@base-framework/ui 0.0.19 → 0.0.20
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/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { V as w, a as U } from "./veil-DSQdR6CM.js";
|
|
|
5
5
|
import { Icons as R } from "./icons.es.js";
|
|
6
6
|
import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ca, p as Ta, q as ca, S as Da, n as Ia, o as Sa, T as ba, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-BqQwYCFz.js";
|
|
7
7
|
import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-B5TK6tLi.js";
|
|
8
|
-
import { B as Oa, m as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, q as Xa, p as Ya, n as Za, o as $a, T as as, k as ss, U as es, W as os, f as ts, h as rs, i as ns, c as is, d as ls, b as ps, e as us, a as ms, g as ds } from "./signature-
|
|
8
|
+
import { B as Oa, m as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, q as Xa, p as Ya, n as Za, o as $a, T as as, k as ss, U as es, W as os, f as ts, h as rs, i as ns, c as is, d as ls, b as ps, e as us, a as ms, g as ds } from "./signature-C9kBM8qz.js";
|
|
9
9
|
import { B as Cs, I as Ts, M as cs, d as Ds, e as Is, g as Ss, N as bs, b as Bs, a as Ps, f as Fs, P as Ms, c as ks, S as Ns, T as vs } from "./mobile-nav-wrapper-CguousG5.js";
|
|
10
10
|
import { B as xs, a as hs, C as ys, F as Ws, b as Ls, c as As, M as Hs, P as ws, S as Us } from "./sidebar-menu-page-22AUZwFc.js";
|
|
11
11
|
import { A as Rs, F as Es, M as Gs, a as Vs, T as js } from "./aside-template-D0KANPjh.js";
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, m as o, C as t, j as r, D as n, l, H as i, I as d, N as b, O as v, P as g, S as p, q as u, p as N, n as k, o as C, T as D, k as M, U as T, W as c, f as B, h as m, i as y, c as W, d as h, b as H, e as P, a as S, g as f } from "./signature-
|
|
1
|
+
import { B as s, m as o, C as t, j as r, D as n, l, H as i, I as d, N as b, O as v, P as g, S as p, q as u, p as N, n as k, o as C, T as D, k as M, U as T, W as c, f as B, h as m, i as y, c as W, d as h, b as H, e as P, a as S, g as f } from "./signature-C9kBM8qz.js";
|
|
2
2
|
import { b as I, C as L, D as O, a as F, F as U, M as G, c as j, p as q } from "./calendar-B5TK6tLi.js";
|
|
3
3
|
import { B as z, I as A, M as E, d as J, e as K, g as Q, N as R, b as V, a as X, f as Y, P as Z, c as _, S as $, T as aa } from "./mobile-nav-wrapper-CguousG5.js";
|
|
4
4
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Button as v, Div as o, On as U, Span as
|
|
2
|
-
import { Atom as u, Component as
|
|
3
|
-
import { B, I as z } from "./icon-B9QUT2NY.js";
|
|
4
|
-
import { Icons as
|
|
1
|
+
import { Button as v, Div as o, On as U, Span as y, Th as O, UseParent as Y, I as E, Thead as F, Tr as H, Table as Q, P as m, Li as D, Time as X, Nav as S, Ul as b, Section as P } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as u, Component as f, Data as L, DateTime as q, Jot as R, router as k, NavLink as M, base as B, Dom as I } from "@base-framework/base";
|
|
3
|
+
import { B as C, I as z } from "./icon-B9QUT2NY.js";
|
|
4
|
+
import { Icons as w } from "./icons.es.js";
|
|
5
5
|
import { TableBody as K, List as _, IntervalTimer as G } from "@base-framework/organisms";
|
|
6
6
|
import { C as V, I as J, H as Z } from "./inputs-O_WkdbI3.js";
|
|
7
7
|
import { A as ee, P as te } from "./calendar-B5TK6tLi.js";
|
|
@@ -14,9 +14,9 @@ u(({ value: t, label: e }) => v({
|
|
|
14
14
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
15
15
|
onState: ["performance", { active: t }],
|
|
16
16
|
dataSet: ["performance", ["state", t, "active"]],
|
|
17
|
-
click: (s, { state:
|
|
17
|
+
click: (s, { state: a }) => a.performance = t
|
|
18
18
|
}, e));
|
|
19
|
-
class Ke extends
|
|
19
|
+
class Ke extends f {
|
|
20
20
|
/**
|
|
21
21
|
* This will declare the props for the compiler.
|
|
22
22
|
*
|
|
@@ -38,49 +38,49 @@ const se = (t) => {
|
|
|
38
38
|
const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
|
|
39
39
|
return e.getDay() === 4 || // December 31 is a Thursday
|
|
40
40
|
s.getDay() === 4;
|
|
41
|
-
},
|
|
41
|
+
}, ae = (t) => {
|
|
42
42
|
const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
|
|
43
43
|
e.setDate(e.getDate() - s + 3);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const i = Math.ceil((e -
|
|
47
|
-
return i > 52 && !se(
|
|
44
|
+
const a = e.getFullYear(), n = new Date(a, 0, 4);
|
|
45
|
+
n.setDate(n.getDate() - (n.getDay() + 6) % 7);
|
|
46
|
+
const i = Math.ceil((e - n) / 6048e5) + 1;
|
|
47
|
+
return i > 52 && !se(a) ? {
|
|
48
48
|
weekNumber: 1,
|
|
49
|
-
year:
|
|
49
|
+
year: a + 1
|
|
50
50
|
} : {
|
|
51
51
|
weekNumber: i,
|
|
52
|
-
year:
|
|
52
|
+
year: a
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, ne = (t, e, s) => {
|
|
55
55
|
if (s === 0) return [];
|
|
56
|
-
const
|
|
56
|
+
const a = new Date(t, e, 0).getDate();
|
|
57
57
|
return Array.from(
|
|
58
58
|
{ length: s },
|
|
59
|
-
(
|
|
59
|
+
(n, i) => new Date(t, e - 1, a - s + i + 1)
|
|
60
60
|
);
|
|
61
|
-
}, ie = (t, e, s) => Array.from({ length: s }, (
|
|
62
|
-
const s = new Date(e, 0, 4),
|
|
63
|
-
|
|
64
|
-
const i = new Date(
|
|
65
|
-
return i.setDate(
|
|
61
|
+
}, ie = (t, e, s) => Array.from({ length: s }, (a, n) => new Date(t, e + 1, n + 1)), T = (t, e) => {
|
|
62
|
+
const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, n = new Date(s);
|
|
63
|
+
n.setDate(s.getDate() - a);
|
|
64
|
+
const i = new Date(n);
|
|
65
|
+
return i.setDate(n.getDate() + (t - 1) * 7), i;
|
|
66
66
|
}, _e = (t, e) => {
|
|
67
|
-
const s = new Date(t, e, 1).getDay(),
|
|
67
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = [];
|
|
68
68
|
let i = [];
|
|
69
|
-
for (let l = 1 - s; l <=
|
|
69
|
+
for (let l = 1 - s; l <= a; l++) {
|
|
70
70
|
const d = new Date(t, e, l);
|
|
71
|
-
i.push(l > 0 ? d : null), (i.length === 7 || l ===
|
|
71
|
+
i.push(l > 0 ? d : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return n;
|
|
74
74
|
}, Ge = (t, e) => {
|
|
75
|
-
const s = new Date(t, e + 1, 0).getDate(),
|
|
76
|
-
let
|
|
75
|
+
const s = new Date(t, e + 1, 0).getDate(), a = [];
|
|
76
|
+
let n = [];
|
|
77
77
|
for (let i = 1; i <= s; i++)
|
|
78
|
-
|
|
79
|
-
return
|
|
78
|
+
n.push(new Date(t, e, i)), n.length === 7 && (a.push(n), n = []);
|
|
79
|
+
return n.length > 0 && a.push(n), a;
|
|
80
80
|
}, oe = (t, e, s) => {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
}, le = ({ day: t, month: e, year: s, weekNumber:
|
|
81
|
+
const a = /* @__PURE__ */ new Date();
|
|
82
|
+
return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
|
|
83
|
+
}, le = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: n }) => {
|
|
84
84
|
const i = oe(t, e, s);
|
|
85
85
|
return v({
|
|
86
86
|
text: t || "",
|
|
@@ -90,21 +90,21 @@ const se = (t) => {
|
|
|
90
90
|
${i ? "bg-accent text-accent-foreground" : ""}
|
|
91
91
|
hover:bg-primary hover:text-primary-foreground
|
|
92
92
|
`,
|
|
93
|
-
click: () => a
|
|
93
|
+
click: () => n(a, s)
|
|
94
94
|
});
|
|
95
95
|
}, re = (t, e) => {
|
|
96
|
-
const s = new Date(t, e, 1).getDay(),
|
|
96
|
+
const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = ne(t, e, s), i = Array.from({ length: a }, (r, p) => new Date(t, e, p + 1)), l = (n.length + i.length) % 7, d = l === 0 ? 0 : 7 - l, c = ie(t, e, d), h = [...n, ...i, ...c], g = [];
|
|
97
97
|
for (let r = 0; r < h.length; r += 7) {
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
const p = h.slice(r, r + 7), x = p.find((j) => j) || new Date(t, e, 1), { weekNumber: $, year: A } = ae(x);
|
|
99
|
+
g.push({
|
|
100
100
|
weekNumber: $,
|
|
101
101
|
year: A,
|
|
102
|
-
days:
|
|
102
|
+
days: p
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
return
|
|
106
|
-
}, ce = ({ selectWeek: t }) => U("month", (e, s, { data:
|
|
107
|
-
const { year:
|
|
105
|
+
return g;
|
|
106
|
+
}, ce = ({ selectWeek: t }) => U("month", (e, s, { data: a }) => {
|
|
107
|
+
const { year: n, month: i, currentDate: l } = a, d = re(n, i);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -115,12 +115,12 @@ const se = (t) => {
|
|
|
115
115
|
class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
|
|
116
116
|
},
|
|
117
117
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
118
|
-
(c) =>
|
|
118
|
+
(c) => y({ class: "px-1 py-1", text: c })
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
// Render each "week" row
|
|
122
122
|
...d.map(
|
|
123
|
-
({ weekNumber: c, days: h, year:
|
|
123
|
+
({ weekNumber: c, days: h, year: g }) => o({
|
|
124
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
125
|
onSet: ["currentWeek", {
|
|
126
126
|
ring: c
|
|
@@ -129,7 +129,7 @@ const se = (t) => {
|
|
|
129
129
|
// Left column: ISO week number
|
|
130
130
|
o({
|
|
131
131
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
132
|
-
click: () => t(c,
|
|
132
|
+
click: () => t(c, g),
|
|
133
133
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
134
134
|
onSet: ["currentWeek", {
|
|
135
135
|
"text-primary-foreground": c,
|
|
@@ -156,7 +156,7 @@ const se = (t) => {
|
|
|
156
156
|
)
|
|
157
157
|
]
|
|
158
158
|
);
|
|
159
|
-
}), W = ({ label: t, click: e }) =>
|
|
159
|
+
}), W = ({ label: t, click: e }) => C(
|
|
160
160
|
{
|
|
161
161
|
class: `
|
|
162
162
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
@@ -167,10 +167,10 @@ const se = (t) => {
|
|
|
167
167
|
click: e,
|
|
168
168
|
"aria-label": `${t} month`,
|
|
169
169
|
variant: "icon",
|
|
170
|
-
icon: t === "Previous" ?
|
|
170
|
+
icon: t === "Previous" ? w.chevron.single.left : w.chevron.single.right
|
|
171
171
|
}
|
|
172
172
|
), de = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
|
|
173
|
-
|
|
173
|
+
y("[[monthName]] [[year]]"),
|
|
174
174
|
W({
|
|
175
175
|
label: "Previous",
|
|
176
176
|
click: e
|
|
@@ -180,7 +180,7 @@ const se = (t) => {
|
|
|
180
180
|
click: t
|
|
181
181
|
})
|
|
182
182
|
]);
|
|
183
|
-
class Ve extends
|
|
183
|
+
class Ve extends f {
|
|
184
184
|
/**
|
|
185
185
|
* This will declare the props for the compiler.
|
|
186
186
|
*
|
|
@@ -195,12 +195,12 @@ class Ve extends g {
|
|
|
195
195
|
* @returns {Data}
|
|
196
196
|
*/
|
|
197
197
|
setData() {
|
|
198
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e),
|
|
199
|
-
return new
|
|
200
|
-
monthName: this.getMonthName(
|
|
201
|
-
year:
|
|
202
|
-
month:
|
|
203
|
-
currentDate:
|
|
198
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = T(s, e.getFullYear());
|
|
199
|
+
return new L({
|
|
200
|
+
monthName: this.getMonthName(a.getMonth()),
|
|
201
|
+
year: a.getFullYear(),
|
|
202
|
+
month: a.getMonth(),
|
|
203
|
+
currentDate: a.getDate(),
|
|
204
204
|
currentWeek: s
|
|
205
205
|
});
|
|
206
206
|
}
|
|
@@ -221,10 +221,10 @@ class Ve extends g {
|
|
|
221
221
|
* @returns {number}
|
|
222
222
|
*/
|
|
223
223
|
calculateCurrentWeek(e) {
|
|
224
|
-
const s = new Date(e.valueOf()),
|
|
225
|
-
s.setDate(s.getDate() -
|
|
226
|
-
const
|
|
227
|
-
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((
|
|
224
|
+
const s = new Date(e.valueOf()), a = (e.getDay() + 6) % 7;
|
|
225
|
+
s.setDate(s.getDate() - a + 3);
|
|
226
|
+
const n = s.valueOf();
|
|
227
|
+
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((n - s) / 6048e5);
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Gets the name of the month.
|
|
@@ -242,8 +242,8 @@ class Ve extends g {
|
|
|
242
242
|
*/
|
|
243
243
|
goToPreviousMonth() {
|
|
244
244
|
const e = this.data;
|
|
245
|
-
let { year: s, month:
|
|
246
|
-
|
|
245
|
+
let { year: s, month: a } = e;
|
|
246
|
+
a === 0 ? (a = 11, s--) : a--, this.setDate(a, s);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Updates the calendar to show the next month.
|
|
@@ -252,8 +252,8 @@ class Ve extends g {
|
|
|
252
252
|
*/
|
|
253
253
|
goToNextMonth() {
|
|
254
254
|
const e = this.data;
|
|
255
|
-
let { year: s, month:
|
|
256
|
-
|
|
255
|
+
let { year: s, month: a } = e;
|
|
256
|
+
a === 11 ? (a = 0, s++) : a++, this.setDate(a, s);
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* Sets the selected date.
|
|
@@ -263,12 +263,12 @@ class Ve extends g {
|
|
|
263
263
|
* @param {number|null} [date=null]
|
|
264
264
|
* @returns {void}
|
|
265
265
|
*/
|
|
266
|
-
setDate(e, s,
|
|
266
|
+
setDate(e, s, a) {
|
|
267
267
|
this.data.set({
|
|
268
268
|
year: s,
|
|
269
269
|
month: e,
|
|
270
270
|
monthName: this.getMonthName(e)
|
|
271
|
-
}),
|
|
271
|
+
}), a && (this.data.currentDate = a);
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
274
|
* Handles week selection.
|
|
@@ -278,8 +278,8 @@ class Ve extends g {
|
|
|
278
278
|
*/
|
|
279
279
|
selectWeek(e, s) {
|
|
280
280
|
this.data.currentWeek = e;
|
|
281
|
-
const
|
|
282
|
-
this.setDate(
|
|
281
|
+
const a = T(e, s);
|
|
282
|
+
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
285
|
* Renders the WeekCalendar component.
|
|
@@ -299,19 +299,19 @@ class Ve extends g {
|
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
302
|
-
|
|
303
|
-
]), ue = ({ align: t, sortable: e, key: s, label:
|
|
302
|
+
Y((e) => new V({ class: "mr-2", onChange: () => e.toggleAllSelectedRows() }))
|
|
303
|
+
]), ue = ({ align: t, sortable: e, key: s, label: a, sort: n, class: i }) => {
|
|
304
304
|
const l = t || "justify-start";
|
|
305
305
|
return O({
|
|
306
306
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
307
|
-
click: e && (() =>
|
|
307
|
+
click: e && (() => n(s))
|
|
308
308
|
}, [
|
|
309
309
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
310
|
-
|
|
311
|
-
e &&
|
|
310
|
+
y(a),
|
|
311
|
+
e && E({ class: "ml-2", html: w.arrows.upDown })
|
|
312
312
|
])
|
|
313
313
|
]);
|
|
314
|
-
},
|
|
314
|
+
}, fe = (t) => F([
|
|
315
315
|
H({
|
|
316
316
|
class: "text-muted-foreground border-b",
|
|
317
317
|
map: [t.headers, (e) => e.label === "checkbox" ? he({ toggle: t.toggle }) : ue({
|
|
@@ -322,11 +322,11 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
322
322
|
sort: t.sort
|
|
323
323
|
})]
|
|
324
324
|
})
|
|
325
|
-
]),
|
|
325
|
+
]), ge = ({ key: t, rows: e, selectRow: s, rowItem: a }) => new K({
|
|
326
326
|
cache: "table",
|
|
327
327
|
key: t,
|
|
328
328
|
items: e,
|
|
329
|
-
rowItem: (
|
|
329
|
+
rowItem: (n) => a(n, s),
|
|
330
330
|
class: "divide-y divide-border"
|
|
331
331
|
}), Je = R(
|
|
332
332
|
{
|
|
@@ -336,7 +336,7 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
336
336
|
* @returns {Data}
|
|
337
337
|
*/
|
|
338
338
|
setData() {
|
|
339
|
-
return new
|
|
339
|
+
return new L({
|
|
340
340
|
selectedRows: [],
|
|
341
341
|
selected: !1
|
|
342
342
|
});
|
|
@@ -386,8 +386,8 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
386
386
|
selectRow(t) {
|
|
387
387
|
const e = t.selected ?? !1;
|
|
388
388
|
t.selected = !e;
|
|
389
|
-
const s = this.data.get("selectedRows"),
|
|
390
|
-
this.data.selectedRows =
|
|
389
|
+
const s = this.data.get("selectedRows"), a = t.selected ? [...s, t] : s.filter((n) => n !== t);
|
|
390
|
+
this.data.selectedRows = a, this.updateSelected();
|
|
391
391
|
},
|
|
392
392
|
/**
|
|
393
393
|
* Renders the DataTable component.
|
|
@@ -400,10 +400,10 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
400
400
|
o({ class: `w-full rounded-md ${e} overflow-x-auto` }, [
|
|
401
401
|
Q({ class: "w-full" }, [
|
|
402
402
|
// @ts-ignore
|
|
403
|
-
this.headers &&
|
|
403
|
+
this.headers && fe({ headers: this.headers, sort: (s) => this.sortRows(s) }),
|
|
404
404
|
// @ts-ignore
|
|
405
405
|
this.customHeader ?? null,
|
|
406
|
-
|
|
406
|
+
ge({
|
|
407
407
|
// @ts-ignore
|
|
408
408
|
key: this.key,
|
|
409
409
|
rows: t,
|
|
@@ -477,20 +477,20 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
), pe = u(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
m({ class: "text-base font-semibold leading-6 m-0" }, t),
|
|
481
|
+
m({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
|
|
482
482
|
])), me = () => o({ class: "flex items-center gap-x-1.5" }, [
|
|
483
483
|
o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
|
|
484
484
|
o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
|
|
485
485
|
]),
|
|
486
|
-
|
|
487
|
-
]), we = (t) =>
|
|
488
|
-
|
|
486
|
+
m({ class: "text-xs leading-5 text-gray-500" }, "Online")
|
|
487
|
+
]), we = (t) => m({ class: "text-xs leading-5 text-muted-foreground" }, [
|
|
488
|
+
y("Last seen "),
|
|
489
489
|
X({ datetime: t }, "3h ago")
|
|
490
490
|
]), be = (t, e) => t === "online" ? me() : we(e), xe = u(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
|
|
491
|
-
|
|
491
|
+
m({ class: "text-sm leading-6 m-0" }, t),
|
|
492
492
|
be(s, e)
|
|
493
|
-
])), ke = (t) => t.split(" ").map((s) => s[0]).join(""),
|
|
493
|
+
])), ke = (t) => t.split(" ").map((s) => s[0]).join(""), ve = u((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
494
494
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
495
495
|
ee({ src: t.image, alt: t.name, fallbackText: ke(t.name) }),
|
|
496
496
|
pe({ name: t.name, email: t.email })
|
|
@@ -506,15 +506,15 @@ const he = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
|
|
|
506
506
|
items: t.users,
|
|
507
507
|
role: "list",
|
|
508
508
|
class: "divide-y divide-border",
|
|
509
|
-
rowItem:
|
|
510
|
-
})),
|
|
509
|
+
rowItem: ve
|
|
510
|
+
})), ye = (t, e) => e.includes(t), De = (t, e, s) => t.exact ? s === e : ye(e, s), Se = ({ text: t, href: e, exact: s, hidden: a }) => new M({
|
|
511
511
|
text: t,
|
|
512
512
|
href: e,
|
|
513
513
|
exact: s,
|
|
514
514
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
515
|
-
class: `${
|
|
515
|
+
class: `${a ? "hidden" : "inline-flex"} items-center justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring focus-visible:ring-offset-background hover:bg-primary hover:text-primary-foreground disabled:opacity-50 disabled:pointer-events-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`
|
|
516
516
|
});
|
|
517
|
-
class et extends
|
|
517
|
+
class et extends f {
|
|
518
518
|
/**
|
|
519
519
|
* This will declare the props for the compiler.
|
|
520
520
|
*
|
|
@@ -535,14 +535,14 @@ class et extends g {
|
|
|
535
535
|
* @returns {object}
|
|
536
536
|
*/
|
|
537
537
|
render() {
|
|
538
|
-
return
|
|
538
|
+
return S(
|
|
539
539
|
{ class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
|
|
540
540
|
[
|
|
541
|
-
|
|
541
|
+
b({
|
|
542
542
|
class: "flex space-x-4",
|
|
543
543
|
map: [this.options, (e) => this.addLink(e)],
|
|
544
544
|
watch: {
|
|
545
|
-
value: ["[[path]]",
|
|
545
|
+
value: ["[[path]]", k.data],
|
|
546
546
|
callBack: this.updateLinks.bind(this)
|
|
547
547
|
}
|
|
548
548
|
})
|
|
@@ -555,7 +555,7 @@ class et extends g {
|
|
|
555
555
|
* @returns {void}
|
|
556
556
|
*/
|
|
557
557
|
afterSetup() {
|
|
558
|
-
const e =
|
|
558
|
+
const e = k.data.path;
|
|
559
559
|
this.updateLinks(e);
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
@@ -567,10 +567,10 @@ class et extends g {
|
|
|
567
567
|
updateLinks(e) {
|
|
568
568
|
let s = !1;
|
|
569
569
|
this.deactivateAllLinks();
|
|
570
|
-
for (const
|
|
571
|
-
if (!
|
|
570
|
+
for (const a of this.links) {
|
|
571
|
+
if (!a.rendered)
|
|
572
572
|
continue;
|
|
573
|
-
De(
|
|
573
|
+
De(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
574
574
|
}
|
|
575
575
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
576
576
|
}
|
|
@@ -599,8 +599,8 @@ class et extends g {
|
|
|
599
599
|
* @param {object} option
|
|
600
600
|
* @returns {object}
|
|
601
601
|
*/
|
|
602
|
-
addLink({ label: e, href: s, exact:
|
|
603
|
-
const i = Se({ text: e, href: s, exact:
|
|
602
|
+
addLink({ label: e, href: s, exact: a, hidden: n }) {
|
|
603
|
+
const i = Se({ text: e, href: s, exact: a, hidden: n });
|
|
604
604
|
return this.links.push(i), i;
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
@@ -615,7 +615,7 @@ class et extends g {
|
|
|
615
615
|
const tt = u((t) => {
|
|
616
616
|
const e = t.margin || "m-4 ml-0";
|
|
617
617
|
return o({ class: `flex-none ${e}` }, [
|
|
618
|
-
|
|
618
|
+
C({
|
|
619
619
|
variant: "icon",
|
|
620
620
|
class: "back-button",
|
|
621
621
|
click: () => {
|
|
@@ -626,11 +626,11 @@ const tt = u((t) => {
|
|
|
626
626
|
t.backUrl && app.navigate(t.backUrl);
|
|
627
627
|
}
|
|
628
628
|
}, [
|
|
629
|
-
z(
|
|
629
|
+
z(w.arrows.left)
|
|
630
630
|
])
|
|
631
631
|
]);
|
|
632
632
|
});
|
|
633
|
-
class N extends
|
|
633
|
+
class N extends f {
|
|
634
634
|
/**
|
|
635
635
|
* This will declare the props for the compiler.
|
|
636
636
|
*
|
|
@@ -739,8 +739,8 @@ class st extends N {
|
|
|
739
739
|
["loading", {
|
|
740
740
|
loading: !0
|
|
741
741
|
}],
|
|
742
|
-
["docked", (s,
|
|
743
|
-
s ? (
|
|
742
|
+
["docked", (s, a) => {
|
|
743
|
+
s ? (a.className = this.getDockedClassName(), e.appendChild(a), document.documentElement.style.overflowY = "auto") : (a.className = this.getClassName(), app.root.appendChild(a), document.documentElement.style.overflowY = "hidden");
|
|
744
744
|
}]
|
|
745
745
|
]
|
|
746
746
|
},
|
|
@@ -820,7 +820,7 @@ class st extends N {
|
|
|
820
820
|
document.documentElement.style.overflowY = "auto";
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
|
-
class
|
|
823
|
+
class at extends N {
|
|
824
824
|
/**
|
|
825
825
|
* This will get the overlay type.
|
|
826
826
|
*
|
|
@@ -839,7 +839,7 @@ class nt extends N {
|
|
|
839
839
|
this.container = e, this.initialize();
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
const Le = u(({ index: t, click: e, state: s },
|
|
842
|
+
const Le = u(({ index: t, click: e, state: s }, a) => D({
|
|
843
843
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
844
844
|
onState: [
|
|
845
845
|
[s, "selectedIndex", {
|
|
@@ -848,9 +848,9 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
848
848
|
}]
|
|
849
849
|
],
|
|
850
850
|
pointerdown: () => e(t)
|
|
851
|
-
},
|
|
851
|
+
}, a)), Ce = u(({ selectOption: t, state: e }) => b({
|
|
852
852
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
853
|
-
for: ["filteredOptions", (s,
|
|
853
|
+
for: ["filteredOptions", (s, a) => Le({ index: a, click: t, state: e }, s.label)]
|
|
854
854
|
})), Be = 100, Ie = u((t) => o({ class: "relative flex items-center" }, [
|
|
855
855
|
J({
|
|
856
856
|
cache: "input",
|
|
@@ -868,18 +868,18 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
868
868
|
])
|
|
869
869
|
])), Te = (t) => o({
|
|
870
870
|
class: "relative flex fle-auto flex-col",
|
|
871
|
-
onState: ["open", (e, s,
|
|
871
|
+
onState: ["open", (e, s, a) => {
|
|
872
872
|
if (e)
|
|
873
873
|
return new te({
|
|
874
874
|
cache: "dropdown",
|
|
875
|
-
parent:
|
|
876
|
-
button:
|
|
875
|
+
parent: a,
|
|
876
|
+
button: a.input,
|
|
877
877
|
size: "xl"
|
|
878
878
|
}, [
|
|
879
879
|
Ce(t)
|
|
880
880
|
]);
|
|
881
881
|
}]
|
|
882
|
-
}),
|
|
882
|
+
}), nt = R(
|
|
883
883
|
{
|
|
884
884
|
/**
|
|
885
885
|
* This will set up the data object.
|
|
@@ -888,7 +888,7 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
888
888
|
*/
|
|
889
889
|
setData() {
|
|
890
890
|
const t = this.options || [];
|
|
891
|
-
return new
|
|
891
|
+
return new L({
|
|
892
892
|
options: t,
|
|
893
893
|
filteredOptions: t
|
|
894
894
|
});
|
|
@@ -914,7 +914,7 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
914
914
|
const t = this.data.filteredOptions;
|
|
915
915
|
let { searchQuery: e } = this.state;
|
|
916
916
|
e = e.toLowerCase();
|
|
917
|
-
const s = t.findIndex((
|
|
917
|
+
const s = t.findIndex((a) => a.label.toLowerCase() === e);
|
|
918
918
|
s >= 0 && (this.state.selectedIndex = s);
|
|
919
919
|
},
|
|
920
920
|
/**
|
|
@@ -999,7 +999,7 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
999
999
|
]);
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
), We = (t) =>
|
|
1002
|
+
), We = (t) => D(
|
|
1003
1003
|
{
|
|
1004
1004
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1005
1005
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
@@ -1011,10 +1011,10 @@ const Le = u(({ index: t, click: e, state: s }, n) => S({
|
|
|
1011
1011
|
click: (e) => t.callBack(t.value)
|
|
1012
1012
|
}, t.label)
|
|
1013
1013
|
]
|
|
1014
|
-
), Oe = (t, e) => (t.callBack = e, We(t)), Pe = (t) =>
|
|
1015
|
-
|
|
1014
|
+
), Oe = (t, e) => (t.callBack = e, We(t)), Pe = (t) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1015
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Oe(e, t.callBack)] })
|
|
1016
1016
|
]);
|
|
1017
|
-
class it extends
|
|
1017
|
+
class it extends f {
|
|
1018
1018
|
/**
|
|
1019
1019
|
* This will declare the props for the compiler.
|
|
1020
1020
|
*
|
|
@@ -1079,11 +1079,11 @@ class it extends g {
|
|
|
1079
1079
|
const s = this.options;
|
|
1080
1080
|
if (!s || s.length < 1)
|
|
1081
1081
|
return;
|
|
1082
|
-
const
|
|
1083
|
-
for (const
|
|
1084
|
-
if (
|
|
1085
|
-
return
|
|
1086
|
-
return
|
|
1082
|
+
const a = s[0];
|
|
1083
|
+
for (const n of s)
|
|
1084
|
+
if (n.value === e)
|
|
1085
|
+
return n.layout;
|
|
1086
|
+
return a.layout;
|
|
1087
1087
|
}
|
|
1088
1088
|
/**
|
|
1089
1089
|
* This will setup the states.
|
|
@@ -1095,14 +1095,14 @@ class it extends g {
|
|
|
1095
1095
|
return {
|
|
1096
1096
|
selected: {
|
|
1097
1097
|
state: this.getFirstValue(),
|
|
1098
|
-
callBack(
|
|
1099
|
-
s === "function" && e(
|
|
1098
|
+
callBack(a) {
|
|
1099
|
+
s === "function" && e(a);
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
const Re = (t) =>
|
|
1105
|
+
const Re = (t) => D(
|
|
1106
1106
|
{
|
|
1107
1107
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
|
|
1108
1108
|
dataSet: ["selected", ["state", t.value, "active"]]
|
|
@@ -1115,10 +1115,10 @@ const Re = (t) => S(
|
|
|
1115
1115
|
disabled: t.disabled
|
|
1116
1116
|
}, t.label)
|
|
1117
1117
|
]
|
|
1118
|
-
), Me = (t, e) => (t.callBack = e, Re(t)), ze = (t) =>
|
|
1119
|
-
|
|
1118
|
+
), Me = (t, e) => (t.callBack = e, Re(t)), ze = (t) => S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
|
|
1119
|
+
b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Me(e, t.callBack)] })
|
|
1120
1120
|
]);
|
|
1121
|
-
class ot extends
|
|
1121
|
+
class ot extends f {
|
|
1122
1122
|
/**
|
|
1123
1123
|
* This will declare the props for the compiler.
|
|
1124
1124
|
*
|
|
@@ -1171,7 +1171,7 @@ const Ne = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), $e = (t, e) => {
|
|
|
1171
1171
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
1172
1172
|
class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm"
|
|
1173
1173
|
});
|
|
1174
|
-
class je extends
|
|
1174
|
+
class je extends f {
|
|
1175
1175
|
/**
|
|
1176
1176
|
* This will declare the props for the compiler.
|
|
1177
1177
|
*
|
|
@@ -1192,12 +1192,12 @@ class je extends g {
|
|
|
1192
1192
|
* @returns {object}
|
|
1193
1193
|
*/
|
|
1194
1194
|
render() {
|
|
1195
|
-
return
|
|
1196
|
-
|
|
1195
|
+
return S({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
|
|
1196
|
+
b({
|
|
1197
1197
|
class: "flex flex-auto flex-row",
|
|
1198
1198
|
map: [this.options, (e) => this.addLink(e)],
|
|
1199
1199
|
watch: {
|
|
1200
|
-
value: ["[[path]]",
|
|
1200
|
+
value: ["[[path]]", k.data],
|
|
1201
1201
|
callBack: this.updateLinks.bind(this)
|
|
1202
1202
|
}
|
|
1203
1203
|
})
|
|
@@ -1209,7 +1209,7 @@ class je extends g {
|
|
|
1209
1209
|
* @returns {void}
|
|
1210
1210
|
*/
|
|
1211
1211
|
afterSetup() {
|
|
1212
|
-
const e =
|
|
1212
|
+
const e = k.data.path;
|
|
1213
1213
|
this.updateLinks(e);
|
|
1214
1214
|
}
|
|
1215
1215
|
/**
|
|
@@ -1219,14 +1219,14 @@ class je extends g {
|
|
|
1219
1219
|
* @returns {void}
|
|
1220
1220
|
*/
|
|
1221
1221
|
updateLinks(e) {
|
|
1222
|
-
let s = !1,
|
|
1222
|
+
let s = !1, a = this.links[0];
|
|
1223
1223
|
this.deactivateAllLinks();
|
|
1224
|
-
for (const
|
|
1225
|
-
if (
|
|
1226
|
-
this.updateLink(
|
|
1224
|
+
for (const n of this.links)
|
|
1225
|
+
if (n.rendered !== !1 && (s = $e(n, e), s === !0)) {
|
|
1226
|
+
this.updateLink(n, !0);
|
|
1227
1227
|
break;
|
|
1228
1228
|
}
|
|
1229
|
-
s !== !0 &&
|
|
1229
|
+
s !== !0 && a && this.updateLink(a, !0);
|
|
1230
1230
|
}
|
|
1231
1231
|
/**
|
|
1232
1232
|
* This will deactivate all links.
|
|
@@ -1253,9 +1253,9 @@ class je extends g {
|
|
|
1253
1253
|
* @param {object} option
|
|
1254
1254
|
* @returns {object}
|
|
1255
1255
|
*/
|
|
1256
|
-
addLink({ label: e, href: s, exact:
|
|
1257
|
-
const
|
|
1258
|
-
return this.links.push(
|
|
1256
|
+
addLink({ label: e, href: s, exact: a }) {
|
|
1257
|
+
const n = Ae({ text: e, href: s, exact: a });
|
|
1258
|
+
return this.links.push(n), n;
|
|
1259
1259
|
}
|
|
1260
1260
|
/**
|
|
1261
1261
|
* This will remove all the links.
|
|
@@ -1266,7 +1266,7 @@ class je extends g {
|
|
|
1266
1266
|
this.links = [];
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
|
-
class lt extends
|
|
1269
|
+
class lt extends f {
|
|
1270
1270
|
/**
|
|
1271
1271
|
* This will declare the props for the compiler.
|
|
1272
1272
|
*
|
|
@@ -1299,9 +1299,9 @@ class lt extends g {
|
|
|
1299
1299
|
*/
|
|
1300
1300
|
addGroup() {
|
|
1301
1301
|
let e;
|
|
1302
|
-
const s = [],
|
|
1303
|
-
for (let
|
|
1304
|
-
e = n
|
|
1302
|
+
const s = [], a = this.options;
|
|
1303
|
+
for (let n = 0, i = a.length; n < i; n++)
|
|
1304
|
+
e = a[n], s.push(
|
|
1305
1305
|
{
|
|
1306
1306
|
uri: e.uri || e.href,
|
|
1307
1307
|
component: e.component,
|
|
@@ -1312,7 +1312,7 @@ class lt extends g {
|
|
|
1312
1312
|
return s;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
class Ue extends
|
|
1315
|
+
class Ue extends f {
|
|
1316
1316
|
/**
|
|
1317
1317
|
* Runs before rendering, sets up defaults, a timer for drawing,
|
|
1318
1318
|
* and basic canvas properties.
|
|
@@ -1322,7 +1322,7 @@ class Ue extends g {
|
|
|
1322
1322
|
onCreated() {
|
|
1323
1323
|
this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
|
|
1324
1324
|
const e = 1e3 / 60;
|
|
1325
|
-
this.timer = new G(e,
|
|
1325
|
+
this.timer = new G(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
|
|
1326
1326
|
}
|
|
1327
1327
|
/**
|
|
1328
1328
|
* Renders a <canvas> element.
|
|
@@ -1360,12 +1360,12 @@ class Ue extends g {
|
|
|
1360
1360
|
* @returns {Array} An array of [eventName, element, callback] definitions.
|
|
1361
1361
|
*/
|
|
1362
1362
|
setupEvents() {
|
|
1363
|
-
const e = this.panel, s =
|
|
1363
|
+
const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), n = this.pointerDown.bind(this), i = this.resize.bind(this);
|
|
1364
1364
|
return [
|
|
1365
1365
|
["pointermove", e, s],
|
|
1366
|
-
["pointerup", e,
|
|
1367
|
-
["pointerdown", e,
|
|
1368
|
-
["pointerout", e,
|
|
1366
|
+
["pointerup", e, a],
|
|
1367
|
+
["pointerdown", e, n],
|
|
1368
|
+
["pointerout", e, a],
|
|
1369
1369
|
["resize", window, i]
|
|
1370
1370
|
];
|
|
1371
1371
|
}
|
|
@@ -1376,14 +1376,14 @@ class Ue extends g {
|
|
|
1376
1376
|
* @returns {void}
|
|
1377
1377
|
*/
|
|
1378
1378
|
getEventPosition(e) {
|
|
1379
|
-
let s,
|
|
1380
|
-
const
|
|
1379
|
+
let s, a;
|
|
1380
|
+
const n = this.canvas, i = n.width / parseInt(n.style.width), l = n.getBoundingClientRect();
|
|
1381
1381
|
if (e.touches && e.touches.length) {
|
|
1382
1382
|
const h = e.touches[0];
|
|
1383
|
-
s = h.clientX,
|
|
1383
|
+
s = h.clientX, a = h.clientY;
|
|
1384
1384
|
} else
|
|
1385
|
-
s = e.x || e.clientX,
|
|
1386
|
-
const d = parseInt((s - l.left) * i), c = parseInt((
|
|
1385
|
+
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1386
|
+
const d = parseInt((s - l.left) * i), c = parseInt((a - l.top) * i);
|
|
1387
1387
|
this.mouse.x = d, this.mouse.y = c;
|
|
1388
1388
|
}
|
|
1389
1389
|
/**
|
|
@@ -1395,8 +1395,8 @@ class Ue extends g {
|
|
|
1395
1395
|
*/
|
|
1396
1396
|
pointerDown(e) {
|
|
1397
1397
|
e.preventDefault(), this.getEventPosition(e);
|
|
1398
|
-
const { ctx: s, mouse:
|
|
1399
|
-
s.beginPath(), s.moveTo(
|
|
1398
|
+
const { ctx: s, mouse: a } = this;
|
|
1399
|
+
s.beginPath(), s.moveTo(a.x, a.y), a.status = "down", this.startTimer();
|
|
1400
1400
|
}
|
|
1401
1401
|
/**
|
|
1402
1402
|
* Called when the pointer goes up or leaves the canvas area.
|
|
@@ -1424,12 +1424,12 @@ class Ue extends g {
|
|
|
1424
1424
|
* @returns {void}
|
|
1425
1425
|
*/
|
|
1426
1426
|
resize() {
|
|
1427
|
-
const { canvas: e, ctx: s } = this,
|
|
1428
|
-
if (this.scale(), this.setupBackground(s),
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
s.drawImage(
|
|
1432
|
-
}),
|
|
1427
|
+
const { canvas: e, ctx: s } = this, a = e.toDataURL();
|
|
1428
|
+
if (this.scale(), this.setupBackground(s), a !== "data:,") {
|
|
1429
|
+
const n = new window.Image();
|
|
1430
|
+
B.on("load", n, function i() {
|
|
1431
|
+
s.drawImage(n, 0, 0), B.off("load", n, i);
|
|
1432
|
+
}), n.src = a;
|
|
1433
1433
|
}
|
|
1434
1434
|
this.draw();
|
|
1435
1435
|
}
|
|
@@ -1458,11 +1458,11 @@ class Ue extends g {
|
|
|
1458
1458
|
* @returns {void}
|
|
1459
1459
|
*/
|
|
1460
1460
|
scale() {
|
|
1461
|
-
const e = this.canvas, s = this.container,
|
|
1461
|
+
const e = this.canvas, s = this.container, a = I.getSize(s), n = this.targetSize, i = n.width, l = n.height;
|
|
1462
1462
|
let d = i + "px", c = l + "px";
|
|
1463
|
-
if (this.width = e.width = i, this.height = e.height = l,
|
|
1464
|
-
const h =
|
|
1465
|
-
d = i *
|
|
1463
|
+
if (this.width = e.width = i, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1464
|
+
const h = a.width, g = a.height, r = h / i, p = g / l, x = Math.min(r, p);
|
|
1465
|
+
d = i * x + "px", c = l * x + "px";
|
|
1466
1466
|
}
|
|
1467
1467
|
e.style.width = d, e.style.height = c;
|
|
1468
1468
|
}
|
|
@@ -1484,8 +1484,8 @@ class Ue extends g {
|
|
|
1484
1484
|
drawBottomLine(e) {
|
|
1485
1485
|
const s = this.canvas;
|
|
1486
1486
|
e.globalAlpha = 1, e.shadowBlur = 0;
|
|
1487
|
-
const
|
|
1488
|
-
e.beginPath(), e.moveTo(
|
|
1487
|
+
const a = this.margin.x, n = this.height - this.margin.y;
|
|
1488
|
+
e.beginPath(), e.moveTo(a, n), e.lineTo(s.width - this.margin.x, n), e.lineWidth = this.baseLineWidth, e.strokeStyle = this.baseStrokeColor, e.stroke(), e.closePath();
|
|
1489
1489
|
}
|
|
1490
1490
|
/**
|
|
1491
1491
|
* Adds a line to the current path, updating the 'signed' status.
|
|
@@ -1496,10 +1496,10 @@ class Ue extends g {
|
|
|
1496
1496
|
* @param {string} color The stroke color.
|
|
1497
1497
|
* @returns {void}
|
|
1498
1498
|
*/
|
|
1499
|
-
addLine(e, s,
|
|
1499
|
+
addLine(e, s, a, n) {
|
|
1500
1500
|
this.signed || (this.signed = !0);
|
|
1501
|
-
const i = Math.round(s), l = Math.round(
|
|
1502
|
-
e.lineWidth = this.lineWidth, e.strokeStyle =
|
|
1501
|
+
const i = Math.round(s), l = Math.round(a);
|
|
1502
|
+
e.lineWidth = this.lineWidth, e.strokeStyle = n, e.lineTo(i, l), e.stroke();
|
|
1503
1503
|
}
|
|
1504
1504
|
/**
|
|
1505
1505
|
* Clears the canvas, sets signed to false, and re-initializes
|
|
@@ -1519,7 +1519,7 @@ class Ue extends g {
|
|
|
1519
1519
|
* @returns {void}
|
|
1520
1520
|
*/
|
|
1521
1521
|
setupBackground(e) {
|
|
1522
|
-
e.fillStyle = "
|
|
1522
|
+
e.fillStyle = "", e.fillRect(0, 0, this.width, this.height), this.drawBottomLine(e);
|
|
1523
1523
|
}
|
|
1524
1524
|
/**
|
|
1525
1525
|
* Starts the drawing timer so new lines can be added as pointer moves.
|
|
@@ -1538,7 +1538,7 @@ class Ue extends g {
|
|
|
1538
1538
|
this.timer.stop(), this.status = "stopped";
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
|
-
class rt extends
|
|
1541
|
+
class rt extends f {
|
|
1542
1542
|
/**
|
|
1543
1543
|
* Sets up default properties for the signature panel.
|
|
1544
1544
|
*
|
|
@@ -1563,17 +1563,17 @@ class rt extends g {
|
|
|
1563
1563
|
* @returns {object} The layout object for the component.
|
|
1564
1564
|
*/
|
|
1565
1565
|
render() {
|
|
1566
|
-
return o({ class: "signature-panel" }, [
|
|
1566
|
+
return o({ class: "signature-panel relative flex flex-auto" }, [
|
|
1567
1567
|
Z({
|
|
1568
1568
|
cache: "hiddenInput",
|
|
1569
1569
|
required: !0,
|
|
1570
1570
|
bind: this.path + ".data"
|
|
1571
1571
|
}),
|
|
1572
|
-
o({ class: "
|
|
1573
|
-
|
|
1572
|
+
o({ class: "absolute top-2 right-2" }, [
|
|
1573
|
+
C({
|
|
1574
1574
|
variant: "icon",
|
|
1575
|
-
icon:
|
|
1576
|
-
click:
|
|
1575
|
+
icon: w.circleX,
|
|
1576
|
+
click: this.reset.bind(this)
|
|
1577
1577
|
})
|
|
1578
1578
|
]),
|
|
1579
1579
|
new Ue({
|
|
@@ -1628,23 +1628,23 @@ class rt extends g {
|
|
|
1628
1628
|
export {
|
|
1629
1629
|
tt as B,
|
|
1630
1630
|
he as C,
|
|
1631
|
-
|
|
1631
|
+
ge as D,
|
|
1632
1632
|
ue as H,
|
|
1633
|
-
|
|
1633
|
+
at as I,
|
|
1634
1634
|
et as N,
|
|
1635
1635
|
N as O,
|
|
1636
1636
|
Ke as P,
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1637
|
+
nt as S,
|
|
1638
|
+
fe as T,
|
|
1639
|
+
ve as U,
|
|
1640
1640
|
Ve as W,
|
|
1641
1641
|
ie as a,
|
|
1642
1642
|
T as b,
|
|
1643
|
-
|
|
1643
|
+
ae as c,
|
|
1644
1644
|
_e as d,
|
|
1645
1645
|
Ge as e,
|
|
1646
1646
|
le as f,
|
|
1647
|
-
|
|
1647
|
+
ne as g,
|
|
1648
1648
|
ce as h,
|
|
1649
1649
|
de as i,
|
|
1650
1650
|
Je as j,
|
package/package.json
CHANGED