@wirecore/wirelayer-vue 0.6.0 → 0.8.0

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 (158) hide show
  1. package/dist/{Checkbox-D9f77jtl.js → Checkbox-DS2qfQK1.js} +28 -30
  2. package/dist/ContextMenu-B6agwyf_.js +2311 -0
  3. package/dist/{Field-B1EsNF84.js → Field-Cqe2BG_x.js} +1 -1
  4. package/dist/{Highlight-Cg8DvCfq.js → Highlight-uwptdaUw.js} +35 -32
  5. package/dist/Input-C5dyvZfJ.js +183 -0
  6. package/dist/{InputStatus-D7kBGlew.js → InputStatus-Cgarj-yu.js} +16 -3
  7. package/dist/{Select-DAuYpE1c.js → Select-CeZbSy6K.js} +137 -112
  8. package/dist/Slider-Cpv7Vj3B.js +143 -0
  9. package/dist/Tree-DgHt0P5P.js +807 -0
  10. package/dist/chart.js +1 -1
  11. package/dist/components/Alert/Alert.vue.d.ts +5 -3
  12. package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
  13. package/dist/components/AngleSlider/AngleSlider.vue.d.ts +2 -0
  14. package/dist/components/AngleSlider/AngleSlider.vue.d.ts.map +1 -1
  15. package/dist/components/Autocomplete/Autocomplete.vue.d.ts +2 -0
  16. package/dist/components/Autocomplete/Autocomplete.vue.d.ts.map +1 -1
  17. package/dist/components/Carousel/Carousel.vue.d.ts +2 -0
  18. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  19. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts +2 -0
  20. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts.map +1 -1
  21. package/dist/components/Checkbox/Checkbox.vue.d.ts +28 -23
  22. package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
  23. package/dist/components/ColorInput/ColorInput.vue.d.ts.map +1 -1
  24. package/dist/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
  25. package/dist/components/ColorPicker/ColorPicker.vue.d.ts.map +1 -1
  26. package/dist/components/Combobox/Combobox.vue.d.ts +11 -1
  27. package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
  28. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +1 -1
  29. package/dist/components/Confirm/ConfirmDialog.vue.d.ts +5 -0
  30. package/dist/components/Confirm/ConfirmDialog.vue.d.ts.map +1 -1
  31. package/dist/components/Confirm/confirm.d.ts +7 -0
  32. package/dist/components/Confirm/confirm.d.ts.map +1 -1
  33. package/dist/components/ContextMenu/ContextMenu.vue.d.ts +17 -1
  34. package/dist/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -1
  35. package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -0
  36. package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
  37. package/dist/components/DatePicker/DatePickerBase.vue.d.ts +2 -0
  38. package/dist/components/DatePicker/DatePickerBase.vue.d.ts.map +1 -1
  39. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts +2 -0
  40. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts.map +1 -1
  41. package/dist/components/Dialog/Dialog.vue.d.ts +1 -1
  42. package/dist/components/Dialog/DialogContent.vue.d.ts +7 -0
  43. package/dist/components/Dialog/DialogContent.vue.d.ts.map +1 -1
  44. package/dist/components/Drawer/Drawer.vue.d.ts +1 -1
  45. package/dist/components/Drawer/DrawerContent.vue.d.ts +2 -0
  46. package/dist/components/Drawer/DrawerContent.vue.d.ts.map +1 -1
  47. package/dist/components/DurationInput/DurationInput.vue.d.ts +2 -0
  48. package/dist/components/DurationInput/DurationInput.vue.d.ts.map +1 -1
  49. package/dist/components/Fieldset/Fieldset.vue.d.ts +1 -1
  50. package/dist/components/FilterPanel/FilterPanel.vue.d.ts +1 -1
  51. package/dist/components/HoverCard/HoverCard.vue.d.ts +1 -1
  52. package/dist/components/IconButton/IconButton.vue.d.ts +2 -0
  53. package/dist/components/IconButton/IconButton.vue.d.ts.map +1 -1
  54. package/dist/components/Input/Input.vue.d.ts +3 -1
  55. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  56. package/dist/components/Knob/Knob.vue.d.ts +2 -0
  57. package/dist/components/Knob/Knob.vue.d.ts.map +1 -1
  58. package/dist/components/Listbox/Listbox.vue.d.ts +2 -0
  59. package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
  60. package/dist/components/MaskInput/MaskInput.vue.d.ts +2 -1
  61. package/dist/components/MaskInput/MaskInput.vue.d.ts.map +1 -1
  62. package/dist/components/Menu/Menu.vue.d.ts +9 -1
  63. package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
  64. package/dist/components/Menu/state.d.ts +22 -0
  65. package/dist/components/Menu/state.d.ts.map +1 -1
  66. package/dist/components/MonthPicker/MonthPicker.vue.d.ts +2 -0
  67. package/dist/components/MonthPicker/MonthPicker.vue.d.ts.map +1 -1
  68. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  69. package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -1
  70. package/dist/components/NativeSelect/NativeSelect.vue.d.ts +26 -17
  71. package/dist/components/NativeSelect/NativeSelect.vue.d.ts.map +1 -1
  72. package/dist/components/NumberInput/NumberInput.vue.d.ts +3 -1
  73. package/dist/components/NumberInput/NumberInput.vue.d.ts.map +1 -1
  74. package/dist/components/Panel/Panel.vue.d.ts +1 -1
  75. package/dist/components/PasswordInput/PasswordInput.vue.d.ts +11 -3
  76. package/dist/components/PasswordInput/PasswordInput.vue.d.ts.map +1 -1
  77. package/dist/components/PinInput/PinInput.vue.d.ts +2 -0
  78. package/dist/components/PinInput/PinInput.vue.d.ts.map +1 -1
  79. package/dist/components/Popover/Popover.vue.d.ts +1 -1
  80. package/dist/components/Progress/Progress.vue.d.ts +11 -0
  81. package/dist/components/Progress/Progress.vue.d.ts.map +1 -1
  82. package/dist/components/RadioGroup/RadioGroup.vue.d.ts +24 -25
  83. package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
  84. package/dist/components/RadioGroup/RadioGroupItem.vue.d.ts +2 -1
  85. package/dist/components/RadioGroup/RadioGroupItem.vue.d.ts.map +1 -1
  86. package/dist/components/RadioGroup/context.d.ts +4 -0
  87. package/dist/components/RadioGroup/context.d.ts.map +1 -0
  88. package/dist/components/Rating/Rating.vue.d.ts +2 -0
  89. package/dist/components/Rating/Rating.vue.d.ts.map +1 -1
  90. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +23 -22
  91. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
  92. package/dist/components/Select/Select.vue.d.ts +11 -1
  93. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  94. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts +2 -0
  95. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts.map +1 -1
  96. package/dist/components/Slider/Slider.vue.d.ts +2 -0
  97. package/dist/components/Slider/Slider.vue.d.ts.map +1 -1
  98. package/dist/components/Switch/Switch.vue.d.ts +2 -0
  99. package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
  100. package/dist/components/TagsInput/TagsInput.vue.d.ts +2 -0
  101. package/dist/components/TagsInput/TagsInput.vue.d.ts.map +1 -1
  102. package/dist/components/Textarea/Textarea.vue.d.ts +3 -1
  103. package/dist/components/Textarea/Textarea.vue.d.ts.map +1 -1
  104. package/dist/components/TimePicker/TimePicker.vue.d.ts +2 -0
  105. package/dist/components/TimePicker/TimePicker.vue.d.ts.map +1 -1
  106. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -0
  107. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts.map +1 -1
  108. package/dist/components/Tooltip/Tooltip.vue.d.ts +3 -0
  109. package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
  110. package/dist/components/TreeSelect/TreeSelect.vue.d.ts +2 -0
  111. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  112. package/dist/components/YearPicker/YearPicker.vue.d.ts +2 -0
  113. package/dist/components/YearPicker/YearPicker.vue.d.ts.map +1 -1
  114. package/dist/data-table/DataTable.vue.d.ts +9 -1
  115. package/dist/data-table/DataTable.vue.d.ts.map +1 -1
  116. package/dist/data-table.js +1007 -994
  117. package/dist/editor.js +1 -1
  118. package/dist/form/FormField.vue.d.ts +3 -0
  119. package/dist/form/FormField.vue.d.ts.map +1 -1
  120. package/dist/form.js +8 -5
  121. package/dist/index.d.ts +2 -1
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +5834 -5626
  124. package/dist/label-for-eQvYjsM5.js +8 -0
  125. package/dist/pdf.js +3 -3
  126. package/dist/sources/ActionBar.css +1 -0
  127. package/dist/sources/AppShell.css +1 -0
  128. package/dist/sources/ChatPrompt.css +1 -0
  129. package/dist/sources/Gallery.css +1 -0
  130. package/dist/sources/IconButton.css +1 -0
  131. package/dist/sources/Image.css +1 -0
  132. package/dist/sources/ImageCropper.css +1 -0
  133. package/dist/sources/InlineEdit.css +1 -0
  134. package/dist/sources/Marquee.css +1 -0
  135. package/dist/sources/MegaMenu.css +1 -0
  136. package/dist/sources/Menubar.css +1 -0
  137. package/dist/sources/OrderList.css +1 -0
  138. package/dist/sources/PickList.css +1 -0
  139. package/dist/sources/ScrollTop.css +1 -0
  140. package/dist/{useTree-H8XsFHMk.js → useTree-UhG1TMeM.js} +1 -1
  141. package/dist/utils/label-for.d.ts +3 -0
  142. package/dist/utils/label-for.d.ts.map +1 -0
  143. package/dist/utils/list.d.ts +5 -0
  144. package/dist/utils/list.d.ts.map +1 -1
  145. package/dist/utils/text-field.d.ts +16 -0
  146. package/dist/utils/text-field.d.ts.map +1 -0
  147. package/dist/virtual/VirtualSelect.vue.d.ts +2 -0
  148. package/dist/virtual/VirtualSelect.vue.d.ts.map +1 -1
  149. package/dist/virtual.js +207 -197
  150. package/fonts.css +2 -0
  151. package/llms-full.txt +254 -23
  152. package/llms.txt +9 -5
  153. package/package.json +7 -3
  154. package/theme.css +14 -0
  155. package/dist/ContextMenu-C5JKyNlX.js +0 -2209
  156. package/dist/Input-BhnYMKjE.js +0 -168
  157. package/dist/Slider-CyoZc5A8.js +0 -135
  158. package/dist/Tree-DWxqSrO6.js +0 -789
@@ -1,17 +1,18 @@
1
1
  import { a as e, n as t } from "./recipes-BlM9aKyt.js";
2
2
  import { t as n } from "./attrs-KNjeRUCf.js";
3
- import { a as r, n as i, r as a } from "./Highlight-Cg8DvCfq.js";
3
+ import { a as r, n as i, r as a } from "./Highlight-uwptdaUw.js";
4
4
  import { Fragment as o, Teleport as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeProps as v, nextTick as ee, normalizeClass as y, normalizeProps as b, onBeforeUnmount as x, onMounted as S, openBlock as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useAttrs as te, useId as ne, watch as A, withCtx as j } from "vue";
5
5
  import { Check as M, ChevronDown as re, LoaderCircle as N, X as ie } from "@lucide/vue";
6
- import { select as ae, spinner as P } from "@wirecore/wirelayer-recipes";
7
- import { createListCollection as oe } from "@ark-ui/vue/collection";
6
+ import { controlIds as ae, select as oe, spinner as P } from "@wirecore/wirelayer-recipes";
7
+ import { useFieldContext as se } from "@ark-ui/vue/field";
8
+ import { createListCollection as ce } from "@ark-ui/vue/collection";
8
9
  import { Select as F } from "@ark-ui/vue/select";
9
10
  //#region src/components/Spinner/Spinner.vue?vue&type=script&setup=true&lang.ts
10
11
  var I = [
11
12
  "aria-label",
12
13
  "aria-valuenow",
13
14
  "aria-valuetext"
14
- ], se = ["stroke-dasharray"], L = /* @__PURE__ */ g({
15
+ ], L = ["stroke-dasharray"], R = /* @__PURE__ */ g({
15
16
  inheritAttrs: !1,
16
17
  __name: "Spinner",
17
18
  props: {
@@ -56,9 +57,9 @@ var I = [
56
57
  "stroke-width": "3",
57
58
  "stroke-linecap": "round",
58
59
  "stroke-dasharray": `${l.value / 100 * u} ${u}`
59
- }, null, 10, se)], 2))], 16, I));
60
+ }, null, 10, L)], 2))], 16, I));
60
61
  }
61
- }), R = ["data-state"], z = /* @__PURE__ */ g({
62
+ }), z = ["data-state"], B = /* @__PURE__ */ g({
62
63
  __name: "ListOption",
63
64
  props: {
64
65
  parts: {},
@@ -84,7 +85,7 @@ var I = [
84
85
  }, [t.selected ? (C(), l(k(M), {
85
86
  key: 0,
86
87
  class: y(e.classes.checkIcon)
87
- }, null, 8, ["class"])) : u("", !0)], 10, R)]),
88
+ }, null, 8, ["class"])) : u("", !0)], 10, z)]),
88
89
  _: 1
89
90
  })) : u("", !0),
90
91
  t.$slots.item ? (C(), l(D(e.parts.ItemContext), { key: 1 }, {
@@ -128,7 +129,7 @@ var I = [
128
129
  "draggable"
129
130
  ]));
130
131
  }
131
- }), B = /* @__PURE__ */ g({
132
+ }), V = /* @__PURE__ */ g({
132
133
  __name: "LoadMore",
133
134
  props: {
134
135
  active: { type: Boolean },
@@ -148,7 +149,7 @@ var I = [
148
149
  "aria-hidden": "true"
149
150
  }, null, 512));
150
151
  }
151
- }), V = /* @__PURE__ */ g({
152
+ }), H = /* @__PURE__ */ g({
152
153
  __name: "ListOptions",
153
154
  props: {
154
155
  parts: {},
@@ -166,7 +167,7 @@ var I = [
166
167
  setup(e, { emit: t }) {
167
168
  let n = t;
168
169
  return (t, r) => (C(), d(o, null, [
169
- (C(!0), d(o, null, T(e.groups, (n, r) => (C(), d(o, { key: n.label ?? `#${r}` }, [n.label === void 0 ? (C(!0), d(o, { key: 1 }, T(n.options, (n) => (C(), l(z, {
170
+ (C(!0), d(o, null, T(e.groups, (n, r) => (C(), d(o, { key: n.label ?? `#${r}` }, [n.label === void 0 ? (C(!0), d(o, { key: 1 }, T(n.options, (n) => (C(), l(B, {
170
171
  key: n.key,
171
172
  parts: e.parts,
172
173
  option: n,
@@ -192,7 +193,7 @@ var I = [
192
193
  default: j(() => [(C(), l(D(e.parts.ItemGroupLabel), { class: y(e.classes.groupLabel) }, {
193
194
  default: j(() => [m(O(n.label), 1)]),
194
195
  _: 2
195
- }, 1032, ["class"])), (C(!0), d(o, null, T(n.options, (n) => (C(), l(z, {
196
+ }, 1032, ["class"])), (C(!0), d(o, null, T(n.options, (n) => (C(), l(B, {
196
197
  key: n.key,
197
198
  parts: e.parts,
198
199
  option: n,
@@ -227,7 +228,7 @@ var I = [
227
228
  class: y(e.classes.loadingIcon),
228
229
  "aria-hidden": "true"
229
230
  }, null, 8, ["class"]), m(" " + O(e.loadingText), 1)], 2)) : u("", !0),
230
- e.hasMore ? (C(), l(B, {
231
+ e.hasMore ? (C(), l(V, {
231
232
  key: 2,
232
233
  class: y(e.classes.sentinel),
233
234
  active: !e.loading,
@@ -240,14 +241,14 @@ var I = [
240
241
  ])) : u("", !0)
241
242
  ], 64));
242
243
  }
243
- }), ce = ["aria-label", "onClick"], le = [
244
+ }), le = ["aria-label", "onClick"], ue = [
244
245
  "aria-controls",
245
246
  "aria-activedescendant",
246
247
  "aria-label",
247
248
  "placeholder",
248
249
  "value",
249
250
  "onInput"
250
- ], H = /* @__PURE__ */ g({
251
+ ], U = /* @__PURE__ */ g({
251
252
  inheritAttrs: !1,
252
253
  __name: "Select",
253
254
  props: {
@@ -286,152 +287,175 @@ var I = [
286
287
  minSearchLength: {},
287
288
  pageSize: {},
288
289
  standalone: { type: Boolean },
290
+ open: {
291
+ type: Boolean,
292
+ default: void 0
293
+ },
294
+ stopKeyPropagation: { type: Boolean },
295
+ id: {},
289
296
  classes: {}
290
297
  },
291
298
  emits: [
292
299
  "update:modelValue",
293
300
  "filterChange",
294
- "loadMore"
301
+ "loadMore",
302
+ "update:open"
295
303
  ],
296
304
  setup(g, { emit: x }) {
297
- let T = e(), M = g, P = t("select", ae, () => M.classes), I = x, se = te(), L = c(() => n(se)), R = c(() => P({
305
+ let T = e(), M = g, P = t("select", oe, () => M.classes), I = x, L = te(), R = c(() => n(L)), z = c(() => P({
298
306
  size: M.size,
299
307
  clearable: M.clearable
300
- })), z = T.select, B = c(() => ({
308
+ })), B = T.select, V = c(() => ({
301
309
  itemValue: M.itemValue,
302
310
  itemLabel: M.itemLabel,
303
311
  itemDisabled: M.itemDisabled,
304
312
  itemGroup: M.itemGroup,
305
313
  itemKeywords: M.itemKeywords,
306
314
  valueKey: M.valueKey
307
- })), H = w(""), U = r({
315
+ })), U = w(""), W = r({
308
316
  items: () => M.items,
309
317
  source: () => M.dataSource,
310
- accessors: () => B.value,
318
+ accessors: () => V.value,
311
319
  pageSize: () => M.pageSize,
312
320
  minSearchLength: () => M.minSearchLength
313
- }), { options: ue, groups: W, ordered: G } = i(() => U.items.value, () => B.value, () => M.filter && !M.manualFilter && !M.dataSource ? H.value : ""), K = c(() => [...ue.value, ...U.resolvedOptions.value]), { selected: q, keys: J, commit: Y, commitKeys: de } = a({
321
+ }), { options: de, groups: G, ordered: K } = i(() => W.items.value, () => V.value, () => M.filter && !M.manualFilter && !M.dataSource ? U.value : ""), q = c(() => [...de.value, ...W.resolvedOptions.value]), { selected: J, keys: Y, commit: X, commitKeys: fe } = a({
314
322
  multiple: !1,
315
323
  model: () => M.modelValue,
316
324
  defaultValue: M.defaultValue,
317
- accessors: () => B.value,
318
- items: K,
319
- emit: (e) => I("update:modelValue", e)
325
+ accessors: () => V.value,
326
+ items: q,
327
+ emit: (e) => I("update:modelValue", e),
328
+ check: {
329
+ component: "Select",
330
+ ready: () => !M.dataSource && !M.loading && M.items.length > 0
331
+ }
320
332
  });
321
- S(() => U.resolve(J.value, K.value)), A(J, (e) => U.resolve(e, K.value));
322
- let X = c(() => M.loading || U.loading.value), Z = c(() => M.hasMore || U.hasMore.value);
323
- function fe() {
324
- M.dataSource ? U.loadMore() : I("loadMore");
333
+ S(() => W.resolve(Y.value, q.value)), A(Y, (e) => W.resolve(e, q.value));
334
+ let Z = c(() => M.loading || W.loading.value), Q = c(() => M.hasMore || W.hasMore.value);
335
+ function pe() {
336
+ M.dataSource ? W.loadMore() : I("loadMore");
325
337
  }
326
- let Q = c(() => q.value[0]), pe = c(() => oe({
327
- items: G.value,
338
+ let $ = c(() => J.value[0]), me = c(() => ce({
339
+ items: K.value,
328
340
  itemToString: (e) => e.label,
329
341
  itemToValue: (e) => e.key,
330
342
  isItemDisabled: (e) => e.disabled
331
- })), me = ne(), he = c(() => M.emptyText ?? U.emptyText.value ?? (H.value ? T.common.noResults : T.common.empty)), $ = c(() => ({
332
- item: R.value.item(),
333
- itemText: R.value.itemText(),
334
- icon: R.value.icon(),
335
- itemIndicator: R.value.itemIndicator(),
336
- itemBody: R.value.itemBody(),
337
- itemDescription: R.value.itemDescription(),
338
- group: R.value.group(),
339
- groupLabel: R.value.groupLabel(),
340
- loading: R.value.loading(),
341
- loadingIcon: R.value.loadingIcon(),
342
- sentinel: R.value.sentinel(),
343
- empty: R.value.empty()
343
+ })), he = ne(), ge = c(() => M.emptyText ?? W.emptyText.value ?? (U.value ? T.common.noResults : T.common.empty)), _e = c(() => ({
344
+ item: z.value.item(),
345
+ itemText: z.value.itemText(),
346
+ icon: z.value.icon(),
347
+ itemIndicator: z.value.itemIndicator(),
348
+ itemBody: z.value.itemBody(),
349
+ itemDescription: z.value.itemDescription(),
350
+ group: z.value.group(),
351
+ groupLabel: z.value.groupLabel(),
352
+ loading: z.value.loading(),
353
+ loadingIcon: z.value.loadingIcon(),
354
+ sentinel: z.value.sentinel(),
355
+ empty: z.value.empty()
344
356
  }));
345
- function ge(e) {
346
- Y([]), e.focus();
357
+ function ve(e) {
358
+ X([]), e.focus();
347
359
  }
348
- function _e(e) {
349
- M.clearable && q.value.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), Y([]));
360
+ function ye(e) {
361
+ M.stopKeyPropagation && e.key === "Enter" && e.stopPropagation(), M.clearable && J.value.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), X([]));
350
362
  }
351
- function ve(e, t) {
352
- H.value = t.target.value, I("filterChange", H.value), M.dataSource && U.search(H.value), !(M.manualFilter || M.dataSource) && ee(() => {
353
- let t = G.value.find((e) => !e.disabled);
363
+ function be(e, t) {
364
+ U.value = t.target.value, I("filterChange", U.value), M.dataSource && W.search(U.value), !(M.manualFilter || M.dataSource) && ee(() => {
365
+ let t = K.value.find((e) => !e.disabled);
354
366
  t && e.setHighlightValue(t.key);
355
367
  });
356
368
  }
357
- function ye(e) {
369
+ function xe(e) {
358
370
  (e.key === " " || e.key === "Home" || e.key === "End") && e.stopPropagation();
359
371
  }
360
- function be(e) {
361
- e && U.open(), !e && H.value && (H.value = "", I("filterChange", ""), M.dataSource && U.search(""));
372
+ function Se(e) {
373
+ M.stopKeyPropagation && [
374
+ "Enter",
375
+ "Escape",
376
+ "Tab"
377
+ ].includes(e.key) && e.stopPropagation();
378
+ }
379
+ function Ce(e) {
380
+ I("update:open", e), e && W.open(), !e && U.value && (U.value = "", I("filterChange", ""), M.dataSource && W.search(""));
362
381
  }
363
- let xe = (e) => e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0, Se = {
382
+ let we = (e) => e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0, Te = {
364
383
  sameWidth: !0,
365
384
  gutter: 4
366
- };
385
+ }, Ee = se(), De = c(() => ae(M.id, "trigger", {
386
+ label: Ee?.value.ids.label,
387
+ hiddenSelect: Ee?.value.ids.control
388
+ }, M.standalone));
367
389
  return (e, t) => (C(), l(k(F).Root, v({
368
- class: R.value.base({ class: L.value.className }),
369
- style: L.value.style,
370
- collection: pe.value,
371
- "model-value": k(J),
390
+ class: z.value.base({ class: R.value.className }),
391
+ style: R.value.style,
392
+ collection: me.value,
393
+ "model-value": k(Y),
372
394
  disabled: g.disabled,
373
395
  invalid: g.invalid,
374
396
  required: g.required,
375
397
  name: g.name,
376
- positioning: Se,
377
- composite: !g.filter
378
- }, g.standalone ? { ids: {} } : {}, {
398
+ positioning: Te,
399
+ composite: !g.filter,
400
+ open: g.open
401
+ }, De.value, {
379
402
  "lazy-mount": "",
380
403
  "unmount-on-exit": "",
381
- onValueChange: t[0] ||= (e) => k(de)(e.value, e.items),
382
- onOpenChange: t[1] ||= (e) => be(e.open)
404
+ onValueChange: t[0] ||= (e) => k(fe)(e.value, e.items),
405
+ onOpenChange: t[1] ||= (e) => Ce(e.open)
383
406
  }), {
384
407
  default: j(() => [
385
- h(k(F).Control, b(_(g.clearable ? { class: R.value.control() } : {})), {
386
- default: j(() => [h(k(F).Trigger, v(L.value.rest, {
387
- class: R.value.trigger(),
408
+ h(k(F).Control, b(_(g.clearable ? { class: z.value.control() } : {})), {
409
+ default: j(() => [h(k(F).Trigger, v(R.value.rest, {
410
+ class: z.value.trigger(),
388
411
  "aria-busy": g.loading || void 0,
389
- onKeydown: _e
412
+ onKeydown: ye
390
413
  }), {
391
- default: j(() => [f("span", { class: y(R.value.value()) }, [e.$slots.value && Q.value ? E(e.$slots, "value", { item: Q.value.item }, void 0, void 0, 0) : (C(), d(o, { key: 1 }, [Q.value?.icon ? (C(), l(D(Q.value.icon), {
414
+ default: j(() => [f("span", { class: y(z.value.value()) }, [e.$slots.value && $.value ? E(e.$slots, "value", { item: $.value.item }, void 0, void 0, 0) : (C(), d(o, { key: 1 }, [$.value?.icon ? (C(), l(D($.value.icon), {
392
415
  key: 0,
393
- class: y(R.value.icon()),
416
+ class: y(z.value.icon()),
394
417
  "aria-hidden": "true"
395
- }, null, 8, ["class"])) : u("", !0), h(k(F).ValueText, { placeholder: g.placeholder ?? k(T).common.placeholder }, p({ _: 2 }, [Q.value ? {
418
+ }, null, 8, ["class"])) : u("", !0), h(k(F).ValueText, { placeholder: g.placeholder ?? k(T).common.placeholder }, p({ _: 2 }, [$.value ? {
396
419
  name: "default",
397
- fn: j(() => [m(O(Q.value.label), 1)]),
420
+ fn: j(() => [m(O($.value.label), 1)]),
398
421
  key: "0"
399
- } : void 0]), 1032, ["placeholder"])], 64))], 2), h(k(F).Indicator, { class: y(R.value.indicator()) }, {
422
+ } : void 0]), 1032, ["placeholder"])], 64))], 2), h(k(F).Indicator, { class: y(z.value.indicator()) }, {
400
423
  default: j(() => [g.loading ? (C(), l(k(N), {
401
424
  key: 0,
402
- class: y(R.value.spinner()),
425
+ class: y(z.value.spinner()),
403
426
  "aria-hidden": "true"
404
427
  }, null, 8, ["class"])) : (C(), l(k(re), {
405
428
  key: 1,
406
- class: y(R.value.indicatorIcon()),
429
+ class: y(z.value.indicatorIcon()),
407
430
  "aria-hidden": "true"
408
431
  }, null, 8, ["class"]))]),
409
432
  _: 1
410
433
  }, 8, ["class"])]),
411
434
  _: 3
412
435
  }, 16, ["class", "aria-busy"]), g.clearable ? (C(), l(k(F).Context, { key: 0 }, {
413
- default: j((e) => [Q.value && !e.disabled ? (C(), d("button", {
436
+ default: j((e) => [$.value && !e.disabled ? (C(), d("button", {
414
437
  key: 0,
415
438
  type: "button",
416
439
  tabindex: "-1",
417
- class: y(R.value.clear()),
418
- "aria-label": k(z).clear,
419
- onClick: (t) => ge(e)
440
+ class: y(z.value.clear()),
441
+ "aria-label": k(B).clear,
442
+ onClick: (t) => ve(e)
420
443
  }, [h(k(ie), {
421
- class: y(R.value.clearIcon()),
444
+ class: y(z.value.clearIcon()),
422
445
  "aria-hidden": "true"
423
- }, null, 8, ["class"])], 10, ce)) : u("", !0)]),
446
+ }, null, 8, ["class"])], 10, le)) : u("", !0)]),
424
447
  _: 1
425
448
  })) : u("", !0)]),
426
449
  _: 3
427
450
  }, 16),
428
451
  (C(), l(s, { to: "body" }, [h(k(F).Positioner, null, {
429
452
  default: j(() => [h(k(F).Content, {
430
- class: y(R.value.content()),
431
- "aria-busy": X.value || void 0,
432
- "aria-label": g.filter ? L.value.rest["aria-label"] : void 0
453
+ class: y(z.value.content()),
454
+ "aria-busy": Z.value || void 0,
455
+ "aria-label": g.filter ? R.value.rest["aria-label"] : void 0,
456
+ onKeydown: Se
433
457
  }, {
434
- default: j(() => [g.filter ? (C(), d(o, { key: 0 }, [f("div", { class: y(R.value.header()) }, [h(k(F).Context, null, {
458
+ default: j(() => [g.filter ? (C(), d(o, { key: 0 }, [f("div", { class: y(z.value.header()) }, [h(k(F).Context, null, {
435
459
  default: j((e) => [f("input", {
436
460
  type: "text",
437
461
  role: "combobox",
@@ -439,29 +463,29 @@ var I = [
439
463
  "aria-autocomplete": "list",
440
464
  "aria-expanded": "true",
441
465
  "data-autofocus": "",
442
- "aria-controls": k(me),
443
- "aria-activedescendant": xe(e),
444
- "aria-label": k(z).filter,
466
+ "aria-controls": k(he),
467
+ "aria-activedescendant": we(e),
468
+ "aria-label": k(B).filter,
445
469
  placeholder: k(T).combobox.search,
446
- value: H.value,
447
- class: y(R.value.search()),
448
- onInput: (t) => ve(e, t),
449
- onKeydown: ye
450
- }, null, 42, le)]),
470
+ value: U.value,
471
+ class: y(z.value.search()),
472
+ onInput: (t) => be(e, t),
473
+ onKeydown: xe
474
+ }, null, 42, ue)]),
451
475
  _: 1
452
476
  })], 2), h(k(F).List, {
453
- id: k(me),
454
- class: y(R.value.list())
477
+ id: k(he),
478
+ class: y(z.value.list())
455
479
  }, {
456
- default: j(() => [h(V, {
480
+ default: j(() => [h(H, {
457
481
  parts: k(F),
458
- groups: k(W),
459
- classes: $.value,
460
- loading: X.value,
482
+ groups: k(G),
483
+ classes: _e.value,
484
+ loading: Z.value,
461
485
  "loading-text": g.loadingText ?? k(T).common.loading,
462
- "has-more": Z.value,
463
- "empty-text": he.value,
464
- onLoadMore: fe
486
+ "has-more": Q.value,
487
+ "empty-text": ge.value,
488
+ onLoadMore: pe
465
489
  }, p({ _: 2 }, [e.$slots.item ? {
466
490
  name: "item",
467
491
  fn: j((t) => [E(e.$slots, "item", b(_(t)))]),
@@ -476,16 +500,16 @@ var I = [
476
500
  "empty-text"
477
501
  ])]),
478
502
  _: 3
479
- }, 8, ["id", "class"])], 64)) : (C(), l(V, {
503
+ }, 8, ["id", "class"])], 64)) : (C(), l(H, {
480
504
  key: 1,
481
505
  parts: k(F),
482
- groups: k(W),
483
- classes: $.value,
484
- loading: X.value,
506
+ groups: k(G),
507
+ classes: _e.value,
508
+ loading: Z.value,
485
509
  "loading-text": g.loadingText ?? k(T).common.loading,
486
- "has-more": Z.value,
487
- "empty-text": he.value,
488
- onLoadMore: fe
510
+ "has-more": Q.value,
511
+ "empty-text": ge.value,
512
+ onLoadMore: pe
489
513
  }, p({ _: 2 }, [e.$slots.item ? {
490
514
  name: "item",
491
515
  fn: j((t) => [E(e.$slots, "item", b(_(t)))]),
@@ -511,8 +535,8 @@ var I = [
511
535
  g.dataSource ? (C(), d("span", {
512
536
  key: 0,
513
537
  role: "status",
514
- class: y(R.value.status())
515
- }, O(k(U).announcement.value), 3)) : u("", !0)
538
+ class: y(z.value.status())
539
+ }, O(k(W).announcement.value), 3)) : u("", !0)
516
540
  ]),
517
541
  _: 3
518
542
  }, 16, [
@@ -524,9 +548,10 @@ var I = [
524
548
  "invalid",
525
549
  "required",
526
550
  "name",
527
- "composite"
551
+ "composite",
552
+ "open"
528
553
  ]));
529
554
  }
530
555
  });
531
556
  //#endregion
532
- export { L as i, V as n, B as r, H as t };
557
+ export { R as i, H as n, V as r, U as t };
@@ -0,0 +1,143 @@
1
+ import { a as e, n as t } from "./recipes-BlM9aKyt.js";
2
+ import { t as n } from "./label-for-eQvYjsM5.js";
3
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, useAttrs as y, useId as b, withCtx as x } from "vue";
4
+ import { slider as S, snapToMarks as C } from "@wirecore/wirelayer-recipes";
5
+ import { Slider as w } from "@ark-ui/vue/slider";
6
+ //#region src/components/Slider/Slider.vue?vue&type=script&setup=true&lang.ts
7
+ var T = ["id"], E = ["data-orientation"], D = /* @__PURE__ */ d({
8
+ inheritAttrs: !1,
9
+ __name: "Slider",
10
+ props: {
11
+ modelValue: { default: void 0 },
12
+ defaultValue: { default: () => [0] },
13
+ min: { default: 0 },
14
+ max: { default: 100 },
15
+ step: { default: 1 },
16
+ label: {},
17
+ thumbLabels: {},
18
+ showValue: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ hideLabel: { type: Boolean },
23
+ formatValue: {
24
+ type: Function,
25
+ default: String
26
+ },
27
+ disabled: {
28
+ type: Boolean,
29
+ default: void 0
30
+ },
31
+ name: {},
32
+ orientation: { default: void 0 },
33
+ marks: { default: void 0 },
34
+ restrictToMarks: { type: Boolean },
35
+ minRange: { default: void 0 },
36
+ classes: {}
37
+ },
38
+ emits: ["update:modelValue", "valueChangeEnd"],
39
+ setup(d, { emit: D }) {
40
+ let O = e(), k = d, A = t("slider", S, () => k.classes), j = D, M = y();
41
+ n("Slider", () => M.id);
42
+ let N = i(() => A({
43
+ withMarks: !!k.marks?.length,
44
+ hideLabel: k.hideLabel,
45
+ hideHeader: k.hideLabel && !k.showValue
46
+ })), P = i(() => (k.marks ?? []).map((e) => typeof e == "number" ? { value: e } : e)), F = h(k.defaultValue), I = i(() => k.restrictToMarks && P.value.length > 0), L = i(() => I.value ? k.modelValue ?? F.value : k.modelValue);
47
+ function R(e) {
48
+ if (!I.value) return j("update:modelValue", e);
49
+ let t = C(e, L.value ?? k.defaultValue, P.value.map((e) => e.value));
50
+ F.value = t, j("update:modelValue", t);
51
+ }
52
+ let z = b(), B = `${z}label`, V = i(() => (k.modelValue ?? k.defaultValue).length);
53
+ return (e, t) => (m(), a(v(w).Root, f({
54
+ ...v(M),
55
+ class: N.value.base({ class: p(v(M).class) })
56
+ }, {
57
+ ids: { label: B },
58
+ "model-value": L.value,
59
+ "default-value": d.defaultValue,
60
+ min: d.min,
61
+ max: d.max,
62
+ step: d.step,
63
+ disabled: d.disabled,
64
+ name: d.name,
65
+ orientation: d.orientation,
66
+ "min-steps-between-thumbs": d.minRange ? Math.ceil(d.minRange / d.step) : void 0,
67
+ "get-aria-value-text": (e) => d.formatValue(e.value),
68
+ onValueChange: t[0] ||= (e) => R(e.value),
69
+ onValueChangeEnd: t[1] ||= (e) => j("valueChangeEnd", e.value)
70
+ }), {
71
+ default: x(() => [c("div", { class: p(N.value.header()) }, [u(v(w).Label, {
72
+ id: B,
73
+ class: p(N.value.label())
74
+ }, {
75
+ default: x(() => [l(_(d.label), 1)]),
76
+ _: 1
77
+ }, 8, ["class"]), d.showValue ? (m(), a(v(w).Context, { key: 0 }, {
78
+ default: x((e) => [c("span", {
79
+ class: p(N.value.value()),
80
+ "aria-hidden": "true"
81
+ }, _(e.value.map(d.formatValue).join(" – ")), 3)]),
82
+ _: 1
83
+ })) : o("", !0)], 2), u(v(w).Control, { class: p(N.value.control()) }, {
84
+ default: x(() => [
85
+ u(v(w).Track, { class: p(N.value.track()) }, {
86
+ default: x(() => [u(v(w).Range, { class: p(N.value.range()) }, null, 8, ["class"])]),
87
+ _: 1
88
+ }, 8, ["class"]),
89
+ (m(!0), s(r, null, g(V.value, (e) => (m(), a(v(w).Thumb, {
90
+ key: e,
91
+ index: e - 1,
92
+ class: p(N.value.thumb()),
93
+ "aria-labelledby": V.value > 1 ? `${B} ${v(z)}thumb${e - 1}` : B
94
+ }, {
95
+ default: x(() => [V.value > 1 ? (m(), s("span", {
96
+ key: 0,
97
+ id: `${v(z)}thumb${e - 1}`,
98
+ class: p(N.value.thumbLabel())
99
+ }, _((d.thumbLabels ?? v(O).slider.thumbs)[e - 1]), 11, T)) : o("", !0), u(v(w).HiddenInput)]),
100
+ _: 2
101
+ }, 1032, [
102
+ "index",
103
+ "class",
104
+ "aria-labelledby"
105
+ ]))), 128)),
106
+ P.value.length ? (m(), a(v(w).MarkerGroup, {
107
+ key: 0,
108
+ class: p(N.value.markerGroup())
109
+ }, {
110
+ default: x(() => [(m(!0), s(r, null, g(P.value, (e) => (m(), a(v(w).Marker, {
111
+ key: e.value,
112
+ value: e.value,
113
+ class: p(N.value.marker())
114
+ }, {
115
+ default: x(() => [c("span", {
116
+ class: p(N.value.markerTick()),
117
+ "data-orientation": d.orientation ?? "horizontal"
118
+ }, null, 10, E), l(_(e.label), 1)]),
119
+ _: 2
120
+ }, 1032, ["value", "class"]))), 128))]),
121
+ _: 1
122
+ }, 8, ["class"])) : o("", !0)
123
+ ]),
124
+ _: 1
125
+ }, 8, ["class"])]),
126
+ _: 1
127
+ }, 16, [
128
+ "ids",
129
+ "model-value",
130
+ "default-value",
131
+ "min",
132
+ "max",
133
+ "step",
134
+ "disabled",
135
+ "name",
136
+ "orientation",
137
+ "min-steps-between-thumbs",
138
+ "get-aria-value-text"
139
+ ]));
140
+ }
141
+ });
142
+ //#endregion
143
+ export { D as t };