orio-ui 1.7.3 → 1.7.5
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/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div ref="trigger"
|
|
3
|
+
<div ref="trigger">
|
|
4
4
|
<slot :toggle="togglePopover" />
|
|
5
5
|
</div>
|
|
6
6
|
|
|
@@ -202,6 +202,7 @@ async function updateRects() {
|
|
|
202
202
|
async function togglePopover(force: boolean | null = null) {
|
|
203
203
|
if (props.disabled) return;
|
|
204
204
|
showPopover.value = force !== null ? force : !showPopover.value;
|
|
205
|
+
|
|
205
206
|
if (!showPopover.value) return;
|
|
206
207
|
|
|
207
208
|
await nextTick();
|
|
@@ -63,14 +63,16 @@ function toggleOption(option: SelectableOption, toggle: () => void) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function isOptionSelected(option: SelectableOption): boolean {
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
(flatModalValue.value
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
if (props.multiple) {
|
|
67
|
+
const flatOption =
|
|
68
|
+
typeof option === "string" ? option : (option as T)[key.value];
|
|
69
|
+
return (flatModalValue.value as string[]).includes(flatOption as string);
|
|
70
|
+
} else {
|
|
71
|
+
if (typeof option === "string") return modelValue.value === option;
|
|
72
|
+
return !!(
|
|
73
|
+
flatModalValue.value && flatModalValue.value === (option as T)[key.value]
|
|
74
|
+
);
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
function getOptionLabel(option: SelectableOption | undefined): string {
|
|
@@ -93,7 +95,7 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
|
|
|
93
95
|
<orio-popover position="bottom-right" :offset="5">
|
|
94
96
|
<template #default="{ toggle }">
|
|
95
97
|
<slot name="trigger" :toggle>
|
|
96
|
-
<div class="selector-trigger">
|
|
98
|
+
<div class="selector-trigger" @click="toggle()">
|
|
97
99
|
<slot
|
|
98
100
|
name="trigger-content"
|
|
99
101
|
:toggle
|