@astryx-vue/core 0.2.0 → 0.2.2

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 (225) hide show
  1. package/dist/AppShell/index.js +1 -1
  2. package/dist/{AppShell-EiGyPFbA.js → AppShell-Cb41gIAj.js} +2 -2
  3. package/dist/Avatar/index.d.ts +1 -1
  4. package/dist/Avatar/index.js +1 -1
  5. package/dist/Avatar-jmHInHwj.js +244 -0
  6. package/dist/AvatarGroup/index.d.ts +1 -1
  7. package/dist/AvatarGroup/index.js +1 -1
  8. package/dist/{AvatarGroup-CZcgAMjM.js → AvatarGroup-QyzSrpYA.js} +8 -7
  9. package/dist/Badge/index.d.ts +2 -1
  10. package/dist/Badge/index.js +1 -1
  11. package/dist/Badge-CjDQPF5g.js +30 -0
  12. package/dist/Banner/index.d.ts +1 -1
  13. package/dist/Breadcrumbs/index.d.ts +2 -2
  14. package/dist/Breadcrumbs/index.js +1 -1
  15. package/dist/{Breadcrumbs-C3YZFQ9w.js → Breadcrumbs-CTQ7fjDn.js} +45 -11
  16. package/dist/ButtonGroup/index.d.ts +1 -1
  17. package/dist/Calendar/index.d.ts +2 -2
  18. package/dist/Calendar/index.js +1 -1
  19. package/dist/Calendar-BFaI5AMv.js +352 -0
  20. package/dist/Card/index.d.ts +1 -1
  21. package/dist/Carousel/index.js +1 -1
  22. package/dist/{Carousel-BTtHkKea.js → Carousel-X0cuQkvg.js} +2 -2
  23. package/dist/Chat/index.d.ts +2 -2
  24. package/dist/Chat/index.js +2 -2
  25. package/dist/Chat-M0tiGrNT.js +3148 -0
  26. package/dist/CheckboxInput/index.d.ts +1 -1
  27. package/dist/CheckboxList/index.d.ts +1 -1
  28. package/dist/CheckboxList/index.js +1 -1
  29. package/dist/Citation/index.js +1 -1
  30. package/dist/{Citation-DijdbUUu.js → Citation-C1veUk5p.js} +2 -2
  31. package/dist/ClickableCard/index.d.ts +1 -1
  32. package/dist/Code/index.js +1 -1
  33. package/dist/{CodeBlock-CxTb6j9_.js → CodeBlock-DesTJAkm.js} +1 -1
  34. package/dist/Collapsible/index.js +1 -1
  35. package/dist/{Collapsible-9MC08X39.js → Collapsible-BestK35V.js} +1 -1
  36. package/dist/CommandPalette/index.js +1 -1
  37. package/dist/{CommandPalette-BD2iODF5.js → CommandPalette-BArt97V8.js} +1 -1
  38. package/dist/ComplexSelector/index.d.ts +1 -1
  39. package/dist/ComplexSelector/index.js +1 -1
  40. package/dist/{ComplexSelector-D9iXd5cH.js → ComplexSelector-CAoig1RK.js} +2 -2
  41. package/dist/ContextMenu/index.d.ts +2 -2
  42. package/dist/ContextMenu/index.js +1 -1
  43. package/dist/{ContextMenu-HS_WqYIg.js → ContextMenu-9Im6i43E.js} +101 -63
  44. package/dist/DateInput/index.d.ts +2 -2
  45. package/dist/DateInput/index.js +1 -1
  46. package/dist/DateInput-BLocxqC3.js +376 -0
  47. package/dist/DateRangeInput/index.d.ts +1 -1
  48. package/dist/DateRangeInput/index.js +1 -1
  49. package/dist/{DateRangeInput-1bhPGG2s.js → DateRangeInput-DwDy3eRo.js} +2 -2
  50. package/dist/DateTimeInput/index.d.ts +1 -1
  51. package/dist/DateTimeInput/index.js +1 -1
  52. package/dist/{DateTimeInput-SnPdgk6P.js → DateTimeInput-BYiaC9bn.js} +5 -3
  53. package/dist/DropdownMenu/index.d.ts +3 -2
  54. package/dist/DropdownMenu/index.js +3 -2
  55. package/dist/DropdownMenu-Ddfr-aEC.js +164 -0
  56. package/dist/{DropdownMenu-UJGych6v.js → DropdownMenu-Dh-WAHKb.js} +63 -16
  57. package/dist/FileInput/index.d.ts +1 -1
  58. package/dist/FileInput/index.js +1 -1
  59. package/dist/{FileInput-BQiwE-GB.js → FileInput-DLO6V12n.js} +2 -2
  60. package/dist/Icon/index.d.ts +4 -3
  61. package/dist/Icon/index.js +3 -2
  62. package/dist/Icon/plugin.d.ts +45 -0
  63. package/dist/Icon/plugin.js +177 -0
  64. package/dist/Icon-CJKjdJy-.js +198 -0
  65. package/dist/Lightbox/index.js +1 -1
  66. package/dist/{Lightbox-CshKoB0r.js → Lightbox-CdFCS_EA.js} +2 -2
  67. package/dist/Link/index.d.ts +1 -1
  68. package/dist/Link/index.js +1 -1
  69. package/dist/Link-DqdQZ37C.js +141 -0
  70. package/dist/Markdown/index.js +1 -1
  71. package/dist/{Markdown-D-Ua055V.js → Markdown-BqKloI3w.js} +3 -3
  72. package/dist/MetadataList/index.js +1 -1
  73. package/dist/{MetadataList-sYph_d8Q.js → MetadataList-CvZkmisf.js} +1 -1
  74. package/dist/MobileNav/index.js +1 -1
  75. package/dist/{MobileNavToggle-DD9D01aj.js → MobileNavToggle-Bwi0qXXM.js} +1 -1
  76. package/dist/MoreMenu/index.d.ts +1 -1
  77. package/dist/MoreMenu/index.js +1 -1
  78. package/dist/{MoreMenu-BVrK5kkk.js → MoreMenu-BwJaJrkB.js} +2 -2
  79. package/dist/MultiSelector/index.js +1 -1
  80. package/dist/{MultiSelector-DiYov9sF.js → MultiSelector-C-ETfFy_.js} +2 -2
  81. package/dist/NumberInput/index.d.ts +2 -2
  82. package/dist/NumberInput/index.js +1 -1
  83. package/dist/NumberInput-DjetVB8O.js +210 -0
  84. package/dist/Outline/index.js +1 -1
  85. package/dist/{Outline-DQfEBxlc.js → Outline-Bz9c-u5y.js} +1 -1
  86. package/dist/OverflowList/index.d.ts +1 -1
  87. package/dist/OverflowList/index.js +1 -1
  88. package/dist/{OverflowList-BU5VCntl.js → OverflowList-ED-KN9Y5.js} +1 -1
  89. package/dist/Overlay/index.d.ts +1 -1
  90. package/dist/Pagination/index.d.ts +2 -2
  91. package/dist/Pagination/index.js +1 -1
  92. package/dist/{Pagination-HdhtykeF.js → Pagination-Cb66HMEf.js} +76 -22
  93. package/dist/PowerSearch/index.d.ts +2 -0
  94. package/dist/PowerSearch/index.js +2 -0
  95. package/dist/PowerSearch-CjU8y4mi.js +2386 -0
  96. package/dist/ProgressBar/index.d.ts +1 -1
  97. package/dist/ProgressBar/index.js +1 -1
  98. package/dist/{ProgressBar-ChDp-7oe.js → ProgressBar-DO9Chic6.js} +31 -11
  99. package/dist/Radio/index.d.ts +1 -1
  100. package/dist/RadioList/index.d.ts +1 -1
  101. package/dist/Resizable/index.d.ts +1 -1
  102. package/dist/Resizable/index.js +1 -1
  103. package/dist/{Resizable-BhSMfO5B.js → Resizable-D-TBCg0Y.js} +1 -1
  104. package/dist/ScrollableArea/index.d.ts +1 -1
  105. package/dist/SelectableCard/index.d.ts +1 -1
  106. package/dist/Selector/index.d.ts +2 -2
  107. package/dist/Selector/index.js +1 -1
  108. package/dist/Selector-DE2IEFML.js +468 -0
  109. package/dist/SideNav/index.d.ts +1 -1
  110. package/dist/SideNav/index.js +1 -1
  111. package/dist/{SideNav-B-Om6Bz3.js → SideNav-DonEfiAx.js} +17 -17
  112. package/dist/Stepper/index.js +1 -1
  113. package/dist/{Stepper-BZ_8SEZt.js → Stepper-D2ZIcUNx.js} +1 -1
  114. package/dist/Switch/index.d.ts +1 -1
  115. package/dist/TabList/index.d.ts +1 -1
  116. package/dist/TabList/index.js +1 -1
  117. package/dist/{TabList-Cnc2Hs1H.js → TabList-D3F-stq-.js} +10 -3
  118. package/dist/Table/index.d.ts +3 -3
  119. package/dist/Table/index.js +2 -2
  120. package/dist/Table-CrP2Uffq.js +1982 -0
  121. package/dist/TextArea/index.d.ts +1 -1
  122. package/dist/TextArea/index.js +1 -1
  123. package/dist/{TextArea-Cv9UVbzS.js → TextArea-CPwSytdO.js} +12 -6
  124. package/dist/TextInput/index.d.ts +1 -1
  125. package/dist/Thumbnail/index.js +1 -1
  126. package/dist/{Thumbnail-Dc1UpykG.js → Thumbnail-BC5JGPGZ.js} +11 -11
  127. package/dist/{TimeField-C7t9Knq9.js → TimeField-DpHFrNv0.js} +2 -2
  128. package/dist/TimeInput/index.d.ts +1 -1
  129. package/dist/TimeInput/index.js +1 -1
  130. package/dist/{TimeInput-BXxCOY98.js → TimeInput-DJLV0_4z.js} +1 -1
  131. package/dist/Timestamp/index.d.ts +1 -1
  132. package/dist/Timestamp/index.js +2 -1
  133. package/dist/{Timestamp-DlZSmgCJ.js → Timestamp-GKNjjt5g.js} +4 -121
  134. package/dist/Toast/index.d.ts +2 -2
  135. package/dist/Toast/index.js +1 -1
  136. package/dist/{Toast-BKXPvEMp.js → Toast-C2ML-bmi.js} +37 -7
  137. package/dist/ToggleButton/index.d.ts +1 -1
  138. package/dist/Token/index.js +1 -1
  139. package/dist/{Token-wt4e80IM.js → Token-Chu_eCVs.js} +1 -1
  140. package/dist/Tokenizer/index.js +1 -1
  141. package/dist/{Tokenizer-nmTqdS9n.js → Tokenizer-DRDpvQ_l.js} +3 -3
  142. package/dist/Toolbar/index.d.ts +1 -1
  143. package/dist/TopNav/index.d.ts +1 -1
  144. package/dist/TopNav/index.js +1 -1
  145. package/dist/{TopNav-notp-mJx.js → TopNav-CEyWddtA.js} +3 -3
  146. package/dist/TreeList/index.js +1 -1
  147. package/dist/{TreeList-s1xBQ0qq.js → TreeList-COS8US8e.js} +3 -3
  148. package/dist/Typeahead/index.js +1 -1
  149. package/dist/{Typeahead-VAuiCurV.js → Typeahead-P7cCqtaQ.js} +3 -3
  150. package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
  151. package/dist/composables/index.d.ts +3 -3
  152. package/dist/{context-Dbo22sck.js → context-CiKncNSH.js} +184 -6
  153. package/dist/formatInstant-BDWUIxS7.js +119 -0
  154. package/dist/{index-SMh42NI8.d.ts → index-B1TG2GPS.d.ts} +2 -2
  155. package/dist/{index-DRmb-oUa.d.ts → index-B9WzWqzk.d.ts} +3 -29
  156. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  157. package/dist/{index-z4p2k9VR.d.ts → index-Bgv4ZmBl.d.ts} +20 -2
  158. package/dist/{index-BoRIw-bP.d.ts → index-Bt7ewoz2.d.ts} +32 -2
  159. package/dist/{index-uQrLBZfF.d.ts → index-Bu3oXIIS.d.ts} +24 -0
  160. package/dist/index-CJlBAXwj.d.ts +100 -0
  161. package/dist/{index-DT9S92sh.d.ts → index-CNjbOgty.d.ts} +15 -0
  162. package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
  163. package/dist/index-Cs5pcwY3.d.ts +416 -0
  164. package/dist/{index-NzLDrOkk.d.ts → index-D4I_obqR.d.ts} +14 -1
  165. package/dist/{index-BtPZKO20.d.ts → index-DGXviOlp.d.ts} +49 -7
  166. package/dist/{index-CTolyeii.d.ts → index-DN7MXPHM.d.ts} +15 -1
  167. package/dist/{index-C6iJwTL0.d.ts → index-DNRBbwp_.d.ts} +165 -55
  168. package/dist/{index-C59PdX9L.d.ts → index-DWH_HzXi.d.ts} +1 -1
  169. package/dist/{index-BfOtLyNH.d.ts → index-D_nYxnNv.d.ts} +1 -1
  170. package/dist/{index-Bn_odHQ9.d.ts → index-Dg3ZmwEg.d.ts} +12 -1
  171. package/dist/{index-BiMGXtD-.d.ts → index-DimuSES0.d.ts} +14 -1
  172. package/dist/{index-DEeJowZf.d.ts → index-cGagYM1g.d.ts} +15 -2
  173. package/dist/{index-Ck8qy6Rf.d.ts → index-c_TaW8mM.d.ts} +24 -2
  174. package/dist/index-kVhSuA9t.d.ts +902 -0
  175. package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
  176. package/dist/{index-DoFCm2Q2.d.ts → index-qiZtHnGK.d.ts} +26 -0
  177. package/dist/{index-Bainr_3n.d.ts → index-u5ozu0G7.d.ts} +2 -2
  178. package/dist/index.d.ts +79 -76
  179. package/dist/index.js +111 -100
  180. package/dist/locale/index.d.ts +1 -1
  181. package/dist/locale/index.js +1 -1
  182. package/dist/power-search-DrDfcoL1.d.ts +68 -0
  183. package/dist/registry-B1ObuP--.d.ts +45 -0
  184. package/dist/registry-C7OZb0PJ.js +135 -0
  185. package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
  186. package/dist/{index-B8MbfMwV.d.ts → types-DDAAT1Xd.d.ts} +36 -82
  187. package/dist/types-DIYwbkpe.d.ts +33 -0
  188. package/dist/{types-DZoEm_DG.d.ts → types-pnljWjEE.d.ts} +23 -6
  189. package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
  190. package/package.json +10 -1
  191. package/styles/avatar.css +14 -0
  192. package/styles/badge.css +8 -0
  193. package/styles/breadcrumbs.css +6 -1
  194. package/styles/button.css +13 -0
  195. package/styles/calendar.css +16 -0
  196. package/styles/card.css +2 -0
  197. package/styles/chat.css +474 -3
  198. package/styles/dropdown-menu.css +11 -0
  199. package/styles/icon.css +58 -8
  200. package/styles/link.css +5 -0
  201. package/styles/number-input.css +22 -0
  202. package/styles/pagination.css +45 -1
  203. package/styles/power-search.css +303 -0
  204. package/styles/progress-bar.css +4 -0
  205. package/styles/selector.css +58 -0
  206. package/styles/tab-list.css +15 -0
  207. package/styles/table.css +304 -1
  208. package/styles/text-area.css +17 -0
  209. package/styles/text-input.css +5 -0
  210. package/styles/toast.css +7 -0
  211. package/styles/toolbar.css +11 -0
  212. package/styles.css +1 -0
  213. package/dist/Avatar-5s3HSrtN.js +0 -136
  214. package/dist/Badge-Ba0EwsTj.js +0 -19
  215. package/dist/Calendar-BG7wEsro.js +0 -277
  216. package/dist/Chat-DjNxw5gv.js +0 -1051
  217. package/dist/DateInput-DE2TN1Rq.js +0 -250
  218. package/dist/Icon-Dfr4k6-S.js +0 -86
  219. package/dist/Link-CprjOuTI.js +0 -92
  220. package/dist/NumberInput-CTYiQxHq.js +0 -147
  221. package/dist/Selector-Da-2BO3q.js +0 -325
  222. package/dist/Table-D-LhAy_J.js +0 -967
  223. package/dist/index-DJo-BmXZ.d.ts +0 -431
  224. package/dist/index-DtjAdYEc.d.ts +0 -68
  225. package/dist/{CheckboxList-EsIEXjK_.js → CheckboxList-BbCPiend.js} +1 -1
@@ -1,325 +0,0 @@
1
- import { t as useCombobox } from "./useCombobox-CTo5C-gc.js";
2
- import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
3
- import { a as useAstryxMessages } from "./context-Dbo22sck.js";
4
- import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
5
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, useSlots, useTemplateRef, vShow, watch, withDirectives, withKeys, withModifiers } from "vue";
6
- import "../styles/visually-hidden-utility.css";
7
- import "../styles/selector.css";
8
- //#region src/Selector/Selector.vue
9
- const _hoisted_1 = [
10
- "disabled",
11
- "aria-expanded",
12
- "aria-label",
13
- "aria-activedescendant",
14
- "title"
15
- ];
16
- const _hoisted_2 = ["aria-label"];
17
- const _hoisted_3 = ["data-placement"];
18
- const _hoisted_4 = {
19
- key: 0,
20
- class: "astryx-selector-search"
21
- };
22
- const _hoisted_5 = [
23
- "id",
24
- "aria-label",
25
- "placeholder",
26
- "value"
27
- ];
28
- const _hoisted_6 = {
29
- key: 1,
30
- class: "astryx-selector-options"
31
- };
32
- const _hoisted_7 = [
33
- "id",
34
- "aria-selected",
35
- "aria-disabled",
36
- "onClick",
37
- "onKeydown"
38
- ];
39
- const _hoisted_8 = { class: "astryx-selector-option-label" };
40
- const _hoisted_9 = {
41
- key: 0,
42
- class: "astryx-selector-option-description"
43
- };
44
- const _hoisted_10 = {
45
- key: 2,
46
- class: "astryx-selector-empty"
47
- };
48
- const _hoisted_11 = [
49
- "id",
50
- "name",
51
- "value",
52
- "aria-label"
53
- ];
54
- const _hoisted_12 = ["value"];
55
- const _sfc_main = /*@__PURE__*/ defineComponent({
56
- name: "AstryxSelector",
57
- inheritAttrs: false,
58
- __name: "Selector",
59
- props: {
60
- modelValue: { default: null },
61
- options: {},
62
- placeholder: {},
63
- disabled: {
64
- type: Boolean,
65
- default: false
66
- },
67
- disabledReason: {},
68
- status: { default: "default" },
69
- statusMessage: {},
70
- size: { default: "md" },
71
- searchable: {
72
- type: Boolean,
73
- default: false
74
- },
75
- searchPlaceholder: {},
76
- clearable: {
77
- type: Boolean,
78
- default: false
79
- },
80
- clearLabel: {},
81
- emptyText: {},
82
- label: {},
83
- name: {}
84
- },
85
- emits: [
86
- "update:modelValue",
87
- "change",
88
- "search"
89
- ],
90
- setup(__props, { emit: __emit }) {
91
- const props = __props;
92
- const emit = __emit;
93
- const slots = useSlots();
94
- const selectorId = `astryx-selector-${useId()}`;
95
- const listboxId = `${selectorId}-listbox`;
96
- const messages = useAstryxMessages();
97
- const resolvedPlaceholder = computed(() => props.placeholder ?? messages.value.selector.placeholder);
98
- const resolvedSearchPlaceholder = computed(() => props.searchPlaceholder ?? messages.value.selector.search);
99
- const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.selector.clear);
100
- const resolvedEmptyText = computed(() => props.emptyText ?? messages.value.selector.empty);
101
- const fieldRef = useTemplateRef("fieldRef");
102
- const listboxRef = useTemplateRef("listboxRef");
103
- const searchInputRef = useTemplateRef("searchInputRef");
104
- const isEnabled = computed(() => !props.disabled);
105
- const isSearchable = computed(() => props.searchable);
106
- const comboboxOptions = computed(() => props.options.map((opt) => ({
107
- value: opt.value,
108
- label: opt.label,
109
- disabled: opt.disabled ?? false
110
- })));
111
- const modelValueRef = computed({
112
- get: () => props.modelValue,
113
- set: (value) => {
114
- emit("update:modelValue", value);
115
- emit("change", value);
116
- }
117
- });
118
- const combobox = useCombobox({
119
- options: comboboxOptions,
120
- modelValue: modelValueRef,
121
- isEnabled,
122
- isSearchable,
123
- onChange: (value) => {
124
- modelValueRef.value = value;
125
- },
126
- onOpenChange: (isOpen) => {
127
- if (isOpen && props.searchable) nextTick(() => {
128
- searchInputRef.value?.focus();
129
- });
130
- }
131
- });
132
- const { position } = usePositionedLayer({
133
- anchor: fieldRef,
134
- layer: listboxRef,
135
- isOpen: combobox.isOpen,
136
- placement: computed(() => "below"),
137
- alignment: computed(() => "start"),
138
- gap: 4
139
- });
140
- useDismiss({
141
- container: listboxRef,
142
- trigger: fieldRef,
143
- isEnabled: combobox.isOpen,
144
- enableEscape: ref(true),
145
- onDismiss: () => {
146
- combobox.close();
147
- }
148
- });
149
- const selectedOption = computed(() => {
150
- if (props.modelValue == null) return null;
151
- return props.options.find((opt) => opt.value === props.modelValue) ?? null;
152
- });
153
- const displayText = computed(() => {
154
- return selectedOption.value?.label ?? resolvedPlaceholder.value;
155
- });
156
- const isEmpty = computed(() => {
157
- return combobox.filteredOptions.value.length === 0;
158
- });
159
- function onTriggerClick() {
160
- if (isEnabled.value) combobox.toggle();
161
- }
162
- function onTriggerKeyDown(event) {
163
- combobox.onKeyDown(event);
164
- }
165
- function onOptionClick(option) {
166
- if (!option.disabled) combobox.select(option.value);
167
- }
168
- function onClear(event) {
169
- event.stopPropagation();
170
- modelValueRef.value = null;
171
- combobox.close();
172
- }
173
- function onSearchInput(event) {
174
- const target = event.target;
175
- combobox.setSearchQuery(target.value);
176
- emit("search", target.value);
177
- }
178
- function getOptionId(index) {
179
- return `${listboxId}-option-${index}`;
180
- }
181
- const anchorWidth = ref(0);
182
- function syncAnchorWidth() {
183
- anchorWidth.value = fieldRef.value?.getBoundingClientRect().width ?? 0;
184
- }
185
- const listboxStyle = computed(() => ({
186
- top: `${position.value.top}px`,
187
- left: `${position.value.left}px`,
188
- minWidth: anchorWidth.value > 0 ? `${anchorWidth.value}px` : void 0
189
- }));
190
- watch(combobox.isOpen, (open) => {
191
- if (open) syncAnchorWidth();
192
- }, { flush: "pre" });
193
- onMounted(syncAnchorWidth);
194
- watch(() => combobox.activeIndex.value, (index) => {
195
- if (index >= 0 && combobox.isOpen.value) nextTick(() => {
196
- const listbox = listboxRef.value;
197
- const optionEl = listbox?.querySelector(`#${getOptionId(index)}`);
198
- if (!listbox || !optionEl) return;
199
- const listboxRect = listbox.getBoundingClientRect();
200
- const optionRect = optionEl.getBoundingClientRect();
201
- if (optionRect.top < listboxRect.top) listbox.scrollTop -= listboxRect.top - optionRect.top;
202
- else if (optionRect.bottom > listboxRect.bottom) listbox.scrollTop += optionRect.bottom - listboxRect.bottom;
203
- });
204
- });
205
- return (_ctx, _cache) => {
206
- return openBlock(), createElementBlock("div", { class: normalizeClass(["astryx-selector", [`size-${props.size}`, `status-${props.status}`]]) }, [
207
- createElementVNode("div", {
208
- ref_key: "fieldRef",
209
- ref: fieldRef,
210
- class: normalizeClass(["astryx-selector-field", {
211
- "is-open": unref(combobox).isOpen.value,
212
- "is-disabled": props.disabled
213
- }])
214
- }, [createElementVNode("button", {
215
- id: selectorId,
216
- type: "button",
217
- class: normalizeClass(["astryx-selector-trigger", {
218
- "is-open": unref(combobox).isOpen.value,
219
- "is-disabled": props.disabled
220
- }]),
221
- disabled: props.disabled,
222
- "aria-haspopup": "listbox",
223
- "aria-expanded": unref(combobox).isOpen.value,
224
- "aria-controls": listboxId,
225
- "aria-label": props.label,
226
- "aria-activedescendant": unref(combobox).activeIndex.value >= 0 ? getOptionId(unref(combobox).activeIndex.value) : void 0,
227
- title: props.disabledReason,
228
- onClick: onTriggerClick,
229
- onKeydown: onTriggerKeyDown
230
- }, [createElementVNode("span", { class: normalizeClass(["astryx-selector-value", { "is-placeholder": !selectedOption.value }]) }, [unref(slots).selected ? renderSlot(_ctx.$slots, "selected", { option: selectedOption.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(displayText.value), 1)], 64))], 2), _cache[0] || (_cache[0] = createElementVNode("span", {
231
- class: "astryx-selector-icon",
232
- "aria-hidden": "true"
233
- }, [createElementVNode("svg", {
234
- width: "16",
235
- height: "16",
236
- viewBox: "0 0 16 16",
237
- fill: "none"
238
- }, [createElementVNode("path", {
239
- d: "M4 6L8 10L12 6",
240
- stroke: "currentColor",
241
- "stroke-width": "1.5",
242
- "stroke-linecap": "round",
243
- "stroke-linejoin": "round"
244
- })])], -1))], 42, _hoisted_1), props.clearable && selectedOption.value ? (openBlock(), createElementBlock("button", {
245
- key: 0,
246
- type: "button",
247
- class: "astryx-selector-clear",
248
- "aria-label": resolvedClearLabel.value,
249
- onClick: onClear
250
- }, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
251
- width: "16",
252
- height: "16",
253
- viewBox: "0 0 16 16",
254
- fill: "none"
255
- }, [createElementVNode("path", {
256
- d: "M12 4L4 12M4 4L12 12",
257
- stroke: "currentColor",
258
- "stroke-width": "1.5",
259
- "stroke-linecap": "round"
260
- })], -1)])], 8, _hoisted_2)) : createCommentVNode("v-if", true)], 2),
261
- (openBlock(), createBlock(Teleport, { to: "body" }, [withDirectives(createElementVNode("div", {
262
- id: listboxId,
263
- ref_key: "listboxRef",
264
- ref: listboxRef,
265
- role: "listbox",
266
- class: "astryx-selector-listbox",
267
- "data-placement": unref(position).placement,
268
- style: normalizeStyle(listboxStyle.value),
269
- tabindex: "-1"
270
- }, [props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("input", {
271
- id: `${selectorId}-search`,
272
- ref_key: "searchInputRef",
273
- ref: searchInputRef,
274
- type: "text",
275
- class: "astryx-selector-search-input",
276
- "aria-label": resolvedSearchPlaceholder.value,
277
- placeholder: resolvedSearchPlaceholder.value,
278
- value: unref(combobox).searchQuery.value,
279
- onInput: onSearchInput
280
- }, null, 40, _hoisted_5)])) : createCommentVNode("v-if", true), !isEmpty.value ? (openBlock(), createElementBlock("div", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(combobox).filteredOptions.value, (option, index) => {
281
- return openBlock(), createElementBlock("div", {
282
- id: getOptionId(index),
283
- key: option.value,
284
- role: "option",
285
- tabindex: "0",
286
- class: normalizeClass(["astryx-selector-option", {
287
- "is-active": index === unref(combobox).activeIndex.value,
288
- "is-selected": option.value === props.modelValue,
289
- "is-disabled": option.disabled
290
- }]),
291
- "aria-selected": option.value === props.modelValue,
292
- "aria-disabled": option.disabled,
293
- onClick: ($event) => onOptionClick(option),
294
- onKeydown: [withKeys(($event) => onOptionClick(option), ["enter"]), withKeys(withModifiers(($event) => onOptionClick(option), ["prevent"]), ["space"])]
295
- }, [unref(slots).option ? renderSlot(_ctx.$slots, "option", {
296
- option,
297
- isActive: index === unref(combobox).activeIndex.value,
298
- isSelected: option.value === props.modelValue
299
- }, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_8, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(option.description), 1)) : createCommentVNode("v-if", true)], 64))], 42, _hoisted_7);
300
- }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_10, [unref(slots).empty ? renderSlot(_ctx.$slots, "empty", {}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(resolvedEmptyText.value), 1)], 64))]))], 12, _hoisted_3), [[vShow, unref(combobox).isOpen.value]])])),
301
- props.name ? (openBlock(), createElementBlock("select", {
302
- key: 0,
303
- id: `${selectorId}-hidden-select`,
304
- name: props.name,
305
- value: props.modelValue ?? "",
306
- "aria-label": props.label || resolvedPlaceholder.value,
307
- tabindex: "-1",
308
- style: {
309
- "position": "absolute",
310
- "left": "-9999px",
311
- "width": "1px",
312
- "height": "1px"
313
- }
314
- }, [_cache[2] || (_cache[2] = createElementVNode("option", { value: "" }, null, -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
315
- return openBlock(), createElementBlock("option", {
316
- key: option.value,
317
- value: option.value
318
- }, toDisplayString(option.label), 9, _hoisted_12);
319
- }), 128))], 8, _hoisted_11)) : createCommentVNode("v-if", true)
320
- ], 2);
321
- };
322
- }
323
- });
324
- //#endregion
325
- export { _sfc_main as t };