@xplortech/apollo-core 1.0.0-beta.16 → 1.0.0-beta.18
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/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/{p-244918b6.entry.js → p-6797b2b7.entry.js} +2 -2
- package/dist/apollo-core/p-6797b2b7.entry.js.map +1 -0
- package/dist/apollo-core/p-da5a8e74.entry.js +2 -0
- package/dist/apollo-core/p-da5a8e74.entry.js.map +1 -0
- package/dist/cjs/xpl-avatar_15.cjs.entry.js +9 -10
- package/dist/cjs/xpl-avatar_15.cjs.entry.js.map +1 -1
- package/dist/cjs/xpl-select.cjs.entry.js +14 -6
- package/dist/cjs/xpl-select.cjs.entry.js.map +1 -1
- package/dist/collection/components/xpl-select/xpl-select.js +16 -6
- package/dist/collection/components/xpl-select/xpl-select.js.map +1 -1
- package/dist/collection/components/xpl-table/xpl-table.js +9 -10
- package/dist/collection/components/xpl-table/xpl-table.js.map +1 -1
- package/dist/components/xpl-select.js +14 -6
- package/dist/components/xpl-select.js.map +1 -1
- package/dist/components/xpl-table.js +9 -10
- package/dist/components/xpl-table.js.map +1 -1
- package/dist/esm/xpl-avatar_15.entry.js +9 -10
- package/dist/esm/xpl-avatar_15.entry.js.map +1 -1
- package/dist/esm/xpl-select.entry.js +14 -6
- package/dist/esm/xpl-select.entry.js.map +1 -1
- package/dist/types/components/xpl-select/xpl-select.d.ts +5 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +0 -1
- package/package.json +1 -1
- package/dist/apollo-core/p-244918b6.entry.js.map +0 -1
- package/dist/apollo-core/p-db29ebe0.entry.js +0 -2
- package/dist/apollo-core/p-db29ebe0.entry.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-e8953b60.js";export{s as setNonce}from"./p-e8953b60.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-e8953b60.js";export{s as setNonce}from"./p-e8953b60.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a([["p-da5a8e74",[[0,"xpl-select",{choices:[16],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],selectedValues:[1,"selected-values"],active:[32],id:[32],keepFocus:[32],selected:[32],value:[32],displayValue:[32],visibleChoices:[32]}]]],["p-5372bf3e",[[4,"xpl-application-shell",{withSubnav:[4,"with-subnav"],withUtility:[4,"with-utility"],navWidth:[1,"nav-width"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],navOpen:[32]},[[0,"navOpen","navToggleHandler"],[0,"navWidth","navWithHandler"],[9,"resize","onWindowResize"]]]]],["p-6797b2b7",[[4,"xpl-data-card",{link:[4],name:[1],stat:[1],shortStat:[1,"short-stat"],variant:[1],icon:[1]}],[4,"xpl-utility-bar",{navControl:[4,"nav-control"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],open:[32]}],[4,"xpl-breadcrumb-item"],[4,"xpl-breadcrumbs"],[4,"xpl-content-area",{size:[1]}],[4,"xpl-dashboard"],[4,"xpl-nav-item",{navControl:[4,"nav-control"]}],[4,"xpl-secondary-nav"],[0,"xpl-table",{columns:[16],data:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16],areAllSelected:[32],rowData:[32],hasScrolled:[32],selected:[32]}],[4,"xpl-avatar",{color:[1],disabled:[4],href:[1],name:[1],size:[1],src:[1],status:[1],target:[1]}],[4,"xpl-badge",{dot:[4],variant:[1]}],[4,"xpl-button",{disabled:[4],link:[4],iconOnly:[4,"icon-only"],fullWidth:[4,"full-width"],name:[1],size:[1],type:[1],value:[1],variant:[1],state:[1]}],[4,"xpl-checkbox",{checked:[4],description:[1],disabled:[4],indeterminate:[4],name:[1],required:[4],styled:[4],value:[1],id:[32]}],[4,"xpl-radio",{checked:[4],description:[1],disabled:[4],name:[1],required:[4],styled:[4],value:[1],id:[32]}],[0,"xpl-icon",{icon:[1],size:[2],backgroundColor:[1,"background-color"]}]]],["p-60d4d252",[[0,"xpl-list",{items:[16]}]]],["p-29f4679d",[[0,"xpl-choicelist",{choices:[16],description:[1],heading:[1],multi:[4],name:[1],styled:[4],selected:[32]}]]],["p-e215fc5f",[[0,"xpl-button-row",{primary:[1],secondary:[1],tertiary:[1]}]]],["p-bcb81e30",[[0,"xpl-input",{_id:[1],autocomplete:[1],dateFormat:[1,"date-format"],description:[1],disabled:[4],error:[1],label:[1],max:[8],maxCharacterCount:[2,"max-character-count"],min:[8],mode:[1],multiline:[4],name:[1],placeholder:[1],post:[1],pre:[1],readonly:[4],required:[4],step:[2],type:[1],value:[1],characterCount:[32],passwordVisible:[32]}]]],["p-807d8de9",[[4,"xpl-divider",{tier:[2]}]]],["p-efa8a79d",[[0,"xpl-grid"]]],["p-1fa46bc3",[[4,"xpl-grid-item",{xs:[2],sm:[2],md:[2],lg:[2]}]]],["p-3f3cc34e",[[4,"xpl-main-nav",{width:[1]}]]],["p-7a8e818a",[[0,"xpl-pagination",{total:[2],perPage:[2,"per-page"],waitForCallback:[4,"wait-for-callback"],current:[32],goto:[64]}]]],["p-5ceaec87",[[0,"xpl-toggle",{checked:[4],description:[1],disabled:[4],heading:[1],label:[1],name:[1],variant:[1],id:[32]}]]],["p-e0541e23",[[0,"xpl-backdrop",{relative:[4]}]]],["p-6acc4122",[[4,"xpl-dropdown-group",{groupName:[1,"label"],options:[16]}],[4,"xpl-dropdown-heading",{label:[1]}],[4,"xpl-dropdown-option",{isDisabled:[516,"disabled"],label:[1],value:[1],isSelected:[4,"selected"]}]]],["p-787bac91",[[4,"xpl-dropdown",{isOpen:[1540,"open"],closeOnSelect:[4,"close-on-select"],mode:[1],options:[16],selectOnFocus:[4,"select-on-focus"],triggerId:[1,"trigger-id"],update:[16],handleSelect:[64]}],[4,"xpl-tag"]]]],e)));
|
|
2
2
|
//# sourceMappingURL=apollo-core.esm.js.map
|
|
@@ -3,5 +3,5 @@ import{r as a,h as t,H as l,g as e,c as h}from"./p-e8953b60.js";import{v as r}fr
|
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
|
-
*/var La=Object.getOwnPropertySymbols;var Va=Object.prototype.hasOwnProperty;var xa=Object.prototype.propertyIsEnumerable;function Aa(a){if(a===null||a===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(a)}function _a(){try{if(!Object.assign){return false}var a=new String("abc");a[5]="de";if(Object.getOwnPropertyNames(a)[0]==="5"){return false}var t={};for(var l=0;l<10;l++){t["_"+String.fromCharCode(l)]=l}var e=Object.getOwnPropertyNames(t).map((function(a){return t[a]}));if(e.join("")!=="0123456789"){return false}var h={};"abcdefghijklmnopqrst".split("").forEach((function(a){h[a]=a}));if(Object.keys(Object.assign({},h)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(a){return false}}var ja=_a()?Object.assign:function(a,t){var l;var e=Aa(a);var h;for(var r=1;r<arguments.length;r++){l=Object(arguments[r]);for(var i in l){if(Va.call(l,i)){e[i]=l[i]}}if(La){h=La(l);for(var o=0;o<h.length;o++){if(xa.call(l,h[o])){e[h[o]]=l[h[o]]}}}}return e};const $a=16;for(const a of Object.keys(Ha)){const t=(t,l,e)=>{const h=[];const r=ja({},l,e);if(e){if(e["width"]||e["height"]){r["width"]=e["width"]?e["width"]:parseInt(e["height"])*l["width"]/l["height"];r["height"]=e["height"]?e["height"]:parseInt(e["width"])*l["height"]/l["width"]}if(e["class"]){r["class"]=`octicon octicon-${a} ${e["class"]}`;r["class"].trim()}if(e["aria-label"]){r["aria-label"]=e["aria-label"];r["role"]="img";delete r["aria-hidden"]}}for(const a of Object.keys(r)){h.push(`${a}="${r[a]}"`)}return h.join(" ").trim()};Ha[a].symbol=a;for(const t of Object.keys(Ha[a].heights)){Ha[a].heights[t].options={version:"1.1",width:Ha[a].heights[t].width,height:parseInt(t),viewBox:`0 0 ${Ha[a].heights[t].width} ${t}`,class:`octicon octicon-${a}`,"aria-hidden":"true"}}Ha[a].toSVG=function(l={}){const{height:e,width:h}=l;const r=Sa(Object.keys(Ha[a].heights),e||h||$a);return`<svg ${t(Ha[a],Ha[a].heights[r].options,l)}>${Ha[a].heights[r].path}</svg>`}}var Oa=Ha;function Sa(a,t){return a.map((a=>parseInt(a,10))).reduce(((a,l)=>l<=t?l:a),a[0])}const Ta=".xpl-icon{align-items:center;display:grid;justify-content:center}";const qa=class{constructor(t){a(this,t);this.icon=undefined;this.size=undefined;this.backgroundColor=undefined}render(){let a={};if(typeof this.size==="number")a={width:this.size,height:this.size};let e="xpl-icon__wrapper ";if(!!this.backgroundColor)e+=`xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`;return t(l,null,t("figure",{class:e},t("span",{"aria-label":this.icon,role:"img",class:"xpl-icon",style:{width:`${this.size}px`,height:`${this.size}px`},innerHTML:Oa[this.icon].toSVG(a)}),t("figcaption",null,this.icon," icon")))}};qa.style=Ta;const Ia=class{constructor(t){a(this,t);this.navOpen=h(this,"navOpen",7);this.navControl=false}onNavToggle(){if(window.innerWidth<=640){this.navOpen.emit(false)}}render(){return t(l,{class:"xpl-nav-item",role:"listitem",onClick:()=>{if(this.navControl){this.onNavToggle()}}},t("slot",{name:"link"},t("slot",{name:"icon"}),t("slot",null)))}};const Da=class{constructor(t){a(this,t);this.radioChange=h(this,"radioChange",7);this.checked=undefined;this.description=undefined;this.disabled=undefined;this.name=undefined;this.required=undefined;this.styled=undefined;this.value=undefined;this.id=r()}render(){return t(l,{class:{"xpl-checkbox-radio-container":true,styled:this.styled,disabled:this.disabled}},t("input",{class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,value:this.value,onChange:()=>this.radioChange.emit(true)}),t("label",{class:{"xpl-label":true,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",null),this.description&&t("small",{class:{"xpl-description":true,"xpl-description--disabled":this.disabled}},this.description)))}};const Fa=class{constructor(t){a(this,t)}render(){return t(l,{class:"xpl-secondary-nav"},t("nav",{"aria-label":"Secondary Nav"},t("slot",null)))}};const Ba=class{constructor(t){a(this,t);this.tableSelect=h(this,"tableSelect",7);
|
|
7
|
-
//# sourceMappingURL=p-
|
|
6
|
+
*/var La=Object.getOwnPropertySymbols;var Va=Object.prototype.hasOwnProperty;var xa=Object.prototype.propertyIsEnumerable;function Aa(a){if(a===null||a===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(a)}function _a(){try{if(!Object.assign){return false}var a=new String("abc");a[5]="de";if(Object.getOwnPropertyNames(a)[0]==="5"){return false}var t={};for(var l=0;l<10;l++){t["_"+String.fromCharCode(l)]=l}var e=Object.getOwnPropertyNames(t).map((function(a){return t[a]}));if(e.join("")!=="0123456789"){return false}var h={};"abcdefghijklmnopqrst".split("").forEach((function(a){h[a]=a}));if(Object.keys(Object.assign({},h)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(a){return false}}var ja=_a()?Object.assign:function(a,t){var l;var e=Aa(a);var h;for(var r=1;r<arguments.length;r++){l=Object(arguments[r]);for(var i in l){if(Va.call(l,i)){e[i]=l[i]}}if(La){h=La(l);for(var o=0;o<h.length;o++){if(xa.call(l,h[o])){e[h[o]]=l[h[o]]}}}}return e};const $a=16;for(const a of Object.keys(Ha)){const t=(t,l,e)=>{const h=[];const r=ja({},l,e);if(e){if(e["width"]||e["height"]){r["width"]=e["width"]?e["width"]:parseInt(e["height"])*l["width"]/l["height"];r["height"]=e["height"]?e["height"]:parseInt(e["width"])*l["height"]/l["width"]}if(e["class"]){r["class"]=`octicon octicon-${a} ${e["class"]}`;r["class"].trim()}if(e["aria-label"]){r["aria-label"]=e["aria-label"];r["role"]="img";delete r["aria-hidden"]}}for(const a of Object.keys(r)){h.push(`${a}="${r[a]}"`)}return h.join(" ").trim()};Ha[a].symbol=a;for(const t of Object.keys(Ha[a].heights)){Ha[a].heights[t].options={version:"1.1",width:Ha[a].heights[t].width,height:parseInt(t),viewBox:`0 0 ${Ha[a].heights[t].width} ${t}`,class:`octicon octicon-${a}`,"aria-hidden":"true"}}Ha[a].toSVG=function(l={}){const{height:e,width:h}=l;const r=Sa(Object.keys(Ha[a].heights),e||h||$a);return`<svg ${t(Ha[a],Ha[a].heights[r].options,l)}>${Ha[a].heights[r].path}</svg>`}}var Oa=Ha;function Sa(a,t){return a.map((a=>parseInt(a,10))).reduce(((a,l)=>l<=t?l:a),a[0])}const Ta=".xpl-icon{align-items:center;display:grid;justify-content:center}";const qa=class{constructor(t){a(this,t);this.icon=undefined;this.size=undefined;this.backgroundColor=undefined}render(){let a={};if(typeof this.size==="number")a={width:this.size,height:this.size};let e="xpl-icon__wrapper ";if(!!this.backgroundColor)e+=`xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`;return t(l,null,t("figure",{class:e},t("span",{"aria-label":this.icon,role:"img",class:"xpl-icon",style:{width:`${this.size}px`,height:`${this.size}px`},innerHTML:Oa[this.icon].toSVG(a)}),t("figcaption",null,this.icon," icon")))}};qa.style=Ta;const Ia=class{constructor(t){a(this,t);this.navOpen=h(this,"navOpen",7);this.navControl=false}onNavToggle(){if(window.innerWidth<=640){this.navOpen.emit(false)}}render(){return t(l,{class:"xpl-nav-item",role:"listitem",onClick:()=>{if(this.navControl){this.onNavToggle()}}},t("slot",{name:"link"},t("slot",{name:"icon"}),t("slot",null)))}};const Da=class{constructor(t){a(this,t);this.radioChange=h(this,"radioChange",7);this.checked=undefined;this.description=undefined;this.disabled=undefined;this.name=undefined;this.required=undefined;this.styled=undefined;this.value=undefined;this.id=r()}render(){return t(l,{class:{"xpl-checkbox-radio-container":true,styled:this.styled,disabled:this.disabled}},t("input",{class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,value:this.value,onChange:()=>this.radioChange.emit(true)}),t("label",{class:{"xpl-label":true,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",null),this.description&&t("small",{class:{"xpl-description":true,"xpl-description--disabled":this.disabled}},this.description)))}};const Fa=class{constructor(t){a(this,t)}render(){return t(l,{class:"xpl-secondary-nav"},t("nav",{"aria-label":"Secondary Nav"},t("slot",null)))}};const Ba=class{constructor(t){a(this,t);this.tableSelect=h(this,"tableSelect",7);this.selectAllValue=Math.random().toString(36).slice(2);this.selectAll=a=>{const{target:t}=a;if(!(t instanceof HTMLInputElement))return;const{checked:l}=t;this.areAllSelected=l;this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map((a=>l?a===null||a===void 0?void 0:a.value:l)):this.selected.map((()=>l));this.onChange()};this.selectOne=(a,t)=>{const{target:l}=a;if(!(l instanceof HTMLInputElement))return;const{checked:e,value:h}=l;this.areAllSelected=false;this.selected=this.selected.map(((a,l)=>{if(l!==t)return a;return this.selectedValues.length>0?e?h:e:e}));this.onChange()};this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})};this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0};this.setData=()=>{this.rowData=this.data!==undefined?Array.from(this.data):[]};this.columns=undefined;this.data=undefined;this.freeze=undefined;this.multiselect=undefined;this.striped=undefined;this.selectedValues=[];this.areAllSelected=false;this.rowData=undefined;this.hasScrolled=false;this.selected=undefined}watchData(){this.setData()}componentWillLoad(){this.areAllSelected=false;this.setData();this.selected=new Array(this.rowData.length).fill(false)}render(){let a="xpl-table";if(this.striped)a+=" xpl-table--striped";if(this.freeze)a+=" xpl-table--freeze";if(this.hasScrolled)a+=" xpl-table--has-scrolled";return t(l,null,t("div",{class:"xpl-table-container",onScroll:this.onScroll,ref:a=>this.container=a},t("table",{class:a},this.columns&&t("thead",null,this.columns.map(((a,l)=>t("th",null,this.multiselect&&l===0?t("label",{htmlFor:"__xpl-table-th"},t("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((a=>a)),onChange:a=>{this.selectAll(a)},type:"checkbox",value:`select-all-${this.selectAllValue}`}),a):a)))),t("tbody",null,this.rowData.map(((a,l)=>t("tr",{class:this.selected&&this.selected[l]?"xpl-table-row-selected":""},a.map(((a,e)=>t("td",null,this.multiselect&&e===0?t("label",{htmlFor:"__xpl-table-row-"+l},t("input",{id:"__xpl-table-row-"+l,checked:!!this.selected[l],type:"checkbox",onChange:a=>this.selectOne(a,l),value:`${this.selectedValues.length>0?this.selectedValues[l]:`xpl-table-checkbox-${l}`}`}),t("div",{innerHTML:a})):t("div",{innerHTML:a})))))))))))}get el(){return e(this)}static get watchers(){return{data:["watchData"]}}};const Ea=class{constructor(t){a(this,t);this.navOpen=h(this,"navOpen",7);this.navControl=undefined;this.isNavOpenAtStartup=undefined;this.open=true}onNavToggle(){this.open=!this.open;this.navOpen.emit(this.open)}componentWillLoad(){this.open=this.isNavOpenAtStartup!==undefined?this.isNavOpenAtStartup:this.open}render(){return t(l,null,t("nav",{"aria-label":"utility navigation bar",class:"xpl-utility-bar"},this.navControl?t("div",null,t("button",{class:"xpl-utility-bar__nav-control",onClick:()=>this.onNavToggle()},t("xpl-icon",{class:"xpl-utility-nav__bars",icon:"three-bars"})),t("slot",{name:"aside"})):t("slot",{name:"aside"}),t("slot",{name:"main"})))}};export{i as xpl_avatar,o as xpl_badge,n as xpl_breadcrumb_item,s as xpl_breadcrumbs,d as xpl_button,c as xpl_checkbox,p as xpl_content_area,u as xpl_dashboard,v as xpl_data_card,qa as xpl_icon,Ia as xpl_nav_item,Da as xpl_radio,Fa as xpl_secondary_nav,Ba as xpl_table,Ea as xpl_utility_bar};
|
|
7
|
+
//# sourceMappingURL=p-6797b2b7.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["XplAvatar","render","className","this","size","color","inner","h","src","alt","name","class","status","Host","href","disabled","target","XplBadge","dot","variant","XplBreadcrumbItem","constructor","hostRef","chevron","role","innerHTML","XplBreadcrumbs","XplButton","componentDidRender","attrs","el","attributes","dataAttrs","Object","keys","filter","k","propertyName","includes","reduce","acc","assign","value","child","querySelector","forEach","setAttribute","removeAttribute","state","iconOnly","fullWidth","link","type","XplCheckbox","uuid","styled","checked","id","indeterminate","onChange","checkboxChange","emit","input","ref","required","htmlFor","description","XplContentArea","XplDashboard","XplDataCard","watchStat","newValue","stat","watchShortStat","shortStat","componentDidLoad","anchorEl","getElementsByTagName","anchorText","document","createTextNode","anchorSpan","createElement","appendChild","bgColorHue","headerClasses","icon","tabindex","title","getOwnPropertySymbols","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","undefined","TypeError","shouldUseNative","test1","String","getOwnPropertyNames","test2","i","fromCharCode","order2","map","n","join","test3","split","letter","err","objectAssign","source","from","to","symbols","s","arguments","length","key","call","DEFAULT_HEIGHT","data","htmlAttributes","defaultOptions","options","attrObj","parseInt","trim","option","push","symbol","height","heights","version","width","viewBox","toSVG","naturalHeight","closestNaturalHeight","path","apolloIcons","naturalHeights","xplIconCss","XplIcon","wrapperClasses","backgroundColor","style","octicons","XplNavItem","onNavToggle","window","innerWidth","navOpen","onClick","navControl","XplRadio","radioChange","XplSecondaryNav","XplTable","selectAllValue","Math","random","toString","slice","selectAll","e","HTMLInputElement","areAllSelected","selected","selectedValues","Array","querySelectorAll","selectOne","checkboxIdx","v","selectedIdx","tableSelect","onScroll","hasScrolled","container","scrollLeft","setData","rowData","watchData","componentWillLoad","fill","striped","freeze","columns","column","multiselect","some","a","row","rowNum","cell","XplUtilityBar","open","isNavOpenAtStartup"],"sources":["./src/components/components/xpl-avatar/xpl-avatar.tsx","./src/components/components/xpl-badge/xpl-badge.tsx","./src/components/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.tsx","./src/components/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.tsx","./src/components/components/xpl-button/xpl-button.tsx","./src/components/components/xpl-checkbox/xpl-checkbox.tsx","./src/components/components/xpl-content-area/xpl-content-area.tsx","./src/components/components/xpl-dashboard/xpl-dashboard.tsx","./src/components/components/xpl-data-card/xpl-data-card.tsx","./node_modules/object-assign/index.js","./node_modules/@xplortech/apollo-icons/index.js","./src/components/components/xpl-icon/xpl-icon.css?tag=xpl-icon","./src/components/components/xpl-icon/xpl-icon.tsx","./src/components/components/xpl-nav-item/xpl-nav-item.tsx","./src/components/components/xpl-radio/xpl-radio.tsx","./src/components/components/xpl-secondary-nav/xpl-secondary-nav.tsx","./src/components/components/xpl-table/xpl-table.tsx","./src/components/components/xpl-utility-bar/xpl-utility-bar.tsx"],"sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xpl-avatar',\n})\nexport class XplAvatar {\n @Prop() color?: 'green' | 'yellow' | 'pink' | 'primary' | 'secondary';\n @Prop() disabled?: boolean = false;\n @Prop() href?: string;\n @Prop() name?: string;\n @Prop() size?: 'md' | 'sm';\n @Prop() src?: string;\n @Prop() status?: 'active' | 'warning' | 'inactive';\n @Prop() target?: string;\n\n render() {\n let className = 'xpl-avatar';\n if (this.size) className += ` xpl-avatar--${this.size}`;\n if (this.color) className += ` xpl-avatar--${this.color}`;\n\n const inner = (\n <div>\n {this.src ? (\n <img alt={this.name} src={this.src} />\n ) : (\n <div class=\"xpl-avatar__placeholder\">\n <slot></slot>\n </div>\n )}\n {this.status && (\n <div class={`xpl-avatar__dot--${this.status}`}></div>\n )}\n </div>\n );\n\n return (\n <Host>\n {this.href && !this.disabled ? (\n <a href={this.href} class={className} target={this.target}>\n {inner}\n </a>\n ) : this.href && this.disabled ? (\n <div class={className + ' xpl-avatar--disabled'}>\n {inner}\n </div>\n ) : (\n <div class={className}>{inner}</div>\n )}\n </Host>\n );\n }\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xpl-badge',\n})\nexport class XplBadge {\n @Prop() dot?: boolean;\n @Prop() variant?: 'success' | 'warning' | 'inactive' | 'error';\n\n render() {\n let className = 'xpl-badge';\n if (this.dot) className += ' xpl-badge--dot';\n if (this.variant) className += ' xpl-badge--' + this.variant;\n\n return (\n <Host>\n <div class={className}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * @slot unnamed - content rendered inside <li>, should be link or button (styled as link)\n */\n@Component({\n tag: 'xpl-breadcrumb-item',\n})\nexport class XplBreadcrumbItem {\n // This is temporary as we still don't have a xpl-icon component. When that's created we should update this code.\n private chevron = `<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"chevron-right\" class=\"svg-inline--fa fa-chevron-right fa-w-10\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path fill=\"currentColor\" d=\"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z\"></path>\n </svg>\n `;\n\n render() {\n return (\n <Host class=\"xpl-breadcrumb-item\" role=\"listitem\">\n <li role=\"none\">\n <slot></slot>\n </li>\n <span innerHTML={`${this.chevron}`} />\n </Host>\n );\n }\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * @slot unnamed - content rendered <ol>, should be a group of <li> or <xpl-breadcrumb-item>\n */\n@Component({\n tag: 'xpl-breadcrumbs',\n})\nexport class XplBreadcrumbs {\n render() {\n return (\n <Host>\n <nav class=\"xpl-breadcrumbs\" aria-label=\"Breadcrumb\">\n <ol role=\"list\">\n <slot></slot>\n </ol>\n </nav>\n </Host>\n );\n }\n}\n","import { Component, Element, Host, h, Prop } from '@stencil/core';\n@Component({\n tag: 'xpl-button',\n})\nexport class XplButton {\n @Element() el: HTMLXplButtonElement;\n /**\n * whether button should be disabled\n */\n @Prop() disabled?: boolean;\n /**\n * whether button should yield a slot for a link tag\n */\n @Prop() link?: boolean;\n /**\n * whether button should render icon only\n */\n @Prop() iconOnly?: boolean;\n /**\n * whether button should render with full width\n */\n @Prop() fullWidth?: boolean;\n /**\n * @property {string} - button name attribute\n */\n @Prop() name?: string;\n /**\n * @property {\"default\" | \"sm\" | \"xs\"} - button size\n */\n @Prop() size: 'default' | 'sm' | 'xs' = 'default';\n /**\n * @property {\"submit\" | \"reset\" | \"button\"} - button type attribute\n */\n @Prop() type?: 'submit' | 'reset' | 'button';\n /**\n * @property {string} - button value attribute\n */\n @Prop() value?: string;\n /**\n * @property {\"primary\" | \"secondary\" | \"subtle\"} - button variant\n */\n @Prop() variant: 'primary' | 'secondary' | 'subtle' = 'primary';\n /**\n * @property {\"neutral\" | \"warning\" | \"success\"} - button state (color) neutral=purple, success=green, warning=red\n */\n @Prop() state: 'neutral' | 'warning' | 'success' = 'neutral';\n\n componentDidRender() {\n const attrs = this.el.attributes;\n const dataAttrs = Object.keys(attrs)\n .filter((k) => {\n const propertyName = attrs[k].name;\n if (propertyName) {\n return (\n propertyName.includes('data-test') ||\n propertyName.includes('aria-')\n );\n }\n return false;\n })\n .reduce((acc, k) => {\n return { ...acc, [attrs[k].name]: attrs[k].value };\n }, {});\n\n const child = this.el.querySelector('button');\n Object.keys(dataAttrs).forEach((k) => {\n child.setAttribute(k, dataAttrs[k]);\n this.el.removeAttribute(k);\n });\n }\n\n render() {\n let className = `xpl-button\n xpl-button--${this.size}\n xpl-button--${this.state}\n xpl-button--${this.variant}`;\n if (this.iconOnly) className += ' xpl-button--icon-only';\n if (this.fullWidth) className += ' xpl-button--full-width';\n if (this.link && this.disabled)\n className += ' xpl-button--link-disabled';\n\n return (\n <Host class={className}>\n {\n /**\n * Conditionally render either an <slot> or <button> element\n * depending on if there's an `link` or not\n */\n this.link ? (\n <slot></slot>\n ) : (\n <button\n disabled={this.disabled}\n name={this.name}\n type={this.type}\n value={this.value}\n >\n <slot></slot>\n </button>\n )\n }\n </Host>\n );\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { v4 as uuid } from 'uuid';\n\n@Component({\n tag: 'xpl-checkbox',\n})\nexport class XplCheckbox {\n @Prop() checked?: boolean;\n @Prop() description?: string;\n @Prop() disabled?: boolean;\n @Prop() indeterminate?: boolean;\n @Prop() name?: string;\n @Prop() required?: boolean;\n @Prop() styled?: boolean;\n @Prop() value?: string;\n\n @State() id: string = uuid();\n\n /** @private */\n @Event() checkboxChange: EventEmitter;\n\n private input!: HTMLInputElement;\n\n render() {\n return (\n <Host\n class={{\n 'xpl-checkbox-radio-container': true,\n styled: this.styled,\n disabled: this.disabled,\n }}\n >\n <input\n class=\"xpl-checkbox\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n id={this.id}\n indeterminate={this.indeterminate}\n onChange={() =>\n this.checkboxChange.emit(this.input.checked)\n }\n name={this.name}\n ref={(el) => (this.input = el as HTMLInputElement)}\n required={this.required}\n value={this.value}\n ></input>\n <label\n class={{\n 'xpl-label': true,\n 'xpl-label--disabled': this.disabled,\n }}\n htmlFor={this.id}\n >\n <slot></slot>\n {this.description && (\n <small\n class={{\n 'xpl-description': true,\n 'xpl-description--disabled': this.disabled,\n }}\n >\n {this.description}\n </small>\n )}\n </label>\n </Host>\n );\n }\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xpl-content-area',\n})\nexport class XplContentArea {\n /**\n * @property {string} size - The content-area size.\n */\n @Prop() size: 'wide' | 'narrow' | 'full' = 'wide';\n\n render() {\n return (\n <Host>\n <main\n class={`xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}`}\n >\n <div class=\"xpl-content-area\">\n <slot></slot>\n </div>\n </main>\n </Host>\n );\n }\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'xpl-dashboard',\n})\nexport class XplDashboard {\n render() {\n return (\n <Host>\n <dl class=\"xpl-dashboard\">\n <slot></slot>\n </dl>\n </Host>\n );\n }\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { IconName } from '../xpl-icon/xpl-icon';\n\n@Component({\n tag: 'xpl-data-card',\n})\nexport class XplDataCard {\n @Element() el: HTMLXplDataCardElement;\n /**\n * Whether the card is a link\n */\n @Prop() link?: boolean;\n /**\n * Name Term\n */\n @Prop() name: string;\n /**\n * Detail, stat, or value to be displayed.\n * Will be rendered when card is larger than 441px.\n * Will also appear in the tooltip when shortStat\n * is shown.\n */\n @Prop() stat: string;\n /**\n * Detail, stat, or value to be displayed\n * in short format. Will be rendered when card is\n * smaller than 441px.\n */\n @Prop() shortStat?: string;\n /**\n * Color variant. Used to set the icon\n * color and background.\n */\n @Prop() variant?: 'primary' | 'secondary';\n /**\n * Whether to display the icon or not.\n */\n @Prop() icon?: IconName;\n\n @Watch('stat')\n watchStat(newValue: string) {\n this.stat = newValue;\n }\n\n @Watch('shortStat')\n watchShortStat(newValue: string) {\n this.shortStat = newValue;\n }\n\n componentDidLoad() {\n if (this.link) {\n const anchorEl =\n this.el.getElementsByTagName('a')[0] ||\n this.el.getElementsByTagName('button')[0];\n const anchorText = document.createTextNode(this.name);\n const anchorSpan = document.createElement('span');\n anchorSpan.appendChild(anchorText);\n\n anchorEl.setAttribute('class', 'xpl-data-card__anchor');\n anchorEl.appendChild(anchorSpan);\n }\n return;\n }\n\n render() {\n const bgColorHue = this.variant === 'secondary' ? 'purple' : 'orange';\n let headerClasses = `xpl-data-card__header${\n !this.icon ? '--no-icon ' : ' '\n }`;\n headerClasses +=\n this.variant === 'secondary'\n ? 'xpl-data-card__header--secondary'\n : 'xpl-data-card__header--primary';\n return (\n <Host\n role=\"group\"\n class={`xpl-data-card ${this.link && 'xpl-data-card__link'}`}\n tabindex=\"0\"\n >\n {this.link &&\n (this.shortStat ? (\n <abbr title={this.stat}>\n <slot></slot>\n </abbr>\n ) : (\n <slot></slot>\n ))}\n <dt>{this.name}</dt>\n <dd>\n <div class={headerClasses}>\n {!!this.icon && (\n <xpl-icon\n icon={this.icon}\n background-color={bgColorHue}\n size={20}\n ></xpl-icon>\n )}\n {this.link && (\n <span class=\"xpl-data-card__header__arrow\">\n <xpl-icon\n icon=\"chevron-right\"\n size={16}\n ></xpl-icon>\n </span>\n )}\n </div>\n <span class={this.shortStat && 'xpl-data-card__long_stat'}>\n {this.stat}\n </span>\n {this.shortStat && (\n <span class=\"xpl-data-card__short_stat\">\n <abbr title={this.stat}>{this.shortStat}</abbr>\n </span>\n )}\n </dd>\n </Host>\n );\n }\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","const data = require('./build/data.json')\nconst objectAssign = require('object-assign')\n\nconst DEFAULT_HEIGHT = 16\n\nfor (const key of Object.keys(data)) {\n // Returns a string representation of html attributes\n const htmlAttributes = (icon, defaultOptions, options) => {\n const attributes = []\n const attrObj = objectAssign({}, defaultOptions, options)\n\n // If the user passed in options\n if (options) {\n // If any of the width or height is passed in\n if (options['width'] || options['height']) {\n attrObj['width'] = options['width']\n ? options['width']\n : (parseInt(options['height']) * defaultOptions['width']) / defaultOptions['height']\n attrObj['height'] = options['height']\n ? options['height']\n : (parseInt(options['width']) * defaultOptions['height']) / defaultOptions['width']\n }\n\n // If the user passed in class\n if (options['class']) {\n attrObj['class'] = `octicon octicon-${key} ${options['class']}`\n attrObj['class'].trim()\n }\n\n // If the user passed in aria-label\n if (options['aria-label']) {\n attrObj['aria-label'] = options['aria-label']\n attrObj['role'] = 'img'\n\n // Un-hide the icon\n delete attrObj['aria-hidden']\n }\n }\n\n for (const option of Object.keys(attrObj)) {\n attributes.push(`${option}=\"${attrObj[option]}\"`)\n }\n\n return attributes.join(' ').trim()\n }\n\n // Set the symbol for easy access\n data[key].symbol = key\n\n // Set options for each icon height\n for (const height of Object.keys(data[key].heights)) {\n data[key].heights[height].options = {\n version: '1.1',\n width: data[key].heights[height].width,\n height: parseInt(height),\n viewBox: `0 0 ${data[key].heights[height].width} ${height}`,\n class: `octicon octicon-${key}`,\n 'aria-hidden': 'true'\n }\n }\n\n // Function to return an SVG object\n data[key].toSVG = function (options = {}) {\n const {height, width} = options\n const naturalHeight = closestNaturalHeight(Object.keys(data[key].heights), height || width || DEFAULT_HEIGHT)\n return `<svg ${htmlAttributes(data[key], data[key].heights[naturalHeight].options, options)}>${\n data[key].heights[naturalHeight].path\n }</svg>`\n }\n}\n\n// Import data into exports\nmodule.exports = data\n\nfunction closestNaturalHeight(naturalHeights, height) {\n return naturalHeights\n .map(naturalHeight => parseInt(naturalHeight, 10))\n .reduce((acc, naturalHeight) => (naturalHeight <= height ? naturalHeight : acc), naturalHeights[0])\n}\n",".xpl-icon {\n align-items: center;\n display: grid;\n justify-content: center;\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\nimport octicons from '@xplortech/apollo-icons';\nimport data from '@xplortech/apollo-icons/build/data.json';\n\nexport type IconName = keyof typeof data;\n\ninterface Options {\n class?: string;\n height?: number;\n width?: number;\n}\n\n@Component({\n tag: 'xpl-icon',\n styleUrl: 'xpl-icon.css',\n})\nexport class XplIcon {\n /**\n * Name of icon\n */\n @Prop() icon: IconName;\n /**\n * Size of icon\n */\n @Prop() size?: number;\n /**\n * Icon's background color.\n */\n @Prop() backgroundColor?: string;\n\n render() {\n let options: Options = {};\n if (typeof this.size === 'number')\n options = { width: this.size, height: this.size };\n let wrapperClasses = 'xpl-icon__wrapper ';\n if (!!this.backgroundColor)\n wrapperClasses += `xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`;\n\n return (\n <Host>\n <figure class={wrapperClasses}>\n <span\n aria-label={this.icon}\n role=\"img\"\n class=\"xpl-icon\"\n style={{\n width: `${this.size}px`,\n height: `${this.size}px`,\n }}\n innerHTML={octicons[this.icon].toSVG(options)}\n />\n <figcaption>{this.icon} icon</figcaption>\n </figure>\n </Host>\n );\n }\n}\n","import { Component, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xpl-nav-item',\n})\nexport class XplNavItem {\n /**\n * @property {boolean} - Whether or not the item should control the main nav state on click\n */\n @Prop() navControl?: boolean = false;\n\n /**\n * @event {boolean} - Emits the desired state of the navigation bar (open: true/false)\n */\n @Event() navOpen: EventEmitter<boolean>;\n\n private onNavToggle() {\n if (window.innerWidth <= 640) {\n this.navOpen.emit(false);\n }\n }\n\n render() {\n return (\n <Host\n class=\"xpl-nav-item\"\n role=\"listitem\"\n onClick={() => {\n if (this.navControl) {\n this.onNavToggle();\n }\n }}\n >\n <slot name=\"link\">\n <slot name=\"icon\"></slot>\n <slot></slot>\n </slot>\n </Host>\n );\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { v4 as uuid } from 'uuid';\n\n@Component({\n tag: 'xpl-radio',\n})\nexport class XplRadio {\n @Prop() checked?: boolean;\n @Prop() description?: string;\n @Prop() disabled?: boolean;\n @Prop() name?: string;\n @Prop() required?: boolean;\n @Prop() styled?: boolean;\n @Prop() value?: string;\n\n @State() id: string = uuid();\n\n /** @private */\n @Event() radioChange: EventEmitter;\n\n render() {\n return (\n <Host\n class={{\n 'xpl-checkbox-radio-container': true,\n styled: this.styled,\n disabled: this.disabled,\n }}\n >\n <input\n class=\"xpl-radio\"\n type=\"radio\"\n checked={this.checked}\n disabled={this.disabled}\n id={this.id}\n name={this.name}\n required={this.required}\n value={this.value}\n onChange={() => this.radioChange.emit(true)}\n ></input>\n <label\n class={{\n 'xpl-label': true,\n 'xpl-label--disabled': this.disabled,\n }}\n htmlFor={this.id}\n >\n <slot></slot>\n {this.description && (\n <small\n class={{\n 'xpl-description': true,\n 'xpl-description--disabled': this.disabled,\n }}\n >\n {this.description}\n </small>\n )}\n </label>\n </Host>\n );\n }\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'xpl-secondary-nav',\n})\nexport class XplSecondaryNav {\n render() {\n return (\n <Host class=\"xpl-secondary-nav\">\n <nav aria-label=\"Secondary Nav\">\n <slot></slot>\n </nav>\n </Host>\n );\n }\n}\n","import {\n Component,\n Host,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n h,\n Watch,\n} from '@stencil/core';\n\n@Component({\n tag: 'xpl-table',\n})\nexport class XplTable {\n @Element() el: HTMLXplTableElement;\n /**\n * The header values for each column.\n */\n @Prop() columns?: string[];\n /**\n * The data for the body of the table.\n */\n @Prop() data?: string[][];\n /**\n * When true, the first column of the table is sticky and will cover the leftmost rows in a horizontally scrollable container.\n */\n @Prop() freeze?: boolean;\n /**\n * Toggles a selectable checkbox for each row in the table\n */\n @Prop() multiselect?: boolean;\n /**\n * Toggles an optional styling of the background of each even row of the table body.\n */\n @Prop() striped?: boolean;\n /**\n * The values for the input for each row when multiselect is activated.\n */\n @Prop() selectedValues?: string[] = [];\n\n @State() areAllSelected: boolean = false;\n @State() rowData: string[][];\n @State() hasScrolled: boolean = false;\n @State() selected: (string | boolean)[];\n\n @Event() tableSelect: EventEmitter;\n\n private selectAllValue = Math.random().toString(36).slice(2);\n\n private container!: HTMLDivElement;\n\n private selectAll = (e: Event) => {\n const { target } = e;\n\n if (!(target instanceof HTMLInputElement)) return;\n\n const { checked } = target;\n\n this.areAllSelected = checked;\n\n this.selected =\n this.selectedValues.length > 0\n ? // gets all checkboxes in body\n Array.from(\n this.el.querySelectorAll('tbody td:first-child input')\n ).map((input: HTMLInputElement) =>\n // if the select all checkbox is checked, return\n // the value from the current input. If false, set all to false.\n checked ? input?.value : checked\n )\n : this.selected.map(() => checked);\n this.onChange();\n };\n\n private selectOne = (e: Event, checkboxIdx: number) => {\n const { target } = e;\n if (!(target instanceof HTMLInputElement)) return;\n\n const { checked, value } = target;\n\n this.areAllSelected = false;\n this.selected = this.selected.map((v, selectedIdx) => {\n // if the checkbox that fired the event is not the current idx\n // return the current value\n if (selectedIdx !== checkboxIdx) return v;\n\n /**\n * If there are values in this.selectedValues, either return the value\n * for that checkbox or false, dependent on if the checkbox is checked or not.\n * If there are no values in this.selectedValues, return the value\n * to either true or false, dependent on if the checkbox is checked or not.\n *\n */\n return this.selectedValues.length > 0\n ? checked\n ? value\n : checked\n : checked;\n });\n this.onChange();\n };\n\n private onChange = () => {\n this.tableSelect.emit({\n selected: this.selected,\n areAllSelected: this.areAllSelected,\n });\n };\n\n private onScroll = () => {\n this.hasScrolled = this.container.scrollLeft > 0;\n };\n\n /**\n * TODO: Need to figure out how this interplays with data\n * received from an API/server\n */\n // private sortBy = (col: number, ascending = true) => {\n // this.rowData.sort((a, b) => {\n // const A = a[col];\n // const B = b[col];\n // if (typeof A === 'number' && typeof B === 'number') {\n // const f = ascending ? 1 : -1;\n // return A > B ? f : -f;\n // }\n // return -1;\n // });\n // this.rowData = Array.from(this.rowData);\n // this.render();\n // };\n\n private setData = () => {\n this.rowData = this.data !== undefined ? Array.from(this.data) : [];\n };\n\n @Watch('data')\n watchData() {\n this.setData();\n }\n\n componentWillLoad() {\n this.areAllSelected = false;\n this.setData();\n this.selected = new Array(this.rowData.length).fill(false);\n }\n\n render() {\n let className = 'xpl-table';\n if (this.striped) className += ' xpl-table--striped';\n if (this.freeze) className += ' xpl-table--freeze';\n if (this.hasScrolled) className += ' xpl-table--has-scrolled';\n\n return (\n <Host>\n <div\n class=\"xpl-table-container\"\n onScroll={this.onScroll}\n ref={(el) => (this.container = el as HTMLDivElement)}\n >\n <table class={className}>\n {this.columns && (\n <thead>\n {this.columns.map((column, i) => {\n return (\n <th>\n {this.multiselect && i === 0 ? (\n <label htmlFor=\"__xpl-table-th\">\n <input\n checked={\n this.areAllSelected\n }\n id=\"__xpl-table-th\"\n // appear indeterminate when at least one but not all\n // are selected\n indeterminate={\n !this\n .areAllSelected &&\n this.selected.some(\n (a) => a\n )\n }\n onChange={(e) => {\n this.selectAll(e);\n }}\n type=\"checkbox\"\n value={`select-all-${this.selectAllValue}`}\n />\n {column}\n </label>\n ) : (\n column\n )}\n </th>\n );\n })}\n </thead>\n )}\n <tbody>\n {this.rowData.map((row, rowNum) => {\n return (\n <tr\n class={\n this.selected &&\n this.selected[rowNum]\n ? 'xpl-table-row-selected'\n : ''\n }\n >\n {row.map((cell, i) => {\n return (\n <td>\n {this.multiselect &&\n i === 0 ? (\n <label\n htmlFor={\n '__xpl-table-row-' +\n rowNum\n }\n >\n <input\n id={\n '__xpl-table-row-' +\n rowNum\n }\n checked={\n !!this\n .selected[\n rowNum\n ]\n }\n type=\"checkbox\"\n onChange={(e) =>\n this.selectOne(\n e,\n rowNum\n )\n }\n value={`${\n this\n .selectedValues\n .length >\n 0\n ? this\n .selectedValues[\n rowNum\n ]\n : `xpl-table-checkbox-${rowNum}`\n }`}\n />\n <div\n innerHTML={cell}\n />\n </label>\n ) : (\n <div innerHTML={cell} />\n )}\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n </Host>\n );\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\n\n@Component({\n tag: 'xpl-utility-bar',\n})\nexport class XplUtilityBar {\n /**\n * @event {boolean} - Emits the desired state of the navigation bar (open: true/false)\n */\n @Event() navOpen: EventEmitter<boolean>;\n\n /**\n * @property {boolean} - whether or not to show the bars to control the state of the navigation bar (open/close)\n */\n @Prop() navControl?: boolean;\n\n /**\n * @property {boolean} - Optional property that defines whether or not the main nav is open at startup.\n */\n @Prop() isNavOpenAtStartup?: boolean;\n\n @State() open: boolean = true;\n\n private onNavToggle() {\n this.open = !this.open;\n this.navOpen.emit(this.open);\n }\n\n componentWillLoad() {\n this.open =\n this.isNavOpenAtStartup !== undefined\n ? this.isNavOpenAtStartup\n : this.open;\n }\n render() {\n return (\n <Host>\n <nav\n aria-label=\"utility navigation bar\"\n class=\"xpl-utility-bar\"\n >\n {this.navControl ? (\n <div>\n <button\n class=\"xpl-utility-bar__nav-control\"\n onClick={() => this.onNavToggle()}\n >\n <xpl-icon\n class=\"xpl-utility-nav__bars\"\n icon=\"three-bars\"\n ></xpl-icon>\n </button>\n <slot name=\"aside\"></slot>\n </div>\n ) : (\n <slot name=\"aside\"></slot>\n )}\n <slot name=\"main\"></slot>\n </nav>\n </Host>\n );\n }\n}\n"],"mappings":"0GAKaA,EAAS,M,4DAEW,M,2HAQ7BC,SACI,IAAIC,EAAY,aAChB,GAAIC,KAAKC,KAAMF,GAAa,gBAAgBC,KAAKC,OACjD,GAAID,KAAKE,MAAOH,GAAa,gBAAgBC,KAAKE,QAElD,MAAMC,EACFC,EAAA,WACKJ,KAAKK,IACFD,EAAA,OAAKE,IAAKN,KAAKO,KAAMF,IAAKL,KAAKK,MAE/BD,EAAA,OAAKI,MAAM,2BACPJ,EAAA,cAGPJ,KAAKS,QACFL,EAAA,OAAKI,MAAO,oBAAoBR,KAAKS,YAKjD,OACIL,EAACM,EAAI,KACAV,KAAKW,OAASX,KAAKY,SAChBR,EAAA,KAAGO,KAAMX,KAAKW,KAAMH,MAAOT,EAAWc,OAAQb,KAAKa,QAC9CV,GAELH,KAAKW,MAAQX,KAAKY,SAClBR,EAAA,OAAKI,MAAOT,EAAY,yBACnBI,GAGLC,EAAA,OAAKI,MAAOT,GAAYI,G,SCzC/BW,EAAQ,M,mEAIjBhB,SACI,IAAIC,EAAY,YAChB,GAAIC,KAAKe,IAAKhB,GAAa,kBAC3B,GAAIC,KAAKgB,QAASjB,GAAa,eAAiBC,KAAKgB,QAErD,OACIZ,EAACM,EAAI,KACDN,EAAA,OAAKI,MAAOT,GACR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AEhB9L,EAAA,MACII,MACIR,KAAKwK,UACLxK,KAAKwK,SAAS0B,GACR,yBACA,IAGTD,EAAI1F,KAAI,CAAC4F,EAAM/F,IAERhG,EAAA,UACKJ,KAAK8L,aACN1F,IAAM,EACFhG,EAAA,SACI0D,QACI,mBACAoI,GAGJ9L,EAAA,SACIkD,GACI,mBACA4I,EAEJ7I,UACMrD,KACGwK,SACD0B,GAGRjJ,KAAK,WACLO,SAAW6G,GACPrK,KAAK4K,UACDP,EACA6B,GAGR3J,MAAO,GACHvC,KACKyK,eACApD,OACL,EACMrH,KACKyK,eACDyB,GAEJ,sBAAsBA,QAGpC9L,EAAA,OACIkB,UAAW6K,KAInB/L,EAAA,OAAKkB,UAAW6K,a,kFCnP3DC,GAAa,M,gIAgBG,I,CAEjB/C,cACJrJ,KAAKqM,MAAQrM,KAAKqM,KAClBrM,KAAKwJ,QAAQ9F,KAAK1D,KAAKqM,K,CAG3Bb,oBACIxL,KAAKqM,KACDrM,KAAKsM,qBAAuBzG,UACtB7F,KAAKsM,mBACLtM,KAAKqM,I,CAEnBvM,SACI,OACIM,EAACM,EAAI,KACDN,EAAA,oBACe,yBACXI,MAAM,mBAELR,KAAK0J,WACFtJ,EAAA,WACIA,EAAA,UACII,MAAM,+BACNiJ,QAAS,IAAMzJ,KAAKqJ,eAEpBjJ,EAAA,YACII,MAAM,wBACN2E,KAAK,gBAGb/E,EAAA,QAAMG,KAAK,WAGfH,EAAA,QAAMG,KAAK,UAEfH,EAAA,QAAMG,KAAK,U"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as n}from"./p-e8953b60.js";import{v as s}from"./p-ad90fe4d.js";var r=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var h="Expected a function";var o=0/0;var u="[object Symbol]";var l=/^\s+|\s+$/g;var a=/^[-+]0x[0-9a-f]+$/i;var f=/^0b[01]+$/i;var d=/^0o[0-7]+$/i;var c=parseInt;var p=typeof r=="object"&&r&&r.Object===Object&&r;var v=typeof self=="object"&&self&&self.Object===Object&&self;var b=p||v||Function("return this")();var g=Object.prototype;var m=g.toString;var y=Math.max,x=Math.min;var w=function(){return b.Date.now()};function C(t,i,e){var n,s,r,o,u,l,a=0,f=false,d=false,c=true;if(typeof t!="function"){throw new TypeError(h)}i=S(i)||0;if(j(e)){f=!!e.leading;d="maxWait"in e;r=d?y(S(e.maxWait)||0,i):r;c="trailing"in e?!!e.trailing:c}function p(i){var e=n,r=s;n=s=undefined;a=i;o=t.apply(r,e);return o}function v(t){a=t;u=setTimeout(m,i);return f?p(t):o}function b(t){var e=t-l,n=t-a,s=i-e;return d?x(s,r-n):s}function g(t){var e=t-l,n=t-a;return l===undefined||e>=i||e<0||d&&n>=r}function m(){var t=w();if(g(t)){return C(t)}u=setTimeout(m,b(t))}function C(t){u=undefined;if(c&&n){return p(t)}n=s=undefined;return o}function T(){if(u!==undefined){clearTimeout(u)}a=0;n=l=s=u=undefined}function I(){return u===undefined?o:C(w())}function M(){var t=w(),e=g(t);n=arguments;s=this;l=t;if(e){if(u===undefined){return v(l)}if(d){u=setTimeout(m,i);return p(l)}}if(u===undefined){u=setTimeout(m,i)}return o}M.cancel=T;M.flush=I;return M}function T(t,i,e){var n=true,s=true;if(typeof t!="function"){throw new TypeError(h)}if(j(e)){n="leading"in e?!!e.leading:n;s="trailing"in e?!!e.trailing:s}return C(t,i,{leading:n,maxWait:i,trailing:s})}function j(t){var i=typeof t;return!!t&&(i=="object"||i=="function")}function I(t){return!!t&&typeof t=="object"}function M(t){return typeof t=="symbol"||I(t)&&m.call(t)==u}function S(t){if(typeof t=="number"){return t}if(M(t)){return o}if(j(t)){var i=typeof t.valueOf=="function"?t.valueOf():t;t=j(i)?i+"":i}if(typeof t!="string"){return t===0?t:+t}t=t.replace(l,"");var e=f.test(t);return e||d.test(t)?c(t.slice(2),e?2:8):a.test(t)?o:+t}var $=T;function D(t){const i=document.createElement("canvas").getContext("2d");i.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";return i.measureText(t).width+44}const E=class{constructor(e){t(this,e);this.selectChange=i(this,"selectChange",7);this.choices=[];this.description=undefined;this.disabled=undefined;this.error=undefined;this.label=undefined;this.mode="single";this.name=undefined;this.placeholder=undefined;this.truncate=true;this.selectedValues=undefined;this.active=false;this.id=s();this.keepFocus=false;this.selected=undefined;this.value="";this.displayValue="";this.visibleChoices=Infinity}onChoicesChanged(t){this.update()}componentWillLoad(){this.selected=this.choices&&this.choices.length>0?this.choices.map((()=>false)):[];if(this.selectedValues){const t=this.mode==="single";if(t){const t=this.selectedValues;const i=this.choices.find((i=>(i.value!==undefined?i.value:i.label)===t));if(i!==undefined)i.isSelected=true}else{this.choices.forEach((({options:t})=>{t.forEach((t=>{const i=this.selectedValues.includes(t.value||t.label);if(i)t.isSelected=true}))}))}this.update()}window.addEventListener("click",(t=>{const i=t.target;const e=i.closest(".xpl-select");if(e===null||e!==this.container){this.active=false}}));window.addEventListener("resize",$((()=>{this.maybeTruncateChoices()}),250))}componentDidLoad(){this.dropdown=this.container.querySelector("xpl-dropdown")}maybeTruncateChoices(){if(this.mode==="single"||!this.truncate)return;const t=this.container.getBoundingClientRect().width;let i=0;let e=0;const n=this.selected.filter((t=>t)).length;for(let s=0;s<n;s++){e+=D(this.getDisplayValue(s));if(e>t-140)break;i++}if(i>=n)i=Infinity;if(i<1)i=1;this.visibleChoices=i}flattenChoices(){return this.choices.reduce(((t,i)=>[...t,...i.groupName?i.options:[i]]),[])}getDisplayValue(t){return this.flattenChoices()[t].label||this.flattenChoices()[t].value}getActualValue(t){return this.flattenChoices()[t].value||this.flattenChoices()[t].label}update(){this.selected=this.flattenChoices().map((({isSelected:t})=>t));if(this.mode==="single"){const t=this.selected.findIndex((t=>t));this.value=t>=0?this.getActualValue(t):"";this.displayValue=t>=0?this.getDisplayValue(t):""}else if(this.mode==="multi"){this.value=this.selected.map(((t,i)=>t?this.getActualValue(i):"")).filter((t=>t.length>0)).join("|")}}handleValueStateChange(t){this.selectChange.emit(t)}render(){let t=0;return e(n,{class:{"xpl-select":true,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate},onKeyDown:t=>{if(t.key==="Escape")this.active=false},ref:t=>this.container=t},this.label||this.description?e("label",{class:{"xpl-label":true,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&e("small",{class:{"xpl-description":true,"xpl-description--disabled":this.disabled}},this.description)):null,e("div",{class:{"xpl-input":true,"xpl-input--disabled":this.disabled,"xpl-input--error":this.error!==undefined}},e("div",{class:"xpl-input-wrapper"},e("div",{class:{"xpl-select-value":true,"xpl-select-value--active":this.mode==="multi"&&this.value.length>0,"has-value":this.value.length>0}},this.mode==="single"?this.displayValue||this.placeholder:this.value.length>0?this.selected.map(((i,n)=>{if(!i)return null;if(t>=this.visibleChoices){return null}t++;return e("xpl-tag",{onClose:()=>{this.flattenChoices().forEach(((t,i)=>{if(n===i)t.isSelected=false}));const t=i=>{i.options=i.groupName?i.options.map(t):undefined;return i};this.choices=this.choices.map(t);this.update();this.maybeTruncateChoices()}},this.getDisplayValue(n))})):this.placeholder,this.visibleChoices<Infinity&&`+ ${this.selected.filter((t=>t)).length-this.visibleChoices} more`),e("button",{disabled:this.disabled,id:this.id,onKeyDown:t=>{if(t.key==="Tab")this.keepFocus=true},onClick:()=>{const{dropdown:t}=this;if(!this.disabled)t.isOpen=!t.isOpen},type:"button"})),!this.disabled&&e("xpl-dropdown",{options:this.choices,mode:this.mode,triggerId:this.id,update:()=>{this.update();this.maybeTruncateChoices()}}),this.error!==undefined&&this.error.length>0&&e("label",{class:"xpl-input-error",htmlFor:this.id},e("svg",{width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z"})),this.error)),e("input",{type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:["onChoicesChanged"],value:["handleValueStateChange"]}}};export{E as xpl_select};
|
|
2
|
+
//# sourceMappingURL=p-da5a8e74.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectProto","prototype","objectToString","toString","nativeMax","Math","max","nativeMin","min","now","Date","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","toNumber","isObject","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","this","throttle","value","type","isObjectLike","isSymbol","call","other","valueOf","replace","isBinary","test","slice","lodash_throttle","tagWidth","text","context","document","createElement","getContext","font","measureText","width","XplSelect","uuid","Infinity","onChoicesChanged","_choices","update","componentWillLoad","selected","choices","length","map","selectedValues","isSingleMode","mode","selectedValue","shouldBeSelected","find","choice","label","isSelected","forEach","option","includes","window","addEventListener","e","el","target","select","closest","container","active","maybeTruncateChoices","componentDidLoad","dropdown","querySelector","truncate","containerWidth","getBoundingClientRect","visibleChoices","visibleChoicesWidth","actualNumSelected","filter","a","i","getDisplayValue","flattenChoices","reduce","acc","curr","groupName","getActualValue","findIndex","v","displayValue","join","handleValueStateChange","newValue","selectChange","emit","render","h","Host","class","disabled","onKeyDown","key","ref","description","htmlFor","id","error","placeholder","onClose","j","mapOptions","keepFocus","onClick","isOpen","triggerId","height","viewBox","fill","xmlns","d","name"],"sources":["./node_modules/lodash.throttle/index.js","./src/components/components/xpl-select/xpl-select.tsx"],"sourcesContent":["/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","import { v4 as uuid } from 'uuid';\nimport {\n Component,\n Host,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch,\n} from '@stencil/core';\nimport throttle from 'lodash.throttle';\nimport type { DropdownItem } from '../xpl-dropdown/dropdownoption';\n\nfunction tagWidth(text: string): number {\n const context = document.createElement('canvas').getContext('2d');\n context.font =\n \"14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif\";\n return context.measureText(text).width + 44; // = text + l/r padding + margin-right\n}\n\n@Component({\n tag: 'xpl-select',\n})\nexport class XplSelect {\n /**\n * An array of choices for the user to choose from.\n * Each choice should be of the form:\n * {\n * label: string;\n * href?: string;\n * value?: string;\n * isGroupHeading?: boolean;\n * }\n */\n @Prop() choices?: DropdownItem[] = [];\n\n /**\n *\n * @param _choices\n */\n @Watch('choices')\n onChoicesChanged(_choices: DropdownItem[]) {\n this.update();\n }\n\n /**\n * Optional text that appears below the input label.\n */\n @Prop() description?: string;\n @Prop() disabled?: boolean;\n /**\n * If an empty string (attribute present with no value),\n * will display visually as an error. If a string is\n * included, will display visually as an error and include\n * the value as an error message.\n */\n @Prop() error?: string;\n\n /**\n * The label that appears above the select dropdown\n */\n @Prop() label?: string;\n /**\n * Whether to allow a single choice or multiple choices.\n */\n @Prop() mode?: 'single' | 'multi' = 'single';\n\n /**\n * The name of the hidden input field that contains the selected option's value(s)\n */\n @Prop() name?: string;\n\n @Prop() placeholder: string;\n /**\n * Only used in multi-choice selects. If `true`,\n * badges representing selections that would overflow the\n * container are replaced with \"+x more\" (where x is the\n * number not shown). If `false`, the container's height will\n * adjust to show all badges representing selections.\n */\n @Prop() truncate?: boolean = true;\n\n @Prop() selectedValues?: string | string[];\n\n /**\n * Emits the value of the selected option in the select menu on change\n */\n @Event() selectChange: EventEmitter<string>;\n\n @State() active: boolean = false;\n @State() id: string = uuid();\n @State() keepFocus: boolean = false;\n @State() selected: boolean[];\n @State() value: string = '';\n @State() displayValue: string = '';\n // infinity isn't real, it's just a mathematical construct, it can't hurt you\n @State() visibleChoices: number = Infinity;\n\n private container!: HTMLElement;\n\n private dropdown: HTMLXplDropdownElement;\n\n componentWillLoad() {\n this.selected =\n this.choices && this.choices.length > 0\n ? this.choices.map(() => false)\n : [];\n\n if (this.selectedValues) {\n const isSingleMode = this.mode === 'single';\n\n if (isSingleMode) {\n const selectedValue = this.selectedValues as string;\n const shouldBeSelected = this.choices.find(\n (choice) =>\n (choice.value !== undefined\n ? choice.value\n : choice.label) === selectedValue\n );\n if (shouldBeSelected !== undefined)\n shouldBeSelected.isSelected = true;\n } else {\n this.choices.forEach(({ options }) => {\n options.forEach((option) => {\n const shouldBeSelected = this.selectedValues.includes(\n option.value || option.label\n );\n\n if (shouldBeSelected) option.isSelected = true;\n });\n });\n }\n\n this.update();\n }\n\n window.addEventListener('click', (e: MouseEvent) => {\n const el = e.target as HTMLElement;\n const select = el.closest('.xpl-select');\n if (select === null || select !== this.container) {\n this.active = false;\n }\n });\n\n window.addEventListener(\n 'resize',\n throttle(() => {\n this.maybeTruncateChoices();\n }, 250)\n );\n }\n componentDidLoad() {\n this.dropdown = this.container.querySelector('xpl-dropdown');\n }\n\n private maybeTruncateChoices(): void {\n if (this.mode === 'single' || !this.truncate) return;\n\n const containerWidth = this.container.getBoundingClientRect().width;\n\n let visibleChoices = 0;\n let visibleChoicesWidth = 0;\n\n const actualNumSelected = this.selected.filter((a) => a).length;\n for (let i = 0; i < actualNumSelected; i++) {\n visibleChoicesWidth += tagWidth(this.getDisplayValue(i));\n if (visibleChoicesWidth > containerWidth - 140) break;\n visibleChoices++;\n }\n\n if (visibleChoices >= actualNumSelected) visibleChoices = Infinity;\n if (visibleChoices < 1) visibleChoices = 1;\n\n this.visibleChoices = visibleChoices;\n }\n\n private flattenChoices(): DropdownItem[] {\n return this.choices.reduce(\n (acc, curr) => [\n ...acc,\n ...(curr.groupName ? curr.options : [curr]),\n ],\n []\n );\n }\n private getDisplayValue(i: number): string {\n return this.flattenChoices()[i].label || this.flattenChoices()[i].value;\n }\n\n private getActualValue(i: number): string {\n return this.flattenChoices()[i].value || this.flattenChoices()[i].label;\n }\n\n private update() {\n this.selected = this.flattenChoices().map(\n ({ isSelected }) => isSelected\n );\n\n if (this.mode === 'single') {\n const selected = this.selected.findIndex((v) => v);\n this.value = selected >= 0 ? this.getActualValue(selected) : '';\n this.displayValue =\n selected >= 0 ? this.getDisplayValue(selected) : '';\n } else if (this.mode === 'multi') {\n this.value = this.selected\n .map((v, i) => {\n return v ? this.getActualValue(i) : '';\n })\n .filter((v) => v.length > 0)\n .join('|');\n }\n }\n\n @Watch('value')\n handleValueStateChange(newValue) {\n this.selectChange.emit(newValue);\n }\n\n render() {\n let visibleChoices = 0;\n return (\n <Host\n class={{\n 'xpl-select': true,\n 'xpl-select--disabled': this.disabled,\n 'xpl-select--no-truncate': !this.truncate,\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') this.active = false;\n }}\n ref={(el) => (this.container = el as HTMLElement)}\n >\n {this.label || this.description ? (\n <label\n class={{\n 'xpl-label': true,\n 'xpl-label--disabled': this.disabled,\n }}\n htmlFor={this.id}\n >\n {this.label}\n {this.description && (\n <small\n class={{\n 'xpl-description': true,\n 'xpl-description--disabled': this.disabled,\n }}\n >\n {this.description}\n </small>\n )}\n </label>\n ) : null}\n <div\n class={{\n 'xpl-input': true,\n 'xpl-input--disabled': this.disabled,\n 'xpl-input--error': this.error !== undefined,\n }}\n >\n <div class=\"xpl-input-wrapper\">\n <div\n class={{\n 'xpl-select-value': true,\n 'xpl-select-value--active':\n this.mode === 'multi' &&\n this.value.length > 0,\n 'has-value': this.value.length > 0,\n }}\n >\n {this.mode === 'single'\n ? this.displayValue || this.placeholder\n : this.value.length > 0\n ? this.selected.map((v, i) => {\n if (!v) return null;\n if (\n visibleChoices >= this.visibleChoices\n ) {\n return null;\n }\n visibleChoices++;\n return (\n <xpl-tag\n onClose={() => {\n this.flattenChoices().forEach(\n (v, j) => {\n if (i === j)\n v.isSelected =\n false;\n }\n );\n const mapOptions = (\n option: DropdownItem\n ): DropdownItem => {\n option.options =\n option.groupName\n ? option.options.map(\n mapOptions\n )\n : undefined;\n return option;\n };\n this.choices =\n this.choices.map(\n mapOptions\n );\n\n this.update();\n this.maybeTruncateChoices();\n }}\n >\n {this.getDisplayValue(i)}\n </xpl-tag>\n );\n })\n : this.placeholder}\n {this.visibleChoices < Infinity &&\n `+ ${\n this.selected.filter((a) => a).length -\n this.visibleChoices\n } more`}\n </div>\n <button\n disabled={this.disabled}\n id={this.id}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Tab') this.keepFocus = true;\n }}\n onClick={() => {\n const { dropdown } = this;\n if (!this.disabled)\n dropdown.isOpen = !dropdown.isOpen;\n }}\n type=\"button\"\n ></button>\n </div>\n {!this.disabled && (\n <xpl-dropdown\n options={this.choices}\n mode={this.mode}\n triggerId={this.id}\n update={() => {\n this.update();\n this.maybeTruncateChoices();\n }}\n ></xpl-dropdown>\n )}\n {this.error !== undefined && this.error.length > 0 && (\n <label class=\"xpl-input-error\" htmlFor={this.id}>\n <svg\n width=\"10\"\n height=\"11\"\n viewBox=\"0 0 10 11\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z\" />\n </svg>\n {this.error}\n </label>\n )}\n </div>\n <input type=\"hidden\" name={this.name} value={this.value} />\n </Host>\n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AAUvF,KAAKuF,SACfM,GAAI7F,KAAK6F,GACTL,UAAYxC,IACR,GAAIA,EAAEyC,MAAQ,MAAOzF,KAAKmG,UAAY,IAAI,EAE9CC,QAAS,KACL,MAAM3C,SAAEA,GAAazD,KACrB,IAAKA,KAAKuF,SACN9B,EAAS4C,QAAU5C,EAAS4C,MAAM,EAE1ClG,KAAK,aAGXH,KAAKuF,UACHH,EAAA,gBACItH,QAASkC,KAAK+B,QACdK,KAAMpC,KAAKoC,KACXkE,UAAWtG,KAAK6F,GAChBjE,OAAQ,KACJ5B,KAAK4B,SACL5B,KAAKuD,sBAAsB,IAItCvD,KAAK8F,QAAU9G,WAAagB,KAAK8F,MAAM9D,OAAS,GAC7CoD,EAAA,SAAOE,MAAM,kBAAkBM,QAAS5F,KAAK6F,IACzCT,EAAA,OACI9D,MAAM,KACNiF,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,8BAENtB,EAAA,QAAMuB,EAAE,6mBAEX3G,KAAK8F,QAIlBV,EAAA,SAAOjF,KAAK,SAASyG,KAAM5G,KAAK4G,KAAM1G,MAAOF,KAAKE,Q"}
|
|
@@ -2103,22 +2103,21 @@ const XplTable = class {
|
|
|
2103
2103
|
constructor(hostRef) {
|
|
2104
2104
|
index.registerInstance(this, hostRef);
|
|
2105
2105
|
this.tableSelect = index.createEvent(this, "tableSelect", 7);
|
|
2106
|
-
var _a;
|
|
2107
2106
|
this.selectAllValue = Math.random().toString(36).slice(2);
|
|
2108
|
-
this.isSelectedValuesSet = ((_a = this.selectedValues) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
2109
2107
|
this.selectAll = (e) => {
|
|
2110
2108
|
const { target } = e;
|
|
2111
2109
|
if (!(target instanceof HTMLInputElement))
|
|
2112
2110
|
return;
|
|
2113
2111
|
const { checked } = target;
|
|
2114
2112
|
this.areAllSelected = checked;
|
|
2115
|
-
this.selected =
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2113
|
+
this.selected =
|
|
2114
|
+
this.selectedValues.length > 0
|
|
2115
|
+
? // gets all checkboxes in body
|
|
2116
|
+
Array.from(this.el.querySelectorAll('tbody td:first-child input')).map((input) =>
|
|
2117
|
+
// if the select all checkbox is checked, return
|
|
2118
|
+
// the value from the current input. If false, set all to false.
|
|
2119
|
+
checked ? input === null || input === void 0 ? void 0 : input.value : checked)
|
|
2120
|
+
: this.selected.map(() => checked);
|
|
2122
2121
|
this.onChange();
|
|
2123
2122
|
};
|
|
2124
2123
|
this.selectOne = (e, checkboxIdx) => {
|
|
@@ -2139,7 +2138,7 @@ const XplTable = class {
|
|
|
2139
2138
|
* to either true or false, dependent on if the checkbox is checked or not.
|
|
2140
2139
|
*
|
|
2141
2140
|
*/
|
|
2142
|
-
return this.
|
|
2141
|
+
return this.selectedValues.length > 0
|
|
2143
2142
|
? checked
|
|
2144
2143
|
? value
|
|
2145
2144
|
: checked
|