@watermarkinsights/ripple 4.3.0 → 4.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/chartFunctions-cecf8134.js +600 -0
- package/dist/cjs/{functions-91da05e9.js → functions-4208c444.js} +362 -362
- package/dist/cjs/{global-20d48c6c.js → global-bd289a67.js} +24 -24
- package/dist/cjs/{index-fae02cd7.js → index-f8ef86de.js} +436 -150
- package/dist/cjs/interfaces-ad9e80a6.js +38 -0
- package/dist/cjs/intl-3fafc6d1.js +179 -0
- package/dist/cjs/loader.cjs.js +4 -13
- package/dist/cjs/priv-chart-popover.cjs.entry.js +85 -85
- package/dist/cjs/priv-datepicker.cjs.entry.js +637 -637
- package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
- package/dist/cjs/priv-navigator-item.cjs.entry.js +21 -21
- package/dist/cjs/ripple.cjs.js +4 -7
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +314 -314
- package/dist/cjs/wm-button.cjs.entry.js +174 -174
- package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -17
- package/dist/cjs/wm-chart.cjs.entry.js +164 -164
- package/dist/cjs/wm-datepicker.cjs.entry.js +160 -160
- package/dist/cjs/wm-file-list.cjs.entry.js +10 -10
- package/dist/cjs/wm-file.cjs.entry.js +178 -178
- package/dist/cjs/wm-input.cjs.entry.js +102 -102
- package/dist/cjs/wm-line-chart.cjs.entry.js +462 -462
- package/dist/cjs/wm-modal-footer.cjs.entry.js +27 -27
- package/dist/cjs/wm-modal-header.cjs.entry.js +21 -21
- package/dist/cjs/wm-modal.cjs.entry.js +92 -92
- package/dist/cjs/wm-navigation_3.cjs.entry.js +179 -179
- package/dist/cjs/wm-navigator.cjs.entry.js +255 -251
- package/dist/cjs/wm-option_2.cjs.entry.js +710 -710
- package/dist/cjs/wm-pagination.cjs.entry.js +169 -169
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +151 -151
- package/dist/cjs/wm-search.cjs.entry.js +192 -192
- package/dist/cjs/wm-snackbar.cjs.entry.js +114 -114
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +247 -247
- package/dist/cjs/wm-tag-input.cjs.entry.js +849 -849
- package/dist/cjs/wm-tag-option.cjs.entry.js +33 -33
- package/dist/cjs/wm-timepicker.cjs.entry.js +270 -270
- package/dist/cjs/wm-toggletip.cjs.entry.js +99 -99
- package/dist/cjs/wm-uploader.cjs.entry.js +198 -198
- package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
- package/dist/collection/collection-manifest.json +41 -41
- package/dist/collection/components/charts/chartFunctions.js +456 -456
- package/dist/collection/components/charts/chartFunctions.spec.js +13 -13
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +73 -73
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +257 -254
- package/dist/collection/components/charts/screenshots.e2e.js +30 -30
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +121 -121
- package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +160 -160
- package/dist/collection/components/charts/wm-chart/wm-chart.js +382 -381
- package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +26 -26
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1 -2
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +138 -138
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +731 -731
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +106 -106
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +202 -202
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +54 -54
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +136 -136
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +31 -31
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +119 -119
- package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +187 -187
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -435
- package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +35 -35
- package/dist/collection/components/wm-button/wm-button.e2e.js +58 -58
- package/dist/collection/components/wm-button/wm-button.js +454 -452
- package/dist/collection/components/wm-button/wm-button.spec.js +63 -63
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +943 -939
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +71 -71
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -2
- package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +359 -359
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +415 -413
- package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +13 -13
- package/dist/collection/components/wm-file/wm-file.js +380 -380
- package/dist/collection/components/wm-file/wm-file.spec.js +107 -107
- package/dist/collection/components/wm-file-list/wm-file-list.js +42 -42
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +47 -47
- package/dist/collection/components/wm-input/wm-input.e2e.js +26 -26
- package/dist/collection/components/wm-input/wm-input.js +453 -453
- package/dist/collection/components/wm-input/wm-input.spec.js +168 -168
- package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +18 -18
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +446 -436
- package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +46 -46
- package/dist/collection/components/wm-modal/wm-modal-footer.js +130 -130
- package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +8 -8
- package/dist/collection/components/wm-modal/wm-modal-header.js +68 -68
- package/dist/collection/components/wm-modal/wm-modal-header.spec.js +5 -5
- package/dist/collection/components/wm-modal/wm-modal.e2e.js +65 -65
- package/dist/collection/components/wm-modal/wm-modal.js +299 -296
- package/dist/collection/components/wm-modal/wm-modal.spec.js +22 -22
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -1
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +112 -112
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +125 -125
- package/dist/collection/components/wm-navigation/wm-navigation.css +0 -2
- package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +86 -86
- package/dist/collection/components/wm-navigation/wm-navigation.js +209 -209
- package/dist/collection/components/wm-navigation/wm-navigation.spec.js +79 -79
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +30 -30
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +103 -103
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +119 -118
- package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +180 -180
- package/dist/collection/components/wm-navigator/wm-navigator.js +458 -454
- package/dist/collection/components/wm-navigator/wm-navigator.spec.js +153 -153
- package/dist/collection/components/wm-option/wm-option.e2e.js +19 -19
- package/dist/collection/components/wm-option/wm-option.js +474 -463
- package/dist/collection/components/wm-option/wm-option.spec.js +39 -39
- package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +301 -301
- package/dist/collection/components/wm-pagination/wm-pagination.js +327 -327
- package/dist/collection/components/wm-search/wm-search.e2e.js +69 -69
- package/dist/collection/components/wm-search/wm-search.js +415 -414
- package/dist/collection/components/wm-search/wm-search.spec.js +64 -64
- package/dist/collection/components/wm-select/wm-select.e2e.js +443 -443
- package/dist/collection/components/wm-select/wm-select.js +967 -966
- package/dist/collection/components/wm-select/wm-select.spec.js +250 -250
- package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +114 -114
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +209 -207
- package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +4 -4
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +190 -188
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +261 -261
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +79 -79
- package/dist/collection/components/wm-tabs/wm-tabs.spec.js +6 -6
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +2 -4
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +168 -168
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1159 -1159
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +147 -147
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +236 -234
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1 -2
- package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +147 -147
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +531 -527
- package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +151 -151
- package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +61 -61
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +209 -208
- package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +16 -16
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +56 -56
- package/dist/collection/components/wm-uploader/wm-uploader.js +423 -422
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +149 -149
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -26
- package/dist/collection/global/__mocks__/functions.js +1 -1
- package/dist/collection/global/functions.js +510 -510
- package/dist/collection/global/functions.spec.js +123 -123
- package/dist/collection/global/global.js +16 -16
- package/dist/collection/global/interfaces.js +39 -39
- package/dist/collection/global/intl.js +162 -162
- package/dist/collection/global/services/__mocks__/http-service.js +112 -112
- package/dist/collection/global/services/http-service.js +41 -41
- package/dist/collection/global/themes/default.js +4 -4
- package/dist/collection/global/themes/neutral.js +4 -4
- package/dist/collection/lang/lang.spec.js +13 -13
- package/dist/esm/chartFunctions-23173fce.js +584 -0
- package/dist/esm/{functions-5afd09f4.js → functions-d0e70094.js} +362 -362
- package/dist/esm/{global-d4a9e80e.js → global-4569c7b8.js} +24 -24
- package/dist/esm/{index-7e11ea42.js → index-f164fbca.js} +436 -150
- package/dist/esm/interfaces-9b75fb61.js +35 -0
- package/dist/esm/intl-05c9e0c9.js +174 -0
- package/dist/esm/loader.js +5 -14
- package/dist/esm/priv-chart-popover.entry.js +85 -85
- package/dist/esm/priv-datepicker.entry.js +637 -637
- package/dist/esm/priv-navigator-button.entry.js +18 -18
- package/dist/esm/priv-navigator-item.entry.js +21 -21
- package/dist/esm/ripple.js +5 -8
- package/dist/esm/wm-action-menu_2.entry.js +314 -314
- package/dist/esm/wm-button.entry.js +174 -174
- package/dist/esm/wm-chart-slice.entry.js +17 -17
- package/dist/esm/wm-chart.entry.js +164 -164
- package/dist/esm/wm-datepicker.entry.js +160 -160
- package/dist/esm/wm-file-list.entry.js +10 -10
- package/dist/esm/wm-file.entry.js +178 -178
- package/dist/esm/wm-input.entry.js +102 -102
- package/dist/esm/wm-line-chart.entry.js +462 -462
- package/dist/esm/wm-modal-footer.entry.js +27 -27
- package/dist/esm/wm-modal-header.entry.js +21 -21
- package/dist/esm/wm-modal.entry.js +92 -92
- package/dist/esm/wm-navigation_3.entry.js +179 -179
- package/dist/esm/wm-navigator.entry.js +255 -251
- package/dist/esm/wm-option_2.entry.js +710 -710
- package/dist/esm/wm-pagination.entry.js +169 -169
- package/dist/esm/wm-progress-indicator_3.entry.js +151 -151
- package/dist/esm/wm-search.entry.js +192 -192
- package/dist/esm/wm-snackbar.entry.js +114 -114
- package/dist/esm/wm-tab-item_3.entry.js +247 -247
- package/dist/esm/wm-tag-input.entry.js +849 -849
- package/dist/esm/wm-tag-option.entry.js +33 -33
- package/dist/esm/wm-timepicker.entry.js +270 -270
- package/dist/esm/wm-toggletip.entry.js +99 -99
- package/dist/esm/wm-uploader.entry.js +198 -198
- package/dist/esm/wm-wrapper.entry.js +12 -12
- package/dist/esm-es5/chartFunctions-23173fce.js +1 -0
- package/dist/esm-es5/functions-d0e70094.js +1 -0
- package/dist/esm-es5/global-4569c7b8.js +1 -0
- package/dist/esm-es5/index-f164fbca.js +2 -0
- package/dist/esm-es5/{intl-e2da750a.js → intl-05c9e0c9.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-wrapper.entry.js +1 -1
- package/dist/loader/index.d.ts +1 -1
- package/dist/ripple/p-028ef6db.system.entry.js +1 -0
- package/dist/ripple/{p-863e737a.js → p-05d4e49b.js} +1 -1
- package/dist/ripple/{p-a1e95b05.system.entry.js → p-06776596.system.entry.js} +1 -1
- package/dist/ripple/{p-622a7791.system.entry.js → p-067d7922.system.entry.js} +1 -1
- package/dist/ripple/p-09d62ddd.entry.js +1 -0
- package/dist/ripple/{p-f30839a1.system.entry.js → p-0ecbf569.system.entry.js} +1 -1
- package/dist/ripple/p-0fe97e85.system.js +2 -0
- package/dist/ripple/{p-24b08e1f.js → p-13ca30d8.js} +1 -1
- package/dist/ripple/{p-8f3f903f.system.js → p-1402cfa2.system.js} +1 -1
- package/dist/ripple/p-1453ea51.system.entry.js +1 -0
- package/dist/ripple/{p-6abb903c.entry.js → p-153701f9.entry.js} +1 -1
- package/dist/ripple/p-1cc91907.system.js +1 -0
- package/dist/ripple/{p-ad37cdfd.entry.js → p-1d8b0039.entry.js} +1 -1
- package/dist/ripple/{p-d0f1b8c4.system.entry.js → p-1fa2a756.system.entry.js} +1 -1
- package/dist/ripple/{p-a52c5a1c.entry.js → p-25446670.entry.js} +1 -1
- package/dist/ripple/{p-1283e85d.entry.js → p-27f47edc.entry.js} +1 -1
- package/dist/ripple/{p-32b1126c.system.entry.js → p-28e4583c.system.entry.js} +1 -1
- package/dist/ripple/{p-a5b23781.system.entry.js → p-2c4f312d.system.entry.js} +1 -1
- package/dist/ripple/p-30b17818.system.entry.js +1 -0
- package/dist/ripple/{p-0631be01.system.entry.js → p-3446852f.system.entry.js} +1 -1
- package/dist/ripple/{p-ae674a54.entry.js → p-350fe5da.entry.js} +1 -1
- package/dist/ripple/{p-d04ba5f8.system.entry.js → p-3583d113.system.entry.js} +1 -1
- package/dist/ripple/{p-cbd8a60b.system.entry.js → p-361cc8fc.system.entry.js} +1 -1
- package/dist/ripple/{p-7529706d.entry.js → p-372faf33.entry.js} +1 -1
- package/dist/ripple/{p-19773c40.entry.js → p-3a070f35.entry.js} +1 -1
- package/dist/ripple/{p-c7b5ac39.js → p-3af72848.js} +1 -1
- package/dist/ripple/{p-c41603e6.entry.js → p-42ebfcfa.entry.js} +1 -1
- package/dist/ripple/{p-13594c2e.entry.js → p-43e2a49a.entry.js} +1 -1
- package/dist/ripple/{p-ed942b42.entry.js → p-49118468.entry.js} +1 -1
- package/dist/ripple/p-49c85d1a.system.js +1 -0
- package/dist/ripple/p-4de51706.js +2 -0
- package/dist/ripple/{p-3c80bf67.entry.js → p-58174f4e.entry.js} +1 -1
- package/dist/ripple/{p-c5e8f8a5.system.entry.js → p-5a4d9897.system.entry.js} +1 -1
- package/dist/ripple/{p-e3f0b57f.system.entry.js → p-5ac980e2.system.entry.js} +1 -1
- package/dist/ripple/{p-3becce62.system.entry.js → p-633cd89a.system.entry.js} +1 -1
- package/dist/ripple/{p-1205fdc1.entry.js → p-63f75d43.entry.js} +1 -1
- package/dist/ripple/{p-90ea7e3a.system.entry.js → p-67d48c33.system.entry.js} +1 -1
- package/dist/ripple/{p-8ef87907.entry.js → p-6caaf85f.entry.js} +1 -1
- package/dist/ripple/{p-935513f8.entry.js → p-6cf7a34a.entry.js} +1 -1
- package/dist/ripple/p-73289c2c.system.js +1 -0
- package/dist/ripple/{p-c76bbedf.system.entry.js → p-7a8816d9.system.entry.js} +1 -1
- package/dist/ripple/{p-8ea68cb3.system.entry.js → p-7e56da2e.system.entry.js} +1 -1
- package/dist/ripple/{p-deb4f5a2.entry.js → p-7e8daaac.entry.js} +1 -1
- package/dist/ripple/p-88406560.system.entry.js +1 -0
- package/dist/ripple/{p-84a7e757.entry.js → p-8cace32f.entry.js} +1 -1
- package/dist/ripple/{p-80aef387.entry.js → p-8d4734ad.entry.js} +1 -1
- package/dist/ripple/p-8f76a838.system.entry.js +1 -0
- package/dist/ripple/p-934c1b6b.js +1 -0
- package/dist/ripple/{p-85f744ed.system.js → p-9fecbc8a.system.js} +1 -1
- package/dist/ripple/{p-b71a83e3.entry.js → p-a69c37e0.entry.js} +1 -1
- package/dist/ripple/{p-9288659b.entry.js → p-a82a8931.entry.js} +1 -1
- package/dist/ripple/p-a99b05de.system.entry.js +1 -0
- package/dist/ripple/{p-36049d2f.entry.js → p-aadf8c59.entry.js} +1 -1
- package/dist/ripple/{p-676c1089.system.entry.js → p-aba5a00e.system.entry.js} +1 -1
- package/dist/ripple/{p-0aecac86.entry.js → p-ad6dc751.entry.js} +1 -1
- package/dist/ripple/{p-0f1ff645.entry.js → p-b253d2fc.entry.js} +1 -1
- package/dist/ripple/p-b2ff4723.system.entry.js +1 -0
- package/dist/ripple/{p-a0bf5eef.entry.js → p-b452d1d7.entry.js} +1 -1
- package/dist/ripple/{p-1cde16a7.system.entry.js → p-b4d862e1.system.entry.js} +1 -1
- package/dist/ripple/{p-d496bc44.system.entry.js → p-bdd4f919.system.entry.js} +1 -1
- package/dist/ripple/p-c18b398c.system.js +1 -0
- package/dist/ripple/{p-8f8c3705.entry.js → p-c249063c.entry.js} +1 -1
- package/dist/ripple/p-c344a69c.entry.js +1 -0
- package/dist/ripple/{p-0d9f70ab.entry.js → p-c717d895.entry.js} +1 -1
- package/dist/ripple/{p-2e773564.system.entry.js → p-c96a5c94.system.entry.js} +1 -1
- package/dist/ripple/{p-15497721.system.entry.js → p-ceced3d9.system.entry.js} +1 -1
- package/dist/ripple/{p-d428e9bb.system.entry.js → p-d16f91e9.system.entry.js} +1 -1
- package/dist/ripple/{p-ff14e4ec.system.entry.js → p-d3f9d028.system.entry.js} +1 -1
- package/dist/ripple/{p-7962f562.entry.js → p-de349bee.entry.js} +1 -1
- package/dist/ripple/{p-b3c73bc9.entry.js → p-e24ddae1.entry.js} +1 -1
- package/dist/ripple/{p-b3e08b14.system.entry.js → p-e8b58666.system.entry.js} +1 -1
- package/dist/ripple/{p-a9c096b5.entry.js → p-fa87bce3.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +16 -20
- package/dist/types/components/charts/chartFunctions.d.ts +13 -13
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +24 -24
- package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +8 -8
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +39 -39
- package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +74 -74
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +7 -7
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -43
- package/dist/types/components/wm-button/wm-button.d.ts +40 -40
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +31 -31
- package/dist/types/components/wm-file/wm-file.d.ts +40 -40
- package/dist/types/components/wm-file-list/wm-file-list.d.ts +3 -3
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +31 -31
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +11 -11
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +7 -7
- package/dist/types/components/wm-modal/wm-modal.d.ts +24 -24
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +13 -13
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +10 -10
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +23 -23
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +7 -7
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +57 -57
- package/dist/types/components/wm-option/wm-option.d.ts +36 -36
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +27 -27
- package/dist/types/components/wm-search/wm-search.d.ts +73 -73
- package/dist/types/components/wm-select/wm-select.d.ts +99 -99
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +24 -24
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -30
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +41 -41
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +16 -16
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +114 -114
- package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +15 -15
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +48 -48
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +20 -20
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +47 -47
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
- package/dist/types/components.d.ts +382 -0
- package/dist/types/global/__mocks__/functions.d.ts +1 -1
- package/dist/types/global/functions.d.ts +4 -4
- package/dist/types/global/interfaces.d.ts +49 -49
- package/dist/types/global/intl.d.ts +31 -31
- package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +46 -5
- package/package.json +1 -1
- package/dist/cjs/chartFunctions-2c3e010e.js +0 -600
- package/dist/cjs/interfaces-245d7bff.js +0 -38
- package/dist/cjs/intl-fa3bb4ae.js +0 -179
- package/dist/esm/chartFunctions-36634c04.js +0 -584
- package/dist/esm/interfaces-89cad2fc.js +0 -35
- package/dist/esm/intl-e2da750a.js +0 -174
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/chartFunctions-36634c04.js +0 -1
- package/dist/esm-es5/functions-5afd09f4.js +0 -1
- package/dist/esm-es5/global-d4a9e80e.js +0 -1
- package/dist/esm-es5/index-7e11ea42.js +0 -2
- package/dist/ripple/p-00acacbe.system.entry.js +0 -1
- package/dist/ripple/p-0f889b84.system.js +0 -1
- package/dist/ripple/p-13af8346.entry.js +0 -1
- package/dist/ripple/p-16363e1c.system.entry.js +0 -1
- package/dist/ripple/p-2a95b63f.system.entry.js +0 -1
- package/dist/ripple/p-30bf24f8.system.js +0 -2
- package/dist/ripple/p-3248c0fa.system.entry.js +0 -1
- package/dist/ripple/p-47c20b05.entry.js +0 -1
- package/dist/ripple/p-56d64283.system.entry.js +0 -1
- package/dist/ripple/p-5e85967a.system.js +0 -1
- package/dist/ripple/p-9b2034f6.js +0 -1
- package/dist/ripple/p-a3d07be5.system.js +0 -1
- package/dist/ripple/p-a6be3cca.system.entry.js +0 -1
- package/dist/ripple/p-aafa111a.system.js +0 -1
- package/dist/ripple/p-b5bedd63.js +0 -2
- package/dist/ripple/p-bd537299.system.entry.js +0 -1
- /package/dist/esm-es5/{interfaces-89cad2fc.js → interfaces-9b75fb61.js} +0 -0
- /package/dist/ripple/{p-c0c111fd.js → p-196eb2f3.js} +0 -0
|
@@ -21,6 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'ripple';
|
|
24
|
+
const BUILD = /* ripple */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: true, 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: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -53,6 +54,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
57
|
+
/**
|
|
58
|
+
* Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
|
|
59
|
+
*
|
|
60
|
+
* Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
|
|
61
|
+
* support as of Stencil v4.
|
|
62
|
+
*/
|
|
63
|
+
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
56
64
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
57
65
|
/**
|
|
58
66
|
* Default style mode id
|
|
@@ -133,13 +141,13 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
133
141
|
};
|
|
134
142
|
walk(children);
|
|
135
143
|
if (vnodeData) {
|
|
136
|
-
// normalize class / classname attributes
|
|
137
144
|
if (vnodeData.key) {
|
|
138
145
|
key = vnodeData.key;
|
|
139
146
|
}
|
|
140
147
|
if (vnodeData.name) {
|
|
141
148
|
slotName = vnodeData.name;
|
|
142
149
|
}
|
|
150
|
+
// normalize class / className attributes
|
|
143
151
|
{
|
|
144
152
|
const classData = vnodeData.className || vnodeData.class;
|
|
145
153
|
if (classData) {
|
|
@@ -290,9 +298,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
290
298
|
}
|
|
291
299
|
styles.set(scopeId, style);
|
|
292
300
|
};
|
|
293
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
301
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
294
302
|
var _a;
|
|
295
|
-
|
|
303
|
+
const scopeId = getScopeId(cmpMeta);
|
|
296
304
|
const style = styles.get(scopeId);
|
|
297
305
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
298
306
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -307,11 +315,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
307
315
|
}
|
|
308
316
|
if (!appliedStyles.has(scopeId)) {
|
|
309
317
|
{
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
styleElm = doc.createElement('style');
|
|
313
|
-
styleElm.innerHTML = style;
|
|
314
|
-
}
|
|
318
|
+
styleElm = doc.createElement('style');
|
|
319
|
+
styleElm.innerHTML = style;
|
|
315
320
|
// Apply CSP nonce to the style tag if it exists
|
|
316
321
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
317
322
|
if (nonce != null) {
|
|
@@ -319,6 +324,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
319
324
|
}
|
|
320
325
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
321
326
|
}
|
|
327
|
+
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
328
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
329
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
330
|
+
}
|
|
322
331
|
if (appliedStyles) {
|
|
323
332
|
appliedStyles.add(scopeId);
|
|
324
333
|
}
|
|
@@ -336,7 +345,6 @@ const attachStyles = (hostRef) => {
|
|
|
336
345
|
const flags = cmpMeta.$flags$;
|
|
337
346
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
338
347
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
339
|
-
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
340
348
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
341
349
|
// only required when we're NOT using native shadow dom (slot)
|
|
342
350
|
// or this browser doesn't support native shadow dom
|
|
@@ -359,6 +367,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
359
367
|
*
|
|
360
368
|
* Modified for Stencil's compiler and vdom
|
|
361
369
|
*/
|
|
370
|
+
/**
|
|
371
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
372
|
+
* corresponding HTML element.
|
|
373
|
+
*
|
|
374
|
+
* Note that this function has special functionality for the `class`,
|
|
375
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
376
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
377
|
+
*
|
|
378
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
379
|
+
* @param memberName the name of the attribute to set
|
|
380
|
+
* @param oldValue the old value for the attribute
|
|
381
|
+
* @param newValue the new value for the attribute
|
|
382
|
+
* @param isSvg whether we're in an svg context or not
|
|
383
|
+
* @param flags bitflags for Vdom variables
|
|
384
|
+
*/
|
|
362
385
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
363
386
|
if (oldValue !== newValue) {
|
|
364
387
|
let isProp = isMemberInElement(elm, memberName);
|
|
@@ -435,11 +458,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
435
458
|
// except for the first character, we keep the event name case
|
|
436
459
|
memberName = ln[2] + memberName.slice(3);
|
|
437
460
|
}
|
|
438
|
-
if (oldValue) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
461
|
+
if (oldValue || newValue) {
|
|
462
|
+
// Need to account for "capture" events.
|
|
463
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
464
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
465
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
466
|
+
// Make sure we only replace the last instance of "Capture"
|
|
467
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
468
|
+
if (oldValue) {
|
|
469
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
470
|
+
}
|
|
471
|
+
if (newValue) {
|
|
472
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
473
|
+
}
|
|
443
474
|
}
|
|
444
475
|
}
|
|
445
476
|
else {
|
|
@@ -461,7 +492,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
461
492
|
elm[memberName] = newValue;
|
|
462
493
|
}
|
|
463
494
|
}
|
|
464
|
-
catch (e) {
|
|
495
|
+
catch (e) {
|
|
496
|
+
/**
|
|
497
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
498
|
+
*/
|
|
499
|
+
}
|
|
465
500
|
}
|
|
466
501
|
/**
|
|
467
502
|
* Need to manually update attribute if:
|
|
@@ -500,7 +535,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
500
535
|
}
|
|
501
536
|
};
|
|
502
537
|
const parseClassListRegex = /\s/;
|
|
538
|
+
/**
|
|
539
|
+
* Parsed a string of classnames into an array
|
|
540
|
+
* @param value className string, e.g. "foo bar baz"
|
|
541
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
542
|
+
*/
|
|
503
543
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
544
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
545
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
504
546
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
505
547
|
// if the element passed in is a shadow root, which is a document fragment
|
|
506
548
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -534,6 +576,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
534
576
|
* @returns the newly created node
|
|
535
577
|
*/
|
|
536
578
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
579
|
+
var _a;
|
|
537
580
|
// tslint:disable-next-line: prefer-const
|
|
538
581
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
539
582
|
let i = 0;
|
|
@@ -607,11 +650,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
607
650
|
}
|
|
608
651
|
}
|
|
609
652
|
}
|
|
653
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
654
|
+
// to another component but don't end up in a slot
|
|
655
|
+
elm['s-hn'] = hostTagName;
|
|
610
656
|
{
|
|
611
|
-
elm['s-hn'] = hostTagName;
|
|
612
657
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
613
658
|
// remember the content reference comment
|
|
614
659
|
elm['s-sr'] = true;
|
|
660
|
+
// Persist the name of the slot that this slot was going to be projected into.
|
|
661
|
+
elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
|
|
615
662
|
// remember the content reference comment
|
|
616
663
|
elm['s-cr'] = contentRef;
|
|
617
664
|
// remember the slot name, or empty string for default slot
|
|
@@ -619,30 +666,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
619
666
|
// check if we've got an old vnode for this slot
|
|
620
667
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
621
668
|
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
669
|
+
{
|
|
670
|
+
// we've got an old slot vnode and the wrapper is being replaced
|
|
671
|
+
// so let's move the old slot content back to its original location
|
|
672
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
673
|
+
}
|
|
625
674
|
}
|
|
626
675
|
}
|
|
627
676
|
}
|
|
628
677
|
return elm;
|
|
629
678
|
};
|
|
630
679
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
680
|
+
var _a;
|
|
631
681
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
632
682
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
633
683
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
634
684
|
const childNode = oldSlotChildNodes[i];
|
|
635
685
|
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
636
|
-
// // this child node in the old element is from another component
|
|
637
|
-
// // remove this node from the old slot's parent
|
|
638
|
-
// childNode.remove();
|
|
639
686
|
// and relocate it back to it's original location
|
|
640
687
|
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
641
688
|
// remove the old original location comment entirely
|
|
642
689
|
// later on the patch function will know what to do
|
|
643
|
-
// and move this to the correct spot
|
|
690
|
+
// and move this to the correct spot if need be
|
|
644
691
|
childNode['s-ol'].remove();
|
|
645
692
|
childNode['s-ol'] = undefined;
|
|
693
|
+
// Reset so we can correctly move the node around again.
|
|
694
|
+
childNode['s-sh'] = undefined;
|
|
695
|
+
// When putting an element node back in its original location,
|
|
696
|
+
// we need to reset the `slot` attribute back to the value it originally had
|
|
697
|
+
// so we can correctly relocate it again in the future
|
|
698
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
699
|
+
childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
|
|
700
|
+
}
|
|
646
701
|
checkSlotRelocate = true;
|
|
647
702
|
}
|
|
648
703
|
if (recursive) {
|
|
@@ -1066,42 +1121,53 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1066
1121
|
elm.data = text;
|
|
1067
1122
|
}
|
|
1068
1123
|
};
|
|
1124
|
+
/**
|
|
1125
|
+
* Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
|
|
1126
|
+
* are slot fallbacks nodes.
|
|
1127
|
+
*
|
|
1128
|
+
* A slot fallback node should be visible by default. Then, it should be
|
|
1129
|
+
* conditionally hidden if:
|
|
1130
|
+
*
|
|
1131
|
+
* - it has a sibling with a `slot` property set to its slot name or if
|
|
1132
|
+
* - it is a default fallback slot node, in which case we hide if it has any
|
|
1133
|
+
* content
|
|
1134
|
+
*
|
|
1135
|
+
* @param elm the element of interest
|
|
1136
|
+
*/
|
|
1069
1137
|
const updateFallbackSlotVisibility = (elm) => {
|
|
1070
|
-
// tslint:disable-next-line: prefer-const
|
|
1071
1138
|
const childNodes = elm.childNodes;
|
|
1072
|
-
|
|
1073
|
-
let i;
|
|
1074
|
-
let ilen;
|
|
1075
|
-
let j;
|
|
1076
|
-
let slotNameAttr;
|
|
1077
|
-
let nodeType;
|
|
1078
|
-
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1079
|
-
childNode = childNodes[i];
|
|
1139
|
+
for (const childNode of childNodes) {
|
|
1080
1140
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1081
1141
|
if (childNode['s-sr']) {
|
|
1082
1142
|
// this is a slot fallback node
|
|
1083
1143
|
// get the slot name for this slot reference node
|
|
1084
|
-
|
|
1144
|
+
const slotName = childNode['s-sn'];
|
|
1085
1145
|
// by default always show a fallback slot node
|
|
1086
1146
|
// then hide it if there are other slots in the light dom
|
|
1087
1147
|
childNode.hidden = false;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1148
|
+
// we need to check all of its sibling nodes in order to see if
|
|
1149
|
+
// `childNode` should be hidden
|
|
1150
|
+
for (const siblingNode of childNodes) {
|
|
1151
|
+
// Don't check the node against itself
|
|
1152
|
+
if (siblingNode !== childNode) {
|
|
1153
|
+
if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
|
|
1154
|
+
// this sibling node is from a different component OR is a named
|
|
1155
|
+
// fallback slot node
|
|
1156
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
1157
|
+
(slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
|
|
1158
|
+
childNode.hidden = true;
|
|
1159
|
+
break;
|
|
1160
|
+
}
|
|
1095
1161
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1162
|
+
else {
|
|
1163
|
+
// this is a default fallback slot node
|
|
1164
|
+
// any element or text node (with content)
|
|
1165
|
+
// should hide the default fallback slot node
|
|
1166
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1167
|
+
(siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
|
|
1168
|
+
childNode.hidden = true;
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1105
1171
|
}
|
|
1106
1172
|
}
|
|
1107
1173
|
}
|
|
@@ -1111,45 +1177,67 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1111
1177
|
}
|
|
1112
1178
|
}
|
|
1113
1179
|
};
|
|
1180
|
+
/**
|
|
1181
|
+
* Component-global information about nodes which are either currently being
|
|
1182
|
+
* relocated or will be shortly.
|
|
1183
|
+
*/
|
|
1114
1184
|
const relocateNodes = [];
|
|
1115
|
-
|
|
1185
|
+
/**
|
|
1186
|
+
* Mark the contents of a slot for relocation via adding references to them to
|
|
1187
|
+
* the {@link relocateNodes} data structure. The actual work of relocating them
|
|
1188
|
+
* will then be handled in {@link renderVdom}.
|
|
1189
|
+
*
|
|
1190
|
+
* @param elm a render node whose child nodes need to be relocated
|
|
1191
|
+
*/
|
|
1192
|
+
const markSlotContentForRelocation = (elm) => {
|
|
1116
1193
|
// tslint:disable-next-line: prefer-const
|
|
1117
|
-
let childNode;
|
|
1118
1194
|
let node;
|
|
1119
1195
|
let hostContentNodes;
|
|
1120
|
-
let slotNameAttr;
|
|
1121
|
-
let relocateNodeData;
|
|
1122
1196
|
let j;
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
for (; i < ilen; i++) {
|
|
1127
|
-
childNode = childNodes[i];
|
|
1197
|
+
for (const childNode of elm.childNodes) {
|
|
1198
|
+
// we need to find child nodes which are slot references so we can then try
|
|
1199
|
+
// to match them up with nodes that need to be relocated
|
|
1128
1200
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
1129
|
-
// first
|
|
1130
|
-
//
|
|
1201
|
+
// first get the content reference comment node ('s-cr'), then we get
|
|
1202
|
+
// its parent, which is where all the host content is now
|
|
1131
1203
|
hostContentNodes = node.parentNode.childNodes;
|
|
1132
|
-
|
|
1204
|
+
const slotName = childNode['s-sn'];
|
|
1205
|
+
// iterate through all the nodes under the location where the host was
|
|
1206
|
+
// originally rendered
|
|
1133
1207
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1134
1208
|
node = hostContentNodes[j];
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1209
|
+
// check that the node is not a content reference node or a node
|
|
1210
|
+
// reference and then check that the host name does not match that of
|
|
1211
|
+
// childNode.
|
|
1212
|
+
// In addition, check that the slot either has not already been relocated, or
|
|
1213
|
+
// that its current location's host is not childNode's host. This is essentially
|
|
1214
|
+
// a check so that we don't try to relocate (and then hide) a node that is already
|
|
1215
|
+
// where it should be.
|
|
1216
|
+
if (!node['s-cn'] &&
|
|
1217
|
+
!node['s-nr'] &&
|
|
1218
|
+
node['s-hn'] !== childNode['s-hn'] &&
|
|
1219
|
+
(!BUILD.experimentalSlotFixes )) {
|
|
1220
|
+
// if `node` is located in the slot that `childNode` refers to (via the
|
|
1221
|
+
// `'s-sn'` property) then we need to relocate it from it's current spot
|
|
1222
|
+
// (under the host element parent) to the right slot location
|
|
1223
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1140
1224
|
// it's possible we've already decided to relocate this node
|
|
1141
|
-
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1225
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1142
1226
|
// made some changes to slots
|
|
1143
1227
|
// let's make sure we also double check
|
|
1144
1228
|
// fallbacks are correctly hidden or shown
|
|
1145
1229
|
checkSlotFallbackVisibility = true;
|
|
1146
|
-
|
|
1230
|
+
// ensure that the slot-name attr is correct
|
|
1231
|
+
node['s-sn'] = node['s-sn'] || slotName;
|
|
1147
1232
|
if (relocateNodeData) {
|
|
1148
|
-
|
|
1149
|
-
//
|
|
1233
|
+
relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
|
|
1234
|
+
// we marked this node for relocation previously but didn't find
|
|
1235
|
+
// out the slot reference node to which it needs to be relocated
|
|
1236
|
+
// so write it down now!
|
|
1150
1237
|
relocateNodeData.$slotRefNode$ = childNode;
|
|
1151
1238
|
}
|
|
1152
1239
|
else {
|
|
1240
|
+
node['s-sh'] = childNode['s-hn'];
|
|
1153
1241
|
// add to our list of nodes to relocate
|
|
1154
1242
|
relocateNodes.push({
|
|
1155
1243
|
$slotRefNode$: childNode,
|
|
@@ -1168,8 +1256,10 @@ const relocateSlotContent = (elm) => {
|
|
|
1168
1256
|
}
|
|
1169
1257
|
}
|
|
1170
1258
|
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1171
|
-
//
|
|
1172
|
-
//
|
|
1259
|
+
// the node is not found within the slot (`childNode`) that we're
|
|
1260
|
+
// currently looking at, so we stick it into `relocateNodes` to
|
|
1261
|
+
// handle later. If we never find a home for this element then
|
|
1262
|
+
// we'll need to hide it
|
|
1173
1263
|
relocateNodes.push({
|
|
1174
1264
|
$nodeToRelocate$: node,
|
|
1175
1265
|
});
|
|
@@ -1177,30 +1267,41 @@ const relocateSlotContent = (elm) => {
|
|
|
1177
1267
|
}
|
|
1178
1268
|
}
|
|
1179
1269
|
}
|
|
1270
|
+
// if we're dealing with any type of element (capable of itself being a
|
|
1271
|
+
// slot reference or containing one) then we recur
|
|
1180
1272
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1181
|
-
|
|
1273
|
+
markSlotContentForRelocation(childNode);
|
|
1182
1274
|
}
|
|
1183
1275
|
}
|
|
1184
1276
|
};
|
|
1185
|
-
|
|
1277
|
+
/**
|
|
1278
|
+
* Check whether a node is located in a given named slot.
|
|
1279
|
+
*
|
|
1280
|
+
* @param nodeToRelocate the node of interest
|
|
1281
|
+
* @param slotName the slot name to check
|
|
1282
|
+
* @returns whether the node is located in the slot or not
|
|
1283
|
+
*/
|
|
1284
|
+
const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1186
1285
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1187
|
-
if (nodeToRelocate.getAttribute('slot') === null &&
|
|
1286
|
+
if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
|
|
1287
|
+
// if the node doesn't have a slot attribute, and the slot we're checking
|
|
1288
|
+
// is not a named slot, then we assume the node should be within the slot
|
|
1188
1289
|
return true;
|
|
1189
1290
|
}
|
|
1190
|
-
if (nodeToRelocate.getAttribute('slot') ===
|
|
1291
|
+
if (nodeToRelocate.getAttribute('slot') === slotName) {
|
|
1191
1292
|
return true;
|
|
1192
1293
|
}
|
|
1193
1294
|
return false;
|
|
1194
1295
|
}
|
|
1195
|
-
if (nodeToRelocate['s-sn'] ===
|
|
1296
|
+
if (nodeToRelocate['s-sn'] === slotName) {
|
|
1196
1297
|
return true;
|
|
1197
1298
|
}
|
|
1198
|
-
return
|
|
1299
|
+
return slotName === '';
|
|
1199
1300
|
};
|
|
1200
1301
|
/**
|
|
1201
|
-
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1302
|
+
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
|
|
1303
|
+
* them with `null`. This signals that the DOM element corresponding to the VDom
|
|
1304
|
+
* node has been removed from the DOM.
|
|
1204
1305
|
*
|
|
1205
1306
|
* @param vNode a virtual DOM node
|
|
1206
1307
|
*/
|
|
@@ -1221,17 +1322,45 @@ const nullifyVNodeRefs = (vNode) => {
|
|
|
1221
1322
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1222
1323
|
* the DOM node into which it should be rendered.
|
|
1223
1324
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1325
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
1224
1326
|
*/
|
|
1225
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
1327
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1328
|
+
var _a, _b, _c, _d;
|
|
1226
1329
|
const hostElm = hostRef.$hostElement$;
|
|
1227
1330
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1228
1331
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1332
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
1333
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
1334
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
1335
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
1336
|
+
// contains attrs that need to be set on the host element.
|
|
1229
1337
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1230
1338
|
hostTagName = hostElm.tagName;
|
|
1231
1339
|
if (cmpMeta.$attrsToReflect$) {
|
|
1232
1340
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1233
1341
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1234
1342
|
}
|
|
1343
|
+
// On the first render and *only* on the first render we want to check for
|
|
1344
|
+
// any attributes set on the host element which are also set on the vdom
|
|
1345
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
1346
|
+
// the value from the host element, which allows developers building apps
|
|
1347
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
1348
|
+
// component even if it's already set on the `Host`.
|
|
1349
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1350
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1351
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
1352
|
+
// `class` which reconciles values coming from the VDom with values
|
|
1353
|
+
// already present on the DOM element, so we don't want to override those
|
|
1354
|
+
// attributes on the VDom tree with values from the host element if they
|
|
1355
|
+
// are present.
|
|
1356
|
+
//
|
|
1357
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
1358
|
+
// runtime and we don't want to override those either.
|
|
1359
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
1360
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1235
1364
|
rootVnode.$tag$ = null;
|
|
1236
1365
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1237
1366
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -1252,43 +1381,48 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1252
1381
|
// the disconnectCallback from working
|
|
1253
1382
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1254
1383
|
if (checkSlotRelocate) {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
let orgLocationNode;
|
|
1259
|
-
let parentNodeRef;
|
|
1260
|
-
let insertBeforeNode;
|
|
1261
|
-
let refNode;
|
|
1262
|
-
let i = 0;
|
|
1263
|
-
for (; i < relocateNodes.length; i++) {
|
|
1264
|
-
relocateData = relocateNodes[i];
|
|
1265
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1384
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1385
|
+
for (const relocateData of relocateNodes) {
|
|
1386
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1266
1387
|
if (!nodeToRelocate['s-ol']) {
|
|
1267
1388
|
// add a reference node marking this node's original location
|
|
1268
1389
|
// keep a reference to this node for later lookups
|
|
1269
|
-
orgLocationNode =
|
|
1270
|
-
doc.createTextNode('');
|
|
1390
|
+
const orgLocationNode = doc.createTextNode('');
|
|
1271
1391
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1272
1392
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1273
1393
|
}
|
|
1274
1394
|
}
|
|
1275
|
-
for (
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
if (
|
|
1279
|
-
|
|
1280
|
-
//
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1395
|
+
for (const relocateData of relocateNodes) {
|
|
1396
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1397
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1398
|
+
if (slotRefNode) {
|
|
1399
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1400
|
+
// When determining where to insert content, the most simple case would be
|
|
1401
|
+
// to relocate the node immediately following the slot reference node. We do this
|
|
1402
|
+
// by getting a reference to the node immediately following the slot reference node
|
|
1403
|
+
// since we will use `insertBefore` to manipulate the DOM.
|
|
1404
|
+
//
|
|
1405
|
+
// If there is no node immediately following the slot reference node, then we will just
|
|
1406
|
+
// end up appending the node as the last child of the parent.
|
|
1407
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1408
|
+
// If the node we're currently planning on inserting the new node before is an element,
|
|
1409
|
+
// we need to do some additional checks to make sure we're inserting the node in the correct order.
|
|
1410
|
+
// The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
|
|
1411
|
+
// to make sure they get inserted into their new how in the same order they were declared in their original location.
|
|
1412
|
+
//
|
|
1413
|
+
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
|
|
1414
|
+
{
|
|
1415
|
+
let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
1416
|
+
while (orgLocationNode) {
|
|
1417
|
+
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
1418
|
+
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1419
|
+
refNode = refNode.nextSibling;
|
|
1420
|
+
if (!refNode || !refNode['s-nr']) {
|
|
1421
|
+
insertBeforeNode = refNode;
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1291
1424
|
}
|
|
1425
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1292
1426
|
}
|
|
1293
1427
|
}
|
|
1294
1428
|
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
@@ -1298,17 +1432,32 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1298
1432
|
// has a different next sibling or parent relocated
|
|
1299
1433
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1300
1434
|
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
1301
|
-
// probably a component in the index.html that doesn't have
|
|
1435
|
+
// probably a component in the index.html that doesn't have its hostname set
|
|
1302
1436
|
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1303
1437
|
}
|
|
1304
|
-
//
|
|
1438
|
+
// Add it back to the dom but in its new home
|
|
1439
|
+
// If we get to this point and `insertBeforeNode` is `null`, that means
|
|
1440
|
+
// we're just going to append the node as the last child of the parent. Passing
|
|
1441
|
+
// `null` as the second arg here will trigger that behavior.
|
|
1305
1442
|
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
1443
|
+
// Reset the `hidden` value back to what it was defined as originally
|
|
1444
|
+
// This solves a problem where a `slot` is dynamically rendered and `hidden` may have
|
|
1445
|
+
// been set on content originally, but now it has a slot to go to so it should have
|
|
1446
|
+
// the value it was defined as having in the DOM, not what we overrode it to.
|
|
1447
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1448
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
|
|
1449
|
+
}
|
|
1306
1450
|
}
|
|
1307
1451
|
}
|
|
1308
1452
|
}
|
|
1309
1453
|
else {
|
|
1310
1454
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1311
1455
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1456
|
+
// Store the initial value of `hidden` so we can reset it later when
|
|
1457
|
+
// moving nodes around.
|
|
1458
|
+
if (isInitialLoad) {
|
|
1459
|
+
nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
|
|
1460
|
+
}
|
|
1312
1461
|
nodeToRelocate.hidden = true;
|
|
1313
1462
|
}
|
|
1314
1463
|
}
|
|
@@ -1429,6 +1578,16 @@ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.th
|
|
|
1429
1578
|
*/
|
|
1430
1579
|
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
1431
1580
|
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
1581
|
+
/**
|
|
1582
|
+
* Update a component given reference to its host elements and so on.
|
|
1583
|
+
*
|
|
1584
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1585
|
+
* VDom nodes, and other metadata
|
|
1586
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1587
|
+
* rendered
|
|
1588
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1589
|
+
* the first render cycle
|
|
1590
|
+
*/
|
|
1432
1591
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1433
1592
|
var _a;
|
|
1434
1593
|
const elm = hostRef.$hostElement$;
|
|
@@ -1440,7 +1599,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1440
1599
|
}
|
|
1441
1600
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1442
1601
|
{
|
|
1443
|
-
callRender(hostRef, instance);
|
|
1602
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1444
1603
|
}
|
|
1445
1604
|
if (rc) {
|
|
1446
1605
|
// ok, so turns out there are some child host elements
|
|
@@ -1464,8 +1623,24 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1464
1623
|
}
|
|
1465
1624
|
}
|
|
1466
1625
|
};
|
|
1467
|
-
|
|
1626
|
+
/**
|
|
1627
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
1628
|
+
* various build variables
|
|
1629
|
+
*
|
|
1630
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1631
|
+
* VDom nodes, and other metadata
|
|
1632
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1633
|
+
* rendered
|
|
1634
|
+
* @param elm the Host element for the component
|
|
1635
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1636
|
+
* @returns an empty promise
|
|
1637
|
+
*/
|
|
1638
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1468
1639
|
try {
|
|
1640
|
+
/**
|
|
1641
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
1642
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
1643
|
+
*/
|
|
1469
1644
|
instance = instance.render && instance.render();
|
|
1470
1645
|
{
|
|
1471
1646
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1479,7 +1654,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1479
1654
|
// or we need to update the css class/attrs on the host element
|
|
1480
1655
|
// DOM WRITE!
|
|
1481
1656
|
{
|
|
1482
|
-
renderVdom(hostRef, instance);
|
|
1657
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
1483
1658
|
}
|
|
1484
1659
|
}
|
|
1485
1660
|
}
|
|
@@ -1560,6 +1735,16 @@ const appDidLoad = (who) => {
|
|
|
1560
1735
|
}
|
|
1561
1736
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1562
1737
|
};
|
|
1738
|
+
/**
|
|
1739
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1740
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1741
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1742
|
+
* output bundle and this function returns `undefined`.
|
|
1743
|
+
* @param instance any object that may or may not contain methods
|
|
1744
|
+
* @param method method name
|
|
1745
|
+
* @param arg single arbitrary argument
|
|
1746
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1747
|
+
*/
|
|
1563
1748
|
const safeCall = (instance, method, arg) => {
|
|
1564
1749
|
if (instance && instance[method]) {
|
|
1565
1750
|
try {
|
|
@@ -1627,13 +1812,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1627
1812
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1628
1813
|
*/
|
|
1629
1814
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1815
|
+
var _a;
|
|
1816
|
+
const prototype = Cstr.prototype;
|
|
1630
1817
|
if (cmpMeta.$members$) {
|
|
1631
1818
|
if (Cstr.watchers) {
|
|
1632
1819
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1633
1820
|
}
|
|
1634
1821
|
// It's better to have a const than two Object.entries()
|
|
1635
1822
|
const members = Object.entries(cmpMeta.$members$);
|
|
1636
|
-
const prototype = Cstr.prototype;
|
|
1637
1823
|
members.map(([memberName, [memberFlags]]) => {
|
|
1638
1824
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1639
1825
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1656,16 +1842,18 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1656
1842
|
// proxyComponent - method
|
|
1657
1843
|
Object.defineProperty(prototype, memberName, {
|
|
1658
1844
|
value(...args) {
|
|
1845
|
+
var _a;
|
|
1659
1846
|
const ref = getHostRef(this);
|
|
1660
|
-
return ref.$onInstancePromise
|
|
1847
|
+
return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
|
|
1661
1848
|
},
|
|
1662
1849
|
});
|
|
1663
1850
|
}
|
|
1664
1851
|
});
|
|
1665
1852
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1666
1853
|
const attrNameToPropName = new Map();
|
|
1667
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
1854
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1668
1855
|
plt.jmp(() => {
|
|
1856
|
+
var _a;
|
|
1669
1857
|
const propName = attrNameToPropName.get(attrName);
|
|
1670
1858
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1671
1859
|
// in the case where an attribute was set inline.
|
|
@@ -1687,12 +1875,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1687
1875
|
// customElements.define('my-component', MyComponent);
|
|
1688
1876
|
// </script>
|
|
1689
1877
|
// ```
|
|
1690
|
-
// In this case if we do not
|
|
1878
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1691
1879
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1692
1880
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1693
|
-
// the connectedCallback attempts to
|
|
1881
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1694
1882
|
//
|
|
1695
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1883
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1696
1884
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1697
1885
|
//
|
|
1698
1886
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1712,26 +1900,67 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1712
1900
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1713
1901
|
return;
|
|
1714
1902
|
}
|
|
1903
|
+
else if (propName == null) {
|
|
1904
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
1905
|
+
// on a vanilla web component
|
|
1906
|
+
const hostRef = getHostRef(this);
|
|
1907
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
1908
|
+
// We only want to trigger the callback(s) if:
|
|
1909
|
+
// 1. The instance is ready
|
|
1910
|
+
// 2. The watchers are ready
|
|
1911
|
+
// 3. The value has changed
|
|
1912
|
+
if (flags &&
|
|
1913
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1914
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1915
|
+
newValue !== oldValue) {
|
|
1916
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1917
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1918
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1919
|
+
if (instance[callbackName] != null) {
|
|
1920
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1715
1926
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1716
1927
|
});
|
|
1717
1928
|
};
|
|
1718
|
-
//
|
|
1719
|
-
//
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1929
|
+
// Create an array of attributes to observe
|
|
1930
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1931
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1932
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1933
|
+
// an invalid attribute.
|
|
1934
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1935
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1936
|
+
...members
|
|
1937
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1938
|
+
.map(([propName, m]) => {
|
|
1939
|
+
var _a;
|
|
1940
|
+
const attrName = m[1] || propName;
|
|
1941
|
+
attrNameToPropName.set(attrName, propName);
|
|
1942
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1943
|
+
(_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
|
|
1944
|
+
}
|
|
1945
|
+
return attrName;
|
|
1946
|
+
}),
|
|
1947
|
+
]));
|
|
1730
1948
|
}
|
|
1731
1949
|
}
|
|
1732
1950
|
return Cstr;
|
|
1733
1951
|
};
|
|
1734
|
-
|
|
1952
|
+
/**
|
|
1953
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
1954
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
1955
|
+
* and (optionally) an HMR version ID.
|
|
1956
|
+
*
|
|
1957
|
+
* @param elm a host element
|
|
1958
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
1959
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
1960
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
1961
|
+
*/
|
|
1962
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1963
|
+
let Cstr;
|
|
1735
1964
|
// initializeComponent
|
|
1736
1965
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1737
1966
|
// Let the runtime know that the component has been initialized
|
|
@@ -1809,6 +2038,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1809
2038
|
schedule();
|
|
1810
2039
|
}
|
|
1811
2040
|
};
|
|
2041
|
+
const fireConnectedCallback = (instance) => {
|
|
2042
|
+
};
|
|
1812
2043
|
const connectedCallback = (elm) => {
|
|
1813
2044
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1814
2045
|
const hostRef = getHostRef(elm);
|
|
@@ -1822,7 +2053,7 @@ const connectedCallback = (elm) => {
|
|
|
1822
2053
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1823
2054
|
// in here to act as original content anchors as we move nodes around
|
|
1824
2055
|
// host element has been connected to the DOM
|
|
1825
|
-
if ((// TODO(STENCIL-
|
|
2056
|
+
if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1826
2057
|
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1827
2058
|
setContentReference(elm);
|
|
1828
2059
|
}
|
|
@@ -1862,6 +2093,11 @@ const connectedCallback = (elm) => {
|
|
|
1862
2093
|
// reattach any event listeners to the host
|
|
1863
2094
|
// since they would have been removed when disconnected
|
|
1864
2095
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
2096
|
+
// fire off connectedCallback() on component instance
|
|
2097
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2098
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2099
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
2100
|
+
}
|
|
1865
2101
|
}
|
|
1866
2102
|
endConnected();
|
|
1867
2103
|
}
|
|
@@ -1877,7 +2113,9 @@ const setContentReference = (elm) => {
|
|
|
1877
2113
|
contentRefElm['s-cn'] = true;
|
|
1878
2114
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1879
2115
|
};
|
|
1880
|
-
const
|
|
2116
|
+
const disconnectInstance = (instance) => {
|
|
2117
|
+
};
|
|
2118
|
+
const disconnectedCallback = async (elm) => {
|
|
1881
2119
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1882
2120
|
const hostRef = getHostRef(elm);
|
|
1883
2121
|
{
|
|
@@ -1886,6 +2124,10 @@ const disconnectedCallback = (elm) => {
|
|
|
1886
2124
|
hostRef.$rmListeners$ = undefined;
|
|
1887
2125
|
}
|
|
1888
2126
|
}
|
|
2127
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2128
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2129
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
2130
|
+
}
|
|
1889
2131
|
}
|
|
1890
2132
|
};
|
|
1891
2133
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -1896,20 +2138,27 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1896
2138
|
const customElements = win.customElements;
|
|
1897
2139
|
const head = doc.head;
|
|
1898
2140
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1899
|
-
const
|
|
2141
|
+
const dataStyles = /*@__PURE__*/ doc.createElement('style');
|
|
1900
2142
|
const deferredConnectedCallbacks = [];
|
|
1901
2143
|
let appLoadFallback;
|
|
1902
2144
|
let isBootstrapping = true;
|
|
1903
2145
|
Object.assign(plt, options);
|
|
1904
2146
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
2147
|
+
let hasSlotRelocation = false;
|
|
1905
2148
|
lazyBundles.map((lazyBundle) => {
|
|
1906
2149
|
lazyBundle[1].map((compactMeta) => {
|
|
2150
|
+
var _a;
|
|
1907
2151
|
const cmpMeta = {
|
|
1908
2152
|
$flags$: compactMeta[0],
|
|
1909
2153
|
$tagName$: compactMeta[1],
|
|
1910
2154
|
$members$: compactMeta[2],
|
|
1911
2155
|
$listeners$: compactMeta[3],
|
|
1912
2156
|
};
|
|
2157
|
+
// Check if we are using slots outside the shadow DOM in this component.
|
|
2158
|
+
// We'll use this information later to add styles for `slot-fb` elements
|
|
2159
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
2160
|
+
hasSlotRelocation = true;
|
|
2161
|
+
}
|
|
1913
2162
|
{
|
|
1914
2163
|
cmpMeta.$members$ = compactMeta[2];
|
|
1915
2164
|
}
|
|
@@ -1920,7 +2169,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1920
2169
|
cmpMeta.$attrsToReflect$ = [];
|
|
1921
2170
|
}
|
|
1922
2171
|
{
|
|
1923
|
-
cmpMeta.$watchers$ = {};
|
|
2172
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
1924
2173
|
}
|
|
1925
2174
|
const tagName = cmpMeta.$tagName$;
|
|
1926
2175
|
const HostElement = class extends HTMLElement {
|
|
@@ -1972,15 +2221,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1972
2221
|
}
|
|
1973
2222
|
});
|
|
1974
2223
|
});
|
|
2224
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
2225
|
+
if (hasSlotRelocation) {
|
|
2226
|
+
dataStyles.innerHTML += SLOT_FB_CSS;
|
|
2227
|
+
}
|
|
2228
|
+
// Add hydration styles
|
|
1975
2229
|
{
|
|
1976
|
-
|
|
1977
|
-
|
|
2230
|
+
dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
|
|
2231
|
+
}
|
|
2232
|
+
// If we have styles, add them to the DOM
|
|
2233
|
+
if (dataStyles.innerHTML.length) {
|
|
2234
|
+
dataStyles.setAttribute('data-styles', '');
|
|
1978
2235
|
// Apply CSP nonce to the style tag if it exists
|
|
1979
2236
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1980
2237
|
if (nonce != null) {
|
|
1981
|
-
|
|
2238
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
1982
2239
|
}
|
|
1983
|
-
|
|
2240
|
+
// Insert the styles into the document head
|
|
2241
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
2242
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1984
2243
|
}
|
|
1985
2244
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1986
2245
|
isBootstrapping = false;
|
|
@@ -2038,13 +2297,40 @@ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !==
|
|
|
2038
2297
|
* @returns void
|
|
2039
2298
|
*/
|
|
2040
2299
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
2300
|
+
/**
|
|
2301
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
2302
|
+
* instances.
|
|
2303
|
+
*/
|
|
2041
2304
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
2305
|
+
/**
|
|
2306
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
2307
|
+
*
|
|
2308
|
+
* @param ref the runtime ref of interest
|
|
2309
|
+
* @returns the Host reference (if found) or undefined
|
|
2310
|
+
*/
|
|
2042
2311
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
2312
|
+
/**
|
|
2313
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
2314
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
2315
|
+
*
|
|
2316
|
+
* @param lazyInstance the lazy instance of interest
|
|
2317
|
+
* @param hostRef that instances `HostRef` object
|
|
2318
|
+
* @returns a reference to the host ref WeakMap
|
|
2319
|
+
*/
|
|
2043
2320
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
2044
|
-
|
|
2321
|
+
/**
|
|
2322
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
2323
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
2324
|
+
* metadata.
|
|
2325
|
+
*
|
|
2326
|
+
* @param hostElement the host element to register
|
|
2327
|
+
* @param cmpMeta runtime metadata for that component
|
|
2328
|
+
* @returns a reference to the host ref WeakMap
|
|
2329
|
+
*/
|
|
2330
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
2045
2331
|
const hostRef = {
|
|
2046
2332
|
$flags$: 0,
|
|
2047
|
-
$hostElement$:
|
|
2333
|
+
$hostElement$: hostElement,
|
|
2048
2334
|
$cmpMeta$: cmpMeta,
|
|
2049
2335
|
$instanceValues$: new Map(),
|
|
2050
2336
|
};
|
|
@@ -2053,11 +2339,11 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
2053
2339
|
}
|
|
2054
2340
|
{
|
|
2055
2341
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
2056
|
-
|
|
2057
|
-
|
|
2342
|
+
hostElement['s-p'] = [];
|
|
2343
|
+
hostElement['s-rc'] = [];
|
|
2058
2344
|
}
|
|
2059
|
-
addHostEventListeners(
|
|
2060
|
-
return hostRefs.set(
|
|
2345
|
+
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
|
|
2346
|
+
return hostRefs.set(hostElement, hostRef);
|
|
2061
2347
|
};
|
|
2062
2348
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
2063
2349
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -2145,7 +2431,7 @@ const flush = () => {
|
|
|
2145
2431
|
}
|
|
2146
2432
|
}
|
|
2147
2433
|
};
|
|
2148
|
-
const nextTick =
|
|
2434
|
+
const nextTick = (cb) => promiseResolve().then(cb);
|
|
2149
2435
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2150
2436
|
|
|
2151
2437
|
exports.Host = Host;
|