@knitui/dates 0.5.0 → 0.6.0
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/lib/commonjs/DatesProvider/DatesProvider.js +33 -4
- package/lib/commonjs/DatesProvider/DatesProvider.js.map +1 -1
- package/lib/commonjs/Day/Day.js +45 -7
- package/lib/commonjs/Day/Day.js.map +1 -1
- package/lib/commonjs/Month/Month.js +266 -80
- package/lib/commonjs/Month/Month.js.map +1 -1
- package/lib/commonjs/MonthLevel/MonthLevel.js +19 -3
- package/lib/commonjs/MonthLevel/MonthLevel.js.map +1 -1
- package/lib/commonjs/MonthsList/MonthsList.js +160 -60
- package/lib/commonjs/MonthsList/MonthsList.js.map +1 -1
- package/lib/commonjs/MonthsList/get-month-in-tab-order/get-month-in-tab-order.js +7 -1
- package/lib/commonjs/MonthsList/get-month-in-tab-order/get-month-in-tab-order.js.map +1 -1
- package/lib/commonjs/TimeControlsList/TimeControl.js +15 -1
- package/lib/commonjs/TimeControlsList/TimeControl.js.map +1 -1
- package/lib/commonjs/TimeControlsList/TimeControlsList.js +16 -3
- package/lib/commonjs/TimeControlsList/TimeControlsList.js.map +1 -1
- package/lib/commonjs/WeekdaysRow/WeekdaysRow.js +23 -4
- package/lib/commonjs/WeekdaysRow/WeekdaysRow.js.map +1 -1
- package/lib/commonjs/YearsList/YearsList.js +155 -60
- package/lib/commonjs/YearsList/YearsList.js.map +1 -1
- package/lib/commonjs/YearsList/get-year-in-tab-order/get-year-in-tab-order.js +7 -1
- package/lib/commonjs/YearsList/get-year-in-tab-order/get-year-in-tab-order.js.map +1 -1
- package/lib/commonjs/hooks/use-dates-state/is-in-range/is-in-range.js +20 -0
- package/lib/commonjs/hooks/use-dates-state/is-in-range/is-in-range.js.map +1 -1
- package/lib/commonjs/hooks/use-dates-state/use-dates-state.js +25 -7
- package/lib/commonjs/hooks/use-dates-state/use-dates-state.js.map +1 -1
- package/lib/commonjs/internal/are-cell-props-equal.js +64 -0
- package/lib/commonjs/internal/are-cell-props-equal.js.map +1 -0
- package/lib/commonjs/internal/date-string-fast-path.js +98 -0
- package/lib/commonjs/internal/date-string-fast-path.js.map +1 -0
- package/lib/commonjs/internal/memoize-control-props.js +54 -0
- package/lib/commonjs/internal/memoize-control-props.js.map +1 -0
- package/lib/commonjs/internal/month-days-cache.js +71 -0
- package/lib/commonjs/internal/month-days-cache.js.map +1 -0
- package/lib/commonjs/utils/get-date-in-tab-order/get-date-in-tab-order.js +9 -1
- package/lib/commonjs/utils/get-date-in-tab-order/get-date-in-tab-order.js.map +1 -1
- package/lib/commonjs/utils/is-after-min-date/is-after-min-date.js +14 -1
- package/lib/commonjs/utils/is-after-min-date/is-after-min-date.js.map +1 -1
- package/lib/commonjs/utils/is-before-max-date/is-before-max-date.js +14 -1
- package/lib/commonjs/utils/is-before-max-date/is-before-max-date.js.map +1 -1
- package/lib/commonjs/utils/is-same-month/is-same-month.js +17 -1
- package/lib/commonjs/utils/is-same-month/is-same-month.js.map +1 -1
- package/lib/module/DatesProvider/DatesProvider.js +34 -5
- package/lib/module/DatesProvider/DatesProvider.js.map +1 -1
- package/lib/module/Day/Day.js +46 -8
- package/lib/module/Day/Day.js.map +1 -1
- package/lib/module/Month/Month.js +267 -82
- package/lib/module/Month/Month.js.map +1 -1
- package/lib/module/MonthLevel/MonthLevel.js +19 -3
- package/lib/module/MonthLevel/MonthLevel.js.map +1 -1
- package/lib/module/MonthsList/MonthsList.js +159 -60
- package/lib/module/MonthsList/MonthsList.js.map +1 -1
- package/lib/module/MonthsList/get-month-in-tab-order/get-month-in-tab-order.js +7 -1
- package/lib/module/MonthsList/get-month-in-tab-order/get-month-in-tab-order.js.map +1 -1
- package/lib/module/TimeControlsList/TimeControl.js +15 -1
- package/lib/module/TimeControlsList/TimeControl.js.map +1 -1
- package/lib/module/TimeControlsList/TimeControlsList.js +16 -3
- package/lib/module/TimeControlsList/TimeControlsList.js.map +1 -1
- package/lib/module/WeekdaysRow/WeekdaysRow.js +23 -4
- package/lib/module/WeekdaysRow/WeekdaysRow.js.map +1 -1
- package/lib/module/YearsList/YearsList.js +154 -60
- package/lib/module/YearsList/YearsList.js.map +1 -1
- package/lib/module/YearsList/get-year-in-tab-order/get-year-in-tab-order.js +7 -1
- package/lib/module/YearsList/get-year-in-tab-order/get-year-in-tab-order.js.map +1 -1
- package/lib/module/hooks/use-dates-state/is-in-range/is-in-range.js +20 -0
- package/lib/module/hooks/use-dates-state/is-in-range/is-in-range.js.map +1 -1
- package/lib/module/hooks/use-dates-state/use-dates-state.js +25 -7
- package/lib/module/hooks/use-dates-state/use-dates-state.js.map +1 -1
- package/lib/module/internal/are-cell-props-equal.js +60 -0
- package/lib/module/internal/are-cell-props-equal.js.map +1 -0
- package/lib/module/internal/date-string-fast-path.js +91 -0
- package/lib/module/internal/date-string-fast-path.js.map +1 -0
- package/lib/module/internal/memoize-control-props.js +50 -0
- package/lib/module/internal/memoize-control-props.js.map +1 -0
- package/lib/module/internal/month-days-cache.js +68 -0
- package/lib/module/internal/month-days-cache.js.map +1 -0
- package/lib/module/utils/get-date-in-tab-order/get-date-in-tab-order.js +9 -1
- package/lib/module/utils/get-date-in-tab-order/get-date-in-tab-order.js.map +1 -1
- package/lib/module/utils/is-after-min-date/is-after-min-date.js +14 -1
- package/lib/module/utils/is-after-min-date/is-after-min-date.js.map +1 -1
- package/lib/module/utils/is-before-max-date/is-before-max-date.js +14 -1
- package/lib/module/utils/is-before-max-date/is-before-max-date.js.map +1 -1
- package/lib/module/utils/is-same-month/is-same-month.js +17 -1
- package/lib/module/utils/is-same-month/is-same-month.js.map +1 -1
- package/lib/typescript/DatesProvider/DatesProvider.d.ts.map +1 -1
- package/lib/typescript/Day/Day.d.ts +7 -7
- package/lib/typescript/Day/Day.d.ts.map +1 -1
- package/lib/typescript/Month/Month.d.ts +3 -2
- package/lib/typescript/Month/Month.d.ts.map +1 -1
- package/lib/typescript/MonthLevel/MonthLevel.d.ts.map +1 -1
- package/lib/typescript/MonthsList/MonthsList.d.ts +3 -2
- package/lib/typescript/MonthsList/MonthsList.d.ts.map +1 -1
- package/lib/typescript/MonthsList/get-month-in-tab-order/get-month-in-tab-order.d.ts +6 -0
- package/lib/typescript/MonthsList/get-month-in-tab-order/get-month-in-tab-order.d.ts.map +1 -1
- package/lib/typescript/TimeControlsList/TimeControl.d.ts +13 -0
- package/lib/typescript/TimeControlsList/TimeControl.d.ts.map +1 -1
- package/lib/typescript/TimeControlsList/TimeControlsList.d.ts.map +1 -1
- package/lib/typescript/WeekdaysRow/WeekdaysRow.d.ts.map +1 -1
- package/lib/typescript/YearsList/YearsList.d.ts +3 -2
- package/lib/typescript/YearsList/YearsList.d.ts.map +1 -1
- package/lib/typescript/YearsList/get-year-in-tab-order/get-year-in-tab-order.d.ts +6 -0
- package/lib/typescript/YearsList/get-year-in-tab-order/get-year-in-tab-order.d.ts.map +1 -1
- package/lib/typescript/hooks/use-dates-state/is-in-range/is-in-range.d.ts +12 -0
- package/lib/typescript/hooks/use-dates-state/is-in-range/is-in-range.d.ts.map +1 -1
- package/lib/typescript/hooks/use-dates-state/use-dates-state.d.ts.map +1 -1
- package/lib/typescript/internal/are-cell-props-equal.d.ts +21 -0
- package/lib/typescript/internal/are-cell-props-equal.d.ts.map +1 -0
- package/lib/typescript/internal/date-string-fast-path.d.ts +35 -0
- package/lib/typescript/internal/date-string-fast-path.d.ts.map +1 -0
- package/lib/typescript/internal/memoize-control-props.d.ts +12 -0
- package/lib/typescript/internal/memoize-control-props.d.ts.map +1 -0
- package/lib/typescript/internal/month-days-cache.d.ts +19 -0
- package/lib/typescript/internal/month-days-cache.d.ts.map +1 -0
- package/lib/typescript/utils/get-date-in-tab-order/get-date-in-tab-order.d.ts +9 -1
- package/lib/typescript/utils/get-date-in-tab-order/get-date-in-tab-order.d.ts.map +1 -1
- package/lib/typescript/utils/is-after-min-date/is-after-min-date.d.ts +6 -0
- package/lib/typescript/utils/is-after-min-date/is-after-min-date.d.ts.map +1 -1
- package/lib/typescript/utils/is-before-max-date/is-before-max-date.d.ts +6 -0
- package/lib/typescript/utils/is-before-max-date/is-before-max-date.d.ts.map +1 -1
- package/lib/typescript/utils/is-same-month/is-same-month.d.ts +13 -1
- package/lib/typescript/utils/is-same-month/is-same-month.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/DatesProvider/DatesProvider.tsx +27 -5
- package/src/Day/Day.tsx +51 -10
- package/src/Month/Month.tsx +357 -80
- package/src/MonthLevel/MonthLevel.tsx +35 -16
- package/src/MonthsList/MonthsList.tsx +201 -55
- package/src/MonthsList/get-month-in-tab-order/get-month-in-tab-order.ts +12 -1
- package/src/TimeControlsList/TimeControl.tsx +16 -1
- package/src/TimeControlsList/TimeControlsList.tsx +15 -3
- package/src/WeekdaysRow/WeekdaysRow.tsx +29 -5
- package/src/YearsList/YearsList.tsx +196 -55
- package/src/YearsList/get-year-in-tab-order/get-year-in-tab-order.ts +12 -1
- package/src/hooks/use-dates-state/is-in-range/is-in-range.ts +22 -0
- package/src/hooks/use-dates-state/use-dates-state.ts +27 -11
- package/src/internal/are-cell-props-equal.ts +63 -0
- package/src/internal/date-string-fast-path.ts +94 -0
- package/src/internal/memoize-control-props.ts +54 -0
- package/src/internal/month-days-cache.ts +77 -0
- package/src/utils/get-date-in-tab-order/get-date-in-tab-order.ts +17 -2
- package/src/utils/is-after-min-date/is-after-min-date.ts +16 -1
- package/src/utils/is-before-max-date/is-before-max-date.ts +16 -1
- package/src/utils/is-same-month/is-same-month.ts +18 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Internal cross-platform helper — NOT exported from the public `src/index.ts`
|
|
4
|
+
// barrel.
|
|
5
|
+
//
|
|
6
|
+
// Most date comparisons in this package run over values that are ALREADY
|
|
7
|
+
// zero-padded `YYYY-MM-DD` strings — that is the package's canonical value shape
|
|
8
|
+
// (`DateStringValue`), and `getMonthDays` / `toDateString` emit nothing else. For
|
|
9
|
+
// those inputs a lexicographic string compare is EXACT: fixed-width, zero-padded,
|
|
10
|
+
// big-endian date strings sort in chronological order, so `a <= b` on the
|
|
11
|
+
// `YYYY-MM-DD` prefix is equivalent to a day-granularity dayjs comparison, and
|
|
12
|
+
// equality on the `YYYY-MM` prefix is equivalent to a month-granularity one.
|
|
13
|
+
//
|
|
14
|
+
// The dayjs spellings cost 2+ instances (each a `new Date` plus an object) and,
|
|
15
|
+
// for the month case, 2 `format()` calls that hit the locale table and run a
|
|
16
|
+
// regex replace — 42+ times per month grid render. The string spellings allocate
|
|
17
|
+
// nothing.
|
|
18
|
+
//
|
|
19
|
+
// The comparisons that use this all keep their dayjs path as a fallback for
|
|
20
|
+
// non-canonical input (`Date` objects, unpadded strings, other formats), so the
|
|
21
|
+
// fast path is a pure optimisation and never a narrowing of the accepted input.
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Matches a leading zero-padded `YYYY-MM-DD`, the package's canonical date
|
|
25
|
+
* string. Anchored at the start and tolerant of a trailing time component, so
|
|
26
|
+
* `DateTimeStringValue` (`YYYY-MM-DD HH:mm:ss`) also qualifies — its date part
|
|
27
|
+
* is what every day-granularity comparison looks at.
|
|
28
|
+
*/
|
|
29
|
+
const CANONICAL_DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Matches a leading zero-padded `YYYY-MM`. Accepts a bare year-month as well as
|
|
33
|
+
* a full date, since month-granularity comparisons only read that prefix. An
|
|
34
|
+
* UNPADDED month (`2026-6-15`) fails to match — `\d{2}` cannot consume `6-` — and
|
|
35
|
+
* so falls through to the dayjs path, which is the point of the guard.
|
|
36
|
+
*/
|
|
37
|
+
const CANONICAL_YEAR_MONTH = /^\d{4}-\d{2}/;
|
|
38
|
+
|
|
39
|
+
/** Whether `value` is a canonical `YYYY-MM-DD…` string safe to compare as text. */
|
|
40
|
+
export function isCanonicalDateString(value) {
|
|
41
|
+
return typeof value === "string" && CANONICAL_DATE.test(value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Whether `value` starts with a canonical zero-padded `YYYY-MM`. */
|
|
45
|
+
export function isCanonicalYearMonthString(value) {
|
|
46
|
+
return typeof value === "string" && CANONICAL_YEAR_MONTH.test(value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Prefix length of a canonical date string that carries each granularity. */
|
|
50
|
+
const PREFIX_LENGTH = {
|
|
51
|
+
year: 4,
|
|
52
|
+
month: 7,
|
|
53
|
+
day: 10
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** The comparison granularities the pickers use (`useDatesState`'s `level`). */
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* `dayjs(a).isSame(b, level)` for canonical date strings, as a prefix compare.
|
|
60
|
+
*
|
|
61
|
+
* Returns `null` when either side is NOT canonical, so callers can fall back to
|
|
62
|
+
* the dayjs comparison rather than silently changing semantics — the same
|
|
63
|
+
* belt-and-braces shape as the predicates above.
|
|
64
|
+
*
|
|
65
|
+
* This is the single hottest comparison in a range picker: `getControlProps`
|
|
66
|
+
* runs it for `selected`, `firstInRange` and `lastInRange` on EVERY cell, so a
|
|
67
|
+
* 42-cell grid pays for it well over a hundred times per render — and a web
|
|
68
|
+
* hover move triggers a full re-render.
|
|
69
|
+
*/
|
|
70
|
+
export function isSameByPrefix(a, b, level) {
|
|
71
|
+
if (!isCanonicalDateString(a) || !isCanonicalDateString(b)) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const length = PREFIX_LENGTH[level];
|
|
75
|
+
return a.slice(0, length) === b.slice(0, length);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* `dayjs(a).isBefore(b)` for canonical date strings, as a prefix compare.
|
|
80
|
+
*
|
|
81
|
+
* Both sides parse to local midnight, so comparing the `YYYY-MM-DD` prefix
|
|
82
|
+
* lexicographically is equivalent to dayjs' millisecond comparison. Returns
|
|
83
|
+
* `null` when either side is not canonical.
|
|
84
|
+
*/
|
|
85
|
+
export function isBeforeByPrefix(a, b) {
|
|
86
|
+
if (!isCanonicalDateString(a) || !isCanonicalDateString(b)) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return a.slice(0, 10) < b.slice(0, 10);
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=date-string-fast-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CANONICAL_DATE","CANONICAL_YEAR_MONTH","isCanonicalDateString","value","test","isCanonicalYearMonthString","PREFIX_LENGTH","year","month","day","isSameByPrefix","a","b","level","length","slice","isBeforeByPrefix"],"sourceRoot":"../../../src","sources":["internal/date-string-fast-path.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,oBAAoB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,cAAc;;AAE3C;AACA,OAAO,SAASC,qBAAqBA,CAACC,KAAc,EAAmB;EACrE,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIH,cAAc,CAACI,IAAI,CAACD,KAAK,CAAC;AAChE;;AAEA;AACA,OAAO,SAASE,0BAA0BA,CAACF,KAAc,EAAmB;EAC1E,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIF,oBAAoB,CAACG,IAAI,CAACD,KAAK,CAAC;AACtE;;AAEA;AACA,MAAMG,aAAa,GAAG;EAAEC,IAAI,EAAE,CAAC;EAAEC,KAAK,EAAE,CAAC;EAAEC,GAAG,EAAE;AAAG,CAAU;;AAE7D;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAC5BC,CAA4B,EAC5BC,CAA4B,EAC5BC,KAAsB,EACN;EAChB,IAAI,CAACX,qBAAqB,CAACS,CAAC,CAAC,IAAI,CAACT,qBAAqB,CAACU,CAAC,CAAC,EAAE;IAC1D,OAAO,IAAI;EACb;EAEA,MAAME,MAAM,GAAGR,aAAa,CAACO,KAAK,CAAC;EACnC,OAAOF,CAAC,CAACI,KAAK,CAAC,CAAC,EAAED,MAAM,CAAC,KAAKF,CAAC,CAACG,KAAK,CAAC,CAAC,EAAED,MAAM,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAC9BL,CAA4B,EAC5BC,CAA4B,EACZ;EAChB,IAAI,CAACV,qBAAqB,CAACS,CAAC,CAAC,IAAI,CAACT,qBAAqB,CAACU,CAAC,CAAC,EAAE;IAC1D,OAAO,IAAI;EACb;EAEA,OAAOD,CAAC,CAACI,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAGH,CAAC,CAACG,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Internal cross-platform helper — NOT exported from the public `src/index.ts`
|
|
4
|
+
// barrel.
|
|
5
|
+
//
|
|
6
|
+
// The grid components (`Month`, `MonthsList`, `YearsList`) each consult their
|
|
7
|
+
// per-item prop getter (`getDayProps` / `getMonthControlProps` /
|
|
8
|
+
// `getYearControlProps`) from MORE THAN ONE place in a single render: once from
|
|
9
|
+
// the `…InTabOrder` helper's "which cell is enabled" filter, again from its
|
|
10
|
+
// "which cell is selected" scan, and a third time in the cell loop itself.
|
|
11
|
+
//
|
|
12
|
+
// Those getters are NOT cheap. `DatePicker` wires `getDayProps` to
|
|
13
|
+
// `useDatesState`'s `getControlProps`, which for `type="range"` runs
|
|
14
|
+
// `rangeView.some(isSame)` + `isDateInRange` + `isFirstInRange` +
|
|
15
|
+
// `isLastInRange` — on the order of 20 dayjs instances and 2 array allocations
|
|
16
|
+
// per call. Three calls × 42 cells is ~2,500 dayjs instances spent re-deriving
|
|
17
|
+
// the SAME answer.
|
|
18
|
+
//
|
|
19
|
+
// Wrapping the getter in a per-render `Map` collapses that to one real call per
|
|
20
|
+
// date. The cache MUST be per render (created during render, discarded with it):
|
|
21
|
+
// the getters close over live selection/hover state and their identity changes
|
|
22
|
+
// every render, so a cache that outlived the render would serve stale props.
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Wrap a per-date prop getter so each distinct date is resolved at most once.
|
|
26
|
+
*
|
|
27
|
+
* Returns `undefined` when `getter` is `undefined`, preserving the optionality
|
|
28
|
+
* of the original prop so call sites keep their `getter?.(date)` shape and their
|
|
29
|
+
* result stays `T | undefined`. Call this ONCE PER RENDER and share the result
|
|
30
|
+
* with every consumer in that render — see the note above on why the cache must
|
|
31
|
+
* not be memoized across renders.
|
|
32
|
+
*/
|
|
33
|
+
export function memoizeByDate(getter) {
|
|
34
|
+
if (!getter) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const cache = new Map();
|
|
38
|
+
return date => {
|
|
39
|
+
const cached = cache.get(date);
|
|
40
|
+
// `has` (not a truthiness test) so a getter legitimately returning
|
|
41
|
+
// `undefined`/`false` is still cached rather than recomputed every hit.
|
|
42
|
+
if (cached !== undefined || cache.has(date)) {
|
|
43
|
+
return cached;
|
|
44
|
+
}
|
|
45
|
+
const value = getter(date);
|
|
46
|
+
cache.set(date, value);
|
|
47
|
+
return value;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=memoize-control-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memoizeByDate","getter","undefined","cache","Map","date","cached","get","has","value","set"],"sourceRoot":"../../../src","sources":["internal/memoize-control-props.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAC3BC,MAAkD,EACN;EAC5C,IAAI,CAACA,MAAM,EAAE;IACX,OAAOC,SAAS;EAClB;EAEA,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAE3C,OAAQC,IAAqB,IAAQ;IACnC,MAAMC,MAAM,GAAGH,KAAK,CAACI,GAAG,CAACF,IAAI,CAAC;IAC9B;IACA;IACA,IAAIC,MAAM,KAAKJ,SAAS,IAAIC,KAAK,CAACK,GAAG,CAACH,IAAI,CAAC,EAAE;MAC3C,OAAOC,MAAM;IACf;IAEA,MAAMG,KAAK,GAAGR,MAAM,CAACI,IAAI,CAAC;IAC1BF,KAAK,CAACO,GAAG,CAACL,IAAI,EAAEI,KAAK,CAAC;IACtB,OAAOA,KAAK;EACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Internal cross-platform helper — NOT exported from the public `src/index.ts`
|
|
4
|
+
// barrel.
|
|
5
|
+
//
|
|
6
|
+
// `getMonthDays` is the grid's enumerator, and it is not cheap: it walks the
|
|
7
|
+
// month day by day, so a 5-week grid costs ~70 dayjs instances (the running
|
|
8
|
+
// cursor plus dayjs' internal clones) and 35 `format("YYYY-MM-DD")` calls. The
|
|
9
|
+
// answer, though, is a PURE function of three primitives — the month, the first
|
|
10
|
+
// weekday, and whether the grid is padded to 6 weeks — and it is re-derived on
|
|
11
|
+
// every single `Month` render, including the ones triggered by nothing but a web
|
|
12
|
+
// hover moving one cell over.
|
|
13
|
+
//
|
|
14
|
+
// A small module-level LRU makes month navigation free after the first visit:
|
|
15
|
+
// stepping back and forth across a few months (or re-rendering the same month
|
|
16
|
+
// for any other reason) replays cached arrays instead of re-walking the calendar.
|
|
17
|
+
// The cap is generous enough to hold a couple of years of browsing yet bounded so
|
|
18
|
+
// a long-lived app cannot grow the map without limit.
|
|
19
|
+
//
|
|
20
|
+
// This deliberately wraps the public `getMonthDays` rather than caching inside
|
|
21
|
+
// it: the public util keeps returning a FRESH array per call, so an external
|
|
22
|
+
// consumer that mutates the result cannot corrupt a shared cache entry. Inside
|
|
23
|
+
// this package the arrays are only read (`.flat()`, `.filter()`, `.find()`,
|
|
24
|
+
// `.map()`), so sharing them is safe — and it additionally gives the grid a
|
|
25
|
+
// STABLE array identity per month, which is what lets `Month` use it directly as
|
|
26
|
+
// a `useMemo` dependency.
|
|
27
|
+
|
|
28
|
+
import { getMonthDays } from "../utils";
|
|
29
|
+
|
|
30
|
+
/** How many distinct month grids to retain (~2 years of navigation). */
|
|
31
|
+
const MAX_ENTRIES = 32;
|
|
32
|
+
const cache = new Map();
|
|
33
|
+
/**
|
|
34
|
+
* `getMonthDays` memoized on its three primitive inputs.
|
|
35
|
+
*
|
|
36
|
+
* The returned weeks array is SHARED — treat it as read-only. Callers also get a
|
|
37
|
+
* stable identity for a given key, so it can be passed straight to `useMemo` as a
|
|
38
|
+
* dependency.
|
|
39
|
+
*/
|
|
40
|
+
export function getCachedMonthDays({
|
|
41
|
+
month,
|
|
42
|
+
firstDayOfWeek,
|
|
43
|
+
consistentWeeks
|
|
44
|
+
}) {
|
|
45
|
+
const key = `${month}|${firstDayOfWeek}|${consistentWeeks ? 1 : 0}`;
|
|
46
|
+
const cached = cache.get(key);
|
|
47
|
+
if (cached) {
|
|
48
|
+
// Re-insert so the most recently used key is last, making the first map key
|
|
49
|
+
// the least recently used one for eviction below.
|
|
50
|
+
cache.delete(key);
|
|
51
|
+
cache.set(key, cached);
|
|
52
|
+
return cached;
|
|
53
|
+
}
|
|
54
|
+
const weeks = getMonthDays({
|
|
55
|
+
month,
|
|
56
|
+
firstDayOfWeek,
|
|
57
|
+
consistentWeeks
|
|
58
|
+
});
|
|
59
|
+
cache.set(key, weeks);
|
|
60
|
+
if (cache.size > MAX_ENTRIES) {
|
|
61
|
+
const oldest = cache.keys().next();
|
|
62
|
+
if (!oldest.done) {
|
|
63
|
+
cache.delete(oldest.value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return weeks;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=month-days-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getMonthDays","MAX_ENTRIES","cache","Map","getCachedMonthDays","month","firstDayOfWeek","consistentWeeks","key","cached","get","delete","set","weeks","size","oldest","keys","next","done","value"],"sourceRoot":"../../../src","sources":["internal/month-days-cache.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,YAAY,QAAQ,UAAU;;AAEvC;AACA,MAAMC,WAAW,GAAG,EAAE;AAEtB,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAWpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,KAAK;EACLC,cAAc;EACdC;AACoB,CAAC,EAAuB;EAC5C,MAAMC,GAAG,GAAG,GAAGH,KAAK,IAAIC,cAAc,IAAIC,eAAe,GAAG,CAAC,GAAG,CAAC,EAAE;EACnE,MAAME,MAAM,GAAGP,KAAK,CAACQ,GAAG,CAACF,GAAG,CAAC;EAE7B,IAAIC,MAAM,EAAE;IACV;IACA;IACAP,KAAK,CAACS,MAAM,CAACH,GAAG,CAAC;IACjBN,KAAK,CAACU,GAAG,CAACJ,GAAG,EAAEC,MAAM,CAAC;IACtB,OAAOA,MAAM;EACf;EAEA,MAAMI,KAAK,GAAGb,YAAY,CAAC;IAAEK,KAAK;IAAEC,cAAc;IAAEC;EAAgB,CAAC,CAAC;EACtEL,KAAK,CAACU,GAAG,CAACJ,GAAG,EAAEK,KAAK,CAAC;EAErB,IAAIX,KAAK,CAACY,IAAI,GAAGb,WAAW,EAAE;IAC5B,MAAMc,MAAM,GAAGb,KAAK,CAACc,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;IAClC,IAAI,CAACF,MAAM,CAACG,IAAI,EAAE;MAChBhB,KAAK,CAACS,MAAM,CAACI,MAAM,CAACI,KAAK,CAAC;IAC5B;EACF;EAEA,OAAON,KAAK;AACd","ignoreList":[]}
|
|
@@ -23,7 +23,15 @@ export function getDateInTabOrder({
|
|
|
23
23
|
if (selectedDate) {
|
|
24
24
|
return selectedDate;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
// `dayjs().isSame(date, "date")` inside the predicate built a FRESH "now"
|
|
28
|
+
// instance (plus dayjs' internal `startOf`/`endOf` clones) for every candidate
|
|
29
|
+
// — ~4 allocations × up to 42 dates, to answer a question whose left-hand side
|
|
30
|
+
// never changes. One formatted "today" string compares exactly instead:
|
|
31
|
+
// `dates` always comes from `getMonthDays`, which emits zero-padded
|
|
32
|
+
// `YYYY-MM-DD`, so string equality is equivalent to a day-granularity `isSame`.
|
|
33
|
+
const today = dayjs().format("YYYY-MM-DD");
|
|
34
|
+
const currentDate = enabledDates.find(date => date.slice(0, 10) === today);
|
|
27
35
|
if (currentDate) {
|
|
28
36
|
return currentDate;
|
|
29
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dayjs","isAfterMinDate","isBeforeMaxDate","isSameMonth","getDateInTabOrder","dates","minDate","maxDate","getDayProps","excludeDate","hideOutsideDates","month","enabledDates","flat","filter","date","disabled","selectedDate","find","selected","currentDate","
|
|
1
|
+
{"version":3,"names":["dayjs","isAfterMinDate","isBeforeMaxDate","isSameMonth","getDateInTabOrder","dates","minDate","maxDate","getDayProps","excludeDate","hideOutsideDates","month","enabledDates","flat","filter","date","disabled","selectedDate","find","selected","today","format","currentDate","slice"],"sourceRoot":"../../../../src","sources":["utils/get-date-in-tab-order/get-date-in-tab-order.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAASC,cAAc,QAAQ,wCAAwC;AACvE,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,WAAW,QAAQ,gCAAgC;AA2B5D;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,KAAK;EACLC,OAAO;EACPC,OAAO;EACPC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC;AACsB,CAAC,EAA+B;EACtD,MAAMC,YAAY,GAAGP,KAAK,CACvBQ,IAAI,CAAC,CAAC,CACNC,MAAM,CACJC,IAAI,IACHb,eAAe,CAACa,IAAI,EAAER,OAAO,CAAC,IAC9BN,cAAc,CAACc,IAAI,EAAET,OAAO,CAAC,IAC7B,CAACG,WAAW,GAAGM,IAAI,CAAC,IACpB,CAACP,WAAW,GAAGO,IAAI,CAAC,EAAEC,QAAQ,KAC7B,CAACN,gBAAgB,IAAIP,WAAW,CAACY,IAAI,EAAEJ,KAAK,CAAC,CAClD,CAAC;EAEH,MAAMM,YAAY,GAAGL,YAAY,CAACM,IAAI,CAAEH,IAAI,IAAKP,WAAW,GAAGO,IAAI,CAAC,EAAEI,QAAQ,CAAC;EAE/E,IAAIF,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMG,KAAK,GAAGpB,KAAK,CAAC,CAAC,CAACqB,MAAM,CAAC,YAAY,CAAC;EAC1C,MAAMC,WAAW,GAAGV,YAAY,CAACM,IAAI,CAAEH,IAAI,IAAKA,IAAI,CAACQ,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAKH,KAAK,CAAC;EAE5E,IAAIE,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,OAAOV,YAAY,CAAC,CAAC,CAAC;AACxB","ignoreList":[]}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
+
import { isCanonicalDateString } from "../../internal/date-string-fast-path";
|
|
4
5
|
/**
|
|
5
6
|
* Whether `date` is on or after `minDate` (no lower bound when `minDate` is
|
|
6
7
|
* absent). Mirrors @mantine/dates `isAfterMinDate`.
|
|
8
|
+
*
|
|
9
|
+
* The lower-bound twin of `isBeforeMaxDate` — the dayjs spelling
|
|
10
|
+
* (`isAfter(minDate - 1 day, "day")`) is a day-granularity `>=`, exactly a
|
|
11
|
+
* lexicographic `>=` for canonical zero-padded `YYYY-MM-DD` strings. Same hot
|
|
12
|
+
* path (once per cell in `Month`, again in `getDateInTabOrder`), same fallback
|
|
13
|
+
* for non-canonical input.
|
|
7
14
|
*/
|
|
8
15
|
export function isAfterMinDate(date, minDate) {
|
|
9
|
-
|
|
16
|
+
if (!minDate) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (isCanonicalDateString(date) && isCanonicalDateString(minDate)) {
|
|
20
|
+
return date.slice(0, 10) >= minDate.slice(0, 10);
|
|
21
|
+
}
|
|
22
|
+
return dayjs(date).isAfter(dayjs(minDate).subtract(1, "day"), "day");
|
|
10
23
|
}
|
|
11
24
|
//# sourceMappingURL=is-after-min-date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dayjs","isAfterMinDate","date","minDate","isAfter","subtract"],"sourceRoot":"../../../../src","sources":["utils/is-after-min-date/is-after-min-date.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["dayjs","isCanonicalDateString","isAfterMinDate","date","minDate","slice","isAfter","subtract"],"sourceRoot":"../../../../src","sources":["utils/is-after-min-date/is-after-min-date.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,qBAAqB,QAAQ,sCAAsC;AAG5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAC5BC,IAAqB,EACrBC,OAAoC,EAC3B;EACT,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,IAAIH,qBAAqB,CAACE,IAAI,CAAC,IAAIF,qBAAqB,CAACG,OAAO,CAAC,EAAE;IACjE,OAAOD,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAID,OAAO,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;EAClD;EAEA,OAAOL,KAAK,CAACG,IAAI,CAAC,CAACG,OAAO,CAACN,KAAK,CAACI,OAAO,CAAC,CAACG,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC;AACtE","ignoreList":[]}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
+
import { isCanonicalDateString } from "../../internal/date-string-fast-path";
|
|
4
5
|
/**
|
|
5
6
|
* Whether `date` is on or before `maxDate` (no upper bound when `maxDate` is
|
|
6
7
|
* absent). Mirrors @mantine/dates `isBeforeMaxDate`.
|
|
8
|
+
*
|
|
9
|
+
* Called once per cell by `Month` and again by `getDateInTabOrder`. The dayjs
|
|
10
|
+
* spelling (`isBefore(maxDate + 1 day, "day")`) is a day-granularity `<=`, which
|
|
11
|
+
* for canonical zero-padded `YYYY-MM-DD` strings is exactly a lexicographic
|
|
12
|
+
* `<=` — same answer, no `add`, no clones, no allocations. Non-canonical input
|
|
13
|
+
* falls back to the original path.
|
|
7
14
|
*/
|
|
8
15
|
export function isBeforeMaxDate(date, maxDate) {
|
|
9
|
-
|
|
16
|
+
if (!maxDate) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (isCanonicalDateString(date) && isCanonicalDateString(maxDate)) {
|
|
20
|
+
return date.slice(0, 10) <= maxDate.slice(0, 10);
|
|
21
|
+
}
|
|
22
|
+
return dayjs(date).isBefore(dayjs(maxDate).add(1, "day"), "day");
|
|
10
23
|
}
|
|
11
24
|
//# sourceMappingURL=is-before-max-date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dayjs","isBeforeMaxDate","date","maxDate","isBefore","add"],"sourceRoot":"../../../../src","sources":["utils/is-before-max-date/is-before-max-date.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["dayjs","isCanonicalDateString","isBeforeMaxDate","date","maxDate","slice","isBefore","add"],"sourceRoot":"../../../../src","sources":["utils/is-before-max-date/is-before-max-date.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,qBAAqB,QAAQ,sCAAsC;AAG5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAqB,EACrBC,OAAoC,EAC3B;EACT,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,IAAIH,qBAAqB,CAACE,IAAI,CAAC,IAAIF,qBAAqB,CAACG,OAAO,CAAC,EAAE;IACjE,OAAOD,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAID,OAAO,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;EAClD;EAEA,OAAOL,KAAK,CAACG,IAAI,CAAC,CAACG,QAAQ,CAACN,KAAK,CAACI,OAAO,CAAC,CAACG,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC;AAClE","ignoreList":[]}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
-
|
|
4
|
+
import { isCanonicalYearMonthString } from "../../internal/date-string-fast-path";
|
|
5
|
+
/**
|
|
6
|
+
* Whether two dates fall in the same calendar month. Mirrors @mantine/dates
|
|
7
|
+
* `isSameMonth`.
|
|
8
|
+
*
|
|
9
|
+
* This is one of the hottest comparisons in the package — `Month` calls it once
|
|
10
|
+
* per cell (42×) to decide `outside`, and `getDateInTabOrder` calls it again per
|
|
11
|
+
* cell whenever `hideOutsideDates` is on (which `DatePicker` enables
|
|
12
|
+
* automatically for multiple columns). The dayjs spelling cost 2 instances plus
|
|
13
|
+
* 2 `format("YYYY-MM")` calls (locale lookup + regex replace) EACH TIME; for the
|
|
14
|
+
* canonical `YYYY-MM-DD` strings that are the actual inputs, comparing the
|
|
15
|
+
* `YYYY-MM` prefix is exact and allocates nothing. `Date` inputs (and any
|
|
16
|
+
* non-canonical string) keep the original dayjs path.
|
|
17
|
+
*/
|
|
5
18
|
export function isSameMonth(date, comparison) {
|
|
19
|
+
if (isCanonicalYearMonthString(date) && isCanonicalYearMonthString(comparison)) {
|
|
20
|
+
return date.slice(0, 7) === comparison.slice(0, 7);
|
|
21
|
+
}
|
|
6
22
|
return dayjs(date).format("YYYY-MM") === dayjs(comparison).format("YYYY-MM");
|
|
7
23
|
}
|
|
8
24
|
//# sourceMappingURL=is-same-month.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dayjs","isSameMonth","date","comparison","format"],"sourceRoot":"../../../../src","sources":["utils/is-same-month/is-same-month.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["dayjs","isCanonicalYearMonthString","isSameMonth","date","comparison","slice","format"],"sourceRoot":"../../../../src","sources":["utils/is-same-month/is-same-month.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,0BAA0B,QAAQ,sCAAsC;AAGjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzBC,IAA4B,EAC5BC,UAAkC,EACzB;EACT,IAAIH,0BAA0B,CAACE,IAAI,CAAC,IAAIF,0BAA0B,CAACG,UAAU,CAAC,EAAE;IAC9E,OAAOD,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAKD,UAAU,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;EACpD;EAEA,OAAOL,KAAK,CAACG,IAAI,CAAC,CAACG,MAAM,CAAC,SAAS,CAAC,KAAKN,KAAK,CAACI,UAAU,CAAC,CAACE,MAAM,CAAC,SAAS,CAAC;AAC9E","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatesProvider.d.ts","sourceRoot":"","sources":["../../../src/DatesProvider/DatesProvider.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAiB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"DatesProvider.d.ts","sourceRoot":"","sources":["../../../src/DatesProvider/DatesProvider.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAiB,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,cAAc,EAAE,SAAS,CAAC;IAC1B,mDAAmD;IACnD,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,8EAA8E;IAC9E,cAAc,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,2DAA2D;AAC3D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,EAAE,kBAM7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,6CAEhC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,qGAAqG;IACrG,QAAQ,EAAE,qBAAqB,CAAC;IAChC,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BA4BvE;yBA5Be,aAAa"}
|
|
@@ -25,8 +25,8 @@ declare const DayFrame: import("@tamagui/web").TamaguiComponent<import("@tamagui
|
|
|
25
25
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
26
26
|
static?: boolean | undefined;
|
|
27
27
|
disabled?: boolean | undefined;
|
|
28
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
29
28
|
hidden?: boolean | undefined;
|
|
29
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
30
30
|
selected?: boolean | undefined;
|
|
31
31
|
outside?: boolean | undefined;
|
|
32
32
|
fullWidth?: boolean | undefined;
|
|
@@ -73,8 +73,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
73
73
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
74
74
|
static?: boolean | undefined;
|
|
75
75
|
disabled?: boolean | undefined;
|
|
76
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
77
76
|
hidden?: boolean | undefined;
|
|
77
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
78
78
|
selected?: boolean | undefined;
|
|
79
79
|
outside?: boolean | undefined;
|
|
80
80
|
fullWidth?: boolean | undefined;
|
|
@@ -87,8 +87,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
87
87
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
88
88
|
static?: boolean | undefined;
|
|
89
89
|
disabled?: boolean | undefined;
|
|
90
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
91
90
|
hidden?: boolean | undefined;
|
|
91
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
92
92
|
selected?: boolean | undefined;
|
|
93
93
|
outside?: boolean | undefined;
|
|
94
94
|
fullWidth?: boolean | undefined;
|
|
@@ -101,8 +101,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
101
101
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
102
102
|
static?: boolean | undefined;
|
|
103
103
|
disabled?: boolean | undefined;
|
|
104
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
105
104
|
hidden?: boolean | undefined;
|
|
105
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
106
106
|
selected?: boolean | undefined;
|
|
107
107
|
outside?: boolean | undefined;
|
|
108
108
|
fullWidth?: boolean | undefined;
|
|
@@ -116,8 +116,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
116
116
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
117
117
|
static?: boolean | undefined;
|
|
118
118
|
disabled?: boolean | undefined;
|
|
119
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
120
119
|
hidden?: boolean | undefined;
|
|
120
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
121
121
|
selected?: boolean | undefined;
|
|
122
122
|
outside?: boolean | undefined;
|
|
123
123
|
fullWidth?: boolean | undefined;
|
|
@@ -130,8 +130,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
130
130
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
131
131
|
static?: boolean | undefined;
|
|
132
132
|
disabled?: boolean | undefined;
|
|
133
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
134
133
|
hidden?: boolean | undefined;
|
|
134
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
135
135
|
selected?: boolean | undefined;
|
|
136
136
|
outside?: boolean | undefined;
|
|
137
137
|
fullWidth?: boolean | undefined;
|
|
@@ -146,8 +146,8 @@ export declare const Day: React.ForwardRefExoticComponent<Omit<import("@tamagui/
|
|
|
146
146
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
147
147
|
static?: boolean | undefined;
|
|
148
148
|
disabled?: boolean | undefined;
|
|
149
|
-
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
150
149
|
hidden?: boolean | undefined;
|
|
150
|
+
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
151
151
|
selected?: boolean | undefined;
|
|
152
152
|
outside?: boolean | undefined;
|
|
153
153
|
fullWidth?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Day.d.ts","sourceRoot":"","sources":["../../../src/Day/Day.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAuB,KAAK,QAAQ,EAAgC,MAAM,cAAc,CAAC;AAEhG,OAAO,EAAE,KAAK,YAAY,EAAyB,MAAM,iBAAiB,CAAC;AAI3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,2DAA2D;AAC3D,KAAK,OAAO,GAAG,YAAY,CAAC;AAE5B,sEAAsE;AACtE,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Day.d.ts","sourceRoot":"","sources":["../../../src/Day/Day.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAuB,KAAK,QAAQ,EAAgC,MAAM,cA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zB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAwHD,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { type GetProps, type SlotStyles } from "@knitui/core";
|
|
2
3
|
import { type CalendarSize } from "../cell-metrics";
|
|
3
4
|
import { type DayProps, type RenderDay } from "../Day";
|
|
@@ -123,10 +124,10 @@ export interface MonthProps extends MonthFrameProps, MonthSettings {
|
|
|
123
124
|
*/
|
|
124
125
|
styles?: SlotStyles<MonthStyles>;
|
|
125
126
|
}
|
|
126
|
-
export declare const Month:
|
|
127
|
+
export declare const Month: React.ForwardRefExoticComponent<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
127
128
|
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
128
129
|
fullWidth?: boolean | undefined;
|
|
129
|
-
}>, keyof MonthProps> & MonthProps &
|
|
130
|
+
}>, keyof MonthProps> & MonthProps & React.RefAttributes<import("@tamagui/web").TamaguiElement>> & import("@tamagui/web").StaticComponentObject<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
130
131
|
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
131
132
|
fullWidth?: boolean | undefined;
|
|
132
133
|
}>, keyof MonthProps> & MonthProps, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & MonthProps, import("@tamagui/web").StackStyleBase, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Month.d.ts","sourceRoot":"","sources":["../../../src/Month/Month.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Month.d.ts","sourceRoot":"","sources":["../../../src/Month/Month.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,YAAY,EAAuC,MAAM,iBAAiB,CAAC;AAEzF,OAAO,EAAO,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAU5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACnG,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,UAAU,CAAC;AAiNlB,6EAA6E;AAC7E,KAAK,SAAS,GAAG,YAAY,CAAC;AAmC9B,sEAAsE;AACtE,QAAA,MAAM,UAAU;;;6CAiBd,CAAC;AAEH,4CAA4C;AAC5C,QAAA,MAAM,QAAQ;;;6CAkBZ,CAAC;AAEH;;;;;GAKG;AACH,QAAA,MAAM,SAAS;;;6CAYb,CAAC;AAEH,6DAA6D;AAC7D,QAAA,MAAM,eAAe;;;6CAWnB,CAAC;AAEH,8DAA8D;AAC9D,QAAA,MAAM,oBAAoB;;;;;;;6CAWxB,CAAC;AASH,KAAK,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAErE,KAAK,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,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AAgB,CAAC,CAAC;CACvC;AAgMD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;IACrB,6BAA6B;;;;;IAE7B,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE/D,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE9B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { type GetProps, type SlotStyles } from "@knitui/core";
|
|
2
3
|
import { type CalendarSize } from "../cell-metrics";
|
|
3
4
|
import { type PickerControlProps } from "../PickerControl";
|
|
@@ -61,10 +62,10 @@ export interface MonthsListProps extends MonthsListFrameProps, MonthsListSetting
|
|
|
61
62
|
*/
|
|
62
63
|
styles?: SlotStyles<MonthsListStyles>;
|
|
63
64
|
}
|
|
64
|
-
export declare const MonthsList:
|
|
65
|
+
export declare const MonthsList: React.ForwardRefExoticComponent<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
65
66
|
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
66
67
|
fullWidth?: boolean | undefined;
|
|
67
|
-
}>, keyof MonthsListProps> & MonthsListProps &
|
|
68
|
+
}>, keyof MonthsListProps> & MonthsListProps & React.RefAttributes<import("@tamagui/web").TamaguiElement>> & import("@tamagui/web").StaticComponentObject<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
68
69
|
shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
69
70
|
fullWidth?: boolean | undefined;
|
|
70
71
|
}>, keyof MonthsListProps> & MonthsListProps, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & MonthsListProps, import("@tamagui/web").StackStyleBase, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthsList.d.ts","sourceRoot":"","sources":["../../../src/MonthsList/MonthsList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MonthsList.d.ts","sourceRoot":"","sources":["../../../src/MonthsList/MonthsList.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAMlE,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAGV,qBAAqB,EACrB,eAAe,EAChB,MAAM,UAAU,CAAC;AAsBlB,uEAAuE;AACvE,QAAA,MAAM,eAAe;;;6CAgBnB,CAAC;AAEH,6CAA6C;AAC7C,QAAA,MAAM,aAAa;;;6CAiBjB,CAAC;AAEH;;;;;GAKG;AACH,QAAA,MAAM,cAAc;;;6CAYlB,CAAC;AA2IH,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;IACxC,yCAAyC;IACzC,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;IACrC,mDAAmD;IACnD,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;IACvC,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvC;AASD,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,mGAAmG;IACnG,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE9E,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,6FAA6F;IAC7F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,oBAAoB,GAAG,IAAI,CAC9B,QAAQ,CAAC,OAAO,eAAe,CAAC,EAChC,MAAM,GAAG,UAAU,GAAG,WAAW,CAClC,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,oBAAoB,EAAE,kBAAkB;IAC/E,0FAA0F;IAC1F,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sFAAsF;IACtF,IAAI,EAAE,eAAe,CAAC;IAEtB,gDAAgD;IAChD,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;CACvC;AA+KD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIrB,CAAC"}
|
|
@@ -4,6 +4,12 @@ interface GetMonthInTabOrderInput {
|
|
|
4
4
|
months: DateStringValue[][];
|
|
5
5
|
minDate: DateStringValue | undefined;
|
|
6
6
|
maxDate: DateStringValue | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Consulted TWICE per month below (once for `disabled`, once for `selected`),
|
|
9
|
+
* so callers should pass a getter wrapped in `memoizeByDate` — the same wrapper
|
|
10
|
+
* they use for their own cell loop, so the whole render resolves each month's
|
|
11
|
+
* props exactly once. See `internal/memoize-control-props.ts`.
|
|
12
|
+
*/
|
|
7
13
|
getMonthControlProps: ((month: DateStringValue) => Partial<PickerControlProps>) | undefined;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-month-in-tab-order.d.ts","sourceRoot":"","sources":["../../../../src/MonthsList/get-month-in-tab-order/get-month-in-tab-order.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,UAAU,uBAAuB;IAC/B,MAAM,EAAE,eAAe,EAAE,EAAE,CAAC;IAC5B,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IACrC,oBAAoB,EAAE,CAAC,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,SAAS,CAAC;CAC7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,OAAO,EACP,OAAO,EACP,oBAAoB,GACrB,EAAE,uBAAuB,GAAG,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"get-month-in-tab-order.d.ts","sourceRoot":"","sources":["../../../../src/MonthsList/get-month-in-tab-order/get-month-in-tab-order.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,UAAU,uBAAuB;IAC/B,MAAM,EAAE,eAAe,EAAE,EAAE,CAAC;IAC5B,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IACrC;;;;;OAKG;IACH,oBAAoB,EAAE,CAAC,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,SAAS,CAAC;CAC7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,OAAO,EACP,OAAO,EACP,oBAAoB,GACrB,EAAE,uBAAuB,GAAG,eAAe,GAAG,SAAS,CA0BvD"}
|
|
@@ -24,6 +24,19 @@ export interface TimeControlProps<Value extends number | string> extends Omit<Ge
|
|
|
24
24
|
/** Label font size. @default 'sm' */
|
|
25
25
|
size?: CalendarSize;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* `React.memo` matters here more than anywhere else in the time picker: a `24h`
|
|
29
|
+
* dropdown with seconds renders 24 + 60 + 60 = 144 of these, and EVERY keystroke
|
|
30
|
+
* in the segment inputs updates `controller.values`, re-rendering `TimePicker` and
|
|
31
|
+
* with it all three columns. Only the two controls whose `active` flips actually
|
|
32
|
+
* need to re-render.
|
|
33
|
+
*
|
|
34
|
+
* All the props are primitives (`value`, `active`, `size`, `role`) except
|
|
35
|
+
* `onSelect`, which `TimeControlsList` stabilises with `useCallbackRef` — so the
|
|
36
|
+
* shallow compare is sound. The `ref` (which `memo` does not compare) is only ever
|
|
37
|
+
* attached to the ACTIVE control, and `active` is itself a compared prop, so a ref
|
|
38
|
+
* change never happens without a prop change to drive the re-render.
|
|
39
|
+
*/
|
|
27
40
|
export declare const TimeControl: <Value extends number | string>(props: TimeControlProps<Value> & React.RefAttributes<TamaguiElement>) => React.ReactElement | null;
|
|
28
41
|
export {};
|
|
29
42
|
//# sourceMappingURL=TimeControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeControl.d.ts","sourceRoot":"","sources":["../../../src/TimeControlsList/TimeControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAuB,KAAK,QAAQ,EAAU,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/F,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,iBAAiB,CAAC;AAkB/D;;;;;;GAMG;AACH,QAAA,MAAM,gBAAgB;;;;6CAuBpB,CAAC;AAaH,uGAAuG;AACvG,MAAM,WAAW,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CAC3E,QAAQ,CAAC,OAAO,gBAAgB,CAAC,EACjC,UAAU,GA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AAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeControlsList.d.ts","sourceRoot":"","sources":["../../../src/TimeControlsList/TimeControlsList.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAEL,KAAK,QAAQ,EAGb,KAAK,UAAU,EAEf,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeControlsList.d.ts","sourceRoot":"","sources":["../../../src/TimeControlsList/TimeControlsList.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAEL,KAAK,QAAQ,EAGb,KAAK,UAAU,EAEf,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAoDnE,wDAAwD;AACxD,QAAA,MAAM,sBAAsB;;6CAK1B,CAAC;AAWH,8DAA8D;AAC9D,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC;IACjD,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;CAC7C;AAQD,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IAEZ,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IAEZ,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IAEb,2CAA2C;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,qCAAqC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAE9B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,qCAAqC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB,gFAAgF;IAChF,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,4FAA4F;IAC5F,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE,yEAAyE;IACzE,MAAM,CAAC,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,yBAAyB,CAAC,EACjC,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAA8B,EAC9B,IAAW,EACX,eAAe,EACf,eAAe,EACf,MAAM,GACP,EAAE,qBAAqB,qBAwFvB;kBApGQ,yBAAyB;;;AA6GlC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;CAI3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekdaysRow.d.ts","sourceRoot":"","sources":["../../../src/WeekdaysRow/WeekdaysRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeekdaysRow.d.ts","sourceRoot":"","sources":["../../../src/WeekdaysRow/WeekdaysRow.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,KAAK,QAAQ,EAGb,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,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