@bridge-ui/vue 0.3.0 → 0.4.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/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +40 -45
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -0
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +39 -44
- package/dist/Components/ColorField/composables/useColorField.d.ts +1 -0
- package/dist/Components/DataTable/DataTable.vue.d.ts +3 -3
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +86 -72
- package/dist/Components/DataTable/DataTableColumnsMenu.vue.d.ts +9 -3
- package/dist/Components/DataTable/DataTableColumnsMenu.vue_vue_type_script_setup_true_lang.js +71 -26
- package/dist/Components/DataTable/DataTableFilterMenu.vue.d.ts +5 -2
- package/dist/Components/DataTable/DataTableFilterMenu.vue_vue_type_script_setup_true_lang.js +94 -75
- package/dist/Components/DataTable/DataTableFilterOptions.vue.d.ts +4 -1
- package/dist/Components/DataTable/DataTableFilterOptions.vue_vue_type_script_setup_true_lang.js +12 -4
- package/dist/Components/DataTable/DataTableSelection.vue_vue_type_script_setup_true_lang.js +22 -21
- package/dist/Components/DataTable/DataTableToolbarButton.vue.d.ts +2 -1
- package/dist/Components/DataTable/composables/useDataTable.d.ts +12 -4
- package/dist/Components/DataTable/composables/useDataTable.js +254 -222
- package/dist/Components/DataTable/composables/useDataTableColumnsMenu.d.ts +27 -0
- package/dist/Components/DataTable/composables/useDataTableColumnsMenu.js +54 -0
- package/dist/Components/DataTable/dataTable.types.d.ts +26 -9
- package/dist/Components/DataTable/index.d.ts +1 -1
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +52 -57
- package/dist/Components/DateField/composables/useDateField.d.ts +1 -0
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +50 -55
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +1 -0
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +56 -61
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +1 -0
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +56 -61
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +1 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -0
- package/dist/Components/FormField/composables/useFormField.js +80 -75
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +53 -43
- package/dist/Components/NumberField/composables/useNumberField.d.ts +8 -1
- package/dist/Components/NumberField/composables/useNumberField.js +49 -36
- package/dist/Components/NumberField/index.d.ts +1 -1
- package/dist/Components/NumberField/numberField.types.d.ts +13 -1
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +28 -33
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +1 -0
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +42 -47
- package/dist/Components/Select/composables/useSelect.d.ts +1 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +43 -48
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- package/dist/Components/Table/Table.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Table/composables/useTable.d.ts +3 -0
- package/dist/Components/Table/composables/useTable.js +1 -0
- package/dist/Components/Table/table.types.d.ts +2 -1
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +11 -16
- package/dist/Components/TextField/composables/useTextField.d.ts +1 -0
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +15 -20
- package/dist/Components/Textarea/composables/useTextarea.d.ts +1 -0
- package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +45 -50
- package/dist/Components/TimeField/composables/useTimeField.d.ts +1 -0
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +45 -50
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +1 -0
- package/dist/Utils/index.d.ts +1 -0
- package/dist/Utils/index.js +28 -27
- package/dist/Utils/useOptionalModel.d.ts +6 -0
- package/dist/Utils/useOptionalModel.js +13 -0
- package/dist/augments.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/theme.css +46 -42
- package/docs/components/DataTable.md +42 -16
- package/docs/components/NumberField.md +17 -6
- package/docs/examples/i18n-dictionary.ts +6 -0
- package/docs/examples/icon-fontawesome.ts +4 -0
- package/docs/examples/icon-heroicons.ts +4 -0
- package/docs/examples/icon-lucide.ts +4 -0
- package/docs/examples/icon-phosphor.ts +4 -0
- package/docs/examples/icon-tabler.ts +4 -0
- package/package.json +2 -2
package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { presentSlotNames as t } from "../../Utils/slotOrProp.js";
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import i from "../FormField/
|
|
6
|
-
import a from "../
|
|
7
|
-
import
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
3
|
+
import { useOptionalModel as n } from "../../Utils/useOptionalModel.js";
|
|
4
|
+
import r from "../Icon/Icon.js";
|
|
5
|
+
import { FORM_FIELD_CHROME_SLOT_NAMES as i } from "../FormField/formField.types.js";
|
|
6
|
+
import a from "../FormField/FormField.js";
|
|
7
|
+
import o from "../FieldOverlay/FieldOverlay.js";
|
|
8
|
+
import { useDateTimeRangeField as s } from "./composables/useDateTimeRangeField.js";
|
|
9
|
+
import c from "../DateTimeRangePicker/DateTimeRangePicker.js";
|
|
10
|
+
import { Fragment as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeModels as v, mergeProps as y, normalizeClass as b, normalizeProps as x, openBlock as S, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, useModel as O, withCtx as k, withKeys as A, withModifiers as j } from "vue";
|
|
11
11
|
//#region src/Components/DateTimeRangeField/DateTimeRangeField.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var M = { class: "flex min-w-0 flex-1 items-center gap-1" }, N = ["aria-label"], P = /*@__PURE__*/ g({
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "DateTimeRangeField",
|
|
15
15
|
props: /*@__PURE__*/ v({
|
|
@@ -85,62 +85,57 @@ var N = { class: "flex min-w-0 flex-1 items-center gap-1" }, P = ["aria-label"],
|
|
|
85
85
|
"open"
|
|
86
86
|
], ["update:modelValue"]),
|
|
87
87
|
setup(g, { emit: v }) {
|
|
88
|
-
let F = O(g, "modelValue"), I =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
default: k(() => [f("div", N, [f("input", x(_(D(W))), null, 16), D($) ? (S(), d("span", y({ key: 0 }, D(G), {
|
|
96
|
-
onClick: o[0] ||= (...e) => D(K) && D(K)(...e),
|
|
97
|
-
"aria-label": D(R)("Clear"),
|
|
98
|
-
onKeydown: [o[1] ||= A(j((...e) => D(K) && D(K)(...e), ["prevent"]), ["enter"]), o[2] ||= A(j((...e) => D(K) && D(K)(...e), ["prevent"]), ["space"])]
|
|
99
|
-
}), [h(D(n), y({
|
|
88
|
+
let P = e(), F = O(g, "modelValue"), I = v, L = g, R = C(L.defaultValue ?? null), z = n(F, R), { open: ee, fill: B, overlay: V, formField: H, inputBind: U, clearBind: W, clearValue: G, modelValue: K, showFooter: q, orientation: J, pickerClass: Y, dateTimeOnly: X, clearIconSize: Z, showClearIcon: Q, handleOpenChange: $, handlePickerChange: te, handlePickerCancel: ne, overlayCustomProps: re, dateTimeRangePickerCustomProps: ie } = s(L, z, I);
|
|
89
|
+
return (e, n) => (S(), d(l, null, [h(D(a), { field: D(H) }, p({
|
|
90
|
+
default: k(() => [f("div", M, [f("input", x(_(D(U))), null, 16), D(Q) ? (S(), d("span", y({ key: 0 }, D(W), {
|
|
91
|
+
onClick: n[0] ||= (...e) => D(G) && D(G)(...e),
|
|
92
|
+
"aria-label": D(P)("Clear"),
|
|
93
|
+
onKeydown: [n[1] ||= A(j((...e) => D(G) && D(G)(...e), ["prevent"]), ["enter"]), n[2] ||= A(j((...e) => D(G) && D(G)(...e), ["prevent"]), ["space"])]
|
|
94
|
+
}), [h(D(r), y({
|
|
100
95
|
icon: "clear",
|
|
101
|
-
size: D(
|
|
102
|
-
},
|
|
96
|
+
size: D(Z)
|
|
97
|
+
}, L.customProps?.clearIcon), null, 16, ["size"])], 16, N)) : u("", !0)])]),
|
|
103
98
|
_: 2
|
|
104
|
-
}, [w(D(t)(D(
|
|
99
|
+
}, [w(D(t)(D(i), e.$slots), (t) => ({
|
|
105
100
|
name: t,
|
|
106
101
|
fn: k((n) => [T(e.$slots, t, x(_(n || {})))])
|
|
107
|
-
}))]), 1032, ["field"]), h(D(
|
|
108
|
-
overlay: D(
|
|
109
|
-
"model-value": D(
|
|
110
|
-
"custom-props": D(
|
|
111
|
-
"onUpdate:modelValue": D(
|
|
102
|
+
}))]), 1032, ["field"]), h(D(o), {
|
|
103
|
+
overlay: D(V),
|
|
104
|
+
"model-value": D(ee),
|
|
105
|
+
"custom-props": D(re),
|
|
106
|
+
"onUpdate:modelValue": D($)
|
|
112
107
|
}, {
|
|
113
|
-
default: k(() => [h(D(
|
|
114
|
-
fill: D(
|
|
115
|
-
value: D(
|
|
116
|
-
class: b(D(
|
|
117
|
-
ampm: D(
|
|
118
|
-
"show-footer": D(
|
|
119
|
-
orientation: D(
|
|
120
|
-
"read-only":
|
|
121
|
-
"max-date": D(
|
|
122
|
-
"min-date": D(
|
|
123
|
-
"max-time": D(
|
|
124
|
-
"min-time": D(
|
|
125
|
-
onChange: D(
|
|
126
|
-
onCancel: D(
|
|
127
|
-
interval: D(
|
|
128
|
-
"time-zone": D(
|
|
129
|
-
"hide-years": D(
|
|
130
|
-
error: D(
|
|
131
|
-
color: D(
|
|
132
|
-
"hide-months": D(
|
|
133
|
-
disabled: D(
|
|
134
|
-
"show-seconds": D(
|
|
135
|
-
"start-of-week": D(
|
|
136
|
-
rounded: D(
|
|
137
|
-
"disable-dates": D(
|
|
138
|
-
"hide-weekdays": D(
|
|
139
|
-
"disable-times": D(
|
|
140
|
-
"disable-years": D(
|
|
141
|
-
"disable-months": D(
|
|
142
|
-
"custom-props": D(
|
|
143
|
-
"hide-outside-days": D(
|
|
108
|
+
default: k(() => [h(D(c), {
|
|
109
|
+
fill: D(B),
|
|
110
|
+
value: D(K),
|
|
111
|
+
class: b(D(Y)),
|
|
112
|
+
ampm: D(X).ampm,
|
|
113
|
+
"show-footer": D(q),
|
|
114
|
+
orientation: D(J),
|
|
115
|
+
"read-only": L.readonly,
|
|
116
|
+
"max-date": D(X).maxDate,
|
|
117
|
+
"min-date": D(X).minDate,
|
|
118
|
+
"max-time": D(X).maxTime,
|
|
119
|
+
"min-time": D(X).minTime,
|
|
120
|
+
onChange: D(te),
|
|
121
|
+
onCancel: D(ne),
|
|
122
|
+
interval: D(X).interval,
|
|
123
|
+
"time-zone": D(X).timeZone,
|
|
124
|
+
"hide-years": D(X).hideYears,
|
|
125
|
+
error: D(H).invalidated.value,
|
|
126
|
+
color: D(H).merged.value.color,
|
|
127
|
+
"hide-months": D(X).hideMonths,
|
|
128
|
+
disabled: D(H).isDisabled.value,
|
|
129
|
+
"show-seconds": D(X).showSeconds,
|
|
130
|
+
"start-of-week": D(X).startOfWeek,
|
|
131
|
+
rounded: D(H).merged.value.rounded,
|
|
132
|
+
"disable-dates": D(X).disableDates,
|
|
133
|
+
"hide-weekdays": D(X).hideWeekdays,
|
|
134
|
+
"disable-times": D(X).disableTimes,
|
|
135
|
+
"disable-years": D(X).disableYears,
|
|
136
|
+
"disable-months": D(X).disableMonths,
|
|
137
|
+
"custom-props": D(ie),
|
|
138
|
+
"hide-outside-days": D(X).hideOutsideDays
|
|
144
139
|
}, p({
|
|
145
140
|
day: k((t) => [T(e.$slots, "day", x(_(t)), () => [m(E(t.label), 1)])]),
|
|
146
141
|
_: 2
|
|
@@ -159,4 +154,4 @@ var N = { class: "flex min-w-0 flex-1 items-center gap-1" }, P = ["aria-label"],
|
|
|
159
154
|
}
|
|
160
155
|
});
|
|
161
156
|
//#endregion
|
|
162
|
-
export {
|
|
157
|
+
export { P as default };
|
|
@@ -450,6 +450,7 @@ export declare function useDateTimeRangeField(props: DateTimeRangeFieldOwnProps,
|
|
|
450
450
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
451
451
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
452
452
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
453
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
453
454
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
454
455
|
}>>;
|
|
455
456
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
@@ -460,6 +460,7 @@ export declare function useFormField(props: MaybeRefOrGetter<Omit<FormFieldOwnPr
|
|
|
460
460
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
461
461
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
462
462
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {
|
|
463
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
463
464
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
464
465
|
}>>;
|
|
465
466
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
@@ -28,39 +28,39 @@ var b = [
|
|
|
28
28
|
"showErrorIcon",
|
|
29
29
|
"hideErrorMessage"
|
|
30
30
|
];
|
|
31
|
-
function x(x,
|
|
32
|
-
let
|
|
31
|
+
function x(x, ee, S = {}) {
|
|
32
|
+
let C = c(), w = l(), T = o(() => y({
|
|
33
33
|
props: s(x),
|
|
34
34
|
bridgeKeys: b
|
|
35
|
-
})), { merged:
|
|
36
|
-
libDefaults:
|
|
37
|
-
componentName:
|
|
38
|
-
props: () =>
|
|
39
|
-
}),
|
|
40
|
-
entry:
|
|
41
|
-
props: () =>
|
|
42
|
-
}),
|
|
43
|
-
let e =
|
|
44
|
-
return
|
|
45
|
-
}), U = o(() =>
|
|
35
|
+
})), { merged: E, entry: D } = i({
|
|
36
|
+
libDefaults: ee,
|
|
37
|
+
componentName: S.componentName,
|
|
38
|
+
props: () => T.value.componentProps
|
|
39
|
+
}), O = o(() => E.value.customProps), k = o(() => S.control?.() ?? "input"), A = a({
|
|
40
|
+
entry: D,
|
|
41
|
+
props: () => T.value.componentProps
|
|
42
|
+
}), j = o(() => E.value.error === !0), M = o(() => !!E.value.disabled), N = o(() => !!E.value.readonly), P = o(() => E.value.variant ?? "outline"), F = o(() => E.value.errorIcon ?? "alert"), I = o(() => P.value === "notched"), L = o(() => P.value === "stacked"), R = o(() => P.value === "underlined"), z = o(() => k.value === "textarea"), B = o(() => z.value && !!S.likeInput?.()), V = o(() => !E.value.hideErrorMessage), H = o(() => {
|
|
43
|
+
let e = T.value.inheritedAttrs.id;
|
|
44
|
+
return E.value.controlId ?? e ?? C;
|
|
45
|
+
}), U = o(() => j.value && t(w, "errorMessage", E.value.errorMessage)), W = o(() => (I.value || L.value) && (t(w, "label", E.value.label) || t(w, "corner", E.value.corner))), G = o(() => t(w, "label", E.value.label) ? "justify-between items-end" : "justify-end"), K = o(() => {
|
|
46
46
|
let e = [];
|
|
47
|
-
return !
|
|
47
|
+
return !j.value && t(w, "description", E.value.description) && e.push(`${H.value}-description`), j.value && !E.value.hideErrorMessage && t(w, "errorMessage", E.value.errorMessage) && e.push(`${H.value}-error`), e.length > 0 ? e.join(" ") : void 0;
|
|
48
48
|
}), q = o(() => {
|
|
49
|
-
let e = v(m,
|
|
50
|
-
return u(e, [
|
|
49
|
+
let e = v(m, D.value?.tokens?.size);
|
|
50
|
+
return u(e, [E.value.size, P.value]);
|
|
51
51
|
}), J = o(() => {
|
|
52
|
-
let e = v(f,
|
|
52
|
+
let e = v(f, D.value?.tokens?.color);
|
|
53
53
|
return _({
|
|
54
54
|
tokens: e,
|
|
55
|
-
color:
|
|
56
|
-
invalid:
|
|
55
|
+
color: E.value.color,
|
|
56
|
+
invalid: j.value
|
|
57
57
|
});
|
|
58
58
|
}), Y = o(() => {
|
|
59
|
-
let e = v(p,
|
|
60
|
-
return u(e,
|
|
59
|
+
let e = v(p, D.value?.tokens?.rounded);
|
|
60
|
+
return u(e, E.value.rounded);
|
|
61
61
|
}), X = o(() => {
|
|
62
|
-
let e = v(h,
|
|
63
|
-
return u(e,
|
|
62
|
+
let e = v(h, D.value?.tokens?.variant);
|
|
63
|
+
return u(e, P.value);
|
|
64
64
|
}), Z = o(() => R.value ? J.value?.underlined : J.value?.input), Q = o(() => {
|
|
65
65
|
if (L.value) return g({
|
|
66
66
|
[q.value?.insetTop ?? ""]: !0,
|
|
@@ -68,42 +68,45 @@ function x(x, S, C = {}) {
|
|
|
68
68
|
[q.value?.insetEnd ?? ""]: !0
|
|
69
69
|
});
|
|
70
70
|
}), te = o(() => {
|
|
71
|
-
let t =
|
|
71
|
+
let t = S.reservedSlots?.() ?? [], n = e(w, "end") || t.includes("end"), r = e(w, "start") || t.includes("start");
|
|
72
72
|
if (!L.value) return !r && !n ? q.value?.padding : g({
|
|
73
73
|
[q.value?.insetStart ?? ""]: !r,
|
|
74
74
|
[q.value?.insetEnd ?? ""]: !n
|
|
75
75
|
});
|
|
76
|
-
}), ne = o(() => r(
|
|
76
|
+
}), ne = o(() => r(O.value?.end, {}, g({
|
|
77
77
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
78
78
|
"text-dark-500": !0,
|
|
79
|
-
[Y.value?.end ?? ""]: !R.value && !L.value,
|
|
80
79
|
[J.value?.end ?? ""]: !0,
|
|
81
|
-
[
|
|
80
|
+
[A.value.end ?? ""]: !0
|
|
82
81
|
}))), re = o(() => {
|
|
83
|
-
let e =
|
|
84
|
-
return r(
|
|
82
|
+
let e = T.value.inheritedAttrs;
|
|
83
|
+
return r(O.value?.root, {
|
|
85
84
|
class: g(e.class),
|
|
86
85
|
...d(e, ["class"])
|
|
87
86
|
}, g({
|
|
88
87
|
"group w-full relative": !0,
|
|
89
88
|
"aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60": !0,
|
|
90
89
|
"aria-readonly:pointer-events-none aria-readonly:select-none": !0,
|
|
91
|
-
[
|
|
90
|
+
[A.value.root ?? ""]: !0
|
|
92
91
|
}));
|
|
93
|
-
}), ie = o(() => r(
|
|
92
|
+
}), ie = o(() => r(O.value?.errorMessage, {}, g({
|
|
94
93
|
"mt-2": !0,
|
|
95
94
|
"min-h-[1lh]": V.value,
|
|
96
95
|
"text-error-600 dark:text-error-400": !0,
|
|
97
96
|
[q.value?.text ?? ""]: !0,
|
|
98
|
-
[
|
|
97
|
+
[A.value.errorMessage ?? ""]: !0
|
|
99
98
|
}))), ae = o(() => r({
|
|
100
|
-
...
|
|
99
|
+
...O.value?.input,
|
|
101
100
|
id: H.value,
|
|
102
|
-
disabled:
|
|
103
|
-
readonly:
|
|
101
|
+
disabled: M.value,
|
|
102
|
+
readonly: N.value,
|
|
104
103
|
"aria-describedby": K.value,
|
|
105
|
-
"aria-invalid":
|
|
106
|
-
}, d(
|
|
104
|
+
"aria-invalid": j.value || void 0
|
|
105
|
+
}, d(T.value.inheritedAttrs, [
|
|
106
|
+
"class",
|
|
107
|
+
"modelValue",
|
|
108
|
+
"onUpdate:modelValue"
|
|
109
|
+
]), g({
|
|
107
110
|
"flex-1 min-w-0 min-h-0 bg-transparent border-0 shadow-none": !0,
|
|
108
111
|
"h-full": !z.value && !L.value,
|
|
109
112
|
"max-h-none": z.value,
|
|
@@ -113,33 +116,32 @@ function x(x, S, C = {}) {
|
|
|
113
116
|
[q.value?.input ?? ""]: !z.value,
|
|
114
117
|
[q.value?.textarea ?? ""]: z.value,
|
|
115
118
|
[q.value?.textareaLikeInput ?? ""]: B.value,
|
|
116
|
-
[
|
|
117
|
-
}))), oe = o(() => n(
|
|
119
|
+
[A.value.input ?? ""]: !0
|
|
120
|
+
}))), oe = o(() => n(O.value?.label, {
|
|
118
121
|
for: H.value,
|
|
119
|
-
size:
|
|
120
|
-
error:
|
|
121
|
-
required:
|
|
122
|
+
size: E.value.size,
|
|
123
|
+
error: j.value,
|
|
124
|
+
required: E.value.required,
|
|
122
125
|
classes: {
|
|
123
|
-
required:
|
|
126
|
+
required: A.value.required,
|
|
124
127
|
root: g({
|
|
125
128
|
[X.value?.label ?? ""]: I.value,
|
|
126
|
-
[
|
|
129
|
+
[A.value.label ?? ""]: !0
|
|
127
130
|
})
|
|
128
131
|
}
|
|
129
|
-
})), $ = o(() => r(
|
|
132
|
+
})), $ = o(() => r(O.value?.start, {}, g({
|
|
130
133
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
131
134
|
"text-dark-400": !0,
|
|
132
|
-
[Y.value?.start ?? ""]: !R.value && !L.value,
|
|
133
135
|
[J.value?.start ?? ""]: !0,
|
|
134
|
-
[
|
|
135
|
-
}))), se = o(() => r(
|
|
136
|
+
[A.value.start ?? ""]: !0
|
|
137
|
+
}))), se = o(() => r(O.value?.corner, {}, g({
|
|
136
138
|
"text-dark-500 dark:text-dark-400": !I.value,
|
|
137
139
|
[q.value?.text ?? ""]: !0,
|
|
138
140
|
[X.value?.corner ?? ""]: I.value,
|
|
139
|
-
[
|
|
141
|
+
[A.value.corner ?? ""]: !0
|
|
140
142
|
}))), ce = o(() => {
|
|
141
|
-
let e = t(
|
|
142
|
-
return r(
|
|
143
|
+
let e = t(w, "label", E.value.label);
|
|
144
|
+
return r(O.value?.header, {}, g({
|
|
143
145
|
flex: !0,
|
|
144
146
|
"w-full shrink-0": !0,
|
|
145
147
|
"justify-between": e,
|
|
@@ -147,18 +149,18 @@ function x(x, S, C = {}) {
|
|
|
147
149
|
"items-center": I.value,
|
|
148
150
|
"items-end": L.value,
|
|
149
151
|
[X.value?.labelRow ?? ""]: W.value,
|
|
150
|
-
[
|
|
152
|
+
[A.value.header ?? ""]: !0
|
|
151
153
|
}));
|
|
152
|
-
}), le = o(() => r(
|
|
154
|
+
}), le = o(() => r(O.value?.header, {}, g({
|
|
153
155
|
flex: !0,
|
|
154
156
|
"mb-1": !0,
|
|
155
157
|
[G.value]: !0,
|
|
156
|
-
[
|
|
157
|
-
}))), ue = o(() => r(
|
|
158
|
+
[A.value.header ?? ""]: !0
|
|
159
|
+
}))), ue = o(() => r(O.value?.endIcon, {}, g({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))), de = o(() => r(O.value?.end, {}, g({
|
|
158
160
|
"group/end wrapper-end-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
159
161
|
"self-stretch min-h-0 overflow-hidden py-0.5 pe-0.5": L.value,
|
|
160
162
|
"h-full min-h-0 overflow-hidden py-0.5 pe-0.5": !L.value,
|
|
161
|
-
[
|
|
163
|
+
[A.value.end ?? ""]: !0
|
|
162
164
|
}))), fe = o(() => r({}, {}, g({
|
|
163
165
|
"flex min-h-0 min-w-0 flex-1 flex-col": !0,
|
|
164
166
|
[Q.value ?? ""]: !0
|
|
@@ -167,56 +169,59 @@ function x(x, S, C = {}) {
|
|
|
167
169
|
[q.value?.controlRow ?? ""]: !0
|
|
168
170
|
})));
|
|
169
171
|
return {
|
|
170
|
-
slots:
|
|
171
|
-
merged:
|
|
172
|
-
control:
|
|
172
|
+
slots: w,
|
|
173
|
+
merged: E,
|
|
174
|
+
control: k,
|
|
173
175
|
endBind: ne,
|
|
174
176
|
rootBind: re,
|
|
175
177
|
controlId: H,
|
|
176
178
|
errorBind: ie,
|
|
177
|
-
errorIcon:
|
|
179
|
+
errorIcon: F,
|
|
178
180
|
inputBind: ae,
|
|
179
181
|
isNotched: I,
|
|
180
182
|
isStacked: L,
|
|
181
183
|
startBind: $,
|
|
182
184
|
cornerBind: se,
|
|
183
185
|
headerBind: le,
|
|
184
|
-
isDisabled:
|
|
185
|
-
isReadonly:
|
|
186
|
-
variantKey:
|
|
186
|
+
isDisabled: M,
|
|
187
|
+
isReadonly: N,
|
|
188
|
+
variantKey: P,
|
|
187
189
|
endIconBind: ue,
|
|
188
190
|
endSlotBind: de,
|
|
189
|
-
invalidated:
|
|
190
|
-
containerBind: o(() => r(
|
|
191
|
+
invalidated: j,
|
|
192
|
+
containerBind: o(() => r(O.value?.container, {
|
|
193
|
+
"data-bridge-variant": P.value,
|
|
194
|
+
"data-bridge-rounded": E.value.rounded ?? "md"
|
|
195
|
+
}, g({
|
|
191
196
|
"group/field relative flex flex-row items-stretch overflow-hidden": L.value,
|
|
192
197
|
"group/field relative flex justify-start gap-x-2 items-stretch": !L.value,
|
|
193
198
|
"transition-all ease-in-out duration-150 outline-none": !0,
|
|
194
|
-
"bg-dark-100 dark:bg-dark-800":
|
|
199
|
+
"bg-dark-100 dark:bg-dark-800": M.value && !j.value,
|
|
195
200
|
[q.value?.container ?? ""]: !z.value,
|
|
196
201
|
[q.value?.containerTextareaLikeInput ?? ""]: B.value,
|
|
197
202
|
[q.value?.containerTextarea ?? ""]: z.value && !B.value,
|
|
198
203
|
[X.value?.container ?? ""]: !0,
|
|
199
|
-
[Y.value
|
|
204
|
+
[Y.value ?? ""]: !R.value,
|
|
200
205
|
[te.value ?? ""]: !0,
|
|
201
206
|
[Z.value ?? ""]: !0,
|
|
202
207
|
"rounded-none": R.value,
|
|
203
|
-
"bg-error-50 ring-error-500 dark:bg-error-700/10 dark:ring-error-600":
|
|
204
|
-
"border-error-500 dark:border-error-600":
|
|
205
|
-
[
|
|
208
|
+
"bg-error-50 ring-error-500 dark:bg-error-700/10 dark:ring-error-600": j.value && !R.value,
|
|
209
|
+
"border-error-500 dark:border-error-600": j.value && R.value,
|
|
210
|
+
[A.value.container ?? ""]: !0
|
|
206
211
|
}))),
|
|
207
|
-
startIconBind: o(() => r(
|
|
208
|
-
startSlotBind: o(() => r(
|
|
212
|
+
startIconBind: o(() => r(O.value?.startIcon, {}, g({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))),
|
|
213
|
+
startSlotBind: o(() => r(O.value?.start, {}, g({
|
|
209
214
|
"group/start wrapper-start-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
210
215
|
"self-stretch min-h-0 overflow-hidden py-0.5 ps-0.5": L.value,
|
|
211
216
|
"h-full min-h-0 overflow-hidden py-0.5 ps-0.5": !L.value,
|
|
212
|
-
[
|
|
217
|
+
[A.value.start ?? ""]: !0
|
|
213
218
|
}))),
|
|
214
219
|
fieldLabelProps: oe,
|
|
215
220
|
ariaDescribedBy: K,
|
|
216
|
-
descriptionBind: o(() => r(
|
|
221
|
+
descriptionBind: o(() => r(O.value?.description, {}, g({
|
|
217
222
|
"mt-2 text-dark-500 dark:text-dark-400": !0,
|
|
218
223
|
[q.value?.text ?? ""]: !0,
|
|
219
|
-
[
|
|
224
|
+
[A.value.description ?? ""]: !0
|
|
220
225
|
}))),
|
|
221
226
|
stackedBodyBind: fe,
|
|
222
227
|
hasInsetLabelRow: W,
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
|
|
2
2
|
import { presentSlotNames as t } from "../../Utils/slotOrProp.js";
|
|
3
3
|
import { useHoldRepeat as n } from "../../Utils/useHoldRepeat.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useOptionalModel as r } from "../../Utils/useOptionalModel.js";
|
|
5
|
+
import { mergePartBind as i } from "../../Utils/index.js";
|
|
5
6
|
import a from "../Icon/Icon.js";
|
|
6
7
|
import { FORM_FIELD_CHROME_SLOT_NAMES as o } from "../FormField/formField.types.js";
|
|
7
8
|
import s from "../FormField/FormField.js";
|
|
8
9
|
import { useNumberField as c } from "./composables/useNumberField.js";
|
|
9
|
-
import { computed as l, createBlock as u,
|
|
10
|
-
import {
|
|
11
|
-
import { cn as A } from "@bridge-ui/core/Utils";
|
|
10
|
+
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createVNode as h, defineComponent as g, guardReactiveProps as _, isRef as v, mergeModels as y, mergeProps as b, normalizeClass as x, normalizeProps as S, openBlock as C, ref as ee, renderList as w, renderSlot as T, unref as E, useModel as D, vModelDynamic as O, withCtx as k, withDirectives as A } from "vue";
|
|
11
|
+
import { cn as j } from "@bridge-ui/core/Utils";
|
|
12
12
|
//#region src/Components/NumberField/NumberField.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var M = /*@__PURE__*/ g({
|
|
14
14
|
inheritAttrs: !1,
|
|
15
15
|
__name: "NumberField",
|
|
16
|
-
props: /*@__PURE__*/
|
|
16
|
+
props: /*@__PURE__*/ y({
|
|
17
17
|
classes: {},
|
|
18
|
+
controlVariant: {},
|
|
18
19
|
customProps: {},
|
|
19
20
|
defaultValue: {},
|
|
20
21
|
max: {},
|
|
@@ -43,50 +44,59 @@ var j = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overf
|
|
|
43
44
|
modelValue: {},
|
|
44
45
|
modelModifiers: {}
|
|
45
46
|
}),
|
|
46
|
-
emits: /*@__PURE__*/
|
|
47
|
-
setup(
|
|
48
|
-
let M =
|
|
49
|
-
set: (e) => {
|
|
50
|
-
N.value = e, F.value = e;
|
|
51
|
-
},
|
|
52
|
-
get: () => k(N.value) ? F.value : N.value
|
|
53
|
-
}), L = e(), { decrement: R, formField: z, increment: B, inputBind: V, stringModel: H, mergedClasses: U } = c(P, I, { onChange: (e) => M("change", e) }), W = n(() => B(), () => ({ disabled: P.disabled })), G = n(() => R(), () => ({ disabled: P.disabled })), K = l(() => i(P.size)), q = l(() => r(P.customProps?.increment, {
|
|
47
|
+
emits: /*@__PURE__*/ y(["change", "update:modelValue"], ["update:modelValue"]),
|
|
48
|
+
setup(g, { emit: y }) {
|
|
49
|
+
let M = e(), te = y, N = D(g, "modelValue"), P = g, F = ee(P.defaultValue), I = r(N, F), { isSplit: L, decrement: R, formField: z, increment: B, inputBind: V, stringModel: H, decrementIcon: U, incrementIcon: W, mergedClasses: G, incrementFirst: K, stepperIconSize: q, controlVariantItem: J } = c(P, I, { onChange: (e) => te("change", e) }), Y = n(() => B(), () => ({ disabled: P.disabled })), X = n(() => R(), () => ({ disabled: P.disabled })), Z = l(() => o.filter((e) => !(e === "end" || e === "start" && L.value))), Q = l(() => i(P.customProps?.increment, {
|
|
54
50
|
type: "button",
|
|
55
51
|
disabled: P.disabled,
|
|
56
|
-
onClick:
|
|
57
|
-
onPointerup:
|
|
58
|
-
onPointerdown:
|
|
59
|
-
"aria-label":
|
|
60
|
-
onLostpointercapture:
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
[
|
|
64
|
-
}))),
|
|
52
|
+
onClick: Y.onPressClick,
|
|
53
|
+
onPointerup: Y.onPressPointerUp,
|
|
54
|
+
onPointerdown: Y.onPressPointerDown,
|
|
55
|
+
"aria-label": M("Increment value"),
|
|
56
|
+
onLostpointercapture: Y.onPressLostPointerCapture
|
|
57
|
+
}, j({
|
|
58
|
+
[J.value.button]: !0,
|
|
59
|
+
[G.value.increment ?? ""]: !0
|
|
60
|
+
}))), $ = l(() => i(P.customProps?.decrement, {
|
|
65
61
|
type: "button",
|
|
66
62
|
disabled: P.disabled,
|
|
67
|
-
onClick:
|
|
68
|
-
onPointerup:
|
|
69
|
-
onPointerdown:
|
|
70
|
-
"aria-label":
|
|
71
|
-
onLostpointercapture:
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
[
|
|
63
|
+
onClick: X.onPressClick,
|
|
64
|
+
onPointerup: X.onPressPointerUp,
|
|
65
|
+
onPointerdown: X.onPressPointerDown,
|
|
66
|
+
"aria-label": M("Decrement value"),
|
|
67
|
+
onLostpointercapture: X.onPressLostPointerCapture
|
|
68
|
+
}, j({
|
|
69
|
+
[J.value.button]: !0,
|
|
70
|
+
[G.value.decrement ?? ""]: !0
|
|
75
71
|
})));
|
|
76
|
-
return (e, n) => (
|
|
77
|
-
end:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
icon: "
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
return (e, n) => (C(), u(E(s), { field: E(z) }, m({
|
|
73
|
+
end: k(() => [p("div", { class: x(E(J).endGroup) }, [
|
|
74
|
+
E(K) ? (C(), f("button", S(b({ key: 0 }, Q.value)), [h(E(a), b({
|
|
75
|
+
icon: E(W),
|
|
76
|
+
size: E(q)
|
|
77
|
+
}, P.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16)) : d("", !0),
|
|
78
|
+
E(L) ? d("", !0) : (C(), f("button", S(b({ key: 1 }, $.value)), [h(E(a), b({
|
|
79
|
+
icon: E(U),
|
|
80
|
+
size: E(q)
|
|
81
|
+
}, P.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)),
|
|
82
|
+
E(K) ? d("", !0) : (C(), f("button", S(b({ key: 2 }, Q.value)), [h(E(a), b({
|
|
83
|
+
icon: E(W),
|
|
84
|
+
size: E(q)
|
|
85
|
+
}, P.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16))
|
|
86
|
+
], 2)]),
|
|
87
|
+
default: k(() => [A(p("input", b({ "onUpdate:modelValue": n[0] ||= (e) => v(H) ? H.value = e : null }, E(V)), null, 16), [[O, E(H)]])]),
|
|
85
88
|
_: 2
|
|
86
|
-
}, [
|
|
89
|
+
}, [w(E(t)(Z.value, e.$slots), (t) => ({
|
|
87
90
|
name: t,
|
|
88
|
-
fn:
|
|
89
|
-
}))
|
|
91
|
+
fn: k((n) => [T(e.$slots, t, S(_(n || {})))])
|
|
92
|
+
})), E(L) ? {
|
|
93
|
+
name: "start",
|
|
94
|
+
fn: k(() => [p("div", { class: x(E(J).startGroup) }, [p("button", S(_($.value)), [h(E(a), b({
|
|
95
|
+
icon: E(U),
|
|
96
|
+
size: E(q)
|
|
97
|
+
}, P.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)], 2)]),
|
|
98
|
+
key: "0"
|
|
99
|
+
} : void 0]), 1032, ["field"]));
|
|
90
100
|
}
|
|
91
101
|
});
|
|
92
102
|
//#endregion
|
|
@@ -448,6 +448,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
448
448
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
449
449
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
450
450
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
451
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
451
452
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
452
453
|
}>>;
|
|
453
454
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
@@ -690,6 +691,12 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
690
691
|
type: string;
|
|
691
692
|
step: number;
|
|
692
693
|
}>>;
|
|
693
|
-
stringModel: import('vue').WritableComputedRef<string
|
|
694
|
+
stringModel: import('vue').WritableComputedRef<string, string | null | undefined>;
|
|
694
695
|
mergedClasses: import('vue').ComputedRef<Partial<NumberFieldClasses>>;
|
|
696
|
+
stepperIconSize: import('vue').ComputedRef<keyof import('@bridge-ui/core/Tokens').IconSize>;
|
|
697
|
+
controlVariantItem: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').NumberFieldControlVariantItem>;
|
|
698
|
+
isSplit: import('vue').ComputedRef<boolean>;
|
|
699
|
+
decrementIcon: import('vue').ComputedRef<"minus" | "chevronDown">;
|
|
700
|
+
incrementIcon: import('vue').ComputedRef<"plus" | "chevronUp">;
|
|
701
|
+
incrementFirst: import('vue').ComputedRef<boolean>;
|
|
695
702
|
};
|