@mmlogic/components 0.5.14 → 0.5.15
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} +1022 -335
- 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-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/mrd-layout-section.js +126 -13
- 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 +694 -0
- package/dist/collection/components/memo/mrd-memo-list/mrd-memo-list.css +150 -0
- package/dist/collection/components/memo/mrd-memo-list/mrd-memo-list.js +511 -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 +17 -0
- 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-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} +1020 -336
- package/dist/esm/mrd-merge-view.entry.js +4 -4
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/{p-Bc42CfJB.js → p-BJkVeSq6.js} +1 -1
- package/dist/mosterdcomponents/p-BMx6VAJ6.js +1 -0
- package/dist/mosterdcomponents/p-d64ba1f2.entry.js +3 -0
- package/dist/mosterdcomponents/{p-e8b0880f.entry.js → p-e68dfbb0.entry.js} +1 -1
- package/dist/types/components/fields/mrd-textarea-field/mrd-textarea-field.d.ts +10 -0
- package/dist/types/components/form/mrd-form/mrd-form.d.ts +6 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +20 -1
- package/dist/types/components/memo/mrd-memo-container/mrd-memo-container.d.ts +152 -0
- package/dist/types/components/memo/mrd-memo-list/mrd-memo-list.d.ts +79 -0
- package/dist/types/components/memo/mrd-memo-view/mrd-memo-view.d.ts +33 -0
- package/dist/types/components.d.ts +528 -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/cell-renderer-B8u5BCK-.js.map +0 -1
- package/dist/mosterdcomponents/client-layout-Bc42CfJB.js.map +0 -1
- package/dist/mosterdcomponents/document-attachments-BufPmMRv.js.map +0 -1
- package/dist/mosterdcomponents/field-helpers-CNQcI3Hf.js.map +0 -1
- package/dist/mosterdcomponents/file-upload-common-C9wp47CB.js.map +0 -1
- package/dist/mosterdcomponents/format-gcecItcD.js.map +0 -1
- package/dist/mosterdcomponents/i18n-ydNM87-Q.js.map +0 -1
- package/dist/mosterdcomponents/index-1ayBojyN.js.map +0 -1
- package/dist/mosterdcomponents/index-DhffneUF.js.map +0 -1
- package/dist/mosterdcomponents/index.esm.js.map +0 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
- package/dist/mosterdcomponents/p-Dkm4WxMy.js +0 -1
- package/dist/mosterdcomponents/p-c834951a.entry.js +0 -3
- package/dist/mosterdcomponents/purify.es-_duHfPgC.js.map +0 -1
- package/dist/mosterdcomponents/query-params-BZbQoeYF.js.map +0 -1
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
- package/dist/mosterdcomponents/validation-CjjTt66G.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.mrd-memo-view {
|
|
7
|
+
max-width: 720px;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--mrd-space-3);
|
|
11
|
+
}
|
|
12
|
+
.mrd-memo-view__header {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: baseline;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: var(--mrd-space-3);
|
|
17
|
+
}
|
|
18
|
+
.mrd-memo-view__title {
|
|
19
|
+
font-size: var(--mrd-font-size-2xl);
|
|
20
|
+
font-weight: var(--mrd-font-weight-bold);
|
|
21
|
+
color: var(--mrd-color-neutral-900);
|
|
22
|
+
letter-spacing: -0.02em;
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
.mrd-memo-view__important {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--mrd-space-1);
|
|
29
|
+
font-size: var(--mrd-font-size-xs);
|
|
30
|
+
font-weight: var(--mrd-font-weight-semibold);
|
|
31
|
+
color: var(--mrd-color-warning);
|
|
32
|
+
text-transform: uppercase;
|
|
33
|
+
letter-spacing: 0.04em;
|
|
34
|
+
}
|
|
35
|
+
.mrd-memo-view__important svg {
|
|
36
|
+
width: 0.875rem;
|
|
37
|
+
height: 0.875rem;
|
|
38
|
+
}
|
|
39
|
+
.mrd-memo-view__meta {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: var(--mrd-space-2);
|
|
43
|
+
font-size: var(--mrd-font-size-sm);
|
|
44
|
+
color: var(--mrd-color-neutral-400);
|
|
45
|
+
}
|
|
46
|
+
.mrd-memo-view__meta-author {
|
|
47
|
+
background: none;
|
|
48
|
+
border: none;
|
|
49
|
+
padding: 0;
|
|
50
|
+
font-family: var(--mrd-font-family);
|
|
51
|
+
font-size: inherit;
|
|
52
|
+
font-weight: var(--mrd-font-weight-medium);
|
|
53
|
+
color: var(--mrd-color-neutral-500);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
.mrd-memo-view__meta-author:hover {
|
|
57
|
+
color: var(--mrd-color-primary);
|
|
58
|
+
text-decoration: underline;
|
|
59
|
+
}
|
|
60
|
+
.mrd-memo-view__meta-date::before {
|
|
61
|
+
content: "·";
|
|
62
|
+
margin-right: var(--mrd-space-2);
|
|
63
|
+
}
|
|
64
|
+
.mrd-memo-view__meta-author + .mrd-memo-view__meta-date::before {
|
|
65
|
+
content: "·";
|
|
66
|
+
}
|
|
67
|
+
.mrd-memo-view__labels {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
gap: var(--mrd-space-2);
|
|
71
|
+
}
|
|
72
|
+
.mrd-memo-view__badge {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
height: 1.375rem;
|
|
76
|
+
padding: 0 var(--mrd-space-2);
|
|
77
|
+
border-radius: var(--mrd-border-radius-full, 999px);
|
|
78
|
+
font-size: var(--mrd-font-size-xs);
|
|
79
|
+
font-weight: var(--mrd-font-weight-medium);
|
|
80
|
+
}
|
|
81
|
+
.mrd-memo-view__badge--plain {
|
|
82
|
+
background: var(--mrd-color-neutral-100);
|
|
83
|
+
color: var(--mrd-color-neutral-600);
|
|
84
|
+
}
|
|
85
|
+
.mrd-memo-view__container-link {
|
|
86
|
+
align-self: flex-start;
|
|
87
|
+
background: none;
|
|
88
|
+
border: none;
|
|
89
|
+
padding: 0;
|
|
90
|
+
font-family: var(--mrd-font-family);
|
|
91
|
+
font-size: var(--mrd-font-size-sm);
|
|
92
|
+
font-weight: var(--mrd-font-weight-semibold);
|
|
93
|
+
color: var(--mrd-color-primary);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
.mrd-memo-view__container-link:hover {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
.mrd-memo-view__divider {
|
|
100
|
+
height: var(--mrd-border-width);
|
|
101
|
+
background: var(--mrd-color-neutral-200);
|
|
102
|
+
}
|
|
103
|
+
.mrd-memo-view__body {
|
|
104
|
+
font-size: var(--mrd-font-size-base);
|
|
105
|
+
color: var(--mrd-color-neutral-800);
|
|
106
|
+
line-height: var(--mrd-line-height-relaxed);
|
|
107
|
+
word-break: break-word;
|
|
108
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import DOMPurify from "dompurify";
|
|
3
|
+
import { t } from "../../../utils/i18n";
|
|
4
|
+
import { formatDateTime } from "../../../utils/format";
|
|
5
|
+
/**
|
|
6
|
+
* Archetype-driven single-memo view. Given a `commons.memo` binding and a data
|
|
7
|
+
* record, renders the memo the way a note should read: the title and body are
|
|
8
|
+
* the prominent content, author and timestamp sit below as a subtle metadata
|
|
9
|
+
* line — not the other way around.
|
|
10
|
+
*/
|
|
11
|
+
export class MrdMemoView {
|
|
12
|
+
constructor() {
|
|
13
|
+
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
14
|
+
this.data = {};
|
|
15
|
+
this.locale = navigator.language;
|
|
16
|
+
/** listItems of the FIELD bound to the `labels` slot, resolved by mrd-layout-section
|
|
17
|
+
* from its own items array (archetype metadata does not publish listItems), so the
|
|
18
|
+
* label badges get a real label/color instead of the raw stored key. */
|
|
19
|
+
this.labelsListItems = null;
|
|
20
|
+
}
|
|
21
|
+
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
22
|
+
slotValue(slot) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
|
|
25
|
+
if (!field)
|
|
26
|
+
return undefined;
|
|
27
|
+
return this.data[field];
|
|
28
|
+
}
|
|
29
|
+
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
30
|
+
slotLink(slot) {
|
|
31
|
+
var _a, _b, _c, _d;
|
|
32
|
+
const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
|
|
33
|
+
if (!field)
|
|
34
|
+
return undefined;
|
|
35
|
+
const links = ((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c._links) !== null && _d !== void 0 ? _d : {});
|
|
36
|
+
return links[field];
|
|
37
|
+
}
|
|
38
|
+
renderAuthor() {
|
|
39
|
+
const link = this.slotLink('author');
|
|
40
|
+
if (!(link === null || link === void 0 ? void 0 : link.href) || !link.name)
|
|
41
|
+
return null;
|
|
42
|
+
return (h("button", { type: "button", class: "mrd-memo-view__meta-author", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, link.name));
|
|
43
|
+
}
|
|
44
|
+
renderContainer() {
|
|
45
|
+
const link = this.slotLink('container');
|
|
46
|
+
if (!(link === null || link === void 0 ? void 0 : link.href) || !link.name)
|
|
47
|
+
return null;
|
|
48
|
+
return (h("button", { type: "button", class: "mrd-memo-view__container-link", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, link.name));
|
|
49
|
+
}
|
|
50
|
+
renderLabels() {
|
|
51
|
+
const raw = this.slotValue('labels');
|
|
52
|
+
const keys = Array.isArray(raw) ? raw.map(String) : (raw != null && raw !== '' ? [String(raw)] : []);
|
|
53
|
+
if (!keys.length)
|
|
54
|
+
return null;
|
|
55
|
+
return (h("div", { class: "mrd-memo-view__labels" }, keys.map(key => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const listItem = ((_a = this.labelsListItems) !== null && _a !== void 0 ? _a : []).find(li => li.key === key);
|
|
58
|
+
const label = (_b = listItem === null || listItem === void 0 ? void 0 : listItem.label) !== null && _b !== void 0 ? _b : key;
|
|
59
|
+
if ((listItem === null || listItem === void 0 ? void 0 : listItem.color) && (listItem === null || listItem === void 0 ? void 0 : listItem.backgroundColor)) {
|
|
60
|
+
return (h("span", { key: key, class: "mrd-memo-view__badge", style: { color: listItem.color, backgroundColor: listItem.backgroundColor } }, label));
|
|
61
|
+
}
|
|
62
|
+
return h("span", { key: key, class: "mrd-memo-view__badge mrd-memo-view__badge--plain" }, label);
|
|
63
|
+
})));
|
|
64
|
+
}
|
|
65
|
+
renderBody() {
|
|
66
|
+
const bodyRaw = this.slotValue('body');
|
|
67
|
+
if (bodyRaw == null || bodyRaw === '')
|
|
68
|
+
return null;
|
|
69
|
+
return h("div", { class: "mrd-memo-view__body", innerHTML: DOMPurify.sanitize(String(bodyRaw)) });
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
const titleRaw = this.slotValue('title');
|
|
73
|
+
const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
|
|
74
|
+
const dateRaw = this.slotValue('date');
|
|
75
|
+
const important = !!this.slotValue('important');
|
|
76
|
+
return (h(Host, { key: '4d8ed14c54449fbcfddc94a34dcfb220338f8bba' }, h("div", { key: '0e0456277715607580e5373ada10706db1067c7d', class: "mrd-memo-view" }, h("div", { key: 'd5c548617eca9a99eb34409b2082be025cfce2f4', class: "mrd-memo-view__header" }, title && h("h1", { key: '2ecd2eae3f8fdba310679515aa2fe76e02f0c2b2', class: "mrd-memo-view__title" }, title), important && (h("span", { key: 'e5e8284310ab6040f1677bc1241d04d65784c2da', class: "mrd-memo-view__important", title: t('memo_important', this.locale) }, h("svg", { key: 'babe987244b384330533721276b5392c9fe72c5a', viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, h("path", { key: '511956710ae8e440328f9e477551ba1c2d478f1a', d: "M12 2l2.9 6.26L22 9.27l-5 4.87L18.18 21 12 17.27 5.82 21 7 14.14l-5-4.87 7.1-1.01z" })), t('memo_important', this.locale)))), h("div", { key: '41c25e5376d94078debaf62121b8bdf400511d16', class: "mrd-memo-view__meta" }, this.renderAuthor(), dateRaw != null && dateRaw !== '' && (h("span", { key: 'caff8047249745ca98da77b374438e58d150ad7f', class: "mrd-memo-view__meta-date" }, formatDateTime(dateRaw, this.locale)))), this.renderLabels(), this.renderContainer(), h("div", { key: 'bfa4c55458ea19fb920338df9478006b1883e606', class: "mrd-memo-view__divider" }), this.renderBody())));
|
|
77
|
+
}
|
|
78
|
+
static get is() { return "mrd-memo-view"; }
|
|
79
|
+
static get encapsulation() { return "scoped"; }
|
|
80
|
+
static get originalStyleUrls() {
|
|
81
|
+
return {
|
|
82
|
+
"$": ["mrd-memo-view.scss"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get styleUrls() {
|
|
86
|
+
return {
|
|
87
|
+
"$": ["mrd-memo-view.css"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"archetype": {
|
|
93
|
+
"type": "unknown",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "ClientArchetype",
|
|
97
|
+
"resolved": "ClientArchetype",
|
|
98
|
+
"references": {
|
|
99
|
+
"ClientArchetype": {
|
|
100
|
+
"location": "import",
|
|
101
|
+
"path": "../../../types/client-layout",
|
|
102
|
+
"id": "src/types/client-layout.ts::ClientArchetype",
|
|
103
|
+
"referenceLocation": "ClientArchetype"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": true,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Resolved `commons.memo` binding: slot name \u2192 concrete field/relation name."
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false
|
|
115
|
+
},
|
|
116
|
+
"data": {
|
|
117
|
+
"type": "unknown",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "Record<string, unknown>",
|
|
121
|
+
"resolved": "string | unknown",
|
|
122
|
+
"references": {
|
|
123
|
+
"Record": {
|
|
124
|
+
"location": "global",
|
|
125
|
+
"id": "global::Record"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "The data record from the /data endpoint. Fields keyed by name; relations under `_links`."
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"defaultValue": "{}"
|
|
138
|
+
},
|
|
139
|
+
"locale": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "string",
|
|
144
|
+
"resolved": "string",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": false,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": ""
|
|
152
|
+
},
|
|
153
|
+
"getter": false,
|
|
154
|
+
"setter": false,
|
|
155
|
+
"reflect": false,
|
|
156
|
+
"attribute": "locale",
|
|
157
|
+
"defaultValue": "navigator.language"
|
|
158
|
+
},
|
|
159
|
+
"labelsListItems": {
|
|
160
|
+
"type": "unknown",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "ClientListValue[] | null",
|
|
164
|
+
"resolved": "ClientListValue[] | null",
|
|
165
|
+
"references": {
|
|
166
|
+
"ClientListValue": {
|
|
167
|
+
"location": "import",
|
|
168
|
+
"path": "../../../types/client-layout",
|
|
169
|
+
"id": "src/types/client-layout.ts::ClientListValue",
|
|
170
|
+
"referenceLocation": "ClientListValue"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "listItems of the FIELD bound to the `labels` slot, resolved by mrd-layout-section\nfrom its own items array (archetype metadata does not publish listItems), so the\nlabel badges get a real label/color instead of the raw stored key."
|
|
179
|
+
},
|
|
180
|
+
"getter": false,
|
|
181
|
+
"setter": false,
|
|
182
|
+
"defaultValue": "null"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
static get events() {
|
|
187
|
+
return [{
|
|
188
|
+
"method": "mrdNavigate",
|
|
189
|
+
"name": "mrdNavigate",
|
|
190
|
+
"bubbles": true,
|
|
191
|
+
"cancelable": true,
|
|
192
|
+
"composed": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Navigate to the author or the container. Host resolves the href and routes."
|
|
196
|
+
},
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "{ href?: string; label: string }",
|
|
199
|
+
"resolved": "{ href?: string | undefined; label: string; }",
|
|
200
|
+
"references": {}
|
|
201
|
+
}
|
|
202
|
+
}];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -121,14 +121,14 @@ export class MrdMergeView {
|
|
|
121
121
|
var _a, _b;
|
|
122
122
|
let stepContent;
|
|
123
123
|
if (this.step === 'search') {
|
|
124
|
-
stepContent = (h(MergeSearchStep, { key: '
|
|
124
|
+
stepContent = (h(MergeSearchStep, { key: '88ddac4f8f60a736bc6bc898b553e24771023b82', locale: this.locale, searchQuery: this.searchQuery, searchResults: this.searchResults, isLoading: this.isLoading, onSearchInput: this.handleSearchInput, onSelect: this.handleSelect }));
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
127
|
const diff = diffFields(this.fields, this.currentRecord, this.candidate);
|
|
128
128
|
const bLabel = candidateLabel(this.candidate);
|
|
129
129
|
stepContent = this.step === 'compare' ? (h(MergeCompareStep, { locale: this.locale, currentLabel: this.currentLabel, candidateLabel: bLabel, conflicts: diff.conflicts, autoFilled: diff.autoFilled, recordA: this.currentRecord, recordB: (_a = this.candidate) !== null && _a !== void 0 ? _a : {}, resolutions: this.resolutions, openHistoryKey: this.openHistoryKey, onResolve: this.handleResolve, onToggleHistory: this.handleToggleHistory, onChangeCandidate: this.handleChangeCandidate, onContinue: this.handleContinue })) : (h(MergeConfirmStep, { locale: this.locale, candidateLabel: bLabel, conflicts: diff.conflicts, autoFilled: diff.autoFilled, resolutions: this.resolutions, recordB: (_b = this.candidate) !== null && _b !== void 0 ? _b : {}, openHistoryKey: this.openHistoryKey, onToggleHistory: this.handleToggleHistory, onBack: this.handleBack, onConfirm: this.handleConfirm }));
|
|
130
130
|
}
|
|
131
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: '3606faba4c86ae1d981b7c40e4f1cb9cde19cf50' }, h("div", { key: '9605009fec0a7c79a5cd32141d930ea04e5efaad', class: "mrd-merge-view" }, stepContent)));
|
|
132
132
|
}
|
|
133
133
|
static get is() { return "mrd-merge-view"; }
|
|
134
134
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host, writeTask } from "@stencil/core";
|
|
2
2
|
import { t } from "../../../utils/i18n";
|
|
3
|
-
import { buildListPath } from "../../../utils/query-params";
|
|
3
|
+
import { buildCreateActionDetail, buildListPath } from "../../../utils/query-params";
|
|
4
4
|
import { TEXT_TYPES, NON_INTERACTIVE_TYPES, SEARCH_DEBOUNCE_MS, parseDefaultSort, buildSortParam, buildTableQueryParams, buildAggregationQs, filterHasValue, normalizeDatetimeFilter, datetimeFilterToDisplay, } from "./table-query";
|
|
5
5
|
import { FilterIcon, TableCell, TotalsRow, TextblockModal, JsonModal, Toolbar } from "./table-parts";
|
|
6
6
|
import { FilterPopup } from "./table-filter-popup";
|
|
@@ -607,16 +607,19 @@ export class MrdTable {
|
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
buildActionDetail(action, basicType) {
|
|
610
|
-
var _a
|
|
610
|
+
var _a;
|
|
611
611
|
if (action === 'export') {
|
|
612
612
|
return { action, path: this.buildExcelPath(), qs: this.buildQueryParams(0) };
|
|
613
613
|
}
|
|
614
614
|
if (action === 'create') {
|
|
615
615
|
const v = this.allViews[this.activeViewIdx];
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
: null
|
|
619
|
-
|
|
616
|
+
return buildCreateActionDetail({
|
|
617
|
+
isRelatedView: ((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === 'RELATED_VIEW',
|
|
618
|
+
fromClass: v === null || v === void 0 ? void 0 : v.fromClass,
|
|
619
|
+
parentId: this.parentId,
|
|
620
|
+
dataClass: v === null || v === void 0 ? void 0 : v.dataClass,
|
|
621
|
+
basicType,
|
|
622
|
+
});
|
|
620
623
|
}
|
|
621
624
|
return { action };
|
|
622
625
|
}
|
|
@@ -513,6 +513,9 @@ async function renderSection(index) {
|
|
|
513
513
|
// Dashboard-level archetypes describe the object itself → single-document view.
|
|
514
514
|
// Only apply to the main object layout, not tab-page (related) layouts.
|
|
515
515
|
section.archetypes = (!layout.tabPage && _dashboardData.archetypes) ? _dashboardData.archetypes : [];
|
|
516
|
+
// Same value mrd-form already gets (line ~932) — needed here too so a memo
|
|
517
|
+
// VIEW/RELATED_VIEW's "New memo" quick-create can resolve author/container.
|
|
518
|
+
if (_meUser) section.me = _meUser;
|
|
516
519
|
|
|
517
520
|
section.addEventListener('mrdLoadViewPage', async (e) => {
|
|
518
521
|
if (generation !== _sectionGeneration) return;
|
|
@@ -648,6 +651,20 @@ async function renderSection(index) {
|
|
|
648
651
|
}
|
|
649
652
|
});
|
|
650
653
|
|
|
654
|
+
// Confirmed delete from an embedded memo dialog. Fire-and-forget DELETE; the
|
|
655
|
+
// component already dropped the row optimistically.
|
|
656
|
+
section.addEventListener('mrdDeleteObject', async (e) => {
|
|
657
|
+
if (generation !== _sectionGeneration) return;
|
|
658
|
+
const { href } = e.detail;
|
|
659
|
+
logEvent('mrdDeleteObject', e.detail);
|
|
660
|
+
try {
|
|
661
|
+
const result = await apiRequest('DELETE', href, authGetToken());
|
|
662
|
+
if (!result.ok) console.error('[mrdDeleteObject] mislukt', result.status, result.body);
|
|
663
|
+
} catch (err) {
|
|
664
|
+
console.error('[mrdDeleteObject] mislukt', href, err);
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
|
|
651
668
|
// External file dropped on a folder: upload it, then hand the reference back to
|
|
652
669
|
// the component (same flow as mrd-form's mrdUpload → setFieldValue).
|
|
653
670
|
section.addEventListener('mrdViewUpload', async (e) => {
|
|
@@ -78,6 +78,7 @@ export const ARCHETYPE_EMAIL = 'commons.email';
|
|
|
78
78
|
* RELATED_VIEW item for the line items generically, by archetype id rather than
|
|
79
79
|
* by name/class string. */
|
|
80
80
|
export const ARCHETYPE_INVOICE_LINE = 'commons.invoiceLine';
|
|
81
|
+
export const ARCHETYPE_MEMO = 'commons.memo';
|
|
81
82
|
/**
|
|
82
83
|
* Find a binding for `archetypeId` in a published `archetypes` list.
|
|
83
84
|
* Returns `undefined` when the archetype is absent — callers fall back to the
|
|
@@ -21,6 +21,7 @@ const translations = {
|
|
|
21
21
|
loading: 'Laden...',
|
|
22
22
|
submit: 'Opslaan',
|
|
23
23
|
cancel: 'Annuleren',
|
|
24
|
+
delete: 'Verwijderen',
|
|
24
25
|
remove: 'Verwijderen',
|
|
25
26
|
add: 'Toevoegen',
|
|
26
27
|
yes: 'Ja',
|
|
@@ -64,6 +65,7 @@ const translations = {
|
|
|
64
65
|
filter_no_support: 'Geen filtering beschikbaar voor dit veldtype.',
|
|
65
66
|
// mrd-table textblock
|
|
66
67
|
textblock_show_more: 'Meer tonen',
|
|
68
|
+
textblock_show_less: 'Minder tonen',
|
|
67
69
|
close: 'Sluiten',
|
|
68
70
|
// history badge
|
|
69
71
|
history_until: 'tot',
|
|
@@ -103,6 +105,17 @@ const translations = {
|
|
|
103
105
|
email_cc: 'Cc',
|
|
104
106
|
email_date: 'Datum',
|
|
105
107
|
email_show_headers: 'Toon technische headers',
|
|
108
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
109
|
+
memo_important: 'Belangrijk',
|
|
110
|
+
memo_view_cards: 'Kaarten',
|
|
111
|
+
memo_view_table: 'Tabel',
|
|
112
|
+
load_more: 'Meer laden',
|
|
113
|
+
memo_new: 'Nieuwe memo',
|
|
114
|
+
memo_edit: 'Memo bewerken',
|
|
115
|
+
memo_delete_confirm_title: 'Memo verwijderen?',
|
|
116
|
+
memo_delete_confirm_body: 'Dit kan niet ongedaan worden gemaakt.',
|
|
117
|
+
memo_field_title: 'Titel',
|
|
118
|
+
memo_field_labels: 'Labels',
|
|
106
119
|
},
|
|
107
120
|
en: {
|
|
108
121
|
required: 'This field is required',
|
|
@@ -126,6 +139,7 @@ const translations = {
|
|
|
126
139
|
loading: 'Loading...',
|
|
127
140
|
submit: 'Save',
|
|
128
141
|
cancel: 'Cancel',
|
|
142
|
+
delete: 'Delete',
|
|
129
143
|
remove: 'Remove',
|
|
130
144
|
add: 'Add',
|
|
131
145
|
yes: 'Yes',
|
|
@@ -169,6 +183,7 @@ const translations = {
|
|
|
169
183
|
filter_no_support: 'Filtering is not available for this field type.',
|
|
170
184
|
// mrd-table textblock
|
|
171
185
|
textblock_show_more: 'Show more',
|
|
186
|
+
textblock_show_less: 'Show less',
|
|
172
187
|
close: 'Close',
|
|
173
188
|
// history badge
|
|
174
189
|
history_until: 'until',
|
|
@@ -208,6 +223,17 @@ const translations = {
|
|
|
208
223
|
email_cc: 'Cc',
|
|
209
224
|
email_date: 'Date',
|
|
210
225
|
email_show_headers: 'Show technical headers',
|
|
226
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
227
|
+
memo_important: 'Important',
|
|
228
|
+
memo_view_cards: 'Cards',
|
|
229
|
+
memo_view_table: 'Table',
|
|
230
|
+
load_more: 'Load more',
|
|
231
|
+
memo_new: 'New memo',
|
|
232
|
+
memo_edit: 'Edit memo',
|
|
233
|
+
memo_delete_confirm_title: 'Delete memo?',
|
|
234
|
+
memo_delete_confirm_body: 'This cannot be undone.',
|
|
235
|
+
memo_field_title: 'Title',
|
|
236
|
+
memo_field_labels: 'Labels',
|
|
211
237
|
},
|
|
212
238
|
ar: {
|
|
213
239
|
required: 'هذا الحقل مطلوب',
|
|
@@ -231,6 +257,7 @@ const translations = {
|
|
|
231
257
|
loading: 'جار التحميل...',
|
|
232
258
|
submit: 'حفظ',
|
|
233
259
|
cancel: 'إلغاء',
|
|
260
|
+
delete: 'حذف',
|
|
234
261
|
remove: 'إزالة',
|
|
235
262
|
add: 'إضافة',
|
|
236
263
|
yes: 'نعم',
|
|
@@ -274,6 +301,7 @@ const translations = {
|
|
|
274
301
|
filter_no_support: 'التصفية غير متاحة لهذا النوع من الحقول.',
|
|
275
302
|
// mrd-table textblock
|
|
276
303
|
textblock_show_more: 'عرض المزيد',
|
|
304
|
+
textblock_show_less: 'عرض أقل',
|
|
277
305
|
close: 'إغلاق',
|
|
278
306
|
// history badge
|
|
279
307
|
history_until: 'حتى',
|
|
@@ -307,6 +335,17 @@ const translations = {
|
|
|
307
335
|
email_cc: 'نسخة',
|
|
308
336
|
email_date: 'التاريخ',
|
|
309
337
|
email_show_headers: 'إظهار الترويسات التقنية',
|
|
338
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
339
|
+
memo_important: 'مهم',
|
|
340
|
+
memo_view_cards: 'بطاقات',
|
|
341
|
+
memo_view_table: 'جدول',
|
|
342
|
+
load_more: 'تحميل المزيد',
|
|
343
|
+
memo_new: 'مذكرة جديدة',
|
|
344
|
+
memo_edit: 'تعديل المذكرة',
|
|
345
|
+
memo_delete_confirm_title: 'حذف المذكرة؟',
|
|
346
|
+
memo_delete_confirm_body: 'لا يمكن التراجع عن هذا الإجراء.',
|
|
347
|
+
memo_field_title: 'العنوان',
|
|
348
|
+
memo_field_labels: 'التصنيفات',
|
|
310
349
|
},
|
|
311
350
|
fr: {
|
|
312
351
|
required: 'Ce champ est obligatoire',
|
|
@@ -330,6 +369,7 @@ const translations = {
|
|
|
330
369
|
loading: 'Chargement...',
|
|
331
370
|
submit: 'Enregistrer',
|
|
332
371
|
cancel: 'Annuler',
|
|
372
|
+
delete: 'Supprimer',
|
|
333
373
|
remove: 'Supprimer',
|
|
334
374
|
add: 'Ajouter',
|
|
335
375
|
yes: 'Oui',
|
|
@@ -373,6 +413,7 @@ const translations = {
|
|
|
373
413
|
filter_no_support: "Le filtrage n'est pas disponible pour ce type de champ.",
|
|
374
414
|
// mrd-table textblock
|
|
375
415
|
textblock_show_more: 'Voir plus',
|
|
416
|
+
textblock_show_less: 'Voir moins',
|
|
376
417
|
close: 'Fermer',
|
|
377
418
|
// history badge
|
|
378
419
|
history_until: "jusqu'au",
|
|
@@ -406,6 +447,17 @@ const translations = {
|
|
|
406
447
|
email_cc: 'Cc',
|
|
407
448
|
email_date: 'Date',
|
|
408
449
|
email_show_headers: 'Afficher les en-têtes techniques',
|
|
450
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
451
|
+
memo_important: 'Important',
|
|
452
|
+
memo_view_cards: 'Cartes',
|
|
453
|
+
memo_view_table: 'Tableau',
|
|
454
|
+
load_more: 'Charger plus',
|
|
455
|
+
memo_new: 'Nouveau mémo',
|
|
456
|
+
memo_edit: 'Modifier le mémo',
|
|
457
|
+
memo_delete_confirm_title: 'Supprimer le mémo ?',
|
|
458
|
+
memo_delete_confirm_body: 'Cette action est irréversible.',
|
|
459
|
+
memo_field_title: 'Titre',
|
|
460
|
+
memo_field_labels: 'Étiquettes',
|
|
409
461
|
},
|
|
410
462
|
de: {
|
|
411
463
|
required: 'Dieses Feld ist erforderlich',
|
|
@@ -429,6 +481,7 @@ const translations = {
|
|
|
429
481
|
loading: 'Laden...',
|
|
430
482
|
submit: 'Speichern',
|
|
431
483
|
cancel: 'Abbrechen',
|
|
484
|
+
delete: 'Löschen',
|
|
432
485
|
remove: 'Entfernen',
|
|
433
486
|
add: 'Hinzufügen',
|
|
434
487
|
yes: 'Ja',
|
|
@@ -472,6 +525,7 @@ const translations = {
|
|
|
472
525
|
filter_no_support: 'Filterung ist für diesen Feldtyp nicht verfügbar.',
|
|
473
526
|
// mrd-table textblock
|
|
474
527
|
textblock_show_more: 'Mehr anzeigen',
|
|
528
|
+
textblock_show_less: 'Weniger anzeigen',
|
|
475
529
|
close: 'Schließen',
|
|
476
530
|
// history badge
|
|
477
531
|
history_until: 'bis',
|
|
@@ -505,6 +559,17 @@ const translations = {
|
|
|
505
559
|
email_cc: 'Cc',
|
|
506
560
|
email_date: 'Datum',
|
|
507
561
|
email_show_headers: 'Technische Header anzeigen',
|
|
562
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
563
|
+
memo_important: 'Wichtig',
|
|
564
|
+
memo_view_cards: 'Karten',
|
|
565
|
+
memo_view_table: 'Tabelle',
|
|
566
|
+
load_more: 'Mehr laden',
|
|
567
|
+
memo_new: 'Neue Notiz',
|
|
568
|
+
memo_edit: 'Notiz bearbeiten',
|
|
569
|
+
memo_delete_confirm_title: 'Notiz löschen?',
|
|
570
|
+
memo_delete_confirm_body: 'Dies kann nicht rückgängig gemacht werden.',
|
|
571
|
+
memo_field_title: 'Titel',
|
|
572
|
+
memo_field_labels: 'Labels',
|
|
508
573
|
},
|
|
509
574
|
es: {
|
|
510
575
|
required: 'Este campo es obligatorio',
|
|
@@ -528,6 +593,7 @@ const translations = {
|
|
|
528
593
|
loading: 'Cargando...',
|
|
529
594
|
submit: 'Guardar',
|
|
530
595
|
cancel: 'Cancelar',
|
|
596
|
+
delete: 'Eliminar',
|
|
531
597
|
remove: 'Eliminar',
|
|
532
598
|
add: 'Añadir',
|
|
533
599
|
yes: 'Sí',
|
|
@@ -571,6 +637,7 @@ const translations = {
|
|
|
571
637
|
filter_no_support: 'El filtrado no está disponible para este tipo de campo.',
|
|
572
638
|
// mrd-table textblock
|
|
573
639
|
textblock_show_more: 'Mostrar más',
|
|
640
|
+
textblock_show_less: 'Mostrar menos',
|
|
574
641
|
close: 'Cerrar',
|
|
575
642
|
// history badge
|
|
576
643
|
history_until: 'hasta',
|
|
@@ -604,6 +671,17 @@ const translations = {
|
|
|
604
671
|
email_cc: 'Cc',
|
|
605
672
|
email_date: 'Fecha',
|
|
606
673
|
email_show_headers: 'Mostrar encabezados técnicos',
|
|
674
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
675
|
+
memo_important: 'Importante',
|
|
676
|
+
memo_view_cards: 'Tarjetas',
|
|
677
|
+
memo_view_table: 'Tabla',
|
|
678
|
+
load_more: 'Cargar más',
|
|
679
|
+
memo_new: 'Nuevo memo',
|
|
680
|
+
memo_edit: 'Editar memo',
|
|
681
|
+
memo_delete_confirm_title: '¿Eliminar memo?',
|
|
682
|
+
memo_delete_confirm_body: 'Esta acción no se puede deshacer.',
|
|
683
|
+
memo_field_title: 'Título',
|
|
684
|
+
memo_field_labels: 'Etiquetas',
|
|
607
685
|
},
|
|
608
686
|
it: {
|
|
609
687
|
required: 'Questo campo è obbligatorio',
|
|
@@ -627,6 +705,7 @@ const translations = {
|
|
|
627
705
|
loading: 'Caricamento...',
|
|
628
706
|
submit: 'Salva',
|
|
629
707
|
cancel: 'Annulla',
|
|
708
|
+
delete: 'Elimina',
|
|
630
709
|
remove: 'Rimuovi',
|
|
631
710
|
add: 'Aggiungi',
|
|
632
711
|
yes: 'Sì',
|
|
@@ -670,6 +749,7 @@ const translations = {
|
|
|
670
749
|
filter_no_support: 'Il filtro non è disponibile per questo tipo di campo.',
|
|
671
750
|
// mrd-table textblock
|
|
672
751
|
textblock_show_more: 'Mostra altro',
|
|
752
|
+
textblock_show_less: 'Mostra meno',
|
|
673
753
|
close: 'Chiudi',
|
|
674
754
|
// history badge
|
|
675
755
|
history_until: 'fino a',
|
|
@@ -703,6 +783,17 @@ const translations = {
|
|
|
703
783
|
email_cc: 'Cc',
|
|
704
784
|
email_date: 'Data',
|
|
705
785
|
email_show_headers: 'Mostra intestazioni tecniche',
|
|
786
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
787
|
+
memo_important: 'Importante',
|
|
788
|
+
memo_view_cards: 'Schede',
|
|
789
|
+
memo_view_table: 'Tabella',
|
|
790
|
+
load_more: 'Carica altro',
|
|
791
|
+
memo_new: 'Nuovo promemoria',
|
|
792
|
+
memo_edit: 'Modifica promemoria',
|
|
793
|
+
memo_delete_confirm_title: 'Eliminare il promemoria?',
|
|
794
|
+
memo_delete_confirm_body: 'Questa azione non può essere annullata.',
|
|
795
|
+
memo_field_title: 'Titolo',
|
|
796
|
+
memo_field_labels: 'Etichette',
|
|
706
797
|
},
|
|
707
798
|
uk: {
|
|
708
799
|
required: "Це поле обов'язкове",
|
|
@@ -726,6 +817,7 @@ const translations = {
|
|
|
726
817
|
loading: 'Завантаження...',
|
|
727
818
|
submit: 'Зберегти',
|
|
728
819
|
cancel: 'Скасувати',
|
|
820
|
+
delete: 'Видалити',
|
|
729
821
|
remove: 'Видалити',
|
|
730
822
|
add: 'Додати',
|
|
731
823
|
yes: 'Так',
|
|
@@ -769,6 +861,7 @@ const translations = {
|
|
|
769
861
|
filter_no_support: 'Фільтрування недоступне для цього типу поля.',
|
|
770
862
|
// mrd-table textblock
|
|
771
863
|
textblock_show_more: 'Показати більше',
|
|
864
|
+
textblock_show_less: 'Показати менше',
|
|
772
865
|
close: 'Закрити',
|
|
773
866
|
// history badge
|
|
774
867
|
history_until: 'до',
|
|
@@ -802,6 +895,17 @@ const translations = {
|
|
|
802
895
|
email_cc: 'Копія',
|
|
803
896
|
email_date: 'Дата',
|
|
804
897
|
email_show_headers: 'Показати технічні заголовки',
|
|
898
|
+
// mrd-memo-view / mrd-memo-list / mrd-memo-container
|
|
899
|
+
memo_important: 'Важливо',
|
|
900
|
+
memo_view_cards: 'Картки',
|
|
901
|
+
memo_view_table: 'Таблиця',
|
|
902
|
+
load_more: 'Завантажити ще',
|
|
903
|
+
memo_new: 'Нова нотатка',
|
|
904
|
+
memo_edit: 'Редагувати нотатку',
|
|
905
|
+
memo_delete_confirm_title: 'Видалити нотатку?',
|
|
906
|
+
memo_delete_confirm_body: 'Це неможливо скасувати.',
|
|
907
|
+
memo_field_title: 'Заголовок',
|
|
908
|
+
memo_field_labels: 'Мітки',
|
|
805
909
|
},
|
|
806
910
|
};
|
|
807
911
|
export function t(key, locale) {
|