@pine-ds/core 1.3.0-dev.2 → 1.3.0-dev.3
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/components/closest.js +11 -0
- package/components/closest.js.map +1 -0
- package/components/index.js +33 -0
- package/components/index.js.map +1 -0
- package/components/index2.js +14 -0
- package/components/index2.js.map +1 -0
- package/components/pds-accordion.js +62 -0
- package/components/pds-accordion.js.map +1 -0
- package/components/pds-avatar.js +97 -0
- package/components/pds-avatar.js.map +1 -0
- package/components/pds-box.js +124 -0
- package/components/pds-box.js.map +1 -0
- package/components/pds-button.js +8 -0
- package/components/pds-button.js.map +1 -0
- package/components/pds-button2.js +78 -0
- package/components/pds-button2.js.map +1 -0
- package/components/pds-checkbox.js +8 -0
- package/components/pds-checkbox.js.map +1 -0
- package/components/pds-checkbox2.js +101 -0
- package/components/pds-checkbox2.js.map +1 -0
- package/components/pds-chip.js +72 -0
- package/components/pds-chip.js.map +1 -0
- package/components/pds-copytext.js +82 -0
- package/components/pds-copytext.js.map +1 -0
- package/components/pds-divider.js +54 -0
- package/components/pds-divider.js.map +1 -0
- package/components/pds-image.js +55 -0
- package/components/pds-image.js.map +1 -0
- package/components/pds-input.js +72 -0
- package/components/pds-input.js.map +1 -0
- package/components/pds-label.js +39 -0
- package/components/pds-label.js.map +1 -0
- package/components/pds-link.js +59 -0
- package/components/pds-link.js.map +1 -0
- package/components/pds-loader.js +68 -0
- package/components/pds-loader.js.map +1 -0
- package/components/pds-progress.js +49 -0
- package/components/pds-progress.js.map +1 -0
- package/components/pds-radio.js +78 -0
- package/components/pds-radio.js.map +1 -0
- package/components/pds-row.js +72 -0
- package/components/pds-row.js.map +1 -0
- package/components/pds-sortable-item.js +52 -0
- package/components/pds-sortable-item.js.map +1 -0
- package/components/pds-sortable.js +2722 -0
- package/components/pds-sortable.js.map +1 -0
- package/components/pds-switch.js +82 -0
- package/components/pds-switch.js.map +1 -0
- package/components/pds-tab.js +53 -0
- package/components/pds-tab.js.map +1 -0
- package/components/pds-table-body.js +36 -0
- package/components/pds-table-body.js.map +1 -0
- package/components/pds-table-cell.js +8 -0
- package/components/pds-table-cell.js.map +1 -0
- package/components/pds-table-cell2.js +72 -0
- package/components/pds-table-cell2.js.map +1 -0
- package/components/pds-table-head-cell.js +8 -0
- package/components/pds-table-head-cell.js.map +1 -0
- package/components/pds-table-head-cell2.js +92 -0
- package/components/pds-table-head-cell2.js.map +1 -0
- package/components/pds-table-head.js +84 -0
- package/components/pds-table-head.js.map +1 -0
- package/components/pds-table-row.js +95 -0
- package/components/pds-table-row.js.map +1 -0
- package/components/pds-table.js +124 -0
- package/components/pds-table.js.map +1 -0
- package/components/pds-tabpanel.js +45 -0
- package/components/pds-tabpanel.js.map +1 -0
- package/components/pds-tabs.js +119 -0
- package/components/pds-tabs.js.map +1 -0
- package/components/pds-textarea.js +82 -0
- package/components/pds-textarea.js.map +1 -0
- package/components/pds-tooltip.js +178 -0
- package/components/pds-tooltip.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/closest-b45138d3.js +13 -0
- package/dist/cjs/closest-b45138d3.js.map +1 -0
- package/dist/{pine-core/index-cccc19b7.js → cjs/index-11f95019.js} +220 -1563
- package/dist/cjs/index-11f95019.js.map +1 -0
- package/dist/cjs/index-dd191bbe.js +24 -0
- package/dist/cjs/index-dd191bbe.js.map +1 -0
- package/dist/cjs/index.cjs.js +6 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/pds-accordion.cjs.entry.js +43 -0
- package/dist/cjs/pds-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-avatar.cjs.entry.js +75 -0
- package/dist/cjs/pds-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-box.cjs.entry.js +82 -0
- package/dist/cjs/pds-box.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-button.cjs.entry.js +59 -0
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-checkbox.cjs.entry.js +75 -0
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-chip.cjs.entry.js +51 -0
- package/dist/cjs/pds-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-copytext.cjs.entry.js +56 -0
- package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-divider.cjs.entry.js +36 -0
- package/dist/cjs/pds-divider.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-image.cjs.entry.js +32 -0
- package/dist/cjs/pds-image.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-input.cjs.entry.js +45 -0
- package/dist/cjs/pds-input.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-label-7acec6ab.js +44 -0
- package/dist/cjs/pds-label-7acec6ab.js.map +1 -0
- package/dist/cjs/pds-link.cjs.entry.js +39 -0
- package/dist/cjs/pds-link.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-loader.cjs.entry.js +49 -0
- package/dist/cjs/pds-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-progress.cjs.entry.js +28 -0
- package/dist/cjs/pds-progress.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-radio.cjs.entry.js +54 -0
- package/dist/cjs/pds-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-row.cjs.entry.js +51 -0
- package/dist/cjs/pds-row.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-sortable-item.cjs.entry.js +35 -0
- package/dist/cjs/pds-sortable-item.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-sortable.cjs.entry.js +2704 -0
- package/dist/cjs/pds-sortable.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-switch.cjs.entry.js +56 -0
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tab.cjs.entry.js +34 -0
- package/dist/cjs/pds-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table-body.cjs.entry.js +22 -0
- package/dist/cjs/pds-table-body.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table-cell.cjs.entry.js +58 -0
- package/dist/cjs/pds-table-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +76 -0
- package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table-head.cjs.entry.js +55 -0
- package/dist/cjs/pds-table-head.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table-row.cjs.entry.js +66 -0
- package/dist/cjs/pds-table-row.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-table.cjs.entry.js +102 -0
- package/dist/cjs/pds-table.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tabpanel.cjs.entry.js +27 -0
- package/dist/cjs/pds-tabpanel.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tabs.cjs.entry.js +99 -0
- package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-textarea.cjs.entry.js +55 -0
- package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js +152 -0
- package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/pine-core.cjs.js +27 -0
- package/dist/cjs/pine-core.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +40 -0
- package/dist/collection/components/_internal/pds-label/pds-label.js +7 -0
- package/dist/collection/components/_internal/pds-label/pds-label.js.map +1 -0
- package/dist/collection/components/pds-accordion/pds-accordion.css +65 -0
- package/dist/collection/components/pds-accordion/pds-accordion.js +94 -0
- package/dist/collection/components/pds-accordion/pds-accordion.js.map +1 -0
- package/dist/collection/components/pds-accordion/stories/pds-accordion.stories.js +34 -0
- package/dist/collection/components/pds-avatar/pds-avatar.css +65 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js +224 -0
- package/dist/collection/components/pds-avatar/pds-avatar.js.map +1 -0
- package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +65 -0
- package/dist/collection/components/pds-box/pds-box.css +1234 -0
- package/dist/collection/components/pds-box/pds-box.js +678 -0
- package/dist/collection/components/pds-box/pds-box.js.map +1 -0
- package/dist/collection/components/pds-box/stories/pds-box.stories.js +50 -0
- package/dist/collection/components/pds-button/pds-button.css +131 -0
- package/dist/collection/components/pds-button/pds-button.js +193 -0
- package/dist/collection/components/pds-button/pds-button.js.map +1 -0
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +66 -0
- package/dist/collection/components/pds-checkbox/checkbox-interface.js +2 -0
- package/dist/collection/components/pds-checkbox/checkbox-interface.js.map +1 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.css +135 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +330 -0
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -0
- package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +82 -0
- package/dist/collection/components/pds-chip/pds-chip.css +239 -0
- package/dist/collection/components/pds-chip/pds-chip.js +189 -0
- package/dist/collection/components/pds-chip/pds-chip.js.map +1 -0
- package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +79 -0
- package/dist/collection/components/pds-copytext/pds-copytext.css +87 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js +173 -0
- package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -0
- package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +57 -0
- package/dist/collection/components/pds-divider/pds-divider.css +92 -0
- package/dist/collection/components/pds-divider/pds-divider.js +94 -0
- package/dist/collection/components/pds-divider/pds-divider.js.map +1 -0
- package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +25 -0
- package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +16 -0
- package/dist/collection/components/pds-image/pds-image.css +13 -0
- package/dist/collection/components/pds-image/pds-image.js +173 -0
- package/dist/collection/components/pds-image/pds-image.js.map +1 -0
- package/dist/collection/components/pds-image/stories/pds-image.stories.js +35 -0
- package/dist/collection/components/pds-input/pds-input.css +92 -0
- package/dist/collection/components/pds-input/pds-input.js +279 -0
- package/dist/collection/components/pds-input/pds-input.js.map +1 -0
- package/dist/collection/components/pds-input/stories/pds-input.stories.js +110 -0
- package/dist/collection/components/pds-link/pds-link.css +68 -0
- package/dist/collection/components/pds-link/pds-link.js +140 -0
- package/dist/collection/components/pds-link/pds-link.js.map +1 -0
- package/dist/collection/components/pds-link/stories/pds-link.stories.js +49 -0
- package/dist/collection/components/pds-loader/pds-loader.css +93 -0
- package/dist/collection/components/pds-loader/pds-loader.js +127 -0
- package/dist/collection/components/pds-loader/pds-loader.js.map +1 -0
- package/dist/collection/components/pds-loader/stories/pds-loader.stories.js +36 -0
- package/dist/collection/components/pds-progress/pds-progress.css +79 -0
- package/dist/collection/components/pds-progress/pds-progress.js +148 -0
- package/dist/collection/components/pds-progress/pds-progress.js.map +1 -0
- package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +65 -0
- package/dist/collection/components/pds-radio/pds-radio.css +104 -0
- package/dist/collection/components/pds-radio/pds-radio.js +261 -0
- package/dist/collection/components/pds-radio/pds-radio.js.map +1 -0
- package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +71 -0
- package/dist/collection/components/pds-row/pds-row.css +78 -0
- package/dist/collection/components/pds-row/pds-row.js +186 -0
- package/dist/collection/components/pds-row/pds-row.js.map +1 -0
- package/dist/collection/components/pds-row/stories/pds-row.stories.js +75 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +63 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +100 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +1 -0
- package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +24 -0
- package/dist/collection/components/pds-sortable/pds-sortable.css +10 -0
- package/dist/collection/components/pds-sortable/pds-sortable.js +150 -0
- package/dist/collection/components/pds-sortable/pds-sortable.js.map +1 -0
- package/dist/collection/components/pds-sortable/sortable-interface.js +2 -0
- package/dist/collection/components/pds-sortable/sortable-interface.js.map +1 -0
- package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +130 -0
- package/dist/collection/components/pds-switch/pds-switch.css +136 -0
- package/dist/collection/components/pds-switch/pds-switch.js +277 -0
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -0
- package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +102 -0
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.css +5 -0
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +19 -0
- package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +1 -0
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +45 -0
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +83 -0
- package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -0
- package/dist/collection/components/pds-table/pds-table-cell/stories/pds-table-cell.stories.js +26 -0
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.css +18 -0
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +109 -0
- package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -0
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +54 -0
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +120 -0
- package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +1 -0
- package/dist/collection/components/pds-table/pds-table-head-cell/stories/pds-table-head-cell.stories.js +24 -0
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.css +22 -0
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +120 -0
- package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -0
- package/dist/collection/components/pds-table/pds-table-row/stories/pds-table-row.stories.js +26 -0
- package/dist/collection/components/pds-table/pds-table.css +27 -0
- package/dist/collection/components/pds-table/pds-table.js +248 -0
- package/dist/collection/components/pds-table/pds-table.js.map +1 -0
- package/dist/collection/components/pds-table/stories/pds-table.stories.js +227 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +160 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +154 -0
- package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +1 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +12 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +107 -0
- package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +1 -0
- package/dist/collection/components/pds-tabs/pds-tabs.css +29 -0
- package/dist/collection/components/pds-tabs/pds-tabs.js +209 -0
- package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -0
- package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +63 -0
- package/dist/collection/components/pds-textarea/pds-textarea.css +88 -0
- package/dist/collection/components/pds-textarea/pds-textarea.js +303 -0
- package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -0
- package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +111 -0
- package/dist/collection/components/pds-textarea/textarea-interface.js +2 -0
- package/dist/collection/components/pds-textarea/textarea-interface.js.map +1 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.css +147 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.js +287 -0
- package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -0
- package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +103 -0
- package/dist/collection/global/pine-ui-global.js +2 -0
- package/dist/collection/global/pine-ui-global.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/stories/_helpers/index.js +15 -0
- package/dist/collection/stories/_helpers/index.js.map +1 -0
- package/dist/collection/utils/closest.js +8 -0
- package/dist/collection/utils/closest.js.map +1 -0
- package/dist/collection/utils/form.js +28 -0
- package/dist/collection/utils/form.js.map +1 -0
- package/dist/collection/utils/overlay.js +68 -0
- package/dist/collection/utils/overlay.js.map +1 -0
- package/dist/collection/utils/types.js +2 -0
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/collection/utils/utils.js +7 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/docs.json +1 -1
- package/dist/esm/index-b8872c16.js +14 -0
- package/dist/esm/index-b8872c16.js.map +1 -0
- package/dist/esm/index-cd2796be.js +2811 -0
- package/dist/esm/index-cd2796be.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{pine-core → esm}/pds-accordion.entry.js +5 -4
- package/dist/esm/pds-accordion.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-avatar.entry.js +5 -4
- package/dist/esm/pds-avatar.entry.js.map +1 -0
- package/dist/esm/pds-box.entry.js +78 -0
- package/dist/esm/pds-box.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-button.entry.js +5 -7
- package/dist/esm/pds-button.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-checkbox.entry.js +5 -4
- package/dist/esm/pds-checkbox.entry.js.map +1 -0
- package/dist/esm/pds-chip.entry.js +47 -0
- package/dist/esm/pds-chip.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-copytext.entry.js +5 -4
- package/dist/esm/pds-copytext.entry.js.map +1 -0
- package/dist/esm/pds-divider.entry.js +32 -0
- package/dist/esm/pds-divider.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-image.entry.js +3 -2
- package/dist/esm/pds-image.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-input.entry.js +5 -4
- package/dist/esm/pds-input.entry.js.map +1 -0
- package/dist/{pine-core/pds-label-7201663d.js → esm/pds-label-7abc6d85.js} +2 -2
- package/dist/{pine-core/pds-label-7201663d.js.map → esm/pds-label-7abc6d85.js.map} +1 -1
- package/dist/{pine-core → esm}/pds-link.entry.js +5 -4
- package/dist/esm/pds-link.entry.js.map +1 -0
- package/dist/esm/pds-loader.entry.js +45 -0
- package/dist/esm/pds-loader.entry.js.map +1 -0
- package/dist/esm/pds-progress.entry.js +24 -0
- package/dist/esm/pds-progress.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-radio.entry.js +5 -4
- package/dist/esm/pds-radio.entry.js.map +1 -0
- package/dist/esm/pds-row.entry.js +47 -0
- package/dist/esm/pds-row.entry.js.map +1 -0
- package/dist/esm/pds-sortable-item.entry.js +31 -0
- package/dist/esm/pds-sortable-item.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-sortable.entry.js +4 -704
- package/dist/esm/pds-sortable.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-switch.entry.js +5 -4
- package/dist/esm/pds-switch.entry.js.map +1 -0
- package/dist/esm/pds-tab.entry.js +30 -0
- package/dist/esm/pds-tab.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table-body.entry.js +3 -2
- package/dist/esm/pds-table-body.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table-cell.entry.js +4 -3
- package/dist/esm/pds-table-cell.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table-head-cell.entry.js +5 -4
- package/dist/esm/pds-table-head-cell.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table-head.entry.js +4 -3
- package/dist/esm/pds-table-head.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table-row.entry.js +4 -3
- package/dist/esm/pds-table-row.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-table.entry.js +4 -3
- package/dist/esm/pds-table.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-tabpanel.entry.js +3 -2
- package/dist/esm/pds-tabpanel.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-tabs.entry.js +4 -3
- package/dist/esm/pds-tabs.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-textarea.entry.js +5 -4
- package/dist/esm/pds-textarea.entry.js.map +1 -0
- package/dist/{pine-core → esm}/pds-tooltip.entry.js +4 -3
- package/dist/esm/pds-tooltip.entry.js.map +1 -0
- package/dist/esm/pine-core.js +22 -0
- package/dist/esm/pine-core.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/app-globals-0f993ce5.js +2 -0
- package/dist/esm-es5/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm-es5/closest-d2d192be.js +2 -0
- package/dist/esm-es5/closest-d2d192be.js.map +1 -0
- package/dist/esm-es5/index-b8872c16.js +2 -0
- package/dist/esm-es5/index-b8872c16.js.map +1 -0
- package/dist/esm-es5/index-cd2796be.js +3 -0
- package/dist/esm-es5/index-cd2796be.js.map +1 -0
- package/dist/esm-es5/index.js +2 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -0
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/pds-accordion.entry.js +2 -0
- package/dist/esm-es5/pds-accordion.entry.js.map +1 -0
- package/dist/esm-es5/pds-avatar.entry.js +2 -0
- package/dist/esm-es5/pds-avatar.entry.js.map +1 -0
- package/dist/esm-es5/pds-box.entry.js +2 -0
- package/dist/esm-es5/pds-box.entry.js.map +1 -0
- package/dist/esm-es5/pds-button.entry.js +2 -0
- package/dist/esm-es5/pds-button.entry.js.map +1 -0
- package/dist/esm-es5/pds-checkbox.entry.js +2 -0
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -0
- package/dist/esm-es5/pds-chip.entry.js +2 -0
- package/dist/esm-es5/pds-chip.entry.js.map +1 -0
- package/dist/esm-es5/pds-copytext.entry.js +2 -0
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -0
- package/dist/esm-es5/pds-divider.entry.js +2 -0
- package/dist/esm-es5/pds-divider.entry.js.map +1 -0
- package/dist/esm-es5/pds-image.entry.js +2 -0
- package/dist/esm-es5/pds-image.entry.js.map +1 -0
- package/dist/esm-es5/pds-input.entry.js +2 -0
- package/dist/esm-es5/pds-input.entry.js.map +1 -0
- package/dist/esm-es5/pds-label-7abc6d85.js +2 -0
- package/dist/esm-es5/pds-label-7abc6d85.js.map +1 -0
- package/dist/esm-es5/pds-link.entry.js +2 -0
- package/dist/esm-es5/pds-link.entry.js.map +1 -0
- package/dist/esm-es5/pds-loader.entry.js +2 -0
- package/dist/esm-es5/pds-loader.entry.js.map +1 -0
- package/dist/esm-es5/pds-progress.entry.js +2 -0
- package/dist/esm-es5/pds-progress.entry.js.map +1 -0
- package/dist/esm-es5/pds-radio.entry.js +2 -0
- package/dist/esm-es5/pds-radio.entry.js.map +1 -0
- package/dist/esm-es5/pds-row.entry.js +2 -0
- package/dist/esm-es5/pds-row.entry.js.map +1 -0
- package/dist/esm-es5/pds-sortable-item.entry.js +2 -0
- package/dist/esm-es5/pds-sortable-item.entry.js.map +1 -0
- package/dist/esm-es5/pds-sortable.entry.js +8 -0
- package/dist/esm-es5/pds-sortable.entry.js.map +1 -0
- package/dist/esm-es5/pds-switch.entry.js +2 -0
- package/dist/esm-es5/pds-switch.entry.js.map +1 -0
- package/dist/esm-es5/pds-tab.entry.js +2 -0
- package/dist/esm-es5/pds-tab.entry.js.map +1 -0
- package/dist/esm-es5/pds-table-body.entry.js +2 -0
- package/dist/esm-es5/pds-table-body.entry.js.map +1 -0
- package/dist/esm-es5/pds-table-cell.entry.js +2 -0
- package/dist/esm-es5/pds-table-cell.entry.js.map +1 -0
- package/dist/esm-es5/pds-table-head-cell.entry.js +2 -0
- package/dist/esm-es5/pds-table-head-cell.entry.js.map +1 -0
- package/dist/esm-es5/pds-table-head.entry.js +2 -0
- package/dist/esm-es5/pds-table-head.entry.js.map +1 -0
- package/dist/esm-es5/pds-table-row.entry.js +2 -0
- package/dist/esm-es5/pds-table-row.entry.js.map +1 -0
- package/dist/esm-es5/pds-table.entry.js +2 -0
- package/dist/{pine-core → esm-es5}/pds-table.entry.js.map +1 -1
- package/dist/esm-es5/pds-tabpanel.entry.js +2 -0
- package/dist/esm-es5/pds-tabpanel.entry.js.map +1 -0
- package/dist/esm-es5/pds-tabs.entry.js +2 -0
- package/dist/esm-es5/pds-tabs.entry.js.map +1 -0
- package/dist/esm-es5/pds-textarea.entry.js +2 -0
- package/dist/esm-es5/pds-textarea.entry.js.map +1 -0
- package/dist/esm-es5/pds-tooltip.entry.js +2 -0
- package/dist/esm-es5/pds-tooltip.entry.js.map +1 -0
- package/dist/esm-es5/pine-core.js +2 -0
- package/dist/esm-es5/pine-core.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pine-core/index.esm.js +1 -2
- package/dist/pine-core/index.esm.js.map +1 -1
- package/dist/pine-core/p-03ac85bb.system.entry.js +2 -0
- package/dist/pine-core/p-03ac85bb.system.entry.js.map +1 -0
- package/dist/pine-core/p-0935a593.system.js +3 -0
- package/dist/pine-core/p-0935a593.system.js.map +1 -0
- package/dist/pine-core/p-0b77685e.js +2 -0
- package/dist/pine-core/p-0b77685e.js.map +1 -0
- package/dist/pine-core/p-0ca08a85.system.js +2 -0
- package/dist/pine-core/p-0ca08a85.system.js.map +1 -0
- package/dist/pine-core/p-1b1c6e9e.system.entry.js +2 -0
- package/dist/pine-core/p-1b1c6e9e.system.entry.js.map +1 -0
- package/dist/pine-core/p-1d34a83d.system.entry.js +2 -0
- package/dist/pine-core/p-1d34a83d.system.entry.js.map +1 -0
- package/dist/pine-core/p-224a435b.system.js +2 -0
- package/dist/pine-core/p-224a435b.system.js.map +1 -0
- package/dist/pine-core/p-23d97662.js +3 -0
- package/dist/pine-core/p-23d97662.js.map +1 -0
- package/dist/pine-core/p-24d43a5d.system.entry.js +2 -0
- package/dist/pine-core/p-24d43a5d.system.entry.js.map +1 -0
- package/dist/pine-core/p-252bcd1c.system.entry.js +2 -0
- package/dist/pine-core/p-252bcd1c.system.entry.js.map +1 -0
- package/dist/pine-core/p-27dfade4.system.entry.js +2 -0
- package/dist/pine-core/p-27dfade4.system.entry.js.map +1 -0
- package/dist/pine-core/p-28d205e0.system.entry.js +2 -0
- package/dist/pine-core/p-28d205e0.system.entry.js.map +1 -0
- package/dist/pine-core/p-2ac1781f.entry.js +2 -0
- package/dist/pine-core/p-2ac1781f.entry.js.map +1 -0
- package/dist/pine-core/p-35f2208a.system.entry.js +2 -0
- package/dist/pine-core/p-35f2208a.system.entry.js.map +1 -0
- package/dist/pine-core/p-38a23fac.system.entry.js +2 -0
- package/dist/pine-core/p-38a23fac.system.entry.js.map +1 -0
- package/dist/pine-core/p-39bc5dc9.system.entry.js +2 -0
- package/dist/pine-core/p-39bc5dc9.system.entry.js.map +1 -0
- package/dist/pine-core/p-3c02b099.entry.js +2 -0
- package/dist/pine-core/p-3c02b099.entry.js.map +1 -0
- package/dist/pine-core/p-41d6881e.system.entry.js +2 -0
- package/dist/pine-core/p-41d6881e.system.entry.js.map +1 -0
- package/dist/pine-core/p-443202f8.entry.js +8 -0
- package/dist/pine-core/p-443202f8.entry.js.map +1 -0
- package/dist/pine-core/p-4df579f2.entry.js +2 -0
- package/dist/pine-core/p-4df579f2.entry.js.map +1 -0
- package/dist/pine-core/p-519ef0c4.system.js +2 -0
- package/dist/pine-core/p-519ef0c4.system.js.map +1 -0
- package/dist/pine-core/p-56588c5d.entry.js +2 -0
- package/dist/pine-core/p-56588c5d.entry.js.map +1 -0
- package/dist/pine-core/p-56ba5cbf.system.js +2 -0
- package/dist/pine-core/p-56ba5cbf.system.js.map +1 -0
- package/dist/pine-core/p-5c60147f.system.entry.js +9 -0
- package/dist/pine-core/p-5c60147f.system.entry.js.map +1 -0
- package/dist/pine-core/p-5c8608cd.system.entry.js +2 -0
- package/dist/pine-core/p-5c8608cd.system.entry.js.map +1 -0
- package/dist/pine-core/p-5d08fe24.entry.js +2 -0
- package/dist/pine-core/p-5d08fe24.entry.js.map +1 -0
- package/dist/pine-core/p-606b6dbb.entry.js +2 -0
- package/dist/pine-core/p-606b6dbb.entry.js.map +1 -0
- package/dist/pine-core/p-60f4dc68.system.entry.js +2 -0
- package/dist/pine-core/p-60f4dc68.system.entry.js.map +1 -0
- package/dist/pine-core/p-6525ed78.entry.js +2 -0
- package/dist/pine-core/p-6525ed78.entry.js.map +1 -0
- package/dist/pine-core/p-684d04ae.entry.js +2 -0
- package/dist/pine-core/p-684d04ae.entry.js.map +1 -0
- package/dist/pine-core/p-6f38bc8e.entry.js +2 -0
- package/dist/pine-core/p-6f38bc8e.entry.js.map +1 -0
- package/dist/pine-core/p-6f511f31.entry.js +2 -0
- package/dist/pine-core/p-6f511f31.entry.js.map +1 -0
- package/dist/pine-core/p-74d57e61.system.entry.js +2 -0
- package/dist/pine-core/p-74d57e61.system.entry.js.map +1 -0
- package/dist/pine-core/p-806b41c3.entry.js +2 -0
- package/dist/pine-core/p-806b41c3.entry.js.map +1 -0
- package/dist/pine-core/p-807d5d68.system.entry.js +2 -0
- package/dist/pine-core/p-807d5d68.system.entry.js.map +1 -0
- package/dist/pine-core/p-854fa9e2.entry.js +2 -0
- package/dist/pine-core/p-854fa9e2.entry.js.map +1 -0
- package/dist/pine-core/p-867aee19.entry.js +2 -0
- package/dist/pine-core/p-867aee19.entry.js.map +1 -0
- package/dist/pine-core/p-8701cb7b.system.entry.js +2 -0
- package/dist/pine-core/p-8701cb7b.system.entry.js.map +1 -0
- package/dist/pine-core/p-87b61d15.system.entry.js +2 -0
- package/dist/pine-core/p-87b61d15.system.entry.js.map +1 -0
- package/dist/pine-core/p-8a1b3866.entry.js +2 -0
- package/dist/pine-core/p-8a1b3866.entry.js.map +1 -0
- package/dist/pine-core/p-8c719c49.entry.js +2 -0
- package/dist/pine-core/p-8c719c49.entry.js.map +1 -0
- package/dist/pine-core/p-8f3273ed.system.entry.js +2 -0
- package/dist/pine-core/p-8f3273ed.system.entry.js.map +1 -0
- package/dist/pine-core/p-8fcfa336.entry.js +2 -0
- package/dist/pine-core/p-8fcfa336.entry.js.map +1 -0
- package/dist/pine-core/p-90694e70.entry.js +2 -0
- package/dist/pine-core/p-90694e70.entry.js.map +1 -0
- package/dist/pine-core/p-91bb8017.entry.js +2 -0
- package/dist/pine-core/p-91bb8017.entry.js.map +1 -0
- package/dist/pine-core/p-924a951b.system.entry.js +2 -0
- package/dist/pine-core/p-924a951b.system.entry.js.map +1 -0
- package/dist/pine-core/p-9c538ab0.entry.js +2 -0
- package/dist/pine-core/p-9c538ab0.entry.js.map +1 -0
- package/dist/pine-core/p-9d959d25.system.entry.js +2 -0
- package/dist/pine-core/p-9d959d25.system.entry.js.map +1 -0
- package/dist/pine-core/p-ad997571.system.entry.js +2 -0
- package/dist/pine-core/p-ad997571.system.entry.js.map +1 -0
- package/dist/pine-core/p-b1363254.entry.js +2 -0
- package/dist/pine-core/p-b1363254.entry.js.map +1 -0
- package/dist/pine-core/p-b47f8855.entry.js +2 -0
- package/dist/pine-core/p-b47f8855.entry.js.map +1 -0
- package/dist/pine-core/p-b480d80a.entry.js +2 -0
- package/dist/pine-core/p-b480d80a.entry.js.map +1 -0
- package/dist/pine-core/p-b5859bbd.system.entry.js +2 -0
- package/dist/pine-core/p-b5859bbd.system.entry.js.map +1 -0
- package/dist/pine-core/p-b978c861.entry.js +2 -0
- package/dist/pine-core/p-b978c861.entry.js.map +1 -0
- package/dist/pine-core/p-bdc39517.system.entry.js +2 -0
- package/dist/pine-core/p-bdc39517.system.entry.js.map +1 -0
- package/dist/pine-core/p-c03cfc96.js +2 -0
- package/dist/pine-core/p-c03cfc96.js.map +1 -0
- package/dist/pine-core/p-c56d871e.system.entry.js +2 -0
- package/dist/pine-core/p-c56d871e.system.entry.js.map +1 -0
- package/dist/pine-core/p-cca53530.system.entry.js +2 -0
- package/dist/pine-core/p-cca53530.system.entry.js.map +1 -0
- package/dist/pine-core/p-cddeae53.entry.js +2 -0
- package/dist/pine-core/p-cddeae53.entry.js.map +1 -0
- package/dist/pine-core/p-d33de2b3.system.entry.js +2 -0
- package/dist/pine-core/p-d33de2b3.system.entry.js.map +1 -0
- package/dist/pine-core/p-dcc876d5.entry.js +2 -0
- package/dist/pine-core/p-dcc876d5.entry.js.map +1 -0
- package/dist/pine-core/p-e1255160.js +2 -0
- package/dist/pine-core/p-e1255160.js.map +1 -0
- package/dist/pine-core/p-ece97e5b.system.js +2 -0
- package/dist/pine-core/p-ece97e5b.system.js.map +1 -0
- package/dist/pine-core/p-ee65aef1.system.js +2 -0
- package/dist/pine-core/p-ee65aef1.system.js.map +1 -0
- package/dist/pine-core/p-efc85823.js +2 -0
- package/dist/pine-core/p-efc85823.js.map +1 -0
- package/dist/pine-core/p-f1610dff.system.entry.js +2 -0
- package/dist/pine-core/p-f1610dff.system.entry.js.map +1 -0
- package/dist/pine-core/p-f666c482.entry.js +2 -0
- package/dist/pine-core/p-f666c482.entry.js.map +1 -0
- package/dist/pine-core/p-f80b45a9.system.entry.js +2 -0
- package/dist/pine-core/p-f80b45a9.system.entry.js.map +1 -0
- package/dist/pine-core/p-f92e85c4.entry.js +2 -0
- package/dist/pine-core/p-f92e85c4.entry.js.map +1 -0
- package/dist/pine-core/p-fc202585.entry.js +2 -0
- package/dist/pine-core/p-fc202585.entry.js.map +1 -0
- package/dist/pine-core/pine-core.css +1 -180
- package/dist/pine-core/pine-core.esm.js +1 -52
- package/dist/pine-core/pine-core.esm.js.map +1 -1
- package/dist/pine-core/pine-core.js +127 -0
- package/hydrate/index.js +28 -28
- package/package.json +1 -1
- package/dist/pine-core/index-00e73f84.js +0 -329
- package/dist/pine-core/index-00e73f84.js.map +0 -1
- package/dist/pine-core/index-cccc19b7.js.map +0 -1
- package/dist/pine-core/pds-accordion.entry.js.map +0 -1
- package/dist/pine-core/pds-avatar.entry.js.map +0 -1
- package/dist/pine-core/pds-box.entry.js +0 -77
- package/dist/pine-core/pds-box.entry.js.map +0 -1
- package/dist/pine-core/pds-button.entry.js.map +0 -1
- package/dist/pine-core/pds-checkbox.entry.js.map +0 -1
- package/dist/pine-core/pds-chip.entry.js +0 -46
- package/dist/pine-core/pds-chip.entry.js.map +0 -1
- package/dist/pine-core/pds-copytext.entry.js.map +0 -1
- package/dist/pine-core/pds-divider.entry.js +0 -31
- package/dist/pine-core/pds-divider.entry.js.map +0 -1
- package/dist/pine-core/pds-image.entry.js.map +0 -1
- package/dist/pine-core/pds-input.entry.js.map +0 -1
- package/dist/pine-core/pds-link.entry.js.map +0 -1
- package/dist/pine-core/pds-loader.entry.js +0 -44
- package/dist/pine-core/pds-loader.entry.js.map +0 -1
- package/dist/pine-core/pds-progress.entry.js +0 -23
- package/dist/pine-core/pds-progress.entry.js.map +0 -1
- package/dist/pine-core/pds-radio.entry.js.map +0 -1
- package/dist/pine-core/pds-row.entry.js +0 -46
- package/dist/pine-core/pds-row.entry.js.map +0 -1
- package/dist/pine-core/pds-sortable-item.entry.js +0 -30
- package/dist/pine-core/pds-sortable-item.entry.js.map +0 -1
- package/dist/pine-core/pds-sortable.entry.js.map +0 -1
- package/dist/pine-core/pds-switch.entry.js.map +0 -1
- package/dist/pine-core/pds-tab.entry.js +0 -29
- package/dist/pine-core/pds-tab.entry.js.map +0 -1
- package/dist/pine-core/pds-table-body.entry.js.map +0 -1
- package/dist/pine-core/pds-table-cell.entry.js.map +0 -1
- package/dist/pine-core/pds-table-head-cell.entry.js.map +0 -1
- package/dist/pine-core/pds-table-head.entry.js.map +0 -1
- package/dist/pine-core/pds-table-row.entry.js.map +0 -1
- package/dist/pine-core/pds-tabpanel.entry.js.map +0 -1
- package/dist/pine-core/pds-tabs.entry.js.map +0 -1
- package/dist/pine-core/pds-textarea.entry.js.map +0 -1
- package/dist/pine-core/pds-tooltip.entry.js.map +0 -1
- package/dist/pine-core/shadow-css-2e0fed52.js +0 -478
- package/dist/pine-core/shadow-css-2e0fed52.js.map +0 -1
- /package/dist/{pine-core → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{pine-core → esm}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{pine-core → esm}/closest-d2d192be.js +0 -0
- /package/dist/{pine-core → esm}/closest-d2d192be.js.map +0 -0
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopNamespace(e) {
|
|
4
|
+
if (e && e.__esModule) return e;
|
|
5
|
+
var n = Object.create(null);
|
|
6
|
+
if (e) {
|
|
7
|
+
Object.keys(e).forEach(function (k) {
|
|
8
|
+
if (k !== 'default') {
|
|
9
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return e[k];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n['default'] = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
const NAMESPACE = 'pine-core';
|
|
2
|
-
const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS:
|
|
3
|
-
const Env = /* pine-core */ {};
|
|
24
|
+
const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
4
25
|
|
|
5
26
|
/**
|
|
6
27
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -13,112 +34,25 @@ const Env = /* pine-core */ {};
|
|
|
13
34
|
let scopeId;
|
|
14
35
|
let contentRef;
|
|
15
36
|
let hostTagName;
|
|
16
|
-
let customError;
|
|
17
|
-
let i = 0;
|
|
18
37
|
let useNativeShadowDom = false;
|
|
19
38
|
let checkSlotFallbackVisibility = false;
|
|
20
39
|
let checkSlotRelocate = false;
|
|
21
40
|
let isSvgMode = false;
|
|
22
|
-
let renderingRef = null;
|
|
23
|
-
let queueCongestion = 0;
|
|
24
41
|
let queuePending = false;
|
|
25
|
-
const Build = {
|
|
26
|
-
isDev: BUILD.isDev ? true : false,
|
|
27
|
-
isBrowser: true,
|
|
28
|
-
isServer: false,
|
|
29
|
-
isTesting: BUILD.isTesting ? true : false,
|
|
30
|
-
};
|
|
31
|
-
const getAssetPath = (path) => {
|
|
32
|
-
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
33
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
34
|
-
};
|
|
35
|
-
const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
|
|
36
42
|
const createTime = (fnName, tagName = '') => {
|
|
37
|
-
|
|
38
|
-
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
39
|
-
// Start
|
|
40
|
-
performance.mark(key);
|
|
41
|
-
// End
|
|
42
|
-
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
43
|
+
{
|
|
45
44
|
return () => {
|
|
46
45
|
return;
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
const uniqueTime = (key, measureText) => {
|
|
51
|
-
|
|
52
|
-
if (performance.getEntriesByName(key, 'mark').length === 0) {
|
|
53
|
-
performance.mark(key);
|
|
54
|
-
}
|
|
55
|
-
return () => {
|
|
56
|
-
if (performance.getEntriesByName(measureText, 'measure').length === 0) {
|
|
57
|
-
performance.measure(measureText, key);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
50
|
+
{
|
|
62
51
|
return () => {
|
|
63
52
|
return;
|
|
64
53
|
};
|
|
65
54
|
}
|
|
66
55
|
};
|
|
67
|
-
const inspect = (ref) => {
|
|
68
|
-
const hostRef = getHostRef(ref);
|
|
69
|
-
if (!hostRef) {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
const flags = hostRef.$flags$;
|
|
73
|
-
const hostElement = hostRef.$hostElement$;
|
|
74
|
-
return {
|
|
75
|
-
renderCount: hostRef.$renderCount$,
|
|
76
|
-
flags: {
|
|
77
|
-
hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
|
|
78
|
-
hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
|
|
79
|
-
isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
|
|
80
|
-
isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
|
|
81
|
-
isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
|
|
82
|
-
hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
|
|
83
|
-
hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
|
|
84
|
-
isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
|
|
85
|
-
isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
|
|
86
|
-
needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
|
|
87
|
-
},
|
|
88
|
-
instanceValues: hostRef.$instanceValues$,
|
|
89
|
-
ancestorComponent: hostRef.$ancestorComponent$,
|
|
90
|
-
hostElement,
|
|
91
|
-
lazyInstance: hostRef.$lazyInstance$,
|
|
92
|
-
vnode: hostRef.$vnode$,
|
|
93
|
-
modeName: hostRef.$modeName$,
|
|
94
|
-
onReadyPromise: hostRef.$onReadyPromise$,
|
|
95
|
-
onReadyResolve: hostRef.$onReadyResolve$,
|
|
96
|
-
onInstancePromise: hostRef.$onInstancePromise$,
|
|
97
|
-
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
98
|
-
onRenderResolve: hostRef.$onRenderResolve$,
|
|
99
|
-
queuedListeners: hostRef.$queuedListeners$,
|
|
100
|
-
rmListeners: hostRef.$rmListeners$,
|
|
101
|
-
['s-id']: hostElement['s-id'],
|
|
102
|
-
['s-cr']: hostElement['s-cr'],
|
|
103
|
-
['s-lr']: hostElement['s-lr'],
|
|
104
|
-
['s-p']: hostElement['s-p'],
|
|
105
|
-
['s-rc']: hostElement['s-rc'],
|
|
106
|
-
['s-sc']: hostElement['s-sc'],
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
const installDevTools = () => {
|
|
110
|
-
if (BUILD.devTools) {
|
|
111
|
-
const stencil = (win.stencil = win.stencil || {});
|
|
112
|
-
const originalInspect = stencil.inspect;
|
|
113
|
-
stencil.inspect = (ref) => {
|
|
114
|
-
let result = inspect(ref);
|
|
115
|
-
if (!result && typeof originalInspect === 'function') {
|
|
116
|
-
result = originalInspect(ref);
|
|
117
|
-
}
|
|
118
|
-
return result;
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
56
|
const CONTENT_REF_ID = 'r';
|
|
123
57
|
const ORG_LOCATION_ID = 'o';
|
|
124
58
|
const SLOT_NODE_ID = 's';
|
|
@@ -135,12 +69,6 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
|
135
69
|
*/
|
|
136
70
|
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
137
71
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
138
|
-
const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
139
|
-
'formAssociatedCallback',
|
|
140
|
-
'formResetCallback',
|
|
141
|
-
'formDisabledCallback',
|
|
142
|
-
'formStateRestoreCallback',
|
|
143
|
-
];
|
|
144
72
|
/**
|
|
145
73
|
* Default style mode id
|
|
146
74
|
*/
|
|
@@ -206,11 +134,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
206
134
|
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
207
135
|
child = String(child);
|
|
208
136
|
}
|
|
209
|
-
else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
|
|
210
|
-
consoleDevError(`vNode passed as children has unexpected type.
|
|
211
|
-
Make sure it's using the correct h() function.
|
|
212
|
-
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
213
|
-
}
|
|
214
137
|
if (simple && lastSimple) {
|
|
215
138
|
// If the previous child was simple (string), we merge both
|
|
216
139
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -225,17 +148,14 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
225
148
|
};
|
|
226
149
|
walk(children);
|
|
227
150
|
if (vnodeData) {
|
|
228
|
-
if (
|
|
229
|
-
validateInputProperties(vnodeData);
|
|
230
|
-
}
|
|
231
|
-
if (BUILD.vdomKey && vnodeData.key) {
|
|
151
|
+
if (vnodeData.key) {
|
|
232
152
|
key = vnodeData.key;
|
|
233
153
|
}
|
|
234
|
-
if (
|
|
154
|
+
if (vnodeData.name) {
|
|
235
155
|
slotName = vnodeData.name;
|
|
236
156
|
}
|
|
237
157
|
// normalize class / className attributes
|
|
238
|
-
|
|
158
|
+
{
|
|
239
159
|
const classData = vnodeData.className || vnodeData.class;
|
|
240
160
|
if (classData) {
|
|
241
161
|
vnodeData.class =
|
|
@@ -247,12 +167,7 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
247
167
|
}
|
|
248
168
|
}
|
|
249
169
|
}
|
|
250
|
-
if (
|
|
251
|
-
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
252
|
-
- You are NOT using hostData() and <Host> in the same component.
|
|
253
|
-
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
254
|
-
}
|
|
255
|
-
if (BUILD.vdomFunctional && typeof nodeName === 'function') {
|
|
170
|
+
if (typeof nodeName === 'function') {
|
|
256
171
|
// nodeName is a functional component
|
|
257
172
|
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
258
173
|
}
|
|
@@ -261,10 +176,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
261
176
|
if (vNodeChildren.length > 0) {
|
|
262
177
|
vnode.$children$ = vNodeChildren;
|
|
263
178
|
}
|
|
264
|
-
|
|
179
|
+
{
|
|
265
180
|
vnode.$key$ = key;
|
|
266
181
|
}
|
|
267
|
-
|
|
182
|
+
{
|
|
268
183
|
vnode.$name$ = slotName;
|
|
269
184
|
}
|
|
270
185
|
return vnode;
|
|
@@ -285,13 +200,13 @@ const newVNode = (tag, text) => {
|
|
|
285
200
|
$elm$: null,
|
|
286
201
|
$children$: null,
|
|
287
202
|
};
|
|
288
|
-
|
|
203
|
+
{
|
|
289
204
|
vnode.$attrs$ = null;
|
|
290
205
|
}
|
|
291
|
-
|
|
206
|
+
{
|
|
292
207
|
vnode.$key$ = null;
|
|
293
208
|
}
|
|
294
|
-
|
|
209
|
+
{
|
|
295
210
|
vnode.$name$ = null;
|
|
296
211
|
}
|
|
297
212
|
return vnode;
|
|
@@ -357,25 +272,6 @@ const convertToPrivate = (node) => {
|
|
|
357
272
|
vnode.$name$ = node.vname;
|
|
358
273
|
return vnode;
|
|
359
274
|
};
|
|
360
|
-
/**
|
|
361
|
-
* Validates the ordering of attributes on an input element
|
|
362
|
-
*
|
|
363
|
-
* @param inputElm the element to validate
|
|
364
|
-
*/
|
|
365
|
-
const validateInputProperties = (inputElm) => {
|
|
366
|
-
const props = Object.keys(inputElm);
|
|
367
|
-
const value = props.indexOf('value');
|
|
368
|
-
if (value === -1) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const typeIndex = props.indexOf('type');
|
|
372
|
-
const minIndex = props.indexOf('min');
|
|
373
|
-
const maxIndex = props.indexOf('max');
|
|
374
|
-
const stepIndex = props.indexOf('step');
|
|
375
|
-
if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
|
|
376
|
-
consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
275
|
/**
|
|
380
276
|
* Entrypoint of the client-side hydration process. Facilitates calls to hydrate the
|
|
381
277
|
* document and all its nodes.
|
|
@@ -392,7 +288,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
392
288
|
const shadowRoot = hostElm.shadowRoot;
|
|
393
289
|
const childRenderNodes = [];
|
|
394
290
|
const slotNodes = [];
|
|
395
|
-
const shadowRootNodes =
|
|
291
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
396
292
|
const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
|
397
293
|
if (!plt.$orgLocNodes$) {
|
|
398
294
|
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
|
@@ -418,7 +314,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
418
314
|
}
|
|
419
315
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
420
316
|
});
|
|
421
|
-
if (
|
|
317
|
+
if (shadowRoot) {
|
|
422
318
|
shadowRootNodes.map((shadowRootNode) => {
|
|
423
319
|
if (shadowRootNode) {
|
|
424
320
|
shadowRoot.appendChild(shadowRootNode);
|
|
@@ -544,7 +440,7 @@ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes
|
|
|
544
440
|
node['s-sn'] = '';
|
|
545
441
|
}
|
|
546
442
|
node['s-sr'] = true;
|
|
547
|
-
if (
|
|
443
|
+
if (shadowRootNodes) {
|
|
548
444
|
// browser support shadowRoot and this is a shadow dom component
|
|
549
445
|
// create an actual slot element
|
|
550
446
|
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
@@ -568,11 +464,11 @@ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes
|
|
|
568
464
|
}
|
|
569
465
|
else if (childNodeType === CONTENT_REF_ID) {
|
|
570
466
|
// `${CONTENT_REF_ID}.${hostId}`;
|
|
571
|
-
if (
|
|
467
|
+
if (shadowRootNodes) {
|
|
572
468
|
// remove the content ref comment since it's not needed for shadow
|
|
573
469
|
node.remove();
|
|
574
470
|
}
|
|
575
|
-
else
|
|
471
|
+
else {
|
|
576
472
|
hostElm['s-cr'] = node;
|
|
577
473
|
node['s-cn'] = true;
|
|
578
474
|
}
|
|
@@ -617,11 +513,6 @@ const initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
|
617
513
|
}
|
|
618
514
|
}
|
|
619
515
|
};
|
|
620
|
-
// Private
|
|
621
|
-
const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
|
|
622
|
-
// Public
|
|
623
|
-
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
624
|
-
const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
625
516
|
/**
|
|
626
517
|
* Parse a new property value for a given property type.
|
|
627
518
|
*
|
|
@@ -648,16 +539,16 @@ const getMode = (ref) => getHostRef(ref).$modeName$;
|
|
|
648
539
|
const parsePropertyValue = (propValue, propType) => {
|
|
649
540
|
// ensure this value is of the correct prop type
|
|
650
541
|
if (propValue != null && !isComplexType(propValue)) {
|
|
651
|
-
if (
|
|
542
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
652
543
|
// per the HTML spec, any string value means it is a boolean true value
|
|
653
544
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
654
545
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
655
546
|
}
|
|
656
|
-
if (
|
|
547
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
657
548
|
// force it to be a number
|
|
658
549
|
return parseFloat(propValue);
|
|
659
550
|
}
|
|
660
|
-
if (
|
|
551
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
661
552
|
// could have been passed as a number or boolean
|
|
662
553
|
// but we still want it as a string
|
|
663
554
|
return String(propValue);
|
|
@@ -669,14 +560,11 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
669
560
|
// so no need to change to a different type
|
|
670
561
|
return propValue;
|
|
671
562
|
};
|
|
672
|
-
const getElement = (ref) => (
|
|
563
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
673
564
|
const createEvent = (ref, name, flags) => {
|
|
674
565
|
const elm = getElement(ref);
|
|
675
566
|
return {
|
|
676
567
|
emit: (detail) => {
|
|
677
|
-
if (BUILD.isDev && !elm.isConnected) {
|
|
678
|
-
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
679
|
-
}
|
|
680
568
|
return emitEvent(elm, name, {
|
|
681
569
|
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
682
570
|
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
@@ -717,11 +605,8 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
717
605
|
};
|
|
718
606
|
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
719
607
|
var _a;
|
|
720
|
-
const scopeId = getScopeId(cmpMeta
|
|
608
|
+
const scopeId = getScopeId(cmpMeta);
|
|
721
609
|
const style = styles.get(scopeId);
|
|
722
|
-
if (!BUILD.attachStyles) {
|
|
723
|
-
return scopeId;
|
|
724
|
-
}
|
|
725
610
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
726
611
|
// so the fallback is to always use the document for the root node in those cases
|
|
727
612
|
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -734,8 +619,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
734
619
|
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
735
620
|
}
|
|
736
621
|
if (!appliedStyles.has(scopeId)) {
|
|
737
|
-
if (
|
|
738
|
-
styleContainerNode.host &&
|
|
622
|
+
if (styleContainerNode.host &&
|
|
739
623
|
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
740
624
|
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
741
625
|
styleElm.innerHTML = style;
|
|
@@ -748,9 +632,6 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
748
632
|
if (nonce != null) {
|
|
749
633
|
styleElm.setAttribute('nonce', nonce);
|
|
750
634
|
}
|
|
751
|
-
if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
|
|
752
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
|
|
753
|
-
}
|
|
754
635
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
755
636
|
}
|
|
756
637
|
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
@@ -762,7 +643,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
762
643
|
}
|
|
763
644
|
}
|
|
764
645
|
}
|
|
765
|
-
else if (
|
|
646
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
766
647
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
767
648
|
}
|
|
768
649
|
}
|
|
@@ -773,8 +654,8 @@ const attachStyles = (hostRef) => {
|
|
|
773
654
|
const elm = hostRef.$hostElement$;
|
|
774
655
|
const flags = cmpMeta.$flags$;
|
|
775
656
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
776
|
-
const scopeId = addStyle(
|
|
777
|
-
if (
|
|
657
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
658
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
778
659
|
// only required when we're NOT using native shadow dom (slot)
|
|
779
660
|
// or this browser doesn't support native shadow dom
|
|
780
661
|
// and this host element was NOT created with SSR
|
|
@@ -784,13 +665,13 @@ const attachStyles = (hostRef) => {
|
|
|
784
665
|
// DOM WRITE!!
|
|
785
666
|
elm['s-sc'] = scopeId;
|
|
786
667
|
elm.classList.add(scopeId + '-h');
|
|
787
|
-
if (
|
|
668
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
788
669
|
elm.classList.add(scopeId + '-s');
|
|
789
670
|
}
|
|
790
671
|
}
|
|
791
672
|
endAttachStyles();
|
|
792
673
|
};
|
|
793
|
-
const getScopeId = (cmp, mode) => 'sc-' + (
|
|
674
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
794
675
|
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
795
676
|
/**
|
|
796
677
|
* Production setAccessor() function based on Preact by
|
|
@@ -819,19 +700,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
819
700
|
if (oldValue !== newValue) {
|
|
820
701
|
let isProp = isMemberInElement(elm, memberName);
|
|
821
702
|
let ln = memberName.toLowerCase();
|
|
822
|
-
if (
|
|
703
|
+
if (memberName === 'class') {
|
|
823
704
|
const classList = elm.classList;
|
|
824
705
|
const oldClasses = parseClassList(oldValue);
|
|
825
706
|
const newClasses = parseClassList(newValue);
|
|
826
707
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
827
708
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
828
709
|
}
|
|
829
|
-
else if (
|
|
710
|
+
else if (memberName === 'style') {
|
|
830
711
|
// update style attribute, css properties and values
|
|
831
|
-
|
|
712
|
+
{
|
|
832
713
|
for (const prop in oldValue) {
|
|
833
714
|
if (!newValue || newValue[prop] == null) {
|
|
834
|
-
if (
|
|
715
|
+
if (prop.includes('-')) {
|
|
835
716
|
elm.style.removeProperty(prop);
|
|
836
717
|
}
|
|
837
718
|
else {
|
|
@@ -842,7 +723,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
842
723
|
}
|
|
843
724
|
for (const prop in newValue) {
|
|
844
725
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
845
|
-
if (
|
|
726
|
+
if (prop.includes('-')) {
|
|
846
727
|
elm.style.setProperty(prop, newValue[prop]);
|
|
847
728
|
}
|
|
848
729
|
else {
|
|
@@ -851,16 +732,15 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
851
732
|
}
|
|
852
733
|
}
|
|
853
734
|
}
|
|
854
|
-
else if (
|
|
735
|
+
else if (memberName === 'key')
|
|
855
736
|
;
|
|
856
|
-
else if (
|
|
737
|
+
else if (memberName === 'ref') {
|
|
857
738
|
// minifier will clean this up
|
|
858
739
|
if (newValue) {
|
|
859
740
|
newValue(elm);
|
|
860
741
|
}
|
|
861
742
|
}
|
|
862
|
-
else if (
|
|
863
|
-
(BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
|
|
743
|
+
else if ((!isProp ) &&
|
|
864
744
|
memberName[0] === 'o' &&
|
|
865
745
|
memberName[1] === 'n') {
|
|
866
746
|
// Event Handlers
|
|
@@ -907,7 +787,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
907
787
|
}
|
|
908
788
|
}
|
|
909
789
|
}
|
|
910
|
-
else
|
|
790
|
+
else {
|
|
911
791
|
// Set property if it exists and it's not a SVG
|
|
912
792
|
const isComplex = isComplexType(newValue);
|
|
913
793
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
@@ -940,7 +820,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
940
820
|
* - if the newValue is null/undefined or 'false'.
|
|
941
821
|
*/
|
|
942
822
|
let xlink = false;
|
|
943
|
-
|
|
823
|
+
{
|
|
944
824
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
945
825
|
memberName = ln;
|
|
946
826
|
xlink = true;
|
|
@@ -948,7 +828,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
948
828
|
}
|
|
949
829
|
if (newValue == null || newValue === false) {
|
|
950
830
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
951
|
-
if (
|
|
831
|
+
if (xlink) {
|
|
952
832
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
953
833
|
}
|
|
954
834
|
else {
|
|
@@ -958,7 +838,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
958
838
|
}
|
|
959
839
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
960
840
|
newValue = newValue === true ? '' : newValue;
|
|
961
|
-
if (
|
|
841
|
+
if (xlink) {
|
|
962
842
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
963
843
|
}
|
|
964
844
|
else {
|
|
@@ -986,7 +866,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
986
866
|
: newVnode.$elm$;
|
|
987
867
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
988
868
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
989
|
-
|
|
869
|
+
{
|
|
990
870
|
// remove attributes no longer present on the vnode by setting them to undefined
|
|
991
871
|
for (memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
992
872
|
if (!(memberName in newVnodeAttrs)) {
|
|
@@ -1035,7 +915,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1035
915
|
let elm;
|
|
1036
916
|
let childNode;
|
|
1037
917
|
let oldVNode;
|
|
1038
|
-
if (
|
|
918
|
+
if (!useNativeShadowDom) {
|
|
1039
919
|
// remember for later we need to check to relocate nodes
|
|
1040
920
|
checkSlotRelocate = true;
|
|
1041
921
|
if (newVNode.$tag$ === 'slot') {
|
|
@@ -1050,38 +930,32 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1050
930
|
1 /* VNODE_FLAGS.isSlotReference */;
|
|
1051
931
|
}
|
|
1052
932
|
}
|
|
1053
|
-
if (
|
|
1054
|
-
consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
|
|
1055
|
-
}
|
|
1056
|
-
if (BUILD.vdomText && newVNode.$text$ !== null) {
|
|
933
|
+
if (newVNode.$text$ !== null) {
|
|
1057
934
|
// create text node
|
|
1058
935
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
1059
936
|
}
|
|
1060
|
-
else if (
|
|
937
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
1061
938
|
// create a slot reference node
|
|
1062
939
|
elm = newVNode.$elm$ =
|
|
1063
|
-
|
|
940
|
+
doc.createTextNode('');
|
|
1064
941
|
}
|
|
1065
942
|
else {
|
|
1066
|
-
if (
|
|
943
|
+
if (!isSvgMode) {
|
|
1067
944
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
1068
945
|
}
|
|
1069
946
|
// create element
|
|
1070
|
-
elm = newVNode.$elm$ = (
|
|
1071
|
-
? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
947
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
1072
948
|
? 'slot-fb'
|
|
1073
949
|
: newVNode.$tag$)
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
: newVNode.$tag$));
|
|
1077
|
-
if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
950
|
+
);
|
|
951
|
+
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
1078
952
|
isSvgMode = false;
|
|
1079
953
|
}
|
|
1080
954
|
// add css classes, attrs, props, listeners, etc.
|
|
1081
|
-
|
|
955
|
+
{
|
|
1082
956
|
updateElement(null, newVNode, isSvgMode);
|
|
1083
957
|
}
|
|
1084
|
-
if (
|
|
958
|
+
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
1085
959
|
// if there is a scopeId and this is the initial render
|
|
1086
960
|
// then let's add the scopeId as a css class
|
|
1087
961
|
elm.classList.add((elm['s-si'] = scopeId));
|
|
@@ -1097,7 +971,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1097
971
|
}
|
|
1098
972
|
}
|
|
1099
973
|
}
|
|
1100
|
-
|
|
974
|
+
{
|
|
1101
975
|
if (newVNode.$tag$ === 'svg') {
|
|
1102
976
|
// Only reset the SVG context when we're exiting <svg> element
|
|
1103
977
|
isSvgMode = false;
|
|
@@ -1111,7 +985,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1111
985
|
// This needs to always happen so we can hide nodes that are projected
|
|
1112
986
|
// to another component but don't end up in a slot
|
|
1113
987
|
elm['s-hn'] = hostTagName;
|
|
1114
|
-
|
|
988
|
+
{
|
|
1115
989
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
1116
990
|
// remember the content reference comment
|
|
1117
991
|
elm['s-sr'] = true;
|
|
@@ -1124,12 +998,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1124
998
|
// check if we've got an old vnode for this slot
|
|
1125
999
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1126
1000
|
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
1127
|
-
|
|
1128
|
-
// we've got an old slot vnode and the wrapper is being replaced
|
|
1129
|
-
// so let's move the old slot content to the root of the element currently being rendered
|
|
1130
|
-
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1131
|
-
}
|
|
1132
|
-
else {
|
|
1001
|
+
{
|
|
1133
1002
|
// we've got an old slot vnode and the wrapper is being replaced
|
|
1134
1003
|
// so let's move the old slot content back to its original location
|
|
1135
1004
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
@@ -1139,36 +1008,6 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1139
1008
|
}
|
|
1140
1009
|
return elm;
|
|
1141
1010
|
};
|
|
1142
|
-
/**
|
|
1143
|
-
* Relocates all child nodes of an element that were a part of a previous slot relocation
|
|
1144
|
-
* to the root of the Stencil component currently being rendered. This happens when a parent
|
|
1145
|
-
* element of a slot reference node dynamically changes and triggers a re-render. We cannot use
|
|
1146
|
-
* `putBackInOriginalLocation()` because that may relocate nodes to elements that will not be re-rendered
|
|
1147
|
-
* and so they will not be relocated again.
|
|
1148
|
-
*
|
|
1149
|
-
* @param parentElm The element potentially containing relocated nodes.
|
|
1150
|
-
*/
|
|
1151
|
-
const relocateToHostRoot = (parentElm) => {
|
|
1152
|
-
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1153
|
-
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1154
|
-
if (host != null) {
|
|
1155
|
-
const contentRefNode = Array.from(host.childNodes).find((ref) => ref['s-cr']);
|
|
1156
|
-
const childNodeArray = Array.from(parentElm.childNodes);
|
|
1157
|
-
// If we have a content ref, we need to invert the order of the nodes we're relocating
|
|
1158
|
-
// to preserve the correct order of elements in the DOM on future relocations
|
|
1159
|
-
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1160
|
-
// Only relocate nodes that were slotted in
|
|
1161
|
-
if (childNode['s-sh'] != null) {
|
|
1162
|
-
host.insertBefore(childNode, contentRefNode !== null && contentRefNode !== void 0 ? contentRefNode : null);
|
|
1163
|
-
// Reset so we can correctly move the node around again.
|
|
1164
|
-
childNode['s-sh'] = undefined;
|
|
1165
|
-
// Need to tell the render pipeline to check to relocate slot content again
|
|
1166
|
-
checkSlotRelocate = true;
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1171
|
-
};
|
|
1172
1011
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1173
1012
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1174
1013
|
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
@@ -1216,9 +1055,9 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1216
1055
|
* creating DOM nodes (inclusive)
|
|
1217
1056
|
*/
|
|
1218
1057
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1219
|
-
let containerElm = ((
|
|
1058
|
+
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
1220
1059
|
let childNode;
|
|
1221
|
-
if (
|
|
1060
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1222
1061
|
containerElm = containerElm.shadowRoot;
|
|
1223
1062
|
}
|
|
1224
1063
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1226,7 +1065,7 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
1226
1065
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
1227
1066
|
if (childNode) {
|
|
1228
1067
|
vnodes[startIdx].$elm$ = childNode;
|
|
1229
|
-
containerElm.insertBefore(childNode,
|
|
1068
|
+
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
1230
1069
|
}
|
|
1231
1070
|
}
|
|
1232
1071
|
}
|
|
@@ -1249,7 +1088,7 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1249
1088
|
const elm = vnode.$elm$;
|
|
1250
1089
|
nullifyVNodeRefs(vnode);
|
|
1251
1090
|
if (elm) {
|
|
1252
|
-
|
|
1091
|
+
{
|
|
1253
1092
|
// we're removing this element
|
|
1254
1093
|
// so it's possible we need to show slot fallback content now
|
|
1255
1094
|
checkSlotFallbackVisibility = true;
|
|
@@ -1397,7 +1236,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1397
1236
|
//
|
|
1398
1237
|
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
1399
1238
|
// and move the DOM element for `oldStartVnode`.
|
|
1400
|
-
if (
|
|
1239
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1401
1240
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1402
1241
|
}
|
|
1403
1242
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1438,7 +1277,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1438
1277
|
// (which will handle updating any changed attributes, reconciling their
|
|
1439
1278
|
// children etc) but we also need to move the DOM node to which
|
|
1440
1279
|
// `oldEndVnode` corresponds.
|
|
1441
|
-
if (
|
|
1280
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
1442
1281
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1443
1282
|
}
|
|
1444
1283
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1461,7 +1300,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1461
1300
|
// children which have the same key as the first node in the new
|
|
1462
1301
|
// children.
|
|
1463
1302
|
idxInOld = -1;
|
|
1464
|
-
|
|
1303
|
+
{
|
|
1465
1304
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
1466
1305
|
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
1467
1306
|
idxInOld = i;
|
|
@@ -1469,7 +1308,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1469
1308
|
}
|
|
1470
1309
|
}
|
|
1471
1310
|
}
|
|
1472
|
-
if (
|
|
1311
|
+
if (idxInOld >= 0) {
|
|
1473
1312
|
// We found a node in the old children which matches up with the first
|
|
1474
1313
|
// node in the new children! So let's deal with that
|
|
1475
1314
|
elmToMove = oldCh[idxInOld];
|
|
@@ -1496,12 +1335,9 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1496
1335
|
}
|
|
1497
1336
|
if (node) {
|
|
1498
1337
|
// if we created a new node then handle inserting it to the DOM
|
|
1499
|
-
|
|
1338
|
+
{
|
|
1500
1339
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
1501
1340
|
}
|
|
1502
|
-
else {
|
|
1503
|
-
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
1504
|
-
}
|
|
1505
1341
|
}
|
|
1506
1342
|
}
|
|
1507
1343
|
}
|
|
@@ -1509,7 +1345,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
1509
1345
|
// we have some more new nodes to add which don't match up with old nodes
|
|
1510
1346
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
1511
1347
|
}
|
|
1512
|
-
else if (
|
|
1348
|
+
else if (newStartIdx > newEndIdx) {
|
|
1513
1349
|
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
1514
1350
|
// in the new array, so lets remove them (which entails cleaning up the
|
|
1515
1351
|
// relevant DOM nodes)
|
|
@@ -1539,7 +1375,7 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
1539
1375
|
// compare if two vnode to see if they're "technically" the same
|
|
1540
1376
|
// need to have the same element tag, and same key to be the same
|
|
1541
1377
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1542
|
-
if (
|
|
1378
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
1543
1379
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1544
1380
|
}
|
|
1545
1381
|
// this will be set if JSX tags in the build have `key` attrs set on them
|
|
@@ -1547,7 +1383,7 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
1547
1383
|
// first render `leftVNode.$key$` will always be `null`, so we can be led
|
|
1548
1384
|
// astray and, for instance, accidentally delete a DOM node that we want to
|
|
1549
1385
|
// keep around.
|
|
1550
|
-
if (
|
|
1386
|
+
if (!isInitialRender) {
|
|
1551
1387
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1552
1388
|
}
|
|
1553
1389
|
return true;
|
|
@@ -1578,19 +1414,14 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
1578
1414
|
const tag = newVNode.$tag$;
|
|
1579
1415
|
const text = newVNode.$text$;
|
|
1580
1416
|
let defaultHolder;
|
|
1581
|
-
if (
|
|
1582
|
-
|
|
1417
|
+
if (text === null) {
|
|
1418
|
+
{
|
|
1583
1419
|
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
1584
1420
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1585
1421
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1586
1422
|
}
|
|
1587
|
-
|
|
1588
|
-
if (
|
|
1589
|
-
if (BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode.$name$) {
|
|
1590
|
-
newVNode.$elm$['s-sn'] = newVNode.$name$ || '';
|
|
1591
|
-
relocateToHostRoot(newVNode.$elm$.parentElement);
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1423
|
+
{
|
|
1424
|
+
if (tag === 'slot' && !useNativeShadowDom) ;
|
|
1594
1425
|
else {
|
|
1595
1426
|
// either this is the first render of an element OR it's an update
|
|
1596
1427
|
// AND we already know it's possible it could have changed
|
|
@@ -1598,33 +1429,33 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
1598
1429
|
updateElement(oldVNode, newVNode, isSvgMode);
|
|
1599
1430
|
}
|
|
1600
1431
|
}
|
|
1601
|
-
if (
|
|
1432
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1602
1433
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1603
1434
|
// so we need to call `updateChildren` to reconcile them
|
|
1604
1435
|
updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
|
|
1605
1436
|
}
|
|
1606
1437
|
else if (newChildren !== null) {
|
|
1607
1438
|
// no old child vnodes, but there are new child vnodes to add
|
|
1608
|
-
if (
|
|
1439
|
+
if (oldVNode.$text$ !== null) {
|
|
1609
1440
|
// the old vnode was text, so be sure to clear it out
|
|
1610
1441
|
elm.textContent = '';
|
|
1611
1442
|
}
|
|
1612
1443
|
// add the new vnode children
|
|
1613
1444
|
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
1614
1445
|
}
|
|
1615
|
-
else if (
|
|
1446
|
+
else if (oldChildren !== null) {
|
|
1616
1447
|
// no new child vnodes, but there are old child vnodes to remove
|
|
1617
1448
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1618
1449
|
}
|
|
1619
|
-
if (
|
|
1450
|
+
if (isSvgMode && tag === 'svg') {
|
|
1620
1451
|
isSvgMode = false;
|
|
1621
1452
|
}
|
|
1622
1453
|
}
|
|
1623
|
-
else if (
|
|
1454
|
+
else if ((defaultHolder = elm['s-cr'])) {
|
|
1624
1455
|
// this element has slotted content
|
|
1625
1456
|
defaultHolder.parentNode.textContent = text;
|
|
1626
1457
|
}
|
|
1627
|
-
else if (
|
|
1458
|
+
else if (oldVNode.$text$ !== text) {
|
|
1628
1459
|
// update the text content for the text only vnode
|
|
1629
1460
|
// and also only if the text is different than before
|
|
1630
1461
|
elm.data = text;
|
|
@@ -1725,7 +1556,7 @@ const markSlotContentForRelocation = (elm) => {
|
|
|
1725
1556
|
if (!node['s-cn'] &&
|
|
1726
1557
|
!node['s-nr'] &&
|
|
1727
1558
|
node['s-hn'] !== childNode['s-hn'] &&
|
|
1728
|
-
(!BUILD.experimentalSlotFixes
|
|
1559
|
+
(!BUILD.experimentalSlotFixes )) {
|
|
1729
1560
|
// if `node` is located in the slot that `childNode` refers to (via the
|
|
1730
1561
|
// `'s-sn'` property) then we need to relocate it from it's current spot
|
|
1731
1562
|
// (under the host element parent) to the right slot location
|
|
@@ -1815,7 +1646,7 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
1815
1646
|
* @param vNode a virtual DOM node
|
|
1816
1647
|
*/
|
|
1817
1648
|
const nullifyVNodeRefs = (vNode) => {
|
|
1818
|
-
|
|
1649
|
+
{
|
|
1819
1650
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1820
1651
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1821
1652
|
}
|
|
@@ -1834,7 +1665,7 @@ const nullifyVNodeRefs = (vNode) => {
|
|
|
1834
1665
|
* @param isInitialLoad whether or not this is the first call after page load
|
|
1835
1666
|
*/
|
|
1836
1667
|
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1837
|
-
var _a, _b, _c, _d
|
|
1668
|
+
var _a, _b, _c, _d;
|
|
1838
1669
|
const hostElm = hostRef.$hostElement$;
|
|
1839
1670
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1840
1671
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -1845,22 +1676,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1845
1676
|
// contains attrs that need to be set on the host element.
|
|
1846
1677
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1847
1678
|
hostTagName = hostElm.tagName;
|
|
1848
|
-
|
|
1849
|
-
if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1850
|
-
throw new Error(`The <Host> must be the single root component.
|
|
1851
|
-
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1852
|
-
|
|
1853
|
-
The render() function should look like this instead:
|
|
1854
|
-
|
|
1855
|
-
render() {
|
|
1856
|
-
// Do not return an array
|
|
1857
|
-
return (
|
|
1858
|
-
<Host>{content}</Host>
|
|
1859
|
-
);
|
|
1860
|
-
}
|
|
1861
|
-
`);
|
|
1862
|
-
}
|
|
1863
|
-
if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1679
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1864
1680
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1865
1681
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1866
1682
|
}
|
|
@@ -1888,19 +1704,19 @@ render() {
|
|
|
1888
1704
|
rootVnode.$tag$ = null;
|
|
1889
1705
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1890
1706
|
hostRef.$vnode$ = rootVnode;
|
|
1891
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (
|
|
1892
|
-
|
|
1707
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
1708
|
+
{
|
|
1893
1709
|
scopeId = hostElm['s-sc'];
|
|
1894
1710
|
}
|
|
1895
|
-
useNativeShadowDom =
|
|
1896
|
-
|
|
1711
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1712
|
+
{
|
|
1897
1713
|
contentRef = hostElm['s-cr'];
|
|
1898
1714
|
// always reset
|
|
1899
1715
|
checkSlotFallbackVisibility = false;
|
|
1900
1716
|
}
|
|
1901
1717
|
// synchronous patch
|
|
1902
1718
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1903
|
-
|
|
1719
|
+
{
|
|
1904
1720
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
1905
1721
|
// the disconnectCallback from working
|
|
1906
1722
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
@@ -1911,9 +1727,7 @@ render() {
|
|
|
1911
1727
|
if (!nodeToRelocate['s-ol']) {
|
|
1912
1728
|
// add a reference node marking this node's original location
|
|
1913
1729
|
// keep a reference to this node for later lookups
|
|
1914
|
-
const orgLocationNode =
|
|
1915
|
-
? originalLocationDebugNode(nodeToRelocate)
|
|
1916
|
-
: doc.createTextNode('');
|
|
1730
|
+
const orgLocationNode = doc.createTextNode('');
|
|
1917
1731
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1918
1732
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1919
1733
|
}
|
|
@@ -1937,8 +1751,7 @@ render() {
|
|
|
1937
1751
|
// to make sure they get inserted into their new home in the same order they were declared in their original location.
|
|
1938
1752
|
//
|
|
1939
1753
|
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
|
|
1940
|
-
|
|
1941
|
-
(insertBeforeNode && insertBeforeNode.nodeType === 1 /* NODE_TYPE.ElementNode */)) {
|
|
1754
|
+
{
|
|
1942
1755
|
let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
1943
1756
|
while (orgLocationNode) {
|
|
1944
1757
|
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
@@ -1963,7 +1776,7 @@ render() {
|
|
|
1963
1776
|
// since that the node to relocate
|
|
1964
1777
|
// has a different next sibling or parent relocated
|
|
1965
1778
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1966
|
-
if (!
|
|
1779
|
+
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
1967
1780
|
// probably a component in the index.html that doesn't have its hostname set
|
|
1968
1781
|
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1969
1782
|
}
|
|
@@ -2005,41 +1818,19 @@ render() {
|
|
|
2005
1818
|
// always reset
|
|
2006
1819
|
relocateNodes.length = 0;
|
|
2007
1820
|
}
|
|
2008
|
-
// Hide any elements that were projected through, but don't have a slot to go to.
|
|
2009
|
-
// Only an issue if there were no "slots" rendered. Otherwise, nodes are hidden correctly.
|
|
2010
|
-
// This _only_ happens for `scoped` components!
|
|
2011
|
-
if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
2012
|
-
for (const childNode of rootVnode.$elm$.childNodes) {
|
|
2013
|
-
if (childNode['s-hn'] !== hostTagName && !childNode['s-sh']) {
|
|
2014
|
-
// Store the initial value of `hidden` so we can reset it later when
|
|
2015
|
-
// moving nodes around.
|
|
2016
|
-
if (isInitialLoad && childNode['s-ih'] == null) {
|
|
2017
|
-
childNode['s-ih'] = (_e = childNode.hidden) !== null && _e !== void 0 ? _e : false;
|
|
2018
|
-
}
|
|
2019
|
-
childNode.hidden = true;
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
1821
|
// Clear the content ref so we don't create a memory leak
|
|
2024
1822
|
contentRef = undefined;
|
|
2025
1823
|
};
|
|
2026
|
-
// slot comment debug nodes only created with the `--debug` flag
|
|
2027
|
-
// otherwise these nodes are text nodes w/out content
|
|
2028
|
-
const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
|
|
2029
|
-
const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
|
|
2030
|
-
(nodeToRelocate.localName
|
|
2031
|
-
? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
|
|
2032
|
-
: `[${nodeToRelocate.textContent}]`));
|
|
2033
1824
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2034
|
-
if (
|
|
1825
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
2035
1826
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
2036
1827
|
}
|
|
2037
1828
|
};
|
|
2038
1829
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2039
|
-
|
|
1830
|
+
{
|
|
2040
1831
|
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
2041
1832
|
}
|
|
2042
|
-
if (
|
|
1833
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
2043
1834
|
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
2044
1835
|
return;
|
|
2045
1836
|
}
|
|
@@ -2048,7 +1839,7 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
2048
1839
|
// has already fired off its lifecycle update then
|
|
2049
1840
|
// fire off the initial update
|
|
2050
1841
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2051
|
-
return
|
|
1842
|
+
return writeTask(dispatch) ;
|
|
2052
1843
|
};
|
|
2053
1844
|
/**
|
|
2054
1845
|
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
@@ -2061,9 +1852,8 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
2061
1852
|
* the component
|
|
2062
1853
|
*/
|
|
2063
1854
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2064
|
-
const elm = hostRef.$hostElement$;
|
|
2065
1855
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
2066
|
-
const instance =
|
|
1856
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
2067
1857
|
// We're going to use this variable together with `enqueue` to implement a
|
|
2068
1858
|
// little promise-based queue. We start out with it `undefined`. When we add
|
|
2069
1859
|
// the first function to the queue we'll set this variable to be that
|
|
@@ -2078,15 +1868,14 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2078
1868
|
// called in order after `dispatchHooks` exits.
|
|
2079
1869
|
let maybePromise;
|
|
2080
1870
|
if (isInitialLoad) {
|
|
2081
|
-
|
|
1871
|
+
{
|
|
2082
1872
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
2083
1873
|
if (hostRef.$queuedListeners$) {
|
|
2084
1874
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
2085
1875
|
hostRef.$queuedListeners$ = undefined;
|
|
2086
1876
|
}
|
|
2087
1877
|
}
|
|
2088
|
-
|
|
2089
|
-
if (BUILD.cmpWillLoad) {
|
|
1878
|
+
{
|
|
2090
1879
|
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
2091
1880
|
// whatever's going on in that `Promise` before we launch into
|
|
2092
1881
|
// rendering the component, doing other lifecycle stuff, etc. So
|
|
@@ -2095,19 +1884,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2095
1884
|
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
2096
1885
|
}
|
|
2097
1886
|
}
|
|
2098
|
-
|
|
2099
|
-
emitLifecycleEvent(elm, 'componentWillUpdate');
|
|
2100
|
-
if (BUILD.cmpWillUpdate) {
|
|
2101
|
-
// Like `componentWillLoad` above, we allow Stencil component
|
|
2102
|
-
// authors to return a `Promise` from this lifecycle callback, and
|
|
2103
|
-
// we specify that our runtime will wait for that `Promise` to
|
|
2104
|
-
// resolve before the component re-renders. So if the method
|
|
2105
|
-
// returns a `Promise` we need to keep it around!
|
|
2106
|
-
maybePromise = safeCall(instance, 'componentWillUpdate');
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
emitLifecycleEvent(elm, 'componentWillRender');
|
|
2110
|
-
if (BUILD.cmpWillRender) {
|
|
1887
|
+
{
|
|
2111
1888
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
|
|
2112
1889
|
}
|
|
2113
1890
|
endSchedule();
|
|
@@ -2157,43 +1934,15 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2157
1934
|
const elm = hostRef.$hostElement$;
|
|
2158
1935
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
2159
1936
|
const rc = elm['s-rc'];
|
|
2160
|
-
if (
|
|
1937
|
+
if (isInitialLoad) {
|
|
2161
1938
|
// DOM WRITE!
|
|
2162
1939
|
attachStyles(hostRef);
|
|
2163
1940
|
}
|
|
2164
1941
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
2165
|
-
|
|
2166
|
-
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
2167
|
-
}
|
|
2168
|
-
if (BUILD.hydrateServerSide) {
|
|
2169
|
-
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2170
|
-
}
|
|
2171
|
-
else {
|
|
1942
|
+
{
|
|
2172
1943
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2173
1944
|
}
|
|
2174
|
-
if (
|
|
2175
|
-
hostRef.$renderCount$ = hostRef.$renderCount$ === undefined ? 1 : hostRef.$renderCount$ + 1;
|
|
2176
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
2177
|
-
}
|
|
2178
|
-
if (BUILD.hydrateServerSide) {
|
|
2179
|
-
try {
|
|
2180
|
-
// manually connected child components during server-side hydrate
|
|
2181
|
-
serverSideConnected(elm);
|
|
2182
|
-
if (isInitialLoad) {
|
|
2183
|
-
// using only during server-side hydrate
|
|
2184
|
-
if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2185
|
-
elm['s-en'] = '';
|
|
2186
|
-
}
|
|
2187
|
-
else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
2188
|
-
elm['s-en'] = 'c';
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
catch (e) {
|
|
2193
|
-
consoleError(e, elm);
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
if (BUILD.asyncLoading && rc) {
|
|
1945
|
+
if (rc) {
|
|
2197
1946
|
// ok, so turns out there are some child host elements
|
|
2198
1947
|
// waiting on this parent element to load
|
|
2199
1948
|
// let's fire off all update callbacks waiting
|
|
@@ -2202,7 +1951,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2202
1951
|
}
|
|
2203
1952
|
endRender();
|
|
2204
1953
|
endUpdate();
|
|
2205
|
-
|
|
1954
|
+
{
|
|
2206
1955
|
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
2207
1956
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2208
1957
|
if (childrenPromises.length === 0) {
|
|
@@ -2214,9 +1963,6 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2214
1963
|
childrenPromises.length = 0;
|
|
2215
1964
|
}
|
|
2216
1965
|
}
|
|
2217
|
-
else {
|
|
2218
|
-
postUpdateComponent(hostRef);
|
|
2219
|
-
}
|
|
2220
1966
|
};
|
|
2221
1967
|
/**
|
|
2222
1968
|
* Handle making the call to the VDom renderer with the proper context given
|
|
@@ -2231,119 +1977,72 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2231
1977
|
* @returns an empty promise
|
|
2232
1978
|
*/
|
|
2233
1979
|
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2234
|
-
// in order for bundlers to correctly tree-shake the BUILD object
|
|
2235
|
-
// we need to ensure BUILD is not deoptimized within a try/catch
|
|
2236
|
-
// https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
|
|
2237
|
-
const allRenderFn = BUILD.allRenderFn ? true : false;
|
|
2238
|
-
const lazyLoad = BUILD.lazyLoad ? true : false;
|
|
2239
|
-
const taskQueue = BUILD.taskQueue ? true : false;
|
|
2240
|
-
const updatable = BUILD.updatable ? true : false;
|
|
2241
1980
|
try {
|
|
2242
|
-
renderingRef = instance;
|
|
2243
1981
|
/**
|
|
2244
1982
|
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
2245
1983
|
* method, so we can call the method immediately. If not, check before calling it.
|
|
2246
1984
|
*/
|
|
2247
|
-
instance =
|
|
2248
|
-
|
|
1985
|
+
instance = instance.render() ;
|
|
1986
|
+
{
|
|
2249
1987
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
2250
1988
|
}
|
|
2251
|
-
|
|
1989
|
+
{
|
|
2252
1990
|
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
2253
1991
|
}
|
|
2254
|
-
|
|
2255
|
-
|
|
1992
|
+
{
|
|
1993
|
+
{
|
|
2256
1994
|
// looks like we've got child nodes to render into this host element
|
|
2257
1995
|
// or we need to update the css class/attrs on the host element
|
|
2258
1996
|
// DOM WRITE!
|
|
2259
|
-
|
|
2260
|
-
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2261
|
-
}
|
|
2262
|
-
else {
|
|
1997
|
+
{
|
|
2263
1998
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
2264
1999
|
}
|
|
2265
2000
|
}
|
|
2266
|
-
else {
|
|
2267
|
-
const shadowRoot = elm.shadowRoot;
|
|
2268
|
-
if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2269
|
-
shadowRoot.textContent = instance;
|
|
2270
|
-
}
|
|
2271
|
-
else {
|
|
2272
|
-
elm.textContent = instance;
|
|
2273
|
-
}
|
|
2274
|
-
}
|
|
2275
2001
|
}
|
|
2276
2002
|
}
|
|
2277
2003
|
catch (e) {
|
|
2278
2004
|
consoleError(e, hostRef.$hostElement$);
|
|
2279
2005
|
}
|
|
2280
|
-
renderingRef = null;
|
|
2281
2006
|
return null;
|
|
2282
2007
|
};
|
|
2283
|
-
const getRenderingRef = () => renderingRef;
|
|
2284
2008
|
const postUpdateComponent = (hostRef) => {
|
|
2285
2009
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2286
2010
|
const elm = hostRef.$hostElement$;
|
|
2287
2011
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
2288
|
-
const instance =
|
|
2012
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
2289
2013
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2290
|
-
|
|
2291
|
-
if (BUILD.isDev) {
|
|
2292
|
-
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
2293
|
-
}
|
|
2014
|
+
{
|
|
2294
2015
|
safeCall(instance, 'componentDidRender');
|
|
2295
|
-
if (BUILD.isDev) {
|
|
2296
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
2297
|
-
}
|
|
2298
2016
|
}
|
|
2299
|
-
emitLifecycleEvent(elm, 'componentDidRender');
|
|
2300
2017
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
2301
2018
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
2302
|
-
|
|
2019
|
+
{
|
|
2303
2020
|
// DOM WRITE!
|
|
2304
2021
|
addHydratedFlag(elm);
|
|
2305
2022
|
}
|
|
2306
|
-
|
|
2307
|
-
if (BUILD.isDev) {
|
|
2308
|
-
hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
2309
|
-
}
|
|
2023
|
+
{
|
|
2310
2024
|
safeCall(instance, 'componentDidLoad');
|
|
2311
|
-
if (BUILD.isDev) {
|
|
2312
|
-
hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
|
|
2313
|
-
}
|
|
2314
2025
|
}
|
|
2315
|
-
emitLifecycleEvent(elm, 'componentDidLoad');
|
|
2316
2026
|
endPostUpdate();
|
|
2317
|
-
|
|
2027
|
+
{
|
|
2318
2028
|
hostRef.$onReadyResolve$(elm);
|
|
2319
2029
|
if (!ancestorComponent) {
|
|
2320
|
-
appDidLoad(
|
|
2030
|
+
appDidLoad();
|
|
2321
2031
|
}
|
|
2322
2032
|
}
|
|
2323
2033
|
}
|
|
2324
2034
|
else {
|
|
2325
|
-
|
|
2326
|
-
// we've already loaded this component
|
|
2327
|
-
// fire off the user's componentDidUpdate method (if one was provided)
|
|
2328
|
-
// componentDidUpdate runs AFTER render() has been called
|
|
2329
|
-
// and all child components have finished updating
|
|
2330
|
-
if (BUILD.isDev) {
|
|
2331
|
-
hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
|
|
2332
|
-
}
|
|
2035
|
+
{
|
|
2333
2036
|
safeCall(instance, 'componentDidUpdate');
|
|
2334
|
-
if (BUILD.isDev) {
|
|
2335
|
-
hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
|
|
2336
|
-
}
|
|
2337
2037
|
}
|
|
2338
|
-
emitLifecycleEvent(elm, 'componentDidUpdate');
|
|
2339
2038
|
endPostUpdate();
|
|
2340
2039
|
}
|
|
2341
|
-
|
|
2040
|
+
{
|
|
2342
2041
|
hostRef.$onInstanceResolve$(elm);
|
|
2343
2042
|
}
|
|
2344
2043
|
// load events fire from bottom to top
|
|
2345
2044
|
// the deepest elements load first then bubbles up
|
|
2346
|
-
|
|
2045
|
+
{
|
|
2347
2046
|
if (hostRef.$onRenderResolve$) {
|
|
2348
2047
|
hostRef.$onRenderResolve$();
|
|
2349
2048
|
hostRef.$onRenderResolve$ = undefined;
|
|
@@ -2357,32 +2056,13 @@ const postUpdateComponent = (hostRef) => {
|
|
|
2357
2056
|
// ( •_•)>⌐■-■
|
|
2358
2057
|
// (⌐■_■)
|
|
2359
2058
|
};
|
|
2360
|
-
const forceUpdate = (ref) => {
|
|
2361
|
-
if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2362
|
-
const hostRef = getHostRef(ref);
|
|
2363
|
-
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2364
|
-
if (isConnected &&
|
|
2365
|
-
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2366
|
-
scheduleUpdate(hostRef, false);
|
|
2367
|
-
}
|
|
2368
|
-
// Returns "true" when the forced update was successfully scheduled
|
|
2369
|
-
return isConnected;
|
|
2370
|
-
}
|
|
2371
|
-
return false;
|
|
2372
|
-
};
|
|
2373
2059
|
const appDidLoad = (who) => {
|
|
2374
2060
|
// on appload
|
|
2375
2061
|
// we have finish the first big initial render
|
|
2376
|
-
|
|
2062
|
+
{
|
|
2377
2063
|
addHydratedFlag(doc.documentElement);
|
|
2378
2064
|
}
|
|
2379
|
-
if (BUILD.asyncQueue) {
|
|
2380
|
-
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
2381
|
-
}
|
|
2382
2065
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
2383
|
-
if (BUILD.profile && performance.measure) {
|
|
2384
|
-
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
|
|
2385
|
-
}
|
|
2386
2066
|
};
|
|
2387
2067
|
/**
|
|
2388
2068
|
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
@@ -2405,67 +2085,27 @@ const safeCall = (instance, method, arg) => {
|
|
|
2405
2085
|
}
|
|
2406
2086
|
return undefined;
|
|
2407
2087
|
};
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
* get removed by the compiler. Used for timing events to see how long they take.
|
|
2411
|
-
* @param elm the target of the Event
|
|
2412
|
-
* @param lifecycleName name of the event
|
|
2413
|
-
*/
|
|
2414
|
-
const emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2415
|
-
if (BUILD.lifecycleDOMEvents) {
|
|
2416
|
-
emitEvent(elm, 'stencil_' + lifecycleName, {
|
|
2417
|
-
bubbles: true,
|
|
2418
|
-
composed: true,
|
|
2419
|
-
detail: {
|
|
2420
|
-
namespace: NAMESPACE,
|
|
2421
|
-
},
|
|
2422
|
-
});
|
|
2423
|
-
}
|
|
2424
|
-
};
|
|
2425
|
-
const addHydratedFlag = (elm) => BUILD.hydratedClass
|
|
2426
|
-
? elm.classList.add('hydrated')
|
|
2427
|
-
: BUILD.hydratedAttribute
|
|
2428
|
-
? elm.setAttribute('hydrated', '')
|
|
2429
|
-
: undefined;
|
|
2430
|
-
const serverSideConnected = (elm) => {
|
|
2431
|
-
const children = elm.children;
|
|
2432
|
-
if (children != null) {
|
|
2433
|
-
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
2434
|
-
const childElm = children[i];
|
|
2435
|
-
if (typeof childElm.connectedCallback === 'function') {
|
|
2436
|
-
childElm.connectedCallback();
|
|
2437
|
-
}
|
|
2438
|
-
serverSideConnected(childElm);
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
};
|
|
2088
|
+
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
2089
|
+
;
|
|
2442
2090
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2443
2091
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2444
2092
|
// check our new property value against our internal value
|
|
2445
2093
|
const hostRef = getHostRef(ref);
|
|
2446
|
-
const elm =
|
|
2094
|
+
const elm = hostRef.$hostElement$ ;
|
|
2447
2095
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2448
2096
|
const flags = hostRef.$flags$;
|
|
2449
|
-
const instance =
|
|
2097
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
2450
2098
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2451
2099
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
2452
2100
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2453
2101
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2454
|
-
if ((!
|
|
2102
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
2455
2103
|
// gadzooks! the property's value has changed!!
|
|
2456
2104
|
// set our new value!
|
|
2457
2105
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2458
|
-
if (
|
|
2459
|
-
if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
|
|
2460
|
-
consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
2461
|
-
}
|
|
2462
|
-
else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
|
|
2463
|
-
consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
if (!BUILD.lazyLoad || instance) {
|
|
2106
|
+
if (instance) {
|
|
2467
2107
|
// get an array of method names of watch functions to call
|
|
2468
|
-
if (
|
|
2108
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
2469
2109
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2470
2110
|
if (watchMethods) {
|
|
2471
2111
|
// this instance is watching for when this property changed
|
|
@@ -2480,13 +2120,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2480
2120
|
});
|
|
2481
2121
|
}
|
|
2482
2122
|
}
|
|
2483
|
-
if (
|
|
2484
|
-
(flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2485
|
-
if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2486
|
-
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2487
|
-
return;
|
|
2488
|
-
}
|
|
2489
|
-
}
|
|
2123
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
2490
2124
|
// looks like this value actually changed, so we've got work to do!
|
|
2491
2125
|
// but only if we've already rendered, otherwise just chill out
|
|
2492
2126
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -2509,39 +2143,15 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2509
2143
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2510
2144
|
var _a;
|
|
2511
2145
|
const prototype = Cstr.prototype;
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
* @ref https://web.dev/articles/more-capable-form-controls#lifecycle_callbacks
|
|
2515
|
-
*/
|
|
2516
|
-
if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */ && flags & 1 /* PROXY_FLAGS.isElementConstructor */) {
|
|
2517
|
-
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => Object.defineProperty(prototype, cbName, {
|
|
2518
|
-
value(...args) {
|
|
2519
|
-
const hostRef = getHostRef(this);
|
|
2520
|
-
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2521
|
-
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2522
|
-
if (!instance) {
|
|
2523
|
-
hostRef.$onReadyPromise$.then((instance) => {
|
|
2524
|
-
const cb = instance[cbName];
|
|
2525
|
-
typeof cb === 'function' && cb.call(instance, ...args);
|
|
2526
|
-
});
|
|
2527
|
-
}
|
|
2528
|
-
else {
|
|
2529
|
-
const cb = instance[cbName];
|
|
2530
|
-
typeof cb === 'function' && cb.call(instance, ...args);
|
|
2531
|
-
}
|
|
2532
|
-
},
|
|
2533
|
-
}));
|
|
2534
|
-
}
|
|
2535
|
-
if (BUILD.member && cmpMeta.$members$) {
|
|
2536
|
-
if (BUILD.watchCallback && Cstr.watchers) {
|
|
2146
|
+
if (cmpMeta.$members$) {
|
|
2147
|
+
if (Cstr.watchers) {
|
|
2537
2148
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2538
2149
|
}
|
|
2539
2150
|
// It's better to have a const than two Object.entries()
|
|
2540
2151
|
const members = Object.entries(cmpMeta.$members$);
|
|
2541
2152
|
members.map(([memberName, [memberFlags]]) => {
|
|
2542
|
-
if ((
|
|
2543
|
-
|
|
2544
|
-
((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
2153
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
2154
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
2545
2155
|
// proxyComponent - prop
|
|
2546
2156
|
Object.defineProperty(prototype, memberName, {
|
|
2547
2157
|
get() {
|
|
@@ -2549,21 +2159,6 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2549
2159
|
return getValue(this, memberName);
|
|
2550
2160
|
},
|
|
2551
2161
|
set(newValue) {
|
|
2552
|
-
// only during dev time
|
|
2553
|
-
if (BUILD.isDev) {
|
|
2554
|
-
const ref = getHostRef(this);
|
|
2555
|
-
if (
|
|
2556
|
-
// we are proxying the instance (not element)
|
|
2557
|
-
(flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
|
|
2558
|
-
// the element is not constructing
|
|
2559
|
-
(ref && ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
|
|
2560
|
-
// the member is a prop
|
|
2561
|
-
(memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
|
|
2562
|
-
// the member is not mutable
|
|
2563
|
-
(memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
|
|
2564
|
-
consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
|
|
2565
|
-
}
|
|
2566
|
-
}
|
|
2567
2162
|
// proxyComponent, set value
|
|
2568
2163
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2569
2164
|
},
|
|
@@ -2571,9 +2166,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2571
2166
|
enumerable: true,
|
|
2572
2167
|
});
|
|
2573
2168
|
}
|
|
2574
|
-
else if (
|
|
2575
|
-
BUILD.method &&
|
|
2576
|
-
flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
2169
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
2577
2170
|
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
2578
2171
|
// proxyComponent - method
|
|
2579
2172
|
Object.defineProperty(prototype, memberName, {
|
|
@@ -2585,7 +2178,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2585
2178
|
});
|
|
2586
2179
|
}
|
|
2587
2180
|
});
|
|
2588
|
-
if (
|
|
2181
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
2589
2182
|
const attrNameToPropName = new Map();
|
|
2590
2183
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
2591
2184
|
plt.jmp(() => {
|
|
@@ -2649,8 +2242,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2649
2242
|
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
2650
2243
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
2651
2244
|
newValue !== oldValue) {
|
|
2652
|
-
const
|
|
2653
|
-
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2245
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
2654
2246
|
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
2655
2247
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
2656
2248
|
if (instance[callbackName] != null) {
|
|
@@ -2676,7 +2268,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2676
2268
|
var _a;
|
|
2677
2269
|
const attrName = m[1] || propName;
|
|
2678
2270
|
attrNameToPropName.set(attrName, propName);
|
|
2679
|
-
if (
|
|
2271
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
2680
2272
|
(_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
|
|
2681
2273
|
}
|
|
2682
2274
|
return attrName;
|
|
@@ -2703,25 +2295,22 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2703
2295
|
// Let the runtime know that the component has been initialized
|
|
2704
2296
|
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
2705
2297
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2706
|
-
if (
|
|
2298
|
+
if (bundleId) {
|
|
2707
2299
|
// lazy loaded components
|
|
2708
2300
|
// request the component's implementation to be
|
|
2709
2301
|
// wired up with the host element
|
|
2710
|
-
Cstr = loadModule(cmpMeta
|
|
2302
|
+
Cstr = loadModule(cmpMeta);
|
|
2711
2303
|
if (Cstr.then) {
|
|
2712
2304
|
// Await creates a micro-task avoid if possible
|
|
2713
|
-
const endLoad = uniqueTime(
|
|
2305
|
+
const endLoad = uniqueTime();
|
|
2714
2306
|
Cstr = await Cstr;
|
|
2715
2307
|
endLoad();
|
|
2716
2308
|
}
|
|
2717
|
-
if (
|
|
2718
|
-
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2719
|
-
}
|
|
2720
|
-
if (BUILD.member && !Cstr.isProxied) {
|
|
2309
|
+
if (!Cstr.isProxied) {
|
|
2721
2310
|
// we've never proxied this Constructor before
|
|
2722
2311
|
// let's add the getters/setters to its prototype before
|
|
2723
2312
|
// the first time we create an instance of the implementation
|
|
2724
|
-
|
|
2313
|
+
{
|
|
2725
2314
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2726
2315
|
}
|
|
2727
2316
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
@@ -2731,7 +2320,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2731
2320
|
// ok, time to construct the instance
|
|
2732
2321
|
// but let's keep track of when we start and stop
|
|
2733
2322
|
// so that the getters/setters don't incorrectly step on data
|
|
2734
|
-
|
|
2323
|
+
{
|
|
2735
2324
|
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
2736
2325
|
}
|
|
2737
2326
|
// construct the lazy-loaded component implementation
|
|
@@ -2744,14 +2333,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2744
2333
|
catch (e) {
|
|
2745
2334
|
consoleError(e);
|
|
2746
2335
|
}
|
|
2747
|
-
|
|
2336
|
+
{
|
|
2748
2337
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
2749
2338
|
}
|
|
2750
|
-
|
|
2339
|
+
{
|
|
2751
2340
|
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
2752
2341
|
}
|
|
2753
2342
|
endNewInstance();
|
|
2754
|
-
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2755
2343
|
}
|
|
2756
2344
|
else {
|
|
2757
2345
|
// sync constructor component
|
|
@@ -2761,25 +2349,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2761
2349
|
// Stencil has completed instantiating the component.
|
|
2762
2350
|
customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
|
|
2763
2351
|
}
|
|
2764
|
-
if (
|
|
2352
|
+
if (Cstr.style) {
|
|
2765
2353
|
// this component has styles but we haven't registered them yet
|
|
2766
2354
|
let style = Cstr.style;
|
|
2767
|
-
|
|
2768
|
-
style = style[(hostRef.$modeName$ = computeMode(elm))];
|
|
2769
|
-
if (BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2770
|
-
elm.setAttribute('s-mode', hostRef.$modeName$);
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2355
|
+
const scopeId = getScopeId(cmpMeta);
|
|
2774
2356
|
if (!styles.has(scopeId)) {
|
|
2775
2357
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
2776
|
-
if (!BUILD.hydrateServerSide &&
|
|
2777
|
-
BUILD.shadowDom &&
|
|
2778
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2779
|
-
BUILD.shadowDomShim &&
|
|
2780
|
-
cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
2781
|
-
style = await import('./shadow-css-2e0fed52.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
2782
|
-
}
|
|
2783
2358
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
2784
2359
|
endRegisterStyles();
|
|
2785
2360
|
}
|
|
@@ -2788,7 +2363,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2788
2363
|
// we've successfully created a lazy instance
|
|
2789
2364
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2790
2365
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2791
|
-
if (
|
|
2366
|
+
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
2792
2367
|
// this is the initial load and this component it has an ancestor component
|
|
2793
2368
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
2794
2369
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
@@ -2802,56 +2377,44 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2802
2377
|
}
|
|
2803
2378
|
};
|
|
2804
2379
|
const fireConnectedCallback = (instance) => {
|
|
2805
|
-
if (BUILD.lazyLoad && BUILD.connectedCallback) {
|
|
2806
|
-
safeCall(instance, 'connectedCallback');
|
|
2807
|
-
}
|
|
2808
2380
|
};
|
|
2809
2381
|
const connectedCallback = (elm) => {
|
|
2810
2382
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
2811
2383
|
const hostRef = getHostRef(elm);
|
|
2812
2384
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2813
2385
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
2814
|
-
if (BUILD.hostListenerTargetParent) {
|
|
2815
|
-
// only run if we have listeners being attached to a parent
|
|
2816
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2817
|
-
}
|
|
2818
2386
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
2819
2387
|
// first time this component has connected
|
|
2820
2388
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
2821
2389
|
let hostId;
|
|
2822
|
-
|
|
2390
|
+
{
|
|
2823
2391
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2824
2392
|
if (hostId) {
|
|
2825
|
-
if (
|
|
2826
|
-
const scopeId =
|
|
2827
|
-
? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
|
|
2828
|
-
: addStyle(elm.shadowRoot, cmpMeta);
|
|
2393
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
2394
|
+
const scopeId = addStyle(elm.shadowRoot, cmpMeta);
|
|
2829
2395
|
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
|
2830
2396
|
}
|
|
2831
2397
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2832
2398
|
}
|
|
2833
2399
|
}
|
|
2834
|
-
if (
|
|
2400
|
+
if (!hostId) {
|
|
2835
2401
|
// initUpdate
|
|
2836
2402
|
// if the slot polyfill is required we'll need to put some nodes
|
|
2837
2403
|
// in here to act as original content anchors as we move nodes around
|
|
2838
2404
|
// host element has been connected to the DOM
|
|
2839
|
-
if (
|
|
2840
|
-
((BUILD.slot || BUILD.shadowDom) &&
|
|
2841
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2405
|
+
if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2842
2406
|
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
2843
2407
|
setContentReference(elm);
|
|
2844
2408
|
}
|
|
2845
2409
|
}
|
|
2846
|
-
|
|
2410
|
+
{
|
|
2847
2411
|
// find the first ancestor component (if there is one) and register
|
|
2848
2412
|
// this component as one of the actively loading child components for its ancestor
|
|
2849
2413
|
let ancestorComponent = elm;
|
|
2850
2414
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
2851
2415
|
// climb up the ancestors looking for the first
|
|
2852
2416
|
// component that hasn't finished its lifecycle update yet
|
|
2853
|
-
if ((
|
|
2854
|
-
ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
2417
|
+
if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
2855
2418
|
ancestorComponent.hasAttribute('s-id') &&
|
|
2856
2419
|
ancestorComponent['s-p']) ||
|
|
2857
2420
|
ancestorComponent['s-p']) {
|
|
@@ -2864,7 +2427,7 @@ const connectedCallback = (elm) => {
|
|
|
2864
2427
|
}
|
|
2865
2428
|
// Lazy properties
|
|
2866
2429
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
2867
|
-
if (
|
|
2430
|
+
if (cmpMeta.$members$) {
|
|
2868
2431
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2869
2432
|
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2870
2433
|
const value = elm[memberName];
|
|
@@ -2873,14 +2436,7 @@ const connectedCallback = (elm) => {
|
|
|
2873
2436
|
}
|
|
2874
2437
|
});
|
|
2875
2438
|
}
|
|
2876
|
-
|
|
2877
|
-
// connectedCallback, taskQueue, initialLoad
|
|
2878
|
-
// angular sets attribute AFTER connectCallback
|
|
2879
|
-
// https://github.com/angular/angular/issues/18909
|
|
2880
|
-
// https://github.com/angular/angular/issues/19940
|
|
2881
|
-
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2882
|
-
}
|
|
2883
|
-
else {
|
|
2439
|
+
{
|
|
2884
2440
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
2885
2441
|
}
|
|
2886
2442
|
}
|
|
@@ -2888,13 +2444,11 @@ const connectedCallback = (elm) => {
|
|
|
2888
2444
|
// not the first time this has connected
|
|
2889
2445
|
// reattach any event listeners to the host
|
|
2890
2446
|
// since they would have been removed when disconnected
|
|
2891
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
2447
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
2892
2448
|
// fire off connectedCallback() on component instance
|
|
2893
|
-
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$)
|
|
2894
|
-
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
2895
|
-
}
|
|
2449
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2896
2450
|
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2897
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(
|
|
2451
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
2898
2452
|
}
|
|
2899
2453
|
}
|
|
2900
2454
|
endConnected();
|
|
@@ -2907,588 +2461,30 @@ const setContentReference = (elm) => {
|
|
|
2907
2461
|
// let's pick out the inner content for slot projection
|
|
2908
2462
|
// create a node to represent where the original
|
|
2909
2463
|
// content was first placed, which is useful later on
|
|
2910
|
-
const contentRefElm = (elm['s-cr'] = doc.createComment(
|
|
2464
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
2911
2465
|
contentRefElm['s-cn'] = true;
|
|
2912
2466
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
2913
2467
|
};
|
|
2914
2468
|
const disconnectInstance = (instance) => {
|
|
2915
|
-
if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
|
|
2916
|
-
safeCall(instance, 'disconnectedCallback');
|
|
2917
|
-
}
|
|
2918
|
-
if (BUILD.cmpDidUnload) {
|
|
2919
|
-
safeCall(instance, 'componentDidUnload');
|
|
2920
|
-
}
|
|
2921
2469
|
};
|
|
2922
2470
|
const disconnectedCallback = async (elm) => {
|
|
2923
2471
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
2924
2472
|
const hostRef = getHostRef(elm);
|
|
2925
|
-
|
|
2473
|
+
{
|
|
2926
2474
|
if (hostRef.$rmListeners$) {
|
|
2927
2475
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2928
2476
|
hostRef.$rmListeners$ = undefined;
|
|
2929
2477
|
}
|
|
2930
2478
|
}
|
|
2931
|
-
if (
|
|
2932
|
-
disconnectInstance(elm);
|
|
2933
|
-
}
|
|
2934
|
-
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
2935
|
-
disconnectInstance(hostRef.$lazyInstance$);
|
|
2936
|
-
}
|
|
2479
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2937
2480
|
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2938
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
};
|
|
2942
|
-
const patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
2943
|
-
patchCloneNode(hostElementPrototype);
|
|
2944
|
-
patchSlotAppendChild(hostElementPrototype);
|
|
2945
|
-
patchSlotAppend(hostElementPrototype);
|
|
2946
|
-
patchSlotPrepend(hostElementPrototype);
|
|
2947
|
-
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
2948
|
-
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2949
|
-
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2950
|
-
patchTextContent(hostElementPrototype);
|
|
2951
|
-
patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
|
|
2952
|
-
patchSlotRemoveChild(hostElementPrototype);
|
|
2953
|
-
};
|
|
2954
|
-
const patchCloneNode = (HostElementPrototype) => {
|
|
2955
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2956
|
-
HostElementPrototype.cloneNode = function (deep) {
|
|
2957
|
-
const srcNode = this;
|
|
2958
|
-
const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2959
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2960
|
-
if (BUILD.slot && !isShadowDom && deep) {
|
|
2961
|
-
let i = 0;
|
|
2962
|
-
let slotted, nonStencilNode;
|
|
2963
|
-
const stencilPrivates = [
|
|
2964
|
-
's-id',
|
|
2965
|
-
's-cr',
|
|
2966
|
-
's-lr',
|
|
2967
|
-
's-rc',
|
|
2968
|
-
's-sc',
|
|
2969
|
-
's-p',
|
|
2970
|
-
's-cn',
|
|
2971
|
-
's-sr',
|
|
2972
|
-
's-sn',
|
|
2973
|
-
's-hn',
|
|
2974
|
-
's-ol',
|
|
2975
|
-
's-nr',
|
|
2976
|
-
's-si',
|
|
2977
|
-
's-rf',
|
|
2978
|
-
];
|
|
2979
|
-
for (; i < srcNode.childNodes.length; i++) {
|
|
2980
|
-
slotted = srcNode.childNodes[i]['s-nr'];
|
|
2981
|
-
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
|
|
2982
|
-
if (slotted) {
|
|
2983
|
-
if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2984
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2985
|
-
}
|
|
2986
|
-
else {
|
|
2987
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2988
|
-
}
|
|
2989
|
-
}
|
|
2990
|
-
if (nonStencilNode) {
|
|
2991
|
-
clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
return clonedNode;
|
|
2996
|
-
};
|
|
2997
|
-
};
|
|
2998
|
-
/**
|
|
2999
|
-
* Patches the `appendChild` method on a `scoped` Stencil component.
|
|
3000
|
-
* The patch will attempt to find a slot with the same name as the node being appended
|
|
3001
|
-
* and insert it into the slot reference if found. Otherwise, it falls-back to the original
|
|
3002
|
-
* `appendChild` method.
|
|
3003
|
-
*
|
|
3004
|
-
* @param HostElementPrototype The Stencil component to be patched
|
|
3005
|
-
*/
|
|
3006
|
-
const patchSlotAppendChild = (HostElementPrototype) => {
|
|
3007
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
3008
|
-
HostElementPrototype.appendChild = function (newChild) {
|
|
3009
|
-
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
|
3010
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
3011
|
-
if (slotNode) {
|
|
3012
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
3013
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
3014
|
-
const insertedNode = appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
|
|
3015
|
-
// Check if there is fallback content that should be hidden
|
|
3016
|
-
updateFallbackSlotVisibility(this);
|
|
3017
|
-
return insertedNode;
|
|
3018
|
-
}
|
|
3019
|
-
return this.__appendChild(newChild);
|
|
3020
|
-
};
|
|
3021
|
-
};
|
|
3022
|
-
/**
|
|
3023
|
-
* Patches the `removeChild` method on a `scoped` Stencil component.
|
|
3024
|
-
* This patch attempts to remove the specified node from a slot reference
|
|
3025
|
-
* if the slot exists. Otherwise, it falls-back to the original `removeChild` method.
|
|
3026
|
-
*
|
|
3027
|
-
* @param ElementPrototype The Stencil component to be patched
|
|
3028
|
-
*/
|
|
3029
|
-
const patchSlotRemoveChild = (ElementPrototype) => {
|
|
3030
|
-
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
3031
|
-
ElementPrototype.removeChild = function (toRemove) {
|
|
3032
|
-
if (toRemove && typeof toRemove['s-sn'] !== 'undefined') {
|
|
3033
|
-
const slotNode = getHostSlotNode(this.childNodes, toRemove['s-sn'], this.tagName);
|
|
3034
|
-
if (slotNode) {
|
|
3035
|
-
// Get all slot content
|
|
3036
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove['s-sn']);
|
|
3037
|
-
// See if any of the slotted content matches the node to remove
|
|
3038
|
-
const existingNode = slotChildNodes.find((n) => n === toRemove);
|
|
3039
|
-
if (existingNode) {
|
|
3040
|
-
existingNode.remove();
|
|
3041
|
-
// Check if there is fallback content that should be displayed if that
|
|
3042
|
-
// was the last node in the slot
|
|
3043
|
-
updateFallbackSlotVisibility(this);
|
|
3044
|
-
return;
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
return this.__removeChild(toRemove);
|
|
3049
|
-
};
|
|
3050
|
-
};
|
|
3051
|
-
/**
|
|
3052
|
-
* Patches the `prepend` method for a slotted node inside a scoped component.
|
|
3053
|
-
*
|
|
3054
|
-
* @param HostElementPrototype the `Element` to be patched
|
|
3055
|
-
*/
|
|
3056
|
-
const patchSlotPrepend = (HostElementPrototype) => {
|
|
3057
|
-
const originalPrepend = HostElementPrototype.prepend;
|
|
3058
|
-
HostElementPrototype.prepend = function (...newChildren) {
|
|
3059
|
-
newChildren.forEach((newChild) => {
|
|
3060
|
-
if (typeof newChild === 'string') {
|
|
3061
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
3062
|
-
}
|
|
3063
|
-
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
|
3064
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
3065
|
-
if (slotNode) {
|
|
3066
|
-
const slotPlaceholder = document.createTextNode('');
|
|
3067
|
-
slotPlaceholder['s-nr'] = newChild;
|
|
3068
|
-
slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
|
|
3069
|
-
newChild['s-ol'] = slotPlaceholder;
|
|
3070
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
3071
|
-
const appendAfter = slotChildNodes[0];
|
|
3072
|
-
return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
|
|
3073
|
-
}
|
|
3074
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute('slot')) {
|
|
3075
|
-
newChild.hidden = true;
|
|
3076
|
-
}
|
|
3077
|
-
return originalPrepend.call(this, newChild);
|
|
3078
|
-
});
|
|
3079
|
-
};
|
|
3080
|
-
};
|
|
3081
|
-
/**
|
|
3082
|
-
* Patches the `append` method for a slotted node inside a scoped component. The patched method uses
|
|
3083
|
-
* `appendChild` under-the-hood while creating text nodes for any new children that passed as bare strings.
|
|
3084
|
-
*
|
|
3085
|
-
* @param HostElementPrototype the `Element` to be patched
|
|
3086
|
-
*/
|
|
3087
|
-
const patchSlotAppend = (HostElementPrototype) => {
|
|
3088
|
-
HostElementPrototype.append = function (...newChildren) {
|
|
3089
|
-
newChildren.forEach((newChild) => {
|
|
3090
|
-
if (typeof newChild === 'string') {
|
|
3091
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
3092
|
-
}
|
|
3093
|
-
this.appendChild(newChild);
|
|
3094
|
-
});
|
|
3095
|
-
};
|
|
3096
|
-
};
|
|
3097
|
-
/**
|
|
3098
|
-
* Patches the `insertAdjacentHTML` method for a slotted node inside a scoped component. Specifically,
|
|
3099
|
-
* we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
|
|
3100
|
-
* gets inserted into the DOM in the correct location.
|
|
3101
|
-
*
|
|
3102
|
-
* @param HostElementPrototype the `Element` to be patched
|
|
3103
|
-
*/
|
|
3104
|
-
const patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
3105
|
-
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
3106
|
-
HostElementPrototype.insertAdjacentHTML = function (position, text) {
|
|
3107
|
-
if (position !== 'afterbegin' && position !== 'beforeend') {
|
|
3108
|
-
return originalInsertAdjacentHtml.call(this, position, text);
|
|
3109
|
-
}
|
|
3110
|
-
const container = this.ownerDocument.createElement('_');
|
|
3111
|
-
let node;
|
|
3112
|
-
container.innerHTML = text;
|
|
3113
|
-
if (position === 'afterbegin') {
|
|
3114
|
-
while ((node = container.firstChild)) {
|
|
3115
|
-
this.prepend(node);
|
|
3116
|
-
}
|
|
3117
|
-
}
|
|
3118
|
-
else if (position === 'beforeend') {
|
|
3119
|
-
while ((node = container.firstChild)) {
|
|
3120
|
-
this.append(node);
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
};
|
|
3124
|
-
};
|
|
3125
|
-
/**
|
|
3126
|
-
* Patches the `insertAdjacentText` method for a slotted node inside a scoped component. Specifically,
|
|
3127
|
-
* we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the text node
|
|
3128
|
-
* gets inserted into the DOM in the correct location.
|
|
3129
|
-
*
|
|
3130
|
-
* @param HostElementPrototype the `Element` to be patched
|
|
3131
|
-
*/
|
|
3132
|
-
const patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
3133
|
-
HostElementPrototype.insertAdjacentText = function (position, text) {
|
|
3134
|
-
this.insertAdjacentHTML(position, text);
|
|
3135
|
-
};
|
|
3136
|
-
};
|
|
3137
|
-
/**
|
|
3138
|
-
* Patches the `insertAdjacentElement` method for a slotted node inside a scoped component. Specifically,
|
|
3139
|
-
* we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
|
|
3140
|
-
* gets inserted into the DOM in the correct location.
|
|
3141
|
-
*
|
|
3142
|
-
* @param HostElementPrototype the `Element` to be patched
|
|
3143
|
-
*/
|
|
3144
|
-
const patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
3145
|
-
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
3146
|
-
HostElementPrototype.insertAdjacentElement = function (position, element) {
|
|
3147
|
-
if (position !== 'afterbegin' && position !== 'beforeend') {
|
|
3148
|
-
return originalInsertAdjacentElement.call(this, position, element);
|
|
3149
|
-
}
|
|
3150
|
-
if (position === 'afterbegin') {
|
|
3151
|
-
this.prepend(element);
|
|
3152
|
-
return element;
|
|
3153
|
-
}
|
|
3154
|
-
else if (position === 'beforeend') {
|
|
3155
|
-
this.append(element);
|
|
3156
|
-
return element;
|
|
3157
|
-
}
|
|
3158
|
-
return element;
|
|
3159
|
-
};
|
|
3160
|
-
};
|
|
3161
|
-
/**
|
|
3162
|
-
* Patches the text content of an unnamed slotted node inside a scoped component
|
|
3163
|
-
* @param hostElementPrototype the `Element` to be patched
|
|
3164
|
-
*/
|
|
3165
|
-
const patchTextContent = (hostElementPrototype) => {
|
|
3166
|
-
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
|
|
3167
|
-
Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
|
|
3168
|
-
if (BUILD.experimentalScopedSlotChanges) {
|
|
3169
|
-
// Patch `textContent` to mimic shadow root behavior
|
|
3170
|
-
Object.defineProperty(hostElementPrototype, 'textContent', {
|
|
3171
|
-
// To mimic shadow root behavior, we need to return the text content of all
|
|
3172
|
-
// nodes in a slot reference node
|
|
3173
|
-
get() {
|
|
3174
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
3175
|
-
const textContent = slotRefNodes
|
|
3176
|
-
.map((node) => {
|
|
3177
|
-
var _a, _b;
|
|
3178
|
-
const text = [];
|
|
3179
|
-
// Need to get the text content of all nodes in the slot reference node
|
|
3180
|
-
let slotContent = node.nextSibling;
|
|
3181
|
-
while (slotContent && slotContent['s-sn'] === node['s-sn']) {
|
|
3182
|
-
if (slotContent.nodeType === 3 /* NODE_TYPES.TEXT_NODE */ || slotContent.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
|
|
3183
|
-
text.push((_b = (_a = slotContent.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '');
|
|
3184
|
-
}
|
|
3185
|
-
slotContent = slotContent.nextSibling;
|
|
3186
|
-
}
|
|
3187
|
-
return text.filter((ref) => ref !== '').join(' ');
|
|
3188
|
-
})
|
|
3189
|
-
.filter((text) => text !== '')
|
|
3190
|
-
.join(' ');
|
|
3191
|
-
// Pad the string to return
|
|
3192
|
-
return ' ' + textContent + ' ';
|
|
3193
|
-
},
|
|
3194
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
3195
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
3196
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
3197
|
-
set(value) {
|
|
3198
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
3199
|
-
slotRefNodes.forEach((node) => {
|
|
3200
|
-
// Remove the existing content of the slot
|
|
3201
|
-
let slotContent = node.nextSibling;
|
|
3202
|
-
while (slotContent && slotContent['s-sn'] === node['s-sn']) {
|
|
3203
|
-
const tmp = slotContent;
|
|
3204
|
-
slotContent = slotContent.nextSibling;
|
|
3205
|
-
tmp.remove();
|
|
3206
|
-
}
|
|
3207
|
-
// If this is a default slot, add the text node in the slot location.
|
|
3208
|
-
// Otherwise, destroy the slot reference node
|
|
3209
|
-
if (node['s-sn'] === '') {
|
|
3210
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
3211
|
-
textNode['s-sn'] = '';
|
|
3212
|
-
node.parentElement.insertBefore(textNode, node.nextSibling);
|
|
3213
|
-
}
|
|
3214
|
-
else {
|
|
3215
|
-
node.remove();
|
|
3216
|
-
}
|
|
3217
|
-
});
|
|
3218
|
-
},
|
|
3219
|
-
});
|
|
3220
|
-
}
|
|
3221
|
-
else {
|
|
3222
|
-
Object.defineProperty(hostElementPrototype, 'textContent', {
|
|
3223
|
-
get() {
|
|
3224
|
-
var _a;
|
|
3225
|
-
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
3226
|
-
// the empty string
|
|
3227
|
-
const slotNode = getHostSlotNode(this.childNodes, '', this.tagName);
|
|
3228
|
-
// when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
|
|
3229
|
-
// nodes were reordered during the vdom render. first try to get the text content from the sibling.
|
|
3230
|
-
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
3231
|
-
return slotNode.nextSibling.textContent;
|
|
3232
|
-
}
|
|
3233
|
-
else if (slotNode) {
|
|
3234
|
-
return slotNode.textContent;
|
|
3235
|
-
}
|
|
3236
|
-
else {
|
|
3237
|
-
// fallback to the original implementation
|
|
3238
|
-
return this.__textContent;
|
|
3239
|
-
}
|
|
3240
|
-
},
|
|
3241
|
-
set(value) {
|
|
3242
|
-
var _a;
|
|
3243
|
-
// get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
|
|
3244
|
-
// the empty string
|
|
3245
|
-
const slotNode = getHostSlotNode(this.childNodes, '', this.tagName);
|
|
3246
|
-
// when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
|
|
3247
|
-
// depending on how nodes were reordered during the vdom render. first try to set the text content on the
|
|
3248
|
-
// sibling.
|
|
3249
|
-
if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
|
|
3250
|
-
slotNode.nextSibling.textContent = value;
|
|
3251
|
-
}
|
|
3252
|
-
else if (slotNode) {
|
|
3253
|
-
slotNode.textContent = value;
|
|
3254
|
-
}
|
|
3255
|
-
else {
|
|
3256
|
-
// we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
|
|
3257
|
-
// loaded, we could have missed it. check for a content reference element on the scoped component and insert
|
|
3258
|
-
// it there
|
|
3259
|
-
this.__textContent = value;
|
|
3260
|
-
const contentRefElm = this['s-cr'];
|
|
3261
|
-
if (contentRefElm) {
|
|
3262
|
-
this.insertBefore(contentRefElm, this.firstChild);
|
|
3263
|
-
}
|
|
3264
|
-
}
|
|
3265
|
-
},
|
|
3266
|
-
});
|
|
3267
|
-
}
|
|
3268
|
-
};
|
|
3269
|
-
const patchChildSlotNodes = (elm, cmpMeta) => {
|
|
3270
|
-
class FakeNodeList extends Array {
|
|
3271
|
-
item(n) {
|
|
3272
|
-
return this[n];
|
|
3273
|
-
}
|
|
3274
|
-
}
|
|
3275
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3276
|
-
if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
|
|
3277
|
-
const childNodesFn = elm.__lookupGetter__('childNodes');
|
|
3278
|
-
Object.defineProperty(elm, 'children', {
|
|
3279
|
-
get() {
|
|
3280
|
-
return this.childNodes.map((n) => n.nodeType === 1);
|
|
3281
|
-
},
|
|
3282
|
-
});
|
|
3283
|
-
Object.defineProperty(elm, 'childElementCount', {
|
|
3284
|
-
get() {
|
|
3285
|
-
return elm.children.length;
|
|
3286
|
-
},
|
|
3287
|
-
});
|
|
3288
|
-
Object.defineProperty(elm, 'childNodes', {
|
|
3289
|
-
get() {
|
|
3290
|
-
const childNodes = childNodesFn.call(this);
|
|
3291
|
-
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
|
|
3292
|
-
getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
|
|
3293
|
-
const result = new FakeNodeList();
|
|
3294
|
-
for (let i = 0; i < childNodes.length; i++) {
|
|
3295
|
-
const slot = childNodes[i]['s-nr'];
|
|
3296
|
-
if (slot) {
|
|
3297
|
-
result.push(slot);
|
|
3298
|
-
}
|
|
3299
|
-
}
|
|
3300
|
-
return result;
|
|
3301
|
-
}
|
|
3302
|
-
return FakeNodeList.from(childNodes);
|
|
3303
|
-
},
|
|
3304
|
-
});
|
|
3305
|
-
}
|
|
3306
|
-
};
|
|
3307
|
-
/**
|
|
3308
|
-
* Recursively finds all slot reference nodes ('s-sr') in a series of child nodes.
|
|
3309
|
-
*
|
|
3310
|
-
* @param childNodes The set of child nodes to search for slot reference nodes.
|
|
3311
|
-
* @returns An array of slot reference nodes.
|
|
3312
|
-
*/
|
|
3313
|
-
const getAllChildSlotNodes = (childNodes) => {
|
|
3314
|
-
const slotRefNodes = [];
|
|
3315
|
-
for (const childNode of Array.from(childNodes)) {
|
|
3316
|
-
if (childNode['s-sr']) {
|
|
3317
|
-
slotRefNodes.push(childNode);
|
|
3318
|
-
}
|
|
3319
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
3320
|
-
}
|
|
3321
|
-
return slotRefNodes;
|
|
3322
|
-
};
|
|
3323
|
-
const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
|
|
3324
|
-
/**
|
|
3325
|
-
* Recursively searches a series of child nodes for a slot with the provided name.
|
|
3326
|
-
* @param childNodes the nodes to search for a slot with a specific name.
|
|
3327
|
-
* @param slotName the name of the slot to match on.
|
|
3328
|
-
* @param hostName the host name of the slot to match on.
|
|
3329
|
-
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
|
3330
|
-
*/
|
|
3331
|
-
const getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
3332
|
-
let i = 0;
|
|
3333
|
-
let childNode;
|
|
3334
|
-
for (; i < childNodes.length; i++) {
|
|
3335
|
-
childNode = childNodes[i];
|
|
3336
|
-
if (childNode['s-sr'] && childNode['s-sn'] === slotName && childNode['s-hn'] === hostName) {
|
|
3337
|
-
return childNode;
|
|
3338
|
-
}
|
|
3339
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
3340
|
-
if (childNode) {
|
|
3341
|
-
return childNode;
|
|
3342
|
-
}
|
|
3343
|
-
}
|
|
3344
|
-
return null;
|
|
3345
|
-
};
|
|
3346
|
-
const getHostSlotChildNodes = (n, slotName) => {
|
|
3347
|
-
const childNodes = [n];
|
|
3348
|
-
while ((n = n.nextSibling) && n['s-sn'] === slotName) {
|
|
3349
|
-
childNodes.push(n);
|
|
3350
|
-
}
|
|
3351
|
-
return childNodes;
|
|
3352
|
-
};
|
|
3353
|
-
const defineCustomElement = (Cstr, compactMeta) => {
|
|
3354
|
-
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
3355
|
-
};
|
|
3356
|
-
const proxyCustomElement = (Cstr, compactMeta) => {
|
|
3357
|
-
const cmpMeta = {
|
|
3358
|
-
$flags$: compactMeta[0],
|
|
3359
|
-
$tagName$: compactMeta[1],
|
|
3360
|
-
};
|
|
3361
|
-
if (BUILD.member) {
|
|
3362
|
-
cmpMeta.$members$ = compactMeta[2];
|
|
3363
|
-
}
|
|
3364
|
-
if (BUILD.hostListener) {
|
|
3365
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
3366
|
-
}
|
|
3367
|
-
if (BUILD.watchCallback) {
|
|
3368
|
-
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
3369
|
-
}
|
|
3370
|
-
if (BUILD.reflect) {
|
|
3371
|
-
cmpMeta.$attrsToReflect$ = [];
|
|
3372
|
-
}
|
|
3373
|
-
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
3374
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3375
|
-
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
3376
|
-
}
|
|
3377
|
-
// TODO(STENCIL-914): this check and `else` block can go away and be replaced by just the `scoped` check
|
|
3378
|
-
if (BUILD.experimentalSlotFixes) {
|
|
3379
|
-
if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
3380
|
-
// This check is intentionally not combined with the surrounding `experimentalSlotFixes` check
|
|
3381
|
-
// since, moving forward, we only want to patch the pseudo shadow DOM when the component is scoped
|
|
3382
|
-
patchPseudoShadowDom(Cstr.prototype, cmpMeta);
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
else {
|
|
3386
|
-
if (BUILD.slotChildNodesFix) {
|
|
3387
|
-
patchChildSlotNodes(Cstr.prototype, cmpMeta);
|
|
3388
|
-
}
|
|
3389
|
-
if (BUILD.cloneNodeFix) {
|
|
3390
|
-
patchCloneNode(Cstr.prototype);
|
|
3391
|
-
}
|
|
3392
|
-
if (BUILD.appendChildSlotFix) {
|
|
3393
|
-
patchSlotAppendChild(Cstr.prototype);
|
|
3394
|
-
}
|
|
3395
|
-
if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
3396
|
-
patchTextContent(Cstr.prototype);
|
|
3397
|
-
}
|
|
3398
|
-
}
|
|
3399
|
-
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
3400
|
-
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
3401
|
-
Object.assign(Cstr.prototype, {
|
|
3402
|
-
__registerHost() {
|
|
3403
|
-
registerHost(this, cmpMeta);
|
|
3404
|
-
},
|
|
3405
|
-
connectedCallback() {
|
|
3406
|
-
connectedCallback(this);
|
|
3407
|
-
if (BUILD.connectedCallback && originalConnectedCallback) {
|
|
3408
|
-
originalConnectedCallback.call(this);
|
|
3409
|
-
}
|
|
3410
|
-
},
|
|
3411
|
-
disconnectedCallback() {
|
|
3412
|
-
disconnectedCallback(this);
|
|
3413
|
-
if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
|
|
3414
|
-
originalDisconnectedCallback.call(this);
|
|
3415
|
-
}
|
|
3416
|
-
},
|
|
3417
|
-
__attachShadow() {
|
|
3418
|
-
if (supportsShadow) {
|
|
3419
|
-
if (BUILD.shadowDelegatesFocus) {
|
|
3420
|
-
this.attachShadow({
|
|
3421
|
-
mode: 'open',
|
|
3422
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
3423
|
-
});
|
|
3424
|
-
}
|
|
3425
|
-
else {
|
|
3426
|
-
this.attachShadow({ mode: 'open' });
|
|
3427
|
-
}
|
|
3428
|
-
}
|
|
3429
|
-
else {
|
|
3430
|
-
this.shadowRoot = this;
|
|
3431
|
-
}
|
|
3432
|
-
},
|
|
3433
|
-
});
|
|
3434
|
-
Cstr.is = cmpMeta.$tagName$;
|
|
3435
|
-
return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
|
|
3436
|
-
};
|
|
3437
|
-
const forceModeUpdate = (elm) => {
|
|
3438
|
-
if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
|
|
3439
|
-
const mode = computeMode(elm);
|
|
3440
|
-
const hostRef = getHostRef(elm);
|
|
3441
|
-
if (hostRef.$modeName$ !== mode) {
|
|
3442
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
3443
|
-
const oldScopeId = elm['s-sc'];
|
|
3444
|
-
const scopeId = getScopeId(cmpMeta, mode);
|
|
3445
|
-
const style = elm.constructor.style[mode];
|
|
3446
|
-
const flags = cmpMeta.$flags$;
|
|
3447
|
-
if (style) {
|
|
3448
|
-
if (!styles.has(scopeId)) {
|
|
3449
|
-
registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
3450
|
-
}
|
|
3451
|
-
hostRef.$modeName$ = mode;
|
|
3452
|
-
elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
|
|
3453
|
-
attachStyles(hostRef);
|
|
3454
|
-
forceUpdate(elm);
|
|
3455
|
-
}
|
|
2481
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
3456
2482
|
}
|
|
3457
2483
|
}
|
|
3458
2484
|
};
|
|
3459
|
-
/**
|
|
3460
|
-
* Kick off hot-module-replacement for a component. In order to replace the
|
|
3461
|
-
* component in-place we:
|
|
3462
|
-
*
|
|
3463
|
-
* 1. get a reference to the {@link d.HostRef} for the element
|
|
3464
|
-
* 2. reset the element's runtime flags
|
|
3465
|
-
* 3. re-run the initialization logic for the element (via
|
|
3466
|
-
* {@link initializeComponent})
|
|
3467
|
-
*
|
|
3468
|
-
* @param hostElement the host element for the component which we want to start
|
|
3469
|
-
* doing HMR
|
|
3470
|
-
* @param cmpMeta runtime metadata for the component
|
|
3471
|
-
* @param hmrVersionId the current HMR version ID
|
|
3472
|
-
*/
|
|
3473
|
-
const hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
3474
|
-
// ¯\_(ツ)_/¯
|
|
3475
|
-
const hostRef = getHostRef(hostElement);
|
|
3476
|
-
// reset state flags to only have been connected
|
|
3477
|
-
hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
|
|
3478
|
-
// TODO
|
|
3479
|
-
// detach any event listeners that may have been added
|
|
3480
|
-
// because we're not passing an exact event name it'll
|
|
3481
|
-
// remove all of this element's event, which is good
|
|
3482
|
-
// re-initialize the component
|
|
3483
|
-
initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
|
|
3484
|
-
};
|
|
3485
2485
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
3486
2486
|
var _a;
|
|
3487
|
-
|
|
3488
|
-
performance.mark('st:app:start');
|
|
3489
|
-
}
|
|
3490
|
-
installDevTools();
|
|
3491
|
-
const endBootstrap = createTime('bootstrapLazy');
|
|
2487
|
+
const endBootstrap = createTime();
|
|
3492
2488
|
const cmpTags = [];
|
|
3493
2489
|
const exclude = options.exclude || [];
|
|
3494
2490
|
const customElements = win.customElements;
|
|
@@ -3502,17 +2498,12 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3502
2498
|
let i = 0;
|
|
3503
2499
|
Object.assign(plt, options);
|
|
3504
2500
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
3505
|
-
|
|
3506
|
-
if (options.syncQueue) {
|
|
3507
|
-
plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
if (BUILD.hydrateClientSide) {
|
|
2501
|
+
{
|
|
3511
2502
|
// If the app is already hydrated there is not point to disable the
|
|
3512
2503
|
// async queue. This will improve the first input delay
|
|
3513
2504
|
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
3514
2505
|
}
|
|
3515
|
-
|
|
2506
|
+
{
|
|
3516
2507
|
for (; i < styles.length; i++) {
|
|
3517
2508
|
registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
|
|
3518
2509
|
}
|
|
@@ -3532,25 +2523,19 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3532
2523
|
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
3533
2524
|
hasSlotRelocation = true;
|
|
3534
2525
|
}
|
|
3535
|
-
|
|
2526
|
+
{
|
|
3536
2527
|
cmpMeta.$members$ = compactMeta[2];
|
|
3537
2528
|
}
|
|
3538
|
-
|
|
2529
|
+
{
|
|
3539
2530
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3540
2531
|
}
|
|
3541
|
-
|
|
2532
|
+
{
|
|
3542
2533
|
cmpMeta.$attrsToReflect$ = [];
|
|
3543
2534
|
}
|
|
3544
|
-
|
|
2535
|
+
{
|
|
3545
2536
|
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
3546
2537
|
}
|
|
3547
|
-
|
|
3548
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3549
|
-
cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
|
|
3550
|
-
}
|
|
3551
|
-
const tagName = BUILD.transformTagName && options.transformTagName
|
|
3552
|
-
? options.transformTagName(cmpMeta.$tagName$)
|
|
3553
|
-
: cmpMeta.$tagName$;
|
|
2538
|
+
const tagName = cmpMeta.$tagName$;
|
|
3554
2539
|
const HostElement = class extends HTMLElement {
|
|
3555
2540
|
// StencilLazyHost
|
|
3556
2541
|
constructor(self) {
|
|
@@ -3558,25 +2543,16 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3558
2543
|
super(self);
|
|
3559
2544
|
self = this;
|
|
3560
2545
|
registerHost(self, cmpMeta);
|
|
3561
|
-
if (
|
|
2546
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
3562
2547
|
// this component is using shadow dom
|
|
3563
2548
|
// and this browser supports shadow dom
|
|
3564
2549
|
// add the read-only property "shadowRoot" to the host element
|
|
3565
2550
|
// adding the shadow root build conditionals to minimize runtime
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
self.attachShadow({
|
|
3569
|
-
mode: 'open',
|
|
3570
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
|
|
3571
|
-
});
|
|
3572
|
-
}
|
|
3573
|
-
else {
|
|
2551
|
+
{
|
|
2552
|
+
{
|
|
3574
2553
|
self.attachShadow({ mode: 'open' });
|
|
3575
2554
|
}
|
|
3576
2555
|
}
|
|
3577
|
-
else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
|
|
3578
|
-
self.shadowRoot = self;
|
|
3579
|
-
}
|
|
3580
2556
|
}
|
|
3581
2557
|
}
|
|
3582
2558
|
connectedCallback() {
|
|
@@ -3599,42 +2575,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3599
2575
|
return getHostRef(this).$onReadyPromise$;
|
|
3600
2576
|
}
|
|
3601
2577
|
};
|
|
3602
|
-
// TODO(STENCIL-914): this check and `else` block can go away and be replaced by just the `scoped` check
|
|
3603
|
-
if (BUILD.experimentalSlotFixes) {
|
|
3604
|
-
// This check is intentionally not combined with the surrounding `experimentalSlotFixes` check
|
|
3605
|
-
// since, moving forward, we only want to patch the pseudo shadow DOM when the component is scoped
|
|
3606
|
-
if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
3607
|
-
patchPseudoShadowDom(HostElement.prototype, cmpMeta);
|
|
3608
|
-
}
|
|
3609
|
-
}
|
|
3610
|
-
else {
|
|
3611
|
-
if (BUILD.slotChildNodesFix) {
|
|
3612
|
-
patchChildSlotNodes(HostElement.prototype, cmpMeta);
|
|
3613
|
-
}
|
|
3614
|
-
if (BUILD.cloneNodeFix) {
|
|
3615
|
-
patchCloneNode(HostElement.prototype);
|
|
3616
|
-
}
|
|
3617
|
-
if (BUILD.appendChildSlotFix) {
|
|
3618
|
-
patchSlotAppendChild(HostElement.prototype);
|
|
3619
|
-
}
|
|
3620
|
-
if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
3621
|
-
patchTextContent(HostElement.prototype);
|
|
3622
|
-
}
|
|
3623
|
-
}
|
|
3624
|
-
// if the component is formAssociated we need to set that on the host
|
|
3625
|
-
// element so that it will be ready for `attachInternals` to be called on
|
|
3626
|
-
// it later on
|
|
3627
|
-
if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */) {
|
|
3628
|
-
HostElement.formAssociated = true;
|
|
3629
|
-
}
|
|
3630
|
-
if (BUILD.hotModuleReplacement) {
|
|
3631
|
-
// if we're in an HMR dev build then we need to set up the callback
|
|
3632
|
-
// which will carry out the work of actually replacing the module for
|
|
3633
|
-
// this particular component
|
|
3634
|
-
HostElement.prototype['s-hmr'] = function (hmrVersionId) {
|
|
3635
|
-
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3636
|
-
};
|
|
3637
|
-
}
|
|
3638
2578
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
3639
2579
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
3640
2580
|
cmpTags.push(tagName);
|
|
@@ -3650,7 +2590,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3650
2590
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3651
2591
|
}
|
|
3652
2592
|
// Add hydration styles
|
|
3653
|
-
|
|
2593
|
+
{
|
|
3654
2594
|
dataStyles.textContent += cmpTags + HYDRATED_CSS;
|
|
3655
2595
|
}
|
|
3656
2596
|
// If we have styles, add them to the DOM
|
|
@@ -3672,40 +2612,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3672
2612
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3673
2613
|
}
|
|
3674
2614
|
else {
|
|
3675
|
-
|
|
3676
|
-
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
|
|
3677
|
-
}
|
|
3678
|
-
else {
|
|
2615
|
+
{
|
|
3679
2616
|
plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
|
|
3680
2617
|
}
|
|
3681
2618
|
}
|
|
3682
2619
|
// Fallback appLoad event
|
|
3683
2620
|
endBootstrap();
|
|
3684
2621
|
};
|
|
3685
|
-
const Fragment = (_, children) => children;
|
|
3686
2622
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3687
|
-
if (
|
|
3688
|
-
// this is called immediately within the element's constructor
|
|
3689
|
-
// initialize our event listeners on the host element
|
|
3690
|
-
// we do this now so that we can listen to events that may
|
|
3691
|
-
// have fired even before the instance is ready
|
|
3692
|
-
if (BUILD.hostListenerTargetParent) {
|
|
3693
|
-
// this component may have event listeners that should be attached to the parent
|
|
3694
|
-
if (attachParentListeners) {
|
|
3695
|
-
// this is being ran from within the connectedCallback
|
|
3696
|
-
// which is important so that we know the host element actually has a parent element
|
|
3697
|
-
// filter out the listeners to only have the ones that ARE being attached to the parent
|
|
3698
|
-
listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
|
|
3699
|
-
}
|
|
3700
|
-
else {
|
|
3701
|
-
// this is being ran from within the component constructor
|
|
3702
|
-
// everything BUT the parent element listeners should be attached at this time
|
|
3703
|
-
// filter out the listeners that are NOT being attached to the parent
|
|
3704
|
-
listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
|
|
3705
|
-
}
|
|
3706
|
-
}
|
|
2623
|
+
if (listeners) {
|
|
3707
2624
|
listeners.map(([flags, name, method]) => {
|
|
3708
|
-
const target =
|
|
2625
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
3709
2626
|
const handler = hostListenerProxy(hostRef, method);
|
|
3710
2627
|
const opts = hostListenerOpts(flags);
|
|
3711
2628
|
plt.ael(target, name, handler, opts);
|
|
@@ -3715,7 +2632,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
|
|
|
3715
2632
|
};
|
|
3716
2633
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3717
2634
|
try {
|
|
3718
|
-
|
|
2635
|
+
{
|
|
3719
2636
|
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
3720
2637
|
// instance is ready, let's call it's member method for this event
|
|
3721
2638
|
hostRef.$lazyInstance$[methodName](ev);
|
|
@@ -3724,23 +2641,14 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3724
2641
|
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
3725
2642
|
}
|
|
3726
2643
|
}
|
|
3727
|
-
else {
|
|
3728
|
-
hostRef.$hostElement$[methodName](ev);
|
|
3729
|
-
}
|
|
3730
2644
|
}
|
|
3731
2645
|
catch (e) {
|
|
3732
2646
|
consoleError(e);
|
|
3733
2647
|
}
|
|
3734
2648
|
};
|
|
3735
2649
|
const getHostListenerTarget = (elm, flags) => {
|
|
3736
|
-
if (
|
|
3737
|
-
return doc;
|
|
3738
|
-
if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
3739
|
-
return win;
|
|
3740
|
-
if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
2650
|
+
if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
3741
2651
|
return doc.body;
|
|
3742
|
-
if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
|
|
3743
|
-
return elm.parentElement;
|
|
3744
2652
|
return elm;
|
|
3745
2653
|
};
|
|
3746
2654
|
// prettier-ignore
|
|
@@ -3757,194 +2665,6 @@ const hostListenerOpts = (flags) => supportsListenerOptions
|
|
|
3757
2665
|
* @returns void
|
|
3758
2666
|
*/
|
|
3759
2667
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
3760
|
-
const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
3761
|
-
/**
|
|
3762
|
-
* Updates the DOM generated on the server with annotations such as node attributes and
|
|
3763
|
-
* comment nodes to facilitate future client-side hydration. These annotations are used for things
|
|
3764
|
-
* like moving elements back to their original hosts if using Shadow DOM on the client, and for quickly
|
|
3765
|
-
* reconstructing the vNode representations of the DOM.
|
|
3766
|
-
*
|
|
3767
|
-
* @param doc The DOM generated by the server.
|
|
3768
|
-
* @param staticComponents Any components that should be considered static and do not need client-side hydration.
|
|
3769
|
-
*/
|
|
3770
|
-
const insertVdomAnnotations = (doc, staticComponents) => {
|
|
3771
|
-
if (doc != null) {
|
|
3772
|
-
const docData = {
|
|
3773
|
-
hostIds: 0,
|
|
3774
|
-
rootLevelIds: 0,
|
|
3775
|
-
staticComponents: new Set(staticComponents),
|
|
3776
|
-
};
|
|
3777
|
-
const orgLocationNodes = [];
|
|
3778
|
-
parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
|
|
3779
|
-
orgLocationNodes.forEach((orgLocationNode) => {
|
|
3780
|
-
var _a, _b;
|
|
3781
|
-
if (orgLocationNode != null && orgLocationNode['s-nr']) {
|
|
3782
|
-
const nodeRef = orgLocationNode['s-nr'];
|
|
3783
|
-
let hostId = nodeRef['s-host-id'];
|
|
3784
|
-
let nodeId = nodeRef['s-node-id'];
|
|
3785
|
-
let childId = `${hostId}.${nodeId}`;
|
|
3786
|
-
if (hostId == null) {
|
|
3787
|
-
hostId = 0;
|
|
3788
|
-
docData.rootLevelIds++;
|
|
3789
|
-
nodeId = docData.rootLevelIds;
|
|
3790
|
-
childId = `${hostId}.${nodeId}`;
|
|
3791
|
-
if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
3792
|
-
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3793
|
-
}
|
|
3794
|
-
else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
3795
|
-
if (hostId === 0) {
|
|
3796
|
-
const textContent = (_a = nodeRef.nodeValue) === null || _a === void 0 ? void 0 : _a.trim();
|
|
3797
|
-
if (textContent === '') {
|
|
3798
|
-
// useless whitespace node at the document root
|
|
3799
|
-
orgLocationNode.remove();
|
|
3800
|
-
return;
|
|
3801
|
-
}
|
|
3802
|
-
}
|
|
3803
|
-
const commentBeforeTextNode = doc.createComment(childId);
|
|
3804
|
-
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
3805
|
-
(_b = nodeRef.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(commentBeforeTextNode, nodeRef);
|
|
3806
|
-
}
|
|
3807
|
-
}
|
|
3808
|
-
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
3809
|
-
const orgLocationParentNode = orgLocationNode.parentElement;
|
|
3810
|
-
if (orgLocationParentNode) {
|
|
3811
|
-
if (orgLocationParentNode['s-en'] === '') {
|
|
3812
|
-
// ending with a "." means that the parent element
|
|
3813
|
-
// of this node's original location is a SHADOW dom element
|
|
3814
|
-
// and this node is apart of the root level light dom
|
|
3815
|
-
orgLocationNodeId += `.`;
|
|
3816
|
-
}
|
|
3817
|
-
else if (orgLocationParentNode['s-en'] === 'c') {
|
|
3818
|
-
// ending with a ".c" means that the parent element
|
|
3819
|
-
// of this node's original location is a SCOPED element
|
|
3820
|
-
// and this node is apart of the root level light dom
|
|
3821
|
-
orgLocationNodeId += `.c`;
|
|
3822
|
-
}
|
|
3823
|
-
}
|
|
3824
|
-
orgLocationNode.nodeValue = orgLocationNodeId;
|
|
3825
|
-
}
|
|
3826
|
-
});
|
|
3827
|
-
}
|
|
3828
|
-
};
|
|
3829
|
-
/**
|
|
3830
|
-
* Recursively parses a node generated by the server and its children to set host and child id
|
|
3831
|
-
* attributes read during client-side hydration. This function also tracks whether each node is
|
|
3832
|
-
* an original location reference node meaning that a node has been moved via slot relocation.
|
|
3833
|
-
*
|
|
3834
|
-
* @param doc The DOM generated by the server.
|
|
3835
|
-
* @param node The node to parse.
|
|
3836
|
-
* @param docData An object containing metadata about the document.
|
|
3837
|
-
* @param orgLocationNodes An array of nodes that have been moved via slot relocation.
|
|
3838
|
-
*/
|
|
3839
|
-
const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
|
|
3840
|
-
if (node == null) {
|
|
3841
|
-
return;
|
|
3842
|
-
}
|
|
3843
|
-
if (node['s-nr'] != null) {
|
|
3844
|
-
orgLocationNodes.push(node);
|
|
3845
|
-
}
|
|
3846
|
-
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
3847
|
-
node.childNodes.forEach((childNode) => {
|
|
3848
|
-
const hostRef = getHostRef(childNode);
|
|
3849
|
-
if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
|
|
3850
|
-
const cmpData = {
|
|
3851
|
-
nodeIds: 0,
|
|
3852
|
-
};
|
|
3853
|
-
insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
|
|
3854
|
-
}
|
|
3855
|
-
parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
|
|
3856
|
-
});
|
|
3857
|
-
}
|
|
3858
|
-
};
|
|
3859
|
-
/**
|
|
3860
|
-
* Insert attribute annotations on an element for its host ID and, potentially, its child ID.
|
|
3861
|
-
* Also makes calls to insert annotations on the element's children, keeping track of the depth of
|
|
3862
|
-
* the component tree.
|
|
3863
|
-
*
|
|
3864
|
-
* @param doc The DOM generated by the server.
|
|
3865
|
-
* @param hostElm The element to insert annotations for.
|
|
3866
|
-
* @param vnode The vNode representation of the element.
|
|
3867
|
-
* @param docData An object containing metadata about the document.
|
|
3868
|
-
* @param cmpData An object containing metadata about the component.
|
|
3869
|
-
*/
|
|
3870
|
-
const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
3871
|
-
if (vnode != null) {
|
|
3872
|
-
const hostId = ++docData.hostIds;
|
|
3873
|
-
hostElm.setAttribute(HYDRATE_ID, hostId);
|
|
3874
|
-
if (hostElm['s-cr'] != null) {
|
|
3875
|
-
hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
|
|
3876
|
-
}
|
|
3877
|
-
if (vnode.$children$ != null) {
|
|
3878
|
-
const depth = 0;
|
|
3879
|
-
vnode.$children$.forEach((vnodeChild, index) => {
|
|
3880
|
-
insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
|
|
3881
|
-
});
|
|
3882
|
-
}
|
|
3883
|
-
// If this element does not already have a child ID and has a sibling comment node
|
|
3884
|
-
// representing a slot, we use the content of the comment to set the child ID attribute
|
|
3885
|
-
// on the host element.
|
|
3886
|
-
if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {
|
|
3887
|
-
const parent = hostElm.parentElement;
|
|
3888
|
-
if (parent && parent.childNodes) {
|
|
3889
|
-
const parentChildNodes = Array.from(parent.childNodes);
|
|
3890
|
-
const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
|
|
3891
|
-
if (comment) {
|
|
3892
|
-
const index = parentChildNodes.indexOf(hostElm) - 1;
|
|
3893
|
-
vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
|
|
3894
|
-
}
|
|
3895
|
-
}
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
};
|
|
3899
|
-
/**
|
|
3900
|
-
* Recursively analyzes the type of a child vNode and inserts annotations on the vNodes's element based on its type.
|
|
3901
|
-
* Element nodes receive a child ID attribute, text nodes have a comment with the child ID inserted before them,
|
|
3902
|
-
* and comment nodes representing a slot have their node value set to a slot node ID containing the child ID.
|
|
3903
|
-
*
|
|
3904
|
-
* @param doc The DOM generated by the server.
|
|
3905
|
-
* @param vnodeChild The vNode to insert annotations for.
|
|
3906
|
-
* @param cmpData An object containing metadata about the component.
|
|
3907
|
-
* @param hostId The host ID of this element's parent.
|
|
3908
|
-
* @param depth How deep this element sits in the component tree relative to its parent.
|
|
3909
|
-
* @param index The index of this element in its parent's children array.
|
|
3910
|
-
*/
|
|
3911
|
-
const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
|
|
3912
|
-
const childElm = vnodeChild.$elm$;
|
|
3913
|
-
if (childElm == null) {
|
|
3914
|
-
return;
|
|
3915
|
-
}
|
|
3916
|
-
const nodeId = cmpData.nodeIds++;
|
|
3917
|
-
const childId = `${hostId}.${nodeId}.${depth}.${index}`;
|
|
3918
|
-
childElm['s-host-id'] = hostId;
|
|
3919
|
-
childElm['s-node-id'] = nodeId;
|
|
3920
|
-
if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
3921
|
-
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3922
|
-
}
|
|
3923
|
-
else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
3924
|
-
const parentNode = childElm.parentNode;
|
|
3925
|
-
const nodeName = parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName;
|
|
3926
|
-
if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
|
|
3927
|
-
const textNodeId = `${TEXT_NODE_ID}.${childId}`;
|
|
3928
|
-
const commentBeforeTextNode = doc.createComment(textNodeId);
|
|
3929
|
-
parentNode === null || parentNode === void 0 ? void 0 : parentNode.insertBefore(commentBeforeTextNode, childElm);
|
|
3930
|
-
}
|
|
3931
|
-
}
|
|
3932
|
-
else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
3933
|
-
if (childElm['s-sr']) {
|
|
3934
|
-
const slotName = childElm['s-sn'] || '';
|
|
3935
|
-
const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
|
|
3936
|
-
childElm.nodeValue = slotNodeId;
|
|
3937
|
-
}
|
|
3938
|
-
}
|
|
3939
|
-
if (vnodeChild.$children$ != null) {
|
|
3940
|
-
// Increment depth each time we recur deeper into the tree
|
|
3941
|
-
const childDepth = depth + 1;
|
|
3942
|
-
vnodeChild.$children$.forEach((vnode, index) => {
|
|
3943
|
-
insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
|
|
3944
|
-
});
|
|
3945
|
-
}
|
|
3946
|
-
};
|
|
3947
|
-
var _a;
|
|
3948
2668
|
/**
|
|
3949
2669
|
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
3950
2670
|
* instances.
|
|
@@ -3960,9 +2680,7 @@ var _a;
|
|
|
3960
2680
|
* component will not have access to the previous hostRef map, leading to a
|
|
3961
2681
|
* bug where the new version of the component cannot properly initialize.
|
|
3962
2682
|
*/
|
|
3963
|
-
const hostRefs =
|
|
3964
|
-
? ((_a = window).__STENCIL_HOSTREFS__ || (_a.__STENCIL_HOSTREFS__ = new WeakMap()))
|
|
3965
|
-
: new WeakMap();
|
|
2683
|
+
const hostRefs = new WeakMap();
|
|
3966
2684
|
/**
|
|
3967
2685
|
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
3968
2686
|
*
|
|
@@ -3995,64 +2713,44 @@ const registerHost = (hostElement, cmpMeta) => {
|
|
|
3995
2713
|
$cmpMeta$: cmpMeta,
|
|
3996
2714
|
$instanceValues$: new Map(),
|
|
3997
2715
|
};
|
|
3998
|
-
|
|
3999
|
-
hostRef.$renderCount$ = 0;
|
|
4000
|
-
}
|
|
4001
|
-
if (BUILD.method && BUILD.lazyLoad) {
|
|
2716
|
+
{
|
|
4002
2717
|
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
4003
2718
|
}
|
|
4004
|
-
|
|
2719
|
+
{
|
|
4005
2720
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
4006
2721
|
hostElement['s-p'] = [];
|
|
4007
2722
|
hostElement['s-rc'] = [];
|
|
4008
2723
|
}
|
|
4009
|
-
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners
|
|
2724
|
+
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
|
|
4010
2725
|
return hostRefs.set(hostElement, hostRef);
|
|
4011
2726
|
};
|
|
4012
2727
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
4013
|
-
const consoleError = (e, el) => (
|
|
4014
|
-
const STENCIL_DEV_MODE = BUILD.isTesting
|
|
4015
|
-
? ['STENCIL:'] // E2E testing
|
|
4016
|
-
: [
|
|
4017
|
-
'%cstencil',
|
|
4018
|
-
'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
|
|
4019
|
-
];
|
|
4020
|
-
const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
4021
|
-
const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
4022
|
-
const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
4023
|
-
const setErrorHandler = (handler) => (customError = handler);
|
|
2728
|
+
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
4024
2729
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
4025
2730
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
4026
2731
|
// loadModuleImport
|
|
4027
2732
|
const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
|
4028
2733
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
4029
|
-
|
|
4030
|
-
consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
|
|
4031
|
-
return undefined;
|
|
4032
|
-
}
|
|
4033
|
-
const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
2734
|
+
const module = cmpModules.get(bundleId) ;
|
|
4034
2735
|
if (module) {
|
|
4035
2736
|
return module[exportName];
|
|
4036
2737
|
}
|
|
4037
2738
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
4038
|
-
return
|
|
2739
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
4039
2740
|
/* @vite-ignore */
|
|
4040
2741
|
/* webpackInclude: /\.entry\.js$/ */
|
|
4041
2742
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
4042
2743
|
/* webpackMode: "lazy" */
|
|
4043
|
-
`./${bundleId}.entry.js${
|
|
4044
|
-
|
|
2744
|
+
`./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
|
|
2745
|
+
{
|
|
4045
2746
|
cmpModules.set(bundleId, importedModule);
|
|
4046
2747
|
}
|
|
4047
2748
|
return importedModule[exportName];
|
|
4048
2749
|
}, consoleError);
|
|
4049
2750
|
};
|
|
4050
2751
|
const styles = /*@__PURE__*/ new Map();
|
|
4051
|
-
const modeResolutionChain = [];
|
|
4052
2752
|
const win = typeof window !== 'undefined' ? window : {};
|
|
4053
2753
|
const doc = win.document || { head: {} };
|
|
4054
|
-
const H = (win.HTMLElement || class {
|
|
4055
|
-
});
|
|
4056
2754
|
const plt = {
|
|
4057
2755
|
$flags$: 0,
|
|
4058
2756
|
$resourcesUrl$: '',
|
|
@@ -4062,14 +2760,9 @@ const plt = {
|
|
|
4062
2760
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
4063
2761
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
4064
2762
|
};
|
|
4065
|
-
const setPlatformHelpers = (helpers) => {
|
|
4066
|
-
Object.assign(plt, helpers);
|
|
4067
|
-
};
|
|
4068
2763
|
const supportsShadow =
|
|
4069
2764
|
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
4070
|
-
|
|
4071
|
-
? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
4072
|
-
: true;
|
|
2765
|
+
true;
|
|
4073
2766
|
const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
4074
2767
|
let supportsListenerOptions = false;
|
|
4075
2768
|
try {
|
|
@@ -4083,8 +2776,7 @@ const supportsListenerOptions = /*@__PURE__*/ (() => {
|
|
|
4083
2776
|
return supportsListenerOptions;
|
|
4084
2777
|
})();
|
|
4085
2778
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
4086
|
-
const supportsConstructableStylesheets =
|
|
4087
|
-
? /*@__PURE__*/ (() => {
|
|
2779
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
4088
2780
|
try {
|
|
4089
2781
|
new CSSStyleSheet();
|
|
4090
2782
|
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
@@ -4092,10 +2784,9 @@ const supportsConstructableStylesheets = BUILD.constructableCSS
|
|
|
4092
2784
|
catch (e) { }
|
|
4093
2785
|
return false;
|
|
4094
2786
|
})()
|
|
4095
|
-
|
|
2787
|
+
;
|
|
4096
2788
|
const queueDomReads = [];
|
|
4097
2789
|
const queueDomWrites = [];
|
|
4098
|
-
const queueDomWritesLow = [];
|
|
4099
2790
|
const queueTask = (queue, write) => (cb) => {
|
|
4100
2791
|
queue.push(cb);
|
|
4101
2792
|
if (!queuePending) {
|
|
@@ -4119,53 +2810,13 @@ const consume = (queue) => {
|
|
|
4119
2810
|
}
|
|
4120
2811
|
queue.length = 0;
|
|
4121
2812
|
};
|
|
4122
|
-
const consumeTimeout = (queue, timeout) => {
|
|
4123
|
-
let i = 0;
|
|
4124
|
-
let ts = 0;
|
|
4125
|
-
while (i < queue.length && (ts = performance.now()) < timeout) {
|
|
4126
|
-
try {
|
|
4127
|
-
queue[i++](ts);
|
|
4128
|
-
}
|
|
4129
|
-
catch (e) {
|
|
4130
|
-
consoleError(e);
|
|
4131
|
-
}
|
|
4132
|
-
}
|
|
4133
|
-
if (i === queue.length) {
|
|
4134
|
-
queue.length = 0;
|
|
4135
|
-
}
|
|
4136
|
-
else if (i !== 0) {
|
|
4137
|
-
queue.splice(0, i);
|
|
4138
|
-
}
|
|
4139
|
-
};
|
|
4140
2813
|
const flush = () => {
|
|
4141
|
-
if (BUILD.asyncQueue) {
|
|
4142
|
-
queueCongestion++;
|
|
4143
|
-
}
|
|
4144
2814
|
// always force a bunch of medium callbacks to run, but still have
|
|
4145
2815
|
// a throttle on how many can run in a certain time
|
|
4146
2816
|
// DOM READS!!!
|
|
4147
2817
|
consume(queueDomReads);
|
|
4148
2818
|
// DOM WRITES!!!
|
|
4149
|
-
|
|
4150
|
-
const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
|
|
4151
|
-
? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
|
|
4152
|
-
: Infinity;
|
|
4153
|
-
consumeTimeout(queueDomWrites, timeout);
|
|
4154
|
-
consumeTimeout(queueDomWritesLow, timeout);
|
|
4155
|
-
if (queueDomWrites.length > 0) {
|
|
4156
|
-
queueDomWritesLow.push(...queueDomWrites);
|
|
4157
|
-
queueDomWrites.length = 0;
|
|
4158
|
-
}
|
|
4159
|
-
if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
|
|
4160
|
-
// still more to do yet, but we've run out of time
|
|
4161
|
-
// let's let this thing cool off and try again in the next tick
|
|
4162
|
-
plt.raf(flush);
|
|
4163
|
-
}
|
|
4164
|
-
else {
|
|
4165
|
-
queueCongestion = 0;
|
|
4166
|
-
}
|
|
4167
|
-
}
|
|
4168
|
-
else {
|
|
2819
|
+
{
|
|
4169
2820
|
consume(queueDomWrites);
|
|
4170
2821
|
if ((queuePending = queueDomReads.length > 0)) {
|
|
4171
2822
|
// still more to do yet, but we've run out of time
|
|
@@ -4175,9 +2826,15 @@ const flush = () => {
|
|
|
4175
2826
|
}
|
|
4176
2827
|
};
|
|
4177
2828
|
const nextTick = (cb) => promiseResolve().then(cb);
|
|
4178
|
-
const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
|
|
4179
2829
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
4180
2830
|
|
|
4181
|
-
|
|
2831
|
+
exports.Host = Host;
|
|
2832
|
+
exports.bootstrapLazy = bootstrapLazy;
|
|
2833
|
+
exports.createEvent = createEvent;
|
|
2834
|
+
exports.getElement = getElement;
|
|
2835
|
+
exports.h = h;
|
|
2836
|
+
exports.promiseResolve = promiseResolve;
|
|
2837
|
+
exports.registerInstance = registerInstance;
|
|
2838
|
+
exports.setNonce = setNonce;
|
|
4182
2839
|
|
|
4183
|
-
//# sourceMappingURL=index-
|
|
2840
|
+
//# sourceMappingURL=index-11f95019.js.map
|