@newtone-dev/ui-react-web 0.48.0 → 0.49.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/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/outline/index.d.ts +3 -0
- package/dist/outline/index.d.ts.map +1 -0
- package/dist/outline/index.js +2 -0
- package/dist/outline/index.js.map +1 -0
- package/dist/outline/outline.css +244 -0
- package/dist/outline/outline.d.ts +78 -0
- package/dist/outline/outline.d.ts.map +1 -0
- package/dist/outline/outline.js +246 -0
- package/dist/outline/outline.js.map +1 -0
- package/dist/when-field/index.d.ts +5 -0
- package/dist/when-field/index.d.ts.map +1 -0
- package/dist/when-field/index.js +3 -0
- package/dist/when-field/index.js.map +1 -0
- package/dist/when-field/period.d.ts +41 -0
- package/dist/when-field/period.d.ts.map +1 -0
- package/dist/when-field/period.js +230 -0
- package/dist/when-field/period.js.map +1 -0
- package/dist/when-field/when-field.css +70 -0
- package/dist/when-field/when-field.d.ts +35 -0
- package/dist/when-field/when-field.d.ts.map +1 -0
- package/dist/when-field/when-field.js +138 -0
- package/dist/when-field/when-field.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import { Icon } from '../icon/index.js';
|
|
5
|
+
import { Text } from '../text/index.js';
|
|
6
|
+
// How long apart two presses on a name may be and still be one double press, in ms: a finger's, which no click count
|
|
7
|
+
// tells of. A mouse's double click says so itself.
|
|
8
|
+
const DOUBLE = 500;
|
|
9
|
+
const NONE = [];
|
|
10
|
+
// The rows in the order they are drawn: an item, then the rows it holds, unless it is folded.
|
|
11
|
+
function rowsOf(items, depth = 0, holder = null, out = []) {
|
|
12
|
+
items.forEach((item, index) => {
|
|
13
|
+
out.push({ item, depth, holder, index, of: items.length });
|
|
14
|
+
if (item.children?.length && !item.folded)
|
|
15
|
+
rowsOf(item.children, depth + 1, item.id, out);
|
|
16
|
+
});
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
// The ids from the top down to `id`, whether drawn or folded away; null when no item has it.
|
|
20
|
+
function pathTo(items, id) {
|
|
21
|
+
for (const item of items) {
|
|
22
|
+
if (item.id === id)
|
|
23
|
+
return [id];
|
|
24
|
+
const deeper = item.children ? pathTo(item.children, id) : null;
|
|
25
|
+
if (deeper)
|
|
26
|
+
return [item.id, ...deeper];
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
// Whether `id` is somewhere under `item`.
|
|
31
|
+
const under = (item, id) => (item.children ?? []).some((c) => c.id === id || under(c, id));
|
|
32
|
+
// Whether a control in a cell is the Tab key's next stop: only in the row that holds the outline's own stop.
|
|
33
|
+
const TabStop = createContext(true);
|
|
34
|
+
// Whether a control stands in a row's cell, or alone.
|
|
35
|
+
const InRow = createContext(false);
|
|
36
|
+
/**
|
|
37
|
+
* Rows as a tree: one row per thing, each under the row of the thing that holds it, with a fold, a glyph, a name
|
|
38
|
+
* changed in place, and cells at its end under the columns' headings. One row is chosen. The consumer keeps the tree
|
|
39
|
+
* and is told each change. Blueprint components/outline.md; contracts/outline.md.
|
|
40
|
+
*/
|
|
41
|
+
function OutlineRoot({ label, labels, items, columns = NONE, chosen, onChoose, onRename, onFold, className, ...rest }) {
|
|
42
|
+
const rows = useMemo(() => rowsOf(items), [items]);
|
|
43
|
+
const [renaming, setRenaming] = useState(null);
|
|
44
|
+
// A row that goes while its name is changed (deleted, or folded away from outside) takes its field with it, and
|
|
45
|
+
// no blur says so: the change is forgotten, so the row coming back (an undo) does not open it and take the focus.
|
|
46
|
+
if (renaming !== null && !rows.some((r) => r.item.id === renaming))
|
|
47
|
+
setRenaming(null);
|
|
48
|
+
// The row the focus last went to, and what was chosen then. Once the choice moves, the Tab stop goes with it.
|
|
49
|
+
const [held, setHeld] = useState(null);
|
|
50
|
+
const root = useRef(null);
|
|
51
|
+
const rowEls = useRef(new Map());
|
|
52
|
+
const pressed = useRef(null);
|
|
53
|
+
// The Tab key's one stop: where the focus last went; else the chosen row, or the row that folds it away; else the
|
|
54
|
+
// first row.
|
|
55
|
+
const tab = useMemo(() => {
|
|
56
|
+
const drawn = (id) => rows.some((r) => r.item.id === id);
|
|
57
|
+
if (held && held.chosen === chosen && drawn(held.id))
|
|
58
|
+
return held.id;
|
|
59
|
+
const path = chosen === null ? null : pathTo(items, chosen);
|
|
60
|
+
return [...(path ?? [])].reverse().find(drawn) ?? rows[0]?.item.id ?? null;
|
|
61
|
+
}, [rows, items, chosen, held]);
|
|
62
|
+
// The chosen row is kept in view when the choice moves (a new item, a press elsewhere that chooses): never as the
|
|
63
|
+
// outline arrives.
|
|
64
|
+
const was = useRef(chosen);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (was.current === chosen)
|
|
67
|
+
return;
|
|
68
|
+
was.current = chosen;
|
|
69
|
+
if (chosen !== null)
|
|
70
|
+
rowEls.current.get(chosen)?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
|
|
71
|
+
}, [chosen]);
|
|
72
|
+
const choose = (id) => {
|
|
73
|
+
if (id !== chosen)
|
|
74
|
+
onChoose?.(id);
|
|
75
|
+
};
|
|
76
|
+
// A row that goes while the focus is in it (deleted, or folded away from outside) gives the focus to the Tab stop,
|
|
77
|
+
// never to the page.
|
|
78
|
+
const lost = () => setTimeout(() => {
|
|
79
|
+
const at = document.activeElement;
|
|
80
|
+
if (at && at !== document.body)
|
|
81
|
+
return;
|
|
82
|
+
root.current
|
|
83
|
+
?.querySelector('.newtone-outline-row[tabindex="0"]')
|
|
84
|
+
?.focus({ preventScroll: true });
|
|
85
|
+
});
|
|
86
|
+
const fold = (row) => {
|
|
87
|
+
const folding = !row.item.folded;
|
|
88
|
+
if (folding) {
|
|
89
|
+
// The focus in a row about to be folded away goes to the row that folds it, before it goes to the page.
|
|
90
|
+
const at = document.activeElement?.closest('.newtone-outline-row');
|
|
91
|
+
const id = at ? [...rowEls.current].find(([, el]) => el === at)?.[0] : undefined;
|
|
92
|
+
if (id !== undefined && under(row.item, id))
|
|
93
|
+
rowEls.current.get(row.item.id)?.focus();
|
|
94
|
+
}
|
|
95
|
+
onFold?.(row.item.id, folding);
|
|
96
|
+
};
|
|
97
|
+
const keys = (i) => (e) => {
|
|
98
|
+
// The row's own keys. A control in one of its cells, and the field its name is changed in, keep theirs.
|
|
99
|
+
if (e.target !== e.currentTarget || e.altKey || e.ctrlKey || e.metaKey)
|
|
100
|
+
return;
|
|
101
|
+
const row = rows[i];
|
|
102
|
+
if (!row)
|
|
103
|
+
return;
|
|
104
|
+
const holds = !!row.item.children?.length;
|
|
105
|
+
const go = (to) => {
|
|
106
|
+
const next = rows[Math.max(0, Math.min(rows.length - 1, to))];
|
|
107
|
+
if (!next || next === row)
|
|
108
|
+
return;
|
|
109
|
+
rowEls.current.get(next.item.id)?.focus();
|
|
110
|
+
choose(next.item.id);
|
|
111
|
+
};
|
|
112
|
+
if (e.key === 'ArrowDown')
|
|
113
|
+
go(i + 1);
|
|
114
|
+
else if (e.key === 'ArrowUp')
|
|
115
|
+
go(i - 1);
|
|
116
|
+
else if (e.key === 'Home')
|
|
117
|
+
go(0);
|
|
118
|
+
else if (e.key === 'End')
|
|
119
|
+
go(rows.length - 1);
|
|
120
|
+
else if (e.key === 'ArrowRight') {
|
|
121
|
+
// Folded, it unfolds; unfolded, to the first row it holds.
|
|
122
|
+
if (holds && row.item.folded)
|
|
123
|
+
fold(row);
|
|
124
|
+
else if (holds)
|
|
125
|
+
go(i + 1);
|
|
126
|
+
}
|
|
127
|
+
else if (e.key === 'ArrowLeft') {
|
|
128
|
+
// Unfolded, it folds; else to the row that holds it.
|
|
129
|
+
if (holds && !row.item.folded)
|
|
130
|
+
fold(row);
|
|
131
|
+
else if (row.holder !== null)
|
|
132
|
+
go(rows.findIndex((r) => r.item.id === row.holder));
|
|
133
|
+
}
|
|
134
|
+
else if (e.key === ' ')
|
|
135
|
+
choose(row.item.id);
|
|
136
|
+
else if ((e.key === 'Enter' || e.key === 'F2') && onRename)
|
|
137
|
+
setRenaming(row.item.id);
|
|
138
|
+
else
|
|
139
|
+
return;
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
};
|
|
142
|
+
// A double press on a name changes it: a mouse's double click, or a finger's two presses within half a second.
|
|
143
|
+
const namePress = (id) => (e) => {
|
|
144
|
+
if (!onRename || renaming)
|
|
145
|
+
return;
|
|
146
|
+
const twice = e.detail >= 2 ||
|
|
147
|
+
(pressed.current?.id === id && e.timeStamp - pressed.current.at < DOUBLE);
|
|
148
|
+
pressed.current = twice ? null : { id, at: e.timeStamp };
|
|
149
|
+
if (twice)
|
|
150
|
+
setRenaming(id);
|
|
151
|
+
};
|
|
152
|
+
return (_jsxs("div", { ref: root, className: ['newtone-outline', className].filter(Boolean).join(' '), role: "treegrid", "aria-label": label, ...rest, children: [columns.length ? (_jsxs("div", { className: "newtone-outline-head", role: "row", children: [_jsx("div", { className: "newtone-outline-heading", role: "columnheader", "data-lead": "", children: _jsx(Text, { as: "span", scale: "caption", weight: "medium", tone: "secondary", lines: 1, children: labels.name }) }), columns.map((c) => (_jsx("div", { className: "newtone-outline-heading", role: "columnheader", "data-align": c.align, "data-wide-only": c.wideOnly ? '' : undefined, style: c.width
|
|
153
|
+
? { '--_outline-width': c.width }
|
|
154
|
+
: undefined, children: _jsx(Text, { as: "span", scale: "caption", weight: "medium", tone: "secondary", lines: 1, children: c.label }) }, c.id)))] })) : null, rows.map((row, i) => (_jsx(OutlineRow, { row: row, columns: columns, labels: labels, chosen: row.item.id === chosen, tab: row.item.id === tab, renaming: renaming === row.item.id, at: (el) => {
|
|
155
|
+
if (el)
|
|
156
|
+
rowEls.current.set(row.item.id, el);
|
|
157
|
+
else
|
|
158
|
+
rowEls.current.delete(row.item.id);
|
|
159
|
+
}, onPress: () => choose(row.item.id), onNamePress: namePress(row.item.id), onKeys: keys(i), onHeld: () => setHeld((h) => h?.id === row.item.id && h.chosen === chosen
|
|
160
|
+
? h
|
|
161
|
+
: { id: row.item.id, chosen }), onFold: () => fold(row), onRenamed: (name, back) => {
|
|
162
|
+
setRenaming(null);
|
|
163
|
+
const next = name?.trim();
|
|
164
|
+
if (next && next !== row.item.name)
|
|
165
|
+
onRename?.(row.item.id, next);
|
|
166
|
+
// Enter and Escape hand the focus back to the row; a focus that left by itself stays where it went.
|
|
167
|
+
if (back)
|
|
168
|
+
rowEls.current.get(row.item.id)?.focus();
|
|
169
|
+
}, onLost: lost }, row.item.id)))] }));
|
|
170
|
+
}
|
|
171
|
+
function OutlineRow({ row, columns, labels, chosen, tab, renaming, at, onPress, onNamePress, onKeys, onHeld, onFold, onRenamed, onLost, }) {
|
|
172
|
+
const { item } = row;
|
|
173
|
+
const holds = !!item.children?.length;
|
|
174
|
+
const el = useRef(null);
|
|
175
|
+
// The row itself going while the focus is in it: the outline takes it.
|
|
176
|
+
useLayoutEffect(() => {
|
|
177
|
+
const row = el.current;
|
|
178
|
+
return () => {
|
|
179
|
+
if (row?.contains(document.activeElement))
|
|
180
|
+
onLost();
|
|
181
|
+
};
|
|
182
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
|
+
}, []);
|
|
184
|
+
return (_jsxs("div", { ref: (node) => {
|
|
185
|
+
el.current = node;
|
|
186
|
+
at(node);
|
|
187
|
+
}, className: "newtone-outline-row", role: "row", "aria-level": row.depth + 1, "aria-posinset": row.index + 1, "aria-setsize": row.of, "aria-expanded": holds ? !item.folded : undefined, "aria-selected": chosen, tabIndex: tab ? 0 : -1, "data-chosen": chosen ? '' : undefined, style: { '--_outline-depth': row.depth }, onClick: onPress, onKeyDown: onKeys, onFocus: onHeld, children: [_jsxs("div", { className: "newtone-outline-lead", role: "rowheader", onClick: onNamePress, children: [holds ? (_jsx("button", { type: "button", className: "newtone-outline-fold", "aria-label": item.folded ? labels.unfold : labels.fold, title: item.folded ? labels.unfold : labels.fold, tabIndex: -1, "data-folded": item.folded ? '' : undefined,
|
|
188
|
+
// A pointer's press never puts the focus on the fold, which some browsers would and some
|
|
189
|
+
// not: the focus stays where it was on every one, so a focused row's keys go on working.
|
|
190
|
+
onMouseDown: (e) => e.preventDefault(), onClick: (e) => {
|
|
191
|
+
// Its own press: it neither chooses the row nor counts toward a double press on the name.
|
|
192
|
+
e.stopPropagation();
|
|
193
|
+
onFold();
|
|
194
|
+
}, children: _jsx(Icon, { name: "expand_more", size: "sm" }) })) : (_jsx("span", { className: "newtone-outline-indent", "aria-hidden": "true" })), _jsx(Icon, { name: item.icon, size: "sm", className: "newtone-outline-glyph" }), renaming ? (_jsx(Rename, { name: item.name, label: labels.rename, onDone: onRenamed })) : (_jsx(Text, { as: "span", scale: "body-sm", lines: 1, measure: "none", className: "newtone-outline-name", children: item.name }))] }), _jsx(TabStop.Provider, { value: tab, children: _jsx(InRow.Provider, { value: true, children: columns.map((c) => {
|
|
195
|
+
const cell = item.cells?.[c.id];
|
|
196
|
+
return (_jsx("div", { className: "newtone-outline-cell", role: "gridcell", "data-align": c.align, "data-wide-only": c.wideOnly ? '' : undefined, style: c.width
|
|
197
|
+
? { '--_outline-width': c.width }
|
|
198
|
+
: undefined, children: typeof cell === 'string' || typeof cell === 'number' ? (_jsx(Text, { as: "span", scale: "body-sm", figures: "tabular", lines: 1, measure: "none", className: "newtone-outline-words", children: cell })) : (cell) }, c.id));
|
|
199
|
+
}) }) })] }));
|
|
200
|
+
}
|
|
201
|
+
// A name being changed in place: Enter keeps it and Escape drops it (null), the focus going back to the row; leaving
|
|
202
|
+
// the field keeps it, and the focus stays where it went.
|
|
203
|
+
function Rename({ name, label, onDone, }) {
|
|
204
|
+
const input = useRef(null);
|
|
205
|
+
const done = useRef(false);
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
input.current?.focus();
|
|
208
|
+
input.current?.select();
|
|
209
|
+
}, []);
|
|
210
|
+
const finish = (value, back) => {
|
|
211
|
+
if (done.current)
|
|
212
|
+
return;
|
|
213
|
+
done.current = true;
|
|
214
|
+
onDone(value, back);
|
|
215
|
+
};
|
|
216
|
+
return (_jsx("input", { ref: input, className: "newtone-outline-rename", "aria-label": label, defaultValue: name, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => {
|
|
217
|
+
e.stopPropagation();
|
|
218
|
+
if (e.key === 'Enter')
|
|
219
|
+
finish(e.currentTarget.value, true);
|
|
220
|
+
else if (e.key === 'Escape')
|
|
221
|
+
finish(null, true);
|
|
222
|
+
}, onBlur: (e) => finish(e.currentTarget.value, false) }));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A tick in a row's cell: on or off, pressed (`Outline.Tick`). Newtone's own box and mark, never the platform's
|
|
226
|
+
* checkbox. In a row it is a Tab stop only while its row holds the outline's.
|
|
227
|
+
*/
|
|
228
|
+
function OutlineTick({ label, checked, onChange, disabled, className, onClick, onMouseDown, ...rest }) {
|
|
229
|
+
const tab = useContext(TabStop);
|
|
230
|
+
const inRow = useContext(InRow);
|
|
231
|
+
return (_jsx("button", { type: "button", role: "checkbox", className: ['newtone-outline-tick', className].filter(Boolean).join(' '), "aria-checked": checked, "aria-label": label, "aria-disabled": disabled || undefined, title: label, tabIndex: tab ? 0 : -1, "data-checked": checked ? '' : undefined, "data-disabled": disabled ? '' : undefined, ...rest, onMouseDown: (e) => {
|
|
232
|
+
onMouseDown?.(e);
|
|
233
|
+
// In a row, a pointer's press never puts the focus on the tick, which some browsers would and some
|
|
234
|
+
// not: the focus stays where it was, and the outline's Tab stop with it.
|
|
235
|
+
if (inRow)
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
}, onClick: (e) => {
|
|
238
|
+
// Its own press: the row is not chosen by it.
|
|
239
|
+
e.stopPropagation();
|
|
240
|
+
onClick?.(e);
|
|
241
|
+
if (!disabled)
|
|
242
|
+
onChange?.(!checked);
|
|
243
|
+
}, children: _jsx("span", { className: "newtone-outline-tick-box", children: _jsx("svg", { className: "newtone-outline-tick-mark", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M5.5 10.5l3 3 6-7" }) }) }) }));
|
|
244
|
+
}
|
|
245
|
+
export const Outline = Object.assign(OutlineRoot, { Tick: OutlineTick });
|
|
246
|
+
//# sourceMappingURL=outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline.js","sourceRoot":"","sources":["../../src/outline/outline.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,aAAa,EACb,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAOX,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA6DvC,qHAAqH;AACrH,mDAAmD;AACnD,MAAM,MAAM,GAAG,GAAG,CAAA;AAElB,MAAM,IAAI,GAAoB,EAAE,CAAA;AAEhC,8FAA8F;AAC9F,SAAS,MAAM,CACX,KAAoB,EACpB,KAAK,GAAG,CAAC,EACT,MAAM,GAAkB,IAAI,EAC5B,GAAG,GAAU,EAAE;IAEf,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC1B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;QAC1D,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAC7F,CAAC,CAAC,C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eriod, writePeriod, periodSpan, periodExactness } from './period.js';
|
|
4
|
+
export type { PeriodExactness, PeriodSpan } from './period.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/when-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClF,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/when-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A period: a date as exact as it is known, written as one string. Four forms, and the form is the exactness:
|
|
3
|
+
*
|
|
4
|
+
* 2027 a year
|
|
5
|
+
* 2027-Q1 a quarter
|
|
6
|
+
* 2027-03 a month
|
|
7
|
+
* 2027-03-15 a day
|
|
8
|
+
*
|
|
9
|
+
* The same string a consumer stores (HuevOS Planner's Start and Target). Everything here is pure: no clock, no time
|
|
10
|
+
* zone, no `Date` arithmetic (the calendar is counted by hand, so a day is the same day wherever it is read).
|
|
11
|
+
* Blueprint components/when-field.md; the forms it reads and writes are contracts/when-field.md's.
|
|
12
|
+
*/
|
|
13
|
+
/** How exact a period is. */
|
|
14
|
+
export type PeriodExactness = 'day' | 'month' | 'quarter' | 'year';
|
|
15
|
+
/** A period's first and last day, each `YYYY-MM-DD`. */
|
|
16
|
+
export interface PeriodSpan {
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
}
|
|
20
|
+
/** Which of the four forms a string is: its exactness, or null when it is not a period. */
|
|
21
|
+
export declare function periodExactness(period: string): PeriodExactness | null;
|
|
22
|
+
/** A period's first and last day (a Start sorts by the first, a Target by the last); null when it is not a period. */
|
|
23
|
+
export declare function periodSpan(period: string): PeriodSpan | null;
|
|
24
|
+
/**
|
|
25
|
+
* A period as words, the American way, as it reads typed: `2028`, `Q1 2027`, `Dec 2026`, `Dec 5, 2026`. A string that
|
|
26
|
+
* is not a period comes back as it is, so a form this file does not know yet is still shown.
|
|
27
|
+
*/
|
|
28
|
+
export declare function writePeriod(period: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* What is typed, read as a period: `2028`, `Q1 2027`, `Dec 2026`, `Dec 5, 2026`, and the other ways
|
|
31
|
+
* contracts/when-field.md lists; capitals and spaces around it do not matter. Null when it does not read as a date, or
|
|
32
|
+
* reads as one of an exactness not in `exactness` (all four when left out).
|
|
33
|
+
*/
|
|
34
|
+
export declare function readPeriod(text: string, exactness?: readonly PeriodExactness[]): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* A period moved by `by` of its own unit: a day by days, a month by months, a quarter by quarters, a year by years.
|
|
37
|
+
* It stays as it is where it is not a period, or where the move would leave the years 0001 to 9999. The field's Up and
|
|
38
|
+
* Down; not exported from the package.
|
|
39
|
+
*/
|
|
40
|
+
export declare function stepPeriod(period: string, by: number): string;
|
|
41
|
+
//# sourceMappingURL=period.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"period.d.ts","sourceRoot":"","sources":["../../src/when-field/period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,6BAA6B;AAC7B,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElE,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACb;AAgDD,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAEtE;AAED,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAS5D;AAeD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQlD;AAkED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,SAAS,eAAe,EAAQ,GAC5C,MAAM,GAAG,IAAI,CAaf;AAsBD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAc7D"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A period: a date as exact as it is known, written as one string. Four forms, and the form is the exactness:
|
|
3
|
+
*
|
|
4
|
+
* 2027 a year
|
|
5
|
+
* 2027-Q1 a quarter
|
|
6
|
+
* 2027-03 a month
|
|
7
|
+
* 2027-03-15 a day
|
|
8
|
+
*
|
|
9
|
+
* The same string a consumer stores (HuevOS Planner's Start and Target). Everything here is pure: no clock, no time
|
|
10
|
+
* zone, no `Date` arithmetic (the calendar is counted by hand, so a day is the same day wherever it is read).
|
|
11
|
+
* Blueprint components/when-field.md; the forms it reads and writes are contracts/when-field.md's.
|
|
12
|
+
*/
|
|
13
|
+
const ALL = ['day', 'month', 'quarter', 'year'];
|
|
14
|
+
// The years a period may name: 0001 to 9999. There is no year 0000 (a calendar's first year is 1, and a store that
|
|
15
|
+
// keeps a period's days as dates refuses it), and a fifth figure is not one of the four forms.
|
|
16
|
+
const FIRST_YEAR = 1;
|
|
17
|
+
const LAST_YEAR = 9999;
|
|
18
|
+
const leap = (y) => (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
|
|
19
|
+
const daysIn = (y, m) => m === 2 ? (leap(y) ? 29 : 28) : [4, 6, 9, 11].includes(m) ? 30 : 31;
|
|
20
|
+
const two = (n) => String(n).padStart(2, '0');
|
|
21
|
+
const four = (n) => String(n).padStart(4, '0');
|
|
22
|
+
// The four forms, strictly: four digits, then nothing, a quarter, a month, or a month and a day.
|
|
23
|
+
const FORM = /^(\d{4})(?:-(?:Q([1-4])|(\d{2})(?:-(\d{2}))?))?$/;
|
|
24
|
+
function parts(period) {
|
|
25
|
+
const f = FORM.exec(period);
|
|
26
|
+
if (!f)
|
|
27
|
+
return null;
|
|
28
|
+
const y = Number(f[1]);
|
|
29
|
+
if (y < FIRST_YEAR)
|
|
30
|
+
return null;
|
|
31
|
+
if (f[2])
|
|
32
|
+
return { exactness: 'quarter', y, q: Number(f[2]) };
|
|
33
|
+
if (!f[3])
|
|
34
|
+
return { exactness: 'year', y };
|
|
35
|
+
const m = Number(f[3]);
|
|
36
|
+
if (m < 1 || m > 12)
|
|
37
|
+
return null;
|
|
38
|
+
if (!f[4])
|
|
39
|
+
return { exactness: 'month', y, m };
|
|
40
|
+
const d = Number(f[4]);
|
|
41
|
+
// A day its month does not have (February 30) is not a period.
|
|
42
|
+
if (d < 1 || d > daysIn(y, m))
|
|
43
|
+
return null;
|
|
44
|
+
return { exactness: 'day', y, m, d };
|
|
45
|
+
}
|
|
46
|
+
function written(p) {
|
|
47
|
+
if (p.exactness === 'year')
|
|
48
|
+
return four(p.y);
|
|
49
|
+
if (p.exactness === 'quarter')
|
|
50
|
+
return `${four(p.y)}-Q${p.q}`;
|
|
51
|
+
if (p.exactness === 'month')
|
|
52
|
+
return `${four(p.y)}-${two(p.m)}`;
|
|
53
|
+
return `${four(p.y)}-${two(p.m)}-${two(p.d)}`;
|
|
54
|
+
}
|
|
55
|
+
/** Which of the four forms a string is: its exactness, or null when it is not a period. */
|
|
56
|
+
export function periodExactness(period) {
|
|
57
|
+
return parts(period)?.exactness ?? null;
|
|
58
|
+
}
|
|
59
|
+
/** A period's first and last day (a Start sorts by the first, a Target by the last); null when it is not a period. */
|
|
60
|
+
export function periodSpan(period) {
|
|
61
|
+
const p = parts(period);
|
|
62
|
+
if (!p)
|
|
63
|
+
return null;
|
|
64
|
+
const day = (m, d) => `${four(p.y)}-${two(m)}-${two(d)}`;
|
|
65
|
+
if (p.exactness === 'year')
|
|
66
|
+
return { from: day(1, 1), to: day(12, 31) };
|
|
67
|
+
if (p.exactness === 'quarter')
|
|
68
|
+
return { from: day(p.q * 3 - 2, 1), to: day(p.q * 3, daysIn(p.y, p.q * 3)) };
|
|
69
|
+
if (p.exactness === 'month')
|
|
70
|
+
return { from: day(p.m, 1), to: day(p.m, daysIn(p.y, p.m)) };
|
|
71
|
+
return { from: day(p.m, p.d), to: day(p.m, p.d) };
|
|
72
|
+
}
|
|
73
|
+
// The months' names, American, from the platform's own data: the script holds no month word. Asked once.
|
|
74
|
+
let named = null;
|
|
75
|
+
function months() {
|
|
76
|
+
if (!named) {
|
|
77
|
+
const of = (width) => {
|
|
78
|
+
const format = new Intl.DateTimeFormat('en-US', { month: width, timeZone: 'UTC' });
|
|
79
|
+
return Array.from({ length: 12 }, (_, m) => format.format(Date.UTC(2001, m, 15)));
|
|
80
|
+
};
|
|
81
|
+
named = { short: of('short'), long: of('long') };
|
|
82
|
+
}
|
|
83
|
+
return named;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A period as words, the American way, as it reads typed: `2028`, `Q1 2027`, `Dec 2026`, `Dec 5, 2026`. A string that
|
|
87
|
+
* is not a period comes back as it is, so a form this file does not know yet is still shown.
|
|
88
|
+
*/
|
|
89
|
+
export function writePeriod(period) {
|
|
90
|
+
const p = parts(period);
|
|
91
|
+
if (!p)
|
|
92
|
+
return period;
|
|
93
|
+
if (p.exactness === 'year')
|
|
94
|
+
return four(p.y);
|
|
95
|
+
if (p.exactness === 'quarter')
|
|
96
|
+
return `Q${p.q} ${four(p.y)}`;
|
|
97
|
+
const month = months().short[p.m - 1];
|
|
98
|
+
if (p.exactness === 'month')
|
|
99
|
+
return `${month} ${four(p.y)}`;
|
|
100
|
+
return `${month} ${p.d}, ${four(p.y)}`;
|
|
101
|
+
}
|
|
102
|
+
// A month by its name: the short name, or the long one from its third letter on (dec, dece, december; sept).
|
|
103
|
+
function monthNamed(word) {
|
|
104
|
+
const w = word.toLowerCase();
|
|
105
|
+
if (w.length < 3)
|
|
106
|
+
return null;
|
|
107
|
+
const { short, long } = months();
|
|
108
|
+
for (let m = 0; m < 12; m++) {
|
|
109
|
+
if (w === short[m].toLowerCase() || long[m].toLowerCase().startsWith(w))
|
|
110
|
+
return m + 1;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
// What is typed, read as one of the four. Each line is one way of writing; the first that fits wins. A day and the
|
|
115
|
+
// year after it always have a comma or a space between them: figures run together (Dec 20261, a slip of the hand)
|
|
116
|
+
// are never cut into a day and a year.
|
|
117
|
+
const WAYS = [
|
|
118
|
+
// 2028
|
|
119
|
+
[/^(\d{4})$/, (f) => ({ exactness: 'year', y: Number(f[1]) })],
|
|
120
|
+
// Q1 2027, q1/2027; 2027 Q1, 2027-Q1
|
|
121
|
+
[
|
|
122
|
+
/^q([1-4])[\s/-]*(\d{4})$/i,
|
|
123
|
+
(f) => ({ exactness: 'quarter', y: Number(f[2]), q: Number(f[1]) }),
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
/^(\d{4})[\s/-]*q([1-4])$/i,
|
|
127
|
+
(f) => ({ exactness: 'quarter', y: Number(f[1]), q: Number(f[2]) }),
|
|
128
|
+
],
|
|
129
|
+
// 2026-12, as it is stored
|
|
130
|
+
[/^(\d{4})-(\d{2})$/, (f) => ({ exactness: 'month', y: Number(f[1]), m: Number(f[2]) })],
|
|
131
|
+
// 12/2026
|
|
132
|
+
[
|
|
133
|
+
/^(\d{1,2})\s*\/\s*(\d{4})$/,
|
|
134
|
+
(f) => ({ exactness: 'month', y: Number(f[2]), m: Number(f[1]) }),
|
|
135
|
+
],
|
|
136
|
+
// Dec 2026, December 2026, dec. 2026
|
|
137
|
+
[
|
|
138
|
+
/^([a-z]+)\.?,?\s*(\d{4})$/i,
|
|
139
|
+
(f) => byName(f[1], (m) => ({ exactness: 'month', y: Number(f[2]), m })),
|
|
140
|
+
],
|
|
141
|
+
// 2026-12-05, as it is stored
|
|
142
|
+
[
|
|
143
|
+
/^(\d{4})-(\d{2})-(\d{2})$/,
|
|
144
|
+
(f) => ({ exactness: 'day', y: Number(f[1]), m: Number(f[2]), d: Number(f[3]) }),
|
|
145
|
+
],
|
|
146
|
+
// 12/5/2026: the month first, the American way
|
|
147
|
+
[
|
|
148
|
+
/^(\d{1,2})\s*\/\s*(\d{1,2})\s*\/\s*(\d{4})$/,
|
|
149
|
+
(f) => ({ exactness: 'day', y: Number(f[3]), m: Number(f[1]), d: Number(f[2]) }),
|
|
150
|
+
],
|
|
151
|
+
// Dec 5, 2026; December 5 2026
|
|
152
|
+
[
|
|
153
|
+
/^([a-z]+)\.?\s*(\d{1,2})(?:\s*,\s*|\s+)(\d{4})$/i,
|
|
154
|
+
(f) => byName(f[1], (m) => ({ exactness: 'day', y: Number(f[3]), m, d: Number(f[2]) })),
|
|
155
|
+
],
|
|
156
|
+
// 5 Dec 2026
|
|
157
|
+
[
|
|
158
|
+
/^(\d{1,2})\s*([a-z]+)\.?,?\s*(\d{4})$/i,
|
|
159
|
+
(f) => byName(f[2], (m) => ({ exactness: 'day', y: Number(f[3]), m, d: Number(f[1]) })),
|
|
160
|
+
],
|
|
161
|
+
];
|
|
162
|
+
function byName(word, make) {
|
|
163
|
+
const m = monthNamed(word);
|
|
164
|
+
return m === null ? null : make(m);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* What is typed, read as a period: `2028`, `Q1 2027`, `Dec 2026`, `Dec 5, 2026`, and the other ways
|
|
168
|
+
* contracts/when-field.md lists; capitals and spaces around it do not matter. Null when it does not read as a date, or
|
|
169
|
+
* reads as one of an exactness not in `exactness` (all four when left out).
|
|
170
|
+
*/
|
|
171
|
+
export function readPeriod(text, exactness = ALL) {
|
|
172
|
+
const t = text.trim().replace(/\s+/g, ' ');
|
|
173
|
+
if (!t)
|
|
174
|
+
return null;
|
|
175
|
+
for (const [way, make] of WAYS) {
|
|
176
|
+
const f = way.exec(t);
|
|
177
|
+
const made = f ? make(f) : null;
|
|
178
|
+
if (!made)
|
|
179
|
+
continue;
|
|
180
|
+
// Written out and read back, so a month 13, a February 30 or a year 0000 is caught by the one reader of the
|
|
181
|
+
// four forms.
|
|
182
|
+
const period = written(made);
|
|
183
|
+
if (parts(period))
|
|
184
|
+
return exactness.includes(made.exactness) ? period : null;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
// Days from 0000-03-01 to a day, and back (the calendar counted in whole 400-year turns; Howard Hinnant's method).
|
|
189
|
+
function dayNumber(y, m, d) {
|
|
190
|
+
const yy = m <= 2 ? y - 1 : y;
|
|
191
|
+
const era = Math.floor(yy / 400);
|
|
192
|
+
const yoe = yy - era * 400;
|
|
193
|
+
const doy = Math.floor((153 * (m + (m > 2 ? -3 : 9)) + 2) / 5) + d - 1;
|
|
194
|
+
return era * 146097 + yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
|
|
195
|
+
}
|
|
196
|
+
function dayOf(n) {
|
|
197
|
+
const era = Math.floor(n / 146097);
|
|
198
|
+
const doe = n - era * 146097;
|
|
199
|
+
const yoe = Math.floor((doe - Math.floor(doe / 1460) + Math.floor(doe / 36524) - Math.floor(doe / 146096)) / 365);
|
|
200
|
+
const doy = doe - (365 * yoe + Math.floor(yoe / 4) - Math.floor(yoe / 100));
|
|
201
|
+
const mp = Math.floor((5 * doy + 2) / 153);
|
|
202
|
+
const m = mp < 10 ? mp + 3 : mp - 9;
|
|
203
|
+
return { y: yoe + era * 400 + (m <= 2 ? 1 : 0), m, d: doy - Math.floor((153 * mp + 2) / 5) + 1 };
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* A period moved by `by` of its own unit: a day by days, a month by months, a quarter by quarters, a year by years.
|
|
207
|
+
* It stays as it is where it is not a period, or where the move would leave the years 0001 to 9999. The field's Up and
|
|
208
|
+
* Down; not exported from the package.
|
|
209
|
+
*/
|
|
210
|
+
export function stepPeriod(period, by) {
|
|
211
|
+
const p = parts(period);
|
|
212
|
+
if (!p || !Number.isFinite(by))
|
|
213
|
+
return period;
|
|
214
|
+
by = Math.trunc(by);
|
|
215
|
+
let next;
|
|
216
|
+
if (p.exactness === 'year')
|
|
217
|
+
next = { exactness: 'year', y: p.y + by };
|
|
218
|
+
else if (p.exactness === 'quarter') {
|
|
219
|
+
const n = p.y * 4 + (p.q - 1) + by;
|
|
220
|
+
next = { exactness: 'quarter', y: Math.floor(n / 4), q: (((n % 4) + 4) % 4) + 1 };
|
|
221
|
+
}
|
|
222
|
+
else if (p.exactness === 'month') {
|
|
223
|
+
const n = p.y * 12 + (p.m - 1) + by;
|
|
224
|
+
next = { exactness: 'month', y: Math.floor(n / 12), m: (((n % 12) + 12) % 12) + 1 };
|
|
225
|
+
}
|
|
226
|
+
else
|
|
227
|
+
next = { exactness: 'day', ...dayOf(dayNumber(p.y, p.m, p.d) + by) };
|
|
228
|
+
return next.y < FIRST_YEAR || next.y > LAST_YEAR ? period : written(next);
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=period.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"period.js","sourceRoot":"","sources":["../../src/when-field/period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,MAAM,GAAG,GAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;AAE3E,mHAAmH;AACnH,+FAA+F;AAC/F,MAAM,UAAU,GAAG,CAAC,CAAA;AACpB,MAAM,SAAS,GAAG,IAAI,CAAA;AAE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