@mgdis/mg-components 6.20.0 → 6.22.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-TUElr4Wv.js → index-BxB20_Vw.js} +54 -0
- package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1761 -80
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +761 -371
- package/dist/cjs/mg-alert.cjs.entry.js +17 -9
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
- package/dist/cjs/mg-input-combobox.cjs.entry.js +49 -19
- package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40096 -15821
- package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
- package/dist/cjs/mg-loader.cjs.entry.js +8 -6
- package/dist/cjs/mg-progress.cjs.entry.js +19 -9
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
- 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.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +163 -53
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +3 -36
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +21 -43
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +65 -38
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +92 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +37 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +13 -33
- package/dist/collection/locales/en/messages.json +14 -0
- package/dist/collection/locales/fr/messages.json +14 -0
- package/dist/components/events.utils.js +1 -23
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -408
- package/dist/components/index3.js +1 -476
- package/dist/components/mg-action-more.js +1 -254
- package/dist/components/mg-alert.js +1 -224
- package/dist/components/mg-badge.js +1 -6
- package/dist/components/mg-badge2.js +1 -113
- package/dist/components/mg-breadcrumb.d.ts +11 -0
- package/dist/components/mg-breadcrumb.js +1 -0
- package/dist/components/mg-button.js +1 -6
- package/dist/components/mg-button2.js +1 -275
- package/dist/components/mg-card.js +1 -6
- package/dist/components/mg-card2.js +1 -92
- package/dist/components/mg-character-left.js +1 -6
- package/dist/components/mg-character-left2.js +1 -75
- package/dist/components/mg-details.js +1 -104
- package/dist/components/mg-divider.js +1 -6
- package/dist/components/mg-divider2.js +1 -49
- package/dist/components/mg-fieldset.js +1 -209
- package/dist/components/mg-form.js +1 -302
- package/dist/components/mg-icon.js +1 -6
- package/dist/components/mg-icon2.js +1 -188
- package/dist/components/mg-illustrated-message.js +1 -129
- package/dist/components/mg-input-checkbox-paginated.js +1 -6
- package/dist/components/mg-input-checkbox-paginated2.js +1 -135
- package/dist/components/mg-input-checkbox.js +1 -762
- package/dist/components/mg-input-combobox.js +1 -940
- package/dist/components/mg-input-date.js +1 -463
- package/dist/components/mg-input-file.d.ts +11 -0
- package/dist/components/mg-input-file.js +1 -0
- package/dist/components/mg-input-numeric.js +1 -592
- package/dist/components/mg-input-password.js +1 -360
- package/dist/components/mg-input-radio.js +1 -392
- package/dist/components/mg-input-rich-text-editor.js +1663 -16797
- package/dist/components/mg-input-select.js +1 -6
- package/dist/components/mg-input-select2.js +1 -481
- package/dist/components/mg-input-text.js +1 -6
- package/dist/components/mg-input-text2.js +1 -514
- package/dist/components/mg-input-textarea.js +1 -412
- package/dist/components/mg-input-title.js +1 -6
- package/dist/components/mg-input-title2.js +1 -81
- package/dist/components/mg-input-toggle.js +1 -371
- package/dist/components/mg-input.conf.js +1 -0
- package/dist/components/mg-input.js +1 -6
- package/dist/components/mg-input2.js +1 -459
- package/dist/components/mg-item-more.js +1 -6
- package/dist/components/mg-item-more2.js +1 -505
- package/dist/components/mg-loader.js +1 -6
- package/dist/components/mg-loader2.js +1 -74
- package/dist/components/mg-menu-item.js +1 -6
- package/dist/components/mg-menu-item2.js +1 -485
- package/dist/components/mg-menu.js +1 -6
- package/dist/components/mg-message.js +1 -6
- package/dist/components/mg-message2.js +1 -146
- package/dist/components/mg-modal.js +1 -184
- package/dist/components/mg-pagination.js +1 -234
- package/dist/components/mg-panel.js +1 -350
- package/dist/components/mg-popover-content.js +1 -6
- package/dist/components/mg-popover-content2.js +1 -96
- package/dist/components/mg-popover.js +1 -6
- package/dist/components/mg-popover2.js +1 -312
- package/dist/components/mg-progress.js +1 -123
- package/dist/components/mg-skip-links.js +1 -78
- package/dist/components/mg-table.js +1 -319
- package/dist/components/mg-tabs.js +1 -6
- package/dist/components/mg-tabs2.js +1 -315
- package/dist/components/mg-tag.js +1 -133
- package/dist/components/mg-tooltip-content.js +1 -6
- package/dist/components/mg-tooltip-content2.js +1 -42
- package/dist/components/mg-tooltip.js +1 -6
- package/dist/components/mg-tooltip2.js +1 -421
- package/dist/components/popper.js +1 -1790
- package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1761 -80
- package/dist/esm/{index-CNX6lq0x.js → index-DSEloqPn.js} +54 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +761 -371
- package/dist/esm/mg-alert.entry.js +17 -9
- package/dist/esm/mg-breadcrumb.entry.js +61 -0
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +24 -7
- package/dist/esm/mg-input-combobox.entry.js +49 -19
- package/dist/esm/mg-input-file.entry.js +382 -0
- package/dist/esm/mg-input-rich-text-editor.entry.js +40083 -15808
- package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
- package/dist/esm/mg-loader.entry.js +8 -6
- package/dist/esm/mg-progress.entry.js +19 -9
- package/dist/mg-components/locales/en/messages.json +14 -0
- package/dist/mg-components/locales/fr/messages.json +14 -0
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-0482eb9f.entry.js +1 -0
- package/dist/mg-components/{p-7132bca1.entry.js → p-2ee92f38.entry.js} +1 -1
- package/dist/mg-components/{p-916dfb6d.entry.js → p-3b653226.entry.js} +1 -1
- package/dist/mg-components/p-5745fbea.entry.js +1 -0
- package/dist/mg-components/p-C9rmNQIL.js +1 -0
- package/dist/mg-components/p-DFwaH2hS.js +2 -0
- package/dist/mg-components/p-DSEloqPn.js +1 -0
- package/dist/mg-components/p-adec7fcc.entry.js +1 -0
- package/dist/mg-components/p-c63f97f0.entry.js +1658 -0
- package/dist/mg-components/p-c8c8cfc1.entry.js +1 -0
- package/dist/mg-components/p-cc793586.entry.js +1 -0
- package/dist/mg-components/p-d5e69c95.entry.js +1 -0
- package/dist/types/assets/icons/index.d.ts +2 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +50 -16
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
- package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
- package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
- package/dist/types/components.d.ts +302 -46
- package/dist/types/stencil-public-runtime.d.ts +76 -12
- package/ide/intellij/web-types.json +483 -51
- package/ide/vscode/css-custom-data.json +10 -2
- package/ide/vscode/html-custom-data.json +445 -104
- package/package.json +24 -23
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
- package/dist/mg-components/p-016bd291.entry.js +0 -1
- package/dist/mg-components/p-186a6139.entry.js +0 -1
- package/dist/mg-components/p-BluNKQ3L.js +0 -2
- package/dist/mg-components/p-CNX6lq0x.js +0 -1
- package/dist/mg-components/p-DDnrE1hD.js +0 -1
- package/dist/mg-components/p-cd061b38.entry.js +0 -1
- package/dist/mg-components/p-d2c72f09.entry.js +0 -1
- package/dist/mg-components/p-d5a276eb.entry.js +0 -1
- package/ide/vscode/custom.css-data.json +0 -425
|
@@ -1,129 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as ClassList, t as toString, b as isTagName } from './index2.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* List of all possibles sizes
|
|
6
|
-
*/
|
|
7
|
-
const sizes = ['small', 'medium', 'large'];
|
|
8
|
-
/**
|
|
9
|
-
* List of all possibles directions
|
|
10
|
-
*/
|
|
11
|
-
const directions = ['vertical', 'horizontal'];
|
|
12
|
-
|
|
13
|
-
const mgIllustratedMessageCss = "/*!\n * @prop --mg-c-illustrated-message-spacing-vertical: Defines the vertical padding of the illustrated message. Default value: `--mg-b-size-40`.\n */.mg-c-illustrated-message{display:flex;max-width:calc(60*var(--mg-b-size-8));box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-c-illustrated-message-spacing-vertical) var(--mg-b-size-16);margin:auto;gap:var(--mg-b-size-16) var(--mg-b-size-64);text-align:center}.mg-c-illustrated-message__illustration{max-height:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){width:100%;max-width:100%;max-width:calc(15*var(--mg-b-size-8));height:auto;max-height:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__slots{display:flex;flex-direction:column;gap:var(--mg-b-size-8)}.mg-c-illustrated-message__slots ::slotted([slot=title]){margin:0;font-family:var(--mg-b-font-family) !important;font-size:var(--mg-b-font-size-h2) !important;font-weight:400 !important}.mg-c-illustrated-message__slots ::slotted([slot=details]){margin:0}.mg-c-illustrated-message.mg-c-illustrated-message--size-small{--mg-c-illustrated-message-spacing-vertical: var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__slots{gap:calc(var(--mg-b-size-4)/2)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration{max-height:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-height:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration{max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-height:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{max-width:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-width:calc(60*var(--mg-b-size-8))}@container (width > 52.8rem){.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{flex-direction:row;align-items:center;column-gap:var(--mg-b-size-48);text-align:left}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-width:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__illustration{max-width:fit-content;flex:1 0 auto}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-small{column-gap:var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-large{column-gap:var(--mg-b-size-64)}}:host{display:block;container-type:inline-size}\n";
|
|
14
|
-
|
|
15
|
-
const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustratedMessage extends HTMLElement {
|
|
16
|
-
constructor(registerHost) {
|
|
17
|
-
super();
|
|
18
|
-
if (registerHost !== false) {
|
|
19
|
-
this.__registerHost();
|
|
20
|
-
}
|
|
21
|
-
this.__attachShadow();
|
|
22
|
-
/**
|
|
23
|
-
* Define illustration size
|
|
24
|
-
*/
|
|
25
|
-
this.size = 'medium';
|
|
26
|
-
/**
|
|
27
|
-
* Define component orientation
|
|
28
|
-
*/
|
|
29
|
-
this.direction = 'vertical';
|
|
30
|
-
/**
|
|
31
|
-
* Component classes
|
|
32
|
-
*/
|
|
33
|
-
this.classCollection = new ClassList(['mg-c-illustrated-message']);
|
|
34
|
-
}
|
|
35
|
-
watchSize(newValue, oldValue) {
|
|
36
|
-
if (!sizes.includes(newValue)) {
|
|
37
|
-
throw new Error(`<mg-illustrated-message> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
if (oldValue !== undefined) {
|
|
41
|
-
this.classCollection.delete(`mg-c-illustrated-message--size-${oldValue}`);
|
|
42
|
-
}
|
|
43
|
-
this.classCollection.add(`mg-c-illustrated-message--size-${newValue}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
watchDirection(newValue, oldValue) {
|
|
47
|
-
if (newValue !== undefined && !directions.includes(newValue)) {
|
|
48
|
-
throw new Error(`<mg-illustrated-message> prop "direction" must be one of: ${directions.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
49
|
-
}
|
|
50
|
-
else if (newValue === 'horizontal') {
|
|
51
|
-
this.classCollection.add('mg-c-illustrated-message--direction-horizontal');
|
|
52
|
-
}
|
|
53
|
-
else if (oldValue === 'horizontal') {
|
|
54
|
-
this.classCollection.delete('mg-c-illustrated-message--direction-horizontal');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/***********
|
|
58
|
-
* Methods *
|
|
59
|
-
***********/
|
|
60
|
-
/**
|
|
61
|
-
* Validate slots
|
|
62
|
-
*/
|
|
63
|
-
validateSlots() {
|
|
64
|
-
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
65
|
-
const slottedTitle = this.element.querySelector('[slot="title"]');
|
|
66
|
-
const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
|
|
67
|
-
const slottedDetails = this.element.querySelectorAll('[slot="details"]');
|
|
68
|
-
if (slottedDetails.length === 0 && slottedTitle === null) {
|
|
69
|
-
throw new Error('<mg-illustrated-message> Slot "title" or "details" must be present.');
|
|
70
|
-
}
|
|
71
|
-
else if (slottedTitle !== null && !isTagName(slottedTitle, headingTags)) {
|
|
72
|
-
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}.`);
|
|
73
|
-
}
|
|
74
|
-
else if (slottedIllustrations.length !== 1) {
|
|
75
|
-
throw new Error('<mg-illustrated-message> Slotted illustration must be present and unique.');
|
|
76
|
-
}
|
|
77
|
-
slottedIllustrations[0].setAttribute('aria-hidden', 'true');
|
|
78
|
-
}
|
|
79
|
-
/*************
|
|
80
|
-
* Lifecycle *
|
|
81
|
-
*************/
|
|
82
|
-
/**
|
|
83
|
-
* Check if component props are well configured on init
|
|
84
|
-
*/
|
|
85
|
-
componentWillLoad() {
|
|
86
|
-
this.watchDirection(this.direction);
|
|
87
|
-
this.watchSize(this.size);
|
|
88
|
-
this.validateSlots();
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Render
|
|
92
|
-
* @returns HTML Element
|
|
93
|
-
*/
|
|
94
|
-
render() {
|
|
95
|
-
return (h("div", { key: 'c9d8c8bfd2792b1cf5e78ab9d168d597b20e9a1e', class: this.classCollection.join() }, h("div", { key: 'cc8fa03147b9e59e6e8e015be9ed2b8dddd92ded', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '83a4ec2223c4e74511beb7c0abfa10e77cee425d', name: "illustration" })), h("div", { key: 'dbb4d13ca5324cab889fa2acc9b9b22522d7a8ec', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '9e74d84becf29539ec9c37e8ad1e317714f3c86c', name: "title" }), h("slot", { key: 'ae97d25c19b76ca092560d2555ebd6a87f542ffe', name: "details" }))));
|
|
96
|
-
}
|
|
97
|
-
get element() { return this; }
|
|
98
|
-
static get watchers() { return {
|
|
99
|
-
"size": ["watchSize"],
|
|
100
|
-
"direction": ["watchDirection"]
|
|
101
|
-
}; }
|
|
102
|
-
static get style() { return mgIllustratedMessageCss; }
|
|
103
|
-
}, [257, "mg-illustrated-message", {
|
|
104
|
-
"size": [1],
|
|
105
|
-
"direction": [1],
|
|
106
|
-
"classCollection": [32]
|
|
107
|
-
}, undefined, {
|
|
108
|
-
"size": ["watchSize"],
|
|
109
|
-
"direction": ["watchDirection"]
|
|
110
|
-
}]);
|
|
111
|
-
function defineCustomElement$1() {
|
|
112
|
-
if (typeof customElements === "undefined") {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const components = ["mg-illustrated-message"];
|
|
116
|
-
components.forEach(tagName => { switch (tagName) {
|
|
117
|
-
case "mg-illustrated-message":
|
|
118
|
-
if (!customElements.get(tagName)) {
|
|
119
|
-
customElements.define(tagName, MgIllustratedMessage$1);
|
|
120
|
-
}
|
|
121
|
-
break;
|
|
122
|
-
} });
|
|
123
|
-
}
|
|
124
|
-
defineCustomElement$1();
|
|
125
|
-
|
|
126
|
-
const MgIllustratedMessage = MgIllustratedMessage$1;
|
|
127
|
-
const defineCustomElement = defineCustomElement$1;
|
|
128
|
-
|
|
129
|
-
export { MgIllustratedMessage, defineCustomElement };
|
|
1
|
+
import{transformTag as e,proxyCustomElement as s,HTMLElement as t,h as i}from"@stencil/core/internal/client";import{C as l,t as a,b as m}from"./index2.js";const r=["small","medium","large"],g=["vertical","horizontal"],o=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="medium",this.direction="vertical",this.classCollection=new l(["mg-c-illustrated-message"])}watchSize(e,s){if(!r.includes(e))throw Error(`<mg-illustrated-message> prop "size" must be one of: ${r.join(", ")}. Passed value: ${a(e)}.`);void 0!==s&&this.classCollection.delete("mg-c-illustrated-message--size-"+s),this.classCollection.add("mg-c-illustrated-message--size-"+e)}watchDirection(e,s){if(void 0!==e&&!g.includes(e))throw Error(`<mg-illustrated-message> prop "direction" must be one of: ${g.join(", ")}. Passed value: ${a(e)}.`);"horizontal"===e?this.classCollection.add("mg-c-illustrated-message--direction-horizontal"):"horizontal"===s&&this.classCollection.delete("mg-c-illustrated-message--direction-horizontal")}validateSlots(){const e=["h1","h2","h3","h4","h5","h6"],s=this.element.querySelector('[slot="title"]'),t=this.element.querySelectorAll('[slot="illustration"]');if(0===this.element.querySelectorAll('[slot="details"]').length&&null===s)throw Error('<mg-illustrated-message> Slot "title" or "details" must be present.');if(null!==s&&!m(s,e))throw Error(`<mg-illustrated-message> Slotted title must be a heading: ${e.join(", ")}.`);if(1!==t.length)throw Error("<mg-illustrated-message> Slotted illustration must be present and unique.");t[0].setAttribute("aria-hidden","true")}componentWillLoad(){this.watchDirection(this.direction),this.watchSize(this.size),this.validateSlots()}render(){return i("div",{key:"ed3b924f5c5a75706aef03ef8798cb699679012d",class:this.classCollection.join()},i("div",{key:"59b7f7b3fe4ad808377094f93e8b6e86ba2f49ec",class:"mg-c-illustrated-message__illustration"},i("slot",{key:"d28aa873cd7025647f56f3a4ed62d9e35dde25d3",name:"illustration"})),i("div",{key:"3b150411a26531827c988a2d34e2990a2302f982",class:"mg-c-illustrated-message__slots"},i("slot",{key:"8ffea6e50bf5dc4b870d414cb710fc88e0984f61",name:"title"}),i("slot",{key:"ec85b4a50d28ddf14dbd6b0feff59e2030348b68",name:"details"})))}get element(){return this}static get watchers(){return{size:[{watchSize:0}],direction:[{watchDirection:0}]}}static get style(){return".mg-c-illustrated-message{display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-c-illustrated-message-spacing-vertical) var(--mg-b-size-16);margin:auto;gap:var(--mg-b-size-16) var(--mg-b-size-64);max-inline-size:calc(60*var(--mg-b-size-8));text-align:center}.mg-c-illustrated-message__illustration{max-block-size:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){block-size:auto;inline-size:100%;max-block-size:calc(15*var(--mg-b-size-8));max-inline-size:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__slots{display:flex;flex-direction:column;gap:var(--mg-b-size-8)}.mg-c-illustrated-message__slots ::slotted([slot=title]){margin:0;font-family:var(--mg-b-font-family-heading) !important;font-size:var(--mg-b-font-size-h2) !important}.mg-c-illustrated-message__slots ::slotted([slot=details]){margin:0}.mg-c-illustrated-message.mg-c-illustrated-message--size-small{--mg-c-illustrated-message-spacing-vertical:var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__slots{gap:calc(var(--mg-b-size-4)/2)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration{max-block-size:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-block-size:var(--mg-b-size-64);max-inline-size:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration{max-block-size:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-block-size:calc(23*var(--mg-b-size-8));max-inline-size:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{max-inline-size:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-inline-size:calc(60*var(--mg-b-size-8))}@container (width > 52.8rem){.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{flex-direction:row;align-items:center;column-gap:var(--mg-b-size-48);text-align:left}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-inline-size:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__illustration{flex:1 0 auto;max-inline-size:fit-content}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-small{column-gap:var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-large{column-gap:var(--mg-b-size-64)}}:host{display:block;container-type:inline-size}"}},[257,"mg-illustrated-message",{size:[1],direction:[1],classCollection:[32]},void 0,{size:[{watchSize:0}],direction:[{watchDirection:0}]}]);function c(){"undefined"!=typeof customElements&&["mg-illustrated-message"].forEach((s=>{"mg-illustrated-message"===s&&(customElements.get(e(s))||customElements.define(e(s),o))}))}c();const n=o,d=c;export{n as MgIllustratedMessage,d as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const MgInputCheckboxPaginated = MgInputCheckboxPaginated$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { MgInputCheckboxPaginated, defineCustomElement };
|
|
1
|
+
import{M as o,d as t}from"./mg-input-checkbox-paginated2.js";const a=o,p=t;export{a as MgInputCheckboxPaginated,p as defineCustomElement}
|
|
@@ -1,135 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { f as formatID } from './index2.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './mg-button2.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Get checkboxes list template
|
|
8
|
-
* @param props - MgInputCheckboxList Interface Props
|
|
9
|
-
* @returns input template
|
|
10
|
-
*/
|
|
11
|
-
const MgInputCheckboxList = (props) => (h("ul", { class: "mg-c-input__input-group-container", role: "list", "aria-labelledby": props.labelledby, id: props.id }, props.checkboxes.map(input => {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
return (h("li", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } }, h("input", { type: "checkbox", id: input._id, name: props.name, value: (_a = input.value) === null || _a === void 0 ? void 0 : _a.toString(), checked: Boolean(input.value), required: input.required, "aria-invalid": ((_b = props.invalid) === null || _b === void 0 ? void 0 : _b.toString()) || 'false', disabled: props.disabled || input.disabled, indeterminate: input.value === null, onInput: input._handleInput, onBlur: input._handleBlur, onKeyDown: input._handleKeydown }), h("label", { htmlFor: input._id }, input.title)));
|
|
14
|
-
})));
|
|
15
|
-
|
|
16
|
-
const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputCheckboxPaginated extends HTMLElement {
|
|
17
|
-
constructor(registerHost) {
|
|
18
|
-
super();
|
|
19
|
-
if (registerHost !== false) {
|
|
20
|
-
this.__registerHost();
|
|
21
|
-
}
|
|
22
|
-
this.step = 10;
|
|
23
|
-
/*************
|
|
24
|
-
* Decorators *
|
|
25
|
-
*************/
|
|
26
|
-
/**
|
|
27
|
-
* Define if mg-input-checkbox-list is readonly
|
|
28
|
-
*/
|
|
29
|
-
this.readonly = false;
|
|
30
|
-
/**
|
|
31
|
-
* Define if mg-input-checkbox-list is disabled
|
|
32
|
-
*/
|
|
33
|
-
this.disabled = false;
|
|
34
|
-
/**
|
|
35
|
-
* Page items limit to display
|
|
36
|
-
*/
|
|
37
|
-
this.limit = this.step;
|
|
38
|
-
/***********
|
|
39
|
-
* Methods *
|
|
40
|
-
***********/
|
|
41
|
-
/**
|
|
42
|
-
* Component has next checkboxes to display
|
|
43
|
-
* @returns truthy if have next elements
|
|
44
|
-
*/
|
|
45
|
-
this.hasNext = () => {
|
|
46
|
-
return this.checkboxes.length > this.limit;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Set items from checkboxes and limit
|
|
50
|
-
*/
|
|
51
|
-
this.setItems = () => {
|
|
52
|
-
this.items = this.checkboxes.slice(0, this.limit);
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Handle load-more <mg-button> click event
|
|
56
|
-
*/
|
|
57
|
-
this.handleLoadMore = () => {
|
|
58
|
-
if (this.hasNext()) {
|
|
59
|
-
this.limit += this.step;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
watchCheckboxes() {
|
|
64
|
-
this.setItems();
|
|
65
|
-
}
|
|
66
|
-
watchLimit() {
|
|
67
|
-
this.setItems();
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Method to reset limit
|
|
71
|
-
*/
|
|
72
|
-
async resetLimit() {
|
|
73
|
-
this.limit = this.step;
|
|
74
|
-
}
|
|
75
|
-
/*************
|
|
76
|
-
* Lifecycle *
|
|
77
|
-
*************/
|
|
78
|
-
/**
|
|
79
|
-
* Validate props
|
|
80
|
-
*/
|
|
81
|
-
componentWillLoad() {
|
|
82
|
-
this.watchCheckboxes();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Render
|
|
86
|
-
* @returns HTML Element
|
|
87
|
-
*/
|
|
88
|
-
render() {
|
|
89
|
-
const listId = formatID(this.messages.label);
|
|
90
|
-
const tabId = 'tab-info';
|
|
91
|
-
return (h(Host, { key: '233ab4fca3f4a3121bc60650ac2f8ae06d47e6e5' }, h("slot", { key: '7d1af8c712928c06953743fc5c182e51d9a6256b', name: "header-action" }), h("div", { key: '95641bd218e36422a6b5b4ead8dd5498e8ac5fa4', class: "mg-c-input__tabs-content" }, h("p", { key: '34814dd1afc9f871cd032500b931e692d63cbd25', id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': this.items.length !== 0 }, "aria-live": this.items.length !== 0 ? 'polite' : undefined }, this.items.length === 0 ? this.messages.noValue : this.messages.values.replace('{count}', this.items.length.toString())), this.items.length > 0 && (h(MgInputCheckboxList, { key: '621077f291a401737157ad0cd9b9348537ef8bdc', checkboxes: this.items, labelledby: tabId, id: listId, disabled: this.disabled, name: this.name, invalid: this.invalid })), this.hasNext() && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: this.handleLoadMore, "aria-controls": listId }, h("mg-icon", { key: 'cb00bbeb1575475b184cc9623db6c4cefc56c26a', icon: "chevron-down" }), this.messages.showMore)))));
|
|
92
|
-
}
|
|
93
|
-
static get watchers() { return {
|
|
94
|
-
"checkboxes": ["watchCheckboxes"],
|
|
95
|
-
"limit": ["watchLimit"]
|
|
96
|
-
}; }
|
|
97
|
-
}, [262, "mg-input-checkbox-paginated", {
|
|
98
|
-
"readonly": [4],
|
|
99
|
-
"disabled": [4],
|
|
100
|
-
"name": [1],
|
|
101
|
-
"invalid": [4],
|
|
102
|
-
"checkboxes": [16],
|
|
103
|
-
"messages": [16],
|
|
104
|
-
"limit": [32],
|
|
105
|
-
"resetLimit": [64]
|
|
106
|
-
}, undefined, {
|
|
107
|
-
"checkboxes": ["watchCheckboxes"],
|
|
108
|
-
"limit": ["watchLimit"]
|
|
109
|
-
}]);
|
|
110
|
-
function defineCustomElement() {
|
|
111
|
-
if (typeof customElements === "undefined") {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const components = ["mg-input-checkbox-paginated", "mg-button", "mg-icon"];
|
|
115
|
-
components.forEach(tagName => { switch (tagName) {
|
|
116
|
-
case "mg-input-checkbox-paginated":
|
|
117
|
-
if (!customElements.get(tagName)) {
|
|
118
|
-
customElements.define(tagName, MgInputCheckboxPaginated);
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case "mg-button":
|
|
122
|
-
if (!customElements.get(tagName)) {
|
|
123
|
-
defineCustomElement$2();
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
case "mg-icon":
|
|
127
|
-
if (!customElements.get(tagName)) {
|
|
128
|
-
defineCustomElement$1();
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
} });
|
|
132
|
-
}
|
|
133
|
-
defineCustomElement();
|
|
134
|
-
|
|
135
|
-
export { MgInputCheckboxPaginated as M, MgInputCheckboxList as a, defineCustomElement as d };
|
|
1
|
+
import{h as t,transformTag as e,proxyCustomElement as i,HTMLElement as s,Host as c}from"@stencil/core/internal/client";import{f as a}from"./index2.js";import{d as n}from"./mg-button2.js";import{d as o}from"./mg-icon2.js";const h=e=>t("div",{class:"mg-c-input__input-group-container","aria-labelledby":e.labelledby,id:e.id},e.checkboxes.map((i=>{var s,c;return t("div",{key:i._id,class:{"mg-c-input__input-group":!0,"mg-c-input__input-group--disabled":e.disabled||i.disabled}},t("input",{type:"checkbox",id:i._id,name:e.name,value:null===(s=i.value)||void 0===s?void 0:s.toString(),checked:Boolean(i.value),required:i.required,"aria-invalid":(null===(c=e.invalid)||void 0===c?void 0:c.toString())||"false",disabled:e.disabled||i.disabled,indeterminate:null===i.value,onInput:i._handleInput,onBlur:i._handleBlur,onKeyDown:i._handleKeydown}),t("label",{htmlFor:i._id},i.title))}))),l=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.step=10,this.readonly=!1,this.disabled=!1,this.limit=this.step,this.hasNext=()=>this.checkboxes.length>this.limit,this.setItems=()=>{this.items=this.checkboxes.slice(0,this.limit)},this.handleLoadMore=()=>{this.hasNext()&&(this.limit+=this.step)}}watchCheckboxes(){this.setItems()}watchLimit(){this.setItems()}async resetLimit(){this.limit=this.step}componentWillLoad(){this.watchCheckboxes()}render(){const e=a(this.messages.label),i="tab-info";return t(c,{key:"ce0fe4a842cc21f7f981b6a9286d592c2c28819b"},t("slot",{key:"683c26f98e76262c565613529c76e7f3b27efbc5",name:"header-action"}),t("div",{key:"eb9e9bfa54a467b44f4e90a8575ae8b1fe40ea10",class:"mg-c-input__tabs-content"},t("p",{key:"6eeb40f89a0cc0b8ea0837f44babe8cd440ced0f",id:i,class:{"mg-c-input__popover-info":!0,"mg-u-visually-hidden":0!==this.items.length},"aria-live":0!==this.items.length?"polite":void 0},0===this.items.length?this.messages.noValue:this.messages.values.replace("{count}",this.items.length.toString())),this.items.length>0&&t(h,{key:"1625b0bdbb1de6ef0c55850e3a08a2cf322da317",checkboxes:this.items,labelledby:i,id:e,disabled:this.disabled,name:this.name,invalid:this.invalid}),this.hasNext()&&t("mg-button",{key:"load-more",variant:"flat",class:"mg-c-input__load-more",tabIndex:-1,"full-width":!0,onClick:this.handleLoadMore,"aria-controls":e},t("mg-icon",{key:"8f10cc6152899cf869023ff1c465763e9a05d7b6",icon:"chevron-down"}),this.messages.showMore)))}static get watchers(){return{checkboxes:[{watchCheckboxes:0}],limit:[{watchLimit:0}]}}},[262,"mg-input-checkbox-paginated",{readonly:[4],disabled:[4],name:[1],invalid:[4],checkboxes:[16],messages:[16],limit:[32],resetLimit:[64]},void 0,{checkboxes:[{watchCheckboxes:0}],limit:[{watchLimit:0}]}]);function d(){"undefined"!=typeof customElements&&["mg-input-checkbox-paginated","mg-button","mg-icon"].forEach((t=>{switch(t){case"mg-input-checkbox-paginated":customElements.get(e(t))||customElements.define(e(t),l);break;case"mg-button":customElements.get(e(t))||n();break;case"mg-icon":customElements.get(e(t))||o()}}))}d();export{l as M,h as a,d}
|