@six-group/ui-library 3.0.0-beta.1.8 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/event-listeners-74715e62.js +2 -0
- package/dist/cjs/event-listeners-74715e62.js.map +1 -0
- package/dist/cjs/execution-control-46f388e0.js +2 -0
- package/dist/cjs/execution-control-46f388e0.js.map +1 -0
- package/dist/cjs/focus-visible-0b352c74.js +2 -0
- package/dist/cjs/focus-visible-0b352c74.js.map +1 -0
- package/dist/cjs/{form-control-866bbece.js → form-control-2c17c573.js} +3 -1
- package/dist/cjs/form-control-2c17c573.js.map +1 -0
- package/dist/cjs/{index-341df120.js → index-2f6daa5b.js} +602 -280
- package/dist/cjs/index-2f6daa5b.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/modal-48d42228.js +2 -0
- package/dist/cjs/modal-48d42228.js.map +1 -0
- package/dist/cjs/{popover-1d2a037c.js → popover-f743f62b.js} +5 -4
- package/dist/cjs/popover-f743f62b.js.map +1 -0
- package/dist/cjs/scroll-76e6f5d7.js +2 -0
- package/dist/cjs/scroll-76e6f5d7.js.map +1 -0
- package/dist/cjs/set-attributes_2.cjs.entry.js +5 -5
- package/dist/cjs/set-attributes_2.cjs.entry.js.map +1 -0
- package/dist/cjs/six-alert.cjs.entry.js +4 -9
- package/dist/cjs/six-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/six-avatar.cjs.entry.js +4 -6
- package/dist/cjs/six-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-badge.cjs.entry.js +4 -5
- package/dist/cjs/six-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/six-button.cjs.entry.js +9 -11
- package/dist/cjs/six-button.cjs.entry.js.map +1 -0
- package/dist/cjs/six-card.cjs.entry.js +4 -2
- package/dist/cjs/six-card.cjs.entry.js.map +1 -0
- package/dist/cjs/six-checkbox.cjs.entry.js +9 -13
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/six-datepicker.cjs.entry.js +34 -87
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/six-details.cjs.entry.js +6 -9
- package/dist/cjs/six-details.cjs.entry.js.map +1 -0
- package/dist/cjs/six-dialog.cjs.entry.js +4 -11
- package/dist/cjs/six-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/six-drawer.cjs.entry.js +4 -16
- package/dist/cjs/six-drawer.cjs.entry.js.map +1 -0
- package/dist/cjs/{six-dropdown_3.cjs.entry.js → six-dropdown_2.cjs.entry.js} +31 -130
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/six-error-page.cjs.entry.js +8 -5
- package/dist/cjs/six-error-page.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-list-item.cjs.entry.js +10 -12
- package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-list.cjs.entry.js +4 -2
- package/dist/cjs/six-file-list.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-upload.cjs.entry.js +30 -17
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -0
- package/dist/cjs/six-footer.cjs.entry.js +4 -2
- package/dist/cjs/six-footer.cjs.entry.js.map +1 -0
- package/dist/cjs/six-form.cjs.entry.js +4 -3
- package/dist/cjs/six-form.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +6 -7
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -0
- package/dist/cjs/six-header.cjs.entry.js +11 -11
- package/dist/cjs/six-header.cjs.entry.js.map +1 -0
- package/dist/cjs/six-icon-button.cjs.entry.js +9 -6
- package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/six-icon.cjs.entry.js +4 -4
- package/dist/cjs/six-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/six-input.cjs.entry.js +21 -23
- package/dist/cjs/six-input.cjs.entry.js.map +1 -0
- package/dist/cjs/six-item-picker.cjs.entry.js +11 -26
- package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/six-language-switcher.cjs.entry.js +6 -4
- package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -0
- package/dist/cjs/six-layout-grid.cjs.entry.js +5 -2
- package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/six-main-container.cjs.entry.js +4 -3
- package/dist/cjs/six-main-container.cjs.entry.js.map +1 -0
- package/dist/cjs/six-menu-divider.cjs.entry.js +4 -2
- package/dist/cjs/six-menu-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/six-menu-item.cjs.entry.js +61 -0
- package/dist/cjs/six-menu-item.cjs.entry.js.map +1 -0
- package/dist/cjs/six-menu-label.cjs.entry.js +4 -2
- package/dist/cjs/six-menu-label.cjs.entry.js.map +1 -0
- package/dist/cjs/six-picto.cjs.entry.js +4 -5
- package/dist/cjs/six-picto.cjs.entry.js.map +1 -0
- package/dist/cjs/six-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/six-progress-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-progress-ring.cjs.entry.js +5 -4
- package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -0
- package/dist/cjs/six-radio.cjs.entry.js +8 -10
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/six-range.cjs.entry.js +9 -20
- package/dist/cjs/six-range.cjs.entry.js.map +1 -0
- package/dist/cjs/six-root.cjs.entry.js +9 -10
- package/dist/cjs/six-root.cjs.entry.js.map +1 -0
- package/dist/cjs/six-search-field.cjs.entry.js +9 -10
- package/dist/cjs/six-search-field.cjs.entry.js.map +1 -0
- package/dist/cjs/six-select.cjs.entry.js +31 -57
- package/dist/cjs/six-select.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +11 -10
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar-item.cjs.entry.js +4 -5
- package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar.cjs.entry.js +9 -11
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-spinner.cjs.entry.js +4 -3
- package/dist/cjs/six-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/six-switch.cjs.entry.js +8 -8
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab-panel.cjs.entry.js +4 -4
- package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab.cjs.entry.js +4 -6
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tag.cjs.entry.js +4 -6
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/six-textarea.cjs.entry.js +17 -20
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tile.cjs.entry.js +12 -15
- package/dist/cjs/six-tile.cjs.entry.js.map +1 -0
- package/dist/cjs/six-timepicker.cjs.entry.js +29 -78
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/six-timepicker.types-c19ebff3.js +2 -0
- package/dist/cjs/six-timepicker.types-c19ebff3.js.map +1 -0
- package/dist/cjs/six-tooltip.cjs.entry.js +8 -18
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/slot-ad537f24.js +2 -0
- package/dist/cjs/slot-ad537f24.js.map +1 -0
- package/dist/cjs/types-64878648.js +2 -0
- package/dist/cjs/types-64878648.js.map +1 -0
- package/dist/cjs/ui-library.cjs.js +12 -3
- package/dist/cjs/ui-library.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -7
- package/dist/collection/components/six-alert/six-alert.js +221 -219
- package/dist/collection/components/six-alert/six-alert.js.map +1 -0
- package/dist/collection/components/six-avatar/six-avatar.js +91 -91
- package/dist/collection/components/six-avatar/six-avatar.js.map +1 -0
- package/dist/collection/components/six-badge/six-badge.js +69 -66
- package/dist/collection/components/six-badge/six-badge.js.map +1 -0
- package/dist/collection/components/six-button/six-button.js +377 -379
- package/dist/collection/components/six-button/six-button.js.map +1 -0
- package/dist/collection/components/six-card/six-card.js +13 -9
- package/dist/collection/components/six-card/six-card.js.map +1 -0
- package/dist/collection/components/six-checkbox/six-checkbox.js +372 -381
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/day-selection.js +9 -10
- package/dist/collection/components/six-datepicker/components/day-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/month-selection.js +6 -6
- package/dist/collection/components/six-datepicker/components/month-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/year-selection.js +6 -6
- package/dist/collection/components/six-datepicker/components/year-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/six-date-formats.js +1 -0
- package/dist/collection/components/six-datepicker/six-date-formats.js.map +1 -0
- package/dist/collection/components/six-datepicker/six-datepicker.css +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +670 -742
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -0
- package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js +1 -0
- package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js.map +1 -0
- package/dist/collection/components/six-details/six-details.js +276 -274
- package/dist/collection/components/six-details/six-details.js.map +1 -0
- package/dist/collection/components/six-dialog/six-dialog.js +224 -228
- package/dist/collection/components/six-dialog/six-dialog.js.map +1 -0
- package/dist/collection/components/six-drawer/six-drawer.js +258 -267
- package/dist/collection/components/six-drawer/six-drawer.js.map +1 -0
- package/dist/collection/components/six-dropdown/six-dropdown.js +514 -534
- package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -0
- package/dist/collection/components/six-error-page/six-error-page.js +100 -96
- package/dist/collection/components/six-error-page/six-error-page.js.map +1 -0
- package/dist/collection/components/six-file-list/six-file-list.js +13 -9
- package/dist/collection/components/six-file-list/six-file-list.js.map +1 -0
- package/dist/collection/components/six-file-list-item/six-file-list-item.js +170 -169
- package/dist/collection/components/six-file-list-item/six-file-list-item.js.map +1 -0
- package/dist/collection/components/six-file-upload/six-file-upload.js +221 -186
- package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -0
- package/dist/collection/components/six-footer/six-footer.js +13 -9
- package/dist/collection/components/six-footer/six-footer.js.map +1 -0
- package/dist/collection/components/six-form/six-form.js +174 -163
- package/dist/collection/components/six-form/six-form.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.js +118 -111
- package/dist/collection/components/six-group-label/six-group-label.js.map +1 -0
- package/dist/collection/components/six-header/six-header.js +260 -268
- package/dist/collection/components/six-header/six-header.js.map +1 -0
- package/dist/collection/components/six-icon/six-icon.js +52 -48
- package/dist/collection/components/six-icon/six-icon.js.map +1 -0
- package/dist/collection/components/six-icon-button/six-icon-button.js +108 -104
- package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -0
- package/dist/collection/components/six-input/six-input.js +895 -896
- package/dist/collection/components/six-input/six-input.js.map +1 -0
- package/dist/collection/components/six-item-picker/six-item-picker.js +329 -336
- package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -0
- package/dist/collection/components/six-item-picker/types.js +1 -0
- package/dist/collection/components/six-item-picker/types.js.map +1 -0
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +85 -74
- package/dist/collection/components/six-language-switcher/six-language-switcher.js.map +1 -0
- package/dist/collection/components/six-layout-grid/six-layout-grid.js +43 -32
- package/dist/collection/components/six-layout-grid/six-layout-grid.js.map +1 -0
- package/dist/collection/components/six-main-container/six-main-container.js +35 -33
- package/dist/collection/components/six-main-container/six-main-container.js.map +1 -0
- package/dist/collection/components/six-menu/six-menu.js +176 -184
- package/dist/collection/components/six-menu/six-menu.js.map +1 -0
- package/dist/collection/components/six-menu-divider/six-menu-divider.js +12 -7
- package/dist/collection/components/six-menu-divider/six-menu-divider.js.map +1 -0
- package/dist/collection/components/six-menu-item/six-menu-item.js +131 -110
- package/dist/collection/components/six-menu-item/six-menu-item.js.map +1 -0
- package/dist/collection/components/six-menu-label/six-menu-label.js +13 -9
- package/dist/collection/components/six-menu-label/six-menu-label.js.map +1 -0
- package/dist/collection/components/six-picto/six-picto.js +35 -32
- package/dist/collection/components/six-picto/six-picto.js.map +1 -0
- package/dist/collection/components/six-progress-bar/six-progress-bar.js +54 -51
- package/dist/collection/components/six-progress-bar/six-progress-bar.js.map +1 -0
- package/dist/collection/components/six-progress-ring/six-progress-ring.js +75 -72
- package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -0
- package/dist/collection/components/six-radio/six-radio.js +269 -267
- package/dist/collection/components/six-radio/six-radio.js.map +1 -0
- package/dist/collection/components/six-range/six-range.js +426 -427
- package/dist/collection/components/six-range/six-range.js.map +1 -0
- package/dist/collection/components/six-root/six-root.js +127 -129
- package/dist/collection/components/six-root/six-root.js.map +1 -0
- package/dist/collection/components/six-search-field/six-search-field.js +134 -128
- package/dist/collection/components/six-search-field/six-search-field.js.map +1 -0
- package/dist/collection/components/six-select/six-select.css +1 -2
- package/dist/collection/components/six-select/six-select.js +665 -689
- package/dist/collection/components/six-select/six-select.js.map +1 -0
- package/dist/collection/components/six-sidebar/six-sidebar.js +288 -279
- package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -0
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +69 -66
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js.map +1 -0
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +116 -115
- package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -0
- package/dist/collection/components/six-spinner/six-spinner.js +35 -32
- package/dist/collection/components/six-spinner/six-spinner.js.map +1 -0
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +39 -36
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.js.map +1 -0
- package/dist/collection/components/six-switch/six-switch.js +279 -271
- package/dist/collection/components/six-switch/six-switch.js.map +1 -0
- package/dist/collection/components/six-tab/six-tab.js +150 -146
- package/dist/collection/components/six-tab/six-tab.js.map +1 -0
- package/dist/collection/components/six-tab-group/six-tab-group.js +126 -120
- package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -0
- package/dist/collection/components/six-tab-panel/six-tab-panel.js +52 -49
- package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -0
- package/dist/collection/components/six-tag/six-tag.js +107 -105
- package/dist/collection/components/six-tag/six-tag.js.map +1 -0
- package/dist/collection/components/six-textarea/six-textarea.js +708 -700
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -0
- package/dist/collection/components/six-tile/six-tile.js +237 -238
- package/dist/collection/components/six-tile/six-tile.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-time-format.js +1 -0
- package/dist/collection/components/six-timepicker/six-time-format.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-timepicker.js +597 -641
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-timepicker.types.js +1 -0
- package/dist/collection/components/six-timepicker/six-timepicker.types.js.map +1 -0
- package/dist/collection/components/six-tooltip/six-tooltip.js +256 -259
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -0
- package/dist/collection/functional-components/form-control/form-control.js +5 -10
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/testUtil/delay.js +1 -0
- package/dist/collection/testUtil/delay.js.map +1 -0
- package/dist/collection/utils/as-array.js +1 -0
- package/dist/collection/utils/as-array.js.map +1 -0
- package/dist/collection/utils/date-util.js +1 -0
- package/dist/collection/utils/date-util.js.map +1 -0
- package/dist/collection/utils/event-listeners.js +1 -0
- package/dist/collection/utils/event-listeners.js.map +1 -0
- package/dist/collection/utils/execution-control.js +1 -0
- package/dist/collection/utils/execution-control.js.map +1 -0
- package/dist/collection/utils/focus-visible.js +1 -0
- package/dist/collection/utils/focus-visible.js.map +1 -0
- package/dist/collection/utils/matchers.js +1 -0
- package/dist/collection/utils/matchers.js.map +1 -0
- package/dist/collection/utils/modal.js +1 -0
- package/dist/collection/utils/modal.js.map +1 -0
- package/dist/collection/utils/offset.js +1 -0
- package/dist/collection/utils/offset.js.map +1 -0
- package/dist/collection/utils/popover.js +1 -0
- package/dist/collection/utils/popover.js.map +1 -0
- package/dist/collection/utils/scroll.js +1 -0
- package/dist/collection/utils/scroll.js.map +1 -0
- package/dist/collection/utils/slot.js +1 -0
- package/dist/collection/utils/slot.js.map +1 -0
- package/dist/collection/utils/support.js +1 -0
- package/dist/collection/utils/support.js.map +1 -0
- package/dist/collection/utils/tabbable.js +1 -0
- package/dist/collection/utils/tabbable.js.map +1 -0
- package/dist/collection/utils/testing.js +1 -0
- package/dist/collection/utils/testing.js.map +1 -0
- package/dist/collection/utils/time.util.js +1 -0
- package/dist/collection/utils/time.util.js.map +1 -0
- package/dist/collection/utils/type-check.js +1 -0
- package/dist/collection/utils/type-check.js.map +1 -0
- package/dist/collection/utils/types.js +1 -0
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/collection/wrappers/set-attributes/set-attributes.js +28 -24
- package/dist/collection/wrappers/set-attributes/set-attributes.js.map +1 -0
- package/dist/components/event-listeners.js +43 -0
- package/dist/components/event-listeners.js.map +1 -0
- package/dist/components/execution-control.js +40 -0
- package/dist/components/execution-control.js.map +1 -0
- package/dist/components/focus-visible.js +45 -0
- package/dist/components/focus-visible.js.map +1 -0
- package/dist/components/form-control.js +32 -0
- package/dist/components/form-control.js.map +1 -0
- package/dist/components/index.d.ts +39 -0
- package/dist/components/index.js +122 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/modal.js +48 -0
- package/dist/components/modal.js.map +1 -0
- package/dist/{esm/popover-1c7a1139.js → components/popover.js} +5 -4
- package/dist/components/popover.js.map +1 -0
- package/dist/components/scroll.js +64 -0
- package/dist/components/scroll.js.map +1 -0
- package/dist/components/set-attributes.d.ts +11 -0
- package/dist/components/set-attributes.js +8 -0
- package/dist/components/set-attributes.js.map +1 -0
- package/dist/components/set-attributes2.js +69 -0
- package/dist/components/set-attributes2.js.map +1 -0
- package/dist/components/six-alert.d.ts +11 -0
- package/dist/components/six-alert.js +172 -0
- package/dist/components/six-alert.js.map +1 -0
- package/dist/components/six-avatar.d.ts +11 -0
- package/dist/components/six-avatar.js +63 -0
- package/dist/components/six-avatar.js.map +1 -0
- package/dist/components/six-badge.d.ts +11 -0
- package/dist/components/six-badge.js +54 -0
- package/dist/components/six-badge.js.map +1 -0
- package/dist/components/six-button.d.ts +11 -0
- package/dist/components/six-button.js +147 -0
- package/dist/components/six-button.js.map +1 -0
- package/dist/components/six-card.d.ts +11 -0
- package/dist/components/six-card.js +35 -0
- package/dist/components/six-card.js.map +1 -0
- package/dist/components/six-checkbox.d.ts +11 -0
- package/dist/components/six-checkbox.js +193 -0
- package/dist/components/six-checkbox.js.map +1 -0
- package/dist/components/six-datepicker.d.ts +11 -0
- package/dist/components/six-datepicker.js +1229 -0
- package/dist/components/six-datepicker.js.map +1 -0
- package/dist/components/six-details.d.ts +11 -0
- package/dist/components/six-details.js +8 -0
- package/dist/components/six-details.js.map +1 -0
- package/dist/components/six-details2.js +176 -0
- package/dist/components/six-details2.js.map +1 -0
- package/dist/components/six-dialog.d.ts +11 -0
- package/dist/components/six-dialog.js +190 -0
- package/dist/components/six-dialog.js.map +1 -0
- package/dist/components/six-drawer.d.ts +11 -0
- package/dist/components/six-drawer.js +209 -0
- package/dist/components/six-drawer.js.map +1 -0
- package/dist/components/six-dropdown.d.ts +11 -0
- package/dist/components/six-dropdown.js +8 -0
- package/dist/components/six-dropdown.js.map +1 -0
- package/dist/components/six-dropdown2.js +499 -0
- package/dist/components/six-dropdown2.js.map +1 -0
- package/dist/components/six-error-page.d.ts +11 -0
- package/dist/components/six-error-page.js +134 -0
- package/dist/components/six-error-page.js.map +1 -0
- package/dist/components/six-file-list-item.d.ts +11 -0
- package/dist/components/six-file-list-item.js +74 -0
- package/dist/components/six-file-list-item.js.map +1 -0
- package/dist/components/six-file-list.d.ts +11 -0
- package/dist/components/six-file-list.js +35 -0
- package/dist/components/six-file-list.js.map +1 -0
- package/dist/components/six-file-upload.d.ts +11 -0
- package/dist/components/six-file-upload.js +147 -0
- package/dist/components/six-file-upload.js.map +1 -0
- package/dist/components/six-footer.d.ts +11 -0
- package/dist/components/six-footer.js +35 -0
- package/dist/components/six-footer.js.map +1 -0
- package/dist/components/six-form.d.ts +11 -0
- package/dist/components/six-form.js +252 -0
- package/dist/components/six-form.js.map +1 -0
- package/dist/components/six-group-label.d.ts +11 -0
- package/dist/components/six-group-label.js +78 -0
- package/dist/components/six-group-label.js.map +1 -0
- package/dist/components/six-header.d.ts +11 -0
- package/dist/components/six-header.js +219 -0
- package/dist/components/six-header.js.map +1 -0
- package/dist/components/six-icon-button.d.ts +11 -0
- package/dist/components/six-icon-button.js +8 -0
- package/dist/components/six-icon-button.js.map +1 -0
- package/dist/components/six-icon-button2.js +70 -0
- package/dist/components/six-icon-button2.js.map +1 -0
- package/dist/components/six-icon.d.ts +11 -0
- package/dist/components/six-icon.js +8 -0
- package/dist/components/six-icon.js.map +1 -0
- package/dist/components/six-icon2.js +49 -0
- package/dist/components/six-icon2.js.map +1 -0
- package/dist/components/six-input.d.ts +11 -0
- package/dist/components/six-input.js +8 -0
- package/dist/components/six-input.js.map +1 -0
- package/dist/components/six-input2.js +303 -0
- package/dist/components/six-input2.js.map +1 -0
- package/dist/components/six-item-picker.d.ts +11 -0
- package/dist/components/six-item-picker.js +8 -0
- package/dist/components/six-item-picker.js.map +1 -0
- package/dist/components/six-item-picker2.js +404 -0
- package/dist/components/six-item-picker2.js.map +1 -0
- package/dist/components/six-language-switcher.d.ts +11 -0
- package/dist/components/six-language-switcher.js +82 -0
- package/dist/components/six-language-switcher.js.map +1 -0
- package/dist/components/six-layout-grid.d.ts +11 -0
- package/dist/components/six-layout-grid.js +49 -0
- package/dist/components/six-layout-grid.js.map +1 -0
- package/dist/components/six-main-container.d.ts +11 -0
- package/dist/components/six-main-container.js +39 -0
- package/dist/components/six-main-container.js.map +1 -0
- package/dist/components/six-menu-divider.d.ts +11 -0
- package/dist/components/six-menu-divider.js +35 -0
- package/dist/components/six-menu-divider.js.map +1 -0
- package/dist/components/six-menu-item.d.ts +11 -0
- package/dist/components/six-menu-item.js +8 -0
- package/dist/components/six-menu-item.js.map +1 -0
- package/dist/components/six-menu-item2.js +86 -0
- package/dist/components/six-menu-item2.js.map +1 -0
- package/dist/components/six-menu-label.d.ts +11 -0
- package/dist/components/six-menu-label.js +35 -0
- package/dist/components/six-menu-label.js.map +1 -0
- package/dist/components/six-menu.d.ts +11 -0
- package/dist/components/six-menu.js +8 -0
- package/dist/components/six-menu.js.map +1 -0
- package/dist/components/six-menu2.js +252 -0
- package/dist/components/six-menu2.js.map +1 -0
- package/dist/components/six-picto.d.ts +11 -0
- package/dist/components/six-picto.js +8 -0
- package/dist/components/six-picto.js.map +1 -0
- package/dist/{custom-elements/index.js → components/six-picto2.js} +21 -9740
- package/dist/components/six-picto2.js.map +1 -0
- package/dist/components/six-progress-bar.d.ts +11 -0
- package/dist/components/six-progress-bar.js +45 -0
- package/dist/components/six-progress-bar.js.map +1 -0
- package/dist/components/six-progress-ring.d.ts +11 -0
- package/dist/components/six-progress-ring.js +61 -0
- package/dist/components/six-progress-ring.js.map +1 -0
- package/dist/components/six-radio.d.ts +11 -0
- package/dist/components/six-radio.js +157 -0
- package/dist/components/six-radio.js.map +1 -0
- package/dist/components/six-range.d.ts +11 -0
- package/dist/components/six-range.js +236 -0
- package/dist/components/six-range.js.map +1 -0
- package/dist/components/six-root.d.ts +11 -0
- package/dist/components/six-root.js +82 -0
- package/dist/components/six-root.js.map +1 -0
- package/dist/components/six-search-field.d.ts +11 -0
- package/dist/components/six-search-field.js +85 -0
- package/dist/components/six-search-field.js.map +1 -0
- package/dist/components/six-select.d.ts +11 -0
- package/dist/components/six-select.js +526 -0
- package/dist/components/six-select.js.map +1 -0
- package/dist/components/six-sidebar-item-group.d.ts +11 -0
- package/dist/components/six-sidebar-item-group.js +88 -0
- package/dist/components/six-sidebar-item-group.js.map +1 -0
- package/dist/components/six-sidebar-item.d.ts +11 -0
- package/dist/components/six-sidebar-item.js +46 -0
- package/dist/components/six-sidebar-item.js.map +1 -0
- package/dist/components/six-sidebar.d.ts +11 -0
- package/dist/components/six-sidebar.js +205 -0
- package/dist/components/six-sidebar.js.map +1 -0
- package/dist/components/six-spinner.d.ts +11 -0
- package/dist/components/six-spinner.js +8 -0
- package/dist/components/six-spinner.js.map +1 -0
- package/dist/components/six-spinner2.js +41 -0
- package/dist/components/six-spinner2.js.map +1 -0
- package/dist/components/six-stage-indicator.d.ts +11 -0
- package/dist/components/six-stage-indicator.js +8 -0
- package/dist/components/six-stage-indicator.js.map +1 -0
- package/dist/components/six-stage-indicator2.js +41 -0
- package/dist/components/six-stage-indicator2.js.map +1 -0
- package/dist/components/six-switch.d.ts +11 -0
- package/dist/components/six-switch.js +139 -0
- package/dist/components/six-switch.js.map +1 -0
- package/dist/components/six-tab-group.d.ts +11 -0
- package/dist/components/six-tab-group.js +268 -0
- package/dist/components/six-tab-group.js.map +1 -0
- package/dist/components/six-tab-panel.d.ts +11 -0
- package/dist/components/six-tab-panel.js +45 -0
- package/dist/components/six-tab-panel.js.map +1 -0
- package/dist/components/six-tab.d.ts +11 -0
- package/dist/components/six-tab.js +84 -0
- package/dist/components/six-tab.js.map +1 -0
- package/dist/components/six-tag.d.ts +11 -0
- package/dist/components/six-tag.js +8 -0
- package/dist/components/six-tag.js.map +1 -0
- package/dist/components/six-tag2.js +77 -0
- package/dist/components/six-tag2.js.map +1 -0
- package/dist/components/six-textarea.d.ts +11 -0
- package/dist/components/six-textarea.js +269 -0
- package/dist/components/six-textarea.js.map +1 -0
- package/dist/components/six-tile.d.ts +11 -0
- package/dist/components/six-tile.js +142 -0
- package/dist/components/six-tile.js.map +1 -0
- package/dist/components/six-timepicker.d.ts +11 -0
- package/dist/components/six-timepicker.js +8 -0
- package/dist/components/six-timepicker.js.map +1 -0
- package/dist/components/six-timepicker2.js +559 -0
- package/dist/components/six-timepicker2.js.map +1 -0
- package/dist/components/six-tooltip.d.ts +11 -0
- package/dist/components/six-tooltip.js +8 -0
- package/dist/components/six-tooltip.js.map +1 -0
- package/dist/components/six-tooltip2.js +194 -0
- package/dist/components/six-tooltip2.js.map +1 -0
- package/dist/components/slot.js +47 -0
- package/dist/components/slot.js.map +1 -0
- package/dist/components.d.ts +27 -0
- package/dist/components.json +47 -499
- package/dist/esm/event-listeners-570a24ea.js +2 -0
- package/dist/esm/event-listeners-570a24ea.js.map +1 -0
- package/dist/esm/execution-control-1a60d709.js +2 -0
- package/dist/esm/execution-control-1a60d709.js.map +1 -0
- package/dist/esm/focus-visible-97933ea9.js +2 -0
- package/dist/esm/focus-visible-97933ea9.js.map +1 -0
- package/dist/esm/{form-control-24f446af.js → form-control-3b440ea1.js} +3 -1
- package/dist/esm/form-control-3b440ea1.js.map +1 -0
- package/dist/esm/{index-a2605a62.js → index-5c0f6628.js} +602 -279
- package/dist/esm/index-5c0f6628.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/modal-5ebdc320.js +2 -0
- package/dist/esm/modal-5ebdc320.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/popover-bd2c2fca.js +1897 -0
- package/dist/esm/popover-bd2c2fca.js.map +1 -0
- package/dist/esm/scroll-180b53fd.js +2 -0
- package/dist/esm/scroll-180b53fd.js.map +1 -0
- package/dist/esm/set-attributes_2.entry.js +5 -5
- package/dist/esm/set-attributes_2.entry.js.map +1 -0
- package/dist/esm/six-alert.entry.js +4 -9
- package/dist/esm/six-alert.entry.js.map +1 -0
- package/dist/esm/six-avatar.entry.js +4 -6
- package/dist/esm/six-avatar.entry.js.map +1 -0
- package/dist/esm/six-badge.entry.js +4 -5
- package/dist/esm/six-badge.entry.js.map +1 -0
- package/dist/esm/six-button.entry.js +9 -11
- package/dist/esm/six-button.entry.js.map +1 -0
- package/dist/esm/six-card.entry.js +4 -2
- package/dist/esm/six-card.entry.js.map +1 -0
- package/dist/esm/six-checkbox.entry.js +9 -13
- package/dist/esm/six-checkbox.entry.js.map +1 -0
- package/dist/esm/six-datepicker.entry.js +34 -87
- package/dist/esm/six-datepicker.entry.js.map +1 -0
- package/dist/esm/six-details.entry.js +6 -9
- package/dist/esm/six-details.entry.js.map +1 -0
- package/dist/esm/six-dialog.entry.js +4 -11
- package/dist/esm/six-dialog.entry.js.map +1 -0
- package/dist/esm/six-drawer.entry.js +4 -16
- package/dist/esm/six-drawer.entry.js.map +1 -0
- package/dist/esm/{six-dropdown_3.entry.js → six-dropdown_2.entry.js} +31 -129
- package/dist/esm/six-dropdown_2.entry.js.map +1 -0
- package/dist/esm/six-error-page.entry.js +8 -5
- package/dist/esm/six-error-page.entry.js.map +1 -0
- package/dist/esm/six-file-list-item.entry.js +10 -12
- package/dist/esm/six-file-list-item.entry.js.map +1 -0
- package/dist/esm/six-file-list.entry.js +4 -2
- package/dist/esm/six-file-list.entry.js.map +1 -0
- package/dist/esm/six-file-upload.entry.js +30 -17
- package/dist/esm/six-file-upload.entry.js.map +1 -0
- package/dist/esm/six-footer.entry.js +4 -2
- package/dist/esm/six-footer.entry.js.map +1 -0
- package/dist/esm/six-form.entry.js +4 -3
- package/dist/esm/six-form.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +6 -7
- package/dist/esm/six-group-label.entry.js.map +1 -0
- package/dist/esm/six-header.entry.js +11 -11
- package/dist/esm/six-header.entry.js.map +1 -0
- package/dist/esm/six-icon-button.entry.js +9 -6
- package/dist/esm/six-icon-button.entry.js.map +1 -0
- package/dist/esm/six-icon.entry.js +4 -4
- package/dist/esm/six-icon.entry.js.map +1 -0
- package/dist/esm/six-input.entry.js +21 -23
- package/dist/esm/six-input.entry.js.map +1 -0
- package/dist/esm/six-item-picker.entry.js +11 -26
- package/dist/esm/six-item-picker.entry.js.map +1 -0
- package/dist/esm/six-language-switcher.entry.js +6 -4
- package/dist/esm/six-language-switcher.entry.js.map +1 -0
- package/dist/esm/six-layout-grid.entry.js +5 -2
- package/dist/esm/six-layout-grid.entry.js.map +1 -0
- package/dist/esm/six-main-container.entry.js +4 -3
- package/dist/esm/six-main-container.entry.js.map +1 -0
- package/dist/esm/six-menu-divider.entry.js +4 -2
- package/dist/esm/six-menu-divider.entry.js.map +1 -0
- package/dist/esm/six-menu-item.entry.js +57 -0
- package/dist/esm/six-menu-item.entry.js.map +1 -0
- package/dist/esm/six-menu-label.entry.js +4 -2
- package/dist/esm/six-menu-label.entry.js.map +1 -0
- package/dist/esm/six-picto.entry.js +4 -5
- package/dist/esm/six-picto.entry.js.map +1 -0
- package/dist/esm/six-progress-bar.entry.js +4 -4
- package/dist/esm/six-progress-bar.entry.js.map +1 -0
- package/dist/esm/six-progress-ring.entry.js +5 -4
- package/dist/esm/six-progress-ring.entry.js.map +1 -0
- package/dist/esm/six-radio.entry.js +8 -10
- package/dist/esm/six-radio.entry.js.map +1 -0
- package/dist/esm/six-range.entry.js +9 -20
- package/dist/esm/six-range.entry.js.map +1 -0
- package/dist/esm/six-root.entry.js +9 -10
- package/dist/esm/six-root.entry.js.map +1 -0
- package/dist/esm/six-search-field.entry.js +9 -10
- package/dist/esm/six-search-field.entry.js.map +1 -0
- package/dist/esm/six-select.entry.js +31 -57
- package/dist/esm/six-select.entry.js.map +1 -0
- package/dist/esm/six-sidebar-item-group.entry.js +11 -10
- package/dist/esm/six-sidebar-item-group.entry.js.map +1 -0
- package/dist/esm/six-sidebar-item.entry.js +4 -5
- package/dist/esm/six-sidebar-item.entry.js.map +1 -0
- package/dist/esm/six-sidebar.entry.js +9 -11
- package/dist/esm/six-sidebar.entry.js.map +1 -0
- package/dist/esm/six-spinner.entry.js +4 -3
- package/dist/esm/six-spinner.entry.js.map +1 -0
- package/dist/esm/six-switch.entry.js +8 -8
- package/dist/esm/six-switch.entry.js.map +1 -0
- package/dist/esm/six-tab-group.entry.js +4 -4
- package/dist/esm/six-tab-group.entry.js.map +1 -0
- package/dist/esm/six-tab-panel.entry.js +4 -4
- package/dist/esm/six-tab-panel.entry.js.map +1 -0
- package/dist/esm/six-tab.entry.js +4 -6
- package/dist/esm/six-tab.entry.js.map +1 -0
- package/dist/esm/six-tag.entry.js +4 -6
- package/dist/esm/six-tag.entry.js.map +1 -0
- package/dist/esm/six-textarea.entry.js +17 -20
- package/dist/esm/six-textarea.entry.js.map +1 -0
- package/dist/esm/six-tile.entry.js +12 -15
- package/dist/esm/six-tile.entry.js.map +1 -0
- package/dist/esm/six-timepicker.entry.js +29 -78
- package/dist/esm/six-timepicker.entry.js.map +1 -0
- package/dist/esm/six-timepicker.types-e161a447.js +2 -0
- package/dist/esm/six-timepicker.types-e161a447.js.map +1 -0
- package/dist/esm/six-tooltip.entry.js +8 -18
- package/dist/esm/six-tooltip.entry.js.map +1 -0
- package/dist/esm/slot-6f3984c7.js +2 -0
- package/dist/esm/slot-6f3984c7.js.map +1 -0
- package/dist/esm/types-4b10b413.js +2 -0
- package/dist/esm/types-4b10b413.js.map +1 -0
- package/dist/esm/ui-library.js +9 -3
- package/dist/esm/ui-library.js.map +1 -0
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +8 -1
- package/dist/types/components/six-item-picker/six-item-picker.d.ts +2 -2
- package/dist/types/components/six-language-switcher/six-language-switcher.d.ts +1 -1
- package/dist/types/components/six-menu-item/six-menu-item.d.ts +3 -0
- package/dist/types/components/six-select/six-select.d.ts +2 -1
- package/dist/types/components/six-stage-indicator/six-stage-indicator.d.ts +1 -1
- package/dist/types/components.d.ts +1154 -238
- package/dist/types/stencil-public-runtime.d.ts +91 -19
- package/dist/types/utils/slot.d.ts +1 -1
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/ui-library/index.esm.js +2 -0
- package/dist/ui-library/index.esm.js.map +1 -0
- package/dist/ui-library/p-054e12cc.entry.js +2 -0
- package/dist/ui-library/p-054e12cc.entry.js.map +1 -0
- package/dist/ui-library/p-0786fa7c.js +2 -1
- package/dist/ui-library/p-0786fa7c.js.map +1 -0
- package/dist/ui-library/p-097cced4.entry.js +2 -0
- package/dist/ui-library/p-097cced4.entry.js.map +1 -0
- package/dist/ui-library/p-0d79b0c6.entry.js +2 -0
- package/dist/ui-library/p-0d79b0c6.entry.js.map +1 -0
- package/dist/ui-library/p-14f20bbb.entry.js +2 -0
- package/dist/ui-library/p-14f20bbb.entry.js.map +1 -0
- package/dist/ui-library/p-18e5f772.entry.js +2 -0
- package/dist/ui-library/p-18e5f772.entry.js.map +1 -0
- package/dist/ui-library/p-18ea0c56.js +2 -0
- package/dist/ui-library/p-18ea0c56.js.map +1 -0
- package/dist/ui-library/p-19364560.entry.js +2 -0
- package/dist/ui-library/p-19364560.entry.js.map +1 -0
- package/dist/ui-library/p-19b50b5a.entry.js +2 -0
- package/dist/ui-library/p-19b50b5a.entry.js.map +1 -0
- package/dist/ui-library/p-21859bca.entry.js +2 -0
- package/dist/ui-library/p-21859bca.entry.js.map +1 -0
- package/dist/ui-library/p-25a3bf57.js +2 -1
- package/dist/ui-library/p-25a3bf57.js.map +1 -0
- package/dist/ui-library/p-2e48c8d2.entry.js +2 -0
- package/dist/ui-library/p-2e48c8d2.entry.js.map +1 -0
- package/dist/ui-library/p-308261c4.entry.js +2 -0
- package/dist/ui-library/p-308261c4.entry.js.map +1 -0
- package/dist/ui-library/p-33f7e22b.entry.js +2 -0
- package/dist/ui-library/p-33f7e22b.entry.js.map +1 -0
- package/dist/ui-library/p-4ae91795.entry.js +2 -0
- package/dist/ui-library/p-4ae91795.entry.js.map +1 -0
- package/dist/ui-library/p-4f8394d7.js +2 -1
- package/dist/ui-library/p-4f8394d7.js.map +1 -0
- package/dist/ui-library/p-53a13db5.entry.js +2 -0
- package/dist/ui-library/p-53a13db5.entry.js.map +1 -0
- package/dist/ui-library/p-559c87f0.entry.js +2 -0
- package/dist/ui-library/p-559c87f0.entry.js.map +1 -0
- package/dist/ui-library/p-611e1978.entry.js +2 -0
- package/dist/ui-library/p-611e1978.entry.js.map +1 -0
- package/dist/ui-library/p-63703ba3.entry.js +2 -0
- package/dist/ui-library/p-63703ba3.entry.js.map +1 -0
- package/dist/ui-library/p-6403fd87.entry.js +2 -0
- package/dist/ui-library/p-6403fd87.entry.js.map +1 -0
- package/dist/ui-library/p-6433c0da.entry.js +2 -0
- package/dist/ui-library/p-6433c0da.entry.js.map +1 -0
- package/dist/ui-library/p-6d75f216.entry.js +2 -0
- package/dist/ui-library/p-6d75f216.entry.js.map +1 -0
- package/dist/ui-library/p-73597d13.entry.js +2 -0
- package/dist/ui-library/p-73597d13.entry.js.map +1 -0
- package/dist/ui-library/p-79eee01b.js +2 -0
- package/dist/ui-library/p-79eee01b.js.map +1 -0
- package/dist/ui-library/p-7e0cc4ae.entry.js +2 -0
- package/dist/ui-library/p-7e0cc4ae.entry.js.map +1 -0
- package/dist/ui-library/p-820c23f0.entry.js +2 -0
- package/dist/ui-library/p-820c23f0.entry.js.map +1 -0
- package/dist/ui-library/p-835c3ff7.entry.js +2 -0
- package/dist/ui-library/p-835c3ff7.entry.js.map +1 -0
- package/dist/ui-library/p-8a970a40.entry.js +2 -0
- package/dist/ui-library/p-8a970a40.entry.js.map +1 -0
- package/dist/ui-library/p-90824648.entry.js +2 -0
- package/dist/ui-library/p-90824648.entry.js.map +1 -0
- package/dist/ui-library/p-90dc6af4.entry.js +2 -0
- package/dist/ui-library/p-90dc6af4.entry.js.map +1 -0
- package/dist/ui-library/p-9328e5bc.entry.js +2 -0
- package/dist/ui-library/p-9328e5bc.entry.js.map +1 -0
- package/dist/ui-library/p-97323ad7.entry.js +2 -0
- package/dist/ui-library/p-97323ad7.entry.js.map +1 -0
- package/dist/ui-library/p-9a860acc.js +2 -1
- package/dist/ui-library/p-9a860acc.js.map +1 -0
- package/dist/ui-library/p-9d1d222f.entry.js +2 -0
- package/dist/ui-library/p-9d1d222f.entry.js.map +1 -0
- package/dist/ui-library/p-a1d4f6cf.entry.js +2 -0
- package/dist/ui-library/p-a1d4f6cf.entry.js.map +1 -0
- package/dist/ui-library/p-ac4f4d45.js +3 -0
- package/dist/ui-library/p-ac4f4d45.js.map +1 -0
- package/dist/ui-library/p-af793d04.entry.js +2 -0
- package/dist/ui-library/p-af793d04.entry.js.map +1 -0
- package/dist/ui-library/p-b0e5658f.entry.js +2 -0
- package/dist/ui-library/p-b0e5658f.entry.js.map +1 -0
- package/dist/ui-library/p-b1e66136.js +2 -1
- package/dist/ui-library/p-b1e66136.js.map +1 -0
- package/dist/ui-library/p-b4dfb7cf.js +2 -1
- package/dist/ui-library/p-b4dfb7cf.js.map +1 -0
- package/dist/ui-library/p-b997e43c.entry.js +2 -0
- package/dist/ui-library/p-b997e43c.entry.js.map +1 -0
- package/dist/ui-library/p-baa03951.entry.js +2 -0
- package/dist/ui-library/p-baa03951.entry.js.map +1 -0
- package/dist/ui-library/p-c0cb6436.entry.js +2 -0
- package/dist/ui-library/p-c0cb6436.entry.js.map +1 -0
- package/dist/ui-library/p-c30f9e0b.entry.js +2 -0
- package/dist/ui-library/p-c30f9e0b.entry.js.map +1 -0
- package/dist/ui-library/p-c349d1d4.entry.js +2 -0
- package/dist/ui-library/p-c349d1d4.entry.js.map +1 -0
- package/dist/ui-library/p-c53a63f9.entry.js +2 -0
- package/dist/ui-library/p-c53a63f9.entry.js.map +1 -0
- package/dist/ui-library/p-c640c2d8.entry.js +2 -0
- package/dist/ui-library/p-c640c2d8.entry.js.map +1 -0
- package/dist/ui-library/p-c94d0b07.entry.js +2 -0
- package/dist/ui-library/p-c94d0b07.entry.js.map +1 -0
- package/dist/ui-library/p-d12c6092.js +2 -1
- package/dist/ui-library/p-d12c6092.js.map +1 -0
- package/dist/ui-library/p-d5633a29.entry.js +2 -0
- package/dist/ui-library/p-d5633a29.entry.js.map +1 -0
- package/dist/ui-library/p-dd3c76f1.entry.js +2 -0
- package/dist/ui-library/p-dd3c76f1.entry.js.map +1 -0
- package/dist/ui-library/p-df655bc9.entry.js +2 -0
- package/dist/ui-library/p-df655bc9.entry.js.map +1 -0
- package/dist/ui-library/p-e19a6c95.entry.js +2 -0
- package/dist/ui-library/p-e19a6c95.entry.js.map +1 -0
- package/dist/ui-library/p-eb8f05a9.js +2 -1
- package/dist/ui-library/p-eb8f05a9.js.map +1 -0
- package/dist/ui-library/p-edc96efc.entry.js +2 -0
- package/dist/ui-library/p-edc96efc.entry.js.map +1 -0
- package/dist/ui-library/p-f18ba86f.entry.js +2 -0
- package/dist/ui-library/p-f18ba86f.entry.js.map +1 -0
- package/dist/ui-library/p-f4938771.entry.js +2 -0
- package/dist/ui-library/p-f4938771.entry.js.map +1 -0
- package/dist/ui-library/p-f70e2403.entry.js +2 -0
- package/dist/ui-library/p-f70e2403.entry.js.map +1 -0
- package/dist/ui-library/p-f9d345e0.entry.js +2 -0
- package/dist/ui-library/p-f9d345e0.entry.js.map +1 -0
- package/dist/ui-library/p-fed07a1f.entry.js +2 -0
- package/dist/ui-library/p-fed07a1f.entry.js.map +1 -0
- package/dist/ui-library/p-ff0257bf.entry.js +2 -0
- package/dist/ui-library/p-ff0257bf.entry.js.map +1 -0
- package/dist/ui-library/ui-library.css +2 -2
- package/dist/ui-library/ui-library.esm.js +2 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -0
- package/loader/index.d.ts +9 -0
- package/loader/package.json +1 -0
- package/package.json +8 -12
- package/readme.md +41 -39
- package/dist/cjs/six-table-cell_4.cjs.entry.js +0 -102
- package/dist/cjs/six-table.cjs.entry.js +0 -168
- package/dist/cjs/types-581e8ff0.js +0 -15
- package/dist/collection/components/six-table/six-table.css +0 -44
- package/dist/collection/components/six-table/six-table.js +0 -209
- package/dist/collection/components/six-table/test/helpers.js +0 -13
- package/dist/collection/components/six-table/types.js +0 -8
- package/dist/collection/components/six-table/util/filter-by.js +0 -34
- package/dist/collection/components/six-table/util/from-data.js +0 -33
- package/dist/collection/components/six-table/util/is.js +0 -3
- package/dist/collection/components/six-table/util/quick-filter-by.js +0 -13
- package/dist/collection/components/six-table/util/sort-by.js +0 -25
- package/dist/collection/components/six-table-cell/six-table-cell.css +0 -13
- package/dist/collection/components/six-table-cell/six-table-cell.js +0 -21
- package/dist/collection/components/six-table-header/six-table-header.css +0 -17
- package/dist/collection/components/six-table-header/six-table-header.js +0 -21
- package/dist/collection/components/six-table-header-cell/get-next-state.js +0 -7
- package/dist/collection/components/six-table-header-cell/icons.js +0 -12
- package/dist/collection/components/six-table-header-cell/six-table-header-cell.css +0 -37
- package/dist/collection/components/six-table-header-cell/six-table-header-cell.js +0 -174
- package/dist/collection/components/six-table-header-cell/types.js +0 -13
- package/dist/collection/components/six-table-header-cell/util/create-model.js +0 -6
- package/dist/collection/components/six-table-header-cell/util/get-next-state.js +0 -7
- package/dist/collection/components/six-table-row/six-table-row.css +0 -16
- package/dist/collection/components/six-table-row/six-table-row.js +0 -21
- package/dist/custom-elements/index.d.ts +0 -387
- package/dist/esm/six-table-cell_4.entry.js +0 -95
- package/dist/esm/six-table.entry.js +0 -164
- package/dist/esm/types-ed860f7c.js +0 -15
- package/dist/types/components/six-table/six-table.d.ts +0 -30
- package/dist/types/components/six-table/test/helpers.d.ts +0 -2
- package/dist/types/components/six-table/types.d.ts +0 -33
- package/dist/types/components/six-table/util/filter-by.d.ts +0 -2
- package/dist/types/components/six-table/util/from-data.d.ts +0 -8
- package/dist/types/components/six-table/util/is.d.ts +0 -3
- package/dist/types/components/six-table/util/quick-filter-by.d.ts +0 -2
- package/dist/types/components/six-table/util/sort-by.d.ts +0 -2
- package/dist/types/components/six-table-cell/six-table-cell.d.ts +0 -9
- package/dist/types/components/six-table-header/six-table-header.d.ts +0 -9
- package/dist/types/components/six-table-header-cell/get-next-state.d.ts +0 -2
- package/dist/types/components/six-table-header-cell/icons.d.ts +0 -3
- package/dist/types/components/six-table-header-cell/six-table-header-cell.d.ts +0 -32
- package/dist/types/components/six-table-header-cell/types.d.ts +0 -11
- package/dist/types/components/six-table-header-cell/util/create-model.d.ts +0 -4
- package/dist/types/components/six-table-header-cell/util/get-next-state.d.ts +0 -3
- package/dist/types/components/six-table-row/six-table-row.d.ts +0 -9
- package/dist/ui-library/p-007bc8e8.entry.js +0 -1
- package/dist/ui-library/p-044b784e.entry.js +0 -1
- package/dist/ui-library/p-0493c926.entry.js +0 -1
- package/dist/ui-library/p-07d1e830.js +0 -1
- package/dist/ui-library/p-09cb13fa.entry.js +0 -1
- package/dist/ui-library/p-0c596054.entry.js +0 -1
- package/dist/ui-library/p-1005d1a8.entry.js +0 -1
- package/dist/ui-library/p-19ff1079.entry.js +0 -1
- package/dist/ui-library/p-1b8dc7b7.entry.js +0 -1
- package/dist/ui-library/p-2053c61a.entry.js +0 -1
- package/dist/ui-library/p-281e8c2d.entry.js +0 -1
- package/dist/ui-library/p-2924f82f.entry.js +0 -1
- package/dist/ui-library/p-2d7ed407.entry.js +0 -1
- package/dist/ui-library/p-30ebc1e7.js +0 -1
- package/dist/ui-library/p-354704e5.entry.js +0 -1
- package/dist/ui-library/p-376b8f30.entry.js +0 -1
- package/dist/ui-library/p-3a7daff8.entry.js +0 -1
- package/dist/ui-library/p-3f577392.entry.js +0 -1
- package/dist/ui-library/p-4162dcdd.entry.js +0 -1
- package/dist/ui-library/p-4d3a4e93.entry.js +0 -1
- package/dist/ui-library/p-4ed023b8.entry.js +0 -1
- package/dist/ui-library/p-530ea6ec.entry.js +0 -1
- package/dist/ui-library/p-531ab886.entry.js +0 -1
- package/dist/ui-library/p-54c48654.entry.js +0 -1
- package/dist/ui-library/p-55c64cbc.entry.js +0 -1
- package/dist/ui-library/p-5f1c6a5f.js +0 -1
- package/dist/ui-library/p-6494e92d.entry.js +0 -1
- package/dist/ui-library/p-66601906.entry.js +0 -1
- package/dist/ui-library/p-675a8243.entry.js +0 -1
- package/dist/ui-library/p-6a4f0542.entry.js +0 -1
- package/dist/ui-library/p-6d622ed0.entry.js +0 -1
- package/dist/ui-library/p-75297ad7.js +0 -1
- package/dist/ui-library/p-76bfa55f.entry.js +0 -1
- package/dist/ui-library/p-7fe09462.entry.js +0 -1
- package/dist/ui-library/p-88e1e390.entry.js +0 -1
- package/dist/ui-library/p-8e8e922b.entry.js +0 -1
- package/dist/ui-library/p-90b26447.entry.js +0 -1
- package/dist/ui-library/p-93945629.entry.js +0 -1
- package/dist/ui-library/p-a98198bd.entry.js +0 -1
- package/dist/ui-library/p-aa37e45a.entry.js +0 -1
- package/dist/ui-library/p-b391f704.entry.js +0 -1
- package/dist/ui-library/p-b9377445.entry.js +0 -1
- package/dist/ui-library/p-bf110ea9.entry.js +0 -1
- package/dist/ui-library/p-c24292b3.entry.js +0 -1
- package/dist/ui-library/p-c4b22513.entry.js +0 -1
- package/dist/ui-library/p-c536792e.entry.js +0 -1
- package/dist/ui-library/p-cd79de73.entry.js +0 -1
- package/dist/ui-library/p-ce02c34f.entry.js +0 -1
- package/dist/ui-library/p-d28ac80a.entry.js +0 -1
- package/dist/ui-library/p-d724bbc9.entry.js +0 -1
- package/dist/ui-library/p-d837e5a8.entry.js +0 -1
- package/dist/ui-library/p-dd3cae68.entry.js +0 -1
- package/dist/ui-library/p-ea781e94.entry.js +0 -1
- package/dist/ui-library/p-eae232c3.entry.js +0 -1
- package/dist/ui-library/p-eb0956d2.entry.js +0 -1
- package/dist/ui-library/p-f00c1783.entry.js +0 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
const NAMESPACE = 'ui-library';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
5
|
+
* Simon Friis Vindum (@paldepind)
|
|
6
|
+
* Licensed under the MIT License
|
|
7
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
8
|
+
*
|
|
9
|
+
* Modified for Stencil's renderer and slot projection
|
|
10
|
+
*/
|
|
3
11
|
let scopeId;
|
|
4
12
|
let contentRef;
|
|
5
13
|
let hostTagName;
|
|
@@ -8,62 +16,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
8
16
|
let checkSlotRelocate = false;
|
|
9
17
|
let isSvgMode = false;
|
|
10
18
|
let queuePending = false;
|
|
11
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
12
|
-
const doc = win.document || { head: {} };
|
|
13
|
-
const plt = {
|
|
14
|
-
$flags$: 0,
|
|
15
|
-
$resourcesUrl$: '',
|
|
16
|
-
jmp: (h) => h(),
|
|
17
|
-
raf: (h) => requestAnimationFrame(h),
|
|
18
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
19
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
20
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
21
|
-
};
|
|
22
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
23
|
-
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
24
|
-
try {
|
|
25
|
-
new CSSStyleSheet();
|
|
26
|
-
return typeof new CSSStyleSheet().replace === 'function';
|
|
27
|
-
}
|
|
28
|
-
catch (e) { }
|
|
29
|
-
return false;
|
|
30
|
-
})()
|
|
31
|
-
;
|
|
32
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
33
|
-
if (listeners) {
|
|
34
|
-
listeners.map(([flags, name, method]) => {
|
|
35
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
36
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
37
|
-
const opts = hostListenerOpts(flags);
|
|
38
|
-
plt.ael(target, name, handler, opts);
|
|
39
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
44
|
-
try {
|
|
45
|
-
{
|
|
46
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
47
|
-
// instance is ready, let's call it's member method for this event
|
|
48
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
consoleError(e);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
60
|
-
if (flags & 8 /* TargetWindow */)
|
|
61
|
-
return win;
|
|
62
|
-
return elm;
|
|
63
|
-
};
|
|
64
|
-
// prettier-ignore
|
|
65
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
66
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
67
19
|
const createTime = (fnName, tagName = '') => {
|
|
68
20
|
{
|
|
69
21
|
return () => {
|
|
@@ -78,74 +30,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
78
30
|
};
|
|
79
31
|
}
|
|
80
32
|
};
|
|
81
|
-
const
|
|
82
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
83
|
-
let style = styles.get(scopeId);
|
|
84
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
85
|
-
style = (style || new CSSStyleSheet());
|
|
86
|
-
style.replace(cssText);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
style = cssText;
|
|
90
|
-
}
|
|
91
|
-
styles.set(scopeId, style);
|
|
92
|
-
};
|
|
93
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
94
|
-
let scopeId = getScopeId(cmpMeta);
|
|
95
|
-
let style = styles.get(scopeId);
|
|
96
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
97
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
98
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
99
|
-
if (style) {
|
|
100
|
-
if (typeof style === 'string') {
|
|
101
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
102
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
103
|
-
let styleElm;
|
|
104
|
-
if (!appliedStyles) {
|
|
105
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
106
|
-
}
|
|
107
|
-
if (!appliedStyles.has(scopeId)) {
|
|
108
|
-
{
|
|
109
|
-
{
|
|
110
|
-
styleElm = doc.createElement('style');
|
|
111
|
-
styleElm.innerHTML = style;
|
|
112
|
-
}
|
|
113
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
114
|
-
}
|
|
115
|
-
if (appliedStyles) {
|
|
116
|
-
appliedStyles.add(scopeId);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
121
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return scopeId;
|
|
125
|
-
};
|
|
126
|
-
const attachStyles = (hostRef) => {
|
|
127
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
128
|
-
const elm = hostRef.$hostElement$;
|
|
129
|
-
const flags = cmpMeta.$flags$;
|
|
130
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
131
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
132
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
133
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
134
|
-
// or this browser doesn't support native shadow dom
|
|
135
|
-
// and this host element was NOT created with SSR
|
|
136
|
-
// let's pick out the inner content for slot projection
|
|
137
|
-
// create a node to represent where the original
|
|
138
|
-
// content was first placed, which is useful later on
|
|
139
|
-
// DOM WRITE!!
|
|
140
|
-
elm['s-sc'] = scopeId;
|
|
141
|
-
elm.classList.add(scopeId + '-h');
|
|
142
|
-
if (flags & 2 /* scopedCssEncapsulation */) {
|
|
143
|
-
elm.classList.add(scopeId + '-s');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
endAttachStyles();
|
|
147
|
-
};
|
|
148
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
33
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
149
34
|
/**
|
|
150
35
|
* Default style mode id
|
|
151
36
|
*/
|
|
@@ -160,11 +45,30 @@ const EMPTY_OBJ = {};
|
|
|
160
45
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
161
46
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
162
47
|
const isDef = (v) => v != null;
|
|
48
|
+
/**
|
|
49
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
50
|
+
* function.
|
|
51
|
+
*
|
|
52
|
+
* @param o the value to check
|
|
53
|
+
* @returns whether it's a complex type or not
|
|
54
|
+
*/
|
|
163
55
|
const isComplexType = (o) => {
|
|
164
56
|
// https://jsperf.com/typeof-fn-object/5
|
|
165
57
|
o = typeof o;
|
|
166
58
|
return o === 'object' || o === 'function';
|
|
167
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
62
|
+
* out of a DOM's head.
|
|
63
|
+
*
|
|
64
|
+
* @param doc The DOM containing the `head` to query against
|
|
65
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
66
|
+
* exists or the tag has no content.
|
|
67
|
+
*/
|
|
68
|
+
function queryNonceMetaTagContent(doc) {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
71
|
+
}
|
|
168
72
|
/**
|
|
169
73
|
* Production h() function based on Preact by
|
|
170
74
|
* Jason Miller (@developit)
|
|
@@ -173,7 +77,6 @@ const isComplexType = (o) => {
|
|
|
173
77
|
*
|
|
174
78
|
* Modified for Stencil's compiler and vdom
|
|
175
79
|
*/
|
|
176
|
-
// const stack: any[] = [];
|
|
177
80
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
178
81
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
179
82
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -182,7 +85,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
182
85
|
let slotName = null;
|
|
183
86
|
let simple = false;
|
|
184
87
|
let lastSimple = false;
|
|
185
|
-
|
|
88
|
+
const vNodeChildren = [];
|
|
186
89
|
const walk = (c) => {
|
|
187
90
|
for (let i = 0; i < c.length; i++) {
|
|
188
91
|
child = c[i];
|
|
@@ -243,6 +146,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
243
146
|
}
|
|
244
147
|
return vnode;
|
|
245
148
|
};
|
|
149
|
+
/**
|
|
150
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
151
|
+
* possible text content.
|
|
152
|
+
*
|
|
153
|
+
* @param tag the tag for this element
|
|
154
|
+
* @param text possible text content for the node
|
|
155
|
+
* @returns a newly-minted virtual DOM node
|
|
156
|
+
*/
|
|
246
157
|
const newVNode = (tag, text) => {
|
|
247
158
|
const vnode = {
|
|
248
159
|
$flags$: 0,
|
|
@@ -263,11 +174,31 @@ const newVNode = (tag, text) => {
|
|
|
263
174
|
return vnode;
|
|
264
175
|
};
|
|
265
176
|
const Host = {};
|
|
177
|
+
/**
|
|
178
|
+
* Check whether a given node is a Host node or not
|
|
179
|
+
*
|
|
180
|
+
* @param node the virtual DOM node to check
|
|
181
|
+
* @returns whether it's a Host node or not
|
|
182
|
+
*/
|
|
266
183
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
184
|
+
/**
|
|
185
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
186
|
+
*
|
|
187
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
188
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
189
|
+
* interface.
|
|
190
|
+
*/
|
|
267
191
|
const vdomFnUtils = {
|
|
268
192
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
269
193
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
270
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
197
|
+
* friendlier public interface (hence, 'convertToPublic').
|
|
198
|
+
*
|
|
199
|
+
* @param node the virtual DOM node to convert
|
|
200
|
+
* @returns a converted child node
|
|
201
|
+
*/
|
|
271
202
|
const convertToPublic = (node) => ({
|
|
272
203
|
vattrs: node.$attrs$,
|
|
273
204
|
vchildren: node.$children$,
|
|
@@ -276,6 +207,15 @@ const convertToPublic = (node) => ({
|
|
|
276
207
|
vtag: node.$tag$,
|
|
277
208
|
vtext: node.$text$,
|
|
278
209
|
});
|
|
210
|
+
/**
|
|
211
|
+
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
212
|
+
* order to use the resulting object in the virtual DOM. The initial object was
|
|
213
|
+
* likely created as part of presenting a public API, so converting it back
|
|
214
|
+
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
215
|
+
*
|
|
216
|
+
* @param node the child node to convert
|
|
217
|
+
* @returns a converted virtual DOM node
|
|
218
|
+
*/
|
|
279
219
|
const convertToPrivate = (node) => {
|
|
280
220
|
if (typeof node.vtag === 'function') {
|
|
281
221
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -294,6 +234,160 @@ const convertToPrivate = (node) => {
|
|
|
294
234
|
vnode.$name$ = node.vname;
|
|
295
235
|
return vnode;
|
|
296
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Parse a new property value for a given property type.
|
|
239
|
+
*
|
|
240
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
241
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
242
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
243
|
+
* 2. the type stored from `propType`.
|
|
244
|
+
*
|
|
245
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
246
|
+
*
|
|
247
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
248
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
249
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
250
|
+
* ```tsx
|
|
251
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* HTML prop values on the other hand, will always a string
|
|
255
|
+
*
|
|
256
|
+
* @param propValue the new value to coerce to some type
|
|
257
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
258
|
+
* @returns the parsed/coerced value
|
|
259
|
+
*/
|
|
260
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
261
|
+
// ensure this value is of the correct prop type
|
|
262
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
263
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
264
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
265
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
266
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
267
|
+
}
|
|
268
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
269
|
+
// force it to be a number
|
|
270
|
+
return parseFloat(propValue);
|
|
271
|
+
}
|
|
272
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
273
|
+
// could have been passed as a number or boolean
|
|
274
|
+
// but we still want it as a string
|
|
275
|
+
return String(propValue);
|
|
276
|
+
}
|
|
277
|
+
// redundant return here for better minification
|
|
278
|
+
return propValue;
|
|
279
|
+
}
|
|
280
|
+
// not sure exactly what type we want
|
|
281
|
+
// so no need to change to a different type
|
|
282
|
+
return propValue;
|
|
283
|
+
};
|
|
284
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
285
|
+
const createEvent = (ref, name, flags) => {
|
|
286
|
+
const elm = getElement(ref);
|
|
287
|
+
return {
|
|
288
|
+
emit: (detail) => {
|
|
289
|
+
return emitEvent(elm, name, {
|
|
290
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
291
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
292
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
293
|
+
detail,
|
|
294
|
+
});
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
300
|
+
* @param elm the target of the Event
|
|
301
|
+
* @param name the name to give the custom Event
|
|
302
|
+
* @param opts options for configuring a custom Event
|
|
303
|
+
* @returns the custom Event
|
|
304
|
+
*/
|
|
305
|
+
const emitEvent = (elm, name, opts) => {
|
|
306
|
+
const ev = plt.ce(name, opts);
|
|
307
|
+
elm.dispatchEvent(ev);
|
|
308
|
+
return ev;
|
|
309
|
+
};
|
|
310
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
311
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
312
|
+
let style = styles.get(scopeId);
|
|
313
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
314
|
+
style = (style || new CSSStyleSheet());
|
|
315
|
+
if (typeof style === 'string') {
|
|
316
|
+
style = cssText;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
style.replaceSync(cssText);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
style = cssText;
|
|
324
|
+
}
|
|
325
|
+
styles.set(scopeId, style);
|
|
326
|
+
};
|
|
327
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
328
|
+
var _a;
|
|
329
|
+
let scopeId = getScopeId(cmpMeta);
|
|
330
|
+
const style = styles.get(scopeId);
|
|
331
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
332
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
333
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
334
|
+
if (style) {
|
|
335
|
+
if (typeof style === 'string') {
|
|
336
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
337
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
338
|
+
let styleElm;
|
|
339
|
+
if (!appliedStyles) {
|
|
340
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
341
|
+
}
|
|
342
|
+
if (!appliedStyles.has(scopeId)) {
|
|
343
|
+
{
|
|
344
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
345
|
+
{
|
|
346
|
+
styleElm = doc.createElement('style');
|
|
347
|
+
styleElm.innerHTML = style;
|
|
348
|
+
}
|
|
349
|
+
// Apply CSP nonce to the style tag if it exists
|
|
350
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
351
|
+
if (nonce != null) {
|
|
352
|
+
styleElm.setAttribute('nonce', nonce);
|
|
353
|
+
}
|
|
354
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
355
|
+
}
|
|
356
|
+
if (appliedStyles) {
|
|
357
|
+
appliedStyles.add(scopeId);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
362
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return scopeId;
|
|
366
|
+
};
|
|
367
|
+
const attachStyles = (hostRef) => {
|
|
368
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
369
|
+
const elm = hostRef.$hostElement$;
|
|
370
|
+
const flags = cmpMeta.$flags$;
|
|
371
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
372
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
373
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
374
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
375
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
376
|
+
// or this browser doesn't support native shadow dom
|
|
377
|
+
// and this host element was NOT created with SSR
|
|
378
|
+
// let's pick out the inner content for slot projection
|
|
379
|
+
// create a node to represent where the original
|
|
380
|
+
// content was first placed, which is useful later on
|
|
381
|
+
// DOM WRITE!!
|
|
382
|
+
elm['s-sc'] = scopeId;
|
|
383
|
+
elm.classList.add(scopeId + '-h');
|
|
384
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
385
|
+
elm.classList.add(scopeId + '-s');
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
endAttachStyles();
|
|
389
|
+
};
|
|
390
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
297
391
|
/**
|
|
298
392
|
* Production setAccessor() function based on Preact by
|
|
299
393
|
* Jason Miller (@developit)
|
|
@@ -391,7 +485,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
391
485
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
392
486
|
try {
|
|
393
487
|
if (!elm.tagName.includes('-')) {
|
|
394
|
-
|
|
488
|
+
const n = newValue == null ? '' : newValue;
|
|
395
489
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
396
490
|
if (memberName === 'list') {
|
|
397
491
|
isProp = false;
|
|
@@ -413,7 +507,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
413
507
|
}
|
|
414
508
|
}
|
|
415
509
|
}
|
|
416
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
510
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
417
511
|
newValue = newValue === true ? '' : newValue;
|
|
418
512
|
{
|
|
419
513
|
elm.setAttribute(memberName, newValue);
|
|
@@ -428,7 +522,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
428
522
|
// if the element passed in is a shadow root, which is a document fragment
|
|
429
523
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
430
524
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
431
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
525
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
432
526
|
? newVnode.$elm$.host
|
|
433
527
|
: newVnode.$elm$;
|
|
434
528
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -446,9 +540,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
446
540
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
447
541
|
}
|
|
448
542
|
};
|
|
543
|
+
/**
|
|
544
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
545
|
+
*
|
|
546
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
547
|
+
* @param newParentVNode the parent VNode from the current render
|
|
548
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
549
|
+
* children, for which we will create a new DOM node
|
|
550
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
551
|
+
* @returns the newly created node
|
|
552
|
+
*/
|
|
449
553
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
450
554
|
// tslint:disable-next-line: prefer-const
|
|
451
|
-
|
|
555
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
452
556
|
let i = 0;
|
|
453
557
|
let elm;
|
|
454
558
|
let childNode;
|
|
@@ -463,16 +567,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
463
567
|
}
|
|
464
568
|
newVNode.$flags$ |= newVNode.$children$
|
|
465
569
|
? // slot element has fallback content
|
|
466
|
-
2 /* isSlotFallback */
|
|
570
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
467
571
|
: // slot element does not have fallback content
|
|
468
|
-
1 /* isSlotReference */;
|
|
572
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
469
573
|
}
|
|
470
574
|
}
|
|
471
575
|
if (newVNode.$text$ !== null) {
|
|
472
576
|
// create text node
|
|
473
577
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
474
578
|
}
|
|
475
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
579
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
476
580
|
// create a slot reference node
|
|
477
581
|
elm = newVNode.$elm$ =
|
|
478
582
|
doc.createTextNode('');
|
|
@@ -482,7 +586,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
482
586
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
483
587
|
}
|
|
484
588
|
// create element
|
|
485
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
589
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
486
590
|
? 'slot-fb'
|
|
487
591
|
: newVNode.$tag$)
|
|
488
592
|
);
|
|
@@ -522,7 +626,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
522
626
|
}
|
|
523
627
|
{
|
|
524
628
|
elm['s-hn'] = hostTagName;
|
|
525
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
629
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
526
630
|
// remember the content reference comment
|
|
527
631
|
elm['s-sr'] = true;
|
|
528
632
|
// remember the content reference comment
|
|
@@ -541,7 +645,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
541
645
|
return elm;
|
|
542
646
|
};
|
|
543
647
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
544
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
648
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
545
649
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
546
650
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
547
651
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -562,8 +666,23 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
562
666
|
putBackInOriginalLocation(childNode, recursive);
|
|
563
667
|
}
|
|
564
668
|
}
|
|
565
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
669
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
566
670
|
};
|
|
671
|
+
/**
|
|
672
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
673
|
+
* add them to the DOM in the appropriate place.
|
|
674
|
+
*
|
|
675
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
676
|
+
* DOM nodes
|
|
677
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
678
|
+
* inserted before (optional)
|
|
679
|
+
* @param parentVNode the parent virtual DOM node
|
|
680
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
681
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
682
|
+
* creating DOM nodes (inclusive)
|
|
683
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
684
|
+
* creating DOM nodes (inclusive)
|
|
685
|
+
*/
|
|
567
686
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
568
687
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
569
688
|
let childNode;
|
|
@@ -580,6 +699,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
580
699
|
}
|
|
581
700
|
}
|
|
582
701
|
};
|
|
702
|
+
/**
|
|
703
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
704
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
705
|
+
* should no longer be shown.
|
|
706
|
+
*
|
|
707
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
708
|
+
*
|
|
709
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
710
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
711
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
712
|
+
* @param vnode a VNode
|
|
713
|
+
* @param elm an element
|
|
714
|
+
*/
|
|
583
715
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
584
716
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
585
717
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -604,6 +736,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
604
736
|
}
|
|
605
737
|
}
|
|
606
738
|
};
|
|
739
|
+
/**
|
|
740
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
741
|
+
* traversing the two collections of children, identifying nodes that are
|
|
742
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
743
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
744
|
+
*
|
|
745
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
746
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
747
|
+
* 'windows' by storing start and end indices and references to the
|
|
748
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
749
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
750
|
+
* no children left to update by doing the following:
|
|
751
|
+
*
|
|
752
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
753
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
754
|
+
* only with a window bounded by the highlighted elements:
|
|
755
|
+
*
|
|
756
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
757
|
+
* ^^^^^^ ^^^^^^
|
|
758
|
+
*
|
|
759
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
760
|
+
* across the windows. This will basically detect elements which haven't
|
|
761
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
762
|
+
* VNode elements (represented as HTML):
|
|
763
|
+
*
|
|
764
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
765
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
766
|
+
*
|
|
767
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
768
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
769
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
770
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
771
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
772
|
+
*
|
|
773
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
774
|
+
* window corresponds to the element at the end of the other window. This is
|
|
775
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
776
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
777
|
+
* children nodes themselves have not changed but merely moved in the
|
|
778
|
+
* following example:
|
|
779
|
+
*
|
|
780
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
781
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
782
|
+
*
|
|
783
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
784
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
785
|
+
* DOM.
|
|
786
|
+
*
|
|
787
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
788
|
+
* nodes in the old children which have the same key as the first element in
|
|
789
|
+
* our window on the new children. If we find such a node we handle calling
|
|
790
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
791
|
+
* what we find.
|
|
792
|
+
*
|
|
793
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
794
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
795
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
796
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
797
|
+
* children has collapsed we still have more nodes on the new children that
|
|
798
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
799
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
800
|
+
* sure the corresponding DOM nodes are removed.
|
|
801
|
+
*
|
|
802
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
803
|
+
* @param oldCh the old children of the parent node
|
|
804
|
+
* @param newVNode the new VNode which will replace the parent
|
|
805
|
+
* @param newCh the new children of the parent node
|
|
806
|
+
*/
|
|
607
807
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
608
808
|
let oldStartIdx = 0;
|
|
609
809
|
let newStartIdx = 0;
|
|
@@ -619,7 +819,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
619
819
|
let elmToMove;
|
|
620
820
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
621
821
|
if (oldStartVnode == null) {
|
|
622
|
-
//
|
|
822
|
+
// VNode might have been moved left
|
|
623
823
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
624
824
|
}
|
|
625
825
|
else if (oldEndVnode == null) {
|
|
@@ -632,37 +832,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
632
832
|
newEndVnode = newCh[--newEndIdx];
|
|
633
833
|
}
|
|
634
834
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
835
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
836
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
837
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
838
|
+
// since things are matched up in order.
|
|
635
839
|
patch(oldStartVnode, newStartVnode);
|
|
636
840
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
637
841
|
newStartVnode = newCh[++newStartIdx];
|
|
638
842
|
}
|
|
639
843
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
844
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
845
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
846
|
+
// need to move any DOM Nodes.
|
|
640
847
|
patch(oldEndVnode, newEndVnode);
|
|
641
848
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
642
849
|
newEndVnode = newCh[--newEndIdx];
|
|
643
850
|
}
|
|
644
851
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
645
|
-
// Vnode moved right
|
|
852
|
+
// case: "Vnode moved right"
|
|
853
|
+
//
|
|
854
|
+
// We've found that the last node in our window on the new children is
|
|
855
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
856
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
857
|
+
// nodes:
|
|
858
|
+
//
|
|
859
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
860
|
+
// ^^^^^^^^^^^
|
|
861
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
862
|
+
// ^^^^^^^^^^^^^
|
|
863
|
+
//
|
|
864
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
865
|
+
// and move the DOM element for `oldStartVnode`.
|
|
646
866
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
647
867
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
648
868
|
}
|
|
649
869
|
patch(oldStartVnode, newEndVnode);
|
|
870
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
871
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
872
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
873
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
874
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
875
|
+
//
|
|
876
|
+
// <old-start-node />
|
|
877
|
+
// <some-intervening-node />
|
|
878
|
+
// <old-end-node />
|
|
879
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
880
|
+
// <next-sibling />
|
|
881
|
+
//
|
|
882
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
883
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
884
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
885
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
886
|
+
// append it to the children of the parent element.
|
|
650
887
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
651
888
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
652
889
|
newEndVnode = newCh[--newEndIdx];
|
|
653
890
|
}
|
|
654
891
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
655
|
-
// Vnode moved left
|
|
892
|
+
// case: "Vnode moved left"
|
|
893
|
+
//
|
|
894
|
+
// We've found that the first node in our window on the new children is
|
|
895
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
896
|
+
// Visually, this is the layout of these two nodes:
|
|
897
|
+
//
|
|
898
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
899
|
+
// ^^^^^^^^^^^^^
|
|
900
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
901
|
+
// ^^^^^^^^^^^
|
|
902
|
+
//
|
|
903
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
904
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
905
|
+
// children etc) but we also need to move the DOM node to which
|
|
906
|
+
// `oldEndVnode` corresponds.
|
|
656
907
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
657
908
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
658
909
|
}
|
|
659
910
|
patch(oldEndVnode, newStartVnode);
|
|
911
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
912
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
913
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
914
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
915
|
+
// future.
|
|
660
916
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
661
917
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
662
918
|
newStartVnode = newCh[++newStartIdx];
|
|
663
919
|
}
|
|
664
920
|
else {
|
|
665
|
-
//
|
|
921
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
922
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
923
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
924
|
+
// component.
|
|
925
|
+
//
|
|
926
|
+
// First we check to see if there are any nodes in the array of old
|
|
927
|
+
// children which have the same key as the first node in the new
|
|
928
|
+
// children.
|
|
666
929
|
idxInOld = -1;
|
|
667
930
|
{
|
|
668
931
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -673,23 +936,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
673
936
|
}
|
|
674
937
|
}
|
|
675
938
|
if (idxInOld >= 0) {
|
|
939
|
+
// We found a node in the old children which matches up with the first
|
|
940
|
+
// node in the new children! So let's deal with that
|
|
676
941
|
elmToMove = oldCh[idxInOld];
|
|
677
942
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
943
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
678
944
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
679
945
|
}
|
|
680
946
|
else {
|
|
681
947
|
patch(elmToMove, newStartVnode);
|
|
948
|
+
// invalidate the matching old node so that we won't try to update it
|
|
949
|
+
// again later on
|
|
682
950
|
oldCh[idxInOld] = undefined;
|
|
683
951
|
node = elmToMove.$elm$;
|
|
684
952
|
}
|
|
685
953
|
newStartVnode = newCh[++newStartIdx];
|
|
686
954
|
}
|
|
687
955
|
else {
|
|
688
|
-
//
|
|
956
|
+
// We either didn't find an element in the old children that matches
|
|
957
|
+
// the key of the first new child OR the build is not using `key`
|
|
958
|
+
// attributes at all. In either case we need to create a new element
|
|
959
|
+
// for the new node.
|
|
689
960
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
690
961
|
newStartVnode = newCh[++newStartIdx];
|
|
691
962
|
}
|
|
692
963
|
if (node) {
|
|
964
|
+
// if we created a new node then handle inserting it to the DOM
|
|
693
965
|
{
|
|
694
966
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
695
967
|
}
|
|
@@ -697,21 +969,44 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
697
969
|
}
|
|
698
970
|
}
|
|
699
971
|
if (oldStartIdx > oldEndIdx) {
|
|
972
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
700
973
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
701
974
|
}
|
|
702
975
|
else if (newStartIdx > newEndIdx) {
|
|
976
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
977
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
978
|
+
// relevant DOM nodes)
|
|
703
979
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
704
980
|
}
|
|
705
981
|
};
|
|
706
|
-
|
|
982
|
+
/**
|
|
983
|
+
* Compare two VNodes to determine if they are the same
|
|
984
|
+
*
|
|
985
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
986
|
+
* information set on the two VNodes and can be misleading under certain
|
|
987
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
988
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
989
|
+
* checking that they have the same tag.
|
|
990
|
+
*
|
|
991
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
992
|
+
* changing order within a `children` array or something along those lines then
|
|
993
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
994
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
995
|
+
*
|
|
996
|
+
* @param leftVNode the first VNode to check
|
|
997
|
+
* @param rightVNode the second VNode to check
|
|
998
|
+
* @returns whether they're equal or not
|
|
999
|
+
*/
|
|
1000
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
707
1001
|
// compare if two vnode to see if they're "technically" the same
|
|
708
1002
|
// need to have the same element tag, and same key to be the same
|
|
709
|
-
if (
|
|
710
|
-
if (
|
|
711
|
-
return
|
|
1003
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1004
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
1005
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
712
1006
|
}
|
|
1007
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
713
1008
|
{
|
|
714
|
-
return
|
|
1009
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
715
1010
|
}
|
|
716
1011
|
}
|
|
717
1012
|
return false;
|
|
@@ -724,6 +1019,14 @@ const referenceNode = (node) => {
|
|
|
724
1019
|
return (node && node['s-ol']) || node;
|
|
725
1020
|
};
|
|
726
1021
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
1022
|
+
/**
|
|
1023
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1024
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1025
|
+
* children of the two nodes (if any).
|
|
1026
|
+
*
|
|
1027
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1028
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
1029
|
+
*/
|
|
727
1030
|
const patch = (oldVNode, newVNode) => {
|
|
728
1031
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
729
1032
|
const oldChildren = oldVNode.$children$;
|
|
@@ -737,7 +1040,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
737
1040
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
738
1041
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
739
1042
|
}
|
|
740
|
-
// element node
|
|
741
1043
|
{
|
|
742
1044
|
if (tag === 'slot')
|
|
743
1045
|
;
|
|
@@ -750,6 +1052,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
750
1052
|
}
|
|
751
1053
|
if (oldChildren !== null && newChildren !== null) {
|
|
752
1054
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1055
|
+
// so we need to call `updateChildren` to reconcile them
|
|
753
1056
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
754
1057
|
}
|
|
755
1058
|
else if (newChildren !== null) {
|
|
@@ -781,7 +1084,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
781
1084
|
};
|
|
782
1085
|
const updateFallbackSlotVisibility = (elm) => {
|
|
783
1086
|
// tslint:disable-next-line: prefer-const
|
|
784
|
-
|
|
1087
|
+
const childNodes = elm.childNodes;
|
|
785
1088
|
let childNode;
|
|
786
1089
|
let i;
|
|
787
1090
|
let ilen;
|
|
@@ -790,7 +1093,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
790
1093
|
let nodeType;
|
|
791
1094
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
792
1095
|
childNode = childNodes[i];
|
|
793
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1096
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
794
1097
|
if (childNode['s-sr']) {
|
|
795
1098
|
// this is a slot fallback node
|
|
796
1099
|
// get the slot name for this slot reference node
|
|
@@ -802,7 +1105,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
802
1105
|
nodeType = childNodes[j].nodeType;
|
|
803
1106
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
804
1107
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
805
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1108
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
806
1109
|
childNode.hidden = true;
|
|
807
1110
|
break;
|
|
808
1111
|
}
|
|
@@ -811,8 +1114,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
811
1114
|
// this is a default fallback slot node
|
|
812
1115
|
// any element or text node (with content)
|
|
813
1116
|
// should hide the default fallback slot node
|
|
814
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
815
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1117
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1118
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
816
1119
|
childNode.hidden = true;
|
|
817
1120
|
break;
|
|
818
1121
|
}
|
|
@@ -834,8 +1137,8 @@ const relocateSlotContent = (elm) => {
|
|
|
834
1137
|
let relocateNodeData;
|
|
835
1138
|
let j;
|
|
836
1139
|
let i = 0;
|
|
837
|
-
|
|
838
|
-
|
|
1140
|
+
const childNodes = elm.childNodes;
|
|
1141
|
+
const ilen = childNodes.length;
|
|
839
1142
|
for (; i < ilen; i++) {
|
|
840
1143
|
childNode = childNodes[i];
|
|
841
1144
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -890,13 +1193,13 @@ const relocateSlotContent = (elm) => {
|
|
|
890
1193
|
}
|
|
891
1194
|
}
|
|
892
1195
|
}
|
|
893
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1196
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
894
1197
|
relocateSlotContent(childNode);
|
|
895
1198
|
}
|
|
896
1199
|
}
|
|
897
1200
|
};
|
|
898
1201
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
899
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1202
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
900
1203
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
901
1204
|
return true;
|
|
902
1205
|
}
|
|
@@ -916,6 +1219,18 @@ const callNodeRefs = (vNode) => {
|
|
|
916
1219
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
917
1220
|
}
|
|
918
1221
|
};
|
|
1222
|
+
/**
|
|
1223
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1224
|
+
*
|
|
1225
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1226
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1227
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1228
|
+
* relocation, and reflecting attributes.
|
|
1229
|
+
*
|
|
1230
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1231
|
+
* the DOM node into which it should be rendered.
|
|
1232
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1233
|
+
*/
|
|
919
1234
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
920
1235
|
const hostElm = hostRef.$hostElement$;
|
|
921
1236
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -927,7 +1242,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
927
1242
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
928
1243
|
}
|
|
929
1244
|
rootVnode.$tag$ = null;
|
|
930
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1245
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
931
1246
|
hostRef.$vnode$ = rootVnode;
|
|
932
1247
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
933
1248
|
{
|
|
@@ -935,7 +1250,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
935
1250
|
}
|
|
936
1251
|
{
|
|
937
1252
|
contentRef = hostElm['s-cr'];
|
|
938
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1253
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
939
1254
|
// always reset
|
|
940
1255
|
checkSlotFallbackVisibility = false;
|
|
941
1256
|
}
|
|
@@ -944,7 +1259,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
944
1259
|
{
|
|
945
1260
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
946
1261
|
// the disconnectCallback from working
|
|
947
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1262
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
948
1263
|
if (checkSlotRelocate) {
|
|
949
1264
|
relocateSlotContent(rootVnode.$elm$);
|
|
950
1265
|
let relocateData;
|
|
@@ -1002,7 +1317,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1002
1317
|
}
|
|
1003
1318
|
else {
|
|
1004
1319
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1005
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1320
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1006
1321
|
nodeToRelocate.hidden = true;
|
|
1007
1322
|
}
|
|
1008
1323
|
}
|
|
@@ -1013,37 +1328,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1013
1328
|
}
|
|
1014
1329
|
// done moving nodes around
|
|
1015
1330
|
// allow the disconnect callback to work again
|
|
1016
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1331
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1017
1332
|
// always reset
|
|
1018
1333
|
relocateNodes.length = 0;
|
|
1019
1334
|
}
|
|
1020
1335
|
};
|
|
1021
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
1022
|
-
const createEvent = (ref, name, flags) => {
|
|
1023
|
-
const elm = getElement(ref);
|
|
1024
|
-
return {
|
|
1025
|
-
emit: (detail) => {
|
|
1026
|
-
return emitEvent(elm, name, {
|
|
1027
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1028
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1029
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1030
|
-
detail,
|
|
1031
|
-
});
|
|
1032
|
-
},
|
|
1033
|
-
};
|
|
1034
|
-
};
|
|
1035
|
-
/**
|
|
1036
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
1037
|
-
* @param elm the target of the Event
|
|
1038
|
-
* @param name the name to give the custom Event
|
|
1039
|
-
* @param opts options for configuring a custom Event
|
|
1040
|
-
* @returns the custom Event
|
|
1041
|
-
*/
|
|
1042
|
-
const emitEvent = (elm, name, opts) => {
|
|
1043
|
-
const ev = plt.ce(name, opts);
|
|
1044
|
-
elm.dispatchEvent(ev);
|
|
1045
|
-
return ev;
|
|
1046
|
-
};
|
|
1047
1336
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1048
1337
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1049
1338
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1051,10 +1340,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1051
1340
|
};
|
|
1052
1341
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1053
1342
|
{
|
|
1054
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1343
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1055
1344
|
}
|
|
1056
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1057
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1345
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1346
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1058
1347
|
return;
|
|
1059
1348
|
}
|
|
1060
1349
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1070,7 +1359,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1070
1359
|
let promise;
|
|
1071
1360
|
if (isInitialLoad) {
|
|
1072
1361
|
{
|
|
1073
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1362
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1074
1363
|
if (hostRef.$queuedListeners$) {
|
|
1075
1364
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1076
1365
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1113,7 +1402,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1113
1402
|
}
|
|
1114
1403
|
else {
|
|
1115
1404
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1116
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1405
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1117
1406
|
childrenPromises.length = 0;
|
|
1118
1407
|
}
|
|
1119
1408
|
}
|
|
@@ -1122,10 +1411,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1122
1411
|
try {
|
|
1123
1412
|
instance = instance.render() ;
|
|
1124
1413
|
{
|
|
1125
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1414
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1126
1415
|
}
|
|
1127
1416
|
{
|
|
1128
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1417
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1129
1418
|
}
|
|
1130
1419
|
{
|
|
1131
1420
|
{
|
|
@@ -1152,8 +1441,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1152
1441
|
{
|
|
1153
1442
|
safeCall(instance, 'componentDidRender');
|
|
1154
1443
|
}
|
|
1155
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1156
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1444
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1445
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1157
1446
|
{
|
|
1158
1447
|
// DOM WRITE!
|
|
1159
1448
|
addHydratedFlag(elm);
|
|
@@ -1185,10 +1474,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1185
1474
|
hostRef.$onRenderResolve$();
|
|
1186
1475
|
hostRef.$onRenderResolve$ = undefined;
|
|
1187
1476
|
}
|
|
1188
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1477
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1189
1478
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1190
1479
|
}
|
|
1191
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1480
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1192
1481
|
}
|
|
1193
1482
|
// ( •_•)
|
|
1194
1483
|
// ( •_•)>⌐■-■
|
|
@@ -1218,53 +1507,6 @@ const then = (promise, thenFn) => {
|
|
|
1218
1507
|
};
|
|
1219
1508
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1220
1509
|
;
|
|
1221
|
-
/**
|
|
1222
|
-
* Parse a new property value for a given property type.
|
|
1223
|
-
*
|
|
1224
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
1225
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
1226
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
1227
|
-
* 2. the type stored from `propType`.
|
|
1228
|
-
*
|
|
1229
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1230
|
-
*
|
|
1231
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1232
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1233
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1234
|
-
* ```tsx
|
|
1235
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
1236
|
-
* ```
|
|
1237
|
-
*
|
|
1238
|
-
* HTML prop values on the other hand, will always a string
|
|
1239
|
-
*
|
|
1240
|
-
* @param propValue the new value to coerce to some type
|
|
1241
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
1242
|
-
* @returns the parsed/coerced value
|
|
1243
|
-
*/
|
|
1244
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1245
|
-
// ensure this value is of the correct prop type
|
|
1246
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1247
|
-
if (propType & 4 /* Boolean */) {
|
|
1248
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1249
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1250
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1251
|
-
}
|
|
1252
|
-
if (propType & 2 /* Number */) {
|
|
1253
|
-
// force it to be a number
|
|
1254
|
-
return parseFloat(propValue);
|
|
1255
|
-
}
|
|
1256
|
-
if (propType & 1 /* String */) {
|
|
1257
|
-
// could have been passed as a number or boolean
|
|
1258
|
-
// but we still want it as a string
|
|
1259
|
-
return String(propValue);
|
|
1260
|
-
}
|
|
1261
|
-
// redundant return here for better minification
|
|
1262
|
-
return propValue;
|
|
1263
|
-
}
|
|
1264
|
-
// not sure exactly what type we want
|
|
1265
|
-
// so no need to change to a different type
|
|
1266
|
-
return propValue;
|
|
1267
|
-
};
|
|
1268
1510
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1269
1511
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1270
1512
|
// check our new property value against our internal value
|
|
@@ -1274,13 +1516,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1274
1516
|
const flags = hostRef.$flags$;
|
|
1275
1517
|
const instance = hostRef.$lazyInstance$ ;
|
|
1276
1518
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1277
|
-
|
|
1519
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1520
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1521
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1522
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1278
1523
|
// gadzooks! the property's value has changed!!
|
|
1279
1524
|
// set our new value!
|
|
1280
1525
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1281
1526
|
if (instance) {
|
|
1282
1527
|
// get an array of method names of watch functions to call
|
|
1283
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1528
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1284
1529
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1285
1530
|
if (watchMethods) {
|
|
1286
1531
|
// this instance is watching for when this property changed
|
|
@@ -1295,7 +1540,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1295
1540
|
});
|
|
1296
1541
|
}
|
|
1297
1542
|
}
|
|
1298
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1543
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1299
1544
|
// looks like this value actually changed, so we've got work to do!
|
|
1300
1545
|
// but only if we've already rendered, otherwise just chill out
|
|
1301
1546
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1305,6 +1550,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1305
1550
|
}
|
|
1306
1551
|
}
|
|
1307
1552
|
};
|
|
1553
|
+
/**
|
|
1554
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1555
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1556
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1557
|
+
*
|
|
1558
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1559
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1560
|
+
* @param flags a number used to store a series of bit flags
|
|
1561
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1562
|
+
*/
|
|
1308
1563
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1309
1564
|
if (cmpMeta.$members$) {
|
|
1310
1565
|
if (Cstr.watchers) {
|
|
@@ -1314,8 +1569,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1314
1569
|
const members = Object.entries(cmpMeta.$members$);
|
|
1315
1570
|
const prototype = Cstr.prototype;
|
|
1316
1571
|
members.map(([memberName, [memberFlags]]) => {
|
|
1317
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1318
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1572
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1573
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1319
1574
|
// proxyComponent - prop
|
|
1320
1575
|
Object.defineProperty(prototype, memberName, {
|
|
1321
1576
|
get() {
|
|
@@ -1330,8 +1585,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1330
1585
|
enumerable: true,
|
|
1331
1586
|
});
|
|
1332
1587
|
}
|
|
1333
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1334
|
-
memberFlags & 64 /* Method */) {
|
|
1588
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1589
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1335
1590
|
// proxyComponent - method
|
|
1336
1591
|
Object.defineProperty(prototype, memberName, {
|
|
1337
1592
|
value(...args) {
|
|
@@ -1341,7 +1596,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1341
1596
|
});
|
|
1342
1597
|
}
|
|
1343
1598
|
});
|
|
1344
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1599
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1345
1600
|
const attrNameToPropName = new Map();
|
|
1346
1601
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1347
1602
|
plt.jmp(() => {
|
|
@@ -1397,11 +1652,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1397
1652
|
// create an array of attributes to observe
|
|
1398
1653
|
// and also create a map of html attribute name to js property name
|
|
1399
1654
|
Cstr.observedAttributes = members
|
|
1400
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1655
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1401
1656
|
.map(([propName, m]) => {
|
|
1402
1657
|
const attrName = m[1] || propName;
|
|
1403
1658
|
attrNameToPropName.set(attrName, propName);
|
|
1404
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1659
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1405
1660
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1406
1661
|
}
|
|
1407
1662
|
return attrName;
|
|
@@ -1412,10 +1667,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1412
1667
|
};
|
|
1413
1668
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1414
1669
|
// initializeComponent
|
|
1415
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1670
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1416
1671
|
{
|
|
1417
1672
|
// we haven't initialized this element yet
|
|
1418
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1673
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1419
1674
|
// lazy loaded components
|
|
1420
1675
|
// request the component's implementation to be
|
|
1421
1676
|
// wired up with the host element
|
|
@@ -1433,7 +1688,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1433
1688
|
{
|
|
1434
1689
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1435
1690
|
}
|
|
1436
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1691
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1437
1692
|
Cstr.isProxied = true;
|
|
1438
1693
|
}
|
|
1439
1694
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1441,7 +1696,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1441
1696
|
// but let's keep track of when we start and stop
|
|
1442
1697
|
// so that the getters/setters don't incorrectly step on data
|
|
1443
1698
|
{
|
|
1444
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1699
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1445
1700
|
}
|
|
1446
1701
|
// construct the lazy-loaded component implementation
|
|
1447
1702
|
// passing the hostRef is very important during
|
|
@@ -1454,10 +1709,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1454
1709
|
consoleError(e);
|
|
1455
1710
|
}
|
|
1456
1711
|
{
|
|
1457
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1712
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1458
1713
|
}
|
|
1459
1714
|
{
|
|
1460
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1715
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1461
1716
|
}
|
|
1462
1717
|
endNewInstance();
|
|
1463
1718
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1468,7 +1723,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1468
1723
|
const scopeId = getScopeId(cmpMeta);
|
|
1469
1724
|
if (!styles.has(scopeId)) {
|
|
1470
1725
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1471
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1726
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1472
1727
|
endRegisterStyles();
|
|
1473
1728
|
}
|
|
1474
1729
|
}
|
|
@@ -1495,19 +1750,20 @@ const fireConnectedCallback = (instance) => {
|
|
|
1495
1750
|
}
|
|
1496
1751
|
};
|
|
1497
1752
|
const connectedCallback = (elm) => {
|
|
1498
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1753
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1499
1754
|
const hostRef = getHostRef(elm);
|
|
1500
1755
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1501
1756
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1502
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1757
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1503
1758
|
// first time this component has connected
|
|
1504
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1759
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1505
1760
|
{
|
|
1506
1761
|
// initUpdate
|
|
1507
1762
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1508
1763
|
// in here to act as original content anchors as we move nodes around
|
|
1509
1764
|
// host element has been connected to the DOM
|
|
1510
|
-
if ((
|
|
1765
|
+
if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
1766
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1511
1767
|
setContentReference(elm);
|
|
1512
1768
|
}
|
|
1513
1769
|
}
|
|
@@ -1530,7 +1786,7 @@ const connectedCallback = (elm) => {
|
|
|
1530
1786
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1531
1787
|
if (cmpMeta.$members$) {
|
|
1532
1788
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1533
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1789
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1534
1790
|
const value = elm[memberName];
|
|
1535
1791
|
delete elm[memberName];
|
|
1536
1792
|
elm[memberName] = value;
|
|
@@ -1564,7 +1820,7 @@ const setContentReference = (elm) => {
|
|
|
1564
1820
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1565
1821
|
};
|
|
1566
1822
|
const disconnectedCallback = (elm) => {
|
|
1567
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1823
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1568
1824
|
const hostRef = getHostRef(elm);
|
|
1569
1825
|
const instance = hostRef.$lazyInstance$ ;
|
|
1570
1826
|
{
|
|
@@ -1579,6 +1835,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1579
1835
|
}
|
|
1580
1836
|
};
|
|
1581
1837
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1838
|
+
var _a;
|
|
1582
1839
|
const endBootstrap = createTime();
|
|
1583
1840
|
const cmpTags = [];
|
|
1584
1841
|
const exclude = options.exclude || [];
|
|
@@ -1619,7 +1876,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1619
1876
|
super(self);
|
|
1620
1877
|
self = this;
|
|
1621
1878
|
registerHost(self, cmpMeta);
|
|
1622
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1879
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1623
1880
|
// this component is using shadow dom
|
|
1624
1881
|
// and this browser supports shadow dom
|
|
1625
1882
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1654,13 +1911,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1654
1911
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1655
1912
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1656
1913
|
cmpTags.push(tagName);
|
|
1657
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1914
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1658
1915
|
}
|
|
1659
1916
|
});
|
|
1660
1917
|
});
|
|
1661
1918
|
{
|
|
1662
1919
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1663
1920
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1921
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1922
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1923
|
+
if (nonce != null) {
|
|
1924
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1925
|
+
}
|
|
1664
1926
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1665
1927
|
}
|
|
1666
1928
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1676,12 +1938,48 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1676
1938
|
// Fallback appLoad event
|
|
1677
1939
|
endBootstrap();
|
|
1678
1940
|
};
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
|
|
1941
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1942
|
+
if (listeners) {
|
|
1943
|
+
listeners.map(([flags, name, method]) => {
|
|
1944
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1945
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1946
|
+
const opts = hostListenerOpts(flags);
|
|
1947
|
+
plt.ael(target, name, handler, opts);
|
|
1948
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1682
1951
|
};
|
|
1683
|
-
const
|
|
1684
|
-
|
|
1952
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1953
|
+
try {
|
|
1954
|
+
{
|
|
1955
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1956
|
+
// instance is ready, let's call it's member method for this event
|
|
1957
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1958
|
+
}
|
|
1959
|
+
else {
|
|
1960
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
catch (e) {
|
|
1965
|
+
consoleError(e);
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1969
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1970
|
+
return win;
|
|
1971
|
+
return elm;
|
|
1972
|
+
};
|
|
1973
|
+
// prettier-ignore
|
|
1974
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1975
|
+
/**
|
|
1976
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1977
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1978
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1979
|
+
* @returns void
|
|
1980
|
+
*/
|
|
1981
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1982
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1685
1983
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1686
1984
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1687
1985
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1713,7 +2011,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1713
2011
|
if (module) {
|
|
1714
2012
|
return module[exportName];
|
|
1715
2013
|
}
|
|
2014
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1716
2015
|
return import(
|
|
2016
|
+
/* @vite-ignore */
|
|
1717
2017
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1718
2018
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1719
2019
|
/* webpackMode: "lazy" */
|
|
@@ -1724,14 +2024,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1724
2024
|
return importedModule[exportName];
|
|
1725
2025
|
}, consoleError);
|
|
1726
2026
|
};
|
|
1727
|
-
const styles = new Map();
|
|
2027
|
+
const styles = /*@__PURE__*/ new Map();
|
|
2028
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
2029
|
+
const doc = win.document || { head: {} };
|
|
2030
|
+
const plt = {
|
|
2031
|
+
$flags$: 0,
|
|
2032
|
+
$resourcesUrl$: '',
|
|
2033
|
+
jmp: (h) => h(),
|
|
2034
|
+
raf: (h) => requestAnimationFrame(h),
|
|
2035
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2036
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2037
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2038
|
+
};
|
|
2039
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
2040
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2041
|
+
try {
|
|
2042
|
+
new CSSStyleSheet();
|
|
2043
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2044
|
+
}
|
|
2045
|
+
catch (e) { }
|
|
2046
|
+
return false;
|
|
2047
|
+
})()
|
|
2048
|
+
;
|
|
1728
2049
|
const queueDomReads = [];
|
|
1729
2050
|
const queueDomWrites = [];
|
|
1730
2051
|
const queueTask = (queue, write) => (cb) => {
|
|
1731
2052
|
queue.push(cb);
|
|
1732
2053
|
if (!queuePending) {
|
|
1733
2054
|
queuePending = true;
|
|
1734
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2055
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1735
2056
|
nextTick(flush);
|
|
1736
2057
|
}
|
|
1737
2058
|
else {
|
|
@@ -1768,4 +2089,6 @@ const flush = () => {
|
|
|
1768
2089
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1769
2090
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1770
2091
|
|
|
1771
|
-
export {
|
|
2092
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2093
|
+
|
|
2094
|
+
//# sourceMappingURL=index-5c0f6628.js.map
|