@mgdis/mg-components 6.22.0 → 6.22.1
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-C2viYwrR.js → index-Dz2LAZQT.js} +325 -1789
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mg-action-more_37.cjs.entry.js → mg-action-more_36.cjs.entry.js} +109 -130
- package/dist/cjs/mg-alert.cjs.entry.js +2 -2
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +2 -2
- package/dist/cjs/mg-input-combobox.cjs.entry.js +2 -2
- package/dist/cjs/mg-input-file.cjs.entry.js +3 -3
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2498 -2474
- package/dist/cjs/mg-loader.cjs.entry.js +2 -2
- package/dist/cjs/mg-progress.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +2 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +6 -3
- package/dist/collection/components/atoms/mg-card/mg-card.js +2 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +8 -4
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +2 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +4 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +38 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +47 -26
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +13 -7
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +9 -5
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +5 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +5 -3
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +7 -4
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +22 -8
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +11 -6
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +5 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +7 -4
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +5 -3
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +5 -3
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +4 -2
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -7
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +5 -3
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +3 -2
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +3 -2
- package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +5 -3
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +6 -4
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +4 -3
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +5 -3
- 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 +3 -2
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +3 -2
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -2
- package/dist/collection/components/molecules/mg-table/mg-table.js +4 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +3 -2
- package/dist/components/index2.js +1 -1
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-breadcrumb.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-fieldset.js +1 -1
- package/dist/components/mg-form.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 +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.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-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +2 -2
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-item-more2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- 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/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/esm/{index-DFwaH2hS.js → index-C3jUhxdI.js} +325 -1789
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-action-more_37.entry.js → mg-action-more_36.entry.js} +111 -131
- package/dist/esm/mg-alert.entry.js +2 -2
- package/dist/esm/mg-breadcrumb.entry.js +2 -2
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +2 -2
- package/dist/esm/mg-input-combobox.entry.js +2 -2
- package/dist/esm/mg-input-file.entry.js +3 -3
- package/dist/esm/mg-input-rich-text-editor.entry.js +2498 -2474
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +2 -2
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-2ee92f38.entry.js → p-06fbdb2f.entry.js} +1 -1
- package/dist/mg-components/{p-3b653226.entry.js → p-188b9ca9.entry.js} +1 -1
- package/dist/mg-components/p-4667078d.entry.js +1 -0
- package/dist/mg-components/{p-c63f97f0.entry.js → p-5a859ecf.entry.js} +2 -2
- package/dist/mg-components/{p-d5e69c95.entry.js → p-661da56b.entry.js} +1 -1
- package/dist/mg-components/{p-adec7fcc.entry.js → p-8e256086.entry.js} +1 -1
- package/dist/mg-components/p-C3jUhxdI.js +2 -0
- package/dist/mg-components/{p-cc793586.entry.js → p-b0b8c58f.entry.js} +1 -1
- package/dist/mg-components/{p-5745fbea.entry.js → p-bbcef41c.entry.js} +1 -1
- package/dist/mg-components/{p-c8c8cfc1.entry.js → p-c1aeb277.entry.js} +1 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +16 -8
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +15 -5
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
- package/dist/types/components.d.ts +525 -170
- package/dist/types/stencil-public-runtime.d.ts +52 -2
- package/ide/intellij/web-types.json +7 -7
- package/ide/vscode/html-custom-data.json +3 -3
- package/package.json +19 -19
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +0 -245
- package/dist/components/mg-input-checkbox-paginated.d.ts +0 -11
- package/dist/components/mg-input-checkbox-paginated.js +0 -1
- package/dist/components/mg-input-checkbox-paginated2.js +0 -1
- package/dist/mg-components/p-0482eb9f.entry.js +0 -1
- package/dist/mg-components/p-DFwaH2hS.js +0 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +0 -77
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-
|
|
2
|
-
import { h as createID, t as toString, C as ClassList, i as isValidString, n as nextTick, j as isValideID, k as isTagName,
|
|
1
|
+
import { r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-C3jUhxdI.js';
|
|
2
|
+
import { h as createID, t as toString, C as ClassList, i as isValidString, n as nextTick, j as isValideID, k as isTagName, f as formatID, l as cleanString, m as dateRegExp, o as dateToString, b as allItemsAreString, p as getWindows, q as focusableElements } from './index-C7xjtdiw.js';
|
|
3
3
|
import { i as initLocales, a as localeDate, b as localeDatePattern, c as localeNumber, d as localeUnit, e as localePercent, f as localeCurrency } from './index-DSEloqPn.js';
|
|
4
4
|
import { K as Keys } from './events.utils-yMGqY8YG.js';
|
|
5
5
|
import { i as isMgInputFile, l as labelHeadings, t as tooltipPositions, b as classFieldset, c as classReadonly, a as classDisabled, d as classVerticalList, w as widths, e as classDisplayCharacterLeft } from './mg-input.conf-C9rmNQIL.js';
|
|
@@ -167,7 +167,7 @@ const MgActionMore = class {
|
|
|
167
167
|
[`${this.classBase}__chevron--rotate`]: this.expanded === true,
|
|
168
168
|
} }, h("mg-icon", { icon: "chevron-down" })));
|
|
169
169
|
}
|
|
170
|
-
return (h(Host, { key: '
|
|
170
|
+
return (h(Host, { key: '184355435ec346d682c2df4aa8b33bf5f54e77e7', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '8176489e5dd7741311745d015b8ef7f2a4f63ea9', class: this.classBase }, h("mg-popover", { key: '3ee64b21556ee9e910939ad2fc9e3fbf8e4bd964', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: 'cf8f7f4f736d6a8338a4f6eebce04b4e2be49825', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: 'ee8b4f13bac85ccdd5e9d72edbaa957054c304ec' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '1c78fb9a98d59fa5422c5105ecb13d2f2884c7d2', slot: "content" }, h("mg-menu", { key: '522d915d4a38529f7709640bb96eebb81ccc86af', direction: directions$1.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
171
171
|
var _a, _b;
|
|
172
172
|
return isMgActionMoreDivider(item) ? (h("mg-divider", { class: "mg-c-action-more__divider", key: "divider", "full-width": true })) : (h("mg-menu-item", { key: item.label, status: item.status || Status$1.VISIBLE, target: item.target, href: item.href,
|
|
173
173
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -689,7 +689,7 @@ const MgDetails = class {
|
|
|
689
689
|
* @returns HTML Element
|
|
690
690
|
*/
|
|
691
691
|
render() {
|
|
692
|
-
return (h("details", { key: '
|
|
692
|
+
return (h("details", { key: 'bbaac6909fa5f3fbd3236b2a8ace0f7c80b2580b', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '2ed8228b63403dd9b386bf3fa70c9094516b6f0e' }, h("slot", { key: '5461d77d2b2869b14737a5c7cfc40a1f9584ee03', name: "summary" }), h("span", { key: 'bb089365bdeaa7b934b97cff6f5f7c67587048e1', class: "mg-c-details__toggle" }, h("mg-icon", { key: 'dc1a30338703ad4182d50f9953a903ae0f68ecb1', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'a32cbaf9e38b71540deeaa8980895c34a7288ecb', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: 'b9c2bc7d681da8ac8b4dec5ff25287bc68975fb6', class: "mg-c-details__details" }, h("slot", { key: '069f05b4c133ff13055681e0b05bb98744303137', name: "details" }))));
|
|
693
693
|
}
|
|
694
694
|
get element() { return getElement(this); }
|
|
695
695
|
static get watchers() { return {
|
|
@@ -982,7 +982,7 @@ const MgForm = class {
|
|
|
982
982
|
* @returns HTML Element
|
|
983
983
|
*/
|
|
984
984
|
render() {
|
|
985
|
-
return (h("form", { key: '
|
|
985
|
+
return (h("form", { key: 'e528a49eba4e57f809dd0a6dd5462c2be3677da5', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '37eb0c30984b998ef8d78ff8ae74949c4761c21a', innerHTML: this.requiredMessageText }), h("slot", { key: '8ae80522118a3e87ca735545a48844c1e4e3ab30' }), !this.readonly && !this.disabled && h("slot", { key: '4cdeba849881f9753ff08df6c456397e859c6a0d', name: "actions" })));
|
|
986
986
|
}
|
|
987
987
|
get element() { return getElement(this); }
|
|
988
988
|
static get watchers() { return {
|
|
@@ -1260,7 +1260,7 @@ const MgIllustratedMessage = class {
|
|
|
1260
1260
|
* @returns HTML Element
|
|
1261
1261
|
*/
|
|
1262
1262
|
render() {
|
|
1263
|
-
return (h("div", { key: '
|
|
1263
|
+
return (h("div", { key: 'c9d8c8bfd2792b1cf5e78ab9d168d597b20e9a1e', class: this.classCollection.join() }, h("div", { key: 'cc8fa03147b9e59e6e8e015be9ed2b8dddd92ded', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '83a4ec2223c4e74511beb7c0abfa10e77cee425d', name: "illustration" })), h("div", { key: 'dbb4d13ca5324cab889fa2acc9b9b22522d7a8ec', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '9e74d84becf29539ec9c37e8ad1e317714f3c86c', name: "title" }), h("slot", { key: 'ae97d25c19b76ca092560d2555ebd6a87f542ffe', name: "details" }))));
|
|
1264
1264
|
}
|
|
1265
1265
|
get element() { return getElement(this); }
|
|
1266
1266
|
static get watchers() { return {
|
|
@@ -1683,8 +1683,9 @@ const checkboxTypes = ['checkbox', 'multi'];
|
|
|
1683
1683
|
* mg-input-checkbox-paginated section kind value
|
|
1684
1684
|
*/
|
|
1685
1685
|
const SectionKind = {
|
|
1686
|
-
|
|
1687
|
-
|
|
1686
|
+
NOT_SELECTED: 0,
|
|
1687
|
+
SELECTED: 1,
|
|
1688
|
+
SEARCH: 2,
|
|
1688
1689
|
};
|
|
1689
1690
|
|
|
1690
1691
|
/**
|
|
@@ -1707,10 +1708,46 @@ const Status = {
|
|
|
1707
1708
|
ACTIVE: 'active',
|
|
1708
1709
|
};
|
|
1709
1710
|
|
|
1711
|
+
/**
|
|
1712
|
+
* Get items from checkboxes and limit
|
|
1713
|
+
* @param checkboxes - checkboxes to slice
|
|
1714
|
+
* @param limit - number of items to return
|
|
1715
|
+
* @returns list of items to display in section
|
|
1716
|
+
*/
|
|
1717
|
+
const getItems = (checkboxes, limit) => [...checkboxes].slice(0, limit);
|
|
1718
|
+
/**
|
|
1719
|
+
* Component has next checkboxes to display
|
|
1720
|
+
* @param checkboxes - checkboxes to check
|
|
1721
|
+
* @param limit - number of items to display
|
|
1722
|
+
* @returns truthy if have next elements
|
|
1723
|
+
*/
|
|
1724
|
+
const hasNext = (checkboxes, limit) => checkboxes.length > limit;
|
|
1725
|
+
/**
|
|
1726
|
+
* Internal component use to manage sections instances
|
|
1727
|
+
* @param props - MgInputCheckboxList Interface Props
|
|
1728
|
+
* @returns input template
|
|
1729
|
+
*/
|
|
1730
|
+
const MgInputCheckboxPaginated = (props) => {
|
|
1731
|
+
const items = getItems(props.checkboxes, props.limit);
|
|
1732
|
+
const listId = formatID(props.messages.label);
|
|
1733
|
+
const tabId = `tab-info-${props.key}`;
|
|
1734
|
+
/**
|
|
1735
|
+
* Handle load-more <mg-button> click event
|
|
1736
|
+
*/
|
|
1737
|
+
const handleLoadMoreClick = () => {
|
|
1738
|
+
if (hasNext(props.checkboxes, props.limit)) {
|
|
1739
|
+
props.handleLoadMore();
|
|
1740
|
+
}
|
|
1741
|
+
};
|
|
1742
|
+
return (h("div", { class: "mg-input-checkbox-paginated mg-c-input__tab", slot: `tab_content-${props.key + 1}` },
|
|
1743
|
+
// Mass action depends on all checkboxes list, not only displayed items
|
|
1744
|
+
typeof props.handleMassAction === 'function' && props.checkboxes.length > 0 && props.checkboxes.some(checkbox => checkbox.disabled !== true) && (h("mg-tooltip", { slot: "header-action", class: "mg-c-input__tabs-action", message: props.messages.tooltip }, h("mg-button", { variant: "link", onClick: props.handleMassAction }, props.messages.action))), h("div", { class: "mg-c-input__tabs-content" }, h("p", { id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': items.length !== 0 }, "aria-live": items.length !== 0 ? 'polite' : undefined }, items.length === 0 ? props.messages.noValue : props.messages.values.replace('{count}', items.length.toString())), items.length > 0 && (h(MgInputCheckboxList, { checkboxes: items, labelledby: tabId, id: listId, disabled: props.disabled, name: props.name, invalid: props.invalid })), hasNext(props.checkboxes, props.limit) && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: handleLoadMoreClick, "aria-controls": listId }, h("mg-icon", { icon: "chevron-down" }), props.messages.showMore)))));
|
|
1745
|
+
};
|
|
1746
|
+
|
|
1710
1747
|
const mgInputCheckboxCss = () => `.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-c-input-check-size);height:var(--mg-c-input-check-size);flex-shrink:0;margin:calc((var(--mg-b-font-size)*var(--mg-b-line-height) - var(--mg-c-input-check-size))/2) var(--mg-b-size-8) 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);gap:var(--mg-b-size-12) var(--mg-b-size-24);list-style:none}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group.mg-c-input__input-group--disabled label{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:var(--mg-b-size-8)}.mg-c-input__popover-info{padding:var(--mg-b-size-8);margin:0;color:var(--mg-b-color-neutral-90);text-align:center}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-group-container{padding:var(--mg-b-size-4) var(--mg-b-size-8);margin:0}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container{display:flex;width:unset;flex:unset;flex-wrap:wrap;column-gap:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container-list{display:flex;flex-flow:row wrap;padding:0;margin:0;gap:var(--mg-b-size-4);list-style:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tab{display:block;min-height:calc(var(--mg-b-size-4)*55)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs{min-height:0;flex-shrink:1}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs-action{padding-top:var(--mg-b-size-16);padding-bottom:var(--mg-b-size-12)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs-content{height:calc(24*var(--mg-b-size-8) - 2*var(--mg-b-size-8));overflow-y:auto}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-value{display:inline-flex;min-width:var(--mg-b-size-min-height);min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;justify-content:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-radius:var(--mg-b-size-4);background-color:var(--mg-b-color-neutral-20);font-size:var(--mg-b-font-size)}.mg-c-input.mg-c-input--checkbox-multi b{margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container b{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--with-values .mg-c-input__input-container{gap:var(--mg-b-size-4)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--search-mode .mg-c-input__content{display:flex;width:calc(var(--mg-b-size-floating-element-max-width) - var(--mg-b-size-16));flex-direction:column;gap:var(--mg-b-size-4)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--search-mode .mg-c-input__content .mg-c-input__tabs-content{min-height:calc(var(--mg-b-size-4)*55)}.mg-c-input.mg-c-input--checkbox-multi:not(.mg-c-input--label-on-top) mg-tooltip:not(.mg-c-input__section-header-tootlip){margin-left:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi mg-popover{--mg-c-card-spacing:var(--mg-b-size-8)}.mg-c-input.mg-c-input--readonly ul{display:flex;min-height:var(--mg-b-font-size);flex-flow:column wrap;padding:0;margin:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) 0 0;list-style:none;row-gap:var(--mg-b-size-8)}`;
|
|
1711
1748
|
|
|
1712
1749
|
/**
|
|
1713
|
-
* type
|
|
1750
|
+
* type ICheckboxItem validation function
|
|
1714
1751
|
* @param items - Checkbox item
|
|
1715
1752
|
* @returns match item type
|
|
1716
1753
|
*/
|
|
@@ -1733,6 +1770,7 @@ const MgInputCheckbox = class {
|
|
|
1733
1770
|
// "multi" setup
|
|
1734
1771
|
this.multiStart = 5;
|
|
1735
1772
|
this.searchStart = 10;
|
|
1773
|
+
this.paginatedStep = 10;
|
|
1736
1774
|
// popover variables
|
|
1737
1775
|
this.hasOpenedPopover = false;
|
|
1738
1776
|
this.checkboxesId = 'checkboxes-list';
|
|
@@ -1798,6 +1836,10 @@ const MgInputCheckbox = class {
|
|
|
1798
1836
|
* Define <mg-tabs> active-tab
|
|
1799
1837
|
*/
|
|
1800
1838
|
this.activeTab = 1;
|
|
1839
|
+
/**
|
|
1840
|
+
* Paginated sections limit per key
|
|
1841
|
+
*/
|
|
1842
|
+
this.paginatedLimits = {};
|
|
1801
1843
|
/**
|
|
1802
1844
|
* Handle input event
|
|
1803
1845
|
* @param event - input event
|
|
@@ -1843,8 +1885,9 @@ const MgInputCheckbox = class {
|
|
|
1843
1885
|
* @param event - input value-change event
|
|
1844
1886
|
*/
|
|
1845
1887
|
this.handleSearchChange = (event) => {
|
|
1846
|
-
this.searchValue = event.detail;
|
|
1847
1888
|
event.stopPropagation();
|
|
1889
|
+
event.preventDefault();
|
|
1890
|
+
this.searchValue = event.detail;
|
|
1848
1891
|
};
|
|
1849
1892
|
/**
|
|
1850
1893
|
* Handle <mg-tabs> tab-change event
|
|
@@ -1976,9 +2019,15 @@ const MgInputCheckbox = class {
|
|
|
1976
2019
|
* Reset <mg-input-checkbox-paginated> limit state
|
|
1977
2020
|
*/
|
|
1978
2021
|
this.resetTabsLimit = () => {
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2022
|
+
this.paginatedLimits = {};
|
|
2023
|
+
};
|
|
2024
|
+
/**
|
|
2025
|
+
* Handle load-more action for a paginated section
|
|
2026
|
+
* @param key - section key
|
|
2027
|
+
*/
|
|
2028
|
+
this.handlePaginatedLoadMore = (key) => {
|
|
2029
|
+
var _a;
|
|
2030
|
+
this.paginatedLimits = Object.assign(Object.assign({}, this.paginatedLimits), { [key]: ((_a = this.paginatedLimits[key]) !== null && _a !== void 0 ? _a : this.paginatedStep) + this.paginatedStep });
|
|
1982
2031
|
};
|
|
1983
2032
|
/**
|
|
1984
2033
|
* Renders the readonly value of the input.
|
|
@@ -1999,7 +2048,7 @@ const MgInputCheckbox = class {
|
|
|
1999
2048
|
this.valueChange.emit(newValue);
|
|
2000
2049
|
}
|
|
2001
2050
|
else {
|
|
2002
|
-
throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type,
|
|
2051
|
+
throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type, ICheckboxItem. Passed value: ${toString(newValue)}.`);
|
|
2003
2052
|
}
|
|
2004
2053
|
}
|
|
2005
2054
|
validateType(newValue) {
|
|
@@ -2224,7 +2273,7 @@ const MgInputCheckbox = class {
|
|
|
2224
2273
|
* @param checkboxes - checkboxes to render
|
|
2225
2274
|
* @returns render sections of checkboxes
|
|
2226
2275
|
*/
|
|
2227
|
-
renderCheckboxTabs(
|
|
2276
|
+
renderCheckboxTabs(props) {
|
|
2228
2277
|
const handleMassAction = (kind) => () => {
|
|
2229
2278
|
const displayItems = this.getDisplayItems();
|
|
2230
2279
|
// update only displayed items
|
|
@@ -2235,39 +2284,43 @@ const MgInputCheckbox = class {
|
|
|
2235
2284
|
});
|
|
2236
2285
|
this.updateValues();
|
|
2237
2286
|
};
|
|
2238
|
-
const [checkedValues, notCheckedValues] = checkboxes.reduce((acc, curr) => {
|
|
2287
|
+
const [checkedValues, notCheckedValues] = props.checkboxes.reduce((acc, curr) => {
|
|
2239
2288
|
acc[curr.value ? 0 : 1].push(curr);
|
|
2240
2289
|
return acc;
|
|
2241
2290
|
}, [[], []]);
|
|
2242
2291
|
const sections = [
|
|
2243
|
-
Object.assign(Object.assign({},
|
|
2244
|
-
Object.assign(Object.assign({},
|
|
2292
|
+
Object.assign(Object.assign({}, props), { checkboxes: notCheckedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.notSelected), { showMore: this.messages.input.showMore }), key: SectionKind.NOT_SELECTED, handleMassAction: handleMassAction(SectionKind.NOT_SELECTED) }),
|
|
2293
|
+
Object.assign(Object.assign({}, props), { checkboxes: checkedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.selected), { showMore: this.messages.input.showMore }), key: SectionKind.SELECTED, handleMassAction: handleMassAction(SectionKind.SELECTED) }),
|
|
2245
2294
|
];
|
|
2246
2295
|
return (h("mg-tabs", { identifier: `${this.identifier}-tabs`, class: "mg-c-input__tabs", label: this.messages.input.checkbox.sections.label, items: sections.map((section, key) => ({
|
|
2247
2296
|
label: section.messages.title,
|
|
2248
2297
|
badge: { value: section.checkboxes.length, label: this.messages.input.checkbox.sections.badge.label, role: 'information' },
|
|
2249
2298
|
status: key + 1 === this.activeTab ? Status.ACTIVE : Status.VISIBLE,
|
|
2250
|
-
})), activeTab: this.activeTab, "onActive-tab-change": this.handleActiveTabChange }, sections.map(
|
|
2299
|
+
})), activeTab: this.activeTab, "onActive-tab-change": this.handleActiveTabChange }, sections.map(section => {
|
|
2300
|
+
var _a;
|
|
2301
|
+
return (h(MgInputCheckboxPaginated, Object.assign({}, section, { limit: (_a = this.paginatedLimits[section.key]) !== null && _a !== void 0 ? _a : this.paginatedStep, handleLoadMore: () => this.handlePaginatedLoadMore(section.key) })));
|
|
2302
|
+
})));
|
|
2251
2303
|
}
|
|
2252
2304
|
/**
|
|
2253
2305
|
* render checkbox multi element
|
|
2254
2306
|
* @returns html element
|
|
2255
2307
|
*/
|
|
2256
2308
|
renderCheckboxMulti() {
|
|
2309
|
+
var _a;
|
|
2257
2310
|
const selectedValuesNb = this.getSelectedItems().length;
|
|
2258
|
-
const
|
|
2259
|
-
const checkboxPaginatedProps = {
|
|
2311
|
+
const props = {
|
|
2260
2312
|
readonly: this.readonly,
|
|
2261
2313
|
disabled: this.disabled,
|
|
2262
|
-
|
|
2314
|
+
checkboxes: this.getDisplayItems(),
|
|
2263
2315
|
};
|
|
2316
|
+
const checkboxesPaginatedSearchProps = Object.assign(Object.assign({}, props), { messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.search), { showMore: this.messages.input.showMore }), key: SectionKind.SEARCH, limit: (_a = this.paginatedLimits[SectionKind.SEARCH]) !== null && _a !== void 0 ? _a : this.paginatedStep, handleLoadMore: () => this.handlePaginatedLoadMore(SectionKind.SEARCH) });
|
|
2264
2317
|
return (h("div", { class: "mg-c-input__input-container" }, h("mg-popover", { arrowHide: true, identifier: this.getMgPopoverIdentifier(), display: this.hasOpenedPopover, "onDisplay-change": this.handleMgPopoverDisplayChange, ref: (el) => {
|
|
2265
2318
|
if (el !== null)
|
|
2266
2319
|
this.mgPopover = el;
|
|
2267
2320
|
} }, h("mg-button", { variant: "secondary", "aria-describedby": `${this.identifier}-title` }, h("mg-icon", { icon: "list" }), this.getSelectValuesButtonMessage()), h("div", { slot: "content", class: "mg-c-input__content" }, this.displaySearchInput ? ([
|
|
2268
2321
|
h("mg-input-text", { key: "input-search", identifier: `${this.identifier}-input-search`, icon: "magnifying-glass", type: "search", placeholder: this.messages.input.checkbox.sections.search.label, label: this.messages.input.checkbox.sections.search.label, mgWidth: "full", value: this.searchValue, labelHide: true, characterLeftHide: true, name: "q", "onValue-change": this.handleSearchChange }),
|
|
2269
|
-
this.searchValue.length > 0 ?
|
|
2270
|
-
]) : (h(MgInputCheckboxList, {
|
|
2322
|
+
this.searchValue.length > 0 ? h(MgInputCheckboxPaginated, Object.assign({}, checkboxesPaginatedSearchProps)) : this.renderCheckboxTabs(props),
|
|
2323
|
+
]) : (h(MgInputCheckboxList, Object.assign({}, props, { id: this.checkboxesId, name: this.name, invalid: this.invalid }))))), this.displaySelectedValues ? (selectedValuesNb > 0 && (h("ul", { role: "list", class: "mg-c-input__input-container-list" }, this.getSelectedItems().map(({ title }) => (h("li", { class: "mg-c-input__input-value", key: title }, title)))))) : (h("b", null, this.messages.input.checkbox[selectedValuesNb > 1 ? 'selectedValues' : 'selectedValue'].replace('{nb}', selectedValuesNb)))));
|
|
2271
2324
|
}
|
|
2272
2325
|
/**
|
|
2273
2326
|
* Render
|
|
@@ -2285,7 +2338,7 @@ const MgInputCheckbox = class {
|
|
|
2285
2338
|
else {
|
|
2286
2339
|
inputContent = this.renderCheckboxMulti();
|
|
2287
2340
|
}
|
|
2288
|
-
return (h("mg-input", { key: '
|
|
2341
|
+
return (h("mg-input", { key: '11b725ebb111707aaf7dc39d191fe6a9efb25ea6', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
|
|
2289
2342
|
}
|
|
2290
2343
|
get element() { return getElement(this); }
|
|
2291
2344
|
static get watchers() { return {
|
|
@@ -2327,90 +2380,6 @@ const MgInputCheckbox = class {
|
|
|
2327
2380
|
};
|
|
2328
2381
|
MgInputCheckbox.style = mgInputCheckboxCss();
|
|
2329
2382
|
|
|
2330
|
-
const MgInputCheckboxPaginated = class {
|
|
2331
|
-
constructor(hostRef) {
|
|
2332
|
-
registerInstance(this, hostRef);
|
|
2333
|
-
this.step = 10;
|
|
2334
|
-
/*************
|
|
2335
|
-
* Decorators *
|
|
2336
|
-
*************/
|
|
2337
|
-
/**
|
|
2338
|
-
* Define if mg-input-checkbox-list is readonly
|
|
2339
|
-
*/
|
|
2340
|
-
this.readonly = false;
|
|
2341
|
-
/**
|
|
2342
|
-
* Define if mg-input-checkbox-list is disabled
|
|
2343
|
-
*/
|
|
2344
|
-
this.disabled = false;
|
|
2345
|
-
/**
|
|
2346
|
-
* Page items limit to display
|
|
2347
|
-
*/
|
|
2348
|
-
this.limit = this.step;
|
|
2349
|
-
/***********
|
|
2350
|
-
* Methods *
|
|
2351
|
-
***********/
|
|
2352
|
-
/**
|
|
2353
|
-
* Component has next checkboxes to display
|
|
2354
|
-
* @returns truthy if have next elements
|
|
2355
|
-
*/
|
|
2356
|
-
this.hasNext = () => {
|
|
2357
|
-
return this.checkboxes.length > this.limit;
|
|
2358
|
-
};
|
|
2359
|
-
/**
|
|
2360
|
-
* Set items from checkboxes and limit
|
|
2361
|
-
*/
|
|
2362
|
-
this.setItems = () => {
|
|
2363
|
-
this.items = this.checkboxes.slice(0, this.limit);
|
|
2364
|
-
};
|
|
2365
|
-
/**
|
|
2366
|
-
* Handle load-more <mg-button> click event
|
|
2367
|
-
*/
|
|
2368
|
-
this.handleLoadMore = () => {
|
|
2369
|
-
if (this.hasNext()) {
|
|
2370
|
-
this.limit += this.step;
|
|
2371
|
-
}
|
|
2372
|
-
};
|
|
2373
|
-
}
|
|
2374
|
-
watchCheckboxes() {
|
|
2375
|
-
this.setItems();
|
|
2376
|
-
}
|
|
2377
|
-
watchLimit() {
|
|
2378
|
-
this.setItems();
|
|
2379
|
-
}
|
|
2380
|
-
/**
|
|
2381
|
-
* Method to reset limit
|
|
2382
|
-
*/
|
|
2383
|
-
async resetLimit() {
|
|
2384
|
-
this.limit = this.step;
|
|
2385
|
-
}
|
|
2386
|
-
/*************
|
|
2387
|
-
* Lifecycle *
|
|
2388
|
-
*************/
|
|
2389
|
-
/**
|
|
2390
|
-
* Validate props
|
|
2391
|
-
*/
|
|
2392
|
-
componentWillLoad() {
|
|
2393
|
-
this.watchCheckboxes();
|
|
2394
|
-
}
|
|
2395
|
-
/**
|
|
2396
|
-
* Render
|
|
2397
|
-
* @returns HTML Element
|
|
2398
|
-
*/
|
|
2399
|
-
render() {
|
|
2400
|
-
const listId = formatID(this.messages.label);
|
|
2401
|
-
const tabId = 'tab-info';
|
|
2402
|
-
return (h(Host, { key: 'ce0fe4a842cc21f7f981b6a9286d592c2c28819b' }, h("slot", { key: '683c26f98e76262c565613529c76e7f3b27efbc5', name: "header-action" }), h("div", { key: 'eb9e9bfa54a467b44f4e90a8575ae8b1fe40ea10', class: "mg-c-input__tabs-content" }, h("p", { key: '6eeb40f89a0cc0b8ea0837f44babe8cd440ced0f', id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': this.items.length !== 0 }, "aria-live": this.items.length !== 0 ? 'polite' : undefined }, this.items.length === 0 ? this.messages.noValue : this.messages.values.replace('{count}', this.items.length.toString())), this.items.length > 0 && (h(MgInputCheckboxList, { key: '1625b0bdbb1de6ef0c55850e3a08a2cf322da317', checkboxes: this.items, labelledby: tabId, id: listId, disabled: this.disabled, name: this.name, invalid: this.invalid })), this.hasNext() && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: this.handleLoadMore, "aria-controls": listId }, h("mg-icon", { key: '8f10cc6152899cf869023ff1c465763e9a05d7b6', icon: "chevron-down" }), this.messages.showMore)))));
|
|
2403
|
-
}
|
|
2404
|
-
static get watchers() { return {
|
|
2405
|
-
"checkboxes": [{
|
|
2406
|
-
"watchCheckboxes": 0
|
|
2407
|
-
}],
|
|
2408
|
-
"limit": [{
|
|
2409
|
-
"watchLimit": 0
|
|
2410
|
-
}]
|
|
2411
|
-
}; }
|
|
2412
|
-
};
|
|
2413
|
-
|
|
2414
2383
|
const DEFAULT_MAX_DATE = '9999-12-31';
|
|
2415
2384
|
|
|
2416
2385
|
const mgInputDateCss = () => `.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-c-input__box{height:var(--mg-b-size-min-height);box-sizing:border-box;padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light);color:var(--mg-b-color-dark);font-family:inherit;font-size:var(--mg-b-font-size);text-align:var(--mg-c-input-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-c-input-placeholder-color-text);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus)}.mg-c-input__box:disabled{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--has-error .mg-c-input__box{border-color:var(--mg-b-color-danger)}.mg-c-input.mg-c-input--is-input-group-append{--mg-c-button-border-radius-top-left:0;--mg-c-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:calc(-1*var(--mg-b-size-border));border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-c-button-border-radius-top-right:0;--mg-c-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-c-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-c-button-border-radius-top-right:var(--mg-c-input-border-radius);--mg-c-button-border-radius-bottom-right:var(--mg-c-input-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){align-self:start;padding-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input.mg-c-input--has-icon .mg-c-input__input-group-container{position:relative}.mg-c-input.mg-c-input--has-icon .mg-c-input__input-group-container>mg-icon:first-of-type{position:absolute;top:50%;left:var(--mg-b-size-8);color:var(--mg-c-input-color-icon);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__input-group-container .mg-c-input__box{padding-left:calc(var(--mg-b-size-16) + var(--mg-b-size-8)*2)}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}`;
|
|
@@ -2771,7 +2740,7 @@ const MgInputDate = class {
|
|
|
2771
2740
|
* @returns HTML Element
|
|
2772
2741
|
*/
|
|
2773
2742
|
render() {
|
|
2774
|
-
return (h("mg-input", { key: '
|
|
2743
|
+
return (h("mg-input", { key: '0c3e08b8c467207110ef75f7d2516c36adc2ec4c', 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) => {
|
|
2775
2744
|
if (el !== null)
|
|
2776
2745
|
this.input = el;
|
|
2777
2746
|
} }))));
|
|
@@ -3272,7 +3241,7 @@ const MgInputNumeric = class {
|
|
|
3272
3241
|
* @returns HTML Element
|
|
3273
3242
|
*/
|
|
3274
3243
|
render() {
|
|
3275
|
-
return (h("mg-input", { key: '
|
|
3244
|
+
return (h("mg-input", { key: '9bea775c3e8d7339a45d18aeb1b3974d6da9a650', 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
|
|
3276
3245
|
? this.readonlyValue && this.renderReadonly()
|
|
3277
3246
|
: [
|
|
3278
3247
|
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) => {
|
|
@@ -3576,7 +3545,7 @@ const MgInputPassword = class {
|
|
|
3576
3545
|
* @returns HTML Element
|
|
3577
3546
|
*/
|
|
3578
3547
|
render() {
|
|
3579
|
-
return (h("mg-input", { key: '
|
|
3548
|
+
return (h("mg-input", { key: 'bfa5f289eb4d357c21cd9a753550bab1df846df8', 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) => {
|
|
3580
3549
|
if (el !== null)
|
|
3581
3550
|
this.input = el;
|
|
3582
3551
|
} }), 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') }))))));
|
|
@@ -3893,7 +3862,7 @@ const MgInputRadio = class {
|
|
|
3893
3862
|
* @returns HTML Element
|
|
3894
3863
|
*/
|
|
3895
3864
|
render() {
|
|
3896
|
-
return (h("mg-input", { key: '
|
|
3865
|
+
return (h("mg-input", { key: 'a24a80156ef3e7760d02a52900d93099cd570db8', 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: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("div", { class: "mg-c-input__input-group-container" }, this.options.map((input, index) => (h("div", { 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) => {
|
|
3897
3866
|
if (el !== null)
|
|
3898
3867
|
this.inputs[index] = el;
|
|
3899
3868
|
} }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
|
|
@@ -4058,11 +4027,19 @@ const MgInputSelect = class {
|
|
|
4058
4027
|
}
|
|
4059
4028
|
};
|
|
4060
4029
|
/**
|
|
4061
|
-
* Method to compare item
|
|
4030
|
+
* Method to compare item with input.value
|
|
4062
4031
|
* @param item - item to compare with
|
|
4063
4032
|
* @returns truthy if input.value is an item
|
|
4064
4033
|
*/
|
|
4065
|
-
this.isInputValue = (item) => {
|
|
4034
|
+
this.isInputValue = (item) => {
|
|
4035
|
+
if (this.input === undefined)
|
|
4036
|
+
return false;
|
|
4037
|
+
// String items keep native DOM values.
|
|
4038
|
+
if (allItemsAreString(this.items))
|
|
4039
|
+
return item.title === this.input.value;
|
|
4040
|
+
// Object items use stringified values.
|
|
4041
|
+
return toString(item.value) === this.input.value;
|
|
4042
|
+
};
|
|
4066
4043
|
/**
|
|
4067
4044
|
* Handle blur event
|
|
4068
4045
|
*/
|
|
@@ -4107,7 +4084,10 @@ const MgInputSelect = class {
|
|
|
4107
4084
|
* @param option - to render
|
|
4108
4085
|
* @returns render option
|
|
4109
4086
|
*/
|
|
4110
|
-
this.renderOption = (option) =>
|
|
4087
|
+
this.renderOption = (option) => {
|
|
4088
|
+
const serializedValue = allItemsAreString(this.items) ? option.title : toString(option.value);
|
|
4089
|
+
return (h("option", { key: serializedValue, value: serializedValue, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title));
|
|
4090
|
+
};
|
|
4111
4091
|
}
|
|
4112
4092
|
validateValue(newValue) {
|
|
4113
4093
|
setTimeout(() => {
|
|
@@ -4301,7 +4281,7 @@ const MgInputSelect = class {
|
|
|
4301
4281
|
*/
|
|
4302
4282
|
render() {
|
|
4303
4283
|
const readonlyValue = this.getReadonlyValue();
|
|
4304
|
-
return (h("mg-input", { key: '
|
|
4284
|
+
return (h("mg-input", { key: '7d544e8f67a37d5781697da10d3d4f47cc5027e3', 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 && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
4305
4285
|
if (el !== null)
|
|
4306
4286
|
this.input = el;
|
|
4307
4287
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -4717,7 +4697,7 @@ const MgInputText = class {
|
|
|
4717
4697
|
* @returns HTML Element
|
|
4718
4698
|
*/
|
|
4719
4699
|
render() {
|
|
4720
|
-
return (h("mg-input", { key: '
|
|
4700
|
+
return (h("mg-input", { key: '068e38b82ef4e2254fb8d37f21ecf11dc4f3a012', 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
|
|
4721
4701
|
? this.value && this.renderReadonly()
|
|
4722
4702
|
: [
|
|
4723
4703
|
h("div", { key: "input", class: "mg-c-input__input-group-container", style: {
|
|
@@ -5062,7 +5042,7 @@ const MgInputTextarea = class {
|
|
|
5062
5042
|
* @returns HTML Element
|
|
5063
5043
|
*/
|
|
5064
5044
|
render() {
|
|
5065
|
-
return (h("mg-input", { key: '
|
|
5045
|
+
return (h("mg-input", { key: '021aa902aa952730d98fbc2eaa5136975b484319', 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: {
|
|
5066
5046
|
'mg-c-input__box': true,
|
|
5067
5047
|
'mg-c-input__box--width': true,
|
|
5068
5048
|
'mg-c-input__box--resizable': this.resizable === 'both',
|
|
@@ -5432,7 +5412,7 @@ const MgInputToggle = class {
|
|
|
5432
5412
|
*/
|
|
5433
5413
|
render() {
|
|
5434
5414
|
const currentOption = this.options[this.getCurrentOptionIndex(this.value)];
|
|
5435
|
-
return (h("mg-input", { key: '
|
|
5415
|
+
return (h("mg-input", { key: '3f440a16156b4fc89590addba025b350218ccf9c', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (currentOption && h("b", { class: "mg-c-input__readonly-value" }, currentOption.title)) : (h("button", { type: "button", role: "switch", "aria-checked": this.isChecked(this.value).toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.handleSwitchButton, ref: el => {
|
|
5436
5416
|
if (el !== null)
|
|
5437
5417
|
this.button = el;
|
|
5438
5418
|
} }, h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-2" }))))));
|
|
@@ -5782,7 +5762,7 @@ const MgMenu = class {
|
|
|
5782
5762
|
* @returns HTML Element
|
|
5783
5763
|
*/
|
|
5784
5764
|
render() {
|
|
5785
|
-
return (h(Host, { key: '
|
|
5765
|
+
return (h(Host, { key: 'c16a69485fabb9a7a91efe032501fafa98862882', role: "list", "aria-label": this.label }, h("slot", { key: 'f5bca6fdb93d9273e5fcc753d2c58c0a0504c0d0' })));
|
|
5786
5766
|
}
|
|
5787
5767
|
get element() { return getElement(this); }
|
|
5788
5768
|
static get watchers() { return {
|
|
@@ -6294,9 +6274,9 @@ const MgMessage = class {
|
|
|
6294
6274
|
* @returns HTML Element
|
|
6295
6275
|
*/
|
|
6296
6276
|
render() {
|
|
6297
|
-
return (h("div", { key: '
|
|
6277
|
+
return (h("div", { key: 'f99bf527eb2c6005eeaec11f89aaa08f8865ea57', class: this.classCollection.join() }, h("mg-card", { key: 'beede3cd97b022d947c216b6bba454a104ba5790', shadow: true }, this.variantStyle === 'bar-left' && h("span", { key: '515828d725a996c9d57b39ad75e9373150a1b78a', class: "mg-c-message__bar" }), h("span", { key: '02ae41c66af25c2611b9b6cb8c87a1ad99346fa3', class: "mg-c-message__icon" }, h("mg-icon", { key: '3eadb40ed0dfa5ec51155608a67769c5fee3d402', icon: this.getIcon() })), h("div", { key: 'b832251e8f330d00b512bcd508ae9bf6e5f511cb', class: "mg-c-message__content" }, h("span", { key: 'c3520fc49bd5c3c187a83823050ceb9ca8c12d46', class: "mg-c-message__content-slot" }, h("slot", { key: 'f4064dff9536cbb76e45c5c4c1a89621da9531b2' })), this.hasActions && [
|
|
6298
6278
|
h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
|
|
6299
|
-
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '
|
|
6279
|
+
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '5585f7c14c2c3896cfdb5319414cd82f4d4b3a8b', name: "actions" })),
|
|
6300
6280
|
]))));
|
|
6301
6281
|
}
|
|
6302
6282
|
get element() { return getElement(this); }
|
|
@@ -6422,11 +6402,11 @@ const MgModal = class {
|
|
|
6422
6402
|
* @returns HTML Element
|
|
6423
6403
|
*/
|
|
6424
6404
|
render() {
|
|
6425
|
-
return (h("dialog", { key: '
|
|
6405
|
+
return (h("dialog", { key: '2d99322fd3c80b8cbfea70589cf579e0c1c6f06b', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
|
|
6426
6406
|
if (el !== null) {
|
|
6427
6407
|
this.dialog = el;
|
|
6428
6408
|
}
|
|
6429
|
-
} }, h("mg-card", { key: '
|
|
6409
|
+
} }, h("mg-card", { key: '32692a6d41ef30b3d3e61ddcfea47350d374ed09', shadow: true }, h("div", { key: 'c87bb43bb069671b65a9759ee293e77975707597', class: "mg-c-modal__dialog" }, h("header", { key: '1272a946878efcf8c69f3b09852ba6938cbe31b0', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: '0704656c7c5ac4c8d405f2cd673e91f72763ee8f', class: "mg-c-modal__close-button" }, h("mg-button", { key: '4402971c763ee34145de5bd69d367fde68f9d1a2', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '9e16add6a3e387971507a252671c895b6c94a586', icon: "cross" })))), h("h1", { key: '3e4fc2b4419398528565d382b728b8b752758ddd', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '170ff6bd9592687baa4c561615f540ad1c7400e4', class: "mg-c-modal__content" }, h("slot", { key: 'cb710e2a57e4c997deac367169b56047af1200b1' })), this.hasActions && (h("footer", { key: '1e08d67caeaaaf75eb97faa11528719ea537c24c', class: "mg-c-modal__footer" }, h("slot", { key: '461ec8e4117477aef08dc6d346ad0bf6007ec12d', name: "actions" })))))));
|
|
6430
6410
|
}
|
|
6431
6411
|
get element() { return getElement(this); }
|
|
6432
6412
|
static get watchers() { return {
|
|
@@ -6838,7 +6818,7 @@ const MgPanel = class {
|
|
|
6838
6818
|
*/
|
|
6839
6819
|
render() {
|
|
6840
6820
|
const headerId = `${this.identifier}-header`;
|
|
6841
|
-
return (h("section", { key: '
|
|
6821
|
+
return (h("section", { key: '3662204d763051c34ea13de4b7b3f7abc7914b81', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '46f113258172b1d040f65a4d312554b0c0551489', shadow: this.shadow }, h("header", { key: '1d7e7a48a5c4f89d141a5a7e46b220d4f9c082a5', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: 'ab0aec831cc79d982b7556d6e245c80ae2979083', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: 'e831573fe9d5ff783073d123b7e2a54baad73bfc' })))));
|
|
6842
6822
|
}
|
|
6843
6823
|
get element() { return getElement(this); }
|
|
6844
6824
|
static get watchers() { return {
|
|
@@ -8900,7 +8880,7 @@ const MgPopover = class {
|
|
|
8900
8880
|
* @returns HTML Element
|
|
8901
8881
|
*/
|
|
8902
8882
|
render() {
|
|
8903
|
-
return (h(Host, { key: '
|
|
8883
|
+
return (h(Host, { key: '2c1506b8e2da100519aeeae75fc5c378a81c473c' }, h("slot", { key: 'f9aea885e8cbc168614c05761829f0a0740eba9e' }), h("slot", { key: 'fa6106a660a73b3761d4783f8d46d401c47b4eb6', name: "content" })));
|
|
8904
8884
|
}
|
|
8905
8885
|
get element() { return getElement(this); }
|
|
8906
8886
|
static get watchers() { return {
|
|
@@ -8966,7 +8946,7 @@ const MgPopoverContent = class {
|
|
|
8966
8946
|
* @returns HTML Element
|
|
8967
8947
|
*/
|
|
8968
8948
|
render() {
|
|
8969
|
-
return (h(Host, { key: '
|
|
8949
|
+
return (h(Host, { key: '054fc82954b39a488f7fe5cb391d89b5fa4a61fe' }, h("mg-card", { key: 'bb89bada37069b50295bd93d988667c3b85eada3', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'a59d6610574b964be1e2ce34ccd8e31c1395b6ff', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '5bcc9e4eb21396f4fc66a6f1e4d6c5cdf68ec1f4', icon: "cross" }))), h("div", { key: '57be2022f3b61220e1249faeaf2acee9960027fe', class: "mg-c-popover-content__title" }, h("slot", { key: 'c7870e86a9f105cf6b9d4520c77874bce9235d72', name: "title" })), h("slot", { key: '5af8462232625d9c7d694bab46351d5e646f62ca', name: "content" })), h("slot", { key: '599863410dd7d751e82c440cd6c4fb7f2c48d9f3', name: "arrow" })));
|
|
8970
8950
|
}
|
|
8971
8951
|
get element() { return getElement(this); }
|
|
8972
8952
|
};
|
|
@@ -9011,7 +8991,7 @@ const MgSkipLinks = class {
|
|
|
9011
8991
|
* @returns HTML Element
|
|
9012
8992
|
*/
|
|
9013
8993
|
render() {
|
|
9014
|
-
return (h("nav", { key: '
|
|
8994
|
+
return (h("nav", { key: '5bf4427662bdca6512969bee91aa03f43a126743', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: '1d2b2a56b3960f70a3d37b333c77bf686643e0fd', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
9015
8995
|
}
|
|
9016
8996
|
get element() { return getElement(this); }
|
|
9017
8997
|
static get watchers() { return {
|
|
@@ -9545,7 +9525,7 @@ const MgTabs = class {
|
|
|
9545
9525
|
* @returns HTML Element
|
|
9546
9526
|
*/
|
|
9547
9527
|
render() {
|
|
9548
|
-
return (h("div", { key: '
|
|
9528
|
+
return (h("div", { key: 'c58c255ddffc83ad6d911d37f626bcadaea61747', class: this.classCollection.join() }, h("header", { key: 'ba6d581a4a8bc4338d6341372c267a28df882113', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
9549
9529
|
[`${this.buttonTabBaseClass}`]: true,
|
|
9550
9530
|
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
9551
9531
|
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|
|
@@ -10084,4 +10064,4 @@ const MgTooltipContent = class {
|
|
|
10084
10064
|
};
|
|
10085
10065
|
MgTooltipContent.style = mgTooltipContentCss();
|
|
10086
10066
|
|
|
10087
|
-
export { MgActionMore as mg_action_more, MgBadge as mg_badge, MgButton as mg_button, MgCard as mg_card, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgDivider as mg_divider, MgForm as mg_form, MgIcon as mg_icon, MgIllustratedMessage as mg_illustrated_message, MgInput as mg_input, MgInputCheckbox as mg_input_checkbox,
|
|
10067
|
+
export { MgActionMore as mg_action_more, MgBadge as mg_badge, MgButton as mg_button, MgCard as mg_card, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgDivider as mg_divider, MgForm as mg_form, MgIcon as mg_icon, MgIllustratedMessage as mg_illustrated_message, MgInput as mg_input, MgInputCheckbox as mg_input_checkbox, MgInputDate as mg_input_date, MgInputNumeric as mg_input_numeric, MgInputPassword as mg_input_password, MgInputRadio as mg_input_radio, MgInputSelect as mg_input_select, MgInputText as mg_input_text, MgInputTextarea as mg_input_textarea, MgInputTitle as mg_input_title, MgInputToggle as mg_input_toggle, MgItemMore as mg_item_more, MgMenu as mg_menu, MgMenuItem as mg_menu_item, MgMessage as mg_message, MgModal as mg_modal, MgPagination as mg_pagination, MgPanel as mg_panel, MgPopover as mg_popover, MgPopoverContent as mg_popover_content, MgSkipLinks as mg_skip_links, MgTable as mg_table, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip, MgTooltipContent as mg_tooltip_content };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, f as forceUpdate, h, a as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, a as getElement } from './index-C3jUhxdI.js';
|
|
2
2
|
import { C as ClassList, t as toString } from './index-C7xjtdiw.js';
|
|
3
3
|
import { i as initLocales } from './index-DSEloqPn.js';
|
|
4
4
|
|
|
@@ -153,7 +153,7 @@ const MgAlert = class {
|
|
|
153
153
|
* @returns HTML Element
|
|
154
154
|
*/
|
|
155
155
|
render() {
|
|
156
|
-
return (h("mg-message", { key: '
|
|
156
|
+
return (h("mg-message", { key: '9041d8643bf4d0d44f20d30ac3c1d9aa46d6e060', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '94d1a430e9af605fa2ea2b557e82fc15f1cc148b' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
|
|
157
157
|
}
|
|
158
158
|
get element() { return getElement(this); }
|
|
159
159
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, a as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, a as getElement } from './index-C3jUhxdI.js';
|
|
2
2
|
import { i as initLocales } from './index-DSEloqPn.js';
|
|
3
3
|
import { t as toString, i as isValidString } from './index-C7xjtdiw.js';
|
|
4
4
|
|
|
@@ -44,7 +44,7 @@ const MgBreadcrumb = class {
|
|
|
44
44
|
this.messages = initLocales(this.element).messages.breadcrumb;
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h("nav", { key: '
|
|
47
|
+
return (h("nav", { key: 'af5c541e6a268af67762eb9d384269511fe0be17', "aria-label": this.messages.label, class: "mg-c-breadcrumb" }, h("ol", { key: 'b5fdfe61eb2c826b3462bdd65cacfb73d4f00484', class: "mg-c-breadcrumb__list" }, this.items.map((item, index) => {
|
|
48
48
|
var _a;
|
|
49
49
|
return (h("li", { key: `${index}-${(_a = item.href) !== null && _a !== void 0 ? _a : item.label}`, class: "mg-c-breadcrumb__list-item" }, this.renderItem(item, index === this.items.length - 1)));
|
|
50
50
|
}))));
|