@mmlogic/components 0.5.14 → 0.5.16
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-mjS630f1.js → cell-renderer-CLVKTVVQ.js} +105 -1
- package/dist/cjs/{client-layout-CqVuJumR.js → client-layout-Eg2VwW-7.js} +2 -0
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/{mrd-boolean-field_25.cjs.entry.js → mrd-boolean-field_28.cjs.entry.js} +1168 -314
- package/dist/cjs/mrd-merge-view.cjs.entry.js +4 -4
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +47 -2
- package/dist/collection/components/form/mrd-field/mrd-field.css +69 -0
- package/dist/collection/components/form/mrd-field/mrd-field.js +95 -25
- package/dist/collection/components/form/mrd-form/mrd-form.css +29 -0
- package/dist/collection/components/form/mrd-form/mrd-form.js +44 -8
- package/dist/collection/components/layout/mrd-layout-section/field-value.js +19 -2
- package/dist/collection/components/layout/mrd-layout-section/layout-helpers.js +10 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +4 -3
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +169 -18
- package/dist/collection/components/memo/mrd-memo-container/mrd-memo-container.css +204 -0
- package/dist/collection/components/memo/mrd-memo-container/mrd-memo-container.js +769 -0
- package/dist/collection/components/memo/mrd-memo-list/mrd-memo-list.css +164 -0
- package/dist/collection/components/memo/mrd-memo-list/mrd-memo-list.js +559 -0
- package/dist/collection/components/memo/mrd-memo-view/mrd-memo-view.css +108 -0
- package/dist/collection/components/memo/mrd-memo-view/mrd-memo-view.js +204 -0
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +2 -2
- package/dist/collection/components/table/mrd-table/mrd-table.js +9 -6
- package/dist/collection/dev/app.js +30 -15
- package/dist/collection/dev/example-data.js +15 -1
- package/dist/collection/types/client-layout.js +1 -0
- package/dist/collection/utils/i18n.js +104 -0
- package/dist/collection/utils/query-params.js +9 -0
- package/dist/components/client-layout.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-field2.js +1 -1
- package/dist/components/mrd-form.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-memo-container.d.ts +11 -0
- package/dist/components/mrd-memo-container.js +1 -0
- package/dist/components/mrd-memo-container2.js +1 -0
- package/dist/components/mrd-memo-list.d.ts +11 -0
- package/dist/components/mrd-memo-list.js +1 -0
- package/dist/components/mrd-memo-list2.js +1 -0
- package/dist/components/mrd-memo-view.d.ts +11 -0
- package/dist/components/mrd-memo-view.js +1 -0
- package/dist/components/mrd-memo-view2.js +1 -0
- package/dist/components/mrd-merge-view.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/query-params.js +1 -1
- package/dist/components/table-query.js +1 -0
- package/dist/esm/{cell-renderer-BDY8UXkH.js → cell-renderer-4NKEzZWw.js} +105 -1
- package/dist/esm/{client-layout-Bc42CfJB.js → client-layout-BJkVeSq6.js} +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_25.entry.js → mrd-boolean-field_28.entry.js} +1166 -315
- package/dist/esm/mrd-merge-view.entry.js +4 -4
- package/dist/mosterdcomponents/{cell-renderer-B8u5BCK-.js.map → cell-renderer-CMUxFREW.js.map} +1 -1
- package/dist/mosterdcomponents/client-layout-BJkVeSq6.js.map +1 -0
- package/dist/mosterdcomponents/{field-helpers-CNQcI3Hf.js.map → field-helpers-BWAp5fD8.js.map} +1 -1
- package/dist/mosterdcomponents/{file-upload-common-C9wp47CB.js.map → file-upload-common-DDWuC9-3.js.map} +1 -1
- package/dist/mosterdcomponents/i18n-OzbszktW.js.map +1 -0
- package/dist/mosterdcomponents/index-CkcFwdPc.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-8a7fa81d.entry.js +3 -0
- package/dist/mosterdcomponents/{p-Bc42CfJB.js → p-BJkVeSq6.js} +1 -1
- package/dist/mosterdcomponents/p-BMx6VAJ6.js +1 -0
- package/dist/mosterdcomponents/{p-e8b0880f.entry.js → p-e68dfbb0.entry.js} +1 -1
- package/dist/mosterdcomponents/query-params-3TXd5CUO.js.map +1 -0
- package/dist/mosterdcomponents/table-query-DJq1uKqJ.js.map +1 -0
- package/dist/mosterdcomponents/{validation-CjjTt66G.js.map → validation-B_0Lx9DE.js.map} +1 -1
- package/dist/types/components/fields/mrd-textarea-field/mrd-textarea-field.d.ts +10 -0
- package/dist/types/components/form/mrd-field/mrd-field.d.ts +16 -0
- package/dist/types/components/form/mrd-form/mrd-form.d.ts +6 -0
- package/dist/types/components/layout/mrd-layout-section/field-value.d.ts +4 -0
- package/dist/types/components/layout/mrd-layout-section/layout-helpers.d.ts +3 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +25 -1
- package/dist/types/components/memo/mrd-memo-container/mrd-memo-container.d.ts +173 -0
- package/dist/types/components/memo/mrd-memo-list/mrd-memo-list.d.ts +91 -0
- package/dist/types/components/memo/mrd-memo-view/mrd-memo-view.d.ts +33 -0
- package/dist/types/components.d.ts +571 -1
- package/dist/types/types/client-layout.d.ts +1 -0
- package/dist/types/utils/query-params.d.ts +16 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/client-layout-Bc42CfJB.js.map +0 -1
- package/dist/mosterdcomponents/i18n-ydNM87-Q.js.map +0 -1
- package/dist/mosterdcomponents/index-DhffneUF.js.map +0 -1
- package/dist/mosterdcomponents/p-Dkm4WxMy.js +0 -1
- package/dist/mosterdcomponents/p-c834951a.entry.js +0 -3
- package/dist/mosterdcomponents/query-params-BZbQoeYF.js.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem, ClientListValue } from '../../../types/client-layout';
|
|
3
|
+
/**
|
|
4
|
+
* Card-view body for a `commons.memo` collection — the alternative to the flat
|
|
5
|
+
* `mrd-table` a `mrd-memo-container` can switch to. Deliberately simpler than
|
|
6
|
+
* `mrd-table`'s virtual-scroll internals: memo cards accumulate via a plain
|
|
7
|
+
* "load more" affordance rather than windowed rendering, since a bounded card
|
|
8
|
+
* list of notes doesn't need that complexity.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors `mrd-table`'s external contract for the parts a host / mrd-layout-
|
|
11
|
+
* section already knows how to drive — `init()`, `setPage()`, the `mrdLoadPage`
|
|
12
|
+
* event shape `{ page, sort, path, qs }` — so no new host-side wiring is needed
|
|
13
|
+
* to feed it data.
|
|
14
|
+
*
|
|
15
|
+
* There is no separate memo detail page: clicking a card opens mrd-memo-
|
|
16
|
+
* container's quick-edit dialog directly (mrdEdit), the same dialog "New memo"
|
|
17
|
+
* uses for creation.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MrdMemoList {
|
|
20
|
+
/** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
|
|
21
|
+
item: ClientLayoutItem | null;
|
|
22
|
+
/** Resolved `commons.memo` archetype binding. */
|
|
23
|
+
archetype: ClientArchetype;
|
|
24
|
+
/** Parent record id — required for RELATED_VIEW path building. */
|
|
25
|
+
parentId: string;
|
|
26
|
+
/** Records per page (must match API page size). */
|
|
27
|
+
pageSize: number;
|
|
28
|
+
locale: string;
|
|
29
|
+
/** When true, cards are not clickable (no mrdEdit) — matches mrd-table's own
|
|
30
|
+
* readOnly gating on its create action. */
|
|
31
|
+
readOnly: boolean;
|
|
32
|
+
/** listItems of the FIELD bound to the `labels` slot, resolved by mrd-layout-section
|
|
33
|
+
* from its own items array, same reason mrd-memo-view needs it. */
|
|
34
|
+
labelsListItems: ClientListValue[] | null;
|
|
35
|
+
/** False when the list is already scoped to its own container (a company's own
|
|
36
|
+
* memo tab) — showing "belongs to: <this same company>" on every card there
|
|
37
|
+
* would be redundant. True everywhere else (top-level VIEW, or a RELATED_VIEW
|
|
38
|
+
* scoped by a different relation, e.g. a person's authored-memos list). */
|
|
39
|
+
showContainerLink: boolean;
|
|
40
|
+
/** Fired when a page needs fetching; same shape as mrd-table's mrdLoadPage minus `qs`'s
|
|
41
|
+
* column-filter support (cards have no filter UI) — host calls setPage() with the result. */
|
|
42
|
+
mrdLoadPage: EventEmitter<{
|
|
43
|
+
page: number;
|
|
44
|
+
sort: string;
|
|
45
|
+
path: string;
|
|
46
|
+
qs: string;
|
|
47
|
+
}>;
|
|
48
|
+
/** A card was clicked (and not read-only). mrd-memo-container opens its quick-
|
|
49
|
+
* edit dialog pre-filled from `row` — no navigation, no detail page. */
|
|
50
|
+
mrdEdit: EventEmitter<{
|
|
51
|
+
row: Record<string, unknown>;
|
|
52
|
+
}>;
|
|
53
|
+
/** The container link on a card was clicked — this is real navigation (to the
|
|
54
|
+
* container record), unrelated to mrdEdit. */
|
|
55
|
+
mrdNavigate: EventEmitter<{
|
|
56
|
+
href?: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}>;
|
|
59
|
+
private rows;
|
|
60
|
+
private loading;
|
|
61
|
+
private exhausted;
|
|
62
|
+
private started;
|
|
63
|
+
private expandedHrefs;
|
|
64
|
+
private nextPage;
|
|
65
|
+
private buildDataPath;
|
|
66
|
+
private sortParam;
|
|
67
|
+
private emitLoadPage;
|
|
68
|
+
/** Reset and request page 0. Call after setting all props, mirrors mrd-table.init(). */
|
|
69
|
+
init(): Promise<void>;
|
|
70
|
+
/** Inject the rows for a page (0-based); page 0 replaces, later pages append. */
|
|
71
|
+
setPage(pageNumber: number, rows: Record<string, unknown>[], hasNext?: boolean): Promise<void>;
|
|
72
|
+
/** Optimistically merge an edit into the matching row — mrdUpdateObject's PATCH
|
|
73
|
+
* is fire-and-forget on the host side, so this is what makes an edit visible
|
|
74
|
+
* immediately rather than only after the next full reload. */
|
|
75
|
+
patchRow(href: string, values: Record<string, unknown>): Promise<void>;
|
|
76
|
+
/** Optimistically drop a deleted row — mrdDeleteObject's DELETE is fire-and-
|
|
77
|
+
* forget on the host side, same reasoning as patchRow(). */
|
|
78
|
+
removeRow(href: string): Promise<void>;
|
|
79
|
+
private loadMore;
|
|
80
|
+
/** Value of a value-slot: reads row[field] via the slot→field map. */
|
|
81
|
+
private slotValue;
|
|
82
|
+
/** Relation link for a relation-slot: reads row._links[field]. */
|
|
83
|
+
private slotLink;
|
|
84
|
+
private plainTextLength;
|
|
85
|
+
private toggleExpanded;
|
|
86
|
+
private renderContainer;
|
|
87
|
+
private renderLabels;
|
|
88
|
+
private renderBody;
|
|
89
|
+
private renderCard;
|
|
90
|
+
render(): any;
|
|
91
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { ClientArchetype, ClientListValue } from '../../../types/client-layout';
|
|
3
|
+
/**
|
|
4
|
+
* Archetype-driven single-memo view. Given a `commons.memo` binding and a data
|
|
5
|
+
* record, renders the memo the way a note should read: the title and body are
|
|
6
|
+
* the prominent content, author and timestamp sit below as a subtle metadata
|
|
7
|
+
* line — not the other way around.
|
|
8
|
+
*/
|
|
9
|
+
export declare class MrdMemoView {
|
|
10
|
+
/** Resolved `commons.memo` binding: slot name → concrete field/relation name. */
|
|
11
|
+
archetype: ClientArchetype;
|
|
12
|
+
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
13
|
+
data: Record<string, unknown>;
|
|
14
|
+
locale: string;
|
|
15
|
+
/** listItems of the FIELD bound to the `labels` slot, resolved by mrd-layout-section
|
|
16
|
+
* from its own items array (archetype metadata does not publish listItems), so the
|
|
17
|
+
* label badges get a real label/color instead of the raw stored key. */
|
|
18
|
+
labelsListItems: ClientListValue[] | null;
|
|
19
|
+
/** Navigate to the author or the container. Host resolves the href and routes. */
|
|
20
|
+
mrdNavigate: EventEmitter<{
|
|
21
|
+
href?: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
25
|
+
private slotValue;
|
|
26
|
+
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
27
|
+
private slotLink;
|
|
28
|
+
private renderAuthor;
|
|
29
|
+
private renderContainer;
|
|
30
|
+
private renderLabels;
|
|
31
|
+
private renderBody;
|
|
32
|
+
render(): any;
|
|
33
|
+
}
|