@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
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
|
+
import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
|
|
3
|
+
import { mergePartBind as n, resolveFieldAdornmentIconSize as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
4
|
+
import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
|
|
5
|
+
import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
|
|
6
|
+
import { Comment as ie, Text as ae, computed as a, nextTick as o, onBeforeUnmount as oe, onMounted as se, ref as s, useAttrs as ce, useId as le, useSlots as ue, watch as c } from "vue";
|
|
7
|
+
import { adjustAutosizeTextareaHeight as de, cn as l, commitFreeSoloValue as fe, createSelectAsyncSearch as pe, filterListboxEntries as me, flattenListboxOptions as u, mergeBridgeUILayeredClasses as d, normalizeListboxEntries as f, normalizeSelectOptions as p, resolveSelectAsyncDebounce as he, resolveSelectAsyncOptions as ge, selectValuesEqual as m, splitComponentProps as _e } from "@bridge-ui/core";
|
|
8
|
+
import { get as h, isNil as ve, omit as ye } from "es-toolkit/compat";
|
|
9
|
+
import { colorProps as be, invalidatedProps as xe } from "@bridge-ui/core/Tokens/Listbox";
|
|
10
|
+
//#region src/Components/Autocomplete/composables/useAutocomplete.ts
|
|
11
|
+
var Se = [
|
|
12
|
+
"classes",
|
|
13
|
+
"loading",
|
|
14
|
+
"options",
|
|
15
|
+
"freeSolo",
|
|
16
|
+
"multiple",
|
|
17
|
+
"asyncData",
|
|
18
|
+
"clearable",
|
|
19
|
+
"maxHeight",
|
|
20
|
+
"searchable",
|
|
21
|
+
"flipOptions",
|
|
22
|
+
"optionLabel",
|
|
23
|
+
"optionValue",
|
|
24
|
+
"placeholder",
|
|
25
|
+
"defaultValue",
|
|
26
|
+
"emptyMessage",
|
|
27
|
+
"loadingMessage",
|
|
28
|
+
"disableMaxHeight",
|
|
29
|
+
"hideEmptyMessage",
|
|
30
|
+
"minItemsForSearch",
|
|
31
|
+
"optionDescription"
|
|
32
|
+
];
|
|
33
|
+
function g(g, _, v, y, Ce) {
|
|
34
|
+
let we = ce(), b = ue(), x = le(), S = e(), C = s(!1), w = s(""), T = s(-1), E = s(null), D = s(!1), O = s([]), k = null, A = s([]), j = a(() => _e({
|
|
35
|
+
props: {
|
|
36
|
+
...we,
|
|
37
|
+
...g
|
|
38
|
+
},
|
|
39
|
+
bridgeKeys: Se
|
|
40
|
+
})), M = a(() => j.value.componentProps), Te = a(() => ({ classes: M.value.classes })), { components: Ee, entry: De } = ee({
|
|
41
|
+
componentName: "Autocomplete",
|
|
42
|
+
props: () => Te.value
|
|
43
|
+
}), N = i({
|
|
44
|
+
entry: De,
|
|
45
|
+
props: () => Te.value
|
|
46
|
+
}), P = a(() => !!M.value.multiple), F = a(() => ({
|
|
47
|
+
optionLabel: M.value.optionLabel ?? "label",
|
|
48
|
+
optionValue: M.value.optionValue ?? "value",
|
|
49
|
+
optionDescription: M.value.optionDescription ?? "description"
|
|
50
|
+
})), I = a(() => Ce.value.length > 0 ? Ce.value.map((e) => ({
|
|
51
|
+
option: e,
|
|
52
|
+
type: "option"
|
|
53
|
+
})) : f(M.value.options, F.value)), Oe = a(() => u(I.value)), L = s([]);
|
|
54
|
+
function ke(e) {
|
|
55
|
+
if (!e || typeof e != "object") return !1;
|
|
56
|
+
let t = e.type;
|
|
57
|
+
if (!t || typeof t != "object") return !1;
|
|
58
|
+
let n = t.name, r = t.__name;
|
|
59
|
+
return n === "AutocompleteOption" || r === "AutocompleteOption";
|
|
60
|
+
}
|
|
61
|
+
function Ae() {
|
|
62
|
+
return t(b, "default") ? (b.default?.({}) ?? []).some((e) => {
|
|
63
|
+
if (!e || typeof e != "object") return !1;
|
|
64
|
+
let t = e.type;
|
|
65
|
+
return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !ke(e);
|
|
66
|
+
}) : !1;
|
|
67
|
+
}
|
|
68
|
+
let R = a(() => Ae() && !M.value.options?.length), z = a(() => {
|
|
69
|
+
if (R.value) return [];
|
|
70
|
+
if (O.value.length > 0) {
|
|
71
|
+
let e = f(O.value, F.value);
|
|
72
|
+
return M.value.flipOptions ? [...e].reverse() : e;
|
|
73
|
+
}
|
|
74
|
+
return M.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
|
|
75
|
+
...e,
|
|
76
|
+
options: [...e.options].reverse()
|
|
77
|
+
} : e) : I.value;
|
|
78
|
+
}), je = a(() => R.value ? L.value : u(z.value)), B = a(() => {
|
|
79
|
+
let e = _.value;
|
|
80
|
+
return P.value ? Array.isArray(e) ? e : [] : !ve(e) && e !== "" ? [e] : [];
|
|
81
|
+
}), V = a(() => {
|
|
82
|
+
let e = /* @__PURE__ */ new Map();
|
|
83
|
+
for (let t of [...je.value, ...A.value]) e.set(t.value, t);
|
|
84
|
+
return B.value.map((t) => e.get(t) ?? {
|
|
85
|
+
value: t,
|
|
86
|
+
label: String(t)
|
|
87
|
+
});
|
|
88
|
+
}), Me = a(() => B.value.length > 0), Ne = a(() => M.value.clearable !== !1), H = a(() => !!M.value.asyncData), U = a(() => {
|
|
89
|
+
if (H.value || (M.value.searchable ?? !0)) return !0;
|
|
90
|
+
let e = M.value.minItemsForSearch ?? 11;
|
|
91
|
+
return Oe.value.length >= e;
|
|
92
|
+
}), W = a(() => C.value && U.value), Pe = a(() => !!M.value.loading || D.value), Fe = a(() => {
|
|
93
|
+
if (R.value) return [];
|
|
94
|
+
if (!W.value || !w.value.trim()) return z.value;
|
|
95
|
+
let e = w.value.trim().toLowerCase();
|
|
96
|
+
return me(z.value, (t) => t.label.toLowerCase().includes(e));
|
|
97
|
+
}), G = a(() => R.value ? L.value : u(Fe.value)), K = re(() => G.value, T, x), Ie = a(() => g.readonly || g.disabled ? !0 : !W.value), Le = a(() => W.value || P.value ? w.value : V.value[0]?.label ?? ""), Re = (e) => {
|
|
98
|
+
E.value = e instanceof HTMLElement ? e : null;
|
|
99
|
+
};
|
|
100
|
+
function ze(e) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
}
|
|
103
|
+
function Be(e) {
|
|
104
|
+
if (g.disabled || g.readonly) return;
|
|
105
|
+
let t = e.target;
|
|
106
|
+
if (!t.closest("[data-autocomplete-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
|
|
107
|
+
if (!C.value) {
|
|
108
|
+
Q();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
W.value || ($(), v.value?.focus({ preventScroll: !0 }));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
let Ve = a(() => {
|
|
115
|
+
let e = _e({
|
|
116
|
+
bridgeKeys: te,
|
|
117
|
+
props: ye(j.value.inheritedAttrs, ["class"])
|
|
118
|
+
}).componentProps, r = e.endIcon ?? (t(b, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...i } = e.customProps ?? {};
|
|
119
|
+
return {
|
|
120
|
+
...e,
|
|
121
|
+
endIcon: r,
|
|
122
|
+
classes: N.value,
|
|
123
|
+
customProps: {
|
|
124
|
+
...i,
|
|
125
|
+
container: n(i.container, {}, {
|
|
126
|
+
ref: Re,
|
|
127
|
+
onClick: Be,
|
|
128
|
+
class: l({ "cursor-pointer": !g.disabled && !g.readonly && !W.value })
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}), He = a(() => g.customProps?.listbox), q = ne(() => Ve.value, {
|
|
133
|
+
size: "md",
|
|
134
|
+
rounded: "md",
|
|
135
|
+
color: "primary",
|
|
136
|
+
variant: "outline",
|
|
137
|
+
showErrorIcon: !0
|
|
138
|
+
}, {
|
|
139
|
+
componentName: "Autocomplete",
|
|
140
|
+
likeInput: () => P.value,
|
|
141
|
+
control: () => P.value ? "textarea" : "input"
|
|
142
|
+
}), J = (e) => {
|
|
143
|
+
!e || !P.value || de(e);
|
|
144
|
+
};
|
|
145
|
+
function Y(e) {
|
|
146
|
+
return B.value.some((t) => m(t, e));
|
|
147
|
+
}
|
|
148
|
+
function X(e) {
|
|
149
|
+
_.value = e;
|
|
150
|
+
}
|
|
151
|
+
function Z(e) {
|
|
152
|
+
if (P.value) {
|
|
153
|
+
let t = Array.isArray(e) ? e : [];
|
|
154
|
+
y("update:modelValue", t), y("change", t);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
let t = e ?? "";
|
|
158
|
+
y("update:modelValue", t), y("change", t);
|
|
159
|
+
}
|
|
160
|
+
function Q() {
|
|
161
|
+
g.disabled || g.readonly || C.value || (C.value = !0, w.value = "", K.highlightCurrentSelection(Y), y("open"), H.value && M.value.asyncData && k?.searchImmediate(""));
|
|
162
|
+
}
|
|
163
|
+
function $(e) {
|
|
164
|
+
k?.cancel();
|
|
165
|
+
let t = C.value;
|
|
166
|
+
if (t && e?.commitFreeSolo && M.value.freeSolo !== !1) {
|
|
167
|
+
let e = fe(w.value, B.value, P.value);
|
|
168
|
+
e != null && (X(e), Z(e), P.value && o(() => {
|
|
169
|
+
J(v.value), v.value?.focus({ preventScroll: !0 });
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
w.value = "", T.value = -1, t && (C.value = !1, y("close"));
|
|
173
|
+
}
|
|
174
|
+
function Ue(e) {
|
|
175
|
+
if (!e.disabled) {
|
|
176
|
+
if (P.value) {
|
|
177
|
+
let t = [...B.value], n = t.findIndex((t) => m(t, e.value));
|
|
178
|
+
n >= 0 ? (t.splice(n, 1), y("deselect", e)) : (t.push(e.value), y("select", e)), X(t), Z(t), w.value = "", T.value = -1, o(() => {
|
|
179
|
+
J(v.value), v.value?.focus({ preventScroll: !0 });
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
X(e.value), Z(e.value), y("select", e), $();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function We() {
|
|
187
|
+
if (M.value.freeSolo === !1) return !1;
|
|
188
|
+
let e = fe(w.value, B.value, P.value);
|
|
189
|
+
return e == null ? !1 : (X(e), Z(e), w.value = "", T.value = -1, P.value ? (o(() => {
|
|
190
|
+
J(v.value), v.value?.focus({ preventScroll: !0 });
|
|
191
|
+
}), !0) : ($(), !0));
|
|
192
|
+
}
|
|
193
|
+
function Ge(e) {
|
|
194
|
+
e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)), y("clear"), $();
|
|
195
|
+
}
|
|
196
|
+
function Ke(e, t) {
|
|
197
|
+
if (t.preventDefault(), t.stopPropagation(), !P.value) return;
|
|
198
|
+
let n = B.value.filter((t) => !m(t, e.value));
|
|
199
|
+
X(n), Z(n), y("deselect", e), o(() => J(v.value));
|
|
200
|
+
}
|
|
201
|
+
function qe() {
|
|
202
|
+
let e = K.getHighlightedOption();
|
|
203
|
+
return e ? (Ue(e), !0) : !1;
|
|
204
|
+
}
|
|
205
|
+
function Je(e) {
|
|
206
|
+
w.value = e.target.value, y("search", w.value), C.value || Q(), K.resetHighlight(), H.value && k?.searchDebounced(w.value);
|
|
207
|
+
}
|
|
208
|
+
function Ye(e) {
|
|
209
|
+
if (!(g.disabled || g.readonly)) switch (e.key) {
|
|
210
|
+
case "ArrowDown":
|
|
211
|
+
e.preventDefault(), C.value ? K.moveHighlight(1) : Q();
|
|
212
|
+
break;
|
|
213
|
+
case "ArrowUp":
|
|
214
|
+
e.preventDefault(), C.value ? K.moveHighlight(-1) : Q();
|
|
215
|
+
break;
|
|
216
|
+
case "Enter":
|
|
217
|
+
e.preventDefault(), C.value ? qe() || We() : Q();
|
|
218
|
+
break;
|
|
219
|
+
case "Escape":
|
|
220
|
+
e.preventDefault(), $();
|
|
221
|
+
break;
|
|
222
|
+
case "Home":
|
|
223
|
+
C.value && (e.preventDefault(), K.highlightFirst());
|
|
224
|
+
break;
|
|
225
|
+
case "End":
|
|
226
|
+
C.value && (e.preventDefault(), K.highlightLast());
|
|
227
|
+
break;
|
|
228
|
+
case "Backspace":
|
|
229
|
+
if (P.value && !w.value && V.value.length > 0) {
|
|
230
|
+
e.preventDefault();
|
|
231
|
+
let t = V.value.at(-1);
|
|
232
|
+
t && Ke(t, e);
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
case "Tab":
|
|
236
|
+
$({ commitFreeSolo: !0 });
|
|
237
|
+
break;
|
|
238
|
+
default: break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function Xe(e) {
|
|
242
|
+
let t = M.value.asyncData;
|
|
243
|
+
if (t) {
|
|
244
|
+
D.value = !0;
|
|
245
|
+
try {
|
|
246
|
+
let { options: n, resolvedSelected: r } = await ge(t, e, B.value, (e) => p(e, F.value));
|
|
247
|
+
r.length > 0 && (A.value = r), O.value = n;
|
|
248
|
+
} finally {
|
|
249
|
+
D.value = !1;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async function Ze() {
|
|
254
|
+
let e = M.value.asyncData;
|
|
255
|
+
!e?.resolve || B.value.length === 0 || (A.value = p(await e.resolve(B.value), F.value));
|
|
256
|
+
}
|
|
257
|
+
let Qe = a(() => {
|
|
258
|
+
let e = h(d(be, h(Ee.value, [
|
|
259
|
+
"Autocomplete",
|
|
260
|
+
"tokens",
|
|
261
|
+
"listbox",
|
|
262
|
+
"color"
|
|
263
|
+
])), q.merged.value.color ?? "primary");
|
|
264
|
+
return q.invalidated.value ? d(xe, h(Ee.value, [
|
|
265
|
+
"Autocomplete",
|
|
266
|
+
"tokens",
|
|
267
|
+
"listbox",
|
|
268
|
+
"invalidated"
|
|
269
|
+
])) : e;
|
|
270
|
+
}), $e = a(() => Qe.value?.value), et = a(() => {
|
|
271
|
+
let e = !g.disabled && !g.readonly && !W.value, t = !g.disabled && !g.readonly && W.value && U.value, r = Me.value && !P.value && !W.value;
|
|
272
|
+
return n({
|
|
273
|
+
role: "combobox",
|
|
274
|
+
value: Le.value,
|
|
275
|
+
"aria-controls": x,
|
|
276
|
+
"aria-expanded": C.value,
|
|
277
|
+
readonly: Ie.value,
|
|
278
|
+
onKeydown: Ye,
|
|
279
|
+
placeholder: M.value.placeholder,
|
|
280
|
+
"aria-autocomplete": U.value ? "list" : void 0,
|
|
281
|
+
"aria-activedescendant": C.value ? K.activeDescendantId.value : void 0,
|
|
282
|
+
...P.value ? {
|
|
283
|
+
rows: 1,
|
|
284
|
+
onInput: (e) => {
|
|
285
|
+
Je(e), J(e.target);
|
|
286
|
+
}
|
|
287
|
+
} : { onInput: Je }
|
|
288
|
+
}, q.inputBind.value, l({
|
|
289
|
+
"cursor-text": t,
|
|
290
|
+
"cursor-pointer": e,
|
|
291
|
+
"resize-none overflow-hidden": P.value,
|
|
292
|
+
[l($e.value, N.value.value) ?? ""]: r
|
|
293
|
+
}));
|
|
294
|
+
});
|
|
295
|
+
c(() => [
|
|
296
|
+
C.value,
|
|
297
|
+
P.value,
|
|
298
|
+
v.value
|
|
299
|
+
], () => {
|
|
300
|
+
J(v.value);
|
|
301
|
+
}, { immediate: !0 }), c(() => _.value, () => {
|
|
302
|
+
Ze();
|
|
303
|
+
}, { immediate: !0 }), c(() => M.value.asyncData, (e) => {
|
|
304
|
+
if (k?.cancel(), O.value = [], Ze(), !e) {
|
|
305
|
+
k = null;
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
k = pe((e) => void Xe(e), he(e));
|
|
309
|
+
}, { immediate: !0 }), oe(() => {
|
|
310
|
+
k?.cancel();
|
|
311
|
+
}), se(() => {
|
|
312
|
+
J(v.value);
|
|
313
|
+
});
|
|
314
|
+
let tt = a(() => r(q.merged.value.size)), nt = a(() => n({}, {}, {
|
|
315
|
+
tabindex: 0,
|
|
316
|
+
role: "button",
|
|
317
|
+
"data-autocomplete-clear": !0,
|
|
318
|
+
onMousedown: ze,
|
|
319
|
+
class: l({
|
|
320
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
|
|
321
|
+
[Qe.value?.clear ?? ""]: !0,
|
|
322
|
+
[N.value.clear ?? ""]: !0
|
|
323
|
+
})
|
|
324
|
+
})), rt = a(() => ({
|
|
325
|
+
listboxId: x,
|
|
326
|
+
isSelected: Y,
|
|
327
|
+
disableAutoFocus: !0,
|
|
328
|
+
loading: Pe.value,
|
|
329
|
+
multiple: P.value,
|
|
330
|
+
maxHeight: g.maxHeight,
|
|
331
|
+
entries: Fe.value,
|
|
332
|
+
options: G.value,
|
|
333
|
+
size: q.merged.value.size,
|
|
334
|
+
color: q.merged.value.color,
|
|
335
|
+
labelledBy: q.controlId.value,
|
|
336
|
+
componentName: "Autocomplete",
|
|
337
|
+
rounded: q.merged.value.rounded,
|
|
338
|
+
invalidated: q.invalidated.value,
|
|
339
|
+
highlightedIndex: T.value,
|
|
340
|
+
disableMaxHeight: g.disableMaxHeight === !0,
|
|
341
|
+
hideEmptyMessage: M.value.hideEmptyMessage === !0,
|
|
342
|
+
emptyMessage: M.value.emptyMessage ?? S("No options"),
|
|
343
|
+
loadingMessage: M.value.loadingMessage ?? S("Loading..."),
|
|
344
|
+
...He.value
|
|
345
|
+
}));
|
|
346
|
+
function it(e) {
|
|
347
|
+
let t = L.value;
|
|
348
|
+
t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (L.value = e);
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
slots: b,
|
|
352
|
+
hasValue: Me,
|
|
353
|
+
multiple: P,
|
|
354
|
+
listboxId: x,
|
|
355
|
+
formField: q,
|
|
356
|
+
isLoading: Pe,
|
|
357
|
+
clearable: Ne,
|
|
358
|
+
clearBind: nt,
|
|
359
|
+
isSelected: Y,
|
|
360
|
+
clearValue: Ge,
|
|
361
|
+
removeChip: Ke,
|
|
362
|
+
triggerBind: et,
|
|
363
|
+
selectOption: Ue,
|
|
364
|
+
containerRef: E,
|
|
365
|
+
listboxProps: rt,
|
|
366
|
+
clearIconSize: tt,
|
|
367
|
+
mergedClasses: N,
|
|
368
|
+
visibleOptions: G,
|
|
369
|
+
isSearchActive: W,
|
|
370
|
+
open: a({
|
|
371
|
+
get: () => C.value,
|
|
372
|
+
set: (e) => {
|
|
373
|
+
e ? Q() : $({ commitFreeSolo: !0 });
|
|
374
|
+
}
|
|
375
|
+
}),
|
|
376
|
+
selectedOptions: V,
|
|
377
|
+
hasComposedList: R,
|
|
378
|
+
highlightedIndex: T,
|
|
379
|
+
handleRegisteredOptionsChange: it,
|
|
380
|
+
hideEmptyMessage: a(() => M.value.hideEmptyMessage === !0),
|
|
381
|
+
emptyMessage: a(() => M.value.emptyMessage ?? S("No options")),
|
|
382
|
+
loadingMessage: a(() => M.value.loadingMessage ?? S("Loading..."))
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
386
|
+
export { g as useAutocomplete };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AutocompleteClasses, AutocompleteEmits, SelectOption as AutocompleteOptionData, AutocompleteOptionProps, AutocompleteProps, AutocompleteSlots, SelectAsyncData, SelectModel, SelectValue, } from './autocomplete.types';
|
|
2
|
+
export { default as Autocomplete } from './Autocomplete.vue';
|
|
3
|
+
export { default as AutocompleteOption } from './AutocompleteOption.vue';
|
|
4
|
+
export { useAutocomplete } from './composables/useAutocomplete';
|
|
@@ -7,7 +7,7 @@ export declare function useAvatar(props: AvatarProps, libDefaults: AvatarLibDefa
|
|
|
7
7
|
[name: string]: import('vue').Slot<any> | undefined;
|
|
8
8
|
}>;
|
|
9
9
|
merged: import('vue').ComputedRef<AvatarMerged>;
|
|
10
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AvatarProps, "color" | "icon" | "size" | "classes" | "customProps" | "rounded" | "alt" | "
|
|
10
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AvatarProps, "color" | "icon" | "size" | "classes" | "customProps" | "rounded" | "alt" | "src" | "fallback">>>;
|
|
11
11
|
iconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
12
12
|
hasImage: import('vue').ComputedRef<boolean>;
|
|
13
13
|
imageBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').ImgHTMLAttributes | undefined, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
3
|
import { computed as i, useAttrs as a, useSlots as o } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as l } from "@bridge-ui/core";
|
|
5
|
+
import { get as u, isEmpty as d, isNil as f } from "es-toolkit/compat";
|
|
6
6
|
import { colorProps as p, iconSizeProps as m, roundedProps as h, sizeProps as g } from "@bridge-ui/core/Tokens/Avatar";
|
|
7
7
|
//#region src/Components/Avatar/composables/useAvatar.ts
|
|
8
8
|
var _ = [
|
|
@@ -17,7 +17,7 @@ var _ = [
|
|
|
17
17
|
"customProps"
|
|
18
18
|
];
|
|
19
19
|
function v(v, y) {
|
|
20
|
-
let b = a(), x = o(), S = i(() =>
|
|
20
|
+
let b = a(), x = o(), S = i(() => l({
|
|
21
21
|
bridgeKeys: _,
|
|
22
22
|
props: {
|
|
23
23
|
...b,
|
|
@@ -30,35 +30,35 @@ function v(v, y) {
|
|
|
30
30
|
}), T = r({
|
|
31
31
|
entry: w,
|
|
32
32
|
props: () => S.value.componentProps
|
|
33
|
-
}), E = i(() => e(x, "default")), D = i(() => !
|
|
33
|
+
}), E = i(() => e(x, "default")), D = i(() => !f(C.value.src) && !d(C.value.src)), O = i(() => e(x, "fallback")), k = i(() => !f(C.value.fallback) && !d(C.value.fallback)), A = i(() => C.value.icon ?? "user"), j = i(() => !D.value && !E.value), M = i(() => u(c(g, w.value?.tokens?.size), C.value.size)), N = i(() => u(c(p, w.value?.tokens?.color), C.value.color)), P = i(() => u(c(h, w.value?.tokens?.rounded), C.value.rounded)), F = i(() => u(c(m, w.value?.tokens?.iconSize), C.value.size)), I = i(() => C.value.customProps), L = i(() => t(I.value?.root, S.value.inheritedAttrs, s({
|
|
34
34
|
"inline-flex shrink-0 items-center justify-center overflow-hidden": !0,
|
|
35
35
|
[T.value.root ?? ""]: !0,
|
|
36
36
|
[P.value ?? ""]: !0,
|
|
37
37
|
[M.value ?? ""]: j.value || E.value || D.value,
|
|
38
|
-
[
|
|
39
|
-
[
|
|
38
|
+
[u(N.value, "background") ?? ""]: j.value,
|
|
39
|
+
[u(N.value, "text") ?? ""]: j.value
|
|
40
40
|
}))), R = i(() => t(I.value?.image, {
|
|
41
41
|
alt: C.value.alt,
|
|
42
42
|
src: C.value.src
|
|
43
|
-
},
|
|
43
|
+
}, s({
|
|
44
44
|
"shrink-0 object-cover object-center": !0,
|
|
45
45
|
[M.value ?? ""]: !0,
|
|
46
46
|
[P.value ?? ""]: !0,
|
|
47
47
|
[T.value.image ?? ""]: !0
|
|
48
|
-
}))), z = i(() => t(I.value?.fallback, {},
|
|
48
|
+
}))), z = i(() => t(I.value?.fallback, {}, s({
|
|
49
49
|
"font-medium": !0,
|
|
50
|
-
[
|
|
51
|
-
[
|
|
50
|
+
[u(F.value, "label") ?? ""]: !0,
|
|
51
|
+
[u(N.value, "text") ?? ""]: !0,
|
|
52
52
|
[T.value.fallback ?? ""]: !0
|
|
53
53
|
})));
|
|
54
54
|
return {
|
|
55
55
|
slots: x,
|
|
56
56
|
merged: C,
|
|
57
57
|
rootBind: L,
|
|
58
|
-
iconBind: i(() => t(I.value?.icon, {},
|
|
58
|
+
iconBind: i(() => t(I.value?.icon, {}, s({
|
|
59
59
|
"shrink-0": !0,
|
|
60
|
-
[
|
|
61
|
-
[
|
|
60
|
+
[u(F.value, "icon") ?? ""]: !0,
|
|
61
|
+
[u(N.value, "text") ?? ""]: !0
|
|
62
62
|
}))),
|
|
63
63
|
hasImage: D,
|
|
64
64
|
imageBind: R,
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { densityProps as l, roundedProps as u, variantProps as d } from "@bridge-ui/core/Tokens/Badge";
|
|
6
6
|
//#region src/Components/Badge/composables/useBadge.ts
|
|
7
7
|
var f = [
|
|
@@ -14,7 +14,7 @@ var f = [
|
|
|
14
14
|
"variant"
|
|
15
15
|
];
|
|
16
16
|
function p(p, m) {
|
|
17
|
-
let h = i(), g = r(() =>
|
|
17
|
+
let h = i(), g = r(() => s({
|
|
18
18
|
bridgeKeys: f,
|
|
19
19
|
props: {
|
|
20
20
|
...h,
|
|
@@ -27,18 +27,18 @@ function p(p, m) {
|
|
|
27
27
|
}), y = n({
|
|
28
28
|
entry: v,
|
|
29
29
|
props: () => g.value.componentProps
|
|
30
|
-
}), b = r(() => _.value.density === "mini"), x = r(() =>
|
|
30
|
+
}), b = r(() => _.value.density === "mini"), x = r(() => c(o(l, v.value?.tokens?.density), [_.value.density, _.value.size])), S = r(() => c(o(d, v.value?.tokens?.variant), [_.value.variant, _.value.color])), C = r(() => c(o(u, v.value?.tokens?.rounded), _.value.rounded));
|
|
31
31
|
return {
|
|
32
32
|
merged: _,
|
|
33
|
-
rootBind: r(() => e({}, g.value.inheritedAttrs,
|
|
33
|
+
rootBind: r(() => e({}, g.value.inheritedAttrs, a({
|
|
34
34
|
"inline-flex items-center justify-center font-medium whitespace-nowrap": !0,
|
|
35
35
|
"w-full": !b.value && _.value.full,
|
|
36
36
|
"w-fit": !b.value && !_.value.full,
|
|
37
37
|
[x.value ?? ""]: !0,
|
|
38
38
|
[C.value ?? ""]: !0,
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
39
|
+
[c(S.value, "background") ?? ""]: !0,
|
|
40
|
+
[c(S.value, "border") ?? ""]: !0,
|
|
41
|
+
[c(S.value, "text") ?? ""]: !0,
|
|
42
42
|
[y.value.root ?? ""]: !0
|
|
43
43
|
})))
|
|
44
44
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseFieldSlots } from './baseField.types';
|
|
2
|
+
import { UseBaseFieldReturn } from './composables/useBaseField';
|
|
3
|
+
type __VLS_Slots = BaseFieldSlots;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
field: UseBaseFieldReturn;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { hasNamedSlot as e, hasSlotOrProp as t, resolveNamedSlot as n, resolveSlotOrProp as r } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import i from "./BaseFieldLabel.js";
|
|
3
|
+
import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeProps as m, openBlock as h, renderSlot as g, resolveDynamicComponent as _, unref as v, useSlots as y } from "vue";
|
|
4
|
+
//#region src/Components/BaseField/BaseField.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var b = [
|
|
6
|
+
"data-invalid",
|
|
7
|
+
"aria-disabled",
|
|
8
|
+
"aria-readonly"
|
|
9
|
+
], x = ["id"], S = ["id", "aria-hidden"], C = /* @__PURE__ */ d({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "BaseField",
|
|
12
|
+
props: { field: {} },
|
|
13
|
+
setup(d) {
|
|
14
|
+
let C = d, w = y(), T = a(() => ({
|
|
15
|
+
...C.field,
|
|
16
|
+
slots: {
|
|
17
|
+
...C.field.slots,
|
|
18
|
+
...w
|
|
19
|
+
}
|
|
20
|
+
})), E = a(() => t(T.value.slots, "label", T.value.merged.value.label) || t(T.value.slots, "corner", T.value.merged.value.corner));
|
|
21
|
+
return (a, d) => (h(), c("div", p(T.value.rootBind.value, {
|
|
22
|
+
"data-invalid": T.value.invalidated.value || void 0,
|
|
23
|
+
"aria-disabled": T.value.isDisabled.value || void 0,
|
|
24
|
+
"aria-readonly": T.value.isReadonly.value || void 0
|
|
25
|
+
}), [
|
|
26
|
+
E.value ? (h(), c("div", m(p({ key: 0 }, T.value.headerBind.value)), [u(i, { api: T.value }, null, 8, ["api"]), v(t)(T.value.slots, "corner", T.value.merged.value.corner) ? (h(), c("span", m(p({ key: 0 }, T.value.cornerBind.value)), [(h(), o(_(v(r)(T.value.slots, "corner", T.value.merged.value.corner))))], 16)) : s("", !0)], 16)) : s("", !0),
|
|
27
|
+
l("div", m(f(T.value.groupBind.value)), [
|
|
28
|
+
v(e)(T.value.slots, "start") ? (h(), c("div", m(p({ key: 0 }, T.value.startSlotBind.value)), [(h(), o(_(v(n)(T.value.slots, "start"))))], 16)) : s("", !0),
|
|
29
|
+
g(a.$slots, "default"),
|
|
30
|
+
v(e)(T.value.slots, "end") ? (h(), c("div", m(p({ key: 1 }, T.value.endSlotBind.value)), [(h(), o(_(v(n)(T.value.slots, "end"))))], 16)) : s("", !0)
|
|
31
|
+
], 16),
|
|
32
|
+
!T.value.invalidated.value && v(t)(T.value.slots, "description", T.value.merged.value.description) ? (h(), c("p", p({ key: 1 }, T.value.descriptionBind.value, { id: `${T.value.controlId.value}-description` }), [(h(), o(_(v(r)(T.value.slots, "description", T.value.merged.value.description))))], 16, x)) : s("", !0),
|
|
33
|
+
T.value.merged.value.hideErrorMessage ? s("", !0) : (h(), c("p", p({ key: 2 }, T.value.errorBind.value, {
|
|
34
|
+
id: `${T.value.controlId.value}-error`,
|
|
35
|
+
"aria-hidden": T.value.showErrorMessageContent.value ? void 0 : !0
|
|
36
|
+
}), [T.value.showErrorMessageContent.value ? (h(), o(_(v(r)(T.value.slots, "errorMessage", T.value.merged.value.errorMessage)), { key: 0 })) : s("", !0)], 16, S))
|
|
37
|
+
], 16, b));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { C as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseBaseFieldReturn } from './composables/useBaseField';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
api: UseBaseFieldReturn;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { hasNamedSlot as e, hasSlotOrProp as t, isPropPresent as n, resolveNamedSlot as r } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import i from "../Label/Label.js";
|
|
3
|
+
import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, defineComponent as u, mergeProps as d, normalizeProps as f, openBlock as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
4
|
+
//#region src/Components/BaseField/BaseFieldLabel.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = /* @__PURE__ */ u({
|
|
6
|
+
__name: "BaseFieldLabel",
|
|
7
|
+
props: { api: {} },
|
|
8
|
+
setup(u) {
|
|
9
|
+
return (v, y) => g(t)(u.api.slots, "label", u.api.merged.value.label) ? (p(), o(g(i), f(d({ key: 0 }, u.api.fieldLabelProps.value)), {
|
|
10
|
+
default: _(() => [g(e)(u.api.slots, "label") ? (p(), o(m(g(r)(u.api.slots, "label")), { key: 0 })) : g(n)(u.api.merged.value.label) ? (p(), c(a, { key: 1 }, [l(h(u.api.merged.value.label), 1)], 64)) : s("", !0)]),
|
|
11
|
+
_: 1
|
|
12
|
+
}, 16)) : s("", !0);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { v as default };
|