@watermarkinsights/ripple 3.8.2 → 3.9.0-2
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 +429 -0
- package/dist/cjs/{functions-b90816b8.js → functions-0750b767.js} +506 -532
- package/dist/cjs/{global-cf9485c4.js → global-0a6b313f.js} +60 -60
- package/dist/cjs/{http-service-9e8c4dd5.js → http-service-494d81de.js} +49 -49
- package/dist/cjs/{index-0e7e3668.js → index-98c6524c.js} +69 -96
- package/dist/cjs/{interfaces-30a74c1f.js → interfaces-a3338581.js} +29 -29
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/priv-chart-popover.cjs.entry.js +87 -79
- 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 +117 -473
- 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 +422 -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 +92 -0
- package/dist/cjs/wm-progress-monitor.cjs.entry.js +57 -0
- package/dist/cjs/wm-progress-slice.cjs.entry.js +17 -0
- 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 +348 -348
- package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +8 -5
- package/dist/collection/components/{wm-chart → charts}/priv-chart-popover/priv-chart-popover.css +0 -0
- package/dist/collection/components/{wm-chart → charts}/priv-chart-popover/priv-chart-popover.js +258 -232
- package/dist/collection/components/{wm-chart → charts/wm-chart}/wm-chart-slice.js +115 -115
- package/dist/collection/components/charts/wm-chart/wm-chart.css +460 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.js +332 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +460 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +199 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +53 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +95 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +111 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
- package/dist/collection/components/wm-button/wm-button.css +2 -1
- package/dist/collection/components/wm-button/wm-button.js +491 -491
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +4 -3
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1024 -1024
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +2 -1
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +471 -471
- package/dist/collection/components/wm-input/wm-input.css +2 -1
- 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 +2 -1
- 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 +3 -2
- 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 +3 -2
- package/dist/collection/components/wm-select/wm-select.js +718 -718
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +3 -2
- 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 +3 -2
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +3 -2
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +2 -1
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +2 -1
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -753
- package/dist/collection/components/wm-uploader/wm-uploader.css +2 -1
- 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/chartFunctions.js +417 -0
- 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 +39 -39
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/chartFunctions-fc11df2b.js +420 -0
- package/dist/esm/{functions-8d09a511.js → functions-b478ef24.js} +506 -532
- package/dist/esm/{global-d1d68bab.js → global-b8be90a6.js} +60 -60
- package/dist/esm/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +49 -49
- package/dist/esm/{index-cd8f9ae2.js → index-d649a861.js} +69 -96
- package/dist/esm/{interfaces-61c6305b.js → interfaces-2b97fab2.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 -79
- 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 +117 -473
- 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 +422 -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 +88 -0
- package/dist/esm/wm-progress-monitor.entry.js +53 -0
- package/dist/esm/wm-progress-slice.entry.js +13 -0
- 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 +348 -348
- package/dist/esm/wm-wrapper.entry.js +13 -13
- package/dist/esm-es5/chartFunctions-fc11df2b.js +1 -0
- package/dist/esm-es5/functions-b478ef24.js +15 -0
- package/dist/esm-es5/global-b8be90a6.js +1 -0
- package/dist/esm-es5/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +1 -1
- package/dist/esm-es5/index-d649a861.js +1 -0
- package/dist/esm-es5/{interfaces-61c6305b.js → interfaces-2b97fab2.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 -0
- package/dist/esm-es5/wm-progress-monitor.entry.js +1 -0
- package/dist/esm-es5/wm-progress-slice.entry.js +1 -0
- 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 +1 -0
- package/dist/ripple/p-063bc67c.system.entry.js +1 -0
- package/dist/ripple/{p-504579c2.system.entry.js → p-099df7b7.system.entry.js} +1 -1
- package/dist/ripple/p-0b23a4fe.entry.js +1 -0
- package/dist/ripple/p-1b2c3251.system.entry.js +1 -0
- package/dist/ripple/{p-34e0410e.system.entry.js → p-1b7be30d.system.entry.js} +1 -1
- package/dist/ripple/p-1e2c46f1.entry.js +1 -0
- package/dist/ripple/p-1e7fc028.entry.js +1 -0
- package/dist/ripple/p-2296c2c3.entry.js +1 -0
- package/dist/ripple/p-24cd6213.system.entry.js +1 -0
- package/dist/ripple/p-2587031d.system.entry.js +1 -0
- package/dist/ripple/p-29d527c8.entry.js +1 -0
- package/dist/ripple/p-2b6246d9.entry.js +1 -0
- package/dist/ripple/{p-a5177480.system.entry.js → p-2b63995f.system.entry.js} +1 -1
- package/dist/ripple/p-2b9c54e7.system.entry.js +1 -0
- package/dist/ripple/p-2cc9e6cf.system.entry.js +1 -0
- package/dist/ripple/p-30db4ad7.entry.js +1 -0
- package/dist/ripple/{p-dc0e6d55.system.entry.js → p-30e1daf7.system.entry.js} +1 -1
- package/dist/ripple/p-3388ca40.entry.js +1 -0
- package/dist/ripple/p-34736928.entry.js +1 -0
- package/dist/ripple/p-366e00f9.js +1 -0
- package/dist/ripple/p-36be0612.js +1 -0
- package/dist/ripple/p-3b31eaec.system.js +1 -0
- package/dist/ripple/p-3eb3a1f8.entry.js +1 -0
- package/dist/ripple/{p-888bec42.js → p-43f1298b.js} +0 -0
- package/dist/ripple/p-492ad5d0.system.entry.js +1 -0
- package/dist/ripple/p-4f23cdc6.entry.js +1 -0
- package/dist/ripple/p-50be3b44.js +1 -0
- package/dist/ripple/p-5743d4bc.system.entry.js +1 -0
- package/dist/ripple/p-59963be9.system.entry.js +1 -0
- package/dist/ripple/p-5d6cc9da.system.js +1 -0
- package/dist/ripple/p-5e5f162c.system.entry.js +1 -0
- package/dist/ripple/{p-53caf7e4.system.entry.js → p-647edff3.system.entry.js} +1 -1
- package/dist/ripple/p-6c295beb.entry.js +1 -0
- package/dist/ripple/p-6c751341.entry.js +1 -0
- package/dist/ripple/p-6f9e8fbc.entry.js +1 -0
- package/dist/ripple/p-70ececb5.entry.js +1 -0
- package/dist/ripple/p-7674c9b0.system.entry.js +1 -0
- package/dist/ripple/p-76b96f77.entry.js +1 -0
- package/dist/ripple/p-7a2a0d2e.js +16 -0
- package/dist/ripple/p-7c2b1682.entry.js +1 -0
- package/dist/ripple/p-7f0c64ac.entry.js +1 -0
- package/dist/ripple/p-803f1f22.entry.js +1 -0
- package/dist/ripple/p-84fb34b5.entry.js +1 -0
- package/dist/ripple/p-8a583f84.entry.js +1 -0
- package/dist/ripple/p-8daa2613.system.entry.js +1 -0
- package/dist/ripple/p-935a266f.entry.js +1 -0
- package/dist/ripple/p-9d02957d.system.js +1 -0
- package/dist/ripple/p-a14ac623.entry.js +1 -0
- package/dist/ripple/{p-e758db14.system.entry.js → p-a1511315.system.entry.js} +1 -1
- package/dist/ripple/p-b325c35a.system.entry.js +1 -0
- package/dist/ripple/{p-9a9743f5.system.entry.js → p-bfc1ab2e.system.entry.js} +1 -1
- package/dist/ripple/p-bfe93d8d.system.entry.js +1 -0
- package/dist/ripple/p-c1c7b0b1.system.js +15 -0
- package/dist/ripple/p-c20a179f.system.entry.js +1 -0
- package/dist/ripple/p-c8bbf15e.entry.js +1 -0
- package/dist/ripple/{p-7913283e.system.entry.js → p-cb7d8ade.system.entry.js} +1 -1
- package/dist/ripple/p-cfb62ded.entry.js +1 -0
- package/dist/ripple/p-d12e0f49.system.js +1 -0
- package/dist/ripple/p-d648d193.entry.js +1 -0
- package/dist/ripple/p-d7ff84eb.entry.js +1 -0
- package/dist/ripple/{p-c19298a5.system.entry.js → p-ddf157c8.system.entry.js} +1 -1
- package/dist/ripple/p-e90f6915.system.js +1 -0
- package/dist/ripple/p-ea33bda7.system.entry.js +1 -0
- package/dist/ripple/p-f2566a42.system.entry.js +1 -0
- package/dist/ripple/{p-08b7ec08.system.js → p-f5df5903.system.js} +0 -0
- package/dist/ripple/p-f62fc5ea.system.entry.js +1 -0
- package/dist/ripple/{p-a6d6eae7.js → p-fd8070fb.js} +0 -0
- package/dist/ripple/{p-dcfe93ea.system.entry.js → p-fd9380f2.system.entry.js} +1 -1
- package/dist/ripple/p-fe0abd10.system.entry.js +1 -0
- package/dist/ripple/p-fe2a30d3.entry.js +1 -0
- package/dist/ripple/p-ffbc5db3.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/{wm-chart → charts}/priv-chart-popover/priv-chart-popover.d.ts +27 -23
- package/dist/types/components/{wm-chart → charts/wm-chart}/wm-chart-slice.d.ts +11 -11
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +35 -0
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -0
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -0
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -0
- 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 +86 -24
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/chartFunctions.d.ts +28 -0
- 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 -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 +4 -6
- package/package.json +47 -47
- package/dist/collection/components/wm-chart/wm-chart.css +0 -346
- package/dist/collection/components/wm-chart/wm-chart.js +0 -715
- package/dist/esm-es5/functions-8d09a511.js +0 -15
- package/dist/esm-es5/global-d1d68bab.js +0 -1
- package/dist/esm-es5/index-cd8f9ae2.js +0 -1
- package/dist/ripple/p-09508c2d.entry.js +0 -1
- package/dist/ripple/p-0a916c6e.entry.js +0 -1
- package/dist/ripple/p-11a9ce3f.system.js +0 -1
- package/dist/ripple/p-1ef19ec1.entry.js +0 -1
- package/dist/ripple/p-20856a2d.system.js +0 -1
- package/dist/ripple/p-244877c8.entry.js +0 -1
- package/dist/ripple/p-253a08fe.system.js +0 -15
- package/dist/ripple/p-268622b5.system.entry.js +0 -1
- package/dist/ripple/p-27f0d9be.entry.js +0 -1
- package/dist/ripple/p-29d3ca15.system.entry.js +0 -1
- package/dist/ripple/p-2a27dba5.entry.js +0 -1
- package/dist/ripple/p-2b209cf3.js +0 -1
- package/dist/ripple/p-313b6073.system.js +0 -1
- package/dist/ripple/p-38062c39.js +0 -1
- package/dist/ripple/p-39eea6bd.system.entry.js +0 -1
- package/dist/ripple/p-3b6b7618.entry.js +0 -1
- package/dist/ripple/p-3ba3afca.entry.js +0 -1
- package/dist/ripple/p-4de0799d.entry.js +0 -1
- package/dist/ripple/p-56963e2f.system.entry.js +0 -1
- package/dist/ripple/p-597985b9.entry.js +0 -1
- package/dist/ripple/p-5adc422a.entry.js +0 -1
- package/dist/ripple/p-5e0d47b9.system.entry.js +0 -1
- package/dist/ripple/p-67f74636.entry.js +0 -1
- package/dist/ripple/p-69735b23.system.entry.js +0 -1
- package/dist/ripple/p-6c65643e.system.entry.js +0 -1
- package/dist/ripple/p-7484c4e6.system.entry.js +0 -1
- package/dist/ripple/p-764fa608.entry.js +0 -1
- package/dist/ripple/p-81c023a7.entry.js +0 -1
- package/dist/ripple/p-8a0450fd.entry.js +0 -1
- package/dist/ripple/p-8e2cbae6.system.entry.js +0 -1
- package/dist/ripple/p-93b1c864.system.entry.js +0 -1
- package/dist/ripple/p-991abdb9.system.entry.js +0 -1
- package/dist/ripple/p-99d610f9.entry.js +0 -1
- package/dist/ripple/p-a8d66745.js +0 -16
- package/dist/ripple/p-b53962af.entry.js +0 -1
- package/dist/ripple/p-b53cecad.system.entry.js +0 -1
- package/dist/ripple/p-bdbc14ee.system.entry.js +0 -1
- package/dist/ripple/p-bf3c22d9.entry.js +0 -1
- package/dist/ripple/p-c58520e4.entry.js +0 -1
- package/dist/ripple/p-c7660ed9.entry.js +0 -1
- package/dist/ripple/p-c8040acd.system.entry.js +0 -1
- package/dist/ripple/p-c9284e6b.entry.js +0 -1
- package/dist/ripple/p-cd75be7a.entry.js +0 -1
- package/dist/ripple/p-cdd5ce00.entry.js +0 -1
- package/dist/ripple/p-d680d98f.entry.js +0 -1
- package/dist/ripple/p-e597d7bb.system.entry.js +0 -1
- package/dist/ripple/p-e6bcfdd5.entry.js +0 -1
- package/dist/ripple/p-e8761ba1.system.js +0 -1
- package/dist/ripple/p-ef344252.entry.js +0 -1
- package/dist/ripple/p-fc254870.system.entry.js +0 -1
- package/dist/types/components/wm-chart/wm-chart.d.ts +0 -82
|
@@ -3914,17 +3914,11 @@ function icuUnitToEcma(unit) {
|
|
|
3914
3914
|
return unit.replace(/^(.*?)-/, '');
|
|
3915
3915
|
}
|
|
3916
3916
|
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3917
|
-
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)
|
|
3917
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
3918
3918
|
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3919
3919
|
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
3920
3920
|
function parseSignificantPrecision(str) {
|
|
3921
3921
|
var result = {};
|
|
3922
|
-
if (str[str.length - 1] === 'r') {
|
|
3923
|
-
result.roundingPriority = 'morePrecision';
|
|
3924
|
-
}
|
|
3925
|
-
else if (str[str.length - 1] === 's') {
|
|
3926
|
-
result.roundingPriority = 'lessPrecision';
|
|
3927
|
-
}
|
|
3928
3922
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
|
|
3929
3923
|
// @@@ case
|
|
3930
3924
|
if (typeof g2 !== 'string') {
|
|
@@ -4151,13 +4145,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4151
4145
|
}
|
|
4152
4146
|
return '';
|
|
4153
4147
|
});
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
if (opt === 'w') {
|
|
4157
|
-
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
|
|
4158
|
-
}
|
|
4159
|
-
else if (opt) {
|
|
4160
|
-
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
4148
|
+
if (token.options.length) {
|
|
4149
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
|
|
4161
4150
|
}
|
|
4162
4151
|
continue;
|
|
4163
4152
|
}
|
|
@@ -4179,8 +4168,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4179
4168
|
}
|
|
4180
4169
|
|
|
4181
4170
|
var _a;
|
|
4182
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
4183
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(
|
|
4171
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*");
|
|
4172
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$");
|
|
4184
4173
|
function createLocation(start, end) {
|
|
4185
4174
|
return { start: start, end: end };
|
|
4186
4175
|
}
|
|
@@ -4427,7 +4416,7 @@ var Parser = /** @class */ (function () {
|
|
|
4427
4416
|
return {
|
|
4428
4417
|
val: {
|
|
4429
4418
|
type: TYPE.literal,
|
|
4430
|
-
value: "<"
|
|
4419
|
+
value: "<" + tagName + "/>",
|
|
4431
4420
|
location: createLocation(startPosition, this.clonePosition()),
|
|
4432
4421
|
},
|
|
4433
4422
|
err: null,
|
|
@@ -5032,7 +5021,7 @@ var Parser = /** @class */ (function () {
|
|
|
5032
5021
|
}
|
|
5033
5022
|
var code = codePointAt(this.message, offset);
|
|
5034
5023
|
if (code === undefined) {
|
|
5035
|
-
throw Error("Offset "
|
|
5024
|
+
throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary");
|
|
5036
5025
|
}
|
|
5037
5026
|
return code;
|
|
5038
5027
|
};
|
|
@@ -5100,7 +5089,7 @@ var Parser = /** @class */ (function () {
|
|
|
5100
5089
|
*/
|
|
5101
5090
|
Parser.prototype.bumpTo = function (targetOffset) {
|
|
5102
5091
|
if (this.offset() > targetOffset) {
|
|
5103
|
-
throw Error("targetOffset "
|
|
5092
|
+
throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset());
|
|
5104
5093
|
}
|
|
5105
5094
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
5106
5095
|
while (true) {
|
|
@@ -5109,7 +5098,7 @@ var Parser = /** @class */ (function () {
|
|
|
5109
5098
|
break;
|
|
5110
5099
|
}
|
|
5111
5100
|
if (offset > targetOffset) {
|
|
5112
|
-
throw Error("targetOffset "
|
|
5101
|
+
throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary");
|
|
5113
5102
|
}
|
|
5114
5103
|
this.bump();
|
|
5115
5104
|
if (this.isEOF()) {
|
|
@@ -5575,28 +5564,28 @@ var FormatError = /** @class */ (function (_super) {
|
|
|
5575
5564
|
return _this;
|
|
5576
5565
|
}
|
|
5577
5566
|
FormatError.prototype.toString = function () {
|
|
5578
|
-
return "[formatjs Error: "
|
|
5567
|
+
return "[formatjs Error: " + this.code + "] " + this.message;
|
|
5579
5568
|
};
|
|
5580
5569
|
return FormatError;
|
|
5581
5570
|
}(Error));
|
|
5582
5571
|
var InvalidValueError = /** @class */ (function (_super) {
|
|
5583
5572
|
__extends(InvalidValueError, _super);
|
|
5584
5573
|
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
5585
|
-
return _super.call(this, "Invalid values for \""
|
|
5574
|
+
return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5586
5575
|
}
|
|
5587
5576
|
return InvalidValueError;
|
|
5588
5577
|
}(FormatError));
|
|
5589
5578
|
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
5590
5579
|
__extends(InvalidValueTypeError, _super);
|
|
5591
5580
|
function InvalidValueTypeError(value, type, originalMessage) {
|
|
5592
|
-
return _super.call(this, "Value for \""
|
|
5581
|
+
return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5593
5582
|
}
|
|
5594
5583
|
return InvalidValueTypeError;
|
|
5595
5584
|
}(FormatError));
|
|
5596
5585
|
var MissingValueError = /** @class */ (function (_super) {
|
|
5597
5586
|
__extends(MissingValueError, _super);
|
|
5598
5587
|
function MissingValueError(variableId, originalMessage) {
|
|
5599
|
-
return _super.call(this, "The intl string context variable \""
|
|
5588
|
+
return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
5600
5589
|
}
|
|
5601
5590
|
return MissingValueError;
|
|
5602
5591
|
}(FormatError));
|
|
@@ -5757,7 +5746,7 @@ originalMessage) {
|
|
|
5757
5746
|
continue;
|
|
5758
5747
|
}
|
|
5759
5748
|
if (isPluralElement(el)) {
|
|
5760
|
-
var opt = el.options["="
|
|
5749
|
+
var opt = el.options["=" + value];
|
|
5761
5750
|
if (!opt) {
|
|
5762
5751
|
if (!Intl.PluralRules) {
|
|
5763
5752
|
throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -5828,7 +5817,7 @@ function createDefaultFormatters(cache) {
|
|
|
5828
5817
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5829
5818
|
args[_i] = arguments[_i];
|
|
5830
5819
|
}
|
|
5831
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
5820
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5832
5821
|
}, {
|
|
5833
5822
|
cache: createFastMemoizeCache$1(cache.number),
|
|
5834
5823
|
strategy: strategies.variadic,
|
|
@@ -5839,7 +5828,7 @@ function createDefaultFormatters(cache) {
|
|
|
5839
5828
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5840
5829
|
args[_i] = arguments[_i];
|
|
5841
5830
|
}
|
|
5842
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
5831
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5843
5832
|
}, {
|
|
5844
5833
|
cache: createFastMemoizeCache$1(cache.dateTime),
|
|
5845
5834
|
strategy: strategies.variadic,
|
|
@@ -5850,7 +5839,7 @@ function createDefaultFormatters(cache) {
|
|
|
5850
5839
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5851
5840
|
args[_i] = arguments[_i];
|
|
5852
5841
|
}
|
|
5853
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args
|
|
5842
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5854
5843
|
}, {
|
|
5855
5844
|
cache: createFastMemoizeCache$1(cache.pluralRules),
|
|
5856
5845
|
strategy: strategies.variadic,
|
|
@@ -6008,13 +5997,7 @@ var IntlErrorCode;
|
|
|
6008
5997
|
var IntlError = /** @class */ (function (_super) {
|
|
6009
5998
|
__extends(IntlError, _super);
|
|
6010
5999
|
function IntlError(code, message, exception) {
|
|
6011
|
-
var _this = this;
|
|
6012
|
-
var err = exception
|
|
6013
|
-
? exception instanceof Error
|
|
6014
|
-
? exception
|
|
6015
|
-
: new Error(String(exception))
|
|
6016
|
-
: undefined;
|
|
6017
|
-
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
|
|
6000
|
+
var _this = _super.call(this, "[@formatjs/intl Error " + code + "] " + message + " \n" + (exception ? "\n" + exception.message + "\n" + exception.stack : '')) || this;
|
|
6018
6001
|
_this.code = code;
|
|
6019
6002
|
// @ts-ignore just so we don't need to declare dep on @types/node
|
|
6020
6003
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -6046,26 +6029,19 @@ var MissingDataError = /** @class */ (function (_super) {
|
|
|
6046
6029
|
}
|
|
6047
6030
|
return MissingDataError;
|
|
6048
6031
|
}(IntlError));
|
|
6049
|
-
var IntlFormatError = /** @class */ (function (_super) {
|
|
6050
|
-
__extends(IntlFormatError, _super);
|
|
6051
|
-
function IntlFormatError(message, locale, exception) {
|
|
6052
|
-
return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
|
|
6053
|
-
}
|
|
6054
|
-
return IntlFormatError;
|
|
6055
|
-
}(IntlError));
|
|
6056
6032
|
var MessageFormatError = /** @class */ (function (_super) {
|
|
6057
6033
|
__extends(MessageFormatError, _super);
|
|
6058
6034
|
function MessageFormatError(message, locale, descriptor, exception) {
|
|
6059
|
-
var _this = _super.call(this,
|
|
6035
|
+
var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, message + " \nLocale: " + locale + "\nMessageID: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.id) + "\nDefault Message: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage) + "\nDescription: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.description) + " \n", exception) || this;
|
|
6060
6036
|
_this.descriptor = descriptor;
|
|
6061
6037
|
return _this;
|
|
6062
6038
|
}
|
|
6063
6039
|
return MessageFormatError;
|
|
6064
|
-
}(
|
|
6040
|
+
}(IntlError));
|
|
6065
6041
|
var MissingTranslationError = /** @class */ (function (_super) {
|
|
6066
6042
|
__extends(MissingTranslationError, _super);
|
|
6067
6043
|
function MissingTranslationError(descriptor, locale) {
|
|
6068
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \""
|
|
6044
|
+
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"" + descriptor.id + "\" for locale \"" + locale + "\", using " + (descriptor.defaultMessage ? 'default message' : 'id') + " as fallback.") || this;
|
|
6069
6045
|
_this.descriptor = descriptor;
|
|
6070
6046
|
return _this;
|
|
6071
6047
|
}
|
|
@@ -6092,7 +6068,6 @@ var DEFAULT_INTL_CONFIG = {
|
|
|
6092
6068
|
timeZone: undefined,
|
|
6093
6069
|
defaultLocale: 'en',
|
|
6094
6070
|
defaultFormats: {},
|
|
6095
|
-
fallbackOnEmptyString: true,
|
|
6096
6071
|
onError: defaultErrorHandler,
|
|
6097
6072
|
};
|
|
6098
6073
|
function createIntlCache() {
|
|
@@ -6135,7 +6110,7 @@ function createFormatters(cache) {
|
|
|
6135
6110
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6136
6111
|
args[_i] = arguments[_i];
|
|
6137
6112
|
}
|
|
6138
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
6113
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6139
6114
|
}, {
|
|
6140
6115
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
6141
6116
|
strategy: strategies.variadic,
|
|
@@ -6146,7 +6121,7 @@ function createFormatters(cache) {
|
|
|
6146
6121
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6147
6122
|
args[_i] = arguments[_i];
|
|
6148
6123
|
}
|
|
6149
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
6124
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6150
6125
|
}, {
|
|
6151
6126
|
cache: createFastMemoizeCache(cache.number),
|
|
6152
6127
|
strategy: strategies.variadic,
|
|
@@ -6157,7 +6132,7 @@ function createFormatters(cache) {
|
|
|
6157
6132
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6158
6133
|
args[_i] = arguments[_i];
|
|
6159
6134
|
}
|
|
6160
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args
|
|
6135
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6161
6136
|
}, {
|
|
6162
6137
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
6163
6138
|
strategy: strategies.variadic,
|
|
@@ -6180,7 +6155,7 @@ function createFormatters(cache) {
|
|
|
6180
6155
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6181
6156
|
args[_i] = arguments[_i];
|
|
6182
6157
|
}
|
|
6183
|
-
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args
|
|
6158
|
+
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
|
|
6184
6159
|
}, {
|
|
6185
6160
|
cache: createFastMemoizeCache(cache.relativeTime),
|
|
6186
6161
|
strategy: strategies.variadic,
|
|
@@ -6191,7 +6166,7 @@ function createFormatters(cache) {
|
|
|
6191
6166
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6192
6167
|
args[_i] = arguments[_i];
|
|
6193
6168
|
}
|
|
6194
|
-
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args
|
|
6169
|
+
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
|
|
6195
6170
|
}, {
|
|
6196
6171
|
cache: createFastMemoizeCache(cache.list),
|
|
6197
6172
|
strategy: strategies.variadic,
|
|
@@ -6201,7 +6176,7 @@ function createFormatters(cache) {
|
|
|
6201
6176
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6202
6177
|
args[_i] = arguments[_i];
|
|
6203
6178
|
}
|
|
6204
|
-
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args
|
|
6179
|
+
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
|
|
6205
6180
|
}, {
|
|
6206
6181
|
cache: createFastMemoizeCache(cache.displayNames),
|
|
6207
6182
|
strategy: strategies.variadic,
|
|
@@ -6217,7 +6192,7 @@ function getNamedFormat(formats, type, name, onError) {
|
|
|
6217
6192
|
if (format) {
|
|
6218
6193
|
return format;
|
|
6219
6194
|
}
|
|
6220
|
-
onError(new UnsupportedFormatterError("No "
|
|
6195
|
+
onError(new UnsupportedFormatterError("No " + type + " format named: " + name));
|
|
6221
6196
|
}
|
|
6222
6197
|
|
|
6223
6198
|
/**
|
|
@@ -6252,7 +6227,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
6252
6227
|
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)) });
|
|
6253
6228
|
}
|
|
6254
6229
|
function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
6255
|
-
var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats,
|
|
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;
|
|
6256
6231
|
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
|
|
6257
6232
|
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
|
|
6258
6233
|
// `id` is a required field of a Message Descriptor.
|
|
@@ -6282,9 +6257,6 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6282
6257
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
6283
6258
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
6284
6259
|
if (!message) {
|
|
6285
|
-
if (fallbackOnEmptyString === false && message === '') {
|
|
6286
|
-
return message;
|
|
6287
|
-
}
|
|
6288
6260
|
if (!defaultMessage ||
|
|
6289
6261
|
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
6290
6262
|
// This prevents warnings from littering the console in development
|
|
@@ -6298,7 +6270,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6298
6270
|
return formatter.format(values);
|
|
6299
6271
|
}
|
|
6300
6272
|
catch (e) {
|
|
6301
|
-
onError(new MessageFormatError("Error formatting default message for: \""
|
|
6273
|
+
onError(new MessageFormatError("Error formatting default message for: \"" + id + "\", rendering default message verbatim", locale, messageDescriptor, e));
|
|
6302
6274
|
return typeof defaultMessage === 'string' ? defaultMessage : id;
|
|
6303
6275
|
}
|
|
6304
6276
|
}
|
|
@@ -6310,7 +6282,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6310
6282
|
return formatter.format(values);
|
|
6311
6283
|
}
|
|
6312
6284
|
catch (e) {
|
|
6313
|
-
onError(new MessageFormatError("Error formatting message: \""
|
|
6285
|
+
onError(new MessageFormatError("Error formatting message: \"" + id + "\", using " + (defaultMessage ? 'default message' : 'id') + " as fallback.", locale, messageDescriptor, e));
|
|
6314
6286
|
}
|
|
6315
6287
|
if (defaultMessage) {
|
|
6316
6288
|
try {
|
|
@@ -6318,7 +6290,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6318
6290
|
return formatter.format(values);
|
|
6319
6291
|
}
|
|
6320
6292
|
catch (e) {
|
|
6321
|
-
onError(new MessageFormatError("Error formatting the default message for: \""
|
|
6293
|
+
onError(new MessageFormatError("Error formatting the default message for: \"" + id + "\", rendering message verbatim", locale, messageDescriptor, e));
|
|
6322
6294
|
}
|
|
6323
6295
|
}
|
|
6324
6296
|
if (typeof message === 'string') {
|
|
@@ -6356,7 +6328,9 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
|
|
|
6356
6328
|
if (options === void 0) { options = {}; }
|
|
6357
6329
|
var format = options.format;
|
|
6358
6330
|
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
|
|
6359
|
-
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6331
|
+
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6332
|
+
// @ts-expect-error es2020 has a lot stuff from es2021 bleed in
|
|
6333
|
+
defaults);
|
|
6360
6334
|
if (type === 'time' &&
|
|
6361
6335
|
!filteredOptions.hour &&
|
|
6362
6336
|
!filteredOptions.minute &&
|
|
@@ -6473,7 +6447,7 @@ var LIST_FORMAT_OPTIONS = [
|
|
|
6473
6447
|
];
|
|
6474
6448
|
var now = Date.now();
|
|
6475
6449
|
function generateToken(i) {
|
|
6476
|
-
return
|
|
6450
|
+
return now + "_" + i + "_" + now;
|
|
6477
6451
|
}
|
|
6478
6452
|
function formatList(opts, getListFormat, values, options) {
|
|
6479
6453
|
if (options === void 0) { options = {}; }
|
|
@@ -6540,7 +6514,7 @@ function formatPlural(_a, getPluralRules, value, options) {
|
|
|
6540
6514
|
return getPluralRules(locale, filteredOptions).select(value);
|
|
6541
6515
|
}
|
|
6542
6516
|
catch (e) {
|
|
6543
|
-
onError(new
|
|
6517
|
+
onError(new MessageFormatError('Error formatting plural.', e));
|
|
6544
6518
|
}
|
|
6545
6519
|
return 'other';
|
|
6546
6520
|
}
|
|
@@ -6567,7 +6541,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
|
|
|
6567
6541
|
return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
|
|
6568
6542
|
}
|
|
6569
6543
|
catch (e) {
|
|
6570
|
-
config.onError(new
|
|
6544
|
+
config.onError(new MessageFormatError('Error formatting relative time.', e));
|
|
6571
6545
|
}
|
|
6572
6546
|
return String(value);
|
|
6573
6547
|
}
|
|
@@ -6647,7 +6621,7 @@ function createIntl(config, cache) {
|
|
|
6647
6621
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
6648
6622
|
if (!locale) {
|
|
6649
6623
|
if (onError) {
|
|
6650
|
-
onError(new InvalidConfigError("\"locale\" was not configured, using \""
|
|
6624
|
+
onError(new InvalidConfigError("\"locale\" was not configured, using \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details"));
|
|
6651
6625
|
}
|
|
6652
6626
|
// Since there's no registered locale data for `locale`, this will
|
|
6653
6627
|
// fallback to the `defaultLocale` to make sure things can render.
|
|
@@ -6657,481 +6631,481 @@ function createIntl(config, cache) {
|
|
|
6657
6631
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
6658
6632
|
}
|
|
6659
6633
|
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
6660
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6634
|
+
onError(new MissingDataError("Missing locale data for locale: \"" + locale + "\" in Intl.NumberFormat. Using default locale: \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details"));
|
|
6661
6635
|
}
|
|
6662
6636
|
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
|
|
6663
6637
|
onError) {
|
|
6664
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6638
|
+
onError(new MissingDataError("Missing locale data for locale: \"" + locale + "\" in Intl.DateTimeFormat. Using default locale: \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details"));
|
|
6665
6639
|
}
|
|
6666
6640
|
verifyConfigMessages(resolvedConfig);
|
|
6667
6641
|
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) });
|
|
6668
6642
|
}
|
|
6669
6643
|
|
|
6670
|
-
const DEFAULT_LANGUAGE = "en";
|
|
6671
|
-
function getBrowserLang() {
|
|
6672
|
-
const langAttr = document.documentElement.getAttribute("lang");
|
|
6673
|
-
if (!!langAttr) {
|
|
6674
|
-
return langAttr;
|
|
6675
|
-
}
|
|
6676
|
-
else if (window.navigator && window.navigator.language) {
|
|
6677
|
-
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6678
|
-
return lang.slice(0, 2);
|
|
6679
|
-
}
|
|
6680
|
-
else {
|
|
6681
|
-
return DEFAULT_LANGUAGE;
|
|
6682
|
-
}
|
|
6683
|
-
}
|
|
6684
|
-
// prevents memory leak
|
|
6685
|
-
const cache = createIntlCache();
|
|
6686
|
-
const locale = getBrowserLang();
|
|
6687
|
-
const intl = createIntl({
|
|
6688
|
-
locale: locale,
|
|
6689
|
-
defaultLocale: "en",
|
|
6690
|
-
messages: lang[locale] || en,
|
|
6691
|
-
}, cache);
|
|
6692
|
-
function generateId() {
|
|
6693
|
-
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6694
|
-
}
|
|
6695
|
-
// limits how many times a function fires
|
|
6696
|
-
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6697
|
-
function throttle(fn, wait) {
|
|
6698
|
-
let timeout;
|
|
6699
|
-
let shouldWait = false;
|
|
6700
|
-
return function () {
|
|
6701
|
-
const context = this;
|
|
6702
|
-
if (!shouldWait) {
|
|
6703
|
-
fn.apply(context, arguments);
|
|
6704
|
-
shouldWait = true;
|
|
6705
|
-
clearTimeout(timeout);
|
|
6706
|
-
timeout = setTimeout(function () {
|
|
6707
|
-
shouldWait = false;
|
|
6708
|
-
}, wait);
|
|
6709
|
-
}
|
|
6710
|
-
};
|
|
6711
|
-
}
|
|
6712
|
-
// waits until it hasn't been called for [timeout] ms.
|
|
6713
|
-
// use when the function should run only after something (event) is done firing
|
|
6714
|
-
function debounce(fn, wait) {
|
|
6715
|
-
let timeout;
|
|
6716
|
-
return function () {
|
|
6717
|
-
const context = this;
|
|
6718
|
-
const functionCall = () => fn.apply(context, arguments);
|
|
6719
|
-
clearTimeout(timeout);
|
|
6720
|
-
timeout = setTimeout(functionCall, wait);
|
|
6721
|
-
};
|
|
6722
|
-
}
|
|
6723
|
-
function getTextDir() {
|
|
6724
|
-
const dir = document.querySelector("html").getAttribute("dir");
|
|
6725
|
-
return dir ? dir.toLowerCase() : "";
|
|
6726
|
-
}
|
|
6727
|
-
function getPosition(el) {
|
|
6728
|
-
const coords = el.getBoundingClientRect();
|
|
6729
|
-
let x = coords.x;
|
|
6730
|
-
let y = coords.y;
|
|
6731
|
-
// Edge doesn't have x and y
|
|
6732
|
-
if (!x) {
|
|
6733
|
-
if (getTextDir() === "rtl") {
|
|
6734
|
-
x = coords.right;
|
|
6735
|
-
}
|
|
6736
|
-
else {
|
|
6737
|
-
x = coords.left;
|
|
6738
|
-
}
|
|
6739
|
-
y = coords.top;
|
|
6740
|
-
}
|
|
6741
|
-
return { x, y };
|
|
6742
|
-
}
|
|
6743
|
-
function findParentWithScrollbar(el) {
|
|
6744
|
-
while (!!el) {
|
|
6745
|
-
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6746
|
-
return el;
|
|
6747
|
-
}
|
|
6748
|
-
el = el.parentElement;
|
|
6749
|
-
}
|
|
6750
|
-
}
|
|
6751
|
-
function findParentWithHiddenOverflow(el) {
|
|
6752
|
-
while (!!el) {
|
|
6753
|
-
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6754
|
-
return el;
|
|
6755
|
-
}
|
|
6756
|
-
el = el.parentElement;
|
|
6757
|
-
}
|
|
6758
|
-
}
|
|
6759
|
-
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6760
|
-
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6761
|
-
// if parent is not found, measurements are checked against the viewport
|
|
6762
|
-
return {
|
|
6763
|
-
closableElHeight: closableEl.clientHeight,
|
|
6764
|
-
closableElWidth: closableEl.clientWidth,
|
|
6765
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6766
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6767
|
-
spaceAbove: parent
|
|
6768
|
-
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6769
|
-
: fixedEl.getBoundingClientRect().top,
|
|
6770
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6771
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6772
|
-
spaceBelow: parent
|
|
6773
|
-
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6774
|
-
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6775
|
-
spaceLeft: parent
|
|
6776
|
-
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6777
|
-
: fixedEl.getBoundingClientRect().left,
|
|
6778
|
-
spaceRight: parent
|
|
6779
|
-
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6780
|
-
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6781
|
-
};
|
|
6782
|
-
}
|
|
6783
|
-
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6784
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6785
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6786
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6787
|
-
) {
|
|
6788
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6789
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6790
|
-
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6791
|
-
return openUp;
|
|
6792
|
-
}
|
|
6793
|
-
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6794
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6795
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6796
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6797
|
-
) {
|
|
6798
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6799
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6800
|
-
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6801
|
-
return openDown;
|
|
6802
|
-
}
|
|
6803
|
-
function shouldShiftRight(fixedEl, closableEl) {
|
|
6804
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6805
|
-
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6806
|
-
return needsSpaceLeft;
|
|
6807
|
-
}
|
|
6808
|
-
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6809
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6810
|
-
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6811
|
-
return needsSpaceRight;
|
|
6812
|
-
}
|
|
6813
|
-
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6814
|
-
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6815
|
-
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6816
|
-
tooltipEl.style.top = "";
|
|
6817
|
-
tooltipEl.style.left = "";
|
|
6818
|
-
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6819
|
-
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6820
|
-
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6821
|
-
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6822
|
-
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6823
|
-
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6824
|
-
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6825
|
-
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6826
|
-
const swapAbove = (position) => {
|
|
6827
|
-
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6828
|
-
};
|
|
6829
|
-
const swapBelow = (position) => {
|
|
6830
|
-
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6831
|
-
};
|
|
6832
|
-
const swapLeft = (position, centeredPosition) => {
|
|
6833
|
-
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6834
|
-
position = position.replace("left", "right");
|
|
6835
|
-
}
|
|
6836
|
-
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6837
|
-
position = centeredPosition;
|
|
6838
|
-
}
|
|
6839
|
-
return position;
|
|
6840
|
-
};
|
|
6841
|
-
const swapRight = (position, centeredPosition) => {
|
|
6842
|
-
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6843
|
-
position = position.replace("right", "left");
|
|
6844
|
-
}
|
|
6845
|
-
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6846
|
-
position = centeredPosition;
|
|
6847
|
-
}
|
|
6848
|
-
return position;
|
|
6849
|
-
};
|
|
6850
|
-
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6851
|
-
switch (tPos) {
|
|
6852
|
-
case "left":
|
|
6853
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6854
|
-
case "right":
|
|
6855
|
-
tPos = swapRight(tPos, "bottom");
|
|
6856
|
-
case "top-left":
|
|
6857
|
-
tPos = swapLeft(tPos, "top");
|
|
6858
|
-
tPos = swapAbove(tPos);
|
|
6859
|
-
case "top-right":
|
|
6860
|
-
tPos = swapRight(tPos, "top");
|
|
6861
|
-
tPos = swapAbove(tPos);
|
|
6862
|
-
case "bottom-left":
|
|
6863
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6864
|
-
tPos = swapBelow(tPos);
|
|
6865
|
-
case "bottom-right":
|
|
6866
|
-
tPos = swapRight(tPos, "bottom");
|
|
6867
|
-
tPos = swapBelow(tPos);
|
|
6868
|
-
case "top":
|
|
6869
|
-
tPos = swapAbove(tPos);
|
|
6870
|
-
case "bottom":
|
|
6871
|
-
tPos = swapBelow(tPos);
|
|
6872
|
-
}
|
|
6873
|
-
return tPos;
|
|
6874
|
-
}
|
|
6875
|
-
function hasRoomRight(x, spaceNeeded) {
|
|
6876
|
-
let horizOffset = 0;
|
|
6877
|
-
// if (getTextDir() === "ltr") {
|
|
6878
|
-
if (x.type === "click") {
|
|
6879
|
-
// if it's a mouse event, deal with mouse coords
|
|
6880
|
-
horizOffset = x.clientX;
|
|
6881
|
-
// if it's a focus event, the offset is 0
|
|
6882
|
-
}
|
|
6883
|
-
else if (x.type === "focus") {
|
|
6884
|
-
horizOffset = 0;
|
|
6885
|
-
}
|
|
6886
|
-
else {
|
|
6887
|
-
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6888
|
-
let el = x; // re-assignment is for clarity
|
|
6889
|
-
while (el) {
|
|
6890
|
-
if (el.tagName == "BODY") {
|
|
6891
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
6892
|
-
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6893
|
-
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6894
|
-
}
|
|
6895
|
-
else {
|
|
6896
|
-
// for all other non-BODY elements
|
|
6897
|
-
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6898
|
-
}
|
|
6899
|
-
el = el.offsetParent;
|
|
6900
|
-
}
|
|
6901
|
-
// }
|
|
6902
|
-
}
|
|
6903
|
-
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6904
|
-
}
|
|
6905
|
-
function checkForActiveElInShadow(element) {
|
|
6906
|
-
while (element && element.shadowRoot) {
|
|
6907
|
-
element = element.shadowRoot.activeElement;
|
|
6908
|
-
}
|
|
6909
|
-
return element;
|
|
6910
|
-
}
|
|
6911
|
-
function checkForFocusableElInShadow(element) {
|
|
6912
|
-
const selectors = [
|
|
6913
|
-
"button",
|
|
6914
|
-
"a",
|
|
6915
|
-
"input",
|
|
6916
|
-
"select",
|
|
6917
|
-
"textarea",
|
|
6918
|
-
"wm-button",
|
|
6919
|
-
"wm-search",
|
|
6920
|
-
"wm-select",
|
|
6921
|
-
"wm-action-menu",
|
|
6922
|
-
"wm-tab-item",
|
|
6923
|
-
"wm-datepicker",
|
|
6924
|
-
];
|
|
6925
|
-
let focusableEl = element;
|
|
6926
|
-
selectors.forEach((selector) => {
|
|
6927
|
-
if (focusableEl && focusableEl.shadowRoot) {
|
|
6928
|
-
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6929
|
-
if (elInShadow) {
|
|
6930
|
-
if (selector.startsWith("wm-")) {
|
|
6931
|
-
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6932
|
-
}
|
|
6933
|
-
else {
|
|
6934
|
-
focusableEl = elInShadow;
|
|
6935
|
-
}
|
|
6936
|
-
}
|
|
6937
|
-
}
|
|
6938
|
-
});
|
|
6939
|
-
return focusableEl;
|
|
6940
|
-
}
|
|
6941
|
-
function isFocusable(element) {
|
|
6942
|
-
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6943
|
-
return true;
|
|
6944
|
-
}
|
|
6945
|
-
if (element.disabled) {
|
|
6946
|
-
return false;
|
|
6947
|
-
}
|
|
6948
|
-
switch (element.nodeName) {
|
|
6949
|
-
case "A":
|
|
6950
|
-
return !!element.href && element.rel != "ignore";
|
|
6951
|
-
case "INPUT":
|
|
6952
|
-
return element.type != "hidden" && element.type != "file";
|
|
6953
|
-
case "BUTTON":
|
|
6954
|
-
case "SELECT":
|
|
6955
|
-
case "TEXTAREA":
|
|
6956
|
-
case "WM-BUTTON":
|
|
6957
|
-
case "WM-SELECT":
|
|
6958
|
-
case "WM-ACTION-MENU":
|
|
6959
|
-
case "WM-DATEPICKER":
|
|
6960
|
-
case "WM-TIMEPICKER":
|
|
6961
|
-
case "WM-INPUT":
|
|
6962
|
-
case "WM-TAG-INPUT":
|
|
6963
|
-
case "WM-TAB-ITEM":
|
|
6964
|
-
case "WM-SEARCH":
|
|
6965
|
-
return true;
|
|
6966
|
-
default:
|
|
6967
|
-
return false;
|
|
6968
|
-
}
|
|
6969
|
-
}
|
|
6970
|
-
function getFirstFocusableDescendant(element) {
|
|
6971
|
-
if (isFocusable(element)) {
|
|
6972
|
-
return checkForFocusableElInShadow(element);
|
|
6973
|
-
}
|
|
6974
|
-
else if (element.childNodes.length > 0) {
|
|
6975
|
-
element.childNodes.forEach((i) => {
|
|
6976
|
-
const childEl = getFirstFocusableDescendant(i);
|
|
6977
|
-
return childEl && checkForFocusableElInShadow(childEl);
|
|
6978
|
-
});
|
|
6979
|
-
}
|
|
6980
|
-
}
|
|
6981
|
-
function hasValidType(file, types) {
|
|
6982
|
-
const acceptedExtensions = types.split(" ");
|
|
6983
|
-
const parts = file.name && file.name.split(".");
|
|
6984
|
-
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6985
|
-
return ext
|
|
6986
|
-
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6987
|
-
: // fallback: if we couldn't obtain an extension,
|
|
6988
|
-
// validate based on MIME type...
|
|
6989
|
-
!!file.type
|
|
6990
|
-
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
6991
|
-
: // ...and if that failed too, accept the file
|
|
6992
|
-
// as it's preferable to accept an invalid file
|
|
6993
|
-
// than refusing a valid one (back-end will take care of what slips through)
|
|
6994
|
-
true;
|
|
6995
|
-
}
|
|
6996
|
-
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
6997
|
-
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
6998
|
-
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
6999
|
-
// front end checks are just a convenience to users, independent of security.
|
|
7000
|
-
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
7001
|
-
const lookupTable = {
|
|
7002
|
-
aac: ["audio/aac"],
|
|
7003
|
-
abw: ["application/x-abiword"],
|
|
7004
|
-
arc: ["application/x-freearc"],
|
|
7005
|
-
avi: ["video/x-msvideo"],
|
|
7006
|
-
azw: ["application/vnd.amazon.ebook"],
|
|
7007
|
-
bin: ["application/octet-stream"],
|
|
7008
|
-
bmp: ["image/bmp"],
|
|
7009
|
-
bz: ["application/x-bzip"],
|
|
7010
|
-
bz2: ["application/x-bzip2"],
|
|
7011
|
-
csh: ["application/x-csh"],
|
|
7012
|
-
css: ["text/css"],
|
|
7013
|
-
csv: ["text/csv"],
|
|
7014
|
-
doc: ["application/msword"],
|
|
7015
|
-
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
7016
|
-
eot: ["application/vnd.ms-fontobject"],
|
|
7017
|
-
epub: ["application/epub+zip"],
|
|
7018
|
-
gz: ["application/gzip"],
|
|
7019
|
-
gif: ["image/gif"],
|
|
7020
|
-
htm: ["text/html"],
|
|
7021
|
-
html: ["text/html"],
|
|
7022
|
-
ico: ["image/vnd.microsoft.icon"],
|
|
7023
|
-
ics: ["text/calendar"],
|
|
7024
|
-
jar: ["application/java-archive"],
|
|
7025
|
-
jpeg: ["image/jpeg"],
|
|
7026
|
-
jpg: ["image/jpeg"],
|
|
7027
|
-
js: ["text/javascript"],
|
|
7028
|
-
json: ["application/json"],
|
|
7029
|
-
jsonld: ["application/ld+json"],
|
|
7030
|
-
log: ["text/plain"],
|
|
7031
|
-
mid: ["audio/x-midi"],
|
|
7032
|
-
midi: ["audio/x-midi"],
|
|
7033
|
-
mjs: ["text/javascript"],
|
|
7034
|
-
mp3: ["audio/mpeg"],
|
|
7035
|
-
mpeg: ["video/mpeg"],
|
|
7036
|
-
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7037
|
-
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7038
|
-
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7039
|
-
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7040
|
-
oga: ["audio/ogg"],
|
|
7041
|
-
ogv: ["video/ogg"],
|
|
7042
|
-
ogx: ["application/ogg"],
|
|
7043
|
-
opus: ["audio/opus"],
|
|
7044
|
-
otf: ["font/otf"],
|
|
7045
|
-
png: ["image/png"],
|
|
7046
|
-
pdf: ["application/pdf"],
|
|
7047
|
-
php: ["application/php"],
|
|
7048
|
-
ppt: ["application/vnd.ms-powerpoint"],
|
|
7049
|
-
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7050
|
-
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7051
|
-
rtf: ["application/rtf"],
|
|
7052
|
-
sh: ["application/x-sh"],
|
|
7053
|
-
svg: ["image/svg+xml"],
|
|
7054
|
-
swf: ["application/x-shockwave-flash"],
|
|
7055
|
-
tar: ["application/x-tar"],
|
|
7056
|
-
tif: ["image/tiff"],
|
|
7057
|
-
tiff: ["image/tiff"],
|
|
7058
|
-
ts: ["video/mp2t"],
|
|
7059
|
-
ttf: ["font/ttf"],
|
|
7060
|
-
txt: ["text/plain"],
|
|
7061
|
-
vsd: ["application/vnd.visio"],
|
|
7062
|
-
wav: ["audio/wav"],
|
|
7063
|
-
weba: ["audio/webm"],
|
|
7064
|
-
webm: ["video/webm"],
|
|
7065
|
-
webp: ["image/webp"],
|
|
7066
|
-
woff: ["font/woff"],
|
|
7067
|
-
woff2: ["font/woff2"],
|
|
7068
|
-
xhtml: ["application/xhtml+xml"],
|
|
7069
|
-
xls: ["application/vnd.ms-excel"],
|
|
7070
|
-
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7071
|
-
xml: ["application/xml", "text/xml"],
|
|
7072
|
-
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7073
|
-
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7074
|
-
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7075
|
-
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7076
|
-
"7z": ["application/x-7z-compressed"],
|
|
7077
|
-
};
|
|
7078
|
-
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7079
|
-
}
|
|
7080
|
-
function snakeCaseToCamelCase(str) {
|
|
7081
|
-
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7082
|
-
if (snakeCaseRegexp.test(str)) {
|
|
7083
|
-
let camelCase = "";
|
|
7084
|
-
let arr = str.split("_");
|
|
7085
|
-
arr.forEach((word, idx) => {
|
|
7086
|
-
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7087
|
-
});
|
|
7088
|
-
return camelCase;
|
|
7089
|
-
}
|
|
7090
|
-
else {
|
|
7091
|
-
return str;
|
|
7092
|
-
}
|
|
7093
|
-
}
|
|
7094
|
-
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7095
|
-
let newIndex = currentIndex;
|
|
7096
|
-
if (direction === "ArrowDown") {
|
|
7097
|
-
newIndex = (currentIndex + 1) % listLength;
|
|
7098
|
-
}
|
|
7099
|
-
if (direction === "ArrowUp") {
|
|
7100
|
-
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7101
|
-
}
|
|
7102
|
-
return newIndex;
|
|
7103
|
-
}
|
|
7104
|
-
function isRelatedTarget(ev, id) {
|
|
7105
|
-
// used for onBlur events to check the element that has been clicked
|
|
7106
|
-
const ids = id.split(" ");
|
|
7107
|
-
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7108
|
-
}
|
|
7109
|
-
function toBool(val) {
|
|
7110
|
-
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7111
|
-
return val == "false" ? false : !!val;
|
|
7112
|
-
}
|
|
7113
|
-
/*
|
|
7114
|
-
* this is going to be needed to solve the extra tabbing on navigator
|
|
7115
|
-
* and for programmatic focus of tabs
|
|
7116
|
-
* Here's a draft, not bug proof, see:
|
|
7117
|
-
* https://stackoverflow.com/a/10730308/3741713
|
|
7118
|
-
|
|
7119
|
-
function getKeyboardFocusableElements(element = document) {
|
|
7120
|
-
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'));
|
|
7121
|
-
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7122
|
-
}
|
|
7123
|
-
|
|
7124
|
-
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7125
|
-
const els = getKeyboardFocusableElements();
|
|
7126
|
-
const current = els.indexOf(element);
|
|
7127
|
-
return els[current - 1] as HTMLElement;
|
|
7128
|
-
}
|
|
7129
|
-
|
|
7130
|
-
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7131
|
-
const els = getKeyboardFocusableElements();
|
|
7132
|
-
const current = els.indexOf(element);
|
|
7133
|
-
return els[current + 1] as HTMLElement;
|
|
7134
|
-
}
|
|
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
|
+
}
|
|
7135
7109
|
*/
|
|
7136
7110
|
|
|
7137
7111
|
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 };
|