@base-framework/ui 1.0.222 → 1.0.224
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 +1 -1
- package/dist/organisms.es.js +1 -1
- package/dist/{signature-panel-B_oAT8dn.js → signature-panel-H6LXfuxW.js} +117 -104
- package/dist/types/components/organisms/calendar/range/month-calendar.d.ts +4 -1
- package/dist/types/components/organisms/calendar/range/range-calendar.d.ts +1 -4
- package/dist/types/components/organisms/calendar/range/range-days-grid.d.ts +5 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { V as w, a as R } from "./veil-D4dRxILB.js";
|
|
|
5
5
|
import { Icons as E } from "./icons.es.js";
|
|
6
6
|
import { A as O, B as V, C as j, t as q, E as z, v as J, w as _, x as K, D as Q, j as X, k as Y, H as Z, G as $, s as aa, c as ea, a as sa, b as oa, I as ta, i as ra, g as na, e as la, h as ia, F as pa, d as ua, f as ma, u as da, M as ca, l as ga, N as Ca, P as Ta, p as ba, q as Da, S as Ia, n as Sa, o as Ba, T as Pa, y as Fa, z as Ma, m as ka, r as Na } from "./empty-state-2O1fITpG.js";
|
|
7
7
|
import { A as va, b as xa, C as ya, D as ha, a as Wa, F as Ha, M as La, P as Aa, c as wa, g as Ra, p as Ua } from "./calendar-Bn55oWBo.js";
|
|
8
|
-
import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, R as Za, S as $a, n as ae, o as ee, t as se, s as oe, q as te, r as re, T as ne, l as le, U as ie, W as pe, f as ue, h as me, i as de, c as ce, d as ge, b as Ce, e as Te, a as be, g as De } from "./signature-panel-
|
|
8
|
+
import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, R as Za, S as $a, n as ae, o as ee, t as se, s as oe, q as te, r as re, T as ne, l as le, U as ie, W as pe, f as ue, h as me, i as de, c as ce, d as ge, b as Ce, e as Te, a as be, g as De } from "./signature-panel-H6LXfuxW.js";
|
|
9
9
|
import { B as Se, I as Be, M as Pe, d as Fe, e as Me, g as ke, N as Ne, b as fe, a as ve, f as xe, P as ye, c as he, S as We, T as He } from "./mobile-nav-wrapper-Dj67Pb8l.js";
|
|
10
10
|
import { B as Ae, a as we, C as Re, F as Ue, b as Ee, c as Ge, M as Oe, P as Ve, S as je } from "./sidebar-menu-page-BVryQj2Z.js";
|
|
11
11
|
import { A as ze, F as Je, M as _e, a as Ke, T as Qe } from "./aside-template-McEj_Gxc.js";
|
package/dist/organisms.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, R as v, S as D, n as N, o as k, t as C, s as c, q as T, r as M, T as m, l as y, U as B, W, f as h, h as S, i as H, c as P, d as I, b as f, e as x, a as L, g as O } from "./signature-panel-
|
|
1
|
+
import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, R as v, S as D, n as N, o as k, t as C, s as c, q as T, r as M, T as m, l as y, U as B, W, f as h, h as S, i as H, c as P, d as I, b as f, e as x, a as L, g as O } from "./signature-panel-H6LXfuxW.js";
|
|
2
2
|
import { b as U, C as G, D as R, a as j, F as q, M as w, c as z, p as A } from "./calendar-Bn55oWBo.js";
|
|
3
3
|
import { B as J, I as K, M as Q, d as V, e as X, g as Y, N as Z, b as _, a as $, f as aa, P as ea, c as sa, S as ta, T as oa } from "./mobile-nav-wrapper-Dj67Pb8l.js";
|
|
4
4
|
export {
|
|
@@ -66,9 +66,9 @@ const ft = (e) => {
|
|
|
66
66
|
}, be = (e, t) => {
|
|
67
67
|
const s = new Date(e, t, 1).getDay(), a = new Date(e, t + 1, 0).getDate(), n = [];
|
|
68
68
|
let i = [];
|
|
69
|
-
for (let
|
|
70
|
-
const
|
|
71
|
-
i.push(
|
|
69
|
+
for (let r = 1 - s; r <= a; r++) {
|
|
70
|
+
const l = new Date(e, t, r);
|
|
71
|
+
i.push(r > 0 ? l : null), (i.length === 7 || r === a) && (n.push([...i]), i = []);
|
|
72
72
|
}
|
|
73
73
|
return n;
|
|
74
74
|
}, we = (e, t) => {
|
|
@@ -93,18 +93,18 @@ const ft = (e) => {
|
|
|
93
93
|
click: () => n(a, s)
|
|
94
94
|
});
|
|
95
95
|
}, wt = (e, t) => {
|
|
96
|
-
const s = new Date(e, t, 1).getDay(), a = new Date(e, t + 1, 0).getDate(), n = gt(e, t, s), i = Array.from({ length: a }, (
|
|
97
|
-
for (let
|
|
98
|
-
const p =
|
|
99
|
-
|
|
96
|
+
const s = new Date(e, t, 1).getDay(), a = new Date(e, t + 1, 0).getDate(), n = gt(e, t, s), i = Array.from({ length: a }, (h, p) => new Date(e, t, p + 1)), r = (n.length + i.length) % 7, l = r === 0 ? 0 : 7 - r, c = pt(e, t, l), d = [...n, ...i, ...c], u = [];
|
|
97
|
+
for (let h = 0; h < d.length; h += 7) {
|
|
98
|
+
const p = d.slice(h, h + 7), y = p.find((B) => B) || new Date(e, t, 1), { weekNumber: L, year: T } = mt(y);
|
|
99
|
+
u.push({
|
|
100
100
|
weekNumber: L,
|
|
101
101
|
year: T,
|
|
102
102
|
days: p
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
return
|
|
105
|
+
return u;
|
|
106
106
|
}, xt = ({ selectWeek: e }) => D("month", (t, s, { data: a }) => {
|
|
107
|
-
const { year: n, month: i, currentDate:
|
|
107
|
+
const { year: n, month: i, currentDate: r } = a, l = wt(n, i);
|
|
108
108
|
return o(
|
|
109
109
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
110
110
|
[
|
|
@@ -119,8 +119,8 @@ const ft = (e) => {
|
|
|
119
119
|
)
|
|
120
120
|
),
|
|
121
121
|
// Render each "week" row
|
|
122
|
-
...
|
|
123
|
-
({ weekNumber: c, days:
|
|
122
|
+
...l.map(
|
|
123
|
+
({ weekNumber: c, days: d, year: u }) => o({
|
|
124
124
|
class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
|
|
125
125
|
onSet: ["currentWeek", {
|
|
126
126
|
ring: c
|
|
@@ -129,7 +129,7 @@ const ft = (e) => {
|
|
|
129
129
|
// Left column: ISO week number
|
|
130
130
|
o({
|
|
131
131
|
class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
|
|
132
|
-
click: () => e(c,
|
|
132
|
+
click: () => e(c, u),
|
|
133
133
|
// If you have a 'currentWeek' state, you can highlight it with 'onSet'
|
|
134
134
|
onSet: ["currentWeek", {
|
|
135
135
|
"text-primary-foreground": c,
|
|
@@ -140,11 +140,11 @@ const ft = (e) => {
|
|
|
140
140
|
// The 7 cells for each day in the row
|
|
141
141
|
o(
|
|
142
142
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
143
|
-
|
|
144
|
-
(
|
|
145
|
-
year: (
|
|
146
|
-
month: (
|
|
147
|
-
day: (
|
|
143
|
+
d.map(
|
|
144
|
+
(h) => bt({
|
|
145
|
+
year: (h == null ? void 0 : h.getFullYear()) || null,
|
|
146
|
+
month: (h == null ? void 0 : h.getMonth()) || null,
|
|
147
|
+
day: (h == null ? void 0 : h.getDate()) || null,
|
|
148
148
|
weekNumber: c,
|
|
149
149
|
selectWeek: e
|
|
150
150
|
})
|
|
@@ -317,33 +317,50 @@ const j = ({ label: e, click: t }) => g(
|
|
|
317
317
|
]), Dt = (e) => o({ class: "h-9 flex items-center justify-center font-medium" }, e), St = () => o(
|
|
318
318
|
{ class: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-muted-foreground mb-2" },
|
|
319
319
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(Dt)
|
|
320
|
-
), Ct = ({ day: e, iso: t, disabled: s, isStart: a, isEnd: n, isBetween: i, click:
|
|
321
|
-
let
|
|
322
|
-
return a || n ? (
|
|
320
|
+
), Ct = ({ day: e, iso: t, disabled: s, isStart: a, isEnd: n, isBetween: i, click: r }) => {
|
|
321
|
+
let l = "ghost", c = "";
|
|
322
|
+
return a || n ? (l = "default", c = "bg-primary text-primary-foreground hover:bg-primary/90") : i && (c = "bg-accent text-accent-foreground hover:bg-accent/80"), s && (c += " opacity-50 cursor-not-allowed"), g(
|
|
323
323
|
{
|
|
324
324
|
class: `flex items-center justify-center h-9 w-9 p-0 text-sm font-medium rounded-md transition-colors ${c}`,
|
|
325
|
-
variant:
|
|
325
|
+
variant: l,
|
|
326
326
|
disabled: s,
|
|
327
327
|
click: () => {
|
|
328
|
-
|
|
328
|
+
s || r();
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
e.toString()
|
|
332
332
|
);
|
|
333
|
-
}, It = ({
|
|
334
|
-
{
|
|
335
|
-
|
|
336
|
-
(
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
333
|
+
}, It = ({ today: e, current: t, blockPriorDates: s, onDateClick: a }) => {
|
|
334
|
+
const { start: n, end: i } = t, r = new Date(t.year, t.month, 1).getDay(), l = new Date(t.year, t.month + 1, 0).getDate(), c = [];
|
|
335
|
+
for (let d = 0; d < r; d++)
|
|
336
|
+
c.push(null);
|
|
337
|
+
for (let d = 1; d <= l; d++) {
|
|
338
|
+
const u = st(t.year, t.month, d), h = new Date(t.year, t.month, d), p = new Date(e.year, e.month, e.date), y = h < p, L = s && y, T = n === u, B = i === u, X = n && i && u > n && u < i;
|
|
339
|
+
c.push({
|
|
340
|
+
day: d,
|
|
341
|
+
iso: u,
|
|
342
|
+
disabled: L,
|
|
343
|
+
isStart: T,
|
|
344
|
+
isEnd: B,
|
|
345
|
+
isBetween: X,
|
|
346
|
+
click: () => a(u)
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
return o(
|
|
350
|
+
{ class: "grid grid-cols-7 gap-1" },
|
|
351
|
+
c.map(
|
|
352
|
+
(d, u) => d ? Ct({
|
|
353
|
+
day: d.day,
|
|
354
|
+
iso: d.iso,
|
|
355
|
+
disabled: d.disabled,
|
|
356
|
+
isStart: d.isStart,
|
|
357
|
+
isEnd: d.isEnd,
|
|
358
|
+
isBetween: d.isBetween,
|
|
359
|
+
click: d.click
|
|
360
|
+
}) : o({ class: "h-9" })
|
|
361
|
+
)
|
|
362
|
+
);
|
|
363
|
+
}, Mt = f((e, t) => o({ class: "flex flex-auto flex-col" }, [
|
|
347
364
|
vt({
|
|
348
365
|
monthName: e.monthName,
|
|
349
366
|
year: e.year,
|
|
@@ -352,10 +369,21 @@ const j = ({ label: e, click: t }) => g(
|
|
|
352
369
|
next: e.next,
|
|
353
370
|
previous: e.previous
|
|
354
371
|
}),
|
|
355
|
-
o({
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
372
|
+
o({
|
|
373
|
+
class: "flex flex-auto flex-col w-full",
|
|
374
|
+
onSet: [
|
|
375
|
+
"currentDate",
|
|
376
|
+
() => [
|
|
377
|
+
St(),
|
|
378
|
+
It({
|
|
379
|
+
today: e.today,
|
|
380
|
+
current: e.current,
|
|
381
|
+
blockPriorDates: e.blockPriorDates,
|
|
382
|
+
onDateClick: e.onDateClick
|
|
383
|
+
})
|
|
384
|
+
]
|
|
385
|
+
]
|
|
386
|
+
})
|
|
359
387
|
])), Lt = ({ currentMonth: e, currentYear: t, onSelect: s }) => o(
|
|
360
388
|
{ class: "grid grid-cols-3 gap-2" },
|
|
361
389
|
P.monthNames.map(
|
|
@@ -372,9 +400,7 @@ const j = ({ label: e, click: t }) => g(
|
|
|
372
400
|
)
|
|
373
401
|
), Tt = ({ start: e, end: t, selecting: s, onSelectStart: a, onSelectEnd: n }) => o({ class: "flex space-x-2 mb-4" }, [
|
|
374
402
|
g({
|
|
375
|
-
click:
|
|
376
|
-
console.log("Start button clicked"), a();
|
|
377
|
-
},
|
|
403
|
+
click: a,
|
|
378
404
|
variant: s === "start" ? "default" : "outline",
|
|
379
405
|
class: "flex-1 text-left justify-start px-3 py-2 text-sm font-medium rounded-md border min-h-[2.5rem] flex flex-col items-start"
|
|
380
406
|
}, [
|
|
@@ -382,9 +408,7 @@ const j = ({ label: e, click: t }) => g(
|
|
|
382
408
|
o({ class: "font-medium" }, e ? Y(e) : "Select start")
|
|
383
409
|
]),
|
|
384
410
|
g({
|
|
385
|
-
click:
|
|
386
|
-
console.log("End button clicked"), n();
|
|
387
|
-
},
|
|
411
|
+
click: n,
|
|
388
412
|
variant: s === "end" ? "default" : "outline",
|
|
389
413
|
class: "flex-1 text-left justify-start px-3 py-2 text-sm font-medium rounded-md border min-h-[2.5rem] flex flex-col items-start"
|
|
390
414
|
}, [
|
|
@@ -438,8 +462,11 @@ class ke extends m {
|
|
|
438
462
|
current: {
|
|
439
463
|
date: t.getDate(),
|
|
440
464
|
month: a,
|
|
441
|
-
year: n
|
|
442
|
-
|
|
465
|
+
year: n,
|
|
466
|
+
start: this.startDate,
|
|
467
|
+
end: this.endDate
|
|
468
|
+
},
|
|
469
|
+
selecting: "start"
|
|
443
470
|
});
|
|
444
471
|
}
|
|
445
472
|
/**
|
|
@@ -454,15 +481,12 @@ class ke extends m {
|
|
|
454
481
|
/**
|
|
455
482
|
* Initialize component state.
|
|
456
483
|
*
|
|
457
|
-
* @returns {{view:string
|
|
484
|
+
* @returns {{view:string}}
|
|
458
485
|
*/
|
|
459
486
|
setupStates() {
|
|
460
487
|
return {
|
|
461
|
-
view: "calendar"
|
|
488
|
+
view: "calendar"
|
|
462
489
|
// 'calendar', 'months', or 'years'
|
|
463
|
-
selecting: "start",
|
|
464
|
-
start: this.startDate,
|
|
465
|
-
end: this.endDate
|
|
466
490
|
};
|
|
467
491
|
}
|
|
468
492
|
/**
|
|
@@ -472,7 +496,7 @@ class ke extends m {
|
|
|
472
496
|
* @returns {void}
|
|
473
497
|
*/
|
|
474
498
|
handleClick(t) {
|
|
475
|
-
|
|
499
|
+
this.data.selecting === "start" ? (this.data.current.start = t, this.data.current.end = null, this.data.selecting = "end") : (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", typeof this.onRangeSelect == "function" && this.onRangeSelect(this.data.current.start, this.data.current.end));
|
|
476
500
|
}
|
|
477
501
|
/**
|
|
478
502
|
* Update current month/year in data.
|
|
@@ -490,38 +514,24 @@ class ke extends m {
|
|
|
490
514
|
* @returns {object}
|
|
491
515
|
*/
|
|
492
516
|
render() {
|
|
493
|
-
const { today: t, current: s } = this.data, { start:
|
|
494
|
-
for (let h = 0; h < l; h++)
|
|
495
|
-
c.push(null);
|
|
496
|
-
for (let h = 1; h <= u; h++) {
|
|
497
|
-
const r = st(s.year, s.month, h), d = new Date(s.year, s.month, h), p = new Date(t.year, t.month, t.date), y = d < p, L = this.blockPriorDates && y, T = a === r, B = n === r, X = a && n && r > a && r < n;
|
|
498
|
-
c.push({
|
|
499
|
-
day: h,
|
|
500
|
-
iso: r,
|
|
501
|
-
disabled: L,
|
|
502
|
-
isStart: T,
|
|
503
|
-
isEnd: B,
|
|
504
|
-
isBetween: X,
|
|
505
|
-
click: this.handleClick.bind(this, r)
|
|
506
|
-
});
|
|
507
|
-
}
|
|
517
|
+
const { today: t, current: s, selecting: a } = this.data, { start: n, end: i } = s;
|
|
508
518
|
return o({ class: "range-calendar bg-background border border-border rounded-lg shadow-md p-4 w-full max-w-sm" }, [
|
|
509
519
|
Tt({
|
|
510
|
-
start:
|
|
511
|
-
end:
|
|
512
|
-
selecting:
|
|
513
|
-
onSelectStart: () => this.
|
|
514
|
-
onSelectEnd: () => this.
|
|
520
|
+
start: n,
|
|
521
|
+
end: i,
|
|
522
|
+
selecting: a,
|
|
523
|
+
onSelectStart: () => this.data.selecting = "start",
|
|
524
|
+
onSelectEnd: () => this.data.selecting = "end"
|
|
515
525
|
}),
|
|
516
|
-
q("view", (
|
|
517
|
-
switch (
|
|
526
|
+
q("view", (r) => {
|
|
527
|
+
switch (r) {
|
|
518
528
|
case "months":
|
|
519
529
|
return Lt(
|
|
520
530
|
{
|
|
521
531
|
currentMonth: s.month,
|
|
522
532
|
currentYear: s.year,
|
|
523
|
-
onSelect: (
|
|
524
|
-
this.setCurrent({ month:
|
|
533
|
+
onSelect: (l) => {
|
|
534
|
+
this.setCurrent({ month: l, year: s.year }), this.state.view = "calendar";
|
|
525
535
|
}
|
|
526
536
|
}
|
|
527
537
|
);
|
|
@@ -529,8 +539,8 @@ class ke extends m {
|
|
|
529
539
|
return Bt(
|
|
530
540
|
{
|
|
531
541
|
currentYear: s.year,
|
|
532
|
-
onSelect: (
|
|
533
|
-
this.setCurrent({ month: s.month, year:
|
|
542
|
+
onSelect: (l) => {
|
|
543
|
+
this.setCurrent({ month: s.month, year: l }), this.state.view = "calendar";
|
|
534
544
|
}
|
|
535
545
|
}
|
|
536
546
|
);
|
|
@@ -538,17 +548,20 @@ class ke extends m {
|
|
|
538
548
|
return Mt({
|
|
539
549
|
monthName: this.data.monthName,
|
|
540
550
|
year: s.year,
|
|
551
|
+
today: t,
|
|
552
|
+
current: s,
|
|
553
|
+
blockPriorDates: this.blockPriorDates,
|
|
554
|
+
onDateClick: (l) => this.handleClick(l),
|
|
541
555
|
onMonthClick: () => this.state.view = "months",
|
|
542
556
|
onYearClick: () => this.state.view = "years",
|
|
543
557
|
next: () => {
|
|
544
|
-
const
|
|
545
|
-
this.setCurrent(
|
|
558
|
+
const l = this.data.current, c = l.month === 11 ? { month: 0, year: l.year + 1 } : { month: l.month + 1, year: l.year };
|
|
559
|
+
this.setCurrent(c);
|
|
546
560
|
},
|
|
547
561
|
previous: () => {
|
|
548
|
-
const
|
|
549
|
-
this.setCurrent(
|
|
550
|
-
}
|
|
551
|
-
cells: c
|
|
562
|
+
const l = this.data.current, c = l.month === 0 ? { month: 11, year: l.year - 1 } : { month: l.month - 1, year: l.year };
|
|
563
|
+
this.setCurrent(c);
|
|
564
|
+
}
|
|
552
565
|
});
|
|
553
566
|
}
|
|
554
567
|
})
|
|
@@ -561,12 +574,12 @@ const Rt = (e, t) => {
|
|
|
561
574
|
}, Pt = (e) => A({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class || ""}` }, [
|
|
562
575
|
K((t) => new dt({ class: "mr-2", onChange: (s, a) => Rt(t, a) }))
|
|
563
576
|
]), Nt = ({ align: e, sortable: t, key: s, label: a, sort: n, class: i }) => {
|
|
564
|
-
const
|
|
577
|
+
const r = e || "justify-start";
|
|
565
578
|
return A({
|
|
566
579
|
class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
|
|
567
580
|
click: t && (() => n(s))
|
|
568
581
|
}, [
|
|
569
|
-
o({ class: `flex flex-auto w-full items-center ${
|
|
582
|
+
o({ class: `flex flex-auto w-full items-center ${r}` }, [
|
|
570
583
|
S(a),
|
|
571
584
|
t && G({ class: "ml-2", html: b.arrows.upDown })
|
|
572
585
|
])
|
|
@@ -1788,11 +1801,11 @@ class ce extends m {
|
|
|
1788
1801
|
* @returns {Array} An array of [eventName, element, callback] definitions.
|
|
1789
1802
|
*/
|
|
1790
1803
|
setupEvents() {
|
|
1791
|
-
const t = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), n = this.pointerDown.bind(this), i = this.resize.bind(this),
|
|
1804
|
+
const t = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), n = this.pointerDown.bind(this), i = this.resize.bind(this), r = { passive: !1 };
|
|
1792
1805
|
return [
|
|
1793
|
-
["pointermove", t, s,
|
|
1806
|
+
["pointermove", t, s, r],
|
|
1794
1807
|
["pointerup", t, a],
|
|
1795
|
-
["pointerdown", t, n,
|
|
1808
|
+
["pointerdown", t, n, r],
|
|
1796
1809
|
["pointerout", t, a],
|
|
1797
1810
|
["resize", globalThis, i]
|
|
1798
1811
|
];
|
|
@@ -1805,14 +1818,14 @@ class ce extends m {
|
|
|
1805
1818
|
*/
|
|
1806
1819
|
getEventPosition(t) {
|
|
1807
1820
|
let s, a;
|
|
1808
|
-
const n = this.canvas, i = n.width / parseInt(n.style.width),
|
|
1821
|
+
const n = this.canvas, i = n.width / parseInt(n.style.width), r = n.getBoundingClientRect();
|
|
1809
1822
|
if (t.touches && t.touches.length) {
|
|
1810
|
-
const
|
|
1811
|
-
s =
|
|
1823
|
+
const d = t.touches[0];
|
|
1824
|
+
s = d.clientX, a = d.clientY;
|
|
1812
1825
|
} else
|
|
1813
1826
|
s = t.x || t.clientX, a = t.y || t.clientY;
|
|
1814
|
-
const
|
|
1815
|
-
this.mouse.x =
|
|
1827
|
+
const l = parseInt((s - r.left) * i), c = parseInt((a - r.top) * i);
|
|
1828
|
+
this.mouse.x = l, this.mouse.y = c;
|
|
1816
1829
|
}
|
|
1817
1830
|
/**
|
|
1818
1831
|
* Called when the pointer goes down on the canvas.
|
|
@@ -1886,13 +1899,13 @@ class ce extends m {
|
|
|
1886
1899
|
* @returns {void}
|
|
1887
1900
|
*/
|
|
1888
1901
|
scale() {
|
|
1889
|
-
const t = this.canvas, s = this.container, a = O.getSize(s), n = this.targetSize, i = n.width,
|
|
1890
|
-
let
|
|
1891
|
-
if (this.width = t.width = i, this.height = t.height =
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1902
|
+
const t = this.canvas, s = this.container, a = O.getSize(s), n = this.targetSize, i = n.width, r = n.height;
|
|
1903
|
+
let l = i + "px", c = r + "px";
|
|
1904
|
+
if (this.width = t.width = i, this.height = t.height = r, a.width !== 0 && a.height !== 0) {
|
|
1905
|
+
const d = a.width, u = a.height, h = d / i, p = u / r, y = Math.min(h, p);
|
|
1906
|
+
l = i * y + "px", c = r * y + "px";
|
|
1894
1907
|
}
|
|
1895
|
-
t.style.width =
|
|
1908
|
+
t.style.width = l, t.style.height = c;
|
|
1896
1909
|
}
|
|
1897
1910
|
/**
|
|
1898
1911
|
* Main drawing loop. If the mouse is down, adds a line
|
|
@@ -1926,8 +1939,8 @@ class ce extends m {
|
|
|
1926
1939
|
*/
|
|
1927
1940
|
addLine(t, s, a, n) {
|
|
1928
1941
|
this.signed || (this.signed = !0);
|
|
1929
|
-
const i = Math.round(s),
|
|
1930
|
-
t.lineWidth = this.lineWidth, t.strokeStyle = n, t.lineTo(i,
|
|
1942
|
+
const i = Math.round(s), r = Math.round(a);
|
|
1943
|
+
t.lineWidth = this.lineWidth, t.strokeStyle = n, t.lineTo(i, r), t.stroke();
|
|
1931
1944
|
}
|
|
1932
1945
|
/**
|
|
1933
1946
|
* Clears the canvas, sets signed to false, and re-initializes
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {string} props.monthName
|
|
6
6
|
* @param {number} props.year
|
|
7
|
+
* @param {object} props.today
|
|
8
|
+
* @param {object} props.current
|
|
9
|
+
* @param {boolean} props.blockPriorDates
|
|
10
|
+
* @param {function} props.onDateClick
|
|
7
11
|
* @param {function} props.onMonthClick
|
|
8
12
|
* @param {function} props.onYearClick
|
|
9
13
|
* @param {function} props.next
|
|
10
14
|
* @param {function} props.previous
|
|
11
|
-
* @param {Array} props.cells
|
|
12
15
|
* @returns {object}
|
|
13
16
|
*/
|
|
14
17
|
export const MonthCalendar: Function;
|
|
@@ -42,13 +42,10 @@ export class RangeCalendar extends Component {
|
|
|
42
42
|
/**
|
|
43
43
|
* Initialize component state.
|
|
44
44
|
*
|
|
45
|
-
* @returns {{view:string
|
|
45
|
+
* @returns {{view:string}}
|
|
46
46
|
*/
|
|
47
47
|
setupStates(): {
|
|
48
48
|
view: string;
|
|
49
|
-
selecting: string;
|
|
50
|
-
start: string | null;
|
|
51
|
-
end: string | null;
|
|
52
49
|
};
|
|
53
50
|
/**
|
|
54
51
|
* Handle a date cell click.
|
package/package.json
CHANGED