@watermarkinsights/ripple 3.9.0 → 3.10.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/{chartFunctions-dbbea5a8.js → chartFunctions-05b9dcc7.js} +418 -417
- package/dist/cjs/{functions-15e21d53.js → functions-71c85bae.js} +506 -532
- package/dist/cjs/{global-b0e0eac2.js → global-f98992f4.js} +60 -60
- package/dist/cjs/{http-service-9e8c4dd5.js → http-service-494d81de.js} +49 -49
- package/dist/cjs/{index-acad7ab3.js → index-98c6524c.js} +64 -96
- package/dist/cjs/{interfaces-30a74c1f.js → interfaces-a3338581.js} +29 -29
- package/dist/cjs/loader.cjs.js +3 -3
- 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 +3 -3
- 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 -117
- 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_3.cjs.entry.js +136 -136
- 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 +2 -2
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +0 -1
- 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.css +6 -15
- package/dist/collection/components/charts/wm-chart/wm-chart.js +332 -332
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +6 -15
- 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.css +0 -1
- 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.css +0 -1
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
- package/dist/collection/components/wm-button/wm-button.css +33 -25
- package/dist/collection/components/wm-button/wm-button.js +491 -491
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +4 -4
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1024 -1024
- package/dist/collection/components/wm-datepicker/wm-datepicker.css +2 -2
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +471 -471
- package/dist/collection/components/wm-input/wm-input.css +2 -2
- package/dist/collection/components/wm-input/wm-input.js +423 -423
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
- package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
- package/dist/collection/components/wm-modal/wm-modal-header.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
- package/dist/collection/components/wm-modal/wm-modal.css +0 -1
- package/dist/collection/components/wm-modal/wm-modal.js +461 -461
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +162 -162
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +0 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +121 -121
- package/dist/collection/components/wm-navigation/wm-navigation.css +0 -1
- package/dist/collection/components/wm-navigation/wm-navigation.js +211 -211
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -1
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
- package/dist/collection/components/wm-navigator/wm-navigator.css +0 -1
- package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
- package/dist/collection/components/wm-option/wm-option.css +3 -3
- package/dist/collection/components/wm-option/wm-option.js +414 -414
- package/dist/collection/components/wm-pagination/wm-pagination.css +0 -1
- package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
- package/dist/collection/components/wm-search/wm-search.css +0 -1
- package/dist/collection/components/wm-search/wm-search.js +480 -480
- package/dist/collection/components/wm-select/wm-select.css +3 -3
- package/dist/collection/components/wm-select/wm-select.js +718 -718
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +3 -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 -3
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +216 -216
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -1
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +330 -330
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -1
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +3 -3
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +3 -3
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +2 -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 +33 -25
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +785 -785
- package/dist/collection/components/wm-uploader/wm-uploader.css +33 -25
- 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-303e1644.js → chartFunctions-b24ba065.js} +418 -418
- package/dist/esm/{functions-e552a8b5.js → functions-117d1a51.js} +506 -532
- package/dist/esm/{global-fa341013.js → global-6a9c8257.js} +60 -60
- package/dist/esm/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +49 -49
- package/dist/esm/{index-7603f98e.js → index-d649a861.js} +64 -96
- package/dist/esm/{interfaces-61c6305b.js → interfaces-2b97fab2.js} +29 -29
- package/dist/esm/loader.js +3 -3
- 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 +3 -3
- 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 -117
- 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_3.entry.js +136 -136
- 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-b24ba065.js +1 -0
- package/dist/esm-es5/functions-117d1a51.js +15 -0
- package/dist/esm-es5/global-6a9c8257.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_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-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-aa104594.system.entry.js → p-03d6014a.system.entry.js} +1 -1
- package/dist/ripple/{p-90ed3268.system.entry.js → p-099df7b7.system.entry.js} +1 -1
- package/dist/ripple/p-0cffec65.entry.js +1 -0
- package/dist/ripple/p-0ebed4b8.system.entry.js +1 -0
- package/dist/ripple/p-13e2891c.system.js +1 -0
- package/dist/ripple/p-18261104.system.entry.js +1 -0
- package/dist/ripple/p-1b1e006a.entry.js +1 -0
- package/dist/ripple/p-1e7fc028.entry.js +1 -0
- package/dist/ripple/{p-32336c78.system.entry.js → p-210039cc.system.entry.js} +1 -1
- package/dist/ripple/p-22759dd5.entry.js +1 -0
- package/dist/ripple/p-25b81952.entry.js +1 -0
- package/dist/ripple/{p-e490e37f.system.entry.js → p-269fa39c.system.entry.js} +1 -1
- package/dist/ripple/p-26c9f5af.entry.js +1 -0
- package/dist/ripple/p-276ed011.js +16 -0
- package/dist/ripple/p-2b6246d9.entry.js +1 -0
- package/dist/ripple/{p-3b3e847c.system.entry.js → p-2b63995f.system.entry.js} +1 -1
- package/dist/ripple/p-2c8a26f2.js +1 -0
- package/dist/ripple/p-38bb7f05.system.entry.js +1 -0
- package/dist/ripple/{p-888bec42.js → p-43f1298b.js} +0 -0
- package/dist/ripple/p-4f581ab3.entry.js +1 -0
- package/dist/ripple/p-50be3b44.js +1 -0
- package/dist/ripple/p-5176b826.system.js +15 -0
- package/dist/ripple/p-5627e44d.entry.js +1 -0
- package/dist/ripple/p-570fb53b.entry.js +1 -0
- package/dist/ripple/p-57f2feb0.entry.js +1 -0
- package/dist/ripple/p-5d6cc9da.system.js +1 -0
- package/dist/ripple/p-5e164260.system.entry.js +1 -0
- package/dist/ripple/{p-64053e24.system.entry.js → p-64e8fb6e.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-6cf47163.entry.js +1 -0
- package/dist/ripple/{p-6bc557fa.js → p-6f59ed45.js} +1 -1
- package/dist/ripple/p-772576d7.system.entry.js +1 -0
- package/dist/ripple/p-7779bfbe.system.entry.js +1 -0
- package/dist/ripple/p-7c2b1682.entry.js +1 -0
- package/dist/ripple/p-81ddf5a0.entry.js +1 -0
- package/dist/ripple/p-83d22032.system.entry.js +1 -0
- package/dist/ripple/p-846e9391.entry.js +1 -0
- package/dist/ripple/{p-7d26d093.system.entry.js → p-8a96b188.system.entry.js} +1 -1
- package/dist/ripple/p-8cf7ce7e.system.entry.js +1 -0
- package/dist/ripple/p-969af068.system.entry.js +1 -0
- package/dist/ripple/p-9a4aca88.system.entry.js +1 -0
- package/dist/ripple/p-9aa6cd9f.entry.js +1 -0
- package/dist/ripple/p-9c20bc1f.system.entry.js +1 -0
- package/dist/ripple/p-9d02957d.system.js +1 -0
- package/dist/ripple/p-9d49f21e.entry.js +1 -0
- package/dist/ripple/p-9d8c246d.system.entry.js +1 -0
- package/dist/ripple/p-9df8a520.entry.js +1 -0
- package/dist/ripple/{p-ae6cfbca.system.entry.js → p-a1511315.system.entry.js} +1 -1
- package/dist/ripple/p-a1a2efca.system.entry.js +1 -0
- package/dist/ripple/{p-1a7a33e0.system.js → p-a224d536.system.js} +1 -1
- package/dist/ripple/p-a5a47a23.entry.js +1 -0
- package/dist/ripple/p-b16373b9.system.entry.js +1 -0
- package/dist/ripple/p-b547bcf2.entry.js +1 -0
- package/dist/ripple/{p-1df2adee.system.entry.js → p-bfc1ab2e.system.entry.js} +1 -1
- package/dist/ripple/p-c8bb4b2b.entry.js +1 -0
- package/dist/ripple/p-d09fb6b5.entry.js +1 -0
- package/dist/ripple/{p-b4efa7d1.system.entry.js → p-ddf157c8.system.entry.js} +1 -1
- package/dist/ripple/p-e1b076be.entry.js +1 -0
- package/dist/ripple/p-e7a7d732.entry.js +1 -0
- package/dist/ripple/p-e8e2228d.system.entry.js +1 -0
- package/dist/ripple/p-ebae8cae.system.entry.js +1 -0
- package/dist/ripple/p-efe7728e.entry.js +1 -0
- package/dist/ripple/p-f54c4b0e.system.js +1 -0
- package/dist/ripple/{p-08b7ec08.system.js → p-f5df5903.system.js} +0 -0
- package/dist/ripple/{p-a6d6eae7.js → p-fd8070fb.js} +0 -0
- package/dist/ripple/{p-fda5a778.system.entry.js → p-ffb97b6d.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/wm-chart/wm-chart-slice.d.ts +11 -11
- package/dist/types/components/charts/wm-chart/wm-chart.d.ts +35 -35
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -10
- package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +48 -48
- package/dist/types/components/wm-button/wm-button.d.ts +43 -43
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +41 -41
- package/dist/types/components/wm-input/wm-input.d.ts +46 -46
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
- package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -15
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -12
- package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +21 -21
- package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +13 -13
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +30 -30
- package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
- package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
- package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
- package/dist/types/components/wm-option/wm-option.d.ts +32 -32
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
- package/dist/types/components/wm-search/wm-search.d.ts +86 -86
- package/dist/types/components/wm-select/wm-select.d.ts +66 -66
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
- package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -92
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
- package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +80 -80
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
- package/dist/types/components.d.ts +24 -24
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/chartFunctions.d.ts +29 -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 +4 -6
- package/package.json +47 -47
- package/dist/esm-es5/chartFunctions-303e1644.js +0 -1
- package/dist/esm-es5/functions-e552a8b5.js +0 -15
- package/dist/esm-es5/global-fa341013.js +0 -1
- package/dist/esm-es5/index-7603f98e.js +0 -1
- package/dist/ripple/p-01d2c1ab.entry.js +0 -1
- package/dist/ripple/p-02a3c14f.entry.js +0 -1
- package/dist/ripple/p-1116a297.entry.js +0 -1
- package/dist/ripple/p-13a746ea.entry.js +0 -1
- package/dist/ripple/p-175eba9d.system.js +0 -15
- package/dist/ripple/p-1d0742b0.entry.js +0 -1
- package/dist/ripple/p-2409192f.entry.js +0 -1
- package/dist/ripple/p-313b6073.system.js +0 -1
- package/dist/ripple/p-358bde27.entry.js +0 -1
- package/dist/ripple/p-35ce3ff8.entry.js +0 -1
- package/dist/ripple/p-3bed42bf.entry.js +0 -1
- package/dist/ripple/p-3fa5f0f0.system.entry.js +0 -1
- package/dist/ripple/p-431220d3.entry.js +0 -1
- package/dist/ripple/p-461f08d4.entry.js +0 -1
- package/dist/ripple/p-4d59fe86.entry.js +0 -1
- package/dist/ripple/p-4f42da30.system.entry.js +0 -1
- package/dist/ripple/p-50db2d6a.system.entry.js +0 -1
- package/dist/ripple/p-5c099280.entry.js +0 -1
- package/dist/ripple/p-6910f965.entry.js +0 -1
- package/dist/ripple/p-69f21f1a.system.entry.js +0 -1
- package/dist/ripple/p-6a6408b8.system.js +0 -1
- package/dist/ripple/p-7fae0cc2.entry.js +0 -1
- package/dist/ripple/p-823380c1.system.entry.js +0 -1
- package/dist/ripple/p-83fe767e.entry.js +0 -1
- package/dist/ripple/p-89372ba5.system.entry.js +0 -1
- package/dist/ripple/p-936fbfff.entry.js +0 -1
- package/dist/ripple/p-9d69aa46.system.entry.js +0 -1
- package/dist/ripple/p-a0c3ef16.system.js +0 -1
- package/dist/ripple/p-a216c161.system.entry.js +0 -1
- package/dist/ripple/p-a51453f6.entry.js +0 -1
- package/dist/ripple/p-a9e0ce88.entry.js +0 -1
- package/dist/ripple/p-b3c71506.js +0 -1
- package/dist/ripple/p-b4724251.entry.js +0 -1
- package/dist/ripple/p-b6b5c946.entry.js +0 -1
- package/dist/ripple/p-b786a5fd.system.entry.js +0 -1
- package/dist/ripple/p-ba76563e.system.entry.js +0 -1
- package/dist/ripple/p-bd5a6394.entry.js +0 -1
- package/dist/ripple/p-c77d79be.entry.js +0 -1
- package/dist/ripple/p-c9541d4d.system.entry.js +0 -1
- package/dist/ripple/p-ca7c628f.entry.js +0 -1
- package/dist/ripple/p-cae4ebf4.system.entry.js +0 -1
- package/dist/ripple/p-cf648440.entry.js +0 -1
- package/dist/ripple/p-d93d5885.entry.js +0 -1
- package/dist/ripple/p-d9d82a0d.js +0 -1
- package/dist/ripple/p-e51562cd.system.entry.js +0 -1
- package/dist/ripple/p-eaedb11d.system.entry.js +0 -1
- package/dist/ripple/p-ed8115b9.system.entry.js +0 -1
- package/dist/ripple/p-f24ff348.system.js +0 -1
- package/dist/ripple/p-f37b54be.js +0 -16
- package/dist/ripple/p-f5f8bb25.system.entry.js +0 -1
- package/dist/ripple/p-f9c3a2ce.entry.js +0 -1
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +0 -27
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +0 -26
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +0 -17
|
@@ -3952,17 +3952,11 @@ function icuUnitToEcma(unit) {
|
|
|
3952
3952
|
return unit.replace(/^(.*?)-/, '');
|
|
3953
3953
|
}
|
|
3954
3954
|
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
3955
|
-
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)
|
|
3955
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
3956
3956
|
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
3957
3957
|
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
3958
3958
|
function parseSignificantPrecision(str) {
|
|
3959
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
|
-
}
|
|
3966
3960
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
|
|
3967
3961
|
// @@@ case
|
|
3968
3962
|
if (typeof g2 !== 'string') {
|
|
@@ -4189,13 +4183,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4189
4183
|
}
|
|
4190
4184
|
return '';
|
|
4191
4185
|
});
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
if (opt === 'w') {
|
|
4195
|
-
result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
|
|
4196
|
-
}
|
|
4197
|
-
else if (opt) {
|
|
4198
|
-
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
4186
|
+
if (token.options.length) {
|
|
4187
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
|
|
4199
4188
|
}
|
|
4200
4189
|
continue;
|
|
4201
4190
|
}
|
|
@@ -4217,8 +4206,8 @@ function parseNumberSkeleton(tokens) {
|
|
|
4217
4206
|
}
|
|
4218
4207
|
|
|
4219
4208
|
var _a;
|
|
4220
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
4221
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(
|
|
4209
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*");
|
|
4210
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$");
|
|
4222
4211
|
function createLocation(start, end) {
|
|
4223
4212
|
return { start: start, end: end };
|
|
4224
4213
|
}
|
|
@@ -4465,7 +4454,7 @@ var Parser = /** @class */ (function () {
|
|
|
4465
4454
|
return {
|
|
4466
4455
|
val: {
|
|
4467
4456
|
type: TYPE.literal,
|
|
4468
|
-
value: "<"
|
|
4457
|
+
value: "<" + tagName + "/>",
|
|
4469
4458
|
location: createLocation(startPosition, this.clonePosition()),
|
|
4470
4459
|
},
|
|
4471
4460
|
err: null,
|
|
@@ -5070,7 +5059,7 @@ var Parser = /** @class */ (function () {
|
|
|
5070
5059
|
}
|
|
5071
5060
|
var code = codePointAt(this.message, offset);
|
|
5072
5061
|
if (code === undefined) {
|
|
5073
|
-
throw Error("Offset "
|
|
5062
|
+
throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary");
|
|
5074
5063
|
}
|
|
5075
5064
|
return code;
|
|
5076
5065
|
};
|
|
@@ -5138,7 +5127,7 @@ var Parser = /** @class */ (function () {
|
|
|
5138
5127
|
*/
|
|
5139
5128
|
Parser.prototype.bumpTo = function (targetOffset) {
|
|
5140
5129
|
if (this.offset() > targetOffset) {
|
|
5141
|
-
throw Error("targetOffset "
|
|
5130
|
+
throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset());
|
|
5142
5131
|
}
|
|
5143
5132
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
5144
5133
|
while (true) {
|
|
@@ -5147,7 +5136,7 @@ var Parser = /** @class */ (function () {
|
|
|
5147
5136
|
break;
|
|
5148
5137
|
}
|
|
5149
5138
|
if (offset > targetOffset) {
|
|
5150
|
-
throw Error("targetOffset "
|
|
5139
|
+
throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary");
|
|
5151
5140
|
}
|
|
5152
5141
|
this.bump();
|
|
5153
5142
|
if (this.isEOF()) {
|
|
@@ -5613,28 +5602,28 @@ var FormatError = /** @class */ (function (_super) {
|
|
|
5613
5602
|
return _this;
|
|
5614
5603
|
}
|
|
5615
5604
|
FormatError.prototype.toString = function () {
|
|
5616
|
-
return "[formatjs Error: "
|
|
5605
|
+
return "[formatjs Error: " + this.code + "] " + this.message;
|
|
5617
5606
|
};
|
|
5618
5607
|
return FormatError;
|
|
5619
5608
|
}(Error));
|
|
5620
5609
|
var InvalidValueError = /** @class */ (function (_super) {
|
|
5621
5610
|
__extends(InvalidValueError, _super);
|
|
5622
5611
|
function InvalidValueError(variableId, value, options, originalMessage) {
|
|
5623
|
-
return _super.call(this, "Invalid values for \""
|
|
5612
|
+
return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5624
5613
|
}
|
|
5625
5614
|
return InvalidValueError;
|
|
5626
5615
|
}(FormatError));
|
|
5627
5616
|
var InvalidValueTypeError = /** @class */ (function (_super) {
|
|
5628
5617
|
__extends(InvalidValueTypeError, _super);
|
|
5629
5618
|
function InvalidValueTypeError(value, type, originalMessage) {
|
|
5630
|
-
return _super.call(this, "Value for \""
|
|
5619
|
+
return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
5631
5620
|
}
|
|
5632
5621
|
return InvalidValueTypeError;
|
|
5633
5622
|
}(FormatError));
|
|
5634
5623
|
var MissingValueError = /** @class */ (function (_super) {
|
|
5635
5624
|
__extends(MissingValueError, _super);
|
|
5636
5625
|
function MissingValueError(variableId, originalMessage) {
|
|
5637
|
-
return _super.call(this, "The intl string context variable \""
|
|
5626
|
+
return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
5638
5627
|
}
|
|
5639
5628
|
return MissingValueError;
|
|
5640
5629
|
}(FormatError));
|
|
@@ -5795,7 +5784,7 @@ originalMessage) {
|
|
|
5795
5784
|
continue;
|
|
5796
5785
|
}
|
|
5797
5786
|
if (isPluralElement(el)) {
|
|
5798
|
-
var opt = el.options["="
|
|
5787
|
+
var opt = el.options["=" + value];
|
|
5799
5788
|
if (!opt) {
|
|
5800
5789
|
if (!Intl.PluralRules) {
|
|
5801
5790
|
throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -5866,7 +5855,7 @@ function createDefaultFormatters(cache) {
|
|
|
5866
5855
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5867
5856
|
args[_i] = arguments[_i];
|
|
5868
5857
|
}
|
|
5869
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
5858
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5870
5859
|
}, {
|
|
5871
5860
|
cache: createFastMemoizeCache$1(cache.number),
|
|
5872
5861
|
strategy: strategies.variadic,
|
|
@@ -5877,7 +5866,7 @@ function createDefaultFormatters(cache) {
|
|
|
5877
5866
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5878
5867
|
args[_i] = arguments[_i];
|
|
5879
5868
|
}
|
|
5880
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
5869
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5881
5870
|
}, {
|
|
5882
5871
|
cache: createFastMemoizeCache$1(cache.dateTime),
|
|
5883
5872
|
strategy: strategies.variadic,
|
|
@@ -5888,7 +5877,7 @@ function createDefaultFormatters(cache) {
|
|
|
5888
5877
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5889
5878
|
args[_i] = arguments[_i];
|
|
5890
5879
|
}
|
|
5891
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args
|
|
5880
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
5892
5881
|
}, {
|
|
5893
5882
|
cache: createFastMemoizeCache$1(cache.pluralRules),
|
|
5894
5883
|
strategy: strategies.variadic,
|
|
@@ -6046,13 +6035,7 @@ var IntlErrorCode;
|
|
|
6046
6035
|
var IntlError = /** @class */ (function (_super) {
|
|
6047
6036
|
__extends(IntlError, _super);
|
|
6048
6037
|
function IntlError(code, message, exception) {
|
|
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;
|
|
6038
|
+
var _this = _super.call(this, "[@formatjs/intl Error " + code + "] " + message + " \n" + (exception ? "\n" + exception.message + "\n" + exception.stack : '')) || this;
|
|
6056
6039
|
_this.code = code;
|
|
6057
6040
|
// @ts-ignore just so we don't need to declare dep on @types/node
|
|
6058
6041
|
if (typeof Error.captureStackTrace === 'function') {
|
|
@@ -6084,26 +6067,19 @@ var MissingDataError = /** @class */ (function (_super) {
|
|
|
6084
6067
|
}
|
|
6085
6068
|
return MissingDataError;
|
|
6086
6069
|
}(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));
|
|
6094
6070
|
var MessageFormatError = /** @class */ (function (_super) {
|
|
6095
6071
|
__extends(MessageFormatError, _super);
|
|
6096
6072
|
function MessageFormatError(message, locale, descriptor, exception) {
|
|
6097
|
-
var _this = _super.call(this,
|
|
6073
|
+
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;
|
|
6098
6074
|
_this.descriptor = descriptor;
|
|
6099
6075
|
return _this;
|
|
6100
6076
|
}
|
|
6101
6077
|
return MessageFormatError;
|
|
6102
|
-
}(
|
|
6078
|
+
}(IntlError));
|
|
6103
6079
|
var MissingTranslationError = /** @class */ (function (_super) {
|
|
6104
6080
|
__extends(MissingTranslationError, _super);
|
|
6105
6081
|
function MissingTranslationError(descriptor, locale) {
|
|
6106
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \""
|
|
6082
|
+
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"" + descriptor.id + "\" for locale \"" + locale + "\", using " + (descriptor.defaultMessage ? 'default message' : 'id') + " as fallback.") || this;
|
|
6107
6083
|
_this.descriptor = descriptor;
|
|
6108
6084
|
return _this;
|
|
6109
6085
|
}
|
|
@@ -6130,7 +6106,6 @@ var DEFAULT_INTL_CONFIG = {
|
|
|
6130
6106
|
timeZone: undefined,
|
|
6131
6107
|
defaultLocale: 'en',
|
|
6132
6108
|
defaultFormats: {},
|
|
6133
|
-
fallbackOnEmptyString: true,
|
|
6134
6109
|
onError: defaultErrorHandler,
|
|
6135
6110
|
};
|
|
6136
6111
|
function createIntlCache() {
|
|
@@ -6173,7 +6148,7 @@ function createFormatters(cache) {
|
|
|
6173
6148
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6174
6149
|
args[_i] = arguments[_i];
|
|
6175
6150
|
}
|
|
6176
|
-
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
6151
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6177
6152
|
}, {
|
|
6178
6153
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
6179
6154
|
strategy: strategies.variadic,
|
|
@@ -6184,7 +6159,7 @@ function createFormatters(cache) {
|
|
|
6184
6159
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6185
6160
|
args[_i] = arguments[_i];
|
|
6186
6161
|
}
|
|
6187
|
-
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args
|
|
6162
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6188
6163
|
}, {
|
|
6189
6164
|
cache: createFastMemoizeCache(cache.number),
|
|
6190
6165
|
strategy: strategies.variadic,
|
|
@@ -6195,7 +6170,7 @@ function createFormatters(cache) {
|
|
|
6195
6170
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6196
6171
|
args[_i] = arguments[_i];
|
|
6197
6172
|
}
|
|
6198
|
-
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args
|
|
6173
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
6199
6174
|
}, {
|
|
6200
6175
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
6201
6176
|
strategy: strategies.variadic,
|
|
@@ -6218,7 +6193,7 @@ function createFormatters(cache) {
|
|
|
6218
6193
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6219
6194
|
args[_i] = arguments[_i];
|
|
6220
6195
|
}
|
|
6221
|
-
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args
|
|
6196
|
+
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
|
|
6222
6197
|
}, {
|
|
6223
6198
|
cache: createFastMemoizeCache(cache.relativeTime),
|
|
6224
6199
|
strategy: strategies.variadic,
|
|
@@ -6229,7 +6204,7 @@ function createFormatters(cache) {
|
|
|
6229
6204
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6230
6205
|
args[_i] = arguments[_i];
|
|
6231
6206
|
}
|
|
6232
|
-
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args
|
|
6207
|
+
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
|
|
6233
6208
|
}, {
|
|
6234
6209
|
cache: createFastMemoizeCache(cache.list),
|
|
6235
6210
|
strategy: strategies.variadic,
|
|
@@ -6239,7 +6214,7 @@ function createFormatters(cache) {
|
|
|
6239
6214
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6240
6215
|
args[_i] = arguments[_i];
|
|
6241
6216
|
}
|
|
6242
|
-
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args
|
|
6217
|
+
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
|
|
6243
6218
|
}, {
|
|
6244
6219
|
cache: createFastMemoizeCache(cache.displayNames),
|
|
6245
6220
|
strategy: strategies.variadic,
|
|
@@ -6255,7 +6230,7 @@ function getNamedFormat(formats, type, name, onError) {
|
|
|
6255
6230
|
if (format) {
|
|
6256
6231
|
return format;
|
|
6257
6232
|
}
|
|
6258
|
-
onError(new UnsupportedFormatterError("No "
|
|
6233
|
+
onError(new UnsupportedFormatterError("No " + type + " format named: " + name));
|
|
6259
6234
|
}
|
|
6260
6235
|
|
|
6261
6236
|
/**
|
|
@@ -6290,7 +6265,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
6290
6265
|
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)) });
|
|
6291
6266
|
}
|
|
6292
6267
|
function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
6293
|
-
var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats,
|
|
6268
|
+
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;
|
|
6294
6269
|
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
|
|
6295
6270
|
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
|
|
6296
6271
|
// `id` is a required field of a Message Descriptor.
|
|
@@ -6320,9 +6295,6 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6320
6295
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
6321
6296
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
6322
6297
|
if (!message) {
|
|
6323
|
-
if (fallbackOnEmptyString === false && message === '') {
|
|
6324
|
-
return message;
|
|
6325
|
-
}
|
|
6326
6298
|
if (!defaultMessage ||
|
|
6327
6299
|
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
6328
6300
|
// This prevents warnings from littering the console in development
|
|
@@ -6336,7 +6308,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6336
6308
|
return formatter.format(values);
|
|
6337
6309
|
}
|
|
6338
6310
|
catch (e) {
|
|
6339
|
-
onError(new MessageFormatError("Error formatting default message for: \""
|
|
6311
|
+
onError(new MessageFormatError("Error formatting default message for: \"" + id + "\", rendering default message verbatim", locale, messageDescriptor, e));
|
|
6340
6312
|
return typeof defaultMessage === 'string' ? defaultMessage : id;
|
|
6341
6313
|
}
|
|
6342
6314
|
}
|
|
@@ -6348,7 +6320,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6348
6320
|
return formatter.format(values);
|
|
6349
6321
|
}
|
|
6350
6322
|
catch (e) {
|
|
6351
|
-
onError(new MessageFormatError("Error formatting message: \""
|
|
6323
|
+
onError(new MessageFormatError("Error formatting message: \"" + id + "\", using " + (defaultMessage ? 'default message' : 'id') + " as fallback.", locale, messageDescriptor, e));
|
|
6352
6324
|
}
|
|
6353
6325
|
if (defaultMessage) {
|
|
6354
6326
|
try {
|
|
@@ -6356,7 +6328,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
|
|
|
6356
6328
|
return formatter.format(values);
|
|
6357
6329
|
}
|
|
6358
6330
|
catch (e) {
|
|
6359
|
-
onError(new MessageFormatError("Error formatting the default message for: \""
|
|
6331
|
+
onError(new MessageFormatError("Error formatting the default message for: \"" + id + "\", rendering message verbatim", locale, messageDescriptor, e));
|
|
6360
6332
|
}
|
|
6361
6333
|
}
|
|
6362
6334
|
if (typeof message === 'string') {
|
|
@@ -6394,7 +6366,9 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
|
|
|
6394
6366
|
if (options === void 0) { options = {}; }
|
|
6395
6367
|
var format = options.format;
|
|
6396
6368
|
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
|
|
6397
|
-
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6369
|
+
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
|
|
6370
|
+
// @ts-expect-error es2020 has a lot stuff from es2021 bleed in
|
|
6371
|
+
defaults);
|
|
6398
6372
|
if (type === 'time' &&
|
|
6399
6373
|
!filteredOptions.hour &&
|
|
6400
6374
|
!filteredOptions.minute &&
|
|
@@ -6511,7 +6485,7 @@ var LIST_FORMAT_OPTIONS = [
|
|
|
6511
6485
|
];
|
|
6512
6486
|
var now = Date.now();
|
|
6513
6487
|
function generateToken(i) {
|
|
6514
|
-
return
|
|
6488
|
+
return now + "_" + i + "_" + now;
|
|
6515
6489
|
}
|
|
6516
6490
|
function formatList(opts, getListFormat, values, options) {
|
|
6517
6491
|
if (options === void 0) { options = {}; }
|
|
@@ -6578,7 +6552,7 @@ function formatPlural(_a, getPluralRules, value, options) {
|
|
|
6578
6552
|
return getPluralRules(locale, filteredOptions).select(value);
|
|
6579
6553
|
}
|
|
6580
6554
|
catch (e) {
|
|
6581
|
-
onError(new
|
|
6555
|
+
onError(new MessageFormatError('Error formatting plural.', e));
|
|
6582
6556
|
}
|
|
6583
6557
|
return 'other';
|
|
6584
6558
|
}
|
|
@@ -6605,7 +6579,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
|
|
|
6605
6579
|
return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
|
|
6606
6580
|
}
|
|
6607
6581
|
catch (e) {
|
|
6608
|
-
config.onError(new
|
|
6582
|
+
config.onError(new MessageFormatError('Error formatting relative time.', e));
|
|
6609
6583
|
}
|
|
6610
6584
|
return String(value);
|
|
6611
6585
|
}
|
|
@@ -6685,7 +6659,7 @@ function createIntl(config, cache) {
|
|
|
6685
6659
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
6686
6660
|
if (!locale) {
|
|
6687
6661
|
if (onError) {
|
|
6688
|
-
onError(new InvalidConfigError("\"locale\" was not configured, using \""
|
|
6662
|
+
onError(new InvalidConfigError("\"locale\" was not configured, using \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details"));
|
|
6689
6663
|
}
|
|
6690
6664
|
// Since there's no registered locale data for `locale`, this will
|
|
6691
6665
|
// fallback to the `defaultLocale` to make sure things can render.
|
|
@@ -6695,481 +6669,481 @@ function createIntl(config, cache) {
|
|
|
6695
6669
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
6696
6670
|
}
|
|
6697
6671
|
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
6698
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6672
|
+
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"));
|
|
6699
6673
|
}
|
|
6700
6674
|
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
|
|
6701
6675
|
onError) {
|
|
6702
|
-
onError(new MissingDataError("Missing locale data for locale: \""
|
|
6676
|
+
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"));
|
|
6703
6677
|
}
|
|
6704
6678
|
verifyConfigMessages(resolvedConfig);
|
|
6705
6679
|
return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
|
|
6706
6680
|
}
|
|
6707
6681
|
|
|
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
|
-
}
|
|
6682
|
+
const DEFAULT_LANGUAGE = "en";
|
|
6683
|
+
function getBrowserLang() {
|
|
6684
|
+
const langAttr = document.documentElement.getAttribute("lang");
|
|
6685
|
+
if (!!langAttr) {
|
|
6686
|
+
return langAttr;
|
|
6687
|
+
}
|
|
6688
|
+
else if (window.navigator && window.navigator.language) {
|
|
6689
|
+
const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
|
|
6690
|
+
return lang.slice(0, 2);
|
|
6691
|
+
}
|
|
6692
|
+
else {
|
|
6693
|
+
return DEFAULT_LANGUAGE;
|
|
6694
|
+
}
|
|
6695
|
+
}
|
|
6696
|
+
// prevents memory leak
|
|
6697
|
+
const cache = createIntlCache();
|
|
6698
|
+
const locale = getBrowserLang();
|
|
6699
|
+
const intl = createIntl({
|
|
6700
|
+
locale: locale,
|
|
6701
|
+
defaultLocale: "en",
|
|
6702
|
+
messages: lang[locale] || en,
|
|
6703
|
+
}, cache);
|
|
6704
|
+
function generateId() {
|
|
6705
|
+
return "wmcl-" + Math.random().toString(36).substr(2, 10);
|
|
6706
|
+
}
|
|
6707
|
+
// limits how many times a function fires
|
|
6708
|
+
// use when the function should run periodically, but not too often (e.g. window resize)
|
|
6709
|
+
function throttle(fn, wait) {
|
|
6710
|
+
let timeout;
|
|
6711
|
+
let shouldWait = false;
|
|
6712
|
+
return function () {
|
|
6713
|
+
const context = this;
|
|
6714
|
+
if (!shouldWait) {
|
|
6715
|
+
fn.apply(context, arguments);
|
|
6716
|
+
shouldWait = true;
|
|
6717
|
+
clearTimeout(timeout);
|
|
6718
|
+
timeout = setTimeout(function () {
|
|
6719
|
+
shouldWait = false;
|
|
6720
|
+
}, wait);
|
|
6721
|
+
}
|
|
6722
|
+
};
|
|
6723
|
+
}
|
|
6724
|
+
// waits until it hasn't been called for [timeout] ms.
|
|
6725
|
+
// use when the function should run only after something (event) is done firing
|
|
6726
|
+
function debounce(fn, wait) {
|
|
6727
|
+
let timeout;
|
|
6728
|
+
return function () {
|
|
6729
|
+
const context = this;
|
|
6730
|
+
const functionCall = () => fn.apply(context, arguments);
|
|
6731
|
+
clearTimeout(timeout);
|
|
6732
|
+
timeout = setTimeout(functionCall, wait);
|
|
6733
|
+
};
|
|
6734
|
+
}
|
|
6735
|
+
function getTextDir() {
|
|
6736
|
+
const dir = document.querySelector("html").getAttribute("dir");
|
|
6737
|
+
return dir ? dir.toLowerCase() : "";
|
|
6738
|
+
}
|
|
6739
|
+
function getPosition(el) {
|
|
6740
|
+
const coords = el.getBoundingClientRect();
|
|
6741
|
+
let x = coords.x;
|
|
6742
|
+
let y = coords.y;
|
|
6743
|
+
// Edge doesn't have x and y
|
|
6744
|
+
if (!x) {
|
|
6745
|
+
if (getTextDir() === "rtl") {
|
|
6746
|
+
x = coords.right;
|
|
6747
|
+
}
|
|
6748
|
+
else {
|
|
6749
|
+
x = coords.left;
|
|
6750
|
+
}
|
|
6751
|
+
y = coords.top;
|
|
6752
|
+
}
|
|
6753
|
+
return { x, y };
|
|
6754
|
+
}
|
|
6755
|
+
function findParentWithScrollbar(el) {
|
|
6756
|
+
while (!!el) {
|
|
6757
|
+
if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
|
|
6758
|
+
return el;
|
|
6759
|
+
}
|
|
6760
|
+
el = el.parentElement;
|
|
6761
|
+
}
|
|
6762
|
+
}
|
|
6763
|
+
function findParentWithHiddenOverflow(el) {
|
|
6764
|
+
while (!!el) {
|
|
6765
|
+
if (window.getComputedStyle(el).overflowY !== "visible") {
|
|
6766
|
+
return el;
|
|
6767
|
+
}
|
|
6768
|
+
el = el.parentElement;
|
|
6769
|
+
}
|
|
6770
|
+
}
|
|
6771
|
+
function getClosableElementMeasurements(fixedEl, closableEl) {
|
|
6772
|
+
const parent = findParentWithHiddenOverflow(fixedEl);
|
|
6773
|
+
// if parent is not found, measurements are checked against the viewport
|
|
6774
|
+
return {
|
|
6775
|
+
closableElHeight: closableEl.clientHeight,
|
|
6776
|
+
closableElWidth: closableEl.clientWidth,
|
|
6777
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6778
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6779
|
+
spaceAbove: parent
|
|
6780
|
+
? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
|
|
6781
|
+
: fixedEl.getBoundingClientRect().top,
|
|
6782
|
+
// NB boundingClientRect.bottom is space from top of viewport to bottom of el
|
|
6783
|
+
// to get space below the el -> height of viewport minus boundingClientRect.bottom
|
|
6784
|
+
spaceBelow: parent
|
|
6785
|
+
? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
|
|
6786
|
+
: document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
|
|
6787
|
+
spaceLeft: parent
|
|
6788
|
+
? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
|
|
6789
|
+
: fixedEl.getBoundingClientRect().left,
|
|
6790
|
+
spaceRight: parent
|
|
6791
|
+
? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
|
|
6792
|
+
: document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
|
|
6793
|
+
};
|
|
6794
|
+
}
|
|
6795
|
+
function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
|
|
6796
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6797
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6798
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6799
|
+
) {
|
|
6800
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6801
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6802
|
+
const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
|
|
6803
|
+
return openUp;
|
|
6804
|
+
}
|
|
6805
|
+
function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
|
|
6806
|
+
closableEl, //the dropdown/popup/etc that becomes visible when the component is open
|
|
6807
|
+
offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
|
|
6808
|
+
offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
|
|
6809
|
+
) {
|
|
6810
|
+
const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6811
|
+
//we want to open up only if there's not enough space below AND there is enough space above
|
|
6812
|
+
const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
|
|
6813
|
+
return openDown;
|
|
6814
|
+
}
|
|
6815
|
+
function shouldShiftRight(fixedEl, closableEl) {
|
|
6816
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6817
|
+
const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
|
|
6818
|
+
return needsSpaceLeft;
|
|
6819
|
+
}
|
|
6820
|
+
function shouldShiftLeft(fixedEl, closableEl) {
|
|
6821
|
+
const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
|
|
6822
|
+
const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
|
|
6823
|
+
return needsSpaceRight;
|
|
6824
|
+
}
|
|
6825
|
+
function adjustTooltipPosition(tPos, el, tooltipEl) {
|
|
6826
|
+
// position must be reset before measurements are taken in adjustTooltipPosition
|
|
6827
|
+
// otherwise text-wrapping from previous position makes width measurement inconsistent
|
|
6828
|
+
tooltipEl.style.top = "";
|
|
6829
|
+
tooltipEl.style.left = "";
|
|
6830
|
+
const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
|
|
6831
|
+
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
6832
|
+
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
6833
|
+
const enoughSpaceAbove = spaceAbove > tooltipHeight;
|
|
6834
|
+
const enoughSpaceBelow = spaceBelow > tooltipHeight;
|
|
6835
|
+
// a tooltip should never be closer than 24px to the edge of a screen
|
|
6836
|
+
const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
|
|
6837
|
+
const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
|
|
6838
|
+
const swapAbove = (position) => {
|
|
6839
|
+
return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
|
|
6840
|
+
};
|
|
6841
|
+
const swapBelow = (position) => {
|
|
6842
|
+
return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
|
|
6843
|
+
};
|
|
6844
|
+
const swapLeft = (position, centeredPosition) => {
|
|
6845
|
+
if (!enoughSpaceLeft && enoughSpaceRight) {
|
|
6846
|
+
position = position.replace("left", "right");
|
|
6847
|
+
}
|
|
6848
|
+
else if (!enoughSpaceLeft && !enoughSpaceRight) {
|
|
6849
|
+
position = centeredPosition;
|
|
6850
|
+
}
|
|
6851
|
+
return position;
|
|
6852
|
+
};
|
|
6853
|
+
const swapRight = (position, centeredPosition) => {
|
|
6854
|
+
if (!enoughSpaceRight && enoughSpaceLeft) {
|
|
6855
|
+
position = position.replace("right", "left");
|
|
6856
|
+
}
|
|
6857
|
+
else if (!enoughSpaceRight && !enoughSpaceLeft) {
|
|
6858
|
+
position = centeredPosition;
|
|
6859
|
+
}
|
|
6860
|
+
return position;
|
|
6861
|
+
};
|
|
6862
|
+
// horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
|
|
6863
|
+
switch (tPos) {
|
|
6864
|
+
case "left":
|
|
6865
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6866
|
+
case "right":
|
|
6867
|
+
tPos = swapRight(tPos, "bottom");
|
|
6868
|
+
case "top-left":
|
|
6869
|
+
tPos = swapLeft(tPos, "top");
|
|
6870
|
+
tPos = swapAbove(tPos);
|
|
6871
|
+
case "top-right":
|
|
6872
|
+
tPos = swapRight(tPos, "top");
|
|
6873
|
+
tPos = swapAbove(tPos);
|
|
6874
|
+
case "bottom-left":
|
|
6875
|
+
tPos = swapLeft(tPos, "bottom");
|
|
6876
|
+
tPos = swapBelow(tPos);
|
|
6877
|
+
case "bottom-right":
|
|
6878
|
+
tPos = swapRight(tPos, "bottom");
|
|
6879
|
+
tPos = swapBelow(tPos);
|
|
6880
|
+
case "top":
|
|
6881
|
+
tPos = swapAbove(tPos);
|
|
6882
|
+
case "bottom":
|
|
6883
|
+
tPos = swapBelow(tPos);
|
|
6884
|
+
}
|
|
6885
|
+
return tPos;
|
|
6886
|
+
}
|
|
6887
|
+
function hasRoomRight(x, spaceNeeded) {
|
|
6888
|
+
let horizOffset = 0;
|
|
6889
|
+
// if (getTextDir() === "ltr") {
|
|
6890
|
+
if (x.type === "click") {
|
|
6891
|
+
// if it's a mouse event, deal with mouse coords
|
|
6892
|
+
horizOffset = x.clientX;
|
|
6893
|
+
// if it's a focus event, the offset is 0
|
|
6894
|
+
}
|
|
6895
|
+
else if (x.type === "focus") {
|
|
6896
|
+
horizOffset = 0;
|
|
6897
|
+
}
|
|
6898
|
+
else {
|
|
6899
|
+
// otherwise an element was passed, calculate how far it is from the edge of the window
|
|
6900
|
+
let el = x; // re-assignment is for clarity
|
|
6901
|
+
while (el) {
|
|
6902
|
+
if (el.tagName == "BODY") {
|
|
6903
|
+
// deal with browser quirks with body/window/document and page scroll
|
|
6904
|
+
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6905
|
+
horizOffset += el.offsetLeft - xScroll + el.clientLeft;
|
|
6906
|
+
}
|
|
6907
|
+
else {
|
|
6908
|
+
// for all other non-BODY elements
|
|
6909
|
+
horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
|
|
6910
|
+
}
|
|
6911
|
+
el = el.offsetParent;
|
|
6912
|
+
}
|
|
6913
|
+
// }
|
|
6914
|
+
}
|
|
6915
|
+
return window.innerWidth - horizOffset >= spaceNeeded;
|
|
6916
|
+
}
|
|
6917
|
+
function checkForActiveElInShadow(element) {
|
|
6918
|
+
while (element && element.shadowRoot) {
|
|
6919
|
+
element = element.shadowRoot.activeElement;
|
|
6920
|
+
}
|
|
6921
|
+
return element;
|
|
6922
|
+
}
|
|
6923
|
+
function checkForFocusableElInShadow(element) {
|
|
6924
|
+
const selectors = [
|
|
6925
|
+
"button",
|
|
6926
|
+
"a",
|
|
6927
|
+
"input",
|
|
6928
|
+
"select",
|
|
6929
|
+
"textarea",
|
|
6930
|
+
"wm-button",
|
|
6931
|
+
"wm-search",
|
|
6932
|
+
"wm-select",
|
|
6933
|
+
"wm-action-menu",
|
|
6934
|
+
"wm-tab-item",
|
|
6935
|
+
"wm-datepicker",
|
|
6936
|
+
];
|
|
6937
|
+
let focusableEl = element;
|
|
6938
|
+
selectors.forEach((selector) => {
|
|
6939
|
+
if (focusableEl && focusableEl.shadowRoot) {
|
|
6940
|
+
let elInShadow = focusableEl.shadowRoot.querySelector(selector);
|
|
6941
|
+
if (elInShadow) {
|
|
6942
|
+
if (selector.startsWith("wm-")) {
|
|
6943
|
+
focusableEl = checkForFocusableElInShadow(elInShadow);
|
|
6944
|
+
}
|
|
6945
|
+
else {
|
|
6946
|
+
focusableEl = elInShadow;
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
});
|
|
6951
|
+
return focusableEl;
|
|
6952
|
+
}
|
|
6953
|
+
function isFocusable(element) {
|
|
6954
|
+
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
|
|
6955
|
+
return true;
|
|
6956
|
+
}
|
|
6957
|
+
if (element.disabled) {
|
|
6958
|
+
return false;
|
|
6959
|
+
}
|
|
6960
|
+
switch (element.nodeName) {
|
|
6961
|
+
case "A":
|
|
6962
|
+
return !!element.href && element.rel != "ignore";
|
|
6963
|
+
case "INPUT":
|
|
6964
|
+
return element.type != "hidden" && element.type != "file";
|
|
6965
|
+
case "BUTTON":
|
|
6966
|
+
case "SELECT":
|
|
6967
|
+
case "TEXTAREA":
|
|
6968
|
+
case "WM-BUTTON":
|
|
6969
|
+
case "WM-SELECT":
|
|
6970
|
+
case "WM-ACTION-MENU":
|
|
6971
|
+
case "WM-DATEPICKER":
|
|
6972
|
+
case "WM-TIMEPICKER":
|
|
6973
|
+
case "WM-INPUT":
|
|
6974
|
+
case "WM-TAG-INPUT":
|
|
6975
|
+
case "WM-TAB-ITEM":
|
|
6976
|
+
case "WM-SEARCH":
|
|
6977
|
+
return true;
|
|
6978
|
+
default:
|
|
6979
|
+
return false;
|
|
6980
|
+
}
|
|
6981
|
+
}
|
|
6982
|
+
function getFirstFocusableDescendant(element) {
|
|
6983
|
+
if (isFocusable(element)) {
|
|
6984
|
+
return checkForFocusableElInShadow(element);
|
|
6985
|
+
}
|
|
6986
|
+
else if (element.childNodes.length > 0) {
|
|
6987
|
+
element.childNodes.forEach((i) => {
|
|
6988
|
+
const childEl = getFirstFocusableDescendant(i);
|
|
6989
|
+
return childEl && checkForFocusableElInShadow(childEl);
|
|
6990
|
+
});
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
function hasValidType(file, types) {
|
|
6994
|
+
const acceptedExtensions = types.split(" ");
|
|
6995
|
+
const parts = file.name && file.name.split(".");
|
|
6996
|
+
const ext = parts && parts.length > 1 && parts[parts.length - 1];
|
|
6997
|
+
return ext
|
|
6998
|
+
? acceptedExtensions.includes(ext.toLowerCase())
|
|
6999
|
+
: // fallback: if we couldn't obtain an extension,
|
|
7000
|
+
// validate based on MIME type...
|
|
7001
|
+
!!file.type
|
|
7002
|
+
? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
|
|
7003
|
+
: // ...and if that failed too, accept the file
|
|
7004
|
+
// as it's preferable to accept an invalid file
|
|
7005
|
+
// than refusing a valid one (back-end will take care of what slips through)
|
|
7006
|
+
true;
|
|
7007
|
+
}
|
|
7008
|
+
// takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
|
|
7009
|
+
function getAcceptedMimeTypesList(acceptedExtensions) {
|
|
7010
|
+
// this is just a list of common file types (regardless of whether they are/can be valid or not)
|
|
7011
|
+
// front end checks are just a convenience to users, independent of security.
|
|
7012
|
+
// it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
|
|
7013
|
+
const lookupTable = {
|
|
7014
|
+
aac: ["audio/aac"],
|
|
7015
|
+
abw: ["application/x-abiword"],
|
|
7016
|
+
arc: ["application/x-freearc"],
|
|
7017
|
+
avi: ["video/x-msvideo"],
|
|
7018
|
+
azw: ["application/vnd.amazon.ebook"],
|
|
7019
|
+
bin: ["application/octet-stream"],
|
|
7020
|
+
bmp: ["image/bmp"],
|
|
7021
|
+
bz: ["application/x-bzip"],
|
|
7022
|
+
bz2: ["application/x-bzip2"],
|
|
7023
|
+
csh: ["application/x-csh"],
|
|
7024
|
+
css: ["text/css"],
|
|
7025
|
+
csv: ["text/csv"],
|
|
7026
|
+
doc: ["application/msword"],
|
|
7027
|
+
docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
7028
|
+
eot: ["application/vnd.ms-fontobject"],
|
|
7029
|
+
epub: ["application/epub+zip"],
|
|
7030
|
+
gz: ["application/gzip"],
|
|
7031
|
+
gif: ["image/gif"],
|
|
7032
|
+
htm: ["text/html"],
|
|
7033
|
+
html: ["text/html"],
|
|
7034
|
+
ico: ["image/vnd.microsoft.icon"],
|
|
7035
|
+
ics: ["text/calendar"],
|
|
7036
|
+
jar: ["application/java-archive"],
|
|
7037
|
+
jpeg: ["image/jpeg"],
|
|
7038
|
+
jpg: ["image/jpeg"],
|
|
7039
|
+
js: ["text/javascript"],
|
|
7040
|
+
json: ["application/json"],
|
|
7041
|
+
jsonld: ["application/ld+json"],
|
|
7042
|
+
log: ["text/plain"],
|
|
7043
|
+
mid: ["audio/x-midi"],
|
|
7044
|
+
midi: ["audio/x-midi"],
|
|
7045
|
+
mjs: ["text/javascript"],
|
|
7046
|
+
mp3: ["audio/mpeg"],
|
|
7047
|
+
mpeg: ["video/mpeg"],
|
|
7048
|
+
mpkg: ["application/vnd.apple.installer+xml"],
|
|
7049
|
+
odp: ["application/vnd.oasis.opendocument.presentation"],
|
|
7050
|
+
ods: ["application/vnd.oasis.opendocument.spreadsheet"],
|
|
7051
|
+
odt: ["application/vnd.oasis.opendocument.text"],
|
|
7052
|
+
oga: ["audio/ogg"],
|
|
7053
|
+
ogv: ["video/ogg"],
|
|
7054
|
+
ogx: ["application/ogg"],
|
|
7055
|
+
opus: ["audio/opus"],
|
|
7056
|
+
otf: ["font/otf"],
|
|
7057
|
+
png: ["image/png"],
|
|
7058
|
+
pdf: ["application/pdf"],
|
|
7059
|
+
php: ["application/php"],
|
|
7060
|
+
ppt: ["application/vnd.ms-powerpoint"],
|
|
7061
|
+
pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
7062
|
+
rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
|
|
7063
|
+
rtf: ["application/rtf"],
|
|
7064
|
+
sh: ["application/x-sh"],
|
|
7065
|
+
svg: ["image/svg+xml"],
|
|
7066
|
+
swf: ["application/x-shockwave-flash"],
|
|
7067
|
+
tar: ["application/x-tar"],
|
|
7068
|
+
tif: ["image/tiff"],
|
|
7069
|
+
tiff: ["image/tiff"],
|
|
7070
|
+
ts: ["video/mp2t"],
|
|
7071
|
+
ttf: ["font/ttf"],
|
|
7072
|
+
txt: ["text/plain"],
|
|
7073
|
+
vsd: ["application/vnd.visio"],
|
|
7074
|
+
wav: ["audio/wav"],
|
|
7075
|
+
weba: ["audio/webm"],
|
|
7076
|
+
webm: ["video/webm"],
|
|
7077
|
+
webp: ["image/webp"],
|
|
7078
|
+
woff: ["font/woff"],
|
|
7079
|
+
woff2: ["font/woff2"],
|
|
7080
|
+
xhtml: ["application/xhtml+xml"],
|
|
7081
|
+
xls: ["application/vnd.ms-excel"],
|
|
7082
|
+
xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
7083
|
+
xml: ["application/xml", "text/xml"],
|
|
7084
|
+
xul: ["application/vnd.mozilla.xul+xml"],
|
|
7085
|
+
zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
|
|
7086
|
+
"3gp": ["video/3gpp", "audio/3gpp"],
|
|
7087
|
+
"3g2": ["video/3gpp2", "audio/3gpp2"],
|
|
7088
|
+
"7z": ["application/x-7z-compressed"],
|
|
7089
|
+
};
|
|
7090
|
+
return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
|
|
7091
|
+
}
|
|
7092
|
+
function snakeCaseToCamelCase(str) {
|
|
7093
|
+
const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
|
|
7094
|
+
if (snakeCaseRegexp.test(str)) {
|
|
7095
|
+
let camelCase = "";
|
|
7096
|
+
let arr = str.split("_");
|
|
7097
|
+
arr.forEach((word, idx) => {
|
|
7098
|
+
camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
|
|
7099
|
+
});
|
|
7100
|
+
return camelCase;
|
|
7101
|
+
}
|
|
7102
|
+
else {
|
|
7103
|
+
return str;
|
|
7104
|
+
}
|
|
7105
|
+
}
|
|
7106
|
+
function getNewIndexToFocus(currentIndex, direction, listLength) {
|
|
7107
|
+
let newIndex = currentIndex;
|
|
7108
|
+
if (direction === "ArrowDown") {
|
|
7109
|
+
newIndex = (currentIndex + 1) % listLength;
|
|
7110
|
+
}
|
|
7111
|
+
if (direction === "ArrowUp") {
|
|
7112
|
+
newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
|
|
7113
|
+
}
|
|
7114
|
+
return newIndex;
|
|
7115
|
+
}
|
|
7116
|
+
function isRelatedTarget(ev, id) {
|
|
7117
|
+
// used for onBlur events to check the element that has been clicked
|
|
7118
|
+
const ids = id.split(" ");
|
|
7119
|
+
return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
|
|
7120
|
+
}
|
|
7121
|
+
function toBool(val) {
|
|
7122
|
+
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
7123
|
+
return val == "false" ? false : !!val;
|
|
7124
|
+
}
|
|
7125
|
+
/*
|
|
7126
|
+
* this is going to be needed to solve the extra tabbing on navigator
|
|
7127
|
+
* and for programmatic focus of tabs
|
|
7128
|
+
* Here's a draft, not bug proof, see:
|
|
7129
|
+
* https://stackoverflow.com/a/10730308/3741713
|
|
7130
|
+
|
|
7131
|
+
function getKeyboardFocusableElements(element = document) {
|
|
7132
|
+
const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
|
|
7133
|
+
return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
|
|
7134
|
+
}
|
|
7135
|
+
|
|
7136
|
+
export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
|
|
7137
|
+
const els = getKeyboardFocusableElements();
|
|
7138
|
+
const current = els.indexOf(element);
|
|
7139
|
+
return els[current - 1] as HTMLElement;
|
|
7140
|
+
}
|
|
7141
|
+
|
|
7142
|
+
export function getNextKeyboardFocusableElement(element: HTMLElement) {
|
|
7143
|
+
const els = getKeyboardFocusableElements();
|
|
7144
|
+
const current = els.indexOf(element);
|
|
7145
|
+
return els[current + 1] as HTMLElement;
|
|
7146
|
+
}
|
|
7173
7147
|
*/
|
|
7174
7148
|
|
|
7175
7149
|
exports.adjustTooltipPosition = adjustTooltipPosition;
|