@watermarkinsights/ripple 3.9.0-2 → 3.9.0-5
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/{chartFunctions-a1dd1291.js → chartFunctions-08c7054a.js} +416 -416
- package/dist/cjs/{functions-0750b767.js → functions-04933f19.js} +544 -506
- package/dist/cjs/{global-0a6b313f.js → global-5faea609.js} +60 -60
- package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
- package/dist/cjs/{index-98c6524c.js → index-acad7ab3.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 +87 -87
- package/dist/cjs/priv-datepicker.cjs.entry.js +659 -659
- 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 -228
- package/dist/cjs/wm-chart-slice.cjs.entry.js +14 -14
- package/dist/cjs/wm-chart.cjs.entry.js +116 -116
- package/dist/cjs/wm-datepicker.cjs.entry.js +267 -267
- 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 +222 -222
- package/dist/cjs/wm-navigator.cjs.entry.js +269 -269
- package/dist/cjs/wm-network-uploader.cjs.entry.js +454 -422
- package/dist/cjs/wm-option_2.cjs.entry.js +487 -487
- package/dist/cjs/wm-pagination.cjs.entry.js +168 -168
- package/dist/cjs/wm-progress-indicator.cjs.entry.js +82 -82
- package/dist/cjs/wm-progress-monitor.cjs.entry.js +51 -47
- package/dist/cjs/wm-progress-slice.cjs.entry.js +9 -9
- 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 +298 -298
- 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 +380 -348
- package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +258 -258
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +115 -115
- package/dist/collection/components/charts/wm-chart/wm-chart.js +332 -332
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +199 -199
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +92 -95
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +111 -111
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
- package/dist/collection/components/wm-button/wm-button.css +20 -21
- package/dist/collection/components/wm-button/wm-button.js +491 -491
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +3 -4
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1024 -1024
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -2
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +471 -471
- package/dist/collection/components/wm-input/wm-input.css +1 -2
- package/dist/collection/components/wm-input/wm-input.js +423 -423
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
- package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
- package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
- package/dist/collection/components/wm-modal/wm-modal.js +461 -461
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +1 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +162 -162
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +121 -121
- package/dist/collection/components/wm-navigation/wm-navigation.js +211 -211
- 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.js +114 -114
- package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
- package/dist/collection/components/wm-option/wm-option.css +2 -3
- package/dist/collection/components/wm-option/wm-option.js +414 -414
- package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
- package/dist/collection/components/wm-search/wm-search.js +480 -480
- package/dist/collection/components/wm-select/wm-select.css +2 -3
- package/dist/collection/components/wm-select/wm-select.js +718 -718
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +2 -3
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +2 -2
- 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.js +330 -330
- 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 -3
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +2 -3
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +1 -2
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +20 -21
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +785 -753
- package/dist/collection/components/wm-uploader/wm-uploader.css +24 -21
- package/dist/collection/components/wm-uploader/wm-uploader.js +780 -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/chartFunctions.js +417 -417
- package/dist/collection/global/functions.js +468 -468
- package/dist/collection/global/global.js +67 -67
- 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 +43 -39
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/{chartFunctions-fc11df2b.js → chartFunctions-aa8b2cfe.js} +416 -416
- package/dist/esm/{functions-b478ef24.js → functions-ecba807c.js} +544 -506
- package/dist/esm/{global-b8be90a6.js → global-8eb97f09.js} +60 -60
- package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
- package/dist/esm/{index-d649a861.js → index-7603f98e.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 +87 -87
- package/dist/esm/priv-datepicker.entry.js +659 -659
- 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 -228
- package/dist/esm/wm-chart-slice.entry.js +14 -14
- package/dist/esm/wm-chart.entry.js +116 -116
- package/dist/esm/wm-datepicker.entry.js +267 -267
- 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 +222 -222
- package/dist/esm/wm-navigator.entry.js +269 -269
- package/dist/esm/wm-network-uploader.entry.js +454 -422
- package/dist/esm/wm-option_2.entry.js +487 -487
- package/dist/esm/wm-pagination.entry.js +168 -168
- package/dist/esm/wm-progress-indicator.entry.js +82 -82
- package/dist/esm/wm-progress-monitor.entry.js +51 -47
- package/dist/esm/wm-progress-slice.entry.js +9 -9
- 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 +298 -298
- 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 +380 -348
- package/dist/esm/wm-wrapper.entry.js +13 -13
- package/dist/esm-es5/chartFunctions-aa8b2cfe.js +1 -0
- package/dist/esm-es5/functions-ecba807c.js +15 -0
- package/dist/esm-es5/{global-b8be90a6.js → global-8eb97f09.js} +1 -1
- package/dist/esm-es5/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +1 -1
- package/dist/esm-es5/index-7603f98e.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 -1
- 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-progress-indicator.entry.js +1 -1
- package/dist/esm-es5/wm-progress-monitor.entry.js +1 -1
- package/dist/esm-es5/wm-progress-slice.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-04255a42.entry.js +1 -0
- package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
- package/dist/ripple/p-0a840636.entry.js +1 -0
- package/dist/ripple/p-0c480b92.system.entry.js +1 -0
- package/dist/ripple/{p-1b7be30d.system.entry.js → p-11ff0109.system.entry.js} +1 -1
- package/dist/ripple/{p-366e00f9.js → p-1523f1e1.js} +1 -1
- package/dist/ripple/{p-bfc1ab2e.system.entry.js → p-1df2adee.system.entry.js} +1 -1
- package/dist/ripple/p-268f470a.system.entry.js +1 -0
- package/dist/ripple/p-2a9e03d8.system.entry.js +1 -0
- package/dist/ripple/p-313b6073.system.js +1 -0
- package/dist/ripple/{p-fd9380f2.system.entry.js → p-314c79cc.system.entry.js} +1 -1
- package/dist/ripple/{p-30e1daf7.system.entry.js → p-32ff1f4d.system.entry.js} +1 -1
- package/dist/ripple/p-358bde27.entry.js +1 -0
- package/dist/ripple/{p-2b63995f.system.entry.js → p-3b3e847c.system.entry.js} +1 -1
- package/dist/ripple/p-3bdad453.system.js +15 -0
- package/dist/ripple/p-3e80a569.system.entry.js +1 -0
- package/dist/ripple/p-461f08d4.entry.js +1 -0
- package/dist/ripple/p-4d20fc46.system.entry.js +1 -0
- package/dist/ripple/p-4d59fe86.entry.js +1 -0
- package/dist/ripple/p-51aaaedf.entry.js +1 -0
- package/dist/ripple/{p-063bc67c.system.entry.js → p-520211f0.system.entry.js} +1 -1
- package/dist/ripple/p-52270154.system.entry.js +1 -0
- package/dist/ripple/p-5322c156.entry.js +1 -0
- package/dist/ripple/p-56fa3181.entry.js +1 -0
- package/dist/ripple/p-631aa708.entry.js +1 -0
- package/dist/ripple/p-64ca10ea.js +16 -0
- package/dist/ripple/{p-3b31eaec.system.js → p-722fbb3c.system.js} +1 -1
- package/dist/ripple/p-766def9b.system.entry.js +1 -0
- package/dist/ripple/p-781e8913.system.entry.js +1 -0
- package/dist/ripple/p-7fae0cc2.entry.js +1 -0
- package/dist/ripple/p-8647d034.system.entry.js +1 -0
- package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
- package/dist/ripple/p-8943b3e4.system.js +1 -0
- package/dist/ripple/p-8e747ee0.entry.js +1 -0
- package/dist/ripple/p-9045fdcc.entry.js +1 -0
- package/dist/ripple/p-90dd1cc5.entry.js +1 -0
- package/dist/ripple/{p-099df7b7.system.entry.js → p-90ed3268.system.entry.js} +1 -1
- package/dist/ripple/p-9233b6c7.entry.js +1 -0
- package/dist/ripple/p-93e6bfbe.system.entry.js +1 -0
- package/dist/ripple/p-952eab56.entry.js +1 -0
- package/dist/ripple/p-98c0e6a6.entry.js +1 -0
- package/dist/ripple/p-9b32db76.system.entry.js +1 -0
- package/dist/ripple/p-9ce7fa33.entry.js +1 -0
- package/dist/ripple/p-9dc909f9.system.entry.js +1 -0
- package/dist/ripple/p-a084e205.entry.js +1 -0
- package/dist/ripple/p-a0c3ef16.system.js +1 -0
- package/dist/ripple/p-a193df9f.entry.js +1 -0
- package/dist/ripple/p-a4aa450f.entry.js +1 -0
- package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
- package/dist/ripple/p-a9e0ce88.entry.js +1 -0
- package/dist/ripple/p-ae04257e.entry.js +1 -0
- package/dist/ripple/{p-a1511315.system.entry.js → p-ae6cfbca.system.entry.js} +1 -1
- package/dist/ripple/{p-ea33bda7.system.entry.js → p-af1d4b36.system.entry.js} +1 -1
- package/dist/ripple/p-af301845.system.entry.js +1 -0
- package/dist/ripple/p-b3c71506.js +1 -0
- package/dist/ripple/p-b4e545e2.entry.js +1 -0
- package/dist/ripple/{p-ddf157c8.system.entry.js → p-b4efa7d1.system.entry.js} +1 -1
- package/dist/ripple/p-bd98cbba.entry.js +1 -0
- package/dist/ripple/p-bd9e522e.system.entry.js +1 -0
- package/dist/ripple/p-bf64c818.entry.js +1 -0
- package/dist/ripple/{p-cb7d8ade.system.entry.js → p-c1795546.system.entry.js} +1 -1
- package/dist/ripple/{p-647edff3.system.entry.js → p-c1c25924.system.entry.js} +1 -1
- package/dist/ripple/{p-36be0612.js → p-cbdefe19.js} +1 -1
- package/dist/ripple/p-cc789f12.system.entry.js +1 -0
- package/dist/ripple/p-ce641de3.entry.js +1 -0
- package/dist/ripple/p-cfb81685.entry.js +1 -0
- package/dist/ripple/p-d636cb95.system.js +1 -0
- package/dist/ripple/{p-2b9c54e7.system.entry.js → p-d863abe4.system.entry.js} +1 -1
- package/dist/ripple/p-e47a097b.entry.js +1 -0
- package/dist/ripple/p-e72c1d68.entry.js +1 -0
- package/dist/ripple/p-e75f7966.system.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +11 -11
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +35 -35
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -10
- 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 -43
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +41 -41
- 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 +21 -21
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +13 -13
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +30 -30
- 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 +24 -24
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/chartFunctions.d.ts +28 -28
- package/dist/types/global/functions.d.ts +42 -42
- package/dist/types/global/global.d.ts +1 -1
- package/dist/types/global/interfaces.d.ts +44 -44
- 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/chartFunctions-fc11df2b.js +0 -1
- package/dist/esm-es5/functions-b478ef24.js +0 -15
- package/dist/esm-es5/index-d649a861.js +0 -1
- package/dist/ripple/p-0b23a4fe.entry.js +0 -1
- package/dist/ripple/p-1b2c3251.system.entry.js +0 -1
- package/dist/ripple/p-1e2c46f1.entry.js +0 -1
- package/dist/ripple/p-1e7fc028.entry.js +0 -1
- package/dist/ripple/p-2296c2c3.entry.js +0 -1
- package/dist/ripple/p-24cd6213.system.entry.js +0 -1
- package/dist/ripple/p-2587031d.system.entry.js +0 -1
- package/dist/ripple/p-29d527c8.entry.js +0 -1
- package/dist/ripple/p-2b6246d9.entry.js +0 -1
- package/dist/ripple/p-2cc9e6cf.system.entry.js +0 -1
- package/dist/ripple/p-30db4ad7.entry.js +0 -1
- package/dist/ripple/p-3388ca40.entry.js +0 -1
- package/dist/ripple/p-34736928.entry.js +0 -1
- package/dist/ripple/p-3eb3a1f8.entry.js +0 -1
- package/dist/ripple/p-492ad5d0.system.entry.js +0 -1
- package/dist/ripple/p-4f23cdc6.entry.js +0 -1
- package/dist/ripple/p-50be3b44.js +0 -1
- package/dist/ripple/p-5743d4bc.system.entry.js +0 -1
- package/dist/ripple/p-59963be9.system.entry.js +0 -1
- package/dist/ripple/p-5d6cc9da.system.js +0 -1
- package/dist/ripple/p-5e5f162c.system.entry.js +0 -1
- package/dist/ripple/p-6c295beb.entry.js +0 -1
- package/dist/ripple/p-6c751341.entry.js +0 -1
- package/dist/ripple/p-6f9e8fbc.entry.js +0 -1
- package/dist/ripple/p-70ececb5.entry.js +0 -1
- package/dist/ripple/p-7674c9b0.system.entry.js +0 -1
- package/dist/ripple/p-76b96f77.entry.js +0 -1
- package/dist/ripple/p-7a2a0d2e.js +0 -16
- package/dist/ripple/p-7c2b1682.entry.js +0 -1
- package/dist/ripple/p-7f0c64ac.entry.js +0 -1
- package/dist/ripple/p-803f1f22.entry.js +0 -1
- package/dist/ripple/p-84fb34b5.entry.js +0 -1
- package/dist/ripple/p-8a583f84.entry.js +0 -1
- package/dist/ripple/p-8daa2613.system.entry.js +0 -1
- package/dist/ripple/p-935a266f.entry.js +0 -1
- package/dist/ripple/p-9d02957d.system.js +0 -1
- package/dist/ripple/p-a14ac623.entry.js +0 -1
- package/dist/ripple/p-b325c35a.system.entry.js +0 -1
- package/dist/ripple/p-bfe93d8d.system.entry.js +0 -1
- package/dist/ripple/p-c1c7b0b1.system.js +0 -15
- package/dist/ripple/p-c20a179f.system.entry.js +0 -1
- package/dist/ripple/p-c8bbf15e.entry.js +0 -1
- package/dist/ripple/p-cfb62ded.entry.js +0 -1
- package/dist/ripple/p-d12e0f49.system.js +0 -1
- package/dist/ripple/p-d648d193.entry.js +0 -1
- package/dist/ripple/p-d7ff84eb.entry.js +0 -1
- package/dist/ripple/p-e90f6915.system.js +0 -1
- package/dist/ripple/p-f2566a42.system.entry.js +0 -1
- package/dist/ripple/p-f62fc5ea.system.entry.js +0 -1
- package/dist/ripple/p-fe0abd10.system.entry.js +0 -1
- package/dist/ripple/p-fe2a30d3.entry.js +0 -1
- package/dist/ripple/p-ffbc5db3.entry.js +0 -1
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +0 -27
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +0 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +0 -17
|
@@ -891,6 +891,12 @@ const en = {
|
|
|
891
891
|
type: 0,
|
|
892
892
|
value: "%"
|
|
893
893
|
}
|
|
894
|
+
],
|
|
895
|
+
"uploader.waitToUpload": [
|
|
896
|
+
{
|
|
897
|
+
type: 0,
|
|
898
|
+
value: "Please wait for current upload to complete before uploading new files."
|
|
899
|
+
}
|
|
894
900
|
]
|
|
895
901
|
};
|
|
896
902
|
|
|
@@ -3547,6 +3553,12 @@ const pig = {
|
|
|
3547
3553
|
type: 0,
|
|
3548
3554
|
value: "%"
|
|
3549
3555
|
}
|
|
3556
|
+
],
|
|
3557
|
+
"uploader.waitToUpload": [
|
|
3558
|
+
{
|
|
3559
|
+
type: 0,
|
|
3560
|
+
value: "Easeplay aitway orfay urrentcay uploadyay otay ompletecay eforebay uploadingyay ewnay ilesfay."
|
|
3561
|
+
}
|
|
3550
3562
|
]
|
|
3551
3563
|
};
|
|
3552
3564
|
|
|
@@ -3914,11 +3926,17 @@ function icuUnitToEcma(unit) {
|
|
|
3914
3926
|
return unit.replace(/^(.*?)-/, '');
|
|
3915
3927
|
}
|
|
3916
3928
|
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3917
|
-
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
3929
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
3918
3930
|
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3919
3931
|
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
3920
3932
|
function parseSignificantPrecision(str) {
|
|
3921
3933
|
var result = {};
|
|
3934
|
+
if (str[str.length - 1] === 'r') {
|
|
3935
|
+
result.roundingPriority = 'morePrecision';
|
|
3936
|
+
}
|
|
3937
|
+
else if (str[str.length - 1] === 's') {
|
|
3938
|
+
result.roundingPriority = 'lessPrecision';
|
|
3939
|
+
}
|
|
3922
3940
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
|
|
3923
3941
|
// @@@ case
|
|
3924
3942
|
if (typeof g2 !== 'string') {
|
|
@@ -4145,8 +4163,13 @@ function parseNumberSkeleton(tokens) {
|
|
|
4145
4163
|
}
|
|
4146
4164
|
return '';
|
|
4147
4165
|
});
|
|
4148
|
-
|
|
4149
|
-
|
|
4166
|
+
var opt = token.options[0];
|
|
4167
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
4168
|
+
if (opt === 'w') {
|
|
4169
|
+
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
|
|
4170
|
+
}
|
|
4171
|
+
else if (opt) {
|
|
4172
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
4150
4173
|
}
|
|
4151
4174
|
continue;
|
|
4152
4175
|
}
|
|
@@ -4168,8 +4191,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4168
4191
|
}
|
|
4169
4192
|
|
|
4170
4193
|
var _a;
|
|
4171
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
4172
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source
|
|
4194
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
4195
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
4173
4196
|
function createLocation(start, end) {
|
|
4174
4197
|
return { start: start, end: end };
|
|
4175
4198
|
}
|
|
@@ -4416,7 +4439,7 @@ var Parser = /** @class */ (function () {
|
|
|
4416
4439
|
return {
|
|
4417
4440
|
val: {
|
|
4418
4441
|
type: TYPE.literal,
|
|
4419
|
-
value: "<"
|
|
4442
|
+
value: "<".concat(tagName, "/>"),
|
|
4420
4443
|
location: createLocation(startPosition, this.clonePosition()),
|
|
4421
4444
|
},
|
|
4422
4445
|
err: null,
|
|
@@ -5021,7 +5044,7 @@ var Parser = /** @class */ (function () {
|
|
|
5021
5044
|
}
|
|
5022
5045
|
var code = codePointAt(this.message, offset);
|
|
5023
5046
|
if (code === undefined) {
|
|
5024
|
-
throw Error("Offset "
|
|
5047
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
5025
5048
|
}
|
|
5026
5049
|
return code;
|
|
5027
5050
|
};
|
|
@@ -5089,7 +5112,7 @@ var Parser = /** @class */ (function () {
|
|
|
5089
5112
|
*/
|
|
5090
5113
|
Parser.prototype.bumpTo = function (targetOffset) {
|
|
5091
5114
|
if (this.offset() > targetOffset) {
|
|
5092
|
-
throw Error("targetOffset "
|
|
5115
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
5093
5116
|
}
|
|
5094
5117
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
5095
5118
|
while (true) {
|
|
@@ -5098,7 +5121,7 @@ var Parser = /** @class */ (function () {
|
|
|
5098
5121
|
break;
|
|
5099
5122
|
}
|
|
5100
5123
|
if (offset > targetOffset) {
|
|
5101
|
-
throw Error("targetOffset "
|
|
5124
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
5102
5125
|
}
|
|
5103
5126
|
this.bump();
|
|
5104
5127
|
if (this.isEOF()) {
|
|
@@ -5564,28 +5587,28 @@ var FormatError = /** @class */ (function (_super) {
|
|
|
5564
5587
|
return _this;
|
|
5565
5588
|
}
|
|
5566
5589
|
FormatError.prototype.toString = function () {
|
|
5567
|
-
return "[formatjs Error: "
|
|
5590
|
+
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
5568
5591
|
};
|
|
5569
5592
|
return FormatError;
|
|
5570
5593
|
}(Error));
|
|
5571
5594
|
var InvalidValueError = /** @class */ (function (_super) {
|
|
5572
5595
|
__extends(InvalidValueError, _super);
|
|
5573
5596
|
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
5574
|
-
return _super.call(this, "Invalid values for \""
|
|
5597
|
+
return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5575
5598
|
}
|
|
5576
5599
|
return InvalidValueError;
|
|
5577
5600
|
}(FormatError));
|
|
5578
5601
|
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
5579
5602
|
__extends(InvalidValueTypeError, _super);
|
|
5580
5603
|
function InvalidValueTypeError(value, type, originalMessage) {
|
|
5581
|
-
return _super.call(this, "Value for \""
|
|
5604
|
+
return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5582
5605
|
}
|
|
5583
5606
|
return InvalidValueTypeError;
|
|
5584
5607
|
}(FormatError));
|
|
5585
5608
|
var MissingValueError = /** @class */ (function (_super) {
|
|
5586
5609
|
__extends(MissingValueError, _super);
|
|
5587
5610
|
function MissingValueError(variableId, originalMessage) {
|
|
5588
|
-
return _super.call(this, "The intl string context variable \""
|
|
5611
|
+
return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
5589
5612
|
}
|
|
5590
5613
|
return MissingValueError;
|
|
5591
5614
|
}(FormatError));
|
|
@@ -5746,7 +5769,7 @@ originalMessage) {
|
|
|
5746
5769
|
continue;
|
|
5747
5770
|
}
|
|
5748
5771
|
if (isPluralElement(el)) {
|
|
5749
|
-
var opt = el.options["="
|
|
5772
|
+
var opt = el.options["=".concat(value)];
|
|
5750
5773
|
if (!opt) {
|
|
5751
5774
|
if (!Intl.PluralRules) {
|
|
5752
5775
|
throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -5817,7 +5840,7 @@ function createDefaultFormatters(cache) {
|
|
|
5817
5840
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5818
5841
|
args[_i] = arguments[_i];
|
|
5819
5842
|
}
|
|
5820
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5843
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5821
5844
|
}, {
|
|
5822
5845
|
cache: createFastMemoizeCache$1(cache.number),
|
|
5823
5846
|
strategy: strategies.variadic,
|
|
@@ -5828,7 +5851,7 @@ function createDefaultFormatters(cache) {
|
|
|
5828
5851
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5829
5852
|
args[_i] = arguments[_i];
|
|
5830
5853
|
}
|
|
5831
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5854
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5832
5855
|
}, {
|
|
5833
5856
|
cache: createFastMemoizeCache$1(cache.dateTime),
|
|
5834
5857
|
strategy: strategies.variadic,
|
|
@@ -5839,7 +5862,7 @@ function createDefaultFormatters(cache) {
|
|
|
5839
5862
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5840
5863
|
args[_i] = arguments[_i];
|
|
5841
5864
|
}
|
|
5842
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5865
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5843
5866
|
}, {
|
|
5844
5867
|
cache: createFastMemoizeCache$1(cache.pluralRules),
|
|
5845
5868
|
strategy: strategies.variadic,
|
|
@@ -5997,7 +6020,13 @@ var IntlErrorCode;
|
|
|
5997
6020
|
var IntlError = /** @class */ (function (_super) {
|
|
5998
6021
|
__extends(IntlError, _super);
|
|
5999
6022
|
function IntlError(code, message, exception) {
|
|
6000
|
-
var _this =
|
|
6023
|
+
var _this = this;
|
|
6024
|
+
var err = exception
|
|
6025
|
+
? exception instanceof Error
|
|
6026
|
+
? exception
|
|
6027
|
+
: new Error(String(exception))
|
|
6028
|
+
: undefined;
|
|
6029
|
+
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
|
|
6001
6030
|
_this.code = code;
|
|
6002
6031
|
// @ts-ignore just so we don't need to declare dep on @types/node
|
|
6003
6032
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -6029,19 +6058,26 @@ var MissingDataError = /** @class */ (function (_super) {
|
|
|
6029
6058
|
}
|
|
6030
6059
|
return MissingDataError;
|
|
6031
6060
|
}(IntlError));
|
|
6061
|
+
var IntlFormatError = /** @class */ (function (_super) {
|
|
6062
|
+
__extends(IntlFormatError, _super);
|
|
6063
|
+
function IntlFormatError(message, locale, exception) {
|
|
6064
|
+
return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
|
|
6065
|
+
}
|
|
6066
|
+
return IntlFormatError;
|
|
6067
|
+
}(IntlError));
|
|
6032
6068
|
var MessageFormatError = /** @class */ (function (_super) {
|
|
6033
6069
|
__extends(MessageFormatError, _super);
|
|
6034
6070
|
function MessageFormatError(message, locale, descriptor, exception) {
|
|
6035
|
-
var _this = _super.call(this,
|
|
6071
|
+
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;
|
|
6036
6072
|
_this.descriptor = descriptor;
|
|
6037
6073
|
return _this;
|
|
6038
6074
|
}
|
|
6039
6075
|
return MessageFormatError;
|
|
6040
|
-
}(
|
|
6076
|
+
}(IntlFormatError));
|
|
6041
6077
|
var MissingTranslationError = /** @class */ (function (_super) {
|
|
6042
6078
|
__extends(MissingTranslationError, _super);
|
|
6043
6079
|
function MissingTranslationError(descriptor, locale) {
|
|
6044
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \""
|
|
6080
|
+
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;
|
|
6045
6081
|
_this.descriptor = descriptor;
|
|
6046
6082
|
return _this;
|
|
6047
6083
|
}
|
|
@@ -6068,6 +6104,7 @@ var DEFAULT_INTL_CONFIG = {
|
|
|
6068
6104
|
timeZone: undefined,
|
|
6069
6105
|
defaultLocale: 'en',
|
|
6070
6106
|
defaultFormats: {},
|
|
6107
|
+
fallbackOnEmptyString: true,
|
|
6071
6108
|
onError: defaultErrorHandler,
|
|
6072
6109
|
};
|
|
6073
6110
|
function createIntlCache() {
|
|
@@ -6110,7 +6147,7 @@ function createFormatters(cache) {
|
|
|
6110
6147
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6111
6148
|
args[_i] = arguments[_i];
|
|
6112
6149
|
}
|
|
6113
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6150
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6114
6151
|
}, {
|
|
6115
6152
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
6116
6153
|
strategy: strategies.variadic,
|
|
@@ -6121,7 +6158,7 @@ function createFormatters(cache) {
|
|
|
6121
6158
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6122
6159
|
args[_i] = arguments[_i];
|
|
6123
6160
|
}
|
|
6124
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6161
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6125
6162
|
}, {
|
|
6126
6163
|
cache: createFastMemoizeCache(cache.number),
|
|
6127
6164
|
strategy: strategies.variadic,
|
|
@@ -6132,7 +6169,7 @@ function createFormatters(cache) {
|
|
|
6132
6169
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6133
6170
|
args[_i] = arguments[_i];
|
|
6134
6171
|
}
|
|
6135
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6172
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6136
6173
|
}, {
|
|
6137
6174
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
6138
6175
|
strategy: strategies.variadic,
|
|
@@ -6155,7 +6192,7 @@ function createFormatters(cache) {
|
|
|
6155
6192
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6156
6193
|
args[_i] = arguments[_i];
|
|
6157
6194
|
}
|
|
6158
|
-
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
|
|
6195
|
+
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();
|
|
6159
6196
|
}, {
|
|
6160
6197
|
cache: createFastMemoizeCache(cache.relativeTime),
|
|
6161
6198
|
strategy: strategies.variadic,
|
|
@@ -6166,7 +6203,7 @@ function createFormatters(cache) {
|
|
|
6166
6203
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6167
6204
|
args[_i] = arguments[_i];
|
|
6168
6205
|
}
|
|
6169
|
-
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
|
|
6206
|
+
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();
|
|
6170
6207
|
}, {
|
|
6171
6208
|
cache: createFastMemoizeCache(cache.list),
|
|
6172
6209
|
strategy: strategies.variadic,
|
|
@@ -6176,7 +6213,7 @@ function createFormatters(cache) {
|
|
|
6176
6213
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6177
6214
|
args[_i] = arguments[_i];
|
|
6178
6215
|
}
|
|
6179
|
-
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
|
|
6216
|
+
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();
|
|
6180
6217
|
}, {
|
|
6181
6218
|
cache: createFastMemoizeCache(cache.displayNames),
|
|
6182
6219
|
strategy: strategies.variadic,
|
|
@@ -6192,7 +6229,7 @@ function getNamedFormat(formats, type, name, onError) {
|
|
|
6192
6229
|
if (format) {
|
|
6193
6230
|
return format;
|
|
6194
6231
|
}
|
|
6195
|
-
onError(new UnsupportedFormatterError("No "
|
|
6232
|
+
onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
|
|
6196
6233
|
}
|
|
6197
6234
|
|
|
6198
6235
|
/**
|
|
@@ -6227,7 +6264,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
6227
6264
|
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)) });
|
|
6228
6265
|
}
|
|
6229
6266
|
function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
6230
|
-
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;
|
|
6267
|
+
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;
|
|
6231
6268
|
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
|
|
6232
6269
|
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
|
|
6233
6270
|
// `id` is a required field of a Message Descriptor.
|
|
@@ -6257,6 +6294,9 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6257
6294
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
6258
6295
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
6259
6296
|
if (!message) {
|
|
6297
|
+
if (fallbackOnEmptyString === false && message === '') {
|
|
6298
|
+
return message;
|
|
6299
|
+
}
|
|
6260
6300
|
if (!defaultMessage ||
|
|
6261
6301
|
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
6262
6302
|
// This prevents warnings from littering the console in development
|
|
@@ -6270,7 +6310,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6270
6310
|
return formatter.format(values);
|
|
6271
6311
|
}
|
|
6272
6312
|
catch (e) {
|
|
6273
|
-
onError(new MessageFormatError("Error formatting default message for: \""
|
|
6313
|
+
onError(new MessageFormatError("Error formatting default message for: \"".concat(id, "\", rendering default message verbatim"), locale, messageDescriptor, e));
|
|
6274
6314
|
return typeof defaultMessage === 'string' ? defaultMessage : id;
|
|
6275
6315
|
}
|
|
6276
6316
|
}
|
|
@@ -6282,7 +6322,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6282
6322
|
return formatter.format(values);
|
|
6283
6323
|
}
|
|
6284
6324
|
catch (e) {
|
|
6285
|
-
onError(new MessageFormatError("Error formatting message: \""
|
|
6325
|
+
onError(new MessageFormatError("Error formatting message: \"".concat(id, "\", using ").concat(defaultMessage ? 'default message' : 'id', " as fallback."), locale, messageDescriptor, e));
|
|
6286
6326
|
}
|
|
6287
6327
|
if (defaultMessage) {
|
|
6288
6328
|
try {
|
|
@@ -6290,7 +6330,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6290
6330
|
return formatter.format(values);
|
|
6291
6331
|
}
|
|
6292
6332
|
catch (e) {
|
|
6293
|
-
onError(new MessageFormatError("Error formatting the default message for: \""
|
|
6333
|
+
onError(new MessageFormatError("Error formatting the default message for: \"".concat(id, "\", rendering message verbatim"), locale, messageDescriptor, e));
|
|
6294
6334
|
}
|
|
6295
6335
|
}
|
|
6296
6336
|
if (typeof message === 'string') {
|
|
@@ -6328,9 +6368,7 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
|
|
|
6328
6368
|
if (options === void 0) { options = {}; }
|
|
6329
6369
|
var format = options.format;
|
|
6330
6370
|
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
|
|
6331
|
-
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6332
|
-
// @ts-expect-error es2020 has a lot stuff from es2021 bleed in
|
|
6333
|
-
defaults);
|
|
6371
|
+
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
|
|
6334
6372
|
if (type === 'time' &&
|
|
6335
6373
|
!filteredOptions.hour &&
|
|
6336
6374
|
!filteredOptions.minute &&
|
|
@@ -6447,7 +6485,7 @@ var LIST_FORMAT_OPTIONS = [
|
|
|
6447
6485
|
];
|
|
6448
6486
|
var now = Date.now();
|
|
6449
6487
|
function generateToken(i) {
|
|
6450
|
-
return now
|
|
6488
|
+
return "".concat(now, "_").concat(i, "_").concat(now);
|
|
6451
6489
|
}
|
|
6452
6490
|
function formatList(opts, getListFormat, values, options) {
|
|
6453
6491
|
if (options === void 0) { options = {}; }
|
|
@@ -6514,7 +6552,7 @@ function formatPlural(_a, getPluralRules, value, options) {
|
|
|
6514
6552
|
return getPluralRules(locale, filteredOptions).select(value);
|
|
6515
6553
|
}
|
|
6516
6554
|
catch (e) {
|
|
6517
|
-
onError(new
|
|
6555
|
+
onError(new IntlFormatError('Error formatting plural.', locale, e));
|
|
6518
6556
|
}
|
|
6519
6557
|
return 'other';
|
|
6520
6558
|
}
|
|
@@ -6541,7 +6579,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
|
|
|
6541
6579
|
return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
|
|
6542
6580
|
}
|
|
6543
6581
|
catch (e) {
|
|
6544
|
-
config.onError(new
|
|
6582
|
+
config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));
|
|
6545
6583
|
}
|
|
6546
6584
|
return String(value);
|
|
6547
6585
|
}
|
|
@@ -6621,7 +6659,7 @@ function createIntl(config, cache) {
|
|
|
6621
6659
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
6622
6660
|
if (!locale) {
|
|
6623
6661
|
if (onError) {
|
|
6624
|
-
onError(new InvalidConfigError("\"locale\" was not configured, using \""
|
|
6662
|
+
onError(new InvalidConfigError("\"locale\" was not configured, using \"".concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details")));
|
|
6625
6663
|
}
|
|
6626
6664
|
// Since there's no registered locale data for `locale`, this will
|
|
6627
6665
|
// fallback to the `defaultLocale` to make sure things can render.
|
|
@@ -6631,481 +6669,481 @@ function createIntl(config, cache) {
|
|
|
6631
6669
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
6632
6670
|
}
|
|
6633
6671
|
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
6634
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6672
|
+
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")));
|
|
6635
6673
|
}
|
|
6636
6674
|
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
|
|
6637
6675
|
onError) {
|
|
6638
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6676
|
+
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")));
|
|
6639
6677
|
}
|
|
6640
6678
|
verifyConfigMessages(resolvedConfig);
|
|
6641
6679
|
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) });
|
|
6642
6680
|
}
|
|
6643
6681
|
|
|
6644
|
-
const DEFAULT_LANGUAGE = "en";
|
|
6645
|
-
function getBrowserLang() {
|
|
6646
|
-
const langAttr = document.documentElement.getAttribute("lang");
|
|
6647
|
-
if (!!langAttr) {
|
|
6648
|
-
return langAttr;
|
|
6649
|
-
}
|
|
6650
|
-
else if (window.navigator && window.navigator.language) {
|
|
6651
|
-
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6652
|
-
return lang.slice(0, 2);
|
|
6653
|
-
}
|
|
6654
|
-
else {
|
|
6655
|
-
return DEFAULT_LANGUAGE;
|
|
6656
|
-
}
|
|
6657
|
-
}
|
|
6658
|
-
// prevents memory leak
|
|
6659
|
-
const cache = createIntlCache();
|
|
6660
|
-
const locale = getBrowserLang();
|
|
6661
|
-
const intl = createIntl({
|
|
6662
|
-
locale: locale,
|
|
6663
|
-
defaultLocale: "en",
|
|
6664
|
-
messages: lang[locale] || en,
|
|
6665
|
-
}, cache);
|
|
6666
|
-
function generateId() {
|
|
6667
|
-
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6668
|
-
}
|
|
6669
|
-
// limits how many times a function fires
|
|
6670
|
-
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6671
|
-
function throttle(fn, wait) {
|
|
6672
|
-
let timeout;
|
|
6673
|
-
let shouldWait = false;
|
|
6674
|
-
return function () {
|
|
6675
|
-
const context = this;
|
|
6676
|
-
if (!shouldWait) {
|
|
6677
|
-
fn.apply(context, arguments);
|
|
6678
|
-
shouldWait = true;
|
|
6679
|
-
clearTimeout(timeout);
|
|
6680
|
-
timeout = setTimeout(function () {
|
|
6681
|
-
shouldWait = false;
|
|
6682
|
-
}, wait);
|
|
6683
|
-
}
|
|
6684
|
-
};
|
|
6685
|
-
}
|
|
6686
|
-
// waits until it hasn't been called for [timeout] ms.
|
|
6687
|
-
// use when the function should run only after something (event) is done firing
|
|
6688
|
-
function debounce(fn, wait) {
|
|
6689
|
-
let timeout;
|
|
6690
|
-
return function () {
|
|
6691
|
-
const context = this;
|
|
6692
|
-
const functionCall = () => fn.apply(context, arguments);
|
|
6693
|
-
clearTimeout(timeout);
|
|
6694
|
-
timeout = setTimeout(functionCall, wait);
|
|
6695
|
-
};
|
|
6696
|
-
}
|
|
6697
|
-
function getTextDir() {
|
|
6698
|
-
const dir = document.querySelector("html").getAttribute("dir");
|
|
6699
|
-
return dir ? dir.toLowerCase() : "";
|
|
6700
|
-
}
|
|
6701
|
-
function getPosition(el) {
|
|
6702
|
-
const coords = el.getBoundingClientRect();
|
|
6703
|
-
let x = coords.x;
|
|
6704
|
-
let y = coords.y;
|
|
6705
|
-
// Edge doesn't have x and y
|
|
6706
|
-
if (!x) {
|
|
6707
|
-
if (getTextDir() === "rtl") {
|
|
6708
|
-
x = coords.right;
|
|
6709
|
-
}
|
|
6710
|
-
else {
|
|
6711
|
-
x = coords.left;
|
|
6712
|
-
}
|
|
6713
|
-
y = coords.top;
|
|
6714
|
-
}
|
|
6715
|
-
return { x, y };
|
|
6716
|
-
}
|
|
6717
|
-
function findParentWithScrollbar(el) {
|
|
6718
|
-
while (!!el) {
|
|
6719
|
-
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6720
|
-
return el;
|
|
6721
|
-
}
|
|
6722
|
-
el = el.parentElement;
|
|
6723
|
-
}
|
|
6724
|
-
}
|
|
6725
|
-
function findParentWithHiddenOverflow(el) {
|
|
6726
|
-
while (!!el) {
|
|
6727
|
-
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6728
|
-
return el;
|
|
6729
|
-
}
|
|
6730
|
-
el = el.parentElement;
|
|
6731
|
-
}
|
|
6732
|
-
}
|
|
6733
|
-
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6734
|
-
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6735
|
-
// if parent is not found, measurements are checked against the viewport
|
|
6736
|
-
return {
|
|
6737
|
-
closableElHeight: closableEl.clientHeight,
|
|
6738
|
-
closableElWidth: closableEl.clientWidth,
|
|
6739
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6740
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6741
|
-
spaceAbove: parent
|
|
6742
|
-
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6743
|
-
: fixedEl.getBoundingClientRect().top,
|
|
6744
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6745
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6746
|
-
spaceBelow: parent
|
|
6747
|
-
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6748
|
-
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6749
|
-
spaceLeft: parent
|
|
6750
|
-
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6751
|
-
: fixedEl.getBoundingClientRect().left,
|
|
6752
|
-
spaceRight: parent
|
|
6753
|
-
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6754
|
-
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6755
|
-
};
|
|
6756
|
-
}
|
|
6757
|
-
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6758
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6759
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6760
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6761
|
-
) {
|
|
6762
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6763
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6764
|
-
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6765
|
-
return openUp;
|
|
6766
|
-
}
|
|
6767
|
-
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6768
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6769
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6770
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6771
|
-
) {
|
|
6772
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6773
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6774
|
-
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6775
|
-
return openDown;
|
|
6776
|
-
}
|
|
6777
|
-
function shouldShiftRight(fixedEl, closableEl) {
|
|
6778
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6779
|
-
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6780
|
-
return needsSpaceLeft;
|
|
6781
|
-
}
|
|
6782
|
-
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6783
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6784
|
-
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6785
|
-
return needsSpaceRight;
|
|
6786
|
-
}
|
|
6787
|
-
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6788
|
-
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6789
|
-
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6790
|
-
tooltipEl.style.top = "";
|
|
6791
|
-
tooltipEl.style.left = "";
|
|
6792
|
-
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6793
|
-
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6794
|
-
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6795
|
-
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6796
|
-
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6797
|
-
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6798
|
-
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6799
|
-
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6800
|
-
const swapAbove = (position) => {
|
|
6801
|
-
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6802
|
-
};
|
|
6803
|
-
const swapBelow = (position) => {
|
|
6804
|
-
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6805
|
-
};
|
|
6806
|
-
const swapLeft = (position, centeredPosition) => {
|
|
6807
|
-
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6808
|
-
position = position.replace("left", "right");
|
|
6809
|
-
}
|
|
6810
|
-
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6811
|
-
position = centeredPosition;
|
|
6812
|
-
}
|
|
6813
|
-
return position;
|
|
6814
|
-
};
|
|
6815
|
-
const swapRight = (position, centeredPosition) => {
|
|
6816
|
-
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6817
|
-
position = position.replace("right", "left");
|
|
6818
|
-
}
|
|
6819
|
-
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6820
|
-
position = centeredPosition;
|
|
6821
|
-
}
|
|
6822
|
-
return position;
|
|
6823
|
-
};
|
|
6824
|
-
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6825
|
-
switch (tPos) {
|
|
6826
|
-
case "left":
|
|
6827
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6828
|
-
case "right":
|
|
6829
|
-
tPos = swapRight(tPos, "bottom");
|
|
6830
|
-
case "top-left":
|
|
6831
|
-
tPos = swapLeft(tPos, "top");
|
|
6832
|
-
tPos = swapAbove(tPos);
|
|
6833
|
-
case "top-right":
|
|
6834
|
-
tPos = swapRight(tPos, "top");
|
|
6835
|
-
tPos = swapAbove(tPos);
|
|
6836
|
-
case "bottom-left":
|
|
6837
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6838
|
-
tPos = swapBelow(tPos);
|
|
6839
|
-
case "bottom-right":
|
|
6840
|
-
tPos = swapRight(tPos, "bottom");
|
|
6841
|
-
tPos = swapBelow(tPos);
|
|
6842
|
-
case "top":
|
|
6843
|
-
tPos = swapAbove(tPos);
|
|
6844
|
-
case "bottom":
|
|
6845
|
-
tPos = swapBelow(tPos);
|
|
6846
|
-
}
|
|
6847
|
-
return tPos;
|
|
6848
|
-
}
|
|
6849
|
-
function hasRoomRight(x, spaceNeeded) {
|
|
6850
|
-
let horizOffset = 0;
|
|
6851
|
-
// if (getTextDir() === "ltr") {
|
|
6852
|
-
if (x.type === "click") {
|
|
6853
|
-
// if it's a mouse event, deal with mouse coords
|
|
6854
|
-
horizOffset = x.clientX;
|
|
6855
|
-
// if it's a focus event, the offset is 0
|
|
6856
|
-
}
|
|
6857
|
-
else if (x.type === "focus") {
|
|
6858
|
-
horizOffset = 0;
|
|
6859
|
-
}
|
|
6860
|
-
else {
|
|
6861
|
-
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6862
|
-
let el = x; // re-assignment is for clarity
|
|
6863
|
-
while (el) {
|
|
6864
|
-
if (el.tagName == "BODY") {
|
|
6865
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
6866
|
-
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6867
|
-
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6868
|
-
}
|
|
6869
|
-
else {
|
|
6870
|
-
// for all other non-BODY elements
|
|
6871
|
-
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6872
|
-
}
|
|
6873
|
-
el = el.offsetParent;
|
|
6874
|
-
}
|
|
6875
|
-
// }
|
|
6876
|
-
}
|
|
6877
|
-
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6878
|
-
}
|
|
6879
|
-
function checkForActiveElInShadow(element) {
|
|
6880
|
-
while (element && element.shadowRoot) {
|
|
6881
|
-
element = element.shadowRoot.activeElement;
|
|
6882
|
-
}
|
|
6883
|
-
return element;
|
|
6884
|
-
}
|
|
6885
|
-
function checkForFocusableElInShadow(element) {
|
|
6886
|
-
const selectors = [
|
|
6887
|
-
"button",
|
|
6888
|
-
"a",
|
|
6889
|
-
"input",
|
|
6890
|
-
"select",
|
|
6891
|
-
"textarea",
|
|
6892
|
-
"wm-button",
|
|
6893
|
-
"wm-search",
|
|
6894
|
-
"wm-select",
|
|
6895
|
-
"wm-action-menu",
|
|
6896
|
-
"wm-tab-item",
|
|
6897
|
-
"wm-datepicker",
|
|
6898
|
-
];
|
|
6899
|
-
let focusableEl = element;
|
|
6900
|
-
selectors.forEach((selector) => {
|
|
6901
|
-
if (focusableEl && focusableEl.shadowRoot) {
|
|
6902
|
-
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6903
|
-
if (elInShadow) {
|
|
6904
|
-
if (selector.startsWith("wm-")) {
|
|
6905
|
-
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6906
|
-
}
|
|
6907
|
-
else {
|
|
6908
|
-
focusableEl = elInShadow;
|
|
6909
|
-
}
|
|
6910
|
-
}
|
|
6911
|
-
}
|
|
6912
|
-
});
|
|
6913
|
-
return focusableEl;
|
|
6914
|
-
}
|
|
6915
|
-
function isFocusable(element) {
|
|
6916
|
-
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6917
|
-
return true;
|
|
6918
|
-
}
|
|
6919
|
-
if (element.disabled) {
|
|
6920
|
-
return false;
|
|
6921
|
-
}
|
|
6922
|
-
switch (element.nodeName) {
|
|
6923
|
-
case "A":
|
|
6924
|
-
return !!element.href && element.rel != "ignore";
|
|
6925
|
-
case "INPUT":
|
|
6926
|
-
return element.type != "hidden" && element.type != "file";
|
|
6927
|
-
case "BUTTON":
|
|
6928
|
-
case "SELECT":
|
|
6929
|
-
case "TEXTAREA":
|
|
6930
|
-
case "WM-BUTTON":
|
|
6931
|
-
case "WM-SELECT":
|
|
6932
|
-
case "WM-ACTION-MENU":
|
|
6933
|
-
case "WM-DATEPICKER":
|
|
6934
|
-
case "WM-TIMEPICKER":
|
|
6935
|
-
case "WM-INPUT":
|
|
6936
|
-
case "WM-TAG-INPUT":
|
|
6937
|
-
case "WM-TAB-ITEM":
|
|
6938
|
-
case "WM-SEARCH":
|
|
6939
|
-
return true;
|
|
6940
|
-
default:
|
|
6941
|
-
return false;
|
|
6942
|
-
}
|
|
6943
|
-
}
|
|
6944
|
-
function getFirstFocusableDescendant(element) {
|
|
6945
|
-
if (isFocusable(element)) {
|
|
6946
|
-
return checkForFocusableElInShadow(element);
|
|
6947
|
-
}
|
|
6948
|
-
else if (element.childNodes.length > 0) {
|
|
6949
|
-
element.childNodes.forEach((i) => {
|
|
6950
|
-
const childEl = getFirstFocusableDescendant(i);
|
|
6951
|
-
return childEl && checkForFocusableElInShadow(childEl);
|
|
6952
|
-
});
|
|
6953
|
-
}
|
|
6954
|
-
}
|
|
6955
|
-
function hasValidType(file, types) {
|
|
6956
|
-
const acceptedExtensions = types.split(" ");
|
|
6957
|
-
const parts = file.name && file.name.split(".");
|
|
6958
|
-
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6959
|
-
return ext
|
|
6960
|
-
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6961
|
-
: // fallback: if we couldn't obtain an extension,
|
|
6962
|
-
// validate based on MIME type...
|
|
6963
|
-
!!file.type
|
|
6964
|
-
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
6965
|
-
: // ...and if that failed too, accept the file
|
|
6966
|
-
// as it's preferable to accept an invalid file
|
|
6967
|
-
// than refusing a valid one (back-end will take care of what slips through)
|
|
6968
|
-
true;
|
|
6969
|
-
}
|
|
6970
|
-
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
6971
|
-
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
6972
|
-
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
6973
|
-
// front end checks are just a convenience to users, independent of security.
|
|
6974
|
-
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
6975
|
-
const lookupTable = {
|
|
6976
|
-
aac: ["audio/aac"],
|
|
6977
|
-
abw: ["application/x-abiword"],
|
|
6978
|
-
arc: ["application/x-freearc"],
|
|
6979
|
-
avi: ["video/x-msvideo"],
|
|
6980
|
-
azw: ["application/vnd.amazon.ebook"],
|
|
6981
|
-
bin: ["application/octet-stream"],
|
|
6982
|
-
bmp: ["image/bmp"],
|
|
6983
|
-
bz: ["application/x-bzip"],
|
|
6984
|
-
bz2: ["application/x-bzip2"],
|
|
6985
|
-
csh: ["application/x-csh"],
|
|
6986
|
-
css: ["text/css"],
|
|
6987
|
-
csv: ["text/csv"],
|
|
6988
|
-
doc: ["application/msword"],
|
|
6989
|
-
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
6990
|
-
eot: ["application/vnd.ms-fontobject"],
|
|
6991
|
-
epub: ["application/epub+zip"],
|
|
6992
|
-
gz: ["application/gzip"],
|
|
6993
|
-
gif: ["image/gif"],
|
|
6994
|
-
htm: ["text/html"],
|
|
6995
|
-
html: ["text/html"],
|
|
6996
|
-
ico: ["image/vnd.microsoft.icon"],
|
|
6997
|
-
ics: ["text/calendar"],
|
|
6998
|
-
jar: ["application/java-archive"],
|
|
6999
|
-
jpeg: ["image/jpeg"],
|
|
7000
|
-
jpg: ["image/jpeg"],
|
|
7001
|
-
js: ["text/javascript"],
|
|
7002
|
-
json: ["application/json"],
|
|
7003
|
-
jsonld: ["application/ld+json"],
|
|
7004
|
-
log: ["text/plain"],
|
|
7005
|
-
mid: ["audio/x-midi"],
|
|
7006
|
-
midi: ["audio/x-midi"],
|
|
7007
|
-
mjs: ["text/javascript"],
|
|
7008
|
-
mp3: ["audio/mpeg"],
|
|
7009
|
-
mpeg: ["video/mpeg"],
|
|
7010
|
-
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7011
|
-
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7012
|
-
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7013
|
-
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7014
|
-
oga: ["audio/ogg"],
|
|
7015
|
-
ogv: ["video/ogg"],
|
|
7016
|
-
ogx: ["application/ogg"],
|
|
7017
|
-
opus: ["audio/opus"],
|
|
7018
|
-
otf: ["font/otf"],
|
|
7019
|
-
png: ["image/png"],
|
|
7020
|
-
pdf: ["application/pdf"],
|
|
7021
|
-
php: ["application/php"],
|
|
7022
|
-
ppt: ["application/vnd.ms-powerpoint"],
|
|
7023
|
-
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7024
|
-
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7025
|
-
rtf: ["application/rtf"],
|
|
7026
|
-
sh: ["application/x-sh"],
|
|
7027
|
-
svg: ["image/svg+xml"],
|
|
7028
|
-
swf: ["application/x-shockwave-flash"],
|
|
7029
|
-
tar: ["application/x-tar"],
|
|
7030
|
-
tif: ["image/tiff"],
|
|
7031
|
-
tiff: ["image/tiff"],
|
|
7032
|
-
ts: ["video/mp2t"],
|
|
7033
|
-
ttf: ["font/ttf"],
|
|
7034
|
-
txt: ["text/plain"],
|
|
7035
|
-
vsd: ["application/vnd.visio"],
|
|
7036
|
-
wav: ["audio/wav"],
|
|
7037
|
-
weba: ["audio/webm"],
|
|
7038
|
-
webm: ["video/webm"],
|
|
7039
|
-
webp: ["image/webp"],
|
|
7040
|
-
woff: ["font/woff"],
|
|
7041
|
-
woff2: ["font/woff2"],
|
|
7042
|
-
xhtml: ["application/xhtml+xml"],
|
|
7043
|
-
xls: ["application/vnd.ms-excel"],
|
|
7044
|
-
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7045
|
-
xml: ["application/xml", "text/xml"],
|
|
7046
|
-
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7047
|
-
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7048
|
-
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7049
|
-
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7050
|
-
"7z": ["application/x-7z-compressed"],
|
|
7051
|
-
};
|
|
7052
|
-
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7053
|
-
}
|
|
7054
|
-
function snakeCaseToCamelCase(str) {
|
|
7055
|
-
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7056
|
-
if (snakeCaseRegexp.test(str)) {
|
|
7057
|
-
let camelCase = "";
|
|
7058
|
-
let arr = str.split("_");
|
|
7059
|
-
arr.forEach((word, idx) => {
|
|
7060
|
-
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7061
|
-
});
|
|
7062
|
-
return camelCase;
|
|
7063
|
-
}
|
|
7064
|
-
else {
|
|
7065
|
-
return str;
|
|
7066
|
-
}
|
|
7067
|
-
}
|
|
7068
|
-
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7069
|
-
let newIndex = currentIndex;
|
|
7070
|
-
if (direction === "ArrowDown") {
|
|
7071
|
-
newIndex = (currentIndex + 1) % listLength;
|
|
7072
|
-
}
|
|
7073
|
-
if (direction === "ArrowUp") {
|
|
7074
|
-
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7075
|
-
}
|
|
7076
|
-
return newIndex;
|
|
7077
|
-
}
|
|
7078
|
-
function isRelatedTarget(ev, id) {
|
|
7079
|
-
// used for onBlur events to check the element that has been clicked
|
|
7080
|
-
const ids = id.split(" ");
|
|
7081
|
-
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7082
|
-
}
|
|
7083
|
-
function toBool(val) {
|
|
7084
|
-
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7085
|
-
return val == "false" ? false : !!val;
|
|
7086
|
-
}
|
|
7087
|
-
/*
|
|
7088
|
-
* this is going to be needed to solve the extra tabbing on navigator
|
|
7089
|
-
* and for programmatic focus of tabs
|
|
7090
|
-
* Here's a draft, not bug proof, see:
|
|
7091
|
-
* https://stackoverflow.com/a/10730308/3741713
|
|
7092
|
-
|
|
7093
|
-
function getKeyboardFocusableElements(element = document) {
|
|
7094
|
-
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'));
|
|
7095
|
-
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7096
|
-
}
|
|
7097
|
-
|
|
7098
|
-
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7099
|
-
const els = getKeyboardFocusableElements();
|
|
7100
|
-
const current = els.indexOf(element);
|
|
7101
|
-
return els[current - 1] as HTMLElement;
|
|
7102
|
-
}
|
|
7103
|
-
|
|
7104
|
-
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7105
|
-
const els = getKeyboardFocusableElements();
|
|
7106
|
-
const current = els.indexOf(element);
|
|
7107
|
-
return els[current + 1] as HTMLElement;
|
|
7108
|
-
}
|
|
6682
|
+
const DEFAULT_LANGUAGE = "en";
|
|
6683
|
+
function getBrowserLang() {
|
|
6684
|
+
const langAttr = document.documentElement.getAttribute("lang");
|
|
6685
|
+
if (!!langAttr) {
|
|
6686
|
+
return langAttr;
|
|
6687
|
+
}
|
|
6688
|
+
else if (window.navigator && window.navigator.language) {
|
|
6689
|
+
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6690
|
+
return lang.slice(0, 2);
|
|
6691
|
+
}
|
|
6692
|
+
else {
|
|
6693
|
+
return DEFAULT_LANGUAGE;
|
|
6694
|
+
}
|
|
6695
|
+
}
|
|
6696
|
+
// prevents memory leak
|
|
6697
|
+
const cache = createIntlCache();
|
|
6698
|
+
const locale = getBrowserLang();
|
|
6699
|
+
const intl = createIntl({
|
|
6700
|
+
locale: locale,
|
|
6701
|
+
defaultLocale: "en",
|
|
6702
|
+
messages: lang[locale] || en,
|
|
6703
|
+
}, cache);
|
|
6704
|
+
function generateId() {
|
|
6705
|
+
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6706
|
+
}
|
|
6707
|
+
// limits how many times a function fires
|
|
6708
|
+
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6709
|
+
function throttle(fn, wait) {
|
|
6710
|
+
let timeout;
|
|
6711
|
+
let shouldWait = false;
|
|
6712
|
+
return function () {
|
|
6713
|
+
const context = this;
|
|
6714
|
+
if (!shouldWait) {
|
|
6715
|
+
fn.apply(context, arguments);
|
|
6716
|
+
shouldWait = true;
|
|
6717
|
+
clearTimeout(timeout);
|
|
6718
|
+
timeout = setTimeout(function () {
|
|
6719
|
+
shouldWait = false;
|
|
6720
|
+
}, wait);
|
|
6721
|
+
}
|
|
6722
|
+
};
|
|
6723
|
+
}
|
|
6724
|
+
// waits until it hasn't been called for [timeout] ms.
|
|
6725
|
+
// use when the function should run only after something (event) is done firing
|
|
6726
|
+
function debounce(fn, wait) {
|
|
6727
|
+
let timeout;
|
|
6728
|
+
return function () {
|
|
6729
|
+
const context = this;
|
|
6730
|
+
const functionCall = () => fn.apply(context, arguments);
|
|
6731
|
+
clearTimeout(timeout);
|
|
6732
|
+
timeout = setTimeout(functionCall, wait);
|
|
6733
|
+
};
|
|
6734
|
+
}
|
|
6735
|
+
function getTextDir() {
|
|
6736
|
+
const dir = document.querySelector("html").getAttribute("dir");
|
|
6737
|
+
return dir ? dir.toLowerCase() : "";
|
|
6738
|
+
}
|
|
6739
|
+
function getPosition(el) {
|
|
6740
|
+
const coords = el.getBoundingClientRect();
|
|
6741
|
+
let x = coords.x;
|
|
6742
|
+
let y = coords.y;
|
|
6743
|
+
// Edge doesn't have x and y
|
|
6744
|
+
if (!x) {
|
|
6745
|
+
if (getTextDir() === "rtl") {
|
|
6746
|
+
x = coords.right;
|
|
6747
|
+
}
|
|
6748
|
+
else {
|
|
6749
|
+
x = coords.left;
|
|
6750
|
+
}
|
|
6751
|
+
y = coords.top;
|
|
6752
|
+
}
|
|
6753
|
+
return { x, y };
|
|
6754
|
+
}
|
|
6755
|
+
function findParentWithScrollbar(el) {
|
|
6756
|
+
while (!!el) {
|
|
6757
|
+
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6758
|
+
return el;
|
|
6759
|
+
}
|
|
6760
|
+
el = el.parentElement;
|
|
6761
|
+
}
|
|
6762
|
+
}
|
|
6763
|
+
function findParentWithHiddenOverflow(el) {
|
|
6764
|
+
while (!!el) {
|
|
6765
|
+
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6766
|
+
return el;
|
|
6767
|
+
}
|
|
6768
|
+
el = el.parentElement;
|
|
6769
|
+
}
|
|
6770
|
+
}
|
|
6771
|
+
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6772
|
+
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6773
|
+
// if parent is not found, measurements are checked against the viewport
|
|
6774
|
+
return {
|
|
6775
|
+
closableElHeight: closableEl.clientHeight,
|
|
6776
|
+
closableElWidth: closableEl.clientWidth,
|
|
6777
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6778
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6779
|
+
spaceAbove: parent
|
|
6780
|
+
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6781
|
+
: fixedEl.getBoundingClientRect().top,
|
|
6782
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6783
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6784
|
+
spaceBelow: parent
|
|
6785
|
+
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6786
|
+
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6787
|
+
spaceLeft: parent
|
|
6788
|
+
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6789
|
+
: fixedEl.getBoundingClientRect().left,
|
|
6790
|
+
spaceRight: parent
|
|
6791
|
+
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6792
|
+
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6793
|
+
};
|
|
6794
|
+
}
|
|
6795
|
+
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6796
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6797
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6798
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6799
|
+
) {
|
|
6800
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6801
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6802
|
+
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6803
|
+
return openUp;
|
|
6804
|
+
}
|
|
6805
|
+
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6806
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6807
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6808
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6809
|
+
) {
|
|
6810
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6811
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6812
|
+
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6813
|
+
return openDown;
|
|
6814
|
+
}
|
|
6815
|
+
function shouldShiftRight(fixedEl, closableEl) {
|
|
6816
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6817
|
+
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6818
|
+
return needsSpaceLeft;
|
|
6819
|
+
}
|
|
6820
|
+
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6821
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6822
|
+
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6823
|
+
return needsSpaceRight;
|
|
6824
|
+
}
|
|
6825
|
+
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6826
|
+
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6827
|
+
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6828
|
+
tooltipEl.style.top = "";
|
|
6829
|
+
tooltipEl.style.left = "";
|
|
6830
|
+
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6831
|
+
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6832
|
+
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6833
|
+
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6834
|
+
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6835
|
+
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6836
|
+
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6837
|
+
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6838
|
+
const swapAbove = (position) => {
|
|
6839
|
+
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6840
|
+
};
|
|
6841
|
+
const swapBelow = (position) => {
|
|
6842
|
+
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6843
|
+
};
|
|
6844
|
+
const swapLeft = (position, centeredPosition) => {
|
|
6845
|
+
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6846
|
+
position = position.replace("left", "right");
|
|
6847
|
+
}
|
|
6848
|
+
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6849
|
+
position = centeredPosition;
|
|
6850
|
+
}
|
|
6851
|
+
return position;
|
|
6852
|
+
};
|
|
6853
|
+
const swapRight = (position, centeredPosition) => {
|
|
6854
|
+
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6855
|
+
position = position.replace("right", "left");
|
|
6856
|
+
}
|
|
6857
|
+
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6858
|
+
position = centeredPosition;
|
|
6859
|
+
}
|
|
6860
|
+
return position;
|
|
6861
|
+
};
|
|
6862
|
+
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6863
|
+
switch (tPos) {
|
|
6864
|
+
case "left":
|
|
6865
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6866
|
+
case "right":
|
|
6867
|
+
tPos = swapRight(tPos, "bottom");
|
|
6868
|
+
case "top-left":
|
|
6869
|
+
tPos = swapLeft(tPos, "top");
|
|
6870
|
+
tPos = swapAbove(tPos);
|
|
6871
|
+
case "top-right":
|
|
6872
|
+
tPos = swapRight(tPos, "top");
|
|
6873
|
+
tPos = swapAbove(tPos);
|
|
6874
|
+
case "bottom-left":
|
|
6875
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6876
|
+
tPos = swapBelow(tPos);
|
|
6877
|
+
case "bottom-right":
|
|
6878
|
+
tPos = swapRight(tPos, "bottom");
|
|
6879
|
+
tPos = swapBelow(tPos);
|
|
6880
|
+
case "top":
|
|
6881
|
+
tPos = swapAbove(tPos);
|
|
6882
|
+
case "bottom":
|
|
6883
|
+
tPos = swapBelow(tPos);
|
|
6884
|
+
}
|
|
6885
|
+
return tPos;
|
|
6886
|
+
}
|
|
6887
|
+
function hasRoomRight(x, spaceNeeded) {
|
|
6888
|
+
let horizOffset = 0;
|
|
6889
|
+
// if (getTextDir() === "ltr") {
|
|
6890
|
+
if (x.type === "click") {
|
|
6891
|
+
// if it's a mouse event, deal with mouse coords
|
|
6892
|
+
horizOffset = x.clientX;
|
|
6893
|
+
// if it's a focus event, the offset is 0
|
|
6894
|
+
}
|
|
6895
|
+
else if (x.type === "focus") {
|
|
6896
|
+
horizOffset = 0;
|
|
6897
|
+
}
|
|
6898
|
+
else {
|
|
6899
|
+
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6900
|
+
let el = x; // re-assignment is for clarity
|
|
6901
|
+
while (el) {
|
|
6902
|
+
if (el.tagName == "BODY") {
|
|
6903
|
+
// deal with browser quirks with body/window/document and page scroll
|
|
6904
|
+
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6905
|
+
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6906
|
+
}
|
|
6907
|
+
else {
|
|
6908
|
+
// for all other non-BODY elements
|
|
6909
|
+
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6910
|
+
}
|
|
6911
|
+
el = el.offsetParent;
|
|
6912
|
+
}
|
|
6913
|
+
// }
|
|
6914
|
+
}
|
|
6915
|
+
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6916
|
+
}
|
|
6917
|
+
function checkForActiveElInShadow(element) {
|
|
6918
|
+
while (element && element.shadowRoot) {
|
|
6919
|
+
element = element.shadowRoot.activeElement;
|
|
6920
|
+
}
|
|
6921
|
+
return element;
|
|
6922
|
+
}
|
|
6923
|
+
function checkForFocusableElInShadow(element) {
|
|
6924
|
+
const selectors = [
|
|
6925
|
+
"button",
|
|
6926
|
+
"a",
|
|
6927
|
+
"input",
|
|
6928
|
+
"select",
|
|
6929
|
+
"textarea",
|
|
6930
|
+
"wm-button",
|
|
6931
|
+
"wm-search",
|
|
6932
|
+
"wm-select",
|
|
6933
|
+
"wm-action-menu",
|
|
6934
|
+
"wm-tab-item",
|
|
6935
|
+
"wm-datepicker",
|
|
6936
|
+
];
|
|
6937
|
+
let focusableEl = element;
|
|
6938
|
+
selectors.forEach((selector) => {
|
|
6939
|
+
if (focusableEl && focusableEl.shadowRoot) {
|
|
6940
|
+
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6941
|
+
if (elInShadow) {
|
|
6942
|
+
if (selector.startsWith("wm-")) {
|
|
6943
|
+
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6944
|
+
}
|
|
6945
|
+
else {
|
|
6946
|
+
focusableEl = elInShadow;
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
});
|
|
6951
|
+
return focusableEl;
|
|
6952
|
+
}
|
|
6953
|
+
function isFocusable(element) {
|
|
6954
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6955
|
+
return true;
|
|
6956
|
+
}
|
|
6957
|
+
if (element.disabled) {
|
|
6958
|
+
return false;
|
|
6959
|
+
}
|
|
6960
|
+
switch (element.nodeName) {
|
|
6961
|
+
case "A":
|
|
6962
|
+
return !!element.href && element.rel != "ignore";
|
|
6963
|
+
case "INPUT":
|
|
6964
|
+
return element.type != "hidden" && element.type != "file";
|
|
6965
|
+
case "BUTTON":
|
|
6966
|
+
case "SELECT":
|
|
6967
|
+
case "TEXTAREA":
|
|
6968
|
+
case "WM-BUTTON":
|
|
6969
|
+
case "WM-SELECT":
|
|
6970
|
+
case "WM-ACTION-MENU":
|
|
6971
|
+
case "WM-DATEPICKER":
|
|
6972
|
+
case "WM-TIMEPICKER":
|
|
6973
|
+
case "WM-INPUT":
|
|
6974
|
+
case "WM-TAG-INPUT":
|
|
6975
|
+
case "WM-TAB-ITEM":
|
|
6976
|
+
case "WM-SEARCH":
|
|
6977
|
+
return true;
|
|
6978
|
+
default:
|
|
6979
|
+
return false;
|
|
6980
|
+
}
|
|
6981
|
+
}
|
|
6982
|
+
function getFirstFocusableDescendant(element) {
|
|
6983
|
+
if (isFocusable(element)) {
|
|
6984
|
+
return checkForFocusableElInShadow(element);
|
|
6985
|
+
}
|
|
6986
|
+
else if (element.childNodes.length > 0) {
|
|
6987
|
+
element.childNodes.forEach((i) => {
|
|
6988
|
+
const childEl = getFirstFocusableDescendant(i);
|
|
6989
|
+
return childEl && checkForFocusableElInShadow(childEl);
|
|
6990
|
+
});
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
function hasValidType(file, types) {
|
|
6994
|
+
const acceptedExtensions = types.split(" ");
|
|
6995
|
+
const parts = file.name && file.name.split(".");
|
|
6996
|
+
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6997
|
+
return ext
|
|
6998
|
+
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6999
|
+
: // fallback: if we couldn't obtain an extension,
|
|
7000
|
+
// validate based on MIME type...
|
|
7001
|
+
!!file.type
|
|
7002
|
+
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
7003
|
+
: // ...and if that failed too, accept the file
|
|
7004
|
+
// as it's preferable to accept an invalid file
|
|
7005
|
+
// than refusing a valid one (back-end will take care of what slips through)
|
|
7006
|
+
true;
|
|
7007
|
+
}
|
|
7008
|
+
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
7009
|
+
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
7010
|
+
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
7011
|
+
// front end checks are just a convenience to users, independent of security.
|
|
7012
|
+
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
7013
|
+
const lookupTable = {
|
|
7014
|
+
aac: ["audio/aac"],
|
|
7015
|
+
abw: ["application/x-abiword"],
|
|
7016
|
+
arc: ["application/x-freearc"],
|
|
7017
|
+
avi: ["video/x-msvideo"],
|
|
7018
|
+
azw: ["application/vnd.amazon.ebook"],
|
|
7019
|
+
bin: ["application/octet-stream"],
|
|
7020
|
+
bmp: ["image/bmp"],
|
|
7021
|
+
bz: ["application/x-bzip"],
|
|
7022
|
+
bz2: ["application/x-bzip2"],
|
|
7023
|
+
csh: ["application/x-csh"],
|
|
7024
|
+
css: ["text/css"],
|
|
7025
|
+
csv: ["text/csv"],
|
|
7026
|
+
doc: ["application/msword"],
|
|
7027
|
+
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
7028
|
+
eot: ["application/vnd.ms-fontobject"],
|
|
7029
|
+
epub: ["application/epub+zip"],
|
|
7030
|
+
gz: ["application/gzip"],
|
|
7031
|
+
gif: ["image/gif"],
|
|
7032
|
+
htm: ["text/html"],
|
|
7033
|
+
html: ["text/html"],
|
|
7034
|
+
ico: ["image/vnd.microsoft.icon"],
|
|
7035
|
+
ics: ["text/calendar"],
|
|
7036
|
+
jar: ["application/java-archive"],
|
|
7037
|
+
jpeg: ["image/jpeg"],
|
|
7038
|
+
jpg: ["image/jpeg"],
|
|
7039
|
+
js: ["text/javascript"],
|
|
7040
|
+
json: ["application/json"],
|
|
7041
|
+
jsonld: ["application/ld+json"],
|
|
7042
|
+
log: ["text/plain"],
|
|
7043
|
+
mid: ["audio/x-midi"],
|
|
7044
|
+
midi: ["audio/x-midi"],
|
|
7045
|
+
mjs: ["text/javascript"],
|
|
7046
|
+
mp3: ["audio/mpeg"],
|
|
7047
|
+
mpeg: ["video/mpeg"],
|
|
7048
|
+
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7049
|
+
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7050
|
+
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7051
|
+
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7052
|
+
oga: ["audio/ogg"],
|
|
7053
|
+
ogv: ["video/ogg"],
|
|
7054
|
+
ogx: ["application/ogg"],
|
|
7055
|
+
opus: ["audio/opus"],
|
|
7056
|
+
otf: ["font/otf"],
|
|
7057
|
+
png: ["image/png"],
|
|
7058
|
+
pdf: ["application/pdf"],
|
|
7059
|
+
php: ["application/php"],
|
|
7060
|
+
ppt: ["application/vnd.ms-powerpoint"],
|
|
7061
|
+
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7062
|
+
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7063
|
+
rtf: ["application/rtf"],
|
|
7064
|
+
sh: ["application/x-sh"],
|
|
7065
|
+
svg: ["image/svg+xml"],
|
|
7066
|
+
swf: ["application/x-shockwave-flash"],
|
|
7067
|
+
tar: ["application/x-tar"],
|
|
7068
|
+
tif: ["image/tiff"],
|
|
7069
|
+
tiff: ["image/tiff"],
|
|
7070
|
+
ts: ["video/mp2t"],
|
|
7071
|
+
ttf: ["font/ttf"],
|
|
7072
|
+
txt: ["text/plain"],
|
|
7073
|
+
vsd: ["application/vnd.visio"],
|
|
7074
|
+
wav: ["audio/wav"],
|
|
7075
|
+
weba: ["audio/webm"],
|
|
7076
|
+
webm: ["video/webm"],
|
|
7077
|
+
webp: ["image/webp"],
|
|
7078
|
+
woff: ["font/woff"],
|
|
7079
|
+
woff2: ["font/woff2"],
|
|
7080
|
+
xhtml: ["application/xhtml+xml"],
|
|
7081
|
+
xls: ["application/vnd.ms-excel"],
|
|
7082
|
+
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7083
|
+
xml: ["application/xml", "text/xml"],
|
|
7084
|
+
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7085
|
+
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7086
|
+
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7087
|
+
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7088
|
+
"7z": ["application/x-7z-compressed"],
|
|
7089
|
+
};
|
|
7090
|
+
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7091
|
+
}
|
|
7092
|
+
function snakeCaseToCamelCase(str) {
|
|
7093
|
+
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7094
|
+
if (snakeCaseRegexp.test(str)) {
|
|
7095
|
+
let camelCase = "";
|
|
7096
|
+
let arr = str.split("_");
|
|
7097
|
+
arr.forEach((word, idx) => {
|
|
7098
|
+
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7099
|
+
});
|
|
7100
|
+
return camelCase;
|
|
7101
|
+
}
|
|
7102
|
+
else {
|
|
7103
|
+
return str;
|
|
7104
|
+
}
|
|
7105
|
+
}
|
|
7106
|
+
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7107
|
+
let newIndex = currentIndex;
|
|
7108
|
+
if (direction === "ArrowDown") {
|
|
7109
|
+
newIndex = (currentIndex + 1) % listLength;
|
|
7110
|
+
}
|
|
7111
|
+
if (direction === "ArrowUp") {
|
|
7112
|
+
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7113
|
+
}
|
|
7114
|
+
return newIndex;
|
|
7115
|
+
}
|
|
7116
|
+
function isRelatedTarget(ev, id) {
|
|
7117
|
+
// used for onBlur events to check the element that has been clicked
|
|
7118
|
+
const ids = id.split(" ");
|
|
7119
|
+
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7120
|
+
}
|
|
7121
|
+
function toBool(val) {
|
|
7122
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7123
|
+
return val == "false" ? false : !!val;
|
|
7124
|
+
}
|
|
7125
|
+
/*
|
|
7126
|
+
* this is going to be needed to solve the extra tabbing on navigator
|
|
7127
|
+
* and for programmatic focus of tabs
|
|
7128
|
+
* Here's a draft, not bug proof, see:
|
|
7129
|
+
* https://stackoverflow.com/a/10730308/3741713
|
|
7130
|
+
|
|
7131
|
+
function getKeyboardFocusableElements(element = document) {
|
|
7132
|
+
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'));
|
|
7133
|
+
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7134
|
+
}
|
|
7135
|
+
|
|
7136
|
+
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7137
|
+
const els = getKeyboardFocusableElements();
|
|
7138
|
+
const current = els.indexOf(element);
|
|
7139
|
+
return els[current - 1] as HTMLElement;
|
|
7140
|
+
}
|
|
7141
|
+
|
|
7142
|
+
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7143
|
+
const els = getKeyboardFocusableElements();
|
|
7144
|
+
const current = els.indexOf(element);
|
|
7145
|
+
return els[current + 1] as HTMLElement;
|
|
7146
|
+
}
|
|
7109
7147
|
*/
|
|
7110
7148
|
|
|
7111
7149
|
export { adjustTooltipPosition as a, getPosition as b, checkForActiveElInShadow as c, debounce as d, isRelatedTarget as e, findParentWithScrollbar as f, generateId as g, checkForFocusableElInShadow as h, intl as i, getFirstFocusableDescendant as j, getNewIndexToFocus as k, shouldOpenUp as l, shouldOpenDown as m, shouldShiftRight as n, shouldShiftLeft as o, hasValidType as p, getTextDir as q, throttle as r, snakeCaseToCamelCase as s, toBool as t, hasRoomRight as u };
|