@mmlogic/components 0.5.5 → 0.5.6
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-Mx3pwONr.js → cell-renderer-Coy-aD3k.js} +0 -237
- 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 +45 -211
- package/dist/cjs/mrd-merge-view.cjs.entry.js +3 -3
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.css +4 -55
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +8 -118
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.css +4 -55
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +15 -117
- package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +1 -1
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
- package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/components/form/mrd-field/mrd-field.js +11 -11
- package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +1 -1
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +1 -1
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +2 -2
- package/dist/collection/utils/format.js +0 -160
- package/dist/collection/utils/i18n.js +0 -72
- package/dist/components/cell-renderer.js +1 -1
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-email-view2.js +1 -1
- package/dist/components/mrd-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-invoice-view2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-merge-view.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/{cell-renderer-UQOYlDv7.js → cell-renderer-Dd_PKH0_.js} +1 -233
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_25.entry.js +45 -211
- package/dist/esm/mrd-merge-view.entry.js +3 -3
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/{p-d31b71d9.entry.js → p-1fc897f4.entry.js} +1 -1
- package/dist/mosterdcomponents/p-53b00783.entry.js +3 -0
- package/dist/mosterdcomponents/p-CGm4ff1O.js +1 -0
- package/dist/types/components/fields/mrd-date-field/mrd-date-field.d.ts +1 -22
- package/dist/types/components/fields/mrd-datetime-field/mrd-datetime-field.d.ts +2 -21
- package/dist/types/components.d.ts +0 -26
- package/dist/types/utils/format.d.ts +0 -34
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-8cc374e0.entry.js +0 -3
- package/dist/mosterdcomponents/p-CF--ScWr.js +0 -1
|
@@ -1,106 +1,26 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { t } from "../../../utils/i18n";
|
|
3
|
-
import { formatIsoDate, localeDatePattern, parseLocalizedDate } from "../../../utils/format";
|
|
4
2
|
import { FieldLabel, FieldError, controlClass, requiredError } from "../field-helpers";
|
|
5
3
|
export class MrdDateField {
|
|
6
4
|
constructor() {
|
|
7
5
|
this.name = '';
|
|
8
6
|
this.label = '';
|
|
9
|
-
/** ISO date, 'YYYY-MM-DD'. */
|
|
10
7
|
this.value = '';
|
|
11
|
-
/** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj'). */
|
|
12
|
-
this.placeholder = '';
|
|
13
8
|
this.required = false;
|
|
14
9
|
this.disabled = false;
|
|
15
10
|
this.locale = navigator.language;
|
|
16
|
-
/** What the user sees: the value formatted for `locale`, or their raw typing. */
|
|
17
|
-
this.displayValue = '';
|
|
18
11
|
this.error = '';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
};
|
|
24
|
-
this.handleInput = (e) => {
|
|
25
|
-
this.displayValue = e.target.value;
|
|
12
|
+
this.handleChange = (e) => {
|
|
13
|
+
const val = e.target.value;
|
|
14
|
+
this.error = requiredError(val, this.required, this.locale);
|
|
15
|
+
this.mrdChange.emit({ name: this.name, value: val });
|
|
26
16
|
};
|
|
27
17
|
this.handleBlur = (e) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
31
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
32
|
-
};
|
|
33
|
-
this.handleKeyDown = (e) => {
|
|
34
|
-
// Submitting with Enter never fires blur, so commit the typed text here too.
|
|
35
|
-
if (e.key !== 'Enter')
|
|
36
|
-
return;
|
|
37
|
-
const value = this.commit(e.target.value);
|
|
38
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
39
|
-
};
|
|
40
|
-
this.openPicker = () => {
|
|
41
|
-
const native = this.nativeInput;
|
|
42
|
-
if (!native || this.disabled)
|
|
43
|
-
return;
|
|
44
|
-
// The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
|
|
45
|
-
native.value = this.currentIso();
|
|
46
|
-
try {
|
|
47
|
-
native.showPicker();
|
|
48
|
-
}
|
|
49
|
-
catch (_a) {
|
|
50
|
-
// Browsers without showPicker(): focusing at least surfaces the platform control.
|
|
51
|
-
native.focus();
|
|
52
|
-
}
|
|
18
|
+
const val = e.target.value;
|
|
19
|
+
this.mrdBlur.emit({ name: this.name, value: val });
|
|
53
20
|
};
|
|
54
|
-
this.handlePickerChange = (e) => {
|
|
55
|
-
const iso = e.target.value; // native inputs always yield 'YYYY-MM-DD'
|
|
56
|
-
this.displayValue = formatIsoDate(iso, this.locale);
|
|
57
|
-
this.error = requiredError(iso, this.required, this.locale);
|
|
58
|
-
this.mrdChange.emit({ name: this.name, value: iso });
|
|
59
|
-
this.mrdBlur.emit({ name: this.name, value: iso });
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
componentWillLoad() {
|
|
63
|
-
this.displayValue = formatIsoDate(this.value, this.locale);
|
|
64
|
-
}
|
|
65
|
-
valueChanged(newValue) {
|
|
66
|
-
if (!this.focused)
|
|
67
|
-
this.displayValue = formatIsoDate(newValue, this.locale);
|
|
68
|
-
}
|
|
69
|
-
localeChanged() {
|
|
70
|
-
if (!this.focused)
|
|
71
|
-
this.displayValue = formatIsoDate(this.value, this.locale);
|
|
72
|
-
}
|
|
73
|
-
patternPlaceholder() {
|
|
74
|
-
if (this.placeholder)
|
|
75
|
-
return this.placeholder;
|
|
76
|
-
return localeDatePattern(this.locale, {
|
|
77
|
-
day: t('date_token_day', this.locale),
|
|
78
|
-
month: t('date_token_month', this.locale),
|
|
79
|
-
year: t('date_token_year', this.locale),
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
/** Parse the typed text, reformat it, and emit the ISO value. */
|
|
83
|
-
commit(raw) {
|
|
84
|
-
const trimmed = raw.trim();
|
|
85
|
-
const iso = trimmed ? parseLocalizedDate(trimmed, this.locale) : '';
|
|
86
|
-
if (trimmed && iso === null) {
|
|
87
|
-
// Keep the raw text so the user can correct it instead of retyping.
|
|
88
|
-
this.error = t('invalid_date', this.locale);
|
|
89
|
-
this.displayValue = trimmed;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
this.error = requiredError(iso, this.required, this.locale);
|
|
93
|
-
this.displayValue = iso ? formatIsoDate(iso, this.locale) : '';
|
|
94
|
-
}
|
|
95
|
-
return iso !== null && iso !== void 0 ? iso : '';
|
|
96
|
-
}
|
|
97
|
-
/** The ISO value currently shown, so the picker opens on the right date. */
|
|
98
|
-
currentIso() {
|
|
99
|
-
var _a;
|
|
100
|
-
return (_a = (this.displayValue ? parseLocalizedDate(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
|
|
101
21
|
}
|
|
102
22
|
render() {
|
|
103
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: 'd83beef11c2b9402e251a50885b92e7a057f02ee' }, h("div", { key: '6a26e4969e9bde8c5c87771d7b8c7b4d6c1dd942', class: "mrd-date-field" }, h(FieldLabel, { key: 'a7bc1b1c56e933a51f6b1b1feb794a4678d9d334', base: "mrd-date-field", label: this.label, required: this.required }), h("input", { key: '82e3855654f3b3c554f80d647e783234cca8dae1', class: controlClass('mrd-date-field', !!this.error), type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), h(FieldError, { key: '294b3cdc1004725267aa8265366f5009ab324203', base: "mrd-date-field", error: this.error }))));
|
|
104
24
|
}
|
|
105
25
|
static get is() { return "mrd-date-field"; }
|
|
106
26
|
static get encapsulation() { return "scoped"; }
|
|
@@ -168,7 +88,7 @@ export class MrdDateField {
|
|
|
168
88
|
"optional": false,
|
|
169
89
|
"docs": {
|
|
170
90
|
"tags": [],
|
|
171
|
-
"text": "
|
|
91
|
+
"text": ""
|
|
172
92
|
},
|
|
173
93
|
"getter": false,
|
|
174
94
|
"setter": false,
|
|
@@ -176,26 +96,6 @@ export class MrdDateField {
|
|
|
176
96
|
"attribute": "value",
|
|
177
97
|
"defaultValue": "''"
|
|
178
98
|
},
|
|
179
|
-
"placeholder": {
|
|
180
|
-
"type": "string",
|
|
181
|
-
"mutable": false,
|
|
182
|
-
"complexType": {
|
|
183
|
-
"original": "string",
|
|
184
|
-
"resolved": "string",
|
|
185
|
-
"references": {}
|
|
186
|
-
},
|
|
187
|
-
"required": false,
|
|
188
|
-
"optional": false,
|
|
189
|
-
"docs": {
|
|
190
|
-
"tags": [],
|
|
191
|
-
"text": "Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj')."
|
|
192
|
-
},
|
|
193
|
-
"getter": false,
|
|
194
|
-
"setter": false,
|
|
195
|
-
"reflect": false,
|
|
196
|
-
"attribute": "placeholder",
|
|
197
|
-
"defaultValue": "''"
|
|
198
|
-
},
|
|
199
99
|
"required": {
|
|
200
100
|
"type": "boolean",
|
|
201
101
|
"mutable": false,
|
|
@@ -260,7 +160,6 @@ export class MrdDateField {
|
|
|
260
160
|
}
|
|
261
161
|
static get states() {
|
|
262
162
|
return {
|
|
263
|
-
"displayValue": {},
|
|
264
163
|
"error": {}
|
|
265
164
|
};
|
|
266
165
|
}
|
|
@@ -297,13 +196,4 @@ export class MrdDateField {
|
|
|
297
196
|
}
|
|
298
197
|
}];
|
|
299
198
|
}
|
|
300
|
-
static get watchers() {
|
|
301
|
-
return [{
|
|
302
|
-
"propName": "value",
|
|
303
|
-
"methodName": "valueChanged"
|
|
304
|
-
}, {
|
|
305
|
-
"propName": "locale",
|
|
306
|
-
"methodName": "localeChanged"
|
|
307
|
-
}];
|
|
308
|
-
}
|
|
309
199
|
}
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
content: " *";
|
|
20
20
|
color: var(--mrd-color-danger);
|
|
21
21
|
}
|
|
22
|
-
.mrd-datetime-field__control {
|
|
23
|
-
position: relative;
|
|
24
|
-
display: block;
|
|
25
|
-
}
|
|
26
22
|
.mrd-datetime-field__input {
|
|
27
23
|
display: block;
|
|
28
24
|
width: 100%;
|
|
@@ -57,59 +53,12 @@
|
|
|
57
53
|
.mrd-datetime-field__input--error:focus {
|
|
58
54
|
box-shadow: var(--mrd-shadow-focus-error);
|
|
59
55
|
}
|
|
60
|
-
.mrd-datetime-field__input {
|
|
61
|
-
padding-inline-end: calc(var(--mrd-input-padding-x) + 1.75rem);
|
|
62
|
-
}
|
|
63
|
-
.mrd-datetime-field__picker {
|
|
64
|
-
position: absolute;
|
|
65
|
-
inset-inline-end: var(--mrd-space-1);
|
|
66
|
-
top: 50%;
|
|
67
|
-
transform: translateY(-50%);
|
|
68
|
-
width: 1.75rem;
|
|
69
|
-
height: 1.75rem;
|
|
70
|
-
}
|
|
71
|
-
.mrd-datetime-field__picker-button {
|
|
72
|
-
display: inline-flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
padding: 0;
|
|
78
|
-
border: 0;
|
|
79
|
-
border-radius: var(--mrd-border-radius-sm);
|
|
80
|
-
background: transparent;
|
|
81
|
-
color: var(--mrd-color-neutral-500);
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
transition: color var(--mrd-transition), background-color var(--mrd-transition);
|
|
84
|
-
}
|
|
85
|
-
.mrd-datetime-field__picker-button svg {
|
|
86
|
-
width: 1.125rem;
|
|
87
|
-
height: 1.125rem;
|
|
88
|
-
}
|
|
89
|
-
.mrd-datetime-field__picker-button:hover:not(:disabled) {
|
|
90
|
-
color: var(--mrd-color-primary);
|
|
91
|
-
background-color: var(--mrd-color-neutral-100);
|
|
92
|
-
}
|
|
93
|
-
.mrd-datetime-field__picker-button:focus-visible {
|
|
94
|
-
outline: 2px solid var(--mrd-border-color-focus);
|
|
95
|
-
outline-offset: 1px;
|
|
96
|
-
}
|
|
97
|
-
.mrd-datetime-field__picker-button:disabled {
|
|
98
|
-
cursor: not-allowed;
|
|
99
|
-
opacity: 0.5;
|
|
100
|
-
}
|
|
101
|
-
.mrd-datetime-field__picker-native {
|
|
102
|
-
position: absolute;
|
|
103
|
-
inset: 0;
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 100%;
|
|
106
|
-
padding: 0;
|
|
107
|
-
border: 0;
|
|
108
|
-
opacity: 0;
|
|
109
|
-
pointer-events: none;
|
|
110
|
-
}
|
|
111
56
|
.mrd-datetime-field__error {
|
|
112
57
|
font-family: var(--mrd-font-family);
|
|
113
58
|
font-size: var(--mrd-error-font-size);
|
|
114
59
|
color: var(--mrd-error-color);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mrd-datetime-field__input {
|
|
63
|
+
cursor: pointer;
|
|
115
64
|
}
|
|
@@ -1,77 +1,33 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { t } from "../../../utils/i18n";
|
|
3
|
-
import { formatLocalDateTime, localeDatePattern, parseLocalizedDateTime } from "../../../utils/format";
|
|
4
2
|
import { FieldLabel, FieldError, controlClass, requiredError } from "../field-helpers";
|
|
5
3
|
export class MrdDatetimeField {
|
|
6
4
|
constructor() {
|
|
7
5
|
this.name = '';
|
|
8
6
|
this.label = '';
|
|
9
|
-
/** UTC ISO string, e.g. '2026-07-06T12:30:00Z'. */
|
|
10
7
|
this.value = '';
|
|
11
|
-
/** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj uu:mm'). */
|
|
12
|
-
this.placeholder = '';
|
|
13
8
|
this.required = false;
|
|
14
9
|
this.disabled = false;
|
|
15
10
|
this.locale = navigator.language;
|
|
16
|
-
/** What the user sees: the value formatted for `locale`, or their raw typing. */
|
|
17
|
-
this.displayValue = '';
|
|
18
11
|
this.error = '';
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.displayValue = e.target.value;
|
|
12
|
+
this.localValue = '';
|
|
13
|
+
this.handleChange = (e) => {
|
|
14
|
+
const localVal = e.target.value;
|
|
15
|
+
this.localValue = localVal;
|
|
16
|
+
this.error = requiredError(localVal, this.required, this.locale);
|
|
17
|
+
this.mrdChange.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
26
18
|
};
|
|
27
19
|
this.handleBlur = (e) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
31
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
32
|
-
};
|
|
33
|
-
this.handleKeyDown = (e) => {
|
|
34
|
-
// Submitting with Enter never fires blur, so commit the typed text here too.
|
|
35
|
-
if (e.key !== 'Enter')
|
|
36
|
-
return;
|
|
37
|
-
const value = this.commit(e.target.value);
|
|
38
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
39
|
-
};
|
|
40
|
-
this.openPicker = () => {
|
|
41
|
-
const native = this.nativeInput;
|
|
42
|
-
if (!native || this.disabled)
|
|
43
|
-
return;
|
|
44
|
-
// The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
|
|
45
|
-
native.value = this.currentLocal();
|
|
46
|
-
try {
|
|
47
|
-
native.showPicker();
|
|
48
|
-
}
|
|
49
|
-
catch (_a) {
|
|
50
|
-
// Browsers without showPicker(): focusing at least surfaces the platform control.
|
|
51
|
-
native.focus();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
this.handlePickerChange = (e) => {
|
|
55
|
-
const local = e.target.value; // native inputs always yield 'YYYY-MM-DDTHH:mm'
|
|
56
|
-
this.displayValue = formatLocalDateTime(local, this.locale);
|
|
57
|
-
this.error = requiredError(local, this.required, this.locale);
|
|
58
|
-
const value = this.localToUtc(local);
|
|
59
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
60
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
20
|
+
const localVal = e.target.value;
|
|
21
|
+
this.mrdBlur.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
61
22
|
};
|
|
62
23
|
}
|
|
63
24
|
componentWillLoad() {
|
|
64
|
-
this.
|
|
25
|
+
this.localValue = this.utcToLocal(this.value);
|
|
65
26
|
}
|
|
66
27
|
valueChanged(newVal) {
|
|
67
|
-
|
|
68
|
-
this.displayValue = this.toDisplay(newVal);
|
|
28
|
+
this.localValue = this.utcToLocal(newVal);
|
|
69
29
|
}
|
|
70
|
-
|
|
71
|
-
if (!this.focused)
|
|
72
|
-
this.displayValue = this.toDisplay(this.value);
|
|
73
|
-
}
|
|
74
|
-
// UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone
|
|
30
|
+
// UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone (for datetime-local input)
|
|
75
31
|
utcToLocal(utcStr) {
|
|
76
32
|
if (!utcStr)
|
|
77
33
|
return '';
|
|
@@ -90,43 +46,8 @@ export class MrdDatetimeField {
|
|
|
90
46
|
return '';
|
|
91
47
|
return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
92
48
|
}
|
|
93
|
-
// UTC ISO string → locale-formatted text for the input
|
|
94
|
-
toDisplay(utcStr) {
|
|
95
|
-
return formatLocalDateTime(this.utcToLocal(utcStr), this.locale);
|
|
96
|
-
}
|
|
97
|
-
patternPlaceholder() {
|
|
98
|
-
if (this.placeholder)
|
|
99
|
-
return this.placeholder;
|
|
100
|
-
return localeDatePattern(this.locale, {
|
|
101
|
-
day: t('date_token_day', this.locale),
|
|
102
|
-
month: t('date_token_month', this.locale),
|
|
103
|
-
year: t('date_token_year', this.locale),
|
|
104
|
-
hour: t('time_token_hour', this.locale),
|
|
105
|
-
minute: t('time_token_minute', this.locale),
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/** Parse the typed text, reformat it, and return the UTC value to emit. */
|
|
109
|
-
commit(raw) {
|
|
110
|
-
const trimmed = raw.trim();
|
|
111
|
-
const local = trimmed ? parseLocalizedDateTime(trimmed, this.locale) : '';
|
|
112
|
-
if (trimmed && local === null) {
|
|
113
|
-
// Keep the raw text so the user can correct it instead of retyping.
|
|
114
|
-
this.error = t('invalid_datetime', this.locale);
|
|
115
|
-
this.displayValue = trimmed;
|
|
116
|
-
return '';
|
|
117
|
-
}
|
|
118
|
-
const localValue = local !== null && local !== void 0 ? local : '';
|
|
119
|
-
this.error = requiredError(localValue, this.required, this.locale);
|
|
120
|
-
this.displayValue = localValue ? formatLocalDateTime(localValue, this.locale) : '';
|
|
121
|
-
return this.localToUtc(localValue);
|
|
122
|
-
}
|
|
123
|
-
/** The local 'YYYY-MM-DDTHH:mm' currently shown, so the picker opens on the right moment. */
|
|
124
|
-
currentLocal() {
|
|
125
|
-
var _a;
|
|
126
|
-
return (_a = (this.displayValue ? parseLocalizedDateTime(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
|
|
127
|
-
}
|
|
128
49
|
render() {
|
|
129
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '6f8020590ac879992058aa9547b90c11250fa303' }, h("div", { key: '76abff48cae58d156540181a6577729a449bb888', class: "mrd-datetime-field" }, h(FieldLabel, { key: 'a8c3688980347a27d6467987f11a3c4135ac5234', base: "mrd-datetime-field", label: this.label, required: this.required }), h("input", { key: '1bb1aa7536a6a82313f51240030c828028cafd76', class: controlClass('mrd-datetime-field', !!this.error), type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), h(FieldError, { key: 'c97301640980bf04311751124fc8e87023d59f87', base: "mrd-datetime-field", error: this.error }))));
|
|
130
51
|
}
|
|
131
52
|
static get is() { return "mrd-datetime-field"; }
|
|
132
53
|
static get encapsulation() { return "scoped"; }
|
|
@@ -194,7 +115,7 @@ export class MrdDatetimeField {
|
|
|
194
115
|
"optional": false,
|
|
195
116
|
"docs": {
|
|
196
117
|
"tags": [],
|
|
197
|
-
"text": "
|
|
118
|
+
"text": ""
|
|
198
119
|
},
|
|
199
120
|
"getter": false,
|
|
200
121
|
"setter": false,
|
|
@@ -202,26 +123,6 @@ export class MrdDatetimeField {
|
|
|
202
123
|
"attribute": "value",
|
|
203
124
|
"defaultValue": "''"
|
|
204
125
|
},
|
|
205
|
-
"placeholder": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"mutable": false,
|
|
208
|
-
"complexType": {
|
|
209
|
-
"original": "string",
|
|
210
|
-
"resolved": "string",
|
|
211
|
-
"references": {}
|
|
212
|
-
},
|
|
213
|
-
"required": false,
|
|
214
|
-
"optional": false,
|
|
215
|
-
"docs": {
|
|
216
|
-
"tags": [],
|
|
217
|
-
"text": "Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj uu:mm')."
|
|
218
|
-
},
|
|
219
|
-
"getter": false,
|
|
220
|
-
"setter": false,
|
|
221
|
-
"reflect": false,
|
|
222
|
-
"attribute": "placeholder",
|
|
223
|
-
"defaultValue": "''"
|
|
224
|
-
},
|
|
225
126
|
"required": {
|
|
226
127
|
"type": "boolean",
|
|
227
128
|
"mutable": false,
|
|
@@ -286,8 +187,8 @@ export class MrdDatetimeField {
|
|
|
286
187
|
}
|
|
287
188
|
static get states() {
|
|
288
189
|
return {
|
|
289
|
-
"
|
|
290
|
-
"
|
|
190
|
+
"error": {},
|
|
191
|
+
"localValue": {}
|
|
291
192
|
};
|
|
292
193
|
}
|
|
293
194
|
static get events() {
|
|
@@ -327,9 +228,6 @@ export class MrdDatetimeField {
|
|
|
327
228
|
return [{
|
|
328
229
|
"propName": "value",
|
|
329
230
|
"methodName": "valueChanged"
|
|
330
|
-
}, {
|
|
331
|
-
"propName": "locale",
|
|
332
|
-
"methodName": "localeChanged"
|
|
333
231
|
}];
|
|
334
232
|
}
|
|
335
233
|
}
|
|
@@ -24,7 +24,7 @@ export class MrdEmailField {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '3253124dadc7f0b3f120c11f8c35604a2f671b0a' }, h("div", { key: 'db820652452145c30f21b41a65942c0a4c6f45f1', class: "mrd-email-field" }, h(FieldLabel, { key: '8b1c5a84afce9fd18c3f644e5c92f07363e116d4', base: "mrd-email-field", label: this.label, required: this.required }), h("input", { key: 'dc4bada3208aa6cb7585b1872f53605177371493', class: controlClass('mrd-email-field', !!this.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 }), h(FieldError, { key: 'c44377d1b6a4a4c468b080b23eecd4ba9ca326e1', base: "mrd-email-field", error: this.error }))));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "mrd-email-field"; }
|
|
30
30
|
static get encapsulation() { return "scoped"; }
|
|
@@ -112,7 +112,7 @@ export class MrdFileField {
|
|
|
112
112
|
error: hasError,
|
|
113
113
|
disabled: this.disabled || this.zoneBusy,
|
|
114
114
|
});
|
|
115
|
-
return (h(Host, { key: '
|
|
115
|
+
return (h(Host, { key: '2e740a0857b069740a6a13616d0a0dfee2b945be' }, h("div", { key: '069b25ced3b2f1ce547819086dadbd53ade2378c', class: "mrd-file-field" }, h(FieldLabel, { key: 'd13f3cb0af766d6328772dab865b2079c85ec075', base: "mrd-file-field", label: this.label, required: this.required }), h("div", { key: '9ffdbb508e3934854034c46e6f719a88d4175920', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, h("input", { key: 'c5d6954b8fa050889b5b65e15fde229dd64d7cc7', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (h("div", { class: "mrd-file-field__selected" }, this.renderEntry(this.entries[0], 0))) : (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)))))), this.multiple && hasEntries && (h("ul", { key: '910a3e89f74d93ab16fb9f677a4276d5ad88897d', class: "mrd-file-field__list" }, this.entries.map((entry, index) => (h("li", { class: "mrd-file-field__item", key: `${index}-${entryLabel(entry)}` }, this.renderEntry(entry, index)))))), h(FieldError, { key: '4f0f071b0a1460ea1d6067a8fa4f588ebc620f2a', base: "mrd-file-field", error: this.error }))));
|
|
116
116
|
}
|
|
117
117
|
static get is() { return "mrd-file-field"; }
|
|
118
118
|
static get encapsulation() { return "scoped"; }
|
|
@@ -130,7 +130,7 @@ export class MrdImageField {
|
|
|
130
130
|
error: hasError,
|
|
131
131
|
disabled: this.disabled || this.zoneBusy,
|
|
132
132
|
});
|
|
133
|
-
return (h(Host, { key: '
|
|
133
|
+
return (h(Host, { key: '51d39ea80195565a5dc780ff6a7923a976cfb0a7' }, h("div", { key: 'd76edb7ac9f1efea8c7c3d5b04e906ad4ab4c761', class: "mrd-image-field" }, h(FieldLabel, { key: 'b46a67a76188047677c40ce3f406daed7d8de141', base: "mrd-image-field", label: this.label, required: this.required }), h("div", { key: '0156a9722ea48d84e3ea1a829e4266425a594a6a', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, h("input", { key: '1b8e41da71bb57254bfd2e5527b05e1aeb32eb2f', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (this.renderSingle(this.entries[0])) : (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)))))), this.multiple && hasEntries && (h("ul", { key: '9211b5212eae0629f7c9b2b49d80e2b658a9ddd3', class: "mrd-image-field__grid" }, this.entries.map((entry, index) => this.renderGridItem(entry, index)))), h(FieldError, { key: '5f49c03156ed18e7c8307adff679b149658ca4a6', base: "mrd-image-field", error: this.error }))));
|
|
134
134
|
}
|
|
135
135
|
static get is() { return "mrd-image-field"; }
|
|
136
136
|
static get encapsulation() { return "scoped"; }
|
|
@@ -21,7 +21,7 @@ export class MrdLongtextField {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: 'e53fec4d4eafbd68d9cffb1f064d8e0c4c37839c' }, h("div", { key: '8843a23e42b0545c269fc6c924e7ae295770064e', class: "mrd-longtext-field" }, h(FieldLabel, { key: '8767676dd35f25f9bf5ebdb26887edc0882582e0', base: "mrd-longtext-field", label: this.label, required: this.required }), this.disabled ? (h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (h("textarea", { class: controlClass('mrd-longtext-field', !!this.error), name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), h(FieldError, { key: '54dc790173575e8a02764e5b14040b900c2eb609', base: "mrd-longtext-field", error: this.error }))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "mrd-longtext-field"; }
|
|
27
27
|
static get encapsulation() { return "scoped"; }
|
|
@@ -86,7 +86,7 @@ export class MrdNumberField {
|
|
|
86
86
|
const hasError = !!this.error;
|
|
87
87
|
const suffix = this.dataType === ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
|
|
88
88
|
this.dataType === ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: '7343dbca882b5054f22de17672ac748a8e3eca11' }, h("div", { key: 'cef10b39515b48fc9c44e651910c6a0c2a847628', class: "mrd-number-field" }, h(FieldLabel, { key: '66f178cf20f1f2f0587bd9614db150d6ae63023e', base: "mrd-number-field", label: this.label, required: this.required }), h("div", { key: 'c57c22e663a570f6e5a70b07b817970f135e850c', class: "mrd-number-field__input-wrapper" }, h("input", { key: '388b20ac11fa4aaf78df124c858b579e12f53619', class: controlClass('mrd-number-field', hasError), type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), h(FieldError, { key: 'f99bb85668b047a97162ffee2582eb45dc0589ae', base: "mrd-number-field", error: this.error }))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "mrd-number-field"; }
|
|
92
92
|
static get encapsulation() { return "scoped"; }
|
|
@@ -21,9 +21,9 @@ export class MrdSecretField {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: 'e06d04fdae34b42441976e21605fe94ad935382e' }, h("div", { key: '2889e1eb1b6d0887ae531523a0b9b43c49ef6f99', class: "mrd-secret-field" }, h(FieldLabel, { key: 'c40907905292cdef8bb0b8b9b0c03e05650bef37', base: "mrd-secret-field", label: this.label, required: this.required }), this.disabled
|
|
25
25
|
? (h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
|
|
26
|
-
: (h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), h(FieldError, { key: '
|
|
26
|
+
: (h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), h(FieldError, { key: '6353e4b40566852dbc1994c7c9c409d0d0aa1b37', base: "mrd-secret-field", error: this.error }))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "mrd-secret-field"; }
|
|
29
29
|
static get encapsulation() { return "scoped"; }
|
|
@@ -21,7 +21,7 @@ export class MrdTextField {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '3153f0c6f8ab4d9dae93306f7507399aeda75eaf' }, h("div", { key: '5d9c28023fdfb5472fc115c66bc3df509506e10f', class: "mrd-text-field" }, h(FieldLabel, { key: '1e21139aae0cc1ae95aa3297271b618a40043e77', base: "mrd-text-field", label: this.label, required: this.required }), h("input", { key: '46f98d5e39bb834075449fac7096b077a1ae7bb3', class: controlClass('mrd-text-field', !!this.error), type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), h(FieldError, { key: '10b6ddae9cd9f36dc9d7176167d79df8e4102c03', base: "mrd-text-field", error: this.error }))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "mrd-text-field"; }
|
|
27
27
|
static get encapsulation() { return "scoped"; }
|
|
@@ -64,7 +64,7 @@ export class MrdTextareaField {
|
|
|
64
64
|
return DOMPurify.sanitize(html);
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'e132531881f68f373e700617aac8033c8ebccb47' }, h("div", { key: 'fec0cf56cd7868d3fcd5a4e8a382b2dcdb6e5c50', class: "mrd-textarea-field" }, h(FieldLabel, { key: '333aa2ff57cce9e3178f0c4be4a1df1077884248', base: "mrd-textarea-field", label: this.label, required: this.required }), h("div", { key: '40025207580eb5768981b85aaa0a8ff95fce7234', class: controlClass('mrd-textarea-field', !!this.error, 'container') }, h("div", { key: '621987b3b2b1d8b4836bff065075ba527a82db81', class: "mrd-textarea-field__editor" })), h(FieldError, { key: 'ac2d8de22f008cd1c91842137ccd0cd36eb9ce19', base: "mrd-textarea-field", error: this.error }))));
|
|
68
68
|
}
|
|
69
69
|
static get is() { return "mrd-textarea-field"; }
|
|
70
70
|
static get encapsulation() { return "scoped"; }
|
|
@@ -20,7 +20,7 @@ export class MrdTimeField {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: 'd521c654bc7beda71a31542a25198edaaf53b838' }, h("div", { key: '084ab16ac8aed952bd0ec50e0430591d4db5bd4b', class: "mrd-time-field" }, h(FieldLabel, { key: '43938ad7c5a9765353f6523d399d4b74cbb9ec6f', base: "mrd-time-field", label: this.label, required: this.required }), h("input", { key: 'e46eda620e7a5f1bb3b433a4c051e913675c33f9', class: controlClass('mrd-time-field', !!this.error), type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), h(FieldError, { key: '34bc1eaa1b969951dffaaacad73af532b6d290fb', base: "mrd-time-field", error: this.error }))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "mrd-time-field"; }
|
|
26
26
|
static get encapsulation() { return "scoped"; }
|
|
@@ -111,7 +111,7 @@ export class MrdField {
|
|
|
111
111
|
return (h("div", { class: "mrd-field__history-editor" }, this.historyEntries.length > 0 && (h("span", { class: "mrd-field__history-editor-label" }, t('history_badge_tooltip', locale))), this.historyEntries.map((entry, i) => (h("div", { key: String(i), class: "mrd-field__history-editor-row" }, h("input", { class: "mrd-field__history-editor-value", type: valueType, value: entry.value, onInput: (e) => updateEntry(i, 'value', e.target.value) }), h("span", { class: "mrd-field__history-editor-sep" }, t('history_until', locale)), h("input", { class: "mrd-field__history-editor-until", type: "date", value: entry.until, onInput: (e) => updateEntry(i, 'until', e.target.value) }), h("button", { type: "button", class: "mrd-field__history-editor-remove", onClick: () => removeEntry(i), "aria-label": t('remove', locale) }, h("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, h("path", { "fill-rule": "evenodd", d: "M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z", "clip-rule": "evenodd" })))))), h("button", { type: "button", class: "mrd-field__history-editor-add", onClick: addEntry }, "+ ", t('add', locale))));
|
|
112
112
|
}
|
|
113
113
|
renderLeafField(displayValue) {
|
|
114
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6
|
|
114
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
115
115
|
const { item, locale } = this;
|
|
116
116
|
const commonProps = {
|
|
117
117
|
name: item.name,
|
|
@@ -136,25 +136,25 @@ export class MrdField {
|
|
|
136
136
|
case ClientLayoutItemFieldDataType.BOOLEAN:
|
|
137
137
|
return (h("mrd-boolean-field", Object.assign({}, commonProps, { value: (_l = displayValue) !== null && _l !== void 0 ? _l : false })));
|
|
138
138
|
case ClientLayoutItemFieldDataType.DATE:
|
|
139
|
-
return (h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : ''
|
|
139
|
+
return (h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : '' })));
|
|
140
140
|
case ClientLayoutItemFieldDataType.DATETIME:
|
|
141
|
-
return (h("mrd-datetime-field", Object.assign({}, commonProps, { value: (
|
|
141
|
+
return (h("mrd-datetime-field", Object.assign({}, commonProps, { value: (_o = displayValue) !== null && _o !== void 0 ? _o : '' })));
|
|
142
142
|
case ClientLayoutItemFieldDataType.TIME:
|
|
143
|
-
return (h("mrd-time-field", Object.assign({}, commonProps, { value: (
|
|
143
|
+
return (h("mrd-time-field", Object.assign({}, commonProps, { value: (_p = displayValue) !== null && _p !== void 0 ? _p : '' })));
|
|
144
144
|
case ClientLayoutItemFieldDataType.EMAIL:
|
|
145
|
-
return (h("mrd-email-field", Object.assign({}, commonProps, { value: (
|
|
145
|
+
return (h("mrd-email-field", Object.assign({}, commonProps, { value: (_q = displayValue) !== null && _q !== void 0 ? _q : '', placeholder: (_r = item.placeholder) !== null && _r !== void 0 ? _r : '' })));
|
|
146
146
|
case ClientLayoutItemFieldDataType.HYPERLINK:
|
|
147
|
-
return (h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (
|
|
147
|
+
return (h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (_s = displayValue) !== null && _s !== void 0 ? _s : '', placeholder: (_t = item.placeholder) !== null && _t !== void 0 ? _t : '' })));
|
|
148
148
|
case ClientLayoutItemFieldDataType.LIST:
|
|
149
|
-
return (h("mrd-list-field", Object.assign({}, commonProps, { value: (
|
|
149
|
+
return (h("mrd-list-field", Object.assign({}, commonProps, { value: (_u = displayValue) !== null && _u !== void 0 ? _u : '', multiple: (_v = item.multiple) !== null && _v !== void 0 ? _v : false, listItems: (_w = item.listItems) !== null && _w !== void 0 ? _w : [] })));
|
|
150
150
|
case ClientLayoutItemFieldDataType.FILE:
|
|
151
|
-
return (h("mrd-file-field", Object.assign({}, commonProps, { value: displayValue, accept: (
|
|
151
|
+
return (h("mrd-file-field", Object.assign({}, commonProps, { value: displayValue, accept: (_x = item.accept) !== null && _x !== void 0 ? _x : '', maxSize: (_y = item.maxSize) !== null && _y !== void 0 ? _y : 0, multiple: (_z = item.multiple) !== null && _z !== void 0 ? _z : false, onMrdUpload: this.handleUpload })));
|
|
152
152
|
case ClientLayoutItemFieldDataType.IMAGE:
|
|
153
|
-
return (h("mrd-image-field", Object.assign({}, commonProps, { value: displayValue, accept: (
|
|
153
|
+
return (h("mrd-image-field", Object.assign({}, commonProps, { value: displayValue, accept: (_0 = item.accept) !== null && _0 !== void 0 ? _0 : 'image/*', maxSize: (_1 = item.maxSize) !== null && _1 !== void 0 ? _1 : 0, multiple: (_2 = item.multiple) !== null && _2 !== void 0 ? _2 : false, onMrdUpload: this.handleUpload })));
|
|
154
154
|
case ClientLayoutItemFieldDataType.LONGTEXT:
|
|
155
|
-
return (h("mrd-longtext-field", Object.assign({}, commonProps, { value: (
|
|
155
|
+
return (h("mrd-longtext-field", Object.assign({}, commonProps, { value: (_3 = displayValue) !== null && _3 !== void 0 ? _3 : '', placeholder: (_4 = item.placeholder) !== null && _4 !== void 0 ? _4 : '' })));
|
|
156
156
|
case ClientLayoutItemFieldDataType.SECRET:
|
|
157
|
-
return (h("mrd-secret-field", Object.assign({}, commonProps, { value: (
|
|
157
|
+
return (h("mrd-secret-field", Object.assign({}, commonProps, { value: (_5 = displayValue) !== null && _5 !== void 0 ? _5 : '', placeholder: (_6 = item.placeholder) !== null && _6 !== void 0 ? _6 : '' })));
|
|
158
158
|
default:
|
|
159
159
|
return null;
|
|
160
160
|
}
|