@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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DVbdkYO3.js');
|
|
4
|
-
var cellRenderer = require('./cell-renderer-
|
|
4
|
+
var cellRenderer = require('./cell-renderer-Coy-aD3k.js');
|
|
5
5
|
var clientLayout = require('./client-layout-CqVuJumR.js');
|
|
6
6
|
|
|
7
7
|
const mrdBooleanFieldCss = () => `.sc-mrd-boolean-field-h{display:block}.mrd-boolean-field.sc-mrd-boolean-field{display:flex;align-items:center;width:100%}.mrd-boolean-field__toggle-label.sc-mrd-boolean-field{display:flex;align-items:center;gap:var(--mrd-space-3);cursor:pointer;user-select:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field{background-color:var(--mrd-color-primary)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{transform:translateX(20px)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:focus+.mrd-boolean-field__toggle.sc-mrd-boolean-field{box-shadow:var(--mrd-shadow-focus)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:disabled+.mrd-boolean-field__toggle.sc-mrd-boolean-field{opacity:0.5;cursor:not-allowed}.mrd-boolean-field__toggle.sc-mrd-boolean-field{position:relative;display:inline-block;width:44px;height:24px;background-color:var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius-full);transition:background-color var(--mrd-transition);flex-shrink:0}.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:var(--mrd-color-white);border-radius:50%;transition:transform var(--mrd-transition);box-shadow:var(--mrd-shadow-sm)}.mrd-boolean-field__text.sc-mrd-boolean-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-boolean-field__text--required.sc-mrd-boolean-field::after{content:" *";color:var(--mrd-color-danger)}`;
|
|
@@ -201,7 +201,7 @@ const MrdCurrencyField = class {
|
|
|
201
201
|
};
|
|
202
202
|
MrdCurrencyField.style = mrdCurrencyFieldCss();
|
|
203
203
|
|
|
204
|
-
const mrdDateFieldCss = () => `.sc-mrd-date-field-h{display:block}.mrd-date-field.sc-mrd-date-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-date-field__label.sc-mrd-date-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-date-field__label--required.sc-mrd-date-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-date-
|
|
204
|
+
const mrdDateFieldCss = () => `.sc-mrd-date-field-h{display:block}.mrd-date-field.sc-mrd-date-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-date-field__label.sc-mrd-date-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-date-field__label--required.sc-mrd-date-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-date-field__input.sc-mrd-date-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-date-field__input.sc-mrd-date-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-date-field__input.sc-mrd-date-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-date-field__input.sc-mrd-date-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-date-field__input--error.sc-mrd-date-field{border-color:var(--mrd-border-color-error)}.mrd-date-field__input--error.sc-mrd-date-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-date-field__error.sc-mrd-date-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-date-field__input.sc-mrd-date-field{cursor:pointer}`;
|
|
205
205
|
|
|
206
206
|
const MrdDateField = class {
|
|
207
207
|
constructor(hostRef) {
|
|
@@ -210,114 +210,28 @@ const MrdDateField = class {
|
|
|
210
210
|
this.mrdBlur = index.createEvent(this, "mrdBlur");
|
|
211
211
|
this.name = '';
|
|
212
212
|
this.label = '';
|
|
213
|
-
/** ISO date, 'YYYY-MM-DD'. */
|
|
214
213
|
this.value = '';
|
|
215
|
-
/** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj'). */
|
|
216
|
-
this.placeholder = '';
|
|
217
214
|
this.required = false;
|
|
218
215
|
this.disabled = false;
|
|
219
216
|
this.locale = navigator.language;
|
|
220
|
-
/** What the user sees: the value formatted for `locale`, or their raw typing. */
|
|
221
|
-
this.displayValue = '';
|
|
222
217
|
this.error = '';
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
this.
|
|
227
|
-
};
|
|
228
|
-
this.handleInput = (e) => {
|
|
229
|
-
this.displayValue = e.target.value;
|
|
218
|
+
this.handleChange = (e) => {
|
|
219
|
+
const val = e.target.value;
|
|
220
|
+
this.error = requiredError(val, this.required, this.locale);
|
|
221
|
+
this.mrdChange.emit({ name: this.name, value: val });
|
|
230
222
|
};
|
|
231
223
|
this.handleBlur = (e) => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
235
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
236
|
-
};
|
|
237
|
-
this.handleKeyDown = (e) => {
|
|
238
|
-
// Submitting with Enter never fires blur, so commit the typed text here too.
|
|
239
|
-
if (e.key !== 'Enter')
|
|
240
|
-
return;
|
|
241
|
-
const value = this.commit(e.target.value);
|
|
242
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
243
|
-
};
|
|
244
|
-
this.openPicker = () => {
|
|
245
|
-
const native = this.nativeInput;
|
|
246
|
-
if (!native || this.disabled)
|
|
247
|
-
return;
|
|
248
|
-
// The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
|
|
249
|
-
native.value = this.currentIso();
|
|
250
|
-
try {
|
|
251
|
-
native.showPicker();
|
|
252
|
-
}
|
|
253
|
-
catch (_a) {
|
|
254
|
-
// Browsers without showPicker(): focusing at least surfaces the platform control.
|
|
255
|
-
native.focus();
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
this.handlePickerChange = (e) => {
|
|
259
|
-
const iso = e.target.value; // native inputs always yield 'YYYY-MM-DD'
|
|
260
|
-
this.displayValue = cellRenderer.formatIsoDate(iso, this.locale);
|
|
261
|
-
this.error = requiredError(iso, this.required, this.locale);
|
|
262
|
-
this.mrdChange.emit({ name: this.name, value: iso });
|
|
263
|
-
this.mrdBlur.emit({ name: this.name, value: iso });
|
|
224
|
+
const val = e.target.value;
|
|
225
|
+
this.mrdBlur.emit({ name: this.name, value: val });
|
|
264
226
|
};
|
|
265
227
|
}
|
|
266
|
-
componentWillLoad() {
|
|
267
|
-
this.displayValue = cellRenderer.formatIsoDate(this.value, this.locale);
|
|
268
|
-
}
|
|
269
|
-
valueChanged(newValue) {
|
|
270
|
-
if (!this.focused)
|
|
271
|
-
this.displayValue = cellRenderer.formatIsoDate(newValue, this.locale);
|
|
272
|
-
}
|
|
273
|
-
localeChanged() {
|
|
274
|
-
if (!this.focused)
|
|
275
|
-
this.displayValue = cellRenderer.formatIsoDate(this.value, this.locale);
|
|
276
|
-
}
|
|
277
|
-
patternPlaceholder() {
|
|
278
|
-
if (this.placeholder)
|
|
279
|
-
return this.placeholder;
|
|
280
|
-
return cellRenderer.localeDatePattern(this.locale, {
|
|
281
|
-
day: cellRenderer.t('date_token_day', this.locale),
|
|
282
|
-
month: cellRenderer.t('date_token_month', this.locale),
|
|
283
|
-
year: cellRenderer.t('date_token_year', this.locale),
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
/** Parse the typed text, reformat it, and emit the ISO value. */
|
|
287
|
-
commit(raw) {
|
|
288
|
-
const trimmed = raw.trim();
|
|
289
|
-
const iso = trimmed ? cellRenderer.parseLocalizedDate(trimmed, this.locale) : '';
|
|
290
|
-
if (trimmed && iso === null) {
|
|
291
|
-
// Keep the raw text so the user can correct it instead of retyping.
|
|
292
|
-
this.error = cellRenderer.t('invalid_date', this.locale);
|
|
293
|
-
this.displayValue = trimmed;
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
this.error = requiredError(iso, this.required, this.locale);
|
|
297
|
-
this.displayValue = iso ? cellRenderer.formatIsoDate(iso, this.locale) : '';
|
|
298
|
-
}
|
|
299
|
-
return iso !== null && iso !== void 0 ? iso : '';
|
|
300
|
-
}
|
|
301
|
-
/** The ISO value currently shown, so the picker opens on the right date. */
|
|
302
|
-
currentIso() {
|
|
303
|
-
var _a;
|
|
304
|
-
return (_a = (this.displayValue ? cellRenderer.parseLocalizedDate(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
|
|
305
|
-
}
|
|
306
228
|
render() {
|
|
307
|
-
return (index.h(index.Host, { key: '
|
|
229
|
+
return (index.h(index.Host, { key: 'd83beef11c2b9402e251a50885b92e7a057f02ee' }, index.h("div", { key: '6a26e4969e9bde8c5c87771d7b8c7b4d6c1dd942', class: "mrd-date-field" }, index.h(FieldLabel, { key: 'a7bc1b1c56e933a51f6b1b1feb794a4678d9d334', base: "mrd-date-field", label: this.label, required: this.required }), index.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 }), index.h(FieldError, { key: '294b3cdc1004725267aa8265366f5009ab324203', base: "mrd-date-field", error: this.error }))));
|
|
308
230
|
}
|
|
309
|
-
static get watchers() { return {
|
|
310
|
-
"value": [{
|
|
311
|
-
"valueChanged": 0
|
|
312
|
-
}],
|
|
313
|
-
"locale": [{
|
|
314
|
-
"localeChanged": 0
|
|
315
|
-
}]
|
|
316
|
-
}; }
|
|
317
231
|
};
|
|
318
232
|
MrdDateField.style = mrdDateFieldCss();
|
|
319
233
|
|
|
320
|
-
const mrdDatetimeFieldCss = () => `.sc-mrd-datetime-field-h{display:block}.mrd-datetime-field.sc-mrd-datetime-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-datetime-field__label.sc-mrd-datetime-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-datetime-field__label--required.sc-mrd-datetime-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-datetime-
|
|
234
|
+
const mrdDatetimeFieldCss = () => `.sc-mrd-datetime-field-h{display:block}.mrd-datetime-field.sc-mrd-datetime-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-datetime-field__label.sc-mrd-datetime-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-datetime-field__label--required.sc-mrd-datetime-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-datetime-field__input.sc-mrd-datetime-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-datetime-field__input.sc-mrd-datetime-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-datetime-field__input.sc-mrd-datetime-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-datetime-field__input.sc-mrd-datetime-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-datetime-field__input--error.sc-mrd-datetime-field{border-color:var(--mrd-border-color-error)}.mrd-datetime-field__input--error.sc-mrd-datetime-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-datetime-field__error.sc-mrd-datetime-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-datetime-field__input.sc-mrd-datetime-field{cursor:pointer}`;
|
|
321
235
|
|
|
322
236
|
const MrdDatetimeField = class {
|
|
323
237
|
constructor(hostRef) {
|
|
@@ -326,72 +240,30 @@ const MrdDatetimeField = class {
|
|
|
326
240
|
this.mrdBlur = index.createEvent(this, "mrdBlur");
|
|
327
241
|
this.name = '';
|
|
328
242
|
this.label = '';
|
|
329
|
-
/** UTC ISO string, e.g. '2026-07-06T12:30:00Z'. */
|
|
330
243
|
this.value = '';
|
|
331
|
-
/** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj uu:mm'). */
|
|
332
|
-
this.placeholder = '';
|
|
333
244
|
this.required = false;
|
|
334
245
|
this.disabled = false;
|
|
335
246
|
this.locale = navigator.language;
|
|
336
|
-
/** What the user sees: the value formatted for `locale`, or their raw typing. */
|
|
337
|
-
this.displayValue = '';
|
|
338
247
|
this.error = '';
|
|
339
|
-
|
|
340
|
-
this.
|
|
341
|
-
|
|
342
|
-
this.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
this.displayValue = e.target.value;
|
|
248
|
+
this.localValue = '';
|
|
249
|
+
this.handleChange = (e) => {
|
|
250
|
+
const localVal = e.target.value;
|
|
251
|
+
this.localValue = localVal;
|
|
252
|
+
this.error = requiredError(localVal, this.required, this.locale);
|
|
253
|
+
this.mrdChange.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
346
254
|
};
|
|
347
255
|
this.handleBlur = (e) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
351
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
352
|
-
};
|
|
353
|
-
this.handleKeyDown = (e) => {
|
|
354
|
-
// Submitting with Enter never fires blur, so commit the typed text here too.
|
|
355
|
-
if (e.key !== 'Enter')
|
|
356
|
-
return;
|
|
357
|
-
const value = this.commit(e.target.value);
|
|
358
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
359
|
-
};
|
|
360
|
-
this.openPicker = () => {
|
|
361
|
-
const native = this.nativeInput;
|
|
362
|
-
if (!native || this.disabled)
|
|
363
|
-
return;
|
|
364
|
-
// The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
|
|
365
|
-
native.value = this.currentLocal();
|
|
366
|
-
try {
|
|
367
|
-
native.showPicker();
|
|
368
|
-
}
|
|
369
|
-
catch (_a) {
|
|
370
|
-
// Browsers without showPicker(): focusing at least surfaces the platform control.
|
|
371
|
-
native.focus();
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
this.handlePickerChange = (e) => {
|
|
375
|
-
const local = e.target.value; // native inputs always yield 'YYYY-MM-DDTHH:mm'
|
|
376
|
-
this.displayValue = cellRenderer.formatLocalDateTime(local, this.locale);
|
|
377
|
-
this.error = requiredError(local, this.required, this.locale);
|
|
378
|
-
const value = this.localToUtc(local);
|
|
379
|
-
this.mrdChange.emit({ name: this.name, value });
|
|
380
|
-
this.mrdBlur.emit({ name: this.name, value });
|
|
256
|
+
const localVal = e.target.value;
|
|
257
|
+
this.mrdBlur.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
381
258
|
};
|
|
382
259
|
}
|
|
383
260
|
componentWillLoad() {
|
|
384
|
-
this.
|
|
261
|
+
this.localValue = this.utcToLocal(this.value);
|
|
385
262
|
}
|
|
386
263
|
valueChanged(newVal) {
|
|
387
|
-
|
|
388
|
-
this.displayValue = this.toDisplay(newVal);
|
|
389
|
-
}
|
|
390
|
-
localeChanged() {
|
|
391
|
-
if (!this.focused)
|
|
392
|
-
this.displayValue = this.toDisplay(this.value);
|
|
264
|
+
this.localValue = this.utcToLocal(newVal);
|
|
393
265
|
}
|
|
394
|
-
// UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone
|
|
266
|
+
// UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone (for datetime-local input)
|
|
395
267
|
utcToLocal(utcStr) {
|
|
396
268
|
if (!utcStr)
|
|
397
269
|
return '';
|
|
@@ -410,50 +282,12 @@ const MrdDatetimeField = class {
|
|
|
410
282
|
return '';
|
|
411
283
|
return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
412
284
|
}
|
|
413
|
-
// UTC ISO string → locale-formatted text for the input
|
|
414
|
-
toDisplay(utcStr) {
|
|
415
|
-
return cellRenderer.formatLocalDateTime(this.utcToLocal(utcStr), this.locale);
|
|
416
|
-
}
|
|
417
|
-
patternPlaceholder() {
|
|
418
|
-
if (this.placeholder)
|
|
419
|
-
return this.placeholder;
|
|
420
|
-
return cellRenderer.localeDatePattern(this.locale, {
|
|
421
|
-
day: cellRenderer.t('date_token_day', this.locale),
|
|
422
|
-
month: cellRenderer.t('date_token_month', this.locale),
|
|
423
|
-
year: cellRenderer.t('date_token_year', this.locale),
|
|
424
|
-
hour: cellRenderer.t('time_token_hour', this.locale),
|
|
425
|
-
minute: cellRenderer.t('time_token_minute', this.locale),
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
/** Parse the typed text, reformat it, and return the UTC value to emit. */
|
|
429
|
-
commit(raw) {
|
|
430
|
-
const trimmed = raw.trim();
|
|
431
|
-
const local = trimmed ? cellRenderer.parseLocalizedDateTime(trimmed, this.locale) : '';
|
|
432
|
-
if (trimmed && local === null) {
|
|
433
|
-
// Keep the raw text so the user can correct it instead of retyping.
|
|
434
|
-
this.error = cellRenderer.t('invalid_datetime', this.locale);
|
|
435
|
-
this.displayValue = trimmed;
|
|
436
|
-
return '';
|
|
437
|
-
}
|
|
438
|
-
const localValue = local !== null && local !== void 0 ? local : '';
|
|
439
|
-
this.error = requiredError(localValue, this.required, this.locale);
|
|
440
|
-
this.displayValue = localValue ? cellRenderer.formatLocalDateTime(localValue, this.locale) : '';
|
|
441
|
-
return this.localToUtc(localValue);
|
|
442
|
-
}
|
|
443
|
-
/** The local 'YYYY-MM-DDTHH:mm' currently shown, so the picker opens on the right moment. */
|
|
444
|
-
currentLocal() {
|
|
445
|
-
var _a;
|
|
446
|
-
return (_a = (this.displayValue ? cellRenderer.parseLocalizedDateTime(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
|
|
447
|
-
}
|
|
448
285
|
render() {
|
|
449
|
-
return (index.h(index.Host, { key: '
|
|
286
|
+
return (index.h(index.Host, { key: '6f8020590ac879992058aa9547b90c11250fa303' }, index.h("div", { key: '76abff48cae58d156540181a6577729a449bb888', class: "mrd-datetime-field" }, index.h(FieldLabel, { key: 'a8c3688980347a27d6467987f11a3c4135ac5234', base: "mrd-datetime-field", label: this.label, required: this.required }), index.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 }), index.h(FieldError, { key: 'c97301640980bf04311751124fc8e87023d59f87', base: "mrd-datetime-field", error: this.error }))));
|
|
450
287
|
}
|
|
451
288
|
static get watchers() { return {
|
|
452
289
|
"value": [{
|
|
453
290
|
"valueChanged": 0
|
|
454
|
-
}],
|
|
455
|
-
"locale": [{
|
|
456
|
-
"localeChanged": 0
|
|
457
291
|
}]
|
|
458
292
|
}; }
|
|
459
293
|
};
|
|
@@ -1677,7 +1511,7 @@ const MrdEmailField = class {
|
|
|
1677
1511
|
};
|
|
1678
1512
|
}
|
|
1679
1513
|
render() {
|
|
1680
|
-
return (index.h(index.Host, { key: '
|
|
1514
|
+
return (index.h(index.Host, { key: '3253124dadc7f0b3f120c11f8c35604a2f671b0a' }, index.h("div", { key: 'db820652452145c30f21b41a65942c0a4c6f45f1', class: "mrd-email-field" }, index.h(FieldLabel, { key: '8b1c5a84afce9fd18c3f644e5c92f07363e116d4', base: "mrd-email-field", label: this.label, required: this.required }), index.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 }), index.h(FieldError, { key: 'c44377d1b6a4a4c468b080b23eecd4ba9ca326e1', base: "mrd-email-field", error: this.error }))));
|
|
1681
1515
|
}
|
|
1682
1516
|
};
|
|
1683
1517
|
MrdEmailField.style = mrdEmailFieldCss();
|
|
@@ -4310,7 +4144,7 @@ const MrdField = class {
|
|
|
4310
4144
|
return (index.h("div", { class: "mrd-field__history-editor" }, this.historyEntries.length > 0 && (index.h("span", { class: "mrd-field__history-editor-label" }, cellRenderer.t('history_badge_tooltip', locale))), this.historyEntries.map((entry, i) => (index.h("div", { key: String(i), class: "mrd-field__history-editor-row" }, index.h("input", { class: "mrd-field__history-editor-value", type: valueType, value: entry.value, onInput: (e) => updateEntry(i, 'value', e.target.value) }), index.h("span", { class: "mrd-field__history-editor-sep" }, cellRenderer.t('history_until', locale)), index.h("input", { class: "mrd-field__history-editor-until", type: "date", value: entry.until, onInput: (e) => updateEntry(i, 'until', e.target.value) }), index.h("button", { type: "button", class: "mrd-field__history-editor-remove", onClick: () => removeEntry(i), "aria-label": cellRenderer.t('remove', locale) }, index.h("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, index.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" })))))), index.h("button", { type: "button", class: "mrd-field__history-editor-add", onClick: addEntry }, "+ ", cellRenderer.t('add', locale))));
|
|
4311
4145
|
}
|
|
4312
4146
|
renderLeafField(displayValue) {
|
|
4313
|
-
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
|
|
4147
|
+
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;
|
|
4314
4148
|
const { item, locale } = this;
|
|
4315
4149
|
const commonProps = {
|
|
4316
4150
|
name: item.name,
|
|
@@ -4335,25 +4169,25 @@ const MrdField = class {
|
|
|
4335
4169
|
case clientLayout.ClientLayoutItemFieldDataType.BOOLEAN:
|
|
4336
4170
|
return (index.h("mrd-boolean-field", Object.assign({}, commonProps, { value: (_l = displayValue) !== null && _l !== void 0 ? _l : false })));
|
|
4337
4171
|
case clientLayout.ClientLayoutItemFieldDataType.DATE:
|
|
4338
|
-
return (index.h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : ''
|
|
4172
|
+
return (index.h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : '' })));
|
|
4339
4173
|
case clientLayout.ClientLayoutItemFieldDataType.DATETIME:
|
|
4340
|
-
return (index.h("mrd-datetime-field", Object.assign({}, commonProps, { value: (
|
|
4174
|
+
return (index.h("mrd-datetime-field", Object.assign({}, commonProps, { value: (_o = displayValue) !== null && _o !== void 0 ? _o : '' })));
|
|
4341
4175
|
case clientLayout.ClientLayoutItemFieldDataType.TIME:
|
|
4342
|
-
return (index.h("mrd-time-field", Object.assign({}, commonProps, { value: (
|
|
4176
|
+
return (index.h("mrd-time-field", Object.assign({}, commonProps, { value: (_p = displayValue) !== null && _p !== void 0 ? _p : '' })));
|
|
4343
4177
|
case clientLayout.ClientLayoutItemFieldDataType.EMAIL:
|
|
4344
|
-
return (index.h("mrd-email-field", Object.assign({}, commonProps, { value: (
|
|
4178
|
+
return (index.h("mrd-email-field", Object.assign({}, commonProps, { value: (_q = displayValue) !== null && _q !== void 0 ? _q : '', placeholder: (_r = item.placeholder) !== null && _r !== void 0 ? _r : '' })));
|
|
4345
4179
|
case clientLayout.ClientLayoutItemFieldDataType.HYPERLINK:
|
|
4346
|
-
return (index.h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (
|
|
4180
|
+
return (index.h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (_s = displayValue) !== null && _s !== void 0 ? _s : '', placeholder: (_t = item.placeholder) !== null && _t !== void 0 ? _t : '' })));
|
|
4347
4181
|
case clientLayout.ClientLayoutItemFieldDataType.LIST:
|
|
4348
|
-
return (index.h("mrd-list-field", Object.assign({}, commonProps, { value: (
|
|
4182
|
+
return (index.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 : [] })));
|
|
4349
4183
|
case clientLayout.ClientLayoutItemFieldDataType.FILE:
|
|
4350
|
-
return (index.h("mrd-file-field", Object.assign({}, commonProps, { value: displayValue, accept: (
|
|
4184
|
+
return (index.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 })));
|
|
4351
4185
|
case clientLayout.ClientLayoutItemFieldDataType.IMAGE:
|
|
4352
|
-
return (index.h("mrd-image-field", Object.assign({}, commonProps, { value: displayValue, accept: (
|
|
4186
|
+
return (index.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 })));
|
|
4353
4187
|
case clientLayout.ClientLayoutItemFieldDataType.LONGTEXT:
|
|
4354
|
-
return (index.h("mrd-longtext-field", Object.assign({}, commonProps, { value: (
|
|
4188
|
+
return (index.h("mrd-longtext-field", Object.assign({}, commonProps, { value: (_3 = displayValue) !== null && _3 !== void 0 ? _3 : '', placeholder: (_4 = item.placeholder) !== null && _4 !== void 0 ? _4 : '' })));
|
|
4355
4189
|
case clientLayout.ClientLayoutItemFieldDataType.SECRET:
|
|
4356
|
-
return (index.h("mrd-secret-field", Object.assign({}, commonProps, { value: (
|
|
4190
|
+
return (index.h("mrd-secret-field", Object.assign({}, commonProps, { value: (_5 = displayValue) !== null && _5 !== void 0 ? _5 : '', placeholder: (_6 = item.placeholder) !== null && _6 !== void 0 ? _6 : '' })));
|
|
4357
4191
|
default:
|
|
4358
4192
|
return null;
|
|
4359
4193
|
}
|
|
@@ -4549,7 +4383,7 @@ const MrdFileField = class {
|
|
|
4549
4383
|
error: hasError,
|
|
4550
4384
|
disabled: this.disabled || this.zoneBusy,
|
|
4551
4385
|
});
|
|
4552
|
-
return (index.h(index.Host, { key: '
|
|
4386
|
+
return (index.h(index.Host, { key: '2e740a0857b069740a6a13616d0a0dfee2b945be' }, index.h("div", { key: '069b25ced3b2f1ce547819086dadbd53ade2378c', class: "mrd-file-field" }, index.h(FieldLabel, { key: 'd13f3cb0af766d6328772dab865b2079c85ec075', base: "mrd-file-field", label: this.label, required: this.required }), index.h("div", { key: '9ffdbb508e3934854034c46e6f719a88d4175920', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.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 ? (index.h("div", { class: "mrd-file-field__selected" }, this.renderEntry(this.entries[0], 0))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '910a3e89f74d93ab16fb9f677a4276d5ad88897d', class: "mrd-file-field__list" }, this.entries.map((entry, index$1) => (index.h("li", { class: "mrd-file-field__item", key: `${index$1}-${entryLabel(entry)}` }, this.renderEntry(entry, index$1)))))), index.h(FieldError, { key: '4f0f071b0a1460ea1d6067a8fa4f588ebc620f2a', base: "mrd-file-field", error: this.error }))));
|
|
4553
4387
|
}
|
|
4554
4388
|
static get watchers() { return {
|
|
4555
4389
|
"value": [{
|
|
@@ -5177,7 +5011,7 @@ const MrdImageField = class {
|
|
|
5177
5011
|
error: hasError,
|
|
5178
5012
|
disabled: this.disabled || this.zoneBusy,
|
|
5179
5013
|
});
|
|
5180
|
-
return (index.h(index.Host, { key: '
|
|
5014
|
+
return (index.h(index.Host, { key: '51d39ea80195565a5dc780ff6a7923a976cfb0a7' }, index.h("div", { key: 'd76edb7ac9f1efea8c7c3d5b04e906ad4ab4c761', class: "mrd-image-field" }, index.h(FieldLabel, { key: 'b46a67a76188047677c40ce3f406daed7d8de141', base: "mrd-image-field", label: this.label, required: this.required }), index.h("div", { key: '0156a9722ea48d84e3ea1a829e4266425a594a6a', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.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])) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '9211b5212eae0629f7c9b2b49d80e2b658a9ddd3', class: "mrd-image-field__grid" }, this.entries.map((entry, index) => this.renderGridItem(entry, index)))), index.h(FieldError, { key: '5f49c03156ed18e7c8307adff679b149658ca4a6', base: "mrd-image-field", error: this.error }))));
|
|
5181
5015
|
}
|
|
5182
5016
|
static get watchers() { return {
|
|
5183
5017
|
"value": [{
|
|
@@ -5282,7 +5116,7 @@ const MrdInvoiceView = class {
|
|
|
5282
5116
|
const invoiceDateRaw = this.slotValue('invoiceDate');
|
|
5283
5117
|
const dueDateRaw = this.slotValue('dueDate');
|
|
5284
5118
|
const hasLines = !!((_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b['lines']);
|
|
5285
|
-
return (index.h(index.Host, { key: '
|
|
5119
|
+
return (index.h(index.Host, { key: 'a97c51e53e39ace913c902ad2ba6813eb85e4561' }, index.h("div", { key: '6938267848bceed5b28b56c3cdd6d6693e57cdbf', class: "mrd-invoice-view" }, index.h("div", { key: '7a0b3346232abfc1e35805e4e92c19d35698f881', class: "mrd-invoice-view__header" }, index.h("div", { key: '5c0471dd8ebd94dd9b374897268c7c03bec66ec7', class: "mrd-invoice-view__title-row" }, invoiceNumber && index.h("h1", { key: '86b4c0ebd0a5b83ae03b731b7e41394645aae954', class: "mrd-invoice-view__title" }, cellRenderer.t('invoice_title', this.locale), " ", invoiceNumber), this.renderStatus()), index.h("div", { key: 'd209bc34d989146b5f510f2bcdc4c484d723378c', class: "mrd-invoice-view__dates" }, invoiceDateRaw != null && invoiceDateRaw !== '' && (index.h("span", { key: '8fffcd1ab10e511c9d939c351ea93e4d8a902688' }, cellRenderer.t('invoice_date', this.locale), ": ", cellRenderer.formatDate(invoiceDateRaw, this.locale))), dueDateRaw != null && dueDateRaw !== '' && (index.h("span", { key: '8d13c6660798108cc2f54137c8415173326d5bf2' }, cellRenderer.t('invoice_due_date', this.locale), ": ", cellRenderer.formatDate(dueDateRaw, this.locale)))), this.renderContainer()), index.h("div", { key: 'cb08c6fd7e6b46a46a69f11aafa960ab5cb35544', class: "mrd-invoice-view__parties" }, this.renderPartyLink('customer', cellRenderer.t('invoice_customer', this.locale)), this.renderPartyLink('supplier', cellRenderer.t('invoice_supplier', this.locale))), hasLines && (index.h("div", { key: '8321e74171fe933a4e10fc202b66cd3720ba959e', class: "mrd-invoice-view__lines" }, index.h("slot", { key: 'eb31d97080173413e74e5b0024984a4b06aa5bdd', name: "lines" }))), this.renderAmounts(), this.renderAttachments())));
|
|
5286
5120
|
}
|
|
5287
5121
|
static get watchers() { return {
|
|
5288
5122
|
"data": [{
|
|
@@ -5810,7 +5644,7 @@ const MrdLayoutSection = class {
|
|
|
5810
5644
|
const docArchetype = clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_DOCUMENT);
|
|
5811
5645
|
const invoiceArchetype = !docArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_INVOICE) : undefined;
|
|
5812
5646
|
const emailArchetype = !docArchetype && !invoiceArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_EMAIL) : undefined;
|
|
5813
|
-
return (index.h(index.Host, { key: '
|
|
5647
|
+
return (index.h(index.Host, { key: 'ccae8e82b4dd549ab24239fe685a6830a508061d' }, index.h("div", { key: '4072cc4ecdd2b087c54a5515e653f7f713b2150f', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), !docArchetype && !invoiceArchetype && !emailArchetype && this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
5814
5648
|
}
|
|
5815
5649
|
get el() { return index.getElement(this); }
|
|
5816
5650
|
static get watchers() { return {
|
|
@@ -5929,7 +5763,7 @@ const MrdLongtextField = class {
|
|
|
5929
5763
|
};
|
|
5930
5764
|
}
|
|
5931
5765
|
render() {
|
|
5932
|
-
return (index.h(index.Host, { key: '
|
|
5766
|
+
return (index.h(index.Host, { key: 'e53fec4d4eafbd68d9cffb1f064d8e0c4c37839c' }, index.h("div", { key: '8843a23e42b0545c269fc6c924e7ae295770064e', class: "mrd-longtext-field" }, index.h(FieldLabel, { key: '8767676dd35f25f9bf5ebdb26887edc0882582e0', base: "mrd-longtext-field", label: this.label, required: this.required }), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.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)), index.h(FieldError, { key: '54dc790173575e8a02764e5b14040b900c2eb609', base: "mrd-longtext-field", error: this.error }))));
|
|
5933
5767
|
}
|
|
5934
5768
|
};
|
|
5935
5769
|
MrdLongtextField.style = mrdLongtextFieldCss();
|
|
@@ -6021,7 +5855,7 @@ const MrdNumberField = class {
|
|
|
6021
5855
|
const hasError = !!this.error;
|
|
6022
5856
|
const suffix = this.dataType === clientLayout.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
|
|
6023
5857
|
this.dataType === clientLayout.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
|
|
6024
|
-
return (index.h(index.Host, { key: '
|
|
5858
|
+
return (index.h(index.Host, { key: '7343dbca882b5054f22de17672ac748a8e3eca11' }, index.h("div", { key: 'cef10b39515b48fc9c44e651910c6a0c2a847628', class: "mrd-number-field" }, index.h(FieldLabel, { key: '66f178cf20f1f2f0587bd9614db150d6ae63023e', base: "mrd-number-field", label: this.label, required: this.required }), index.h("div", { key: 'c57c22e663a570f6e5a70b07b817970f135e850c', class: "mrd-number-field__input-wrapper" }, index.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 })), index.h(FieldError, { key: 'f99bb85668b047a97162ffee2582eb45dc0589ae', base: "mrd-number-field", error: this.error }))));
|
|
6025
5859
|
}
|
|
6026
5860
|
static get watchers() { return {
|
|
6027
5861
|
"value": [{
|
|
@@ -6317,9 +6151,9 @@ const MrdSecretField = class {
|
|
|
6317
6151
|
};
|
|
6318
6152
|
}
|
|
6319
6153
|
render() {
|
|
6320
|
-
return (index.h(index.Host, { key: '
|
|
6154
|
+
return (index.h(index.Host, { key: 'e06d04fdae34b42441976e21605fe94ad935382e' }, index.h("div", { key: '2889e1eb1b6d0887ae531523a0b9b43c49ef6f99', class: "mrd-secret-field" }, index.h(FieldLabel, { key: 'c40907905292cdef8bb0b8b9b0c03e05650bef37', base: "mrd-secret-field", label: this.label, required: this.required }), this.disabled
|
|
6321
6155
|
? (index.h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
|
|
6322
|
-
: (index.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 })), index.h(FieldError, { key: '
|
|
6156
|
+
: (index.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 })), index.h(FieldError, { key: '6353e4b40566852dbc1994c7c9c409d0d0aa1b37', base: "mrd-secret-field", error: this.error }))));
|
|
6323
6157
|
}
|
|
6324
6158
|
};
|
|
6325
6159
|
MrdSecretField.style = mrdSecretFieldCss();
|
|
@@ -7647,7 +7481,7 @@ const MrdTextField = class {
|
|
|
7647
7481
|
};
|
|
7648
7482
|
}
|
|
7649
7483
|
render() {
|
|
7650
|
-
return (index.h(index.Host, { key: '
|
|
7484
|
+
return (index.h(index.Host, { key: '3153f0c6f8ab4d9dae93306f7507399aeda75eaf' }, index.h("div", { key: '5d9c28023fdfb5472fc115c66bc3df509506e10f', class: "mrd-text-field" }, index.h(FieldLabel, { key: '1e21139aae0cc1ae95aa3297271b618a40043e77', base: "mrd-text-field", label: this.label, required: this.required }), index.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 }), index.h(FieldError, { key: '10b6ddae9cd9f36dc9d7176167d79df8e4102c03', base: "mrd-text-field", error: this.error }))));
|
|
7651
7485
|
}
|
|
7652
7486
|
};
|
|
7653
7487
|
MrdTextField.style = mrdTextFieldCss();
|
|
@@ -7719,7 +7553,7 @@ const MrdTextareaField = class {
|
|
|
7719
7553
|
return purify.sanitize(html);
|
|
7720
7554
|
}
|
|
7721
7555
|
render() {
|
|
7722
|
-
return (index.h(index.Host, { key: '
|
|
7556
|
+
return (index.h(index.Host, { key: 'e132531881f68f373e700617aac8033c8ebccb47' }, index.h("div", { key: 'fec0cf56cd7868d3fcd5a4e8a382b2dcdb6e5c50', class: "mrd-textarea-field" }, index.h(FieldLabel, { key: '333aa2ff57cce9e3178f0c4be4a1df1077884248', base: "mrd-textarea-field", label: this.label, required: this.required }), index.h("div", { key: '40025207580eb5768981b85aaa0a8ff95fce7234', class: controlClass('mrd-textarea-field', !!this.error, 'container') }, index.h("div", { key: '621987b3b2b1d8b4836bff065075ba527a82db81', class: "mrd-textarea-field__editor" })), index.h(FieldError, { key: 'ac2d8de22f008cd1c91842137ccd0cd36eb9ce19', base: "mrd-textarea-field", error: this.error }))));
|
|
7723
7557
|
}
|
|
7724
7558
|
get el() { return index.getElement(this); }
|
|
7725
7559
|
};
|
|
@@ -7750,7 +7584,7 @@ const MrdTimeField = class {
|
|
|
7750
7584
|
};
|
|
7751
7585
|
}
|
|
7752
7586
|
render() {
|
|
7753
|
-
return (index.h(index.Host, { key: '
|
|
7587
|
+
return (index.h(index.Host, { key: 'd521c654bc7beda71a31542a25198edaaf53b838' }, index.h("div", { key: '084ab16ac8aed952bd0ec50e0430591d4db5bd4b', class: "mrd-time-field" }, index.h(FieldLabel, { key: '43938ad7c5a9765353f6523d399d4b74cbb9ec6f', base: "mrd-time-field", label: this.label, required: this.required }), index.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 }), index.h(FieldError, { key: '34bc1eaa1b969951dffaaacad73af532b6d290fb', base: "mrd-time-field", error: this.error }))));
|
|
7754
7588
|
}
|
|
7755
7589
|
};
|
|
7756
7590
|
MrdTimeField.style = mrdTimeFieldCss();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DVbdkYO3.js');
|
|
4
4
|
var clientLayout = require('./client-layout-CqVuJumR.js');
|
|
5
|
-
var cellRenderer = require('./cell-renderer-
|
|
5
|
+
var cellRenderer = require('./cell-renderer-Coy-aD3k.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Whether a layout item can appear in the merge diff at all. m-n relations
|
|
@@ -257,14 +257,14 @@ const MrdMergeView = class {
|
|
|
257
257
|
var _a, _b;
|
|
258
258
|
let stepContent;
|
|
259
259
|
if (this.step === 'search') {
|
|
260
|
-
stepContent = (index.h(MergeSearchStep, { key: '
|
|
260
|
+
stepContent = (index.h(MergeSearchStep, { key: '3adb36fb46aa7260641a46a2cf27cc0ef320876f', locale: this.locale, searchQuery: this.searchQuery, searchResults: this.searchResults, isLoading: this.isLoading, onSearchInput: this.handleSearchInput, onSelect: this.handleSelect }));
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
263
|
const diff = diffFields(this.fields, this.currentRecord, this.candidate);
|
|
264
264
|
const bLabel = candidateLabel(this.candidate);
|
|
265
265
|
stepContent = this.step === 'compare' ? (index.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 })) : (index.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 }));
|
|
266
266
|
}
|
|
267
|
-
return (index.h(index.Host, { key: '
|
|
267
|
+
return (index.h(index.Host, { key: 'e33a6d66a220b28cc9533da78dc274e2d7ec5c4a' }, index.h("div", { key: 'b5fb1390d86192f9f6f15e3ccb89e2d21d9c7c8b', class: "mrd-merge-view" }, stepContent)));
|
|
268
268
|
}
|
|
269
269
|
get el() { return index.getElement(this); }
|
|
270
270
|
};
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
content: " *";
|
|
20
20
|
color: var(--mrd-color-danger);
|
|
21
21
|
}
|
|
22
|
-
.mrd-date-field__control {
|
|
23
|
-
position: relative;
|
|
24
|
-
display: block;
|
|
25
|
-
}
|
|
26
22
|
.mrd-date-field__input {
|
|
27
23
|
display: block;
|
|
28
24
|
width: 100%;
|
|
@@ -57,59 +53,12 @@
|
|
|
57
53
|
.mrd-date-field__input--error:focus {
|
|
58
54
|
box-shadow: var(--mrd-shadow-focus-error);
|
|
59
55
|
}
|
|
60
|
-
.mrd-date-field__input {
|
|
61
|
-
padding-inline-end: calc(var(--mrd-input-padding-x) + 1.75rem);
|
|
62
|
-
}
|
|
63
|
-
.mrd-date-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-date-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-date-field__picker-button svg {
|
|
86
|
-
width: 1.125rem;
|
|
87
|
-
height: 1.125rem;
|
|
88
|
-
}
|
|
89
|
-
.mrd-date-field__picker-button:hover:not(:disabled) {
|
|
90
|
-
color: var(--mrd-color-primary);
|
|
91
|
-
background-color: var(--mrd-color-neutral-100);
|
|
92
|
-
}
|
|
93
|
-
.mrd-date-field__picker-button:focus-visible {
|
|
94
|
-
outline: 2px solid var(--mrd-border-color-focus);
|
|
95
|
-
outline-offset: 1px;
|
|
96
|
-
}
|
|
97
|
-
.mrd-date-field__picker-button:disabled {
|
|
98
|
-
cursor: not-allowed;
|
|
99
|
-
opacity: 0.5;
|
|
100
|
-
}
|
|
101
|
-
.mrd-date-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-date-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-date-field__input {
|
|
63
|
+
cursor: pointer;
|
|
115
64
|
}
|