@base-framework/ui 1.0.2008 → 1.0.2010
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-D6ylWJ5h.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-C5WAB1m7.js → range-calendar-CCVC3e9d.js} +132 -131
- package/dist/{signature-panel-Dj7lb6ln.js → signature-panel-C4Xncv3U.js} +1 -1
- 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-C4Xncv3U.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-C4Xncv3U.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,16 +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
|
|
141
|
+
src: n,
|
|
142
|
+
alt: t,
|
|
143
|
+
load: (e) => e.target.style.visibility = "visible",
|
|
143
144
|
/**
|
|
144
145
|
* If there's an error loading the image, hide it.
|
|
145
146
|
*/
|
|
146
|
-
|
|
147
|
-
})), K = (
|
|
148
|
-
|
|
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);
|
|
149
150
|
}]), A = {
|
|
150
151
|
xs: "h-6 w-6",
|
|
151
152
|
sm: "h-8 w-8",
|
|
@@ -166,8 +167,8 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
166
167
|
"3xl": "text-4xl",
|
|
167
168
|
"4xl": "text-5xl",
|
|
168
169
|
default: "text-base"
|
|
169
|
-
}, V = (
|
|
170
|
-
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);
|
|
171
172
|
return h(
|
|
172
173
|
{
|
|
173
174
|
class: `
|
|
@@ -180,49 +181,49 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
180
181
|
t ? Q(t) : H({ class: "uppercase" }, a)
|
|
181
182
|
]
|
|
182
183
|
);
|
|
183
|
-
}, Tt = j(({ src:
|
|
184
|
+
}, Tt = j(({ src: n, alt: t, fallbackText: e, watcherFallback: a, size: s }) => {
|
|
184
185
|
const r = V(s);
|
|
185
186
|
return h(
|
|
186
187
|
{
|
|
187
188
|
class: `relative flex items-center justify-center ${r}`
|
|
188
189
|
},
|
|
189
190
|
[
|
|
190
|
-
q({ src:
|
|
191
|
-
tt(
|
|
191
|
+
q({ src: n, alt: t }),
|
|
192
|
+
tt(e, a, s)
|
|
192
193
|
]
|
|
193
194
|
);
|
|
194
|
-
}), et = ({ currentMonth:
|
|
195
|
+
}), et = ({ currentMonth: n, currentYear: t, onSelect: e }) => h(
|
|
195
196
|
{ class: "grid grid-cols-3 gap-2" },
|
|
196
197
|
T.monthNames.map(
|
|
197
198
|
(a, s) => m(
|
|
198
199
|
{
|
|
199
200
|
click: (r) => {
|
|
200
|
-
r.preventDefault(), r.stopPropagation(),
|
|
201
|
+
r.preventDefault(), r.stopPropagation(), e(s);
|
|
201
202
|
},
|
|
202
|
-
variant:
|
|
203
|
+
variant: n === s ? "primary" : "ghost",
|
|
203
204
|
"aria-label": `Select ${a} ${t}`
|
|
204
205
|
},
|
|
205
206
|
a.substring(0, 3)
|
|
206
207
|
)
|
|
207
208
|
)
|
|
208
|
-
), 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) => {
|
|
209
210
|
const s = ot(t, a);
|
|
210
|
-
return s || (
|
|
211
|
-
}, N = (
|
|
211
|
+
return s || (n ? at(n) : e ? st(e) : "text-foreground");
|
|
212
|
+
}, N = (n) => {
|
|
212
213
|
const {
|
|
213
214
|
day: t,
|
|
214
|
-
currentDate:
|
|
215
|
+
currentDate: e,
|
|
215
216
|
date: a,
|
|
216
217
|
isToday: s,
|
|
217
218
|
isOutsideMonth: r,
|
|
218
219
|
select: l,
|
|
219
220
|
disabled: i
|
|
220
|
-
} =
|
|
221
|
+
} = n;
|
|
221
222
|
return L(
|
|
222
223
|
{
|
|
223
224
|
class: `
|
|
224
225
|
flex items-center justify-center h-9 w-auto p-0 font-normal text-sm rounded-md
|
|
225
|
-
${it(s,
|
|
226
|
+
${it(s, e, r, a)}
|
|
226
227
|
hover:bg-muted/50 hover:text-muted-foreground focus:z-10
|
|
227
228
|
disabled:pointer-events-none disabled:opacity-50
|
|
228
229
|
`,
|
|
@@ -233,8 +234,8 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
233
234
|
},
|
|
234
235
|
t.toString()
|
|
235
236
|
);
|
|
236
|
-
}, O = (
|
|
237
|
-
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;
|
|
238
239
|
for (let o = i - 1; o >= 0; o--) {
|
|
239
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;
|
|
240
241
|
f.push(
|
|
@@ -244,7 +245,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
244
245
|
date: w(v, C, u),
|
|
245
246
|
isToday: p,
|
|
246
247
|
isOutsideMonth: !0,
|
|
247
|
-
select:
|
|
248
|
+
select: e,
|
|
248
249
|
disabled: x
|
|
249
250
|
})
|
|
250
251
|
);
|
|
@@ -258,7 +259,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
258
259
|
date: w(s, r, o),
|
|
259
260
|
isToday: u,
|
|
260
261
|
isOutsideMonth: !1,
|
|
261
|
-
select:
|
|
262
|
+
select: e,
|
|
262
263
|
disabled: y
|
|
263
264
|
})
|
|
264
265
|
);
|
|
@@ -273,39 +274,39 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
273
274
|
date: w($, b, o),
|
|
274
275
|
isToday: u,
|
|
275
276
|
isOutsideMonth: !0,
|
|
276
|
-
select:
|
|
277
|
+
select: e,
|
|
277
278
|
disabled: y
|
|
278
279
|
})
|
|
279
280
|
);
|
|
280
281
|
}
|
|
281
282
|
return f;
|
|
282
|
-
}, R = ({ label:
|
|
283
|
+
}, R = ({ label: n, click: t }) => m(
|
|
283
284
|
{
|
|
284
285
|
class: `
|
|
285
286
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
286
287
|
opacity-50 hover:opacity-100 text-muted-foreground absolute
|
|
287
|
-
${
|
|
288
|
+
${n === "Previous" ? "left-1" : "right-1"}
|
|
288
289
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
289
290
|
`,
|
|
290
291
|
click: t,
|
|
291
|
-
"aria-label": `${
|
|
292
|
+
"aria-label": `${n} month`,
|
|
292
293
|
variant: "icon",
|
|
293
|
-
icon:
|
|
294
|
+
icon: n === "Previous" ? P.chevron.single.left : P.chevron.single.right
|
|
294
295
|
}
|
|
295
|
-
), ct = ({ onMonthClick:
|
|
296
|
-
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]]"),
|
|
297
298
|
m({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
|
|
298
299
|
R({ label: "Previous", click: a }),
|
|
299
|
-
R({ label: "Next", click:
|
|
300
|
-
]), ht = (
|
|
300
|
+
R({ label: "Next", click: e })
|
|
301
|
+
]), ht = (n) => h(
|
|
301
302
|
{ class: "flex items-center justify-center h-9 w-auto text-[0.8rem] font-normal text-muted-foreground" },
|
|
302
|
-
|
|
303
|
-
), 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" }, [
|
|
304
305
|
ct({
|
|
305
|
-
onMonthClick:
|
|
306
|
-
onYearClick:
|
|
307
|
-
next:
|
|
308
|
-
previous:
|
|
306
|
+
onMonthClick: n.onMonthClick,
|
|
307
|
+
onYearClick: n.onYearClick,
|
|
308
|
+
next: n.next,
|
|
309
|
+
previous: n.previous
|
|
309
310
|
}),
|
|
310
311
|
h({
|
|
311
312
|
class: "flex flex-auto flex-col w-full",
|
|
@@ -316,16 +317,16 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
316
317
|
h(
|
|
317
318
|
{ class: "grid grid-cols-7" },
|
|
318
319
|
lt(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
n.current,
|
|
321
|
+
n.today,
|
|
322
|
+
n.select,
|
|
323
|
+
n.blockPriorDates
|
|
323
324
|
)
|
|
324
325
|
)
|
|
325
326
|
]
|
|
326
327
|
]
|
|
327
328
|
})
|
|
328
|
-
]), gt = ({ currentMonth:
|
|
329
|
+
]), gt = ({ currentMonth: n, currentYear: t, onSelect: e }) => {
|
|
329
330
|
const a = t - 50, s = Array.from({ length: 101 }, (r, l) => a + l);
|
|
330
331
|
return h(
|
|
331
332
|
{ class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
|
|
@@ -333,7 +334,7 @@ const q = j(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[
|
|
|
333
334
|
(r) => m(
|
|
334
335
|
{
|
|
335
336
|
click: (l) => {
|
|
336
|
-
l.preventDefault(), l.stopPropagation(),
|
|
337
|
+
l.preventDefault(), l.stopPropagation(), e(r);
|
|
337
338
|
},
|
|
338
339
|
variant: r === t ? "primary" : "ghost",
|
|
339
340
|
"aria-label": `Select ${r}`
|
|
@@ -359,8 +360,8 @@ class Nt extends Y {
|
|
|
359
360
|
* @returns {Date}
|
|
360
361
|
*/
|
|
361
362
|
getSelectedDate(t) {
|
|
362
|
-
const
|
|
363
|
-
return new Date(
|
|
363
|
+
const e = this.selectedDate ? new Date(nt(this.selectedDate)) : t;
|
|
364
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
364
365
|
}
|
|
365
366
|
/**
|
|
366
367
|
* This will set up the data for the calendar.
|
|
@@ -368,13 +369,13 @@ class Nt extends Y {
|
|
|
368
369
|
* @returns {Data}
|
|
369
370
|
*/
|
|
370
371
|
setData() {
|
|
371
|
-
const t = /* @__PURE__ */ new Date(),
|
|
372
|
+
const t = /* @__PURE__ */ new Date(), e = this.getSelectedDate(t), a = e.getMonth();
|
|
372
373
|
return new B({
|
|
373
374
|
monthName: this.getMonthName(a),
|
|
374
|
-
currentDate: `${
|
|
375
|
+
currentDate: `${e.getFullYear()}-${a + 1}-${e.getDate()}`,
|
|
375
376
|
current: {
|
|
376
|
-
date:
|
|
377
|
-
year:
|
|
377
|
+
date: e.getDate(),
|
|
378
|
+
year: e.getFullYear(),
|
|
378
379
|
month: a
|
|
379
380
|
},
|
|
380
381
|
today: {
|
|
@@ -411,8 +412,8 @@ class Nt extends Y {
|
|
|
411
412
|
*/
|
|
412
413
|
goToPreviousMonth() {
|
|
413
414
|
const t = this.data;
|
|
414
|
-
let
|
|
415
|
-
|
|
415
|
+
let e = t.current.month, a = t.current.year;
|
|
416
|
+
e === 0 ? (e = 11, a--) : e--, this.setCurrentDate(e, a);
|
|
416
417
|
}
|
|
417
418
|
/**
|
|
418
419
|
* This will go to the next month.
|
|
@@ -421,8 +422,8 @@ class Nt extends Y {
|
|
|
421
422
|
*/
|
|
422
423
|
goToNextMonth() {
|
|
423
424
|
const t = this.data;
|
|
424
|
-
let
|
|
425
|
-
|
|
425
|
+
let e = t.current.month, a = t.current.year;
|
|
426
|
+
e === 11 ? (e = 0, a++) : e++, this.setCurrentDate(e, a);
|
|
426
427
|
}
|
|
427
428
|
/**
|
|
428
429
|
* This will set the current month and year.
|
|
@@ -432,9 +433,9 @@ class Nt extends Y {
|
|
|
432
433
|
* @param {number} [date=null]
|
|
433
434
|
* @returns {void}
|
|
434
435
|
*/
|
|
435
|
-
setCurrentDate(t,
|
|
436
|
+
setCurrentDate(t, e, a = null) {
|
|
436
437
|
const s = this.data;
|
|
437
|
-
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);
|
|
438
439
|
}
|
|
439
440
|
/**
|
|
440
441
|
* This will select a date.
|
|
@@ -443,8 +444,8 @@ class Nt extends Y {
|
|
|
443
444
|
* @returns {void}
|
|
444
445
|
*/
|
|
445
446
|
selectDate(t) {
|
|
446
|
-
const
|
|
447
|
-
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);
|
|
448
449
|
}
|
|
449
450
|
/**
|
|
450
451
|
* This will render the calendar.
|
|
@@ -460,8 +461,8 @@ class Nt extends Y {
|
|
|
460
461
|
{
|
|
461
462
|
currentMonth: this.data.current.month,
|
|
462
463
|
currentYear: this.data.current.year,
|
|
463
|
-
onSelect: (
|
|
464
|
-
this.setCurrentDate(
|
|
464
|
+
onSelect: (e) => {
|
|
465
|
+
this.setCurrentDate(e, this.data.current.year), this.state.view = "calendar";
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
468
|
);
|
|
@@ -470,8 +471,8 @@ class Nt extends Y {
|
|
|
470
471
|
{
|
|
471
472
|
currentMonth: this.data.current.month,
|
|
472
473
|
currentYear: this.data.current.year,
|
|
473
|
-
onSelect: (
|
|
474
|
-
this.setCurrentDate(this.data.current.month,
|
|
474
|
+
onSelect: (e) => {
|
|
475
|
+
this.setCurrentDate(this.data.current.month, e), this.state.view = "calendar";
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
478
|
);
|
|
@@ -479,15 +480,15 @@ class Nt extends Y {
|
|
|
479
480
|
return dt({
|
|
480
481
|
current: this.data.current,
|
|
481
482
|
today: this.data.today,
|
|
482
|
-
select: (
|
|
483
|
+
select: (e) => this.selectDate(e),
|
|
483
484
|
next: () => this.goToNextMonth(),
|
|
484
485
|
previous: () => this.goToPreviousMonth(),
|
|
485
486
|
blockPriorDates: this.blockPriorDates || !1,
|
|
486
|
-
onMonthClick: (
|
|
487
|
-
|
|
487
|
+
onMonthClick: (e) => {
|
|
488
|
+
e.preventDefault(), e.stopPropagation(), this.state.view = "months";
|
|
488
489
|
},
|
|
489
|
-
onYearClick: (
|
|
490
|
-
|
|
490
|
+
onYearClick: (e) => {
|
|
491
|
+
e.preventDefault(), e.stopPropagation(), this.state.view = "years";
|
|
491
492
|
}
|
|
492
493
|
});
|
|
493
494
|
}
|
|
@@ -495,44 +496,44 @@ class Nt extends Y {
|
|
|
495
496
|
]);
|
|
496
497
|
}
|
|
497
498
|
}
|
|
498
|
-
const W = ({ label:
|
|
499
|
+
const W = ({ label: n, click: t }) => m(
|
|
499
500
|
{
|
|
500
501
|
class: `
|
|
501
502
|
inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
|
|
502
503
|
opacity-50 hover:opacity-100 text-muted-foreground absolute
|
|
503
|
-
${
|
|
504
|
+
${n === "Previous" ? "left-1" : "right-1"}
|
|
504
505
|
focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
505
506
|
`,
|
|
506
507
|
click: t,
|
|
507
|
-
"aria-label": `${
|
|
508
|
+
"aria-label": `${n} month`,
|
|
508
509
|
variant: "icon",
|
|
509
|
-
icon:
|
|
510
|
+
icon: n === "Previous" ? P.chevron.single.left : P.chevron.single.right
|
|
510
511
|
}
|
|
511
|
-
), ft = ({ onMonthClick:
|
|
512
|
-
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]]"),
|
|
513
514
|
m({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
|
|
514
515
|
W({ label: "Previous", click: a }),
|
|
515
|
-
W({ label: "Next", click:
|
|
516
|
-
]), mt = (
|
|
516
|
+
W({ label: "Next", click: e })
|
|
517
|
+
]), mt = (n) => h({ class: "h-9 flex items-center justify-center font-medium" }, n), pt = () => h(
|
|
517
518
|
{ class: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-muted-foreground mb-2" },
|
|
518
519
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(mt)
|
|
519
|
-
), yt = ({ day:
|
|
520
|
+
), yt = ({ day: n, iso: t, disabled: e, isStart: a, isEnd: s, isBetween: r, isOtherMonth: l, click: i }) => {
|
|
520
521
|
let d = "ghost", g = "";
|
|
521
|
-
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(
|
|
522
523
|
{
|
|
523
524
|
class: `flex items-center justify-center p-0 text-sm font-medium rounded-md transition-colors ${g}`,
|
|
524
525
|
variant: d,
|
|
525
|
-
disabled:
|
|
526
|
+
disabled: e,
|
|
526
527
|
click: (f) => {
|
|
527
|
-
f.preventDefault(), f.stopPropagation(),
|
|
528
|
+
f.preventDefault(), f.stopPropagation(), e || i();
|
|
528
529
|
}
|
|
529
530
|
},
|
|
530
|
-
|
|
531
|
+
n.toString()
|
|
531
532
|
);
|
|
532
|
-
}, Dt = ({ today:
|
|
533
|
+
}, Dt = ({ today: n, current: t, blockPriorDates: e, onDateClick: a }) => {
|
|
533
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;
|
|
534
535
|
for (let c = l - 1; c >= 0; c--) {
|
|
535
|
-
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;
|
|
536
537
|
d.push({
|
|
537
538
|
day: o,
|
|
538
539
|
iso: u,
|
|
@@ -545,7 +546,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
545
546
|
});
|
|
546
547
|
}
|
|
547
548
|
for (let c = 1; c <= i; c++) {
|
|
548
|
-
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;
|
|
549
550
|
d.push({
|
|
550
551
|
day: c,
|
|
551
552
|
iso: o,
|
|
@@ -561,7 +562,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
561
562
|
}
|
|
562
563
|
const F = (7 - d.length % 7) % 7;
|
|
563
564
|
for (let c = 1; c <= F; c++) {
|
|
564
|
-
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;
|
|
565
566
|
d.push({
|
|
566
567
|
day: c,
|
|
567
568
|
iso: o,
|
|
@@ -588,12 +589,12 @@ const W = ({ label: e, click: t }) => m(
|
|
|
588
589
|
})
|
|
589
590
|
)
|
|
590
591
|
);
|
|
591
|
-
}, xt = j((
|
|
592
|
+
}, xt = j((n, t) => h({ class: "flex flex-auto flex-col" }, [
|
|
592
593
|
ft({
|
|
593
|
-
onMonthClick:
|
|
594
|
-
onYearClick:
|
|
595
|
-
next:
|
|
596
|
-
previous:
|
|
594
|
+
onMonthClick: n.onMonthClick,
|
|
595
|
+
onYearClick: n.onYearClick,
|
|
596
|
+
next: n.next,
|
|
597
|
+
previous: n.previous
|
|
597
598
|
}),
|
|
598
599
|
h({
|
|
599
600
|
class: "flex flex-auto flex-col w-full",
|
|
@@ -602,29 +603,29 @@ const W = ({ label: e, click: t }) => m(
|
|
|
602
603
|
() => [
|
|
603
604
|
pt(),
|
|
604
605
|
Dt({
|
|
605
|
-
today:
|
|
606
|
-
current:
|
|
607
|
-
blockPriorDates:
|
|
608
|
-
onDateClick:
|
|
606
|
+
today: n.today,
|
|
607
|
+
current: n.current,
|
|
608
|
+
blockPriorDates: n.blockPriorDates,
|
|
609
|
+
onDateClick: n.onDateClick
|
|
609
610
|
})
|
|
610
611
|
]
|
|
611
612
|
]
|
|
612
613
|
})
|
|
613
|
-
])), wt = ({ currentMonth:
|
|
614
|
+
])), wt = ({ currentMonth: n, currentYear: t, onSelect: e }) => h(
|
|
614
615
|
{ class: "grid grid-cols-3 gap-2" },
|
|
615
616
|
T.monthNames.map(
|
|
616
617
|
(a, s) => m(
|
|
617
618
|
{
|
|
618
619
|
click: (r) => {
|
|
619
|
-
r.preventDefault(), r.stopPropagation(),
|
|
620
|
+
r.preventDefault(), r.stopPropagation(), e(s);
|
|
620
621
|
},
|
|
621
|
-
variant:
|
|
622
|
+
variant: n === s ? "primary" : "ghost",
|
|
622
623
|
"aria-label": `Select ${a} ${t}`
|
|
623
624
|
},
|
|
624
625
|
a.substring(0, 3)
|
|
625
626
|
)
|
|
626
627
|
)
|
|
627
|
-
), vt = ({ start:
|
|
628
|
+
), vt = ({ start: n, end: t, selecting: e, onSelectStart: a, onSelectEnd: s }) => h({ class: "flex gap-x-2 mb-4" }, [
|
|
628
629
|
z("selecting", (r) => m({
|
|
629
630
|
click: a,
|
|
630
631
|
variant: r === "start" ? "primary" : "outline",
|
|
@@ -639,11 +640,11 @@ const W = ({ label: e, click: t }) => m(
|
|
|
639
640
|
}, [
|
|
640
641
|
h({ class: "font-medium" }, E("current.end", "End Date"))
|
|
641
642
|
]))
|
|
642
|
-
]), E = (
|
|
643
|
-
const t = /* @__PURE__ */ new Date(
|
|
644
|
-
return `${
|
|
645
|
-
}, Ct = ({ currentYear:
|
|
646
|
-
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);
|
|
647
648
|
return h(
|
|
648
649
|
{ class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
|
|
649
650
|
a.map(
|
|
@@ -652,7 +653,7 @@ const W = ({ label: e, click: t }) => m(
|
|
|
652
653
|
click: (r) => {
|
|
653
654
|
r.preventDefault(), r.stopPropagation(), t(s);
|
|
654
655
|
},
|
|
655
|
-
variant: s ===
|
|
656
|
+
variant: s === n ? "primary" : "ghost",
|
|
656
657
|
"aria-label": `Select ${s}`
|
|
657
658
|
},
|
|
658
659
|
s.toString()
|
|
@@ -675,7 +676,7 @@ class Ot extends Y {
|
|
|
675
676
|
* @returns {Data}
|
|
676
677
|
*/
|
|
677
678
|
setData() {
|
|
678
|
-
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();
|
|
679
680
|
return new B({
|
|
680
681
|
today: {
|
|
681
682
|
date: t.getDate(),
|
|
@@ -683,7 +684,7 @@ class Ot extends Y {
|
|
|
683
684
|
year: t.getFullYear()
|
|
684
685
|
},
|
|
685
686
|
monthName: this.getMonthName(a),
|
|
686
|
-
currentData: `${
|
|
687
|
+
currentData: `${e.getFullYear()}-${D(e.getMonth() + 1)}-${D(e.getDate())}`,
|
|
687
688
|
current: {
|
|
688
689
|
date: t.getDate(),
|
|
689
690
|
month: a,
|
|
@@ -723,19 +724,19 @@ class Ot extends Y {
|
|
|
723
724
|
handleClick(t) {
|
|
724
725
|
if (this.data.selecting === "start") {
|
|
725
726
|
this.data.current.start = t, this.data.current.end = null, this.data.selecting = "end";
|
|
726
|
-
const
|
|
727
|
+
const e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
727
728
|
this.setCurrent({
|
|
728
|
-
month:
|
|
729
|
-
year:
|
|
730
|
-
date:
|
|
729
|
+
month: e.getMonth(),
|
|
730
|
+
year: e.getFullYear(),
|
|
731
|
+
date: e.getDate()
|
|
731
732
|
});
|
|
732
733
|
} else {
|
|
733
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";
|
|
734
|
-
const
|
|
735
|
+
const e = /* @__PURE__ */ new Date(t + "T00:00:00");
|
|
735
736
|
this.setCurrent({
|
|
736
|
-
month:
|
|
737
|
-
year:
|
|
738
|
-
date:
|
|
737
|
+
month: e.getMonth(),
|
|
738
|
+
year: e.getFullYear(),
|
|
739
|
+
date: e.getDate()
|
|
739
740
|
}), typeof this.onRangeSelect == "function" && this.onRangeSelect(this.data.current.start, this.data.current.end);
|
|
740
741
|
}
|
|
741
742
|
}
|
|
@@ -745,9 +746,9 @@ class Ot extends Y {
|
|
|
745
746
|
* @param {object} obj
|
|
746
747
|
* @returns {void}
|
|
747
748
|
*/
|
|
748
|
-
setCurrent({ month: t, year:
|
|
749
|
+
setCurrent({ month: t, year: e, date: a = null }) {
|
|
749
750
|
const s = this.data.current;
|
|
750
|
-
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)}`;
|
|
751
752
|
}
|
|
752
753
|
/**
|
|
753
754
|
* Render the range calendar.
|
|
@@ -755,7 +756,7 @@ class Ot extends Y {
|
|
|
755
756
|
* @returns {object}
|
|
756
757
|
*/
|
|
757
758
|
render() {
|
|
758
|
-
const { today: t, current:
|
|
759
|
+
const { today: t, current: e, selecting: a } = this.data, { start: s, end: r } = e;
|
|
759
760
|
return h({ class: "range-calendar border border-border rounded-lg shadow-md p-4 w-full max-w-sm min-w-80" }, [
|
|
760
761
|
vt({
|
|
761
762
|
start: s,
|
|
@@ -773,28 +774,28 @@ class Ot extends Y {
|
|
|
773
774
|
case "months":
|
|
774
775
|
return wt(
|
|
775
776
|
{
|
|
776
|
-
currentMonth:
|
|
777
|
-
currentYear:
|
|
777
|
+
currentMonth: e.month,
|
|
778
|
+
currentYear: e.year,
|
|
778
779
|
onSelect: (i) => {
|
|
779
|
-
this.setCurrent({ month: i, year:
|
|
780
|
+
this.setCurrent({ month: i, year: e.year }), this.state.view = "calendar";
|
|
780
781
|
}
|
|
781
782
|
}
|
|
782
783
|
);
|
|
783
784
|
case "years":
|
|
784
785
|
return Ct(
|
|
785
786
|
{
|
|
786
|
-
currentYear:
|
|
787
|
+
currentYear: e.year,
|
|
787
788
|
onSelect: (i) => {
|
|
788
|
-
this.setCurrent({ month:
|
|
789
|
+
this.setCurrent({ month: e.month, year: i }), this.state.view = "calendar";
|
|
789
790
|
}
|
|
790
791
|
}
|
|
791
792
|
);
|
|
792
793
|
default:
|
|
793
794
|
return xt({
|
|
794
795
|
monthName: this.data.monthName,
|
|
795
|
-
year:
|
|
796
|
+
year: e.year,
|
|
796
797
|
today: t,
|
|
797
|
-
current:
|
|
798
|
+
current: e,
|
|
798
799
|
blockPriorDates: this.blockPriorDates,
|
|
799
800
|
onDateClick: (i) => this.handleClick(i),
|
|
800
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",
|
package/package.json
CHANGED