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 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Input params: one plain object per input, `{ type, name, ...props }`. The same object renders the input
|
|
3
|
+
* (`renderInput`), validates its value without a browser (`validateInput`), and describes a row of a tabular or group
|
|
4
|
+
* form. Forms (Form, SubmitForm, ApiForm, and Crud) take a list of them: `inputs: InputParams[]`.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Which input a params object describes: `{ type: EInputTypes.Dropdown, name: "country", ... }`. A number, so a
|
|
8
|
+
* database, a generated page and a C# enum hold the same value.
|
|
9
|
+
*
|
|
10
|
+
* The numbers come in blocks by kind, each with room to grow. 0 is never a kind, so a missing value is never a valid
|
|
11
|
+
* one; a released number is never reused or given a new meaning.
|
|
12
|
+
*
|
|
13
|
+
* | Block | Kind | Members |
|
|
14
|
+
* |---|---|---|
|
|
15
|
+
* | 1–19 | Text boxes | Text 1, Email 2, Password 3, Search 4, Tel 5, Url 6, TextArea 7, Code 8 |
|
|
16
|
+
* | 20–39 | Choices | CheckBox 20, Switch 21, Radio 22, CheckBoxGroup 23, RadioGroup 24, Dropdown 25 |
|
|
17
|
+
* | 40–59 | Dates and times | Date 40, DateRange 41, Time 42, DateTime 43 |
|
|
18
|
+
* | 60–79 | Numbers and sliders | Number 60, Slider 61, RangeSlider 62 |
|
|
19
|
+
* | 80–99 | Editors | Markdown 80, RichText 81 |
|
|
20
|
+
* | 100–119 | Structures | Tree 100, Tabular 101, Group 102, Picture 103 |
|
|
21
|
+
*
|
|
22
|
+
* A dropdown is one member: `multiple` decides whether it picks one item or many. Every number fits a byte.
|
|
23
|
+
*/
|
|
24
|
+
export const EInputTypes = {
|
|
25
|
+
/** `TextBox`, a single line. */
|
|
26
|
+
Text: 1,
|
|
27
|
+
/** `TextBox` of HTML type email. */
|
|
28
|
+
Email: 2,
|
|
29
|
+
/** `TextBox` of HTML type password, with a button that shows what was typed. */
|
|
30
|
+
Password: 3,
|
|
31
|
+
/** `TextBox` of HTML type search. */
|
|
32
|
+
Search: 4,
|
|
33
|
+
/** `TextBox` of HTML type tel: a phone number. */
|
|
34
|
+
Tel: 5,
|
|
35
|
+
/** `TextBox` of HTML type url. */
|
|
36
|
+
Url: 6,
|
|
37
|
+
/** `TextArea`: several lines of plain text. */
|
|
38
|
+
TextArea: 7,
|
|
39
|
+
/** `CodeBox`: a box per character, such as a one-time code. */
|
|
40
|
+
Code: 8,
|
|
41
|
+
/** `CheckBox`: `true` or `false`. */
|
|
42
|
+
CheckBox: 20,
|
|
43
|
+
/** `Switch`: `true` or `false`, for a setting that takes effect. */
|
|
44
|
+
Switch: 21,
|
|
45
|
+
/** `RadioButton`: one radio, on or off; in rows, only one row has it on. */
|
|
46
|
+
Radio: 22,
|
|
47
|
+
/** `CheckBoxGroup`: any number of options. */
|
|
48
|
+
CheckBoxGroup: 23,
|
|
49
|
+
/** `RadioGroup`: one option of a few, all in view. */
|
|
50
|
+
RadioGroup: 24,
|
|
51
|
+
/** `Dropdown`: one item, or many with `multiple`. */
|
|
52
|
+
Dropdown: 25,
|
|
53
|
+
/** `DatePicker`: an ISO date. */
|
|
54
|
+
Date: 40,
|
|
55
|
+
/** `DateRangePicker`: two ISO dates. */
|
|
56
|
+
DateRange: 41,
|
|
57
|
+
/** `TimePicker`: an ISO time. */
|
|
58
|
+
Time: 42,
|
|
59
|
+
/** `DateTimePicker`: a UTC moment shown in the user's zone. */
|
|
60
|
+
DateTime: 43,
|
|
61
|
+
/** `NumberBox`. */
|
|
62
|
+
Number: 60,
|
|
63
|
+
/** `Slider`: one number on a track. */
|
|
64
|
+
Slider: 61,
|
|
65
|
+
/** `RangeSlider`: two numbers on a track. */
|
|
66
|
+
RangeSlider: 62,
|
|
67
|
+
/** `MarkdownEditor`: Markdown text. */
|
|
68
|
+
Markdown: 80,
|
|
69
|
+
/** `RichTextEditor`: sanitized HTML. */
|
|
70
|
+
RichText: 81,
|
|
71
|
+
/** `TreeView`: nodes picked in a tree. */
|
|
72
|
+
Tree: 100,
|
|
73
|
+
/** `TabularForm`: rows of inputs in a table. */
|
|
74
|
+
Tabular: 101,
|
|
75
|
+
/** `GroupForm`: the same rows, each as a section of inputs. */
|
|
76
|
+
Group: 102,
|
|
77
|
+
/** `PictureInput`: a record's picture, kept by the file backend as one of the owner's files, not a value of the form. */
|
|
78
|
+
Picture: 103,
|
|
79
|
+
};
|
|
@@ -127,8 +127,10 @@ export type DropdownItem = object;
|
|
|
127
127
|
* - `avatar`: a round photo from a URL; the initials of the item's label when there is no URL or it fails to load.
|
|
128
128
|
* - `image`: a small picture from a URL, 4:3, such as a flag or a logo.
|
|
129
129
|
* - `icon`: a Tabler icon by name, such as `"wifi"`.
|
|
130
|
+
* - `money`: a figure with 2 places in the person's number format (1,00,000.00 under lakh and crore), at the end of the
|
|
131
|
+
* column in even digits, such as a fee's price beside its name; empty for a missing one.
|
|
130
132
|
*/
|
|
131
|
-
export type DropdownColumnType = "text" | "muted" | "code" | "avatar" | "image" | "icon";
|
|
133
|
+
export type DropdownColumnType = "text" | "muted" | "code" | "avatar" | "image" | "icon" | "money";
|
|
132
134
|
/** One column of a dropdown's rows. Plain values, so a list of fields can describe it; `render` is the only function. */
|
|
133
135
|
export interface DropdownColumn<TItem extends DropdownItem = DropdownItem> {
|
|
134
136
|
/** The item's field, e.g. `"username"`. */
|
|
@@ -137,9 +139,9 @@ export interface DropdownColumn<TItem extends DropdownItem = DropdownItem> {
|
|
|
137
139
|
header?: string;
|
|
138
140
|
/** Default `text`. */
|
|
139
141
|
type?: DropdownColumnType;
|
|
140
|
-
/** A CSS grid track: `"6rem"`, `"auto"`, `"1fr"`. Default: `auto` for avatar, image, icon, and
|
|
142
|
+
/** A CSS grid track: `"6rem"`, `"auto"`, `"1fr"`. Default: `auto` for avatar, image, icon, code, and money; `minmax(0, 1fr)` for text. */
|
|
141
143
|
width?: string;
|
|
142
|
-
/** Default `start`. */
|
|
144
|
+
/** Default `start`; `end` for `money`. */
|
|
143
145
|
align?: "start" | "center" | "end";
|
|
144
146
|
/** Draws the cell instead of `type`. */
|
|
145
147
|
render?: (item: TItem) => ReactNode;
|
|
@@ -154,6 +156,23 @@ export interface DropdownPageRequest {
|
|
|
154
156
|
skip: number;
|
|
155
157
|
/** Aborted when a newer search replaces this request, or the dropdown unmounts. */
|
|
156
158
|
signal: AbortSignal;
|
|
159
|
+
/**
|
|
160
|
+
* Only the options whose `key` field holds `value`: set by a form for an input another narrows (`narrowedBy`). A source
|
|
161
|
+
* of its own should honour it (`crudPicker` does); a static list is narrowed by the form itself. `orUnset`: the options
|
|
162
|
+
* whose `key` field is empty are offered too (`narrowedBy.orUnset`), and a `null` value then offers only those.
|
|
163
|
+
*/
|
|
164
|
+
narrow?: DropdownNarrow;
|
|
165
|
+
/**
|
|
166
|
+
* Every narrowing, when several narrow at once (`narrowedBy` as a list: the form's Store and the row's Item): the
|
|
167
|
+
* options must fit each. `narrow` is the first of them, for a source that reads one. Absent with one narrowing or none.
|
|
168
|
+
*/
|
|
169
|
+
narrows?: readonly DropdownNarrow[];
|
|
170
|
+
}
|
|
171
|
+
/** One narrowing of a picker's options: the records whose `key` field holds `value` (`orUnset`: or is empty). */
|
|
172
|
+
export interface DropdownNarrow {
|
|
173
|
+
key: string;
|
|
174
|
+
value: OptionValue | null;
|
|
175
|
+
orUnset?: boolean;
|
|
157
176
|
}
|
|
158
177
|
/** What `loadOptions` returns for one page. */
|
|
159
178
|
export interface DropdownPage<TItem extends DropdownItem = DropdownItem> {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { ChatDomainValue, ChatId, ChatMessageKind, ChatSource } from "./ChatInterfaces.ts";
|
|
2
|
+
import type { DropdownPage, DropdownPageRequest } from "./InputInterfaces.ts";
|
|
3
|
+
import type { TablePage } from "./TableInterfaces.ts";
|
|
4
|
+
/** How a person is on a thread: who sent it, and who it was sent to, copied to, or copied to unseen. */
|
|
5
|
+
export type MailRole = "from" | "to" | "cc" | "bcc";
|
|
6
|
+
/** The lists of a mailbox: every thread not archived, the ones with unread lines, the ones the reader started, the archived. */
|
|
7
|
+
export type MailList = "inbox" | "unread" | "sent" | "archived";
|
|
8
|
+
/** What a thread opened with: a mail a person wrote, or a notification a module wrote about an event. */
|
|
9
|
+
export type MailHeadKind = Extract<ChatMessageKind, "mail" | "notification">;
|
|
10
|
+
/**
|
|
11
|
+
* What a conversation in a mailbox is, which decides how it opens and which of the mailbox's types it is counted under:
|
|
12
|
+
* `mail` a mail thread about no record, `chat` a one-to-one or group chat (it opens in a chat popup), `domain` a mail
|
|
13
|
+
* thread about a record (its `domainType` names the kind: a leave request, a requisition). The Nexus wire's `kind`:
|
|
14
|
+
* Mail 1, Chat 2, Domain 3.
|
|
15
|
+
*/
|
|
16
|
+
export type MailThreadKind = "mail" | "chat" | "domain";
|
|
17
|
+
/** Someone a mail can be sent to, or was. */
|
|
18
|
+
export interface MailPerson {
|
|
19
|
+
id: ChatId;
|
|
20
|
+
name: string;
|
|
21
|
+
/** False for someone who has left: their name stays on what they wrote, and they cannot be addressed again. */
|
|
22
|
+
isActive?: boolean;
|
|
23
|
+
/** A photo URL. Without one, the initials of the name. */
|
|
24
|
+
avatar?: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** The record a thread is about: its kind (the app's own domain value), its id as the reader may open it, and its words. */
|
|
27
|
+
export interface MailDomain {
|
|
28
|
+
domainType: ChatDomainValue;
|
|
29
|
+
/** The record's id, sealed for this reader. `null` when the app knows no way to open records of this kind. */
|
|
30
|
+
id: ChatId | null;
|
|
31
|
+
/** The record's words as the module wrote them: "LR2082-0007 · Puja Shrestha". */
|
|
32
|
+
label: string | null;
|
|
33
|
+
}
|
|
34
|
+
/** One thread in a list of them: what an inbox row shows. A record, so a CRUD can list it. */
|
|
35
|
+
export interface MailInboxRow extends Record<string, unknown> {
|
|
36
|
+
id: ChatId;
|
|
37
|
+
subject: string;
|
|
38
|
+
fromId: ChatId;
|
|
39
|
+
fromName: string;
|
|
40
|
+
/** How the reader is on it. */
|
|
41
|
+
myRole: MailRole;
|
|
42
|
+
/** What it opened with. */
|
|
43
|
+
kind: MailHeadKind;
|
|
44
|
+
/** The kind of record it is about, when it is about one. */
|
|
45
|
+
domainType?: ChatDomainValue | null;
|
|
46
|
+
/** That record's words, shown beside the subject. */
|
|
47
|
+
domainLabel?: string | null;
|
|
48
|
+
/** When its newest line was written, as a UTC moment. */
|
|
49
|
+
lastMessageTime: string;
|
|
50
|
+
/** Who wrote it. */
|
|
51
|
+
lastAuthorName?: string | null;
|
|
52
|
+
/** Its first characters, Markdown as written (`markdownToPlainText` for a line of text). */
|
|
53
|
+
lastPreview: string;
|
|
54
|
+
messageCount: number;
|
|
55
|
+
/** Lines the reader has not read. */
|
|
56
|
+
unreadCount: number;
|
|
57
|
+
/** The reader put it aside. */
|
|
58
|
+
archived: boolean;
|
|
59
|
+
/** What the conversation is: mail, chat, or mail about a record. Absent from an older backend: read from `domainType`. */
|
|
60
|
+
threadKind?: MailThreadKind;
|
|
61
|
+
/** The reader starred it. Absent when the backend keeps no stars. */
|
|
62
|
+
starred?: boolean;
|
|
63
|
+
/** A photo of the sender: the row's avatar. Without one, their initials. */
|
|
64
|
+
fromAvatar?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** A thread opened: its subject and its people, as the reader may see them, and how they may act on it. */
|
|
67
|
+
export interface MailThreadHead {
|
|
68
|
+
id: ChatId;
|
|
69
|
+
subject: string;
|
|
70
|
+
from: MailPerson;
|
|
71
|
+
to: readonly MailPerson[];
|
|
72
|
+
cc: readonly MailPerson[];
|
|
73
|
+
/**
|
|
74
|
+
* The people copied unseen, as the reader may see them: all of them for the sender, the reader's own row for a person
|
|
75
|
+
* copied unseen, nobody for anyone else. The backend decides; the thread shows what it is given.
|
|
76
|
+
*/
|
|
77
|
+
bcc: readonly MailPerson[];
|
|
78
|
+
myRole: MailRole;
|
|
79
|
+
archived: boolean;
|
|
80
|
+
/** The reader may reply. */
|
|
81
|
+
canSend: boolean;
|
|
82
|
+
/** When the thread was started, as a UTC moment. */
|
|
83
|
+
createdTime: string;
|
|
84
|
+
messageCount: number;
|
|
85
|
+
unreadCount: number;
|
|
86
|
+
/** The record it is about. */
|
|
87
|
+
domain?: MailDomain | null;
|
|
88
|
+
/** What the conversation is: mail, chat, or mail about a record. */
|
|
89
|
+
threadKind?: MailThreadKind;
|
|
90
|
+
}
|
|
91
|
+
/** What a list of threads asks for. */
|
|
92
|
+
export interface MailInboxRequest {
|
|
93
|
+
list: MailList;
|
|
94
|
+
/** Matched in the subject and the record's words. */
|
|
95
|
+
search?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Only the threads about one record: its kind and its id (as its own module gave it to the reader). The kind alone
|
|
98
|
+
* (no `parentId`) is a mailbox's type: every thread about a record of that kind.
|
|
99
|
+
*/
|
|
100
|
+
domainType?: ChatDomainValue;
|
|
101
|
+
parentId?: ChatId;
|
|
102
|
+
/** Only one kind of conversation: a mailbox's Mail, Chat, or a record kind's type (`domain` with its `domainType`). */
|
|
103
|
+
threadKind?: MailThreadKind;
|
|
104
|
+
/** Threads before this page. */
|
|
105
|
+
skip: number;
|
|
106
|
+
/** Threads on this page. */
|
|
107
|
+
take: number;
|
|
108
|
+
signal?: AbortSignal;
|
|
109
|
+
}
|
|
110
|
+
/** What the reader has not read: how many lines, and the newest threads holding them. */
|
|
111
|
+
export interface MailUnread {
|
|
112
|
+
count: number;
|
|
113
|
+
/** The newest threads with unread lines, newest first. */
|
|
114
|
+
newest: readonly MailInboxRow[];
|
|
115
|
+
}
|
|
116
|
+
/** One list of a mailbox with how much of it is unread: its folder's count. */
|
|
117
|
+
export interface MailFolderCount {
|
|
118
|
+
list: MailList;
|
|
119
|
+
/** Conversations in it with unread lines. */
|
|
120
|
+
unread: number;
|
|
121
|
+
}
|
|
122
|
+
/** One type of conversation in a mailbox (Mail, Chat, Leave, Request ...), counted across the reader's inbox. */
|
|
123
|
+
export interface MailKindCount {
|
|
124
|
+
threadKind: MailThreadKind;
|
|
125
|
+
/** The record kind of a `domain` type; `null` for Mail and Chat. */
|
|
126
|
+
domainType: ChatDomainValue | null;
|
|
127
|
+
/** Conversations of this type with unread lines. */
|
|
128
|
+
unread: number;
|
|
129
|
+
/** Conversations of this type in the inbox. A type with none is not listed. */
|
|
130
|
+
total: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The counts beside a mailbox's folders and types, read in one call. The Nexus wire (`Mail/Folders`):
|
|
134
|
+
* `{ folders: [{ list, unread }], kinds: [{ kind, domainType, unread, total }] }`, lists 1-4 and kinds 1-3.
|
|
135
|
+
*/
|
|
136
|
+
export interface MailFolders {
|
|
137
|
+
folders: readonly MailFolderCount[];
|
|
138
|
+
kinds: readonly MailKindCount[];
|
|
139
|
+
}
|
|
140
|
+
/** Who a new message is sent to by default: the people the reader set, or the backend's rule (their supervisor). */
|
|
141
|
+
export interface MailDefaults {
|
|
142
|
+
to: readonly MailPerson[];
|
|
143
|
+
cc: readonly MailPerson[];
|
|
144
|
+
bcc: readonly MailPerson[];
|
|
145
|
+
}
|
|
146
|
+
/** A new message: the people by id, at least one in To; its subject and body; and this browser's id for it, so a retry writes it once. */
|
|
147
|
+
export interface MailDraft {
|
|
148
|
+
to: readonly ChatId[];
|
|
149
|
+
cc?: readonly ChatId[];
|
|
150
|
+
bcc?: readonly ChatId[];
|
|
151
|
+
subject: string;
|
|
152
|
+
/** Markdown. */
|
|
153
|
+
body: string;
|
|
154
|
+
clientId: string;
|
|
155
|
+
}
|
|
156
|
+
/** A new message written: its thread, and its first line. */
|
|
157
|
+
export interface MailSent {
|
|
158
|
+
id: ChatId;
|
|
159
|
+
messageId: ChatId;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Where a mailbox's data comes from. A thread's lines come through `threadSource`, an ordinary `ChatSource`, so the
|
|
163
|
+
* chat's store and thread draw, page, send and mark read a mail thread unchanged.
|
|
164
|
+
*/
|
|
165
|
+
export interface MessageSource {
|
|
166
|
+
/** One page of a list, newest line first. */
|
|
167
|
+
inbox(request: MailInboxRequest): Promise<TablePage<MailInboxRow>>;
|
|
168
|
+
/** A thread's head: its subject, its people, the reader's role. */
|
|
169
|
+
thread(id: ChatId, signal?: AbortSignal): Promise<MailThreadHead>;
|
|
170
|
+
/** A thread's lines: history, replies and the read mark, as a chat. */
|
|
171
|
+
threadSource(id: ChatId): ChatSource;
|
|
172
|
+
/** Writes a new message, and answers its thread. */
|
|
173
|
+
compose(draft: MailDraft, signal?: AbortSignal): Promise<MailSent>;
|
|
174
|
+
/** Puts threads aside for the reader alone, and answers how many changed. */
|
|
175
|
+
archive(ids: readonly ChatId[], signal?: AbortSignal): Promise<number>;
|
|
176
|
+
/** Brings them back to the inbox, and answers how many changed. */
|
|
177
|
+
unarchive(ids: readonly ChatId[], signal?: AbortSignal): Promise<number>;
|
|
178
|
+
/** What the reader has not read. */
|
|
179
|
+
unread(signal?: AbortSignal): Promise<MailUnread>;
|
|
180
|
+
/** The people a message can be sent to, searched by name, a page at a time (the reader left out). */
|
|
181
|
+
people(query: DropdownPageRequest): Promise<DropdownPage<MailPerson>>;
|
|
182
|
+
/** Who a new message goes to by default. */
|
|
183
|
+
defaults(signal?: AbortSignal): Promise<MailDefaults>;
|
|
184
|
+
/** The counts beside the folders and the types. Without it a mail client shows no counts and no Types. */
|
|
185
|
+
folders?(signal?: AbortSignal): Promise<MailFolders>;
|
|
186
|
+
/** Marks whole conversations read for the reader, and answers how many changed. Without it, no Mark read. */
|
|
187
|
+
markRead?(ids: readonly ChatId[], signal?: AbortSignal): Promise<number>;
|
|
188
|
+
/** Marks conversations unread again (their newest line), and answers how many changed. Without it, no Mark unread. */
|
|
189
|
+
markUnread?(ids: readonly ChatId[], signal?: AbortSignal): Promise<number>;
|
|
190
|
+
/** Stars conversations for the reader, or takes the star away. Without it, a mail client draws no stars. */
|
|
191
|
+
star?(ids: readonly ChatId[], starred: boolean, signal?: AbortSignal): Promise<number>;
|
|
192
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|