@base-framework/ui 1.0.71 → 1.0.73
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-D4dRxILB.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 Ta, p as ca, q as Ca, S as ba, n as Da, o as Sa, T as Ia, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-DgARq0AK.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-BDqm833e.js";
|
|
8
|
-
import { B as Oa, n 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, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-
|
|
8
|
+
import { B as Oa, n 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, m as Xa, r as Ya, q as Za, o as $a, p as as, T as ss, k as es, U as os, W as ts, f as rs, h as ns, i as is, c as ls, d as ps, b as us, e as ms, a as ds, g as gs } from "./signature-panel-BhLkjayG.js";
|
|
9
9
|
import { B as cs, I as Cs, M as bs, d as Ds, e as Ss, g as Is, N as Bs, b as Ps, a as Fs, f as Ms, P as ks, c as Ns, S as vs, T as fs } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
10
10
|
import { B as hs, a as ys, C as Ws, F as Ls, b as As, c as Hs, M as ws, P as Us, S as Os } from "./sidebar-menu-page-nCAVFk3R.js";
|
|
11
11
|
import { A as Es, F as Gs, M as Vs, a as js, T as qs } from "./aside-template-McEj_Gxc.js";
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-
|
|
1
|
+
import { B as s, n as o, C as t, j as r, D as l, l as n, H as i, I as b, N as d, O as v, P as g, S as p, m as u, r as N, q as k, o as D, p as C, T, k as c, U as M, W as B, f as m, h as y, i as W, c as h, d as H, b as P, e as S, a as f, g as x } from "./signature-panel-BhLkjayG.js";
|
|
2
2
|
import { b as L, C as O, D as F, a as U, F as G, M as j, c as q, p as w } from "./calendar-BDqm833e.js";
|
|
3
3
|
import { B as A, I as E, M as J, d as K, e as Q, g as R, N as V, b as X, a as Y, f as Z, P as _, c as $, S as aa, T as ea } from "./mobile-nav-wrapper-BE_hr65B.js";
|
|
4
4
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Button as y, Div as o, On as E, Span as v, Th as P, UseParent as H, I as Q, Thead as X, Tr as q, Table as R, P as m, Li as D, Time as K, Nav as S, Ul as b, Section as O, Canvas as G } from "@base-framework/atoms";
|
|
2
|
-
import { Atom as d, Component as u, Data as L, DateTime as V, Jot as M, router as x, NavLink as z, DataTracker as N, base as
|
|
2
|
+
import { Atom as d, Component as u, Data as L, DateTime as V, Jot as M, router as x, NavLink as z, DataTracker as N, base as B, Dom as I } from "@base-framework/base";
|
|
3
3
|
import { B as C, I as $ } from "./buttons-CVEwmPAi.js";
|
|
4
4
|
import { Icons as w } from "./icons.es.js";
|
|
5
5
|
import { TableBody as _, ScrollableTableBody as J, List as Z, IntervalTimer as ee } from "@base-framework/organisms";
|
|
6
|
-
import { C as te, I as se, H as
|
|
7
|
-
import { A as
|
|
6
|
+
import { C as te, I as se, H as ae } from "./inputs-DmJuUwS9.js";
|
|
7
|
+
import { A as ne, P as ie } from "./calendar-BDqm833e.js";
|
|
8
8
|
d((t, e) => ({
|
|
9
9
|
class: "flex items-center px-4 py-2",
|
|
10
10
|
...t,
|
|
@@ -14,7 +14,7 @@ d(({ value: t, label: e }) => y({
|
|
|
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
19
|
class Je extends u {
|
|
20
20
|
/**
|
|
@@ -41,46 +41,46 @@ const oe = (t) => {
|
|
|
41
41
|
}, le = (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 && !oe(
|
|
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 && !oe(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
|
}, re = (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
|
-
}, ce = (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
|
+
}, ce = (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
|
}, Ze = (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 h = new Date(t, e, l);
|
|
71
|
-
i.push(l > 0 ? h : null), (i.length === 7 || l ===
|
|
71
|
+
i.push(l > 0 ? h : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return n;
|
|
74
74
|
}, et = (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
|
}, de = (t, e, s) => {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
}, he = ({ 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
|
+
}, he = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: n }) => {
|
|
84
84
|
const i = de(t, e, s);
|
|
85
85
|
return y({
|
|
86
86
|
text: t || "",
|
|
@@ -90,10 +90,10 @@ const oe = (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
|
}, ue = (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 = re(t, e, s), i = Array.from({ length: a }, (r, p) => new Date(t, e, p + 1)), l = (n.length + i.length) % 7, h = l === 0 ? 0 : 7 - l, c = ce(t, e, h), f = [...n, ...i, ...c], g = [];
|
|
97
97
|
for (let r = 0; r < f.length; r += 7) {
|
|
98
98
|
const p = f.slice(r, r + 7), k = p.find((F) => F) || new Date(t, e, 1), { weekNumber: U, year: Y } = le(k);
|
|
99
99
|
g.push({
|
|
@@ -103,8 +103,8 @@ const oe = (t) => {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
return g;
|
|
106
|
-
}, fe = ({ selectWeek: t }) => E("month", (e, s, { data:
|
|
107
|
-
const { year:
|
|
106
|
+
}, fe = ({ selectWeek: t }) => E("month", (e, s, { data: a }) => {
|
|
107
|
+
const { year: n, month: i, currentDate: l } = a, h = ue(n, i);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -193,12 +193,12 @@ class tt extends u {
|
|
|
193
193
|
* @returns {Data}
|
|
194
194
|
*/
|
|
195
195
|
setData() {
|
|
196
|
-
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e),
|
|
196
|
+
const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = T(s, e.getFullYear());
|
|
197
197
|
return new L({
|
|
198
|
-
monthName: this.getMonthName(
|
|
199
|
-
year:
|
|
200
|
-
month:
|
|
201
|
-
currentDate:
|
|
198
|
+
monthName: this.getMonthName(a.getMonth()),
|
|
199
|
+
year: a.getFullYear(),
|
|
200
|
+
month: a.getMonth(),
|
|
201
|
+
currentDate: a.getDate(),
|
|
202
202
|
currentWeek: s
|
|
203
203
|
});
|
|
204
204
|
}
|
|
@@ -219,10 +219,10 @@ class tt extends u {
|
|
|
219
219
|
* @returns {number}
|
|
220
220
|
*/
|
|
221
221
|
calculateCurrentWeek(e) {
|
|
222
|
-
const s = new Date(e.valueOf()),
|
|
223
|
-
s.setDate(s.getDate() -
|
|
224
|
-
const
|
|
225
|
-
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((
|
|
222
|
+
const s = new Date(e.valueOf()), a = (e.getDay() + 6) % 7;
|
|
223
|
+
s.setDate(s.getDate() - a + 3);
|
|
224
|
+
const n = s.valueOf();
|
|
225
|
+
return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((n - s) / 6048e5);
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Gets the name of the month.
|
|
@@ -240,8 +240,8 @@ class tt extends u {
|
|
|
240
240
|
*/
|
|
241
241
|
goToPreviousMonth() {
|
|
242
242
|
const e = this.data;
|
|
243
|
-
let { year: s, month:
|
|
244
|
-
|
|
243
|
+
let { year: s, month: a } = e;
|
|
244
|
+
a === 0 ? (a = 11, s--) : a--, this.setDate(a, s);
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Updates the calendar to show the next month.
|
|
@@ -250,8 +250,8 @@ class tt extends u {
|
|
|
250
250
|
*/
|
|
251
251
|
goToNextMonth() {
|
|
252
252
|
const e = this.data;
|
|
253
|
-
let { year: s, month:
|
|
254
|
-
|
|
253
|
+
let { year: s, month: a } = e;
|
|
254
|
+
a === 11 ? (a = 0, s++) : a++, this.setDate(a, s);
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
* Sets the selected date.
|
|
@@ -261,12 +261,12 @@ class tt extends u {
|
|
|
261
261
|
* @param {number|null} [date=null]
|
|
262
262
|
* @returns {void}
|
|
263
263
|
*/
|
|
264
|
-
setDate(e, s,
|
|
264
|
+
setDate(e, s, a) {
|
|
265
265
|
this.data.set({
|
|
266
266
|
year: s,
|
|
267
267
|
month: e,
|
|
268
268
|
monthName: this.getMonthName(e)
|
|
269
|
-
}),
|
|
269
|
+
}), a && (this.data.currentDate = a);
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* Handles week selection.
|
|
@@ -276,8 +276,8 @@ class tt extends u {
|
|
|
276
276
|
*/
|
|
277
277
|
selectWeek(e, s) {
|
|
278
278
|
this.data.currentWeek = e;
|
|
279
|
-
const
|
|
280
|
-
this.setDate(
|
|
279
|
+
const a = T(e, s);
|
|
280
|
+
this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
283
|
* Renders the WeekCalendar component.
|
|
@@ -300,15 +300,15 @@ const pe = (t, e) => {
|
|
|
300
300
|
const s = t.toggleAllSelectedRows();
|
|
301
301
|
e.state.checked = !s;
|
|
302
302
|
}, me = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
|
|
303
|
-
H((e) => new te({ class: "mr-2", onChange: (s,
|
|
304
|
-
]), we = ({ align: t, sortable: e, key: s, label:
|
|
303
|
+
H((e) => new te({ class: "mr-2", onChange: (s, a) => pe(e, a) }))
|
|
304
|
+
]), we = ({ align: t, sortable: e, key: s, label: a, sort: n, class: i }) => {
|
|
305
305
|
const l = t || "justify-start";
|
|
306
306
|
return P({
|
|
307
307
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
308
|
-
click: e && (() =>
|
|
308
|
+
click: e && (() => n(s))
|
|
309
309
|
}, [
|
|
310
310
|
o({ class: `flex flex-auto w-full items-center ${l}` }, [
|
|
311
|
-
v(
|
|
311
|
+
v(a),
|
|
312
312
|
e && Q({ class: "ml-2", html: w.arrows.upDown })
|
|
313
313
|
])
|
|
314
314
|
]);
|
|
@@ -323,11 +323,11 @@ const pe = (t, e) => {
|
|
|
323
323
|
sort: t.sort
|
|
324
324
|
})]
|
|
325
325
|
})
|
|
326
|
-
]), be = ({ key: t, rows: e, selectRow: s, rowItem:
|
|
326
|
+
]), be = ({ key: t, rows: e, selectRow: s, rowItem: a }) => new _({
|
|
327
327
|
cache: "list",
|
|
328
328
|
key: t,
|
|
329
329
|
items: e,
|
|
330
|
-
rowItem: (
|
|
330
|
+
rowItem: (n) => a(n, s),
|
|
331
331
|
class: "divide-y divide-border"
|
|
332
332
|
}), ke = M(
|
|
333
333
|
{
|
|
@@ -387,8 +387,8 @@ const pe = (t, e) => {
|
|
|
387
387
|
selectRow(t) {
|
|
388
388
|
const e = t.selected ?? !1;
|
|
389
389
|
t.selected = !e;
|
|
390
|
-
const s = this.data.get("selectedRows"),
|
|
391
|
-
this.data.selectedRows =
|
|
390
|
+
const s = this.data.get("selectedRows"), a = t.selected ? [...s, t] : s.filter((n) => n !== t);
|
|
391
|
+
this.data.selectedRows = a, this.updateSelected();
|
|
392
392
|
},
|
|
393
393
|
/**
|
|
394
394
|
* Renders the DataTable component.
|
|
@@ -479,22 +479,18 @@ const pe = (t, e) => {
|
|
|
479
479
|
}
|
|
480
480
|
), st = d((t) => new ke(
|
|
481
481
|
{
|
|
482
|
-
key: t.key,
|
|
483
|
-
rows: t.rows,
|
|
484
|
-
rowItem: t.rowItem,
|
|
485
482
|
/**
|
|
486
483
|
* Renders the DataTable component.
|
|
487
484
|
*
|
|
488
485
|
* @returns {object}
|
|
489
486
|
*/
|
|
490
487
|
render() {
|
|
491
|
-
|
|
492
|
-
const e = this.rows, s = this.border !== !1 ? "border" : "";
|
|
488
|
+
const e = t.rows, s = this.border !== !1 ? "border" : "";
|
|
493
489
|
return o({ class: "w-full" }, [
|
|
494
490
|
o({ class: `w-full rounded-md ${s} overflow-x-auto` }, [
|
|
495
491
|
R({ class: "w-full" }, [
|
|
496
492
|
// @ts-ignore
|
|
497
|
-
t.headers && j({ headers: t.headers, sort: (
|
|
493
|
+
t.headers && j({ headers: t.headers, sort: (a) => this.sortRows(a) }),
|
|
498
494
|
// @ts-ignore
|
|
499
495
|
t.customHeader ?? null,
|
|
500
496
|
J({
|
|
@@ -506,12 +502,12 @@ const pe = (t, e) => {
|
|
|
506
502
|
containerClass: t.containerClass ?? "",
|
|
507
503
|
data: t.data,
|
|
508
504
|
// @ts-ignore
|
|
509
|
-
key:
|
|
505
|
+
key: t.key,
|
|
510
506
|
rows: e,
|
|
511
507
|
// @ts-ignore
|
|
512
508
|
selectRow: this.selectRow.bind(this),
|
|
513
509
|
// @ts-ignore
|
|
514
|
-
rowItem:
|
|
510
|
+
rowItem: t.rowItem
|
|
515
511
|
})
|
|
516
512
|
])
|
|
517
513
|
])
|
|
@@ -534,7 +530,7 @@ const pe = (t, e) => {
|
|
|
534
530
|
De(s, e)
|
|
535
531
|
])), Le = (t) => t.split(" ").map((s) => s[0]).join(""), Ce = d((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
|
|
536
532
|
o({ class: "flex min-w-0 gap-x-4" }, [
|
|
537
|
-
|
|
533
|
+
ne({ src: t.image, alt: t.name, fallbackText: Le(t.name) }),
|
|
538
534
|
xe({ name: t.name, email: t.email })
|
|
539
535
|
]),
|
|
540
536
|
Se({
|
|
@@ -542,21 +538,21 @@ const pe = (t, e) => {
|
|
|
542
538
|
lastSeen: t.lastSeen,
|
|
543
539
|
status: t.status
|
|
544
540
|
})
|
|
545
|
-
])),
|
|
541
|
+
])), at = d((t) => new Z({
|
|
546
542
|
cache: "list",
|
|
547
543
|
key: "name",
|
|
548
544
|
items: t.users,
|
|
549
545
|
role: "list",
|
|
550
546
|
class: "divide-y divide-border",
|
|
551
547
|
rowItem: Ce
|
|
552
|
-
})),
|
|
548
|
+
})), Be = (t, e) => e.includes(t), Ie = (t, e, s) => t.exact ? s === e : Be(e, s), Te = ({ text: t, href: e, exact: s, hidden: a }) => new z({
|
|
553
549
|
text: t,
|
|
554
550
|
href: e,
|
|
555
551
|
exact: s,
|
|
556
552
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
557
|
-
class: `${
|
|
553
|
+
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`
|
|
558
554
|
});
|
|
559
|
-
class
|
|
555
|
+
class nt extends u {
|
|
560
556
|
/**
|
|
561
557
|
* This will declare the props for the compiler.
|
|
562
558
|
*
|
|
@@ -609,10 +605,10 @@ class at extends u {
|
|
|
609
605
|
updateLinks(e) {
|
|
610
606
|
let s = !1;
|
|
611
607
|
this.deactivateAllLinks();
|
|
612
|
-
for (const
|
|
613
|
-
if (!
|
|
608
|
+
for (const a of this.links) {
|
|
609
|
+
if (!a.rendered)
|
|
614
610
|
continue;
|
|
615
|
-
|
|
611
|
+
Ie(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
|
|
616
612
|
}
|
|
617
613
|
!s && this.links[0] && this.updateLink(this.links[0], !0);
|
|
618
614
|
}
|
|
@@ -641,8 +637,8 @@ class at extends u {
|
|
|
641
637
|
* @param {object} option
|
|
642
638
|
* @returns {object}
|
|
643
639
|
*/
|
|
644
|
-
addLink({ label: e, href: s, exact:
|
|
645
|
-
const i = Te({ text: e, href: s, exact:
|
|
640
|
+
addLink({ label: e, href: s, exact: a, hidden: n }) {
|
|
641
|
+
const i = Te({ text: e, href: s, exact: a, hidden: n });
|
|
646
642
|
return this.links.push(i), i;
|
|
647
643
|
}
|
|
648
644
|
/**
|
|
@@ -787,8 +783,8 @@ class ot extends A {
|
|
|
787
783
|
["loading", {
|
|
788
784
|
loading: !0
|
|
789
785
|
}],
|
|
790
|
-
["docked", (s,
|
|
791
|
-
s ? (
|
|
786
|
+
["docked", (s, a) => {
|
|
787
|
+
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");
|
|
792
788
|
}]
|
|
793
789
|
]
|
|
794
790
|
},
|
|
@@ -893,7 +889,7 @@ class lt extends A {
|
|
|
893
889
|
this.container = e, this.initialize();
|
|
894
890
|
}
|
|
895
891
|
}
|
|
896
|
-
const We = d(({ index: t, click: e, state: s },
|
|
892
|
+
const We = d(({ index: t, click: e, state: s }, a) => D({
|
|
897
893
|
class: "p-2 cursor-pointer hover:bg-muted/50",
|
|
898
894
|
onState: [
|
|
899
895
|
[s, "selectedIndex", {
|
|
@@ -902,9 +898,9 @@ const We = d(({ index: t, click: e, state: s }, n) => D({
|
|
|
902
898
|
}]
|
|
903
899
|
],
|
|
904
900
|
click: () => e(t)
|
|
905
|
-
},
|
|
901
|
+
}, a)), Pe = d(({ selectOption: t, state: e }) => b({
|
|
906
902
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
907
|
-
for: ["filteredOptions", (s,
|
|
903
|
+
for: ["filteredOptions", (s, a) => We({ index: a, click: t, state: e }, s.label)]
|
|
908
904
|
})), Re = d((t) => o({ class: "relative flex items-center" }, [
|
|
909
905
|
se({
|
|
910
906
|
cache: "input",
|
|
@@ -921,12 +917,12 @@ const We = d(({ index: t, click: e, state: s }, n) => D({
|
|
|
921
917
|
])
|
|
922
918
|
])), Oe = (t) => o({
|
|
923
919
|
class: "relative flex fle-auto flex-col",
|
|
924
|
-
onState: ["open", (e, s,
|
|
920
|
+
onState: ["open", (e, s, a) => {
|
|
925
921
|
if (e)
|
|
926
922
|
return new ie({
|
|
927
923
|
cache: "dropdown",
|
|
928
|
-
parent:
|
|
929
|
-
button:
|
|
924
|
+
parent: a,
|
|
925
|
+
button: a.input,
|
|
930
926
|
size: "xl"
|
|
931
927
|
}, [
|
|
932
928
|
Pe(t)
|
|
@@ -967,7 +963,7 @@ const We = d(({ index: t, click: e, state: s }, n) => D({
|
|
|
967
963
|
const t = this.data.filteredOptions;
|
|
968
964
|
let { searchQuery: e } = this.state;
|
|
969
965
|
e = e.toLowerCase();
|
|
970
|
-
const s = t.findIndex((
|
|
966
|
+
const s = t.findIndex((a) => a.label.toLowerCase() === e);
|
|
971
967
|
s >= 0 && (this.state.selectedIndex = s);
|
|
972
968
|
},
|
|
973
969
|
/**
|
|
@@ -1132,11 +1128,11 @@ class ct extends u {
|
|
|
1132
1128
|
const s = this.options;
|
|
1133
1129
|
if (!s || s.length < 1)
|
|
1134
1130
|
return;
|
|
1135
|
-
const
|
|
1136
|
-
for (const
|
|
1137
|
-
if (
|
|
1138
|
-
return
|
|
1139
|
-
return
|
|
1131
|
+
const a = s[0];
|
|
1132
|
+
for (const n of s)
|
|
1133
|
+
if (n.value === e)
|
|
1134
|
+
return n.layout;
|
|
1135
|
+
return a.layout;
|
|
1140
1136
|
}
|
|
1141
1137
|
/**
|
|
1142
1138
|
* This will setup the states.
|
|
@@ -1148,8 +1144,8 @@ class ct extends u {
|
|
|
1148
1144
|
return {
|
|
1149
1145
|
selected: {
|
|
1150
1146
|
state: this.getFirstValue(),
|
|
1151
|
-
callBack(
|
|
1152
|
-
s === "function" && e(
|
|
1147
|
+
callBack(a) {
|
|
1148
|
+
s === "function" && e(a);
|
|
1153
1149
|
}
|
|
1154
1150
|
}
|
|
1155
1151
|
};
|
|
@@ -1272,14 +1268,14 @@ class Ee extends u {
|
|
|
1272
1268
|
* @returns {void}
|
|
1273
1269
|
*/
|
|
1274
1270
|
updateLinks(e) {
|
|
1275
|
-
let s = !1,
|
|
1271
|
+
let s = !1, a = this.links[0];
|
|
1276
1272
|
this.deactivateAllLinks();
|
|
1277
|
-
for (const
|
|
1278
|
-
if (
|
|
1279
|
-
this.updateLink(
|
|
1273
|
+
for (const n of this.links)
|
|
1274
|
+
if (n.rendered !== !1 && (s = Ye(n, e), s === !0)) {
|
|
1275
|
+
this.updateLink(n, !0);
|
|
1280
1276
|
break;
|
|
1281
1277
|
}
|
|
1282
|
-
s !== !0 &&
|
|
1278
|
+
s !== !0 && a && this.updateLink(a, !0);
|
|
1283
1279
|
}
|
|
1284
1280
|
/**
|
|
1285
1281
|
* This will deactivate all links.
|
|
@@ -1306,9 +1302,9 @@ class Ee extends u {
|
|
|
1306
1302
|
* @param {object} option
|
|
1307
1303
|
* @returns {object}
|
|
1308
1304
|
*/
|
|
1309
|
-
addLink({ label: e, href: s, exact:
|
|
1310
|
-
const
|
|
1311
|
-
return this.links.push(
|
|
1305
|
+
addLink({ label: e, href: s, exact: a }) {
|
|
1306
|
+
const n = Fe({ text: e, href: s, exact: a });
|
|
1307
|
+
return this.links.push(n), n;
|
|
1312
1308
|
}
|
|
1313
1309
|
/**
|
|
1314
1310
|
* This will remove all the links.
|
|
@@ -1352,9 +1348,9 @@ class ht extends u {
|
|
|
1352
1348
|
*/
|
|
1353
1349
|
addGroup() {
|
|
1354
1350
|
let e;
|
|
1355
|
-
const s = [],
|
|
1356
|
-
for (let
|
|
1357
|
-
e = n
|
|
1351
|
+
const s = [], a = this.options;
|
|
1352
|
+
for (let n = 0, i = a.length; n < i; n++)
|
|
1353
|
+
e = a[n], s.push(
|
|
1358
1354
|
{
|
|
1359
1355
|
uri: e.uri || e.href,
|
|
1360
1356
|
component: e.component,
|
|
@@ -1413,12 +1409,12 @@ class He extends u {
|
|
|
1413
1409
|
* @returns {Array} An array of [eventName, element, callback] definitions.
|
|
1414
1410
|
*/
|
|
1415
1411
|
setupEvents() {
|
|
1416
|
-
const e = this.panel, s = this.pointerPosition.bind(this),
|
|
1412
|
+
const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), n = this.pointerDown.bind(this), i = this.resize.bind(this), l = { passive: !1 };
|
|
1417
1413
|
return [
|
|
1418
1414
|
["pointermove", e, s, l],
|
|
1419
|
-
["pointerup", e,
|
|
1420
|
-
["pointerdown", e,
|
|
1421
|
-
["pointerout", e,
|
|
1415
|
+
["pointerup", e, a],
|
|
1416
|
+
["pointerdown", e, n, l],
|
|
1417
|
+
["pointerout", e, a],
|
|
1422
1418
|
["resize", window, i]
|
|
1423
1419
|
];
|
|
1424
1420
|
}
|
|
@@ -1429,14 +1425,14 @@ class He extends u {
|
|
|
1429
1425
|
* @returns {void}
|
|
1430
1426
|
*/
|
|
1431
1427
|
getEventPosition(e) {
|
|
1432
|
-
let s,
|
|
1433
|
-
const
|
|
1428
|
+
let s, a;
|
|
1429
|
+
const n = this.canvas, i = n.width / parseInt(n.style.width), l = n.getBoundingClientRect();
|
|
1434
1430
|
if (e.touches && e.touches.length) {
|
|
1435
1431
|
const f = e.touches[0];
|
|
1436
|
-
s = f.clientX,
|
|
1432
|
+
s = f.clientX, a = f.clientY;
|
|
1437
1433
|
} else
|
|
1438
|
-
s = e.x || e.clientX,
|
|
1439
|
-
const h = parseInt((s - l.left) * i), c = parseInt((
|
|
1434
|
+
s = e.x || e.clientX, a = e.y || e.clientY;
|
|
1435
|
+
const h = parseInt((s - l.left) * i), c = parseInt((a - l.top) * i);
|
|
1440
1436
|
this.mouse.x = h, this.mouse.y = c;
|
|
1441
1437
|
}
|
|
1442
1438
|
/**
|
|
@@ -1448,8 +1444,8 @@ class He extends u {
|
|
|
1448
1444
|
*/
|
|
1449
1445
|
pointerDown(e) {
|
|
1450
1446
|
e.preventDefault(), e.stopPropagation(), this.getEventPosition(e);
|
|
1451
|
-
const { ctx: s, mouse:
|
|
1452
|
-
s.beginPath(), s.moveTo(
|
|
1447
|
+
const { ctx: s, mouse: a } = this;
|
|
1448
|
+
s.beginPath(), s.moveTo(a.x, a.y), a.status = "down", this.startTimer();
|
|
1453
1449
|
}
|
|
1454
1450
|
/**
|
|
1455
1451
|
* Called when the pointer goes up or leaves the canvas area.
|
|
@@ -1477,12 +1473,12 @@ class He extends u {
|
|
|
1477
1473
|
* @returns {void}
|
|
1478
1474
|
*/
|
|
1479
1475
|
resize() {
|
|
1480
|
-
const { canvas: e, ctx: s } = this,
|
|
1481
|
-
if (this.scale(), this.setupBackground(s),
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
s.drawImage(
|
|
1485
|
-
}),
|
|
1476
|
+
const { canvas: e, ctx: s } = this, a = e.toDataURL();
|
|
1477
|
+
if (this.scale(), this.setupBackground(s), a !== "data:,") {
|
|
1478
|
+
const n = new window.Image();
|
|
1479
|
+
B.on("load", n, function i() {
|
|
1480
|
+
s.drawImage(n, 0, 0), B.off("load", n, i);
|
|
1481
|
+
}), n.src = a;
|
|
1486
1482
|
}
|
|
1487
1483
|
this.draw();
|
|
1488
1484
|
}
|
|
@@ -1501,7 +1497,7 @@ class He extends u {
|
|
|
1501
1497
|
* @returns {void}
|
|
1502
1498
|
*/
|
|
1503
1499
|
noScaleResize() {
|
|
1504
|
-
const e =
|
|
1500
|
+
const e = I.getSize(container);
|
|
1505
1501
|
this.width = canvas.width = e.width, this.height = canvas.height = e.height;
|
|
1506
1502
|
}
|
|
1507
1503
|
/**
|
|
@@ -1511,10 +1507,10 @@ class He extends u {
|
|
|
1511
1507
|
* @returns {void}
|
|
1512
1508
|
*/
|
|
1513
1509
|
scale() {
|
|
1514
|
-
const e = this.canvas, s = this.container,
|
|
1510
|
+
const e = this.canvas, s = this.container, a = I.getSize(s), n = this.targetSize, i = n.width, l = n.height;
|
|
1515
1511
|
let h = i + "px", c = l + "px";
|
|
1516
|
-
if (this.width = e.width = i, this.height = e.height = l,
|
|
1517
|
-
const f =
|
|
1512
|
+
if (this.width = e.width = i, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
|
|
1513
|
+
const f = a.width, g = a.height, r = f / i, p = g / l, k = Math.min(r, p);
|
|
1518
1514
|
h = i * k + "px", c = l * k + "px";
|
|
1519
1515
|
}
|
|
1520
1516
|
e.style.width = h, e.style.height = c;
|
|
@@ -1537,8 +1533,8 @@ class He extends u {
|
|
|
1537
1533
|
drawBottomLine(e) {
|
|
1538
1534
|
const s = this.canvas;
|
|
1539
1535
|
e.globalAlpha = 1, e.shadowBlur = 0;
|
|
1540
|
-
const
|
|
1541
|
-
e.beginPath(), e.moveTo(
|
|
1536
|
+
const a = this.margin.x, n = this.height - this.margin.y;
|
|
1537
|
+
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();
|
|
1542
1538
|
}
|
|
1543
1539
|
/**
|
|
1544
1540
|
* Adds a line to the current path, updating the 'signed' status.
|
|
@@ -1549,10 +1545,10 @@ class He extends u {
|
|
|
1549
1545
|
* @param {string} color The stroke color.
|
|
1550
1546
|
* @returns {void}
|
|
1551
1547
|
*/
|
|
1552
|
-
addLine(e, s,
|
|
1548
|
+
addLine(e, s, a, n) {
|
|
1553
1549
|
this.signed || (this.signed = !0);
|
|
1554
|
-
const i = Math.round(s), l = Math.round(
|
|
1555
|
-
e.lineWidth = this.lineWidth, e.strokeStyle =
|
|
1550
|
+
const i = Math.round(s), l = Math.round(a);
|
|
1551
|
+
e.lineWidth = this.lineWidth, e.strokeStyle = n, e.lineTo(i, l), e.stroke();
|
|
1556
1552
|
}
|
|
1557
1553
|
/**
|
|
1558
1554
|
* Clears the canvas, sets signed to false, and re-initializes
|
|
@@ -1608,7 +1604,7 @@ class ut extends u {
|
|
|
1608
1604
|
*/
|
|
1609
1605
|
render() {
|
|
1610
1606
|
return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
|
|
1611
|
-
|
|
1607
|
+
ae({
|
|
1612
1608
|
cache: "hiddenInput",
|
|
1613
1609
|
required: !0,
|
|
1614
1610
|
bind: this.path + ".data"
|
|
@@ -1675,7 +1671,7 @@ export {
|
|
|
1675
1671
|
be as D,
|
|
1676
1672
|
we as H,
|
|
1677
1673
|
lt as I,
|
|
1678
|
-
|
|
1674
|
+
nt as N,
|
|
1679
1675
|
A as O,
|
|
1680
1676
|
Je as P,
|
|
1681
1677
|
st as S,
|
|
@@ -1692,7 +1688,7 @@ export {
|
|
|
1692
1688
|
fe as h,
|
|
1693
1689
|
ge as i,
|
|
1694
1690
|
ke as j,
|
|
1695
|
-
|
|
1691
|
+
at as k,
|
|
1696
1692
|
ot as l,
|
|
1697
1693
|
rt as m,
|
|
1698
1694
|
ct as n,
|
package/package.json
CHANGED