@bridge-ui/vue 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/skills/bridge-ui-forms/SKILL.md +1 -1
- package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/Components/Alert/alert.types.d.ts +7 -4
- package/dist/Components/Alert/composables/useAlert.d.ts +1 -0
- package/dist/Components/Alert/composables/useAlert.js +60 -57
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +1 -1
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +4 -2
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/Components/BaseField/baseField.types.d.ts +15 -4
- package/dist/Components/BaseField/composables/useBaseField.d.ts +6 -2
- package/dist/Components/BaseField/composables/useBaseField.js +67 -67
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
- package/dist/Components/Button/composables/useButton.d.ts +3 -1
- package/dist/Components/Button/composables/useButton.js +46 -40
- package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -1
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +1 -1
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -1
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +1 -1
- package/dist/Components/ColorField/ColorField.vue.d.ts +1 -1
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ColorField/composables/useColorField.d.ts +5 -3
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateField/composables/useDateField.d.ts +5 -3
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +1 -1
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +5 -3
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +1 -1
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +5 -3
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +1 -1
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +5 -3
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -1
- package/dist/Components/FormControl/composables/useFormControl.js +39 -38
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/Components/FormField/composables/useFormField.d.ts +7 -3
- package/dist/Components/FormField/composables/useFormField.js +148 -144
- package/dist/Components/FormField/formField.types.d.ts +14 -4
- package/dist/Components/Listbox/Listbox.vue.d.ts +1 -1
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -2
- package/dist/Components/OtpField/OtpField.vue.d.ts +1 -8
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/Components/OtpField/composables/useOtpField.d.ts +3 -1
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -2
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Select/composables/useSelect.d.ts +4 -2
- package/dist/Components/Sidebar/composables/useSidebarList.js +1 -1
- package/dist/Components/Sidebar/composables/useSidebarShell.js +1 -1
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +4 -2
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/TextField/composables/useTextField.d.ts +4 -2
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -2
- package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/TimeField/composables/useTimeField.d.ts +5 -3
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +1 -1
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +1 -1
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +5 -3
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +1 -1
- package/dist/Components/Tooltip/composables/useTooltip.d.ts +1 -1
- package/dist/Utils/index.d.ts +11 -2
- package/dist/Utils/index.js +31 -27
- package/dist/augments.d.ts +8 -8
- package/docs/components/Alert.md +4 -2
- package/docs/components/BaseField.md +19 -18
- package/docs/components/BridgeUIProvider.md +14 -7
- package/docs/components/FormControl.md +1 -1
- package/docs/components/FormField.md +28 -27
- package/package.json +2 -2
|
@@ -45,4 +45,4 @@ Controlled fields: **`v-model` / `modelValue`**. Never React `value`/`onChange`.
|
|
|
45
45
|
1. Map validation to `error`, `error-message`, `description`, `disabled`, `readOnly`.
|
|
46
46
|
2. Native input attrs often go through `:custom-props` → `input` — see TextField docs.
|
|
47
47
|
3. Use only documented option shapes for Select/Autocomplete.
|
|
48
|
-
4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition
|
|
48
|
+
4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition. Theme shared chrome via `components.FormField` / `FormControl` / `BaseField` (a public entry such as `components.TextField` still overrides `defaultProps`). Chrome tokens live on those shared keys. Dropdown tokens live on `components.Listbox`. Time overlay chrome: `components.TimePanel` (`TimePicker` / `TimeRangePicker` override). Shared form density: `global.formDefaults: { size, rounded }` (Radio/Switch/BaseField/FormControl ignore `rounded`).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { hasNamedSlot as e,
|
|
2
|
-
import
|
|
3
|
-
import { useAlert as
|
|
4
|
-
import { Fragment as
|
|
1
|
+
import { hasNamedSlot as e, isPropPresent as t } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import n from "../Icon/Icon.js";
|
|
3
|
+
import { useAlert as r } from "./composables/useAlert.js";
|
|
4
|
+
import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, guardReactiveProps as d, mergeProps as f, normalizeProps as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _ } from "vue";
|
|
5
5
|
//#region src/Components/Alert/Alert.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var v = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "flex justify-between items-start"
|
|
9
|
-
},
|
|
9
|
+
}, y = { class: "flex items-start gap-x-3" }, b = /*@__PURE__*/ u({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "Alert",
|
|
12
12
|
props: {
|
|
@@ -20,20 +20,20 @@ var y = {
|
|
|
20
20
|
title: {},
|
|
21
21
|
variant: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
let { slots:
|
|
23
|
+
setup(u) {
|
|
24
|
+
let { slots: b, merged: x, bodyBind: S, iconBind: C, rootBind: w, hasTitle: T, titleBind: E, resolvedIcon: D, hasDefaultBody: O } = r(u, {
|
|
25
25
|
shadow: "sm",
|
|
26
26
|
rounded: "sm",
|
|
27
27
|
variant: "flat",
|
|
28
28
|
color: "primary",
|
|
29
29
|
padding: "medium"
|
|
30
30
|
});
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
return (r, u) => (m(), s("div", p(d(_(w))), [
|
|
32
|
+
_(e)(_(b), "header") ? h(r.$slots, "header", {}, void 0, void 0, 0) : _(T) ? (m(), s("div", v, [c("div", y, [_(e)(_(b), "icon") ? h(r.$slots, "icon", {}, void 0, void 0, 0) : _(D) ? (m(), a(n, f({ key: 1 }, _(C), { icon: _(D) }), null, 16, ["icon"])) : o("", !0), c("div", p(d(_(E))), [_(e)(_(b), "title") ? h(r.$slots, "title", {}, void 0, void 0, 0) : _(t)(_(x).title) ? (m(), s(i, { key: 1 }, [l(g(_(x).title), 1)], 64)) : h(r.$slots, "default", {}, void 0, void 0, 2)], 16)]), h(r.$slots, "action")])) : o("", !0),
|
|
33
|
+
_(O) ? (m(), s("div", p(f({ key: 2 }, _(S))), [h(r.$slots, "default")], 16)) : o("", !0),
|
|
34
|
+
h(r.$slots, "footer")
|
|
35
35
|
], 16));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
//#endregion
|
|
39
|
-
export {
|
|
39
|
+
export { b as default };
|
|
@@ -76,7 +76,7 @@ export interface AlertOwnProps {
|
|
|
76
76
|
*/
|
|
77
77
|
icon?: null | IconSource;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Root padding scale. Each token also sets body indent under the title row.
|
|
80
80
|
*
|
|
81
81
|
* @default "medium"
|
|
82
82
|
*/
|
|
@@ -94,7 +94,8 @@ export interface AlertOwnProps {
|
|
|
94
94
|
*/
|
|
95
95
|
shadow?: MergeProps<AlertShadow, AlertShadowOverrides>;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* Title in the heading row. When omitted, the default slot is used as the
|
|
98
|
+
* title.
|
|
98
99
|
*
|
|
99
100
|
* @default undefined
|
|
100
101
|
*/
|
|
@@ -112,7 +113,8 @@ export interface AlertSlots {
|
|
|
112
113
|
*/
|
|
113
114
|
action?: Slot<undefined>;
|
|
114
115
|
/**
|
|
115
|
-
*
|
|
116
|
+
* Body below the title row. Used as the title when `title` and the `title`
|
|
117
|
+
* slot are omitted.
|
|
116
118
|
*/
|
|
117
119
|
default?: Slot<undefined>;
|
|
118
120
|
/**
|
|
@@ -128,7 +130,8 @@ export interface AlertSlots {
|
|
|
128
130
|
*/
|
|
129
131
|
icon?: Slot<undefined>;
|
|
130
132
|
/**
|
|
131
|
-
*
|
|
133
|
+
* Title in the heading row. Takes precedence over the `title` prop and the
|
|
134
|
+
* default slot.
|
|
132
135
|
*/
|
|
133
136
|
title?: Slot<undefined>;
|
|
134
137
|
}
|
|
@@ -11,6 +11,7 @@ export declare function useAlert(props: AlertOwnProps, libDefaults: AlertLibDefa
|
|
|
11
11
|
bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
12
12
|
iconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
13
13
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AlertProps, "color" | "icon" | "classes" | "customProps" | "title" | "padding" | "rounded" | "shadow" | "variant">>>;
|
|
14
|
+
hasTitle: import('vue').ComputedRef<boolean>;
|
|
14
15
|
titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
15
16
|
resolvedIcon: import('vue').ComputedRef<IconSource | null>;
|
|
16
17
|
hasDefaultBody: import('vue').ComputedRef<boolean>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { hasNamedSlot as e, hasSlotOrProp as t } from "../../../Utils/slotOrProp.js";
|
|
2
|
+
import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
3
|
+
import { alertDefaultIcons as a } from "../alertDefaultIcons.js";
|
|
4
|
+
import { computed as o, useAttrs as s, useSlots as c } from "vue";
|
|
5
|
+
import { get as l, isNull as u } from "es-toolkit/compat";
|
|
6
|
+
import { alertPaddingProps as d, alertRoundedProps as f, alertShadowProps as p, alertVariantProps as m } from "@bridge-ui/core/Tokens";
|
|
7
|
+
import { cn as h, mergeBridgeUILayeredClasses as g, splitComponentProps as _ } from "@bridge-ui/core/Utils";
|
|
7
8
|
//#region src/Components/Alert/composables/useAlert.ts
|
|
8
|
-
var
|
|
9
|
+
var v = [
|
|
9
10
|
"icon",
|
|
10
11
|
"color",
|
|
11
12
|
"title",
|
|
@@ -16,68 +17,70 @@ var g = [
|
|
|
16
17
|
"variant",
|
|
17
18
|
"customProps"
|
|
18
19
|
];
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
bridgeKeys:
|
|
20
|
+
function y(y, b) {
|
|
21
|
+
let x = s(), S = c(), C = o(() => _({
|
|
22
|
+
bridgeKeys: v,
|
|
22
23
|
props: {
|
|
23
|
-
...
|
|
24
|
-
...
|
|
24
|
+
...x,
|
|
25
|
+
...y
|
|
25
26
|
}
|
|
26
|
-
})), { merged:
|
|
27
|
-
libDefaults:
|
|
27
|
+
})), { merged: w, entry: T } = r({
|
|
28
|
+
libDefaults: b,
|
|
28
29
|
componentName: "Alert",
|
|
29
|
-
props: () =>
|
|
30
|
-
}),
|
|
31
|
-
entry:
|
|
32
|
-
props: () =>
|
|
33
|
-
}),
|
|
34
|
-
let e =
|
|
30
|
+
props: () => C.value.componentProps
|
|
31
|
+
}), E = o(() => w.value.customProps), D = i({
|
|
32
|
+
entry: T,
|
|
33
|
+
props: () => C.value.componentProps
|
|
34
|
+
}), O = o(() => t(S, "title", w.value.title)), k = o(() => {
|
|
35
|
+
let e = S.default?.();
|
|
35
36
|
return !!(e && e.length > 0);
|
|
36
|
-
}),
|
|
37
|
-
let e = m
|
|
38
|
-
return
|
|
39
|
-
}),
|
|
40
|
-
let e =
|
|
41
|
-
return
|
|
42
|
-
}),
|
|
43
|
-
let e =
|
|
44
|
-
return
|
|
45
|
-
}),
|
|
46
|
-
let e =
|
|
47
|
-
return
|
|
48
|
-
}),
|
|
37
|
+
}), A = o(() => !e(S, "header") && (k.value || O.value)), j = o(() => k.value && (O.value || e(S, "header"))), M = o(() => {
|
|
38
|
+
let e = g(m, T.value?.tokens?.variant);
|
|
39
|
+
return l(e, [w.value.variant, w.value.color]);
|
|
40
|
+
}), N = o(() => {
|
|
41
|
+
let e = g(p, T.value?.tokens?.shadow);
|
|
42
|
+
return l(e, w.value.shadow);
|
|
43
|
+
}), P = o(() => {
|
|
44
|
+
let e = g(d, T.value?.tokens?.padding);
|
|
45
|
+
return l(e, w.value.padding);
|
|
46
|
+
}), F = o(() => {
|
|
47
|
+
let e = g(f, T.value?.tokens?.rounded);
|
|
48
|
+
return l(e, w.value.rounded);
|
|
49
|
+
}), I = o(() => u(w.value.icon) ? null : w.value.icon ? w.value.icon : l(M.value, "icon") ?? l(a, w.value.color));
|
|
49
50
|
return {
|
|
50
|
-
slots:
|
|
51
|
-
merged:
|
|
52
|
-
bodyBind:
|
|
51
|
+
slots: S,
|
|
52
|
+
merged: w,
|
|
53
|
+
bodyBind: o(() => n(E.value?.body, {}, h({
|
|
53
54
|
"grow text-sm text-start": !0,
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
55
|
+
[l(P.value, "body") ?? ""]: !0,
|
|
56
|
+
[l(M.value, "text") ?? ""]: !0,
|
|
57
|
+
[l(D.value, "body") ?? ""]: !0
|
|
57
58
|
}))),
|
|
58
|
-
iconBind:
|
|
59
|
+
iconBind: o(() => n(E.value?.icon, {}, h({
|
|
59
60
|
"w-5 h-5 shrink-0": !0,
|
|
60
|
-
[
|
|
61
|
-
[
|
|
61
|
+
[l(M.value, "iconColor") ?? ""]: !0,
|
|
62
|
+
[l(D.value, "icon") ?? ""]: !0
|
|
62
63
|
}))),
|
|
63
|
-
rootBind:
|
|
64
|
-
"w-full flex flex-col
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
64
|
+
rootBind: o(() => n(E.value?.root, C.value.inheritedAttrs, h({
|
|
65
|
+
"w-full flex flex-col": !0,
|
|
66
|
+
[l(P.value, "root") ?? ""]: !0,
|
|
67
|
+
[N.value ?? ""]: !0,
|
|
68
|
+
[F.value ?? ""]: !0,
|
|
69
|
+
[l(M.value, "border") ?? ""]: !0,
|
|
70
|
+
[l(M.value, "background") ?? ""]: !0,
|
|
71
|
+
[l(D.value, "root") ?? ""]: !0
|
|
70
72
|
}))),
|
|
71
|
-
|
|
73
|
+
hasTitle: A,
|
|
74
|
+
titleBind: o(() => n(E.value?.title, {}, h({
|
|
72
75
|
"text-start text-sm whitespace-normal": !0,
|
|
73
|
-
"font-normal": !
|
|
74
|
-
"font-semibold":
|
|
75
|
-
[
|
|
76
|
-
[
|
|
76
|
+
"font-normal": !j.value,
|
|
77
|
+
"font-semibold": j.value,
|
|
78
|
+
[l(M.value, "text") ?? ""]: !0,
|
|
79
|
+
[l(D.value, "title") ?? ""]: !0
|
|
77
80
|
}))),
|
|
78
|
-
resolvedIcon:
|
|
79
|
-
hasDefaultBody:
|
|
81
|
+
resolvedIcon: I,
|
|
82
|
+
hasDefaultBody: j
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
85
|
//#endregion
|
|
83
|
-
export {
|
|
86
|
+
export { y as useAlert };
|
|
@@ -31,9 +31,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
31
31
|
showFooter: boolean;
|
|
32
32
|
showErrorIcon: boolean;
|
|
33
33
|
clearable: boolean;
|
|
34
|
-
freeSolo: boolean;
|
|
35
34
|
minItemsForSearch: number;
|
|
36
35
|
searchable: boolean;
|
|
36
|
+
freeSolo: boolean;
|
|
37
37
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -436,7 +436,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
436
436
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
437
437
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
438
438
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
439
|
-
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
|
|
439
|
+
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>;
|
|
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, {}>>;
|
|
@@ -461,6 +461,8 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
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", {}, {}>>;
|
|
464
|
+
showErrorMessageRow: import('vue').ComputedRef<boolean>;
|
|
465
|
+
showDescriptionContent: import('vue').ComputedRef<boolean>;
|
|
464
466
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
465
467
|
reservesErrorMessageSpace: import('vue').ComputedRef<boolean>;
|
|
466
468
|
};
|
|
@@ -720,7 +722,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
720
722
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
721
723
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
722
724
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
723
|
-
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>>;
|
|
725
|
+
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>>;
|
|
724
726
|
handleApply: () => void;
|
|
725
727
|
selectOption: (option: SelectOption) => void;
|
|
726
728
|
handleCancel: () => void;
|
|
@@ -19,30 +19,30 @@ var C = [
|
|
|
19
19
|
...D
|
|
20
20
|
}
|
|
21
21
|
})), k = o(() => t(D, "label", O.value.merged.value.label) || t(D, "corner", O.value.merged.value.corner));
|
|
22
|
-
return (
|
|
22
|
+
return (t, o) => (_(), c("div", h(O.value.rootBind.value, {
|
|
23
23
|
"data-invalid": O.value.invalidated.value || void 0,
|
|
24
24
|
"aria-disabled": O.value.isDisabled.value || void 0,
|
|
25
25
|
"aria-readonly": O.value.isReadonly.value || void 0
|
|
26
26
|
}), [
|
|
27
27
|
k.value ? (_(), c("div", g(h({ key: 0 }, O.value.headerBind.value)), [f(i, { api: O.value }, u({ _: 2 }, [b(e)(b(D), "label") ? {
|
|
28
28
|
name: "label",
|
|
29
|
-
fn: S(() => [v(
|
|
29
|
+
fn: S(() => [v(t.$slots, "label")]),
|
|
30
30
|
key: "0"
|
|
31
31
|
} : void 0]), 1032, ["api"]), f(r, { api: O.value }, u({ _: 2 }, [b(e)(b(D), "corner") ? {
|
|
32
32
|
name: "corner",
|
|
33
|
-
fn: S(() => [v(
|
|
33
|
+
fn: S(() => [v(t.$slots, "corner")]),
|
|
34
34
|
key: "0"
|
|
35
35
|
} : void 0]), 1032, ["api"])], 16)) : s("", !0),
|
|
36
36
|
l("div", g(m(O.value.groupBind.value)), [
|
|
37
|
-
b(e)(b(D), "start") ? (_(), c("div", g(h({ key: 0 }, O.value.startSlotBind.value)), [v(
|
|
38
|
-
v(
|
|
39
|
-
b(e)(b(D), "end") ? (_(), c("div", g(h({ key: 1 }, O.value.endSlotBind.value)), [v(
|
|
37
|
+
b(e)(b(D), "start") ? (_(), c("div", g(h({ key: 0 }, O.value.startSlotBind.value)), [v(t.$slots, "start")], 16)) : s("", !0),
|
|
38
|
+
v(t.$slots, "default"),
|
|
39
|
+
b(e)(b(D), "end") ? (_(), c("div", g(h({ key: 1 }, O.value.endSlotBind.value)), [v(t.$slots, "end")], 16)) : s("", !0)
|
|
40
40
|
], 16),
|
|
41
|
-
|
|
42
|
-
O.value.
|
|
41
|
+
O.value.showDescriptionContent.value ? (_(), c("p", h({ key: 1 }, O.value.descriptionBind.value, { id: `${O.value.controlId.value}-description` }), [b(e)(b(D), "description") ? v(t.$slots, "description", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.description) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.description), 1)], 64)) : s("", !0)], 16, w)) : s("", !0),
|
|
42
|
+
O.value.showErrorMessageRow.value ? (_(), c("p", h({ key: 2 }, O.value.errorBind.value, {
|
|
43
43
|
id: `${O.value.controlId.value}-error`,
|
|
44
44
|
"aria-hidden": !O.value.showErrorMessageContent.value || void 0
|
|
45
|
-
}), [O.value.showErrorMessageContent.value ? (_(), c(a, { key: 0 }, [b(e)(b(D), "errorMessage") ? v(
|
|
45
|
+
}), [O.value.showErrorMessageContent.value ? (_(), c(a, { key: 0 }, [b(e)(b(D), "errorMessage") ? v(t.$slots, "errorMessage", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.errorMessage) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.errorMessage), 1)], 64)) : s("", !0)], 64)) : s("", !0)], 16, T)) : s("", !0)
|
|
46
46
|
], 16, C));
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -115,7 +115,8 @@ export interface BaseFieldOwnProps {
|
|
|
115
115
|
*/
|
|
116
116
|
customProps?: BaseFieldCustomProps;
|
|
117
117
|
/**
|
|
118
|
-
* Helper text below the control group
|
|
118
|
+
* Helper text below the control group. Hidden when `error` is true and an
|
|
119
|
+
* error message is shown, unless `showDescriptionOnError` is true.
|
|
119
120
|
*
|
|
120
121
|
* @default undefined
|
|
121
122
|
*/
|
|
@@ -127,7 +128,9 @@ export interface BaseFieldOwnProps {
|
|
|
127
128
|
*/
|
|
128
129
|
disabled?: boolean;
|
|
129
130
|
/**
|
|
130
|
-
* When `true`, applies invalid styling on the label and control group.
|
|
131
|
+
* When `true`, applies invalid styling on the label and control group. Hides
|
|
132
|
+
* description when an error message is shown, unless `showDescriptionOnError`
|
|
133
|
+
* is true.
|
|
131
134
|
*
|
|
132
135
|
* @default false
|
|
133
136
|
*/
|
|
@@ -148,7 +151,8 @@ export interface BaseFieldOwnProps {
|
|
|
148
151
|
*/
|
|
149
152
|
field?: UseBaseFieldReturn;
|
|
150
153
|
/**
|
|
151
|
-
* When `true`, does not reserve
|
|
154
|
+
* When `true`, does not reserve the error row. That row is also omitted
|
|
155
|
+
* while a description is shown.
|
|
152
156
|
*
|
|
153
157
|
* @default false
|
|
154
158
|
*/
|
|
@@ -171,6 +175,12 @@ export interface BaseFieldOwnProps {
|
|
|
171
175
|
* @default false
|
|
172
176
|
*/
|
|
173
177
|
required?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* When `true`, keeps the description visible while the field is invalid.
|
|
180
|
+
*
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
showDescriptionOnError?: boolean;
|
|
174
184
|
/**
|
|
175
185
|
* Label typography and control group gap scale.
|
|
176
186
|
*
|
|
@@ -195,7 +205,8 @@ export interface BaseFieldSlots {
|
|
|
195
205
|
*/
|
|
196
206
|
default?: Slot<undefined>;
|
|
197
207
|
/**
|
|
198
|
-
* Helper text below the control group.
|
|
208
|
+
* Helper text below the control group. Hidden when the field is invalid and
|
|
209
|
+
* an error message is shown, unless `showDescriptionOnError` is true.
|
|
199
210
|
*/
|
|
200
211
|
description?: Slot;
|
|
201
212
|
/**
|
|
@@ -5,14 +5,16 @@ import { LabelProps } from '../../Label/label.types';
|
|
|
5
5
|
export type BaseFieldOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* Public registry key that owns BaseField chrome defaults/tokens.
|
|
8
|
+
* Defaults to `BaseField`; Slider / OtpField pass their own key so chrome
|
|
9
|
+
* cascades (`BaseField` → parent).
|
|
8
10
|
*/
|
|
9
|
-
componentName?: "Slider" | "OtpField";
|
|
11
|
+
componentName?: "Slider" | "OtpField" | "BaseField";
|
|
10
12
|
/**
|
|
11
13
|
* Resolve `Label` `for` from `controlId`. Defaults to the control id itself.
|
|
12
14
|
*/
|
|
13
15
|
labelHtmlFor?: (controlId: string) => string;
|
|
14
16
|
};
|
|
15
|
-
export declare const baseFieldBridgeKeys: readonly ["size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage"];
|
|
17
|
+
export declare const baseFieldBridgeKeys: readonly ["size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage", "showDescriptionOnError"];
|
|
16
18
|
type BaseFieldLibDefaults = LibDefaultsShape<Omit<BaseFieldOwnProps, "field">, "size" | "error" | "hideErrorMessage">;
|
|
17
19
|
type BaseFieldMerged = MergeLibDefaults<Omit<BaseFieldOwnProps, "field">, BaseFieldLibDefaults>;
|
|
18
20
|
/**
|
|
@@ -49,6 +51,8 @@ export declare function useBaseField(props: MaybeRefOrGetter<Omit<BaseFieldOwnPr
|
|
|
49
51
|
fieldLabelProps: import('vue').ComputedRef<LabelProps>;
|
|
50
52
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
51
53
|
fieldCornerProps: import('vue').ComputedRef<LabelProps>;
|
|
54
|
+
showErrorMessageRow: import('vue').ComputedRef<boolean>;
|
|
55
|
+
showDescriptionContent: import('vue').ComputedRef<boolean>;
|
|
52
56
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
53
57
|
};
|
|
54
58
|
export type UseBaseFieldReturn = ReturnType<typeof useBaseField>;
|
|
@@ -18,7 +18,8 @@ var g = [
|
|
|
18
18
|
"customProps",
|
|
19
19
|
"description",
|
|
20
20
|
"errorMessage",
|
|
21
|
-
"hideErrorMessage"
|
|
21
|
+
"hideErrorMessage",
|
|
22
|
+
"showDescriptionOnError"
|
|
22
23
|
];
|
|
23
24
|
function _(_, v = {
|
|
24
25
|
size: "md",
|
|
@@ -31,102 +32,101 @@ function _(_, v = {
|
|
|
31
32
|
...b,
|
|
32
33
|
...o(_)
|
|
33
34
|
}
|
|
34
|
-
})), { merged:
|
|
35
|
+
})), w = y.componentName ?? "BaseField", { merged: T, entry: E, chromeEntry: D } = r({
|
|
35
36
|
libDefaults: v,
|
|
36
|
-
componentName:
|
|
37
|
+
componentName: w,
|
|
37
38
|
props: () => C.value.componentProps
|
|
38
|
-
}),
|
|
39
|
-
entry:
|
|
39
|
+
}), O = i({
|
|
40
|
+
entry: E,
|
|
41
|
+
chromeEntry: D,
|
|
40
42
|
props: () => C.value.componentProps
|
|
41
|
-
}),
|
|
42
|
-
let e = m(f, u(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}), N = a(() => !w.value.hideErrorMessage), P = a(() => O.value && e(x, "errorMessage", w.value.errorMessage)), F = a(() => {
|
|
49
|
-
let t = [];
|
|
50
|
-
return !O.value && e(x, "description", w.value.description) && t.push(`${j.value}-description`), O.value && !w.value.hideErrorMessage && e(x, "errorMessage", w.value.errorMessage) && t.push(`${j.value}-error`), t.length > 0 ? t.join(" ") : void 0;
|
|
51
|
-
}), I = a(() => n(D.value?.root, {
|
|
43
|
+
}), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? S), P = a(() => {
|
|
44
|
+
let e = w !== "BaseField", t = m(f, u(D.value, ["tokens", "size"]), e ? void 0 : u(E.value, ["tokens", "size"]));
|
|
45
|
+
return u(t, T.value.size ?? "md");
|
|
46
|
+
}), F = a(() => !T.value.hideErrorMessage && !e(x, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(x, "errorMessage", T.value.errorMessage)), L = a(() => e(x, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
|
|
47
|
+
let e = [];
|
|
48
|
+
return L.value && e.push(`${N.value}-description`), I.value && e.push(`${N.value}-error`), e.length > 0 ? e.join(" ") : void 0;
|
|
49
|
+
}), B = a(() => n(k.value?.root, {
|
|
52
50
|
class: p(C.value.inheritedAttrs.class),
|
|
53
51
|
...d(C.value.inheritedAttrs, ["class", "id"])
|
|
54
52
|
}, p({
|
|
55
53
|
"group w-full relative": !0,
|
|
56
54
|
"aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60": !0,
|
|
57
55
|
"aria-readonly:pointer-events-none aria-readonly:select-none": !0,
|
|
58
|
-
[
|
|
59
|
-
}))),
|
|
56
|
+
[O.value.root ?? ""]: !0
|
|
57
|
+
}))), V = a(() => n(k.value?.header, {}, p({
|
|
60
58
|
"flex w-full gap-x-2 mb-1.5": !0,
|
|
61
|
-
"justify-between items-end": e(x, "label",
|
|
62
|
-
"justify-end": !e(x, "label",
|
|
63
|
-
[
|
|
64
|
-
}))),
|
|
59
|
+
"justify-between items-end": e(x, "label", T.value.label),
|
|
60
|
+
"justify-end": !e(x, "label", T.value.label),
|
|
61
|
+
[O.value.header ?? ""]: !0
|
|
62
|
+
}))), H = a(() => {
|
|
65
63
|
let e = y.labelHtmlFor ?? ((e) => e);
|
|
66
|
-
return t(
|
|
67
|
-
size:
|
|
68
|
-
for: e(
|
|
69
|
-
classes: { root: p({ [
|
|
64
|
+
return t(k.value?.corner, {
|
|
65
|
+
size: T.value.size,
|
|
66
|
+
for: e(N.value),
|
|
67
|
+
classes: { root: p({ [O.value.corner ?? ""]: !0 }) }
|
|
70
68
|
});
|
|
71
|
-
}),
|
|
69
|
+
}), U = a(() => n(k.value?.group, {
|
|
72
70
|
role: "group",
|
|
73
|
-
id:
|
|
74
|
-
"aria-describedby":
|
|
75
|
-
"aria-disabled":
|
|
76
|
-
"aria-invalid":
|
|
71
|
+
id: N.value,
|
|
72
|
+
"aria-describedby": z.value,
|
|
73
|
+
"aria-disabled": j.value || void 0,
|
|
74
|
+
"aria-invalid": A.value || void 0
|
|
77
75
|
}, p({
|
|
78
76
|
"flex flex-wrap items-center": !0,
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
}))),
|
|
77
|
+
[P.value?.group ?? ""]: !0,
|
|
78
|
+
[O.value.group ?? ""]: !0
|
|
79
|
+
}))), W = a(() => n(k.value?.start, {}, p({
|
|
82
80
|
"group/start wrapper-start-slot shrink-0 flex items-center [&>*]:min-h-0": !0,
|
|
83
|
-
[
|
|
84
|
-
}))),
|
|
81
|
+
[O.value.start ?? ""]: !0
|
|
82
|
+
}))), G = a(() => n(k.value?.end, {}, p({
|
|
85
83
|
"group/end wrapper-end-slot shrink-0 flex items-center [&>*]:min-h-0": !0,
|
|
86
|
-
[
|
|
87
|
-
}))),
|
|
84
|
+
[O.value.end ?? ""]: !0
|
|
85
|
+
}))), K = a(() => n(k.value?.description, {}, p({
|
|
88
86
|
"mt-1 px-1 text-dark-500 dark:text-dark-400": !0,
|
|
89
|
-
[
|
|
90
|
-
[
|
|
87
|
+
[P.value?.text ?? ""]: !0,
|
|
88
|
+
[O.value.description ?? ""]: !0
|
|
91
89
|
})));
|
|
92
90
|
return {
|
|
93
91
|
slots: x,
|
|
94
|
-
merged:
|
|
95
|
-
rootBind:
|
|
96
|
-
errorBind: a(() => n(
|
|
92
|
+
merged: T,
|
|
93
|
+
rootBind: B,
|
|
94
|
+
errorBind: a(() => n(k.value?.errorMessage, {}, p({
|
|
97
95
|
"mt-1 px-1": !0,
|
|
98
|
-
"min-h-[1lh]":
|
|
96
|
+
"min-h-[1lh]": F.value,
|
|
99
97
|
"text-error-600 dark:text-error-400": !0,
|
|
100
|
-
[
|
|
101
|
-
[
|
|
98
|
+
[P.value?.text ?? ""]: !0,
|
|
99
|
+
[O.value.errorMessage ?? ""]: !0
|
|
102
100
|
}))),
|
|
103
|
-
groupBind:
|
|
104
|
-
controlId:
|
|
105
|
-
headerBind:
|
|
106
|
-
isDisabled:
|
|
107
|
-
isReadonly:
|
|
108
|
-
sizeClasses:
|
|
109
|
-
endSlotBind:
|
|
110
|
-
invalidated:
|
|
111
|
-
startSlotBind:
|
|
112
|
-
mergedClasses:
|
|
113
|
-
ariaDescribedBy:
|
|
101
|
+
groupBind: U,
|
|
102
|
+
controlId: N,
|
|
103
|
+
headerBind: V,
|
|
104
|
+
isDisabled: j,
|
|
105
|
+
isReadonly: M,
|
|
106
|
+
sizeClasses: P,
|
|
107
|
+
endSlotBind: G,
|
|
108
|
+
invalidated: A,
|
|
109
|
+
startSlotBind: W,
|
|
110
|
+
mergedClasses: O,
|
|
111
|
+
ariaDescribedBy: z,
|
|
114
112
|
fieldLabelProps: a(() => {
|
|
115
113
|
let e = y.labelHtmlFor ?? ((e) => e);
|
|
116
|
-
return t(
|
|
117
|
-
size:
|
|
118
|
-
error:
|
|
119
|
-
required:
|
|
120
|
-
for: e(
|
|
114
|
+
return t(k.value?.label, {
|
|
115
|
+
size: T.value.size,
|
|
116
|
+
error: A.value,
|
|
117
|
+
required: T.value.required,
|
|
118
|
+
for: e(N.value),
|
|
121
119
|
classes: {
|
|
122
|
-
required:
|
|
123
|
-
root: p({ [
|
|
120
|
+
required: O.value.required,
|
|
121
|
+
root: p({ [O.value.label ?? ""]: !0 })
|
|
124
122
|
}
|
|
125
123
|
});
|
|
126
124
|
}),
|
|
127
|
-
descriptionBind:
|
|
128
|
-
fieldCornerProps:
|
|
129
|
-
|
|
125
|
+
descriptionBind: K,
|
|
126
|
+
fieldCornerProps: H,
|
|
127
|
+
showErrorMessageRow: R,
|
|
128
|
+
showDescriptionContent: L,
|
|
129
|
+
showErrorMessageContent: I
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|