@watermarkinsights/ripple 3.9.0-6 → 3.9.1
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-01bb841e.js → chartFunctions-dbbea5a8.js} +417 -417
- package/dist/cjs/{functions-33825afb.js → functions-15e21d53.js} +556 -506
- package/dist/cjs/{global-d016e7de.js → global-3b6559f9.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 -454
- 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 → wm-progress-indicator_3.cjs.entry.js} +143 -82
- 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 -380
- package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +9 -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 +88 -88
- 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 +11 -12
- 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 +11 -12
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +785 -785
- package/dist/collection/components/wm-uploader/wm-uploader.css +11 -12
- package/dist/collection/components/wm-uploader/wm-uploader.js +780 -780
- 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 +418 -418
- 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 -43
- package/dist/collection/lang/piglatin.js +93 -93
- package/dist/esm/{chartFunctions-4be35472.js → chartFunctions-303e1644.js} +417 -417
- package/dist/esm/{functions-a326c899.js → functions-e552a8b5.js} +556 -506
- package/dist/esm/{global-9823b157.js → global-ed48a3d4.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 -454
- 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 → wm-progress-indicator_3.entry.js} +142 -83
- 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 -380
- package/dist/esm/wm-wrapper.entry.js +13 -13
- package/dist/esm-es5/chartFunctions-303e1644.js +1 -0
- package/dist/esm-es5/functions-e552a8b5.js +15 -0
- package/dist/esm-es5/global-ed48a3d4.js +1 -0
- 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_3.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 +0 -1
- package/dist/ripple/p-01d2c1ab.entry.js +1 -0
- package/dist/ripple/p-02a3c14f.entry.js +1 -0
- package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
- package/dist/ripple/p-0df9fc96.entry.js +1 -0
- package/dist/ripple/p-1116a297.entry.js +1 -0
- package/dist/ripple/p-13a746ea.entry.js +1 -0
- package/dist/ripple/p-15cc26f7.js +1 -0
- package/dist/ripple/p-175eba9d.system.js +15 -0
- package/dist/ripple/p-1d0742b0.entry.js +1 -0
- package/dist/ripple/{p-bfc1ab2e.system.entry.js → p-1df2adee.system.entry.js} +1 -1
- package/dist/ripple/p-313b6073.system.js +1 -0
- package/dist/ripple/{p-19331b32.system.entry.js → p-32336c78.system.entry.js} +1 -1
- package/dist/ripple/p-358bde27.entry.js +1 -0
- package/dist/ripple/p-35ce3ff8.entry.js +1 -0
- package/dist/ripple/{p-2b63995f.system.entry.js → p-3b3e847c.system.entry.js} +1 -1
- package/dist/ripple/p-3bed42bf.entry.js +1 -0
- package/dist/ripple/p-3fa5f0f0.system.entry.js +1 -0
- package/dist/ripple/p-461f08d4.entry.js +1 -0
- package/dist/ripple/p-4d59fe86.entry.js +1 -0
- package/dist/ripple/p-50db2d6a.system.entry.js +1 -0
- package/dist/ripple/p-510a2a2d.system.entry.js +1 -0
- package/dist/ripple/p-5c099280.entry.js +1 -0
- package/dist/ripple/{p-12681f66.system.entry.js → p-64053e24.system.entry.js} +1 -1
- package/dist/ripple/p-6910f965.entry.js +1 -0
- package/dist/ripple/{p-0ff4d5d1.system.entry.js → p-69f21f1a.system.entry.js} +1 -1
- package/dist/ripple/{p-e9951aa1.js → p-6bc557fa.js} +1 -1
- package/dist/ripple/{p-66b6f53d.system.entry.js → p-7d26d093.system.entry.js} +1 -1
- package/dist/ripple/p-7fae0cc2.entry.js +1 -0
- package/dist/ripple/p-83fe767e.entry.js +1 -0
- package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
- package/dist/ripple/p-88927384.system.js +1 -0
- package/dist/ripple/p-89372ba5.system.entry.js +1 -0
- package/dist/ripple/p-89b324ce.system.entry.js +1 -0
- package/dist/ripple/{p-099df7b7.system.entry.js → p-90ed3268.system.entry.js} +1 -1
- package/dist/ripple/p-936fbfff.entry.js +1 -0
- package/dist/ripple/p-9d69aa46.system.entry.js +1 -0
- package/dist/ripple/p-a0c3ef16.system.js +1 -0
- package/dist/ripple/p-a216c161.system.entry.js +1 -0
- package/dist/ripple/p-a51453f6.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-9fae30ed.system.entry.js → p-aa104594.system.entry.js} +1 -1
- package/dist/ripple/{p-a1511315.system.entry.js → p-ae6cfbca.system.entry.js} +1 -1
- package/dist/ripple/p-b3c71506.js +1 -0
- package/dist/ripple/p-b4724251.entry.js +1 -0
- package/dist/ripple/{p-ddf157c8.system.entry.js → p-b4efa7d1.system.entry.js} +1 -1
- package/dist/ripple/p-b786a5fd.system.entry.js +1 -0
- package/dist/ripple/p-b8b35084.system.js +1 -0
- package/dist/ripple/p-bb0c21e5.entry.js +1 -0
- package/dist/ripple/p-bd5a6394.entry.js +1 -0
- package/dist/ripple/p-c77d79be.entry.js +1 -0
- package/dist/ripple/p-c92d970a.system.entry.js +1 -0
- package/dist/ripple/p-c9541d4d.system.entry.js +1 -0
- package/dist/ripple/p-ca7c628f.entry.js +1 -0
- package/dist/ripple/p-cae4ebf4.system.entry.js +1 -0
- package/dist/ripple/p-cf648440.entry.js +1 -0
- package/dist/ripple/p-d93d5885.entry.js +1 -0
- package/dist/ripple/{p-33d23baa.system.entry.js → p-e490e37f.system.entry.js} +1 -1
- package/dist/ripple/p-e51562cd.system.entry.js +1 -0
- package/dist/ripple/p-eaedb11d.system.entry.js +1 -0
- package/dist/ripple/p-ed8115b9.system.entry.js +1 -0
- package/dist/ripple/p-f24ff348.system.js +1 -0
- package/dist/ripple/p-f37b54be.js +16 -0
- package/dist/ripple/p-f5f8bb25.system.entry.js +1 -0
- package/dist/ripple/p-f6342e81.entry.js +1 -0
- package/dist/ripple/p-f9c3a2ce.entry.js +1 -0
- package/dist/ripple/{p-5c199fd5.system.entry.js → p-fda5a778.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +27 -27
- 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-indicator.d.ts +26 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +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/cjs/wm-progress-monitor.cjs.entry.js +0 -57
- package/dist/cjs/wm-progress-slice.cjs.entry.js +0 -17
- package/dist/esm/wm-progress-monitor.entry.js +0 -53
- package/dist/esm/wm-progress-slice.entry.js +0 -13
- package/dist/esm-es5/chartFunctions-4be35472.js +0 -1
- package/dist/esm-es5/functions-a326c899.js +0 -15
- package/dist/esm-es5/global-9823b157.js +0 -1
- package/dist/esm-es5/index-d649a861.js +0 -1
- package/dist/esm-es5/wm-progress-indicator.entry.js +0 -1
- package/dist/esm-es5/wm-progress-monitor.entry.js +0 -1
- package/dist/esm-es5/wm-progress-slice.entry.js +0 -1
- package/dist/ripple/p-0404f9e8.system.js +0 -1
- package/dist/ripple/p-09341809.system.entry.js +0 -1
- package/dist/ripple/p-0c45ad74.entry.js +0 -1
- package/dist/ripple/p-1a2b34ee.system.entry.js +0 -1
- package/dist/ripple/p-1e7fc028.entry.js +0 -1
- package/dist/ripple/p-2b6246d9.entry.js +0 -1
- package/dist/ripple/p-2d20de1e.system.entry.js +0 -1
- package/dist/ripple/p-33ee2cf6.js +0 -1
- package/dist/ripple/p-34b5af5b.system.entry.js +0 -1
- package/dist/ripple/p-36456289.system.entry.js +0 -1
- package/dist/ripple/p-3710ef3e.system.entry.js +0 -1
- package/dist/ripple/p-407735b2.entry.js +0 -1
- package/dist/ripple/p-49bb18cc.entry.js +0 -1
- package/dist/ripple/p-50be3b44.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-6c295beb.entry.js +0 -1
- package/dist/ripple/p-6c751341.entry.js +0 -1
- package/dist/ripple/p-6ea8120e.system.entry.js +0 -1
- package/dist/ripple/p-70165cfb.entry.js +0 -1
- package/dist/ripple/p-76678c87.system.entry.js +0 -1
- package/dist/ripple/p-767d370a.entry.js +0 -1
- package/dist/ripple/p-777105ef.entry.js +0 -1
- package/dist/ripple/p-77cd6501.system.js +0 -1
- package/dist/ripple/p-7918cebe.entry.js +0 -1
- package/dist/ripple/p-7b10708b.system.entry.js +0 -1
- package/dist/ripple/p-7c2b1682.entry.js +0 -1
- package/dist/ripple/p-8aefc87b.entry.js +0 -1
- package/dist/ripple/p-8c11c2cb.entry.js +0 -1
- package/dist/ripple/p-8caffd40.entry.js +0 -1
- package/dist/ripple/p-90d6e070.entry.js +0 -1
- package/dist/ripple/p-95139f95.system.entry.js +0 -1
- package/dist/ripple/p-97647fa9.entry.js +0 -1
- package/dist/ripple/p-9c940014.js +0 -16
- package/dist/ripple/p-9d02957d.system.js +0 -1
- package/dist/ripple/p-9f07588b.entry.js +0 -1
- package/dist/ripple/p-a11f9b93.system.entry.js +0 -1
- package/dist/ripple/p-b96c7863.system.entry.js +0 -1
- package/dist/ripple/p-b9c1b0bf.entry.js +0 -1
- package/dist/ripple/p-bb73ebab.system.js +0 -1
- package/dist/ripple/p-c233717a.entry.js +0 -1
- package/dist/ripple/p-c3720168.system.entry.js +0 -1
- package/dist/ripple/p-c9e598b4.entry.js +0 -1
- package/dist/ripple/p-d17345cb.entry.js +0 -1
- package/dist/ripple/p-d9912bd5.entry.js +0 -1
- package/dist/ripple/p-dc32ec0c.system.entry.js +0 -1
- package/dist/ripple/p-dddae010.system.entry.js +0 -1
- package/dist/ripple/p-e7212c03.entry.js +0 -1
- package/dist/ripple/p-e802ba67.entry.js +0 -1
- package/dist/ripple/p-ed6c5269.system.js +0 -15
- package/dist/ripple/p-f2b9a140.entry.js +0 -1
- package/dist/ripple/p-f5486f80.system.entry.js +0 -1
- package/dist/ripple/p-f70cc1ab.entry.js +0 -1
- package/dist/ripple/p-fdbfae1c.entry.js +0 -1
- package/dist/ripple/p-ffbc5db3.entry.js +0 -1
|
@@ -1299,6 +1299,12 @@ const fr = {
|
|
|
1299
1299
|
type: 0,
|
|
1300
1300
|
value: "suivant"
|
|
1301
1301
|
}
|
|
1302
|
+
],
|
|
1303
|
+
"global.openVerb": [
|
|
1304
|
+
{
|
|
1305
|
+
type: 0,
|
|
1306
|
+
value: "Ouvrir"
|
|
1307
|
+
}
|
|
1302
1308
|
],
|
|
1303
1309
|
"global.previous": [
|
|
1304
1310
|
{
|
|
@@ -1323,6 +1329,18 @@ const fr = {
|
|
|
1323
1329
|
type: 0,
|
|
1324
1330
|
value: "Entrez un nombre valide."
|
|
1325
1331
|
}
|
|
1332
|
+
],
|
|
1333
|
+
"navigation.mainNavigation": [
|
|
1334
|
+
{
|
|
1335
|
+
type: 0,
|
|
1336
|
+
value: "Principale"
|
|
1337
|
+
}
|
|
1338
|
+
],
|
|
1339
|
+
"navigation.showNavigation": [
|
|
1340
|
+
{
|
|
1341
|
+
type: 0,
|
|
1342
|
+
value: "Ouvrir la navigation"
|
|
1343
|
+
}
|
|
1326
1344
|
],
|
|
1327
1345
|
"navigator.WatermarkAppNavigation": [
|
|
1328
1346
|
{
|
|
@@ -1777,6 +1795,12 @@ const fr = {
|
|
|
1777
1795
|
type: 0,
|
|
1778
1796
|
value: "%"
|
|
1779
1797
|
}
|
|
1798
|
+
],
|
|
1799
|
+
"uploader.waitToUpload": [
|
|
1800
|
+
{
|
|
1801
|
+
type: 0,
|
|
1802
|
+
value: "Attendez la fin du chargement en cours pour ajouter de nouveaux fichiers."
|
|
1803
|
+
}
|
|
1780
1804
|
]
|
|
1781
1805
|
};
|
|
1782
1806
|
|
|
@@ -3928,11 +3952,17 @@ function icuUnitToEcma(unit) {
|
|
|
3928
3952
|
return unit.replace(/^(.*?)-/, '');
|
|
3929
3953
|
}
|
|
3930
3954
|
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3931
|
-
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
3955
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
3932
3956
|
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3933
3957
|
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
3934
3958
|
function parseSignificantPrecision(str) {
|
|
3935
3959
|
var result = {};
|
|
3960
|
+
if (str[str.length - 1] === 'r') {
|
|
3961
|
+
result.roundingPriority = 'morePrecision';
|
|
3962
|
+
}
|
|
3963
|
+
else if (str[str.length - 1] === 's') {
|
|
3964
|
+
result.roundingPriority = 'lessPrecision';
|
|
3965
|
+
}
|
|
3936
3966
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
|
|
3937
3967
|
// @@@ case
|
|
3938
3968
|
if (typeof g2 !== 'string') {
|
|
@@ -4159,8 +4189,13 @@ function parseNumberSkeleton(tokens) {
|
|
|
4159
4189
|
}
|
|
4160
4190
|
return '';
|
|
4161
4191
|
});
|
|
4162
|
-
|
|
4163
|
-
|
|
4192
|
+
var opt = token.options[0];
|
|
4193
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
4194
|
+
if (opt === 'w') {
|
|
4195
|
+
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
|
|
4196
|
+
}
|
|
4197
|
+
else if (opt) {
|
|
4198
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
4164
4199
|
}
|
|
4165
4200
|
continue;
|
|
4166
4201
|
}
|
|
@@ -4182,8 +4217,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4182
4217
|
}
|
|
4183
4218
|
|
|
4184
4219
|
var _a;
|
|
4185
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
4186
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source
|
|
4220
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
4221
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
4187
4222
|
function createLocation(start, end) {
|
|
4188
4223
|
return { start: start, end: end };
|
|
4189
4224
|
}
|
|
@@ -4430,7 +4465,7 @@ var Parser = /** @class */ (function () {
|
|
|
4430
4465
|
return {
|
|
4431
4466
|
val: {
|
|
4432
4467
|
type: TYPE.literal,
|
|
4433
|
-
value: "<"
|
|
4468
|
+
value: "<".concat(tagName, "/>"),
|
|
4434
4469
|
location: createLocation(startPosition, this.clonePosition()),
|
|
4435
4470
|
},
|
|
4436
4471
|
err: null,
|
|
@@ -5035,7 +5070,7 @@ var Parser = /** @class */ (function () {
|
|
|
5035
5070
|
}
|
|
5036
5071
|
var code = codePointAt(this.message, offset);
|
|
5037
5072
|
if (code === undefined) {
|
|
5038
|
-
throw Error("Offset "
|
|
5073
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
5039
5074
|
}
|
|
5040
5075
|
return code;
|
|
5041
5076
|
};
|
|
@@ -5103,7 +5138,7 @@ var Parser = /** @class */ (function () {
|
|
|
5103
5138
|
*/
|
|
5104
5139
|
Parser.prototype.bumpTo = function (targetOffset) {
|
|
5105
5140
|
if (this.offset() > targetOffset) {
|
|
5106
|
-
throw Error("targetOffset "
|
|
5141
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
5107
5142
|
}
|
|
5108
5143
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
5109
5144
|
while (true) {
|
|
@@ -5112,7 +5147,7 @@ var Parser = /** @class */ (function () {
|
|
|
5112
5147
|
break;
|
|
5113
5148
|
}
|
|
5114
5149
|
if (offset > targetOffset) {
|
|
5115
|
-
throw Error("targetOffset "
|
|
5150
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
5116
5151
|
}
|
|
5117
5152
|
this.bump();
|
|
5118
5153
|
if (this.isEOF()) {
|
|
@@ -5578,28 +5613,28 @@ var FormatError = /** @class */ (function (_super) {
|
|
|
5578
5613
|
return _this;
|
|
5579
5614
|
}
|
|
5580
5615
|
FormatError.prototype.toString = function () {
|
|
5581
|
-
return "[formatjs Error: "
|
|
5616
|
+
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
5582
5617
|
};
|
|
5583
5618
|
return FormatError;
|
|
5584
5619
|
}(Error));
|
|
5585
5620
|
var InvalidValueError = /** @class */ (function (_super) {
|
|
5586
5621
|
__extends(InvalidValueError, _super);
|
|
5587
5622
|
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
5588
|
-
return _super.call(this, "Invalid values for \""
|
|
5623
|
+
return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5589
5624
|
}
|
|
5590
5625
|
return InvalidValueError;
|
|
5591
5626
|
}(FormatError));
|
|
5592
5627
|
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
5593
5628
|
__extends(InvalidValueTypeError, _super);
|
|
5594
5629
|
function InvalidValueTypeError(value, type, originalMessage) {
|
|
5595
|
-
return _super.call(this, "Value for \""
|
|
5630
|
+
return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5596
5631
|
}
|
|
5597
5632
|
return InvalidValueTypeError;
|
|
5598
5633
|
}(FormatError));
|
|
5599
5634
|
var MissingValueError = /** @class */ (function (_super) {
|
|
5600
5635
|
__extends(MissingValueError, _super);
|
|
5601
5636
|
function MissingValueError(variableId, originalMessage) {
|
|
5602
|
-
return _super.call(this, "The intl string context variable \""
|
|
5637
|
+
return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
5603
5638
|
}
|
|
5604
5639
|
return MissingValueError;
|
|
5605
5640
|
}(FormatError));
|
|
@@ -5760,7 +5795,7 @@ originalMessage) {
|
|
|
5760
5795
|
continue;
|
|
5761
5796
|
}
|
|
5762
5797
|
if (isPluralElement(el)) {
|
|
5763
|
-
var opt = el.options["="
|
|
5798
|
+
var opt = el.options["=".concat(value)];
|
|
5764
5799
|
if (!opt) {
|
|
5765
5800
|
if (!Intl.PluralRules) {
|
|
5766
5801
|
throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -5831,7 +5866,7 @@ function createDefaultFormatters(cache) {
|
|
|
5831
5866
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5832
5867
|
args[_i] = arguments[_i];
|
|
5833
5868
|
}
|
|
5834
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5869
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5835
5870
|
}, {
|
|
5836
5871
|
cache: createFastMemoizeCache$1(cache.number),
|
|
5837
5872
|
strategy: strategies.variadic,
|
|
@@ -5842,7 +5877,7 @@ function createDefaultFormatters(cache) {
|
|
|
5842
5877
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5843
5878
|
args[_i] = arguments[_i];
|
|
5844
5879
|
}
|
|
5845
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5880
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5846
5881
|
}, {
|
|
5847
5882
|
cache: createFastMemoizeCache$1(cache.dateTime),
|
|
5848
5883
|
strategy: strategies.variadic,
|
|
@@ -5853,7 +5888,7 @@ function createDefaultFormatters(cache) {
|
|
|
5853
5888
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5854
5889
|
args[_i] = arguments[_i];
|
|
5855
5890
|
}
|
|
5856
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5891
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
5857
5892
|
}, {
|
|
5858
5893
|
cache: createFastMemoizeCache$1(cache.pluralRules),
|
|
5859
5894
|
strategy: strategies.variadic,
|
|
@@ -6011,7 +6046,13 @@ var IntlErrorCode;
|
|
|
6011
6046
|
var IntlError = /** @class */ (function (_super) {
|
|
6012
6047
|
__extends(IntlError, _super);
|
|
6013
6048
|
function IntlError(code, message, exception) {
|
|
6014
|
-
var _this =
|
|
6049
|
+
var _this = this;
|
|
6050
|
+
var err = exception
|
|
6051
|
+
? exception instanceof Error
|
|
6052
|
+
? exception
|
|
6053
|
+
: new Error(String(exception))
|
|
6054
|
+
: undefined;
|
|
6055
|
+
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
|
|
6015
6056
|
_this.code = code;
|
|
6016
6057
|
// @ts-ignore just so we don't need to declare dep on @types/node
|
|
6017
6058
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -6043,19 +6084,26 @@ var MissingDataError = /** @class */ (function (_super) {
|
|
|
6043
6084
|
}
|
|
6044
6085
|
return MissingDataError;
|
|
6045
6086
|
}(IntlError));
|
|
6087
|
+
var IntlFormatError = /** @class */ (function (_super) {
|
|
6088
|
+
__extends(IntlFormatError, _super);
|
|
6089
|
+
function IntlFormatError(message, locale, exception) {
|
|
6090
|
+
return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
|
|
6091
|
+
}
|
|
6092
|
+
return IntlFormatError;
|
|
6093
|
+
}(IntlError));
|
|
6046
6094
|
var MessageFormatError = /** @class */ (function (_super) {
|
|
6047
6095
|
__extends(MessageFormatError, _super);
|
|
6048
6096
|
function MessageFormatError(message, locale, descriptor, exception) {
|
|
6049
|
-
var _this = _super.call(this,
|
|
6097
|
+
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;
|
|
6050
6098
|
_this.descriptor = descriptor;
|
|
6051
6099
|
return _this;
|
|
6052
6100
|
}
|
|
6053
6101
|
return MessageFormatError;
|
|
6054
|
-
}(
|
|
6102
|
+
}(IntlFormatError));
|
|
6055
6103
|
var MissingTranslationError = /** @class */ (function (_super) {
|
|
6056
6104
|
__extends(MissingTranslationError, _super);
|
|
6057
6105
|
function MissingTranslationError(descriptor, locale) {
|
|
6058
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \""
|
|
6106
|
+
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;
|
|
6059
6107
|
_this.descriptor = descriptor;
|
|
6060
6108
|
return _this;
|
|
6061
6109
|
}
|
|
@@ -6082,6 +6130,7 @@ var DEFAULT_INTL_CONFIG = {
|
|
|
6082
6130
|
timeZone: undefined,
|
|
6083
6131
|
defaultLocale: 'en',
|
|
6084
6132
|
defaultFormats: {},
|
|
6133
|
+
fallbackOnEmptyString: true,
|
|
6085
6134
|
onError: defaultErrorHandler,
|
|
6086
6135
|
};
|
|
6087
6136
|
function createIntlCache() {
|
|
@@ -6124,7 +6173,7 @@ function createFormatters(cache) {
|
|
|
6124
6173
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6125
6174
|
args[_i] = arguments[_i];
|
|
6126
6175
|
}
|
|
6127
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6176
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6128
6177
|
}, {
|
|
6129
6178
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
6130
6179
|
strategy: strategies.variadic,
|
|
@@ -6135,7 +6184,7 @@ function createFormatters(cache) {
|
|
|
6135
6184
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6136
6185
|
args[_i] = arguments[_i];
|
|
6137
6186
|
}
|
|
6138
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6187
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6139
6188
|
}, {
|
|
6140
6189
|
cache: createFastMemoizeCache(cache.number),
|
|
6141
6190
|
strategy: strategies.variadic,
|
|
@@ -6146,7 +6195,7 @@ function createFormatters(cache) {
|
|
|
6146
6195
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6147
6196
|
args[_i] = arguments[_i];
|
|
6148
6197
|
}
|
|
6149
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6198
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
6150
6199
|
}, {
|
|
6151
6200
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
6152
6201
|
strategy: strategies.variadic,
|
|
@@ -6169,7 +6218,7 @@ function createFormatters(cache) {
|
|
|
6169
6218
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6170
6219
|
args[_i] = arguments[_i];
|
|
6171
6220
|
}
|
|
6172
|
-
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
|
|
6221
|
+
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();
|
|
6173
6222
|
}, {
|
|
6174
6223
|
cache: createFastMemoizeCache(cache.relativeTime),
|
|
6175
6224
|
strategy: strategies.variadic,
|
|
@@ -6180,7 +6229,7 @@ function createFormatters(cache) {
|
|
|
6180
6229
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6181
6230
|
args[_i] = arguments[_i];
|
|
6182
6231
|
}
|
|
6183
|
-
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
|
|
6232
|
+
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();
|
|
6184
6233
|
}, {
|
|
6185
6234
|
cache: createFastMemoizeCache(cache.list),
|
|
6186
6235
|
strategy: strategies.variadic,
|
|
@@ -6190,7 +6239,7 @@ function createFormatters(cache) {
|
|
|
6190
6239
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6191
6240
|
args[_i] = arguments[_i];
|
|
6192
6241
|
}
|
|
6193
|
-
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
|
|
6242
|
+
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();
|
|
6194
6243
|
}, {
|
|
6195
6244
|
cache: createFastMemoizeCache(cache.displayNames),
|
|
6196
6245
|
strategy: strategies.variadic,
|
|
@@ -6206,7 +6255,7 @@ function getNamedFormat(formats, type, name, onError) {
|
|
|
6206
6255
|
if (format) {
|
|
6207
6256
|
return format;
|
|
6208
6257
|
}
|
|
6209
|
-
onError(new UnsupportedFormatterError("No "
|
|
6258
|
+
onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
|
|
6210
6259
|
}
|
|
6211
6260
|
|
|
6212
6261
|
/**
|
|
@@ -6241,7 +6290,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
6241
6290
|
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)) });
|
|
6242
6291
|
}
|
|
6243
6292
|
function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
6244
|
-
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;
|
|
6293
|
+
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;
|
|
6245
6294
|
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
|
|
6246
6295
|
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
|
|
6247
6296
|
// `id` is a required field of a Message Descriptor.
|
|
@@ -6271,6 +6320,9 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6271
6320
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
6272
6321
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
6273
6322
|
if (!message) {
|
|
6323
|
+
if (fallbackOnEmptyString === false && message === '') {
|
|
6324
|
+
return message;
|
|
6325
|
+
}
|
|
6274
6326
|
if (!defaultMessage ||
|
|
6275
6327
|
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
6276
6328
|
// This prevents warnings from littering the console in development
|
|
@@ -6284,7 +6336,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6284
6336
|
return formatter.format(values);
|
|
6285
6337
|
}
|
|
6286
6338
|
catch (e) {
|
|
6287
|
-
onError(new MessageFormatError("Error formatting default message for: \""
|
|
6339
|
+
onError(new MessageFormatError("Error formatting default message for: \"".concat(id, "\", rendering default message verbatim"), locale, messageDescriptor, e));
|
|
6288
6340
|
return typeof defaultMessage === 'string' ? defaultMessage : id;
|
|
6289
6341
|
}
|
|
6290
6342
|
}
|
|
@@ -6296,7 +6348,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6296
6348
|
return formatter.format(values);
|
|
6297
6349
|
}
|
|
6298
6350
|
catch (e) {
|
|
6299
|
-
onError(new MessageFormatError("Error formatting message: \""
|
|
6351
|
+
onError(new MessageFormatError("Error formatting message: \"".concat(id, "\", using ").concat(defaultMessage ? 'default message' : 'id', " as fallback."), locale, messageDescriptor, e));
|
|
6300
6352
|
}
|
|
6301
6353
|
if (defaultMessage) {
|
|
6302
6354
|
try {
|
|
@@ -6304,7 +6356,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6304
6356
|
return formatter.format(values);
|
|
6305
6357
|
}
|
|
6306
6358
|
catch (e) {
|
|
6307
|
-
onError(new MessageFormatError("Error formatting the default message for: \""
|
|
6359
|
+
onError(new MessageFormatError("Error formatting the default message for: \"".concat(id, "\", rendering message verbatim"), locale, messageDescriptor, e));
|
|
6308
6360
|
}
|
|
6309
6361
|
}
|
|
6310
6362
|
if (typeof message === 'string') {
|
|
@@ -6342,9 +6394,7 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
|
|
|
6342
6394
|
if (options === void 0) { options = {}; }
|
|
6343
6395
|
var format = options.format;
|
|
6344
6396
|
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
|
|
6345
|
-
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6346
|
-
// @ts-expect-error es2020 has a lot stuff from es2021 bleed in
|
|
6347
|
-
defaults);
|
|
6397
|
+
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
|
|
6348
6398
|
if (type === 'time' &&
|
|
6349
6399
|
!filteredOptions.hour &&
|
|
6350
6400
|
!filteredOptions.minute &&
|
|
@@ -6461,7 +6511,7 @@ var LIST_FORMAT_OPTIONS = [
|
|
|
6461
6511
|
];
|
|
6462
6512
|
var now = Date.now();
|
|
6463
6513
|
function generateToken(i) {
|
|
6464
|
-
return now
|
|
6514
|
+
return "".concat(now, "_").concat(i, "_").concat(now);
|
|
6465
6515
|
}
|
|
6466
6516
|
function formatList(opts, getListFormat, values, options) {
|
|
6467
6517
|
if (options === void 0) { options = {}; }
|
|
@@ -6528,7 +6578,7 @@ function formatPlural(_a, getPluralRules, value, options) {
|
|
|
6528
6578
|
return getPluralRules(locale, filteredOptions).select(value);
|
|
6529
6579
|
}
|
|
6530
6580
|
catch (e) {
|
|
6531
|
-
onError(new
|
|
6581
|
+
onError(new IntlFormatError('Error formatting plural.', locale, e));
|
|
6532
6582
|
}
|
|
6533
6583
|
return 'other';
|
|
6534
6584
|
}
|
|
@@ -6555,7 +6605,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
|
|
|
6555
6605
|
return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
|
|
6556
6606
|
}
|
|
6557
6607
|
catch (e) {
|
|
6558
|
-
config.onError(new
|
|
6608
|
+
config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));
|
|
6559
6609
|
}
|
|
6560
6610
|
return String(value);
|
|
6561
6611
|
}
|
|
@@ -6635,7 +6685,7 @@ function createIntl(config, cache) {
|
|
|
6635
6685
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
6636
6686
|
if (!locale) {
|
|
6637
6687
|
if (onError) {
|
|
6638
|
-
onError(new InvalidConfigError("\"locale\" was not configured, using \""
|
|
6688
|
+
onError(new InvalidConfigError("\"locale\" was not configured, using \"".concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details")));
|
|
6639
6689
|
}
|
|
6640
6690
|
// Since there's no registered locale data for `locale`, this will
|
|
6641
6691
|
// fallback to the `defaultLocale` to make sure things can render.
|
|
@@ -6645,481 +6695,481 @@ function createIntl(config, cache) {
|
|
|
6645
6695
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
6646
6696
|
}
|
|
6647
6697
|
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
6648
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6698
|
+
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")));
|
|
6649
6699
|
}
|
|
6650
6700
|
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
|
|
6651
6701
|
onError) {
|
|
6652
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6702
|
+
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")));
|
|
6653
6703
|
}
|
|
6654
6704
|
verifyConfigMessages(resolvedConfig);
|
|
6655
6705
|
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) });
|
|
6656
6706
|
}
|
|
6657
6707
|
|
|
6658
|
-
const DEFAULT_LANGUAGE = "en";
|
|
6659
|
-
function getBrowserLang() {
|
|
6660
|
-
const langAttr = document.documentElement.getAttribute("lang");
|
|
6661
|
-
if (!!langAttr) {
|
|
6662
|
-
return langAttr;
|
|
6663
|
-
}
|
|
6664
|
-
else if (window.navigator && window.navigator.language) {
|
|
6665
|
-
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6666
|
-
return lang.slice(0, 2);
|
|
6667
|
-
}
|
|
6668
|
-
else {
|
|
6669
|
-
return DEFAULT_LANGUAGE;
|
|
6670
|
-
}
|
|
6671
|
-
}
|
|
6672
|
-
// prevents memory leak
|
|
6673
|
-
const cache = createIntlCache();
|
|
6674
|
-
const locale = getBrowserLang();
|
|
6675
|
-
const intl = createIntl({
|
|
6676
|
-
locale: locale,
|
|
6677
|
-
defaultLocale: "en",
|
|
6678
|
-
messages: lang[locale] || en,
|
|
6679
|
-
}, cache);
|
|
6680
|
-
function generateId() {
|
|
6681
|
-
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6682
|
-
}
|
|
6683
|
-
// limits how many times a function fires
|
|
6684
|
-
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6685
|
-
function throttle(fn, wait) {
|
|
6686
|
-
let timeout;
|
|
6687
|
-
let shouldWait = false;
|
|
6688
|
-
return function () {
|
|
6689
|
-
const context = this;
|
|
6690
|
-
if (!shouldWait) {
|
|
6691
|
-
fn.apply(context, arguments);
|
|
6692
|
-
shouldWait = true;
|
|
6693
|
-
clearTimeout(timeout);
|
|
6694
|
-
timeout = setTimeout(function () {
|
|
6695
|
-
shouldWait = false;
|
|
6696
|
-
}, wait);
|
|
6697
|
-
}
|
|
6698
|
-
};
|
|
6699
|
-
}
|
|
6700
|
-
// waits until it hasn't been called for [timeout] ms.
|
|
6701
|
-
// use when the function should run only after something (event) is done firing
|
|
6702
|
-
function debounce(fn, wait) {
|
|
6703
|
-
let timeout;
|
|
6704
|
-
return function () {
|
|
6705
|
-
const context = this;
|
|
6706
|
-
const functionCall = () => fn.apply(context, arguments);
|
|
6707
|
-
clearTimeout(timeout);
|
|
6708
|
-
timeout = setTimeout(functionCall, wait);
|
|
6709
|
-
};
|
|
6710
|
-
}
|
|
6711
|
-
function getTextDir() {
|
|
6712
|
-
const dir = document.querySelector("html").getAttribute("dir");
|
|
6713
|
-
return dir ? dir.toLowerCase() : "";
|
|
6714
|
-
}
|
|
6715
|
-
function getPosition(el) {
|
|
6716
|
-
const coords = el.getBoundingClientRect();
|
|
6717
|
-
let x = coords.x;
|
|
6718
|
-
let y = coords.y;
|
|
6719
|
-
// Edge doesn't have x and y
|
|
6720
|
-
if (!x) {
|
|
6721
|
-
if (getTextDir() === "rtl") {
|
|
6722
|
-
x = coords.right;
|
|
6723
|
-
}
|
|
6724
|
-
else {
|
|
6725
|
-
x = coords.left;
|
|
6726
|
-
}
|
|
6727
|
-
y = coords.top;
|
|
6728
|
-
}
|
|
6729
|
-
return { x, y };
|
|
6730
|
-
}
|
|
6731
|
-
function findParentWithScrollbar(el) {
|
|
6732
|
-
while (!!el) {
|
|
6733
|
-
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6734
|
-
return el;
|
|
6735
|
-
}
|
|
6736
|
-
el = el.parentElement;
|
|
6737
|
-
}
|
|
6738
|
-
}
|
|
6739
|
-
function findParentWithHiddenOverflow(el) {
|
|
6740
|
-
while (!!el) {
|
|
6741
|
-
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6742
|
-
return el;
|
|
6743
|
-
}
|
|
6744
|
-
el = el.parentElement;
|
|
6745
|
-
}
|
|
6746
|
-
}
|
|
6747
|
-
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6748
|
-
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6749
|
-
// if parent is not found, measurements are checked against the viewport
|
|
6750
|
-
return {
|
|
6751
|
-
closableElHeight: closableEl.clientHeight,
|
|
6752
|
-
closableElWidth: closableEl.clientWidth,
|
|
6753
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6754
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6755
|
-
spaceAbove: parent
|
|
6756
|
-
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6757
|
-
: fixedEl.getBoundingClientRect().top,
|
|
6758
|
-
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6759
|
-
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6760
|
-
spaceBelow: parent
|
|
6761
|
-
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6762
|
-
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6763
|
-
spaceLeft: parent
|
|
6764
|
-
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6765
|
-
: fixedEl.getBoundingClientRect().left,
|
|
6766
|
-
spaceRight: parent
|
|
6767
|
-
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6768
|
-
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6769
|
-
};
|
|
6770
|
-
}
|
|
6771
|
-
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6772
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6773
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6774
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6775
|
-
) {
|
|
6776
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6777
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6778
|
-
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6779
|
-
return openUp;
|
|
6780
|
-
}
|
|
6781
|
-
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6782
|
-
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6783
|
-
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6784
|
-
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6785
|
-
) {
|
|
6786
|
-
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6787
|
-
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6788
|
-
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6789
|
-
return openDown;
|
|
6790
|
-
}
|
|
6791
|
-
function shouldShiftRight(fixedEl, closableEl) {
|
|
6792
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6793
|
-
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6794
|
-
return needsSpaceLeft;
|
|
6795
|
-
}
|
|
6796
|
-
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6797
|
-
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6798
|
-
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6799
|
-
return needsSpaceRight;
|
|
6800
|
-
}
|
|
6801
|
-
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6802
|
-
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6803
|
-
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6804
|
-
tooltipEl.style.top = "";
|
|
6805
|
-
tooltipEl.style.left = "";
|
|
6806
|
-
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6807
|
-
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6808
|
-
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6809
|
-
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6810
|
-
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6811
|
-
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6812
|
-
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6813
|
-
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6814
|
-
const swapAbove = (position) => {
|
|
6815
|
-
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6816
|
-
};
|
|
6817
|
-
const swapBelow = (position) => {
|
|
6818
|
-
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6819
|
-
};
|
|
6820
|
-
const swapLeft = (position, centeredPosition) => {
|
|
6821
|
-
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6822
|
-
position = position.replace("left", "right");
|
|
6823
|
-
}
|
|
6824
|
-
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6825
|
-
position = centeredPosition;
|
|
6826
|
-
}
|
|
6827
|
-
return position;
|
|
6828
|
-
};
|
|
6829
|
-
const swapRight = (position, centeredPosition) => {
|
|
6830
|
-
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6831
|
-
position = position.replace("right", "left");
|
|
6832
|
-
}
|
|
6833
|
-
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6834
|
-
position = centeredPosition;
|
|
6835
|
-
}
|
|
6836
|
-
return position;
|
|
6837
|
-
};
|
|
6838
|
-
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6839
|
-
switch (tPos) {
|
|
6840
|
-
case "left":
|
|
6841
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6842
|
-
case "right":
|
|
6843
|
-
tPos = swapRight(tPos, "bottom");
|
|
6844
|
-
case "top-left":
|
|
6845
|
-
tPos = swapLeft(tPos, "top");
|
|
6846
|
-
tPos = swapAbove(tPos);
|
|
6847
|
-
case "top-right":
|
|
6848
|
-
tPos = swapRight(tPos, "top");
|
|
6849
|
-
tPos = swapAbove(tPos);
|
|
6850
|
-
case "bottom-left":
|
|
6851
|
-
tPos = swapLeft(tPos, "bottom");
|
|
6852
|
-
tPos = swapBelow(tPos);
|
|
6853
|
-
case "bottom-right":
|
|
6854
|
-
tPos = swapRight(tPos, "bottom");
|
|
6855
|
-
tPos = swapBelow(tPos);
|
|
6856
|
-
case "top":
|
|
6857
|
-
tPos = swapAbove(tPos);
|
|
6858
|
-
case "bottom":
|
|
6859
|
-
tPos = swapBelow(tPos);
|
|
6860
|
-
}
|
|
6861
|
-
return tPos;
|
|
6862
|
-
}
|
|
6863
|
-
function hasRoomRight(x, spaceNeeded) {
|
|
6864
|
-
let horizOffset = 0;
|
|
6865
|
-
// if (getTextDir() === "ltr") {
|
|
6866
|
-
if (x.type === "click") {
|
|
6867
|
-
// if it's a mouse event, deal with mouse coords
|
|
6868
|
-
horizOffset = x.clientX;
|
|
6869
|
-
// if it's a focus event, the offset is 0
|
|
6870
|
-
}
|
|
6871
|
-
else if (x.type === "focus") {
|
|
6872
|
-
horizOffset = 0;
|
|
6873
|
-
}
|
|
6874
|
-
else {
|
|
6875
|
-
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6876
|
-
let el = x; // re-assignment is for clarity
|
|
6877
|
-
while (el) {
|
|
6878
|
-
if (el.tagName == "BODY") {
|
|
6879
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
6880
|
-
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6881
|
-
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6882
|
-
}
|
|
6883
|
-
else {
|
|
6884
|
-
// for all other non-BODY elements
|
|
6885
|
-
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6886
|
-
}
|
|
6887
|
-
el = el.offsetParent;
|
|
6888
|
-
}
|
|
6889
|
-
// }
|
|
6890
|
-
}
|
|
6891
|
-
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6892
|
-
}
|
|
6893
|
-
function checkForActiveElInShadow(element) {
|
|
6894
|
-
while (element && element.shadowRoot) {
|
|
6895
|
-
element = element.shadowRoot.activeElement;
|
|
6896
|
-
}
|
|
6897
|
-
return element;
|
|
6898
|
-
}
|
|
6899
|
-
function checkForFocusableElInShadow(element) {
|
|
6900
|
-
const selectors = [
|
|
6901
|
-
"button",
|
|
6902
|
-
"a",
|
|
6903
|
-
"input",
|
|
6904
|
-
"select",
|
|
6905
|
-
"textarea",
|
|
6906
|
-
"wm-button",
|
|
6907
|
-
"wm-search",
|
|
6908
|
-
"wm-select",
|
|
6909
|
-
"wm-action-menu",
|
|
6910
|
-
"wm-tab-item",
|
|
6911
|
-
"wm-datepicker",
|
|
6912
|
-
];
|
|
6913
|
-
let focusableEl = element;
|
|
6914
|
-
selectors.forEach((selector) => {
|
|
6915
|
-
if (focusableEl && focusableEl.shadowRoot) {
|
|
6916
|
-
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6917
|
-
if (elInShadow) {
|
|
6918
|
-
if (selector.startsWith("wm-")) {
|
|
6919
|
-
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6920
|
-
}
|
|
6921
|
-
else {
|
|
6922
|
-
focusableEl = elInShadow;
|
|
6923
|
-
}
|
|
6924
|
-
}
|
|
6925
|
-
}
|
|
6926
|
-
});
|
|
6927
|
-
return focusableEl;
|
|
6928
|
-
}
|
|
6929
|
-
function isFocusable(element) {
|
|
6930
|
-
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6931
|
-
return true;
|
|
6932
|
-
}
|
|
6933
|
-
if (element.disabled) {
|
|
6934
|
-
return false;
|
|
6935
|
-
}
|
|
6936
|
-
switch (element.nodeName) {
|
|
6937
|
-
case "A":
|
|
6938
|
-
return !!element.href && element.rel != "ignore";
|
|
6939
|
-
case "INPUT":
|
|
6940
|
-
return element.type != "hidden" && element.type != "file";
|
|
6941
|
-
case "BUTTON":
|
|
6942
|
-
case "SELECT":
|
|
6943
|
-
case "TEXTAREA":
|
|
6944
|
-
case "WM-BUTTON":
|
|
6945
|
-
case "WM-SELECT":
|
|
6946
|
-
case "WM-ACTION-MENU":
|
|
6947
|
-
case "WM-DATEPICKER":
|
|
6948
|
-
case "WM-TIMEPICKER":
|
|
6949
|
-
case "WM-INPUT":
|
|
6950
|
-
case "WM-TAG-INPUT":
|
|
6951
|
-
case "WM-TAB-ITEM":
|
|
6952
|
-
case "WM-SEARCH":
|
|
6953
|
-
return true;
|
|
6954
|
-
default:
|
|
6955
|
-
return false;
|
|
6956
|
-
}
|
|
6957
|
-
}
|
|
6958
|
-
function getFirstFocusableDescendant(element) {
|
|
6959
|
-
if (isFocusable(element)) {
|
|
6960
|
-
return checkForFocusableElInShadow(element);
|
|
6961
|
-
}
|
|
6962
|
-
else if (element.childNodes.length > 0) {
|
|
6963
|
-
element.childNodes.forEach((i) => {
|
|
6964
|
-
const childEl = getFirstFocusableDescendant(i);
|
|
6965
|
-
return childEl && checkForFocusableElInShadow(childEl);
|
|
6966
|
-
});
|
|
6967
|
-
}
|
|
6968
|
-
}
|
|
6969
|
-
function hasValidType(file, types) {
|
|
6970
|
-
const acceptedExtensions = types.split(" ");
|
|
6971
|
-
const parts = file.name && file.name.split(".");
|
|
6972
|
-
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6973
|
-
return ext
|
|
6974
|
-
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6975
|
-
: // fallback: if we couldn't obtain an extension,
|
|
6976
|
-
// validate based on MIME type...
|
|
6977
|
-
!!file.type
|
|
6978
|
-
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
6979
|
-
: // ...and if that failed too, accept the file
|
|
6980
|
-
// as it's preferable to accept an invalid file
|
|
6981
|
-
// than refusing a valid one (back-end will take care of what slips through)
|
|
6982
|
-
true;
|
|
6983
|
-
}
|
|
6984
|
-
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
6985
|
-
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
6986
|
-
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
6987
|
-
// front end checks are just a convenience to users, independent of security.
|
|
6988
|
-
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
6989
|
-
const lookupTable = {
|
|
6990
|
-
aac: ["audio/aac"],
|
|
6991
|
-
abw: ["application/x-abiword"],
|
|
6992
|
-
arc: ["application/x-freearc"],
|
|
6993
|
-
avi: ["video/x-msvideo"],
|
|
6994
|
-
azw: ["application/vnd.amazon.ebook"],
|
|
6995
|
-
bin: ["application/octet-stream"],
|
|
6996
|
-
bmp: ["image/bmp"],
|
|
6997
|
-
bz: ["application/x-bzip"],
|
|
6998
|
-
bz2: ["application/x-bzip2"],
|
|
6999
|
-
csh: ["application/x-csh"],
|
|
7000
|
-
css: ["text/css"],
|
|
7001
|
-
csv: ["text/csv"],
|
|
7002
|
-
doc: ["application/msword"],
|
|
7003
|
-
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
7004
|
-
eot: ["application/vnd.ms-fontobject"],
|
|
7005
|
-
epub: ["application/epub+zip"],
|
|
7006
|
-
gz: ["application/gzip"],
|
|
7007
|
-
gif: ["image/gif"],
|
|
7008
|
-
htm: ["text/html"],
|
|
7009
|
-
html: ["text/html"],
|
|
7010
|
-
ico: ["image/vnd.microsoft.icon"],
|
|
7011
|
-
ics: ["text/calendar"],
|
|
7012
|
-
jar: ["application/java-archive"],
|
|
7013
|
-
jpeg: ["image/jpeg"],
|
|
7014
|
-
jpg: ["image/jpeg"],
|
|
7015
|
-
js: ["text/javascript"],
|
|
7016
|
-
json: ["application/json"],
|
|
7017
|
-
jsonld: ["application/ld+json"],
|
|
7018
|
-
log: ["text/plain"],
|
|
7019
|
-
mid: ["audio/x-midi"],
|
|
7020
|
-
midi: ["audio/x-midi"],
|
|
7021
|
-
mjs: ["text/javascript"],
|
|
7022
|
-
mp3: ["audio/mpeg"],
|
|
7023
|
-
mpeg: ["video/mpeg"],
|
|
7024
|
-
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7025
|
-
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7026
|
-
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7027
|
-
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7028
|
-
oga: ["audio/ogg"],
|
|
7029
|
-
ogv: ["video/ogg"],
|
|
7030
|
-
ogx: ["application/ogg"],
|
|
7031
|
-
opus: ["audio/opus"],
|
|
7032
|
-
otf: ["font/otf"],
|
|
7033
|
-
png: ["image/png"],
|
|
7034
|
-
pdf: ["application/pdf"],
|
|
7035
|
-
php: ["application/php"],
|
|
7036
|
-
ppt: ["application/vnd.ms-powerpoint"],
|
|
7037
|
-
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7038
|
-
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7039
|
-
rtf: ["application/rtf"],
|
|
7040
|
-
sh: ["application/x-sh"],
|
|
7041
|
-
svg: ["image/svg+xml"],
|
|
7042
|
-
swf: ["application/x-shockwave-flash"],
|
|
7043
|
-
tar: ["application/x-tar"],
|
|
7044
|
-
tif: ["image/tiff"],
|
|
7045
|
-
tiff: ["image/tiff"],
|
|
7046
|
-
ts: ["video/mp2t"],
|
|
7047
|
-
ttf: ["font/ttf"],
|
|
7048
|
-
txt: ["text/plain"],
|
|
7049
|
-
vsd: ["application/vnd.visio"],
|
|
7050
|
-
wav: ["audio/wav"],
|
|
7051
|
-
weba: ["audio/webm"],
|
|
7052
|
-
webm: ["video/webm"],
|
|
7053
|
-
webp: ["image/webp"],
|
|
7054
|
-
woff: ["font/woff"],
|
|
7055
|
-
woff2: ["font/woff2"],
|
|
7056
|
-
xhtml: ["application/xhtml+xml"],
|
|
7057
|
-
xls: ["application/vnd.ms-excel"],
|
|
7058
|
-
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7059
|
-
xml: ["application/xml", "text/xml"],
|
|
7060
|
-
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7061
|
-
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7062
|
-
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7063
|
-
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7064
|
-
"7z": ["application/x-7z-compressed"],
|
|
7065
|
-
};
|
|
7066
|
-
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7067
|
-
}
|
|
7068
|
-
function snakeCaseToCamelCase(str) {
|
|
7069
|
-
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7070
|
-
if (snakeCaseRegexp.test(str)) {
|
|
7071
|
-
let camelCase = "";
|
|
7072
|
-
let arr = str.split("_");
|
|
7073
|
-
arr.forEach((word, idx) => {
|
|
7074
|
-
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7075
|
-
});
|
|
7076
|
-
return camelCase;
|
|
7077
|
-
}
|
|
7078
|
-
else {
|
|
7079
|
-
return str;
|
|
7080
|
-
}
|
|
7081
|
-
}
|
|
7082
|
-
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7083
|
-
let newIndex = currentIndex;
|
|
7084
|
-
if (direction === "ArrowDown") {
|
|
7085
|
-
newIndex = (currentIndex + 1) % listLength;
|
|
7086
|
-
}
|
|
7087
|
-
if (direction === "ArrowUp") {
|
|
7088
|
-
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7089
|
-
}
|
|
7090
|
-
return newIndex;
|
|
7091
|
-
}
|
|
7092
|
-
function isRelatedTarget(ev, id) {
|
|
7093
|
-
// used for onBlur events to check the element that has been clicked
|
|
7094
|
-
const ids = id.split(" ");
|
|
7095
|
-
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7096
|
-
}
|
|
7097
|
-
function toBool(val) {
|
|
7098
|
-
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7099
|
-
return val == "false" ? false : !!val;
|
|
7100
|
-
}
|
|
7101
|
-
/*
|
|
7102
|
-
* this is going to be needed to solve the extra tabbing on navigator
|
|
7103
|
-
* and for programmatic focus of tabs
|
|
7104
|
-
* Here's a draft, not bug proof, see:
|
|
7105
|
-
* https://stackoverflow.com/a/10730308/3741713
|
|
7106
|
-
|
|
7107
|
-
function getKeyboardFocusableElements(element = document) {
|
|
7108
|
-
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'));
|
|
7109
|
-
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7110
|
-
}
|
|
7111
|
-
|
|
7112
|
-
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7113
|
-
const els = getKeyboardFocusableElements();
|
|
7114
|
-
const current = els.indexOf(element);
|
|
7115
|
-
return els[current - 1] as HTMLElement;
|
|
7116
|
-
}
|
|
7117
|
-
|
|
7118
|
-
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7119
|
-
const els = getKeyboardFocusableElements();
|
|
7120
|
-
const current = els.indexOf(element);
|
|
7121
|
-
return els[current + 1] as HTMLElement;
|
|
7122
|
-
}
|
|
6708
|
+
const DEFAULT_LANGUAGE = "en";
|
|
6709
|
+
function getBrowserLang() {
|
|
6710
|
+
const langAttr = document.documentElement.getAttribute("lang");
|
|
6711
|
+
if (!!langAttr) {
|
|
6712
|
+
return langAttr;
|
|
6713
|
+
}
|
|
6714
|
+
else if (window.navigator && window.navigator.language) {
|
|
6715
|
+
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6716
|
+
return lang.slice(0, 2);
|
|
6717
|
+
}
|
|
6718
|
+
else {
|
|
6719
|
+
return DEFAULT_LANGUAGE;
|
|
6720
|
+
}
|
|
6721
|
+
}
|
|
6722
|
+
// prevents memory leak
|
|
6723
|
+
const cache = createIntlCache();
|
|
6724
|
+
const locale = getBrowserLang();
|
|
6725
|
+
const intl = createIntl({
|
|
6726
|
+
locale: locale,
|
|
6727
|
+
defaultLocale: "en",
|
|
6728
|
+
messages: lang[locale] || en,
|
|
6729
|
+
}, cache);
|
|
6730
|
+
function generateId() {
|
|
6731
|
+
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6732
|
+
}
|
|
6733
|
+
// limits how many times a function fires
|
|
6734
|
+
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6735
|
+
function throttle(fn, wait) {
|
|
6736
|
+
let timeout;
|
|
6737
|
+
let shouldWait = false;
|
|
6738
|
+
return function () {
|
|
6739
|
+
const context = this;
|
|
6740
|
+
if (!shouldWait) {
|
|
6741
|
+
fn.apply(context, arguments);
|
|
6742
|
+
shouldWait = true;
|
|
6743
|
+
clearTimeout(timeout);
|
|
6744
|
+
timeout = setTimeout(function () {
|
|
6745
|
+
shouldWait = false;
|
|
6746
|
+
}, wait);
|
|
6747
|
+
}
|
|
6748
|
+
};
|
|
6749
|
+
}
|
|
6750
|
+
// waits until it hasn't been called for [timeout] ms.
|
|
6751
|
+
// use when the function should run only after something (event) is done firing
|
|
6752
|
+
function debounce(fn, wait) {
|
|
6753
|
+
let timeout;
|
|
6754
|
+
return function () {
|
|
6755
|
+
const context = this;
|
|
6756
|
+
const functionCall = () => fn.apply(context, arguments);
|
|
6757
|
+
clearTimeout(timeout);
|
|
6758
|
+
timeout = setTimeout(functionCall, wait);
|
|
6759
|
+
};
|
|
6760
|
+
}
|
|
6761
|
+
function getTextDir() {
|
|
6762
|
+
const dir = document.querySelector("html").getAttribute("dir");
|
|
6763
|
+
return dir ? dir.toLowerCase() : "";
|
|
6764
|
+
}
|
|
6765
|
+
function getPosition(el) {
|
|
6766
|
+
const coords = el.getBoundingClientRect();
|
|
6767
|
+
let x = coords.x;
|
|
6768
|
+
let y = coords.y;
|
|
6769
|
+
// Edge doesn't have x and y
|
|
6770
|
+
if (!x) {
|
|
6771
|
+
if (getTextDir() === "rtl") {
|
|
6772
|
+
x = coords.right;
|
|
6773
|
+
}
|
|
6774
|
+
else {
|
|
6775
|
+
x = coords.left;
|
|
6776
|
+
}
|
|
6777
|
+
y = coords.top;
|
|
6778
|
+
}
|
|
6779
|
+
return { x, y };
|
|
6780
|
+
}
|
|
6781
|
+
function findParentWithScrollbar(el) {
|
|
6782
|
+
while (!!el) {
|
|
6783
|
+
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6784
|
+
return el;
|
|
6785
|
+
}
|
|
6786
|
+
el = el.parentElement;
|
|
6787
|
+
}
|
|
6788
|
+
}
|
|
6789
|
+
function findParentWithHiddenOverflow(el) {
|
|
6790
|
+
while (!!el) {
|
|
6791
|
+
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6792
|
+
return el;
|
|
6793
|
+
}
|
|
6794
|
+
el = el.parentElement;
|
|
6795
|
+
}
|
|
6796
|
+
}
|
|
6797
|
+
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6798
|
+
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6799
|
+
// if parent is not found, measurements are checked against the viewport
|
|
6800
|
+
return {
|
|
6801
|
+
closableElHeight: closableEl.clientHeight,
|
|
6802
|
+
closableElWidth: closableEl.clientWidth,
|
|
6803
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6804
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6805
|
+
spaceAbove: parent
|
|
6806
|
+
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6807
|
+
: fixedEl.getBoundingClientRect().top,
|
|
6808
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6809
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6810
|
+
spaceBelow: parent
|
|
6811
|
+
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6812
|
+
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6813
|
+
spaceLeft: parent
|
|
6814
|
+
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6815
|
+
: fixedEl.getBoundingClientRect().left,
|
|
6816
|
+
spaceRight: parent
|
|
6817
|
+
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6818
|
+
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6819
|
+
};
|
|
6820
|
+
}
|
|
6821
|
+
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6822
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6823
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6824
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6825
|
+
) {
|
|
6826
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6827
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6828
|
+
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6829
|
+
return openUp;
|
|
6830
|
+
}
|
|
6831
|
+
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6832
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6833
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6834
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6835
|
+
) {
|
|
6836
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6837
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6838
|
+
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6839
|
+
return openDown;
|
|
6840
|
+
}
|
|
6841
|
+
function shouldShiftRight(fixedEl, closableEl) {
|
|
6842
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6843
|
+
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6844
|
+
return needsSpaceLeft;
|
|
6845
|
+
}
|
|
6846
|
+
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6847
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6848
|
+
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6849
|
+
return needsSpaceRight;
|
|
6850
|
+
}
|
|
6851
|
+
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6852
|
+
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6853
|
+
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6854
|
+
tooltipEl.style.top = "";
|
|
6855
|
+
tooltipEl.style.left = "";
|
|
6856
|
+
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6857
|
+
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6858
|
+
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6859
|
+
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6860
|
+
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6861
|
+
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6862
|
+
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6863
|
+
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6864
|
+
const swapAbove = (position) => {
|
|
6865
|
+
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6866
|
+
};
|
|
6867
|
+
const swapBelow = (position) => {
|
|
6868
|
+
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6869
|
+
};
|
|
6870
|
+
const swapLeft = (position, centeredPosition) => {
|
|
6871
|
+
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6872
|
+
position = position.replace("left", "right");
|
|
6873
|
+
}
|
|
6874
|
+
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6875
|
+
position = centeredPosition;
|
|
6876
|
+
}
|
|
6877
|
+
return position;
|
|
6878
|
+
};
|
|
6879
|
+
const swapRight = (position, centeredPosition) => {
|
|
6880
|
+
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6881
|
+
position = position.replace("right", "left");
|
|
6882
|
+
}
|
|
6883
|
+
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6884
|
+
position = centeredPosition;
|
|
6885
|
+
}
|
|
6886
|
+
return position;
|
|
6887
|
+
};
|
|
6888
|
+
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6889
|
+
switch (tPos) {
|
|
6890
|
+
case "left":
|
|
6891
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6892
|
+
case "right":
|
|
6893
|
+
tPos = swapRight(tPos, "bottom");
|
|
6894
|
+
case "top-left":
|
|
6895
|
+
tPos = swapLeft(tPos, "top");
|
|
6896
|
+
tPos = swapAbove(tPos);
|
|
6897
|
+
case "top-right":
|
|
6898
|
+
tPos = swapRight(tPos, "top");
|
|
6899
|
+
tPos = swapAbove(tPos);
|
|
6900
|
+
case "bottom-left":
|
|
6901
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6902
|
+
tPos = swapBelow(tPos);
|
|
6903
|
+
case "bottom-right":
|
|
6904
|
+
tPos = swapRight(tPos, "bottom");
|
|
6905
|
+
tPos = swapBelow(tPos);
|
|
6906
|
+
case "top":
|
|
6907
|
+
tPos = swapAbove(tPos);
|
|
6908
|
+
case "bottom":
|
|
6909
|
+
tPos = swapBelow(tPos);
|
|
6910
|
+
}
|
|
6911
|
+
return tPos;
|
|
6912
|
+
}
|
|
6913
|
+
function hasRoomRight(x, spaceNeeded) {
|
|
6914
|
+
let horizOffset = 0;
|
|
6915
|
+
// if (getTextDir() === "ltr") {
|
|
6916
|
+
if (x.type === "click") {
|
|
6917
|
+
// if it's a mouse event, deal with mouse coords
|
|
6918
|
+
horizOffset = x.clientX;
|
|
6919
|
+
// if it's a focus event, the offset is 0
|
|
6920
|
+
}
|
|
6921
|
+
else if (x.type === "focus") {
|
|
6922
|
+
horizOffset = 0;
|
|
6923
|
+
}
|
|
6924
|
+
else {
|
|
6925
|
+
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6926
|
+
let el = x; // re-assignment is for clarity
|
|
6927
|
+
while (el) {
|
|
6928
|
+
if (el.tagName == "BODY") {
|
|
6929
|
+
// deal with browser quirks with body/window/document and page scroll
|
|
6930
|
+
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6931
|
+
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6932
|
+
}
|
|
6933
|
+
else {
|
|
6934
|
+
// for all other non-BODY elements
|
|
6935
|
+
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6936
|
+
}
|
|
6937
|
+
el = el.offsetParent;
|
|
6938
|
+
}
|
|
6939
|
+
// }
|
|
6940
|
+
}
|
|
6941
|
+
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6942
|
+
}
|
|
6943
|
+
function checkForActiveElInShadow(element) {
|
|
6944
|
+
while (element && element.shadowRoot) {
|
|
6945
|
+
element = element.shadowRoot.activeElement;
|
|
6946
|
+
}
|
|
6947
|
+
return element;
|
|
6948
|
+
}
|
|
6949
|
+
function checkForFocusableElInShadow(element) {
|
|
6950
|
+
const selectors = [
|
|
6951
|
+
"button",
|
|
6952
|
+
"a",
|
|
6953
|
+
"input",
|
|
6954
|
+
"select",
|
|
6955
|
+
"textarea",
|
|
6956
|
+
"wm-button",
|
|
6957
|
+
"wm-search",
|
|
6958
|
+
"wm-select",
|
|
6959
|
+
"wm-action-menu",
|
|
6960
|
+
"wm-tab-item",
|
|
6961
|
+
"wm-datepicker",
|
|
6962
|
+
];
|
|
6963
|
+
let focusableEl = element;
|
|
6964
|
+
selectors.forEach((selector) => {
|
|
6965
|
+
if (focusableEl && focusableEl.shadowRoot) {
|
|
6966
|
+
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6967
|
+
if (elInShadow) {
|
|
6968
|
+
if (selector.startsWith("wm-")) {
|
|
6969
|
+
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6970
|
+
}
|
|
6971
|
+
else {
|
|
6972
|
+
focusableEl = elInShadow;
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
}
|
|
6976
|
+
});
|
|
6977
|
+
return focusableEl;
|
|
6978
|
+
}
|
|
6979
|
+
function isFocusable(element) {
|
|
6980
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6981
|
+
return true;
|
|
6982
|
+
}
|
|
6983
|
+
if (element.disabled) {
|
|
6984
|
+
return false;
|
|
6985
|
+
}
|
|
6986
|
+
switch (element.nodeName) {
|
|
6987
|
+
case "A":
|
|
6988
|
+
return !!element.href && element.rel != "ignore";
|
|
6989
|
+
case "INPUT":
|
|
6990
|
+
return element.type != "hidden" && element.type != "file";
|
|
6991
|
+
case "BUTTON":
|
|
6992
|
+
case "SELECT":
|
|
6993
|
+
case "TEXTAREA":
|
|
6994
|
+
case "WM-BUTTON":
|
|
6995
|
+
case "WM-SELECT":
|
|
6996
|
+
case "WM-ACTION-MENU":
|
|
6997
|
+
case "WM-DATEPICKER":
|
|
6998
|
+
case "WM-TIMEPICKER":
|
|
6999
|
+
case "WM-INPUT":
|
|
7000
|
+
case "WM-TAG-INPUT":
|
|
7001
|
+
case "WM-TAB-ITEM":
|
|
7002
|
+
case "WM-SEARCH":
|
|
7003
|
+
return true;
|
|
7004
|
+
default:
|
|
7005
|
+
return false;
|
|
7006
|
+
}
|
|
7007
|
+
}
|
|
7008
|
+
function getFirstFocusableDescendant(element) {
|
|
7009
|
+
if (isFocusable(element)) {
|
|
7010
|
+
return checkForFocusableElInShadow(element);
|
|
7011
|
+
}
|
|
7012
|
+
else if (element.childNodes.length > 0) {
|
|
7013
|
+
element.childNodes.forEach((i) => {
|
|
7014
|
+
const childEl = getFirstFocusableDescendant(i);
|
|
7015
|
+
return childEl && checkForFocusableElInShadow(childEl);
|
|
7016
|
+
});
|
|
7017
|
+
}
|
|
7018
|
+
}
|
|
7019
|
+
function hasValidType(file, types) {
|
|
7020
|
+
const acceptedExtensions = types.split(" ");
|
|
7021
|
+
const parts = file.name && file.name.split(".");
|
|
7022
|
+
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
7023
|
+
return ext
|
|
7024
|
+
? acceptedExtensions.includes(ext.toLowerCase())
|
|
7025
|
+
: // fallback: if we couldn't obtain an extension,
|
|
7026
|
+
// validate based on MIME type...
|
|
7027
|
+
!!file.type
|
|
7028
|
+
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
7029
|
+
: // ...and if that failed too, accept the file
|
|
7030
|
+
// as it's preferable to accept an invalid file
|
|
7031
|
+
// than refusing a valid one (back-end will take care of what slips through)
|
|
7032
|
+
true;
|
|
7033
|
+
}
|
|
7034
|
+
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
7035
|
+
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
7036
|
+
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
7037
|
+
// front end checks are just a convenience to users, independent of security.
|
|
7038
|
+
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
7039
|
+
const lookupTable = {
|
|
7040
|
+
aac: ["audio/aac"],
|
|
7041
|
+
abw: ["application/x-abiword"],
|
|
7042
|
+
arc: ["application/x-freearc"],
|
|
7043
|
+
avi: ["video/x-msvideo"],
|
|
7044
|
+
azw: ["application/vnd.amazon.ebook"],
|
|
7045
|
+
bin: ["application/octet-stream"],
|
|
7046
|
+
bmp: ["image/bmp"],
|
|
7047
|
+
bz: ["application/x-bzip"],
|
|
7048
|
+
bz2: ["application/x-bzip2"],
|
|
7049
|
+
csh: ["application/x-csh"],
|
|
7050
|
+
css: ["text/css"],
|
|
7051
|
+
csv: ["text/csv"],
|
|
7052
|
+
doc: ["application/msword"],
|
|
7053
|
+
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
7054
|
+
eot: ["application/vnd.ms-fontobject"],
|
|
7055
|
+
epub: ["application/epub+zip"],
|
|
7056
|
+
gz: ["application/gzip"],
|
|
7057
|
+
gif: ["image/gif"],
|
|
7058
|
+
htm: ["text/html"],
|
|
7059
|
+
html: ["text/html"],
|
|
7060
|
+
ico: ["image/vnd.microsoft.icon"],
|
|
7061
|
+
ics: ["text/calendar"],
|
|
7062
|
+
jar: ["application/java-archive"],
|
|
7063
|
+
jpeg: ["image/jpeg"],
|
|
7064
|
+
jpg: ["image/jpeg"],
|
|
7065
|
+
js: ["text/javascript"],
|
|
7066
|
+
json: ["application/json"],
|
|
7067
|
+
jsonld: ["application/ld+json"],
|
|
7068
|
+
log: ["text/plain"],
|
|
7069
|
+
mid: ["audio/x-midi"],
|
|
7070
|
+
midi: ["audio/x-midi"],
|
|
7071
|
+
mjs: ["text/javascript"],
|
|
7072
|
+
mp3: ["audio/mpeg"],
|
|
7073
|
+
mpeg: ["video/mpeg"],
|
|
7074
|
+
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7075
|
+
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7076
|
+
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7077
|
+
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7078
|
+
oga: ["audio/ogg"],
|
|
7079
|
+
ogv: ["video/ogg"],
|
|
7080
|
+
ogx: ["application/ogg"],
|
|
7081
|
+
opus: ["audio/opus"],
|
|
7082
|
+
otf: ["font/otf"],
|
|
7083
|
+
png: ["image/png"],
|
|
7084
|
+
pdf: ["application/pdf"],
|
|
7085
|
+
php: ["application/php"],
|
|
7086
|
+
ppt: ["application/vnd.ms-powerpoint"],
|
|
7087
|
+
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7088
|
+
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7089
|
+
rtf: ["application/rtf"],
|
|
7090
|
+
sh: ["application/x-sh"],
|
|
7091
|
+
svg: ["image/svg+xml"],
|
|
7092
|
+
swf: ["application/x-shockwave-flash"],
|
|
7093
|
+
tar: ["application/x-tar"],
|
|
7094
|
+
tif: ["image/tiff"],
|
|
7095
|
+
tiff: ["image/tiff"],
|
|
7096
|
+
ts: ["video/mp2t"],
|
|
7097
|
+
ttf: ["font/ttf"],
|
|
7098
|
+
txt: ["text/plain"],
|
|
7099
|
+
vsd: ["application/vnd.visio"],
|
|
7100
|
+
wav: ["audio/wav"],
|
|
7101
|
+
weba: ["audio/webm"],
|
|
7102
|
+
webm: ["video/webm"],
|
|
7103
|
+
webp: ["image/webp"],
|
|
7104
|
+
woff: ["font/woff"],
|
|
7105
|
+
woff2: ["font/woff2"],
|
|
7106
|
+
xhtml: ["application/xhtml+xml"],
|
|
7107
|
+
xls: ["application/vnd.ms-excel"],
|
|
7108
|
+
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7109
|
+
xml: ["application/xml", "text/xml"],
|
|
7110
|
+
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7111
|
+
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7112
|
+
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7113
|
+
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7114
|
+
"7z": ["application/x-7z-compressed"],
|
|
7115
|
+
};
|
|
7116
|
+
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7117
|
+
}
|
|
7118
|
+
function snakeCaseToCamelCase(str) {
|
|
7119
|
+
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7120
|
+
if (snakeCaseRegexp.test(str)) {
|
|
7121
|
+
let camelCase = "";
|
|
7122
|
+
let arr = str.split("_");
|
|
7123
|
+
arr.forEach((word, idx) => {
|
|
7124
|
+
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7125
|
+
});
|
|
7126
|
+
return camelCase;
|
|
7127
|
+
}
|
|
7128
|
+
else {
|
|
7129
|
+
return str;
|
|
7130
|
+
}
|
|
7131
|
+
}
|
|
7132
|
+
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7133
|
+
let newIndex = currentIndex;
|
|
7134
|
+
if (direction === "ArrowDown") {
|
|
7135
|
+
newIndex = (currentIndex + 1) % listLength;
|
|
7136
|
+
}
|
|
7137
|
+
if (direction === "ArrowUp") {
|
|
7138
|
+
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7139
|
+
}
|
|
7140
|
+
return newIndex;
|
|
7141
|
+
}
|
|
7142
|
+
function isRelatedTarget(ev, id) {
|
|
7143
|
+
// used for onBlur events to check the element that has been clicked
|
|
7144
|
+
const ids = id.split(" ");
|
|
7145
|
+
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7146
|
+
}
|
|
7147
|
+
function toBool(val) {
|
|
7148
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7149
|
+
return val == "false" ? false : !!val;
|
|
7150
|
+
}
|
|
7151
|
+
/*
|
|
7152
|
+
* this is going to be needed to solve the extra tabbing on navigator
|
|
7153
|
+
* and for programmatic focus of tabs
|
|
7154
|
+
* Here's a draft, not bug proof, see:
|
|
7155
|
+
* https://stackoverflow.com/a/10730308/3741713
|
|
7156
|
+
|
|
7157
|
+
function getKeyboardFocusableElements(element = document) {
|
|
7158
|
+
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'));
|
|
7159
|
+
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7160
|
+
}
|
|
7161
|
+
|
|
7162
|
+
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7163
|
+
const els = getKeyboardFocusableElements();
|
|
7164
|
+
const current = els.indexOf(element);
|
|
7165
|
+
return els[current - 1] as HTMLElement;
|
|
7166
|
+
}
|
|
7167
|
+
|
|
7168
|
+
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7169
|
+
const els = getKeyboardFocusableElements();
|
|
7170
|
+
const current = els.indexOf(element);
|
|
7171
|
+
return els[current + 1] as HTMLElement;
|
|
7172
|
+
}
|
|
7123
7173
|
*/
|
|
7124
7174
|
|
|
7125
7175
|
exports.adjustTooltipPosition = adjustTooltipPosition;
|