@mgdis/mg-components 6.7.0 → 6.9.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/README.md +17 -78
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{index-1a5a1081.js → index-CATFkm3O.js} +244 -196
- package/dist/cjs/index-CATFkm3O.js.map +1 -0
- package/dist/cjs/{index-b7923724.js → index-CTU2m-sy.js} +87 -42
- package/dist/cjs/index-CTU2m-sy.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/index.es-jXqiN1uw.js +152 -0
- package/dist/cjs/index.es-jXqiN1uw.js.map +1 -0
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{mg-action-more_36.cjs.entry.js → mg-action-more_37.cjs.entry.js} +842 -826
- package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -0
- package/dist/cjs/mg-alert.cjs.entry.js +21 -15
- package/dist/cjs/mg-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.entry.cjs.js.map +1 -0
- package/dist/cjs/mg-components.cjs.js +8 -7
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +21524 -6868
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.entry.cjs.js.map +1 -0
- package/dist/cjs/{mg-input.conf-5bbcea79.js → mg-input.conf-WTsvDfpC.js} +2 -1
- package/dist/cjs/mg-input.conf-WTsvDfpC.js.map +1 -0
- package/dist/cjs/mg-loader.cjs.entry.js +12 -10
- package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-loader.entry.cjs.js.map +1 -0
- package/dist/cjs/mg-progress.cjs.entry.js +13 -15
- package/dist/cjs/mg-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-progress.entry.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +9 -4
- package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +14 -14
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +21 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +17 -7
- package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -2
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +12 -8
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +19 -6
- 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.js +16 -5
- 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 +1 -1
- 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 +53 -21
- 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.js +64 -30
- 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 +12 -7
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +44 -39
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -3
- 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 +7 -1
- 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 +89 -53
- 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 +28 -23
- 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 +8 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +2 -2
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -1
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js.map +1 -0
- package/dist/collection/components/molecules/{menu → menus}/mg-menu/mg-menu.js +9 -9
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js.map +1 -0
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.conf.js.map +1 -0
- package/dist/collection/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.js +7 -7
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js.map +1 -0
- 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 +9 -4
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +13 -3
- package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +3 -2
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +10 -3
- package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +4 -4
- package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -7
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +12 -7
- package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +2 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/collection/components/molecules/mg-table/mg-table.conf.js +13 -0
- package/dist/collection/components/molecules/mg-table/mg-table.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-table/mg-table.js +364 -0
- package/dist/collection/components/molecules/mg-table/mg-table.js.map +1 -0
- package/dist/collection/locales/en/messages.json +37 -16
- package/dist/collection/locales/fr/messages.json +40 -19
- package/dist/collection/utils/playwright.fixture.js +2 -3
- package/dist/collection/utils/playwright.fixture.js.map +1 -1
- package/dist/components/floating-ui.utils.js +2 -421
- package/dist/components/floating-ui.utils.js.map +1 -1
- package/dist/components/index.es.js +68 -67
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +86 -41
- package/dist/components/index2.js.map +1 -1
- package/dist/components/mg-action-more.js +13 -9
- package/dist/components/mg-action-more.js.map +1 -1
- package/dist/components/mg-alert.js +16 -8
- package/dist/components/mg-alert.js.map +1 -1
- package/dist/components/mg-badge.js +1 -0
- package/dist/components/mg-badge2.js +14 -10
- package/dist/components/mg-badge2.js.map +1 -1
- package/dist/components/mg-button.js +1 -0
- package/dist/components/mg-button2.js +19 -19
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-card.js +1 -0
- package/dist/components/mg-card2.js +2 -2
- package/dist/components/mg-card2.js.map +1 -1
- package/dist/components/mg-character-left.js +1 -0
- package/dist/components/mg-character-left2.js +6 -6
- package/dist/components/mg-character-left2.js.map +1 -1
- package/dist/components/mg-details.js +7 -6
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-divider.js +1 -0
- package/dist/components/mg-divider2.js +2 -2
- package/dist/components/mg-divider2.js.map +1 -1
- package/dist/components/mg-form.js +14 -10
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon.js +1 -0
- package/dist/components/mg-icon2.js +29 -14
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-illustrated-message.js +7 -7
- package/dist/components/mg-illustrated-message.js.map +1 -1
- package/dist/components/mg-input-checkbox-paginated.js +2 -1
- package/dist/components/mg-input-checkbox-paginated2.js +15 -3
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +23 -14
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +64 -32
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.js +76 -43
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.js +12 -8
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.js +10 -10
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-rich-text-editor.js +21525 -6867
- package/dist/components/mg-input-rich-text-editor.js.map +1 -1
- package/dist/components/mg-input-select.js +1 -0
- package/dist/components/mg-input-select2.js +15 -11
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text.js +1 -0
- package/dist/components/mg-input-text2.js +67 -27
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.js +16 -12
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title.js +1 -0
- package/dist/components/mg-input-title2.js +6 -6
- package/dist/components/mg-input-title2.js.map +1 -1
- package/dist/components/mg-input-toggle.js +14 -10
- package/dist/components/mg-input-toggle.js.map +1 -1
- package/dist/components/mg-input.js +1 -0
- package/dist/components/mg-input2.js +20 -14
- package/dist/components/mg-input2.js.map +1 -1
- package/dist/components/mg-item-more.js +2 -1
- package/dist/components/mg-item-more2.js +18 -19
- package/dist/components/mg-item-more2.js.map +1 -1
- package/dist/components/mg-loader.js +10 -6
- package/dist/components/mg-loader.js.map +1 -1
- package/dist/components/mg-menu-item.js +1 -0
- package/dist/components/mg-menu-item2.js +16 -16
- package/dist/components/mg-menu-item2.js.map +1 -1
- package/dist/components/mg-menu.js +2 -1
- package/dist/components/mg-message.js +1 -0
- package/dist/components/mg-message2.js +6 -6
- package/dist/components/mg-message2.js.map +1 -1
- package/dist/components/mg-modal.js +13 -13
- package/dist/components/mg-modal.js.map +1 -1
- package/dist/components/mg-pagination.js +1 -0
- package/dist/components/mg-pagination2.js +19 -11
- package/dist/components/mg-pagination2.js.map +1 -1
- package/dist/components/mg-panel.js +18 -14
- package/dist/components/mg-panel.js.map +1 -1
- package/dist/components/mg-popover-content.js +1 -0
- package/dist/components/mg-popover-content2.js +5 -5
- package/dist/components/mg-popover-content2.js.map +1 -1
- package/dist/components/mg-popover.js +1 -0
- package/dist/components/mg-popover2.js +9 -9
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-progress.js +12 -12
- package/dist/components/mg-progress.js.map +1 -1
- package/dist/components/mg-skip-links.js +4 -4
- package/dist/components/mg-skip-links.js.map +1 -1
- package/dist/components/mg-table.d.ts +11 -0
- package/dist/components/mg-table.js +320 -0
- package/dist/components/mg-table.js.map +1 -0
- package/dist/components/mg-tabs.js +14 -14
- package/dist/components/mg-tabs.js.map +1 -1
- package/dist/components/mg-tag.js +16 -8
- package/dist/components/mg-tag.js.map +1 -1
- package/dist/components/mg-tooltip-content.js +1 -0
- package/dist/components/mg-tooltip-content2.js +2 -2
- package/dist/components/mg-tooltip-content2.js.map +1 -1
- package/dist/components/mg-tooltip.js +1 -0
- package/dist/components/mg-tooltip2.js +13 -13
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{index-5059254f.js → index-CAuxALt5.js} +242 -174
- package/dist/esm/index-CAuxALt5.js.map +1 -0
- package/dist/esm/{index-a58f8b91.js → index-SQlkEaXW.js} +87 -42
- package/dist/esm/index-SQlkEaXW.js.map +1 -0
- package/dist/esm/index.es-DDBtzymI.js +130 -0
- package/dist/esm/index.es-DDBtzymI.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{mg-action-more_36.entry.js → mg-action-more_37.entry.js} +842 -825
- package/dist/esm/mg-action-more_37.entry.js.map +1 -0
- package/dist/esm/mg-alert.entry.js +21 -13
- package/dist/esm/mg-alert.entry.js.map +1 -1
- package/dist/esm/mg-components.js +7 -5
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +21527 -6869
- package/dist/esm/mg-input-rich-text-editor.entry.js.map +1 -1
- package/dist/esm/{mg-input.conf-712c7bb6.js → mg-input.conf-BtkqaBXm.js} +2 -1
- package/dist/esm/mg-input.conf-BtkqaBXm.js.map +1 -0
- package/dist/esm/mg-loader.entry.js +12 -8
- package/dist/esm/mg-loader.entry.js.map +1 -1
- package/dist/esm/mg-progress.entry.js +13 -13
- package/dist/esm/mg-progress.entry.js.map +1 -1
- package/dist/mg-components/index.esm.js.map +1 -1
- package/dist/mg-components/loader.esm.js.map +1 -0
- package/dist/mg-components/locales/en/messages.json +37 -16
- package/dist/mg-components/locales/fr/messages.json +40 -19
- package/dist/mg-components/mg-alert.entry.esm.js.map +1 -0
- 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/mg-input-rich-text-editor.entry.esm.js.map +1 -0
- package/dist/mg-components/mg-loader.entry.esm.js.map +1 -0
- package/dist/mg-components/mg-progress.entry.esm.js.map +1 -0
- package/dist/mg-components/p-583b3769.entry.js +2 -0
- package/dist/mg-components/p-583b3769.entry.js.map +1 -0
- package/dist/mg-components/p-650d6986.entry.js +11 -0
- package/dist/mg-components/p-650d6986.entry.js.map +1 -0
- package/dist/mg-components/p-680948e3.entry.js +2 -0
- package/dist/mg-components/p-680948e3.entry.js.map +1 -0
- package/dist/mg-components/p-9acc6504.entry.js +2 -0
- package/dist/mg-components/p-9acc6504.entry.js.map +1 -0
- package/dist/mg-components/{p-2884f369.js → p-BtkqaBXm.js} +1 -1
- package/dist/mg-components/p-BtkqaBXm.js.map +1 -0
- package/dist/mg-components/p-CAuxALt5.js +3 -0
- package/dist/mg-components/p-CAuxALt5.js.map +1 -0
- package/dist/mg-components/p-CqGbLOnN.js +2 -0
- package/dist/mg-components/p-CqGbLOnN.js.map +1 -0
- package/dist/mg-components/p-DDBtzymI.js +2 -0
- package/dist/mg-components/p-DDBtzymI.js.map +1 -0
- package/dist/mg-components/p-DQuL1Twl.js +2 -0
- package/dist/mg-components/p-DQuL1Twl.js.map +1 -0
- package/dist/mg-components/p-c0fb6f62.entry.js +2 -0
- package/dist/mg-components/p-c0fb6f62.entry.js.map +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +2 -2
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +1 -4
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +7 -6
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +9 -9
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +16 -10
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +5 -5
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +1 -1
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +1 -1
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-loader/mg-loader.d.ts +1 -1
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +2 -2
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -0
- package/dist/types/components/molecules/mg-table/mg-table.conf.d.ts +19 -0
- package/dist/types/components/molecules/mg-table/mg-table.d.ts +58 -0
- package/dist/types/components.d.ts +66 -27
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/ide/intellij/web-types.json +157 -49
- package/ide/vscode/html-custom-data.json +111 -27
- package/package.json +25 -25
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-1a5a1081.js.map +0 -1
- package/dist/cjs/index-b7923724.js.map +0 -1
- package/dist/cjs/index.es-903492c5.js +0 -151
- package/dist/cjs/index.es-903492c5.js.map +0 -1
- package/dist/cjs/mg-action-more_36.cjs.entry.js.map +0 -1
- package/dist/cjs/mg-input.conf-5bbcea79.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-5059254f.js.map +0 -1
- package/dist/esm/index-a58f8b91.js.map +0 -1
- package/dist/esm/index.es-b80b758c.js +0 -129
- package/dist/esm/index.es-b80b758c.js.map +0 -1
- package/dist/esm/mg-action-more_36.entry.js.map +0 -1
- package/dist/esm/mg-input.conf-712c7bb6.js.map +0 -1
- package/dist/mg-components/p-2884f369.js.map +0 -1
- package/dist/mg-components/p-2a633b29.entry.js +0 -2
- package/dist/mg-components/p-2a633b29.entry.js.map +0 -1
- package/dist/mg-components/p-361cc090.entry.js +0 -2
- package/dist/mg-components/p-361cc090.entry.js.map +0 -1
- package/dist/mg-components/p-3afebdab.entry.js +0 -2
- package/dist/mg-components/p-3afebdab.entry.js.map +0 -1
- package/dist/mg-components/p-3c6710be.js +0 -2
- package/dist/mg-components/p-3c6710be.js.map +0 -1
- package/dist/mg-components/p-ac8a5083.js +0 -2
- package/dist/mg-components/p-ac8a5083.js.map +0 -1
- package/dist/mg-components/p-bc6ec847.entry.js +0 -2
- package/dist/mg-components/p-bc6ec847.entry.js.map +0 -1
- package/dist/mg-components/p-e1255160.js +0 -2
- package/dist/mg-components/p-e1255160.js.map +0 -1
- package/dist/mg-components/p-e39791fa.js +0 -3
- package/dist/mg-components/p-e39791fa.js.map +0 -1
- package/dist/mg-components/p-f2e6e7ae.entry.js +0 -2
- package/dist/mg-components/p-f2e6e7ae.entry.js.map +0 -1
- package/loader/package.json +0 -11
- /package/dist/collection/components/molecules/{menu → menus}/mg-menu/mg-menu.conf.js +0 -0
- /package/dist/collection/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.conf.js +0 -0
- /package/dist/types/components/molecules/{menu → menus}/mg-menu/mg-menu.conf.d.ts +0 -0
- /package/dist/types/components/molecules/{menu → menus}/mg-menu/mg-menu.d.ts +0 -0
- /package/dist/types/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.conf.d.ts +0 -0
- /package/dist/types/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface MgTable extends Components.MgTable, HTMLElement {}
|
|
4
|
+
export const MgTable: {
|
|
5
|
+
prototype: MgTable;
|
|
6
|
+
new (): MgTable;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { k as kt, z as zt, L as Le, x as xt } from './index.es.js';
|
|
3
|
+
import { i as initLocales } from './index2.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sizes
|
|
8
|
+
*/
|
|
9
|
+
// Define possible sizes
|
|
10
|
+
const sizes = ['small', 'medium', 'large', 'xlarge'];
|
|
11
|
+
/**
|
|
12
|
+
* Columns
|
|
13
|
+
*/
|
|
14
|
+
// Define possible text alignments
|
|
15
|
+
const textAlignments = ['left', 'center', 'right'];
|
|
16
|
+
// Define possible data types
|
|
17
|
+
const dataTypes = ['string', 'numeric', 'date'];
|
|
18
|
+
|
|
19
|
+
const mgTableCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing:var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-40);--mg-c-table-header-cell-height:calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:none;border-radius:var(--mg-b-size-8);background:var(--mg-b-color-light);border-collapse:separate;border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead td,.mg-c-table th{font-weight:600}.mg-c-table thead{height:var(--mg-c-table-header-cell-height);background-color:var(--mg-b-color-app);color:var(--mg-b-color-light)}.mg-c-table :not(thead) tr:nth-child(even){background:color-mix(in srgb, var(--mg-b-color-app), transparent 80%)}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing:var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-32);--mg-c-table-header-cell-height:var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height:var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing:var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-64);--mg-c-table-header-cell-height:var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td .mg-c-table__sort-button mg-icon,.mg-c-table thead th .mg-c-table__sort-button mg-icon{margin-left:var(--mg-b-size-4)}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:color-mix(in srgb, var(--mg-b-color-app), black 10%)}";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Check if value is a valid align object
|
|
23
|
+
* @param newValue - New value
|
|
24
|
+
* @returns True if value is a valid align object
|
|
25
|
+
*/
|
|
26
|
+
const isValidColumnsObject = (newValue) =>
|
|
27
|
+
// ensure newValue is an object
|
|
28
|
+
typeof newValue === 'object' &&
|
|
29
|
+
!Array.isArray(newValue) &&
|
|
30
|
+
// Ensure every property is well formatted
|
|
31
|
+
Object.entries(newValue).every(([key, value]) =>
|
|
32
|
+
// ensure key is a number
|
|
33
|
+
!isNaN(parseInt(key)) &&
|
|
34
|
+
// ensure value is an object
|
|
35
|
+
typeof value === 'object' &&
|
|
36
|
+
!Array.isArray(value) &&
|
|
37
|
+
// ensure value has at least one of the following properties
|
|
38
|
+
((value.align !== undefined && textAlignments.includes(value.align)) ||
|
|
39
|
+
(value.sortable !== undefined && typeof value.sortable === 'boolean') ||
|
|
40
|
+
(value.datatype !== undefined && dataTypes.includes(value.datatype))) &&
|
|
41
|
+
// ensure no extra properties are present
|
|
42
|
+
Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)));
|
|
43
|
+
/**
|
|
44
|
+
* Compare values
|
|
45
|
+
* @param firstValue - First value
|
|
46
|
+
* @param secondValue - Second value
|
|
47
|
+
* @param descending - Define descending order
|
|
48
|
+
* @param datatype - Data type
|
|
49
|
+
* @returns Comparison result
|
|
50
|
+
* @example
|
|
51
|
+
* compareValues('a', 'b', false, 'string'); // -1
|
|
52
|
+
*/
|
|
53
|
+
const compareValues = (firstValue, secondValue, descending, datatype) => {
|
|
54
|
+
if (descending) {
|
|
55
|
+
const temp = firstValue;
|
|
56
|
+
firstValue = secondValue;
|
|
57
|
+
secondValue = temp;
|
|
58
|
+
}
|
|
59
|
+
if (datatype === 'date') {
|
|
60
|
+
return new Date(firstValue).getTime() - new Date(secondValue).getTime();
|
|
61
|
+
}
|
|
62
|
+
return firstValue.localeCompare(secondValue, undefined, { numeric: datatype === 'numeric' });
|
|
63
|
+
};
|
|
64
|
+
const MgTable$1 = /*@__PURE__*/ proxyCustomElement(class MgTable extends HTMLElement {
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
this.__registerHost();
|
|
68
|
+
this.__attachShadow();
|
|
69
|
+
// Classes
|
|
70
|
+
this.componentClass = 'mg-c-table';
|
|
71
|
+
this.componentWrapperClass = 'mg-c-table-wrapper';
|
|
72
|
+
this.classFullWidth = 'mg-c-table--full-width';
|
|
73
|
+
// Alignment stylesheet
|
|
74
|
+
this.alignmentStylesheet = new CSSStyleSheet();
|
|
75
|
+
/**
|
|
76
|
+
* Define table size
|
|
77
|
+
*/
|
|
78
|
+
this.size = 'medium';
|
|
79
|
+
/**
|
|
80
|
+
* Define if table fits its parent element
|
|
81
|
+
*/
|
|
82
|
+
this.fullWidth = false;
|
|
83
|
+
/**
|
|
84
|
+
* Class collection
|
|
85
|
+
*/
|
|
86
|
+
this.classCollection = new kt([this.componentClass]);
|
|
87
|
+
}
|
|
88
|
+
watchSize(newValue, oldValue) {
|
|
89
|
+
if (!sizes.includes(newValue)) {
|
|
90
|
+
throw new Error(`<mg-table> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${zt(newValue)}.`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
if (oldValue !== undefined) {
|
|
94
|
+
this.classCollection.delete(`mg-c-table--size-${oldValue}`);
|
|
95
|
+
}
|
|
96
|
+
this.classCollection.add(`mg-c-table--size-${newValue}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
watchFullWidth(newValue) {
|
|
100
|
+
if (newValue) {
|
|
101
|
+
this.classCollection.add(this.classFullWidth);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.classCollection.delete(this.classFullWidth);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
watchColumns(newValue) {
|
|
108
|
+
if (newValue !== undefined && !isValidColumnsObject(newValue)) {
|
|
109
|
+
throw new Error(`<mg-table> prop "columns" must be a ColumnsType object. Passed value: ${zt(newValue)}.`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Render Table
|
|
114
|
+
* @param table - Table element
|
|
115
|
+
*/
|
|
116
|
+
renderTable(table) {
|
|
117
|
+
let isSortable = false;
|
|
118
|
+
// Remove table classes
|
|
119
|
+
table.className = '';
|
|
120
|
+
// Add table classes
|
|
121
|
+
table.classList.add(...this.classCollection.classes);
|
|
122
|
+
// Set columns based on columns prop
|
|
123
|
+
if (this.columns !== undefined) {
|
|
124
|
+
// Store original rows
|
|
125
|
+
const rowsDefault = Array.from(table.querySelectorAll('tbody tr'));
|
|
126
|
+
// Apply columns settings
|
|
127
|
+
Object.entries(this.columns).forEach(([key, value]) => {
|
|
128
|
+
// Add alignment to stylesheet
|
|
129
|
+
if (value.align !== undefined) {
|
|
130
|
+
this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align}}}`);
|
|
131
|
+
}
|
|
132
|
+
// if align is not defined and datatype is number, align right
|
|
133
|
+
else if (value.datatype === 'numeric') {
|
|
134
|
+
this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:right}}`);
|
|
135
|
+
}
|
|
136
|
+
// Define if column is sortable
|
|
137
|
+
if (value.sortable) {
|
|
138
|
+
isSortable = true;
|
|
139
|
+
// Add sortable class to table header
|
|
140
|
+
const sortableHeader = table.querySelector(`thead td:nth-child(${key}),thead th:nth-child(${key})`);
|
|
141
|
+
// Create button
|
|
142
|
+
const button = document.createElement('button');
|
|
143
|
+
button.classList.add('mg-c-table__sort-button');
|
|
144
|
+
// Append button to header
|
|
145
|
+
const sortableHeaderContent = sortableHeader.innerHTML;
|
|
146
|
+
sortableHeader.innerHTML = '';
|
|
147
|
+
button.innerHTML = sortableHeaderContent;
|
|
148
|
+
// Set icon
|
|
149
|
+
const icon = document.createElement('mg-icon');
|
|
150
|
+
icon.setAttribute('icon', 'arrows-up-down');
|
|
151
|
+
// Append icon to button
|
|
152
|
+
button.append(icon);
|
|
153
|
+
sortableHeader.append(button);
|
|
154
|
+
// Add event listener
|
|
155
|
+
button.addEventListener('click', () => {
|
|
156
|
+
// Reset aria pressed
|
|
157
|
+
table.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`).forEach(ariaPressed => {
|
|
158
|
+
ariaPressed.removeAttribute('aria-pressed');
|
|
159
|
+
ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');
|
|
160
|
+
});
|
|
161
|
+
// Reset aria sort
|
|
162
|
+
table.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`).forEach(ariaSort => {
|
|
163
|
+
ariaSort.removeAttribute('aria-sort');
|
|
164
|
+
});
|
|
165
|
+
// Set aria pressed
|
|
166
|
+
button.setAttribute('aria-pressed', 'true');
|
|
167
|
+
// Manage sort order
|
|
168
|
+
// Get sort order
|
|
169
|
+
let sortOrder = sortableHeader.getAttribute('aria-sort');
|
|
170
|
+
// First click sort asc
|
|
171
|
+
if ([null, 'none'].includes(sortOrder)) {
|
|
172
|
+
sortableHeader.setAttribute('aria-sort', 'ascending');
|
|
173
|
+
}
|
|
174
|
+
// Second click sort desc
|
|
175
|
+
else if (sortOrder === 'ascending') {
|
|
176
|
+
sortableHeader.setAttribute('aria-sort', 'descending');
|
|
177
|
+
}
|
|
178
|
+
// Third click remove sort
|
|
179
|
+
else {
|
|
180
|
+
sortableHeader.setAttribute('aria-sort', 'none');
|
|
181
|
+
}
|
|
182
|
+
// Update sort order
|
|
183
|
+
sortOrder = sortableHeader.getAttribute('aria-sort');
|
|
184
|
+
// Update button icon
|
|
185
|
+
const icon = button.querySelector('mg-icon');
|
|
186
|
+
let iconType = 'arrows-up-down';
|
|
187
|
+
if (sortOrder === 'ascending') {
|
|
188
|
+
iconType = 'arrow-up';
|
|
189
|
+
}
|
|
190
|
+
else if (sortOrder === 'descending') {
|
|
191
|
+
iconType = 'arrow-down';
|
|
192
|
+
}
|
|
193
|
+
icon.setAttribute('icon', iconType);
|
|
194
|
+
// If sort order is none, return to original order
|
|
195
|
+
if (sortOrder === 'none') {
|
|
196
|
+
// Append rows to table
|
|
197
|
+
rowsDefault.forEach(row => table.querySelector('tbody').append(row));
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
// Set a copy of rows
|
|
201
|
+
const rows = Array.from(table.querySelectorAll('tbody tr'));
|
|
202
|
+
// Sort rows
|
|
203
|
+
rows.sort((a, b) => {
|
|
204
|
+
var _a, _b;
|
|
205
|
+
// Get cells
|
|
206
|
+
const cellA = a.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);
|
|
207
|
+
const cellB = b.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);
|
|
208
|
+
// Get cell values
|
|
209
|
+
const cellValueA = (_a = cellA.dataset.sort) !== null && _a !== void 0 ? _a : cellA.textContent;
|
|
210
|
+
const cellValueB = (_b = cellB.dataset.sort) !== null && _b !== void 0 ? _b : cellB.textContent;
|
|
211
|
+
// Sort cells based on sort order
|
|
212
|
+
return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);
|
|
213
|
+
});
|
|
214
|
+
// Append rows to table
|
|
215
|
+
rows.forEach(row => table.querySelector('tbody').append(row));
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
// Add alignment to columns
|
|
221
|
+
this.element.shadowRoot.adoptedStyleSheets = [...this.element.shadowRoot.adoptedStyleSheets, this.alignmentStylesheet];
|
|
222
|
+
// Create div wrapper for responsive behavior
|
|
223
|
+
const divWrapper = document.createElement('div');
|
|
224
|
+
divWrapper.setAttribute('class', this.componentWrapperClass);
|
|
225
|
+
divWrapper.setAttribute('tabindex', '0');
|
|
226
|
+
divWrapper.setAttribute('role', 'region');
|
|
227
|
+
// Get table title
|
|
228
|
+
let captionTable = table.querySelector('caption');
|
|
229
|
+
// If table is sortable we must add a caption
|
|
230
|
+
if (captionTable === null && isSortable) {
|
|
231
|
+
captionTable = document.createElement('caption');
|
|
232
|
+
table.prepend(captionTable);
|
|
233
|
+
}
|
|
234
|
+
if (captionTable !== null) {
|
|
235
|
+
// Ensure caption is not visible (otherwhise the table does not have rounded corners)
|
|
236
|
+
captionTable.className = 'mg-u-visually-hidden';
|
|
237
|
+
// Link caption to div
|
|
238
|
+
if (!Le(captionTable.id)) {
|
|
239
|
+
captionTable.setAttribute('id', xt(`${this.componentClass}-caption`));
|
|
240
|
+
}
|
|
241
|
+
divWrapper.setAttribute('aria-labelledby', captionTable.id);
|
|
242
|
+
// Add sortable caption if neeeded
|
|
243
|
+
if (isSortable) {
|
|
244
|
+
captionTable.innerHTML = `${captionTable.innerHTML} ${this.messages.table.sortableCaption}`.trim();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
divWrapper.append(table);
|
|
248
|
+
// Remove existing table from shadow root
|
|
249
|
+
const existingTable = this.element.shadowRoot.querySelector(`.${this.componentWrapperClass}`);
|
|
250
|
+
if (existingTable !== null) {
|
|
251
|
+
existingTable.remove();
|
|
252
|
+
}
|
|
253
|
+
// Append table
|
|
254
|
+
this.element.shadowRoot.append(divWrapper);
|
|
255
|
+
}
|
|
256
|
+
/*************
|
|
257
|
+
* Lifecycle *
|
|
258
|
+
*************/
|
|
259
|
+
componentWillLoad() {
|
|
260
|
+
this.messages = initLocales(this.element).messages;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Set variables and validate props
|
|
264
|
+
*/
|
|
265
|
+
componentDidLoad() {
|
|
266
|
+
this.watchSize(this.size);
|
|
267
|
+
this.watchFullWidth(this.fullWidth);
|
|
268
|
+
this.watchColumns(this.columns);
|
|
269
|
+
this.renderTable(this.element.querySelector('table'));
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Update table
|
|
273
|
+
*/
|
|
274
|
+
componentWillUpdate() {
|
|
275
|
+
this.renderTable(this.element.shadowRoot.querySelector('table'));
|
|
276
|
+
}
|
|
277
|
+
get element() { return this; }
|
|
278
|
+
static get watchers() { return {
|
|
279
|
+
"size": ["watchSize"],
|
|
280
|
+
"fullWidth": ["watchFullWidth"],
|
|
281
|
+
"columns": ["watchColumns"]
|
|
282
|
+
}; }
|
|
283
|
+
static get style() { return mgTableCss; }
|
|
284
|
+
}, [1, "mg-table", {
|
|
285
|
+
"size": [1],
|
|
286
|
+
"fullWidth": [4, "full-width"],
|
|
287
|
+
"columns": [16],
|
|
288
|
+
"classCollection": [32]
|
|
289
|
+
}, undefined, {
|
|
290
|
+
"size": ["watchSize"],
|
|
291
|
+
"fullWidth": ["watchFullWidth"],
|
|
292
|
+
"columns": ["watchColumns"]
|
|
293
|
+
}]);
|
|
294
|
+
function defineCustomElement$1() {
|
|
295
|
+
if (typeof customElements === "undefined") {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const components = ["mg-table", "mg-icon"];
|
|
299
|
+
components.forEach(tagName => { switch (tagName) {
|
|
300
|
+
case "mg-table":
|
|
301
|
+
if (!customElements.get(tagName)) {
|
|
302
|
+
customElements.define(tagName, MgTable$1);
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case "mg-icon":
|
|
306
|
+
if (!customElements.get(tagName)) {
|
|
307
|
+
defineCustomElement$2();
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
} });
|
|
311
|
+
}
|
|
312
|
+
defineCustomElement$1();
|
|
313
|
+
|
|
314
|
+
const MgTable = MgTable$1;
|
|
315
|
+
const defineCustomElement = defineCustomElement$1;
|
|
316
|
+
|
|
317
|
+
export { MgTable, defineCustomElement };
|
|
318
|
+
//# sourceMappingURL=mg-table.js.map
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=mg-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"mg-table.js","mappings":";;;;;AACA;;AAEG;AACH;AACO,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU;AAGpE;;AAEG;AACH;AACO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU;AAClE;AACO,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAU;;ACd/D,MAAM,UAAU,GAAG,gmIAAgmI;;ACKnnI;;;;AAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,QAAqB;AACjD;AACA,OAAO,QAAQ,KAAK,QAAQ;AAC5B,IAAA,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAExB,IAAA,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAC5B,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC;;AAEX,IAAA,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;;QAErB,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;;AAErB,SAAC,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;AACjE,aAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI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;;;;;;;;;;;;;","names":["MgTable","__stencil_proxyCustomElement","ClassList","toString","isValidString","createID"],"sources":["src/components/molecules/mg-table/mg-table.conf.ts","../styles/dist/components/mg-table.css?tag=mg-table&encapsulation=shadow","src/components/molecules/mg-table/mg-table.tsx"],"sourcesContent":["import type { Size } from '../../../types';\n/**\n * Sizes\n */\n// Define possible sizes\nexport const sizes = ['small', 'medium', 'large', 'xlarge'] as const;\n// Define Table size type and ensure it is a valid size\nexport type TableSizeType = Size & (typeof sizes)[number];\n/**\n * Columns\n */\n// Define possible text alignments\nexport const textAlignments = ['left', 'center', 'right'] as const;\n// Define possible data types\nexport const dataTypes = ['string', 'numeric', 'date'] as const;\n// Define possible data types\nexport type datatypesType = (typeof dataTypes)[number];\n// Define columns type\nexport type ColumnsType = {\n [key: number]: { align?: (typeof textAlignments)[number]; sortable?: boolean; datatype?: datatypesType };\n};\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing: var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-40);--mg-c-table-header-cell-height: calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:none;border-radius:var(--mg-b-size-8);background:var(--mg-b-color-light);border-collapse:separate;border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead td,.mg-c-table th{font-weight:600}.mg-c-table thead{height:var(--mg-c-table-header-cell-height);background-color:var(--mg-b-color-app);color:var(--mg-b-color-light)}.mg-c-table :not(thead) tr:nth-child(even){background:color-mix(in srgb, var(--mg-b-color-app), transparent 80%)}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing: var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-32);--mg-c-table-header-cell-height: var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height: var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing: var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-64);--mg-c-table-header-cell-height: var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td .mg-c-table__sort-button mg-icon,.mg-c-table thead th .mg-c-table__sort-button mg-icon{margin-left:var(--mg-b-size-4)}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:color-mix(in srgb, var(--mg-b-color-app), black 10%)}/*# sourceMappingURL=mg-table.css.map */\n","import { Component, Element, State, Prop, Watch } from '@stencil/core';\nimport { ClassList, toString, createID, isValidString } from '@mgdis/stencil-helpers';\nimport { type TableSizeType, type ColumnsType, type datatypesType, textAlignments, dataTypes, sizes } from './mg-table.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * Check if value is a valid align object\n * @param newValue - New value\n * @returns True if value is a valid align object\n */\nconst isValidColumnsObject = (newValue: ColumnsType): boolean =>\n // ensure newValue is an object\n typeof newValue === 'object' &&\n !Array.isArray(newValue) &&\n // Ensure every property is well formatted\n Object.entries(newValue).every(\n ([key, value]) =>\n // ensure key is a number\n !isNaN(parseInt(key)) &&\n // ensure value is an object\n typeof value === 'object' &&\n !Array.isArray(value) &&\n // ensure value has at least one of the following properties\n ((value.align !== undefined && textAlignments.includes(value.align)) ||\n (value.sortable !== undefined && typeof value.sortable === 'boolean') ||\n (value.datatype !== undefined && dataTypes.includes(value.datatype))) &&\n // ensure no extra properties are present\n Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)),\n );\n\n/**\n * Compare values\n * @param firstValue - First value\n * @param secondValue - Second value\n * @param descending - Define descending order\n * @param datatype - Data type\n * @returns Comparison result\n * @example\n * compareValues('a', 'b', false, 'string'); // -1\n */\nconst compareValues = (firstValue: string, secondValue: string, descending: boolean, datatype: datatypesType): number => {\n if (descending) {\n const temp = firstValue;\n firstValue = secondValue;\n secondValue = temp;\n }\n if (datatype === 'date') {\n return new Date(firstValue).getTime() - new Date(secondValue).getTime();\n }\n return firstValue.localeCompare(secondValue, undefined, { numeric: datatype === 'numeric' });\n};\n\n/**\n * @slot - Table content\n */\n@Component({\n tag: 'mg-table',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-table.css',\n shadow: true,\n})\nexport class MgTable {\n /************\n * Internal *\n ************/\n\n private messages;\n\n // Classes\n private readonly componentClass = 'mg-c-table';\n private readonly componentWrapperClass = 'mg-c-table-wrapper';\n private readonly classFullWidth = 'mg-c-table--full-width';\n\n // Alignment stylesheet\n private alignmentStylesheet = new CSSStyleSheet();\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTableElement;\n\n /**\n * Define table size\n */\n @Prop() size: TableSizeType = 'medium';\n @Watch('size')\n watchSize(newValue: MgTable['size'], oldValue?: MgTable['size']): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<mg-table> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-table--size-${oldValue}`);\n }\n this.classCollection.add(`mg-c-table--size-${newValue}`);\n }\n }\n\n /**\n * Define if table fits its parent element\n */\n @Prop() fullWidth = false;\n @Watch('fullWidth')\n watchFullWidth(newValue: MgTable['fullWidth']): void {\n if (newValue) {\n this.classCollection.add(this.classFullWidth);\n } else {\n this.classCollection.delete(this.classFullWidth);\n }\n }\n\n /**\n * Define column properties\n */\n @Prop() columns: ColumnsType;\n @Watch('columns')\n watchColumns(newValue: ColumnsType): void {\n if (newValue !== undefined && !isValidColumnsObject(newValue)) {\n throw new Error(`<mg-table> prop \"columns\" must be a ColumnsType object. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Class collection\n */\n @State() classCollection: ClassList = new ClassList([this.componentClass]);\n\n /**\n * Render Table\n * @param table - Table element\n */\n private renderTable(table: HTMLTableElement): void {\n let isSortable = false;\n // Remove table classes\n table.className = '';\n // Add table classes\n table.classList.add(...this.classCollection.classes);\n\n // Set columns based on columns prop\n if (this.columns !== undefined) {\n // Store original rows\n const rowsDefault = Array.from(table.querySelectorAll('tbody tr'));\n\n // Apply columns settings\n Object.entries(this.columns).forEach(([key, value]) => {\n // Add alignment to stylesheet\n if (value.align !== undefined) {\n this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align}}}`);\n }\n // if align is not defined and datatype is number, align right\n else if (value.datatype === 'numeric') {\n this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:right}}`);\n }\n\n // Define if column is sortable\n if (value.sortable) {\n isSortable = true;\n // Add sortable class to table header\n const sortableHeader = table.querySelector(`thead td:nth-child(${key}),thead th:nth-child(${key})`);\n\n // Create button\n const button = document.createElement('button');\n button.classList.add('mg-c-table__sort-button');\n\n // Append button to header\n const sortableHeaderContent = sortableHeader.innerHTML;\n sortableHeader.innerHTML = '';\n button.innerHTML = sortableHeaderContent;\n\n // Set icon\n const icon = document.createElement('mg-icon');\n icon.setAttribute('icon', 'arrows-up-down');\n\n // Append icon to button\n button.append(icon);\n sortableHeader.append(button);\n\n // Add event listener\n button.addEventListener('click', (): void => {\n // Reset aria pressed\n table.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`).forEach(ariaPressed => {\n ariaPressed.removeAttribute('aria-pressed');\n ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');\n });\n // Reset aria sort\n table.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`).forEach(ariaSort => {\n ariaSort.removeAttribute('aria-sort');\n });\n\n // Set aria pressed\n button.setAttribute('aria-pressed', 'true');\n\n // Manage sort order\n // Get sort order\n let sortOrder = sortableHeader.getAttribute('aria-sort');\n\n // First click sort asc\n if ([null, 'none'].includes(sortOrder)) {\n sortableHeader.setAttribute('aria-sort', 'ascending');\n }\n // Second click sort desc\n else if (sortOrder === 'ascending') {\n sortableHeader.setAttribute('aria-sort', 'descending');\n }\n // Third click remove sort\n else {\n sortableHeader.setAttribute('aria-sort', 'none');\n }\n\n // Update sort order\n sortOrder = sortableHeader.getAttribute('aria-sort');\n\n // Update button icon\n const icon = button.querySelector('mg-icon');\n let iconType = 'arrows-up-down';\n if (sortOrder === 'ascending') {\n iconType = 'arrow-up';\n } else if (sortOrder === 'descending') {\n iconType = 'arrow-down';\n }\n icon.setAttribute('icon', iconType);\n\n // If sort order is none, return to original order\n if (sortOrder === 'none') {\n // Append rows to table\n rowsDefault.forEach(row => table.querySelector('tbody').append(row));\n return;\n }\n\n // Set a copy of rows\n const rows = Array.from(table.querySelectorAll('tbody tr'));\n\n // Sort rows\n rows.sort((a, b) => {\n // Get cells\n const cellA: HTMLTableCellElement = a.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);\n const cellB: HTMLTableCellElement = b.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);\n\n // Get cell values\n const cellValueA = cellA.dataset.sort ?? cellA.textContent;\n const cellValueB = cellB.dataset.sort ?? cellB.textContent;\n\n // Sort cells based on sort order\n return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);\n });\n\n // Append rows to table\n rows.forEach(row => table.querySelector('tbody').append(row));\n });\n }\n });\n }\n\n // Add alignment to columns\n this.element.shadowRoot.adoptedStyleSheets = [...this.element.shadowRoot.adoptedStyleSheets, this.alignmentStylesheet];\n\n // Create div wrapper for responsive behavior\n const divWrapper = document.createElement('div');\n divWrapper.setAttribute('class', this.componentWrapperClass);\n divWrapper.setAttribute('tabindex', '0');\n divWrapper.setAttribute('role', 'region');\n\n // Get table title\n let captionTable = table.querySelector('caption');\n\n // If table is sortable we must add a caption\n if (captionTable === null && isSortable) {\n captionTable = document.createElement('caption');\n table.prepend(captionTable);\n }\n\n if (captionTable !== null) {\n // Ensure caption is not visible (otherwhise the table does not have rounded corners)\n captionTable.className = 'mg-u-visually-hidden';\n\n // Link caption to div\n if (!isValidString(captionTable.id)) {\n captionTable.setAttribute('id', createID(`${this.componentClass}-caption`));\n }\n divWrapper.setAttribute('aria-labelledby', captionTable.id);\n\n // Add sortable caption if neeeded\n if (isSortable) {\n captionTable.innerHTML = `${captionTable.innerHTML} ${this.messages.table.sortableCaption}`.trim();\n }\n }\n divWrapper.append(table);\n\n // Remove existing table from shadow root\n const existingTable = this.element.shadowRoot.querySelector(`.${this.componentWrapperClass}`);\n if (existingTable !== null) {\n existingTable.remove();\n }\n // Append table\n this.element.shadowRoot.append(divWrapper);\n }\n\n /*************\n * Lifecycle *\n *************/\n\n componentWillLoad(): void {\n this.messages = initLocales(this.element).messages;\n }\n\n /**\n * Set variables and validate props\n */\n componentDidLoad(): void {\n this.watchSize(this.size);\n this.watchFullWidth(this.fullWidth);\n this.watchColumns(this.columns);\n this.renderTable(this.element.querySelector('table'));\n }\n\n /**\n * Update table\n */\n componentWillUpdate(): void {\n this.renderTable(this.element.shadowRoot.querySelector('table'));\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { x as xt, k as kt, M as Mt, O as Ot, z as zt, L as Le, A as At } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './mg-badge2.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
5
5
|
|
|
@@ -18,7 +18,6 @@ const Status = {
|
|
|
18
18
|
const sizes = ['medium', 'large'];
|
|
19
19
|
|
|
20
20
|
const mgTabsCss = "/*!\n * @prop --mg-c-tabs-color: Defines tabs global color, used for bottom line and active tabs. Default value: `--mg-b-color-app`.\n * @prop --mg-c-tabs-color-text: Defines tabs text color. Unset by default, fallback on `--mg-b-color-dark`.\n */.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium{padding:var(--mg-b-size-12) var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button,.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button ::slotted([slot=label]),.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button ::slotted([slot=metadata]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium ::slotted([slot=label]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium ::slotted([slot=metadata]){font-size:var(--mg-b-font-size)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--horizontal,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium.mg-c-tabs__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--vertical,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium.mg-c-tabs__navigation-button--vertical{padding-left:var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large{padding:var(--mg-b-size-16) var(--mg-b-size-32)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button,.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button ::slotted([slot=label]),.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button ::slotted([slot=metadata]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large ::slotted([slot=label]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--horizontal,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large.mg-c-tabs__navigation-button--horizontal{padding-bottom:var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--vertical,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large.mg-c-tabs__navigation-button--vertical{padding-left:var(--mg-b-size-32)}.mg-c-tabs__navigation-button{display:flex;box-sizing:border-box;align-items:center;border:none;background-color:unset;color:var(--mg-c-tabs-color-text, var(--mg-b-color-dark));column-gap:var(--mg-c-tabs-navigation-button-column-gap, var(--mg-b-size-8));cursor:pointer;font-family:var(--mg-b-font-family);font-weight:400;line-height:var(--mg-b-line-height);text-decoration:none;white-space:nowrap}.mg-c-tabs__navigation-button:disabled,.mg-c-tabs__navigation-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-tabs__navigation-button:focus-visible{z-index:10}.mg-c-tabs__navigation-button:hover:not(.mg-c-tabs__navigation-button--disabled),.mg-c-tabs__navigation-button:focus-visible:not(.mg-c-tabs__navigation-button--disabled){background-color:color-mix(in srgb, var(--mg-c-tabs-color), transparent 90%)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active{color:var(--mg-c-tabs-color);font-weight:600}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active.mg-c-tabs__navigation-button--horizontal{box-shadow:inset 0 calc(-1*var(--mg-b-size-4)) var(--mg-c-tabs-color)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active.mg-c-tabs__navigation-button--vertical{box-shadow:inset var(--mg-b-size-4) 0 var(--mg-c-tabs-color)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--hidden{display:none}.mg-c-tabs__header{display:flex;flex-flow:row wrap;border-bottom:var(--mg-b-size-border) solid color-mix(in srgb, var(--mg-c-tabs-color), transparent 90%)}.mg-c-tabs__content-container:focus-visible{outline:none}.mg-c-tabs__navigation-button-text{flex:0 0 content}";
|
|
21
|
-
const MgTabsStyle0 = mgTabsCss;
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* type TabItem validation function
|
|
@@ -43,7 +42,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
43
42
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
44
43
|
* If not set, it will be created.
|
|
45
44
|
*/
|
|
46
|
-
this.identifier =
|
|
45
|
+
this.identifier = xt('mg-tabs');
|
|
47
46
|
/**
|
|
48
47
|
* Define tabs size
|
|
49
48
|
*/
|
|
@@ -55,7 +54,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
55
54
|
/**
|
|
56
55
|
* Component classes
|
|
57
56
|
*/
|
|
58
|
-
this.classCollection = new
|
|
57
|
+
this.classCollection = new kt(['mg-c-tabs']);
|
|
59
58
|
/**
|
|
60
59
|
* Validate that new tab status can be `Status.ACTIVE`
|
|
61
60
|
* @param tab - tab item
|
|
@@ -153,7 +152,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
153
152
|
*/
|
|
154
153
|
this.resetFocus = () => {
|
|
155
154
|
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
156
|
-
|
|
155
|
+
Mt(() => {
|
|
157
156
|
this.tabFocus = undefined;
|
|
158
157
|
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
159
158
|
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
@@ -170,30 +169,30 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
170
169
|
};
|
|
171
170
|
}
|
|
172
171
|
watchIdentifier(newValue) {
|
|
173
|
-
if (!
|
|
174
|
-
console.error(`<mg-tabs> prop "identifier" value is invalid. Passed value: ${
|
|
172
|
+
if (!Ot(newValue)) {
|
|
173
|
+
console.error(`<mg-tabs> prop "identifier" value is invalid. Passed value: ${zt(newValue)}.`);
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
validateLabel(newValue) {
|
|
178
|
-
if (!
|
|
179
|
-
throw new Error(`<mg-tabs> prop "label" is required and must be a string. Passed value: ${
|
|
177
|
+
if (!Le(newValue)) {
|
|
178
|
+
throw new Error(`<mg-tabs> prop "label" is required and must be a string. Passed value: ${zt(newValue)}.`);
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
181
|
validateSize(newValue) {
|
|
183
182
|
if (!sizes.includes(newValue)) {
|
|
184
|
-
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${
|
|
183
|
+
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${zt(newValue)}.`);
|
|
185
184
|
}
|
|
186
185
|
this.classCollection.add(`mg-c-tabs--size-${this.size}`);
|
|
187
186
|
}
|
|
188
187
|
validateItems(newValue) {
|
|
189
188
|
// String array
|
|
190
|
-
if (
|
|
189
|
+
if (At(newValue))
|
|
191
190
|
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
192
191
|
// Object array
|
|
193
192
|
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
194
193
|
this.tabs = newValue;
|
|
195
194
|
else
|
|
196
|
-
throw new Error(`<mg-tabs> prop "items" is required and all items must be the same type: TabItem. Passed value: ${
|
|
195
|
+
throw new Error(`<mg-tabs> prop "items" is required and all items must be the same type: TabItem. Passed value: ${zt(newValue)}.`);
|
|
197
196
|
}
|
|
198
197
|
validateActiveTab(newValue) {
|
|
199
198
|
// when `active-tab` is undefined we set default value by searching an item with `Status.ACTIVE` or we use the `startIndex` has fallback value
|
|
@@ -218,7 +217,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
218
217
|
this.activeTabChange.emit(newValue);
|
|
219
218
|
}
|
|
220
219
|
else {
|
|
221
|
-
throw new Error(`<mg-tabs> prop "activeTab" must be a number between ${this.startIndex} and ${this.tabs.length} and new value must be "activable". Passed value: ${
|
|
220
|
+
throw new Error(`<mg-tabs> prop "activeTab" must be a number between ${this.startIndex} and ${this.tabs.length} and new value must be "activable". Passed value: ${zt(newValue)}.`);
|
|
222
221
|
}
|
|
223
222
|
}
|
|
224
223
|
/*************
|
|
@@ -269,7 +268,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
269
268
|
"items": ["validateItems"],
|
|
270
269
|
"activeTab": ["validateActiveTab"]
|
|
271
270
|
}; }
|
|
272
|
-
static get style() { return
|
|
271
|
+
static get style() { return mgTabsCss; }
|
|
273
272
|
}, [1, "mg-tabs", {
|
|
274
273
|
"identifier": [1],
|
|
275
274
|
"label": [1],
|
|
@@ -314,5 +313,6 @@ const MgTabs = MgTabs$1;
|
|
|
314
313
|
const defineCustomElement = defineCustomElement$1;
|
|
315
314
|
|
|
316
315
|
export { MgTabs, defineCustomElement };
|
|
316
|
+
//# sourceMappingURL=mg-tabs.js.map
|
|
317
317
|
|
|
318
318
|
//# sourceMappingURL=mg-tabs.js.map
|