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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0 || ^4.0.0"
6
6
  },
7
- "version": "1.7.3",
7
+ "version": "1.7.5",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <div ref="trigger" @click="togglePopover()">
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 (typeof option === "string") return modelValue.value === option;
67
- return !!(
68
- flatModalValue.value &&
69
- (flatModalValue.value === (option as T)[key.value] ||
70
- (flatModalValue.value as string[]).includes(
71
- (option as T)[key.value] as string,
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orio-ui",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Modern Nuxt component library with theme support",
5
5
  "type": "module",
6
6
  "main": "./dist/module.mjs",