@bridge-ui/vue 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/AGENTS.md +31 -0
- package/ai/README.md +35 -0
- package/ai/guidelines/core.md +44 -0
- package/ai/llms.txt +38 -0
- package/ai/skills/bridge-ui-components/SKILL.md +37 -0
- package/ai/skills/bridge-ui-forms/SKILL.md +38 -0
- package/ai/skills/bridge-ui-overlays/SKILL.md +37 -0
- package/ai/skills/bridge-ui-setup/SKILL.md +38 -0
- package/bin/__tests__/ai.test.ts +319 -0
- package/bin/ai.mjs +469 -0
- package/dist/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +17 -17
- package/dist/Adapters/I18n/index.d.ts +1 -1
- package/dist/Adapters/I18n/index.js +2 -2
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +7 -3
- package/dist/Adapters/I18n/useI18nAdapter.js +12 -7
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/index.d.ts +1 -1
- package/dist/Adapters/index.js +3 -3
- package/dist/Components/Alert/composables/useAlert.js +17 -17
- package/dist/Components/Autocomplete/Autocomplete.js +5 -0
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
- package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +763 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +386 -0
- package/dist/Components/Autocomplete/index.d.ts +4 -0
- package/dist/Components/Autocomplete/index.js +4 -0
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +13 -13
- package/dist/Components/Badge/composables/useBadge.js +8 -8
- package/dist/Components/BaseField/BaseField.js +5 -0
- package/dist/Components/BaseField/BaseField.vue.d.ts +15 -0
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/Components/BaseField/BaseFieldLabel.js +5 -0
- package/dist/Components/BaseField/BaseFieldLabel.vue.d.ts +7 -0
- package/dist/Components/BaseField/BaseFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/Components/BaseField/baseField.types.d.ts +222 -0
- package/dist/Components/BaseField/composables/useBaseField.d.ts +55 -0
- package/dist/Components/BaseField/composables/useBaseField.js +131 -0
- package/dist/Components/BaseField/index.d.ts +4 -0
- package/dist/Components/BaseField/index.js +3 -0
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Button/composables/useButton.js +14 -14
- package/dist/Components/Card/composables/useCard.js +27 -27
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
- package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
- package/dist/Components/Chip/Chip.vue.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.js +6 -6
- package/dist/Components/Divider/composables/useDivider.js +5 -5
- package/dist/Components/Drawer/Drawer.vue.d.ts +2 -2
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +23 -23
- package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +13 -4
- package/dist/Components/FormControl/composables/useFormControl.js +63 -59
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormControl/index.d.ts +1 -1
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/composables/useFormField.d.ts +7 -3
- package/dist/Components/FormField/composables/useFormField.js +29 -29
- package/dist/Components/FormField/formField.types.d.ts +14 -14
- package/dist/Components/Icon/composables/useIcon.js +5 -5
- package/dist/Components/Label/composables/useLabel.js +5 -5
- package/dist/Components/Link/composables/useLink.js +9 -9
- package/dist/Components/List/composables/useList.js +6 -6
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +20 -20
- package/dist/Components/ListSection/composables/useListSection.js +8 -8
- package/dist/Components/Listbox/Listbox.vue.d.ts +3 -3
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +29 -28
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -1
- package/dist/Components/Listbox/composables/useListbox.js +23 -23
- package/dist/Components/Listbox/index.d.ts +1 -0
- package/dist/Components/Listbox/index.js +3 -3
- package/dist/Components/Listbox/listbox.types.d.ts +6 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.js +43 -43
- package/dist/Components/Modal/Modal.vue.d.ts +2 -2
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.js +18 -18
- package/dist/Components/NumberField/NumberField.vue.d.ts +2 -2
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -4
- package/dist/Components/NumberField/composables/useNumberField.js +13 -10
- package/dist/Components/OtpField/OtpField.js +5 -0
- package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/OtpField/composables/useOtpField.d.ts +287 -0
- package/dist/Components/OtpField/composables/useOtpField.js +154 -0
- package/dist/Components/OtpField/index.d.ts +4 -0
- package/dist/Components/OtpField/index.js +3 -0
- package/dist/Components/OtpField/otpField.types.d.ts +120 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -4
- package/dist/Components/PasswordField/composables/usePasswordField.js +6 -3
- package/dist/Components/Progress/composables/useProgress.js +11 -11
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
- package/dist/Components/Radio/composables/useRadio.js +9 -9
- package/dist/Components/Select/Select.vue.d.ts +5 -5
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +16 -13
- package/dist/Components/Select/composables/useSelect.d.ts +5 -4
- package/dist/Components/Select/composables/useSelect.js +167 -163
- package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
- package/dist/Components/Slider/Slider.js +5 -0
- package/dist/Components/Slider/Slider.vue.d.ts +25 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +482 -0
- package/dist/Components/Slider/composables/useSlider.js +287 -0
- package/dist/Components/Slider/index.d.ts +4 -0
- package/dist/Components/Slider/index.js +3 -0
- package/dist/Components/Slider/slider.types.d.ts +169 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +2 -2
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +54 -54
- package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
- package/dist/Components/Spinner/composables/useSpinner.js +11 -11
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
- package/dist/Components/Switch/composables/useSwitch.js +9 -9
- package/dist/Components/Tab/composables/useTab.js +11 -11
- package/dist/Components/TabList/composables/useTabList.js +7 -7
- package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
- package/dist/Components/Tabs/Tabs.vue.d.ts +2 -2
- package/dist/Components/Tabs/composables/useTabs.js +22 -22
- package/dist/Components/TextField/TextField.vue.d.ts +1 -1
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/TextField/composables/useTextField.d.ts +4 -4
- package/dist/Components/TextField/composables/useTextField.js +2 -2
- package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -4
- package/dist/Components/Textarea/composables/useTextarea.js +10 -9
- package/dist/Components/Tooltip/composables/useTooltip.js +17 -17
- package/dist/Provider/bridgeUITypes.d.ts +4 -1
- package/dist/Provider/createBridgeUIApi.js +13 -1
- package/dist/Utils/index.d.ts +3 -3
- package/dist/Utils/index.js +11 -8
- package/dist/Utils/useBreakpoint.js +7 -7
- package/dist/augments.d.ts +29 -17
- package/dist/index.d.ts +11 -3
- package/dist/index.js +88 -80
- package/docs/README.md +56 -0
- package/docs/components/Alert.md +96 -0
- package/docs/components/Autocomplete.md +198 -0
- package/docs/components/Avatar.md +60 -0
- package/docs/components/Badge.md +47 -0
- package/docs/components/BaseField.md +126 -0
- package/docs/components/BridgeUIProvider.md +151 -0
- package/docs/components/Button.md +93 -0
- package/docs/components/Card.md +287 -0
- package/docs/components/Checkbox.md +87 -0
- package/docs/components/Divider.md +56 -0
- package/docs/components/Drawer.md +137 -0
- package/docs/components/FormControl.md +66 -0
- package/docs/components/FormField.md +71 -0
- package/docs/components/I18n.md +125 -0
- package/docs/components/Icon.md +88 -0
- package/docs/components/Label.md +31 -0
- package/docs/components/Link.md +71 -0
- package/docs/components/List.md +167 -0
- package/docs/components/Menu.md +97 -0
- package/docs/components/Modal.md +154 -0
- package/docs/components/NumberField.md +80 -0
- package/docs/components/OtpField.md +133 -0
- package/docs/components/PasswordField.md +82 -0
- package/docs/components/Progress.md +68 -0
- package/docs/components/Radio.md +91 -0
- package/docs/components/Select.md +181 -0
- package/docs/components/Skeleton.md +38 -0
- package/docs/components/Slider.md +140 -0
- package/docs/components/Snackbar.md +99 -0
- package/docs/components/Spinner.md +61 -0
- package/docs/components/Switch.md +72 -0
- package/docs/components/Tabs.md +207 -0
- package/docs/components/TextField.md +72 -0
- package/docs/components/Textarea.md +80 -0
- package/docs/components/Tooltip.md +125 -0
- package/docs/components/useBreakpoint.md +100 -0
- package/docs/components/useDialogAction.md +97 -0
- package/docs/components/useDrawerAction.md +75 -0
- package/docs/components/useModalAction.md +75 -0
- package/docs/components/useSnackbarAction.md +85 -0
- package/docs/examples/i18n-dictionary.ts +48 -0
- package/docs/examples/i18n-vue-i18n.ts +34 -0
- package/docs/examples/icon-fontawesome.ts +112 -0
- package/docs/examples/icon-heroicons.ts +57 -0
- package/docs/examples/icon-lucide.ts +57 -0
- package/docs/examples/icon-phosphor.ts +57 -0
- package/docs/examples/icon-tabler.ts +57 -0
- package/package.json +13 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
|
|
3
3
|
import { mergePartBind as n, resolveFieldAdornmentIconSize as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
4
4
|
import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
|
|
5
5
|
import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
|
|
6
|
-
import { Comment as ie, Text as ae, computed as a, nextTick as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { colorProps as
|
|
6
|
+
import { Comment as ie, Text as ae, computed as a, nextTick as oe, onBeforeUnmount as se, onMounted as ce, ref as o, useAttrs as le, useId as ue, useSlots as de, watch as s } from "vue";
|
|
7
|
+
import { adjustAutosizeTextareaHeight as fe, cn as c, createSelectAsyncSearch as pe, filterListboxEntries as me, flattenListboxOptions as l, mergeBridgeUILayeredClasses as u, normalizeListboxEntries as he, normalizeSelectOptions as ge, resolveSelectAsyncDebounce as _e, resolveSelectAsyncOptions as ve, selectValuesEqual as d, splitComponentProps as ye } from "@bridge-ui/core";
|
|
8
|
+
import { get as f, isNil as be, omit as xe } from "es-toolkit/compat";
|
|
9
|
+
import { colorProps as Se, invalidatedProps as Ce } from "@bridge-ui/core/Tokens/Listbox";
|
|
10
10
|
//#region src/Components/Select/composables/useSelect.ts
|
|
11
|
-
var
|
|
11
|
+
var we = [
|
|
12
12
|
"classes",
|
|
13
13
|
"loading",
|
|
14
14
|
"options",
|
|
@@ -29,92 +29,92 @@ var Se = [
|
|
|
29
29
|
"minItemsForSearch",
|
|
30
30
|
"optionDescription"
|
|
31
31
|
];
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
bridgeKeys:
|
|
32
|
+
function p(p, m, h, g, _) {
|
|
33
|
+
let Te = le(), v = de(), y = ue(), b = e(), x = o(!1), S = o(""), C = o(-1), w = o(null), T = o(!1), E = o([]), D = null, O = o([]), k = a(() => ye({
|
|
34
|
+
bridgeKeys: we,
|
|
35
35
|
props: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
36
|
+
...Te,
|
|
37
|
+
...p
|
|
38
38
|
}
|
|
39
|
-
})),
|
|
39
|
+
})), A = a(() => k.value.componentProps), j = a(() => ({ classes: A.value.classes })), { components: M, entry: Ee } = ee({
|
|
40
40
|
componentName: "Select",
|
|
41
|
-
props: () =>
|
|
41
|
+
props: () => j.value
|
|
42
42
|
}), N = i({
|
|
43
|
-
entry:
|
|
44
|
-
props: () =>
|
|
45
|
-
}), P = a(() => !!
|
|
46
|
-
optionLabel:
|
|
47
|
-
optionValue:
|
|
48
|
-
optionDescription:
|
|
49
|
-
})), I = a(() =>
|
|
43
|
+
entry: Ee,
|
|
44
|
+
props: () => j.value
|
|
45
|
+
}), P = a(() => !!A.value.multiple), F = a(() => ({
|
|
46
|
+
optionLabel: A.value.optionLabel ?? "label",
|
|
47
|
+
optionValue: A.value.optionValue ?? "value",
|
|
48
|
+
optionDescription: A.value.optionDescription ?? "description"
|
|
49
|
+
})), I = a(() => _.value.length > 0 ? _.value.map((e) => ({
|
|
50
50
|
option: e,
|
|
51
51
|
type: "option"
|
|
52
|
-
})) :
|
|
53
|
-
function
|
|
52
|
+
})) : he(A.value.options, F.value)), De = a(() => l(I.value)), L = o([]);
|
|
53
|
+
function Oe(e) {
|
|
54
54
|
if (!e || typeof e != "object") return !1;
|
|
55
55
|
let t = e.type;
|
|
56
56
|
if (!t || typeof t != "object") return !1;
|
|
57
57
|
let n = t.name, r = t.__name;
|
|
58
58
|
return n === "SelectOption" || r === "SelectOption";
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return t(
|
|
60
|
+
function ke() {
|
|
61
|
+
return t(v, "default") ? (v.default?.({}) ?? []).some((e) => {
|
|
62
62
|
if (!e || typeof e != "object") return !1;
|
|
63
63
|
let t = e.type;
|
|
64
|
-
return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !
|
|
64
|
+
return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !Oe(e);
|
|
65
65
|
}) : !1;
|
|
66
66
|
}
|
|
67
|
-
let R = a(() =>
|
|
67
|
+
let R = a(() => ke() && !A.value.options?.length), z = a(() => {
|
|
68
68
|
if (R.value) return [];
|
|
69
|
-
if (
|
|
70
|
-
let e =
|
|
71
|
-
return
|
|
69
|
+
if (E.value.length > 0) {
|
|
70
|
+
let e = he(E.value, F.value);
|
|
71
|
+
return A.value.flipOptions ? [...e].reverse() : e;
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return A.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
|
|
74
74
|
...e,
|
|
75
75
|
options: [...e.options].reverse()
|
|
76
76
|
} : e) : I.value;
|
|
77
|
-
}),
|
|
78
|
-
let e =
|
|
79
|
-
return P.value ? Array.isArray(e) ? e : [] : !
|
|
77
|
+
}), Ae = a(() => R.value ? L.value : l(z.value)), B = a(() => {
|
|
78
|
+
let e = m.value;
|
|
79
|
+
return P.value ? Array.isArray(e) ? e : [] : !be(e) && e !== "" ? [e] : [];
|
|
80
80
|
}), V = a(() => {
|
|
81
81
|
let e = /* @__PURE__ */ new Map();
|
|
82
|
-
for (let t of [...
|
|
82
|
+
for (let t of [...Ae.value, ...O.value]) e.set(t.value, t);
|
|
83
83
|
return B.value.map((t) => e.get(t) ?? {
|
|
84
84
|
value: t,
|
|
85
85
|
label: String(t)
|
|
86
86
|
});
|
|
87
|
-
}),
|
|
88
|
-
if (H.value ||
|
|
89
|
-
let e =
|
|
90
|
-
return
|
|
91
|
-
}), W = a(() =>
|
|
87
|
+
}), je = a(() => B.value.length > 0), Me = a(() => A.value.clearable !== !1), H = a(() => !!A.value.asyncData), U = a(() => {
|
|
88
|
+
if (H.value || A.value.searchable) return !0;
|
|
89
|
+
let e = A.value.minItemsForSearch ?? 11;
|
|
90
|
+
return De.value.length >= e;
|
|
91
|
+
}), W = a(() => x.value && U.value), Ne = a(() => !!A.value.loading || T.value), Pe = a(() => {
|
|
92
92
|
if (R.value) return [];
|
|
93
|
-
if (!W.value || !
|
|
94
|
-
let e =
|
|
95
|
-
return
|
|
96
|
-
}), G = a(() => R.value ? L.value :
|
|
97
|
-
|
|
93
|
+
if (!W.value || !S.value.trim()) return z.value;
|
|
94
|
+
let e = S.value.trim().toLowerCase();
|
|
95
|
+
return me(z.value, (t) => t.label.toLowerCase().includes(e));
|
|
96
|
+
}), G = a(() => R.value ? L.value : l(Pe.value)), K = re(() => G.value, C, y), Fe = a(() => p.readonly || p.disabled ? !0 : !W.value), Ie = a(() => W.value || P.value ? S.value : V.value[0]?.label ?? ""), Le = (e) => {
|
|
97
|
+
w.value = e instanceof HTMLElement ? e : null;
|
|
98
98
|
};
|
|
99
|
-
function
|
|
99
|
+
function Re(e) {
|
|
100
100
|
e.preventDefault();
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
102
|
+
function ze(e) {
|
|
103
|
+
if (p.disabled || p.readonly) return;
|
|
104
104
|
let t = e.target;
|
|
105
105
|
if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
|
|
106
|
-
if (!
|
|
106
|
+
if (!x.value) {
|
|
107
107
|
Q();
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
W.value || ($(),
|
|
110
|
+
W.value || ($(), h.value?.focus({ preventScroll: !0 }));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
let
|
|
113
|
+
let Be = a(() => {
|
|
114
114
|
let e = ye({
|
|
115
115
|
bridgeKeys: te,
|
|
116
|
-
props:
|
|
117
|
-
}).componentProps, r = e.endIcon ?? (t(
|
|
116
|
+
props: xe(k.value.inheritedAttrs, ["class"])
|
|
117
|
+
}).componentProps, r = e.endIcon ?? (t(v, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...i } = e.customProps ?? {};
|
|
118
118
|
return {
|
|
119
119
|
...e,
|
|
120
120
|
endIcon: r,
|
|
@@ -122,97 +122,98 @@ function g(g, _, v, y, b) {
|
|
|
122
122
|
customProps: {
|
|
123
123
|
...i,
|
|
124
124
|
container: n(i.container, {}, {
|
|
125
|
-
ref:
|
|
126
|
-
onClick:
|
|
127
|
-
class:
|
|
125
|
+
ref: Le,
|
|
126
|
+
onClick: ze,
|
|
127
|
+
class: c({ "cursor-pointer": !p.disabled && !p.readonly && !W.value })
|
|
128
128
|
})
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
}),
|
|
131
|
+
}), Ve = a(() => p.customProps?.listbox), q = ne(() => Be.value, {
|
|
132
132
|
size: "md",
|
|
133
133
|
rounded: "md",
|
|
134
134
|
color: "primary",
|
|
135
135
|
variant: "outline",
|
|
136
|
-
|
|
136
|
+
showErrorIcon: !0
|
|
137
137
|
}, {
|
|
138
|
+
componentName: "Select",
|
|
138
139
|
likeInput: () => P.value,
|
|
139
140
|
control: () => P.value ? "textarea" : "input"
|
|
140
141
|
}), J = (e) => {
|
|
141
|
-
!e || !P.value ||
|
|
142
|
+
!e || !P.value || fe(e);
|
|
142
143
|
};
|
|
143
144
|
function Y(e) {
|
|
144
|
-
return B.value.some((t) =>
|
|
145
|
+
return B.value.some((t) => d(t, e));
|
|
145
146
|
}
|
|
146
147
|
function X(e) {
|
|
147
|
-
|
|
148
|
+
m.value = e;
|
|
148
149
|
}
|
|
149
150
|
function Z(e) {
|
|
150
151
|
if (P.value) {
|
|
151
152
|
let t = Array.isArray(e) ? e : [];
|
|
152
|
-
|
|
153
|
+
g("update:modelValue", t), g("change", t);
|
|
153
154
|
return;
|
|
154
155
|
}
|
|
155
156
|
let t = e ?? "";
|
|
156
|
-
|
|
157
|
+
g("update:modelValue", t), g("change", t);
|
|
157
158
|
}
|
|
158
159
|
function Q() {
|
|
159
|
-
|
|
160
|
+
p.disabled || p.readonly || x.value || (x.value = !0, S.value = "", K.highlightCurrentSelection(Y), g("open"), H.value && A.value.asyncData && D?.searchImmediate(""));
|
|
160
161
|
}
|
|
161
162
|
function $() {
|
|
162
|
-
|
|
163
|
+
D?.cancel(), x.value && (x.value = !1, S.value = "", C.value = -1, g("close"));
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function He(e) {
|
|
165
166
|
if (!e.disabled) {
|
|
166
167
|
if (P.value) {
|
|
167
|
-
let t = [...B.value], n = t.findIndex((t) =>
|
|
168
|
-
n >= 0 ? (t.splice(n, 1),
|
|
169
|
-
J(
|
|
168
|
+
let t = [...B.value], n = t.findIndex((t) => d(t, e.value));
|
|
169
|
+
n >= 0 ? (t.splice(n, 1), g("deselect", e)) : (t.push(e.value), g("select", e)), X(t), Z(t), S.value = "", C.value = -1, oe(() => {
|
|
170
|
+
J(h.value), h.value?.focus({ preventScroll: !0 });
|
|
170
171
|
});
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
|
-
X(e.value), Z(e.value),
|
|
174
|
+
X(e.value), Z(e.value), g("select", e), $();
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
-
e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)),
|
|
177
|
+
function Ue(e) {
|
|
178
|
+
e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)), g("clear"), $();
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function We(e, t) {
|
|
180
181
|
if (t.preventDefault(), t.stopPropagation(), !P.value) return;
|
|
181
|
-
let n = B.value.filter((t) => !
|
|
182
|
-
X(n), Z(n),
|
|
182
|
+
let n = B.value.filter((t) => !d(t, e.value));
|
|
183
|
+
X(n), Z(n), g("deselect", e), oe(() => J(h.value));
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
+
function Ge() {
|
|
185
186
|
let e = K.getHighlightedOption();
|
|
186
|
-
e &&
|
|
187
|
+
e && He(e);
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
189
|
+
function Ke(e) {
|
|
190
|
+
S.value = e.target.value, g("search", S.value), x.value || Q(), K.resetHighlight(), H.value && D?.searchDebounced(S.value);
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
if (!(
|
|
192
|
+
function qe(e) {
|
|
193
|
+
if (!(p.disabled || p.readonly)) switch (e.key) {
|
|
193
194
|
case "ArrowDown":
|
|
194
|
-
e.preventDefault(),
|
|
195
|
+
e.preventDefault(), x.value ? K.moveHighlight(1) : Q();
|
|
195
196
|
break;
|
|
196
197
|
case "ArrowUp":
|
|
197
|
-
e.preventDefault(),
|
|
198
|
+
e.preventDefault(), x.value ? K.moveHighlight(-1) : Q();
|
|
198
199
|
break;
|
|
199
200
|
case "Enter":
|
|
200
|
-
e.preventDefault(),
|
|
201
|
+
e.preventDefault(), x.value ? Ge() : Q();
|
|
201
202
|
break;
|
|
202
203
|
case "Escape":
|
|
203
204
|
e.preventDefault(), $();
|
|
204
205
|
break;
|
|
205
206
|
case "Home":
|
|
206
|
-
|
|
207
|
+
x.value && (e.preventDefault(), K.highlightFirst());
|
|
207
208
|
break;
|
|
208
209
|
case "End":
|
|
209
|
-
|
|
210
|
+
x.value && (e.preventDefault(), K.highlightLast());
|
|
210
211
|
break;
|
|
211
212
|
case "Backspace":
|
|
212
|
-
if (P.value && !
|
|
213
|
+
if (P.value && !S.value && V.value.length > 0) {
|
|
213
214
|
e.preventDefault();
|
|
214
215
|
let t = V.value.at(-1);
|
|
215
|
-
t &&
|
|
216
|
+
t && We(t, e);
|
|
216
217
|
}
|
|
217
218
|
break;
|
|
218
219
|
case "Tab":
|
|
@@ -221,141 +222,144 @@ function g(g, _, v, y, b) {
|
|
|
221
222
|
default: break;
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
|
-
async function
|
|
225
|
-
let t =
|
|
225
|
+
async function Je(e) {
|
|
226
|
+
let t = A.value.asyncData;
|
|
226
227
|
if (t) {
|
|
227
|
-
|
|
228
|
+
T.value = !0;
|
|
228
229
|
try {
|
|
229
230
|
let { options: n, resolvedSelected: r } = await ve(t, e, B.value, (e) => ge(e, F.value));
|
|
230
|
-
r.length > 0 && (
|
|
231
|
+
r.length > 0 && (O.value = r), E.value = n;
|
|
231
232
|
} finally {
|
|
232
|
-
|
|
233
|
+
T.value = !1;
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
async function
|
|
237
|
-
let e =
|
|
238
|
-
!e?.resolve || B.value.length === 0 || (
|
|
237
|
+
async function Ye() {
|
|
238
|
+
let e = A.value.asyncData;
|
|
239
|
+
!e?.resolve || B.value.length === 0 || (O.value = ge(await e.resolve(B.value), F.value));
|
|
239
240
|
}
|
|
240
|
-
let
|
|
241
|
-
let e =
|
|
242
|
-
"
|
|
241
|
+
let Xe = a(() => {
|
|
242
|
+
let e = f(u(Se, f(M.value, [
|
|
243
|
+
"Select",
|
|
243
244
|
"tokens",
|
|
245
|
+
"listbox",
|
|
244
246
|
"color"
|
|
245
247
|
])), q.merged.value.color ?? "primary");
|
|
246
|
-
return q.invalidated.value ?
|
|
247
|
-
"
|
|
248
|
+
return q.invalidated.value ? u(Ce, f(M.value, [
|
|
249
|
+
"Select",
|
|
248
250
|
"tokens",
|
|
251
|
+
"listbox",
|
|
249
252
|
"invalidated"
|
|
250
253
|
])) : e;
|
|
251
|
-
}),
|
|
252
|
-
let e = !
|
|
254
|
+
}), Ze = a(() => Xe.value?.value), Qe = a(() => {
|
|
255
|
+
let e = !p.disabled && !p.readonly && !W.value, t = !p.disabled && !p.readonly && W.value && U.value, r = je.value && !P.value && !W.value;
|
|
253
256
|
return n({
|
|
254
257
|
role: "combobox",
|
|
255
|
-
value:
|
|
256
|
-
"aria-controls":
|
|
257
|
-
"aria-expanded":
|
|
258
|
-
readonly:
|
|
259
|
-
onKeydown:
|
|
260
|
-
placeholder:
|
|
258
|
+
value: Ie.value,
|
|
259
|
+
"aria-controls": y,
|
|
260
|
+
"aria-expanded": x.value,
|
|
261
|
+
readonly: Fe.value,
|
|
262
|
+
onKeydown: qe,
|
|
263
|
+
placeholder: A.value.placeholder,
|
|
261
264
|
"aria-autocomplete": U.value ? "list" : void 0,
|
|
262
|
-
"aria-activedescendant":
|
|
265
|
+
"aria-activedescendant": x.value ? K.activeDescendantId.value : void 0,
|
|
263
266
|
...P.value ? {
|
|
264
267
|
rows: 1,
|
|
265
268
|
onInput: (e) => {
|
|
266
|
-
|
|
269
|
+
Ke(e), J(e.target);
|
|
267
270
|
}
|
|
268
|
-
} : { onInput:
|
|
269
|
-
}, q.inputBind.value,
|
|
271
|
+
} : { onInput: Ke }
|
|
272
|
+
}, q.inputBind.value, c({
|
|
270
273
|
"cursor-text": t,
|
|
271
274
|
"cursor-pointer": e,
|
|
272
275
|
"resize-none overflow-hidden": P.value,
|
|
273
|
-
[
|
|
276
|
+
[c(Ze.value, N.value.value) ?? ""]: r
|
|
274
277
|
}));
|
|
275
278
|
});
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
s(() => [
|
|
280
|
+
x.value,
|
|
278
281
|
P.value,
|
|
279
|
-
|
|
282
|
+
h.value
|
|
280
283
|
], () => {
|
|
281
|
-
J(
|
|
282
|
-
}, { immediate: !0 }),
|
|
283
|
-
|
|
284
|
-
}, { immediate: !0 }),
|
|
285
|
-
if (
|
|
286
|
-
|
|
284
|
+
J(h.value);
|
|
285
|
+
}, { immediate: !0 }), s(() => m.value, () => {
|
|
286
|
+
Ye();
|
|
287
|
+
}, { immediate: !0 }), s(() => A.value.asyncData, (e) => {
|
|
288
|
+
if (D?.cancel(), E.value = [], Ye(), !e) {
|
|
289
|
+
D = null;
|
|
287
290
|
return;
|
|
288
291
|
}
|
|
289
|
-
|
|
290
|
-
}, { immediate: !0 }),
|
|
291
|
-
|
|
292
|
-
}),
|
|
293
|
-
J(
|
|
292
|
+
D = pe((e) => void Je(e), _e(e));
|
|
293
|
+
}, { immediate: !0 }), se(() => {
|
|
294
|
+
D?.cancel();
|
|
295
|
+
}), ce(() => {
|
|
296
|
+
J(h.value);
|
|
294
297
|
});
|
|
295
|
-
let
|
|
298
|
+
let $e = a(() => r(q.merged.value.size)), et = a(() => n({}, {}, {
|
|
296
299
|
tabindex: 0,
|
|
297
300
|
role: "button",
|
|
298
301
|
"data-select-clear": !0,
|
|
299
|
-
onMousedown:
|
|
300
|
-
class:
|
|
302
|
+
onMousedown: Re,
|
|
303
|
+
class: c({
|
|
301
304
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
|
|
302
|
-
[
|
|
305
|
+
[Xe.value?.clear ?? ""]: !0,
|
|
303
306
|
[N.value.clear ?? ""]: !0
|
|
304
307
|
})
|
|
305
|
-
})),
|
|
306
|
-
listboxId:
|
|
308
|
+
})), tt = a(() => ({
|
|
309
|
+
listboxId: y,
|
|
307
310
|
isSelected: Y,
|
|
308
311
|
disableAutoFocus: !0,
|
|
309
|
-
loading:
|
|
312
|
+
loading: Ne.value,
|
|
310
313
|
multiple: P.value,
|
|
311
|
-
maxHeight:
|
|
312
|
-
entries:
|
|
314
|
+
maxHeight: p.maxHeight,
|
|
315
|
+
entries: Pe.value,
|
|
313
316
|
options: G.value,
|
|
317
|
+
componentName: "Select",
|
|
314
318
|
size: q.merged.value.size,
|
|
315
319
|
color: q.merged.value.color,
|
|
316
320
|
labelledBy: q.controlId.value,
|
|
317
321
|
rounded: q.merged.value.rounded,
|
|
318
322
|
invalidated: q.invalidated.value,
|
|
319
|
-
highlightedIndex:
|
|
320
|
-
disableMaxHeight:
|
|
321
|
-
hideEmptyMessage:
|
|
322
|
-
emptyMessage:
|
|
323
|
-
loadingMessage:
|
|
324
|
-
...
|
|
323
|
+
highlightedIndex: C.value,
|
|
324
|
+
disableMaxHeight: p.disableMaxHeight === !0,
|
|
325
|
+
hideEmptyMessage: A.value.hideEmptyMessage === !0,
|
|
326
|
+
emptyMessage: A.value.emptyMessage ?? b("No options"),
|
|
327
|
+
loadingMessage: A.value.loadingMessage ?? b("Loading..."),
|
|
328
|
+
...Ve.value
|
|
325
329
|
}));
|
|
326
|
-
function
|
|
330
|
+
function nt(e) {
|
|
327
331
|
let t = L.value;
|
|
328
332
|
t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (L.value = e);
|
|
329
333
|
}
|
|
330
334
|
return {
|
|
331
|
-
open:
|
|
332
|
-
slots:
|
|
333
|
-
hasValue:
|
|
335
|
+
open: x,
|
|
336
|
+
slots: v,
|
|
337
|
+
hasValue: je,
|
|
334
338
|
multiple: P,
|
|
335
|
-
listboxId:
|
|
339
|
+
listboxId: y,
|
|
336
340
|
formField: q,
|
|
337
|
-
isLoading:
|
|
338
|
-
clearable:
|
|
339
|
-
clearBind:
|
|
341
|
+
isLoading: Ne,
|
|
342
|
+
clearable: Me,
|
|
343
|
+
clearBind: et,
|
|
340
344
|
isSelected: Y,
|
|
341
|
-
clearValue:
|
|
342
|
-
removeChip:
|
|
343
|
-
triggerBind:
|
|
344
|
-
selectOption:
|
|
345
|
-
containerRef:
|
|
346
|
-
listboxProps:
|
|
347
|
-
clearIconSize:
|
|
345
|
+
clearValue: Ue,
|
|
346
|
+
removeChip: We,
|
|
347
|
+
triggerBind: Qe,
|
|
348
|
+
selectOption: He,
|
|
349
|
+
containerRef: w,
|
|
350
|
+
listboxProps: tt,
|
|
351
|
+
clearIconSize: $e,
|
|
348
352
|
mergedClasses: N,
|
|
349
353
|
visibleOptions: G,
|
|
350
354
|
isSearchActive: W,
|
|
351
355
|
selectedOptions: V,
|
|
352
356
|
hasComposedList: R,
|
|
353
|
-
highlightedIndex:
|
|
354
|
-
handleRegisteredOptionsChange:
|
|
355
|
-
hideEmptyMessage: a(() =>
|
|
356
|
-
emptyMessage: a(() =>
|
|
357
|
-
loadingMessage: a(() =>
|
|
357
|
+
highlightedIndex: C,
|
|
358
|
+
handleRegisteredOptionsChange: nt,
|
|
359
|
+
hideEmptyMessage: a(() => A.value.hideEmptyMessage === !0),
|
|
360
|
+
emptyMessage: a(() => A.value.emptyMessage ?? b("No options")),
|
|
361
|
+
loadingMessage: a(() => A.value.loadingMessage ?? b("Loading..."))
|
|
358
362
|
};
|
|
359
363
|
}
|
|
360
364
|
//#endregion
|
|
361
|
-
export {
|
|
365
|
+
export { p as useSelect };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn as a, mergeBridgeUILayeredClasses as o, splitComponentProps as s } from "@bridge-ui/core";
|
|
4
|
+
import { get as c } from "es-toolkit/compat";
|
|
5
5
|
import { roundedProps as l } from "@bridge-ui/core/Tokens/Skeleton";
|
|
6
6
|
//#region src/Components/Skeleton/composables/useSkeleton.ts
|
|
7
7
|
var u = ["classes", "rounded"];
|
|
8
8
|
function d(d, f) {
|
|
9
|
-
let p = i(), m = r(() =>
|
|
9
|
+
let p = i(), m = r(() => s({
|
|
10
10
|
props: {
|
|
11
11
|
...p,
|
|
12
12
|
...d
|
|
@@ -19,10 +19,10 @@ function d(d, f) {
|
|
|
19
19
|
}), _ = n({
|
|
20
20
|
entry: g,
|
|
21
21
|
props: () => m.value.componentProps
|
|
22
|
-
}), v = r(() =>
|
|
22
|
+
}), v = r(() => c(o(l, g.value?.tokens?.rounded), h.value.rounded));
|
|
23
23
|
return {
|
|
24
24
|
merged: h,
|
|
25
|
-
rootBind: r(() => e({}, m.value.inheritedAttrs,
|
|
25
|
+
rootBind: r(() => e({}, m.value.inheritedAttrs, a({
|
|
26
26
|
"block animate-pulse bg-gray-200 dark:bg-gray-700": !0,
|
|
27
27
|
[v.value ?? ""]: !0,
|
|
28
28
|
[_.value.root ?? ""]: !0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SliderRangeValue } from '@bridge-ui/core';
|
|
2
|
+
import { SliderOwnProps, SliderSlots } from './slider.types';
|
|
3
|
+
type __VLS_Slots = SliderSlots;
|
|
4
|
+
type __VLS_Props = SliderOwnProps;
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
modelValue?: number | undefined | SliderRangeValue;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
change: (value: number | SliderRangeValue) => any;
|
|
11
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
onChange?: ((value: number | SliderRangeValue) => any) | undefined;
|
|
14
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
showTooltip: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|