@razaman2/reactive-view 0.1.0-beta.9 → 0.2.1
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/LICENSE +21 -21
- package/README.md +1 -1
- package/dist/Editor-DMCekNFl.mjs +364 -0
- package/dist/Editor-JraAPAuW.js +1 -0
- package/dist/Label-CkJjlfli.js +1 -0
- package/dist/Label-DD9yGa7V.mjs +49 -0
- package/dist/ReactiveView.d.mts +20 -0
- package/dist/ReactiveView.d.ts +20 -0
- package/dist/Select-D8LFsK4R.js +1 -0
- package/dist/Select-x96YoTl5.mjs +238 -0
- package/dist/Subscription.d.mts +17 -0
- package/dist/Subscription.d.ts +17 -0
- package/dist/Subscriptions.d.mts +5 -0
- package/dist/Subscriptions.d.ts +5 -0
- package/dist/Types.d.mts +28 -0
- package/dist/Types.d.ts +28 -0
- package/dist/components/Button.vue.d.mts +3 -0
- package/dist/components/Button.vue.d.ts +3 -0
- package/dist/components/ConfirmationModal.vue.d.mts +3 -0
- package/dist/components/ConfirmationModal.vue.d.ts +3 -0
- package/dist/components/CustomAlert.vue.d.mts +69 -0
- package/dist/components/CustomAlert.vue.d.ts +69 -0
- package/dist/components/CustomButton.vue.d.mts +3 -0
- package/dist/components/CustomButton.vue.d.ts +3 -0
- package/dist/components/CustomModal.vue.d.mts +3 -0
- package/dist/components/CustomModal.vue.d.ts +3 -0
- package/dist/components/CustomTable.vue.d.mts +3 -0
- package/dist/components/CustomTable.vue.d.ts +3 -0
- package/dist/components/CustomTableRow.vue.d.mts +3 -0
- package/dist/components/CustomTableRow.vue.d.ts +3 -0
- package/dist/components/Datetime.vue.d.mts +3 -0
- package/dist/components/Datetime.vue.d.ts +3 -0
- package/dist/components/DraggableList.vue.d.mts +3 -0
- package/dist/components/DraggableList.vue.d.ts +3 -0
- package/dist/components/Editor.vue.d.mts +3 -0
- package/dist/components/Editor.vue.d.ts +3 -0
- package/dist/components/Input.vue.d.mts +3 -0
- package/dist/components/Input.vue.d.ts +3 -0
- package/dist/components/ItemsList.vue.d.mts +3 -0
- package/dist/components/ItemsList.vue.d.ts +3 -0
- package/dist/components/Label.vue.d.mts +3 -0
- package/dist/components/Label.vue.d.ts +3 -0
- package/dist/components/ListPagination.vue.d.mts +3 -0
- package/dist/components/ListPagination.vue.d.ts +3 -0
- package/dist/components/Popover.vue.d.mts +3 -0
- package/dist/components/Popover.vue.d.ts +3 -0
- package/dist/components/Select.vue.d.mts +3 -0
- package/dist/components/Select.vue.d.ts +3 -0
- package/dist/components/drag.d.mts +1 -0
- package/dist/components/drag.d.ts +1 -0
- package/dist/components/index.d.mts +17 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/masks.d.mts +22 -0
- package/dist/components/masks.d.ts +22 -0
- package/dist/components.js +1 -0
- package/dist/components.mjs +1660 -0
- package/dist/index.d.mts +43 -121
- package/dist/index.d.ts +43 -121
- package/dist/index.js +1 -963
- package/dist/index.mjs +2 -916
- package/dist/reactive-view.css +2 -0
- package/dist/rolldown-runtime-C-QNzSnW.mjs +11 -0
- package/dist/src-BJaQUsvj.js +1 -0
- package/dist/src-DwXft6y4.mjs +528 -0
- package/package.json +126 -48
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 razamvmt
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 razamvmt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# reactive-view
|
|
1
|
+
# reactive-view
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-C-QNzSnW.mjs";
|
|
2
|
+
import { c as t, f as n, i as r, n as i, t as a } from "./src-DwXft6y4.mjs";
|
|
3
|
+
import { t as o } from "./Label-DD9yGa7V.mjs";
|
|
4
|
+
import { Teleport as s, computed as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineAsyncComponent as f, isVNode as p, markRaw as m, mergeProps as h, nextTick as g, openBlock as _, ref as v, unref as y, watch as b } from "vue";
|
|
5
|
+
import { twMerge as x } from "tailwind-merge";
|
|
6
|
+
import { Checkbox as S, InputText as C, RadioButton as w, Textarea as T, ToggleSwitch as E } from "primevue";
|
|
7
|
+
import { v4 as D } from "uuid";
|
|
8
|
+
import O from "inputmask";
|
|
9
|
+
import k from "primevue/editor";
|
|
10
|
+
//#region ~icons/tabler/x-filled
|
|
11
|
+
var A = {
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
width: "1.2em",
|
|
14
|
+
height: "1.2em"
|
|
15
|
+
};
|
|
16
|
+
function j(e, t) {
|
|
17
|
+
return _(), l("svg", A, [...t[0] ||= [u("path", {
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
d: "M6.707 5.293L12 10.585l5.293-5.292a1 1 0 0 1 1.414 1.414L13.415 12l5.292 5.293a1 1 0 0 1-1.414 1.414L12 13.415l-5.293 5.292a1 1 0 1 1-1.414-1.414L10.585 12L5.293 6.707a1 1 0 0 1 1.414-1.414"
|
|
20
|
+
}, null, -1)]]);
|
|
21
|
+
}
|
|
22
|
+
var M = m({
|
|
23
|
+
name: "tabler-x-filled",
|
|
24
|
+
render: j
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/Input.vue?vue&type=script&lang.jsx
|
|
28
|
+
function N(e) {
|
|
29
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !p(e);
|
|
30
|
+
}
|
|
31
|
+
var P = f(() => Promise.resolve().then(() => B)), F = f(() => import("./Select-x96YoTl5.mjs").then((e) => e.n)), I = t({
|
|
32
|
+
modelName: "Input",
|
|
33
|
+
props: {
|
|
34
|
+
grow: i({ type: Boolean }),
|
|
35
|
+
filled: i({ type: Boolean }),
|
|
36
|
+
container: i({ type: Boolean }),
|
|
37
|
+
debounce: i({
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: 200,
|
|
40
|
+
validator: (e) => /^\d+$/.test(e)
|
|
41
|
+
}),
|
|
42
|
+
placeholder: i({ type: [
|
|
43
|
+
Boolean,
|
|
44
|
+
Number,
|
|
45
|
+
String
|
|
46
|
+
] }),
|
|
47
|
+
masking: i({ type: Object }),
|
|
48
|
+
type: i({ type: String }),
|
|
49
|
+
inputClass: i(),
|
|
50
|
+
class: i(),
|
|
51
|
+
indeterminate: i({ type: Boolean }),
|
|
52
|
+
showClear: i({ type: Boolean }),
|
|
53
|
+
data: {}
|
|
54
|
+
},
|
|
55
|
+
data: (e) => ["select", "editor"].includes(y(e.type)) ? void 0 : e.data,
|
|
56
|
+
defaultData: void 0,
|
|
57
|
+
setup(e, t, i) {
|
|
58
|
+
let s = `component_${D()}`, l = i.type ?? "text", u = v(), f = v(), p = c(() => y(i.placeholder) === !1 || ["number", "string"].includes(typeof y(i.placeholder)) ? y(i.placeholder) : ["number", "string"].includes(typeof y(i.label)) ? y(i.label) : void 0), m = () => y(i.container) || y(i.$attrs.label) || y(i.grow), _ = () => m() ? r(e).container() : r(e).field(), k = () => d("label", {
|
|
59
|
+
for: s,
|
|
60
|
+
class: x(a(y(i.labelClass)).string)
|
|
61
|
+
}, [y(i.label)]), A = () => d(C, h({
|
|
62
|
+
fluid: !y(i.grow),
|
|
63
|
+
onInput: () => r(e).resize(),
|
|
64
|
+
size: "small",
|
|
65
|
+
type: y(l)
|
|
66
|
+
}, n(i.$attrs, "label"), y(p) ? { placeholder: y(p) } : {}, {
|
|
67
|
+
id: s,
|
|
68
|
+
ref: u,
|
|
69
|
+
class: x(a({
|
|
70
|
+
"bg-(--colors-F5F6F8)!": y(i.filled),
|
|
71
|
+
"pr-8!": y(i.showClear)
|
|
72
|
+
}).string, a(y(i.inputClass)).string, m() ? "" : a(y(i.class)).string),
|
|
73
|
+
modelValue: r(e).model.getData(),
|
|
74
|
+
"onUpdate:modelValue": (t) => {
|
|
75
|
+
W(() => {
|
|
76
|
+
r(e).model.replaceData(t);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}), null), j = () => {
|
|
80
|
+
let t = r(e).input();
|
|
81
|
+
return d(T, h({ autoResize: !0 }, n(t.props, "type")), t.children);
|
|
82
|
+
}, I = () => {
|
|
83
|
+
let t = r(e).input();
|
|
84
|
+
return d(S, h({
|
|
85
|
+
binary: !0,
|
|
86
|
+
indeterminate: y(i.indeterminate)
|
|
87
|
+
}, n(t.props, "type")), t.children);
|
|
88
|
+
}, L = () => {
|
|
89
|
+
let t = r(e).input();
|
|
90
|
+
return d(w, n(t.props, "type"), t.children);
|
|
91
|
+
}, R = () => {
|
|
92
|
+
let t = r(e).input();
|
|
93
|
+
return d(E, h({ binary: !0 }, n(t.props, "type")), t.children);
|
|
94
|
+
}, z = () => {
|
|
95
|
+
let t = r(e).input();
|
|
96
|
+
return d(P, h(n(t.props, [
|
|
97
|
+
"type",
|
|
98
|
+
"label",
|
|
99
|
+
"modelValue",
|
|
100
|
+
"onUpdate:modelValue"
|
|
101
|
+
]), { data: i.data }), t.children);
|
|
102
|
+
}, B = () => {
|
|
103
|
+
let t = r(e).input();
|
|
104
|
+
return d(F, h(n(t.props, [
|
|
105
|
+
"type",
|
|
106
|
+
"modelValue",
|
|
107
|
+
"onUpdate:modelValue"
|
|
108
|
+
]), { data: i.data }), t.children);
|
|
109
|
+
}, V = () => {
|
|
110
|
+
let t;
|
|
111
|
+
return d(o, h(i.$attrs, { class: y(i.class) }), N(t = r(e).field()) ? t : { default: () => [t] });
|
|
112
|
+
}, H = () => [
|
|
113
|
+
"textarea",
|
|
114
|
+
"editor",
|
|
115
|
+
"select",
|
|
116
|
+
"checkbox",
|
|
117
|
+
"toggle",
|
|
118
|
+
"radio"
|
|
119
|
+
].includes(y(l)) ? r(e)[y(l)]() : r(e).clearableInput(), U = () => {
|
|
120
|
+
let t = r(e).input();
|
|
121
|
+
return y(i.showClear) ? d("div", { class: x("relative", a(y(i.inputClass)).string) }, [t, d(M, {
|
|
122
|
+
class: {
|
|
123
|
+
hidden: !r(e).model.getData(),
|
|
124
|
+
"absolute right-3 -translate-y-1/2 top-1/2 text-gray-400 hover:text-gray-600 cursor-pointer": !0
|
|
125
|
+
},
|
|
126
|
+
onClick: () => {
|
|
127
|
+
r(e).model.replaceData();
|
|
128
|
+
}
|
|
129
|
+
}, null)]) : t;
|
|
130
|
+
}, W = (e) => {
|
|
131
|
+
clearTimeout(f.value), f.value = setTimeout(e, y(i.debounce));
|
|
132
|
+
};
|
|
133
|
+
b(() => [i.masking, u], ([e, t]) => {
|
|
134
|
+
e && t.value && O(e).mask(t.value.$el);
|
|
135
|
+
}, { deep: !0 });
|
|
136
|
+
let G = () => {
|
|
137
|
+
let e = y(u)?.$el;
|
|
138
|
+
if (!y(i.grow) || !(e instanceof HTMLInputElement)) return;
|
|
139
|
+
let t = getComputedStyle(e), n = document.createElement("span");
|
|
140
|
+
Object.assign(n.style, {
|
|
141
|
+
position: "absolute",
|
|
142
|
+
visibility: "hidden",
|
|
143
|
+
whiteSpace: "pre",
|
|
144
|
+
fontFamily: t.fontFamily,
|
|
145
|
+
fontSize: t.fontSize,
|
|
146
|
+
fontWeight: t.fontWeight,
|
|
147
|
+
fontStyle: t.fontStyle,
|
|
148
|
+
letterSpacing: t.letterSpacing
|
|
149
|
+
}), n.textContent = e.value || e.placeholder || "", document.body.append(n);
|
|
150
|
+
let r = t.boxSizing === "border-box" ? [
|
|
151
|
+
"paddingLeft",
|
|
152
|
+
"paddingRight",
|
|
153
|
+
"borderLeftWidth",
|
|
154
|
+
"borderRightWidth"
|
|
155
|
+
].reduce((e, n) => e + (parseFloat(t[n]) || 0), 0) : 0;
|
|
156
|
+
e.style.width = `${Math.ceil(n.getBoundingClientRect().width) + r + 2}px`, n.remove();
|
|
157
|
+
};
|
|
158
|
+
return b([
|
|
159
|
+
u,
|
|
160
|
+
() => r(e).model.getData(),
|
|
161
|
+
() => y(i.placeholder)
|
|
162
|
+
], () => g(G), {
|
|
163
|
+
immediate: !0,
|
|
164
|
+
flush: "post"
|
|
165
|
+
}), {
|
|
166
|
+
template: _,
|
|
167
|
+
label: k,
|
|
168
|
+
input: A,
|
|
169
|
+
textarea: j,
|
|
170
|
+
editor: z,
|
|
171
|
+
select: B,
|
|
172
|
+
checkbox: I,
|
|
173
|
+
radio: L,
|
|
174
|
+
toggle: R,
|
|
175
|
+
field: H,
|
|
176
|
+
clearableInput: U,
|
|
177
|
+
container: V,
|
|
178
|
+
throttle: W,
|
|
179
|
+
resize: G,
|
|
180
|
+
inputRef: u
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/components/Editor.vue?vue&type=script&lang.jsx
|
|
186
|
+
function L(e) {
|
|
187
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !p(e);
|
|
188
|
+
}
|
|
189
|
+
var R = t({
|
|
190
|
+
modelName: "Editor",
|
|
191
|
+
props: { showClear: i({ type: Boolean }) },
|
|
192
|
+
setup(e, t, i) {
|
|
193
|
+
let a, o = v(), c = () => {
|
|
194
|
+
let c, l = r(t).input();
|
|
195
|
+
return d("div", {
|
|
196
|
+
class: {
|
|
197
|
+
"w-full": !0,
|
|
198
|
+
"editor-clearable": y(i.showClear)
|
|
199
|
+
},
|
|
200
|
+
onClick: (e) => {
|
|
201
|
+
e.target.type !== "file" && e.preventDefault();
|
|
202
|
+
}
|
|
203
|
+
}, [d(k, h(n(l.props, "type"), { onLoad: (e) => {
|
|
204
|
+
a = e.instance, o.value = e.instance.container, l.props.onLoad?.(e);
|
|
205
|
+
} }), {
|
|
206
|
+
...l.children,
|
|
207
|
+
toolbar: () => d("div", { class: "w-full flex flex-wrap items-center gap-y-1" }, [
|
|
208
|
+
d("span", { class: "ql-formats" }, [r(e).undo(), r(e).redo()]),
|
|
209
|
+
d("span", { class: "ql-formats" }, [r(e).header()]),
|
|
210
|
+
d("span", { class: "ql-formats" }, [
|
|
211
|
+
r(e).bold(),
|
|
212
|
+
r(e).italic(),
|
|
213
|
+
r(e).underline(),
|
|
214
|
+
r(e).strike(),
|
|
215
|
+
r(e).code()
|
|
216
|
+
]),
|
|
217
|
+
d("span", { class: "ql-formats" }, [r(e).color(), r(e).background()]),
|
|
218
|
+
d("span", { class: "ql-formats" }, [r(e).subscript(), r(e).superscript()]),
|
|
219
|
+
d("span", { class: "ql-formats" }, [
|
|
220
|
+
r(e).ordered(),
|
|
221
|
+
r(e).unordered(),
|
|
222
|
+
r(e).checklist(),
|
|
223
|
+
r(e).outdent(),
|
|
224
|
+
r(e).indent(),
|
|
225
|
+
r(e).align()
|
|
226
|
+
]),
|
|
227
|
+
d("span", { class: "ql-formats" }, [r(e).blockquote(), r(e).codeBlock()]),
|
|
228
|
+
d("span", { class: "ql-formats" }, [r(e).link(), r(e).image()]),
|
|
229
|
+
d("span", { class: "ql-formats" }, [r(e).clean()])
|
|
230
|
+
])
|
|
231
|
+
}), y(i.showClear) && o.value && d(s, { to: o.value }, L(c = r(e).clearButton()) ? c : { default: () => [c] })]);
|
|
232
|
+
}, l = () => r(e).field(), u = () => d(M, {
|
|
233
|
+
class: {
|
|
234
|
+
hidden: !r(e).model.getData(),
|
|
235
|
+
"absolute top-3 right-3 text-gray-400 hover:text-gray-600 cursor-pointer": !0
|
|
236
|
+
},
|
|
237
|
+
onClick: () => {
|
|
238
|
+
r(e).model.replaceData();
|
|
239
|
+
}
|
|
240
|
+
}, null), f = () => d("button", {
|
|
241
|
+
class: "ql-bold",
|
|
242
|
+
title: "Bold"
|
|
243
|
+
}, null), p = () => d("button", {
|
|
244
|
+
class: "ql-italic",
|
|
245
|
+
title: "Italic"
|
|
246
|
+
}, null), m = () => d("button", {
|
|
247
|
+
class: "ql-underline",
|
|
248
|
+
title: "Underline"
|
|
249
|
+
}, null), g = () => d("button", {
|
|
250
|
+
class: "ql-strike",
|
|
251
|
+
title: "Strikethrough"
|
|
252
|
+
}, null), _ = () => d("button", {
|
|
253
|
+
class: "ql-code",
|
|
254
|
+
title: "Inline code"
|
|
255
|
+
}, null), b = () => d("button", {
|
|
256
|
+
class: "ql-list",
|
|
257
|
+
value: "ordered",
|
|
258
|
+
title: "Numbered list"
|
|
259
|
+
}, null), x = () => d("button", {
|
|
260
|
+
class: "ql-list",
|
|
261
|
+
value: "bullet",
|
|
262
|
+
title: "Bulleted list"
|
|
263
|
+
}, null), S = () => d("button", {
|
|
264
|
+
class: "ql-list",
|
|
265
|
+
value: "check",
|
|
266
|
+
title: "Checklist"
|
|
267
|
+
}, null), C = (e) => {
|
|
268
|
+
a?.history[e]();
|
|
269
|
+
};
|
|
270
|
+
return {
|
|
271
|
+
input: c,
|
|
272
|
+
container: l,
|
|
273
|
+
clearButton: u,
|
|
274
|
+
undo: () => d("button", {
|
|
275
|
+
type: "button",
|
|
276
|
+
title: "Undo",
|
|
277
|
+
onClick: () => C("undo")
|
|
278
|
+
}, [d("svg", { viewBox: "0 0 18 18" }, [d("polygon", {
|
|
279
|
+
class: "ql-fill ql-stroke",
|
|
280
|
+
points: "6 10 4 12 2 10 6 10"
|
|
281
|
+
}, null), d("path", {
|
|
282
|
+
class: "ql-stroke",
|
|
283
|
+
d: "M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"
|
|
284
|
+
}, null)])]),
|
|
285
|
+
redo: () => d("button", {
|
|
286
|
+
type: "button",
|
|
287
|
+
title: "Redo",
|
|
288
|
+
onClick: () => C("redo")
|
|
289
|
+
}, [d("svg", { viewBox: "0 0 18 18" }, [d("polygon", {
|
|
290
|
+
class: "ql-fill ql-stroke",
|
|
291
|
+
points: "12 10 14 12 16 10 12 10"
|
|
292
|
+
}, null), d("path", {
|
|
293
|
+
class: "ql-stroke",
|
|
294
|
+
d: "M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5"
|
|
295
|
+
}, null)])]),
|
|
296
|
+
bold: f,
|
|
297
|
+
italic: p,
|
|
298
|
+
underline: m,
|
|
299
|
+
strike: g,
|
|
300
|
+
code: _,
|
|
301
|
+
ordered: b,
|
|
302
|
+
unordered: x,
|
|
303
|
+
checklist: S,
|
|
304
|
+
align: () => d("span", { title: "Alignment" }, [d("select", { class: "ql-align" }, null)]),
|
|
305
|
+
header: () => d("span", { title: "Heading" }, [d("select", { class: "ql-header" }, [
|
|
306
|
+
d("option", { value: "1" }, null),
|
|
307
|
+
d("option", { value: "2" }, null),
|
|
308
|
+
d("option", { value: "3" }, null),
|
|
309
|
+
d("option", { value: "4" }, null),
|
|
310
|
+
d("option", { value: "5" }, null),
|
|
311
|
+
d("option", { value: "6" }, null),
|
|
312
|
+
d("option", { selected: !0 }, null)
|
|
313
|
+
])]),
|
|
314
|
+
color: () => d("span", { title: "Text colour" }, [d("select", { class: "ql-color" }, null)]),
|
|
315
|
+
background: () => d("span", { title: "Highlight" }, [d("select", { class: "ql-background" }, null)]),
|
|
316
|
+
subscript: () => d("button", {
|
|
317
|
+
class: "ql-script",
|
|
318
|
+
value: "sub",
|
|
319
|
+
title: "Subscript"
|
|
320
|
+
}, null),
|
|
321
|
+
superscript: () => d("button", {
|
|
322
|
+
class: "ql-script",
|
|
323
|
+
value: "super",
|
|
324
|
+
title: "Superscript"
|
|
325
|
+
}, null),
|
|
326
|
+
outdent: () => d("button", {
|
|
327
|
+
class: "ql-indent",
|
|
328
|
+
value: "-1",
|
|
329
|
+
title: "Decrease indent"
|
|
330
|
+
}, null),
|
|
331
|
+
indent: () => d("button", {
|
|
332
|
+
class: "ql-indent",
|
|
333
|
+
value: "+1",
|
|
334
|
+
title: "Increase indent"
|
|
335
|
+
}, null),
|
|
336
|
+
blockquote: () => d("button", {
|
|
337
|
+
class: "ql-blockquote",
|
|
338
|
+
title: "Quote"
|
|
339
|
+
}, null),
|
|
340
|
+
codeBlock: () => d("button", {
|
|
341
|
+
class: "ql-code-block",
|
|
342
|
+
title: "Code block"
|
|
343
|
+
}, null),
|
|
344
|
+
link: () => d("button", {
|
|
345
|
+
class: "ql-link",
|
|
346
|
+
title: "Link"
|
|
347
|
+
}, null),
|
|
348
|
+
image: () => d("button", {
|
|
349
|
+
class: "ql-image",
|
|
350
|
+
title: "Image"
|
|
351
|
+
}, null),
|
|
352
|
+
clean: () => d("button", {
|
|
353
|
+
class: "ql-clean",
|
|
354
|
+
title: "Clear formatting"
|
|
355
|
+
}, null)
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
}, I), z = (e, t) => {
|
|
359
|
+
let n = e.__vccOpts || e;
|
|
360
|
+
for (let [e, r] of t) n[e] = r;
|
|
361
|
+
return n;
|
|
362
|
+
}, B = /* @__PURE__ */ e({ default: () => V }), V = /* @__PURE__ */ z(R, [["__scopeId", "data-v-f9ca0d09"]]);
|
|
363
|
+
//#endregion
|
|
364
|
+
export { B as n, I as r, V as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./src-BJaQUsvj.js`),t=require(`./Label-CkJjlfli.js`);let n=require(`vue`),r=require(`tailwind-merge`),i=require(`primevue`),a=require(`uuid`),o=require(`inputmask`);o=e.S(o);let s=require(`primevue/editor`);s=e.S(s);var c={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function l(e,t){return(0,n.openBlock)(),(0,n.createElementBlock)(`svg`,c,[...t[0]||=[(0,n.createElementVNode)(`path`,{fill:`currentColor`,d:`M6.707 5.293L12 10.585l5.293-5.292a1 1 0 0 1 1.414 1.414L13.415 12l5.292 5.293a1 1 0 0 1-1.414 1.414L12 13.415l-5.293 5.292a1 1 0 1 1-1.414-1.414L10.585 12L5.293 6.707a1 1 0 0 1 1.414-1.414`},null,-1)]])}var u=(0,n.markRaw)({name:`tabler-x-filled`,render:l});function d(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!(0,n.isVNode)(e)}var f=(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>v)),p=(0,n.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./Select-D8LFsK4R.js`)).then(e=>e.n)),m=e.c({modelName:`Input`,props:{grow:e.n({type:Boolean}),filled:e.n({type:Boolean}),container:e.n({type:Boolean}),debounce:e.n({type:[Number,String],default:200,validator:e=>/^\d+$/.test(e)}),placeholder:e.n({type:[Boolean,Number,String]}),masking:e.n({type:Object}),type:e.n({type:String}),inputClass:e.n(),class:e.n(),indeterminate:e.n({type:Boolean}),showClear:e.n({type:Boolean}),data:{}},data:e=>[`select`,`editor`].includes((0,n.unref)(e.type))?void 0:e.data,defaultData:void 0,setup(s,c,l){let m=`component_${(0,a.v4)()}`,h=l.type??`text`,g=(0,n.ref)(),_=(0,n.ref)(),v=(0,n.computed)(()=>(0,n.unref)(l.placeholder)===!1||[`number`,`string`].includes(typeof(0,n.unref)(l.placeholder))?(0,n.unref)(l.placeholder):[`number`,`string`].includes(typeof(0,n.unref)(l.label))?(0,n.unref)(l.label):void 0),y=()=>(0,n.unref)(l.container)||(0,n.unref)(l.$attrs.label)||(0,n.unref)(l.grow),b=()=>y()?e.i(s).container():e.i(s).field(),x=()=>(0,n.createVNode)(`label`,{for:m,class:(0,r.twMerge)(e.t((0,n.unref)(l.labelClass)).string)},[(0,n.unref)(l.label)]),S=()=>(0,n.createVNode)(i.InputText,(0,n.mergeProps)({fluid:!(0,n.unref)(l.grow),onInput:()=>e.i(s).resize(),size:`small`,type:(0,n.unref)(h)},e.f(l.$attrs,`label`),(0,n.unref)(v)?{placeholder:(0,n.unref)(v)}:{},{id:m,ref:g,class:(0,r.twMerge)(e.t({"bg-(--colors-F5F6F8)!":(0,n.unref)(l.filled),"pr-8!":(0,n.unref)(l.showClear)}).string,e.t((0,n.unref)(l.inputClass)).string,y()?``:e.t((0,n.unref)(l.class)).string),modelValue:e.i(s).model.getData(),"onUpdate:modelValue":t=>{M(()=>{e.i(s).model.replaceData(t)})}}),null),C=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.Textarea,(0,n.mergeProps)({autoResize:!0},e.f(t.props,`type`)),t.children)},w=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.Checkbox,(0,n.mergeProps)({binary:!0,indeterminate:(0,n.unref)(l.indeterminate)},e.f(t.props,`type`)),t.children)},T=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.RadioButton,e.f(t.props,`type`),t.children)},E=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.ToggleSwitch,(0,n.mergeProps)({binary:!0},e.f(t.props,`type`)),t.children)},D=()=>{let t=e.i(s).input();return(0,n.createVNode)(f,(0,n.mergeProps)(e.f(t.props,[`type`,`label`,`modelValue`,`onUpdate:modelValue`]),{data:l.data}),t.children)},O=()=>{let t=e.i(s).input();return(0,n.createVNode)(p,(0,n.mergeProps)(e.f(t.props,[`type`,`modelValue`,`onUpdate:modelValue`]),{data:l.data}),t.children)},k=()=>{let r;return(0,n.createVNode)(t.t,(0,n.mergeProps)(l.$attrs,{class:(0,n.unref)(l.class)}),d(r=e.i(s).field())?r:{default:()=>[r]})},A=()=>[`textarea`,`editor`,`select`,`checkbox`,`toggle`,`radio`].includes((0,n.unref)(h))?e.i(s)[(0,n.unref)(h)]():e.i(s).clearableInput(),j=()=>{let t=e.i(s).input();return(0,n.unref)(l.showClear)?(0,n.createVNode)(`div`,{class:(0,r.twMerge)(`relative`,e.t((0,n.unref)(l.inputClass)).string)},[t,(0,n.createVNode)(u,{class:{hidden:!e.i(s).model.getData(),"absolute right-3 -translate-y-1/2 top-1/2 text-gray-400 hover:text-gray-600 cursor-pointer":!0},onClick:()=>{e.i(s).model.replaceData()}},null)]):t},M=e=>{clearTimeout(_.value),_.value=setTimeout(e,(0,n.unref)(l.debounce))};(0,n.watch)(()=>[l.masking,g],([e,t])=>{e&&t.value&&(0,o.default)(e).mask(t.value.$el)},{deep:!0});let N=()=>{let e=(0,n.unref)(g)?.$el;if(!(0,n.unref)(l.grow)||!(e instanceof HTMLInputElement))return;let t=getComputedStyle(e),r=document.createElement(`span`);Object.assign(r.style,{position:`absolute`,visibility:`hidden`,whiteSpace:`pre`,fontFamily:t.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,letterSpacing:t.letterSpacing}),r.textContent=e.value||e.placeholder||``,document.body.append(r);let i=t.boxSizing===`border-box`?[`paddingLeft`,`paddingRight`,`borderLeftWidth`,`borderRightWidth`].reduce((e,n)=>e+(parseFloat(t[n])||0),0):0;e.style.width=`${Math.ceil(r.getBoundingClientRect().width)+i+2}px`,r.remove()};return(0,n.watch)([g,()=>e.i(s).model.getData(),()=>(0,n.unref)(l.placeholder)],()=>(0,n.nextTick)(N),{immediate:!0,flush:`post`}),{template:b,label:x,input:S,textarea:C,editor:D,select:O,checkbox:w,radio:T,toggle:E,field:A,clearableInput:j,container:k,throttle:M,resize:N,inputRef:g}}});function h(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!(0,n.isVNode)(e)}var g=e.c({modelName:`Editor`,props:{showClear:e.n({type:Boolean})},setup(t,r,i){let a,o=(0,n.ref)(),c=()=>{let c,l=e.i(r).input();return(0,n.createVNode)(`div`,{class:{"w-full":!0,"editor-clearable":(0,n.unref)(i.showClear)},onClick:e=>{e.target.type!==`file`&&e.preventDefault()}},[(0,n.createVNode)(s.default,(0,n.mergeProps)(e.f(l.props,`type`),{onLoad:e=>{a=e.instance,o.value=e.instance.container,l.props.onLoad?.(e)}}),{...l.children,toolbar:()=>(0,n.createVNode)(`div`,{class:`w-full flex flex-wrap items-center gap-y-1`},[(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).undo(),e.i(t).redo()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).header()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).bold(),e.i(t).italic(),e.i(t).underline(),e.i(t).strike(),e.i(t).code()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).color(),e.i(t).background()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).subscript(),e.i(t).superscript()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).ordered(),e.i(t).unordered(),e.i(t).checklist(),e.i(t).outdent(),e.i(t).indent(),e.i(t).align()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).blockquote(),e.i(t).codeBlock()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).link(),e.i(t).image()]),(0,n.createVNode)(`span`,{class:`ql-formats`},[e.i(t).clean()])])}),(0,n.unref)(i.showClear)&&o.value&&(0,n.createVNode)(n.Teleport,{to:o.value},h(c=e.i(t).clearButton())?c:{default:()=>[c]})])},l=()=>e.i(t).field(),d=()=>(0,n.createVNode)(u,{class:{hidden:!e.i(t).model.getData(),"absolute top-3 right-3 text-gray-400 hover:text-gray-600 cursor-pointer":!0},onClick:()=>{e.i(t).model.replaceData()}},null),f=()=>(0,n.createVNode)(`button`,{class:`ql-bold`,title:`Bold`},null),p=()=>(0,n.createVNode)(`button`,{class:`ql-italic`,title:`Italic`},null),m=()=>(0,n.createVNode)(`button`,{class:`ql-underline`,title:`Underline`},null),g=()=>(0,n.createVNode)(`button`,{class:`ql-strike`,title:`Strikethrough`},null),_=()=>(0,n.createVNode)(`button`,{class:`ql-code`,title:`Inline code`},null),v=()=>(0,n.createVNode)(`button`,{class:`ql-list`,value:`ordered`,title:`Numbered list`},null),y=()=>(0,n.createVNode)(`button`,{class:`ql-list`,value:`bullet`,title:`Bulleted list`},null),b=()=>(0,n.createVNode)(`button`,{class:`ql-list`,value:`check`,title:`Checklist`},null),x=e=>{a?.history[e]()};return{input:c,container:l,clearButton:d,undo:()=>(0,n.createVNode)(`button`,{type:`button`,title:`Undo`,onClick:()=>x(`undo`)},[(0,n.createVNode)(`svg`,{viewBox:`0 0 18 18`},[(0,n.createVNode)(`polygon`,{class:`ql-fill ql-stroke`,points:`6 10 4 12 2 10 6 10`},null),(0,n.createVNode)(`path`,{class:`ql-stroke`,d:`M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9`},null)])]),redo:()=>(0,n.createVNode)(`button`,{type:`button`,title:`Redo`,onClick:()=>x(`redo`)},[(0,n.createVNode)(`svg`,{viewBox:`0 0 18 18`},[(0,n.createVNode)(`polygon`,{class:`ql-fill ql-stroke`,points:`12 10 14 12 16 10 12 10`},null),(0,n.createVNode)(`path`,{class:`ql-stroke`,d:`M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5`},null)])]),bold:f,italic:p,underline:m,strike:g,code:_,ordered:v,unordered:y,checklist:b,align:()=>(0,n.createVNode)(`span`,{title:`Alignment`},[(0,n.createVNode)(`select`,{class:`ql-align`},null)]),header:()=>(0,n.createVNode)(`span`,{title:`Heading`},[(0,n.createVNode)(`select`,{class:`ql-header`},[(0,n.createVNode)(`option`,{value:`1`},null),(0,n.createVNode)(`option`,{value:`2`},null),(0,n.createVNode)(`option`,{value:`3`},null),(0,n.createVNode)(`option`,{value:`4`},null),(0,n.createVNode)(`option`,{value:`5`},null),(0,n.createVNode)(`option`,{value:`6`},null),(0,n.createVNode)(`option`,{selected:!0},null)])]),color:()=>(0,n.createVNode)(`span`,{title:`Text colour`},[(0,n.createVNode)(`select`,{class:`ql-color`},null)]),background:()=>(0,n.createVNode)(`span`,{title:`Highlight`},[(0,n.createVNode)(`select`,{class:`ql-background`},null)]),subscript:()=>(0,n.createVNode)(`button`,{class:`ql-script`,value:`sub`,title:`Subscript`},null),superscript:()=>(0,n.createVNode)(`button`,{class:`ql-script`,value:`super`,title:`Superscript`},null),outdent:()=>(0,n.createVNode)(`button`,{class:`ql-indent`,value:`-1`,title:`Decrease indent`},null),indent:()=>(0,n.createVNode)(`button`,{class:`ql-indent`,value:`+1`,title:`Increase indent`},null),blockquote:()=>(0,n.createVNode)(`button`,{class:`ql-blockquote`,title:`Quote`},null),codeBlock:()=>(0,n.createVNode)(`button`,{class:`ql-code-block`,title:`Code block`},null),link:()=>(0,n.createVNode)(`button`,{class:`ql-link`,title:`Link`},null),image:()=>(0,n.createVNode)(`button`,{class:`ql-image`,title:`Image`},null),clean:()=>(0,n.createVNode)(`button`,{class:`ql-clean`,title:`Clear formatting`},null)}}},m),_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},v=e.x({default:()=>y}),y=_(g,[[`__scopeId`,`data-v-f9ca0d09`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./src-BJaQUsvj.js`);let t=require(`vue`),n=require(`tailwind-merge`),r=require(`primevue`);var i=e.c({model:!1,modelName:`Label`,props:{label:e.n({type:[Number,String],default:`Label`}),labelType:e.n({type:String,default:`lb`,validator:e=>{let n=[`lb`,`on`,`in`,`if`,`over`];if(n.includes(e))return!0;throw Error(`Invalid label type [ ${(0,t.unref)(e)} ], must be of [ ${n.join(`, `)} ]`)}}),invisible:e.n({type:Boolean}),labelLeft:e.n({type:Boolean}),labelRight:e.n({type:Boolean}),labelClass:e.n()},setup(i,a,o){return{template:()=>[`lb`].includes((0,t.unref)(o.labelType))?(0,t.createVNode)(`label`,{class:(0,n.twMerge)(`flex flex-col text-xs gap-y-1`,e.t({"flex-row items-center gap-x-2":(0,t.unref)(o.labelLeft)||(0,t.unref)(o.labelRight)}).string)},[(0,t.createVNode)(`div`,{class:(0,n.twMerge)(`flex items-center h-full`,e.t({"order-1":(0,t.unref)(o.labelRight),invisible:(0,t.unref)(o.invisible)}).string,e.t((0,t.unref)(o.labelClass)).string)},[(0,t.unref)(o.label)]),(0,t.createVNode)(`div`,{class:{"flex grow":!0,"justify-end":(0,t.unref)(o.labelLeft)}},[o.$slots.default()])]):(0,t.createVNode)([`if`].includes((0,t.unref)(o.labelType))?r.IftaLabel:r.FloatLabel,{variant:(0,t.unref)(o.labelType),class:(0,n.twMerge)(e.t((0,t.unref)(o.labelClass)).string)},{default:()=>[(0,t.createVNode)(`label`,{class:{invisible:(0,t.unref)(o.invisible)}},[(0,t.unref)(o.label)]),o.$slots.default()]})}}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { c as e, n as t, t as n } from "./src-DwXft6y4.mjs";
|
|
2
|
+
import { createVNode as r, unref as i } from "vue";
|
|
3
|
+
import { twMerge as a } from "tailwind-merge";
|
|
4
|
+
import { FloatLabel as o, IftaLabel as s } from "primevue";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/components/Label.vue
|
|
7
|
+
var c = e({
|
|
8
|
+
model: !1,
|
|
9
|
+
modelName: "Label",
|
|
10
|
+
props: {
|
|
11
|
+
label: t({
|
|
12
|
+
type: [Number, String],
|
|
13
|
+
default: "Label"
|
|
14
|
+
}),
|
|
15
|
+
labelType: t({
|
|
16
|
+
type: String,
|
|
17
|
+
default: "lb",
|
|
18
|
+
validator: (e) => {
|
|
19
|
+
let t = [
|
|
20
|
+
"lb",
|
|
21
|
+
"on",
|
|
22
|
+
"in",
|
|
23
|
+
"if",
|
|
24
|
+
"over"
|
|
25
|
+
];
|
|
26
|
+
if (t.includes(e)) return !0;
|
|
27
|
+
throw Error(`Invalid label type [ ${i(e)} ], must be of [ ${t.join(", ")} ]`);
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
invisible: t({ type: Boolean }),
|
|
31
|
+
labelLeft: t({ type: Boolean }),
|
|
32
|
+
labelRight: t({ type: Boolean }),
|
|
33
|
+
labelClass: t()
|
|
34
|
+
},
|
|
35
|
+
setup(e, t, c) {
|
|
36
|
+
return { template: () => ["lb"].includes(i(c.labelType)) ? r("label", { class: a("flex flex-col text-xs gap-y-1", n({ "flex-row items-center gap-x-2": i(c.labelLeft) || i(c.labelRight) }).string) }, [r("div", { class: a("flex items-center h-full", n({
|
|
37
|
+
"order-1": i(c.labelRight),
|
|
38
|
+
invisible: i(c.invisible)
|
|
39
|
+
}).string, n(i(c.labelClass)).string) }, [i(c.label)]), r("div", { class: {
|
|
40
|
+
"flex grow": !0,
|
|
41
|
+
"justify-end": i(c.labelLeft)
|
|
42
|
+
} }, [c.$slots.default()])]) : r(["if"].includes(i(c.labelType)) ? s : o, {
|
|
43
|
+
variant: i(c.labelType),
|
|
44
|
+
class: a(n(i(c.labelClass)).string)
|
|
45
|
+
}, { default: () => [r("label", { class: { invisible: i(c.invisible) } }, [i(c.label)]), c.$slots.default()] }) };
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { c as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentPublicInstance } from "vue";
|
|
2
|
+
export declare const setup: {
|
|
3
|
+
type: FunctionConstructor;
|
|
4
|
+
default: (_parent?: {}, self?: {}) => {};
|
|
5
|
+
ReactiveView: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
8
|
+
[x: string]: /*elided*/ any;
|
|
9
|
+
}, (vue: ComponentPublicInstance) => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
10
|
+
[x: string]: /*elided*/ any;
|
|
11
|
+
}> & Readonly<{}>, {
|
|
12
|
+
ReactiveView: boolean;
|
|
13
|
+
instance: import("vue").Ref<any, any>;
|
|
14
|
+
data: import("vue").Ref<{}, {}>;
|
|
15
|
+
getDefaultData: Function;
|
|
16
|
+
modelName: string;
|
|
17
|
+
debug: boolean;
|
|
18
|
+
state: {};
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentPublicInstance } from "vue";
|
|
2
|
+
export declare const setup: {
|
|
3
|
+
type: FunctionConstructor;
|
|
4
|
+
default: (_parent?: {}, self?: {}) => {};
|
|
5
|
+
ReactiveView: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
8
|
+
[x: string]: /*elided*/ any;
|
|
9
|
+
}, (vue: ComponentPublicInstance) => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
10
|
+
[x: string]: /*elided*/ any;
|
|
11
|
+
}> & Readonly<{}>, {
|
|
12
|
+
ReactiveView: boolean;
|
|
13
|
+
instance: import("vue").Ref<any, any>;
|
|
14
|
+
data: import("vue").Ref<{}, {}>;
|
|
15
|
+
getDefaultData: Function;
|
|
16
|
+
modelName: string;
|
|
17
|
+
debug: boolean;
|
|
18
|
+
state: {};
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./src-BJaQUsvj.js`),t=require(`./Label-CkJjlfli.js`);let n=require(`vue`),r=require(`tailwind-merge`),i=require(`primevue`),a=require(`uuid`);var o={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function s(e,t){return(0,n.openBlock)(),(0,n.createElementBlock)(`svg`,o,[...t[0]||=[(0,n.createElementVNode)(`path`,{fill:`currentColor`,d:`M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z`},null,-1)]])}var c=(0,n.markRaw)({name:`mdi-check`,render:s});function l(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!(0,n.isVNode)(e)}var u=e.c({modelName:`Select`,props:{data:{},defaultData:e.n(),onShow:e.n({type:Function}),onFilter:e.n({type:Function}),multiple:e.n({type:Boolean}),filled:e.n({type:Boolean}),sorted:e.n({type:Boolean,default:!0}),debounce:e.n({type:[Number,String],default:200,validator:e=>/^\d+$/.test(e)}),placeholder:e.n({type:[Boolean,Number,String],default:`None`}),dropdown:e.n({type:Boolean,default:!0}),type:e.n({type:String,default:`select`}),options:e.n({type:Array,default:[]}),optionLabel:e.n({type:[Function,Number,String]}),optionValue:e.n({type:[Function,Number,String]}),optionProperty:e.n({type:[Function,Number,String]}),filterInputClass:e.n(),inputClass:e.n(),class:e.n()},data:t=>{let r=(0,n.unref)(t.data);return e.o(r===void 0?(0,n.unref)(t.defaultData)??((0,n.unref)(t.multiple)?[]:{}):r)},defaultData:e=>(0,n.unref)(e.defaultData)??((0,n.unref)(e.multiple)?[]:{}),setup(o,s,u){let d=`component_${(0,a.v4)()}`,f=(0,n.ref)(),p=(0,n.ref)(),m=(0,n.ref)([]),h=(0,n.reactive)({status:!1}),g=(0,n.computed)(()=>(0,n.unref)(u.placeholder)===!1||[`number`,`string`].includes(typeof(0,n.unref)(u.placeholder))?(0,n.unref)(u.placeholder):[`number`,`string`].includes(typeof(0,n.unref)(u.$attrs.label))?(0,n.unref)(u.$attrs.label):void 0),_=(0,n.computed)(()=>(0,n.unref)(u.multiple)?i.MultiSelect:i.Select),v=t=>((0,n.unref)(m)??[]).find(n=>e.i(o).getValue(n)===e.i(o).getValue(t)),y=(0,n.computed)(()=>{try{if((0,n.unref)(u.sorted)===!1)return(0,n.unref)(m);let t=e.i(o).model.getData();if(!t||Array.isArray(t)&&t.length===0)return(0,n.unref)(m);let r=new Set((Array.isArray(t)?t:[t]).map(t=>{let n=v(t);return n?e.i(o).getValue(n):e.i(o).getValue(t)})),i=new Map((0,n.unref)(m).map((e,t)=>[e,t]));return(0,n.unref)(m).toSorted((t,n)=>{let a=r.has(e.i(o).getValue(t)),s=r.has(e.i(o).getValue(n));return a&&!s?-1:!a&&s?1:a&&s?(i.get(n)??0)-(i.get(t)??0):0})}catch{return(0,n.unref)(m)}}),b=(0,n.computed)(()=>{let t=e.i(o).model.getData();return((0,n.unref)(u.multiple)?(Array.isArray(t)?t:[]).map(t=>e.i(o).getProperty(v(t))):e.i(o).getProperty(v(t)))??t}),x=(0,n.computed)(()=>{if((0,n.unref)(m).some(e=>typeof e==`object`&&!!e))return t=>e.i(o).getLabel(t)}),S=e=>{try{return typeof u.optionValue==`function`?u.optionValue(e):[`Object`].includes(e.constructor.name)?e[(0,n.unref)(u.optionValue)??`id`]:e}catch{return e}},C=e=>{try{return typeof u.optionLabel==`function`?u.optionLabel(e):[`Object`].includes(e.constructor.name)?e[(0,n.unref)(u.optionLabel)??`name`]:e}catch{return e}},w=e=>{try{return typeof u.optionProperty==`function`?u.optionProperty(e):[`Object`].includes(e.constructor.name)&&(0,n.unref)(u.optionProperty)?e[(0,n.unref)(u.optionProperty)]:e}catch{return e}},T=()=>{let r;return(0,n.unref)(u.$attrs.label)?(0,n.createVNode)(t.t,(0,n.mergeProps)(u.$attrs,{class:(0,n.unref)(u.class)}),l(r=e.i(o).input())?r:{default:()=>[r]}):e.i(o).input()},E=()=>(0,n.createVNode)(_.value,(0,n.mergeProps)({fluid:!0,size:`small`,appendTo:`self`,autoFilterFocus:(0,n.unref)(u.$attrs.filter),resetFilterOnHide:!0,resetFilterOnClear:!0,loading:h.status,options:(0,n.unref)(y)},e.f(u.$attrs,`class`),[`number`,`string`].includes(typeof(0,n.unref)(g))?{placeholder:String((0,n.unref)(g))}:{},{id:d,ref:f,class:(0,r.twMerge)(e.t({"bg-(--colors-F5F6F8)!":(0,n.unref)(u.filled)}).string,e.t((0,n.unref)(u.inputClass)).string,(0,n.unref)(u.$attrs.label)?``:e.t((0,n.unref)(u.class)).string),modelValue:(0,n.unref)(b),onFilter:({value:t})=>{typeof u.onFilter==`function`&&A(()=>{e.m({loading:h,try:async()=>{let e=await u.onFilter({query:t});Array.isArray(e)?m.value=e:typeof e==`function`&&(m.value=e())}})})},onShow:()=>{typeof u.onShow==`function`&&A(()=>{e.m({loading:h,try:async()=>{let e=await u.onShow();Array.isArray(e)?m.value=e:typeof e==`function`&&(m.value=e())}})})},optionLabel:(0,n.unref)(x),pt:{...(0,n.unref)(u.$attrs.pt),...(0,n.unref)(u.multiple)?{header:e.i(o).allRow()}:{},pcFilter:{...(0,n.unref)(u.$attrs.pt)?.pcFilter,root:{...(0,n.unref)(u.$attrs.pt)?.pcFilter?.root,class:(0,r.twMerge)((0,n.unref)(u.$attrs.pt)?.pcFilter?.root?.class,e.t((0,n.unref)(u.filterInputClass)).string)}}}},(0,n.unref)(u.optionProperty)?{optionValue:t=>e.i(o).getProperty(t)}:{},{"onUpdate:modelValue":t=>{A(()=>{e.i(o).model.replaceData(e.i(o).getProperty(t))})}}),{...u.$slots,...(0,n.unref)(u.dropdown)?{}:{dropdownicon:()=>``},...(0,n.unref)(u.multiple)?{headercheckboxicon:(...t)=>(u.$slots.headercheckboxicon||e.i(o).headerCheckboxIconSlot)(...t)}:{},...e.i(o).valueSlot?{value:(t,...n)=>u.$slots.value({...t,value:e.i(o).valueSlot(t,...n)},...n)}:{},...e.i(o).optionSlot?{option:(t,...n)=>u.$slots.option({...t,option:e.i(o).optionSlot(t,...n)},...n)}:{}}),D=({class:t,checked:r})=>(0,n.createVNode)(`div`,{class:`absolute flex items-center`},[(0,n.createVNode)(c,{class:{[t]:!0,invisible:!r,"relative left-1/2 -translate-x-1/2":!0}},null),e.i(o).selectAllOptionText()]),O=()=>({class:`m-(--p-multiselect-list-padding)! mb-0! p-(--p-multiselect-option-padding)! rounded-(--p-multiselect-option-border-radius)! cursor-pointer hover:bg-(--p-multiselect-option-focus-background)! hover:text-(--p-multiselect-option-focus-color)!`,onMouseenter:()=>{(0,n.unref)(f)&&((0,n.unref)(f).focusedOptionIndex=-1)},onClick:e=>{e.target.closest(`.p-checkbox-input, .p-multiselect-filter-container`)||e.currentTarget.querySelector(`.p-checkbox-input`)?.click()}}),k=()=>(0,n.createVNode)(`div`,{class:`relative left-5 text-(--p-multiselect-option-color)`},[(0,n.createTextVNode)(`All`)]),A=e=>{clearTimeout(p.value),p.value=setTimeout(e,(0,n.unref)(u.debounce))};return(0,n.watch)(()=>(0,n.unref)(u.options),e=>{m.value=e},{immediate:!0}),(0,n.onBeforeUnmount)(()=>{clearTimeout(p.value)}),{template:T,input:E,getLabel:C,getValue:S,getProperty:w,getOption:v,headerCheckboxIconSlot:D,allRow:O,selectAllOptionText:k,debounce:A,inputRef:f,timeoutRef:p,optionsRef:m,computedOptionsRef:y,computedSelectionsRef:b,loadingRef:h}}}),d=e.x({default:()=>f}),f=u;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|