@base-framework/ui 1.0.2009 → 1.0.2011
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/{empty-state-DPZnGGfG.js → empty-state-DJncaDM9.js} +1 -1
- package/dist/index.es.js +3 -3
- package/dist/molecules.es.js +2 -2
- package/dist/organisms.es.js +2 -2
- package/dist/{range-calendar-CE23Uxc_.js → range-calendar-CCVC3e9d.js} +135 -130
- package/dist/{signature-panel-BkW9B_6i.js → signature-panel-DIFmtS0f.js} +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Div as n, H5 as X, P as b, I as x, Li as q, Span as a, Ul as Y, Button as m, OnState as D, Label as A, H2 as S, Form as Z, Header as F, Footer as M, A as V, H3 as ee, Checkbox as te, Input as f, Img as _, Nav as se, UseParent as W, OnStateOpen as P, Time as oe, Dialog as ne } from "@base-framework/atoms";
|
|
2
2
|
import { Atom as c, Component as y, Html as O, Dom as re, base as le, Data as T, Builder as G, Jot as w, Events as p, DateTime as L } from "@base-framework/base";
|
|
3
|
-
import { P as I, b as ie, R as ae } from "./range-calendar-
|
|
3
|
+
import { P as I, b as ie, R as ae } from "./range-calendar-CCVC3e9d.js";
|
|
4
4
|
import { C as ce, F as ue } from "./form-group-CJzpq9Us.js";
|
|
5
5
|
import { B as h, I as g } from "./buttons-CHEs54Wl.js";
|
|
6
6
|
import { Icons as u } from "./icons.es.js";
|
package/dist/index.es.js
CHANGED
|
@@ -4,9 +4,9 @@ import { C as T, F as b } from "./form-group-CJzpq9Us.js";
|
|
|
4
4
|
import { C as I, d as S, D as F, c as B, E as P, F as k, H as M, I as x, M as f, N as v, P as N, R as y, T as h, a as U, b as L, U as W, W as H } from "./inputs-9udyzkHR.js";
|
|
5
5
|
import { V as w, a as A } from "./veil-CqnAmj-D.js";
|
|
6
6
|
import { Icons as O } from "./icons.es.js";
|
|
7
|
-
import { A as V, B as j, C as q, w as J, K as z, y as K, z as Q, E as _, G as X, D as Y, m as Z, n as $, Q as aa, O as ea, v as sa, c as oa, a as ta, b as ra, R as na, l as la, g as ia, i as pa, h as da, j as ma, e as ua, k as ga, F as Ca, d as ca, f as Ta, I as ba, L as Da, x as Ia, M as Sa, o as Fa, N as Ba, P as Pa, s as ka, t as Ma, S as xa, q as fa, r as va, T as Na, H as ya, J as ha, p as Ua, u as La } from "./empty-state-
|
|
8
|
-
import { A as Ha, b as Ra, C as wa, D as Aa, a as Ga, F as Oa, M as Ea, P as Va, R as ja, c as qa, g as Ja, p as za } from "./range-calendar-
|
|
9
|
-
import { B as Qa, p as _a, C as Xa, j as Ya, D as Za, m as $a, k as ae, H as ee, I as se, N as oe, O as te, P as re, S as ne, n as le, o as ie, x as pe, s as de, q as me, r as ue, T as ge, t as Ce, w as ce, u as Te, v as be, l as De, U as Ie, W as Se, f as Fe, h as Be, i as Pe, c as ke, d as Me, b as xe, e as fe, a as ve, g as Ne } from "./signature-panel-
|
|
7
|
+
import { A as V, B as j, C as q, w as J, K as z, y as K, z as Q, E as _, G as X, D as Y, m as Z, n as $, Q as aa, O as ea, v as sa, c as oa, a as ta, b as ra, R as na, l as la, g as ia, i as pa, h as da, j as ma, e as ua, k as ga, F as Ca, d as ca, f as Ta, I as ba, L as Da, x as Ia, M as Sa, o as Fa, N as Ba, P as Pa, s as ka, t as Ma, S as xa, q as fa, r as va, T as Na, H as ya, J as ha, p as Ua, u as La } from "./empty-state-DJncaDM9.js";
|
|
8
|
+
import { A as Ha, b as Ra, C as wa, D as Aa, a as Ga, F as Oa, M as Ea, P as Va, R as ja, c as qa, g as Ja, p as za } from "./range-calendar-CCVC3e9d.js";
|
|
9
|
+
import { B as Qa, p as _a, C as Xa, j as Ya, D as Za, m as $a, k as ae, H as ee, I as se, N as oe, O as te, P as re, S as ne, n as le, o as ie, x as pe, s as de, q as me, r as ue, T as ge, t as Ce, w as ce, u as Te, v as be, l as De, U as Ie, W as Se, f as Fe, h as Be, i as Pe, c as ke, d as Me, b as xe, e as fe, a as ve, g as Ne } from "./signature-panel-DIFmtS0f.js";
|
|
10
10
|
import { B as he, I as Ue, M as Le, d as We, e as He, g as Re, N as we, b as Ae, a as Ge, f as Oe, P as Ee, c as Ve, S as je, T as qe } from "./mobile-nav-wrapper-Dm9DinRD.js";
|
|
11
11
|
import { B as ze, a as Ke, C as Qe, F as _e, b as Xe, c as Ye, M as Ze, P as $e, S as as } from "./sidebar-menu-page-D4WMgz5U.js";
|
|
12
12
|
import { A as ss, F as os, M as ts, a as rs, T as ns } from "./aside-template-sUm-F2f0.js";
|
package/dist/molecules.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as s, B as t, C as e, w as r, K as i, y as n, z as m, E as l, G as d, D as C, m as p, n as S, Q as g, O as u, v as D, c, a as F, b as T, R as P, l as A, g as I, i as f, h as w, j as b, e as y, k as B, F as M, d as k, f as x, I as L, L as R, x as U, M as v, o as E, N, P as h, s as G, t as O, S as j, q, r as z, T as H, H as J, J as K, p as Q, u as _ } from "./empty-state-
|
|
2
|
-
import { A as W, P as X, g as Y } from "./range-calendar-
|
|
1
|
+
import { A as s, B as t, C as e, w as r, K as i, y as n, z as m, E as l, G as d, D as C, m as p, n as S, Q as g, O as u, v as D, c, a as F, b as T, R as P, l as A, g as I, i as f, h as w, j as b, e as y, k as B, F as M, d as k, f as x, I as L, L as R, x as U, M as v, o as E, N, P as h, s as G, t as O, S as j, q, r as z, T as H, H as J, J as K, p as Q, u as _ } from "./empty-state-DJncaDM9.js";
|
|
2
|
+
import { A as W, P as X, g as Y } from "./range-calendar-CCVC3e9d.js";
|
|
3
3
|
export {
|
|
4
4
|
s as Alert,
|
|
5
5
|
W as Avatar,
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as s, p as n, C as t, j as o, D as r, m as l, k as i, H as d, I as b, N as u, O as v, P as g, S as p, n as T, o as D, x as N, s as k, q as C, r as c, T as B, t as M, w as m, u as y, v as W, l as h, U as S, W as H, f as P, h as U, i as x, c as I, d as f, b as L, e as O, a as F, g as G } from "./signature-panel-
|
|
2
|
-
import { b as R, C as j, D as q, a as z, F as A, M as E, R as J, c as K, p as Q } from "./range-calendar-
|
|
1
|
+
import { B as s, p as n, C as t, j as o, D as r, m as l, k as i, H as d, I as b, N as u, O as v, P as g, S as p, n as T, o as D, x as N, s as k, q as C, r as c, T as B, t as M, w as m, u as y, v as W, l as h, U as S, W as H, f as P, h as U, i as x, c as I, d as f, b as L, e as O, a as F, g as G } from "./signature-panel-DIFmtS0f.js";
|
|
2
|
+
import { b as R, C as j, D as q, a as z, F as A, M as E, R as J, c as K, p as Q } from "./range-calendar-CCVC3e9d.js";
|
|
3
3
|
import { B as X, I as Y, M as Z, d as _, e as $, g as aa, N as ea, b as sa, a as na, f as ta, P as oa, c as ra, S as la, T as ia } from "./mobile-nav-wrapper-Dm9DinRD.js";
|
|
4
4
|
export {
|
|
5
5
|
s as BackButton,
|
|
@@ -2,11 +2,11 @@ import { Div as h, Img as _, Span as H, Button as L, OnState as J, On as z } fro
|
|
|
2
2
|
import { Component as Y, Data as B, Atom as j, DateTime as T } from "@base-framework/base";
|
|
3
3
|
import { B as m } from "./buttons-CHEs54Wl.js";
|
|
4
4
|
import { Icons as P } from "./icons.es.js";
|
|
5
|
-
const U = (
|
|
6
|
-
const
|
|
7
|
-
let i =
|
|
8
|
-
const g = globalThis.innerHeight -
|
|
9
|
-
return i + a.width > globalThis.innerWidth && (i = globalThis.innerWidth - a.width - s), g < a.height && f > g ? d =
|
|
5
|
+
const U = (n, t) => {
|
|
6
|
+
const e = n ? n.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, a = t.getBoundingClientRect(), s = 10, r = globalThis.scrollX, l = globalThis.scrollY;
|
|
7
|
+
let i = e.left + r, d = e.bottom + l;
|
|
8
|
+
const g = globalThis.innerHeight - e.bottom, f = e.top;
|
|
9
|
+
return i + a.width > globalThis.innerWidth && (i = globalThis.innerWidth - a.width - s), g < a.height && f > g ? d = e.top + l - a.height - s : g < a.height && (d = e.bottom + l - (a.height - g) - s), { x: i, y: d };
|
|
10
10
|
};
|
|
11
11
|
class Pt extends Y {
|
|
12
12
|
/**
|
|
@@ -59,7 +59,7 @@ class Pt extends Y {
|
|
|
59
59
|
return h({
|
|
60
60
|
class: `absolute inset-auto fadeIn mt-2 rounded-md p-0 shadow-lg bg-popover min-h-12 backdrop:bg-transparent text-inherit r z-30 ${t}`,
|
|
61
61
|
popover: "manual",
|
|
62
|
-
toggle: (
|
|
62
|
+
toggle: (e, { state: a }) => e.newState === "closed" ? a.open = !1 : null,
|
|
63
63
|
style: "top: [[position.y]]px; left: [[position.x]]px"
|
|
64
64
|
}, this.children);
|
|
65
65
|
}
|
|
@@ -84,7 +84,7 @@ class Pt extends Y {
|
|
|
84
84
|
* @returns {void}
|
|
85
85
|
*/
|
|
86
86
|
updatePosition() {
|
|
87
|
-
const t = this.button ?? null,
|
|
87
|
+
const t = this.button ?? null, e = this.panel, a = U(t, e);
|
|
88
88
|
this.data.position = a;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -136,12 +136,17 @@ class Pt extends Y {
|
|
|
136
136
|
this.panel.hidePopover();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
const q = j(({ src:
|
|
139
|
+
const q = j(({ src: n, alt: t }) => !n || n.indexOf(".") === -1 && n.indexOf("[[") === -1 ? null : _({
|
|
140
140
|
class: "absolute w-full h-full rounded-full object-cover fadeIn",
|
|
141
|
-
src:
|
|
142
|
-
alt: t
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
src: n,
|
|
142
|
+
alt: t,
|
|
143
|
+
load: (e) => e.target.style.visibility = "visible",
|
|
144
|
+
/**
|
|
145
|
+
* If there's an error loading the image, hide it.
|
|
146
|
+
*/
|
|
147
|
+
error: (e) => e.target.style.visibility = "hidden"
|
|
148
|
+
})), K = (n) => n && (Array.isArray(n) && (n = n.join(" ")), typeof n != "string" && (n = String(n)), n.split(" ").map((t) => t.charAt(0)).join("").toUpperCase()), G = (n) => !n || n.length < 2 ? n : K(n), Q = (n) => H([n, (t, e) => {
|
|
149
|
+
e.textContent = G(t);
|
|
145
150
|
}]), A = {
|
|
146
151
|
xs: "h-6 w-6",
|
|
147
152
|
sm: "h-8 w-8",
|
|
@@ -162,8 +167,8 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
162
167
|
"3xl": "text-4xl",
|
|
163
168
|
"4xl": "text-5xl",
|
|
164
169
|
default: "text-base"
|
|
165
|
-
}, V = (
|
|
166
|
-
const a = G(
|
|
170
|
+
}, V = (n) => A[n] || A.default, Z = (n) => I[n] || I.default, tt = (n, t = null, e = "md") => {
|
|
171
|
+
const a = G(n), s = Z(e);
|
|
167
172
|
return h(
|
|
168
173
|
{
|
|
169
174
|
class: `
|
|
@@ -176,49 +181,49 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
176
181
|
t ? Q(t) : H({ class: "uppercase" }, a)
|
|
177
182
|
]
|
|
178
183
|
);
|
|
179
|
-
}, Tt = j(({ src:
|
|
184
|
+
}, Tt = j(({ src: n, alt: t, fallbackText: e, watcherFallback: a, size: s }) => {
|
|
180
185
|
const r = V(s);
|
|
181
186
|
return h(
|
|
182
187
|
{
|
|
183
188
|
class: `relative flex items-center justify-center ${r}`
|
|
184
189
|
},
|
|
185
190
|
[
|
|
186
|
-
q({ src:
|
|
187
|
-
tt(
|
|
191
|
+
q({ src: n, alt: t }),
|
|
192
|
+
tt(e, a, s)
|
|
188
193
|
]
|
|
189
194
|
);
|
|
190
|
-
}), et = ({ currentMonth:
|
|
195
|
+
}), et = ({ currentMonth: n, currentYear: t, onSelect: e }) => h(
|
|
191
196
|
{ class: "grid grid-cols-3 gap-2" },
|
|
192
197
|
T.monthNames.map(
|
|
193
198
|
(a, s) => m(
|
|
194
199
|
{
|
|
195
200
|
click: (r) => {
|
|
196
|
-
r.preventDefault(), r.stopPropagation(),
|
|
201
|
+
r.preventDefault(), r.stopPropagation(), e(s);
|
|
197
202
|
},
|
|
198
|
-
variant:
|
|
203
|
+
variant: n === s ? "primary" : "ghost",
|
|
199
204
|
"aria-label": `Select ${a} ${t}`
|
|
200
205
|
},
|
|
201
206
|
a.substring(0, 3)
|
|
202
207
|
)
|
|
203
208
|
)
|
|
204
|
-
), D = (
|
|
209
|
+
), D = (n) => (n *= 1, n < 10 ? `0${n}` : String(n)), nt = (n) => (n.indexOf("T") === -1 && n.indexOf(" ") === -1 && (n += "T00:00:01"), n.replace(" ", "T"), n), w = (n, t, e) => `${n}-${D(t + 1)}-${D(e)}`, at = (n) => n ? "bg-accent text-primary" : "", st = (n) => n ? "text-muted-foreground opacity-50" : "", rt = (n, t) => n === t, ot = (n, t) => rt(n, t) ? "bg-primary text-primary-foreground" : "", it = (n, t, e, a) => {
|
|
205
210
|
const s = ot(t, a);
|
|
206
|
-
return s || (
|
|
207
|
-
}, N = (
|
|
211
|
+
return s || (n ? at(n) : e ? st(e) : "text-foreground");
|
|
212
|
+
}, N = (n) => {
|
|
208
213
|
const {
|
|
209
214
|
day: t,
|
|
210
|
-
currentDate:
|
|
215
|
+
currentDate: e,
|
|
211
216
|
date: a,
|
|
212
217
|
isToday: s,
|
|
213
218
|
isOutsideMonth: r,
|
|
214
219
|
select: l,
|
|
215
220
|
disabled: i
|
|
216
|
-
} =
|
|
221
|
+
} = n;
|
|
217
222
|
return L(
|
|
218
223
|
{
|
|
219
224
|
class: `
|
|
220
225
|
flex items-center justify-center h-9 w-auto p-0 font-normal text-sm rounded-md
|
|
221
|
-
${it(s,
|
|
226
|
+
${it(s, e, r, a)}
|
|
222
227
|
hover:bg-muted/50 hover:text-muted-foreground focus:z-10
|
|
223
228
|
disabled:pointer-events-none disabled:opacity-50
|
|
224
229
|
`,
|
|
@@ -229,8 +234,8 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
229
234
|
},
|
|
230
235
|
t.toString()
|
|
231
236
|
);
|
|
232
|
-
}, O = (
|
|
233
|
-
const { year: s, month: r } =
|
|
237
|
+
}, O = (n, t, e, a) => n === a.date && t === a.month && e === a.year, lt = (n, t, e, a = !1) => {
|
|
238
|
+
const { year: s, month: r } = n, l = w(s, r, n.date), i = new Date(s, r, 1).getDay(), d = new Date(s, r + 1, 0).getDate(), g = new Date(s, r, 0).getDate(), f = [], C = r === 0 ? 11 : r - 1, v = r === 0 ? s - 1 : s;
|
|
234
239
|
for (let o = i - 1; o >= 0; o--) {
|
|
235
240
|
const u = g - o, p = O(u, C, v, t), y = new Date(v, C, u) < new Date(t.year, t.month, t.date), x = a && y;
|
|
236
241
|
f.push(
|
|
@@ -240,7 +245,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
240
245
|
date: w(v, C, u),
|
|
241
246
|
isToday: p,
|
|
242
247
|
isOutsideMonth: !0,
|
|
243
|
-
select:
|
|
248
|
+
select: e,
|
|
244
249
|
disabled: x
|
|
245
250
|
})
|
|
246
251
|
);
|
|
@@ -254,7 +259,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
254
259
|
date: w(s, r, o),
|
|
255
260
|
isToday: u,
|
|
256
261
|
isOutsideMonth: !1,
|
|
257
|
-
select:
|
|
262
|
+
select: e,
|
|
258
263
|
disabled: y
|
|
259
264
|
})
|
|
260
265
|
);
|
|
@@ -269,39 +274,39 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
269
274
|
date: w($, b, o),
|
|
270
275
|
isToday: u,
|
|
271
276
|
isOutsideMonth: !0,
|
|
272
|
-
select:
|
|
277
|
+
select: e,
|
|
273
278
|
disabled: y
|
|
274
279
|
})
|
|
275
280
|
);
|
|
276
281
|
}
|
|
277
282
|
return f;
|
|
278
|
-
}, R = ({ label:
|
|
283
|
+
}, R = ({ label: n, click: t }) => m(
|
|
279
284
|
{
|
|
280
285
|
class: `
|
|
281
286
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
282
287
|
opacity-50 hover:opacity-100 text-muted-foreground absolute
|
|
283
|
-
${
|
|
288
|
+
${n === "Previous" ? "left-1" : "right-1"}
|
|
284
289
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
285
290
|
`,
|
|
286
291
|
click: t,
|
|
287
|
-
"aria-label": `${
|
|
292
|
+
"aria-label": `${n} month`,
|
|
288
293
|
variant: "icon",
|
|
289
|
-
icon:
|
|
294
|
+
icon: n === "Previous" ? P.chevron.single.left : P.chevron.single.right
|
|
290
295
|
}
|
|
291
|
-
), ct = ({ onMonthClick:
|
|
292
|
-
m({ click:
|
|
296
|
+
), ct = ({ onMonthClick: n, onYearClick: t, next: e, previous: a }) => h({ class: "flex items-center justify-center gap-x-2 relative min-h-12 text-sm font-medium" }, [
|
|
297
|
+
m({ click: n, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
|
|
293
298
|
m({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
|
|
294
299
|
R({ label: "Previous", click: a }),
|
|
295
|
-
R({ label: "Next", click:
|
|
296
|
-
]), ht = (
|
|
300
|
+
R({ label: "Next", click: e })
|
|
301
|
+
]), ht = (n) => h(
|
|
297
302
|
{ class: "flex items-center justify-center h-9 w-auto text-[0.8rem] font-normal text-muted-foreground" },
|
|
298
|
-
|
|
299
|
-
), ut = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(ht), dt = (
|
|
303
|
+
n
|
|
304
|
+
), ut = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(ht), dt = (n) => h({ class: "rdp flex flex-auto flex-col w-full gap-y-1" }, [
|
|
300
305
|
ct({
|
|
301
|
-
onMonthClick:
|
|
302
|
-
onYearClick:
|
|
303
|
-
next:
|
|
304
|
-
previous:
|
|
306
|
+
onMonthClick: n.onMonthClick,
|
|
307
|
+
onYearClick: n.onYearClick,
|
|
308
|
+
next: n.next,
|
|
309
|
+
previous: n.previous
|
|
305
310
|
}),
|
|
306
311
|
h({
|
|
307
312
|
class: "flex flex-auto flex-col w-full",
|
|
@@ -312,16 +317,16 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
312
317
|
h(
|
|
313
318
|
{ class: "grid grid-cols-7" },
|
|
314
319
|
lt(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
320
|
+
n.current,
|
|
321
|
+
n.today,
|
|
322
|
+
n.select,
|
|
323
|
+
n.blockPriorDates
|
|
319
324
|
)
|
|
320
325
|
)
|
|
321
326
|
]
|
|
322
327
|
]
|
|
323
328
|
})
|
|
324
|
-
]), gt = ({ currentMonth:
|
|
329
|
+
]), gt = ({ currentMonth: n, currentYear: t, onSelect: e }) => {
|
|
325
330
|
const a = t - 50, s = Array.from({ length: 101 }, (r, l) => a + l);
|
|
326
331
|
return h(
|
|
327
332
|
{ class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
|
|
@@ -329,7 +334,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
329
334
|
(r) => m(
|
|
330
335
|
{
|
|
331
336
|
click: (l) => {
|
|
332
|
-
l.preventDefault(), l.stopPropagation(),
|
|
337
|
+
l.preventDefault(), l.stopPropagation(), e(r);
|
|
333
338
|
},
|
|
334
339
|
variant: r === t ? "primary" : "ghost",
|
|
335
340
|
"aria-label": `Select ${r}`
|
|
@@ -355,8 +360,8 @@ class Nt extends Y {
|
|
|
355
360
|
* @returns {Date}
|
|
356
361
|
*/
|
|
357
362
|
getSelectedDate(t) {
|
|
358
|
-
const
|
|
359
|
-
return new Date(
|
|
363
|
+
const e = this.selectedDate ? new Date(nt(this.selectedDate)) : t;
|
|
364
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
360
365
|
}
|
|
361
366
|
/**
|
|
362
367
|
* This will set up the data for the calendar.
|
|
@@ -364,13 +369,13 @@ class Nt extends Y {
|
|
|
364
369
|
* @returns {Data}
|
|
365
370
|
*/
|
|
366
371
|
setData() {
|
|
367
|
-
const t = /* @__PURE__ */ new Date(),
|
|
372
|
+
const t = /* @__PURE__ */ new Date(), e = this.getSelectedDate(t), a = e.getMonth();
|
|
368
373
|
return new B({
|
|
369
374
|
monthName: this.getMonthName(a),
|
|
370
|
-
currentDate: `${
|
|
375
|
+
currentDate: `${e.getFullYear()}-${a + 1}-${e.getDate()}`,
|
|
371
376
|
current: {
|
|
372
|
-
date:
|
|
373
|
-
year:
|
|
377
|
+
date: e.getDate(),
|
|
378
|
+
year: e.getFullYear(),
|
|
374
379
|
month: a
|
|
375
380
|
},
|
|
376
381
|
today: {
|
|
@@ -407,8 +412,8 @@ class Nt extends Y {
|
|
|
407
412
|
*/
|
|
408
413
|
goToPreviousMonth() {
|
|
409
414
|
const t = this.data;
|
|
410
|
-
let
|
|
411
|
-
|
|
415
|
+
let e = t.current.month, a = t.current.year;
|
|
416
|
+
e === 0 ? (e = 11, a--) : e--, this.setCurrentDate(e, a);
|
|
412
417
|
}
|
|
413
418
|
/**
|
|
414
419
|
* This will go to the next month.
|
|
@@ -417,8 +422,8 @@ class Nt extends Y {
|
|
|
417
422
|
*/
|
|
418
423
|
goToNextMonth() {
|
|
419
424
|
const t = this.data;
|
|
420
|
-
let
|
|
421
|
-
|
|
425
|
+
let e = t.current.month, a = t.current.year;
|
|
426
|
+
e === 11 ? (e = 0, a++) : e++, this.setCurrentDate(e, a);
|
|
422
427
|
}
|
|
423
428
|
/**
|
|
424
429
|
* This will set the current month and year.
|
|
@@ -428,9 +433,9 @@ class Nt extends Y {
|
|
|
428
433
|
* @param {number} [date=null]
|
|
429
434
|
* @returns {void}
|
|
430
435
|
*/
|
|
431
|
-
setCurrentDate(t,
|
|
436
|
+
setCurrentDate(t, e, a = null) {
|
|
432
437
|
const s = this.data;
|
|
433
|
-
s.current.month = t, s.current.year =
|
|
438
|
+
s.current.month = t, s.current.year = e, typeof a == "number" && (s.current.date = D(a)), s.currentDate = `${e}-${D(t + 1)}-${s.current.date}`, s.monthName = this.getMonthName(t);
|
|
434
439
|
}
|
|
435
440
|
/**
|
|
436
441
|
* This will select a date.
|
|
@@ -439,8 +444,8 @@ class Nt extends Y {
|
|
|
439
444
|
* @returns {void}
|
|
440
445
|
*/
|
|
441
446
|
selectDate(t) {
|
|
442
|
-
const
|
|
443
|
-
this.setCurrentDate(
|
|
447
|
+
const e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
448
|
+
this.setCurrentDate(e.getMonth(), e.getFullYear(), e.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(this.data.currentDate);
|
|
444
449
|
}
|
|
445
450
|
/**
|
|
446
451
|
* This will render the calendar.
|
|
@@ -456,8 +461,8 @@ class Nt extends Y {
|
|
|
456
461
|
{
|
|
457
462
|
currentMonth: this.data.current.month,
|
|
458
463
|
currentYear: this.data.current.year,
|
|
459
|
-
onSelect: (
|
|
460
|
-
this.setCurrentDate(
|
|
464
|
+
onSelect: (e) => {
|
|
465
|
+
this.setCurrentDate(e, this.data.current.year), this.state.view = "calendar";
|
|
461
466
|
}
|
|
462
467
|
}
|
|
463
468
|
);
|
|
@@ -466,8 +471,8 @@ class Nt extends Y {
|
|
|
466
471
|
{
|
|
467
472
|
currentMonth: this.data.current.month,
|
|
468
473
|
currentYear: this.data.current.year,
|
|
469
|
-
onSelect: (
|
|
470
|
-
this.setCurrentDate(this.data.current.month,
|
|
474
|
+
onSelect: (e) => {
|
|
475
|
+
this.setCurrentDate(this.data.current.month, e), this.state.view = "calendar";
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
478
|
);
|
|
@@ -475,15 +480,15 @@ class Nt extends Y {
|
|
|
475
480
|
return dt({
|
|
476
481
|
current: this.data.current,
|
|
477
482
|
today: this.data.today,
|
|
478
|
-
select: (
|
|
483
|
+
select: (e) => this.selectDate(e),
|
|
479
484
|
next: () => this.goToNextMonth(),
|
|
480
485
|
previous: () => this.goToPreviousMonth(),
|
|
481
486
|
blockPriorDates: this.blockPriorDates || !1,
|
|
482
|
-
onMonthClick: (
|
|
483
|
-
|
|
487
|
+
onMonthClick: (e) => {
|
|
488
|
+
e.preventDefault(), e.stopPropagation(), this.state.view = "months";
|
|
484
489
|
},
|
|
485
|
-
onYearClick: (
|
|
486
|
-
|
|
490
|
+
onYearClick: (e) => {
|
|
491
|
+
e.preventDefault(), e.stopPropagation(), this.state.view = "years";
|
|
487
492
|
}
|
|
488
493
|
});
|
|
489
494
|
}
|
|
@@ -491,44 +496,44 @@ class Nt extends Y {
|
|
|
491
496
|
]);
|
|
492
497
|
}
|
|
493
498
|
}
|
|
494
|
-
const W = ({ label:
|
|
499
|
+
const W = ({ label: n, click: t }) => m(
|
|
495
500
|
{
|
|
496
501
|
class: `
|
|
497
502
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
498
503
|
opacity-50 hover:opacity-100 text-muted-foreground absolute
|
|
499
|
-
${
|
|
504
|
+
${n === "Previous" ? "left-1" : "right-1"}
|
|
500
505
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
501
506
|
`,
|
|
502
507
|
click: t,
|
|
503
|
-
"aria-label": `${
|
|
508
|
+
"aria-label": `${n} month`,
|
|
504
509
|
variant: "icon",
|
|
505
|
-
icon:
|
|
510
|
+
icon: n === "Previous" ? P.chevron.single.left : P.chevron.single.right
|
|
506
511
|
}
|
|
507
|
-
), ft = ({ onMonthClick:
|
|
508
|
-
m({ click:
|
|
512
|
+
), ft = ({ onMonthClick: n, onYearClick: t, next: e, previous: a }) => h({ class: "flex items-center justify-center gap-x-2 relative min-h-12 text-sm font-medium" }, [
|
|
513
|
+
m({ click: n, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
|
|
509
514
|
m({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
|
|
510
515
|
W({ label: "Previous", click: a }),
|
|
511
|
-
W({ label: "Next", click:
|
|
512
|
-
]), mt = (
|
|
516
|
+
W({ label: "Next", click: e })
|
|
517
|
+
]), mt = (n) => h({ class: "h-9 flex items-center justify-center font-medium" }, n), pt = () => h(
|
|
513
518
|
{ class: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-muted-foreground mb-2" },
|
|
514
519
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(mt)
|
|
515
|
-
), yt = ({ day:
|
|
520
|
+
), yt = ({ day: n, iso: t, disabled: e, isStart: a, isEnd: s, isBetween: r, isOtherMonth: l, click: i }) => {
|
|
516
521
|
let d = "ghost", g = "";
|
|
517
|
-
return a || s ? (d = "default", g = "bg-primary text-primary-foreground hover:bg-primary/90") : r && (g = "bg-accent text-accent-foreground hover:bg-accent/80"),
|
|
522
|
+
return a || s ? (d = "default", g = "bg-primary text-primary-foreground hover:bg-primary/90") : r && (g = "bg-accent text-accent-foreground hover:bg-accent/80"), e && (g += " opacity-50 cursor-not-allowed"), l && (g += " text-muted-foreground opacity-50"), m(
|
|
518
523
|
{
|
|
519
524
|
class: `flex items-center justify-center p-0 text-sm font-medium rounded-md transition-colors ${g}`,
|
|
520
525
|
variant: d,
|
|
521
|
-
disabled:
|
|
526
|
+
disabled: e,
|
|
522
527
|
click: (f) => {
|
|
523
|
-
f.preventDefault(), f.stopPropagation(),
|
|
528
|
+
f.preventDefault(), f.stopPropagation(), e || i();
|
|
524
529
|
}
|
|
525
530
|
},
|
|
526
|
-
|
|
531
|
+
n.toString()
|
|
527
532
|
);
|
|
528
|
-
}, Dt = ({ today:
|
|
533
|
+
}, Dt = ({ today: n, current: t, blockPriorDates: e, onDateClick: a }) => {
|
|
529
534
|
const { start: s, end: r } = t, l = new Date(t.year, t.month, 1).getDay(), i = new Date(t.year, t.month + 1, 0).getDate(), d = [], g = t.month === 0 ? 11 : t.month - 1, f = t.month === 0 ? t.year - 1 : t.year, C = new Date(f, g + 1, 0).getDate(), v = t.month === 11 ? 0 : t.month + 1, b = t.month === 11 ? t.year + 1 : t.year;
|
|
530
535
|
for (let c = l - 1; c >= 0; c--) {
|
|
531
|
-
const o = C - c, u = w(f, g, o), p = new Date(f, g, o), y = new Date(
|
|
536
|
+
const o = C - c, u = w(f, g, o), p = new Date(f, g, o), y = new Date(n.year, n.month, n.date), x = p < y, M = e && x, S = s === u, k = r === u, X = s && r && u > s && u < r;
|
|
532
537
|
d.push({
|
|
533
538
|
day: o,
|
|
534
539
|
iso: u,
|
|
@@ -541,7 +546,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
541
546
|
});
|
|
542
547
|
}
|
|
543
548
|
for (let c = 1; c <= i; c++) {
|
|
544
|
-
const o = w(t.year, t.month, c), u = new Date(t.year, t.month, c), p = new Date(
|
|
549
|
+
const o = w(t.year, t.month, c), u = new Date(t.year, t.month, c), p = new Date(n.year, n.month, n.date), y = u < p, x = e && y, M = s === o, S = r === o, k = s && r && o > s && o < r;
|
|
545
550
|
d.push({
|
|
546
551
|
day: c,
|
|
547
552
|
iso: o,
|
|
@@ -557,7 +562,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
557
562
|
}
|
|
558
563
|
const F = (7 - d.length % 7) % 7;
|
|
559
564
|
for (let c = 1; c <= F; c++) {
|
|
560
|
-
const o = w(b, v, c), u = new Date(b, v, c), p = new Date(
|
|
565
|
+
const o = w(b, v, c), u = new Date(b, v, c), p = new Date(n.year, n.month, n.date), y = u < p, x = e && y, M = s === o, S = r === o, k = s && r && o > s && o < r;
|
|
561
566
|
d.push({
|
|
562
567
|
day: c,
|
|
563
568
|
iso: o,
|
|
@@ -584,12 +589,12 @@ const W = ({ label: e, click: t }) => m(
|
|
|
584
589
|
})
|
|
585
590
|
)
|
|
586
591
|
);
|
|
587
|
-
}, xt = j((
|
|
592
|
+
}, xt = j((n, t) => h({ class: "flex flex-auto flex-col" }, [
|
|
588
593
|
ft({
|
|
589
|
-
onMonthClick:
|
|
590
|
-
onYearClick:
|
|
591
|
-
next:
|
|
592
|
-
previous:
|
|
594
|
+
onMonthClick: n.onMonthClick,
|
|
595
|
+
onYearClick: n.onYearClick,
|
|
596
|
+
next: n.next,
|
|
597
|
+
previous: n.previous
|
|
593
598
|
}),
|
|
594
599
|
h({
|
|
595
600
|
class: "flex flex-auto flex-col w-full",
|
|
@@ -598,29 +603,29 @@ const W = ({ label: e, click: t }) => m(
|
|
|
598
603
|
() => [
|
|
599
604
|
pt(),
|
|
600
605
|
Dt({
|
|
601
|
-
today:
|
|
602
|
-
current:
|
|
603
|
-
blockPriorDates:
|
|
604
|
-
onDateClick:
|
|
606
|
+
today: n.today,
|
|
607
|
+
current: n.current,
|
|
608
|
+
blockPriorDates: n.blockPriorDates,
|
|
609
|
+
onDateClick: n.onDateClick
|
|
605
610
|
})
|
|
606
611
|
]
|
|
607
612
|
]
|
|
608
613
|
})
|
|
609
|
-
])), wt = ({ currentMonth:
|
|
614
|
+
])), wt = ({ currentMonth: n, currentYear: t, onSelect: e }) => h(
|
|
610
615
|
{ class: "grid grid-cols-3 gap-2" },
|
|
611
616
|
T.monthNames.map(
|
|
612
617
|
(a, s) => m(
|
|
613
618
|
{
|
|
614
619
|
click: (r) => {
|
|
615
|
-
r.preventDefault(), r.stopPropagation(),
|
|
620
|
+
r.preventDefault(), r.stopPropagation(), e(s);
|
|
616
621
|
},
|
|
617
|
-
variant:
|
|
622
|
+
variant: n === s ? "primary" : "ghost",
|
|
618
623
|
"aria-label": `Select ${a} ${t}`
|
|
619
624
|
},
|
|
620
625
|
a.substring(0, 3)
|
|
621
626
|
)
|
|
622
627
|
)
|
|
623
|
-
), vt = ({ start:
|
|
628
|
+
), vt = ({ start: n, end: t, selecting: e, onSelectStart: a, onSelectEnd: s }) => h({ class: "flex gap-x-2 mb-4" }, [
|
|
624
629
|
z("selecting", (r) => m({
|
|
625
630
|
click: a,
|
|
626
631
|
variant: r === "start" ? "primary" : "outline",
|
|
@@ -635,11 +640,11 @@ const W = ({ label: e, click: t }) => m(
|
|
|
635
640
|
}, [
|
|
636
641
|
h({ class: "font-medium" }, E("current.end", "End Date"))
|
|
637
642
|
]))
|
|
638
|
-
]), E = (
|
|
639
|
-
const t = /* @__PURE__ */ new Date(
|
|
640
|
-
return `${
|
|
641
|
-
}, Ct = ({ currentYear:
|
|
642
|
-
const
|
|
643
|
+
]), E = (n, t) => [`[[${n}]]`, (e) => e == null ? t : bt(e)], bt = (n) => {
|
|
644
|
+
const t = /* @__PURE__ */ new Date(n + "T00:00:00"), e = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
645
|
+
return `${e[t.getDay()]}, ${t.getDate()} ${a[t.getMonth()]}`;
|
|
646
|
+
}, Ct = ({ currentYear: n, onSelect: t }) => {
|
|
647
|
+
const e = n - 50, a = Array.from({ length: 101 }, (s, r) => e + r);
|
|
643
648
|
return h(
|
|
644
649
|
{ class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
|
|
645
650
|
a.map(
|
|
@@ -648,7 +653,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
648
653
|
click: (r) => {
|
|
649
654
|
r.preventDefault(), r.stopPropagation(), t(s);
|
|
650
655
|
},
|
|
651
|
-
variant: s ===
|
|
656
|
+
variant: s === n ? "primary" : "ghost",
|
|
652
657
|
"aria-label": `Select ${s}`
|
|
653
658
|
},
|
|
654
659
|
s.toString()
|
|
@@ -671,7 +676,7 @@ class Ot extends Y {
|
|
|
671
676
|
* @returns {Data}
|
|
672
677
|
*/
|
|
673
678
|
setData() {
|
|
674
|
-
const t = /* @__PURE__ */ new Date(),
|
|
679
|
+
const t = /* @__PURE__ */ new Date(), e = this.startDate ? /* @__PURE__ */ new Date(this.startDate + "T00:00:00") : t, a = e.getMonth(), s = e.getFullYear();
|
|
675
680
|
return new B({
|
|
676
681
|
today: {
|
|
677
682
|
date: t.getDate(),
|
|
@@ -679,7 +684,7 @@ class Ot extends Y {
|
|
|
679
684
|
year: t.getFullYear()
|
|
680
685
|
},
|
|
681
686
|
monthName: this.getMonthName(a),
|
|
682
|
-
currentData: `${
|
|
687
|
+
currentData: `${e.getFullYear()}-${D(e.getMonth() + 1)}-${D(e.getDate())}`,
|
|
683
688
|
current: {
|
|
684
689
|
date: t.getDate(),
|
|
685
690
|
month: a,
|
|
@@ -719,19 +724,19 @@ class Ot extends Y {
|
|
|
719
724
|
handleClick(t) {
|
|
720
725
|
if (this.data.selecting === "start") {
|
|
721
726
|
this.data.current.start = t, this.data.current.end = null, this.data.selecting = "end";
|
|
722
|
-
const
|
|
727
|
+
const e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
723
728
|
this.setCurrent({
|
|
724
|
-
month:
|
|
725
|
-
year:
|
|
726
|
-
date:
|
|
729
|
+
month: e.getMonth(),
|
|
730
|
+
year: e.getFullYear(),
|
|
731
|
+
date: e.getDate()
|
|
727
732
|
});
|
|
728
733
|
} else {
|
|
729
734
|
this.data.current.start && t < this.data.current.start ? (this.data.current.end = this.data.current.start, this.data.current.start = t) : this.data.current.end = t, this.data.selecting = "start";
|
|
730
|
-
const
|
|
735
|
+
const e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
731
736
|
this.setCurrent({
|
|
732
|
-
month:
|
|
733
|
-
year:
|
|
734
|
-
date:
|
|
737
|
+
month: e.getMonth(),
|
|
738
|
+
year: e.getFullYear(),
|
|
739
|
+
date: e.getDate()
|
|
735
740
|
}), typeof this.onRangeSelect == "function" && this.onRangeSelect(this.data.current.start, this.data.current.end);
|
|
736
741
|
}
|
|
737
742
|
}
|
|
@@ -741,9 +746,9 @@ class Ot extends Y {
|
|
|
741
746
|
* @param {object} obj
|
|
742
747
|
* @returns {void}
|
|
743
748
|
*/
|
|
744
|
-
setCurrent({ month: t, year:
|
|
749
|
+
setCurrent({ month: t, year: e, date: a = null }) {
|
|
745
750
|
const s = this.data.current;
|
|
746
|
-
s.month = (t + 12) % 12, s.year =
|
|
751
|
+
s.month = (t + 12) % 12, s.year = e + (t < 0 ? -1 : t > 11 ? 1 : 0), a !== null && (s.date = a), this.data.monthName = this.getMonthName(s.month), this.data.currentDate = `${e}-${D(t + 1)}-${D(s.date)}`;
|
|
747
752
|
}
|
|
748
753
|
/**
|
|
749
754
|
* Render the range calendar.
|
|
@@ -751,7 +756,7 @@ class Ot extends Y {
|
|
|
751
756
|
* @returns {object}
|
|
752
757
|
*/
|
|
753
758
|
render() {
|
|
754
|
-
const { today: t, current:
|
|
759
|
+
const { today: t, current: e, selecting: a } = this.data, { start: s, end: r } = e;
|
|
755
760
|
return h({ class: "range-calendar border border-border rounded-lg shadow-md p-4 w-full max-w-sm min-w-80" }, [
|
|
756
761
|
vt({
|
|
757
762
|
start: s,
|
|
@@ -769,28 +774,28 @@ class Ot extends Y {
|
|
|
769
774
|
case "months":
|
|
770
775
|
return wt(
|
|
771
776
|
{
|
|
772
|
-
currentMonth:
|
|
773
|
-
currentYear:
|
|
777
|
+
currentMonth: e.month,
|
|
778
|
+
currentYear: e.year,
|
|
774
779
|
onSelect: (i) => {
|
|
775
|
-
this.setCurrent({ month: i, year:
|
|
780
|
+
this.setCurrent({ month: i, year: e.year }), this.state.view = "calendar";
|
|
776
781
|
}
|
|
777
782
|
}
|
|
778
783
|
);
|
|
779
784
|
case "years":
|
|
780
785
|
return Ct(
|
|
781
786
|
{
|
|
782
|
-
currentYear:
|
|
787
|
+
currentYear: e.year,
|
|
783
788
|
onSelect: (i) => {
|
|
784
|
-
this.setCurrent({ month:
|
|
789
|
+
this.setCurrent({ month: e.month, year: i }), this.state.view = "calendar";
|
|
785
790
|
}
|
|
786
791
|
}
|
|
787
792
|
);
|
|
788
793
|
default:
|
|
789
794
|
return xt({
|
|
790
795
|
monthName: this.data.monthName,
|
|
791
|
-
year:
|
|
796
|
+
year: e.year,
|
|
792
797
|
today: t,
|
|
793
|
-
current:
|
|
798
|
+
current: e,
|
|
794
799
|
blockPriorDates: this.blockPriorDates,
|
|
795
800
|
onDateClick: (i) => this.handleClick(i),
|
|
796
801
|
onMonthClick: (i) => {
|
|
@@ -4,7 +4,7 @@ import { B as P, I as J } from "./buttons-CHEs54Wl.js";
|
|
|
4
4
|
import { Icons as S } from "./icons.es.js";
|
|
5
5
|
import { TableBody as Z, DataTableBody as ee, ScrollableTableBody as te, List as se, IntervalTimer as ae } from "@base-framework/organisms";
|
|
6
6
|
import { C as ie, I as ne, H as oe } from "./inputs-9udyzkHR.js";
|
|
7
|
-
import { A as le, P as re } from "./range-calendar-
|
|
7
|
+
import { A as le, P as re } from "./range-calendar-CCVC3e9d.js";
|
|
8
8
|
import { V as g } from "./veil-CqnAmj-D.js";
|
|
9
9
|
d((t, e) => ({
|
|
10
10
|
class: "flex items-center px-4 py-2",
|
|
@@ -1041,7 +1041,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => y({
|
|
|
1041
1041
|
}, a)), Ne = d(({ selectOption: t, state: e }) => f({
|
|
1042
1042
|
class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
|
|
1043
1043
|
for: ["filteredOptions", (s, a) => ze({ index: a, click: t, state: e }, s.label)]
|
|
1044
|
-
})), Ue = d((t) => o({ class: "relative flex items-center" }, [
|
|
1044
|
+
})), Ue = d((t) => o({ class: "relative flex flex-auto items-center" }, [
|
|
1045
1045
|
ne({
|
|
1046
1046
|
cache: "input",
|
|
1047
1047
|
class: t.class ?? "",
|
package/package.json
CHANGED