@watermarkinsights/ripple 5.9.0 → 5.10.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{global-bcbcacab.js → global-f8dc67a7.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
- package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
- package/dist/cjs/priv-option-list.cjs.entry.js +1 -1
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +16 -7
- package/dist/cjs/wm-button.cjs.entry.js +17 -2
- package/dist/cjs/wm-chart.cjs.entry.js +1 -1
- package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +1 -1
- package/dist/cjs/wm-input.cjs.entry.js +1 -1
- package/dist/cjs/wm-line-chart.cjs.entry.js +1 -1
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal_3.cjs.entry.js +3 -3
- package/dist/cjs/wm-navigation_3.cjs.entry.js +3 -3
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-nested-select.cjs.entry.js +1 -1
- package/dist/cjs/wm-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +2 -2
- package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +1 -1
- package/dist/cjs/wm-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +3 -3
- package/dist/cjs/wm-tag-input.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +1 -1
- package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/wm-uploader.cjs.entry.js +14 -4
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +30 -0
- package/dist/collection/components/charts/wm-chart/wm-chart.css +30 -0
- package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +30 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +30 -0
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +30 -0
- package/dist/collection/components/datepickers/datepicker.css +30 -0
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +30 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +30 -0
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +30 -0
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +30 -0
- package/dist/collection/components/selects/wm-option/wm-option.css +30 -0
- package/dist/collection/components/selects/wm-select/wm-select.css +30 -0
- package/dist/collection/components/wm-action-menu/wm-action-menu.css +30 -0
- package/dist/collection/components/wm-button/wm-button.css +32 -1
- package/dist/collection/components/wm-button/wm-button.js +16 -1
- package/dist/collection/components/wm-file/wm-file.css +30 -0
- package/dist/collection/components/wm-file-list/wm-file-list.css +30 -0
- package/dist/collection/components/wm-input/wm-input.css +30 -0
- package/dist/collection/components/wm-menuitem/wm-menuitem.css +36 -3
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +14 -5
- package/dist/collection/components/wm-modal/wm-modal-footer.css +30 -0
- package/dist/collection/components/wm-modal/wm-modal-header.css +30 -0
- package/dist/collection/components/wm-modal/wm-modal.css +30 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +30 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +30 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +30 -0
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +30 -0
- package/dist/collection/components/wm-navigation/wm-navigation-item.css +30 -0
- package/dist/collection/components/wm-navigation/wm-navigation.css +30 -0
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +30 -0
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +30 -0
- package/dist/collection/components/wm-navigator/wm-navigator.css +30 -0
- package/dist/collection/components/wm-pagination/wm-pagination.css +30 -0
- package/dist/collection/components/wm-search/wm-search.css +30 -0
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +30 -0
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +30 -0
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +30 -0
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +30 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +30 -0
- package/dist/collection/components/wm-textarea/wm-textarea.css +30 -0
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +30 -0
- package/dist/collection/components/wm-toggletip/wm-toggletip.css +30 -0
- package/dist/collection/components/wm-uploader/wm-uploader.css +32 -1
- package/dist/collection/components/wm-uploader/wm-uploader.js +13 -3
- package/dist/esm/{global-5bd4039b.js → global-2ee184fa.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-navigator-button.entry.js +1 -1
- package/dist/esm/priv-navigator-item.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +1 -1
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-action-menu_2.entry.js +16 -7
- package/dist/esm/wm-button.entry.js +17 -2
- package/dist/esm/wm-chart.entry.js +1 -1
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file-list.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +1 -1
- package/dist/esm/wm-input.entry.js +1 -1
- package/dist/esm/wm-line-chart.entry.js +1 -1
- package/dist/esm/wm-modal-pss_3.entry.js +3 -3
- package/dist/esm/wm-modal_3.entry.js +3 -3
- package/dist/esm/wm-navigation_3.entry.js +3 -3
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +1 -1
- package/dist/esm/wm-optgroup.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +2 -2
- package/dist/esm/wm-pagination.entry.js +1 -1
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +1 -1
- package/dist/esm/wm-snackbar.entry.js +1 -1
- package/dist/esm/wm-tab-item_3.entry.js +3 -3
- package/dist/esm/wm-tag-input.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +1 -1
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +14 -4
- package/dist/esm-es5/global-2ee184fa.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.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-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.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-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.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-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.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-textarea.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-f9d26f8b.system.entry.js → p-02ff9d9a.system.entry.js} +1 -1
- package/dist/ripple/p-056f9114.system.entry.js +1 -0
- package/dist/ripple/{p-870cf4ef.entry.js → p-0c66ecba.entry.js} +1 -1
- package/dist/ripple/p-0e6fc5a0.system.entry.js +1 -0
- package/dist/ripple/p-0eaa5f28.system.entry.js +1 -0
- package/dist/ripple/p-1664fdca.entry.js +1 -0
- package/dist/ripple/p-1d05f67b.system.entry.js +1 -0
- package/dist/ripple/p-1d8a56df.entry.js +1 -0
- package/dist/ripple/p-28b03c72.entry.js +1 -0
- package/dist/ripple/p-33143ee5.entry.js +1 -0
- package/dist/ripple/p-39edbc9c.entry.js +1 -0
- package/dist/ripple/p-3cbe36c5.system.entry.js +1 -0
- package/dist/ripple/p-3f8f2a25.entry.js +1 -0
- package/dist/ripple/p-40defee8.entry.js +1 -0
- package/dist/ripple/p-45d9682c.system.entry.js +1 -0
- package/dist/ripple/{p-e53b6f7c.entry.js → p-47719c70.entry.js} +1 -1
- package/dist/ripple/p-4e741c68.system.entry.js +1 -0
- package/dist/ripple/p-4edaeeeb.system.entry.js +1 -0
- package/dist/ripple/{p-6692b5a6.entry.js → p-52ac4efc.entry.js} +1 -1
- package/dist/ripple/p-5782584c.system.entry.js +1 -0
- package/dist/ripple/p-6837e730.entry.js +1 -0
- package/dist/ripple/p-6be637a4.system.entry.js +1 -0
- package/dist/ripple/p-6e6f0bb6.system.entry.js +1 -0
- package/dist/ripple/p-73cba751.entry.js +1 -0
- package/dist/ripple/p-79dd2d45.entry.js +1 -0
- package/dist/ripple/p-7f6bdd09.entry.js +1 -0
- package/dist/ripple/p-8454039b.system.entry.js +1 -0
- package/dist/ripple/p-87f0b9e4.system.entry.js +1 -0
- package/dist/ripple/p-891a5937.system.entry.js +1 -0
- package/dist/ripple/p-897995da.system.entry.js +1 -0
- package/dist/ripple/p-8a8f341e.entry.js +1 -0
- package/dist/ripple/p-8dfff1de.entry.js +1 -0
- package/dist/ripple/p-94283558.system.entry.js +1 -0
- package/dist/ripple/{p-37649315.entry.js → p-9ac65a33.entry.js} +1 -1
- package/dist/ripple/p-9cf3201c.system.entry.js +1 -0
- package/dist/ripple/p-9e5e84ff.system.entry.js +1 -0
- package/dist/ripple/p-b0ccd8f7.entry.js +1 -0
- package/dist/ripple/p-b1887b90.entry.js +1 -0
- package/dist/ripple/{p-6ad695a5.entry.js → p-b670af1d.entry.js} +1 -1
- package/dist/ripple/p-b7d6a53d.system.entry.js +1 -0
- package/dist/ripple/p-b9954d05.js +1 -0
- package/dist/ripple/{p-e28671cd.system.entry.js → p-bf45953e.system.entry.js} +1 -1
- package/dist/ripple/p-c232f2de.entry.js +1 -0
- package/dist/ripple/p-ccfffedb.entry.js +1 -0
- package/dist/ripple/p-ce73934e.system.entry.js +1 -0
- package/dist/ripple/p-d16fcb24.entry.js +1 -0
- package/dist/ripple/p-d1a46a3d.entry.js +1 -0
- package/dist/ripple/p-d2933cff.system.entry.js +1 -0
- package/dist/ripple/p-d2e3b0dd.system.js +1 -0
- package/dist/ripple/{p-65f4ce68.system.js → p-d3adb7db.system.js} +1 -1
- package/dist/ripple/{p-52338bbc.entry.js → p-d7312723.entry.js} +1 -1
- package/dist/ripple/p-da3003ab.entry.js +1 -0
- package/dist/ripple/p-dbda39c7.system.entry.js +1 -0
- package/dist/ripple/p-ddcdf330.entry.js +1 -0
- package/dist/ripple/p-e19a8330.entry.js +1 -0
- package/dist/ripple/p-e8e6c4cf.system.entry.js +1 -0
- package/dist/ripple/p-e9588527.entry.js +1 -0
- package/dist/ripple/{p-dd76bf0a.system.entry.js → p-e9ec2446.system.entry.js} +1 -1
- package/dist/ripple/p-f22a2dcd.system.entry.js +1 -0
- package/dist/ripple/p-f3e19729.entry.js +1 -0
- package/dist/ripple/p-f56f2911.system.entry.js +1 -0
- package/dist/ripple/p-f657216e.system.entry.js +1 -0
- package/dist/ripple/p-f6a40173.system.entry.js +1 -0
- package/dist/ripple/p-fe00606b.entry.js +1 -0
- package/dist/ripple/p-ff7df52d.system.entry.js +1 -0
- package/dist/ripple/ripple.css +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-button/wm-button.d.ts +1 -0
- package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +1 -2
- package/package.json +1 -1
- package/dist/esm-es5/global-5bd4039b.js +0 -1
- package/dist/ripple/p-021ff5fa.system.entry.js +0 -1
- package/dist/ripple/p-037bf5c7.system.entry.js +0 -1
- package/dist/ripple/p-04d5e7d7.entry.js +0 -1
- package/dist/ripple/p-0eea8fd3.system.entry.js +0 -1
- package/dist/ripple/p-0faf7ef9.system.entry.js +0 -1
- package/dist/ripple/p-13cc92e7.entry.js +0 -1
- package/dist/ripple/p-1618709f.entry.js +0 -1
- package/dist/ripple/p-1f73b257.entry.js +0 -1
- package/dist/ripple/p-2520d947.system.entry.js +0 -1
- package/dist/ripple/p-29f41fea.system.entry.js +0 -1
- package/dist/ripple/p-2c028fe2.entry.js +0 -1
- package/dist/ripple/p-2f565d7a.system.entry.js +0 -1
- package/dist/ripple/p-311923b2.system.entry.js +0 -1
- package/dist/ripple/p-3212fd0e.entry.js +0 -1
- package/dist/ripple/p-34d80f95.entry.js +0 -1
- package/dist/ripple/p-3aca84d7.entry.js +0 -1
- package/dist/ripple/p-3bb1f795.system.entry.js +0 -1
- package/dist/ripple/p-43b03ad8.system.entry.js +0 -1
- package/dist/ripple/p-4c5606da.system.entry.js +0 -1
- package/dist/ripple/p-54d7688a.entry.js +0 -1
- package/dist/ripple/p-5ea1c7a6.entry.js +0 -1
- package/dist/ripple/p-5eb02aa9.system.entry.js +0 -1
- package/dist/ripple/p-6025efee.system.entry.js +0 -1
- package/dist/ripple/p-6a4c59e0.system.entry.js +0 -1
- package/dist/ripple/p-6d2122b9.entry.js +0 -1
- package/dist/ripple/p-6eb50cc3.system.entry.js +0 -1
- package/dist/ripple/p-7039fa60.system.entry.js +0 -1
- package/dist/ripple/p-72c22a55.entry.js +0 -1
- package/dist/ripple/p-7906a797.system.entry.js +0 -1
- package/dist/ripple/p-7b982ba8.system.entry.js +0 -1
- package/dist/ripple/p-7e4866c3.entry.js +0 -1
- package/dist/ripple/p-8f217fb1.entry.js +0 -1
- package/dist/ripple/p-90261a03.system.entry.js +0 -1
- package/dist/ripple/p-902a54c5.entry.js +0 -1
- package/dist/ripple/p-9a2cf94c.system.entry.js +0 -1
- package/dist/ripple/p-9dc64e6f.entry.js +0 -1
- package/dist/ripple/p-ade3d9a9.entry.js +0 -1
- package/dist/ripple/p-ae4c8481.system.entry.js +0 -1
- package/dist/ripple/p-b01d022f.entry.js +0 -1
- package/dist/ripple/p-b0e099f8.entry.js +0 -1
- package/dist/ripple/p-b19ea29e.entry.js +0 -1
- package/dist/ripple/p-c2657183.entry.js +0 -1
- package/dist/ripple/p-c39a3951.system.entry.js +0 -1
- package/dist/ripple/p-c7e928cb.system.entry.js +0 -1
- package/dist/ripple/p-c885c7f9.entry.js +0 -1
- package/dist/ripple/p-c9543950.system.entry.js +0 -1
- package/dist/ripple/p-cbd2473d.system.entry.js +0 -1
- package/dist/ripple/p-cedfcf23.entry.js +0 -1
- package/dist/ripple/p-d824406e.system.entry.js +0 -1
- package/dist/ripple/p-e4ff7200.entry.js +0 -1
- package/dist/ripple/p-e6f3f0e5.system.entry.js +0 -1
- package/dist/ripple/p-ec52a08e.system.js +0 -1
- package/dist/ripple/p-f05e38b1.entry.js +0 -1
- package/dist/ripple/p-f367f027.system.entry.js +0 -1
- package/dist/ripple/p-fe3451ec.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-8800c690.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .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{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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{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{color:var(--wmcolor-text-error)}:host .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{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.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}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){if(e.key==="Escape"&&this.isExpanded){e.preventDefault();e.stopPropagation();this.closePopup(true)}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-label":intl.formatMessage({id:"date.selectDate",defaultMessage:"Select date",description:"Button text for screen readers."}),"aria-describedby":"single-date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-8800c690.js";var datepickerCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}:host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .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{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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{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{color:var(--wmcolor-text-error)}:host .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{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:\"start-label-wrapper . end-label-wrapper\" \"start-date-input hyphen end-date-input\"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:\"start-label-wrapper . end-label-wrapper .\" \"start-date-input hyphen end-date-input toggle-wrapper\"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.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}";var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){if(e.key==="Escape"&&this.isExpanded){e.preventDefault();e.stopPropagation();this.closePopup(true)}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-label":intl.formatMessage({id:"date.selectDate",defaultMessage:"Select date",description:"Button text for screen readers."}),"aria-describedby":"single-date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,g as getElement}from"./index-558b5a82.js";var wmFileListCss=":host{display:block}.list-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0.5rem}";var FileList=function(){function e(e){registerInstance(this,e);this.showInfo="last-updated"}e.prototype.render=function(){return h("div",{role:"list",class:"list-wrapper"},h("slot",null))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();FileList.style=wmFileListCss;export{FileList as wm_file_list};
|
|
1
|
+
import{r as registerInstance,h,g as getElement}from"./index-558b5a82.js";var wmFileListCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}:host{display:block}.list-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0.5rem}";var FileList=function(){function e(e){registerInstance(this,e);this.showInfo="last-updated"}e.prototype.render=function(){return h("div",{role:"list",class:"list-wrapper"},h("slot",null))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();FileList.style=wmFileListCss;export{FileList as wm_file_list};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{i as intl,m as truncateText,s as showTooltip,h as hideTooltip}from"./functions-8800c690.js";var wmFileCss=':host{--wmcolor-file-background-error:var(--wmcolor-background-error);--wmcolor-file-background:var(--wmcolor-background-readonly);--wmcolor-file-border-error:var(--wmcolor-border-error);--wmcolor-file-border:var(--wmcolor-border);--wmcolor-file-checkmark-icon:var(--wmcolor-positive);--wmcolor-file-progress:var(--wmcolor-progress);display:block;width:100%}.file-wrapper{font-size:0.875rem;position:relative;list-style:none}.file-wrapper .file{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;min-height:3.5rem;padding:0.5rem 1.25rem;position:relative;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);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;min-width:5.3125rem;-ms-flex-positive:1;flex-grow:1}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;-ms-flex-align:center;align-items:center;gap:1rem;min-width:0;padding-left:5rem}.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{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:end;gap:0.25rem;text-align:right;min-width:8.5rem;max-width:450px;-ms-flex:1;flex:1}.file-wrapper .file .right-group .file-info .uploader-name{max-width:100%;overflow-wrap:break-word}.file-wrapper .file.--error{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);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:var(--wmcolor-file-checkmark-icon);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:var(--wmcolor-text-error);font-size:0.875rem}.error-message:not(:empty){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}';var File=function(){function e(e){registerInstance(this,e);this.wmFilePreview=createEvent(this,"wmFilePreview",7);this.wmFileDownload=createEvent(this,"wmFileDownload",7);this.wmFileDelete=createEvent(this,"wmFileDelete",7);this.wmFileErrorCleared=createEvent(this,"wmFileErrorCleared",7);this.fullFilename="".concat(this.name,".").concat(this.type);this.name=undefined;this.type=undefined;this.fileActions="download delete";this.lastUpdated=undefined;this.progress=undefined;this.size=undefined;this.uploadedBy=undefined;this.errorMessage=undefined;this.showInfo="last-updated"}Object.defineProperty(e.prototype,"isCondensed",{get:function(){return this.el.clientWidth<500},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isUploading",{get:function(){return this.progress!==undefined&&this.progress<100},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"previewButtonTooltip",{get:function(){return intl.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"downloadButtonTooltip",{get:function(){return intl.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"deleteButtonTooltip",{get:function(){return intl.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"previewActionMessage",{get:function(){return intl.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"downloadActionMessage",{get:function(){return intl.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"deleteActionMessage",{get:function(){return intl.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"actionMenuLabel",{get:function(){return intl.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"clearButtonText",{get:function(){return intl.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})},enumerable:false,configurable:true});e.prototype.generateClearButtonLabel=function(e){return intl.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})};e.prototype.componentWillLoad=function(){var e=this;if(!this.el.id){console.error("wm-file: a file id is required")}if(!this.name){console.error('wm-file: "name" is a required property')}if(!this.type){console.error('wm-file: "type" is a required property')}if(this.el.parentElement&&this.el.parentElement.showInfo){this.showInfo=this.el.parentElement.showInfo}if(this.showInfo==="time"){console.warn("wm-file: show-info='time' is deprecated, use show-info='last-updated'");this.showInfo="last-updated"}var t=new ResizeObserver((function(){e.setFilename()}));t.observe(this.el)};e.prototype.setFilename=function(){var e=this;requestAnimationFrame((function(){var t=e.el.shadowRoot.querySelector(".filename");var i=e.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left;var o=e.el.shadowRoot.querySelector(".right-group");var r=o?o.getBoundingClientRect().left:e.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;t.textContent=truncateText(t,e.fullFilename,r-i,7)}))};e.prototype.componentDidRender=function(){this.setFilename()};e.prototype.previewFile=function(){this.wmFilePreview.emit()};e.prototype.downloadFile=function(){this.wmFileDownload.emit()};e.prototype.deleteFile=function(){this.wmFileDelete.emit()};e.prototype.handleFilenameMouseEnter=function(e){if(e.target.textContent!==this.fullFilename){showTooltip("bottom",e.target,this.fullFilename)}};e.prototype.renderFileName=function(){var e=this;return h("div",{class:"left-group"},h("div",{class:"name-wrapper"},h("span",{class:"sr-only"},this.fullFilename),h("span",{"aria-hidden":"true",class:"filename",onMouseEnter:function(t){return e.handleFilenameMouseEnter(t)},onMouseLeave:function(){return hideTooltip()}}),this.isUploading&&h("span",{class:"sr-only"},"uploading")))};e.prototype.renderFileInfo=function(){return h("div",{class:"file-info"},(this.showInfo==="uploaded-by"||this.showInfo==="all")&&h("div",{class:"details uploader-name"},this.uploadedBy),(this.showInfo==="last-updated"||this.showInfo==="all")&&h("div",{class:"details"},this.lastUpdated),(this.showInfo==="size"||this.showInfo==="all")&&h("div",{class:"details"},this.size))};e.prototype.renderActionMenu=function(){var e=this;var t=h("wm-menuitem",{icon:"f208",onClick:function(){return e.previewFile()}},this.previewActionMessage);var i=h("wm-menuitem",{icon:"f1da",onClick:function(){return e.downloadFile()}},this.downloadActionMessage);var o=h("wm-menuitem",{icon:"f1c0",onClick:function(){return e.deleteFile()}},this.deleteActionMessage);return h("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":"".concat(this.name," ").concat(this.actionMenuLabel)},this.fileActions.includes("preview")&&t,this.fileActions.includes("download")&&i,this.fileActions.includes("delete")&&o)};e.prototype.renderFileActionButtons=function(){var e=this;var t=h("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"preview ".concat(this.name),icon:"f208",onClick:function(){return e.previewFile()}});var i=h("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"download ".concat(this.name),icon:"f1da",onClick:function(){return e.downloadFile()}});var o=h("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"delete ".concat(this.name),icon:"f1c0",onClick:function(){return e.deleteFile()}});return h("div",{class:"file-controls"},this.fileActions.includes("preview")&&t,this.fileActions.includes("download")&&i,this.fileActions.includes("delete")&&o)};e.prototype.renderFileInProgress=function(){return h("div",{class:"file-wrapper"},h("div",{class:"file --progress"},h("div",{class:"progress",style:{background:"linear-gradient(to right, var(--wmcolor-file-progress) ".concat(this.progress,"%, transparent ").concat(this.progress,"%)")}}),this.renderFileName()))};e.prototype.renderFileControls=function(){var e=this.fileActions.split(" ").length===1;var t=this.isCondensed&&!e;return t?this.renderActionMenu():this.renderFileActionButtons()};e.prototype.renderFile=function(){var e=this;return h("div",{class:"file-wrapper ".concat(this.progress===100?"checked":"")},h("div",{class:"file ".concat(this.errorMessage?"--error":"")},this.renderFileName(),!this.errorMessage&&h("div",{class:"right-group ".concat(this.isCondensed?"condensed":"")},this.renderFileInfo(),this.fileActions!==""&&this.renderFileControls()),this.errorMessage&&h("wm-button",{"permanently-delete":true,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(this.name),onClick:function(){return e.wmFileErrorCleared.emit()}},this.clearButtonText)),this.errorMessage&&h("div",{class:"error-message"},this.errorMessage))};e.prototype.render=function(){return h(Host,{role:"listitem"},this.isUploading?this.renderFileInProgress():this.renderFile())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();File.style=wmFileCss;export{File as wm_file};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{i as intl,m as truncateText,s as showTooltip,h as hideTooltip}from"./functions-8800c690.js";var wmFileCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}:host{--wmcolor-file-background-error:var(--wmcolor-background-error);--wmcolor-file-background:var(--wmcolor-background-readonly);--wmcolor-file-border-error:var(--wmcolor-border-error);--wmcolor-file-border:var(--wmcolor-border);--wmcolor-file-checkmark-icon:var(--wmcolor-positive);--wmcolor-file-progress:var(--wmcolor-progress);display:block;width:100%}.file-wrapper{font-size:0.875rem;position:relative;list-style:none}.file-wrapper .file{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;min-height:3.5rem;padding:0.5rem 1.25rem;position:relative;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);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;min-width:5.3125rem;-ms-flex-positive:1;flex-grow:1}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;-ms-flex-align:center;align-items:center;gap:1rem;min-width:0;padding-left:5rem}.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{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:end;gap:0.25rem;text-align:right;min-width:8.5rem;max-width:450px;-ms-flex:1;flex:1}.file-wrapper .file .right-group .file-info .uploader-name{max-width:100%;overflow-wrap:break-word}.file-wrapper .file.--error{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);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:var(--wmcolor-file-checkmark-icon);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:var(--wmcolor-text-error);font-size:0.875rem}.error-message:not(:empty){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}";var File=function(){function e(e){registerInstance(this,e);this.wmFilePreview=createEvent(this,"wmFilePreview",7);this.wmFileDownload=createEvent(this,"wmFileDownload",7);this.wmFileDelete=createEvent(this,"wmFileDelete",7);this.wmFileErrorCleared=createEvent(this,"wmFileErrorCleared",7);this.fullFilename="".concat(this.name,".").concat(this.type);this.name=undefined;this.type=undefined;this.fileActions="download delete";this.lastUpdated=undefined;this.progress=undefined;this.size=undefined;this.uploadedBy=undefined;this.errorMessage=undefined;this.showInfo="last-updated"}Object.defineProperty(e.prototype,"isCondensed",{get:function(){return this.el.clientWidth<500},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isUploading",{get:function(){return this.progress!==undefined&&this.progress<100},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"previewButtonTooltip",{get:function(){return intl.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"downloadButtonTooltip",{get:function(){return intl.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"deleteButtonTooltip",{get:function(){return intl.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"previewActionMessage",{get:function(){return intl.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"downloadActionMessage",{get:function(){return intl.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"deleteActionMessage",{get:function(){return intl.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"actionMenuLabel",{get:function(){return intl.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"clearButtonText",{get:function(){return intl.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})},enumerable:false,configurable:true});e.prototype.generateClearButtonLabel=function(e){return intl.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})};e.prototype.componentWillLoad=function(){var e=this;if(!this.el.id){console.error("wm-file: a file id is required")}if(!this.name){console.error('wm-file: "name" is a required property')}if(!this.type){console.error('wm-file: "type" is a required property')}if(this.el.parentElement&&this.el.parentElement.showInfo){this.showInfo=this.el.parentElement.showInfo}if(this.showInfo==="time"){console.warn("wm-file: show-info='time' is deprecated, use show-info='last-updated'");this.showInfo="last-updated"}var t=new ResizeObserver((function(){e.setFilename()}));t.observe(this.el)};e.prototype.setFilename=function(){var e=this;requestAnimationFrame((function(){var t=e.el.shadowRoot.querySelector(".filename");var i=e.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left;var o=e.el.shadowRoot.querySelector(".right-group");var r=o?o.getBoundingClientRect().left:e.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;t.textContent=truncateText(t,e.fullFilename,r-i,7)}))};e.prototype.componentDidRender=function(){this.setFilename()};e.prototype.previewFile=function(){this.wmFilePreview.emit()};e.prototype.downloadFile=function(){this.wmFileDownload.emit()};e.prototype.deleteFile=function(){this.wmFileDelete.emit()};e.prototype.handleFilenameMouseEnter=function(e){if(e.target.textContent!==this.fullFilename){showTooltip("bottom",e.target,this.fullFilename)}};e.prototype.renderFileName=function(){var e=this;return h("div",{class:"left-group"},h("div",{class:"name-wrapper"},h("span",{class:"sr-only"},this.fullFilename),h("span",{"aria-hidden":"true",class:"filename",onMouseEnter:function(t){return e.handleFilenameMouseEnter(t)},onMouseLeave:function(){return hideTooltip()}}),this.isUploading&&h("span",{class:"sr-only"},"uploading")))};e.prototype.renderFileInfo=function(){return h("div",{class:"file-info"},(this.showInfo==="uploaded-by"||this.showInfo==="all")&&h("div",{class:"details uploader-name"},this.uploadedBy),(this.showInfo==="last-updated"||this.showInfo==="all")&&h("div",{class:"details"},this.lastUpdated),(this.showInfo==="size"||this.showInfo==="all")&&h("div",{class:"details"},this.size))};e.prototype.renderActionMenu=function(){var e=this;var t=h("wm-menuitem",{icon:"f208",onClick:function(){return e.previewFile()}},this.previewActionMessage);var i=h("wm-menuitem",{icon:"f1da",onClick:function(){return e.downloadFile()}},this.downloadActionMessage);var o=h("wm-menuitem",{icon:"f1c0",onClick:function(){return e.deleteFile()}},this.deleteActionMessage);return h("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":"".concat(this.name," ").concat(this.actionMenuLabel)},this.fileActions.includes("preview")&&t,this.fileActions.includes("download")&&i,this.fileActions.includes("delete")&&o)};e.prototype.renderFileActionButtons=function(){var e=this;var t=h("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"preview ".concat(this.name),icon:"f208",onClick:function(){return e.previewFile()}});var i=h("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"download ".concat(this.name),icon:"f1da",onClick:function(){return e.downloadFile()}});var o=h("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":"delete ".concat(this.name),icon:"f1c0",onClick:function(){return e.deleteFile()}});return h("div",{class:"file-controls"},this.fileActions.includes("preview")&&t,this.fileActions.includes("download")&&i,this.fileActions.includes("delete")&&o)};e.prototype.renderFileInProgress=function(){return h("div",{class:"file-wrapper"},h("div",{class:"file --progress"},h("div",{class:"progress",style:{background:"linear-gradient(to right, var(--wmcolor-file-progress) ".concat(this.progress,"%, transparent ").concat(this.progress,"%)")}}),this.renderFileName()))};e.prototype.renderFileControls=function(){var e=this.fileActions.split(" ").length===1;var t=this.isCondensed&&!e;return t?this.renderActionMenu():this.renderFileActionButtons()};e.prototype.renderFile=function(){var e=this;return h("div",{class:"file-wrapper ".concat(this.progress===100?"checked":"")},h("div",{class:"file ".concat(this.errorMessage?"--error":"")},this.renderFileName(),!this.errorMessage&&h("div",{class:"right-group ".concat(this.isCondensed?"condensed":"")},this.renderFileInfo(),this.fileActions!==""&&this.renderFileControls()),this.errorMessage&&h("wm-button",{"permanently-delete":true,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(this.name),onClick:function(){return e.wmFileErrorCleared.emit()}},this.clearButtonText)),this.errorMessage&&h("div",{class:"error-message"},this.errorMessage))};e.prototype.render=function(){return h(Host,{role:"listitem"},this.isUploading?this.renderFileInProgress():this.renderFile())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();File.style=wmFileCss;export{File as wm_file};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-558b5a82.js";import{t as toBool,a as handleDisabledAttribute,b as triggerFormSubmit}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmInputCss=':host{font-family:inherit;width:100%}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .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{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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{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{color:var(--wmcolor-text-error)}:host .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{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper{width:100%}:host .wrapper .text-after-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px}:host .wrapper .text-after{-ms-flex:0 1 fit-content;flex:0 1 fit-content}:host .wrapper .inputfield-wrapper{height:2.5rem;min-width:6.25rem;border:1px solid var(--wmcolor-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .inputfield-wrapper.disabled{background-color:var(--wmcolor-input-background-disabled);color:var(--wmcolor-input-text-disabled)}:host .wrapper .inputfield-wrapper.disabled .symbol{background:none}:host .wrapper .symbol{display:-ms-flexbox;display:flex;background-color:var(--wmcolor-input-unit-background);-ms-flex:0 0 44px;flex:0 0 44px;padding-inline:8px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .wrapper .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:var(--wmcolor-input-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:focus{outline:none}:host .wrapper input[type=number]{padding-right:0}:host .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper.invalid .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;line-height:100%}:host .wrapper.invalid .error-message:not(:empty){margin-top:0.25rem}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .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}';var Input=function(){function t(t){registerInstance(this,t);this.wmInputValueChanged=createEvent(this,"wmInputValueChanged",7);this.previousValue="";this.label=undefined;this.labelPosition="top";this.value="";this.disabled=false;this.info=undefined;this.inputWidth="";this.placeholder="";this.requiredField=false;this.errorMessage=undefined;this.characterLimit=undefined;this.symbolBefore=undefined;this.symbolAfter=undefined;this.textAfter=undefined;this.type="text";this.step=1;this.min=undefined;this.max=undefined;this.isSubmit=false;this.announcement=""}t.prototype.getInputWidth=function(){return this.inputWidth?{width:this.inputWidth}:{flex:"1"}};Object.defineProperty(t.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});t.prototype.componentWillLoad=function(){if(!this.label){console.error("wm-input requires the label property")}handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.componentDidLoad=function(){this.previousValue=this.inputEl.value};t.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.announceError=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.handleInput=function(t){this.value=t.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};t.prototype.handleKeyDown=function(t){var e=t.ctrlKey||t.metaKey||t.altKey;var r=/^.$/.test(t.key)&&!e;var i=r&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit;if(i){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}if(t.key==="Enter"){this.isSubmit&&triggerFormSubmit(this.el.closest("form"))}};t.prototype.handleBlur=function(){if(this.value!==this.previousValue){this.wmInputValueChanged.emit({value:this.value})}this.previousValue=this.value;this.inputWrapperEl.classList.remove("focus")};t.prototype.handleFocus=function(){this.inputWrapperEl.classList.add("focus")};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.generateCharacterLimitWarning=function(t,e){var r=globalMessages.getCharactersEntered(t,e);if(t>=e){r+=" ".concat(globalMessages.characterLimitReached)}return r};t.prototype.descriptors=function(){return this.symbolBefore||this.symbolAfter||this.textAfter?"symbol-before inputfield symbol-after text-after info error":"info error"};t.prototype.render=function(){var t=this;return h("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":""),ref:function(e){return t.inputWrapperEl=e}},h("div",{class:"label-wrapper"},h("label",{htmlFor:"inputfield",class:"label"},this.label,this.characterLimit&&h("span",{class:"sr-only"}," ",globalMessages.getCharacterLimit(this.characterLimit)),this.requiredField&&h("span",{class:"required","aria-hidden":"true"},"*"))),h("div",{class:"inner-wrapper"},h("div",{class:"text-after-wrapper"},h("div",{class:"inputfield-wrapper ".concat(this.isDisabled?"disabled":""),style:this.getInputWidth()},this.symbolBefore&&h("span",{class:"symbol",id:"symbol-before"},this.symbolBefore),h("input",{ref:function(e){return t.inputEl=e},id:"inputfield",disabled:this.isDisabled,"aria-describedby":this.descriptors(),onInput:function(e){return t.handleInput(e)},onKeyDown:function(e){return t.handleKeyDown(e)},onBlur:function(){return t.handleBlur()},onFocus:function(){return t.handleFocus()},placeholder:this.placeholder,autocomplete:"off","aria-required":this.requiredField?"true":null,maxLength:this.characterLimit||undefined,type:this.type,step:this.step,max:this.max,min:this.min,value:this.el.value}),this.symbolAfter&&h("span",{class:"symbol",id:"symbol-after"},this.symbolAfter),this.characterLimit&&typeof this.characterLimit==="number"?h("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.textAfter&&h("span",{class:"text-after",id:"text-after"},this.textAfter)),this.info&&h("div",{id:"info",class:"info"},this.info),h("div",{id:"error",class:"error-message"},this.errorMessage),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(e){return t.liveRegionEl=e}},this.announcement)))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabledChange"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return t}();Input.style=wmInputCss;export{Input as wm_input};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-558b5a82.js";import{t as toBool,a as handleDisabledAttribute,b as triggerFormSubmit}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmInputCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}:host{font-family:inherit;width:100%}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .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{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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{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{color:var(--wmcolor-text-error)}:host .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{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper{width:100%}:host .wrapper .text-after-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px}:host .wrapper .text-after{-ms-flex:0 1 fit-content;flex:0 1 fit-content}:host .wrapper .inputfield-wrapper{height:2.5rem;min-width:6.25rem;border:1px solid var(--wmcolor-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .inputfield-wrapper.disabled{background-color:var(--wmcolor-input-background-disabled);color:var(--wmcolor-input-text-disabled)}:host .wrapper .inputfield-wrapper.disabled .symbol{background:none}:host .wrapper .symbol{display:-ms-flexbox;display:flex;background-color:var(--wmcolor-input-unit-background);-ms-flex:0 0 44px;flex:0 0 44px;padding-inline:8px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .wrapper .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:var(--wmcolor-input-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:focus{outline:none}:host .wrapper input[type=number]{padding-right:0}:host .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper.invalid .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;line-height:100%}:host .wrapper.invalid .error-message:not(:empty){margin-top:0.25rem}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .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}";var Input=function(){function t(t){registerInstance(this,t);this.wmInputValueChanged=createEvent(this,"wmInputValueChanged",7);this.previousValue="";this.label=undefined;this.labelPosition="top";this.value="";this.disabled=false;this.info=undefined;this.inputWidth="";this.placeholder="";this.requiredField=false;this.errorMessage=undefined;this.characterLimit=undefined;this.symbolBefore=undefined;this.symbolAfter=undefined;this.textAfter=undefined;this.type="text";this.step=1;this.min=undefined;this.max=undefined;this.isSubmit=false;this.announcement=""}t.prototype.getInputWidth=function(){return this.inputWidth?{width:this.inputWidth}:{flex:"1"}};Object.defineProperty(t.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});t.prototype.componentWillLoad=function(){if(!this.label){console.error("wm-input requires the label property")}handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.componentDidLoad=function(){this.previousValue=this.inputEl.value};t.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.announceError=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.handleInput=function(t){this.value=t.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};t.prototype.handleKeyDown=function(t){var e=t.ctrlKey||t.metaKey||t.altKey;var i=/^.$/.test(t.key)&&!e;var r=i&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit;if(r){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}if(t.key==="Enter"){this.isSubmit&&triggerFormSubmit(this.el.closest("form"))}};t.prototype.handleBlur=function(){if(this.value!==this.previousValue){this.wmInputValueChanged.emit({value:this.value})}this.previousValue=this.value;this.inputWrapperEl.classList.remove("focus")};t.prototype.handleFocus=function(){this.inputWrapperEl.classList.add("focus")};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.generateCharacterLimitWarning=function(t,e){var i=globalMessages.getCharactersEntered(t,e);if(t>=e){i+=" ".concat(globalMessages.characterLimitReached)}return i};t.prototype.descriptors=function(){return this.symbolBefore||this.symbolAfter||this.textAfter?"symbol-before inputfield symbol-after text-after info error":"info error"};t.prototype.render=function(){var t=this;return h("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":""),ref:function(e){return t.inputWrapperEl=e}},h("div",{class:"label-wrapper"},h("label",{htmlFor:"inputfield",class:"label"},this.label,this.characterLimit&&h("span",{class:"sr-only"}," ",globalMessages.getCharacterLimit(this.characterLimit)),this.requiredField&&h("span",{class:"required","aria-hidden":"true"},"*"))),h("div",{class:"inner-wrapper"},h("div",{class:"text-after-wrapper"},h("div",{class:"inputfield-wrapper ".concat(this.isDisabled?"disabled":""),style:this.getInputWidth()},this.symbolBefore&&h("span",{class:"symbol",id:"symbol-before"},this.symbolBefore),h("input",{ref:function(e){return t.inputEl=e},id:"inputfield",disabled:this.isDisabled,"aria-describedby":this.descriptors(),onInput:function(e){return t.handleInput(e)},onKeyDown:function(e){return t.handleKeyDown(e)},onBlur:function(){return t.handleBlur()},onFocus:function(){return t.handleFocus()},placeholder:this.placeholder,autocomplete:"off","aria-required":this.requiredField?"true":null,maxLength:this.characterLimit||undefined,type:this.type,step:this.step,max:this.max,min:this.min,value:this.el.value}),this.symbolAfter&&h("span",{class:"symbol",id:"symbol-after"},this.symbolAfter),this.characterLimit&&typeof this.characterLimit==="number"?h("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.textAfter&&h("span",{class:"text-after",id:"text-after"},this.textAfter)),this.info&&h("div",{id:"info",class:"info"},this.info),h("div",{id:"error",class:"error-message"},this.errorMessage),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(e){return t.liveRegionEl=e}},this.announcement)))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabledChange"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return t}();Input.style=wmInputCss;export{Input as wm_input};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,i,e,r){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?e(t.value):n(t.value).then(a,s)}l((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return l([t,i])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1];o=s;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(s);break}if(o[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{d as debounce,F as transposeMatrix,x as csvToArray,G as wrapAround,H as getSmallestSkipInterval,I as calcPercentageInRange}from"./functions-8800c690.js";import{n as abbrNumber,o as getInterval}from"./chartFunctions-34f19953.js";import{l as lineChartMessages,c as chartMessages,g as globalMessages}from"./intl-b110ca8d.js";var wmLineChartCss=':host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-interactive-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon: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:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);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:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0;border-radius:3px}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .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}';var LineChart=function(){function t(t){var i=this;registerInstance(this,t);this.minTickWidth=120;this.popoverData=[];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=debounce((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.popoverIndex=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(i){return t.buildLineDataPointDetails(i[0],i[1])}));this.popoverData=transposeMatrix(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return csvToArray(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pointEls",{get:function(){return this.plotAreaEl.querySelectorAll(".point")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var i=new ResizeObserver((function(){return t.debouncedResize()}));i.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,i){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPointByEl(this.lineEls[this.firstVisibleLineIdx].querySelector(".point"))}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var e=wrapAround(i,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[e].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var r=wrapAround(i,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[r].focus();break}};t.prototype.handleDataPointKeydown=function(t){var i=t.target;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();this.navigatePointsVertically(i,-1);break;case"ArrowDown":t.preventDefault();this.navigatePointsVertically(i,1);break;case"ArrowLeft":t.preventDefault();this.navigatePointsHorizontally(i,-1);break;case"ArrowRight":t.preventDefault();this.navigatePointsHorizontally(i,1);break}};t.prototype.navigatePointsVertically=function(t,i){var e=Array.from(this.pointEls).filter((function(i){return i.dataset.pointidx==t.dataset.pointidx}));if(e.length>1){var r=wrapAround(e.indexOf(t),i,e.length-1);var n=e[r];this.announce(this.lineFocusMessage(parseInt(n.dataset.lineidx)));this.focusDataPointByEl(n)}};t.prototype.navigatePointsHorizontally=function(t,i){var e=Array.from(t.parentElement.querySelectorAll(".point"));if(e.length>1){var r=wrapAround(e.indexOf(t),i,e.length-1);var n=e[r];this.focusDataPointByEl(n)}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var i=this.dataPointMatrix[t][0].lineLabel;var e=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(i,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(e," data points")};t.prototype.focusDataPointByEl=function(t){this.pointEls.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus()};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=csvToArray(this.yRange).map((function(t){return parseInt(t)}))}else{var i=[];var e=Object.values(this.parsedLineData).flat();e.forEach((function(t){return i.push.apply(i,Object.values(t))}));var r=i.filter((function(t){return t!==null}));var n=Math.min.apply(Math,r);var o=Math.max.apply(Math,r);var a=getInterval(o-n,4);var s=a;while(n%a!==0&&s>0){n--;s--}a=getInterval(o-n,4);var l=n;while(l<=o+a){t.push(l);l+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var i=getSmallestSkipInterval(this.xIntervals,t),e=i.skipInterval,r=i.skippedList;this.intervalSkip=e;return r};t.prototype.buildLineDataPointDetails=function(t,i){var e=this;var r=[];var n=Object.entries(i);var o;n.forEach((function(i,a){var s=i[0],l=i[1];var h=100/(n.length-1)*a;var c=l===null?null:100-calcPercentageInRange(l,e.yIntervals[e.yIntervals.length-1],e.yIntervals[0]);if(a===0){h+=e.plotAreaEl&&e.plotAreaEl.clientWidth>0?8/e.plotAreaEl.clientWidth*100:1}if(s===e.highlightStart&&!o){o=true}r.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:h,yPositionPercent:c,highlighted:o});if(s===e.highlightEnd&&o){o=false}}));return r};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(i){return i!==t}))}else{this.hiddenLines.push(t)}forceUpdate(this.el)};t.prototype.resetDataPointFocus=function(){this.popoverIndex=-1;this.pointEls.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var t=this.lineEls[this.firstVisibleLineIdx];var i=t.querySelectorAll(".point")[0];i.tabIndex=0}};t.prototype.calcDelta=function(t,i){var e;if(t.yValue===null||i.yValue===null){e=lineChartMessages.noData}else if(t.yValue==i.yValue){e="0%"}else if(i.yValue==0){e="-"}else{var r=(t.yValue-i.yValue)/i.yValue*100;var n=Math.round(r*100)/100;e="".concat(n>0?"+":"").concat(n,"%")}return e};t.prototype.renderLegend=function(){var t=this;var i=Object.keys(this.parsedLineData);return h("div",{ref:function(i){return t.legendEl=i},class:"legend"},i.map((function(i,e){var r=t.hiddenLines.includes(e);var n=t.focusedLine!==-1&&t.focusedLine!==e;return h("div",{id:"legend-label-".concat(e),class:"legend-label ".concat(n?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:e},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(e),i,t.visibilityToggles&&t.renderVisibilityToggle(i,e,r))})))};t.prototype.renderVisibilityToggle=function(t,i,e){var r=this;return h("wm-button",{id:"visibility-button-".concat(i),class:"visibility-toggle","label-for-identical-buttons":"".concat(i===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(e?globalMessages.show:globalMessages.hide," ").concat(t," toggle ").concat(e?"pressed":""),"button-type":"navigational",tooltip:e?globalMessages.show:globalMessages.hide,tooltipPosition:"bottom",icon:e?"f209":"f208",onClick:function(){return r.toggleLineVisibility(i)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,i)},onFocus:function(){return r.popoverIndex=-1}})};t.prototype.renderIcon=function(t){var i=this.lineStyles[t],e=i.color,r=i.icon;var n={"--iconColor":e,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return h("span",{class:"icon",style:n})};t.prototype.renderXIntervals=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"x-intervals",style:i},this.xIntervals.map((function(i){return h("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(i)?"":"hidden")},i)})))};t.prototype.renderYIntervals=function(){var t=this;return h("div",{ref:function(i){return t.yIntervalsEl=i},class:"y-intervals"},this.yIntervals.map((function(t){return h("span",{class:"y-interval"},abbrNumber(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(i,e){var r=t.focusedLine===e?"focused":"faded";var n=t.hiddenLines.includes(e);return h("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(n?"hidden":"")},t.renderLines(e),t.renderPoints(e))}))};t.prototype.renderPoints=function(t){var i=this;var e=this.dataPointMatrix[t];return h("div",{class:"line-icons"},e.map((function(r,n){var o=r.lineLabel,a=r.xValue,s=r.yValue,l=r.xPositionPercent,c=r.yPositionPercent,u=r.highlighted;if(s!==null){var p=i.lineStyles[t],f=p.color,v=p.icon;var d=t===0&&n===0?0:undefined;var g={"--icon":'"\\'.concat(v,'"'),"--iconColor":f,"--xPosition":l+"%","--yPosition":c+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(o," ").concat(u?i.highlightQualifier:""," ").concat(i.xAxisLabel," ").concat(a+(i.parsedUnits[0]?i.parsedUnits[0]:""),", ").concat(i.yAxisLabel,": ").concat(s+(i.parsedUnits[1]?i.parsedUnits[1]:""));if(i.showDeltas&&n>0){var x=e[n-1];var m=lineChartMessages.getChangeSince(x.xValue);b+=", ".concat(m," ").concat(i.calcDelta(r,x))}return h("span",{id:"".concat(o,"-").concat(n),role:"img","aria-label":b,tabIndex:d,class:"point icon",style:g,"data-lineidx":t,"data-pointidx":n,"data-xvalue":a,onKeyDown:function(t){return i.handleDataPointKeydown(t)},onFocus:function(){return i.popoverIndex=n},onClick:function(t){return i.focusDataPointByEl(t.target)},onMouseEnter:function(){return i.popoverIndex=n}})}})))};t.prototype.renderLines=function(t){var i=this;var e=this.dataPointMatrix[t];return h("svg",{class:"line-svg"},e.map((function(r,n){var o=r.yValue!==null&&n!==e.length-1&&e[n+1].yValue!==null;if(o){var a=i.lineStyles[t].color;var s=r.xPositionPercent,l=r.yPositionPercent;var c=e[n+1],u=c.xPositionPercent,p=c.yPositionPercent;return h("line",{x1:s+"%",y1:l+"%",x2:u+"%",y2:p+"%",stroke:a,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"hover-area-wrapper",style:i,onMouseLeave:function(){return t.popoverIndex=-1}},this.xIntervals.map((function(i,e){return h("div",{onMouseEnter:function(){return t.popoverIndex=e}})})))};t.prototype.renderPopover=function(){var t=this;var i=this.popoverData&&this.popoverData[this.popoverIndex]&&this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));if(!i){return""}var e=this.popoverData[this.popoverIndex];var r=e[0].xPositionPercent;var n=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=n.reduce((function(t,i){return t+i}),0)/n.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var u=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var f=u>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var v=8/this.plotAreaEl.clientWidth*100;var d={"--leftPosition":p?r+v+"%":"unset","--rightPosition":f?100-r+v+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!f&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");d={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return h("div",{ref:function(i){return t.popoverEl=i},class:"popover",style:d},h("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&h("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.popoverIndex>0&&h("div",{class:"comparison-title"},lineChartMessages.getChangeSince(this.popoverData[this.popoverIndex-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var i=this.popoverData[this.popoverIndex];return h("table",{class:"popover-table"},i.map((function(i,e){if(!t.hiddenLines.includes(e)){var r=i.lineLabel,n=i.yValue;var o=t.popoverIndex>0?t.popoverData[t.popoverIndex-1][e]:null;var a=n!==null?(new Intl.NumberFormat).format(n):null;return h("tr",{class:"popover-row"},h("td",null,t.renderIcon(e)),h("td",{class:"row-label"},r),h("td",{class:"row-value"},n===null?lineChartMessages.noData:a,n!==null&&t.parsedUnits[1]&&h("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&o&&t.renderDeltas(i,o))}})))};t.prototype.renderDeltas=function(t,i){var e=this.calcDelta(t,i);var r=e.toString()[0]=="+"||e=="-"?"positive":e.toString()[0]=="-"?"negative":"";return i&&h("td",{class:"delta --".concat(r)},e)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix.length>0&&this.dataPointMatrix[0][this.popoverIndex];if(!t){return""}var i=this.dataPointMatrix[0][this.popoverIndex].xPositionPercent;var e={"--xPosition":i+"%"};return h("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var i=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var e={"--startPercentage":t+"%","--endPercentage":i+"%"};return h("div",{class:"highlight",style:e})};t.prototype.render=function(){var t=this;return h(Host,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.popoverIndex=-1}},h("div",{class:"component-wrapper",role:"application","aria-roledescription":chartMessages.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),h("div",{class:"chart-wrapper"},h("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),h("div",{ref:function(i){return t.plotAreaEl=i},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.popoverIndex!==-1&&this.renderHoverIndicator(),this.popoverIndex!==-1&&this.renderPopover(),this.renderXIntervals(),h("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),h("div",{id:"chart-description",class:"sr-only"},"".concat(lineChartMessages.instructions," ").concat(this.description)),h("div",{ref:function(i){return t.liveRegionEl=i},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}();LineChart.style=wmLineChartCss;export{LineChart as wm_line_chart};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,i,e,r){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?e(t.value):n(t.value).then(a,s)}l((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return l([t,i])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1];o=s;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(s);break}if(o[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{d as debounce,F as transposeMatrix,x as csvToArray,G as wrapAround,H as getSmallestSkipInterval,I as calcPercentageInRange}from"./functions-8800c690.js";import{n as abbrNumber,o as getInterval}from"./chartFunctions-34f19953.js";import{l as lineChartMessages,c as chartMessages,g as globalMessages}from"./intl-b110ca8d.js";var wmLineChartCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}:host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-interactive-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon: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:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);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:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0;border-radius:3px}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .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}";var LineChart=function(){function t(t){var i=this;registerInstance(this,t);this.minTickWidth=120;this.popoverData=[];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=debounce((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.popoverIndex=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(i){return t.buildLineDataPointDetails(i[0],i[1])}));this.popoverData=transposeMatrix(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return csvToArray(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pointEls",{get:function(){return this.plotAreaEl.querySelectorAll(".point")},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var i=new ResizeObserver((function(){return t.debouncedResize()}));i.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,i){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPointByEl(this.lineEls[this.firstVisibleLineIdx].querySelector(".point"))}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var e=wrapAround(i,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[e].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var r=wrapAround(i,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[r].focus();break}};t.prototype.handleDataPointKeydown=function(t){var i=t.target;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();this.navigatePointsVertically(i,-1);break;case"ArrowDown":t.preventDefault();this.navigatePointsVertically(i,1);break;case"ArrowLeft":t.preventDefault();this.navigatePointsHorizontally(i,-1);break;case"ArrowRight":t.preventDefault();this.navigatePointsHorizontally(i,1);break}};t.prototype.navigatePointsVertically=function(t,i){var e=Array.from(this.pointEls).filter((function(i){return i.dataset.pointidx==t.dataset.pointidx}));if(e.length>1){var r=wrapAround(e.indexOf(t),i,e.length-1);var n=e[r];this.announce(this.lineFocusMessage(parseInt(n.dataset.lineidx)));this.focusDataPointByEl(n)}};t.prototype.navigatePointsHorizontally=function(t,i){var e=Array.from(t.parentElement.querySelectorAll(".point"));if(e.length>1){var r=wrapAround(e.indexOf(t),i,e.length-1);var n=e[r];this.focusDataPointByEl(n)}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var i=this.dataPointMatrix[t][0].lineLabel;var e=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(i,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(e," data points")};t.prototype.focusDataPointByEl=function(t){this.pointEls.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus()};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=csvToArray(this.yRange).map((function(t){return parseInt(t)}))}else{var i=[];var e=Object.values(this.parsedLineData).flat();e.forEach((function(t){return i.push.apply(i,Object.values(t))}));var r=i.filter((function(t){return t!==null}));var n=Math.min.apply(Math,r);var o=Math.max.apply(Math,r);var a=getInterval(o-n,4);var s=a;while(n%a!==0&&s>0){n--;s--}a=getInterval(o-n,4);var l=n;while(l<=o+a){t.push(l);l+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var i=getSmallestSkipInterval(this.xIntervals,t),e=i.skipInterval,r=i.skippedList;this.intervalSkip=e;return r};t.prototype.buildLineDataPointDetails=function(t,i){var e=this;var r=[];var n=Object.entries(i);var o;n.forEach((function(i,a){var s=i[0],l=i[1];var h=100/(n.length-1)*a;var c=l===null?null:100-calcPercentageInRange(l,e.yIntervals[e.yIntervals.length-1],e.yIntervals[0]);if(a===0){h+=e.plotAreaEl&&e.plotAreaEl.clientWidth>0?8/e.plotAreaEl.clientWidth*100:1}if(s===e.highlightStart&&!o){o=true}r.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:h,yPositionPercent:c,highlighted:o});if(s===e.highlightEnd&&o){o=false}}));return r};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(i){return i!==t}))}else{this.hiddenLines.push(t)}forceUpdate(this.el)};t.prototype.resetDataPointFocus=function(){this.popoverIndex=-1;this.pointEls.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var t=this.lineEls[this.firstVisibleLineIdx];var i=t.querySelectorAll(".point")[0];i.tabIndex=0}};t.prototype.calcDelta=function(t,i){var e;if(t.yValue===null||i.yValue===null){e=lineChartMessages.noData}else if(t.yValue==i.yValue){e="0%"}else if(i.yValue==0){e="-"}else{var r=(t.yValue-i.yValue)/i.yValue*100;var n=Math.round(r*100)/100;e="".concat(n>0?"+":"").concat(n,"%")}return e};t.prototype.renderLegend=function(){var t=this;var i=Object.keys(this.parsedLineData);return h("div",{ref:function(i){return t.legendEl=i},class:"legend"},i.map((function(i,e){var r=t.hiddenLines.includes(e);var n=t.focusedLine!==-1&&t.focusedLine!==e;return h("div",{id:"legend-label-".concat(e),class:"legend-label ".concat(n?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:e},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(e),i,t.visibilityToggles&&t.renderVisibilityToggle(i,e,r))})))};t.prototype.renderVisibilityToggle=function(t,i,e){var r=this;return h("wm-button",{id:"visibility-button-".concat(i),class:"visibility-toggle","label-for-identical-buttons":"".concat(i===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(e?globalMessages.show:globalMessages.hide," ").concat(t," toggle ").concat(e?"pressed":""),"button-type":"navigational",tooltip:e?globalMessages.show:globalMessages.hide,tooltipPosition:"bottom",icon:e?"f209":"f208",onClick:function(){return r.toggleLineVisibility(i)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,i)},onFocus:function(){return r.popoverIndex=-1}})};t.prototype.renderIcon=function(t){var i=this.lineStyles[t],e=i.color,r=i.icon;var n={"--iconColor":e,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return h("span",{class:"icon",style:n})};t.prototype.renderXIntervals=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"x-intervals",style:i},this.xIntervals.map((function(i){return h("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(i)?"":"hidden")},i)})))};t.prototype.renderYIntervals=function(){var t=this;return h("div",{ref:function(i){return t.yIntervalsEl=i},class:"y-intervals"},this.yIntervals.map((function(t){return h("span",{class:"y-interval"},abbrNumber(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(i,e){var r=t.focusedLine===e?"focused":"faded";var n=t.hiddenLines.includes(e);return h("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(n?"hidden":"")},t.renderLines(e),t.renderPoints(e))}))};t.prototype.renderPoints=function(t){var i=this;var e=this.dataPointMatrix[t];return h("div",{class:"line-icons"},e.map((function(r,n){var o=r.lineLabel,a=r.xValue,s=r.yValue,l=r.xPositionPercent,c=r.yPositionPercent,u=r.highlighted;if(s!==null){var p=i.lineStyles[t],f=p.color,v=p.icon;var d=t===0&&n===0?0:undefined;var g={"--icon":'"\\'.concat(v,'"'),"--iconColor":f,"--xPosition":l+"%","--yPosition":c+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(o," ").concat(u?i.highlightQualifier:""," ").concat(i.xAxisLabel," ").concat(a+(i.parsedUnits[0]?i.parsedUnits[0]:""),", ").concat(i.yAxisLabel,": ").concat(s+(i.parsedUnits[1]?i.parsedUnits[1]:""));if(i.showDeltas&&n>0){var m=e[n-1];var x=lineChartMessages.getChangeSince(m.xValue);b+=", ".concat(x," ").concat(i.calcDelta(r,m))}return h("span",{id:"".concat(o,"-").concat(n),role:"img","aria-label":b,tabIndex:d,class:"point icon",style:g,"data-lineidx":t,"data-pointidx":n,"data-xvalue":a,onKeyDown:function(t){return i.handleDataPointKeydown(t)},onFocus:function(){return i.popoverIndex=n},onClick:function(t){return i.focusDataPointByEl(t.target)},onMouseEnter:function(){return i.popoverIndex=n}})}})))};t.prototype.renderLines=function(t){var i=this;var e=this.dataPointMatrix[t];return h("svg",{class:"line-svg"},e.map((function(r,n){var o=r.yValue!==null&&n!==e.length-1&&e[n+1].yValue!==null;if(o){var a=i.lineStyles[t].color;var s=r.xPositionPercent,l=r.yPositionPercent;var c=e[n+1],u=c.xPositionPercent,p=c.yPositionPercent;return h("line",{x1:s+"%",y1:l+"%",x2:u+"%",y2:p+"%",stroke:a,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var i={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return h("div",{class:"hover-area-wrapper",style:i,onMouseLeave:function(){return t.popoverIndex=-1}},this.xIntervals.map((function(i,e){return h("div",{onMouseEnter:function(){return t.popoverIndex=e}})})))};t.prototype.renderPopover=function(){var t=this;var i=this.popoverData&&this.popoverData[this.popoverIndex]&&this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));if(!i){return""}var e=this.popoverData[this.popoverIndex];var r=e[0].xPositionPercent;var n=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=n.reduce((function(t,i){return t+i}),0)/n.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.popoverIndex].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var u=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var f=u>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var v=8/this.plotAreaEl.clientWidth*100;var d={"--leftPosition":p?r+v+"%":"unset","--rightPosition":f?100-r+v+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!f&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");d={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return h("div",{ref:function(i){return t.popoverEl=i},class:"popover",style:d},h("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&h("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.popoverIndex>0&&h("div",{class:"comparison-title"},lineChartMessages.getChangeSince(this.popoverData[this.popoverIndex-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var i=this.popoverData[this.popoverIndex];return h("table",{class:"popover-table"},i.map((function(i,e){if(!t.hiddenLines.includes(e)){var r=i.lineLabel,n=i.yValue;var o=t.popoverIndex>0?t.popoverData[t.popoverIndex-1][e]:null;var a=n!==null?(new Intl.NumberFormat).format(n):null;return h("tr",{class:"popover-row"},h("td",null,t.renderIcon(e)),h("td",{class:"row-label"},r),h("td",{class:"row-value"},n===null?lineChartMessages.noData:a,n!==null&&t.parsedUnits[1]&&h("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&o&&t.renderDeltas(i,o))}})))};t.prototype.renderDeltas=function(t,i){var e=this.calcDelta(t,i);var r=e.toString()[0]=="+"||e=="-"?"positive":e.toString()[0]=="-"?"negative":"";return i&&h("td",{class:"delta --".concat(r)},e)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix.length>0&&this.dataPointMatrix[0][this.popoverIndex];if(!t){return""}var i=this.dataPointMatrix[0][this.popoverIndex].xPositionPercent;var e={"--xPosition":i+"%"};return h("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var i=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var e={"--startPercentage":t+"%","--endPercentage":i+"%"};return h("div",{class:"highlight",style:e})};t.prototype.render=function(){var t=this;return h(Host,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.popoverIndex=-1}},h("div",{class:"component-wrapper",role:"application","aria-roledescription":chartMessages.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),h("div",{class:"chart-wrapper"},h("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),h("div",{ref:function(i){return t.plotAreaEl=i},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.popoverIndex!==-1&&this.renderHoverIndicator(),this.popoverIndex!==-1&&this.renderPopover(),this.renderXIntervals(),h("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),h("div",{id:"chart-description",class:"sr-only"},"".concat(lineChartMessages.instructions," ").concat(this.description)),h("div",{ref:function(i){return t.liveRegionEl=i},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}();LineChart.style=wmLineChartCss;export{LineChart as wm_line_chart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,i){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i["throw"](t))}catch(t){s(t)}}function l(t){t.done?o(t.value):n(t.value).then(r,a)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,c as checkForActiveElInShadow}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmModalPssCss="wm-modal-pss{--wmcolor-modal-background:var(--wmcolor-background);--wmcolor-modal-border:var(--wmcolor-border);--wmcolor-modal-heading:var(--wmcolor-text);--wmcolor-modal-overlay:var(--wmcolor-overlay);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);z-index:2001;width:80vw;max-width:750px;max-height:80vh;-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal-pss *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal-pss>*{width:80vw;max-width:750px;background:var(--wmcolor-modal-background)}wm-modal-pss>*:focus{outline:none}wm-modal-pss wm-modal-pss-header,wm-modal-pss wm-modal-pss-footer{padding:1.25rem 1.875rem}wm-modal-pss wm-modal-pss-header{z-index:2003}wm-modal-pss wm-modal-pss-footer{z-index:2003}wm-modal-pss>:not(wm-modal-pss-header):not(wm-modal-pss-footer){max-height:calc(80vh - 166px);z-index:2002}wm-modal-pss.wm-modal wm-modal-pss-header{border-bottom:1px solid var(--wmcolor-modal-border)}wm-modal-pss.wm-modal wm-modal-pss-footer{border-top:1px solid var(--wmcolor-modal-border)}@media only screen and (max-width: 768px){wm-modal-pss.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal-pss.wm-modal>*{max-width:none;width:100vw}wm-modal-pss.wm-modal>*:not(wm-modal-pss-header):not(wm-modal-pss-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal-pss.wm-dialog>:not(wm-modal-pss-header):not(wm-modal-pss-footer){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal-pss .overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:-1;bottom:1;left:-1;right:1;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:var(--wmcolor-modal-overlay);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;z-index:2000}wm-modal-pss.hide{visibility:hidden}wm-modal-pss .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}";var ModalPss=function(){function t(t){var e=this;registerInstance(this,t);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.bodyFocusListener=function(){return e.redirectFocusFromBody()};this.open=false;this.elementToFocus="";this.modalType="modal";this.uid=undefined}Object.defineProperty(t.prototype,"focusOnOpenEl",{get:function(){var t=null;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){t=this.el.querySelector("#wm-".concat(this.elementToFocus,"-").concat(this.uid))}else if(this.elementToFocus){t=this.el.querySelector("#"+this.elementToFocus);!t&&console.warn("Ripple Component Library: The modal component couldn't find an element matching the id you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.")}var e=this.el.querySelector("#wm-modal-close-".concat(this.uid));return t?t:e},enumerable:false,configurable:true});t.prototype.toggleModal=function(){this.open?this.showModal():this.hideModal()};t.prototype.handleClick=function(t){this.open&&t.target===this.overlayEl&&this.focusOnOpenEl.focus()};t.prototype.closeModalOnEscape=function(t){if(t.key==="Escape"){t.stopPropagation();this.wmModalCloseTriggered.emit();this.open=false}};t.prototype.showModal=function(){var t=this;this.setAriaDescribedbyOnModal();this.setElToFocusOnClose();document.body.style.overflow="hidden";document.body.tabIndex=0;document.body.removeEventListener("focus",this.bodyFocusListener,true);document.body.addEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){return t.focusOnOpenEl.focus()}))}))};t.prototype.hideModal=function(){var t=this;document.body.style.overflow="visible";document.body.tabIndex=-1;document.body.removeEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){return t.focusOnCloseEl.focus()}))};t.prototype.componentWillLoad=function(){var t=this;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("You are telling the modal to focus an element in the footer when it opens. That's fine! But when you do that, you also need to give the wm-modal-wrapper an ID and set the ID of the modal body to 'content-[id of wm-modal-wrapper]. This is for accessibility purposes.")}}this.el.focus=function(){t.focusOnOpenEl.focus()};this.uid=this.el.id?this.el.id:generateId()};t.prototype.componentDidLoad=function(){if(this.open){this.showModal()}};t.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalCloseTriggered.emit();return[2]}))}))};t.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalPrimaryTriggered.emit();return[2]}))}))};t.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalSecondaryTriggered.emit();return[2]}))}))};t.prototype.setAriaDescribedbyOnModal=function(){var t=document.getElementById("content-".concat(this.uid));if(!t){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};t.prototype.setElToFocusOnClose=function(){var t=document.activeElement;if(t.tagName==="WM-MENUITEM"){this.focusOnCloseEl=t.parentElement}else{this.focusOnCloseEl=checkForActiveElInShadow(t)}};t.prototype.redirectFocusFromBody=function(){if(document.activeElement.tagName==="BODY"){this.focusOnOpenEl.focus()}};t.prototype.render=function(){var t=this;return h(Host,{class:"".concat(this.open?"":"hide ").concat("wm-"+this.modalType),role:"dialog","aria-describedby":"wm-modal-heading-text-".concat(this.uid),"aria-modal":"true",tabindex:this.open?0:null,onFocus:function(){t.focusLastElement.emit()}},h("div",{class:"overlay",ref:function(e){return t.overlayEl=e}}),h("div",{class:"sr-only",tabIndex:0,onFocus:function(){t.focusFirstElement.emit()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["toggleModal"]}},enumerable:false,configurable:true});return t}();ModalPss.style=wmModalPssCss;var wmModalPssFooterCss="wm-modal-pss-footer{-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px;margin-top:-1px}wm-modal-pss-footer .wm-wrapper{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}@media only screen and (max-width: 650px){wm-modal-pss-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-pss-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-pss-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-pss-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-pss-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalPssFooter=function(){function t(t){registerInstance(this,t);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}t.prototype.componentWillLoad=function(){var t=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusLastElement",(function(){t.lastElement.focus()}))};t.prototype.emitParentPrimaryEvent=function(){var t=this.el.parentElement;t.emitPrimaryEvent()};t.prototype.emitParentSecondaryEvent=function(){var t=this.el.parentElement;t.emitSecondaryEvent()};t.prototype.render=function(){var t=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info","aria-live":"polite"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return t.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(e){return t.primaryActionDisabled?t.lastElement=e:null}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return t.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(e){return!t.primaryActionDisabled?t.lastElement=e:null}},this.primaryText)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalPssFooter.style=wmModalPssFooterCss;var wmModalPssHeaderCss="wm-modal-pss-header{-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px;margin-bottom:-1px}wm-modal-pss-header .wm-wrapper{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}wm-modal-pss-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:var(--wmcolor-modal-heading);line-height:normal}wm-modal-pss-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-pss-header .wm-wrapper .title:focus{outline:none}";var ModalPssHeader=function(){function t(t){registerInstance(this,t);this.heading="";this.subheading=""}t.prototype.componentWillLoad=function(){var t=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusFirstElement",(function(){t.closeButtonEl.focus()}))};t.prototype.emitParentCloseEvent=function(){var t=this.el.parentElement;t.emitCloseEvent()};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:globalMessages.close,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(e){return t.closeButtonEl=e},onClick:function(){return t.emitParentCloseEvent()}})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalPssHeader.style=wmModalPssHeaderCss;export{ModalPss as wm_modal_pss,ModalPssFooter as wm_modal_pss_footer,ModalPssHeader as wm_modal_pss_header};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,o){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,n){function r(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o["throw"](t))}catch(t){n(t)}}function l(t){t.done?i(t.value):s(t.value).then(r,a)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(i=0)),i)try{if(o=1,s&&(n=a[0]&2?s["return"]:a[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,a[1])).done)return n;if(s=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(a[0]===6&&i.label<n[1]){i.label=n[1];n=a;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(a);break}if(n[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];s=0}finally{o=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,c as checkForActiveElInShadow}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmModalPssCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal-pss{--wmcolor-modal-background:var(--wmcolor-background);--wmcolor-modal-border:var(--wmcolor-border);--wmcolor-modal-heading:var(--wmcolor-text);--wmcolor-modal-overlay:var(--wmcolor-overlay);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);z-index:2001;width:80vw;max-width:750px;max-height:80vh;-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal-pss *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal-pss>*{width:80vw;max-width:750px;background:var(--wmcolor-modal-background)}wm-modal-pss>*:focus{outline:none}wm-modal-pss wm-modal-pss-header,wm-modal-pss wm-modal-pss-footer{padding:1.25rem 1.875rem}wm-modal-pss wm-modal-pss-header{z-index:2003}wm-modal-pss wm-modal-pss-footer{z-index:2003}wm-modal-pss>:not(wm-modal-pss-header):not(wm-modal-pss-footer){max-height:calc(80vh - 166px);z-index:2002}wm-modal-pss.wm-modal wm-modal-pss-header{border-bottom:1px solid var(--wmcolor-modal-border)}wm-modal-pss.wm-modal wm-modal-pss-footer{border-top:1px solid var(--wmcolor-modal-border)}@media only screen and (max-width: 768px){wm-modal-pss.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal-pss.wm-modal>*{max-width:none;width:100vw}wm-modal-pss.wm-modal>*:not(wm-modal-pss-header):not(wm-modal-pss-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal-pss.wm-dialog>:not(wm-modal-pss-header):not(wm-modal-pss-footer){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal-pss .overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:-1;bottom:1;left:-1;right:1;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:var(--wmcolor-modal-overlay);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;z-index:2000}wm-modal-pss.hide{visibility:hidden}wm-modal-pss .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}";var ModalPss=function(){function t(t){var e=this;registerInstance(this,t);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.bodyFocusListener=function(){return e.redirectFocusFromBody()};this.open=false;this.elementToFocus="";this.modalType="modal";this.uid=undefined}Object.defineProperty(t.prototype,"focusOnOpenEl",{get:function(){var t=null;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){t=this.el.querySelector("#wm-".concat(this.elementToFocus,"-").concat(this.uid))}else if(this.elementToFocus){t=this.el.querySelector("#"+this.elementToFocus);!t&&console.warn("Ripple Component Library: The modal component couldn't find an element matching the id you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.")}var e=this.el.querySelector("#wm-modal-close-".concat(this.uid));return t?t:e},enumerable:false,configurable:true});t.prototype.toggleModal=function(){this.open?this.showModal():this.hideModal()};t.prototype.handleClick=function(t){this.open&&t.target===this.overlayEl&&this.focusOnOpenEl.focus()};t.prototype.closeModalOnEscape=function(t){if(t.key==="Escape"){t.stopPropagation();this.wmModalCloseTriggered.emit();this.open=false}};t.prototype.showModal=function(){var t=this;this.setAriaDescribedbyOnModal();this.setElToFocusOnClose();document.body.style.overflow="hidden";document.body.tabIndex=0;document.body.removeEventListener("focus",this.bodyFocusListener,true);document.body.addEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){return t.focusOnOpenEl.focus()}))}))};t.prototype.hideModal=function(){var t=this;document.body.style.overflow="visible";document.body.tabIndex=-1;document.body.removeEventListener("focus",this.bodyFocusListener,true);window.requestAnimationFrame((function(){return t.focusOnCloseEl.focus()}))};t.prototype.componentWillLoad=function(){var t=this;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("You are telling the modal to focus an element in the footer when it opens. That's fine! But when you do that, you also need to give the wm-modal-wrapper an ID and set the ID of the modal body to 'content-[id of wm-modal-wrapper]. This is for accessibility purposes.")}}this.el.focus=function(){t.focusOnOpenEl.focus()};this.uid=this.el.id?this.el.id:generateId()};t.prototype.componentDidLoad=function(){if(this.open){this.showModal()}};t.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalCloseTriggered.emit();return[2]}))}))};t.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalPrimaryTriggered.emit();return[2]}))}))};t.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalSecondaryTriggered.emit();return[2]}))}))};t.prototype.setAriaDescribedbyOnModal=function(){var t=document.getElementById("content-".concat(this.uid));if(!t){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};t.prototype.setElToFocusOnClose=function(){var t=document.activeElement;if(t.tagName==="WM-MENUITEM"){this.focusOnCloseEl=t.parentElement}else{this.focusOnCloseEl=checkForActiveElInShadow(t)}};t.prototype.redirectFocusFromBody=function(){if(document.activeElement.tagName==="BODY"){this.focusOnOpenEl.focus()}};t.prototype.render=function(){var t=this;return h(Host,{class:"".concat(this.open?"":"hide ").concat("wm-"+this.modalType),role:"dialog","aria-describedby":"wm-modal-heading-text-".concat(this.uid),"aria-modal":"true",tabindex:this.open?0:null,onFocus:function(){t.focusLastElement.emit()}},h("div",{class:"overlay",ref:function(e){return t.overlayEl=e}}),h("div",{class:"sr-only",tabIndex:0,onFocus:function(){t.focusFirstElement.emit()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["toggleModal"]}},enumerable:false,configurable:true});return t}();ModalPss.style=wmModalPssCss;var wmModalPssFooterCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal-pss-footer{-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px;margin-top:-1px}wm-modal-pss-footer .wm-wrapper{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}@media only screen and (max-width: 650px){wm-modal-pss-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-pss-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-pss-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-pss-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-pss-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalPssFooter=function(){function t(t){registerInstance(this,t);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}t.prototype.componentWillLoad=function(){var t=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusLastElement",(function(){t.lastElement.focus()}))};t.prototype.emitParentPrimaryEvent=function(){var t=this.el.parentElement;t.emitPrimaryEvent()};t.prototype.emitParentSecondaryEvent=function(){var t=this.el.parentElement;t.emitSecondaryEvent()};t.prototype.render=function(){var t=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info","aria-live":"polite"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return t.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(e){return t.primaryActionDisabled?t.lastElement=e:null}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return t.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(e){return!t.primaryActionDisabled?t.lastElement=e:null}},this.primaryText)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalPssFooter.style=wmModalPssFooterCss;var wmModalPssHeaderCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal-pss-header{-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px;margin-bottom:-1px}wm-modal-pss-header .wm-wrapper{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}wm-modal-pss-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:var(--wmcolor-modal-heading);line-height:normal}wm-modal-pss-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-pss-header .wm-wrapper .title:focus{outline:none}";var ModalPssHeader=function(){function t(t){registerInstance(this,t);this.heading="";this.subheading=""}t.prototype.componentWillLoad=function(){var t=this;this.uid=this.el.parentElement.uid;this.el.parentElement.addEventListener("focusFirstElement",(function(){t.closeButtonEl.focus()}))};t.prototype.emitParentCloseEvent=function(){var t=this.el.parentElement;t.emitCloseEvent()};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:globalMessages.close,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(e){return t.closeButtonEl=e},onClick:function(){return t.emitParentCloseEvent()}})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalPssHeader.style=wmModalPssHeaderCss;export{ModalPss as wm_modal_pss,ModalPssFooter as wm_modal_pss_footer,ModalPssHeader as wm_modal_pss_header};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,i){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function s(t){try{l(i["throw"](t))}catch(t){r(t)}}function l(t){t.done?o(t.value):n(t.value).then(a,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement,H as Host}from"./index-558b5a82.js";import{g as generateId}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmModalCss="wm-modal{--wmcolor-modal-background:var(--wmcolor-background);--wmcolor-modal-border:var(--wmcolor-border);--wmcolor-modal-heading:var(--wmcolor-text);--wmcolor-modal-overlay:var(--wmcolor-overlay)}wm-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal dialog{color:inherit;padding:0;width:80vw;max-width:750px;max-height:80vh;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;-ms-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;border:none;background:var(--wmcolor-modal-background)}wm-modal dialog>:not(wm-modal-header):not(wm-modal-footer){max-height:calc(80vh - 166px)}wm-modal dialog::-webkit-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::-ms-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog[open]{-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal dialog.wm-modal>wm-modal-header{border-bottom:1px solid var(--wmcolor-modal-border)}wm-modal dialog.wm-modal>wm-modal-footer{border-top:1px solid var(--wmcolor-modal-border)}@media only screen and (max-width: 768px){wm-modal dialog.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal dialog.wm-modal>*{max-width:none;width:100vw}wm-modal dialog.wm-modal>*:not(wm-modal-header):not(wm-modal-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal dialog.wm-dialog>:not(wm-modal-header):not(wm-modal-footer):not(.wm-tooltip){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal wm-modal-header,wm-modal wm-modal-footer{padding:1.25rem 1.875rem;width:100%}wm-modal .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}";var Modal=function(){function t(t){registerInstance(this,t);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.open=false;this.elementToFocus="";this.modalType="modal";this.uid=undefined;this.returnFocusEl=undefined}Object.defineProperty(t.prototype,"closeButtonEl",{get:function(){return this.el.querySelector("#wm-modal-close-".concat(this.uid))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusOnOpenEl",{get:function(){var t=null;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){t=this.el.querySelector("#wm-".concat(this.elementToFocus,"-").concat(this.uid))}else if(this.elementToFocus){t=this.el.querySelector("#"+this.elementToFocus);!t&&console.warn("Ripple Component Library: The modal component couldn't find an element matching the id you passed for 'elementToFocus' (".concat(this.elementToFocus,"). It will fall back to the default and focus the close button when the modal opens."))}return t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasBrowserPopoverSupport",{get:function(){var t=document.getElementById("wm-tooltip");return t?!!t.showPopover:false},enumerable:false,configurable:true});t.prototype.toggleModal=function(){this.open?this.showModal():this.hideModal()};t.prototype.handleDialogClose=function(){if(this.open){this.wmModalCloseTriggered.emit()}this.open=false};t.prototype.showModal=function(){this.returnFocusEl=document.activeElement;this.setAriaDescribedbyOnModal();document.body.style.overflow="hidden";this.dialogEl.showModal();if(this.focusOnOpenEl){this.focusOnOpenEl.focus()}};t.prototype.hideModal=function(){var t=this;document.body.style.overflow="visible";this.dialogEl.close();setTimeout((function(){if(t.returnFocusEl&&document.activeElement===document.body){if(t.returnFocusEl.tagName==="WM-MENUITEM"){t.returnFocusEl=t.returnFocusEl.parentElement}t.returnFocusEl.focus()}}),20)};t.prototype.componentWillLoad=function(){var t=this;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("For accessibility purposes you need to set the modal content wrapper's id to 'content-[id of wm-modal]'.")}}this.el.focus=function(){if(t.focusOnOpenEl){t.focusOnOpenEl.focus()}else{t.closeButtonEl.focus()}};this.uid=this.el.id?this.el.id:generateId()};t.prototype.componentDidLoad=function(){var t=this;if(this.open){this.showModal()}this.dialogEl.addEventListener("close",(function(){return t.handleDialogClose()}))};t.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalCloseTriggered.emit();return[2]}))}))};t.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalPrimaryTriggered.emit();return[2]}))}))};t.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalSecondaryTriggered.emit();return[2]}))}))};t.prototype.handleKeyDown=function(t){if(t.key=="Escape"){t.stopPropagation()}};t.prototype.setAriaDescribedbyOnModal=function(){var t=document.getElementById("content-".concat(this.uid));if(!t){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};t.prototype.render=function(){var t=this;return h("dialog",{class:"".concat("wm-"+this.modalType),ref:function(e){return t.dialogEl=e},onKeyDown:function(e){return t.handleKeyDown(e)}},h("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:function(e){var o=e.relatedTarget&&e.relatedTarget==t.closeButtonEl;o?t.focusLastElement.emit():t.focusFirstElement.emit()}}),!this.hasBrowserPopoverSupport&&h("div",{class:"wm-tooltip"}),h("slot",null),h("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:function(){t.focusFirstElement.emit()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["toggleModal"]}},enumerable:false,configurable:true});return t}();Modal.style=wmModalCss;var wmModalFooterCss="wm-modal-footer{display:block;-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px}wm-modal-footer .wm-wrapper{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}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalFooter=function(){function t(t){registerInstance(this,t);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}t.prototype.componentWillLoad=function(){var t=this;var e=this.el.closest("wm-modal");this.uid=e.uid;e.addEventListener("focusLastElement",(function(){t.lastElement.focus()}))};t.prototype.emitParentPrimaryEvent=function(){var t=this.el.closest("wm-modal");if(t){t.emitPrimaryEvent()}};t.prototype.emitParentSecondaryEvent=function(){var t=this.el.closest("wm-modal");if(t){t.emitSecondaryEvent()}};t.prototype.render=function(){var t=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info","aria-live":"polite"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return t.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(e){return t.primaryActionDisabled?t.lastElement=e:undefined}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return t.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(e){return!t.primaryActionDisabled?t.lastElement=e:undefined}},this.primaryText)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalFooter.style=wmModalFooterCss;var wmModalHeaderCss="wm-modal-header{display:block;-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px}wm-modal-header .wm-wrapper{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}wm-modal-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:var(--wmcolor-modal-heading);line-height:normal}wm-modal-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-header .wm-wrapper .title:focus{outline:none}";var ModalHeader=function(){function t(t){registerInstance(this,t);this.heading="";this.subheading=""}t.prototype.componentWillLoad=function(){var t=this;var e=this.el.closest("wm-modal");this.uid=e.uid;e.addEventListener("focusFirstElement",(function(){t.closeButtonEl.focus()}))};t.prototype.emitParentCloseEvent=function(){var t=this.el.closest("wm-modal");t.emitCloseEvent()};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:globalMessages.close,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(e){return t.closeButtonEl=e},onClick:function(){return t.emitParentCloseEvent()}})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalHeader.style=wmModalHeaderCss;export{Modal as wm_modal,ModalFooter as wm_modal_footer,ModalHeader as wm_modal_header};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,o){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function n(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o["throw"](t))}catch(t){a(t)}}function l(t){t.done?i(t.value):r(t.value).then(n,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(t){return function(e){return l([t,e])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(i=0)),i)try{if(o=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,g as getElement,H as Host}from"./index-558b5a82.js";import{g as generateId}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmModalCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal{--wmcolor-modal-background:var(--wmcolor-background);--wmcolor-modal-border:var(--wmcolor-border);--wmcolor-modal-heading:var(--wmcolor-text);--wmcolor-modal-overlay:var(--wmcolor-overlay)}wm-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal dialog{color:inherit;padding:0;width:80vw;max-width:750px;max-height:80vh;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;-ms-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;border:none;background:var(--wmcolor-modal-background)}wm-modal dialog>:not(wm-modal-header):not(wm-modal-footer){max-height:calc(80vh - 166px)}wm-modal dialog::-webkit-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::-ms-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog[open]{-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal dialog.wm-modal>wm-modal-header{border-bottom:1px solid var(--wmcolor-modal-border)}wm-modal dialog.wm-modal>wm-modal-footer{border-top:1px solid var(--wmcolor-modal-border)}@media only screen and (max-width: 768px){wm-modal dialog.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal dialog.wm-modal>*{max-width:none;width:100vw}wm-modal dialog.wm-modal>*:not(wm-modal-header):not(wm-modal-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal dialog.wm-dialog>:not(wm-modal-header):not(wm-modal-footer):not(.wm-tooltip){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal wm-modal-header,wm-modal wm-modal-footer{padding:1.25rem 1.875rem;width:100%}wm-modal .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}";var Modal=function(){function t(t){registerInstance(this,t);this.focusLastElement=createEvent(this,"focusLastElement",3);this.focusFirstElement=createEvent(this,"focusFirstElement",3);this.wmModalCloseTriggered=createEvent(this,"wmModalCloseTriggered",3);this.wmModalPrimaryTriggered=createEvent(this,"wmModalPrimaryTriggered",7);this.wmModalSecondaryTriggered=createEvent(this,"wmModalSecondaryTriggered",7);this.open=false;this.elementToFocus="";this.modalType="modal";this.uid=undefined;this.returnFocusEl=undefined}Object.defineProperty(t.prototype,"closeButtonEl",{get:function(){return this.el.querySelector("#wm-modal-close-".concat(this.uid))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusOnOpenEl",{get:function(){var t=null;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){t=this.el.querySelector("#wm-".concat(this.elementToFocus,"-").concat(this.uid))}else if(this.elementToFocus){t=this.el.querySelector("#"+this.elementToFocus);!t&&console.warn("Ripple Component Library: The modal component couldn't find an element matching the id you passed for 'elementToFocus' (".concat(this.elementToFocus,"). It will fall back to the default and focus the close button when the modal opens."))}return t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasBrowserPopoverSupport",{get:function(){var t=document.getElementById("wm-tooltip");return t?!!t.showPopover:false},enumerable:false,configurable:true});t.prototype.toggleModal=function(){this.open?this.showModal():this.hideModal()};t.prototype.handleDialogClose=function(){if(this.open){this.wmModalCloseTriggered.emit()}this.open=false};t.prototype.showModal=function(){this.returnFocusEl=document.activeElement;this.setAriaDescribedbyOnModal();document.body.style.overflow="hidden";this.dialogEl.showModal();if(this.focusOnOpenEl){this.focusOnOpenEl.focus()}};t.prototype.hideModal=function(){var t=this;document.body.style.overflow="visible";this.dialogEl.close();setTimeout((function(){if(t.returnFocusEl&&document.activeElement===document.body){if(t.returnFocusEl.tagName==="WM-MENUITEM"){t.returnFocusEl=t.returnFocusEl.parentElement}t.returnFocusEl.focus()}}),20)};t.prototype.componentWillLoad=function(){var t=this;if(this.elementToFocus==="primary"||this.elementToFocus==="secondary"){if(!this.el.id){console.error("For accessibility purposes you need to set the modal content wrapper's id to 'content-[id of wm-modal]'.")}}this.el.focus=function(){if(t.focusOnOpenEl){t.focusOnOpenEl.focus()}else{t.closeButtonEl.focus()}};this.uid=this.el.id?this.el.id:generateId()};t.prototype.componentDidLoad=function(){var t=this;if(this.open){this.showModal()}this.dialogEl.addEventListener("close",(function(){return t.handleDialogClose()}))};t.prototype.emitCloseEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalCloseTriggered.emit();return[2]}))}))};t.prototype.emitPrimaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalPrimaryTriggered.emit();return[2]}))}))};t.prototype.emitSecondaryEvent=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmModalSecondaryTriggered.emit();return[2]}))}))};t.prototype.handleKeyDown=function(t){if(t.key=="Escape"){t.stopPropagation()}};t.prototype.setAriaDescribedbyOnModal=function(){var t=document.getElementById("content-".concat(this.uid));if(!t){console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}else{this.el.setAttribute("aria-describedby","wm-modal-heading-text-".concat(this.uid," content-").concat(this.uid))}};t.prototype.render=function(){var t=this;return h("dialog",{class:"".concat("wm-"+this.modalType),ref:function(e){return t.dialogEl=e},onKeyDown:function(e){return t.handleKeyDown(e)}},h("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:function(e){var i=e.relatedTarget&&e.relatedTarget==t.closeButtonEl;i?t.focusLastElement.emit():t.focusFirstElement.emit()}}),!this.hasBrowserPopoverSupport&&h("div",{class:"wm-tooltip"}),h("slot",null),h("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:function(){t.focusFirstElement.emit()}}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["toggleModal"]}},enumerable:false,configurable:true});return t}();Modal.style=wmModalCss;var wmModalFooterCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal-footer{display:block;-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px}wm-modal-footer .wm-wrapper{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}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-footer .wm-wrapper .wm-info:focus{outline:none}";var ModalFooter=function(){function t(t){registerInstance(this,t);this.secondaryText="";this.primaryText="";this.infoText="";this.primaryActionDisabled=false;this.deleteStyle=false}t.prototype.componentWillLoad=function(){var t=this;var e=this.el.closest("wm-modal");this.uid=e.uid;e.addEventListener("focusLastElement",(function(){t.lastElement.focus()}))};t.prototype.emitParentPrimaryEvent=function(){var t=this.el.closest("wm-modal");if(t){t.emitPrimaryEvent()}};t.prototype.emitParentSecondaryEvent=function(){var t=this.el.closest("wm-modal");if(t){t.emitSecondaryEvent()}};t.prototype.render=function(){var t=this;return h("div",{class:"wm-wrapper ".concat(this.infoText?" footer-text":"")},h("div",{class:"wm-info","aria-live":"polite"},this.infoText),h("div",{class:"wm-button-collection"},this.secondaryText&&h("wm-button",{onClick:function(){return t.emitParentSecondaryEvent()},id:"wm-secondary-".concat(this.uid),ref:function(e){return t.primaryActionDisabled?t.lastElement=e:undefined}},this.secondaryText),h("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:function(){return t.emitParentPrimaryEvent()},disabled:this.primaryActionDisabled,id:"wm-primary-".concat(this.uid),ref:function(e){return!t.primaryActionDisabled?t.lastElement=e:undefined}},this.primaryText)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalFooter.style=wmModalFooterCss;var wmModalHeaderCss=".svg-icon{display:inline-block}.svg-icon:before{content:\"\";background-color:var(--icon-fill, currentColor);width:var(--icon-size, 14px);height:var(--icon-size, 14px)}.svg-icon.horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg-icon.vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.svg-icon.svg-pencil:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}.svg-icon.svg-rotate-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");mask-image:url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z'/%3E%3C/svg%3E%0A\");-webkit-mask-size:100%;mask-size:100%;display:block}wm-modal-header{display:block;-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px}wm-modal-header .wm-wrapper{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}wm-modal-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:var(--wmcolor-modal-heading);line-height:normal}wm-modal-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-header .wm-wrapper .title:focus{outline:none}";var ModalHeader=function(){function t(t){registerInstance(this,t);this.heading="";this.subheading=""}t.prototype.componentWillLoad=function(){var t=this;var e=this.el.closest("wm-modal");this.uid=e.uid;e.addEventListener("focusFirstElement",(function(){t.closeButtonEl.focus()}))};t.prototype.emitParentCloseEvent=function(){var t=this.el.closest("wm-modal");t.emitCloseEvent()};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{class:"wm-wrapper"},h("div",null,h("h2",{class:"title",id:"wm-modal-heading-text-".concat(this.uid)},this.heading,h("span",{class:"subtitle"},this.subheading))),h("wm-button",{"button-type":"navigational",icon:"f156",tooltip:globalMessages.close,"tooltip-position":"left",id:"wm-modal-close-".concat(this.uid),ref:function(e){return t.closeButtonEl=e},onClick:function(){return t.emitParentCloseEvent()}})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ModalHeader.style=wmModalHeaderCss;export{Modal as wm_modal,ModalFooter as wm_modal_footer,ModalHeader as wm_modal_header};
|