@watermarkinsights/ripple 3.26.0 → 3.26.1-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-b7452189.js → chartFunctions-d746b939.js} +596 -596
- package/dist/cjs/{functions-a047a8ea.js → functions-68f637b4.js} +503 -503
- package/dist/cjs/{global-21ae6c78.js → global-ae47f0c9.js} +72 -72
- package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
- package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
- package/dist/cjs/{intl-47d63c8f.js → intl-d9ffc76c.js} +131 -131
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-chart-popover.cjs.entry.js +91 -91
- package/dist/cjs/priv-datepicker.cjs.entry.js +657 -657
- package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
- package/dist/cjs/priv-navigator-item.cjs.entry.js +23 -23
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +334 -334
- package/dist/cjs/wm-button.cjs.entry.js +260 -260
- package/dist/cjs/wm-chart-slice.cjs.entry.js +18 -18
- package/dist/cjs/wm-chart.cjs.entry.js +183 -183
- package/dist/cjs/wm-datepicker.cjs.entry.js +263 -263
- package/dist/cjs/wm-file-list.cjs.entry.js +35 -35
- package/dist/cjs/wm-file.cjs.entry.js +181 -181
- package/dist/cjs/wm-input.cjs.entry.js +136 -136
- package/dist/cjs/wm-modal-footer.cjs.entry.js +33 -33
- package/dist/cjs/wm-modal-header.cjs.entry.js +32 -32
- package/dist/cjs/wm-modal.cjs.entry.js +152 -152
- package/dist/cjs/wm-navigation_3.cjs.entry.js +225 -225
- package/dist/cjs/wm-navigator.cjs.entry.js +264 -264
- package/dist/cjs/wm-network-uploader.cjs.entry.js +465 -465
- package/dist/cjs/wm-option_2.cjs.entry.js +768 -768
- package/dist/cjs/wm-pagination.cjs.entry.js +179 -179
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +155 -155
- package/dist/cjs/wm-search.cjs.entry.js +184 -184
- package/dist/cjs/wm-snackbar.cjs.entry.js +155 -155
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +265 -265
- package/dist/cjs/wm-tag-input-row.cjs.entry.js +14 -14
- package/dist/cjs/wm-tag-input.cjs.entry.js +939 -939
- package/dist/cjs/wm-timepicker.cjs.entry.js +385 -385
- package/dist/cjs/wm-toggletip.cjs.entry.js +130 -130
- package/dist/cjs/wm-uploader.cjs.entry.js +441 -441
- package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
- package/dist/collection/components/charts/chartFunctions.js +562 -562
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +267 -267
- package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -125
- package/dist/collection/components/charts/wm-chart/wm-chart.js +450 -450
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +207 -207
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +143 -143
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -121
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +472 -472
- package/dist/collection/components/wm-button/wm-button.js +575 -575
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +983 -983
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +491 -491
- package/dist/collection/components/wm-file/wm-file.js +313 -313
- package/dist/collection/components/wm-file-list/wm-file-list.js +152 -152
- package/dist/collection/components/wm-input/wm-input.js +509 -509
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +454 -454
- package/dist/collection/components/wm-modal/wm-modal-footer.js +138 -138
- package/dist/collection/components/wm-modal/wm-modal-header.js +82 -82
- package/dist/collection/components/wm-modal/wm-modal.js +462 -462
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +176 -176
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +130 -130
- package/dist/collection/components/wm-navigation/wm-navigation.js +217 -217
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +106 -106
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +123 -123
- package/dist/collection/components/wm-navigator/wm-navigator.js +467 -467
- package/dist/collection/components/wm-option/wm-option.js +435 -435
- package/dist/collection/components/wm-pagination/wm-pagination.js +370 -370
- package/dist/collection/components/wm-search/wm-search.js +439 -439
- package/dist/collection/components/wm-select/wm-select.js +1054 -1054
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +282 -282
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +211 -211
- 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 +327 -327
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +108 -108
- package/dist/collection/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.js +122 -122
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +1294 -1294
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +605 -605
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +253 -253
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +772 -772
- package/dist/collection/components/wm-uploader/wm-uploader.js +964 -964
- package/dist/collection/components/wm-wrapper/wm-wrapper.js +28 -28
- package/dist/collection/dev/scripts.js +20 -20
- package/dist/collection/global/__mocks__/functions.js +6 -6
- package/dist/collection/global/functions.js +546 -546
- package/dist/collection/global/global.js +79 -79
- package/dist/collection/global/interfaces.js +49 -49
- package/dist/collection/global/intl.js +132 -132
- 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-9d629e09.js → chartFunctions-5c1ad085.js} +596 -596
- package/dist/esm/{functions-3b813e0c.js → functions-b2582352.js} +503 -503
- package/dist/esm/{global-c7bb5530.js → global-770519f0.js} +72 -72
- package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
- package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
- package/dist/esm/{intl-d544f922.js → intl-6732dd5b.js} +131 -131
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- 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 +91 -91
- package/dist/esm/priv-datepicker.entry.js +657 -657
- package/dist/esm/priv-navigator-button.entry.js +19 -19
- package/dist/esm/priv-navigator-item.entry.js +23 -23
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-action-menu_2.entry.js +334 -334
- package/dist/esm/wm-button.entry.js +260 -260
- package/dist/esm/wm-chart-slice.entry.js +18 -18
- package/dist/esm/wm-chart.entry.js +183 -183
- package/dist/esm/wm-datepicker.entry.js +263 -263
- package/dist/esm/wm-file-list.entry.js +35 -35
- package/dist/esm/wm-file.entry.js +181 -181
- package/dist/esm/wm-input.entry.js +136 -136
- package/dist/esm/wm-modal-footer.entry.js +33 -33
- package/dist/esm/wm-modal-header.entry.js +32 -32
- package/dist/esm/wm-modal.entry.js +152 -152
- package/dist/esm/wm-navigation_3.entry.js +225 -225
- package/dist/esm/wm-navigator.entry.js +264 -264
- package/dist/esm/wm-network-uploader.entry.js +465 -465
- package/dist/esm/wm-option_2.entry.js +768 -768
- package/dist/esm/wm-pagination.entry.js +179 -179
- package/dist/esm/wm-progress-indicator_3.entry.js +155 -155
- package/dist/esm/wm-search.entry.js +184 -184
- package/dist/esm/wm-snackbar.entry.js +155 -155
- package/dist/esm/wm-tab-item_3.entry.js +265 -265
- package/dist/esm/wm-tag-input-row.entry.js +14 -14
- package/dist/esm/wm-tag-input.entry.js +939 -939
- package/dist/esm/wm-timepicker.entry.js +385 -385
- package/dist/esm/wm-toggletip.entry.js +130 -130
- package/dist/esm/wm-uploader.entry.js +441 -441
- package/dist/esm/wm-wrapper.entry.js +12 -12
- package/dist/esm-es5/{chartFunctions-9d629e09.js → chartFunctions-5c1ad085.js} +1 -1
- package/dist/esm-es5/global-770519f0.js +1 -0
- package/dist/esm-es5/{intl-d544f922.js → intl-6732dd5b.js} +1 -1
- 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/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.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.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/ripple/{p-56ba575c.system.entry.js → p-00edfbc8.system.entry.js} +1 -1
- package/dist/ripple/{p-0cfc0d13.entry.js → p-0414179c.entry.js} +1 -1
- package/dist/ripple/{p-f6c9c95f.entry.js → p-043b4874.entry.js} +1 -1
- package/dist/ripple/{p-ea99fb58.system.entry.js → p-0503e614.system.entry.js} +1 -1
- package/dist/ripple/{p-09a04f55.system.entry.js → p-061914bf.system.entry.js} +1 -1
- package/dist/ripple/{p-4f5a48dd.system.entry.js → p-0648aa61.system.entry.js} +1 -1
- package/dist/ripple/{p-2d46dbea.entry.js → p-076a8729.entry.js} +1 -1
- package/dist/ripple/{p-d973fe13.system.entry.js → p-08e1c91b.system.entry.js} +1 -1
- package/dist/ripple/{p-ae1e1db8.entry.js → p-094388f1.entry.js} +1 -1
- package/dist/ripple/{p-8c853762.entry.js → p-17490d32.entry.js} +1 -1
- package/dist/ripple/{p-51b38033.entry.js → p-22b74491.entry.js} +1 -1
- package/dist/ripple/{p-4fb81a33.system.entry.js → p-2948bf33.system.entry.js} +1 -1
- package/dist/ripple/{p-2cde4ade.system.entry.js → p-2cef256c.system.entry.js} +1 -1
- package/dist/ripple/{p-2dd5f5c3.system.entry.js → p-3313df40.system.entry.js} +1 -1
- package/dist/ripple/{p-7f15df83.entry.js → p-3aaf86e4.entry.js} +1 -1
- package/dist/ripple/{p-b3d97de8.entry.js → p-3b582301.entry.js} +1 -1
- package/dist/ripple/{p-42f8f3ff.entry.js → p-42739dba.entry.js} +1 -1
- package/dist/ripple/{p-236dab05.system.entry.js → p-462e7cf8.system.entry.js} +1 -1
- package/dist/ripple/{p-fe76e568.entry.js → p-49f7f1da.entry.js} +1 -1
- package/dist/ripple/{p-38819b27.system.entry.js → p-4e7489a3.system.entry.js} +1 -1
- package/dist/ripple/{p-832910a0.entry.js → p-5ddb1660.entry.js} +1 -1
- package/dist/ripple/{p-fea37751.system.entry.js → p-60f58a39.system.entry.js} +1 -1
- package/dist/ripple/{p-35790e4e.system.entry.js → p-64b64f40.system.entry.js} +1 -1
- package/dist/ripple/{p-84ce9b67.system.entry.js → p-66bb46e5.system.entry.js} +1 -1
- package/dist/ripple/{p-8b23f32b.entry.js → p-6f96c28d.entry.js} +1 -1
- package/dist/ripple/p-719816e6.system.entry.js +1 -0
- package/dist/ripple/{p-f6f80b8d.system.entry.js → p-731beaab.system.entry.js} +1 -1
- package/dist/ripple/{p-630bd6f5.system.entry.js → p-7dafc84b.system.entry.js} +1 -1
- package/dist/ripple/{p-18c2f4fe.js → p-7ee31208.js} +1 -1
- package/dist/ripple/{p-8ff578ad.system.entry.js → p-81b26d3a.system.entry.js} +1 -1
- package/dist/ripple/{p-ffb83b6f.entry.js → p-918dc303.entry.js} +1 -1
- package/dist/ripple/{p-3aa8e5f5.entry.js → p-926aab51.entry.js} +1 -1
- package/dist/ripple/{p-54a2b7d6.system.js → p-9706537b.system.js} +1 -1
- package/dist/ripple/p-9ad652d9.system.js +1 -0
- package/dist/ripple/{p-95f4e5a1.entry.js → p-9b28a31f.entry.js} +1 -1
- package/dist/ripple/{p-5708349e.entry.js → p-9b293f13.entry.js} +1 -1
- package/dist/ripple/{p-95aa793b.system.entry.js → p-9b9e60aa.system.entry.js} +1 -1
- package/dist/ripple/{p-2cd5477a.entry.js → p-9baf62ae.entry.js} +1 -1
- package/dist/ripple/p-9c2b8fb4.js +1 -0
- package/dist/ripple/{p-a48e4f1a.system.js → p-a1f5f82f.system.js} +1 -1
- package/dist/ripple/{p-09bc0aa7.entry.js → p-a2f10a77.entry.js} +1 -1
- package/dist/ripple/{p-f2bb38d0.system.entry.js → p-a5662a2c.system.entry.js} +1 -1
- package/dist/ripple/{p-0ef638b7.entry.js → p-a9080b82.entry.js} +1 -1
- package/dist/ripple/{p-72b9b986.entry.js → p-a966a18c.entry.js} +1 -1
- package/dist/ripple/{p-a006968b.system.entry.js → p-accdf91c.system.entry.js} +1 -1
- package/dist/ripple/{p-6eb2c2d5.system.js → p-b7982fab.system.js} +1 -1
- package/dist/ripple/{p-c3665c9f.system.entry.js → p-b805612a.system.entry.js} +1 -1
- package/dist/ripple/{p-eeeec290.entry.js → p-bd94e7c3.entry.js} +1 -1
- package/dist/ripple/{p-05563588.entry.js → p-d5a420fa.entry.js} +1 -1
- package/dist/ripple/{p-d96b86c9.js → p-d7f77b2c.js} +1 -1
- package/dist/ripple/{p-8775e10b.system.entry.js → p-e6fde200.system.entry.js} +1 -1
- package/dist/ripple/{p-12c70659.system.entry.js → p-f740c48c.system.entry.js} +1 -1
- package/dist/ripple/{p-bdecbb63.entry.js → p-f8418ac9.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/chartFunctions.d.ts +37 -37
- 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 +47 -47
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +29 -29
- package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +20 -20
- 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 +49 -49
- package/dist/types/components/wm-button/wm-button.d.ts +49 -49
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +42 -42
- package/dist/types/components/wm-file/wm-file.d.ts +40 -40
- package/dist/types/components/wm-file-list/wm-file-list.d.ts +16 -16
- package/dist/types/components/wm-input/wm-input.d.ts +57 -57
- 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 +10 -10
- package/dist/types/components/wm-modal/wm-modal.d.ts +40 -40
- 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 +26 -26
- 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 +34 -34
- package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
- package/dist/types/components/wm-search/wm-search.d.ts +77 -77
- package/dist/types/components/wm-select/wm-select.d.ts +101 -101
- package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +31 -31
- package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +37 -37
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +52 -52
- 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-row/wm-tag-input-row.d.ts +11 -11
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +136 -136
- package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +62 -62
- package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +28 -28
- 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 +99 -99
- package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
- package/dist/types/components.d.ts +27 -27
- package/dist/types/global/__mocks__/functions.d.ts +6 -6
- package/dist/types/global/functions.d.ts +49 -49
- package/dist/types/global/global.d.ts +1 -1
- package/dist/types/global/interfaces.d.ts +74 -74
- package/dist/types/global/intl.d.ts +29 -29
- 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 +46 -46
- package/dist/esm-es5/global-c7bb5530.js +0 -1
- package/dist/ripple/p-169606b9.system.js +0 -1
- package/dist/ripple/p-4444add0.system.entry.js +0 -1
- package/dist/ripple/p-76015762.js +0 -1
- /package/dist/esm-es5/{functions-3b813e0c.js → functions-b2582352.js} +0 -0
- /package/dist/esm-es5/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +0 -0
- /package/dist/esm-es5/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +0 -0
- /package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
- /package/dist/ripple/{p-9d02957d.system.js → p-313b6073.system.js} +0 -0
- /package/dist/ripple/{p-4a0e1d2d.js → p-5384856b.js} +0 -0
- /package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
- /package/dist/ripple/{p-190afa40.system.js → p-9e94ae94.system.js} +0 -0
- /package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as r,H as s,g as a}from"./p-b5dee715.js";import{g as o,d as n,r as h,i as d,u as l,v as p,j as c,k as w,s as g,n as m}from"./p-4a0e1d2d.js";import{g as u}from"./p-18c2f4fe.js";const b=class{constructor(r){t(this,r),this.wmTagInputChanged=e(this,"wmTagInputChanged",7),this.uid=this.el.id?this.el.id:o(),this.openUp=!1,this.debouncedUpdate=n((()=>i(this.el)),30),this.label=void 0,this.labelPosition="top",this.options="",this.selectedTags="",this.info=void 0,this.errorMessage=void 0,this.addNew=!0,this.placeholder=void 0,this.requiredField=!1,this.characterLimit=50,this.maxTags=void 0,this.tagInputType="dropdown",this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.messageConfig="",this.focusedListItem=void 0,this.focusedTag=null,this.tablePosition={row:0,column:1},this.isExpanded=!1,this.tagsList=h(this.selectedTags),this.optionsList=h(this.options),this.charCount=0,this.liveRegionMessage=""}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("open")}get focusedElement(){return this.el.shadowRoot.activeElement}get listItemEls(){return Array.from(this.dropdownEl.querySelectorAll("li"))}get tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get nonLockedTagEls(){return this.tagEls.filter((t=>!t.classList.contains("locked")))}get optionEls(){return Array.from(this.dropdownEl.querySelectorAll(".option"))}get wmRowEls(){return Array.from(this.el.querySelectorAll("wm-tag-input-row"))}get localRowEls(){return Array.from(this.el.shadowRoot.querySelectorAll("tr"))}get filteredRows(){return this.wmRowEls.filter((t=>{const e=[t.col1,t.col2,t.col3,t.col4].join("").toLowerCase();return!this.inputEl||!this.inputEl.value||e.includes(this.inputEl.value.toLowerCase())}))}get nonLockedTagsList(){let t=[];return"table"===this.tagInputType?this.tagsList.forEach((e=>{this.wmRowEls.filter((t=>e===t.id))[0].locked||t.push(e)})):"dropdown"===this.tagInputType&&(t=this.tagsList),t}get tagLimitReached(){return!!(this.maxTags&&this.tagsList.length>=this.maxTags)}get noResultsMessage(){return d.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get componentMessages(){const t={addNewHelpText:d.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),selectionHelpText:d.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),maxTagsReached:d.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),tagAreaInstructions:d.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),tagsAdded:d.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"For the user to understand how close they are to the tag limit, followed by x/y count"})},e=l(this.messageConfig);return e?Object.assign(Object.assign({},t),e):t}get inputMinimumWidth(){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this.tagEls[this.tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,p(this.inputEl,this.placeholder).width+i)}generateTagAddedMessage(t){return d.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}generateTagAlreadyAddedMessage(t){return d.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,!!this.options)),this.label||console.error("wm-tag-input must have a label property"),this.consolidateSelectedTags(),this.el.focus=()=>{const t=this.nonLockedTagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}componentDidLoad(){this.tagEls.forEach((t=>t.classList.remove("highlight")))}componentDidRender(){this.positionInput(),this.tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,s=i.getBoundingClientRect().right-10-8-28;let a=t.dataset.tag;if("table"===this.tagInputType){const t=this.el.querySelector(`#${a}`);a=t?t.col1:""}e.textContent=c(e,a,s-r,5)}))}consolidateSelectedTags(){this.tagsList.forEach((t=>{this.includesCaseInsensitive(this.optionsList,t)||(this.options+=`${this.options.length>0?",":""}${t}`)})),this.optionsList=h(this.options)}createPlaceholderDefault(t,e){const i=d.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=d.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),s=d.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let a="";return t&&e?a=i:!t&&e?a=r:t&&(a=s),a}reflectSelectedTags(t,e){let i="",r=this.tagsList;i=t.length>e.length?t.filter((t=>!e.includes(t)))[0]:e.filter((e=>!t.includes(e)))[0],"table"===this.tagInputType&&(i=this.wmRowEls.filter((t=>t.id===i))[0],r=this.tagsList.map((t=>this.el.querySelector(`#${t}`)))),this.selectedTags=this.listToCSV(this.tagsList),this.wmTagInputChanged.emit({value:r,tagChanged:i})}handleErrorMessageChange(){this.errorMessage&&this.announce(this.errorMessage)}handleRowUpdate(){i(this.el)}closeIfNotElOrChild(t){const e=t.target!==this.el&&!this.el.shadowRoot.contains(t.target);"dropdown"===this.tagInputType&&e&&this.isExpanded&&this.closeDropdown()}dismissTooltip(){this.tooltipVisible&&w()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.inputEl.value.length>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.inputEl.value.length,this.characterLimit)),t.stopPropagation(),t.key){case"Enter":case",":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":"table"===this.tagInputType&&this.tablePosition.row&&(t.preventDefault(),this.moveLeftCell());break;case"ArrowRight":"table"===this.tagInputType&&this.tablePosition.row&&(t.preventDefault(),this.moveRightCell());break;case"Escape":"dropdown"===this.tagInputType&&this.isExpanded&&this.closeDropdown();break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){"dropdown"===this.tagInputType&&(this.openDropdown(),this.clearListItemFocus()),i(this.el)}handleInputChanged(t){this.charCount=t.length,"dropdown"===this.tagInputType?(this.clearListItemFocus(),this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown()):"table"===this.tagInputType&&this.clearCellFocus(),this.announceExistingOptions()}handleInputEnter(){"dropdown"===this.tagInputType?this.focusedListItem?this.handleListItemClick(this.focusedListItem):this.submitInput(this.addNew,this.inputEl.value.trim()):"table"===this.tagInputType&&this.tablePosition.row>0&&this.handleTableRowClick(this.localRowEls[this.tablePosition.row].id)}submitInput(t,e){const i=e.match(/\S/);t&&i&&(this.addTag(e),this.optionsList=this.addOption(e),this.resetInput())}handleInputArrowDown(){"table"===this.tagInputType?this.moveDownRow():"dropdown"===this.tagInputType&&this.isExpanded?this.moveDownListItem():"dropdown"===this.tagInputType&&this.openDropdown()}handleInputArrowUp(){"table"===this.tagInputType?this.moveUpRow():"dropdown"===this.tagInputType&&this.isExpanded?this.moveUpListItem():"dropdown"===this.tagInputType&&this.openDropdown()}handleInputBackspace(){""===this.inputEl.value&&this.tagsList.length>0&&window.requestAnimationFrame((()=>{this.nonLockedTagsList.length>0&&(this.tagAreaEl.focus(),this.focusTag(this.tagEls[this.tagEls.length-1]))}))}handleListItemKeyDown(t){const e=t.target;switch(t.key){case"Enter":case" ":t.preventDefault(),e.click();break;case"ArrowDown":t.preventDefault(),this.moveDownListItem();break;case"ArrowUp":t.preventDefault(),this.moveUpListItem();break;case"Escape":this.focusedElement!==this.inputEl?this.inputEl.focus():"dropdown"===this.tagInputType&&this.closeDropdown()}}handleListItemClick(t){const e=t.dataset.option.trim()||"";this.includesCaseInsensitive(this.tagsList,e)?this.announce(this.generateTagAlreadyAddedMessage(e)):(this.resetInput(),this.addTag(e),this.optionsList=this.addOption(e),this.focusedListItem=null)}handleTableRowClick(t){this.el.querySelector(`#${t}`).locked||(this.includesCaseInsensitive(this.tagsList,t)?this.removeTag(t):this.tagLimitReached||(this.addTag(t),this.resetInput()))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.moveLeftTag();break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.moveRightTag();break;case"Backspace":case"Delete":this.handleTagAreaDelete()}}handleTagAreaDelete(){const t=this.focusedTag&&this.focusedTag.classList.contains("locked");this.focusedTag&&!t&&(this.removeTag(this.focusedTag.dataset.tag),0===this.nonLockedTagsList.length?this.inputEl.focus():(this.focusedTag=this.focusedTag===this.tagEls[this.tagEls.length-1]?this.tagEls[this.tagEls.length-2]:this.focusedTag,this.focusTag(this.focusedTag)))}handleBlur(t,e){const i=t.relatedTarget!==e&&!this.el.shadowRoot.contains(t.relatedTarget);this.dismissTooltip(),this.clearCellFocus(),i&&(this.fieldWrapperEl.classList.remove("focused"),"dropdown"===this.tagInputType&&this.closeDropdown())}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&g("bottom",e,e.innerText)}handleTagAreaFocus(){"dropdown"===this.tagInputType&&this.closeDropdown();const t=this.nonLockedTagEls[0];t&&this.focusTag(t)}handleRemoveButtonClick(t){this.moveLeftTag(),this.removeTag(t)}moveDownListItem(){if(this.listItemEls.length>0){this.focusListItem(this.focusedListItem&&this.focusedListItem.nextElementSibling?this.focusedListItem.nextElementSibling:this.listItemEls[0])}}moveUpListItem(){if(this.listItemEls.length>0){const t=this.listItemEls[this.listItemEls.length-1];this.focusedListItem?this.focusedListItem.previousElementSibling?this.focusListItem(this.focusedListItem.previousElementSibling):this.clearListItemFocus():this.focusListItem(t)}}moveDownRow(){this.filteredRows.length>0&&(0===this.tablePosition.row||this.tablePosition.row===this.filteredRows.length?this.tablePosition.row=1:this.tablePosition.row++,this.wmRowEls[this.tablePosition.row-1].locked?this.moveDownRow():this.focusCell(this.tablePosition))}moveUpRow(){if(this.filteredRows.length>0){0===this.tablePosition.row?this.tablePosition.row=this.filteredRows.length:1===this.tablePosition.row?this.tablePosition.row=0:this.tablePosition.row--;const t=this.wmRowEls[this.tablePosition.row-1];t&&t.locked?this.moveUpRow():t?this.focusCell(this.tablePosition):this.clearCellFocus()}}moveLeftCell(){1!=this.tablePosition.column&&(this.tablePosition.column--,this.focusCell(this.tablePosition))}moveRightCell(){const t=h(this.colHeaders).length;this.tablePosition.column<t&&(this.tablePosition.column++,this.focusCell(this.tablePosition))}moveLeftTag(){const t=this.tagEls[this.tagEls.length-1];this.focusedTag=this.focusedTag&&this.tagEls.includes(this.focusedTag.previousElementSibling)?this.focusedTag.previousElementSibling:t,this.focusedTag.classList.contains("locked")&&this.nonLockedTagEls.length>0?this.moveLeftTag():this.focusTag(this.focusedTag)}moveRightTag(){const t=this.tagEls[0];this.focusedTag=this.focusedTag&&this.tagEls.includes(this.focusedTag.nextElementSibling)?this.focusedTag.nextElementSibling:t,this.focusedTag.classList.contains("locked")?this.moveRightTag():this.focusTag(this.focusedTag)}addOption(t){let e=this.optionsList;return this.includesCaseInsensitive(this.optionsList,t)||(e=e.concat(t)),e}removeOption(t){this.optionsList=this.filterCaseInsensitive(this.optionsList,t)}addTag(t){let e=this.tagsList;const i=this.includesCaseInsensitive(this.tagsList,t),r=this.optionsList.filter((e=>e.toLowerCase()===t.toLowerCase()))[0];if(!i){let i=t;"table"===this.tagInputType&&(i=this.el.querySelector(`#${t}`).col1),this.announce(this.generateTagAddedMessage(i)),this.tagsList=e.concat(r||t),this.tagLimitReached&&this.tagAreaEl.focus()}}removeTag(t){let e=t;"table"===this.tagInputType&&(e=this.el.querySelector(`#${t}`).col1);const i=d.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tag} removed"},{tag:e});if(this.announce(i),this.tagsList=this.filterCaseInsensitive(this.tagsList,t),"dropdown"===this.tagInputType){const e=h(this.options);this.includesCaseInsensitive(this.optionsList,t)&&!this.includesCaseInsensitive(e,t)&&this.removeOption(t)}}focusListItem(t){this.focusedListItem=t,this.inputEl.setAttribute("aria-activedescendant",this.focusedListItem.id),t.scrollIntoView({block:"nearest"})}focusTag(t){t.classList.contains("locked")?(this.focusedTag=null,this.tagAreaEl.setAttribute("aria-activedescendant","")):(this.focusedTag=t,this.tagAreaEl.setAttribute("aria-activedescendant",this.focusedTag.id)),window.requestAnimationFrame((()=>{w();const e=t.querySelector(".tag-text"),i=t.dataset.tag;i!==e.textContent&&e.textContent.includes("...")&&g("bottom",t,i)}))}focusCell(t){if(this.clearCellFocus(!1),t.row){const e=this.localRowEls[t.row],i=e.querySelectorAll("td")[t.column-1],r=i.querySelector(".cell-content-wrapper"),s=r.scrollWidth>r.clientWidth;e.classList.add("focused"),i.classList.add("focused"),i.scrollIntoView({block:"nearest"}),this.inputEl.setAttribute("aria-activedescendant",i.id),this.dismissTooltip(),s&&g("bottom",i,i.innerText)}}clearTagFocus(){this.tagAreaEl.setAttribute("aria-activedescendant",""),this.focusedTag=null}clearCellFocus(t=!0){this.inputEl.setAttribute("aria-activedescendant",""),t&&(this.tablePosition={row:0,column:1}),this.localRowEls.forEach((t=>{t.classList.remove("focused"),t.querySelectorAll("td").forEach((t=>{t.classList.remove("focused")}))}))}openDropdown(){this.openUp=m(this.el,this.dropdownEl,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearListItemFocus(),this.isExpanded=!1}clearListItemFocus(){this.focusedListItem=null,this.inputEl.setAttribute("aria-activedescendant",""),this.listItemEls.forEach((t=>{t.classList.remove("focused")}))}resetInput(){this.charCount=0,this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}announceExistingOptions(){window.requestAnimationFrame((()=>{let t=0;"dropdown"===this.tagInputType?t=this.optionEls.length:"table"===this.tagInputType&&(t=this.filteredRows.length);const e=d.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:t});this.announce(e)}))}generateCharacterLimitWarning(t,e){let i=u.getCharactersEntered(t,e);return t>=e&&(i+=` ${u.characterLimitReached}`),i}positionInput(){const t=this.tagEls[this.tagEls.length-1];this.inputEl.style.position="static",this.inputEl.style.width="100%",t&&this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right-8).toString()+"px")}handleTagMouseEnter(t){const e=t.target.querySelector(".tag-text").textContent,i=t.target.dataset.tag;e!==i&&e.includes("...")&&g("bottom",t.target,i)}listToCSV(t){return t.join(",")}includesCaseInsensitive(t,e){return t.map((t=>t.toLowerCase())).includes(e.toLowerCase())}filterCaseInsensitive(t,e){return t.filter((t=>t.toLowerCase()!==e.toLowerCase()))}sortCaseInsensitive(t){return t.sort(((t,e)=>(t=t.toLowerCase())>(e=e.toLowerCase())?1:t<e?-1:0))}renderTags(){let t=[],e=[];return this.tagsList.forEach(((i,s)=>{const a=`tag${s+1}`;let o="",n=!1;if("dropdown"===this.tagInputType)o=i;else if("table"===this.tagInputType){const t=this.el.querySelector(`#${i}`);o=t?t.col1:"",n=!!t&&t.locked}(n?t:e).push(r("li",{id:a,class:`tag highlight ${this.focusedTag&&this.focusedTag.id===a?"focused":""} ${n?"locked":""}`,"data-tag":i,role:"option",onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:w},r("span",{class:"sr-only"},i),r("span",{class:"tag-text","aria-hidden":"true"},o),n?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>this.handleRemoveButtonClick(i)})))})),[...t,...e]}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":!!this.isExpanded&&"true","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.renderListItems(this.optionsList)))}renderListItems(t){return t=this.sortCaseInsensitive(t),this.inputEl&&this.inputEl.value&&(t=this.optionsList.filter((t=>t.toLowerCase().includes(this.inputEl.value.toLowerCase())))),t.map(((t,e)=>{const i=`option${e+1}`,s=this.focusedListItem&&this.focusedListItem.id===i,a=this.includesCaseInsensitive(this.tagsList,t);return r("li",{class:"option "+(s?"focused":""),role:"option",id:i,"data-option":t,"aria-selected":a?"true":"false","aria-disabled":a?"true":"false",onKeyDown:t=>this.handleListItemKeyDown(t),onBlur:t=>this.handleBlur(t,this.el),onClick:t=>this.handleListItemClick(t.target)},t)}))}renderAddNewButton(){const t=this.inputEl.value.match(/\S/),e=this.includesCaseInsensitive(this.optionsList,this.inputEl.value.trim());if(this.addNew&&t&&!e){const t="add-new-btn",e=this.focusedListItem&&this.focusedListItem.id===t;return r("li",{role:"option",class:"add-new-btn "+(e?"focused":""),id:t,"data-option":this.inputEl.value,onKeyDown:t=>this.handleListItemKeyDown(t),onBlur:t=>this.handleBlur(t,this.el),onClick:t=>this.handleListItemClick(t.target),tabIndex:e?0:-1},`Add "${this.inputEl.value.trim()}"`)}return""}renderHelpText(){let t="";return this.optionsList.length>0&&(t+=this.componentMessages.selectionHelpText),this.addNew&&(t+=" "+this.componentMessages.addNewHelpText),t}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},`${this.componentMessages.tagsAdded}: ${this.tagsList.length}/${this.maxTags}`,this.tagLimitReached&&` - ${this.componentMessages.maxTagsReached}`))}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredRows.length?this.renderTableRows():r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},h(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&h(this.colWrap)[e]&&(i=h(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?h(this.colWidths)[e]:""},t)})))}renderTableRows(){return this.filteredRows.map((t=>{const e=this.includesCaseInsensitive(this.tagsList,t.id);return r("tr",{id:t.id,class:`${t.locked?"locked":""} ${e?"selected":""}`,role:"row",onClick:()=>this.handleTableRowClick(t.id)},this.renderTableCells(t))}))}renderTableCells(t){const e=[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)),i=this.includesCaseInsensitive(this.tagsList,t.id);return e.map(((e,s)=>{const a=`${t.id}-col${s+1}`;let o="wrap";return this.colWrap&&h(this.colWrap)[s]&&(o=h(this.colWrap)[s]),r("td",{id:a,role:"gridcell","aria-describedby":`${a}-description`,"aria-selected":i.toString(),onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>this.dismissTooltip()},r("div",{class:`cell-content-wrapper ${o}`},e),r("div",{class:"description",id:`${a}-description`},t.locked?"locked":""))}))}render(){return r(s,{id:this.uid},r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:`input${this.uid}`},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.focusedElement?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper"},this.tagsList.length>0&&r("ul",{ref:t=>this.tagAreaEl=t,class:"tag-area",role:"listbox","aria-activedescendant":"","aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagsList.length>0?this.componentMessages.tagAreaInstructions:""}`,tabindex:this.nonLockedTagsList.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:()=>this.handleTagAreaFocus(),onBlur:t=>{this.clearTagFocus(),this.handleBlur(t,this.el)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:`input${this.uid}`,class:this.tagLimitReached?"hidden":"",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":"help-text"+(this.errorMessage?" error ":""),"aria-label":`${this.label} ${"dropdown"===this.tagInputType?u.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":"dropdown"===this.tagInputType?this.isExpanded.toString():null,placeholder:this.placeholder,maxLength:"dropdown"===this.tagInputType?this.characterLimit:void 0,onInput:()=>this.handleInputChanged(this.inputEl.value),onBlur:t=>{this.handleBlur(t,this.el)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),"dropdown"===this.tagInputType&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),"dropdown"===this.tagInputType&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),this.errorMessage&&r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"assertive",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),"table"===this.tagInputType&&this.renderTable()))}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{tagsList:["reflectSelectedTags"],errorMessage:["handleErrorMessageChange"]}}};b.style=':host,wm-tag-input{font-family:inherit;width:100%;display:block;max-height:80vh}:host *,wm-tag-input *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper,wm-tag-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-tag-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-tag-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-tag-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-tag-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-tag-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-tag-input .wrapper.label-none label{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}:host .wrapper.invalid .label,wm-tag-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-tag-input .wrapper.invalid .label: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:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-tag-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-tag-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-tag-input .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper,wm-tag-input .field-wrapper{position:relative;width:100%;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused,wm-tag-input .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px #19a1a9;-moz-box-shadow:0 0 0 1px #19a1a9;box-shadow:0 0 0 1px #19a1a9;outline:none;border-color:#19a1a9}:host .field-wrapper.invalid,wm-tag-input .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .character-count,wm-tag-input .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper,wm-tag-input .tags-and-input-wrapper{position:relative;width:100%;padding:0.5rem 0.25rem 0.5rem 0;margin-bottom:-0.5rem;overflow:hidden}:host .upper-row,wm-tag-input .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before,wm-tag-input .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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:"\\f349";color:#b5b5b5;padding:0.75rem 0.5rem 0.75rem 0.75rem}:host .lower-row,wm-tag-input .lower-row{width:100%;min-height:1.875rem}:host #max-tags,wm-tag-input #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:#e6e6e6;padding:0.5rem 1rem;color:#4a4a4a;font-size:0.875rem;border-top:1px solid rgba(35, 35, 35, 0.6);border-radius:0 0 3px 3px}:host .tag-area,wm-tag-input .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0}:host .tag-area:focus,wm-tag-input .tag-area:focus{outline:none}:host .tag-area [role=option],wm-tag-input .tag-area [role=option]{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:#4a4a4a;background-color:rgba(3, 0, 0, 0.1);padding:0.5rem 0.625rem;margin-bottom:0.5rem;margin-right:0.25rem;margin-left:0.25rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area [role=option].highlight,wm-tag-input .tag-area [role=option].highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}@keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}:host .tag-area [role=option].focused,wm-tag-input .tag-area [role=option].focused{background-color:#d1d1d1}:host .tag-area [role=option].locked,wm-tag-input .tag-area [role=option].locked{background-color:#6b6b6b;color:white}:host .tag-area [role=option] .icon,wm-tag-input .tag-area [role=option] .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area [role=option] .icon.remove-btn,wm-tag-input .tag-area [role=option] .icon.remove-btn{border:1px solid #575195;color:#575195;border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 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)}:host .tag-area [role=option] .icon.remove-btn:hover,wm-tag-input .tag-area [role=option] .icon.remove-btn:hover{color:white;background-color:#575195}:host .tag-area [role=option] .icon.remove-btn:before,wm-tag-input .tag-area [role=option] .icon.remove-btn: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:"\\f156"}:host .tag-area [role=option] .icon.lock,wm-tag-input .tag-area [role=option] .icon.lock{color:white}:host .tag-area [role=option] .icon.lock:before,wm-tag-input .tag-area [role=option] .icon.lock: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:"\\f341"}:host input,wm-tag-input input{font-family:inherit;border:none;height:1.75rem;padding:0;margin-bottom:0.5rem;margin-right:0.25rem;padding-left:0.5rem;right:0px}:host input.hidden,wm-tag-input input.hidden{display:none}:host input:focus,wm-tag-input input:focus{outline:none}:host .dropdown-wrapper,wm-tag-input .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;background:#fff;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown,wm-tag-input .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open,wm-tag-input .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards,wm-tag-input .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div,wm-tag-input .dropdown-wrapper li,wm-tag-input .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:#fff;list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li[role=option],:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div[role=option],:host .dropdown-wrapper div.add-new-btn,wm-tag-input .dropdown-wrapper li[role=option],wm-tag-input .dropdown-wrapper li.add-new-btn,wm-tag-input .dropdown-wrapper div[role=option],wm-tag-input .dropdown-wrapper div.add-new-btn{cursor:pointer;color:#575195;font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li[role=option][aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div[role=option][aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper li[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper li.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper div[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:#6b6b6b;font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper li[role=option].focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper div[role=option].focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused,wm-tag-input .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li[role=option].focused,wm-tag-input .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li.add-new-btn.focused,wm-tag-input .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div[role=option].focused,wm-tag-input .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div.add-new-btn.focused{outline:none;background:#f4f4f4}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text,wm-tag-input .dropdown-wrapper li.help-text,wm-tag-input .dropdown-wrapper div.help-text{color:#4a4a4a;height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child),wm-tag-input .dropdown-wrapper li:not(:last-child),wm-tag-input .dropdown-wrapper div:not(:last-child){border-bottom:2px solid rgba(46, 27, 70, 0.05)}:host .info-text,wm-tag-input .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper,wm-tag-input .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table,wm-tag-input .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths,wm-tag-input .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers,wm-tag-input .table-wrapper #table .headers{height:2.5rem;background-color:#eeedf4}:host .table-wrapper #table .headers th,wm-tag-input .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even),wm-tag-input .table-wrapper tr:nth-child(even){background-color:#fafafa}:host .table-wrapper tr.selected,wm-tag-input .table-wrapper tr.selected{background-color:rgba(25, 161, 169, 0.2);-webkit-box-shadow:inset 0 0 0 1px #19a1a9;box-shadow:inset 0 0 0 1px #19a1a9;font-weight:500}:host .table-wrapper tr.focused:not(.locked),:host .table-wrapper tr:hover:not(.locked),wm-tag-input .table-wrapper tr.focused:not(.locked),wm-tag-input .table-wrapper tr:hover:not(.locked){background-color:#e9e7ec;-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td,wm-tag-input .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before,wm-tag-input .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:#4a4a4a}:host .table-wrapper td,wm-tag-input .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused,wm-tag-input .table-wrapper td.focused{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e;box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e}:host .table-wrapper td .cell-content-wrapper.trunc,wm-tag-input .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .table-wrapper td .description,wm-tag-input .table-wrapper td .description{display:none}:host .no-results,wm-tag-input .no-results{padding:1.25rem 1.5rem}:host .sr-only,wm-tag-input .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}:host #error,wm-tag-input #error{display:block;font-style:italic;color:#c0392b;font-size:0.875rem;margin-top:0.25rem}';export{b as wm_tag_input}
|
|
1
|
+
import{r as t,c as e,f as i,h as r,H as s,g as a}from"./p-b5dee715.js";import{g as o,d as n,r as h,i as l,u as d,v as p,j as c,k as w,s as g,n as m}from"./p-5384856b.js";import{g as u}from"./p-7ee31208.js";const b=class{constructor(r){t(this,r),this.wmTagInputChanged=e(this,"wmTagInputChanged",7),this.uid=this.el.id?this.el.id:o(),this.openUp=!1,this.debouncedUpdate=n((()=>i(this.el)),30),this.label=void 0,this.labelPosition="top",this.options="",this.selectedTags="",this.info=void 0,this.errorMessage=void 0,this.addNew=!0,this.placeholder=void 0,this.requiredField=!1,this.characterLimit=50,this.maxTags=void 0,this.tagInputType="dropdown",this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.messageConfig="",this.focusedListItem=void 0,this.focusedTag=null,this.tablePosition={row:0,column:1},this.isExpanded=!1,this.tagsList=h(this.selectedTags),this.optionsList=h(this.options),this.charCount=0,this.liveRegionMessage=""}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("open")}get focusedElement(){return this.el.shadowRoot.activeElement}get listItemEls(){return Array.from(this.dropdownEl.querySelectorAll("li"))}get tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get nonLockedTagEls(){return this.tagEls.filter((t=>!t.classList.contains("locked")))}get optionEls(){return Array.from(this.dropdownEl.querySelectorAll(".option"))}get wmRowEls(){return Array.from(this.el.querySelectorAll("wm-tag-input-row"))}get localRowEls(){return Array.from(this.el.shadowRoot.querySelectorAll("tr"))}get filteredRows(){return this.wmRowEls.filter((t=>{const e=[t.col1,t.col2,t.col3,t.col4].join("").toLowerCase();return!this.inputEl||!this.inputEl.value||e.includes(this.inputEl.value.toLowerCase())}))}get nonLockedTagsList(){let t=[];return"table"===this.tagInputType?this.tagsList.forEach((e=>{this.wmRowEls.filter((t=>e===t.id))[0].locked||t.push(e)})):"dropdown"===this.tagInputType&&(t=this.tagsList),t}get tagLimitReached(){return!!(this.maxTags&&this.tagsList.length>=this.maxTags)}get noResultsMessage(){return l.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get componentMessages(){const t={addNewHelpText:l.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),selectionHelpText:l.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),maxTagsReached:l.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),tagAreaInstructions:l.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),tagsAdded:l.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"For the user to understand how close they are to the tag limit, followed by x/y count"})},e=d(this.messageConfig);return e?Object.assign(Object.assign({},t),e):t}get inputMinimumWidth(){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this.tagEls[this.tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,p(this.inputEl,this.placeholder).width+i)}generateTagAddedMessage(t){return l.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}generateTagAlreadyAddedMessage(t){return l.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,!!this.options)),this.label||console.error("wm-tag-input must have a label property"),this.consolidateSelectedTags(),this.el.focus=()=>{const t=this.nonLockedTagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}componentDidLoad(){this.tagEls.forEach((t=>t.classList.remove("highlight")))}componentDidRender(){this.positionInput(),this.tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,s=i.getBoundingClientRect().right-10-8-28;let a=t.dataset.tag;if("table"===this.tagInputType){const t=this.el.querySelector(`#${a}`);a=t?t.col1:""}e.textContent=c(e,a,s-r,5)}))}consolidateSelectedTags(){this.tagsList.forEach((t=>{this.includesCaseInsensitive(this.optionsList,t)||(this.options+=`${this.options.length>0?",":""}${t}`)})),this.optionsList=h(this.options)}createPlaceholderDefault(t,e){const i=l.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=l.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),s=l.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let a="";return t&&e?a=i:!t&&e?a=r:t&&(a=s),a}reflectSelectedTags(t,e){let i="",r=this.tagsList;i=t.length>e.length?t.filter((t=>!e.includes(t)))[0]:e.filter((e=>!t.includes(e)))[0],"table"===this.tagInputType&&(i=this.wmRowEls.filter((t=>t.id===i))[0],r=this.tagsList.map((t=>this.el.querySelector(`#${t}`)))),this.selectedTags=this.listToCSV(this.tagsList),this.wmTagInputChanged.emit({value:r,tagChanged:i})}handleErrorMessageChange(){this.errorMessage&&this.announce(this.errorMessage)}handleRowUpdate(){i(this.el)}closeIfNotElOrChild(t){const e=t.target!==this.el&&!this.el.shadowRoot.contains(t.target);"dropdown"===this.tagInputType&&e&&this.isExpanded&&this.closeDropdown()}dismissTooltip(){this.tooltipVisible&&w()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.inputEl.value.length>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.inputEl.value.length,this.characterLimit)),t.stopPropagation(),t.key){case"Enter":case",":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":"table"===this.tagInputType&&this.tablePosition.row&&(t.preventDefault(),this.moveLeftCell());break;case"ArrowRight":"table"===this.tagInputType&&this.tablePosition.row&&(t.preventDefault(),this.moveRightCell());break;case"Escape":"dropdown"===this.tagInputType&&this.isExpanded&&this.closeDropdown();break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){"dropdown"===this.tagInputType&&(this.openDropdown(),this.clearListItemFocus()),i(this.el)}handleInputChanged(t){this.charCount=t.length,"dropdown"===this.tagInputType?(this.clearListItemFocus(),this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown()):"table"===this.tagInputType&&this.clearCellFocus(),this.announceExistingOptions()}handleInputEnter(){"dropdown"===this.tagInputType?this.focusedListItem?this.handleListItemClick(this.focusedListItem):this.submitInput(this.addNew,this.inputEl.value.trim()):"table"===this.tagInputType&&this.tablePosition.row>0&&this.handleTableRowClick(this.localRowEls[this.tablePosition.row].id)}submitInput(t,e){const i=e.match(/\S/);t&&i&&(this.addTag(e),this.optionsList=this.addOption(e),this.resetInput())}handleInputArrowDown(){"table"===this.tagInputType?this.moveDownRow():"dropdown"===this.tagInputType&&this.isExpanded?this.moveDownListItem():"dropdown"===this.tagInputType&&this.openDropdown()}handleInputArrowUp(){"table"===this.tagInputType?this.moveUpRow():"dropdown"===this.tagInputType&&this.isExpanded?this.moveUpListItem():"dropdown"===this.tagInputType&&this.openDropdown()}handleInputBackspace(){""===this.inputEl.value&&this.tagsList.length>0&&window.requestAnimationFrame((()=>{this.nonLockedTagsList.length>0&&(this.tagAreaEl.focus(),this.focusTag(this.tagEls[this.tagEls.length-1]))}))}handleListItemKeyDown(t){const e=t.target;switch(t.key){case"Enter":case" ":t.preventDefault(),e.click();break;case"ArrowDown":t.preventDefault(),this.moveDownListItem();break;case"ArrowUp":t.preventDefault(),this.moveUpListItem();break;case"Escape":this.focusedElement!==this.inputEl?this.inputEl.focus():"dropdown"===this.tagInputType&&this.closeDropdown()}}handleListItemClick(t){const e=t.dataset.option.trim()||"";this.includesCaseInsensitive(this.tagsList,e)?this.announce(this.generateTagAlreadyAddedMessage(e)):(this.resetInput(),this.addTag(e),this.optionsList=this.addOption(e),this.focusedListItem=null)}handleTableRowClick(t){this.el.querySelector(`#${t}`).locked||(this.includesCaseInsensitive(this.tagsList,t)?this.removeTag(t):this.tagLimitReached||(this.addTag(t),this.resetInput()))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.moveLeftTag();break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.moveRightTag();break;case"Backspace":case"Delete":this.handleTagAreaDelete()}}handleTagAreaDelete(){const t=this.focusedTag&&this.focusedTag.classList.contains("locked");this.focusedTag&&!t&&(this.removeTag(this.focusedTag.dataset.tag),0===this.nonLockedTagsList.length?this.inputEl.focus():(this.focusedTag=this.focusedTag===this.tagEls[this.tagEls.length-1]?this.tagEls[this.tagEls.length-2]:this.focusedTag,this.focusTag(this.focusedTag)))}handleBlur(t,e){const i=t.relatedTarget!==e&&!this.el.shadowRoot.contains(t.relatedTarget);this.dismissTooltip(),this.clearCellFocus(),i&&(this.fieldWrapperEl.classList.remove("focused"),"dropdown"===this.tagInputType&&this.closeDropdown())}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&g("bottom",e,e.innerText)}handleTagAreaFocus(){"dropdown"===this.tagInputType&&this.closeDropdown();const t=this.nonLockedTagEls[0];t&&this.focusTag(t)}handleRemoveButtonClick(t){this.moveLeftTag(),this.removeTag(t)}moveDownListItem(){if(this.listItemEls.length>0){this.focusListItem(this.focusedListItem&&this.focusedListItem.nextElementSibling?this.focusedListItem.nextElementSibling:this.listItemEls[0])}}moveUpListItem(){if(this.listItemEls.length>0){const t=this.listItemEls[this.listItemEls.length-1];this.focusedListItem?this.focusedListItem.previousElementSibling?this.focusListItem(this.focusedListItem.previousElementSibling):this.clearListItemFocus():this.focusListItem(t)}}moveDownRow(){this.filteredRows.length>0&&(0===this.tablePosition.row||this.tablePosition.row===this.filteredRows.length?this.tablePosition.row=1:this.tablePosition.row++,this.wmRowEls[this.tablePosition.row-1].locked?this.moveDownRow():this.focusCell(this.tablePosition))}moveUpRow(){if(this.filteredRows.length>0){0===this.tablePosition.row?this.tablePosition.row=this.filteredRows.length:1===this.tablePosition.row?this.tablePosition.row=0:this.tablePosition.row--;const t=this.wmRowEls[this.tablePosition.row-1];t&&t.locked?this.moveUpRow():t?this.focusCell(this.tablePosition):this.clearCellFocus()}}moveLeftCell(){1!=this.tablePosition.column&&(this.tablePosition.column--,this.focusCell(this.tablePosition))}moveRightCell(){const t=h(this.colHeaders).length;this.tablePosition.column<t&&(this.tablePosition.column++,this.focusCell(this.tablePosition))}moveLeftTag(){const t=this.tagEls[this.tagEls.length-1];this.focusedTag=this.focusedTag&&this.tagEls.includes(this.focusedTag.previousElementSibling)?this.focusedTag.previousElementSibling:t,this.focusedTag.classList.contains("locked")&&this.nonLockedTagEls.length>0?this.moveLeftTag():this.focusTag(this.focusedTag)}moveRightTag(){const t=this.tagEls[0];this.focusedTag=this.focusedTag&&this.tagEls.includes(this.focusedTag.nextElementSibling)?this.focusedTag.nextElementSibling:t,this.focusedTag.classList.contains("locked")?this.moveRightTag():this.focusTag(this.focusedTag)}addOption(t){let e=this.optionsList;return this.includesCaseInsensitive(this.optionsList,t)||(e=e.concat(t)),e}removeOption(t){this.optionsList=this.filterCaseInsensitive(this.optionsList,t)}addTag(t){let e=this.tagsList;const i=this.includesCaseInsensitive(this.tagsList,t),r=this.optionsList.filter((e=>e.toLowerCase()===t.toLowerCase()))[0];if(!i){let i=t;"table"===this.tagInputType&&(i=this.el.querySelector(`#${t}`).col1),this.announce(this.generateTagAddedMessage(i)),this.tagsList=e.concat(r||t),this.tagLimitReached&&this.tagAreaEl.focus()}}removeTag(t){let e=t;"table"===this.tagInputType&&(e=this.el.querySelector(`#${t}`).col1);const i=l.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tag} removed"},{tag:e});if(this.announce(i),this.tagsList=this.filterCaseInsensitive(this.tagsList,t),"dropdown"===this.tagInputType){const e=h(this.options);this.includesCaseInsensitive(this.optionsList,t)&&!this.includesCaseInsensitive(e,t)&&this.removeOption(t)}}focusListItem(t){this.focusedListItem=t,this.inputEl.setAttribute("aria-activedescendant",this.focusedListItem.id),t.scrollIntoView({block:"nearest"})}focusTag(t){t.classList.contains("locked")?(this.focusedTag=null,this.tagAreaEl.setAttribute("aria-activedescendant","")):(this.focusedTag=t,this.tagAreaEl.setAttribute("aria-activedescendant",this.focusedTag.id)),window.requestAnimationFrame((()=>{w();const e=t.querySelector(".tag-text"),i=t.dataset.tag;i!==e.textContent&&e.textContent.includes("...")&&g("bottom",t,i)}))}focusCell(t){if(this.clearCellFocus(!1),t.row){const e=this.localRowEls[t.row],i=e.querySelectorAll("td")[t.column-1],r=i.querySelector(".cell-content-wrapper"),s=r.scrollWidth>r.clientWidth;e.classList.add("focused"),i.classList.add("focused"),i.scrollIntoView({block:"nearest"}),this.inputEl.setAttribute("aria-activedescendant",i.id),this.dismissTooltip(),s&&g("bottom",i,i.innerText)}}clearTagFocus(){this.tagAreaEl.setAttribute("aria-activedescendant",""),this.focusedTag=null}clearCellFocus(t=!0){this.inputEl.setAttribute("aria-activedescendant",""),t&&(this.tablePosition={row:0,column:1}),this.localRowEls.forEach((t=>{t.classList.remove("focused"),t.querySelectorAll("td").forEach((t=>{t.classList.remove("focused")}))}))}openDropdown(){this.openUp=m(this.el,this.dropdownEl,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearListItemFocus(),this.isExpanded=!1}clearListItemFocus(){this.focusedListItem=null,this.inputEl.setAttribute("aria-activedescendant",""),this.listItemEls.forEach((t=>{t.classList.remove("focused")}))}resetInput(){this.charCount=0,this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}announceExistingOptions(){window.requestAnimationFrame((()=>{let t=0;"dropdown"===this.tagInputType?t=this.optionEls.length:"table"===this.tagInputType&&(t=this.filteredRows.length);const e=l.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:t});this.announce(e)}))}generateCharacterLimitWarning(t,e){let i=u.getCharactersEntered(t,e);return t>=e&&(i+=` ${u.characterLimitReached}`),i}positionInput(){const t=this.tagEls[this.tagEls.length-1];this.inputEl.style.position="static",this.inputEl.style.width="100%",t&&this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right-8).toString()+"px")}handleTagMouseEnter(t){const e=t.target.querySelector(".tag-text").textContent,i=t.target.dataset.tag;e!==i&&e.includes("...")&&g("bottom",t.target,i)}listToCSV(t){return t.join(",")}includesCaseInsensitive(t,e){return t.map((t=>t.toLowerCase())).includes(e.toLowerCase())}filterCaseInsensitive(t,e){return t.filter((t=>t.toLowerCase()!==e.toLowerCase()))}sortCaseInsensitive(t){return t.sort(((t,e)=>(t=t.toLowerCase())>(e=e.toLowerCase())?1:t<e?-1:0))}renderTags(){let t=[],e=[];return this.tagsList.forEach(((i,s)=>{const a=`tag${s+1}`;let o="",n=!1;if("dropdown"===this.tagInputType)o=i;else if("table"===this.tagInputType){const t=this.el.querySelector(`#${i}`);o=t?t.col1:"",n=!!t&&t.locked}(n?t:e).push(r("li",{id:a,class:`tag highlight ${this.focusedTag&&this.focusedTag.id===a?"focused":""} ${n?"locked":""}`,"data-tag":i,role:"option",onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:w},r("span",{class:"sr-only"},i),r("span",{class:"tag-text","aria-hidden":"true"},o),n?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>this.handleRemoveButtonClick(i)})))})),[...t,...e]}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":!!this.isExpanded&&"true","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.renderListItems(this.optionsList)))}renderListItems(t){return t=this.sortCaseInsensitive(t),this.inputEl&&this.inputEl.value&&(t=this.optionsList.filter((t=>t.toLowerCase().includes(this.inputEl.value.toLowerCase())))),t.map(((t,e)=>{const i=`option${e+1}`,s=this.focusedListItem&&this.focusedListItem.id===i,a=this.includesCaseInsensitive(this.tagsList,t);return r("li",{class:"option "+(s?"focused":""),role:"option",id:i,"data-option":t,"aria-selected":a?"true":"false","aria-disabled":a?"true":"false",onKeyDown:t=>this.handleListItemKeyDown(t),onBlur:t=>this.handleBlur(t,this.el),onClick:t=>this.handleListItemClick(t.target)},t)}))}renderAddNewButton(){const t=this.inputEl.value.match(/\S/),e=this.includesCaseInsensitive(this.optionsList,this.inputEl.value.trim());if(this.addNew&&t&&!e){const t="add-new-btn",e=this.focusedListItem&&this.focusedListItem.id===t;return r("li",{role:"option",class:"add-new-btn "+(e?"focused":""),id:t,"data-option":this.inputEl.value,onKeyDown:t=>this.handleListItemKeyDown(t),onBlur:t=>this.handleBlur(t,this.el),onClick:t=>this.handleListItemClick(t.target),tabIndex:e?0:-1},`Add "${this.inputEl.value.trim()}"`)}return""}renderHelpText(){let t="";return this.optionsList.length>0&&(t+=this.componentMessages.selectionHelpText),this.addNew&&(t+=" "+this.componentMessages.addNewHelpText),t}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},`${this.componentMessages.tagsAdded}: ${this.tagsList.length}/${this.maxTags}`,this.tagLimitReached&&` - ${this.componentMessages.maxTagsReached}`))}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredRows.length?this.renderTableRows():r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},h(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&h(this.colWrap)[e]&&(i=h(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?h(this.colWidths)[e]:""},t)})))}renderTableRows(){return this.filteredRows.map((t=>{const e=this.includesCaseInsensitive(this.tagsList,t.id);return r("tr",{id:t.id,class:`${t.locked?"locked":""} ${e?"selected":""}`,role:"row",onClick:()=>this.handleTableRowClick(t.id)},this.renderTableCells(t))}))}renderTableCells(t){const e=[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)),i=this.includesCaseInsensitive(this.tagsList,t.id);return e.map(((e,s)=>{const a=`${t.id}-col${s+1}`;let o="wrap";return this.colWrap&&h(this.colWrap)[s]&&(o=h(this.colWrap)[s]),r("td",{id:a,role:"gridcell","aria-describedby":`${a}-description`,"aria-selected":i.toString(),onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>this.dismissTooltip()},r("div",{class:`cell-content-wrapper ${o}`},e),r("div",{class:"description",id:`${a}-description`},t.locked?"locked":""))}))}render(){return r(s,{id:this.uid},r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:`input${this.uid}`},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.focusedElement?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper"},this.tagsList.length>0&&r("ul",{ref:t=>this.tagAreaEl=t,class:"tag-area",role:"listbox","aria-activedescendant":"","aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagsList.length>0?this.componentMessages.tagAreaInstructions:""}`,tabindex:this.nonLockedTagsList.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:()=>this.handleTagAreaFocus(),onBlur:t=>{this.clearTagFocus(),this.handleBlur(t,this.el)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:`input${this.uid}`,class:this.tagLimitReached?"hidden":"",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":"help-text"+(this.errorMessage?" error ":""),"aria-label":`${this.label} ${"dropdown"===this.tagInputType?u.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":"dropdown"===this.tagInputType?this.isExpanded.toString():null,placeholder:this.placeholder,maxLength:"dropdown"===this.tagInputType?this.characterLimit:void 0,onInput:()=>this.handleInputChanged(this.inputEl.value),onBlur:t=>{this.handleBlur(t,this.el)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),"dropdown"===this.tagInputType&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),"dropdown"===this.tagInputType&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),this.errorMessage&&r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"assertive",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),"table"===this.tagInputType&&this.renderTable()))}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{tagsList:["reflectSelectedTags"],errorMessage:["handleErrorMessageChange"]}}};b.style=':host,wm-tag-input{font-family:inherit;width:100%;display:block;max-height:80vh}:host *,wm-tag-input *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper,wm-tag-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-tag-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-tag-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-tag-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-tag-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-tag-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-tag-input .wrapper.label-none label{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}:host .wrapper.invalid .label,wm-tag-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-tag-input .wrapper.invalid .label: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:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-tag-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-tag-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-tag-input .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper,wm-tag-input .field-wrapper{position:relative;width:100%;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused,wm-tag-input .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px #19a1a9;-moz-box-shadow:0 0 0 1px #19a1a9;box-shadow:0 0 0 1px #19a1a9;outline:none;border-color:#19a1a9}:host .field-wrapper.invalid,wm-tag-input .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px #c0392b;-moz-box-shadow:0 0 0 1px #c0392b;box-shadow:0 0 0 1px #c0392b;border-color:#c0392b}:host .character-count,wm-tag-input .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper,wm-tag-input .tags-and-input-wrapper{position:relative;width:100%;padding:0.5rem 0.25rem 0.5rem 0;margin-bottom:-0.5rem;overflow:hidden}:host .upper-row,wm-tag-input .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before,wm-tag-input .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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:"\\f349";color:#b5b5b5;padding:0.75rem 0.5rem 0.75rem 0.75rem}:host .lower-row,wm-tag-input .lower-row{width:100%;min-height:1.875rem}:host #max-tags,wm-tag-input #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:#e6e6e6;padding:0.5rem 1rem;color:#4a4a4a;font-size:0.875rem;border-top:1px solid rgba(35, 35, 35, 0.6);border-radius:0 0 3px 3px}:host .tag-area,wm-tag-input .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0}:host .tag-area:focus,wm-tag-input .tag-area:focus{outline:none}:host .tag-area [role=option],wm-tag-input .tag-area [role=option]{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:#4a4a4a;background-color:rgba(3, 0, 0, 0.1);padding:0.5rem 0.625rem;margin-bottom:0.5rem;margin-right:0.25rem;margin-left:0.25rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area [role=option].highlight,wm-tag-input .tag-area [role=option].highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}@keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}:host .tag-area [role=option].focused,wm-tag-input .tag-area [role=option].focused{background-color:#d1d1d1}:host .tag-area [role=option].locked,wm-tag-input .tag-area [role=option].locked{background-color:#6b6b6b;color:white}:host .tag-area [role=option] .icon,wm-tag-input .tag-area [role=option] .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area [role=option] .icon.remove-btn,wm-tag-input .tag-area [role=option] .icon.remove-btn{border:1px solid #575195;color:#575195;border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 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)}:host .tag-area [role=option] .icon.remove-btn:hover,wm-tag-input .tag-area [role=option] .icon.remove-btn:hover{color:white;background-color:#575195}:host .tag-area [role=option] .icon.remove-btn:before,wm-tag-input .tag-area [role=option] .icon.remove-btn: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:"\\f156"}:host .tag-area [role=option] .icon.lock,wm-tag-input .tag-area [role=option] .icon.lock{color:white}:host .tag-area [role=option] .icon.lock:before,wm-tag-input .tag-area [role=option] .icon.lock: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:"\\f341"}:host input,wm-tag-input input{font-family:inherit;border:none;height:1.75rem;padding:0;margin-bottom:0.5rem;margin-right:0.25rem;padding-left:0.5rem;right:0px}:host input.hidden,wm-tag-input input.hidden{display:none}:host input:focus,wm-tag-input input:focus{outline:none}:host .dropdown-wrapper,wm-tag-input .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;background:#fff;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown,wm-tag-input .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open,wm-tag-input .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards,wm-tag-input .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div,wm-tag-input .dropdown-wrapper li,wm-tag-input .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:#fff;list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li[role=option],:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div[role=option],:host .dropdown-wrapper div.add-new-btn,wm-tag-input .dropdown-wrapper li[role=option],wm-tag-input .dropdown-wrapper li.add-new-btn,wm-tag-input .dropdown-wrapper div[role=option],wm-tag-input .dropdown-wrapper div.add-new-btn{cursor:pointer;color:#575195;font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li[role=option][aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div[role=option][aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper li[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper li.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper div[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:#6b6b6b;font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper li[role=option].focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper div[role=option].focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused,wm-tag-input .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li[role=option].focused,wm-tag-input .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li.add-new-btn.focused,wm-tag-input .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div[role=option].focused,wm-tag-input .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div.add-new-btn.focused{outline:none;background:#f4f4f4}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text,wm-tag-input .dropdown-wrapper li.help-text,wm-tag-input .dropdown-wrapper div.help-text{color:#4a4a4a;height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child),wm-tag-input .dropdown-wrapper li:not(:last-child),wm-tag-input .dropdown-wrapper div:not(:last-child){border-bottom:2px solid rgba(46, 27, 70, 0.05)}:host .info-text,wm-tag-input .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper,wm-tag-input .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table,wm-tag-input .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths,wm-tag-input .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers,wm-tag-input .table-wrapper #table .headers{height:2.5rem;background-color:#eeedf4}:host .table-wrapper #table .headers th,wm-tag-input .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even),wm-tag-input .table-wrapper tr:nth-child(even){background-color:#fafafa}:host .table-wrapper tr.selected,wm-tag-input .table-wrapper tr.selected{background-color:rgba(25, 161, 169, 0.2);-webkit-box-shadow:inset 0 0 0 1px #19a1a9;box-shadow:inset 0 0 0 1px #19a1a9;font-weight:500}:host .table-wrapper tr.focused:not(.locked),:host .table-wrapper tr:hover:not(.locked),wm-tag-input .table-wrapper tr.focused:not(.locked),wm-tag-input .table-wrapper tr:hover:not(.locked){background-color:#e9e7ec;-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td,wm-tag-input .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before,wm-tag-input .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:#4a4a4a}:host .table-wrapper td,wm-tag-input .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused,wm-tag-input .table-wrapper td.focused{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e;box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e}:host .table-wrapper td .cell-content-wrapper.trunc,wm-tag-input .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .table-wrapper td .description,wm-tag-input .table-wrapper td .description{display:none}:host .no-results,wm-tag-input .no-results{padding:1.25rem 1.5rem}:host .sr-only,wm-tag-input .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}:host #error,wm-tag-input #error{display:block;font-style:italic;color:#c0392b;font-size:0.875rem;margin-top:0.25rem}';export{b as wm_tag_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-c4ca5d46.system.js","./p-f5df5903.system.js","./p-190afa40.system.js","./p-9d02957d.system.js"],(function(t){"use strict";var e,r,n,o,i,s,a,u,c,l;return{setters:[function(t){e=t.r;r=t.c;n=t.h;o=t.H;i=t.g},function(t){s=t.a},function(t){a=t.l;u=t.m;c=t.i},function(t){l=t.g}],execute:function(){var p=":host,wm-navigator{min-width:0;position:relative;display:inline-block}:host .wrapper,wm-navigator .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:#fff;letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user,wm-navigator .wrapper .user{background:#f4f4f4;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p,wm-navigator .wrapper .user p{margin:0}:host .wrapper .user p:first-child,wm-navigator .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2,wm-navigator .wrapper h2{background:#2e1b46;color:#fff;font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox],wm-navigator .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide,wm-navigator .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right,wm-navigator .wrapper.right{right:auto;left:20px}:host img,wm-navigator img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout,wm-navigator .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var f=t("wm_navigator",function(){function t(t){e(this,t);this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,l("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=s(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[a(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=u(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var n=this.itemIndexToFocus;this.itemIndexToFocus=u(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(n);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return n("div",{class:"user",id:"wm-nav-user","aria-label":c.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},n("p",null,this.userName),n("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return c.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return c.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return n("h2",null,c.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return n("ul",{role:"listbox","aria-label":"".concat(c.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,o,i,s;r=e.name;o=e.iconUrl;s=t.setProductOnClick(e.id);if(!!r&&!!o){i=t.currentProductId===e.id;return n("priv-navigator-item",{selected:i,id:e.id,onClick:s,role:"option","aria-label":r},n("img",{src:o,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return n("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},n("span",{class:"logout"},c.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?n(o,{class:this.isTabbing?"user-is-tabbing":""},n("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),n("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());f.style=p}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-c4ca5d46.system.js","./p-08b7ec08.system.js","./p-9e94ae94.system.js","./p-313b6073.system.js"],(function(t){"use strict";var e,r,n,o,i,s,a,u,c,l;return{setters:[function(t){e=t.r;r=t.c;n=t.h;o=t.H;i=t.g},function(t){s=t.a},function(t){a=t.l;u=t.m;c=t.i},function(t){l=t.g}],execute:function(){var p=":host,wm-navigator{min-width:0;position:relative;display:inline-block}:host .wrapper,wm-navigator .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:#fff;letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user,wm-navigator .wrapper .user{background:#f4f4f4;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p,wm-navigator .wrapper .user p{margin:0}:host .wrapper .user p:first-child,wm-navigator .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2,wm-navigator .wrapper h2{background:#2e1b46;color:#fff;font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox],wm-navigator .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide,wm-navigator .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right,wm-navigator .wrapper.right{right:auto;left:20px}:host img,wm-navigator img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout,wm-navigator .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var f=t("wm_navigator",function(){function t(t){e(this,t);this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,l("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=s(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[a(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=u(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var n=this.itemIndexToFocus;this.itemIndexToFocus=u(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(n);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return n("div",{class:"user",id:"wm-nav-user","aria-label":c.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},n("p",null,this.userName),n("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return c.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return c.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return n("h2",null,c.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return n("ul",{role:"listbox","aria-label":"".concat(c.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,o,i,s;r=e.name;o=e.iconUrl;s=t.setProductOnClick(e.id);if(!!r&&!!o){i=t.currentProductId===e.id;return n("priv-navigator-item",{selected:i,id:e.id,onClick:s,role:"option","aria-label":r},n("img",{src:o,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return n("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},n("span",{class:"logout"},c.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?n(o,{class:this.isTabbing?"user-is-tabbing":""},n("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),n("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());f.style=p}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{l(a.next(t))}catch(t){i(t)}}function o(t){try{l(a["throw"](t))}catch(t){i(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,n=e.length,i;a<n;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};System.register(["./p-c4ca5d46.system.js","./p-190afa40.system.js"],(function(t){"use strict";var e,r,a,n,i,s;return{setters:[function(t){e=t.h},function(t){r=t.i;a=t.c;n=t.b;i=t.f;s=t.d}],execute:function(){t({b:f,c:K,d:L,e:P,f:U,g:B,h:M,i:H,j:X,k:A,l:q,r:N});var o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var l=t("a",{doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}});function c(t){return t==="percentage"||t==="amount"?"show-values":""}var u=r.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var h=r.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function d(t){return t>999?Math.round(t/100)/10+"K":t}function f(t,e,r){return r?Math.round(t*100/e):Math.round(t*1e4/e)/100}function p(t,e){return t*360/e}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,e,r,a){var n=v(t+t*e*Math.cos(Math.PI*r/180));var i=v(t+t*e*Math.sin(Math.PI*r/180));if(a!==undefined){var s=v(t+t*e*Math.cos(Math.PI*a/180));var o=v(t+t*e*Math.sin(Math.PI*a/180));return{x1:n,y1:i,x2:s,y2:o}}return{x:n,y:i}}function m(t,e,r,a,n){var i=v(n/2*t);return"A ".concat(i,", ").concat(i," 0 ").concat(e," ").concat(v(r),", ").concat(v(a))}function b(t,e,r,a,n){var i=(t-e)*(n-a)/(r-e)+a;return i<a?a:i>n?n:i}function y(t){return b(t,300,900,70,150)}function w(t){return Math.round(t/y(t))}function x(t,e){var r=t/e;var a=Math.pow(10,Math.floor(Math.log10(r)));var n=r/a;var i;if(n>5){i=10*a}else if(n>3){i=5*a}else if(n>2){i=3*a}else if(n>1.5){i=2*a}else if(n>1){i=1.5*a}else{i=a}return i}function k(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var e=this.popoverEl.querySelector("button");e&&e.click()}}function E(t,e){if(this.popoverEl&&!this.isTabbing){e.coords={x:t.clientX,y:t.clientY};z.call(this,e)}}function D(t,e){if(this.popoverEl&&this.isTabbing){e.coords=n(t.target);z.call(this,e)}}function M(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;_.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;T.call(this);break;case"Tab":A.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function z(t){var e=this;if(!!this.popoverEl&&!!t.title&&!!t.text){this.popoverEl.popoverTitle=t.title;this.popoverEl.popoverText=t.text;this.popoverEl.buttonText=t.buttonText;this.popoverEl.coords=t.coords;this.popoverEl.sliceRef=t.sliceRef;window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),30);var r=s((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=i(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function T(){var t=a(document.activeElement);var e=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;C.call(this,e)}function _(){if(this.sliceEls){var t=a(document.activeElement);var e=this.sliceEls.indexOf(t);if(e===-1){e=0}else if(e===0){e=this.sliceEls.length-1}else{e-=1}C.call(this,e)}}function C(t){var e=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),10)}}function A(){var t=this;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function B(t){return __awaiter(this,void 0,void 0,(function(){var e,r;var a=this;return __generator(this,(function(n){this.slicesDetails=[];e=0;r=Array.from(this.el.children);this.total=r.reduce((function(t,e){return t+=parseInt(e.getAttribute("amount")||"0")}),0);r.forEach((function(r,n){var i=parseInt(r.getAttribute("amount")||"0");var s=f(i,a.total,true);var c=n;if(t==="bar5"){c=a.notStartedColor?n:n+1}if(t==="bar6"){c=0}var u=l[t].colors[c];var h={amount:i,perc:s,legend:r.getAttribute("legend"),color:u||o.gray,offset:e,id:"".concat(a.uid,"-").concat(n+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};e+=i;a.slicesDetails.push(h)}));return[2]}))}))}function I(t,e){var r=__spreadArray([],t,true).sort((function(t,e){return t.amount===e.amount?0:t.amount>e.amount?-1:1}));var a=0;r.forEach((function(t,n){var i=r[n===0?r.length-1:n-1];var s=r[n===r.length-1?0:n+1];var o=f(i.amount,e,true);var l=f(s.amount,e,true);t.offset=a;a+=t.amount;t.inSmallCluster=S(o,t.perc,t.amount,l)}));return r}function S(t,e,r,a){var n=e<4;var i=t<5;var s=a<5;var o=n&&(i||s);var l=e===0&&r>0;if(l&&(a<8||t<8)){o=true}return o}function F(t,e,r){var a=p(e,this.total)-90;var n=t/this.total*360;var i=a+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(n===360){i-=.01}var v=g(l,u,a+d,i);var b=g(l,c,a+f,i);var y="M ".concat(v.x1,", ").concat(v.y1," ");var w=m(u,s,v.x2,v.y2,this.chartDetails.size);var x=" L ".concat(b.x2,", ").concat(b.y2," ");var k=m(c,o,b.x1,b.y1,this.chartDetails.size);return y+w+x+k+" z"}function P(){var t=r.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return e("div",{id:"chart-instructions"},t)}function V(){return e("defs",null,e("filter",{id:"wmHoverDropShadow"},e("feGaussianBlur",{stdDeviation:"3"}),e("feOffset",{result:"offsetblur"}),e("feFlood",{"flood-color":"#333"}),e("feComposite",{operator:"in",in2:"offsetblur"}),e("feMerge",null,e("feMergeNode",null),e("feMergeNode",{in:"SourceGraphic"}))))}function L(t){var r=this;var a=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut0"||t==="doughnut";var i=n?this.slicesDetails:I(this.slicesDetails,this.total);return e("div",{class:"chart-wrapper doughnut-wrapper"},e("svg",{width:a+"px",height:a+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},V(),i.map((function(e){return R.call(r,e,t)})),n?e("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},f(i[0].amount,this.total,true)+"%"):e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},i.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(r,t):""})))))}function R(t,r){var a=this;return e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},e("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:F.call(this,t.amount,t.offset,r),onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)},role:"img","aria-label":t.legend}))}function W(t){var r=p(t.offset+t.amount/2,this.total);var a=g(this.chartDetails.size/2,1.4,r-90),n=a.x,i=a.y;return e("text",{class:"value",x:n+"px",y:i+"px"},"".concat(t.perc>0?t.perc:"<1","%"))}function N(t){var r=this;var a=t==="bar1"||t==="bar";return e("div",{class:"chart-wrapper bar-wrapper"},a?e("div",{class:"single-perc"},f(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),e("div",{class:"inner-stacked-bar-wrapper ".concat(c(this.tempValueFormat))},!a?e("div",{class:"values"},this.slicesDetails.map((function(t,e){return r.renderBarText(t,e)}))):"",e("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t,e){return G.call(r,t,e)}))),a?H.call(this):""))}function G(t,r){var a=this;var n=r!==this.slicesDetails.length-1;var i="calc(".concat(f(t.amount,this.total,false),"%").concat(n?" - 2px":"",")");return e("div",{class:"segment stacked-bar-segment ".concat(f(t.amount,this.total,false)===0?"zero":""),style:{backgroundColor:t.color,width:i},onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)}},e("span",{class:"sr-only"},t.legend))}function K(t){var r=this;var a=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,e){return t>e?t:e}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var i=48;var s=this.el.getBoundingClientRect().width;var o=s-n-i;var l=w(o);var u=x(a,l);var h=l*u;var f=Math.floor((h-a)/u);l-=f;this.el.style.setProperty("--backgroundSize",100/l+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var p=[];this.slicesDetails.forEach((function(e){e.legend&&p.push(j(e.legend,r.showBarLegend,t));p.push(O.call(r,e,u,l,a))}));var v=[];for(var g=1;g<=l;g++){var m=d(g*u);v.push(e("div",{class:"tick"},e("span",null,m)))}var b=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return e("div",{class:"chart-wrapper simple-bar-wrapper"},e("div",{class:"chart ".concat(c(this.tempValueFormat))},b&&e("div",{class:"gridlines"}),e("div",{class:"rows"},p)),b&&e("div",{class:"x-axis","aria-hidden":"true"},e("div",{class:"zero"},e("span",null,"0")),v))}function j(t,r,a){var n=a==="bar7"&&!r?" hidden":"";return e("label",{class:"label".concat(n)},t)}function O(t,r,a,n){var i=this;var s=this.currentChartType==="bar6"?r*a:n;var o=f(t.amount,s,false);var l=o?o+"%":"1px";var c=d(t.amount);var u=this.tempValueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){u=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){u=f(t.amount,this.total,true)+"%"}return e("div",{class:"bar segment",style:{backgroundColor:t.color,width:l},onClick:function(e){return E.call(i,e,t)},onFocus:function(e){return D.call(i,e,t)},onKeyDown:function(t){return k.call(i,t)}},e("div",{class:"value"},u))}function U(t){if(this.showLegend){var r=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(t,e){return t=e.inSmallCluster?true:t}),false);return e("div",{class:"legend-wrapper"},e("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.total>0?this.slicesDetails.map((function(t){if(!!t.amount||!!t.legend){return q({key:t.legend,color:t.color})}})):""),r&&X())}}function q(t){return e("div",{class:"legend-item"},e("div",{class:"legend-color",style:{backgroundColor:t.color}}),e("div",{class:"legend-text"},t.key))}function H(){if(this.completionMessage){return e("div",{class:"completion-message"},this.completionMessage)}}function X(){return e("div",{class:"hidden-values-warning"},u,e("br",null),h)}}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{l(a.next(t))}catch(t){i(t)}}function o(t){try{l(a["throw"](t))}catch(t){i(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,n=e.length,i;a<n;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};System.register(["./p-c4ca5d46.system.js","./p-9e94ae94.system.js"],(function(t){"use strict";var e,r,a,n,i,s;return{setters:[function(t){e=t.h},function(t){r=t.i;a=t.c;n=t.b;i=t.f;s=t.d}],execute:function(){t({b:f,c:K,d:L,e:P,f:U,g:B,h:M,i:H,j:X,k:A,l:q,r:N});var o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var l=t("a",{doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}});function c(t){return t==="percentage"||t==="amount"?"show-values":""}var u=r.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var h=r.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function d(t){return t>999?Math.round(t/100)/10+"K":t}function f(t,e,r){return r?Math.round(t*100/e):Math.round(t*1e4/e)/100}function p(t,e){return t*360/e}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,e,r,a){var n=v(t+t*e*Math.cos(Math.PI*r/180));var i=v(t+t*e*Math.sin(Math.PI*r/180));if(a!==undefined){var s=v(t+t*e*Math.cos(Math.PI*a/180));var o=v(t+t*e*Math.sin(Math.PI*a/180));return{x1:n,y1:i,x2:s,y2:o}}return{x:n,y:i}}function m(t,e,r,a,n){var i=v(n/2*t);return"A ".concat(i,", ").concat(i," 0 ").concat(e," ").concat(v(r),", ").concat(v(a))}function b(t,e,r,a,n){var i=(t-e)*(n-a)/(r-e)+a;return i<a?a:i>n?n:i}function y(t){return b(t,300,900,70,150)}function w(t){return Math.round(t/y(t))}function x(t,e){var r=t/e;var a=Math.pow(10,Math.floor(Math.log10(r)));var n=r/a;var i;if(n>5){i=10*a}else if(n>3){i=5*a}else if(n>2){i=3*a}else if(n>1.5){i=2*a}else if(n>1){i=1.5*a}else{i=a}return i}function k(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var e=this.popoverEl.querySelector("button");e&&e.click()}}function E(t,e){if(this.popoverEl&&!this.isTabbing){e.coords={x:t.clientX,y:t.clientY};z.call(this,e)}}function D(t,e){if(this.popoverEl&&this.isTabbing){e.coords=n(t.target);z.call(this,e)}}function M(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;_.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;T.call(this);break;case"Tab":A.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function z(t){var e=this;if(!!this.popoverEl&&!!t.title&&!!t.text){this.popoverEl.popoverTitle=t.title;this.popoverEl.popoverText=t.text;this.popoverEl.buttonText=t.buttonText;this.popoverEl.coords=t.coords;this.popoverEl.sliceRef=t.sliceRef;window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),30);var r=s((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=i(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function T(){var t=a(document.activeElement);var e=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;C.call(this,e)}function _(){if(this.sliceEls){var t=a(document.activeElement);var e=this.sliceEls.indexOf(t);if(e===-1){e=0}else if(e===0){e=this.sliceEls.length-1}else{e-=1}C.call(this,e)}}function C(t){var e=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),10)}}function A(){var t=this;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function B(t){return __awaiter(this,void 0,void 0,(function(){var e,r;var a=this;return __generator(this,(function(n){this.slicesDetails=[];e=0;r=Array.from(this.el.children);this.total=r.reduce((function(t,e){return t+=parseInt(e.getAttribute("amount")||"0")}),0);r.forEach((function(r,n){var i=parseInt(r.getAttribute("amount")||"0");var s=f(i,a.total,true);var c=n;if(t==="bar5"){c=a.notStartedColor?n:n+1}if(t==="bar6"){c=0}var u=l[t].colors[c];var h={amount:i,perc:s,legend:r.getAttribute("legend"),color:u||o.gray,offset:e,id:"".concat(a.uid,"-").concat(n+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};e+=i;a.slicesDetails.push(h)}));return[2]}))}))}function I(t,e){var r=__spreadArray([],t,true).sort((function(t,e){return t.amount===e.amount?0:t.amount>e.amount?-1:1}));var a=0;r.forEach((function(t,n){var i=r[n===0?r.length-1:n-1];var s=r[n===r.length-1?0:n+1];var o=f(i.amount,e,true);var l=f(s.amount,e,true);t.offset=a;a+=t.amount;t.inSmallCluster=S(o,t.perc,t.amount,l)}));return r}function S(t,e,r,a){var n=e<4;var i=t<5;var s=a<5;var o=n&&(i||s);var l=e===0&&r>0;if(l&&(a<8||t<8)){o=true}return o}function F(t,e,r){var a=p(e,this.total)-90;var n=t/this.total*360;var i=a+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(n===360){i-=.01}var v=g(l,u,a+d,i);var b=g(l,c,a+f,i);var y="M ".concat(v.x1,", ").concat(v.y1," ");var w=m(u,s,v.x2,v.y2,this.chartDetails.size);var x=" L ".concat(b.x2,", ").concat(b.y2," ");var k=m(c,o,b.x1,b.y1,this.chartDetails.size);return y+w+x+k+" z"}function P(){var t=r.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return e("div",{id:"chart-instructions"},t)}function V(){return e("defs",null,e("filter",{id:"wmHoverDropShadow"},e("feGaussianBlur",{stdDeviation:"3"}),e("feOffset",{result:"offsetblur"}),e("feFlood",{"flood-color":"#333"}),e("feComposite",{operator:"in",in2:"offsetblur"}),e("feMerge",null,e("feMergeNode",null),e("feMergeNode",{in:"SourceGraphic"}))))}function L(t){var r=this;var a=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut0"||t==="doughnut";var i=n?this.slicesDetails:I(this.slicesDetails,this.total);return e("div",{class:"chart-wrapper doughnut-wrapper"},e("svg",{width:a+"px",height:a+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},V(),i.map((function(e){return R.call(r,e,t)})),n?e("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},f(i[0].amount,this.total,true)+"%"):e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},i.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(r,t):""})))))}function R(t,r){var a=this;return e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},e("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:F.call(this,t.amount,t.offset,r),onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)},role:"img","aria-label":t.legend}))}function W(t){var r=p(t.offset+t.amount/2,this.total);var a=g(this.chartDetails.size/2,1.4,r-90),n=a.x,i=a.y;return e("text",{class:"value",x:n+"px",y:i+"px"},"".concat(t.perc>0?t.perc:"<1","%"))}function N(t){var r=this;var a=t==="bar1"||t==="bar";return e("div",{class:"chart-wrapper bar-wrapper"},a?e("div",{class:"single-perc"},f(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),e("div",{class:"inner-stacked-bar-wrapper ".concat(c(this.tempValueFormat))},!a?e("div",{class:"values"},this.slicesDetails.map((function(t,e){return r.renderBarText(t,e)}))):"",e("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t,e){return G.call(r,t,e)}))),a?H.call(this):""))}function G(t,r){var a=this;var n=r!==this.slicesDetails.length-1;var i="calc(".concat(f(t.amount,this.total,false),"%").concat(n?" - 2px":"",")");return e("div",{class:"segment stacked-bar-segment ".concat(f(t.amount,this.total,false)===0?"zero":""),style:{backgroundColor:t.color,width:i},onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)}},e("span",{class:"sr-only"},t.legend))}function K(t){var r=this;var a=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,e){return t>e?t:e}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var i=48;var s=this.el.getBoundingClientRect().width;var o=s-n-i;var l=w(o);var u=x(a,l);var h=l*u;var f=Math.floor((h-a)/u);l-=f;this.el.style.setProperty("--backgroundSize",100/l+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var p=[];this.slicesDetails.forEach((function(e){e.legend&&p.push(j(e.legend,r.showBarLegend,t));p.push(O.call(r,e,u,l,a))}));var v=[];for(var g=1;g<=l;g++){var m=d(g*u);v.push(e("div",{class:"tick"},e("span",null,m)))}var b=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return e("div",{class:"chart-wrapper simple-bar-wrapper"},e("div",{class:"chart ".concat(c(this.tempValueFormat))},b&&e("div",{class:"gridlines"}),e("div",{class:"rows"},p)),b&&e("div",{class:"x-axis","aria-hidden":"true"},e("div",{class:"zero"},e("span",null,"0")),v))}function j(t,r,a){var n=a==="bar7"&&!r?" hidden":"";return e("label",{class:"label".concat(n)},t)}function O(t,r,a,n){var i=this;var s=this.currentChartType==="bar6"?r*a:n;var o=f(t.amount,s,false);var l=o?o+"%":"1px";var c=d(t.amount);var u=this.tempValueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){u=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){u=f(t.amount,this.total,true)+"%"}return e("div",{class:"bar segment",style:{backgroundColor:t.color,width:l},onClick:function(e){return E.call(i,e,t)},onFocus:function(e){return D.call(i,e,t)},onKeyDown:function(t){return k.call(i,t)}},e("div",{class:"value"},u))}function U(t){if(this.showLegend){var r=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(t,e){return t=e.inSmallCluster?true:t}),false);return e("div",{class:"legend-wrapper"},e("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.total>0?this.slicesDetails.map((function(t){if(!!t.amount||!!t.legend){return q({key:t.legend,color:t.color})}})):""),r&&X())}}function q(t){return e("div",{class:"legend-item"},e("div",{class:"legend-color",style:{backgroundColor:t.color}}),e("div",{class:"legend-text"},t.key))}function H(){if(this.completionMessage){return e("div",{class:"completion-message"},this.completionMessage)}}function X(){return e("div",{class:"hidden-values-warning"},u,e("br",null),h)}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __spreadArray=this&&this.__spreadArray||function(a,n,s){if(s||arguments.length===2)for(var i=0,r=n.length,t;i<r;i++){if(t||!(i in n)){if(!t)t=Array.prototype.slice.call(n,0,i);t[i]=n[i]}}return a.concat(t||Array.prototype.slice.call(n))};System.register(["./p-c4ca5d46.system.js","./p-190afa40.system.js","./p-54a2b7d6.system.js"],(function(a){"use strict";var n,s,i,r,t,e,o,c;return{setters:[function(a){n=a.r;s=a.c;i=a.h;r=a.g},function(a){t=a.g;e=a.s;o=a.k},function(a){c=a.g}],execute:function(){var m='.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active){-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-snackbar *{-webkit-box-sizing:border-box;box-sizing:border-box;margin:unset}:host .wm-snackbars,wm-snackbar .wm-snackbars{position:fixed;bottom:0;left:1.25rem;right:1.25rem;padding:0.25rem 0.625rem 1.875rem;z-index:2001;max-width:35.5rem;max-height:17.5rem;-webkit-overflow-scrolling:touch;overflow:auto}:host .wm-snackbars.empty,wm-snackbar .wm-snackbars.empty{-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);padding-top:0;padding-bottom:0}:host .wm-snackbars .wm-snack-wrapper,wm-snackbar .wm-snackbars .wm-snack-wrapper{width:100%;height:100%}:host .wm-snackbars .wm-snack-wrapper:not(:last-child),wm-snackbar .wm-snackbars .wm-snack-wrapper:not(:last-child){margin-bottom:1.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar{-webkit-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);font-size:0.875rem;color:#fff;padding:0.9375rem 1.875rem;background:#4a4a4a;opacity:0;left:0;position:relative;font-family:inherit}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link{letter-spacing:0;text-transform:none;font-size:0.875rem;border:none;background:transparent;padding-left:0;padding-right:0;height:auto;border-radius:0;line-height:1;color:#85dadf;margin:0 3.125rem 0 0.625rem;text-decoration:none;font-weight:600;cursor:pointer}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link.new-window::after,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link.new-window::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;display:inline;content:"\\f137";margin-left:0.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:hover,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:hover{text-decoration:underline}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:focus,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:focus{outline:none;border:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner{border:0;outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar:not(:last-child),wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar:not(:last-child){margin-bottom:1.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar.active:not(button),wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar.active:not(button){opacity:1}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;padding:0}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext{width:100%}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;background-color:#3b3b3b;color:#ffffff;cursor:pointer;border:none;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}@media screen and (min-width: 48rem){:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack{min-width:1.875rem;min-height:1.875rem}}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:before,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack: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:"\\f156"}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:hover,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:hover{background-color:#fff;color:#4a4a4a}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus{outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack::-moz-focus-inner,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack::-moz-focus-inner{border:0;outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:active,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:active{-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-snackbars .wm-snack-wrapper .wm-snackbar .sr-only,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .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;top:0;left:0}:host .sr-only,wm-snackbar .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;top:0;left:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active)>.tooltip{clip:auto;width:auto;height:auto;opacity:1;-webkit-transition:opacity 500ms 500ms;transition:opacity 500ms 500ms;padding:0.375rem;top:2.75rem;left:2.75rem;white-space:nowrap;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width: 48rem){.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active)>.tooltip{top:2.0625rem;left:auto}}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .link:focus:not(:active){outline:none;background:-webkit-gradient(linear, left top, right top, color-stop(66%, #85dadf), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, #85dadf 66%, transparent 0) repeat-x;background-size:0.375rem 0.1875rem;background-position:0 1em;border-radius:0;line-height:normal}';var w=a("wm_snackbar",function(){function a(a){n(this,a);this.wmSnackbarSnackFinished=s(this,"wmSnackbarSnackFinished",7);this.userFinishedSnack=s(this,"userFinishedSnack",7);this.wmSnackbarActionTriggered=s(this,"wmSnackbarActionTriggered",7);this.userTriggeredAction=s(this,"userTriggeredAction",7);this.parsedNotifications=[];this.isTabbing=false;this.timers=[];this.newNotification=false;this.notifications="[]"}a.prototype.updateSnacks=function(a){var n=this;var s=JSON.parse(a);var i=s.length;var r=this.parsedNotifications.length;this.parsedNotifications=[];for(var t=0;t<i;t++){var e={id:s[t].id.toString(),message:s[t].message.toString(),link:s[t].link.toString(),newWindow:!!s[t].newWindow};this.parsedNotifications=__spreadArray(__spreadArray([],this.parsedNotifications,true),[e],false)}if(r<this.parsedNotifications.length){var o=window.setTimeout((function(){return n.snackExpired()}),2e4);this.timers=__spreadArray([o],this.timers,true);this.storeElToFocusOnDismiss();this.newNotification=true}else{this.newNotification=false}};a.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:t()};a.prototype.componentDidUpdate=function(){this.isTabbing&&this.newNotification&&this.focusLinkAndDisableTimer();this.newNotification=false};a.prototype.toggleTabbingOn=function(){this.isTabbing=true};a.prototype.toggleTabbingOff=function(){this.isTabbing=false};a.prototype.focusLinkAndDisableTimer=function(){var a=this.parsedNotifications[0];if(a.link){var n=this.el.shadowRoot.querySelector("#action-".concat(a.id));n.focus();this.stopTimer(a)}};a.prototype.storeElToFocusOnDismiss=function(){var a=document.activeElement;while(a&&a.shadowRoot){a=a.shadowRoot.activeElement}this.focusOnDismiss=a};a.prototype.snackDismissed=function(a){this.endSnack(a);a.link&&this.isTabbing&&this.focusOnDismiss.focus()};a.prototype.snackExpired=function(){var a=this.parsedNotifications[this.parsedNotifications.length-1];this.endSnack(a)};a.prototype.endSnack=function(a){this.stopTimer(a);this.wmSnackbarSnackFinished.emit({id:a.id,message:a.message,link:a.link,newWindow:a.newWindow});this.userFinishedSnack.emit({id:a.id,message:a.message,link:a.link})};a.prototype.snackLinkClicked=function(a){this.stopTimer(a);this.wmSnackbarActionTriggered.emit({id:a.id,message:a.message,link:a.link,newWindow:a.newWindow});this.userTriggeredAction.emit({id:a.id,message:a.message,link:a.link})};a.prototype.stopTimer=function(a){var n=this;this.parsedNotifications.forEach((function(s,i){if(s.id===a.id){clearTimeout(n.timers[i]);n.timers=n.timers.filter((function(a,n){if(n!==i){return a}}))}}))};a.prototype.renderSnackbars=function(){var a=this;return this.parsedNotifications.map((function(n){return i("div",{class:"wm-snack-wrapper"},i("div",{id:"snack-".concat(a.uid),class:"wm-snackbar active neutral"},i("div",{class:"sr-only",tabindex:n.link?0:-1,onFocus:function(){return n.link&&a.snackDismissed(n)}}),i("div",{class:"wm-snackbarmsg"},i("div",{class:"msgtext"},i("span",null,n.message),n.link&&i("a",{id:"action-".concat(n.id),class:"link ".concat(n.newWindow?"new-window":""),"aria-label":"Click to ".concat(n.link,"...").concat(n.newWindow?" "+c.newWindow:""),tabindex:0,onClick:function(){a.snackLinkClicked(n)},onKeyDown:function(s){return s.key==="Enter"&&a.snackLinkClicked(n)}},i("span",{"aria-hidden":"true"},n.link))),i("button",{id:"close-button-".concat(n.id),"aria-label":"Close this notification",class:"closesnack",tabindex:n.link?0:-1,onClick:function(){return a.snackDismissed(n)},onMouseEnter:function(a){return e("bottom",a.target,c.close)},onMouseLeave:function(){return o()},onFocus:function(n){return a.isTabbing&&e("bottom",n.target,c.close)},onBlur:function(){return o()}})),i("div",{class:"sr-only",tabindex:n.link?0:-1,onFocus:function(){return n.link&&a.snackDismissed(n)}})))}))};a.prototype.renderLiveRegion=function(){var a=this.parsedNotifications[0];var n=this.isTabbing?"":a.link;var s="".concat(a.message," ").concat(n);var i=this.el.shadowRoot.querySelector("#wm-live-region-".concat(this.uid));if(i){i.innerHTML="";var r=document.createElement("span");r.innerHTML=s;i.appendChild(r)}};a.prototype.render=function(){this.newNotification&&this.renderLiveRegion();var a=this.renderSnackbars();var n=this.parsedNotifications.length===0?"empty":"";return i("div",{class:"wm-snackbars ".concat(n," ").concat(this.isTabbing?"user-is-tabbing":"")},i("div",{class:"sr-only","aria-live":"polite","aria-atomic":"false",id:"wm-live-region-".concat(this.uid)}),a)};Object.defineProperty(a.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(a,"watchers",{get:function(){return{notifications:["updateSnacks"]}},enumerable:false,configurable:true});return a}());w.style=m}}}));
|
|
1
|
+
var __spreadArray=this&&this.__spreadArray||function(a,n,s){if(s||arguments.length===2)for(var i=0,r=n.length,t;i<r;i++){if(t||!(i in n)){if(!t)t=Array.prototype.slice.call(n,0,i);t[i]=n[i]}}return a.concat(t||Array.prototype.slice.call(n))};System.register(["./p-c4ca5d46.system.js","./p-9e94ae94.system.js","./p-9706537b.system.js"],(function(a){"use strict";var n,s,i,r,t,e,o,c;return{setters:[function(a){n=a.r;s=a.c;i=a.h;r=a.g},function(a){t=a.g;e=a.s;o=a.k},function(a){c=a.g}],execute:function(){var m='.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active){-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-snackbar *{-webkit-box-sizing:border-box;box-sizing:border-box;margin:unset}:host .wm-snackbars,wm-snackbar .wm-snackbars{position:fixed;bottom:0;left:1.25rem;right:1.25rem;padding:0.25rem 0.625rem 1.875rem;z-index:2001;max-width:35.5rem;max-height:17.5rem;-webkit-overflow-scrolling:touch;overflow:auto}:host .wm-snackbars.empty,wm-snackbar .wm-snackbars.empty{-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);padding-top:0;padding-bottom:0}:host .wm-snackbars .wm-snack-wrapper,wm-snackbar .wm-snackbars .wm-snack-wrapper{width:100%;height:100%}:host .wm-snackbars .wm-snack-wrapper:not(:last-child),wm-snackbar .wm-snackbars .wm-snack-wrapper:not(:last-child){margin-bottom:1.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar{-webkit-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);font-size:0.875rem;color:#fff;padding:0.9375rem 1.875rem;background:#4a4a4a;opacity:0;left:0;position:relative;font-family:inherit}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link{letter-spacing:0;text-transform:none;font-size:0.875rem;border:none;background:transparent;padding-left:0;padding-right:0;height:auto;border-radius:0;line-height:1;color:#85dadf;margin:0 3.125rem 0 0.625rem;text-decoration:none;font-weight:600;cursor:pointer}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link.new-window::after,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link.new-window::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;display:inline;content:"\\f137";margin-left:0.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:hover,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:hover{text-decoration:underline}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:focus,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link:focus{outline:none;border:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner{border:0;outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar:not(:last-child),wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar:not(:last-child){margin-bottom:1.25rem}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar.active:not(button),wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar.active:not(button){opacity:1}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;padding:0}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext{width:100%}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;background-color:#3b3b3b;color:#ffffff;cursor:pointer;border:none;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}@media screen and (min-width: 48rem){:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack{min-width:1.875rem;min-height:1.875rem}}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:before,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack: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:"\\f156"}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:hover,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:hover{background-color:#fff;color:#4a4a4a}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus{outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack::-moz-focus-inner,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack::-moz-focus-inner{border:0;outline:none}:host .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:active,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:active{-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-snackbars .wm-snack-wrapper .wm-snackbar .sr-only,wm-snackbar .wm-snackbars .wm-snack-wrapper .wm-snackbar .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;top:0;left:0}:host .sr-only,wm-snackbar .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;top:0;left:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active)>.tooltip{clip:auto;width:auto;height:auto;opacity:1;-webkit-transition:opacity 500ms 500ms;transition:opacity 500ms 500ms;padding:0.375rem;top:2.75rem;left:2.75rem;white-space:nowrap;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width: 48rem){.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active)>.tooltip{top:2.0625rem;left:auto}}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .link:focus:not(:active){outline:none;background:-webkit-gradient(linear, left top, right top, color-stop(66%, #85dadf), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, #85dadf 66%, transparent 0) repeat-x;background-size:0.375rem 0.1875rem;background-position:0 1em;border-radius:0;line-height:normal}';var w=a("wm_snackbar",function(){function a(a){n(this,a);this.wmSnackbarSnackFinished=s(this,"wmSnackbarSnackFinished",7);this.userFinishedSnack=s(this,"userFinishedSnack",7);this.wmSnackbarActionTriggered=s(this,"wmSnackbarActionTriggered",7);this.userTriggeredAction=s(this,"userTriggeredAction",7);this.parsedNotifications=[];this.isTabbing=false;this.timers=[];this.newNotification=false;this.notifications="[]"}a.prototype.updateSnacks=function(a){var n=this;var s=JSON.parse(a);var i=s.length;var r=this.parsedNotifications.length;this.parsedNotifications=[];for(var t=0;t<i;t++){var e={id:s[t].id.toString(),message:s[t].message.toString(),link:s[t].link.toString(),newWindow:!!s[t].newWindow};this.parsedNotifications=__spreadArray(__spreadArray([],this.parsedNotifications,true),[e],false)}if(r<this.parsedNotifications.length){var o=window.setTimeout((function(){return n.snackExpired()}),2e4);this.timers=__spreadArray([o],this.timers,true);this.storeElToFocusOnDismiss();this.newNotification=true}else{this.newNotification=false}};a.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:t()};a.prototype.componentDidUpdate=function(){this.isTabbing&&this.newNotification&&this.focusLinkAndDisableTimer();this.newNotification=false};a.prototype.toggleTabbingOn=function(){this.isTabbing=true};a.prototype.toggleTabbingOff=function(){this.isTabbing=false};a.prototype.focusLinkAndDisableTimer=function(){var a=this.parsedNotifications[0];if(a.link){var n=this.el.shadowRoot.querySelector("#action-".concat(a.id));n.focus();this.stopTimer(a)}};a.prototype.storeElToFocusOnDismiss=function(){var a=document.activeElement;while(a&&a.shadowRoot){a=a.shadowRoot.activeElement}this.focusOnDismiss=a};a.prototype.snackDismissed=function(a){this.endSnack(a);a.link&&this.isTabbing&&this.focusOnDismiss.focus()};a.prototype.snackExpired=function(){var a=this.parsedNotifications[this.parsedNotifications.length-1];this.endSnack(a)};a.prototype.endSnack=function(a){this.stopTimer(a);this.wmSnackbarSnackFinished.emit({id:a.id,message:a.message,link:a.link,newWindow:a.newWindow});this.userFinishedSnack.emit({id:a.id,message:a.message,link:a.link})};a.prototype.snackLinkClicked=function(a){this.stopTimer(a);this.wmSnackbarActionTriggered.emit({id:a.id,message:a.message,link:a.link,newWindow:a.newWindow});this.userTriggeredAction.emit({id:a.id,message:a.message,link:a.link})};a.prototype.stopTimer=function(a){var n=this;this.parsedNotifications.forEach((function(s,i){if(s.id===a.id){clearTimeout(n.timers[i]);n.timers=n.timers.filter((function(a,n){if(n!==i){return a}}))}}))};a.prototype.renderSnackbars=function(){var a=this;return this.parsedNotifications.map((function(n){return i("div",{class:"wm-snack-wrapper"},i("div",{id:"snack-".concat(a.uid),class:"wm-snackbar active neutral"},i("div",{class:"sr-only",tabindex:n.link?0:-1,onFocus:function(){return n.link&&a.snackDismissed(n)}}),i("div",{class:"wm-snackbarmsg"},i("div",{class:"msgtext"},i("span",null,n.message),n.link&&i("a",{id:"action-".concat(n.id),class:"link ".concat(n.newWindow?"new-window":""),"aria-label":"Click to ".concat(n.link,"...").concat(n.newWindow?" "+c.newWindow:""),tabindex:0,onClick:function(){a.snackLinkClicked(n)},onKeyDown:function(s){return s.key==="Enter"&&a.snackLinkClicked(n)}},i("span",{"aria-hidden":"true"},n.link))),i("button",{id:"close-button-".concat(n.id),"aria-label":"Close this notification",class:"closesnack",tabindex:n.link?0:-1,onClick:function(){return a.snackDismissed(n)},onMouseEnter:function(a){return e("bottom",a.target,c.close)},onMouseLeave:function(){return o()},onFocus:function(n){return a.isTabbing&&e("bottom",n.target,c.close)},onBlur:function(){return o()}})),i("div",{class:"sr-only",tabindex:n.link?0:-1,onFocus:function(){return n.link&&a.snackDismissed(n)}})))}))};a.prototype.renderLiveRegion=function(){var a=this.parsedNotifications[0];var n=this.isTabbing?"":a.link;var s="".concat(a.message," ").concat(n);var i=this.el.shadowRoot.querySelector("#wm-live-region-".concat(this.uid));if(i){i.innerHTML="";var r=document.createElement("span");r.innerHTML=s;i.appendChild(r)}};a.prototype.render=function(){this.newNotification&&this.renderLiveRegion();var a=this.renderSnackbars();var n=this.parsedNotifications.length===0?"empty":"";return i("div",{class:"wm-snackbars ".concat(n," ").concat(this.isTabbing?"user-is-tabbing":"")},i("div",{class:"sr-only","aria-live":"polite","aria-atomic":"false",id:"wm-live-region-".concat(this.uid)}),a)};Object.defineProperty(a.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(a,"watchers",{get:function(){return{notifications:["updateSnacks"]}},enumerable:false,configurable:true});return a}());w.style=m}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,f as i,h as o,H as r,g as n}from"./p-b5dee715.js";import{d as s,i as l,j as a,s as d,k as p}from"./p-
|
|
1
|
+
import{r as e,c as t,f as i,h as o,H as r,g as n}from"./p-b5dee715.js";import{d as s,i as l,j as a,s as d,k as p}from"./p-5384856b.js";const f=class{constructor(o){e(this,o),this.wmIntFilePreviewed=t(this,"wmIntFilePreviewed",7),this.wmIntFileDownloaded=t(this,"wmIntFileDownloaded",7),this.wmIntFileDeleted=t(this,"wmIntFileDeleted",7),this.wmFileClearErrorClicked=t(this,"wmFileClearErrorClicked",7),this.isWithinLegacyUploader=!1,this.debouncedResize=s((()=>{this.isCondensed=this.el.clientWidth<500,i(this.el)}),50),this.file=void 0,this.showInfo="time",this.errorMessage=void 0,this.isCondensed=!1}get fileData(){let e=this.file?JSON.parse(this.file):null;return e&&e.progress&&"string"==typeof e.progress&&e.progress.match(/^[0-9]+$/)&&(e.progress=parseInt(e.progress.toString())),e}get isUploading(){return this.fileData&&this.fileData.hasOwnProperty("progress")&&this.fileData.progress<100}get previewButtonTooltip(){return l.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})}get downloadButtonTooltip(){return l.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})}get deleteButtonTooltip(){return l.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})}get previewActionMessage(){return l.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})}get downloadActionMessage(){return l.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})}get deleteActionMessage(){return l.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})}get actionMenuLabel(){return l.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})}get clearButtonText(){return l.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})}generateClearButtonLabel(e){return l.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})}componentWillLoad(){const e=this.el.getRootNode().host;e&&"WM-UPLOADER"===e.nodeName&&(e.type||e.uploaderType)&&(this.isWithinLegacyUploader=!0),new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}componentDidRender(){const e=this.el.shadowRoot.querySelector(".filename"),t=this.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left,i=this.el.shadowRoot.querySelector(".right-group"),o=i?i.getBoundingClientRect().left:this.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;e.textContent=a(e,e.dataset.filename,o-t,7)}previewFile(e){this.wmIntFilePreviewed.emit(e.id)}downloadFile(e){this.wmIntFileDownloaded.emit(e.id)}deleteFile(e){this.wmIntFileDeleted.emit(e.id)}handleFilenameMouseEnter(e,t){e.target.textContent.includes("...")&&d("bottom",e.target,t)}renderFileName(e,t){return o("div",{class:"left-group"},o("div",{class:"name-wrapper"},o("span",{class:"sr-only"},e),o("span",{"aria-hidden":"true",class:"filename","data-filename":e,onMouseEnter:t=>this.handleFilenameMouseEnter(t,e),onMouseLeave:()=>p()}),t&&o("span",{class:"sr-only"},"uploading")))}renderFileInfo(e,t){let i="";return"time"===t&&e.lastUpdated?i=e.lastUpdated:"size"===t&&e.size&&(i=e.size),o("div",{class:"file-info"},i)}renderActionMenu(e){const t=e.fileActions||"download delete",i=o("wm-menuitem",{icon:"f208",onClick:()=>this.previewFile(e)},this.previewActionMessage),r=o("wm-menuitem",{icon:"f1da",onClick:()=>this.downloadFile(e)},this.downloadActionMessage),n=o("wm-menuitem",{icon:"f1c0",onClick:()=>this.deleteFile(e)},this.deleteActionMessage);return o("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":`${e.name} ${this.actionMenuLabel}`},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&n)}renderFileActionButtons(e){const t=e.fileActions||"download delete",i=o("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`preview ${e.name}`,icon:"f208",onClick:()=>this.previewFile(e)}),r=o("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`download ${e.name}`,icon:"f1da",onClick:()=>this.downloadFile(e)}),n=o("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`delete ${e.name}`,icon:"f1c0",onClick:()=>this.deleteFile(e)});return o("div",{class:"file-controls"},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&n)}renderFileInProgress(e){const t=e.type?`${e.name}.${e.type}`:e.name;return o("div",{class:"file-wrapper"},o("div",{class:"file --progress"},o("div",{class:"progress",style:{background:`linear-gradient(to right, rgba(67, 126, 142, 1) ${e.progress}%, transparent ${e.progress}%)`}}),this.renderFileName(t,this.isUploading)))}renderFileControls(e){const t=e.fileActions&&1===e.fileActions.split(" ").length;return this.isCondensed&&!t?this.renderActionMenu(e):this.renderFileActionButtons(e)}renderFile(e){return o("div",{class:"file-wrapper "+(this.isWithinLegacyUploader||100!==e.progress?"":"checked")},o("div",{class:"file "+(this.errorMessage?"--error":"")},this.renderFileName(e.type?`${e.name}.${e.type}`:e.name,this.isUploading),!this.errorMessage&&o("div",{class:"right-group "+(this.isCondensed?"condensed":"")},"none"!==this.showInfo&&this.renderFileInfo(e,this.showInfo),""!==e.fileActions&&this.renderFileControls(e)),this.errorMessage&&o("wm-button",{"permanently-delete":!0,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(e.name),onClick:()=>this.wmFileClearErrorClicked.emit({name:e.name})},this.clearButtonText)),this.errorMessage&&o("div",{class:"error-message"},this.errorMessage))}render(){return o(r,{role:"listitem"},this.isUploading?this.renderFileInProgress(this.fileData):this.renderFile(this.fileData))}static get delegatesFocus(){return!0}get el(){return n(this)}};f.style=':host,wm-file{display:block;width:100%}.file-wrapper{font-size:0.875rem;position:relative;list-style:none}.file-wrapper .file{min-width:300px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;height:3.5rem;padding:0 1.25rem;position:relative;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}.file-wrapper .file .filename{display:inline-block;white-space:nowrap}.file-wrapper .file .left-group{overflow:hidden}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:5rem;gap:1rem}.file-wrapper .file .right-group.condensed{padding-left:2.5rem}.file-wrapper .file .right-group .file-controls{display:-ms-flexbox;display:flex;gap:1rem}.file-wrapper .file .right-group .file-info{white-space:nowrap}.file-wrapper .file.--error{border:1px solid #c0392b;background-color:#f5ebea;height:3.75rem}.file-wrapper.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}.name-wrapper{overflow:hidden}.progress{position:absolute;left:0;top:0;right:0;height:8px}.error-message{display:block;font-style:italic;color:#c0392b;font-size:0.875rem;margin-top:0.25rem}.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}';export{f as wm_file}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as a,g as i}from"./p-b5dee715.js";import{d as n}from"./p-4a0e1d2d.js";const s=class{constructor(a){t(this,a),this.wmPaginationPageClicked=e(this,"wmPaginationPageClicked",7),this.pageClicked=e(this,"pageClicked",7),this.focusCurrentPage=e(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=n((()=>{this.isLargeViewport=window.innerWidth>600}),250),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeViewport=window.innerWidth>600,this.isTabbing=!1,this.srAnnouncement=""}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}handleResize(){this.debouncedResize()}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.el.focus=()=>{this.isLargeViewport?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()}}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.pageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let e=1;e<=this.totalPages;e++)t.push(this.displayPageNumber(e));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return a("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return a("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const e=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(e===t?`${e}`:`${e}–${t} of ${this.totalItems}`)}renderLarge(){return a("div",{class:"largescreen"},a("div",{class:"pageview"},this.getCurrentPagesInView()),a("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},a("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),a("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return a("div",{class:"smallscreen"},a("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},a("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},a("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),a("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,a("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),a("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},a("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))}render(){return this.totalItems>this.itemsPerPage&&a("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeViewport?this.renderLarge():this.renderSmall(),a("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return i(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};s.style='nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:#575195;background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:#565397}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:#9f9f9f;pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:#9f9f9f}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem;width:auto !important}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0;width:auto !important}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]),nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]){-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before{position:absolute;content:"";height:auto;width:16px;top:0;bottom:0;left:12px;right:0;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 2px;background-position:0 2em;border-radius:0;line-height:normal}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus{-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}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner{border:0}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-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);background-color:#575195;color:#fff}nav .largescreen .paginationbtn[aria-current=page]:hover{-webkit-box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);background:#4e4986}.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}';export{s as wm_pagination}
|
|
1
|
+
import{r as t,c as e,h as a,g as i}from"./p-b5dee715.js";import{d as n}from"./p-5384856b.js";const s=class{constructor(a){t(this,a),this.wmPaginationPageClicked=e(this,"wmPaginationPageClicked",7),this.pageClicked=e(this,"pageClicked",7),this.focusCurrentPage=e(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=n((()=>{this.isLargeViewport=window.innerWidth>600}),250),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeViewport=window.innerWidth>600,this.isTabbing=!1,this.srAnnouncement=""}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}handleResize(){this.debouncedResize()}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.el.focus=()=>{this.isLargeViewport?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()}}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.pageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let e=1;e<=this.totalPages;e++)t.push(this.displayPageNumber(e));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return a("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return a("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const e=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(e===t?`${e}`:`${e}–${t} of ${this.totalItems}`)}renderLarge(){return a("div",{class:"largescreen"},a("div",{class:"pageview"},this.getCurrentPagesInView()),a("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},a("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),a("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return a("div",{class:"smallscreen"},a("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},a("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},a("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),a("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,a("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),a("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},a("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))}render(){return this.totalItems>this.itemsPerPage&&a("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeViewport?this.renderLarge():this.renderSmall(),a("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return i(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};s.style='nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:#575195;background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:#565397}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:#9f9f9f;pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:#9f9f9f}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem;width:auto !important}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0;width:auto !important}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]),nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]){-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before{position:absolute;content:"";height:auto;width:16px;top:0;bottom:0;left:12px;right:0;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 2px;background-position:0 2em;border-radius:0;line-height:normal}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus{-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}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner{border:0}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-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);background-color:#575195;color:#fff}nav .largescreen .paginationbtn[aria-current=page]:hover{-webkit-box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 2px 0 rgba(87, 81, 149, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.2);background:#4e4986}.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}';export{s as wm_pagination}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"./p-b5dee715.js";import{i as s,c as i,b as e,f as n,d as a}from"./p-4a0e1d2d.js";const o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"},r={doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}};function h(t){return"percentage"===t||"amount"===t?"show-values":""}const c=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),d=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function l(t){return t>999?Math.round(t/100)/10+"K":t}function u(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function g(t,s){return 360*t/s}function p(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function f(t,s,i,e){var n=p(t+t*s*Math.cos(Math.PI*i/180)),a=p(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:p(t+t*s*Math.cos(Math.PI*e/180)),y2:p(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function b(t,s,i,e,n){var a=p(n/2*t);return`A ${a}, ${a} 0 ${s} ${p(i)}, ${p(e)}`}function m(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function v(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},k.call(this,s))}function w(t,s){this.popoverEl&&this.isTabbing&&(s.coords=e(t.target),k.call(this,s))}function y(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,$.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,x.call(this);break;case"Tab":z.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function k(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=n(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function x(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;M.call(this,s)}function $(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,M.call(this,s)}}function M(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function z(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function B(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=u(n,this.total,!0);let h=e;"bar5"===t&&(h=this.notStartedColor?e:e+1),"bar6"===t&&(h=0);const c=r[t].colors[h],d={amount:n,perc:a,legend:i.getAttribute("legend"),color:c||o.gray,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(d)}))}function C(t,s,i){const e=g(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=f(h,1,e+1.5,a),u=f(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+b(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+b(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function D(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function A(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=u(i[0===n?i.length-1:n-1].amount,s,!0),r=u(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>F.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},u(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?S.call(this,t):"")))))}function F(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:C.call(this,s.amount,s.offset,i),onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t),role:"img","aria-label":s.legend}))}function S(s){const i=g(s.offset+s.amount/2,this.total);let{x:e,y:n}=f(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function T(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},u(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${h(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>K.call(this,t,s)))),i?G.call(this):""))}function K(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${u(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===u(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t)},t("span",{class:"sr-only"},s.legend))}function j(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=function(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const c=[];this.slicesDetails.forEach((e=>{e.legend&&c.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),c.push(I.call(this,e,o,n,i))}));const d=[];for(let s=1;s<=n;s++){const i=l(s*o);d.push(t("div",{class:"tick"},t("span",null,i)))}const u="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${h(this.tempValueFormat)}`},u&&t("div",{class:"gridlines"}),t("div",{class:"rows"},c)),u&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),d))}function I(s,i,e,n){const a=u(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=l(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=u(s.amount,this.total,!0)+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t)},t("div",{class:"value"},h))}function W(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.total>0?this.slicesDetails.map((t=>{if(t.amount||t.legend)return E({key:t.legend,color:t.color})})):""),i&&L())}}function E(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function G(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function L(){return t("div",{class:"hidden-values-warning"},c,t("br",null),d)}export{r as a,u as b,j as c,A as d,D as e,W as f,B as g,y as h,G as i,L as j,z as k,E as l,T as r}
|
|
1
|
+
import{h as t}from"./p-b5dee715.js";import{i as s,c as i,b as e,f as n,d as a}from"./p-5384856b.js";const o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"},r={doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}};function h(t){return"percentage"===t||"amount"===t?"show-values":""}const c=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),d=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function l(t){return t>999?Math.round(t/100)/10+"K":t}function u(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function g(t,s){return 360*t/s}function p(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function f(t,s,i,e){var n=p(t+t*s*Math.cos(Math.PI*i/180)),a=p(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:p(t+t*s*Math.cos(Math.PI*e/180)),y2:p(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function b(t,s,i,e,n){var a=p(n/2*t);return`A ${a}, ${a} 0 ${s} ${p(i)}, ${p(e)}`}function m(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function v(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},k.call(this,s))}function w(t,s){this.popoverEl&&this.isTabbing&&(s.coords=e(t.target),k.call(this,s))}function y(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,$.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,x.call(this);break;case"Tab":z.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function k(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=n(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function x(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;M.call(this,s)}function $(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,M.call(this,s)}}function M(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function z(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function B(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=u(n,this.total,!0);let h=e;"bar5"===t&&(h=this.notStartedColor?e:e+1),"bar6"===t&&(h=0);const c=r[t].colors[h],d={amount:n,perc:a,legend:i.getAttribute("legend"),color:c||o.gray,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(d)}))}function C(t,s,i){const e=g(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=f(h,1,e+1.5,a),u=f(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+b(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+b(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function D(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function A(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=u(i[0===n?i.length-1:n-1].amount,s,!0),r=u(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>F.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},u(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?S.call(this,t):"")))))}function F(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:C.call(this,s.amount,s.offset,i),onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t),role:"img","aria-label":s.legend}))}function S(s){const i=g(s.offset+s.amount/2,this.total);let{x:e,y:n}=f(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function T(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},u(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${h(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>K.call(this,t,s)))),i?G.call(this):""))}function K(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${u(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===u(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t)},t("span",{class:"sr-only"},s.legend))}function j(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=function(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const c=[];this.slicesDetails.forEach((e=>{e.legend&&c.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),c.push(I.call(this,e,o,n,i))}));const d=[];for(let s=1;s<=n;s++){const i=l(s*o);d.push(t("div",{class:"tick"},t("span",null,i)))}const u="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${h(this.tempValueFormat)}`},u&&t("div",{class:"gridlines"}),t("div",{class:"rows"},c)),u&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),d))}function I(s,i,e,n){const a=u(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=l(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=u(s.amount,this.total,!0)+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>v.call(this,t,s),onFocus:t=>w.call(this,t,s),onKeyDown:t=>m.call(this,t)},t("div",{class:"value"},h))}function W(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.total>0?this.slicesDetails.map((t=>{if(t.amount||t.legend)return E({key:t.legend,color:t.color})})):""),i&&L())}}function E(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function G(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function L(){return t("div",{class:"hidden-values-warning"},c,t("br",null),d)}export{r as a,u as b,j as c,A as d,D as e,W as f,B as g,y as h,G as i,L as j,z as k,E as l,T as r}
|