@dataloop-ai/components 0.17.116 → 0.17.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/basic/DlPopup/DlPopup.vue +8 -3
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +10 -4
- package/src/components/compound/DlSelect/DlSelect.vue +55 -49
- package/src/components/essential/DlMenu/DlMenu.vue +12 -2
- package/src/demos/DlSelectDemo.vue +8 -4
package/package.json
CHANGED
|
@@ -167,7 +167,11 @@ export default defineComponent({
|
|
|
167
167
|
maxWidth: { type: String, default: 'auto' },
|
|
168
168
|
height: { type: String, default: 'auto' },
|
|
169
169
|
width: { type: String, default: 'auto' },
|
|
170
|
-
draggable: Boolean
|
|
170
|
+
draggable: Boolean,
|
|
171
|
+
zIndex: {
|
|
172
|
+
type: [Number, String],
|
|
173
|
+
default: 'var(--dl-z-index-popup)'
|
|
174
|
+
}
|
|
171
175
|
},
|
|
172
176
|
emits: [
|
|
173
177
|
'close-button-click',
|
|
@@ -254,7 +258,8 @@ export default defineComponent({
|
|
|
254
258
|
'--popup-max-width': props.maxWidth,
|
|
255
259
|
'--popup-max-height': props.maxHeight,
|
|
256
260
|
'--popup-width': props.width,
|
|
257
|
-
'--popup-height': props.height
|
|
261
|
+
'--popup-height': props.height,
|
|
262
|
+
'--popup-z-index': props.zIndex ?? 'var(--dl-z-index-popup)'
|
|
258
263
|
}
|
|
259
264
|
})
|
|
260
265
|
|
|
@@ -462,7 +467,7 @@ export default defineComponent({
|
|
|
462
467
|
|
|
463
468
|
<style lang="scss" scoped>
|
|
464
469
|
.dl-popup {
|
|
465
|
-
z-index: var(--
|
|
470
|
+
z-index: var(--popup-z-index);
|
|
466
471
|
position: fixed !important;
|
|
467
472
|
padding: var(--dl-popup-padding, 10px 0 16px 0);
|
|
468
473
|
border: 1px solid var(--dl-color-separator);
|
|
@@ -90,6 +90,10 @@ export default defineComponent({
|
|
|
90
90
|
draggable: {
|
|
91
91
|
type: Boolean,
|
|
92
92
|
default: false
|
|
93
|
+
},
|
|
94
|
+
zIndex: {
|
|
95
|
+
type: [Number, String],
|
|
96
|
+
default: 'var(--dl-z-index-dialog)'
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
99
|
emits: ['update:modelValue', 'hide', 'show'],
|
|
@@ -131,7 +135,9 @@ export default defineComponent({
|
|
|
131
135
|
typeof this.width === 'string'
|
|
132
136
|
? parseInt(this.width)
|
|
133
137
|
: this.width / 2
|
|
134
|
-
}px
|
|
138
|
+
}px`,
|
|
139
|
+
'--dialog-z-index':
|
|
140
|
+
`${this.zIndex}` ?? 'var(--dl-z-index-dialog)'
|
|
135
141
|
}
|
|
136
142
|
},
|
|
137
143
|
iconStyles(): Record<string, string> {
|
|
@@ -223,7 +229,7 @@ export default defineComponent({
|
|
|
223
229
|
right: 0;
|
|
224
230
|
bottom: 0;
|
|
225
231
|
left: 0;
|
|
226
|
-
z-index: var(--
|
|
232
|
+
z-index: var(--dialog-z-index);
|
|
227
233
|
overflow-x: hidden;
|
|
228
234
|
overflow-y: hidden;
|
|
229
235
|
text-align: start;
|
|
@@ -240,7 +246,7 @@ export default defineComponent({
|
|
|
240
246
|
left: 0;
|
|
241
247
|
background-color: var(--dl-backdrop-color);
|
|
242
248
|
z-index: var(
|
|
243
|
-
--
|
|
249
|
+
--dialog-z-index
|
|
244
250
|
); // todo: check if this should be overlay instead.
|
|
245
251
|
}
|
|
246
252
|
|
|
@@ -253,7 +259,7 @@ export default defineComponent({
|
|
|
253
259
|
border-radius: 2px;
|
|
254
260
|
display: flex;
|
|
255
261
|
flex-direction: column;
|
|
256
|
-
z-index: var(--
|
|
262
|
+
z-index: var(--dialog-z-index);
|
|
257
263
|
|
|
258
264
|
&--fullscreen {
|
|
259
265
|
margin: 0;
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
{{ computedAllItemsLabel }}
|
|
199
199
|
</template>
|
|
200
200
|
</dl-select-option>
|
|
201
|
+
|
|
201
202
|
<!-- Virtual scroll -->
|
|
202
203
|
<dl-virtual-scroll
|
|
203
204
|
v-if="optionsCount > MAX_ITEMS_PER_LIST"
|
|
@@ -249,48 +250,47 @@
|
|
|
249
250
|
</template>
|
|
250
251
|
</dl-select-option>
|
|
251
252
|
</dl-virtual-scroll>
|
|
252
|
-
|
|
253
253
|
<!-- Else normal list -->
|
|
254
|
-
<
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
</
|
|
293
|
-
</
|
|
254
|
+
<div v-else>
|
|
255
|
+
<dl-select-option
|
|
256
|
+
v-for="(option, optionIndex) in options"
|
|
257
|
+
:key="getKeyForOption(option)"
|
|
258
|
+
clickable
|
|
259
|
+
:multiselect="multiselect"
|
|
260
|
+
:class="{
|
|
261
|
+
selected:
|
|
262
|
+
option === selectedOption &&
|
|
263
|
+
highlightSelected
|
|
264
|
+
}"
|
|
265
|
+
:style="
|
|
266
|
+
optionIndex === highlightedIndex
|
|
267
|
+
? 'background-color: var(--dl-color-fill)'
|
|
268
|
+
: ''
|
|
269
|
+
"
|
|
270
|
+
:with-wave="withWave"
|
|
271
|
+
:model-value="modelValue"
|
|
272
|
+
:value="getOptionValue(option)"
|
|
273
|
+
:highlight-selected="highlightSelected"
|
|
274
|
+
:count="getOptionCount(option)"
|
|
275
|
+
:children="getOptionChildren(option)"
|
|
276
|
+
:capitalized="capitalizedOptions"
|
|
277
|
+
@update:model-value="handleModelValueUpdate"
|
|
278
|
+
@click="selectOption(option)"
|
|
279
|
+
@selected="handleSelected"
|
|
280
|
+
@deselected="handleDeselected"
|
|
281
|
+
@depth-change="handleDepthChange"
|
|
282
|
+
>
|
|
283
|
+
<slot
|
|
284
|
+
:opt="option"
|
|
285
|
+
name="option"
|
|
286
|
+
>
|
|
287
|
+
<span
|
|
288
|
+
class="inner-option"
|
|
289
|
+
v-html="getOptionHtml(option)"
|
|
290
|
+
/>
|
|
291
|
+
</slot>
|
|
292
|
+
</dl-select-option>
|
|
293
|
+
</div>
|
|
294
294
|
<dl-list-item v-if="hasAfterOptions && !noOptions">
|
|
295
295
|
<dl-item-section>
|
|
296
296
|
<slot name="after-options" />
|
|
@@ -793,7 +793,8 @@ export default defineComponent({
|
|
|
793
793
|
: this.options[this.selectedIndex]
|
|
794
794
|
|
|
795
795
|
if (this.search) {
|
|
796
|
-
|
|
796
|
+
const searchInput = this.$refs.searchInput as HTMLInputElement
|
|
797
|
+
searchInput.value =
|
|
797
798
|
typeof selectedOption === 'string'
|
|
798
799
|
? selectedOption
|
|
799
800
|
: (selectedOption as Record<string, any>)?.label
|
|
@@ -817,7 +818,8 @@ export default defineComponent({
|
|
|
817
818
|
(e.target as HTMLInputElement).value.trim() === ''
|
|
818
819
|
|
|
819
820
|
this.$nextTick(() => {
|
|
820
|
-
|
|
821
|
+
const menu = this.$refs.menu as any
|
|
822
|
+
menu?.updatePosition()
|
|
821
823
|
})
|
|
822
824
|
}
|
|
823
825
|
const searchValue = (e.target as HTMLInputElement).value
|
|
@@ -825,14 +827,18 @@ export default defineComponent({
|
|
|
825
827
|
this.$emit('search-input', searchValue)
|
|
826
828
|
},
|
|
827
829
|
getOptionHtml(option: DlSelectOptionType) {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
830
|
+
let label = `${this.getOptionLabel(option)}`
|
|
831
|
+
if (this.capitalizedOptions) {
|
|
832
|
+
label = label.toLowerCase()
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const highlightedHtml = label.replace(
|
|
833
836
|
this.searchInputValue,
|
|
834
837
|
`<span style="background: var(--dl-color-warning)">${this.searchInputValue}</span>`
|
|
835
|
-
)
|
|
838
|
+
)
|
|
839
|
+
const html = `<span>${highlightedHtml}</span>`
|
|
840
|
+
|
|
841
|
+
return html
|
|
836
842
|
},
|
|
837
843
|
handleSearchBlur(e: Event): void {
|
|
838
844
|
if (this.search) {
|
|
@@ -145,6 +145,10 @@ export default defineComponent({
|
|
|
145
145
|
arrowNavItems: {
|
|
146
146
|
type: [String, Array, Object],
|
|
147
147
|
default: () => [] as any[]
|
|
148
|
+
},
|
|
149
|
+
zIndex: {
|
|
150
|
+
type: [Number, String],
|
|
151
|
+
default: 'var(--dl-z-index-menu)'
|
|
148
152
|
}
|
|
149
153
|
},
|
|
150
154
|
|
|
@@ -432,7 +436,13 @@ export default defineComponent({
|
|
|
432
436
|
portalEl: isVue2 ? '[data-test-id="portal"]' : portalEl,
|
|
433
437
|
portalIsActive,
|
|
434
438
|
classes: 'dl-menu dl-position-engine scroll' + classes.value,
|
|
435
|
-
styles: [
|
|
439
|
+
styles: [
|
|
440
|
+
attrs.style,
|
|
441
|
+
transitionStyle.value,
|
|
442
|
+
{
|
|
443
|
+
'--menu-z-index': props.zIndex ?? 'var(--dl-z-index-menu)'
|
|
444
|
+
}
|
|
445
|
+
] as any,
|
|
436
446
|
selectedItem,
|
|
437
447
|
highlightedIndex
|
|
438
448
|
}
|
|
@@ -457,7 +467,7 @@ export default defineComponent({
|
|
|
457
467
|
}
|
|
458
468
|
outline: 0;
|
|
459
469
|
max-height: 65vh;
|
|
460
|
-
z-index: var(--
|
|
470
|
+
z-index: var(--menu-z-index);
|
|
461
471
|
|
|
462
472
|
&--square {
|
|
463
473
|
border-radius: 0;
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
</dl-select>
|
|
217
217
|
With tooltip
|
|
218
218
|
<dl-select
|
|
219
|
-
v-model="
|
|
219
|
+
v-model="select2"
|
|
220
220
|
title="With tooltip"
|
|
221
221
|
:tooltip="'Test Me'"
|
|
222
222
|
:options="[
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
</dl-select>
|
|
252
252
|
Small size
|
|
253
253
|
<dl-select
|
|
254
|
-
v-model="
|
|
254
|
+
v-model="select3"
|
|
255
255
|
:size="'s'"
|
|
256
256
|
:options="[
|
|
257
257
|
{
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
</dl-select>
|
|
286
286
|
Small size with tooltip
|
|
287
287
|
<dl-select
|
|
288
|
-
v-model="
|
|
288
|
+
v-model="select4"
|
|
289
289
|
:size="'s'"
|
|
290
290
|
title="test"
|
|
291
291
|
tooltip="test me"
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
|
|
323
323
|
Select with max-height
|
|
324
324
|
<dl-select
|
|
325
|
-
v-model="
|
|
325
|
+
v-model="select5"
|
|
326
326
|
:size="'s'"
|
|
327
327
|
title="test"
|
|
328
328
|
dropdown-max-height="50px"
|
|
@@ -484,6 +484,10 @@ export default defineComponent({
|
|
|
484
484
|
bgColor: 'dl-color-error',
|
|
485
485
|
textColor: 'dl-color-white'
|
|
486
486
|
},
|
|
487
|
+
select2: null,
|
|
488
|
+
select3: null,
|
|
489
|
+
select4: null,
|
|
490
|
+
select5: null,
|
|
487
491
|
statusOption: {
|
|
488
492
|
label: 'Status 1',
|
|
489
493
|
value: 1,
|