@dataloop-ai/components 0.18.2 → 0.18.3
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
CHANGED
package/src/demos/DlMenuDemo.vue
CHANGED
|
@@ -525,6 +525,32 @@
|
|
|
525
525
|
</dl-button>
|
|
526
526
|
</div>
|
|
527
527
|
</div>
|
|
528
|
+
|
|
529
|
+
<h4>With model as button: {{ isOpen }}</h4>
|
|
530
|
+
<dl-button label="test">
|
|
531
|
+
<dl-menu
|
|
532
|
+
v-model="isOpen"
|
|
533
|
+
max-height="250px"
|
|
534
|
+
self="bottom middle"
|
|
535
|
+
anchor="top middle"
|
|
536
|
+
:offset="[50, 5]"
|
|
537
|
+
@show="onShow"
|
|
538
|
+
@hide="onHide"
|
|
539
|
+
>
|
|
540
|
+
<dl-list style="min-width: 100px">
|
|
541
|
+
<dl-list-item
|
|
542
|
+
v-for="(item, index) in alotOfListItems"
|
|
543
|
+
:key="index"
|
|
544
|
+
clickable
|
|
545
|
+
:is-highlighted="index === highlightedIndex"
|
|
546
|
+
>
|
|
547
|
+
<dl-item-section>
|
|
548
|
+
{{ item }}
|
|
549
|
+
</dl-item-section>
|
|
550
|
+
</dl-list-item>
|
|
551
|
+
</dl-list>
|
|
552
|
+
</dl-menu>
|
|
553
|
+
</dl-button>
|
|
528
554
|
</div>
|
|
529
555
|
</template>
|
|
530
556
|
|
|
@@ -556,6 +582,7 @@ export default defineComponent({
|
|
|
556
582
|
const showing = ref(false)
|
|
557
583
|
const isMenuOpen = ref(false)
|
|
558
584
|
const arrowNavigationLabel = ref<ItemType>('Arrow Navigation Label')
|
|
585
|
+
const isOpen = ref(false)
|
|
559
586
|
|
|
560
587
|
const listItems = ref([
|
|
561
588
|
'New tab',
|
|
@@ -694,6 +721,7 @@ export default defineComponent({
|
|
|
694
721
|
listItems,
|
|
695
722
|
onShow,
|
|
696
723
|
onHide,
|
|
724
|
+
isOpen,
|
|
697
725
|
isMenuOpen,
|
|
698
726
|
selectedItem,
|
|
699
727
|
highlightedIndex,
|
|
@@ -121,7 +121,7 @@ export default function useModelToggle({
|
|
|
121
121
|
props[`onUpdate:${modelValueNaming}`] ||
|
|
122
122
|
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
123
123
|
|
|
124
|
-
if (listener
|
|
124
|
+
if (listener) {
|
|
125
125
|
emit(`update:${modelValueNaming}`, false)
|
|
126
126
|
payload = evt
|
|
127
127
|
nextTick(() => {
|
|
@@ -131,7 +131,7 @@ export default function useModelToggle({
|
|
|
131
131
|
})
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (!props.modelValue || listener
|
|
134
|
+
if (!props.modelValue || !listener) {
|
|
135
135
|
processHide(evt)
|
|
136
136
|
}
|
|
137
137
|
}
|