@eintrek/erp-theme 1.4.13 → 1.4.15
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.esm.js +58 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +58 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/calendar-month.d.ts +29 -0
- package/dist/lib/calendar-month.test.d.ts +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Month arithmetic for the calendar header.
|
|
3
|
+
*
|
|
4
|
+
* This lives apart from the component for one reason: the bug it fixes is
|
|
5
|
+
* invisible on 28 days out of 31. Driving the calendar through the UI proves
|
|
6
|
+
* nothing unless the machine's clock happens to read the 29th or later, so the
|
|
7
|
+
* behaviour has to be reachable by a test that supplies its own date.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* stepMonth moves one month in either direction, always landing on the 1st.
|
|
11
|
+
*
|
|
12
|
+
* The obvious implementation — copy the date and call setMonth(m + 1) — keeps
|
|
13
|
+
* the day of the month. From the 31st that asks for a day the target month
|
|
14
|
+
* does not have, and JavaScript rolls forward rather than complaining: 31
|
|
15
|
+
* August plus one month is 1 October, so September cannot be reached at all.
|
|
16
|
+
*
|
|
17
|
+
* It only ever bit a calendar opened with nothing selected, because that
|
|
18
|
+
* starting point is today — including today's day-of-month. On the 3rd the old
|
|
19
|
+
* code is indistinguishable from this one.
|
|
20
|
+
*/
|
|
21
|
+
export declare function stepMonth(from: Date, direction: "prev" | "next"): Date;
|
|
22
|
+
/**
|
|
23
|
+
* monthAnchor is the month a calendar should open on.
|
|
24
|
+
*
|
|
25
|
+
* A field holding a value opens on that value's month. A field holding nothing
|
|
26
|
+
* opens on the current month — not on whatever month a different field was
|
|
27
|
+
* last browsed to, which is what a shared, unreset state produces.
|
|
28
|
+
*/
|
|
29
|
+
export declare function monthAnchor(selected: Date | undefined, today: Date): Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eintrek/erp-theme",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"packageManager": "pnpm@10.17.1",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"build-storybook": "storybook build",
|
|
22
22
|
"clean": "rimraf dist",
|
|
23
23
|
"prepare": "rimraf dist && cross-env NODE_ENV=production rollup -c --silent",
|
|
24
|
-
"pack": "cross-env NODE_ENV=production pnpm build && pnpm pack"
|
|
24
|
+
"pack": "cross-env NODE_ENV=production pnpm build && pnpm pack",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest"
|
|
25
27
|
},
|
|
26
28
|
"keywords": [
|
|
27
29
|
"react",
|
|
@@ -73,7 +75,8 @@
|
|
|
73
75
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
74
76
|
"storybook": "^9.0.9",
|
|
75
77
|
"tailwindcss": "^4.0.0",
|
|
76
|
-
"typescript": "^5.9.2"
|
|
78
|
+
"typescript": "^5.9.2",
|
|
79
|
+
"vitest": "^4.1.11"
|
|
77
80
|
},
|
|
78
81
|
"dependencies": {
|
|
79
82
|
"@dnd-kit/core": "^6.3.1",
|