@mmlogic/components 0.3.5 → 0.3.9

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.
Files changed (68) hide show
  1. package/dist/cjs/index.cjs.js +13 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  4. package/dist/cjs/{mrd-boolean-field_20.cjs.entry.js → mrd-boolean-field_22.cjs.entry.js} +506 -25
  5. package/dist/collection/collection-manifest.json +2 -0
  6. package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +1 -1
  7. package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +1 -1
  8. package/dist/collection/components/mrd-date-field/mrd-date-field.js +1 -1
  9. package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +1 -1
  10. package/dist/collection/components/mrd-document-list/mrd-document-list.js +578 -0
  11. package/dist/collection/components/mrd-document-list/mrd-document-list.scss +126 -0
  12. package/dist/collection/components/mrd-document-view/mrd-document-view.js +177 -0
  13. package/dist/collection/components/mrd-document-view/mrd-document-view.scss +121 -0
  14. package/dist/collection/components/mrd-email-field/mrd-email-field.js +1 -1
  15. package/dist/collection/components/mrd-file-field/mrd-file-field.js +1 -1
  16. package/dist/collection/components/mrd-image-field/mrd-image-field.js +1 -1
  17. package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +154 -16
  18. package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +46 -3
  19. package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +1 -1
  20. package/dist/collection/components/mrd-number-field/mrd-number-field.js +1 -1
  21. package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +2 -2
  22. package/dist/collection/components/mrd-text-field/mrd-text-field.js +1 -1
  23. package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +1 -1
  24. package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.scss +0 -56
  25. package/dist/collection/components/mrd-time-field/mrd-time-field.js +1 -1
  26. package/dist/collection/dev/app.js +19 -2
  27. package/dist/collection/types/client-layout.js +10 -0
  28. package/dist/collection/utils/i18n.js +24 -0
  29. package/dist/components/client-layout.js +1 -1
  30. package/dist/components/format.js +1 -1
  31. package/dist/components/i18n.js +1 -1
  32. package/dist/components/index.js +1 -1
  33. package/dist/components/mrd-boolean-field2.js +1 -1
  34. package/dist/components/mrd-currency-field2.js +1 -1
  35. package/dist/components/mrd-date-field2.js +1 -1
  36. package/dist/components/mrd-datetime-field2.js +1 -1
  37. package/dist/components/mrd-document-list.d.ts +11 -0
  38. package/dist/components/mrd-document-list.js +1 -0
  39. package/dist/components/mrd-document-list2.js +1 -0
  40. package/dist/components/mrd-document-view.d.ts +11 -0
  41. package/dist/components/mrd-document-view.js +1 -0
  42. package/dist/components/mrd-document-view2.js +1 -0
  43. package/dist/components/mrd-email-field2.js +1 -1
  44. package/dist/components/mrd-file-field2.js +1 -1
  45. package/dist/components/mrd-image-field2.js +1 -1
  46. package/dist/components/mrd-layout-section.js +1 -1
  47. package/dist/components/mrd-longtext-field2.js +1 -1
  48. package/dist/components/mrd-number-field2.js +1 -1
  49. package/dist/components/mrd-secret-field2.js +1 -1
  50. package/dist/components/mrd-table2.js +1 -1
  51. package/dist/components/mrd-text-field2.js +1 -1
  52. package/dist/components/mrd-textarea-field2.js +1 -1
  53. package/dist/components/mrd-time-field2.js +1 -1
  54. package/dist/esm/index.js +11 -1
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/esm/mosterdcomponents.js +1 -1
  57. package/dist/esm/{mrd-boolean-field_20.entry.js → mrd-boolean-field_22.entry.js} +506 -27
  58. package/dist/mosterdcomponents/index.esm.js +1 -1
  59. package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
  60. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  61. package/dist/mosterdcomponents/p-b547291b.entry.js +1 -0
  62. package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +108 -0
  63. package/dist/types/components/mrd-document-view/mrd-document-view.d.ts +36 -0
  64. package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +33 -6
  65. package/dist/types/components.d.ts +290 -15
  66. package/dist/types/types/client-layout.d.ts +38 -0
  67. package/package.json +1 -1
  68. package/dist/mosterdcomponents/p-e477187c.entry.js +0 -1
@@ -0,0 +1,126 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .mrd-document-list {
6
+ padding: var(--mrd-space-2) 0;
7
+ }
8
+
9
+ .mrd-document-list__row {
10
+ display: flex;
11
+ align-items: center;
12
+ gap: var(--mrd-space-2);
13
+ height: 2.125rem;
14
+ padding: 0 var(--mrd-space-4);
15
+ cursor: pointer;
16
+ user-select: none;
17
+ font-size: var(--mrd-font-size-sm);
18
+ color: var(--mrd-color-neutral-800);
19
+ }
20
+
21
+ .mrd-document-list__row:hover {
22
+ background: var(--mrd-color-neutral-50);
23
+ }
24
+
25
+ .mrd-document-list__row--dossier .mrd-document-list__label {
26
+ font-weight: var(--mrd-font-weight-semibold);
27
+ }
28
+
29
+ .mrd-document-list__indent {
30
+ flex: none;
31
+ }
32
+
33
+ .mrd-document-list__chev {
34
+ width: 1rem;
35
+ height: 1rem;
36
+ flex: none;
37
+ display: grid;
38
+ place-items: center;
39
+ color: var(--mrd-color-neutral-400);
40
+ transition: transform var(--mrd-transition-fast);
41
+ }
42
+
43
+ .mrd-document-list__chev svg {
44
+ width: 0.6875rem;
45
+ height: 0.6875rem;
46
+ }
47
+
48
+ .mrd-document-list__chev--open {
49
+ transform: rotate(90deg);
50
+ }
51
+
52
+ .mrd-document-list__chev--leaf {
53
+ visibility: hidden;
54
+ }
55
+
56
+ .mrd-document-list__icon {
57
+ width: 1.0625rem;
58
+ height: 1.0625rem;
59
+ flex: none;
60
+ }
61
+
62
+ .mrd-document-list__icon--dossier {
63
+ color: var(--mrd-color-primary);
64
+ }
65
+
66
+ .mrd-document-list__icon--folder {
67
+ color: #d9a441;
68
+ }
69
+
70
+ .mrd-document-list__icon--doc {
71
+ color: var(--mrd-color-neutral-400);
72
+ }
73
+
74
+ .mrd-document-list__label {
75
+ flex: 1;
76
+ white-space: nowrap;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+ }
80
+
81
+ .mrd-document-list__count {
82
+ flex: none;
83
+ font-family: var(--mrd-font-family-mono);
84
+ font-size: var(--mrd-font-size-xs);
85
+ color: var(--mrd-color-neutral-500);
86
+ background: var(--mrd-color-neutral-100);
87
+ border-radius: var(--mrd-border-radius-full);
88
+ padding: 0.0625rem 0.5rem;
89
+ }
90
+
91
+ .mrd-document-list__date {
92
+ flex: none;
93
+ font-size: var(--mrd-font-size-xs);
94
+ color: var(--mrd-color-neutral-400);
95
+ font-variant-numeric: tabular-nums;
96
+ }
97
+
98
+ .mrd-document-list__loading {
99
+ display: flex;
100
+ align-items: center;
101
+ gap: var(--mrd-space-2);
102
+ height: 1.875rem;
103
+ padding: 0 var(--mrd-space-4);
104
+ font-size: var(--mrd-font-size-xs);
105
+ color: var(--mrd-color-neutral-400);
106
+ }
107
+
108
+ .mrd-document-list__spinner {
109
+ width: 0.75rem;
110
+ height: 0.75rem;
111
+ border: 2px solid var(--mrd-color-neutral-300);
112
+ border-top-color: var(--mrd-color-primary);
113
+ border-radius: 50%;
114
+ animation: mrd-document-list-spin 0.7s linear infinite;
115
+ }
116
+
117
+ @keyframes mrd-document-list-spin {
118
+ to { transform: rotate(360deg); }
119
+ }
120
+
121
+ .mrd-document-list__empty {
122
+ padding: var(--mrd-space-8) var(--mrd-space-4);
123
+ text-align: center;
124
+ color: var(--mrd-color-neutral-400);
125
+ font-size: var(--mrd-font-size-sm);
126
+ }
@@ -0,0 +1,177 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { t } from "../../utils/i18n";
3
+ import { formatDate } from "../../utils/format";
4
+ /**
5
+ * Archetype-driven single-document view. Given a `commons.document` binding and a
6
+ * data record, renders the document recognisably — title, file preview/download,
7
+ * summary and date — plus a navigation link to the container (the dossier),
8
+ * instead of a generic field form.
9
+ *
10
+ * The component keys on the slot→field map (`archetype.slots`) to locate values:
11
+ * value slots read `data[field]`; the `container` relation slot reads
12
+ * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
13
+ */
14
+ export class MrdDocumentView {
15
+ constructor() {
16
+ /** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
17
+ this.data = {};
18
+ this.locale = navigator.language;
19
+ }
20
+ /** Value of a value-slot: reads data[field] via the slot→field map. */
21
+ slotValue(slot) {
22
+ var _a, _b;
23
+ const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
24
+ if (!field)
25
+ return undefined;
26
+ return this.data[field];
27
+ }
28
+ /** Relation link for a relation-slot: reads data._links[field]. */
29
+ slotLink(slot) {
30
+ var _a, _b, _c, _d;
31
+ const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
32
+ if (!field)
33
+ return undefined;
34
+ const links = ((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c._links) !== null && _d !== void 0 ? _d : {});
35
+ return links[field];
36
+ }
37
+ renderContainer() {
38
+ const link = this.slotLink('container');
39
+ if (!(link === null || link === void 0 ? void 0 : link.href) || !link.name)
40
+ return null;
41
+ return (h("button", { class: "mrd-document-view__crumb", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, h("svg", { class: "mrd-document-view__crumb-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M19 12H5M12 19l-7-7 7-7" })), link.name));
42
+ }
43
+ renderFile() {
44
+ var _a, _b;
45
+ const raw = this.slotValue('file');
46
+ if (!raw)
47
+ return null;
48
+ const href = (_a = raw === null || raw === void 0 ? void 0 : raw.href) !== null && _a !== void 0 ? _a : '';
49
+ const fileName = (_b = raw === null || raw === void 0 ? void 0 : raw.fileName) !== null && _b !== void 0 ? _b : String(raw);
50
+ return (h("div", { class: "mrd-document-view__file" }, h("div", { class: "mrd-document-view__file-preview", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { d: "M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6H6zm7 1.5L18.5 9H13V3.5z" }))), h("div", { class: "mrd-document-view__file-meta" }, h("span", { class: "mrd-document-view__file-name" }, fileName)), href && (h("button", { class: "mrd-document-view__download", onClick: () => this.mrdDownload.emit({ href, fileName }) }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 21h16" })), t('download', this.locale)))));
51
+ }
52
+ render() {
53
+ const titleRaw = this.slotValue('title');
54
+ const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
55
+ const dateRaw = this.slotValue('date');
56
+ const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
57
+ const summaryRaw = this.slotValue('summary');
58
+ const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
59
+ return (h(Host, { key: 'b6c2dbc45d5cfe551ac16b43b1a152a0d793b794' }, h("div", { key: 'df70848b4aa54ea414ea5d577a600779ee002b13', class: "mrd-document-view" }, this.renderContainer(), title && h("h1", { key: '46ff550fccd6de02972c6ee77b3cd5e7e394481a', class: "mrd-document-view__title" }, title), date && h("p", { key: '501c75cfc78722bd486d4a1db366675a1c519264', class: "mrd-document-view__date" }, date), this.renderFile(), summary && (h("div", { key: 'ee4475d06e5ca81a760e0c9e1e4b5f32ed894d89', class: "mrd-document-view__summary" }, h("div", { key: '9d196abdcc56b84b2b07203d7e5167be196a342a', class: "mrd-document-view__summary-body", innerHTML: summary }))))));
60
+ }
61
+ static get is() { return "mrd-document-view"; }
62
+ static get encapsulation() { return "scoped"; }
63
+ static get originalStyleUrls() {
64
+ return {
65
+ "$": ["mrd-document-view.scss"]
66
+ };
67
+ }
68
+ static get styleUrls() {
69
+ return {
70
+ "$": ["mrd-document-view.css"]
71
+ };
72
+ }
73
+ static get properties() {
74
+ return {
75
+ "archetype": {
76
+ "type": "unknown",
77
+ "mutable": false,
78
+ "complexType": {
79
+ "original": "ClientArchetype",
80
+ "resolved": "ClientArchetype",
81
+ "references": {
82
+ "ClientArchetype": {
83
+ "location": "import",
84
+ "path": "../../types/client-layout",
85
+ "id": "src/types/client-layout.ts::ClientArchetype",
86
+ "referenceLocation": "ClientArchetype"
87
+ }
88
+ }
89
+ },
90
+ "required": true,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": "Resolved `commons.document` binding: slot name \u2192 concrete field/relation name."
95
+ },
96
+ "getter": false,
97
+ "setter": false
98
+ },
99
+ "data": {
100
+ "type": "unknown",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "Record<string, unknown>",
104
+ "resolved": "string | unknown",
105
+ "references": {
106
+ "Record": {
107
+ "location": "global",
108
+ "id": "global::Record"
109
+ }
110
+ }
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": "The data record from the /data endpoint. Fields keyed by name; relations under `_links`."
117
+ },
118
+ "getter": false,
119
+ "setter": false,
120
+ "defaultValue": "{}"
121
+ },
122
+ "locale": {
123
+ "type": "string",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "string",
127
+ "resolved": "string",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": ""
135
+ },
136
+ "getter": false,
137
+ "setter": false,
138
+ "reflect": false,
139
+ "attribute": "locale",
140
+ "defaultValue": "navigator.language"
141
+ }
142
+ };
143
+ }
144
+ static get events() {
145
+ return [{
146
+ "method": "mrdNavigate",
147
+ "name": "mrdNavigate",
148
+ "bubbles": true,
149
+ "cancelable": true,
150
+ "composed": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": "Navigate to the container (dossier). Host resolves the href and routes."
154
+ },
155
+ "complexType": {
156
+ "original": "{ href?: string; label: string }",
157
+ "resolved": "{ href?: string | undefined; label: string; }",
158
+ "references": {}
159
+ }
160
+ }, {
161
+ "method": "mrdDownload",
162
+ "name": "mrdDownload",
163
+ "bubbles": true,
164
+ "cancelable": true,
165
+ "composed": true,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": "Download the document file. Host resolves the href to a signed URL."
169
+ },
170
+ "complexType": {
171
+ "original": "{ href: string; fileName: string }",
172
+ "resolved": "{ href: string; fileName: string; }",
173
+ "references": {}
174
+ }
175
+ }];
176
+ }
177
+ }
@@ -0,0 +1,121 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .mrd-document-view {
6
+ max-width: 720px;
7
+ }
8
+
9
+ .mrd-document-view__crumb {
10
+ display: inline-flex;
11
+ align-items: center;
12
+ gap: var(--mrd-space-2);
13
+ margin-bottom: var(--mrd-space-4);
14
+ padding: var(--mrd-space-1) var(--mrd-space-3);
15
+ background: var(--mrd-color-primary-light);
16
+ border: 1px solid transparent;
17
+ border-radius: var(--mrd-border-radius);
18
+ font-family: var(--mrd-font-family);
19
+ font-size: var(--mrd-font-size-sm);
20
+ color: var(--mrd-color-primary-dark);
21
+ cursor: pointer;
22
+ }
23
+
24
+ .mrd-document-view__crumb:hover {
25
+ border-color: var(--mrd-color-primary);
26
+ }
27
+
28
+ .mrd-document-view__crumb-icon {
29
+ width: 0.875rem;
30
+ height: 0.875rem;
31
+ flex-shrink: 0;
32
+ }
33
+
34
+ .mrd-document-view__title {
35
+ font-size: var(--mrd-font-size-2xl);
36
+ font-weight: var(--mrd-font-weight-bold);
37
+ color: var(--mrd-color-neutral-900);
38
+ letter-spacing: -0.02em;
39
+ margin: 0 0 var(--mrd-space-1) 0;
40
+ }
41
+
42
+ .mrd-document-view__date {
43
+ font-size: var(--mrd-font-size-sm);
44
+ color: var(--mrd-color-neutral-400);
45
+ font-variant-numeric: tabular-nums;
46
+ margin: 0 0 var(--mrd-space-6) 0;
47
+ }
48
+
49
+ .mrd-document-view__file {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: var(--mrd-space-4);
53
+ padding: var(--mrd-space-4);
54
+ border: 1px solid var(--mrd-border-color);
55
+ border-radius: var(--mrd-border-radius-md);
56
+ background: var(--mrd-color-neutral-50);
57
+ margin-bottom: var(--mrd-space-6);
58
+ }
59
+
60
+ .mrd-document-view__file-preview {
61
+ width: 2.875rem;
62
+ height: 3.625rem;
63
+ flex-shrink: 0;
64
+ display: grid;
65
+ place-items: center;
66
+ border-radius: var(--mrd-border-radius-sm);
67
+ background: var(--mrd-color-white);
68
+ border: 1px solid var(--mrd-border-color);
69
+ color: var(--mrd-color-danger);
70
+ box-shadow: var(--mrd-shadow-sm);
71
+ }
72
+
73
+ .mrd-document-view__file-preview svg {
74
+ width: 1.5rem;
75
+ height: 1.5rem;
76
+ }
77
+
78
+ .mrd-document-view__file-meta {
79
+ flex: 1;
80
+ min-width: 0;
81
+ }
82
+
83
+ .mrd-document-view__file-name {
84
+ font-weight: var(--mrd-font-weight-semibold);
85
+ font-size: var(--mrd-font-size-sm);
86
+ color: var(--mrd-color-neutral-800);
87
+ word-break: break-word;
88
+ }
89
+
90
+ .mrd-document-view__download {
91
+ display: inline-flex;
92
+ align-items: center;
93
+ gap: var(--mrd-space-2);
94
+ flex-shrink: 0;
95
+ height: 2rem;
96
+ padding: 0 var(--mrd-space-3);
97
+ background: var(--mrd-color-white);
98
+ border: 1px solid var(--mrd-color-neutral-300);
99
+ border-radius: var(--mrd-border-radius);
100
+ font-family: var(--mrd-font-family);
101
+ font-size: var(--mrd-font-size-sm);
102
+ font-weight: var(--mrd-font-weight-medium);
103
+ color: var(--mrd-color-neutral-700);
104
+ cursor: pointer;
105
+ }
106
+
107
+ .mrd-document-view__download:hover {
108
+ background: var(--mrd-color-neutral-100);
109
+ color: var(--mrd-color-neutral-900);
110
+ }
111
+
112
+ .mrd-document-view__download svg {
113
+ width: 0.9375rem;
114
+ height: 0.9375rem;
115
+ }
116
+
117
+ .mrd-document-view__summary-body {
118
+ font-size: var(--mrd-font-size-base);
119
+ color: var(--mrd-color-neutral-700);
120
+ line-height: var(--mrd-line-height-relaxed);
121
+ }
@@ -31,7 +31,7 @@ export class MrdEmailField {
31
31
  }
32
32
  render() {
33
33
  const hasError = !!this.error;
34
- return (h(Host, { key: '851ec092957ab86e811b292eaabe29d04a600fe0' }, h("div", { key: '2d8969d60378f3161656369494549d682de8ec0e', class: "mrd-email-field" }, this.label && (h("label", { key: '7a35cc60d4804097e1a54f984c7da1829f6bbd11', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), h("input", { key: '1fc20e860aa021886f7ed522c3a0c8dd2cb1e093', class: `mrd-email-field__input${hasError ? ' mrd-email-field__input--error' : ''}`, type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: 'a44b3b41b7cd6b8c643cc64e6aadd884a2ba4961', class: "mrd-email-field__error" }, this.error))));
34
+ return (h(Host, { key: 'bf888feadb6585a845f6d610165e192e342be5d2' }, h("div", { key: 'ab43101242a92df1643d218c0d35bb7b80452fef', class: "mrd-email-field" }, this.label && (h("label", { key: '854c9bd733f5803616ab8b70f0316a7a8a82ffd4', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), h("input", { key: '39ed16119a2329fdc67db578dcc7bafc35f4acf0', class: `mrd-email-field__input${hasError ? ' mrd-email-field__input--error' : ''}`, type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: 'c5881e21a2314e5d339464b16982add69be9f68a', class: "mrd-email-field__error" }, this.error))));
35
35
  }
36
36
  static get is() { return "mrd-email-field"; }
37
37
  static get encapsulation() { return "scoped"; }
@@ -85,7 +85,7 @@ export class MrdFileField {
85
85
  hasError ? 'mrd-file-field__zone--error' : '',
86
86
  this.disabled || this.uploading ? 'mrd-file-field__zone--disabled' : '',
87
87
  ].filter(Boolean).join(' ');
88
- return (h(Host, { key: '2090102df8169226c1e66f87cbc837296e4b55d4' }, h("div", { key: '7a37a09df1bfa2eaf28ed04c806ad5f7c0337bb0', class: "mrd-file-field" }, this.label && (h("label", { key: '8f1fcb8adbb66b792be902c7c548e50db99b6a53', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), h("div", { key: '66d992298f537b24d69ce3ead3dd229f6d124f3d', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: '95ba6560e71ee08c6b2526802727b29a18cdc454', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (h("div", { class: "mrd-file-field__selected" }, this.uploading ? (h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), h("polyline", { points: "14 2 14 8 20 8" }))), h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (h("div", { class: "mrd-file-field__prompt" }, h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "16 16 12 12 8 16" }), h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'a6020e63bebb01e31a980a903f81badd486585aa', class: "mrd-file-field__error" }, this.error))));
88
+ return (h(Host, { key: '424a55ff5c141a51ed2e253a126e0046808cf1b1' }, h("div", { key: '49407e31c019a27bbaa3ccbc81cd4597d992d03a', class: "mrd-file-field" }, this.label && (h("label", { key: '0477b203f2b8df03cf9d11153bc547e9490800f7', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), h("div", { key: 'aff3e5f258cfa8320150048af0b0087081cbbc13', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: 'ee4366f0c4b8871524288ca47c98b4749def0b81', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (h("div", { class: "mrd-file-field__selected" }, this.uploading ? (h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), h("polyline", { points: "14 2 14 8 20 8" }))), h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (h("div", { class: "mrd-file-field__prompt" }, h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "16 16 12 12 8 16" }), h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'b67b7770e194843a1b75caaff807ea14d62eba6a', class: "mrd-file-field__error" }, this.error))));
89
89
  }
90
90
  static get is() { return "mrd-file-field"; }
91
91
  static get encapsulation() { return "scoped"; }
@@ -99,7 +99,7 @@ export class MrdImageField {
99
99
  hasError ? 'mrd-image-field__zone--error' : '',
100
100
  this.disabled || this.uploading ? 'mrd-image-field__zone--disabled' : '',
101
101
  ].filter(Boolean).join(' ');
102
- return (h(Host, { key: '71be4c1df559cff87280cac30be58beab3149064' }, h("div", { key: '9d0811d87068ce258aca9b2c5223a5594af9f6a3', class: "mrd-image-field" }, this.label && (h("label", { key: '63e129db968a2edfcc04fcac466d908ba4715158', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), h("div", { key: 'c7e560ad4dda43499707a2d1771a8eb561653a1b', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: 'd325ee1aa3baccd689cc579e4cfa21abe977a575', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (h("div", { class: "mrd-image-field__preview-container" }, h("div", { class: "mrd-image-field__preview-thumb" }, h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && h("div", { class: "mrd-image-field__preview-overlay" }, h("span", { class: "mrd-image-field__spinner" }))), h("div", { class: "mrd-image-field__preview-info" }, h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (h("div", { class: "mrd-image-field__prompt" }, h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), h("polyline", { points: "21 15 16 10 5 21" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'b0442d6f5c07ef22443194b3f1a95d2dfc409c4e', class: "mrd-image-field__error" }, this.error))));
102
+ return (h(Host, { key: '105ebf20023291a1e5c8524eedba4f04573943cd' }, h("div", { key: '59e6fe3b81c2ec1c07db7aaba819d79d2525b21f', class: "mrd-image-field" }, this.label && (h("label", { key: '2f3815ad6fe3f35932a8cc4d625751935272b629', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), h("div", { key: '8b45fbf8d0a229110a53068620a316ab6d48dbb8', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: 'b6039e85f3f456e7c8d8e7d4db29e111a7f6d8d9', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (h("div", { class: "mrd-image-field__preview-container" }, h("div", { class: "mrd-image-field__preview-thumb" }, h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && h("div", { class: "mrd-image-field__preview-overlay" }, h("span", { class: "mrd-image-field__spinner" }))), h("div", { class: "mrd-image-field__preview-info" }, h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (h("div", { class: "mrd-image-field__prompt" }, h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), h("polyline", { points: "21 15 16 10 5 21" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'f53ade0f627f3c840bc133690d40034c12665b5c', class: "mrd-image-field__error" }, this.error))));
103
103
  }
104
104
  static get is() { return "mrd-image-field"; }
105
105
  static get encapsulation() { return "scoped"; }