@mmlogic/components 0.5.0 → 0.5.2
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/cell-renderer-CmaO0CZT.js +862 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/mrd-boolean-field_23.cjs.entry.js +2506 -832
- package/dist/cjs/mrd-merge-view.cjs.entry.js +273 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +27 -24
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +16 -9
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +9 -5
- package/dist/collection/components/merge/mrd-merge-view/merge-diff.js +99 -0
- package/dist/collection/components/merge/mrd-merge-view/merge-parts.js +44 -0
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.css +244 -0
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +397 -0
- package/dist/collection/components/table/mrd-table/mrd-table.js +2 -4
- package/dist/collection/components/table/mrd-table/table-parts.js +2 -5
- package/dist/collection/dev/api.js +24 -0
- package/dist/collection/dev/app.js +84 -4
- package/dist/collection/dev/example-data.js +2 -1
- package/dist/collection/utils/cell-renderer.js +6 -1
- package/dist/collection/utils/i18n.js +104 -0
- package/dist/components/cell-renderer.js +1 -0
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-merge-view.d.ts +11 -0
- package/dist/components/mrd-merge-view.js +1 -0
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +2 -1
- package/dist/esm/cell-renderer-D63AUZxa.js +854 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_23.entry.js +2437 -763
- package/dist/esm/mrd-merge-view.entry.js +271 -0
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-2e16a7d0.entry.js +1 -0
- package/dist/mosterdcomponents/p-CnqDM0Gb.js +1 -0
- package/dist/mosterdcomponents/p-b5f38707.entry.js +3 -0
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +9 -5
- package/dist/types/components/fields/mrd-textarea-field/mrd-textarea-field.d.ts +1 -0
- package/dist/types/components/merge/mrd-merge-view/merge-diff.d.ts +43 -0
- package/dist/types/components/merge/mrd-merge-view/merge-parts.d.ts +37 -0
- package/dist/types/components/merge/mrd-merge-view/mrd-merge-view.d.ts +68 -0
- package/dist/types/components.d.ts +167 -12
- package/dist/types/types/client-layout.d.ts +2 -3
- package/package.json +2 -1
- package/dist/mosterdcomponents/p-b56f9802.entry.js +0 -1
|
@@ -2,9 +2,10 @@ import { EventEmitter } from '../../../stencil-public-runtime';
|
|
|
2
2
|
import { ClientArchetype, DocumentAttachment } from '../../../types/client-layout';
|
|
3
3
|
/**
|
|
4
4
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
5
|
-
* data record, renders the document recognisably — title,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* data record, renders the document recognisably — title, date, a navigation
|
|
6
|
+
* link to the container (the dossier) presented like any other data-object link
|
|
7
|
+
* (primary-coloured text link), an optional muted folder path, a download button
|
|
8
|
+
* and summary — instead of a generic field form.
|
|
8
9
|
*
|
|
9
10
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
10
11
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
@@ -50,9 +51,12 @@ export declare class MrdDocumentView {
|
|
|
50
51
|
private slotValue;
|
|
51
52
|
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
52
53
|
private slotLink;
|
|
54
|
+
/** Container link (styled like relation links in layout sections: primary text
|
|
55
|
+
* link) plus a muted, non-interactive folder path when present. */
|
|
53
56
|
private renderContainer;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
57
|
+
/** Download button — the only file-related UI this component owns; the filename
|
|
58
|
+
* is deliberately not shown (rarely relevant, the title identifies the document)
|
|
59
|
+
* and inline preview rendering is entirely the host's responsibility. */
|
|
56
60
|
private renderFileMeta;
|
|
57
61
|
render(): any;
|
|
58
62
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ClientLayoutItem } from '../../../types/client-layout';
|
|
2
|
+
/** A single field/relation whose value differs between the two records being merged. */
|
|
3
|
+
export interface MergeFieldDiff {
|
|
4
|
+
item: ClientLayoutItem;
|
|
5
|
+
aValue: unknown;
|
|
6
|
+
bValue: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether a layout item can appear in the merge diff at all. m-n relations
|
|
10
|
+
* (`multiple: true`) are unioned automatically server-side (DataService.merge)
|
|
11
|
+
* and must never be surfaced as a user choice — only FIELD and single-value
|
|
12
|
+
* (n-1) RELATION items are diffable.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isDiffable(item: ClientLayoutItem): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Raw value for a field/relation off a record in the API's row shape (flat
|
|
17
|
+
* fields + `_links`). History-enabled fields come back as `{ current,
|
|
18
|
+
* history: [...] }` — this returns that whole object as-is, since a winning
|
|
19
|
+
* B value must carry its entire history into the patch (FINDING-0114: "the
|
|
20
|
+
* entire history list follows whichever value wins ... never interleaved").
|
|
21
|
+
*/
|
|
22
|
+
export declare function getRawValue(item: ClientLayoutItem, record: Record<string, any> | null | undefined): unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Splits diffable fields into `conflicts` (both records have a — different —
|
|
25
|
+
* value, user must pick) and `autoFilled` (A has no value, B does; silently
|
|
26
|
+
* taken from B without a UI choice).
|
|
27
|
+
*/
|
|
28
|
+
export declare function diffFields(fields: ClientLayoutItem[], recordA: Record<string, any> | null | undefined, recordB: Record<string, any> | null | undefined): {
|
|
29
|
+
conflicts: MergeFieldDiff[];
|
|
30
|
+
autoFilled: MergeFieldDiff[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Builds the patch payload per the merge endpoint contract: every `autoFilled`
|
|
34
|
+
* entry is always included (A had nothing to lose); a `conflicts` entry is
|
|
35
|
+
* only included when the user explicitly resolved it to B — anything left
|
|
36
|
+
* unresolved keeps A's value by omission.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildPatch(diff: {
|
|
39
|
+
conflicts: MergeFieldDiff[];
|
|
40
|
+
autoFilled: MergeFieldDiff[];
|
|
41
|
+
}, resolutions: Record<string, 'A' | 'B'>): Record<string, unknown>;
|
|
42
|
+
/** Display label for a candidate record in the search results list. */
|
|
43
|
+
export declare function candidateLabel(record: Record<string, any> | null | undefined): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
2
|
+
import { MergeFieldDiff } from './merge-diff';
|
|
3
|
+
export declare const MergeSearchStep: FunctionalComponent<{
|
|
4
|
+
locale: string;
|
|
5
|
+
searchQuery: string;
|
|
6
|
+
searchResults: Record<string, any>[];
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
onSearchInput: (query: string) => void;
|
|
9
|
+
onSelect: (record: Record<string, any>) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const MergeCompareStep: FunctionalComponent<{
|
|
12
|
+
locale: string;
|
|
13
|
+
currentLabel: string;
|
|
14
|
+
candidateLabel: string;
|
|
15
|
+
conflicts: MergeFieldDiff[];
|
|
16
|
+
autoFilled: MergeFieldDiff[];
|
|
17
|
+
recordA: Record<string, any>;
|
|
18
|
+
recordB: Record<string, any>;
|
|
19
|
+
resolutions: Record<string, 'A' | 'B'>;
|
|
20
|
+
openHistoryKey: string | null;
|
|
21
|
+
onResolve: (name: string, side: 'A' | 'B') => void;
|
|
22
|
+
onToggleHistory: (key: string | null) => void;
|
|
23
|
+
onChangeCandidate: () => void;
|
|
24
|
+
onContinue: () => void;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const MergeConfirmStep: FunctionalComponent<{
|
|
27
|
+
locale: string;
|
|
28
|
+
candidateLabel: string;
|
|
29
|
+
conflicts: MergeFieldDiff[];
|
|
30
|
+
autoFilled: MergeFieldDiff[];
|
|
31
|
+
resolutions: Record<string, 'A' | 'B'>;
|
|
32
|
+
recordB: Record<string, any>;
|
|
33
|
+
openHistoryKey: string | null;
|
|
34
|
+
onToggleHistory: (key: string | null) => void;
|
|
35
|
+
onBack: () => void;
|
|
36
|
+
onConfirm: () => void;
|
|
37
|
+
}>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientLayoutItem } from '../../../types/client-layout';
|
|
3
|
+
type MergeStep = 'search' | 'compare' | 'confirm';
|
|
4
|
+
/**
|
|
5
|
+
* Merges two DataObjects of the same basic type (FINDING-0114 / TASK-0177).
|
|
6
|
+
* Never performs network I/O itself: it emits `mrdSearch` (host searches and
|
|
7
|
+
* calls `setSearchResults()`, mirroring mrd-relation-field) and `mrdMerge`
|
|
8
|
+
* (host calls the merge endpoint — `POST {winnerHref}/merge` with
|
|
9
|
+
* `{ loser: loserHref, patch }`, per DataController.merge()).
|
|
10
|
+
*
|
|
11
|
+
* Has no exit/cancel affordance of its own — hosts show this inside their
|
|
12
|
+
* own overlay-page chrome (its close button), the same way mrd-layout-section
|
|
13
|
+
* never renders a page-level close button either.
|
|
14
|
+
*/
|
|
15
|
+
export declare class MrdMergeView {
|
|
16
|
+
el: HTMLElement;
|
|
17
|
+
locale: string;
|
|
18
|
+
/** Dot-notation class, passed through on mrdSearch (host may use it to pick the right search endpoint). */
|
|
19
|
+
basicType: string;
|
|
20
|
+
/** URL segment for the search endpoint; falls back to basicType when absent. */
|
|
21
|
+
mostSignificantClass: string;
|
|
22
|
+
/** Flat FIELD/RELATION items describing the basic type's schema (host flattens SECTION/GROUP, same as mrd-table's `columns`). */
|
|
23
|
+
fields: ClientLayoutItem[];
|
|
24
|
+
/** Href of A (winner) — the object the merge screen was opened from. */
|
|
25
|
+
currentHref: string;
|
|
26
|
+
/** A's full raw record: flat fields + `_links`, the same row shape CellRenderer.render expects. */
|
|
27
|
+
currentRecord: Record<string, any>;
|
|
28
|
+
/** Display name for A, shown in the compare step's column header. */
|
|
29
|
+
currentLabel: string;
|
|
30
|
+
step: MergeStep;
|
|
31
|
+
searchQuery: string;
|
|
32
|
+
searchResults: Record<string, any>[];
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
candidate: Record<string, any> | null;
|
|
35
|
+
resolutions: Record<string, 'A' | 'B'>;
|
|
36
|
+
/** Which history badge popover is open, keyed e.g. `legalName:A` / `legalName:confirm`. */
|
|
37
|
+
openHistoryKey: string | null;
|
|
38
|
+
mrdSearch: EventEmitter<{
|
|
39
|
+
query: string;
|
|
40
|
+
basicType: string;
|
|
41
|
+
mostSignificantClass?: string;
|
|
42
|
+
}>;
|
|
43
|
+
mrdMerge: EventEmitter<{
|
|
44
|
+
winnerHref: string;
|
|
45
|
+
loserHref: string;
|
|
46
|
+
patch: Record<string, unknown>;
|
|
47
|
+
}>;
|
|
48
|
+
private historyClickOutside;
|
|
49
|
+
connectedCallback(): void;
|
|
50
|
+
disconnectedCallback(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Stores search results, filtering out A itself regardless of what the
|
|
53
|
+
* host's search returns — A must never appear as a mergeable candidate.
|
|
54
|
+
*/
|
|
55
|
+
setSearchResults(records: Record<string, any>[]): Promise<void>;
|
|
56
|
+
setLoading(loading: boolean): Promise<void>;
|
|
57
|
+
private searchDebounce;
|
|
58
|
+
private handleSearchInput;
|
|
59
|
+
private handleSelect;
|
|
60
|
+
private handleChangeCandidate;
|
|
61
|
+
private handleResolve;
|
|
62
|
+
private handleToggleHistory;
|
|
63
|
+
private handleContinue;
|
|
64
|
+
private handleBack;
|
|
65
|
+
private handleConfirm;
|
|
66
|
+
render(): any;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -226,9 +226,10 @@ export namespace Components {
|
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
229
|
-
* data record, renders the document recognisably — title,
|
|
230
|
-
*
|
|
231
|
-
*
|
|
229
|
+
* data record, renders the document recognisably — title, date, a navigation
|
|
230
|
+
* link to the container (the dossier) presented like any other data-object link
|
|
231
|
+
* (primary-coloured text link), an optional muted folder path, a download button
|
|
232
|
+
* and summary — instead of a generic field form.
|
|
232
233
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
233
234
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
234
235
|
* `data._links[field]` (`{ href, name }`). Empty slots are omitted.
|
|
@@ -549,6 +550,57 @@ export namespace Components {
|
|
|
549
550
|
*/
|
|
550
551
|
"value": string;
|
|
551
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Merges two DataObjects of the same basic type (FINDING-0114 / TASK-0177).
|
|
555
|
+
* Never performs network I/O itself: it emits `mrdSearch` (host searches and
|
|
556
|
+
* calls `setSearchResults()`, mirroring mrd-relation-field) and `mrdMerge`
|
|
557
|
+
* (host calls the merge endpoint — `POST {winnerHref}/merge` with
|
|
558
|
+
* `{ loser: loserHref, patch }`, per DataController.merge()).
|
|
559
|
+
* Has no exit/cancel affordance of its own — hosts show this inside their
|
|
560
|
+
* own overlay-page chrome (its close button), the same way mrd-layout-section
|
|
561
|
+
* never renders a page-level close button either.
|
|
562
|
+
*/
|
|
563
|
+
interface MrdMergeView {
|
|
564
|
+
/**
|
|
565
|
+
* Dot-notation class, passed through on mrdSearch (host may use it to pick the right search endpoint).
|
|
566
|
+
* @default ''
|
|
567
|
+
*/
|
|
568
|
+
"basicType": string;
|
|
569
|
+
/**
|
|
570
|
+
* Href of A (winner) — the object the merge screen was opened from.
|
|
571
|
+
* @default ''
|
|
572
|
+
*/
|
|
573
|
+
"currentHref": string;
|
|
574
|
+
/**
|
|
575
|
+
* Display name for A, shown in the compare step's column header.
|
|
576
|
+
* @default ''
|
|
577
|
+
*/
|
|
578
|
+
"currentLabel": string;
|
|
579
|
+
/**
|
|
580
|
+
* A's full raw record: flat fields + `_links`, the same row shape CellRenderer.render expects.
|
|
581
|
+
* @default {}
|
|
582
|
+
*/
|
|
583
|
+
"currentRecord": Record<string, any>;
|
|
584
|
+
/**
|
|
585
|
+
* Flat FIELD/RELATION items describing the basic type's schema (host flattens SECTION/GROUP, same as mrd-table's `columns`).
|
|
586
|
+
* @default []
|
|
587
|
+
*/
|
|
588
|
+
"fields": ClientLayoutItem[];
|
|
589
|
+
/**
|
|
590
|
+
* @default navigator.language
|
|
591
|
+
*/
|
|
592
|
+
"locale": string;
|
|
593
|
+
/**
|
|
594
|
+
* URL segment for the search endpoint; falls back to basicType when absent.
|
|
595
|
+
* @default ''
|
|
596
|
+
*/
|
|
597
|
+
"mostSignificantClass": string;
|
|
598
|
+
"setLoading": (loading: boolean) => Promise<void>;
|
|
599
|
+
/**
|
|
600
|
+
* Stores search results, filtering out A itself regardless of what the host's search returns — A must never appear as a mergeable candidate.
|
|
601
|
+
*/
|
|
602
|
+
"setSearchResults": (records: Record<string, any>[]) => Promise<void>;
|
|
603
|
+
}
|
|
552
604
|
interface MrdNumberField {
|
|
553
605
|
/**
|
|
554
606
|
* @default ClientLayoutItemFieldDataType.INTEGER
|
|
@@ -879,6 +931,10 @@ export interface MrdLongtextFieldCustomEvent<T> extends CustomEvent<T> {
|
|
|
879
931
|
detail: T;
|
|
880
932
|
target: HTMLMrdLongtextFieldElement;
|
|
881
933
|
}
|
|
934
|
+
export interface MrdMergeViewCustomEvent<T> extends CustomEvent<T> {
|
|
935
|
+
detail: T;
|
|
936
|
+
target: HTMLMrdMergeViewElement;
|
|
937
|
+
}
|
|
882
938
|
export interface MrdNumberFieldCustomEvent<T> extends CustomEvent<T> {
|
|
883
939
|
detail: T;
|
|
884
940
|
target: HTMLMrdNumberFieldElement;
|
|
@@ -1060,9 +1116,10 @@ declare global {
|
|
|
1060
1116
|
}
|
|
1061
1117
|
/**
|
|
1062
1118
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
1063
|
-
* data record, renders the document recognisably — title,
|
|
1064
|
-
*
|
|
1065
|
-
*
|
|
1119
|
+
* data record, renders the document recognisably — title, date, a navigation
|
|
1120
|
+
* link to the container (the dossier) presented like any other data-object link
|
|
1121
|
+
* (primary-coloured text link), an optional muted folder path, a download button
|
|
1122
|
+
* and summary — instead of a generic field form.
|
|
1066
1123
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
1067
1124
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
1068
1125
|
* `data._links[field]` (`{ href, name }`). Empty slots are omitted.
|
|
@@ -1266,6 +1323,34 @@ declare global {
|
|
|
1266
1323
|
prototype: HTMLMrdLongtextFieldElement;
|
|
1267
1324
|
new (): HTMLMrdLongtextFieldElement;
|
|
1268
1325
|
};
|
|
1326
|
+
interface HTMLMrdMergeViewElementEventMap {
|
|
1327
|
+
"mrdSearch": { query: string; basicType: string; mostSignificantClass?: string };
|
|
1328
|
+
"mrdMerge": { winnerHref: string; loserHref: string; patch: Record<string, unknown> };
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Merges two DataObjects of the same basic type (FINDING-0114 / TASK-0177).
|
|
1332
|
+
* Never performs network I/O itself: it emits `mrdSearch` (host searches and
|
|
1333
|
+
* calls `setSearchResults()`, mirroring mrd-relation-field) and `mrdMerge`
|
|
1334
|
+
* (host calls the merge endpoint — `POST {winnerHref}/merge` with
|
|
1335
|
+
* `{ loser: loserHref, patch }`, per DataController.merge()).
|
|
1336
|
+
* Has no exit/cancel affordance of its own — hosts show this inside their
|
|
1337
|
+
* own overlay-page chrome (its close button), the same way mrd-layout-section
|
|
1338
|
+
* never renders a page-level close button either.
|
|
1339
|
+
*/
|
|
1340
|
+
interface HTMLMrdMergeViewElement extends Components.MrdMergeView, HTMLStencilElement {
|
|
1341
|
+
addEventListener<K extends keyof HTMLMrdMergeViewElementEventMap>(type: K, listener: (this: HTMLMrdMergeViewElement, ev: MrdMergeViewCustomEvent<HTMLMrdMergeViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1342
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1343
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1344
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1345
|
+
removeEventListener<K extends keyof HTMLMrdMergeViewElementEventMap>(type: K, listener: (this: HTMLMrdMergeViewElement, ev: MrdMergeViewCustomEvent<HTMLMrdMergeViewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1346
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1347
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1348
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1349
|
+
}
|
|
1350
|
+
var HTMLMrdMergeViewElement: {
|
|
1351
|
+
prototype: HTMLMrdMergeViewElement;
|
|
1352
|
+
new (): HTMLMrdMergeViewElement;
|
|
1353
|
+
};
|
|
1269
1354
|
interface HTMLMrdNumberFieldElementEventMap {
|
|
1270
1355
|
"mrdChange": { name: string; value: number | null };
|
|
1271
1356
|
"mrdBlur": { name: string; value: number | null };
|
|
@@ -1415,6 +1500,7 @@ declare global {
|
|
|
1415
1500
|
"mrd-layout-section": HTMLMrdLayoutSectionElement;
|
|
1416
1501
|
"mrd-list-field": HTMLMrdListFieldElement;
|
|
1417
1502
|
"mrd-longtext-field": HTMLMrdLongtextFieldElement;
|
|
1503
|
+
"mrd-merge-view": HTMLMrdMergeViewElement;
|
|
1418
1504
|
"mrd-number-field": HTMLMrdNumberFieldElement;
|
|
1419
1505
|
"mrd-relation-field": HTMLMrdRelationFieldElement;
|
|
1420
1506
|
"mrd-secret-field": HTMLMrdSecretFieldElement;
|
|
@@ -1685,9 +1771,10 @@ declare namespace LocalJSX {
|
|
|
1685
1771
|
}
|
|
1686
1772
|
/**
|
|
1687
1773
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
1688
|
-
* data record, renders the document recognisably — title,
|
|
1689
|
-
*
|
|
1690
|
-
*
|
|
1774
|
+
* data record, renders the document recognisably — title, date, a navigation
|
|
1775
|
+
* link to the container (the dossier) presented like any other data-object link
|
|
1776
|
+
* (primary-coloured text link), an optional muted folder path, a download button
|
|
1777
|
+
* and summary — instead of a generic field form.
|
|
1691
1778
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
1692
1779
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
1693
1780
|
* `data._links[field]` (`{ href, name }`). Empty slots are omitted.
|
|
@@ -2059,6 +2146,54 @@ declare namespace LocalJSX {
|
|
|
2059
2146
|
*/
|
|
2060
2147
|
"value"?: string;
|
|
2061
2148
|
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Merges two DataObjects of the same basic type (FINDING-0114 / TASK-0177).
|
|
2151
|
+
* Never performs network I/O itself: it emits `mrdSearch` (host searches and
|
|
2152
|
+
* calls `setSearchResults()`, mirroring mrd-relation-field) and `mrdMerge`
|
|
2153
|
+
* (host calls the merge endpoint — `POST {winnerHref}/merge` with
|
|
2154
|
+
* `{ loser: loserHref, patch }`, per DataController.merge()).
|
|
2155
|
+
* Has no exit/cancel affordance of its own — hosts show this inside their
|
|
2156
|
+
* own overlay-page chrome (its close button), the same way mrd-layout-section
|
|
2157
|
+
* never renders a page-level close button either.
|
|
2158
|
+
*/
|
|
2159
|
+
interface MrdMergeView {
|
|
2160
|
+
/**
|
|
2161
|
+
* Dot-notation class, passed through on mrdSearch (host may use it to pick the right search endpoint).
|
|
2162
|
+
* @default ''
|
|
2163
|
+
*/
|
|
2164
|
+
"basicType"?: string;
|
|
2165
|
+
/**
|
|
2166
|
+
* Href of A (winner) — the object the merge screen was opened from.
|
|
2167
|
+
* @default ''
|
|
2168
|
+
*/
|
|
2169
|
+
"currentHref"?: string;
|
|
2170
|
+
/**
|
|
2171
|
+
* Display name for A, shown in the compare step's column header.
|
|
2172
|
+
* @default ''
|
|
2173
|
+
*/
|
|
2174
|
+
"currentLabel"?: string;
|
|
2175
|
+
/**
|
|
2176
|
+
* A's full raw record: flat fields + `_links`, the same row shape CellRenderer.render expects.
|
|
2177
|
+
* @default {}
|
|
2178
|
+
*/
|
|
2179
|
+
"currentRecord"?: Record<string, any>;
|
|
2180
|
+
/**
|
|
2181
|
+
* Flat FIELD/RELATION items describing the basic type's schema (host flattens SECTION/GROUP, same as mrd-table's `columns`).
|
|
2182
|
+
* @default []
|
|
2183
|
+
*/
|
|
2184
|
+
"fields"?: ClientLayoutItem[];
|
|
2185
|
+
/**
|
|
2186
|
+
* @default navigator.language
|
|
2187
|
+
*/
|
|
2188
|
+
"locale"?: string;
|
|
2189
|
+
/**
|
|
2190
|
+
* URL segment for the search endpoint; falls back to basicType when absent.
|
|
2191
|
+
* @default ''
|
|
2192
|
+
*/
|
|
2193
|
+
"mostSignificantClass"?: string;
|
|
2194
|
+
"onMrdMerge"?: (event: MrdMergeViewCustomEvent<{ winnerHref: string; loserHref: string; patch: Record<string, unknown> }>) => void;
|
|
2195
|
+
"onMrdSearch"?: (event: MrdMergeViewCustomEvent<{ query: string; basicType: string; mostSignificantClass?: string }>) => void;
|
|
2196
|
+
}
|
|
2062
2197
|
interface MrdNumberField {
|
|
2063
2198
|
/**
|
|
2064
2199
|
* @default ClientLayoutItemFieldDataType.INTEGER
|
|
@@ -2460,6 +2595,13 @@ declare namespace LocalJSX {
|
|
|
2460
2595
|
"disabled": boolean;
|
|
2461
2596
|
"locale": string;
|
|
2462
2597
|
}
|
|
2598
|
+
interface MrdMergeViewAttributes {
|
|
2599
|
+
"locale": string;
|
|
2600
|
+
"basicType": string;
|
|
2601
|
+
"mostSignificantClass": string;
|
|
2602
|
+
"currentHref": string;
|
|
2603
|
+
"currentLabel": string;
|
|
2604
|
+
}
|
|
2463
2605
|
interface MrdNumberFieldAttributes {
|
|
2464
2606
|
"name": string;
|
|
2465
2607
|
"label": string;
|
|
@@ -2547,6 +2689,7 @@ declare namespace LocalJSX {
|
|
|
2547
2689
|
"mrd-layout-section": Omit<MrdLayoutSection, keyof MrdLayoutSectionAttributes> & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes]?: MrdLayoutSection[K] } & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes as `attr:${K}`]?: MrdLayoutSectionAttributes[K] } & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes as `prop:${K}`]?: MrdLayoutSection[K] };
|
|
2548
2690
|
"mrd-list-field": Omit<MrdListField, keyof MrdListFieldAttributes> & { [K in keyof MrdListField & keyof MrdListFieldAttributes]?: MrdListField[K] } & { [K in keyof MrdListField & keyof MrdListFieldAttributes as `attr:${K}`]?: MrdListFieldAttributes[K] } & { [K in keyof MrdListField & keyof MrdListFieldAttributes as `prop:${K}`]?: MrdListField[K] };
|
|
2549
2691
|
"mrd-longtext-field": Omit<MrdLongtextField, keyof MrdLongtextFieldAttributes> & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes]?: MrdLongtextField[K] } & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes as `attr:${K}`]?: MrdLongtextFieldAttributes[K] } & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes as `prop:${K}`]?: MrdLongtextField[K] };
|
|
2692
|
+
"mrd-merge-view": Omit<MrdMergeView, keyof MrdMergeViewAttributes> & { [K in keyof MrdMergeView & keyof MrdMergeViewAttributes]?: MrdMergeView[K] } & { [K in keyof MrdMergeView & keyof MrdMergeViewAttributes as `attr:${K}`]?: MrdMergeViewAttributes[K] } & { [K in keyof MrdMergeView & keyof MrdMergeViewAttributes as `prop:${K}`]?: MrdMergeView[K] };
|
|
2550
2693
|
"mrd-number-field": Omit<MrdNumberField, keyof MrdNumberFieldAttributes> & { [K in keyof MrdNumberField & keyof MrdNumberFieldAttributes]?: MrdNumberField[K] } & { [K in keyof MrdNumberField & keyof MrdNumberFieldAttributes as `attr:${K}`]?: MrdNumberFieldAttributes[K] } & { [K in keyof MrdNumberField & keyof MrdNumberFieldAttributes as `prop:${K}`]?: MrdNumberField[K] };
|
|
2551
2694
|
"mrd-relation-field": Omit<MrdRelationField, keyof MrdRelationFieldAttributes> & { [K in keyof MrdRelationField & keyof MrdRelationFieldAttributes]?: MrdRelationField[K] } & { [K in keyof MrdRelationField & keyof MrdRelationFieldAttributes as `attr:${K}`]?: MrdRelationFieldAttributes[K] } & { [K in keyof MrdRelationField & keyof MrdRelationFieldAttributes as `prop:${K}`]?: MrdRelationField[K] };
|
|
2552
2695
|
"mrd-secret-field": Omit<MrdSecretField, keyof MrdSecretFieldAttributes> & { [K in keyof MrdSecretField & keyof MrdSecretFieldAttributes]?: MrdSecretField[K] } & { [K in keyof MrdSecretField & keyof MrdSecretFieldAttributes as `attr:${K}`]?: MrdSecretFieldAttributes[K] } & { [K in keyof MrdSecretField & keyof MrdSecretFieldAttributes as `prop:${K}`]?: MrdSecretField[K] };
|
|
@@ -2594,9 +2737,10 @@ declare module "@stencil/core" {
|
|
|
2594
2737
|
"mrd-document-list": LocalJSX.IntrinsicElements["mrd-document-list"] & JSXBase.HTMLAttributes<HTMLMrdDocumentListElement>;
|
|
2595
2738
|
/**
|
|
2596
2739
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
2597
|
-
* data record, renders the document recognisably — title,
|
|
2598
|
-
*
|
|
2599
|
-
*
|
|
2740
|
+
* data record, renders the document recognisably — title, date, a navigation
|
|
2741
|
+
* link to the container (the dossier) presented like any other data-object link
|
|
2742
|
+
* (primary-coloured text link), an optional muted folder path, a download button
|
|
2743
|
+
* and summary — instead of a generic field form.
|
|
2600
2744
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
2601
2745
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
2602
2746
|
* `data._links[field]` (`{ href, name }`). Empty slots are omitted.
|
|
@@ -2616,6 +2760,17 @@ declare module "@stencil/core" {
|
|
|
2616
2760
|
"mrd-layout-section": LocalJSX.IntrinsicElements["mrd-layout-section"] & JSXBase.HTMLAttributes<HTMLMrdLayoutSectionElement>;
|
|
2617
2761
|
"mrd-list-field": LocalJSX.IntrinsicElements["mrd-list-field"] & JSXBase.HTMLAttributes<HTMLMrdListFieldElement>;
|
|
2618
2762
|
"mrd-longtext-field": LocalJSX.IntrinsicElements["mrd-longtext-field"] & JSXBase.HTMLAttributes<HTMLMrdLongtextFieldElement>;
|
|
2763
|
+
/**
|
|
2764
|
+
* Merges two DataObjects of the same basic type (FINDING-0114 / TASK-0177).
|
|
2765
|
+
* Never performs network I/O itself: it emits `mrdSearch` (host searches and
|
|
2766
|
+
* calls `setSearchResults()`, mirroring mrd-relation-field) and `mrdMerge`
|
|
2767
|
+
* (host calls the merge endpoint — `POST {winnerHref}/merge` with
|
|
2768
|
+
* `{ loser: loserHref, patch }`, per DataController.merge()).
|
|
2769
|
+
* Has no exit/cancel affordance of its own — hosts show this inside their
|
|
2770
|
+
* own overlay-page chrome (its close button), the same way mrd-layout-section
|
|
2771
|
+
* never renders a page-level close button either.
|
|
2772
|
+
*/
|
|
2773
|
+
"mrd-merge-view": LocalJSX.IntrinsicElements["mrd-merge-view"] & JSXBase.HTMLAttributes<HTMLMrdMergeViewElement>;
|
|
2619
2774
|
"mrd-number-field": LocalJSX.IntrinsicElements["mrd-number-field"] & JSXBase.HTMLAttributes<HTMLMrdNumberFieldElement>;
|
|
2620
2775
|
"mrd-relation-field": LocalJSX.IntrinsicElements["mrd-relation-field"] & JSXBase.HTMLAttributes<HTMLMrdRelationFieldElement>;
|
|
2621
2776
|
"mrd-secret-field": LocalJSX.IntrinsicElements["mrd-secret-field"] & JSXBase.HTMLAttributes<HTMLMrdSecretFieldElement>;
|
|
@@ -134,11 +134,10 @@ export interface ClientLayoutItemField {
|
|
|
134
134
|
aggregate?: 'sum' | 'avg' | 'count' | null;
|
|
135
135
|
historyEnabled?: boolean;
|
|
136
136
|
}
|
|
137
|
-
/** Response shape from the /aggregations endpoint.
|
|
138
|
-
* `count` is a plain number (total record count) when returned at the top level. */
|
|
137
|
+
/** Response shape from the /aggregations endpoint. */
|
|
139
138
|
export interface AggregationResult {
|
|
140
139
|
total?: number;
|
|
141
|
-
count?:
|
|
140
|
+
count?: Record<string, number>;
|
|
142
141
|
sum?: Record<string, number>;
|
|
143
142
|
avg?: Record<string, number>;
|
|
144
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmlogic/components",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Stencil.js web component library for dynamic forms and virtual-scroll data tables",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mosterd",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@stencil/core": "^4.43.5",
|
|
46
|
+
"dompurify": "^3.4.12",
|
|
46
47
|
"quill": "^2.0.3"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|