@mgdis/mg-components 5.19.2 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{components.utils-dc9c8a53.js → components.utils-cd908d4e.js} +102 -99
- package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
- package/dist/cjs/{index-c042e24b.js → index-8532b5e9.js} +320 -137
- package/dist/cjs/index-8532b5e9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_34.cjs.entry.js +5130 -5057
- package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
- package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
- package/dist/collection/assets/icons/index.js +193 -183
- package/dist/collection/assets/icons/index.js.map +1 -0
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
- package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +362 -347
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
- package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
- package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
- package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
- package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +8 -0
- package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
- package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +789 -791
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +589 -572
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +779 -767
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +537 -520
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +566 -550
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +701 -689
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +0 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +771 -754
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +706 -689
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +332 -335
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
- package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
- package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
- package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
- package/dist/collection/locales/fr/messages.json +4 -4
- package/dist/collection/locales/index.spec.js +20 -20
- package/dist/collection/locales/index.spec.js.map +1 -1
- package/dist/collection/utils/behaviors.utils.js +127 -127
- package/dist/collection/utils/behaviors.utils.js.map +1 -1
- package/dist/collection/utils/behaviors.utils.spec.js +42 -42
- package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
- package/dist/collection/utils/components.utils.js +77 -75
- package/dist/collection/utils/components.utils.js.map +1 -1
- package/dist/collection/utils/components.utils.spec.js +150 -135
- package/dist/collection/utils/components.utils.spec.js.map +1 -1
- package/dist/collection/utils/e2e.test.utils.js +21 -21
- package/dist/collection/utils/e2e.test.utils.js.map +1 -1
- package/dist/collection/utils/locale.utils.js +17 -17
- package/dist/collection/utils/locale.utils.js.map +1 -1
- package/dist/collection/utils/locale.utils.spec.js +45 -45
- package/dist/collection/utils/locale.utils.spec.js.map +1 -1
- package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
- package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
- package/dist/collection/utils/playwright.fixture.js +24 -0
- package/dist/collection/utils/playwright.fixture.js.map +1 -0
- package/dist/collection/utils/unit.test.utils.js +50 -50
- package/dist/collection/utils/unit.test.utils.js.map +1 -1
- package/dist/components/MgInput.js +105 -97
- package/dist/components/MgInput.js.map +1 -1
- package/dist/components/components.utils.js +78 -76
- package/dist/components/components.utils.js.map +1 -1
- package/dist/components/index2.js +21 -21
- package/dist/components/index2.js.map +1 -1
- package/dist/components/mg-action-more.d.ts +2 -2
- package/dist/components/mg-action-more.js +173 -173
- package/dist/components/mg-action-more.js.map +1 -1
- package/dist/components/mg-badge.d.ts +2 -2
- package/dist/components/mg-badge2.js +83 -83
- package/dist/components/mg-badge2.js.map +1 -1
- package/dist/components/mg-button.d.ts +2 -2
- package/dist/components/mg-button2.js +182 -167
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-card.d.ts +2 -2
- package/dist/components/mg-card2.js +77 -77
- package/dist/components/mg-card2.js.map +1 -1
- package/dist/components/mg-character-left.d.ts +2 -2
- package/dist/components/mg-character-left2.js +50 -50
- package/dist/components/mg-character-left2.js.map +1 -1
- package/dist/components/mg-details.d.ts +2 -2
- package/dist/components/mg-details.js +69 -69
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-divider.d.ts +2 -2
- package/dist/components/mg-divider.js +30 -30
- package/dist/components/mg-divider.js.map +1 -1
- package/dist/components/mg-form.d.ts +2 -2
- package/dist/components/mg-form.js +171 -179
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon.d.ts +2 -2
- package/dist/components/mg-icon2.js +327 -309
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-illustrated-message.d.ts +2 -2
- package/dist/components/mg-illustrated-message.js +51 -51
- package/dist/components/mg-illustrated-message.js.map +1 -1
- package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js +170 -170
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.d.ts +2 -2
- package/dist/components/mg-input-checkbox.js +478 -480
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.d.ts +2 -2
- package/dist/components/mg-input-date.js +266 -260
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.d.ts +2 -2
- package/dist/components/mg-input-numeric.js +354 -348
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.d.ts +2 -2
- package/dist/components/mg-input-password.js +205 -199
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.d.ts +2 -2
- package/dist/components/mg-input-radio.js +236 -231
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-select.d.ts +2 -2
- package/dist/components/mg-input-select2.js +316 -310
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text.d.ts +2 -2
- package/dist/components/mg-input-text2.js +306 -300
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.d.ts +2 -2
- package/dist/components/mg-input-textarea.js +277 -271
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title.d.ts +2 -2
- package/dist/components/mg-input-title2.js +60 -60
- package/dist/components/mg-input-title2.js.map +1 -1
- package/dist/components/mg-input-toggle.d.ts +2 -2
- package/dist/components/mg-input-toggle.js +251 -251
- package/dist/components/mg-input-toggle.js.map +1 -1
- package/dist/components/mg-item-more.d.ts +2 -2
- package/dist/components/mg-item-more.js +285 -285
- package/dist/components/mg-item-more.js.map +1 -1
- package/dist/components/mg-menu-item.d.ts +2 -2
- package/dist/components/mg-menu-item2.js +345 -345
- package/dist/components/mg-menu-item2.js.map +1 -1
- package/dist/components/mg-menu.conf.js +2 -2
- package/dist/components/mg-menu.conf.js.map +1 -1
- package/dist/components/mg-menu.d.ts +2 -2
- package/dist/components/mg-menu2.js +176 -176
- package/dist/components/mg-menu2.js.map +1 -1
- package/dist/components/mg-message.d.ts +2 -2
- package/dist/components/mg-message.js +198 -193
- package/dist/components/mg-message.js.map +1 -1
- package/dist/components/mg-modal.d.ts +2 -2
- package/dist/components/mg-modal.js +198 -198
- package/dist/components/mg-modal.js.map +1 -1
- package/dist/components/mg-pagination.d.ts +2 -2
- package/dist/components/mg-pagination2.js +133 -133
- package/dist/components/mg-pagination2.js.map +1 -1
- package/dist/components/mg-panel.d.ts +2 -2
- package/dist/components/mg-panel.js +238 -238
- package/dist/components/mg-panel.js.map +1 -1
- package/dist/components/mg-popover-content.d.ts +2 -2
- package/dist/components/mg-popover-content2.js +70 -70
- package/dist/components/mg-popover-content2.js.map +1 -1
- package/dist/components/mg-popover.d.ts +2 -2
- package/dist/components/mg-popover2.js +224 -222
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-skip-links.d.ts +2 -2
- package/dist/components/mg-skip-links.js +57 -57
- package/dist/components/mg-skip-links.js.map +1 -1
- package/dist/components/mg-tabs.d.ts +2 -2
- package/dist/components/mg-tabs.js +243 -243
- package/dist/components/mg-tabs.js.map +1 -1
- package/dist/components/mg-tag.d.ts +2 -2
- package/dist/components/mg-tag.js +97 -97
- package/dist/components/mg-tag.js.map +1 -1
- package/dist/components/mg-tooltip-content.d.ts +2 -2
- package/dist/components/mg-tooltip-content2.js +30 -30
- package/dist/components/mg-tooltip-content2.js.map +1 -1
- package/dist/components/mg-tooltip.d.ts +2 -2
- package/dist/components/mg-tooltip2.js +316 -316
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/components/popper.js +6 -12
- package/dist/components/popper.js.map +1 -1
- package/dist/esm/{components.utils-0f76010d.js → components.utils-0d67c31c.js} +102 -100
- package/dist/esm/components.utils-0d67c31c.js.map +1 -0
- package/dist/esm/{index-ce01e63b.js → index-f34a3a2c.js} +320 -137
- package/dist/esm/index-f34a3a2c.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_34.entry.js +5130 -5057
- package/dist/esm/mg-action-more_34.entry.js.map +1 -1
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-item-more.entry.js +224 -224
- package/dist/esm/mg-item-more.entry.js.map +1 -1
- package/dist/mg-components/locales/fr/messages.json +4 -4
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -1
- package/dist/mg-components/p-629454f7.entry.js +2 -0
- package/dist/mg-components/p-629454f7.entry.js.map +1 -0
- package/dist/mg-components/p-7444ff40.js +3 -0
- package/dist/mg-components/p-7444ff40.js.map +1 -0
- package/dist/mg-components/p-af42d17b.js +2 -0
- package/dist/mg-components/p-af42d17b.js.map +1 -0
- package/dist/mg-components/{p-01ebc95a.entry.js → p-e0fb0f3c.entry.js} +2 -2
- package/dist/mg-components/p-e0fb0f3c.entry.js.map +1 -0
- package/dist/types/assets/icons/index.d.ts +193 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -96
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -3
- package/dist/types/components/molecules/inputs/MgInput.d.ts +17 -16
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -260
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -149
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -222
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -141
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -151
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -192
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +1 -6
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -194
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -180
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -11
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -104
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
- package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
- package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
- package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
- package/dist/types/components.d.ts +296 -32
- package/dist/types/locales/index.d.ts +172 -172
- package/dist/types/stencil-public-runtime.d.ts +29 -0
- package/dist/types/utils/behaviors.utils.d.ts +65 -65
- package/dist/types/utils/components.utils.d.ts +32 -26
- package/dist/types/utils/locale.utils.d.ts +2 -2
- package/dist/types/utils/playwright.fixture.d.ts +3 -0
- package/dist/types/utils/unit.test.utils.d.ts +5 -5
- package/package.json +33 -47
- package/dist/cjs/components.utils-dc9c8a53.js.map +0 -1
- package/dist/cjs/index-c042e24b.js.map +0 -1
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -142
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
- package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
- package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -640
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -379
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -456
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -289
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -355
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -399
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -353
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -318
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -128
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -187
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
- package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
- package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -277
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
- package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
- package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
- package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
- package/dist/esm/components.utils-0f76010d.js.map +0 -1
- package/dist/esm/index-ce01e63b.js.map +0 -1
- package/dist/mg-components/p-01ebc95a.entry.js.map +0 -1
- package/dist/mg-components/p-1aa89acf.js +0 -3
- package/dist/mg-components/p-1aa89acf.js.map +0 -1
- package/dist/mg-components/p-71a5a848.entry.js +0 -2
- package/dist/mg-components/p-71a5a848.entry.js.map +0 -1
- package/dist/mg-components/p-c9e2c669.js +0 -2
- package/dist/mg-components/p-c9e2c669.js.map +0 -1
- package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
- package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
- package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
- package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
- package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
- package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
- package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'mg-components';
|
|
2
|
+
const BUILD = /* mg-components */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -31,6 +32,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
35
|
+
/**
|
|
36
|
+
* Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
|
|
37
|
+
*
|
|
38
|
+
* Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
|
|
39
|
+
* support as of Stencil v4.
|
|
40
|
+
*/
|
|
41
|
+
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
34
42
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
35
43
|
/**
|
|
36
44
|
* Default style mode id
|
|
@@ -346,6 +354,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
346
354
|
}
|
|
347
355
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
348
356
|
}
|
|
357
|
+
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
358
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
359
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
360
|
+
}
|
|
349
361
|
if (appliedStyles) {
|
|
350
362
|
appliedStyles.add(scopeId);
|
|
351
363
|
}
|
|
@@ -479,11 +491,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
479
491
|
// except for the first character, we keep the event name case
|
|
480
492
|
memberName = ln[2] + memberName.slice(3);
|
|
481
493
|
}
|
|
482
|
-
if (oldValue) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
494
|
+
if (oldValue || newValue) {
|
|
495
|
+
// Need to account for "capture" events.
|
|
496
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
497
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
498
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
499
|
+
// Make sure we only replace the last instance of "Capture"
|
|
500
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
501
|
+
if (oldValue) {
|
|
502
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
503
|
+
}
|
|
504
|
+
if (newValue) {
|
|
505
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
506
|
+
}
|
|
487
507
|
}
|
|
488
508
|
}
|
|
489
509
|
else {
|
|
@@ -505,7 +525,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
505
525
|
elm[memberName] = newValue;
|
|
506
526
|
}
|
|
507
527
|
}
|
|
508
|
-
catch (e) {
|
|
528
|
+
catch (e) {
|
|
529
|
+
/**
|
|
530
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
531
|
+
*/
|
|
532
|
+
}
|
|
509
533
|
}
|
|
510
534
|
/**
|
|
511
535
|
* Need to manually update attribute if:
|
|
@@ -544,7 +568,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
544
568
|
}
|
|
545
569
|
};
|
|
546
570
|
const parseClassListRegex = /\s/;
|
|
571
|
+
/**
|
|
572
|
+
* Parsed a string of classnames into an array
|
|
573
|
+
* @param value className string, e.g. "foo bar baz"
|
|
574
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
575
|
+
*/
|
|
547
576
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
577
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
578
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
548
579
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
549
580
|
// if the element passed in is a shadow root, which is a document fragment
|
|
550
581
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -578,6 +609,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
578
609
|
* @returns the newly created node
|
|
579
610
|
*/
|
|
580
611
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
612
|
+
var _a;
|
|
581
613
|
// tslint:disable-next-line: prefer-const
|
|
582
614
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
583
615
|
let i = 0;
|
|
@@ -634,11 +666,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
634
666
|
}
|
|
635
667
|
}
|
|
636
668
|
}
|
|
669
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
670
|
+
// to another component but don't end up in a slot
|
|
671
|
+
elm['s-hn'] = hostTagName;
|
|
637
672
|
{
|
|
638
|
-
elm['s-hn'] = hostTagName;
|
|
639
673
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
640
674
|
// remember the content reference comment
|
|
641
675
|
elm['s-sr'] = true;
|
|
676
|
+
// Persist the name of the slot that this slot was going to be projected into.
|
|
677
|
+
elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
|
|
642
678
|
// remember the content reference comment
|
|
643
679
|
elm['s-cr'] = contentRef;
|
|
644
680
|
// remember the slot name, or empty string for default slot
|
|
@@ -646,30 +682,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
646
682
|
// check if we've got an old vnode for this slot
|
|
647
683
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
648
684
|
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
685
|
+
{
|
|
686
|
+
// we've got an old slot vnode and the wrapper is being replaced
|
|
687
|
+
// so let's move the old slot content back to its original location
|
|
688
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
689
|
+
}
|
|
652
690
|
}
|
|
653
691
|
}
|
|
654
692
|
}
|
|
655
693
|
return elm;
|
|
656
694
|
};
|
|
657
695
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
696
|
+
var _a;
|
|
658
697
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
659
698
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
660
699
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
661
700
|
const childNode = oldSlotChildNodes[i];
|
|
662
701
|
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
663
|
-
// // this child node in the old element is from another component
|
|
664
|
-
// // remove this node from the old slot's parent
|
|
665
|
-
// childNode.remove();
|
|
666
702
|
// and relocate it back to it's original location
|
|
667
703
|
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
668
704
|
// remove the old original location comment entirely
|
|
669
705
|
// later on the patch function will know what to do
|
|
670
|
-
// and move this to the correct spot
|
|
706
|
+
// and move this to the correct spot if need be
|
|
671
707
|
childNode['s-ol'].remove();
|
|
672
708
|
childNode['s-ol'] = undefined;
|
|
709
|
+
// Reset so we can correctly move the node around again.
|
|
710
|
+
childNode['s-sh'] = undefined;
|
|
711
|
+
// When putting an element node back in its original location,
|
|
712
|
+
// we need to reset the `slot` attribute back to the value it originally had
|
|
713
|
+
// so we can correctly relocate it again in the future
|
|
714
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
715
|
+
childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
|
|
716
|
+
}
|
|
673
717
|
checkSlotRelocate = true;
|
|
674
718
|
}
|
|
675
719
|
if (recursive) {
|
|
@@ -1085,42 +1129,53 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1085
1129
|
elm.data = text;
|
|
1086
1130
|
}
|
|
1087
1131
|
};
|
|
1132
|
+
/**
|
|
1133
|
+
* Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
|
|
1134
|
+
* are slot fallbacks nodes.
|
|
1135
|
+
*
|
|
1136
|
+
* A slot fallback node should be visible by default. Then, it should be
|
|
1137
|
+
* conditionally hidden if:
|
|
1138
|
+
*
|
|
1139
|
+
* - it has a sibling with a `slot` property set to its slot name or if
|
|
1140
|
+
* - it is a default fallback slot node, in which case we hide if it has any
|
|
1141
|
+
* content
|
|
1142
|
+
*
|
|
1143
|
+
* @param elm the element of interest
|
|
1144
|
+
*/
|
|
1088
1145
|
const updateFallbackSlotVisibility = (elm) => {
|
|
1089
|
-
// tslint:disable-next-line: prefer-const
|
|
1090
1146
|
const childNodes = elm.childNodes;
|
|
1091
|
-
|
|
1092
|
-
let i;
|
|
1093
|
-
let ilen;
|
|
1094
|
-
let j;
|
|
1095
|
-
let slotNameAttr;
|
|
1096
|
-
let nodeType;
|
|
1097
|
-
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1098
|
-
childNode = childNodes[i];
|
|
1147
|
+
for (const childNode of childNodes) {
|
|
1099
1148
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1100
1149
|
if (childNode['s-sr']) {
|
|
1101
1150
|
// this is a slot fallback node
|
|
1102
1151
|
// get the slot name for this slot reference node
|
|
1103
|
-
|
|
1152
|
+
const slotName = childNode['s-sn'];
|
|
1104
1153
|
// by default always show a fallback slot node
|
|
1105
1154
|
// then hide it if there are other slots in the light dom
|
|
1106
1155
|
childNode.hidden = false;
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1156
|
+
// we need to check all of its sibling nodes in order to see if
|
|
1157
|
+
// `childNode` should be hidden
|
|
1158
|
+
for (const siblingNode of childNodes) {
|
|
1159
|
+
// Don't check the node against itself
|
|
1160
|
+
if (siblingNode !== childNode) {
|
|
1161
|
+
if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
|
|
1162
|
+
// this sibling node is from a different component OR is a named
|
|
1163
|
+
// fallback slot node
|
|
1164
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
1165
|
+
(slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
|
|
1166
|
+
childNode.hidden = true;
|
|
1167
|
+
break;
|
|
1168
|
+
}
|
|
1114
1169
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1170
|
+
else {
|
|
1171
|
+
// this is a default fallback slot node
|
|
1172
|
+
// any element or text node (with content)
|
|
1173
|
+
// should hide the default fallback slot node
|
|
1174
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1175
|
+
(siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
|
|
1176
|
+
childNode.hidden = true;
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1124
1179
|
}
|
|
1125
1180
|
}
|
|
1126
1181
|
}
|
|
@@ -1130,45 +1185,67 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1130
1185
|
}
|
|
1131
1186
|
}
|
|
1132
1187
|
};
|
|
1188
|
+
/**
|
|
1189
|
+
* Component-global information about nodes which are either currently being
|
|
1190
|
+
* relocated or will be shortly.
|
|
1191
|
+
*/
|
|
1133
1192
|
const relocateNodes = [];
|
|
1134
|
-
|
|
1193
|
+
/**
|
|
1194
|
+
* Mark the contents of a slot for relocation via adding references to them to
|
|
1195
|
+
* the {@link relocateNodes} data structure. The actual work of relocating them
|
|
1196
|
+
* will then be handled in {@link renderVdom}.
|
|
1197
|
+
*
|
|
1198
|
+
* @param elm a render node whose child nodes need to be relocated
|
|
1199
|
+
*/
|
|
1200
|
+
const markSlotContentForRelocation = (elm) => {
|
|
1135
1201
|
// tslint:disable-next-line: prefer-const
|
|
1136
|
-
let childNode;
|
|
1137
1202
|
let node;
|
|
1138
1203
|
let hostContentNodes;
|
|
1139
|
-
let slotNameAttr;
|
|
1140
|
-
let relocateNodeData;
|
|
1141
1204
|
let j;
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
for (; i < ilen; i++) {
|
|
1146
|
-
childNode = childNodes[i];
|
|
1205
|
+
for (const childNode of elm.childNodes) {
|
|
1206
|
+
// we need to find child nodes which are slot references so we can then try
|
|
1207
|
+
// to match them up with nodes that need to be relocated
|
|
1147
1208
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
1148
|
-
// first
|
|
1149
|
-
//
|
|
1209
|
+
// first get the content reference comment node ('s-cr'), then we get
|
|
1210
|
+
// its parent, which is where all the host content is now
|
|
1150
1211
|
hostContentNodes = node.parentNode.childNodes;
|
|
1151
|
-
|
|
1212
|
+
const slotName = childNode['s-sn'];
|
|
1213
|
+
// iterate through all the nodes under the location where the host was
|
|
1214
|
+
// originally rendered
|
|
1152
1215
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1153
1216
|
node = hostContentNodes[j];
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1217
|
+
// check that the node is not a content reference node or a node
|
|
1218
|
+
// reference and then check that the host name does not match that of
|
|
1219
|
+
// childNode.
|
|
1220
|
+
// In addition, check that the slot either has not already been relocated, or
|
|
1221
|
+
// that its current location's host is not childNode's host. This is essentially
|
|
1222
|
+
// a check so that we don't try to relocate (and then hide) a node that is already
|
|
1223
|
+
// where it should be.
|
|
1224
|
+
if (!node['s-cn'] &&
|
|
1225
|
+
!node['s-nr'] &&
|
|
1226
|
+
node['s-hn'] !== childNode['s-hn'] &&
|
|
1227
|
+
(!BUILD.experimentalSlotFixes )) {
|
|
1228
|
+
// if `node` is located in the slot that `childNode` refers to (via the
|
|
1229
|
+
// `'s-sn'` property) then we need to relocate it from it's current spot
|
|
1230
|
+
// (under the host element parent) to the right slot location
|
|
1231
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1159
1232
|
// it's possible we've already decided to relocate this node
|
|
1160
|
-
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1233
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1161
1234
|
// made some changes to slots
|
|
1162
1235
|
// let's make sure we also double check
|
|
1163
1236
|
// fallbacks are correctly hidden or shown
|
|
1164
1237
|
checkSlotFallbackVisibility = true;
|
|
1165
|
-
|
|
1238
|
+
// ensure that the slot-name attr is correct
|
|
1239
|
+
node['s-sn'] = node['s-sn'] || slotName;
|
|
1166
1240
|
if (relocateNodeData) {
|
|
1167
|
-
|
|
1168
|
-
//
|
|
1241
|
+
relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
|
|
1242
|
+
// we marked this node for relocation previously but didn't find
|
|
1243
|
+
// out the slot reference node to which it needs to be relocated
|
|
1244
|
+
// so write it down now!
|
|
1169
1245
|
relocateNodeData.$slotRefNode$ = childNode;
|
|
1170
1246
|
}
|
|
1171
1247
|
else {
|
|
1248
|
+
node['s-sh'] = childNode['s-hn'];
|
|
1172
1249
|
// add to our list of nodes to relocate
|
|
1173
1250
|
relocateNodes.push({
|
|
1174
1251
|
$slotRefNode$: childNode,
|
|
@@ -1187,8 +1264,10 @@ const relocateSlotContent = (elm) => {
|
|
|
1187
1264
|
}
|
|
1188
1265
|
}
|
|
1189
1266
|
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1190
|
-
//
|
|
1191
|
-
//
|
|
1267
|
+
// the node is not found within the slot (`childNode`) that we're
|
|
1268
|
+
// currently looking at, so we stick it into `relocateNodes` to
|
|
1269
|
+
// handle later. If we never find a home for this element then
|
|
1270
|
+
// we'll need to hide it
|
|
1192
1271
|
relocateNodes.push({
|
|
1193
1272
|
$nodeToRelocate$: node,
|
|
1194
1273
|
});
|
|
@@ -1196,30 +1275,41 @@ const relocateSlotContent = (elm) => {
|
|
|
1196
1275
|
}
|
|
1197
1276
|
}
|
|
1198
1277
|
}
|
|
1278
|
+
// if we're dealing with any type of element (capable of itself being a
|
|
1279
|
+
// slot reference or containing one) then we recur
|
|
1199
1280
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1200
|
-
|
|
1281
|
+
markSlotContentForRelocation(childNode);
|
|
1201
1282
|
}
|
|
1202
1283
|
}
|
|
1203
1284
|
};
|
|
1204
|
-
|
|
1285
|
+
/**
|
|
1286
|
+
* Check whether a node is located in a given named slot.
|
|
1287
|
+
*
|
|
1288
|
+
* @param nodeToRelocate the node of interest
|
|
1289
|
+
* @param slotName the slot name to check
|
|
1290
|
+
* @returns whether the node is located in the slot or not
|
|
1291
|
+
*/
|
|
1292
|
+
const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1205
1293
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1206
|
-
if (nodeToRelocate.getAttribute('slot') === null &&
|
|
1294
|
+
if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
|
|
1295
|
+
// if the node doesn't have a slot attribute, and the slot we're checking
|
|
1296
|
+
// is not a named slot, then we assume the node should be within the slot
|
|
1207
1297
|
return true;
|
|
1208
1298
|
}
|
|
1209
|
-
if (nodeToRelocate.getAttribute('slot') ===
|
|
1299
|
+
if (nodeToRelocate.getAttribute('slot') === slotName) {
|
|
1210
1300
|
return true;
|
|
1211
1301
|
}
|
|
1212
1302
|
return false;
|
|
1213
1303
|
}
|
|
1214
|
-
if (nodeToRelocate['s-sn'] ===
|
|
1304
|
+
if (nodeToRelocate['s-sn'] === slotName) {
|
|
1215
1305
|
return true;
|
|
1216
1306
|
}
|
|
1217
|
-
return
|
|
1307
|
+
return slotName === '';
|
|
1218
1308
|
};
|
|
1219
1309
|
/**
|
|
1220
|
-
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1310
|
+
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
|
|
1311
|
+
* them with `null`. This signals that the DOM element corresponding to the VDom
|
|
1312
|
+
* node has been removed from the DOM.
|
|
1223
1313
|
*
|
|
1224
1314
|
* @param vNode a virtual DOM node
|
|
1225
1315
|
*/
|
|
@@ -1243,6 +1333,7 @@ const nullifyVNodeRefs = (vNode) => {
|
|
|
1243
1333
|
* @param isInitialLoad whether or not this is the first call after page load
|
|
1244
1334
|
*/
|
|
1245
1335
|
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1336
|
+
var _a, _b, _c, _d;
|
|
1246
1337
|
const hostElm = hostRef.$hostElement$;
|
|
1247
1338
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1248
1339
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -1298,43 +1389,48 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1298
1389
|
// the disconnectCallback from working
|
|
1299
1390
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1300
1391
|
if (checkSlotRelocate) {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
let orgLocationNode;
|
|
1305
|
-
let parentNodeRef;
|
|
1306
|
-
let insertBeforeNode;
|
|
1307
|
-
let refNode;
|
|
1308
|
-
let i = 0;
|
|
1309
|
-
for (; i < relocateNodes.length; i++) {
|
|
1310
|
-
relocateData = relocateNodes[i];
|
|
1311
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1392
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1393
|
+
for (const relocateData of relocateNodes) {
|
|
1394
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1312
1395
|
if (!nodeToRelocate['s-ol']) {
|
|
1313
1396
|
// add a reference node marking this node's original location
|
|
1314
1397
|
// keep a reference to this node for later lookups
|
|
1315
|
-
orgLocationNode =
|
|
1316
|
-
doc.createTextNode('');
|
|
1398
|
+
const orgLocationNode = doc.createTextNode('');
|
|
1317
1399
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1318
1400
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1319
1401
|
}
|
|
1320
1402
|
}
|
|
1321
|
-
for (
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1326
|
-
//
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1403
|
+
for (const relocateData of relocateNodes) {
|
|
1404
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1405
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1406
|
+
if (slotRefNode) {
|
|
1407
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1408
|
+
// When determining where to insert content, the most simple case would be
|
|
1409
|
+
// to relocate the node immediately following the slot reference node. We do this
|
|
1410
|
+
// by getting a reference to the node immediately following the slot reference node
|
|
1411
|
+
// since we will use `insertBefore` to manipulate the DOM.
|
|
1412
|
+
//
|
|
1413
|
+
// If there is no node immediately following the slot reference node, then we will just
|
|
1414
|
+
// end up appending the node as the last child of the parent.
|
|
1415
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1416
|
+
// If the node we're currently planning on inserting the new node before is an element,
|
|
1417
|
+
// we need to do some additional checks to make sure we're inserting the node in the correct order.
|
|
1418
|
+
// The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
|
|
1419
|
+
// to make sure they get inserted into their new how in the same order they were declared in their original location.
|
|
1420
|
+
//
|
|
1421
|
+
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
|
|
1422
|
+
{
|
|
1423
|
+
let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
1424
|
+
while (orgLocationNode) {
|
|
1425
|
+
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
1426
|
+
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1427
|
+
refNode = refNode.nextSibling;
|
|
1428
|
+
if (!refNode || !refNode['s-nr']) {
|
|
1429
|
+
insertBeforeNode = refNode;
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1337
1432
|
}
|
|
1433
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1338
1434
|
}
|
|
1339
1435
|
}
|
|
1340
1436
|
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
@@ -1347,14 +1443,29 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1347
1443
|
// probably a component in the index.html that doesn't have its hostname set
|
|
1348
1444
|
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1349
1445
|
}
|
|
1350
|
-
//
|
|
1446
|
+
// Add it back to the dom but in its new home
|
|
1447
|
+
// If we get to this point and `insertBeforeNode` is `null`, that means
|
|
1448
|
+
// we're just going to append the node as the last child of the parent. Passing
|
|
1449
|
+
// `null` as the second arg here will trigger that behavior.
|
|
1351
1450
|
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
1451
|
+
// Reset the `hidden` value back to what it was defined as originally
|
|
1452
|
+
// This solves a problem where a `slot` is dynamically rendered and `hidden` may have
|
|
1453
|
+
// been set on content originally, but now it has a slot to go to so it should have
|
|
1454
|
+
// the value it was defined as having in the DOM, not what we overrode it to.
|
|
1455
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1456
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
|
|
1457
|
+
}
|
|
1352
1458
|
}
|
|
1353
1459
|
}
|
|
1354
1460
|
}
|
|
1355
1461
|
else {
|
|
1356
1462
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1357
1463
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1464
|
+
// Store the initial value of `hidden` so we can reset it later when
|
|
1465
|
+
// moving nodes around.
|
|
1466
|
+
if (isInitialLoad) {
|
|
1467
|
+
nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
|
|
1468
|
+
}
|
|
1358
1469
|
nodeToRelocate.hidden = true;
|
|
1359
1470
|
}
|
|
1360
1471
|
}
|
|
@@ -1534,6 +1645,10 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1534
1645
|
*/
|
|
1535
1646
|
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1536
1647
|
try {
|
|
1648
|
+
/**
|
|
1649
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
1650
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
1651
|
+
*/
|
|
1537
1652
|
instance = instance.render && instance.render();
|
|
1538
1653
|
{
|
|
1539
1654
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1616,6 +1731,16 @@ const appDidLoad = (who) => {
|
|
|
1616
1731
|
}
|
|
1617
1732
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1618
1733
|
};
|
|
1734
|
+
/**
|
|
1735
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1736
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1737
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1738
|
+
* output bundle and this function returns `undefined`.
|
|
1739
|
+
* @param instance any object that may or may not contain methods
|
|
1740
|
+
* @param method method name
|
|
1741
|
+
* @param arg single arbitrary argument
|
|
1742
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1743
|
+
*/
|
|
1619
1744
|
const safeCall = (instance, method, arg) => {
|
|
1620
1745
|
if (instance && instance[method]) {
|
|
1621
1746
|
try {
|
|
@@ -1684,13 +1809,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1684
1809
|
*/
|
|
1685
1810
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1686
1811
|
var _a;
|
|
1812
|
+
const prototype = Cstr.prototype;
|
|
1687
1813
|
if (cmpMeta.$members$) {
|
|
1688
1814
|
if (Cstr.watchers) {
|
|
1689
1815
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1690
1816
|
}
|
|
1691
1817
|
// It's better to have a const than two Object.entries()
|
|
1692
1818
|
const members = Object.entries(cmpMeta.$members$);
|
|
1693
|
-
const prototype = Cstr.prototype;
|
|
1694
1819
|
members.map(([memberName, [memberFlags]]) => {
|
|
1695
1820
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1696
1821
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1713,8 +1838,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1713
1838
|
// proxyComponent - method
|
|
1714
1839
|
Object.defineProperty(prototype, memberName, {
|
|
1715
1840
|
value(...args) {
|
|
1841
|
+
var _a;
|
|
1716
1842
|
const ref = getHostRef(this);
|
|
1717
|
-
return ref.$onInstancePromise
|
|
1843
|
+
return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
|
|
1718
1844
|
},
|
|
1719
1845
|
});
|
|
1720
1846
|
}
|
|
@@ -1723,6 +1849,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1723
1849
|
const attrNameToPropName = new Map();
|
|
1724
1850
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1725
1851
|
plt.jmp(() => {
|
|
1852
|
+
var _a;
|
|
1726
1853
|
const propName = attrNameToPropName.get(attrName);
|
|
1727
1854
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1728
1855
|
// in the case where an attribute was set inline.
|
|
@@ -1778,11 +1905,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1778
1905
|
// 1. The instance is ready
|
|
1779
1906
|
// 2. The watchers are ready
|
|
1780
1907
|
// 3. The value has changed
|
|
1781
|
-
if (
|
|
1908
|
+
if (flags &&
|
|
1909
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1782
1910
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1783
1911
|
newValue !== oldValue) {
|
|
1784
1912
|
const instance = hostRef.$lazyInstance$ ;
|
|
1785
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1913
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1786
1914
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1787
1915
|
if (instance[callbackName] != null) {
|
|
1788
1916
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
@@ -1804,10 +1932,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1804
1932
|
...members
|
|
1805
1933
|
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1806
1934
|
.map(([propName, m]) => {
|
|
1935
|
+
var _a;
|
|
1807
1936
|
const attrName = m[1] || propName;
|
|
1808
1937
|
attrNameToPropName.set(attrName, propName);
|
|
1809
1938
|
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1810
|
-
cmpMeta.$attrsToReflect
|
|
1939
|
+
(_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
|
|
1811
1940
|
}
|
|
1812
1941
|
return attrName;
|
|
1813
1942
|
}),
|
|
@@ -1816,7 +1945,18 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1816
1945
|
}
|
|
1817
1946
|
return Cstr;
|
|
1818
1947
|
};
|
|
1819
|
-
|
|
1948
|
+
/**
|
|
1949
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
1950
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
1951
|
+
* and (optionally) an HMR version ID.
|
|
1952
|
+
*
|
|
1953
|
+
* @param elm a host element
|
|
1954
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
1955
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
1956
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
1957
|
+
*/
|
|
1958
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1959
|
+
let Cstr;
|
|
1820
1960
|
// initializeComponent
|
|
1821
1961
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1822
1962
|
// Let the runtime know that the component has been initialized
|
|
@@ -1999,12 +2139,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1999
2139
|
const customElements = win.customElements;
|
|
2000
2140
|
const head = doc.head;
|
|
2001
2141
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
2002
|
-
const
|
|
2142
|
+
const dataStyles = /*@__PURE__*/ doc.createElement('style');
|
|
2003
2143
|
const deferredConnectedCallbacks = [];
|
|
2004
2144
|
let appLoadFallback;
|
|
2005
2145
|
let isBootstrapping = true;
|
|
2006
2146
|
Object.assign(plt, options);
|
|
2007
2147
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
2148
|
+
let hasSlotRelocation = false;
|
|
2008
2149
|
lazyBundles.map((lazyBundle) => {
|
|
2009
2150
|
lazyBundle[1].map((compactMeta) => {
|
|
2010
2151
|
var _a;
|
|
@@ -2014,6 +2155,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2014
2155
|
$members$: compactMeta[2],
|
|
2015
2156
|
$listeners$: compactMeta[3],
|
|
2016
2157
|
};
|
|
2158
|
+
// Check if we are using slots outside the shadow DOM in this component.
|
|
2159
|
+
// We'll use this information later to add styles for `slot-fb` elements
|
|
2160
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
2161
|
+
hasSlotRelocation = true;
|
|
2162
|
+
}
|
|
2017
2163
|
{
|
|
2018
2164
|
cmpMeta.$members$ = compactMeta[2];
|
|
2019
2165
|
}
|
|
@@ -2073,15 +2219,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2073
2219
|
}
|
|
2074
2220
|
});
|
|
2075
2221
|
});
|
|
2222
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
2223
|
+
if (hasSlotRelocation) {
|
|
2224
|
+
dataStyles.innerHTML += SLOT_FB_CSS;
|
|
2225
|
+
}
|
|
2226
|
+
// Add hydration styles
|
|
2076
2227
|
{
|
|
2077
|
-
|
|
2078
|
-
|
|
2228
|
+
dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
|
|
2229
|
+
}
|
|
2230
|
+
// If we have styles, add them to the DOM
|
|
2231
|
+
if (dataStyles.innerHTML.length) {
|
|
2232
|
+
dataStyles.setAttribute('data-styles', '');
|
|
2079
2233
|
// Apply CSP nonce to the style tag if it exists
|
|
2080
2234
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
2081
2235
|
if (nonce != null) {
|
|
2082
|
-
|
|
2236
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
2083
2237
|
}
|
|
2084
|
-
|
|
2238
|
+
// Insert the styles into the document head
|
|
2239
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
2240
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
2085
2241
|
}
|
|
2086
2242
|
// Process deferred connectedCallbacks now all components have been registered
|
|
2087
2243
|
isBootstrapping = false;
|
|
@@ -2137,13 +2293,40 @@ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !==
|
|
|
2137
2293
|
* @returns void
|
|
2138
2294
|
*/
|
|
2139
2295
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
2296
|
+
/**
|
|
2297
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
2298
|
+
* instances.
|
|
2299
|
+
*/
|
|
2140
2300
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
2301
|
+
/**
|
|
2302
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
2303
|
+
*
|
|
2304
|
+
* @param ref the runtime ref of interest
|
|
2305
|
+
* @returns the Host reference (if found) or undefined
|
|
2306
|
+
*/
|
|
2141
2307
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
2308
|
+
/**
|
|
2309
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
2310
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
2311
|
+
*
|
|
2312
|
+
* @param lazyInstance the lazy instance of interest
|
|
2313
|
+
* @param hostRef that instances `HostRef` object
|
|
2314
|
+
* @returns a reference to the host ref WeakMap
|
|
2315
|
+
*/
|
|
2142
2316
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
2143
|
-
|
|
2317
|
+
/**
|
|
2318
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
2319
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
2320
|
+
* metadata.
|
|
2321
|
+
*
|
|
2322
|
+
* @param hostElement the host element to register
|
|
2323
|
+
* @param cmpMeta runtime metadata for that component
|
|
2324
|
+
* @returns a reference to the host ref WeakMap
|
|
2325
|
+
*/
|
|
2326
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
2144
2327
|
const hostRef = {
|
|
2145
2328
|
$flags$: 0,
|
|
2146
|
-
$hostElement$:
|
|
2329
|
+
$hostElement$: hostElement,
|
|
2147
2330
|
$cmpMeta$: cmpMeta,
|
|
2148
2331
|
$instanceValues$: new Map(),
|
|
2149
2332
|
};
|
|
@@ -2152,11 +2335,11 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
2152
2335
|
}
|
|
2153
2336
|
{
|
|
2154
2337
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
2155
|
-
|
|
2156
|
-
|
|
2338
|
+
hostElement['s-p'] = [];
|
|
2339
|
+
hostElement['s-rc'] = [];
|
|
2157
2340
|
}
|
|
2158
|
-
addHostEventListeners(
|
|
2159
|
-
return hostRefs.set(
|
|
2341
|
+
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
|
|
2342
|
+
return hostRefs.set(hostElement, hostRef);
|
|
2160
2343
|
};
|
|
2161
2344
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
2162
2345
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -2170,23 +2353,23 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2170
2353
|
return module[exportName];
|
|
2171
2354
|
}
|
|
2172
2355
|
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2356
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
2357
|
+
const processMod = importedModule => {
|
|
2358
|
+
cmpModules.set(bundleId, importedModule);
|
|
2359
|
+
return importedModule[exportName];
|
|
2360
|
+
}
|
|
2361
|
+
switch(bundleId) {
|
|
2362
|
+
|
|
2363
|
+
case 'mg-action-more_34':
|
|
2364
|
+
return import(
|
|
2365
|
+
/* webpackMode: "lazy" */
|
|
2366
|
+
'./mg-action-more_34.entry.js').then(processMod, consoleError);
|
|
2367
|
+
case 'mg-item-more':
|
|
2368
|
+
return import(
|
|
2369
|
+
/* webpackMode: "lazy" */
|
|
2370
|
+
'./mg-item-more.entry.js').then(processMod, consoleError);
|
|
2371
|
+
}
|
|
2177
2372
|
}
|
|
2178
|
-
switch(bundleId) {
|
|
2179
|
-
|
|
2180
|
-
case 'mg-action-more_34':
|
|
2181
|
-
return import(
|
|
2182
|
-
/* webpackMode: "lazy" */
|
|
2183
|
-
'./mg-action-more_34.entry.js').then(processMod, consoleError);
|
|
2184
|
-
case 'mg-item-more':
|
|
2185
|
-
return import(
|
|
2186
|
-
/* webpackMode: "lazy" */
|
|
2187
|
-
'./mg-item-more.entry.js').then(processMod, consoleError);
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
2373
|
return import(
|
|
2191
2374
|
/* @vite-ignore */
|
|
2192
2375
|
/* webpackInclude: /\.entry\.js$/ */
|
|
@@ -2261,9 +2444,9 @@ const flush = () => {
|
|
|
2261
2444
|
}
|
|
2262
2445
|
}
|
|
2263
2446
|
};
|
|
2264
|
-
const nextTick =
|
|
2447
|
+
const nextTick = (cb) => promiseResolve().then(cb);
|
|
2265
2448
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2266
2449
|
|
|
2267
2450
|
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2268
2451
|
|
|
2269
|
-
//# sourceMappingURL=index-
|
|
2452
|
+
//# sourceMappingURL=index-f34a3a2c.js.map
|