@commmerce/ui 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar.d.ts +38 -0
- package/dist/calendar.js +109 -0
- package/dist/cdn.js +677 -450
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +25 -0
- package/dist/components/card.d.ts +5 -0
- package/dist/components/card.js +44 -5
- package/dist/components/date-picker.d.ts +49 -5
- package/dist/components/date-picker.js +211 -48
- package/dist/components/empty-state.d.ts +19 -4
- package/dist/components/empty-state.js +59 -5
- package/dist/components/metric.d.ts +97 -0
- package/dist/components/metric.js +168 -0
- package/dist/components/page-header.js +3 -2
- package/dist/components/resource-list.d.ts +14 -2
- package/dist/components/resource-list.js +48 -6
- package/dist/components/table-header.d.ts +14 -0
- package/dist/components/table-header.js +21 -0
- package/dist/components/text-field.d.ts +36 -2
- package/dist/components/text-field.js +86 -14
- package/dist/components/timeline.d.ts +210 -0
- package/dist/components/timeline.js +380 -0
- package/dist/custom-elements.json +5102 -3386
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/package.json +3 -3
package/dist/cdn.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(r,a,e)=>(No(r,a,"read from private field"),e?e.call(r):a.get(r)),h=(r,a,e)=>a.has(r)?gc("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(r):a.set(r,e),b=(r,a,e,t)=>(No(r,a,"write to private field"),t?t.call(r,e):a.set(r,e),e),n=(r,a,e)=>(No(r,a,"access private method"),e);var Ar=globalThis,Dr=Ar.ShadowRoot&&(Ar.ShadyCSS===void 0||Ar.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Io=Symbol(),vc=new WeakMap,na=class{constructor(a,e,t){if(this._$cssResult$=!0,t!==Io)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a,this.t=e}get styleSheet(){let a=this.o,e=this.t;if(Dr&&a===void 0){let t=e!==void 0&&e.length===1;t&&(a=vc.get(e)),a===void 0&&((this.o=a=new CSSStyleSheet).replaceSync(this.cssText),t&&vc.set(e,a))}return a}toString(){return this.cssText}},Nr=r=>new na(typeof r=="string"?r:r+"",void 0,Io),u=(r,...a)=>{let e=r.length===1?r[0]:a.reduce((t,i,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.")})(i)+r[l+1],r[0]);return new na(e,r,Io)},xc=(r,a)=>{if(Dr)r.adoptedStyleSheets=a.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of a){let t=document.createElement("style"),i=Ar.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,r.appendChild(t)}},Ho=Dr?r=>r:r=>r instanceof CSSStyleSheet?(a=>{let e="";for(let t of a.cssRules)e+=t.cssText;return Nr(e)})(r):r;var{is:kh,defineProperty:Eh,getOwnPropertyDescriptor:Mh,getOwnPropertyNames:_h,getOwnPropertySymbols:zh,getPrototypeOf:Th}=Object,Ir=globalThis,yc=Ir.trustedTypes,Sh=yc?yc.emptyScript:"",Lh=Ir.reactiveElementPolyfillSupport,oa=(r,a)=>r,Ro={toAttribute(r,a){switch(a){case Boolean:r=r?Sh:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,a){let e=r;switch(a){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},$c=(r,a)=>!kh(r,a),wc={attribute:!0,type:String,converter:Ro,reflect:!1,useDefault:!1,hasChanged:$c};Symbol.metadata??=Symbol("metadata"),Ir.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(a){this._$Ei(),(this.l??=[]).push(a)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(a,e=wc){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(a)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(a,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(a,t,e);i!==void 0&&Eh(this.prototype,a,i)}}static getPropertyDescriptor(a,e,t){let{get:i,set:l}=Mh(this.prototype,a)??{get(){return this[e]},set(d){this[e]=d}};return{get:i,set(d){let p=i?.call(this);l?.call(this,d),this.requestUpdate(a,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(a){return this.elementProperties.get(a)??wc}static _$Ei(){if(this.hasOwnProperty(oa("elementProperties")))return;let a=Th(this);a.finalize(),a.l!==void 0&&(this.l=[...a.l]),this.elementProperties=new Map(a.elementProperties)}static finalize(){if(this.hasOwnProperty(oa("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(oa("properties"))){let e=this.properties,t=[..._h(e),...zh(e)];for(let i of t)this.createProperty(i,e[i])}let a=this[Symbol.metadata];if(a!==null){let e=litPropertyMetadata.get(a);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(a){let e=[];if(Array.isArray(a)){let t=new Set(a.flat(1/0).reverse());for(let i of t)e.unshift(Ho(i))}else a!==void 0&&e.push(Ho(a));return e}static _$Eu(a,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof a=="string"?a.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(a=>this.enableUpdating=a),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(a=>a(this))}addController(a){(this._$EO??=new Set).add(a),this.renderRoot!==void 0&&this.isConnected&&a.hostConnected?.()}removeController(a){this._$EO?.delete(a)}_$E_(){let a=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(a.set(t,this[t]),delete this[t]);a.size>0&&(this._$Ep=a)}createRenderRoot(){let a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xc(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(a=>a.hostConnected?.())}enableUpdating(a){}disconnectedCallback(){this._$EO?.forEach(a=>a.hostDisconnected?.())}attributeChangedCallback(a,e,t){this._$AK(a,t)}_$ET(a,e){let t=this.constructor.elementProperties.get(a),i=this.constructor._$Eu(a,t);if(i!==void 0&&t.reflect===!0){let l=(t.converter?.toAttribute!==void 0?t.converter:Ro).toAttribute(e,t.type);this._$Em=a,l==null?this.removeAttribute(i):this.setAttribute(i,l),this._$Em=null}}_$AK(a,e){let t=this.constructor,i=t._$Eh.get(a);if(i!==void 0&&this._$Em!==i){let l=t.getPropertyOptions(i),d=typeof l.converter=="function"?{fromAttribute:l.converter}:l.converter?.fromAttribute!==void 0?l.converter:Ro;this._$Em=i;let p=d.fromAttribute(e,l.type);this[i]=p??this._$Ej?.get(i)??p,this._$Em=null}}requestUpdate(a,e,t,i=!1,l){if(a!==void 0){let d=this.constructor;if(i===!1&&(l=this[a]),t??=d.getPropertyOptions(a),!((t.hasChanged??$c)(l,e)||t.useDefault&&t.reflect&&l===this._$Ej?.get(a)&&!this.hasAttribute(d._$Eu(a,t))))return;this.C(a,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(a,e,{useDefault:t,reflect:i,wrapped:l},d){t&&!(this._$Ej??=new Map).has(a)&&(this._$Ej.set(a,d??e??this[a]),l!==!0||d!==void 0)||(this._$AL.has(a)||(this.hasUpdated||t||(e=void 0),this._$AL.set(a,e)),i===!0&&this._$Em!==a&&(this._$Eq??=new Set).add(a))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let a=this.scheduleUpdate();return a!=null&&await a,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,l]of this._$Ep)this[i]=l;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,l]of t){let{wrapped:d}=l,p=this[i];d!==!0||this._$AL.has(i)||p===void 0||this.C(i,void 0,l,p)}}let a=!1,e=this._$AL;try{a=this.shouldUpdate(e),a?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw a=!1,this._$EM(),t}a&&this._$AE(e)}willUpdate(a){}_$AE(a){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(a)),this.updated(a)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(a){return!0}update(a){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(a){}firstUpdated(a){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[oa("elementProperties")]=new Map,Ne[oa("finalized")]=new Map,Lh?.({ReactiveElement:Ne}),(Ir.reactiveElementVersions??=[]).push("2.1.2");var qo=globalThis,kc=r=>r,Hr=qo.trustedTypes,Ec=Hr?Hr.createPolicy("lit-html",{createHTML:r=>r}):void 0,Po="$lit$",Ie=`lit$${Math.random().toFixed(9).slice(2)}$`,Bo="?"+Ie,Ch=`<${Bo}>`,kt=document,ca=()=>kt.createComment(""),da=r=>r===null||typeof r!="object"&&typeof r!="function",Fo=Array.isArray,Lc=r=>Fo(r)||typeof r?.[Symbol.iterator]=="function",Oo=`[
|
|
2
|
+
\f\r]`,la=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mc=/-->/g,_c=/>/g,wt=RegExp(`>|${Oo}(?:([^\\s"'>=/]+)(${Oo}*=${Oo}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),zc=/'/g,Tc=/"/g,Cc=/^(?:script|style|textarea|title)$/i,jo=r=>(a,...e)=>({_$litType$:r,strings:a,values:e}),o=jo(1),pa=jo(2),up=jo(3),ae=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Sc=new WeakMap,$t=kt.createTreeWalker(kt,129);function Ac(r,a){if(!Fo(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ec!==void 0?Ec.createHTML(a):a}var Dc=(r,a)=>{let e=r.length-1,t=[],i,l=a===2?"<svg>":a===3?"<math>":"",d=la;for(let p=0;p<e;p++){let m=r[p],x,$,y=-1,T=0;for(;T<m.length&&(d.lastIndex=T,$=d.exec(m),$!==null);)T=d.lastIndex,d===la?$[1]==="!--"?d=Mc:$[1]!==void 0?d=_c:$[2]!==void 0?(Cc.test($[2])&&(i=RegExp("</"+$[2],"g")),d=wt):$[3]!==void 0&&(d=wt):d===wt?$[0]===">"?(d=i??la,y=-1):$[1]===void 0?y=-2:(y=d.lastIndex-$[2].length,x=$[1],d=$[3]===void 0?wt:$[3]==='"'?Tc:zc):d===Tc||d===zc?d=wt:d===Mc||d===_c?d=la:(d=wt,i=void 0);let M=d===wt&&r[p+1].startsWith("/>")?" ":"";l+=d===la?m+Ch:y>=0?(t.push(x),m.slice(0,y)+Po+m.slice(y)+Ie+M):m+Ie+(y===-2?p:M)}return[Ac(r,l+(r[e]||"<?>")+(a===2?"</svg>":a===3?"</math>":"")),t]},ha=class r{constructor({strings:a,_$litType$:e},t){let i;this.parts=[];let l=0,d=0,p=a.length-1,m=this.parts,[x,$]=Dc(a,e);if(this.el=r.createElement(x,t),$t.currentNode=this.el.content,e===2||e===3){let y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=$t.nextNode())!==null&&m.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(let y of i.getAttributeNames())if(y.endsWith(Po)){let T=$[d++],M=i.getAttribute(y).split(Ie),_=/([.?@])?(.*)/.exec(T);m.push({type:1,index:l,name:_[2],strings:M,ctor:_[1]==="."?Or:_[1]==="?"?qr:_[1]==="@"?Pr:Mt}),i.removeAttribute(y)}else y.startsWith(Ie)&&(m.push({type:6,index:l}),i.removeAttribute(y));if(Cc.test(i.tagName)){let y=i.textContent.split(Ie),T=y.length-1;if(T>0){i.textContent=Hr?Hr.emptyScript:"";for(let M=0;M<T;M++)i.append(y[M],ca()),$t.nextNode(),m.push({type:2,index:++l});i.append(y[T],ca())}}}else if(i.nodeType===8)if(i.data===Bo)m.push({type:2,index:l});else{let y=-1;for(;(y=i.data.indexOf(Ie,y+1))!==-1;)m.push({type:7,index:l}),y+=Ie.length-1}l++}}static createElement(a,e){let t=kt.createElement("template");return t.innerHTML=a,t}};function Et(r,a,e=r,t){if(a===ae)return a;let i=t!==void 0?e._$Co?.[t]:e._$Cl,l=da(a)?void 0:a._$litDirective$;return i?.constructor!==l&&(i?._$AO?.(!1),l===void 0?i=void 0:(i=new l(r),i._$AT(r,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(a=Et(r,i._$AS(r,a.values),i,t)),a}var Rr=class{constructor(a,e){this._$AV=[],this._$AN=void 0,this._$AD=a,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(a){let{el:{content:e},parts:t}=this._$AD,i=(a?.creationScope??kt).importNode(e,!0);$t.currentNode=i;let l=$t.nextNode(),d=0,p=0,m=t[0];for(;m!==void 0;){if(d===m.index){let x;m.type===2?x=new ai(l,l.nextSibling,this,a):m.type===1?x=new m.ctor(l,m.name,m.strings,this,a):m.type===6&&(x=new Br(l,this,a)),this._$AV.push(x),m=t[++p]}d!==m?.index&&(l=$t.nextNode(),d++)}return $t.currentNode=kt,i}p(a){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(a,t,e),e+=t.strings.length-2):t._$AI(a[e])),e++}},ai=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(a,e,t,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=a,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let a=this._$AA.parentNode,e=this._$AM;return e!==void 0&&a?.nodeType===11&&(a=e.parentNode),a}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(a,e=this){a=Et(this,a,e),da(a)?a===c||a==null||a===""?(this._$AH!==c&&this._$AR(),this._$AH=c):a!==this._$AH&&a!==ae&&this._(a):a._$litType$!==void 0?this.$(a):a.nodeType!==void 0?this.T(a):Lc(a)?this.k(a):this._(a)}O(a){return this._$AA.parentNode.insertBefore(a,this._$AB)}T(a){this._$AH!==a&&(this._$AR(),this._$AH=this.O(a))}_(a){this._$AH!==c&&da(this._$AH)?this._$AA.nextSibling.data=a:this.T(kt.createTextNode(a)),this._$AH=a}$(a){let{values:e,_$litType$:t}=a,i=typeof t=="number"?this._$AC(a):(t.el===void 0&&(t.el=ha.createElement(Ac(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let l=new Rr(i,this),d=l.u(this.options);l.p(e),this.T(d),this._$AH=l}}_$AC(a){let e=Sc.get(a.strings);return e===void 0&&Sc.set(a.strings,e=new ha(a)),e}k(a){Fo(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let l of a)i===e.length?e.push(t=new r(this.O(ca()),this.O(ca()),this,this.options)):t=e[i],t._$AI(l),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(a=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);a!==this._$AB;){let t=kc(a).nextSibling;kc(a).remove(),a=t}}setConnected(a){this._$AM===void 0&&(this._$Cv=a,this._$AP?.(a))}},Mt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(a,e,t,i,l){this.type=1,this._$AH=c,this._$AN=void 0,this.element=a,this.name=e,this._$AM=i,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(a,e=this,t,i){let l=this.strings,d=!1;if(l===void 0)a=Et(this,a,e,0),d=!da(a)||a!==this._$AH&&a!==ae,d&&(this._$AH=a);else{let p=a,m,x;for(a=l[0],m=0;m<l.length-1;m++)x=Et(this,p[t+m],e,m),x===ae&&(x=this._$AH[m]),d||=!da(x)||x!==this._$AH[m],x===c?a=c:a!==c&&(a+=(x??"")+l[m+1]),this._$AH[m]=x}d&&!i&&this.j(a)}j(a){a===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,a??"")}},Or=class extends Mt{constructor(){super(...arguments),this.type=3}j(a){this.element[this.name]=a===c?void 0:a}},qr=class extends Mt{constructor(){super(...arguments),this.type=4}j(a){this.element.toggleAttribute(this.name,!!a&&a!==c)}},Pr=class extends Mt{constructor(a,e,t,i,l){super(a,e,t,i,l),this.type=5}_$AI(a,e=this){if((a=Et(this,a,e,0)??c)===ae)return;let t=this._$AH,i=a===c&&t!==c||a.capture!==t.capture||a.once!==t.once||a.passive!==t.passive,l=a!==c&&(t===c||i);i&&this.element.removeEventListener(this.name,this,t),l&&this.element.addEventListener(this.name,this,a),this._$AH=a}handleEvent(a){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,a):this._$AH.handleEvent(a)}},Br=class{constructor(a,e,t){this.element=a,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(a){Et(this,a)}},Nc={M:Po,P:Ie,A:Bo,C:1,L:Dc,R:Rr,D:Lc,V:Et,I:ai,H:Mt,N:qr,U:Pr,B:Or,F:Br},Ah=qo.litHtmlPolyfillSupport;Ah?.(ha,ai),(qo.litHtmlVersions??=[]).push("3.3.3");var Ic=(r,a,e)=>{let t=e?.renderBefore??a,i=t._$litPart$;if(i===void 0){let l=e?.renderBefore??null;t._$litPart$=i=new ai(a.insertBefore(ca(),l),l,void 0,e??{})}return i._$AI(r),i};var Vo=globalThis,E=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let a=super.createRenderRoot();return this.renderOptions.renderBefore??=a.firstChild,a}update(a){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(a),this._$Do=Ic(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};E._$litElement$=!0,E.finalized=!0,Vo.litElementHydrateSupport?.({LitElement:E});var Dh=Vo.litElementPolyfillSupport;Dh?.({LitElement:E});(Vo.litElementVersions??=[]).push("4.2.2");var v=u`
|
|
4
4
|
:host {
|
|
5
5
|
font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif);
|
|
6
6
|
color: var(--cm-text-default, #000);
|
|
@@ -8,20 +8,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
8
8
|
}
|
|
9
9
|
:host([hidden]) { display: none !important; }
|
|
10
10
|
*, *::before, *::after { box-sizing: inherit; }
|
|
11
|
-
`,
|
|
11
|
+
`,Tp=u`
|
|
12
12
|
outline: 2px solid var(--cm-border-strong);
|
|
13
13
|
outline-offset: 2px;
|
|
14
|
-
`,
|
|
14
|
+
`,Nh=0,S=r=>`${r}-${++Nh}`;function f(r,a){customElements.get(r)||customElements.define(r,a)}function fe(r,a){let e=r.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(a).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var Ih={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Fr={common:{...Ih}},ma={},ua={},jr;function k(r,a){return Fr[r]={...Fr[r],...a},a}function Hh(){return Object.fromEntries(Object.entries(Fr).map(([r,a])=>[r,{...a}]))}function Vr(r,a){for(let[e,t]of Object.entries(a??{}))t&&typeof t=="object"&&(r[e]={...r[e],...t})}function Rh(r,a){Vr(a?ua[a.toLowerCase()]??={}:ma,r),Kr()}function Oh(r={}){"locale"in r&&(jr=r.locale||void 0),r.strings&&Vr(ma,r.strings);for(let[a,e]of Object.entries(r.translations??{}))Vr(ua[a.toLowerCase()]??={},e);Kr()}function qh(){jr=void 0;for(let r of Object.keys(ma))delete ma[r];for(let r of Object.keys(ua))delete ua[r];Kr()}function ba(r){if(jr)return jr;let a=r;for(;a;){if(a instanceof Element&&a.hasAttribute("lang")&&a.getAttribute("lang"))return a.getAttribute("lang");a=a.parentNode??(a instanceof ShadowRoot?a.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var Hc=new Map;function Wo(r,a,e,t){let i=`${r}|${a??""}|${JSON.stringify(e)}`,l=Hc.get(i);if(!l){try{l=t(a)}catch{l=t(void 0)}Hc.set(i,l)}return l}function Yo(r,a={},e){return Wo("n",e,a,t=>new Intl.NumberFormat(t,a)).format(r)}function V(r,a={},e){return Wo("d",e,a,t=>new Intl.DateTimeFormat(t,a)).format(r)}function Ur(r,a){return Wo("p",a,{},e=>new Intl.PluralRules(e)).select(r)}function Rc(r,a={},e){if(r==null)return"";if(typeof r=="function")return String(r(a));let t;if(typeof r=="object"){let i=Number(a.count??0);t=r[Ur(i,e)]??r.other??""}else t=String(r);return t.replace(/\{(\w+)\}/g,(i,l)=>{let d=a[l];return d===void 0?i:typeof d=="number"?Yo(d,{},e):String(d)})}function Ph(r,a,e,t){if(t&&t[a]!==void 0)return t[a];let i=[];if(e){let l=e.toLowerCase().split("-");for(let d=l.length;d>0;d--)i.push(l.slice(0,d).join("-"))}for(let l of r==="common"?["common"]:[r,"common"]){for(let p of i){let m=ua[p]?.[l]?.[a];if(m!==void 0)return m}let d=ma[l]?.[a]??Fr[l]?.[a];if(d!==void 0)return d}}function Oc(r,a,e,t,i){let l=ba(t);return Rc(Ph(r,a,l,i),e,l)}var Ko=new Set,Uo;function Kr(){for(let r of Ko)r.requestUpdate()}function Bh(){Uo||typeof MutationObserver>"u"||typeof document>"u"||(Uo=new MutationObserver(Kr),Uo.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Fh=r=>r.replace(/^cm-/,"").replace(/-([a-z])/g,(a,e)=>e.toUpperCase()),w=class extends E{static finalize(){let a=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!a(this,"finalized")&&a(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||a(this.prototype,e))continue;let l=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[l]??this.t(i)},set(d){this[l]=d},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Fh(this.localName)}t(a,e){return Oc(this.stringsNamespace,a,e,this,this.strings)}get locale(){return ba(this)}formatNumber(a,e){return Yo(a,e,this.locale)}connectedCallback(){super.connectedCallback(),Ko.add(this),Bh()}disconnectedCallback(){super.disconnectedCallback(),Ko.delete(this)}};w.properties={strings:{type:Object}};var Wr={"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",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z"},qc=["more","drag"],Ap=Object.keys(Wr);var Pc=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],ri=class extends E{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=Wr[this.name]??Wr.more,t=qc.includes(this.name)?3:1.6;return pa`<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
|
-
part="svg" class=${(this.mirror==="auto"?
|
|
17
|
+
part="svg" class=${(this.mirror==="auto"?Pc.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};ri.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},ri.styles=u`
|
|
18
18
|
:host { display: inline-flex; flex: none; color: inherit; line-height: 0; }
|
|
19
19
|
svg { display: block; }
|
|
20
20
|
:host(:dir(rtl)) svg.flip { transform: scaleX(-1); }
|
|
21
|
-
`;
|
|
22
|
-
rel=${this.target==="_blank"?"noopener noreferrer":c} aria-label=${
|
|
21
|
+
`;f("cm-icon",ri);var Bc=99,Bp=k("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),Yr,Gr,fa,_t=class extends w{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;h(this,Yr,this.attachInternals());h(this,Gr,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=s(this,Yr).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});h(this,fa,!1);this.addEventListener("click",s(this,Gr),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!s(this,fa)&&(b(this,fa,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.size==="large"?20:16,i=this.loading?o`<span class="spinner" aria-hidden="true"></span>`:o`<slot name="icon">${this.icon?o`<cm-icon name=${this.icon} size=${t}></cm-icon>`:c}</slot>`,l=this.iconOnly?o`<span class="vh"><slot></slot></span>`:o`<slot></slot>`,d=e?o`<span class="count" part="count" aria-hidden="true">${e>Bc?this.t("countOverflow",{max:Bc}):this.formatNumber(e)}</span>${this.iconOnly?c:o`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:c,p=this.iconOnly&&(this.label||this.textContent?.trim())||"",m=!this.iconOnly||!p?c:e?this.t("labelWithCount",{label:p,count:e}):this.label||c,x=o`${i}${l}${d}`;return this.href&&!this.disabled?o`<a class="btn" part="control" href=${this.href} target=${this.target??c}
|
|
22
|
+
rel=${this.target==="_blank"?"noopener noreferrer":c} aria-label=${m}>${x}</a>`:o`<button class="btn" part="control" type="button"
|
|
23
23
|
?disabled=${this.disabled} aria-disabled=${this.loading?"true":c}
|
|
24
|
-
aria-busy=${this.loading?"true":c} aria-label=${
|
|
24
|
+
aria-busy=${this.loading?"true":c} aria-label=${m}>${x}</button>`}};Yr=new WeakMap,Gr=new WeakMap,fa=new WeakMap,_t.formAssociated=!0,_t.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},_t.styles=[v,u`
|
|
25
25
|
:host { display: inline-flex; vertical-align: middle; }
|
|
26
26
|
.btn {
|
|
27
27
|
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
@@ -41,6 +41,29 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
41
41
|
:host([disabled]) .btn, :host([loading]) .btn {
|
|
42
42
|
background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed;
|
|
43
43
|
}
|
|
44
|
+
/* Tones (1.2). Secondary sits on bg-surface, not bg-hover: text-critical on bg-hover is under 4.5:1 in dark.
|
|
45
|
+
Success has no border token: its outline is text-success (4.8:1 or more on every surface; icon-success is 2.9:1 on bg-page).
|
|
46
|
+
Primary fills with the tone's text colour and takes action-primary-text, like the black primary (5.1:1 or more).
|
|
47
|
+
Hover darkens it towards text-default, which only raises the label's contrast. Pairs: packages/tokens/scripts/contrast.mjs. */
|
|
48
|
+
:host([tone='critical']:not([variant='primary']):not([disabled]):not([loading])) .btn {
|
|
49
|
+
background: var(--cm-bg-surface); color: var(--cm-text-critical); border-color: var(--cm-border-critical);
|
|
50
|
+
}
|
|
51
|
+
:host([tone='critical']:not([variant='primary']):not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-critical); }
|
|
52
|
+
:host([tone='success']:not([variant='primary']):not([disabled]):not([loading])) .btn {
|
|
53
|
+
background: var(--cm-bg-surface); color: var(--cm-text-success); border-color: var(--cm-text-success);
|
|
54
|
+
}
|
|
55
|
+
:host([tone='success']:not([variant='primary']):not([disabled]):not([loading])) .btn:hover {
|
|
56
|
+
background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)) var(--cm-bg-surface);
|
|
57
|
+
}
|
|
58
|
+
:host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn { --_tone: var(--cm-text-critical); }
|
|
59
|
+
:host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn { --_tone: var(--cm-text-success); }
|
|
60
|
+
:host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn, :host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn {
|
|
61
|
+
background: var(--_tone); border-color: var(--_tone); color: var(--cm-action-primary-text);
|
|
62
|
+
}
|
|
63
|
+
:host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn:hover, :host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn:hover {
|
|
64
|
+
background: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default));
|
|
65
|
+
border-color: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default));
|
|
66
|
+
}
|
|
44
67
|
.btn:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
45
68
|
.spinner {
|
|
46
69
|
width: 1em; height: 1em; border-radius: 50%;
|
|
@@ -69,21 +92,22 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
69
92
|
position: absolute; inset-block-start: -7px; inset-inline-end: -7px;
|
|
70
93
|
box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
|
|
71
94
|
}
|
|
72
|
-
`];
|
|
73
|
-
.value=${
|
|
95
|
+
`];f("cm-button",_t);var He={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Xr=r=>(...a)=>({_$litDirective$:r,values:a}),ni=class{constructor(a){}get _$AU(){return this._$AM._$AU}_$AT(a,e,t){this._$Ct=a,this._$AM=e,this._$Ci=t}_$AS(a,e){return this.update(a,e)}update(a,e){return this.render(...e)}};var{I:Kp}=Nc;var Fc=r=>r.strings===void 0;var jh={},jc=(r,a=jh)=>r._$AH=a;var re=Xr(class extends ni{constructor(r){if(super(r),r.type!==He.PROPERTY&&r.type!==He.ATTRIBUTE&&r.type!==He.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Fc(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[a]){if(a===ae||a===c)return a;let e=r.element,t=r.name;if(r.type===He.PROPERTY){if(a===e[t])return ae}else if(r.type===He.BOOLEAN_ATTRIBUTE){if(!!a===e.hasAttribute(t))return ae}else if(r.type===He.ATTRIBUTE&&e.getAttribute(t)===a+"")return ae;return jc(r),a}});var rm=k("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time."}),Y,Re,va,B,ga,Jr,Vc,Go,Uc,Xo,et=class extends w{constructor(){super(...arguments);h(this,B);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,Y,this.attachInternals());h(this,Re,S("cm-tf"));h(this,va,"")}connectedCallback(){super.connectedCallback(),b(this,va,this.value)}get form(){return s(this,Y).form}get validity(){return s(this,Y).validity}get validationMessage(){return s(this,Y).validationMessage}checkValidity(){return n(this,B,ga).call(this),s(this,Y).checkValidity()}reportValidity(){return n(this,B,ga).call(this),s(this,Y).reportValidity()}formResetCallback(){this.value=s(this,va),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){s(this,Y).setFormValue(this.value),n(this,B,ga).call(this)}render(){let e=[this.error&&`${s(this,Re)}-err`,this.helpText&&`${s(this,Re)}-help`].filter(Boolean).join(" ")||c,t={id:s(this,Re),invalid:this.error?"true":c},i=this.multiline?o`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
|
|
96
|
+
.value=${re(this.value)} placeholder=${this.placeholder||c}
|
|
74
97
|
?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
|
|
75
98
|
aria-invalid=${t.invalid} aria-describedby=${e}
|
|
76
|
-
@input=${
|
|
77
|
-
.value=${
|
|
99
|
+
@input=${n(this,B,Go)} @change=${n(this,B,Xo)}></textarea>`:o`<input class="input" part="input" id=${t.id} type=${this.type}
|
|
100
|
+
.value=${re(this.value)} placeholder=${this.placeholder||c}
|
|
78
101
|
autocomplete=${this.autocomplete??c}
|
|
102
|
+
min=${this.min||c} max=${this.max||c} step=${this.step||c}
|
|
79
103
|
?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
|
|
80
104
|
aria-invalid=${t.invalid} aria-describedby=${e}
|
|
81
|
-
@input=${
|
|
82
|
-
${this.label?
|
|
83
|
-
${
|
|
84
|
-
${this.error?
|
|
85
|
-
${this.helpText?
|
|
86
|
-
</div>`}};
|
|
105
|
+
@input=${n(this,B,Go)} @change=${n(this,B,Xo)} @blur=${n(this,B,Uc)} />`;return o`<div class="field">
|
|
106
|
+
${this.label?o`<label for=${s(this,Re)} part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}${this.hint?o`<span class="hint">[${this.hint}]</span>`:c}</label>`:c}
|
|
107
|
+
${i}
|
|
108
|
+
${this.error?o`<p class="error" id="${s(this,Re)}-err" role="alert">${this.error}</p>`:c}
|
|
109
|
+
${this.helpText?o`<p class="help" id="${s(this,Re)}-help">${this.helpText}</p>`:c}
|
|
110
|
+
</div>`}};Y=new WeakMap,Re=new WeakMap,va=new WeakMap,B=new WeakSet,ga=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?s(this,Y).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?s(this,Y).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.required&&!this.value?s(this,Y).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.rangeUnderflow?s(this,Y).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:n(this,B,Jr).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?s(this,Y).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:n(this,B,Jr).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?s(this,Y).setValidity({stepMismatch:!0},this.t("stepMismatch",n(this,B,Vc).call(this,e)),e??void 0):s(this,Y).setValidity({})},Jr=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let d=/^(\d{2}):(\d{2})/.exec(e);return d?V(new Date(2e3,0,1,+d[1],+d[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let l=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?V(l,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):V(l,{day:"numeric",month:"short",year:"numeric"},t)},Vc=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),l=e.valueAsNumber,d=document.createElement("input");d.type=this.type,d.value=this.min??"";let p=Number.isFinite(d.valueAsNumber)?d.valueAsNumber:0,m=p+Math.floor((l-p)/i)*i,x=$=>{if(this.type==="number")return this.formatNumber(Number($.toPrecision(12)));let T=new Date($).toISOString();return n(this,B,Jr).call(this,this.type==="time"?T.slice(11,16):this.type==="date"?T.slice(0,10):T.slice(0,16))};return{lower:x(m),upper:x(m+i)}},Go=function(e){this.value=e.target.value},Uc=function(){n(this,B,ga).call(this)},Xo=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},et.formAssociated=!0,et.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},et.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0},min:{},max:{},step:{}},et.styles=[v,u`
|
|
87
111
|
:host { display: block; }
|
|
88
112
|
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
89
113
|
label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
@@ -106,13 +130,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
106
130
|
:host([size='small']) .field { gap: 6px; }
|
|
107
131
|
:host([size='small']) label { font-size: 12px; }
|
|
108
132
|
:host([size='small']) .input { font-size: 14px; }
|
|
109
|
-
`];
|
|
110
|
-
<input type="checkbox" id=${
|
|
133
|
+
`];f("cm-text-field",et);var hm=k("checkbox",{required:"Please tick this box."}),it,zt,xa,Zr,Kc,tt=class extends w{constructor(){super(...arguments);h(this,Zr);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;h(this,it,this.attachInternals());h(this,zt,S("cm-cb"));h(this,xa,!1)}connectedCallback(){super.connectedCallback(),b(this,xa,this.checked)}get form(){return s(this,it).form}checkValidity(){return s(this,it).checkValidity()}formResetCallback(){this.checked=s(this,xa)}formDisabledCallback(e){this.disabled=e}updated(){s(this,it).setFormValue(this.checked?this.value:null),this.required&&!this.checked?s(this,it).setValidity({valueMissing:!0},this.t("required")):s(this,it).setValidity({})}render(){let e=this.indeterminate?o`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:o`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return o`<label for=${s(this,zt)}>
|
|
134
|
+
<input type="checkbox" id=${s(this,zt)} .checked=${this.checked} .indeterminate=${this.indeterminate}
|
|
111
135
|
?disabled=${this.disabled} ?required=${this.required}
|
|
112
|
-
aria-describedby=${this.description?`${
|
|
136
|
+
aria-describedby=${this.description?`${s(this,zt)}-d`:c} @change=${n(this,Zr,Kc)} />
|
|
113
137
|
<span class="box" part="box">${e}</span>
|
|
114
|
-
${this.label||this.description?
|
|
115
|
-
</label>`}};
|
|
138
|
+
${this.label||this.description?o`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?o`<span class="desc" id="${s(this,zt)}-d">${this.description}</span>`:c}</span>`:o`<slot></slot>`}
|
|
139
|
+
</label>`}};it=new WeakMap,zt=new WeakMap,xa=new WeakMap,Zr=new WeakSet,Kc=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},tt.formAssociated=!0,tt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},tt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},tt.styles=[v,u`
|
|
116
140
|
:host { display: inline-flex; }
|
|
117
141
|
label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
|
|
118
142
|
input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: inherit; }
|
|
@@ -129,12 +153,12 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
129
153
|
:host([disabled]) label { cursor: not-allowed; }
|
|
130
154
|
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
|
|
131
155
|
:host([disabled]) .label { color: var(--cm-text-secondary); }
|
|
132
|
-
`];
|
|
156
|
+
`];f("cm-checkbox",tt);var ya,St=class extends E{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;h(this,ya,S("cm-radio"))}render(){let e=this.description?`${s(this,ya)}-d`:null;return o`<div class="radio" part="radio" role="radio" id=${s(this,ya)}
|
|
133
157
|
aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":c}
|
|
134
158
|
aria-describedby=${e??c} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
|
|
135
159
|
<span class="dot" part="dot"></span>
|
|
136
|
-
<span class="text"><span class="label">${this.label}<slot></slot></span>${e?
|
|
137
|
-
</div>`}};
|
|
160
|
+
<span class="text"><span class="label">${this.label}<slot></slot></span>${e?o`<span class="desc" id=${e}>${this.description}</span>`:c}</span>
|
|
161
|
+
</div>`}};ya=new WeakMap,St.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},St.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},St.styles=[v,u`
|
|
138
162
|
:host { display: inline-flex; }
|
|
139
163
|
.radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; outline: none; }
|
|
140
164
|
.dot {
|
|
@@ -154,16 +178,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
154
178
|
:host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
|
|
155
179
|
:host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-default); }
|
|
156
180
|
:host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
|
|
157
|
-
`];
|
|
158
|
-
aria-labelledby=${
|
|
181
|
+
`];f("cm-radio",St);var gm=k("radioGroup",{required:"Please select one of these options."}),ge,Oe,wa,$a,ka,oi,P,Jo,en,Tt,Zo,li,Qo,tn,sn,Qr,Lt=class extends w{constructor(){super();h(this,P);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;h(this,ge,this.attachInternals());h(this,Oe,S("cm-rg"));h(this,wa,"");h(this,$a,!0);h(this,ka,!1);h(this,oi,!1);h(this,en,()=>{n(this,P,Jo).call(this),s(this,li).call(this)});h(this,li,()=>{let e=n(this,P,Tt).call(this),t=!1;for(let l of e)l.checked=!!this.value&&l.value===this.value&&!t,l.checked&&(t=!0),l.groupDisabled=this.disabled;let i=e.find(l=>l.checked&&!l.disabled)??n(this,P,Zo).call(this)[0];for(let l of e)l._tabbable=l===i&&!this.disabled});h(this,tn,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||n(this,P,Qo).call(this,t,!0)});h(this,sn,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=n(this,P,Zo).call(this),l=i.indexOf(t),d=fe(e,this),p;if(e.key==="ArrowDown"||d==="ArrowRight")p=i[(l+1)%i.length];else if(e.key==="ArrowUp"||d==="ArrowLeft")p=i[(l-1+i.length)%i.length];else if(e.key===" ")p=t.disabled?void 0:t;else return;e.preventDefault(),p&&n(this,P,Qo).call(this,p,!0)});this.addEventListener("keydown",s(this,sn)),this.addEventListener("click",s(this,tn))}connectedCallback(){super.connectedCallback(),n(this,P,Jo).call(this)}get form(){return s(this,ge).form}get validity(){return s(this,ge).validity}get validationMessage(){return s(this,ge).validationMessage}checkValidity(){return s(this,ge).checkValidity()}reportValidity(){return s(this,ge).reportValidity()}formResetCallback(){this.value=s(this,wa)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(n(this,P,Tt).call(this).find(t=>t._tabbable)??n(this,P,Tt).call(this)[0])?.focus(e)}updated(e){e.has("value")&&s(this,ka)&&!s(this,oi)&&b(this,$a,!1),b(this,ka,!0),s(this,li).call(this),s(this,ge).setFormValue(this.value||null,this.value);let t=n(this,P,Tt).call(this)[0];this.error?s(this,ge).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ge).setValidity({valueMissing:!0},this.t("required"),t):s(this,ge).setValidity({})}render(){let e=[this.error&&`${s(this,Oe)}-err`,this.helpText&&`${s(this,Oe)}-help`].filter(Boolean).join(" ");return o`<div class="group" role="radiogroup" part="group"
|
|
182
|
+
aria-labelledby=${n(this,P,Qr).call(this)?`${s(this,Oe)}-l`:c} aria-label=${n(this,P,Qr).call(this)?c:this.getAttribute("aria-label")??c}
|
|
159
183
|
aria-describedby=${e||c}
|
|
160
184
|
aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
|
|
161
185
|
aria-disabled=${this.disabled?"true":c}>
|
|
162
|
-
<span class="label" id="${
|
|
163
|
-
${this.helpText?
|
|
164
|
-
${this.error?
|
|
165
|
-
<div class="options" part="options"><slot @slotchange=${
|
|
166
|
-
</div>`}};
|
|
186
|
+
<span class="label" id="${s(this,Oe)}-l" part="label" ?hidden=${!n(this,P,Qr).call(this)}>${this.label}<slot name="label"></slot>${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>
|
|
187
|
+
${this.helpText?o`<p class="help" id="${s(this,Oe)}-help">${this.helpText}</p>`:c}
|
|
188
|
+
${this.error?o`<p class="error" id="${s(this,Oe)}-err" role="alert">${this.error}</p>`:c}
|
|
189
|
+
<div class="options" part="options"><slot @slotchange=${s(this,en)}></slot></div>
|
|
190
|
+
</div>`}};ge=new WeakMap,Oe=new WeakMap,wa=new WeakMap,$a=new WeakMap,ka=new WeakMap,oi=new WeakMap,P=new WeakSet,Jo=function(){s(this,$a)&&(this.value||(b(this,oi,!0),this.value=n(this,P,Tt).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>b(this,oi,!1))),b(this,wa,this.value))},en=new WeakMap,Tt=function(){return[...this.querySelectorAll("cm-radio")]},Zo=function(){return n(this,P,Tt).call(this).filter(e=>!e.disabled&&!this.disabled)},li=new WeakMap,Qo=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,s(this,li).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},tn=new WeakMap,sn=new WeakMap,Qr=function(){return!!this.label||!!this.querySelector("[slot=label]")},Lt.formAssociated=!0,Lt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Lt.styles=[v,u`
|
|
167
191
|
:host { display: block; }
|
|
168
192
|
.group { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
169
193
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
@@ -172,13 +196,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
172
196
|
.error { color: var(--cm-text-critical); }
|
|
173
197
|
.options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-20); padding-top: var(--cm-space-10); }
|
|
174
198
|
:host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-30); }
|
|
175
|
-
`];
|
|
176
|
-
<input type="checkbox" role="switch" id=${
|
|
199
|
+
`];f("cm-radio-group",Lt);var ci,Ct,Ea,an,Wc,st=class extends E{constructor(){super(...arguments);h(this,an);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;h(this,ci,this.attachInternals());h(this,Ct,S("cm-tg"));h(this,Ea,!1)}connectedCallback(){super.connectedCallback(),b(this,Ea,this.checked)}get form(){return s(this,ci).form}checkValidity(){return s(this,ci).checkValidity()}formResetCallback(){this.checked=s(this,Ea)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){s(this,ci).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return o`<label for=${s(this,Ct)}>
|
|
200
|
+
<input type="checkbox" role="switch" id=${s(this,Ct)} .checked=${this.checked} ?disabled=${this.disabled}
|
|
177
201
|
aria-label=${e?c:this.getAttribute("aria-label")??c}
|
|
178
|
-
aria-describedby=${this.description?`${
|
|
202
|
+
aria-describedby=${this.description?`${s(this,Ct)}-d`:c} @change=${n(this,an,Wc)} />
|
|
179
203
|
<span class="track" part="track"><span class="thumb" part="thumb"></span></span>
|
|
180
|
-
${e?
|
|
181
|
-
</label>`}};
|
|
204
|
+
${e?o`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?o`<span class="desc" id="${s(this,Ct)}-d">${this.description}</span>`:c}</span>`:c}
|
|
205
|
+
</label>`}};ci=new WeakMap,Ct=new WeakMap,Ea=new WeakMap,an=new WeakSet,Wc=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},st.formAssociated=!0,st.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},st.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},st.styles=[v,u`
|
|
182
206
|
:host { display: inline-flex; }
|
|
183
207
|
label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
|
|
184
208
|
input { position: absolute; opacity: 0; width: 38px; height: 20px; margin: 0; cursor: inherit; }
|
|
@@ -203,32 +227,32 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
203
227
|
:host([disabled]) .track { opacity: .5; }
|
|
204
228
|
:host([disabled]) .label { color: var(--cm-text-secondary); }
|
|
205
229
|
@media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
|
|
206
|
-
`];
|
|
207
|
-
${this.label?
|
|
230
|
+
`];f("cm-toggle",st);var zm=k("select",{required:"Please select an item in the list."}),ve,G,hi,Ee,pi,_a,A,el,tl,Ma,di,At,at,rn,nn,za,on,ln,rt=class extends w{constructor(){super(...arguments);h(this,A);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this._active=-1;this._slotted=[];h(this,ve,this.attachInternals());h(this,G,S("cm-sel"));h(this,hi,"");h(this,Ee,"");h(this,pi,0);h(this,_a,new MutationObserver(()=>n(this,A,el).call(this)));h(this,nn,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),n(this,A,Ma).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),n(this,A,Ma).call(this),n(this,A,at).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=n(this,A,rn).call(this,t);n(this,A,Ma).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?n(this,A,At).call(this,this._active):n(this,A,at).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?n(this,A,At).call(this,this._active):n(this,A,at).call(this,-1);break;case"Home":e.preventDefault(),n(this,A,at).call(this,"first");break;case"End":e.preventDefault(),n(this,A,at).call(this,"last");break;case"PageDown":e.preventDefault(),n(this,A,at).call(this,10);break;case"PageUp":e.preventDefault(),n(this,A,at).call(this,-10);break;case"Enter":e.preventDefault(),n(this,A,At).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),n(this,A,di).call(this);break;case"Tab":n(this,A,At).call(this,this._active);break;case" ":if(e.preventDefault(),s(this,Ee)&&Date.now()-s(this,pi)<500){let i=n(this,A,rn).call(this," ");i>=0&&(this._active=i)}else n(this,A,At).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=n(this,A,rn).call(this,t);i>=0&&(this._active=i)}}});h(this,za,e=>{this.open&&!e.composedPath().includes(this)&&n(this,A,di).call(this)});h(this,on,()=>{this.disabled||(this.open?n(this,A,di).call(this):n(this,A,Ma).call(this))});h(this,ln,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),n(this,A,el).call(this),s(this,_a).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",s(this,za),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,_a).disconnect(),document.removeEventListener("pointerdown",s(this,za),!0)}get form(){return s(this,ve).form}get validity(){return s(this,ve).validity}get validationMessage(){return s(this,ve).validationMessage}checkValidity(){return s(this,ve).checkValidity()}reportValidity(){return s(this,ve).reportValidity()}formResetCallback(){this.value=s(this,hi),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,hi)||b(this,hi,this.value)}updated(e){s(this,ve).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?s(this,ve).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ve).setValidity({valueMissing:!0},this.t("required"),t):s(this,ve).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${s(this,G)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(d=>d.value===this.value),i=[this.error&&`${s(this,G)}-err`,this.helpText&&`${s(this,G)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label");return o`<div class="field">
|
|
231
|
+
${this.label?o`<span class="label" id="${s(this,G)}-l" part="label" @click=${s(this,ln)}>${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
|
|
208
232
|
<div class="wrap">
|
|
209
233
|
<div class="box" part="box" role="combobox" tabindex=${this.disabled?"-1":"0"}
|
|
210
|
-
aria-labelledby=${this.label?`${
|
|
234
|
+
aria-labelledby=${this.label?`${s(this,G)}-l`:c}
|
|
211
235
|
aria-label=${!this.label&&l?l:c}
|
|
212
|
-
aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${
|
|
213
|
-
aria-activedescendant=${this.open&&this._active>=0?`${
|
|
236
|
+
aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,G)}-list"
|
|
237
|
+
aria-activedescendant=${this.open&&this._active>=0?`${s(this,G)}-o${this._active}`:c}
|
|
214
238
|
aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
|
|
215
|
-
aria-disabled=${this.disabled?"true":c} aria-describedby=${
|
|
216
|
-
@click=${
|
|
217
|
-
<span class="text ${t?"":"placeholder"}" id="${
|
|
239
|
+
aria-disabled=${this.disabled?"true":c} aria-describedby=${i||c}
|
|
240
|
+
@click=${s(this,on)} @keydown=${s(this,nn)} @blur=${()=>n(this,A,di).call(this)}>
|
|
241
|
+
<span class="text ${t?"":"placeholder"}" id="${s(this,G)}-v">${t?t.label:this.placeholder}</span>
|
|
218
242
|
<cm-icon class="chev" name="chevron-down" size="16"></cm-icon>
|
|
219
243
|
</div>
|
|
220
|
-
<ul role="listbox" id="${
|
|
244
|
+
<ul role="listbox" id="${s(this,G)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,G)}-l`:c}
|
|
221
245
|
aria-label=${!this.label&&l?l:c} ?hidden=${!this.open}
|
|
222
246
|
@pointerdown=${d=>d.preventDefault()}>
|
|
223
|
-
${e.map((d,p)=>
|
|
247
|
+
${e.map((d,p)=>o`<li role="option" id="${s(this,G)}-o${p}" class=${p===this._active?"active":""}
|
|
224
248
|
aria-selected=${d.value===this.value?"true":"false"} aria-disabled=${d.disabled?"true":c}
|
|
225
|
-
@pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>
|
|
249
|
+
@pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>n(this,A,At).call(this,p)}>${d.label}</li>`)}
|
|
226
250
|
</ul>
|
|
227
251
|
</div>
|
|
228
|
-
${this.error?
|
|
229
|
-
${this.helpText?
|
|
252
|
+
${this.error?o`<p class="error" id="${s(this,G)}-err" role="alert">${this.error}</p>`:c}
|
|
253
|
+
${this.helpText?o`<p class="help" id="${s(this,G)}-help">${this.helpText}</p>`:c}
|
|
230
254
|
<slot></slot>
|
|
231
|
-
</div>`}};
|
|
255
|
+
</div>`}};ve=new WeakMap,G=new WeakMap,hi=new WeakMap,Ee=new WeakMap,pi=new WeakMap,_a=new WeakMap,A=new WeakSet,el=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",b(this,hi,this.value))},tl=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},Ma=function(e){if(this.disabled)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:n(this,A,tl).call(this)[0]??-1)},di=function(){this.open=!1},At=function(e){let t=this.items[e];!t||t.disabled||(n(this,A,di).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},at=function(e){let t=n(this,A,tl).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},rn=function(e){let t=Date.now();b(this,Ee,t-s(this,pi)>500?e:s(this,Ee)+e),b(this,pi,t);let i=this.items,l=this._active<0?0:this._active,d=s(this,Ee).split("").every(x=>x===s(this,Ee)[0]),p=d?s(this,Ee)[0]:s(this,Ee),m=d||s(this,Ee).length===1?l+1:l;for(let x=0;x<i.length;x++){let $=(m+x)%i.length;if(!i[$].disabled&&i[$].label.toLowerCase().startsWith(p.toLowerCase()))return $}return-1},nn=new WeakMap,za=new WeakMap,on=new WeakMap,ln=new WeakMap,rt.formAssociated=!0,rt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},rt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_active:{state:!0},_slotted:{state:!0}},rt.styles=[v,u`
|
|
232
256
|
:host { display: block; position: relative; }
|
|
233
257
|
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
234
258
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); cursor: default; }
|
|
@@ -265,16 +289,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
265
289
|
slot { display: none; }
|
|
266
290
|
@media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
|
|
267
291
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
268
|
-
`];
|
|
292
|
+
`];f("cm-select",rt);var Nm=k("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),ui,cn,Ta,Q,mi,Yc,Gc,il,nt=class extends w{constructor(){super(...arguments);h(this,Q);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;h(this,ui,this.attachInternals());h(this,cn,S("cm-search"));h(this,Ta,"")}connectedCallback(){super.connectedCallback(),b(this,Ta,this.value)}get form(){return s(this,ui).form}checkValidity(){return s(this,ui).checkValidity()}formResetCallback(){this.value=s(this,Ta)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){s(this,ui).setFormValue(this.value)}render(){let e=this.size==="large";return o`<div class="box" part="box">
|
|
269
293
|
<cm-icon class="icon" name="search" size=${e?16:14}></cm-icon>
|
|
270
|
-
<input id=${
|
|
271
|
-
aria-label=${this.label} .value=${
|
|
272
|
-
@input=${
|
|
273
|
-
${this.value&&!this.disabled?
|
|
274
|
-
${this.filter?
|
|
294
|
+
<input id=${s(this,cn)} part="input" type="search" enterkeyhint="search" autocomplete="off"
|
|
295
|
+
aria-label=${this.label} .value=${re(this.value)} placeholder=${this.placeholder||c} ?disabled=${this.disabled}
|
|
296
|
+
@input=${n(this,Q,Yc)} @change=${()=>n(this,Q,mi).call(this,"change")} @keydown=${n(this,Q,Gc)} />
|
|
297
|
+
${this.value&&!this.disabled?o`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${n(this,Q,il)}><cm-icon name="close" size="14"></cm-icon></button>`:c}
|
|
298
|
+
${this.filter?o`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
|
|
275
299
|
aria-label=${this.filterCount>0?this.t("filterApplied",{label:this.filterLabel,count:this.filterCount}):this.filterLabel}
|
|
276
|
-
@click=${()=>
|
|
277
|
-
</div>`}};
|
|
300
|
+
@click=${()=>n(this,Q,mi).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?o`<span class="count" aria-hidden="true">${this.filterCount}</span>`:c}</button>`:c}
|
|
301
|
+
</div>`}};ui=new WeakMap,cn=new WeakMap,Ta=new WeakMap,Q=new WeakSet,mi=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Yc=function(e){this.value=e.target.value},Gc=function(e){e.key==="Enter"?n(this,Q,mi).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),n(this,Q,il).call(this))},il=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),n(this,Q,mi).call(this,"input"),n(this,Q,mi).call(this,"change")},nt.formAssociated=!0,nt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},nt.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},nt.styles=[v,u`
|
|
278
302
|
:host { display: block; }
|
|
279
303
|
.box {
|
|
280
304
|
display: flex; align-items: center; gap: var(--cm-space-10); height: 42px; padding: 0 var(--cm-space-10);
|
|
@@ -304,7 +328,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
304
328
|
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
|
|
305
329
|
:host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
306
330
|
:host([disabled]) button { cursor: not-allowed; }
|
|
307
|
-
`];
|
|
331
|
+
`];f("cm-search",nt);var dn=u`
|
|
308
332
|
.pop {
|
|
309
333
|
position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
|
|
310
334
|
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
|
|
@@ -316,7 +340,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
316
340
|
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
|
|
317
341
|
clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
|
|
318
342
|
}
|
|
319
|
-
`;function
|
|
343
|
+
`;function hn(r,a,e){let t=i=>{a()&&!i.composedPath().includes(r)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var jm=k("tag",{remove:"Remove {label}"}),pn,Xc,bi=class extends w{constructor(){super(...arguments);h(this,pn);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return o`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?o`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${n(this,pn,Xc)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:c}</span>`}};pn=new WeakSet,Xc=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},bi.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},bi.styles=[v,u`
|
|
320
344
|
:host { display: inline-flex; vertical-align: middle; max-width: 100%; }
|
|
321
345
|
.tag {
|
|
322
346
|
display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 var(--cm-space-10);
|
|
@@ -334,13 +358,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
334
358
|
:host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-default); }
|
|
335
359
|
:host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); }
|
|
336
360
|
@media (max-width: 640px) { .tag { height: 22px; } button { width: 18px; height: 18px; } }
|
|
337
|
-
`];
|
|
361
|
+
`];f("cm-tag",bi);var fi=class extends w{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return o`<span class="spinner" part="spinner" role="status">
|
|
338
362
|
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
339
363
|
<circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
|
|
340
364
|
<path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
|
|
341
365
|
</svg>
|
|
342
366
|
<span class="vh">${this.accessibleLabel||this.t("loading")}</span>
|
|
343
|
-
</span>`}};
|
|
367
|
+
</span>`}};fi.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},fi.styles=[v,u`
|
|
344
368
|
:host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
|
|
345
369
|
.spinner { display: inline-flex; }
|
|
346
370
|
svg { inline-size: 44px; block-size: 44px; animation: spin 0.8s linear infinite; }
|
|
@@ -353,42 +377,42 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
353
377
|
}
|
|
354
378
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
355
379
|
@media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
|
|
356
|
-
`];
|
|
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
|
|
358
|
-
`))}else
|
|
359
|
-
${this.label?
|
|
380
|
+
`];f("cm-spinner",fi);var iu=k("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."}),ne,X,Da,xi,Na,Ia,z,sl,Sa,mn,La,gi,vi,ot,Jc,Ca,al,rl,Aa,un,bn,fn,Zc,lt=class extends w{constructor(){super(...arguments);h(this,z);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,ne,this.attachInternals());h(this,X,S("cm-cb"));h(this,Da,null);h(this,xi,new Map);h(this,Na,new MutationObserver(()=>n(this,z,sl).call(this)));h(this,Ia);h(this,un,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,n(this,z,vi).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});h(this,bn,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?n(this,z,Ca).call(this,1):(n(this,z,vi).call(this),e.altKey||n(this,z,Ca).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?n(this,z,Ca).call(this,-1):(n(this,z,vi).call(this),n(this,z,Ca).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),n(this,z,al).call(this,this._active)):s(this,z,mn)&&(e.preventDefault(),n(this,z,rl).call(this,s(this,z,mn)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),n(this,z,ot).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",n(this,z,gi).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":n(this,z,ot).call(this);break;default:}});h(this,fn,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(n(this,z,ot).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?n(this,z,Sa).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),n(this,z,sl).call(this),s(this,Na).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),b(this,Ia,hn(this,()=>this.open,()=>n(this,z,ot).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),s(this,Na).disconnect(),(e=s(this,Ia))==null||e.call(this)}get form(){return s(this,ne).form}get validity(){return s(this,ne).validity}get validationMessage(){return s(this,ne).validationMessage}checkValidity(){return s(this,ne).checkValidity()}reportValidity(){return s(this,ne).reportValidity()}formResetCallback(){let e=s(this,Da)??{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(`
|
|
381
|
+
`):[]: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 i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){b(this,Da,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)s(this,xi).set(t.value,t.label);if((e.has("value")||e.has("options")||e.has("_slotted"))&&!this.multiple&&!this._typing&&(this._query=this.value?n(this,z,Sa).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=n(this,z,La).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);s(this,ne).setFormValue(l,this.values.join(`
|
|
382
|
+
`))}else s(this,ne).setFormValue(null);else s(this,ne).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?s(this,ne).setValidity({customError:!0},this.error,t):this.required&&i?s(this,ne).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):s(this,ne).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,X)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),n(this,z,gi).call(this))}render(){let e=n(this,z,La).call(this),t=[this.error&&`${s(this,X)}-err`,this.helpText&&`${s(this,X)}-help`].filter(Boolean).join(" "),i=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 o`<div class="field">
|
|
383
|
+
${this.label?o`<label class="label" id="${s(this,X)}-l" for="${s(this,X)}-in" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
|
|
360
384
|
<div class="wrap">
|
|
361
|
-
<div class="box" part="box" @click=${p=>{p.target.closest("cm-tag")||
|
|
362
|
-
${this.multiple?this.values.map(p=>
|
|
363
|
-
@cm-remove=${()=>{this.removeValue(p),
|
|
364
|
-
<input id="${
|
|
365
|
-
.value=${
|
|
366
|
-
aria-label=${!this.label&&
|
|
367
|
-
aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${
|
|
368
|
-
aria-activedescendant=${this.open&&this._active>=0?`${
|
|
385
|
+
<div class="box" part="box" @click=${p=>{p.target.closest("cm-tag")||n(this,z,Aa).call(this)}}>
|
|
386
|
+
${this.multiple?this.values.map(p=>o`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:n(this,z,Sa).call(this,p)})}
|
|
387
|
+
@cm-remove=${()=>{this.removeValue(p),n(this,z,Aa).call(this)}}>${n(this,z,Sa).call(this,p)}</cm-tag>`):c}
|
|
388
|
+
<input id="${s(this,X)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
|
|
389
|
+
.value=${re(this._query)} placeholder=${this.multiple&&this.values.length?c:this.placeholder||c}
|
|
390
|
+
aria-label=${!this.label&&i?i:c}
|
|
391
|
+
aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,X)}-list"
|
|
392
|
+
aria-activedescendant=${this.open&&this._active>=0?`${s(this,X)}-o${this._active}`:c}
|
|
369
393
|
aria-invalid=${this.error?"true":c} aria-describedby=${t||c}
|
|
370
394
|
aria-required=${this.required?"true":c} ?disabled=${this.disabled}
|
|
371
|
-
@input=${
|
|
372
|
-
@click=${()=>{this.open||
|
|
373
|
-
<cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?
|
|
395
|
+
@input=${s(this,un)} @keydown=${s(this,bn)} @blur=${s(this,fn)}
|
|
396
|
+
@click=${()=>{this.open||n(this,z,vi).call(this)}} @change=${p=>p.stopPropagation()} />
|
|
397
|
+
<cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?n(this,z,ot).call(this):(n(this,z,vi).call(this),n(this,z,Aa).call(this))}}></cm-icon>
|
|
374
398
|
</div>
|
|
375
399
|
<div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${p=>p.preventDefault()}>
|
|
376
|
-
<ul role="listbox" id="${
|
|
377
|
-
aria-labelledby=${this.label?`${
|
|
400
|
+
<ul role="listbox" id="${s(this,X)}-list" part="listbox" ?hidden=${!e.length}
|
|
401
|
+
aria-labelledby=${this.label?`${s(this,X)}-l`:c} aria-label=${!this.label&&i?i:c}
|
|
378
402
|
aria-multiselectable=${this.multiple?"true":c}>
|
|
379
|
-
${e.map((p,
|
|
403
|
+
${e.map((p,m)=>o`<li role="option" id="${s(this,X)}-o${m}" class=${m===this._active?"active":""}
|
|
380
404
|
aria-selected=${p.create?"false":l(p.value)?"true":"false"} aria-disabled=${p.disabled?"true":c}
|
|
381
|
-
@pointerenter=${()=>!p.disabled&&(this._active=
|
|
382
|
-
${p.create?
|
|
405
|
+
@pointerenter=${()=>!p.disabled&&(this._active=m)} @click=${()=>n(this,z,al).call(this,m)}>
|
|
406
|
+
${p.create?o`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:p.label})}</span>`:o`${this.multiple?o`<cm-icon class="check" name="check" size="16"></cm-icon>`:c}<span>${n(this,z,Zc).call(this,p.label)}</span>`}</li>`)}
|
|
383
407
|
</ul>
|
|
384
|
-
${this.loading?
|
|
408
|
+
${this.loading?o`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?c:o`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
|
|
385
409
|
</div>
|
|
386
410
|
</div>
|
|
387
411
|
<span class="vh" role="status" aria-live="polite">${d}</span>
|
|
388
|
-
${this.error?
|
|
389
|
-
${this.helpText?
|
|
412
|
+
${this.error?o`<p class="error" id="${s(this,X)}-err" role="alert">${this.error}</p>`:c}
|
|
413
|
+
${this.helpText?o`<p class="help" id="${s(this,X)}-help">${this.helpText}</p>`:c}
|
|
390
414
|
<slot></slot>
|
|
391
|
-
</div>`}};
|
|
415
|
+
</div>`}};ne=new WeakMap,X=new WeakMap,Da=new WeakMap,xi=new WeakMap,Na=new WeakMap,Ia=new WeakMap,z=new WeakSet,sl=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(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},Sa=function(e){return this.items.find(t=>t.value===e)?.label??s(this,xi).get(e)??e},mn=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},La=function(){let e=this.loading?[]:[...this.filteredItems],t=s(this,z,mn);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},gi=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vi=function(){this.disabled||(this.open=!0)},ot=function(){this.open=!1,this._active=-1},Jc=function(e=n(this,z,La).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},Ca=function(e){let t=n(this,z,Jc).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 i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},al=function(e){let t=n(this,z,La).call(this)[e];if(!(!t||t.disabled)){if(t.create){n(this,z,rl).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,n(this,z,gi).call(this),n(this,z,Aa).call(this);return}n(this,z,ot).call(this),this._typing=!1,this._query=t.label,t.value!==this.value&&(this.value=t.value,n(this,z,gi).call(this))}},rl=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(s(this,xi).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(n(this,z,ot).call(this),this.value=e,this._typing=!1,this._query=e),n(this,z,gi).call(this))},Aa=function(){this.renderRoot.querySelector("input")?.focus()},un=new WeakMap,bn=new WeakMap,fn=new WeakMap,Zc=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:o`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},lt.formAssociated=!0,lt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},lt.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}},lt.styles=[v,dn,u`
|
|
392
416
|
:host { display: block; position: relative; }
|
|
393
417
|
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
394
418
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
@@ -430,32 +454,32 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
430
454
|
slot { display: none; }
|
|
431
455
|
@media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
|
|
432
456
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
433
|
-
`];
|
|
457
|
+
`];f("cm-combobox",lt);var du=k("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),xe,Ha,H,gn,vn,yi,nl,xn,Qc,yn,Ra,ol,ed,Dt=class extends w{constructor(){super(...arguments);h(this,H);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;h(this,xe,S("cm-gs"));h(this,Ha);h(this,xn,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),n(this,H,nl).call(this)});h(this,yn,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),n(this,H,Qc).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":s(this,H,vn)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${s(this,xe)}-o${this._active}`)?.click());break;case"Escape":s(this,H,vn)?(e.preventDefault(),e.stopPropagation(),n(this,H,yi).call(this)):this.value&&(e.preventDefault(),n(this,H,ol).call(this,!1));break;case"Tab":n(this,H,yi).call(this);break;default:}});h(this,Ra,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(),b(this,Ha,hn(this,()=>this.open,()=>n(this,H,yi).call(this))),document.addEventListener("keydown",s(this,Ra))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=s(this,Ha))==null||e.call(this),document.removeEventListener("keydown",s(this,Ra))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=n(this,H,gn).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,xe)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=n(this,H,gn).call(this),t=s(this,H,vn),i=e.filter(x=>x.item).length,l=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",d=-1,p=(this.results??[]).filter(x=>x?.items?.length),m=(x,$,y="")=>{d++;let T=d;return o`<a role="option" id="${s(this,xe)}-o${T}" class="${y}${T===this._active?" active":""}" href=${x.href} tabindex="-1"
|
|
434
458
|
aria-selected=${T===this._active?"true":"false"} @pointerenter=${()=>this._active=T}
|
|
435
|
-
@click=${M=>
|
|
436
|
-
<div class="box" part="box" @click=${
|
|
459
|
+
@click=${M=>n(this,H,ed).call(this,M,x)}>${$}</a>`};return o`<div class="wrap">
|
|
460
|
+
<div class="box" part="box" @click=${x=>{x.target===x.currentTarget&&this.focus()}}>
|
|
437
461
|
<cm-icon class="icon" name="search" size="14"></cm-icon>
|
|
438
|
-
<input id="${
|
|
439
|
-
aria-label=${this.label} placeholder=${this.placeholder||c} .value=${
|
|
440
|
-
aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${
|
|
441
|
-
aria-activedescendant=${t&&this._active>=0?`${
|
|
462
|
+
<input id="${s(this,xe)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
|
|
463
|
+
aria-label=${this.label} placeholder=${this.placeholder||c} .value=${re(this.value)}
|
|
464
|
+
aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${s(this,xe)}-list"
|
|
465
|
+
aria-activedescendant=${t&&this._active>=0?`${s(this,xe)}-o${this._active}`:c}
|
|
442
466
|
aria-keyshortcuts=${this.shortcut||c}
|
|
443
|
-
@input=${
|
|
467
|
+
@input=${s(this,xn)} @keydown=${s(this,yn)}
|
|
444
468
|
@focus=${()=>{this.value.trim()&&(this.open=!0)}} @click=${()=>{this.value.trim()&&(this.open=!0)}} />
|
|
445
|
-
${this.value?
|
|
469
|
+
${this.value?o`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>n(this,H,ol).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?o`<kbd aria-hidden="true">${this.shortcut}</kbd>`:c}
|
|
446
470
|
</div>
|
|
447
|
-
<div class="pop" part="popover" ?hidden=${!t} @pointerdown=${
|
|
448
|
-
<div role="listbox" id="${
|
|
449
|
-
${p.map((
|
|
450
|
-
<div role="presentation" class="gh" id="${
|
|
451
|
-
${
|
|
452
|
-
${
|
|
471
|
+
<div class="pop" part="popover" ?hidden=${!t} @pointerdown=${x=>x.preventDefault()}>
|
|
472
|
+
<div role="listbox" id="${s(this,xe)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
|
|
473
|
+
${p.map((x,$)=>{let y=x.total??x.items.length;return o`<div role="group" aria-labelledby="${s(this,xe)}-g${$}">
|
|
474
|
+
<div role="presentation" class="gh" id="${s(this,xe)}-g${$}"><span>${x.label}</span><span class="count" aria-hidden="true">${this.formatNumber(y)}</span><span class="vh">, ${this.t("results",{count:y})}</span></div>
|
|
475
|
+
${x.items.map(T=>m({group:x,item:T,href:T.href},o`${T.icon?o`<cm-icon name=${T.icon} size="16"></cm-icon>`:c}<span class="text"><span class="title">${T.title}</span>${T.description?o`<span class="vh">, </span><span class="desc">${T.description}</span>`:c}</span>`))}
|
|
476
|
+
${x.href?m({group:x,href:x.href},o`<span class="text">${x.seeAllLabel||this.seeAllLabel}</span>`,"all"):c}
|
|
453
477
|
</div>`})}
|
|
454
478
|
</div>
|
|
455
|
-
${this.loading?
|
|
479
|
+
${this.loading?o`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?c:o`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
|
|
456
480
|
</div>
|
|
457
481
|
<span class="vh" role="status" aria-live="polite">${l}</span>
|
|
458
|
-
</div>`}};
|
|
482
|
+
</div>`}};xe=new WeakMap,Ha=new WeakMap,H=new WeakSet,gn=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}]:[]])},vn=function(){return this.open&&!!this.value.trim()},yi=function(){this.open=!1,this._active=-1},nl=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},xn=new WeakMap,Qc=function(e){let t=n(this,H,gn).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},yn=new WeakMap,Ra=new WeakMap,ol=function(e=!0){this.value="",n(this,H,yi).call(this),e&&this.renderRoot.querySelector("input")?.focus(),n(this,H,nl).call(this)},ed=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(),n(this,H,yi).call(this)},Dt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},Dt.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}},Dt.styles=[v,dn,u`
|
|
459
483
|
:host { display: block; position: relative; }
|
|
460
484
|
.wrap { position: relative; }
|
|
461
485
|
.box {
|
|
@@ -507,20 +531,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
507
531
|
.title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
508
532
|
.desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
|
|
509
533
|
.all { font-size: 13px; text-decoration: underline; }
|
|
510
|
-
`];
|
|
511
|
-
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${
|
|
512
|
-
<h2 id="${
|
|
513
|
-
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${
|
|
534
|
+
`];f("cm-global-search",Dt);var Vh=/^(\d{4})-(\d{2})-(\d{2})$/;function D(r){let a=Vh.exec(r??"");if(!a)return null;let e=new Date(+a[1],+a[2]-1,+a[3]);return e.getFullYear()===+a[1]&&e.getMonth()===+a[2]-1&&e.getDate()===+a[3]?e:null}var Te=(r,a=2)=>String(r).padStart(a,"0"),ee=r=>`${Te(r.getFullYear(),4)}-${Te(r.getMonth()+1)}-${Te(r.getDate())}`,Uh=()=>ee(new Date),oe=(r,a)=>new Date(r.getFullYear(),r.getMonth(),r.getDate()+a);function Se(r,a){let e=new Date(r.getFullYear(),r.getMonth()+a,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(r.getDate(),t))}var Nt=r=>new Date(r.getFullYear(),r.getMonth(),1),wn=r=>new Date(r.getFullYear(),r.getMonth()+1,0);var Kh=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function It(r){let a=Kh.exec(r??"");return a?+a[1]*60+ +a[2]:null}var Oa=r=>{let a=(Math.round(r)%1440+1440)%1440;return`${Te(Math.floor(a/60))}:${Te(a%60)}`};function Ht(r){let[a="",e=""]=(r??"").split("T"),t=It(e);return{date:D(a)?a:"",time:t===null?"":Oa(t)}}function qa(r,a=!1){let{date:e,time:t}=Ht(r),i=D(e);if(!i)return null;let l=t?It(t):a?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(l/60),l%60)}var sd=()=>{let r=new Date;return`${ee(r)}T${Te(r.getHours())}:${Te(r.getMinutes())}`},td=new Map;function ad(r,a){let e=a==="h12"||a==="h23"?a:void 0,t=`${r}|${e??""}`,i=td.get(t);if(i)return i;let l={hour:"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},d=new Intl.DateTimeFormat(r,l),p=d.resolvedOptions().hourCycle,m=_=>new Date(2e3,0,1,_,30),x=_=>(new Intl.DateTimeFormat(r,{hour:"numeric",hourCycle:"h12"}).formatToParts(m(_)).find(R=>R.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),$=(_,R)=>[...new Set([_,...R].filter(Boolean))],y=_=>_.replace(/[\u202f\u00a0]/g," "),T=y(d.formatToParts(m(9)).map(_=>_.type==="hour"?"{h}":_.type==="minute"?"{m}":_.value).join("")),M={format:_=>y(d.format(new Date(2e3,0,1,Math.floor(_/60),_%60))),dateTime:_=>V(_,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},r),pattern:T,hour12:p==="h12"||p==="h11",am:$(x(9),["am","a"]),pm:$(x(15),["pm","p"])};return td.set(t,M),M}var rd=(r,a)=>r.pattern.replace(/\{([hm])\}/g,(e,t)=>a[t]);function ll(r,a){let e=r.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&a.pm.includes(t),l=!!t&&a.am.includes(t);if(t&&!i&&!l)return null;let d=e.match(/\d+/g)??[],p,m;if(d.length===1){let x=d[0];if(x.length<=2)p=+x,m=0;else if(x.length<=4)p=+x.slice(0,-2),m=+x.slice(-2);else return null}else if(d.length===2||d.length===3){if(d[0].length>2||d[1].length!==2)return null;p=+d[0],m=+d[1]}else return null;if(m>59)return null;if(l||i){if(p<1||p>12)return null;p=p%12+(i?12:0)}else if(p>23)return null;return Oa(p*60+m)}var wi={fromAttribute:r=>r?r.split(/[\s,]+/).filter(Boolean):[],toAttribute:r=>Array.isArray(r)?r.join(" "):r},Pa=r=>Array.isArray(r)?r:typeof r=="string"?wi.fromAttribute(r):[];function $n(r,a){let e=[a,ba(r)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function kn(r){try{let a=new Intl.Locale(r),e=a.getWeekInfo?.()??a.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var id=new Map;function En(r){let a=id.get(r);if(a)return a;let e=M=>new Intl.DateTimeFormat(r,M),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),l=e({weekday:"long"}),d=new Date(2024,0,7),p=t.formatToParts(new Date(2026,10,15)),m=p.filter(M=>M.type==="day"||M.type==="month"||M.type==="year").map(M=>M.type),x=p.map(M=>M.type==="day"?"{d}":M.type==="month"?"{m}":M.type==="year"?"{y}":M.value).join(""),$=(M,_)=>Array.from({length:12},(R,O)=>new Intl.DateTimeFormat(M,{month:_}).format(new Date(2024,O,1)).toLowerCase().replace(/\./g,"")),y=Array.from({length:12},(M,_)=>[...new Set([$(r,"long")[_],$(r,"short")[_],$("en","long")[_],$("en","short")[_]])]),T={short:M=>t.format(M),long:M=>V(M,{weekday:"long",day:"numeric",month:"long",year:"numeric"},r),medium:M=>V(M,{day:"numeric",month:"short",year:"numeric"},r),monthYear:M=>V(M,{month:"long",year:"numeric"},r),day:M=>V(M,{day:"numeric"},r),weekdaysShort:Array.from({length:7},(M,_)=>i.format(oe(d,_))),weekdaysLong:Array.from({length:7},(M,_)=>l.format(oe(d,_))),pattern:m.length===3?x:"{y}-{m}-{d}",order:m.length===3?m:["year","month","day"],months:y};return id.set(r,T),T}var Mn=(r,a)=>r.pattern.replace(/\{([dmy])\}/g,(e,t)=>a[t]);function _n(r,a){let e=r.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,l,d,p=t.findIndex(x=>/\p{L}/u.test(x));if(p>=0){let x=t[p];l=a.months.findIndex(M=>M.some(_=>_===x||x.length>=3&&_.startsWith(x)))+1;let $=t.filter((M,_)=>_!==p);if(!l||$.some(M=>!/^\d+$/.test(M)))return null;let y=$.findIndex(M=>M.length===4),T=y>=0?y:1;i=+$[T],d=+$[1-T],$[T].length<=2&&(i+=2e3)}else{if(t.some(y=>!/^\d+$/.test(y)))return null;let x=t[0].length===4?["year","month","day"]:a.order,$=y=>t[x.indexOf(y)];if(i=+$("year"),l=+$("month"),d=+$("day"),$("year").length<=2)i+=2e3;else if($("year").length!==4)return null}let m=`${Te(i,4)}-${Te(l)}-${Te(d)}`;return D(m)?m:null}function zn(r,a,e,t){let i=(e.getDay()-t+7)%7;switch(r){case"ArrowRight":return oe(e,1);case"ArrowLeft":return oe(e,-1);case"ArrowDown":return oe(e,7);case"ArrowUp":return oe(e,-7);case"Home":return oe(e,-i);case"End":return oe(e,6-i);case"PageDown":return Se(e,a.shiftKey?12:1);case"PageUp":return Se(e,a.shiftKey?-12:-1);default:return null}}var ct=(r,a,e)=>a&&r<a?a:e&&r>e?e:r;function Tn(r){let{fmt:a,firstDay:e,month:t,focus:i,min:l,max:d}=r,p=Nt(t),m=(p.getDay()-e+7)%7,x=wn(t).getDate(),$=[],y=Array(m).fill(null);for(let O=1;O<=x;O++)y.push(new Date(t.getFullYear(),t.getMonth(),O)),y.length===7&&($.push(y),y=[]);y.length&&$.push([...y,...Array(7-y.length).fill(null)]);let T=Array.from({length:7},(O,q)=>(q+e)%7),M=Uh(),_=!!l&&wn(Se(p,-1))<l,R=!!d&&Se(p,1)>d;return o`<div class="cal-head">
|
|
535
|
+
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${r.previousLabel} ?disabled=${_} @click=${()=>r.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
|
|
536
|
+
<h2 id="${r.id}-month" class="cal-title" aria-live="polite">${a.monthYear(t)}</h2>
|
|
537
|
+
<button type="button" class="cal-nav" part="calendar-nav" aria-label=${r.nextLabel} ?disabled=${R} @click=${()=>r.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
|
|
514
538
|
</div>
|
|
515
|
-
<table role="grid" class="cal-grid" part="calendar" aria-labelledby="${
|
|
516
|
-
<thead><tr>${T.map(
|
|
517
|
-
<tbody>${$.map(
|
|
518
|
-
tabindex=${
|
|
519
|
-
aria-selected=${
|
|
520
|
-
aria-current=${
|
|
521
|
-
aria-label="${
|
|
522
|
-
@click=${()=>!
|
|
523
|
-
</table>`}var
|
|
539
|
+
<table role="grid" class="cal-grid" part="calendar" aria-labelledby="${r.id}-month" @keydown=${r.onKey}>
|
|
540
|
+
<thead><tr>${T.map(O=>o`<th scope="col" abbr=${a.weekdaysLong[O]}><span aria-hidden="true">${a.weekdaysShort[O]}</span><span class="vh">${a.weekdaysLong[O]}</span></th>`)}</tr></thead>
|
|
541
|
+
<tbody>${$.map(O=>o`<tr>${O.map(q=>{if(!q)return o`<td class="empty"></td>`;let ii=ee(q),si=r.isDisabled(q)||!!l&&q<l||!!d&&q>d,bc=r.mark(q),fc=r.note?.(q);return o`<td class="day ${bc} ${ii===M?"today":""}" data-date=${ii}
|
|
542
|
+
tabindex=${ii===ee(i)?"0":"-1"}
|
|
543
|
+
aria-selected=${bc?"true":"false"} aria-disabled=${si?"true":c}
|
|
544
|
+
aria-current=${ii===M?"date":c}
|
|
545
|
+
aria-label="${a.long(q)}${fc?`, ${fc}`:""}"
|
|
546
|
+
@click=${()=>!si&&r.onPick(q)} @pointerenter=${()=>r.onHover?.(q)}><span aria-hidden="true">${a.day(q)}</span></td>`})}</tr>`)}</tbody>
|
|
547
|
+
</table>`}var Sn=u`
|
|
524
548
|
.pop {
|
|
525
549
|
position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline-start: 0;
|
|
526
550
|
width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-15);
|
|
@@ -552,7 +576,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
552
576
|
clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
|
|
553
577
|
}
|
|
554
578
|
@media (max-width: 640px) { .day, .empty { height: 36px; } }
|
|
555
|
-
`;function
|
|
579
|
+
`;function Ln(r,a){if(r.key!=="Tab")return;let e=[...a.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=a.getRootNode(),i=e.indexOf(t.activeElement);r.preventDefault(),e[(i+(r.shiftKey?-1:1)+e.length)%e.length].focus()}var Cn=u`
|
|
556
580
|
:host { display: block; position: relative; }
|
|
557
581
|
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
558
582
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
@@ -583,60 +607,73 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
583
607
|
:host([size='small']) .field { gap: 6px; }
|
|
584
608
|
:host([size='small']) .label { font-size: 12px; }
|
|
585
609
|
:host([size='small']) input { font-size: 14px; }
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
610
|
+
/* cm-date-picker with \`time\`: the date box and a time box side by side, wrapping onto two rows when narrow. */
|
|
611
|
+
.wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); }
|
|
612
|
+
.wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
|
|
613
|
+
.wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--cm-space-10); }
|
|
614
|
+
`;var wu=k("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.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Mi,j,ye,_i,Fe,mt,le,pe,zi,Ti,g,Ba,dt,Si,An,Rt,$i,qe,ht,Pe,Be,Dn,cl,dl,ki,Ot,hl,pl,nd,Nn,od,ml,Ei,Fa,ja,ul,ld,In,bl,fl,Hn,Rn,On,qn,Pn,Va,pt=class extends w{constructor(){super(...arguments);h(this,g);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";h(this,Mi,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._focus=new Date;h(this,j,this.attachInternals());h(this,ye,S("cm-dp"));h(this,_i,null);h(this,Fe,!1);h(this,mt,!1);h(this,le,"");h(this,pe,"");h(this,zi,!1);h(this,Ti,"");h(this,Si,!1);h(this,In,e=>{e.key==="Enter"?n(this,g,ul).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),n(this,g,ld).call(this,e.key==="ArrowUp"?1:-1))});h(this,Hn,()=>{this.disabled||(this.open?this.open=!1:(n(this,g,ja).call(this),this.show()))});h(this,Rn,e=>{e.key==="Enter"?n(this,g,ja).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),n(this,g,ja).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});h(this,On,e=>{let t=zn(fe(e,this),e,this._focus,s(this,g,cl));if(t){e.preventDefault(),this._focus=ct(t,s(this,g,Pe),s(this,g,Be)),b(this,mt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n(this,g,bl).call(this,this._focus))});h(this,qn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,n(this,g,fl).call(this);return}Ln(e,e.currentTarget)});h(this,Pn,e=>{this._focus=ct(Se(this._focus,e),s(this,g,Pe),s(this,g,Be))});h(this,Va,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Mi)}set locale(e){let t=s(this,Mi);b(this,Mi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,_i)===null&&b(this,_i,this.value),document.addEventListener("pointerdown",s(this,Va),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Va),!0)}get form(){return s(this,j).form}get validity(){return s(this,j).validity}get validationMessage(){return s(this,j).validationMessage}get valueAsDate(){return this.time?this.value?qa(this.value):null:D(this.value)}checkValidity(){return n(this,g,Nn).call(this),s(this,j).checkValidity()}reportValidity(){return n(this,g,Nn).call(this),s(this,j).reportValidity()}formResetCallback(){this.value=s(this,_i)??"",this.time&&(n(this,g,pl).call(this,this.value),b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt)),this._text=n(this,g,ki).call(this,s(this,g,qe)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(n(this,g,nd).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=D(e);if(!t)return!0;let i=s(this,g,Pe),l=s(this,g,Be);return i&&t<i||l&&t>l?!0:Pa(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!s(this,Si)?(n(this,g,pl).call(this,this.value),s(this,zi)||b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt)):this.time&&(e.has("locale")||e.has("hourCycle"))&&s(this,pe)&&b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt),(e.has("value")||e.has("time"))&&!s(this,Fe)?this._text=n(this,g,ki).call(this,s(this,g,qe)):e.has("locale")&&D(s(this,g,qe))&&(this._text=n(this,g,ki).call(this,s(this,g,qe))),b(this,Fe,!1),b(this,zi,!1),b(this,Si,!1)}updated(e){s(this,j).setFormValue(this.value||null,this.time?this.value:this._text),n(this,g,Nn).call(this),this.open&&s(this,mt)&&(b(this,mt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&b(this,mt,!1)}render(){let e=s(this,g,Rt),t=D(s(this,g,qe)),i=[this.error&&`${s(this,ye)}-err`,this.helpText&&`${s(this,ye)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",p=Nt(this._focus);return o`<div class="field">
|
|
615
|
+
${this.label?o`<label class="label" for="${s(this,ye)}-in" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
|
|
616
|
+
<div class="wrap ${this.time?"timed":""}">
|
|
589
617
|
<div class="box" part="box">
|
|
590
|
-
<input id="${
|
|
591
|
-
.value=${
|
|
618
|
+
<input id="${s(this,ye)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
|
|
619
|
+
.value=${re(this._text)} placeholder=${this.placeholder||s(this,g,dl)}
|
|
592
620
|
aria-label=${!this.label&&l?l:c}
|
|
593
621
|
?required=${this.required} ?disabled=${this.disabled}
|
|
594
|
-
aria-invalid=${this.error?"true":c} aria-describedby=${
|
|
595
|
-
@input=${
|
|
596
|
-
@change=${()=>
|
|
622
|
+
aria-invalid=${this.error?"true":c} aria-describedby=${i||c}
|
|
623
|
+
@input=${m=>{m.stopPropagation(),this._text=m.target.value}}
|
|
624
|
+
@change=${()=>n(this,g,ja).call(this)} @keydown=${s(this,Rn)} />
|
|
597
625
|
<button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
|
|
598
626
|
aria-label=${t?this.t(d?"changeFor":"change",{label:d,date:e.long(t)}):this.t(d?"chooseFor":"choose",{label:d})}
|
|
599
|
-
aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${
|
|
600
|
-
@click=${
|
|
627
|
+
aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,ye)}-pop"
|
|
628
|
+
@click=${s(this,Hn)}><cm-icon name="calendar" size="18"></cm-icon></button>
|
|
601
629
|
</div>
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
630
|
+
${this.time?o`<div class="box time" part="time-box">
|
|
631
|
+
<input class="time-in" part="time-input" type="text" autocomplete="off" spellcheck="false"
|
|
632
|
+
.value=${re(s(this,g,Ba))} placeholder=${s(this,g,hl)}
|
|
633
|
+
aria-label=${this.t(d?"timeFor":"time",{label:d})}
|
|
634
|
+
?required=${this.required} ?disabled=${this.disabled}
|
|
635
|
+
aria-invalid=${this.error?"true":c} aria-describedby=${i||c}
|
|
636
|
+
@input=${m=>{m.stopPropagation(),b(this,g,m.target.value,dt)}}
|
|
637
|
+
@change=${()=>n(this,g,ul).call(this)} @keydown=${s(this,In)} />
|
|
638
|
+
</div>`:c}
|
|
639
|
+
<div class="pop" id="${s(this,ye)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
|
|
640
|
+
?hidden=${!this.open} @keydown=${s(this,qn)}>
|
|
641
|
+
${this.open?o`<div class="cal">${Tn({id:s(this,ye),fmt:e,firstDay:s(this,g,cl),month:p,focus:this._focus,min:s(this,g,Pe),max:s(this,g,Be),isDisabled:m=>this.isUnavailable(ee(m)),mark:m=>t&&ee(m)===s(this,g,qe)?"selected":"",onPick:m=>n(this,g,bl).call(this,m),onKey:s(this,On),onMonth:s(this,Pn),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:c}
|
|
605
642
|
</div>
|
|
606
643
|
</div>
|
|
607
|
-
${this.error?
|
|
608
|
-
${this.helpText?
|
|
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=${
|
|
611
|
-
aria-label=${
|
|
644
|
+
${this.error?o`<p class="error" id="${s(this,ye)}-err" role="alert">${this.error}</p>`:c}
|
|
645
|
+
${this.helpText?o`<p class="help" id="${s(this,ye)}-help">${this.helpText}</p>`:c}
|
|
646
|
+
</div>`}};Mi=new WeakMap,j=new WeakMap,ye=new WeakMap,_i=new WeakMap,Fe=new WeakMap,mt=new WeakMap,le=new WeakMap,pe=new WeakMap,zi=new WeakMap,Ti=new WeakMap,g=new WeakSet,Ba=function(){return s(this,Ti)},dt=function(e){e!==s(this,Ti)&&(b(this,Ti,e),this.requestUpdate())},Si=new WeakMap,An=function(){return $n(this,this.locale)},Rt=function(){return En(s(this,g,An))},$i=function(){return ad(s(this,g,An),this.hourCycle)},qe=function(){return this.time?s(this,le):this.value},ht=function(e){return this.time&&e.trim().toLowerCase()==="now"?sd():e},Pe=function(){return D(Ht(n(this,g,ht).call(this,this.min)).date||this.min)},Be=function(){return D(Ht(n(this,g,ht).call(this,this.max)).date||this.max)},Dn=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},cl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?kn(s(this,g,An)):(Math.trunc(e)%7+7)%7},dl=function(){return Mn(s(this,g,Rt),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},ki=function(e){let t=D(e);return t?s(this,g,Rt).short(t):e},Ot=function(e){let t=It(e);return t===null?"":s(this,g,$i).format(t)},hl=function(){return rd(s(this,g,$i),{h:this.t("patternHour"),m:this.t("patternMinute")})},pl=function(e){let{date:t,time:i}=Ht(e);b(this,le,t),b(this,pe,t?i:"")},nd=function(){let e=new Date,t=D(s(this,g,qe))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=ct(t,s(this,g,Pe),s(this,g,Be)),b(this,mt,!0)},Nn=function(){let e=this.renderRoot.querySelector("input")??void 0,t=D(s(this,g,qe)),i=s(this,g,Rt);this.error?s(this,j).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?s(this,j).setValidity({badInput:!0},this.t("badInput",{pattern:s(this,g,dl)}),e):this.time?n(this,g,od).call(this,t,e):this.required&&!t?s(this,j).setValidity({valueMissing:!0},this.t("required"),e):t&&s(this,g,Pe)&&t<s(this,g,Pe)?s(this,j).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(s(this,g,Pe))}),e):t&&s(this,g,Be)&&t>s(this,g,Be)?s(this,j).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(s(this,g,Be))}),e):t&&this.isUnavailable(this.value)?s(this,j).setValidity({customError:!0},this.t("unavailable"),e):s(this,j).setValidity({})},od=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,l=(y,T,M,_=t)=>s(this,j).setValidity(y,this.t(T,M),_),d=It(s(this,pe));if(s(this,g,Ba).trim()&&d===null)return l({badInput:!0},"badTime",{pattern:s(this,g,hl)},i);if(!e&&d===null)return this.required?l({valueMissing:!0},"required"):s(this,j).setValidity({});if(!e)return l({badInput:!0},"required");if(d===null)return l({badInput:!0},"timeMissing",void 0,i);let p=qa(`${s(this,le)}T${s(this,pe)}`),m=qa(n(this,g,ht).call(this,this.min)),x=qa(n(this,g,ht).call(this,this.max),!0),$=(y,T)=>Ht(y).time?s(this,g,$i).dateTime(T):s(this,g,Rt).medium(T);if(m&&p<m)return l({rangeUnderflow:!0},"rangeUnderflow",{date:$(n(this,g,ht).call(this,this.min),m)},i);if(x&&p>x)return l({rangeOverflow:!0},"rangeOverflow",{date:$(n(this,g,ht).call(this,this.max),x)},i);if(d%s(this,g,Dn))return l({stepMismatch:!0},"stepMismatch",{count:s(this,g,Dn)},i);if(this.isUnavailable(s(this,le)))return l({customError:!0},"unavailable");s(this,j).setValidity({})},ml=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})))},Ei=function(e,t){b(this,le,e),b(this,pe,t);let i=e&&t?`${e}T${t}`:"";b(this,Si,!0),this.requestUpdate(),n(this,g,ml).call(this,i)},Fa=function(e){this.time?n(this,g,Ei).call(this,e,s(this,pe)):n(this,g,ml).call(this,e)},ja=function(){let e=this._text.trim();if(!e){n(this,g,Fa).call(this,"");return}let t=_n(e,s(this,g,Rt));t?(n(this,g,Fa).call(this,t),this._text=n(this,g,ki).call(this,t)):(b(this,Fe,!0),n(this,g,Fa).call(this,""))},ul=function(){let e=s(this,g,Ba).trim(),t=e?ll(e,s(this,g,$i)):"";if(b(this,Fe,!0),t===null){b(this,zi,!0),n(this,g,Ei).call(this,s(this,le),"");return}n(this,g,Ei).call(this,s(this,le),t),b(this,g,n(this,g,Ot).call(this,t),dt)},ld=function(e){let t=s(this,g,Dn),i=ll(s(this,g,Ba),s(this,g,$i));if(!i){let m=Ht(n(this,g,ht).call(this,this.min)),x=new Date;if(i=m.time&&(!s(this,le)||s(this,le)===m.date)?m.time:Oa(x.getHours()*60+x.getMinutes()),It(i)%t===0){b(this,Fe,!0),n(this,g,Ei).call(this,s(this,le),i),b(this,g,n(this,g,Ot).call(this,i),dt);return}e=1}let l=It(i),d=e>0?(Math.floor(l/t)+1)*t:(Math.ceil(l/t)-1)*t,p=Oa(d>=1440?0:d<0?Math.floor(1439/t)*t:d);b(this,Fe,!0),n(this,g,Ei).call(this,s(this,le),p),b(this,g,n(this,g,Ot).call(this,p),dt)},In=new WeakMap,bl=function(e){let t=ee(e);this.isUnavailable(t)||(this.open=!1,n(this,g,Fa).call(this,t),this._text=n(this,g,ki).call(this,t),this.time&&!s(this,pe)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):n(this,g,fl).call(this))},fl=function(){this.renderRoot.querySelector(".trigger")?.focus()},Hn=new WeakMap,Rn=new WeakMap,On=new WeakMap,qn=new WeakMap,Pn=new WeakMap,Va=new WeakMap,pt.formAssociated=!0,pt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},pt.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:wi},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_focus:{state:!0}},pt.styles=[v,Cn,Sn,u`.pop { min-width: 0; }`];f("cm-date-picker",pt);var Su=k("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"}),Wh={today:["Today",r=>[r,r]],yesterday:["Yesterday",r=>[oe(r,-1),oe(r,-1)]],"last-7-days":["Last 7 days",r=>[oe(r,-6),r]],"last-30-days":["Last 30 days",r=>[oe(r,-29),r]],"last-90-days":["Last 90 days",r=>[oe(r,-89),r]],"this-month":["This month",r=>[Nt(r),r]],"last-month":["Last month",r=>[Nt(Se(r,-1)),wn(Se(r,-1))]]},Yh=r=>r.replace(/-([a-z0-9])/g,(a,e)=>e.toUpperCase());function cd(r,a=new Date,e){if(typeof r=="object"&&r)return r;let t=Wh[r];if(!t)return null;let i=new Date(a.getFullYear(),a.getMonth(),a.getDate()),[l,d]=t[1](i);return{label:e?.(Yh(r))||t[0],start:ee(l),end:ee(d)}}var Ai,U,me,Di,Ni,bt,L,gl,Li,vl,Ve,Bn,je,dd,Fn,Ci,xl,hd,jn,Vn,Un,Kn,Wn,Ua,yl,ut=class extends w{constructor(){super(...arguments);h(this,L);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";h(this,Ai,"");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,U,this.attachInternals());h(this,me,S("cm-drp"));h(this,Di,null);h(this,Ni,!1);h(this,bt,!1);h(this,Ve,"start");h(this,Vn,()=>{this.disabled||(this.open?this.open=!1:(n(this,L,Ci).call(this,"start"),n(this,L,Ci).call(this,"end"),this.show()))});h(this,Un,e=>t=>{t.key==="Enter"?n(this,L,Ci).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),n(this,L,Ci).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});h(this,Kn,e=>{let t=zn(fe(e,this),e,this._focus,s(this,L,vl));if(t){e.preventDefault(),this._focus=ct(t,D(this.min),D(this.max)),b(this,bt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n(this,L,xl).call(this,this._focus))});h(this,Wn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,n(this,L,jn).call(this);return}Ln(e,e.currentTarget)});h(this,Ua,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Ai)}set locale(e){let t=s(this,Ai);b(this,Ai,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,Di)||b(this,Di,[this.start,this.end]),document.addEventListener("pointerdown",s(this,Ua),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Ua),!0)}get form(){return s(this,U).form}get validity(){return s(this,U).validity}get validationMessage(){return s(this,U).validationMessage}checkValidity(){return s(this,U).checkValidity()}reportValidity(){return s(this,U).reportValidity()}formResetCallback(){[this.start,this.end]=s(this,Di)??["",""],this._startText=n(this,L,je).call(this,this.start),this._endText=n(this,L,je).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=D(this.start)?this.start:"",this._draftEnd=D(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=ct(D(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),D(this.min),D(this.max)),b(this,Ve,"start"),b(this,bt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=D(e);if(!t)return!0;let i=D(this.min),l=D(this.max);return i&&t<i||l&&t>l?!0:Pa(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){s(this,Ni)||(e.has("start")&&(this._startText=n(this,L,je).call(this,this.start)),e.has("end")&&(this._endText=n(this,L,je).call(this,this.end))),b(this,Ni,!1),e.has("locale")&&(D(this.start)&&(this._startText=n(this,L,je).call(this,this.start)),D(this.end)&&(this._endText=n(this,L,je).call(this,this.end)))}updated(){let e=D(this.start),t=D(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),s(this,U).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let l=this.renderRoot.querySelectorAll("input"),[d,p]=[l[0]??void 0,l[1]??void 0],m=s(this,L,Li),x=D(this.min),$=D(this.max);this.error?s(this,U).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?s(this,U).setValidity({badInput:!0},this.t("badStart",{pattern:s(this,L,Bn)}),d):this._endText.trim()&&!t?s(this,U).setValidity({badInput:!0},this.t("badEnd",{pattern:s(this,L,Bn)}),p):this.required&&(!e||!t)?s(this,U).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?s(this,U).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&x&&e<x||t&&x&&t<x?s(this,U).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:m.medium(x)}),d):e&&$&&e>$||t&&$&&t>$?s(this,U).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:m.medium($)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?s(this,U).setValidity({customError:!0},this.t("unavailable"),d):s(this,U).setValidity({}),this.open&&s(this,bt)&&(b(this,bt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=s(this,L,Li),t=D(this.start),i=D(this.end),l=[this.error&&`${s(this,me)}-err`,this.helpText&&`${s(this,me)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",m=Pa(this.presets).map(y=>cd(y,new Date,T=>this.t(T))).filter(y=>!!y),x=s(this,Ve)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(D(this._draftStart))}):this.t("chooseStart"),$=y=>{let T=y==="start"?this._startText:this._endText;return o`<input id="${s(this,me)}-${y}" type="text" autocomplete="off" spellcheck="false"
|
|
647
|
+
.value=${re(T)} placeholder=${s(this,L,Bn)}
|
|
648
|
+
aria-label=${y==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
|
|
612
649
|
?required=${this.required} ?disabled=${this.disabled}
|
|
613
650
|
aria-invalid=${this.error?"true":c} aria-describedby=${l||c}
|
|
614
|
-
@input=${M=>{M.stopPropagation();let
|
|
615
|
-
@change=${()=>
|
|
616
|
-
${this.label?
|
|
651
|
+
@input=${M=>{M.stopPropagation();let _=M.target.value;y==="start"?this._startText=_:this._endText=_}}
|
|
652
|
+
@change=${()=>n(this,L,Ci).call(this,y)} @keydown=${s(this,Un).call(this,y)} />`};return o`<div class="field" role="group" aria-labelledby=${this.label?`${s(this,me)}-l`:c} aria-label=${!this.label&&d?d:c}>
|
|
653
|
+
${this.label?o`<span class="label" id="${s(this,me)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
|
|
617
654
|
<div class="wrap">
|
|
618
655
|
<div class="box" part="box">
|
|
619
656
|
${$("start")}<span class="sep" aria-hidden="true">–</span>${$("end")}
|
|
620
657
|
<button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
|
|
621
|
-
aria-label=${t&&
|
|
622
|
-
aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${
|
|
623
|
-
@click=${
|
|
658
|
+
aria-label=${t&&i?this.t(p?"changeFor":"change",{label:p,start:e.long(t),end:e.long(i)}):this.t(p?"chooseFor":"choose",{label:p})}
|
|
659
|
+
aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,me)}-pop"
|
|
660
|
+
@click=${s(this,Vn)}><cm-icon name="calendar" size="18"></cm-icon></button>
|
|
624
661
|
</div>
|
|
625
|
-
<div class="pop" id="${
|
|
626
|
-
?hidden=${!this.open} @keydown=${
|
|
627
|
-
${this.open?
|
|
628
|
-
${
|
|
629
|
-
<button type="button" class="preset" aria-pressed=${
|
|
630
|
-
@click=${()=>
|
|
631
|
-
<div class="cal">${
|
|
632
|
-
<p class="status" aria-live="polite">${
|
|
662
|
+
<div class="pop" id="${s(this,me)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
|
|
663
|
+
?hidden=${!this.open} @keydown=${s(this,Wn)}>
|
|
664
|
+
${this.open?o`<div class="body">
|
|
665
|
+
${m.length?o`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${m.map(y=>o`<li>
|
|
666
|
+
<button type="button" class="preset" aria-pressed=${y.start===this.start&&y.end===this.end?"true":"false"}
|
|
667
|
+
@click=${()=>n(this,L,hd).call(this,y)}>${y.label}</button></li>`)}</ul>`:c}
|
|
668
|
+
<div class="cal">${Tn({id:s(this,me),fmt:e,firstDay:s(this,L,vl),month:Nt(this._focus),focus:this._focus,min:D(this.min),max:D(this.max),isDisabled:y=>this.isUnavailable(ee(y)),mark:y=>n(this,L,yl).call(this,y),note:y=>{let T=n(this,L,yl).call(this,y);return T==="start"?this.t("startNote"):T==="end"?this.t("endNote"):""},onPick:y=>n(this,L,xl).call(this,y),onKey:s(this,Kn),onMonth:y=>{this._focus=ct(Se(this._focus,y),D(this.min),D(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:y=>{s(this,Ve)==="end"&&(this._hover=y)}})}
|
|
669
|
+
<p class="status" aria-live="polite">${x}</p>
|
|
633
670
|
</div>
|
|
634
671
|
</div>`:c}
|
|
635
672
|
</div>
|
|
636
673
|
</div>
|
|
637
|
-
${this.error?
|
|
638
|
-
${this.helpText?
|
|
639
|
-
</div>`}};
|
|
674
|
+
${this.error?o`<p class="error" id="${s(this,me)}-err" role="alert">${this.error}</p>`:c}
|
|
675
|
+
${this.helpText?o`<p class="help" id="${s(this,me)}-help">${this.helpText}</p>`:c}
|
|
676
|
+
</div>`}};Ai=new WeakMap,U=new WeakMap,me=new WeakMap,Di=new WeakMap,Ni=new WeakMap,bt=new WeakMap,L=new WeakSet,gl=function(){return $n(this,this.locale)},Li=function(){return En(s(this,L,gl))},vl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?kn(s(this,L,gl)):(Math.trunc(e)%7+7)%7},Ve=new WeakMap,Bn=function(){return Mn(s(this,L,Li),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},je=function(e){let t=D(e);return t?s(this,L,Li).short(t):e},dd=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Fn=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,n(this,L,dd).call(this))},Ci=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?_n(t,s(this,L,Li)):"";t&&!i&&b(this,Ni,!0);let l=e==="start"?[i??"",this.end]:[this.start,i??""];n(this,L,Fn).call(this,...l),i&&(e==="start"?this._startText=n(this,L,je).call(this,i):this._endText=n(this,L,je).call(this,i))},xl=function(e){let t=ee(e);if(!this.isUnavailable(t)){if(s(this,Ve)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",b(this,Ve,"end"),this._focus=e,b(this,bt,!0);return}this._draftEnd=t,this.open=!1,n(this,L,Fn).call(this,this._draftStart,t),n(this,L,jn).call(this)}},hd=function(e){this.open=!1,n(this,L,Fn).call(this,e.start,e.end),n(this,L,jn).call(this)},jn=function(){this.renderRoot.querySelector(".trigger")?.focus()},Vn=new WeakMap,Un=new WeakMap,Kn=new WeakMap,Wn=new WeakMap,Ua=new WeakMap,yl=function(e){let t=ee(e),i=this._draftStart,l=this._draftEnd||(s(this,Ve)==="end"&&i?ee(this._hover??this._focus):"");return t===i?"start":t===l&&l>i?"end":i&&l&&t>i&&t<l?"in-range":""},ut.formAssociated=!0,ut.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},ut.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:wi},isDateDisabled:{attribute:!1},presets:{converter:wi},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}},ut.styles=[v,Cn,Sn,u`
|
|
640
677
|
.sep { flex: none; color: var(--cm-text-tertiary); }
|
|
641
678
|
input { flex: 0 1 6.6em; }
|
|
642
679
|
:host([size='small']) input { flex-basis: 6.6em; }
|
|
@@ -656,29 +693,29 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
656
693
|
.presets li { flex: 0 0 auto; }
|
|
657
694
|
.preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-full); min-height: 32px; }
|
|
658
695
|
}
|
|
659
|
-
`];
|
|
660
|
-
${this.label||this.hint?
|
|
661
|
-
${this.label?
|
|
662
|
-
${this.hint?
|
|
696
|
+
`];f("cm-date-range-picker",ut);var Iu=k("fileUpload",{prompt:"Click here to upload",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files"});function Gh(r,a){if(!a.trim())return!0;let e=r.name.toLowerCase(),t=r.type.toLowerCase();return a.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var we,$e,Ue,J,wl,pd,md,Yn,$l,ft=class extends w{constructor(){super(...arguments);h(this,J);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";h(this,we,this.attachInternals());h(this,$e,S("cm-fu"));h(this,Ue,new Map)}get form(){return s(this,we).form}get validity(){return s(this,we).validity}get validationMessage(){return s(this,we).validationMessage}checkValidity(){return s(this,we).checkValidity()}reportValidity(){return s(this,we).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of s(this,Ue).values())URL.revokeObjectURL(e);s(this,Ue).clear()}updated(e){if(e.has("files"))for(let[d,p]of s(this,Ue))this.files.includes(d)||(URL.revokeObjectURL(p),s(this,Ue).delete(d));let t=new FormData;for(let d of this.files)t.append(this.name||"file",d);s(this,we).setFormValue(this.files.length?t:null);let i=this.renderRoot.querySelector("input")??void 0,l=this.error||this._rejected;l?s(this,we).setValidity({customError:!0},l,i):this.required&&!this.files.length?s(this,we).setValidity({valueMissing:!0},this.t("required"),i):s(this,we).setValidity({})}addFiles(e){let t=[...e],i=[],l=[],d=[];for(let m of t)Gh(m,this.accept)?this.maxSize&&m.size>this.maxSize?(l.push(m),d.push(this.t("tooLarge",{name:m.name,size:n(this,J,wl).call(this,this.maxSize)}))):i.push(m):(l.push(m),d.push(this.t("wrongType",{name:m.name})));let p=this.multiple?[...this.files,...i]:i.slice(-1);!this.multiple&&!i.length&&(p=this.files),this.multiple&&this.maxFiles&&p.length>this.maxFiles&&(l.push(...p.slice(this.maxFiles)),d.push(this.t("tooMany",{max:this.maxFiles})),p=p.slice(0,this.maxFiles)),this._rejected=d.join(". "),l.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:l}})),p!==this.files&&(p.length!==this.files.length||p.some((m,x)=>m!==this.files[x]))&&(this.files=p,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return o`
|
|
697
|
+
${this.label||this.hint?o`<div class="head">
|
|
698
|
+
${this.label?o`<span class="label" id="${s(this,$e)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
|
|
699
|
+
${this.hint?o`<span class="hint" id="${s(this,$e)}-hint">${this.hint}</span>`:c}
|
|
663
700
|
</div>`:c}
|
|
664
|
-
${
|
|
665
|
-
${this.files.map(l=>
|
|
666
|
-
${l.type.startsWith("image/")?
|
|
667
|
-
${this.disabled?c:
|
|
701
|
+
${i?o`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
|
|
702
|
+
${this.files.map(l=>o`<li class="file">
|
|
703
|
+
${l.type.startsWith("image/")?o`<img src=${n(this,J,pd).call(this,l)} alt=${l.name} />`:o`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${l.name}</span><span class="size">${n(this,J,wl).call(this,l.size)}</span></div>`}
|
|
704
|
+
${this.disabled?c:o`<button type="button" class="remove" aria-label=${this.t("remove",{name:l.name})} @click=${()=>this.removeFile(l)}><cm-icon name="close" size="12"></cm-icon></button>`}
|
|
668
705
|
</li>`)}
|
|
669
|
-
${t?
|
|
670
|
-
</ul>`:
|
|
671
|
-
${e?
|
|
672
|
-
`}};
|
|
673
|
-
@dragenter=${()=>
|
|
674
|
-
<input type="file" id=${
|
|
706
|
+
${t?o`<li>${n(this,J,$l).call(this,!0)}</li>`:c}
|
|
707
|
+
</ul>`:n(this,J,$l).call(this,!1)}
|
|
708
|
+
${e?o`<p class="msg" id="${s(this,$e)}-msg" role="alert">${e}</p>`:c}
|
|
709
|
+
`}};we=new WeakMap,$e=new WeakMap,Ue=new WeakMap,J=new WeakSet,wl=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},pd=function(e){let t=s(this,Ue).get(e);return t||(t=URL.createObjectURL(e),s(this,Ue).set(e,t)),t},md=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},Yn=function(e){this.toggleAttribute("data-over",e)},$l=function(e){let t=[this.hint&&`${s(this,$e)}-hint`,(this.error||this._rejected)&&`${s(this,$e)}-msg`].filter(Boolean).join(" ");return o`<label class="zone ${e?"tile":""}" part="zone"
|
|
710
|
+
@dragenter=${()=>n(this,J,Yn).call(this,!0)} @dragleave=${()=>n(this,J,Yn).call(this,!1)} @drop=${()=>n(this,J,Yn).call(this,!1)}>
|
|
711
|
+
<input type="file" id=${s(this,$e)} accept=${this.accept||c} ?multiple=${this.multiple} ?disabled=${this.disabled}
|
|
675
712
|
?required=${this.required&&!this.files.length}
|
|
676
|
-
aria-labelledby=${[this.label&&`${
|
|
713
|
+
aria-labelledby=${[this.label&&`${s(this,$e)}-l`,`${s(this,$e)}-p`].filter(Boolean).join(" ")}
|
|
677
714
|
aria-describedby=${t||c} aria-invalid=${this.error||this._rejected?"true":c}
|
|
678
|
-
@change=${
|
|
715
|
+
@change=${n(this,J,md)} @cancel=${i=>i.stopPropagation()} />
|
|
679
716
|
<cm-icon name=${e?"plus":"upload"} size=${e?24:38}></cm-icon>
|
|
680
|
-
<span id="${
|
|
681
|
-
</label>`},
|
|
717
|
+
<span id="${s(this,$e)}-p">${e?this.t("addMore"):this.prompt}</span>
|
|
718
|
+
</label>`},ft.formAssociated=!0,ft.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},ft.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},_rejected:{state:!0}},ft.styles=[v,u`
|
|
682
719
|
:host { display: block; }
|
|
683
720
|
.head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-10); margin-bottom: var(--cm-space-20); }
|
|
684
721
|
.label { font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
|
|
@@ -715,17 +752,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
715
752
|
.zone:not(.tile) { min-height: 100px; font-size: 14px; }
|
|
716
753
|
.label { font-size: var(--cm-type-heading-sm-resp-size); }
|
|
717
754
|
}
|
|
718
|
-
`];
|
|
719
|
-
${this.label?
|
|
755
|
+
`];f("cm-file-upload",ft);var Fu=k("optionGroup",{required:"Please select one of these options."}),Me,Ka,Ii,Wa,Le,kl,El,ud,qt=class extends w{constructor(){super(...arguments);h(this,Le);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];h(this,Me,this.attachInternals());h(this,Ka,S("cm-og"));h(this,Ii,"");h(this,Wa,new MutationObserver(()=>n(this,Le,kl).call(this)))}connectedCallback(){super.connectedCallback(),n(this,Le,kl).call(this),s(this,Wa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Wa).disconnect()}get form(){return s(this,Me).form}get validity(){return s(this,Me).validity}get validationMessage(){return s(this,Me).validationMessage}checkValidity(){return s(this,Me).checkValidity()}reportValidity(){return s(this,Me).reportValidity()}formResetCallback(){this.value=s(this,Ii)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,Ii)||b(this,Ii,this.value)}updated(){s(this,Me).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?s(this,Me).setValidity({valueMissing:!0},this.t("required"),e):s(this,Me).setValidity({})}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),l=this.getAttribute("aria-label");return o`
|
|
756
|
+
${this.label?o`<span class="label" id="${s(this,Ka)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
|
|
720
757
|
<div class="options" part="options" role="radiogroup"
|
|
721
|
-
aria-labelledby=${this.label?`${
|
|
758
|
+
aria-labelledby=${this.label?`${s(this,Ka)}-l`:c} aria-label=${!this.label&&l?l:c}
|
|
722
759
|
aria-required=${this.required?"true":c}>
|
|
723
|
-
${e.map((d,p)=>
|
|
724
|
-
tabindex=${p===
|
|
725
|
-
@click=${()=>
|
|
760
|
+
${e.map((d,p)=>o`<button type="button" role="radio" part="option" aria-checked=${d.value===this.value?"true":"false"}
|
|
761
|
+
tabindex=${p===i?"0":"-1"} ?disabled=${this.disabled||!!d.disabled}
|
|
762
|
+
@click=${()=>n(this,Le,El).call(this,p)} @keydown=${m=>n(this,Le,ud).call(this,m,p)}>${d.label}</button>`)}
|
|
726
763
|
</div>
|
|
727
764
|
<slot></slot>
|
|
728
|
-
`}};
|
|
765
|
+
`}};Me=new WeakMap,Ka=new WeakMap,Ii=new WeakMap,Wa=new WeakMap,Le=new WeakSet,kl=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",b(this,Ii,this.value))},El=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},ud=function(e,t){let i=fe(e,this),l=this.items.flatMap((m,x)=>m.disabled?[]:[x]),d=l.indexOf(t),p;if(i==="ArrowRight"||e.key==="ArrowDown")p=l[(d+1)%l.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&n(this,Le,El).call(this,p)},qt.formAssociated=!0,qt.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},qt.styles=[v,u`
|
|
729
766
|
:host { display: block; }
|
|
730
767
|
.label { display: block; margin-bottom: var(--cm-space-20); font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
|
|
731
768
|
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
@@ -746,25 +783,25 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
746
783
|
.options { gap: var(--cm-space-10); }
|
|
747
784
|
button { height: 42px; padding: 0 var(--cm-space-15); font-size: 14px; }
|
|
748
785
|
}
|
|
749
|
-
`];
|
|
786
|
+
`];f("cm-option-group",qt);var Gu=k("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Ya,Ml,Hi=class extends w{constructor(){super(...arguments);h(this,Ya);this.heading="";this.breadcrumbs=[];this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=[...e].reverse().find(i=>i.href);return o`<header part="header">
|
|
750
787
|
<div class="lead">
|
|
751
|
-
${t?
|
|
788
|
+
${t?o`<a class="back" part="back" href=${t.href} aria-label=${this.t("back",{label:t.label})}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:c}
|
|
752
789
|
<div class="titles">
|
|
753
|
-
${e.length?
|
|
754
|
-
${e.map(
|
|
790
|
+
${e.length?o`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
|
|
791
|
+
${e.map(i=>o`<li>${i.href?o`<a href=${i.href}>${i.label}</a>`:i.label}</li>`)}
|
|
755
792
|
<li><span aria-current="page">${this.heading}</span></li>
|
|
756
793
|
</ol></nav>`:c}
|
|
757
794
|
<h1 part="title"><span class="text">${this.heading}</span><slot name="title-adornment"></slot></h1>
|
|
758
795
|
</div>
|
|
759
796
|
</div>
|
|
760
797
|
<div class="actions">
|
|
761
|
-
${this.pagination?
|
|
762
|
-
<button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>
|
|
763
|
-
<button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>
|
|
798
|
+
${this.pagination?o`<div class="arrows" role="group" aria-label=${this.t("records")}>
|
|
799
|
+
<button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>n(this,Ya,Ml).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
|
|
800
|
+
<button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>n(this,Ya,Ml).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
|
|
764
801
|
</div>`:c}
|
|
765
802
|
<slot name="actions"></slot>
|
|
766
803
|
</div>
|
|
767
|
-
</header>`}};
|
|
804
|
+
</header>`}};Ya=new WeakSet,Ml=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},Hi.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},Hi.styles=[v,u`
|
|
768
805
|
:host { display: block; }
|
|
769
806
|
header {
|
|
770
807
|
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-20);
|
|
@@ -781,10 +818,11 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
781
818
|
nav a:focus-visible, .back:focus-visible, .arrow:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
782
819
|
nav [aria-current] { color: var(--cm-text-default); }
|
|
783
820
|
h1 {
|
|
784
|
-
display: flex; align-items: center; gap: var(--cm-space-10); margin: 0; min-width: 0;
|
|
821
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--cm-space-10); margin: 0; min-width: 0;
|
|
785
822
|
font-size: 26px; font-weight: 500; line-height: 1.2;
|
|
786
823
|
}
|
|
787
|
-
|
|
824
|
+
/* The title keeps at least about 12 characters; badges in title-adornment wrap below it instead of pushing the page wider. */
|
|
825
|
+
.text { flex: 0 1 auto; min-width: min(12ch, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
788
826
|
.actions { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); margin-inline-start: auto; }
|
|
789
827
|
.arrows { display: flex; gap: var(--cm-space-10); }
|
|
790
828
|
.arrow, .back {
|
|
@@ -805,17 +843,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
805
843
|
h1 { font-size: 18px; font-weight: 600; }
|
|
806
844
|
.actions { gap: var(--cm-space-10); }
|
|
807
845
|
}
|
|
808
|
-
`];
|
|
846
|
+
`];f("cm-page-header",Hi);var ib=k("actionBar",{label:"Actions"}),Ri=class extends w{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return o`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
|
|
809
847
|
<div class="lead">
|
|
810
|
-
${e?
|
|
848
|
+
${e?o`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:c}
|
|
811
849
|
<div class="text">
|
|
812
850
|
<div class="eyebrow" ?hidden=${!this.eyebrow}>${this.eyebrow}<slot name="adornment"></slot></div>
|
|
813
|
-
${this.heading?
|
|
851
|
+
${this.heading?o`<p class="heading" part="heading" role=${e?"alert":c}>${this.heading}</p>`:c}
|
|
814
852
|
<slot></slot>
|
|
815
853
|
</div>
|
|
816
854
|
</div>
|
|
817
855
|
<div class="actions"><slot name="actions"></slot></div>
|
|
818
|
-
</div>`}};
|
|
856
|
+
</div>`}};Ri.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},Ri.styles=[v,u`
|
|
819
857
|
:host { display: block; }
|
|
820
858
|
:host([sticky]) { position: sticky; bottom: 0; z-index: 10; }
|
|
821
859
|
.bar {
|
|
@@ -846,13 +884,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
846
884
|
.icon { width: 30px; height: 30px; }
|
|
847
885
|
.actions { gap: var(--cm-space-10); }
|
|
848
886
|
}
|
|
849
|
-
`];
|
|
887
|
+
`];f("cm-action-bar",Ri);var lb=k("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Ce,Pt,Ga,te,_l,zl,Tl,bd,fd,Oi=class extends w{constructor(){super(...arguments);h(this,te);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";h(this,Ce,null);h(this,Pt,()=>{this.open=!0});h(this,Ga,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>n(this,te,_l).call(this))}disconnectedCallback(){super.disconnectedCallback(),n(this,te,zl).call(this)}updated(e){e.has("form")&&this.isConnected&&n(this,te,_l).call(this)}render(){return o`<div class="bar" part="bar" role="region" aria-label=${this.message}>
|
|
850
888
|
<p class="message" part="message" role="status">${this.open?this.message:""}</p>
|
|
851
889
|
<div class="actions">
|
|
852
|
-
<cm-button size="large" ?disabled=${this.loading} @click=${
|
|
853
|
-
<cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${
|
|
890
|
+
<cm-button size="large" ?disabled=${this.loading} @click=${n(this,te,fd)}>${this.discardLabel}</cm-button>
|
|
891
|
+
<cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${n(this,te,bd)}>${this.saveLabel}</cm-button>
|
|
854
892
|
</div>
|
|
855
|
-
</div>`}};
|
|
893
|
+
</div>`}};Ce=new WeakMap,Pt=new WeakMap,Ga=new WeakMap,te=new WeakSet,_l=function(){n(this,te,zl).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(b(this,Ce,e),e.addEventListener("input",s(this,Pt)),e.addEventListener("change",s(this,Pt)),e.addEventListener("reset",s(this,Ga)))},zl=function(){let e=s(this,Ce);e&&(e.removeEventListener("input",s(this,Pt)),e.removeEventListener("change",s(this,Pt)),e.removeEventListener("reset",s(this,Ga)),b(this,Ce,null))},Tl=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},bd=function(){this.loading||this.saveDisabled||n(this,te,Tl).call(this,"cm-save")&&s(this,Ce)&&s(this,Ce).requestSubmit()},fd=function(){this.loading||n(this,te,Tl).call(this,"cm-discard")&&s(this,Ce)&&(s(this,Ce).reset(),this.open=!1)},Oi.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},Oi.styles=[v,u`
|
|
856
894
|
:host { display: block; position: sticky; bottom: 0; z-index: 20; }
|
|
857
895
|
:host(:not([open])) { display: none; }
|
|
858
896
|
.bar {
|
|
@@ -868,14 +906,14 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
868
906
|
.message { font-size: 14px; font-weight: 500; }
|
|
869
907
|
.actions { gap: var(--cm-space-10); }
|
|
870
908
|
}
|
|
871
|
-
`];
|
|
872
|
-
${this.heading||this.action?
|
|
909
|
+
`];f("cm-save-bar",Oi);var qi=class extends E{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<section part="panel" aria-label=${this.heading||c}>
|
|
910
|
+
${this.heading||this.action?o`<header>
|
|
873
911
|
<div class="title" role="heading" aria-level=${e} part="title">${this.heading}</div>
|
|
874
|
-
${this.action?
|
|
912
|
+
${this.action?o`<button class="action" type="button" part="action" aria-label=${this.actionLabel||c}
|
|
875
913
|
@click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:c}
|
|
876
914
|
</header>`:c}
|
|
877
|
-
<div class="items" role=${this._list?"list":c}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(
|
|
878
|
-
</section>`}};
|
|
915
|
+
<div class="items" role=${this._list?"list":c}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
|
|
916
|
+
</section>`}};qi.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},qi.styles=[v,u`
|
|
879
917
|
:host { display: block; }
|
|
880
918
|
section {
|
|
881
919
|
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
|
|
@@ -891,7 +929,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
891
929
|
.action:hover { text-decoration: underline; }
|
|
892
930
|
.action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
893
931
|
.items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-15) var(--cm-space-20); }
|
|
894
|
-
`];
|
|
932
|
+
`];f("cm-info-panel",qi);var Pi=class extends E{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return o`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};Pi.properties={label:{},half:{type:Boolean,reflect:!0}},Pi.styles=[v,u`
|
|
895
933
|
:host { display: block; grid-column: 1 / -1; min-width: 0; }
|
|
896
934
|
:host([half]) { grid-column: auto; }
|
|
897
935
|
.label { font-size: 16px; }
|
|
@@ -899,16 +937,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
899
937
|
display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10);
|
|
900
938
|
margin-top: 6px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere;
|
|
901
939
|
}
|
|
902
|
-
`];
|
|
940
|
+
`];f("cm-info-item",Pi);var Bt,Bi=class extends E{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;h(this,Bt,S("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return o`<div class="wrap" part="accordion">
|
|
903
941
|
<div class="h" role="heading" aria-level=${e}>
|
|
904
|
-
<button type="button" part="toggle" id="${
|
|
942
|
+
<button type="button" part="toggle" id="${s(this,Bt)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Bt)}-body"
|
|
905
943
|
?disabled=${this.disabled} @click=${this.toggle}>
|
|
906
944
|
<span>${this.heading}</span>
|
|
907
945
|
<span class="chev" aria-hidden="true"><cm-icon name="chevron-down" size="16"></cm-icon></span>
|
|
908
946
|
</button>
|
|
909
947
|
</div>
|
|
910
|
-
<div class="body" part="body" id="${
|
|
911
|
-
</div>`}};
|
|
948
|
+
<div class="body" part="body" id="${s(this,Bt)}-body" role="region" aria-labelledby="${s(this,Bt)}-btn" ?hidden=${!this.open}><slot></slot></div>
|
|
949
|
+
</div>`}};Bt=new WeakMap,Bi.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Bi.styles=[v,u`
|
|
912
950
|
:host { display: block; }
|
|
913
951
|
.wrap { border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
|
|
914
952
|
.h { margin: 0; font: inherit; }
|
|
@@ -930,14 +968,24 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
930
968
|
.body { padding: var(--cm-space-15) var(--cm-space-20); border-top: var(--cm-border-1) solid var(--cm-border-default); font-size: 14px; }
|
|
931
969
|
.body[hidden] { display: none; }
|
|
932
970
|
@media (max-width: 640px) { button { min-height: 50px; font-size: 14px; } .chev { width: 28px; height: 28px; } }
|
|
933
|
-
`];
|
|
971
|
+
`];f("cm-accordion",Bi);var ce,Ft,Sl,gd,Fi=class extends E{constructor(){super(...arguments);h(this,ce);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="large";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return n(this,ce,gd).call(this,e);let t=this.image?o`<img src=${this.image} alt="" part="image">`:this.icon?o`<cm-icon name=${this.icon} size="96"></cm-icon>`:c;return o`<div class="wrap" part="empty-state">
|
|
934
972
|
<div class="circle" part="circle" aria-hidden=${this.hasImage?c:"true"}>
|
|
935
|
-
<slot name="image" @slotchange=${
|
|
973
|
+
<slot name="image" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasImage")}>${t}</slot>
|
|
936
974
|
</div>
|
|
937
975
|
<div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
|
|
938
|
-
<div class="text" ?hidden=${!this.hasText}><slot @slotchange=${
|
|
939
|
-
<div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${
|
|
940
|
-
</div>`}};
|
|
976
|
+
<div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasText")}></slot></div>
|
|
977
|
+
<div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasActions")}></slot></div>${this.action?o`<div class="actions">${n(this,ce,Sl).call(this)}</div>`:c}
|
|
978
|
+
</div>`}};ce=new WeakSet,Ft=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(l=>l.nodeType===1||l.textContent.trim()),this.requestUpdate()},Sl=function(){return this.action?this.actionHref?o`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:o`<button class="text-action" type="button" part="action"
|
|
979
|
+
@click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:c},gd=function(e){let t=this.image?o`<img src=${this.image} alt="" part="image">`:this.icon?o`<cm-icon name=${this.icon} size="20"></cm-icon>`:c;return o`<div class="wrap inline" part="empty-state">
|
|
980
|
+
<span class="icon" part="circle" aria-hidden=${this.hasImage?c:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
|
|
981
|
+
<slot name="image" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasImage")}>${t}</slot>
|
|
982
|
+
</span>
|
|
983
|
+
<div class="line">
|
|
984
|
+
<div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
|
|
985
|
+
<span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasText")}></slot></span>${n(this,ce,Sl).call(this)}
|
|
986
|
+
<span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasActions")}></slot></span>
|
|
987
|
+
</div>
|
|
988
|
+
</div>`},Fi.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},Fi.styles=[v,u`
|
|
941
989
|
:host { display: block; }
|
|
942
990
|
.wrap {
|
|
943
991
|
display: flex; flex-direction: column; align-items: center; text-align: center;
|
|
@@ -956,12 +1004,30 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
956
1004
|
:host([size='small']) .circle { width: 200px; height: 200px; }
|
|
957
1005
|
:host([size='small']) .title { margin-top: 30px; font-size: 14px; }
|
|
958
1006
|
:host([size='small']) .actions { gap: var(--cm-space-10); }
|
|
1007
|
+
/* Inline (1.2): a line of text with an optional 20px icon, no circle, no extra height. */
|
|
1008
|
+
.inline { flex-direction: row; align-items: flex-start; gap: var(--cm-space-10); padding: 0; text-align: start; font-size: 14px; line-height: 20px; }
|
|
1009
|
+
.inline .icon { display: inline-flex; flex: none; width: 20px; height: 20px; overflow: hidden; color: var(--cm-icon-default); }
|
|
1010
|
+
.inline .icon img, .inline ::slotted([slot='image']) { width: 20px; height: 20px; max-width: none; max-height: none; object-fit: contain; }
|
|
1011
|
+
.inline .line { min-width: 0; text-align: start; }
|
|
1012
|
+
.inline .title { display: inline; margin: 0; font-size: inherit; font-weight: 500; color: var(--cm-text-default); }
|
|
1013
|
+
.inline .text { display: inline; margin: 0; font-size: inherit; color: var(--cm-text-tertiary); }
|
|
1014
|
+
.inline .actions { display: inline-flex; vertical-align: middle; margin: 0; margin-inline-start: var(--cm-space-10); }
|
|
1015
|
+
.inline .text[hidden], .inline .actions[hidden], .inline .icon[hidden] { display: none; }
|
|
1016
|
+
.text-action {
|
|
1017
|
+
display: inline-flex; align-items: center; min-height: 24px; vertical-align: middle;
|
|
1018
|
+
margin: -2px 0; padding: 0 2px; border: 0; background: none; cursor: pointer;
|
|
1019
|
+
font: inherit; font-weight: 500; color: var(--cm-text-default);
|
|
1020
|
+
text-decoration: underline; text-underline-offset: 3px; border-radius: var(--cm-radius-xs);
|
|
1021
|
+
}
|
|
1022
|
+
.text-action:hover { text-decoration-thickness: 2px; }
|
|
1023
|
+
.text-action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1024
|
+
.inline .text-action { display: inline; min-height: 0; vertical-align: baseline; margin: 0; margin-inline-start: var(--cm-space-10); padding-block: 2px; }
|
|
959
1025
|
@media (max-width: 640px) {
|
|
960
1026
|
.circle { width: 200px; height: 200px; }
|
|
961
1027
|
.title { margin-top: 30px; font-size: 14px; }
|
|
962
1028
|
.actions { gap: var(--cm-space-10); }
|
|
963
1029
|
}
|
|
964
|
-
`];
|
|
1030
|
+
`];f("cm-empty-state",Fi);var vd={small:34,medium:40,large:50,xlarge:186},ji=class extends E{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=vd[this.size]??vd.large;return o`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return o`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return o`${Array.from({length:e},(t,i)=>o`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};ji.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},ji.styles=[v,u`
|
|
965
1031
|
:host { display: block; --cm-skeleton-height: 120px; }
|
|
966
1032
|
:host([variant='thumbnail']) { display: inline-block; vertical-align: middle; }
|
|
967
1033
|
.bone {
|
|
@@ -976,17 +1042,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
976
1042
|
.bone { animation: none; background: var(--cm-thumb-bg); }
|
|
977
1043
|
}
|
|
978
1044
|
@media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
|
|
979
|
-
`];
|
|
1045
|
+
`];f("cm-skeleton",ji);var Xh=[472,90,90,251],Jh=[94,266,134,191,138],Vi=class extends w{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>o`<span class="bone" style="height:${i}px"></span>`);return o`<div class="wrap" part="skeleton-display" aria-busy="true">
|
|
980
1046
|
<span class="sr" role="status">${this.label}</span>
|
|
981
1047
|
<div class="page" aria-hidden="true">
|
|
982
|
-
${this.navigation?
|
|
1048
|
+
${this.navigation?o`<span class="bone nav"></span>`:c}
|
|
983
1049
|
<span class="bone head"></span>
|
|
984
1050
|
<div class="body">
|
|
985
|
-
<div class="col main">${e(this.layout==="one-column"?[472,251]:
|
|
986
|
-
<div class="col side">${e(
|
|
1051
|
+
<div class="col main">${e(this.layout==="one-column"?[472,251]:Xh)}</div>
|
|
1052
|
+
<div class="col side">${e(Jh)}</div>
|
|
987
1053
|
</div>
|
|
988
1054
|
</div>
|
|
989
|
-
</div>`}};
|
|
1055
|
+
</div>`}};Vi.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Vi.styles=[v,u`
|
|
990
1056
|
:host { display: block; }
|
|
991
1057
|
.page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-10); }
|
|
992
1058
|
:host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
|
|
@@ -1010,11 +1076,11 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1010
1076
|
.body { grid-template-columns: minmax(0, 1fr); }
|
|
1011
1077
|
.head { height: 60px; }
|
|
1012
1078
|
}
|
|
1013
|
-
`];
|
|
1014
|
-
${e?
|
|
1079
|
+
`];f("cm-skeleton-display",Vi);var Nb=k("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Gn,xd,Ui=class extends w{constructor(){super(...arguments);h(this,Gn);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=n(this,Gn,xd).call(this);return o`<article part="comment">
|
|
1080
|
+
${e?o`<time class="meta" part="time" datetime=${this.datetime||c}>${e}</time>`:c}
|
|
1015
1081
|
<div class="body" part="body"><slot></slot></div>
|
|
1016
|
-
${this.author?
|
|
1017
|
-
</article>`}};
|
|
1082
|
+
${this.author?o`<div class="meta" part="author">– ${this.author}</div>`:c}
|
|
1083
|
+
</article>`}};Gn=new WeakSet,xd=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:V(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},Ui.properties={author:{},datetime:{},time:{}},Ui.styles=[v,u`
|
|
1018
1084
|
:host { display: block; }
|
|
1019
1085
|
article {
|
|
1020
1086
|
display: flex; flex-direction: column; gap: 6px; padding: var(--cm-space-10);
|
|
@@ -1022,16 +1088,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1022
1088
|
}
|
|
1023
1089
|
.meta { font-size: 12px; color: var(--cm-text-tertiary); }
|
|
1024
1090
|
.body { font-size: 14px; line-height: 16px; overflow-wrap: anywhere; }
|
|
1025
|
-
`];
|
|
1026
|
-
<div class="title" id="${
|
|
1091
|
+
`];f("cm-comment",Ui);var Xa,Xn,yd,Ki=class extends w{constructor(){super(...arguments);h(this,Xn);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;h(this,Xa,S("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<section part="comment-box" aria-labelledby="${s(this,Xa)}-h">
|
|
1092
|
+
<div class="title" id="${s(this,Xa)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
|
|
1027
1093
|
<textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||c} .value=${this.value}
|
|
1028
1094
|
?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
|
|
1029
|
-
@keydown=${
|
|
1095
|
+
@keydown=${n(this,Xn,yd)}></textarea>
|
|
1030
1096
|
<div class="actions"><cm-button variant="primary" size="large" ?disabled=${this.disabled} @click=${()=>this.submit()}>${this.action}</cm-button></div>
|
|
1031
1097
|
<div class="list" role="list" ?hidden=${!this.hasComments}>
|
|
1032
1098
|
<slot @slotchange=${t=>{this.hasComments=t.target.assignedElements().length>0,this.requestUpdate()}}></slot>
|
|
1033
1099
|
</div>
|
|
1034
|
-
</section>`}};
|
|
1100
|
+
</section>`}};Xa=new WeakMap,Xn=new WeakSet,yd=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},Ki.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Ki.styles=[v,u`
|
|
1035
1101
|
:host { display: block; }
|
|
1036
1102
|
section { display: flex; flex-direction: column; gap: var(--cm-space-20); }
|
|
1037
1103
|
.title { margin: 0; font-size: 20px; font-weight: 600; }
|
|
@@ -1052,14 +1118,111 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1052
1118
|
textarea { min-height: 100px; }
|
|
1053
1119
|
.actions { justify-content: flex-end; }
|
|
1054
1120
|
}
|
|
1055
|
-
`];
|
|
1121
|
+
`];f("cm-comment-box",Ki);var Jn='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',K,Yi,gt,vt,Ae,Gi,Xi,ue,Ll,Zn,Qn,eo,to,Ji,wd,jt,Cl,Al,Ke,Wi=class extends E{constructor(){super(...arguments);h(this,ue);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";h(this,K);h(this,Yi);h(this,gt,[]);h(this,vt);h(this,Ae);h(this,Gi,!1);h(this,Xi,!1);h(this,Zn,()=>{b(this,Gi,!0),clearTimeout(s(this,Ae)),this.open||b(this,Ae,setTimeout(()=>this.show(),this.delay))});h(this,Qn,()=>{b(this,Gi,!1),clearTimeout(s(this,Ae)),s(this,Xi)||b(this,Ae,setTimeout(()=>this.hide(),100))});h(this,eo,()=>{b(this,Xi,!0),this.show()});h(this,to,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(b(this,Xi,!1),s(this,Gi)||this.hide())});h(this,Ji,e=>{e.key==="Escape"&&this.open&&this.hide()});h(this,jt,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(n(this,ue,Al).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(Jn)&&i.then(()=>{t.shadowRoot?.querySelector(Jn)&&s(this,jt).call(this)}),s(this,K)||(b(this,K,document.createElement("span")),s(this,K).id=S("cm-tooltip"),s(this,K).hidden=!0,s(this,K).slot="description"),s(this,K).textContent=this.content,s(this,K).isConnected||this.append(s(this,K));let l=n(this,ue,wd).call(this,t);if(b(this,Yi,l),l.getRootNode()===s(this,K).getRootNode()){let d=(l.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);d.includes(s(this,K).id)||l.setAttribute("aria-describedby",[...d,s(this,K).id].join(" "))}else"ariaDescribedByElements"in l?(n(this,ue,Cl).call(this,l),b(this,vt,new MutationObserver(()=>{l.getAttribute("aria-describedby")!==""&&n(this,ue,Cl).call(this,l)})),s(this,vt).observe(l,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",s(this,K).id)});h(this,Ke,()=>{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,m=8,x=innerWidth,$=innerHeight,y=getComputedStyle(this).direction==="rtl",T=si=>si==="start"?y?"right":"left":si==="end"?y?"left":"right":si,M={top:l.top-p-d.height>=m,bottom:l.bottom+p+d.height<=$-m,left:l.left-p-d.width>=m,right:l.right+p+d.width<=x-m},_={top:"bottom",bottom:"top",left:"right",right:"left"},R=T(this.placement);!M[R]&&M[_[R]]&&(R=_[R]);let O,q;R==="top"||R==="bottom"?(O=l.left+l.width/2-d.width/2,q=R==="top"?l.top-p-d.height:l.bottom+p):(q=l.top+l.height/2-d.height/2,O=R==="left"?l.left-p-d.width:l.right+p),O=Math.min(Math.max(m,O),x-m-d.width),q=Math.min(Math.max(m,q),$-m-d.height),e.style.transform=`translate(${Math.round(O)}px, ${Math.round(q)}px)`;let ii={top:"top",bottom:"bottom",left:y?"end":"start",right:y?"start":"end"};this._side=ii[R]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",s(this,Zn)),this.addEventListener("pointerleave",s(this,Qn)),this.addEventListener("focusin",s(this,eo)),this.addEventListener("focusout",s(this,to)),this.addEventListener("keydown",s(this,Ji)),this.hasUpdated&&s(this,jt).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),n(this,ue,Al).call(this),n(this,ue,Ll).call(this),clearTimeout(s(this,Ae))}show(){clearTimeout(s(this,Ae)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",s(this,Ji),!0),addEventListener("scroll",s(this,Ke),!0),addEventListener("resize",s(this,Ke)),this.updateComplete.then(s(this,Ke)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(s(this,Ae)),this.open&&(this.open=!1,n(this,ue,Ll).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(s(this,jt).call(this),this.content?this.open&&s(this,Ke).call(this):this.hide())}render(){return o`<slot @slotchange=${s(this,jt)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
|
|
1122
|
+
data-side=${this._side}>${this.content}</div>`}};K=new WeakMap,Yi=new WeakMap,gt=new WeakMap,vt=new WeakMap,Ae=new WeakMap,Gi=new WeakMap,Xi=new WeakMap,ue=new WeakSet,Ll=function(){document.removeEventListener("keydown",s(this,Ji),!0),removeEventListener("scroll",s(this,Ke),!0),removeEventListener("resize",s(this,Ke))},Zn=new WeakMap,Qn=new WeakMap,eo=new WeakMap,to=new WeakMap,Ji=new WeakMap,wd=function(e){return e.matches(Jn)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Jn)??e},jt=new WeakMap,Cl=function(e){b(this,gt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=s(this,gt).map(l=>t.getElementById(l)).filter(l=>!!l);e.ariaDescribedByElements=[...i,s(this,K)]},Al=function(){let e=s(this,Yi);if(!(!e||!s(this,K))){if(s(this,vt))s(this,vt).disconnect(),b(this,vt,void 0),s(this,gt).length?e.setAttribute("aria-describedby",s(this,gt).join(" ")):e.removeAttribute("aria-describedby"),b(this,gt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==s(this,K).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}b(this,Yi,void 0)}},Ke=new WeakMap,Wi.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Wi.styles=[v,u`
|
|
1123
|
+
:host { display: inline-block; position: relative; }
|
|
1124
|
+
.tip {
|
|
1125
|
+
position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
|
|
1126
|
+
max-width: min(280px, calc(100vw - 16px)); width: max-content;
|
|
1127
|
+
padding: 6px var(--cm-space-10); border-radius: var(--cm-radius-sm);
|
|
1128
|
+
background: var(--cm-bg-panel-header); color: var(--cm-text-on-dark);
|
|
1129
|
+
font-size: 12px; line-height: 16px; font-weight: 400; white-space: normal; overflow-wrap: anywhere;
|
|
1130
|
+
box-shadow: var(--cm-shadow-100); pointer-events: auto;
|
|
1131
|
+
opacity: 0; visibility: hidden; transition: opacity 120ms ease;
|
|
1132
|
+
}
|
|
1133
|
+
:host([open]) .tip { opacity: 1; visibility: visible; }
|
|
1134
|
+
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
1135
|
+
@media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
|
|
1136
|
+
`];f("cm-tooltip",Wi);var Vb=k("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),Ub=k("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),Zh=7,Ja=new Set,Za;function $d(r,a){a?Ja.add(r):Ja.delete(r),Ja.size&&!Za&&(Za=setInterval(()=>Ja.forEach(e=>e.requestUpdate()),6e4)),!Ja.size&&Za&&(clearInterval(Za),Za=void 0)}var Qa,Ut,_e,Dl,io,kd,Zi=class extends w{constructor(){super(...arguments);h(this,_e);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;h(this,Qa,S("cm-tl"));h(this,Ut)}connectedCallback(){super.connectedCallback(),$d(this,!0)}disconnectedCallback(){super.disconnectedCallback(),$d(this,!1),s(this,Ut)?.disconnect(),b(this,Ut,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(b(this,Ut,new ResizeObserver(()=>n(this,_e,Dl).call(this))),s(this,Ut).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&n(this,_e,Dl).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,l=Math.floor(Math.abs(t)/6e4);if(l<1)return this.t("justNow");if(l<60)return this.t(i?"inMinutes":"minutesAgo",{count:l});let d=Math.floor(l/60);if(d<24)return this.t(i?"inHours":"hoursAgo",{count:d});let p=Math.floor(d/24);return p<Zh?this.t(i?"inDays":"daysAgo",{count:p}):V(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?V(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",l=this.lines>0&&!this.expanded,d=e?t?o`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:o`<time class="when" part="time" datetime=${this.datetime||c}>${e}</time>`:c;return o`<div class="item">
|
|
1137
|
+
<span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?o`<cm-icon name=${this.icon} size="16"></cm-icon>`:o`<span class="dot"></span>`}</span>
|
|
1138
|
+
<div class="main">
|
|
1139
|
+
<div class="head">
|
|
1140
|
+
<span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
|
|
1141
|
+
<slot name="badge"></slot>
|
|
1142
|
+
${d}
|
|
1143
|
+
</div>
|
|
1144
|
+
<div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${p=>n(this,_e,io).call(this,p,"_meta")}>${this.meta}</slot></div>
|
|
1145
|
+
<div class="body ${l?"clamp":""}" id="${s(this,Qa)}-body" part="body" ?hidden=${!this._body}
|
|
1146
|
+
style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${p=>n(this,_e,io).call(this,p,"_body")}></slot></div>
|
|
1147
|
+
${this._body&&this._overflow?o`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
|
|
1148
|
+
aria-controls="${s(this,Qa)}-body" @click=${n(this,_e,kd)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:c}
|
|
1149
|
+
<div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${p=>n(this,_e,io).call(this,p,"_actions")}></slot></div>
|
|
1150
|
+
</div>
|
|
1151
|
+
</div>`}};Qa=new WeakMap,Ut=new WeakMap,_e=new WeakSet,Dl=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},io=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(l=>l.nodeType===Node.ELEMENT_NODE||(l.textContent??"").trim())},kd=function(){this.expanded=!this.expanded},Zi.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},Zi.styles=[v,u`
|
|
1152
|
+
:host { display: block; min-width: 0; font-size: 14px; line-height: 20px; }
|
|
1153
|
+
.item { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
|
|
1154
|
+
.icon {
|
|
1155
|
+
position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--cm-radius-full);
|
|
1156
|
+
background: var(--cm-bg-inset); color: var(--cm-icon-default); border: var(--cm-border-1) solid var(--cm-border-default);
|
|
1157
|
+
}
|
|
1158
|
+
.icon.information { background: var(--cm-bg-information-soft); color: var(--cm-text-information); border-color: transparent; }
|
|
1159
|
+
.icon.attention { background: var(--cm-bg-attention); color: var(--cm-text-attention); border-color: transparent; }
|
|
1160
|
+
.icon.success { background: var(--cm-bg-success-soft); color: var(--cm-text-success); border-color: transparent; }
|
|
1161
|
+
.icon.critical { background: var(--cm-bg-critical); color: var(--cm-text-critical); border-color: transparent; }
|
|
1162
|
+
.dot { width: 10px; height: 10px; border-radius: var(--cm-radius-full); background: currentColor; }
|
|
1163
|
+
.main { flex: 1; min-width: 0; padding-block-start: 6px; }
|
|
1164
|
+
.head { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--cm-space-10); row-gap: 4px; }
|
|
1165
|
+
.title { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
|
|
1166
|
+
.when { margin-inline-start: auto; }
|
|
1167
|
+
time {
|
|
1168
|
+
position: relative; display: inline-block; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); white-space: nowrap;
|
|
1169
|
+
border-radius: var(--cm-radius-xs);
|
|
1170
|
+
}
|
|
1171
|
+
time:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1172
|
+
.meta { margin-block-start: 2px; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); overflow-wrap: anywhere; }
|
|
1173
|
+
.body { margin-block-start: var(--cm-space-10); overflow-wrap: anywhere; }
|
|
1174
|
+
.body.clamp {
|
|
1175
|
+
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--_lines); overflow: hidden;
|
|
1176
|
+
max-height: calc(var(--_lines) * 20px);
|
|
1177
|
+
}
|
|
1178
|
+
.toggle {
|
|
1179
|
+
margin-block-start: 4px; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--cm-text-default);
|
|
1180
|
+
text-decoration: underline; background: none; border: 0; cursor: pointer; min-height: 24px;
|
|
1181
|
+
}
|
|
1182
|
+
.toggle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
1183
|
+
.actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); margin-block-start: var(--cm-space-10); }
|
|
1184
|
+
[hidden] { display: none !important; }
|
|
1185
|
+
.sr { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
1186
|
+
::slotted([slot='badge']) { flex: none; }
|
|
1187
|
+
`];f("cm-timeline-item",Zi);var er,Qi,Kt,Nl,Ed,Vt=class extends w{constructor(){super(...arguments);h(this,Kt);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];h(this,er,new MutationObserver(()=>n(this,Kt,Nl).call(this)));h(this,Qi,!1)}connectedCallback(){super.connectedCallback(),n(this,Kt,Nl).call(this),s(this,er).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,er).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){b(this,Qi,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,l)=>{this._items[l]&&i.assign(this._items[l])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),s(this,Qi)&&!this.renderRoot.querySelector(".more cm-button")&&(b(this,Qi,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?o`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>o`<div class="sk">
|
|
1188
|
+
<cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:c;return o`
|
|
1189
|
+
${e.length?o`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
|
|
1190
|
+
${e.map(()=>o`<li><slot></slot></li>`)}
|
|
1191
|
+
</ol>`:c}
|
|
1192
|
+
${i}
|
|
1193
|
+
${!e.length&&!t?o`<slot class="empty"></slot>`:c}
|
|
1194
|
+
${this.hasMore&&e.length?o`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${n(this,Kt,Ed)}>${this.moreLabel}</cm-button></div>`:c}
|
|
1195
|
+
<span class="sr" role="status">${t?this.t("loading"):""}</span>
|
|
1196
|
+
`}};er=new WeakMap,Qi=new WeakMap,Kt=new WeakSet,Nl=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},Ed=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},Vt.shadowRootOptions={...E.shadowRootOptions,slotAssignment:"manual"},Vt.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},Vt.styles=[v,u`
|
|
1197
|
+
:host { display: block; }
|
|
1198
|
+
ol { margin: 0; padding: 0; list-style: none; }
|
|
1199
|
+
ol:focus { outline: none; }
|
|
1200
|
+
li { position: relative; padding-block-end: var(--cm-space-20); }
|
|
1201
|
+
/* The line joining the icons (16px is half the 32px icon). Decorative: a pseudo-element, nothing to read. */
|
|
1202
|
+
li::before {
|
|
1203
|
+
content: ''; position: absolute; inset-inline-start: 15px; inset-block: 32px 0; width: 2px; background: var(--cm-border-default);
|
|
1204
|
+
}
|
|
1205
|
+
li:last-child::before { display: none; }
|
|
1206
|
+
:host([has-more]) li:last-child::before { display: block; }
|
|
1207
|
+
li:last-child { padding-block-end: 0; }
|
|
1208
|
+
:host([has-more]) li:last-child { padding-block-end: var(--cm-space-20); }
|
|
1209
|
+
.more { display: flex; padding-inline-start: 47px; }
|
|
1210
|
+
.loading { display: grid; gap: var(--cm-space-20); }
|
|
1211
|
+
.sk { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
|
|
1212
|
+
.sk .ic { flex: none; width: 32px; --cm-skeleton-height: 32px; }
|
|
1213
|
+
.sk .tx { flex: 1; }
|
|
1214
|
+
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
1215
|
+
@media (max-width: 640px) {
|
|
1216
|
+
.more { padding-inline-start: 0; }
|
|
1217
|
+
}
|
|
1218
|
+
`];f("cm-timeline",Vt);var Zb=k("smartTip",{newTab:"(opens in a new tab)"}),Qb=k("smartTips",{heading:"Smart tips",tourAction:"Start"}),es=class extends w{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return o`<a part="tip" href=${this.href||c} target=${this.target||c} rel=${e?"noopener noreferrer":c}>
|
|
1056
1219
|
<span class="text">
|
|
1057
1220
|
<span class="title" part="heading">${this.heading}</span>
|
|
1058
1221
|
<span class="desc" part="description"><slot></slot></span>
|
|
1059
|
-
${e?
|
|
1222
|
+
${e?o`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:c}
|
|
1060
1223
|
</span>
|
|
1061
1224
|
<span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
|
|
1062
|
-
</a>`}};
|
|
1225
|
+
</a>`}};es.properties={heading:{},href:{},target:{}},es.styles=[v,u`
|
|
1063
1226
|
:host { display: block; }
|
|
1064
1227
|
a {
|
|
1065
1228
|
display: flex; align-items: flex-start; gap: var(--cm-space-10); padding: var(--cm-space-20) var(--cm-space-10);
|
|
@@ -1076,8 +1239,8 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1076
1239
|
}
|
|
1077
1240
|
a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
|
|
1078
1241
|
a:hover .title { text-decoration: underline; }
|
|
1079
|
-
`];
|
|
1080
|
-
${this.tourHeading?
|
|
1242
|
+
`];f("cm-smart-tip",es);var ts=class extends w{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<div class="card" part="smart-tips">
|
|
1243
|
+
${this.tourHeading?o`<div class="tour" part="tour">
|
|
1081
1244
|
<span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="18"></cm-icon></span>
|
|
1082
1245
|
<span class="tour-text">${this.tourHeading}</span>
|
|
1083
1246
|
<cm-button size="medium" @click=${()=>this.dispatchEvent(new CustomEvent("cm-tour",{bubbles:!0,composed:!0}))}>${this.tourAction}</cm-button>
|
|
@@ -1086,7 +1249,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1086
1249
|
<div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
|
|
1087
1250
|
<div class="list" role="list"><slot></slot></div>
|
|
1088
1251
|
</section>
|
|
1089
|
-
</div>`}};
|
|
1252
|
+
</div>`}};ts.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},ts.styles=[v,u`
|
|
1090
1253
|
:host { display: block; }
|
|
1091
1254
|
.card { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
1092
1255
|
.tour {
|
|
@@ -1104,24 +1267,24 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1104
1267
|
letter-spacing: var(--cm-tracking-caps); text-transform: uppercase;
|
|
1105
1268
|
}
|
|
1106
1269
|
.list { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
1107
|
-
`];
|
|
1270
|
+
`];f("cm-smart-tips",ts);var nf=k("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"}),We,ss,Md,_d,is=class extends w{constructor(){super(...arguments);h(this,ss);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;h(this,We,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)),i=this.total?(t-1)*this.pageSize+1:0,l=Math.min(this.total,t*this.pageSize),d=this.pageSizes??[];return o`
|
|
1108
1271
|
<nav part="bar" aria-label=${this.label}>
|
|
1109
|
-
${d.length?
|
|
1110
|
-
<label for="${
|
|
1111
|
-
<span class="field"><select id="${
|
|
1112
|
-
${(d.includes(this.pageSize)?d:[...d,this.pageSize].sort((p,
|
|
1272
|
+
${d.length?o`<div class="rows" part="rows">
|
|
1273
|
+
<label for="${s(this,We)}-s">${this.t("rows")}</label>
|
|
1274
|
+
<span class="field"><select id="${s(this,We)}-s" @change=${n(this,ss,Md)}>
|
|
1275
|
+
${(d.includes(this.pageSize)?d:[...d,this.pageSize].sort((p,m)=>p-m)).map(p=>o`<option value=${p} ?selected=${p===this.pageSize}>${p}</option>`)}
|
|
1113
1276
|
</select><cm-icon name="chevron-down" size="12"></cm-icon></span>
|
|
1114
1277
|
</div>`:c}
|
|
1115
|
-
<div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:
|
|
1278
|
+
<div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:l,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():c}</div>
|
|
1116
1279
|
<div class="pages" part="pages">
|
|
1117
1280
|
<span class="counter">
|
|
1118
|
-
<label for="${
|
|
1119
|
-
<input id="${
|
|
1120
|
-
.value=${this._draft??String(t)} aria-describedby="${
|
|
1281
|
+
<label for="${s(this,We)}-p">${this.t("page")}</label>
|
|
1282
|
+
<input id="${s(this,We)}-p" type="number" inputmode="numeric" min="1" max=${e}
|
|
1283
|
+
.value=${this._draft??String(t)} aria-describedby="${s(this,We)}-of"
|
|
1121
1284
|
@input=${p=>this._draft=p.target.value}
|
|
1122
|
-
@keydown=${
|
|
1285
|
+
@keydown=${n(this,ss,_d)}
|
|
1123
1286
|
@change=${p=>this.goTo(Number(p.target.value))} />
|
|
1124
|
-
<span id="${
|
|
1287
|
+
<span id="${s(this,We)}-of">${this.t("of",{count:e})}</span>
|
|
1125
1288
|
</span>
|
|
1126
1289
|
<span class="arrows">
|
|
1127
1290
|
<button class="prev" type="button" part="previous" aria-label=${this.t("previous")} ?disabled=${t<=1}
|
|
@@ -1131,7 +1294,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1131
1294
|
</span>
|
|
1132
1295
|
</div>
|
|
1133
1296
|
</nav>
|
|
1134
|
-
`}};
|
|
1297
|
+
`}};We=new WeakMap,ss=new WeakSet,Md=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})))},_d=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))},is.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}},is.styles=[v,u`
|
|
1135
1298
|
:host { display: block; }
|
|
1136
1299
|
nav {
|
|
1137
1300
|
display: flex; align-items: center; gap: var(--cm-space-20); min-height: 60px; padding: 0 var(--cm-space-20);
|
|
@@ -1165,14 +1328,14 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1165
1328
|
.arrows { display: contents; }
|
|
1166
1329
|
.prev { order: -1; }
|
|
1167
1330
|
}
|
|
1168
|
-
`];
|
|
1331
|
+
`];f("cm-pagination",is);var mf=k("statusTabs",{label:"Status"}),tr,ke,Il,zd,Hl,Td,as=class extends w{constructor(){super(...arguments);h(this,ke);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];h(this,tr,new MutationObserver(()=>n(this,ke,Il).call(this)))}connectedCallback(){super.connectedCallback(),n(this,ke,Il).call(this),s(this,tr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,tr).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 i of this.renderRoot.querySelectorAll("button"))i.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=n(this,ke,zd).call(this,e);return o`
|
|
1169
1332
|
<div class="tabs" part="tabs" role="tablist" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
|
|
1170
|
-
${e.map((
|
|
1171
|
-
tabindex=${l===t?"0":"-1"} ?disabled=${!!
|
|
1172
|
-
@click=${()=>
|
|
1333
|
+
${e.map((i,l)=>o`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
|
|
1334
|
+
tabindex=${l===t?"0":"-1"} ?disabled=${!!i.disabled}
|
|
1335
|
+
@click=${()=>n(this,ke,Hl).call(this,l)} @keydown=${d=>n(this,ke,Td).call(this,d,l)}>${i.label}${i.count!==void 0&&!Number.isNaN(i.count)?o` <span class="count">(</span> ${this.formatNumber(i.count)} <span class="count">)</span>`:c}</button>`)}
|
|
1173
1336
|
</div>
|
|
1174
1337
|
<slot></slot>
|
|
1175
|
-
`}};
|
|
1338
|
+
`}};tr=new WeakMap,ke=new WeakSet,Il=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},zd=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},Hl=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Td=function(e,t){let i=fe(e,this),l=this.items.flatMap((m,x)=>m.disabled?[]:[x]),d=l.indexOf(t),p;if(i==="ArrowRight")p=l[(d+1)%l.length];else if(i==="ArrowLeft")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&n(this,ke,Hl).call(this,p)},as.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},as.styles=[v,u`
|
|
1176
1339
|
:host { display: block; }
|
|
1177
1340
|
.tabs {
|
|
1178
1341
|
display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 0;
|
|
@@ -1196,20 +1359,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1196
1359
|
@media (max-width: 640px) {
|
|
1197
1360
|
.tabs { gap: 18px; font-size: 14px; }
|
|
1198
1361
|
}
|
|
1199
|
-
`];
|
|
1362
|
+
`];f("cm-status-tabs",as);var yf=k("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),so,ir,Ye,Rl,Sd,Ld,rs=class extends w{constructor(){super(...arguments);h(this,Ye);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;h(this,so,S("cm-th"));h(this,ir,new MutationObserver(()=>n(this,Ye,Rl).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),n(this,Ye,Rl).call(this),s(this,ir).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,ir).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return o`
|
|
1200
1363
|
<div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":c}
|
|
1201
1364
|
style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
|
|
1202
|
-
${this.selectable?
|
|
1203
|
-
<input id="${
|
|
1204
|
-
@change=${
|
|
1205
|
-
<span class="box" aria-hidden="true">${this.indeterminate?
|
|
1365
|
+
${this.selectable?o`<span class="cell" role=${e?"columnheader":c}><span class="check">
|
|
1366
|
+
<input id="${s(this,so)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
|
|
1367
|
+
@change=${n(this,Ye,Ld)} />
|
|
1368
|
+
<span class="box" aria-hidden="true">${this.indeterminate?o`<span class="dash"></span>`:this.checked?o`<cm-icon name="check" size="14"></cm-icon>`:c}</span>
|
|
1206
1369
|
</span></span>`:c}
|
|
1207
|
-
${t.map(
|
|
1208
|
-
aria-sort=${e&&
|
|
1370
|
+
${t.map(i=>{let l=this.sort===i.key,d=l?this.direction==="descending"?"descending":"ascending":"none",p=i.hidden?o`<span class="sr">${i.label}</span>`:i.label;return o`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":c}
|
|
1371
|
+
aria-sort=${e&&i.sortable?d:c}>${i.sortable?o`<button type="button" class=${l?"on":""} @click=${()=>n(this,Ye,Sd).call(this,i)}>${p}${e?c:o`<span class="sr">${l?this.t("sorted",{direction:this.t(d)}):this.t("sortable")}</span>`}<cm-icon
|
|
1209
1372
|
name=${l&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:p}</span>`})}
|
|
1210
1373
|
</div>
|
|
1211
1374
|
<slot></slot>
|
|
1212
|
-
`}};
|
|
1375
|
+
`}};so=new WeakMap,ir=new WeakMap,Ye=new WeakSet,Rl=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},Sd=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},Ld=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},rs.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},rs.styles=[v,u`
|
|
1213
1376
|
:host { display: block; }
|
|
1214
1377
|
slot { display: none; } /* <option> children are column data, not content */
|
|
1215
1378
|
.bar {
|
|
@@ -1239,7 +1402,23 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
|
|
|
1239
1402
|
.dash { width: 10px; height: 2px; background: var(--cm-icon-selected); }
|
|
1240
1403
|
input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1241
1404
|
slot { display: none; }
|
|
1242
|
-
|
|
1405
|
+
/* In a cm-resource-list (resource-rows): the bar's content box matches a row's content box, so the same
|
|
1406
|
+
--cm-table-columns grid (with column-gap space-20) lands on the same x positions. Rows are padded space-10
|
|
1407
|
+
inline, start with a 20px checkbox and a space-20 gap when selectable, and end with the gap before their
|
|
1408
|
+
(possibly empty) actions; on phones: no padding, an 18px checkbox, space-10 gaps.
|
|
1409
|
+
The bar reaches out to the list's edges; its border is drawn inside so it takes no room. */
|
|
1410
|
+
:host([resource-rows]) .bar {
|
|
1411
|
+
margin-inline: calc(-1 * var(--cm-space-10)); padding-inline: var(--cm-space-20) calc(2 * var(--cm-space-20));
|
|
1412
|
+
border: 0; box-shadow: inset 0 0 0 var(--cm-border-1) var(--cm-border-subtle);
|
|
1413
|
+
}
|
|
1414
|
+
:host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-20) + 20px + var(--cm-space-20)); }
|
|
1415
|
+
:host([resource-rows]) .bar.sel > .cell:first-child { overflow: visible; }
|
|
1416
|
+
@media (max-width: 640px) {
|
|
1417
|
+
:host([resource-rows]) .bar { padding-inline: var(--cm-space-10) calc(2 * var(--cm-space-10)); }
|
|
1418
|
+
:host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-10) + 18px + var(--cm-space-10)); }
|
|
1419
|
+
:host([resource-rows]) .bar.sel { grid-template-columns: calc(18px + var(--cm-space-10) - var(--cm-space-20)) var(--cm-table-columns, var(--_cols)); }
|
|
1420
|
+
}
|
|
1421
|
+
`];f("cm-table-header",rs);var zf=k("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),Cd=!1,Qh=`
|
|
1243
1422
|
cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: 14px; line-height: 1.5; color: var(--cm-text-default); }
|
|
1244
1423
|
cm-data-table > table caption { text-align: start; font-weight: 500; font-size: 16px; padding-block-end: var(--cm-space-10); }
|
|
1245
1424
|
cm-data-table > table th { font-size: 12px; font-weight: 400; text-align: start; padding: 7px var(--cm-space-20); background: var(--cm-bg-hover); border-block: var(--cm-border-1) solid var(--cm-border-subtle); white-space: nowrap; }
|
|
@@ -1255,22 +1434,22 @@ cm-data-table > table th > button.cm-sort:hover cm-icon, cm-data-table > table t
|
|
|
1255
1434
|
cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1256
1435
|
@media (forced-colors: active) { cm-data-table > table th > button.cm-sort cm-icon { opacity: 1; } }
|
|
1257
1436
|
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
|
|
1437
|
+
`;function ep(){if(Cd||typeof document>"u")return;Cd=!0;let r=new CSSStyleSheet;r.replaceSync(Qh),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}var tp=r=>(r.align??(r.type==="numeric"||r.type==="money"?"end":"start"))==="end";function Ad(r){if(typeof r=="number")return r;let a=String(r??"").trim(),e=/^\(.*\)$/.test(a)||/^-|^[^\d]*-\s*\d/.test(a),t=a.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var Dd=r=>r instanceof Date?r.getTime():typeof r=="number"?r:Date.parse(String(r??"")),Nd=new Map;function ip(r){let a=Nd.get(r??"");if(!a){try{a=new Intl.Collator(r,{numeric:!0,sensitivity:"base"})}catch{a=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Nd.set(r??"",a)}return a}function Id(r,a,e,t){let i=l=>l==null||l==="";return i(r)||i(a)?i(r)===i(a)?0:i(r)?1:-1:e==="numeric"||e==="money"?(Ad(r)||0)-(Ad(a)||0):e==="date"?(Dd(r)||0)-(Dd(a)||0):ip(t).compare(String(r),String(a))}var ls,sr,I,Ol,ql,Hd,Pl,Rd,Od,ao,ns,os=class extends w{constructor(){super(...arguments);h(this,I);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,ls,!1);h(this,sr,new MutationObserver(()=>n(this,I,Ol).call(this)))}connectedCallback(){super.connectedCallback(),n(this,I,Ol).call(this),s(this,sr).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,sr).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(l=>l.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((l,d)=>[l,d]).sort(([l,d],[p,m])=>{let x=l[t.key],$=p[t.key],y=x==null||x==="",T=$==null||$==="";return y||T?y===T?d-m:y?1:-1:i*Id(x,$,t.type,this.locale)||d-m}).map(([l])=>l)}updated(e){if(s(this,ls)&&(e.has("sort")||e.has("direction"))&&this.sort){b(this,ls,!1);let t=this.columns.find(i=>i.key===this.sort);t&&n(this,I,ql).call(this,t.label,this.direction)}}render(){let e=o`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return o`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],i=this.sortedRows,l=Math.max(1,t.length),d=!this.loading&&i.length===0;return o`
|
|
1259
1438
|
<div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":c}
|
|
1260
1439
|
role=${this.stickyHeader||this.stickyFirstColumn?"region":c}
|
|
1261
1440
|
aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:c}>
|
|
1262
1441
|
<table part="table" aria-busy=${this.loading?"true":"false"}>
|
|
1263
|
-
${this.caption?
|
|
1264
|
-
<thead><tr>${t.map(p=>{let
|
|
1265
|
-
name=${
|
|
1442
|
+
${this.caption?o`<caption part="caption">${this.caption}</caption>`:c}
|
|
1443
|
+
<thead><tr>${t.map(p=>{let m=this.sort===p.key,x=m?this.direction:"none",$=p.hidden?o`<span class="sr">${p.label}</span>`:p.label;return o`<th scope="col" class=${n(this,I,ns).call(this,p)} aria-sort=${p.sortable?x:c}>${p.sortable?o`<button type="button" class=${m?"on":""} @click=${()=>n(this,I,Od).call(this,p)}>${$}<cm-icon
|
|
1444
|
+
name=${m&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:$}</th>`})}</tr></thead>
|
|
1266
1445
|
<tbody>
|
|
1267
|
-
${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>
|
|
1268
|
-
${d?
|
|
1446
|
+
${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>o`<tr>${t.map(p=>o`<td class=${n(this,I,ns).call(this,p)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):i.map(p=>o`<tr part="row">${t.map((m,x)=>x===0?o`<th scope="row" class=${n(this,I,ns).call(this,m)} part="cell">${n(this,I,ao).call(this,p[m.key])}</th>`:o`<td class=${n(this,I,ns).call(this,m)} part="cell">${n(this,I,ao).call(this,p[m.key])}</td>`)}</tr>`)}
|
|
1447
|
+
${d?o`<tr class="empty"><td colspan=${l}><slot name="empty">${this.t("empty")}</slot></td></tr>`:c}
|
|
1269
1448
|
</tbody>
|
|
1270
|
-
${this.totals&&!this.loading&&!d?
|
|
1449
|
+
${this.totals&&!this.loading&&!d?o`<tfoot><tr part="totals">${t.map(p=>o`<td class=${n(this,I,ns).call(this,p)}>${n(this,I,ao).call(this,this.totals[p.key])}</td>`)}</tr></tfoot>`:c}
|
|
1271
1450
|
</table>
|
|
1272
1451
|
</div>${e}
|
|
1273
|
-
`}};
|
|
1452
|
+
`}};ls=new WeakMap,sr=new WeakMap,I=new WeakSet,Ol=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(ep(),n(this,I,Hd).call(this))},ql=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},Hd=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((i,l)=>{if(!i.dataset.sort||i.querySelector(":scope > button.cm-sort"))return;i.dataset.type=i.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...i.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),i.append(d),i.hasAttribute("aria-sort")||i.setAttribute("aria-sort","none"),n(this,I,Pl).call(this,i),d.addEventListener("click",()=>n(this,I,Rd).call(this,e,i,l))})},Pl=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Rd=function(e,t,i){let l=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),d=t.dataset.key||l,p=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",m=new CustomEvent("cm-sort",{detail:{key:d,direction:p},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(m)||this.sortMode==="manual")return;let x=t.dataset.sort,$=p==="descending"?-1:1;for(let y of e.tBodies){let T=_=>{let R=_.cells[i];return R?(R.dataset.value??R.textContent??"").trim():""},M=[...y.rows].map((_,R)=>[_,T(_),R]).sort(([,_,R],[,O,q])=>_===""||O===""?_===O?R-q:_===""?1:-1:$*Id(_,O,x,this.locale)||R-q);y.append(...M.map(([_])=>_))}for(let y of e.tHead.rows[0].cells)y.dataset.sort&&(y.setAttribute("aria-sort",y===t?p:"none"),n(this,I,Pl).call(this,y));n(this,I,ql).call(this,l,p)},Od=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),l=this.dispatchEvent(i);b(this,ls,l),l&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},ao=function(e){return e==null?"":e instanceof Date?V(e,{},this.locale):String(e)},ns=function(e){return`${tp(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},os.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}},os.styles=[v,u`
|
|
1274
1453
|
:host { display: block; font-size: 14px; line-height: 1.5; }
|
|
1275
1454
|
.scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
|
|
1276
1455
|
.scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
@@ -1307,18 +1486,18 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1307
1486
|
.empty td { padding: var(--cm-space-20); border-block-end: 0; }
|
|
1308
1487
|
.light { display: contents; }
|
|
1309
1488
|
@media (forced-colors: active) { button cm-icon { opacity: 1; } }
|
|
1310
|
-
`];
|
|
1311
|
-
aria-expanded=${String(this.open)} aria-controls="${
|
|
1312
|
-
@click=${
|
|
1489
|
+
`];f("cm-data-table",os);var cs=class extends E{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}}};cs.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},cs.styles=u`:host { display: none; }`;f("cm-menu-item",cs);function ar(r){let a=[];for(let e of Array.from(r.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=l=>e.getAttribute(l)||void 0;a.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&a.push({divider:!0});return a}function ro(r,a){let e=new MutationObserver(a);return e.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Of=k("actionMenu",{label:"Actions"}),rr,ps,Wt,nr,N,no,or,Bl,oo,lo,co,lr,cr,ds,ho,qd,Pd,hs=class extends w{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,rr);h(this,ps,S("cm-menu"));h(this,Wt,"");h(this,nr,0);h(this,or,e=>{this.open&&!e.composedPath().includes(this)&&n(this,N,lo).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,ho,e=>{let t=n(this,N,oo).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),n(this,N,ds).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),n(this,N,ds).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),n(this,N,ds).call(this,t[0]);break;case"End":e.preventDefault(),n(this,N,ds).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();b(this,Wt,(l-s(this,nr)<600?s(this,Wt):"")+e.key.toLowerCase()),b(this,nr,l);let d=this.menuItems,p=s(this,Wt).length>1?i:i+1,x=[...t.slice(Math.max(p,0)),...t.slice(0,Math.max(p,0))].find($=>(d[$].label??"").toLowerCase().startsWith(s(this,Wt)));x!==void 0&&n(this,N,ds).call(this,x)}}})}connectedCallback(){super.connectedCallback(),n(this,N,no).call(this),b(this,rr,ro(this,()=>n(this,N,no).call(this))),document.addEventListener("pointerdown",s(this,or),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,rr)?.disconnect(),document.removeEventListener("pointerdown",s(this,or),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=n(this,N,oo).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,n(this,N,lo).call(this,!0),this.updateComplete.then(()=>n(this,N,co).call(this))}hide(e=!1){n(this,N,lo).call(this,!1),e&&n(this,N,Bl).call(this)?.focus()}updated(e){if(this._custom){let t=n(this,N,Bl).call(this);if(t){let i=(l,d)=>{t.getAttribute(l)!==d&&t.setAttribute(l,d)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${s(this,ps)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=n(this,N,oo).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>n(this,N,co).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?o`<slot name="trigger" @click=${s(this,cr)} @keydown=${s(this,lr)} @slotchange=${()=>n(this,N,no).call(this)}></slot>`:o`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
|
|
1490
|
+
aria-expanded=${String(this.open)} aria-controls="${s(this,ps)}-m" aria-label=${this.iconOnly?t:c}
|
|
1491
|
+
@click=${s(this,cr)} @keydown=${s(this,lr)}>${this.iconOnly?o`<cm-icon name=${this.icon} size="18"></cm-icon>`:o`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return o`${i}
|
|
1313
1492
|
<div class="pop" part="menu" ?hidden=${!this.open}>
|
|
1314
|
-
${this.heading?
|
|
1315
|
-
<div role="menu" id="${
|
|
1316
|
-
${e.map((l,d)=>
|
|
1493
|
+
${this.heading?o`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?o`<span>${this.subheading}</span>`:c}</div>`:c}
|
|
1494
|
+
<div role="menu" id="${s(this,ps)}-m" aria-label=${this.heading||this.label} @keydown=${s(this,ho)}>
|
|
1495
|
+
${e.map((l,d)=>n(this,N,Pd).call(this,l,d))}
|
|
1317
1496
|
</div>
|
|
1318
1497
|
</div>
|
|
1319
|
-
<slot hidden></slot>`}};
|
|
1320
|
-
@pointerenter=${d.over} @click=${d.click}>${l}</a>`:
|
|
1321
|
-
aria-disabled=${e.disabled?"true":c} @pointerenter=${d.over} @click=${d.click}>${l}</button>`},
|
|
1498
|
+
<slot hidden></slot>`}};rr=new WeakMap,ps=new WeakMap,Wt=new WeakMap,nr=new WeakMap,N=new WeakSet,no=function(){this._slotted=ar(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},or=new WeakMap,Bl=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},oo=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},lo=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})))},co=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},lr=new WeakMap,cr=new WeakMap,ds=function(e){this._active=e,this.updateComplete.then(()=>n(this,N,co).call(this))},ho=new WeakMap,qd=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},Pd=function(e,t){if(e.divider)return o`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,l=o`${e.icon?o`<cm-icon name=${e.icon} size="16"></cm-icon>`:c}<span>${e.label}</span>`,d={over:()=>{e.disabled||(this._active=t)},click:p=>n(this,N,qd).call(this,p,e)};return e.href&&!e.disabled?o`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
|
|
1499
|
+
@pointerenter=${d.over} @click=${d.click}>${l}</a>`:o`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
|
|
1500
|
+
aria-disabled=${e.disabled?"true":c} @pointerenter=${d.over} @click=${d.click}>${l}</button>`},hs.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}},hs.styles=[v,u`
|
|
1322
1501
|
:host { display: inline-block; position: relative; vertical-align: middle; }
|
|
1323
1502
|
.trigger {
|
|
1324
1503
|
display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 500;
|
|
@@ -1351,7 +1530,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1351
1530
|
}
|
|
1352
1531
|
.item.active:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; }
|
|
1353
1532
|
[role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-default); }
|
|
1354
|
-
`];
|
|
1533
|
+
`];f("cm-action-menu",hs);var Uf=k("resourceItem",{select:"Select {name}"}),Kf=k("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),Bd=u`
|
|
1355
1534
|
.check { position: relative; display: inline-flex; flex: none; width: 20px; height: 20px; }
|
|
1356
1535
|
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
|
1357
1536
|
.check input:disabled { cursor: not-allowed; }
|
|
@@ -1363,17 +1542,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1363
1542
|
.dash { width: 50%; height: 2px; background: currentColor; }
|
|
1364
1543
|
.check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1365
1544
|
.check input:disabled + .box { border-color: var(--cm-border-default); background: var(--cm-bg-input-filled); }
|
|
1366
|
-
`,
|
|
1367
|
-
${this.href&&!this.disabled?
|
|
1368
|
-
<div class="row" part="row" @click=${
|
|
1369
|
-
${this.selectable?
|
|
1545
|
+
`,mo,uo,Fd,us=class extends w{constructor(){super();h(this,uo);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;h(this,mo,this.attachInternals());s(this,mo).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return o`
|
|
1546
|
+
${this.href&&!this.disabled?o`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:c}
|
|
1547
|
+
<div class="row" part="row" @click=${n(this,uo,Fd)}>
|
|
1548
|
+
${this.selectable?o`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
|
|
1370
1549
|
?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
|
|
1371
|
-
<span class="box" aria-hidden="true">${this.selected?
|
|
1550
|
+
<span class="box" aria-hidden="true">${this.selected?o`<cm-icon name="check" size="14"></cm-icon>`:c}</span></span>`:c}
|
|
1372
1551
|
<span class="media"><slot name="media"></slot></span>
|
|
1373
1552
|
<div class="content" part="content"><slot></slot></div>
|
|
1374
1553
|
<div class="actions" part="actions"><slot name="actions"></slot></div>
|
|
1375
1554
|
</div>
|
|
1376
|
-
`}};
|
|
1555
|
+
`}};mo=new WeakMap,uo=new WeakSet,Fd=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},us.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0}},us.styles=[v,Bd,u`
|
|
1377
1556
|
:host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-default); }
|
|
1378
1557
|
:host(:last-child) { border-bottom: 0; }
|
|
1379
1558
|
.row {
|
|
@@ -1389,6 +1568,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1389
1568
|
}
|
|
1390
1569
|
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 50px; background: none; }
|
|
1391
1570
|
.content { flex: 1; min-width: 0; }
|
|
1571
|
+
:host([columns]) .content {
|
|
1572
|
+
display: grid; grid-template-columns: var(--cm-table-columns, minmax(0, 1fr)); column-gap: var(--cm-space-20); align-items: center;
|
|
1573
|
+
}
|
|
1574
|
+
:host([columns]) ::slotted(*) { min-width: 0; overflow-wrap: anywhere; }
|
|
1392
1575
|
a { position: absolute; inset: 0; z-index: 0; border-radius: var(--cm-radius-xs); }
|
|
1393
1576
|
a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; }
|
|
1394
1577
|
.check, .actions { position: relative; z-index: 1; }
|
|
@@ -1400,29 +1583,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1400
1583
|
::slotted([slot='media']) { width: 34px; height: 34px; }
|
|
1401
1584
|
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 34px; }
|
|
1402
1585
|
}
|
|
1403
|
-
`];
|
|
1404
|
-
${this.selectable?
|
|
1586
|
+
`];f("cm-resource-item",us);var dr,hr,W,jd,Fl,bo,ms,po,fo,bs=class extends w{constructor(){super();h(this,W);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this._count=0;this._rows=0;h(this,dr,S("cm-rl"));h(this,hr,new Set);h(this,bo,e=>{let t=e.target;t.parentElement.classList.toggle("has",t.assignedElements().length>0),n(this,W,Fl).call(this,t)});h(this,fo,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,n(this,W,ms).call(this),n(this,W,po).call(this))})}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),n(this,W,ms).call(this),n(this,W,po).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,n(this,W,ms).call(this),n(this,W,po).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&(n(this,W,ms).call(this),n(this,W,Fl).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter($=>!$.disabled).length,l=i>0&&e>=i,d=n(this,W,jd).call(this),p=$=>Ur($,this.locale)==="one"?this.resourceName:d,m=this.total>t,x=c;return this.allSelected?x=o`${this.t("allSelected",{count:Math.max(this.total,e),resource:d})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(x=o`${this.t("selected",{count:e,resource:p(e)})}${l&&m?o` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:d})}</button>`:c}`),o`
|
|
1587
|
+
${this.selectable?o`<div class="toolbar" part="toolbar">
|
|
1405
1588
|
<span class="select" part="select">
|
|
1406
|
-
<span class="check"><input id="${
|
|
1407
|
-
?disabled=${!
|
|
1408
|
-
<span class="box" aria-hidden="true">${e>0&&!l?
|
|
1409
|
-
<label for="${
|
|
1410
|
-
${this.hideSelectMenu?c:
|
|
1411
|
-
.items=${[{label:this.t("selectPage",{count:
|
|
1589
|
+
<span class="check"><input id="${s(this,dr)}-all" type="checkbox" .checked=${l} .indeterminate=${e>0&&!l}
|
|
1590
|
+
?disabled=${!i} @change=${$=>this.selectPage($.target.checked)} />
|
|
1591
|
+
<span class="box" aria-hidden="true">${e>0&&!l?o`<span class="dash"></span>`:l?o`<cm-icon name="check" size="12"></cm-icon>`:c}</span></span>
|
|
1592
|
+
<label for="${s(this,dr)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:p(t)})}</span></label>
|
|
1593
|
+
${this.hideSelectMenu?c:o`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
|
|
1594
|
+
.items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...m?[{label:this.t("selectAll",{count:this.total,resource:d}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${s(this,fo)}></cm-action-menu>`}
|
|
1412
1595
|
</span>
|
|
1413
1596
|
<span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
|
|
1414
|
-
<span class="status" part="status" role="status">${
|
|
1597
|
+
<span class="status" part="status" role="status">${x}</span>
|
|
1415
1598
|
<span class="actions"><slot name="actions"></slot></span>
|
|
1416
1599
|
</div>`:c}
|
|
1417
|
-
<div class="header"><slot name="header" @slotchange=${
|
|
1600
|
+
<div class="header"><slot name="header" @slotchange=${s(this,bo)}></slot></div>
|
|
1418
1601
|
<div class="body">
|
|
1419
1602
|
<div class="list" part="list" role="list" aria-label=${this.label||d.replace(/^./,$=>$.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
|
|
1420
|
-
<slot @slotchange=${()=>
|
|
1603
|
+
<slot @slotchange=${()=>n(this,W,ms).call(this)}></slot>
|
|
1421
1604
|
</div>
|
|
1422
|
-
${this.loading?
|
|
1605
|
+
${this.loading?o`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:d})}></span>`:c}
|
|
1423
1606
|
</div>
|
|
1424
1607
|
<div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
|
|
1425
|
-
`}};
|
|
1608
|
+
`}};dr=new WeakMap,hr=new WeakMap,W=new WeakSet,jd=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Fl=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(l=>t.add(l));for(let i of s(this,hr))t.has(i)||i.removeAttribute("resource-rows");for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain");b(this,hr,t)},bo=new WeakMap,ms=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},po=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},fo=new WeakMap,bs.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},_count:{state:!0},_rows:{state:!0}},bs.styles=[v,Bd,u`
|
|
1426
1609
|
:host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
|
|
1427
1610
|
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); padding: var(--cm-space-20) var(--cm-space-20) 0; }
|
|
1428
1611
|
.select {
|
|
@@ -1460,20 +1643,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1460
1643
|
.list { padding: 0 var(--cm-space-10); }
|
|
1461
1644
|
.spinner { width: 30px; height: 30px; margin: -15px; border-width: 3px; }
|
|
1462
1645
|
}
|
|
1463
|
-
`];
|
|
1464
|
-
<div class="row" part="row" @dragover=${
|
|
1465
|
-
${this.sortable?
|
|
1646
|
+
`];f("cm-resource-list",bs);var Qf=k("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",moved:"{label} moved to position {position} of {total}."}),eg=k("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),vo,be,Vd,Ud,Kd,jl,Wd,Ge=class Ge extends w{constructor(){super();h(this,be);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;h(this,vo,this.attachInternals());s(this,vo).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let l=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(l))return!1;let d=t[e];return d.parentElement.insertBefore(this,e>i?d.nextSibling:d),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return o`
|
|
1647
|
+
<div class="row" part="row" @dragover=${n(this,be,Kd)} @dragleave=${n(this,be,jl)} @drop=${n(this,be,Wd)}>
|
|
1648
|
+
${this.sortable?o`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
|
|
1466
1649
|
aria-describedby="hint"
|
|
1467
|
-
@keydown=${
|
|
1468
|
-
@dragend=${()=>{this.classList.remove("dragging"),
|
|
1469
|
-
${this.sortable?
|
|
1650
|
+
@keydown=${n(this,be,Vd)} @dragstart=${n(this,be,Ud)}
|
|
1651
|
+
@dragend=${()=>{this.classList.remove("dragging"),Ge.dragged=null}}><cm-icon name="drag" size="18"></cm-icon></button>`:c}
|
|
1652
|
+
${this.sortable?o`<span class="sr" id="hint">${this.t("hint")}</span>`:c}
|
|
1470
1653
|
<span class="label" part="label">${this.label}</span>
|
|
1471
1654
|
<span class="actions" part="actions"><slot name="actions"></slot></span>
|
|
1472
1655
|
</div>
|
|
1473
1656
|
<div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
|
|
1474
|
-
<slot @slotchange=${e=>{let t=e.target.assignedElements().filter(
|
|
1657
|
+
<slot @slotchange=${e=>{let t=e.target.assignedElements().filter(i=>i.localName==="cm-nested-item");t.forEach(i=>i.sortable=this.sortable),this._hasChildren=t.length>0}}></slot>
|
|
1475
1658
|
</div>
|
|
1476
|
-
`}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};
|
|
1659
|
+
`}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};vo=new WeakMap,be=new WeakSet,Vd=function(e){let t=this.siblings.indexOf(this),i;if(e.key==="ArrowUp")i=t-1;else if(e.key==="ArrowDown")i=t+1;else if(e.key==="Home")i=0;else if(e.key==="End")i=this.siblings.length-1;else return;if(e.preventDefault(),this.moveTo(i)){let l=()=>this.renderRoot.querySelector(".handle")?.focus();l(),requestAnimationFrame(l)}},Ud=function(e){e.stopPropagation(),Ge.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},Kd=function(e){let t=Ge.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),l=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",l),this.classList.toggle("drop-before",!l)},jl=function(){this.classList.remove("drop-before","drop-after")},Wd=function(e){let t=Ge.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");n(this,be,jl).call(this);let l=this.siblings,d=l.indexOf(t),p=l.indexOf(this)+(i?1:0);p>d&&(p-=1),t.moveTo(p)},Ge.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},Ge.styles=[v,u`
|
|
1477
1660
|
:host { display: block; }
|
|
1478
1661
|
.row {
|
|
1479
1662
|
display: flex; align-items: center; gap: var(--cm-space-15); min-height: 60px; padding: 0 var(--cm-space-20);
|
|
@@ -1498,19 +1681,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1498
1681
|
.actions { gap: var(--cm-space-10); }
|
|
1499
1682
|
.children { margin-inline-start: var(--cm-space-20); }
|
|
1500
1683
|
}
|
|
1501
|
-
`],
|
|
1684
|
+
`],Ge.dragged=null;var go=Ge;f("cm-nested-item",go);var Yt,Gt,Yd,Vl,fs=class extends w{constructor(){super(...arguments);h(this,Gt);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this._msg="";h(this,Yt,S("cm-nl"))}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}updated(e){e.has("sortable")&&n(this,Gt,Vl).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return o`
|
|
1502
1685
|
<div class="bar" part="bar">
|
|
1503
|
-
<div class="title" part="heading" role="heading" aria-level=${e} id="${
|
|
1686
|
+
<div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,Yt)}-h">${this.heading}</div>
|
|
1504
1687
|
<span class="actions"><slot name="actions"></slot></span>
|
|
1505
|
-
${this.collapsible?
|
|
1506
|
-
aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${
|
|
1688
|
+
${this.collapsible?o`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Yt)}-rows"
|
|
1689
|
+
aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${n(this,Gt,Yd)}>
|
|
1507
1690
|
<cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:c}
|
|
1508
1691
|
</div>
|
|
1509
|
-
<div class="rows" id="${
|
|
1510
|
-
<slot @slotchange=${()=>
|
|
1692
|
+
<div class="rows" id="${s(this,Yt)}-rows" role="list" aria-labelledby="${s(this,Yt)}-h" ?hidden=${!t}>
|
|
1693
|
+
<slot @slotchange=${()=>n(this,Gt,Vl).call(this)}></slot>
|
|
1511
1694
|
</div>
|
|
1512
1695
|
<span class="sr" role="status">${this._msg}</span>
|
|
1513
|
-
`}};
|
|
1696
|
+
`}};Yt=new WeakMap,Gt=new WeakSet,Yd=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Vl=function(){[...this.children].forEach(e=>{e.localName==="cm-nested-item"&&(e.sortable=this.sortable)})},fs.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}},fs.styles=[v,u`
|
|
1514
1697
|
:host { display: block; }
|
|
1515
1698
|
.bar {
|
|
1516
1699
|
display: flex; align-items: center; gap: var(--cm-space-15); min-height: 90px; padding: 0 var(--cm-space-20);
|
|
@@ -1533,11 +1716,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1533
1716
|
.rows { margin-inline-start: var(--cm-space-10); }
|
|
1534
1717
|
.toggle { width: 30px; height: 30px; }
|
|
1535
1718
|
}
|
|
1536
|
-
`];
|
|
1719
|
+
`];f("cm-nested-list",fs);var ng=k("reportTile",{pinned:", pinned"}),Xt=class extends w{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=o`
|
|
1537
1720
|
<span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="58"></cm-icon></slot></span>
|
|
1538
1721
|
<span class="label">${this.label}</span>
|
|
1539
|
-
${this.pinned?
|
|
1540
|
-
`;return this.href?
|
|
1722
|
+
${this.pinned?o`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:c}
|
|
1723
|
+
`;return this.href?o`<a class="tile" part="tile" href=${this.href}>${e}</a>`:o`<button class="tile" part="tile" type="button">${e}</button>`}};Xt.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Xt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},Xt.styles=[v,u`
|
|
1541
1724
|
:host { display: block; }
|
|
1542
1725
|
.tile {
|
|
1543
1726
|
position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-20);
|
|
@@ -1557,10 +1740,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1557
1740
|
::slotted([slot='icon']) { width: 38px; height: 38px; }
|
|
1558
1741
|
.pin { top: 8px; inset-inline-end: 8px; }
|
|
1559
1742
|
}
|
|
1560
|
-
`];
|
|
1561
|
-
${this.heading?
|
|
1743
|
+
`];f("cm-report-tile",Xt);var gs=class extends E{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 o`
|
|
1744
|
+
${this.heading?o`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:c}
|
|
1562
1745
|
<div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":c}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
|
|
1563
|
-
`}};
|
|
1746
|
+
`}};gs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},gs.styles=[v,u`
|
|
1564
1747
|
:host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
|
|
1565
1748
|
.title { margin: 0 0 var(--cm-space-20); font-size: 16px; font-weight: 500; }
|
|
1566
1749
|
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-15); }
|
|
@@ -1570,44 +1753,74 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1570
1753
|
.title { margin-bottom: var(--cm-space-10); font-size: 14px; }
|
|
1571
1754
|
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-10); }
|
|
1572
1755
|
}
|
|
1573
|
-
`];
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1756
|
+
`];f("cm-report-tiles",gs);var hg=k("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Gd=/^\s*-?\d+(\.\d+)?\s*$/,vs=class extends w{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:Gd.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return c;if(!e)return o`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),l=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return o`<span class="change ${e} ${t}" part="change">
|
|
1757
|
+
<cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${l}</span>
|
|
1758
|
+
</span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?o`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),l=i!==c||e,d=o`
|
|
1759
|
+
<span class="label" id="label" part="label">${this.label}</span>
|
|
1760
|
+
<span class="value" id="value" part="value">${t}</span>
|
|
1761
|
+
<span class="foot ${l?"on":""}" id="foot" part="footer">
|
|
1762
|
+
${i}
|
|
1763
|
+
<span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
|
|
1764
|
+
</span>
|
|
1765
|
+
`,p=o`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,m=this.loading?"true":c;return this.href?o`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${l?"foot":c} aria-busy=${m}>${d}</a>${p}`:o`<div class="tile" part="tile" aria-busy=${m}>${d}</div>${p}`}};vs.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&Gd.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},vs.styles=[v,u`
|
|
1766
|
+
:host { display: block; align-self: stretch; min-inline-size: 0; }
|
|
1767
|
+
.tile {
|
|
1768
|
+
display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
|
|
1769
|
+
padding: var(--cm-space-20); color: var(--cm-text-default); text-decoration: none; text-align: start;
|
|
1770
|
+
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card); border-radius: var(--cm-radius-md);
|
|
1584
1771
|
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1772
|
+
a.tile { cursor: pointer; }
|
|
1773
|
+
a.tile:hover { border-color: var(--cm-border-strong); }
|
|
1774
|
+
a.tile:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1775
|
+
.label { font-size: var(--cm-type-body-md-size); font-weight: 500; line-height: var(--cm-type-body-md-line-height); overflow-wrap: anywhere; }
|
|
1776
|
+
.value {
|
|
1777
|
+
font-size: var(--cm-type-heading-lg-size); font-weight: var(--cm-type-heading-lg-weight); line-height: 1.25;
|
|
1778
|
+
font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-block-size: 1.25em;
|
|
1779
|
+
}
|
|
1780
|
+
.value cm-skeleton { inline-size: 6ch; max-inline-size: 100%; --cm-skeleton-height: 0.9em; margin-block: 0.175em; }
|
|
1781
|
+
.foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--cm-space-10); row-gap: 2px; }
|
|
1782
|
+
.foot:not(.on) { display: none; }
|
|
1783
|
+
.change {
|
|
1784
|
+
display: inline-flex; align-items: center; gap: 2px; font-size: var(--cm-type-body-sm-size); font-weight: 500;
|
|
1785
|
+
font-variant-numeric: tabular-nums; color: var(--cm-text-tertiary);
|
|
1786
|
+
}
|
|
1787
|
+
.change.positive { color: var(--cm-text-success); }
|
|
1788
|
+
.change.negative { color: var(--cm-text-critical); }
|
|
1789
|
+
.change cm-icon { align-self: center; }
|
|
1790
|
+
.change.down cm-icon { transform: rotate(90deg); }
|
|
1791
|
+
:host(:dir(rtl)) .change.down cm-icon { transform: rotate(-90deg); }
|
|
1792
|
+
.change.flat cm-icon { transform: rotate(180deg); }
|
|
1793
|
+
.hint { font-size: var(--cm-type-body-sm-size); line-height: var(--cm-type-body-sm-line-height); color: var(--cm-text-tertiary); overflow-wrap: anywhere; }
|
|
1794
|
+
.hint:not(.on) { display: none; }
|
|
1795
|
+
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
1796
|
+
@media (max-width: 640px) {
|
|
1797
|
+
.tile { padding: var(--cm-space-15); }
|
|
1798
|
+
.value { font-size: var(--cm-type-heading-lg-resp-size); }
|
|
1799
|
+
}
|
|
1800
|
+
@media (forced-colors: active) { .change { color: CanvasText; } }
|
|
1801
|
+
`];f("cm-metric",vs);var xs=class extends E{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 Xd(this)}};xs.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}},xs.styles=u`:host { display: none !important; }`;f("cm-nav-item",xs);function Xd(r){let a=i=>r.getAttribute(i),e={label:a("label")||""};a("icon")&&(e.icon=a("icon")),a("href")&&(e.href=a("href")),a("value")&&(e.value=a("value")),r.hasAttribute("current")&&(e.current=!0),a("badge")&&(e.badge=a("badge")),r.hasAttribute("expanded")&&(e.expanded=!0),r.hasAttribute("primary")&&(e.primary=!0);let t=Xe(r);return t.length&&(e.items=t),e}var Xe=r=>[...r.children].filter(a=>a.localName==="cm-nav-item").map(Xd),Ul=r=>r.value||r.href||r.label,xo=r=>!!r.current||!!r.items?.some(xo),xt=(r,a)=>{let e=new MutationObserver(a);return e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},yt=(r,a)=>r.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:a,value:Ul(a),href:a.href??""}}));var wg=k("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),pr,mr,$o,C,Kl,yo,Wl,Jd,Zd,Yl,Gl,Qd,Xl,Jl,wo,Zl,eh,ys=class extends w{constructor(){super(...arguments);h(this,C);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;h(this,pr,new Set);h(this,mr);h(this,$o,S("cm-sidenav"))}connectedCallback(){super.connectedCallback(),n(this,C,Kl).call(this),b(this,mr,xt(this,()=>n(this,C,Kl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,mr)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=n(this,C,yo).call(this,e,t);s(this,pr).has(i)||!e.items?.length||(s(this,pr).add(i),(e.expanded||xo(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let l=n(this,C,yo).call(this,i,e),d=t??!this._open.has(l);if(d===this._open.has(l))return;let p=new Set(this._open);d?p.add(l):p.delete(l),this._open=p,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:d}}))}render(){let e=this.collapsed;return o`
|
|
1802
|
+
<nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${n(this,C,Zd)}>
|
|
1590
1803
|
<slot name="header"></slot>
|
|
1591
1804
|
<ul part="list">
|
|
1592
|
-
${this.navItems.map((t,
|
|
1593
|
-
${
|
|
1594
|
-
aria-expanded=${l?"true":"false"} aria-controls=${d} @click=${()=>e?
|
|
1595
|
-
${
|
|
1596
|
-
${e?c:
|
|
1805
|
+
${this.navItems.map((t,i)=>{if(!t.items?.length)return o`<li>${n(this,C,Zl).call(this,t,"",{index:i})}</li>`;let l=!e&&this._open.has(n(this,C,yo).call(this,t,i)),d=`${s(this,$o)}-${i}`;return o`<li>
|
|
1806
|
+
${n(this,C,wo).call(this,t,o`<button type="button" class="item parent ${xo(t)?"has-current":""}" part="item" data-index=${i}
|
|
1807
|
+
aria-expanded=${l?"true":"false"} aria-controls=${d} @click=${()=>e?n(this,C,Qd).call(this,i):this.toggle(i)}>
|
|
1808
|
+
${n(this,C,Xl).call(this,t)}${n(this,C,Jl).call(this,t)}
|
|
1809
|
+
${e?c:o`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
|
|
1597
1810
|
</button>`)}
|
|
1598
1811
|
<ul class="sub" id=${d} ?hidden=${!l} aria-label=${t.label}>
|
|
1599
|
-
${
|
|
1812
|
+
${n(this,C,Yl).call(this,t.items).map(([p,m])=>o`<li>${n(this,C,Zl).call(this,{...p,icon:void 0},m?"deep":"",{parent:i})}</li>`)}
|
|
1600
1813
|
</ul>
|
|
1601
1814
|
</li>`})}
|
|
1602
1815
|
</ul>
|
|
1603
|
-
${
|
|
1816
|
+
${n(this,C,eh).call(this)}
|
|
1604
1817
|
<slot name="footer"></slot>
|
|
1605
1818
|
<slot hidden></slot>
|
|
1606
1819
|
</nav>
|
|
1607
|
-
`}};
|
|
1608
|
-
data-index=${
|
|
1609
|
-
data-index=${
|
|
1610
|
-
@click=${()=>
|
|
1820
|
+
`}};pr=new WeakMap,mr=new WeakMap,$o=new WeakMap,C=new WeakSet,Kl=function(){this._slotted=Xe(this)},yo=function(e,t){return`${t}:${Ul(e)}`},Wl=function(e,t){yt(this,t)||e.preventDefault()},Jd=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Zd=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=n(this,C,Jd).call(this),l=i.indexOf(t),d=Number(t.dataset.index),p=fe(e,this),m;if(e.key==="ArrowDown")m=i[(l+1)%i.length];else if(e.key==="ArrowUp")m=i[(l-1+i.length)%i.length];else if(e.key==="Home")m=i[0];else if(e.key==="End")m=i[i.length-1];else{if(this.collapsed&&(p==="ArrowRight"||p==="ArrowLeft"))return;if(p==="ArrowRight"&&t.classList.contains("parent")){this.toggle(d,!0),e.preventDefault();return}else if(p==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(d,!1):t.dataset.parent&&(m=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!m){e.preventDefault();return}}else return}e.preventDefault(),m?.focus()},Yl=function(e,t=0){return e.flatMap(i=>[[i,t],...n(this,C,Yl).call(this,i.items??[],t+1)])},Gl=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},Qd=function(e){let t=this.navItems[e];n(this,C,Gl).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},Xl=function(e){return e.icon?o`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?o`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:c},Jl=function(e){if(!this.collapsed)return o`<span class="label">${e.label}</span>${e.badge?o`<span class="badge">${e.badge}</span>`:c}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return o`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?o`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:c}</span>`:c}`},wo=function(e,t){return this.collapsed?o`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},Zl=function(e,t,i={}){let l=o`${n(this,C,Xl).call(this,e)}${n(this,C,Jl).call(this,e)}`;return n(this,C,wo).call(this,e,e.href?o`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":c}
|
|
1821
|
+
data-index=${i.index??c} data-parent=${i.parent??c} @click=${d=>n(this,C,Wl).call(this,d,e)}>${l}</a>`:o`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":c}
|
|
1822
|
+
data-index=${i.index??c} data-parent=${i.parent??c} @click=${d=>n(this,C,Wl).call(this,d,e)}>${l}</button>`)},eh=function(){if(!this.collapsible)return c;let e=this.t(this.collapsed?"expand":"collapse"),t=o`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?o`<span class="sr">${e}</span>`:o`<span class="label">${e}</span>`}`;return o`<div class="toggle-row">${n(this,C,wo).call(this,{label:e},o`<button type="button" class="item toggle" part="collapse-button"
|
|
1823
|
+
@click=${()=>n(this,C,Gl).call(this,!this.collapsed)}>${t}</button>`)}</div>`},ys.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},ys.styles=[v,u`
|
|
1611
1824
|
:host { display: block; width: var(--cm-side-navigation-width, 250px); }
|
|
1612
1825
|
nav {
|
|
1613
1826
|
background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: 16px;
|
|
@@ -1647,15 +1860,15 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1647
1860
|
background: var(--cm-nav-badge); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
|
|
1648
1861
|
}
|
|
1649
1862
|
.dot.count { inset-block-start: 3px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; color: var(--cm-text-on-dark); }
|
|
1650
|
-
`];
|
|
1863
|
+
`];f("cm-side-navigation",ys);var Ql=0,th="";function tc(){Ql++===0&&(th=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function ur(){Ql>0&&--Ql===0&&(document.documentElement.style.overflow=th)}function ic(){let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;return r}var ws,Je,$s,br,ec,ko,Eo,Mo,_o,zo,F=class extends w{constructor(){super(...arguments);h(this,br);this.open=!1;this.label="";this.uid=S("cm-ovl");h(this,ws,null);h(this,Je,!1);h(this,$s,!1);h(this,ko,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});h(this,Eo,e=>{e.preventDefault(),this.requestClose("escape")});h(this,Mo,()=>{this.open&&!this.dialog?.open&&(this.open=!1,n(this,br,ec).call(this))});h(this,_o,e=>{b(this,$s,e.target===e.currentTarget)});h(this,zo,e=>{if(e.target===e.currentTarget&&s(this,$s)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}b(this,$s,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(b(this,ws,ic()),!this.isConnected)return;t.showModal(),s(this,Je)||(tc(),b(this,Je,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),n(this,br,ec).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),s(this,Je)&&(ur(),b(this,Je,!1))}renderHeader(e=c){return o`<header class="head" part="header">
|
|
1651
1864
|
<h2 id="${this.uid}-h">${this.heading}</h2>${e}
|
|
1652
1865
|
<button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
|
|
1653
1866
|
<cm-icon name="close" size="18"></cm-icon></button>
|
|
1654
|
-
</header>`}renderDialog(e,t=""){return
|
|
1867
|
+
</header>`}renderDialog(e,t=""){return o`<dialog part="dialog" class=${t}
|
|
1655
1868
|
aria-labelledby=${this.heading?`${this.uid}-h`:c}
|
|
1656
1869
|
aria-label=${!this.heading&&this.label?this.label:c}
|
|
1657
|
-
@keydown=${
|
|
1658
|
-
@pointerdown=${
|
|
1870
|
+
@keydown=${s(this,ko)} @cancel=${s(this,Eo)} @close=${s(this,Mo)}
|
|
1871
|
+
@pointerdown=${s(this,_o)} @click=${s(this,zo)}>${e}</dialog>`}};ws=new WeakMap,Je=new WeakMap,$s=new WeakMap,br=new WeakSet,ec=function(){s(this,Je)&&(ur(),b(this,Je,!1));let e=s(this,ws);b(this,ws,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},ko=new WeakMap,Eo=new WeakMap,Mo=new WeakMap,_o=new WeakMap,zo=new WeakMap,F.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},F.overlayStyles=[v,u`
|
|
1659
1872
|
:host { display: contents; }
|
|
1660
1873
|
dialog {
|
|
1661
1874
|
padding: 0; border: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: inherit;
|
|
@@ -1686,7 +1899,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1686
1899
|
dialog[open] .panel { animation: cm-ovl-in 160ms ease-out; }
|
|
1687
1900
|
}
|
|
1688
1901
|
@keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
|
|
1689
|
-
`];function
|
|
1902
|
+
`];function ih(r){let a=r.trim().split(/[\s._@-]+/).filter(Boolean);if(!a.length)return"";let e=[...a[0]][0]??"",t=a.length>1&&!/[.@]/.test(r)?[...a[a.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var ks=class extends E{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=ih(this.name),t=this.decorative||!this.name?c:this.name,i=this.decorative||!this.name?"true":c,l,d="avatar";return this.src&&!this._failed?l=o`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?l=o`<span aria-hidden="true">${e}</span>`:(d+=" icon",l=o`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),o`<span class=${d} part="avatar" role=${t===c?c:"img"} aria-label=${t} aria-hidden=${i}>${l}</span>`}};ks.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},ks.styles=[v,u`
|
|
1690
1903
|
:host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
|
|
1691
1904
|
:host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
|
|
1692
1905
|
:host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
|
|
@@ -1699,34 +1912,34 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1699
1912
|
.icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
|
|
1700
1913
|
img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
|
|
1701
1914
|
@media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
|
|
1702
|
-
`];
|
|
1915
|
+
`];f("cm-avatar",ks);var Hg=k("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),_s,Ze,zs,Z,fr,sc,Es,Ms=class extends w{constructor(){super();h(this,Z);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;h(this,_s);h(this,Ze,!1);h(this,zs,null);this.addEventListener("cm-select",e=>{let t=n(this,Z,fr).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){n(this,Z,fr).call(this)?.focus();return}this._searchOpen||(b(this,zs,ic()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),b(this,_s,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),s(this,_s).observe(this)}disconnectedCallback(){super.disconnectedCallback(),s(this,_s)?.disconnect(),s(this,Ze)&&(ur(),b(this,Ze,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),s(this,Ze)||(tc(),b(this,Ze,!0)),n(this,Z,fr).call(this)?.focus(),n(this,Z,Es).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),s(this,Ze)&&(ur(),b(this,Ze,!1));let i=s(this,zs)??this.renderRoot.querySelector(".search-btn");b(this,zs,null),i?.isConnected&&i.focus(),n(this,Z,Es).call(this,"cm-search-toggle",{open:!1})}}render(){return o`
|
|
1703
1916
|
<header part="bar" role="banner" aria-label=${this.label||c}>
|
|
1704
1917
|
<div class="logo"><slot name="logo"></slot></div>
|
|
1705
|
-
${this.store?
|
|
1706
|
-
@click=${()=>
|
|
1707
|
-
${this._narrow?c:
|
|
1918
|
+
${this.store?o`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
|
|
1919
|
+
@click=${()=>n(this,Z,Es).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:c}
|
|
1920
|
+
${this._narrow?c:o`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${n(this,Z,sc)}></slot></div>`}
|
|
1708
1921
|
<span class="grow"></span>
|
|
1709
1922
|
<div class="end">
|
|
1710
|
-
${this._narrow&&this._hasSearch?
|
|
1923
|
+
${this._narrow&&this._hasSearch?o`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
|
|
1711
1924
|
aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:c}
|
|
1712
1925
|
<div class="actions"><slot name="actions"></slot></div>
|
|
1713
|
-
${this.balance?
|
|
1714
|
-
@click=${()=>
|
|
1715
|
-
${this.userName?
|
|
1716
|
-
@click=${()=>
|
|
1926
|
+
${this.balance?o`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
|
|
1927
|
+
@click=${()=>n(this,Z,Es).call(this,"cm-wallet")}>${this.balance}</button>`:c}
|
|
1928
|
+
${this.userName?o`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
|
|
1929
|
+
@click=${()=>n(this,Z,Es).call(this,"cm-account")}><span class="name">${this.userName}</span>
|
|
1717
1930
|
<cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:c}
|
|
1718
1931
|
<slot name="end"></slot>
|
|
1719
1932
|
</div>
|
|
1720
1933
|
</header>
|
|
1721
|
-
${this._narrow?
|
|
1934
|
+
${this._narrow?o`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
|
|
1722
1935
|
@keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
|
|
1723
1936
|
@cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
|
|
1724
1937
|
<div class="layer-bar">
|
|
1725
|
-
<div class="layer-search"><slot name="search" @slotchange=${
|
|
1938
|
+
<div class="layer-search"><slot name="search" @slotchange=${n(this,Z,sc)}></slot></div>
|
|
1726
1939
|
<button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
|
|
1727
1940
|
</div>
|
|
1728
1941
|
</dialog>`:c}
|
|
1729
|
-
`}};
|
|
1942
|
+
`}};_s=new WeakMap,Ze=new WeakMap,zs=new WeakMap,Z=new WeakSet,fr=function(){return this.querySelector(':scope > [slot="search"]')},sc=function(){this._hasSearch=!!n(this,Z,fr).call(this)},Es=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Ms.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},Ms.styles=[v,u`
|
|
1730
1943
|
:host { display: block; background: var(--cm-bg-surface); container-type: inline-size; }
|
|
1731
1944
|
header {
|
|
1732
1945
|
display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
|
|
@@ -1796,10 +2009,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1796
2009
|
/* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
|
|
1797
2010
|
.end { gap: 0; }
|
|
1798
2011
|
}
|
|
1799
|
-
`];
|
|
1800
|
-
<ul>${this.navItems.slice(0,5).map(e=>
|
|
2012
|
+
`];f("cm-header-bar",Ms);var Vg=k("bottomNavigation",{label:"Main"}),gr,Jt,ac,sh,Ts=class extends w{constructor(){super(...arguments);h(this,Jt);this.items=[];this.fixed=!1;this._slotted=[];h(this,gr)}connectedCallback(){super.connectedCallback(),n(this,Jt,ac).call(this),b(this,gr,xt(this,()=>n(this,Jt,ac).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,gr)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return o`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
2013
|
+
<ul>${this.navItems.slice(0,5).map(e=>o`<li>${n(this,Jt,sh).call(this,e)}</li>`)}</ul>
|
|
1801
2014
|
<slot hidden></slot>
|
|
1802
|
-
</nav>`}};
|
|
2015
|
+
</nav>`}};gr=new WeakMap,Jt=new WeakSet,ac=function(){this._slotted=Xe(this)},sh=function(e){let t=`item ${e.primary?"primary":""}`,i=o`<span class="icon">${e.icon?o`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:c}</span><span class="label">${e.label}</span>`,l=d=>{yt(this,e)||d.preventDefault()};return e.href?o`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":c} @click=${l}>${i}</a>`:o`<button type="button" class=${t} part="item" aria-current=${e.current?"page":c} @click=${l}>${i}</button>`},Ts.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},Ts.styles=[v,u`
|
|
1803
2016
|
:host { display: block; }
|
|
1804
2017
|
:host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
|
|
1805
2018
|
nav {
|
|
@@ -1819,31 +2032,31 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1819
2032
|
.icon { display: grid; place-items: center; width: 26px; height: 26px; }
|
|
1820
2033
|
.primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
|
|
1821
2034
|
.label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1822
|
-
`];
|
|
1823
|
-
@keydown=${
|
|
2035
|
+
`];f("cm-bottom-navigation",Ts);var Zg=k("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),vr,Zt,ie,rc,ah,nc,oc,rh,Ss=class extends w{constructor(){super(...arguments);h(this,ie);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;h(this,vr);h(this,Zt,S("cm-mmenu"))}connectedCallback(){super.connectedCallback(),n(this,ie,rc).call(this),b(this,vr,xt(this,()=>n(this,ie,rc).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,vr)?.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?o`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${s(this,Zt)}-sub"
|
|
2036
|
+
@keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
|
|
1824
2037
|
<button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="18"></cm-icon>${t.label}</button>
|
|
1825
|
-
<ul class="card" aria-label=${t.label}>${t.items.map(
|
|
2038
|
+
<ul class="card" aria-label=${t.label}>${t.items.map(i=>o`<li>${n(this,ie,oc).call(this,i,0,0,!0)}</li>`)}</ul>
|
|
1826
2039
|
<slot hidden></slot>
|
|
1827
|
-
</nav>`:
|
|
1828
|
-
${
|
|
1829
|
-
${e.map((
|
|
1830
|
-
${
|
|
1831
|
-
<ul class="card">${(
|
|
2040
|
+
</nav>`:o`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
2041
|
+
${n(this,ie,rh).call(this)}
|
|
2042
|
+
${e.map((i,l)=>{let d=`${s(this,Zt)}-s${l}`;return o`<section aria-labelledby=${i.label?d:c}>
|
|
2043
|
+
${i.label?o`<h2 class="heading" id=${d}>${i.label}</h2>`:c}
|
|
2044
|
+
<ul class="card">${(i.items??[]).map((p,m)=>o`<li>${n(this,ie,oc).call(this,p,l,m)}</li>`)}</ul>
|
|
1832
2045
|
</section>`})}
|
|
1833
2046
|
<slot hidden></slot>
|
|
1834
|
-
</nav>`}};
|
|
1835
|
-
@click=${()=>
|
|
1836
|
-
<h2 class="heading" id="${
|
|
2047
|
+
</nav>`}};vr=new WeakMap,Zt=new WeakMap,ie=new WeakSet,rc=function(){this._slotted=Xe(this)},ah=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},nc=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},oc=function(e,t,i,l=!1){let d=$=>{yt(this,e)||$.preventDefault()};if(e.primary&&!l)return o`<button type="button" class="row action" part="row" @click=${d}>${e.label}</button>`;let p=e.icon&&!l?o`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:c,m=e.badge?o`<span class="badge">${e.badge}</span>`:c;if(e.items?.length&&!l)return o`<button type="button" class="row" part="row" data-row="${t}-${i}"
|
|
2048
|
+
@click=${()=>n(this,ie,ah).call(this,t,i)}>${p}<span class="label">${e.label}</span>${m}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let x=o`${p}<span class="label">${e.label}</span>${m}${e.href&&!l?o`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:c}`;return e.href?o`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":c} @click=${d}>${x}</a>`:o`<button type="button" class="row" part="row" aria-current=${e.current?"page":c} @click=${d}>${x}</button>`},rh=function(){if(!this.store&&!this.userName)return c;let e=this.userName.trim().charAt(0).toUpperCase();return o`<section aria-labelledby="${s(this,Zt)}-profile">
|
|
2049
|
+
<h2 class="heading" id="${s(this,Zt)}-profile">${this.t("profile")}</h2>
|
|
1837
2050
|
<ul class="card">
|
|
1838
|
-
${this.store?
|
|
2051
|
+
${this.store?o`<li><button type="button" class="row" part="row" @click=${()=>n(this,ie,nc).call(this,"cm-store-switch")}>
|
|
1839
2052
|
<span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
|
|
1840
2053
|
<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
|
|
1841
|
-
${this.userName?
|
|
1842
|
-
<span class="avatar">${this.avatarSrc?
|
|
1843
|
-
<span class="stack"><span>${this.userName}</span>${this.userEmail?
|
|
2054
|
+
${this.userName?o`<li><button type="button" class="row" part="row" @click=${()=>n(this,ie,nc).call(this,"cm-account")}>
|
|
2055
|
+
<span class="avatar">${this.avatarSrc?o`<img src=${this.avatarSrc} alt="">`:o`<span aria-hidden="true">${e}</span>`}</span>
|
|
2056
|
+
<span class="stack"><span>${this.userName}</span>${this.userEmail?o`<span class="email">${this.userEmail}</span>`:c}</span>
|
|
1844
2057
|
<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
|
|
1845
2058
|
</ul>
|
|
1846
|
-
</section>`},
|
|
2059
|
+
</section>`},Ss.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},Ss.styles=[v,u`
|
|
1847
2060
|
:host { display: block; background: var(--cm-bg-page); }
|
|
1848
2061
|
nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
|
|
1849
2062
|
.heading {
|
|
@@ -1880,11 +2093,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1880
2093
|
}
|
|
1881
2094
|
.back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
1882
2095
|
.sub .row { font-size: 16px; min-height: 48px; }
|
|
1883
|
-
`];
|
|
1884
|
-
<span class="icon" aria-hidden="true"><slot name="icon">${this.icon?
|
|
2096
|
+
`];f("cm-mobile-menu",Ss);var rv=k("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),To,nh,Ls=class extends w{constructor(){super(...arguments);h(this,To);this.icon="send";this.dismissible=!1}render(){return o`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
|
|
2097
|
+
<span class="icon" aria-hidden="true"><slot name="icon">${this.icon?o`<cm-icon name=${this.icon} size="20"></cm-icon>`:c}</slot></span>
|
|
1885
2098
|
<span class="text"><slot></slot></span>
|
|
1886
|
-
${this.dismissible?
|
|
1887
|
-
</div>`}};
|
|
2099
|
+
${this.dismissible?o`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${n(this,To,nh)}><cm-icon name="close" size="18"></cm-icon></button>`:c}
|
|
2100
|
+
</div>`}};To=new WeakSet,nh=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},Ls.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},Ls.styles=[v,u`
|
|
1888
2101
|
:host { display: block; }
|
|
1889
2102
|
.bar {
|
|
1890
2103
|
position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
|
|
@@ -1906,11 +2119,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1906
2119
|
@media (max-width: 640px) {
|
|
1907
2120
|
.bar { font-size: 14px; min-height: 44px; justify-content: flex-start; text-align: start; }
|
|
1908
2121
|
}
|
|
1909
|
-
`];
|
|
1910
|
-
<ul part="tabs">${this.tabs.map(e=>
|
|
1911
|
-
@click=${t=>{
|
|
2122
|
+
`];f("cm-flash-offer-bar",Ls);var mv=k("linkTabs",{label:"Sections"}),xr,yr,lc,Cs=class extends w{constructor(){super(...arguments);h(this,yr);this.items=[];this._slotted=[];h(this,xr)}connectedCallback(){super.connectedCallback(),n(this,yr,lc).call(this),b(this,xr,xt(this,()=>n(this,yr,lc).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,xr)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return o`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
2123
|
+
<ul part="tabs">${this.tabs.map(e=>o`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":c}
|
|
2124
|
+
@click=${t=>{yt(this,e)||t.preventDefault()}}>${e.label}${e.badge?o`<span class="badge">(${e.badge})</span>`:c}</a></li>`)}</ul>
|
|
1912
2125
|
<slot hidden></slot>
|
|
1913
|
-
</nav>`}};
|
|
2126
|
+
</nav>`}};xr=new WeakMap,yr=new WeakSet,lc=function(){this._slotted=Xe(this)},Cs.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},Cs.styles=[v,u`
|
|
1914
2127
|
:host { display: block; }
|
|
1915
2128
|
ul {
|
|
1916
2129
|
display: flex; gap: 28px; margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto; scrollbar-width: thin;
|
|
@@ -1928,19 +2141,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1928
2141
|
a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
1929
2142
|
.badge { font-size: 12px; color: var(--cm-text-tertiary); }
|
|
1930
2143
|
@media (max-width: 640px) { ul { gap: 18px; } a { font-size: 14px; } }
|
|
1931
|
-
`];
|
|
2144
|
+
`];f("cm-link-tabs",Cs);var yv=k("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),As=class extends w{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",l=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return o`<article part="card" aria-labelledby="name">
|
|
1932
2145
|
<div class="logo" part="logo"><slot name="logo"></slot></div>
|
|
1933
2146
|
<div class="status"><slot name="status"></slot></div>
|
|
1934
2147
|
<div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
|
|
1935
|
-
${this.developer?
|
|
1936
|
-
${t?
|
|
2148
|
+
${this.developer?o`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:c}
|
|
2149
|
+
${t?o`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
|
|
1937
2150
|
<span aria-hidden="true">${l}</span><span class="sr">${this.t("rating",{rating:l})}</span>
|
|
1938
|
-
${
|
|
1939
|
-
${this.pricing?
|
|
1940
|
-
${this.offer?
|
|
1941
|
-
<div class="actions"><slot name="actions"></slot>${this.href?
|
|
2151
|
+
${i?this.reviewsHref?o`<a href=${this.reviewsHref}>${i}</a>`:o`<span>${i}</span>`:c}</p>`:c}
|
|
2152
|
+
${this.pricing?o`<p class="pricing">${this.pricing}</p>`:c}
|
|
2153
|
+
${this.offer?o`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:c}
|
|
2154
|
+
<div class="actions"><slot name="actions"></slot>${this.href?o`<a class="details" part="details" href=${this.href}
|
|
1942
2155
|
aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:c}</div>
|
|
1943
|
-
</article>`}};
|
|
2156
|
+
</article>`}};As.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},As.styles=[v,u`
|
|
1944
2157
|
:host { display: block; container-type: inline-size; }
|
|
1945
2158
|
article {
|
|
1946
2159
|
position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: var(--cm-space-20);
|
|
@@ -1976,20 +2189,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
1976
2189
|
.actions { gap: var(--cm-space-10); }
|
|
1977
2190
|
.details { margin-inline-start: auto; }
|
|
1978
2191
|
}
|
|
1979
|
-
`];
|
|
2192
|
+
`];f("cm-app-card",As);var So,oh,Ds=class extends F{constructor(){super(...arguments);h(this,So);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
|
|
1980
2193
|
${this.renderHeader()}
|
|
1981
2194
|
<div class="body" part="body"><slot></slot></div>
|
|
1982
|
-
<footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${
|
|
1983
|
-
</div>`)}};
|
|
2195
|
+
<footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${n(this,So,oh)}></slot></footer>
|
|
2196
|
+
</div>`)}};So=new WeakSet,oh=function(e){this._hasFooter=e.target.assignedElements().length>0},Ds.properties={...F.properties,size:{reflect:!0},_hasFooter:{state:!0}},Ds.styles=[...F.overlayStyles,u`
|
|
1984
2197
|
dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
|
|
1985
2198
|
:host([size='small']) dialog { --cm-modal-width: 400px; }
|
|
1986
2199
|
:host([size='large']) dialog { --cm-modal-width: 900px; }
|
|
1987
2200
|
.panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-sm); box-shadow: var(--cm-shadow-100); }
|
|
1988
|
-
`];
|
|
2201
|
+
`];f("cm-modal",Ds);var Lo,lh,De=class extends F{constructor(){super(...arguments);h(this,Lo);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return o`<slot></slot>`}renderFooter(){return o`<slot name="footer" @slotchange=${n(this,Lo,lh)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
|
|
1989
2202
|
${this.renderHeader()}
|
|
1990
2203
|
<div class="body" part="body">${this.renderBody()}</div>
|
|
1991
2204
|
<footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
|
|
1992
|
-
</div>`)}};
|
|
2205
|
+
</div>`)}};Lo=new WeakSet,lh=function(e){this._hasFooter=e.target.assignedElements().length>0},De.properties={...F.properties,size:{reflect:!0},_hasFooter:{state:!0}},De.styles=[...F.overlayStyles,u`
|
|
1993
2206
|
dialog {
|
|
1994
2207
|
position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
|
|
1995
2208
|
}
|
|
@@ -2006,25 +2219,25 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2006
2219
|
dialog { inset: 16px; width: auto; height: auto; }
|
|
2007
2220
|
.panel { border-radius: var(--cm-radius-sm); }
|
|
2008
2221
|
}
|
|
2009
|
-
`];
|
|
2222
|
+
`];f("cm-side-panel",De);var Hv=k("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),Is,Co,Ns=class extends De{constructor(){super(...arguments);this.search=!1;this.query="";h(this,Is,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});h(this,Co,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(l,d)=>{if(d==="")return;let p=e[l];e[l]=p===void 0?d:Array.isArray(p)?[...p,d]:[p,d]},i=this.form;if(i){for(let[l,d]of new FormData(i))typeof d=="string"&&t(l,d);return e}return this.querySelectorAll("[name]").forEach(l=>{let d=l.getAttribute("name");"checked"in l&&(l.type==="checkbox"||l.type==="radio"||l.localName.match(/^cm-(checkbox|radio|toggle)$/))?l.checked&&t(d,l.value||"on"):typeof l.value=="string"&&t(d,l.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return o`${this.search?o`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
|
|
2010
2223
|
placeholder=${this.searchPlaceholder}
|
|
2011
2224
|
@input=${e=>{this.query=e.target.value}}
|
|
2012
|
-
@cm-search=${e=>{e.stopPropagation(),
|
|
2013
|
-
<slot @submit=${e=>{e.preventDefault(),
|
|
2014
|
-
<cm-button part="apply" variant="primary" @click=${
|
|
2225
|
+
@cm-search=${e=>{e.stopPropagation(),s(this,Is).call(this)}}></cm-search>`:c}
|
|
2226
|
+
<slot @submit=${e=>{e.preventDefault(),s(this,Is).call(this)}}></slot>`}renderFooter(){return o`<cm-button part="reset" @click=${s(this,Co)}>${this.resetLabel}</cm-button>
|
|
2227
|
+
<cm-button part="apply" variant="primary" @click=${s(this,Is)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};Is=new WeakMap,Co=new WeakMap,Ns.properties={...De.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},Ns.styles=[...De.styles,u`
|
|
2015
2228
|
.search { display: block; margin-bottom: var(--cm-space-20); }
|
|
2016
2229
|
.foot { justify-content: center; }
|
|
2017
2230
|
::slotted(form) { display: grid; gap: var(--cm-space-15); }
|
|
2018
|
-
`];
|
|
2231
|
+
`];f("cm-filter-panel",Ns);var wr,Qt,cc,ch,Hs=class extends F{constructor(){super(...arguments);h(this,Qt);this.heading="";this.items=[];this._slotted=[];h(this,wr)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=ar(this),b(this,wr,ro(this,()=>{this._slotted=ar(this)}))}disconnectedCallback(){super.disconnectedCallback(),s(this,wr)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider),t=e.some(i=>i.icon);return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
|
|
2019
2232
|
<button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
|
|
2020
2233
|
<cm-icon name="close" size="16"></cm-icon></button>
|
|
2021
|
-
${this.heading?
|
|
2234
|
+
${this.heading?o`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:c}
|
|
2022
2235
|
<div class="content">
|
|
2023
|
-
${e.length?
|
|
2236
|
+
${e.length?o`<ul class=${t?"icons":""} part="list">${e.map(i=>o`<li>${n(this,Qt,ch).call(this,i)}</li>`)}</ul>`:c}
|
|
2024
2237
|
<slot ?hidden=${this._slotted.length>0}></slot>
|
|
2025
2238
|
</div>
|
|
2026
|
-
</div>`)}};
|
|
2027
|
-
@click=${l=>
|
|
2239
|
+
</div>`)}};wr=new WeakMap,Qt=new WeakSet,cc=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},ch=function(e){let t=`row${e.critical?" critical":""}`,i=o`${e.icon?o`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:c}<span class="label">${e.label}</span>${e.icon?o`<cm-icon name="chevron-right" size="16"></cm-icon>`:c}`;return e.href&&!e.disabled?o`<a class=${t} part="row" href=${e.href} @click=${l=>n(this,Qt,cc).call(this,l,e)}>${i}</a>`:o`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":c}
|
|
2240
|
+
@click=${l=>n(this,Qt,cc).call(this,l,e)}>${i}</button>`},Hs.properties={...F.properties,items:{type:Array},_slotted:{state:!0}},Hs.styles=[...F.overlayStyles,u`
|
|
2028
2241
|
dialog {
|
|
2029
2242
|
position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: 22px;
|
|
2030
2243
|
}
|
|
@@ -2058,17 +2271,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2058
2271
|
}
|
|
2059
2272
|
@keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
2060
2273
|
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
2061
|
-
`];
|
|
2062
|
-
<cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?
|
|
2274
|
+
`];f("cm-bottom-sheet",Hs);var Gv=k("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),sp={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},Rs=class extends E{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};Rs.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},Rs.styles=u`:host { display: none; }`;f("cm-notification-item",Rs);var qs,de,dc,hc,dh,hh,ph,Os=class extends F{constructor(){super(...arguments);h(this,de);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;h(this,qs)}connectedCallback(){super.connectedCallback(),n(this,de,dc).call(this),b(this,qs,new MutationObserver(()=>n(this,de,dc).call(this))),s(this,qs).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,qs)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(l=>l.unread)?o`<button type="button" class="mark" part="mark-all-read" @click=${n(this,de,hh)}>${this.markAllLabel}</button>`:c,i=this.loading?o`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>o`<li>
|
|
2275
|
+
<cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?o`<ul class="list" part="list">${e.map(l=>o`<li>${n(this,de,dh).call(this,l)}</li>`)}</ul>`:o`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
|
|
2063
2276
|
${this.renderHeader(t)}
|
|
2064
|
-
${
|
|
2277
|
+
${i}
|
|
2065
2278
|
<span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
|
|
2066
|
-
${this.moreHref?
|
|
2067
|
-
<div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${
|
|
2279
|
+
${this.moreHref?o`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:c}
|
|
2280
|
+
<div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${n(this,de,ph)}></slot></div>
|
|
2068
2281
|
<slot hidden></slot>
|
|
2069
|
-
</div>`)}};
|
|
2070
|
-
<span class="label">${e.unread?
|
|
2071
|
-
${e.time?
|
|
2282
|
+
</div>`)}};qs=new WeakMap,de=new WeakSet,dc=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},hc=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},dh=function(e){let t=e.tone??"information",i=e.description?o`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,l=o`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||sp[t]||"bell"} size="14"></cm-icon></span>
|
|
2283
|
+
<span class="label">${e.unread?o`<span class="vh">${this.t("unread")}</span>`:c}${i}</span>
|
|
2284
|
+
${e.time?o`<time>${e.time}</time>`:c}`,d=`row${e.unread?" unread":""}`;return e.href?o`<a class=${d} part="row" href=${e.href} @click=${p=>n(this,de,hc).call(this,p,e)}>${l}</a>`:o`<button type="button" class=${d} part="row" @click=${p=>n(this,de,hc).call(this,p,e)}>${l}</button>`},hh=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},ph=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},Os.properties={...F.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},Os.styles=[...F.overlayStyles,u`
|
|
2072
2285
|
dialog {
|
|
2073
2286
|
position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
|
|
2074
2287
|
width: min(380px, calc(100vw - 32px));
|
|
@@ -2117,14 +2330,14 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2117
2330
|
@media (max-width: 599px) {
|
|
2118
2331
|
dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
|
|
2119
2332
|
}
|
|
2120
|
-
`];
|
|
2121
|
-
${this.tone==="critical"?
|
|
2333
|
+
`];f("cm-notification-panel",Os);var ix=k("toastRegion",{label:"Notifications"}),ap=2e3,mh=1e4,uh=150,$r,ze,Qe,kr,js,Vs,se,bh,Ps,pc,Er,Mr,_r,zr,fh,Bs=class extends w{constructor(){super(...arguments);h(this,se);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;h(this,$r);h(this,ze);h(this,Qe,0);h(this,kr,0);h(this,js,!1);h(this,Vs,!1);h(this,Er,()=>{b(this,js,!0),n(this,se,pc).call(this)});h(this,Mr,()=>{b(this,js,!1),n(this,se,Ps).call(this)});h(this,_r,()=>{b(this,Vs,!0),n(this,se,pc).call(this)});h(this,zr,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(b(this,Vs,!1),n(this,se,Ps).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?mh:5e3);return Math.min(mh,Math.max(ap,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&b(this,$r,setTimeout(()=>{this._primed=!0},uh)),this.addEventListener("pointerenter",s(this,Er)),this.addEventListener("pointerleave",s(this,Mr)),this.addEventListener("focusin",s(this,_r)),this.addEventListener("focusout",s(this,zr))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(s(this,ze)),clearTimeout(s(this,$r)),this.removeEventListener("pointerenter",s(this,Er)),this.removeEventListener("pointerleave",s(this,Mr)),this.removeEventListener("focusin",s(this,_r)),this.removeEventListener("focusout",s(this,zr))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(s(this,ze)),this.open&&(this._inRegion||this._primed)&&(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)))}show(){this.open?(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(s(this,ze)),this.open=!1,!0):(e==="timeout"&&(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)),!1)}render(){let e=o`<div class="toast" part="toast">
|
|
2334
|
+
${this.tone==="critical"?o`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:c}
|
|
2122
2335
|
<div class="message" part="message">${this.message}<slot></slot></div>
|
|
2123
|
-
${this.actionLabel?
|
|
2336
|
+
${this.actionLabel?o`<button class="action" part="action" @click=${n(this,se,fh)}>${this.actionLabel}</button>`:c}
|
|
2124
2337
|
<button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
|
|
2125
2338
|
<svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
|
|
2126
2339
|
</button>
|
|
2127
|
-
</div>`;return this._inRegion?e:
|
|
2340
|
+
</div>`;return this._inRegion?e:o`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:c}</div>`}};$r=new WeakMap,ze=new WeakMap,Qe=new WeakMap,kr=new WeakMap,js=new WeakMap,Vs=new WeakMap,se=new WeakSet,bh=function(){return s(this,js)||s(this,Vs)},Ps=function(){clearTimeout(s(this,ze)),!(!this.open||s(this,se,bh))&&(b(this,kr,Date.now()),b(this,ze,setTimeout(()=>this.dismiss("timeout"),s(this,Qe))))},pc=function(){s(this,ze)!==void 0&&(clearTimeout(s(this,ze)),b(this,ze,void 0),b(this,Qe,Math.max(1e3,s(this,Qe)-(Date.now()-s(this,kr)))))},Er=new WeakMap,Mr=new WeakMap,_r=new WeakMap,zr=new WeakMap,fh=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Bs.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Bs.styles=[v,u`
|
|
2128
2341
|
:host { display: block; pointer-events: auto; }
|
|
2129
2342
|
:host(:not([open])) { display: none; }
|
|
2130
2343
|
.toast {
|
|
@@ -2149,23 +2362,23 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2149
2362
|
:host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
|
|
2150
2363
|
button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
|
|
2151
2364
|
:host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
|
|
2152
|
-
`];
|
|
2365
|
+
`];f("cm-toast",Bs);var Tr,Sr,Fs=class extends w{constructor(){super(...arguments);this.max=3;h(this,Tr,!1);h(this,Sr,e=>{let t=e.target;queueMicrotask(()=>{t.localName==="cm-toast"&&!t.open&&t.remove()})})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),b(this,Tr,!0)),this.addEventListener("cm-dismiss",s(this,Sr))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",s(this,Sr))}updated(){s(this,Tr)&&this.setAttribute("aria-label",this.t("label"))}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")];return t.slice(0,Math.max(0,t.length-Math.max(1,this.max))).forEach(i=>i.remove()),e}render(){return o`<slot></slot>`}};Tr=new WeakMap,Sr=new WeakMap,Fs.properties={max:{type:Number}},Fs.styles=[v,u`
|
|
2153
2366
|
:host {
|
|
2154
2367
|
position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
|
|
2155
2368
|
display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-10);
|
|
2156
2369
|
padding-inline: var(--cm-space-15); pointer-events: none;
|
|
2157
2370
|
}
|
|
2158
|
-
`];
|
|
2371
|
+
`];f("cm-toast-region",Fs);function rp(r,a={}){let e=a.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let l=document.createElement("cm-toast");if(l.message=String(r),a.tone&&(l.tone=a.tone),a.duration!==void 0&&(l.duration=a.duration),a.action){l.actionLabel=a.action.label;let d=a.action.onAction;l.addEventListener("cm-action",()=>d())}if(i){let d=t;return setTimeout(()=>d.add(l),uh),l}return t.add(l)}var cx=k("progressBar",{inProgress:"In progress"}),Ao,Us=class extends w{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";h(this,Ao,S("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${s(this,Ao)}-label`;return o`
|
|
2159
2372
|
<div class="head ${this.labelHidden?"vh":""}">
|
|
2160
2373
|
<span id=${t} part="label">${this.label}</span>
|
|
2161
|
-
${this.showValue&&e!==null?
|
|
2374
|
+
${this.showValue&&e!==null?o`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:c}
|
|
2162
2375
|
</div>
|
|
2163
2376
|
<div class="track ${e===null?"indeterminate":""}" part="track" role="progressbar"
|
|
2164
2377
|
aria-labelledby=${t} aria-valuemin="0" aria-valuemax="100"
|
|
2165
2378
|
aria-valuenow=${e===null?c:Math.round(e)}
|
|
2166
2379
|
aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
|
|
2167
2380
|
<div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
|
|
2168
|
-
</div>`}};
|
|
2381
|
+
</div>`}};Ao=new WeakMap,Us.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Us.styles=[v,u`
|
|
2169
2382
|
:host { display: block; }
|
|
2170
2383
|
.head { display: flex; justify-content: space-between; gap: var(--cm-space-10); margin-block-end: 6px; font-size: 14px; line-height: 20px; }
|
|
2171
2384
|
.value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
|
|
@@ -2182,7 +2395,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2182
2395
|
.fill { transition: none; }
|
|
2183
2396
|
.indeterminate .fill { animation-duration: 4s; }
|
|
2184
2397
|
}
|
|
2185
|
-
`];
|
|
2398
|
+
`];f("cm-progress-bar",Us);var Ks=class extends E{constructor(){super(...arguments);this.tone="neutral"}render(){return o`<span part="badge"><slot></slot></span>`}};Ks.properties={tone:{reflect:!0}},Ks.styles=[v,u`
|
|
2186
2399
|
:host { display: inline-flex; vertical-align: middle; }
|
|
2187
2400
|
span {
|
|
2188
2401
|
display: inline-flex; align-items: center; height: 28px; padding: 0 var(--cm-space-10);
|
|
@@ -2194,24 +2407,38 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2194
2407
|
:host([tone='success']) span { background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)), var(--cm-bg-surface); color: var(--cm-text-success); }
|
|
2195
2408
|
:host([tone='critical']) span { background: linear-gradient(var(--cm-bg-critical), var(--cm-bg-critical)), var(--cm-bg-surface); color: var(--cm-text-critical); }
|
|
2196
2409
|
:host([tone='attention']) span { background: linear-gradient(var(--cm-bg-attention), var(--cm-bg-attention)), var(--cm-bg-surface); color: var(--cm-text-attention); }
|
|
2197
|
-
`];
|
|
2198
|
-
${this.heading||this.description?
|
|
2410
|
+
`];f("cm-badge",Ks);var Ys,Do,gh,Ws=class extends E{constructor(){super(...arguments);h(this,Do);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;h(this,Ys,!1)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?o`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${this.heading}</span><span class="adornment" ?hidden=${!s(this,Ys)}><slot name="title-adornment" @slotchange=${n(this,Do,gh)}></slot></span></div>`:c;return o`<section part="card" aria-label=${this.heading||c}>
|
|
2411
|
+
${this.heading||this.description?o`<header><div class="main">${this.heading?o`<span class="strut" aria-hidden="true">${this.heading}</span>`:c}${t}${this.description?o`<p class="desc">${this.description}</p>`:c}</div>
|
|
2199
2412
|
<div class="actions"><slot name="actions"></slot></div></header>`:c}
|
|
2200
2413
|
<slot></slot>
|
|
2201
|
-
</section>`}};
|
|
2414
|
+
</section>`}};Ys=new WeakMap,Do=new WeakSet,gh=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,Ys)&&(b(this,Ys,t),this.requestUpdate())},Ws.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Ws.styles=[v,u`
|
|
2202
2415
|
:host { display: block; }
|
|
2203
2416
|
section {
|
|
2204
2417
|
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
|
|
2205
2418
|
border-radius: var(--cm-radius-md); padding: var(--cm-space-20);
|
|
2206
2419
|
}
|
|
2207
2420
|
:host([flush]) section { padding: 0; }
|
|
2208
|
-
|
|
2421
|
+
/* Wraps only on narrow cards. .main grows from a 0 basis (wide cards look exactly as before: its content stays
|
|
2422
|
+
at the start), and its minimum width comes from .strut: the heading on one line, capped at 12 characters. So
|
|
2423
|
+
the actions move under the title only when the heading would get less than that. */
|
|
2424
|
+
header {
|
|
2425
|
+
display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
|
|
2426
|
+
gap: var(--cm-space-10) var(--cm-space-20); margin-bottom: var(--cm-space-20);
|
|
2427
|
+
}
|
|
2209
2428
|
:host([flush]) header { padding: var(--cm-space-20) var(--cm-space-20) 0; }
|
|
2210
|
-
.
|
|
2429
|
+
.main { flex: 1 1 0%; max-inline-size: 100%; }
|
|
2430
|
+
.strut {
|
|
2431
|
+
display: block; block-size: 0; overflow: hidden; visibility: hidden; white-space: nowrap;
|
|
2432
|
+
max-inline-size: 12ch; font-size: var(--cm-type-heading-sm-size); font-weight: 600;
|
|
2433
|
+
}
|
|
2434
|
+
.title { margin: 0; font-size: var(--cm-type-heading-sm-size); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10); }
|
|
2435
|
+
/* Flex-wrap moves the badges under the heading before the heading itself would wrap. */
|
|
2436
|
+
.adornment { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10); }
|
|
2437
|
+
.adornment[hidden] { display: none; }
|
|
2211
2438
|
.desc { margin: 6px 0 0; font-size: 16px; color: var(--cm-text-tertiary); }
|
|
2212
|
-
.actions { display: flex; gap: var(--cm-space-20); align-items: center; }
|
|
2213
|
-
`];
|
|
2214
|
-
`))}var
|
|
2439
|
+
.actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-20); align-items: center; }
|
|
2440
|
+
`];f("cm-card",Ws);var np=["0","10","12","15","20","22","30"];function Gs(r,a){return Nr(np.map(e=>`:host([${r}='${e}']) { ${a}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
|
|
2441
|
+
`))}var Xs=class extends E{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return o`<slot></slot>`}};Xs.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},Xs.styles=[v,u`
|
|
2215
2442
|
:host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
|
|
2216
2443
|
:host([direction='inline']) { flex-direction: row; align-items: center; }
|
|
2217
2444
|
:host([wrap]) { flex-wrap: wrap; }
|
|
@@ -2224,13 +2451,13 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2224
2451
|
:host([justify='center']) { justify-content: center; }
|
|
2225
2452
|
:host([justify='end']) { justify-content: flex-end; }
|
|
2226
2453
|
:host([justify='space-between']) { justify-content: space-between; }
|
|
2227
|
-
`,
|
|
2454
|
+
`,Gs("gap","gap")];f("cm-stack",Xs);var vh="important",op=" !"+vh,xh=Xr(class extends ni{constructor(r){if(super(r),r.type!==He.ATTRIBUTE||r.name!=="style"||r.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(r){return Object.keys(r).reduce((a,e)=>{let t=r[e];return t==null?a:a+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(r,[a]){let{style:e}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(a)),this.render(a);for(let t of this.ft)a[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in a){let i=a[t];if(i!=null){this.ft.add(t);let l=typeof i=="string"&&i.endsWith(op);t.includes("-")||l?e.setProperty(t,l?i.slice(0,-11):i,l?vh:""):e[t]=i}}return ae}});var Js=class extends E{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(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return o`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${xh({gridTemplateColumns:i})}><slot></slot></div>`}};Js.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},Js.styles=[v,u`
|
|
2228
2455
|
:host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
|
|
2229
2456
|
.grid { display: grid; gap: var(--_gap); align-items: start; }
|
|
2230
2457
|
@container cm-grid (max-width: 640px) {
|
|
2231
2458
|
.grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
|
|
2232
2459
|
}
|
|
2233
|
-
`,
|
|
2460
|
+
`,Gs("gap","--_gap")];f("cm-grid",Js);var Zs=class extends E{constructor(){super(...arguments);this.gap="20"}render(){return o`<div class="layout" part="layout"><slot></slot></div>`}};Zs.properties={gap:{reflect:!0}},Zs.styles=[v,u`
|
|
2234
2461
|
:host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-20); }
|
|
2235
2462
|
.layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
|
|
2236
2463
|
@container cm-layout (max-width: 767px) {
|
|
@@ -2244,9 +2471,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2244
2471
|
::slotted([variant='one-third']) { grid-column: span 2; }
|
|
2245
2472
|
::slotted([variant='two-thirds']) { grid-column: span 4; }
|
|
2246
2473
|
}
|
|
2247
|
-
`,
|
|
2474
|
+
`,Gs("gap","--_gap")];var Qs=class extends E{constructor(){super(...arguments);this.variant="full"}render(){return o`<slot></slot>`}};Qs.properties={variant:{reflect:!0}},Qs.styles=[v,u`
|
|
2248
2475
|
:host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
|
|
2249
|
-
`];
|
|
2476
|
+
`];f("cm-layout",Zs);f("cm-layout-section",Qs);var mc=1024,lp=()=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;return r},ti,ta,he,uc,ei,yh,Lr,Cr,ea=class extends E{constructor(){super(...arguments);h(this,he);this.menuOpen=!1;this.menuItem="";this._wide=!1;h(this,ti);h(this,ta,null);h(this,Lr,e=>{if(!this.menuItem)return;let t=n(this,he,yh).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?n(this,he,ei).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&n(this,he,ei).call(this,!1,!1)});h(this,Cr,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),n(this,he,ei).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",s(this,Lr)),this.addEventListener("keydown",s(this,Cr));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=mc)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",s(this,Lr)),this.removeEventListener("keydown",s(this,Cr)),s(this,ti)?.disconnect(),b(this,ti,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;b(this,ti,new ResizeObserver(()=>{n(this,he,uc).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=mc!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=mc}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>s(this,ti).observe(t))}updated(e){e.has("_wide")&&n(this,he,uc).call(this)}openMenu(){n(this,he,ei).call(this,!0)}closeMenu(){n(this,he,ei).call(this,!1)}toggleMenu(){n(this,he,ei).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return o`<div class="frame ${e?"wide":""}" part="frame">
|
|
2250
2477
|
<div class="probe"></div>
|
|
2251
2478
|
<div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
|
|
2252
2479
|
<div class="body">
|
|
@@ -2255,7 +2482,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2255
2482
|
</div>
|
|
2256
2483
|
<div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
|
|
2257
2484
|
<div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation"></slot></div>
|
|
2258
|
-
</div>`}};
|
|
2485
|
+
</div>`}};ti=new WeakMap,ta=new WeakMap,he=new WeakSet,uc=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},ei=function(e,t=!0){e!==this.menuOpen&&(e&&b(this,ta,lp()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(s(this,ta)?.focus(),b(this,ta,null))}))},yh=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},Lr=new WeakMap,Cr=new WeakMap,ea.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},ea.styles=[v,u`
|
|
2259
2486
|
:host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
|
|
2260
2487
|
.header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
|
|
2261
2488
|
.body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
|
|
@@ -2276,7 +2503,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2276
2503
|
}
|
|
2277
2504
|
.probe { block-size: 0; }
|
|
2278
2505
|
[hidden] { display: none !important; }
|
|
2279
|
-
`];
|
|
2506
|
+
`];f("cm-app-frame",ea);var ia=class extends E{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return o`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};ia.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},ia.styles=[v,u`
|
|
2280
2507
|
:host { display: block; container: cm-page / inline-size; background: var(--cm-bg-page); min-block-size: 100%; }
|
|
2281
2508
|
.content {
|
|
2282
2509
|
box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
|
|
@@ -2285,16 +2512,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2285
2512
|
:host([narrow]) .content { max-inline-size: 800px; }
|
|
2286
2513
|
:host([full-width]) .content { max-inline-size: none; }
|
|
2287
2514
|
@container cm-page (max-width: 640px) { .content { padding: var(--cm-space-10); } }
|
|
2288
|
-
`];
|
|
2515
|
+
`];f("cm-page",ia);var aa,wh,$h,sa=class extends w{constructor(){super(...arguments);h(this,aa);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?pa`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:pa`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return o`<div class="banner" part="banner" role=${e}>
|
|
2289
2516
|
<svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
|
|
2290
2517
|
<div class="body">
|
|
2291
|
-
${this.heading?
|
|
2518
|
+
${this.heading?o`<p class="title">${this.heading}</p>`:c}
|
|
2292
2519
|
<div><slot></slot></div>
|
|
2293
|
-
<div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${
|
|
2520
|
+
<div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${n(this,aa,wh)}></slot></div>
|
|
2294
2521
|
</div>
|
|
2295
|
-
${this.dismissible?
|
|
2522
|
+
${this.dismissible?o`<button class="close" aria-label=${this.t("dismiss")} @click=${n(this,aa,$h)}>
|
|
2296
2523
|
<svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>`:c}
|
|
2297
|
-
</div>`}};
|
|
2524
|
+
</div>`}};aa=new WeakSet,wh=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},$h=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},sa.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},sa.styles=[v,u`
|
|
2298
2525
|
:host { display: block; }
|
|
2299
2526
|
.banner {
|
|
2300
2527
|
display: flex; gap: var(--cm-space-15); align-items: flex-start;
|
|
@@ -2317,10 +2544,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2317
2544
|
border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
|
|
2318
2545
|
}
|
|
2319
2546
|
.close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
2320
|
-
`];
|
|
2321
|
-
@error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return
|
|
2547
|
+
`];f("cm-banner",sa);var sy=k("thumbnail",{noImage:"{alt} (no image)"}),ra=class extends w{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return o`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
|
|
2548
|
+
@error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return o`<span class="box" part="thumbnail" role=${this.alt?"img":c}
|
|
2322
2549
|
aria-label=${this.alt?this.t("noImage",{alt:this.alt}):c} aria-hidden=${this.alt?c:"true"}>
|
|
2323
|
-
<cm-icon name="box" size=${e}></cm-icon></span>`}};
|
|
2550
|
+
<cm-icon name="box" size=${e}></cm-icon></span>`}};ra.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},ra.styles=[v,u`
|
|
2324
2551
|
:host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
|
|
2325
2552
|
:host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
|
|
2326
2553
|
:host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
|
|
@@ -2330,7 +2557,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2330
2557
|
background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
|
|
2331
2558
|
}
|
|
2332
2559
|
img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
|
|
2333
|
-
`];
|
|
2560
|
+
`];f("cm-thumbnail",ra);export{Bi as CmAccordion,Ri as CmActionBar,hs as CmActionMenu,As as CmAppCard,ea as CmAppFrame,ks as CmAvatar,Ks as CmBadge,sa as CmBanner,Ts as CmBottomNavigation,Hs as CmBottomSheet,_t as CmButton,Ws as CmCard,tt as CmCheckbox,lt as CmCombobox,Ui as CmComment,Ki as CmCommentBox,os as CmDataTable,pt as CmDatePicker,ut as CmDateRangePicker,Fi as CmEmptyState,ft as CmFileUpload,Ns as CmFilterPanel,Ls as CmFlashOfferBar,Dt as CmGlobalSearch,Js as CmGrid,Ms as CmHeaderBar,ri as CmIcon,Pi as CmInfoItem,qi as CmInfoPanel,Zs as CmLayout,Qs as CmLayoutSection,Cs as CmLinkTabs,w as CmLocalizedElement,cs as CmMenuItem,vs as CmMetric,Ss as CmMobileMenu,Ds as CmModal,xs as CmNavItem,go as CmNestedItem,fs as CmNestedList,Rs as CmNotificationItem,Os as CmNotificationPanel,qt as CmOptionGroup,ia as CmPage,Hi as CmPageHeader,is as CmPagination,Us as CmProgressBar,St as CmRadio,Lt as CmRadioGroup,Xt as CmReportTile,gs as CmReportTiles,us as CmResourceItem,bs as CmResourceList,Oi as CmSaveBar,nt as CmSearch,rt as CmSelect,ys as CmSideNavigation,De as CmSidePanel,ji as CmSkeleton,Vi as CmSkeletonDisplay,es as CmSmartTip,ts as CmSmartTips,fi as CmSpinner,Xs as CmStack,as as CmStatusTabs,rs as CmTableHeader,bi as CmTag,et as CmTextField,ra as CmThumbnail,Vt as CmTimeline,Zi as CmTimelineItem,Bs as CmToast,Fs as CmToastRegion,st as CmToggle,Wi as CmTooltip,Oh as configure,k as defineStrings,Pc as directionalIcons,V as formatDate,Rc as formatMessage,Yo as formatNumber,Hh as getDefaultStrings,ih as initials,ba as localeFor,Ur as pluralCategory,qh as resetStrings,cd as resolvePreset,Rh as setStrings,rp as showToast,Oc as translate};
|
|
2334
2561
|
/*! Bundled license information:
|
|
2335
2562
|
|
|
2336
2563
|
@lit/reactive-element/css-tag.js:
|