@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { hasNamedSlot as e, hasSlotOrProp as t } from "../../../Utils/slotOrProp.js";
|
|
2
|
-
import { mergeNestedComponentProps as n, mergePartBind as r, useBridgeUIComponent as
|
|
3
|
-
import { computed as
|
|
4
|
-
import { get as
|
|
5
|
-
import { formFieldColorProps as
|
|
6
|
-
import { cn as
|
|
2
|
+
import { mergeNestedComponentProps as n, mergePartBind as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
3
|
+
import { computed as a, toValue as o, useId as s, useSlots as c } from "vue";
|
|
4
|
+
import { get as l, omit as u } from "es-toolkit/compat";
|
|
5
|
+
import { formFieldColorProps as d, formFieldRoundedProps as f, formFieldSizeProps as p, formFieldVariantProps as m } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as h, getColorToken as g, mergeBridgeUILayeredClasses as _, splitComponentProps as v } from "@bridge-ui/core/Utils";
|
|
7
7
|
//#region src/Components/FormField/composables/useFormField.ts
|
|
8
|
-
var
|
|
8
|
+
var y = [
|
|
9
9
|
"end",
|
|
10
10
|
"size",
|
|
11
11
|
"color",
|
|
@@ -26,216 +26,220 @@ var b = [
|
|
|
26
26
|
"description",
|
|
27
27
|
"errorMessage",
|
|
28
28
|
"showErrorIcon",
|
|
29
|
-
"hideErrorMessage"
|
|
29
|
+
"hideErrorMessage",
|
|
30
|
+
"showDescriptionOnError"
|
|
30
31
|
];
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
props:
|
|
34
|
-
bridgeKeys:
|
|
35
|
-
})), { merged: E, entry: D } =
|
|
36
|
-
libDefaults:
|
|
37
|
-
componentName:
|
|
38
|
-
props: () =>
|
|
39
|
-
}),
|
|
32
|
+
function b(b, x, S = {}) {
|
|
33
|
+
let te = s(), C = c(), w = a(() => v({
|
|
34
|
+
props: o(b),
|
|
35
|
+
bridgeKeys: y
|
|
36
|
+
})), T = S.componentName ?? "FormField", { merged: E, entry: D, chromeEntry: O } = ee({
|
|
37
|
+
libDefaults: x,
|
|
38
|
+
componentName: T,
|
|
39
|
+
props: () => w.value.componentProps
|
|
40
|
+
}), k = a(() => E.value.customProps), A = a(() => S.control?.() ?? "input"), j = i({
|
|
40
41
|
entry: D,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
chromeEntry: O,
|
|
43
|
+
props: () => w.value.componentProps
|
|
44
|
+
}), M = a(() => E.value.error === !0), N = a(() => !!E.value.disabled), P = a(() => !!E.value.readonly), F = a(() => E.value.variant ?? "outline"), ne = a(() => E.value.errorIcon ?? "alert"), I = a(() => F.value === "notched"), L = a(() => F.value === "stacked"), R = a(() => F.value === "underlined"), z = a(() => A.value === "textarea"), B = a(() => z.value && !!S.likeInput?.()), V = a(() => !E.value.hideErrorMessage && !t(C, "description", E.value.description)), H = a(() => {
|
|
45
|
+
let e = w.value.inheritedAttrs.id;
|
|
46
|
+
return E.value.controlId ?? e ?? te;
|
|
47
|
+
}), U = a(() => M.value && !E.value.hideErrorMessage && t(C, "errorMessage", E.value.errorMessage)), W = a(() => t(C, "description", E.value.description) ? !U.value || E.value.showDescriptionOnError === !0 : !1), G = a(() => U.value || V.value), K = a(() => (I.value || L.value) && (t(C, "label", E.value.label) || t(C, "corner", E.value.corner))), q = a(() => t(C, "label", E.value.label) ? "justify-between items-end" : "justify-end"), J = a(() => {
|
|
46
48
|
let e = [];
|
|
47
|
-
return
|
|
48
|
-
}),
|
|
49
|
-
let e =
|
|
50
|
-
return
|
|
51
|
-
}),
|
|
52
|
-
let e =
|
|
53
|
-
return
|
|
49
|
+
return W.value && e.push(`${H.value}-description`), U.value && e.push(`${H.value}-error`), e.length > 0 ? e.join(" ") : void 0;
|
|
50
|
+
}), Y = a(() => {
|
|
51
|
+
let e = _(p, l(O.value ?? D.value, ["tokens", "size"]));
|
|
52
|
+
return l(e, [E.value.size, F.value]);
|
|
53
|
+
}), X = a(() => {
|
|
54
|
+
let e = _(d, l(O.value ?? D.value, ["tokens", "color"]));
|
|
55
|
+
return g({
|
|
54
56
|
tokens: e,
|
|
55
57
|
color: E.value.color,
|
|
56
|
-
invalid:
|
|
58
|
+
invalid: M.value
|
|
57
59
|
});
|
|
58
|
-
}),
|
|
59
|
-
let e =
|
|
60
|
-
return
|
|
61
|
-
}),
|
|
62
|
-
let e =
|
|
63
|
-
return
|
|
64
|
-
}),
|
|
65
|
-
if (L.value) return
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
60
|
+
}), Z = a(() => {
|
|
61
|
+
let e = _(f, l(O.value ?? D.value, ["tokens", "rounded"]));
|
|
62
|
+
return l(e, E.value.rounded);
|
|
63
|
+
}), Q = a(() => {
|
|
64
|
+
let e = _(m, l(O.value ?? D.value, ["tokens", "variant"]));
|
|
65
|
+
return l(e, F.value);
|
|
66
|
+
}), re = a(() => R.value ? X.value?.underlined : X.value?.input), ie = a(() => {
|
|
67
|
+
if (L.value) return h({
|
|
68
|
+
[Y.value?.insetTop ?? ""]: !0,
|
|
69
|
+
[Y.value?.insetStart ?? ""]: !0,
|
|
70
|
+
[Y.value?.insetEnd ?? ""]: !0
|
|
69
71
|
});
|
|
70
|
-
}),
|
|
71
|
-
let t = S.reservedSlots?.() ?? [], n = e(
|
|
72
|
-
if (!L.value) return !r && !n ?
|
|
73
|
-
[
|
|
74
|
-
[
|
|
72
|
+
}), ae = a(() => {
|
|
73
|
+
let t = S.reservedSlots?.() ?? [], n = e(C, "end") || t.includes("end"), r = e(C, "start") || t.includes("start");
|
|
74
|
+
if (!L.value) return !r && !n ? Y.value?.padding : h({
|
|
75
|
+
[Y.value?.insetStart ?? ""]: !r,
|
|
76
|
+
[Y.value?.insetEnd ?? ""]: !n
|
|
75
77
|
});
|
|
76
|
-
}),
|
|
78
|
+
}), oe = a(() => r(k.value?.end, {}, h({
|
|
77
79
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
78
80
|
"text-dark-500": !0,
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
}))),
|
|
82
|
-
let e =
|
|
83
|
-
return r(
|
|
84
|
-
class:
|
|
85
|
-
...
|
|
86
|
-
},
|
|
81
|
+
[X.value?.end ?? ""]: !0,
|
|
82
|
+
[j.value.end ?? ""]: !0
|
|
83
|
+
}))), se = a(() => {
|
|
84
|
+
let e = w.value.inheritedAttrs;
|
|
85
|
+
return r(k.value?.root, {
|
|
86
|
+
class: h(e.class),
|
|
87
|
+
...u(e, ["class"])
|
|
88
|
+
}, h({
|
|
87
89
|
"group w-full relative": !0,
|
|
88
90
|
"aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60": !0,
|
|
89
91
|
"aria-readonly:pointer-events-none aria-readonly:select-none": !0,
|
|
90
|
-
[
|
|
92
|
+
[j.value.root ?? ""]: !0
|
|
91
93
|
}));
|
|
92
|
-
}),
|
|
94
|
+
}), ce = a(() => r(k.value?.errorMessage, {}, h({
|
|
93
95
|
"mt-1": !0,
|
|
94
96
|
"min-h-[1lh]": V.value,
|
|
95
97
|
"text-error-600 dark:text-error-400": !0,
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
}))),
|
|
101
|
-
...
|
|
98
|
+
[Y.value?.text ?? ""]: !0,
|
|
99
|
+
[Y.value?.insetStart ?? ""]: !0,
|
|
100
|
+
[Y.value?.insetEnd ?? ""]: !0,
|
|
101
|
+
[j.value.errorMessage ?? ""]: !0
|
|
102
|
+
}))), le = a(() => r({
|
|
103
|
+
...k.value?.input,
|
|
102
104
|
id: H.value,
|
|
103
|
-
disabled:
|
|
104
|
-
readonly:
|
|
105
|
-
"aria-describedby":
|
|
106
|
-
"aria-invalid":
|
|
107
|
-
},
|
|
105
|
+
disabled: N.value,
|
|
106
|
+
readonly: P.value,
|
|
107
|
+
"aria-describedby": J.value,
|
|
108
|
+
"aria-invalid": M.value || void 0
|
|
109
|
+
}, u(w.value.inheritedAttrs, [
|
|
108
110
|
"class",
|
|
109
111
|
"modelValue",
|
|
110
112
|
"onUpdate:modelValue"
|
|
111
|
-
]),
|
|
113
|
+
]), h({
|
|
112
114
|
"flex-1 min-w-0 min-h-0 bg-transparent border-0 shadow-none": !0,
|
|
113
115
|
"h-full": !z.value && !L.value,
|
|
114
116
|
"max-h-none": z.value,
|
|
115
117
|
"text-dark-900 dark:text-dark-100 placeholder:text-dark-400": !0,
|
|
116
118
|
"outline-none ring-0 focus:outline-none focus:ring-0": !0,
|
|
117
119
|
"disabled:cursor-not-allowed": !0,
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
}))),
|
|
120
|
+
[Y.value?.input ?? ""]: !z.value,
|
|
121
|
+
[Y.value?.textarea ?? ""]: z.value,
|
|
122
|
+
[Y.value?.textareaLikeInput ?? ""]: B.value,
|
|
123
|
+
[j.value.input ?? ""]: !0
|
|
124
|
+
}))), ue = a(() => n(k.value?.label, {
|
|
123
125
|
for: H.value,
|
|
124
126
|
size: E.value.size,
|
|
125
|
-
error:
|
|
127
|
+
error: M.value,
|
|
126
128
|
required: E.value.required,
|
|
127
129
|
classes: {
|
|
128
|
-
required:
|
|
129
|
-
root:
|
|
130
|
-
[
|
|
131
|
-
[
|
|
130
|
+
required: j.value.required,
|
|
131
|
+
root: h({
|
|
132
|
+
[Q.value?.label ?? ""]: I.value,
|
|
133
|
+
[j.value.label ?? ""]: !0
|
|
132
134
|
})
|
|
133
135
|
}
|
|
134
|
-
})),
|
|
136
|
+
})), de = a(() => r(k.value?.start, {}, h({
|
|
135
137
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
136
138
|
"text-dark-400": !0,
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
}))),
|
|
139
|
+
[X.value?.start ?? ""]: !0,
|
|
140
|
+
[j.value.start ?? ""]: !0
|
|
141
|
+
}))), fe = a(() => n(k.value?.corner, {
|
|
140
142
|
for: H.value,
|
|
141
143
|
size: E.value.size,
|
|
142
|
-
classes: { root:
|
|
143
|
-
[
|
|
144
|
-
[
|
|
144
|
+
classes: { root: h({
|
|
145
|
+
[Q.value?.corner ?? ""]: I.value,
|
|
146
|
+
[j.value.corner ?? ""]: !0
|
|
145
147
|
}) }
|
|
146
|
-
})),
|
|
147
|
-
let e = t(
|
|
148
|
-
return r(
|
|
148
|
+
})), pe = a(() => {
|
|
149
|
+
let e = t(C, "label", E.value.label);
|
|
150
|
+
return r(k.value?.header, {}, h({
|
|
149
151
|
flex: !0,
|
|
150
152
|
"w-full shrink-0": !0,
|
|
151
153
|
"justify-between": e,
|
|
152
154
|
"justify-end": !e,
|
|
153
155
|
"items-center": I.value,
|
|
154
156
|
"items-end": L.value,
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
+
[Q.value?.labelRow ?? ""]: K.value,
|
|
158
|
+
[j.value.header ?? ""]: !0
|
|
157
159
|
}));
|
|
158
|
-
}),
|
|
160
|
+
}), $ = a(() => r(k.value?.header, {}, h({
|
|
159
161
|
flex: !0,
|
|
160
162
|
"mb-1": !0,
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
}))),
|
|
163
|
+
[q.value]: !0,
|
|
164
|
+
[j.value.header ?? ""]: !0
|
|
165
|
+
}))), me = a(() => r(k.value?.endIcon, {}, h({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))), he = a(() => r(k.value?.end, {}, h({
|
|
164
166
|
"group/end wrapper-end-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
165
167
|
"self-stretch min-h-0 overflow-hidden py-0.5 pe-0.5": L.value,
|
|
166
168
|
"h-full min-h-0 overflow-hidden py-0.5 pe-0.5": !L.value,
|
|
167
|
-
[
|
|
168
|
-
}))),
|
|
169
|
+
[j.value.end ?? ""]: !0
|
|
170
|
+
}))), ge = a(() => r({}, {}, h({
|
|
169
171
|
"flex min-h-0 min-w-0 flex-1 flex-col": !0,
|
|
170
|
-
[
|
|
171
|
-
}))),
|
|
172
|
+
[ie.value ?? ""]: !0
|
|
173
|
+
}))), _e = a(() => r({}, {}, h({
|
|
172
174
|
"flex w-full min-w-0 flex-1 items-stretch gap-x-2": !0,
|
|
173
|
-
[
|
|
175
|
+
[Y.value?.controlRow ?? ""]: !0
|
|
174
176
|
})));
|
|
175
177
|
return {
|
|
176
|
-
slots:
|
|
178
|
+
slots: C,
|
|
177
179
|
merged: E,
|
|
178
|
-
control:
|
|
179
|
-
endBind:
|
|
180
|
-
rootBind:
|
|
180
|
+
control: A,
|
|
181
|
+
endBind: oe,
|
|
182
|
+
rootBind: se,
|
|
181
183
|
controlId: H,
|
|
182
|
-
errorBind:
|
|
183
|
-
errorIcon:
|
|
184
|
-
inputBind:
|
|
184
|
+
errorBind: ce,
|
|
185
|
+
errorIcon: ne,
|
|
186
|
+
inputBind: le,
|
|
185
187
|
isNotched: I,
|
|
186
188
|
isStacked: L,
|
|
187
|
-
startBind:
|
|
188
|
-
headerBind:
|
|
189
|
-
isDisabled:
|
|
190
|
-
isReadonly:
|
|
191
|
-
variantKey:
|
|
192
|
-
endIconBind:
|
|
193
|
-
endSlotBind:
|
|
194
|
-
invalidated:
|
|
195
|
-
containerBind:
|
|
196
|
-
"data-bridge-variant":
|
|
189
|
+
startBind: de,
|
|
190
|
+
headerBind: $,
|
|
191
|
+
isDisabled: N,
|
|
192
|
+
isReadonly: P,
|
|
193
|
+
variantKey: F,
|
|
194
|
+
endIconBind: me,
|
|
195
|
+
endSlotBind: he,
|
|
196
|
+
invalidated: M,
|
|
197
|
+
containerBind: a(() => r(k.value?.container, {
|
|
198
|
+
"data-bridge-variant": F.value,
|
|
197
199
|
"data-bridge-rounded": E.value.rounded ?? "md"
|
|
198
|
-
},
|
|
200
|
+
}, h({
|
|
199
201
|
"group/field relative flex flex-row items-stretch overflow-hidden": L.value,
|
|
200
202
|
"group/field relative flex justify-start gap-x-2 items-stretch": !L.value,
|
|
201
203
|
"transition-all ease-in-out duration-150 outline-none": !0,
|
|
202
|
-
"bg-dark-100 dark:bg-dark-800":
|
|
203
|
-
[
|
|
204
|
-
[
|
|
205
|
-
[
|
|
206
|
-
[
|
|
207
|
-
[
|
|
208
|
-
[
|
|
209
|
-
[
|
|
204
|
+
"bg-dark-100 dark:bg-dark-800": N.value && !M.value,
|
|
205
|
+
[Y.value?.container ?? ""]: !z.value,
|
|
206
|
+
[Y.value?.containerTextareaLikeInput ?? ""]: B.value,
|
|
207
|
+
[Y.value?.containerTextarea ?? ""]: z.value && !B.value,
|
|
208
|
+
[Q.value?.container ?? ""]: !0,
|
|
209
|
+
[Z.value ?? ""]: !R.value,
|
|
210
|
+
[ae.value ?? ""]: !0,
|
|
211
|
+
[re.value ?? ""]: !0,
|
|
210
212
|
"rounded-none": R.value,
|
|
211
|
-
"bg-error-50 ring-error-500 dark:bg-error-700/10 dark:ring-error-600":
|
|
212
|
-
"border-error-500 dark:border-error-600":
|
|
213
|
-
[
|
|
213
|
+
"bg-error-50 ring-error-500 dark:bg-error-700/10 dark:ring-error-600": M.value && !R.value,
|
|
214
|
+
"border-error-500 dark:border-error-600": M.value && R.value,
|
|
215
|
+
[j.value.container ?? ""]: !0
|
|
214
216
|
}))),
|
|
215
|
-
startIconBind:
|
|
216
|
-
startSlotBind:
|
|
217
|
+
startIconBind: a(() => r(k.value?.startIcon, {}, h({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))),
|
|
218
|
+
startSlotBind: a(() => r(k.value?.start, {}, h({
|
|
217
219
|
"group/start wrapper-start-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
218
220
|
"self-stretch min-h-0 overflow-hidden py-0.5 ps-0.5": L.value,
|
|
219
221
|
"h-full min-h-0 overflow-hidden py-0.5 ps-0.5": !L.value,
|
|
220
|
-
[
|
|
222
|
+
[j.value.start ?? ""]: !0
|
|
221
223
|
}))),
|
|
222
|
-
fieldLabelProps:
|
|
223
|
-
ariaDescribedBy:
|
|
224
|
-
descriptionBind:
|
|
224
|
+
fieldLabelProps: ue,
|
|
225
|
+
ariaDescribedBy: J,
|
|
226
|
+
descriptionBind: a(() => r(k.value?.description, {}, h({
|
|
225
227
|
"mt-1 text-dark-500 dark:text-dark-400": !0,
|
|
226
|
-
[
|
|
227
|
-
[
|
|
228
|
-
[
|
|
229
|
-
[
|
|
228
|
+
[Y.value?.text ?? ""]: !0,
|
|
229
|
+
[Y.value?.insetStart ?? ""]: !0,
|
|
230
|
+
[Y.value?.insetEnd ?? ""]: !0,
|
|
231
|
+
[j.value.description ?? ""]: !0
|
|
230
232
|
}))),
|
|
231
|
-
stackedBodyBind:
|
|
232
|
-
fieldCornerProps:
|
|
233
|
-
hasInsetLabelRow:
|
|
234
|
-
insetLabelRowBind:
|
|
235
|
-
stackedInputRowBind:
|
|
233
|
+
stackedBodyBind: ge,
|
|
234
|
+
fieldCornerProps: fe,
|
|
235
|
+
hasInsetLabelRow: K,
|
|
236
|
+
insetLabelRowBind: pe,
|
|
237
|
+
stackedInputRowBind: _e,
|
|
238
|
+
showErrorMessageRow: G,
|
|
239
|
+
showDescriptionContent: W,
|
|
236
240
|
showErrorMessageContent: U,
|
|
237
241
|
reservesErrorMessageSpace: V
|
|
238
242
|
};
|
|
239
243
|
}
|
|
240
244
|
//#endregion
|
|
241
|
-
export {
|
|
245
|
+
export { y as formFieldBridgeKeys, b as useFormField };
|
|
@@ -142,7 +142,8 @@ export interface FormFieldOwnProps {
|
|
|
142
142
|
*/
|
|
143
143
|
customProps?: FormFieldCustomProps;
|
|
144
144
|
/**
|
|
145
|
-
* Helper text below the control
|
|
145
|
+
* Helper text below the control. Hidden when `error` is true and an error
|
|
146
|
+
* message is shown, unless `showDescriptionOnError` is true.
|
|
146
147
|
*
|
|
147
148
|
* @default undefined
|
|
148
149
|
*/
|
|
@@ -166,7 +167,8 @@ export interface FormFieldOwnProps {
|
|
|
166
167
|
*/
|
|
167
168
|
endIcon?: IconSource;
|
|
168
169
|
/**
|
|
169
|
-
* When `true`, applies invalid styling on the label
|
|
170
|
+
* When `true`, applies invalid styling on the label. Hides description when
|
|
171
|
+
* an error message is shown, unless `showDescriptionOnError` is true.
|
|
170
172
|
*
|
|
171
173
|
* @default false
|
|
172
174
|
*/
|
|
@@ -192,7 +194,8 @@ export interface FormFieldOwnProps {
|
|
|
192
194
|
*/
|
|
193
195
|
field?: UseFormFieldReturn;
|
|
194
196
|
/**
|
|
195
|
-
* When `true`, does not reserve
|
|
197
|
+
* When `true`, does not reserve the error row. That row is also omitted
|
|
198
|
+
* while a description is shown.
|
|
196
199
|
*
|
|
197
200
|
* @default false
|
|
198
201
|
*/
|
|
@@ -221,6 +224,12 @@ export interface FormFieldOwnProps {
|
|
|
221
224
|
* @default "md"
|
|
222
225
|
*/
|
|
223
226
|
rounded?: MergeProps<FormFieldRounded, FormFieldRoundedOverrides>;
|
|
227
|
+
/**
|
|
228
|
+
* When `true`, keeps the description visible while the field is invalid.
|
|
229
|
+
*
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
showDescriptionOnError?: boolean;
|
|
224
233
|
/**
|
|
225
234
|
* When `true` and the field is invalid, shows an error icon at the inline end
|
|
226
235
|
* when no `endIcon` or `end` slot is present.
|
|
@@ -269,7 +278,8 @@ export interface FormFieldSlots {
|
|
|
269
278
|
*/
|
|
270
279
|
default?: Slot<undefined>;
|
|
271
280
|
/**
|
|
272
|
-
* Helper text below the control
|
|
281
|
+
* Helper text below the control. Hidden when the field is invalid and an
|
|
282
|
+
* error message is shown, unless `showDescriptionOnError` is true.
|
|
273
283
|
*/
|
|
274
284
|
description?: Slot<undefined>;
|
|
275
285
|
/**
|
|
@@ -26,10 +26,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
26
26
|
overlay: import('@bridge-ui/core/Domain').FieldOverlayMode;
|
|
27
27
|
showFooter: boolean;
|
|
28
28
|
multiple: boolean;
|
|
29
|
+
hideEmptyMessage: boolean;
|
|
29
30
|
loading: boolean;
|
|
30
31
|
placement: import('@floating-ui/utils').Placement;
|
|
31
32
|
disableAutoFocus: boolean;
|
|
32
|
-
hideEmptyMessage: boolean;
|
|
33
33
|
highlightedIndex: number;
|
|
34
34
|
showCheckmark: boolean;
|
|
35
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -435,7 +435,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
435
435
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
436
436
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
437
437
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
438
|
-
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
|
|
438
|
+
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>;
|
|
439
439
|
isNotched: import('vue').ComputedRef<boolean>;
|
|
440
440
|
isStacked: import('vue').ComputedRef<boolean>;
|
|
441
441
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
@@ -460,6 +460,8 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
460
460
|
hasInsetLabelRow: import('vue').ComputedRef<boolean>;
|
|
461
461
|
insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
462
462
|
stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
463
|
+
showErrorMessageRow: import('vue').ComputedRef<boolean>;
|
|
464
|
+
showDescriptionContent: import('vue').ComputedRef<boolean>;
|
|
463
465
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
464
466
|
reservesErrorMessageSpace: import('vue').ComputedRef<boolean>;
|
|
465
467
|
};
|
|
@@ -685,7 +687,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
685
687
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
686
688
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
687
689
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
688
|
-
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>, {
|
|
690
|
+
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>, {
|
|
689
691
|
min: number | undefined;
|
|
690
692
|
max: number | undefined;
|
|
691
693
|
type: string;
|
|
@@ -13,14 +13,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
13
13
|
onChange?: ((value: string) => any) | undefined;
|
|
14
14
|
"onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
|
|
15
15
|
onComplete?: ((value: string) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
color: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').OtpFieldColor, import('./otpField.types').OtpFieldColorOverrides>;
|
|
18
|
-
type: import('@bridge-ui/core/Domain').OtpInputType;
|
|
19
|
-
size: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').BaseFieldSize, import('../BaseField').BaseFieldSizeOverrides>;
|
|
20
|
-
length: number;
|
|
21
|
-
rounded: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').OtpFieldRounded, import('./otpField.types').OtpFieldRoundedOverrides>;
|
|
22
|
-
variant: import('@bridge-ui/core/Utils').MergeProps<import('@bridge-ui/core/Tokens').OtpFieldVariant, import('./otpField.types').OtpFieldVariantOverrides>;
|
|
23
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
18
|
declare const _default: typeof __VLS_export;
|
|
26
19
|
export default _default;
|
|
@@ -16,15 +16,15 @@ var b = [
|
|
|
16
16
|
props: /*@__PURE__*/ d({
|
|
17
17
|
autoFocus: { type: Boolean },
|
|
18
18
|
classes: {},
|
|
19
|
-
color: {
|
|
19
|
+
color: {},
|
|
20
20
|
customProps: {},
|
|
21
21
|
defaultValue: {},
|
|
22
|
-
length: {
|
|
22
|
+
length: {},
|
|
23
23
|
mask: { type: Boolean },
|
|
24
24
|
placeholder: {},
|
|
25
|
-
rounded: {
|
|
26
|
-
type: {
|
|
27
|
-
variant: {
|
|
25
|
+
rounded: {},
|
|
26
|
+
type: {},
|
|
27
|
+
variant: {},
|
|
28
28
|
controlId: {},
|
|
29
29
|
corner: {},
|
|
30
30
|
description: {},
|
|
@@ -35,7 +35,8 @@ var b = [
|
|
|
35
35
|
label: {},
|
|
36
36
|
readonly: { type: Boolean },
|
|
37
37
|
required: { type: Boolean },
|
|
38
|
-
|
|
38
|
+
showDescriptionOnError: { type: Boolean },
|
|
39
|
+
size: {}
|
|
39
40
|
}, {
|
|
40
41
|
modelValue: {},
|
|
41
42
|
modelModifiers: {}
|
|
@@ -6,7 +6,7 @@ export type UseOtpFieldOptions = {
|
|
|
6
6
|
onChange?: (value: string) => void;
|
|
7
7
|
onComplete?: (value: string) => void;
|
|
8
8
|
};
|
|
9
|
-
export declare const otpFieldBridgeKeys: readonly ["mask", "type", "color", "length", "rounded", "variant", "autoFocus", "placeholder", "defaultValue", "size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage"];
|
|
9
|
+
export declare const otpFieldBridgeKeys: readonly ["mask", "type", "color", "length", "rounded", "variant", "autoFocus", "placeholder", "defaultValue", "size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage", "showDescriptionOnError"];
|
|
10
10
|
type OtpFieldLibDefaults = LibDefaultsShape<OtpFieldOwnProps, "size" | "type" | "color" | "length" | "rounded" | "variant">;
|
|
11
11
|
type OtpFieldMerged = MergeLibDefaults<OtpFieldOwnProps, OtpFieldLibDefaults>;
|
|
12
12
|
/**
|
|
@@ -52,6 +52,8 @@ export declare function useOtpField(props: MaybeRefOrGetter<OtpFieldOwnProps>, m
|
|
|
52
52
|
fieldLabelProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
|
|
53
53
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
54
54
|
fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
|
|
55
|
+
showErrorMessageRow: import('vue').ComputedRef<boolean>;
|
|
56
|
+
showDescriptionContent: import('vue').ComputedRef<boolean>;
|
|
55
57
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
56
58
|
};
|
|
57
59
|
inputBind: (index: number) => import('@bridge-ui/core/Utils').MergePartBind<object, "class", {
|
|
@@ -433,7 +433,7 @@ export declare function usePasswordField(props: PasswordFieldOwnProps, options?:
|
|
|
433
433
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
434
434
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
435
435
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
436
|
-
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
|
|
436
|
+
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>;
|
|
437
437
|
isNotched: import('vue').ComputedRef<boolean>;
|
|
438
438
|
isStacked: import('vue').ComputedRef<boolean>;
|
|
439
439
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
@@ -458,6 +458,8 @@ export declare function usePasswordField(props: PasswordFieldOwnProps, options?:
|
|
|
458
458
|
hasInsetLabelRow: import('vue').ComputedRef<boolean>;
|
|
459
459
|
insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
460
460
|
stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
|
|
461
|
+
showErrorMessageRow: import('vue').ComputedRef<boolean>;
|
|
462
|
+
showDescriptionContent: import('vue').ComputedRef<boolean>;
|
|
461
463
|
showErrorMessageContent: import('vue').ComputedRef<boolean>;
|
|
462
464
|
reservesErrorMessageSpace: import('vue').ComputedRef<boolean>;
|
|
463
465
|
};
|
|
@@ -682,7 +684,7 @@ export declare function usePasswordField(props: PasswordFieldOwnProps, options?:
|
|
|
682
684
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
683
685
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
684
686
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
685
|
-
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>, {
|
|
687
|
+
}, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>, {
|
|
686
688
|
type: string;
|
|
687
689
|
}>>;
|
|
688
690
|
isVisible: import('vue').ComputedRef<boolean>;
|