@mmlogic/components 0.3.11 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-BPj2cBXs.js → index-CAzwGt9u.js} +38 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mosterdcomponents.cjs.js +2 -2
- package/dist/cjs/mrd-boolean-field_23.cjs.entry.js +1313 -1088
- package/dist/collection/collection-manifest.json +23 -23
- package/dist/collection/components/{mrd-document-container/mrd-document-container.scss → documents/mrd-document-container/mrd-document-container.css} +3 -3
- package/dist/collection/components/{mrd-document-container → documents/mrd-document-container}/mrd-document-container.js +7 -7
- package/dist/collection/components/documents/mrd-document-list/folder-tree.js +109 -0
- package/dist/collection/components/{mrd-document-list/mrd-document-list.scss → documents/mrd-document-list/mrd-document-list.css} +6 -4
- package/dist/collection/components/{mrd-document-list → documents/mrd-document-list}/mrd-document-list.js +83 -240
- package/dist/collection/components/documents/mrd-document-list/tree-view.js +75 -0
- package/dist/collection/components/{mrd-document-view/mrd-document-view.scss → documents/mrd-document-view/mrd-document-view.css} +1 -1
- package/dist/collection/components/{mrd-document-view → documents/mrd-document-view}/mrd-document-view.js +4 -4
- package/dist/collection/components/fields/field-helpers.js +17 -0
- package/dist/collection/components/fields/file-upload-common.js +38 -0
- package/dist/collection/components/{mrd-boolean-field/mrd-boolean-field.scss → fields/mrd-boolean-field/mrd-boolean-field.css} +3 -3
- package/dist/collection/components/{mrd-boolean-field → fields/mrd-boolean-field}/mrd-boolean-field.js +1 -1
- package/dist/collection/components/{mrd-currency-field/mrd-currency-field.scss → fields/mrd-currency-field/mrd-currency-field.css} +11 -9
- package/dist/collection/components/{mrd-currency-field → fields/mrd-currency-field}/mrd-currency-field.js +7 -13
- package/dist/collection/components/{mrd-date-field/mrd-date-field.scss → fields/mrd-date-field/mrd-date-field.css} +8 -10
- package/dist/collection/components/{mrd-date-field → fields/mrd-date-field}/mrd-date-field.js +3 -10
- package/dist/collection/components/{mrd-datetime-field/mrd-datetime-field.scss → fields/mrd-datetime-field/mrd-datetime-field.css} +8 -10
- package/dist/collection/components/{mrd-datetime-field → fields/mrd-datetime-field}/mrd-datetime-field.js +3 -10
- package/dist/collection/components/{mrd-email-field/mrd-email-field.scss → fields/mrd-email-field/mrd-email-field.css} +2 -11
- package/dist/collection/components/{mrd-email-field → fields/mrd-email-field}/mrd-email-field.js +6 -13
- package/dist/collection/components/{mrd-file-field/mrd-file-field.scss → fields/mrd-file-field/mrd-file-field.css} +19 -24
- package/dist/collection/components/{mrd-file-field → fields/mrd-file-field}/mrd-file-field.js +13 -24
- package/dist/collection/components/{mrd-hyperlink-field/mrd-hyperlink-field.scss → fields/mrd-hyperlink-field/mrd-hyperlink-field.css} +7 -16
- package/dist/collection/components/{mrd-hyperlink-field → fields/mrd-hyperlink-field}/mrd-hyperlink-field.js +9 -15
- package/dist/collection/components/{mrd-image-field/mrd-image-field.scss → fields/mrd-image-field/mrd-image-field.css} +15 -24
- package/dist/collection/components/{mrd-image-field → fields/mrd-image-field}/mrd-image-field.js +13 -28
- package/dist/collection/components/{mrd-list-field/mrd-list-field.scss → fields/mrd-list-field/mrd-list-field.css} +18 -21
- package/dist/collection/components/{mrd-list-field → fields/mrd-list-field}/mrd-list-field.js +10 -25
- package/dist/collection/components/{mrd-longtext-field/mrd-longtext-field.scss → fields/mrd-longtext-field/mrd-longtext-field.css} +21 -18
- package/dist/collection/components/{mrd-longtext-field → fields/mrd-longtext-field}/mrd-longtext-field.js +3 -10
- package/dist/collection/components/{mrd-number-field/mrd-number-field.scss → fields/mrd-number-field/mrd-number-field.css} +9 -10
- package/dist/collection/components/{mrd-number-field → fields/mrd-number-field}/mrd-number-field.js +7 -6
- package/dist/collection/components/{mrd-relation-field/mrd-relation-field.scss → fields/mrd-relation-field/mrd-relation-field.css} +61 -59
- package/dist/collection/components/{mrd-relation-field → fields/mrd-relation-field}/mrd-relation-field.js +16 -26
- package/dist/collection/components/{mrd-secret-field/mrd-secret-field.scss → fields/mrd-secret-field/mrd-secret-field.css} +7 -10
- package/dist/collection/components/{mrd-secret-field → fields/mrd-secret-field}/mrd-secret-field.js +4 -11
- package/dist/collection/components/{mrd-text-field/mrd-text-field.scss → fields/mrd-text-field/mrd-text-field.css} +2 -11
- package/dist/collection/components/{mrd-text-field → fields/mrd-text-field}/mrd-text-field.js +3 -10
- package/dist/collection/components/{mrd-textarea-field/mrd-textarea-field.scss → fields/mrd-textarea-field/mrd-textarea-field.css} +7 -10
- package/dist/collection/components/{mrd-textarea-field → fields/mrd-textarea-field}/mrd-textarea-field.js +3 -9
- package/dist/collection/components/{mrd-time-field/mrd-time-field.scss → fields/mrd-time-field/mrd-time-field.css} +8 -10
- package/dist/collection/components/{mrd-time-field → fields/mrd-time-field}/mrd-time-field.js +3 -10
- package/dist/collection/components/{mrd-field/mrd-field.scss → form/mrd-field/mrd-field.css} +1 -1
- package/dist/collection/components/{mrd-field → form/mrd-field}/mrd-field.js +3 -3
- package/dist/collection/components/{mrd-form/mrd-form.scss → form/mrd-form/mrd-form.css} +1 -1
- package/dist/collection/components/{mrd-form → form/mrd-form}/mrd-form.js +5 -5
- package/dist/collection/components/layout/mrd-layout-section/field-value.js +111 -0
- package/dist/collection/components/layout/mrd-layout-section/layout-helpers.js +29 -0
- package/dist/collection/components/{mrd-layout-section/mrd-layout-section.scss → layout/mrd-layout-section/mrd-layout-section.css} +4 -4
- package/dist/collection/components/{mrd-layout-section → layout/mrd-layout-section}/mrd-layout-section.js +52 -142
- package/dist/collection/components/{mrd-table/mrd-table.scss → table/mrd-table/mrd-table.css} +30 -12
- package/dist/collection/components/{mrd-table → table/mrd-table}/mrd-table.js +234 -443
- package/dist/collection/components/table/mrd-table/table-filter-popup.js +85 -0
- package/dist/collection/components/table/mrd-table/table-parts.js +110 -0
- package/dist/collection/components/table/mrd-table/table-query.js +178 -0
- package/dist/collection/components/table/mrd-table/virtual-scroll.js +63 -0
- package/dist/collection/dev/app.js +19 -18
- package/dist/collection/dev/example-data.js +58 -43
- package/dist/collection/utils/i18n.js +16 -0
- package/dist/collection/utils/query-params.js +43 -0
- package/dist/components/field-helpers.js +1 -0
- package/dist/components/file-upload-common.js +1 -0
- package/dist/components/i18n.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-form.js +1 -1
- package/dist/components/mrd-hyperlink-field2.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-list-field2.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-relation-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/components/query-params.js +1 -0
- package/dist/esm/{index-_tsCCkAi.js → index-DiSEJMA8.js} +38 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mosterdcomponents.js +3 -3
- package/dist/esm/mrd-boolean-field_23.entry.js +1313 -1088
- package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-DiSEJMA8.js +2 -0
- package/dist/mosterdcomponents/p-b1a2e108.entry.js +1 -0
- package/dist/types/components/{mrd-document-container → documents/mrd-document-container}/mrd-document-container.d.ts +2 -2
- package/dist/types/components/documents/mrd-document-list/folder-tree.d.ts +66 -0
- package/dist/types/components/{mrd-document-list → documents/mrd-document-list}/mrd-document-list.d.ts +4 -37
- package/dist/types/components/documents/mrd-document-list/tree-view.d.ts +32 -0
- package/dist/types/components/{mrd-document-view → documents/mrd-document-view}/mrd-document-view.d.ts +2 -2
- package/dist/types/components/fields/field-helpers.d.ts +18 -0
- package/dist/types/components/fields/file-upload-common.d.ts +18 -0
- package/dist/types/components/{mrd-boolean-field → fields/mrd-boolean-field}/mrd-boolean-field.d.ts +1 -1
- package/dist/types/components/{mrd-currency-field → fields/mrd-currency-field}/mrd-currency-field.d.ts +2 -2
- package/dist/types/components/{mrd-date-field → fields/mrd-date-field}/mrd-date-field.d.ts +1 -1
- package/dist/types/components/{mrd-datetime-field → fields/mrd-datetime-field}/mrd-datetime-field.d.ts +1 -1
- package/dist/types/components/{mrd-email-field → fields/mrd-email-field}/mrd-email-field.d.ts +1 -1
- package/dist/types/components/{mrd-file-field → fields/mrd-file-field}/mrd-file-field.d.ts +2 -4
- package/dist/types/components/{mrd-hyperlink-field → fields/mrd-hyperlink-field}/mrd-hyperlink-field.d.ts +2 -2
- package/dist/types/components/{mrd-image-field → fields/mrd-image-field}/mrd-image-field.d.ts +2 -4
- package/dist/types/components/{mrd-list-field → fields/mrd-list-field}/mrd-list-field.d.ts +2 -2
- package/dist/types/components/{mrd-longtext-field → fields/mrd-longtext-field}/mrd-longtext-field.d.ts +1 -1
- package/dist/types/components/{mrd-number-field → fields/mrd-number-field}/mrd-number-field.d.ts +2 -2
- package/dist/types/components/{mrd-relation-field → fields/mrd-relation-field}/mrd-relation-field.d.ts +2 -2
- package/dist/types/components/{mrd-secret-field → fields/mrd-secret-field}/mrd-secret-field.d.ts +1 -1
- package/dist/types/components/{mrd-text-field → fields/mrd-text-field}/mrd-text-field.d.ts +1 -1
- package/dist/types/components/{mrd-textarea-field → fields/mrd-textarea-field}/mrd-textarea-field.d.ts +1 -1
- package/dist/types/components/{mrd-time-field → fields/mrd-time-field}/mrd-time-field.d.ts +1 -1
- package/dist/types/components/{mrd-field → form/mrd-field}/mrd-field.d.ts +2 -2
- package/dist/types/components/{mrd-form → form/mrd-form}/mrd-form.d.ts +2 -2
- package/dist/types/components/layout/mrd-layout-section/field-value.d.ts +22 -0
- package/dist/types/components/layout/mrd-layout-section/layout-helpers.d.ts +8 -0
- package/dist/types/components/{mrd-layout-section → layout/mrd-layout-section}/mrd-layout-section.d.ts +4 -11
- package/dist/types/components/{mrd-table → table/mrd-table}/mrd-table.d.ts +29 -13
- package/dist/types/components/table/mrd-table/table-filter-popup.d.ts +35 -0
- package/dist/types/components/table/mrd-table/table-parts.d.ts +61 -0
- package/dist/types/components/table/mrd-table/table-query.d.ts +50 -0
- package/dist/types/components/table/mrd-table/virtual-scroll.d.ts +33 -0
- package/dist/types/components.d.ts +19 -5
- package/dist/types/utils/query-params.d.ts +14 -0
- package/package.json +7 -2
- package/dist/components/validation.js +0 -1
- package/dist/mosterdcomponents/p-_tsCCkAi.js +0 -2
- package/dist/mosterdcomponents/p-a9618055.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientArchetype, ClientLayoutItem } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem } from '../../../types/client-layout';
|
|
3
3
|
/**
|
|
4
4
|
* Owns a document collection view: a single toolbar (view switch + collection
|
|
5
5
|
* actions like "New folder", and — later — upload / drag-drop) plus the two
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree model and pure tree logic for mrd-document-list.
|
|
3
|
+
* Nodes are mutated in place; the component triggers re-renders via bump().
|
|
4
|
+
*/
|
|
5
|
+
/** A distinct value as returned by the /distinct endpoint. */
|
|
6
|
+
export interface DistinctValue {
|
|
7
|
+
/** Relation slot → `{ href, name }`; value slot (folder) → the raw path string. */
|
|
8
|
+
value: {
|
|
9
|
+
href: string;
|
|
10
|
+
name: string;
|
|
11
|
+
} | string | number | null;
|
|
12
|
+
count: number;
|
|
13
|
+
}
|
|
14
|
+
/** A loaded document row (raw data object from the /data endpoint). */
|
|
15
|
+
export type DocRow = Record<string, any>;
|
|
16
|
+
/** Internal tree node. Containers and folders share one shape; the container is
|
|
17
|
+
* the root of its own folder subtree (root docs = the container's direct docs). */
|
|
18
|
+
export interface TreeNode {
|
|
19
|
+
id: string;
|
|
20
|
+
kind: 'container' | 'folder';
|
|
21
|
+
label: string;
|
|
22
|
+
/** Container href — used to filter documents/folders (`{containerField}_href`). */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** Exact distinct folder string this node maps to (present when it holds documents). */
|
|
25
|
+
fullPath?: string;
|
|
26
|
+
/** True when a distinct value maps exactly to this node (it can load documents). */
|
|
27
|
+
hasDocs: boolean;
|
|
28
|
+
/** Direct document count (0 for grouping-only folder nodes). */
|
|
29
|
+
docCount: number;
|
|
30
|
+
/** Aggregate count including descendants — shown in the badge. */
|
|
31
|
+
totalCount: number;
|
|
32
|
+
children: TreeNode[];
|
|
33
|
+
open: boolean;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
/** Container only: folder distinct fetched. */
|
|
36
|
+
foldersLoaded: boolean;
|
|
37
|
+
/** Direct documents fetched. */
|
|
38
|
+
docsLoaded: boolean;
|
|
39
|
+
docs: DocRow[];
|
|
40
|
+
/** Owning container id (folder nodes only) — used to resolve the container for a folder. */
|
|
41
|
+
containerId?: string;
|
|
42
|
+
/** Client-side folder that is not yet materialised on the server (no documents yet). */
|
|
43
|
+
pending?: boolean;
|
|
44
|
+
/** The inline name input is currently shown for this (freshly created) node. */
|
|
45
|
+
editing?: boolean;
|
|
46
|
+
/** Inline validation message shown under the name input. */
|
|
47
|
+
error?: string;
|
|
48
|
+
}
|
|
49
|
+
/** Normalise a folder path: null/""/"/" → root ([]); else split on "/" dropping empties. */
|
|
50
|
+
export declare function splitFolder(path: string | null | undefined): string[];
|
|
51
|
+
export declare function makeContainerNode(href: string, label: string, count: number): TreeNode;
|
|
52
|
+
export declare function makeFolderNode(id: string, label: string, containerId: string): TreeNode;
|
|
53
|
+
/** Recompute totalCount over the subtree; returns the node's aggregate. */
|
|
54
|
+
export declare function computeTotals(node: TreeNode): number;
|
|
55
|
+
/** Folder path segments of a node relative to its container (derived from its id). */
|
|
56
|
+
export declare function segmentsOf(node: TreeNode, container: TreeNode): string[];
|
|
57
|
+
/** Folder string a node represents: the raw distinct value when it holds
|
|
58
|
+
* documents, else derived from its path segments; null for a container root. */
|
|
59
|
+
export declare function folderStringOf(node: TreeNode, container: TreeNode): string | null;
|
|
60
|
+
/** Strip a single trailing extension for the document title. */
|
|
61
|
+
export declare function stripExtension(name: string): string;
|
|
62
|
+
/** Rebuild a container's folder subtree from the /distinct folder strings.
|
|
63
|
+
* New nodes are registered in `nodeIndex`; the container is mutated in place. */
|
|
64
|
+
export declare function applyFolderDistinct(container: TreeNode, values: DistinctValue[], nodeIndex: Map<string, TreeNode>): void;
|
|
65
|
+
/** Optimistic in-place tree update for a document moved between folders. */
|
|
66
|
+
export declare function applyDocMove(doc: DocRow, fromNode: TreeNode, toNode: TreeNode, targetFolder: string | null): void;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientArchetype, ClientLayoutItem } from '
|
|
3
|
-
|
|
4
|
-
export interface DistinctValue {
|
|
5
|
-
/** Relation slot → `{ href, name }`; value slot (folder) → the raw path string. */
|
|
6
|
-
value: {
|
|
7
|
-
href: string;
|
|
8
|
-
name: string;
|
|
9
|
-
} | string | number | null;
|
|
10
|
-
count: number;
|
|
11
|
-
}
|
|
12
|
-
/** A loaded document row (raw data object from the /data endpoint). */
|
|
13
|
-
export type DocRow = Record<string, any>;
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem } from '../../../types/client-layout';
|
|
3
|
+
import { DistinctValue, DocRow } from './folder-tree';
|
|
14
4
|
/**
|
|
15
5
|
* Archetype-driven document collection view. Renders documents as a lazy,
|
|
16
6
|
* file-explorer-style folder tree, grouped by the `commons.document` archetype's
|
|
@@ -161,11 +151,6 @@ export declare class MrdDocumentList {
|
|
|
161
151
|
setDocuments(nodeId: string, docs: DocRow[]): Promise<void>;
|
|
162
152
|
private applyContainers;
|
|
163
153
|
private applyFolders;
|
|
164
|
-
/** Normalise a folder path: null/""/"/" → root ([]); else split on "/" dropping empties. */
|
|
165
|
-
private splitFolder;
|
|
166
|
-
private makeContainerNode;
|
|
167
|
-
private makeFolderNode;
|
|
168
|
-
private computeTotals;
|
|
169
154
|
/** Force a re-render after mutating nodes in place. */
|
|
170
155
|
private bump;
|
|
171
156
|
private toggleContainer;
|
|
@@ -177,8 +162,6 @@ export declare class MrdDocumentList {
|
|
|
177
162
|
/** Start creating a folder under the current target. Called by the host toolbar
|
|
178
163
|
* (mrd-document-container). No-op when there is no valid target. */
|
|
179
164
|
createFolder(): Promise<void>;
|
|
180
|
-
/** Folder path segments of a node relative to its container (derived from its id). */
|
|
181
|
-
private segmentsOf;
|
|
182
165
|
private startCreateFolder;
|
|
183
166
|
private onPendingInput;
|
|
184
167
|
private onPendingKeyDown;
|
|
@@ -201,33 +184,17 @@ export declare class MrdDocumentList {
|
|
|
201
184
|
private onRootDrop;
|
|
202
185
|
/** Begin an upload: emit mrdUpload; the host uploads and calls setFileReference. */
|
|
203
186
|
private startFileUpload;
|
|
204
|
-
/** Strip a single trailing extension for the document title. */
|
|
205
|
-
private stripExtension;
|
|
206
187
|
/** Host callback with the uploaded file reference. Builds the create payload
|
|
207
188
|
* from the archetype slots and requests the new document. */
|
|
208
189
|
setFileReference(uri: string): Promise<void>;
|
|
209
190
|
/** Host callback with the created document's self href, so the optimistic row
|
|
210
191
|
* becomes navigable without waiting for a reload. */
|
|
211
192
|
setCreatedHref(href: string): Promise<void>;
|
|
212
|
-
/** Folder string a node represents: the raw distinct value when it holds
|
|
213
|
-
* documents, else derived from its path segments; null for a container root. */
|
|
214
|
-
private folderStringOf;
|
|
215
193
|
private moveDocument;
|
|
216
194
|
/** Recompute a container's subtree totals from docCounts when its folders are
|
|
217
195
|
* loaded; otherwise just nudge the aggregate badge by the delta. */
|
|
218
196
|
private recomputeContainerTotals;
|
|
219
197
|
private openDoc;
|
|
220
|
-
private
|
|
221
|
-
private renderDossierIcon;
|
|
222
|
-
private renderFolderIcon;
|
|
223
|
-
private renderDocIcon;
|
|
224
|
-
private indent;
|
|
225
|
-
private renderDocRow;
|
|
226
|
-
private renderLoadingRow;
|
|
227
|
-
private renderChildren;
|
|
228
|
-
private renderUploadingRow;
|
|
229
|
-
private renderFolderEditRow;
|
|
230
|
-
private renderFolderNode;
|
|
231
|
-
private renderContainerNode;
|
|
198
|
+
private treeCtx;
|
|
232
199
|
render(): any;
|
|
233
200
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DocRow, TreeNode } from './folder-tree';
|
|
2
|
+
/**
|
|
3
|
+
* Render functions for the mrd-document-list tree. Plain functions (not
|
|
4
|
+
* FunctionalComponents) because the tree renders recursively and the whole
|
|
5
|
+
* context travels as one object; all state and handlers stay in the component.
|
|
6
|
+
*/
|
|
7
|
+
export interface TreeViewContext {
|
|
8
|
+
locale: string;
|
|
9
|
+
titleField: string;
|
|
10
|
+
dateField?: string;
|
|
11
|
+
selectedId: string | null;
|
|
12
|
+
dropTargetId: string | null;
|
|
13
|
+
uploadingNodeId: string | null;
|
|
14
|
+
on: {
|
|
15
|
+
toggleContainer: (node: TreeNode) => void;
|
|
16
|
+
toggleFolder: (container: TreeNode, node: TreeNode) => void;
|
|
17
|
+
openDoc: (doc: DocRow) => void;
|
|
18
|
+
docDragStart: (e: DragEvent, doc: DocRow, node: TreeNode) => void;
|
|
19
|
+
docDragEnd: () => void;
|
|
20
|
+
nodeDragOver: (e: DragEvent, node: TreeNode) => void;
|
|
21
|
+
nodeDragLeave: (node: TreeNode) => void;
|
|
22
|
+
nodeDrop: (e: DragEvent, node: TreeNode, container: TreeNode) => void;
|
|
23
|
+
pendingInput: (e: Event) => void;
|
|
24
|
+
pendingKeyDown: (e: KeyboardEvent) => void;
|
|
25
|
+
cancelFolder: () => void;
|
|
26
|
+
setPendingInputEl: (el: HTMLInputElement) => void;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export declare function renderLoadingRow(ctx: TreeViewContext, depth: number): any;
|
|
30
|
+
export declare function renderNodeChildren(ctx: TreeViewContext, container: TreeNode, node: TreeNode, depth: number): any[];
|
|
31
|
+
export declare function renderFolderNode(ctx: TreeViewContext, container: TreeNode, node: TreeNode, depth: number): any;
|
|
32
|
+
export declare function renderContainerNode(ctx: TreeViewContext, node: TreeNode, depth: number): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientArchetype } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientArchetype } from '../../../types/client-layout';
|
|
3
3
|
/**
|
|
4
4
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
5
5
|
* data record, renders the document recognisably — title, file preview/download,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Shared building blocks for the leaf field components.
|
|
4
|
+
* `base` is the BEM block name, e.g. 'mrd-text-field'.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FieldLabel: FunctionalComponent<{
|
|
7
|
+
base: string;
|
|
8
|
+
label: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const FieldError: FunctionalComponent<{
|
|
12
|
+
base: string;
|
|
13
|
+
error: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** Class string for the form control, with the --error modifier when applicable. */
|
|
16
|
+
export declare function controlClass(base: string, hasError: boolean, element?: string): string;
|
|
17
|
+
/** Returns the localised required-error, or '' when the value passes. */
|
|
18
|
+
export declare function requiredError(value: unknown, required: boolean, locale: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared upload behaviour for mrd-file-field and mrd-image-field:
|
|
3
|
+
* file validation, drop-zone class building and drag-drop wiring.
|
|
4
|
+
*/
|
|
5
|
+
/** Validates a selected/dropped file; returns a localised error message or '' when accepted. */
|
|
6
|
+
export declare function validateUploadFile(file: File, maxSize: number, locale: string, requireImage?: boolean): string;
|
|
7
|
+
/** BEM class string for the drop zone, e.g. base 'mrd-file-field' → 'mrd-file-field__zone …'. */
|
|
8
|
+
export declare function uploadZoneClass(base: string, opts: {
|
|
9
|
+
dragging: boolean;
|
|
10
|
+
error: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}): string;
|
|
13
|
+
/** Drag-drop handlers for the drop zone; the component owns the dragging state and file handling. */
|
|
14
|
+
export declare function makeDragHandlers(setDragging: (dragging: boolean) => void, onFile: (file: File | null) => void): {
|
|
15
|
+
onDragOver: (e: DragEvent) => void;
|
|
16
|
+
onDragLeave: () => void;
|
|
17
|
+
onDrop: (e: DragEvent) => void;
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { CurrencyValue } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { CurrencyValue } from '../../../types';
|
|
3
3
|
export declare class MrdCurrencyField {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
export declare class MrdFileField {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
@@ -31,9 +31,7 @@ export declare class MrdFileField {
|
|
|
31
31
|
valueChanged(newVal: unknown): void;
|
|
32
32
|
private handleFile;
|
|
33
33
|
private handleInputChange;
|
|
34
|
-
private
|
|
35
|
-
private handleDragLeave;
|
|
36
|
-
private handleDrop;
|
|
34
|
+
private drag;
|
|
37
35
|
private handleZoneClick;
|
|
38
36
|
private handleClear;
|
|
39
37
|
render(): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { HyperlinkValue } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { HyperlinkValue } from '../../../types/client-layout';
|
|
3
3
|
export declare class MrdHyperlinkField {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
package/dist/types/components/{mrd-image-field → fields/mrd-image-field}/mrd-image-field.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
export declare class MrdImageField {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
@@ -32,9 +32,7 @@ export declare class MrdImageField {
|
|
|
32
32
|
valueChanged(newVal: unknown): void;
|
|
33
33
|
private handleFile;
|
|
34
34
|
private handleInputChange;
|
|
35
|
-
private
|
|
36
|
-
private handleDragLeave;
|
|
37
|
-
private handleDrop;
|
|
35
|
+
private drag;
|
|
38
36
|
private handleZoneClick;
|
|
39
37
|
private handleClear;
|
|
40
38
|
render(): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientListValue } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientListValue } from '../../../types';
|
|
3
3
|
export declare class MrdListField {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
package/dist/types/components/{mrd-number-field → fields/mrd-number-field}/mrd-number-field.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientLayoutItemFieldDataType } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayoutItemFieldDataType } from '../../../types';
|
|
3
3
|
export declare class MrdNumberField {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, RelationSearchResult } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, RelationSearchResult } from '../../../types';
|
|
3
3
|
export declare class MrdRelationField {
|
|
4
4
|
el: HTMLElement;
|
|
5
5
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientLayoutItem } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayoutItem } from '../../../types';
|
|
3
3
|
export declare class MrdField {
|
|
4
4
|
el: HTMLElement;
|
|
5
5
|
item: ClientLayoutItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientLayout, RelationSearchResult } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayout, RelationSearchResult } from '../../../types';
|
|
3
3
|
export declare class MrdForm {
|
|
4
4
|
layout: ClientLayout;
|
|
5
5
|
locale: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ClientLayoutItem } from '../../../types/client-layout';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only field rendering for mrd-layout-section. Plain render functions;
|
|
4
|
+
* state (image previews, open history popover) stays in the component and
|
|
5
|
+
* travels in via the context object.
|
|
6
|
+
*/
|
|
7
|
+
export interface FieldViewContext {
|
|
8
|
+
locale: string;
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
imagePreviews: Record<string, string>;
|
|
11
|
+
openHistoryField: string | null;
|
|
12
|
+
on: {
|
|
13
|
+
download: (detail: {
|
|
14
|
+
href: string;
|
|
15
|
+
fileName: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
openImage: (url: string) => void;
|
|
18
|
+
toggleHistory: (fieldName: string | null) => void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function renderFieldValue(ctx: FieldViewContext, item: ClientLayoutItem, rawValue: unknown): any;
|
|
22
|
+
export declare function renderField(ctx: FieldViewContext, item: ClientLayoutItem): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClientLayoutItem } from '../../../types/client-layout';
|
|
2
|
+
/** Key an embedded view is addressed by (setViewPage etc.). */
|
|
3
|
+
export declare function viewKeyFor(item: ClientLayoutItem): string;
|
|
4
|
+
/** Depth-first flatten of the SECTION/GROUP tree. */
|
|
5
|
+
export declare function flattenItems(items: ClientLayoutItem[]): ClientLayoutItem[];
|
|
6
|
+
/** Build the canonical parent href `/{base}/{tenant}/{fromClass}/{parentId}` from
|
|
7
|
+
* the object's self href. Empty unless it is a RELATED_VIEW with a fromClass. */
|
|
8
|
+
export declare function buildContainerHref(item: ClientLayoutItem, selfHref: string, parentId: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, ClientArchetype, RelationSearchResult } from '
|
|
3
|
-
import { DistinctValue } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, ClientArchetype, RelationSearchResult } from '../../../types/client-layout';
|
|
3
|
+
import { DistinctValue } from '../../documents/mrd-document-list/folder-tree';
|
|
4
4
|
export declare class MrdLayoutSection {
|
|
5
5
|
el: HTMLElement;
|
|
6
6
|
/** Items from one layout entry in ClientDashboardMetadata.layouts[]. */
|
|
@@ -101,9 +101,7 @@ export declare class MrdLayoutSection {
|
|
|
101
101
|
disconnectedCallback(): void;
|
|
102
102
|
dataChanged(newVal: Record<string, unknown>): void;
|
|
103
103
|
private initEmbeddedTables;
|
|
104
|
-
private viewKeyFor;
|
|
105
104
|
private emitLoadImages;
|
|
106
|
-
private flattenItems;
|
|
107
105
|
/** Inject search results. Pass dataClass to target a specific SEARCH item; omit when there is only one. */
|
|
108
106
|
setSearchResults(results: RelationSearchResult[], dataClass?: string): Promise<void>;
|
|
109
107
|
/**
|
|
@@ -130,16 +128,11 @@ export declare class MrdLayoutSection {
|
|
|
130
128
|
private resolveSearchKey;
|
|
131
129
|
private handleViewLoadPage;
|
|
132
130
|
private handleSearchInput;
|
|
133
|
-
private
|
|
134
|
-
private renderFieldValue;
|
|
135
|
-
private renderHistoryBadge;
|
|
131
|
+
private fieldCtx;
|
|
136
132
|
private renderField;
|
|
137
133
|
private renderRelation;
|
|
138
134
|
private renderSearch;
|
|
139
135
|
private renderRelatedView;
|
|
140
|
-
/** Build the canonical parent href `/{base}/{tenant}/{fromClass}/{parentId}` from
|
|
141
|
-
* the object's self href. Empty unless it is a RELATED_VIEW with a fromClass. */
|
|
142
|
-
private buildContainerHref;
|
|
143
136
|
/** Document collection view: owns the view-switch + collection actions and
|
|
144
137
|
* swaps between the folder tree and the flat table. Events are re-emitted to
|
|
145
138
|
* the host with the view key, exactly as the raw list/table events were. */
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { EventEmitter } from '
|
|
2
|
-
import { ColumnFilter } from '
|
|
3
|
-
import { AggregationResult, ClientLayoutItem } from '
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ColumnFilter } from '../../../utils/cell-renderer';
|
|
3
|
+
import { AggregationResult, ClientLayoutItem } from '../../../types/client-layout';
|
|
4
4
|
export declare class MrdTable {
|
|
5
5
|
el: HTMLElement;
|
|
6
6
|
private pendingPages;
|
|
7
7
|
private debounceTimer;
|
|
8
|
+
/** Timestamp of the last mrdLoadPage emission per outstanding page — drives stale-request detection. */
|
|
9
|
+
private requestedAt;
|
|
10
|
+
/** Retry count per page since it first became stale. */
|
|
11
|
+
private retryAttempts;
|
|
12
|
+
private staleCheckTimer;
|
|
8
13
|
private outsideClickHandler;
|
|
9
14
|
private keydownHandler;
|
|
10
15
|
private createPickerClickHandler;
|
|
11
16
|
private viewPopoverClickHandler;
|
|
17
|
+
/** Guards against scheduling more than one column-width measurement per freeze. */
|
|
18
|
+
private colWidthMeasureScheduled;
|
|
12
19
|
/** The VIEW or RELATED_VIEW layout item. Contains view config, dataClass, fromClass, actions etc. */
|
|
13
20
|
item: ClientLayoutItem | null;
|
|
14
21
|
/** Parent record id — required for RELATED_VIEW to build /{fromClass}/{parentId}/{dataClass}. */
|
|
@@ -24,6 +31,9 @@ export declare class MrdTable {
|
|
|
24
31
|
rowHeight: number;
|
|
25
32
|
/** Height of the scroll container in px. */
|
|
26
33
|
tableHeight: number;
|
|
34
|
+
/** Time (ms) to wait for setPage() before retrying a page request; after
|
|
35
|
+
* MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages). */
|
|
36
|
+
requestTimeoutMs: number;
|
|
27
37
|
/** Clamp renderEnd when totalElements shrinks (e.g. after a filter is applied). */
|
|
28
38
|
totalElementsChanged(newVal: number): void;
|
|
29
39
|
/** Reset to primary view when the item prop is replaced from outside. */
|
|
@@ -32,6 +42,8 @@ export declare class MrdTable {
|
|
|
32
42
|
private activeViewIdx;
|
|
33
43
|
loadedPages: Map<number, Record<string, any>[]>;
|
|
34
44
|
requestedPages: Set<number>;
|
|
45
|
+
/** Pages that timed out MAX_RETRY_ATTEMPTS times — rendered as a retry row instead of shimmer. */
|
|
46
|
+
failedPages: Set<number>;
|
|
35
47
|
renderStart: number;
|
|
36
48
|
renderEnd: number;
|
|
37
49
|
colWidths: number[];
|
|
@@ -76,6 +88,11 @@ export declare class MrdTable {
|
|
|
76
88
|
path: string;
|
|
77
89
|
qs: string;
|
|
78
90
|
}>;
|
|
91
|
+
/** Fired when a page request timed out MAX_RETRY_ATTEMPTS times without setPage() being called.
|
|
92
|
+
* Purely informational — the table shows its own retry row regardless of whether a host listens. */
|
|
93
|
+
mrdPageError: EventEmitter<{
|
|
94
|
+
page: number;
|
|
95
|
+
}>;
|
|
79
96
|
/** Fired when a data row is clicked. Detail is the full row object including _links. */
|
|
80
97
|
mrdRowClick: EventEmitter<Record<string, any>>;
|
|
81
98
|
/** Fired when a toolbar action button is clicked.
|
|
@@ -103,6 +120,7 @@ export declare class MrdTable {
|
|
|
103
120
|
aggQs: string;
|
|
104
121
|
}>;
|
|
105
122
|
componentWillLoad(): void;
|
|
123
|
+
componentDidLoad(): void;
|
|
106
124
|
private applyDefaultSort;
|
|
107
125
|
/**
|
|
108
126
|
* Initialise (or reset) the virtual scroll.
|
|
@@ -152,18 +170,22 @@ export declare class MrdTable {
|
|
|
152
170
|
private isTotalKnown;
|
|
153
171
|
/** Effective total: aggregations-response > totalElements prop > minKnownTotal from setPage(). */
|
|
154
172
|
private get baseTotal();
|
|
155
|
-
private buildAggregationParams;
|
|
156
|
-
private buildAggregationQs;
|
|
157
173
|
private emitLoadAggregations;
|
|
158
|
-
private renderAggregationValue;
|
|
159
174
|
/** Reset pagination state and scroll to top (used after sort or filter change). */
|
|
160
175
|
private resetPages;
|
|
161
176
|
private handleSortClick;
|
|
162
177
|
private applySort;
|
|
178
|
+
/** Emits mrdLoadPage for a page and records the request timestamp for stale-request detection. */
|
|
179
|
+
private emitLoadPage;
|
|
163
180
|
private emitPagesForWindow;
|
|
164
181
|
private getRow;
|
|
165
182
|
private requestPagesForWindow;
|
|
166
183
|
private flushPendingPages;
|
|
184
|
+
/** Scans outstanding requests for staleness: retries up to MAX_RETRY_ATTEMPTS times,
|
|
185
|
+
* then gives up and marks the page as failed (rendered as a retry row). */
|
|
186
|
+
private checkStalePages;
|
|
187
|
+
/** Manually retry a page the user gave up on (clicked the retry row). */
|
|
188
|
+
private retryPage;
|
|
167
189
|
private handleScroll;
|
|
168
190
|
private handleFilterToggle;
|
|
169
191
|
private handleFilterOpen;
|
|
@@ -174,24 +196,18 @@ export declare class MrdTable {
|
|
|
174
196
|
private closeJsonModal;
|
|
175
197
|
private setPending;
|
|
176
198
|
private togglePendingValue;
|
|
177
|
-
private filterHasValue;
|
|
178
|
-
private dateLocalToUTCStart;
|
|
179
|
-
private dateLocalToUTCEndExclusive;
|
|
180
|
-
private utcISOToLocalDate;
|
|
181
|
-
private utcISOToLocalDateExclusiveEnd;
|
|
182
199
|
private applyFilter;
|
|
183
200
|
private clearFilter;
|
|
184
201
|
private clearAllFilters;
|
|
185
202
|
private handleViewSwitch;
|
|
186
203
|
private toggleViewPopover;
|
|
204
|
+
private closeViewPopover;
|
|
187
205
|
private renderToolbar;
|
|
188
|
-
private renderFilterEditor;
|
|
189
206
|
private renderFilterPopup;
|
|
190
207
|
private renderFooter;
|
|
191
208
|
private renderCell;
|
|
192
209
|
private renderTotalsRow;
|
|
193
210
|
render(): any;
|
|
194
|
-
private renderFilterIcon;
|
|
195
211
|
private renderTextblockModal;
|
|
196
212
|
private renderJsonModal;
|
|
197
213
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ColumnFilter, TableColumn } from '../../../utils/cell-renderer';
|
|
3
|
+
/**
|
|
4
|
+
* Per-column filter popup of mrd-table (sort buttons + type-specific editor).
|
|
5
|
+
* The pending-filter state stays in the component; every mutation goes
|
|
6
|
+
* through the callbacks. Several branches replace the pending filter
|
|
7
|
+
* wholesale, hence onReplacePending next to onSetPending.
|
|
8
|
+
*/
|
|
9
|
+
export interface FilterPopupCallbacks {
|
|
10
|
+
onSetPending: (key: keyof ColumnFilter, val: unknown) => void;
|
|
11
|
+
onReplacePending: (pf: Partial<ColumnFilter>) => void;
|
|
12
|
+
onToggleValue: (key: string, checked: boolean) => void;
|
|
13
|
+
onApplySort: (dir: 'asc' | 'desc') => void;
|
|
14
|
+
onApply: () => void;
|
|
15
|
+
onClear: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}
|
|
18
|
+
interface EditorProps {
|
|
19
|
+
col: TableColumn;
|
|
20
|
+
dataType: string;
|
|
21
|
+
openFilterCol: string;
|
|
22
|
+
pendingFilter: Partial<ColumnFilter>;
|
|
23
|
+
locale: string;
|
|
24
|
+
cb: FilterPopupCallbacks;
|
|
25
|
+
}
|
|
26
|
+
export declare const FilterEditor: FunctionalComponent<EditorProps>;
|
|
27
|
+
export declare const FilterPopup: FunctionalComponent<EditorProps & {
|
|
28
|
+
popupPos: {
|
|
29
|
+
top: number;
|
|
30
|
+
left: number;
|
|
31
|
+
};
|
|
32
|
+
sortField: string;
|
|
33
|
+
sortDir: 'asc' | 'desc';
|
|
34
|
+
}>;
|
|
35
|
+
export {};
|