brutx-ui-vue 0.9.9 → 0.9.10
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/chunks/{AuthCard-DAk6Q3n2.js → AuthCard-DeACCtKv.js} +1 -1
- package/dist/chunks/{DataTable-v6odfpSY.js → DataTable-S5luTeKx.js} +2 -2
- package/dist/chunks/{FeedbackForm-Bj38uGf-.js → FeedbackForm-xqjfiPHv.js} +2 -2
- package/dist/chunks/{HardcoreInput-b6-eON5f.js → HardcoreInput-DgMpsS2d.js} +40 -31
- package/dist/chunks/{Input-Cgt7mldw.js → Input-qKeVv2nE.js} +35 -25
- package/dist/chunks/{KanbanBoard-CsmS0Sr-.js → KanbanBoard-DPBZJwqL.js} +2 -2
- package/dist/chunks/{NoiseBackground-MyEeaFgH.js → NoiseBackground-u5ie1E_M.js} +1 -2
- package/dist/chunks/{Pagination-D94MJ-5i.js → Pagination-TPDhgBtp.js} +1 -1
- package/dist/chunks/ScratchCard-CSnH0QrE.js +100 -0
- package/dist/chunks/{SelectSeparator-B4kviEmv.js → SelectSeparator-PCTmI70q.js} +21 -20
- package/dist/chunks/{SkeletonTable-jS8HiisA.js → SkeletonTable-Y3mmt4Ru.js} +1 -0
- package/dist/chunks/{Slider-DxFWq588.js → Slider-DOfELoQi.js} +46 -46
- package/dist/chunks/{Stepper-D49v7iMb.js → Stepper-DrciUcXp.js} +9 -9
- package/dist/chunks/{SubMenu-oD7qBrtZ.js → SubMenu-DIYKb1P3.js} +31 -24
- package/dist/chunks/{TableCaption-C-DUnkXx.js → TableCaption-BOGu3F4m.js} +1 -1
- package/dist/chunks/{Tabs-5NGmdnfd.js → Tabs-C1TspMAr.js} +51 -43
- package/dist/chunks/{TagsInputItemDelete-CTHZCMUY.js → TagsInputItemDelete-xHFI-gXR.js} +12 -8
- package/dist/chunks/{Textarea-BWwVFvYd.js → Textarea-zK2n7NrR.js} +19 -9
- package/dist/chunks/{Tour-BZGKQNf7.js → Tour-xVANZOcM.js} +9 -1
- package/dist/chunks/{Transfer-BcLrawvV.js → Transfer-BQeH3qg4.js} +3 -3
- package/dist/chunks/{TreeSelect-Dt2UiMnG.js → TreeSelect-CZkeUsxa.js} +131 -114
- package/dist/chunks/{TreeView-B7ETE04q.js → TreeView-CVv06aG0.js} +123 -123
- package/dist/chunks/{UploadFileList-CWrGZQo3.js → UploadFileList-Galy0yYT.js} +107 -97
- package/dist/chunks/{VirtualScroll-1GcfIhEp.js → VirtualScroll-BUg5hvXK.js} +2 -0
- package/dist/chunks/{Watermark-D7VB39cd.js → Watermark-D8AQEV6Q.js} +12 -5
- package/dist/chunks/{form-BMVZ-Mdq.js → form-xJNi-zE3.js} +7 -5
- package/dist/chunks/{functional-ZVsrDRu9.js → functional-CKXWTqql.js} +2 -2
- package/dist/chunks/{locales-vmgWoduO.js → locales-D8p6Try5.js} +4 -1
- package/dist/chunks/{plugin-CHaCenTo.js → plugin-D_aPBWPS.js} +1 -1
- package/dist/chunks/{useInfiniteScroll-Bj0Hy8eF.js → useInfiniteScroll-DMMdTHID.js} +3 -2
- package/dist/chunks/{useMessage-DSUQYEbg.js → useMessage-BLSRjEV2.js} +1 -1
- package/dist/chunks/{zh-CN-Dp1Z58Nv.js → zh-CN-DZMILuCP.js} +4 -1
- package/dist/components/auth-card/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/feedback-form/index.js +1 -1
- package/dist/components/form/Form.vue.d.ts.map +1 -1
- package/dist/components/form/FormWizard.vue.d.ts.map +1 -1
- package/dist/components/form/index.js +1 -1
- package/dist/components/hardcore-input/HardcoreInput.vue.d.ts.map +1 -1
- package/dist/components/hardcore-input/index.js +1 -1
- package/dist/components/infinite-scroll/InfiniteScroll.vue.d.ts +7 -0
- package/dist/components/infinite-scroll/InfiniteScroll.vue.d.ts.map +1 -1
- package/dist/components/infinite-scroll/index.js +1 -1
- package/dist/components/input/Input.vue.d.ts.map +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/kanban/KanbanBoard.vue.d.ts.map +1 -1
- package/dist/components/kanban/index.js +1 -1
- package/dist/components/menu/MenuItem.vue.d.ts.map +1 -1
- package/dist/components/menu/SubMenu.vue.d.ts.map +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message/index.js +1 -1
- package/dist/components/noise-background/NoiseBackground.vue.d.ts.map +1 -1
- package/dist/components/noise-background/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/scratch-card/ScratchCard.vue.d.ts.map +1 -1
- package/dist/components/scratch-card/index.js +1 -1
- package/dist/components/select/Select.vue.d.ts.map +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/skeleton/SkeletonAvatar.vue.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/Slider.vue.d.ts +1 -1
- package/dist/components/slider/Slider.vue.d.ts.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/stepper/Stepper.vue.d.ts.map +1 -1
- package/dist/components/stepper/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/tabs/Tabs.vue.d.ts.map +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tags-input/TagsInputItemDelete.vue.d.ts +5 -1
- package/dist/components/tags-input/TagsInputItemDelete.vue.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/textarea/Textarea.vue.d.ts.map +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/tour/Tour.vue.d.ts.map +1 -1
- package/dist/components/tour/index.js +1 -1
- package/dist/components/transfer/Transfer.vue.d.ts.map +1 -1
- package/dist/components/transfer/index.js +1 -1
- package/dist/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/components/tree-select/TreeSelectNode.vue.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +1 -1
- package/dist/components/tree-view/TreeView.vue.d.ts.map +1 -1
- package/dist/components/tree-view/TreeViewNode.vue.d.ts.map +1 -1
- package/dist/components/tree-view/index.js +1 -1
- package/dist/components/upload/Upload.vue.d.ts.map +1 -1
- package/dist/components/upload/UploadTrigger.vue.d.ts +2 -2
- package/dist/components/upload/UploadTrigger.vue.d.ts.map +1 -1
- package/dist/components/upload/index.js +1 -1
- package/dist/components/virtual-scroll/VirtualScroll.vue.d.ts.map +1 -1
- package/dist/components/virtual-scroll/index.js +1 -1
- package/dist/components/watermark/Watermark.vue.d.ts.map +1 -1
- package/dist/components/watermark/index.js +1 -1
- package/dist/composables/destroyFallbacks.js +1 -1
- package/dist/composables/useDialog.js +1 -1
- package/dist/composables/useLocale.js +1 -1
- package/dist/composables/useMessage.js +1 -1
- package/dist/composables/useMessageBox.js +1 -1
- package/dist/index.js +32 -32
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/types.d.ts +1 -0
- package/dist/locales/types.d.ts.map +1 -1
- package/dist/locales/zh-CN.d.ts.map +1 -1
- package/dist/locales.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/ScratchCard-ndvLtKC8.js +0 -93
|
@@ -3,7 +3,7 @@ import { t } from "./icon-size-variants-nPLFCnI7.js";
|
|
|
3
3
|
import { useLocale as n } from "../composables/useLocale.js";
|
|
4
4
|
import { t as r } from "./Button-CQH3jyWY.js";
|
|
5
5
|
import { t as i } from "./Label-B3416ZVX.js";
|
|
6
|
-
import { t as a } from "./Input-
|
|
6
|
+
import { t as a } from "./Input-qKeVv2nE.js";
|
|
7
7
|
import { t as o } from "./Card-BbuXTMF2.js";
|
|
8
8
|
import { i as s, n as c, r as l, t as u } from "./CardFooter-qWuhvRh2.js";
|
|
9
9
|
import { t as d } from "./CardContent-BMUyIIpB.js";
|
|
@@ -4,7 +4,7 @@ import { useLocale as n } from "../composables/useLocale.js";
|
|
|
4
4
|
import { g as r } from "./defaults-BrqEfXpQ.js";
|
|
5
5
|
import { t as i } from "./Button-CQH3jyWY.js";
|
|
6
6
|
import { t as a } from "./Checkbox-BJKxAvEj.js";
|
|
7
|
-
import { t as o } from "./Input-
|
|
7
|
+
import { t as o } from "./Input-qKeVv2nE.js";
|
|
8
8
|
import { t as ee } from "./PopoverContent-BR4RHXYa.js";
|
|
9
9
|
import { a as te, n as ne, t as s } from "./SelectItem-B541Rhqy.js";
|
|
10
10
|
import { t as c } from "./data-table-utils-Cilh_JGU.js";
|
|
@@ -12,7 +12,7 @@ import { useDataTableSort as l } from "../composables/useDataTableSort.js";
|
|
|
12
12
|
import { useDataTableFilter as u } from "../composables/useDataTableFilter.js";
|
|
13
13
|
import { useDataTableSelection as d } from "../composables/useDataTableSelection.js";
|
|
14
14
|
import { useDataTablePagination as re } from "../composables/useDataTablePagination.js";
|
|
15
|
-
import { t as ie } from "./VirtualScroll-
|
|
15
|
+
import { t as ie } from "./VirtualScroll-BUg5hvXK.js";
|
|
16
16
|
import { n as ae, t as f } from "./PopoverTrigger-BxStODw9.js";
|
|
17
17
|
import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as y, createVNode as b, defineComponent as x, markRaw as oe, normalizeClass as S, normalizeStyle as C, openBlock as w, renderList as T, renderSlot as E, shallowRef as se, toDisplayString as D, unref as O, useSlots as ce, vShow as le, watch as k, watchEffect as ue, withCtx as A, withDirectives as de, withKeys as j, withModifiers as M } from "vue";
|
|
18
18
|
import { ArrowDown as fe, ArrowUp as pe, ArrowUpDown as me, ChevronDown as N, ChevronLeft as he, ChevronRight as P, ChevronsLeft as ge, ChevronsRight as _e, Filter as F, Inbox as ve, Loader2 as ye } from "@lucide/vue";
|
|
@@ -3,10 +3,10 @@ import { t } from "./icon-size-variants-nPLFCnI7.js";
|
|
|
3
3
|
import { useLocale as ee } from "../composables/useLocale.js";
|
|
4
4
|
import { t as n } from "./Button-CQH3jyWY.js";
|
|
5
5
|
import { t as r } from "./Label-B3416ZVX.js";
|
|
6
|
-
import { t as i } from "./Input-
|
|
6
|
+
import { t as i } from "./Input-qKeVv2nE.js";
|
|
7
7
|
import { t as a } from "./Card-BbuXTMF2.js";
|
|
8
8
|
import { t as o } from "./Result-DiJVipLS.js";
|
|
9
|
-
import { t as s } from "./Textarea-
|
|
9
|
+
import { t as s } from "./Textarea-zK2n7NrR.js";
|
|
10
10
|
import { t as c } from "./CardContent-BMUyIIpB.js";
|
|
11
11
|
import { Fragment as l, computed as u, createBlock as te, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, reactive as ne, ref as y, renderSlot as b, toDisplayString as x, unref as S, withCtx as C, withModifiers as w } from "vue";
|
|
12
12
|
import { Send as T } from "@lucide/vue";
|
|
@@ -82,66 +82,75 @@ var w = C([
|
|
|
82
82
|
},
|
|
83
83
|
emits: ["update:modelValue", "validation-change"],
|
|
84
84
|
setup(n, { expose: r, emit: f }) {
|
|
85
|
-
let C = n, j = f, M = `input-error-${S().replace(/:/g, "-")}`, N = _(!1), P = _(void 0), F = _(!1), I = a(b(C, "sound")), { t:
|
|
85
|
+
let C = n, j = f, M = `input-error-${S().replace(/:/g, "-")}`, N = _(!1), P = _(void 0), F = _(!1), I = !1, L = a(b(C, "sound")), { t: R } = t(), z = p(i, null), { validationState: B, errorMessage: V, validate: H } = o({
|
|
86
86
|
rules: () => C.rules,
|
|
87
87
|
validateOn: () => C.validateOn,
|
|
88
|
-
defaultErrorMessage: () =>
|
|
88
|
+
defaultErrorMessage: () => R("hardcoreInput.invalidInput")
|
|
89
89
|
});
|
|
90
90
|
h(() => {
|
|
91
91
|
P.value && clearTimeout(P.value);
|
|
92
92
|
});
|
|
93
|
-
let
|
|
94
|
-
let t = C.rules.length === 0, n =
|
|
95
|
-
if (
|
|
96
|
-
|
|
93
|
+
let U = (e) => {
|
|
94
|
+
let t = C.rules.length === 0, n = B.value;
|
|
95
|
+
if (H(e), t) {
|
|
96
|
+
z?.setError(void 0), n !== "default" && B.value === "default" && j("validation-change", "default");
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
n !==
|
|
99
|
+
n !== B.value && (B.value === "error" ? L.playSound("fail") : B.value === "success" && L.playSound("success")), B.value === "error" && C.shakeOnError && (P.value && clearTimeout(P.value), N.value = !1, P.value = setTimeout(() => {
|
|
100
100
|
P.value = void 0, N.value = !0;
|
|
101
|
-
}, 10)),
|
|
102
|
-
}, U = (e) => {
|
|
103
|
-
let t = e.target;
|
|
104
|
-
t instanceof HTMLInputElement && (F.value || (j("update:modelValue", t.value), R && R.setValue(t.value), I.playSound("type"), C.validateOn === "input" && H(t.value)));
|
|
101
|
+
}, 10)), z && z.setError(B.value === "error" ? V.value : void 0), B.value === "error" ? j("validation-change", "error", V.value) : B.value === "success" && j("validation-change", "success");
|
|
105
102
|
}, W = (e) => {
|
|
106
103
|
let t = e.target;
|
|
107
|
-
t instanceof HTMLInputElement && (F.value
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
if (t instanceof HTMLInputElement && !(F.value || e.isComposing)) {
|
|
105
|
+
if (I) {
|
|
106
|
+
I = !1;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
j("update:modelValue", t.value), z && z.setValue(t.value), L.playSound("type"), C.validateOn === "input" && U(t.value);
|
|
110
|
+
}
|
|
111
|
+
}, G = (e) => {
|
|
112
|
+
let t = e.target;
|
|
113
|
+
t instanceof HTMLInputElement && (F.value = !1, j("update:modelValue", t.value), I = !0, z && z.setValue(t.value), C.validateOn === "input" && U(t.value));
|
|
110
114
|
}, K = () => {
|
|
115
|
+
F.value = !1;
|
|
116
|
+
}, q = () => {
|
|
117
|
+
C.validateOn === "blur" && U(C.modelValue ?? "");
|
|
118
|
+
}, J = () => {
|
|
111
119
|
P.value || (N.value = !1);
|
|
112
120
|
};
|
|
113
121
|
r({
|
|
114
122
|
validate: () => {
|
|
115
|
-
|
|
123
|
+
U(C.modelValue ?? "");
|
|
116
124
|
},
|
|
117
|
-
validationState:
|
|
118
|
-
errorMessage:
|
|
125
|
+
validationState: B,
|
|
126
|
+
errorMessage: V
|
|
119
127
|
});
|
|
120
|
-
let
|
|
121
|
-
return (e, t) => (g(), l("div", { class: m(
|
|
128
|
+
let Y = s(() => e("relative w-full flex flex-col gap-1.5", C.class)), X = s(() => e(w({ variant: B.value }), N.value ? "animate-shake" : "")), Z = s(() => e(T(), B.value === "success" ? "bg-brutal-success" : "", B.value === "error" ? "bg-brutal-destructive text-brutal-fg animate-bounce-short" : ""));
|
|
129
|
+
return (e, t) => (g(), l("div", { class: m(Y.value) }, [u("div", E, [u("input", {
|
|
122
130
|
type: n.type,
|
|
123
131
|
value: n.modelValue,
|
|
124
132
|
disabled: n.disabled,
|
|
125
133
|
readonly: n.readonly,
|
|
126
134
|
placeholder: n.placeholder,
|
|
127
|
-
class: m(
|
|
128
|
-
"aria-invalid": x(
|
|
129
|
-
"aria-describedby": x(
|
|
130
|
-
onInput:
|
|
131
|
-
onBlur:
|
|
132
|
-
onAnimationend:
|
|
135
|
+
class: m(X.value),
|
|
136
|
+
"aria-invalid": x(B) === "error",
|
|
137
|
+
"aria-describedby": x(V) ? M : void 0,
|
|
138
|
+
onInput: W,
|
|
139
|
+
onBlur: q,
|
|
140
|
+
onAnimationend: J,
|
|
133
141
|
onCompositionstart: t[0] ||= (e) => F.value = !0,
|
|
134
|
-
onCompositionend:
|
|
135
|
-
|
|
142
|
+
onCompositionend: G,
|
|
143
|
+
onCompositioncancel: K
|
|
144
|
+
}, null, 42, D), u("div", O, [v(e.$slots, "default", {}, () => [x(B) === "default" ? c("", !0) : (g(), l("div", {
|
|
136
145
|
key: 0,
|
|
137
|
-
class: m(
|
|
138
|
-
}, [x(
|
|
146
|
+
class: m(Z.value)
|
|
147
|
+
}, [x(B) === "success" ? (g(), l("svg", k, [...t[1] ||= [d("<circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"var(--brutal-accent)\" stroke=\"currentColor\" stroke-width=\"2.5\" data-v-a026da72></circle><rect x=\"6\" y=\"8\" width=\"5\" height=\"4\" rx=\"1.5\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"1\" data-v-a026da72></rect><rect x=\"13\" y=\"8\" width=\"5\" height=\"4\" rx=\"1.5\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"1\" data-v-a026da72></rect><line x1=\"11\" y1=\"10\" x2=\"13\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"2\" data-v-a026da72></line><path d=\"M8 15 Q12 19 16 15\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" fill=\"none\" data-v-a026da72></path>", 5)]])) : c("", !0), x(B) === "error" ? (g(), l("svg", A, [...t[2] ||= [d("<circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"var(--brutal-destructive)\" stroke=\"currentColor\" stroke-width=\"2.5\" data-v-a026da72></circle><line x1=\"6\" y1=\"8\" x2=\"10\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" data-v-a026da72></line><line x1=\"18\" y1=\"8\" x2=\"14\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" data-v-a026da72></line><circle cx=\"8\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" data-v-a026da72></circle><circle cx=\"16\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" data-v-a026da72></circle><path d=\"M9 17 Q12 14 15 17\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" fill=\"none\" data-v-a026da72></path>", 6)]])) : c("", !0)], 2))], !0)])]), x(B) === "error" && x(V) ? (g(), l("p", {
|
|
139
148
|
key: 0,
|
|
140
149
|
id: M,
|
|
141
150
|
class: "text-xs font-black tracking-wide text-brutal-destructive animate-fade-in",
|
|
142
151
|
"aria-live": "polite"
|
|
143
|
-
}, y(x(
|
|
152
|
+
}, y(x(V)), 1)) : c("", !0)], 2));
|
|
144
153
|
}
|
|
145
|
-
}), [["__scopeId", "data-v-
|
|
154
|
+
}), [["__scopeId", "data-v-a026da72"]]);
|
|
146
155
|
//#endregion
|
|
147
156
|
export { T as n, w as r, j as t };
|
|
@@ -118,29 +118,38 @@ var T = w([
|
|
|
118
118
|
},
|
|
119
119
|
emits: ["update:modelValue", "clear"],
|
|
120
120
|
setup(t, { expose: n, emit: i }) {
|
|
121
|
-
let f = t, w = i, R = b(), z = h(null), B = h(!1), V = h(!1), { t:
|
|
121
|
+
let f = t, w = i, R = b(), z = h(null), B = h(!1), V = !1, H = h(!1), { t: U } = r(), W = o(() => U(H.value ? "input.hidePassword" : "input.showPassword")), { showClear: G, handleClear: K, onMouseEnter: q, onMouseLeave: J } = a({
|
|
122
122
|
modelValue: () => f.modelValue,
|
|
123
123
|
clearable: () => f.clearable,
|
|
124
124
|
disabled: () => f.disabled,
|
|
125
125
|
onClear: () => {
|
|
126
126
|
w("update:modelValue", ""), w("clear");
|
|
127
127
|
}
|
|
128
|
-
}),
|
|
128
|
+
}), Y = o(() => f.type === "password" ? H.value ? "text" : "password" : f.type), X = o(() => f.type === "password" && f.showPassword), Z = o(() => f.showWordLimit && f.maxlength !== void 0), Q = o(() => f.modelValue?.length ?? 0), $ = o(() => f.suffixIcon || G.value || X.value), ee = o(() => e(T({
|
|
129
129
|
variant: f.variant,
|
|
130
130
|
size: f.size,
|
|
131
131
|
disabled: f.disabled
|
|
132
|
-
}), f.class)),
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
function ne(e) {
|
|
137
|
-
G(e);
|
|
132
|
+
}), f.class)), te = o(() => e(E(), f.readonly && "cursor-default", f.prefixIcon ? "pl-9" : "pl-3", $.value ? "pr-9" : "pr-3"));
|
|
133
|
+
function ne() {
|
|
134
|
+
H.value = !H.value;
|
|
138
135
|
}
|
|
139
136
|
function re(e) {
|
|
140
|
-
|
|
137
|
+
K(e);
|
|
141
138
|
}
|
|
142
139
|
function ie(e) {
|
|
143
|
-
B.value
|
|
140
|
+
if (!(B.value || e.isComposing)) {
|
|
141
|
+
if (V) {
|
|
142
|
+
V = !1;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
w("update:modelValue", e.target.value);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function ae(e) {
|
|
149
|
+
B.value = !1, w("update:modelValue", e.target.value), V = !0;
|
|
150
|
+
}
|
|
151
|
+
function oe() {
|
|
152
|
+
B.value = !1;
|
|
144
153
|
}
|
|
145
154
|
return n({
|
|
146
155
|
ref: z,
|
|
@@ -149,9 +158,9 @@ var T = w([
|
|
|
149
158
|
select: () => z.value?.select()
|
|
150
159
|
}), (e, n) => (m(), l("div", D, [
|
|
151
160
|
u("div", {
|
|
152
|
-
class: p(["brutal-input-container",
|
|
153
|
-
onMouseenter: n[1] ||= (...e) => y(
|
|
154
|
-
onMouseleave: n[2] ||= (...e) => y(
|
|
161
|
+
class: p(["brutal-input-container", ee.value]),
|
|
162
|
+
onMouseenter: n[1] ||= (...e) => y(q) && y(q)(...e),
|
|
163
|
+
onMouseleave: n[2] ||= (...e) => y(J) && y(J)(...e)
|
|
155
164
|
}, [
|
|
156
165
|
y(R).prepend ? (m(), l("div", O, [g(e.$slots, "prepend")])) : c("", !0),
|
|
157
166
|
u("div", k, [
|
|
@@ -159,13 +168,13 @@ var T = w([
|
|
|
159
168
|
u("input", {
|
|
160
169
|
ref_key: "inputRef",
|
|
161
170
|
ref: z,
|
|
162
|
-
type:
|
|
171
|
+
type: Y.value,
|
|
163
172
|
value: t.modelValue,
|
|
164
173
|
disabled: t.disabled,
|
|
165
174
|
readonly: t.readonly,
|
|
166
175
|
placeholder: t.placeholder,
|
|
167
176
|
maxlength: t.maxlength,
|
|
168
|
-
class: p(
|
|
177
|
+
class: p(te.value),
|
|
169
178
|
"aria-label": t.ariaLabel,
|
|
170
179
|
"aria-labelledby": t.ariaLabelledby,
|
|
171
180
|
"aria-describedby": t.ariaDescribedby,
|
|
@@ -173,30 +182,31 @@ var T = w([
|
|
|
173
182
|
"aria-errormessage": t.ariaErrormessage,
|
|
174
183
|
"aria-required": t.ariaRequired,
|
|
175
184
|
onCompositionstart: n[0] ||= (e) => B.value = !0,
|
|
176
|
-
onCompositionend:
|
|
177
|
-
|
|
185
|
+
onCompositionend: ae,
|
|
186
|
+
onCompositioncancel: oe,
|
|
187
|
+
onInput: ie
|
|
178
188
|
}, null, 42, j),
|
|
179
189
|
u("div", M, [
|
|
180
|
-
y(
|
|
190
|
+
y(G) ? (m(), l("button", {
|
|
181
191
|
key: 0,
|
|
182
192
|
type: "button",
|
|
183
193
|
class: "p-0.5 hover:bg-brutal-muted rounded-brutal transition-colors",
|
|
184
|
-
onClick:
|
|
194
|
+
onClick: re
|
|
185
195
|
}, [d(y(C), { class: "h-3.5 w-3.5 text-brutal-placeholder" })])) : c("", !0),
|
|
186
|
-
|
|
196
|
+
X.value ? (m(), l("button", {
|
|
187
197
|
key: 1,
|
|
188
198
|
type: "button",
|
|
189
199
|
class: "p-0.5 hover:bg-brutal-muted rounded-brutal transition-colors",
|
|
190
|
-
"aria-label":
|
|
191
|
-
onClick:
|
|
192
|
-
}, [
|
|
200
|
+
"aria-label": W.value,
|
|
201
|
+
onClick: ne
|
|
202
|
+
}, [H.value ? (m(), s(y(S), {
|
|
193
203
|
key: 1,
|
|
194
204
|
class: "h-3.5 w-3.5 text-brutal-placeholder"
|
|
195
205
|
})) : (m(), s(y(x), {
|
|
196
206
|
key: 0,
|
|
197
207
|
class: "h-3.5 w-3.5 text-brutal-placeholder"
|
|
198
208
|
}))], 8, N)) : c("", !0),
|
|
199
|
-
t.suffixIcon && !y(
|
|
209
|
+
t.suffixIcon && !y(G) && !X.value ? (m(), s(_(t.suffixIcon), {
|
|
200
210
|
key: 2,
|
|
201
211
|
class: "h-4 w-4 text-brutal-placeholder"
|
|
202
212
|
})) : c("", !0)
|
|
@@ -204,7 +214,7 @@ var T = w([
|
|
|
204
214
|
]),
|
|
205
215
|
y(R).append ? (m(), l("div", P, [g(e.$slots, "append")])) : c("", !0)
|
|
206
216
|
], 34),
|
|
207
|
-
|
|
217
|
+
Z.value ? (m(), l("div", F, [u("span", I, v(Q.value) + " / " + v(t.maxlength), 1)])) : c("", !0),
|
|
208
218
|
t.variant === "error" && t.errorMessage ? (m(), l("p", L, v(t.errorMessage), 1)) : c("", !0)
|
|
209
219
|
]));
|
|
210
220
|
}
|
|
@@ -229,8 +229,8 @@ var O = D([
|
|
|
229
229
|
if (K.value = null, H.value = null, n === t) return;
|
|
230
230
|
let r = Y.value.findIndex((e) => e.id === n), i = Y.value.findIndex((e) => e.id === t);
|
|
231
231
|
if (r === -1 || i === -1) return;
|
|
232
|
-
let a = [...Y.value], [o] = a.splice(r, 1)
|
|
233
|
-
a.splice(
|
|
232
|
+
let a = [...Y.value], [o] = a.splice(r, 1);
|
|
233
|
+
a.splice(i, 0, o), z("update:modelValue", a), z("column-move", n, r, i);
|
|
234
234
|
}
|
|
235
235
|
function $(e) {
|
|
236
236
|
z("add-card", e);
|
|
@@ -38,8 +38,7 @@ var v = _(["relative overflow-hidden"], {
|
|
|
38
38
|
setup(c) {
|
|
39
39
|
let _ = c, C = i(), w = p(null), T = `noise-${h()}`, E = null, D = p(_.frequency);
|
|
40
40
|
function O() {
|
|
41
|
-
if (!_.animated || !r || _.animationDuration <= 0 || C.value) return;
|
|
42
|
-
k();
|
|
41
|
+
if (k(), !_.animated || !r || _.animationDuration <= 0 || C.value) return;
|
|
43
42
|
let e = performance.now(), n = _.frequency, i = _.animationRange;
|
|
44
43
|
function a(r) {
|
|
45
44
|
let o = (r - e) / 1e3 % _.animationDuration / _.animationDuration;
|
|
@@ -2,7 +2,7 @@ import { n as e } from "./utils-CUXX1zll.js";
|
|
|
2
2
|
import { a as t, o as n } from "./brutal-interaction-variants-BAheBvSg.js";
|
|
3
3
|
import { t as r } from "./icon-size-variants-nPLFCnI7.js";
|
|
4
4
|
import { useLocale as i } from "../composables/useLocale.js";
|
|
5
|
-
import { t as a } from "./Input-
|
|
5
|
+
import { t as a } from "./Input-qKeVv2nE.js";
|
|
6
6
|
import { a as o, n as s, t as c } from "./SelectItem-B541Rhqy.js";
|
|
7
7
|
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as ee, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, withCtx as C, withKeys as w } from "vue";
|
|
8
8
|
import { ChevronLeft as te, ChevronRight as ne, ChevronsLeft as re, ChevronsRight as ie } from "@lucide/vue";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { n as e } from "./utils-CUXX1zll.js";
|
|
2
|
+
import { useLocale as t } from "../composables/useLocale.js";
|
|
3
|
+
import { a as n, c as r, o as i, s as a } from "./env-CvRqOgSF.js";
|
|
4
|
+
import { useReducedMotion as o } from "../composables/useReducedMotion.js";
|
|
5
|
+
import { useCanvasInteraction as s } from "../composables/useCanvasInteraction.js";
|
|
6
|
+
import { computed as c, createElementBlock as l, createElementVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, onUnmounted as ee, openBlock as m, ref as h, renderSlot as g, toRef as _, unref as v, vShow as y, watch as b, withDirectives as te, withKeys as x, withModifiers as S } from "vue";
|
|
7
|
+
import { cva as C } from "class-variance-authority";
|
|
8
|
+
//#region src/lib/theme-fallbacks.ts
|
|
9
|
+
var w = "#FF6B6B", T = "#4ECDC4", E = "#000000", D = C([
|
|
10
|
+
"relative",
|
|
11
|
+
"border-3 border-brutal",
|
|
12
|
+
"rounded-brutal",
|
|
13
|
+
"overflow-hidden",
|
|
14
|
+
"bg-brutal-bg"
|
|
15
|
+
]), O = ["aria-label"], k = { class: "scratch-card-content w-full h-full" }, A = 50, j = 20, M = 300, N = 10, P = 2, F = 20, I = 5, L = /* @__PURE__ */ d({
|
|
16
|
+
__name: "ScratchCard",
|
|
17
|
+
props: {
|
|
18
|
+
percentage: { default: A },
|
|
19
|
+
brushRadius: { default: j },
|
|
20
|
+
overlayColor: { default: void 0 },
|
|
21
|
+
fadeDuration: { default: M },
|
|
22
|
+
class: { default: void 0 }
|
|
23
|
+
},
|
|
24
|
+
emits: ["progress", "completed"],
|
|
25
|
+
setup(d, { expose: C, emit: A }) {
|
|
26
|
+
let j = d, M = A, L = h(null), R = h(null), z = h(!1), B = o(), { t: V } = t(), H = (e, t, n) => {
|
|
27
|
+
if (e.clearRect(0, 0, t, n), j.overlayColor) e.fillStyle = j.overlayColor, e.fillRect(0, 0, t, n);
|
|
28
|
+
else {
|
|
29
|
+
let a = w, o = T, s = E, c = r();
|
|
30
|
+
if (c) {
|
|
31
|
+
let e = i(c.documentElement);
|
|
32
|
+
a = e?.getPropertyValue("--brutal-primary").trim() || a, o = e?.getPropertyValue("--brutal-secondary").trim() || o, s = e?.getPropertyValue("--brutal-fg").trim() || s;
|
|
33
|
+
}
|
|
34
|
+
e.fillStyle = o, e.fillRect(0, 0, t, n), e.strokeStyle = a, e.lineWidth = N;
|
|
35
|
+
for (let r = -n; r < t + n; r += F) e.beginPath(), e.moveTo(r, 0), e.lineTo(r + n, n), e.stroke();
|
|
36
|
+
e.strokeStyle = s, e.lineWidth = P;
|
|
37
|
+
for (let r = -n; r < t + n; r += F) e.beginPath(), e.moveTo(r + I, 0), e.lineTo(r + I + n, n), e.stroke();
|
|
38
|
+
}
|
|
39
|
+
}, { isRevealed: U, revealAll: W, handlePointerDown: G, handlePointerMove: K, handlePointerUp: q, touchAction: J } = s({
|
|
40
|
+
containerRef: L,
|
|
41
|
+
canvasRef: R,
|
|
42
|
+
brushRadius: _(j, "brushRadius"),
|
|
43
|
+
percentage: _(j, "percentage"),
|
|
44
|
+
fadeDuration: _(j, "fadeDuration"),
|
|
45
|
+
prefersReducedMotion: B,
|
|
46
|
+
onProgress: (e) => M("progress", e),
|
|
47
|
+
onCompleted: () => M("completed"),
|
|
48
|
+
drawOverlay: H
|
|
49
|
+
});
|
|
50
|
+
C({
|
|
51
|
+
isRevealed: U,
|
|
52
|
+
revealAll: W
|
|
53
|
+
});
|
|
54
|
+
let Y = c(() => e(D(), j.class)), X = c(() => ({
|
|
55
|
+
transition: `opacity ${B.value ? 0 : j.fadeDuration}ms ease-out`,
|
|
56
|
+
opacity: +!U.value
|
|
57
|
+
}));
|
|
58
|
+
function Z() {
|
|
59
|
+
let e = R.value;
|
|
60
|
+
if (!e) return;
|
|
61
|
+
let t = n(e);
|
|
62
|
+
if (!t) return;
|
|
63
|
+
let r = a();
|
|
64
|
+
H(t, e.width / r, e.height / r);
|
|
65
|
+
}
|
|
66
|
+
let Q = null;
|
|
67
|
+
function $() {
|
|
68
|
+
Q &&= (clearTimeout(Q), null);
|
|
69
|
+
}
|
|
70
|
+
return b(U, (e) => {
|
|
71
|
+
$(), e ? Q = setTimeout(() => {
|
|
72
|
+
z.value = !0, Q = null;
|
|
73
|
+
}, B.value ? 0 : j.fadeDuration) : (z.value = !1, Z());
|
|
74
|
+
}), ee(() => {
|
|
75
|
+
$();
|
|
76
|
+
}), (t, n) => (m(), l("div", {
|
|
77
|
+
ref_key: "containerRef",
|
|
78
|
+
ref: L,
|
|
79
|
+
class: f(Y.value),
|
|
80
|
+
role: "region",
|
|
81
|
+
"aria-label": v(V)("scratchCard.ariaLabel"),
|
|
82
|
+
tabindex: "0",
|
|
83
|
+
onKeydown: [n[4] ||= x((...e) => v(W) && v(W)(...e), ["enter"]), n[5] ||= x(S((...e) => v(W) && v(W)(...e), ["prevent"]), ["space"])]
|
|
84
|
+
}, [u("div", k, [g(t.$slots, "default")]), te(u("canvas", {
|
|
85
|
+
ref_key: "canvasRef",
|
|
86
|
+
ref: R,
|
|
87
|
+
class: f(v(e)("absolute inset-0 cursor-crosshair select-none z-10", v(U) && "pointer-events-none")),
|
|
88
|
+
style: p({
|
|
89
|
+
...X.value,
|
|
90
|
+
touchAction: v(J)
|
|
91
|
+
}),
|
|
92
|
+
onPointerdown: n[0] ||= (...e) => v(G) && v(G)(...e),
|
|
93
|
+
onPointermove: n[1] ||= (...e) => v(K) && v(K)(...e),
|
|
94
|
+
onPointerup: n[2] ||= (...e) => v(q) && v(q)(...e),
|
|
95
|
+
onPointercancel: n[3] ||= (...e) => v(q) && v(q)(...e)
|
|
96
|
+
}, null, 38), [[y, !z.value]])], 42, O));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export { D as n, L as t };
|
|
@@ -49,33 +49,34 @@ var D = /* @__PURE__ */ d({
|
|
|
49
49
|
}),
|
|
50
50
|
emits: ["update:modelValue"],
|
|
51
51
|
setup(d) {
|
|
52
|
-
let f = y(d, "modelValue"), C = b(), T = a(() => !!C.default), O = a(() => !!C.trigger), k = a(() => {
|
|
52
|
+
let f = y(d, "modelValue"), C = b(), T = a(() => !!C.default), O = a(() => !!C.trigger), k = a(() => d.options ?? []), A = a(() => {
|
|
53
|
+
let e = k.value;
|
|
53
54
|
if (!d.groupField) return [{
|
|
54
55
|
key: "all",
|
|
55
56
|
label: "",
|
|
56
|
-
options:
|
|
57
|
+
options: e
|
|
57
58
|
}];
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
let r =
|
|
59
|
+
let t = {}, n = [];
|
|
60
|
+
e.forEach((e) => {
|
|
61
|
+
let r = e[d.groupField];
|
|
61
62
|
if (r != null) {
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
} else
|
|
63
|
+
let n = String(r);
|
|
64
|
+
t[n] || (t[n] = []), t[n].push(e);
|
|
65
|
+
} else n.push(e);
|
|
65
66
|
});
|
|
66
|
-
let
|
|
67
|
-
return Object.keys(
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
key:
|
|
71
|
-
label: d.groupLabel &&
|
|
72
|
-
options: e
|
|
67
|
+
let r = [];
|
|
68
|
+
return Object.keys(t).forEach((e) => {
|
|
69
|
+
let n = t[e][0];
|
|
70
|
+
r.push({
|
|
71
|
+
key: e,
|
|
72
|
+
label: d.groupLabel && n && n[d.groupLabel] !== void 0 ? String(n[d.groupLabel]) : e,
|
|
73
|
+
options: t[e]
|
|
73
74
|
});
|
|
74
|
-
}),
|
|
75
|
+
}), n.length > 0 && r.push({
|
|
75
76
|
key: "__ungrouped__",
|
|
76
77
|
label: "",
|
|
77
|
-
options:
|
|
78
|
-
}),
|
|
78
|
+
options: n
|
|
79
|
+
}), r;
|
|
79
80
|
});
|
|
80
81
|
return (a, y) => (m(), o(v(w), {
|
|
81
82
|
modelValue: f.value,
|
|
@@ -111,7 +112,7 @@ var D = /* @__PURE__ */ d({
|
|
|
111
112
|
position: d.position,
|
|
112
113
|
class: p(d.contentClass)
|
|
113
114
|
}, {
|
|
114
|
-
default: x(() => [d.groupField ? (m(!0), c(i, { key: 0 }, h(
|
|
115
|
+
default: x(() => [d.groupField ? (m(!0), c(i, { key: 0 }, h(A.value, (e) => (m(), o(v(S), { key: e.key }, {
|
|
115
116
|
default: x(() => [e.label ? (m(), o(D, { key: 0 }, {
|
|
116
117
|
default: x(() => [l(_(e.label), 1)]),
|
|
117
118
|
_: 2
|
|
@@ -129,7 +130,7 @@ var D = /* @__PURE__ */ d({
|
|
|
129
130
|
"variant"
|
|
130
131
|
]))), 128))]),
|
|
131
132
|
_: 2
|
|
132
|
-
}, 1024))), 128)) : (m(!0), c(i, { key: 1 }, h(
|
|
133
|
+
}, 1024))), 128)) : (m(!0), c(i, { key: 1 }, h(k.value, (e) => (m(), o(r, {
|
|
133
134
|
key: e.value,
|
|
134
135
|
value: e.value,
|
|
135
136
|
disabled: e.disabled,
|