@scalar/components 0.13.20 → 0.13.23

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.
Files changed (84) hide show
  1. package/dist/components/ScalarButton/ScalarButton.stories.d.ts +12 -12
  2. package/dist/components/ScalarButton/ScalarButton.vue.d.ts +1 -1
  3. package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +1 -1
  4. package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts +5 -4
  5. package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts.map +1 -1
  6. package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +4 -4
  7. package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
  8. package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +14 -13
  9. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +2 -5
  10. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
  11. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +37 -26
  12. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts +2 -14
  13. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
  14. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +76 -65
  15. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts.map +1 -1
  16. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +34 -30
  17. package/dist/components/ScalarCombobox/types.d.ts +9 -0
  18. package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
  19. package/dist/components/ScalarContextMenu/ScalarContextMenu.stories.d.ts +3 -3
  20. package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts +3 -3
  21. package/dist/components/ScalarFileUpload/ScalarFileUpload.stories.d.ts +364 -0
  22. package/dist/components/ScalarFileUpload/ScalarFileUpload.stories.d.ts.map +1 -0
  23. package/dist/components/ScalarFileUpload/ScalarFileUpload.test.d.ts +2 -0
  24. package/dist/components/ScalarFileUpload/ScalarFileUpload.test.d.ts.map +1 -0
  25. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts +86 -0
  26. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts.map +1 -0
  27. package/dist/components/ScalarFileUpload/ScalarFileUploadDropTarget.vue.d.ts +19 -0
  28. package/dist/components/ScalarFileUpload/ScalarFileUploadDropTarget.vue.d.ts.map +1 -0
  29. package/dist/components/ScalarFileUpload/ScalarFileUploadError.vue.d.ts +20 -0
  30. package/dist/components/ScalarFileUpload/ScalarFileUploadError.vue.d.ts.map +1 -0
  31. package/dist/components/ScalarFileUpload/ScalarFileUploadFileList.vue.d.ts +22 -0
  32. package/dist/components/ScalarFileUpload/ScalarFileUploadFileList.vue.d.ts.map +1 -0
  33. package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.d.ts +21 -0
  34. package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.d.ts.map +1 -0
  35. package/dist/components/ScalarFileUpload/ScalarFileUploadInputCompact.vue.d.ts +21 -0
  36. package/dist/components/ScalarFileUpload/ScalarFileUploadInputCompact.vue.d.ts.map +1 -0
  37. package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.d.ts +16 -0
  38. package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.d.ts.map +1 -0
  39. package/dist/components/ScalarFileUpload/index.d.ts +8 -0
  40. package/dist/components/ScalarFileUpload/index.d.ts.map +1 -0
  41. package/dist/components/ScalarFileUpload/types.d.ts +32 -0
  42. package/dist/components/ScalarFileUpload/types.d.ts.map +1 -0
  43. package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts +9 -9
  44. package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +3 -3
  45. package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
  46. package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +3 -3
  47. package/dist/components/ScalarPopover/ScalarPopover.stories.d.ts +3 -3
  48. package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts +3 -2
  49. package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts.map +1 -1
  50. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts +31 -0
  51. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -0
  52. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +63 -0
  53. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue2.js +4 -0
  54. package/dist/components/ScalarSidebar/ScalarSidebarGroup.test.d.ts +2 -0
  55. package/dist/components/ScalarSidebar/ScalarSidebarGroup.test.d.ts.map +1 -0
  56. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +50 -0
  57. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -0
  58. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +47 -0
  59. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue2.js +4 -0
  60. package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts +50 -0
  61. package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts.map +1 -0
  62. package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +39 -0
  63. package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue2.js +4 -0
  64. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts +27 -0
  65. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts.map +1 -0
  66. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +34 -0
  67. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue2.js +4 -0
  68. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.d.ts +28 -0
  69. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.d.ts.map +1 -0
  70. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +22 -0
  71. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +4 -0
  72. package/dist/components/ScalarSidebar/index.d.ts +5 -0
  73. package/dist/components/ScalarSidebar/index.d.ts.map +1 -1
  74. package/dist/components/ScalarSidebar/types.d.ts +25 -0
  75. package/dist/components/ScalarSidebar/types.d.ts.map +1 -0
  76. package/dist/components/ScalarSidebar/useSidebarGroups.d.ts +25 -0
  77. package/dist/components/ScalarSidebar/useSidebarGroups.d.ts.map +1 -0
  78. package/dist/components/ScalarSidebar/useSidebarGroups.js +11 -0
  79. package/dist/components/ScalarSidebar/useSidebarGroups.test.d.ts +2 -0
  80. package/dist/components/ScalarSidebar/useSidebarGroups.test.d.ts.map +1 -0
  81. package/dist/components/ScalarTooltip/ScalarTooltip.stories.d.ts +3 -3
  82. package/dist/index.js +95 -85
  83. package/dist/style.css +1 -1
  84. package/package.json +5 -4
@@ -8,7 +8,7 @@ declare const meta: {
8
8
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
9
9
  disabled?: boolean;
10
10
  fullWidth?: boolean;
11
- loading?: import("../ScalarLoading").LoadingState;
11
+ loading?: import("../ScalarLoading").LoadingState | undefined;
12
12
  size?: import("./variants.js").Variants["size"];
13
13
  variant?: import("./variants.js").Variants["variant"];
14
14
  type?: "button" | "submit" | "reset";
@@ -27,7 +27,7 @@ declare const meta: {
27
27
  }, Readonly<{
28
28
  disabled?: boolean;
29
29
  fullWidth?: boolean;
30
- loading?: import("../ScalarLoading").LoadingState;
30
+ loading?: import("../ScalarLoading").LoadingState | undefined;
31
31
  size?: import("./variants.js").Variants["size"];
32
32
  variant?: import("./variants.js").Variants["variant"];
33
33
  type?: "button" | "submit" | "reset";
@@ -43,7 +43,7 @@ declare const meta: {
43
43
  } & import("vue").ComponentOptionsBase<Readonly<{
44
44
  disabled?: boolean;
45
45
  fullWidth?: boolean;
46
- loading?: import("../ScalarLoading").LoadingState;
46
+ loading?: import("../ScalarLoading").LoadingState | undefined;
47
47
  size?: import("./variants.js").Variants["size"];
48
48
  variant?: import("./variants.js").Variants["variant"];
49
49
  type?: "button" | "submit" | "reset";
@@ -81,7 +81,7 @@ declare const meta: {
81
81
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
82
82
  disabled?: boolean;
83
83
  fullWidth?: boolean;
84
- loading?: import("../ScalarLoading").LoadingState;
84
+ loading?: import("../ScalarLoading").LoadingState | undefined;
85
85
  size?: import("./variants.js").Variants["size"];
86
86
  variant?: import("./variants.js").Variants["variant"];
87
87
  type?: "button" | "submit" | "reset";
@@ -100,7 +100,7 @@ declare const meta: {
100
100
  }, Readonly<{
101
101
  disabled?: boolean;
102
102
  fullWidth?: boolean;
103
- loading?: import("../ScalarLoading").LoadingState;
103
+ loading?: import("../ScalarLoading").LoadingState | undefined;
104
104
  size?: import("./variants.js").Variants["size"];
105
105
  variant?: import("./variants.js").Variants["variant"];
106
106
  type?: "button" | "submit" | "reset";
@@ -116,7 +116,7 @@ declare const meta: {
116
116
  } & import("vue").ComponentOptionsBase<Readonly<{
117
117
  disabled?: boolean;
118
118
  fullWidth?: boolean;
119
- loading?: import("../ScalarLoading").LoadingState;
119
+ loading?: import("../ScalarLoading").LoadingState | undefined;
120
120
  size?: import("./variants.js").Variants["size"];
121
121
  variant?: import("./variants.js").Variants["variant"];
122
122
  type?: "button" | "submit" | "reset";
@@ -137,7 +137,7 @@ declare const meta: {
137
137
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
138
138
  disabled?: boolean;
139
139
  fullWidth?: boolean;
140
- loading?: import("../ScalarLoading").LoadingState;
140
+ loading?: import("../ScalarLoading").LoadingState | undefined;
141
141
  size?: import("./variants.js").Variants["size"];
142
142
  variant?: import("./variants.js").Variants["variant"];
143
143
  type?: "button" | "submit" | "reset";
@@ -156,7 +156,7 @@ declare const meta: {
156
156
  }, Readonly<{
157
157
  disabled?: boolean;
158
158
  fullWidth?: boolean;
159
- loading?: import("../ScalarLoading").LoadingState;
159
+ loading?: import("../ScalarLoading").LoadingState | undefined;
160
160
  size?: import("./variants.js").Variants["size"];
161
161
  variant?: import("./variants.js").Variants["variant"];
162
162
  type?: "button" | "submit" | "reset";
@@ -172,7 +172,7 @@ declare const meta: {
172
172
  } & import("vue").ComponentOptionsBase<Readonly<{
173
173
  disabled?: boolean;
174
174
  fullWidth?: boolean;
175
- loading?: import("../ScalarLoading").LoadingState;
175
+ loading?: import("../ScalarLoading").LoadingState | undefined;
176
176
  size?: import("./variants.js").Variants["size"];
177
177
  variant?: import("./variants.js").Variants["variant"];
178
178
  type?: "button" | "submit" | "reset";
@@ -194,7 +194,7 @@ declare const meta: {
194
194
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
195
195
  disabled?: boolean;
196
196
  fullWidth?: boolean;
197
- loading?: import("../ScalarLoading").LoadingState;
197
+ loading?: import("../ScalarLoading").LoadingState | undefined;
198
198
  size?: import("./variants.js").Variants["size"];
199
199
  variant?: import("./variants.js").Variants["variant"];
200
200
  type?: "button" | "submit" | "reset";
@@ -213,7 +213,7 @@ declare const meta: {
213
213
  }, Readonly<{
214
214
  disabled?: boolean;
215
215
  fullWidth?: boolean;
216
- loading?: import("../ScalarLoading").LoadingState;
216
+ loading?: import("../ScalarLoading").LoadingState | undefined;
217
217
  size?: import("./variants.js").Variants["size"];
218
218
  variant?: import("./variants.js").Variants["variant"];
219
219
  type?: "button" | "submit" | "reset";
@@ -229,7 +229,7 @@ declare const meta: {
229
229
  } & import("vue").ComponentOptionsBase<Readonly<{
230
230
  disabled?: boolean;
231
231
  fullWidth?: boolean;
232
- loading?: import("../ScalarLoading").LoadingState;
232
+ loading?: import("../ScalarLoading").LoadingState | undefined;
233
233
  size?: import("./variants.js").Variants["size"];
234
234
  variant?: import("./variants.js").Variants["variant"];
235
235
  type?: "button" | "submit" | "reset";
@@ -6,7 +6,7 @@ import { type Variants } from './variants.js';
6
6
  type __VLS_Props = {
7
7
  disabled?: boolean;
8
8
  fullWidth?: boolean;
9
- loading?: LoadingState;
9
+ loading?: LoadingState | undefined;
10
10
  size?: Variants['size'];
11
11
  variant?: Variants['variant'];
12
12
  type?: 'button' | 'submit' | 'reset';
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarButton/ScalarButton.vue"],"names":[],"mappings":"AA6DA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,YAAY,CAAA;AAIpD;;GAEG;AACH,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC7B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;CACrC,CAAC;AAyBJ,iBAAS,cAAc;WAoET,OAAO,IAA6B;;sBAVxB,GAAG;yBACA,GAAG;yBACH,GAAG;;;;EAa/B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;eApHL,OAAO;UAIZ,QAAQ,GAAG,QAAQ,GAAG,OAAO;6EAuHtC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarButton/ScalarButton.vue"],"names":[],"mappings":"AA6DA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,YAAY,CAAA;AAIpD;;GAEG;AACH,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IAClC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC7B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;CACrC,CAAC;AAyBJ,iBAAS,cAAc;WAoET,OAAO,IAA6B;;sBAVxB,GAAG;yBACA,GAAG;yBACH,GAAG;;;;EAa/B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;eApHL,OAAO;UAIZ,QAAQ,GAAG,QAAQ,GAAG,OAAO;6EAuHtC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -40,20 +40,20 @@ declare const meta: {
40
40
  default(props: {
41
41
  open: boolean;
42
42
  }): import("vue").Slot;
43
- before(props: {
43
+ before?(props: {
44
44
  open: boolean;
45
45
  }): import("vue").Slot;
46
- after(props: {
46
+ after?(props: {
47
47
  open: boolean;
48
48
  }): import("vue").Slot;
49
49
  }> & {
50
50
  default(props: {
51
51
  open: boolean;
52
52
  }): import("vue").Slot;
53
- before(props: {
53
+ before?(props: {
54
54
  open: boolean;
55
55
  }): import("vue").Slot;
56
- after(props: {
56
+ after?(props: {
57
57
  open: boolean;
58
58
  }): import("vue").Slot;
59
59
  };
@@ -78,6 +78,7 @@ export declare const Base: Story;
78
78
  export declare const Groups: Story;
79
79
  export declare const Multiselect: Story;
80
80
  export declare const MultiselectGroups: Story;
81
+ export declare const WithSlots: Story;
81
82
  /**
82
83
  * Applies a custom class to the combobox popover
83
84
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarCombobox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarCombobox.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMrD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAElD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa6B,CAAA;AAEvC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAqClC,eAAO,MAAM,IAAI,EAAE,KA0BlB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA0BpB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KA0BzB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KA0B/B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAA"}
1
+ {"version":3,"file":"ScalarCombobox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarCombobox.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMrD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAElD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa6B,CAAA;AAEvC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAqClC,eAAO,MAAM,IAAI,EAAE,KA0BlB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA0BpB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KA0BzB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KA0B/B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAiCvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAA"}
@@ -16,16 +16,16 @@ declare function __VLS_template(): {
16
16
  /** The reference element for the combobox */
17
17
  default(props: SlotProps): Slot;
18
18
  /** A slot for contents before the combobox options */
19
- before(props: SlotProps): Slot;
19
+ before?(props: SlotProps): Slot;
20
20
  /** A slot for contents after the combobox options */
21
- after(props: SlotProps): Slot;
21
+ after?(props: SlotProps): Slot;
22
22
  }> & {
23
23
  /** The reference element for the combobox */
24
24
  default(props: SlotProps): Slot;
25
25
  /** A slot for contents before the combobox options */
26
- before(props: SlotProps): Slot;
26
+ before?(props: SlotProps): Slot;
27
27
  /** A slot for contents after the combobox options */
28
- after(props: SlotProps): Slot;
28
+ after?(props: SlotProps): Slot;
29
29
  };
30
30
  refs: {};
31
31
  rootEl: any;
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarCombobox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarCombobox.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM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AAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,qBAAqB,CAAA;AAEzB,KAAK,SAAS,GAAG;IACf,0CAA0C;IAC1C,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAyBD,iBAAS,cAAc;WAqFT,OAAO,IAA6B;;QAnGhD,6CAA6C;uBAC9B,SAAS,GAAG,IAAI;QAC/B,sDAAsD;uBACvC,SAAS,GAAG,IAAI;QAC/B,qDAAqD;sBACvC,SAAS,GAAG,IAAI;;QAL9B,6CAA6C;uBAC9B,SAAS,GAAG,IAAI;QAC/B,sDAAsD;uBACvC,SAAS,GAAG,IAAI;QAC/B,qDAAqD;sBACvC,SAAS,GAAG,IAAI;;;;EAmG/B;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as m, openBlock as p, createBlock as d, withCtx as l, renderSlot as a, createVNode as s, createSlots as n } from "vue";
2
- import i from "./ScalarComboboxOptions.vue.js";
3
- import f from "./ScalarComboboxPopover.vue.js";
4
- const h = /* @__PURE__ */ m({
1
+ import { defineComponent as m, openBlock as p, createBlock as d, withCtx as l, renderSlot as t, createVNode as s, createSlots as n } from "vue";
2
+ import f from "./ScalarComboboxOptions.vue.js";
3
+ import i from "./ScalarComboboxPopover.vue.js";
4
+ const c = /* @__PURE__ */ m({
5
5
  __name: "ScalarCombobox",
6
6
  props: {
7
7
  options: {},
@@ -16,44 +16,45 @@ const h = /* @__PURE__ */ m({
16
16
  },
17
17
  emits: ["update:modelValue"],
18
18
  setup(u) {
19
- return (e, V) => (p(), d(f, {
19
+ return (e, V) => (p(), d(i, {
20
20
  middleware: e.middleware,
21
+ offset: e.offset,
21
22
  placement: e.placement ?? "bottom-start",
22
23
  resize: e.resize,
23
24
  target: e.target,
24
25
  teleport: e.teleport
25
26
  }, {
26
27
  default: l(({ open: o }) => [
27
- a(e.$slots, "default", { open: o })
28
+ t(e.$slots, "default", { open: o })
28
29
  ]),
29
- popover: l(({ open: o, close: t }) => [
30
- s(i, {
30
+ popover: l(({ open: o, close: a }) => [
31
+ s(f, {
31
32
  modelValue: e.modelValue ? [e.modelValue] : [],
32
33
  open: o,
33
34
  options: e.options,
34
35
  placeholder: e.placeholder,
35
- "onUpdate:modelValue": (r) => (t(), e.$emit("update:modelValue", r[0]))
36
+ "onUpdate:modelValue": (r) => (a(), e.$emit("update:modelValue", r[0]))
36
37
  }, n({ _: 2 }, [
37
38
  e.$slots.before ? {
38
39
  name: "before",
39
40
  fn: l(() => [
40
- a(e.$slots, "before", { open: o })
41
+ t(e.$slots, "before", { open: o })
41
42
  ]),
42
43
  key: "0"
43
44
  } : void 0,
44
45
  e.$slots.after ? {
45
46
  name: "after",
46
47
  fn: l(() => [
47
- a(e.$slots, "after", { open: o })
48
+ t(e.$slots, "after", { open: o })
48
49
  ]),
49
50
  key: "1"
50
51
  } : void 0
51
52
  ]), 1032, ["modelValue", "open", "options", "placeholder", "onUpdate:modelValue"])
52
53
  ]),
53
54
  _: 3
54
- }, 8, ["middleware", "placement", "resize", "target", "teleport"]));
55
+ }, 8, ["middleware", "offset", "placement", "resize", "target", "teleport"]));
55
56
  }
56
57
  });
57
58
  export {
58
- h as default
59
+ c as default
59
60
  };
@@ -1,5 +1,5 @@
1
1
  import type { ScalarFloatingOptions } from '../ScalarFloating';
2
- import type { Option, OptionGroup } from './types.js';
2
+ import type { ComboboxSlots, Option, OptionGroup } from './types.js';
3
3
  type __VLS_Props = {
4
4
  options: Option[] | OptionGroup[];
5
5
  modelValue?: Option[];
@@ -8,10 +8,7 @@ type __VLS_Props = {
8
8
  } & ScalarFloatingOptions;
9
9
  declare function __VLS_template(): {
10
10
  attrs: Partial<{}>;
11
- slots: {
12
- default?(_: {}): any;
13
- actions?(_: {}): any;
14
- };
11
+ slots: Readonly<ComboboxSlots> & ComboboxSlots;
15
12
  refs: {
16
13
  comboboxPopoverRef: ({
17
14
  $: import("vue").ComponentInternalInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarComboboxMultiselect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarComboboxMultiselect.vue"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIlD,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,GAAG,qBAAqB,CAAC;AAuB5B,iBAAS,cAAc;WA6FT,OAAO,IAA6B;;yBAVrB,GAAG;yBACF,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAzHjC,KApBgB,eAoBhB,KApBoC,uBAoBpC,KAnBqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkM6riB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAxCv0iB;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;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B,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,10 +1,7 @@
1
- import { defineComponent as m, ref as u, openBlock as t, createBlock as a, withCtx as s, createElementVNode as f, createCommentVNode as i, createElementBlock as b, renderSlot as p } from "vue";
2
- import c from "./ScalarComboboxOptions.vue.js";
1
+ import { defineComponent as d, ref as f, openBlock as p, createBlock as n, withCtx as l, createSlots as u, renderSlot as a, createCommentVNode as b } from "vue";
2
+ import $ from "./ScalarComboboxOptions.vue.js";
3
3
  import V from "./ScalarComboboxPopover.vue.js";
4
- const v = { class: "divide-1 divide-y" }, y = {
5
- key: 1,
6
- class: "p-0.75"
7
- }, h = /* @__PURE__ */ m({
4
+ const w = /* @__PURE__ */ d({
8
5
  __name: "ScalarComboboxMultiselect",
9
6
  props: {
10
7
  options: {},
@@ -19,42 +16,56 @@ const v = { class: "divide-1 divide-y" }, y = {
19
16
  teleport: { type: [Boolean, String] }
20
17
  },
21
18
  emits: ["update:modelValue", "delete"],
22
- setup($, { expose: n }) {
23
- const r = u(null);
24
- return n({ comboboxPopoverRef: r }), (e, o) => (t(), a(V, {
19
+ setup(y, { expose: i }) {
20
+ const s = f(null);
21
+ return i({ comboboxPopoverRef: s }), (e, o) => (p(), n(V, {
25
22
  ref_key: "comboboxPopoverRef",
26
- ref: r,
23
+ ref: s,
27
24
  middleware: e.middleware,
25
+ offset: e.offset,
28
26
  placement: e.placement ?? "bottom-start",
29
27
  resize: e.resize,
30
28
  target: e.target,
31
29
  teleport: e.teleport
32
30
  }, {
33
- popover: s(({ open: d }) => [
34
- f("div", v, [
35
- e.options && e.options.length ? (t(), a(c, {
31
+ popover: l(({ open: t }) => {
32
+ var m;
33
+ return [
34
+ (m = e.options) != null && m.length ? (p(), n($, {
36
35
  key: 0,
37
36
  isDeletable: e.isDeletable,
38
37
  modelValue: e.modelValue,
39
38
  multiselect: "",
40
- open: d,
39
+ open: t,
41
40
  options: e.options,
42
41
  placeholder: e.placeholder,
43
- onDelete: o[0] || (o[0] = (l) => e.$emit("delete", l)),
44
- "onUpdate:modelValue": o[1] || (o[1] = (l) => e.$emit("update:modelValue", l))
45
- }, null, 8, ["isDeletable", "modelValue", "open", "options", "placeholder"])) : i("", !0),
46
- e.$slots.actions ? (t(), b("div", y, [
47
- p(e.$slots, "actions")
48
- ])) : i("", !0)
49
- ])
50
- ]),
51
- default: s(() => [
52
- p(e.$slots, "default")
42
+ onDelete: o[0] || (o[0] = (r) => e.$emit("delete", r)),
43
+ "onUpdate:modelValue": o[1] || (o[1] = (r) => e.$emit("update:modelValue", r))
44
+ }, u({ _: 2 }, [
45
+ e.$slots.before ? {
46
+ name: "before",
47
+ fn: l(() => [
48
+ a(e.$slots, "before", { open: t })
49
+ ]),
50
+ key: "0"
51
+ } : void 0,
52
+ e.$slots.after ? {
53
+ name: "after",
54
+ fn: l(() => [
55
+ a(e.$slots, "after", { open: t })
56
+ ]),
57
+ key: "1"
58
+ } : void 0
59
+ ]), 1032, ["isDeletable", "modelValue", "open", "options", "placeholder"])) : b("", !0)
60
+ ];
61
+ }),
62
+ default: l(() => [
63
+ a(e.$slots, "default")
53
64
  ]),
54
65
  _: 3
55
- }, 8, ["middleware", "placement", "resize", "target", "teleport"]));
66
+ }, 8, ["middleware", "offset", "placement", "resize", "target", "teleport"]));
56
67
  }
57
68
  });
58
69
  export {
59
- h as default
70
+ w as default
60
71
  };
@@ -1,26 +1,14 @@
1
- import { type Slot } from 'vue';
2
- import { type Option, type OptionGroup } from './types.js';
1
+ import { type ComboboxSlots, type Option, type OptionGroup } from './types.js';
3
2
  type __VLS_Props = {
4
3
  options: Option[] | OptionGroup[];
5
4
  modelValue?: Option[];
6
5
  placeholder?: string;
7
- open?: boolean;
8
6
  multiselect?: boolean;
9
7
  isDeletable?: boolean;
10
8
  };
11
9
  declare function __VLS_template(): {
12
10
  attrs: Partial<{}>;
13
- slots: Readonly<{
14
- /** A slot for contents before the combobox options */
15
- before(): Slot;
16
- /** A slot for contents after the combobox options */
17
- after(): Slot;
18
- }> & {
19
- /** A slot for contents before the combobox options */
20
- before(): Slot;
21
- /** A slot for contents after the combobox options */
22
- after(): Slot;
23
- };
11
+ slots: Readonly<Omit<ComboboxSlots, "default">> & Omit<ComboboxSlots, "default">;
24
12
  refs: {};
25
13
  rootEl: any;
26
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarComboboxOptions.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarComboboxOptions.vue"],"names":[],"mappings":"AAiKA,OAAO,EAAE,KAAK,IAAI,EAAwB,MAAM,KAAK,CAAA;AAIrD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAY,MAAM,SAAS,CAAA;AAIjE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;AA8FF,iBAAS,cAAc;WA2JT,OAAO,IAA6B;;QA/OhD,sDAAsD;kBAC5C,IAAI;QACd,qDAAqD;iBAC5C,IAAI;;QAHb,sDAAsD;kBAC5C,IAAI;QACd,qDAAqD;iBAC5C,IAAI;;;;EAiPd;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarComboboxOptions.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarComboboxOptions.vue"],"names":[],"mappings":"AA6LA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAA;AAIhB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;AAiHF,iBAAS,cAAc;WA+JT,OAAO,IAA6B;;;;EAKjD;AAoBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,61 +1,71 @@
1
- import { defineComponent as T, computed as f, ref as C, watch as S, openBlock as a, createElementBlock as u, Fragment as m, createElementVNode as x, createVNode as q, unref as w, withDirectives as g, withKeys as $, withModifiers as b, vModelText as F, renderSlot as B, renderList as M, toDisplayString as I, createCommentVNode as N, createBlock as G, normalizeStyle as O, withCtx as U, createTextVNode as j, vShow as H } from "vue";
2
- import { nanoid as J } from "nanoid";
3
- import P from "./ScalarComboboxOption.vue.js";
4
- import { isGroups as L } from "./types.js";
5
- import Q from "../ScalarIcon/ScalarIcon.vue.js";
6
- const R = { class: "relative flex" }, W = ["aria-controls", "placeholder"], X = ["id"], Y = {
1
+ import { defineComponent as A, computed as b, ref as I, onMounted as K, watch as O, openBlock as i, createElementBlock as c, Fragment as p, createElementVNode as $, createVNode as q, unref as F, withDirectives as D, withKeys as h, withModifiers as y, vModelText as G, renderSlot as C, renderList as S, toDisplayString as B, createCommentVNode as M, createBlock as U, normalizeStyle as j, withCtx as H, createTextVNode as J, vShow as P } from "vue";
2
+ import { nanoid as Q } from "nanoid";
3
+ import R from "./ScalarComboboxOption.vue.js";
4
+ import { isGroups as E } from "./types.js";
5
+ import W from "../ScalarIcon/ScalarIcon.vue.js";
6
+ const X = { class: "relative flex" }, Y = ["placeholder"], Z = {
7
7
  key: 0,
8
- class: "min-w-0 truncate px-2 py-1.5 text-left text-c-2"
9
- }, oe = /* @__PURE__ */ T({
8
+ class: "min-w-0 truncate px-2.5 py-1.5 text-left text-c-2"
9
+ }, ne = /* @__PURE__ */ A({
10
10
  inheritAttrs: !1,
11
11
  __name: "ScalarComboboxOptions",
12
12
  props: {
13
13
  options: {},
14
14
  modelValue: {},
15
15
  placeholder: {},
16
- open: { type: Boolean },
17
16
  multiselect: { type: Boolean },
18
17
  isDeletable: { type: Boolean }
19
18
  },
20
19
  emits: ["update:modelValue", "delete"],
21
- setup(z, { emit: A }) {
22
- var D;
23
- const o = z, E = A, h = J(), y = f(
24
- () => L(o.options) ? o.options.flatMap((e) => e.options) : o.options
25
- ), K = f(
26
- () => L(o.options) ? o.options : [{ label: "", options: o.options }]
27
- ), i = C(""), r = C(((D = o.modelValue) == null ? void 0 : D[0]) ?? y.value[0]);
28
- S(
29
- () => o.open,
30
- () => i.value = ""
31
- ), S(
32
- () => i.value,
33
- () => r.value = v.value[0]
20
+ setup(N, { emit: L }) {
21
+ var g;
22
+ const o = N, T = L, x = `scalar-combobox-items-${Q()}`;
23
+ function w(e) {
24
+ return `${x}-${e.id}`;
25
+ }
26
+ const f = b(
27
+ () => E(o.options) ? o.options.flatMap((e) => e.options) : o.options
28
+ ), z = b(
29
+ () => E(o.options) ? o.options : [{ label: "", options: o.options }]
30
+ ), r = I(""), a = I(((g = o.modelValue) == null ? void 0 : g[0]) ?? f.value[0]);
31
+ K(async () => {
32
+ var e;
33
+ r.value = "", a.value = ((e = o.modelValue) == null ? void 0 : e[0]) ?? f.value[0], s.value.length !== 0 && setTimeout(() => {
34
+ var t;
35
+ (t = document == null ? void 0 : document.getElementById(w(s.value[0]))) == null || t.scrollIntoView({ block: "center" });
36
+ }, 10);
37
+ }), O(
38
+ () => r.value,
39
+ () => a.value = v.value[0]
34
40
  );
35
- const v = f(
36
- () => i.value === "" ? y.value : y.value.filter((e) => e.label.toLowerCase().includes(i.value.toLowerCase()))
37
- ), s = f({
41
+ const v = b(
42
+ () => r.value === "" ? f.value : f.value.filter((e) => e.label.toLowerCase().includes(r.value.toLowerCase()))
43
+ ), s = b({
38
44
  get: () => o.modelValue ?? [],
39
- set: (e) => e && E("update:modelValue", e)
45
+ set: (e) => e && T("update:modelValue", e)
40
46
  });
41
- function k(e) {
47
+ function V(e) {
42
48
  o.multiselect ? s.value.some((t) => t.id === e.id) ? s.value = s.value.filter((t) => t.id !== e.id) : s.value = [...s.value, e] : s.value = [e];
43
49
  }
44
- function V(e) {
45
- const t = v.value, c = t.findIndex((l) => l.id === r.value.id) + e;
46
- c < 0 || c > t.length - 1 || (r.value = t[c]);
50
+ function k(e) {
51
+ var l;
52
+ const t = v.value, m = t.findIndex((u) => u.id === a.value.id) + e;
53
+ m < 0 || m > t.length - 1 || (a.value = t[m], (l = document == null ? void 0 : document.getElementById(w(a.value))) == null || l.scrollIntoView({
54
+ behavior: "smooth",
55
+ block: "nearest"
56
+ }));
47
57
  }
48
- return (e, t) => (a(), u(m, null, [
49
- x("div", R, [
50
- q(w(Q), {
51
- class: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-c-3",
58
+ return (e, t) => (i(), c(p, null, [
59
+ $("div", X, [
60
+ q(F(W), {
61
+ class: "pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-c-3",
52
62
  icon: "Search",
53
- size: "sm"
63
+ size: "md"
54
64
  }),
55
- g(x("input", {
56
- "onUpdate:modelValue": t[0] || (t[0] = (n) => i.value = n),
65
+ D($("input", {
66
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => r.value = n),
57
67
  "aria-autocomplete": "list",
58
- "aria-controls": w(h),
68
+ "aria-controls": x,
59
69
  class: "min-w-0 flex-1 rounded-none border-0 py-2.5 pl-8 pr-3 leading-none text-c-1 outline-none",
60
70
  "data-1p-ignore": "",
61
71
  placeholder: e.placeholder,
@@ -63,54 +73,55 @@ const R = { class: "relative flex" }, W = ["aria-controls", "placeholder"], X =
63
73
  tabindex: "0",
64
74
  type: "text",
65
75
  onKeydown: [
66
- t[1] || (t[1] = $(b((n) => V(1), ["prevent"]), ["down"])),
67
- t[2] || (t[2] = $(b((n) => k(r.value), ["prevent"]), ["enter"])),
68
- t[3] || (t[3] = $(b((n) => V(-1), ["prevent"]), ["up"]))
76
+ t[1] || (t[1] = h(y((n) => k(1), ["prevent"]), ["down"])),
77
+ t[2] || (t[2] = h(y((n) => V(a.value), ["prevent"]), ["enter"])),
78
+ t[3] || (t[3] = h(y((n) => k(-1), ["prevent"]), ["up"]))
69
79
  ]
70
- }, null, 40, W), [
71
- [F, i.value]
80
+ }, null, 40, Y), [
81
+ [G, r.value]
72
82
  ])
73
83
  ]),
74
- g(x("ul", {
75
- id: w(h),
76
- class: "border-t p-0.75"
84
+ D($("ul", {
85
+ id: x,
86
+ class: "border-t p-0.75 custom-scroll overscroll-contain flex-1 min-h-0"
77
87
  }, [
78
- B(e.$slots, "before"),
79
- (a(!0), u(m, null, M(K.value, (n, c) => (a(), u(m, { key: c }, [
88
+ C(e.$slots, "before"),
89
+ (i(!0), c(p, null, S(z.value, (n, m) => (i(), c(p, { key: m }, [
80
90
  n.label && // Only show the group label if there are some results
81
- n.options.some((l) => v.value.some((p) => p.id === l.id)) ? (a(), u("div", Y, I(n.label), 1)) : N("", !0),
82
- (a(!0), u(m, null, M(v.value, (l) => {
83
- var p;
84
- return a(), u(m, {
91
+ n.options.some((l) => v.value.some((u) => u.id === l.id)) ? (i(), c("div", Z, B(n.label), 1)) : M("", !0),
92
+ (i(!0), c(p, null, S(v.value, (l) => {
93
+ var u;
94
+ return i(), c(p, {
85
95
  key: l.id
86
96
  }, [
87
- n.options.some((d) => d.id === l.id) ? (a(), G(P, {
97
+ n.options.some((d) => d.id === l.id) ? (i(), U(R, {
88
98
  key: 0,
89
- active: ((p = r.value) == null ? void 0 : p.id) === l.id,
99
+ id: w(l),
100
+ active: ((u = a.value) == null ? void 0 : u.id) === l.id,
90
101
  isDeletable: l.isDeletable ?? e.isDeletable,
91
102
  selected: s.value.some((d) => d.id === l.id),
92
- style: O(e.multiselect ? "checkbox" : "radio"),
93
- onClick: (d) => k(l),
103
+ style: j(e.multiselect ? "checkbox" : "radio"),
104
+ onClick: (d) => V(l),
94
105
  onDelete: (d) => e.$emit("delete", l),
95
- onMousedown: t[4] || (t[4] = b(() => {
106
+ onMousedown: t[4] || (t[4] = y(() => {
96
107
  }, ["prevent"])),
97
- onMouseenter: (d) => r.value = l
108
+ onMouseenter: (d) => a.value = l
98
109
  }, {
99
- default: U(() => [
100
- j(I(l.label), 1)
110
+ default: H(() => [
111
+ J(B(l.label), 1)
101
112
  ]),
102
113
  _: 2
103
- }, 1032, ["active", "isDeletable", "selected", "style", "onClick", "onDelete", "onMouseenter"])) : N("", !0)
114
+ }, 1032, ["id", "active", "isDeletable", "selected", "style", "onClick", "onDelete", "onMouseenter"])) : M("", !0)
104
115
  ], 64);
105
116
  }), 128))
106
117
  ], 64))), 128)),
107
- B(e.$slots, "after")
108
- ], 8, X), [
109
- [H, v.value.length || e.$slots.before || e.$slots.after]
118
+ C(e.$slots, "after")
119
+ ], 512), [
120
+ [P, v.value.length || e.$slots.before || e.$slots.after]
110
121
  ])
111
122
  ], 64));
112
123
  }
113
124
  });
114
125
  export {
115
- oe as default
126
+ ne as default
116
127
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarComboboxPopover.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarComboboxPopover.vue"],"names":[],"mappings":"AA+DA,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AA8B1D,iBAAS,cAAc;WAwGT,OAAO,IAA6B;;;;;;;;;;;;;;;;0BA3IlD,KA1B6B,eA0B7B,KAzBkB,uBAyBlB,KAxBwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwKvB;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;oBAhKrB,KA1B6B,eA0B7B,KAzBkB,uBAyBlB,KAxBwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8PA+LtB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarComboboxPopover.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarCombobox/ScalarComboboxPopover.vue"],"names":[],"mappings":"AAoEA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AA8B1D,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;;;;;;;;;;;;;;;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