@bridge-ui/vue 0.5.1 → 0.7.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 (125) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -2
  2. package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
  3. package/dist/Adapters/I18n/useI18nAdapter.js +4 -1
  4. package/dist/Components/Accordion/Accordion.vue_vue_type_script_setup_true_lang.js +1 -1
  5. package/dist/Components/Accordion/accordion.types.d.ts +2 -2
  6. package/dist/Components/Alert/alertDefaultIcons.js +1 -0
  7. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +2 -2
  8. package/dist/Components/Autocomplete/composables/useAutocomplete.js +150 -145
  9. package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +33 -28
  10. package/dist/Components/BaseField/BaseFieldCorner.js +5 -0
  11. package/dist/Components/BaseField/BaseFieldCorner.vue.d.ts +17 -0
  12. package/dist/Components/BaseField/BaseFieldCorner.vue_vue_type_script_setup_true_lang.js +17 -0
  13. package/dist/Components/BaseField/baseField.types.d.ts +4 -2
  14. package/dist/Components/BaseField/composables/useBaseField.d.ts +1 -1
  15. package/dist/Components/BaseField/composables/useBaseField.js +11 -8
  16. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -0
  17. package/dist/Components/Button/button.types.d.ts +6 -0
  18. package/dist/Components/Button/composables/useButton.d.ts +4 -1
  19. package/dist/Components/Button/composables/useButton.js +88 -69
  20. package/dist/Components/ButtonGroup/ButtonGroup.js +5 -0
  21. package/dist/Components/ButtonGroup/ButtonGroup.vue.d.ts +14 -0
  22. package/dist/Components/ButtonGroup/ButtonGroup.vue_vue_type_script_setup_true_lang.js +37 -0
  23. package/dist/Components/ButtonGroup/buttonGroup.types.d.ts +93 -0
  24. package/dist/Components/ButtonGroup/buttonGroupInjectionKey.d.ts +7 -0
  25. package/dist/Components/ButtonGroup/buttonGroupInjectionKey.js +4 -0
  26. package/dist/Components/ButtonGroup/composables/useButtonGroup.d.ts +16 -0
  27. package/dist/Components/ButtonGroup/composables/useButtonGroup.js +66 -0
  28. package/dist/Components/ButtonGroup/index.d.ts +4 -0
  29. package/dist/Components/ButtonGroup/index.js +4 -0
  30. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +2 -2
  32. package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
  33. package/dist/Components/ColorField/composables/useColorField.d.ts +1 -1
  34. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +180 -158
  35. package/dist/Components/DataTable/DataTableColumnsMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  36. package/dist/Components/DataTable/DataTableFilterMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/dist/Components/DataTable/DataTableFilterOptions.vue_vue_type_script_setup_true_lang.js +1 -1
  38. package/dist/Components/DataTable/DataTablePagination.js +5 -0
  39. package/dist/Components/DataTable/DataTablePagination.vue.d.ts +24 -0
  40. package/dist/Components/DataTable/DataTablePagination.vue_vue_type_script_setup_true_lang.js +40 -0
  41. package/dist/Components/DataTable/DataTableSortButton.vue.d.ts +5 -11
  42. package/dist/Components/DataTable/DataTableSortButton.vue_vue_type_script_setup_true_lang.js +22 -26
  43. package/dist/Components/DataTable/composables/useDataTable.d.ts +8 -6
  44. package/dist/Components/DataTable/composables/useDataTable.js +268 -263
  45. package/dist/Components/DataTable/composables/useDataTablePagination.d.ts +69 -0
  46. package/dist/Components/DataTable/composables/useDataTablePagination.js +130 -0
  47. package/dist/Components/DataTable/dataTable.types.d.ts +27 -12
  48. package/dist/Components/DataTable/dataTablePagination.types.d.ts +169 -0
  49. package/dist/Components/DataTable/index.d.ts +2 -1
  50. package/dist/Components/DateField/composables/useDateField.d.ts +1 -1
  51. package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +1 -1
  52. package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +1 -1
  53. package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +1 -1
  54. package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +4 -1
  55. package/dist/Components/FormField/FilledFormField.vue.d.ts +7 -7
  56. package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +32 -27
  57. package/dist/Components/FormField/FormFieldCorner.js +5 -0
  58. package/dist/Components/FormField/FormFieldCorner.vue.d.ts +17 -0
  59. package/dist/Components/FormField/FormFieldCorner.vue_vue_type_script_setup_true_lang.js +17 -0
  60. package/dist/Components/FormField/NotchedFormField.vue.d.ts +7 -7
  61. package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +31 -26
  62. package/dist/Components/FormField/OutlinedFormField.vue.d.ts +7 -7
  63. package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +32 -27
  64. package/dist/Components/FormField/StackedFormField.vue.d.ts +6 -6
  65. package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +34 -29
  66. package/dist/Components/FormField/UnderlinedFormField.vue.d.ts +7 -7
  67. package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +32 -27
  68. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  69. package/dist/Components/FormField/composables/useFormField.js +15 -9
  70. package/dist/Components/FormField/formField.types.d.ts +4 -2
  71. package/dist/Components/List/composables/useList.js +1 -1
  72. package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
  73. package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
  74. package/dist/Components/ListItem/composables/useListItem.js +101 -86
  75. package/dist/Components/ListSection/composables/useListSection.js +34 -31
  76. package/dist/Components/ListSection/listSection.types.d.ts +2 -1
  77. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +82 -82
  78. package/dist/Components/Listbox/collectComposedListboxOptions.d.ts +5 -0
  79. package/dist/Components/Listbox/collectComposedListboxOptions.js +27 -0
  80. package/dist/Components/NumberField/composables/useNumberField.d.ts +1 -1
  81. package/dist/Components/OtpField/composables/useOtpField.d.ts +1 -1
  82. package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +6 -6
  83. package/dist/Components/Pagination/composables/usePagination.d.ts +4 -2
  84. package/dist/Components/Pagination/composables/usePagination.js +125 -127
  85. package/dist/Components/Pagination/pagination.types.d.ts +5 -5
  86. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +1 -1
  87. package/dist/Components/Radio/composables/useRadio.js +2 -1
  88. package/dist/Components/Select/composables/useSelect.d.ts +2 -2
  89. package/dist/Components/Select/composables/useSelect.js +104 -99
  90. package/dist/Components/Sidebar/composables/useSidebarListItem.js +29 -28
  91. package/dist/Components/Sidebar/composables/useSidebarTrigger.js +14 -14
  92. package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
  93. package/dist/Components/Slider/composables/useSlider.js +53 -53
  94. package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -0
  95. package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +13 -12
  96. package/dist/Components/Tabs/composables/useTabs.js +16 -10
  97. package/dist/Components/Tabs/tabs.types.d.ts +3 -3
  98. package/dist/Components/TextField/composables/useTextField.d.ts +1 -1
  99. package/dist/Components/Textarea/composables/useTextarea.d.ts +1 -1
  100. package/dist/Components/TimeField/composables/useTimeField.d.ts +1 -1
  101. package/dist/Components/TimePanel/composables/useTimePanel.js +106 -106
  102. package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +1 -1
  103. package/dist/augments.d.ts +5 -0
  104. package/dist/index.d.ts +3 -1
  105. package/dist/index.js +150 -147
  106. package/docs/README.md +1 -0
  107. package/docs/components/Accordion.md +1 -1
  108. package/docs/components/Badge.md +2 -0
  109. package/docs/components/Button.md +5 -1
  110. package/docs/components/ButtonGroup.md +124 -0
  111. package/docs/components/DataTable.md +9 -11
  112. package/docs/components/Divider.md +1 -0
  113. package/docs/components/I18n.md +65 -24
  114. package/docs/components/Pagination.md +5 -3
  115. package/docs/components/Table.md +2 -2
  116. package/docs/components/Tabs.md +24 -6
  117. package/docs/components/ToggleGroup.md +1 -1
  118. package/docs/examples/i18n-dictionary.ts +31 -10
  119. package/docs/examples/i18n-vue-i18n.ts +7 -6
  120. package/docs/examples/icon-fontawesome.ts +4 -0
  121. package/docs/examples/icon-heroicons.ts +5 -1
  122. package/docs/examples/icon-lucide.ts +4 -0
  123. package/docs/examples/icon-phosphor.ts +4 -0
  124. package/docs/examples/icon-tabler.ts +4 -0
  125. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: bridge-ui-components
3
3
  description: >-
4
- Use Bridge UI Vue components — Button, Avatar, Card, Alert, Accordion, Badge, Icon,
4
+ Use Bridge UI Vue components — Button, ButtonGroup, Avatar, Card, Alert, Accordion, Badge, Icon,
5
5
  Link, List, Table, DataTable, Tabs, Spinner, Skeleton, EmptyState, Sidebar, Progress, Stepper, Pagination, TextField, Select,
6
6
  Autocomplete, DateField, DatePicker, DateRangeField, DateRangePicker,
7
7
  TimeField, TimePicker, DateTimeField, DateTimePicker, ColorField, ColorPicker,
@@ -18,7 +18,7 @@ In templates, use kebab-case attrs (`start-icon`, `custom-props`, `error-message
18
18
 
19
19
  | Need | Doc |
20
20
  | ----------------------------- | --------------------------------------------------------------------- |
21
- | Actions | `.ai/docs/components/Button.md` |
21
+ | Actions | `.ai/docs/components/Button.md`, `ButtonGroup.md` |
22
22
  | Surfaces / modal body | `.ai/docs/components/Card.md` |
23
23
  | Avatar | `.ai/docs/components/Avatar.md` |
24
24
  | Badge | `.ai/docs/components/Badge.md` |
@@ -13,4 +13,4 @@ export declare function useI18nAdapter(): ComputedRef<undefined | I18nAdapter>;
13
13
  /**
14
14
  * Resolves Bridge chrome strings through the active i18n adapter.
15
15
  */
16
- export declare function useResolveMessage(): (message: string, params?: MessageParams) => string;
16
+ export declare function useResolveMessage(): (message: string, countOrParams?: number | MessageParams, params?: MessageParams) => string;
@@ -12,7 +12,10 @@ function a() {
12
12
  }
13
13
  function o() {
14
14
  let e = a();
15
- return (t, r) => n(t, e.value, r);
15
+ function t(t, r, i) {
16
+ return n(t, e.value, r, i);
17
+ }
18
+ return t;
16
19
  }
17
20
  //#endregion
18
21
  export { i as setI18nAdapterForTests, a as useI18nAdapter, o as useResolveMessage };
@@ -26,9 +26,9 @@ var u = /*@__PURE__*/ n({
26
26
  setup(n, { emit: i }) {
27
27
  let u = i, d = n, f = l(n, "modelValue"), { rootBind: p } = e(d, {
28
28
  size: "md",
29
+ color: "dark",
29
30
  multiple: !1,
30
31
  disabled: !1,
31
- color: "primary",
32
32
  variant: "default"
33
33
  }, f, u);
34
34
  return (e, n) => (o(), t("div", a(r(c(p))), [s(e.$slots, "default")], 16));
@@ -40,9 +40,9 @@ export interface AccordionOwnProps {
40
40
  */
41
41
  classes?: AccordionClasses;
42
42
  /**
43
- * Accent color for the expanded indicator and trigger.
43
+ * Optional text accent for the expanded trigger and indicator.
44
44
  *
45
- * @default "primary"
45
+ * @default "dark"
46
46
  */
47
47
  color?: MergeProps<AccordionColor, AccordionColorOverrides>;
48
48
  /**
@@ -2,6 +2,7 @@
2
2
  var e = {
3
3
  dark: "info",
4
4
  info: "alert",
5
+ black: "info",
5
6
  error: "error",
6
7
  primary: "bell",
7
8
  secondary: "info",
@@ -440,7 +440,6 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
440
440
  isNotched: import('vue').ComputedRef<boolean>;
441
441
  isStacked: import('vue').ComputedRef<boolean>;
442
442
  startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
443
- cornerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
444
443
  headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
445
444
  isDisabled: import('vue').ComputedRef<boolean>;
446
445
  isReadonly: import('vue').ComputedRef<boolean>;
@@ -458,6 +457,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
458
457
  ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
459
458
  descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
460
459
  stackedBodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
460
+ fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
461
461
  hasInsetLabelRow: import('vue').ComputedRef<boolean>;
462
462
  insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
463
463
  stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
@@ -728,7 +728,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
728
728
  listboxProps: import('vue').ComputedRef<{
729
729
  anchorEl?: null | HTMLElement;
730
730
  classes?: import('../../Listbox').ListboxClasses;
731
- color: "info" | "error" | "success" | "warning" | "dark" | "primary" | "secondary";
731
+ color: "info" | "error" | "success" | "warning" | "black" | "dark" | "primary" | "secondary";
732
732
  customProps?: import('../../Listbox').ListboxCustomProps;
733
733
  disableAutoFocus: boolean;
734
734
  disableMaxHeight: boolean;
@@ -1,16 +1,17 @@
1
1
  import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
2
  import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
3
3
  import { useBreakpoint as n } from "../../../Utils/useBreakpoint.js";
4
- import { mergePartBind as r, resolveFieldAdornmentIconSize as i, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as a, useFieldShowFooter as te } from "../../../Utils/index.js";
5
- import { formFieldBridgeKeys as ne, useFormField as re } from "../../FormField/composables/useFormField.js";
6
- import { useListboxNavigation as ie } from "../../Listbox/composables/useListboxNavigation.js";
7
- import { Comment as ae, Text as oe, computed as o, nextTick as s, onBeforeUnmount as se, onMounted as ce, ref as c, useAttrs as le, useId as ue, useSlots as de, watch as l } from "vue";
8
- import { get as fe, isNil as pe, omit as me } from "es-toolkit/compat";
9
- import { commitFreeSoloValue as u, createSelectAsyncSearch as he, filterListboxEntries as ge, flattenListboxOptions as d, normalizeListboxEntries as _e, normalizeSelectOptions as ve, resolveFieldOverlay as ye, resolveSelectAsyncDebounce as be, resolveSelectAsyncOptions as xe, selectValuesEqual as f } from "@bridge-ui/core/Domain";
10
- import { listboxColorProps as Se } from "@bridge-ui/core/Tokens";
11
- import { adjustAutosizeTextareaHeight as Ce, cn as p, getColorToken as we, mergeBridgeUILayeredClasses as Te, splitComponentProps as Ee } from "@bridge-ui/core/Utils";
4
+ import { mergePartBind as r, resolveFieldAdornmentIconSize as ee, useBridgeUIComponent as te, useBridgeUIMergedRegistryClasses as i, useFieldShowFooter as ne } from "../../../Utils/index.js";
5
+ import { formFieldBridgeKeys as re, useFormField as ie } from "../../FormField/composables/useFormField.js";
6
+ import { collectComposedListboxOptions as ae } from "../../Listbox/collectComposedListboxOptions.js";
7
+ import { useListboxNavigation as oe } from "../../Listbox/composables/useListboxNavigation.js";
8
+ import { Comment as se, Text as ce, computed as a, nextTick as o, onBeforeUnmount as le, onMounted as ue, ref as s, useAttrs as de, useId as fe, useSlots as pe, watch as c } from "vue";
9
+ import { get as me, isNil as he, isObjectLike as l, isSymbol as ge, omit as _e } from "es-toolkit/compat";
10
+ import { commitFreeSoloValue as u, createSelectAsyncSearch as ve, filterListboxEntries as ye, flattenListboxOptions as d, mergeListboxOptionsByValue as be, normalizeListboxEntries as xe, normalizeSelectOptions as Se, resolveFieldOverlay as Ce, resolveSelectAsyncDebounce as we, resolveSelectAsyncOptions as Te, selectValuesEqual as f } from "@bridge-ui/core/Domain";
11
+ import { listboxColorProps as Ee } from "@bridge-ui/core/Tokens";
12
+ import { adjustAutosizeTextareaHeight as De, cn as p, getColorToken as Oe, mergeBridgeUILayeredClasses as ke, splitComponentProps as Ae } from "@bridge-ui/core/Utils";
12
13
  //#region src/Components/Autocomplete/composables/useAutocomplete.ts
13
- var De = [
14
+ var je = [
14
15
  "classes",
15
16
  "loading",
16
17
  "options",
@@ -34,81 +35,81 @@ var De = [
34
35
  "minItemsForSearch",
35
36
  "optionDescription"
36
37
  ];
37
- function m(m, h, g, _, Oe) {
38
- let ke = le(), v = de(), y = ue(), Ae = n(), b = e(), x = c(!1), S = c(""), C = c(!1), w = c(-1), T = c([]), E = c([]), D = c([]), O = c(null), k = null, je = o(() => Ee({
38
+ function m(m, h, g, _, Me) {
39
+ let Ne = de(), v = pe(), y = fe(), Pe = n(), b = e(), x = s(!1), S = s(""), C = s(!1), w = s(-1), T = s([]), E = s([]), D = s([]), Fe = s(null), O = null, Ie = a(() => Ae({
39
40
  props: {
40
- ...ke,
41
+ ...Ne,
41
42
  ...m
42
43
  },
43
- bridgeKeys: De
44
- })), A = o(() => je.value.componentProps), Me = o(() => ({ classes: A.value.classes })), { components: Ne, entry: Pe } = ee({
44
+ bridgeKeys: je
45
+ })), k = a(() => Ie.value.componentProps), A = a(() => ({ classes: k.value.classes })), { components: Le, entry: Re } = te({
45
46
  componentName: "Autocomplete",
46
- props: () => Me.value
47
- }), j = a({
48
- entry: Pe,
49
- props: () => Me.value
50
- }), M = o(() => !!A.value.multiple), N = o(() => ({
51
- optionLabel: A.value.optionLabel ?? "label",
52
- optionValue: A.value.optionValue ?? "value",
53
- optionDescription: A.value.optionDescription ?? "description"
54
- })), P = o(() => Oe.value.length > 0 ? Oe.value.map((e) => ({
47
+ props: () => A.value
48
+ }), j = i({
49
+ entry: Re,
50
+ props: () => A.value
51
+ }), M = a(() => !!k.value.multiple), N = a(() => ({
52
+ optionLabel: k.value.optionLabel ?? "label",
53
+ optionValue: k.value.optionValue ?? "value",
54
+ optionDescription: k.value.optionDescription ?? "description"
55
+ })), P = a(() => Me.value.length > 0 ? Me.value.map((e) => ({
55
56
  option: e,
56
57
  type: "option"
57
- })) : _e(A.value.options, N.value)), Fe = o(() => d(P.value)), F = c([]);
58
- function Ie(e) {
59
- if (!e || typeof e != "object") return !1;
58
+ })) : xe(k.value.options, N.value)), ze = a(() => d(P.value)), F = s([]);
59
+ function Be(e) {
60
+ if (!l(e)) return !1;
60
61
  let t = e.type;
61
- if (!t || typeof t != "object") return !1;
62
+ if (!l(t)) return !1;
62
63
  let n = t.name, r = t.__name;
63
64
  return n === "AutocompleteOption" || r === "AutocompleteOption";
64
65
  }
65
- function Le() {
66
+ function Ve() {
66
67
  return t(v, "default") ? (v.default?.({}) ?? []).some((e) => {
67
- if (!e || typeof e != "object") return !1;
68
+ if (!l(e)) return !1;
68
69
  let t = e.type;
69
- return t === ae || t === oe || t === void 0 || typeof t == "symbol" ? !1 : !Ie(e);
70
+ return t === se || t === ce || t === void 0 || ge(t) ? !1 : !Be(e);
70
71
  }) : !1;
71
72
  }
72
- let I = o(() => Le() && !A.value.options?.length), L = o(() => {
73
+ let I = a(() => Ve()), He = a(() => I.value ? ae(v.default?.({}) ?? []) : []), L = a(() => {
73
74
  if (I.value) return [];
74
75
  if (E.value.length > 0) {
75
- let e = _e(E.value, N.value);
76
- return A.value.flipOptions ? [...e].reverse() : e;
76
+ let e = xe(E.value, N.value);
77
+ return k.value.flipOptions ? [...e].reverse() : e;
77
78
  }
78
- return A.value.flipOptions ? [...P.value].reverse().map((e) => e.type === "section" ? {
79
+ return k.value.flipOptions ? [...P.value].reverse().map((e) => e.type === "section" ? {
79
80
  ...e,
80
81
  options: [...e.options].reverse()
81
82
  } : e) : P.value;
82
- }), Re = o(() => I.value ? F.value : d(L.value)), R = o(() => {
83
+ }), Ue = a(() => I.value ? be(F.value, He.value) : d(L.value)), R = a(() => {
83
84
  let e = h.value;
84
- return M.value ? Array.isArray(e) ? e : [] : !pe(e) && e !== "" ? [e] : [];
85
- }), ze = o(() => ye(A.value.overlay, Ae.mobile)), z = te({
86
- overlay: ze,
85
+ return M.value ? Array.isArray(e) ? e : [] : !he(e) && e !== "" ? [e] : [];
86
+ }), We = a(() => Ce(k.value.overlay, Pe.mobile)), z = ne({
87
+ overlay: We,
87
88
  componentName: "Autocomplete",
88
- showFooter: () => A.value.showFooter
89
- }), Be = o(() => z.value ? T.value : R.value), B = o(() => {
89
+ showFooter: () => k.value.showFooter
90
+ }), Ge = a(() => z.value ? T.value : R.value), B = a(() => {
90
91
  let e = /* @__PURE__ */ new Map();
91
- for (let t of [...Re.value, ...D.value]) e.set(t.value, t);
92
+ for (let t of [...Ue.value, ...D.value]) e.set(t.value, t);
92
93
  return R.value.map((t) => e.get(t) ?? {
93
94
  value: t,
94
95
  label: String(t)
95
96
  });
96
- }), V = o(() => R.value.length > 0), Ve = o(() => A.value.clearable !== !1), H = o(() => !!A.value.asyncData), U = o(() => {
97
- if (H.value || (A.value.searchable ?? !0)) return !0;
98
- let e = A.value.minItemsForSearch ?? 11;
99
- return Fe.value.length >= e;
100
- }), W = o(() => x.value && U.value), He = o(() => !!A.value.loading || C.value), Ue = o(() => {
97
+ }), V = a(() => R.value.length > 0), Ke = a(() => k.value.clearable !== !1), H = a(() => !!k.value.asyncData), U = a(() => {
98
+ if (H.value || (k.value.searchable ?? !0)) return !0;
99
+ let e = k.value.minItemsForSearch ?? 11;
100
+ return ze.value.length >= e;
101
+ }), W = a(() => x.value && U.value), qe = a(() => !!k.value.loading || C.value), Je = a(() => {
101
102
  if (I.value) return [];
102
103
  if (!W.value || !S.value.trim()) return L.value;
103
104
  let e = S.value.trim().toLowerCase();
104
- return ge(L.value, (t) => t.label.toLowerCase().includes(e));
105
- }), G = o(() => I.value ? F.value : d(Ue.value)), K = ie(() => G.value, w, y), We = o(() => m.readonly || m.disabled ? !0 : !W.value), Ge = o(() => W.value || M.value ? S.value : B.value[0]?.label ?? ""), Ke = (e) => {
106
- O.value = e instanceof HTMLElement ? e : null;
105
+ return ye(L.value, (t) => t.label.toLowerCase().includes(e));
106
+ }), G = a(() => I.value ? F.value : d(Je.value)), K = oe(() => G.value, w, y), Ye = a(() => m.readonly || m.disabled ? !0 : !W.value), Xe = a(() => W.value || M.value ? S.value : B.value[0]?.label ?? ""), Ze = (e) => {
107
+ Fe.value = e instanceof HTMLElement ? e : null;
107
108
  };
108
- function qe(e) {
109
+ function Qe(e) {
109
110
  e.preventDefault();
110
111
  }
111
- function Je(e) {
112
+ function $e(e) {
112
113
  if (m.disabled || m.readonly) return;
113
114
  let t = e.target;
114
115
  if (!t.closest("[data-autocomplete-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
@@ -119,25 +120,25 @@ function m(m, h, g, _, Oe) {
119
120
  W.value || (Q(), g.value?.focus({ preventScroll: !0 }));
120
121
  }
121
122
  }
122
- let Ye = o(() => {
123
- let e = me(je.value.inheritedAttrs, ["class"]), n = Ee({
124
- bridgeKeys: ne,
123
+ let et = a(() => {
124
+ let e = _e(Ie.value.inheritedAttrs, ["class"]), n = Ae({
125
+ bridgeKeys: re,
125
126
  props: e
126
- }).componentProps, i = n.endIcon ?? (t(v, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...a } = n.customProps ?? {};
127
+ }).componentProps, ee = n.endIcon ?? (t(v, "end") ? void 0 : "chevronUpDown"), { listbox: te, ...i } = n.customProps ?? {};
127
128
  return {
128
129
  ...n,
129
- endIcon: i,
130
+ endIcon: ee,
130
131
  classes: j.value,
131
132
  customProps: {
132
- ...a,
133
- container: r(a.container, {}, {
134
- ref: Ke,
135
- onClick: Je,
133
+ ...i,
134
+ container: r(i.container, {}, {
135
+ ref: Ze,
136
+ onClick: $e,
136
137
  class: p({ "cursor-pointer": !m.disabled && !m.readonly && !W.value })
137
138
  })
138
139
  }
139
140
  };
140
- }), Xe = o(() => m.customProps?.listbox), q = re(() => Ye.value, {
141
+ }), tt = a(() => m.customProps?.listbox), q = ie(() => et.value, {
141
142
  size: "md",
142
143
  rounded: "md",
143
144
  color: "primary",
@@ -147,11 +148,11 @@ function m(m, h, g, _, Oe) {
147
148
  componentName: "Autocomplete",
148
149
  likeInput: () => M.value,
149
150
  control: () => M.value ? "textarea" : "input"
150
- }), Ze = o(() => V.value && Ve.value && !m.readonly && !q.isDisabled.value), J = (e) => {
151
- !e || !M.value || Ce(e);
151
+ }), nt = a(() => V.value && Ke.value && !m.readonly && !q.isDisabled.value), J = (e) => {
152
+ !e || !M.value || De(e);
152
153
  };
153
- function Qe(e) {
154
- return Be.value.some((t) => f(t, e));
154
+ function rt(e) {
155
+ return Ge.value.some((t) => f(t, e));
155
156
  }
156
157
  function Y(e) {
157
158
  h.value = e;
@@ -166,25 +167,25 @@ function m(m, h, g, _, Oe) {
166
167
  _("update:modelValue", t), _("change", t);
167
168
  }
168
169
  function Z() {
169
- m.disabled || m.readonly || x.value || (T.value = [...R.value], x.value = !0, S.value = "", K.highlightCurrentSelection((e) => R.value.some((t) => f(t, e))), _("open"), H.value && A.value.asyncData && k?.searchImmediate(""));
170
+ m.disabled || m.readonly || x.value || (T.value = [...R.value], x.value = !0, S.value = "", K.highlightCurrentSelection((e) => R.value.some((t) => f(t, e))), _("open"), H.value && k.value.asyncData && O?.searchImmediate(""));
170
171
  }
171
172
  function Q(e) {
172
- k?.cancel();
173
+ O?.cancel();
173
174
  let t = x.value;
174
- if (t && e?.commitFreeSolo && A.value.freeSolo !== !1) {
175
+ if (t && e?.commitFreeSolo && k.value.freeSolo !== !1) {
175
176
  let e = u(S.value, R.value, M.value);
176
- e != null && (Y(e), X(e), M.value && s(() => {
177
+ e != null && (Y(e), X(e), M.value && o(() => {
177
178
  J(g.value), g.value?.focus({ preventScroll: !0 });
178
179
  }));
179
180
  }
180
181
  S.value = "", w.value = -1, t && (x.value = !1, _("close"));
181
182
  }
182
- function $e(e) {
183
+ function it(e) {
183
184
  if (!e.disabled) {
184
185
  if (z.value) {
185
186
  if (M.value) {
186
187
  let t = [...T.value], n = t.findIndex((t) => f(t, e.value));
187
- n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), T.value = t, S.value = "", w.value = -1, s(() => {
188
+ n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), T.value = t, S.value = "", w.value = -1, o(() => {
188
189
  g.value?.focus({ preventScroll: !0 });
189
190
  });
190
191
  return;
@@ -194,7 +195,7 @@ function m(m, h, g, _, Oe) {
194
195
  }
195
196
  if (M.value) {
196
197
  let t = [...R.value], n = t.findIndex((t) => f(t, e.value));
197
- n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), Y(t), X(t), S.value = "", w.value = -1, s(() => {
198
+ n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), Y(t), X(t), S.value = "", w.value = -1, o(() => {
198
199
  J(g.value), g.value?.focus({ preventScroll: !0 });
199
200
  });
200
201
  return;
@@ -202,7 +203,7 @@ function m(m, h, g, _, Oe) {
202
203
  Y(e.value), X(e.value), _("select", e), Q();
203
204
  }
204
205
  }
205
- function et() {
206
+ function at() {
206
207
  if (M.value) Y(T.value), X(T.value);
207
208
  else {
208
209
  let e = T.value[0] ?? null;
@@ -210,33 +211,33 @@ function m(m, h, g, _, Oe) {
210
211
  }
211
212
  Q(), _("apply");
212
213
  }
213
- function tt() {
214
+ function ot() {
214
215
  T.value = [...R.value], Q(), _("cancel");
215
216
  }
216
- function nt() {
217
- if (A.value.freeSolo === !1) return !1;
217
+ function st() {
218
+ if (k.value.freeSolo === !1) return !1;
218
219
  let e = u(S.value, R.value, M.value);
219
- return e != null && (Y(e), X(e), S.value = "", w.value = -1, M.value ? (s(() => {
220
+ return e != null && (Y(e), X(e), S.value = "", w.value = -1, M.value ? (o(() => {
220
221
  J(g.value), g.value?.focus({ preventScroll: !0 });
221
222
  }), !0) : (Q(), !0));
222
223
  }
223
- function rt(e) {
224
+ function ct(e) {
224
225
  e?.preventDefault(), e?.stopPropagation(), !(m.disabled || m.readonly) && (M.value ? (Y([]), X([])) : (Y(null), X(null)), _("clear"), Q());
225
226
  }
226
- function it(e, t) {
227
+ function lt(e, t) {
227
228
  if (t.preventDefault(), t.stopPropagation(), !M.value) return;
228
229
  let n = R.value.filter((t) => !f(t, e.value));
229
- Y(n), X(n), _("deselect", e), s(() => J(g.value));
230
+ Y(n), X(n), _("deselect", e), o(() => J(g.value));
230
231
  }
231
- function at() {
232
+ function ut() {
232
233
  let e = K.getHighlightedOption();
233
- return e ? ($e(e), !0) : !1;
234
+ return e ? (it(e), !0) : !1;
234
235
  }
235
- function ot(e) {
236
+ function dt(e) {
236
237
  let t = e.target;
237
- S.value = t.value, _("search", S.value), x.value || Z(), K.resetHighlight(), H.value && k?.searchDebounced(S.value);
238
+ S.value = t.value, _("search", S.value), x.value || Z(), K.resetHighlight(), H.value && O?.searchDebounced(S.value);
238
239
  }
239
- function st(e) {
240
+ function ft(e) {
240
241
  if (!(m.disabled || m.readonly)) switch (e.key) {
241
242
  case "ArrowDown":
242
243
  e.preventDefault(), x.value ? K.moveHighlight(1) : Z();
@@ -245,7 +246,7 @@ function m(m, h, g, _, Oe) {
245
246
  e.preventDefault(), x.value ? K.moveHighlight(-1) : Z();
246
247
  break;
247
248
  case "Enter":
248
- e.preventDefault(), x.value ? at() || nt() : Z();
249
+ e.preventDefault(), x.value ? ut() || st() : Z();
249
250
  break;
250
251
  case "Escape":
251
252
  e.preventDefault(), Q();
@@ -260,104 +261,104 @@ function m(m, h, g, _, Oe) {
260
261
  if (M.value && !S.value && B.value.length > 0) {
261
262
  e.preventDefault();
262
263
  let t = B.value.at(-1);
263
- t && it(t, e);
264
+ t && lt(t, e);
264
265
  }
265
266
  break;
266
267
  case "Tab": Q({ commitFreeSolo: !0 });
267
268
  }
268
269
  }
269
- async function ct(e) {
270
- let t = A.value.asyncData;
270
+ async function pt(e) {
271
+ let t = k.value.asyncData;
271
272
  if (t) {
272
273
  C.value = !0;
273
274
  try {
274
- let { options: n, resolvedSelected: r } = await xe(t, e, R.value, (e) => ve(e, N.value));
275
+ let { options: n, resolvedSelected: r } = await Te(t, e, R.value, (e) => Se(e, N.value));
275
276
  r.length > 0 && (D.value = r), E.value = n;
276
277
  } finally {
277
278
  C.value = !1;
278
279
  }
279
280
  }
280
281
  }
281
- async function lt() {
282
- let e = A.value.asyncData;
283
- !e?.resolve || R.value.length === 0 || (D.value = ve(await e.resolve(R.value), N.value));
282
+ async function mt() {
283
+ let e = k.value.asyncData;
284
+ !e?.resolve || R.value.length === 0 || (D.value = Se(await e.resolve(R.value), N.value));
284
285
  }
285
- let $ = o(() => {
286
- let e = Te(Se, fe(Ne.value, [
286
+ let $ = a(() => {
287
+ let e = ke(Ee, me(Le.value, [
287
288
  "Autocomplete",
288
289
  "tokens",
289
290
  "listbox",
290
291
  "color"
291
292
  ]));
292
- return we({
293
+ return Oe({
293
294
  tokens: e,
294
295
  color: q.merged.value.color,
295
296
  invalid: q.invalidated.value
296
297
  });
297
- }), ut = o(() => $.value?.value), dt = o(() => {
298
+ }), ht = a(() => $.value?.value), gt = a(() => {
298
299
  let e = !m.disabled && !m.readonly && !W.value, t = !m.disabled && !m.readonly && W.value && U.value, n = V.value && !M.value && !W.value;
299
300
  return r({
300
301
  role: "combobox",
301
- value: Ge.value,
302
+ value: Xe.value,
302
303
  "aria-controls": y,
303
304
  "aria-expanded": x.value,
304
- readonly: We.value,
305
- onKeydown: st,
306
- placeholder: A.value.placeholder,
305
+ readonly: Ye.value,
306
+ onKeydown: ft,
307
+ placeholder: k.value.placeholder,
307
308
  "aria-autocomplete": U.value ? "list" : void 0,
308
309
  "aria-activedescendant": x.value ? K.activeDescendantId.value : void 0,
309
310
  ...M.value ? {
310
311
  rows: 1,
311
312
  onInput: (e) => {
312
- ot(e), J(e.target);
313
+ dt(e), J(e.target);
313
314
  }
314
- } : { onInput: ot }
315
+ } : { onInput: dt }
315
316
  }, q.inputBind.value, p({
316
317
  "cursor-text": t,
317
318
  "cursor-pointer": e,
318
319
  "resize-none overflow-hidden": M.value,
319
- [p(ut.value, j.value.value) ?? ""]: n
320
+ [p(ht.value, j.value.value) ?? ""]: n
320
321
  }));
321
322
  });
322
- l(() => [
323
+ c(() => [
323
324
  x.value,
324
325
  M.value,
325
326
  g.value
326
327
  ], () => {
327
328
  J(g.value);
328
- }, { immediate: !0 }), l(() => h.value, () => {
329
- lt();
330
- }, { immediate: !0 }), l(() => A.value.asyncData, (e) => {
331
- if (k?.cancel(), E.value = [], lt(), !e) {
332
- k = null;
329
+ }, { immediate: !0 }), c(() => h.value, () => {
330
+ mt();
331
+ }, { immediate: !0 }), c(() => k.value.asyncData, (e) => {
332
+ if (O?.cancel(), E.value = [], mt(), !e) {
333
+ O = null;
333
334
  return;
334
335
  }
335
- k = he((e) => void ct(e), be(e));
336
- }, { immediate: !0 }), se(() => {
337
- k?.cancel();
338
- }), ce(() => {
336
+ O = ve((e) => void pt(e), we(e));
337
+ }, { immediate: !0 }), le(() => {
338
+ O?.cancel();
339
+ }), ue(() => {
339
340
  J(g.value);
340
341
  });
341
- let ft = o(() => i(q.merged.value.size)), pt = o(() => r({}, {}, {
342
+ let _t = a(() => ee(q.merged.value.size)), vt = a(() => r({}, {}, {
342
343
  tabindex: 0,
343
344
  role: "button",
344
345
  "data-autocomplete-clear": !0,
345
- onMousedown: qe,
346
+ onMousedown: Qe,
346
347
  class: p({
347
348
  "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
348
349
  [$.value?.clear ?? ""]: !0,
349
350
  [j.value.clear ?? ""]: !0
350
351
  })
351
- })), mt = o(() => ({
352
+ })), yt = a(() => ({
352
353
  listboxId: y,
353
- isSelected: Qe,
354
+ isSelected: rt,
354
355
  disableAutoFocus: !0,
355
356
  overlay: m.overlay,
356
- loading: He.value,
357
+ loading: qe.value,
357
358
  multiple: M.value,
358
359
  maxHeight: m.maxHeight,
359
360
  showFooter: z.value,
360
- entries: Ue.value,
361
+ entries: Je.value,
361
362
  options: G.value,
362
363
  size: q.merged.value.size,
363
364
  error: q.invalidated.value,
@@ -366,14 +367,18 @@ function m(m, h, g, _, Oe) {
366
367
  rounded: q.merged.value.rounded,
367
368
  highlightedIndex: w.value,
368
369
  disableMaxHeight: m.disableMaxHeight === !0,
369
- hideEmptyMessage: A.value.hideEmptyMessage === !0,
370
- emptyMessage: A.value.emptyMessage ?? b("No options"),
371
- loadingMessage: A.value.loadingMessage ?? b("Loading..."),
372
- ...Xe.value
370
+ hideEmptyMessage: k.value.hideEmptyMessage === !0,
371
+ emptyMessage: k.value.emptyMessage ?? b("No options"),
372
+ loadingMessage: k.value.loadingMessage ?? b("Loading..."),
373
+ ...tt.value
373
374
  }));
374
- function ht(e) {
375
+ function bt(e) {
376
+ if (e.length === 0) return;
375
377
  let t = F.value;
376
- t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (F.value = e);
378
+ t.length === e.length && t.every((t, n) => {
379
+ let r = e[n];
380
+ return t.label === r?.label && t.description === r?.description && String(t.value) === String(r?.value) && !!t.disabled == !!r?.disabled;
381
+ }) || (F.value = e);
377
382
  }
378
383
  return {
379
384
  slots: v,
@@ -381,24 +386,24 @@ function m(m, h, g, _, Oe) {
381
386
  multiple: M,
382
387
  listboxId: y,
383
388
  formField: q,
384
- isLoading: He,
385
- clearable: Ve,
386
- clearBind: pt,
387
- isSelected: Qe,
388
- clearValue: rt,
389
- removeChip: it,
390
- triggerBind: dt,
391
- handleApply: et,
392
- selectOption: $e,
393
- handleCancel: tt,
394
- containerRef: O,
395
- listboxProps: mt,
396
- clearIconSize: ft,
389
+ isLoading: qe,
390
+ clearable: Ke,
391
+ clearBind: vt,
392
+ isSelected: rt,
393
+ clearValue: ct,
394
+ removeChip: lt,
395
+ triggerBind: gt,
396
+ handleApply: at,
397
+ selectOption: it,
398
+ handleCancel: ot,
399
+ containerRef: Fe,
400
+ listboxProps: yt,
401
+ clearIconSize: _t,
397
402
  mergedClasses: j,
398
- showClearIcon: Ze,
403
+ showClearIcon: nt,
399
404
  visibleOptions: G,
400
405
  isSearchActive: W,
401
- open: o({
406
+ open: a({
402
407
  get: () => x.value,
403
408
  set: (e) => {
404
409
  e ? Z() : Q({ commitFreeSolo: !0 });
@@ -407,10 +412,10 @@ function m(m, h, g, _, Oe) {
407
412
  selectedOptions: B,
408
413
  hasComposedList: I,
409
414
  highlightedIndex: w,
410
- handleRegisteredOptionsChange: ht,
411
- hideEmptyMessage: o(() => A.value.hideEmptyMessage === !0),
412
- emptyMessage: o(() => A.value.emptyMessage ?? b("No options")),
413
- loadingMessage: o(() => A.value.loadingMessage ?? b("Loading..."))
415
+ handleRegisteredOptionsChange: bt,
416
+ hideEmptyMessage: a(() => k.value.hideEmptyMessage === !0),
417
+ emptyMessage: a(() => k.value.emptyMessage ?? b("No options")),
418
+ loadingMessage: a(() => k.value.loadingMessage ?? b("Loading..."))
414
419
  };
415
420
  }
416
421
  //#endregion