@dataloop-ai/components 0.17.106 → 0.17.108
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/App.vue +1 -1
- package/src/assets/constants.scss +2 -1
- package/src/components/basic/DlPopup/DlPopup.vue +1 -1
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +5 -3
- package/src/components/compound/DlSelect/DlSelect.vue +20 -9
- package/src/demos/DlMenuDemo.vue +130 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -462,7 +462,7 @@ export default defineComponent({
|
|
|
462
462
|
|
|
463
463
|
<style lang="scss" scoped>
|
|
464
464
|
.dl-popup {
|
|
465
|
-
z-index:
|
|
465
|
+
z-index: var(--dl-z-index-popup);
|
|
466
466
|
position: fixed !important;
|
|
467
467
|
padding: var(--dl-popup-padding, 10px 0 16px 0);
|
|
468
468
|
border: 1px solid var(--dl-color-separator);
|
|
@@ -223,7 +223,7 @@ export default defineComponent({
|
|
|
223
223
|
right: 0;
|
|
224
224
|
bottom: 0;
|
|
225
225
|
left: 0;
|
|
226
|
-
z-index: var(--dl-z-index-
|
|
226
|
+
z-index: var(--dl-z-index-dialog);
|
|
227
227
|
overflow-x: hidden;
|
|
228
228
|
overflow-y: hidden;
|
|
229
229
|
text-align: start;
|
|
@@ -239,7 +239,9 @@ export default defineComponent({
|
|
|
239
239
|
bottom: 0;
|
|
240
240
|
left: 0;
|
|
241
241
|
background-color: var(--dl-backdrop-color);
|
|
242
|
-
z-index: var(
|
|
242
|
+
z-index: var(
|
|
243
|
+
--dl-z-index-dialog
|
|
244
|
+
); // todo: check if this should be overlay instead.
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
.dialog-wrapper {
|
|
@@ -251,7 +253,7 @@ export default defineComponent({
|
|
|
251
253
|
border-radius: 2px;
|
|
252
254
|
display: flex;
|
|
253
255
|
flex-direction: column;
|
|
254
|
-
z-index: var(--dl-z-index-
|
|
256
|
+
z-index: var(--dl-z-index-dialog);
|
|
255
257
|
|
|
256
258
|
&--fullscreen {
|
|
257
259
|
margin: 0;
|
|
@@ -281,13 +281,10 @@
|
|
|
281
281
|
name="option"
|
|
282
282
|
/>
|
|
283
283
|
<template v-else>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
getOptionLabel(option).toLowerCase()
|
|
289
|
-
: getOptionLabel(option)
|
|
290
|
-
}}
|
|
284
|
+
<span
|
|
285
|
+
class="inner-option"
|
|
286
|
+
v-html="getOptionHtml(option)"
|
|
287
|
+
/>
|
|
291
288
|
</template>
|
|
292
289
|
</dl-select-option>
|
|
293
290
|
<dl-list-item v-if="hasAfterOptions && !noOptions">
|
|
@@ -418,6 +415,7 @@ export default defineComponent({
|
|
|
418
415
|
const selectedIndex = ref(-1)
|
|
419
416
|
const highlightedIndex = ref(-1)
|
|
420
417
|
const isEmpty = ref(true)
|
|
418
|
+
const searchInputValue = ref('')
|
|
421
419
|
const MAX_ITEMS_PER_LIST = 100 // HARDCODED - max items per list before virtual scroll
|
|
422
420
|
|
|
423
421
|
const setHighlightedIndex = (value: any) => {
|
|
@@ -446,7 +444,8 @@ export default defineComponent({
|
|
|
446
444
|
selectedIndex,
|
|
447
445
|
setHighlightedIndex,
|
|
448
446
|
handleSelectedItem,
|
|
449
|
-
handleModelValueUpdate
|
|
447
|
+
handleModelValueUpdate,
|
|
448
|
+
searchInputValue
|
|
450
449
|
}
|
|
451
450
|
},
|
|
452
451
|
computed: {
|
|
@@ -817,7 +816,19 @@ export default defineComponent({
|
|
|
817
816
|
(this.$refs.menu as any)?.updatePosition()
|
|
818
817
|
})
|
|
819
818
|
}
|
|
820
|
-
|
|
819
|
+
const searchValue = (e.target as HTMLInputElement).value
|
|
820
|
+
this.searchInputValue = searchValue
|
|
821
|
+
this.$emit('search-input', searchValue)
|
|
822
|
+
},
|
|
823
|
+
getOptionHtml(option: DlSelectOptionType) {
|
|
824
|
+
return `<span>${(this.capitalizedOptions
|
|
825
|
+
? typeof this.getOptionLabel(option) === 'string' &&
|
|
826
|
+
this.getOptionLabel(option).toLowerCase()
|
|
827
|
+
: this.getOptionLabel(option)
|
|
828
|
+
).replace(
|
|
829
|
+
this.searchInputValue,
|
|
830
|
+
`<span style="background: var(--dl-color-warning)">${this.searchInputValue}</span>`
|
|
831
|
+
)}</span>`
|
|
821
832
|
},
|
|
822
833
|
handleSearchBlur(e: Event): void {
|
|
823
834
|
if (this.search) {
|
package/src/demos/DlMenuDemo.vue
CHANGED
|
@@ -507,6 +507,31 @@
|
|
|
507
507
|
</dl-list>
|
|
508
508
|
</dl-menu>
|
|
509
509
|
</dl-button>
|
|
510
|
+
|
|
511
|
+
<h4>With max height with alot of elements</h4>
|
|
512
|
+
<dl-button :label="arrowNavigationLabel">
|
|
513
|
+
<dl-menu
|
|
514
|
+
max-height="250px"
|
|
515
|
+
self="bottom middle"
|
|
516
|
+
anchor="top middle"
|
|
517
|
+
:offset="[50, 5]"
|
|
518
|
+
@show="onShow"
|
|
519
|
+
@hide="onHide"
|
|
520
|
+
>
|
|
521
|
+
<dl-list style="min-width: 100px">
|
|
522
|
+
<dl-list-item
|
|
523
|
+
v-for="(item, index) in alotOfListItems"
|
|
524
|
+
:key="index"
|
|
525
|
+
clickable
|
|
526
|
+
:is-highlighted="index === highlightedIndex"
|
|
527
|
+
>
|
|
528
|
+
<dl-item-section>
|
|
529
|
+
{{ item }}
|
|
530
|
+
</dl-item-section>
|
|
531
|
+
</dl-list-item>
|
|
532
|
+
</dl-list>
|
|
533
|
+
</dl-menu>
|
|
534
|
+
</dl-button>
|
|
510
535
|
</div>
|
|
511
536
|
</div>
|
|
512
537
|
</div>
|
|
@@ -551,6 +576,109 @@ export default defineComponent({
|
|
|
551
576
|
'Help & Feedback'
|
|
552
577
|
])
|
|
553
578
|
|
|
579
|
+
const alotOfListItems = ref([
|
|
580
|
+
'New tab0',
|
|
581
|
+
'New incognito tab1',
|
|
582
|
+
'Recent tabs2',
|
|
583
|
+
'History3',
|
|
584
|
+
'Downloads4',
|
|
585
|
+
'Settings5',
|
|
586
|
+
'Help & Feedback6',
|
|
587
|
+
'New tab7',
|
|
588
|
+
'New incognito tab8',
|
|
589
|
+
'Recent tabs9',
|
|
590
|
+
'History10',
|
|
591
|
+
'Downloads11',
|
|
592
|
+
'Settings12',
|
|
593
|
+
'Help & Feedback13',
|
|
594
|
+
'New tab14',
|
|
595
|
+
'New incognito tab15',
|
|
596
|
+
'Recent tabs16',
|
|
597
|
+
'History17',
|
|
598
|
+
'Downloads18',
|
|
599
|
+
'Settings19',
|
|
600
|
+
'Help & Feedback20',
|
|
601
|
+
'New tab21',
|
|
602
|
+
'New incognito tab22',
|
|
603
|
+
'Recent tabs23',
|
|
604
|
+
'History24',
|
|
605
|
+
'Downloads25',
|
|
606
|
+
'Settings26',
|
|
607
|
+
'Help & Feedback27',
|
|
608
|
+
'New tab28',
|
|
609
|
+
'New incognito tab29',
|
|
610
|
+
'Recent tabs30',
|
|
611
|
+
'History31',
|
|
612
|
+
'Downloads32',
|
|
613
|
+
'Settings33',
|
|
614
|
+
'Help & Feedback34',
|
|
615
|
+
'New tab35',
|
|
616
|
+
'New incognito tab36',
|
|
617
|
+
'Recent tabs37',
|
|
618
|
+
'History38',
|
|
619
|
+
'Downloads39',
|
|
620
|
+
'Settings40',
|
|
621
|
+
'Help & Feedback41',
|
|
622
|
+
'New tab42',
|
|
623
|
+
'New incognito tab43',
|
|
624
|
+
'Recent tabs44',
|
|
625
|
+
'History45',
|
|
626
|
+
'Downloads46',
|
|
627
|
+
'Settings47',
|
|
628
|
+
'Help & Feedback48',
|
|
629
|
+
'New tab49',
|
|
630
|
+
'New incognito tab50',
|
|
631
|
+
'Recent tabs51',
|
|
632
|
+
'History52',
|
|
633
|
+
'Downloads53',
|
|
634
|
+
'Settings54',
|
|
635
|
+
'Help & Feedback55',
|
|
636
|
+
'New tab56',
|
|
637
|
+
'New incognito tab57',
|
|
638
|
+
'Recent tabs58',
|
|
639
|
+
'History59',
|
|
640
|
+
'Downloads60',
|
|
641
|
+
'Settings61',
|
|
642
|
+
'Help & Feedback62',
|
|
643
|
+
'New tab63',
|
|
644
|
+
'New incognito tab64',
|
|
645
|
+
'Recent tabs65',
|
|
646
|
+
'History66',
|
|
647
|
+
'Downloads67',
|
|
648
|
+
'Settings68',
|
|
649
|
+
'Help & Feedback69',
|
|
650
|
+
'New tab70',
|
|
651
|
+
'New incognito tab71',
|
|
652
|
+
'Recent tabs72',
|
|
653
|
+
'History73',
|
|
654
|
+
'Downloads74',
|
|
655
|
+
'Settings75',
|
|
656
|
+
'Help & Feedback76',
|
|
657
|
+
'New tab77',
|
|
658
|
+
'New incognito tab78',
|
|
659
|
+
'Recent tabs79',
|
|
660
|
+
'History80',
|
|
661
|
+
'Downloads81',
|
|
662
|
+
'Settings82',
|
|
663
|
+
'Help & Feedback83',
|
|
664
|
+
'New tab84',
|
|
665
|
+
'New incognito tab85',
|
|
666
|
+
'Recent tabs86',
|
|
667
|
+
'History87',
|
|
668
|
+
'Downloads88',
|
|
669
|
+
'Settings89',
|
|
670
|
+
'Help & Feedback90',
|
|
671
|
+
'New tab91',
|
|
672
|
+
'New incognito tab92',
|
|
673
|
+
'Recent tabs93',
|
|
674
|
+
'History94',
|
|
675
|
+
'Downloads95',
|
|
676
|
+
'Settings96',
|
|
677
|
+
'Help & Feedback97',
|
|
678
|
+
'New tab98',
|
|
679
|
+
'New incognito tab99'
|
|
680
|
+
])
|
|
681
|
+
|
|
554
682
|
const onShow = (value: any) => {
|
|
555
683
|
isMenuOpen.value = !!value
|
|
556
684
|
}
|
|
@@ -578,7 +706,8 @@ export default defineComponent({
|
|
|
578
706
|
isMenuOpen,
|
|
579
707
|
selectedItem,
|
|
580
708
|
highlightedIndex,
|
|
581
|
-
arrowNavigationLabel
|
|
709
|
+
arrowNavigationLabel,
|
|
710
|
+
alotOfListItems
|
|
582
711
|
}
|
|
583
712
|
}
|
|
584
713
|
})
|