@mgdis/mg-components 6.14.0 → 6.15.0
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/{index-DzBkSgSK.js → index-BGxkpQwi.js} +7 -1
- package/dist/cjs/{index-DUJwxnoi.js → index-CpENFzEo.js} +2 -2
- package/dist/cjs/{index-CwjAofQ1.js → index-iUZvsp-F.js} +55 -31
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +431 -208
- package/dist/cjs/mg-alert.cjs.entry.js +4 -4
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +145 -81
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1248 -16004
- package/dist/cjs/{mg-input.conf-WTsvDfpC.js → mg-input.conf-CwjEAih3.js} +7 -0
- package/dist/cjs/mg-input.utils-D-ASK4ua.js +49 -0
- package/dist/cjs/mg-loader.cjs.entry.js +4 -4
- package/dist/cjs/mg-progress.cjs.entry.js +3 -3
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +93 -22
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +21 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +49 -106
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +123 -48
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +140 -56
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +63 -10
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -6
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +142 -9
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +2 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +23 -14
- package/dist/collection/locales/fr/messages.json +24 -15
- package/dist/components/index2.js +3 -3
- package/dist/components/index3.js +55 -31
- package/dist/components/mg-action-more.js +2 -2
- package/dist/components/mg-alert.js +2 -2
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -97
- package/dist/components/mg-details2.js +99 -0
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js +43 -124
- package/dist/components/mg-input-checkbox.js +136 -62
- package/dist/components/mg-input-combobox.js +135 -63
- package/dist/components/mg-input-date.js +9 -3
- package/dist/components/mg-input-numeric.js +14 -3
- package/dist/components/mg-input-password.js +10 -4
- package/dist/components/mg-input-radio.js +54 -13
- package/dist/components/mg-input-rich-text-editor.js +1266 -16016
- package/dist/components/mg-input-select2.js +45 -9
- package/dist/components/mg-input-text2.js +10 -4
- package/dist/components/mg-input-textarea.js +10 -4
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +97 -12
- package/dist/components/mg-input.utils.js +24 -0
- package/dist/components/mg-input2.js +100 -23
- package/dist/components/mg-item-more2.js +2 -2
- package/dist/components/mg-loader2.js +2 -2
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +3 -3
- package/dist/components/mg-modal.js +3 -3
- package/dist/components/mg-pagination.js +233 -1
- package/dist/components/mg-panel.js +14 -8
- package/dist/components/mg-popover-content2.js +2 -2
- package/dist/components/mg-popover2.js +2 -2
- package/dist/components/mg-progress.js +2 -2
- package/dist/components/mg-skip-links.js +2 -2
- package/dist/components/mg-table.js +3 -3
- package/dist/components/mg-tabs.js +1 -311
- package/dist/components/mg-tabs2.js +313 -0
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip2.js +2 -2
- package/dist/esm/{index-Bv7NHR-W.js → index-CKB-AnCZ.js} +55 -31
- package/dist/esm/{index-Degtjvph.js → index-DhAOnZJn.js} +7 -1
- package/dist/esm/{index-Dr7GYvIz.js → index-WtiuOkLj.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +426 -203
- package/dist/esm/mg-alert.entry.js +4 -4
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-input-combobox.entry.js +125 -61
- package/dist/esm/mg-input-rich-text-editor.entry.js +1249 -16005
- package/dist/esm/{mg-input.conf-CNgv8hc5.js → mg-input.conf-BAUTlb6r.js} +7 -1
- package/dist/esm/mg-input.utils-BYI03zSi.js +46 -0
- package/dist/esm/mg-loader.entry.js +4 -4
- package/dist/esm/mg-progress.entry.js +3 -3
- package/dist/mg-components/locales/en/messages.json +23 -14
- package/dist/mg-components/locales/fr/messages.json +24 -15
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-31856cff.entry.js +1 -0
- package/dist/mg-components/{p-056ba467.entry.js → p-420daa1e.entry.js} +1 -1
- package/dist/mg-components/{p-d13a6fdc.entry.js → p-47e19783.entry.js} +1 -1
- package/dist/mg-components/p-67af6274.entry.js +1 -0
- package/dist/mg-components/p-698dfc6c.entry.js +1 -0
- package/dist/mg-components/p-BAUTlb6r.js +1 -0
- package/dist/mg-components/p-CKB-AnCZ.js +1 -0
- package/dist/mg-components/p-DhAOnZJn.js +2 -0
- package/dist/mg-components/p-PuX-pdL4.js +1 -0
- package/dist/mg-components/p-WtiuOkLj.js +1 -0
- package/dist/mg-components/p-a0fa44cf.entry.js +1 -0
- package/dist/types/assets/icons/index.d.ts +6 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +13 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +15 -4
- package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +17 -40
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -9
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +17 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +40 -4
- package/dist/types/components.d.ts +69 -40
- package/ide/intellij/web-types.json +148 -22
- package/ide/vscode/html-custom-data.json +143 -9
- package/package.json +15 -15
- package/dist/cjs/events.utils-D5SAtkpQ.js +0 -25
- package/dist/components/mg-pagination2.js +0 -229
- package/dist/esm/events.utils-yMGqY8YG.js +0 -23
- package/dist/mg-components/p-625c463c.entry.js +0 -1
- package/dist/mg-components/p-Bv7NHR-W.js +0 -1
- package/dist/mg-components/p-CNgv8hc5.js +0 -1
- package/dist/mg-components/p-Degtjvph.js +0 -2
- package/dist/mg-components/p-Dr7GYvIz.js +0 -1
- package/dist/mg-components/p-c522f3c1.entry.js +0 -1
- package/dist/mg-components/p-cac23bd7.entry.js +0 -1
- package/dist/mg-components/p-e75f5383.entry.js +0 -10
- package/dist/mg-components/p-yMGqY8YG.js +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { allItemsAreString, ClassList, getObjectValueFromKey, isValidString, nextTick, Page, Paginate, Cursor, toString, isObject, formatID, } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
-
import { widths, classReadonly, classDisabled } from "../mg-input/mg-input.conf";
|
|
3
|
+
import { widths, classReadonly, classDisabled, CustomError } from "../mg-input/mg-input.conf";
|
|
4
4
|
import { initLocales } from "../../../../locales";
|
|
5
5
|
import { Keys } from "../../../../utils/events.utils";
|
|
6
|
+
import { defineErrorMessage } from "../mg-input/mg-input.utils";
|
|
6
7
|
/**
|
|
7
8
|
* Check if object is an item
|
|
8
9
|
* @param item - object to check
|
|
@@ -126,10 +127,12 @@ export class MgInputCombobox {
|
|
|
126
127
|
*/
|
|
127
128
|
this.handleFilterInput = () => {
|
|
128
129
|
this.checkValidity();
|
|
129
|
-
if (this.hasDisplayedError)
|
|
130
|
+
if (this.hasDisplayedError) {
|
|
130
131
|
this.setErrorMessage();
|
|
131
|
-
|
|
132
|
+
}
|
|
133
|
+
if (!this.popoverDisplay) {
|
|
132
134
|
this.popoverDisplay = true;
|
|
135
|
+
}
|
|
133
136
|
// update filter with debounce to prevent filter update overload
|
|
134
137
|
if (!this.debounce) {
|
|
135
138
|
this.debounce = true;
|
|
@@ -186,7 +189,7 @@ export class MgInputCombobox {
|
|
|
186
189
|
const option = this.option || this.options.items.find(this.isCurrentOption);
|
|
187
190
|
// Sets the value to the content of the focused option in the listbox.
|
|
188
191
|
if (this.popoverDisplay)
|
|
189
|
-
this.setValue(
|
|
192
|
+
this.setValue(option);
|
|
190
193
|
// Closes the popover.
|
|
191
194
|
this.popoverDisplay = false;
|
|
192
195
|
break;
|
|
@@ -307,28 +310,47 @@ export class MgInputCombobox {
|
|
|
307
310
|
else
|
|
308
311
|
return '';
|
|
309
312
|
};
|
|
313
|
+
/**
|
|
314
|
+
* Test if component has no value error message displayed
|
|
315
|
+
* @returns truthy if compent display no value error message
|
|
316
|
+
*/
|
|
317
|
+
this.hasNoValueError = () => this.customError === CustomError.NoValue;
|
|
310
318
|
/**
|
|
311
319
|
* Check if input is valid
|
|
312
320
|
*/
|
|
313
321
|
this.checkValidity = () => {
|
|
314
|
-
|
|
322
|
+
// force validity with readonly|disabled states
|
|
323
|
+
this.setValidity(this.readonly || this.disabled);
|
|
315
324
|
};
|
|
316
325
|
/**
|
|
317
326
|
* Set input error message
|
|
318
|
-
* @param errorMessage - errorMessage override
|
|
319
327
|
*/
|
|
320
|
-
this.setErrorMessage = (
|
|
328
|
+
this.setErrorMessage = () => {
|
|
321
329
|
// Set error message
|
|
322
330
|
this.errorMessage = undefined;
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
if (!this.valid) {
|
|
332
|
+
// Does have a custom error message
|
|
333
|
+
if (this.customError !== undefined && !Object.values(CustomError).includes(this.customError)) {
|
|
334
|
+
this.errorMessage = this.customError;
|
|
335
|
+
}
|
|
336
|
+
// no items
|
|
337
|
+
else if (this.hasNoValueError()) {
|
|
338
|
+
this.errorMessage = this.messages.errors.noValue;
|
|
339
|
+
}
|
|
340
|
+
// required
|
|
341
|
+
else if (this.input.validity.valueMissing) {
|
|
342
|
+
this.errorMessage = this.messages.errors.required;
|
|
343
|
+
}
|
|
330
344
|
}
|
|
331
345
|
};
|
|
346
|
+
/**
|
|
347
|
+
* Reset error message
|
|
348
|
+
*/
|
|
349
|
+
this.resetErrorMessage = () => {
|
|
350
|
+
this.checkValidity();
|
|
351
|
+
this.errorMessage = undefined;
|
|
352
|
+
this.hasDisplayedError = false;
|
|
353
|
+
};
|
|
332
354
|
/**
|
|
333
355
|
* Get filtered options from `filter` input value
|
|
334
356
|
* @returns filtered options
|
|
@@ -353,8 +375,8 @@ export class MgInputCombobox {
|
|
|
353
375
|
else if (this.loadingAction === 'load-more') {
|
|
354
376
|
index = this.page.items.length - this.page.baseIndex;
|
|
355
377
|
}
|
|
356
|
-
// when action require a
|
|
357
|
-
// Set "
|
|
378
|
+
// when action require a showMore we fetch the API else we report action to next tick
|
|
379
|
+
// Set "Show more" if action match OR if next item not available in the current page
|
|
358
380
|
if (action.name === 'load-more') {
|
|
359
381
|
// wait for new element render and update scroll position
|
|
360
382
|
// set component loading
|
|
@@ -400,15 +422,15 @@ export class MgInputCombobox {
|
|
|
400
422
|
* @returns promise
|
|
401
423
|
*/
|
|
402
424
|
this.goToNextPage = () => {
|
|
403
|
-
this.
|
|
404
|
-
if (
|
|
425
|
+
this.showMore.emit();
|
|
426
|
+
if (this.fetchurl !== undefined) {
|
|
405
427
|
return this.getOptions(typeof this.page.next === 'string' ? this.page.next : undefined).then(nextPage => {
|
|
406
|
-
if (
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
428
|
+
if (isObject(nextPage)) {
|
|
429
|
+
// merge items from current page and next page
|
|
430
|
+
const items = [...this.page.items, ...nextPage.items];
|
|
431
|
+
// create new options pagination withe merged items
|
|
432
|
+
this.options = new Paginate(items, { total: nextPage.total, next: nextPage.next, top: items.length });
|
|
433
|
+
}
|
|
412
434
|
});
|
|
413
435
|
}
|
|
414
436
|
else {
|
|
@@ -425,12 +447,20 @@ export class MgInputCombobox {
|
|
|
425
447
|
* @returns promise
|
|
426
448
|
*/
|
|
427
449
|
this.updatePage = async () => {
|
|
428
|
-
if (
|
|
450
|
+
if (this.fetchurl !== undefined) {
|
|
429
451
|
return this.getOptions().then(page => {
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
452
|
+
if (isObject(page)) {
|
|
453
|
+
// reset current options pagination from API response
|
|
454
|
+
this.options = new Paginate(page.items, { total: page.total, next: page.next, top: page.top });
|
|
455
|
+
// has items aren't updated with fetch mode we run the noValueError control here
|
|
456
|
+
if (this.filter.length === 0 && page.total === 0) {
|
|
457
|
+
this.displayError();
|
|
458
|
+
}
|
|
459
|
+
// force to reset error when noValueError is displaied
|
|
460
|
+
else if (this.invalid && this.hasNoValueError()) {
|
|
461
|
+
this.resetErrorMessage();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
434
464
|
});
|
|
435
465
|
}
|
|
436
466
|
else {
|
|
@@ -449,14 +479,16 @@ export class MgInputCombobox {
|
|
|
449
479
|
const response = await fetch(updateUrl, this.fetchoptions);
|
|
450
480
|
if (!response.ok) {
|
|
451
481
|
this.fetchError.emit(new Error(`${response.status} - ${response.statusText}`));
|
|
482
|
+
this.displayError();
|
|
452
483
|
return;
|
|
453
484
|
}
|
|
454
485
|
const json = await response.json();
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
486
|
+
const defaultItems = [];
|
|
487
|
+
const items = getObjectValueFromKey(json, this.fetchmappings.response.items, defaultItems).map((item) => ({
|
|
488
|
+
title: getObjectValueFromKey(item, this.fetchmappings.response.itemTitle, typeof item === 'string' ? item : JSON.stringify(item)),
|
|
489
|
+
value: getObjectValueFromKey(item, this.fetchmappings.response.itemValue, item),
|
|
458
490
|
}));
|
|
459
|
-
const total = Number(getObjectValueFromKey(json, this.fetchmappings.response.total,
|
|
491
|
+
const total = Number(getObjectValueFromKey(json, this.fetchmappings.response.total, defaultItems.length));
|
|
460
492
|
let next = getObjectValueFromKey(json, this.fetchmappings.response.next);
|
|
461
493
|
if (URL.canParse(updateUrl) && Boolean(next) && !URL.canParse(next)) {
|
|
462
494
|
const previousUrl = new URL(updateUrl);
|
|
@@ -468,6 +500,7 @@ export class MgInputCombobox {
|
|
|
468
500
|
}
|
|
469
501
|
catch (error) {
|
|
470
502
|
this.fetchError.emit(error);
|
|
503
|
+
this.displayError();
|
|
471
504
|
}
|
|
472
505
|
};
|
|
473
506
|
}
|
|
@@ -476,24 +509,35 @@ export class MgInputCombobox {
|
|
|
476
509
|
this.valueChange.emit(newValue);
|
|
477
510
|
}
|
|
478
511
|
watchItems(newValue) {
|
|
479
|
-
|
|
512
|
+
// fetch items
|
|
513
|
+
if (![undefined, null].includes(this.fetchurl) && [undefined, null].includes(newValue)) {
|
|
480
514
|
// skip newValue check
|
|
481
515
|
return;
|
|
482
516
|
}
|
|
483
|
-
|
|
517
|
+
// invalid items
|
|
518
|
+
else if (![undefined, null].includes(this.fetchurl) && Array.isArray(newValue)) {
|
|
484
519
|
throw new Error(`<mg-input-combobox> prop "items" values cannot be use with "fetchurl" prop defined. Passed value: ${toString(newValue)}.`);
|
|
485
520
|
}
|
|
486
|
-
// Empty
|
|
487
|
-
else if (Array.isArray(newValue) && newValue.length === 0) {
|
|
521
|
+
// Empty items
|
|
522
|
+
else if ([undefined, null].includes(newValue) || (Array.isArray(newValue) && newValue.length === 0)) {
|
|
488
523
|
this.options = new Paginate([]);
|
|
524
|
+
this.displayError();
|
|
489
525
|
}
|
|
490
526
|
// String array
|
|
491
527
|
else if (allItemsAreString(newValue)) {
|
|
492
528
|
this.options = new Paginate(newValue.map(item => ({ title: item, value: item })), { total: newValue.length });
|
|
529
|
+
// force to reset error when noValueError is displayed
|
|
530
|
+
if (this.invalid && this.hasNoValueError()) {
|
|
531
|
+
this.resetErrorMessage();
|
|
532
|
+
}
|
|
493
533
|
}
|
|
494
534
|
// Object array
|
|
495
535
|
else if (isItems(newValue)) {
|
|
496
536
|
this.options = new Paginate(newValue, { total: newValue.length });
|
|
537
|
+
// force to reset error when noValueError is displayed
|
|
538
|
+
if (this.invalid && this.hasNoValueError()) {
|
|
539
|
+
this.resetErrorMessage();
|
|
540
|
+
}
|
|
497
541
|
}
|
|
498
542
|
else {
|
|
499
543
|
throw new Error(`<mg-input-combobox> prop "items" values must be the same type, string or Option. Passed value: ${toString(newValue)}.`);
|
|
@@ -561,7 +605,7 @@ export class MgInputCombobox {
|
|
|
561
605
|
}
|
|
562
606
|
}
|
|
563
607
|
watchOptions(newValue) {
|
|
564
|
-
this.page = newValue.getPage(0,
|
|
608
|
+
this.page = newValue.getPage(0, this.filter.length > 0 ? this.optionsFilter : undefined);
|
|
565
609
|
}
|
|
566
610
|
watchFilter(newValue) {
|
|
567
611
|
this.loadingWrapper({ name: 'load-data' });
|
|
@@ -627,8 +671,8 @@ export class MgInputCombobox {
|
|
|
627
671
|
throw new Error('<mg-input-combobox> method "setError()" param "errorMessage" must be a string.');
|
|
628
672
|
}
|
|
629
673
|
else {
|
|
630
|
-
this.setValidity(valid);
|
|
631
|
-
this.setErrorMessage(
|
|
674
|
+
this.setValidity(valid, errorMessage);
|
|
675
|
+
this.setErrorMessage();
|
|
632
676
|
this.hasDisplayedError = this.invalid;
|
|
633
677
|
}
|
|
634
678
|
}
|
|
@@ -648,9 +692,7 @@ export class MgInputCombobox {
|
|
|
648
692
|
// - Keep everything in sync both inside and outside the component
|
|
649
693
|
return new Promise(resolve => {
|
|
650
694
|
requestAnimationFrame(() => {
|
|
651
|
-
this.
|
|
652
|
-
this.errorMessage = undefined;
|
|
653
|
-
this.hasDisplayedError = false;
|
|
695
|
+
this.resetErrorMessage();
|
|
654
696
|
resolve();
|
|
655
697
|
});
|
|
656
698
|
});
|
|
@@ -673,15 +715,34 @@ export class MgInputCombobox {
|
|
|
673
715
|
}
|
|
674
716
|
/**
|
|
675
717
|
* Method to set validity values
|
|
676
|
-
* @param
|
|
718
|
+
* @param newValidValue - new valid value. `true` will bypass input check.
|
|
719
|
+
* @param customErrorMessage - custom error message
|
|
677
720
|
*/
|
|
678
|
-
setValidity(
|
|
721
|
+
setValidity(newValidValue, customErrorMessage) {
|
|
722
|
+
var _a;
|
|
679
723
|
const oldValidValue = this.valid;
|
|
680
|
-
|
|
724
|
+
let valid = newValidValue;
|
|
725
|
+
// Set custom validity
|
|
726
|
+
if (!valid && this.input !== undefined) {
|
|
727
|
+
// custom errror, start by reset it
|
|
728
|
+
this.customError = undefined;
|
|
729
|
+
if (isValidString(customErrorMessage)) {
|
|
730
|
+
this.customError = customErrorMessage;
|
|
731
|
+
}
|
|
732
|
+
// no value
|
|
733
|
+
else if ((this.fetchurl === undefined ? ((_a = this.items) !== null && _a !== void 0 ? _a : []).length : this.page.total) === 0) {
|
|
734
|
+
this.customError = CustomError.NoValue;
|
|
735
|
+
}
|
|
736
|
+
// get new input validity from validity state
|
|
737
|
+
valid = this.input.checkValidity() && this.customError === undefined;
|
|
738
|
+
}
|
|
739
|
+
// set valid/invalid props
|
|
740
|
+
this.valid = valid;
|
|
681
741
|
this.invalid = !this.valid;
|
|
682
742
|
// We need to send valid event even if it is the same value
|
|
683
|
-
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
|
|
743
|
+
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) {
|
|
684
744
|
this.inputValid.emit(this.valid);
|
|
745
|
+
}
|
|
685
746
|
}
|
|
686
747
|
/*************
|
|
687
748
|
* Lifecycle *
|
|
@@ -722,15 +783,19 @@ export class MgInputCombobox {
|
|
|
722
783
|
const listId = `${this.identifier}-list`;
|
|
723
784
|
const readonlyValue = this.getValueTitle();
|
|
724
785
|
const withResetButton = this.value && !this.disabled;
|
|
786
|
+
const disabled = this.disabled || this.hasNoValueError();
|
|
725
787
|
let popoverContent;
|
|
726
|
-
if (((_a = this.page) === null || _a === void 0 ? void 0 : _a.items.length) > 0)
|
|
788
|
+
if (((_a = this.page) === null || _a === void 0 ? void 0 : _a.items.length) > 0) {
|
|
727
789
|
popoverContent = 'list';
|
|
728
|
-
|
|
790
|
+
}
|
|
791
|
+
else if (((_b = this.page) === null || _b === void 0 ? void 0 : _b.items.length) === 0 && this.filter.length > 0) {
|
|
729
792
|
popoverContent = 'notfound';
|
|
730
|
-
|
|
793
|
+
}
|
|
794
|
+
else if (((_c = this.page) === null || _c === void 0 ? void 0 : _c.items.length) === 0) {
|
|
731
795
|
popoverContent = 'notavailable';
|
|
796
|
+
}
|
|
732
797
|
let activeDescendant;
|
|
733
|
-
if (
|
|
798
|
+
if (![null, undefined].includes((_d = this.option) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
734
799
|
activeDescendant = this.option.value;
|
|
735
800
|
}
|
|
736
801
|
else if (typeof this.value === 'string') {
|
|
@@ -739,12 +804,12 @@ export class MgInputCombobox {
|
|
|
739
804
|
else {
|
|
740
805
|
activeDescendant = (_e = this.value) === null || _e === void 0 ? void 0 : _e.value;
|
|
741
806
|
}
|
|
742
|
-
return (h("mg-input", { key: '
|
|
807
|
+
return (h("mg-input", { key: 'fa0977713a1150c39b4f989bbb139e0e345b4c5f', label: this.label, identifier: this.identifier, class: this.classCollection.classes.join(' '), ariaDescribedbyIDs: popoverContent && popoverContent !== 'list' ? popoverContent : undefined, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: defineErrorMessage(this.errorMessage, this.noValueErrorDetail) }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("mg-popover", { identifier: this.popoverId, placement: "bottom-start", display: this.popoverDisplay, "arrow-hide": true, style: {
|
|
743
808
|
'--mg-c-input-list-width': Boolean((_f = this.input) === null || _f === void 0 ? void 0 : _f.offsetWidth) ? `${this.input.offsetWidth}px` : undefined,
|
|
744
|
-
}, "data-fallback-placement": "bottom-end", "onDisplay-change": this.handlePopoverDisplay }, h("div", { class: "mg-c-input__input-group-container" }, h("mg-icon", { icon: "magnifying-glass" }), h("input", { type: "text", role: "combobox", class: "mg-c-input__box mg-c-input__box--width", value: this.filter, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled:
|
|
809
|
+
}, "data-fallback-placement": "bottom-end", "onDisplay-change": this.handlePopoverDisplay }, h("div", { class: "mg-c-input__input-group-container" }, h("mg-icon", { icon: "magnifying-glass" }), h("input", { type: "text", role: "combobox", class: "mg-c-input__box mg-c-input__box--width", value: this.filter, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: disabled, required: this.required, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.popoverDisplay.toString(), "aria-controls": listId, "aria-invalid": (this.invalid === true).toString(), "aria-activedescendant": formatID(activeDescendant), onInput: this.handleFilterInput, onBlur: this.handleFilterBlur, onFocus: this.handleFilterFocus, onKeyDown: this.handleFilterKeydown, ref: (el) => {
|
|
745
810
|
if (el !== null)
|
|
746
811
|
this.input = el;
|
|
747
|
-
} }), withResetButton ? (h("mg-button", { class: "mg-c-input__box-append mg-c-input__reset", variant: "flat", "is-icon": true, label: this.messages.general.reset, "aria-controls": this.identifier, tabindex: "-1", onClick: this.handleResetButton }, h("mg-icon", { icon: "cross" }))) : (h("mg-button", { class: "mg-c-input__box-append", variant: "flat", "is-icon": true, label: this.itemsLabel, tabindex: "-1", disabled:
|
|
812
|
+
} }), withResetButton ? (h("mg-button", { class: "mg-c-input__box-append mg-c-input__reset", variant: "flat", "is-icon": true, label: this.messages.general.reset, "aria-controls": this.identifier, tabindex: "-1", onClick: this.handleResetButton, disabled: disabled }, h("mg-icon", { icon: "cross" }))) : (h("mg-button", { class: "mg-c-input__box-append", variant: "flat", "is-icon": true, label: this.itemsLabel, tabindex: "-1", disabled: disabled }, h("mg-icon", { icon: `chevron-${this.popoverDisplay ? 'up' : 'down'}` })))), h("div", { slot: "content", class: "mg-c-input__popover-container" }, popoverContent === 'list' && [
|
|
748
813
|
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
|
|
749
814
|
h("ul", { key: "list", class: "mg-c-input__input-list", role: "listbox", id: listId, "aria-label": this.itemsLabel, "aria-setsize": this.page.total }, this.page.items.map(option => {
|
|
750
815
|
var _a;
|
|
@@ -760,7 +825,7 @@ export class MgInputCombobox {
|
|
|
760
825
|
this.page.next && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, disabled: this.isLoading, "full-width": true, "disable-on-click": true, onClick: this.handleLoadMoreButton, "aria-controls": listId, ref: (el) => {
|
|
761
826
|
if (el !== null)
|
|
762
827
|
this.loadMoreElement = el;
|
|
763
|
-
} }, h("mg-icon", { icon: "chevron-down" }), this.messages.input.
|
|
828
|
+
} }, h("mg-icon", { icon: "chevron-down" }), this.messages.input.showMore)),
|
|
764
829
|
], popoverContent === 'notfound' && (h("p", { id: popoverContent, class: "mg-c-input__popover-info" }, this.messages.input.combobox.notFound)), popoverContent === 'notavailable' && (h("p", { id: popoverContent, class: "mg-c-input__popover-info" }, this.messages.input.combobox.notAvailable)))))));
|
|
765
830
|
}
|
|
766
831
|
static get is() { return "mg-input-combobox"; }
|
|
@@ -1203,6 +1268,25 @@ export class MgInputCombobox {
|
|
|
1203
1268
|
"getter": false,
|
|
1204
1269
|
"setter": false
|
|
1205
1270
|
},
|
|
1271
|
+
"noValueErrorDetail": {
|
|
1272
|
+
"type": "string",
|
|
1273
|
+
"attribute": "no-value-error-detail",
|
|
1274
|
+
"mutable": false,
|
|
1275
|
+
"complexType": {
|
|
1276
|
+
"original": "string",
|
|
1277
|
+
"resolved": "string",
|
|
1278
|
+
"references": {}
|
|
1279
|
+
},
|
|
1280
|
+
"required": false,
|
|
1281
|
+
"optional": true,
|
|
1282
|
+
"docs": {
|
|
1283
|
+
"tags": [],
|
|
1284
|
+
"text": "Define no value error detail"
|
|
1285
|
+
},
|
|
1286
|
+
"getter": false,
|
|
1287
|
+
"setter": false,
|
|
1288
|
+
"reflect": false
|
|
1289
|
+
},
|
|
1206
1290
|
"valid": {
|
|
1207
1291
|
"type": "boolean",
|
|
1208
1292
|
"attribute": "valid",
|
|
@@ -1291,7 +1375,7 @@ export class MgInputCombobox {
|
|
|
1291
1375
|
"references": {}
|
|
1292
1376
|
}
|
|
1293
1377
|
}, {
|
|
1294
|
-
"method": "
|
|
1378
|
+
"method": "showMore",
|
|
1295
1379
|
"name": "load-more",
|
|
1296
1380
|
"bubbles": true,
|
|
1297
1381
|
"cancelable": true,
|
|
@@ -362,7 +362,7 @@ export class MgInputDate {
|
|
|
362
362
|
* @returns HTML Element
|
|
363
363
|
*/
|
|
364
364
|
render() {
|
|
365
|
-
return (h("mg-input", { key: '
|
|
365
|
+
return (h("mg-input", { key: '71daaa8818ab7120c61a45399ae016a4621c8f50', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === null ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, localeDate(this.value, this.locale))) : (h("input", { type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, ref: (el) => {
|
|
366
366
|
if (el !== null)
|
|
367
367
|
this.input = el;
|
|
368
368
|
} }))));
|
|
@@ -241,6 +241,11 @@ export class MgInputNumeric {
|
|
|
241
241
|
var _a;
|
|
242
242
|
// has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type
|
|
243
243
|
if (typeof newValue === 'string') {
|
|
244
|
+
// Check if integer value starts with '0' (leading zero)
|
|
245
|
+
if (newValue.startsWith('0') && parseInt(newValue, 10) > 0) {
|
|
246
|
+
// Remove leading zero
|
|
247
|
+
newValue = newValue.substring(1);
|
|
248
|
+
}
|
|
244
249
|
// Split number and decimal
|
|
245
250
|
const [integer, decimal = ''] = newValue.replace('-', '').split(/[.,]/);
|
|
246
251
|
// Regex
|
|
@@ -457,7 +462,7 @@ export class MgInputNumeric {
|
|
|
457
462
|
* @returns HTML Element
|
|
458
463
|
*/
|
|
459
464
|
render() {
|
|
460
|
-
return (h("mg-input", { key: '
|
|
465
|
+
return (h("mg-input", { key: 'ca551b49b1b4dc98fd4e943e51de8a32bc78882b', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
|
|
461
466
|
? this.readonlyValue && this.renderReadonly()
|
|
462
467
|
: [
|
|
463
468
|
h("input", { key: "input", type: "text", class: "mg-c-input__box mg-c-input__box--width", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
|
|
@@ -237,7 +237,7 @@ export class MgInputPassword {
|
|
|
237
237
|
* @returns HTML Element
|
|
238
238
|
*/
|
|
239
239
|
render() {
|
|
240
|
-
return (h("mg-input", { key: '
|
|
240
|
+
return (h("mg-input", { key: '4bdaa6d26811f66fa43b580ac6e85c61b308ee92', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value !== undefined && h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (h("span", { class: "mg-c-input__input-group" }, h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
241
241
|
if (el !== null)
|
|
242
242
|
this.input = el;
|
|
243
243
|
} }), h("mg-button", { label: this.messages.input.password[this.displayPassword ? 'hide' : 'display'], disabled: this.disabled, variant: "flat", class: "mg-c-input__append-button", "is-icon": true, onClick: this.toggleDisplayPassword, "aria-controls": this.identifier }, h("mg-icon", { class: "mg-c-input__input-icon", icon: this.displayPassword ? 'eye-slash' : 'eye' }))))));
|
|
@@ -2,6 +2,7 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { classReadonly, classDisabled, classFieldset } from "../mg-input/mg-input.conf";
|
|
4
4
|
import { initLocales } from "../../../../locales";
|
|
5
|
+
import { defineErrorMessage } from "../mg-input/mg-input.utils";
|
|
5
6
|
/**
|
|
6
7
|
* type Option validation function
|
|
7
8
|
* @param option - radio option
|
|
@@ -74,11 +75,21 @@ export class MgInputRadio {
|
|
|
74
75
|
// reset guard
|
|
75
76
|
this.handlerInProgress = undefined;
|
|
76
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Test if component has items
|
|
80
|
+
* @returns truthy if component has items
|
|
81
|
+
*/
|
|
82
|
+
this.hasInputValue = () => { var _a; return ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0; };
|
|
83
|
+
/**
|
|
84
|
+
* Test if component has no value error message displayed
|
|
85
|
+
* @returns truthy if compent display no value error message
|
|
86
|
+
*/
|
|
87
|
+
this.hasNoValueErrorMessageDisplay = () => this.errorMessage === this.messages.errors.noValue;
|
|
77
88
|
/**
|
|
78
89
|
* Check if input is valid
|
|
79
90
|
*/
|
|
80
91
|
this.checkValidity = () => {
|
|
81
|
-
this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
|
|
92
|
+
this.setValidity(this.readonly || this.disabled || (this.hasInputValue() && this.getInvalidElement() === undefined));
|
|
82
93
|
};
|
|
83
94
|
/**
|
|
84
95
|
* Set input error message
|
|
@@ -92,11 +103,22 @@ export class MgInputRadio {
|
|
|
92
103
|
if (errorMessage !== undefined) {
|
|
93
104
|
this.errorMessage = errorMessage;
|
|
94
105
|
}
|
|
106
|
+
else if (!this.hasInputValue()) {
|
|
107
|
+
this.errorMessage = this.messages.errors.noValue;
|
|
108
|
+
}
|
|
95
109
|
else if (invalidElement.validity.valueMissing) {
|
|
96
110
|
this.errorMessage = this.messages.errors.required;
|
|
97
111
|
}
|
|
98
112
|
}
|
|
99
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Reset error message
|
|
116
|
+
*/
|
|
117
|
+
this.resetErrorMessage = () => {
|
|
118
|
+
this.checkValidity();
|
|
119
|
+
this.errorMessage = undefined;
|
|
120
|
+
this.hasDisplayedError = false;
|
|
121
|
+
};
|
|
100
122
|
/**
|
|
101
123
|
* get invalid element
|
|
102
124
|
* @returns element
|
|
@@ -118,17 +140,29 @@ export class MgInputRadio {
|
|
|
118
140
|
this.valueChange.emit(newValue);
|
|
119
141
|
}
|
|
120
142
|
validateItems(newValue) {
|
|
143
|
+
if ([undefined, null].includes(newValue) || (Array.isArray(newValue) && newValue.length === 0)) {
|
|
144
|
+
this.options = [];
|
|
145
|
+
this.displayError();
|
|
146
|
+
}
|
|
121
147
|
// Validate if items have required min length
|
|
122
|
-
if (
|
|
148
|
+
else if (Array.isArray(newValue) && newValue.length < 2) {
|
|
123
149
|
throw new Error(`<mg-input-radio> prop "items" require at least 2 items. Passed value: ${toString(newValue)}.`);
|
|
124
150
|
}
|
|
125
151
|
// String array
|
|
126
152
|
else if (allItemsAreString(newValue)) {
|
|
127
153
|
this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
|
|
154
|
+
// force to reset error when noValueError is displaied
|
|
155
|
+
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
156
|
+
this.resetErrorMessage();
|
|
157
|
+
}
|
|
128
158
|
}
|
|
129
159
|
// Object array
|
|
130
|
-
else if (newValue && newValue.every(
|
|
160
|
+
else if (Array.isArray(newValue) && newValue.every(isOption)) {
|
|
131
161
|
this.options = newValue;
|
|
162
|
+
// force to reset error when noValueError is displaied
|
|
163
|
+
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
164
|
+
this.resetErrorMessage();
|
|
165
|
+
}
|
|
132
166
|
}
|
|
133
167
|
else {
|
|
134
168
|
throw new Error(`<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption. Passed value: ${toString(newValue)}.`);
|
|
@@ -224,9 +258,7 @@ export class MgInputRadio {
|
|
|
224
258
|
// - Keep everything in sync both inside and outside the component
|
|
225
259
|
return new Promise(resolve => {
|
|
226
260
|
requestAnimationFrame(() => {
|
|
227
|
-
this.
|
|
228
|
-
this.errorMessage = undefined;
|
|
229
|
-
this.hasDisplayedError = false;
|
|
261
|
+
this.resetErrorMessage();
|
|
230
262
|
resolve();
|
|
231
263
|
});
|
|
232
264
|
});
|
|
@@ -272,10 +304,12 @@ export class MgInputRadio {
|
|
|
272
304
|
* @returns HTML Element
|
|
273
305
|
*/
|
|
274
306
|
render() {
|
|
275
|
-
return (h("mg-input", { key: '
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
307
|
+
return (h("mg-input", { key: 'ecb4efa3a4ccfae5ff56c4a304158c7a03c73153', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: defineErrorMessage(this.errorMessage, this.noValueErrorDetail) }, this.readonly
|
|
308
|
+
? this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)
|
|
309
|
+
: this.options.length > 0 && (h("ul", { class: "mg-c-input__input-group-container", role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
|
|
310
|
+
if (el !== null)
|
|
311
|
+
this.inputs[index] = el;
|
|
312
|
+
} }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
|
|
279
313
|
}
|
|
280
314
|
static get is() { return "mg-input-radio"; }
|
|
281
315
|
static get encapsulation() { return "shadow"; }
|
|
@@ -576,6 +610,25 @@ export class MgInputRadio {
|
|
|
576
610
|
"setter": false,
|
|
577
611
|
"reflect": false
|
|
578
612
|
},
|
|
613
|
+
"noValueErrorDetail": {
|
|
614
|
+
"type": "string",
|
|
615
|
+
"attribute": "no-value-error-detail",
|
|
616
|
+
"mutable": false,
|
|
617
|
+
"complexType": {
|
|
618
|
+
"original": "string",
|
|
619
|
+
"resolved": "string",
|
|
620
|
+
"references": {}
|
|
621
|
+
},
|
|
622
|
+
"required": false,
|
|
623
|
+
"optional": true,
|
|
624
|
+
"docs": {
|
|
625
|
+
"tags": [],
|
|
626
|
+
"text": "Define no value error detail"
|
|
627
|
+
},
|
|
628
|
+
"getter": false,
|
|
629
|
+
"setter": false,
|
|
630
|
+
"reflect": false
|
|
631
|
+
},
|
|
579
632
|
"valid": {
|
|
580
633
|
"type": "boolean",
|
|
581
634
|
"attribute": "valid",
|
|
@@ -308,7 +308,7 @@ export class MgInputRichTextEditor {
|
|
|
308
308
|
* @returns HTML mg-input Element
|
|
309
309
|
*/
|
|
310
310
|
render() {
|
|
311
|
-
return (h("mg-input", { key: '
|
|
311
|
+
return (h("mg-input", { key: 'b7f7fe282aa00b695418fe7f055955045bbd932d', identifier: this.identifier, class: this.classCollection.join(), label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.hasDisplayedError ? this.errorMessage : undefined }, this.readonly ? (h("div", { class: "mg-c-input__readonly-value", innerHTML: this.value })) : (h("div", { ref: el => {
|
|
312
312
|
this.wrapperElement = el;
|
|
313
313
|
}, id: this.identifier, class: "mg-c-input__wrapper" }, h("div", null)))));
|
|
314
314
|
}
|