@mgdis/mg-components 5.5.0 → 5.7.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-c3450336.js → index-5e7ede97.js} +120 -4
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +1223 -547
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +13 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -4
- package/dist/collection/components/atoms/mg-button/mg-button.css +9 -22
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +38 -28
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +4 -4
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +14 -17
- package/dist/collection/components/molecules/inputs/MgInput.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -4
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +17 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +27 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +141 -19
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +0 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +48 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +139 -71
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.css +38 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +252 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -3
- package/dist/collection/components/molecules/mg-message/mg-message.css +7 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +54 -13
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +64 -7
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +33 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +12 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +105 -57
- package/dist/collection/locales/en/messages.json +10 -1
- package/dist/collection/locales/fr/messages.json +10 -1
- package/dist/collection/locales/index.js +3 -26
- package/dist/collection/styles/a11y.scss +32 -0
- package/dist/collection/styles/components.scss +3 -0
- package/dist/collection/styles/fonts.scss +21 -0
- package/dist/collection/styles/form.scss +3 -0
- package/dist/collection/styles/global.scss +87 -0
- package/dist/collection/styles/layout.scss +29 -0
- package/dist/collection/styles/main.scss +23 -0
- package/dist/collection/styles/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +77 -0
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/collection/styles/typography.scss +75 -0
- package/dist/collection/styles/utilities.scss +21 -0
- package/dist/collection/utils/behaviors.utils.js +151 -0
- package/dist/collection/utils/components.utils.js +52 -0
- package/dist/collection/utils/locale.utils.js +28 -6
- package/dist/collection/utils/unit.test.utils.js +65 -32
- package/dist/collection/variables.css +11 -10
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +53 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index2.js +79 -20
- package/dist/components/mg-action-more.d.ts +11 -0
- package/dist/components/mg-action-more.js +215 -0
- package/dist/components/mg-badge2.js +5 -5
- package/dist/components/mg-button2.js +2 -2
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +41 -31
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +7 -5
- package/dist/components/mg-input-numeric.js +3 -4
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +2 -2
- package/dist/components/mg-input-select2.js +9 -5
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +2 -2
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-menu-item.js +1 -253
- package/dist/components/mg-menu-item2.js +520 -0
- package/dist/components/mg-menu.js +1 -129
- package/dist/components/mg-menu2.js +247 -0
- package/dist/components/mg-message.js +55 -14
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +3 -3
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +226 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +104 -55
- package/dist/components/mg-tag.js +5 -5
- package/dist/components/mg-tooltip2.js +15 -18
- package/dist/esm/{index-78edde1d.js → index-03cceb11.js} +120 -5
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +1223 -548
- package/dist/esm/mg-components.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +10 -1
- package/dist/mg-components/locales/fr/messages.json +10 -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-4cfd5423.entry.js +1 -0
- package/dist/mg-components/p-e126dd84.js +2 -0
- package/dist/mg-components/styles/a11y.scss +32 -0
- package/dist/mg-components/styles/components.scss +3 -0
- package/dist/mg-components/styles/fonts.scss +21 -0
- package/dist/mg-components/styles/form.scss +3 -0
- package/dist/mg-components/styles/global.scss +87 -0
- package/dist/mg-components/styles/layout.scss +29 -0
- package/dist/mg-components/styles/main.scss +23 -0
- package/dist/mg-components/styles/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +77 -0
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/mg-components/styles/typography.scss +75 -0
- package/dist/mg-components/styles/utilities.scss +21 -0
- package/dist/mg-components/variables.css +11 -10
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +37 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +51 -3
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +0 -8
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +61 -15
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +42 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +81 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +13 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +15 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +22 -12
- package/dist/types/components.d.ts +98 -12
- package/dist/types/locales/index.d.ts +21 -10
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/behaviors.utils.d.ts +77 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +16 -3
- package/dist/types/utils/unit.test.utils.d.ts +68 -14
- package/loader/index.d.ts +9 -0
- package/package.json +28 -27
- package/readme.md +22 -31
- package/dist/.storybook/utils.js +0 -24
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -27
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -38
- package/dist/collection/components/atoms/mg-card/doc/mg-card.stories.js +0 -18
- package/dist/collection/components/atoms/mg-character-left/doc/mg-character-left.stories.js +0 -20
- package/dist/collection/components/atoms/mg-divider/doc/mg-divider.stories.js +0 -18
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +0 -41
- package/dist/collection/components/atoms/mg-input-title/doc/mg-input-title.stories.js +0 -21
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +0 -22
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +0 -43
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +0 -68
- package/dist/collection/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.js +0 -46
- package/dist/collection/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.js +0 -59
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +0 -77
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +0 -110
- package/dist/collection/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.js +0 -54
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +0 -51
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +0 -87
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -39
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +0 -24
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +0 -47
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +0 -19
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +0 -39
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +0 -39
- package/dist/collection/components/molecules/mg-pagination/doc/mg-pagination.stories.js +0 -20
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +0 -22
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +0 -34
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +0 -24
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +0 -51
- package/dist/collection/stories/grids.stories.js +0 -7
- package/dist/collection/stories/helpers.stories.js +0 -23
- package/dist/collection/stories/icons.stories.js +0 -25
- package/dist/collection/stories/typography.stories.js +0 -24
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-125c54ca.js +0 -2
- package/dist/mg-components/p-4961c96c.entry.js +0 -1
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -16
- package/dist/types/components/atoms/mg-card/doc/mg-card.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-character-left/doc/mg-character-left.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-divider/doc/mg-divider.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-icon/doc/mg-icon.stories.d.ts +0 -26
- package/dist/types/components/atoms/mg-input-title/doc/mg-input-title.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.d.ts +0 -32
- package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +0 -22
- package/dist/types/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.d.ts +0 -20
- package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +0 -34
- package/dist/types/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.d.ts +0 -39
- package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +0 -19
- package/dist/types/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.d.ts +0 -12
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +0 -17
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +0 -12
- package/dist/types/components/molecules/mg-details/doc/mg-details.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-form/doc/mg-form.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.d.ts +0 -6
- package/dist/types/components/molecules/mg-message/doc/mg-message.stories.d.ts +0 -26
- package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +0 -13
- package/dist/types/components/molecules/mg-pagination/doc/mg-pagination.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +0 -22
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +0 -20
- package/dist/types/home/runner/work/mg-components/mg-components/.stencil/.storybook/utils.d.ts +0 -1
- package/dist/types/stories/grids.stories.d.ts +0 -5
- package/dist/types/stories/helpers.stories.d.ts +0 -13
- package/dist/types/stories/icons.stories.d.ts +0 -13
- package/dist/types/stories/typography.stories.d.ts +0 -5
|
@@ -2,12 +2,273 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-5e7ede97.js');
|
|
6
|
+
|
|
7
|
+
const errors$1 = {
|
|
8
|
+
required: "This field is required.",
|
|
9
|
+
date: {
|
|
10
|
+
badInput: "The date format must be <span aria-hidden=\"true\">mm/dd/yyyy</span><span class=\"sr-only\">m m / d d / y y y y</span> and the date must be greater than {min}",
|
|
11
|
+
min: "The date cannot be earlier than {min}",
|
|
12
|
+
max: "The date cannot be later than {max}",
|
|
13
|
+
minMax: "The date must be between {min} and {max}"
|
|
14
|
+
},
|
|
15
|
+
numeric: {
|
|
16
|
+
min: "The value cannot be less than {min}",
|
|
17
|
+
max: "The value cannot be greater than {max}",
|
|
18
|
+
minMax: "The value must be between {min} et {max}"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const nbCharLeft$1 = "{counter} characters left.";
|
|
22
|
+
const input$1 = {
|
|
23
|
+
select: {
|
|
24
|
+
placeholder: "Select a value"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const form$1 = {
|
|
28
|
+
required: "Fields with a <strong class=\"is-asterisk\">*</strong> are required",
|
|
29
|
+
requiredSingle: "Field with a <strong class=\"is-asterisk\">*</strong> is required",
|
|
30
|
+
allRequired: "All fields are required",
|
|
31
|
+
allRequiredSingle: "The field is required"
|
|
32
|
+
};
|
|
33
|
+
const message$1 = {
|
|
34
|
+
closeButton: "Close message"
|
|
35
|
+
};
|
|
36
|
+
const modal$1 = {
|
|
37
|
+
closeButton: "Close modal"
|
|
38
|
+
};
|
|
39
|
+
const pagination$1 = {
|
|
40
|
+
label: "Pagination",
|
|
41
|
+
page: "page",
|
|
42
|
+
pages: "pages",
|
|
43
|
+
nextPage: "Next page",
|
|
44
|
+
previousPage: "Previous page",
|
|
45
|
+
selectPage: "Select the page to display."
|
|
46
|
+
};
|
|
47
|
+
const panel$1 = {
|
|
48
|
+
editLabel: "Edit section title."
|
|
49
|
+
};
|
|
50
|
+
const skipLinks$1 = {
|
|
51
|
+
navLabel: "Quick access"
|
|
52
|
+
};
|
|
53
|
+
const general$1 = {
|
|
54
|
+
confirm: "Confirm",
|
|
55
|
+
cancel: "Cancel",
|
|
56
|
+
close: "Close",
|
|
57
|
+
next: "next",
|
|
58
|
+
previous: "previous"
|
|
59
|
+
};
|
|
60
|
+
const plusMenu$1 = {
|
|
61
|
+
moreLabel: "Additional menu",
|
|
62
|
+
badgeLabel: "Include notification(s)"
|
|
63
|
+
};
|
|
64
|
+
const actionMore$1 = {
|
|
65
|
+
label: "Actions"
|
|
66
|
+
};
|
|
67
|
+
const en = {
|
|
68
|
+
errors: errors$1,
|
|
69
|
+
nbCharLeft: nbCharLeft$1,
|
|
70
|
+
input: input$1,
|
|
71
|
+
form: form$1,
|
|
72
|
+
message: message$1,
|
|
73
|
+
modal: modal$1,
|
|
74
|
+
pagination: pagination$1,
|
|
75
|
+
panel: panel$1,
|
|
76
|
+
skipLinks: skipLinks$1,
|
|
77
|
+
general: general$1,
|
|
78
|
+
plusMenu: plusMenu$1,
|
|
79
|
+
actionMore: actionMore$1
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const errors = {
|
|
83
|
+
required: "Ce champ est obligatoire.",
|
|
84
|
+
date: {
|
|
85
|
+
badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"sr-only\">j j / m m / a a a a</span> et la date supérieure au {min}",
|
|
86
|
+
min: "La date ne peut pas être antérieure au {min}",
|
|
87
|
+
max: "La date ne peut pas être postérieure au {max}",
|
|
88
|
+
minMax: "La date doit être comprise entre le {min} et le {max}"
|
|
89
|
+
},
|
|
90
|
+
numeric: {
|
|
91
|
+
min: "La valeur ne peut pas être inférieure à {min}",
|
|
92
|
+
max: "La valeur ne peut pas être supérieure à {max}",
|
|
93
|
+
minMax: "La valeur doit être comprise entre {min} et {max}"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const nbCharLeft = "{counter} caractères disponibles.";
|
|
97
|
+
const input = {
|
|
98
|
+
select: {
|
|
99
|
+
placeholder: "Sélectionnez une valeur"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const form = {
|
|
103
|
+
required: "Les champs marqués d'un <strong class=\"is-asterisk\">*</strong> sont obligatoires",
|
|
104
|
+
requiredSingle: "Le champ marqué d'un <strong class=\"is-asterisk\">*</strong> est obligatoire",
|
|
105
|
+
allRequired: "Tous les champs sont obligatoires",
|
|
106
|
+
allRequiredSingle: "Le champ est obligatoire"
|
|
107
|
+
};
|
|
108
|
+
const message = {
|
|
109
|
+
closeButton: "Fermer le message"
|
|
110
|
+
};
|
|
111
|
+
const modal = {
|
|
112
|
+
closeButton: "Fermer la modale"
|
|
113
|
+
};
|
|
114
|
+
const pagination = {
|
|
115
|
+
label: "Pagination",
|
|
116
|
+
page: "page",
|
|
117
|
+
pages: "pages",
|
|
118
|
+
nextPage: "Page suivante",
|
|
119
|
+
previousPage: "Page précédente",
|
|
120
|
+
selectPage: "Sélectionner la page à afficher."
|
|
121
|
+
};
|
|
122
|
+
const panel = {
|
|
123
|
+
editLabel: "Modifier le titre de la section."
|
|
124
|
+
};
|
|
125
|
+
const skipLinks = {
|
|
126
|
+
navLabel: "Accès rapide"
|
|
127
|
+
};
|
|
128
|
+
const general = {
|
|
129
|
+
confirm: "Valider",
|
|
130
|
+
cancel: "Annuler",
|
|
131
|
+
close: "Fermer",
|
|
132
|
+
next: "suivant",
|
|
133
|
+
previous: "précédent"
|
|
134
|
+
};
|
|
135
|
+
const plusMenu = {
|
|
136
|
+
moreLabel: "Menu complémentaire",
|
|
137
|
+
badgeLabel: "Notification(s) incluse(s)"
|
|
138
|
+
};
|
|
139
|
+
const actionMore = {
|
|
140
|
+
label: "Actions"
|
|
141
|
+
};
|
|
142
|
+
const fr = {
|
|
143
|
+
errors: errors,
|
|
144
|
+
nbCharLeft: nbCharLeft,
|
|
145
|
+
input: input,
|
|
146
|
+
form: form,
|
|
147
|
+
message: message,
|
|
148
|
+
modal: modal,
|
|
149
|
+
pagination: pagination,
|
|
150
|
+
panel: panel,
|
|
151
|
+
skipLinks: skipLinks,
|
|
152
|
+
general: general,
|
|
153
|
+
plusMenu: plusMenu,
|
|
154
|
+
actionMore: actionMore
|
|
155
|
+
};
|
|
6
156
|
|
|
7
157
|
/**
|
|
8
|
-
*
|
|
158
|
+
* Format number to the locale currency
|
|
159
|
+
*
|
|
160
|
+
* @param {number} number number to format
|
|
161
|
+
* @param {string} locale locale to apply
|
|
162
|
+
* @param {string} currency currency to apply
|
|
163
|
+
* @returns {string} formatted currency
|
|
164
|
+
*/
|
|
165
|
+
const localeCurrency = (number, locale, currency) => {
|
|
166
|
+
return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Format number to locale
|
|
170
|
+
*
|
|
171
|
+
* @param {number} number number to format
|
|
172
|
+
* @param {string} locale locale to apply
|
|
173
|
+
* @returns {string} formatted number
|
|
174
|
+
*/
|
|
175
|
+
const localeNumber = (number, locale) => {
|
|
176
|
+
return new Intl.NumberFormat(locale).format(number);
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Date RegExp
|
|
180
|
+
*/
|
|
181
|
+
const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
|
|
182
|
+
/**
|
|
183
|
+
* Locale date format
|
|
184
|
+
*
|
|
185
|
+
* @param {string} date date to format
|
|
186
|
+
* @param {string} locale locale to apply
|
|
187
|
+
* @returns {string} formatted date
|
|
188
|
+
*/
|
|
189
|
+
const localeDate = (date, locale) => {
|
|
190
|
+
if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
|
|
191
|
+
return '';
|
|
192
|
+
}
|
|
193
|
+
return new Intl.DateTimeFormat(locale).format(new Date(date));
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Get locale and messages
|
|
197
|
+
* We load the defined locale but for now we only support the first subtag for messages
|
|
198
|
+
*
|
|
199
|
+
* @param {HTMLElement} element element we need to get the language
|
|
200
|
+
* @param {unknown} messages messages to use
|
|
201
|
+
* @param {string} defaultLocale default messages locale
|
|
202
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
203
|
+
*/
|
|
204
|
+
const getLocaleMessages = (element, messages, defaultLocale) => {
|
|
205
|
+
// Get local
|
|
206
|
+
const closestLangAttribute = element.closest('[lang]');
|
|
207
|
+
const closestLang = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute === null || closestLangAttribute === void 0 ? void 0 : closestLangAttribute.lang);
|
|
208
|
+
const locale = closestLang.length > 0 ? closestLang[0] : navigator.language || defaultLocale;
|
|
209
|
+
// Only keep first subtag
|
|
210
|
+
const localeSubtag = locale.split('-').shift();
|
|
211
|
+
// Return
|
|
212
|
+
return {
|
|
213
|
+
locale,
|
|
214
|
+
messages: messages[localeSubtag] || messages[defaultLocale],
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const defaultLocale = 'en';
|
|
219
|
+
const messages = { en, fr };
|
|
220
|
+
/**
|
|
221
|
+
* Get Intl object
|
|
222
|
+
*
|
|
223
|
+
* @param {HTMLElement} element element we need to get the language
|
|
224
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
225
|
+
*/
|
|
226
|
+
const initLocales = (element) => getLocaleMessages(element, messages, defaultLocale);
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Available menu-item positions
|
|
230
|
+
*/
|
|
231
|
+
var ElementPosition;
|
|
232
|
+
(function (ElementPosition) {
|
|
233
|
+
ElementPosition["FIRST"] = "first";
|
|
234
|
+
ElementPosition["LAST"] = "last";
|
|
235
|
+
})(ElementPosition || (ElementPosition = {}));
|
|
236
|
+
/**
|
|
237
|
+
* Available menu item status
|
|
238
|
+
*/
|
|
239
|
+
var Status$1;
|
|
240
|
+
(function (Status) {
|
|
241
|
+
Status["VISIBLE"] = "visible";
|
|
242
|
+
Status["HIDDEN"] = "hidden";
|
|
243
|
+
Status["DISABLED"] = "disabled";
|
|
244
|
+
Status["ACTIVE"] = "active";
|
|
245
|
+
})(Status$1 || (Status$1 = {}));
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Menu direction type
|
|
249
|
+
*/
|
|
250
|
+
var Direction;
|
|
251
|
+
(function (Direction) {
|
|
252
|
+
Direction["VERTICAL"] = "vertical";
|
|
253
|
+
Direction["HORIZONTAL"] = "horizontal";
|
|
254
|
+
})(Direction || (Direction = {}));
|
|
255
|
+
/**
|
|
256
|
+
* More item type guard
|
|
257
|
+
*
|
|
258
|
+
* @param {unknown} element element to control
|
|
259
|
+
* @returns {boolean} truthy if element is more-item
|
|
260
|
+
*/
|
|
261
|
+
const isMoreItem = (element) => {
|
|
262
|
+
var _a, _b, _c;
|
|
263
|
+
const item = element;
|
|
264
|
+
return (item === undefined ||
|
|
265
|
+
(typeof item === 'object' &&
|
|
266
|
+
(typeof item.size === 'string' || typeof ((_a = item.mgIcon) === null || _a === void 0 ? void 0 : _a.icon) === 'string' || typeof ((_b = item.slotLabel) === null || _b === void 0 ? void 0 : _b.label) === 'string' || typeof ((_c = item.slotLabel) === null || _c === void 0 ? void 0 : _c.display) === 'boolean')));
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* List of all possibles sizes
|
|
9
270
|
*/
|
|
10
|
-
const
|
|
271
|
+
const sizes$2 = ['regular', 'medium', 'large'];
|
|
11
272
|
|
|
12
273
|
/**
|
|
13
274
|
* Create random ID
|
|
@@ -97,8 +358,208 @@ const isTagName = (element, tagNames) => {
|
|
|
97
358
|
* Focusable elements query selector
|
|
98
359
|
*/
|
|
99
360
|
const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier]';
|
|
361
|
+
/**
|
|
362
|
+
*
|
|
363
|
+
* @param {Window} localWindow the window we are lookink for other windows
|
|
364
|
+
* @returns {Window[]} The list of windows found
|
|
365
|
+
*/
|
|
366
|
+
const getWindows = (localWindow) => {
|
|
367
|
+
const parentWindows = getParentWindows(localWindow);
|
|
368
|
+
const childWindows = getChildWindows(localWindow);
|
|
369
|
+
return [localWindow, ...parentWindows, ...childWindows];
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Get parent windows
|
|
373
|
+
*
|
|
374
|
+
* @param {Window} localWindow the window we are lookink for parents
|
|
375
|
+
* @param {Window[]} windows The list of allready found windows
|
|
376
|
+
* @returns {Window[]} The list of windows found
|
|
377
|
+
*/
|
|
378
|
+
const getParentWindows = (localWindow, windows = []) => {
|
|
379
|
+
// Check if is in iframe
|
|
380
|
+
if (localWindow.self !== localWindow.top) {
|
|
381
|
+
// Check if we have permission to access parent
|
|
382
|
+
try {
|
|
383
|
+
const parentWindow = localWindow.parent;
|
|
384
|
+
windows.push(parentWindow);
|
|
385
|
+
return getParentWindows(parentWindow, windows);
|
|
386
|
+
}
|
|
387
|
+
catch (err) {
|
|
388
|
+
console.error('Different hosts between iframes:', err);
|
|
389
|
+
return windows;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return windows;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Get child windows
|
|
396
|
+
*
|
|
397
|
+
* @param {Window} localWindow the window we are lookink for children
|
|
398
|
+
* @param {Window[]} windows The list of allready found windows
|
|
399
|
+
* @returns {Window[]} The list of windows found
|
|
400
|
+
*/
|
|
401
|
+
const getChildWindows = (localWindow, windows = []) => {
|
|
402
|
+
if (localWindow.frames.length > 0) {
|
|
403
|
+
// Window.frames is an array-like object, needs a classic for loop
|
|
404
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
|
|
405
|
+
for (let i = 0; i < localWindow.frames.length; i++) {
|
|
406
|
+
const childWindow = localWindow.frames[i];
|
|
407
|
+
windows.push(childWindow);
|
|
408
|
+
getChildWindows(childWindow, windows);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return windows;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
const mgActionMoreCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}:host{--mg-popover-padding-vertical:1rem;--mg-popover-padding-horizontal:0}.mg-action-more__chevron{transition:200ms}.mg-action-more__chevron--rotate.mg-action-more__chevron{transform:rotate(180deg)}";
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* MgActionMore['items'] type guard
|
|
418
|
+
*
|
|
419
|
+
* @param {unknown} prop commponent items prop
|
|
420
|
+
* @returns {boolean} return true if type is valid
|
|
421
|
+
*/
|
|
422
|
+
const isMgActionMoreItems = (prop) => {
|
|
423
|
+
const items = prop;
|
|
424
|
+
return typeof items === 'object' && items.every(item => typeof item === 'object' && typeof item.label === 'string' && typeof item.mouseEventHandler === 'function');
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* MgActionMore['button'] type guard
|
|
428
|
+
*
|
|
429
|
+
* @param {unknown} prop commponent button prop
|
|
430
|
+
* @returns {boolean} return true if type is valid
|
|
431
|
+
*/
|
|
432
|
+
const isMgActionMoreButton = (prop) => {
|
|
433
|
+
const button = prop;
|
|
434
|
+
return typeof button === 'object' && typeof button.variant === 'string' && typeof button.isIcon === 'boolean';
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* MgActionMore['icon'] type guard
|
|
438
|
+
*
|
|
439
|
+
* @param {unknown} prop commponent icon prop
|
|
440
|
+
* @returns {boolean} return true if type is valid
|
|
441
|
+
*/
|
|
442
|
+
const isMgActionMoreIcon = (prop) => {
|
|
443
|
+
const icon = prop;
|
|
444
|
+
return typeof icon === 'object' && typeof icon.icon === 'string';
|
|
445
|
+
};
|
|
446
|
+
const MgActionMore = class {
|
|
447
|
+
constructor(hostRef) {
|
|
448
|
+
index.registerInstance(this, hostRef);
|
|
449
|
+
/************
|
|
450
|
+
* Internal *
|
|
451
|
+
************/
|
|
452
|
+
this.name = 'mg-action-more';
|
|
453
|
+
this.mgPopoverIdentifier = createID(this.name);
|
|
454
|
+
/************
|
|
455
|
+
* Merthods *
|
|
456
|
+
***********/
|
|
457
|
+
/**
|
|
458
|
+
* Toogle expanded props
|
|
459
|
+
*
|
|
460
|
+
* @returns {void}
|
|
461
|
+
*/
|
|
462
|
+
this.toggleExpanded = () => {
|
|
463
|
+
this.expanded = !this.expanded;
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Button click handler
|
|
467
|
+
*
|
|
468
|
+
* @returns {void}
|
|
469
|
+
*/
|
|
470
|
+
this.handleButton = () => {
|
|
471
|
+
this.toggleExpanded();
|
|
472
|
+
};
|
|
473
|
+
/**
|
|
474
|
+
* Item click handler
|
|
475
|
+
*
|
|
476
|
+
* @param {MouseEvent} event click event
|
|
477
|
+
* @param {MgActionMoreItemType['mouseEventHandler']} customHandler item['mouseEventHandler']
|
|
478
|
+
* @returns {void}
|
|
479
|
+
*/
|
|
480
|
+
this.handleItemClick = (event, customHandler) => {
|
|
481
|
+
this.expanded = false;
|
|
482
|
+
customHandler(event);
|
|
483
|
+
};
|
|
484
|
+
this.icon = { icon: 'ellipsis' };
|
|
485
|
+
this.button = { variant: 'flat', isIcon: true };
|
|
486
|
+
this.items = undefined;
|
|
487
|
+
this.displayChevron = undefined;
|
|
488
|
+
this.expanded = false;
|
|
489
|
+
}
|
|
490
|
+
validateIcon(newValue) {
|
|
491
|
+
if (newValue && !isMgActionMoreIcon(newValue)) {
|
|
492
|
+
throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
validateButton(newValue) {
|
|
496
|
+
if (newValue && !isMgActionMoreButton(newValue)) {
|
|
497
|
+
throw new Error(`<${this.name}> prop button must match MgActionMoreButtonType.`);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
validateItems(newValue) {
|
|
501
|
+
if (!isMgActionMoreItems(newValue)) {
|
|
502
|
+
throw new Error(`<${this.name}> prop "items" is required and all values must be the same type, MgActionMoreItemType.`);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
validateDisplayChevron(newValue) {
|
|
506
|
+
if (newValue && this.button.isIcon === true) {
|
|
507
|
+
throw new Error(`<${this.name}> prop "displayChevron" can't be used with a 'button" prop "isIcon" attribute.`);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/*************
|
|
511
|
+
* Lifecycle *
|
|
512
|
+
*************/
|
|
513
|
+
/**
|
|
514
|
+
* Validate props
|
|
515
|
+
*
|
|
516
|
+
* @returns {void}
|
|
517
|
+
*/
|
|
518
|
+
componentWillLoad() {
|
|
519
|
+
this.messages = initLocales(this.element).messages.actionMore;
|
|
520
|
+
this.validateItems(this.items);
|
|
521
|
+
this.validateButton(this.button);
|
|
522
|
+
this.validateIcon(this.icon);
|
|
523
|
+
this.validateDisplayChevron(this.displayChevron);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Render
|
|
527
|
+
*
|
|
528
|
+
* @returns {HTMLElement} HTML Element
|
|
529
|
+
*/
|
|
530
|
+
render() {
|
|
531
|
+
const buttonLabel = this.button.label || this.messages.label;
|
|
532
|
+
const buttonContent = [buttonLabel];
|
|
533
|
+
if (!this.button.isIcon && this.displayChevron) {
|
|
534
|
+
buttonContent.push(index.h("span", { class: {
|
|
535
|
+
[`${this.name}__chevron`]: true,
|
|
536
|
+
[`${this.name}__chevron--rotate`]: this.expanded === true,
|
|
537
|
+
'mg-a11y-animation': true,
|
|
538
|
+
} }, index.h("mg-icon", { icon: "chevron-down", size: "small" })));
|
|
539
|
+
}
|
|
540
|
+
return (index.h(index.Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, index.h("span", { class: "mg-action-more" }, index.h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded }, index.h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, type: "button", label: buttonLabel, onClick: this.handleButton }, index.h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), index.h("div", { slot: "content" }, index.h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
541
|
+
var _a;
|
|
542
|
+
return (
|
|
543
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
544
|
+
index.h("mg-menu-item", { key: item.label, status: item.status || Status$1.VISIBLE, onClick: e => this.handleItemClick(e, item.mouseEventHandler), href: item.href }, item.icon && index.h("mg-icon", { icon: item.icon, slot: "image" }), index.h("span", { slot: "label" }, item.label), ((_a = item.badge) === null || _a === void 0 ? void 0 : _a.label) && index.h("mg-badge", { label: item.badge.label, value: item.badge.value, slot: "information", variant: "text-color" })));
|
|
545
|
+
})))))));
|
|
546
|
+
}
|
|
547
|
+
get element() { return index.getElement(this); }
|
|
548
|
+
static get watchers() { return {
|
|
549
|
+
"icon": ["validateIcon"],
|
|
550
|
+
"button": ["validateButton"],
|
|
551
|
+
"items": ["validateItems"],
|
|
552
|
+
"displayChevron": ["validateDisplayChevron"]
|
|
553
|
+
}; }
|
|
554
|
+
};
|
|
555
|
+
MgActionMore.style = mgActionMoreCss;
|
|
100
556
|
|
|
101
|
-
|
|
557
|
+
/**
|
|
558
|
+
* List of all possibles variants
|
|
559
|
+
*/
|
|
560
|
+
const variants$4 = ['info', 'primary', 'secondary', 'success', 'warning', 'danger', 'text-color'];
|
|
561
|
+
|
|
562
|
+
const mgBadgeCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-badge{padding:0 0.4rem;height:var(--mg-badge-size);min-width:var(--mg-badge-size);box-sizing:border-box;border:0.1rem solid;border-radius:calc(var(--mg-badge-size) / 2);font-size:var(--mg-badge-font-size);font-weight:600;text-align:center;line-height:var(--mg-badge-size)}.mg-badge.mg-badge--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-badge.mg-badge--primary.mg-badge--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-badge.mg-badge--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-badge.mg-badge--secondary.mg-badge--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-badge.mg-badge--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-badge.mg-badge--success.mg-badge--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-badge.mg-badge--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-badge.mg-badge--warning.mg-badge--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-badge.mg-badge--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-badge.mg-badge--danger.mg-badge--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-badge.mg-badge--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-badge.mg-badge--info.mg-badge--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-badge.mg-badge--text-color{background-color:currentColor;border-color:currentColor}.mg-badge.mg-badge--text-color .mg-badge__value{color:hsl(var(--mg-badge-text-color, var(--color-light)))}.mg-badge.mg-badge--text-color.mg-badge--outline{background-color:transparent}.mg-badge.mg-badge--text-color.mg-badge--outline .mg-badge__value{color:currentColor}.mg-badge,mg-badge{display:inline-flex;align-items:center;justify-content:center}";
|
|
102
563
|
|
|
103
564
|
const MgBadge = class {
|
|
104
565
|
constructor(hostRef) {
|
|
@@ -116,7 +577,7 @@ const MgBadge = class {
|
|
|
116
577
|
}
|
|
117
578
|
validateValue(newValue) {
|
|
118
579
|
if (`${newValue}`.match(/^(\d+\+*|[?*!a-z])$/i) === null) {
|
|
119
|
-
throw new Error('<mg-badge> prop "value" must be
|
|
580
|
+
throw new Error('<mg-badge> prop "value" must be integer or ponctuation character.');
|
|
120
581
|
}
|
|
121
582
|
}
|
|
122
583
|
validateLabel(newValue) {
|
|
@@ -126,7 +587,7 @@ const MgBadge = class {
|
|
|
126
587
|
}
|
|
127
588
|
validateVariant(newValue, oldValue) {
|
|
128
589
|
if (!variants$4.includes(newValue)) {
|
|
129
|
-
throw new Error(`<mg-badge> prop "variant" must be one of
|
|
590
|
+
throw new Error(`<mg-badge> prop "variant" must be one of: ${variants$4.join(', ')}.`);
|
|
130
591
|
}
|
|
131
592
|
else {
|
|
132
593
|
if (oldValue !== undefined) {
|
|
@@ -158,7 +619,7 @@ const MgBadge = class {
|
|
|
158
619
|
* @returns {HTMLElement} HTML Element
|
|
159
620
|
*/
|
|
160
621
|
render() {
|
|
161
|
-
return (index.h("span", { class: this.classList.join() }, this.value, index.h("span", { class: "sr-only" }, this.label)));
|
|
622
|
+
return (index.h("span", { class: this.classList.join() }, index.h("span", { class: "mg-badge__value" }, this.value), index.h("span", { class: "sr-only" }, this.label)));
|
|
162
623
|
}
|
|
163
624
|
static get watchers() { return {
|
|
164
625
|
"value": ["validateValue"],
|
|
@@ -174,7 +635,7 @@ MgBadge.style = mgBadgeCss;
|
|
|
174
635
|
*/
|
|
175
636
|
const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'];
|
|
176
637
|
|
|
177
|
-
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled)
|
|
638
|
+
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled){background:hsl(var(--color-dark), 0.1)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-button.mg-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-primary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--primary:not(.mg-button--disabled){background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-secondary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--secondary:not(.mg-button--disabled){background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger:not(.mg-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-danger));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger-alt:not(.mg-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--info:not(.mg-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-dark));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--success:not(.mg-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button{position:relative;display:inline-flex;align-items:center;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);touch-action:manipulation}.mg-button.mg-button--disabled{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon{padding:0;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--font-size)}.mg-button.mg-button--flat{background:none;border:none}.mg-button.mg-button--link{padding:unset;min-height:unset;background:unset;border:unset;border-radius:unset;text-decoration:underline}.mg-button.mg-button--link slot{font-weight:600}.mg-button.mg-button--link:hover{text-decoration:none}.mg-button.mg-button--full-width{display:flex;justify-content:center}.mg-button.mg-button--loading>mg-icon:first-of-type{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading .mg-button__content{opacity:0}.mg-button mg-icon:only-child,.mg-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button slot,.mg-button ::slotted(*:not(mg-icon)){text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);display:flex;align-items:center;column-gap:0.6rem}";
|
|
178
639
|
|
|
179
640
|
const MgButton = class {
|
|
180
641
|
constructor(hostRef) {
|
|
@@ -242,7 +703,7 @@ const MgButton = class {
|
|
|
242
703
|
}
|
|
243
704
|
validateVariant(newValue, oldValue) {
|
|
244
705
|
if (!variants$3.includes(newValue)) {
|
|
245
|
-
throw new Error(`<mg-button> prop "variant" must be one of
|
|
706
|
+
throw new Error(`<mg-button> prop "variant" must be one of: ${variants$3.join(', ')}`);
|
|
246
707
|
}
|
|
247
708
|
else {
|
|
248
709
|
if (oldValue !== undefined) {
|
|
@@ -298,212 +759,50 @@ const MgButton = class {
|
|
|
298
759
|
if (this.isIcon) {
|
|
299
760
|
this.classList.add(`mg-button--icon`);
|
|
300
761
|
if (typeof this.label !== 'string' || this.label.trim() === '') {
|
|
301
|
-
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
// Store the onclick fn
|
|
305
|
-
this.onClickElementFn = this.element.onclick;
|
|
306
|
-
this.disabledHandler(this.disabled);
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Render component
|
|
310
|
-
*
|
|
311
|
-
* @returns {HTMLElement} html element
|
|
312
|
-
*/
|
|
313
|
-
render() {
|
|
314
|
-
return (index.h(index.Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, index.h("div", { class: this.classList.join(), id: this.identifier }, this.loading && index.h("mg-icon", { icon: "loader", spin: true }), index.h("div", { class: "mg-button__content" }, index.h("slot", null)))));
|
|
315
|
-
}
|
|
316
|
-
get element() { return index.getElement(this); }
|
|
317
|
-
static get watchers() { return {
|
|
318
|
-
"variant": ["validateVariant"],
|
|
319
|
-
"fullWidth": ["validateFullWidth"],
|
|
320
|
-
"disabled": ["disabledHandler"],
|
|
321
|
-
"loading": ["loadingHandler"]
|
|
322
|
-
}; }
|
|
323
|
-
};
|
|
324
|
-
MgButton.style = mgButtonCss;
|
|
325
|
-
|
|
326
|
-
const mgCardCss = ".mg-card{position:relative;width:100%;padding:var(--mg-card-padding);overflow:var(--mg-card-overflow);box-sizing:border-box;z-index:inherit;background:var(--mg-card-background);border:var(--mg-card-border);border-radius:var(--mg-card-border-radius);box-shadow:var(--mg-card-box-shadow)}";
|
|
327
|
-
|
|
328
|
-
const MgCard = class {
|
|
329
|
-
constructor(hostRef) {
|
|
330
|
-
index.registerInstance(this, hostRef);
|
|
331
|
-
}
|
|
332
|
-
/*************
|
|
333
|
-
* Lifecycle *
|
|
334
|
-
*************/
|
|
335
|
-
/**
|
|
336
|
-
* Render
|
|
337
|
-
*
|
|
338
|
-
* @returns {HTMLElement} HTML Element
|
|
339
|
-
*/
|
|
340
|
-
render() {
|
|
341
|
-
return (index.h("div", { class: "mg-card" }, index.h("slot", null)));
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
MgCard.style = mgCardCss;
|
|
345
|
-
|
|
346
|
-
const errors$1 = {
|
|
347
|
-
required: "This field is required.",
|
|
348
|
-
date: {
|
|
349
|
-
badInput: "The date format must be <span aria-hidden=\"true\">mm/dd/yyyy</span><span class=\"sr-only\">m m / d d / y y y y</span> and the date must be greater than {min}",
|
|
350
|
-
min: "The date cannot be earlier than {min}",
|
|
351
|
-
max: "The date cannot be later than {max}",
|
|
352
|
-
minMax: "The date must be between {min} and {max}"
|
|
353
|
-
},
|
|
354
|
-
numeric: {
|
|
355
|
-
min: "The value cannot be less than {min}",
|
|
356
|
-
max: "The value cannot be greater than {max}",
|
|
357
|
-
minMax: "The value must be between {min} et {max}"
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
const nbCharLeft$1 = "{counter} characters left.";
|
|
361
|
-
const input$1 = {
|
|
362
|
-
select: {
|
|
363
|
-
placeholder: "Select a value"
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
const form$1 = {
|
|
367
|
-
required: "Fields with a <strong class=\"is-asterisk\">*</strong> are required",
|
|
368
|
-
allRequired: "All fields are required"
|
|
369
|
-
};
|
|
370
|
-
const message$1 = {
|
|
371
|
-
closeButton: "Close message"
|
|
372
|
-
};
|
|
373
|
-
const modal$1 = {
|
|
374
|
-
closeButton: "Close modal"
|
|
375
|
-
};
|
|
376
|
-
const pagination$1 = {
|
|
377
|
-
label: "Pagination",
|
|
378
|
-
page: "page",
|
|
379
|
-
pages: "pages",
|
|
380
|
-
nextPage: "Next page",
|
|
381
|
-
previousPage: "Previous page",
|
|
382
|
-
selectPage: "Select the page to display."
|
|
383
|
-
};
|
|
384
|
-
const panel$1 = {
|
|
385
|
-
editLabel: "Edit section title."
|
|
386
|
-
};
|
|
387
|
-
const skipLinks$1 = {
|
|
388
|
-
navLabel: "Quick access"
|
|
389
|
-
};
|
|
390
|
-
const general$1 = {
|
|
391
|
-
confirm: "Confirm",
|
|
392
|
-
cancel: "Cancel",
|
|
393
|
-
close: "Close",
|
|
394
|
-
next: "next",
|
|
395
|
-
previous: "previous"
|
|
396
|
-
};
|
|
397
|
-
const en = {
|
|
398
|
-
errors: errors$1,
|
|
399
|
-
nbCharLeft: nbCharLeft$1,
|
|
400
|
-
input: input$1,
|
|
401
|
-
form: form$1,
|
|
402
|
-
message: message$1,
|
|
403
|
-
modal: modal$1,
|
|
404
|
-
pagination: pagination$1,
|
|
405
|
-
panel: panel$1,
|
|
406
|
-
skipLinks: skipLinks$1,
|
|
407
|
-
general: general$1
|
|
762
|
+
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
// Store the onclick fn
|
|
766
|
+
this.onClickElementFn = this.element.onclick;
|
|
767
|
+
this.disabledHandler(this.disabled);
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Render component
|
|
771
|
+
*
|
|
772
|
+
* @returns {HTMLElement} html element
|
|
773
|
+
*/
|
|
774
|
+
render() {
|
|
775
|
+
return (index.h(index.Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, index.h("div", { class: this.classList.join(), id: this.identifier }, this.loading && index.h("mg-icon", { icon: "loader", spin: true }), index.h("div", { class: "mg-button__content" }, index.h("slot", null)))));
|
|
776
|
+
}
|
|
777
|
+
get element() { return index.getElement(this); }
|
|
778
|
+
static get watchers() { return {
|
|
779
|
+
"variant": ["validateVariant"],
|
|
780
|
+
"fullWidth": ["validateFullWidth"],
|
|
781
|
+
"disabled": ["disabledHandler"],
|
|
782
|
+
"loading": ["loadingHandler"]
|
|
783
|
+
}; }
|
|
408
784
|
};
|
|
785
|
+
MgButton.style = mgButtonCss;
|
|
409
786
|
|
|
410
|
-
const
|
|
411
|
-
required: "Ce champ est obligatoire.",
|
|
412
|
-
date: {
|
|
413
|
-
badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"sr-only\">j j / m m / a a a a</span> et la date supérieure au {min}",
|
|
414
|
-
min: "La date ne peut pas être antérieure au {min}",
|
|
415
|
-
max: "La date ne peut pas être postérieure au {max}",
|
|
416
|
-
minMax: "La date doit être comprise entre le {min} et le {max}"
|
|
417
|
-
},
|
|
418
|
-
numeric: {
|
|
419
|
-
min: "La valeur ne peut pas être inférieure à {min}",
|
|
420
|
-
max: "La valeur ne peut pas être supérieure à {max}",
|
|
421
|
-
minMax: "La valeur doit être comprise entre {min} et {max}"
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
const nbCharLeft = "{counter} caractères disponibles.";
|
|
425
|
-
const input = {
|
|
426
|
-
select: {
|
|
427
|
-
placeholder: "Sélectionnez une valeur"
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
const form = {
|
|
431
|
-
required: "Les champs marqués d'un <strong class=\"is-asterisk\">*</strong> sont obligatoires",
|
|
432
|
-
allRequired: "Tous les champs sont obligatoires"
|
|
433
|
-
};
|
|
434
|
-
const message = {
|
|
435
|
-
closeButton: "Fermer le message"
|
|
436
|
-
};
|
|
437
|
-
const modal = {
|
|
438
|
-
closeButton: "Fermer la modale"
|
|
439
|
-
};
|
|
440
|
-
const pagination = {
|
|
441
|
-
label: "Pagination",
|
|
442
|
-
page: "page",
|
|
443
|
-
pages: "pages",
|
|
444
|
-
nextPage: "Page suivante",
|
|
445
|
-
previousPage: "Page précédente",
|
|
446
|
-
selectPage: "Sélectionner la page à afficher."
|
|
447
|
-
};
|
|
448
|
-
const panel = {
|
|
449
|
-
editLabel: "Modifier le titre de la section."
|
|
450
|
-
};
|
|
451
|
-
const skipLinks = {
|
|
452
|
-
navLabel: "Accès rapide"
|
|
453
|
-
};
|
|
454
|
-
const general = {
|
|
455
|
-
confirm: "Valider",
|
|
456
|
-
cancel: "Annuler",
|
|
457
|
-
close: "Fermer",
|
|
458
|
-
next: "suivant",
|
|
459
|
-
previous: "précédent"
|
|
460
|
-
};
|
|
461
|
-
const fr = {
|
|
462
|
-
errors: errors,
|
|
463
|
-
nbCharLeft: nbCharLeft,
|
|
464
|
-
input: input,
|
|
465
|
-
form: form,
|
|
466
|
-
message: message,
|
|
467
|
-
modal: modal,
|
|
468
|
-
pagination: pagination,
|
|
469
|
-
panel: panel,
|
|
470
|
-
skipLinks: skipLinks,
|
|
471
|
-
general: general
|
|
472
|
-
};
|
|
787
|
+
const mgCardCss = ".mg-card{position:relative;width:100%;padding:var(--mg-card-padding, var(--mg-card-padding-default));overflow:var(--mg-card-overflow, var(--mg-card-overflow-default));box-sizing:border-box;z-index:inherit;background:var(--mg-card-background, var(--mg-card-background-default));border:var(--mg-card-border, var(--mg-card-border-default));border-radius:var(--mg-card-border-radius, var(--mg-card-border-radius-default));box-shadow:var(--mg-card-box-shadow, var(--mg-card-box-shadow-default))}.mg-card ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default)}";
|
|
473
788
|
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
* Get Intl object
|
|
490
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
491
|
-
*
|
|
492
|
-
* @param {HTMLElement} element element we need to get the language
|
|
493
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
494
|
-
*/
|
|
495
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
496
|
-
const initLocales = (element) => {
|
|
497
|
-
// Get local
|
|
498
|
-
const locale = getLocale(element);
|
|
499
|
-
// Only keep first subtag
|
|
500
|
-
const localeSubtag = locale.split('-').shift();
|
|
501
|
-
// Return
|
|
502
|
-
return {
|
|
503
|
-
locale,
|
|
504
|
-
messages: messages[localeSubtag] || messages[defaultLocale],
|
|
505
|
-
};
|
|
789
|
+
const MgCard = class {
|
|
790
|
+
constructor(hostRef) {
|
|
791
|
+
index.registerInstance(this, hostRef);
|
|
792
|
+
}
|
|
793
|
+
/*************
|
|
794
|
+
* Lifecycle *
|
|
795
|
+
*************/
|
|
796
|
+
/**
|
|
797
|
+
* Render
|
|
798
|
+
*
|
|
799
|
+
* @returns {HTMLElement} HTML Element
|
|
800
|
+
*/
|
|
801
|
+
render() {
|
|
802
|
+
return (index.h("div", { class: "mg-card" }, index.h("slot", null)));
|
|
803
|
+
}
|
|
506
804
|
};
|
|
805
|
+
MgCard.style = mgCardCss;
|
|
507
806
|
|
|
508
807
|
const mgCharacterLeftCss = "mg-character-left.sc-mg-character-left{display:block}";
|
|
509
808
|
|
|
@@ -649,12 +948,12 @@ const MgForm = class {
|
|
|
649
948
|
// All fields are required
|
|
650
949
|
// mg-input-toggle can not be required
|
|
651
950
|
if (requiredInputs.length > 0 && requiredInputs.length === this.mgInputs.filter(input => input.nodeName !== 'MG-INPUT-TOGGLE').length) {
|
|
652
|
-
this.requiredMessage = this.messages.form.allRequired;
|
|
951
|
+
this.requiredMessage = requiredInputs.length === 1 ? this.messages.form.allRequiredSingle : this.messages.form.allRequired;
|
|
653
952
|
this.classList.add(this.classAllRequired);
|
|
654
953
|
}
|
|
655
954
|
// Some fields are required
|
|
656
955
|
else if (requiredInputs.length > 0) {
|
|
657
|
-
this.requiredMessage = this.messages.form.required;
|
|
956
|
+
this.requiredMessage = requiredInputs.length === 1 ? this.messages.form.requiredSingle : this.messages.form.required;
|
|
658
957
|
}
|
|
659
958
|
}
|
|
660
959
|
};
|
|
@@ -805,6 +1104,7 @@ const icons = {
|
|
|
805
1104
|
'archive': () => (index.h("path", { fill: "currentColor", d: "M3 6v6.96c0 .57.46 1.04 1.04 1.04H12c.55 0 1-.45 1-1V6H3Zm7 2H6V7h4v1Zm3-3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1Z" })),
|
|
806
1105
|
'archive-outline': () => (index.h("path", { fill: "currentColor", d: "M13 2H3c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1v6.96c0 .57.46 1.04 1.04 1.04H12c.55 0 1-.45 1-1V6c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1Zm-1 11H4.04S4 12.98 4 12.96V6h8v7Zm1-8H3V3h10v2Zm-3 3H6V7h4v1Z" })),
|
|
807
1106
|
'arrow-down': () => (index.h("path", { fill: "currentColor", d: "M13,10.1H10.23a.31.31,0,0,1-.32-.28h0V.94A.3.3,0,0,0,9.59.65H6.37A.32.32,0,0,0,6,.94H6V9.81a.29.29,0,0,1-.31.29H3a.3.3,0,0,0-.31.29.27.27,0,0,0,.08.22l5.06,4.58a.36.36,0,0,0,.46,0l5-4.58a.29.29,0,0,0,0-.42C13.22,10.1,13.12,10.1,13,10.1Z" })),
|
|
1107
|
+
'arrow-down-a-z': () => (index.h("path", { fill: "currentColor", d: "m6.53 10.9-1.41 1.41-.71.71-2.12-2.12.71-.71.88.88V3.02h1v8.12l.95-.95.71.71ZM12.29 6H10.5l-.36 1H9.08l1.79-5h1.05l1.79 5h-1.06l-.36-1Zm-.36-1.02-.53-1.49-.53 1.49h1.06Zm1.79 5.18V9H9.09v1h3.29l-3.29 2.84V14h4.63v-1h-3.29l3.29-2.84Z" })),
|
|
808
1108
|
'arrow-down-right': () => (index.h("path", { fill: "currentColor", d: "m1.98 3.47 8.75 8.75H6.94c-.58 0-1.05.47-1.05 1.06s.47 1.05 1.05 1.05h6.33c.58 0 1.05-.47 1.05-1.05V6.94a1.05 1.05 0 1 0-2.1 0v3.79L3.47 1.98c-.41-.41-1.08-.41-1.49 0-.41.41-.41 1.08 0 1.49Z" })),
|
|
809
1109
|
'arrow-left': () => (index.h("path", { fill: "currentColor", d: "M5.88,12.93V10.18a.3.3,0,0,1,.28-.32H15a.31.31,0,0,0,.29-.33h0V6.32A.31.31,0,0,0,15,6H6.17a.32.32,0,0,1-.29-.31h0V2.93a.3.3,0,0,0-.28-.32.32.32,0,0,0-.23.09L.79,7.76a.36.36,0,0,0,0,.46l4.58,5a.31.31,0,0,0,.43,0A.4.4,0,0,0,5.88,12.93Z" })),
|
|
810
1110
|
'arrow-right': () => (index.h("path", { fill: "currentColor", d: "M10.16,3V5.75a.3.3,0,0,1-.28.32H1a.31.31,0,0,0-.29.33h0V9.61A.31.31,0,0,0,1,9.94H9.87a.29.29,0,0,1,.29.31h0V13a.3.3,0,0,0,.28.32.32.32,0,0,0,.23-.09l4.58-5.06a.36.36,0,0,0,0-.46l-4.58-5a.3.3,0,0,0-.42,0C10.16,2.76,10.16,2.87,10.16,3Z" })),
|
|
@@ -813,6 +1113,7 @@ const icons = {
|
|
|
813
1113
|
'arrow-up': () => (index.h("path", { fill: "currentColor", d: "M3.06,5.82H5.81a.31.31,0,0,1,.32.28h0V15a.31.31,0,0,0,.33.29H9.67A.3.3,0,0,0,10,15h0V6.11a.3.3,0,0,1,.31-.29h2.75a.3.3,0,0,0,.23-.51L8.23.73a.36.36,0,0,0-.46,0l-5,4.58a.3.3,0,0,0,0,.43C2.82,5.83,2.92,5.82,3.06,5.82Z" })),
|
|
814
1114
|
'arrow-up-right': () => (index.h("path", { fill: "currentColor", d: "m3.47 14.02 8.75-8.75v3.78c0 .58.47 1.05 1.06 1.05s1.05-.47 1.05-1.05V2.72c0-.58-.47-1.05-1.05-1.05H6.94a1.05 1.05 0 1 0 0 2.1h3.78l-8.74 8.76c-.41.41-.41 1.08 0 1.49s1.08.41 1.49 0Z" })),
|
|
815
1115
|
'arrow-up-right-square': () => (index.h("path", { fill: "currentColor", d: "M14.33 3v10A1.34 1.34 0 0 1 13 14.33H3A1.34 1.34 0 0 1 1.67 13V3A1.34 1.34 0 0 1 3 1.67h10A1.34 1.34 0 0 1 14.33 3Zm-2.48.46H8.68a.67.67 0 0 0-.68.7.63.63 0 0 0 .2.47l.91.91-5.53 5.53a.33.33 0 0 0 0 .48l.87.87a.33.33 0 0 0 .48 0l5.53-5.52.91.9a.69.69 0 0 0 1 0 .71.71 0 0 0 .19-.48V4.15a.67.67 0 0 0-.67-.67Z" })),
|
|
1116
|
+
'arrow-up-z-a': () => (index.h("path", { fill: "currentColor", d: "m5.82 5.85-.94-.94v8.11h-1V4.96l-.89.89-.71-.71 1.41-1.41.71-.71.71.71 1.41 1.41-.71.71ZM12.29 13H10.5l-.36 1H9.08l1.79-5h1.05l1.79 5h-1.06l-.36-1Zm-.36-1.02-.53-1.49-.53 1.49h1.06Zm1.79-8.82V2H9.09v1h3.29L9.09 5.84V7h4.63V6h-3.29l3.29-2.84Z" })),
|
|
816
1117
|
'arrows-compare': () => index.h("path", { fill: "currentColor", d: "M5.81 9.47H.67v1.47h5.14v2.2l2.93-2.93-2.93-2.93v2.2Zm4.39-.73v-2.2h5.14V5.07H10.2v-2.2L7.27 5.8l2.93 2.93Z" }),
|
|
817
1118
|
'arrows-right-down': () => (index.h("path", { fill: "currentColor", d: "M10.68 10.78c.16.17.16.45-.02.61l-2.8 2.78a.43.43 0 0 1-.31.12.42.42 0 0 1-.31-.12l-2.8-2.78a.44.44 0 0 1 0-.62.44.44 0 0 1 .62 0l2.06 2.05V5.38H2.11c-.24 0-.44-.19-.44-.44 0-.24.2-.44.44-.44H8v8.32l2.06-2.05a.44.44 0 0 1 .62 0Zm3.53-6.14-2.78-2.8a.438.438 0 0 0-.61-.02.44.44 0 0 0 0 .62l2.05 2.06H8.89v.88h3.98l-2.05 2.06a.44.44 0 0 0 0 .62c.17.17.45.17.62 0l2.78-2.8s.07-.09.09-.14c.02-.05.03-.11.03-.17 0-.11-.04-.23-.12-.31Z" })),
|
|
818
1119
|
'arrows-right-left': () => (index.h("path", { fill: "currentColor", d: "M.73,5.65V5.23a.64.64,0,0,1,.64-.64H12V3.31a.64.64,0,0,1,.64-.64.63.63,0,0,1,.45.18L15.19,5a.63.63,0,0,1,0,.9L13.05,8A.65.65,0,0,1,12,7.57V6.29H1.37a.64.64,0,0,1-.64-.64Zm14,4.06H4.09V8.43A.64.64,0,0,0,3,8L.87,10.11a.63.63,0,0,0,0,.9L3,13.15a.64.64,0,0,0,.91,0,.61.61,0,0,0,.18-.45V11.41H14.73a.63.63,0,0,0,.64-.64h0v-.42a.63.63,0,0,0-.64-.64Z" })),
|
|
@@ -823,8 +1124,13 @@ const icons = {
|
|
|
823
1124
|
'briefcase': () => (index.h("path", { fill: "currentColor", d: "M14 4.5h-3v-1c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v1H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-7c0-.55-.45-1-1-1Zm-8-1h4v1H6v-1Z" })),
|
|
824
1125
|
'briefcase-outline': () => (index.h("path", { fill: "currentColor", d: "M14 4.5h-3v-1c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v1H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-7c0-.55-.45-1-1-1Zm-8-1h4v1H6v-1Zm8 9H2v-7h12v7Z" })),
|
|
825
1126
|
'calculator': () => (index.h("path", { fill: "currentColor", d: "M12.83.67H3.17a.5.5 0 0 0-.5.5v13.66a.5.5 0 0 0 .5.5h9.66a.5.5 0 0 0 .5-.5V1.17a.5.5 0 0 0-.5-.5ZM5.58 13.39a.29.29 0 0 1-.28.3H4.1a.29.29 0 0 1-.3-.28v-1.2a.29.29 0 0 1 .28-.3h1.2a.29.29 0 0 1 .3.28v1.2Zm0-3.28a.29.29 0 0 1-.3.3H4.1a.29.29 0 0 1-.3-.3V8.93a.29.29 0 0 1 .28-.3h1.2a.29.29 0 0 1 .3.28v1.2Zm3.29 3.28a.29.29 0 0 1-.3.3H7.38a.29.29 0 0 1-.3-.3v-1.18a.29.29 0 0 1 .3-.3h1.19a.29.29 0 0 1 .3.3Zm0-3.28a.32.32 0 0 1-.3.3H7.38a.32.32 0 0 1-.3-.3V8.93a.29.29 0 0 1 .3-.3h1.19a.29.29 0 0 1 .3.3Zm3.33 3.28a.29.29 0 0 1-.28.3h-1.25a.29.29 0 0 1-.3-.28V8.93a.29.29 0 0 1 .28-.3h1.25a.29.29 0 0 1 .3.28v4.48Zm0-7.15a.29.29 0 0 1-.3.3H4.1a.29.29 0 0 1-.3-.3V2.61a.29.29 0 0 1 .28-.3h7.82a.29.29 0 0 1 .3.28v3.65Z" })),
|
|
826
|
-
'calendar': () => (index.h("path", { fill: "currentColor", d: "M14
|
|
827
|
-
'calendar-
|
|
1127
|
+
'calendar': () => (index.h("path", { fill: "currentColor", d: "M14 3.5c0-.55-.45-1-1-1h-1v-1h-1v1H5v-1H4v1H3c-.55 0-1 .45-1 1v.98s0 .02.02.02H2v9c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-9h-.02s.02 0 .02-.02V3.5Zm-11 10v-8h10v8H3Z" })),
|
|
1128
|
+
'calendar-outline': () => (index.h("path", { fill: "currentColor", d: "M13 2.5h-1v-1h-1v1H5v-1H4v1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-10c0-.55-.45-1-1-1Zm-10 11v-8h10v8H3Zm0-9v-1h10v1H3Z" })),
|
|
1129
|
+
'calendar-euro': () => [
|
|
1130
|
+
index.h("path", { key: "calendar-euro-1", d: "M13 2.5h-1v-1h-1v1H5v-1H4v1H3c-.6 0-1 .4-1 1v10c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-10c0-.6-.4-1-1-1Zm-10 11v-8h10v8H3Z" }),
|
|
1131
|
+
index.h("path", { key: "calendar-euro-2", d: "m9.79 11.03.71.71c-.53.48-1.23.78-2 .78-1.31 0-2.43-.85-2.83-2.02H4.5v-.75h1.02c-.02-.07-.02-.15-.02-.23 0-.09 0-.18.02-.27H4.5V8.5h1.19a2.974 2.974 0 0 1 4.81-1.2l-.71.71c-.35-.3-.8-.49-1.29-.49-.73 0-1.37.39-1.72.98h1.75v.75H6.52c-.01.09-.02.18-.02.27 0 .08 0 .16.01.23h2.02v.75H6.76c.34.61 1 1.02 1.74 1.02.49 0 .94-.19 1.29-.49Z" }),
|
|
1132
|
+
],
|
|
1133
|
+
'calendar-euro-outline': () => (index.h("path", { d: "m9.79 11.02.71.71a2.976 2.976 0 0 1-4.83-1.24H4.5v-.75h1.01c-.01-.08-.01-.15-.01-.23 0-.09 0-.18.02-.27H4.5v-.75h1.19a2.974 2.974 0 0 1 4.81-1.2L9.79 8c-.35-.3-.8-.49-1.29-.49-.73 0-1.37.39-1.72.98h1.75v.75H6.52c-.01.09-.02.18-.02.27 0 .08 0 .16.01.23h2.02v.75H6.76c.34.61 1 1.02 1.74 1.02.49 0 .94-.19 1.29-.49ZM13 3.5v1H3v-1h10m-1-2h-1v1H5v-1H4v1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-10c0-.55-.45-1-1-1h-1v-1Zm-9 12v-8h10v8H3Z" })),
|
|
828
1134
|
'check': () => (index.h("path", { fill: "currentColor", d: "m15.27 4.23-1.11-1.18c-.11-.1-.27-.1-.38 0L6 10.36l-3.76-4a.187.187 0 0 0-.26 0L.71 7.6c-.07.07-.07.19 0 .26l5.12 5.41c.07.07.18.07.25 0l1.3-1.23 7.87-7.45c.1-.1.11-.26.01-.37h.01Z" })),
|
|
829
1135
|
'check-circle': () => (index.h("path", { fill: "currentColor", d: "M15.33 8A7.33 7.33 0 1 1 8 .67 7.33 7.33 0 0 1 15.33 8Zm-8.18 3.88 5.44-5.44a.46.46 0 0 0 0-.65l-.67-.67a.48.48 0 0 0-.67 0L6.82 9.54 4.75 7.47a.46.46 0 0 0-.65 0l-.67.67a.46.46 0 0 0 0 .65l3.07 3.07a.46.46 0 0 0 .65 0Z" })),
|
|
830
1136
|
'chevron-down': () => (index.h("path", { fill: "currentColor", d: "M7.43,12.21.9,5.69a.81.81,0,0,1,0-1.14h0l.76-.77a.81.81,0,0,1,1.14,0L8,9l5.2-5.18a.81.81,0,0,1,1.14,0l.76.77a.8.8,0,0,1,0,1.13h0L8.57,12.21a.79.79,0,0,1-1.13,0Z" })),
|
|
@@ -836,10 +1142,12 @@ const icons = {
|
|
|
836
1142
|
'chevron-up': () => (index.h("path", { fill: "currentColor", d: "M8.57,3.79l6.53,6.52a.81.81,0,0,1,0,1.14h0l-.76.77a.81.81,0,0,1-1.14,0L8,7,2.8,12.22a.81.81,0,0,1-1.14,0L.9,11.45a.8.8,0,0,1,0-1.13h0L7.43,3.79a.79.79,0,0,1,1.13,0Z" })),
|
|
837
1143
|
'chevron-up-circle': () => (index.h("path", { fill: "currentColor", d: "M.67 8C.67 3.95 3.95.67 8 .67S15.33 3.95 15.33 8 12.05 15.33 8 15.33C3.95 15.33.67 12.05.67 8ZM7.5 4.63l-4 4c-.28.27-.28.71-.01.99h.01l.5.53c.28.27.72.27 1 0l3-3 3 3c.28.27.72.27 1 0l.5-.51c.28-.27.28-.71.01-.99h-.01l-4-4.01a.697.697 0 0 0-.99-.01H7.5Z" })),
|
|
838
1144
|
'clock': () => (index.h("path", { fill: "currentColor", d: "M8,.67C3.95,.67,.67,3.95,.67,8s3.28,7.33,7.33,7.33,7.33-3.28,7.33-7.33h0C15.33,3.95,12.05,.67,8,.67h0Zm1.69,10.33l-2.61-1.88c-.09-.07-.14-.17-.14-.28V3.84c0-.19,.16-.35,.35-.36h1.42c.2,0,.35,.16,.36,.36V7.93l1.87,1.37c.16,.1,.2,.32,.09,.47v.02h-.01l-.83,1.15c-.12,.15-.34,.18-.5,.06Z" })),
|
|
1145
|
+
'clock-outline': () => (index.h("path", { fill: "currentColor", d: "m10.95 10.04-.71.71L7.5 8.01v-4h1V7.6l2.45 2.45ZM8 2C4.69 2 2 4.69 2 8s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6m0-1c3.87 0 7 3.13 7 7s-3.13 7-7 7-7-3.13-7-7 3.13-7 7-7Z" })),
|
|
1146
|
+
'code-square-outline': () => (index.h("path", { fill: "currentColor", d: "m6.32 10.28.73-.73L5.5 8l1.53-1.53-.73-.73-2.27 2.27 2.28 2.28Zm3.37 0L11.97 8 9.69 5.72l-.73.73L10.51 8 8.96 9.55l.73.73ZM3.01 14c-.27 0-.5-.1-.7-.3-.2-.2-.3-.43-.3-.7V3c0-.27.1-.5.3-.7.2-.2.43-.3.7-.3h10c.27 0 .5.1.7.3.2.2.3.43.3.7v10c0 .27-.1.5-.3.7-.2.2-.43.3-.7.3H3Zm0-1h10V3H3v10Zm0-10v10V3Z" })),
|
|
839
1147
|
'conversation': () => (index.h("path", { fill: "currentColor", d: "M11.22,6.48c0-2.11-2.36-3.81-5.28-3.81S.67,4.37.67,6.48a3.15,3.15,0,0,0,1,2.19A5.17,5.17,0,0,1,.72,10a.2.2,0,0,0,0,.21.23.23,0,0,0,.19.12,4.79,4.79,0,0,0,2.25-.6,6.84,6.84,0,0,0,2.82.6C8.86,10.29,11.22,8.58,11.22,6.48Zm3.1,5.23a3.08,3.08,0,0,0,1-2.19C15.28,7.93,14,6.57,12,6a3.84,3.84,0,0,1,0,.48C12,9,9.3,11.05,6,11.05a7.16,7.16,0,0,1-.8-.05A5.6,5.6,0,0,0,10,13.33a6.7,6.7,0,0,0,2.82-.59,4.66,4.66,0,0,0,2.25.59.21.21,0,0,0,.19-.11.2.2,0,0,0,0-.21,5.15,5.15,0,0,1-.91-1.3Z" })),
|
|
840
1148
|
'conversation-outline': () => [
|
|
841
|
-
index.h("path", { fill: "currentColor", d: "M15 8.5c0 .79-.39 1.51-1.01 2.09v1.91a.508.508 0 0 1-.68.47l-2.26-1.05c-.34.05-.69.08-1.05.08-.23 0-.47-.01-.69-.04-.18 0-.35-.03-.52-.07-.02 0-.03 0-.05-.01-.16-.02-.31-.06-.46-.1-.42-.1-.82-.25-1.18-.43l-.42-.24c-.06-.04-.12-.08-.18-.13.58-.03 1.13-.12 1.64-.27.56.19 1.19.29 1.86.29.29 0 .6-.02.91-.07l.29-.04.28.12 1.5.7v-1.12l.01-.43.31-.3c.32-.29.7-.77.7-1.36 0-.91-.82-1.72-2.01-2.15-.01-.39-.09-.77-.23-1.13.06.02.12.04.19.06.25.08.5.17.73.27.11.05.23.11.34.17.11.06.21.12.31.18.11.07.2.13.3.2.48.35.86.78 1.1 1.26a2.288 2.288 0 0 1 .17.45c.03.11.06.22.07.33.02.12.03.24.03.36Z" }),
|
|
842
|
-
index.h("path", { fill: "currentColor", d: "M6 4c2.17 0 4 1.14 4 2.5S8.17 9 6 9c-.29 0-.6-.02-.91-.07l-.3-.04-.27.13-1.51.7V8.17l-.32-.3c-.32-.3-.7-.77-.7-1.36 0-1.36 1.83-2.5 4-2.5m0-1c-2.76 0-5 1.57-5 3.5 0 .79.39 1.51 1.01 2.09v1.91c0 .29.24.5.5.5.06 0 .11 0 .17-.03l2.26-1.05c.34.05.69.08 1.05.08 2.76 0 5-1.57 5-3.5s-2.24-3.5-5-3.5Z" }),
|
|
1149
|
+
index.h("path", { key: "conversation-outline-1", fill: "currentColor", d: "M15 8.5c0 .79-.39 1.51-1.01 2.09v1.91a.508.508 0 0 1-.68.47l-2.26-1.05c-.34.05-.69.08-1.05.08-.23 0-.47-.01-.69-.04-.18 0-.35-.03-.52-.07-.02 0-.03 0-.05-.01-.16-.02-.31-.06-.46-.1-.42-.1-.82-.25-1.18-.43l-.42-.24c-.06-.04-.12-.08-.18-.13.58-.03 1.13-.12 1.64-.27.56.19 1.19.29 1.86.29.29 0 .6-.02.91-.07l.29-.04.28.12 1.5.7v-1.12l.01-.43.31-.3c.32-.29.7-.77.7-1.36 0-.91-.82-1.72-2.01-2.15-.01-.39-.09-.77-.23-1.13.06.02.12.04.19.06.25.08.5.17.73.27.11.05.23.11.34.17.11.06.21.12.31.18.11.07.2.13.3.2.48.35.86.78 1.1 1.26a2.288 2.288 0 0 1 .17.45c.03.11.06.22.07.33.02.12.03.24.03.36Z" }),
|
|
1150
|
+
index.h("path", { key: "conversation-outline-2", fill: "currentColor", d: "M6 4c2.17 0 4 1.14 4 2.5S8.17 9 6 9c-.29 0-.6-.02-.91-.07l-.3-.04-.27.13-1.51.7V8.17l-.32-.3c-.32-.3-.7-.77-.7-1.36 0-1.36 1.83-2.5 4-2.5m0-1c-2.76 0-5 1.57-5 3.5 0 .79.39 1.51 1.01 2.09v1.91c0 .29.24.5.5.5.06 0 .11 0 .17-.03l2.26-1.05c.34.05.69.08 1.05.08 2.76 0 5-1.57 5-3.5s-2.24-3.5-5-3.5Z" }),
|
|
843
1151
|
],
|
|
844
1152
|
'cog': () => (index.h("path", { fill: "currentColor", d: "M14.82 9.76 13.56 9a5.54 5.54 0 0 0 0-2.07l1.26-.72a.36.36 0 0 0 .18-.38A7.5 7.5 0 0 0 13.37 3a.35.35 0 0 0-.44 0l-1.26.72a5.51 5.51 0 0 0-1.79-1V1.21a.34.34 0 0 0-.27-.34 7.29 7.29 0 0 0-3.22 0 .34.34 0 0 0-.28.34v1.45a5.83 5.83 0 0 0-1.79 1L3.06 3a.35.35 0 0 0-.43 0A7.24 7.24 0 0 0 1 5.83a.34.34 0 0 0 .16.41L2.44 7a5.49 5.49 0 0 0 0 2l-1.26.73a.35.35 0 0 0-.16.41A7.24 7.24 0 0 0 2.63 13a.35.35 0 0 0 .43.07l1.26-.73a5.56 5.56 0 0 0 1.79 1v1.45a.35.35 0 0 0 .28.34 7.29 7.29 0 0 0 3.22 0 .35.35 0 0 0 .28-.34v-1.45a6 6 0 0 0 1.79-1l1.26.73a.35.35 0 0 0 .43-.07A7.39 7.39 0 0 0 15 10.17a.37.37 0 0 0-.17-.41Zm-6.82.6A2.36 2.36 0 1 1 10.35 8 2.36 2.36 0 0 1 8 10.36Z" })),
|
|
845
1153
|
'comment': () => (index.h("path", { fill: "currentColor", d: "M8 1.67c-3.37-.12-6.21 2.51-6.33 5.88 0 1.36.5 2.68 1.41 3.69-.26 1-.72 1.94-1.36 2.76-.04.08-.04.17 0 .25.03.08.1.13.18.13 1.3-.03 2.54-.55 3.48-1.45.83.34 1.72.51 2.62.5 3.37.12 6.21-2.51 6.33-5.88-.12-3.37-2.96-6-6.33-5.88Zm2.53 8.43c0 .14-.11.25-.25.25H5.73c-.14 0-.25-.1-.26-.24V9.2c0-.17.13-.3.3-.31h4.5c.14 0 .26.12.26.26v.95Zm.92-3.29c0 .17-.13.3-.3.3h-6.3c-.17 0-.3-.13-.3-.3V6c0-.16.12-.29.28-.3H11.15c.16 0 .29.12.3.28V6.81Z" })),
|
|
@@ -853,34 +1161,35 @@ const icons = {
|
|
|
853
1161
|
'download': () => (index.h("path", { fill: "currentColor", d: "M6.4 2v4.1c0 .2-.1.3-.3.3H4c-.2 0-.3.1-.3.3 0 .1 0 .2.1.2l4 4c.1.1.3.1.4 0l4-4c.1-.1.1-.3 0-.4-.1-.1-.1-.1-.2-.1H9.9c-.2 0-.3-.1-.3-.3V2c0-.2-.1-.3-.3-.3H6.7c-.1 0-.3.1-.3.3zm7.9 11v1c0 .2-.1.3-.3.3H2c-.2 0-.3-.1-.3-.3v-1c0-.2.1-.3.3-.3h12c.2 0 .3.1.3.3z" })),
|
|
854
1162
|
'ellipsis': () => (index.h("path", { fill: "currentColor", d: "M2.5 6.17A1.83 1.83 0 1 0 4.33 8c0-1.01-.82-1.83-1.83-1.83Zm11 0A1.83 1.83 0 1 0 15.33 8c0-1.01-.82-1.83-1.83-1.83Zm-5.5 0A1.83 1.83 0 1 0 9.83 8c0-1.01-.82-1.83-1.83-1.83Z" })),
|
|
855
1163
|
'ellipsis-vertical': () => (index.h("path", { fill: "currentColor", d: "M6.17 13.5A1.83 1.83 0 1 0 8 11.67c-1.01 0-1.83.82-1.83 1.83Zm0-11A1.83 1.83 0 1 0 8 .67c-1.01 0-1.83.82-1.83 1.83Zm0 5.5A1.83 1.83 0 1 0 8 6.17c-1.01 0-1.83.82-1.83 1.83Z" })),
|
|
856
|
-
'euro': () => (index.h("path", { fill: "currentColor", d: "
|
|
1164
|
+
'euro': () => (index.h("path", { fill: "currentColor", d: "m12.1 11.02 1.4 1.42a5.948 5.948 0 0 1-4 1.56c-2.64 0-4.86-1.68-5.66-4.04H1.5v-1.5h2.02C3.5 8.3 3.5 8.16 3.5 8c0-.18 0-.36.04-.54H1.5v-1.5h2.38C4.7 3.66 6.9 2 9.5 2c1.54 0 2.94.6 4 1.56l-1.4 1.42c-.7-.6-1.6-.98-2.6-.98-1.46 0-2.74.78-3.44 1.96h3.5v1.5H5.54c-.02.18-.04.36-.04.54 0 .16 0 .32.02.46h4.04v1.5H6.02C6.7 11.18 8.02 12 9.5 12c1 0 1.9-.38 2.6-.98Z" })),
|
|
857
1165
|
'euro-circle': () => (index.h("path", { fill: "currentColor", d: "M8 .67C3.95.67.67 3.95.67 8S3.95 15.33 8 15.33s7.33-3.28 7.33-7.33S12.05.67 8 .67Zm2.27 11.4c-.38.09-.76.14-1.15.14a4.038 4.038 0 0 1-3.99-2.92h-.58c-.13 0-.23-.1-.23-.22v-.54c0-.12.11-.22.23-.22h.41a5.34 5.34 0 0 1 0-.8h-.41c-.13 0-.23-.1-.23-.22v-.58c0-.13.11-.22.23-.22h.63c.6-1.65 2.18-2.74 3.94-2.71.34 0 .68.03 1.02.1.12.03.19.16.16.28l-.23.84c-.03.12-.15.19-.27.17-.24-.05-.48-.08-.73-.08A2.42 2.42 0 0 0 6.81 6.5h2.71c.12.03.2.15.17.27l-.13.58c-.02.1-.12.18-.22.18H6.52c-.03.26-.03.53 0 .8h2.63c.12.03.2.15.17.27l-.11.52c-.03.1-.12.18-.22.18H6.8c.36.96 1.28 1.6 2.31 1.61.3 0 .59-.04.88-.1.12-.02.24.05.27.18l.17.84c.02.12-.05.24-.17.27v-.03Z" })),
|
|
858
1166
|
'exclamation-circle': () => (index.h("path", { fill: "currentColor", d: "M8 15.33c4.05 0 7.33-3.28 7.33-7.33S12.05.67 8 .67.67 3.95.67 8 3.95 15.33 8 15.33Zm.95-3.3c0 .15-.12.27-.28.27h-1.4c-.15 0-.28-.12-.28-.27v-1.31c0-.15.12-.28.28-.28h1.4c.15 0 .28.12.28.28v1.31ZM7 3.96c0-.14.11-.25.25-.25H8.7c.14 0 .25.11.25.25v4.8c0 .14-.11.25-.25.25H7.25c-.14 0-.25-.11-.25-.25V3.95Z" })),
|
|
1167
|
+
'exclamation-stamp': () => (index.h("path", { fill: "currentColor", d: "m15 8-1.55-1.86.22-2.46-2.3-.55L10.17 1 8 1.98 5.84 1 4.63 3.13l-2.29.54.22 2.46L1.01 8l1.55 1.86-.22 2.47 2.3.55 1.2 2.13L8 14.03l2.17.98 1.2-2.13 2.3-.55-.22-2.46L15 8.01Zm-6.36 3.35H7.36v-1.34h1.28v1.34Zm0-2.67H7.36V4.67h1.28v4.01Z" })),
|
|
859
1168
|
'exclamation-triangle': () => (index.h("path", { fill: "currentColor", d: "m14.3 13.88-6-12a.32.32 0 0 0-.41-.15.31.31 0 0 0-.15.15l-6 12a.31.31 0 0 0 .14.42.32.32 0 0 0 .14 0H14a.31.31 0 0 0 .33-.29.23.23 0 0 0-.03-.13ZM7 6a.28.28 0 0 1 .28-.28h1.46A.28.28 0 0 1 9 6v4a.29.29 0 0 1-.28.29H7.3A.29.29 0 0 1 7 10Zm2 7a.31.31 0 0 1-.31.32H7.34A.32.32 0 0 1 7 13v-1.37a.31.31 0 0 1 .32-.31h1.39a.31.31 0 0 1 .31.31Z" })),
|
|
860
1169
|
'eye': () => [
|
|
861
|
-
index.h("circle", { fill: "currentColor", cx: "8.01", cy: "7.96", r: "2.44" }),
|
|
862
|
-
index.h("path", { fill: "currentColor", d: "M15.24 7.59A8.12 8.12 0 0 0 8 2.67 8.12 8.12 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.12 8.12 0 0 0 8 13.33a8.12 8.12 0 0 0 7.24-4.92 1 1 0 0 0 0-.82ZM8 11.62A3.66 3.66 0 1 1 11.67 8 3.66 3.66 0 0 1 8 11.62Z" }),
|
|
1170
|
+
index.h("circle", { key: "eye-1", fill: "currentColor", cx: "8.01", cy: "7.96", r: "2.44" }),
|
|
1171
|
+
index.h("path", { key: "eye-2", fill: "currentColor", d: "M15.24 7.59A8.12 8.12 0 0 0 8 2.67 8.12 8.12 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.12 8.12 0 0 0 8 13.33a8.12 8.12 0 0 0 7.24-4.92 1 1 0 0 0 0-.82ZM8 11.62A3.66 3.66 0 1 1 11.67 8 3.66 3.66 0 0 1 8 11.62Z" }),
|
|
863
1172
|
],
|
|
864
1173
|
'eye-slash': () => [
|
|
865
|
-
index.h("path", { fill: "currentColor", d: "M10.25 7a2.43 2.43 0 0 0-2.08-1.46ZM6.45 6.1a2.43 2.43 0 1 0 3.85 2.69Z" }),
|
|
866
|
-
index.h("path", { fill: "currentColor", d: "M15.24 7.59A8.13 8.13 0 0 0 8 2.67a8.06 8.06 0 0 0-2.89.64l1.72 1.2A3.58 3.58 0 0 1 8 4.3a3.65 3.65 0 0 1 3.64 3.6l2.77 1.93a7.91 7.91 0 0 0 .81-1.42 1 1 0 0 0 .02-.82ZM.81 3.84 2.51 5A8.16 8.16 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.13 8.13 0 0 0 8 13.33a8 8 0 0 0 4.32-1.4l2 1.38.81-1.17-13.5-9.47ZM8 11.62A3.66 3.66 0 0 1 4.35 8a3.75 3.75 0 0 1 .29-1.42l5.85 4.11a3.65 3.65 0 0 1-2.49.93Z" }),
|
|
1174
|
+
index.h("path", { key: "eye-slash-1", fill: "currentColor", d: "M10.25 7a2.43 2.43 0 0 0-2.08-1.46ZM6.45 6.1a2.43 2.43 0 1 0 3.85 2.69Z" }),
|
|
1175
|
+
index.h("path", { key: "eye-slash-2", fill: "currentColor", d: "M15.24 7.59A8.13 8.13 0 0 0 8 2.67a8.06 8.06 0 0 0-2.89.64l1.72 1.2A3.58 3.58 0 0 1 8 4.3a3.65 3.65 0 0 1 3.64 3.6l2.77 1.93a7.91 7.91 0 0 0 .81-1.42 1 1 0 0 0 .02-.82ZM.81 3.84 2.51 5A8.16 8.16 0 0 0 .76 7.59a1 1 0 0 0 0 .82A8.13 8.13 0 0 0 8 13.33a8 8 0 0 0 4.32-1.4l2 1.38.81-1.17-13.5-9.47ZM8 11.62A3.66 3.66 0 0 1 4.35 8a3.75 3.75 0 0 1 .29-1.42l5.85 4.11a3.65 3.65 0 0 1-2.49.93Z" }),
|
|
867
1176
|
],
|
|
868
1177
|
'file': () => [
|
|
869
|
-
index.h("path", { fill: "currentColor", d: "M8.89 4.56V.67H3.35a.66.66 0 0 0-.66.68v13.3a.67.67 0 0 0 .66.68h9.3a.66.66 0 0 0 .66-.68v-9.4H9.55a.67.67 0 0 1-.66-.69Z" }),
|
|
870
|
-
index.h("path", { fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
|
|
1178
|
+
index.h("path", { key: "file-1", fill: "currentColor", d: "M8.89 4.56V.67H3.35a.66.66 0 0 0-.66.68v13.3a.67.67 0 0 0 .66.68h9.3a.66.66 0 0 0 .66-.68v-9.4H9.55a.67.67 0 0 1-.66-.69Z" }),
|
|
1179
|
+
index.h("path", { key: "file-2", fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
|
|
871
1180
|
],
|
|
872
1181
|
'file-cog': () => (index.h("path", { fill: "currentColor", d: "M9,10.1C9,10.6,8.5,11,8,11l0,0c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1C8.6,9,9,9.4,9,10.1C9,10,9,10,9,10.1z M13.2,3.7l-2.8-2.8c-0.1-0.1-0.3-0.2-0.5-0.2H9.8v3.7h3.5V4.2C13.3,4,13.2,3.8,13.2,3.7L13.2,3.7z M9.6,5.3h3.8v9.4 c0,0.4-0.3,0.6-0.7,0.7H3.3c-0.4,0-0.7-0.3-0.7-0.7c0,0,0,0,0,0V1.3C2.7,1,3,0.7,3.3,0.7h5.5v3.9l0,0C8.9,4.9,9.2,5.2,9.6,5.3 C9.5,5.2,9.5,5.2,9.6,5.3z M10,8L9.5,8.3C9.3,8.1,9,8,8.8,7.9V7.3c0-0.1,0-0.1-0.1-0.1c-0.4-0.1-0.9-0.1-1.3,0 c-0.1,0-0.1,0.1-0.1,0.1v0.6C7,8,6.7,8.1,6.5,8.3L6,8C5.9,8,5.9,8,5.8,8C5.5,8.3,5.3,8.7,5.2,9.1c0,0.1,0,0.1,0.1,0.2l0.5,0.3 c-0.1,0.3-0.1,0.6,0,0.8l-0.5,0.3c-0.1,0-0.1,0.1-0.1,0.2c0.1,0.4,0.4,0.8,0.7,1.1c0.1,0,0.1,0,0.2,0l0.5-0.3 C6.7,11.9,7,12,7.2,12.1v0.6c0,0.1,0,0.1,0.1,0.1c0.4,0.1,0.9,0.1,1.3,0c0.1,0,0.1-0.1,0.1-0.1v-0.5C9,12.1,9.3,12,9.5,11.8l0.5,0.3 c0.1,0,0.1,0,0.2,0c0.3-0.3,0.5-0.7,0.6-1.1c0-0.1,0-0.1-0.1-0.2l0,0l-0.5-0.3c0-0.3,0-0.6,0-0.8l0.5-0.3c0.1,0,0.1-0.1,0.1-0.2 c-0.1-0.4-0.4-0.8-0.6-1.1C10.1,8,10.1,8,10,8z" })),
|
|
873
1182
|
'file-download': () => [
|
|
874
|
-
index.h("path", { fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
|
|
875
|
-
index.h("path", { fill: "currentColor", d: "M13.31 14.65v-9.4H9.55a.67.67 0 0 1-.66-.68V.67H3.35a.67.67 0 0 0-.66.66v13.32a.67.67 0 0 0 .66.68h9.3a.67.67 0 0 0 .66-.66Zm-2.91-4.24-2.54 2.53a.18.18 0 0 1-.26 0l-2.54-2.53a.2.2 0 0 1-.06-.15.18.18 0 0 1 .19-.18h1.34a.2.2 0 0 0 .2-.2V7.27a.19.19 0 0 1 .19-.18h1.63a.18.18 0 0 1 .18.19v2.6a.2.2 0 0 0 .2.2h1.34a.16.16 0 0 1 .14.06.19.19 0 0 1-.01.27Z" }),
|
|
1183
|
+
index.h("path", { key: "file-download-1", fill: "currentColor", d: "M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17a.69.69 0 0 0-.19-.49Z" }),
|
|
1184
|
+
index.h("path", { key: "file-download-2", fill: "currentColor", d: "M13.31 14.65v-9.4H9.55a.67.67 0 0 1-.66-.68V.67H3.35a.67.67 0 0 0-.66.66v13.32a.67.67 0 0 0 .66.68h9.3a.67.67 0 0 0 .66-.66Zm-2.91-4.24-2.54 2.53a.18.18 0 0 1-.26 0l-2.54-2.53a.2.2 0 0 1-.06-.15.18.18 0 0 1 .19-.18h1.34a.2.2 0 0 0 .2-.2V7.27a.19.19 0 0 1 .19-.18h1.63a.18.18 0 0 1 .18.19v2.6a.2.2 0 0 0 .2.2h1.34a.16.16 0 0 1 .14.06.19.19 0 0 1-.01.27Z" }),
|
|
876
1185
|
],
|
|
877
1186
|
'file-excel': () => (index.h("path", { fill: "currentColor", d: "M8.89 4.43V.67H3.35a.65.65 0 0 0-.66.66v13.34a.65.65 0 0 0 .66.66h9.3a.65.65 0 0 0 .66-.66V5.09H9.55a.65.65 0 0 1-.66-.66Zm1.66 3.2-1.66 2.58 1.66 2.59a.34.34 0 0 1-.1.46.31.31 0 0 1-.18.05h-1a.32.32 0 0 1-.27-.17c-.54-1-1-1.9-1-1.9-.18.41-.28.55-1 1.9a.33.33 0 0 1-.29.18h-1A.34.34 0 0 1 5.4 13a.41.41 0 0 1 0-.18l1.67-2.58-1.62-2.61a.34.34 0 0 1 .1-.46.37.37 0 0 1 .18 0h1a.33.33 0 0 1 .3.17c.72 1.35.55.93 1 1.9 0 0 .17-.33 1-1.9a.33.33 0 0 1 .3-.17h1a.33.33 0 0 1 .33.33.41.41 0 0 1-.11.13ZM13.31 4v.17H9.77V.67h.17a.67.67 0 0 1 .47.19l2.71 2.71a.66.66 0 0 1 .19.43Z" })),
|
|
878
1187
|
'file-pdf': () => (index.h("path", { fill: "currentColor", d: "M7.74 8a2.68 2.68 0 0 1-.06-1.3c.24 0 .21 1.02.06 1.3Zm0 1.31a12.5 12.5 0 0 1-.79 1.75 9.8 9.8 0 0 1 1.75-.61 3.63 3.63 0 0 1-1.01-1.14Zm-2.66 3.47s.36-.15 1-1.12a3.71 3.71 0 0 0-1 1.12Zm4.49-7.67h3.78v9.56a.65.65 0 0 1-.66.66H3.31a.66.66 0 0 1-.66-.66V1.33a.65.65 0 0 1 .7-.66h5.56v3.77a.67.67 0 0 0 .66.67Zm-.22 5a2.78 2.78 0 0 1-1.18-1.5 4 4 0 0 0 .17-1.78.7.7 0 0 0-.78-.6.69.69 0 0 0-.56.41 4.58 4.58 0 0 0 .23 2.14 26 26 0 0 1-1.13 2.38c-.76.39-2 1.24-1.52 1.89a.87.87 0 0 0 .6.28c.5 0 1-.5 1.7-1.72A15.24 15.24 0 0 1 9.07 11a4.34 4.34 0 0 0 1.78.54.72.72 0 0 0 .74-.7.78.78 0 0 0-.19-.51c-.4-.4-1.51-.33-2.05-.23Zm3.81-6.53L10.44.86A.71.71 0 0 0 10 .67h-.2v3.55h3.55v-.17a.7.7 0 0 0-.19-.47ZM11.1 10.9c.11-.08-.07-.33-1.19-.25 1.03.44 1.19.25 1.19.25Z" })),
|
|
879
1188
|
'file-text': () => (index.h("path", { fill: "currentColor", d: "M8.89 4.56V.67H3.35c-.36 0-.66.3-.66.66v13.32c0 .37.29.67.66.68h9.3c.36 0 .66-.3.66-.66V5.25H9.55c-.37 0-.67-.31-.66-.68Zm1.77 6.75c0 .19-.15.34-.34.35H5.68c-.19 0-.34-.16-.34-.35v-.23c0-.19.15-.34.34-.34h4.64c.19 0 .34.15.34.34v.23Zm0-1.83c0 .19-.15.34-.34.34H5.68c-.19 0-.34-.15-.34-.34v-.23c0-.19.15-.34.34-.34h4.64c.19 0 .34.15.34.34v.23Zm0-2.06v.23c0 .19-.15.34-.34.34H5.68c-.19 0-.34-.15-.34-.34v-.23c0-.19.15-.34.34-.35h4.64c.19 0 .34.16.34.35Zm2.65-3.27v.17H9.77V.67h.17c.18 0 .35.07.47.2l2.71 2.8c.13.13.19.31.19.49Z" })),
|
|
880
1189
|
'file-text-outline': () => (index.h("path", { fill: "currentColor", d: "M10.31 10.74H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0-1.84H5.69c-.2 0-.36.16-.36.36v.21c0 .2.16.35.36.35h4.62c.2 0 .36-.15.36-.35v-.21c0-.2-.16-.36-.36-.36Zm0-1.83H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0 3.67H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm0-1.84H5.69c-.2 0-.36.16-.36.36v.21c0 .2.16.35.36.35h4.62c.2 0 .36-.15.36-.35v-.21c0-.2-.16-.36-.36-.36Zm0-1.83H5.69c-.2 0-.36.16-.36.35v.22c0 .19.16.35.36.35h4.62c.2 0 .36-.16.36-.35v-.22c0-.19-.16-.35-.36-.35Zm2.76-2.64L9.69.92A.8.8 0 0 0 9.1.67H3.35c-.36 0-.66.3-.66.66v13.32c0 .37.29.67.66.68h9.3c.36 0 .66-.3.66-.66V5.05c0-.23-.07-.45-.24-.62Zm-.76 9.9H3.69V1.67h5.2v2.75c0 .46.37.83.83.83h2.59v9.08Z" })),
|
|
881
1190
|
'file-upload': () => [
|
|
882
|
-
index.h("path", { fill: "currentColor", d: "M13.1 3.7 10.4.9c-.1-.1-.3-.2-.5-.2h-.1v3.7h3.5v-.2c0-.2-.1-.4-.2-.5z" }),
|
|
883
|
-
index.h("path", { fill: "currentColor", d: "M13.3 14.6V5.3H9.6c-.4 0-.7-.3-.7-.7V.7H3.3c-.3 0-.6.3-.6.6v13.3c0 .4.3.7.7.7h9.3c.3 0 .6-.3.6-.7zm-3-4.6H8.9c-.1 0-.2.1-.2.2v2.6c0 .1-.1.2-.2.2H6.9c-.1 0-.2-.1-.2-.2v-2.6c0-.1-.1-.2-.2-.2H5.1C5 9.9 5 9.8 5 9.7l2.5-2.6c.1-.1.2-.1.3 0l2.5 2.5.1.1c.1.2 0 .3-.1.3z" }),
|
|
1191
|
+
index.h("path", { key: "file-upload-1", fill: "currentColor", d: "M13.1 3.7 10.4.9c-.1-.1-.3-.2-.5-.2h-.1v3.7h3.5v-.2c0-.2-.1-.4-.2-.5z" }),
|
|
1192
|
+
index.h("path", { key: "file-upload-2", fill: "currentColor", d: "M13.3 14.6V5.3H9.6c-.4 0-.7-.3-.7-.7V.7H3.3c-.3 0-.6.3-.6.6v13.3c0 .4.3.7.7.7h9.3c.3 0 .6-.3.6-.7zm-3-4.6H8.9c-.1 0-.2.1-.2.2v2.6c0 .1-.1.2-.2.2H6.9c-.1 0-.2-.1-.2-.2v-2.6c0-.1-.1-.2-.2-.2H5.1C5 9.9 5 9.8 5 9.7l2.5-2.6c.1-.1.2-.1.3 0l2.5 2.5.1.1c.1.2 0 .3-.1.3z" }),
|
|
884
1193
|
],
|
|
885
1194
|
'filter': () => (index.h("path", { fill: "currentColor", d: "M13.74 1.66H2.26a.6.6 0 0 0-.59.6.59.59 0 0 0 .17.42l4.58 4.58v5.1a.58.58 0 0 0 .25.48l2 1.39a.6.6 0 0 0 .83-.15.59.59 0 0 0 .1-.34V7.26l4.58-4.58a.6.6 0 0 0 0-.84.64.64 0 0 0-.44-.18Z" })),
|
|
886
1195
|
'floppy-disk': () => (index.h("path", { fill: "currentColor", d: "m13.93 4.44-2.37-2.37c-.25-.25-.6-.4-.96-.4H3.03c-.75 0-1.36.61-1.36 1.36v9.94c0 .75.61 1.36 1.36 1.36h9.94c.75 0 1.36-.61 1.36-1.36V5.4c0-.36-.14-.7-.4-.96ZM8 12.52A1.81 1.81 0 1 1 8 8.9a1.81 1.81 0 0 1 0 3.62Zm2.71-5.77c0 .09-.04.18-.1.24a.35.35 0 0 1-.24.1H3.82c-.19 0-.34-.15-.34-.34V3.82c0-.19.15-.34.34-.34h6.55c.19 0 .34.15.34.34v2.93Z" })),
|
|
@@ -892,8 +1201,8 @@ const icons = {
|
|
|
892
1201
|
'folder-star': () => (index.h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2A1.35 1.35 0 0 0 .67 4v8A1.35 1.35 0 0 0 2 13.33h12A1.35 1.35 0 0 0 15.33 12V5.78A1.36 1.36 0 0 0 14 4.44Zm-.2 3.89L12 9.66l.69 2a.22.22 0 0 1-.08.27.26.26 0 0 1-.13.06.39.39 0 0 1-.15-.06l-1.77-1.26L8.75 12a.34.34 0 0 1-.15 0 .31.31 0 0 1-.13 0 .23.23 0 0 1-.08-.27l.69-2-1.81-1.35a.23.23 0 0 1-.1-.17.24.24 0 0 1 .24-.24h2.21l.67-2a.26.26 0 0 1 .15-.14.24.24 0 0 1 .31.14l.67 2h2.2a.26.26 0 0 1 .26.24.3.3 0 0 1-.08.12Z" })),
|
|
893
1202
|
'graduation-cap': () => (index.h("path", { fill: "currentColor", d: "M14.93 5.14 8.54 2.76c-.35-.13-.73-.13-1.08 0L1.07 5.14c-.31.13-.48.47-.39.8.04.22.19.39.39.47l1.12.42c-.26.38-.4.84-.41 1.3-.35.28-.47.75-.3 1.16.06.12.14.23.24.31l-.59 3.19c-.06.22.07.45.28.53h1.37c.22-.02.38-.22.36-.44v-.1L2.55 9.6c.32-.31.4-.79.2-1.18a.814.814 0 0 0-.24-.28c0-.38.18-.75.47-1l4.48 1.65c.35.13.73.13 1.08 0l6.39-2.38c.31-.13.48-.47.39-.8a.625.625 0 0 0-.39-.47Zm-6.18 4.5c-.48.18-1.02.18-1.5 0L3.93 8.4l-.33 3.15c0 1 2 1.78 4.4 1.78s4.4-.79 4.4-1.78l-.33-3.15-3.32 1.24Z" })),
|
|
894
1203
|
'history': () => [
|
|
895
|
-
index.h("path", { fill: "currentColor", d: "M8,1.67A6.37,6.37,0,0,0,3.6,3.42l-.91-.91a.6.6,0,0,0-.85,0h0a.58.58,0,0,0-.18.43V6.37A.61.61,0,0,0,2.24,7H5.68a.62.62,0,0,0,.62-.62A.69.69,0,0,0,6.12,6L5.05,4.87a4.29,4.29,0,1,1,.1,6.36.3.3,0,0,0-.41,0l-1,1a.3.3,0,0,0,0,.42h0A6.33,6.33,0,1,0,8,1.67Z" }),
|
|
896
|
-
index.h("path", { fill: "currentColor", d: "M9.85,9.3l-.36.36a.3.3,0,0,1-.43,0L7.45,8V5.15a.3.3,0,0,1,.3-.3h.5a.3.3,0,0,1,.3.3V7.58l1.3,1.3A.31.31,0,0,1,9.85,9.3Z" }),
|
|
1204
|
+
index.h("path", { key: "history-1", fill: "currentColor", d: "M8,1.67A6.37,6.37,0,0,0,3.6,3.42l-.91-.91a.6.6,0,0,0-.85,0h0a.58.58,0,0,0-.18.43V6.37A.61.61,0,0,0,2.24,7H5.68a.62.62,0,0,0,.62-.62A.69.69,0,0,0,6.12,6L5.05,4.87a4.29,4.29,0,1,1,.1,6.36.3.3,0,0,0-.41,0l-1,1a.3.3,0,0,0,0,.42h0A6.33,6.33,0,1,0,8,1.67Z" }),
|
|
1205
|
+
index.h("path", { key: "history-2", fill: "currentColor", d: "M9.85,9.3l-.36.36a.3.3,0,0,1-.43,0L7.45,8V5.15a.3.3,0,0,1,.3-.3h.5a.3.3,0,0,1,.3.3V7.58l1.3,1.3A.31.31,0,0,1,9.85,9.3Z" }),
|
|
897
1206
|
],
|
|
898
1207
|
'hand-up': () => (index.h("path", { fill: "currentColor", d: "M12.75 3.5c-.41 0-.75.34-.75.75v3.5c0 .14-.11.25-.25.25s-.25-.11-.25-.25v-4c0-.41-.34-.75-.75-.75s-.75.34-.75.75v4c0 .14-.11.25-.25.25s-.25-.11-.25-.25v-5c0-.41-.34-.75-.75-.75S8 2.34 8 2.75v5c0 .14-.11.25-.25.25s-.25-.11-.25-.25v-4c0-.41-.34-.75-.75-.75S6 3.34 6 3.75V11L3.97 9.54c-.34-.34-.88-.34-1.21 0s-.34.88 0 1.21l2.22 2.22c.66.66 1.55 1.03 2.47 1.03H11a2.5 2.5 0 0 0 2.5-2.5V4.25c0-.41-.34-.75-.75-.75Z" })),
|
|
899
1208
|
'home': () => (index.h("path", { fill: "currentColor", d: "m13.55 5.5-5-3.33C8.38 2.06 8.19 2 7.99 2s-.39.06-.56.17L2.45 5.5c-.28.19-.45.5-.45.83v6.66c0 .55.45 1 1 1h4V12c0-.56.45-1.01 1-1.01s1 .45 1 1.01v1.99h4c.55 0 1-.45 1-1V6.33c0-.33-.17-.65-.45-.83Z" })),
|
|
@@ -906,22 +1215,22 @@ const icons = {
|
|
|
906
1215
|
'link': () => (index.h("path", { fill: "currentColor", d: "M9.75 6.25a3.748 3.748 0 0 1 0 5.31l-1.66 1.67a3.76 3.76 0 0 1-5.32 0 3.76 3.76 0 0 1 0-5.32l.92-.92c.15-.15.4-.16.56 0 .07.07.11.16.12.26.02.44.1.88.24 1.3.05.14.01.3-.09.41l-.32.32c-.72.67-.76 1.8-.09 2.52s1.8.76 2.52.09c.03-.02.05-.05.07-.07l1.66-1.66c.7-.7.7-1.82 0-2.52-.08-.08-.16-.15-.26-.21a.394.394 0 0 1-.17-.31.98.98 0 0 1 .29-.74l.52-.52c.14-.14.35-.15.51-.04.18.13.35.27.51.43Zm3.49-3.48a3.76 3.76 0 0 0-5.32 0L6.26 4.43a3.772 3.772 0 0 0 .52 5.75c.16.11.37.09.51-.04l.52-.52c.2-.19.3-.46.29-.74a.38.38 0 0 0-.17-.31 1.775 1.775 0 0 1-.26-2.73l1.66-1.66c.68-.71 1.81-.74 2.52-.06.71.68.74 1.81.06 2.52-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.14.42.22.86.24 1.3 0 .22.19.39.41.38.1 0 .19-.05.26-.12l.92-.92a3.76 3.76 0 0 0 0-5.32Z" })),
|
|
907
1216
|
'list': () => (index.h("path", { fill: "currentColor", d: "M1.9 2.68c-.67 0-1.22.56-1.21 1.23 0 .67.56 1.22 1.23 1.21.67 0 1.22-.56 1.21-1.23 0-.32-.13-.63-.36-.86-.23-.23-.54-.36-.87-.35Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm13 .41H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Zm0-8.18H5.18c-.23 0-.41.18-.41.41v.81c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41V3.5c0-.23-.18-.41-.41-.41h-.03Zm0 4.09H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Z" })),
|
|
908
1217
|
'loader': () => [
|
|
909
|
-
index.h("path", { fill: "currentColor", class: "loader__full-circle", d: "M8 2.67A5.33 5.33 0 1 1 2.67 8 5.33 5.33 0 0 1 8 2.67m0-2A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Z" }),
|
|
910
|
-
index.h("path", { fill: "currentColor", d: "M8 2.67v-2A7.33 7.33 0 0 0 .67 8h2A5.33 5.33 0 0 1 8 2.67Z" }),
|
|
1218
|
+
index.h("path", { key: "loader-1", fill: "currentColor", class: "loader__full-circle", d: "M8 2.67A5.33 5.33 0 1 1 2.67 8 5.33 5.33 0 0 1 8 2.67m0-2A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Z" }),
|
|
1219
|
+
index.h("path", { key: "loader-2", fill: "currentColor", d: "M8 2.67v-2A7.33 7.33 0 0 0 .67 8h2A5.33 5.33 0 0 1 8 2.67Z" }),
|
|
911
1220
|
],
|
|
912
1221
|
'lock': () => (index.h("path", { fill: "currentColor", d: "M12 5.56h-.67v-1.4C11.37 2.28 9.88.71 8 .67 6.12.71 4.63 2.28 4.67 4.16v1.4H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39V7a1.37 1.37 0 0 0-1.28-1.44H12Zm-4 6.28c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Zm2.07-6.28H5.93v-1.4A2.12 2.12 0 0 1 8 2c1.17.03 2.1 1 2.07 2.17v1.39Z" })),
|
|
913
1222
|
'location': () => (index.h("path", { fill: "currentColor", d: "M8 .67A5.1 5.1 0 0 0 2.67 5.5c0 3.06 3.51 7.88 4.83 9.59a.64.64 0 0 0 1 0c1.32-1.71 4.83-6.53 4.83-9.59A5.1 5.1 0 0 0 8 .67Zm0 6.94a1.74 1.74 0 1 1 1.74-1.73A1.73 1.73 0 0 1 8 7.61Z" })),
|
|
914
1223
|
'log-in': () => (index.h("path", { fill: "currentColor", d: "M10.97,7.78h0L6.97,3.78c-.12-.12-.31-.12-.42,0h0c-.07,.06-.12,.15-.13,.24v2.07c0,.17-.13,.3-.3,.32H1.97c-.16,0-.29,.12-.3,.28h0v2.58c0,.16,.12,.29,.28,.3H6.11c.17,0,.3,.14,.3,.31v2.14c0,.16,.12,.29,.28,.3h0c.11,.01,.21-.03,.28-.11l4-4c.11-.12,.11-.3,0-.42Zm3.37,5.26h0v1c0,.16-.13,.28-.28,.28h-4.77c-.16,0-.28-.13-.28-.28v-1c0-.16,.13-.28,.28-.28h3.43V3.3h-3.42c-.16,0-.29-.13-.29-.29V1.97c0-.16,.13-.29,.29-.29h4.76c.16,0,.29,.13,.29,.29v.68h0V13.04Z" })),
|
|
915
1224
|
'log-out': () => [
|
|
916
|
-
index.h("path", { fill: "currentColor", d: "M14.25,7.77h0l-4-4a.31.31,0,0,0-.43,0A.34.34,0,0,0,9.7,4V6.07a.32.32,0,0,1-.3.32H5.23a.3.3,0,0,0-.3.3V9.25a.3.3,0,0,0,.3.3H9.4a.31.31,0,0,1,.3.31V12a.3.3,0,0,0,.3.3.33.33,0,0,0,.23-.09l4-4A.29.29,0,0,0,14.25,7.77Z" }),
|
|
917
|
-
index.h("path", { fill: "currentColor", d: "M6.71,12.72H3.27V3.26H6.69A.31.31,0,0,0,7,3V2a.3.3,0,0,0-.31-.3H2A.29.29,0,0,0,1.67,2h0V3h0V14a.27.27,0,0,0,.1.24h0a.32.32,0,0,0,.14.08H6.71A.3.3,0,0,0,7,14V13A.3.3,0,0,0,6.71,12.72Z" }),
|
|
1225
|
+
index.h("path", { key: "log-out-1", fill: "currentColor", d: "M14.25,7.77h0l-4-4a.31.31,0,0,0-.43,0A.34.34,0,0,0,9.7,4V6.07a.32.32,0,0,1-.3.32H5.23a.3.3,0,0,0-.3.3V9.25a.3.3,0,0,0,.3.3H9.4a.31.31,0,0,1,.3.31V12a.3.3,0,0,0,.3.3.33.33,0,0,0,.23-.09l4-4A.29.29,0,0,0,14.25,7.77Z" }),
|
|
1226
|
+
index.h("path", { key: "log-out-2", fill: "currentColor", d: "M6.71,12.72H3.27V3.26H6.69A.31.31,0,0,0,7,3V2a.3.3,0,0,0-.31-.3H2A.29.29,0,0,0,1.67,2h0V3h0V14a.27.27,0,0,0,.1.24h0a.32.32,0,0,0,.14.08H6.71A.3.3,0,0,0,7,14V13A.3.3,0,0,0,6.71,12.72Z" }),
|
|
918
1227
|
],
|
|
919
1228
|
'magnifying-glass': () => (index.h("path", { fill: "currentColor", d: "M11.24 9.5c1.48-2.44.71-5.62-1.73-7.1-.05-.03-.11-.07-.17-.1A5.232 5.232 0 0 0 2.52 4C.94 6.38 1.6 9.59 3.98 11.17a5.142 5.142 0 0 0 5.54.1L12.3 14c.39.39 1.02.39 1.41 0l.33-.33a.996.996 0 0 0 0-1.41l-2.8-2.76Zm-4.4.5c-1.76.02-3.2-1.4-3.22-3.16-.02-1.76 1.4-3.2 3.16-3.22 1.76-.02 3.2 1.4 3.22 3.16v.06A3.193 3.193 0 0 1 6.84 10Z" })),
|
|
920
1229
|
'mail': () => (index.h("path", { fill: "currentColor", d: "M13.87 2.67H2.13C1.36 2.64.71 3.23.67 4v8c.03.77.68 1.36 1.45 1.33h11.75c.77.04 1.42-.55 1.46-1.32V4c-.03-.77-.68-1.36-1.45-1.33h-.01Zm0 2.66L8 8.67 2.13 5.33V4L8 7.33 13.87 4v1.33Z" })),
|
|
921
1230
|
'notes': () => [
|
|
922
|
-
index.h("path", { fill: "currentColor", d: "M12.6 2.76v-.43c0-.75-.53-1.28-1.28-1.28H2.33c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h.39V4.05c0-.75.53-1.28 1.28-1.28h8.6Z" }),
|
|
923
|
-
index.h("path", { fill: "currentColor", d: "M13.67 3.4H4.68c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h6.42V11.1h3.85V4.68c0-.75-.53-1.28-1.28-1.28Zm-4.49 7.06H5.97V9.18h3.21v1.28Zm3.21-2.57H5.97V6.61h6.42v1.28Z" }),
|
|
924
|
-
index.h("path", { fill: "currentColor", d: "m11.74 14.42 2.68-2.68h-2.68v2.68z" }),
|
|
1231
|
+
index.h("path", { key: "notes-1", fill: "currentColor", d: "M12.6 2.76v-.43c0-.75-.53-1.28-1.28-1.28H2.33c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h.39V4.05c0-.75.53-1.28 1.28-1.28h8.6Z" }),
|
|
1232
|
+
index.h("path", { key: "notes-2", fill: "currentColor", d: "M13.67 3.4H4.68c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h6.42V11.1h3.85V4.68c0-.75-.53-1.28-1.28-1.28Zm-4.49 7.06H5.97V9.18h3.21v1.28Zm3.21-2.57H5.97V6.61h6.42v1.28Z" }),
|
|
1233
|
+
index.h("path", { key: "notes-3", fill: "currentColor", d: "m11.74 14.42 2.68-2.68h-2.68v2.68z" }),
|
|
925
1234
|
],
|
|
926
1235
|
'notes-outline': () => (index.h("path", { fill: "currentColor", d: "M13.11 4.74v5.38h-3v3H4.73V4.74h8.38m0-1.2H4.73a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.19h6l3.59-3.59v-6a1.2 1.2 0 0 0-1.21-1.18Zm-4.19 6.58h-3V8.93h3Zm3-2.39h-6v-1.2h6ZM3.8 11.19h-1V2.81h8.38v1h1.2v-1a1.2 1.2 0 0 0-1.2-1.2H2.81a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.2h1Z" })),
|
|
927
1236
|
'paper-plane': () => (index.h("path", { fill: "currentColor", d: "M14 1.69 1.84 7a.28.28 0 0 0-.15.36.29.29 0 0 0 .16.15l3.27 1.82a.57.57 0 0 0 .61-.06l6.45-5.57c.05 0 .15-.1.19-.06s0 .14-.06.18l-5.59 6.29a.52.52 0 0 0 0 .63l2.09 3.44a.28.28 0 0 0 .37.12.3.3 0 0 0 .13-.12l5-12.11a.3.3 0 0 0-.14-.37.28.28 0 0 0-.17-.01Z" })),
|
|
@@ -943,13 +1252,13 @@ const icons = {
|
|
|
943
1252
|
'table': () => (index.h("path", { fill: "currentColor", d: "M14.19 2.68H1.81A1.14 1.14 0 0 0 .67 3.82v8.36a1.14 1.14 0 0 0 1.14 1.14h12.38a1.14 1.14 0 0 0 1.14-1.14V3.82a1.14 1.14 0 0 0-1.14-1.14ZM7.24 11.8H2.19V9.52h5.05Zm0-3.8H2.19V5.72h5.05Zm6.57 3.8H8.76V9.52h5.05Zm0-3.8H8.76V5.72h5.05Z" })),
|
|
944
1253
|
'tag': () => (index.h("path", { fill: "currentColor", d: "M1.67 7.9V2.85a1.18 1.18 0 0 1 1.18-1.18H7.9a1.18 1.18 0 0 1 .84.33L14 7.26a1.2 1.2 0 0 1 0 1.68L8.94 14a1.2 1.2 0 0 1-1.68 0L2 8.74a1.18 1.18 0 0 1-.33-.84Zm2.77-4.65a1.19 1.19 0 1 0 1.18 1.19 1.19 1.19 0 0 0-1.18-1.19Z" })),
|
|
945
1254
|
'tags': () => [
|
|
946
|
-
index.h("path", { fill: "currentColor", d: "M12.08 7.37 7.22 3a1.12 1.12 0 0 0-.78-.29H1.77a1 1 0 0 0-1.1 1v4.21a1 1 0 0 0 .33.71L5.85 13a1.17 1.17 0 0 0 1.55 0l4.68-4.25a.94.94 0 0 0 0-1.38ZM3.23 6.13A1.13 1.13 0 1 1 4.36 5a1.13 1.13 0 0 1-1.13 1.13Z" }),
|
|
947
|
-
index.h("path", { fill: "currentColor", d: "M15 7.37 10.15 3a1.12 1.12 0 0 0-.77-.29H8.26l4.5 4.09a1.76 1.76 0 0 1 0 2.65L8.77 13a1.17 1.17 0 0 0 1.55 0L15 8.79a.94.94 0 0 0 0-1.42Z" }),
|
|
1255
|
+
index.h("path", { key: "tags-1", fill: "currentColor", d: "M12.08 7.37 7.22 3a1.12 1.12 0 0 0-.78-.29H1.77a1 1 0 0 0-1.1 1v4.21a1 1 0 0 0 .33.71L5.85 13a1.17 1.17 0 0 0 1.55 0l4.68-4.25a.94.94 0 0 0 0-1.38ZM3.23 6.13A1.13 1.13 0 1 1 4.36 5a1.13 1.13 0 0 1-1.13 1.13Z" }),
|
|
1256
|
+
index.h("path", { key: "tags-2", fill: "currentColor", d: "M15 7.37 10.15 3a1.12 1.12 0 0 0-.77-.29H8.26l4.5 4.09a1.76 1.76 0 0 1 0 2.65L8.77 13a1.17 1.17 0 0 0 1.55 0L15 8.79a.94.94 0 0 0 0-1.42Z" }),
|
|
948
1257
|
],
|
|
949
1258
|
'thumb-up': () => (index.h("path", { fill: "currentColor", d: "M2.11 14.36h1a.45.45 0 0 0 .45-.44V7.17a.45.45 0 0 0-.45-.44h-1a.44.44 0 0 0-.44.44v6.75a.44.44 0 0 0 .44.44Zm12.22-7a1.27 1.27 0 0 0-1.27-1.27H9.71l.61-2.91v-.2a1.07 1.07 0 0 0-.28-.68l-.68-.66-4.17 4.19a1.26 1.26 0 0 0-.37.9v6.36a1.27 1.27 0 0 0 1.27 1.27h5.06a1.24 1.24 0 0 0 1.17-.77l1.92-4.49a1.22 1.22 0 0 0 .09-.46V7.42Z" })),
|
|
950
1259
|
'trash': () => [
|
|
951
|
-
index.h("path", { fill: "currentColor", d: "M3.27 14.17c0 .66.54 1.19 1.2 1.2h7l-.05-.02h.08c.64-.02 1.14-.56 1.12-1.2V4.32H3.27v9.85Zm5.97-7.12c0-.33.27-.6.6-.6s.6.27.6.6v5.3c0 .33-.27.6-.6.6s-.6-.27-.6-.6v-5.3Zm-3.5 0c0-.33.27-.59.6-.6.32.02.58.28.6.6v5.3c-.02.32-.28.58-.6.6a.645.645 0 0 1-.6-.6v-5.3Zm7.28-5.39h-2.6V.95a.28.28 0 0 0-.28-.28H5.87a.28.28 0 0 0-.28.28v.72H2.91a.28.28 0 0 0-.28.28V3.1c0 .15.12.28.28.28h10.11c.15 0 .28-.12.28-.28V1.94a.28.28 0 0 0-.28-.28Z" }),
|
|
952
|
-
index.h("path", { fill: "currentColor", d: "M13,2h-2.9L9.9,1.6 C9.8,1.4,9.6,1.2,9.4,1.2H6.6c-0.2,0-0.4,0.1-0.5,0.3L5.8,2H2.9C2.7,2,2.5,2.2,2.5,2.4c0,0,0,0,0,0v0.8c0,0.2,0.2,0.4,0.4,0.4H13 c0.2,0,0.4-0.2,0.4-0.4V2.4C13.4,2.2,13.2,2,13,2z" }),
|
|
1260
|
+
index.h("path", { key: "trash-1", fill: "currentColor", d: "M3.27 14.17c0 .66.54 1.19 1.2 1.2h7l-.05-.02h.08c.64-.02 1.14-.56 1.12-1.2V4.32H3.27v9.85Zm5.97-7.12c0-.33.27-.6.6-.6s.6.27.6.6v5.3c0 .33-.27.6-.6.6s-.6-.27-.6-.6v-5.3Zm-3.5 0c0-.33.27-.59.6-.6.32.02.58.28.6.6v5.3c-.02.32-.28.58-.6.6a.645.645 0 0 1-.6-.6v-5.3Zm7.28-5.39h-2.6V.95a.28.28 0 0 0-.28-.28H5.87a.28.28 0 0 0-.28.28v.72H2.91a.28.28 0 0 0-.28.28V3.1c0 .15.12.28.28.28h10.11c.15 0 .28-.12.28-.28V1.94a.28.28 0 0 0-.28-.28Z" }),
|
|
1261
|
+
index.h("path", { key: "trash-2", fill: "currentColor", d: "M13,2h-2.9L9.9,1.6 C9.8,1.4,9.6,1.2,9.4,1.2H6.6c-0.2,0-0.4,0.1-0.5,0.3L5.8,2H2.9C2.7,2,2.5,2.2,2.5,2.4c0,0,0,0,0,0v0.8c0,0.2,0.2,0.4,0.4,0.4H13 c0.2,0,0.4-0.2,0.4-0.4V2.4C13.4,2.2,13.2,2,13,2z" }),
|
|
953
1262
|
],
|
|
954
1263
|
'universal-access': () => (index.h("path", { fill: "currentColor", d: "M8 15.33A7.33 7.33 0 1 1 15.33 8 7.34 7.34 0 0 1 8 15.33ZM8 1.71A6.29 6.29 0 1 0 14.29 8 6.29 6.29 0 0 0 8 1.71ZM13.74 8A5.74 5.74 0 1 1 8 2.25 5.75 5.75 0 0 1 13.74 8ZM8 3.77a1.07 1.07 0 1 0 1.07 1.07A1.07 1.07 0 0 0 8 3.77ZM4.67 5.63c-.6-.14-.87.86-.32 1s1.79.43 2.57.55a11.25 11.25 0 0 1-.72 4.47.54.54 0 0 0 .85.65 6.94 6.94 0 0 0 .78-2.42c0-.07.31-.11.33 0a8.73 8.73 0 0 0 .63 2.23c.3.65 1.31.26 1-.38a11.54 11.54 0 0 1-.76-4.58 21.34 21.34 0 0 0 2.41-.45.55.55 0 1 0-.2-1.08 11.47 11.47 0 0 1-6.57.01Z" })),
|
|
955
1264
|
'unlink': () => (index.h("path", { fill: "currentColor", d: "M9.74 6.25c-.16-.17-.32-.3-.5-.43-.14-.09-.31-.1-.44 0l1.81 1.81c-.17-.5-.47-.98-.87-1.38Zm-1.1 3.51c-.07.15-.17.28-.29.4l-1.66 1.66s-.04.05-.07.07c-.72.67-1.85.63-2.52-.09-.67-.72-.63-1.85.09-2.52l.32-.32c.1-.11.14-.27.09-.41-.14-.42-.22-.86-.24-1.3a.42.42 0 0 0-.12-.26.395.395 0 0 0-.56 0l-.92.92a3.76 3.76 0 0 0 0 5.32 3.76 3.76 0 0 0 5.32 0l1.66-1.67c.12-.12.23-.25.32-.38L8.64 9.76Zm4.61-7h-.02a3.778 3.778 0 0 0-5.32 0L6.83 3.84l1.41 1.41 1.08-1.08c.68-.71 1.81-.74 2.52-.06.71.68.74 1.81.06 2.52-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.13.4.21.81.23 1.23l.44.44c.09 0 .18-.05.24-.11l.92-.92a3.76 3.76 0 0 0 0-5.32Zm.97 10.52-1.03 1.03-5.14-5.14c-.04.17-.12.33-.25.45l-.52.52c-.14.13-.35.15-.51.04-.18-.13-.35-.27-.5-.42-.74-.74-1.11-1.7-1.11-2.67 0-.24.02-.49.08-.73l-3.6-3.6 1.03-1.03 11.55 11.55Z" })),
|
|
@@ -967,7 +1276,7 @@ const icons = {
|
|
|
967
1276
|
/**
|
|
968
1277
|
* List of all possibles sizes
|
|
969
1278
|
*/
|
|
970
|
-
const sizes$
|
|
1279
|
+
const sizes$1 = ['small', 'regular', 'large', 'extra-large'];
|
|
971
1280
|
/**
|
|
972
1281
|
* List of all possibles variants
|
|
973
1282
|
*/
|
|
@@ -992,7 +1301,7 @@ const MgIcon = class {
|
|
|
992
1301
|
}
|
|
993
1302
|
validateIcon(newValue, oldValue) {
|
|
994
1303
|
if (!Object.keys(icons).includes(newValue)) {
|
|
995
|
-
throw new Error(`<mg-icon> prop "icon" must be one of
|
|
1304
|
+
throw new Error(`<mg-icon> prop "icon" must be one of: ${Object.keys(icons).join(', ')}`);
|
|
996
1305
|
}
|
|
997
1306
|
else {
|
|
998
1307
|
if (oldValue !== undefined) {
|
|
@@ -1002,8 +1311,8 @@ const MgIcon = class {
|
|
|
1002
1311
|
}
|
|
1003
1312
|
}
|
|
1004
1313
|
validateSize(newValue, oldValue) {
|
|
1005
|
-
if (!sizes$
|
|
1006
|
-
throw new Error(`<mg-icon> prop "size" must be one of
|
|
1314
|
+
if (!sizes$1.includes(newValue)) {
|
|
1315
|
+
throw new Error(`<mg-icon> prop "size" must be one of: ${sizes$1.join(', ')}`);
|
|
1007
1316
|
}
|
|
1008
1317
|
else {
|
|
1009
1318
|
if (oldValue !== undefined) {
|
|
@@ -1014,7 +1323,7 @@ const MgIcon = class {
|
|
|
1014
1323
|
}
|
|
1015
1324
|
validateVariant(newValue, oldValue) {
|
|
1016
1325
|
if (newValue !== undefined && !variants$2.includes(newValue)) {
|
|
1017
|
-
throw new Error(`<mg-icon> prop "variant" must be one of
|
|
1326
|
+
throw new Error(`<mg-icon> prop "variant" must be one of: ${variants$2.join(', ')}`);
|
|
1018
1327
|
}
|
|
1019
1328
|
else if (newValue !== undefined) {
|
|
1020
1329
|
if (oldValue !== undefined) {
|
|
@@ -1079,13 +1388,14 @@ const MgIllustratedMessage = class {
|
|
|
1079
1388
|
*/
|
|
1080
1389
|
componentDidLoad() {
|
|
1081
1390
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
1082
|
-
const
|
|
1391
|
+
const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
|
|
1083
1392
|
if (!isTagName(this.element.querySelector('[slot="title"]'), headingTags)) {
|
|
1084
1393
|
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
1085
1394
|
}
|
|
1086
|
-
else if (
|
|
1087
|
-
throw new Error(
|
|
1395
|
+
else if (slottedIllustrations.length !== 1) {
|
|
1396
|
+
throw new Error('<mg-illustrated-message> Slotted illustration must be present and unique.');
|
|
1088
1397
|
}
|
|
1398
|
+
slottedIllustrations[0].setAttribute('aria-hidden', 'true');
|
|
1089
1399
|
}
|
|
1090
1400
|
/**
|
|
1091
1401
|
* Render
|
|
@@ -1164,6 +1474,11 @@ const MgInput = (props, children, utils) => {
|
|
|
1164
1474
|
if (props.labelOnTop && props.labelHide) {
|
|
1165
1475
|
throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide".');
|
|
1166
1476
|
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Set readonly value
|
|
1479
|
+
*/
|
|
1480
|
+
if (props.readonlyValue === undefined)
|
|
1481
|
+
props.readonlyValue = props.value;
|
|
1167
1482
|
/**
|
|
1168
1483
|
* Component classes
|
|
1169
1484
|
*/
|
|
@@ -1217,7 +1532,7 @@ const MgInput = (props, children, utils) => {
|
|
|
1217
1532
|
getInputTitle(),
|
|
1218
1533
|
!props.readonly && props.tooltip && getTooltip())) : (getInputTitle()),
|
|
1219
1534
|
props.readonly ? (index.h("div", { class: "mg-input__input-container" },
|
|
1220
|
-
index.h("strong", null, props.readonlyValue
|
|
1535
|
+
index.h("strong", null, props.readonlyValue),
|
|
1221
1536
|
children.filter(child => child.$name$ === 'append-input'))) : (index.h("div", { class: "mg-input__input-container" },
|
|
1222
1537
|
index.h("div", { class: { 'mg-input__input': true, 'mg-input__input--has-error': props.errorMessage !== undefined } },
|
|
1223
1538
|
applyAriadescribedBy(children, ariaDescribedbyIDs, utils),
|
|
@@ -1226,7 +1541,7 @@ const MgInput = (props, children, utils) => {
|
|
|
1226
1541
|
props.errorMessage && !props.readonly && !props.disabled && (index.h("div", { id: helpTextErrorId, class: "mg-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" }))))));
|
|
1227
1542
|
};
|
|
1228
1543
|
|
|
1229
|
-
const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.
|
|
1544
|
+
const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}";
|
|
1230
1545
|
|
|
1231
1546
|
/**
|
|
1232
1547
|
* type CheckboxItem validation function
|
|
@@ -1374,11 +1689,11 @@ const MgInputCheckbox = class {
|
|
|
1374
1689
|
* @returns {HTMLElement} HTML Element
|
|
1375
1690
|
*/
|
|
1376
1691
|
render() {
|
|
1377
|
-
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value && this.value.toString(), readonlyValue: undefined, tooltip: !this.readonly ? this.tooltip : undefined, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined, isFieldset: true }, index.h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList } }, this.checkboxItems
|
|
1692
|
+
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value && this.value.toString(), readonlyValue: undefined, tooltip: !this.readonly ? this.tooltip : undefined, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined, isFieldset: true }, index.h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.checkboxItems
|
|
1378
1693
|
.filter(item => {
|
|
1379
1694
|
return !this.readonly || item.value;
|
|
1380
1695
|
})
|
|
1381
|
-
.map((input, index$1) => (index.h("li", { class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "checkbox", id: input.id, name: this.identifier, value: input.value && input.value.toString(), checked: Boolean(input.value), disabled: this.readonly || this.disabled || input.disabled, required: this.required, indeterminate: input.value === null, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => {
|
|
1696
|
+
.map((input, index$1) => (index.h("li", { key: input.id, class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "checkbox", id: input.id, name: this.identifier, value: input.value && input.value.toString(), checked: Boolean(input.value), disabled: this.readonly || this.disabled || input.disabled, required: this.required, indeterminate: input.value === null, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => {
|
|
1382
1697
|
if (el !== null)
|
|
1383
1698
|
this.inputs[index$1] = el;
|
|
1384
1699
|
} }), index.h("label", { htmlFor: input.id }, input.title)))))));
|
|
@@ -1401,46 +1716,7 @@ var InputError$1;
|
|
|
1401
1716
|
InputError["REQUIRED"] = "required";
|
|
1402
1717
|
})(InputError$1 || (InputError$1 = {}));
|
|
1403
1718
|
|
|
1404
|
-
|
|
1405
|
-
* Format number to the locale currency
|
|
1406
|
-
*
|
|
1407
|
-
* @param {number} number number to format
|
|
1408
|
-
* @param {string} locale locale to apply
|
|
1409
|
-
* @param {string} currency currency to apply
|
|
1410
|
-
* @returns {string} formatted currency
|
|
1411
|
-
*/
|
|
1412
|
-
function localeCurrency(number, locale, currency) {
|
|
1413
|
-
return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Format number to locale
|
|
1417
|
-
*
|
|
1418
|
-
* @param {number} number number to format
|
|
1419
|
-
* @param {string} locale locale to apply
|
|
1420
|
-
* @returns {string} formatted number
|
|
1421
|
-
*/
|
|
1422
|
-
function localeNumber(number, locale) {
|
|
1423
|
-
return new Intl.NumberFormat(locale).format(number);
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Date RegExp
|
|
1427
|
-
*/
|
|
1428
|
-
const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
|
|
1429
|
-
/**
|
|
1430
|
-
* Locale date format
|
|
1431
|
-
*
|
|
1432
|
-
* @param {string} date date to format
|
|
1433
|
-
* @param {string} locale locale to apply
|
|
1434
|
-
* @returns {string} formatted date
|
|
1435
|
-
*/
|
|
1436
|
-
function localeDate(date, locale) {
|
|
1437
|
-
if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
|
|
1438
|
-
return '';
|
|
1439
|
-
}
|
|
1440
|
-
return new Intl.DateTimeFormat(locale).format(new Date(date));
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
const mgInputDateCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}";
|
|
1719
|
+
const mgInputDateCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}";
|
|
1444
1720
|
|
|
1445
1721
|
const MgInputDate = class {
|
|
1446
1722
|
constructor(hostRef) {
|
|
@@ -1546,11 +1822,14 @@ const MgInputDate = class {
|
|
|
1546
1822
|
this.errorMessage = undefined;
|
|
1547
1823
|
}
|
|
1548
1824
|
validateValue(newValue) {
|
|
1825
|
+
// When the input is not fully completed or has been cleared, the value becomes an empty string.
|
|
1826
|
+
if (newValue === '')
|
|
1827
|
+
newValue = null;
|
|
1549
1828
|
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {
|
|
1550
1829
|
throw new Error("<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd");
|
|
1551
1830
|
}
|
|
1552
1831
|
else {
|
|
1553
|
-
this.valueChange.emit(
|
|
1832
|
+
this.valueChange.emit(newValue);
|
|
1554
1833
|
}
|
|
1555
1834
|
}
|
|
1556
1835
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
@@ -1608,7 +1887,7 @@ const MgInputDate = class {
|
|
|
1608
1887
|
* @returns {HTMLElement} HTML Element
|
|
1609
1888
|
*/
|
|
1610
1889
|
render() {
|
|
1611
|
-
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: localeDate(this.value, this.locale), tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("input", { type: "date", class: "mg-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur,
|
|
1890
|
+
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: localeDate(this.value, this.locale), tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("input", { type: "date", class: "mg-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => {
|
|
1612
1891
|
if (el !== null)
|
|
1613
1892
|
this.input = el;
|
|
1614
1893
|
} })));
|
|
@@ -1637,7 +1916,7 @@ var InputError;
|
|
|
1637
1916
|
InputError["REQUIRED"] = "required";
|
|
1638
1917
|
})(InputError || (InputError = {}));
|
|
1639
1918
|
|
|
1640
|
-
const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem
|
|
1919
|
+
const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box{width:100%}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{max-width:100%}.mg-input:not(.mg-input--label-on-top) .mg-input__box{width:100%;max-width:calc(17.7rem + var(--mg-inputs-spacer) * 2);min-width:5rem}.mg-input.mg-input--width-16 .mg-input__input-container{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input{width:100%;max-width:21rem}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box{max-width:21rem;min-width:100%}.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box{max-width:7rem}.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box{max-width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input .mg-input__box{text-align:var(--mg-inputs-text-align, right)}";
|
|
1641
1920
|
|
|
1642
1921
|
const MgInputNumeric = class {
|
|
1643
1922
|
constructor(hostRef) {
|
|
@@ -1816,7 +2095,7 @@ const MgInputNumeric = class {
|
|
|
1816
2095
|
}
|
|
1817
2096
|
validateType(newValue) {
|
|
1818
2097
|
if (!types.includes(newValue)) {
|
|
1819
|
-
throw new Error(`<mg-input-numeric> prop "type" must be one of
|
|
2098
|
+
throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}`);
|
|
1820
2099
|
}
|
|
1821
2100
|
}
|
|
1822
2101
|
validateIntegerLength(newValue) {
|
|
@@ -1898,7 +2177,7 @@ const MgInputNumeric = class {
|
|
|
1898
2177
|
};
|
|
1899
2178
|
MgInputNumeric.style = mgInputNumericCss;
|
|
1900
2179
|
|
|
1901
|
-
const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem
|
|
2180
|
+
const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box{width:100%}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{max-width:100%}.mg-input:not(.mg-input--label-on-top) .mg-input__box{width:100%;max-width:calc(17.7rem + var(--mg-inputs-spacer) * 2);min-width:5rem}.mg-input.mg-input--width-16 .mg-input__input-container{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input{width:100%;max-width:21rem}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box{max-width:21rem;min-width:100%}.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box{max-width:7rem}.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box{max-width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}";
|
|
1902
2181
|
|
|
1903
2182
|
const MgInputPassword = class {
|
|
1904
2183
|
constructor(hostRef) {
|
|
@@ -2024,7 +2303,7 @@ const MgInputPassword = class {
|
|
|
2024
2303
|
};
|
|
2025
2304
|
MgInputPassword.style = mgInputPasswordCss;
|
|
2026
2305
|
|
|
2027
|
-
const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.
|
|
2306
|
+
const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}";
|
|
2028
2307
|
|
|
2029
2308
|
/**
|
|
2030
2309
|
* type Option validation function
|
|
@@ -2179,7 +2458,7 @@ const MgInputRadio = class {
|
|
|
2179
2458
|
* @returns {HTMLElement} HTML Element
|
|
2180
2459
|
*/
|
|
2181
2460
|
render() {
|
|
2182
|
-
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, index.h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList } }, this.options.map((input, index$1) => (index.h("li", { class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "radio", id: this.identifier + '_' + index$1, name: this.identifier, value: index$1, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index$1].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: el => {
|
|
2461
|
+
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, index.h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index$1) => (index.h("li", { key: input.title, class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "radio", id: this.identifier + '_' + index$1, name: this.identifier, value: index$1, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index$1].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: el => {
|
|
2183
2462
|
if (el !== null)
|
|
2184
2463
|
this.inputs[index$1] = el;
|
|
2185
2464
|
} }), index.h("label", { htmlFor: this.identifier + '_' + index$1 }, input.title)))))));
|
|
@@ -2195,7 +2474,7 @@ const MgInputRadio = class {
|
|
|
2195
2474
|
};
|
|
2196
2475
|
MgInputRadio.style = mgInputRadioCss;
|
|
2197
2476
|
|
|
2198
|
-
const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem
|
|
2477
|
+
const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box{width:100%}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{max-width:100%}.mg-input:not(.mg-input--label-on-top) .mg-input__box{width:100%;max-width:calc(17.7rem + var(--mg-inputs-spacer) * 2);min-width:5rem}.mg-input.mg-input--width-16 .mg-input__input-container{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input{width:100%;max-width:21rem}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box{max-width:21rem;min-width:100%}.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box{max-width:7rem}.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box{max-width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input__box{width:100%;padding-top:0;padding-bottom:0;padding-right:1rem}.mg-input.mg-input--select:not(.mg-input--label-on-top) .mg-input__box{max-width:unset}";
|
|
2199
2478
|
|
|
2200
2479
|
/**
|
|
2201
2480
|
* Check if item is a well configured option
|
|
@@ -2315,13 +2594,17 @@ const MgInputSelect = class {
|
|
|
2315
2594
|
this.valueChange.emit(newValue);
|
|
2316
2595
|
}
|
|
2317
2596
|
validateItems(newValue) {
|
|
2597
|
+
// Empty options
|
|
2598
|
+
if (newValue.length === 0) {
|
|
2599
|
+
this.options = [];
|
|
2600
|
+
}
|
|
2318
2601
|
// String array
|
|
2319
|
-
if (allItemsAreString(newValue)) {
|
|
2602
|
+
else if (allItemsAreString(newValue)) {
|
|
2320
2603
|
this.valueExist = newValue.includes(this.value);
|
|
2321
2604
|
this.options = newValue.map((item) => ({ title: item, value: item }));
|
|
2322
2605
|
}
|
|
2323
2606
|
// Object array
|
|
2324
|
-
else if (newValue
|
|
2607
|
+
else if (newValue.every(item => isOption$1(item))) {
|
|
2325
2608
|
this.valueExist = newValue.map(item => item.value).includes(this.value);
|
|
2326
2609
|
// Grouped object options
|
|
2327
2610
|
if (newValue.some(item => item.group !== undefined)) {
|
|
@@ -2333,7 +2616,7 @@ const MgInputSelect = class {
|
|
|
2333
2616
|
}
|
|
2334
2617
|
}
|
|
2335
2618
|
else {
|
|
2336
|
-
throw new Error('<mg-input-select> prop "items" is required
|
|
2619
|
+
throw new Error('<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option.');
|
|
2337
2620
|
}
|
|
2338
2621
|
}
|
|
2339
2622
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
@@ -2390,7 +2673,7 @@ const MgInputSelect = class {
|
|
|
2390
2673
|
if (el !== null)
|
|
2391
2674
|
this.input = el;
|
|
2392
2675
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
2393
|
-
index.h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => option.group !== undefined ? (index.h("optgroup", { label: option.group }, option.options.map(optgroup => (index.h("option", { value: optgroup.title, selected: JSON.stringify(this.value) === JSON.stringify(optgroup.value), disabled: optgroup.disabled }, optgroup.title))))) : (index.h("option", { value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title))))));
|
|
2676
|
+
index.h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => option.group !== undefined ? (index.h("optgroup", { label: option.group }, option.options.map(optgroup => (index.h("option", { key: optgroup.title, value: optgroup.title, selected: JSON.stringify(this.value) === JSON.stringify(optgroup.value), disabled: optgroup.disabled }, optgroup.title))))) : (index.h("option", { value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title))))));
|
|
2394
2677
|
}
|
|
2395
2678
|
get element() { return index.getElement(this); }
|
|
2396
2679
|
static get watchers() { return {
|
|
@@ -2403,7 +2686,7 @@ const MgInputSelect = class {
|
|
|
2403
2686
|
};
|
|
2404
2687
|
MgInputSelect.style = mgInputSelectCss;
|
|
2405
2688
|
|
|
2406
|
-
const mgInputTextCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem
|
|
2689
|
+
const mgInputTextCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box{width:100%}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{max-width:100%}.mg-input:not(.mg-input--label-on-top) .mg-input__box{width:100%;max-width:calc(17.7rem + var(--mg-inputs-spacer) * 2);min-width:5rem}.mg-input.mg-input--width-16 .mg-input__input-container{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input{width:100%;max-width:21rem}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box{max-width:21rem;min-width:100%}.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box{max-width:7rem}.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box{max-width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input.mg-input--has-icon .mg-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-input.mg-input--has-icon .mg-input__with-character-left .mg-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer) * 2)}.mg-input__with-character-left{position:relative;display:inline-flex}.mg-input--width-full .mg-input__with-character-left{width:100%}.mg-input.is-focused .mg-input__with-character-left .mg-input__box{padding-right:calc(var(--mg-character-left-message-length) * 1ch + 0.8rem)}.mg-input__with-character-left mg-character-left{position:absolute;display:none;top:50%;right:1rem;opacity:0.6;transform:translateY(-50%);font-size:1.1rem}.mg-input.is-focused .mg-input__with-character-left mg-character-left{display:block}";
|
|
2407
2690
|
|
|
2408
2691
|
const MgInputText = class {
|
|
2409
2692
|
constructor(hostRef) {
|
|
@@ -2621,7 +2904,7 @@ const MgInputText = class {
|
|
|
2621
2904
|
};
|
|
2622
2905
|
MgInputText.style = mgInputTextCss;
|
|
2623
2906
|
|
|
2624
|
-
const mgInputTextareaCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem
|
|
2907
|
+
const mgInputTextareaCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0;border-bottom-right-radius:0}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box{width:100%}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{max-width:100%}.mg-input:not(.mg-input--label-on-top) .mg-input__box{width:100%;max-width:calc(17.7rem + var(--mg-inputs-spacer) * 2);min-width:5rem}.mg-input.mg-input--width-16 .mg-input__input-container{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input{width:100%;max-width:21rem}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left{width:100%}.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box{max-width:21rem;min-width:100%}.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box{max-width:7rem}.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box{max-width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input .mg-input__box{display:block;height:auto;resize:none}.mg-input .mg-input__box.mg-input__box--resizable{resize:both}.mg-input .mg-input__box.mg-input__box--resizable-horizontal{resize:horizontal}.mg-input .mg-input__box.mg-input__box--resizable-vertical{resize:vertical}.mg-input__with-character-left{width:100%}.mg-input__with-character-left mg-character-left{display:block;visibility:hidden;margin-top:0.2rem;text-align:end}.mg-input.is-focused .mg-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-input__box{overflow-x:hidden}}";
|
|
2625
2908
|
|
|
2626
2909
|
const MgInputTextarea = class {
|
|
2627
2910
|
constructor(hostRef) {
|
|
@@ -2665,7 +2948,7 @@ const MgInputTextarea = class {
|
|
|
2665
2948
|
};
|
|
2666
2949
|
/**
|
|
2667
2950
|
* Get pattern validity
|
|
2668
|
-
* Pattern is not defined on textarea field
|
|
2951
|
+
* Pattern is not defined on textarea field: https://developer.mozilla.org/fr/docs/Web/HTML/Element/Textarea
|
|
2669
2952
|
*
|
|
2670
2953
|
* @returns {boolean} is pattern valid
|
|
2671
2954
|
*/
|
|
@@ -2857,7 +3140,7 @@ const MgInputTitle = class {
|
|
|
2857
3140
|
};
|
|
2858
3141
|
MgInputTitle.style = mgInputTitleCss;
|
|
2859
3142
|
|
|
2860
|
-
const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input.mg-input.mg-input--toggle .mg-input__input-container{flex:auto;min-width:0}.mg-input__button-toggle{display:flex;padding:0.2rem;min-width:0;background-color:hsl(var(--color-light));border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:calc((var(--font-size) * var(--line-height) + 2 * (0.7rem + var(--mg-inputs-border-width))) / var(--mg-input-toggle-border-radius-ratio));font-family:var(--font-family);font-size:inherit;line-height:inherit;cursor:pointer}.mg-input__button-toggle:disabled{cursor:default}.mg-input__toggle-item-container{padding:0.5rem 0.9rem;border:0;box-sizing:border-box;border-radius:calc((var(--font-size) * var(--line-height) + 1rem) / var(--mg-input-toggle-border-radius-ratio));background-color:unset;font-weight:unset;color:hsl(var(--color-dark));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--font-size) * var(--line-height) + 1rem);height:calc(var(--font-size) * var(--line-height) + 1rem);padding:0;visibility:hidden}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container:first-of-type{visibility:visible}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container ::slotted(mg-icon){display:flex}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{visibility:hidden}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{visibility:visible}.mg-input.mg-input--toggle-on-off .mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-dark));background-color:hsl(var(--color-dark-h), calc(var(--color-dark-s) - 30%), calc(var(--color-dark-l) + 75%))}.mg-input.mg-input--toggle-on-off.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-readonly .mg-input__button-toggle{border-color:transparent;background-color:transparent;cursor:initial}.mg-input.mg-input--toggle-readonly .mg-input__toggle-item-container:last-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{display:flex}
|
|
3143
|
+
const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input.mg-input.mg-input--toggle .mg-input__input-container{flex:auto;min-width:0}.mg-input__button-toggle{display:flex;padding:0.2rem;min-width:0;background-color:hsl(var(--color-light));border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:calc((var(--font-size) * var(--line-height) + 2 * (0.7rem + var(--mg-inputs-border-width))) / var(--mg-input-toggle-border-radius-ratio));font-family:var(--font-family);font-size:inherit;line-height:inherit;cursor:pointer}.mg-input__button-toggle:disabled{cursor:default}.mg-input__toggle-item-container{padding:0.5rem 0.9rem;border:0;box-sizing:border-box;border-radius:calc((var(--font-size) * var(--line-height) + 1rem) / var(--mg-input-toggle-border-radius-ratio));background-color:unset;font-weight:unset;color:hsl(var(--color-dark));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--font-size) * var(--line-height) + 1rem);height:calc(var(--font-size) * var(--line-height) + 1rem);padding:0;visibility:hidden}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container:first-of-type{visibility:visible}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container ::slotted(mg-icon){display:flex}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{visibility:hidden}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{visibility:visible}.mg-input.mg-input--toggle-on-off .mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-dark));background-color:hsl(var(--color-dark-h), calc(var(--color-dark-s) - 30%), calc(var(--color-dark-l) + 75%))}.mg-input.mg-input--toggle-on-off.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-readonly .mg-input__button-toggle{border-color:transparent;background-color:transparent;cursor:initial}.mg-input.mg-input--toggle-readonly .mg-input__toggle-item-container:last-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{display:flex}";
|
|
2861
3144
|
|
|
2862
3145
|
/**
|
|
2863
3146
|
* type Option validation function
|
|
@@ -3000,56 +3283,199 @@ const MgInputToggle = class {
|
|
|
3000
3283
|
this.checked = this.value === this.options[1].value;
|
|
3001
3284
|
}
|
|
3002
3285
|
}
|
|
3003
|
-
/*************
|
|
3004
|
-
* Lifecycle *
|
|
3005
|
-
*************/
|
|
3006
|
-
/**
|
|
3007
|
-
* Check if component props are well configured on init
|
|
3008
|
-
*/
|
|
3009
|
-
componentWillLoad() {
|
|
3010
|
-
// Check items format
|
|
3011
|
-
this.validateItems(this.items);
|
|
3012
|
-
// Check slots
|
|
3013
|
-
this.validateSlots();
|
|
3014
|
-
// init checked value
|
|
3015
|
-
this.setChecked();
|
|
3016
|
-
// apply handler
|
|
3017
|
-
this.handleIsOnOff(this.isOnOff);
|
|
3018
|
-
this.handleIsIcon(this.isIcon);
|
|
3019
|
-
this.handleReadonly(this.readonly);
|
|
3020
|
-
this.handleDisabled(this.disabled);
|
|
3021
|
-
}
|
|
3022
|
-
/**
|
|
3023
|
-
* Render
|
|
3024
|
-
*
|
|
3025
|
-
* @returns {HTMLElement} HTML Element
|
|
3026
|
-
*/
|
|
3027
|
-
render() {
|
|
3028
|
-
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, index.h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, index.h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, index.h("slot", { name: "item-1" })), index.h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, index.h("slot", { name: "item-2" })))));
|
|
3029
|
-
}
|
|
3030
|
-
get element() { return index.getElement(this); }
|
|
3031
|
-
static get watchers() { return {
|
|
3032
|
-
"value": ["handleValue"],
|
|
3033
|
-
"items": ["validateItems"],
|
|
3034
|
-
"isOnOff": ["handleIsOnOff"],
|
|
3035
|
-
"isIcon": ["handleIsIcon"],
|
|
3036
|
-
"readonly": ["handleReadonly"],
|
|
3037
|
-
"disabled": ["handleDisabled"],
|
|
3038
|
-
"checked": ["handleChecked"]
|
|
3039
|
-
}; }
|
|
3040
|
-
};
|
|
3041
|
-
MgInputToggle.style = mgInputToggleCss;
|
|
3042
|
-
|
|
3043
|
-
/**
|
|
3044
|
-
*
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3286
|
+
/*************
|
|
3287
|
+
* Lifecycle *
|
|
3288
|
+
*************/
|
|
3289
|
+
/**
|
|
3290
|
+
* Check if component props are well configured on init
|
|
3291
|
+
*/
|
|
3292
|
+
componentWillLoad() {
|
|
3293
|
+
// Check items format
|
|
3294
|
+
this.validateItems(this.items);
|
|
3295
|
+
// Check slots
|
|
3296
|
+
this.validateSlots();
|
|
3297
|
+
// init checked value
|
|
3298
|
+
this.setChecked();
|
|
3299
|
+
// apply handler
|
|
3300
|
+
this.handleIsOnOff(this.isOnOff);
|
|
3301
|
+
this.handleIsIcon(this.isIcon);
|
|
3302
|
+
this.handleReadonly(this.readonly);
|
|
3303
|
+
this.handleDisabled(this.disabled);
|
|
3304
|
+
}
|
|
3305
|
+
/**
|
|
3306
|
+
* Render
|
|
3307
|
+
*
|
|
3308
|
+
* @returns {HTMLElement} HTML Element
|
|
3309
|
+
*/
|
|
3310
|
+
render() {
|
|
3311
|
+
return (index.h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, index.h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, index.h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, index.h("slot", { name: "item-1" })), index.h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, index.h("slot", { name: "item-2" })))));
|
|
3312
|
+
}
|
|
3313
|
+
get element() { return index.getElement(this); }
|
|
3314
|
+
static get watchers() { return {
|
|
3315
|
+
"value": ["handleValue"],
|
|
3316
|
+
"items": ["validateItems"],
|
|
3317
|
+
"isOnOff": ["handleIsOnOff"],
|
|
3318
|
+
"isIcon": ["handleIsIcon"],
|
|
3319
|
+
"readonly": ["handleReadonly"],
|
|
3320
|
+
"disabled": ["handleDisabled"],
|
|
3321
|
+
"checked": ["handleChecked"]
|
|
3322
|
+
}; }
|
|
3323
|
+
};
|
|
3324
|
+
MgInputToggle.style = mgInputToggleCss;
|
|
3325
|
+
|
|
3326
|
+
/**
|
|
3327
|
+
* MgMenuItem type guard
|
|
3328
|
+
*
|
|
3329
|
+
* @param {HTMLElement} element element to control type
|
|
3330
|
+
* @returns {boolean} truthy if element is mg-menu-item
|
|
3331
|
+
*/
|
|
3332
|
+
const isMgMenuItem = (element) => element.nodeName === 'MG-MENU-ITEM';
|
|
3333
|
+
var OverflowBehaviorElements;
|
|
3334
|
+
(function (OverflowBehaviorElements) {
|
|
3335
|
+
OverflowBehaviorElements["MORE"] = "data-overflow-more";
|
|
3336
|
+
OverflowBehaviorElements["BASE_INDEX"] = "data-overflow-base-index";
|
|
3337
|
+
OverflowBehaviorElements["PROXY_INDEX"] = "data-overflow-proxy-index";
|
|
3338
|
+
})(OverflowBehaviorElements || (OverflowBehaviorElements = {}));
|
|
3339
|
+
class OverflowBehavior {
|
|
3340
|
+
constructor(element, render) {
|
|
3341
|
+
this.element = element;
|
|
3342
|
+
this.render = render;
|
|
3343
|
+
/**********
|
|
3344
|
+
* Public *
|
|
3345
|
+
**********/
|
|
3346
|
+
/**
|
|
3347
|
+
* Disconnect ResizeObserver
|
|
3348
|
+
*
|
|
3349
|
+
* @returns {void}
|
|
3350
|
+
*/
|
|
3351
|
+
this.disconnect = () => {
|
|
3352
|
+
this.resizeObserver.disconnect();
|
|
3353
|
+
};
|
|
3354
|
+
/************
|
|
3355
|
+
* Internal *
|
|
3356
|
+
************/
|
|
3357
|
+
/**
|
|
3358
|
+
* run overflow behavior
|
|
3359
|
+
*
|
|
3360
|
+
* @param {number} width width of the container
|
|
3361
|
+
* @returns {void}
|
|
3362
|
+
*/
|
|
3363
|
+
this.run = (width) => {
|
|
3364
|
+
if (this.moreElement === undefined) {
|
|
3365
|
+
// set moreElement
|
|
3366
|
+
this.moreElement = this.render();
|
|
3367
|
+
this.moreElement.setAttribute(OverflowBehaviorElements.MORE, '');
|
|
3368
|
+
// set children
|
|
3369
|
+
this.children = Array.from(this.element.children);
|
|
3370
|
+
let moreElementChildren;
|
|
3371
|
+
const allowedElements = ['MG-MENU-ITEM', 'MG-BUTTON'];
|
|
3372
|
+
if (isMgMenuItem(this.moreElement)) {
|
|
3373
|
+
moreElementChildren = Array.from(this.moreElement.querySelector('mg-menu').children).filter(element => allowedElements.includes(element.nodeName));
|
|
3374
|
+
}
|
|
3375
|
+
this.children.forEach((child, index) => {
|
|
3376
|
+
child.setAttribute(OverflowBehaviorElements.BASE_INDEX, `${index}`);
|
|
3377
|
+
if (child.getAttribute(OverflowBehaviorElements.MORE) === null) {
|
|
3378
|
+
// set moreElement children
|
|
3379
|
+
moreElementChildren[index].setAttribute(OverflowBehaviorElements.PROXY_INDEX, `${index}`);
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3382
|
+
}
|
|
3383
|
+
this.updateDisplayedItems(width);
|
|
3384
|
+
};
|
|
3385
|
+
/**
|
|
3386
|
+
* Update displayed items in container from a given available space
|
|
3387
|
+
*
|
|
3388
|
+
* @param {number} availableWidth available width in container to display child items
|
|
3389
|
+
* @returns {void}
|
|
3390
|
+
*/
|
|
3391
|
+
this.updateDisplayedItems = (availableWidth) => {
|
|
3392
|
+
this.restoreItems();
|
|
3393
|
+
const acc = { accWidth: 0, previousItem: null };
|
|
3394
|
+
this.children.forEach((child) => {
|
|
3395
|
+
acc.accWidth += child.offsetWidth;
|
|
3396
|
+
const isPreviousItemHidden = acc.previousItem !== null && acc.previousItem.getAttribute('hidden') !== null;
|
|
3397
|
+
// if previous item is hidden AND is NOT more element we hidde current
|
|
3398
|
+
// OR if item has an overflow we hidde current
|
|
3399
|
+
// OR if current item is more element AND have NOT previous hidden items, current more element item is an hidden item
|
|
3400
|
+
// ELSE current is a display item
|
|
3401
|
+
this.toggleItem(child, (isPreviousItemHidden && !this.isMoreElement(child)) || this.isOverflowElement(acc.accWidth, child, availableWidth) || (this.isMoreElement(child) && !isPreviousItemHidden));
|
|
3402
|
+
// update previous item with current item
|
|
3403
|
+
acc.previousItem = child;
|
|
3404
|
+
});
|
|
3405
|
+
};
|
|
3406
|
+
/**
|
|
3407
|
+
* Utility method to know if item overflow partialy or totaly in the container
|
|
3408
|
+
*
|
|
3409
|
+
* @param {number} cumulateWidth previous sibling elements cumulate width + item width
|
|
3410
|
+
* @param {HTMLElement} item item HTML element
|
|
3411
|
+
* @param {number} availableWidth container available width
|
|
3412
|
+
* @returns {boolean} truthy if element is overflow
|
|
3413
|
+
*/
|
|
3414
|
+
this.isOverflowElement = (cumulateWidth, item, availableWidth) => {
|
|
3415
|
+
if (item.previousElementSibling === null || this.isMoreElement(item))
|
|
3416
|
+
return false;
|
|
3417
|
+
else if (!this.isMoreElement(item.nextElementSibling))
|
|
3418
|
+
return cumulateWidth + this.moreElement.offsetWidth > availableWidth;
|
|
3419
|
+
else
|
|
3420
|
+
return cumulateWidth > availableWidth;
|
|
3421
|
+
};
|
|
3422
|
+
/**
|
|
3423
|
+
* Utility method to know if a given element is the 'MORE' element
|
|
3424
|
+
*
|
|
3425
|
+
* @param {Element} element element to match with 'MORE' element
|
|
3426
|
+
* @returns {boolean} truthy if element is the 'MORE' element
|
|
3427
|
+
*/
|
|
3428
|
+
this.isMoreElement = (element) => element.getAttribute(OverflowBehaviorElements.MORE) !== null;
|
|
3429
|
+
/**
|
|
3430
|
+
* Toggle display item element
|
|
3431
|
+
*
|
|
3432
|
+
* @param {HTMLElement} item item to control
|
|
3433
|
+
* @param {boolean} isHidden is item hidden
|
|
3434
|
+
* @returns {void}
|
|
3435
|
+
*/
|
|
3436
|
+
this.toggleItem = (item, isHidden) => {
|
|
3437
|
+
const mgActionMenuindex = Number(item.getAttribute(OverflowBehaviorElements.BASE_INDEX));
|
|
3438
|
+
if (this.isMoreElement(item))
|
|
3439
|
+
this.toggleElement(this.moreElement, isHidden);
|
|
3440
|
+
else if (mgActionMenuindex >= 0) {
|
|
3441
|
+
this.toggleElement(item, isHidden);
|
|
3442
|
+
this.toggleElement(this.moreElement.querySelector(`[${OverflowBehaviorElements.PROXY_INDEX}="${mgActionMenuindex}"]`), !isHidden);
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
/**
|
|
3446
|
+
* Toggle element's hidde attribute
|
|
3447
|
+
*
|
|
3448
|
+
* @param {Element} element element to toggle
|
|
3449
|
+
* @param {boolean} isHidden element is hidden
|
|
3450
|
+
* @returns {void}
|
|
3451
|
+
*/
|
|
3452
|
+
this.toggleElement = (element, isHidden) => {
|
|
3453
|
+
if (isHidden)
|
|
3454
|
+
element.setAttribute('hidden', '');
|
|
3455
|
+
else
|
|
3456
|
+
element.removeAttribute('hidden');
|
|
3457
|
+
};
|
|
3458
|
+
/**
|
|
3459
|
+
* Remove hidden attributes on all items
|
|
3460
|
+
*
|
|
3461
|
+
* @returns {void}
|
|
3462
|
+
*/
|
|
3463
|
+
this.restoreItems = () => {
|
|
3464
|
+
this.children.forEach(item => item.removeAttribute('hidden'));
|
|
3465
|
+
};
|
|
3466
|
+
if (this.resizeObserver === undefined) {
|
|
3467
|
+
// add resize observer
|
|
3468
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
3469
|
+
entries.forEach(entry => {
|
|
3470
|
+
this.run(entry.contentRect.width);
|
|
3471
|
+
});
|
|
3472
|
+
});
|
|
3473
|
+
this.resizeObserver.observe(this.element);
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3051
3477
|
|
|
3052
|
-
const mgMenuCss = ":host{display:flex;background-color:hsl(var(--mg-menu-background-color-hsl, var(--color-light)))}:host([direction=vertical]){flex-direction:column;height:100%;overflow-y:auto}";
|
|
3478
|
+
const mgMenuCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}:host{display:flex;background-color:hsl(var(--mg-menu-background-color-hsl, var(--color-light)))}:host([direction=vertical]){flex-direction:column;height:100%;overflow-y:auto}";
|
|
3053
3479
|
|
|
3054
3480
|
const MgMenu = class {
|
|
3055
3481
|
constructor(hostRef) {
|
|
@@ -3058,11 +3484,12 @@ const MgMenu = class {
|
|
|
3058
3484
|
* Internal *
|
|
3059
3485
|
************/
|
|
3060
3486
|
this.name = 'mg-menu';
|
|
3487
|
+
this.menuItems = [];
|
|
3061
3488
|
this.focusedMenuItem = 0;
|
|
3062
3489
|
/**
|
|
3063
3490
|
* Close matching menu-item
|
|
3064
3491
|
*
|
|
3065
|
-
* @param {
|
|
3492
|
+
* @param {HTMLElement} item menu-item to close
|
|
3066
3493
|
* @param {boolean} condition addionnal condition
|
|
3067
3494
|
* @returns {void}
|
|
3068
3495
|
*/
|
|
@@ -3071,12 +3498,15 @@ const MgMenu = class {
|
|
|
3071
3498
|
item.expanded = false;
|
|
3072
3499
|
}
|
|
3073
3500
|
};
|
|
3501
|
+
/*************
|
|
3502
|
+
* Methods *
|
|
3503
|
+
*************/
|
|
3074
3504
|
/**
|
|
3075
3505
|
* Store menu-items on component init and add listeners
|
|
3506
|
+
*
|
|
3507
|
+
* @returns {void}
|
|
3076
3508
|
*/
|
|
3077
|
-
this.
|
|
3078
|
-
// store all menu-items
|
|
3079
|
-
this.menuItems = Array.from(this.element.children).filter(child => child.nodeName === 'MG-MENU-ITEM');
|
|
3509
|
+
this.initMenuItemsListeners = () => {
|
|
3080
3510
|
// add listeners on menu item and edit index
|
|
3081
3511
|
this.menuItems.forEach((item, menuItemIndex) => {
|
|
3082
3512
|
['click', 'focus'].forEach(trigger => {
|
|
@@ -3090,9 +3520,46 @@ const MgMenu = class {
|
|
|
3090
3520
|
});
|
|
3091
3521
|
});
|
|
3092
3522
|
};
|
|
3523
|
+
/**
|
|
3524
|
+
* render mg-menu-more
|
|
3525
|
+
*
|
|
3526
|
+
* @returns {HTMLElement} formated mg-menu-item element
|
|
3527
|
+
*/
|
|
3528
|
+
this.renderMgMenuMore = () => {
|
|
3529
|
+
const moreElement = this.element.shadowRoot.querySelector(`[${OverflowBehaviorElements.MORE}]`);
|
|
3530
|
+
this.menuItems.forEach((child) => {
|
|
3531
|
+
const proxy = child.cloneNode(true);
|
|
3532
|
+
moreElement.querySelector('mg-menu').appendChild(proxy);
|
|
3533
|
+
});
|
|
3534
|
+
const allMenuItem = Array.from(this.element.querySelectorAll('mg-menu-item:not([data-overflow-more])'));
|
|
3535
|
+
Array.from(moreElement.querySelectorAll('mg-menu-item:not([data-overflow-more])')).forEach((proxy, index) => {
|
|
3536
|
+
// manage click on proxy to mirror it on initial element
|
|
3537
|
+
proxy.addEventListener('click', () => {
|
|
3538
|
+
(allMenuItem[index].shadowRoot.querySelector('a') || allMenuItem[index].shadowRoot.querySelector('button')).dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
3539
|
+
});
|
|
3540
|
+
// manage status change miror in proxy
|
|
3541
|
+
allMenuItem[index].addEventListener('status-change', (event) => {
|
|
3542
|
+
proxy.setAttribute('status', event.detail);
|
|
3543
|
+
});
|
|
3544
|
+
});
|
|
3545
|
+
this.element.appendChild(moreElement);
|
|
3546
|
+
return this.element.querySelector(`[${OverflowBehaviorElements.MORE}]`);
|
|
3547
|
+
};
|
|
3548
|
+
/**
|
|
3549
|
+
* Render mg-menu-item more element for overflow behavior
|
|
3550
|
+
*
|
|
3551
|
+
* @returns {HTMLElement} rendered mg-menu-item more element
|
|
3552
|
+
*/
|
|
3553
|
+
this.renderMgMenuItemMore = () => {
|
|
3554
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3555
|
+
return (index.h("mg-menu-item", { "data-overflow-more": true }, index.h("mg-icon", { icon: ((_b = (_a = this.moreitem) === null || _a === void 0 ? void 0 : _a.mgIcon) === null || _b === void 0 ? void 0 : _b.icon) || 'ellipsis-vertical', slot: "image" }), index.h("span", { class: { 'sr-only': !((_d = (_c = this.moreitem) === null || _c === void 0 ? void 0 : _c.slotLabel) === null || _d === void 0 ? void 0 : _d.display) }, slot: "label" }, ((_f = (_e = this.moreitem) === null || _e === void 0 ? void 0 : _e.slotLabel) === null || _f === void 0 ? void 0 : _f.label) || this.messages.moreLabel), index.h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.moreLabel, size: (_g = this.moreitem) === null || _g === void 0 ? void 0 : _g.size })));
|
|
3556
|
+
};
|
|
3093
3557
|
this.label = undefined;
|
|
3094
3558
|
this.direction = Direction.HORIZONTAL;
|
|
3559
|
+
this.moreitem = undefined;
|
|
3560
|
+
this.size = 'regular';
|
|
3095
3561
|
this.isChildMenu = undefined;
|
|
3562
|
+
this.hasOverflow = false;
|
|
3096
3563
|
}
|
|
3097
3564
|
validateLabel(newValue) {
|
|
3098
3565
|
if (newValue === undefined) {
|
|
@@ -3101,7 +3568,20 @@ const MgMenu = class {
|
|
|
3101
3568
|
}
|
|
3102
3569
|
validateDirection(newValue) {
|
|
3103
3570
|
if (![Direction.VERTICAL, Direction.HORIZONTAL].includes(newValue)) {
|
|
3104
|
-
throw new Error(`<${this.name}> prop "direction" must be one of
|
|
3571
|
+
throw new Error(`<${this.name}> prop "direction" must be one of: ${Direction.HORIZONTAL}, ${Direction.VERTICAL}.`);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
validateMoreItem(newValue) {
|
|
3575
|
+
if (newValue !== undefined && this.direction !== Direction.HORIZONTAL) {
|
|
3576
|
+
throw new Error(`<${this.name}> prop "moreitem" must be paired with direction ${Direction.HORIZONTAL}.`);
|
|
3577
|
+
}
|
|
3578
|
+
else if (newValue !== undefined && !isMoreItem(newValue)) {
|
|
3579
|
+
throw new Error(`<${this.name}> prop "moreitem" must match MoreItemType.`);
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
validateSize(newValue) {
|
|
3583
|
+
if (!sizes$2.includes(newValue)) {
|
|
3584
|
+
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes$2.join(', ')}.`);
|
|
3105
3585
|
}
|
|
3106
3586
|
}
|
|
3107
3587
|
/*************
|
|
@@ -3113,8 +3593,12 @@ const MgMenu = class {
|
|
|
3113
3593
|
* @returns {void}
|
|
3114
3594
|
*/
|
|
3115
3595
|
componentWillLoad() {
|
|
3596
|
+
this.messages = initLocales(this.element).messages.plusMenu;
|
|
3597
|
+
// validation
|
|
3116
3598
|
this.validateDirection(this.direction);
|
|
3117
3599
|
this.validateLabel(this.label);
|
|
3600
|
+
this.validateMoreItem(this.moreitem);
|
|
3601
|
+
this.validateSize(this.size);
|
|
3118
3602
|
}
|
|
3119
3603
|
/**
|
|
3120
3604
|
* Check if component slots configuration
|
|
@@ -3126,72 +3610,64 @@ const MgMenu = class {
|
|
|
3126
3610
|
// return a promise to process action only in the FIRST render().
|
|
3127
3611
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
3128
3612
|
return setTimeout(() => {
|
|
3129
|
-
|
|
3613
|
+
// store all menu-items
|
|
3614
|
+
this.menuItems = Array.from(this.element.children).filter(child => child.nodeName === 'MG-MENU-ITEM');
|
|
3130
3615
|
this.isChildMenu = this.element.closest('mg-menu-item') !== null;
|
|
3131
|
-
|
|
3132
|
-
if (
|
|
3133
|
-
|
|
3134
|
-
if (event.target.closest('mg-menu') === null) {
|
|
3135
|
-
this.menuItems.forEach(item => {
|
|
3136
|
-
this.closeMenuItem(item, this.direction === Direction.HORIZONTAL);
|
|
3137
|
-
});
|
|
3138
|
-
}
|
|
3139
|
-
});
|
|
3140
|
-
}
|
|
3616
|
+
this.hasOverflow = this.direction === Direction.HORIZONTAL && !this.isChildMenu;
|
|
3617
|
+
if (this.hasOverflow && isMoreItem(this.moreitem))
|
|
3618
|
+
this.overflowBehavior = new OverflowBehavior(this.element, this.renderMgMenuMore);
|
|
3141
3619
|
}, 0);
|
|
3142
3620
|
}
|
|
3621
|
+
/**
|
|
3622
|
+
* Check add listeners to childs
|
|
3623
|
+
*
|
|
3624
|
+
* @returns {void}
|
|
3625
|
+
*/
|
|
3626
|
+
componentDidRender() {
|
|
3627
|
+
// add menu items listeners
|
|
3628
|
+
this.initMenuItemsListeners();
|
|
3629
|
+
}
|
|
3630
|
+
/**
|
|
3631
|
+
* Disconnect overflow ResizeObserver
|
|
3632
|
+
*
|
|
3633
|
+
* @returns {void} run overflow resize obeserver disconnexion
|
|
3634
|
+
*/
|
|
3635
|
+
disconnectedCallback() {
|
|
3636
|
+
if (this.hasOverflow)
|
|
3637
|
+
this.overflowBehavior.disconnect();
|
|
3638
|
+
}
|
|
3143
3639
|
/**
|
|
3144
3640
|
* Render
|
|
3145
3641
|
*
|
|
3146
3642
|
* @returns {HTMLElement} HTML Element
|
|
3147
3643
|
*/
|
|
3148
3644
|
render() {
|
|
3149
|
-
return (index.h(index.Host, { role: this.isChildMenu ? 'menu' : 'menubar', "aria-label": this.label }, index.h("slot", null)));
|
|
3645
|
+
return (index.h(index.Host, { role: this.isChildMenu ? 'menu' : 'menubar', "aria-label": this.label }, index.h("slot", null), this.hasOverflow && isMoreItem(this.moreitem) && this.renderMgMenuItemMore()));
|
|
3150
3646
|
}
|
|
3151
3647
|
get element() { return index.getElement(this); }
|
|
3152
3648
|
static get watchers() { return {
|
|
3153
3649
|
"label": ["validateLabel"],
|
|
3154
|
-
"direction": ["validateDirection"]
|
|
3650
|
+
"direction": ["validateDirection"],
|
|
3651
|
+
"moreitem": ["validateMoreItem"],
|
|
3652
|
+
"size": ["validateSize"]
|
|
3155
3653
|
}; }
|
|
3156
3654
|
};
|
|
3157
3655
|
MgMenu.style = mgMenuCss;
|
|
3158
3656
|
|
|
3159
|
-
/**
|
|
3160
|
-
* Available menu-item positions
|
|
3161
|
-
*/
|
|
3162
|
-
var ElementPosition;
|
|
3163
|
-
(function (ElementPosition) {
|
|
3164
|
-
ElementPosition["FIRST"] = "first";
|
|
3165
|
-
ElementPosition["LAST"] = "last";
|
|
3166
|
-
})(ElementPosition || (ElementPosition = {}));
|
|
3167
|
-
/**
|
|
3168
|
-
* Available menu item status
|
|
3169
|
-
*/
|
|
3170
|
-
var Status$1;
|
|
3171
|
-
(function (Status) {
|
|
3172
|
-
Status["VISIBLE"] = "visible";
|
|
3173
|
-
Status["HIDDEN"] = "hidden";
|
|
3174
|
-
Status["DISABLED"] = "disabled";
|
|
3175
|
-
Status["ACTIVE"] = "active";
|
|
3176
|
-
})(Status$1 || (Status$1 = {}));
|
|
3177
|
-
/**
|
|
3178
|
-
* List of all possibles sizes
|
|
3179
|
-
*/
|
|
3180
|
-
const sizes$1 = ['regular', 'medium', 'large'];
|
|
3181
|
-
|
|
3182
|
-
const mgMenuItemCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding:1rem 2rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=metadata]){font-size:1.3rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding:1.5rem 3rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding:2.5rem 4rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(2.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--vertical{padding-left:calc(4rem - 0.3rem)}.mg-menu-item__navigation-button{display:flex;align-items:center;column-gap:1rem;background-color:unset;border:none;font-family:var(--font-family);color:hsl(var(--mg-menu-item-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;cursor:pointer}.mg-menu-item__navigation-button:disabled,.mg-menu-item__navigation-button--disabled{cursor:default;opacity:30%}.mg-menu-item__navigation-button:focus-visible{z-index:10}.mg-menu-item__navigation-button:hover:not(.mg-menu-item__navigation-button--disabled),.mg-menu-item__navigation-button:focus:not(.mg-menu-item__navigation-button--disabled){background-color:hsla(var(--mg-menu-item-focused-background-color-hsl), 10%)}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active{color:hsl(var(--mg-menu-item-color-active-hsl));font-weight:700}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--vertical{border-left-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--hidden{display:none}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical{border-left:0.3rem solid transparent}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(1 * 2rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(2 * 2rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(3 * 2rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(4 * 2rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(5 * 2rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(6 * 2rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(1 * 3rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(2 * 3rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(3 * 3rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(4 * 3rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(5 * 3rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(6 * 3rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(1 * 4rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(2 * 4rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(3 * 4rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(4 * 4rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(5 * 4rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(6 * 4rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host{position:relative;display:flex}:host([data-style-position-last]) .mg-menu-item__collapse-container{left:unset;right:0}:host([data-style-direction-vertical]){flex-direction:column}:host([data-style-direction-vertical]) .mg-menu-item__collapse-container{left:unset;top:unset;position:unset;width:unset}:host([data-style-direction-vertical]) .mg-menu-item-chevron{margin-left:auto}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level{box-shadow:var(--box-shadow);background-color:hsl(var(--color-light))}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:1rem 0}.mg-menu-item{max-width:var(--mg-menu-item-navigation-button-max-width)}.mg-menu-item__collapse-container{position:absolute;top:100%;left:0;width:max-content;z-index:10}.mg-menu-item__navigation-button-center{min-width:0}.mg-menu-item__navigation-button-text-content{width:100%;display:flex}.mg-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:1rem}.mg-menu-item__navigation-button-chevron{margin-left:auto;transition:200ms}.mg-menu-item__navigation-button-chevron--rotate.mg-menu-item__navigation-button-chevron{transform:rotate(180deg)}::slotted([slot=label]),::slotted([slot=metadata]){display:block;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([status=disabled]){pointer-events:none}";
|
|
3657
|
+
const mgMenuItemCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding:1rem 2rem;height:calc(3.8rem)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=metadata]){font-size:var(--font-size)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding:1rem 3rem;height:calc(5.1rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:calc(var(--font-size) + 0.2rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding:1rem 4rem;height:calc(7.1rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:calc(var(--font-size) + 0.2rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--vertical{padding-left:calc(4rem - 0.3rem)}.mg-menu-item__navigation-button{display:flex;align-items:center;column-gap:var(--mg-menu-item-navigation-button-column-gap, 1rem);background-color:unset;border:none;font-family:var(--font-family);font-weight:400;color:hsl(var(--mg-menu-item-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;white-space:nowrap;box-sizing:border-box;cursor:pointer}.mg-menu-item__navigation-button:disabled,.mg-menu-item__navigation-button--disabled{cursor:default;opacity:var(--mg-disabled-opacity)}.mg-menu-item__navigation-button:focus-visible{z-index:10}.mg-menu-item__navigation-button:hover:not(.mg-menu-item__navigation-button--disabled),.mg-menu-item__navigation-button:focus-visible:not(.mg-menu-item__navigation-button--disabled){background-color:hsl(var(--mg-menu-item-focused-background-color-hsl), 0.1)}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active{color:hsl(var(--mg-menu-item-color-active-hsl));font-weight:600}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--vertical{border-left-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--hidden{display:none}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical{border-left:0.3rem solid transparent}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(1 * 2rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(2 * 2rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(3 * 2rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(4 * 2rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(5 * 2rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(6 * 2rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(1 * 3rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(2 * 3rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(3 * 3rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(4 * 3rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(5 * 3rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(6 * 3rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(1 * 4rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(2 * 4rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(3 * 4rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(4 * 4rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(5 * 4rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(6 * 4rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host{position:relative;display:flex;--mg-popover-padding-vertical:0;--mg-popover-padding-horizontal:0}:host([data-style-direction-vertical]){flex-direction:column}:host([data-style-direction-vertical]) .mg-menu-item__navigation-button{width:100%}:host([data-style-direction-vertical]) .mg-menu-item__collapse-container{left:unset;top:unset;position:unset;width:unset}:host([data-style-direction-vertical]) .mg-menu-item-chevron{margin-left:auto}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level{background-color:hsl(var(--color-light))}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:1rem 0}:host([data-overflow-more]){--mg-menu-item-navigation-button-column-gap:0}:host([data-overflow-more]) .mg-menu-item__navigation-button-chevron{display:none}:host([data-overflow-more]) .mg-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:0}:host([data-overflow-more]) ::slotted(mg-menu){--mg-menu-item-navigation-button-column-gap:1rem}.mg-menu-item{max-width:var(--mg-menu-item-navigation-button-max-width)}.mg-menu-item__collapse-container{width:max-content;z-index:10}.mg-menu-item__navigation-button-center{min-width:0}.mg-menu-item__navigation-button-text-content{width:100%;display:flex;align-items:center}.mg-menu-item__navigation-button-text-content-notification,.mg-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:1rem;font-size:var(--font-size)}.mg-menu-item__navigation-button-chevron{margin-left:auto;transition:200ms}.mg-menu-item__navigation-button-chevron--rotate.mg-menu-item__navigation-button-chevron{transform:rotate(180deg)}::slotted([slot=label]),::slotted([slot=metadata]){display:block;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}::slotted(*){display:flex;flex-direction:column}:host([status=disabled]){pointer-events:none}:host([hidden]){display:none}";
|
|
3183
3658
|
|
|
3184
3659
|
const MgMenuItem = class {
|
|
3185
3660
|
constructor(hostRef) {
|
|
3186
3661
|
index.registerInstance(this, hostRef);
|
|
3662
|
+
this.statusChange = index.createEvent(this, "status-change", 7);
|
|
3187
3663
|
/************
|
|
3188
3664
|
* Internal *
|
|
3189
3665
|
************/
|
|
3190
3666
|
this.name = 'mg-menu-item';
|
|
3191
3667
|
this.navigationButton = `${this.name}__navigation-button`;
|
|
3192
|
-
|
|
3668
|
+
/***********
|
|
3193
3669
|
* Methods *
|
|
3194
|
-
|
|
3670
|
+
**********/
|
|
3195
3671
|
/**
|
|
3196
3672
|
* Toggle expanded prop value
|
|
3197
3673
|
*
|
|
@@ -3201,20 +3677,20 @@ const MgMenuItem = class {
|
|
|
3201
3677
|
this.expanded = !this.expanded;
|
|
3202
3678
|
};
|
|
3203
3679
|
/**
|
|
3204
|
-
* Does an
|
|
3680
|
+
* Does an Element have given Status
|
|
3205
3681
|
*
|
|
3206
|
-
* @param {
|
|
3682
|
+
* @param {HTMLMgMenuItemElement} mgMenuItemElement to parse
|
|
3207
3683
|
* @param {MgMenuItem['status']} status to check
|
|
3208
3684
|
* @returns {boolean} true if element with status is found
|
|
3209
3685
|
*/
|
|
3210
|
-
this.
|
|
3686
|
+
this.hasStatus = (mgMenuItemElement, status) => mgMenuItemElement.status === status;
|
|
3211
3687
|
/**
|
|
3212
3688
|
* Is component contextual direction match the given direction
|
|
3213
3689
|
*
|
|
3214
3690
|
* @param {MgMenuItem['direction']} direction in parent menu
|
|
3215
3691
|
* @returns {boolean} true is direction match the direction propertie
|
|
3216
3692
|
*/
|
|
3217
|
-
this.
|
|
3693
|
+
this.isDirection = (direction) => this.direction === direction;
|
|
3218
3694
|
/************
|
|
3219
3695
|
* Handlers *
|
|
3220
3696
|
************/
|
|
@@ -3225,7 +3701,7 @@ const MgMenuItem = class {
|
|
|
3225
3701
|
* @returns {void}
|
|
3226
3702
|
*/
|
|
3227
3703
|
this.handleElementCLick = (event) => {
|
|
3228
|
-
if (this.hasChildren || this.status === Status$1.DISABLED) {
|
|
3704
|
+
if ((this.hasChildren && !this.isInMainMenu) || this.status === Status$1.DISABLED) {
|
|
3229
3705
|
event.preventDefault();
|
|
3230
3706
|
event.stopPropagation();
|
|
3231
3707
|
}
|
|
@@ -3233,27 +3709,60 @@ const MgMenuItem = class {
|
|
|
3233
3709
|
if (this.hasChildren)
|
|
3234
3710
|
this.toggleExpanded();
|
|
3235
3711
|
};
|
|
3712
|
+
/**
|
|
3713
|
+
* Handle popover element display-change event
|
|
3714
|
+
*
|
|
3715
|
+
* @param {CustomEvent} event popover display event
|
|
3716
|
+
* @returns {void}
|
|
3717
|
+
*/
|
|
3718
|
+
this.handlePopoverDisplay = (event) => {
|
|
3719
|
+
this.expanded = event.detail;
|
|
3720
|
+
};
|
|
3721
|
+
/**
|
|
3722
|
+
* Update displayNotificationBadge
|
|
3723
|
+
* current component notification badge have priority over the slot badge when submenu contain badge
|
|
3724
|
+
*
|
|
3725
|
+
* @returns {void} update displayNotificationBadge value
|
|
3726
|
+
*/
|
|
3727
|
+
this.updateDisplayNotificationBadge = () => {
|
|
3728
|
+
const childMenu = this.element.querySelector('mg-menu');
|
|
3729
|
+
this.displayNotificationBadge =
|
|
3730
|
+
childMenu !== null &&
|
|
3731
|
+
Array.from(childMenu.children).some((subItem) => subItem.querySelector('mg-badge') !== null && subItem.getAttribute('hidden') === null);
|
|
3732
|
+
};
|
|
3733
|
+
/**
|
|
3734
|
+
* Method to control if one of component children have active status
|
|
3735
|
+
*
|
|
3736
|
+
* @returns {boolean} truthy if component has active child
|
|
3737
|
+
*/
|
|
3738
|
+
this.hasActiveChild = () => {
|
|
3739
|
+
var _a;
|
|
3740
|
+
return Array.from(((_a = this.element.querySelector('mg-menu')) === null || _a === void 0 ? void 0 : _a.children) || [])
|
|
3741
|
+
.filter(element => element.nodeName === 'MG-MENU-ITEM')
|
|
3742
|
+
.some((element) => this.hasStatus(element, Status$1.ACTIVE) && element.getAttribute('hidden') === null);
|
|
3743
|
+
};
|
|
3744
|
+
/**
|
|
3745
|
+
* Render slot
|
|
3746
|
+
*
|
|
3747
|
+
* @returns {HTMLElement} HTML Element
|
|
3748
|
+
*/
|
|
3749
|
+
this.renderSlot = () => index.h("slot", null);
|
|
3236
3750
|
this.href = undefined;
|
|
3237
3751
|
this.status = Status$1.VISIBLE;
|
|
3238
|
-
this.size = 'large';
|
|
3239
3752
|
this.expanded = false;
|
|
3753
|
+
this.size = 'regular';
|
|
3240
3754
|
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
3241
3755
|
this.direction = undefined;
|
|
3242
3756
|
this.isInMainMenu = undefined;
|
|
3243
3757
|
this.hasChildren = false;
|
|
3758
|
+
this.displayNotificationBadge = undefined;
|
|
3244
3759
|
}
|
|
3245
3760
|
validateStatus(newValue, oldValue) {
|
|
3246
3761
|
if (oldValue !== undefined) {
|
|
3247
3762
|
this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);
|
|
3248
3763
|
}
|
|
3249
3764
|
this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);
|
|
3250
|
-
|
|
3251
|
-
validateSize(newValue, oldValue) {
|
|
3252
|
-
if (!sizes$1.includes(newValue)) {
|
|
3253
|
-
throw new Error(`<${this.name}> prop "size" must be one of : ${sizes$1.join(', ')}.`);
|
|
3254
|
-
}
|
|
3255
|
-
this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);
|
|
3256
|
-
this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);
|
|
3765
|
+
this.statusChange.emit(newValue);
|
|
3257
3766
|
}
|
|
3258
3767
|
validateExpanded(newValue) {
|
|
3259
3768
|
if (typeof newValue !== 'boolean')
|
|
@@ -3267,16 +3776,20 @@ const MgMenuItem = class {
|
|
|
3267
3776
|
item.expanded = false;
|
|
3268
3777
|
});
|
|
3269
3778
|
}
|
|
3270
|
-
else if (
|
|
3779
|
+
else if (this.element.querySelector(`${this.name}[status="${Status$1.ACTIVE}"]`) !== null) {
|
|
3271
3780
|
// - when expanded and contain an active item parents are expended too
|
|
3272
3781
|
subItems.forEach(item => {
|
|
3273
|
-
if (this.
|
|
3782
|
+
if (this.hasStatus(item, Status$1.ACTIVE)) {
|
|
3274
3783
|
item.expanded = true;
|
|
3275
3784
|
}
|
|
3276
3785
|
});
|
|
3277
3786
|
}
|
|
3278
3787
|
}
|
|
3279
3788
|
}
|
|
3789
|
+
validateSize(newValue, oldValue) {
|
|
3790
|
+
this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);
|
|
3791
|
+
this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);
|
|
3792
|
+
}
|
|
3280
3793
|
validateHasChildren(newValue) {
|
|
3281
3794
|
if (newValue && this.element.href !== undefined) {
|
|
3282
3795
|
throw new Error(`<${this.name}> prop "href" is unauthorizied when element is a parent.`);
|
|
@@ -3291,13 +3804,14 @@ const MgMenuItem = class {
|
|
|
3291
3804
|
* @returns {void}
|
|
3292
3805
|
*/
|
|
3293
3806
|
componentWillLoad() {
|
|
3294
|
-
// has children items that is NOT [slot=
|
|
3807
|
+
// has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element
|
|
3295
3808
|
// we store only matching elements
|
|
3296
|
-
this.hasChildren = Array.from(this.element.children).
|
|
3809
|
+
this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));
|
|
3297
3810
|
// Validate props
|
|
3298
3811
|
this.validateSize(this.size);
|
|
3299
3812
|
this.validateStatus(this.status);
|
|
3300
3813
|
this.validateExpanded(this.expanded);
|
|
3814
|
+
this.badgeLabel = initLocales(this.element).messages.plusMenu.badgeLabel;
|
|
3301
3815
|
}
|
|
3302
3816
|
/**
|
|
3303
3817
|
* Check if component slots configuration
|
|
@@ -3321,55 +3835,82 @@ const MgMenuItem = class {
|
|
|
3321
3835
|
// return a promise to process action only in the FIRST render().
|
|
3322
3836
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
3323
3837
|
return setTimeout(() => {
|
|
3324
|
-
var _a
|
|
3838
|
+
var _a;
|
|
3325
3839
|
// define menu-item context states
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
this.isInMainMenu = this.element.parentElement.
|
|
3330
|
-
const hasNextMenuItem = ((_a = this.element.nextElementSibling) === null || _a === void 0 ? void 0 : _a.nodeName) === 'MG-MENU-ITEM';
|
|
3331
|
-
const hasPreviousMenuItem = ((_b = this.element.previousElementSibling) === null || _b === void 0 ? void 0 : _b.nodeName) === 'MG-MENU-ITEM';
|
|
3332
|
-
// manage last menu item
|
|
3333
|
-
if (!hasNextMenuItem && hasPreviousMenuItem && this.isdirection(Direction.HORIZONTAL)) {
|
|
3334
|
-
this.element.setAttribute('data-style-position-last', '');
|
|
3335
|
-
}
|
|
3840
|
+
const menu = this.element.closest('mg-menu');
|
|
3841
|
+
this.direction = this.element.getAttribute(OverflowBehaviorElements.MORE) !== null || menu === null ? Direction.HORIZONTAL : menu.direction;
|
|
3842
|
+
this.size = menu === null || menu === void 0 ? void 0 : menu.size;
|
|
3843
|
+
this.isInMainMenu = this.element.parentElement.closest('mg-menu-item') === null;
|
|
3336
3844
|
// when main menu item contain an active item it will get the active style
|
|
3337
3845
|
// AND if item is in vertical menu it will be expanded
|
|
3338
|
-
if (this.
|
|
3846
|
+
if (this.hasActiveChild()) {
|
|
3339
3847
|
this.status = Status$1.ACTIVE;
|
|
3340
|
-
|
|
3848
|
+
if (this.isInMainMenu)
|
|
3849
|
+
this.expanded = this.isDirection(Direction.VERTICAL);
|
|
3341
3850
|
}
|
|
3342
3851
|
// manage menu items style depending to parent menu horientation
|
|
3343
3852
|
this.element.setAttribute(`data-style-direction-${this.direction}`, '');
|
|
3344
3853
|
this.navigationButtonClassList.add(`${this.navigationButton}--${this.direction}`);
|
|
3345
|
-
|
|
3346
|
-
|
|
3854
|
+
this.updateDisplayNotificationBadge();
|
|
3855
|
+
// manage all sub levels child menu-items level with data-level attribut
|
|
3856
|
+
if (this.isDirection(Direction.VERTICAL)) {
|
|
3857
|
+
Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {
|
|
3858
|
+
item.dataset.level = `${(Number(item.dataset.level) || 1) + 1}`;
|
|
3859
|
+
});
|
|
3860
|
+
}
|
|
3861
|
+
// manage first sub-level menu-items
|
|
3862
|
+
const childItems = Array.from(((_a = this.element.querySelector('mg-menu')) === null || _a === void 0 ? void 0 : _a.children) || []).filter(item => item.nodeName === 'MG-MENU-ITEM');
|
|
3347
3863
|
childItems.forEach(item => {
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3864
|
+
const updateStatus = () => {
|
|
3865
|
+
if (![Status$1.HIDDEN, Status$1.DISABLED].includes(this.status)) {
|
|
3866
|
+
this.status = this.hasActiveChild() ? Status$1.ACTIVE : Status$1.VISIBLE;
|
|
3867
|
+
}
|
|
3868
|
+
};
|
|
3869
|
+
// manage child menu listener
|
|
3870
|
+
item.addEventListener('status-change', () => {
|
|
3871
|
+
updateStatus();
|
|
3872
|
+
});
|
|
3873
|
+
new MutationObserver(mutationsList => {
|
|
3874
|
+
if (mutationsList.some(mutation => mutation.attributeName === 'hidden'))
|
|
3875
|
+
updateStatus();
|
|
3876
|
+
this.updateDisplayNotificationBadge();
|
|
3877
|
+
}).observe(item, { attributes: true });
|
|
3352
3878
|
});
|
|
3353
3879
|
}, 0);
|
|
3354
3880
|
}
|
|
3355
3881
|
/**
|
|
3356
|
-
* Render
|
|
3882
|
+
* Render ineractive element
|
|
3357
3883
|
*
|
|
3358
3884
|
* @returns {HTMLElement} HTML Element
|
|
3359
3885
|
*/
|
|
3360
|
-
|
|
3886
|
+
renderInteractiveElement() {
|
|
3361
3887
|
const TagName = this.href !== undefined ? 'a' : 'button';
|
|
3362
|
-
return (index.h(
|
|
3888
|
+
return (index.h(TagName, { href: this.href, class: this.navigationButtonClassList.join(), tabindex: [Status$1.DISABLED, Status$1.HIDDEN].includes(this.status) ? -1 : 0, disabled: this.status === Status$1.DISABLED, hidden: this.status === Status$1.HIDDEN, "aria-expanded": this.hasChildren && this.expanded.toString(), "aria-current": this.status === Status$1.ACTIVE && 'page', onClick: this.handleElementCLick }, index.h("slot", { name: "image" }), index.h("div", { class: `${this.navigationButton}-center` }, index.h("div", { class: `${this.navigationButton}-text-content` }, index.h("slot", { name: "label" }), !this.displayNotificationBadge && index.h("slot", { name: "information" }), this.displayNotificationBadge && (index.h("span", { class: "mg-menu-item__navigation-button-text-content-notification" }, index.h("mg-badge", { label: this.badgeLabel, value: "!", variant: "text-color", slot: "information" })))), this.size !== 'regular' && index.h("slot", { name: "metadata" })), this.hasChildren && this.href === undefined && (index.h("span", { class: {
|
|
3363
3889
|
[`${this.navigationButton}-chevron`]: true,
|
|
3364
3890
|
[`${this.navigationButton}-chevron--rotate`]: this.expanded === true,
|
|
3365
3891
|
'mg-a11y-animation': true,
|
|
3366
|
-
} }, index.h("mg-icon", { icon: "chevron-down" }))))
|
|
3892
|
+
} }, index.h("mg-icon", { icon: "chevron-down" })))));
|
|
3893
|
+
}
|
|
3894
|
+
/**
|
|
3895
|
+
* Render
|
|
3896
|
+
*
|
|
3897
|
+
* @returns {HTMLElement} HTML Element
|
|
3898
|
+
*/
|
|
3899
|
+
render() {
|
|
3900
|
+
const getContainerClasses = () => ({
|
|
3901
|
+
[`${this.name}__collapse-container`]: true,
|
|
3902
|
+
[`${this.name}__collapse-container--first-level`]: this.isInMainMenu && this.isDirection(Direction.HORIZONTAL),
|
|
3903
|
+
});
|
|
3904
|
+
return (index.h(index.Host, { role: "menuitem", "aria-haspopup": this.hasChildren.toString() }, this.isDirection(Direction.HORIZONTAL) && this.hasChildren && this.href === undefined ? (index.h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay }, this.renderInteractiveElement(), index.h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
|
|
3905
|
+
this.renderInteractiveElement(),
|
|
3906
|
+
index.h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
|
|
3907
|
+
])));
|
|
3367
3908
|
}
|
|
3368
3909
|
get element() { return index.getElement(this); }
|
|
3369
3910
|
static get watchers() { return {
|
|
3370
3911
|
"status": ["validateStatus"],
|
|
3371
|
-
"size": ["validateSize"],
|
|
3372
3912
|
"expanded": ["validateExpanded"],
|
|
3913
|
+
"size": ["validateSize"],
|
|
3373
3914
|
"hasChildren": ["validateHasChildren"]
|
|
3374
3915
|
}; }
|
|
3375
3916
|
};
|
|
@@ -3380,7 +3921,7 @@ MgMenuItem.style = mgMenuItemCss;
|
|
|
3380
3921
|
*/
|
|
3381
3922
|
const variants$1 = ['info', 'warning', 'success', 'danger'];
|
|
3382
3923
|
|
|
3383
|
-
const mgMessageCss = ":host{--mg-card-padding:0;--mg-card-border-radius:var(--mg-message-border-radius);--mg-card-border:none;--mg-card-overflow:hidden}.mg-message{display:inline-block;min-height:var(--default-size)}.mg-message__bar{position:absolute;top:0;left:0;width:0.3rem;height:100%}.mg-message.mg-message--info .mg-message__bar{background-color:hsl(var(--color-info))}.mg-message.mg-message--info .mg-message__icon{color:hsl(var(--color-info))}.mg-message.mg-message--warning .mg-message__bar{background-color:hsl(var(--color-warning))}.mg-message.mg-message--warning .mg-message__icon{color:hsl(var(--color-warning))}.mg-message.mg-message--success .mg-message__bar{background-color:hsl(var(--color-success))}.mg-message.mg-message--success .mg-message__icon{color:hsl(var(--color-success))}.mg-message.mg-message--danger .mg-message__bar{background-color:hsl(var(--color-danger))}.mg-message.mg-message--danger .mg-message__icon{color:hsl(var(--color-danger))}.mg-message.mg-message--close-button{--mg-card-padding:0 3.4rem 0 0}.mg-message.mg-message--hide{display:none}.mg-message ::slotted(*){margin:0;padding:0}.mg-message__icon{position:absolute;top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);left:1.3rem;line-height:1}.mg-message__content{display:flex;flex-wrap:wrap;justify-content:flex-end;align-content:stretch;padding:0 1rem 0 3.8rem}.mg-message__content-slot{flex-grow:1;margin:0.84rem 0}.mg-message__content-separator{display:inline-block;width:4.5rem;height:0}.mg-message__content-actions-slot{padding:1rem 0;text-align:right}.mg-message__close-button{position:absolute;top:0;right:0}.mg-message,mg-message{max-width:100%}";
|
|
3924
|
+
const mgMessageCss = ":host{--mg-card-padding:0;--mg-card-border-radius:var(--mg-message-border-radius);--mg-card-border:none;--mg-card-overflow:hidden}.mg-message{display:inline-block;min-height:var(--default-size)}.mg-message__bar{position:absolute;top:0;left:0;width:0.3rem;height:100%}.mg-message.mg-message--info .mg-message__bar{background-color:hsl(var(--color-info))}.mg-message.mg-message--info .mg-message__icon{color:hsl(var(--color-info))}.mg-message.mg-message--warning .mg-message__bar{background-color:hsl(var(--color-warning))}.mg-message.mg-message--warning .mg-message__icon{color:hsl(var(--color-warning))}.mg-message.mg-message--success .mg-message__bar{background-color:hsl(var(--color-success))}.mg-message.mg-message--success .mg-message__icon{color:hsl(var(--color-success))}.mg-message.mg-message--danger .mg-message__bar{background-color:hsl(var(--color-danger))}.mg-message.mg-message--danger .mg-message__icon{color:hsl(var(--color-danger))}.mg-message.mg-message--close-button{--mg-card-padding:0 3.4rem 0 0}.mg-message.mg-message--hide{display:none}.mg-message ::slotted(*){margin:0;padding:0}.mg-message__icon{position:absolute;top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);left:1.3rem;line-height:1}.mg-message__content{display:flex;flex-wrap:wrap;justify-content:flex-end;align-content:stretch;padding:0 1rem 0 3.8rem}.mg-message__content-slot{flex-grow:1;margin:0.84rem 0}.mg-message__content-separator{display:inline-block;width:4.5rem;height:0}.mg-message__content-actions-slot{padding:1rem 0;text-align:right}.mg-message__close-button{position:absolute;top:0;right:0}.mg-message ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default)}.mg-message,mg-message{max-width:100%}";
|
|
3384
3925
|
|
|
3385
3926
|
const MgMessage = class {
|
|
3386
3927
|
constructor(hostRef) {
|
|
@@ -3396,22 +3937,49 @@ const MgMessage = class {
|
|
|
3396
3937
|
this.closeButtonId = '';
|
|
3397
3938
|
// Stored timer setted when hide action is run from setTimeOut
|
|
3398
3939
|
this.storedTimer = null;
|
|
3940
|
+
// Manage hover
|
|
3941
|
+
this.isFocused = false;
|
|
3942
|
+
this.isHovered = false;
|
|
3399
3943
|
/**
|
|
3400
|
-
*
|
|
3944
|
+
* Set timer
|
|
3945
|
+
*
|
|
3946
|
+
* @returns {void}
|
|
3401
3947
|
*/
|
|
3402
|
-
this.
|
|
3403
|
-
this.hide = true;
|
|
3948
|
+
this.setTimer = () => {
|
|
3949
|
+
this.storedTimer = setTimeout(() => (this.hide = true), this.delay * 1000);
|
|
3404
3950
|
};
|
|
3405
3951
|
/**
|
|
3406
|
-
*
|
|
3952
|
+
* Clear timer
|
|
3953
|
+
*
|
|
3954
|
+
* @returns {void}
|
|
3407
3955
|
*/
|
|
3408
|
-
this.
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3956
|
+
this.clearTimer = () => {
|
|
3957
|
+
clearTimeout(this.storedTimer);
|
|
3958
|
+
};
|
|
3959
|
+
/**
|
|
3960
|
+
* Event to add on element
|
|
3961
|
+
*
|
|
3962
|
+
* @param {MouseEvent | FocusEvent} event event
|
|
3963
|
+
* @returns {void}
|
|
3964
|
+
*/
|
|
3965
|
+
this.timerEvents = (event) => {
|
|
3966
|
+
this.clearTimer();
|
|
3967
|
+
const isMouseEvent = event.type === 'mouseenter';
|
|
3968
|
+
// Needed to ensure we don't start the timer
|
|
3969
|
+
this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;
|
|
3970
|
+
// Restart timer when loose focus AND mouse leave
|
|
3971
|
+
this.element.addEventListener(isMouseEvent ? 'mouseleave' : 'focusout', eventOut => {
|
|
3972
|
+
this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;
|
|
3973
|
+
// Start timer if needed
|
|
3974
|
+
if (!this.isFocused && !this.isHovered)
|
|
3975
|
+
this.setTimer();
|
|
3976
|
+
}, { once: true });
|
|
3977
|
+
};
|
|
3978
|
+
/**
|
|
3979
|
+
* Handle close button
|
|
3980
|
+
*/
|
|
3981
|
+
this.handleClose = () => {
|
|
3982
|
+
this.hide = true;
|
|
3415
3983
|
};
|
|
3416
3984
|
/**
|
|
3417
3985
|
* Get icon corresponding to variant
|
|
@@ -3445,7 +4013,7 @@ const MgMessage = class {
|
|
|
3445
4013
|
}
|
|
3446
4014
|
validateVariant(newValue, oldValue) {
|
|
3447
4015
|
if (!variants$1.includes(newValue)) {
|
|
3448
|
-
throw new Error(`<mg-message> prop "variant" must be one of
|
|
4016
|
+
throw new Error(`<mg-message> prop "variant" must be one of: ${variants$1.join(', ')}`);
|
|
3449
4017
|
}
|
|
3450
4018
|
else {
|
|
3451
4019
|
if (oldValue !== undefined) {
|
|
@@ -3464,12 +4032,26 @@ const MgMessage = class {
|
|
|
3464
4032
|
if (newValue) {
|
|
3465
4033
|
this.componentHide.emit();
|
|
3466
4034
|
this.classList.add(this.classHide);
|
|
4035
|
+
// Remove event Listener
|
|
4036
|
+
['focusin', 'mouseenter'].forEach(event => {
|
|
4037
|
+
this.element.removeEventListener(event, this.timerEvents);
|
|
4038
|
+
});
|
|
4039
|
+
// Clear Timer
|
|
4040
|
+
this.clearTimer();
|
|
3467
4041
|
}
|
|
3468
4042
|
else {
|
|
3469
4043
|
this.componentShow.emit();
|
|
3470
4044
|
this.classList.delete(this.classHide);
|
|
4045
|
+
// If delay is set
|
|
4046
|
+
if (this.delay > 1) {
|
|
4047
|
+
// Start timer
|
|
4048
|
+
this.setTimer();
|
|
4049
|
+
// Stop timer when get focus or mouse enter
|
|
4050
|
+
['focusin', 'mouseenter'].forEach(event => {
|
|
4051
|
+
this.element.addEventListener(event, this.timerEvents);
|
|
4052
|
+
});
|
|
4053
|
+
}
|
|
3471
4054
|
}
|
|
3472
|
-
this.hideWithDelay();
|
|
3473
4055
|
}
|
|
3474
4056
|
/*************
|
|
3475
4057
|
* Lifecycle *
|
|
@@ -3510,7 +4092,7 @@ const MgMessage = class {
|
|
|
3510
4092
|
};
|
|
3511
4093
|
MgMessage.style = mgMessageCss;
|
|
3512
4094
|
|
|
3513
|
-
const mgModalCss = ":host{--mg-card-border-radius:var(--mg-modal-border-radius);--mg-card-padding:1.5rem 2.5rem;--mg-card-border:none}.mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;padding:2rem 0;background-color:
|
|
4095
|
+
const mgModalCss = ":host{--mg-card-border-radius:var(--mg-modal-border-radius);--mg-card-padding:1.5rem 2.5rem;--mg-card-border:none}.mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;padding:2rem 0;background-color:hsl(var(--color-light), 0.85)}.mg-modal mg-card{display:flex;width:60rem;max-width:100%;max-height:100%}.mg-modal__dialog{display:flex;position:relative;flex-direction:column;align-self:center;row-gap:3rem;height:fit-content;max-height:100%}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal__content{overflow-y:auto}.mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}.mg-modal ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default)}";
|
|
3514
4096
|
|
|
3515
4097
|
const MgModal = class {
|
|
3516
4098
|
constructor(hostRef) {
|
|
@@ -3723,6 +4305,7 @@ const MgPagination = class {
|
|
|
3723
4305
|
};
|
|
3724
4306
|
this.identifier = createID('mg-pagination');
|
|
3725
4307
|
this.label = undefined;
|
|
4308
|
+
this.hideNavigationLabels = undefined;
|
|
3726
4309
|
this.totalPages = 1;
|
|
3727
4310
|
this.currentPage = 1;
|
|
3728
4311
|
}
|
|
@@ -3767,7 +4350,7 @@ const MgPagination = class {
|
|
|
3767
4350
|
render() {
|
|
3768
4351
|
const navigationActionButton = (disabled, action) => (index.h("mg-button", { identifier: `${this.identifier}-button-${action}`, label: this.messages.pagination[`${action}Page`],
|
|
3769
4352
|
// eslint-disable-next-line react/jsx-no-bind
|
|
3770
|
-
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat" }, action === NavigationAction.PREVIOUS && index.h("mg-icon", { icon: "chevron-left" }), this.messages.general[action], action === NavigationAction.NEXT && index.h("mg-icon", { icon: "chevron-right" })));
|
|
4353
|
+
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && index.h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && index.h("mg-icon", { icon: "chevron-right" })));
|
|
3771
4354
|
return (index.h("nav", { "aria-label": this.label, id: this.identifier, class: "mg-pagination" }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), index.h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), index.h("span", { class: "sr-only" }, this.messages.pagination.page, " ", this.currentPage), index.h("span", null, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
|
|
3772
4355
|
}
|
|
3773
4356
|
get element() { return index.getElement(this); }
|
|
@@ -3778,7 +4361,7 @@ const MgPagination = class {
|
|
|
3778
4361
|
};
|
|
3779
4362
|
MgPagination.style = mgPaginationCss;
|
|
3780
4363
|
|
|
3781
|
-
const mgPanelCss = ":host{--mg-card-border:none;--mg-card-padding:0;--mg-card-border-radius:var(--mg-panel-border-radius);--mg-card-background:hsl(var(--mg-panel-background));--mg-card-box-shadow:var(--mg-panel-box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:flex;margin:0.3rem 0}.mg-panel__header-right{padding-left:0.3rem;flex:1 auto;min-height:var(--default-size);align-items:center}.mg-panel__header-left mg-input-text{flex-grow:1;margin-left:0.3rem}.mg-panel__header-left mg-button+mg-button:not([slot=append-input]){margin-left:0.3rem}.mg-panel__header-left.mg-panel__header-left--full{flex:1 1 auto}.mg-panel__collapse-button-content{--font-size:1.4rem;--mg-button-font-weight:600}.mg-panel__content{padding:var(--mg-panel-content-padding)}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}";
|
|
4364
|
+
const mgPanelCss = ":host{--mg-card-border:none;--mg-card-padding:0;--mg-card-border-radius:var(--mg-panel-border-radius);--mg-card-background:hsl(var(--mg-panel-background));--mg-card-box-shadow:var(--mg-panel-box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:flex;margin:0.3rem 0}.mg-panel__header-right{padding-left:0.3rem;flex:1 auto;min-height:var(--default-size);align-items:center}.mg-panel__header-left mg-input-text{flex-grow:1;margin-left:0.3rem}.mg-panel__header-left mg-button+mg-button:not([slot=append-input]){margin-left:0.3rem}.mg-panel__header-left.mg-panel__header-left--full{flex:1 1 auto}.mg-panel__collapse-button-content{--font-size:1.4rem;--mg-button-font-weight:600}.mg-panel__content{padding:var(--mg-panel-content-padding)}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}.mg-panel ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default)}";
|
|
3782
4365
|
|
|
3783
4366
|
const MgPanel = class {
|
|
3784
4367
|
constructor(hostRef) {
|
|
@@ -3858,13 +4441,13 @@ const MgPanel = class {
|
|
|
3858
4441
|
if (this.titleEditable && !this.isEditing) {
|
|
3859
4442
|
return [
|
|
3860
4443
|
collapseButton(),
|
|
3861
|
-
index.h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, index.h("mg-icon", { icon: "pen" })),
|
|
4444
|
+
index.h("mg-button", { key: "edit-button", "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, index.h("mg-icon", { icon: "pen" })),
|
|
3862
4445
|
];
|
|
3863
4446
|
}
|
|
3864
4447
|
if (this.titleEditable && this.isEditing) {
|
|
3865
4448
|
return [
|
|
3866
4449
|
collapseButton(),
|
|
3867
|
-
index.h("mg-input-text", { label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) }, index.h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, index.h("mg-icon", { icon: "cross" })), index.h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, index.h("mg-icon", { icon: "check" }))),
|
|
4450
|
+
index.h("mg-input-text", { key: "edition-input", label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) }, index.h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, index.h("mg-icon", { icon: "cross" })), index.h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, index.h("mg-icon", { icon: "check" }))),
|
|
3868
4451
|
];
|
|
3869
4452
|
}
|
|
3870
4453
|
return collapseButton();
|
|
@@ -5738,13 +6321,15 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
5738
6321
|
defaultModifiers: defaultModifiers
|
|
5739
6322
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
5740
6323
|
|
|
5741
|
-
const mgPopoverCss = ":host{--mg-card-padding:1.5rem;--mg-card-border:none;--mg-card-border-radius:0.5rem;--mg-card-background:hsl(var(--mg-popover-background-color));position:relative;display:contents}:host::slotted(*){display:inline-block}.mg-popover{display:none;z-index:2000;color:hsl(var(--mg-popover-font-color))}.mg-popover mg-card{
|
|
6324
|
+
const mgPopoverCss = ":host{--mg-card-padding:var(--mg-popover-padding-vertical, 1.5rem) var(--mg-popover-padding-horizontal, var(--mg-popover-padding-vertical, 1.5rem));--mg-card-border:none;--mg-card-border-radius:0.5rem;--mg-card-background:hsl(var(--mg-popover-background-color));position:relative;display:contents}:host::slotted(*){display:inline-block}.mg-popover{display:none;padding:1rem;z-index:2000;color:hsl(var(--mg-popover-font-color))}.mg-popover mg-card{position:relative}.mg-popover[data-show]{display:block}.mg-popover mg-button{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover__arrow{position:absolute;visibility:hidden;width:calc(3rem + 2 * var(--mg-card-border-radius) + 2rem);height:calc(3rem + 2 * var(--mg-card-border-radius) + 2rem)}.mg-popover__arrow:before{visibility:visible;content:\"\";position:absolute}.mg-popover[data-popper-placement^=top]>.mg-popover__arrow,.mg-popover[data-popper-placement^=bottom]>.mg-popover__arrow{height:1rem}.mg-popover[data-popper-placement^=top]>.mg-popover__arrow:before,.mg-popover[data-popper-placement^=bottom]>.mg-popover__arrow:before{left:calc(var(--mg-card-border-radius) + 1rem);border-right:calc(3rem / 2) solid transparent;border-left:calc(3rem / 2) solid transparent}.mg-popover[data-popper-placement^=top]>.mg-popover__arrow{bottom:0.1rem;filter:drop-shadow(0 0.5rem 0.25rem hsl(var(--color-dark), 0.15))}.mg-popover[data-popper-placement^=top]>.mg-popover__arrow:before{border-top:1rem solid hsl(var(--mg-popover-background-color))}.mg-popover[data-popper-placement^=bottom]>.mg-popover__arrow{top:0.1rem;filter:drop-shadow(0 -0.5rem 0.25rem hsl(var(--color-dark), 0.15))}.mg-popover[data-popper-placement^=bottom]>.mg-popover__arrow:before{border-bottom:1rem solid hsl(var(--mg-popover-background-color))}.mg-popover[data-popper-placement^=left]>.mg-popover__arrow,.mg-popover[data-popper-placement^=right]>.mg-popover__arrow{width:1rem}.mg-popover[data-popper-placement^=left]>.mg-popover__arrow:before,.mg-popover[data-popper-placement^=right]>.mg-popover__arrow:before{top:calc(var(--mg-card-border-radius) + 1rem);border-top:calc(3rem / 2) solid transparent;border-bottom:calc(3rem / 2) solid transparent}.mg-popover[data-popper-placement^=left]>.mg-popover__arrow{right:0.1rem;filter:drop-shadow(0.5rem 0 0.25rem hsl(var(--color-dark), 0.15))}.mg-popover[data-popper-placement^=left]>.mg-popover__arrow:before{border-left:1rem solid hsl(var(--mg-popover-background-color))}.mg-popover[data-popper-placement^=right]>.mg-popover__arrow{left:0.1rem;filter:drop-shadow(-0.5rem 0 0.25rem hsl(var(--color-dark), 0.15))}.mg-popover[data-popper-placement^=right]>.mg-popover__arrow:before{border-right:1rem solid hsl(var(--mg-popover-background-color))}.mg-popover[data-popper-placement^=left-start],.mg-popover[data-popper-placement^=left-end],.mg-popover[data-popper-placement^=right-start],.mg-popover[data-popper-placement^=right-end]{padding:0 1rem}.mg-popover[data-popper-placement^=left-start]>.mg-popover__arrow,.mg-popover[data-popper-placement^=left-end]>.mg-popover__arrow,.mg-popover[data-popper-placement^=right-start]>.mg-popover__arrow,.mg-popover[data-popper-placement^=right-end]>.mg-popover__arrow{height:calc(3rem + 2 * var(--mg-card-border-radius))}.mg-popover[data-popper-placement^=left-start]>.mg-popover__arrow:before,.mg-popover[data-popper-placement^=left-end]>.mg-popover__arrow:before,.mg-popover[data-popper-placement^=right-start]>.mg-popover__arrow:before,.mg-popover[data-popper-placement^=right-end]>.mg-popover__arrow:before{top:var(--mg-card-border-radius)}.mg-popover__title ::slotted([slot=title]){margin:0 0 1rem !important;font-size:var(--mg-popover-title-font-size) !important;font-weight:600}.mg-popover--arrow-hide.mg-popover[data-popper-placement^=top]{padding-bottom:0}.mg-popover--arrow-hide.mg-popover[data-popper-placement^=bottom]{padding-top:0}.mg-popover--arrow-hide.mg-popover[data-popper-placement$=end],.mg-popover--arrow-hide.mg-popover[data-popper-placement^=left]{padding-right:0}.mg-popover--arrow-hide.mg-popover[data-popper-placement$=start],.mg-popover--arrow-hide.mg-popover[data-popper-placement^=right]{padding-left:0}.mg-popover ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default)}";
|
|
5742
6325
|
|
|
5743
6326
|
const MgPopover = class {
|
|
5744
6327
|
constructor(hostRef) {
|
|
5745
6328
|
index.registerInstance(this, hostRef);
|
|
5746
6329
|
this.displayChange = index.createEvent(this, "display-change", 7);
|
|
5747
6330
|
this.closeButtonId = '';
|
|
6331
|
+
// Classes
|
|
6332
|
+
this.classArrowHide = `mg-popover--arrow-hide`;
|
|
5748
6333
|
/**
|
|
5749
6334
|
* Check if clicked outside of component
|
|
5750
6335
|
*
|
|
@@ -5752,7 +6337,10 @@ const MgPopover = class {
|
|
|
5752
6337
|
* @returns {void}
|
|
5753
6338
|
*/
|
|
5754
6339
|
this.clickOutside = (event) => {
|
|
5755
|
-
|
|
6340
|
+
var _a;
|
|
6341
|
+
if (!this.disabled &&
|
|
6342
|
+
event.target.closest('mg-popover') !== this.element &&
|
|
6343
|
+
!(((_a = event.target.closest(`[data-mg-popover-guard]`)) === null || _a === void 0 ? void 0 : _a.dataset.mgPopoverGuard) === this.identifier)) {
|
|
5756
6344
|
this.display = false;
|
|
5757
6345
|
}
|
|
5758
6346
|
};
|
|
@@ -5763,7 +6351,7 @@ const MgPopover = class {
|
|
|
5763
6351
|
*/
|
|
5764
6352
|
this.show = () => {
|
|
5765
6353
|
// Make the popover visible
|
|
5766
|
-
this.popover.
|
|
6354
|
+
this.popover.dataset.show = '';
|
|
5767
6355
|
// Enable the event listeners
|
|
5768
6356
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
5769
6357
|
// Update its position
|
|
@@ -5771,7 +6359,9 @@ const MgPopover = class {
|
|
|
5771
6359
|
// hide when click outside
|
|
5772
6360
|
// setTimeout is used to prevent event to trigger after creation
|
|
5773
6361
|
setTimeout(() => {
|
|
5774
|
-
|
|
6362
|
+
this.windows.forEach((localWindow) => {
|
|
6363
|
+
localWindow.addEventListener('click', this.clickOutside, false);
|
|
6364
|
+
});
|
|
5775
6365
|
}, 0);
|
|
5776
6366
|
};
|
|
5777
6367
|
/**
|
|
@@ -5785,7 +6375,9 @@ const MgPopover = class {
|
|
|
5785
6375
|
// Disable the event listeners
|
|
5786
6376
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
5787
6377
|
// Remove event listener
|
|
5788
|
-
|
|
6378
|
+
this.windows.forEach((localWindow) => {
|
|
6379
|
+
localWindow.removeEventListener('click', this.clickOutside, false);
|
|
6380
|
+
});
|
|
5789
6381
|
};
|
|
5790
6382
|
/**
|
|
5791
6383
|
* Handle action for close button
|
|
@@ -5797,9 +6389,17 @@ const MgPopover = class {
|
|
|
5797
6389
|
};
|
|
5798
6390
|
this.identifier = createID('mg-popover');
|
|
5799
6391
|
this.placement = 'bottom';
|
|
6392
|
+
this.arrowHide = false;
|
|
5800
6393
|
this.closeButton = false;
|
|
5801
6394
|
this.display = false;
|
|
5802
6395
|
this.disabled = false;
|
|
6396
|
+
this.classList = new ClassList(['mg-popover']);
|
|
6397
|
+
}
|
|
6398
|
+
validateArrowHide(newValue) {
|
|
6399
|
+
if (newValue)
|
|
6400
|
+
this.classList.add(this.classArrowHide);
|
|
6401
|
+
else
|
|
6402
|
+
this.classList.delete(this.classArrowHide);
|
|
5803
6403
|
}
|
|
5804
6404
|
handleDisplay(newValue) {
|
|
5805
6405
|
if (newValue) {
|
|
@@ -5819,8 +6419,11 @@ const MgPopover = class {
|
|
|
5819
6419
|
* @returns {void} timeout
|
|
5820
6420
|
*/
|
|
5821
6421
|
componentWillLoad() {
|
|
6422
|
+
// Get windows to attach events
|
|
6423
|
+
this.windows = getWindows(window);
|
|
5822
6424
|
// Get locales
|
|
5823
6425
|
this.messages = initLocales(this.element).messages;
|
|
6426
|
+
this.validateArrowHide(this.arrowHide);
|
|
5824
6427
|
}
|
|
5825
6428
|
/**
|
|
5826
6429
|
* Check if component props are well configured on init
|
|
@@ -5852,11 +6455,22 @@ const MgPopover = class {
|
|
|
5852
6455
|
{
|
|
5853
6456
|
name: 'offset',
|
|
5854
6457
|
options: {
|
|
5855
|
-
offset: [0,
|
|
6458
|
+
offset: [0, 0],
|
|
5856
6459
|
},
|
|
5857
6460
|
},
|
|
5858
6461
|
],
|
|
5859
6462
|
});
|
|
6463
|
+
if (this.resizeObserver === undefined) {
|
|
6464
|
+
// add resize observer
|
|
6465
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
6466
|
+
if (entries.some(entrie => entrie.target.getAttribute('slot') !== null)) {
|
|
6467
|
+
this.popper.update();
|
|
6468
|
+
}
|
|
6469
|
+
});
|
|
6470
|
+
Array.from(this.element.querySelectorAll('[slot]')).forEach(element => {
|
|
6471
|
+
this.resizeObserver.observe(element);
|
|
6472
|
+
});
|
|
6473
|
+
}
|
|
5860
6474
|
// Add events to toggle display
|
|
5861
6475
|
interactiveElement.addEventListener('click', () => {
|
|
5862
6476
|
if (!this.disabled)
|
|
@@ -5875,10 +6489,11 @@ const MgPopover = class {
|
|
|
5875
6489
|
* @returns {HTMLElement} HTML Element
|
|
5876
6490
|
*/
|
|
5877
6491
|
render() {
|
|
5878
|
-
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class:
|
|
6492
|
+
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class: this.classList.join() }, index.h("mg-card", null, this.closeButton && (index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, index.h("mg-icon", { icon: "cross" }))), index.h("div", { class: "mg-popover__title" }, index.h("slot", { name: "title" })), index.h("slot", { name: "content" })), !this.arrowHide && index.h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
5879
6493
|
}
|
|
5880
6494
|
get element() { return index.getElement(this); }
|
|
5881
6495
|
static get watchers() { return {
|
|
6496
|
+
"arrowHide": ["validateArrowHide"],
|
|
5882
6497
|
"display": ["handleDisplay"]
|
|
5883
6498
|
}; }
|
|
5884
6499
|
};
|
|
@@ -5889,6 +6504,20 @@ const mgSkipLinksCss = ".mg-skip-links{position:absolute;transform:translateY(-1
|
|
|
5889
6504
|
const MgSkipLinks = class {
|
|
5890
6505
|
constructor(hostRef) {
|
|
5891
6506
|
index.registerInstance(this, hostRef);
|
|
6507
|
+
this.goToAnchor = index.createEvent(this, "go-to-anchor", 7);
|
|
6508
|
+
/***********
|
|
6509
|
+
* Methods *
|
|
6510
|
+
**********/
|
|
6511
|
+
/**
|
|
6512
|
+
* Handle link click and emit go-to-anchor event
|
|
6513
|
+
*
|
|
6514
|
+
* @param {MouseEvent} event mouse event
|
|
6515
|
+
* @returns {void}
|
|
6516
|
+
*/
|
|
6517
|
+
this.handleLinkCLick = (event) => {
|
|
6518
|
+
event.currentTarget.blur();
|
|
6519
|
+
this.goToAnchor.emit(event.currentTarget.getAttribute('href'));
|
|
6520
|
+
};
|
|
5892
6521
|
this.links = undefined;
|
|
5893
6522
|
}
|
|
5894
6523
|
validateLinks(links) {
|
|
@@ -5916,7 +6545,7 @@ const MgSkipLinks = class {
|
|
|
5916
6545
|
* @returns {HTMLElement} HTML Element
|
|
5917
6546
|
*/
|
|
5918
6547
|
render() {
|
|
5919
|
-
return (index.h("nav", { class: "mg-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, index.h("ul", { class: "mg-skip-links__list" }, this.links.map(link => (index.h("li",
|
|
6548
|
+
return (index.h("nav", { class: "mg-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, index.h("ul", { class: "mg-skip-links__list", role: "list" }, this.links.map(link => (index.h("li", { key: link.href }, index.h("a", { class: "mg-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
5920
6549
|
}
|
|
5921
6550
|
get element() { return index.getElement(this); }
|
|
5922
6551
|
static get watchers() { return {
|
|
@@ -5940,7 +6569,7 @@ var Status;
|
|
|
5940
6569
|
*/
|
|
5941
6570
|
const sizes = ['regular', 'large'];
|
|
5942
6571
|
|
|
5943
|
-
const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular{padding:1rem 2rem}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=metadata]){font-size:
|
|
6572
|
+
const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular{padding:1rem 2rem;height:calc()}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=metadata]){font-size:var(--font-size)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large{padding:1.5rem 3rem;height:calc()}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=metadata]){font-size:calc(var(--font-size) + 0.2rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:var(--mg-tabs-navigation-button-column-gap, 1rem);background-color:unset;border:none;font-family:var(--font-family);font-weight:400;color:hsl(var(--mg-tabs-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;white-space:nowrap;box-sizing:border-box;cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:var(--mg-disabled-opacity)}.mg-tabs__navigation-button:focus-visible{z-index:10}.mg-tabs__navigation-button:hover:not(.mg-tabs__navigation-button--disabled),.mg-tabs__navigation-button:focus-visible:not(.mg-tabs__navigation-button--disabled){background-color:hsl(var(--mg-tabs-focused-background-color-hsl), 0.1)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--mg-tabs-color-active-hsl));font-weight:600}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--vertical{border-left-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-tabs__navigation-button.mg-tabs__navigation-button--vertical{border-left:0.3rem solid transparent}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap}.mg-tabs__content-container:focus-visible{outline:none}.mg-tabs__navigation-button-text{flex:0 0 content}";
|
|
5944
6573
|
|
|
5945
6574
|
/**
|
|
5946
6575
|
* type TabItem validation function
|
|
@@ -5959,25 +6588,7 @@ const MgTabs = class {
|
|
|
5959
6588
|
// classes
|
|
5960
6589
|
this.tabPanel = 'panel';
|
|
5961
6590
|
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
5962
|
-
// variables
|
|
5963
6591
|
this.startIndex = 1;
|
|
5964
|
-
/**
|
|
5965
|
-
* Method to set active tab
|
|
5966
|
-
*
|
|
5967
|
-
* @param {number} tabKey item tab key to set to ACTIVE status
|
|
5968
|
-
* @returns {void}
|
|
5969
|
-
*/
|
|
5970
|
-
this.setActiveTab = (tabKey) => {
|
|
5971
|
-
// reset active tabs
|
|
5972
|
-
this.tabs.forEach(tab => {
|
|
5973
|
-
if (this.tabHasGivenStatus(tab, Status.ACTIVE))
|
|
5974
|
-
tab.status = Status.VISIBLE;
|
|
5975
|
-
});
|
|
5976
|
-
// set active tab from given tab key
|
|
5977
|
-
this.tabs[tabKey - this.startIndex].status = Status.ACTIVE;
|
|
5978
|
-
// emit change active tab key event
|
|
5979
|
-
this.activeTabChange.emit(tabKey);
|
|
5980
|
-
};
|
|
5981
6592
|
/**
|
|
5982
6593
|
* Method to know if given tab has the given status
|
|
5983
6594
|
*
|
|
@@ -5985,7 +6596,7 @@ const MgTabs = class {
|
|
|
5985
6596
|
* @param {Status} status status to valide
|
|
5986
6597
|
* @returns {boolean} status comparaison
|
|
5987
6598
|
*/
|
|
5988
|
-
this.
|
|
6599
|
+
this.tabHasStatus = (tab, status) => tab.status === status;
|
|
5989
6600
|
/**
|
|
5990
6601
|
* Method to get element id from index
|
|
5991
6602
|
*
|
|
@@ -5993,31 +6604,43 @@ const MgTabs = class {
|
|
|
5993
6604
|
* @param {number} index to generate id
|
|
5994
6605
|
* @returns {string} generated element id
|
|
5995
6606
|
*/
|
|
5996
|
-
this.getElementId = (element, index) => `${element}-${this.
|
|
6607
|
+
this.getElementId = (element, index) => `${element}-${this.getTabItemIndex(index)}`;
|
|
5997
6608
|
/**
|
|
5998
|
-
* Method to get tab index
|
|
6609
|
+
* Method to get tab item index
|
|
5999
6610
|
*
|
|
6000
6611
|
* @param {number} index to get
|
|
6001
6612
|
* @returns {number} index
|
|
6002
6613
|
*/
|
|
6003
|
-
this.
|
|
6614
|
+
this.getTabItemIndex = (index) => index + this.startIndex;
|
|
6615
|
+
/**
|
|
6616
|
+
* Method to get the active-tab value
|
|
6617
|
+
*
|
|
6618
|
+
* @returns {number} of the active-tab
|
|
6619
|
+
*/
|
|
6620
|
+
this.getActiveTab = () => this.activeTab || this.getTabItemIndex(this.tabs.map((tab, index) => (Object.assign(Object.assign({}, tab), { index }))).find(tab => this.tabHasStatus(tab, Status.ACTIVE)).index);
|
|
6004
6621
|
/**
|
|
6005
6622
|
* Handle click events on tabs
|
|
6006
6623
|
*
|
|
6007
6624
|
* @param {MouseEvent} event mouse event
|
|
6008
6625
|
*/
|
|
6009
6626
|
this.handleClick = (event) => {
|
|
6010
|
-
const tabId = event.currentTarget.
|
|
6011
|
-
|
|
6627
|
+
const tabId = event.currentTarget.dataset.index;
|
|
6628
|
+
const tab = this.tabs[Number(tabId) - this.startIndex];
|
|
6629
|
+
if (this.tabHasStatus(tab, Status.HIDDEN) || this.tabHasStatus(tab, Status.DISABLED)) {
|
|
6630
|
+
event.preventDefault();
|
|
6631
|
+
}
|
|
6632
|
+
else {
|
|
6633
|
+
this.activeTab = Number(tabId);
|
|
6634
|
+
this.tabFocus = undefined;
|
|
6635
|
+
}
|
|
6012
6636
|
};
|
|
6013
6637
|
/**
|
|
6014
6638
|
* get navigation button class from given status
|
|
6015
6639
|
*
|
|
6016
6640
|
* @param {Status} status button tab status
|
|
6017
|
-
* @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
|
|
6018
6641
|
* @returns {string} button class/selector variant
|
|
6019
6642
|
*/
|
|
6020
|
-
this.getNavigationButtonClass = (status
|
|
6643
|
+
this.getNavigationButtonClass = (status) => `${this.buttonTabBaseClass}--${status}`;
|
|
6021
6644
|
/**
|
|
6022
6645
|
* Handle keyboard event on tabs
|
|
6023
6646
|
*
|
|
@@ -6025,37 +6648,66 @@ const MgTabs = class {
|
|
|
6025
6648
|
* @returns {void}
|
|
6026
6649
|
*/
|
|
6027
6650
|
this.handleKeydown = (event) => {
|
|
6028
|
-
let tabId = Number(event.target.getAttribute('data-index'));
|
|
6029
6651
|
const parent = event.target.parentElement;
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6652
|
+
if (['ArrowRight', 'ArrowLeft'].includes(event.key)) {
|
|
6653
|
+
this.tabFocus = Number(event.target.dataset.index);
|
|
6654
|
+
parent.querySelector(`[data-index="${this.tabFocus}"]`).setAttribute('tabindex', '-1');
|
|
6655
|
+
// Move right
|
|
6656
|
+
if (event.key === 'ArrowRight') {
|
|
6657
|
+
this.tabFocus++;
|
|
6658
|
+
// If we're at the end, go to the start
|
|
6659
|
+
if (this.tabFocus > this.tabs.length)
|
|
6660
|
+
this.tabFocus = this.startIndex;
|
|
6661
|
+
// Move left
|
|
6662
|
+
}
|
|
6663
|
+
else if (event.key === 'ArrowLeft') {
|
|
6664
|
+
this.tabFocus--;
|
|
6665
|
+
// If we're at the start, move to the end
|
|
6666
|
+
if (this.tabFocus < this.startIndex)
|
|
6667
|
+
this.tabFocus = this.tabs.length;
|
|
6668
|
+
}
|
|
6669
|
+
const parentButtonElement = parent.querySelector(`[data-index="${this.tabFocus}"]`);
|
|
6670
|
+
// if focus item is ['hidden'] we recursively repeat action
|
|
6671
|
+
if (this.tabHasStatus(this.tabs[this.tabFocus - 1], Status.HIDDEN)) {
|
|
6672
|
+
parentButtonElement.dispatchEvent(new KeyboardEvent('keydown', { key: event.key, bubbles: true }));
|
|
6673
|
+
// else run focus methods on tabFocus element
|
|
6674
|
+
}
|
|
6675
|
+
else {
|
|
6676
|
+
parentButtonElement.setAttribute('tabindex', '0');
|
|
6677
|
+
parentButtonElement.focus();
|
|
6678
|
+
}
|
|
6036
6679
|
}
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
// apply selected tab if exist
|
|
6040
|
-
if (selectedTab !== null) {
|
|
6041
|
-
selectedTab.focus();
|
|
6042
|
-
this.activeTab = tabId;
|
|
6680
|
+
else if (event.key === 'Tab') {
|
|
6681
|
+
this.resetFocus();
|
|
6043
6682
|
}
|
|
6044
6683
|
};
|
|
6684
|
+
/**
|
|
6685
|
+
* Method to reset focus behavior
|
|
6686
|
+
*
|
|
6687
|
+
* @returns {void}
|
|
6688
|
+
*/
|
|
6689
|
+
this.resetFocus = () => {
|
|
6690
|
+
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
6691
|
+
setTimeout(() => {
|
|
6692
|
+
this.tabFocus = undefined;
|
|
6693
|
+
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
6694
|
+
tab.setAttribute('tabindex', this.getActiveTab() - this.startIndex !== index ? '-1' : '0');
|
|
6695
|
+
});
|
|
6696
|
+
}, 0);
|
|
6697
|
+
};
|
|
6045
6698
|
/**
|
|
6046
6699
|
* Validate slots setting
|
|
6047
6700
|
*/
|
|
6048
6701
|
this.validateSlots = () => {
|
|
6049
6702
|
const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
|
|
6050
|
-
if (slots.length !== this.tabs.length)
|
|
6703
|
+
if (slots.length !== this.tabs.length)
|
|
6051
6704
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
6052
|
-
}
|
|
6053
6705
|
};
|
|
6054
6706
|
this.identifier = createID('mg-tabs');
|
|
6055
6707
|
this.label = undefined;
|
|
6056
6708
|
this.size = 'regular';
|
|
6057
6709
|
this.items = undefined;
|
|
6058
|
-
this.activeTab =
|
|
6710
|
+
this.activeTab = undefined;
|
|
6059
6711
|
this.tabs = [];
|
|
6060
6712
|
this.classList = new ClassList(['mg-tabs']);
|
|
6061
6713
|
}
|
|
@@ -6066,29 +6718,44 @@ const MgTabs = class {
|
|
|
6066
6718
|
}
|
|
6067
6719
|
validateSize(newValue) {
|
|
6068
6720
|
if (!sizes.includes(newValue)) {
|
|
6069
|
-
throw new Error(`<mg-tabs> prop "size" must be one of
|
|
6721
|
+
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}`);
|
|
6070
6722
|
}
|
|
6071
6723
|
this.classList.add(`mg-tabs--size-${this.size}`);
|
|
6072
6724
|
}
|
|
6073
6725
|
validateItems(newValue) {
|
|
6074
6726
|
// String array
|
|
6075
6727
|
if (allItemsAreString(newValue)) {
|
|
6076
|
-
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
6728
|
+
this.tabs = newValue.map((item, index) => ({ label: item, status: index === 0 ? Status.ACTIVE : Status.VISIBLE }));
|
|
6077
6729
|
}
|
|
6078
6730
|
// Object array
|
|
6079
|
-
else if (newValue && newValue.every(item => isTabItem(item))) {
|
|
6731
|
+
else if (newValue && newValue.length > 0 && newValue.every(item => isTabItem(item))) {
|
|
6080
6732
|
this.tabs = newValue;
|
|
6733
|
+
// init active tabs if not set. Default: index 0.
|
|
6734
|
+
if (this.tabs.find(tab => this.tabHasStatus(tab, Status.ACTIVE)) === undefined)
|
|
6735
|
+
this.tabs[0].status = Status.ACTIVE;
|
|
6081
6736
|
}
|
|
6082
6737
|
else {
|
|
6083
6738
|
throw new Error('<mg-tabs> prop "items" is required and all items must be the same type: TabItem.');
|
|
6084
6739
|
}
|
|
6085
6740
|
}
|
|
6086
6741
|
validateActiveTab(newValue) {
|
|
6087
|
-
if (newValue
|
|
6088
|
-
|
|
6742
|
+
if (typeof newValue === 'number' && newValue >= 1 && newValue <= this.tabs.length) {
|
|
6743
|
+
this.tabs.forEach((tab, index) => {
|
|
6744
|
+
const isNewActiveTab = index === newValue - this.startIndex;
|
|
6745
|
+
// reset active tabs
|
|
6746
|
+
if (this.tabHasStatus(tab, Status.ACTIVE) && !isNewActiveTab)
|
|
6747
|
+
tab.status = Status.VISIBLE;
|
|
6748
|
+
// set active tab from given tab key
|
|
6749
|
+
else if ((tab.status === undefined || this.tabHasStatus(tab, Status.VISIBLE)) && isNewActiveTab)
|
|
6750
|
+
tab.status = Status.ACTIVE;
|
|
6751
|
+
});
|
|
6752
|
+
// emit change active tab key event
|
|
6753
|
+
if (this.tabs.find(tab => this.tabHasStatus(tab, Status.ACTIVE)) !== undefined) {
|
|
6754
|
+
this.activeTabChange.emit(newValue);
|
|
6755
|
+
}
|
|
6089
6756
|
}
|
|
6090
|
-
else {
|
|
6091
|
-
|
|
6757
|
+
else if (newValue !== undefined) {
|
|
6758
|
+
throw new Error('<mg-tabs> prop "activeTab" must be between 1 and tabs length.');
|
|
6092
6759
|
}
|
|
6093
6760
|
}
|
|
6094
6761
|
/*************
|
|
@@ -6107,19 +6774,30 @@ const MgTabs = class {
|
|
|
6107
6774
|
this.validateSize(this.size);
|
|
6108
6775
|
this.validateSlots();
|
|
6109
6776
|
}
|
|
6777
|
+
/**
|
|
6778
|
+
* add listners
|
|
6779
|
+
*
|
|
6780
|
+
* @returns {void}
|
|
6781
|
+
*/
|
|
6782
|
+
componentDidLoad() {
|
|
6783
|
+
document.addEventListener('click', (event) => {
|
|
6784
|
+
if (event.target.closest('mg-tabs') !== this.element)
|
|
6785
|
+
this.resetFocus();
|
|
6786
|
+
}, false);
|
|
6787
|
+
}
|
|
6110
6788
|
/**
|
|
6111
6789
|
* Render
|
|
6112
6790
|
*
|
|
6113
6791
|
* @returns {HTMLElement} HTML Element
|
|
6114
6792
|
*/
|
|
6115
6793
|
render() {
|
|
6116
|
-
return (index.h("div", { class: this.classList.join() }, index.h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index$1) => (index.h("button", { role: "tab", id: this.getElementId(this.identifier, index$1), class: {
|
|
6794
|
+
return (index.h("div", { class: this.classList.join() }, index.h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index$1) => (index.h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index$1), class: {
|
|
6117
6795
|
[`${this.buttonTabBaseClass}`]: true,
|
|
6118
6796
|
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
6119
|
-
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.
|
|
6120
|
-
[`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.
|
|
6121
|
-
[`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.
|
|
6122
|
-
}, tabindex: this.
|
|
6797
|
+
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|
|
6798
|
+
[`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasStatus(tab, Status.DISABLED),
|
|
6799
|
+
[`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasStatus(tab, Status.HIDDEN),
|
|
6800
|
+
}, tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index$1), "aria-disabled": this.tabHasStatus(tab, Status.DISABLED), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabItemIndex(index$1) }, tab.icon !== undefined && index.h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && index.h("mg-badge", { variant: "text-color", value: tab.badge.value, label: tab.badge.label, outline: tab.badge.role === 'information' }))))), this.tabs.map((tab, index$1) => (index.h("article", { key: tab.label, role: "tabpanel", id: this.getElementId(this.tabPanel, index$1), hidden: !this.tabHasStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index$1), tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, index.h("slot", { name: this.getElementId('tab_content', index$1) }))))));
|
|
6123
6801
|
}
|
|
6124
6802
|
get element() { return index.getElement(this); }
|
|
6125
6803
|
static get watchers() { return {
|
|
@@ -6136,7 +6814,7 @@ MgTabs.style = mgTabsCss;
|
|
|
6136
6814
|
*/
|
|
6137
6815
|
const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
|
|
6138
6816
|
|
|
6139
|
-
const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--primary.mg-tag--soft{font-weight:
|
|
6817
|
+
const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--primary.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-dark-h), var(--color-dark-s), 90%);border-color:hsl(var(--color-dark-h), var(--color-dark-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--primary.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--secondary.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-light-h), var(--color-light-s), 90%);border-color:hsl(var(--color-light-h), var(--color-light-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-dark))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--success.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-success-h), var(--color-success-s), 90%);border-color:hsl(var(--color-success-h), var(--color-success-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--warning.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-warning-h), var(--color-warning-s), 90%);border-color:hsl(var(--color-warning-h), var(--color-warning-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--danger.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-danger-h), var(--color-danger-s), 90%);border-color:hsl(var(--color-danger-h), var(--color-danger-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--danger.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag.mg-tag--info.mg-tag--soft{font-weight:400;background-color:hsl(var(--color-info-h), var(--color-info-s), 90%);border-color:hsl(var(--color-info-h), var(--color-info-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--info.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}::slotted(mg-icon){margin-right:0.4rem}";
|
|
6140
6818
|
|
|
6141
6819
|
const MgTag = class {
|
|
6142
6820
|
constructor(hostRef) {
|
|
@@ -6145,8 +6823,8 @@ const MgTag = class {
|
|
|
6145
6823
|
* Internal *
|
|
6146
6824
|
************/
|
|
6147
6825
|
// Classes
|
|
6148
|
-
this.classOutline =
|
|
6149
|
-
this.classSoft =
|
|
6826
|
+
this.classOutline = 'mg-tag--outline';
|
|
6827
|
+
this.classSoft = 'mg-tag--soft';
|
|
6150
6828
|
this.variant = variants[0];
|
|
6151
6829
|
this.outline = undefined;
|
|
6152
6830
|
this.soft = undefined;
|
|
@@ -6154,7 +6832,7 @@ const MgTag = class {
|
|
|
6154
6832
|
}
|
|
6155
6833
|
validateVariant(newValue, oldValue) {
|
|
6156
6834
|
if (!variants.includes(newValue)) {
|
|
6157
|
-
throw new Error(`<mg-tag> prop "variant" must be one of
|
|
6835
|
+
throw new Error(`<mg-tag> prop "variant" must be one of: ${variants.join(', ')}.`);
|
|
6158
6836
|
}
|
|
6159
6837
|
else {
|
|
6160
6838
|
if (oldValue !== undefined) {
|
|
@@ -6189,7 +6867,7 @@ const MgTag = class {
|
|
|
6189
6867
|
* @returns {void}
|
|
6190
6868
|
*/
|
|
6191
6869
|
validateTextContent(textContent) {
|
|
6192
|
-
if (
|
|
6870
|
+
if (typeof textContent !== 'string' || textContent.trim() === '')
|
|
6193
6871
|
throw new Error('<mg-tag> slot must contain a text content.');
|
|
6194
6872
|
}
|
|
6195
6873
|
/*************
|
|
@@ -6230,7 +6908,7 @@ var Guard;
|
|
|
6230
6908
|
Guard["HOVER_TOOLTIPED_ELEMENT"] = "hoverTooltipedGuard";
|
|
6231
6909
|
})(Guard || (Guard = {}));
|
|
6232
6910
|
|
|
6233
|
-
const mgTooltipCss = ":host{display:inline-block}.mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:1000;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show]{display:block}.mg-tooltip .mg-tooltip__arrow,.mg-tooltip .mg-tooltip__arrow::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip .mg-tooltip__arrow{visibility:hidden}.mg-tooltip .mg-tooltip__arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top]>.mg-tooltip__arrow{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom]>.mg-tooltip__arrow{top:-4px}.mg-tooltip[data-popper-placement^=left]>.mg-tooltip__arrow{right:-4px}.mg-tooltip[data-popper-placement^=right]>.mg-tooltip__arrow{left:-4px}";
|
|
6911
|
+
const mgTooltipCss = ":host{display:inline-block}.mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:1000;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start;max-width:40rem;box-sizing:border-box}.mg-tooltip[data-show]{display:block}.mg-tooltip .mg-tooltip__arrow,.mg-tooltip .mg-tooltip__arrow::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip .mg-tooltip__arrow{visibility:hidden}.mg-tooltip .mg-tooltip__arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top]>.mg-tooltip__arrow{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom]>.mg-tooltip__arrow{top:-4px}.mg-tooltip[data-popper-placement^=left]>.mg-tooltip__arrow{right:-4px}.mg-tooltip[data-popper-placement^=right]>.mg-tooltip__arrow{left:-4px}";
|
|
6234
6912
|
|
|
6235
6913
|
const MgTooltip = class {
|
|
6236
6914
|
constructor(hostRef) {
|
|
@@ -6242,7 +6920,7 @@ const MgTooltip = class {
|
|
|
6242
6920
|
*/
|
|
6243
6921
|
this.show = () => {
|
|
6244
6922
|
// Make the tooltip visible
|
|
6245
|
-
this.tooltip.
|
|
6923
|
+
this.tooltip.dataset.show = '';
|
|
6246
6924
|
// Enable the event listeners
|
|
6247
6925
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
6248
6926
|
// Update its position
|
|
@@ -6288,7 +6966,7 @@ const MgTooltip = class {
|
|
|
6288
6966
|
this.resetGuard();
|
|
6289
6967
|
}, 100);
|
|
6290
6968
|
}
|
|
6291
|
-
else if (
|
|
6969
|
+
else if (this.guard === Guard.HOVER_TOOLTIPED_ELEMENT) {
|
|
6292
6970
|
this.setDisplay(isMouseenter);
|
|
6293
6971
|
}
|
|
6294
6972
|
}
|
|
@@ -6357,24 +7035,22 @@ const MgTooltip = class {
|
|
|
6357
7035
|
this.guard = Guard.FOCUS;
|
|
6358
7036
|
this.setDisplay(true);
|
|
6359
7037
|
});
|
|
6360
|
-
|
|
6361
|
-
this.
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
this.resetGuard();
|
|
7038
|
+
this.tooltipedElement.addEventListener('blur', () => {
|
|
7039
|
+
this.resetGuard();
|
|
7040
|
+
this.setDisplay(false);
|
|
7041
|
+
});
|
|
7042
|
+
document.addEventListener('keydown', (event) => {
|
|
7043
|
+
if (event.code === 'Escape')
|
|
6367
7044
|
this.setDisplay(false);
|
|
6368
|
-
});
|
|
6369
7045
|
});
|
|
6370
7046
|
// manage tooltipElement & tooltipedElement mouseenter/mouseleave events
|
|
6371
|
-
['mouseenter', 'mouseleave'].forEach(
|
|
6372
|
-
const isMouseenter =
|
|
7047
|
+
['mouseenter', 'mouseleave'].forEach(eventType => {
|
|
7048
|
+
const isMouseenter = eventType === 'mouseenter';
|
|
6373
7049
|
[
|
|
6374
7050
|
{ element: this.tooltip, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIPED_ELEMENT) },
|
|
6375
7051
|
{ element: this.tooltipedElement, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIP_ELEMENT) },
|
|
6376
7052
|
].forEach(({ element, action }) => {
|
|
6377
|
-
element.addEventListener(
|
|
7053
|
+
element.addEventListener(eventType, () => {
|
|
6378
7054
|
action();
|
|
6379
7055
|
});
|
|
6380
7056
|
});
|
|
@@ -6416,8 +7092,7 @@ const MgTooltip = class {
|
|
|
6416
7092
|
// get slotted element
|
|
6417
7093
|
const slotElement = this.element.firstElementChild;
|
|
6418
7094
|
// Get interactive element
|
|
6419
|
-
const
|
|
6420
|
-
const interactiveElement = this.element.shadowRoot.querySelector(interactiveElements.join(',')) || ((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
7095
|
+
const interactiveElement = slotElement.matches(focusableElements) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(focusableElements);
|
|
6421
7096
|
// define selected element to become tooltip selector
|
|
6422
7097
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
6423
7098
|
// Check if slotted element is a disabled mg-button
|
|
@@ -6442,7 +7117,7 @@ const MgTooltip = class {
|
|
|
6442
7117
|
* @returns {HTMLElement} HTML Element
|
|
6443
7118
|
*/
|
|
6444
7119
|
render() {
|
|
6445
|
-
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { role: "tooltip", id: this.identifier, class: "mg-tooltip", innerHTML: this.message }, index.h("div", { class: "mg-tooltip__arrow", "data-popper-arrow": true }))));
|
|
7120
|
+
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { role: "tooltip", id: this.identifier, class: "mg-tooltip" }, index.h("span", { innerHTML: this.message }), index.h("div", { class: "mg-tooltip__arrow", "data-popper-arrow": true }))));
|
|
6446
7121
|
}
|
|
6447
7122
|
get element() { return index.getElement(this); }
|
|
6448
7123
|
static get watchers() { return {
|
|
@@ -6452,6 +7127,7 @@ const MgTooltip = class {
|
|
|
6452
7127
|
};
|
|
6453
7128
|
MgTooltip.style = mgTooltipCss;
|
|
6454
7129
|
|
|
7130
|
+
exports.mg_action_more = MgActionMore;
|
|
6455
7131
|
exports.mg_badge = MgBadge;
|
|
6456
7132
|
exports.mg_button = MgButton;
|
|
6457
7133
|
exports.mg_card = MgCard;
|