@six-group/ui-library 3.0.0-beta.1.7 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{event-listeners-4a8d66d5.js → event-listeners-74715e62.js} +40 -38
- package/dist/cjs/event-listeners-74715e62.js.map +1 -0
- package/dist/cjs/{execution-control-3bc9c7c4.js → execution-control-46f388e0.js} +37 -35
- package/dist/cjs/execution-control-46f388e0.js.map +1 -0
- package/dist/cjs/{focus-visible-b08d956f.js → focus-visible-0b352c74.js} +42 -40
- package/dist/cjs/focus-visible-0b352c74.js.map +1 -0
- package/dist/cjs/{form-control-9e4dffd1.js → form-control-8e2ae807.js} +28 -26
- package/dist/cjs/form-control-8e2ae807.js.map +1 -0
- package/dist/cjs/{index-341df120.js → index-b3257a77.js} +603 -279
- package/dist/cjs/index-b3257a77.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-a9679ddf.js → modal-48d42228.js} +43 -41
- package/dist/cjs/modal-48d42228.js.map +1 -0
- package/dist/cjs/{popover-e3781f5a.js → popover-f743f62b.js} +100 -99
- package/dist/cjs/popover-f743f62b.js.map +1 -0
- package/dist/cjs/{scroll-5b8676ba.js → scroll-76e6f5d7.js} +59 -57
- package/dist/cjs/scroll-76e6f5d7.js.map +1 -0
- package/dist/cjs/set-attributes_2.cjs.entry.js +58 -58
- package/dist/cjs/set-attributes_2.cjs.entry.js.map +1 -0
- package/dist/cjs/six-alert.cjs.entry.js +127 -132
- package/dist/cjs/six-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/six-avatar.cjs.entry.js +27 -29
- package/dist/cjs/six-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-badge.cjs.entry.js +26 -27
- package/dist/cjs/six-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/six-button.cjs.entry.js +96 -98
- package/dist/cjs/six-button.cjs.entry.js.map +1 -0
- package/dist/cjs/six-card.cjs.entry.js +11 -9
- package/dist/cjs/six-card.cjs.entry.js.map +1 -0
- package/dist/cjs/six-checkbox.cjs.entry.js +149 -153
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/six-datepicker.cjs.entry.js +1137 -1190
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/six-details.cjs.entry.js +137 -140
- package/dist/cjs/six-details.cjs.entry.js.map +1 -0
- package/dist/cjs/six-dialog.cjs.entry.js +146 -153
- package/dist/cjs/six-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/six-drawer.cjs.entry.js +163 -175
- package/dist/cjs/six-drawer.cjs.entry.js.map +1 -0
- package/dist/cjs/six-dropdown_3.cjs.entry.js +682 -729
- package/dist/cjs/six-dropdown_3.cjs.entry.js.map +1 -0
- package/dist/cjs/six-error-page.cjs.entry.js +98 -95
- package/dist/cjs/six-error-page.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-list-item.cjs.entry.js +37 -39
- package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-list.cjs.entry.js +11 -9
- package/dist/cjs/six-file-list.cjs.entry.js.map +1 -0
- package/dist/cjs/six-file-upload.cjs.entry.js +110 -97
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -0
- package/dist/cjs/six-footer.cjs.entry.js +11 -9
- package/dist/cjs/six-footer.cjs.entry.js.map +1 -0
- package/dist/cjs/six-form.cjs.entry.js +221 -220
- package/dist/cjs/six-form.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +46 -47
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -0
- package/dist/cjs/six-header.cjs.entry.js +150 -150
- package/dist/cjs/six-header.cjs.entry.js.map +1 -0
- package/dist/cjs/six-icon-button.cjs.entry.js +37 -34
- package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/six-icon.cjs.entry.js +25 -25
- package/dist/cjs/six-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/six-input.cjs.entry.js +229 -231
- package/dist/cjs/six-input.cjs.entry.js.map +1 -0
- package/dist/cjs/six-item-picker.cjs.entry.js +347 -362
- package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/six-language-switcher.cjs.entry.js +55 -53
- package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -0
- package/dist/cjs/six-layout-grid.cjs.entry.js +23 -20
- package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/six-main-container.cjs.entry.js +13 -12
- package/dist/cjs/six-main-container.cjs.entry.js.map +1 -0
- package/dist/cjs/six-menu-divider.cjs.entry.js +11 -9
- package/dist/cjs/six-menu-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/six-menu-label.cjs.entry.js +11 -9
- package/dist/cjs/six-menu-label.cjs.entry.js.map +1 -0
- package/dist/cjs/six-picto.cjs.entry.js +15 -16
- package/dist/cjs/six-picto.cjs.entry.js.map +1 -0
- package/dist/cjs/six-progress-bar.cjs.entry.js +18 -18
- package/dist/cjs/six-progress-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-progress-ring.cjs.entry.js +33 -32
- package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -0
- package/dist/cjs/six-radio.cjs.entry.js +120 -122
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/six-range.cjs.entry.js +188 -199
- package/dist/cjs/six-range.cjs.entry.js.map +1 -0
- package/dist/cjs/six-root.cjs.entry.js +34 -35
- package/dist/cjs/six-root.cjs.entry.js.map +1 -0
- package/dist/cjs/six-search-field.cjs.entry.js +43 -44
- package/dist/cjs/six-search-field.cjs.entry.js.map +1 -0
- package/dist/cjs/six-select.cjs.entry.js +422 -448
- package/dist/cjs/six-select.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js +44 -43
- package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar-item.cjs.entry.js +18 -19
- package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -0
- package/dist/cjs/six-sidebar.cjs.entry.js +170 -172
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -0
- package/dist/cjs/six-spinner.cjs.entry.js +18 -17
- package/dist/cjs/six-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/six-switch.cjs.entry.js +101 -101
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab-group.cjs.entry.js +227 -227
- package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab-panel.cjs.entry.js +18 -18
- package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tab.cjs.entry.js +41 -43
- package/dist/cjs/six-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/six-table-cell_4.cjs.entry.js +77 -72
- package/dist/cjs/six-table-cell_4.cjs.entry.js.map +1 -0
- package/dist/cjs/six-table.cjs.entry.js +145 -146
- package/dist/cjs/six-table.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tag.cjs.entry.js +39 -41
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/six-textarea.cjs.entry.js +209 -212
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/six-tile.cjs.entry.js +87 -90
- package/dist/cjs/six-tile.cjs.entry.js.map +1 -0
- package/dist/cjs/six-timepicker.cjs.entry.js +441 -490
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/{six-timepicker.types-c58cc88b.js → six-timepicker.types-c19ebff3.js} +45 -43
- package/dist/cjs/six-timepicker.types-c19ebff3.js.map +1 -0
- package/dist/cjs/six-tooltip.cjs.entry.js +163 -173
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/{slot-8abe833c.js → slot-ad537f24.js} +44 -42
- package/dist/cjs/slot-ad537f24.js.map +1 -0
- package/dist/cjs/{types-0c28e484.js → types-64878648.js} +14 -12
- 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 -2
- package/dist/collection/components/six-alert/six-alert.js +368 -366
- package/dist/collection/components/six-alert/six-alert.js.map +1 -0
- package/dist/collection/components/six-avatar/six-avatar.js +131 -131
- package/dist/collection/components/six-avatar/six-avatar.js.map +1 -0
- package/dist/collection/components/six-badge/six-badge.js +104 -101
- package/dist/collection/components/six-badge/six-badge.js.map +1 -0
- package/dist/collection/components/six-button/six-button.js +464 -466
- package/dist/collection/components/six-button/six-button.js.map +1 -0
- package/dist/collection/components/six-card/six-card.js +25 -21
- package/dist/collection/components/six-card/six-card.js.map +1 -0
- package/dist/collection/components/six-checkbox/six-checkbox.js +541 -550
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/day-selection.js +12 -13
- package/dist/collection/components/six-datepicker/components/day-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/month-selection.js +12 -12
- package/dist/collection/components/six-datepicker/components/month-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/components/year-selection.js +10 -10
- package/dist/collection/components/six-datepicker/components/year-selection.js.map +1 -0
- package/dist/collection/components/six-datepicker/six-date-formats.js +24 -23
- package/dist/collection/components/six-datepicker/six-date-formats.js.map +1 -0
- package/dist/collection/components/six-datepicker/six-datepicker.js +1271 -1343
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -0
- package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js +17 -16
- package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js.map +1 -0
- package/dist/collection/components/six-details/six-details.js +434 -432
- package/dist/collection/components/six-details/six-details.js.map +1 -0
- package/dist/collection/components/six-dialog/six-dialog.js +397 -401
- package/dist/collection/components/six-dialog/six-dialog.js.map +1 -0
- package/dist/collection/components/six-drawer/six-drawer.js +449 -458
- package/dist/collection/components/six-drawer/six-drawer.js.map +1 -0
- package/dist/collection/components/six-dropdown/six-dropdown.js +919 -939
- package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -0
- package/dist/collection/components/six-error-page/six-error-page.js +203 -199
- 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 +24 -20
- 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 +204 -203
- 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 +307 -272
- package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -0
- package/dist/collection/components/six-footer/six-footer.js +25 -21
- package/dist/collection/components/six-footer/six-footer.js.map +1 -0
- package/dist/collection/components/six-form/six-form.js +419 -408
- package/dist/collection/components/six-form/six-form.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.js +173 -166
- package/dist/collection/components/six-group-label/six-group-label.js.map +1 -0
- package/dist/collection/components/six-header/six-header.js +412 -420
- package/dist/collection/components/six-header/six-header.js.map +1 -0
- package/dist/collection/components/six-icon/six-icon.js +81 -77
- package/dist/collection/components/six-icon/six-icon.js.map +1 -0
- package/dist/collection/components/six-icon-button/six-icon-button.js +146 -142
- package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -0
- package/dist/collection/components/six-input/six-input.js +1140 -1141
- package/dist/collection/components/six-input/six-input.js.map +1 -0
- package/dist/collection/components/six-item-picker/six-item-picker.js +681 -688
- package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -0
- package/dist/collection/components/six-item-picker/types.js +14 -13
- package/dist/collection/components/six-item-picker/types.js.map +1 -0
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +139 -128
- 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 +63 -52
- 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 +55 -53
- package/dist/collection/components/six-main-container/six-main-container.js.map +1 -0
- package/dist/collection/components/six-menu/six-menu.js +398 -406
- package/dist/collection/components/six-menu/six-menu.js.map +1 -0
- package/dist/collection/components/six-menu-divider/six-menu-divider.js +27 -22
- 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 +198 -177
- 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 +29 -25
- package/dist/collection/components/six-menu-label/six-menu-label.js.map +1 -0
- package/dist/collection/components/six-picto/six-picto.js +53 -50
- package/dist/collection/components/six-picto/six-picto.js.map +1 -0
- package/dist/collection/components/six-progress-bar/six-progress-bar.js +80 -77
- 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 +114 -111
- package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -0
- package/dist/collection/components/six-radio/six-radio.js +412 -410
- package/dist/collection/components/six-radio/six-radio.js.map +1 -0
- package/dist/collection/components/six-range/six-range.js +619 -620
- package/dist/collection/components/six-range/six-range.js.map +1 -0
- package/dist/collection/components/six-root/six-root.js +165 -167
- package/dist/collection/components/six-root/six-root.js.map +1 -0
- package/dist/collection/components/six-search-field/six-search-field.js +177 -171
- 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 +1081 -1105
- package/dist/collection/components/six-select/six-select.js.map +1 -0
- package/dist/collection/components/six-sidebar/six-sidebar.js +464 -455
- package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -0
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +92 -89
- 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 +159 -158
- 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 +58 -55
- package/dist/collection/components/six-spinner/six-spinner.js.map +1 -0
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +49 -46
- package/dist/collection/components/six-stage-indicator/six-stage-indicator.js.map +1 -0
- package/dist/collection/components/six-switch/six-switch.js +401 -393
- package/dist/collection/components/six-switch/six-switch.js.map +1 -0
- package/dist/collection/components/six-tab/six-tab.js +202 -198
- package/dist/collection/components/six-tab/six-tab.js.map +1 -0
- package/dist/collection/components/six-tab-group/six-tab-group.js +368 -362
- 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 +78 -75
- package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -0
- package/dist/collection/components/six-table/six-table.js +219 -209
- package/dist/collection/components/six-table/six-table.js.map +1 -0
- package/dist/collection/components/six-table/test/helpers.js +14 -13
- package/dist/collection/components/six-table/test/helpers.js.map +1 -0
- package/dist/collection/components/six-table/types.js +9 -8
- package/dist/collection/components/six-table/types.js.map +1 -0
- package/dist/collection/components/six-table/util/filter-by.js +34 -34
- package/dist/collection/components/six-table/util/filter-by.js.map +1 -0
- package/dist/collection/components/six-table/util/from-data.js +32 -33
- package/dist/collection/components/six-table/util/from-data.js.map +1 -0
- package/dist/collection/components/six-table/util/is.js +4 -3
- package/dist/collection/components/six-table/util/is.js.map +1 -0
- package/dist/collection/components/six-table/util/quick-filter-by.js +14 -13
- package/dist/collection/components/six-table/util/quick-filter-by.js.map +1 -0
- package/dist/collection/components/six-table/util/sort-by.js +25 -25
- package/dist/collection/components/six-table/util/sort-by.js.map +1 -0
- package/dist/collection/components/six-table-cell/six-table-cell.js +25 -21
- package/dist/collection/components/six-table-cell/six-table-cell.js.map +1 -0
- package/dist/collection/components/six-table-header/six-table-header.js +25 -21
- package/dist/collection/components/six-table-header/six-table-header.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/get-next-state.js +7 -7
- package/dist/collection/components/six-table-header-cell/get-next-state.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/icons.js +12 -12
- package/dist/collection/components/six-table-header-cell/icons.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/six-table-header-cell.js +179 -174
- package/dist/collection/components/six-table-header-cell/six-table-header-cell.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/types.js +2 -13
- package/dist/collection/components/six-table-header-cell/types.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/util/create-model.js +7 -6
- package/dist/collection/components/six-table-header-cell/util/create-model.js.map +1 -0
- package/dist/collection/components/six-table-header-cell/util/get-next-state.js +7 -7
- package/dist/collection/components/six-table-header-cell/util/get-next-state.js.map +1 -0
- package/dist/collection/components/six-table-row/six-table-row.js +25 -21
- package/dist/collection/components/six-table-row/six-table-row.js.map +1 -0
- package/dist/collection/components/six-tag/six-tag.js +159 -157
- package/dist/collection/components/six-tag/six-tag.js.map +1 -0
- package/dist/collection/components/six-textarea/six-textarea.js +920 -912
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -0
- package/dist/collection/components/six-tile/six-tile.js +314 -315
- package/dist/collection/components/six-tile/six-tile.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-time-format.js +15 -14
- package/dist/collection/components/six-timepicker/six-time-format.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-timepicker.js +936 -980
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -0
- package/dist/collection/components/six-timepicker/six-timepicker.types.js +41 -40
- package/dist/collection/components/six-timepicker/six-timepicker.types.js.map +1 -0
- package/dist/collection/components/six-tooltip/six-tooltip.js +432 -435
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -0
- package/dist/collection/functional-components/form-control/form-control.js +23 -28
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -0
- package/dist/collection/index.js +2 -1
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/testUtil/delay.js +4 -3
- package/dist/collection/testUtil/delay.js.map +1 -0
- package/dist/collection/utils/as-array.js +2 -1
- package/dist/collection/utils/as-array.js.map +1 -0
- package/dist/collection/utils/date-util.js +713 -712
- package/dist/collection/utils/date-util.js.map +1 -0
- package/dist/collection/utils/event-listeners.js +40 -39
- package/dist/collection/utils/event-listeners.js.map +1 -0
- package/dist/collection/utils/execution-control.js +39 -38
- package/dist/collection/utils/execution-control.js.map +1 -0
- package/dist/collection/utils/focus-visible.js +42 -41
- package/dist/collection/utils/focus-visible.js.map +1 -0
- package/dist/collection/utils/matchers.js +3 -2
- package/dist/collection/utils/matchers.js.map +1 -0
- package/dist/collection/utils/modal.js +29 -28
- package/dist/collection/utils/modal.js.map +1 -0
- package/dist/collection/utils/offset.js +14 -13
- package/dist/collection/utils/offset.js.map +1 -0
- package/dist/collection/utils/popover.js +114 -113
- package/dist/collection/utils/popover.js.map +1 -0
- package/dist/collection/utils/scroll.js +48 -47
- package/dist/collection/utils/scroll.js.map +1 -0
- package/dist/collection/utils/slot.js +60 -59
- package/dist/collection/utils/slot.js.map +1 -0
- package/dist/collection/utils/support.js +16 -15
- package/dist/collection/utils/support.js.map +1 -0
- package/dist/collection/utils/tabbable.js +23 -22
- package/dist/collection/utils/tabbable.js.map +1 -0
- package/dist/collection/utils/testing.js +39 -38
- package/dist/collection/utils/testing.js.map +1 -0
- package/dist/collection/utils/time.util.js +75 -74
- package/dist/collection/utils/time.util.js.map +1 -0
- package/dist/collection/utils/type-check.js +6 -5
- package/dist/collection/utils/type-check.js.map +1 -0
- package/dist/collection/utils/types.js +2 -1
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/collection/wrappers/set-attributes/set-attributes.js +72 -68
- package/dist/collection/wrappers/set-attributes/set-attributes.js.map +1 -0
- package/dist/{esm/event-listeners-1bef934e.js → components/event-listeners.js} +40 -38
- package/dist/components/event-listeners.js.map +1 -0
- package/dist/{esm/execution-control-235f5126.js → components/execution-control.js} +37 -35
- package/dist/components/execution-control.js.map +1 -0
- package/dist/{esm/focus-visible-4b7946aa.js → components/focus-visible.js} +42 -40
- 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 +132 -0
- package/dist/components/index.js.map +1 -0
- package/dist/{esm/modal-e5709f6b.js → components/modal.js} +43 -41
- package/dist/components/modal.js.map +1 -0
- package/dist/{esm/popover-5a51f84d.js → components/popover.js} +100 -99
- package/dist/components/popover.js.map +1 -0
- package/dist/{esm/scroll-99b214c2.js → components/scroll.js} +59 -57
- 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} +30 -9749
- 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-table-cell.d.ts +11 -0
- package/dist/components/six-table-cell.js +8 -0
- package/dist/components/six-table-cell.js.map +1 -0
- package/dist/components/six-table-cell2.js +32 -0
- package/dist/components/six-table-cell2.js.map +1 -0
- package/dist/components/six-table-header-cell.d.ts +11 -0
- package/dist/components/six-table-header-cell.js +8 -0
- package/dist/components/six-table-header-cell.js.map +1 -0
- package/dist/components/six-table-header-cell2.js +120 -0
- package/dist/components/six-table-header-cell2.js.map +1 -0
- package/dist/components/six-table-header.d.ts +11 -0
- package/dist/components/six-table-header.js +8 -0
- package/dist/components/six-table-header.js.map +1 -0
- package/dist/components/six-table-header2.js +32 -0
- package/dist/components/six-table-header2.js.map +1 -0
- package/dist/components/six-table-row.d.ts +11 -0
- package/dist/components/six-table-row.js +8 -0
- package/dist/components/six-table-row.js.map +1 -0
- package/dist/components/six-table-row2.js +32 -0
- package/dist/components/six-table-row2.js.map +1 -0
- package/dist/components/six-table.d.ts +11 -0
- package/dist/components/six-table.js +252 -0
- package/dist/components/six-table.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/{esm/slot-5253e199.js → components/slot.js} +44 -42
- package/dist/components/slot.js.map +1 -0
- package/dist/components.d.ts +27 -0
- package/dist/components.json +61 -28
- package/dist/esm/event-listeners-570a24ea.js +43 -0
- package/dist/esm/event-listeners-570a24ea.js.map +1 -0
- package/dist/esm/execution-control-1a60d709.js +40 -0
- package/dist/esm/execution-control-1a60d709.js.map +1 -0
- package/dist/esm/focus-visible-97933ea9.js +45 -0
- package/dist/esm/focus-visible-97933ea9.js.map +1 -0
- package/dist/esm/{form-control-17478ad2.js → form-control-bdd1478a.js} +28 -26
- package/dist/esm/form-control-bdd1478a.js.map +1 -0
- package/dist/esm/{index-a2605a62.js → index-96b1af5d.js} +603 -279
- package/dist/esm/index-96b1af5d.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 +48 -0
- package/dist/esm/modal-5ebdc320.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/popover-bd2c2fca.js +1897 -0
- package/dist/esm/popover-bd2c2fca.js.map +1 -0
- package/dist/esm/scroll-180b53fd.js +64 -0
- package/dist/esm/scroll-180b53fd.js.map +1 -0
- package/dist/esm/set-attributes_2.entry.js +58 -58
- package/dist/esm/set-attributes_2.entry.js.map +1 -0
- package/dist/esm/six-alert.entry.js +127 -132
- package/dist/esm/six-alert.entry.js.map +1 -0
- package/dist/esm/six-avatar.entry.js +27 -29
- package/dist/esm/six-avatar.entry.js.map +1 -0
- package/dist/esm/six-badge.entry.js +26 -27
- package/dist/esm/six-badge.entry.js.map +1 -0
- package/dist/esm/six-button.entry.js +96 -98
- package/dist/esm/six-button.entry.js.map +1 -0
- package/dist/esm/six-card.entry.js +11 -9
- package/dist/esm/six-card.entry.js.map +1 -0
- package/dist/esm/six-checkbox.entry.js +149 -153
- package/dist/esm/six-checkbox.entry.js.map +1 -0
- package/dist/esm/six-datepicker.entry.js +1137 -1190
- package/dist/esm/six-datepicker.entry.js.map +1 -0
- package/dist/esm/six-details.entry.js +137 -140
- package/dist/esm/six-details.entry.js.map +1 -0
- package/dist/esm/six-dialog.entry.js +146 -153
- package/dist/esm/six-dialog.entry.js.map +1 -0
- package/dist/esm/six-drawer.entry.js +163 -175
- package/dist/esm/six-drawer.entry.js.map +1 -0
- package/dist/esm/six-dropdown_3.entry.js +682 -729
- package/dist/esm/six-dropdown_3.entry.js.map +1 -0
- package/dist/esm/six-error-page.entry.js +98 -95
- package/dist/esm/six-error-page.entry.js.map +1 -0
- package/dist/esm/six-file-list-item.entry.js +37 -39
- package/dist/esm/six-file-list-item.entry.js.map +1 -0
- package/dist/esm/six-file-list.entry.js +11 -9
- package/dist/esm/six-file-list.entry.js.map +1 -0
- package/dist/esm/six-file-upload.entry.js +110 -97
- package/dist/esm/six-file-upload.entry.js.map +1 -0
- package/dist/esm/six-footer.entry.js +11 -9
- package/dist/esm/six-footer.entry.js.map +1 -0
- package/dist/esm/six-form.entry.js +221 -220
- package/dist/esm/six-form.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +46 -47
- package/dist/esm/six-group-label.entry.js.map +1 -0
- package/dist/esm/six-header.entry.js +150 -150
- package/dist/esm/six-header.entry.js.map +1 -0
- package/dist/esm/six-icon-button.entry.js +37 -34
- package/dist/esm/six-icon-button.entry.js.map +1 -0
- package/dist/esm/six-icon.entry.js +25 -25
- package/dist/esm/six-icon.entry.js.map +1 -0
- package/dist/esm/six-input.entry.js +229 -231
- package/dist/esm/six-input.entry.js.map +1 -0
- package/dist/esm/six-item-picker.entry.js +347 -362
- package/dist/esm/six-item-picker.entry.js.map +1 -0
- package/dist/esm/six-language-switcher.entry.js +55 -53
- package/dist/esm/six-language-switcher.entry.js.map +1 -0
- package/dist/esm/six-layout-grid.entry.js +23 -20
- package/dist/esm/six-layout-grid.entry.js.map +1 -0
- package/dist/esm/six-main-container.entry.js +13 -12
- package/dist/esm/six-main-container.entry.js.map +1 -0
- package/dist/esm/six-menu-divider.entry.js +11 -9
- package/dist/esm/six-menu-divider.entry.js.map +1 -0
- package/dist/esm/six-menu-label.entry.js +11 -9
- package/dist/esm/six-menu-label.entry.js.map +1 -0
- package/dist/esm/six-picto.entry.js +15 -16
- package/dist/esm/six-picto.entry.js.map +1 -0
- package/dist/esm/six-progress-bar.entry.js +18 -18
- package/dist/esm/six-progress-bar.entry.js.map +1 -0
- package/dist/esm/six-progress-ring.entry.js +33 -32
- package/dist/esm/six-progress-ring.entry.js.map +1 -0
- package/dist/esm/six-radio.entry.js +120 -122
- package/dist/esm/six-radio.entry.js.map +1 -0
- package/dist/esm/six-range.entry.js +188 -199
- package/dist/esm/six-range.entry.js.map +1 -0
- package/dist/esm/six-root.entry.js +34 -35
- package/dist/esm/six-root.entry.js.map +1 -0
- package/dist/esm/six-search-field.entry.js +43 -44
- package/dist/esm/six-search-field.entry.js.map +1 -0
- package/dist/esm/six-select.entry.js +422 -448
- package/dist/esm/six-select.entry.js.map +1 -0
- package/dist/esm/six-sidebar-item-group.entry.js +44 -43
- package/dist/esm/six-sidebar-item-group.entry.js.map +1 -0
- package/dist/esm/six-sidebar-item.entry.js +18 -19
- package/dist/esm/six-sidebar-item.entry.js.map +1 -0
- package/dist/esm/six-sidebar.entry.js +170 -172
- package/dist/esm/six-sidebar.entry.js.map +1 -0
- package/dist/esm/six-spinner.entry.js +18 -17
- package/dist/esm/six-spinner.entry.js.map +1 -0
- package/dist/esm/six-switch.entry.js +101 -101
- package/dist/esm/six-switch.entry.js.map +1 -0
- package/dist/esm/six-tab-group.entry.js +227 -227
- package/dist/esm/six-tab-group.entry.js.map +1 -0
- package/dist/esm/six-tab-panel.entry.js +18 -18
- package/dist/esm/six-tab-panel.entry.js.map +1 -0
- package/dist/esm/six-tab.entry.js +41 -43
- package/dist/esm/six-tab.entry.js.map +1 -0
- package/dist/esm/six-table-cell_4.entry.js +77 -72
- package/dist/esm/six-table-cell_4.entry.js.map +1 -0
- package/dist/esm/six-table.entry.js +145 -146
- package/dist/esm/six-table.entry.js.map +1 -0
- package/dist/esm/six-tag.entry.js +39 -41
- package/dist/esm/six-tag.entry.js.map +1 -0
- package/dist/esm/six-textarea.entry.js +209 -212
- package/dist/esm/six-textarea.entry.js.map +1 -0
- package/dist/esm/six-tile.entry.js +87 -90
- package/dist/esm/six-tile.entry.js.map +1 -0
- package/dist/esm/six-timepicker.entry.js +441 -490
- package/dist/esm/six-timepicker.entry.js.map +1 -0
- package/dist/esm/{six-timepicker.types-cd6bac03.js → six-timepicker.types-e161a447.js} +45 -43
- package/dist/esm/six-timepicker.types-e161a447.js.map +1 -0
- package/dist/esm/six-tooltip.entry.js +163 -173
- package/dist/esm/six-tooltip.entry.js.map +1 -0
- package/dist/esm/slot-6f3984c7.js +47 -0
- package/dist/esm/slot-6f3984c7.js.map +1 -0
- package/dist/esm/{types-a37c1695.js → types-4b10b413.js} +14 -12
- 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-alert/six-alert.d.ts +60 -60
- package/dist/types/components/six-avatar/six-avatar.d.ts +27 -27
- package/dist/types/components/six-badge/six-badge.d.ts +20 -20
- package/dist/types/components/six-button/six-button.d.ts +69 -69
- package/dist/types/components/six-card/six-card.d.ts +9 -9
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +86 -86
- package/dist/types/components/six-datepicker/components/day-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/components/month-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/components/year-selection.d.ts +5 -5
- package/dist/types/components/six-datepicker/six-date-formats.d.ts +22 -22
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +214 -214
- package/dist/types/components/six-datepicker/test/six-datepicker.test-helpers.d.ts +1 -1
- package/dist/types/components/six-details/six-details.d.ts +61 -61
- package/dist/types/components/six-dialog/six-dialog.d.ts +75 -75
- package/dist/types/components/six-drawer/six-drawer.d.ts +82 -82
- package/dist/types/components/six-dropdown/six-dropdown.d.ts +140 -140
- package/dist/types/components/six-error-page/six-error-page.d.ts +27 -27
- package/dist/types/components/six-file-list/six-file-list.d.ts +8 -8
- package/dist/types/components/six-file-list-item/six-file-list-item.d.ts +35 -35
- package/dist/types/components/six-file-upload/six-file-upload.d.ts +49 -42
- package/dist/types/components/six-footer/six-footer.d.ts +9 -9
- package/dist/types/components/six-form/six-form.d.ts +69 -69
- package/dist/types/components/six-group-label/six-group-label.d.ts +37 -37
- package/dist/types/components/six-header/six-header.d.ts +90 -90
- package/dist/types/components/six-icon/six-icon.d.ts +13 -13
- package/dist/types/components/six-icon-button/six-icon-button.d.ts +28 -28
- package/dist/types/components/six-input/six-input.d.ts +165 -165
- package/dist/types/components/six-item-picker/six-item-picker.d.ts +106 -106
- package/dist/types/components/six-item-picker/types.d.ts +11 -11
- package/dist/types/components/six-language-switcher/six-language-switcher.d.ts +25 -25
- package/dist/types/components/six-layout-grid/six-layout-grid.d.ts +14 -14
- package/dist/types/components/six-main-container/six-main-container.d.ts +16 -16
- package/dist/types/components/six-menu/six-menu.d.ts +81 -81
- package/dist/types/components/six-menu-divider/six-menu-divider.d.ts +11 -11
- package/dist/types/components/six-menu-item/six-menu-item.d.ts +39 -36
- package/dist/types/components/six-menu-label/six-menu-label.d.ts +13 -13
- package/dist/types/components/six-picto/six-picto.d.ts +14 -14
- package/dist/types/components/six-progress-bar/six-progress-bar.d.ts +19 -19
- package/dist/types/components/six-progress-ring/six-progress-ring.d.ts +24 -24
- package/dist/types/components/six-radio/six-radio.d.ts +66 -66
- package/dist/types/components/six-range/six-range.d.ts +101 -101
- package/dist/types/components/six-root/six-root.d.ts +34 -34
- package/dist/types/components/six-search-field/six-search-field.d.ts +32 -32
- package/dist/types/components/six-select/six-select.d.ts +164 -163
- package/dist/types/components/six-sidebar/six-sidebar.d.ts +55 -55
- package/dist/types/components/six-sidebar-item/six-sidebar-item.d.ts +15 -15
- package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +26 -26
- package/dist/types/components/six-spinner/six-spinner.d.ts +15 -15
- package/dist/types/components/six-stage-indicator/six-stage-indicator.d.ts +6 -6
- package/dist/types/components/six-switch/six-switch.d.ts +62 -62
- package/dist/types/components/six-tab/six-tab.d.ts +35 -35
- package/dist/types/components/six-tab-group/six-tab-group.d.ts +62 -62
- package/dist/types/components/six-tab-panel/six-tab-panel.d.ts +19 -19
- package/dist/types/components/six-table/six-table.d.ts +30 -30
- package/dist/types/components/six-table/test/helpers.d.ts +2 -2
- package/dist/types/components/six-table/types.d.ts +33 -33
- package/dist/types/components/six-table/util/filter-by.d.ts +2 -2
- package/dist/types/components/six-table/util/from-data.d.ts +8 -8
- package/dist/types/components/six-table/util/is.d.ts +3 -3
- package/dist/types/components/six-table/util/quick-filter-by.d.ts +2 -2
- package/dist/types/components/six-table/util/sort-by.d.ts +2 -2
- package/dist/types/components/six-table-cell/six-table-cell.d.ts +9 -9
- package/dist/types/components/six-table-header/six-table-header.d.ts +9 -9
- package/dist/types/components/six-table-header-cell/get-next-state.d.ts +2 -2
- package/dist/types/components/six-table-header-cell/icons.d.ts +3 -3
- package/dist/types/components/six-table-header-cell/six-table-header-cell.d.ts +32 -32
- package/dist/types/components/six-table-header-cell/types.d.ts +2 -11
- package/dist/types/components/six-table-header-cell/util/create-model.d.ts +4 -4
- package/dist/types/components/six-table-header-cell/util/get-next-state.d.ts +3 -3
- package/dist/types/components/six-table-row/six-table-row.d.ts +9 -9
- package/dist/types/components/six-tag/six-tag.d.ts +30 -30
- package/dist/types/components/six-textarea/six-textarea.d.ts +134 -134
- package/dist/types/components/six-tile/six-tile.d.ts +40 -40
- package/dist/types/components/six-timepicker/six-time-format.d.ts +13 -13
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +184 -184
- package/dist/types/components/six-timepicker/six-timepicker.types.d.ts +36 -36
- package/dist/types/components/six-tooltip/six-tooltip.d.ts +72 -72
- package/dist/types/components.d.ts +1254 -106
- package/dist/types/functional-components/form-control/form-control.d.ts +34 -34
- package/dist/types/index.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +91 -19
- package/dist/types/testUtil/delay.d.ts +1 -1
- package/dist/types/utils/as-array.d.ts +1 -1
- package/dist/types/utils/date-util.d.ts +194 -194
- package/dist/types/utils/event-listeners.d.ts +15 -15
- package/dist/types/utils/execution-control.d.ts +26 -26
- package/dist/types/utils/focus-visible.d.ts +6 -6
- package/dist/types/utils/matchers.d.ts +2 -2
- package/dist/types/utils/modal.d.ts +13 -13
- package/dist/types/utils/offset.d.ts +4 -4
- package/dist/types/utils/popover.d.ts +27 -27
- package/dist/types/utils/scroll.d.ts +3 -3
- package/dist/types/utils/slot.d.ts +9 -9
- package/dist/types/utils/support.d.ts +1 -1
- package/dist/types/utils/tabbable.d.ts +2 -2
- package/dist/types/utils/testing.d.ts +2 -2
- package/dist/types/utils/time.util.d.ts +10 -10
- package/dist/types/utils/type-check.d.ts +4 -4
- package/dist/types/utils/types.d.ts +4 -4
- package/dist/types/wrappers/set-attributes/set-attributes.d.ts +9 -9
- package/dist/ui-library/index.esm.js +2 -0
- package/dist/ui-library/index.esm.js.map +1 -0
- package/dist/ui-library/p-00507165.entry.js +2 -0
- package/dist/ui-library/p-00507165.entry.js.map +1 -0
- package/dist/ui-library/p-028a2c54.entry.js +2 -0
- package/dist/ui-library/p-028a2c54.entry.js.map +1 -0
- package/dist/ui-library/p-028a2f77.entry.js +2 -0
- package/dist/ui-library/p-028a2f77.entry.js.map +1 -0
- package/dist/ui-library/p-0786fa7c.js +2 -0
- package/dist/ui-library/p-0786fa7c.js.map +1 -0
- package/dist/ui-library/p-0c89817e.entry.js +2 -0
- package/dist/ui-library/p-0c89817e.entry.js.map +1 -0
- package/dist/ui-library/p-0d1fdc4e.entry.js +2 -0
- package/dist/ui-library/p-0d1fdc4e.entry.js.map +1 -0
- package/dist/ui-library/p-0d9cbb51.entry.js +2 -0
- package/dist/ui-library/p-0d9cbb51.entry.js.map +1 -0
- package/dist/ui-library/p-12000282.entry.js +2 -0
- package/dist/ui-library/p-12000282.entry.js.map +1 -0
- package/dist/ui-library/p-1414a242.entry.js +2 -0
- package/dist/ui-library/p-1414a242.entry.js.map +1 -0
- package/dist/ui-library/p-14db57aa.entry.js +2 -0
- package/dist/ui-library/p-14db57aa.entry.js.map +1 -0
- package/dist/ui-library/p-16732ac1.entry.js +2 -0
- package/dist/ui-library/p-16732ac1.entry.js.map +1 -0
- package/dist/ui-library/p-16b99232.js +3 -0
- package/dist/ui-library/p-16b99232.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-232d43a6.entry.js +2 -0
- package/dist/ui-library/p-232d43a6.entry.js.map +1 -0
- package/dist/ui-library/p-25a3bf57.js +2 -0
- package/dist/ui-library/p-25a3bf57.js.map +1 -0
- package/dist/ui-library/p-28e6c2eb.entry.js +2 -0
- package/dist/ui-library/p-28e6c2eb.entry.js.map +1 -0
- package/dist/ui-library/p-2a02734a.entry.js +2 -0
- package/dist/ui-library/p-2a02734a.entry.js.map +1 -0
- package/dist/ui-library/p-2a61cc66.entry.js +2 -0
- package/dist/ui-library/p-2a61cc66.entry.js.map +1 -0
- package/dist/ui-library/p-3c100309.js +2 -0
- package/dist/ui-library/p-3c100309.js.map +1 -0
- package/dist/ui-library/p-3d5cad2d.entry.js +2 -0
- package/dist/ui-library/p-3d5cad2d.entry.js.map +1 -0
- package/dist/ui-library/p-3e3edcbc.entry.js +2 -0
- package/dist/ui-library/p-3e3edcbc.entry.js.map +1 -0
- package/dist/ui-library/p-3efe46cf.entry.js +2 -0
- package/dist/ui-library/p-3efe46cf.entry.js.map +1 -0
- package/dist/ui-library/p-4b44fa83.entry.js +2 -0
- package/dist/ui-library/p-4b44fa83.entry.js.map +1 -0
- package/dist/ui-library/p-4bcebd5a.entry.js +2 -0
- package/dist/ui-library/p-4bcebd5a.entry.js.map +1 -0
- package/dist/ui-library/p-4d4829db.entry.js +2 -0
- package/dist/ui-library/p-4d4829db.entry.js.map +1 -0
- package/dist/ui-library/p-4f8394d7.js +2 -0
- package/dist/ui-library/p-4f8394d7.js.map +1 -0
- package/dist/ui-library/p-524e5804.entry.js +2 -0
- package/dist/ui-library/p-524e5804.entry.js.map +1 -0
- package/dist/ui-library/p-52cb61bd.entry.js +2 -0
- package/dist/ui-library/p-52cb61bd.entry.js.map +1 -0
- package/dist/ui-library/p-55dc28ad.entry.js +2 -0
- package/dist/ui-library/p-55dc28ad.entry.js.map +1 -0
- package/dist/ui-library/p-57a84d7f.entry.js +2 -0
- package/dist/ui-library/p-57a84d7f.entry.js.map +1 -0
- package/dist/ui-library/p-5eb21538.entry.js +2 -0
- package/dist/ui-library/p-5eb21538.entry.js.map +1 -0
- package/dist/ui-library/p-60c5395c.entry.js +2 -0
- package/dist/ui-library/p-60c5395c.entry.js.map +1 -0
- package/dist/ui-library/p-694829b8.entry.js +2 -0
- package/dist/ui-library/p-694829b8.entry.js.map +1 -0
- package/dist/ui-library/p-6cc82df5.entry.js +2 -0
- package/dist/ui-library/p-6cc82df5.entry.js.map +1 -0
- package/dist/ui-library/p-7115416e.entry.js +2 -0
- package/dist/ui-library/p-7115416e.entry.js.map +1 -0
- package/dist/ui-library/p-788281d0.entry.js +2 -0
- package/dist/ui-library/p-788281d0.entry.js.map +1 -0
- package/dist/ui-library/p-7cbc261b.entry.js +2 -0
- package/dist/ui-library/p-7cbc261b.entry.js.map +1 -0
- package/dist/ui-library/p-80f32909.entry.js +2 -0
- package/dist/ui-library/p-80f32909.entry.js.map +1 -0
- package/dist/ui-library/p-8187701c.entry.js +2 -0
- package/dist/ui-library/p-8187701c.entry.js.map +1 -0
- package/dist/ui-library/p-94ab37b2.entry.js +2 -0
- package/dist/ui-library/p-94ab37b2.entry.js.map +1 -0
- package/dist/ui-library/p-9a860acc.js +2 -0
- package/dist/ui-library/p-9a860acc.js.map +1 -0
- package/dist/ui-library/p-9eba5c71.entry.js +2 -0
- package/dist/ui-library/p-9eba5c71.entry.js.map +1 -0
- package/dist/ui-library/p-9f9bef35.entry.js +2 -0
- package/dist/ui-library/p-9f9bef35.entry.js.map +1 -0
- package/dist/ui-library/p-b1683e9c.entry.js +2 -0
- package/dist/ui-library/p-b1683e9c.entry.js.map +1 -0
- package/dist/ui-library/p-b1e66136.js +2 -0
- package/dist/ui-library/p-b1e66136.js.map +1 -0
- package/dist/ui-library/p-b3974ad4.entry.js +2 -0
- package/dist/ui-library/p-b3974ad4.entry.js.map +1 -0
- package/dist/ui-library/p-b4dfb7cf.js +2 -0
- package/dist/ui-library/p-b4dfb7cf.js.map +1 -0
- package/dist/ui-library/p-b66c5c48.entry.js +2 -0
- package/dist/ui-library/p-b66c5c48.entry.js.map +1 -0
- package/dist/ui-library/p-ba6e1f0e.entry.js +2 -0
- package/dist/ui-library/p-ba6e1f0e.entry.js.map +1 -0
- package/dist/ui-library/p-c799a6bf.entry.js +2 -0
- package/dist/ui-library/p-c799a6bf.entry.js.map +1 -0
- package/dist/ui-library/p-ccee090e.entry.js +2 -0
- package/dist/ui-library/p-ccee090e.entry.js.map +1 -0
- package/dist/ui-library/p-cf2bdd34.entry.js +2 -0
- package/dist/ui-library/p-cf2bdd34.entry.js.map +1 -0
- package/dist/ui-library/p-d12c6092.js +2 -0
- package/dist/ui-library/p-d12c6092.js.map +1 -0
- package/dist/ui-library/p-dd0ac344.entry.js +2 -0
- package/dist/ui-library/p-dd0ac344.entry.js.map +1 -0
- package/dist/ui-library/p-def4a925.entry.js +2 -0
- package/dist/ui-library/p-def4a925.entry.js.map +1 -0
- package/dist/ui-library/p-e0bda772.entry.js +2 -0
- package/dist/ui-library/p-e0bda772.entry.js.map +1 -0
- package/dist/ui-library/p-e1aed7ed.entry.js +2 -0
- package/dist/ui-library/p-e1aed7ed.entry.js.map +1 -0
- package/dist/ui-library/p-e4b6264b.entry.js +2 -0
- package/dist/ui-library/p-e4b6264b.entry.js.map +1 -0
- package/dist/ui-library/p-eb1ec1b7.entry.js +2 -0
- package/dist/ui-library/p-eb1ec1b7.entry.js.map +1 -0
- package/dist/ui-library/p-eb8f05a9.js +2 -0
- package/dist/ui-library/p-eb8f05a9.js.map +1 -0
- package/dist/ui-library/p-f65aa796.entry.js +2 -0
- package/dist/ui-library/p-f65aa796.entry.js.map +1 -0
- package/dist/ui-library/p-f68b5c54.entry.js +2 -0
- package/dist/ui-library/p-f68b5c54.entry.js.map +1 -0
- package/dist/ui-library/p-f9c50f81.entry.js +2 -0
- package/dist/ui-library/p-f9c50f81.entry.js.map +1 -0
- 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/types-65e5c95b.js +0 -15
- package/dist/custom-elements/index.d.ts +0 -387
- package/dist/esm/types-33d15673.js +0 -15
- package/dist/ui-library/p-044c6bf9.js +0 -1
- package/dist/ui-library/p-0493c926.entry.js +0 -1
- package/dist/ui-library/p-1005d1a8.entry.js +0 -1
- package/dist/ui-library/p-12cc24c3.js +0 -1
- package/dist/ui-library/p-191f958b.js +0 -1
- package/dist/ui-library/p-19543c96.entry.js +0 -1
- package/dist/ui-library/p-19ff1079.entry.js +0 -1
- package/dist/ui-library/p-1b92cc7a.entry.js +0 -1
- package/dist/ui-library/p-1c9f0dc6.js +0 -1
- package/dist/ui-library/p-2053c61a.entry.js +0 -1
- package/dist/ui-library/p-2ff97cdf.entry.js +0 -1
- package/dist/ui-library/p-30ebc1e7.js +0 -1
- package/dist/ui-library/p-34e6d8e8.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-48ea4419.entry.js +0 -1
- package/dist/ui-library/p-4cc01afc.entry.js +0 -1
- package/dist/ui-library/p-572e3690.js +0 -1
- package/dist/ui-library/p-5ead7b2f.entry.js +0 -1
- package/dist/ui-library/p-60491176.entry.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-68d31736.js +0 -1
- package/dist/ui-library/p-6a4f0542.entry.js +0 -1
- package/dist/ui-library/p-6f67f986.entry.js +0 -1
- package/dist/ui-library/p-76bfa55f.entry.js +0 -1
- package/dist/ui-library/p-7735d99f.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-89f68e76.entry.js +0 -1
- package/dist/ui-library/p-8bd0873f.entry.js +0 -1
- package/dist/ui-library/p-8e8e922b.entry.js +0 -1
- package/dist/ui-library/p-968c5169.entry.js +0 -1
- package/dist/ui-library/p-9f2dc381.entry.js +0 -1
- package/dist/ui-library/p-a77a6442.entry.js +0 -1
- package/dist/ui-library/p-a8c225f2.entry.js +0 -1
- package/dist/ui-library/p-a98198bd.entry.js +0 -1
- package/dist/ui-library/p-af3d757c.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-b9fb8455.entry.js +0 -1
- package/dist/ui-library/p-bf110ea9.entry.js +0 -1
- package/dist/ui-library/p-c09dc3a9.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-c733dead.js +0 -1
- package/dist/ui-library/p-c948d3db.entry.js +0 -1
- package/dist/ui-library/p-ce02c34f.entry.js +0 -1
- package/dist/ui-library/p-d724bbc9.entry.js +0 -1
- package/dist/ui-library/p-e96dcf96.entry.js +0 -1
- package/dist/ui-library/p-ea1fcff2.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-ebaea182.entry.js +0 -1
- package/dist/ui-library/p-ec1ecc2a.entry.js +0 -1
- package/dist/ui-library/p-ed21cc57.entry.js +0 -1
- package/dist/ui-library/p-f00c1783.entry.js +0 -1
- package/dist/ui-library/p-f0e91e17.entry.js +0 -1
- package/dist/ui-library/p-f9c0cfb7.entry.js +0 -1
- package/dist/ui-library/p-fcd2356c.entry.js +0 -1
- package/dist/ui-library/p-fdb455d7.entry.js +0 -1
|
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'ui-library';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
+
* Simon Friis Vindum (@paldepind)
|
|
28
|
+
* Licensed under the MIT License
|
|
29
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
+
*
|
|
31
|
+
* Modified for Stencil's renderer and slot projection
|
|
32
|
+
*/
|
|
25
33
|
let scopeId;
|
|
26
34
|
let contentRef;
|
|
27
35
|
let hostTagName;
|
|
@@ -30,62 +38,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
30
38
|
let checkSlotRelocate = false;
|
|
31
39
|
let isSvgMode = false;
|
|
32
40
|
let queuePending = false;
|
|
33
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
34
|
-
const doc = win.document || { head: {} };
|
|
35
|
-
const plt = {
|
|
36
|
-
$flags$: 0,
|
|
37
|
-
$resourcesUrl$: '',
|
|
38
|
-
jmp: (h) => h(),
|
|
39
|
-
raf: (h) => requestAnimationFrame(h),
|
|
40
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
41
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
42
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
43
|
-
};
|
|
44
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
45
|
-
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
46
|
-
try {
|
|
47
|
-
new CSSStyleSheet();
|
|
48
|
-
return typeof new CSSStyleSheet().replace === 'function';
|
|
49
|
-
}
|
|
50
|
-
catch (e) { }
|
|
51
|
-
return false;
|
|
52
|
-
})()
|
|
53
|
-
;
|
|
54
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
55
|
-
if (listeners) {
|
|
56
|
-
listeners.map(([flags, name, method]) => {
|
|
57
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
58
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
59
|
-
const opts = hostListenerOpts(flags);
|
|
60
|
-
plt.ael(target, name, handler, opts);
|
|
61
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
66
|
-
try {
|
|
67
|
-
{
|
|
68
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
69
|
-
// instance is ready, let's call it's member method for this event
|
|
70
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
consoleError(e);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
82
|
-
if (flags & 8 /* TargetWindow */)
|
|
83
|
-
return win;
|
|
84
|
-
return elm;
|
|
85
|
-
};
|
|
86
|
-
// prettier-ignore
|
|
87
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
88
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
89
41
|
const createTime = (fnName, tagName = '') => {
|
|
90
42
|
{
|
|
91
43
|
return () => {
|
|
@@ -100,74 +52,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
100
52
|
};
|
|
101
53
|
}
|
|
102
54
|
};
|
|
103
|
-
const
|
|
104
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
105
|
-
let style = styles.get(scopeId);
|
|
106
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
107
|
-
style = (style || new CSSStyleSheet());
|
|
108
|
-
style.replace(cssText);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
style = cssText;
|
|
112
|
-
}
|
|
113
|
-
styles.set(scopeId, style);
|
|
114
|
-
};
|
|
115
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
116
|
-
let scopeId = getScopeId(cmpMeta);
|
|
117
|
-
let style = styles.get(scopeId);
|
|
118
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
119
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
120
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
121
|
-
if (style) {
|
|
122
|
-
if (typeof style === 'string') {
|
|
123
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
124
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
125
|
-
let styleElm;
|
|
126
|
-
if (!appliedStyles) {
|
|
127
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
128
|
-
}
|
|
129
|
-
if (!appliedStyles.has(scopeId)) {
|
|
130
|
-
{
|
|
131
|
-
{
|
|
132
|
-
styleElm = doc.createElement('style');
|
|
133
|
-
styleElm.innerHTML = style;
|
|
134
|
-
}
|
|
135
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
136
|
-
}
|
|
137
|
-
if (appliedStyles) {
|
|
138
|
-
appliedStyles.add(scopeId);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
143
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return scopeId;
|
|
147
|
-
};
|
|
148
|
-
const attachStyles = (hostRef) => {
|
|
149
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
150
|
-
const elm = hostRef.$hostElement$;
|
|
151
|
-
const flags = cmpMeta.$flags$;
|
|
152
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
153
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
154
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
155
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
156
|
-
// or this browser doesn't support native shadow dom
|
|
157
|
-
// and this host element was NOT created with SSR
|
|
158
|
-
// let's pick out the inner content for slot projection
|
|
159
|
-
// create a node to represent where the original
|
|
160
|
-
// content was first placed, which is useful later on
|
|
161
|
-
// DOM WRITE!!
|
|
162
|
-
elm['s-sc'] = scopeId;
|
|
163
|
-
elm.classList.add(scopeId + '-h');
|
|
164
|
-
if (flags & 2 /* scopedCssEncapsulation */) {
|
|
165
|
-
elm.classList.add(scopeId + '-s');
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
endAttachStyles();
|
|
169
|
-
};
|
|
170
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
55
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
171
56
|
/**
|
|
172
57
|
* Default style mode id
|
|
173
58
|
*/
|
|
@@ -182,11 +67,30 @@ const EMPTY_OBJ = {};
|
|
|
182
67
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
183
68
|
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
184
69
|
const isDef = (v) => v != null;
|
|
70
|
+
/**
|
|
71
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
72
|
+
* function.
|
|
73
|
+
*
|
|
74
|
+
* @param o the value to check
|
|
75
|
+
* @returns whether it's a complex type or not
|
|
76
|
+
*/
|
|
185
77
|
const isComplexType = (o) => {
|
|
186
78
|
// https://jsperf.com/typeof-fn-object/5
|
|
187
79
|
o = typeof o;
|
|
188
80
|
return o === 'object' || o === 'function';
|
|
189
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
84
|
+
* out of a DOM's head.
|
|
85
|
+
*
|
|
86
|
+
* @param doc The DOM containing the `head` to query against
|
|
87
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
88
|
+
* exists or the tag has no content.
|
|
89
|
+
*/
|
|
90
|
+
function queryNonceMetaTagContent(doc) {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
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;
|
|
93
|
+
}
|
|
190
94
|
/**
|
|
191
95
|
* Production h() function based on Preact by
|
|
192
96
|
* Jason Miller (@developit)
|
|
@@ -195,7 +99,6 @@ const isComplexType = (o) => {
|
|
|
195
99
|
*
|
|
196
100
|
* Modified for Stencil's compiler and vdom
|
|
197
101
|
*/
|
|
198
|
-
// const stack: any[] = [];
|
|
199
102
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
200
103
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
201
104
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -204,7 +107,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
204
107
|
let slotName = null;
|
|
205
108
|
let simple = false;
|
|
206
109
|
let lastSimple = false;
|
|
207
|
-
|
|
110
|
+
const vNodeChildren = [];
|
|
208
111
|
const walk = (c) => {
|
|
209
112
|
for (let i = 0; i < c.length; i++) {
|
|
210
113
|
child = c[i];
|
|
@@ -265,6 +168,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
265
168
|
}
|
|
266
169
|
return vnode;
|
|
267
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
173
|
+
* possible text content.
|
|
174
|
+
*
|
|
175
|
+
* @param tag the tag for this element
|
|
176
|
+
* @param text possible text content for the node
|
|
177
|
+
* @returns a newly-minted virtual DOM node
|
|
178
|
+
*/
|
|
268
179
|
const newVNode = (tag, text) => {
|
|
269
180
|
const vnode = {
|
|
270
181
|
$flags$: 0,
|
|
@@ -285,11 +196,31 @@ const newVNode = (tag, text) => {
|
|
|
285
196
|
return vnode;
|
|
286
197
|
};
|
|
287
198
|
const Host = {};
|
|
199
|
+
/**
|
|
200
|
+
* Check whether a given node is a Host node or not
|
|
201
|
+
*
|
|
202
|
+
* @param node the virtual DOM node to check
|
|
203
|
+
* @returns whether it's a Host node or not
|
|
204
|
+
*/
|
|
288
205
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
206
|
+
/**
|
|
207
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
208
|
+
*
|
|
209
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
210
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
211
|
+
* interface.
|
|
212
|
+
*/
|
|
289
213
|
const vdomFnUtils = {
|
|
290
214
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
291
215
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
292
216
|
};
|
|
217
|
+
/**
|
|
218
|
+
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
219
|
+
* friendlier public interface (hence, 'convertToPublic').
|
|
220
|
+
*
|
|
221
|
+
* @param node the virtual DOM node to convert
|
|
222
|
+
* @returns a converted child node
|
|
223
|
+
*/
|
|
293
224
|
const convertToPublic = (node) => ({
|
|
294
225
|
vattrs: node.$attrs$,
|
|
295
226
|
vchildren: node.$children$,
|
|
@@ -298,6 +229,15 @@ const convertToPublic = (node) => ({
|
|
|
298
229
|
vtag: node.$tag$,
|
|
299
230
|
vtext: node.$text$,
|
|
300
231
|
});
|
|
232
|
+
/**
|
|
233
|
+
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
234
|
+
* order to use the resulting object in the virtual DOM. The initial object was
|
|
235
|
+
* likely created as part of presenting a public API, so converting it back
|
|
236
|
+
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
237
|
+
*
|
|
238
|
+
* @param node the child node to convert
|
|
239
|
+
* @returns a converted virtual DOM node
|
|
240
|
+
*/
|
|
301
241
|
const convertToPrivate = (node) => {
|
|
302
242
|
if (typeof node.vtag === 'function') {
|
|
303
243
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -316,6 +256,160 @@ const convertToPrivate = (node) => {
|
|
|
316
256
|
vnode.$name$ = node.vname;
|
|
317
257
|
return vnode;
|
|
318
258
|
};
|
|
259
|
+
/**
|
|
260
|
+
* Parse a new property value for a given property type.
|
|
261
|
+
*
|
|
262
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
263
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
264
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
265
|
+
* 2. the type stored from `propType`.
|
|
266
|
+
*
|
|
267
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
268
|
+
*
|
|
269
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
270
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
271
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
272
|
+
* ```tsx
|
|
273
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
274
|
+
* ```
|
|
275
|
+
*
|
|
276
|
+
* HTML prop values on the other hand, will always a string
|
|
277
|
+
*
|
|
278
|
+
* @param propValue the new value to coerce to some type
|
|
279
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
280
|
+
* @returns the parsed/coerced value
|
|
281
|
+
*/
|
|
282
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
283
|
+
// ensure this value is of the correct prop type
|
|
284
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
285
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
286
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
287
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
288
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
289
|
+
}
|
|
290
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
291
|
+
// force it to be a number
|
|
292
|
+
return parseFloat(propValue);
|
|
293
|
+
}
|
|
294
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
295
|
+
// could have been passed as a number or boolean
|
|
296
|
+
// but we still want it as a string
|
|
297
|
+
return String(propValue);
|
|
298
|
+
}
|
|
299
|
+
// redundant return here for better minification
|
|
300
|
+
return propValue;
|
|
301
|
+
}
|
|
302
|
+
// not sure exactly what type we want
|
|
303
|
+
// so no need to change to a different type
|
|
304
|
+
return propValue;
|
|
305
|
+
};
|
|
306
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
307
|
+
const createEvent = (ref, name, flags) => {
|
|
308
|
+
const elm = getElement(ref);
|
|
309
|
+
return {
|
|
310
|
+
emit: (detail) => {
|
|
311
|
+
return emitEvent(elm, name, {
|
|
312
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
313
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
314
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
315
|
+
detail,
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
322
|
+
* @param elm the target of the Event
|
|
323
|
+
* @param name the name to give the custom Event
|
|
324
|
+
* @param opts options for configuring a custom Event
|
|
325
|
+
* @returns the custom Event
|
|
326
|
+
*/
|
|
327
|
+
const emitEvent = (elm, name, opts) => {
|
|
328
|
+
const ev = plt.ce(name, opts);
|
|
329
|
+
elm.dispatchEvent(ev);
|
|
330
|
+
return ev;
|
|
331
|
+
};
|
|
332
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
333
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
334
|
+
let style = styles.get(scopeId);
|
|
335
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
336
|
+
style = (style || new CSSStyleSheet());
|
|
337
|
+
if (typeof style === 'string') {
|
|
338
|
+
style = cssText;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
style.replaceSync(cssText);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
style = cssText;
|
|
346
|
+
}
|
|
347
|
+
styles.set(scopeId, style);
|
|
348
|
+
};
|
|
349
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
350
|
+
var _a;
|
|
351
|
+
let scopeId = getScopeId(cmpMeta);
|
|
352
|
+
const style = styles.get(scopeId);
|
|
353
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
354
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
355
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
356
|
+
if (style) {
|
|
357
|
+
if (typeof style === 'string') {
|
|
358
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
359
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
360
|
+
let styleElm;
|
|
361
|
+
if (!appliedStyles) {
|
|
362
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
363
|
+
}
|
|
364
|
+
if (!appliedStyles.has(scopeId)) {
|
|
365
|
+
{
|
|
366
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
|
367
|
+
{
|
|
368
|
+
styleElm = doc.createElement('style');
|
|
369
|
+
styleElm.innerHTML = style;
|
|
370
|
+
}
|
|
371
|
+
// Apply CSP nonce to the style tag if it exists
|
|
372
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
373
|
+
if (nonce != null) {
|
|
374
|
+
styleElm.setAttribute('nonce', nonce);
|
|
375
|
+
}
|
|
376
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
377
|
+
}
|
|
378
|
+
if (appliedStyles) {
|
|
379
|
+
appliedStyles.add(scopeId);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
384
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return scopeId;
|
|
388
|
+
};
|
|
389
|
+
const attachStyles = (hostRef) => {
|
|
390
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
391
|
+
const elm = hostRef.$hostElement$;
|
|
392
|
+
const flags = cmpMeta.$flags$;
|
|
393
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
394
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
395
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
396
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
397
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
398
|
+
// or this browser doesn't support native shadow dom
|
|
399
|
+
// and this host element was NOT created with SSR
|
|
400
|
+
// let's pick out the inner content for slot projection
|
|
401
|
+
// create a node to represent where the original
|
|
402
|
+
// content was first placed, which is useful later on
|
|
403
|
+
// DOM WRITE!!
|
|
404
|
+
elm['s-sc'] = scopeId;
|
|
405
|
+
elm.classList.add(scopeId + '-h');
|
|
406
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
407
|
+
elm.classList.add(scopeId + '-s');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
endAttachStyles();
|
|
411
|
+
};
|
|
412
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
319
413
|
/**
|
|
320
414
|
* Production setAccessor() function based on Preact by
|
|
321
415
|
* Jason Miller (@developit)
|
|
@@ -413,7 +507,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
413
507
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
414
508
|
try {
|
|
415
509
|
if (!elm.tagName.includes('-')) {
|
|
416
|
-
|
|
510
|
+
const n = newValue == null ? '' : newValue;
|
|
417
511
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
418
512
|
if (memberName === 'list') {
|
|
419
513
|
isProp = false;
|
|
@@ -435,7 +529,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
435
529
|
}
|
|
436
530
|
}
|
|
437
531
|
}
|
|
438
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
532
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
439
533
|
newValue = newValue === true ? '' : newValue;
|
|
440
534
|
{
|
|
441
535
|
elm.setAttribute(memberName, newValue);
|
|
@@ -450,7 +544,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
450
544
|
// if the element passed in is a shadow root, which is a document fragment
|
|
451
545
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
452
546
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
453
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
547
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
454
548
|
? newVnode.$elm$.host
|
|
455
549
|
: newVnode.$elm$;
|
|
456
550
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -468,9 +562,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
468
562
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
469
563
|
}
|
|
470
564
|
};
|
|
565
|
+
/**
|
|
566
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
567
|
+
*
|
|
568
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
569
|
+
* @param newParentVNode the parent VNode from the current render
|
|
570
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
571
|
+
* children, for which we will create a new DOM node
|
|
572
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
573
|
+
* @returns the newly created node
|
|
574
|
+
*/
|
|
471
575
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
472
576
|
// tslint:disable-next-line: prefer-const
|
|
473
|
-
|
|
577
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
474
578
|
let i = 0;
|
|
475
579
|
let elm;
|
|
476
580
|
let childNode;
|
|
@@ -485,16 +589,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
485
589
|
}
|
|
486
590
|
newVNode.$flags$ |= newVNode.$children$
|
|
487
591
|
? // slot element has fallback content
|
|
488
|
-
2 /* isSlotFallback */
|
|
592
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
489
593
|
: // slot element does not have fallback content
|
|
490
|
-
1 /* isSlotReference */;
|
|
594
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
491
595
|
}
|
|
492
596
|
}
|
|
493
597
|
if (newVNode.$text$ !== null) {
|
|
494
598
|
// create text node
|
|
495
599
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
496
600
|
}
|
|
497
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
601
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
498
602
|
// create a slot reference node
|
|
499
603
|
elm = newVNode.$elm$ =
|
|
500
604
|
doc.createTextNode('');
|
|
@@ -504,7 +608,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
504
608
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
505
609
|
}
|
|
506
610
|
// create element
|
|
507
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
611
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
508
612
|
? 'slot-fb'
|
|
509
613
|
: newVNode.$tag$)
|
|
510
614
|
);
|
|
@@ -544,7 +648,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
544
648
|
}
|
|
545
649
|
{
|
|
546
650
|
elm['s-hn'] = hostTagName;
|
|
547
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
651
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
548
652
|
// remember the content reference comment
|
|
549
653
|
elm['s-sr'] = true;
|
|
550
654
|
// remember the content reference comment
|
|
@@ -563,7 +667,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
563
667
|
return elm;
|
|
564
668
|
};
|
|
565
669
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
566
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
670
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
567
671
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
568
672
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
569
673
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -584,8 +688,23 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
584
688
|
putBackInOriginalLocation(childNode, recursive);
|
|
585
689
|
}
|
|
586
690
|
}
|
|
587
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
691
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
588
692
|
};
|
|
693
|
+
/**
|
|
694
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
695
|
+
* add them to the DOM in the appropriate place.
|
|
696
|
+
*
|
|
697
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
698
|
+
* DOM nodes
|
|
699
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
700
|
+
* inserted before (optional)
|
|
701
|
+
* @param parentVNode the parent virtual DOM node
|
|
702
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
703
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
704
|
+
* creating DOM nodes (inclusive)
|
|
705
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
706
|
+
* creating DOM nodes (inclusive)
|
|
707
|
+
*/
|
|
589
708
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
590
709
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
591
710
|
let childNode;
|
|
@@ -602,6 +721,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
602
721
|
}
|
|
603
722
|
}
|
|
604
723
|
};
|
|
724
|
+
/**
|
|
725
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
726
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
727
|
+
* should no longer be shown.
|
|
728
|
+
*
|
|
729
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
730
|
+
*
|
|
731
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
732
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
733
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
734
|
+
* @param vnode a VNode
|
|
735
|
+
* @param elm an element
|
|
736
|
+
*/
|
|
605
737
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
606
738
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
607
739
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -626,6 +758,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
626
758
|
}
|
|
627
759
|
}
|
|
628
760
|
};
|
|
761
|
+
/**
|
|
762
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
763
|
+
* traversing the two collections of children, identifying nodes that are
|
|
764
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
765
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
766
|
+
*
|
|
767
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
768
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
769
|
+
* 'windows' by storing start and end indices and references to the
|
|
770
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
771
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
772
|
+
* no children left to update by doing the following:
|
|
773
|
+
*
|
|
774
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
775
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
776
|
+
* only with a window bounded by the highlighted elements:
|
|
777
|
+
*
|
|
778
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
779
|
+
* ^^^^^^ ^^^^^^
|
|
780
|
+
*
|
|
781
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
782
|
+
* across the windows. This will basically detect elements which haven't
|
|
783
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
784
|
+
* VNode elements (represented as HTML):
|
|
785
|
+
*
|
|
786
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
787
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
788
|
+
*
|
|
789
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
790
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
791
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
792
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
793
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
794
|
+
*
|
|
795
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
796
|
+
* window corresponds to the element at the end of the other window. This is
|
|
797
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
798
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
799
|
+
* children nodes themselves have not changed but merely moved in the
|
|
800
|
+
* following example:
|
|
801
|
+
*
|
|
802
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
803
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
804
|
+
*
|
|
805
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
806
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
807
|
+
* DOM.
|
|
808
|
+
*
|
|
809
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
810
|
+
* nodes in the old children which have the same key as the first element in
|
|
811
|
+
* our window on the new children. If we find such a node we handle calling
|
|
812
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
813
|
+
* what we find.
|
|
814
|
+
*
|
|
815
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
816
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
817
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
818
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
819
|
+
* children has collapsed we still have more nodes on the new children that
|
|
820
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
821
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
822
|
+
* sure the corresponding DOM nodes are removed.
|
|
823
|
+
*
|
|
824
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
825
|
+
* @param oldCh the old children of the parent node
|
|
826
|
+
* @param newVNode the new VNode which will replace the parent
|
|
827
|
+
* @param newCh the new children of the parent node
|
|
828
|
+
*/
|
|
629
829
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
630
830
|
let oldStartIdx = 0;
|
|
631
831
|
let newStartIdx = 0;
|
|
@@ -641,7 +841,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
641
841
|
let elmToMove;
|
|
642
842
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
643
843
|
if (oldStartVnode == null) {
|
|
644
|
-
//
|
|
844
|
+
// VNode might have been moved left
|
|
645
845
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
646
846
|
}
|
|
647
847
|
else if (oldEndVnode == null) {
|
|
@@ -654,37 +854,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
654
854
|
newEndVnode = newCh[--newEndIdx];
|
|
655
855
|
}
|
|
656
856
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
857
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
858
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
859
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
860
|
+
// since things are matched up in order.
|
|
657
861
|
patch(oldStartVnode, newStartVnode);
|
|
658
862
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
659
863
|
newStartVnode = newCh[++newStartIdx];
|
|
660
864
|
}
|
|
661
865
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
866
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
867
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
868
|
+
// need to move any DOM Nodes.
|
|
662
869
|
patch(oldEndVnode, newEndVnode);
|
|
663
870
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
664
871
|
newEndVnode = newCh[--newEndIdx];
|
|
665
872
|
}
|
|
666
873
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
667
|
-
// Vnode moved right
|
|
874
|
+
// case: "Vnode moved right"
|
|
875
|
+
//
|
|
876
|
+
// We've found that the last node in our window on the new children is
|
|
877
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
878
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
879
|
+
// nodes:
|
|
880
|
+
//
|
|
881
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
882
|
+
// ^^^^^^^^^^^
|
|
883
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
884
|
+
// ^^^^^^^^^^^^^
|
|
885
|
+
//
|
|
886
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
887
|
+
// and move the DOM element for `oldStartVnode`.
|
|
668
888
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
669
889
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
670
890
|
}
|
|
671
891
|
patch(oldStartVnode, newEndVnode);
|
|
892
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
893
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
894
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
895
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
896
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
897
|
+
//
|
|
898
|
+
// <old-start-node />
|
|
899
|
+
// <some-intervening-node />
|
|
900
|
+
// <old-end-node />
|
|
901
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
902
|
+
// <next-sibling />
|
|
903
|
+
//
|
|
904
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
905
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
906
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
907
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
908
|
+
// append it to the children of the parent element.
|
|
672
909
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
673
910
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
674
911
|
newEndVnode = newCh[--newEndIdx];
|
|
675
912
|
}
|
|
676
913
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
677
|
-
// Vnode moved left
|
|
914
|
+
// case: "Vnode moved left"
|
|
915
|
+
//
|
|
916
|
+
// We've found that the first node in our window on the new children is
|
|
917
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
918
|
+
// Visually, this is the layout of these two nodes:
|
|
919
|
+
//
|
|
920
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
921
|
+
// ^^^^^^^^^^^^^
|
|
922
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
923
|
+
// ^^^^^^^^^^^
|
|
924
|
+
//
|
|
925
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
926
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
927
|
+
// children etc) but we also need to move the DOM node to which
|
|
928
|
+
// `oldEndVnode` corresponds.
|
|
678
929
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
679
930
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
680
931
|
}
|
|
681
932
|
patch(oldEndVnode, newStartVnode);
|
|
933
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
934
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
935
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
936
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
937
|
+
// future.
|
|
682
938
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
683
939
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
684
940
|
newStartVnode = newCh[++newStartIdx];
|
|
685
941
|
}
|
|
686
942
|
else {
|
|
687
|
-
//
|
|
943
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
944
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
945
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
946
|
+
// component.
|
|
947
|
+
//
|
|
948
|
+
// First we check to see if there are any nodes in the array of old
|
|
949
|
+
// children which have the same key as the first node in the new
|
|
950
|
+
// children.
|
|
688
951
|
idxInOld = -1;
|
|
689
952
|
{
|
|
690
953
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -695,23 +958,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
695
958
|
}
|
|
696
959
|
}
|
|
697
960
|
if (idxInOld >= 0) {
|
|
961
|
+
// We found a node in the old children which matches up with the first
|
|
962
|
+
// node in the new children! So let's deal with that
|
|
698
963
|
elmToMove = oldCh[idxInOld];
|
|
699
964
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
965
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
700
966
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
701
967
|
}
|
|
702
968
|
else {
|
|
703
969
|
patch(elmToMove, newStartVnode);
|
|
970
|
+
// invalidate the matching old node so that we won't try to update it
|
|
971
|
+
// again later on
|
|
704
972
|
oldCh[idxInOld] = undefined;
|
|
705
973
|
node = elmToMove.$elm$;
|
|
706
974
|
}
|
|
707
975
|
newStartVnode = newCh[++newStartIdx];
|
|
708
976
|
}
|
|
709
977
|
else {
|
|
710
|
-
//
|
|
978
|
+
// We either didn't find an element in the old children that matches
|
|
979
|
+
// the key of the first new child OR the build is not using `key`
|
|
980
|
+
// attributes at all. In either case we need to create a new element
|
|
981
|
+
// for the new node.
|
|
711
982
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
712
983
|
newStartVnode = newCh[++newStartIdx];
|
|
713
984
|
}
|
|
714
985
|
if (node) {
|
|
986
|
+
// if we created a new node then handle inserting it to the DOM
|
|
715
987
|
{
|
|
716
988
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
717
989
|
}
|
|
@@ -719,21 +991,44 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
719
991
|
}
|
|
720
992
|
}
|
|
721
993
|
if (oldStartIdx > oldEndIdx) {
|
|
994
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
722
995
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
723
996
|
}
|
|
724
997
|
else if (newStartIdx > newEndIdx) {
|
|
998
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
999
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
1000
|
+
// relevant DOM nodes)
|
|
725
1001
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
726
1002
|
}
|
|
727
1003
|
};
|
|
728
|
-
|
|
1004
|
+
/**
|
|
1005
|
+
* Compare two VNodes to determine if they are the same
|
|
1006
|
+
*
|
|
1007
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
1008
|
+
* information set on the two VNodes and can be misleading under certain
|
|
1009
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
1010
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
1011
|
+
* checking that they have the same tag.
|
|
1012
|
+
*
|
|
1013
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
1014
|
+
* changing order within a `children` array or something along those lines then
|
|
1015
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
1016
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
1017
|
+
*
|
|
1018
|
+
* @param leftVNode the first VNode to check
|
|
1019
|
+
* @param rightVNode the second VNode to check
|
|
1020
|
+
* @returns whether they're equal or not
|
|
1021
|
+
*/
|
|
1022
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
729
1023
|
// compare if two vnode to see if they're "technically" the same
|
|
730
1024
|
// need to have the same element tag, and same key to be the same
|
|
731
|
-
if (
|
|
732
|
-
if (
|
|
733
|
-
return
|
|
1025
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1026
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
1027
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
734
1028
|
}
|
|
1029
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
735
1030
|
{
|
|
736
|
-
return
|
|
1031
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
737
1032
|
}
|
|
738
1033
|
}
|
|
739
1034
|
return false;
|
|
@@ -746,6 +1041,14 @@ const referenceNode = (node) => {
|
|
|
746
1041
|
return (node && node['s-ol']) || node;
|
|
747
1042
|
};
|
|
748
1043
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
1044
|
+
/**
|
|
1045
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1046
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1047
|
+
* children of the two nodes (if any).
|
|
1048
|
+
*
|
|
1049
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1050
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
1051
|
+
*/
|
|
749
1052
|
const patch = (oldVNode, newVNode) => {
|
|
750
1053
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
751
1054
|
const oldChildren = oldVNode.$children$;
|
|
@@ -759,7 +1062,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
759
1062
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
760
1063
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
761
1064
|
}
|
|
762
|
-
// element node
|
|
763
1065
|
{
|
|
764
1066
|
if (tag === 'slot')
|
|
765
1067
|
;
|
|
@@ -772,6 +1074,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
772
1074
|
}
|
|
773
1075
|
if (oldChildren !== null && newChildren !== null) {
|
|
774
1076
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1077
|
+
// so we need to call `updateChildren` to reconcile them
|
|
775
1078
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
776
1079
|
}
|
|
777
1080
|
else if (newChildren !== null) {
|
|
@@ -803,7 +1106,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
803
1106
|
};
|
|
804
1107
|
const updateFallbackSlotVisibility = (elm) => {
|
|
805
1108
|
// tslint:disable-next-line: prefer-const
|
|
806
|
-
|
|
1109
|
+
const childNodes = elm.childNodes;
|
|
807
1110
|
let childNode;
|
|
808
1111
|
let i;
|
|
809
1112
|
let ilen;
|
|
@@ -812,7 +1115,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
812
1115
|
let nodeType;
|
|
813
1116
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
814
1117
|
childNode = childNodes[i];
|
|
815
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1118
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
816
1119
|
if (childNode['s-sr']) {
|
|
817
1120
|
// this is a slot fallback node
|
|
818
1121
|
// get the slot name for this slot reference node
|
|
@@ -824,7 +1127,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
824
1127
|
nodeType = childNodes[j].nodeType;
|
|
825
1128
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
826
1129
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
827
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1130
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
828
1131
|
childNode.hidden = true;
|
|
829
1132
|
break;
|
|
830
1133
|
}
|
|
@@ -833,8 +1136,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
833
1136
|
// this is a default fallback slot node
|
|
834
1137
|
// any element or text node (with content)
|
|
835
1138
|
// should hide the default fallback slot node
|
|
836
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
837
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1139
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1140
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
838
1141
|
childNode.hidden = true;
|
|
839
1142
|
break;
|
|
840
1143
|
}
|
|
@@ -856,8 +1159,8 @@ const relocateSlotContent = (elm) => {
|
|
|
856
1159
|
let relocateNodeData;
|
|
857
1160
|
let j;
|
|
858
1161
|
let i = 0;
|
|
859
|
-
|
|
860
|
-
|
|
1162
|
+
const childNodes = elm.childNodes;
|
|
1163
|
+
const ilen = childNodes.length;
|
|
861
1164
|
for (; i < ilen; i++) {
|
|
862
1165
|
childNode = childNodes[i];
|
|
863
1166
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -912,13 +1215,13 @@ const relocateSlotContent = (elm) => {
|
|
|
912
1215
|
}
|
|
913
1216
|
}
|
|
914
1217
|
}
|
|
915
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1218
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
916
1219
|
relocateSlotContent(childNode);
|
|
917
1220
|
}
|
|
918
1221
|
}
|
|
919
1222
|
};
|
|
920
1223
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
921
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1224
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
922
1225
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
923
1226
|
return true;
|
|
924
1227
|
}
|
|
@@ -938,6 +1241,18 @@ const callNodeRefs = (vNode) => {
|
|
|
938
1241
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
939
1242
|
}
|
|
940
1243
|
};
|
|
1244
|
+
/**
|
|
1245
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
1246
|
+
*
|
|
1247
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
1248
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
1249
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
1250
|
+
* relocation, and reflecting attributes.
|
|
1251
|
+
*
|
|
1252
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1253
|
+
* the DOM node into which it should be rendered.
|
|
1254
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1255
|
+
*/
|
|
941
1256
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
942
1257
|
const hostElm = hostRef.$hostElement$;
|
|
943
1258
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -949,7 +1264,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
949
1264
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
950
1265
|
}
|
|
951
1266
|
rootVnode.$tag$ = null;
|
|
952
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1267
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
953
1268
|
hostRef.$vnode$ = rootVnode;
|
|
954
1269
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
955
1270
|
{
|
|
@@ -957,7 +1272,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
957
1272
|
}
|
|
958
1273
|
{
|
|
959
1274
|
contentRef = hostElm['s-cr'];
|
|
960
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1275
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
961
1276
|
// always reset
|
|
962
1277
|
checkSlotFallbackVisibility = false;
|
|
963
1278
|
}
|
|
@@ -966,7 +1281,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
966
1281
|
{
|
|
967
1282
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
968
1283
|
// the disconnectCallback from working
|
|
969
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1284
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
970
1285
|
if (checkSlotRelocate) {
|
|
971
1286
|
relocateSlotContent(rootVnode.$elm$);
|
|
972
1287
|
let relocateData;
|
|
@@ -1024,7 +1339,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1024
1339
|
}
|
|
1025
1340
|
else {
|
|
1026
1341
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1027
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1342
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1028
1343
|
nodeToRelocate.hidden = true;
|
|
1029
1344
|
}
|
|
1030
1345
|
}
|
|
@@ -1035,37 +1350,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1035
1350
|
}
|
|
1036
1351
|
// done moving nodes around
|
|
1037
1352
|
// allow the disconnect callback to work again
|
|
1038
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1353
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1039
1354
|
// always reset
|
|
1040
1355
|
relocateNodes.length = 0;
|
|
1041
1356
|
}
|
|
1042
1357
|
};
|
|
1043
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
1044
|
-
const createEvent = (ref, name, flags) => {
|
|
1045
|
-
const elm = getElement(ref);
|
|
1046
|
-
return {
|
|
1047
|
-
emit: (detail) => {
|
|
1048
|
-
return emitEvent(elm, name, {
|
|
1049
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1050
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1051
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1052
|
-
detail,
|
|
1053
|
-
});
|
|
1054
|
-
},
|
|
1055
|
-
};
|
|
1056
|
-
};
|
|
1057
|
-
/**
|
|
1058
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
1059
|
-
* @param elm the target of the Event
|
|
1060
|
-
* @param name the name to give the custom Event
|
|
1061
|
-
* @param opts options for configuring a custom Event
|
|
1062
|
-
* @returns the custom Event
|
|
1063
|
-
*/
|
|
1064
|
-
const emitEvent = (elm, name, opts) => {
|
|
1065
|
-
const ev = plt.ce(name, opts);
|
|
1066
|
-
elm.dispatchEvent(ev);
|
|
1067
|
-
return ev;
|
|
1068
|
-
};
|
|
1069
1358
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1070
1359
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1071
1360
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1073,10 +1362,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1073
1362
|
};
|
|
1074
1363
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1075
1364
|
{
|
|
1076
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1365
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1077
1366
|
}
|
|
1078
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1079
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1367
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1368
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1080
1369
|
return;
|
|
1081
1370
|
}
|
|
1082
1371
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1092,7 +1381,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1092
1381
|
let promise;
|
|
1093
1382
|
if (isInitialLoad) {
|
|
1094
1383
|
{
|
|
1095
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1384
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1096
1385
|
if (hostRef.$queuedListeners$) {
|
|
1097
1386
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1098
1387
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1135,7 +1424,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1135
1424
|
}
|
|
1136
1425
|
else {
|
|
1137
1426
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1138
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1427
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1139
1428
|
childrenPromises.length = 0;
|
|
1140
1429
|
}
|
|
1141
1430
|
}
|
|
@@ -1144,10 +1433,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1144
1433
|
try {
|
|
1145
1434
|
instance = instance.render() ;
|
|
1146
1435
|
{
|
|
1147
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1436
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1148
1437
|
}
|
|
1149
1438
|
{
|
|
1150
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1439
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1151
1440
|
}
|
|
1152
1441
|
{
|
|
1153
1442
|
{
|
|
@@ -1174,8 +1463,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1174
1463
|
{
|
|
1175
1464
|
safeCall(instance, 'componentDidRender');
|
|
1176
1465
|
}
|
|
1177
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1178
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1466
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1467
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1179
1468
|
{
|
|
1180
1469
|
// DOM WRITE!
|
|
1181
1470
|
addHydratedFlag(elm);
|
|
@@ -1207,10 +1496,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1207
1496
|
hostRef.$onRenderResolve$();
|
|
1208
1497
|
hostRef.$onRenderResolve$ = undefined;
|
|
1209
1498
|
}
|
|
1210
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1499
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1211
1500
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1212
1501
|
}
|
|
1213
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1502
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1214
1503
|
}
|
|
1215
1504
|
// ( •_•)
|
|
1216
1505
|
// ( •_•)>⌐■-■
|
|
@@ -1240,53 +1529,6 @@ const then = (promise, thenFn) => {
|
|
|
1240
1529
|
};
|
|
1241
1530
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1242
1531
|
;
|
|
1243
|
-
/**
|
|
1244
|
-
* Parse a new property value for a given property type.
|
|
1245
|
-
*
|
|
1246
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
1247
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
1248
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
1249
|
-
* 2. the type stored from `propType`.
|
|
1250
|
-
*
|
|
1251
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1252
|
-
*
|
|
1253
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1254
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1255
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1256
|
-
* ```tsx
|
|
1257
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
1258
|
-
* ```
|
|
1259
|
-
*
|
|
1260
|
-
* HTML prop values on the other hand, will always a string
|
|
1261
|
-
*
|
|
1262
|
-
* @param propValue the new value to coerce to some type
|
|
1263
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
1264
|
-
* @returns the parsed/coerced value
|
|
1265
|
-
*/
|
|
1266
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1267
|
-
// ensure this value is of the correct prop type
|
|
1268
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1269
|
-
if (propType & 4 /* Boolean */) {
|
|
1270
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1271
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1272
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1273
|
-
}
|
|
1274
|
-
if (propType & 2 /* Number */) {
|
|
1275
|
-
// force it to be a number
|
|
1276
|
-
return parseFloat(propValue);
|
|
1277
|
-
}
|
|
1278
|
-
if (propType & 1 /* String */) {
|
|
1279
|
-
// could have been passed as a number or boolean
|
|
1280
|
-
// but we still want it as a string
|
|
1281
|
-
return String(propValue);
|
|
1282
|
-
}
|
|
1283
|
-
// redundant return here for better minification
|
|
1284
|
-
return propValue;
|
|
1285
|
-
}
|
|
1286
|
-
// not sure exactly what type we want
|
|
1287
|
-
// so no need to change to a different type
|
|
1288
|
-
return propValue;
|
|
1289
|
-
};
|
|
1290
1532
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1291
1533
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1292
1534
|
// check our new property value against our internal value
|
|
@@ -1296,13 +1538,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1296
1538
|
const flags = hostRef.$flags$;
|
|
1297
1539
|
const instance = hostRef.$lazyInstance$ ;
|
|
1298
1540
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1299
|
-
|
|
1541
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1542
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1543
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1544
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1300
1545
|
// gadzooks! the property's value has changed!!
|
|
1301
1546
|
// set our new value!
|
|
1302
1547
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1303
1548
|
if (instance) {
|
|
1304
1549
|
// get an array of method names of watch functions to call
|
|
1305
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1550
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1306
1551
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1307
1552
|
if (watchMethods) {
|
|
1308
1553
|
// this instance is watching for when this property changed
|
|
@@ -1317,7 +1562,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1317
1562
|
});
|
|
1318
1563
|
}
|
|
1319
1564
|
}
|
|
1320
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1565
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1321
1566
|
// looks like this value actually changed, so we've got work to do!
|
|
1322
1567
|
// but only if we've already rendered, otherwise just chill out
|
|
1323
1568
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1327,6 +1572,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1327
1572
|
}
|
|
1328
1573
|
}
|
|
1329
1574
|
};
|
|
1575
|
+
/**
|
|
1576
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1577
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1578
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1579
|
+
*
|
|
1580
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1581
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1582
|
+
* @param flags a number used to store a series of bit flags
|
|
1583
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1584
|
+
*/
|
|
1330
1585
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1331
1586
|
if (cmpMeta.$members$) {
|
|
1332
1587
|
if (Cstr.watchers) {
|
|
@@ -1336,8 +1591,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1336
1591
|
const members = Object.entries(cmpMeta.$members$);
|
|
1337
1592
|
const prototype = Cstr.prototype;
|
|
1338
1593
|
members.map(([memberName, [memberFlags]]) => {
|
|
1339
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1340
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1594
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1595
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1341
1596
|
// proxyComponent - prop
|
|
1342
1597
|
Object.defineProperty(prototype, memberName, {
|
|
1343
1598
|
get() {
|
|
@@ -1352,8 +1607,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1352
1607
|
enumerable: true,
|
|
1353
1608
|
});
|
|
1354
1609
|
}
|
|
1355
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1356
|
-
memberFlags & 64 /* Method */) {
|
|
1610
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1611
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1357
1612
|
// proxyComponent - method
|
|
1358
1613
|
Object.defineProperty(prototype, memberName, {
|
|
1359
1614
|
value(...args) {
|
|
@@ -1363,7 +1618,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1363
1618
|
});
|
|
1364
1619
|
}
|
|
1365
1620
|
});
|
|
1366
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1621
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1367
1622
|
const attrNameToPropName = new Map();
|
|
1368
1623
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1369
1624
|
plt.jmp(() => {
|
|
@@ -1419,11 +1674,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1419
1674
|
// create an array of attributes to observe
|
|
1420
1675
|
// and also create a map of html attribute name to js property name
|
|
1421
1676
|
Cstr.observedAttributes = members
|
|
1422
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1677
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1423
1678
|
.map(([propName, m]) => {
|
|
1424
1679
|
const attrName = m[1] || propName;
|
|
1425
1680
|
attrNameToPropName.set(attrName, propName);
|
|
1426
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1681
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1427
1682
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1428
1683
|
}
|
|
1429
1684
|
return attrName;
|
|
@@ -1434,10 +1689,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1434
1689
|
};
|
|
1435
1690
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1436
1691
|
// initializeComponent
|
|
1437
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1692
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1438
1693
|
{
|
|
1439
1694
|
// we haven't initialized this element yet
|
|
1440
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1695
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1441
1696
|
// lazy loaded components
|
|
1442
1697
|
// request the component's implementation to be
|
|
1443
1698
|
// wired up with the host element
|
|
@@ -1455,7 +1710,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1455
1710
|
{
|
|
1456
1711
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1457
1712
|
}
|
|
1458
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1713
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1459
1714
|
Cstr.isProxied = true;
|
|
1460
1715
|
}
|
|
1461
1716
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1463,7 +1718,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1463
1718
|
// but let's keep track of when we start and stop
|
|
1464
1719
|
// so that the getters/setters don't incorrectly step on data
|
|
1465
1720
|
{
|
|
1466
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1721
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1467
1722
|
}
|
|
1468
1723
|
// construct the lazy-loaded component implementation
|
|
1469
1724
|
// passing the hostRef is very important during
|
|
@@ -1476,10 +1731,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1476
1731
|
consoleError(e);
|
|
1477
1732
|
}
|
|
1478
1733
|
{
|
|
1479
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1734
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1480
1735
|
}
|
|
1481
1736
|
{
|
|
1482
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1737
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1483
1738
|
}
|
|
1484
1739
|
endNewInstance();
|
|
1485
1740
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1490,7 +1745,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1490
1745
|
const scopeId = getScopeId(cmpMeta);
|
|
1491
1746
|
if (!styles.has(scopeId)) {
|
|
1492
1747
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1493
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1748
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1494
1749
|
endRegisterStyles();
|
|
1495
1750
|
}
|
|
1496
1751
|
}
|
|
@@ -1517,19 +1772,20 @@ const fireConnectedCallback = (instance) => {
|
|
|
1517
1772
|
}
|
|
1518
1773
|
};
|
|
1519
1774
|
const connectedCallback = (elm) => {
|
|
1520
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1775
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1521
1776
|
const hostRef = getHostRef(elm);
|
|
1522
1777
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1523
1778
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1524
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1779
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1525
1780
|
// first time this component has connected
|
|
1526
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1781
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1527
1782
|
{
|
|
1528
1783
|
// initUpdate
|
|
1529
1784
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1530
1785
|
// in here to act as original content anchors as we move nodes around
|
|
1531
1786
|
// host element has been connected to the DOM
|
|
1532
|
-
if ((
|
|
1787
|
+
if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
1788
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1533
1789
|
setContentReference(elm);
|
|
1534
1790
|
}
|
|
1535
1791
|
}
|
|
@@ -1552,7 +1808,7 @@ const connectedCallback = (elm) => {
|
|
|
1552
1808
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1553
1809
|
if (cmpMeta.$members$) {
|
|
1554
1810
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1555
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1811
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1556
1812
|
const value = elm[memberName];
|
|
1557
1813
|
delete elm[memberName];
|
|
1558
1814
|
elm[memberName] = value;
|
|
@@ -1586,7 +1842,7 @@ const setContentReference = (elm) => {
|
|
|
1586
1842
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1587
1843
|
};
|
|
1588
1844
|
const disconnectedCallback = (elm) => {
|
|
1589
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1845
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1590
1846
|
const hostRef = getHostRef(elm);
|
|
1591
1847
|
const instance = hostRef.$lazyInstance$ ;
|
|
1592
1848
|
{
|
|
@@ -1601,6 +1857,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1601
1857
|
}
|
|
1602
1858
|
};
|
|
1603
1859
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1860
|
+
var _a;
|
|
1604
1861
|
const endBootstrap = createTime();
|
|
1605
1862
|
const cmpTags = [];
|
|
1606
1863
|
const exclude = options.exclude || [];
|
|
@@ -1641,7 +1898,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1641
1898
|
super(self);
|
|
1642
1899
|
self = this;
|
|
1643
1900
|
registerHost(self, cmpMeta);
|
|
1644
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1901
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1645
1902
|
// this component is using shadow dom
|
|
1646
1903
|
// and this browser supports shadow dom
|
|
1647
1904
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1676,13 +1933,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1676
1933
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1677
1934
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1678
1935
|
cmpTags.push(tagName);
|
|
1679
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1936
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1680
1937
|
}
|
|
1681
1938
|
});
|
|
1682
1939
|
});
|
|
1683
1940
|
{
|
|
1684
1941
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1685
1942
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1943
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1944
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1945
|
+
if (nonce != null) {
|
|
1946
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1947
|
+
}
|
|
1686
1948
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1687
1949
|
}
|
|
1688
1950
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1698,12 +1960,49 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1698
1960
|
// Fallback appLoad event
|
|
1699
1961
|
endBootstrap();
|
|
1700
1962
|
};
|
|
1701
|
-
const getAssetPath = (path) => {
|
|
1702
|
-
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
1703
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
1704
|
-
};
|
|
1705
1963
|
const Fragment = (_, children) => children;
|
|
1706
|
-
const
|
|
1964
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1965
|
+
if (listeners) {
|
|
1966
|
+
listeners.map(([flags, name, method]) => {
|
|
1967
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1968
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1969
|
+
const opts = hostListenerOpts(flags);
|
|
1970
|
+
plt.ael(target, name, handler, opts);
|
|
1971
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1975
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1976
|
+
try {
|
|
1977
|
+
{
|
|
1978
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1979
|
+
// instance is ready, let's call it's member method for this event
|
|
1980
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1981
|
+
}
|
|
1982
|
+
else {
|
|
1983
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
catch (e) {
|
|
1988
|
+
consoleError(e);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1992
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1993
|
+
return win;
|
|
1994
|
+
return elm;
|
|
1995
|
+
};
|
|
1996
|
+
// prettier-ignore
|
|
1997
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1998
|
+
/**
|
|
1999
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
2000
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
2001
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
2002
|
+
* @returns void
|
|
2003
|
+
*/
|
|
2004
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
2005
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1707
2006
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1708
2007
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1709
2008
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1735,7 +2034,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1735
2034
|
if (module) {
|
|
1736
2035
|
return module[exportName];
|
|
1737
2036
|
}
|
|
2037
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1738
2038
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2039
|
+
/* @vite-ignore */
|
|
1739
2040
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1740
2041
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1741
2042
|
/* webpackMode: "lazy" */
|
|
@@ -1746,14 +2047,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1746
2047
|
return importedModule[exportName];
|
|
1747
2048
|
}, consoleError);
|
|
1748
2049
|
};
|
|
1749
|
-
const styles = new Map();
|
|
2050
|
+
const styles = /*@__PURE__*/ new Map();
|
|
2051
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
2052
|
+
const doc = win.document || { head: {} };
|
|
2053
|
+
const plt = {
|
|
2054
|
+
$flags$: 0,
|
|
2055
|
+
$resourcesUrl$: '',
|
|
2056
|
+
jmp: (h) => h(),
|
|
2057
|
+
raf: (h) => requestAnimationFrame(h),
|
|
2058
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2059
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2060
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
2061
|
+
};
|
|
2062
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
2063
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2064
|
+
try {
|
|
2065
|
+
new CSSStyleSheet();
|
|
2066
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2067
|
+
}
|
|
2068
|
+
catch (e) { }
|
|
2069
|
+
return false;
|
|
2070
|
+
})()
|
|
2071
|
+
;
|
|
1750
2072
|
const queueDomReads = [];
|
|
1751
2073
|
const queueDomWrites = [];
|
|
1752
2074
|
const queueTask = (queue, write) => (cb) => {
|
|
1753
2075
|
queue.push(cb);
|
|
1754
2076
|
if (!queuePending) {
|
|
1755
2077
|
queuePending = true;
|
|
1756
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2078
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1757
2079
|
nextTick(flush);
|
|
1758
2080
|
}
|
|
1759
2081
|
else {
|
|
@@ -1794,8 +2116,10 @@ exports.Fragment = Fragment;
|
|
|
1794
2116
|
exports.Host = Host;
|
|
1795
2117
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1796
2118
|
exports.createEvent = createEvent;
|
|
1797
|
-
exports.getAssetPath = getAssetPath;
|
|
1798
2119
|
exports.getElement = getElement;
|
|
1799
2120
|
exports.h = h;
|
|
1800
2121
|
exports.promiseResolve = promiseResolve;
|
|
1801
2122
|
exports.registerInstance = registerInstance;
|
|
2123
|
+
exports.setNonce = setNonce;
|
|
2124
|
+
|
|
2125
|
+
//# sourceMappingURL=index-b3257a77.js.map
|