@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'ripple';
|
|
2
|
+
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 };
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -31,6 +32,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
35
|
+
/**
|
|
36
|
+
* Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
|
|
37
|
+
*
|
|
38
|
+
* Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
|
|
39
|
+
* support as of Stencil v4.
|
|
40
|
+
*/
|
|
41
|
+
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
34
42
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
35
43
|
/**
|
|
36
44
|
* Default style mode id
|
|
@@ -111,13 +119,13 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
111
119
|
};
|
|
112
120
|
walk(children);
|
|
113
121
|
if (vnodeData) {
|
|
114
|
-
// normalize class / classname attributes
|
|
115
122
|
if (vnodeData.key) {
|
|
116
123
|
key = vnodeData.key;
|
|
117
124
|
}
|
|
118
125
|
if (vnodeData.name) {
|
|
119
126
|
slotName = vnodeData.name;
|
|
120
127
|
}
|
|
128
|
+
// normalize class / className attributes
|
|
121
129
|
{
|
|
122
130
|
const classData = vnodeData.className || vnodeData.class;
|
|
123
131
|
if (classData) {
|
|
@@ -268,9 +276,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
268
276
|
}
|
|
269
277
|
styles.set(scopeId, style);
|
|
270
278
|
};
|
|
271
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
279
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
272
280
|
var _a;
|
|
273
|
-
|
|
281
|
+
const scopeId = getScopeId(cmpMeta);
|
|
274
282
|
const style = styles.get(scopeId);
|
|
275
283
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
276
284
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -285,11 +293,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
285
293
|
}
|
|
286
294
|
if (!appliedStyles.has(scopeId)) {
|
|
287
295
|
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
styleElm = doc.createElement('style');
|
|
291
|
-
styleElm.innerHTML = style;
|
|
292
|
-
}
|
|
296
|
+
styleElm = doc.createElement('style');
|
|
297
|
+
styleElm.innerHTML = style;
|
|
293
298
|
// Apply CSP nonce to the style tag if it exists
|
|
294
299
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
295
300
|
if (nonce != null) {
|
|
@@ -297,6 +302,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
297
302
|
}
|
|
298
303
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
299
304
|
}
|
|
305
|
+
// Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
|
|
306
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
307
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
308
|
+
}
|
|
300
309
|
if (appliedStyles) {
|
|
301
310
|
appliedStyles.add(scopeId);
|
|
302
311
|
}
|
|
@@ -314,7 +323,6 @@ const attachStyles = (hostRef) => {
|
|
|
314
323
|
const flags = cmpMeta.$flags$;
|
|
315
324
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
316
325
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
317
|
-
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
|
318
326
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
319
327
|
// only required when we're NOT using native shadow dom (slot)
|
|
320
328
|
// or this browser doesn't support native shadow dom
|
|
@@ -337,6 +345,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
337
345
|
*
|
|
338
346
|
* Modified for Stencil's compiler and vdom
|
|
339
347
|
*/
|
|
348
|
+
/**
|
|
349
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
350
|
+
* corresponding HTML element.
|
|
351
|
+
*
|
|
352
|
+
* Note that this function has special functionality for the `class`,
|
|
353
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
354
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
355
|
+
*
|
|
356
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
357
|
+
* @param memberName the name of the attribute to set
|
|
358
|
+
* @param oldValue the old value for the attribute
|
|
359
|
+
* @param newValue the new value for the attribute
|
|
360
|
+
* @param isSvg whether we're in an svg context or not
|
|
361
|
+
* @param flags bitflags for Vdom variables
|
|
362
|
+
*/
|
|
340
363
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
341
364
|
if (oldValue !== newValue) {
|
|
342
365
|
let isProp = isMemberInElement(elm, memberName);
|
|
@@ -413,11 +436,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
413
436
|
// except for the first character, we keep the event name case
|
|
414
437
|
memberName = ln[2] + memberName.slice(3);
|
|
415
438
|
}
|
|
416
|
-
if (oldValue) {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
439
|
+
if (oldValue || newValue) {
|
|
440
|
+
// Need to account for "capture" events.
|
|
441
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
442
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
443
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
444
|
+
// Make sure we only replace the last instance of "Capture"
|
|
445
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
446
|
+
if (oldValue) {
|
|
447
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
448
|
+
}
|
|
449
|
+
if (newValue) {
|
|
450
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
451
|
+
}
|
|
421
452
|
}
|
|
422
453
|
}
|
|
423
454
|
else {
|
|
@@ -439,7 +470,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
439
470
|
elm[memberName] = newValue;
|
|
440
471
|
}
|
|
441
472
|
}
|
|
442
|
-
catch (e) {
|
|
473
|
+
catch (e) {
|
|
474
|
+
/**
|
|
475
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
476
|
+
*/
|
|
477
|
+
}
|
|
443
478
|
}
|
|
444
479
|
/**
|
|
445
480
|
* Need to manually update attribute if:
|
|
@@ -478,7 +513,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
478
513
|
}
|
|
479
514
|
};
|
|
480
515
|
const parseClassListRegex = /\s/;
|
|
516
|
+
/**
|
|
517
|
+
* Parsed a string of classnames into an array
|
|
518
|
+
* @param value className string, e.g. "foo bar baz"
|
|
519
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
520
|
+
*/
|
|
481
521
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
522
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
523
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
482
524
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
483
525
|
// if the element passed in is a shadow root, which is a document fragment
|
|
484
526
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
@@ -512,6 +554,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
512
554
|
* @returns the newly created node
|
|
513
555
|
*/
|
|
514
556
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
557
|
+
var _a;
|
|
515
558
|
// tslint:disable-next-line: prefer-const
|
|
516
559
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
517
560
|
let i = 0;
|
|
@@ -585,11 +628,15 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
585
628
|
}
|
|
586
629
|
}
|
|
587
630
|
}
|
|
631
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
632
|
+
// to another component but don't end up in a slot
|
|
633
|
+
elm['s-hn'] = hostTagName;
|
|
588
634
|
{
|
|
589
|
-
elm['s-hn'] = hostTagName;
|
|
590
635
|
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
591
636
|
// remember the content reference comment
|
|
592
637
|
elm['s-sr'] = true;
|
|
638
|
+
// Persist the name of the slot that this slot was going to be projected into.
|
|
639
|
+
elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
|
|
593
640
|
// remember the content reference comment
|
|
594
641
|
elm['s-cr'] = contentRef;
|
|
595
642
|
// remember the slot name, or empty string for default slot
|
|
@@ -597,30 +644,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
597
644
|
// check if we've got an old vnode for this slot
|
|
598
645
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
599
646
|
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
647
|
+
{
|
|
648
|
+
// we've got an old slot vnode and the wrapper is being replaced
|
|
649
|
+
// so let's move the old slot content back to its original location
|
|
650
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
651
|
+
}
|
|
603
652
|
}
|
|
604
653
|
}
|
|
605
654
|
}
|
|
606
655
|
return elm;
|
|
607
656
|
};
|
|
608
657
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
658
|
+
var _a;
|
|
609
659
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
610
660
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
611
661
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
612
662
|
const childNode = oldSlotChildNodes[i];
|
|
613
663
|
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
614
|
-
// // this child node in the old element is from another component
|
|
615
|
-
// // remove this node from the old slot's parent
|
|
616
|
-
// childNode.remove();
|
|
617
664
|
// and relocate it back to it's original location
|
|
618
665
|
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
619
666
|
// remove the old original location comment entirely
|
|
620
667
|
// later on the patch function will know what to do
|
|
621
|
-
// and move this to the correct spot
|
|
668
|
+
// and move this to the correct spot if need be
|
|
622
669
|
childNode['s-ol'].remove();
|
|
623
670
|
childNode['s-ol'] = undefined;
|
|
671
|
+
// Reset so we can correctly move the node around again.
|
|
672
|
+
childNode['s-sh'] = undefined;
|
|
673
|
+
// When putting an element node back in its original location,
|
|
674
|
+
// we need to reset the `slot` attribute back to the value it originally had
|
|
675
|
+
// so we can correctly relocate it again in the future
|
|
676
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
677
|
+
childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
|
|
678
|
+
}
|
|
624
679
|
checkSlotRelocate = true;
|
|
625
680
|
}
|
|
626
681
|
if (recursive) {
|
|
@@ -1044,42 +1099,53 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1044
1099
|
elm.data = text;
|
|
1045
1100
|
}
|
|
1046
1101
|
};
|
|
1102
|
+
/**
|
|
1103
|
+
* Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
|
|
1104
|
+
* are slot fallbacks nodes.
|
|
1105
|
+
*
|
|
1106
|
+
* A slot fallback node should be visible by default. Then, it should be
|
|
1107
|
+
* conditionally hidden if:
|
|
1108
|
+
*
|
|
1109
|
+
* - it has a sibling with a `slot` property set to its slot name or if
|
|
1110
|
+
* - it is a default fallback slot node, in which case we hide if it has any
|
|
1111
|
+
* content
|
|
1112
|
+
*
|
|
1113
|
+
* @param elm the element of interest
|
|
1114
|
+
*/
|
|
1047
1115
|
const updateFallbackSlotVisibility = (elm) => {
|
|
1048
|
-
// tslint:disable-next-line: prefer-const
|
|
1049
1116
|
const childNodes = elm.childNodes;
|
|
1050
|
-
|
|
1051
|
-
let i;
|
|
1052
|
-
let ilen;
|
|
1053
|
-
let j;
|
|
1054
|
-
let slotNameAttr;
|
|
1055
|
-
let nodeType;
|
|
1056
|
-
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
1057
|
-
childNode = childNodes[i];
|
|
1117
|
+
for (const childNode of childNodes) {
|
|
1058
1118
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1059
1119
|
if (childNode['s-sr']) {
|
|
1060
1120
|
// this is a slot fallback node
|
|
1061
1121
|
// get the slot name for this slot reference node
|
|
1062
|
-
|
|
1122
|
+
const slotName = childNode['s-sn'];
|
|
1063
1123
|
// by default always show a fallback slot node
|
|
1064
1124
|
// then hide it if there are other slots in the light dom
|
|
1065
1125
|
childNode.hidden = false;
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1126
|
+
// we need to check all of its sibling nodes in order to see if
|
|
1127
|
+
// `childNode` should be hidden
|
|
1128
|
+
for (const siblingNode of childNodes) {
|
|
1129
|
+
// Don't check the node against itself
|
|
1130
|
+
if (siblingNode !== childNode) {
|
|
1131
|
+
if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
|
|
1132
|
+
// this sibling node is from a different component OR is a named
|
|
1133
|
+
// fallback slot node
|
|
1134
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
1135
|
+
(slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
|
|
1136
|
+
childNode.hidden = true;
|
|
1137
|
+
break;
|
|
1138
|
+
}
|
|
1073
1139
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1140
|
+
else {
|
|
1141
|
+
// this is a default fallback slot node
|
|
1142
|
+
// any element or text node (with content)
|
|
1143
|
+
// should hide the default fallback slot node
|
|
1144
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1145
|
+
(siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
|
|
1146
|
+
childNode.hidden = true;
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1083
1149
|
}
|
|
1084
1150
|
}
|
|
1085
1151
|
}
|
|
@@ -1089,45 +1155,67 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
1089
1155
|
}
|
|
1090
1156
|
}
|
|
1091
1157
|
};
|
|
1158
|
+
/**
|
|
1159
|
+
* Component-global information about nodes which are either currently being
|
|
1160
|
+
* relocated or will be shortly.
|
|
1161
|
+
*/
|
|
1092
1162
|
const relocateNodes = [];
|
|
1093
|
-
|
|
1163
|
+
/**
|
|
1164
|
+
* Mark the contents of a slot for relocation via adding references to them to
|
|
1165
|
+
* the {@link relocateNodes} data structure. The actual work of relocating them
|
|
1166
|
+
* will then be handled in {@link renderVdom}.
|
|
1167
|
+
*
|
|
1168
|
+
* @param elm a render node whose child nodes need to be relocated
|
|
1169
|
+
*/
|
|
1170
|
+
const markSlotContentForRelocation = (elm) => {
|
|
1094
1171
|
// tslint:disable-next-line: prefer-const
|
|
1095
|
-
let childNode;
|
|
1096
1172
|
let node;
|
|
1097
1173
|
let hostContentNodes;
|
|
1098
|
-
let slotNameAttr;
|
|
1099
|
-
let relocateNodeData;
|
|
1100
1174
|
let j;
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
for (; i < ilen; i++) {
|
|
1105
|
-
childNode = childNodes[i];
|
|
1175
|
+
for (const childNode of elm.childNodes) {
|
|
1176
|
+
// we need to find child nodes which are slot references so we can then try
|
|
1177
|
+
// to match them up with nodes that need to be relocated
|
|
1106
1178
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
1107
|
-
// first
|
|
1108
|
-
//
|
|
1179
|
+
// first get the content reference comment node ('s-cr'), then we get
|
|
1180
|
+
// its parent, which is where all the host content is now
|
|
1109
1181
|
hostContentNodes = node.parentNode.childNodes;
|
|
1110
|
-
|
|
1182
|
+
const slotName = childNode['s-sn'];
|
|
1183
|
+
// iterate through all the nodes under the location where the host was
|
|
1184
|
+
// originally rendered
|
|
1111
1185
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1112
1186
|
node = hostContentNodes[j];
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1187
|
+
// check that the node is not a content reference node or a node
|
|
1188
|
+
// reference and then check that the host name does not match that of
|
|
1189
|
+
// childNode.
|
|
1190
|
+
// In addition, check that the slot either has not already been relocated, or
|
|
1191
|
+
// that its current location's host is not childNode's host. This is essentially
|
|
1192
|
+
// a check so that we don't try to relocate (and then hide) a node that is already
|
|
1193
|
+
// where it should be.
|
|
1194
|
+
if (!node['s-cn'] &&
|
|
1195
|
+
!node['s-nr'] &&
|
|
1196
|
+
node['s-hn'] !== childNode['s-hn'] &&
|
|
1197
|
+
(!BUILD.experimentalSlotFixes )) {
|
|
1198
|
+
// if `node` is located in the slot that `childNode` refers to (via the
|
|
1199
|
+
// `'s-sn'` property) then we need to relocate it from it's current spot
|
|
1200
|
+
// (under the host element parent) to the right slot location
|
|
1201
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1118
1202
|
// it's possible we've already decided to relocate this node
|
|
1119
|
-
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1203
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1120
1204
|
// made some changes to slots
|
|
1121
1205
|
// let's make sure we also double check
|
|
1122
1206
|
// fallbacks are correctly hidden or shown
|
|
1123
1207
|
checkSlotFallbackVisibility = true;
|
|
1124
|
-
|
|
1208
|
+
// ensure that the slot-name attr is correct
|
|
1209
|
+
node['s-sn'] = node['s-sn'] || slotName;
|
|
1125
1210
|
if (relocateNodeData) {
|
|
1126
|
-
|
|
1127
|
-
//
|
|
1211
|
+
relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
|
|
1212
|
+
// we marked this node for relocation previously but didn't find
|
|
1213
|
+
// out the slot reference node to which it needs to be relocated
|
|
1214
|
+
// so write it down now!
|
|
1128
1215
|
relocateNodeData.$slotRefNode$ = childNode;
|
|
1129
1216
|
}
|
|
1130
1217
|
else {
|
|
1218
|
+
node['s-sh'] = childNode['s-hn'];
|
|
1131
1219
|
// add to our list of nodes to relocate
|
|
1132
1220
|
relocateNodes.push({
|
|
1133
1221
|
$slotRefNode$: childNode,
|
|
@@ -1146,8 +1234,10 @@ const relocateSlotContent = (elm) => {
|
|
|
1146
1234
|
}
|
|
1147
1235
|
}
|
|
1148
1236
|
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1149
|
-
//
|
|
1150
|
-
//
|
|
1237
|
+
// the node is not found within the slot (`childNode`) that we're
|
|
1238
|
+
// currently looking at, so we stick it into `relocateNodes` to
|
|
1239
|
+
// handle later. If we never find a home for this element then
|
|
1240
|
+
// we'll need to hide it
|
|
1151
1241
|
relocateNodes.push({
|
|
1152
1242
|
$nodeToRelocate$: node,
|
|
1153
1243
|
});
|
|
@@ -1155,30 +1245,41 @@ const relocateSlotContent = (elm) => {
|
|
|
1155
1245
|
}
|
|
1156
1246
|
}
|
|
1157
1247
|
}
|
|
1248
|
+
// if we're dealing with any type of element (capable of itself being a
|
|
1249
|
+
// slot reference or containing one) then we recur
|
|
1158
1250
|
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1159
|
-
|
|
1251
|
+
markSlotContentForRelocation(childNode);
|
|
1160
1252
|
}
|
|
1161
1253
|
}
|
|
1162
1254
|
};
|
|
1163
|
-
|
|
1255
|
+
/**
|
|
1256
|
+
* Check whether a node is located in a given named slot.
|
|
1257
|
+
*
|
|
1258
|
+
* @param nodeToRelocate the node of interest
|
|
1259
|
+
* @param slotName the slot name to check
|
|
1260
|
+
* @returns whether the node is located in the slot or not
|
|
1261
|
+
*/
|
|
1262
|
+
const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1164
1263
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1165
|
-
if (nodeToRelocate.getAttribute('slot') === null &&
|
|
1264
|
+
if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
|
|
1265
|
+
// if the node doesn't have a slot attribute, and the slot we're checking
|
|
1266
|
+
// is not a named slot, then we assume the node should be within the slot
|
|
1166
1267
|
return true;
|
|
1167
1268
|
}
|
|
1168
|
-
if (nodeToRelocate.getAttribute('slot') ===
|
|
1269
|
+
if (nodeToRelocate.getAttribute('slot') === slotName) {
|
|
1169
1270
|
return true;
|
|
1170
1271
|
}
|
|
1171
1272
|
return false;
|
|
1172
1273
|
}
|
|
1173
|
-
if (nodeToRelocate['s-sn'] ===
|
|
1274
|
+
if (nodeToRelocate['s-sn'] === slotName) {
|
|
1174
1275
|
return true;
|
|
1175
1276
|
}
|
|
1176
|
-
return
|
|
1277
|
+
return slotName === '';
|
|
1177
1278
|
};
|
|
1178
1279
|
/**
|
|
1179
|
-
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1280
|
+
* 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
|
|
1281
|
+
* them with `null`. This signals that the DOM element corresponding to the VDom
|
|
1282
|
+
* node has been removed from the DOM.
|
|
1182
1283
|
*
|
|
1183
1284
|
* @param vNode a virtual DOM node
|
|
1184
1285
|
*/
|
|
@@ -1199,17 +1300,45 @@ const nullifyVNodeRefs = (vNode) => {
|
|
|
1199
1300
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
1200
1301
|
* the DOM node into which it should be rendered.
|
|
1201
1302
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
1303
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
1202
1304
|
*/
|
|
1203
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
1305
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1306
|
+
var _a, _b, _c, _d;
|
|
1204
1307
|
const hostElm = hostRef.$hostElement$;
|
|
1205
1308
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1206
1309
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1310
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
1311
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
1312
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
1313
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
1314
|
+
// contains attrs that need to be set on the host element.
|
|
1207
1315
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1208
1316
|
hostTagName = hostElm.tagName;
|
|
1209
1317
|
if (cmpMeta.$attrsToReflect$) {
|
|
1210
1318
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1211
1319
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1212
1320
|
}
|
|
1321
|
+
// On the first render and *only* on the first render we want to check for
|
|
1322
|
+
// any attributes set on the host element which are also set on the vdom
|
|
1323
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
1324
|
+
// the value from the host element, which allows developers building apps
|
|
1325
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
1326
|
+
// component even if it's already set on the `Host`.
|
|
1327
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1328
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1329
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
1330
|
+
// `class` which reconciles values coming from the VDom with values
|
|
1331
|
+
// already present on the DOM element, so we don't want to override those
|
|
1332
|
+
// attributes on the VDom tree with values from the host element if they
|
|
1333
|
+
// are present.
|
|
1334
|
+
//
|
|
1335
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
1336
|
+
// runtime and we don't want to override those either.
|
|
1337
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
1338
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1213
1342
|
rootVnode.$tag$ = null;
|
|
1214
1343
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1215
1344
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -1230,43 +1359,48 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1230
1359
|
// the disconnectCallback from working
|
|
1231
1360
|
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1232
1361
|
if (checkSlotRelocate) {
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
let orgLocationNode;
|
|
1237
|
-
let parentNodeRef;
|
|
1238
|
-
let insertBeforeNode;
|
|
1239
|
-
let refNode;
|
|
1240
|
-
let i = 0;
|
|
1241
|
-
for (; i < relocateNodes.length; i++) {
|
|
1242
|
-
relocateData = relocateNodes[i];
|
|
1243
|
-
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1362
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1363
|
+
for (const relocateData of relocateNodes) {
|
|
1364
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1244
1365
|
if (!nodeToRelocate['s-ol']) {
|
|
1245
1366
|
// add a reference node marking this node's original location
|
|
1246
1367
|
// keep a reference to this node for later lookups
|
|
1247
|
-
orgLocationNode =
|
|
1248
|
-
doc.createTextNode('');
|
|
1368
|
+
const orgLocationNode = doc.createTextNode('');
|
|
1249
1369
|
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1250
1370
|
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1251
1371
|
}
|
|
1252
1372
|
}
|
|
1253
|
-
for (
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
if (
|
|
1257
|
-
|
|
1258
|
-
//
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1373
|
+
for (const relocateData of relocateNodes) {
|
|
1374
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1375
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1376
|
+
if (slotRefNode) {
|
|
1377
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1378
|
+
// When determining where to insert content, the most simple case would be
|
|
1379
|
+
// to relocate the node immediately following the slot reference node. We do this
|
|
1380
|
+
// by getting a reference to the node immediately following the slot reference node
|
|
1381
|
+
// since we will use `insertBefore` to manipulate the DOM.
|
|
1382
|
+
//
|
|
1383
|
+
// If there is no node immediately following the slot reference node, then we will just
|
|
1384
|
+
// end up appending the node as the last child of the parent.
|
|
1385
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1386
|
+
// If the node we're currently planning on inserting the new node before is an element,
|
|
1387
|
+
// we need to do some additional checks to make sure we're inserting the node in the correct order.
|
|
1388
|
+
// The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
|
|
1389
|
+
// to make sure they get inserted into their new how in the same order they were declared in their original location.
|
|
1390
|
+
//
|
|
1391
|
+
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
|
|
1392
|
+
{
|
|
1393
|
+
let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
1394
|
+
while (orgLocationNode) {
|
|
1395
|
+
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
1396
|
+
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1397
|
+
refNode = refNode.nextSibling;
|
|
1398
|
+
if (!refNode || !refNode['s-nr']) {
|
|
1399
|
+
insertBeforeNode = refNode;
|
|
1400
|
+
break;
|
|
1401
|
+
}
|
|
1269
1402
|
}
|
|
1403
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1270
1404
|
}
|
|
1271
1405
|
}
|
|
1272
1406
|
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
@@ -1276,17 +1410,32 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1276
1410
|
// has a different next sibling or parent relocated
|
|
1277
1411
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1278
1412
|
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
1279
|
-
// probably a component in the index.html that doesn't have
|
|
1413
|
+
// probably a component in the index.html that doesn't have its hostname set
|
|
1280
1414
|
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1281
1415
|
}
|
|
1282
|
-
//
|
|
1416
|
+
// Add it back to the dom but in its new home
|
|
1417
|
+
// If we get to this point and `insertBeforeNode` is `null`, that means
|
|
1418
|
+
// we're just going to append the node as the last child of the parent. Passing
|
|
1419
|
+
// `null` as the second arg here will trigger that behavior.
|
|
1283
1420
|
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
1421
|
+
// Reset the `hidden` value back to what it was defined as originally
|
|
1422
|
+
// This solves a problem where a `slot` is dynamically rendered and `hidden` may have
|
|
1423
|
+
// been set on content originally, but now it has a slot to go to so it should have
|
|
1424
|
+
// the value it was defined as having in the DOM, not what we overrode it to.
|
|
1425
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1426
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
|
|
1427
|
+
}
|
|
1284
1428
|
}
|
|
1285
1429
|
}
|
|
1286
1430
|
}
|
|
1287
1431
|
else {
|
|
1288
1432
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1289
1433
|
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1434
|
+
// Store the initial value of `hidden` so we can reset it later when
|
|
1435
|
+
// moving nodes around.
|
|
1436
|
+
if (isInitialLoad) {
|
|
1437
|
+
nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
|
|
1438
|
+
}
|
|
1290
1439
|
nodeToRelocate.hidden = true;
|
|
1291
1440
|
}
|
|
1292
1441
|
}
|
|
@@ -1407,6 +1556,16 @@ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.th
|
|
|
1407
1556
|
*/
|
|
1408
1557
|
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
1409
1558
|
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
1559
|
+
/**
|
|
1560
|
+
* Update a component given reference to its host elements and so on.
|
|
1561
|
+
*
|
|
1562
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1563
|
+
* VDom nodes, and other metadata
|
|
1564
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1565
|
+
* rendered
|
|
1566
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1567
|
+
* the first render cycle
|
|
1568
|
+
*/
|
|
1410
1569
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1411
1570
|
var _a;
|
|
1412
1571
|
const elm = hostRef.$hostElement$;
|
|
@@ -1418,7 +1577,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1418
1577
|
}
|
|
1419
1578
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1420
1579
|
{
|
|
1421
|
-
callRender(hostRef, instance);
|
|
1580
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1422
1581
|
}
|
|
1423
1582
|
if (rc) {
|
|
1424
1583
|
// ok, so turns out there are some child host elements
|
|
@@ -1442,8 +1601,24 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1442
1601
|
}
|
|
1443
1602
|
}
|
|
1444
1603
|
};
|
|
1445
|
-
|
|
1604
|
+
/**
|
|
1605
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
1606
|
+
* various build variables
|
|
1607
|
+
*
|
|
1608
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1609
|
+
* VDom nodes, and other metadata
|
|
1610
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1611
|
+
* rendered
|
|
1612
|
+
* @param elm the Host element for the component
|
|
1613
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1614
|
+
* @returns an empty promise
|
|
1615
|
+
*/
|
|
1616
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1446
1617
|
try {
|
|
1618
|
+
/**
|
|
1619
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
1620
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
1621
|
+
*/
|
|
1447
1622
|
instance = instance.render && instance.render();
|
|
1448
1623
|
{
|
|
1449
1624
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1457,7 +1632,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1457
1632
|
// or we need to update the css class/attrs on the host element
|
|
1458
1633
|
// DOM WRITE!
|
|
1459
1634
|
{
|
|
1460
|
-
renderVdom(hostRef, instance);
|
|
1635
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
1461
1636
|
}
|
|
1462
1637
|
}
|
|
1463
1638
|
}
|
|
@@ -1538,6 +1713,16 @@ const appDidLoad = (who) => {
|
|
|
1538
1713
|
}
|
|
1539
1714
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1540
1715
|
};
|
|
1716
|
+
/**
|
|
1717
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1718
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1719
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1720
|
+
* output bundle and this function returns `undefined`.
|
|
1721
|
+
* @param instance any object that may or may not contain methods
|
|
1722
|
+
* @param method method name
|
|
1723
|
+
* @param arg single arbitrary argument
|
|
1724
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1725
|
+
*/
|
|
1541
1726
|
const safeCall = (instance, method, arg) => {
|
|
1542
1727
|
if (instance && instance[method]) {
|
|
1543
1728
|
try {
|
|
@@ -1605,13 +1790,14 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1605
1790
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1606
1791
|
*/
|
|
1607
1792
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1793
|
+
var _a;
|
|
1794
|
+
const prototype = Cstr.prototype;
|
|
1608
1795
|
if (cmpMeta.$members$) {
|
|
1609
1796
|
if (Cstr.watchers) {
|
|
1610
1797
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1611
1798
|
}
|
|
1612
1799
|
// It's better to have a const than two Object.entries()
|
|
1613
1800
|
const members = Object.entries(cmpMeta.$members$);
|
|
1614
|
-
const prototype = Cstr.prototype;
|
|
1615
1801
|
members.map(([memberName, [memberFlags]]) => {
|
|
1616
1802
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1617
1803
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1634,16 +1820,18 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1634
1820
|
// proxyComponent - method
|
|
1635
1821
|
Object.defineProperty(prototype, memberName, {
|
|
1636
1822
|
value(...args) {
|
|
1823
|
+
var _a;
|
|
1637
1824
|
const ref = getHostRef(this);
|
|
1638
|
-
return ref.$onInstancePromise
|
|
1825
|
+
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); });
|
|
1639
1826
|
},
|
|
1640
1827
|
});
|
|
1641
1828
|
}
|
|
1642
1829
|
});
|
|
1643
1830
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1644
1831
|
const attrNameToPropName = new Map();
|
|
1645
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
1832
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1646
1833
|
plt.jmp(() => {
|
|
1834
|
+
var _a;
|
|
1647
1835
|
const propName = attrNameToPropName.get(attrName);
|
|
1648
1836
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1649
1837
|
// in the case where an attribute was set inline.
|
|
@@ -1665,12 +1853,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1665
1853
|
// customElements.define('my-component', MyComponent);
|
|
1666
1854
|
// </script>
|
|
1667
1855
|
// ```
|
|
1668
|
-
// In this case if we do not
|
|
1856
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1669
1857
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1670
1858
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1671
|
-
// the connectedCallback attempts to
|
|
1859
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1672
1860
|
//
|
|
1673
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1861
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1674
1862
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1675
1863
|
//
|
|
1676
1864
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1690,26 +1878,67 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1690
1878
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1691
1879
|
return;
|
|
1692
1880
|
}
|
|
1881
|
+
else if (propName == null) {
|
|
1882
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
1883
|
+
// on a vanilla web component
|
|
1884
|
+
const hostRef = getHostRef(this);
|
|
1885
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
1886
|
+
// We only want to trigger the callback(s) if:
|
|
1887
|
+
// 1. The instance is ready
|
|
1888
|
+
// 2. The watchers are ready
|
|
1889
|
+
// 3. The value has changed
|
|
1890
|
+
if (flags &&
|
|
1891
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1892
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1893
|
+
newValue !== oldValue) {
|
|
1894
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1895
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1896
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1897
|
+
if (instance[callbackName] != null) {
|
|
1898
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1693
1904
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1694
1905
|
});
|
|
1695
1906
|
};
|
|
1696
|
-
//
|
|
1697
|
-
//
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1907
|
+
// Create an array of attributes to observe
|
|
1908
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1909
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1910
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1911
|
+
// an invalid attribute.
|
|
1912
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1913
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1914
|
+
...members
|
|
1915
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1916
|
+
.map(([propName, m]) => {
|
|
1917
|
+
var _a;
|
|
1918
|
+
const attrName = m[1] || propName;
|
|
1919
|
+
attrNameToPropName.set(attrName, propName);
|
|
1920
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1921
|
+
(_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
|
|
1922
|
+
}
|
|
1923
|
+
return attrName;
|
|
1924
|
+
}),
|
|
1925
|
+
]));
|
|
1708
1926
|
}
|
|
1709
1927
|
}
|
|
1710
1928
|
return Cstr;
|
|
1711
1929
|
};
|
|
1712
|
-
|
|
1930
|
+
/**
|
|
1931
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
1932
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
1933
|
+
* and (optionally) an HMR version ID.
|
|
1934
|
+
*
|
|
1935
|
+
* @param elm a host element
|
|
1936
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
1937
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
1938
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
1939
|
+
*/
|
|
1940
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1941
|
+
let Cstr;
|
|
1713
1942
|
// initializeComponent
|
|
1714
1943
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1715
1944
|
// Let the runtime know that the component has been initialized
|
|
@@ -1787,6 +2016,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1787
2016
|
schedule();
|
|
1788
2017
|
}
|
|
1789
2018
|
};
|
|
2019
|
+
const fireConnectedCallback = (instance) => {
|
|
2020
|
+
};
|
|
1790
2021
|
const connectedCallback = (elm) => {
|
|
1791
2022
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1792
2023
|
const hostRef = getHostRef(elm);
|
|
@@ -1800,7 +2031,7 @@ const connectedCallback = (elm) => {
|
|
|
1800
2031
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1801
2032
|
// in here to act as original content anchors as we move nodes around
|
|
1802
2033
|
// host element has been connected to the DOM
|
|
1803
|
-
if ((// TODO(STENCIL-
|
|
2034
|
+
if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1804
2035
|
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1805
2036
|
setContentReference(elm);
|
|
1806
2037
|
}
|
|
@@ -1840,6 +2071,11 @@ const connectedCallback = (elm) => {
|
|
|
1840
2071
|
// reattach any event listeners to the host
|
|
1841
2072
|
// since they would have been removed when disconnected
|
|
1842
2073
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
2074
|
+
// fire off connectedCallback() on component instance
|
|
2075
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2076
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2077
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
2078
|
+
}
|
|
1843
2079
|
}
|
|
1844
2080
|
endConnected();
|
|
1845
2081
|
}
|
|
@@ -1855,7 +2091,9 @@ const setContentReference = (elm) => {
|
|
|
1855
2091
|
contentRefElm['s-cn'] = true;
|
|
1856
2092
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1857
2093
|
};
|
|
1858
|
-
const
|
|
2094
|
+
const disconnectInstance = (instance) => {
|
|
2095
|
+
};
|
|
2096
|
+
const disconnectedCallback = async (elm) => {
|
|
1859
2097
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1860
2098
|
const hostRef = getHostRef(elm);
|
|
1861
2099
|
{
|
|
@@ -1864,6 +2102,10 @@ const disconnectedCallback = (elm) => {
|
|
|
1864
2102
|
hostRef.$rmListeners$ = undefined;
|
|
1865
2103
|
}
|
|
1866
2104
|
}
|
|
2105
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
2106
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
2107
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
2108
|
+
}
|
|
1867
2109
|
}
|
|
1868
2110
|
};
|
|
1869
2111
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -1874,20 +2116,27 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1874
2116
|
const customElements = win.customElements;
|
|
1875
2117
|
const head = doc.head;
|
|
1876
2118
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
|
1877
|
-
const
|
|
2119
|
+
const dataStyles = /*@__PURE__*/ doc.createElement('style');
|
|
1878
2120
|
const deferredConnectedCallbacks = [];
|
|
1879
2121
|
let appLoadFallback;
|
|
1880
2122
|
let isBootstrapping = true;
|
|
1881
2123
|
Object.assign(plt, options);
|
|
1882
2124
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
2125
|
+
let hasSlotRelocation = false;
|
|
1883
2126
|
lazyBundles.map((lazyBundle) => {
|
|
1884
2127
|
lazyBundle[1].map((compactMeta) => {
|
|
2128
|
+
var _a;
|
|
1885
2129
|
const cmpMeta = {
|
|
1886
2130
|
$flags$: compactMeta[0],
|
|
1887
2131
|
$tagName$: compactMeta[1],
|
|
1888
2132
|
$members$: compactMeta[2],
|
|
1889
2133
|
$listeners$: compactMeta[3],
|
|
1890
2134
|
};
|
|
2135
|
+
// Check if we are using slots outside the shadow DOM in this component.
|
|
2136
|
+
// We'll use this information later to add styles for `slot-fb` elements
|
|
2137
|
+
if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
|
|
2138
|
+
hasSlotRelocation = true;
|
|
2139
|
+
}
|
|
1891
2140
|
{
|
|
1892
2141
|
cmpMeta.$members$ = compactMeta[2];
|
|
1893
2142
|
}
|
|
@@ -1898,7 +2147,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1898
2147
|
cmpMeta.$attrsToReflect$ = [];
|
|
1899
2148
|
}
|
|
1900
2149
|
{
|
|
1901
|
-
cmpMeta.$watchers$ = {};
|
|
2150
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
1902
2151
|
}
|
|
1903
2152
|
const tagName = cmpMeta.$tagName$;
|
|
1904
2153
|
const HostElement = class extends HTMLElement {
|
|
@@ -1950,15 +2199,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1950
2199
|
}
|
|
1951
2200
|
});
|
|
1952
2201
|
});
|
|
2202
|
+
// Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
|
|
2203
|
+
if (hasSlotRelocation) {
|
|
2204
|
+
dataStyles.innerHTML += SLOT_FB_CSS;
|
|
2205
|
+
}
|
|
2206
|
+
// Add hydration styles
|
|
1953
2207
|
{
|
|
1954
|
-
|
|
1955
|
-
|
|
2208
|
+
dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
|
|
2209
|
+
}
|
|
2210
|
+
// If we have styles, add them to the DOM
|
|
2211
|
+
if (dataStyles.innerHTML.length) {
|
|
2212
|
+
dataStyles.setAttribute('data-styles', '');
|
|
1956
2213
|
// Apply CSP nonce to the style tag if it exists
|
|
1957
2214
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1958
2215
|
if (nonce != null) {
|
|
1959
|
-
|
|
2216
|
+
dataStyles.setAttribute('nonce', nonce);
|
|
1960
2217
|
}
|
|
1961
|
-
|
|
2218
|
+
// Insert the styles into the document head
|
|
2219
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
2220
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1962
2221
|
}
|
|
1963
2222
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1964
2223
|
isBootstrapping = false;
|
|
@@ -2016,13 +2275,40 @@ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !==
|
|
|
2016
2275
|
* @returns void
|
|
2017
2276
|
*/
|
|
2018
2277
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
2278
|
+
/**
|
|
2279
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
2280
|
+
* instances.
|
|
2281
|
+
*/
|
|
2019
2282
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
2283
|
+
/**
|
|
2284
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
2285
|
+
*
|
|
2286
|
+
* @param ref the runtime ref of interest
|
|
2287
|
+
* @returns the Host reference (if found) or undefined
|
|
2288
|
+
*/
|
|
2020
2289
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
2290
|
+
/**
|
|
2291
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
2292
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
2293
|
+
*
|
|
2294
|
+
* @param lazyInstance the lazy instance of interest
|
|
2295
|
+
* @param hostRef that instances `HostRef` object
|
|
2296
|
+
* @returns a reference to the host ref WeakMap
|
|
2297
|
+
*/
|
|
2021
2298
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
2022
|
-
|
|
2299
|
+
/**
|
|
2300
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
2301
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
2302
|
+
* metadata.
|
|
2303
|
+
*
|
|
2304
|
+
* @param hostElement the host element to register
|
|
2305
|
+
* @param cmpMeta runtime metadata for that component
|
|
2306
|
+
* @returns a reference to the host ref WeakMap
|
|
2307
|
+
*/
|
|
2308
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
2023
2309
|
const hostRef = {
|
|
2024
2310
|
$flags$: 0,
|
|
2025
|
-
$hostElement$:
|
|
2311
|
+
$hostElement$: hostElement,
|
|
2026
2312
|
$cmpMeta$: cmpMeta,
|
|
2027
2313
|
$instanceValues$: new Map(),
|
|
2028
2314
|
};
|
|
@@ -2031,11 +2317,11 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
2031
2317
|
}
|
|
2032
2318
|
{
|
|
2033
2319
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
2034
|
-
|
|
2035
|
-
|
|
2320
|
+
hostElement['s-p'] = [];
|
|
2321
|
+
hostElement['s-rc'] = [];
|
|
2036
2322
|
}
|
|
2037
|
-
addHostEventListeners(
|
|
2038
|
-
return hostRefs.set(
|
|
2323
|
+
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
|
|
2324
|
+
return hostRefs.set(hostElement, hostRef);
|
|
2039
2325
|
};
|
|
2040
2326
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
2041
2327
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -2123,7 +2409,7 @@ const flush = () => {
|
|
|
2123
2409
|
}
|
|
2124
2410
|
}
|
|
2125
2411
|
};
|
|
2126
|
-
const nextTick =
|
|
2412
|
+
const nextTick = (cb) => promiseResolve().then(cb);
|
|
2127
2413
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
2128
2414
|
|
|
2129
2415
|
export { Host as H, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|