@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { presentSlotNames as e } from "../../Utils/slotOrProp.js";
|
|
2
|
-
import {
|
|
3
|
-
import n from "../FormField/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useOptionalModel as t } from "../../Utils/useOptionalModel.js";
|
|
3
|
+
import { FORM_FIELD_CHROME_SLOT_NAMES as n } from "../FormField/formField.types.js";
|
|
4
|
+
import r from "../FormField/FormField.js";
|
|
5
|
+
import { useTextField as i } from "./composables/useTextField.js";
|
|
6
|
+
import { createBlock as a, createElementVNode as o, createSlots as s, defineComponent as c, guardReactiveProps as l, isRef as u, mergeModels as d, mergeProps as f, normalizeProps as p, openBlock as m, ref as h, renderList as g, renderSlot as _, unref as v, useModel as y, vModelDynamic as b, withCtx as x, withDirectives as S } from "vue";
|
|
7
7
|
//#region src/Components/TextField/TextField.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var C = /*@__PURE__*/ c({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "TextField",
|
|
11
|
-
props: /*@__PURE__*/
|
|
11
|
+
props: /*@__PURE__*/ d({
|
|
12
12
|
defaultValue: {},
|
|
13
13
|
classes: {},
|
|
14
14
|
color: {},
|
|
@@ -42,18 +42,13 @@ var C = /*@__PURE__*/ c({
|
|
|
42
42
|
}),
|
|
43
43
|
emits: ["update:modelValue"],
|
|
44
44
|
setup(c) {
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
get: () => S(u.value) ? w.value : u.value
|
|
50
|
-
}), { formField: E, inputBind: D } = r(C);
|
|
51
|
-
return (r, i) => (p(), a(_(n), { field: _(E) }, s({
|
|
52
|
-
default: b(() => [x(o("input", d({ "onUpdate:modelValue": i[0] ||= (e) => T.value = e }, _(D)), null, 16), [[y, T.value]])]),
|
|
45
|
+
let d = y(c, "modelValue"), C = c, w = h(C.defaultValue), T = t(d, w), { formField: E, inputBind: D } = i(C);
|
|
46
|
+
return (t, i) => (m(), a(v(r), { field: v(E) }, s({
|
|
47
|
+
default: x(() => [S(o("input", f({ "onUpdate:modelValue": i[0] ||= (e) => u(T) ? T.value = e : null }, v(D)), null, 16), [[b, v(T)]])]),
|
|
53
48
|
_: 2
|
|
54
|
-
}, [
|
|
49
|
+
}, [g(v(e)(v(n), t.$slots), (e) => ({
|
|
55
50
|
name: e,
|
|
56
|
-
fn:
|
|
51
|
+
fn: x((n) => [_(t.$slots, e, p(l(n || {})))])
|
|
57
52
|
}))]), 1032, ["field"]));
|
|
58
53
|
}
|
|
59
54
|
});
|
|
@@ -440,6 +440,7 @@ export declare function useTextField(props: TextFieldOwnProps): {
|
|
|
440
440
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
441
441
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
442
442
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
443
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
443
444
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
444
445
|
}>>;
|
|
445
446
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { presentSlotNames as e } from "../../Utils/slotOrProp.js";
|
|
2
|
-
import {
|
|
3
|
-
import n from "../FormField/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useOptionalModel as t } from "../../Utils/useOptionalModel.js";
|
|
3
|
+
import { FORM_FIELD_CHROME_SLOT_NAMES as n } from "../FormField/formField.types.js";
|
|
4
|
+
import r from "../FormField/FormField.js";
|
|
5
|
+
import { useTextarea as i } from "./composables/useTextarea.js";
|
|
6
|
+
import { createBlock as a, createElementVNode as o, createSlots as s, defineComponent as c, guardReactiveProps as l, isRef as u, mergeModels as d, mergeProps as f, normalizeProps as p, openBlock as m, ref as h, renderList as g, renderSlot as _, unref as v, useModel as y, useTemplateRef as b, vModelText as x, watch as S, withCtx as C, withDirectives as w } from "vue";
|
|
7
7
|
//#region src/Components/Textarea/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var T = /*@__PURE__*/ c({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "Textarea",
|
|
11
|
-
props: /*@__PURE__*/
|
|
11
|
+
props: /*@__PURE__*/ d({
|
|
12
12
|
autosize: { type: Boolean },
|
|
13
13
|
defaultValue: {},
|
|
14
14
|
likeInput: { type: Boolean },
|
|
@@ -45,23 +45,18 @@ var T = /*@__PURE__*/ c({
|
|
|
45
45
|
}),
|
|
46
46
|
emits: ["update:modelValue"],
|
|
47
47
|
setup(c) {
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}), O = y("textarea"), { formField: k, textareaBind: A, adjustHeight: j } = r(T, O);
|
|
54
|
-
return x(D, () => {
|
|
55
|
-
j(O.value);
|
|
56
|
-
}), (r, i) => (p(), a(_(n), { field: _(k) }, s({
|
|
57
|
-
default: S(() => [C(o("textarea", d({
|
|
48
|
+
let d = y(c, "modelValue"), T = c, E = b("textarea"), D = h(T.defaultValue), O = t(d, D), { formField: k, textareaBind: A, adjustHeight: j } = i(T, E);
|
|
49
|
+
return S(O, () => {
|
|
50
|
+
j(E.value);
|
|
51
|
+
}), (t, i) => (m(), a(v(r), { field: v(k) }, s({
|
|
52
|
+
default: C(() => [w(o("textarea", f({
|
|
58
53
|
ref: "textarea",
|
|
59
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
60
|
-
},
|
|
54
|
+
"onUpdate:modelValue": i[0] ||= (e) => u(O) ? O.value = e : null
|
|
55
|
+
}, v(A)), null, 16), [[x, v(O)]])]),
|
|
61
56
|
_: 2
|
|
62
|
-
}, [
|
|
57
|
+
}, [g(v(e)(v(n), t.$slots), (e) => ({
|
|
63
58
|
name: e,
|
|
64
|
-
fn:
|
|
59
|
+
fn: C((n) => [_(t.$slots, e, p(l(n || {})))])
|
|
65
60
|
}))]), 1032, ["field"]));
|
|
66
61
|
}
|
|
67
62
|
});
|
|
@@ -441,6 +441,7 @@ export declare function useTextarea(props: TextareaOwnProps, textareaRef: Ref<nu
|
|
|
441
441
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
442
442
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
443
443
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
444
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
444
445
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
445
446
|
}>>;
|
|
446
447
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
@@ -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 { useTimeField as s } from "./composables/useTimeField.js";
|
|
9
|
+
import c from "../TimePicker/TimePicker.js";
|
|
10
|
+
import { Fragment as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeClass as y, normalizeProps as b, openBlock as x, ref as S, renderList as C, renderSlot as w, unref as T, useModel as E, withCtx as D, withKeys as O, withModifiers as k } from "vue";
|
|
11
11
|
//#region src/Components/TimeField/TimeField.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var A = { class: "flex min-w-0 flex-1 items-center gap-1" }, j = ["aria-label"], M = /*@__PURE__*/ h({
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "TimeField",
|
|
15
15
|
props: /*@__PURE__*/ _({
|
|
@@ -74,51 +74,46 @@ var j = { class: "flex min-w-0 flex-1 items-center gap-1" }, M = ["aria-label"],
|
|
|
74
74
|
"open"
|
|
75
75
|
], ["update:modelValue"]),
|
|
76
76
|
setup(h, { emit: _ }) {
|
|
77
|
-
let N = E(h, "modelValue"),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
default: D(() => [f("div", j, [f("input", b(g(T(W))), null, 16), T(Z) ? (x(), d("span", v({ key: 0 }, T(G), {
|
|
85
|
-
onClick: o[0] ||= (...e) => T(K) && T(K)(...e),
|
|
86
|
-
"aria-label": T(I)("Clear"),
|
|
87
|
-
onKeydown: [o[1] ||= O(k((...e) => T(K) && T(K)(...e), ["prevent"]), ["enter"]), o[2] ||= O(k((...e) => T(K) && T(K)(...e), ["prevent"]), ["space"])]
|
|
88
|
-
}), [m(T(n), v({
|
|
77
|
+
let M = _, N = e(), P = E(h, "modelValue"), F = h, I = S(F.defaultValue ?? null), L = n(P, I), { open: R, fill: z, overlay: B, timeOnly: V, formField: H, inputBind: U, clearBind: W, clearValue: G, modelValue: K, showFooter: q, pickerClass: J, clearIconSize: Y, showClearIcon: X, handleOpenChange: Z, handlePickerChange: Q, handlePickerCancel: $, overlayCustomProps: ee, timePickerCustomProps: te } = s(F, L, M);
|
|
78
|
+
return (e, n) => (x(), d(l, null, [m(T(a), { field: T(H) }, p({
|
|
79
|
+
default: D(() => [f("div", A, [f("input", b(g(T(U))), null, 16), T(X) ? (x(), d("span", v({ key: 0 }, T(W), {
|
|
80
|
+
onClick: n[0] ||= (...e) => T(G) && T(G)(...e),
|
|
81
|
+
"aria-label": T(N)("Clear"),
|
|
82
|
+
onKeydown: [n[1] ||= O(k((...e) => T(G) && T(G)(...e), ["prevent"]), ["enter"]), n[2] ||= O(k((...e) => T(G) && T(G)(...e), ["prevent"]), ["space"])]
|
|
83
|
+
}), [m(T(r), v({
|
|
89
84
|
icon: "clear",
|
|
90
|
-
size: T(
|
|
91
|
-
},
|
|
85
|
+
size: T(Y)
|
|
86
|
+
}, F.customProps?.clearIcon), null, 16, ["size"])], 16, j)) : u("", !0)])]),
|
|
92
87
|
_: 2
|
|
93
|
-
}, [C(T(t)(T(
|
|
88
|
+
}, [C(T(t)(T(i), e.$slots), (t) => ({
|
|
94
89
|
name: t,
|
|
95
90
|
fn: D((n) => [w(e.$slots, t, b(g(n || {})))])
|
|
96
|
-
}))]), 1032, ["field"]), m(T(
|
|
97
|
-
overlay: T(
|
|
98
|
-
"model-value": T(
|
|
99
|
-
"custom-props": T(
|
|
100
|
-
"onUpdate:modelValue": T(
|
|
91
|
+
}))]), 1032, ["field"]), m(T(o), {
|
|
92
|
+
overlay: T(B),
|
|
93
|
+
"model-value": T(R),
|
|
94
|
+
"custom-props": T(ee),
|
|
95
|
+
"onUpdate:modelValue": T(Z)
|
|
101
96
|
}, {
|
|
102
|
-
default: D(() => [m(T(
|
|
103
|
-
fill: T(
|
|
104
|
-
value: T(
|
|
105
|
-
class: y(T(
|
|
106
|
-
ampm: T(
|
|
107
|
-
"show-footer": T(
|
|
108
|
-
"read-only":
|
|
109
|
-
"max-time": T(
|
|
110
|
-
"min-time": T(
|
|
111
|
-
interval: T(
|
|
112
|
-
"time-zone": T(
|
|
113
|
-
onChange: T(
|
|
114
|
-
onCancel: T(
|
|
115
|
-
"show-seconds": T(
|
|
116
|
-
error: T(
|
|
117
|
-
color: T(
|
|
118
|
-
"custom-props": T(
|
|
119
|
-
disabled: T(
|
|
120
|
-
"disable-times": T(
|
|
121
|
-
rounded: T(
|
|
97
|
+
default: D(() => [m(T(c), {
|
|
98
|
+
fill: T(z),
|
|
99
|
+
value: T(K),
|
|
100
|
+
class: y(T(J)),
|
|
101
|
+
ampm: T(V).ampm,
|
|
102
|
+
"show-footer": T(q),
|
|
103
|
+
"read-only": F.readonly,
|
|
104
|
+
"max-time": T(V).maxTime,
|
|
105
|
+
"min-time": T(V).minTime,
|
|
106
|
+
interval: T(V).interval,
|
|
107
|
+
"time-zone": T(V).timeZone,
|
|
108
|
+
onChange: T(Q),
|
|
109
|
+
onCancel: T($),
|
|
110
|
+
"show-seconds": T(V).showSeconds,
|
|
111
|
+
error: T(H).invalidated.value,
|
|
112
|
+
color: T(H).merged.value.color,
|
|
113
|
+
"custom-props": T(te),
|
|
114
|
+
disabled: T(H).isDisabled.value,
|
|
115
|
+
"disable-times": T(V).disableTimes,
|
|
116
|
+
rounded: T(H).merged.value.rounded
|
|
122
117
|
}, p({ _: 2 }, [e.$slots.footer ? {
|
|
123
118
|
name: "footer",
|
|
124
119
|
fn: D((t) => [w(e.$slots, "footer", b(g(t)))]),
|
|
@@ -154,4 +149,4 @@ var j = { class: "flex min-w-0 flex-1 items-center gap-1" }, M = ["aria-label"],
|
|
|
154
149
|
}
|
|
155
150
|
});
|
|
156
151
|
//#endregion
|
|
157
|
-
export {
|
|
152
|
+
export { M as default };
|
|
@@ -451,6 +451,7 @@ export declare function useTimeField(props: TimeFieldOwnProps, model: Ref<null |
|
|
|
451
451
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
452
452
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
453
453
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
454
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
454
455
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
455
456
|
}>>;
|
|
456
457
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
package/dist/Components/TimeRangeField/TimeRangeField.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 { useTimeRangeField as s } from "./composables/useTimeRangeField.js";
|
|
9
|
+
import c from "../TimeRangePicker/TimeRangePicker.js";
|
|
10
|
+
import { Fragment as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeClass as y, normalizeProps as b, openBlock as x, ref as S, renderList as C, renderSlot as w, unref as T, useModel as E, withCtx as D, withKeys as O, withModifiers as k } from "vue";
|
|
11
11
|
//#region src/Components/TimeRangeField/TimeRangeField.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var A = { class: "flex min-w-0 flex-1 items-center gap-1" }, j = ["aria-label"], M = /*@__PURE__*/ h({
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "TimeRangeField",
|
|
15
15
|
props: /*@__PURE__*/ _({
|
|
@@ -74,51 +74,46 @@ var j = { class: "flex min-w-0 flex-1 items-center gap-1" }, M = ["aria-label"],
|
|
|
74
74
|
"open"
|
|
75
75
|
], ["update:modelValue"]),
|
|
76
76
|
setup(h, { emit: _ }) {
|
|
77
|
-
let N = E(h, "modelValue"),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
default: D(() => [f("div", j, [f("input", b(g(T(W))), null, 16), T(Z) ? (x(), d("span", v({ key: 0 }, T(G), {
|
|
85
|
-
onClick: o[0] ||= (...e) => T(K) && T(K)(...e),
|
|
86
|
-
"aria-label": T(I)("Clear"),
|
|
87
|
-
onKeydown: [o[1] ||= O(k((...e) => T(K) && T(K)(...e), ["prevent"]), ["enter"]), o[2] ||= O(k((...e) => T(K) && T(K)(...e), ["prevent"]), ["space"])]
|
|
88
|
-
}), [m(T(n), v({
|
|
77
|
+
let M = e(), N = _, P = E(h, "modelValue"), F = h, I = S(F.defaultValue ?? null), L = n(P, I), { open: R, fill: z, overlay: B, timeOnly: V, formField: H, inputBind: U, clearBind: W, clearValue: G, modelValue: K, showFooter: q, pickerClass: J, clearIconSize: Y, showClearIcon: X, handleOpenChange: Z, handlePickerChange: Q, handlePickerCancel: $, overlayCustomProps: ee, timeRangePickerCustomProps: te } = s(F, L, N);
|
|
78
|
+
return (e, n) => (x(), d(l, null, [m(T(a), { field: T(H) }, p({
|
|
79
|
+
default: D(() => [f("div", A, [f("input", b(g(T(U))), null, 16), T(X) ? (x(), d("span", v({ key: 0 }, T(W), {
|
|
80
|
+
onClick: n[0] ||= (...e) => T(G) && T(G)(...e),
|
|
81
|
+
"aria-label": T(M)("Clear"),
|
|
82
|
+
onKeydown: [n[1] ||= O(k((...e) => T(G) && T(G)(...e), ["prevent"]), ["enter"]), n[2] ||= O(k((...e) => T(G) && T(G)(...e), ["prevent"]), ["space"])]
|
|
83
|
+
}), [m(T(r), v({
|
|
89
84
|
icon: "clear",
|
|
90
|
-
size: T(
|
|
91
|
-
},
|
|
85
|
+
size: T(Y)
|
|
86
|
+
}, F.customProps?.clearIcon), null, 16, ["size"])], 16, j)) : u("", !0)])]),
|
|
92
87
|
_: 2
|
|
93
|
-
}, [C(T(t)(T(
|
|
88
|
+
}, [C(T(t)(T(i), e.$slots), (t) => ({
|
|
94
89
|
name: t,
|
|
95
90
|
fn: D((n) => [w(e.$slots, t, b(g(n || {})))])
|
|
96
|
-
}))]), 1032, ["field"]), m(T(
|
|
97
|
-
overlay: T(
|
|
98
|
-
"model-value": T(
|
|
99
|
-
"custom-props": T(
|
|
100
|
-
"onUpdate:modelValue": T(
|
|
91
|
+
}))]), 1032, ["field"]), m(T(o), {
|
|
92
|
+
overlay: T(B),
|
|
93
|
+
"model-value": T(R),
|
|
94
|
+
"custom-props": T(ee),
|
|
95
|
+
"onUpdate:modelValue": T(Z)
|
|
101
96
|
}, {
|
|
102
|
-
default: D(() => [m(T(
|
|
103
|
-
fill: T(
|
|
104
|
-
value: T(
|
|
105
|
-
class: y(T(
|
|
106
|
-
ampm: T(
|
|
107
|
-
"show-footer": T(
|
|
108
|
-
"read-only":
|
|
109
|
-
"max-time": T(
|
|
110
|
-
"min-time": T(
|
|
111
|
-
interval: T(
|
|
112
|
-
"time-zone": T(
|
|
113
|
-
onChange: T(
|
|
114
|
-
onCancel: T(
|
|
115
|
-
"show-seconds": T(
|
|
116
|
-
error: T(
|
|
117
|
-
color: T(
|
|
118
|
-
disabled: T(
|
|
119
|
-
"disable-times": T(
|
|
120
|
-
rounded: T(
|
|
121
|
-
"custom-props": T(
|
|
97
|
+
default: D(() => [m(T(c), {
|
|
98
|
+
fill: T(z),
|
|
99
|
+
value: T(K),
|
|
100
|
+
class: y(T(J)),
|
|
101
|
+
ampm: T(V).ampm,
|
|
102
|
+
"show-footer": T(q),
|
|
103
|
+
"read-only": F.readonly,
|
|
104
|
+
"max-time": T(V).maxTime,
|
|
105
|
+
"min-time": T(V).minTime,
|
|
106
|
+
interval: T(V).interval,
|
|
107
|
+
"time-zone": T(V).timeZone,
|
|
108
|
+
onChange: T(Q),
|
|
109
|
+
onCancel: T($),
|
|
110
|
+
"show-seconds": T(V).showSeconds,
|
|
111
|
+
error: T(H).invalidated.value,
|
|
112
|
+
color: T(H).merged.value.color,
|
|
113
|
+
disabled: T(H).isDisabled.value,
|
|
114
|
+
"disable-times": T(V).disableTimes,
|
|
115
|
+
rounded: T(H).merged.value.rounded,
|
|
116
|
+
"custom-props": T(te)
|
|
122
117
|
}, p({ _: 2 }, [e.$slots.footer ? {
|
|
123
118
|
name: "footer",
|
|
124
119
|
fn: D((t) => [w(e.$slots, "footer", b(g(t)))]),
|
|
@@ -154,4 +149,4 @@ var j = { class: "flex min-w-0 flex-1 items-center gap-1" }, M = ["aria-label"],
|
|
|
154
149
|
}
|
|
155
150
|
});
|
|
156
151
|
//#endregion
|
|
157
|
-
export {
|
|
152
|
+
export { M as default };
|
|
@@ -451,6 +451,7 @@ export declare function useTimeRangeField(props: TimeRangeFieldOwnProps, model:
|
|
|
451
451
|
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
452
452
|
invalidated: import('vue').ComputedRef<boolean>;
|
|
453
453
|
containerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
454
|
+
"data-bridge-variant": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldVariant | undefined>;
|
|
454
455
|
"data-bridge-rounded": NonNullable<keyof import('@bridge-ui/core/Tokens').FormFieldRounded | undefined>;
|
|
455
456
|
}>>;
|
|
456
457
|
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
package/dist/Utils/index.d.ts
CHANGED
|
@@ -72,3 +72,4 @@ export { useBreakpoint } from './useBreakpoint';
|
|
|
72
72
|
export type { UseBreakpointOptions } from './useBreakpoint';
|
|
73
73
|
export { useHoldRepeat } from './useHoldRepeat';
|
|
74
74
|
export type { HoldRepeatAction, UseHoldRepeatOptions, } from './useHoldRepeat';
|
|
75
|
+
export { useOptionalModel } from './useOptionalModel';
|
package/dist/Utils/index.js
CHANGED
|
@@ -2,64 +2,65 @@ import { useBridgeUI as e } from "../Provider/useBridgeUI.js";
|
|
|
2
2
|
import { RenderFn as t, hasNamedSlot as n, hasSlotOrProp as r, isPropPresent as i, presentSlotNames as a } from "./slotOrProp.js";
|
|
3
3
|
import { useBreakpoint as o } from "./useBreakpoint.js";
|
|
4
4
|
import { useHoldRepeat as s } from "./useHoldRepeat.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { useOptionalModel as c } from "./useOptionalModel.js";
|
|
6
|
+
import { computed as l, defineComponent as u, toValue as d, unref as f } from "vue";
|
|
7
|
+
import { get as p, isNil as m } from "es-toolkit/compat";
|
|
8
|
+
import { resolveFieldShowFooter as h, resolvePickerFill as g } from "@bridge-ui/core/Domain";
|
|
9
|
+
import { createMergeNestedComponentProps as _, createMergePartBind as v, mergeBridgeUILayeredClasses as y, mergePropsWithBridgeUIDefaults as b } from "@bridge-ui/core/Utils";
|
|
9
10
|
//#region src/Utils/index.ts
|
|
10
|
-
function
|
|
11
|
-
return
|
|
11
|
+
function x(e) {
|
|
12
|
+
return u({
|
|
12
13
|
name: "HeadlessTestComponent",
|
|
13
14
|
setup() {
|
|
14
15
|
return e(), () => null;
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
let i = e(), a =
|
|
19
|
+
var S = v("class"), C = _(S);
|
|
20
|
+
function w({ props: t, libDefaults: n, componentName: r }) {
|
|
21
|
+
let i = e(), a = l(() => m(i) ? null : f(i.components));
|
|
21
22
|
return {
|
|
22
|
-
entry:
|
|
23
|
-
if (r) return
|
|
23
|
+
entry: l(() => {
|
|
24
|
+
if (r) return p(a.value, r);
|
|
24
25
|
}),
|
|
25
26
|
bridge: i,
|
|
26
|
-
merged:
|
|
27
|
+
merged: l(() => b({
|
|
27
28
|
libDefaults: n,
|
|
28
29
|
componentName: r,
|
|
29
|
-
props:
|
|
30
|
+
props: d(t),
|
|
30
31
|
components: a.value,
|
|
31
32
|
formDefaults: i?.global.value.formDefaults
|
|
32
33
|
})),
|
|
33
34
|
components: a
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function T({ overlay: t, showFooter: n, componentName: r }) {
|
|
37
38
|
let i = e();
|
|
38
|
-
return
|
|
39
|
-
let e = r ? f(
|
|
39
|
+
return l(() => {
|
|
40
|
+
let e = r ? p(f(i?.components), [
|
|
40
41
|
r,
|
|
41
42
|
"defaultProps",
|
|
42
43
|
"showFooter"
|
|
43
44
|
]) : void 0;
|
|
44
|
-
return
|
|
45
|
+
return h(d(n) ?? e, d(t));
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function E({ fill: t, overlay: n, componentName: r }) {
|
|
48
49
|
let i = e();
|
|
49
|
-
return
|
|
50
|
-
let e = r ? f(
|
|
50
|
+
return l(() => {
|
|
51
|
+
let e = r ? p(f(i?.components), [
|
|
51
52
|
r,
|
|
52
53
|
"defaultProps",
|
|
53
54
|
"fill"
|
|
54
55
|
]) : void 0;
|
|
55
|
-
return
|
|
56
|
+
return g(d(t) ?? e, d(n));
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
59
|
+
function D({ entry: e, props: t }) {
|
|
60
|
+
return l(() => y(p(e.value, "classes"), d(t).classes));
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
62
|
+
function O(e) {
|
|
63
|
+
return p({
|
|
63
64
|
xs: "xs",
|
|
64
65
|
sm: "sm",
|
|
65
66
|
md: "md",
|
|
@@ -69,7 +70,7 @@ function D(e) {
|
|
|
69
70
|
"2xl": "lg"
|
|
70
71
|
}, e ?? "md");
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function k(e) {
|
|
73
74
|
if (e instanceof HTMLElement) return e;
|
|
74
75
|
if (e && "$el" in e) {
|
|
75
76
|
let t = e.$el;
|
|
@@ -78,4 +79,4 @@ function O(e) {
|
|
|
78
79
|
return null;
|
|
79
80
|
}
|
|
80
81
|
//#endregion
|
|
81
|
-
export { t as RenderFn,
|
|
82
|
+
export { t as RenderFn, x as defineHeadlessComponent, n as hasNamedSlot, r as hasSlotOrProp, i as isPropPresent, C as mergeNestedComponentProps, S as mergePartBind, a as presentSlotNames, O as resolveFieldAdornmentIconSize, k as resolveVnodeRefElement, o as useBreakpoint, w as useBridgeUIComponent, D as useBridgeUIMergedRegistryClasses, T as useFieldShowFooter, s as useHoldRepeat, c as useOptionalModel, E as usePickerFill };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Ref, WritableComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Optional `v-model` that keeps `defaultValue` when unbound, and stays empty
|
|
4
|
+
* when the parent sets the bound model to `null`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useOptionalModel<T>(model: Ref<undefined | NoInfer<T>>, uncontrolled: Ref<T>): WritableComputedRef<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { computed as e } from "vue";
|
|
2
|
+
import { isUndefined as t } from "es-toolkit/compat";
|
|
3
|
+
//#region src/Utils/useOptionalModel.ts
|
|
4
|
+
function n(n, r) {
|
|
5
|
+
return e({
|
|
6
|
+
get: () => t(n.value) ? r.value : n.value,
|
|
7
|
+
set: (e) => {
|
|
8
|
+
t(n.value) && (r.value = e), n.value = e;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as useOptionalModel };
|
package/dist/augments.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ declare module "@bridge-ui/core/Config" {
|
|
|
96
96
|
}
|
|
97
97
|
interface NumberFieldConfigOverrides {
|
|
98
98
|
classes: NumberFieldClasses;
|
|
99
|
-
defaultProps: Partial<Pick<NumberFieldProps, "size" | "color" | "rounded" | "variant" | "showErrorIcon" | "hideErrorMessage">>;
|
|
99
|
+
defaultProps: Partial<Pick<NumberFieldProps, "size" | "color" | "rounded" | "variant" | "showErrorIcon" | "controlVariant" | "hideErrorMessage">>;
|
|
100
100
|
}
|
|
101
101
|
interface OtpFieldConfigOverrides {
|
|
102
102
|
classes: OtpFieldClasses;
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export type { MenuClasses, MenuCustomProps, MenuEmits, MenuOptions, MenuOwnProps
|
|
|
87
87
|
export { Modal, useModal } from './Components/Modal';
|
|
88
88
|
export type { ModalAlignOverrides, ModalBlurOverrides, ModalClasses, ModalCustomProps, ModalEmits, ModalOwnProps, ModalProps, ModalSizeOverrides, ModalSlots, } from './Components/Modal';
|
|
89
89
|
export { NumberField, useNumberField } from './Components/NumberField';
|
|
90
|
-
export type { NumberFieldClasses, NumberFieldCustomProps, NumberFieldOwnProps, NumberFieldProps, NumberFieldSlots, } from './Components/NumberField';
|
|
90
|
+
export type { NumberFieldClasses, NumberFieldControlVariantOverrides, NumberFieldCustomProps, NumberFieldOwnProps, NumberFieldProps, NumberFieldSlots, } from './Components/NumberField';
|
|
91
91
|
export { OtpField, useOtpField } from './Components/OtpField';
|
|
92
92
|
export type { OtpFieldClasses, OtpFieldCustomProps, OtpFieldEmits, OtpFieldOwnProps, OtpFieldProps, OtpFieldSlots, UseOtpFieldOptions, } from './Components/OtpField';
|
|
93
93
|
export { Pagination, usePagination } from './Components/Pagination';
|