@watermarkinsights/ripple 3.11.0 → 3.12.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-847c1e8b.js → chartFunctions-44ae2eee.js} +420 -420
- package/dist/cjs/{functions-e80fc415.js → functions-1a67b971.js} +477 -1921
- package/dist/cjs/{global-8910723e.js → global-d71c13fa.js} +60 -60
- package/dist/cjs/{http-service-9e8c4dd5.js → http-service-494d81de.js} +49 -49
- package/dist/cjs/{index-df6a3611.js → index-acad7ab3.js} +1 -4
- package/dist/cjs/{interfaces-30a74c1f.js → interfaces-a3338581.js} +29 -29
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/priv-chart-popover.cjs.entry.js +87 -87
- package/dist/cjs/priv-datepicker.cjs.entry.js +658 -658
- 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 +336 -336
- package/dist/cjs/wm-button.cjs.entry.js +230 -227
- package/dist/cjs/wm-chart-slice.cjs.entry.js +14 -14
- package/dist/cjs/wm-chart.cjs.entry.js +111 -111
- package/dist/cjs/wm-datepicker.cjs.entry.js +266 -266
- package/dist/cjs/wm-input.cjs.entry.js +135 -135
- package/dist/cjs/wm-modal-footer.cjs.entry.js +34 -34
- package/dist/cjs/wm-modal-header.cjs.entry.js +37 -37
- package/dist/cjs/wm-modal.cjs.entry.js +164 -164
- package/dist/cjs/wm-navigation_3.cjs.entry.js +228 -228
- package/dist/cjs/wm-navigator.cjs.entry.js +269 -269
- package/dist/cjs/wm-network-uploader.cjs.entry.js +453 -453
- package/dist/cjs/wm-option_2.cjs.entry.js +485 -485
- package/dist/cjs/wm-pagination.cjs.entry.js +168 -168
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +130 -130
- package/dist/cjs/wm-search.cjs.entry.js +233 -233
- package/dist/cjs/wm-snackbar.cjs.entry.js +171 -171
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +297 -297
- package/dist/cjs/wm-tag-input.cjs.entry.js +580 -580
- package/dist/cjs/wm-timepicker.cjs.entry.js +384 -384
- package/dist/cjs/wm-toggletip.cjs.entry.js +125 -125
- package/dist/cjs/wm-uploader.cjs.entry.js +632 -608
- package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +1 -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.js +328 -328
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +195 -195
- 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 +448 -448
- package/dist/collection/components/wm-button/wm-button.js +494 -491
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1024 -1024
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +471 -471
- 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 +136 -136
- package/dist/collection/components/wm-modal/wm-modal-header.js +87 -87
- package/dist/collection/components/wm-modal/wm-modal.js +461 -461
- 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 +218 -218
- 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.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.js +718 -718
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
- 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.js +810 -810
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +785 -785
- package/dist/collection/components/wm-uploader/wm-uploader.js +1077 -1051
- 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 +421 -421
- 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-60cabc24.js → chartFunctions-8fa800a6.js} +420 -420
- package/dist/esm/{functions-dde318c0.js → functions-61c7bb1f.js} +477 -1921
- package/dist/esm/{global-efcb3f02.js → global-0ee18f6e.js} +60 -60
- package/dist/esm/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +49 -49
- package/dist/esm/{index-17c79cc6.js → index-7603f98e.js} +1 -4
- package/dist/esm/{interfaces-61c6305b.js → interfaces-2b97fab2.js} +29 -29
- package/dist/esm/loader.js +4 -4
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-chart-popover.entry.js +87 -87
- package/dist/esm/priv-datepicker.entry.js +658 -658
- 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 +336 -336
- package/dist/esm/wm-button.entry.js +230 -227
- package/dist/esm/wm-chart-slice.entry.js +14 -14
- package/dist/esm/wm-chart.entry.js +111 -111
- package/dist/esm/wm-datepicker.entry.js +266 -266
- package/dist/esm/wm-input.entry.js +135 -135
- package/dist/esm/wm-modal-footer.entry.js +34 -34
- package/dist/esm/wm-modal-header.entry.js +37 -37
- package/dist/esm/wm-modal.entry.js +164 -164
- package/dist/esm/wm-navigation_3.entry.js +228 -228
- package/dist/esm/wm-navigator.entry.js +269 -269
- package/dist/esm/wm-network-uploader.entry.js +453 -453
- package/dist/esm/wm-option_2.entry.js +485 -485
- package/dist/esm/wm-pagination.entry.js +168 -168
- package/dist/esm/wm-progress-indicator_3.entry.js +130 -130
- package/dist/esm/wm-search.entry.js +233 -233
- package/dist/esm/wm-snackbar.entry.js +171 -171
- package/dist/esm/wm-tab-item_3.entry.js +297 -297
- package/dist/esm/wm-tag-input.entry.js +580 -580
- package/dist/esm/wm-timepicker.entry.js +384 -384
- package/dist/esm/wm-toggletip.entry.js +125 -125
- package/dist/esm/wm-uploader.entry.js +632 -608
- package/dist/esm/wm-wrapper.entry.js +13 -13
- package/dist/esm-es5/{chartFunctions-60cabc24.js → chartFunctions-8fa800a6.js} +1 -1
- package/dist/esm-es5/functions-61c7bb1f.js +15 -0
- package/dist/esm-es5/global-0ee18f6e.js +1 -0
- package/dist/esm-es5/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +0 -0
- package/dist/esm-es5/{index-17c79cc6.js → index-7603f98e.js} +1 -1
- 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/ripple/p-00fa3d4b.entry.js +1 -0
- package/dist/ripple/p-0f33461d.entry.js +1 -0
- package/dist/ripple/p-0fbb7809.system.js +1 -0
- package/dist/ripple/{p-c62df7fc.system.entry.js → p-1242752c.system.entry.js} +1 -1
- package/dist/ripple/p-140ff08b.js +1 -0
- package/dist/ripple/p-15b1c11b.js +16 -0
- package/dist/ripple/{p-59678b70.system.entry.js → p-1df2adee.system.entry.js} +1 -1
- package/dist/ripple/{p-ad60e3ba.system.entry.js → p-212aac05.system.entry.js} +1 -1
- package/dist/ripple/{p-c1185f13.system.js → p-28bf6a2e.system.js} +1 -1
- package/dist/ripple/p-30745db6.entry.js +1 -0
- package/dist/ripple/p-358bde27.entry.js +1 -0
- package/dist/ripple/p-35cfcf9f.entry.js +1 -0
- package/dist/ripple/p-379b125b.entry.js +1 -0
- package/dist/ripple/{p-3d4bf3df.system.entry.js → p-398b2486.system.entry.js} +1 -1
- package/dist/ripple/{p-f17076c4.system.entry.js → p-3b3e847c.system.entry.js} +1 -1
- package/dist/ripple/{p-bc207b54.system.entry.js → p-3e6498ea.system.entry.js} +1 -1
- package/dist/ripple/{p-29425d92.system.entry.js → p-3f1d8211.system.entry.js} +1 -1
- package/dist/ripple/{p-8fab569a.system.entry.js → p-42aa51fe.system.entry.js} +1 -1
- package/dist/ripple/{p-888bec42.js → p-43f1298b.js} +0 -0
- package/dist/ripple/{p-bd9e6e7b.system.entry.js → p-44035b02.system.entry.js} +1 -1
- package/dist/ripple/{p-b0ba5460.system.entry.js → p-487f7419.system.entry.js} +1 -1
- package/dist/ripple/p-4d59fe86.entry.js +1 -0
- package/dist/ripple/p-520b0f54.entry.js +1 -0
- package/dist/ripple/{p-d1eff01f.system.entry.js → p-5471864e.system.entry.js} +1 -1
- package/dist/ripple/p-5e041c35.entry.js +1 -0
- package/dist/ripple/{p-158f538a.system.entry.js → p-68155230.system.entry.js} +1 -1
- package/dist/ripple/{p-fb4d6afd.system.entry.js → p-72eb5064.system.entry.js} +1 -1
- package/dist/ripple/{p-0e605966.system.entry.js → p-73d66b0a.system.entry.js} +1 -1
- package/dist/ripple/{p-d934e3bb.system.entry.js → p-75ef731b.system.entry.js} +1 -1
- package/dist/ripple/p-76ca7498.system.js +15 -0
- package/dist/ripple/p-7fae0cc2.entry.js +1 -0
- package/dist/ripple/{p-7cb0b2a5.js → p-8aa9f811.js} +1 -1
- package/dist/ripple/p-8caae464.entry.js +1 -0
- package/dist/ripple/p-8d347cd5.entry.js +1 -0
- package/dist/ripple/{p-27253ed2.system.entry.js → p-90ed3268.system.entry.js} +1 -1
- package/dist/ripple/p-92226595.entry.js +1 -0
- package/dist/ripple/{p-313b6073.system.js → p-9d02957d.system.js} +0 -0
- package/dist/ripple/{p-f2959770.system.entry.js → p-9e671274.system.entry.js} +1 -1
- package/dist/ripple/{p-d0369e2f.system.entry.js → p-9f12284b.system.entry.js} +1 -1
- package/dist/ripple/p-9fe64cec.entry.js +1 -0
- package/dist/ripple/{p-726b9452.system.js → p-a0c3ef16.system.js} +1 -1
- package/dist/ripple/p-a82d37d8.entry.js +1 -0
- package/dist/ripple/p-a9e0ce88.entry.js +1 -0
- package/dist/ripple/{p-c78f0984.system.entry.js → p-ac2485a6.system.entry.js} +1 -1
- package/dist/ripple/{p-db44eb6f.system.entry.js → p-ae6cfbca.system.entry.js} +1 -1
- package/dist/ripple/p-b3c71506.js +1 -0
- package/dist/ripple/p-ba168596.entry.js +1 -0
- package/dist/ripple/p-bb7bc75b.entry.js +1 -0
- package/dist/ripple/{p-6bfc949d.system.entry.js → p-c873b490.system.entry.js} +1 -1
- package/dist/ripple/p-cd4fda75.entry.js +1 -0
- package/dist/ripple/p-d3603def.entry.js +1 -0
- package/dist/ripple/{p-35f21755.system.entry.js → p-d3ed8b65.system.entry.js} +1 -1
- package/dist/ripple/{p-3b77a3f7.system.entry.js → p-d81a4e7c.system.entry.js} +1 -1
- package/dist/ripple/{p-72c1052f.system.js → p-db6fddec.system.js} +1 -1
- package/dist/ripple/{p-fffdb4fb.system.entry.js → p-e180001c.system.entry.js} +1 -1
- package/dist/ripple/p-e49b9a96.entry.js +1 -0
- package/dist/ripple/p-e748e22b.entry.js +1 -0
- package/dist/ripple/p-e75e75e0.entry.js +1 -0
- package/dist/ripple/{p-25696dab.system.entry.js → p-eacd33cc.system.entry.js} +1 -1
- package/dist/ripple/p-ed657559.entry.js +1 -0
- package/dist/ripple/{p-1eb5cb0d.system.entry.js → p-eee347b4.system.entry.js} +1 -1
- package/dist/ripple/p-f0656464.entry.js +1 -0
- package/dist/ripple/p-f12a510f.entry.js +1 -0
- package/dist/ripple/p-f36b74bf.entry.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-4f393ce8.system.entry.js → p-fdc4a599.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 +36 -36
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +27 -27
- 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 +47 -47
- 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 +14 -14
- package/dist/types/components/wm-modal/wm-modal-header.d.ts +11 -11
- 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 +28 -28
- 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 +118 -115
- 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 -29
- 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/package.json +47 -47
- package/dist/esm-es5/functions-dde318c0.js +0 -1
- package/dist/esm-es5/global-efcb3f02.js +0 -1
- package/dist/ripple/p-008292f6.system.js +0 -1
- package/dist/ripple/p-05757c14.entry.js +0 -1
- package/dist/ripple/p-06618a34.entry.js +0 -1
- package/dist/ripple/p-068e874b.entry.js +0 -1
- package/dist/ripple/p-0f4a6a8f.entry.js +0 -1
- package/dist/ripple/p-199f825e.js +0 -1
- package/dist/ripple/p-1cee0339.entry.js +0 -1
- package/dist/ripple/p-262c75ff.entry.js +0 -1
- package/dist/ripple/p-321daa60.entry.js +0 -1
- package/dist/ripple/p-416944fd.entry.js +0 -1
- package/dist/ripple/p-425ef815.entry.js +0 -1
- package/dist/ripple/p-4296b0ba.entry.js +0 -1
- package/dist/ripple/p-43b09b72.entry.js +0 -1
- package/dist/ripple/p-57c94258.entry.js +0 -1
- package/dist/ripple/p-6220c94d.entry.js +0 -1
- package/dist/ripple/p-6dbc79be.entry.js +0 -1
- package/dist/ripple/p-789e0afa.entry.js +0 -1
- package/dist/ripple/p-962f51ff.entry.js +0 -1
- package/dist/ripple/p-98c9b376.entry.js +0 -1
- package/dist/ripple/p-9d069ec5.entry.js +0 -1
- package/dist/ripple/p-9ec9ba5b.entry.js +0 -1
- package/dist/ripple/p-aacdaa79.entry.js +0 -1
- package/dist/ripple/p-b0536ddb.entry.js +0 -1
- package/dist/ripple/p-b1928a70.js +0 -1
- package/dist/ripple/p-b9d5b407.entry.js +0 -1
- package/dist/ripple/p-c0ab18ce.entry.js +0 -1
- package/dist/ripple/p-c2abdcba.js +0 -1
- package/dist/ripple/p-d2996c45.entry.js +0 -1
- package/dist/ripple/p-d9b98c9d.entry.js +0 -1
- package/dist/ripple/p-dee93986.entry.js +0 -1
- package/dist/ripple/p-e4e70417.entry.js +0 -1
- package/dist/ripple/p-fa8569d2.system.js +0 -1
|
@@ -2,617 +2,641 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const functions = require('./functions-
|
|
5
|
+
const index = require('./index-acad7ab3.js');
|
|
6
|
+
const functions = require('./functions-1a67b971.js');
|
|
7
7
|
|
|
8
8
|
const wmUploaderCss = ":host .wm-button,wm-uploader .wm-button{-ms-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-moz-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:inherit;border:2px solid #575195;color:#575195;font-family:inherit;font-size:0.75rem;font-weight:700;height:2.75rem;padding:0 1.3333333333em;cursor:pointer;position:relative;background:#fff;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-decoration:none;text-transform:uppercase;letter-spacing:0.01875rem;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button,wm-uploader .wm-button{height:3.3333333333em}}:host .wm-button.nowrap,wm-uploader .wm-button.nowrap{display:inline-block;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host .wm-button:focus,wm-uploader .wm-button:focus{outline:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}:host .wm-button::-moz-focus-inner,wm-uploader .wm-button::-moz-focus-inner{border:0;outline:none}:host .wm-button.user-is-tabbing:focus:not(:disabled):not(.disabled) :host .wm-button.-textonly .button-text,wm-uploader .wm-button.user-is-tabbing:focus:not(:disabled):not(.disabled) :host .wm-button.-textonly .button-text,:host .wm-button.user-is-tabbing:focus:not(:disabled):not(.disabled) wm-uploader .wm-button.-textonly .button-text,wm-uploader .wm-button.user-is-tabbing:focus:not(:disabled):not(.disabled) wm-uploader .wm-button.-textonly .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, #3862e9), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, #3862e9 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled),wm-uploader .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled){-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark),wm-uploader .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark){-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark)::-moz-focus-inner,wm-uploader .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark)::-moz-focus-inner{border:0}:host .wm-button.dark:not(.-textonly):not(:disabled):not(.disabled),wm-uploader .wm-button.dark:not(.-textonly):not(:disabled):not(.disabled){background:transparent;border:2px solid #fff;color:#fff}:host .wm-button.dark:not(.-textonly):not(:disabled):not(.disabled):hover,wm-uploader .wm-button.dark:not(.-textonly):not(:disabled):not(.disabled):hover{color:#575195;background:#e6e6e6;border:2px solid #e6e6e6}:host .wm-button.dark.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled).dark,wm-uploader .wm-button.dark.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled).dark{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #c6b4e3;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #c6b4e3;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #c6b4e3;outline:none}:host .wm-button:active:not(:disabled):not(.disabled):not(.-textonly):not(.-actionbutton):not(.displayedoption),wm-uploader .wm-button:active:not(:disabled):not(.disabled):not(.-textonly):not(.-actionbutton):not(.displayedoption){-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}:host .wm-button .mdi,wm-uploader .wm-button .mdi{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button:not(.-icononly):not(.-navigational) .mdi,wm-uploader .wm-button:not(.-icononly):not(.-navigational) .mdi{margin-right:0.3125rem}:host .wm-button[dir=RTL] :not(.-icononly) .mdi,wm-uploader .wm-button[dir=RTL] :not(.-icononly) .mdi{margin-left:0.3125rem;margin-right:0}:host .wm-button.-primary:not(.-textonly),wm-uploader .wm-button.-primary:not(.-textonly){background:#575195;color:#fff}:host .wm-button.-primary:not(.-textonly):not(:focus),wm-uploader .wm-button.-primary:not(.-textonly):not(:focus){-webkit-box-shadow:0 2px 2px 0 rgba(87, 81, 149, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 2px 2px 0 rgba(87, 81, 149, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.2);box-shadow:0 2px 2px 0 rgba(87, 81, 149, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.2)}:host .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled){background:#464177}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled),wm-uploader .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled){color:#575195;background:#fff;border:2px solid #fff}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled):hover,wm-uploader .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled):hover{color:#575195;background:#e6e6e6;border:2px solid #e6e6e6}:host .wm-button.-secondary:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-secondary:hover:not(:disabled):not(.disabled),:host .wm-button.-icononly:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-icononly:hover:not(:disabled):not(.disabled){background:#464177;color:#fff}:host .wm-button.-textonly,wm-uploader .wm-button.-textonly{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:inline-block;letter-spacing:0;text-transform:none;text-align:initial;font-size:0.875rem;border:none;background:transparent;padding-left:0;padding-right:0;height:auto;border-radius:0;line-height:1}:host .wm-button.-textonly+.-textonly,wm-uploader .wm-button.-textonly+.-textonly{margin-left:0.3125rem}:host .wm-button.-textonly:focus,wm-uploader .wm-button.-textonly:focus{outline:none}:host .wm-button.-textonly::-moz-focus-inner,wm-uploader .wm-button.-textonly::-moz-focus-inner{border:0;outline:none}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled) .button-text,wm-uploader .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled) .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, #3862e9), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, #3862e9 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled).dark .button-text,wm-uploader .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled).dark .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, #fff), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, #fff 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.small,wm-uploader .wm-button.-textonly.small{font-size:0.625rem}:host .wm-button.-textonly:hover:not(:disabled):not(.disabled):not(.-permanentlydelete),wm-uploader .wm-button.-textonly:hover:not(:disabled):not(.disabled):not(.-permanentlydelete){text-decoration:underline}:host .wm-button.-textonly.-permanentlydelete,wm-uploader .wm-button.-textonly.-permanentlydelete{color:#c0392b}:host .wm-button.-textonly.-permanentlydelete:hover:not(:disabled):not(.disabled):not(.dark),wm-uploader .wm-button.-textonly.-permanentlydelete:hover:not(:disabled):not(.disabled):not(.dark){text-decoration:underline;color:#c0392b !important}:host .wm-button.-textonly.dark,wm-uploader .wm-button.-textonly.dark{color:#fff}:host .wm-button.-textonly.dark:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-textonly.dark:hover:not(:disabled):not(.disabled){text-decoration:underline;color:#fff !important}:host .wm-button.-icononly,wm-uploader .wm-button.-icononly,:host .wm-button.-navigational,wm-uploader .wm-button.-navigational{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}:host .wm-button.-icononly:not(:focus),wm-uploader .wm-button.-icononly:not(:focus),:host .wm-button.-navigational:not(:focus),wm-uploader .wm-button.-navigational:not(:focus){-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button.-icononly,wm-uploader .wm-button.-icononly,:host .wm-button.-navigational,wm-uploader .wm-button.-navigational{min-width:2.5rem;min-height:2.5rem}}:host .wm-button.-icononly,wm-uploader .wm-button.-icononly{border-width:1px !important}:host .wm-button.-icononly:before,wm-uploader .wm-button.-icononly:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-navigational,wm-uploader .wm-button.-navigational{border:none !important;background-color:transparent}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled),wm-uploader .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled){color:#575195}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled):hover,wm-uploader .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled):hover,:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled).selected,wm-uploader .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled).selected{background-color:#d7d6d9}:host .wm-button.-navigational:before,wm-uploader .wm-button.-navigational:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-permanentlydelete:not(.-textonly),wm-uploader .wm-button.-permanentlydelete:not(.-textonly){background:#c0392b;border-color:#c0392b;color:#fff}:host .wm-button.-permanentlydelete:not(.-textonly):hover:not(:disabled):not(.disabled):not(.dark),wm-uploader .wm-button.-permanentlydelete:not(.-textonly):hover:not(:disabled):not(.disabled):not(.dark){background:#9a2e22;border-color:#9a2e22}:host .wm-button.-pairnegative,wm-uploader .wm-button.-pairnegative{background:#cc4c3e;border-color:#cc4c3e;color:#fff}:host .wm-button.-pairnegative:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-pairnegative:hover:not(:disabled):not(.disabled){background:#a33d32;border-color:#a33d32}:host .wm-button.-pairpositive,wm-uploader .wm-button.-pairpositive{background:#15868d;border-color:#15868d;color:#fff}:host .wm-button.-pairpositive:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-pairpositive:hover:not(:disabled):not(.disabled){background:#116b71;border-color:#116b71}:host .wm-button.-selectoronly,wm-uploader .wm-button.-selectoronly{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:block;background:transparent;border:1px solid #575195;border-radius:3px 3px 3px 3px;height:2.75rem;min-width:11.4375rem;padding:0 1.875rem 0 0.9375rem;line-height:normal;font-family:inherit;color:#575195;font-weight:500;font-size:0.875rem;text-transform:none;letter-spacing:0.01875rem;text-align:left}@media screen and (min-width: 48rem){:host .wm-button.-selectoronly,wm-uploader .wm-button.-selectoronly{height:2.5rem}}:host .wm-button.-selectoronly:before,wm-uploader .wm-button.-selectoronly:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f140\";position:absolute;right:0.5625rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);pointer-events:none}:host .wm-button.-selectoronly:hover:not(:disabled):not(.disabled),wm-uploader .wm-button.-selectoronly:hover:not(:disabled):not(.disabled){background:transparent;text-decoration:none}:host .wm-button.-selectoronly:active,wm-uploader .wm-button.-selectoronly:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}:host .wm-button.-selectoronly::-moz-focus-inner,wm-uploader .wm-button.-selectoronly::-moz-focus-inner{border:0}:host .wm-button.-selectoronly .overflowcontrol,wm-uploader .wm-button.-selectoronly .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:visible}:host .wm-button:disabled,wm-uploader .wm-button:disabled,:host .wm-button.disabled,wm-uploader .wm-button.disabled{background:inherit;border-color:#737373;color:#737373;cursor:default;pointer-events:none}:host .wm-button:disabled.-primary,wm-uploader .wm-button:disabled.-primary,:host .wm-button:disabled.-permanentlydelete,wm-uploader .wm-button:disabled.-permanentlydelete,:host .wm-button:disabled.-pairnegative,wm-uploader .wm-button:disabled.-pairnegative,:host .wm-button:disabled.-pairpositive,wm-uploader .wm-button:disabled.-pairpositive,:host .wm-button.disabled.-primary,wm-uploader .wm-button.disabled.-primary,:host .wm-button.disabled.-permanentlydelete,wm-uploader .wm-button.disabled.-permanentlydelete,:host .wm-button.disabled.-pairnegative,wm-uploader .wm-button.disabled.-pairnegative,:host .wm-button.disabled.-pairpositive,wm-uploader .wm-button.disabled.-pairpositive{background:#737373;color:#fff;border-color:#737373}:host .wm-button:disabled.-secondary,wm-uploader .wm-button:disabled.-secondary,:host .wm-button.disabled.-secondary,wm-uploader .wm-button.disabled.-secondary{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}:host .wm-button:disabled.-selectoronly,wm-uploader .wm-button:disabled.-selectoronly,:host .wm-button.disabled.-selectoronly,wm-uploader .wm-button.disabled.-selectoronly{color:#737373}:host .wm-button:disabled.-textonly,wm-uploader .wm-button:disabled.-textonly,:host .wm-button.disabled.-textonly,wm-uploader .wm-button.disabled.-textonly{color:#6b6b6b;background:transparent}:host .wm-button:disabled.dark.-secondary:not(.-permanentlydelete),wm-uploader .wm-button:disabled.dark.-secondary:not(.-permanentlydelete),:host .wm-button:disabled.dark.-textonly,wm-uploader .wm-button:disabled.dark.-textonly,:host .wm-button:disabled.dark.-navigational,wm-uploader .wm-button:disabled.dark.-navigational,:host .wm-button:disabled.dark.-icononly,wm-uploader .wm-button:disabled.dark.-icononly,:host .wm-button.disabled.dark.-secondary:not(.-permanentlydelete),wm-uploader .wm-button.disabled.dark.-secondary:not(.-permanentlydelete),:host .wm-button.disabled.dark.-textonly,wm-uploader .wm-button.disabled.dark.-textonly,:host .wm-button.disabled.dark.-navigational,wm-uploader .wm-button.disabled.dark.-navigational,:host .wm-button.disabled.dark.-icononly,wm-uploader .wm-button.disabled.dark.-icononly{color:#b5b5b5;border-color:#b5b5b5}:host .wm-button:disabled.dark.-primary,wm-uploader .wm-button:disabled.dark.-primary,:host .wm-button:disabled.dark.-permanentlydelete:not(.-textonly),wm-uploader .wm-button:disabled.dark.-permanentlydelete:not(.-textonly),:host .wm-button.disabled.dark.-primary,wm-uploader .wm-button.disabled.dark.-primary,:host .wm-button.disabled.dark.-permanentlydelete:not(.-textonly),wm-uploader .wm-button.disabled.dark.-permanentlydelete:not(.-textonly){background:#a6a6a6;border-color:#a6a6a6;color:#353b48}:host a.wm-button,wm-uploader a.wm-button,:host label.wm-button,wm-uploader label.wm-button{height:auto;padding-top:0.75rem;padding-bottom:0.75rem}:host,wm-uploader{width:100%;height:100%;display:block;position:relative;max-width:1140px}:host[dir=RTL] .mdi,wm-uploader[dir=RTL] .mdi{margin-left:0.3125rem;margin-right:0}:host input:focus+.wm-button.user-is-tabbing,wm-uploader input:focus+.wm-button.user-is-tabbing{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e !important;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e !important;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px #61279e !important}:host *,wm-uploader *{-webkit-box-sizing:border-box;box-sizing:border-box}.wm-button.disabled{pointer-events:initial !important}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.header{margin-bottom:2.5rem}.header.type1,.header.type2{margin-bottom:1rem}.header .slot-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:start;align-items:flex-start}.header .info-wrapper{-ms-flex-align:center;align-items:center}.header .info-wrapper .info{font-size:0.875rem;margin-left:1rem}.header .accepted-types{font-size:0.875rem}.header .requirements{font-size:0.875rem;margin-left:1rem}.footer{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;padding:0.9375rem 1.875rem}.footer .notif-wrapper{-ms-flex-align:end;align-items:flex-end}.footer .filecount-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.footer .filecount-wrapper .filecount{font-size:0.875rem;margin-right:1rem}.notif-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin-bottom:0.75rem}.notif-wrapper.type1,.notif-wrapper.type2{-ms-flex-direction:column;flex-direction:column;margin-bottom:1rem}.notif-wrapper .requirements{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.notif{padding-top:0.25rem;font-size:0.875rem;font-style:italic;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.info-wrapper{position:relative;display:-ms-flexbox;display:flex}.name-wrapper{overflow:hidden}.name-wrapper+.file-controls{-ms-flex:none;flex:none;margin-left:1rem}.empty-block{margin:5rem auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.empty-block .upload-file{margin-bottom:1.875rem}.empty-block .empty-message{font-size:0.875rem;margin-bottom:0.4375rem}.empty-block .empty-message.large{font-size:1.5rem}.empty-block .info-wrapper{-ms-flex-pack:center;justify-content:center;width:100%}.empty-block .info-wrapper .wm-button{width:auto}.list-container{overflow-y:unset}.list-container.checkmark-spacer{margin-right:2.75rem}.list-container.type1,.list-container.type2{overflow-y:auto}.list-container.type1 ul,.list-container.type2 ul{margin:revert}.list-container.type1 .file-list li,.list-container.type1 .inprogress-list li,.list-container.type2 .file-list li,.list-container.type2 .inprogress-list li{margin-bottom:1.625rem}.list-container.type1 .error-list li,.list-container.type2 .error-list li{margin-bottom:1.25rem}.list-container.type1{padding:0 1.875rem;height:16.25rem}ul{list-style:none;padding:0;width:100%;margin:0}ul li{position:relative;font-size:0.875rem;margin-bottom:0.5rem}ul li .file{min-width:300px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:relative;height:3.5rem;padding:0.5rem 1.25rem;background:#f4f4f4;border:1px solid #6b6b6b;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}ul li .file+.file{margin-top:1.25rem}ul li .file .filename{font-weight:500;white-space:nowrap}ul li .file .left-group{overflow:hidden}ul li .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:5rem}ul li .file .right-group .file-controls{display:-ms-flexbox;display:flex}ul li .file .right-group .file-info{white-space:nowrap;margin-right:1rem}ul li .file wm-button+wm-button{margin-left:1rem}ul li.condensed .right-group{padding-left:2.5rem}ul li.checked .file:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f133\";position:absolute;right:-44px;color:#088000;font-size:28px;line-height:1}ul .progress{position:absolute;left:0;top:0;right:0;height:8px}ul.file-list li,ul.inprogress-list li{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}ul.file-list li .file,ul.inprogress-list li .file{-ms-flex:1;flex:1}ul.error-list li{margin-bottom:0.5rem;color:#c0392b}ul.error-list li .file{border:1px solid #c0392b;background-color:#f5ebea;height:3.75rem}ul.error-list li .error-message{padding-top:0.25rem;font-style:italic}.ch-measure{width:1ch !important}";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.wmUploaderFilesSelected = index.createEvent(this, "wmUploaderFilesSelected", 7);
|
|
14
|
-
this.wmFilesSelected = index.createEvent(this, "wmFilesSelected", 7);
|
|
15
|
-
this.wmUploaderDeleteFile = index.createEvent(this, "wmUploaderDeleteFile", 7);
|
|
16
|
-
this.wmDeleteFile = index.createEvent(this, "wmDeleteFile", 7);
|
|
17
|
-
this.wmUploaderDownloadFile = index.createEvent(this, "wmUploaderDownloadFile", 7);
|
|
18
|
-
this.wmDownloadFile = index.createEvent(this, "wmDownloadFile", 7);
|
|
19
|
-
this.wmUploaderPreviewFile = index.createEvent(this, "wmUploaderPreviewFile", 7);
|
|
20
|
-
this.fileTypes = "pdf txt log xml doc docx xls xlsx ppt pptx gif jpg jpeg png csv";
|
|
21
|
-
this.defaultMaxSize = 100;
|
|
22
|
-
this.maxSize = this.defaultMaxSize; // in Mb
|
|
23
|
-
this.sortBy = "date"; // name is descending (a -> z), date is ascending (earlier -> later)
|
|
24
|
-
this.showInfo = "time";
|
|
25
|
-
this.fileList = []; // the string above transformed into the actual array
|
|
26
|
-
this.filesToUpload = []; // input.files that passed validation
|
|
27
|
-
this.isTabbing = false;
|
|
28
|
-
this.errorList = []; // for errors on a particular file
|
|
29
|
-
this.isCondensed = false;
|
|
30
|
-
this.inputId = functions.generateId();
|
|
31
|
-
this.debouncedResize = functions.debounce(() => {
|
|
32
|
-
this.isCondensed = this.el.clientWidth < 500;
|
|
33
|
-
// rerender to show filename truncation changes
|
|
34
|
-
index.forceUpdate(this.el);
|
|
35
|
-
}, 50);
|
|
36
|
-
}
|
|
37
|
-
get tooltipEl() {
|
|
38
|
-
return document.getElementById("wm-tooltip");
|
|
39
|
-
}
|
|
40
|
-
get
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return this.
|
|
46
|
-
}
|
|
47
|
-
get
|
|
48
|
-
return this.
|
|
49
|
-
}
|
|
50
|
-
get
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
amount:
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
//
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
this.
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
this.
|
|
387
|
-
this.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
this.
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
return (index.h("
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
const
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
,
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
"
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
};
|
|
10
|
+
let Uploader = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.wmUploaderFilesSelected = index.createEvent(this, "wmUploaderFilesSelected", 7);
|
|
14
|
+
this.wmFilesSelected = index.createEvent(this, "wmFilesSelected", 7);
|
|
15
|
+
this.wmUploaderDeleteFile = index.createEvent(this, "wmUploaderDeleteFile", 7);
|
|
16
|
+
this.wmDeleteFile = index.createEvent(this, "wmDeleteFile", 7);
|
|
17
|
+
this.wmUploaderDownloadFile = index.createEvent(this, "wmUploaderDownloadFile", 7);
|
|
18
|
+
this.wmDownloadFile = index.createEvent(this, "wmDownloadFile", 7);
|
|
19
|
+
this.wmUploaderPreviewFile = index.createEvent(this, "wmUploaderPreviewFile", 7);
|
|
20
|
+
this.fileTypes = "pdf txt log xml doc docx xls xlsx ppt pptx gif jpg jpeg png csv";
|
|
21
|
+
this.defaultMaxSize = 100;
|
|
22
|
+
this.maxSize = this.defaultMaxSize; // in Mb
|
|
23
|
+
this.sortBy = "date"; // name is descending (a -> z), date is ascending (earlier -> later)
|
|
24
|
+
this.showInfo = "time";
|
|
25
|
+
this.fileList = []; // the string above transformed into the actual array
|
|
26
|
+
this.filesToUpload = []; // input.files that passed validation
|
|
27
|
+
this.isTabbing = false;
|
|
28
|
+
this.errorList = []; // for errors on a particular file
|
|
29
|
+
this.isCondensed = false;
|
|
30
|
+
this.inputId = functions.generateId();
|
|
31
|
+
this.debouncedResize = functions.debounce(() => {
|
|
32
|
+
this.isCondensed = this.el.clientWidth < 500;
|
|
33
|
+
// rerender to show filename truncation changes
|
|
34
|
+
index.forceUpdate(this.el);
|
|
35
|
+
}, 50);
|
|
36
|
+
}
|
|
37
|
+
get tooltipEl() {
|
|
38
|
+
return document.getElementById("wm-tooltip");
|
|
39
|
+
}
|
|
40
|
+
get uploadButtonEl() {
|
|
41
|
+
return this.el.shadowRoot.querySelector(`#${this.inputId}`);
|
|
42
|
+
}
|
|
43
|
+
get tempUploaderType() {
|
|
44
|
+
// replace instances of this.tempUploaderType with this.uploaderType once type is fully phased out
|
|
45
|
+
return this.type || this.uploaderType;
|
|
46
|
+
}
|
|
47
|
+
get chMeasure() {
|
|
48
|
+
return this.el.shadowRoot.querySelector(".ch-measure").clientWidth;
|
|
49
|
+
}
|
|
50
|
+
get fileLimitReached() {
|
|
51
|
+
return this.maxFiles && this.fileList.length >= this.maxFiles;
|
|
52
|
+
}
|
|
53
|
+
get fileUploadLimitMessage() {
|
|
54
|
+
return functions.intl.formatMessage({
|
|
55
|
+
id: "uploader.fileUploadLimit",
|
|
56
|
+
defaultMessage: "Maximum number of files reached",
|
|
57
|
+
description: "Message displayed when reaching the file upload limit",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
get fileCountMessage() {
|
|
61
|
+
return this.fileLimitReached
|
|
62
|
+
? this.fileUploadLimitMessage
|
|
63
|
+
: functions.intl.formatMessage({
|
|
64
|
+
id: "uploader.fileCount",
|
|
65
|
+
defaultMessage: "{x} of {y} Files",
|
|
66
|
+
description: "A count of the number of files currently uploaded",
|
|
67
|
+
}, { x: this.fileList.length, y: this.maxFiles });
|
|
68
|
+
}
|
|
69
|
+
get maxSizeMessage() {
|
|
70
|
+
return functions.intl.formatMessage({
|
|
71
|
+
id: "uploader.maxSize",
|
|
72
|
+
defaultMessage: "Maximum file size {maxSize}MB",
|
|
73
|
+
description: "An indicator of the maximum file size the uploader allows",
|
|
74
|
+
}, {
|
|
75
|
+
maxSize: this.maxSize,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
get acceptedFileTypesMessage() {
|
|
79
|
+
const validTypes = "." + this.fileTypes.split(" ").join(", .");
|
|
80
|
+
return functions.intl.formatMessage({
|
|
81
|
+
id: "uploader.acceptedFileTypes",
|
|
82
|
+
defaultMessage: "Accepted file {amount, plural, =1 {type} other {types}}: {fileTypes}",
|
|
83
|
+
}, {
|
|
84
|
+
fileTypes: validTypes,
|
|
85
|
+
amount: this.fileTypes.split(" ").length,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
get previewActionMessage() {
|
|
89
|
+
return functions.intl.formatMessage({
|
|
90
|
+
id: "uploader.previewAction",
|
|
91
|
+
defaultMessage: "Preview File",
|
|
92
|
+
description: "Label of a button that triggers a file to be previewed",
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
get downloadActionMessage() {
|
|
96
|
+
return functions.intl.formatMessage({
|
|
97
|
+
id: "uploader.downloadAction",
|
|
98
|
+
defaultMessage: "Download File",
|
|
99
|
+
description: "Label of a button that triggers a file to be downloaded",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
get deleteActionMessage() {
|
|
103
|
+
return functions.intl.formatMessage({
|
|
104
|
+
id: "uploader.deleteAction",
|
|
105
|
+
defaultMessage: "Delete File",
|
|
106
|
+
description: "Label of a button that triggers a file to be delete",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
get clearButtonText() {
|
|
110
|
+
return functions.intl.formatMessage({
|
|
111
|
+
id: "uploader.clearErrorText",
|
|
112
|
+
defaultMessage: "Clear",
|
|
113
|
+
description: "Text for a button used to clear an error",
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
get actionMenuLabel() {
|
|
117
|
+
return functions.intl.formatMessage({
|
|
118
|
+
id: "uploader.actionMenuLabel",
|
|
119
|
+
defaultMessage: "Actions",
|
|
120
|
+
description: "Label of a button that opens a menu of file actions",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
toggleTabbingOn() {
|
|
124
|
+
this.isTabbing = true;
|
|
125
|
+
}
|
|
126
|
+
toggleTabbingOff() {
|
|
127
|
+
this.isTabbing = false;
|
|
128
|
+
}
|
|
129
|
+
handleUploadProgress(ev) {
|
|
130
|
+
this.fileList.map((i) => {
|
|
131
|
+
if (i.id === ev.detail.id) {
|
|
132
|
+
i.progress = ev.detail.progress;
|
|
133
|
+
index.forceUpdate(this.el);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
if (ev.detail.progress === 100) {
|
|
137
|
+
// inProgressList is not a perfect reflection of how many files are uploading
|
|
138
|
+
// because even after progress reached 100% the item should remain in the array
|
|
139
|
+
// (should only be removed once it appears in fileList)
|
|
140
|
+
this.numFilesInProgress -= 1;
|
|
141
|
+
}
|
|
142
|
+
// aggregate the percentages for SR to announce progress
|
|
143
|
+
if (!this.srProgress && this.numFilesInProgress) {
|
|
144
|
+
const total = this.numFilesInProgress; // if we don't reassign this number changes when a file is done and the percentage becomes wrong
|
|
145
|
+
this.srProgress = setInterval(() => {
|
|
146
|
+
const aggregate = this.fileList.reduce((avg, item) => (item.progress ? avg + item.progress : avg), 0);
|
|
147
|
+
if (this.liveRegion) {
|
|
148
|
+
this.liveRegion.innerHTML = functions.intl.formatMessage({
|
|
149
|
+
id: "uploader.uploadProgress",
|
|
150
|
+
defaultMessage: "Upload progress: {percentage}%",
|
|
151
|
+
}, { percentage: Math.floor(aggregate / total) });
|
|
152
|
+
}
|
|
153
|
+
}, 5000);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
parseFiles() {
|
|
157
|
+
if (!!this.files) {
|
|
158
|
+
if (typeof this.files === "string") {
|
|
159
|
+
const list = JSON.parse(this.files);
|
|
160
|
+
if (typeof list === "object") {
|
|
161
|
+
this.fileList = list;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
throw new Error("could not parse string passed to files attribute");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
throw new Error("Attribute 'files' should be a string");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
parseRejectedFiles() {
|
|
173
|
+
if (!!this.rejectedFiles) {
|
|
174
|
+
if (typeof this.files === "string") {
|
|
175
|
+
const list = JSON.parse(this.rejectedFiles);
|
|
176
|
+
if (typeof list === "object") {
|
|
177
|
+
this.errorList = list;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
throw new Error("could not parse string passed to errors attribute");
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
throw new Error("Attribute 'rejected-files' should be a string");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
setMaxSize() {
|
|
189
|
+
// Max size can't be set above 100Mb
|
|
190
|
+
this.maxSize = this.maxSize > this.defaultMaxSize ? this.defaultMaxSize : this.maxSize;
|
|
191
|
+
}
|
|
192
|
+
uploadNotifications(newNum, oldNum) {
|
|
193
|
+
if (oldNum > 0 && newNum === 0) {
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
this.notif = null;
|
|
196
|
+
}, 20 * 1000);
|
|
197
|
+
const message = functions.intl.formatMessage({
|
|
198
|
+
id: "uploader.finishedUploading",
|
|
199
|
+
defaultMessage: "Finished uploading",
|
|
200
|
+
});
|
|
201
|
+
this.notif = { id: 5, message };
|
|
202
|
+
if (this.liveRegion) {
|
|
203
|
+
this.liveRegion.innerHTML = message;
|
|
204
|
+
}
|
|
205
|
+
this.numFilesInProgress = null;
|
|
206
|
+
clearInterval(this.srProgress);
|
|
207
|
+
index.forceUpdate(this.el);
|
|
208
|
+
}
|
|
209
|
+
else if (newNum > 0 && newNum != oldNum) {
|
|
210
|
+
const message = functions.intl.formatMessage({
|
|
211
|
+
id: "uploader.filesUploading",
|
|
212
|
+
defaultMessage: "{num, plural, one {1 file uploading} other {# files uploading}}",
|
|
213
|
+
}, { num: newNum });
|
|
214
|
+
this.notif = { id: 6, message };
|
|
215
|
+
if (this.liveRegion) {
|
|
216
|
+
this.liveRegion.innerHTML = message;
|
|
217
|
+
}
|
|
218
|
+
index.forceUpdate(this.el);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
isValidSize(size) {
|
|
222
|
+
return this.convertBytes(size, "MB").size <= this.maxSize;
|
|
223
|
+
}
|
|
224
|
+
convertBytes(bytes, unit) {
|
|
225
|
+
// https://stackoverflow.com/questions/2365100/converting-bytes-to-megabytes
|
|
226
|
+
const unitOrder = ["bytes", "KB", "MB", "GB", "TB"];
|
|
227
|
+
let unitIndex = 0;
|
|
228
|
+
let result = bytes;
|
|
229
|
+
if (unit) {
|
|
230
|
+
// convert until result matches desired unit
|
|
231
|
+
while (unitOrder.indexOf(unit) > unitIndex) {
|
|
232
|
+
result /= 1024;
|
|
233
|
+
unitIndex++;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
// convert until result is appropriate unit (value is under 1000)
|
|
238
|
+
while (result > 1000) {
|
|
239
|
+
result /= 1024;
|
|
240
|
+
unitIndex++;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return { size: result, unit: unitOrder[unitIndex] };
|
|
244
|
+
}
|
|
245
|
+
isDuplicate(name) {
|
|
246
|
+
return this.fileList.find((f) => {
|
|
247
|
+
const filename = f.type ? f.name + "." + f.type : f.name;
|
|
248
|
+
return filename === name;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
isEmpty() {
|
|
252
|
+
return !this.fileList.length && !this.errorList.length;
|
|
253
|
+
}
|
|
254
|
+
get isDisabled() {
|
|
255
|
+
if (!this.notif) {
|
|
256
|
+
if (this.fileLimitReached) {
|
|
257
|
+
const errMessage = this.fileUploadLimitMessage;
|
|
258
|
+
this.notif = { id: 1, message: errMessage };
|
|
259
|
+
if (this.liveRegion) {
|
|
260
|
+
this.liveRegion.innerHTML = errMessage;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
this.notif = null;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else if (this.notif.id === 1) {
|
|
268
|
+
// to make sure SR don't repeat the error, don't reset it if it already is showing
|
|
269
|
+
// just dismiss it if isMax is not true anymore
|
|
270
|
+
if (!this.fileLimitReached) {
|
|
271
|
+
this.notif = null;
|
|
272
|
+
}
|
|
273
|
+
// finally do nothing if error 2 is showing (special case when user selects too many files)
|
|
274
|
+
}
|
|
275
|
+
// disable if is the uploader is maxed out or if something is uploading
|
|
276
|
+
return this.fileLimitReached || this.numFilesInProgress > 0;
|
|
277
|
+
}
|
|
278
|
+
isItemUploading(item) {
|
|
279
|
+
return item.hasOwnProperty("progress") && item.progress < 100;
|
|
280
|
+
}
|
|
281
|
+
clearError(filename) {
|
|
282
|
+
this.errorList = this.errorList.filter((error) => error.name != filename);
|
|
283
|
+
this.notif = null;
|
|
284
|
+
}
|
|
285
|
+
clearErrors() {
|
|
286
|
+
this.errorList = [];
|
|
287
|
+
this.notif = null;
|
|
288
|
+
}
|
|
289
|
+
handleFiles(ev) {
|
|
290
|
+
this.filesToUpload = [];
|
|
291
|
+
const validTypes = this.fileTypes.split(" ").join(", ");
|
|
292
|
+
const files = Array.from(ev.target.files);
|
|
293
|
+
if (!!this.maxFiles && this.fileList.length + files.length > this.maxFiles) {
|
|
294
|
+
const errMessage = functions.intl.formatMessage({
|
|
295
|
+
id: "uploader.fileUploadExceeded",
|
|
296
|
+
defaultMessage: "The number of selected files exceeds the limit.",
|
|
297
|
+
});
|
|
298
|
+
this.notif = { id: 2, message: errMessage };
|
|
299
|
+
if (this.liveRegion) {
|
|
300
|
+
this.liveRegion.innerHTML = errMessage;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
files &&
|
|
305
|
+
files.map((file) => {
|
|
306
|
+
if (!functions.hasValidType(file, this.fileTypes)) {
|
|
307
|
+
const error = {
|
|
308
|
+
name: file.name,
|
|
309
|
+
message: functions.intl.formatMessage({
|
|
310
|
+
id: "uploader.invalidFileType",
|
|
311
|
+
defaultMessage: "The file type is invalid. Accepted types: {validTypes}",
|
|
312
|
+
}, { validTypes }),
|
|
313
|
+
};
|
|
314
|
+
this.errorList.push(error);
|
|
315
|
+
}
|
|
316
|
+
else if (file.size === 0) {
|
|
317
|
+
const error = {
|
|
318
|
+
name: file.name,
|
|
319
|
+
message: functions.intl.formatMessage({
|
|
320
|
+
id: "uploader.zeroFileSize",
|
|
321
|
+
defaultMessage: "The file must be more than 0 bytes",
|
|
322
|
+
description: "Error message when user attempts to upload a file of no size",
|
|
323
|
+
}),
|
|
324
|
+
};
|
|
325
|
+
this.errorList.push(error);
|
|
326
|
+
}
|
|
327
|
+
else if (!this.isValidSize(file.size)) {
|
|
328
|
+
const error = {
|
|
329
|
+
name: file.name,
|
|
330
|
+
message: functions.intl.formatMessage({
|
|
331
|
+
id: "uploader.fileTooLarge",
|
|
332
|
+
defaultMessage: "The selected file is too large. Maximum file size is {size}Mb",
|
|
333
|
+
}, { size: this.maxSize }),
|
|
334
|
+
};
|
|
335
|
+
this.errorList.push(error);
|
|
336
|
+
}
|
|
337
|
+
else if (this.isDuplicate(file.name)) {
|
|
338
|
+
const error = {
|
|
339
|
+
name: file.name,
|
|
340
|
+
message: functions.intl.formatMessage({
|
|
341
|
+
id: "uploader.duplicateName",
|
|
342
|
+
defaultMessage: "A file with this name already exists.",
|
|
343
|
+
}),
|
|
344
|
+
};
|
|
345
|
+
this.errorList.push(error);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
this.filesToUpload.push(file);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
if (this.filesToUpload.length > 0) {
|
|
352
|
+
this.numFilesInProgress = this.filesToUpload.length;
|
|
353
|
+
this.wmUploaderFilesSelected.emit(this.filesToUpload);
|
|
354
|
+
this.wmFilesSelected.emit(this.filesToUpload); // deprecated
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
ev.target.value = ""; // reset to ensure that onChange is triggered when the same file is selected a second time
|
|
358
|
+
}
|
|
359
|
+
previewFile(file) {
|
|
360
|
+
this.clearErrors();
|
|
361
|
+
this.wmUploaderPreviewFile.emit(file.id);
|
|
362
|
+
}
|
|
363
|
+
downloadFile(file) {
|
|
364
|
+
this.clearErrors();
|
|
365
|
+
this.wmUploaderDownloadFile.emit(file.id);
|
|
366
|
+
this.wmDownloadFile.emit(file.id); // deprecated
|
|
367
|
+
}
|
|
368
|
+
deleteFile(file) {
|
|
369
|
+
this.clearErrors();
|
|
370
|
+
index.forceUpdate(this.el); // for the button to stop being disabled if num files become < max-files
|
|
371
|
+
this.wmUploaderDeleteFile.emit(file.id);
|
|
372
|
+
this.wmDeleteFile.emit(file.id); // deprecated
|
|
373
|
+
}
|
|
374
|
+
componentWillLoad() {
|
|
375
|
+
if (!this.buttonText) {
|
|
376
|
+
throw new Error("wm-uploader: button-text is a required prop");
|
|
377
|
+
}
|
|
378
|
+
if (this.type) {
|
|
379
|
+
console.warn("wm-uploader: type has been deprecated as of v3.1.0. Please use uploader-type instead.");
|
|
380
|
+
}
|
|
381
|
+
if (this.tempUploaderType === "1" && !this.emptyStateText) {
|
|
382
|
+
throw new Error("wm-uploader: empty-state-text is a required prop");
|
|
383
|
+
}
|
|
384
|
+
// rerender on resize in case layout needs to change
|
|
385
|
+
const resizeObserver = new ResizeObserver(() => this.debouncedResize());
|
|
386
|
+
resizeObserver.observe(this.el);
|
|
387
|
+
this.setMaxSize();
|
|
388
|
+
this.parseFiles();
|
|
389
|
+
this.clearErrors();
|
|
390
|
+
this.parseRejectedFiles();
|
|
391
|
+
}
|
|
392
|
+
componentDidLoad() {
|
|
393
|
+
if (document.body.classList.contains("wmcl-user-is-tabbing")) {
|
|
394
|
+
this.toggleTabbingOn();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
showTooltip(anchorEl, tooltipText) {
|
|
398
|
+
this.tooltipEl.textContent = tooltipText;
|
|
399
|
+
this.positionTooltip("bottom", anchorEl, this.tooltipEl);
|
|
400
|
+
this.tooltipEl.style.transitionDelay = "500ms";
|
|
401
|
+
this.tooltipEl.style.opacity = "1";
|
|
402
|
+
}
|
|
403
|
+
hideTooltip() {
|
|
404
|
+
this.tooltipEl.style.transitionDelay = "0s";
|
|
405
|
+
this.tooltipEl.style.opacity = "0";
|
|
406
|
+
}
|
|
407
|
+
positionTooltip(tPos, anchorEl, tooltipEl) {
|
|
408
|
+
const tooltipHeight = tooltipEl.getBoundingClientRect().height;
|
|
409
|
+
const tooltipWidth = tooltipEl.getBoundingClientRect().width;
|
|
410
|
+
// to get the center positions, calculate the difference between the button width and the tooltip width
|
|
411
|
+
const verticalDiff = (anchorEl.getBoundingClientRect().height - tooltipHeight) / 2;
|
|
412
|
+
const horizontalDiff = (anchorEl.getBoundingClientRect().width - tooltipWidth) / 2;
|
|
413
|
+
// the naming convention defaults to center in the absence of a value
|
|
414
|
+
// "top" and "bottom" imply centering horizontally; "right" and "left" imply centering vertically
|
|
415
|
+
// therefore we first set to center and adjust accordingly
|
|
416
|
+
let verticalPos = anchorEl.getBoundingClientRect().top + verticalDiff;
|
|
417
|
+
let horizontalPos = anchorEl.getBoundingClientRect().left + horizontalDiff;
|
|
418
|
+
if (tPos.includes("top")) {
|
|
419
|
+
verticalPos = anchorEl.getBoundingClientRect().top - tooltipHeight - 8;
|
|
420
|
+
}
|
|
421
|
+
if (tPos.includes("bottom")) {
|
|
422
|
+
verticalPos = anchorEl.getBoundingClientRect().bottom + 8;
|
|
423
|
+
}
|
|
424
|
+
if (tPos.includes("left")) {
|
|
425
|
+
horizontalPos = anchorEl.getBoundingClientRect().left - tooltipWidth - 8;
|
|
426
|
+
}
|
|
427
|
+
if (tPos.includes("right")) {
|
|
428
|
+
horizontalPos = anchorEl.getBoundingClientRect().right + 8;
|
|
429
|
+
}
|
|
430
|
+
// after all positioning has been calculated, if tooltip is off-screen or closer than 24px it is readjusted
|
|
431
|
+
// this only occurs when the tooltip is overflowing to the left and is positioned top or bottom
|
|
432
|
+
// (button placed too far left, or screen size under 268px)
|
|
433
|
+
horizontalPos = Math.max(horizontalPos, 24);
|
|
434
|
+
tooltipEl.style.top = (verticalPos / 16).toString() + "rem";
|
|
435
|
+
tooltipEl.style.left = (horizontalPos / 16).toString() + "rem";
|
|
436
|
+
}
|
|
437
|
+
uploadButtonOnClick(ev) {
|
|
438
|
+
if (this.isDisabled) {
|
|
439
|
+
// this is a temporary fix.
|
|
440
|
+
// we need the disabled button to be programmatically focusable
|
|
441
|
+
// to allow return focus after closing the browser file panel
|
|
442
|
+
// since it's focusable the button should respond when activated
|
|
443
|
+
// it looks disabled, and announces the reason why the action cannot
|
|
444
|
+
// be taken when activated.
|
|
445
|
+
// this is not pretty duplicating a intl message + the logic of isDisabled,
|
|
446
|
+
// but not worth a bigger refactor since this is only until we get the UX for disabled elements and refactor all interactive els.
|
|
447
|
+
ev.preventDefault();
|
|
448
|
+
if (this.liveRegion) {
|
|
449
|
+
let errMsg = "";
|
|
450
|
+
if (this.numFilesInProgress > 0) {
|
|
451
|
+
errMsg = functions.intl.formatMessage({
|
|
452
|
+
id: "uploader.waitToUpload",
|
|
453
|
+
defaultMessage: "Please wait for current upload to complete before uploading new files.",
|
|
454
|
+
description: "Message for screen reader users",
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
else if (this.fileLimitReached) {
|
|
458
|
+
errMsg = this.fileUploadLimitMessage;
|
|
459
|
+
}
|
|
460
|
+
if (errMsg) {
|
|
461
|
+
// clear and set again to re-announce if button is clicked several times
|
|
462
|
+
// (can't be done inside setTimeout because of scope, hence the promise)
|
|
463
|
+
this.liveRegion.innerHTML = "";
|
|
464
|
+
new Promise((resolve) => {
|
|
465
|
+
setTimeout(() => {
|
|
466
|
+
resolve("");
|
|
467
|
+
}, 500);
|
|
468
|
+
}).then(() => (this.liveRegion.innerHTML = errMsg));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
this.clearErrors();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
renderUploadSvg() {
|
|
477
|
+
return (index.h("svg", { class: "upload-file", width: "91", height: "84", viewBox: "0 0 91 84" }, index.h("path", { transform: "rotate(-180.000000) translate(-452, -255.5)", fill: "#eae8ec", d: "M361,249.681818 L361,197.318182 C361,194.118182 365.555061,191.5 371.122358,191.5 L391.316463,191.5 L391.286495,200.562515 L369.871211,200.600292 L369.885404,200.622146 L369.886423,246.655947 L443.657038,246.840767 L443.657038,200.622146 L421.683537,200.622146 L421.683537,191.5 L441.978865,191.5 C447.546162,191.5 452,194.118182 452,197.318182 L452,249.681818 C452,252.881818 447.546162,255.5 441.978865,255.5 L371.122358,255.5 C365.504449,255.5 361,252.881818 361,249.681818 Z M391.5,207 L406,221 L420.5,207 L409.625,207 L409.625,172 L402.375,172 L402.375,207 L391.5,207 Z" })));
|
|
478
|
+
}
|
|
479
|
+
renderIcon() {
|
|
480
|
+
// mdi attachment icon (paper clip) is horizontal but we want it vertical
|
|
481
|
+
const rotate = this.icon && this.icon === "f066";
|
|
482
|
+
return (this.icon && (index.h("span", { class: `mdi ${rotate ? "rotate" : ""}` }, String.fromCodePoint(parseInt(`0x${this.icon}`)))));
|
|
483
|
+
}
|
|
484
|
+
renderInfo() {
|
|
485
|
+
return this.info && this.tempUploaderType === "2" ? index.h("span", { class: "info" }, this.info) : "";
|
|
486
|
+
}
|
|
487
|
+
renderNotif() {
|
|
488
|
+
return this.notif ? index.h("div", { class: "notif" }, this.notif.message) : "";
|
|
489
|
+
}
|
|
490
|
+
renderUploadButton(classes) {
|
|
491
|
+
return (index.h("div", { class: "info-wrapper" }, index.h("input", { name: this.inputId, id: this.inputId, class: "sr-only", "aria-describedby": "file-count max-size accepted-types", type: "file", multiple: true, onClick: (ev) => this.uploadButtonOnClick(ev), onChange: (ev) => this.handleFiles(ev) }), index.h("label", { htmlFor: this.inputId, class: `wm-button ${classes}${this.isTabbing ? " user-is-tabbing" : ""}` }, this.renderIcon(), this.buttonText), this.renderInfo()));
|
|
492
|
+
}
|
|
493
|
+
renderEmptyState() {
|
|
494
|
+
return (index.h("div", { class: "empty-block" }, this.renderUploadSvg(), index.h("div", { class: `empty-message` }, this.emptyStateText), this.renderUploadButton("-primary empty-button"), this.renderNotif()));
|
|
495
|
+
}
|
|
496
|
+
renderFileName(filename, isUploading) {
|
|
497
|
+
return (index.h("div", { class: "left-group" }, index.h("div", { class: "name-wrapper" }, index.h("span", { class: "filename", "data-filename": filename, onMouseEnter: (ev) => this.handleFilenameMouseEnter(ev, filename), onMouseLeave: () => this.hideTooltip() }), isUploading && index.h("span", { class: "sr-only" }, "uploading"), index.h("div", { class: "sr-only ch-measure" }))));
|
|
498
|
+
}
|
|
499
|
+
renderErrorList() {
|
|
500
|
+
if (!!this.errorList.length) {
|
|
501
|
+
if (this.liveRegion) {
|
|
502
|
+
let srMessage = this.errorList.reduce(function (acc, err) {
|
|
503
|
+
return acc + `${err.name}: ${err.message} `;
|
|
504
|
+
}, "");
|
|
505
|
+
this.liveRegion.innerHTML = srMessage;
|
|
506
|
+
}
|
|
507
|
+
return (index.h("ul", { class: "error-list" }, this.errorList.map((err) => {
|
|
508
|
+
const clearButtonLabel = functions.intl.formatMessage({
|
|
509
|
+
id: "uploader.clearErrorLabel",
|
|
510
|
+
defaultMessage: "Clear {fileName} error",
|
|
511
|
+
description: "Label for a button used to clear an error, including filename",
|
|
512
|
+
}, { fileName: err.name });
|
|
513
|
+
return (index.h("li", null, index.h("div", { class: "file --error" }, this.renderFileName(err.name, false), index.h("wm-button", { "permanently-delete": true, "button-type": "textonly", "label-for-identical-buttons": clearButtonLabel, onClick: () => {
|
|
514
|
+
this.clearError(err.name);
|
|
515
|
+
this.uploadButtonEl.focus();
|
|
516
|
+
} }, this.clearButtonText)), index.h("div", { class: "error-message" }, err.message)));
|
|
517
|
+
})));
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
renderFileInProgress(item) {
|
|
521
|
+
const filename = item.type ? `${item.name}.${item.type}` : item.name;
|
|
522
|
+
return (index.h("li", null, index.h("div", { class: "file --progress" }, index.h("div", { class: "progress", style: {
|
|
523
|
+
background: `linear-gradient(to right, rgba(67, 126, 142, 1) ${item.progress}%, transparent ${item.progress}%)`,
|
|
524
|
+
} }), this.renderFileName(filename, this.isItemUploading(item)))));
|
|
525
|
+
}
|
|
526
|
+
renderFile(item) {
|
|
527
|
+
const filename = item.type ? `${item.name}.${item.type}` : item.name;
|
|
528
|
+
const hasSingleFileAction = item.fileActions && item.fileActions.split(" ").length === 1;
|
|
529
|
+
const showActionMenu = !this.tempUploaderType && this.isCondensed && !hasSingleFileAction;
|
|
530
|
+
const showFileInfo = !this.tempUploaderType && !this.isCondensed;
|
|
531
|
+
const showCheckmark = !this.tempUploaderType && item.progress === 100;
|
|
532
|
+
return (index.h("li", { class: `${this.isCondensed ? "condensed" : ""} ${showCheckmark ? "checked" : ""}` }, index.h("div", { class: "file --saved" }, this.renderFileName(filename, this.isItemUploading(item)), index.h("div", { class: "right-group" }, showFileInfo && this.renderFileInfo(item), showActionMenu ? this.renderActionMenu(item) : this.renderFileActions(item)))));
|
|
533
|
+
}
|
|
534
|
+
handleFilenameMouseEnter(ev, filename) {
|
|
535
|
+
// only show tooltip if file name is being truncated (has ellipses)
|
|
536
|
+
if (ev.target.textContent.includes("...")) {
|
|
537
|
+
this.showTooltip(ev.target, filename);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
componentDidRender() {
|
|
541
|
+
const files = this.el.shadowRoot.querySelectorAll(".file");
|
|
542
|
+
files.forEach((file) => this.truncateFileName(file));
|
|
543
|
+
}
|
|
544
|
+
truncateFileName(file) {
|
|
545
|
+
const leftGroup = file.querySelector(".left-group");
|
|
546
|
+
const leftBoundary = leftGroup.getBoundingClientRect().left;
|
|
547
|
+
const rightGroup = file.querySelector(".right-group");
|
|
548
|
+
const rightBoundary = rightGroup
|
|
549
|
+
? rightGroup.getBoundingClientRect().left
|
|
550
|
+
: file.getBoundingClientRect().right - 20;
|
|
551
|
+
const filenameEl = file.querySelector(".filename");
|
|
552
|
+
const availableSpace = rightBoundary - leftBoundary;
|
|
553
|
+
let filename = filenameEl.dataset.filename;
|
|
554
|
+
const canFitText = availableSpace > filename.length * this.chMeasure;
|
|
555
|
+
if (!canFitText) {
|
|
556
|
+
const extension = filename.slice(filename.lastIndexOf("."));
|
|
557
|
+
const numFittingCharacters = Math.floor(availableSpace / this.chMeasure);
|
|
558
|
+
// three ellipses, three constant characters, extension
|
|
559
|
+
const postEllipsesLength = 3 + 3 + extension.length;
|
|
560
|
+
let preEllipsesLength = Math.max(2, numFittingCharacters - postEllipsesLength);
|
|
561
|
+
const preEllipsesText = filename.slice(0, preEllipsesLength);
|
|
562
|
+
const postEllipsesText = filename.slice(filename.indexOf(extension) - 3, filename.length);
|
|
563
|
+
filename = `${preEllipsesText.trim()}...${postEllipsesText.trim()}`;
|
|
564
|
+
}
|
|
565
|
+
filenameEl.textContent = filename;
|
|
566
|
+
}
|
|
567
|
+
renderFileActions(item) {
|
|
568
|
+
const defaultFileActions = "download delete";
|
|
569
|
+
const availableActions = item.fileActions || defaultFileActions;
|
|
570
|
+
const previewButton = (index.h("wm-button", { class: "preview-button", "button-type": "icononly", tooltip: "Preview", "tooltip-position": "bottom", "label-for-identical-buttons": `preview ${item.name}`, icon: "f208", onClick: () => this.previewFile(item) }));
|
|
571
|
+
const downloadButton = (index.h("wm-button", { class: "download-button", "button-type": "icononly", tooltip: "Download", "tooltip-position": "bottom", "label-for-identical-buttons": `download ${item.name}`, icon: "f1da", onClick: () => this.downloadFile(item) }));
|
|
572
|
+
const deleteButton = (index.h("wm-button", { class: "delete-button", "button-type": "icononly", tooltip: "Delete", "tooltip-position": "bottom", "label-for-identical-buttons": `delete ${item.name}`, icon: "f1c0", onClick: () => this.deleteFile(item) }));
|
|
573
|
+
return (index.h("div", { class: "file-controls" }, availableActions.includes("preview") && previewButton, availableActions.includes("download") && downloadButton, availableActions.includes("delete") && deleteButton));
|
|
574
|
+
}
|
|
575
|
+
renderActionMenu(item) {
|
|
576
|
+
const defaultFileActions = "download delete";
|
|
577
|
+
const availableActions = item.fileActions || defaultFileActions;
|
|
578
|
+
const previewItem = (index.h("wm-menuitem", { icon: "f208", onClick: () => this.previewFile(item) }, this.previewActionMessage));
|
|
579
|
+
const downloadItem = (index.h("wm-menuitem", { icon: "f1da", onClick: () => this.downloadFile(item) }, this.downloadActionMessage));
|
|
580
|
+
const deleteItem = (index.h("wm-menuitem", { icon: "f1c0", onClick: () => this.deleteFile(item) }, this.deleteActionMessage));
|
|
581
|
+
return (index.h("wm-action-menu", { "action-menu-type": "icon", tooltip: this.actionMenuLabel, "tooltip-position": "bottom", "label-for-identical-buttons": `${item.name} ${this.actionMenuLabel}` }, availableActions.includes("preview") && previewItem, availableActions.includes("download") && downloadItem, availableActions.includes("delete") && deleteItem));
|
|
582
|
+
}
|
|
583
|
+
renderFileInfo(item) {
|
|
584
|
+
let elementToRender = undefined;
|
|
585
|
+
if (this.showInfo === "time") {
|
|
586
|
+
const uploadDate = new Date(Date.parse(item.lastUpdated));
|
|
587
|
+
const day = uploadDate.getDate();
|
|
588
|
+
const month = uploadDate.getMonth() + 1;
|
|
589
|
+
const year = uploadDate.getFullYear();
|
|
590
|
+
const time = uploadDate.toLocaleTimeString("en-us", { hour: "numeric", minute: "2-digit" });
|
|
591
|
+
const formattedDate = `${month}/${day}/${year} ${time}`;
|
|
592
|
+
elementToRender = index.h("div", { class: "file-info" }, formattedDate);
|
|
593
|
+
}
|
|
594
|
+
else if (this.showInfo === "size" && item.size) {
|
|
595
|
+
const convertedSize = this.convertBytes(item.size);
|
|
596
|
+
elementToRender = index.h("div", { class: "file-info" }, `${convertedSize.size.toFixed(0)} ${convertedSize.unit}`);
|
|
597
|
+
}
|
|
598
|
+
return elementToRender;
|
|
599
|
+
}
|
|
600
|
+
renderFileList() {
|
|
601
|
+
if (this.fileList) {
|
|
602
|
+
this.sortBy === "name"
|
|
603
|
+
? this.fileList.sort((a, b) => a.name.localeCompare(b.name))
|
|
604
|
+
: this.fileList.sort((a, b) => Date.parse(a.lastUpdated) - Date.parse(b.lastUpdated));
|
|
605
|
+
return (index.h("div", null, index.h("ul", { class: "inprogress-list" }, this.fileList.filter((item) => this.isItemUploading(item)).map((item) => this.renderFileInProgress(item))), index.h("ul", { class: "file-list" }, this.fileList.filter((item) => !this.isItemUploading(item)).map((item) => this.renderFile(item)))));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
legacyRenderHeader() {
|
|
609
|
+
return (index.h("div", { class: `header ${this.tempUploaderType ? `type${this.tempUploaderType}` : ""}` }, index.h("div", { class: "slot-wrapper" }, index.h("slot", null), index.h("div", { class: `notif-wrapper ${this.tempUploaderType ? `type${this.tempUploaderType}` : ""}` }, this.renderUploadButton(`-secondary ${this.isDisabled ? "disabled" : ""}`), this.renderNotif()))));
|
|
610
|
+
}
|
|
611
|
+
renderHeader() {
|
|
612
|
+
return (index.h("div", { class: `header ${this.tempUploaderType ? `type${this.tempUploaderType}` : ""}` }, index.h("div", { class: `notif-wrapper ${this.tempUploaderType ? `type${this.tempUploaderType}` : ""}` }, this.renderUploadButton(`-secondary ${this.isDisabled ? "disabled" : ""}`), this.renderRequirements()), index.h("div", { id: "accepted-types", class: "accepted-types" }, this.acceptedFileTypesMessage), this.renderNotif()));
|
|
613
|
+
}
|
|
614
|
+
renderRequirements() {
|
|
615
|
+
return (index.h("div", { class: "requirements" }, this.maxFiles && index.h("span", { id: "file-count" }, this.fileCountMessage), this.maxSize !== this.defaultMaxSize && index.h("span", { id: "max-size" }, this.maxSizeMessage)));
|
|
616
|
+
}
|
|
617
|
+
renderFooter() {
|
|
618
|
+
return (index.h("div", { class: "footer" }, index.h("div", { class: `notif-wrapper ${this.tempUploaderType ? `type${this.tempUploaderType}` : ""}` }, index.h("div", { class: "filecount-wrapper" }, index.h("div", { class: "filecount" }, functions.intl.formatMessage({
|
|
619
|
+
id: "uploader.filesAdded",
|
|
620
|
+
defaultMessage: "{numFiles, plural, one {1 file added} other {# files added}}",
|
|
621
|
+
}, { numFiles: this.fileList.length })), this.renderUploadButton(`-primary ${this.isDisabled ? "disabled" : ""}`)), this.renderNotif())));
|
|
622
|
+
}
|
|
623
|
+
renderWithItems() {
|
|
624
|
+
const hasNewlyUploadedFiles = this.fileList.filter((file) => file.progress === 100).length > 0;
|
|
625
|
+
return (index.h("div", null, !this.tempUploaderType && this.renderHeader(), this.tempUploaderType === "2" && this.legacyRenderHeader(), index.h("div", { class: `list-container type${this.tempUploaderType} ${!this.tempUploaderType && hasNewlyUploadedFiles ? "checkmark-spacer" : ""}` }, this.renderErrorList(), this.renderFileList()), this.tempUploaderType === "1" && this.renderFooter()));
|
|
626
|
+
}
|
|
627
|
+
render() {
|
|
628
|
+
return (index.h(index.Host, null, this.isEmpty() && this.tempUploaderType === "1" ? this.renderEmptyState() : this.renderWithItems(), index.h("div", { ref: (el) => (this.liveRegion = el), class: "live-region sr-only", "aria-live": "assertive" // since it's directly linked to the action the user took, it should be read in priority. With polite, some messages get dismissed in favor of the page title
|
|
629
|
+
,
|
|
630
|
+
"aria-atomic": "true" })));
|
|
631
|
+
}
|
|
632
|
+
get el() { return index.getElement(this); }
|
|
633
|
+
static get watchers() { return {
|
|
634
|
+
"files": ["parseFiles"],
|
|
635
|
+
"rejectedFiles": ["parseRejectedFiles"],
|
|
636
|
+
"maxSize": ["setMaxSize"],
|
|
637
|
+
"numFilesInProgress": ["uploadNotifications"]
|
|
638
|
+
}; }
|
|
639
|
+
};
|
|
616
640
|
Uploader.style = wmUploaderCss;
|
|
617
641
|
|
|
618
642
|
exports.wm_uploader = Uploader;
|