@watermarkinsights/ripple 3.8.0-1 → 3.8.0-4
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/README.md +3 -3
- package/dist/cjs/{functions-f0693632.js → functions-1f0edc61.js} +534 -483
- package/dist/cjs/{global-6c69dece.js → global-80d74e31.js} +65 -65
- package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
- package/dist/cjs/{index-cd179539.js → index-0e7e3668.js} +96 -64
- package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/priv-chart-popover.cjs.entry.js +79 -79
- package/dist/cjs/priv-datepicker.cjs.entry.js +674 -674
- package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
- package/dist/cjs/priv-navigator-item.cjs.entry.js +24 -24
- package/dist/cjs/ripple.cjs.js +4 -4
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +342 -342
- package/dist/cjs/wm-button.cjs.entry.js +228 -238
- package/dist/cjs/wm-chart-slice.cjs.entry.js +14 -14
- package/dist/cjs/wm-chart.cjs.entry.js +475 -475
- package/dist/cjs/wm-datepicker.cjs.entry.js +273 -273
- package/dist/cjs/wm-input.cjs.entry.js +136 -136
- package/dist/cjs/wm-modal-footer.cjs.entry.js +32 -32
- package/dist/cjs/wm-modal-header.cjs.entry.js +35 -35
- package/dist/cjs/wm-modal.cjs.entry.js +164 -164
- package/dist/cjs/wm-navigation_3.cjs.entry.js +239 -0
- package/dist/cjs/wm-navigator.cjs.entry.js +269 -269
- package/dist/cjs/wm-network-uploader.cjs.entry.js +422 -422
- package/dist/cjs/wm-option_2.cjs.entry.js +497 -497
- package/dist/cjs/wm-pagination.cjs.entry.js +168 -168
- package/dist/cjs/wm-search.cjs.entry.js +233 -233
- package/dist/cjs/wm-snackbar.cjs.entry.js +172 -172
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +297 -297
- package/dist/cjs/wm-tag-input.cjs.entry.js +581 -581
- package/dist/cjs/wm-timepicker.cjs.entry.js +385 -385
- package/dist/cjs/wm-toggletip.cjs.entry.js +126 -126
- package/dist/cjs/wm-uploader.cjs.entry.js +348 -348
- package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +12 -2
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +0 -1
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
- package/dist/collection/components/wm-button/wm-button.css +1 -3
- package/dist/collection/components/wm-button/wm-button.js +491 -503
- package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +0 -1
- package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -232
- package/dist/collection/components/wm-chart/wm-chart-slice.js +115 -115
- package/dist/collection/components/wm-chart/wm-chart.css +0 -1
- package/dist/collection/components/wm-chart/wm-chart.js +718 -718
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +3 -5
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1039 -1039
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -3
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +483 -483
- package/dist/collection/components/wm-input/wm-input.css +1 -3
- package/dist/collection/components/wm-input/wm-input.js +423 -423
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
- package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
- package/dist/collection/components/wm-modal/wm-modal-header.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
- package/dist/collection/components/wm-modal/wm-modal.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal.js +461 -461
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +87 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +152 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +85 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +105 -0
- package/dist/collection/components/wm-navigation/wm-navigation.css +122 -0
- package/dist/collection/components/wm-navigation/wm-navigation.js +193 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -1
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
- package/dist/collection/components/wm-navigator/wm-navigator.css +0 -1
- package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
- package/dist/collection/components/wm-option/wm-option.css +2 -4
- package/dist/collection/components/wm-option/wm-option.js +422 -422
- package/dist/collection/components/wm-pagination/wm-pagination.css +0 -1
- package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
- package/dist/collection/components/wm-search/wm-search.css +0 -1
- package/dist/collection/components/wm-search/wm-search.js +480 -480
- package/dist/collection/components/wm-select/wm-select.css +2 -4
- package/dist/collection/components/wm-select/wm-select.js +720 -720
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +2 -4
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +0 -1
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +216 -216
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -1
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +330 -330
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -1
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +2 -4
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +2 -4
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +1 -3
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +1 -3
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -753
- package/dist/collection/components/wm-uploader/wm-uploader.css +1 -3
- package/dist/collection/components/wm-uploader/wm-uploader.js +748 -748
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -27
- package/dist/collection/dev/scripts.js +20 -20
- package/dist/collection/global/__mocks__/functions.js +6 -6
- package/dist/collection/global/functions.js +468 -445
- package/dist/collection/global/global.js +72 -72
- package/dist/collection/global/interfaces.js +49 -49
- package/dist/collection/global/services/__mocks__/http-service.js +130 -130
- package/dist/collection/global/services/http-service.js +50 -50
- package/dist/collection/lang/lang.js +5 -5
- package/dist/collection/lang/missing.js +39 -39
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/{functions-cbfc81d1.js → functions-b130b95f.js} +533 -484
- package/dist/esm/{global-738cd49c.js → global-22a1aa43.js} +65 -65
- package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
- package/dist/esm/{index-66f8130e.js → index-cd8f9ae2.js} +96 -64
- package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
- package/dist/esm/loader.js +4 -4
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-chart-popover.entry.js +79 -79
- package/dist/esm/priv-datepicker.entry.js +674 -674
- package/dist/esm/priv-navigator-button.entry.js +19 -19
- package/dist/esm/priv-navigator-item.entry.js +24 -24
- package/dist/esm/ripple.js +4 -4
- package/dist/esm/wm-action-menu_2.entry.js +342 -342
- package/dist/esm/wm-button.entry.js +228 -238
- package/dist/esm/wm-chart-slice.entry.js +14 -14
- package/dist/esm/wm-chart.entry.js +475 -475
- package/dist/esm/wm-datepicker.entry.js +273 -273
- package/dist/esm/wm-input.entry.js +136 -136
- package/dist/esm/wm-modal-footer.entry.js +32 -32
- package/dist/esm/wm-modal-header.entry.js +35 -35
- package/dist/esm/wm-modal.entry.js +164 -164
- package/dist/esm/wm-navigation_3.entry.js +233 -0
- package/dist/esm/wm-navigator.entry.js +269 -269
- package/dist/esm/wm-network-uploader.entry.js +422 -422
- package/dist/esm/wm-option_2.entry.js +497 -497
- package/dist/esm/wm-pagination.entry.js +168 -168
- package/dist/esm/wm-search.entry.js +233 -233
- package/dist/esm/wm-snackbar.entry.js +172 -172
- package/dist/esm/wm-tab-item_3.entry.js +297 -297
- package/dist/esm/wm-tag-input.entry.js +581 -581
- package/dist/esm/wm-timepicker.entry.js +385 -385
- package/dist/esm/wm-toggletip.entry.js +126 -126
- package/dist/esm/wm-uploader.entry.js +348 -348
- package/dist/esm/wm-wrapper.entry.js +13 -13
- package/dist/esm-es5/functions-b130b95f.js +15 -0
- package/dist/esm-es5/{global-738cd49c.js → global-22a1aa43.js} +1 -1
- package/dist/esm-es5/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +1 -1
- package/dist/esm-es5/index-cd8f9ae2.js +1 -0
- package/dist/esm-es5/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +0 -0
- 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-input.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 -0
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-network-uploader.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-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-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 +0 -1
- package/dist/ripple/{p-6bc37009.system.entry.js → p-040262af.system.entry.js} +1 -1
- package/dist/ripple/{p-b840acea.system.entry.js → p-08987f25.system.entry.js} +1 -1
- package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
- package/dist/ripple/p-08f8a387.system.js +15 -0
- package/dist/ripple/p-11e94b56.system.entry.js +1 -0
- package/dist/ripple/{p-5ef0d011.system.entry.js → p-12bd075c.system.entry.js} +1 -1
- package/dist/ripple/p-16b81b95.system.entry.js +1 -0
- package/dist/ripple/p-1aa63d75.entry.js +1 -0
- package/dist/ripple/p-1bc95574.system.entry.js +1 -0
- package/dist/ripple/p-20856a2d.system.js +1 -0
- package/dist/ripple/p-244877c8.entry.js +1 -0
- package/dist/ripple/{p-b2ccbff3.system.js → p-26d5f144.system.js} +1 -1
- package/dist/ripple/p-28c23453.system.entry.js +1 -0
- package/dist/ripple/p-313b6073.system.js +1 -0
- package/dist/ripple/p-38062c39.js +1 -0
- package/dist/ripple/p-3ba3afca.entry.js +1 -0
- package/dist/ripple/p-3faf2b4d.entry.js +1 -0
- package/dist/ripple/p-4372e470.entry.js +1 -0
- package/dist/ripple/{p-8d97d1d5.system.entry.js → p-450d329a.system.entry.js} +1 -1
- package/dist/ripple/p-4be373bc.entry.js +1 -0
- package/dist/ripple/{p-7bc744bf.system.entry.js → p-504579c2.system.entry.js} +1 -1
- package/dist/ripple/p-5345ef2c.entry.js +1 -0
- package/dist/ripple/p-5866f8c0.entry.js +1 -0
- package/dist/ripple/p-64176f58.entry.js +1 -0
- package/dist/ripple/p-6aa11b0c.system.entry.js +1 -0
- package/dist/ripple/{p-366a3db1.system.entry.js → p-6b8753b3.system.entry.js} +1 -1
- package/dist/ripple/p-6c1a8429.system.entry.js +1 -0
- package/dist/ripple/{p-90aebfd6.system.entry.js → p-6eed4845.system.entry.js} +1 -1
- package/dist/ripple/p-764fa608.entry.js +1 -0
- package/dist/ripple/p-7e118839.entry.js +1 -0
- package/dist/ripple/p-880d231c.system.js +1 -0
- package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
- package/dist/ripple/p-8a0450fd.entry.js +1 -0
- package/dist/ripple/p-8dd28361.entry.js +1 -0
- package/dist/ripple/p-91e122c6.entry.js +1 -0
- package/dist/ripple/p-97909b0f.entry.js +1 -0
- package/dist/ripple/{p-2d49a016.system.entry.js → p-9a9743f5.system.entry.js} +1 -1
- package/dist/ripple/{p-b3ce2033.system.entry.js → p-a5177480.system.entry.js} +1 -1
- package/dist/ripple/p-a6cc08a5.system.entry.js +1 -0
- package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
- package/dist/ripple/p-a8584619.system.entry.js +1 -0
- package/dist/ripple/p-a9dd6fe1.entry.js +1 -0
- package/dist/ripple/p-add208d8.entry.js +1 -0
- package/dist/ripple/p-b3568fc3.system.entry.js +1 -0
- package/dist/ripple/p-b635fdfe.system.entry.js +1 -0
- package/dist/ripple/p-bfef8d9c.entry.js +1 -0
- package/dist/ripple/p-c0fd9e19.system.entry.js +1 -0
- package/dist/ripple/{p-261ea633.system.entry.js → p-c19298a5.system.entry.js} +1 -1
- package/dist/ripple/p-ce80b46d.entry.js +1 -0
- package/dist/ripple/p-d0ab4cf2.entry.js +1 -0
- package/dist/ripple/p-d0d3421d.system.entry.js +1 -0
- package/dist/ripple/p-d43a4e01.entry.js +1 -0
- package/dist/ripple/p-d4e46468.entry.js +1 -0
- package/dist/ripple/{p-85d12cf2.system.entry.js → p-db4f099c.system.entry.js} +1 -1
- package/dist/ripple/p-ddf5044a.entry.js +1 -0
- package/dist/ripple/{p-da78496a.entry.js → p-e03a7b17.entry.js} +1 -1
- package/dist/ripple/{p-11400c80.js → p-e2398de1.js} +1 -1
- package/dist/ripple/{p-7a9aac92.system.entry.js → p-e758db14.system.entry.js} +1 -1
- package/dist/ripple/p-ea22b946.js +16 -0
- package/dist/ripple/p-eb63bbcb.system.entry.js +1 -0
- package/dist/ripple/p-ef344252.entry.js +1 -0
- package/dist/ripple/p-f44803ff.system.entry.js +1 -0
- package/dist/ripple/p-fa35e47b.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +48 -48
- package/dist/types/components/wm-button/wm-button.d.ts +43 -44
- package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -23
- package/dist/types/components/wm-chart/wm-chart-slice.d.ts +11 -11
- package/dist/types/components/wm-chart/wm-chart.d.ts +82 -82
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +42 -42
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -15
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -12
- package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +20 -0
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +11 -0
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +28 -0
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
- package/dist/types/components/wm-option/wm-option.d.ts +32 -32
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
- package/dist/types/components/wm-search/wm-search.d.ts +86 -86
- package/dist/types/components/wm-select/wm-select.d.ts +66 -66
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -92
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
- package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +80 -80
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
- package/dist/types/components.d.ts +76 -24
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/functions.d.ts +42 -40
- package/dist/types/global/global.d.ts +1 -1
- package/dist/types/global/interfaces.d.ts +34 -34
- package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
- package/dist/types/global/services/http-service.d.ts +4 -4
- package/dist/types/lang/lang.d.ts +5 -5
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/package.json +47 -47
- package/dist/esm-es5/functions-cbfc81d1.js +0 -15
- package/dist/esm-es5/index-66f8130e.js +0 -1
- package/dist/ripple/p-0418abd7.system.js +0 -15
- package/dist/ripple/p-065e2ca1.entry.js +0 -1
- package/dist/ripple/p-06627dcf.entry.js +0 -1
- package/dist/ripple/p-08b2262e.system.entry.js +0 -1
- package/dist/ripple/p-09432004.system.entry.js +0 -1
- package/dist/ripple/p-0c58f50d.entry.js +0 -1
- package/dist/ripple/p-0d8bd4ee.entry.js +0 -1
- package/dist/ripple/p-111f705a.entry.js +0 -1
- package/dist/ripple/p-1d899a2d.system.entry.js +0 -1
- package/dist/ripple/p-252e91de.entry.js +0 -1
- package/dist/ripple/p-2cdfb4cc.entry.js +0 -1
- package/dist/ripple/p-2f91e2a6.entry.js +0 -1
- package/dist/ripple/p-39cba5b2.entry.js +0 -1
- package/dist/ripple/p-3e1dd662.entry.js +0 -1
- package/dist/ripple/p-3fb41fe3.system.entry.js +0 -1
- package/dist/ripple/p-5a528af7.entry.js +0 -1
- package/dist/ripple/p-5ad7afc0.entry.js +0 -1
- package/dist/ripple/p-5bd3aa5a.system.entry.js +0 -1
- package/dist/ripple/p-67fcdd5d.entry.js +0 -1
- package/dist/ripple/p-6b4374e3.system.entry.js +0 -1
- package/dist/ripple/p-8afdc986.entry.js +0 -1
- package/dist/ripple/p-8b0eb05e.entry.js +0 -1
- package/dist/ripple/p-8c4c086d.system.js +0 -1
- package/dist/ripple/p-8f05bc58.system.entry.js +0 -1
- package/dist/ripple/p-9276c5e4.entry.js +0 -1
- package/dist/ripple/p-92b6bc97.system.entry.js +0 -1
- package/dist/ripple/p-99548d58.system.js +0 -1
- package/dist/ripple/p-99db8501.entry.js +0 -1
- package/dist/ripple/p-9baa3039.js +0 -1
- package/dist/ripple/p-9d02957d.system.js +0 -1
- package/dist/ripple/p-ae4e95ce.system.entry.js +0 -1
- package/dist/ripple/p-b4e9a8e3.entry.js +0 -1
- package/dist/ripple/p-b5edcf38.js +0 -16
- package/dist/ripple/p-b626f3b9.system.entry.js +0 -1
- package/dist/ripple/p-c3a9a5da.system.entry.js +0 -1
- package/dist/ripple/p-c730ce74.entry.js +0 -1
- package/dist/ripple/p-d0643c9b.entry.js +0 -1
- package/dist/ripple/p-dc196bc2.entry.js +0 -1
- package/dist/ripple/p-deae1a7a.entry.js +0 -1
- package/dist/ripple/p-e06b8ab3.system.entry.js +0 -1
- package/dist/ripple/p-e3bab713.entry.js +0 -1
- package/dist/ripple/p-eed76888.system.entry.js +0 -1
- package/dist/ripple/p-ff5ec153.entry.js +0 -1
|
@@ -3880,11 +3880,17 @@ function icuUnitToEcma(unit) {
|
|
|
3880
3880
|
return unit.replace(/^(.*?)-/, '');
|
|
3881
3881
|
}
|
|
3882
3882
|
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3883
|
-
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
3883
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
3884
3884
|
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3885
3885
|
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
3886
3886
|
function parseSignificantPrecision(str) {
|
|
3887
3887
|
var result = {};
|
|
3888
|
+
if (str[str.length - 1] === 'r') {
|
|
3889
|
+
result.roundingPriority = 'morePrecision';
|
|
3890
|
+
}
|
|
3891
|
+
else if (str[str.length - 1] === 's') {
|
|
3892
|
+
result.roundingPriority = 'lessPrecision';
|
|
3893
|
+
}
|
|
3888
3894
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
|
|
3889
3895
|
// @@@ case
|
|
3890
3896
|
if (typeof g2 !== 'string') {
|
|
@@ -4111,8 +4117,13 @@ function parseNumberSkeleton(tokens) {
|
|
|
4111
4117
|
}
|
|
4112
4118
|
return '';
|
|
4113
4119
|
});
|
|
4114
|
-
|
|
4115
|
-
|
|
4120
|
+
var opt = token.options[0];
|
|
4121
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
4122
|
+
if (opt === 'w') {
|
|
4123
|
+
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
|
|
4124
|
+
}
|
|
4125
|
+
else if (opt) {
|
|
4126
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
4116
4127
|
}
|
|
4117
4128
|
continue;
|
|
4118
4129
|
}
|
|
@@ -4134,8 +4145,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4134
4145
|
}
|
|
4135
4146
|
|
|
4136
4147
|
var _a;
|
|
4137
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
4138
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source
|
|
4148
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
4149
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
4139
4150
|
function createLocation(start, end) {
|
|
4140
4151
|
return { start: start, end: end };
|
|
4141
4152
|
}
|
|
@@ -4382,7 +4393,7 @@ var Parser = /** @class */ (function () {
|
|
|
4382
4393
|
return {
|
|
4383
4394
|
val: {
|
|
4384
4395
|
type: TYPE.literal,
|
|
4385
|
-
value: "<"
|
|
4396
|
+
value: "<".concat(tagName, "/>"),
|
|
4386
4397
|
location: createLocation(startPosition, this.clonePosition()),
|
|
4387
4398
|
},
|
|
4388
4399
|
err: null,
|
|
@@ -4987,7 +4998,7 @@ var Parser = /** @class */ (function () {
|
|
|
4987
4998
|
}
|
|
4988
4999
|
var code = codePointAt(this.message, offset);
|
|
4989
5000
|
if (code === undefined) {
|
|
4990
|
-
throw Error("Offset "
|
|
5001
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
4991
5002
|
}
|
|
4992
5003
|
return code;
|
|
4993
5004
|
};
|
|
@@ -5055,7 +5066,7 @@ var Parser = /** @class */ (function () {
|
|
|
5055
5066
|
*/
|
|
5056
5067
|
Parser.prototype.bumpTo = function (targetOffset) {
|
|
5057
5068
|
if (this.offset() > targetOffset) {
|
|
5058
|
-
throw Error("targetOffset "
|
|
5069
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
5059
5070
|
}
|
|
5060
5071
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
5061
5072
|
while (true) {
|
|
@@ -5064,7 +5075,7 @@ var Parser = /** @class */ (function () {
|
|
|
5064
5075
|
break;
|
|
5065
5076
|
}
|
|
5066
5077
|
if (offset > targetOffset) {
|
|
5067
|
-
throw Error("targetOffset "
|
|
5078
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
5068
5079
|
}
|
|
5069
5080
|
this.bump();
|
|
5070
5081
|
if (this.isEOF()) {
|
|
@@ -5530,28 +5541,28 @@ var FormatError = /** @class */ (function (_super) {
|
|
|
5530
5541
|
return _this;
|
|
5531
5542
|
}
|
|
5532
5543
|
FormatError.prototype.toString = function () {
|
|
5533
|
-
return "[formatjs Error: "
|
|
5544
|
+
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
5534
5545
|
};
|
|
5535
5546
|
return FormatError;
|
|
5536
5547
|
}(Error));
|
|
5537
5548
|
var InvalidValueError = /** @class */ (function (_super) {
|
|
5538
5549
|
__extends(InvalidValueError, _super);
|
|
5539
5550
|
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
5540
|
-
return _super.call(this, "Invalid values for \""
|
|
5551
|
+
return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5541
5552
|
}
|
|
5542
5553
|
return InvalidValueError;
|
|
5543
5554
|
}(FormatError));
|
|
5544
5555
|
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
5545
5556
|
__extends(InvalidValueTypeError, _super);
|
|
5546
5557
|
function InvalidValueTypeError(value, type, originalMessage) {
|
|
5547
|
-
return _super.call(this, "Value for \""
|
|
5558
|
+
return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5548
5559
|
}
|
|
5549
5560
|
return InvalidValueTypeError;
|
|
5550
5561
|
}(FormatError));
|
|
5551
5562
|
var MissingValueError = /** @class */ (function (_super) {
|
|
5552
5563
|
__extends(MissingValueError, _super);
|
|
5553
5564
|
function MissingValueError(variableId, originalMessage) {
|
|
5554
|
-
return _super.call(this, "The intl string context variable \""
|
|
5565
|
+
return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
5555
5566
|
}
|
|
5556
5567
|
return MissingValueError;
|
|
5557
5568
|
}(FormatError));
|
|
@@ -5712,7 +5723,7 @@ originalMessage) {
|
|
|
5712
5723
|
continue;
|
|
5713
5724
|
}
|
|
5714
5725
|
if (isPluralElement(el)) {
|
|
5715
|
-
var opt = el.options["="
|
|
5726
|
+
var opt = el.options["=".concat(value)];
|
|
5716
5727
|
if (!opt) {
|
|
5717
5728
|
if (!Intl.PluralRules) {
|
|
5718
5729
|
throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -5783,7 +5794,7 @@ function createDefaultFormatters(cache) {
|
|
|
5783
5794
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5784
5795
|
args[_i] = arguments[_i];
|
|
5785
5796
|
}
|
|
5786
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5797
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5787
5798
|
}, {
|
|
5788
5799
|
cache: createFastMemoizeCache$1(cache.number),
|
|
5789
5800
|
strategy: strategies.variadic,
|
|
@@ -5794,7 +5805,7 @@ function createDefaultFormatters(cache) {
|
|
|
5794
5805
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5795
5806
|
args[_i] = arguments[_i];
|
|
5796
5807
|
}
|
|
5797
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5808
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5798
5809
|
}, {
|
|
5799
5810
|
cache: createFastMemoizeCache$1(cache.dateTime),
|
|
5800
5811
|
strategy: strategies.variadic,
|
|
@@ -5805,7 +5816,7 @@ function createDefaultFormatters(cache) {
|
|
|
5805
5816
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5806
5817
|
args[_i] = arguments[_i];
|
|
5807
5818
|
}
|
|
5808
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5819
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5809
5820
|
}, {
|
|
5810
5821
|
cache: createFastMemoizeCache$1(cache.pluralRules),
|
|
5811
5822
|
strategy: strategies.variadic,
|
|
@@ -5963,7 +5974,13 @@ var IntlErrorCode;
|
|
|
5963
5974
|
var IntlError = /** @class */ (function (_super) {
|
|
5964
5975
|
__extends(IntlError, _super);
|
|
5965
5976
|
function IntlError(code, message, exception) {
|
|
5966
|
-
var _this =
|
|
5977
|
+
var _this = this;
|
|
5978
|
+
var err = exception
|
|
5979
|
+
? exception instanceof Error
|
|
5980
|
+
? exception
|
|
5981
|
+
: new Error(String(exception))
|
|
5982
|
+
: undefined;
|
|
5983
|
+
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
|
|
5967
5984
|
_this.code = code;
|
|
5968
5985
|
// @ts-ignore just so we don't need to declare dep on @types/node
|
|
5969
5986
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -5995,19 +6012,26 @@ var MissingDataError = /** @class */ (function (_super) {
|
|
|
5995
6012
|
}
|
|
5996
6013
|
return MissingDataError;
|
|
5997
6014
|
}(IntlError));
|
|
6015
|
+
var IntlFormatError = /** @class */ (function (_super) {
|
|
6016
|
+
__extends(IntlFormatError, _super);
|
|
6017
|
+
function IntlFormatError(message, locale, exception) {
|
|
6018
|
+
return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
|
|
6019
|
+
}
|
|
6020
|
+
return IntlFormatError;
|
|
6021
|
+
}(IntlError));
|
|
5998
6022
|
var MessageFormatError = /** @class */ (function (_super) {
|
|
5999
6023
|
__extends(MessageFormatError, _super);
|
|
6000
6024
|
function MessageFormatError(message, locale, descriptor, exception) {
|
|
6001
|
-
var _this = _super.call(this,
|
|
6025
|
+
var _this = _super.call(this, "".concat(message, " \nMessageID: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, "\nDefault Message: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, "\nDescription: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, " \n"), locale, exception) || this;
|
|
6002
6026
|
_this.descriptor = descriptor;
|
|
6003
6027
|
return _this;
|
|
6004
6028
|
}
|
|
6005
6029
|
return MessageFormatError;
|
|
6006
|
-
}(
|
|
6030
|
+
}(IntlFormatError));
|
|
6007
6031
|
var MissingTranslationError = /** @class */ (function (_super) {
|
|
6008
6032
|
__extends(MissingTranslationError, _super);
|
|
6009
6033
|
function MissingTranslationError(descriptor, locale) {
|
|
6010
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \""
|
|
6034
|
+
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"".concat(descriptor.id, "\" for locale \"").concat(locale, "\", using ").concat(descriptor.defaultMessage ? 'default message' : 'id', " as fallback.")) || this;
|
|
6011
6035
|
_this.descriptor = descriptor;
|
|
6012
6036
|
return _this;
|
|
6013
6037
|
}
|
|
@@ -6034,6 +6058,7 @@ var DEFAULT_INTL_CONFIG = {
|
|
|
6034
6058
|
timeZone: undefined,
|
|
6035
6059
|
defaultLocale: 'en',
|
|
6036
6060
|
defaultFormats: {},
|
|
6061
|
+
fallbackOnEmptyString: true,
|
|
6037
6062
|
onError: defaultErrorHandler,
|
|
6038
6063
|
};
|
|
6039
6064
|
function createIntlCache() {
|
|
@@ -6076,7 +6101,7 @@ function createFormatters(cache) {
|
|
|
6076
6101
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6077
6102
|
args[_i] = arguments[_i];
|
|
6078
6103
|
}
|
|
6079
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6104
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6080
6105
|
}, {
|
|
6081
6106
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
6082
6107
|
strategy: strategies.variadic,
|
|
@@ -6087,7 +6112,7 @@ function createFormatters(cache) {
|
|
|
6087
6112
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6088
6113
|
args[_i] = arguments[_i];
|
|
6089
6114
|
}
|
|
6090
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6115
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6091
6116
|
}, {
|
|
6092
6117
|
cache: createFastMemoizeCache(cache.number),
|
|
6093
6118
|
strategy: strategies.variadic,
|
|
@@ -6098,7 +6123,7 @@ function createFormatters(cache) {
|
|
|
6098
6123
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6099
6124
|
args[_i] = arguments[_i];
|
|
6100
6125
|
}
|
|
6101
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6126
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6102
6127
|
}, {
|
|
6103
6128
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
6104
6129
|
strategy: strategies.variadic,
|
|
@@ -6121,7 +6146,7 @@ function createFormatters(cache) {
|
|
|
6121
6146
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6122
6147
|
args[_i] = arguments[_i];
|
|
6123
6148
|
}
|
|
6124
|
-
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
|
|
6149
|
+
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();
|
|
6125
6150
|
}, {
|
|
6126
6151
|
cache: createFastMemoizeCache(cache.relativeTime),
|
|
6127
6152
|
strategy: strategies.variadic,
|
|
@@ -6132,7 +6157,7 @@ function createFormatters(cache) {
|
|
|
6132
6157
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6133
6158
|
args[_i] = arguments[_i];
|
|
6134
6159
|
}
|
|
6135
|
-
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
|
|
6160
|
+
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();
|
|
6136
6161
|
}, {
|
|
6137
6162
|
cache: createFastMemoizeCache(cache.list),
|
|
6138
6163
|
strategy: strategies.variadic,
|
|
@@ -6142,7 +6167,7 @@ function createFormatters(cache) {
|
|
|
6142
6167
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6143
6168
|
args[_i] = arguments[_i];
|
|
6144
6169
|
}
|
|
6145
|
-
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
|
|
6170
|
+
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();
|
|
6146
6171
|
}, {
|
|
6147
6172
|
cache: createFastMemoizeCache(cache.displayNames),
|
|
6148
6173
|
strategy: strategies.variadic,
|
|
@@ -6158,7 +6183,7 @@ function getNamedFormat(formats, type, name, onError) {
|
|
|
6158
6183
|
if (format) {
|
|
6159
6184
|
return format;
|
|
6160
6185
|
}
|
|
6161
|
-
onError(new UnsupportedFormatterError("No "
|
|
6186
|
+
onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
|
|
6162
6187
|
}
|
|
6163
6188
|
|
|
6164
6189
|
/**
|
|
@@ -6193,7 +6218,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
6193
6218
|
return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });
|
|
6194
6219
|
}
|
|
6195
6220
|
function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
6196
|
-
var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;
|
|
6221
|
+
var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;
|
|
6197
6222
|
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
|
|
6198
6223
|
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
|
|
6199
6224
|
// `id` is a required field of a Message Descriptor.
|
|
@@ -6223,6 +6248,9 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6223
6248
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
6224
6249
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
6225
6250
|
if (!message) {
|
|
6251
|
+
if (fallbackOnEmptyString === false && message === '') {
|
|
6252
|
+
return message;
|
|
6253
|
+
}
|
|
6226
6254
|
if (!defaultMessage ||
|
|
6227
6255
|
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
6228
6256
|
// This prevents warnings from littering the console in development
|
|
@@ -6236,7 +6264,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6236
6264
|
return formatter.format(values);
|
|
6237
6265
|
}
|
|
6238
6266
|
catch (e) {
|
|
6239
|
-
onError(new MessageFormatError("Error formatting default message for: \""
|
|
6267
|
+
onError(new MessageFormatError("Error formatting default message for: \"".concat(id, "\", rendering default message verbatim"), locale, messageDescriptor, e));
|
|
6240
6268
|
return typeof defaultMessage === 'string' ? defaultMessage : id;
|
|
6241
6269
|
}
|
|
6242
6270
|
}
|
|
@@ -6248,7 +6276,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6248
6276
|
return formatter.format(values);
|
|
6249
6277
|
}
|
|
6250
6278
|
catch (e) {
|
|
6251
|
-
onError(new MessageFormatError("Error formatting message: \""
|
|
6279
|
+
onError(new MessageFormatError("Error formatting message: \"".concat(id, "\", using ").concat(defaultMessage ? 'default message' : 'id', " as fallback."), locale, messageDescriptor, e));
|
|
6252
6280
|
}
|
|
6253
6281
|
if (defaultMessage) {
|
|
6254
6282
|
try {
|
|
@@ -6256,7 +6284,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6256
6284
|
return formatter.format(values);
|
|
6257
6285
|
}
|
|
6258
6286
|
catch (e) {
|
|
6259
|
-
onError(new MessageFormatError("Error formatting the default message for: \""
|
|
6287
|
+
onError(new MessageFormatError("Error formatting the default message for: \"".concat(id, "\", rendering message verbatim"), locale, messageDescriptor, e));
|
|
6260
6288
|
}
|
|
6261
6289
|
}
|
|
6262
6290
|
if (typeof message === 'string') {
|
|
@@ -6294,9 +6322,7 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
|
|
|
6294
6322
|
if (options === void 0) { options = {}; }
|
|
6295
6323
|
var format = options.format;
|
|
6296
6324
|
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
|
|
6297
|
-
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6298
|
-
// @ts-expect-error es2020 has a lot stuff from es2021 bleed in
|
|
6299
|
-
defaults);
|
|
6325
|
+
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
|
|
6300
6326
|
if (type === 'time' &&
|
|
6301
6327
|
!filteredOptions.hour &&
|
|
6302
6328
|
!filteredOptions.minute &&
|
|
@@ -6413,7 +6439,7 @@ var LIST_FORMAT_OPTIONS = [
|
|
|
6413
6439
|
];
|
|
6414
6440
|
var now = Date.now();
|
|
6415
6441
|
function generateToken(i) {
|
|
6416
|
-
return now
|
|
6442
|
+
return "".concat(now, "_").concat(i, "_").concat(now);
|
|
6417
6443
|
}
|
|
6418
6444
|
function formatList(opts, getListFormat, values, options) {
|
|
6419
6445
|
if (options === void 0) { options = {}; }
|
|
@@ -6480,7 +6506,7 @@ function formatPlural(_a, getPluralRules, value, options) {
|
|
|
6480
6506
|
return getPluralRules(locale, filteredOptions).select(value);
|
|
6481
6507
|
}
|
|
6482
6508
|
catch (e) {
|
|
6483
|
-
onError(new
|
|
6509
|
+
onError(new IntlFormatError('Error formatting plural.', locale, e));
|
|
6484
6510
|
}
|
|
6485
6511
|
return 'other';
|
|
6486
6512
|
}
|
|
@@ -6507,7 +6533,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
|
|
|
6507
6533
|
return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
|
|
6508
6534
|
}
|
|
6509
6535
|
catch (e) {
|
|
6510
|
-
config.onError(new
|
|
6536
|
+
config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));
|
|
6511
6537
|
}
|
|
6512
6538
|
return String(value);
|
|
6513
6539
|
}
|
|
@@ -6587,7 +6613,7 @@ function createIntl(config, cache) {
|
|
|
6587
6613
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
6588
6614
|
if (!locale) {
|
|
6589
6615
|
if (onError) {
|
|
6590
|
-
onError(new InvalidConfigError("\"locale\" was not configured, using \""
|
|
6616
|
+
onError(new InvalidConfigError("\"locale\" was not configured, using \"".concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details")));
|
|
6591
6617
|
}
|
|
6592
6618
|
// Since there's no registered locale data for `locale`, this will
|
|
6593
6619
|
// fallback to the `defaultLocale` to make sure things can render.
|
|
@@ -6597,458 +6623,481 @@ function createIntl(config, cache) {
|
|
|
6597
6623
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
6598
6624
|
}
|
|
6599
6625
|
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
6600
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6626
|
+
onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.NumberFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
|
|
6601
6627
|
}
|
|
6602
6628
|
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
|
|
6603
6629
|
onError) {
|
|
6604
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6630
|
+
onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.DateTimeFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
|
|
6605
6631
|
}
|
|
6606
6632
|
verifyConfigMessages(resolvedConfig);
|
|
6607
6633
|
return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
|
|
6608
6634
|
}
|
|
6609
6635
|
|
|
6610
|
-
const DEFAULT_LANGUAGE = "en";
|
|
6611
|
-
function getBrowserLang() {
|
|
6612
|
-
const langAttr = document.documentElement.getAttribute("lang");
|
|
6613
|
-
if (!!langAttr) {
|
|
6614
|
-
return langAttr;
|
|
6615
|
-
}
|
|
6616
|
-
else if (window.navigator && window.navigator.language) {
|
|
6617
|
-
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6618
|
-
return lang.slice(0, 2);
|
|
6619
|
-
}
|
|
6620
|
-
else {
|
|
6621
|
-
return DEFAULT_LANGUAGE;
|
|
6622
|
-
}
|
|
6623
|
-
}
|
|
6624
|
-
// prevents memory leak
|
|
6625
|
-
const cache = createIntlCache();
|
|
6626
|
-
const locale = getBrowserLang();
|
|
6627
|
-
const intl = createIntl({
|
|
6628
|
-
locale: locale,
|
|
6629
|
-
defaultLocale: "en",
|
|
6630
|
-
messages: lang[locale] || en,
|
|
6631
|
-
}, cache);
|
|
6632
|
-
function generateId() {
|
|
6633
|
-
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6634
|
-
}
|
|
6635
|
-
function
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
}
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
)
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
}
|
|
6729
|
-
|
|
6730
|
-
const
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
const
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
const
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
};
|
|
6750
|
-
const
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
const
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
}
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
const
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
}
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
6636
|
+
const DEFAULT_LANGUAGE = "en";
|
|
6637
|
+
function getBrowserLang() {
|
|
6638
|
+
const langAttr = document.documentElement.getAttribute("lang");
|
|
6639
|
+
if (!!langAttr) {
|
|
6640
|
+
return langAttr;
|
|
6641
|
+
}
|
|
6642
|
+
else if (window.navigator && window.navigator.language) {
|
|
6643
|
+
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6644
|
+
return lang.slice(0, 2);
|
|
6645
|
+
}
|
|
6646
|
+
else {
|
|
6647
|
+
return DEFAULT_LANGUAGE;
|
|
6648
|
+
}
|
|
6649
|
+
}
|
|
6650
|
+
// prevents memory leak
|
|
6651
|
+
const cache = createIntlCache();
|
|
6652
|
+
const locale = getBrowserLang();
|
|
6653
|
+
const intl = createIntl({
|
|
6654
|
+
locale: locale,
|
|
6655
|
+
defaultLocale: "en",
|
|
6656
|
+
messages: lang[locale] || en,
|
|
6657
|
+
}, cache);
|
|
6658
|
+
function generateId() {
|
|
6659
|
+
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6660
|
+
}
|
|
6661
|
+
// limits how many times a function fires
|
|
6662
|
+
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6663
|
+
function throttle(fn, wait) {
|
|
6664
|
+
let timeout;
|
|
6665
|
+
let shouldWait = false;
|
|
6666
|
+
return function () {
|
|
6667
|
+
const context = this;
|
|
6668
|
+
if (!shouldWait) {
|
|
6669
|
+
fn.apply(context, arguments);
|
|
6670
|
+
shouldWait = true;
|
|
6671
|
+
clearTimeout(timeout);
|
|
6672
|
+
timeout = setTimeout(function () {
|
|
6673
|
+
shouldWait = false;
|
|
6674
|
+
}, wait);
|
|
6675
|
+
}
|
|
6676
|
+
};
|
|
6677
|
+
}
|
|
6678
|
+
// waits until it hasn't been called for [timeout] ms.
|
|
6679
|
+
// use when the function should run only after something (event) is done firing
|
|
6680
|
+
function debounce(fn, wait) {
|
|
6681
|
+
let timeout;
|
|
6682
|
+
return function () {
|
|
6683
|
+
const context = this;
|
|
6684
|
+
const functionCall = () => fn.apply(context, arguments);
|
|
6685
|
+
clearTimeout(timeout);
|
|
6686
|
+
timeout = setTimeout(functionCall, wait);
|
|
6687
|
+
};
|
|
6688
|
+
}
|
|
6689
|
+
function getTextDir() {
|
|
6690
|
+
const dir = document.querySelector("html").getAttribute("dir");
|
|
6691
|
+
return dir ? dir.toLowerCase() : "";
|
|
6692
|
+
}
|
|
6693
|
+
function getPosition(el) {
|
|
6694
|
+
const coords = el.getBoundingClientRect();
|
|
6695
|
+
let x = coords.x;
|
|
6696
|
+
let y = coords.y;
|
|
6697
|
+
// Edge doesn't have x and y
|
|
6698
|
+
if (!x) {
|
|
6699
|
+
if (getTextDir() === "rtl") {
|
|
6700
|
+
x = coords.right;
|
|
6701
|
+
}
|
|
6702
|
+
else {
|
|
6703
|
+
x = coords.left;
|
|
6704
|
+
}
|
|
6705
|
+
y = coords.top;
|
|
6706
|
+
}
|
|
6707
|
+
return { x, y };
|
|
6708
|
+
}
|
|
6709
|
+
function findParentWithScrollbar(el) {
|
|
6710
|
+
while (!!el) {
|
|
6711
|
+
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6712
|
+
return el;
|
|
6713
|
+
}
|
|
6714
|
+
el = el.parentElement;
|
|
6715
|
+
}
|
|
6716
|
+
}
|
|
6717
|
+
function findParentWithHiddenOverflow(el) {
|
|
6718
|
+
while (!!el) {
|
|
6719
|
+
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6720
|
+
return el;
|
|
6721
|
+
}
|
|
6722
|
+
el = el.parentElement;
|
|
6723
|
+
}
|
|
6724
|
+
}
|
|
6725
|
+
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6726
|
+
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6727
|
+
// if parent is not found, measurements are checked against the viewport
|
|
6728
|
+
return {
|
|
6729
|
+
closableElHeight: closableEl.clientHeight,
|
|
6730
|
+
closableElWidth: closableEl.clientWidth,
|
|
6731
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6732
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6733
|
+
spaceAbove: parent
|
|
6734
|
+
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6735
|
+
: fixedEl.getBoundingClientRect().top,
|
|
6736
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6737
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6738
|
+
spaceBelow: parent
|
|
6739
|
+
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6740
|
+
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6741
|
+
spaceLeft: parent
|
|
6742
|
+
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6743
|
+
: fixedEl.getBoundingClientRect().left,
|
|
6744
|
+
spaceRight: parent
|
|
6745
|
+
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6746
|
+
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6747
|
+
};
|
|
6748
|
+
}
|
|
6749
|
+
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6750
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6751
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6752
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6753
|
+
) {
|
|
6754
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6755
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6756
|
+
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6757
|
+
return openUp;
|
|
6758
|
+
}
|
|
6759
|
+
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6760
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6761
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6762
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6763
|
+
) {
|
|
6764
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6765
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6766
|
+
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6767
|
+
return openDown;
|
|
6768
|
+
}
|
|
6769
|
+
function shouldShiftRight(fixedEl, closableEl) {
|
|
6770
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6771
|
+
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6772
|
+
return needsSpaceLeft;
|
|
6773
|
+
}
|
|
6774
|
+
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6775
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6776
|
+
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6777
|
+
return needsSpaceRight;
|
|
6778
|
+
}
|
|
6779
|
+
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6780
|
+
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6781
|
+
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6782
|
+
tooltipEl.style.top = "";
|
|
6783
|
+
tooltipEl.style.left = "";
|
|
6784
|
+
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6785
|
+
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6786
|
+
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6787
|
+
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6788
|
+
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6789
|
+
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6790
|
+
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6791
|
+
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6792
|
+
const swapAbove = (position) => {
|
|
6793
|
+
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6794
|
+
};
|
|
6795
|
+
const swapBelow = (position) => {
|
|
6796
|
+
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6797
|
+
};
|
|
6798
|
+
const swapLeft = (position, centeredPosition) => {
|
|
6799
|
+
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6800
|
+
position = position.replace("left", "right");
|
|
6801
|
+
}
|
|
6802
|
+
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6803
|
+
position = centeredPosition;
|
|
6804
|
+
}
|
|
6805
|
+
return position;
|
|
6806
|
+
};
|
|
6807
|
+
const swapRight = (position, centeredPosition) => {
|
|
6808
|
+
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6809
|
+
position = position.replace("right", "left");
|
|
6810
|
+
}
|
|
6811
|
+
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6812
|
+
position = centeredPosition;
|
|
6813
|
+
}
|
|
6814
|
+
return position;
|
|
6815
|
+
};
|
|
6816
|
+
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6817
|
+
switch (tPos) {
|
|
6818
|
+
case "left":
|
|
6819
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6820
|
+
case "right":
|
|
6821
|
+
tPos = swapRight(tPos, "bottom");
|
|
6822
|
+
case "top-left":
|
|
6823
|
+
tPos = swapLeft(tPos, "top");
|
|
6824
|
+
tPos = swapAbove(tPos);
|
|
6825
|
+
case "top-right":
|
|
6826
|
+
tPos = swapRight(tPos, "top");
|
|
6827
|
+
tPos = swapAbove(tPos);
|
|
6828
|
+
case "bottom-left":
|
|
6829
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6830
|
+
tPos = swapBelow(tPos);
|
|
6831
|
+
case "bottom-right":
|
|
6832
|
+
tPos = swapRight(tPos, "bottom");
|
|
6833
|
+
tPos = swapBelow(tPos);
|
|
6834
|
+
case "top":
|
|
6835
|
+
tPos = swapAbove(tPos);
|
|
6836
|
+
case "bottom":
|
|
6837
|
+
tPos = swapBelow(tPos);
|
|
6838
|
+
}
|
|
6839
|
+
return tPos;
|
|
6840
|
+
}
|
|
6841
|
+
function hasRoomRight(x, spaceNeeded) {
|
|
6842
|
+
let horizOffset = 0;
|
|
6843
|
+
// if (getTextDir() === "ltr") {
|
|
6844
|
+
if (x.type === "click") {
|
|
6845
|
+
// if it's a mouse event, deal with mouse coords
|
|
6846
|
+
horizOffset = x.clientX;
|
|
6847
|
+
// if it's a focus event, the offset is 0
|
|
6848
|
+
}
|
|
6849
|
+
else if (x.type === "focus") {
|
|
6850
|
+
horizOffset = 0;
|
|
6851
|
+
}
|
|
6852
|
+
else {
|
|
6853
|
+
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6854
|
+
let el = x; // re-assignment is for clarity
|
|
6855
|
+
while (el) {
|
|
6856
|
+
if (el.tagName == "BODY") {
|
|
6857
|
+
// deal with browser quirks with body/window/document and page scroll
|
|
6858
|
+
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6859
|
+
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6860
|
+
}
|
|
6861
|
+
else {
|
|
6862
|
+
// for all other non-BODY elements
|
|
6863
|
+
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6864
|
+
}
|
|
6865
|
+
el = el.offsetParent;
|
|
6866
|
+
}
|
|
6867
|
+
// }
|
|
6868
|
+
}
|
|
6869
|
+
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6870
|
+
}
|
|
6871
|
+
function checkForActiveElInShadow(element) {
|
|
6872
|
+
while (element && element.shadowRoot) {
|
|
6873
|
+
element = element.shadowRoot.activeElement;
|
|
6874
|
+
}
|
|
6875
|
+
return element;
|
|
6876
|
+
}
|
|
6877
|
+
function checkForFocusableElInShadow(element) {
|
|
6878
|
+
const selectors = [
|
|
6879
|
+
"button",
|
|
6880
|
+
"a",
|
|
6881
|
+
"input",
|
|
6882
|
+
"select",
|
|
6883
|
+
"textarea",
|
|
6884
|
+
"wm-button",
|
|
6885
|
+
"wm-search",
|
|
6886
|
+
"wm-select",
|
|
6887
|
+
"wm-action-menu",
|
|
6888
|
+
"wm-tab-item",
|
|
6889
|
+
"wm-datepicker",
|
|
6890
|
+
];
|
|
6891
|
+
let focusableEl = element;
|
|
6892
|
+
selectors.forEach((selector) => {
|
|
6893
|
+
if (focusableEl && focusableEl.shadowRoot) {
|
|
6894
|
+
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6895
|
+
if (elInShadow) {
|
|
6896
|
+
if (selector.startsWith("wm-")) {
|
|
6897
|
+
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6898
|
+
}
|
|
6899
|
+
else {
|
|
6900
|
+
focusableEl = elInShadow;
|
|
6901
|
+
}
|
|
6902
|
+
}
|
|
6903
|
+
}
|
|
6904
|
+
});
|
|
6905
|
+
return focusableEl;
|
|
6906
|
+
}
|
|
6907
|
+
function isFocusable(element) {
|
|
6908
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6909
|
+
return true;
|
|
6910
|
+
}
|
|
6911
|
+
if (element.disabled) {
|
|
6912
|
+
return false;
|
|
6913
|
+
}
|
|
6914
|
+
switch (element.nodeName) {
|
|
6915
|
+
case "A":
|
|
6916
|
+
return !!element.href && element.rel != "ignore";
|
|
6917
|
+
case "INPUT":
|
|
6918
|
+
return element.type != "hidden" && element.type != "file";
|
|
6919
|
+
case "BUTTON":
|
|
6920
|
+
case "SELECT":
|
|
6921
|
+
case "TEXTAREA":
|
|
6922
|
+
case "WM-BUTTON":
|
|
6923
|
+
case "WM-SELECT":
|
|
6924
|
+
case "WM-ACTION-MENU":
|
|
6925
|
+
case "WM-DATEPICKER":
|
|
6926
|
+
case "WM-TIMEPICKER":
|
|
6927
|
+
case "WM-INPUT":
|
|
6928
|
+
case "WM-TAG-INPUT":
|
|
6929
|
+
case "WM-TAB-ITEM":
|
|
6930
|
+
case "WM-SEARCH":
|
|
6931
|
+
return true;
|
|
6932
|
+
default:
|
|
6933
|
+
return false;
|
|
6934
|
+
}
|
|
6935
|
+
}
|
|
6936
|
+
function getFirstFocusableDescendant(element) {
|
|
6937
|
+
if (isFocusable(element)) {
|
|
6938
|
+
return checkForFocusableElInShadow(element);
|
|
6939
|
+
}
|
|
6940
|
+
else if (element.childNodes.length > 0) {
|
|
6941
|
+
element.childNodes.forEach((i) => {
|
|
6942
|
+
const childEl = getFirstFocusableDescendant(i);
|
|
6943
|
+
return childEl && checkForFocusableElInShadow(childEl);
|
|
6944
|
+
});
|
|
6945
|
+
}
|
|
6946
|
+
}
|
|
6947
|
+
function hasValidType(file, types) {
|
|
6948
|
+
const acceptedExtensions = types.split(" ");
|
|
6949
|
+
const parts = file.name && file.name.split(".");
|
|
6950
|
+
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6951
|
+
return ext
|
|
6952
|
+
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6953
|
+
: // fallback: if we couldn't obtain an extension,
|
|
6954
|
+
// validate based on MIME type...
|
|
6955
|
+
!!file.type
|
|
6956
|
+
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
6957
|
+
: // ...and if that failed too, accept the file
|
|
6958
|
+
// as it's preferable to accept an invalid file
|
|
6959
|
+
// than refusing a valid one (back-end will take care of what slips through)
|
|
6960
|
+
true;
|
|
6961
|
+
}
|
|
6962
|
+
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
6963
|
+
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
6964
|
+
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
6965
|
+
// front end checks are just a convenience to users, independent of security.
|
|
6966
|
+
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
6967
|
+
const lookupTable = {
|
|
6968
|
+
aac: ["audio/aac"],
|
|
6969
|
+
abw: ["application/x-abiword"],
|
|
6970
|
+
arc: ["application/x-freearc"],
|
|
6971
|
+
avi: ["video/x-msvideo"],
|
|
6972
|
+
azw: ["application/vnd.amazon.ebook"],
|
|
6973
|
+
bin: ["application/octet-stream"],
|
|
6974
|
+
bmp: ["image/bmp"],
|
|
6975
|
+
bz: ["application/x-bzip"],
|
|
6976
|
+
bz2: ["application/x-bzip2"],
|
|
6977
|
+
csh: ["application/x-csh"],
|
|
6978
|
+
css: ["text/css"],
|
|
6979
|
+
csv: ["text/csv"],
|
|
6980
|
+
doc: ["application/msword"],
|
|
6981
|
+
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
6982
|
+
eot: ["application/vnd.ms-fontobject"],
|
|
6983
|
+
epub: ["application/epub+zip"],
|
|
6984
|
+
gz: ["application/gzip"],
|
|
6985
|
+
gif: ["image/gif"],
|
|
6986
|
+
htm: ["text/html"],
|
|
6987
|
+
html: ["text/html"],
|
|
6988
|
+
ico: ["image/vnd.microsoft.icon"],
|
|
6989
|
+
ics: ["text/calendar"],
|
|
6990
|
+
jar: ["application/java-archive"],
|
|
6991
|
+
jpeg: ["image/jpeg"],
|
|
6992
|
+
jpg: ["image/jpeg"],
|
|
6993
|
+
js: ["text/javascript"],
|
|
6994
|
+
json: ["application/json"],
|
|
6995
|
+
jsonld: ["application/ld+json"],
|
|
6996
|
+
log: ["text/plain"],
|
|
6997
|
+
mid: ["audio/x-midi"],
|
|
6998
|
+
midi: ["audio/x-midi"],
|
|
6999
|
+
mjs: ["text/javascript"],
|
|
7000
|
+
mp3: ["audio/mpeg"],
|
|
7001
|
+
mpeg: ["video/mpeg"],
|
|
7002
|
+
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7003
|
+
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7004
|
+
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7005
|
+
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7006
|
+
oga: ["audio/ogg"],
|
|
7007
|
+
ogv: ["video/ogg"],
|
|
7008
|
+
ogx: ["application/ogg"],
|
|
7009
|
+
opus: ["audio/opus"],
|
|
7010
|
+
otf: ["font/otf"],
|
|
7011
|
+
png: ["image/png"],
|
|
7012
|
+
pdf: ["application/pdf"],
|
|
7013
|
+
php: ["application/php"],
|
|
7014
|
+
ppt: ["application/vnd.ms-powerpoint"],
|
|
7015
|
+
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7016
|
+
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7017
|
+
rtf: ["application/rtf"],
|
|
7018
|
+
sh: ["application/x-sh"],
|
|
7019
|
+
svg: ["image/svg+xml"],
|
|
7020
|
+
swf: ["application/x-shockwave-flash"],
|
|
7021
|
+
tar: ["application/x-tar"],
|
|
7022
|
+
tif: ["image/tiff"],
|
|
7023
|
+
tiff: ["image/tiff"],
|
|
7024
|
+
ts: ["video/mp2t"],
|
|
7025
|
+
ttf: ["font/ttf"],
|
|
7026
|
+
txt: ["text/plain"],
|
|
7027
|
+
vsd: ["application/vnd.visio"],
|
|
7028
|
+
wav: ["audio/wav"],
|
|
7029
|
+
weba: ["audio/webm"],
|
|
7030
|
+
webm: ["video/webm"],
|
|
7031
|
+
webp: ["image/webp"],
|
|
7032
|
+
woff: ["font/woff"],
|
|
7033
|
+
woff2: ["font/woff2"],
|
|
7034
|
+
xhtml: ["application/xhtml+xml"],
|
|
7035
|
+
xls: ["application/vnd.ms-excel"],
|
|
7036
|
+
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7037
|
+
xml: ["application/xml", "text/xml"],
|
|
7038
|
+
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7039
|
+
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7040
|
+
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7041
|
+
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7042
|
+
"7z": ["application/x-7z-compressed"],
|
|
7043
|
+
};
|
|
7044
|
+
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7045
|
+
}
|
|
7046
|
+
function snakeCaseToCamelCase(str) {
|
|
7047
|
+
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7048
|
+
if (snakeCaseRegexp.test(str)) {
|
|
7049
|
+
let camelCase = "";
|
|
7050
|
+
let arr = str.split("_");
|
|
7051
|
+
arr.forEach((word, idx) => {
|
|
7052
|
+
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7053
|
+
});
|
|
7054
|
+
return camelCase;
|
|
7055
|
+
}
|
|
7056
|
+
else {
|
|
7057
|
+
return str;
|
|
7058
|
+
}
|
|
7059
|
+
}
|
|
7060
|
+
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7061
|
+
let newIndex = currentIndex;
|
|
7062
|
+
if (direction === "ArrowDown") {
|
|
7063
|
+
newIndex = (currentIndex + 1) % listLength;
|
|
7064
|
+
}
|
|
7065
|
+
if (direction === "ArrowUp") {
|
|
7066
|
+
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7067
|
+
}
|
|
7068
|
+
return newIndex;
|
|
7069
|
+
}
|
|
7070
|
+
function isRelatedTarget(ev, id) {
|
|
7071
|
+
// used for onBlur events to check the element that has been clicked
|
|
7072
|
+
const ids = id.split(" ");
|
|
7073
|
+
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7074
|
+
}
|
|
7075
|
+
function toBool(val) {
|
|
7076
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7077
|
+
return val == "false" ? false : !!val;
|
|
7078
|
+
}
|
|
7079
|
+
/*
|
|
7080
|
+
* this is going to be needed to solve the extra tabbing on navigator
|
|
7081
|
+
* and for programmatic focus of tabs
|
|
7082
|
+
* Here's a draft, not bug proof, see:
|
|
7083
|
+
* https://stackoverflow.com/a/10730308/3741713
|
|
7084
|
+
|
|
7085
|
+
function getKeyboardFocusableElements(element = document) {
|
|
7086
|
+
const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
|
|
7087
|
+
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7088
|
+
}
|
|
7089
|
+
|
|
7090
|
+
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7091
|
+
const els = getKeyboardFocusableElements();
|
|
7092
|
+
const current = els.indexOf(element);
|
|
7093
|
+
return els[current - 1] as HTMLElement;
|
|
7094
|
+
}
|
|
7095
|
+
|
|
7096
|
+
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7097
|
+
const els = getKeyboardFocusableElements();
|
|
7098
|
+
const current = els.indexOf(element);
|
|
7099
|
+
return els[current + 1] as HTMLElement;
|
|
7100
|
+
}
|
|
7052
7101
|
*/
|
|
7053
7102
|
|
|
7054
7103
|
exports.adjustTooltipPosition = adjustTooltipPosition;
|
|
@@ -7070,3 +7119,5 @@ exports.shouldOpenUp = shouldOpenUp;
|
|
|
7070
7119
|
exports.shouldShiftLeft = shouldShiftLeft;
|
|
7071
7120
|
exports.shouldShiftRight = shouldShiftRight;
|
|
7072
7121
|
exports.snakeCaseToCamelCase = snakeCaseToCamelCase;
|
|
7122
|
+
exports.throttle = throttle;
|
|
7123
|
+
exports.toBool = toBool;
|