viewkitjs 0.35.0 → 0.37.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/CHANGELOG.md +112 -0
- package/MIGRATION.md +7 -0
- package/package.json +1 -1
- package/views/dist/atoms/types.d.ts +32 -4
- package/views/dist/contract.d.ts +32 -9
- package/views/dist/contract.js +35 -1
- package/views/dist/controls/avatar/avatar.d.ts +3 -1
- package/views/dist/controls/avatar/avatar.js +2 -2
- package/views/dist/controls/button/own-look-moved.d.ts +11 -0
- package/views/dist/controls/button/own-look-moved.js +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.js +2 -0
- package/views/dist/controls/compound-editor/name-parts.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +1 -1
- package/views/dist/controls/compound-editor/range-parts.js +1 -1
- package/views/dist/controls/compound-editor/words.d.ts +3 -0
- package/views/dist/controls/compound-editor/words.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +10 -3
- package/views/dist/controls/customize/customize.js +147 -63
- package/views/dist/controls/customize/items.d.ts +49 -0
- package/views/dist/controls/customize/items.js +104 -0
- package/views/dist/controls/customize/map-customize-body.js +7 -4
- package/views/dist/controls/customize/words.d.ts +2 -0
- package/views/dist/controls/customize/words.js +1 -0
- package/views/dist/controls/date-editor/date-behaviour.d.ts +80 -0
- package/views/dist/controls/date-editor/date-behaviour.js +187 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -2
- package/views/dist/controls/date-editor/date-editor.js +29 -166
- package/views/dist/controls/field/field.d.ts +3 -2
- package/views/dist/controls/field/field.js +7 -2
- package/views/dist/controls/field/looks.d.ts +1 -1
- package/views/dist/controls/field/looks.js +5 -4
- package/views/dist/controls/field.css +4 -0
- package/views/dist/controls/filter-editor/block.js +5 -2
- package/views/dist/controls/filter-editor/filter-editor.d.ts +14 -1
- package/views/dist/controls/filter-editor/filter-editor.js +21 -13
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
- package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
- package/views/dist/controls/filter-editor/map-rules.js +18 -13
- package/views/dist/controls/filter-editor/parts.d.ts +2 -0
- package/views/dist/controls/filter-editor/parts.js +13 -12
- package/views/dist/controls/filter-editor/rules.d.ts +4 -4
- package/views/dist/controls/filter-editor/rules.js +6 -3
- package/views/dist/controls/filter-editor/words.d.ts +2 -0
- package/views/dist/controls/filter-editor/words.js +1 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
- package/views/dist/controls/group-editor/group-editor.js +21 -15
- package/views/dist/controls/group-editor/map-group-body.js +1 -0
- package/views/dist/controls/index.d.ts +4 -2
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/inline-input.css +9 -0
- package/views/dist/controls/internal/kit-words.d.ts +11 -0
- package/views/dist/controls/internal/kit-words.js +7 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
- package/views/dist/controls/internal/map-panel-controls.js +14 -1
- package/views/dist/controls/internal/menu-items.d.ts +9 -0
- package/views/dist/controls/internal/menu-items.js +97 -0
- package/views/dist/controls/internal/panel-controls.js +1 -1
- package/views/dist/controls/internal/phone.d.ts +1 -1
- package/views/dist/controls/internal/phone.js +3 -2
- package/views/dist/controls/list/tokens.d.ts +1 -1
- package/views/dist/controls/list/tokens.js +1 -1
- package/views/dist/controls/list.css +5 -2
- package/views/dist/controls/menu/menu.d.ts +1 -1
- package/views/dist/controls/menu/menu.js +1 -1
- package/views/dist/controls/menu-list/menu-list.js +3 -2
- package/views/dist/controls/menu.css +4 -4
- package/views/dist/controls/number-editor/map-number-body.js +2 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/number-editor/words.d.ts +3 -0
- package/views/dist/controls/number-editor/words.js +2 -0
- package/views/dist/controls/pane.css +1 -1
- package/views/dist/controls/picker/fields-frame.d.ts +5 -0
- package/views/dist/controls/picker/fields-frame.js +30 -0
- package/views/dist/controls/picker/map-fields-body.js +3 -26
- package/views/dist/controls/picker/map-picker.d.ts +2 -1
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.js +9 -2
- package/views/dist/controls/picker/rows.d.ts +3 -1
- package/views/dist/controls/picker.css +7 -3
- package/views/dist/controls/popover/looks.d.ts +1 -1
- package/views/dist/controls/popover/looks.js +5 -0
- package/views/dist/controls/popover/tokens.d.ts +13 -1
- package/views/dist/controls/popover/tokens.js +4 -1
- package/views/dist/controls/popover.css +59 -8
- package/views/dist/controls/select/map-select.d.ts +1 -1
- package/views/dist/controls/select/map-select.js +4 -1
- package/views/dist/controls/select/select.d.ts +2 -0
- package/views/dist/controls/select/select.js +4 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -3
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +3 -1
- package/views/dist/controls/sort-editor/sort-editor.js +6 -4
- package/views/dist/controls/sort-editor.css +4 -2
- package/views/dist/controls/tag/tag.js +4 -2
- package/views/dist/controls/text-editor/map-text-body.js +4 -1
- package/views/dist/controls/text-editor/text-editor.js +2 -2
- package/views/dist/controls/text-editor/words.d.ts +3 -0
- package/views/dist/controls/text-editor/words.js +1 -1
- package/views/dist/controls/text-editor.css +6 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +12 -4
- package/views/dist/controls/toolbar/toolbar.js +7 -2
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +1 -1
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/tooltip/tokens.d.ts +1 -1
- package/views/dist/controls/tooltip/tokens.js +1 -1
- package/views/dist/controls/tooltip.css +5 -3
- package/views/dist/controls/values-editor.css +20 -5
- package/views/dist/controls/views-list/map-views-list-body.js +9 -1
- package/views/dist/controls/views-list/rules.d.ts +1 -0
- package/views/dist/controls/views-list/rules.js +2 -2
- package/views/dist/controls/views-list/view-menu.js +2 -2
- package/views/dist/controls/views-list/words.d.ts +4 -0
- package/views/dist/controls/views-list/words.js +2 -1
- package/views/dist/display/entity-chip.d.ts +7 -1
- package/views/dist/display/entity-chip.js +2 -1
- package/views/dist/display/option-badges.d.ts +3 -2
- package/views/dist/display/option-badges.js +2 -2
- package/views/dist/field-row/FieldRow.js +12 -8
- package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
- package/views/dist/grid/chrome/GridAddColumn.js +5 -4
- package/views/dist/grid/chrome/GridCellEditors.d.ts +4 -1
- package/views/dist/grid/chrome/GridCellEditors.js +3 -2
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -5
- package/views/dist/grid/chrome/GridCellOutline.js +3 -5
- package/views/dist/grid/chrome/GridChipsEditor.js +1 -1
- package/views/dist/grid/chrome/GridDateEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridDateEditor.js +1 -1
- package/views/dist/grid/chrome/GridHeader.js +3 -1
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridLongTextEditor.js +8 -5
- package/views/dist/grid/chrome/GridNameEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNameEditor.js +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridPlaceEditor.js +1 -1
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +2 -2
- package/views/dist/grid/chrome/GridRangeEditor.js +1 -1
- package/views/dist/grid/chrome/GridRelationEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +7 -1
- package/views/dist/grid/chrome/GridRowCells.js +6 -5
- package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
- package/views/dist/grid/chrome/GridTable.d.ts +2 -1
- package/views/dist/grid/chrome/GridTable.js +7 -2
- package/views/dist/grid/chrome/GridTableSurface.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/GridValueListEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridValueListEditor.js +1 -1
- package/views/dist/grid/chrome/grid-body-place.d.ts +7 -2
- package/views/dist/grid/chrome/grid-body-place.js +8 -4
- package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
- package/views/dist/grid/chrome/grid-edit-session.d.ts +4 -0
- package/views/dist/grid/chrome/grid-edit-session.js +10 -1
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +10 -0
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +9 -6
- package/views/dist/grid/chrome/grid-fitted-box.js +15 -7
- package/views/dist/grid/chrome/grid-hover.d.ts +3 -3
- package/views/dist/grid/chrome/grid-hover.js +2 -3
- package/views/dist/grid/chrome/grid-row-props.d.ts +6 -2
- package/views/dist/grid/chrome/grid-styles.d.ts +1 -5
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +0 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +2 -10
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
- package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +24 -1
- package/views/dist/grid/core/useGridEditing.d.ts +3 -0
- package/views/dist/grid/core/useGridEditing.js +2 -0
- package/views/dist/grid/grid-format-props.d.ts +1 -1
- package/views/dist/grid/grid-format-props.js +18 -5
- package/views/dist/grid/grid.css +9 -20
- package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
- package/views/dist/grid/useGridTableSettings.d.ts +1 -1
- package/views/dist/internal/screen-forms.d.ts +11 -0
- package/views/dist/internal/screen-forms.js +31 -0
- package/views/dist/list/list.js +4 -3
- package/views/dist/list/menu.d.ts +5 -4
- package/views/dist/list/parts.d.ts +8 -2
- package/views/dist/list/parts.js +31 -7
- package/views/dist/list/toolbar.js +11 -5
- package/views/dist/looks/index.d.ts +1 -0
- package/views/dist/looks/index.js +1 -0
- package/views/dist/panels/customize-body.d.ts +1 -1
- package/views/dist/panels/customize-body.js +8 -1
- package/views/dist/panels/model.d.ts +5 -0
- package/views/dist/panels/react/customize-body.js +11 -2
- package/views/dist/panels/react/customize.d.ts +3 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
- package/views/dist/panels/react/filter/filter-body.js +3 -1
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-part-body.js +2 -2
- package/views/dist/panels/react/popover.d.ts +3 -1
- package/views/dist/panels/react/popover.js +2 -2
- package/views/dist/panels/react/sort/SortEditor.js +3 -1
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +15 -4
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +5 -1
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarButton.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +28 -20
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/context.d.ts +3 -2
- package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
- package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +26 -11
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
- package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +7 -10
- package/views/dist/panels/react/views-row/more-views.d.ts +2 -0
- package/views/dist/panels/react/views-row/more-views.js +3 -0
- package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
- package/views/dist/panels/react/views-row/new-view.js +21 -0
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/toolbar/model.d.ts +2 -2
- package/views/dist/provider/components.d.ts +88 -8
- package/views/dist/provider/desktop.d.ts +2 -1
- package/views/dist/provider/desktop.js +5 -2
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +198 -84
- package/views/dist/styles.unlayered.css +198 -84
- package/views/docs/contract.md +87 -32
- package/views/docs/controls/list.md +2 -0
- package/views/docs/controls/menu.md +2 -0
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/popover.md +7 -0
- package/views/docs/controls/tooltip.md +2 -0
- package/views/docs/guides/atoms.md +11 -10
- package/views/docs/guides/the-grid.md +7 -5
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/reference/controls.md +24 -18
- package/views/docs/reference/display.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +4 -4
- package/views/docs/reference/list.md +30 -11
- package/views/docs/reference/looks.md +4 -1
- package/views/docs/reference/panels-react.md +7 -6
- package/views/docs/reference/panels.md +2 -2
- package/views/docs/reference/react.md +22 -10
- package/views/docs/reference/views.md +2 -2
- package/views/docs/reshaping.md +2 -2
- package/views/skills/views/SKILL.md +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DateNames, type DatePick } from "./calendar.js";
|
|
3
|
+
import type { DateEditorProps } from "./date-editor.js";
|
|
4
|
+
import { type DateEditorWords } from "./words.js";
|
|
5
|
+
/** What the behaviour is handed: the Date editor's props that say how it behaves, and how its line reads. */
|
|
6
|
+
export type DateEditorBehaviourProps = Pick<DateEditorProps, "value" | "onValueChange" | "onDone" | "time" | "empty" | "days" | "picks" | "today" | "typed" | "autoFocus" | "form" | "draft" | "words" | "language"> & {
|
|
7
|
+
/** The line: `box` stands empty at rest, nothing typed in it nothing at all (the default; Attio's, and every phone's);
|
|
8
|
+
* `written` writes the day held out, the first key typed or a delete starting over in its place (Mihai's line). */
|
|
9
|
+
line?: "box" | "written";
|
|
10
|
+
};
|
|
11
|
+
/** The element that holds it: a press elsewhere keeps (own draft, computer), Escape keeps and closes (own draft,
|
|
12
|
+
* computer), and on a phone, taken off the page and back, it starts over on what it is handed then. */
|
|
13
|
+
export interface DateEditorRootProps {
|
|
14
|
+
ref: (el: HTMLElement | null) => void;
|
|
15
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
16
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
17
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
18
|
+
}
|
|
19
|
+
/** The line a date is typed into: its text, its refusal, its keys (Enter keeps and closes; on a written line the first
|
|
20
|
+
* key starts over), and on a computer the focus as it opens, the caret after a seed. */
|
|
21
|
+
export interface DateEditorLineProps {
|
|
22
|
+
ref: (el: HTMLInputElement | null) => void;
|
|
23
|
+
value: string;
|
|
24
|
+
"aria-invalid"?: true;
|
|
25
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
26
|
+
onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
27
|
+
onBeforeInput?: React.FormEventHandler<HTMLInputElement>;
|
|
28
|
+
}
|
|
29
|
+
export interface DateEditorBehaviour {
|
|
30
|
+
/** It behaves as a phone's: a day pressed never closes, and ✓ and ✕ are the closes. */
|
|
31
|
+
phone: boolean;
|
|
32
|
+
today: string;
|
|
33
|
+
/** What it holds: the day ("2026-11-12") and the time ("14:30"), each or null. */
|
|
34
|
+
date: string | null;
|
|
35
|
+
clock: string | null;
|
|
36
|
+
/** What is typed in the line, null when nothing is. */
|
|
37
|
+
typed: string | null;
|
|
38
|
+
/** The day the line reads as, while it reads as one. */
|
|
39
|
+
reads: string | null;
|
|
40
|
+
/** Why the line is refused, in its words, or null. */
|
|
41
|
+
error: string | null;
|
|
42
|
+
/** The day the keys stand on, the month shown being its month: the day the line reads while it reads. */
|
|
43
|
+
keyDay: string;
|
|
44
|
+
/** Its quick picks in order, each with its day from today (null for No date) and its word. */
|
|
45
|
+
picks: {
|
|
46
|
+
key: DatePick;
|
|
47
|
+
day: string | null;
|
|
48
|
+
word: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Its words, the English under those handed, and its month and weekday names. */
|
|
51
|
+
words: DateEditorWords;
|
|
52
|
+
names: DateNames;
|
|
53
|
+
/** A day the field can't take (`days`). */
|
|
54
|
+
off: (day: string) => boolean;
|
|
55
|
+
/** A day or a quick pick pressed (null: No date): on a computer a date keeps and closes, a date and time stays open;
|
|
56
|
+
* No date closes; on a phone nothing closes. */
|
|
57
|
+
pick: (day: string | null) => void;
|
|
58
|
+
/** Enter on a day: as `pick`, then on a phone or a date and time it keeps that day and closes. */
|
|
59
|
+
enterDay: (day: string) => void;
|
|
60
|
+
/** The keys' day moved (an arrow, a month or a year shown); nothing is picked. */
|
|
61
|
+
moveKey: (day: string) => void;
|
|
62
|
+
/** The month shown moved by n months. */
|
|
63
|
+
moveMonth: (n: number) => void;
|
|
64
|
+
/** The line's text set (null: nothing typed); a refusal shown clears; held, it is handed once it reads. */
|
|
65
|
+
type: (text: string | null) => void;
|
|
66
|
+
/** A day set in parts: held and handed, nothing closes. */
|
|
67
|
+
setDay: (day: string) => void;
|
|
68
|
+
/** The time set (null: none); handed with the day the line means. */
|
|
69
|
+
setTime: (time: string | null) => void;
|
|
70
|
+
/** ✓ or Enter: what is typed taken first, then kept and closed; a line that isn't a date stays open, refused. */
|
|
71
|
+
keep: () => void;
|
|
72
|
+
/** ✕: nothing kept, it starts over on what it was handed, and closes. */
|
|
73
|
+
leave: () => void;
|
|
74
|
+
root: DateEditorRootProps;
|
|
75
|
+
line: DateEditorLineProps;
|
|
76
|
+
}
|
|
77
|
+
/** The Date editor's behaviour, with no drawing: what an app's own date body or editor is drawn on. */
|
|
78
|
+
export declare function useDateEditorBehaviour(props: DateEditorBehaviourProps): DateEditorBehaviour;
|
|
79
|
+
/** The behaviour, and for ViewKit's own drawing what it puts back as it starts over (its views and wheels). */
|
|
80
|
+
export declare function useDateBehaviour(props: DateEditorBehaviourProps, startOver?: () => void): DateEditorBehaviour;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
4
|
+
import { addMonths, dateNames, lineDay, lineText, quickPick, readDate, todayOf } from "./calendar.js";
|
|
5
|
+
import { dateWords } from "./words.js";
|
|
6
|
+
const PICK_WORD = { today: "today", tomorrow: "tomorrow", "next-week": "nextWeek", "in-a-week": "inAWeek", "next-monday": "nextMonday", none: "none" };
|
|
7
|
+
export function useDateEditorBehaviour(props) {
|
|
8
|
+
return useDateBehaviour(props);
|
|
9
|
+
}
|
|
10
|
+
export function useDateBehaviour(props, startOver) {
|
|
11
|
+
const { value, onValueChange, onDone, time = false, empty = false, days = "any", autoFocus = true } = props;
|
|
12
|
+
const w = dateWords(props.words), names = dateNames(props.language);
|
|
13
|
+
const host = React.useContext(PhoneHost), small = usePhone(), phone = (props.form ?? (host || small ? "phone" : "computer")) === "phone";
|
|
14
|
+
const phoneNow = React.useRef(phone);
|
|
15
|
+
React.useLayoutEffect(() => { phoneNow.current = phone; }, [phone]);
|
|
16
|
+
const today = props.today ?? todayOf();
|
|
17
|
+
const picks = props.picks ?? ["today", "tomorrow", "next-week", ...(empty ? ["none"] : [])];
|
|
18
|
+
const [date, setDate] = React.useState(value ? value.slice(0, 10) : null);
|
|
19
|
+
const [clock, setClock] = React.useState(value && value.length > 10 ? value.slice(11, 16) : null);
|
|
20
|
+
const [key, setKey] = React.useState(date ?? today);
|
|
21
|
+
const [typed, setTyped] = React.useState(props.typed ?? null);
|
|
22
|
+
const [error, setError] = React.useState(() => { const r = props.typed != null && props.typed.length > 1 ? readDate(props.typed, today, names, w) : null; return r && "error" in r ? r.error : null; });
|
|
23
|
+
const settled = React.useRef(false), line = React.useRef(null);
|
|
24
|
+
const off = (day) => (days === "from-today" && day < today) || (days === "until-today" && day > today);
|
|
25
|
+
const reading = typed != null ? readDate(typed, today, names, w) : null;
|
|
26
|
+
const written = props.line === "written";
|
|
27
|
+
const blank = (t) => t == null || (!written && !t.trim());
|
|
28
|
+
const clears = empty && written;
|
|
29
|
+
const valueOf = (d, t) => (d ? (time && t ? `${d}T${t}` : d) : null);
|
|
30
|
+
const shell = props.draft === "shell";
|
|
31
|
+
const handed = React.useRef(value);
|
|
32
|
+
const hand = (d, t) => {
|
|
33
|
+
if (!shell)
|
|
34
|
+
return;
|
|
35
|
+
const next = valueOf(d, t);
|
|
36
|
+
if (next === handed.current)
|
|
37
|
+
return;
|
|
38
|
+
handed.current = next;
|
|
39
|
+
onValueChange(next);
|
|
40
|
+
};
|
|
41
|
+
const dayOfLine = () => lineDay(typed, date, today, clears, names);
|
|
42
|
+
const handTyped = (text) => { if (shell)
|
|
43
|
+
hand(lineDay(text, date, today, clears, names), clock); };
|
|
44
|
+
const setTime = (t) => { setClock(t); hand(dayOfLine(), t); };
|
|
45
|
+
const settle = (d = date, t = clock) => {
|
|
46
|
+
settled.current = true;
|
|
47
|
+
if (shell) {
|
|
48
|
+
hand(d, t);
|
|
49
|
+
onDone?.();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const next = valueOf(d, t);
|
|
53
|
+
if (next !== value)
|
|
54
|
+
onValueChange(next);
|
|
55
|
+
onDone?.();
|
|
56
|
+
};
|
|
57
|
+
const leave = () => { settled.current = true; reset(); onDone?.(); };
|
|
58
|
+
function reset() { const v = value; setDate(v ? v.slice(0, 10) : null); setClock(v && v.length > 10 ? v.slice(11, 16) : null); setKey(v ? v.slice(0, 10) : today); setTyped(null); setError(null); startOver?.(); }
|
|
59
|
+
const [placed, setPlaced] = React.useState(null), left = React.useRef(false);
|
|
60
|
+
const rootRef = React.useCallback((el) => {
|
|
61
|
+
if (!phoneNow.current)
|
|
62
|
+
return;
|
|
63
|
+
setPlaced(el);
|
|
64
|
+
if (!el) {
|
|
65
|
+
left.current = true;
|
|
66
|
+
settled.current = false;
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
React.useLayoutEffect(() => {
|
|
70
|
+
if (!placed || !left.current || !phone)
|
|
71
|
+
return;
|
|
72
|
+
left.current = false;
|
|
73
|
+
reset();
|
|
74
|
+
}, [placed]);
|
|
75
|
+
const focusOnce = React.useRef(autoFocus);
|
|
76
|
+
const seeded = React.useRef(props.typed != null);
|
|
77
|
+
const lineRef = React.useCallback((el) => {
|
|
78
|
+
line.current = el;
|
|
79
|
+
if (!phoneNow.current && el && focusOnce.current) {
|
|
80
|
+
focusOnce.current = false;
|
|
81
|
+
requestAnimationFrame(() => {
|
|
82
|
+
const to = el.isConnected ? el : line.current;
|
|
83
|
+
to?.focus({ preventScroll: true });
|
|
84
|
+
if (seeded.current && to instanceof HTMLInputElement)
|
|
85
|
+
to.setSelectionRange(to.value.length, to.value.length);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}, []);
|
|
89
|
+
const pick = (day) => {
|
|
90
|
+
setDate(day);
|
|
91
|
+
setTyped(null);
|
|
92
|
+
setError(null);
|
|
93
|
+
hand(day, clock);
|
|
94
|
+
if (day)
|
|
95
|
+
setKey(day);
|
|
96
|
+
if (!phone && (!time || day === null))
|
|
97
|
+
settle(day, clock);
|
|
98
|
+
};
|
|
99
|
+
const take = () => {
|
|
100
|
+
if (typed == null)
|
|
101
|
+
return true;
|
|
102
|
+
if (!typed.trim()) {
|
|
103
|
+
setTyped(null);
|
|
104
|
+
if (clears) {
|
|
105
|
+
setDate(null);
|
|
106
|
+
hand(null, clock);
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
if (reading && "date" in reading) {
|
|
111
|
+
setDate(reading.date);
|
|
112
|
+
setKey(reading.date);
|
|
113
|
+
setTyped(null);
|
|
114
|
+
setError(null);
|
|
115
|
+
hand(reading.date, clock);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
setError(reading && "error" in reading ? reading.error : null);
|
|
119
|
+
return false;
|
|
120
|
+
};
|
|
121
|
+
const keep = () => { if (take())
|
|
122
|
+
settle(dayOfLine(), clock); };
|
|
123
|
+
const type = (text) => { setTyped(text); setError(null); if (text != null)
|
|
124
|
+
handTyped(text); };
|
|
125
|
+
const reads = reading && "date" in reading ? reading.date : null;
|
|
126
|
+
const keyDay = reads ?? key;
|
|
127
|
+
const onBlur = (e) => {
|
|
128
|
+
if (shell || settled.current || (e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget)))
|
|
129
|
+
return;
|
|
130
|
+
keep();
|
|
131
|
+
};
|
|
132
|
+
const onEscape = (e) => { if (e.key === "Escape") {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
e.stopPropagation();
|
|
135
|
+
settle(dayOfLine(), clock);
|
|
136
|
+
} };
|
|
137
|
+
const lineKeys = (e) => {
|
|
138
|
+
if (e.key !== "Enter" || e.nativeEvent.isComposing)
|
|
139
|
+
return;
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
if (blank(typed)) {
|
|
142
|
+
setTyped(null);
|
|
143
|
+
settle();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
keep();
|
|
147
|
+
};
|
|
148
|
+
const lineKeyDown = written
|
|
149
|
+
? (e) => { if (typed == null && (e.key === "Backspace" || e.key === "Delete")) {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
type("");
|
|
152
|
+
return;
|
|
153
|
+
} lineKeys(e); }
|
|
154
|
+
: phone
|
|
155
|
+
? (e) => { if (e.key !== "Enter" || e.nativeEvent.isComposing)
|
|
156
|
+
return; e.preventDefault(); keep(); }
|
|
157
|
+
: (e) => { if (blank(typed) && (e.key === "Backspace" || e.key === "Delete")) {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
return;
|
|
160
|
+
} lineKeys(e); };
|
|
161
|
+
return {
|
|
162
|
+
phone, today, date, clock, typed, reads, error, keyDay,
|
|
163
|
+
picks: picks.map((p) => ({ key: p, day: p === "none" ? null : quickPick(p, today), word: w[PICK_WORD[p]] })),
|
|
164
|
+
words: w, names, off, pick,
|
|
165
|
+
enterDay: (day) => { pick(day); if (phone || time)
|
|
166
|
+
settle(day, clock); },
|
|
167
|
+
moveKey: setKey,
|
|
168
|
+
moveMonth: (n) => setKey(addMonths(keyDay, n)),
|
|
169
|
+
type,
|
|
170
|
+
setDay: (d) => { setDate(d); setKey(d); hand(d, clock); },
|
|
171
|
+
setTime, keep, leave,
|
|
172
|
+
root: phone
|
|
173
|
+
? { ref: rootRef }
|
|
174
|
+
: { ref: rootRef, onBlur, onFocus: () => { settled.current = false; }, onKeyDown: shell ? undefined : onEscape },
|
|
175
|
+
line: {
|
|
176
|
+
ref: lineRef,
|
|
177
|
+
value: written ? (typed ?? (date ? lineText(date, names) : "")) : (typed ?? ""),
|
|
178
|
+
"aria-invalid": error ? true : undefined,
|
|
179
|
+
onChange: (e) => type(e.target.value),
|
|
180
|
+
onKeyDown: lineKeyDown,
|
|
181
|
+
onBeforeInput: written ? (e) => { if (typed == null) {
|
|
182
|
+
e.preventDefault();
|
|
183
|
+
type(e.nativeEvent.data ?? "");
|
|
184
|
+
} } : undefined,
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
3
3
|
import { type DatePick } from "./calendar.js";
|
|
4
4
|
import { type DateEditorWorn } from "./looks.js";
|
|
5
|
-
import {
|
|
5
|
+
import type { DateEditorWords } from "./words.js";
|
|
6
6
|
export type { DatePick } from "./calendar.js";
|
|
7
7
|
export interface DateEditorProps {
|
|
8
8
|
/** The field's name: the Sheet's title, and the days' name to a screen reader. */
|
|
@@ -62,7 +62,8 @@ export declare const LEFT: string[], RIGHT: string[];
|
|
|
62
62
|
/** The options worn round an element: a ref callback and what it wears, Attio's before it stands, read again as Tweaks
|
|
63
63
|
* change them (a MutationObserver on the six data-date-editor-* attributes, as the Picker reads its own); `given` wins. */
|
|
64
64
|
export declare function useDateEditorWorn(given?: Partial<DateEditorWorn>): [(el: Element | null) => void, DateEditorWorn];
|
|
65
|
-
/** The Date editor's state and the parts a shell pours in.
|
|
65
|
+
/** The Date editor's state and the parts a shell pours in: drawn on its behaviour (date-behaviour.ts), which an app's own
|
|
66
|
+
* piece may be drawn on too. */
|
|
66
67
|
export declare function useDateEditor(props: DateEditorProps): DateEditorParts;
|
|
67
68
|
/** The body alone, for a shell that holds only a body (the Popover). */
|
|
68
69
|
export declare function DateEditor(props: DateEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,19 +8,18 @@ import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
|
|
|
8
8
|
import { scrollInList } from "../internal/scroll.js";
|
|
9
9
|
import { MenuListRow } from "../menu-list/menu-list.js";
|
|
10
10
|
import { SheetButton } from "../sheet/bottom-sheet.js";
|
|
11
|
-
import { addMonths,
|
|
11
|
+
import { addMonths, lineText, parts, QUARTERS } from "./calendar.js";
|
|
12
12
|
import { DateDays } from "./date-days.js";
|
|
13
13
|
import { DateParts } from "./date-parts.js";
|
|
14
14
|
import { DATE_EDITOR_ATTIO, DATE_EDITOR_ATTRS, DATE_EDITOR_LOOKS, dateEditorWornOf } from "./looks.js";
|
|
15
15
|
import { yearTyped } from "./segments.js";
|
|
16
|
-
import {
|
|
16
|
+
import { useDateBehaviour } from "./date-behaviour.js";
|
|
17
17
|
export const glyph = (paths, className) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
18
18
|
const CAL = ["M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z", "M16 3v4", "M8 3v4", "M4 11h16"];
|
|
19
19
|
const CLOCK = ["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 7v5l3 3"];
|
|
20
20
|
export const LEFT = ["M15 6l-6 6l6 6"], RIGHT = ["M9 6l6 6l-6 6"];
|
|
21
21
|
const DOWN = ["M6 9l6 6l6 -6"], X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"];
|
|
22
22
|
const CAL_WEEK = [...CAL, "M8 15h8"];
|
|
23
|
-
const PICK_WORD = { today: "today", tomorrow: "tomorrow", "next-week": "nextWeek", "in-a-week": "inAWeek", "next-monday": "nextMonday", none: "none" };
|
|
24
23
|
const PICKS = {
|
|
25
24
|
today: { icon: [...CAL, "M8 15h2v2h-2z"] },
|
|
26
25
|
tomorrow: { icon: ["M5 12h14", "M13 18l6 -6", "M13 6l6 6"] },
|
|
@@ -75,165 +74,48 @@ const wheelOf = (opens) => (opens === "years" || opens === "months" ? "date" : o
|
|
|
75
74
|
export function useDateEditor(props) {
|
|
76
75
|
const { Button, Input, Calendar } = usePanelControls();
|
|
77
76
|
const [wornRef, worn] = useDateEditorWorn(props.worn);
|
|
78
|
-
const
|
|
79
|
-
const root = React.useRef(null);
|
|
80
|
-
const rootRef = React.useCallback((el) => { root.current = el; wornRef(el); }, [wornRef]);
|
|
81
|
-
const { label, value, onValueChange, onDone, time = false, empty = false, days = "any", autoFocus = true } = props;
|
|
77
|
+
const { label } = props;
|
|
82
78
|
const host = React.useContext(PhoneHost), small = usePhone(), phone = (props.form ?? (host || small ? "phone" : "computer")) === "phone";
|
|
83
|
-
const
|
|
84
|
-
const picks = props.picks ?? ["today", "tomorrow", "next-week", ...(empty ? ["none"] : [])];
|
|
85
|
-
const [date, setDate] = React.useState(value ? value.slice(0, 10) : null);
|
|
86
|
-
const [clock, setClock] = React.useState(value && value.length > 10 ? value.slice(11, 16) : null);
|
|
87
|
-
const [key, setKey] = React.useState(date ?? today), [view, setView] = React.useState(viewOf(props.opens));
|
|
88
|
-
const [typed, setTyped] = React.useState(props.typed ?? null);
|
|
89
|
-
const [error, setError] = React.useState(() => { const r = props.typed != null && props.typed.length > 1 ? readDate(props.typed, today, names, w) : null; return r && "error" in r ? r.error : null; });
|
|
79
|
+
const [view, setView] = React.useState(viewOf(props.opens));
|
|
90
80
|
const [wheel, setWheel] = React.useState(wheelOf(props.opens));
|
|
91
|
-
const settled = React.useRef(false), line = React.useRef(null);
|
|
92
|
-
const off = (day) => (days === "from-today" && day < today) || (days === "until-today" && day > today);
|
|
93
|
-
const reading = typed != null ? readDate(typed, today, names, w) : null;
|
|
94
81
|
const lineBox = phone ? worn.calendar === "plain" : worn.line === "box";
|
|
95
|
-
const
|
|
96
|
-
const
|
|
82
|
+
const b = useDateBehaviour({ ...props, line: lineBox ? "box" : "written" }, () => { setView(viewOf(props.opens)); setWheel(wheelOf(props.opens)); });
|
|
83
|
+
const { date, clock, error, today, words: w, names } = b;
|
|
84
|
+
const time = props.time ?? false;
|
|
97
85
|
const inParts = time && worn.time === "parts";
|
|
98
86
|
const [yearText, setYearText] = React.useState(null), yearFocus = React.useRef(false);
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const next = valueOf(d, t);
|
|
106
|
-
if (next === handed.current)
|
|
107
|
-
return;
|
|
108
|
-
handed.current = next;
|
|
109
|
-
onValueChange(next);
|
|
110
|
-
};
|
|
111
|
-
const dayOfLine = () => lineDay(typed, date, today, clears, names);
|
|
112
|
-
const handTyped = (text) => { if (shell)
|
|
113
|
-
hand(lineDay(text, date, today, clears, names), clock); };
|
|
114
|
-
const setTime = (t) => { setClock(t); hand(dayOfLine(), t); };
|
|
115
|
-
const keep = (d = date, t = clock) => {
|
|
116
|
-
settled.current = true;
|
|
117
|
-
if (shell) {
|
|
118
|
-
hand(d, t);
|
|
119
|
-
onDone?.();
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const next = valueOf(d, t);
|
|
123
|
-
if (next !== value)
|
|
124
|
-
onValueChange(next);
|
|
125
|
-
onDone?.();
|
|
126
|
-
};
|
|
127
|
-
const leave = () => { settled.current = true; reset(); onDone?.(); };
|
|
128
|
-
function reset() { const v = value; setDate(v ? v.slice(0, 10) : null); setClock(v && v.length > 10 ? v.slice(11, 16) : null); setKey(v ? v.slice(0, 10) : today); setTyped(null); setError(null); setView(viewOf(props.opens)); setWheel(wheelOf(props.opens)); }
|
|
129
|
-
const [placed, setPlaced] = React.useState(null), left = React.useRef(false);
|
|
130
|
-
const placeRoot = React.useCallback((el) => { wornRef(el); setPlaced(el); if (!el) {
|
|
131
|
-
left.current = true;
|
|
132
|
-
settled.current = false;
|
|
133
|
-
} }, [wornRef]);
|
|
134
|
-
React.useLayoutEffect(() => {
|
|
135
|
-
if (!placed || !left.current)
|
|
136
|
-
return;
|
|
137
|
-
left.current = false;
|
|
138
|
-
reset();
|
|
139
|
-
}, [placed]);
|
|
140
|
-
const focusOnce = React.useRef(autoFocus);
|
|
141
|
-
const seeded = React.useRef(props.typed != null);
|
|
142
|
-
const first = React.useCallback((el) => {
|
|
143
|
-
if (!el || !focusOnce.current)
|
|
144
|
-
return;
|
|
145
|
-
focusOnce.current = false;
|
|
146
|
-
requestAnimationFrame(() => {
|
|
147
|
-
const to = el.isConnected ? el : root.current?.querySelector(".o-date-editor-input");
|
|
148
|
-
to?.focus({ preventScroll: true });
|
|
149
|
-
if (seeded.current && to instanceof HTMLInputElement)
|
|
150
|
-
to.setSelectionRange(to.value.length, to.value.length);
|
|
151
|
-
});
|
|
152
|
-
}, []);
|
|
153
|
-
const lineRef = React.useCallback((el) => { line.current = el; first(el); }, [first]);
|
|
154
|
-
const pick = (day) => {
|
|
155
|
-
setDate(day);
|
|
156
|
-
setTyped(null);
|
|
157
|
-
setError(null);
|
|
158
|
-
hand(day, clock);
|
|
159
|
-
if (day)
|
|
160
|
-
setKey(day);
|
|
161
|
-
if (!phone && (!time || day === null))
|
|
162
|
-
keep(day, clock);
|
|
163
|
-
};
|
|
164
|
-
const take = () => {
|
|
165
|
-
if (typed == null)
|
|
166
|
-
return true;
|
|
167
|
-
if (!typed.trim()) {
|
|
168
|
-
setTyped(null);
|
|
169
|
-
if (clears) {
|
|
170
|
-
setDate(null);
|
|
171
|
-
hand(null, clock);
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
if (reading && "date" in reading) {
|
|
176
|
-
setDate(reading.date);
|
|
177
|
-
setKey(reading.date);
|
|
178
|
-
setTyped(null);
|
|
179
|
-
setError(null);
|
|
180
|
-
hand(reading.date, clock);
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
setError(reading && "error" in reading ? reading.error : null);
|
|
184
|
-
return false;
|
|
185
|
-
};
|
|
186
|
-
const shownKey = reading && "date" in reading ? reading.date : key;
|
|
87
|
+
const root = React.useRef(null), line = React.useRef(null);
|
|
88
|
+
const bRoot = b.root.ref, bLine = b.line.ref;
|
|
89
|
+
const rootRef = React.useCallback((el) => { root.current = el; bRoot(el); wornRef(el); }, [bRoot, wornRef]);
|
|
90
|
+
const lineRef = React.useCallback((el) => { line.current = el; bLine(el); }, [bLine]);
|
|
91
|
+
const pick = b.pick, setTime = b.setTime, keep = b.keep;
|
|
92
|
+
const shownKey = b.keyDay;
|
|
187
93
|
const [sy, sm] = parts(shownKey);
|
|
188
|
-
const dayGrid = (big, weekdays) => (_jsx(DateDays, { year: sy, month: sm, keyDay: shownKey, picked: date, today: today, names: names, weekdays: weekdays, big: big, off: off, reads:
|
|
189
|
-
|
|
190
|
-
const calendar = Calendar && (_jsx(Calendar, { "data-slot": "vk-calendar", value: date, month: `${sy}-${String(sm + 1).padStart(2, "0")}`, locale: props.locale ?? props.language ?? "en", onMonthChange: (m) => setKey(`${m}-01`), onChange: (day) => { const to = day ?? date; if (to)
|
|
94
|
+
const dayGrid = (big, weekdays) => (_jsx(DateDays, { year: sy, month: sm, keyDay: shownKey, picked: date, today: today, names: names, weekdays: weekdays, big: big, off: b.off, reads: b.reads, onPick: pick, onKeyMove: b.moveKey, onEnter: b.enterDay }));
|
|
95
|
+
const calendar = Calendar && (_jsx(Calendar, { "data-slot": "vk-calendar", value: date, month: `${sy}-${String(sm + 1).padStart(2, "0")}`, locale: props.locale ?? props.language ?? "en", onMonthChange: (m) => b.moveKey(`${m}-01`), onChange: (day) => { const to = day ?? date; if (to)
|
|
191
96
|
pick(to); } }));
|
|
192
97
|
const row = phone ? worn.calendar === "plain" : worn.picks === "row";
|
|
193
|
-
const quick = (_jsx("div", { className: "o-date-editor-picks", "data-slot": "vk-date-picks", children: picks.map((p) => (_jsx(Button, { kind: "quiet", size: phone ? "lg" : row ? "2xs" : "sm", className: "o-date-editor-pick", "data-slot": "vk-date-pick", "data-key": p, look: phone ? (row ? PICK_PLAIN : PICK_CARDS) : row ? PICK_ROW : PICK_TWO, icon: glyph(row ? ROW_PICKS[p] : PICKS[p].icon), onClick: () => pick(
|
|
98
|
+
const quick = (_jsx("div", { className: "o-date-editor-picks", "data-slot": "vk-date-picks", children: b.picks.map(({ key: p, day, word }) => (_jsx(Button, { kind: "quiet", size: phone ? "lg" : row ? "2xs" : "sm", className: "o-date-editor-pick", "data-slot": "vk-date-pick", "data-key": p, look: phone ? (row ? PICK_PLAIN : PICK_CARDS) : row ? PICK_ROW : PICK_TWO, icon: glyph(row ? ROW_PICKS[p] : PICKS[p].icon), onClick: () => pick(day), children: word }, p))) }));
|
|
194
99
|
if (phone) {
|
|
195
100
|
const months = names.months.map((name, i) => ({ value: String(i), label: name }));
|
|
196
101
|
const years = Array.from({ length: 41 }, (_, i) => String(sy - 20 + i)).map((v) => ({ value: v, label: v }));
|
|
197
102
|
const hours = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, "0")).map((v) => ({ value: v, label: v }));
|
|
198
103
|
const mins = ["00", "15", "30", "45"].map((v) => ({ value: v, label: v }));
|
|
199
104
|
const [hh, mm] = (clock ?? "09:00").split(":");
|
|
200
|
-
const head = { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick:
|
|
201
|
-
|
|
202
|
-
const wheels = wheel === "date" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "month", label: w.month, items: months, value: String(sm), onChange: (v) => setKey(addMonths(shownKey, Number(v) - sm)) }, "month"), _jsx(Wheel, { name: "year", label: w.year, items: years, value: String(sy), onChange: (v) => setKey(addMonths(shownKey, (Number(v) - sy) * 12)) }, "year")] })) : wheel === "time" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "hour", label: w.hour, items: hours, value: hh, onChange: (v) => setTime(`${v}:${mm}`) }, "hour"), _jsx(Wheel, { name: "minute", label: w.minute, items: mins, value: mm, onChange: (v) => setTime(`${hh}:${v}`) }, "minute")] })) : null;
|
|
105
|
+
const head = { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: b.leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: keep }) };
|
|
106
|
+
const wheels = wheel === "date" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "month", label: w.month, items: months, value: String(sm), onChange: (v) => b.moveKey(addMonths(shownKey, Number(v) - sm)) }, "month"), _jsx(Wheel, { name: "year", label: w.year, items: years, value: String(sy), onChange: (v) => b.moveKey(addMonths(shownKey, (Number(v) - sy) * 12)) }, "year")] })) : wheel === "time" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "hour", label: w.hour, items: hours, value: hh, onChange: (v) => setTime(`${v}:${mm}`) }, "hour"), _jsx(Wheel, { name: "minute", label: w.minute, items: mins, value: mm, onChange: (v) => setTime(`${hh}:${v}`) }, "minute")] })) : null;
|
|
203
107
|
if (worn.calendar === "plain") {
|
|
204
108
|
const toggle = (w) => { if (w === "time" && !clock)
|
|
205
109
|
setTime("09:00"); setWheel(wheel === w ? "none" : w); };
|
|
206
|
-
const plain = (_jsxs("div", { ref:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
keep(dayOfLine(), clock); }, date: date, clock: clock, today: today, wheel: wheel, onWheel: calendar ? (which) => { if (which === "time")
|
|
210
|
-
toggle(which); } : toggle, onDate: (d) => { setDate(d); setKey(d); hand(d, clock); }, onClock: setTime }), quick] }));
|
|
211
|
-
return { body: plain, head: shell ? {} : head };
|
|
110
|
+
const plain = (_jsxs("div", { ...b.root, ref: rootRef, className: "o-date-editor", "data-slot": "vk-date", "data-kit": "date-editor", "data-date-form": "phone", ...phoneMark(!!host || small), ...wornAttrs(worn), children: [_jsxs(InputGroup, { size: "lg", className: "o-date-editor-line", "data-slot": "vk-date-line", "data-bad": error ? "" : undefined, children: [_jsx(Input, { ...b.line, ref: lineRef, className: "o-date-editor-input", "aria-label": label, placeholder: `${w.type}…`, autofill: false, spellCheck: false, enterKeyHint: "done" }), b.reads && _jsx(InputGroupAddon, { side: "end", children: _jsx("span", { className: "o-date-editor-reads", "data-slot": "vk-date-reads", children: lineText(b.reads, names) }) })] }), error && _jsx("p", { className: "o-date-editor-error", "data-slot": "vk-date-error", role: "alert", children: error }), !calendar && _jsxs("div", { className: "o-date-editor-head", "data-slot": "vk-date-head", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: "lg", "data-slot": "vk-date-prev", "aria-label": w.lastMonth, icon: glyph(LEFT), onClick: () => b.moveKey(addMonths(shownKey, -1)) }), _jsx(Button, { kind: "quiet", shape: "icon", size: "lg", "data-slot": "vk-date-next", "aria-label": w.nextMonth, icon: glyph(RIGHT), onClick: () => b.moveKey(addMonths(shownKey, 1)) }), _jsx(Button, { kind: "quiet", size: "lg", className: "o-date-editor-heading", "data-slot": "vk-date-month", look: PLAIN_HEADING, "aria-expanded": wheel === "date", onClick: () => toggle("date"), children: names.months[sm] }), _jsx(Button, { kind: "quiet", size: "lg", className: "o-date-editor-year", "data-slot": "vk-date-year", look: PLAIN_YEAR, "aria-expanded": wheel === "date", onClick: () => toggle("date"), children: String(sy) })] }), calendar ? (wheel === "time" ? wheels : calendar) : wheels ?? _jsx(_Fragment, { children: dayGrid(true, names.week) }), time && _jsx(DateParts, { form: "phone", words: w, onEnter: keep, date: date, clock: clock, today: today, wheel: wheel, onWheel: calendar ? (which) => { if (which === "time")
|
|
111
|
+
toggle(which); } : toggle, onDate: b.setDay, onClock: setTime }), quick] }));
|
|
112
|
+
return { body: plain, head: props.draft === "shell" ? {} : head };
|
|
212
113
|
}
|
|
213
|
-
const body = (_jsxs("div", { ref:
|
|
114
|
+
const body = (_jsxs("div", { ...b.root, ref: rootRef, className: "o-date-editor", "data-slot": "vk-date", "data-kit": "date-editor", "data-date-form": "phone", ...phoneMark(!!host || small), ...wornAttrs(worn), children: [_jsx("div", { className: "o-date-editor-card", "data-slot": "vk-date-card", "data-key": "date", children: calendar || _jsxs(_Fragment, { children: [_jsxs("div", { className: "o-date-editor-card-head", "data-slot": "vk-date-head", children: [_jsx(Button, { kind: "quiet", size: "lg", className: "o-date-editor-heading", "data-slot": "vk-date-month", look: CARD_HEADING, "aria-expanded": wheel === "date", iconEnd: glyph(wheel === "date" ? DOWN : RIGHT), onClick: () => setWheel(wheel === "date" ? "none" : "date"), children: `${names.months[sm]} ${sy}` }), wheel !== "date" && _jsxs("span", { className: "o-date-editor-arrows", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: "lg", "data-slot": "vk-date-prev", "aria-label": w.lastMonth, icon: glyph(LEFT), onClick: () => b.moveKey(addMonths(shownKey, -1)) }), _jsx(Button, { kind: "quiet", shape: "icon", size: "lg", "data-slot": "vk-date-next", "aria-label": w.nextMonth, icon: glyph(RIGHT), onClick: () => b.moveKey(addMonths(shownKey, 1)) })] })] }), wheel === "date" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "month", label: w.month, items: months, value: String(sm), onChange: (v) => b.moveKey(addMonths(shownKey, Number(v) - sm)) }, "month"), _jsx(Wheel, { name: "year", label: w.year, items: years, value: String(sy), onChange: (v) => b.moveKey(addMonths(shownKey, (Number(v) - sy) * 12)) }, "year")] })) : (_jsx(_Fragment, { children: dayGrid(true, names.weekUpper) }))] }) }), time && (_jsx("div", { className: "o-date-editor-card", "data-slot": "vk-date-card", "data-key": "time", children: wheel === "time" ? (_jsxs("div", { className: "o-date-editor-wheels", "data-slot": "vk-date-wheels", children: [_jsx(Wheel, { name: "hour", label: w.hour, items: hours, value: hh, onChange: (v) => setTime(`${v}:${mm}`) }, "hour"), _jsx(Wheel, { name: "minute", label: w.minute, items: mins, value: mm, onChange: (v) => setTime(`${hh}:${v}`) }, "minute")] })) : (_jsx(MenuListRow, { "data-slot": "vk-date-time", label: w.time, value: clock ?? w.addTime, onSelect: () => { if (!clock)
|
|
214
115
|
setTime("09:00"); setWheel("time"); } })) })), quick] }));
|
|
215
|
-
return { body, head: shell ? {} : head };
|
|
116
|
+
return { body, head: props.draft === "shell" ? {} : head };
|
|
216
117
|
}
|
|
217
|
-
const
|
|
218
|
-
if (shell || settled.current || (e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget)))
|
|
219
|
-
return;
|
|
220
|
-
if (take())
|
|
221
|
-
keep(dayOfLine(), clock);
|
|
222
|
-
};
|
|
223
|
-
const escape = () => keep(dayOfLine(), clock);
|
|
224
|
-
const lineKeys = (e) => {
|
|
225
|
-
if (e.key !== "Enter" || e.nativeEvent.isComposing)
|
|
226
|
-
return;
|
|
227
|
-
e.preventDefault();
|
|
228
|
-
if (blank(typed)) {
|
|
229
|
-
setTyped(null);
|
|
230
|
-
keep();
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
if (take())
|
|
234
|
-
keep(dayOfLine(), clock);
|
|
235
|
-
};
|
|
236
|
-
const moveMonth = (n) => setKey(addMonths(shownKey, n));
|
|
118
|
+
const moveMonth = b.moveMonth;
|
|
237
119
|
const hold = (e) => e.preventDefault();
|
|
238
120
|
const arrows = worn.days === "outlined" ? "2xs" : "xs";
|
|
239
121
|
const leaveYear = () => { if (document.activeElement?.closest(".o-date-editor-year-box"))
|
|
@@ -244,31 +126,13 @@ export function useDateEditor(props) {
|
|
|
244
126
|
el.select();
|
|
245
127
|
} };
|
|
246
128
|
const timeButton = _jsx(Button, { kind: "quiet", size: lineBox ? "2xs" : "xs", className: "o-date-editor-time", "data-slot": "vk-date-time", look: TIME, "aria-pressed": view === "time", "data-empty": clock ? undefined : "", icon: glyph(CLOCK), onClick: () => setView(view === "time" ? "days" : "time"), children: clock ?? w.addTime });
|
|
247
|
-
const boxLine = (_jsxs(InputGroup, { size: "sm", className: "o-date-editor-line", "data-slot": "vk-date-line", "data-bad": error ? "" : undefined, children: [_jsx(Input, { ref: lineRef, className: "o-date-editor-input", "aria-label": label, placeholder: `${w.type}…`, autofill: false, spellCheck: false,
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
return;
|
|
250
|
-
} lineKeys(e); } }), reading && "date" in reading && _jsx(InputGroupAddon, { side: "end", children: _jsx("span", { className: "o-date-editor-reads", "data-slot": "vk-date-reads", children: lineText(reading.date, names) }) }), time && !inParts && _jsx(InputGroupAddon, { side: "end", flush: true, children: timeButton })] }));
|
|
129
|
+
const boxLine = (_jsxs(InputGroup, { size: "sm", className: "o-date-editor-line", "data-slot": "vk-date-line", "data-bad": error ? "" : undefined, children: [_jsx(Input, { ...b.line, ref: lineRef, className: "o-date-editor-input", "aria-label": label, placeholder: `${w.type}…`, autofill: false, spellCheck: false }), b.reads && _jsx(InputGroupAddon, { side: "end", children: _jsx("span", { className: "o-date-editor-reads", "data-slot": "vk-date-reads", children: lineText(b.reads, names) }) }), time && !inParts && _jsx(InputGroupAddon, { side: "end", flush: true, children: timeButton })] }));
|
|
251
130
|
const shownView = calendar && (view === "months" || view === "years") ? "days" : view;
|
|
252
131
|
const daysShown = shownView === "days" || (inParts && shownView === "time");
|
|
253
132
|
const refocus = (sel) => requestAnimationFrame(() => root.current?.querySelector(sel)?.focus({ preventScroll: true }));
|
|
254
|
-
const body = (_jsxs("div", { ref: rootRef, className: "o-date-editor", "data-slot": "vk-date", "data-kit": "date-editor", "data-date-form": "computer", ...phoneMark(!!host || small), ...wornAttrs(worn),
|
|
255
|
-
e.preventDefault();
|
|
256
|
-
e.stopPropagation();
|
|
257
|
-
escape();
|
|
258
|
-
} }, children: [lineBox ? boxLine : _jsxs("div", { className: "o-date-editor-line o-popup-line", "data-slot": "vk-date-line", "data-bad": error ? "" : undefined, children: [glyph(CAL), _jsx(Input, { chrome: "bare", ref: (el) => { line.current = el; first(el); }, className: "o-date-editor-input", "aria-label": label, placeholder: w.type, autofill: false, spellCheck: false, "aria-invalid": error ? true : undefined, value: typed ?? (date ? lineText(date, names) : ""), onChange: (e) => { setTyped(e.target.value); setError(null); handTyped(e.target.value); }, onBeforeInput: (e) => { if (typed == null) {
|
|
259
|
-
e.preventDefault();
|
|
260
|
-
const d = e.nativeEvent.data ?? "";
|
|
261
|
-
setTyped(d);
|
|
262
|
-
setError(null);
|
|
263
|
-
handTyped(d);
|
|
264
|
-
} }, onKeyDown: (e) => { if (typed == null && (e.key === "Backspace" || e.key === "Delete")) {
|
|
265
|
-
e.preventDefault();
|
|
266
|
-
setTyped("");
|
|
267
|
-
handTyped("");
|
|
268
|
-
return;
|
|
269
|
-
} lineKeys(e); } }), reading && "date" in reading && _jsx("span", { className: "o-date-editor-reads", "data-slot": "vk-date-reads", children: lineText(reading.date, names) }), time && !inParts && _jsxs(_Fragment, { children: [_jsx("span", { className: "o-date-editor-bar", "aria-hidden": "true" }), timeButton] })] }), error && _jsx("p", { className: "o-date-editor-error", "data-slot": "vk-date-error", role: "alert", children: error }), calendar && daysShown ? calendar : _jsxs("div", { className: "o-date-editor-head", "data-slot": "vk-date-head", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: arrows, "data-slot": "vk-date-prev", "aria-label": w.lastMonth, icon: glyph(LEFT), onClick: () => moveMonth(-1) }), _jsx(Button, { kind: "quiet", shape: "icon", size: arrows, "data-slot": "vk-date-next", "aria-label": w.nextMonth, icon: glyph(RIGHT), onClick: () => moveMonth(1) }), !calendar && _jsx(Button, { kind: "quiet", size: "xs", className: "o-date-editor-month", "data-slot": "vk-date-month", look: STANDS_PRESSED, "aria-pressed": view === "months", onClick: () => setView(view === "months" ? "days" : "months"), children: names.months[sm] }), _jsx("span", { className: "o-date-editor-space" }), calendar ? null : worn.year === "typed" && view === "years"
|
|
133
|
+
const body = (_jsxs("div", { ...b.root, ref: rootRef, className: "o-date-editor", "data-slot": "vk-date", "data-kit": "date-editor", "data-date-form": "computer", ...phoneMark(!!host || small), ...wornAttrs(worn), children: [lineBox ? boxLine : _jsxs("div", { className: "o-date-editor-line o-popup-line", "data-slot": "vk-date-line", "data-bad": error ? "" : undefined, children: [glyph(CAL), _jsx(Input, { chrome: "bare", ...b.line, ref: lineRef, className: "o-date-editor-input", "aria-label": label, placeholder: w.type, autofill: false, spellCheck: false }), b.reads && _jsx("span", { className: "o-date-editor-reads", "data-slot": "vk-date-reads", children: lineText(b.reads, names) }), time && !inParts && _jsxs(_Fragment, { children: [_jsx("span", { className: "o-date-editor-bar", "aria-hidden": "true" }), timeButton] })] }), error && _jsx("p", { className: "o-date-editor-error", "data-slot": "vk-date-error", role: "alert", children: error }), calendar && daysShown ? calendar : _jsxs("div", { className: "o-date-editor-head", "data-slot": "vk-date-head", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: arrows, "data-slot": "vk-date-prev", "aria-label": w.lastMonth, icon: glyph(LEFT), onClick: () => moveMonth(-1) }), _jsx(Button, { kind: "quiet", shape: "icon", size: arrows, "data-slot": "vk-date-next", "aria-label": w.nextMonth, icon: glyph(RIGHT), onClick: () => moveMonth(1) }), !calendar && _jsx(Button, { kind: "quiet", size: "xs", className: "o-date-editor-month", "data-slot": "vk-date-month", look: STANDS_PRESSED, "aria-pressed": view === "months", onClick: () => setView(view === "months" ? "days" : "months"), children: names.months[sm] }), _jsx("span", { className: "o-date-editor-space" }), calendar ? null : worn.year === "typed" && view === "years"
|
|
270
134
|
? _jsx(Input, { ref: yearRef, size: "xs", numeric: true, className: "o-date-editor-year-box", "data-slot": "vk-date-year", "aria-label": w.year, inputMode: "numeric", maxLength: 4, autofill: false, value: yearText ?? String(sy), onChange: (e) => { const t = e.target.value.replace(/\D/g, "").slice(0, 4), yr = yearTyped(t); setYearText(t); if (yr)
|
|
271
|
-
|
|
135
|
+
b.moveKey(addMonths(shownKey, (yr - sy) * 12)); }, onKeyDown: (e) => { if (e.key === "Enter") {
|
|
272
136
|
e.preventDefault();
|
|
273
137
|
leaveYear();
|
|
274
138
|
setYearText(null);
|
|
@@ -278,9 +142,8 @@ export function useDateEditor(props) {
|
|
|
278
142
|
: _jsx(Button, { kind: "quiet", size: "xs", className: "o-date-editor-year", "data-slot": "vk-date-year", look: STANDS_PRESSED, "aria-pressed": view === "years", onMouseDown: worn.year === "typed" ? hold : undefined, onClick: () => { if (view !== "years") {
|
|
279
143
|
setYearText(null);
|
|
280
144
|
yearFocus.current = worn.year === "typed";
|
|
281
|
-
} setView(view === "years" ? "days" : "years"); }, children: String(sy) })] }), !calendar && daysShown && _jsx(_Fragment, { children: dayGrid(false, names.week) }), shownView === "months" && (_jsx("div", { className: "o-date-editor-choices", "data-slot": "vk-date-choices", "data-key": "months", role: "group", "aria-label": w.months, children: names.monthsShort.map((name, i) => _jsx("button", { type: "button", className: "o-date-editor-choice", "data-slot": "vk-date-choice", "data-key": String(i), onMouseDown: hold, "data-picked": i === sm ? "" : undefined, onClick: () => {
|
|
282
|
-
scrollInList(el, { block: "center" }); } : undefined, onClick: () => { setTime(q); setView("days"); refocus(".o-date-editor-time"); }, children: q }, q)) })), inParts && _jsx(DateParts, { form: "computer", words: w, onEnter: () => {
|
|
283
|
-
keep(dayOfLine(), clock); }, date: date, clock: clock, today: today, shownTyping: props.opens === "time", onDate: (d) => { setDate(d); setKey(d); setTyped(null); setError(null); hand(d, clock); }, onClock: setTime }), worn.picks === "two" && _jsx("div", { className: "o-date-editor-sep", "data-slot": "vk-date-sep" }), quick] }));
|
|
145
|
+
} setView(view === "years" ? "days" : "years"); }, children: String(sy) })] }), !calendar && daysShown && _jsx(_Fragment, { children: dayGrid(false, names.week) }), shownView === "months" && (_jsx("div", { className: "o-date-editor-choices", "data-slot": "vk-date-choices", "data-key": "months", role: "group", "aria-label": w.months, children: names.monthsShort.map((name, i) => _jsx("button", { type: "button", className: "o-date-editor-choice", "data-slot": "vk-date-choice", "data-key": String(i), onMouseDown: hold, "data-picked": i === sm ? "" : undefined, onClick: () => { b.moveKey(addMonths(shownKey, i - sm)); setView("days"); refocus(".o-date-editor-day[data-stop]"); }, children: name }, i)) })), shownView === "years" && (_jsx("div", { className: "o-date-editor-choices", "data-slot": "vk-date-choices", "data-key": "years", role: "group", "aria-label": w.years, children: Array.from({ length: 12 }, (_, i) => sy - 5 + i).map((yr) => (_jsx("button", { type: "button", className: "o-date-editor-choice", "data-slot": "vk-date-choice", "data-key": String(yr), onMouseDown: hold, "data-picked": yr === sy ? "" : undefined, "data-today": yr === parts(today)[0] ? "" : undefined, onClick: () => { leaveYear(); setYearText(null); b.moveKey(addMonths(shownKey, (yr - sy) * 12)); setView("months"); refocus(".o-date-editor-choice[data-picked]"); }, children: yr }, yr))) })), view === "time" && !inParts && (_jsx("div", { className: "o-date-editor-quarters", "data-slot": "vk-date-quarters", role: "group", "aria-label": w.time, children: QUARTERS.map((q) => _jsx("button", { type: "button", className: "o-date-editor-quarter", "data-slot": "vk-date-quarter", "data-key": q, onMouseDown: hold, "data-picked": q === clock ? "" : undefined, ref: q === (clock ?? "09:00") ? (el) => { if (el)
|
|
146
|
+
scrollInList(el, { block: "center" }); } : undefined, onClick: () => { setTime(q); setView("days"); refocus(".o-date-editor-time"); }, children: q }, q)) })), inParts && _jsx(DateParts, { form: "computer", words: w, onEnter: keep, date: date, clock: clock, today: today, shownTyping: props.opens === "time", onDate: (d) => { b.setDay(d); b.type(null); }, onClock: setTime }), worn.picks === "two" && _jsx("div", { className: "o-date-editor-sep", "data-slot": "vk-date-sep" }), quick] }));
|
|
284
147
|
return { body, head: {} };
|
|
285
148
|
}
|
|
286
149
|
function Wheel({ name, label, items, value, onChange }) {
|
|
@@ -82,8 +82,9 @@ export interface FieldRowsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
82
82
|
}
|
|
83
83
|
/** Field rows' card: fields that belong together, as rows of one card on a phone, or each its own card. Its rows are FieldRowsRows,
|
|
84
84
|
* or Fields, each then the card's row (VK-960), their notes and errors under the card; anything else stands in it as its place
|
|
85
|
-
* puts it.
|
|
86
|
-
|
|
85
|
+
* puts it. Server-rendered outside a PhoneHost and a ComputerHost, the card stands whole once for each screen, CSS showing the
|
|
86
|
+
* screen's until the page comes alive (`ScreenForms`, VK-1074), so a record's rows paint the phone's form on a phone. */
|
|
87
|
+
export declare function FieldRows(props: FieldRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
87
88
|
/** Field rows' card as its Fields see it, and the foot to draw after it: FieldRows', and a setting rows' card on a phone (VK-979).
|
|
88
89
|
* Its Fields in the order they came (VK-960), and those with a note or an error to show; while any has one, its foot stands
|
|
89
90
|
* after the card, the card first, so a foot coming or going never redraws the card or moves the focus in it. In the foot each
|