@watermarkinsights/ripple 3.36.0 → 3.36.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/{chartFunctions-41c67866.js → chartFunctions-dcefe35e.js} +1 -1
- package/dist/cjs/{functions-45f36418.js → functions-b85d9b0c.js} +1 -1
- package/dist/cjs/{global-c795cff3.js → global-3efdaff1.js} +1 -1
- package/dist/cjs/{intl-a84cd5ef.js → intl-800e0638.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
- package/dist/cjs/priv-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
- package/dist/cjs/wm-button.cjs.entry.js +9 -2
- package/dist/cjs/wm-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +1 -1
- package/dist/cjs/wm-input.cjs.entry.js +2 -2
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-header.cjs.entry.js +2 -2
- package/dist/cjs/wm-modal.cjs.entry.js +1 -1
- package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-network-uploader.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
- package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/wm-button/wm-button.js +8 -1
- package/dist/collection/components/wm-button/wm-button.spec.js +6 -0
- package/dist/esm/{chartFunctions-e539d991.js → chartFunctions-38758d18.js} +1 -1
- package/dist/esm/{functions-7fc7cf30.js → functions-da3b00cf.js} +1 -1
- package/dist/esm/{global-1dca883b.js → global-0469a5f5.js} +1 -1
- package/dist/esm/{intl-f0475a8e.js → intl-3eb5074d.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-datepicker.entry.js +1 -1
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +9 -2
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +1 -1
- package/dist/esm/wm-input.entry.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-header.entry.js +2 -2
- package/dist/esm/wm-modal.entry.js +1 -1
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-network-uploader.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-tab-item_3.entry.js +1 -1
- package/dist/esm/wm-tag-input.entry.js +2 -2
- 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 +2 -2
- package/dist/esm-es5/{chartFunctions-e539d991.js → chartFunctions-38758d18.js} +1 -1
- package/dist/esm-es5/{functions-7fc7cf30.js → functions-da3b00cf.js} +1 -1
- package/dist/esm-es5/{global-1dca883b.js → global-0469a5f5.js} +1 -1
- package/dist/esm-es5/{intl-f0475a8e.js → intl-3eb5074d.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-1cb7bdc5.entry.js → p-14e956bd.entry.js} +1 -1
- package/dist/ripple/{p-5d78937a.entry.js → p-1678e4b5.entry.js} +1 -1
- package/dist/ripple/{p-4a58b0ff.system.entry.js → p-172fa114.system.entry.js} +1 -1
- package/dist/ripple/{p-a9012b82.system.entry.js → p-1984e1c7.system.entry.js} +1 -1
- package/dist/ripple/{p-2b378ac6.js → p-1eb5a93a.js} +1 -1
- package/dist/ripple/{p-6639cf6c.entry.js → p-203152e7.entry.js} +1 -1
- package/dist/ripple/{p-cabf1867.system.entry.js → p-249597a9.system.entry.js} +1 -1
- package/dist/ripple/{p-f3ff86da.entry.js → p-2683ea3a.entry.js} +1 -1
- package/dist/ripple/{p-56747d40.system.entry.js → p-2c049e82.system.entry.js} +1 -1
- package/dist/ripple/{p-0872dd92.entry.js → p-2c9fa4e1.entry.js} +1 -1
- package/dist/ripple/{p-936e078c.system.js → p-2e52e36f.system.js} +1 -1
- package/dist/ripple/{p-212d0c64.entry.js → p-32c8a588.entry.js} +1 -1
- package/dist/ripple/{p-24ac418e.system.entry.js → p-3642dff3.system.entry.js} +1 -1
- package/dist/ripple/{p-935eafa7.system.entry.js → p-3b138cf2.system.entry.js} +1 -1
- package/dist/ripple/{p-fd0fc5e1.system.entry.js → p-3cc86126.system.entry.js} +1 -1
- package/dist/ripple/{p-6628e036.system.entry.js → p-427747c5.system.entry.js} +1 -1
- package/dist/ripple/{p-5da6b9ff.system.entry.js → p-4891e621.system.entry.js} +1 -1
- package/dist/ripple/{p-6546dda7.entry.js → p-5c2d6dae.entry.js} +1 -1
- package/dist/ripple/{p-765b53d8.system.entry.js → p-63abf623.system.entry.js} +1 -1
- package/dist/ripple/{p-16708229.js → p-69092dc0.js} +1 -1
- package/dist/ripple/{p-74880dac.system.entry.js → p-6fb4eb05.system.entry.js} +1 -1
- package/dist/ripple/{p-08e0007e.system.entry.js → p-70bcec5b.system.entry.js} +1 -1
- package/dist/ripple/{p-d4ebbe84.system.js → p-7eb9bac9.system.js} +1 -1
- package/dist/ripple/{p-71ecba7e.system.entry.js → p-7f1c918f.system.entry.js} +1 -1
- package/dist/ripple/{p-0730d70d.system.entry.js → p-81c40ed3.system.entry.js} +1 -1
- package/dist/ripple/{p-a6317ac6.entry.js → p-81c52231.entry.js} +1 -1
- package/dist/ripple/{p-64abb6d9.system.entry.js → p-86878f67.system.entry.js} +1 -1
- package/dist/ripple/{p-e4f352fe.system.js → p-975c0d09.system.js} +1 -1
- package/dist/ripple/{p-766a4a70.system.entry.js → p-9be73edd.system.entry.js} +1 -1
- package/dist/ripple/{p-89bc016a.js → p-9f3a6192.js} +1 -1
- package/dist/ripple/{p-770f02d4.entry.js → p-a3ce6f93.entry.js} +1 -1
- package/dist/ripple/{p-00850d97.entry.js → p-a7dd417d.entry.js} +1 -1
- package/dist/ripple/{p-0a846e45.entry.js → p-aa3f9686.entry.js} +1 -1
- package/dist/ripple/{p-20495238.js → p-af1d2a68.js} +1 -1
- package/dist/ripple/{p-1a7b1578.system.js → p-b3c4e012.system.js} +1 -1
- package/dist/ripple/{p-4418858d.entry.js → p-bdce95d4.entry.js} +1 -1
- package/dist/ripple/{p-b22858cd.entry.js → p-be78d6db.entry.js} +1 -1
- package/dist/ripple/{p-4d5e075b.system.entry.js → p-bf85a915.system.entry.js} +1 -1
- package/dist/ripple/{p-29960160.system.entry.js → p-c1b36890.system.entry.js} +1 -1
- package/dist/ripple/{p-53b84f6d.entry.js → p-c44fb391.entry.js} +1 -1
- package/dist/ripple/{p-d9268ba1.system.entry.js → p-cd01caeb.system.entry.js} +1 -1
- package/dist/ripple/{p-b111bc7d.entry.js → p-d26d60fd.entry.js} +1 -1
- package/dist/ripple/{p-68f11410.entry.js → p-d3353dda.entry.js} +1 -1
- package/dist/ripple/{p-a7a9c931.entry.js → p-d3b54132.entry.js} +1 -1
- package/dist/ripple/{p-77ea81c7.system.entry.js → p-d3df5034.system.entry.js} +1 -1
- package/dist/ripple/{p-f1aed810.system.entry.js → p-da048416.system.entry.js} +1 -1
- package/dist/ripple/{p-23a5adae.entry.js → p-dea254a1.entry.js} +1 -1
- package/dist/ripple/{p-5e005259.system.entry.js → p-e527bff3.system.entry.js} +1 -1
- package/dist/ripple/p-e54add34.entry.js +1 -0
- package/dist/ripple/{p-7b91eba4.system.entry.js → p-e5e28616.system.entry.js} +1 -1
- package/dist/ripple/{p-2bbf689a.system.entry.js → p-e8732b27.system.entry.js} +1 -1
- package/dist/ripple/{p-8a38e526.system.js → p-ef635a54.system.js} +1 -1
- package/dist/ripple/{p-6f36e973.entry.js → p-f2f4b743.entry.js} +1 -1
- package/dist/ripple/{p-69c802aa.entry.js → p-f3184d03.entry.js} +1 -1
- package/dist/ripple/{p-cd67e184.entry.js → p-f7391b66.entry.js} +1 -1
- package/dist/ripple/{p-f9e942f6.entry.js → p-fbb44d4c.entry.js} +1 -1
- package/dist/ripple/{p-63466d04.entry.js → p-fcb4328c.entry.js} +1 -1
- 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 +2 -0
- package/package.json +1 -1
- package/dist/ripple/p-dc069d46.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,o){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):n(t.value).then(a,s)}c((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,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 c([t,e])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(o=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-c467a1e1.system.js","./p-08b7ec08.system.js","./p-d4ebbe84.system.js","./p-313b6073.system.js"],(function(t){"use strict";var e,r,o,n,i,a,s,c,u,l;return{setters:[function(t){e=t.r;r=t.c;o=t.h;n=t.H;i=t.g},function(t){a=t.a},function(t){s=t.m;c=t.n;u=t.i},function(t){l=t.g}],execute:function(){var d=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var f=t("wm_navigator",function(){function t(t){e(this,t);this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,l("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=a(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[s(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=c(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var o=this.itemIndexToFocus;this.itemIndexToFocus=c(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(o);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return o("div",{class:"user",id:"wm-nav-user","aria-label":u.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},o("p",null,this.userName),o("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return u.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return u.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return o("h2",null,u.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return o("ul",{role:"listbox","aria-label":"".concat(u.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,n,i,a;r=e.name;n=e.iconUrl;a=t.setProductOnClick(e.id);if(!!r&&!!n){i=t.currentProductId===e.id;return o("priv-navigator-item",{selected:i,id:e.id,onClick:a,role:"option","aria-label":r},o("img",{src:n,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return o("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},o("span",{class:"logout"},u.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?o(n,{class:this.isTabbing?"user-is-tabbing":""},o("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),o("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());f.style=d}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,o){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):n(t.value).then(a,s)}c((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,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 c([t,e])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(o=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-c467a1e1.system.js","./p-08b7ec08.system.js","./p-7eb9bac9.system.js","./p-313b6073.system.js"],(function(t){"use strict";var e,r,o,n,i,a,s,c,u,l;return{setters:[function(t){e=t.r;r=t.c;o=t.h;n=t.H;i=t.g},function(t){a=t.a},function(t){s=t.m;c=t.n;u=t.i},function(t){l=t.g}],execute:function(){var d=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var f=t("wm_navigator",function(){function t(t){e(this,t);this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.isTabbing=false;this.itemIndexToFocus=0}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,l("/platform/navigator/userinfo").then((function(e){t.email=e.email;t.currentProductId=e.current_product_id;t.parsedProducts=t.productKeysToCamelCase(e.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:e.logout_url;t.connectionName=t.connectionName?t.connectionName:e.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:e.sent();return[3,3];case 2:this.currentProductId=a(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}e.label=3;case 3:this.parsedProducts.sort((function(t,e){return t.name<e.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var e=Object.keys(t);var r={};e.forEach((function(e){r[s(e)]=t[e]}));return r}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=c(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var r=t.detail.navItem;switch(e){case"Tab":this.closeMenu();break;case"Enter":case" ":r.click();break;case"ArrowDown":case"ArrowUp":var o=this.itemIndexToFocus;this.itemIndexToFocus=c(this.itemIndexToFocus,e,this.navigatorItems.length);this.focusItem();this.unfocusItem(o);break}};t.prototype.handleClick=function(t){var e=t.target===this.el||this.el.contains(t.target);if(!e&&this.isOpen){this.closeMenu()}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var e=this.el.getBoundingClientRect().left;var r=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>e&&r>e}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(){this.isOpen=false;this.buttonFocusHandler();this.unfocusItem(this.itemIndexToFocus);this.setFocusIndex()};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var e=this.navigatorItems[t];e.tabIndex=-1;e.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var e=t.shadowRoot.querySelector("button");window.requestAnimationFrame((function(){return e.focus()}))};t.prototype.renderUserInfo=function(){return o("div",{class:"user",id:"wm-nav-user","aria-label":u.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},o("p",null,this.userName),o("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return u.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return u.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return o("h2",null,u.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return o("ul",{role:"listbox","aria-label":"".concat(u.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(e){var r,n,i,a;r=e.name;n=e.iconUrl;a=t.setProductOnClick(e.id);if(!!r&&!!n){i=t.currentProductId===e.id;return o("priv-navigator-item",{selected:i,id:e.id,onClick:a,role:"option","aria-label":r},o("img",{src:n,alt:r}))}}))};t.prototype.setProductOnClick=function(t){var e=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(e){if(!!this.loadFromUserinfo||this.authType===2){return function(){return window.location.href=e.linkUrl}}else if(this.authType===3){var r=this.connectionName?"/?connection_name=".concat(this.connectionName):"";return function(){return window.location.href=e.samlLinkUrl+r}}}};t.prototype.renderLogoutOption=function(){return o("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},o("span",{class:"logout"},u.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();if(t.logoutUrl){window.location.href=t.logoutUrl}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(e){return e.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?o(n,{class:this.isTabbing?"user-is-tabbing":""},o("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),o("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(e){return t.wrapperEl=e}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());f.style=d}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-c467a1e1.system.js","./p-d4ebbe84.system.js","./p-e4f352fe.system.js"],(function(e){"use strict";var t,r,o,n,a,p,i,s,l,c,h,d,m,b,g,w,u,f,x,v;return{setters:[function(e){t=e.r;r=e.f;o=e.h;n=e.H;a=e.g;p=e.c},function(e){i=e.g;s=e.i;l=e.d;c=e.u},function(e){h=e.a;d=e.h;m=e.g;b=e.c;g=e.d;w=e.e;u=e.f;f=e.i;x=e.k;v=e.l}],execute:function(){var y=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment:not(.zero):not(:last-of-type){margin-right:2px}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper:not(:last-of-type){margin-right:2px}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment,:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment,:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment,:host .component-wrapper path:hover.doughnut-segment,:host .component-wrapper path:focus.doughnut-segment,:host .component-wrapper .stacked-bar-segment:active.doughnut-segment,:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment,:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment{-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut2b label,:host .component-wrapper.doughnut2b .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{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 .component-wrapper.doughnut0,:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut0 label,:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut0 label .subinfo,:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut0 .completion-message,:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar1,:host .component-wrapper.bar{padding:1.25rem;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar1 label,:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar1 label .subinfo,:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar1 .chart-wrapper,:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar1 .chart-wrapper .single-perc,:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar1 .chart-wrapper .inner-stacked-bar-wrapper,:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar1 .chart-wrapper .completion-message,:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar1,:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar1 label,:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar1 .bar-wrapper,:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar1 .bar-wrapper .single-perc,:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar2b,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar2 .inner-stacked-bar-wrapper,:host .component-wrapper.bar2b .inner-stacked-bar-wrapper,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar2 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar2b .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar,:host .component-wrapper.bar6 .bar:hover.bar,:host .component-wrapper.bar6 .bar:focus.bar,:host .component-wrapper.bar7 .bar:active.bar,:host .component-wrapper.bar7 .bar:hover.bar,:host .component-wrapper.bar7 .bar:focus.bar{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host #chart-instructions{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 .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar1,:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .stacked-bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .simple-bar-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host(:focus) .component-wrapper.user-is-tabbing .stacked-bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .simple-bar-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";var k=e("wm_progress_indicator",function(){function e(e){t(this,e);this.uid=i();this.slicesDetails=[];this.barLabelsWidth=this.el.parentElement.barLabelsWidth;this.label=undefined;this.subinfo=undefined;this.completionMessage=undefined;this.showLegend=true;this.isTabbing=false;this.mode=undefined;this.userIsNavigating=false}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return this.mode?h[this.mode]:undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartRoleDescription",{get:function(){return s.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){d.call(this,e)};e.prototype.componentWillLoad=function(){var e=this;if(!this.label){console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.el.children.length!==2){console.warn("wm-progress-indicator component must have 2 wm-progress-slice children.")}this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(function(t){return e.mode=t.detail}))};e.prototype.handleSliceUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,m.call(this,this.mode)];case 1:e.sent();r(this.el);return[2]}}))}))};e.prototype.handleModeUpdate=function(){if(this.mode){m.call(this,this.mode)}};e.prototype.renderBarOrDoughnut=function(){if(this.total>0&&this.mode==="bar"){return b.call(this,this.mode)}else{return g.call(this,this.mode)}};e.prototype.render=function(){var e=this;return o(n,{onBlur:function(){return x.call(e)}},o("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.mode," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""),role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},o("label",{id:"label-".concat(this.uid),class:"label ".concat(this.barLabelsWidth&&this.mode==="bar"?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:"graphic-".concat(this.uid)},o("span",{class:"label-text"},this.label),this.subinfo?o("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),this.mode==="doughnut"?u.call(this,this.mode):"",o("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":""}),this.mode==="doughnut"?f.call(this):""),w())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["handleModeUpdate"]}},enumerable:false,configurable:true});return e}());k.style=y;var z=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar1,:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start;padding:0 1.25rem}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}";var P=e("wm_progress_monitor",function(){function e(e){var o=this;t(this,e);this.wmProgressMonitorModeChange=p(this,"wmProgressMonitorModeChange",7);this.doughnutWidth=300;this.modeInitialized=false;this.debouncedUpdate=l((function(){return r(o.el)}),50);this.breakpoint=undefined;this.groupLegend=undefined;this.barLabelsWidth=undefined}Object.defineProperty(e.prototype,"parsedBreakpoint",{get:function(){var e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);var t=e>=20?e:e*this.doughnutWidth;return t},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"mode",{get:function(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.componentDidLoad=function(){this.wmProgressMonitorModeChange.emit(this.mode);this.modeInitialized=true};e.prototype.componentWillUpdate=function(){if(this.prevMode!==this.mode){this.wmProgressMonitorModeChange.emit(this.mode)}this.prevMode=this.mode};e.prototype.parseToNum=function(e){var t=e.toString();var r=t.replace("px","");return parseInt(r)};e.prototype.renderLegend=function(){var e=c(this.groupLegend);var t=h.bar.colors;return o("div",{class:"legend-wrapper"},o("div",{class:"legend"},e.map((function(e,r){var o={key:e,color:t[r]};return v(o)}))))};e.prototype.render=function(){return o(n,{class:this.mode==="doughnut"?"row":"column"},this.modeInitialized&&this.groupLegend&&this.mode==="bar"&&this.renderLegend(),this.modeInitialized&&o("slot",null))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());P.style=z;var j=e("wm_progress_slice",function(){function e(e){t(this,e);this.wmProgressSliceUpdated=p(this,"wmProgressSliceUpdated",7);this.legend=undefined;this.amount=undefined;this.popoverTitle=undefined;this.popoverText=undefined;this.popoverButtonText=undefined}e.prototype.componentDidUpdate=function(){this.wmProgressSliceUpdated.emit()};return e}())}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-c467a1e1.system.js","./p-7eb9bac9.system.js","./p-975c0d09.system.js"],(function(e){"use strict";var t,r,o,n,a,p,i,s,l,c,h,d,m,b,g,w,u,f,x,v;return{setters:[function(e){t=e.r;r=e.f;o=e.h;n=e.H;a=e.g;p=e.c},function(e){i=e.g;s=e.i;l=e.d;c=e.u},function(e){h=e.a;d=e.h;m=e.g;b=e.c;g=e.d;w=e.e;u=e.f;f=e.i;x=e.k;v=e.l}],execute:function(){var y=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment:not(.zero):not(:last-of-type){margin-right:2px}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper:not(:last-of-type){margin-right:2px}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment,:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment,:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment,:host .component-wrapper path:hover.doughnut-segment,:host .component-wrapper path:focus.doughnut-segment,:host .component-wrapper .stacked-bar-segment:active.doughnut-segment,:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment,:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment{-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut2b label,:host .component-wrapper.doughnut2b .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{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 .component-wrapper.doughnut0,:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut0 label,:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut0 label .subinfo,:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut0 .completion-message,:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar1,:host .component-wrapper.bar{padding:1.25rem;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar1 label,:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar1 label .subinfo,:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar1 .chart-wrapper,:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar1 .chart-wrapper .single-perc,:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar1 .chart-wrapper .inner-stacked-bar-wrapper,:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar1 .chart-wrapper .completion-message,:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar1,:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar1 label,:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar1 .bar-wrapper,:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar1 .bar-wrapper .single-perc,:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar2b,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar2 .inner-stacked-bar-wrapper,:host .component-wrapper.bar2b .inner-stacked-bar-wrapper,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar2 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar2b .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:100px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;height:90px;width:100%;overflow:visible;-webkit-transform:translateY(90px);transform:translateY(90px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .chart-wrapper .axis text{-webkit-transform:translate(4px, 24px);transform:translate(4px, 24px);text-anchor:middle}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar,:host .component-wrapper.bar6 .bar:hover.bar,:host .component-wrapper.bar6 .bar:focus.bar,:host .component-wrapper.bar7 .bar:active.bar,:host .component-wrapper.bar7 .bar:hover.bar,:host .component-wrapper.bar7 .bar:focus.bar{-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host #chart-instructions{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 .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar1,:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host(:focus){outline:none}:host(:focus) .component-wrapper.user-is-tabbing .stacked-bar-segments-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .simple-bar-wrapper,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host(:focus) .component-wrapper.user-is-tabbing .stacked-bar-segments-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .simple-bar-wrapper::-moz-focus-inner,:host(:focus) .component-wrapper.user-is-tabbing .doughnut-wrapper::-moz-focus-inner{border:0}";var k=e("wm_progress_indicator",function(){function e(e){t(this,e);this.uid=i();this.slicesDetails=[];this.barLabelsWidth=this.el.parentElement.barLabelsWidth;this.label=undefined;this.subinfo=undefined;this.completionMessage=undefined;this.showLegend=true;this.isTabbing=false;this.mode=undefined;this.userIsNavigating=false}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return this.mode?h[this.mode]:undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartRoleDescription",{get:function(){return s.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){d.call(this,e)};e.prototype.componentWillLoad=function(){var e=this;if(!this.label){console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.el.children.length!==2){console.warn("wm-progress-indicator component must have 2 wm-progress-slice children.")}this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(function(t){return e.mode=t.detail}))};e.prototype.handleSliceUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,m.call(this,this.mode)];case 1:e.sent();r(this.el);return[2]}}))}))};e.prototype.handleModeUpdate=function(){if(this.mode){m.call(this,this.mode)}};e.prototype.renderBarOrDoughnut=function(){if(this.total>0&&this.mode==="bar"){return b.call(this,this.mode)}else{return g.call(this,this.mode)}};e.prototype.render=function(){var e=this;return o(n,{onBlur:function(){return x.call(e)}},o("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.mode," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""),role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},o("label",{id:"label-".concat(this.uid),class:"label ".concat(this.barLabelsWidth&&this.mode==="bar"?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:"graphic-".concat(this.uid)},o("span",{class:"label-text"},this.label),this.subinfo?o("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),this.mode==="doughnut"?u.call(this,this.mode):"",o("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":""}),this.mode==="doughnut"?f.call(this):""),w())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["handleModeUpdate"]}},enumerable:false,configurable:true});return e}());k.style=y;var z=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar1,:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start;padding:0 1.25rem}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}";var P=e("wm_progress_monitor",function(){function e(e){var o=this;t(this,e);this.wmProgressMonitorModeChange=p(this,"wmProgressMonitorModeChange",7);this.doughnutWidth=300;this.modeInitialized=false;this.debouncedUpdate=l((function(){return r(o.el)}),50);this.breakpoint=undefined;this.groupLegend=undefined;this.barLabelsWidth=undefined}Object.defineProperty(e.prototype,"parsedBreakpoint",{get:function(){var e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);var t=e>=20?e:e*this.doughnutWidth;return t},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"mode",{get:function(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.componentDidLoad=function(){this.wmProgressMonitorModeChange.emit(this.mode);this.modeInitialized=true};e.prototype.componentWillUpdate=function(){if(this.prevMode!==this.mode){this.wmProgressMonitorModeChange.emit(this.mode)}this.prevMode=this.mode};e.prototype.parseToNum=function(e){var t=e.toString();var r=t.replace("px","");return parseInt(r)};e.prototype.renderLegend=function(){var e=c(this.groupLegend);var t=h.bar.colors;return o("div",{class:"legend-wrapper"},o("div",{class:"legend"},e.map((function(e,r){var o={key:e,color:t[r]};return v(o)}))))};e.prototype.render=function(){return o(n,{class:this.mode==="doughnut"?"row":"column"},this.modeInitialized&&this.groupLegend&&this.mode==="bar"&&this.renderLegend(),this.modeInitialized&&o("slot",null))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());P.style=z;var j=e("wm_progress_slice",function(){function e(e){t(this,e);this.wmProgressSliceUpdated=p(this,"wmProgressSliceUpdated",7);this.legend=undefined;this.amount=undefined;this.popoverTitle=undefined;this.popoverText=undefined;this.popoverButtonText=undefined}e.prototype.componentDidUpdate=function(){this.wmProgressSliceUpdated.emit()};return e}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,f as i,h as o,H as r,g as l}from"./p-11b416c7.js";import{d as n,i as s,l as a,s as d,h as p}from"./p-
|
|
1
|
+
import{r as e,c as t,f as i,h as o,H as r,g as l}from"./p-11b416c7.js";import{d as n,i as s,l as a,s as d,h as p}from"./p-af1d2a68.js";const c=class{constructor(o){e(this,o),this.wmIntFilePreviewed=t(this,"wmIntFilePreviewed",7),this.wmIntFileDownloaded=t(this,"wmIntFileDownloaded",7),this.wmIntFileDeleted=t(this,"wmIntFileDeleted",7),this.wmFileClearErrorClicked=t(this,"wmFileClearErrorClicked",7),this.isWithinLegacyUploader=!1,this.debouncedResize=n((()=>{this.isCondensed=this.el.clientWidth<500,i(this.el)}),50),this.file=void 0,this.showInfo="time",this.errorMessage=void 0,this.isCondensed=!1}get fileData(){let e=this.file?JSON.parse(this.file):null;return e&&e.progress&&"string"==typeof e.progress&&e.progress.match(/^[0-9]+$/)&&(e.progress=parseInt(e.progress.toString())),e}get isUploading(){return this.fileData&&this.fileData.hasOwnProperty("progress")&&this.fileData.progress<100}get previewButtonTooltip(){return s.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})}get downloadButtonTooltip(){return s.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})}get deleteButtonTooltip(){return s.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})}get previewActionMessage(){return s.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})}get downloadActionMessage(){return s.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})}get deleteActionMessage(){return s.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})}get actionMenuLabel(){return s.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})}get clearButtonText(){return s.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})}generateClearButtonLabel(e){return s.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})}componentWillLoad(){const e=this.el.getRootNode().host;e&&"WM-UPLOADER"===e.nodeName&&(e.type||e.uploaderType)&&(this.isWithinLegacyUploader=!0),new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}componentDidRender(){const e=this.el.shadowRoot.querySelector(".filename"),t=this.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left,i=this.el.shadowRoot.querySelector(".right-group"),o=i?i.getBoundingClientRect().left:this.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;e.textContent=a(e,e.dataset.filename,o-t,7)}previewFile(e){this.wmIntFilePreviewed.emit(e.id)}downloadFile(e){this.wmIntFileDownloaded.emit(e.id)}deleteFile(e){this.wmIntFileDeleted.emit(e.id)}handleFilenameMouseEnter(e,t){e.target.textContent.includes("...")&&d("bottom",e.target,t)}renderFileName(e,t){return o("div",{class:"left-group"},o("div",{class:"name-wrapper"},o("span",{class:"sr-only"},e),o("span",{"aria-hidden":"true",class:"filename","data-filename":e,onMouseEnter:t=>this.handleFilenameMouseEnter(t,e),onMouseLeave:()=>p()}),t&&o("span",{class:"sr-only"},"uploading")))}renderFileInfo(e,t){let i="";return"time"===t&&e.lastUpdated?i=e.lastUpdated:"size"===t&&e.size&&(i=e.size),o("div",{class:"file-info"},i)}renderActionMenu(e){const t=e.fileActions||"download delete",i=o("wm-menuitem",{icon:"f208",onClick:()=>this.previewFile(e)},this.previewActionMessage),r=o("wm-menuitem",{icon:"f1da",onClick:()=>this.downloadFile(e)},this.downloadActionMessage),l=o("wm-menuitem",{icon:"f1c0",onClick:()=>this.deleteFile(e)},this.deleteActionMessage);return o("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":`${e.name} ${this.actionMenuLabel}`},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileActionButtons(e){const t=e.fileActions||"download delete",i=o("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`preview ${e.name}`,icon:"f208",onClick:()=>this.previewFile(e)}),r=o("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`download ${e.name}`,icon:"f1da",onClick:()=>this.downloadFile(e)}),l=o("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`delete ${e.name}`,icon:"f1c0",onClick:()=>this.deleteFile(e)});return o("div",{class:"file-controls"},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileInProgress(e){const t=e.type?`${e.name}.${e.type}`:e.name;return o("div",{class:"file-wrapper"},o("div",{class:"file --progress"},o("div",{class:"progress",style:{background:`linear-gradient(to right, var(--wmcolor-file-progress) ${e.progress}%, transparent ${e.progress}%)`}}),this.renderFileName(t,this.isUploading)))}renderFileControls(e){const t=e.fileActions&&1===e.fileActions.split(" ").length;return this.isCondensed&&!t?this.renderActionMenu(e):this.renderFileActionButtons(e)}renderFile(e){return o("div",{class:"file-wrapper "+(this.isWithinLegacyUploader||100!==e.progress?"":"checked")},o("div",{class:"file "+(this.errorMessage?"--error":"")},this.renderFileName(e.type?`${e.name}.${e.type}`:e.name,this.isUploading),!this.errorMessage&&o("div",{class:"right-group "+(this.isCondensed?"condensed":"")},"none"!==this.showInfo&&this.renderFileInfo(e,this.showInfo),""!==e.fileActions&&this.renderFileControls(e)),this.errorMessage&&o("wm-button",{"permanently-delete":!0,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(e.name),onClick:()=>this.wmFileClearErrorClicked.emit({name:e.name})},this.clearButtonText)),this.errorMessage&&o("div",{class:"error-message"},this.errorMessage))}render(){return o(r,{role:"listitem"},this.isUploading?this.renderFileInProgress(this.fileData):this.renderFile(this.fileData))}static get delegatesFocus(){return!0}get el(){return l(this)}};c.style=':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{min-width:300px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;height:3.5rem;padding:0 1.25rem;position:relative;background: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}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:5rem;gap:1rem}.file-wrapper .file .right-group.condensed{padding-left:2.5rem}.file-wrapper .file .right-group .file-controls{display:-ms-flexbox;display:flex;gap:1rem}.file-wrapper .file .right-group .file-info{white-space:nowrap}.file-wrapper .file.--error{border:1px solid 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;margin-top:0.25rem}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{c as wm_file}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-c467a1e1.system.js","./p-d4ebbe84.system.js"],(function(t){"use strict";var e,i,n,a,o,r,s,l;return{setters:[function(t){e=t.r;i=t.c;n=t.h;a=t.H;o=t.g;r=t.f},function(t){s=t.d;l=t.g}],execute:function(){var b=":host{font-family:inherit;display:inline-block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tab-item{list-style-type:none;height:100%;display:inline-block}:host .tab-item .tab{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;border-radius:0;color:var(--wmcolor-tab-text);text-decoration:none;letter-spacing:0.7px;font-size:0.875rem;font-weight:500;opacity:1;position:relative;text-transform:uppercase;display:inline-block;height:3.3333333333em;line-height:3.3333333333em;padding-right:1.5rem;padding-left:1.5rem}:host .tab-item .tab[aria-selected=true]{font-weight:700;opacity:1;background:-webkit-gradient(linear, left top, left bottom, from(currentColor), to(currentColor)) bottom/0 0 no-repeat;background:linear-gradient(currentColor, currentColor) bottom/0 0 no-repeat;background-size:calc(100% - 50px) 3px}:host .tab-item .tab[aria-selected=true].dark{color:var(--wmcolor-tab-text-ondark)}:host .tab-item .tab,:host .tab-item .tab:hover,:host .tab-item .tab:active{outline:none}:host .tab-item .tab:focus{outline:none}:host .tab-item .tab.dark:not([aria-selected=true]){opacity:0.8;color:var(--wmcolor-tab-text-ondark)}:host .tab-item .tab.user-is-tabbing:focus:not(:active){outline:none;-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .tab-item .tab.user-is-tabbing:focus:not(:active)::-moz-focus-inner{border:0}:host .tab-item .tab.user-is-tabbing:focus:not(:active).dark{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);outline:none}:host.hide{display:none}";var c=t("wm_tab_item",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.tabSelected=i(this,"tabSelected",7);this.keydownOnTabItem=i(this,"keydownOnTabItem",7);this.tabItemLoaded=i(this,"tabItemLoaded",7);this.tabClicked=function(t){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId});n.tabSelected.emit({tabId:n.tabId})};this.tabPressed=function(t){var e=t.key;if(e==="Enter"||e===" "){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId});n.tabSelected.emit({tabId:n.tabId})}else if(e.includes("Arrow")){t.preventDefault();n.keydownOnTabItem.emit({tabItem:n.el,key:t.key})}};this.selected=false;this.show=true;this.tabId=""}Object.defineProperty(t.prototype,"parentTabList",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.linkEl&&this.linkEl.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.linkEl&&this.linkEl.classList.remove("user-is-tabbing")};t.prototype.componentDidLoad=function(){this.tabItemLoaded.emit()};t.prototype.render=function(){var t=this;var e=this.show?"":"hide ";e+=this.parentTabList&&this.parentTabList.customBackground=="dark"?"dark":"";var i={};var o=this.parentTabList&&this.parentTabList.customPadding;if(o){var r=parseInt(o,10)*2||0;var s=o.split(/([0-9]+)/).pop();i={"padding-left":this.parentTabList.customPadding,"padding-right":this.parentTabList.customPadding,"background-size":"calc(100% - ".concat(r).concat(s,") 3px")}}return n(a,{role:"presentation"},n("li",{class:"tab-item",role:"presentation"},n("a",{class:"tab ".concat(e),style:i,role:"tab",ref:function(e){return t.linkEl=e},onClick:this.tabClicked,id:"tab-link-".concat(this.tabId),onKeyDown:function(e){return t.tabPressed(e)},"aria-selected":this.selected?"true":"false",tabindex:this.selected?0:-1},n("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());c.style=b;var d=":host{--wmcolor-tab-background:var(--wmcolor-background-transparent);--wmcolor-tab-background-dark:var(--wmcolor-background-dark);--wmcolor-tab-text-ondark:var(--wmcolor-interactive-ondark);--wmcolor-tab-text:var(--wmcolor-interactive);position:relative;white-space:nowrap;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tabcontainer{background:var(--wmcolor-tab-background);margin:0;margin-left:-24px;width:100%;height:4.0625rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0}:host .tabcontainer.dark{background:var(--wmcolor-tab-background-dark);margin:0}:host wm-select{padding:0.375rem 0}";var u=t("wm_tab_list",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.tabSelected=i(this,"tabSelected",7);this.debouncedSetLayout=s((function(){if(!n.listWidth){n.setListWidth()}r(n.el)}),250);this.customBackground=undefined;this.customPadding=undefined;this.selectedTab=undefined;this.controllerEnabled=false}Object.defineProperty(t.prototype,"menuLayout",{get:function(){if(this.listWidth){return this.el.offsetWidth<this.listWidth-24}else{return false}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-tab-item"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedTabItem",{get:function(){return this.tabItems.filter((function(t){return t.selected}))[0]},enumerable:false,configurable:true});t.prototype.getLinkEl=function(t){return t.shadowRoot.querySelector("a")};Object.defineProperty(t.prototype,"panels",{get:function(){var t=Array.from(document.querySelectorAll("wm-tab-panel"));var e=this.tabItems.map((function(t){return t.tabId}));return t.filter((function(t){return e.includes(t.tabId)}))},enumerable:false,configurable:true});t.prototype.getPanel=function(t){return this.panels.find((function(e){return e.tabId===t}))};t.prototype.setListWidth=function(){var t=this.tabItems.reduce((function(t,e){return t+e.offsetWidth}),0);this.listWidth=t&&t>0?t:this.listWidth};t.prototype.setSelected=function(t){this.tabItems.map((function(e){return e.selected=e.tabId===t}));var e=this.panels.length===1&&this.tabItems.length>1;if(e){this.setAttributesOnPanel(this.panels[0],this.selectedTabItem);this.panels[0].active=true}else{this.panels.map((function(e){return e.active=e.tabId===t}))}};t.prototype.showItems=function(){this.tabItems.map((function(t){return t.show=true}))};t.prototype.hideItems=function(){this.tabItems.map((function(t){return t.show=false}))};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){t.selectedTabItem&&t.selectedTabItem.focus()}};t.prototype.componentDidLoad=function(){this.setLayout();var t=this.selectedTab||this.tabItems[0].tabId;this.setSelected(t)};t.prototype.tabItemLoaded=function(t){this.setAriaOnPanelAndTab(t.target)};t.prototype.setAriaOnPanelAndTab=function(t){var e=this.getPanel(t.tabId);if(!e){if(this.panels.length===1){this.setAttributesOnTab(t,this.panels[0])}}else{this.setAttributesOnPanel(e,t);this.setAttributesOnTab(t,e)}};t.prototype.setAttributesOnTab=function(t,e){var i=this.getLinkEl(t);if(i){i.setAttribute("aria-controls",e.id);i.setAttribute("href","#".concat(e.id))}};t.prototype.removeAttributesOnTab=function(t){var e=this.getLinkEl(t);if(e){e.removeAttribute("aria-controls");e.removeAttribute("href")}};t.prototype.setAttributesOnPanel=function(t,e){var i=this.getLinkEl(e);if(i){t.setAttribute("aria-labelledby",i.id);t.setAttribute("tab-id",e.tabId)}};t.prototype.handleTabSelected=function(t){if(this.controllerEnabled){this.setSelected(t.detail.tabId)}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var i=this.tabItems.indexOf(t.detail.tabItem);if(e==="ArrowLeft"||e==="ArrowRight"){this.handleLeftRightArrow(i,e)}};t.prototype.handleLeftRightArrow=function(t,e){if(e){t=e==="ArrowLeft"?t-1:t+1}if(t<0){t=this.tabItems.length-1}else if(t===this.tabItems.length){t=0}var i=this.tabItems[t];this.getLinkEl(i).focus()};t.prototype.setLayout=function(){this.debouncedSetLayout()};t.prototype.renderMenuOrTabs=function(){if(this.menuLayout){this.hideItems();return n("wm-select",{label:"Tab Selection","label-position":"none"},this.renderOptions())}else{this.showItems();var t={};if(this.customPadding){t={"margin-left":"-"+this.customPadding}}return n("ul",{class:"tabcontainer ".concat(this.customBackground||""),style:t,role:"tablist"},n("slot",null))}};t.prototype.renderOptions=function(){var t=this;return this.tabItems.map((function(e){return n("wm-option",{id:"tab-link-".concat(e.tabId),selected:e.tabId===t.selectedTab,onClick:function(i){i.preventDefault();t.wmTabSelected.emit({tabId:e.tabId});t.tabSelected.emit({tabId:e.tabId})}},e.textContent)}))};t.prototype.render=function(){return n(a,{class:this.menuLayout?"menu":""},this.renderMenuOrTabs())};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["setSelected"]}},enumerable:false,configurable:true});return t}());u.style=d;var p="wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";var h=t("wm_tab_panel",function(){function t(t){e(this,t);this.tabPanelLoaded=i(this,"tabPanelLoaded",7);this.active=false;this.tabId=""}t.prototype.componentWillLoad=function(){!this.el.id&&this.el.setAttribute("id",l())};t.prototype.componentDidLoad=function(){this.tabPanelLoaded.emit({tabId:this.tabId})};t.prototype.toggleTabbingOn=function(){this.el.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.el.classList.remove("user-is-tabbing")};t.prototype.render=function(){return n(a,{role:"tabpanel",class:{"tab-hidden":!this.active}})};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());h.style=p}}}));
|
|
1
|
+
System.register(["./p-c467a1e1.system.js","./p-7eb9bac9.system.js"],(function(t){"use strict";var e,i,n,a,o,r,s,l;return{setters:[function(t){e=t.r;i=t.c;n=t.h;a=t.H;o=t.g;r=t.f},function(t){s=t.d;l=t.g}],execute:function(){var b=":host{font-family:inherit;display:inline-block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tab-item{list-style-type:none;height:100%;display:inline-block}:host .tab-item .tab{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;border-radius:0;color:var(--wmcolor-tab-text);text-decoration:none;letter-spacing:0.7px;font-size:0.875rem;font-weight:500;opacity:1;position:relative;text-transform:uppercase;display:inline-block;height:3.3333333333em;line-height:3.3333333333em;padding-right:1.5rem;padding-left:1.5rem}:host .tab-item .tab[aria-selected=true]{font-weight:700;opacity:1;background:-webkit-gradient(linear, left top, left bottom, from(currentColor), to(currentColor)) bottom/0 0 no-repeat;background:linear-gradient(currentColor, currentColor) bottom/0 0 no-repeat;background-size:calc(100% - 50px) 3px}:host .tab-item .tab[aria-selected=true].dark{color:var(--wmcolor-tab-text-ondark)}:host .tab-item .tab,:host .tab-item .tab:hover,:host .tab-item .tab:active{outline:none}:host .tab-item .tab:focus{outline:none}:host .tab-item .tab.dark:not([aria-selected=true]){opacity:0.8;color:var(--wmcolor-tab-text-ondark)}:host .tab-item .tab.user-is-tabbing:focus:not(:active){outline:none;-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .tab-item .tab.user-is-tabbing:focus:not(:active)::-moz-focus-inner{border:0}:host .tab-item .tab.user-is-tabbing:focus:not(:active).dark{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);outline:none}:host.hide{display:none}";var c=t("wm_tab_item",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.tabSelected=i(this,"tabSelected",7);this.keydownOnTabItem=i(this,"keydownOnTabItem",7);this.tabItemLoaded=i(this,"tabItemLoaded",7);this.tabClicked=function(t){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId});n.tabSelected.emit({tabId:n.tabId})};this.tabPressed=function(t){var e=t.key;if(e==="Enter"||e===" "){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId});n.tabSelected.emit({tabId:n.tabId})}else if(e.includes("Arrow")){t.preventDefault();n.keydownOnTabItem.emit({tabItem:n.el,key:t.key})}};this.selected=false;this.show=true;this.tabId=""}Object.defineProperty(t.prototype,"parentTabList",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.linkEl&&this.linkEl.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.linkEl&&this.linkEl.classList.remove("user-is-tabbing")};t.prototype.componentDidLoad=function(){this.tabItemLoaded.emit()};t.prototype.render=function(){var t=this;var e=this.show?"":"hide ";e+=this.parentTabList&&this.parentTabList.customBackground=="dark"?"dark":"";var i={};var o=this.parentTabList&&this.parentTabList.customPadding;if(o){var r=parseInt(o,10)*2||0;var s=o.split(/([0-9]+)/).pop();i={"padding-left":this.parentTabList.customPadding,"padding-right":this.parentTabList.customPadding,"background-size":"calc(100% - ".concat(r).concat(s,") 3px")}}return n(a,{role:"presentation"},n("li",{class:"tab-item",role:"presentation"},n("a",{class:"tab ".concat(e),style:i,role:"tab",ref:function(e){return t.linkEl=e},onClick:this.tabClicked,id:"tab-link-".concat(this.tabId),onKeyDown:function(e){return t.tabPressed(e)},"aria-selected":this.selected?"true":"false",tabindex:this.selected?0:-1},n("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());c.style=b;var d=":host{--wmcolor-tab-background:var(--wmcolor-background-transparent);--wmcolor-tab-background-dark:var(--wmcolor-background-dark);--wmcolor-tab-text-ondark:var(--wmcolor-interactive-ondark);--wmcolor-tab-text:var(--wmcolor-interactive);position:relative;white-space:nowrap;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tabcontainer{background:var(--wmcolor-tab-background);margin:0;margin-left:-24px;width:100%;height:4.0625rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0}:host .tabcontainer.dark{background:var(--wmcolor-tab-background-dark);margin:0}:host wm-select{padding:0.375rem 0}";var u=t("wm_tab_list",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.tabSelected=i(this,"tabSelected",7);this.debouncedSetLayout=s((function(){if(!n.listWidth){n.setListWidth()}r(n.el)}),250);this.customBackground=undefined;this.customPadding=undefined;this.selectedTab=undefined;this.controllerEnabled=false}Object.defineProperty(t.prototype,"menuLayout",{get:function(){if(this.listWidth){return this.el.offsetWidth<this.listWidth-24}else{return false}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-tab-item"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedTabItem",{get:function(){return this.tabItems.filter((function(t){return t.selected}))[0]},enumerable:false,configurable:true});t.prototype.getLinkEl=function(t){return t.shadowRoot.querySelector("a")};Object.defineProperty(t.prototype,"panels",{get:function(){var t=Array.from(document.querySelectorAll("wm-tab-panel"));var e=this.tabItems.map((function(t){return t.tabId}));return t.filter((function(t){return e.includes(t.tabId)}))},enumerable:false,configurable:true});t.prototype.getPanel=function(t){return this.panels.find((function(e){return e.tabId===t}))};t.prototype.setListWidth=function(){var t=this.tabItems.reduce((function(t,e){return t+e.offsetWidth}),0);this.listWidth=t&&t>0?t:this.listWidth};t.prototype.setSelected=function(t){this.tabItems.map((function(e){return e.selected=e.tabId===t}));var e=this.panels.length===1&&this.tabItems.length>1;if(e){this.setAttributesOnPanel(this.panels[0],this.selectedTabItem);this.panels[0].active=true}else{this.panels.map((function(e){return e.active=e.tabId===t}))}};t.prototype.showItems=function(){this.tabItems.map((function(t){return t.show=true}))};t.prototype.hideItems=function(){this.tabItems.map((function(t){return t.show=false}))};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){t.selectedTabItem&&t.selectedTabItem.focus()}};t.prototype.componentDidLoad=function(){this.setLayout();var t=this.selectedTab||this.tabItems[0].tabId;this.setSelected(t)};t.prototype.tabItemLoaded=function(t){this.setAriaOnPanelAndTab(t.target)};t.prototype.setAriaOnPanelAndTab=function(t){var e=this.getPanel(t.tabId);if(!e){if(this.panels.length===1){this.setAttributesOnTab(t,this.panels[0])}}else{this.setAttributesOnPanel(e,t);this.setAttributesOnTab(t,e)}};t.prototype.setAttributesOnTab=function(t,e){var i=this.getLinkEl(t);if(i){i.setAttribute("aria-controls",e.id);i.setAttribute("href","#".concat(e.id))}};t.prototype.removeAttributesOnTab=function(t){var e=this.getLinkEl(t);if(e){e.removeAttribute("aria-controls");e.removeAttribute("href")}};t.prototype.setAttributesOnPanel=function(t,e){var i=this.getLinkEl(e);if(i){t.setAttribute("aria-labelledby",i.id);t.setAttribute("tab-id",e.tabId)}};t.prototype.handleTabSelected=function(t){if(this.controllerEnabled){this.setSelected(t.detail.tabId)}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var i=this.tabItems.indexOf(t.detail.tabItem);if(e==="ArrowLeft"||e==="ArrowRight"){this.handleLeftRightArrow(i,e)}};t.prototype.handleLeftRightArrow=function(t,e){if(e){t=e==="ArrowLeft"?t-1:t+1}if(t<0){t=this.tabItems.length-1}else if(t===this.tabItems.length){t=0}var i=this.tabItems[t];this.getLinkEl(i).focus()};t.prototype.setLayout=function(){this.debouncedSetLayout()};t.prototype.renderMenuOrTabs=function(){if(this.menuLayout){this.hideItems();return n("wm-select",{label:"Tab Selection","label-position":"none"},this.renderOptions())}else{this.showItems();var t={};if(this.customPadding){t={"margin-left":"-"+this.customPadding}}return n("ul",{class:"tabcontainer ".concat(this.customBackground||""),style:t,role:"tablist"},n("slot",null))}};t.prototype.renderOptions=function(){var t=this;return this.tabItems.map((function(e){return n("wm-option",{id:"tab-link-".concat(e.tabId),selected:e.tabId===t.selectedTab,onClick:function(i){i.preventDefault();t.wmTabSelected.emit({tabId:e.tabId});t.tabSelected.emit({tabId:e.tabId})}},e.textContent)}))};t.prototype.render=function(){return n(a,{class:this.menuLayout?"menu":""},this.renderMenuOrTabs())};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["setSelected"]}},enumerable:false,configurable:true});return t}());u.style=d;var p="wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";var h=t("wm_tab_panel",function(){function t(t){e(this,t);this.tabPanelLoaded=i(this,"tabPanelLoaded",7);this.active=false;this.tabId=""}t.prototype.componentWillLoad=function(){!this.el.id&&this.el.setAttribute("id",l())};t.prototype.componentDidLoad=function(){this.tabPanelLoaded.emit({tabId:this.tabId})};t.prototype.toggleTabbingOn=function(){this.el.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.el.classList.remove("user-is-tabbing")};t.prototype.render=function(){return n(a,{role:"tabpanel",class:{"tab-hidden":!this.active}})};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());h.style=p}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{l(a.next(t))}catch(t){i(t)}}function o(t){try{l(a["throw"](t))}catch(t){i(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,n=e.length,i;a<n;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};System.register(["./p-c467a1e1.system.js","./p-d4ebbe84.system.js"],(function(t){"use strict";var e,r,a,n,i,s;return{setters:[function(t){e=t.h},function(t){r=t.i;a=t.c;n=t.e;i=t.f;s=t.d}],execute:function(){t({b:f,c:N,d:L,e:P,f:U,g:B,h:M,i:H,j:X,k:A,l:q,m:d,n:x,r:K});var o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var l=t("a",{doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}});function c(t){return t==="percentage"||t==="amount"?"show-values":""}var u=r.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var h=r.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function d(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function f(t,e,r){return r?Math.round(t*100/e):Math.round(t*1e4/e)/100}function p(t,e){return t*360/e}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,e,r,a){var n=v(t+t*e*Math.cos(Math.PI*r/180));var i=v(t+t*e*Math.sin(Math.PI*r/180));if(a!==undefined){var s=v(t+t*e*Math.cos(Math.PI*a/180));var o=v(t+t*e*Math.sin(Math.PI*a/180));return{x1:n,y1:i,x2:s,y2:o}}return{x:n,y:i}}function m(t,e,r,a,n){var i=v(n/2*t);return"A ".concat(i,", ").concat(i," 0 ").concat(e," ").concat(v(r),", ").concat(v(a))}function b(t,e,r,a,n){var i=(t-e)*(n-a)/(r-e)+a;return i<a?a:i>n?n:i}function y(t){return b(t,300,900,70,150)}function w(t){return Math.round(t/y(t))}function x(t,e){var r=t/e;var a=Math.pow(10,Math.floor(Math.log10(r)));var n=r/a;var i;if(n>5){i=10*a}else if(n>3){i=5*a}else if(n>2){i=3*a}else if(n>1.5){i=2*a}else if(n>1){i=1.5*a}else{i=a}return i}function k(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var e=this.popoverEl.querySelector("button");e&&e.click()}}function E(t,e){if(this.popoverEl&&!this.isTabbing){e.coords={x:t.clientX,y:t.clientY};z.call(this,e)}}function D(t,e){if(this.popoverEl&&this.isTabbing){e.coords=n(t.target);z.call(this,e)}}function M(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;_.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;T.call(this);break;case"Tab":A.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function z(t){var e=this;if(!!this.popoverEl&&!!t.title&&!!t.text){this.popoverEl.popoverTitle=t.title;this.popoverEl.popoverText=t.text;this.popoverEl.buttonText=t.buttonText;this.popoverEl.coords=t.coords;this.popoverEl.sliceRef=t.sliceRef;window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),30);var r=s((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=i(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function T(){var t=a(document.activeElement);var e=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;C.call(this,e)}function _(){if(this.sliceEls){var t=a(document.activeElement);var e=this.sliceEls.indexOf(t);if(e===-1){e=0}else if(e===0){e=this.sliceEls.length-1}else{e-=1}C.call(this,e)}}function C(t){var e=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),10)}}function A(){var t=this;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function B(t){return __awaiter(this,void 0,void 0,(function(){var e,r;var a=this;return __generator(this,(function(n){this.slicesDetails=[];e=0;r=Array.from(this.el.children);this.total=r.reduce((function(t,e){return t+=parseInt(e.getAttribute("amount")||"0")}),0);r.forEach((function(r,n){var i=parseInt(r.getAttribute("amount")||"0");var s=f(i,a.total,true);var c=n;if(t==="bar5"){c=a.notStartedColor?n:n+1}if(t==="bar6"){c=0}var u=l[t].colors[c];var h={amount:i,perc:s,legend:r.getAttribute("legend"),color:u||o.gray,offset:e,id:"".concat(a.uid,"-").concat(n+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};e+=i;a.slicesDetails.push(h)}));return[2]}))}))}function I(t,e){var r=__spreadArray([],t,true).sort((function(t,e){return t.amount===e.amount?0:t.amount>e.amount?-1:1}));var a=0;r.forEach((function(t,n){var i=r[n===0?r.length-1:n-1];var s=r[n===r.length-1?0:n+1];var o=f(i.amount,e,true);var l=f(s.amount,e,true);t.offset=a;a+=t.amount;t.inSmallCluster=S(o,t.perc,t.amount,l)}));return r}function S(t,e,r,a){var n=e<4;var i=t<5;var s=a<5;var o=n&&(i||s);var l=e===0&&r>0;if(l&&(a<8||t<8)){o=true}return o}function F(t,e,r){var a=p(e,this.total)-90;var n=t/this.total*360;var i=a+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(n===360){i-=.01}var v=g(l,u,a+d,i);var b=g(l,c,a+f,i);var y="M ".concat(v.x1,", ").concat(v.y1," ");var w=m(u,s,v.x2,v.y2,this.chartDetails.size);var x=" L ".concat(b.x2,", ").concat(b.y2," ");var k=m(c,o,b.x1,b.y1,this.chartDetails.size);return y+w+x+k+" z"}function P(){var t=r.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return e("div",{id:"chart-instructions"},t)}function V(){return e("defs",null,e("filter",{id:"wmHoverDropShadow"},e("feGaussianBlur",{stdDeviation:"3"}),e("feOffset",{result:"offsetblur"}),e("feFlood",{"flood-color":"#333"}),e("feComposite",{operator:"in",in2:"offsetblur"}),e("feMerge",null,e("feMergeNode",null),e("feMergeNode",{in:"SourceGraphic"}))))}function L(t){var r=this;var a=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut0"||t==="doughnut";var i=n?this.slicesDetails:I(this.slicesDetails,this.total);return e("div",{class:"chart-wrapper doughnut-wrapper"},e("svg",{width:a+"px",height:a+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},V(),i.map((function(e){return R.call(r,e,t)})),n?e("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},f(i[0].amount,this.total,true)+"%"):e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},i.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(r,t):""})))))}function R(t,r){var a=this;return e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},e("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:F.call(this,t.amount,t.offset,r),onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)},role:"img","aria-label":t.legend}))}function W(t){var r=p(t.offset+t.amount/2,this.total);var a=g(this.chartDetails.size/2,1.4,r-90),n=a.x,i=a.y;return e("text",{class:"value",x:n+"px",y:i+"px"},"".concat(t.perc>0?t.perc:"<1","%"))}function N(t){var r=this;var a=t==="bar1"||t==="bar";return e("div",{class:"chart-wrapper bar-wrapper"},a?e("div",{class:"single-perc"},f(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),e("div",{class:"inner-stacked-bar-wrapper ".concat(c(this.tempValueFormat))},!a?e("div",{class:"values"},this.slicesDetails.map((function(t,e){return r.renderBarText(t,e)}))):"",e("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t,e){return G.call(r,t,e)}))),a?H.call(this):""))}function G(t,r){var a=this;var n=r!==this.slicesDetails.length-1;var i="calc(".concat(f(t.amount,this.total,false),"%").concat(n?" - 2px":"",")");return e("div",{class:"segment stacked-bar-segment ".concat(f(t.amount,this.total,false)===0?"zero":""),style:{backgroundColor:t.color,width:i},onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)}},e("span",{class:"sr-only"},t.legend))}function K(t){var r=this;var a=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,e){return t>e?t:e}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var i=48;var s=this.el.getBoundingClientRect().width;var o=s-n-i;var l=w(o);var u=x(a,l);var h=l*u;var f=Math.floor((h-a)/u);l-=f;this.el.style.setProperty("--backgroundSize",100/l+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var p=[];this.slicesDetails.forEach((function(e){e.legend&&p.push(j(e.legend,r.showBarLegend,t));p.push(O.call(r,e,u,l,a))}));var v=[];for(var g=1;g<=l;g++){var m=d(g*u);v.push(e("div",{class:"tick"},e("span",null,m)))}var b=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return e("div",{class:"chart-wrapper simple-bar-wrapper"},e("div",{class:"chart ".concat(c(this.tempValueFormat))},b&&e("div",{class:"gridlines"}),e("div",{class:"rows"},p)),b&&e("div",{class:"x-axis","aria-hidden":"true"},e("div",{class:"zero"},e("span",null,"0")),v))}function j(t,r,a){var n=a==="bar7"&&!r?" hidden":"";return e("label",{class:"label".concat(n)},t)}function O(t,r,a,n){var i=this;var s=this.currentChartType==="bar6"?r*a:n;var o=f(t.amount,s,false);var l=o?o+"%":"1px";var c=d(t.amount);var u=this.tempValueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){u=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){u=(this.total===0?"0":f(t.amount,this.total,true))+"%"}return e("div",{class:"bar segment",style:{backgroundColor:t.color,width:l},onClick:function(e){return E.call(i,e,t)},onFocus:function(e){return D.call(i,e,t)},onKeyDown:function(t){return k.call(i,t)}},e("div",{class:"value"},u))}function U(t){if(this.showLegend){var r=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(t,e){return t=e.inSmallCluster?true:t}),false);return e("div",{class:"legend-wrapper"},e("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(t){if(!!t.amount||!!t.legend){return q({key:t.legend,color:t.color})}}))),r&&X())}}function q(t){return e("div",{class:"legend-item"},e("div",{class:"legend-color",style:{backgroundColor:t.color}}),e("div",{class:"legend-text"},t.key))}function H(){if(this.completionMessage){return e("div",{class:"completion-message"},this.completionMessage)}}function X(){return e("div",{class:"hidden-values-warning"},u,e("br",null),h)}}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{l(a.next(t))}catch(t){i(t)}}function o(t){try{l(a["throw"](t))}catch(t){i(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,n=e.length,i;a<n;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};System.register(["./p-c467a1e1.system.js","./p-7eb9bac9.system.js"],(function(t){"use strict";var e,r,a,n,i,s;return{setters:[function(t){e=t.h},function(t){r=t.i;a=t.c;n=t.e;i=t.f;s=t.d}],execute:function(){t({b:f,c:N,d:L,e:P,f:U,g:B,h:M,i:H,j:X,k:A,l:q,m:d,n:x,r:K});var o={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var l=t("a",{doughnut:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[o.forest,o.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[o.lavender,o.midnight,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[o.forest,o.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[o.gray,o.periwinkle,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[o.gray,o.periwinkle,o.midnight,o.cyan,o.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",o.cyan,"#8e4129",o.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o.salmon,o.cyan,o.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[o.gray,o.lavender,o.midnight,"#0089e4",o.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[o.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[o.periwinkle,o.cyan,o.salmon,o.gray],padding:0,category:"simpleBar"}});function c(t){return t==="percentage"||t==="amount"?"show-values":""}var u=r.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var h=r.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function d(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function f(t,e,r){return r?Math.round(t*100/e):Math.round(t*1e4/e)/100}function p(t,e){return t*360/e}function v(t){return parseFloat((Math.floor(t*100)/100).toFixed(2))}function g(t,e,r,a){var n=v(t+t*e*Math.cos(Math.PI*r/180));var i=v(t+t*e*Math.sin(Math.PI*r/180));if(a!==undefined){var s=v(t+t*e*Math.cos(Math.PI*a/180));var o=v(t+t*e*Math.sin(Math.PI*a/180));return{x1:n,y1:i,x2:s,y2:o}}return{x:n,y:i}}function m(t,e,r,a,n){var i=v(n/2*t);return"A ".concat(i,", ").concat(i," 0 ").concat(e," ").concat(v(r),", ").concat(v(a))}function b(t,e,r,a,n){var i=(t-e)*(n-a)/(r-e)+a;return i<a?a:i>n?n:i}function y(t){return b(t,300,900,70,150)}function w(t){return Math.round(t/y(t))}function x(t,e){var r=t/e;var a=Math.pow(10,Math.floor(Math.log10(r)));var n=r/a;var i;if(n>5){i=10*a}else if(n>3){i=5*a}else if(n>2){i=3*a}else if(n>1.5){i=2*a}else if(n>1){i=1.5*a}else{i=a}return i}function k(t){if(this.popoverEl&&this.popoverEl.open&&t.key==="Enter"){var e=this.popoverEl.querySelector("button");e&&e.click()}}function E(t,e){if(this.popoverEl&&!this.isTabbing){e.coords={x:t.clientX,y:t.clientY};z.call(this,e)}}function D(t,e){if(this.popoverEl&&this.isTabbing){e.coords=n(t.target);z.call(this,e)}}function M(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault();this.isTabbing=true;_.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault();this.isTabbing=true;T.call(this);break;case"Tab":A.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function z(t){var e=this;if(!!this.popoverEl&&!!t.title&&!!t.text){this.popoverEl.popoverTitle=t.title;this.popoverEl.popoverText=t.text;this.popoverEl.buttonText=t.buttonText;this.popoverEl.coords=t.coords;this.popoverEl.sliceRef=t.sliceRef;window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),30);var r=s((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=i(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function T(){var t=a(document.activeElement);var e=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;C.call(this,e)}function _(){if(this.sliceEls){var t=a(document.activeElement);var e=this.sliceEls.indexOf(t);if(e===-1){e=0}else if(e===0){e=this.sliceEls.length-1}else{e-=1}C.call(this,e)}}function C(t){var e=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.sliceEls[t].tabIndex=0;this.sliceEls[t].focusable=true;this.sliceEls[t].focus();window.setTimeout((function(){if(e.popoverEl){e.popoverEl.open=true}}),10)}}function A(){var t=this;this.sliceEls&&this.sliceEls.map((function(t){t.tabIndex=-1;t.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){t.componentWrapperEl.tabIndex=0;t.el.focusable=true;if(t.popoverEl){t.popoverEl.open=false}}),100)}function B(t){return __awaiter(this,void 0,void 0,(function(){var e,r;var a=this;return __generator(this,(function(n){this.slicesDetails=[];e=0;r=Array.from(this.el.children);this.total=r.reduce((function(t,e){return t+=parseInt(e.getAttribute("amount")||"0")}),0);r.forEach((function(r,n){var i=parseInt(r.getAttribute("amount")||"0");var s=f(i,a.total,true);var c=n;if(t==="bar5"){c=a.notStartedColor?n:n+1}if(t==="bar6"){c=0}var u=l[t].colors[c];var h={amount:i,perc:s,legend:r.getAttribute("legend"),color:u||o.gray,offset:e,id:"".concat(a.uid,"-").concat(n+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};e+=i;a.slicesDetails.push(h)}));return[2]}))}))}function I(t,e){var r=__spreadArray([],t,true).sort((function(t,e){return t.amount===e.amount?0:t.amount>e.amount?-1:1}));var a=0;r.forEach((function(t,n){var i=r[n===0?r.length-1:n-1];var s=r[n===r.length-1?0:n+1];var o=f(i.amount,e,true);var l=f(s.amount,e,true);t.offset=a;a+=t.amount;t.inSmallCluster=S(o,t.perc,t.amount,l)}));return r}function S(t,e,r,a){var n=e<4;var i=t<5;var s=a<5;var o=n&&(i||s);var l=e===0&&r>0;if(l&&(a<8||t<8)){o=true}return o}function F(t,e,r){var a=p(e,this.total)-90;var n=t/this.total*360;var i=a+n;var s=n>180?"1 1":"0 1";var o=n>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(n===360){i-=.01}var v=g(l,u,a+d,i);var b=g(l,c,a+f,i);var y="M ".concat(v.x1,", ").concat(v.y1," ");var w=m(u,s,v.x2,v.y2,this.chartDetails.size);var x=" L ".concat(b.x2,", ").concat(b.y2," ");var k=m(c,o,b.x1,b.y1,this.chartDetails.size);return y+w+x+k+" z"}function P(){var t=r.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return e("div",{id:"chart-instructions"},t)}function V(){return e("defs",null,e("filter",{id:"wmHoverDropShadow"},e("feGaussianBlur",{stdDeviation:"3"}),e("feOffset",{result:"offsetblur"}),e("feFlood",{"flood-color":"#333"}),e("feComposite",{operator:"in",in2:"offsetblur"}),e("feMerge",null,e("feMergeNode",null),e("feMergeNode",{in:"SourceGraphic"}))))}function L(t){var r=this;var a=this.chartDetails.size+this.chartDetails.padding;var n=t==="doughnut0"||t==="doughnut";var i=n?this.slicesDetails:I(this.slicesDetails,this.total);return e("div",{class:"chart-wrapper doughnut-wrapper"},e("svg",{width:a+"px",height:a+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},V(),i.map((function(e){return R.call(r,e,t)})),n?e("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},f(i[0].amount,this.total,true)+"%"):e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},i.map((function(t){return t.amount>0&&!t.inSmallCluster?W.call(r,t):""})))))}function R(t,r){var a=this;return e("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},e("path",{id:t.id,class:"segment doughnut-segment",fill:t.amount?t.color:"transparent",d:F.call(this,t.amount,t.offset,r),onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)},role:"img","aria-label":t.legend}))}function W(t){var r=p(t.offset+t.amount/2,this.total);var a=g(this.chartDetails.size/2,1.4,r-90),n=a.x,i=a.y;return e("text",{class:"value",x:n+"px",y:i+"px"},"".concat(t.perc>0?t.perc:"<1","%"))}function N(t){var r=this;var a=t==="bar1"||t==="bar";return e("div",{class:"chart-wrapper bar-wrapper"},a?e("div",{class:"single-perc"},f(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),e("div",{class:"inner-stacked-bar-wrapper ".concat(c(this.tempValueFormat))},!a?e("div",{class:"values"},this.slicesDetails.map((function(t,e){return r.renderBarText(t,e)}))):"",e("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(t,e){return G.call(r,t,e)}))),a?H.call(this):""))}function G(t,r){var a=this;var n=r!==this.slicesDetails.length-1;var i="calc(".concat(f(t.amount,this.total,false),"%").concat(n?" - 2px":"",")");return e("div",{class:"segment stacked-bar-segment ".concat(f(t.amount,this.total,false)===0?"zero":""),style:{backgroundColor:t.color,width:i},onClick:function(e){return E.call(a,e,t)},onFocus:function(e){return D.call(a,e,t)},onKeyDown:function(t){return k.call(a,t)}},e("span",{class:"sr-only"},t.legend))}function K(t){var r=this;var a=this.slicesDetails.map((function(t){return t.amount})).reduce((function(t,e){return t>e?t:e}));var n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var i=48;var s=this.el.getBoundingClientRect().width;var o=s-n-i;var l=w(o);var u=x(a,l);var h=l*u;var f=Math.floor((h-a)/u);l-=f;this.el.style.setProperty("--backgroundSize",100/l+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(t==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var p=[];this.slicesDetails.forEach((function(e){e.legend&&p.push(j(e.legend,r.showBarLegend,t));p.push(O.call(r,e,u,l,a))}));var v=[];for(var g=1;g<=l;g++){var m=d(g*u);v.push(e("div",{class:"tick"},e("span",null,m)))}var b=t==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return e("div",{class:"chart-wrapper simple-bar-wrapper"},e("div",{class:"chart ".concat(c(this.tempValueFormat))},b&&e("div",{class:"gridlines"}),e("div",{class:"rows"},p)),b&&e("div",{class:"x-axis","aria-hidden":"true"},e("div",{class:"zero"},e("span",null,"0")),v))}function j(t,r,a){var n=a==="bar7"&&!r?" hidden":"";return e("label",{class:"label".concat(n)},t)}function O(t,r,a,n){var i=this;var s=this.currentChartType==="bar6"?r*a:n;var o=f(t.amount,s,false);var l=o?o+"%":"1px";var c=d(t.amount);var u=this.tempValueFormat==="amount"?c:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){u=t.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){u=(this.total===0?"0":f(t.amount,this.total,true))+"%"}return e("div",{class:"bar segment",style:{backgroundColor:t.color,width:l},onClick:function(e){return E.call(i,e,t)},onFocus:function(e){return D.call(i,e,t)},onKeyDown:function(t){return k.call(i,t)}},e("div",{class:"value"},u))}function U(t){if(this.showLegend){var r=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(t,e){return t=e.inSmallCluster?true:t}),false);return e("div",{class:"legend-wrapper"},e("div",{class:"legend ".concat(t," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(t){if(!!t.amount||!!t.legend){return q({key:t.legend,color:t.color})}}))),r&&X())}}function q(t){return e("div",{class:"legend-item"},e("div",{class:"legend-color",style:{backgroundColor:t.color}}),e("div",{class:"legend-text"},t.key))}function H(){if(this.completionMessage){return e("div",{class:"completion-message"},this.completionMessage)}}function X(){return e("div",{class:"hidden-values-warning"},u,e("br",null),h)}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-c467a1e1.system.js","./p-d4ebbe84.system.js","./p-08b7ec08.system.js"],(function(t){"use strict";var e,i,o,n,s,r,a,c,l,d;return{setters:[function(t){e=t.r;i=t.c;o=t.h;n=t.H;s=t.g},function(t){r=t.q;a=t.g;c=t.o;l=t.y},function(t){d=t.g}],execute:function(){var m=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}: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}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";var u=t("wm_action_menu",function(){function t(t){e(this,t);this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7);this.menuLoaded=i(this,"menuLoaded",7);this.openUp=false;this.keysSoFar="";this.searchIndex=0;this.keyClear=null;this.isExpanded=false;this.tooltipPosition=undefined;this.actionMenuType=null;this.buttonType=null;this.buttonText=undefined;this.disabled=false;this.tooltip=undefined;this.labelForIdenticalButtons=undefined;this.darkMode=undefined}Object.defineProperty(t.prototype,"horizontalPosition",{get:function(){return!!this.el&&!!this.itemsEl&&r(this.el,this.itemsEl.clientWidth)?"right":"left"},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"childItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-menuitem"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"internalButtonType",{get:function(){return this.tempActionMenuType==="icon"||this.tempActionMenuType==="text"?this.tempActionMenuType+"only":this.tempActionMenuType},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tempActionMenuType",{get:function(){return this.actionMenuType||this.buttonType||"icon"},enumerable:false,configurable:true});t.prototype.handleClickedItem=function(){this.close()};t.prototype.handleKeyUp=function(t){this.moveUp(t.target)};t.prototype.handleKeyDown=function(t){this.moveDown(t.detail)};t.prototype.handleHomeKey=function(){this.focusFirstItem()};t.prototype.handleEndKey=function(){this.focusLastItem()};t.prototype.handleTabKey=function(){if(this.isExpanded){this.close()}};t.prototype.handleEscKey=function(){this.close();this.wmButtonEl.focus()};t.prototype.handleKey=function(t){var e=this;switch(t.key){case"ArrowDown":if(!this.isExpanded){t.preventDefault();this.open();window.requestAnimationFrame((function(){return e.focusFirstItem()}))}break;case"ArrowUp":if(!this.isExpanded){t.preventDefault();this.open();window.requestAnimationFrame((function(){return e.focusLastItem()}))}break}};t.prototype.handleMenuitemBlur=function(t){var e=t.detail.relatedTarget===this.el||this.el.contains(t.detail.relatedTarget);if(!e){var i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(i)}};t.prototype.handleButtonBlur=function(t){var e=t.relatedTarget===this.el||this.el.contains(t.relatedTarget);if(e){t.stopPropagation()}};t.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:a();if(this.buttonType){console.warn("wm-action-menu: button-type has been deprecated as of v3.1.0. Please use action-menu-type instead.")}};t.prototype.componentDidLoad=function(){if(this.tempActionMenuType!=="icon"&&!this.buttonText){console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'")}if(this.tempActionMenuType==="icon"&&!this.tooltip){console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'")}this.wmActionMenuLoaded.emit();this.menuLoaded.emit()};t.prototype.moveUp=function(t){var e=this.childItems.indexOf(t);if(e===0){this.focusLastItem()}else{this.focusItem(this.childItems[e-1])}};t.prototype.moveDown=function(t){var e=this.childItems.indexOf(t);if(e===this.childItems.length-1){this.focusFirstItem()}else{this.focusItem(this.childItems[e+1])}};t.prototype.open=function(){var t=this;if(!this.disabled){this.openUp=c(this.el,this.itemsEl.clientHeight);this.isExpanded=true;this.itemsEl.classList.remove("hidden");window.requestAnimationFrame((function(){return t.focusFirstItem()}))}};t.prototype.close=function(t){var e=this;if(t===void 0){t=true}this.isExpanded=false;this.childItems.forEach((function(t){return t.focused=false}));window.setTimeout((function(){e.itemsEl.classList.add("hidden")}),150);window.setTimeout((function(){if(t&&(document.activeElement.tagName==="BODY"||document.activeElement.tagName==="WM-MENUITEM")){e.wmButtonEl.focus()}}),250)};t.prototype.focusItem=function(t){this.childItems.map((function(e){return e.focused=e===t}));t.focus&&t.focus()};t.prototype.focusFirstItem=function(){this.focusItem(this.childItems[0])};t.prototype.focusLastItem=function(){this.focusItem(this.childItems[this.childItems.length-1])};t.prototype.findAndFocusItem=function(t){var e=t.detail.toUpperCase();this.focusFirstItem();if(!this.keysSoFar){for(var i=0;i<this.childItems.length;i++){if(this.childItems[i]===document.activeElement){this.searchIndex=i}}}this.keysSoFar+=e;this.clearKeysSoFarAfterDelay();var o=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);if(!o){o=this.findMatchInRange(this.childItems,0,this.searchIndex)}if(o){this.focusItem(o)}};t.prototype.clearKeysSoFarAfterDelay=function(){if(this.keyClear){window.clearTimeout(this.keyClear);this.keyClear=null}this.keyClear=window.setTimeout(function(){this.keysSoFar="";this.keyClear=null}.bind(this),500)};t.prototype.findMatchInRange=function(t,e,i){for(var o=e;o<i;o++){var n=t[o].innerText;if(n&&n.toUpperCase().indexOf(this.keysSoFar)===0){return t[o]}}return null};t.prototype.render=function(){var t=this;return o(n,{onBlur:function(){return t.close(false)}},o("div",{class:l()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":undefined,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:this.tempActionMenuType==="icon"?"f1d9":"",iconSize:this.tempActionMenuType==="icon"?"24px":undefined,id:"menubtn-".concat(this.uid),onClick:function(){return t.isExpanded?t.close():t.open()},onBlur:function(e){return t.handleButtonBlur(e)},disabled:this.disabled,ref:function(e){return t.wmButtonEl=e},"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":"menu-".concat(this.uid)},this.buttonText),o("div",{class:"dropdown ".concat(this.openUp?"open-up":""," ").concat(this.horizontalPosition," ").concat(this.isExpanded?"open":""," hidden"),id:"menu-".concat(this.uid),tabindex:-1,role:"menu",ref:function(e){return t.itemsEl=e}},o("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());u.style=m;var h=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:focus,:host .wrapper.focus{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper[aria-disabled=true]{font-style:italic;color:var(--wmcolor-actionmenu-text-disabled)}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus){outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}';var p=t("wm_menuitem",function(){function t(t){e(this,t);this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7);this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7);this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7);this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7);this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7);this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7);this.wmPageDownItems=i(this,"wmPageDownItems",7);this.wmPageUpItems=i(this,"wmPageUpItems",7);this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7);this.wmLetterPressed=i(this,"wmLetterPressed",7);this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7);this.descriptionCharLimit=100;this.disabled=false;this.focused=false;this.icon=undefined;this.description=undefined;this.isKeying=false}t.prototype.toggleKeyingOn=function(){this.isKeying=true};t.prototype.toggleKeyingOff=function(){this.isKeying=false};t.prototype.handleKeydown=function(t){var e=t.altKey||t.ctrlKey||t.metaKey;var i=/^.$/.test(t.key);var o=i&&!e;switch(t.key){case"ArrowUp":t.preventDefault();this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault();this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault();if(!this.disabled){this.el.click()}break;case"Escape":t.preventDefault();t.stopPropagation();this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault();this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault();this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:if(o){t.preventDefault();this.wmLetterPressed.emit(t.key)}}};t.prototype.handleClick=function(){if(!this.disabled){this.wmMenuitemClicked.emit()}};t.prototype.handleBlur=function(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})};t.prototype.setOnClick=function(){if(this.disabled&&this.el.onclick){this.onClickFunc=this.el.onclick;this.el.onclick=null}else if(!this.disabled&&this.onClickFunc){this.el.onclick=this.onClickFunc}};t.prototype.componentWillLoad=function(){if(this.icon){this.icon=d(this.icon)}if(this.description){if(this.description.length>this.descriptionCharLimit){console.error("wm-menuitem description is above the character limit of ".concat(this.descriptionCharLimit))}if(this.icon){console.error("wm-menuitems with descriptions do not support the use of icons")}}this.setOnClick()};t.prototype.componentDidLoad=function(){if(this.icon){this.iconEl.classList.add("mdi");this.iconEl.innerHTML="&#x".concat(this.icon,";")}};t.prototype.render=function(){var t=this;return o(n,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper ".concat(this.focused&&this.isKeying?"focus":""),"aria-disabled":this.disabled?"true":null},o("span",{ref:function(e){return t.iconEl=e}}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["setOnClick"]}},enumerable:false,configurable:true});return t}());p.style=h}}}));
|
|
1
|
+
System.register(["./p-c467a1e1.system.js","./p-7eb9bac9.system.js","./p-08b7ec08.system.js"],(function(t){"use strict";var e,i,o,n,s,r,a,c,l,d;return{setters:[function(t){e=t.r;i=t.c;o=t.h;n=t.H;s=t.g},function(t){r=t.q;a=t.g;c=t.o;l=t.y},function(t){d=t.g}],execute:function(){var m=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}: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}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";var u=t("wm_action_menu",function(){function t(t){e(this,t);this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7);this.menuLoaded=i(this,"menuLoaded",7);this.openUp=false;this.keysSoFar="";this.searchIndex=0;this.keyClear=null;this.isExpanded=false;this.tooltipPosition=undefined;this.actionMenuType=null;this.buttonType=null;this.buttonText=undefined;this.disabled=false;this.tooltip=undefined;this.labelForIdenticalButtons=undefined;this.darkMode=undefined}Object.defineProperty(t.prototype,"horizontalPosition",{get:function(){return!!this.el&&!!this.itemsEl&&r(this.el,this.itemsEl.clientWidth)?"right":"left"},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"childItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-menuitem"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"internalButtonType",{get:function(){return this.tempActionMenuType==="icon"||this.tempActionMenuType==="text"?this.tempActionMenuType+"only":this.tempActionMenuType},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tempActionMenuType",{get:function(){return this.actionMenuType||this.buttonType||"icon"},enumerable:false,configurable:true});t.prototype.handleClickedItem=function(){this.close()};t.prototype.handleKeyUp=function(t){this.moveUp(t.target)};t.prototype.handleKeyDown=function(t){this.moveDown(t.detail)};t.prototype.handleHomeKey=function(){this.focusFirstItem()};t.prototype.handleEndKey=function(){this.focusLastItem()};t.prototype.handleTabKey=function(){if(this.isExpanded){this.close()}};t.prototype.handleEscKey=function(){this.close();this.wmButtonEl.focus()};t.prototype.handleKey=function(t){var e=this;switch(t.key){case"ArrowDown":if(!this.isExpanded){t.preventDefault();this.open();window.requestAnimationFrame((function(){return e.focusFirstItem()}))}break;case"ArrowUp":if(!this.isExpanded){t.preventDefault();this.open();window.requestAnimationFrame((function(){return e.focusLastItem()}))}break}};t.prototype.handleMenuitemBlur=function(t){var e=t.detail.relatedTarget===this.el||this.el.contains(t.detail.relatedTarget);if(!e){var i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(i)}};t.prototype.handleButtonBlur=function(t){var e=t.relatedTarget===this.el||this.el.contains(t.relatedTarget);if(e){t.stopPropagation()}};t.prototype.componentWillLoad=function(){this.uid=this.el.id?this.el.id:a();if(this.buttonType){console.warn("wm-action-menu: button-type has been deprecated as of v3.1.0. Please use action-menu-type instead.")}};t.prototype.componentDidLoad=function(){if(this.tempActionMenuType!=="icon"&&!this.buttonText){console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'")}if(this.tempActionMenuType==="icon"&&!this.tooltip){console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'")}this.wmActionMenuLoaded.emit();this.menuLoaded.emit()};t.prototype.moveUp=function(t){var e=this.childItems.indexOf(t);if(e===0){this.focusLastItem()}else{this.focusItem(this.childItems[e-1])}};t.prototype.moveDown=function(t){var e=this.childItems.indexOf(t);if(e===this.childItems.length-1){this.focusFirstItem()}else{this.focusItem(this.childItems[e+1])}};t.prototype.open=function(){var t=this;if(!this.disabled){this.openUp=c(this.el,this.itemsEl.clientHeight);this.isExpanded=true;this.itemsEl.classList.remove("hidden");window.requestAnimationFrame((function(){return t.focusFirstItem()}))}};t.prototype.close=function(t){var e=this;if(t===void 0){t=true}this.isExpanded=false;this.childItems.forEach((function(t){return t.focused=false}));window.setTimeout((function(){e.itemsEl.classList.add("hidden")}),150);window.setTimeout((function(){if(t&&(document.activeElement.tagName==="BODY"||document.activeElement.tagName==="WM-MENUITEM")){e.wmButtonEl.focus()}}),250)};t.prototype.focusItem=function(t){this.childItems.map((function(e){return e.focused=e===t}));t.focus&&t.focus()};t.prototype.focusFirstItem=function(){this.focusItem(this.childItems[0])};t.prototype.focusLastItem=function(){this.focusItem(this.childItems[this.childItems.length-1])};t.prototype.findAndFocusItem=function(t){var e=t.detail.toUpperCase();this.focusFirstItem();if(!this.keysSoFar){for(var i=0;i<this.childItems.length;i++){if(this.childItems[i]===document.activeElement){this.searchIndex=i}}}this.keysSoFar+=e;this.clearKeysSoFarAfterDelay();var o=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);if(!o){o=this.findMatchInRange(this.childItems,0,this.searchIndex)}if(o){this.focusItem(o)}};t.prototype.clearKeysSoFarAfterDelay=function(){if(this.keyClear){window.clearTimeout(this.keyClear);this.keyClear=null}this.keyClear=window.setTimeout(function(){this.keysSoFar="";this.keyClear=null}.bind(this),500)};t.prototype.findMatchInRange=function(t,e,i){for(var o=e;o<i;o++){var n=t[o].innerText;if(n&&n.toUpperCase().indexOf(this.keysSoFar)===0){return t[o]}}return null};t.prototype.render=function(){var t=this;return o(n,{onBlur:function(){return t.close(false)}},o("div",{class:l()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":undefined,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:this.tempActionMenuType==="icon"?"f1d9":"",iconSize:this.tempActionMenuType==="icon"?"24px":undefined,id:"menubtn-".concat(this.uid),onClick:function(){return t.isExpanded?t.close():t.open()},onBlur:function(e){return t.handleButtonBlur(e)},disabled:this.disabled,ref:function(e){return t.wmButtonEl=e},"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":"menu-".concat(this.uid)},this.buttonText),o("div",{class:"dropdown ".concat(this.openUp?"open-up":""," ").concat(this.horizontalPosition," ").concat(this.isExpanded?"open":""," hidden"),id:"menu-".concat(this.uid),tabindex:-1,role:"menu",ref:function(e){return t.itemsEl=e}},o("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());u.style=m;var h=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:focus,:host .wrapper.focus{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper[aria-disabled=true]{font-style:italic;color:var(--wmcolor-actionmenu-text-disabled)}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus){outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}';var p=t("wm_menuitem",function(){function t(t){e(this,t);this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7);this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7);this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7);this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7);this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7);this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7);this.wmPageDownItems=i(this,"wmPageDownItems",7);this.wmPageUpItems=i(this,"wmPageUpItems",7);this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7);this.wmLetterPressed=i(this,"wmLetterPressed",7);this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7);this.descriptionCharLimit=100;this.disabled=false;this.focused=false;this.icon=undefined;this.description=undefined;this.isKeying=false}t.prototype.toggleKeyingOn=function(){this.isKeying=true};t.prototype.toggleKeyingOff=function(){this.isKeying=false};t.prototype.handleKeydown=function(t){var e=t.altKey||t.ctrlKey||t.metaKey;var i=/^.$/.test(t.key);var o=i&&!e;switch(t.key){case"ArrowUp":t.preventDefault();this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault();this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault();if(!this.disabled){this.el.click()}break;case"Escape":t.preventDefault();t.stopPropagation();this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault();this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault();this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:if(o){t.preventDefault();this.wmLetterPressed.emit(t.key)}}};t.prototype.handleClick=function(){if(!this.disabled){this.wmMenuitemClicked.emit()}};t.prototype.handleBlur=function(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})};t.prototype.setOnClick=function(){if(this.disabled&&this.el.onclick){this.onClickFunc=this.el.onclick;this.el.onclick=null}else if(!this.disabled&&this.onClickFunc){this.el.onclick=this.onClickFunc}};t.prototype.componentWillLoad=function(){if(this.icon){this.icon=d(this.icon)}if(this.description){if(this.description.length>this.descriptionCharLimit){console.error("wm-menuitem description is above the character limit of ".concat(this.descriptionCharLimit))}if(this.icon){console.error("wm-menuitems with descriptions do not support the use of icons")}}this.setOnClick()};t.prototype.componentDidLoad=function(){if(this.icon){this.iconEl.classList.add("mdi");this.iconEl.innerHTML="&#x".concat(this.icon,";")}};t.prototype.render=function(){var t=this;return o(n,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper ".concat(this.focused&&this.isKeying?"focus":""),"aria-disabled":this.disabled?"true":null},o("span",{ref:function(e){return t.iconEl=e}}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["setOnClick"]}},enumerable:false,configurable:true});return t}());p.style=h}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"./p-11b416c7.js";import{i as s,c as i,e,f as n,d as a}from"./p-20495238.js";const o="#ff5f4e",r="#19a1a9",h="#088000",c="#2e1b46",d="#8b86ca",l="#575195",u="#6b6b6b",g={doughnut:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[d,c,u],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[l,r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar1:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar2:{size:400,colors:[u,l,r,o],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[u,l,c,r,o],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",o],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o,r,l],padding:0,category:"stackedBar"},bar5:{size:400,colors:[u,d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[d],padding:0,category:"simpleBar"},bar7:{size:400,colors:[l,r,o,u],padding:0,category:"simpleBar"}};function p(t){return"percentage"===t||"amount"===t?"show-values":""}const f=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),b=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function m(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function v(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function w(t,s){return 360*t/s}function y(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function k(t,s,i,e){var n=y(t+t*s*Math.cos(Math.PI*i/180)),a=y(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:y(t+t*s*Math.cos(Math.PI*e/180)),y2:y(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function x(t,s,i,e,n){var a=y(n/2*t);return`A ${a}, ${a} 0 ${s} ${y(i)}, ${y(e)}`}function $(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}function M(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},D.call(this,s))}function B(t,s){this.popoverEl&&this.isTabbing&&(s.coords=e(t.target),D.call(this,s))}function C(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,F.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,A.call(this);break;case"Tab":T.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function D(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=n(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function A(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function F(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function T(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function K(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=v(n,this.total,!0);let o=e;"bar5"===t&&(o=this.notStartedColor?e:e+1),"bar6"===t&&(o=0);const r=g[t].colors[o],h={amount:n,perc:a,legend:i.getAttribute("legend"),color:r||u,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(h)}))}function j(t,s,i){const e=w(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=k(h,1,e+1.5,a),u=k(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+x(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+x(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function I(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function W(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=v(i[0===n?i.length-1:n-1].amount,s,!0),r=v(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>E.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},v(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?G.call(this,t):"")))))}function E(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:j.call(this,s.amount,s.offset,i),onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t),role:"img","aria-label":s.legend}))}function G(s){const i=w(s.offset+s.amount/2,this.total);let{x:e,y:n}=k(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function L(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},v(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${p(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>N.call(this,t,s)))),i?O.call(this):""))}function N(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${v(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===v(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("span",{class:"sr-only"},s.legend))}function R(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=$(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(U.call(this,e,o,n,i))}));const c=[];for(let s=1;s<=n;s++){const i=m(s*o);c.push(t("div",{class:"tick"},t("span",null,i)))}const d="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${p(this.tempValueFormat)}`},d&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),d&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function U(s,i,e,n){const a=v(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=m(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=(0===this.total?"0":v(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("div",{class:"value"},h))}function V(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{if(t.amount||t.legend)return H({key:t.legend,color:t.color})}))),i&&q())}}function H(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function O(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function q(){return t("div",{class:"hidden-values-warning"},f,t("br",null),b)}export{g as a,v as b,L as c,W as d,I as e,V as f,K as g,C as h,O as i,q as j,T as k,H as l,m,$ as n,R as r}
|
|
1
|
+
import{h as t}from"./p-11b416c7.js";import{i as s,c as i,e,f as n,d as a}from"./p-af1d2a68.js";const o="#ff5f4e",r="#19a1a9",h="#088000",c="#2e1b46",d="#8b86ca",l="#575195",u="#6b6b6b",g={doughnut:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[d,c,u],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[l,r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar1:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar2:{size:400,colors:[u,l,r,o],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[u,l,c,r,o],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",o],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o,r,l],padding:0,category:"stackedBar"},bar5:{size:400,colors:[u,d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[d],padding:0,category:"simpleBar"},bar7:{size:400,colors:[l,r,o,u],padding:0,category:"simpleBar"}};function p(t){return"percentage"===t||"amount"===t?"show-values":""}const f=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),b=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function m(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function v(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function w(t,s){return 360*t/s}function y(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function k(t,s,i,e){var n=y(t+t*s*Math.cos(Math.PI*i/180)),a=y(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:y(t+t*s*Math.cos(Math.PI*e/180)),y2:y(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function x(t,s,i,e,n){var a=y(n/2*t);return`A ${a}, ${a} 0 ${s} ${y(i)}, ${y(e)}`}function $(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}function M(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},D.call(this,s))}function B(t,s){this.popoverEl&&this.isTabbing&&(s.coords=e(t.target),D.call(this,s))}function C(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,F.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,A.call(this);break;case"Tab":T.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function D(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=n(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function A(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function F(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function T(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function K(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=v(n,this.total,!0);let o=e;"bar5"===t&&(o=this.notStartedColor?e:e+1),"bar6"===t&&(o=0);const r=g[t].colors[o],h={amount:n,perc:a,legend:i.getAttribute("legend"),color:r||u,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(h)}))}function j(t,s,i){const e=w(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=k(h,1,e+1.5,a),u=k(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+x(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+x(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function I(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function W(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=v(i[0===n?i.length-1:n-1].amount,s,!0),r=v(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>E.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},v(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?G.call(this,t):"")))))}function E(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:j.call(this,s.amount,s.offset,i),onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t),role:"img","aria-label":s.legend}))}function G(s){const i=w(s.offset+s.amount/2,this.total);let{x:e,y:n}=k(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function L(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},v(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${p(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>N.call(this,t,s)))),i?O.call(this):""))}function N(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${v(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===v(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("span",{class:"sr-only"},s.legend))}function R(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=$(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(U.call(this,e,o,n,i))}));const c=[];for(let s=1;s<=n;s++){const i=m(s*o);c.push(t("div",{class:"tick"},t("span",null,i)))}const d="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${p(this.tempValueFormat)}`},d&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),d&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function U(s,i,e,n){const a=v(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=m(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=(0===this.total?"0":v(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("div",{class:"value"},h))}function V(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{if(t.amount||t.legend)return H({key:t.legend,color:t.color})}))),i&&q())}}function H(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function O(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function q(){return t("div",{class:"hidden-values-warning"},f,t("br",null),b)}export{g as a,v as b,L as c,W as d,I as e,V as f,K as g,C as h,O as i,q as j,T as k,H as l,m,$ as n,R as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as a,f as n}from"./p-11b416c7.js";import{i as s,z as r,h as c,s as l}from"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as a,f as n}from"./p-11b416c7.js";import{i as s,z as r,h as c,s as l}from"./p-af1d2a68.js";import{g as h}from"./p-1eb5a93a.js";const g=class{constructor(o){t(this,o),this.wmNavigationStateChanged=i(this,"wmNavigationStateChanged",7),this.mainNavigationMessage=s.formatMessage({id:"navigation.mainNavigation",defaultMessage:"Main",description:"Label describing the site navigation, for screen reader users"}),this.throttledRerender=r((()=>n(this.el)),50),this.open=!1,this.isTabbing=!1}get isCollapsible(){return window.innerWidth<1024}get ariaExpanded(){return this.isCollapsible?this.open.toString():void 0}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}closeOnEscape(t){"Escape"===t.key&&(this.open=!1)}handleWindowResize(){this.throttledRerender()}handleHamburgerClicked(){this.open=!this.open}handleClickOnItem(){this.open=!1}handleStateChange(){this.isCollapsible&&(this.wmNavigationStateChanged.emit(),this.open?this.expand():this.collapse())}componentWillLoad(){document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.el.focus=()=>{const t=this.open?this.el.shadowRoot.querySelector(".toggle"):document.querySelector("wm-navigation-hamburger"),i=this.el.querySelector("wm-navigation-item");this.isCollapsible?t.focus():i.focus()},this.isCollapsible&&this.open&&(this.wmNavigationStateChanged.emit(),this.expand())}redirectFocusFromBody(t){"BODY"!==document.activeElement.tagName||t.relatedTarget||this.el.focus()}expand(){document.body.tabIndex=0,document.body.addEventListener("focus",this.redirectFocusFromBody.bind(this),!0),setTimeout((()=>this.toggleEl.focus()),250)}collapse(){document.body.tabIndex=-1,document.body.removeEventListener("focus",this.redirectFocusFromBody.bind(this));const t=document.querySelector("wm-navigation-hamburger");t&&t.focus()}focusLastItem(){const t=this.el.querySelectorAll("wm-navigation-item");Array.from(t).pop().focus()}renderOverlay(){return o("div",{class:"overlay",onClick:()=>{this.open=!1}})}render(){return o(e,{role:"navigation","aria-expanded":this.ariaExpanded,"aria-label":this.mainNavigationMessage},this.open?this.renderOverlay():"",this.isCollapsible&&o("div",{class:"trapfocus",tabindex:this.open?0:void 0,onFocus:()=>this.focusLastItem()}),o("div",{class:"tray"},o("div",{class:"toggle-wrapper"},o("wm-button",{ref:t=>this.toggleEl=t,class:"toggle "+(this.isTabbing?"user-is-tabbing":""),"button-type":"navigational",icon:this.open?"f156":"f35c","icon-size":"2rem",tooltip:this.open?h.close:h.open,"tooltip-position":"right",tabIndex:this.open?void 0:-1,onClick:()=>{this.open=!this.open}})),o("ul",{class:"navlist"},o("slot",null))),this.isCollapsible&&o("div",{class:"trapfocus",tabindex:this.open?0:void 0,onFocus:()=>this.toggleEl.focus()}))}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{open:["handleStateChange"]}}};g.style=":host{--wmcolor-navigation-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-background-selected:var(--wmcolor-background-selected);--wmcolor-navigation-background:var(--wmcolor-background);--wmcolor-navigation-border-selected:var(--wmcolor-interactive);--wmcolor-navigation-focus:var(--wmcolor-interactive-focus);--wmcolor-navigation-icon-selected:var(--wmcolor-interactive);--wmcolor-navigation-icon:var(--wmcolor-text);--wmcolor-navigation-text-selected:var(--wmcolor-interactive);z-index:10}:host([aria-expanded=true]){z-index:5000}.tray{-webkit-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);-moz-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:7.5625rem;background-color:var(--wmcolor-navigation-background);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:0.875rem;height:100%}.navlist{margin:0;padding:0}.toggle-wrapper{display:none}@media screen and (max-width: 1023px){.tray{-ms-transition:transform 0.33s ease;-webkit-transition:transform 0.33s ease;-moz-transition:transform 0.33s ease;-webkit-transition:-webkit-transform 0.33s ease;transition:-webkit-transform 0.33s ease;transition:transform 0.33s ease;transition:transform 0.33s ease, -webkit-transform 0.33s ease;position:fixed;top:0;bottom:0;left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.tray ul{visibility:hidden}.tray .toggle-wrapper{display:inline-block;min-height:5rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([aria-expanded=true]) .tray{-webkit-transform:translateX(0);transform:translateX(0)}:host([aria-expanded=true]) .tray ul{visibility:visible}.overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:0;bottom:0;left:0;right:0;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-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}}";const d=class{constructor(o){t(this,o),this.wmNavigationHamburgerClicked=i(this,"wmNavigationHamburgerClicked",7),this.showNavMessage=s.formatMessage({id:"navigation.showNavigation",defaultMessage:"Show navigation",description:"For user interface element opening a navigation menu"}),this.navId=void 0,this.isTabbing=!1,this.open=!1}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleNavigationStateChanged(t){this.open=t.target.open}componentWillLoad(){document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.navId||console.error("wm-navigation-hamburger: nav-id is a required prop")}handleClick(){c(),this.wmNavigationHamburgerClicked.emit()}render(){return o(e,{class:"hamburger "+(this.open?"nav-open":"nav-closed")},o("button",{class:this.isTabbing?"user-is-tabbing":void 0,"aria-expanded":this.open,"aria-controls":this.navId,"aria-label":this.showNavMessage,onMouseEnter:()=>l("right",this.el,this.showNavMessage),onMouseLeave:()=>c(),onFocus:()=>this.isTabbing&&l("right",this.el,this.showNavMessage),onBlur:()=>c(),onClick:()=>this.handleClick()},o("span",{class:"icon"})))}static get delegatesFocus(){return!0}get el(){return a(this)}};d.style='button{--wmcolor-navigation-hamburger-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-hamburger-icon:var(--wmcolor-interactive);display:none;width:100%;height:100%;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);background-color:transparent;outline:none;padding:0}button.user-is-tabbing:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}button.user-is-tabbing:focus::-moz-focus-inner{border:0}button:hover{background-color:var(--wmcolor-navigation-hamburger-background-hover)}.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:"\\f35c";font-size:1.5rem;color:var(--wmcolor-navigation-hamburger-icon)}@media screen and (max-width: 1023px){:host{width:3.75rem;height:3.75rem}button{display:initial}}';const m=class{constructor(o){t(this,o),this.wmNavigationItemClicked=i(this,"wmNavigationItemClicked",7),this.href=void 0,this.text=void 0,this.active=void 0,this.isTabbing=!1}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}componentWillLoad(){document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn()}render(){return o(e,{role:"listitem"},o("a",{class:`link ${this.active?"active":""} ${this.isTabbing?"user-is-tabbing":""}`,href:this.href,onClick:()=>this.wmNavigationItemClicked.emit()},o("div",{class:"icon","aria-hidden":"true"},o("slot",null)),o("div",{class:"text"},this.text)))}static get delegatesFocus(){return!0}get el(){return a(this)}};m.style='.link{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:inherit;text-decoration:none;min-height:4.5rem;text-align:center;padding:1.25rem 0.5rem;font-weight:500;outline:none;position:relative;background:var(--wmcolor-navigation-background)}.link:hover{background-color:var(--wmcolor-navigation-background-hover)}.link .icon{font-size:1.375rem;color:var(--wmcolor-navigation-icon)}.link .text{font-size:0.875rem}.link.user-is-tabbing:focus{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-navigation-focus);box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-navigation-focus)}.link.active{background-color:var(--wmcolor-navigation-background-selected)}.link.active:before{content:"";background-color:var(--wmcolor-navigation-border-selected);position:absolute;height:100%;width:5px;left:0}.link.active .text{color:var(--wmcolor-navigation-text-selected)}.link.active .icon{color:var(--wmcolor-navigation-icon-selected)}';export{g as wm_navigation,d as wm_navigation_hamburger,m as wm_navigation_item}
|