@mgdis/mg-components 6.18.0 → 6.20.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-DCZEYvlH.js → index-Bp6wZzau.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +90 -120
- package/dist/cjs/mg-alert.cjs.entry.js +1 -1
- package/dist/cjs/mg-components.cjs.js +2 -2
- package/dist/cjs/mg-fieldset.cjs.entry.js +2 -2
- package/dist/cjs/mg-input-combobox.cjs.entry.js +39 -38
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +4 -8
- package/dist/cjs/{mg-input.conf-HYIzRsy7.js → mg-input.conf-D7jmj_lh.js} +2 -0
- package/dist/cjs/mg-loader.cjs.entry.js +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +36 -35
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +2 -6
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +17 -16
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +5 -21
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +72 -84
- 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 +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +38 -37
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +2 -6
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +16 -16
- package/dist/components/mg-input-textarea.js +6 -22
- package/dist/components/mg-input-toggle.js +60 -75
- package/dist/components/mg-input2.js +3 -2
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/esm/{index-T6kOJXP1.js → index-BluNKQ3L.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +90 -120
- package/dist/esm/mg-alert.entry.js +1 -1
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-fieldset.entry.js +2 -2
- package/dist/esm/mg-input-combobox.entry.js +40 -39
- package/dist/esm/mg-input-rich-text-editor.entry.js +4 -8
- package/dist/esm/{mg-input.conf-D9V2v4n2.js → mg-input.conf-DDnrE1hD.js} +2 -1
- package/dist/esm/mg-loader.entry.js +1 -1
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-f2cddd52.entry.js → p-016bd291.entry.js} +1 -1
- package/dist/mg-components/{p-f6afaeb8.entry.js → p-186a6139.entry.js} +1 -1
- package/dist/mg-components/p-7132bca1.entry.js +1 -0
- package/dist/mg-components/{p-952288bd.entry.js → p-916dfb6d.entry.js} +1 -1
- package/dist/mg-components/p-BluNKQ3L.js +2 -0
- package/dist/mg-components/p-DDnrE1hD.js +1 -0
- package/dist/mg-components/p-cd061b38.entry.js +1 -0
- package/dist/mg-components/{p-5abc77cd.entry.js → p-d2c72f09.entry.js} +1 -1
- package/dist/mg-components/{p-92e5e5a6.entry.js → p-d5a276eb.entry.js} +1 -1
- package/dist/types/assets/icons/index.d.ts +9 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +4 -5
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -5
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -6
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +13 -16
- package/dist/types/components.d.ts +6 -8
- package/ide/intellij/web-types.json +35 -28
- package/ide/vscode/css-custom-data.json +19 -3
- package/ide/vscode/custom.css-data.json +425 -0
- package/ide/vscode/html-custom-data.json +60 -6
- package/package.json +21 -21
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
- package/dist/mg-components/p-2bab89c2.entry.js +0 -1
- package/dist/mg-components/p-7d2e43b2.entry.js +0 -1
- package/dist/mg-components/p-D9V2v4n2.js +0 -1
- package/dist/mg-components/p-T6kOJXP1.js +0 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +0 -8
|
@@ -144,7 +144,7 @@ export class MgIcon {
|
|
|
144
144
|
"mutable": false,
|
|
145
145
|
"complexType": {
|
|
146
146
|
"original": "IconType",
|
|
147
|
-
"resolved": "\"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-download\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
|
|
147
|
+
"resolved": "\"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
|
|
148
148
|
"references": {
|
|
149
149
|
"IconType": {
|
|
150
150
|
"location": "import",
|
|
@@ -14,3 +14,4 @@ export const classFieldset = 'mg-c-input--fieldset';
|
|
|
14
14
|
export const classDisabled = 'mg-c-input--disabled';
|
|
15
15
|
export const classReadonly = 'mg-c-input--readonly';
|
|
16
16
|
export const classVerticalList = 'mg-c-input--vertical-list';
|
|
17
|
+
export const classDisplayCharacterLeft = 'mg-c-input--display-character-left';
|
|
@@ -26,7 +26,7 @@ const isFetchmappings = (value) => {
|
|
|
26
26
|
const { request, response } = value;
|
|
27
27
|
if ([request, response].some(property => !isObject(property)))
|
|
28
28
|
return false;
|
|
29
|
-
const isValidRequest = typeof request.filter === 'string';
|
|
29
|
+
const isValidRequest = typeof request.filter === 'string' && (request.filterTransform === undefined || typeof request.filterTransform === 'function');
|
|
30
30
|
const isValidResponse = typeof response === 'object' &&
|
|
31
31
|
typeof response.total === 'string' &&
|
|
32
32
|
typeof response.items === 'string' &&
|
|
@@ -41,11 +41,6 @@ const isFetchmappings = (value) => {
|
|
|
41
41
|
};
|
|
42
42
|
export class MgInputCombobox {
|
|
43
43
|
constructor() {
|
|
44
|
-
/************
|
|
45
|
-
* Internal *
|
|
46
|
-
************/
|
|
47
|
-
// Classes
|
|
48
|
-
this.classFocus = 'mg-u-is-focused';
|
|
49
44
|
// hasDisplayedError (triggered by blur event)
|
|
50
45
|
this.hasDisplayedError = false;
|
|
51
46
|
this.customErrorMessage = { lock: false };
|
|
@@ -103,7 +98,7 @@ export class MgInputCombobox {
|
|
|
103
98
|
* @param event - option element click event
|
|
104
99
|
*/
|
|
105
100
|
this.handleOptionClick = (event) => {
|
|
106
|
-
this.setValue(this.options.items.find(option =>
|
|
101
|
+
this.setValue(this.options.items.find(option => toString(option.value) === event.target.dataset.value));
|
|
107
102
|
this.popoverDisplay = false;
|
|
108
103
|
};
|
|
109
104
|
/**
|
|
@@ -143,16 +138,20 @@ export class MgInputCombobox {
|
|
|
143
138
|
/**
|
|
144
139
|
* Handle `blur` event
|
|
145
140
|
*/
|
|
146
|
-
this.handleFilterBlur = () => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//
|
|
154
|
-
this.handlerInProgress =
|
|
155
|
-
|
|
141
|
+
this.handleFilterBlur = (event) => {
|
|
142
|
+
if (this.popoverDisplay) {
|
|
143
|
+
// prevent blur event to bubble up and reset input focus process when popover is open
|
|
144
|
+
event.stopImmediatePropagation();
|
|
145
|
+
this.input.focus();
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// Display Error
|
|
149
|
+
this.handlerInProgress = 'blur';
|
|
150
|
+
this.displayError().finally(() => {
|
|
151
|
+
// reset guard
|
|
152
|
+
this.handlerInProgress = undefined;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
156
155
|
};
|
|
157
156
|
/**
|
|
158
157
|
* Handle `focus` event
|
|
@@ -340,10 +339,10 @@ export class MgInputCombobox {
|
|
|
340
339
|
}
|
|
341
340
|
};
|
|
342
341
|
/**
|
|
343
|
-
* Get
|
|
344
|
-
* @returns
|
|
342
|
+
* Get first page with filter applied
|
|
343
|
+
* @returns first page with filter applied
|
|
345
344
|
*/
|
|
346
|
-
this.
|
|
345
|
+
this.getFirstPage = () => this.options.getPage(0, option => this.filter === '' || option.title.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()));
|
|
347
346
|
/**
|
|
348
347
|
* Loading wrapper with a given action
|
|
349
348
|
* @param action - wrapped loading action
|
|
@@ -387,7 +386,7 @@ export class MgInputCombobox {
|
|
|
387
386
|
return promise()
|
|
388
387
|
.then(() => {
|
|
389
388
|
// parse full items list from options
|
|
390
|
-
const options = this.options.items.filter(this.
|
|
389
|
+
const options = this.filter === '' ? this.options.items : this.options.items.filter(option => option.title.includes(this.filter));
|
|
391
390
|
// update visual focus
|
|
392
391
|
if (action.name !== 'load-data') {
|
|
393
392
|
index = this.page.getIndexFromCursor(action.cursor, this.loadingAction === 'load-more' && index >= 0 ? options[index] : this.option);
|
|
@@ -443,7 +442,7 @@ export class MgInputCombobox {
|
|
|
443
442
|
});
|
|
444
443
|
}
|
|
445
444
|
else {
|
|
446
|
-
this.page = this.
|
|
445
|
+
this.page = this.getFirstPage();
|
|
447
446
|
}
|
|
448
447
|
};
|
|
449
448
|
/**
|
|
@@ -452,8 +451,9 @@ export class MgInputCombobox {
|
|
|
452
451
|
* @returns new page from url
|
|
453
452
|
*/
|
|
454
453
|
this.getOptions = async (url = this.fetchurl) => {
|
|
455
|
-
// add text filter
|
|
456
|
-
const
|
|
454
|
+
// add text filter to url
|
|
455
|
+
const filter = typeof this.fetchmappings.request.filterTransform === 'function' ? this.fetchmappings.request.filterTransform(this.filter) : this.filter;
|
|
456
|
+
const updateUrl = (typeof url === 'string' ? url : url.toString()).replaceAll(this.fetchmappings.request.filter, encodeURIComponent(filter));
|
|
457
457
|
try {
|
|
458
458
|
const response = await fetch(updateUrl, this.fetchoptions);
|
|
459
459
|
if (!response.ok) {
|
|
@@ -461,10 +461,13 @@ export class MgInputCombobox {
|
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
463
463
|
const json = await response.json();
|
|
464
|
-
const items = getObjectValueFromKey(json, this.fetchmappings.response.items).map((item) =>
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
const items = getObjectValueFromKey(json, this.fetchmappings.response.items).map((item) => {
|
|
465
|
+
var _a;
|
|
466
|
+
return ({
|
|
467
|
+
title: getObjectValueFromKey(item, this.fetchmappings.response.itemTitle),
|
|
468
|
+
value: (_a = getObjectValueFromKey(item, this.fetchmappings.response.itemValue)) !== null && _a !== void 0 ? _a : item,
|
|
469
|
+
});
|
|
470
|
+
});
|
|
468
471
|
const total = Number(getObjectValueFromKey(json, this.fetchmappings.response.total, 0));
|
|
469
472
|
let next = getObjectValueFromKey(json, this.fetchmappings.response.next);
|
|
470
473
|
if (URL.canParse(updateUrl) && Boolean(next) && !URL.canParse(next)) {
|
|
@@ -566,8 +569,8 @@ export class MgInputCombobox {
|
|
|
566
569
|
throw new Error(`<mg-input-combobox> prop "fetchmappings" value must be { request: RequestMappingType, response: ResponseMappingType }. Passed value: ${toString(newValue)}.`);
|
|
567
570
|
}
|
|
568
571
|
}
|
|
569
|
-
watchOptions(
|
|
570
|
-
this.page =
|
|
572
|
+
watchOptions() {
|
|
573
|
+
this.page = this.getFirstPage();
|
|
571
574
|
}
|
|
572
575
|
watchFilter(newValue) {
|
|
573
576
|
this.loadingWrapper({ name: 'load-data' });
|
|
@@ -575,7 +578,6 @@ export class MgInputCombobox {
|
|
|
575
578
|
}
|
|
576
579
|
watchPopoverDisplay(newValue) {
|
|
577
580
|
if (newValue) {
|
|
578
|
-
this.classCollection.add(this.classFocus);
|
|
579
581
|
this.input.focus();
|
|
580
582
|
}
|
|
581
583
|
else {
|
|
@@ -583,7 +585,6 @@ export class MgInputCombobox {
|
|
|
583
585
|
this.option = null;
|
|
584
586
|
// reset filter with value
|
|
585
587
|
this.filter = this.getValueTitle();
|
|
586
|
-
this.classCollection.delete(this.classFocus);
|
|
587
588
|
this.handlerInProgress = 'blur';
|
|
588
589
|
this.displayError().finally(() => {
|
|
589
590
|
// reset guard
|
|
@@ -717,7 +718,7 @@ export class MgInputCombobox {
|
|
|
717
718
|
this.loadingWrapper({ name: 'load-data' });
|
|
718
719
|
}
|
|
719
720
|
this.watchValue(this.value);
|
|
720
|
-
this.watchOptions(
|
|
721
|
+
this.watchOptions();
|
|
721
722
|
this.watchMgWidth(this.mgWidth);
|
|
722
723
|
this.watchReadonly(this.readonly);
|
|
723
724
|
this.watchDisabled(this.disabled);
|
|
@@ -757,7 +758,7 @@ export class MgInputCombobox {
|
|
|
757
758
|
else {
|
|
758
759
|
activeDescendant = (_e = this.value) === null || _e === void 0 ? void 0 : _e.value;
|
|
759
760
|
}
|
|
760
|
-
return (h("mg-input", { key: '
|
|
761
|
+
return (h("mg-input", { key: 'ee8222484fa6546a422eb724fdea67402644c0cc', 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: this.errorMessage }, 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: {
|
|
761
762
|
'--mg-c-input-list-width': ((_f = this.input) === null || _f === void 0 ? void 0 : _f.offsetWidth) > 0 ? `${this.input.offsetWidth}px` : undefined,
|
|
762
763
|
}, "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: this.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) => {
|
|
763
764
|
if (el !== null)
|
|
@@ -772,7 +773,7 @@ export class MgInputCombobox {
|
|
|
772
773
|
'mg-c-input__input-list-item': true,
|
|
773
774
|
'mg-c-input__input-list-item--focus-visible': JSON.stringify((_a = this.option) === null || _a === void 0 ? void 0 : _a.value) === JSON.stringify(option.value),
|
|
774
775
|
'mg-c-input__input-list-item--selected': this.isCurrentOption(option),
|
|
775
|
-
}, key: option.title, id: formatID(option.value), "aria-selected": this.isCurrentOption(option).toString(), onClick: this.handleOptionClick }, option.title, this.isCurrentOption(option) && h("mg-icon", { icon: "check" })));
|
|
776
|
+
}, key: option.title, id: formatID(option.value), "aria-selected": this.isCurrentOption(option).toString(), "data-value": toString(option.value), onClick: this.handleOptionClick }, option.title, this.isCurrentOption(option) && h("mg-icon", { icon: "check" })));
|
|
776
777
|
})),
|
|
777
778
|
this.isLoading && h("mg-loader", { key: "loader", message: this.messages.input.combobox.search, class: { 'mg-u-visually-hidden': Boolean(this.page.next) } }),
|
|
778
779
|
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) => {
|
|
@@ -8,8 +8,6 @@ export class MgInputRichTextEditor {
|
|
|
8
8
|
// hasDisplayedError (triggered by blur event)
|
|
9
9
|
this.hasDisplayedError = false;
|
|
10
10
|
this.customErrorMessage = { lock: false };
|
|
11
|
-
// Classes
|
|
12
|
-
this.classFocus = 'mg-u-is-focused';
|
|
13
11
|
/**
|
|
14
12
|
* Define the value of the editor
|
|
15
13
|
* Can be either HTML string or plain text
|
|
@@ -96,7 +94,6 @@ export class MgInputRichTextEditor {
|
|
|
96
94
|
* Handle focus event
|
|
97
95
|
*/
|
|
98
96
|
this.handleFocus = () => {
|
|
99
|
-
this.classCollection.add(this.classFocus);
|
|
100
97
|
this.classCollection = new ClassList(this.classCollection.classes);
|
|
101
98
|
};
|
|
102
99
|
/**
|
|
@@ -105,7 +102,6 @@ export class MgInputRichTextEditor {
|
|
|
105
102
|
*/
|
|
106
103
|
this.handleBlur = () => {
|
|
107
104
|
// Manage focus
|
|
108
|
-
this.classCollection.delete(this.classFocus);
|
|
109
105
|
this.classCollection = new ClassList(this.classCollection.classes);
|
|
110
106
|
if (!this.readonly) {
|
|
111
107
|
this.checkValidity();
|
|
@@ -173,7 +169,7 @@ export class MgInputRichTextEditor {
|
|
|
173
169
|
* Get editor content as HTML
|
|
174
170
|
* @returns HTML content of the editor
|
|
175
171
|
*/
|
|
176
|
-
|
|
172
|
+
getHTML() {
|
|
177
173
|
return new Promise(resolve => {
|
|
178
174
|
requestAnimationFrame(() => {
|
|
179
175
|
resolve(this.editor.getSemanticHTML());
|
|
@@ -321,7 +317,7 @@ export class MgInputRichTextEditor {
|
|
|
321
317
|
* @returns HTML mg-input Element
|
|
322
318
|
*/
|
|
323
319
|
render() {
|
|
324
|
-
return (h("mg-input", { key: '
|
|
320
|
+
return (h("mg-input", { key: '5e807e1059704a6624a1fda63ab56a6f9a51230f', 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 => {
|
|
325
321
|
this.wrapperElement = el;
|
|
326
322
|
}, id: this.identifier, class: "mg-c-input__wrapper" }, h("div", null)))));
|
|
327
323
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { allItemsAreString, ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { helpTextTypes, textTypes } from "./mg-input-text.conf";
|
|
4
|
-
import { widths, classReadonly, classDisabled } from "../mg-input/mg-input.conf";
|
|
4
|
+
import { widths, classReadonly, classDisabled, classDisplayCharacterLeft } from "../mg-input/mg-input.conf";
|
|
5
5
|
import { initLocales } from "../../../../locales";
|
|
6
6
|
/**
|
|
7
7
|
* Check if object is an option
|
|
@@ -24,7 +24,6 @@ export class MgInputText {
|
|
|
24
24
|
* Internal *
|
|
25
25
|
************/
|
|
26
26
|
// Classes
|
|
27
|
-
this.classFocus = 'mg-u-is-focused';
|
|
28
27
|
this.classIsInputGroupAppend = 'mg-c-input--is-input-group-append';
|
|
29
28
|
this.classHasIcon = 'mg-c-input--has-icon';
|
|
30
29
|
this.classHasButtonsGroupAppend = 'mg-c-input--has-buttons-group-append';
|
|
@@ -101,20 +100,10 @@ export class MgInputText {
|
|
|
101
100
|
}
|
|
102
101
|
this.value = this.input.value;
|
|
103
102
|
};
|
|
104
|
-
/**
|
|
105
|
-
* Handle focus event
|
|
106
|
-
*/
|
|
107
|
-
this.handleFocus = () => {
|
|
108
|
-
this.classCollection.add(this.classFocus);
|
|
109
|
-
this.classCollection = new ClassList(this.classCollection.classes);
|
|
110
|
-
};
|
|
111
103
|
/**
|
|
112
104
|
* Handle blur event
|
|
113
105
|
*/
|
|
114
106
|
this.handleBlur = () => {
|
|
115
|
-
// Manage focus
|
|
116
|
-
this.classCollection.delete(this.classFocus);
|
|
117
|
-
this.classCollection = new ClassList(this.classCollection.classes);
|
|
118
107
|
// Display Error
|
|
119
108
|
this.handlerInProgress = 'blur';
|
|
120
109
|
this.displayError().finally(() => {
|
|
@@ -248,6 +237,14 @@ export class MgInputText {
|
|
|
248
237
|
watchPattern() {
|
|
249
238
|
this.validatePattern();
|
|
250
239
|
}
|
|
240
|
+
validateCharacterLeftHide(newValue) {
|
|
241
|
+
if (newValue) {
|
|
242
|
+
this.classCollection.delete(classDisplayCharacterLeft);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.classCollection.add(classDisplayCharacterLeft);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
251
248
|
watchHelpText(newValue) {
|
|
252
249
|
if (!isValidString(newValue) && helpTextTypes.includes(this.type)) {
|
|
253
250
|
this.helpText = this.messages.input.text.helpText[this.type];
|
|
@@ -363,6 +360,7 @@ export class MgInputText {
|
|
|
363
360
|
this.watchMgWidth(this.mgWidth);
|
|
364
361
|
this.watchReadonly(this.readonly);
|
|
365
362
|
this.watchDisabled(this.disabled);
|
|
363
|
+
this.validateCharacterLeftHide(this.characterLeftHide);
|
|
366
364
|
this.validateType(this.type);
|
|
367
365
|
this.watchHelpText(this.helpText);
|
|
368
366
|
// Check validity when component is ready
|
|
@@ -377,12 +375,12 @@ export class MgInputText {
|
|
|
377
375
|
* @returns HTML Element
|
|
378
376
|
*/
|
|
379
377
|
render() {
|
|
380
|
-
return (h("mg-input", { key: '
|
|
378
|
+
return (h("mg-input", { key: 'b6360c95530daf744ae5c3eb5cc41d6c81c3e35c', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, 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
|
|
381
379
|
? this.value && this.renderReadonly()
|
|
382
380
|
: [
|
|
383
|
-
h("div", { key: "input", class: "mg-c-
|
|
381
|
+
h("div", { key: "input", class: "mg-c-input__input-group-container", style: {
|
|
384
382
|
'--mg-c-character-left-message-length': (!this.characterLeftHide ? this.maxlength.toString().length * 2 + 1 : 0).toString(),
|
|
385
|
-
} }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type === 'emails' ? 'email' : this.type, multiple: this.type === 'emails', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, list: this.hasDatalist() ? this.datalistId : undefined, autocomplete: this.hasDatalist() ? 'off' : undefined, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), pattern: this.pattern, onInput: this.handleInput,
|
|
383
|
+
} }, this.icon !== undefined && h("mg-icon", { icon: this.icon }), h("input", { type: this.type === 'emails' ? 'email' : this.type, multiple: this.type === 'emails', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, list: this.hasDatalist() ? this.datalistId : undefined, autocomplete: this.hasDatalist() ? 'off' : undefined, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), pattern: this.pattern, onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
386
384
|
if (el !== null)
|
|
387
385
|
this.input = el;
|
|
388
386
|
} }), this.hasDatalist() && (h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (h("option", { value: isOption(option) ? option.title : option, key: option }))))), !this.characterLeftHide && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))),
|
|
@@ -551,7 +549,7 @@ export class MgInputText {
|
|
|
551
549
|
"mutable": false,
|
|
552
550
|
"complexType": {
|
|
553
551
|
"original": "IconType",
|
|
554
|
-
"resolved": "\"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-download\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
|
|
552
|
+
"resolved": "\"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
|
|
555
553
|
"references": {
|
|
556
554
|
"IconType": {
|
|
557
555
|
"location": "import",
|
|
@@ -1065,6 +1063,9 @@ export class MgInputText {
|
|
|
1065
1063
|
}, {
|
|
1066
1064
|
"propName": "patternErrorMessage",
|
|
1067
1065
|
"methodName": "watchPattern"
|
|
1066
|
+
}, {
|
|
1067
|
+
"propName": "characterLeftHide",
|
|
1068
|
+
"methodName": "validateCharacterLeftHide"
|
|
1068
1069
|
}, {
|
|
1069
1070
|
"propName": "helpText",
|
|
1070
1071
|
"methodName": "watchHelpText"
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
-
import { widths, classReadonly, classDisabled } from "../mg-input/mg-input.conf";
|
|
3
|
+
import { widths, classReadonly, classDisabled, classDisplayCharacterLeft } from "../mg-input/mg-input.conf";
|
|
4
4
|
import { initLocales } from "../../../../locales";
|
|
5
5
|
export class MgInputTextarea {
|
|
6
6
|
constructor() {
|
|
7
|
-
/************
|
|
8
|
-
* Internal *
|
|
9
|
-
************/
|
|
10
|
-
// Classes
|
|
11
|
-
this.classFocus = 'mg-u-is-focused';
|
|
12
|
-
this.classDisplayCharacterLeft = 'mg-c-input--display-character-left';
|
|
13
7
|
// hasDisplayedError (triggered by blur event)
|
|
14
8
|
this.hasDisplayedError = false;
|
|
15
9
|
this.customErrorMessage = { lock: false };
|
|
@@ -76,20 +70,10 @@ export class MgInputTextarea {
|
|
|
76
70
|
}
|
|
77
71
|
this.value = this.input.value;
|
|
78
72
|
};
|
|
79
|
-
/**
|
|
80
|
-
* Handle focus event
|
|
81
|
-
*/
|
|
82
|
-
this.handleFocus = () => {
|
|
83
|
-
this.classCollection.add(this.classFocus);
|
|
84
|
-
this.classCollection = new ClassList(this.classCollection.classes);
|
|
85
|
-
};
|
|
86
73
|
/**
|
|
87
74
|
* Handle blur event
|
|
88
75
|
*/
|
|
89
76
|
this.handleBlur = () => {
|
|
90
|
-
// Manage focus
|
|
91
|
-
this.classCollection.delete(this.classFocus);
|
|
92
|
-
this.classCollection = new ClassList(this.classCollection.classes);
|
|
93
77
|
// Display Error
|
|
94
78
|
this.handlerInProgress = 'blur';
|
|
95
79
|
this.displayError().finally(() => {
|
|
@@ -174,10 +158,10 @@ export class MgInputTextarea {
|
|
|
174
158
|
}
|
|
175
159
|
validatecharacterLeftHide(newValue) {
|
|
176
160
|
if (newValue) {
|
|
177
|
-
this.classCollection.delete(
|
|
161
|
+
this.classCollection.delete(classDisplayCharacterLeft);
|
|
178
162
|
}
|
|
179
163
|
else {
|
|
180
|
-
this.classCollection.add(
|
|
164
|
+
this.classCollection.add(classDisplayCharacterLeft);
|
|
181
165
|
}
|
|
182
166
|
}
|
|
183
167
|
/**
|
|
@@ -300,13 +284,13 @@ export class MgInputTextarea {
|
|
|
300
284
|
* @returns HTML Element
|
|
301
285
|
*/
|
|
302
286
|
render() {
|
|
303
|
-
return (h("mg-input", { key: '
|
|
287
|
+
return (h("mg-input", { key: 'a43b8b1572249e31fb6ea5bd9244639698629218', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, 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 && h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (h("div", { class: "mg-c-input__input-group-container" }, h("textarea", { class: {
|
|
304
288
|
'mg-c-input__box': true,
|
|
305
289
|
'mg-c-input__box--width': true,
|
|
306
290
|
'mg-c-input__box--resizable': this.resizable === 'both',
|
|
307
291
|
'mg-c-input__box--resizable-horizontal': this.resizable === 'horizontal',
|
|
308
292
|
'mg-c-input__box--resizable-vertical': this.resizable === 'vertical',
|
|
309
|
-
}, value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, rows: this.rows, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput,
|
|
293
|
+
}, value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, rows: this.rows, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
310
294
|
if (el !== null)
|
|
311
295
|
this.input = el;
|
|
312
296
|
} }), !this.characterLeftHide && this.maxlength > 0 && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))))));
|