@razaman2/reactive-view 0.1.0-beta.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1 -1
  3. package/dist/Editor-BX8prqWt.mjs +364 -0
  4. package/dist/Editor-DKILsiST.js +1 -0
  5. package/dist/Label-B63BpiJm.mjs +49 -0
  6. package/dist/Label-ClklvtMk.js +1 -0
  7. package/dist/ReactiveView.d.mts +20 -0
  8. package/dist/ReactiveView.d.ts +20 -0
  9. package/dist/Select-CSA5Sk_b.mjs +238 -0
  10. package/dist/Select-CqG647qR.js +1 -0
  11. package/dist/Subscription.d.mts +17 -0
  12. package/dist/Subscription.d.ts +17 -0
  13. package/dist/Subscriptions.d.mts +5 -0
  14. package/dist/Subscriptions.d.ts +5 -0
  15. package/dist/Types.d.mts +28 -0
  16. package/dist/Types.d.ts +28 -0
  17. package/dist/components/Button.vue.d.mts +3 -0
  18. package/dist/components/Button.vue.d.ts +3 -0
  19. package/dist/components/ConfirmationModal.vue.d.mts +3 -0
  20. package/dist/components/ConfirmationModal.vue.d.ts +3 -0
  21. package/dist/components/CustomAlert.vue.d.mts +69 -0
  22. package/dist/components/CustomAlert.vue.d.ts +69 -0
  23. package/dist/components/CustomButton.vue.d.mts +3 -0
  24. package/dist/components/CustomButton.vue.d.ts +3 -0
  25. package/dist/components/CustomModal.vue.d.mts +3 -0
  26. package/dist/components/CustomModal.vue.d.ts +3 -0
  27. package/dist/components/CustomTable.vue.d.mts +3 -0
  28. package/dist/components/CustomTable.vue.d.ts +3 -0
  29. package/dist/components/CustomTableRow.vue.d.mts +3 -0
  30. package/dist/components/CustomTableRow.vue.d.ts +3 -0
  31. package/dist/components/Datetime.vue.d.mts +3 -0
  32. package/dist/components/Datetime.vue.d.ts +3 -0
  33. package/dist/components/DraggableList.vue.d.mts +3 -0
  34. package/dist/components/DraggableList.vue.d.ts +3 -0
  35. package/dist/components/Editor.vue.d.mts +3 -0
  36. package/dist/components/Editor.vue.d.ts +3 -0
  37. package/dist/components/Input.vue.d.mts +3 -0
  38. package/dist/components/Input.vue.d.ts +3 -0
  39. package/dist/components/ItemsList.vue.d.mts +3 -0
  40. package/dist/components/ItemsList.vue.d.ts +3 -0
  41. package/dist/components/Label.vue.d.mts +3 -0
  42. package/dist/components/Label.vue.d.ts +3 -0
  43. package/dist/components/ListPagination.vue.d.mts +3 -0
  44. package/dist/components/ListPagination.vue.d.ts +3 -0
  45. package/dist/components/Popover.vue.d.mts +3 -0
  46. package/dist/components/Popover.vue.d.ts +3 -0
  47. package/dist/components/Select.vue.d.mts +3 -0
  48. package/dist/components/Select.vue.d.ts +3 -0
  49. package/dist/components/drag.d.mts +1 -0
  50. package/dist/components/drag.d.ts +1 -0
  51. package/dist/components/index.d.mts +17 -0
  52. package/dist/components/index.d.ts +17 -0
  53. package/dist/components/masks.d.mts +22 -0
  54. package/dist/components/masks.d.ts +22 -0
  55. package/dist/components.js +1 -0
  56. package/dist/components.mjs +1660 -0
  57. package/dist/index.d.mts +42 -121
  58. package/dist/index.d.ts +42 -121
  59. package/dist/index.js +1 -963
  60. package/dist/index.mjs +2 -916
  61. package/dist/reactive-view.css +2 -0
  62. package/dist/rolldown-runtime-C-QNzSnW.mjs +11 -0
  63. package/dist/src-CB2Ym95H.js +1 -0
  64. package/dist/src-DgPt5VTg.mjs +523 -0
  65. 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 { d as t, i as n, n as r, s as i, t as a } from "./src-DgPt5VTg.mjs";
3
+ import { t as o } from "./Label-B63BpiJm.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-CSA5Sk_b.mjs").then((e) => e.n)), I = i({
32
+ modelName: "Input",
33
+ props: {
34
+ grow: r({ type: Boolean }),
35
+ filled: r({ type: Boolean }),
36
+ container: r({ type: Boolean }),
37
+ debounce: r({
38
+ type: [Number, String],
39
+ default: 200,
40
+ validator: (e) => /^\d+$/.test(e)
41
+ }),
42
+ placeholder: r({ type: [
43
+ Boolean,
44
+ Number,
45
+ String
46
+ ] }),
47
+ masking: r({ type: Object }),
48
+ type: r({ type: String }),
49
+ inputClass: r(),
50
+ class: r(),
51
+ indeterminate: r({ type: Boolean }),
52
+ showClear: r({ 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, r, 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() ? n(e).container() : n(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: () => n(e).resize(),
64
+ size: "small",
65
+ type: y(l)
66
+ }, t(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: n(e).model.getData(),
74
+ "onUpdate:modelValue": (t) => {
75
+ W(() => {
76
+ n(e).model.replaceData(t);
77
+ });
78
+ }
79
+ }), null), j = () => {
80
+ let r = n(e).input();
81
+ return d(T, h({ autoResize: !0 }, t(r.props, "type")), r.children);
82
+ }, I = () => {
83
+ let r = n(e).input();
84
+ return d(S, h({
85
+ binary: !0,
86
+ indeterminate: y(i.indeterminate)
87
+ }, t(r.props, "type")), r.children);
88
+ }, L = () => {
89
+ let r = n(e).input();
90
+ return d(w, t(r.props, "type"), r.children);
91
+ }, R = () => {
92
+ let r = n(e).input();
93
+ return d(E, h({ binary: !0 }, t(r.props, "type")), r.children);
94
+ }, z = () => {
95
+ let r = n(e).input();
96
+ return d(P, h(t(r.props, [
97
+ "type",
98
+ "label",
99
+ "modelValue",
100
+ "onUpdate:modelValue"
101
+ ]), { data: i.data }), r.children);
102
+ }, B = () => {
103
+ let r = n(e).input();
104
+ return d(F, h(t(r.props, [
105
+ "type",
106
+ "modelValue",
107
+ "onUpdate:modelValue"
108
+ ]), { data: i.data }), r.children);
109
+ }, V = () => {
110
+ let t;
111
+ return d(o, h(i.$attrs, { class: y(i.class) }), N(t = n(e).field()) ? t : { default: () => [t] });
112
+ }, H = () => [
113
+ "textarea",
114
+ "editor",
115
+ "select",
116
+ "checkbox",
117
+ "toggle",
118
+ "radio"
119
+ ].includes(y(l)) ? n(e)[y(l)]() : n(e).clearableInput(), U = () => {
120
+ let t = n(e).input();
121
+ return y(i.showClear) ? d("div", { class: x("relative", a(y(i.inputClass)).string) }, [t, d(M, {
122
+ class: {
123
+ hidden: !n(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
+ n(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
+ () => n(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 = i({
190
+ modelName: "Editor",
191
+ props: { showClear: r({ type: Boolean }) },
192
+ setup(e, r, i) {
193
+ let a, o = v(), c = () => {
194
+ let c, l = n(r).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(t(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" }, [n(e).undo(), n(e).redo()]),
209
+ d("span", { class: "ql-formats" }, [n(e).header()]),
210
+ d("span", { class: "ql-formats" }, [
211
+ n(e).bold(),
212
+ n(e).italic(),
213
+ n(e).underline(),
214
+ n(e).strike(),
215
+ n(e).code()
216
+ ]),
217
+ d("span", { class: "ql-formats" }, [n(e).color(), n(e).background()]),
218
+ d("span", { class: "ql-formats" }, [n(e).subscript(), n(e).superscript()]),
219
+ d("span", { class: "ql-formats" }, [
220
+ n(e).ordered(),
221
+ n(e).unordered(),
222
+ n(e).checklist(),
223
+ n(e).outdent(),
224
+ n(e).indent(),
225
+ n(e).align()
226
+ ]),
227
+ d("span", { class: "ql-formats" }, [n(e).blockquote(), n(e).codeBlock()]),
228
+ d("span", { class: "ql-formats" }, [n(e).link(), n(e).image()]),
229
+ d("span", { class: "ql-formats" }, [n(e).clean()])
230
+ ])
231
+ }), y(i.showClear) && o.value && d(s, { to: o.value }, L(c = n(e).clearButton()) ? c : { default: () => [c] })]);
232
+ }, l = () => n(e).field(), u = () => d(M, {
233
+ class: {
234
+ hidden: !n(e).model.getData(),
235
+ "absolute top-3 right-3 text-gray-400 hover:text-gray-600 cursor-pointer": !0
236
+ },
237
+ onClick: () => {
238
+ n(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-CB2Ym95H.js`),t=require(`./Label-ClklvtMk.js`);let n=require(`vue`),r=require(`tailwind-merge`),i=require(`primevue`),a=require(`uuid`),o=require(`inputmask`);o=e.x(o);let s=require(`primevue/editor`);s=e.x(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-CqG647qR.js`)).then(e=>e.n)),m=e.s({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.d(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.d(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.d(t.props,`type`)),t.children)},T=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.RadioButton,e.d(t.props,`type`),t.children)},E=()=>{let t=e.i(s).input();return(0,n.createVNode)(i.ToggleSwitch,(0,n.mergeProps)({binary:!0},e.d(t.props,`type`)),t.children)},D=()=>{let t=e.i(s).input();return(0,n.createVNode)(f,(0,n.mergeProps)(e.d(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.d(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.s({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.d(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.b({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,49 @@
1
+ import { n as e, s as t, t as n } from "./src-DgPt5VTg.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 = t({
8
+ model: !1,
9
+ modelName: "Label",
10
+ props: {
11
+ label: e({
12
+ type: [Number, String],
13
+ default: "Label"
14
+ }),
15
+ labelType: e({
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: e({ type: Boolean }),
31
+ labelLeft: e({ type: Boolean }),
32
+ labelRight: e({ type: Boolean }),
33
+ labelClass: e()
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 @@
1
+ const e=require(`./src-CB2Ym95H.js`);let t=require(`vue`),n=require(`tailwind-merge`),r=require(`primevue`);var i=e.s({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,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;