@bridge-ui/vue 0.0.3 → 0.0.5
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/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +23 -22
- package/dist/Components/Checkbox/checkbox.types.d.ts +7 -6
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -1
- package/dist/Components/Checkbox/composables/useCheckbox.js +2 -1
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +37 -30
- package/dist/Components/NumberField/composables/useNumberField.js +2 -2
- package/dist/Components/NumberField/numberField.types.d.ts +7 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +24 -17
- package/dist/Components/PasswordField/composables/usePasswordField.js +2 -2
- package/dist/Components/PasswordField/passwordField.types.d.ts +7 -0
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/Components/Radio/composables/useRadio.d.ts +1 -1
- package/dist/Components/Radio/composables/useRadio.js +2 -1
- package/dist/Components/Radio/radio.types.d.ts +7 -6
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +60 -54
- package/dist/Components/Select/select.types.d.ts +4 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +1 -1
- package/dist/Components/Switch/Switch.vue.d.ts +3 -3
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/Components/Switch/composables/useSwitch.d.ts +1 -1
- package/dist/Components/Switch/composables/useSwitch.js +2 -1
- package/dist/Components/Switch/switch.types.d.ts +7 -6
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +15 -8
- package/dist/Components/TextField/composables/useTextField.js +7 -4
- package/dist/Components/TextField/textField.types.d.ts +9 -1
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +19 -12
- package/dist/Components/Textarea/composables/useTextarea.js +2 -1
- package/dist/Components/Textarea/textarea.types.d.ts +7 -0
- package/dist/theme.css +12 -12
- package/package.json +2 -2
|
@@ -2,13 +2,13 @@ import { CheckboxOwnProps, CheckboxSlots } from './checkbox.types';
|
|
|
2
2
|
type __VLS_Slots = CheckboxSlots;
|
|
3
3
|
type __VLS_Props = CheckboxOwnProps;
|
|
4
4
|
type __VLS_ModelProps = {
|
|
5
|
-
modelValue?: boolean;
|
|
5
|
+
modelValue?: boolean | undefined;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "../FormControl/FormControl.js";
|
|
2
2
|
import { useCheckbox as t } from "./composables/useCheckbox.js";
|
|
3
|
-
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, openBlock as p,
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Check as
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, openBlock as p, ref as m, unref as h, useAttrs as g, useModel as _, withCtx as v } from "vue";
|
|
4
|
+
import { cn as y } from "@bridge-ui/core";
|
|
5
|
+
import { Check as b } from "@lucide/vue";
|
|
6
6
|
//#region src/Components/Checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var x = ["for"], S = ["checked"], C = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "block h-0.5 w-[55%] rounded-full bg-white"
|
|
10
|
-
},
|
|
10
|
+
}, w = /* @__PURE__ */ s({
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "Checkbox",
|
|
13
13
|
props: /* @__PURE__ */ l({
|
|
14
|
-
checked: { type: Boolean },
|
|
15
14
|
classes: {},
|
|
16
15
|
color: {},
|
|
17
16
|
customProps: {},
|
|
17
|
+
defaultChecked: { type: Boolean },
|
|
18
18
|
indeterminate: { type: Boolean },
|
|
19
19
|
rounded: {},
|
|
20
20
|
size: {},
|
|
@@ -32,38 +32,39 @@ var b = ["for"], x = ["checked"], S = {
|
|
|
32
32
|
}, {
|
|
33
33
|
modelValue: {
|
|
34
34
|
type: Boolean,
|
|
35
|
-
default:
|
|
35
|
+
default: void 0
|
|
36
36
|
},
|
|
37
37
|
modelModifiers: {}
|
|
38
38
|
}),
|
|
39
39
|
emits: ["update:modelValue"],
|
|
40
40
|
setup(s) {
|
|
41
|
-
let l =
|
|
41
|
+
let l = g(), w = s, T = m(!!w.defaultChecked), E = _(s, "modelValue"), { merged: D, iconBind: O, inputRef: k, fieldBind: A, inputBind: j, isChecked: M, formControl: N, controlBind: P } = t(() => ({
|
|
42
42
|
...l,
|
|
43
|
-
...
|
|
43
|
+
...w
|
|
44
44
|
}), {
|
|
45
45
|
size: "md",
|
|
46
46
|
rounded: "sm",
|
|
47
47
|
color: "primary"
|
|
48
|
-
}, n(() =>
|
|
49
|
-
function
|
|
50
|
-
|
|
48
|
+
}, n(() => E.value ?? T.value));
|
|
49
|
+
function F(e) {
|
|
50
|
+
let t = e.target;
|
|
51
|
+
E.value = t.checked, T.value = t.checked;
|
|
51
52
|
}
|
|
52
|
-
return (t, n) => (p(), r(
|
|
53
|
-
default:
|
|
53
|
+
return (t, n) => (p(), r(h(e), { field: h(N) }, {
|
|
54
|
+
default: v(() => [o("label", u(h(A), { for: h(N).controlId.value }), [o("input", u({
|
|
54
55
|
ref_key: "inputRef",
|
|
55
|
-
ref:
|
|
56
|
-
},
|
|
57
|
-
checked:
|
|
58
|
-
onChange:
|
|
59
|
-
}), null, 16,
|
|
56
|
+
ref: k
|
|
57
|
+
}, h(j), {
|
|
58
|
+
checked: h(M),
|
|
59
|
+
onChange: F
|
|
60
|
+
}), null, 16, S), o("span", f(c(h(P))), [h(M) && !h(D).indeterminate ? (p(), r(h(b), {
|
|
60
61
|
key: 0,
|
|
61
62
|
"stroke-width": 3,
|
|
62
|
-
class: d(
|
|
63
|
-
}, null, 8, ["class"])) :
|
|
63
|
+
class: d(h(y)("h-[65%] w-[65%]", h(O).class))
|
|
64
|
+
}, null, 8, ["class"])) : h(D).indeterminate ? (p(), a("span", C)) : i("", !0)], 16)], 16, x)]),
|
|
64
65
|
_: 1
|
|
65
66
|
}, 8, ["field"]));
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
//#endregion
|
|
69
|
-
export {
|
|
70
|
+
export { w as default };
|
|
@@ -39,12 +39,6 @@ export interface CheckboxEmits {
|
|
|
39
39
|
"update:modelValue": [value: boolean];
|
|
40
40
|
}
|
|
41
41
|
export interface CheckboxOwnProps extends Omit<FormControlOwnProps, "field" | "slots" | "classes" | "customProps"> {
|
|
42
|
-
/**
|
|
43
|
-
* Whether the checkbox is checked.
|
|
44
|
-
*
|
|
45
|
-
* @default undefined
|
|
46
|
-
*/
|
|
47
|
-
checked?: boolean;
|
|
48
42
|
/**
|
|
49
43
|
* Classes for the form control chrome and the checkbox control.
|
|
50
44
|
*
|
|
@@ -63,6 +57,13 @@ export interface CheckboxOwnProps extends Omit<FormControlOwnProps, "field" | "s
|
|
|
63
57
|
* @default undefined
|
|
64
58
|
*/
|
|
65
59
|
customProps?: CheckboxCustomProps;
|
|
60
|
+
/**
|
|
61
|
+
* Initial checked state for uncontrolled usage (when `v-model` /
|
|
62
|
+
* `modelValue` is not bound).
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
defaultChecked?: boolean;
|
|
66
67
|
/**
|
|
67
68
|
* Whether the checkbox is in an indeterminate state.
|
|
68
69
|
*
|
|
@@ -229,7 +229,7 @@ export declare function useCheckbox(props: MaybeRefOrGetter<CheckboxOwnProps>, l
|
|
|
229
229
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
230
230
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
231
231
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
232
|
-
}, Partial<Omit<CheckboxOwnProps, "color" | "size" | "classes" | "customProps" | "rounded" | "indeterminate">>>>;
|
|
232
|
+
}, Partial<Omit<CheckboxOwnProps, "color" | "size" | "classes" | "customProps" | "rounded" | "indeterminate" | "defaultChecked">>>>;
|
|
233
233
|
isChecked: import('vue').ComputedRef<boolean>;
|
|
234
234
|
formControl: {
|
|
235
235
|
slots: Readonly<{
|
|
@@ -3,16 +3,18 @@ import { mergePartBind as t, resolveFieldAdornmentIconSize as n } from "../../Ut
|
|
|
3
3
|
import r from "../Icon/Icon.js";
|
|
4
4
|
import i from "../FormField/FormField.js";
|
|
5
5
|
import { useNumberField as a } from "./composables/useNumberField.js";
|
|
6
|
-
import { computed as o, createBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, isRef as f, mergeModels as p, mergeProps as m, normalizeProps as h, openBlock as g,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { computed as o, createBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, isRef as f, mergeModels as p, mergeProps as m, normalizeProps as h, openBlock as g, ref as _, unref as v, useModel as y, vModelDynamic as b, withCtx as x, withDirectives as S } from "vue";
|
|
7
|
+
import { isUndefined as C } from "es-toolkit/compat";
|
|
8
|
+
import { cn as w } from "@bridge-ui/core";
|
|
9
|
+
import { ChevronDown as T, ChevronUp as E } from "@lucide/vue";
|
|
9
10
|
//#region src/Components/NumberField/NumberField.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var D = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overflow-hidden" }, O = /* @__PURE__ */ u({
|
|
11
12
|
inheritAttrs: !1,
|
|
12
13
|
__name: "NumberField",
|
|
13
14
|
props: /* @__PURE__ */ p({
|
|
14
15
|
classes: {},
|
|
15
16
|
customProps: {},
|
|
17
|
+
defaultValue: {},
|
|
16
18
|
max: {},
|
|
17
19
|
min: {},
|
|
18
20
|
step: { default: 1 },
|
|
@@ -41,41 +43,46 @@ var T = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overf
|
|
|
41
43
|
}),
|
|
42
44
|
emits: /* @__PURE__ */ p(["change", "update:modelValue"], ["update:modelValue"]),
|
|
43
45
|
setup(u, { emit: p }) {
|
|
44
|
-
let
|
|
46
|
+
let O = p, k = y(u, "modelValue"), A = u, j = _(A.defaultValue), { decrement: M, formField: N, increment: P, inputBind: F, stringModel: I, mergedClasses: L } = a(A, o({
|
|
47
|
+
set: (e) => {
|
|
48
|
+
k.value = e, j.value = e;
|
|
49
|
+
},
|
|
50
|
+
get: () => C(k.value) ? j.value : k.value
|
|
51
|
+
}), { onChange: (e) => O("change", e) }), R = e(() => P(), () => ({ disabled: A.disabled })), z = e(() => M(), () => ({ disabled: A.disabled })), B = o(() => n(A.size)), V = o(() => t(A.customProps?.increment, {
|
|
45
52
|
type: "button",
|
|
46
|
-
disabled:
|
|
53
|
+
disabled: A.disabled,
|
|
47
54
|
"aria-label": "Increment value",
|
|
48
|
-
onClick:
|
|
49
|
-
onPointerup:
|
|
50
|
-
onPointerdown:
|
|
51
|
-
onLostpointercapture:
|
|
52
|
-
},
|
|
55
|
+
onClick: R.onPressClick,
|
|
56
|
+
onPointerup: R.onPressPointerUp,
|
|
57
|
+
onPointerdown: R.onPressPointerDown,
|
|
58
|
+
onLostpointercapture: R.onPressLostPointerCapture
|
|
59
|
+
}, w({
|
|
53
60
|
"bridge-field-adornment-button inline-flex min-h-0 min-w-8 flex-1 items-center justify-center": !0,
|
|
54
|
-
[
|
|
55
|
-
}))),
|
|
61
|
+
[L.value.increment ?? ""]: !0
|
|
62
|
+
}))), H = o(() => t(A.customProps?.decrement, {
|
|
56
63
|
type: "button",
|
|
57
|
-
disabled:
|
|
64
|
+
disabled: A.disabled,
|
|
58
65
|
"aria-label": "Decrement value",
|
|
59
|
-
onClick:
|
|
60
|
-
onPointerup:
|
|
61
|
-
onPointerdown:
|
|
62
|
-
onLostpointercapture:
|
|
63
|
-
},
|
|
66
|
+
onClick: z.onPressClick,
|
|
67
|
+
onPointerup: z.onPressPointerUp,
|
|
68
|
+
onPointerdown: z.onPressPointerDown,
|
|
69
|
+
onLostpointercapture: z.onPressLostPointerCapture
|
|
70
|
+
}, w({
|
|
64
71
|
"bridge-field-adornment-button inline-flex min-h-0 min-w-8 flex-1 items-center justify-center": !0,
|
|
65
|
-
[
|
|
72
|
+
[L.value.decrement ?? ""]: !0
|
|
66
73
|
})));
|
|
67
|
-
return (e, t) => (g(), s(
|
|
68
|
-
end:
|
|
69
|
-
icon:
|
|
70
|
-
size:
|
|
71
|
-
},
|
|
72
|
-
icon:
|
|
73
|
-
size:
|
|
74
|
-
},
|
|
75
|
-
default:
|
|
74
|
+
return (e, t) => (g(), s(v(i), { field: v(N) }, {
|
|
75
|
+
end: x(() => [c("div", D, [c("button", h(d(V.value)), [l(v(r), m({
|
|
76
|
+
icon: v(E),
|
|
77
|
+
size: B.value
|
|
78
|
+
}, A.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16), c("button", h(d(H.value)), [l(v(r), m({
|
|
79
|
+
icon: v(T),
|
|
80
|
+
size: B.value
|
|
81
|
+
}, A.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)])]),
|
|
82
|
+
default: x(() => [S(c("input", m({ "onUpdate:modelValue": t[0] ||= (e) => f(I) ? I.value = e : null }, v(F)), null, 16), [[b, v(I)]])]),
|
|
76
83
|
_: 1
|
|
77
84
|
}, 8, ["field"]));
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
//#endregion
|
|
81
|
-
export {
|
|
88
|
+
export { O as default };
|
|
@@ -12,10 +12,10 @@ function c(c, l, u = {}) {
|
|
|
12
12
|
entry: p,
|
|
13
13
|
props: () => ({ classes: c.classes })
|
|
14
14
|
}), h = r(() => {
|
|
15
|
-
let { min: e, max: t, step: n, classes: r,
|
|
15
|
+
let { min: e, max: t, step: n, classes: r, defaultValue: i, ...a } = c;
|
|
16
16
|
return {
|
|
17
17
|
...d,
|
|
18
|
-
...
|
|
18
|
+
...a,
|
|
19
19
|
withErrorIcon: !1,
|
|
20
20
|
classes: m.value
|
|
21
21
|
};
|
|
@@ -60,6 +60,13 @@ export interface NumberFieldOwnProps extends Omit<FormFieldOwnProps, "field" | "
|
|
|
60
60
|
* @default undefined
|
|
61
61
|
*/
|
|
62
62
|
customProps?: NumberFieldCustomProps;
|
|
63
|
+
/**
|
|
64
|
+
* Initial value for uncontrolled usage (when `v-model` / `modelValue` is
|
|
65
|
+
* not bound).
|
|
66
|
+
*
|
|
67
|
+
* @default undefined
|
|
68
|
+
*/
|
|
69
|
+
defaultValue?: number;
|
|
63
70
|
/**
|
|
64
71
|
* The maximum value.
|
|
65
72
|
*/
|
|
@@ -2,16 +2,18 @@ import { mergePartBind as e, resolveFieldAdornmentIconSize as t } from "../../Ut
|
|
|
2
2
|
import n from "../Icon/Icon.js";
|
|
3
3
|
import r from "../FormField/FormField.js";
|
|
4
4
|
import { usePasswordField as i } from "./composables/usePasswordField.js";
|
|
5
|
-
import { computed as a, createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeModels as d, mergeProps as f, normalizeProps as p, openBlock as m,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { computed as a, createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeModels as d, mergeProps as f, normalizeProps as p, openBlock as m, ref as h, unref as g, useModel as _, vModelDynamic as v, withCtx as y, withDirectives as b } from "vue";
|
|
6
|
+
import { isUndefined as x } from "es-toolkit/compat";
|
|
7
|
+
import { cn as S } from "@bridge-ui/core";
|
|
8
|
+
import { Eye as C, EyeOff as w } from "@lucide/vue";
|
|
8
9
|
//#region src/Components/PasswordField/PasswordField.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
10
|
+
var T = /* @__PURE__ */ l({
|
|
10
11
|
inheritAttrs: !1,
|
|
11
12
|
__name: "PasswordField",
|
|
12
13
|
props: /* @__PURE__ */ d({
|
|
13
14
|
classes: {},
|
|
14
15
|
customProps: {},
|
|
16
|
+
defaultValue: {},
|
|
15
17
|
visible: {
|
|
16
18
|
type: [null, Boolean],
|
|
17
19
|
default: null
|
|
@@ -43,24 +45,29 @@ var C = /* @__PURE__ */ l({
|
|
|
43
45
|
}),
|
|
44
46
|
emits: /* @__PURE__ */ d(["visibility-change"], ["update:modelValue"]),
|
|
45
47
|
setup(l, { emit: d }) {
|
|
46
|
-
let
|
|
48
|
+
let T = d, E = _(l, "modelValue"), D = l, O = h(D.defaultValue), k = a({
|
|
49
|
+
set: (e) => {
|
|
50
|
+
E.value = e, O.value = e;
|
|
51
|
+
},
|
|
52
|
+
get: () => x(E.value) ? O.value : E.value
|
|
53
|
+
}), { formField: A, inputBind: j, isVisible: M, mergedClasses: N, toggleVisibility: P } = i(D, { onVisibilityChange: (e) => T("visibility-change", e) }), F = a(() => e(D.customProps?.toggle, {
|
|
47
54
|
type: "button",
|
|
48
|
-
disabled:
|
|
49
|
-
onClick:
|
|
50
|
-
"aria-label":
|
|
51
|
-
},
|
|
55
|
+
disabled: D.disabled,
|
|
56
|
+
onClick: P,
|
|
57
|
+
"aria-label": M.value ? "Hide password" : "Show password"
|
|
58
|
+
}, S({
|
|
52
59
|
"bridge-end-adornment bridge-field-adornment-button inline-flex h-full items-center justify-center px-2.5": !0,
|
|
53
|
-
[
|
|
60
|
+
[N.value.toggle ?? ""]: !0
|
|
54
61
|
})));
|
|
55
|
-
return (e, i) => (m(), o(
|
|
56
|
-
end:
|
|
57
|
-
icon:
|
|
58
|
-
size:
|
|
59
|
-
},
|
|
60
|
-
default:
|
|
62
|
+
return (e, i) => (m(), o(g(r), { field: g(A) }, {
|
|
63
|
+
end: y(() => [s("button", p(u(F.value)), [c(g(n), f({
|
|
64
|
+
icon: g(M) ? g(w) : g(C),
|
|
65
|
+
size: g(t)(D.size)
|
|
66
|
+
}, D.customProps?.toggleIcon), null, 16, ["icon", "size"])], 16)]),
|
|
67
|
+
default: y(() => [b(s("input", f({ "onUpdate:modelValue": i[0] ||= (e) => k.value = e }, g(j)), null, 16), [[v, k.value]])]),
|
|
61
68
|
_: 1
|
|
62
69
|
}, 8, ["field"]));
|
|
63
70
|
}
|
|
64
71
|
});
|
|
65
72
|
//#endregion
|
|
66
|
-
export {
|
|
73
|
+
export { T as default };
|
|
@@ -11,10 +11,10 @@ function l(l, u = {}) {
|
|
|
11
11
|
entry: _,
|
|
12
12
|
props: () => ({ classes: l.classes })
|
|
13
13
|
}), y = r(() => {
|
|
14
|
-
let { visible: e, classes: t,
|
|
14
|
+
let { visible: e, classes: t, defaultValue: n, ...r } = l;
|
|
15
15
|
return {
|
|
16
16
|
...d,
|
|
17
|
-
...
|
|
17
|
+
...r,
|
|
18
18
|
withErrorIcon: !1,
|
|
19
19
|
classes: v.value
|
|
20
20
|
};
|
|
@@ -40,6 +40,13 @@ export interface PasswordFieldOwnProps extends Omit<FormFieldOwnProps, "type" |
|
|
|
40
40
|
* @default undefined
|
|
41
41
|
*/
|
|
42
42
|
customProps?: PasswordFieldCustomProps;
|
|
43
|
+
/**
|
|
44
|
+
* Initial value for uncontrolled usage (when `v-model` / `modelValue` is
|
|
45
|
+
* not bound).
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
defaultValue?: string;
|
|
43
50
|
/**
|
|
44
51
|
* Whether the password is visible. Omit for uncontrolled mode.
|
|
45
52
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import e from "../FormControl/FormControl.js";
|
|
2
2
|
import { useRadio as t } from "./composables/useRadio.js";
|
|
3
|
-
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeModels as s, mergeProps as c, normalizeProps as l, openBlock as u,
|
|
4
|
-
import { isNil as
|
|
3
|
+
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeModels as s, mergeProps as c, normalizeProps as l, openBlock as u, ref as d, unref as f, useAttrs as p, useModel as m, withCtx as h } from "vue";
|
|
4
|
+
import { isNil as g } from "es-toolkit/compat";
|
|
5
5
|
//#region src/Components/Radio/Radio.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var _ = ["for"], v = ["checked"], y = /* @__PURE__ */ a({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "Radio",
|
|
9
9
|
props: /* @__PURE__ */ s({
|
|
10
|
-
checked: { type: Boolean },
|
|
11
10
|
classes: {},
|
|
12
11
|
color: {},
|
|
13
12
|
customProps: {},
|
|
13
|
+
defaultChecked: { type: Boolean },
|
|
14
14
|
name: {},
|
|
15
15
|
rounded: {},
|
|
16
16
|
size: {},
|
|
@@ -32,25 +32,25 @@ var g = ["for"], _ = ["checked"], v = /* @__PURE__ */ a({
|
|
|
32
32
|
}),
|
|
33
33
|
emits: ["update:modelValue"],
|
|
34
34
|
setup(a) {
|
|
35
|
-
let s =
|
|
35
|
+
let s = p(), y = a, b = m(a, "modelValue"), x = d(!!y.defaultChecked), { merged: S, dotBind: C, fieldBind: w, inputBind: T, isChecked: E, formControl: D, controlBind: O } = t(() => ({
|
|
36
36
|
...s,
|
|
37
|
-
...
|
|
37
|
+
...y
|
|
38
38
|
}), {
|
|
39
39
|
size: "md",
|
|
40
40
|
rounded: "full",
|
|
41
41
|
color: "primary"
|
|
42
|
-
}, n(() => y.value));
|
|
43
|
-
function
|
|
44
|
-
|
|
42
|
+
}, n(() => g(b.value) && x.value ? y.value : b.value));
|
|
43
|
+
function k() {
|
|
44
|
+
x.value = !0, g(S.value.value) || (b.value = S.value.value);
|
|
45
45
|
}
|
|
46
|
-
return (t, n) => (u(), r(
|
|
47
|
-
default:
|
|
48
|
-
checked:
|
|
49
|
-
onChange:
|
|
50
|
-
}), null, 16,
|
|
46
|
+
return (t, n) => (u(), r(f(e), { field: f(D) }, {
|
|
47
|
+
default: h(() => [i("label", c(f(w), { for: f(D).controlId.value }), [i("input", c(f(T), {
|
|
48
|
+
checked: f(E),
|
|
49
|
+
onChange: k
|
|
50
|
+
}), null, 16, v), i("span", l(o(f(O))), [i("span", l(o(f(C))), null, 16)], 16)], 16, _)]),
|
|
51
51
|
_: 1
|
|
52
52
|
}, 8, ["field"]));
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
//#endregion
|
|
56
|
-
export {
|
|
56
|
+
export { y as default };
|
|
@@ -228,7 +228,7 @@ export declare function useRadio(props: MaybeRefOrGetter<RadioOwnProps>, libDefa
|
|
|
228
228
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
229
229
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
230
230
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
231
|
-
}, Partial<Omit<RadioOwnProps, "color" | "name" | "size" | "value" | "classes" | "customProps" | "rounded">>>>;
|
|
231
|
+
}, Partial<Omit<RadioOwnProps, "color" | "name" | "size" | "value" | "classes" | "customProps" | "rounded" | "defaultChecked">>>>;
|
|
232
232
|
isChecked: import('vue').ComputedRef<boolean>;
|
|
233
233
|
formControl: {
|
|
234
234
|
slots: Readonly<{
|
|
@@ -39,12 +39,6 @@ export interface RadioEmits {
|
|
|
39
39
|
"update:modelValue": [value: number | string];
|
|
40
40
|
}
|
|
41
41
|
export interface RadioOwnProps extends Omit<FormControlOwnProps, "field" | "slots" | "classes" | "customProps"> {
|
|
42
|
-
/**
|
|
43
|
-
* Whether the radio is checked.
|
|
44
|
-
*
|
|
45
|
-
* @default undefined
|
|
46
|
-
*/
|
|
47
|
-
checked?: boolean;
|
|
48
42
|
/**
|
|
49
43
|
* Classes for the form control chrome and the radio control.
|
|
50
44
|
*
|
|
@@ -63,6 +57,13 @@ export interface RadioOwnProps extends Omit<FormControlOwnProps, "field" | "slot
|
|
|
63
57
|
* @default undefined
|
|
64
58
|
*/
|
|
65
59
|
customProps?: RadioCustomProps;
|
|
60
|
+
/**
|
|
61
|
+
* Initial selected state for uncontrolled usage (when `v-model` /
|
|
62
|
+
* `modelValue` is not bound). For interactive groups, prefer `v-model`.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
defaultChecked?: boolean;
|
|
66
67
|
/**
|
|
67
68
|
* The `name` attribute shared by radios in the same group.
|
|
68
69
|
*
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergeNestedComponentProps as n } from "../../Utils/index.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import r from "../Icon/Icon.js";
|
|
4
|
+
import ee from "../Chip/Chip.js";
|
|
5
5
|
import i from "../FormField/FormField.js";
|
|
6
6
|
import a from "../Listbox/Listbox.js";
|
|
7
7
|
import { useSelect as o } from "./composables/useSelect.js";
|
|
8
8
|
import { SELECT_OPTION_KEY as s } from "./selectInjectionKey.js";
|
|
9
|
-
import { Fragment as c,
|
|
10
|
-
import {
|
|
9
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as te, createTextVNode as ne, createVNode as m, defineComponent as h, guardReactiveProps as g, isRef as _, mergeModels as v, mergeProps as y, normalizeProps as b, openBlock as x, provide as re, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as ie, unref as E, useModel as ae, useTemplateRef as D, withCtx as O, withKeys as k, withModifiers as A } from "vue";
|
|
10
|
+
import { isUndefined as j } from "es-toolkit/compat";
|
|
11
|
+
import { X as M } from "@lucide/vue";
|
|
11
12
|
//#region src/Components/Select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
13
|
+
var N = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
|
|
15
|
-
},
|
|
16
|
+
}, P = {
|
|
16
17
|
key: 1,
|
|
17
18
|
class: "flex min-w-0 flex-1 items-center gap-1"
|
|
18
|
-
},
|
|
19
|
+
}, F = {
|
|
19
20
|
key: 0,
|
|
20
21
|
hidden: "",
|
|
21
22
|
"aria-hidden": "true"
|
|
22
|
-
},
|
|
23
|
+
}, I = /* @__PURE__ */ h({
|
|
23
24
|
inheritAttrs: !1,
|
|
24
25
|
__name: "Select",
|
|
25
|
-
props: /* @__PURE__ */
|
|
26
|
+
props: /* @__PURE__ */ v({
|
|
26
27
|
asyncData: {},
|
|
27
28
|
clearable: {
|
|
28
29
|
type: Boolean,
|
|
@@ -77,7 +78,7 @@ var F = {
|
|
|
77
78
|
modelValue: {},
|
|
78
79
|
modelModifiers: {}
|
|
79
80
|
}),
|
|
80
|
-
emits: /* @__PURE__ */
|
|
81
|
+
emits: /* @__PURE__ */ v([
|
|
81
82
|
"change",
|
|
82
83
|
"clear",
|
|
83
84
|
"close",
|
|
@@ -87,9 +88,14 @@ var F = {
|
|
|
87
88
|
"select",
|
|
88
89
|
"update:modelValue"
|
|
89
90
|
], ["update:modelValue"]),
|
|
90
|
-
setup(
|
|
91
|
-
let
|
|
92
|
-
|
|
91
|
+
setup(h, { emit: v }) {
|
|
92
|
+
let I = ae(h, "modelValue"), L = h, R = v, z = S(L.defaultValue), B = l({
|
|
93
|
+
set: (e) => {
|
|
94
|
+
I.value = e, z.value = e;
|
|
95
|
+
},
|
|
96
|
+
get: () => j(I.value) ? z.value : I.value
|
|
97
|
+
}), V = D("trigger"), H = S([]);
|
|
98
|
+
re(s, {
|
|
93
99
|
unregister(e) {
|
|
94
100
|
H.value = H.value.filter((t) => String(t.value) !== String(e));
|
|
95
101
|
},
|
|
@@ -97,76 +103,76 @@ var F = {
|
|
|
97
103
|
H.value.some((t) => String(t.value) === String(e.value)) || (H.value = [...H.value, e]);
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
|
-
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip:
|
|
101
|
-
return (o, s) => (
|
|
102
|
-
|
|
103
|
-
default:
|
|
106
|
+
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: oe, triggerBind: Z, selectOption: se, containerRef: ce, listboxProps: le, clearIconSize: ue, mergedClasses: Q, selectedOptions: de, hasComposedList: $, handleRegisteredOptionsChange: fe } = o(L, B, V, R, H);
|
|
107
|
+
return (o, s) => (x(), f(c, null, [
|
|
108
|
+
m(E(i), { field: E(q) }, {
|
|
109
|
+
default: O(() => [E(K) ? (x(), f("div", N, [(x(!0), f(c, null, C(E(de), (e) => (x(), u(E(ee), y({
|
|
104
110
|
dismissible: "",
|
|
105
111
|
key: String(e.value),
|
|
106
|
-
size:
|
|
107
|
-
disabled:
|
|
112
|
+
size: E(q).merged.value.size,
|
|
113
|
+
disabled: E(q).isDisabled.value,
|
|
108
114
|
"clear-label": `Remove ${e.label}`,
|
|
109
|
-
onDismiss: (t) =>
|
|
110
|
-
}, { ref_for: !0 },
|
|
111
|
-
classes: { root:
|
|
112
|
-
customProps: { clear:
|
|
115
|
+
onDismiss: (t) => E(oe)(e, t)
|
|
116
|
+
}, { ref_for: !0 }, E(n)(L.customProps?.chip, {
|
|
117
|
+
classes: { root: E(Q).chip },
|
|
118
|
+
customProps: { clear: E(Y) }
|
|
113
119
|
})), {
|
|
114
|
-
default:
|
|
120
|
+
default: O(() => [w(o.$slots, "chip", { option: e }, () => [ne(ie(e.label), 1)])]),
|
|
115
121
|
_: 2
|
|
116
122
|
}, 1040, [
|
|
117
123
|
"size",
|
|
118
124
|
"disabled",
|
|
119
125
|
"clear-label",
|
|
120
126
|
"onDismiss"
|
|
121
|
-
]))), 128)),
|
|
127
|
+
]))), 128)), p("textarea", y({ ref: "trigger" }, E(Z)), null, 16)])) : (x(), f("div", P, [p("input", y({
|
|
122
128
|
ref: "trigger",
|
|
123
129
|
class: "min-w-0 flex-1"
|
|
124
|
-
},
|
|
125
|
-
onClick: s[0] ||= (...e) =>
|
|
130
|
+
}, E(Z)), null, 16), E(J) && E(G) && !E(q).isDisabled.value ? (x(), f("span", y({ key: 0 }, E(Y), {
|
|
131
|
+
onClick: s[0] ||= (...e) => E(X) && E(X)(...e),
|
|
126
132
|
"aria-label": "Clear selection",
|
|
127
|
-
onKeydown: [s[1] ||=
|
|
128
|
-
}), [
|
|
129
|
-
icon:
|
|
130
|
-
size:
|
|
131
|
-
},
|
|
133
|
+
onKeydown: [s[1] ||= k(A((...e) => E(X) && E(X)(...e), ["prevent"]), ["enter"]), s[2] ||= k(A((...e) => E(X) && E(X)(...e), ["prevent"]), ["space"])]
|
|
134
|
+
}), [m(E(r), y({
|
|
135
|
+
icon: E(M),
|
|
136
|
+
size: E(ue)
|
|
137
|
+
}, L.customProps?.clearIcon), null, 16, ["icon", "size"])], 16)) : d("", !0)]))]),
|
|
132
138
|
_: 3
|
|
133
139
|
}, 8, ["field"]),
|
|
134
|
-
|
|
135
|
-
modelValue:
|
|
136
|
-
"onUpdate:modelValue": s[3] ||= (e) =>
|
|
137
|
-
},
|
|
138
|
-
"anchor-el":
|
|
139
|
-
onSelect:
|
|
140
|
-
onRegisteredOptionsChange:
|
|
141
|
-
}),
|
|
142
|
-
|
|
140
|
+
m(E(a), y({
|
|
141
|
+
modelValue: E(U),
|
|
142
|
+
"onUpdate:modelValue": s[3] ||= (e) => _(U) ? U.value = e : null
|
|
143
|
+
}, E(le), {
|
|
144
|
+
"anchor-el": E(ce),
|
|
145
|
+
onSelect: E(se),
|
|
146
|
+
onRegisteredOptionsChange: E(fe)
|
|
147
|
+
}), te({ _: 2 }, [
|
|
148
|
+
E($) ? {
|
|
143
149
|
name: "default",
|
|
144
|
-
fn:
|
|
150
|
+
fn: O(() => [w(o.$slots, "default")]),
|
|
145
151
|
key: "0"
|
|
146
152
|
} : void 0,
|
|
147
|
-
|
|
153
|
+
E(e)(E(W), "beforeOptions") ? {
|
|
148
154
|
name: "beforeOptions",
|
|
149
|
-
fn:
|
|
155
|
+
fn: O(() => [(x(), u(T(E(t)(E(W), "beforeOptions"))))]),
|
|
150
156
|
key: "1"
|
|
151
157
|
} : void 0,
|
|
152
|
-
|
|
158
|
+
E(e)(E(W), "loading") ? {
|
|
153
159
|
name: "loading",
|
|
154
|
-
fn:
|
|
160
|
+
fn: O(() => [(x(), u(T(E(t)(E(W), "loading"))))]),
|
|
155
161
|
key: "2"
|
|
156
162
|
} : void 0,
|
|
157
|
-
|
|
163
|
+
E(e)(E(W), "option") ? {
|
|
158
164
|
name: "option",
|
|
159
|
-
fn:
|
|
165
|
+
fn: O((e) => [w(o.$slots, "option", b(g(e)))]),
|
|
160
166
|
key: "3"
|
|
161
167
|
} : void 0,
|
|
162
|
-
|
|
168
|
+
E(e)(E(W), "empty") ? {
|
|
163
169
|
name: "empty",
|
|
164
|
-
fn:
|
|
170
|
+
fn: O(() => [(x(), u(T(E(t)(E(W), "empty"))))]),
|
|
165
171
|
key: "4"
|
|
166
172
|
} : void 0,
|
|
167
|
-
|
|
173
|
+
E(e)(E(W), "afterOptions") ? {
|
|
168
174
|
name: "afterOptions",
|
|
169
|
-
fn:
|
|
175
|
+
fn: O(() => [(x(), u(T(E(t)(E(W), "afterOptions"))))]),
|
|
170
176
|
key: "5"
|
|
171
177
|
} : void 0
|
|
172
178
|
]), 1040, [
|
|
@@ -175,9 +181,9 @@ var F = {
|
|
|
175
181
|
"onSelect",
|
|
176
182
|
"onRegisteredOptionsChange"
|
|
177
183
|
]),
|
|
178
|
-
|
|
184
|
+
E($) ? d("", !0) : (x(), f("div", F, [w(o.$slots, "default")]))
|
|
179
185
|
], 64));
|
|
180
186
|
}
|
|
181
187
|
});
|
|
182
188
|
//#endregion
|
|
183
|
-
export {
|
|
189
|
+
export { I as default };
|
|
@@ -120,7 +120,10 @@ export interface SelectOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
|
120
120
|
*/
|
|
121
121
|
customProps?: SelectCustomProps;
|
|
122
122
|
/**
|
|
123
|
-
* Initial value when
|
|
123
|
+
* Initial value for uncontrolled usage (when `v-model` / `modelValue` is
|
|
124
|
+
* not bound).
|
|
125
|
+
*
|
|
126
|
+
* @default undefined
|
|
124
127
|
*/
|
|
125
128
|
defaultValue?: SelectModel;
|
|
126
129
|
/**
|
|
@@ -2,13 +2,13 @@ import { SwitchOwnProps, SwitchSlots } from './switch.types';
|
|
|
2
2
|
type __VLS_Slots = SwitchSlots;
|
|
3
3
|
type __VLS_Props = SwitchOwnProps;
|
|
4
4
|
type __VLS_ModelProps = {
|
|
5
|
-
modelValue?: boolean;
|
|
5
|
+
modelValue?: boolean | undefined;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
-
"update:modelValue": (value: boolean) => any;
|
|
9
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import e from "../FormControl/FormControl.js";
|
|
2
2
|
import { useSwitch as t } from "./composables/useSwitch.js";
|
|
3
|
-
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeModels as s, mergeProps as c, normalizeProps as l, openBlock as u,
|
|
3
|
+
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeModels as s, mergeProps as c, normalizeProps as l, openBlock as u, ref as d, unref as f, useAttrs as p, useModel as m, withCtx as h } from "vue";
|
|
4
4
|
//#region src/Components/Switch/Switch.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var g = ["checked"], _ = /* @__PURE__ */ a({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "Switch",
|
|
8
8
|
props: /* @__PURE__ */ s({
|
|
9
|
-
checked: { type: Boolean },
|
|
10
9
|
classes: {},
|
|
11
10
|
color: {},
|
|
12
11
|
customProps: {},
|
|
12
|
+
defaultChecked: { type: Boolean },
|
|
13
13
|
rounded: {},
|
|
14
14
|
size: {},
|
|
15
15
|
slots: {},
|
|
@@ -26,35 +26,36 @@ var h = ["checked"], g = /* @__PURE__ */ a({
|
|
|
26
26
|
}, {
|
|
27
27
|
modelValue: {
|
|
28
28
|
type: Boolean,
|
|
29
|
-
default:
|
|
29
|
+
default: void 0
|
|
30
30
|
},
|
|
31
31
|
modelModifiers: {}
|
|
32
32
|
}),
|
|
33
33
|
emits: ["update:modelValue"],
|
|
34
34
|
setup(a) {
|
|
35
|
-
let s =
|
|
35
|
+
let s = p(), _ = a, v = d(!!_.defaultChecked), y = m(a, "modelValue"), { fieldBind: b, inputBind: x, isChecked: S, thumbBind: C, trackBind: w, formControl: T } = t(() => ({
|
|
36
36
|
...s,
|
|
37
|
-
...
|
|
37
|
+
..._
|
|
38
38
|
}), {
|
|
39
39
|
size: "md",
|
|
40
40
|
rounded: "full",
|
|
41
41
|
color: "primary"
|
|
42
|
-
}, n(() =>
|
|
43
|
-
function
|
|
44
|
-
|
|
42
|
+
}, n(() => y.value ?? v.value));
|
|
43
|
+
function E(e) {
|
|
44
|
+
let t = e.target;
|
|
45
|
+
y.value = t.checked, v.value = t.checked;
|
|
45
46
|
}
|
|
46
|
-
return (t, n) => (u(), r(
|
|
47
|
-
default:
|
|
48
|
-
i("input", c(
|
|
49
|
-
checked:
|
|
50
|
-
onChange:
|
|
51
|
-
}), null, 16,
|
|
52
|
-
i("span", l(o(
|
|
53
|
-
i("span", l(o(
|
|
47
|
+
return (t, n) => (u(), r(f(e), { field: f(T) }, {
|
|
48
|
+
default: h(() => [i("label", l(o(f(b))), [
|
|
49
|
+
i("input", c(f(x), {
|
|
50
|
+
checked: f(S),
|
|
51
|
+
onChange: E
|
|
52
|
+
}), null, 16, g),
|
|
53
|
+
i("span", l(o(f(w))), null, 16),
|
|
54
|
+
i("span", l(o(f(C))), null, 16)
|
|
54
55
|
], 16)]),
|
|
55
56
|
_: 1
|
|
56
57
|
}, 8, ["field"]));
|
|
57
58
|
}
|
|
58
59
|
});
|
|
59
60
|
//#endregion
|
|
60
|
-
export {
|
|
61
|
+
export { _ as default };
|
|
@@ -225,7 +225,7 @@ export declare function useSwitch(props: MaybeRefOrGetter<SwitchOwnProps>, libDe
|
|
|
225
225
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
226
226
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
227
227
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
228
|
-
}, Partial<Omit<SwitchOwnProps, "color" | "size" | "classes" | "customProps" | "rounded">>>>;
|
|
228
|
+
}, Partial<Omit<SwitchOwnProps, "color" | "size" | "classes" | "customProps" | "rounded" | "defaultChecked">>>>;
|
|
229
229
|
isChecked: import('vue').ComputedRef<boolean>;
|
|
230
230
|
thumbBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').InputHTMLAttributes | undefined, {
|
|
231
231
|
"aria-hidden": boolean;
|
|
@@ -39,12 +39,6 @@ export interface SwitchEmits {
|
|
|
39
39
|
"update:modelValue": [value: boolean];
|
|
40
40
|
}
|
|
41
41
|
export interface SwitchOwnProps extends Omit<FormControlOwnProps, "field" | "slots" | "classes" | "customProps"> {
|
|
42
|
-
/**
|
|
43
|
-
* Whether the switch is on.
|
|
44
|
-
*
|
|
45
|
-
* @default undefined
|
|
46
|
-
*/
|
|
47
|
-
checked?: boolean;
|
|
48
42
|
/**
|
|
49
43
|
* Classes for the form control chrome and the switch control.
|
|
50
44
|
*
|
|
@@ -63,6 +57,13 @@ export interface SwitchOwnProps extends Omit<FormControlOwnProps, "field" | "slo
|
|
|
63
57
|
* @default undefined
|
|
64
58
|
*/
|
|
65
59
|
customProps?: SwitchCustomProps;
|
|
60
|
+
/**
|
|
61
|
+
* Initial on state for uncontrolled usage (when `v-model` / `modelValue`
|
|
62
|
+
* is not bound).
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
defaultChecked?: boolean;
|
|
66
67
|
/**
|
|
67
68
|
* The roundedness of the switch track.
|
|
68
69
|
*
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import e from "../FormField/FormField.js";
|
|
2
2
|
import { useTextField as t } from "./composables/useTextField.js";
|
|
3
|
-
import {
|
|
3
|
+
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, openBlock as c, ref as l, unref as u, useModel as d, vModelDynamic as f, withCtx as p, withDirectives as m } from "vue";
|
|
4
|
+
import { isUndefined as h } from "es-toolkit/compat";
|
|
4
5
|
//#region src/Components/TextField/TextField.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var g = /* @__PURE__ */ a({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "TextField",
|
|
8
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ o({
|
|
10
|
+
defaultValue: {},
|
|
9
11
|
classes: {},
|
|
10
12
|
color: {},
|
|
11
13
|
controlId: {},
|
|
@@ -37,13 +39,18 @@ var p = /* @__PURE__ */ i({
|
|
|
37
39
|
modelModifiers: {}
|
|
38
40
|
}),
|
|
39
41
|
emits: ["update:modelValue"],
|
|
40
|
-
setup(
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
setup(a) {
|
|
43
|
+
let o = d(a, "modelValue"), g = a, _ = l(g.defaultValue), v = n({
|
|
44
|
+
set: (e) => {
|
|
45
|
+
o.value = e, _.value = e;
|
|
46
|
+
},
|
|
47
|
+
get: () => h(o.value) ? _.value : o.value
|
|
48
|
+
}), { formField: y, inputBind: b } = t(g);
|
|
49
|
+
return (t, n) => (c(), r(u(e), { field: u(y) }, {
|
|
50
|
+
default: p(() => [m(i("input", s({ "onUpdate:modelValue": n[0] ||= (e) => v.value = e }, u(b)), null, 16), [[f, v.value]])]),
|
|
44
51
|
_: 1
|
|
45
52
|
}, 8, ["field"]));
|
|
46
53
|
}
|
|
47
54
|
});
|
|
48
55
|
//#endregion
|
|
49
|
-
export {
|
|
56
|
+
export { g as default };
|
|
@@ -2,10 +2,13 @@ import { useFormField as e } from "../../FormField/composables/useFormField.js";
|
|
|
2
2
|
import { useAttrs as t } from "vue";
|
|
3
3
|
//#region src/Components/TextField/composables/useTextField.ts
|
|
4
4
|
function n(n) {
|
|
5
|
-
let r = t(), i = e(() =>
|
|
6
|
-
...
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let r = t(), i = e(() => {
|
|
6
|
+
let { defaultValue: e, ...t } = n;
|
|
7
|
+
return {
|
|
8
|
+
...r,
|
|
9
|
+
...t
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
9
12
|
size: "md",
|
|
10
13
|
rounded: "md",
|
|
11
14
|
color: "primary",
|
|
@@ -3,7 +3,15 @@ import { MergeHtmlProps } from '@bridge-ui/core';
|
|
|
3
3
|
import { FormFieldClasses, FormFieldCustomProps, FormFieldOwnProps, FormFieldSlots } from '../FormField/formField.types';
|
|
4
4
|
export interface TextFieldClasses extends FormFieldClasses {}
|
|
5
5
|
export interface TextFieldCustomProps extends FormFieldCustomProps {}
|
|
6
|
-
export interface TextFieldOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
6
|
+
export interface TextFieldOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
7
|
+
/**
|
|
8
|
+
* Initial value for uncontrolled usage (when `v-model` / `modelValue` is
|
|
9
|
+
* not bound).
|
|
10
|
+
*
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
}
|
|
7
15
|
export interface TextFieldSlots extends FormFieldSlots {}
|
|
8
16
|
export type TextFieldProps = MergeHtmlProps<TextFieldOwnProps, InputHTMLAttributes> & {
|
|
9
17
|
/**
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import e from "../FormField/FormField.js";
|
|
2
2
|
import { useTextarea as t } from "./composables/useTextarea.js";
|
|
3
|
-
import {
|
|
3
|
+
import { computed as n, createBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, openBlock as c, ref as l, unref as u, useModel as d, useTemplateRef as f, vModelText as p, watch as m, withCtx as h, withDirectives as g } from "vue";
|
|
4
|
+
import { isUndefined as _ } from "es-toolkit/compat";
|
|
4
5
|
//#region src/Components/Textarea/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var v = /* @__PURE__ */ a({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "Textarea",
|
|
8
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ o({
|
|
9
10
|
autosize: { type: Boolean },
|
|
11
|
+
defaultValue: {},
|
|
10
12
|
likeInput: { type: Boolean },
|
|
11
13
|
resize: {},
|
|
12
14
|
classes: {},
|
|
@@ -40,18 +42,23 @@ var h = /* @__PURE__ */ i({
|
|
|
40
42
|
modelModifiers: {}
|
|
41
43
|
}),
|
|
42
44
|
emits: ["update:modelValue"],
|
|
43
|
-
setup(
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
setup(a) {
|
|
46
|
+
let o = d(a, "modelValue"), v = a, y = l(v.defaultValue), b = n({
|
|
47
|
+
set: (e) => {
|
|
48
|
+
o.value = e, y.value = e;
|
|
49
|
+
},
|
|
50
|
+
get: () => _(o.value) ? y.value : o.value
|
|
51
|
+
}), x = f("textarea"), { formField: S, textareaBind: C, adjustHeight: w } = t(v, x);
|
|
52
|
+
return m(b, () => {
|
|
53
|
+
w(x.value);
|
|
54
|
+
}), (t, n) => (c(), r(u(e), { field: u(S) }, {
|
|
55
|
+
default: h(() => [g(i("textarea", s({
|
|
49
56
|
ref: "textarea",
|
|
50
|
-
"onUpdate:modelValue":
|
|
51
|
-
},
|
|
57
|
+
"onUpdate:modelValue": n[0] ||= (e) => b.value = e
|
|
58
|
+
}, u(C)), null, 16), [[p, b.value]])]),
|
|
52
59
|
_: 1
|
|
53
60
|
}, 8, ["field"]));
|
|
54
61
|
}
|
|
55
62
|
});
|
|
56
63
|
//#endregion
|
|
57
|
-
export {
|
|
64
|
+
export { v as default };
|
|
@@ -11,6 +11,13 @@ export interface TextareaOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
|
11
11
|
* Defaults to `true` when `likeInput` is set; otherwise `false`.
|
|
12
12
|
*/
|
|
13
13
|
autosize?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Initial value for uncontrolled usage (when `v-model` / `modelValue` is
|
|
16
|
+
* not bound).
|
|
17
|
+
*
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
defaultValue?: string;
|
|
14
21
|
/**
|
|
15
22
|
* Use compact TextField-like sizing instead of the default multiline textarea profile.
|
|
16
23
|
* Enables `autosize` and `rows={1}` by default; both can be overridden explicitly.
|
package/dist/theme.css
CHANGED
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
--color-dark-900: var(--color-slate-900);
|
|
30
30
|
--color-dark-950: var(--color-slate-950);
|
|
31
31
|
|
|
32
|
-
/* Primary (
|
|
33
|
-
--color-primary-50: var(--color-
|
|
34
|
-
--color-primary-100: var(--color-
|
|
35
|
-
--color-primary-200: var(--color-
|
|
36
|
-
--color-primary-300: var(--color-
|
|
37
|
-
--color-primary-400: var(--color-
|
|
38
|
-
--color-primary-500: var(--color-
|
|
39
|
-
--color-primary-600: var(--color-
|
|
40
|
-
--color-primary-700: var(--color-
|
|
41
|
-
--color-primary-800: var(--color-
|
|
42
|
-
--color-primary-900: var(--color-
|
|
43
|
-
--color-primary-950: var(--color-
|
|
32
|
+
/* Primary (teal) */
|
|
33
|
+
--color-primary-50: var(--color-teal-50);
|
|
34
|
+
--color-primary-100: var(--color-teal-100);
|
|
35
|
+
--color-primary-200: var(--color-teal-200);
|
|
36
|
+
--color-primary-300: var(--color-teal-300);
|
|
37
|
+
--color-primary-400: var(--color-teal-400);
|
|
38
|
+
--color-primary-500: var(--color-teal-500);
|
|
39
|
+
--color-primary-600: var(--color-teal-600);
|
|
40
|
+
--color-primary-700: var(--color-teal-700);
|
|
41
|
+
--color-primary-800: var(--color-teal-800);
|
|
42
|
+
--color-primary-900: var(--color-teal-900);
|
|
43
|
+
--color-primary-950: var(--color-teal-950);
|
|
44
44
|
|
|
45
45
|
/* Secondary (amber) */
|
|
46
46
|
--color-secondary-50: var(--color-amber-50);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dist"
|
|
61
61
|
],
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@bridge-ui/core": "^0.0.
|
|
63
|
+
"@bridge-ui/core": "^0.0.5",
|
|
64
64
|
"@lucide/vue": ">=1.0.0",
|
|
65
65
|
"vue": "^3.4.0"
|
|
66
66
|
},
|