@commmerce/ui 1.1.0 → 1.1.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/cdn.js +52 -50
- package/dist/components/header-bar.js +4 -2
- package/package.json +3 -3
package/dist/cdn.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(a,i,e)=>(Wn(a,i,"read from private field"),e?e.call(a):i.get(a)),h=(a,i,e)=>i.has(a)?kl("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,e),f=(a,i,e,t)=>(Wn(a,i,"write to private field"),t?t.call(a,e):i.set(a,e),e),o=(a,i,e)=>(Wn(a,i,"access private method"),e);var Qr=globalThis,ea=Qr.ShadowRoot&&(Qr.ShadyCSS===void 0||Qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yn=Symbol(),El=new WeakMap,Is=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==Yn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=e}get styleSheet(){let i=this.o,e=this.t;if(ea&&i===void 0){let t=e!==void 0&&e.length===1;t&&(i=El.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&El.set(e,i))}return i}toString(){return this.cssText}},ta=a=>new Is(typeof a=="string"?a:a+"",void 0,Yn),m=(a,...i)=>{let e=a.length===1?a[0]:i.reduce((t,s,l)=>t+(d=>{if(d._$cssResult$===!0)return d.cssText;if(typeof d=="number")return d;throw Error("Value passed to 'css' function must be a 'css' function result: "+d+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+a[l+1],a[0]);return new Is(e,a,Yn)},Ml=(a,i)=>{if(ea)a.adoptedStyleSheets=i.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of i){let t=document.createElement("style"),s=Qr.litNonce;s!==void 0&&t.setAttribute("nonce",s),t.textContent=e.cssText,a.appendChild(t)}},Gn=ea?a=>a:a=>a instanceof CSSStyleSheet?(i=>{let e="";for(let t of i.cssRules)e+=t.cssText;return ta(e)})(a):a;var{is:bd,defineProperty:fd,getOwnPropertyDescriptor:gd,getOwnPropertyNames:vd,getOwnPropertySymbols:xd,getPrototypeOf:yd}=Object,ia=globalThis,_l=ia.trustedTypes,$d=_l?_l.emptyScript:"",wd=ia.reactiveElementPolyfillSupport,Hs=(a,i)=>a,Xn={toAttribute(a,i){switch(i){case Boolean:a=a?$d:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,i){let e=a;switch(i){case Boolean:e=a!==null;break;case Number:e=a===null?null:Number(a);break;case Object:case Array:try{e=JSON.parse(a)}catch{e=null}}return e}},Sl=(a,i)=>!bd(a,i),zl={attribute:!0,type:String,converter:Xn,reflect:!1,useDefault:!1,hasChanged:Sl};Symbol.metadata??=Symbol("metadata"),ia.litPropertyMetadata??=new WeakMap;var Se=class extends HTMLElement{static addInitializer(i){this._$Ei(),(this.l??=[]).push(i)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(i,e=zl){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(i)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(i,e),!e.noAccessor){let t=Symbol(),s=this.getPropertyDescriptor(i,t,e);s!==void 0&&fd(this.prototype,i,s)}}static getPropertyDescriptor(i,e,t){let{get:s,set:l}=gd(this.prototype,i)??{get(){return this[e]},set(d){this[e]=d}};return{get:s,set(d){let p=s?.call(this);l?.call(this,d),this.requestUpdate(i,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(i){return this.elementProperties.get(i)??zl}static _$Ei(){if(this.hasOwnProperty(Hs("elementProperties")))return;let i=yd(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties)}static finalize(){if(this.hasOwnProperty(Hs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Hs("properties"))){let e=this.properties,t=[...vd(e),...xd(e)];for(let s of t)this.createProperty(s,e[s])}let i=this[Symbol.metadata];if(i!==null){let e=litPropertyMetadata.get(i);if(e!==void 0)for(let[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let s=this._$Eu(e,t);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(i){let e=[];if(Array.isArray(i)){let t=new Set(i.flat(1/0).reverse());for(let s of t)e.unshift(Gn(s))}else i!==void 0&&e.push(Gn(i));return e}static _$Eu(i,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this))}addController(i){(this._$EO??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.()}removeController(i){this._$EO?.delete(i)}_$E_(){let i=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(i.set(t,this[t]),delete this[t]);i.size>0&&(this._$Ep=i)}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ml(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(i=>i.hostConnected?.())}enableUpdating(i){}disconnectedCallback(){this._$EO?.forEach(i=>i.hostDisconnected?.())}attributeChangedCallback(i,e,t){this._$AK(i,t)}_$ET(i,e){let t=this.constructor.elementProperties.get(i),s=this.constructor._$Eu(i,t);if(s!==void 0&&t.reflect===!0){let l=(t.converter?.toAttribute!==void 0?t.converter:Xn).toAttribute(e,t.type);this._$Em=i,l==null?this.removeAttribute(s):this.setAttribute(s,l),this._$Em=null}}_$AK(i,e){let t=this.constructor,s=t._$Eh.get(i);if(s!==void 0&&this._$Em!==s){let l=t.getPropertyOptions(s),d=typeof l.converter=="function"?{fromAttribute:l.converter}:l.converter?.fromAttribute!==void 0?l.converter:Xn;this._$Em=s;let p=d.fromAttribute(e,l.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(i,e,t,s=!1,l){if(i!==void 0){let d=this.constructor;if(s===!1&&(l=this[i]),t??=d.getPropertyOptions(i),!((t.hasChanged??Sl)(l,e)||t.useDefault&&t.reflect&&l===this._$Ej?.get(i)&&!this.hasAttribute(d._$Eu(i,t))))return;this.C(i,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(i,e,{useDefault:t,reflect:s,wrapped:l},d){t&&!(this._$Ej??=new Map).has(i)&&(this._$Ej.set(i,d??e??this[i]),l!==!0||d!==void 0)||(this._$AL.has(i)||(this.hasUpdated||t||(e=void 0),this._$AL.set(i,e)),s===!0&&this._$Em!==i&&(this._$Eq??=new Set).add(i))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,l]of this._$Ep)this[s]=l;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[s,l]of t){let{wrapped:d}=l,p=this[s];d!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,l,p)}}let i=!1,e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw i=!1,this._$EM(),t}i&&this._$AE(e)}willUpdate(i){}_$AE(i){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(i)),this.updated(i)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(i){return!0}update(i){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(i){}firstUpdated(i){}};Se.elementStyles=[],Se.shadowRootOptions={mode:"open"},Se[Hs("elementProperties")]=new Map,Se[Hs("finalized")]=new Map,wd?.({ReactiveElement:Se}),(ia.reactiveElementVersions??=[]).push("2.1.2");var Zn=globalThis,
|
|
1
|
+
var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(a,i,e)=>(Wn(a,i,"read from private field"),e?e.call(a):i.get(a)),h=(a,i,e)=>i.has(a)?kl("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,e),f=(a,i,e,t)=>(Wn(a,i,"write to private field"),t?t.call(a,e):i.set(a,e),e),o=(a,i,e)=>(Wn(a,i,"access private method"),e);var Qr=globalThis,ea=Qr.ShadowRoot&&(Qr.ShadyCSS===void 0||Qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yn=Symbol(),El=new WeakMap,Is=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==Yn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=e}get styleSheet(){let i=this.o,e=this.t;if(ea&&i===void 0){let t=e!==void 0&&e.length===1;t&&(i=El.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&El.set(e,i))}return i}toString(){return this.cssText}},ta=a=>new Is(typeof a=="string"?a:a+"",void 0,Yn),m=(a,...i)=>{let e=a.length===1?a[0]:i.reduce((t,s,l)=>t+(d=>{if(d._$cssResult$===!0)return d.cssText;if(typeof d=="number")return d;throw Error("Value passed to 'css' function must be a 'css' function result: "+d+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+a[l+1],a[0]);return new Is(e,a,Yn)},Ml=(a,i)=>{if(ea)a.adoptedStyleSheets=i.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of i){let t=document.createElement("style"),s=Qr.litNonce;s!==void 0&&t.setAttribute("nonce",s),t.textContent=e.cssText,a.appendChild(t)}},Gn=ea?a=>a:a=>a instanceof CSSStyleSheet?(i=>{let e="";for(let t of i.cssRules)e+=t.cssText;return ta(e)})(a):a;var{is:bd,defineProperty:fd,getOwnPropertyDescriptor:gd,getOwnPropertyNames:vd,getOwnPropertySymbols:xd,getPrototypeOf:yd}=Object,ia=globalThis,_l=ia.trustedTypes,$d=_l?_l.emptyScript:"",wd=ia.reactiveElementPolyfillSupport,Hs=(a,i)=>a,Xn={toAttribute(a,i){switch(i){case Boolean:a=a?$d:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,i){let e=a;switch(i){case Boolean:e=a!==null;break;case Number:e=a===null?null:Number(a);break;case Object:case Array:try{e=JSON.parse(a)}catch{e=null}}return e}},Sl=(a,i)=>!bd(a,i),zl={attribute:!0,type:String,converter:Xn,reflect:!1,useDefault:!1,hasChanged:Sl};Symbol.metadata??=Symbol("metadata"),ia.litPropertyMetadata??=new WeakMap;var Se=class extends HTMLElement{static addInitializer(i){this._$Ei(),(this.l??=[]).push(i)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(i,e=zl){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(i)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(i,e),!e.noAccessor){let t=Symbol(),s=this.getPropertyDescriptor(i,t,e);s!==void 0&&fd(this.prototype,i,s)}}static getPropertyDescriptor(i,e,t){let{get:s,set:l}=gd(this.prototype,i)??{get(){return this[e]},set(d){this[e]=d}};return{get:s,set(d){let p=s?.call(this);l?.call(this,d),this.requestUpdate(i,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(i){return this.elementProperties.get(i)??zl}static _$Ei(){if(this.hasOwnProperty(Hs("elementProperties")))return;let i=yd(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties)}static finalize(){if(this.hasOwnProperty(Hs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Hs("properties"))){let e=this.properties,t=[...vd(e),...xd(e)];for(let s of t)this.createProperty(s,e[s])}let i=this[Symbol.metadata];if(i!==null){let e=litPropertyMetadata.get(i);if(e!==void 0)for(let[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let s=this._$Eu(e,t);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(i){let e=[];if(Array.isArray(i)){let t=new Set(i.flat(1/0).reverse());for(let s of t)e.unshift(Gn(s))}else i!==void 0&&e.push(Gn(i));return e}static _$Eu(i,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this))}addController(i){(this._$EO??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.()}removeController(i){this._$EO?.delete(i)}_$E_(){let i=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(i.set(t,this[t]),delete this[t]);i.size>0&&(this._$Ep=i)}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ml(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(i=>i.hostConnected?.())}enableUpdating(i){}disconnectedCallback(){this._$EO?.forEach(i=>i.hostDisconnected?.())}attributeChangedCallback(i,e,t){this._$AK(i,t)}_$ET(i,e){let t=this.constructor.elementProperties.get(i),s=this.constructor._$Eu(i,t);if(s!==void 0&&t.reflect===!0){let l=(t.converter?.toAttribute!==void 0?t.converter:Xn).toAttribute(e,t.type);this._$Em=i,l==null?this.removeAttribute(s):this.setAttribute(s,l),this._$Em=null}}_$AK(i,e){let t=this.constructor,s=t._$Eh.get(i);if(s!==void 0&&this._$Em!==s){let l=t.getPropertyOptions(s),d=typeof l.converter=="function"?{fromAttribute:l.converter}:l.converter?.fromAttribute!==void 0?l.converter:Xn;this._$Em=s;let p=d.fromAttribute(e,l.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(i,e,t,s=!1,l){if(i!==void 0){let d=this.constructor;if(s===!1&&(l=this[i]),t??=d.getPropertyOptions(i),!((t.hasChanged??Sl)(l,e)||t.useDefault&&t.reflect&&l===this._$Ej?.get(i)&&!this.hasAttribute(d._$Eu(i,t))))return;this.C(i,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(i,e,{useDefault:t,reflect:s,wrapped:l},d){t&&!(this._$Ej??=new Map).has(i)&&(this._$Ej.set(i,d??e??this[i]),l!==!0||d!==void 0)||(this._$AL.has(i)||(this.hasUpdated||t||(e=void 0),this._$AL.set(i,e)),s===!0&&this._$Em!==i&&(this._$Eq??=new Set).add(i))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,l]of this._$Ep)this[s]=l;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[s,l]of t){let{wrapped:d}=l,p=this[s];d!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,l,p)}}let i=!1,e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw i=!1,this._$EM(),t}i&&this._$AE(e)}willUpdate(i){}_$AE(i){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(i)),this.updated(i)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(i){return!0}update(i){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(i){}firstUpdated(i){}};Se.elementStyles=[],Se.shadowRootOptions={mode:"open"},Se[Hs("elementProperties")]=new Map,Se[Hs("finalized")]=new Map,wd?.({ReactiveElement:Se}),(ia.reactiveElementVersions??=[]).push("2.1.2");var Zn=globalThis,Tl=a=>a,sa=Zn.trustedTypes,Ll=sa?sa.createPolicy("lit-html",{createHTML:a=>a}):void 0,Qn="$lit$",Te=`lit$${Math.random().toFixed(9).slice(2)}$`,eo="?"+Te,kd=`<${eo}>`,pt=document,qs=()=>pt.createComment(""),Ps=a=>a===null||typeof a!="object"&&typeof a!="function",to=Array.isArray,Il=a=>to(a)||typeof a?.[Symbol.iterator]=="function",Jn=`[
|
|
2
2
|
\f\r]`,Os=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Cl=/-->/g,Al=/>/g,dt=RegExp(`>|${Jn}(?:([^\\s"'>=/]+)(${Jn}*=${Jn}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dl=/'/g,Nl=/"/g,Hl=/^(?:script|style|textarea|title)$/i,io=a=>(i,...e)=>({_$litType$:a,strings:i,values:e}),n=io(1),js=io(2),rh=io(3),Q=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Rl=new WeakMap,ht=pt.createTreeWalker(pt,129);function Ol(a,i){if(!to(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dl=/'/g,Nl=/"/g,Hl=/^(?:script|style|textarea|title)$/i,io=a=>(i,...e)=>({_$litType$:a,strings:i,values:e}),n=io(1),js=io(2),rh=io(3),Q=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Rl=new WeakMap,ht=pt.createTreeWalker(pt,129);function Ol(a,i){if(!to(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ll!==void 0?Ll.createHTML(i):i}var ql=(a,i)=>{let e=a.length-1,t=[],s,l=i===2?"<svg>":i===3?"<math>":"",d=Os;for(let p=0;p<e;p++){let u=a[p],v,$,x=-1,T=0;for(;T<u.length&&(d.lastIndex=T,$=d.exec(u),$!==null);)T=d.lastIndex,d===Os?$[1]==="!--"?d=Cl:$[1]!==void 0?d=Al:$[2]!==void 0?(Hl.test($[2])&&(s=RegExp("</"+$[2],"g")),d=dt):$[3]!==void 0&&(d=dt):d===dt?$[0]===">"?(d=s??Os,x=-1):$[1]===void 0?x=-2:(x=d.lastIndex-$[2].length,v=$[1],d=$[3]===void 0?dt:$[3]==='"'?Nl:Dl):d===Nl||d===Dl?d=dt:d===Cl||d===Al?d=Os:(d=dt,s=void 0);let M=d===dt&&a[p+1].startsWith("/>")?" ":"";l+=d===Os?u+kd:x>=0?(t.push(v),u.slice(0,x)+Qn+u.slice(x)+Te+M):u+Te+(x===-2?p:M)}return[Ol(a,l+(a[e]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),t]},Bs=class a{constructor({strings:i,_$litType$:e},t){let s;this.parts=[];let l=0,d=0,p=i.length-1,u=this.parts,[v,$]=ql(i,e);if(this.el=a.createElement(v,t),ht.currentNode=this.el.content,e===2||e===3){let x=this.el.content.firstChild;x.replaceWith(...x.childNodes)}for(;(s=ht.nextNode())!==null&&u.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let x of s.getAttributeNames())if(x.endsWith(Qn)){let T=$[d++],M=s.getAttribute(x).split(Te),C=/([.?@])?(.*)/.exec(T);u.push({type:1,index:l,name:C[2],strings:M,ctor:C[1]==="."?aa:C[1]==="?"?na:C[1]==="@"?oa:ut}),s.removeAttribute(x)}else x.startsWith(Te)&&(u.push({type:6,index:l}),s.removeAttribute(x));if(Hl.test(s.tagName)){let x=s.textContent.split(Te),T=x.length-1;if(T>0){s.textContent=sa?sa.emptyScript:"";for(let M=0;M<T;M++)s.append(x[M],qs()),ht.nextNode(),u.push({type:2,index:++l});s.append(x[T],qs())}}}else if(s.nodeType===8)if(s.data===eo)u.push({type:2,index:l});else{let x=-1;for(;(x=s.data.indexOf(Te,x+1))!==-1;)u.push({type:7,index:l}),x+=Te.length-1}l++}}static createElement(i,e){let t=pt.createElement("template");return t.innerHTML=i,t}};function mt(a,i,e=a,t){if(i===Q)return i;let s=t!==void 0?e._$Co?.[t]:e._$Cl,l=Ps(i)?void 0:i._$litDirective$;return s?.constructor!==l&&(s?._$AO?.(!1),l===void 0?s=void 0:(s=new l(a),s._$AT(a,e,t)),t!==void 0?(e._$Co??=[])[t]=s:e._$Cl=s),s!==void 0&&(i=mt(a,s._$AS(a,i.values),s,t)),i}var ra=class{constructor(i,e){this._$AV=[],this._$AN=void 0,this._$AD=i,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(i){let{el:{content:e},parts:t}=this._$AD,s=(i?.creationScope??pt).importNode(e,!0);ht.currentNode=s;let l=ht.nextNode(),d=0,p=0,u=t[0];for(;u!==void 0;){if(d===u.index){let v;u.type===2?v=new qt(l,l.nextSibling,this,i):u.type===1?v=new u.ctor(l,u.name,u.strings,this,i):u.type===6&&(v=new la(l,this,i)),this._$AV.push(v),u=t[++p]}d!==u?.index&&(l=ht.nextNode(),d++)}return ht.currentNode=pt,s}p(i){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(i,t,e),e+=t.strings.length-2):t._$AI(i[e])),e++}},qt=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(i,e,t,s){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=i,this._$AB=e,this._$AM=t,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let i=this._$AA.parentNode,e=this._$AM;return e!==void 0&&i?.nodeType===11&&(i=e.parentNode),i}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(i,e=this){i=mt(this,i,e),Ps(i)?i===c||i==null||i===""?(this._$AH!==c&&this._$AR(),this._$AH=c):i!==this._$AH&&i!==Q&&this._(i):i._$litType$!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):Il(i)?this.k(i):this._(i)}O(i){return this._$AA.parentNode.insertBefore(i,this._$AB)}T(i){this._$AH!==i&&(this._$AR(),this._$AH=this.O(i))}_(i){this._$AH!==c&&Ps(this._$AH)?this._$AA.nextSibling.data=i:this.T(pt.createTextNode(i)),this._$AH=i}$(i){let{values:e,_$litType$:t}=i,s=typeof t=="number"?this._$AC(i):(t.el===void 0&&(t.el=Bs.createElement(Ol(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===s)this._$AH.p(e);else{let l=new ra(s,this),d=l.u(this.options);l.p(e),this.T(d),this._$AH=l}}_$AC(i){let e=Rl.get(i.strings);return e===void 0&&Rl.set(i.strings,e=new Bs(i)),e}k(i){to(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,s=0;for(let l of i)s===e.length?e.push(t=new a(this.O(qs()),this.O(qs()),this,this.options)):t=e[s],t._$AI(l),s++;s<e.length&&(this._$AR(t&&t._$AB.nextSibling,s),e.length=s)}_$AR(i=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);i!==this._$AB;){let t=Tl(i).nextSibling;Tl(i).remove(),i=t}}setConnected(i){this._$AM===void 0&&(this._$Cv=i,this._$AP?.(i))}},ut=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(i,e,t,s,l){this.type=1,this._$AH=c,this._$AN=void 0,this.element=i,this.name=e,this._$AM=s,this.options=l,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(i,e=this,t,s){let l=this.strings,d=!1;if(l===void 0)i=mt(this,i,e,0),d=!Ps(i)||i!==this._$AH&&i!==Q,d&&(this._$AH=i);else{let p=i,u,v;for(i=l[0],u=0;u<l.length-1;u++)v=mt(this,p[t+u],e,u),v===Q&&(v=this._$AH[u]),d||=!Ps(v)||v!==this._$AH[u],v===c?i=c:i!==c&&(i+=(v??"")+l[u+1]),this._$AH[u]=v}d&&!s&&this.j(i)}j(i){i===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"")}},aa=class extends ut{constructor(){super(...arguments),this.type=3}j(i){this.element[this.name]=i===c?void 0:i}},na=class extends ut{constructor(){super(...arguments),this.type=4}j(i){this.element.toggleAttribute(this.name,!!i&&i!==c)}},oa=class extends ut{constructor(i,e,t,s,l){super(i,e,t,s,l),this.type=5}_$AI(i,e=this){if((i=mt(this,i,e,0)??c)===Q)return;let t=this._$AH,s=i===c&&t!==c||i.capture!==t.capture||i.once!==t.once||i.passive!==t.passive,l=i!==c&&(t===c||s);s&&this.element.removeEventListener(this.name,this,t),l&&this.element.addEventListener(this.name,this,i),this._$AH=i}handleEvent(i){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,i):this._$AH.handleEvent(i)}},la=class{constructor(i,e,t){this.element=i,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(i){mt(this,i)}},Pl={M:Qn,P:Te,A:eo,C:1,L:ql,R:ra,D:Il,V:mt,I:qt,H:ut,N:na,U:oa,B:aa,F:la},Ed=Zn.litHtmlPolyfillSupport;Ed?.(Bs,qt),(Zn.litHtmlVersions??=[]).push("3.3.3");var Bl=(a,i,e)=>{let t=e?.renderBefore??i,s=t._$litPart$;if(s===void 0){let l=e?.renderBefore??null;t._$litPart$=s=new qt(i.insertBefore(qs(),l),l,void 0,e??{})}return s._$AI(a),s};var so=globalThis,k=class extends Se{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let i=super.createRenderRoot();return this.renderOptions.renderBefore??=i.firstChild,i}update(i){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this._$Do=Bl(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};k._$litElement$=!0,k.finalized=!0,so.litElementHydrateSupport?.({LitElement:k});var Md=so.litElementPolyfillSupport;Md?.({LitElement:k});(so.litElementVersions??=[]).push("4.2.2");var g=m`
|
|
4
4
|
:host {
|
|
5
5
|
font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif);
|
|
6
6
|
color: var(--cm-text-default, #000);
|
|
@@ -11,7 +11,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
11
11
|
`,vh=m`
|
|
12
12
|
outline: 2px solid var(--cm-border-strong);
|
|
13
13
|
outline-offset: 2px;
|
|
14
|
-
`,_d=0,S=a=>`${a}-${++_d}`;function b(a,i){customElements.get(a)||customElements.define(a,i)}function de(a,i){let e=a.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(i).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var zd={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},ca={common:{...zd}},Fs={},Vs={},da;function w(a,i){return ca[a]={...ca[a],...i},i}function Sd(){return Object.fromEntries(Object.entries(ca).map(([a,i])=>[a,{...i}]))}function ha(a,i){for(let[e,t]of Object.entries(i??{}))t&&typeof t=="object"&&(a[e]={...a[e],...t})}function
|
|
14
|
+
`,_d=0,S=a=>`${a}-${++_d}`;function b(a,i){customElements.get(a)||customElements.define(a,i)}function de(a,i){let e=a.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(i).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var zd={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},ca={common:{...zd}},Fs={},Vs={},da;function w(a,i){return ca[a]={...ca[a],...i},i}function Sd(){return Object.fromEntries(Object.entries(ca).map(([a,i])=>[a,{...i}]))}function ha(a,i){for(let[e,t]of Object.entries(i??{}))t&&typeof t=="object"&&(a[e]={...a[e],...t})}function Td(a,i){ha(i?Vs[i.toLowerCase()]??={}:Fs,a),ma()}function Ld(a={}){"locale"in a&&(da=a.locale||void 0),a.strings&&ha(Fs,a.strings);for(let[i,e]of Object.entries(a.translations??{}))ha(Vs[i.toLowerCase()]??={},e);ma()}function Cd(){da=void 0;for(let a of Object.keys(Fs))delete Fs[a];for(let a of Object.keys(Vs))delete Vs[a];ma()}function Us(a){if(da)return da;let i=a;for(;i;){if(i instanceof Element&&i.hasAttribute("lang")&&i.getAttribute("lang"))return i.getAttribute("lang");i=i.parentNode??(i instanceof ShadowRoot?i.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var jl=new Map;function no(a,i,e,t){let s=`${a}|${i??""}|${JSON.stringify(e)}`,l=jl.get(s);if(!l){try{l=t(i)}catch{l=t(void 0)}jl.set(s,l)}return l}function oo(a,i={},e){return no("n",e,i,t=>new Intl.NumberFormat(t,i)).format(a)}function we(a,i={},e){return no("d",e,i,t=>new Intl.DateTimeFormat(t,i)).format(a)}function pa(a,i){return no("p",i,{},e=>new Intl.PluralRules(e)).select(a)}function Fl(a,i={},e){if(a==null)return"";if(typeof a=="function")return String(a(i));let t;if(typeof a=="object"){let s=Number(i.count??0);t=a[pa(s,e)]??a.other??""}else t=String(a);return t.replace(/\{(\w+)\}/g,(s,l)=>{let d=i[l];return d===void 0?s:typeof d=="number"?oo(d,{},e):String(d)})}function Ad(a,i,e,t){if(t&&t[i]!==void 0)return t[i];let s=[];if(e){let l=e.toLowerCase().split("-");for(let d=l.length;d>0;d--)s.push(l.slice(0,d).join("-"))}for(let l of a==="common"?["common"]:[a,"common"]){for(let p of s){let u=Vs[p]?.[l]?.[i];if(u!==void 0)return u}let d=Fs[l]?.[i]??ca[l]?.[i];if(d!==void 0)return d}}function Vl(a,i,e,t,s){let l=Us(t);return Fl(Ad(a,i,l,s),e,l)}var ao=new Set,ro;function ma(){for(let a of ao)a.requestUpdate()}function Dd(){ro||typeof MutationObserver>"u"||typeof document>"u"||(ro=new MutationObserver(ma),ro.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Nd=a=>a.replace(/^cm-/,"").replace(/-([a-z])/g,(i,e)=>e.toUpperCase()),y=class extends k{static finalize(){let i=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!i(this,"finalized")&&i(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let s=t.string;if(!s||i(this.prototype,e))continue;let l=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[l]??this.t(s)},set(d){this[l]=d},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Nd(this.localName)}t(i,e){return Vl(this.stringsNamespace,i,e,this,this.strings)}get locale(){return Us(this)}formatNumber(i,e){return oo(i,e,this.locale)}connectedCallback(){super.connectedCallback(),ao.add(this),Dd()}disconnectedCallback(){super.disconnectedCallback(),ao.delete(this)}};y.properties={strings:{type:Object}};var ua={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5"},Ul=["more","drag"],wh=Object.keys(ua);var Kl=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],Pt=class extends k{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=ua[this.name]??ua.more,t=Ul.includes(this.name)?3:1.6;return js`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
15
15
|
stroke-width=${t} stroke-linecap="round" stroke-linejoin="round"
|
|
16
16
|
role=${this.label?"img":c} aria-label=${this.label||c} aria-hidden=${this.label?c:"true"}
|
|
17
17
|
part="svg" class=${(this.mirror==="auto"?Kl.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};Pt.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},Pt.styles=m`
|
|
@@ -69,7 +69,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
69
69
|
position: absolute; inset-block-start: -7px; inset-inline-end: -7px;
|
|
70
70
|
box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
|
|
71
71
|
}
|
|
72
|
-
`];b("cm-button",bt);var
|
|
72
|
+
`];b("cm-button",bt);var Le={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ga=a=>(...i)=>({_$litDirective$:a,values:i}),Bt=class{constructor(i){}get _$AU(){return this._$AM._$AU}_$AT(i,e,t){this._$Ct=i,this._$AM=e,this._$Ci=t}_$AS(i,e){return this.update(i,e)}update(i,e){return this.render(...e)}};var{I:Ih}=Pl;var Yl=a=>a.strings===void 0;var Rd={},Gl=(a,i=Rd)=>a._$AH=i;var ne=ga(class extends Bt{constructor(a){if(super(a),a.type!==Le.PROPERTY&&a.type!==Le.ATTRIBUTE&&a.type!==Le.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Yl(a))throw Error("`live` bindings can only contain a single expression")}render(a){return a}update(a,[i]){if(i===Q||i===c)return i;let e=a.element,t=a.name;if(a.type===Le.PROPERTY){if(i===e[t])return Q}else if(a.type===Le.BOOLEAN_ATTRIBUTE){if(!!i===e.hasAttribute(t))return Q}else if(a.type===Le.ATTRIBUTE&&e.getAttribute(t)===i+"")return Q;return Gl(a),i}});var Gh=w("textField",{required:"Please fill in this field."}),he,Ce,Ws,Ue,lo,co,Ve=class extends y{constructor(){super(...arguments);h(this,Ue);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";h(this,he,this.attachInternals());h(this,Ce,S("cm-tf"));h(this,Ws,"")}connectedCallback(){super.connectedCallback(),f(this,Ws,this.value)}get form(){return r(this,he).form}get validity(){return r(this,he).validity}get validationMessage(){return r(this,he).validationMessage}checkValidity(){return r(this,he).checkValidity()}reportValidity(){return r(this,he).reportValidity()}formResetCallback(){this.value=r(this,Ws),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){r(this,he).setFormValue(this.value);let e=this.renderRoot.querySelector(".input");this.error?r(this,he).setValidity({customError:!0},this.error,e??void 0):this.required&&!this.value?r(this,he).setValidity({valueMissing:!0},this.t("required"),e??void 0):r(this,he).setValidity({})}render(){let e=[this.error&&`${r(this,Ce)}-err`,this.helpText&&`${r(this,Ce)}-help`].filter(Boolean).join(" ")||c,t={id:r(this,Ce),invalid:this.error?"true":c},s=this.multiline?n`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
|
|
73
73
|
.value=${ne(this.value)} placeholder=${this.placeholder||c}
|
|
74
74
|
?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
|
|
75
75
|
aria-invalid=${t.invalid} aria-describedby=${e}
|
|
@@ -304,7 +304,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
304
304
|
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
|
|
305
305
|
:host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
306
306
|
:host([disabled]) button { cursor: not-allowed; }
|
|
307
|
-
`];b("cm-search",Je);var
|
|
307
|
+
`];b("cm-search",Je);var Ta=m`
|
|
308
308
|
.pop {
|
|
309
309
|
position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
|
|
310
310
|
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
|
|
@@ -316,7 +316,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
316
316
|
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
|
|
317
317
|
clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
|
|
318
318
|
}
|
|
319
|
-
`;function
|
|
319
|
+
`;function La(a,i,e){let t=s=>{i()&&!s.composedPath().includes(a)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Dp=w("tag",{remove:"Remove {label}"}),Ca,ec,Xt=class extends y{constructor(){super(...arguments);h(this,Ca);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return n`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?n`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${o(this,Ca,ec)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:c}</span>`}};Ca=new WeakSet,ec=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Xt.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Xt.styles=[g,m`
|
|
320
320
|
:host { display: inline-flex; vertical-align: middle; max-width: 100%; }
|
|
321
321
|
.tag {
|
|
322
322
|
display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 var(--cm-space-10);
|
|
@@ -353,7 +353,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
353
353
|
}
|
|
354
354
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
355
355
|
@media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
|
|
356
|
-
`];b("cm-spinner",Jt);var Kp=w("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item."}),ee,U,lr,ei,cr,dr,E,go,rr,Aa,ar,Zt,Qt,Ze,tc,nr,vo,xo,or,Da,Na,Ra,ic,Qe=class extends y{constructor(){super(...arguments);h(this,E);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;h(this,ee,this.attachInternals());h(this,U,S("cm-cb"));h(this,lr,null);h(this,ei,new Map);h(this,cr,new MutationObserver(()=>o(this,E,go).call(this)));h(this,dr);h(this,Da,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,o(this,E,Qt).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});h(this,Na,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?o(this,E,nr).call(this,1):(o(this,E,Qt).call(this),e.altKey||o(this,E,nr).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?o(this,E,nr).call(this,-1):(o(this,E,Qt).call(this),o(this,E,nr).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),o(this,E,vo).call(this,this._active)):r(this,E,Aa)&&(e.preventDefault(),o(this,E,xo).call(this,r(this,E,Aa)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),o(this,E,Ze).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",o(this,E,Zt).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":o(this,E,Ze).call(this);break;default:}});h(this,Ra,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(o(this,E,Ze).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?o(this,E,rr).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),o(this,E,go).call(this),r(this,cr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),f(this,dr,
|
|
356
|
+
`];b("cm-spinner",Jt);var Kp=w("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item."}),ee,U,lr,ei,cr,dr,E,go,rr,Aa,ar,Zt,Qt,Ze,tc,nr,vo,xo,or,Da,Na,Ra,ic,Qe=class extends y{constructor(){super(...arguments);h(this,E);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;h(this,ee,this.attachInternals());h(this,U,S("cm-cb"));h(this,lr,null);h(this,ei,new Map);h(this,cr,new MutationObserver(()=>o(this,E,go).call(this)));h(this,dr);h(this,Da,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,o(this,E,Qt).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});h(this,Na,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?o(this,E,nr).call(this,1):(o(this,E,Qt).call(this),e.altKey||o(this,E,nr).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?o(this,E,nr).call(this,-1):(o(this,E,Qt).call(this),o(this,E,nr).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),o(this,E,vo).call(this,this._active)):r(this,E,Aa)&&(e.preventDefault(),o(this,E,xo).call(this,r(this,E,Aa)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),o(this,E,Ze).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",o(this,E,Zt).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":o(this,E,Ze).call(this);break;default:}});h(this,Ra,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(o(this,E,Ze).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?o(this,E,rr).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),o(this,E,go).call(this),r(this,cr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),f(this,dr,La(this,()=>this.open,()=>o(this,E,Ze).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,cr).disconnect(),(e=r(this,dr))==null||e.call(this)}get form(){return r(this,ee).form}get validity(){return r(this,ee).validity}get validationMessage(){return r(this,ee).validationMessage}checkValidity(){return r(this,ee).checkValidity()}reportValidity(){return r(this,ee).reportValidity()}formResetCallback(){let e=r(this,lr)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
|
|
357
357
|
`):[]:this.value=e)}get items(){return this.options?.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let s=t.label.toLowerCase();return this.filter==="starts-with"?s.startsWith(e):s.includes(e)})}firstUpdated(){f(this,lr,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,ei).set(t.value,t.label);if((e.has("value")||e.has("options")||e.has("_slotted"))&&!this.multiple&&!this._typing&&(this._query=this.value?o(this,E,rr).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=o(this,E,ar).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);r(this,ee).setFormValue(l,this.values.join(`
|
|
358
358
|
`))}else r(this,ee).setFormValue(null);else r(this,ee).setFormValue(this.value||null,this.value);let s=this.multiple?!this.values.length:!this.value;this.error?r(this,ee).setValidity({customError:!0},this.error,t):this.required&&s?r(this,ee).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):r(this,ee).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,U)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),o(this,E,Zt).call(this))}render(){let e=o(this,E,ar).call(this),t=[this.error&&`${r(this,U)}-err`,this.helpText&&`${r(this,U)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=p=>this.multiple?this.values.includes(p):p===this.value,d=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return n`<div class="field">
|
|
359
359
|
${this.label?n`<label class="label" id="${r(this,U)}-l" for="${r(this,U)}-in" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
|
|
@@ -388,7 +388,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
388
388
|
${this.error?n`<p class="error" id="${r(this,U)}-err" role="alert">${this.error}</p>`:c}
|
|
389
389
|
${this.helpText?n`<p class="help" id="${r(this,U)}-help">${this.helpText}</p>`:c}
|
|
390
390
|
<slot></slot>
|
|
391
|
-
</div>`}};ee=new WeakMap,U=new WeakMap,lr=new WeakMap,ei=new WeakMap,cr=new WeakMap,dr=new WeakMap,E=new WeakSet,go=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated){let t=e.filter(s=>s.hasAttribute("selected")).map(s=>s.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},rr=function(e){return this.items.find(t=>t.value===e)?.label??r(this,ei).get(e)??e},Aa=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(s=>s.label.toLowerCase()===t||s.value.toLowerCase()===t)||(this.multiple?this.values.some(s=>s.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},ar=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,E,Aa);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Zt=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Qt=function(){this.disabled||(this.open=!0)},Ze=function(){this.open=!1,this._active=-1},tc=function(e=o(this,E,ar).call(this)){return e.flatMap((t,s)=>t.disabled?[]:[s])},nr=function(e){let t=o(this,E,tc).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let s=t.indexOf(this._active);if(s<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(s+e+t.length)%t.length]},vo=function(e){let t=o(this,E,ar).call(this)[e];if(!(!t||t.disabled)){if(t.create){o(this,E,xo).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(s=>s!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,o(this,E,Zt).call(this),o(this,E,or).call(this);return}o(this,E,Ze).call(this),this._typing=!1,this._query=t.label,t.value!==this.value&&(this.value=t.value,o(this,E,Zt).call(this))}},xo=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,ei).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(o(this,E,Ze).call(this),this.value=e,this._typing=!1,this._query=e),o(this,E,Zt).call(this))},or=function(){this.renderRoot.querySelector("input")?.focus()},Da=new WeakMap,Na=new WeakMap,Ra=new WeakMap,ic=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let s=e.toLowerCase().indexOf(t.toLowerCase());return s<0||this.filter==="starts-with"&&s!==0?e:n`${e.slice(0,s)}<mark>${e.slice(s,s+t.length)}</mark>${e.slice(s+t.length)}`},Qe.formAssociated=!0,Qe.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Qe.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Qe.styles=[g,
|
|
391
|
+
</div>`}};ee=new WeakMap,U=new WeakMap,lr=new WeakMap,ei=new WeakMap,cr=new WeakMap,dr=new WeakMap,E=new WeakSet,go=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated){let t=e.filter(s=>s.hasAttribute("selected")).map(s=>s.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},rr=function(e){return this.items.find(t=>t.value===e)?.label??r(this,ei).get(e)??e},Aa=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(s=>s.label.toLowerCase()===t||s.value.toLowerCase()===t)||(this.multiple?this.values.some(s=>s.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},ar=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,E,Aa);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Zt=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Qt=function(){this.disabled||(this.open=!0)},Ze=function(){this.open=!1,this._active=-1},tc=function(e=o(this,E,ar).call(this)){return e.flatMap((t,s)=>t.disabled?[]:[s])},nr=function(e){let t=o(this,E,tc).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let s=t.indexOf(this._active);if(s<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(s+e+t.length)%t.length]},vo=function(e){let t=o(this,E,ar).call(this)[e];if(!(!t||t.disabled)){if(t.create){o(this,E,xo).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(s=>s!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,o(this,E,Zt).call(this),o(this,E,or).call(this);return}o(this,E,Ze).call(this),this._typing=!1,this._query=t.label,t.value!==this.value&&(this.value=t.value,o(this,E,Zt).call(this))}},xo=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,ei).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(o(this,E,Ze).call(this),this.value=e,this._typing=!1,this._query=e),o(this,E,Zt).call(this))},or=function(){this.renderRoot.querySelector("input")?.focus()},Da=new WeakMap,Na=new WeakMap,Ra=new WeakMap,ic=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let s=e.toLowerCase().indexOf(t.toLowerCase());return s<0||this.filter==="starts-with"&&s!==0?e:n`${e.slice(0,s)}<mark>${e.slice(s,s+t.length)}</mark>${e.slice(s+t.length)}`},Qe.formAssociated=!0,Qe.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Qe.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Qe.styles=[g,Ta,m`
|
|
392
392
|
:host { display: block; position: relative; }
|
|
393
393
|
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
394
394
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
@@ -430,8 +430,8 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
430
430
|
slot { display: none; }
|
|
431
431
|
@media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
|
|
432
432
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
433
|
-
`];b("cm-combobox",Qe);var em=w("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),ue,hr,I,Ia,Ha,ti,yo,Oa,sc,qa,pr,$o,rc,wt=class extends y{constructor(){super(...arguments);h(this,I);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;h(this,ue,S("cm-gs"));h(this,hr);h(this,Oa,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),o(this,I,yo).call(this)});h(this,qa,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),o(this,I,sc).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,I,Ha)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.click());break;case"Escape":r(this,I,Ha)?(e.preventDefault(),e.stopPropagation(),o(this,I,ti).call(this)):this.value&&(e.preventDefault(),o(this,I,$o).call(this,!1));break;case"Tab":o(this,I,ti).call(this);break;default:}});h(this,pr,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),f(this,hr,
|
|
434
|
-
aria-selected=${
|
|
433
|
+
`];b("cm-combobox",Qe);var em=w("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),ue,hr,I,Ia,Ha,ti,yo,Oa,sc,qa,pr,$o,rc,wt=class extends y{constructor(){super(...arguments);h(this,I);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;h(this,ue,S("cm-gs"));h(this,hr);h(this,Oa,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),o(this,I,yo).call(this)});h(this,qa,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),o(this,I,sc).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,I,Ha)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.click());break;case"Escape":r(this,I,Ha)?(e.preventDefault(),e.stopPropagation(),o(this,I,ti).call(this)):this.value&&(e.preventDefault(),o(this,I,$o).call(this,!1));break;case"Tab":o(this,I,ti).call(this);break;default:}});h(this,pr,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),f(this,hr,La(this,()=>this.open,()=>o(this,I,ti).call(this))),document.addEventListener("keydown",r(this,pr))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=r(this,hr))==null||e.call(this),document.removeEventListener("keydown",r(this,pr))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=o(this,I,Ia).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=o(this,I,Ia).call(this),t=r(this,I,Ha),s=e.filter(v=>v.item).length,l=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:s}):this.emptyText:"",d=-1,p=(this.results??[]).filter(v=>v?.items?.length),u=(v,$,x="")=>{d++;let T=d;return n`<a role="option" id="${r(this,ue)}-o${T}" class="${x}${T===this._active?" active":""}" href=${v.href} tabindex="-1"
|
|
434
|
+
aria-selected=${T===this._active?"true":"false"} @pointerenter=${()=>this._active=T}
|
|
435
435
|
@click=${M=>o(this,I,rc).call(this,M,v)}>${$}</a>`};return n`<div class="wrap">
|
|
436
436
|
<div class="box" part="box" @click=${v=>{v.target===v.currentTarget&&this.focus()}}>
|
|
437
437
|
<cm-icon class="icon" name="search" size="14"></cm-icon>
|
|
@@ -448,14 +448,14 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
448
448
|
<div role="listbox" id="${r(this,ue)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
|
|
449
449
|
${p.map((v,$)=>{let x=v.total??v.items.length;return n`<div role="group" aria-labelledby="${r(this,ue)}-g${$}">
|
|
450
450
|
<div role="presentation" class="gh" id="${r(this,ue)}-g${$}"><span>${v.label}</span><span class="count" aria-hidden="true">${this.formatNumber(x)}</span><span class="vh">, ${this.t("results",{count:x})}</span></div>
|
|
451
|
-
${v.items.map(
|
|
451
|
+
${v.items.map(T=>u({group:v,item:T,href:T.href},n`${T.icon?n`<cm-icon name=${T.icon} size="16"></cm-icon>`:c}<span class="text"><span class="title">${T.title}</span>${T.description?n`<span class="vh">, </span><span class="desc">${T.description}</span>`:c}</span>`))}
|
|
452
452
|
${v.href?u({group:v,href:v.href},n`<span class="text">${v.seeAllLabel||this.seeAllLabel}</span>`,"all"):c}
|
|
453
453
|
</div>`})}
|
|
454
454
|
</div>
|
|
455
455
|
${this.loading?n`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?c:n`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
|
|
456
456
|
</div>
|
|
457
457
|
<span class="vh" role="status" aria-live="polite">${l}</span>
|
|
458
|
-
</div>`}};ue=new WeakMap,hr=new WeakMap,I=new WeakSet,Ia=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Ha=function(){return this.open&&!!this.value.trim()},ti=function(){this.open=!1,this._active=-1},yo=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Oa=new WeakMap,sc=function(e){let t=o(this,I,Ia).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},qa=new WeakMap,pr=new WeakMap,$o=function(e=!0){this.value="",o(this,I,ti).call(this),e&&this.renderRoot.querySelector("input")?.focus(),o(this,I,yo).call(this)},rc=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),o(this,I,ti).call(this)},wt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},wt.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},wt.styles=[g,
|
|
458
|
+
</div>`}};ue=new WeakMap,hr=new WeakMap,I=new WeakSet,Ia=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Ha=function(){return this.open&&!!this.value.trim()},ti=function(){this.open=!1,this._active=-1},yo=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Oa=new WeakMap,sc=function(e){let t=o(this,I,Ia).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},qa=new WeakMap,pr=new WeakMap,$o=function(e=!0){this.value="",o(this,I,ti).call(this),e&&this.renderRoot.querySelector("input")?.focus(),o(this,I,yo).call(this)},rc=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),o(this,I,ti).call(this)},wt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},wt.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},wt.styles=[g,Ta,m`
|
|
459
459
|
:host { display: block; position: relative; }
|
|
460
460
|
.wrap { position: relative; }
|
|
461
461
|
.box {
|
|
@@ -507,13 +507,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
507
507
|
.title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
508
508
|
.desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
|
|
509
509
|
.all { font-size: 13px; text-decoration: underline; }
|
|
510
|
-
`];b("cm-global-search",wt);var Id=/^(\d{4})-(\d{2})-(\d{2})$/;function z(a){let i=Id.exec(a??"");if(!i)return null;let e=new Date(+i[1],+i[2]-1,+i[3]);return e.getFullYear()===+i[1]&&e.getMonth()===+i[2]-1&&e.getDate()===+i[3]?e:null}var ii=(a,i=2)=>String(a).padStart(i,"0"),ie=a=>`${ii(a.getFullYear(),4)}-${ii(a.getMonth()+1)}-${ii(a.getDate())}`,Hd=()=>ie(new Date),te=(a,i)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+i);function ke(a,i){let e=new Date(a.getFullYear(),a.getMonth()+i,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(a.getDate(),t))}var kt=a=>new Date(a.getFullYear(),a.getMonth(),1),Pa=a=>new Date(a.getFullYear(),a.getMonth()+1,0);var si={fromAttribute:a=>a?a.split(/[\s,]+/).filter(Boolean):[],toAttribute:a=>Array.isArray(a)?a.join(" "):a},mr=a=>Array.isArray(a)?a:typeof a=="string"?si.fromAttribute(a):[];function Ba(a,i){let e=[i,Us(a)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function ja(a){try{let i=new Intl.Locale(a),e=i.getWeekInfo?.()??i.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var ac=new Map;function Fa(a){let i=ac.get(a);if(i)return i;let e=M=>new Intl.DateTimeFormat(a,M),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),s=e({weekday:"short"}),l=e({weekday:"long"}),d=new Date(2024,0,7),p=t.formatToParts(new Date(2026,10,15)),u=p.filter(M=>M.type==="day"||M.type==="month"||M.type==="year").map(M=>M.type),v=p.map(M=>M.type==="day"?"{d}":M.type==="month"?"{m}":M.type==="year"?"{y}":M.value).join(""),$=(M,C)=>Array.from({length:12},(P,H)=>new Intl.DateTimeFormat(M,{month:C}).format(new Date(2024,H,1)).toLowerCase().replace(/\./g,"")),x=Array.from({length:12},(M,C)=>[...new Set([$(a,"long")[C],$(a,"short")[C],$("en","long")[C],$("en","short")[C]])]),
|
|
510
|
+
`];b("cm-global-search",wt);var Id=/^(\d{4})-(\d{2})-(\d{2})$/;function z(a){let i=Id.exec(a??"");if(!i)return null;let e=new Date(+i[1],+i[2]-1,+i[3]);return e.getFullYear()===+i[1]&&e.getMonth()===+i[2]-1&&e.getDate()===+i[3]?e:null}var ii=(a,i=2)=>String(a).padStart(i,"0"),ie=a=>`${ii(a.getFullYear(),4)}-${ii(a.getMonth()+1)}-${ii(a.getDate())}`,Hd=()=>ie(new Date),te=(a,i)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+i);function ke(a,i){let e=new Date(a.getFullYear(),a.getMonth()+i,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(a.getDate(),t))}var kt=a=>new Date(a.getFullYear(),a.getMonth(),1),Pa=a=>new Date(a.getFullYear(),a.getMonth()+1,0);var si={fromAttribute:a=>a?a.split(/[\s,]+/).filter(Boolean):[],toAttribute:a=>Array.isArray(a)?a.join(" "):a},mr=a=>Array.isArray(a)?a:typeof a=="string"?si.fromAttribute(a):[];function Ba(a,i){let e=[i,Us(a)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function ja(a){try{let i=new Intl.Locale(a),e=i.getWeekInfo?.()??i.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var ac=new Map;function Fa(a){let i=ac.get(a);if(i)return i;let e=M=>new Intl.DateTimeFormat(a,M),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),s=e({weekday:"short"}),l=e({weekday:"long"}),d=new Date(2024,0,7),p=t.formatToParts(new Date(2026,10,15)),u=p.filter(M=>M.type==="day"||M.type==="month"||M.type==="year").map(M=>M.type),v=p.map(M=>M.type==="day"?"{d}":M.type==="month"?"{m}":M.type==="year"?"{y}":M.value).join(""),$=(M,C)=>Array.from({length:12},(P,H)=>new Intl.DateTimeFormat(M,{month:C}).format(new Date(2024,H,1)).toLowerCase().replace(/\./g,"")),x=Array.from({length:12},(M,C)=>[...new Set([$(a,"long")[C],$(a,"short")[C],$("en","long")[C],$("en","short")[C]])]),T={short:M=>t.format(M),long:M=>we(M,{weekday:"long",day:"numeric",month:"long",year:"numeric"},a),medium:M=>we(M,{day:"numeric",month:"short",year:"numeric"},a),monthYear:M=>we(M,{month:"long",year:"numeric"},a),day:M=>we(M,{day:"numeric"},a),weekdaysShort:Array.from({length:7},(M,C)=>s.format(te(d,C))),weekdaysLong:Array.from({length:7},(M,C)=>l.format(te(d,C))),pattern:u.length===3?v:"{y}-{m}-{d}",order:u.length===3?u:["year","month","day"],months:x};return ac.set(a,T),T}var Va=(a,i)=>a.pattern.replace(/\{([dmy])\}/g,(e,t)=>i[t]);function Ua(a,i){let e=a.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let s,l,d,p=t.findIndex(v=>/\p{L}/u.test(v));if(p>=0){let v=t[p];l=i.months.findIndex(M=>M.some(C=>C===v||v.length>=3&&C.startsWith(v)))+1;let $=t.filter((M,C)=>C!==p);if(!l||$.some(M=>!/^\d+$/.test(M)))return null;let x=$.findIndex(M=>M.length===4),T=x>=0?x:1;s=+$[T],d=+$[1-T],$[T].length<=2&&(s+=2e3)}else{if(t.some(x=>!/^\d+$/.test(x)))return null;let v=t[0].length===4?["year","month","day"]:i.order,$=x=>t[v.indexOf(x)];if(s=+$("year"),l=+$("month"),d=+$("day"),$("year").length<=2)s+=2e3;else if($("year").length!==4)return null}let u=`${ii(s,4)}-${ii(l)}-${ii(d)}`;return z(u)?u:null}function Ka(a,i,e,t){let s=(e.getDay()-t+7)%7;switch(a){case"ArrowRight":return te(e,1);case"ArrowLeft":return te(e,-1);case"ArrowDown":return te(e,7);case"ArrowUp":return te(e,-7);case"Home":return te(e,-s);case"End":return te(e,6-s);case"PageDown":return ke(e,i.shiftKey?12:1);case"PageUp":return ke(e,i.shiftKey?-12:-1);default:return null}}var et=(a,i,e)=>i&&a<i?i:e&&a>e?e:a;function Wa(a){let{fmt:i,firstDay:e,month:t,focus:s,min:l,max:d}=a,p=kt(t),u=(p.getDay()-e+7)%7,v=Pa(t).getDate(),$=[],x=Array(u).fill(null);for(let H=1;H<=v;H++)x.push(new Date(t.getFullYear(),t.getMonth(),H)),x.length===7&&($.push(x),x=[]);x.length&&$.push([...x,...Array(7-x.length).fill(null)]);let T=Array.from({length:7},(H,O)=>(O+e)%7),M=Hd(),C=!!l&&Pa(ke(p,-1))<l,P=!!d&&ke(p,1)>d;return n`<div class="cal-head">
|
|
511
511
|
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${a.previousLabel} ?disabled=${C} @click=${()=>a.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
|
|
512
512
|
<h2 id="${a.id}-month" class="cal-title" aria-live="polite">${i.monthYear(t)}</h2>
|
|
513
513
|
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${a.nextLabel} ?disabled=${P} @click=${()=>a.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
|
|
514
514
|
</div>
|
|
515
515
|
<table role="grid" class="cal-grid" part="calendar" aria-labelledby="${a.id}-month" @keydown=${a.onKey}>
|
|
516
|
-
<thead><tr>${
|
|
516
|
+
<thead><tr>${T.map(H=>n`<th scope="col" abbr=${i.weekdaysLong[H]}><span aria-hidden="true">${i.weekdaysShort[H]}</span><span class="vh">${i.weekdaysLong[H]}</span></th>`)}</tr></thead>
|
|
517
517
|
<tbody>${$.map(H=>n`<tr>${H.map(O=>{if(!O)return n`<td class="empty"></td>`;let Ht=ie(O),Ot=a.isDisabled(O)||!!l&&O<l||!!d&&O>d,$l=a.mark(O),wl=a.note?.(O);return n`<td class="day ${$l} ${Ht===M?"today":""}" data-date=${Ht}
|
|
518
518
|
tabindex=${Ht===ie(s)?"0":"-1"}
|
|
519
519
|
aria-selected=${$l?"true":"false"} aria-disabled=${Ot?"true":c}
|
|
@@ -583,17 +583,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
583
583
|
:host([size='small']) .field { gap: 6px; }
|
|
584
584
|
:host([size='small']) .label { font-size: 12px; }
|
|
585
585
|
:host([size='small']) input { font-size: 14px; }
|
|
586
|
-
`;var hm=w("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date."}),ni,K,be,oi,li,it,
|
|
586
|
+
`;var hm=w("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date."}),ni,K,be,oi,li,it,L,wo,ri,ko,Eo,ai,nc,ur,br,Mo,_o,Ja,Za,Qa,en,tn,fr,tt=class extends y{constructor(){super(...arguments);h(this,L);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";h(this,ni,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._focus=new Date;h(this,K,this.attachInternals());h(this,be,S("cm-dp"));h(this,oi,null);h(this,li,!1);h(this,it,!1);h(this,Ja,()=>{this.disabled||(this.open?this.open=!1:(o(this,L,br).call(this),this.show()))});h(this,Za,e=>{e.key==="Enter"?o(this,L,br).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),o(this,L,br).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});h(this,Qa,e=>{let t=Ka(de(e,this),e,this._focus,r(this,L,ko));if(t){e.preventDefault(),this._focus=et(t,z(this.min),z(this.max)),f(this,it,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,L,Mo).call(this,this._focus))});h(this,en,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,L,_o).call(this);return}Ga(e,e.currentTarget)});h(this,tn,e=>{this._focus=et(ke(this._focus,e),z(this.min),z(this.max))});h(this,fr,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,ni)}set locale(e){let t=r(this,ni);f(this,ni,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,oi)===null&&f(this,oi,this.value),document.addEventListener("pointerdown",r(this,fr),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,fr),!0)}get form(){return r(this,K).form}get validity(){return r(this,K).validity}get validationMessage(){return r(this,K).validationMessage}get valueAsDate(){return z(this.value)}checkValidity(){return r(this,K).checkValidity()}reportValidity(){return r(this,K).reportValidity()}formResetCallback(){this.value=r(this,oi)??"",this._text=o(this,L,ai).call(this,this.value),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(o(this,L,nc).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=z(e);if(!t)return!0;let s=z(this.min),l=z(this.max);return s&&t<s||l&&t>l?!0:mr(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){e.has("value")&&!r(this,li)?this._text=o(this,L,ai).call(this,this.value):e.has("locale")&&z(this.value)&&(this._text=o(this,L,ai).call(this,this.value)),f(this,li,!1)}updated(e){r(this,K).setFormValue(this.value||null,this._text);let t=this.renderRoot.querySelector("input")??void 0,s=z(this.value),l=r(this,L,ri);this.error?r(this,K).setValidity({customError:!0},this.error,t):this._text.trim()&&!s?r(this,K).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,L,Eo)}),t):this.required&&!s?r(this,K).setValidity({valueMissing:!0},this.t("required"),t):s&&z(this.min)&&s<z(this.min)?r(this,K).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:l.medium(z(this.min))}),t):s&&z(this.max)&&s>z(this.max)?r(this,K).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:l.medium(z(this.max))}),t):s&&this.isUnavailable(this.value)?r(this,K).setValidity({customError:!0},this.t("unavailable"),t):r(this,K).setValidity({}),this.open&&r(this,it)&&(f(this,it,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&f(this,it,!1)}render(){let e=r(this,L,ri),t=z(this.value),s=[this.error&&`${r(this,be)}-err`,this.helpText&&`${r(this,be)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",p=kt(this._focus);return n`<div class="field">
|
|
587
587
|
${this.label?n`<label class="label" for="${r(this,be)}-in" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
|
|
588
588
|
<div class="wrap">
|
|
589
589
|
<div class="box" part="box">
|
|
590
590
|
<input id="${r(this,be)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
|
|
591
|
-
.value=${ne(this._text)} placeholder=${this.placeholder||r(this,
|
|
591
|
+
.value=${ne(this._text)} placeholder=${this.placeholder||r(this,L,Eo)}
|
|
592
592
|
aria-label=${!this.label&&l?l:c}
|
|
593
593
|
?required=${this.required} ?disabled=${this.disabled}
|
|
594
594
|
aria-invalid=${this.error?"true":c} aria-describedby=${s||c}
|
|
595
595
|
@input=${u=>{u.stopPropagation(),this._text=u.target.value}}
|
|
596
|
-
@change=${()=>o(this,
|
|
596
|
+
@change=${()=>o(this,L,br).call(this)} @keydown=${r(this,Za)} />
|
|
597
597
|
<button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
|
|
598
598
|
aria-label=${t?this.t(d?"changeFor":"change",{label:d,date:e.long(t)}):this.t(d?"chooseFor":"choose",{label:d})}
|
|
599
599
|
aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,be)}-pop"
|
|
@@ -601,13 +601,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
601
601
|
</div>
|
|
602
602
|
<div class="pop" id="${r(this,be)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
|
|
603
603
|
?hidden=${!this.open} @keydown=${r(this,en)}>
|
|
604
|
-
${this.open?n`<div class="cal">${Wa({id:r(this,be),fmt:e,firstDay:r(this,
|
|
604
|
+
${this.open?n`<div class="cal">${Wa({id:r(this,be),fmt:e,firstDay:r(this,L,ko),month:p,focus:this._focus,min:z(this.min),max:z(this.max),isDisabled:u=>this.isUnavailable(ie(u)),mark:u=>t&&ie(u)===this.value?"selected":"",onPick:u=>o(this,L,Mo).call(this,u),onKey:r(this,Qa),onMonth:r(this,tn),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:c}
|
|
605
605
|
</div>
|
|
606
606
|
</div>
|
|
607
607
|
${this.error?n`<p class="error" id="${r(this,be)}-err" role="alert">${this.error}</p>`:c}
|
|
608
608
|
${this.helpText?n`<p class="help" id="${r(this,be)}-help">${this.helpText}</p>`:c}
|
|
609
|
-
</div>`}};ni=new WeakMap,K=new WeakMap,be=new WeakMap,oi=new WeakMap,li=new WeakMap,it=new WeakMap,
|
|
610
|
-
.value=${ne(
|
|
609
|
+
</div>`}};ni=new WeakMap,K=new WeakMap,be=new WeakMap,oi=new WeakMap,li=new WeakMap,it=new WeakMap,L=new WeakSet,wo=function(){return Ba(this,this.locale)},ri=function(){return Fa(r(this,L,wo))},ko=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?ja(r(this,L,wo)):(Math.trunc(e)%7+7)%7},Eo=function(){return Va(r(this,L,ri),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},ai=function(e){let t=z(e);return t?r(this,L,ri).short(t):e},nc=function(){let e=new Date,t=z(this.value)??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=et(t,z(this.min),z(this.max)),f(this,it,!0)},ur=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},br=function(){let e=this._text.trim();if(!e){o(this,L,ur).call(this,"");return}let t=Ua(e,r(this,L,ri));t?(o(this,L,ur).call(this,t),this._text=o(this,L,ai).call(this,t)):(f(this,li,!0),o(this,L,ur).call(this,""))},Mo=function(e){let t=ie(e);this.isUnavailable(t)||(this.open=!1,o(this,L,ur).call(this,t),this._text=o(this,L,ai).call(this,t),o(this,L,_o).call(this))},_o=function(){this.renderRoot.querySelector(".trigger")?.focus()},Ja=new WeakMap,Za=new WeakMap,Qa=new WeakMap,en=new WeakMap,tn=new WeakMap,fr=new WeakMap,tt.formAssociated=!0,tt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},tt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:si},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_focus:{state:!0}},tt.styles=[g,Xa,Ya,m`.pop { min-width: 0; }`];b("cm-date-picker",tt);var xm=w("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month"}),Od={today:["Today",a=>[a,a]],yesterday:["Yesterday",a=>[te(a,-1),te(a,-1)]],"last-7-days":["Last 7 days",a=>[te(a,-6),a]],"last-30-days":["Last 30 days",a=>[te(a,-29),a]],"last-90-days":["Last 90 days",a=>[te(a,-89),a]],"this-month":["This month",a=>[kt(a),a]],"last-month":["Last month",a=>[kt(ke(a,-1)),Pa(ke(a,-1))]]},qd=a=>a.replace(/-([a-z0-9])/g,(i,e)=>e.toUpperCase());function oc(a,i=new Date,e){if(typeof a=="object"&&a)return a;let t=Od[a];if(!t)return null;let s=new Date(i.getFullYear(),i.getMonth(),i.getDate()),[l,d]=t[1](s);return{label:e?.(qd(a))||t[0],start:ie(l),end:ie(d)}}var hi,j,oe,pi,mi,rt,_,zo,ci,So,Ne,sn,De,lc,rn,di,To,cc,an,nn,on,ln,cn,gr,Lo,st=class extends y{constructor(){super(...arguments);h(this,_);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";h(this,hi,"");this.disabledDates=[];this.presets=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;h(this,j,this.attachInternals());h(this,oe,S("cm-drp"));h(this,pi,null);h(this,mi,!1);h(this,rt,!1);h(this,Ne,"start");h(this,nn,()=>{this.disabled||(this.open?this.open=!1:(o(this,_,di).call(this,"start"),o(this,_,di).call(this,"end"),this.show()))});h(this,on,e=>t=>{t.key==="Enter"?o(this,_,di).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),o(this,_,di).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});h(this,ln,e=>{let t=Ka(de(e,this),e,this._focus,r(this,_,So));if(t){e.preventDefault(),this._focus=et(t,z(this.min),z(this.max)),f(this,rt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,_,To).call(this,this._focus))});h(this,cn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,_,an).call(this);return}Ga(e,e.currentTarget)});h(this,gr,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,hi)}set locale(e){let t=r(this,hi);f(this,hi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,pi)||f(this,pi,[this.start,this.end]),document.addEventListener("pointerdown",r(this,gr),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,gr),!0)}get form(){return r(this,j).form}get validity(){return r(this,j).validity}get validationMessage(){return r(this,j).validationMessage}checkValidity(){return r(this,j).checkValidity()}reportValidity(){return r(this,j).reportValidity()}formResetCallback(){[this.start,this.end]=r(this,pi)??["",""],this._startText=o(this,_,De).call(this,this.start),this._endText=o(this,_,De).call(this,this.end),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=z(this.start)?this.start:"",this._draftEnd=z(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=et(z(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),z(this.min),z(this.max)),f(this,Ne,"start"),f(this,rt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=z(e);if(!t)return!0;let s=z(this.min),l=z(this.max);return s&&t<s||l&&t>l?!0:mr(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){r(this,mi)||(e.has("start")&&(this._startText=o(this,_,De).call(this,this.start)),e.has("end")&&(this._endText=o(this,_,De).call(this,this.end))),f(this,mi,!1),e.has("locale")&&(z(this.start)&&(this._startText=o(this,_,De).call(this,this.start)),z(this.end)&&(this._endText=o(this,_,De).call(this,this.end)))}updated(){let e=z(this.start),t=z(this.end),s=new FormData;(this.name||this.startName)&&e&&s.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&s.append(this.endName||`${this.name}-end`,this.end),r(this,j).setFormValue(e||t?s:null,`${this.start}/${this.end}`);let l=this.renderRoot.querySelectorAll("input"),[d,p]=[l[0]??void 0,l[1]??void 0],u=r(this,_,ci),v=z(this.min),$=z(this.max);this.error?r(this,j).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?r(this,j).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,_,sn)}),d):this._endText.trim()&&!t?r(this,j).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,_,sn)}),p):this.required&&(!e||!t)?r(this,j).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?r(this,j).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&v&&e<v||t&&v&&t<v?r(this,j).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(v)}),d):e&&$&&e>$||t&&$&&t>$?r(this,j).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium($)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,j).setValidity({customError:!0},this.t("unavailable"),d):r(this,j).setValidity({}),this.open&&r(this,rt)&&(f(this,rt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,_,ci),t=z(this.start),s=z(this.end),l=[this.error&&`${r(this,oe)}-err`,this.helpText&&`${r(this,oe)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=mr(this.presets).map(x=>oc(x,new Date,T=>this.t(T))).filter(x=>!!x),v=r(this,Ne)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(z(this._draftStart))}):this.t("chooseStart"),$=x=>{let T=x==="start"?this._startText:this._endText;return n`<input id="${r(this,oe)}-${x}" type="text" autocomplete="off" spellcheck="false"
|
|
610
|
+
.value=${ne(T)} placeholder=${r(this,_,sn)}
|
|
611
611
|
aria-label=${x==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
|
|
612
612
|
?required=${this.required} ?disabled=${this.disabled}
|
|
613
613
|
aria-invalid=${this.error?"true":c} aria-describedby=${l||c}
|
|
@@ -628,7 +628,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
628
628
|
${u.length?n`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(x=>n`<li>
|
|
629
629
|
<button type="button" class="preset" aria-pressed=${x.start===this.start&&x.end===this.end?"true":"false"}
|
|
630
630
|
@click=${()=>o(this,_,cc).call(this,x)}>${x.label}</button></li>`)}</ul>`:c}
|
|
631
|
-
<div class="cal">${Wa({id:r(this,oe),fmt:e,firstDay:r(this,_,So),month:kt(this._focus),focus:this._focus,min:z(this.min),max:z(this.max),isDisabled:x=>this.isUnavailable(ie(x)),mark:x=>o(this,_,
|
|
631
|
+
<div class="cal">${Wa({id:r(this,oe),fmt:e,firstDay:r(this,_,So),month:kt(this._focus),focus:this._focus,min:z(this.min),max:z(this.max),isDisabled:x=>this.isUnavailable(ie(x)),mark:x=>o(this,_,Lo).call(this,x),note:x=>{let T=o(this,_,Lo).call(this,x);return T==="start"?this.t("startNote"):T==="end"?this.t("endNote"):""},onPick:x=>o(this,_,To).call(this,x),onKey:r(this,ln),onMonth:x=>{this._focus=et(ke(this._focus,x),z(this.min),z(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:x=>{r(this,Ne)==="end"&&(this._hover=x)}})}
|
|
632
632
|
<p class="status" aria-live="polite">${v}</p>
|
|
633
633
|
</div>
|
|
634
634
|
</div>`:c}
|
|
@@ -636,7 +636,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
636
636
|
</div>
|
|
637
637
|
${this.error?n`<p class="error" id="${r(this,oe)}-err" role="alert">${this.error}</p>`:c}
|
|
638
638
|
${this.helpText?n`<p class="help" id="${r(this,oe)}-help">${this.helpText}</p>`:c}
|
|
639
|
-
</div>`}};hi=new WeakMap,j=new WeakMap,oe=new WeakMap,pi=new WeakMap,mi=new WeakMap,rt=new WeakMap,_=new WeakSet,zo=function(){return Ba(this,this.locale)},ci=function(){return Fa(r(this,_,zo))},So=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?ja(r(this,_,zo)):(Math.trunc(e)%7+7)%7},Ne=new WeakMap,sn=function(){return Va(r(this,_,ci),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},De=function(e){let t=z(e);return t?r(this,_,ci).short(t):e},lc=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},rn=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,o(this,_,lc).call(this))},di=function(e){let t=(e==="start"?this._startText:this._endText).trim(),s=t?Ua(t,r(this,_,ci)):"";t&&!s&&f(this,mi,!0);let l=e==="start"?[s??"",this.end]:[this.start,s??""];o(this,_,rn).call(this,...l),s&&(e==="start"?this._startText=o(this,_,De).call(this,s):this._endText=o(this,_,De).call(this,s))},
|
|
639
|
+
</div>`}};hi=new WeakMap,j=new WeakMap,oe=new WeakMap,pi=new WeakMap,mi=new WeakMap,rt=new WeakMap,_=new WeakSet,zo=function(){return Ba(this,this.locale)},ci=function(){return Fa(r(this,_,zo))},So=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?ja(r(this,_,zo)):(Math.trunc(e)%7+7)%7},Ne=new WeakMap,sn=function(){return Va(r(this,_,ci),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},De=function(e){let t=z(e);return t?r(this,_,ci).short(t):e},lc=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},rn=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,o(this,_,lc).call(this))},di=function(e){let t=(e==="start"?this._startText:this._endText).trim(),s=t?Ua(t,r(this,_,ci)):"";t&&!s&&f(this,mi,!0);let l=e==="start"?[s??"",this.end]:[this.start,s??""];o(this,_,rn).call(this,...l),s&&(e==="start"?this._startText=o(this,_,De).call(this,s):this._endText=o(this,_,De).call(this,s))},To=function(e){let t=ie(e);if(!this.isUnavailable(t)){if(r(this,Ne)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",f(this,Ne,"end"),this._focus=e,f(this,rt,!0);return}this._draftEnd=t,this.open=!1,o(this,_,rn).call(this,this._draftStart,t),o(this,_,an).call(this)}},cc=function(e){this.open=!1,o(this,_,rn).call(this,e.start,e.end),o(this,_,an).call(this)},an=function(){this.renderRoot.querySelector(".trigger")?.focus()},nn=new WeakMap,on=new WeakMap,ln=new WeakMap,cn=new WeakMap,gr=new WeakMap,Lo=function(e){let t=ie(e),s=this._draftStart,l=this._draftEnd||(r(this,Ne)==="end"&&s?ie(this._hover??this._focus):"");return t===s?"start":t===l&&l>s?"end":s&&l&&t>s&&t<l?"in-range":""},st.formAssociated=!0,st.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},st.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:si},isDateDisabled:{attribute:!1},presets:{converter:si},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0}},st.styles=[g,Xa,Ya,m`
|
|
640
640
|
.sep { flex: none; color: var(--cm-text-tertiary); }
|
|
641
641
|
input { flex: 0 1 6.6em; }
|
|
642
642
|
:host([size='small']) input { flex-basis: 6.6em; }
|
|
@@ -1104,11 +1104,11 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1104
1104
|
letter-spacing: var(--cm-tracking-caps); text-transform: uppercase;
|
|
1105
1105
|
}
|
|
1106
1106
|
.list { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
1107
|
-
`];b("cm-smart-tips",Si);var Ou=w("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),Ie,
|
|
1107
|
+
`];b("cm-smart-tips",Si);var Ou=w("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),Ie,Li,vc,xc,Ti=class extends y{constructor(){super(...arguments);h(this,Li);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;h(this,Ie,S("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),s=this.total?(t-1)*this.pageSize+1:0,l=Math.min(this.total,t*this.pageSize),d=this.pageSizes??[];return n`
|
|
1108
1108
|
<nav part="bar" aria-label=${this.label}>
|
|
1109
1109
|
${d.length?n`<div class="rows" part="rows">
|
|
1110
1110
|
<label for="${r(this,Ie)}-s">${this.t("rows")}</label>
|
|
1111
|
-
<span class="field"><select id="${r(this,Ie)}-s" @change=${o(this,
|
|
1111
|
+
<span class="field"><select id="${r(this,Ie)}-s" @change=${o(this,Li,vc)}>
|
|
1112
1112
|
${(d.includes(this.pageSize)?d:[...d,this.pageSize].sort((p,u)=>p-u)).map(p=>n`<option value=${p} ?selected=${p===this.pageSize}>${p}</option>`)}
|
|
1113
1113
|
</select><cm-icon name="chevron-down" size="12"></cm-icon></span>
|
|
1114
1114
|
</div>`:c}
|
|
@@ -1119,7 +1119,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1119
1119
|
<input id="${r(this,Ie)}-p" type="number" inputmode="numeric" min="1" max=${e}
|
|
1120
1120
|
.value=${this._draft??String(t)} aria-describedby="${r(this,Ie)}-of"
|
|
1121
1121
|
@input=${p=>this._draft=p.target.value}
|
|
1122
|
-
@keydown=${o(this,
|
|
1122
|
+
@keydown=${o(this,Li,xc)}
|
|
1123
1123
|
@change=${p=>this.goTo(Number(p.target.value))} />
|
|
1124
1124
|
<span id="${r(this,Ie)}-of">${this.t("of",{count:e})}</span>
|
|
1125
1125
|
</span>
|
|
@@ -1131,7 +1131,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1131
1131
|
</span>
|
|
1132
1132
|
</div>
|
|
1133
1133
|
</nav>
|
|
1134
|
-
`}};Ie=new WeakMap,
|
|
1134
|
+
`}};Ie=new WeakMap,Li=new WeakSet,vc=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},xc=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},Ti.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},Ti.styles=[g,m`
|
|
1135
1135
|
:host { display: block; }
|
|
1136
1136
|
nav {
|
|
1137
1137
|
display: flex; align-items: center; gap: var(--cm-space-20); min-height: 60px; padding: 0 var(--cm-space-20);
|
|
@@ -1165,7 +1165,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1165
1165
|
.arrows { display: contents; }
|
|
1166
1166
|
.prev { order: -1; }
|
|
1167
1167
|
}
|
|
1168
|
-
`];b("cm-pagination",
|
|
1168
|
+
`];b("cm-pagination",Ti);var Uu=w("statusTabs",{label:"Status"}),kr,ve,qo,yc,Po,$c,Ci=class extends y{constructor(){super(...arguments);h(this,ve);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];h(this,kr,new MutationObserver(()=>o(this,ve,qo).call(this)))}connectedCallback(){super.connectedCallback(),o(this,ve,qo).call(this),r(this,kr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,kr).disconnect()}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(){if(!("ariaControlsElements"in Element.prototype))return;let e=this.getRootNode(),t=this.controls?e.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button"))s.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=o(this,ve,yc).call(this,e);return n`
|
|
1169
1169
|
<div class="tabs" part="tabs" role="tablist" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
|
|
1170
1170
|
${e.map((s,l)=>n`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
|
|
1171
1171
|
tabindex=${l===t?"0":"-1"} ?disabled=${!!s.disabled}
|
|
@@ -1255,7 +1255,7 @@ cm-data-table > table th > button.cm-sort:hover cm-icon, cm-data-table > table t
|
|
|
1255
1255
|
cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1256
1256
|
@media (forced-colors: active) { cm-data-table > table th > button.cm-sort cm-icon { opacity: 1; } }
|
|
1257
1257
|
cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'] { text-align: end; font-variant-numeric: tabular-nums; }
|
|
1258
|
-
`;function Vd(){if(Ec||typeof document>"u")return;Ec=!0;let a=new CSSStyleSheet;a.replaceSync(Fd),document.adoptedStyleSheets=[...document.adoptedStyleSheets,a]}var Ud=a=>(a.align??(a.type==="numeric"||a.type==="money"?"end":"start"))==="end";function Mc(a){if(typeof a=="number")return a;let i=String(a??"").trim(),e=/^\(.*\)$/.test(i)||/^-|^[^\d]*-\s*\d/.test(i),t=i.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let s=Number(t[0].replace(/,/g,""));return e?-s:s}var _c=a=>a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(String(a??"")),zc=new Map;function Kd(a){let i=zc.get(a??"");if(!i){try{i=new Intl.Collator(a,{numeric:!0,sensitivity:"base"})}catch{i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}zc.set(a??"",i)}return i}function Sc(a,i,e,t){let s=l=>l==null||l==="";return s(a)||s(i)?s(a)===s(i)?0:s(a)?1:-1:e==="numeric"||e==="money"?(Mc(a)||0)-(Mc(i)||0):e==="date"?(_c(a)||0)-(_c(i)||0):Kd(t).compare(String(a),String(i))}var Ri,Mr,R,jo,Fo,
|
|
1258
|
+
`;function Vd(){if(Ec||typeof document>"u")return;Ec=!0;let a=new CSSStyleSheet;a.replaceSync(Fd),document.adoptedStyleSheets=[...document.adoptedStyleSheets,a]}var Ud=a=>(a.align??(a.type==="numeric"||a.type==="money"?"end":"start"))==="end";function Mc(a){if(typeof a=="number")return a;let i=String(a??"").trim(),e=/^\(.*\)$/.test(i)||/^-|^[^\d]*-\s*\d/.test(i),t=i.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let s=Number(t[0].replace(/,/g,""));return e?-s:s}var _c=a=>a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(String(a??"")),zc=new Map;function Kd(a){let i=zc.get(a??"");if(!i){try{i=new Intl.Collator(a,{numeric:!0,sensitivity:"base"})}catch{i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}zc.set(a??"",i)}return i}function Sc(a,i,e,t){let s=l=>l==null||l==="";return s(a)||s(i)?s(a)===s(i)?0:s(a)?1:-1:e==="numeric"||e==="money"?(Mc(a)||0)-(Mc(i)||0):e==="date"?(_c(a)||0)-(_c(i)||0):Kd(t).compare(String(a),String(i))}var Ri,Mr,R,jo,Fo,Tc,Vo,Lc,Cc,bn,Di,Ni=class extends y{constructor(){super(...arguments);h(this,R);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this._light=!1;this._announce="";h(this,Ri,!1);h(this,Mr,new MutationObserver(()=>o(this,R,jo).call(this)))}connectedCallback(){super.connectedCallback(),o(this,R,jo).call(this),r(this,Mr).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Mr).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(l=>l.key===this.sort);if(!t||this.sortMode==="manual")return e;let s=this.direction==="descending"?-1:1;return e.map((l,d)=>[l,d]).sort(([l,d],[p,u])=>{let v=l[t.key],$=p[t.key],x=v==null||v==="",T=$==null||$==="";return x||T?x===T?d-u:x?1:-1:s*Sc(v,$,t.type,this.locale)||d-u}).map(([l])=>l)}updated(e){if(r(this,Ri)&&(e.has("sort")||e.has("direction"))&&this.sort){f(this,Ri,!1);let t=this.columns.find(s=>s.key===this.sort);t&&o(this,R,Fo).call(this,t.label,this.direction)}}render(){let e=n`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return n`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],s=this.sortedRows,l=Math.max(1,t.length),d=!this.loading&&s.length===0;return n`
|
|
1259
1259
|
<div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":c}
|
|
1260
1260
|
role=${this.stickyHeader||this.stickyFirstColumn?"region":c}
|
|
1261
1261
|
aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:c}>
|
|
@@ -1270,7 +1270,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1270
1270
|
${this.totals&&!this.loading&&!d?n`<tfoot><tr part="totals">${t.map(p=>n`<td class=${o(this,R,Di).call(this,p)}>${o(this,R,bn).call(this,this.totals[p.key])}</td>`)}</tr></tfoot>`:c}
|
|
1271
1271
|
</table>
|
|
1272
1272
|
</div>${e}
|
|
1273
|
-
`}};Ri=new WeakMap,Mr=new WeakMap,R=new WeakSet,jo=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Vd(),o(this,R,
|
|
1273
|
+
`}};Ri=new WeakMap,Mr=new WeakMap,R=new WeakSet,jo=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Vd(),o(this,R,Tc).call(this))},Fo=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},Tc=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),o(this,R,Vo).call(this,s),d.addEventListener("click",()=>o(this,R,Lc).call(this,e,s,l))})},Vo=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Lc=function(e,t,s){let l=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),d=t.dataset.key||l,p=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",u=new CustomEvent("cm-sort",{detail:{key:d,direction:p},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(u)||this.sortMode==="manual")return;let v=t.dataset.sort,$=p==="descending"?-1:1;for(let x of e.tBodies){let T=C=>{let P=C.cells[s];return P?(P.dataset.value??P.textContent??"").trim():""},M=[...x.rows].map((C,P)=>[C,T(C),P]).sort(([,C,P],[,H,O])=>C===""||H===""?C===H?P-O:C===""?1:-1:$*Sc(C,H,v,this.locale)||P-O);x.append(...M.map(([C])=>C))}for(let x of e.tHead.rows[0].cells)x.dataset.sort&&(x.setAttribute("aria-sort",x===t?p:"none"),o(this,R,Vo).call(this,x));o(this,R,Fo).call(this,l,p)},Cc=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",s=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),l=this.dispatchEvent(s);f(this,Ri,l),l&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},bn=function(e){return e==null?"":e instanceof Date?we(e,{},this.locale):String(e)},Di=function(e){return`${Ud(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},Ni.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},_light:{state:!0},_announce:{state:!0}},Ni.styles=[g,m`
|
|
1274
1274
|
:host { display: block; font-size: 14px; line-height: 1.5; }
|
|
1275
1275
|
.scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
|
|
1276
1276
|
.scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
@@ -1307,16 +1307,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1307
1307
|
.empty td { padding: var(--cm-space-20); border-block-end: 0; }
|
|
1308
1308
|
.light { display: contents; }
|
|
1309
1309
|
@media (forced-colors: active) { button cm-icon { opacity: 1; } }
|
|
1310
|
-
`];b("cm-data-table",Ni);var Ii=class extends k{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};Ii.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Ii.styles=m`:host { display: none; }`;b("cm-menu-item",Ii);function _r(a){let i=[];for(let e of Array.from(a.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),s=l=>e.getAttribute(l)||void 0;i.push({label:t,value:s("value")??t,icon:s("icon"),href:s("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&i.push({divider:!0});return i}function fn(a,i){let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var fb=w("actionMenu",{label:"Actions"}),zr,qi,zt,Sr,N,gn,
|
|
1310
|
+
`];b("cm-data-table",Ni);var Ii=class extends k{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};Ii.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Ii.styles=m`:host { display: none; }`;b("cm-menu-item",Ii);function _r(a){let i=[];for(let e of Array.from(a.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),s=l=>e.getAttribute(l)||void 0;i.push({label:t,value:s("value")??t,icon:s("icon"),href:s("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&i.push({divider:!0});return i}function fn(a,i){let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var fb=w("actionMenu",{label:"Actions"}),zr,qi,zt,Sr,N,gn,Tr,Uo,vn,xn,yn,Lr,Cr,Hi,$n,Ac,Dc,Oi=class extends y{constructor(){super(...arguments);h(this,N);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this._slotted=[];this._active=-1;this._custom=!1;h(this,zr);h(this,qi,S("cm-menu"));h(this,zt,"");h(this,Sr,0);h(this,Tr,e=>{this.open&&!e.composedPath().includes(this)&&o(this,N,xn).call(this,!1)});h(this,Lr,e=>{e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0))});h(this,Cr,()=>{this.open?this.hide():this.show()});h(this,$n,e=>{let t=o(this,N,vn).call(this),s=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),o(this,N,Hi).call(this,t[(s+1)%t.length]);break;case"ArrowUp":e.preventDefault(),o(this,N,Hi).call(this,t[(s-1+t.length)%t.length]);break;case"Home":e.preventDefault(),o(this,N,Hi).call(this,t[0]);break;case"End":e.preventDefault(),o(this,N,Hi).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let l=Date.now();f(this,zt,(l-r(this,Sr)<600?r(this,zt):"")+e.key.toLowerCase()),f(this,Sr,l);let d=this.menuItems,p=r(this,zt).length>1?s:s+1,v=[...t.slice(Math.max(p,0)),...t.slice(0,Math.max(p,0))].find($=>(d[$].label??"").toLowerCase().startsWith(r(this,zt)));v!==void 0&&o(this,N,Hi).call(this,v)}}})}connectedCallback(){super.connectedCallback(),o(this,N,gn).call(this),f(this,zr,fn(this,()=>o(this,N,gn).call(this))),document.addEventListener("pointerdown",r(this,Tr),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,zr)?.disconnect(),document.removeEventListener("pointerdown",r(this,Tr),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=o(this,N,vn).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,o(this,N,xn).call(this,!0),this.updateComplete.then(()=>o(this,N,yn).call(this))}hide(e=!1){o(this,N,xn).call(this,!1),e&&o(this,N,Uo).call(this)?.focus()}updated(e){if(this._custom){let t=o(this,N,Uo).call(this);if(t){let s=(l,d)=>{t.getAttribute(l)!==d&&t.setAttribute(l,d)};s("aria-haspopup","menu"),s("aria-expanded",String(this.open)),s("aria-controls",`${r(this,qi)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=o(this,N,vn).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>o(this,N,yn).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,s=this._custom?n`<slot name="trigger" @click=${r(this,Cr)} @keydown=${r(this,Lr)} @slotchange=${()=>o(this,N,gn).call(this)}></slot>`:n`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
|
|
1311
1311
|
aria-expanded=${String(this.open)} aria-controls="${r(this,qi)}-m" aria-label=${this.iconOnly?t:c}
|
|
1312
|
-
@click=${r(this,Cr)} @keydown=${r(this,
|
|
1312
|
+
@click=${r(this,Cr)} @keydown=${r(this,Lr)}>${this.iconOnly?n`<cm-icon name=${this.icon} size="18"></cm-icon>`:n`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return n`${s}
|
|
1313
1313
|
<div class="pop" part="menu" ?hidden=${!this.open}>
|
|
1314
1314
|
${this.heading?n`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?n`<span>${this.subheading}</span>`:c}</div>`:c}
|
|
1315
1315
|
<div role="menu" id="${r(this,qi)}-m" aria-label=${this.heading||this.label} @keydown=${r(this,$n)}>
|
|
1316
1316
|
${e.map((l,d)=>o(this,N,Dc).call(this,l,d))}
|
|
1317
1317
|
</div>
|
|
1318
1318
|
</div>
|
|
1319
|
-
<slot hidden></slot>`}};zr=new WeakMap,qi=new WeakMap,zt=new WeakMap,Sr=new WeakMap,N=new WeakSet,gn=function(){this._slotted=_r(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},
|
|
1319
|
+
<slot hidden></slot>`}};zr=new WeakMap,qi=new WeakMap,zt=new WeakMap,Sr=new WeakMap,N=new WeakSet,gn=function(){this._slotted=_r(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Tr=new WeakMap,Uo=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},vn=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},xn=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},yn=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Lr=new WeakMap,Cr=new WeakMap,Hi=function(e){this._active=e,this.updateComplete.then(()=>o(this,N,yn).call(this))},$n=new WeakMap,Ac=function(e,t){if(t.disabled){e.preventDefault();return}let s=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));s||e.preventDefault(),this.hide(!t.href||!s)},Dc=function(e,t){if(e.divider)return n`<div role="separator"></div>`;let s=`item${e.critical?" critical":""}${t===this._active?" active":""}`,l=n`${e.icon?n`<cm-icon name=${e.icon} size="16"></cm-icon>`:c}<span>${e.label}</span>`,d={over:()=>{e.disabled||(this._active=t)},click:p=>o(this,N,Ac).call(this,p,e)};return e.href&&!e.disabled?n`<a class=${s} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
|
|
1320
1320
|
@pointerenter=${d.over} @click=${d.click}>${l}</a>`:n`<button type="button" class=${s} part="item" role="menuitem" tabindex="-1" data-i=${t}
|
|
1321
1321
|
aria-disabled=${e.disabled?"true":c} @pointerenter=${d.over} @click=${d.click}>${l}</button>`},Oi.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},Oi.styles=[g,m`
|
|
1322
1322
|
:host { display: inline-block; position: relative; vertical-align: middle; }
|
|
@@ -1498,19 +1498,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1498
1498
|
.actions { gap: var(--cm-space-10); }
|
|
1499
1499
|
.children { margin-inline-start: var(--cm-space-20); }
|
|
1500
1500
|
}
|
|
1501
|
-
`],Oe.dragged=null;var _n=Oe;b("cm-nested-item",_n);var St,
|
|
1501
|
+
`],Oe.dragged=null;var _n=Oe;b("cm-nested-item",_n);var St,Tt,Bc,Wo,Fi=class extends y{constructor(){super(...arguments);h(this,Tt);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this._msg="";h(this,St,S("cm-nl"))}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}updated(e){e.has("sortable")&&o(this,Tt,Wo).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return n`
|
|
1502
1502
|
<div class="bar" part="bar">
|
|
1503
1503
|
<div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,St)}-h">${this.heading}</div>
|
|
1504
1504
|
<span class="actions"><slot name="actions"></slot></span>
|
|
1505
1505
|
${this.collapsible?n`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${r(this,St)}-rows"
|
|
1506
|
-
aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${o(this,
|
|
1506
|
+
aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${o(this,Tt,Bc)}>
|
|
1507
1507
|
<cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:c}
|
|
1508
1508
|
</div>
|
|
1509
1509
|
<div class="rows" id="${r(this,St)}-rows" role="list" aria-labelledby="${r(this,St)}-h" ?hidden=${!t}>
|
|
1510
|
-
<slot @slotchange=${()=>o(this,
|
|
1510
|
+
<slot @slotchange=${()=>o(this,Tt,Wo).call(this)}></slot>
|
|
1511
1511
|
</div>
|
|
1512
1512
|
<span class="sr" role="status">${this._msg}</span>
|
|
1513
|
-
`}};St=new WeakMap,
|
|
1513
|
+
`}};St=new WeakMap,Tt=new WeakSet,Bc=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Wo=function(){[...this.children].forEach(e=>{e.localName==="cm-nested-item"&&(e.sortable=this.sortable)})},Fi.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_msg:{state:!0}},Fi.styles=[g,m`
|
|
1514
1514
|
:host { display: block; }
|
|
1515
1515
|
.bar {
|
|
1516
1516
|
display: flex; align-items: center; gap: var(--cm-space-15); min-height: 90px; padding: 0 var(--cm-space-20);
|
|
@@ -1533,11 +1533,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1533
1533
|
.rows { margin-inline-start: var(--cm-space-10); }
|
|
1534
1534
|
.toggle { width: 30px; height: 30px; }
|
|
1535
1535
|
}
|
|
1536
|
-
`];b("cm-nested-list",Fi);var Ob=w("reportTile",{pinned:", pinned"}),
|
|
1536
|
+
`];b("cm-nested-list",Fi);var Ob=w("reportTile",{pinned:", pinned"}),Lt=class extends y{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=n`
|
|
1537
1537
|
<span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="58"></cm-icon></slot></span>
|
|
1538
1538
|
<span class="label">${this.label}</span>
|
|
1539
1539
|
${this.pinned?n`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:c}
|
|
1540
|
-
`;return this.href?n`<a class="tile" part="tile" href=${this.href}>${e}</a>`:n`<button class="tile" part="tile" type="button">${e}</button>`}};
|
|
1540
|
+
`;return this.href?n`<a class="tile" part="tile" href=${this.href}>${e}</a>`:n`<button class="tile" part="tile" type="button">${e}</button>`}};Lt.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Lt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Lt.styles=[g,m`
|
|
1541
1541
|
:host { display: block; }
|
|
1542
1542
|
.tile {
|
|
1543
1543
|
position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-20);
|
|
@@ -1557,7 +1557,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1557
1557
|
::slotted([slot='icon']) { width: 38px; height: 38px; }
|
|
1558
1558
|
.pin { top: 8px; inset-inline-end: 8px; }
|
|
1559
1559
|
}
|
|
1560
|
-
`];b("cm-report-tile",
|
|
1560
|
+
`];b("cm-report-tile",Lt);var Vi=class extends k{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return n`
|
|
1561
1561
|
${this.heading?n`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:c}
|
|
1562
1562
|
<div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":c}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
|
|
1563
1563
|
`}};Vi.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},Vi.styles=[g,m`
|
|
@@ -1570,8 +1570,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1570
1570
|
.title { margin-bottom: var(--cm-space-10); font-size: 14px; }
|
|
1571
1571
|
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-10); }
|
|
1572
1572
|
}
|
|
1573
|
-
`];b("cm-report-tiles",Vi);var Ui=class extends k{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return jc(this)}};Ui.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},Ui.styles=m`:host { display: none !important; }`;b("cm-nav-item",Ui);function jc(a){let i=s=>a.getAttribute(s),e={label:i("label")||""};i("icon")&&(e.icon=i("icon")),i("href")&&(e.href=i("href")),i("value")&&(e.value=i("value")),a.hasAttribute("current")&&(e.current=!0),i("badge")&&(e.badge=i("badge")),a.hasAttribute("expanded")&&(e.expanded=!0),a.hasAttribute("primary")&&(e.primary=!0);let t=qe(a);return t.length&&(e.items=t),e}var qe=a=>[...a.children].filter(i=>i.localName==="cm-nav-item").map(jc),Yo=a=>a.value||a.href||a.label,Sn=a=>!!a.current||!!a.items?.some(Sn),nt=(a,i)=>{let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},ot=(a,i)=>a.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:i,value:Yo(i),href:i.href??""}}));var
|
|
1574
|
-
data-side=${this._side}>${this.content}</div>`}};F=new WeakMap,Wi=new WeakMap,lt=new WeakMap,ct=new WeakMap,_e=new WeakMap,Yi=new WeakMap,Gi=new WeakMap,ce=new WeakSet,Go=function(){document.removeEventListener("keydown",r(this,Xi),!0),removeEventListener("scroll",r(this,Pe),!0),removeEventListener("resize",r(this,Pe))},
|
|
1573
|
+
`];b("cm-report-tiles",Vi);var Ui=class extends k{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return jc(this)}};Ui.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},Ui.styles=m`:host { display: none !important; }`;b("cm-nav-item",Ui);function jc(a){let i=s=>a.getAttribute(s),e={label:i("label")||""};i("icon")&&(e.icon=i("icon")),i("href")&&(e.href=i("href")),i("value")&&(e.value=i("value")),a.hasAttribute("current")&&(e.current=!0),i("badge")&&(e.badge=i("badge")),a.hasAttribute("expanded")&&(e.expanded=!0),a.hasAttribute("primary")&&(e.primary=!0);let t=qe(a);return t.length&&(e.items=t),e}var qe=a=>[...a.children].filter(i=>i.localName==="cm-nav-item").map(jc),Yo=a=>a.value||a.href||a.label,Sn=a=>!!a.current||!!a.items?.some(Sn),nt=(a,i)=>{let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},ot=(a,i)=>a.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:i,value:Yo(i),href:i.href??""}}));var Tn='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',F,Wi,lt,ct,_e,Yi,Gi,ce,Go,Ln,Cn,An,Dn,Xi,Fc,Ct,Xo,Jo,Pe,Ki=class extends k{constructor(){super(...arguments);h(this,ce);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";h(this,F);h(this,Wi);h(this,lt,[]);h(this,ct);h(this,_e);h(this,Yi,!1);h(this,Gi,!1);h(this,Ln,()=>{f(this,Yi,!0),clearTimeout(r(this,_e)),this.open||f(this,_e,setTimeout(()=>this.show(),this.delay))});h(this,Cn,()=>{f(this,Yi,!1),clearTimeout(r(this,_e)),r(this,Gi)||f(this,_e,setTimeout(()=>this.hide(),100))});h(this,An,()=>{f(this,Gi,!0),this.show()});h(this,Dn,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(f(this,Gi,!1),r(this,Yi)||this.hide())});h(this,Xi,e=>{e.key==="Escape"&&this.open&&this.hide()});h(this,Ct,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(o(this,ce,Jo).call(this),!t||!this.content||this.visualOnly)return;let s=t.updateComplete;t.localName.includes("-")&&s&&!t.shadowRoot?.querySelector(Tn)&&s.then(()=>{t.shadowRoot?.querySelector(Tn)&&r(this,Ct).call(this)}),r(this,F)||(f(this,F,document.createElement("span")),r(this,F).id=S("cm-tooltip"),r(this,F).hidden=!0,r(this,F).slot="description"),r(this,F).textContent=this.content,r(this,F).isConnected||this.append(r(this,F));let l=o(this,ce,Fc).call(this,t);if(f(this,Wi,l),l.getRootNode()===r(this,F).getRootNode()){let d=(l.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);d.includes(r(this,F).id)||l.setAttribute("aria-describedby",[...d,r(this,F).id].join(" "))}else"ariaDescribedByElements"in l?(o(this,ce,Xo).call(this,l),f(this,ct,new MutationObserver(()=>{l.getAttribute("aria-describedby")!==""&&o(this,ce,Xo).call(this,l)})),r(this,ct).observe(l,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,F).id)});h(this,Pe,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let l=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),d=e.getBoundingClientRect(),p=8,u=8,v=innerWidth,$=innerHeight,x=getComputedStyle(this).direction==="rtl",T=Ot=>Ot==="start"?x?"right":"left":Ot==="end"?x?"left":"right":Ot,M={top:l.top-p-d.height>=u,bottom:l.bottom+p+d.height<=$-u,left:l.left-p-d.width>=u,right:l.right+p+d.width<=v-u},C={top:"bottom",bottom:"top",left:"right",right:"left"},P=T(this.placement);!M[P]&&M[C[P]]&&(P=C[P]);let H,O;P==="top"||P==="bottom"?(H=l.left+l.width/2-d.width/2,O=P==="top"?l.top-p-d.height:l.bottom+p):(O=l.top+l.height/2-d.height/2,H=P==="left"?l.left-p-d.width:l.right+p),H=Math.min(Math.max(u,H),v-u-d.width),O=Math.min(Math.max(u,O),$-u-d.height),e.style.transform=`translate(${Math.round(H)}px, ${Math.round(O)}px)`;let Ht={top:"top",bottom:"bottom",left:x?"end":"start",right:x?"start":"end"};this._side=Ht[P]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,Ln)),this.addEventListener("pointerleave",r(this,Cn)),this.addEventListener("focusin",r(this,An)),this.addEventListener("focusout",r(this,Dn)),this.addEventListener("keydown",r(this,Xi)),this.hasUpdated&&r(this,Ct).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),o(this,ce,Jo).call(this),o(this,ce,Go).call(this),clearTimeout(r(this,_e))}show(){clearTimeout(r(this,_e)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,Xi),!0),addEventListener("scroll",r(this,Pe),!0),addEventListener("resize",r(this,Pe)),this.updateComplete.then(r(this,Pe)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,_e)),this.open&&(this.open=!1,o(this,ce,Go).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,Ct).call(this),this.content?this.open&&r(this,Pe).call(this):this.hide())}render(){return n`<slot @slotchange=${r(this,Ct)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
|
|
1574
|
+
data-side=${this._side}>${this.content}</div>`}};F=new WeakMap,Wi=new WeakMap,lt=new WeakMap,ct=new WeakMap,_e=new WeakMap,Yi=new WeakMap,Gi=new WeakMap,ce=new WeakSet,Go=function(){document.removeEventListener("keydown",r(this,Xi),!0),removeEventListener("scroll",r(this,Pe),!0),removeEventListener("resize",r(this,Pe))},Ln=new WeakMap,Cn=new WeakMap,An=new WeakMap,Dn=new WeakMap,Xi=new WeakMap,Fc=function(e){return e.matches(Tn)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Tn)??e},Ct=new WeakMap,Xo=function(e){f(this,lt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),s=r(this,lt).map(l=>t.getElementById(l)).filter(l=>!!l);e.ariaDescribedByElements=[...s,r(this,F)]},Jo=function(){let e=r(this,Wi);if(!(!e||!r(this,F))){if(r(this,ct))r(this,ct).disconnect(),f(this,ct,void 0),r(this,lt).length?e.setAttribute("aria-describedby",r(this,lt).join(" ")):e.removeAttribute("aria-describedby"),f(this,lt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(s=>s&&s!==r(this,F).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}f(this,Wi,void 0)}},Pe=new WeakMap,Ki.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Ki.styles=[g,m`
|
|
1575
1575
|
:host { display: inline-block; position: relative; }
|
|
1576
1576
|
.tip {
|
|
1577
1577
|
position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
|
|
@@ -1731,8 +1731,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1731
1731
|
header {
|
|
1732
1732
|
display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
|
|
1733
1733
|
}
|
|
1734
|
-
.logo { display: flex; align-items: center; flex:
|
|
1735
|
-
::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; }
|
|
1734
|
+
.logo { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
|
|
1735
|
+
::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; max-width: 100%; object-fit: contain; }
|
|
1736
1736
|
.store, .pill, .user {
|
|
1737
1737
|
display: inline-flex; align-items: center; gap: 8px; font: inherit; color: var(--cm-text-default);
|
|
1738
1738
|
background: none; cursor: pointer;
|
|
@@ -1793,6 +1793,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1793
1793
|
.user { padding: 2px; min-height: 0; border-color: transparent; }
|
|
1794
1794
|
.user .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
1795
1795
|
.avatar { --cm-avatar-size: 32px; }
|
|
1796
|
+
/* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
|
|
1797
|
+
.end { gap: 0; }
|
|
1796
1798
|
}
|
|
1797
1799
|
`];b("cm-header-bar",is);var wf=w("bottomNavigation",{label:"Main"}),Or,At,dl,Xc,as=class extends y{constructor(){super(...arguments);h(this,At);this.items=[];this.fixed=!1;this._slotted=[];h(this,Or)}connectedCallback(){super.connectedCallback(),o(this,At,dl).call(this),f(this,Or,nt(this,()=>o(this,At,dl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Or)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return n`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
1798
1800
|
<ul>${this.navItems.slice(0,5).map(e=>n`<li>${o(this,At,Xc).call(this,e)}</li>`)}</ul>
|
|
@@ -1817,7 +1819,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1817
1819
|
.icon { display: grid; place-items: center; width: 26px; height: 26px; }
|
|
1818
1820
|
.primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
|
|
1819
1821
|
.label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1820
|
-
`];b("cm-bottom-navigation",as);var
|
|
1822
|
+
`];b("cm-bottom-navigation",as);var Lf=w("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),qr,Dt,J,hl,Jc,pl,ml,Zc,ns=class extends y{constructor(){super(...arguments);h(this,J);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;h(this,qr);h(this,Dt,S("cm-mmenu"))}connectedCallback(){super.connectedCallback(),o(this,J,hl).call(this),f(this,qr,nt(this,()=>o(this,J,hl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,qr)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?n`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Dt)}-sub"
|
|
1821
1823
|
@keydown=${s=>{s.key==="Escape"&&(s.preventDefault(),this.back())}}>
|
|
1822
1824
|
<button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="18"></cm-icon>${t.label}</button>
|
|
1823
1825
|
<ul class="card" aria-label=${t.label}>${t.items.map(s=>n`<li>${o(this,J,ml).call(this,s,0,0,!0)}</li>`)}</ul>
|
|
@@ -2222,7 +2224,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2222
2224
|
:host([justify='center']) { justify-content: center; }
|
|
2223
2225
|
:host([justify='end']) { justify-content: flex-end; }
|
|
2224
2226
|
:host([justify='space-between']) { justify-content: space-between; }
|
|
2225
|
-
`,Ms("gap","gap")];b("cm-stack",_s);var dd="important",Jd=" !"+dd,hd=ga(class extends Bt{constructor(a){if(super(a),a.type!==
|
|
2227
|
+
`,Ms("gap","gap")];b("cm-stack",_s);var dd="important",Jd=" !"+dd,hd=ga(class extends Bt{constructor(a){if(super(a),a.type!==Le.ATTRIBUTE||a.name!=="style"||a.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(a){return Object.keys(a).reduce((i,e)=>{let t=a[e];return t==null?i:i+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(a,[i]){let{style:e}=a.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let t of this.ft)i[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in i){let s=i[t];if(s!=null){this.ft.add(t);let l=typeof s=="string"&&s.endsWith(Jd);t.includes("-")||l?e.setProperty(t,l?s.slice(0,-11):s,l?dd:""):e[t]=s}}return Q}});var zs=class extends k{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),s=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return n`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${hd({gridTemplateColumns:s})}><slot></slot></div>`}};zs.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},zs.styles=[g,m`
|
|
2226
2228
|
:host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
|
|
2227
2229
|
.grid { display: grid; gap: var(--_gap); align-items: start; }
|
|
2228
2230
|
@container cm-grid (max-width: 640px) {
|
|
@@ -2242,9 +2244,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2242
2244
|
::slotted([variant='one-third']) { grid-column: span 2; }
|
|
2243
2245
|
::slotted([variant='two-thirds']) { grid-column: span 4; }
|
|
2244
2246
|
}
|
|
2245
|
-
`,Ms("gap","--_gap")];var
|
|
2247
|
+
`,Ms("gap","--_gap")];var Ts=class extends k{constructor(){super(...arguments);this.variant="full"}render(){return n`<slot></slot>`}};Ts.properties={variant:{reflect:!0}},Ts.styles=[g,m`
|
|
2246
2248
|
:host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
|
|
2247
|
-
`];b("cm-layout",Ss);b("cm-layout-section",
|
|
2249
|
+
`];b("cm-layout",Ss);b("cm-layout-section",Ts);var xl=1024,Zd=()=>{let a=document.activeElement;for(;a?.shadowRoot?.activeElement;)a=a.shadowRoot.activeElement;return a},It,Cs,ae,yl,Rt,pd,Jr,Zr,Ls=class extends k{constructor(){super(...arguments);h(this,ae);this.menuOpen=!1;this.menuItem="";this._wide=!1;h(this,It);h(this,Cs,null);h(this,Jr,e=>{if(!this.menuItem)return;let t=o(this,ae,pd).call(this,e),s=e.detail?.value;t==="bottom-navigation"&&s===this.menuItem?o(this,ae,Rt).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&o(this,ae,Rt).call(this,!1,!1)});h(this,Zr,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),o(this,ae,Rt).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",r(this,Jr)),this.addEventListener("keydown",r(this,Zr));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=xl)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",r(this,Jr)),this.removeEventListener("keydown",r(this,Zr)),r(this,It)?.disconnect(),f(this,It,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;f(this,It,new ResizeObserver(()=>{o(this,ae,yl).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=xl!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=xl}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>r(this,It).observe(t))}updated(e){e.has("_wide")&&o(this,ae,yl).call(this)}openMenu(){o(this,ae,Rt).call(this,!0)}closeMenu(){o(this,ae,Rt).call(this,!1)}toggleMenu(){o(this,ae,Rt).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return n`<div class="frame ${e?"wide":""}" part="frame">
|
|
2248
2250
|
<div class="probe"></div>
|
|
2249
2251
|
<div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
|
|
2250
2252
|
<div class="body">
|
|
@@ -2253,7 +2255,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2253
2255
|
</div>
|
|
2254
2256
|
<div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
|
|
2255
2257
|
<div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation"></slot></div>
|
|
2256
|
-
</div>`}};It=new WeakMap,Cs=new WeakMap,ae=new WeakSet,yl=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=s=>Math.round(this.renderRoot.querySelector(s)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},Rt=function(e,t=!0){e!==this.menuOpen&&(e&&f(this,Cs,Zd()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let s=this.querySelector(':scope > [slot="mobile-menu"]');(s?.shadowRoot??s)?.querySelector("a[href], button")?.focus()}else t&&(r(this,Cs)?.focus(),f(this,Cs,null))}))},pd=function(e){return e.composedPath().find(s=>s.parentElement===this)?.getAttribute("slot")??""},Jr=new WeakMap,Zr=new WeakMap,
|
|
2258
|
+
</div>`}};It=new WeakMap,Cs=new WeakMap,ae=new WeakSet,yl=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=s=>Math.round(this.renderRoot.querySelector(s)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},Rt=function(e,t=!0){e!==this.menuOpen&&(e&&f(this,Cs,Zd()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let s=this.querySelector(':scope > [slot="mobile-menu"]');(s?.shadowRoot??s)?.querySelector("a[href], button")?.focus()}else t&&(r(this,Cs)?.focus(),f(this,Cs,null))}))},pd=function(e){return e.composedPath().find(s=>s.parentElement===this)?.getAttribute("slot")??""},Jr=new WeakMap,Zr=new WeakMap,Ls.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},Ls.styles=[g,m`
|
|
2257
2259
|
:host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
|
|
2258
2260
|
.header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
|
|
2259
2261
|
.body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
|
|
@@ -2274,7 +2276,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2274
2276
|
}
|
|
2275
2277
|
.probe { block-size: 0; }
|
|
2276
2278
|
[hidden] { display: none !important; }
|
|
2277
|
-
`];b("cm-app-frame",
|
|
2279
|
+
`];b("cm-app-frame",Ls);var As=class extends k{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return n`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};As.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},As.styles=[g,m`
|
|
2278
2280
|
:host { display: block; container: cm-page / inline-size; background: var(--cm-bg-page); min-block-size: 100%; }
|
|
2279
2281
|
.content {
|
|
2280
2282
|
box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
|
|
@@ -2328,7 +2330,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2328
2330
|
background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
|
|
2329
2331
|
}
|
|
2330
2332
|
img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
|
|
2331
|
-
`];b("cm-thumbnail",Rs);export{yi as CmAccordion,fi as CmActionBar,Oi as CmActionMenu,cs as CmAppCard,
|
|
2333
|
+
`];b("cm-thumbnail",Rs);export{yi as CmAccordion,fi as CmActionBar,Oi as CmActionMenu,cs as CmAppCard,Ls as CmAppFrame,es as CmAvatar,ks as CmBadge,Ds as CmBanner,as as CmBottomNavigation,ms as CmBottomSheet,bt as CmButton,Es as CmCard,Ke as CmCheckbox,Qe as CmCombobox,Mi as CmComment,_i as CmCommentBox,Ni as CmDataTable,tt as CmDatePicker,st as CmDateRangePicker,$i as CmEmptyState,at as CmFileUpload,hs as CmFilterPanel,os as CmFlashOfferBar,wt as CmGlobalSearch,zs as CmGrid,is as CmHeaderBar,Pt as CmIcon,xi as CmInfoItem,vi as CmInfoPanel,Ss as CmLayout,Ts as CmLayoutSection,ls as CmLinkTabs,y as CmLocalizedElement,Ii as CmMenuItem,ns as CmMobileMenu,ds as CmModal,Ui as CmNavItem,_n as CmNestedItem,Fi as CmNestedList,us as CmNotificationItem,bs as CmNotificationPanel,Et as CmOptionGroup,As as CmPage,bi as CmPageHeader,Ti as CmPagination,ws as CmProgressBar,vt as CmRadio,xt as CmRadioGroup,Lt as CmReportTile,Vi as CmReportTiles,Bi as CmResourceItem,ji as CmResourceList,gi as CmSaveBar,Je as CmSearch,Xe as CmSelect,Ji as CmSideNavigation,ze as CmSidePanel,ki as CmSkeleton,Ei as CmSkeletonDisplay,zi as CmSmartTip,Si as CmSmartTips,Jt as CmSpinner,_s as CmStack,Ci as CmStatusTabs,Ai as CmTableHeader,Xt as CmTag,Ve as CmTextField,Rs as CmThumbnail,vs as CmToast,xs as CmToastRegion,Ye as CmToggle,Ki as CmTooltip,Ld as configure,w as defineStrings,Kl as directionalIcons,we as formatDate,Fl as formatMessage,oo as formatNumber,Sd as getDefaultStrings,Gc as initials,Us as localeFor,pa as pluralCategory,Cd as resetStrings,oc as resolvePreset,Td as setStrings,Gd as showToast,Vl as translate};
|
|
2332
2334
|
/*! Bundled license information:
|
|
2333
2335
|
|
|
2334
2336
|
@lit/reactive-element/css-tag.js:
|
|
@@ -200,8 +200,8 @@ CmHeaderBar.styles = [
|
|
|
200
200
|
header {
|
|
201
201
|
display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
|
|
202
202
|
}
|
|
203
|
-
.logo { display: flex; align-items: center; flex:
|
|
204
|
-
::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; }
|
|
203
|
+
.logo { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
|
|
204
|
+
::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; max-width: 100%; object-fit: contain; }
|
|
205
205
|
.store, .pill, .user {
|
|
206
206
|
display: inline-flex; align-items: center; gap: 8px; font: inherit; color: var(--cm-text-default);
|
|
207
207
|
background: none; cursor: pointer;
|
|
@@ -262,6 +262,8 @@ CmHeaderBar.styles = [
|
|
|
262
262
|
.user { padding: 2px; min-height: 0; border-color: transparent; }
|
|
263
263
|
.user .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
264
264
|
.avatar { --cm-avatar-size: 32px; }
|
|
265
|
+
/* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
|
|
266
|
+
.end { gap: 0; }
|
|
265
267
|
}
|
|
266
268
|
`,
|
|
267
269
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Commmerce UI web components: build apps that feel native to the Commmerce admin. Works in plain HTML, React, Vue and server-rendered pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"test": "vitest run"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@commmerce/icons": "1.1.
|
|
54
|
-
"@commmerce/tokens": "1.1.
|
|
53
|
+
"@commmerce/icons": "1.1.1",
|
|
54
|
+
"@commmerce/tokens": "1.1.1",
|
|
55
55
|
"lit": "3.2.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|