Skip to content

Commit 4ff8490

Browse files
authored
PATCH: Fix/select/component (#420)
* add rounded elements options for select component * add documentation
1 parent e5bb3b5 commit 4ff8490

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

src/BIMDataComponents/BIMDataSelect/BIMDataSelect.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
padding-left: calc(var(--spacing-unit) * 2);
9999
}
100100
}
101+
102+
&.rounded-element {
103+
.bimdata-select__option-list__entry {
104+
border-radius: 50px;
105+
}
106+
}
101107
}
102108

103109
&.default {

src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default {
5050
type: Boolean,
5151
default: false,
5252
},
53+
isSelectedAndHoveredElementsRounded: {
54+
type: Boolean,
55+
default: false,
56+
},
5357
},
5458
emits: ["update:modelValue"],
5559
setup(props, { emit, slots }) {

src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424

2525
<transition name="slide-fade-down">
26-
<div v-show="!disabled && isOpen" class="bimdata-select__option-list">
26+
<div v-show="!disabled && isOpen" class="bimdata-select__option-list" :class="{ 'rounded-element': isSelectedAndHoveredElementsRounded }">
2727
<BIMDataSearch
2828
v-if="search"
2929
width="calc(100% - 12px)"
@@ -137,10 +137,13 @@ export default {
137137
type: String,
138138
default: "Search",
139139
},
140-
141140
width: {
142141
type: [String, Number],
143142
},
143+
isSelectedAndHoveredElementsRounded: {
144+
type: Boolean,
145+
default: false,
146+
},
144147
},
145148
emits: ["update:modelValue"],
146149
data() {

src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323

2424
<transition name="slide-fade-down">
25-
<div v-show="!disabled && isOpen" class="bimdata-select__option-list">
25+
<div v-show="!disabled && isOpen" class="bimdata-select__option-list" :class="{ 'rounded-element': isSelectedAndHoveredElementsRounded }">
2626
<BIMDataSearch
2727
v-if="search"
2828
width="calc(100% - 12px)"
@@ -144,6 +144,10 @@ export default {
144144
validator: value =>
145145
["primary", "secondary", "tertiary", "quaternary", "quaternary-light"].includes(value),
146146
},
147+
isSelectedAndHoveredElementsRounded: {
148+
type: Boolean,
149+
default: false,
150+
},
147151
},
148152
emits: ["update:modelValue"],
149153
data() {

src/web/views/Components/Select/Select.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
:disabled="isDisabled"
1414
:multi="isMulti"
1515
:search="search"
16+
:isSelectedAndHoveredElementsRounded="isSelectedAndHoveredElementsRounded"
1617
width="200px"
1718
label="Selector label"
1819
:options="options"
@@ -80,6 +81,13 @@
8081
@update:modelValue="toggleClearSearch"
8182
/>
8283
</div>
84+
<div class="m-t-6">
85+
<BIMDataCheckbox
86+
text="Rounded selected and hovered elements"
87+
:modelValue="isSelectedAndHoveredElementsRounded"
88+
@update:modelValue="toggleSelectedAndHoveredElementsRounded"
89+
/>
90+
</div>
8391

8492
<div v-for="(setting, key) in colorSettings" :key="key">
8593
<BIMDataText
@@ -257,6 +265,7 @@ export default {
257265
eventsData,
258266
slotsData,
259267
search: false,
268+
isSelectedAndHoveredElementsRounded: false,
260269
searchText: "",
261270
colorSettings: {
262271
color: {
@@ -317,6 +326,9 @@ export default {
317326
toggleClearSearch(value) {
318327
this.clearSearch = value;
319328
},
329+
toggleSelectedAndHoveredElementsRounded(value) {
330+
this.isSelectedAndHoveredElementsRounded = value;
331+
},
320332
getEmptySlot() {
321333
if (this.isEmpty) {
322334
return "<template #empty>No result</template>";

src/web/views/Components/Select/props-data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ export default [
5757
],
5858
["resetOnLeave", "Boolean", "false", "In multi-selection mode: clear search bar on click away."],
5959
["search", "Boolean", "false", "Use this boolean to add a search bar."],
60-
["searchColor", "String", "primary", "Set the color of the search input. (e.g. 'primary', 'secondary', 'tertiary', 'quaternary')."],
60+
["searchColor", "String", "primary", "Set the color of the search input. (e.g. 'primary', 'secondary', 'tertiary', 'quaternary', 'quaternary-light')."],
6161
[
6262
"searchPlaceholder",
6363
"String",
6464
"Search",
6565
"Use this props to custom search placeholder.",
6666
],
6767
["width", "[String, Number]", "100%", "Set the selector width."],
68-
68+
["isSelectedAndHoveredElementsRounded", "Boolean", "false", "When true, selected and hovered elements have rounded borders."],
6969
];

0 commit comments

Comments
 (0)