nexus-shared 3.2.0 → 4.1.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 +2359 -0
- package/README.md +1911 -1123
- package/dist/Client.Index.d.ts +27 -0
- package/dist/Client.Index.js +27 -0
- package/dist/Components/Chats/ChatComposer.d.ts +7 -1
- package/dist/Components/Chats/ChatComposer.js +9 -6
- package/dist/Components/Chats/ChatParts.d.ts +15 -2
- package/dist/Components/Chats/ChatParts.js +15 -4
- package/dist/Components/Chats/ChatPopup.d.ts +46 -0
- package/dist/Components/Chats/ChatPopup.js +34 -0
- package/dist/Components/Chats/ChatThread.d.ts +9 -1
- package/dist/Components/Chats/ChatThread.js +54 -6
- package/dist/Components/Dashboards/DashboardBoard.d.ts +62 -0
- package/dist/Components/Dashboards/DashboardBoard.js +594 -0
- package/dist/Components/Dashboards/DashboardWidgets.d.ts +155 -0
- package/dist/Components/Dashboards/DashboardWidgets.js +159 -0
- package/dist/Components/Dashboards/WidgetFrame.d.ts +51 -0
- package/dist/Components/Dashboards/WidgetFrame.js +45 -0
- package/dist/Components/Documents/Button.d.ts +6 -1
- package/dist/Components/Documents/Button.js +2 -2
- package/dist/Components/Documents/DocumentFrame.d.ts +50 -0
- package/dist/Components/Documents/DocumentFrame.js +83 -0
- package/dist/Components/Documents/Menu.d.ts +4 -0
- package/dist/Components/Documents/Menu.js +40 -24
- package/dist/Components/Documents/PrintDocument.d.ts +95 -0
- package/dist/Components/Documents/PrintDocument.js +62 -0
- package/dist/Components/Documents/TabButtons.d.ts +6 -0
- package/dist/Components/Documents/TabButtons.js +5 -4
- package/dist/Components/Documents/Tabs.d.ts +59 -0
- package/dist/Components/Documents/Tabs.js +70 -0
- package/dist/Components/Domains/DomainCard.d.ts +98 -0
- package/dist/Components/Domains/DomainCard.js +182 -0
- package/dist/Components/Forms/ApiForm.js +24 -3
- package/dist/Components/Forms/Crud.d.ts +2 -2
- package/dist/Components/Forms/Crud.js +628 -247
- package/dist/Components/Forms/CrudActions.d.ts +137 -0
- package/dist/Components/Forms/CrudActions.js +214 -0
- package/dist/Components/Forms/CrudHistory.d.ts +6 -1
- package/dist/Components/Forms/CrudHistory.js +14 -6
- package/dist/Components/Forms/CrudNarrowPicker.d.ts +31 -0
- package/dist/Components/Forms/CrudNarrowPicker.js +180 -0
- package/dist/Components/Forms/CrudParts.d.ts +37 -2
- package/dist/Components/Forms/CrudParts.js +123 -7
- package/dist/Components/Forms/CrudRowForms.d.ts +26 -0
- package/dist/Components/Forms/CrudRowForms.js +174 -0
- package/dist/Components/Forms/CrudScopes.d.ts +28 -0
- package/dist/Components/Forms/CrudScopes.js +76 -0
- package/dist/Components/Forms/CrudTree.d.ts +90 -0
- package/dist/Components/Forms/CrudTree.js +363 -0
- package/dist/Components/Forms/CrudWorkspace.d.ts +73 -0
- package/dist/Components/Forms/CrudWorkspace.js +177 -0
- package/dist/Components/Forms/ExcelImport.js +3 -3
- package/dist/Components/Forms/Form.d.ts +6 -5
- package/dist/Components/Forms/Form.js +134 -21
- package/dist/Components/Forms/FormLeaveGuard.d.ts +44 -0
- package/dist/Components/Forms/FormLeaveGuard.js +65 -0
- package/dist/Components/Forms/FormQuestion.d.ts +6 -0
- package/dist/Components/Forms/FormQuestion.js +28 -0
- package/dist/Components/Forms/RecordFlows.d.ts +50 -0
- package/dist/Components/Forms/RecordFlows.js +282 -0
- package/dist/Components/Forms/SubmitForm.d.ts +37 -2
- package/dist/Components/Forms/SubmitForm.js +182 -10
- package/dist/Components/Inputs/CheckBox.js +1 -1
- package/dist/Components/Inputs/ChoiceField.d.ts +21 -1
- package/dist/Components/Inputs/ChoiceField.js +28 -2
- package/dist/Components/Inputs/ComputedInput.d.ts +51 -0
- package/dist/Components/Inputs/ComputedInput.js +179 -0
- package/dist/Components/Inputs/Dropdown.d.ts +13 -0
- package/dist/Components/Inputs/Dropdown.js +8 -6
- package/dist/Components/Inputs/DropdownParts.d.ts +3 -1
- package/dist/Components/Inputs/DropdownParts.js +16 -4
- package/dist/Components/Inputs/Field.d.ts +7 -1
- package/dist/Components/Inputs/Field.js +2 -2
- package/dist/Components/Inputs/GroupForm.d.ts +6 -6
- package/dist/Components/Inputs/GroupForm.js +12 -12
- package/dist/Components/Inputs/InputRenderer.d.ts +13 -6
- package/dist/Components/Inputs/InputRenderer.js +37 -32
- package/dist/Components/Inputs/MarkdownEditor.d.ts +6 -0
- package/dist/Components/Inputs/MarkdownEditor.js +32 -6
- package/dist/Components/Inputs/PictureInput.d.ts +41 -0
- package/dist/Components/Inputs/PictureInput.js +75 -0
- package/dist/Components/Inputs/RadioGroup.d.ts +16 -3
- package/dist/Components/Inputs/RadioGroup.js +8 -3
- package/dist/Components/Inputs/RowsInput.d.ts +15 -2
- package/dist/Components/Inputs/RowsInput.js +96 -8
- package/dist/Components/Inputs/TabularForm.d.ts +5 -5
- package/dist/Components/Inputs/TabularForm.js +45 -32
- package/dist/Components/Inputs/TextArea.d.ts +6 -0
- package/dist/Components/Inputs/TextArea.js +11 -2
- package/dist/Components/Inputs/TextBoxTypes.d.ts +6 -0
- package/dist/Components/Inputs/TextBoxTypes.js +17 -0
- package/dist/Components/Inputs/TreeView.d.ts +76 -2
- package/dist/Components/Inputs/TreeView.js +227 -16
- package/dist/Components/Layouts/MessageBox.d.ts +15 -2
- package/dist/Components/Layouts/MessageBox.js +56 -7
- package/dist/Components/Layouts/Popup.d.ts +34 -7
- package/dist/Components/Layouts/Popup.js +143 -13
- package/dist/Components/Layouts/PopupDock.d.ts +3 -1
- package/dist/Components/Layouts/PopupDock.js +2 -1
- package/dist/Components/Layouts/PopupHost.js +5 -4
- package/dist/Components/Messages/MailClient.d.ts +50 -0
- package/dist/Components/Messages/MailClient.js +410 -0
- package/dist/Components/Messages/MailColumns.d.ts +21 -0
- package/dist/Components/Messages/MailColumns.js +92 -0
- package/dist/Components/Messages/MailCompose.d.ts +46 -0
- package/dist/Components/Messages/MailCompose.js +154 -0
- package/dist/Components/Messages/MailReader.d.ts +43 -0
- package/dist/Components/Messages/MailReader.js +207 -0
- package/dist/Components/Messages/MailThread.d.ts +71 -0
- package/dist/Components/Messages/MailThread.js +185 -0
- package/dist/Components/Messages/MessageBell.d.ts +41 -0
- package/dist/Components/Messages/MessageBell.js +76 -0
- package/dist/Components/Viewers/DataTable.js +153 -49
- package/dist/Components/Viewers/DataTableColumns.d.ts +2 -2
- package/dist/Components/Viewers/DataTableColumns.js +2 -1
- package/dist/Components/Viewers/DataTableFilters.d.ts +1 -1
- package/dist/Components/Viewers/DataTableFilters.js +17 -2
- package/dist/Components/Viewers/DataTableParts.d.ts +23 -5
- package/dist/Components/Viewers/DataTableParts.js +26 -14
- package/dist/Components/Viewers/OwnerFiles.d.ts +227 -0
- package/dist/Components/Viewers/OwnerFiles.js +700 -0
- package/dist/Components/Viewers/QrCodeImage.d.ts +22 -0
- package/dist/Components/Viewers/QrCodeImage.js +15 -0
- package/dist/Components/Viewers/RecordCards.d.ts +16 -0
- package/dist/Components/Viewers/RecordCards.js +509 -0
- package/dist/Helpers/ApiModules.js +4 -0
- package/dist/Helpers/AuditEntries.d.ts +50 -0
- package/dist/Helpers/AuditEntries.js +96 -0
- package/dist/Helpers/BusyHooks.d.ts +6 -0
- package/dist/Helpers/BusyHooks.js +39 -0
- package/dist/Helpers/ChatBackend.d.ts +8 -1
- package/dist/Helpers/ChatBackend.js +18 -0
- package/dist/Helpers/ChatHelpers.d.ts +2 -0
- package/dist/Helpers/ChatHelpers.js +4 -1
- package/dist/Helpers/CrudBackend.d.ts +20 -2
- package/dist/Helpers/CrudBackend.js +46 -2
- package/dist/Helpers/CrudColumns.d.ts +91 -6
- package/dist/Helpers/CrudColumns.js +148 -7
- package/dist/Helpers/CrudDetailsTabs.d.ts +58 -0
- package/dist/Helpers/CrudDetailsTabs.js +126 -0
- package/dist/Helpers/CrudHelpers.d.ts +116 -2
- package/dist/Helpers/CrudHelpers.js +256 -0
- package/dist/Helpers/CrudNarrowPick.d.ts +83 -0
- package/dist/Helpers/CrudNarrowPick.js +157 -0
- package/dist/Helpers/CrudPickerPlan.d.ts +58 -0
- package/dist/Helpers/CrudPickerPlan.js +46 -0
- package/dist/Helpers/CrudRowForms.d.ts +32 -0
- package/dist/Helpers/CrudRowForms.js +76 -0
- package/dist/Helpers/CrudScopes.d.ts +32 -0
- package/dist/Helpers/CrudScopes.js +79 -0
- package/dist/Helpers/DashboardHelpers.d.ts +115 -0
- package/dist/Helpers/DashboardHelpers.js +305 -0
- package/dist/Helpers/DomainCards.d.ts +140 -0
- package/dist/Helpers/DomainCards.js +370 -0
- package/dist/Helpers/DropdownHelpers.d.ts +3 -1
- package/dist/Helpers/DropdownHelpers.js +6 -2
- package/dist/Helpers/ExcelHelpers.d.ts +1 -1
- package/dist/Helpers/ExcelHelpers.js +12 -11
- package/dist/Helpers/FileAdapter.d.ts +158 -0
- package/dist/Helpers/FileAdapter.js +173 -0
- package/dist/Helpers/FilePrimaries.d.ts +48 -0
- package/dist/Helpers/FilePrimaries.js +138 -0
- package/dist/Helpers/FormConfirm.d.ts +32 -0
- package/dist/Helpers/FormConfirm.js +40 -0
- package/dist/Helpers/FormStore.d.ts +100 -5
- package/dist/Helpers/FormStore.js +368 -25
- package/dist/Helpers/InputConditions.d.ts +56 -0
- package/dist/Helpers/InputConditions.js +192 -0
- package/dist/Helpers/InputMemory.d.ts +106 -0
- package/dist/Helpers/InputMemory.js +395 -0
- package/dist/Helpers/InputNarrowing.d.ts +50 -0
- package/dist/Helpers/InputNarrowing.js +148 -0
- package/dist/Helpers/InputParamsHelpers.d.ts +44 -1
- package/dist/Helpers/InputParamsHelpers.js +157 -74
- package/dist/Helpers/MailClientHelpers.d.ts +96 -0
- package/dist/Helpers/MailClientHelpers.js +211 -0
- package/dist/Helpers/MessageBackend.d.ts +152 -0
- package/dist/Helpers/MessageBackend.js +329 -0
- package/dist/Helpers/MessageHelpers.d.ts +160 -0
- package/dist/Helpers/MessageHelpers.js +573 -0
- package/dist/Helpers/MessageUnread.d.ts +95 -0
- package/dist/Helpers/MessageUnread.js +245 -0
- package/dist/Helpers/NexusDriveAdapter.d.ts +71 -0
- package/dist/Helpers/NexusDriveAdapter.js +236 -0
- package/dist/Helpers/NumberHelpers.d.ts +156 -0
- package/dist/Helpers/NumberHelpers.js +242 -0
- package/dist/Helpers/PagedPicker.d.ts +42 -0
- package/dist/Helpers/PagedPicker.js +85 -0
- package/dist/Helpers/Permissions.js +2 -1
- package/dist/Helpers/QrCode.d.ts +26 -0
- package/dist/Helpers/QrCode.js +463 -0
- package/dist/Helpers/RecordCards.d.ts +205 -0
- package/dist/Helpers/RecordCards.js +378 -0
- package/dist/Helpers/RequestCache.d.ts +14 -2
- package/dist/Helpers/RequestCache.js +22 -3
- package/dist/Helpers/RowsStore.d.ts +61 -2
- package/dist/Helpers/RowsStore.js +203 -16
- package/dist/Helpers/ServerPreview.d.ts +69 -0
- package/dist/Helpers/ServerPreview.js +99 -0
- package/dist/Helpers/TableColumns.js +4 -3
- package/dist/Helpers/TableExport.d.ts +7 -1
- package/dist/Helpers/TableExport.js +9 -3
- package/dist/Helpers/TableFilters.d.ts +1 -1
- package/dist/Helpers/TableFilters.js +24 -23
- package/dist/Helpers/TableHelpers.d.ts +38 -4
- package/dist/Helpers/TableHelpers.js +78 -10
- package/dist/Helpers/TableJoins.d.ts +13 -0
- package/dist/Helpers/TableJoins.js +34 -0
- package/dist/Helpers/TableStore.d.ts +28 -4
- package/dist/Helpers/TableStore.js +73 -11
- package/dist/Helpers/ToolbarFit.d.ts +23 -0
- package/dist/Helpers/ToolbarFit.js +30 -0
- package/dist/Helpers/TreeStore.d.ts +156 -6
- package/dist/Helpers/TreeStore.js +547 -18
- package/dist/Interfaces/ApiInterfaces.d.ts +10 -1
- package/dist/Interfaces/ApiInterfaces.js +10 -1
- package/dist/Interfaces/ChatInterfaces.d.ts +22 -0
- package/dist/Interfaces/CrudInterfaces.d.ts +539 -6
- package/dist/Interfaces/DashboardInterfaces.d.ts +123 -0
- package/dist/Interfaces/DashboardInterfaces.js +1 -0
- package/dist/Interfaces/DomainInterfaces.d.ts +145 -0
- package/dist/Interfaces/DomainInterfaces.js +1 -0
- package/dist/Interfaces/FileInterfaces.d.ts +183 -0
- package/dist/Interfaces/FileInterfaces.js +6 -0
- package/dist/Interfaces/FormInterfaces.d.ts +460 -32
- package/dist/Interfaces/FormInterfaces.js +79 -1
- package/dist/Interfaces/InputInterfaces.d.ts +22 -3
- package/dist/Interfaces/MailInterfaces.d.ts +192 -0
- package/dist/Interfaces/MailInterfaces.js +1 -0
- package/dist/Interfaces/RecordInterfaces.d.ts +367 -0
- package/dist/Interfaces/RecordInterfaces.js +1 -0
- package/dist/Interfaces/TableInterfaces.d.ts +102 -3
- package/dist/Services/ExcelApi.js +5 -0
- package/dist/Services/FileApi.d.ts +13 -0
- package/dist/Services/FileApi.js +29 -0
- package/dist/Services/ImageEditorLoader.d.ts +14 -0
- package/dist/Services/ImageEditorLoader.js +51 -0
- package/dist/Services/JoinSources.d.ts +79 -6
- package/dist/Services/JoinSources.js +132 -21
- package/dist/Services/MessageApi.d.ts +18 -0
- package/dist/Services/MessageApi.js +64 -0
- package/dist/Services/ModuleImport.d.ts +7 -0
- package/dist/Services/ModuleImport.js +22 -0
- package/dist/Shared.Index.d.ts +28 -0
- package/dist/Shared.Index.js +28 -0
- package/package.json +13 -2
- package/src/Styles/Nexus.Avatar.css +6 -5
- package/src/Styles/Nexus.Button.css +39 -4
- package/src/Styles/Nexus.Chat.css +114 -22
- package/src/Styles/Nexus.Choice.css +16 -0
- package/src/Styles/Nexus.Crud.css +486 -21
- package/src/Styles/Nexus.Dashboard.css +763 -0
- package/src/Styles/Nexus.Domain.css +384 -0
- package/src/Styles/Nexus.Dropdown.css +8 -0
- package/src/Styles/Nexus.Editor.css +20 -0
- package/src/Styles/Nexus.Files.css +437 -0
- package/src/Styles/Nexus.Form.css +5 -2
- package/src/Styles/Nexus.Index.css +7 -0
- package/src/Styles/Nexus.Input.css +73 -0
- package/src/Styles/Nexus.Mail.css +1062 -0
- package/src/Styles/Nexus.Menu.css +10 -1
- package/src/Styles/Nexus.Popup.css +135 -1
- package/src/Styles/Nexus.Print.css +288 -0
- package/src/Styles/Nexus.QrCode.css +12 -0
- package/src/Styles/Nexus.Record.css +430 -0
- package/src/Styles/Nexus.Tab.Buttons.css +87 -22
- package/src/Styles/Nexus.Table.css +1458 -1387
- package/src/Styles/Nexus.Theme.Picker.css +1 -0
- package/src/Styles/Nexus.Themes.css +12 -6
- package/src/Styles/Nexus.Tokens.css +8 -3
- package/src/Styles/Nexus.Tree.css +41 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormErrors, FormRuleResult, FormValues, InputParams, InputValidationContext } from "../Interfaces/FormInterfaces.ts";
|
|
2
|
+
import { type InputMemoryStorage } from "./InputMemory.ts";
|
|
2
3
|
export interface FormStoreOptions<TValues extends FormValues = FormValues> {
|
|
3
4
|
inputs: readonly InputParams[];
|
|
4
5
|
validate?(values: TValues): FormRuleResult;
|
|
@@ -58,6 +59,21 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
58
59
|
private inputByName;
|
|
59
60
|
private values;
|
|
60
61
|
private initial;
|
|
62
|
+
/** The values the last load was given, as given: an input they name with a value is the form's own, never remembered. */
|
|
63
|
+
private given;
|
|
64
|
+
/** Where remembered inputs (`remember`) are read and kept; set by the form that draws this store, in the browser. */
|
|
65
|
+
private memory;
|
|
66
|
+
/** Pickers asked whether they still offer a remembered value; the next opening (a load, a reset) or a submit stops it. */
|
|
67
|
+
private memoryRound;
|
|
68
|
+
/** The inputs whose picker is being asked: drawn loading, and a change to one (the person's pick, code) ends its ask. */
|
|
69
|
+
private asking;
|
|
70
|
+
/** The values memory opened inputs on: an opening that finds nothing (a reset after the choice went) takes its own back. */
|
|
71
|
+
private fromMemory;
|
|
72
|
+
/**
|
|
73
|
+
* The values a load (or a reset, a draft) is working out, while it works them out: what `get` answers then, so an
|
|
74
|
+
* input's live `hidden` (`showWhen`) is judged on the values the form opens with, never on the ones it had before.
|
|
75
|
+
*/
|
|
76
|
+
private reading;
|
|
61
77
|
private isStarted;
|
|
62
78
|
private ruleErrors;
|
|
63
79
|
/** Rows inputs are checked when asked: 10,000 rows on every keystroke would be slow, and the rows check themselves. */
|
|
@@ -87,6 +103,8 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
87
103
|
private draftDropped;
|
|
88
104
|
/** An input reported a value while the values loaded and was refused: it is drawn again from the store when loading ends. */
|
|
89
105
|
private refusedWhileLoading;
|
|
106
|
+
/** What a choice input reported beside the value the user picked last (`pickedItem`): its item, kept with that value. */
|
|
107
|
+
private picked;
|
|
90
108
|
/** A load during a render tells nobody; `announce` does, once the form has mounted. */
|
|
91
109
|
private quiet;
|
|
92
110
|
private unannounced;
|
|
@@ -100,6 +118,8 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
100
118
|
/** Every value, plus the fields the record came with. The same object until something changes; do not change it. */
|
|
101
119
|
getValue(): TValues;
|
|
102
120
|
get(name: string): unknown;
|
|
121
|
+
/** The params of the input of this name, as the form was given them; undefined for a name no input has. */
|
|
122
|
+
inputParams(name: string): InputParams | undefined;
|
|
103
123
|
/** The values the form opened with, or saved last. */
|
|
104
124
|
getInitial(): TValues;
|
|
105
125
|
/** Only the values that differ from the ones the form opened with or saved last. */
|
|
@@ -107,11 +127,23 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
107
127
|
/** The inputs whose values changed, in form order. */
|
|
108
128
|
changedInputs(): string[];
|
|
109
129
|
isChanged(): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the changes are worth asking about before they are dropped (Cancel, closing a popup, leaving the page): a
|
|
132
|
+
* changed value of any input but a password or a one-time code (`keepsTyping`). A form where only those were typed is
|
|
133
|
+
* changed, and Save and its line say so, but nothing asks before it goes.
|
|
134
|
+
*/
|
|
135
|
+
isWorthKeeping(): boolean;
|
|
110
136
|
getStatus: () => FormStatus;
|
|
111
137
|
/** The message an input shows for the form: a server's, the form's rule once the input was left or a submit ran, or its own rule after a submit its input missed. */
|
|
112
138
|
shownError(name: string): string | undefined;
|
|
113
139
|
/** The shown message, with the form's rule messages given, such as the ones before a change. */
|
|
114
140
|
private shownWith;
|
|
141
|
+
/**
|
|
142
|
+
* The item a choice input reported with the value it holds now, when the user picked that value: a dropdown's option
|
|
143
|
+
* (its options, with `multiple`). `undefined` for a value loaded, set from code, or changed since - so what it answers
|
|
144
|
+
* always goes with the value. A CRUD names what a save joined from it (`crudJoinedNames`).
|
|
145
|
+
*/
|
|
146
|
+
pickedItem(name: string): unknown;
|
|
115
147
|
/** The input's own rule message for its value, whether it shows or not. */
|
|
116
148
|
ruleError(name: string): string | null;
|
|
117
149
|
/** The form's own rule message for an input, whether it shows or not. */
|
|
@@ -152,17 +184,28 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
152
184
|
/** Tells listeners about a quiet load. */
|
|
153
185
|
announce(): void;
|
|
154
186
|
private loadValues;
|
|
155
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* Brings back the values the form opened with or saved last, and clears every message. The draft goes too. A
|
|
189
|
+
* remembered input opens on the choice kept now, so a form reset after a save starts on what was just saved.
|
|
190
|
+
*/
|
|
156
191
|
reset(): void;
|
|
157
192
|
/** Sets a value from code. Its input shows it at once, and it counts as a change. */
|
|
158
193
|
set(name: string, value: unknown): void;
|
|
159
194
|
/** Sets several values from code, as one change. */
|
|
160
195
|
setValues(values: Partial<TValues>): void;
|
|
161
196
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
197
|
+
* Values a person set through another input - one worked out from them and typed in (`compute.solve`) - as one change.
|
|
198
|
+
* Their inputs show them at once, as values from code do, and they are taken as the person's own: the form's
|
|
199
|
+
* `onFieldChange` runs for them, and inputs narrowed by them lose what they picked. Nothing is taken while the values
|
|
200
|
+
* load. Answers whether anything changed.
|
|
201
|
+
*/
|
|
202
|
+
setFromPerson(values: Partial<TValues>): boolean;
|
|
203
|
+
/**
|
|
204
|
+
* A value the user typed or picked, from the input rendered with `stamp`, with what a choice input reported beside it
|
|
205
|
+
* (`item`: a dropdown's option, kept for `pickedItem`). An input that was replaced since (by a value from code, a load,
|
|
206
|
+
* or a reset) can still report its last value as it leaves; that value is ignored.
|
|
164
207
|
*/
|
|
165
|
-
input(name: string, value: unknown, stamp: string): void;
|
|
208
|
+
input(name: string, value: unknown, stamp: string, item?: unknown): void;
|
|
166
209
|
/** Marks an input as left by the user: the form's rule messages on it show from now on. */
|
|
167
210
|
touch(name: string): void;
|
|
168
211
|
/**
|
|
@@ -199,6 +242,28 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
199
242
|
* `extra` (from the server, such as a new id) is set on top.
|
|
200
243
|
*/
|
|
201
244
|
commit(saved: TValues, extra?: Partial<TValues>): void;
|
|
245
|
+
/**
|
|
246
|
+
* @internal Whether the input's picker is being asked whether it still offers a remembered value: the input draws
|
|
247
|
+
* loading until it answers, the person picks, or the form opens again.
|
|
248
|
+
*/
|
|
249
|
+
isRemembering(name: string): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* @internal The browser storage remembered inputs read and keep (`InputLayoutParams.remember`), set by the form that
|
|
252
|
+
* draws this store once it is in the browser. Inputs the values left without one open on it at once (as the values
|
|
253
|
+
* the form opened with), a picker once it answers that it still offers the value; a form drawn on a server opened
|
|
254
|
+
* without it, so nothing differs while it hydrates.
|
|
255
|
+
*/
|
|
256
|
+
attachMemory(storage: InputMemoryStorage | null): void;
|
|
257
|
+
/**
|
|
258
|
+
* Inputs that follow ones memory opened (`dependsOn`: a `compute.from`, `showWhen`, `spanWhen`, `labelWhen`, or a
|
|
259
|
+
* `narrowedBy`) draw again with their params read afresh, as after a change: a cell redraws only on its own bump.
|
|
260
|
+
*/
|
|
261
|
+
private bumpFollowers;
|
|
262
|
+
/**
|
|
263
|
+
* @internal A save: each remembered input keeps the value saved (an empty one forgets), for the next form that asks -
|
|
264
|
+
* under the saved values' `per` value, and only where its `when` holds on them.
|
|
265
|
+
*/
|
|
266
|
+
rememberSaved(values: TValues): void;
|
|
202
267
|
/** @internal A save after which the form went back to its opening values (`resetOnSuccess`). */
|
|
203
268
|
markSaved(): void;
|
|
204
269
|
/** @internal While the values load, nothing typed is taken (`input`), and a submit waits (`SubmitForm`). */
|
|
@@ -210,10 +275,40 @@ export declare class FormStore<TValues extends FormValues = FormValues> {
|
|
|
210
275
|
private indexInputs;
|
|
211
276
|
/** Each input's value in the type the input reports; a missing one is the input's default. Other fields stay as they came. */
|
|
212
277
|
private normalize;
|
|
278
|
+
/** Runs `work` with `get` answering from these values (a load's, a reset's, a draft's), and gives back its answer. */
|
|
279
|
+
private readingFrom;
|
|
280
|
+
/**
|
|
281
|
+
* The values with each remembered input the given values leave without one opened on the company's preferred value
|
|
282
|
+
* or the person's last choice (`rememberedOpeningNow`), its `when` and `per` read among these values; without storage
|
|
283
|
+
* (on a server, before the form is drawn) only a preferred value applies. A kept choice no longer offered is forgotten.
|
|
284
|
+
* A picker that must be asked first opens nothing now: it is asked, and its answer opens the input later
|
|
285
|
+
* (`askPickers`) - the round any earlier opening started stops here. An input memory opened before (a reset after a
|
|
286
|
+
* save, the storage arriving) that now opens on nothing takes the value the given values give it back.
|
|
287
|
+
*/
|
|
288
|
+
private openRemembered;
|
|
289
|
+
/** Stops asking pickers about remembered values: their answers no longer open anything, and their inputs stop loading. */
|
|
290
|
+
private stopAskingPickers;
|
|
291
|
+
/**
|
|
292
|
+
* Asks each picker whether it still offers the remembered value (`findRememberedOpening`), the input drawn loading
|
|
293
|
+
* meanwhile. An answer forgets a choice no longer offered, and opens an offered one (`openAsked`) only while the input
|
|
294
|
+
* is still asked about - no pick, no value from code since - and the values it was judged on (`rememberDependencies`:
|
|
295
|
+
* the group that narrows it, the one it is kept per, its `when`) are still the form's: a group changed meanwhile opens
|
|
296
|
+
* nothing.
|
|
297
|
+
*/
|
|
298
|
+
private askPickers;
|
|
299
|
+
/**
|
|
300
|
+
* A picker answered for a remembered value: the input opens on it, as the value the form opened with (not a change) -
|
|
301
|
+
* only while it is as the form opened it and still on the form. One the person typed in, or a draft gave back, keeps
|
|
302
|
+
* what it has.
|
|
303
|
+
*/
|
|
304
|
+
private openAsked;
|
|
213
305
|
/** Inputs that were not there, or were hidden, get their value in the input's type, as a load gives it. */
|
|
214
306
|
private adoptNewInputs;
|
|
215
307
|
private change;
|
|
216
|
-
/**
|
|
308
|
+
/**
|
|
309
|
+
* The inputs whose `dependsOn` (or `narrowedBy`) names any of `names`, and the rows inputs whose row inputs are narrowed
|
|
310
|
+
* by one of them `from: "form"`: their rows draw again with the form's value as it is now.
|
|
311
|
+
*/
|
|
217
312
|
private followersOf;
|
|
218
313
|
private checkRule;
|
|
219
314
|
private checkAllRules;
|