@commmerce/ui 1.7.1 → 1.8.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/LICENSE.md +27 -4
- package/dist/cdn.js +50 -48
- package/dist/components/board.js +0 -1
- package/dist/components/data-table.js +3 -1
- package/dist/components/side-navigation.js +4 -2
- package/dist/components/signature-field.js +2 -2
- package/dist/components/text-field.js +2 -2
- package/package.json +3 -3
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# Commmerce UI Licence
|
|
2
2
|
|
|
3
|
-
Version 1.
|
|
3
|
+
Version 1.1 | Copyright © 2026 Outdo Inc. (Commmerce)
|
|
4
4
|
|
|
5
5
|
All rights not expressly granted under this licence are reserved.
|
|
6
6
|
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
By downloading, installing, copying or using the Packages, you agree to be bound by this licence. If you
|
|
10
|
+
do not agree, do not download, install, copy or use the Packages. If you accept this licence on behalf of a
|
|
11
|
+
company or other legal entity, you confirm that you have authority to bind that entity, and "you" refers to
|
|
12
|
+
that entity.
|
|
13
|
+
|
|
7
14
|
## 1. Definitions
|
|
8
15
|
|
|
9
16
|
"**Commmerce**" means Outdo Inc. and its affiliates.
|
|
@@ -11,7 +18,7 @@ All rights not expressly granted under this licence are reserved.
|
|
|
11
18
|
"**Packages**" means the Commmerce UI software and assets distributed by Commmerce under this licence,
|
|
12
19
|
including the npm packages `@commmerce/tokens`, `@commmerce/icons`, `@commmerce/ui`, `@commmerce/ui-react`
|
|
13
20
|
and `@commmerce/app-bridge`, the Flutter package `commmerce_ui`, and the corresponding files hosted at
|
|
14
|
-
commmerce.com/blog/commmerceui
|
|
21
|
+
commmerce.com/commmerceui/ (also reachable at commmerce.com/blog/commmerceui/).
|
|
15
22
|
|
|
16
23
|
"**Commmerce Platform**" means the products, services, infrastructure and applications operated or provided
|
|
17
24
|
by Commmerce.
|
|
@@ -119,11 +126,18 @@ every third-party environment.
|
|
|
119
126
|
|
|
120
127
|
## 9. Limitation of Liability
|
|
121
128
|
|
|
129
|
+
The Packages are provided free of charge.
|
|
130
|
+
|
|
122
131
|
To the maximum extent permitted by applicable law, Commmerce and its affiliates, directors, officers,
|
|
123
132
|
employees and licensors shall not be liable for any indirect, incidental, special, exemplary or
|
|
124
133
|
consequential damages, or for loss of profits, revenue, business opportunities, goodwill, business
|
|
125
134
|
interruption or data arising out of or relating to the Packages or this licence.
|
|
126
135
|
|
|
136
|
+
To the maximum extent permitted by applicable law, the total aggregate liability of Commmerce and its
|
|
137
|
+
affiliates, directors, officers, employees and licensors arising out of or relating to the Packages or this
|
|
138
|
+
licence, whether in contract, tort (including negligence) or otherwise, shall not exceed the total amount
|
|
139
|
+
you paid to Commmerce for the Packages, which, because the Packages are provided free of charge, is zero.
|
|
140
|
+
|
|
127
141
|
Nothing in this licence excludes or limits liability to the extent that such exclusion or limitation is
|
|
128
142
|
prohibited by applicable law.
|
|
129
143
|
|
|
@@ -143,9 +157,18 @@ violation, Commmerce may permit a limited transition period for existing merchan
|
|
|
143
157
|
|
|
144
158
|
Termination does not affect rights or obligations accrued before termination.
|
|
145
159
|
|
|
146
|
-
Sections 4, 5, 7, 8, 9 and this section survive termination.
|
|
160
|
+
Sections 4, 5, 7, 8, 9, 11 and this section survive termination.
|
|
161
|
+
|
|
162
|
+
## 11. Governing Law and Jurisdiction
|
|
163
|
+
|
|
164
|
+
This licence, and any dispute or claim arising out of or in connection with it or the Packages, is governed
|
|
165
|
+
by the laws of India, without regard to its conflict of laws rules.
|
|
166
|
+
|
|
167
|
+
The courts at Bengaluru, Karnataka, India have exclusive jurisdiction over any such dispute or claim.
|
|
168
|
+
Commmerce may nevertheless seek injunctive or other equitable relief in any court of competent
|
|
169
|
+
jurisdiction to protect its intellectual property or confidential information.
|
|
147
170
|
|
|
148
|
-
##
|
|
171
|
+
## 12. Contact
|
|
149
172
|
|
|
150
173
|
Questions concerning this licence may be sent to: support@commmerce.com
|
|
151
174
|
|
package/dist/cdn.js
CHANGED
|
@@ -123,7 +123,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
123
123
|
}
|
|
124
124
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
125
125
|
@media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
|
|
126
|
-
`];$("cm-spinner",jr);var
|
|
126
|
+
`];$("cm-spinner",jr);var zx=z("actionMenu",{label:"Actions"}),qn,Fi,ji,Bn,K,vc,Fn,sm,yc,xc,wc,jn,Un,Ur,$c,ag,nm,sg,Vr=class extends T{constructor(){super(...arguments);p(this,K);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this.loading=!1;this.disabled=!1;this._slotted=[];this._active=-1;this._custom=!1;p(this,qn);p(this,Fi,A("cm-menu"));p(this,ji,"");p(this,Bn,0);p(this,Fn,e=>{this.open&&!e.composedPath().includes(this)&&s(this,K,xc).call(this,!1)});p(this,jn,e=>{this.disabled||(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)))});p(this,Un,()=>{this.disabled||(this.open?this.hide():this.show())});p(this,$c,e=>{let t=s(this,K,yc).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),s(this,K,Ur).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),s(this,K,Ur).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),s(this,K,Ur).call(this,t[0]);break;case"End":e.preventDefault(),s(this,K,Ur).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 a=Date.now();g(this,ji,(a-r(this,Bn)<600?r(this,ji):"")+e.key.toLowerCase()),g(this,Bn,a);let l=this.menuItems,d=r(this,ji).length>1?i:i+1,u=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(v=>(l[v].label??"").toLowerCase().startsWith(r(this,ji)));u!==void 0&&s(this,K,Ur).call(this,u)}}})}connectedCallback(){super.connectedCallback(),s(this,K,vc).call(this),g(this,qn,fc(this,()=>s(this,K,vc).call(this))),document.addEventListener("pointerdown",r(this,Fn),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,qn)?.disconnect(),document.removeEventListener("pointerdown",r(this,Fn),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=s(this,K,yc).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,s(this,K,xc).call(this,!0),this.updateComplete.then(()=>s(this,K,wc).call(this))}hide(e=!1){s(this,K,xc).call(this,!1),e&&s(this,K,sm).call(this)?.focus()}updated(e){if(this._custom){let t=s(this,K,sm).call(this);if(t){let i=(a,l)=>{t.getAttribute(a)!==l&&t.setAttribute(a,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${r(this,Fi)}-m`)}}if((e.has("open")||e.has("loading"))&&this.open&&this._active<0){let t=s(this,K,yc).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>s(this,K,wc).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${r(this,Un)} @keydown=${r(this,jn)} @slotchange=${()=>s(this,K,vc).call(this)}></slot>`:c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
|
|
127
127
|
aria-expanded=${String(this.open)} aria-controls="${r(this,Fi)}-m" aria-label=${this.iconOnly?t:h}
|
|
128
128
|
?disabled=${this.disabled} @click=${r(this,Un)} @keydown=${r(this,jn)}>${this.iconOnly?c`<cm-icon name=${this.icon} size="18"></cm-icon>`:c`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return c`${i}
|
|
129
129
|
<div class="pop" part="menu" ?hidden=${!this.open}>
|
|
@@ -193,7 +193,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
193
193
|
}
|
|
194
194
|
.loading { display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md, 36px); padding: var(--cm-space-4) var(--cm-space-12); font-size: var(--cm-font-size-14); color: var(--cm-text-tertiary); }
|
|
195
195
|
[role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
196
|
-
`];$("cm-action-menu",Vr);var
|
|
196
|
+
`];$("cm-action-menu",Vr);var Ax=z("buttonGroup",{more:"More"}),Zt="data-cm-overflow",Yv=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],Qt,Ui,St,bt,ei,Vi,U,Kr,ng,Vn,om,kc,Ec,og,Mc,lm,cm,dm,Wr=class extends T{constructor(){super(...arguments);p(this,U);this.overflow="wrap";this.align="start";this.label="";this._items=[];this._size="medium";p(this,Qt,[]);p(this,Ui);p(this,St);p(this,bt,0);p(this,ei,new Set);p(this,Vi,!1);p(this,Mc,e=>{e.stopPropagation();let t=r(this,Qt)[Number(e.detail.value)];if(!t)return;g(this,Vi,!0),(t.shadowRoot?.querySelector('[part="control"]')??t).click(),requestAnimationFrame(()=>requestAnimationFrame(()=>s(this,U,lm).call(this)))})}get overflowing(){return[...r(this,Qt)]}connectedCallback(){super.connectedCallback(),g(this,Ui,new MutationObserver(e=>s(this,U,ng).call(this,e))),r(this,Ui).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Yv}),typeof ResizeObserver<"u"&&(g(this,St,new ResizeObserver(()=>s(this,U,Kr).call(this))),r(this,St).observe(this),g(this,ei,new Set([this]))),document.fonts?.ready.then(()=>s(this,U,Kr).call(this)),s(this,U,Kr).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Ui)?.disconnect(),r(this,St)?.disconnect(),r(this,ei).clear(),cancelAnimationFrame(r(this,bt)),g(this,bt,0),s(this,U,om).call(this,s(this,U,Vn).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&s(this,U,Kr).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,bt)),g(this,bt,0),s(this,U,Ec).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
|
|
197
197
|
<slot></slot>
|
|
198
198
|
<cm-action-menu class="more ${this._size}${e?" icon":""}" part="more" hidden align="end"
|
|
199
199
|
.items=${this._items} label=${this.moreLabel} ?icon-only=${e} icon=${this.moreIcon||"more"}
|
|
@@ -255,7 +255,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
255
255
|
[role='option']:not([aria-disabled='true']):not([aria-selected='true']):active { background: color-mix(in srgb, var(--cm-bg-hover), var(--cm-text-default) 8%); }
|
|
256
256
|
:host([size='small']) [role='option'] { min-height: var(--cm-control-height-sm, 32px); }
|
|
257
257
|
@media (pointer: coarse) { [role='option'], :host([size='small']) [role='option'] { min-height: var(--cm-control-height-touch, 44px); } }
|
|
258
|
-
`;var
|
|
258
|
+
`;var Qx=z("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."}),$e,Lt,Wn,oe,Kn,Cc,mg,hm,pg,mm,ri=class extends T{constructor(){super(...arguments);p(this,oe);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";p(this,$e,this.attachInternals());p(this,Lt,A("cm-tf"));p(this,Wn,"")}connectedCallback(){super.connectedCallback(),g(this,Wn,this.value)}get form(){return r(this,$e).form}get validity(){return r(this,$e).validity}get validationMessage(){return r(this,$e).validationMessage}checkValidity(){return s(this,oe,Kn).call(this),r(this,$e).checkValidity()}reportValidity(){return s(this,oe,Kn).call(this),r(this,$e).reportValidity()}formResetCallback(){this.value=r(this,Wn),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){r(this,$e).setFormValue(this.value),s(this,oe,Kn).call(this)}render(){let e=[this.error&&`${r(this,Lt)}-err`,this.helpText&&`${r(this,Lt)}-help`].filter(Boolean).join(" ")||h,t={id:r(this,Lt),invalid:this.error?"true":h},i=this.multiline?c`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
|
|
259
259
|
.value=${ne(this.value)} placeholder=${this.placeholder||h}
|
|
260
260
|
?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
|
|
261
261
|
aria-invalid=${t.invalid} aria-describedby=${e}
|
|
@@ -286,7 +286,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
286
286
|
.input:read-only, .input:disabled { background: var(--cm-bg-input-filled); }
|
|
287
287
|
.input:disabled { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
|
|
288
288
|
:host([error]:not([error=''])) .input { border-color: var(--cm-border-critical); }
|
|
289
|
-
`];$("cm-text-field",ri);var
|
|
289
|
+
`];$("cm-text-field",ri);var sw=z("checkbox",{required:"Please tick this box."}),si,Ki,Gn,Sc,ug,ai=class extends T{constructor(){super(...arguments);p(this,Sc);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;p(this,si,this.attachInternals());p(this,Ki,A("cm-cb"));p(this,Gn,!1)}connectedCallback(){super.connectedCallback(),g(this,Gn,this.checked)}get form(){return r(this,si).form}checkValidity(){return r(this,si).checkValidity()}formResetCallback(){this.checked=r(this,Gn)}formDisabledCallback(e){this.disabled=e}updated(){r(this,si).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,si).setValidity({valueMissing:!0},this.t("required")):r(this,si).setValidity({})}render(){let e=this.indeterminate?c`<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>`:c`<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 c`<label for=${r(this,Ki)}>
|
|
290
290
|
<input type="checkbox" id=${r(this,Ki)} .checked=${this.checked} .indeterminate=${this.indeterminate}
|
|
291
291
|
?disabled=${this.disabled} ?required=${this.required}
|
|
292
292
|
aria-describedby=${this.description?`${r(this,Ki)}-d`:h} @change=${s(this,Sc,ug)} />
|
|
@@ -342,7 +342,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
342
342
|
:host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
343
343
|
:host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-subtle); }
|
|
344
344
|
:host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
|
|
345
|
-
`];$("cm-radio",Gi);var
|
|
345
|
+
`];$("cm-radio",Gi);var hw=z("radioGroup",{required:"Please select one of these options."}),Ye,Dt,Xn,Jn,Zn,Xr,se,pm,Dc,Wi,um,Jr,gm,Ac,Rc,Lc,Yi=class extends T{constructor(){super();p(this,se);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;p(this,Ye,this.attachInternals());p(this,Dt,A("cm-rg"));p(this,Xn,"");p(this,Jn,!0);p(this,Zn,!1);p(this,Xr,!1);p(this,Dc,()=>{s(this,se,pm).call(this),r(this,Jr).call(this)});p(this,Jr,()=>{let e=s(this,se,Wi).call(this),t=!1;for(let a of e)a.checked=!!this.value&&a.value===this.value&&!t,a.checked&&(t=!0),a.groupDisabled=this.disabled;let i=e.find(a=>a.checked&&!a.disabled)??s(this,se,um).call(this)[0];for(let a of e)a._tabbable=a===i&&!this.disabled});p(this,Ac,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||s(this,se,gm).call(this,t,!0)});p(this,Rc,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=s(this,se,um).call(this),a=i.indexOf(t),l=J(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(a+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(a-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&s(this,se,gm).call(this,d,!0)});this.addEventListener("keydown",r(this,Rc)),this.addEventListener("click",r(this,Ac))}connectedCallback(){super.connectedCallback(),s(this,se,pm).call(this)}get form(){return r(this,Ye).form}get validity(){return r(this,Ye).validity}get validationMessage(){return r(this,Ye).validationMessage}checkValidity(){return r(this,Ye).checkValidity()}reportValidity(){return r(this,Ye).reportValidity()}formResetCallback(){this.value=r(this,Xn)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(s(this,se,Wi).call(this).find(t=>t._tabbable)??s(this,se,Wi).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,Zn)&&!r(this,Xr)&&g(this,Jn,!1),g(this,Zn,!0),r(this,Jr).call(this),r(this,Ye).setFormValue(this.value||null,this.value);let t=s(this,se,Wi).call(this)[0];this.error?r(this,Ye).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,Ye).setValidity({valueMissing:!0},this.t("required"),t):r(this,Ye).setValidity({})}render(){let e=[this.error&&`${r(this,Dt)}-err`,this.helpText&&`${r(this,Dt)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
|
|
346
346
|
aria-labelledby=${s(this,se,Lc).call(this)?`${r(this,Dt)}-l`:h} aria-label=${s(this,se,Lc).call(this)?h:this.getAttribute("aria-label")??h}
|
|
347
347
|
aria-describedby=${e||h}
|
|
348
348
|
aria-required=${this.required?"true":h} aria-invalid=${this.error?"true":h}
|
|
@@ -436,7 +436,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
436
436
|
}
|
|
437
437
|
`;function Oc(o,n,e,t){return c`<div role="presentation" class="gh" id=${o}><span>${n}</span>${e!==void 0?c`<span class="count" aria-hidden="true">${e}</span><span class="vh">, ${t}</span>`:h}</div>`}function qc(o,n=h){return c`${o.icon?c`<cm-icon name=${o.icon} size="16"></cm-icon>`:h}<span class="text"><span class="title">${o.title}</span>${o.description?c`<span class="vh">, </span><span class="desc">${o.description}</span>`:h}</span>${n}`}function Bc(o,n){let e=`${o.cls??""}${o.active?" active":""}`;return o.href?c`<a role="option" id=${o.id} class=${e} href=${o.href} tabindex="-1" aria-selected=${o.active?"true":"false"}
|
|
438
438
|
aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</a>`:c`<div role="option" id=${o.id} class=${e} tabindex="-1" aria-selected=${o.active?"true":"false"}
|
|
439
|
-
aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</div>`}function Fc(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var
|
|
439
|
+
aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</div>`}function Fc(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var Mw=z("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),Xe,ue,ia,lt,ra,to,B,bm,fm,eo,ta,Ji,li,jc,Uc,io,Vc,bg,Kc,ci=class extends T{constructor(){super(...arguments);p(this,B);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.size="default";this.loading=!1;this._active=-1;this._slotted=[];p(this,Xe,this.attachInternals());p(this,ue,A("cm-sel"));p(this,ia,"");p(this,lt,"");p(this,ra,0);p(this,to,new MutationObserver(()=>s(this,B,bm).call(this)));p(this,Uc,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),s(this,B,eo).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),s(this,B,eo).call(this),s(this,B,li).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=s(this,B,jc).call(this,t);s(this,B,eo).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?s(this,B,Ji).call(this,this._active):s(this,B,li).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?s(this,B,Ji).call(this,this._active):s(this,B,li).call(this,-1);break;case"Home":e.preventDefault(),s(this,B,li).call(this,"first");break;case"End":e.preventDefault(),s(this,B,li).call(this,"last");break;case"PageDown":e.preventDefault(),s(this,B,li).call(this,10);break;case"PageUp":e.preventDefault(),s(this,B,li).call(this,-10);break;case"Enter":e.preventDefault(),s(this,B,Ji).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),s(this,B,ta).call(this);break;case"Tab":s(this,B,Ji).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,lt)&&Date.now()-r(this,ra)<500){let i=s(this,B,jc).call(this," ");i>=0&&(this._active=i)}else s(this,B,Ji).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=s(this,B,jc).call(this,t);i>=0&&(this._active=i)}}});p(this,io,e=>{this.open&&!e.composedPath().includes(this)&&s(this,B,ta).call(this)});p(this,Vc,()=>{this.disabled||(this.open?s(this,B,ta).call(this):s(this,B,eo).call(this))});p(this,Kc,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),s(this,B,bm).call(this),r(this,to).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,io),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,to).disconnect(),document.removeEventListener("pointerdown",r(this,io),!0)}get form(){return r(this,Xe).form}get validity(){return r(this,Xe).validity}get validationMessage(){return r(this,Xe).validationMessage}checkValidity(){return r(this,Xe).checkValidity()}reportValidity(){return r(this,Xe).reportValidity()}formResetCallback(){this.value=r(this,ia),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?ea(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):ea(this._slotted)}firstUpdated(){r(this,ia)||g(this,ia,this.value)}updated(e){r(this,Xe).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,Xe).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,Xe).setValidity({valueMissing:!0},this.t("required"),t):r(this,Xe).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(d=>d.value===this.value),i=[this.error&&`${r(this,ue)}-err`,this.helpText&&`${r(this,ue)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),l=(d,m)=>c`<li role="option" id="${r(this,ue)}-o${m}" class=${m===this._active?"active":""}
|
|
440
440
|
aria-selected=${d.value===this.value?"true":"false"} aria-disabled=${d.disabled?"true":h}
|
|
441
441
|
@pointerenter=${()=>!d.disabled&&(this._active=m)} @click=${()=>s(this,B,Ji).call(this,m)}>${d.label}</li>`;return c`<div class="field">
|
|
442
442
|
${this.label?c`<span class="label" id="${r(this,ue)}-l" part="label" @click=${r(this,Kc)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
|
|
@@ -495,7 +495,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
495
495
|
[role='group'] { display: block; }
|
|
496
496
|
slot { display: none; }
|
|
497
497
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
498
|
-
`];$("cm-select",ci);var
|
|
498
|
+
`];$("cm-select",ci);var Aw=z("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),sa,Wc,ro,Te,aa,fg,vg,vm,di=class extends T{constructor(){super(...arguments);p(this,Te);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;p(this,sa,this.attachInternals());p(this,Wc,A("cm-search"));p(this,ro,"")}connectedCallback(){super.connectedCallback(),g(this,ro,this.value)}get form(){return r(this,sa).form}checkValidity(){return r(this,sa).checkValidity()}formResetCallback(){this.value=r(this,ro)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,sa).setFormValue(this.value)}render(){return c`<div class="box" part="box">
|
|
499
499
|
<cm-icon class="icon" name="search" size="16"></cm-icon>
|
|
500
500
|
<input id=${r(this,Wc)} part="input" type="search" enterkeyhint="search" autocomplete="off"
|
|
501
501
|
aria-label=${this.label} .value=${ne(this.value)} placeholder=${this.placeholder||h} ?disabled=${this.disabled}
|
|
@@ -538,7 +538,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
538
538
|
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
539
539
|
:host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
540
540
|
:host([disabled]) button { cursor: not-allowed; }
|
|
541
|
-
`];$("cm-search",di);var
|
|
541
|
+
`];$("cm-search",di);var Ow=z("tag",{remove:"Remove {label}"}),Gc,yg,Zi=class extends T{constructor(){super(...arguments);p(this,Gc);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${s(this,Gc,yg)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};Gc=new WeakSet,yg=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Zi.shadowRootOptions={...S.shadowRootOptions,delegatesFocus:!0},Zi.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Zi.styles=[k,x`
|
|
542
542
|
:host { display: inline-flex; vertical-align: middle; max-width: 100%; }
|
|
543
543
|
.tag {
|
|
544
544
|
display: inline-flex; align-items: center; gap: var(--cm-space-4); min-width: 0; height: 24px; padding: 0 var(--cm-space-8);
|
|
@@ -556,7 +556,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
556
556
|
button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
557
557
|
:host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); }
|
|
558
558
|
:host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); background: none; }
|
|
559
|
-
`];$("cm-tag",Zi);var
|
|
559
|
+
`];$("cm-tag",Zi);var Gw=z("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.",grouped:"{group}: {label}",more:"+{count} more"}),Ae,ge,oo,la,lo,co,ho,L,ym,xg,ao,Yc,so,na,oa,At,wg,no,xm,wm,Qi,Xc,Jc,er,$g,Zc,Qc,ed,kg,Eg,hi=class extends T{constructor(){super(...arguments);p(this,L);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.size="default";this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.maxTags=3;this._query="";this._focusIn=!1;this._active=-1;this._slotted=[];this._typing=!1;p(this,Ae,this.attachInternals());p(this,ge,A("cm-cb"));p(this,oo,null);p(this,la,new Map);p(this,lo,new Map);p(this,co,new MutationObserver(()=>s(this,L,ym).call(this)));p(this,ho);p(this,Xc,()=>{this._focusIn=!0});p(this,Jc,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});p(this,Zc,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,s(this,L,oa).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});p(this,Qc,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?s(this,L,no).call(this,1):(s(this,L,oa).call(this),e.altKey||s(this,L,no).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?s(this,L,no).call(this,-1):(s(this,L,oa).call(this),s(this,L,no).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),s(this,L,xm).call(this,this._active)):r(this,L,Yc)&&(e.preventDefault(),s(this,L,wm).call(this,r(this,L,Yc)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),s(this,L,At).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",s(this,L,na).call(this)));break;case"ArrowLeft":case"ArrowRight":{let i=e.target;this.multiple&&this.values.length&&J(e,this)==="ArrowLeft"&&i.selectionStart===0&&i.selectionEnd===0&&(e.preventDefault(),s(this,L,At).call(this),s(this,L,er).call(this,this.values.length-1));break}case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":s(this,L,At).call(this);break;default:}});p(this,ed,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(s(this,L,At).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?s(this,L,ao).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),s(this,L,ym).call(this),r(this,co).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,ho,Nc(this,()=>this.open,()=>s(this,L,At).call(this))),this.addEventListener("focusin",r(this,Xc)),this.addEventListener("focusout",r(this,Jc))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,co).disconnect(),(e=r(this,ho))==null||e.call(this)}get form(){return r(this,Ae).form}get validity(){return r(this,Ae).validity}get validationMessage(){return r(this,Ae).validationMessage}checkValidity(){return r(this,Ae).checkValidity()}reportValidity(){return r(this,Ae).reportValidity()}formResetCallback(){let e=r(this,oo)??{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(`
|
|
560
560
|
`):[]:this.value=e)}get items(){return this.options?.length?ea(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):ea(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(){g(this,oo,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,la).set(t.value,t.label),t.group&&r(this,lo).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?s(this,L,ao).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=s(this,L,so).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 a=new FormData;for(let l of this.values)a.append(this.name,l);r(this,Ae).setFormValue(a,this.values.join(`
|
|
561
561
|
`))}else r(this,Ae).setFormValue(null);else r(this,Ae).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?r(this,Ae).setValidity({customError:!0},this.error,t):this.required&&i?r(this,Ae).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):r(this,Ae).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,ge)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),s(this,L,na).call(this))}focus(e){this.renderRoot.querySelector("input")?.focus(e)}render(){let e=s(this,L,so).call(this),t=[this.error&&`${r(this,ge)}-err`,this.helpText&&`${r(this,ge)}-help`].filter(Boolean).join(" "),i=this.getAttribute("aria-label"),a=m=>this.multiple?this.values.includes(m):m===this.value,l=(m,u)=>c`<li role="option" id="${r(this,ge)}-o${u}" class=${u===this._active?"active":""}
|
|
562
562
|
aria-selected=${m.create?"false":a(m.value)?"true":"false"} aria-disabled=${m.disabled?"true":h}
|
|
@@ -637,7 +637,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
637
637
|
.create { font-style: normal; }
|
|
638
638
|
slot { display: none; }
|
|
639
639
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
640
|
-
`];$("cm-combobox",hi);function mo(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var Zv={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function td(o,n){let e=o.trim().toLowerCase().split("+").map(a=>a.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:Zv[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let a of e)if(a==="mod")n?i.meta=!0:i.ctrl=!0;else if(a==="ctrl"||a==="control")i.ctrl=!0;else if(a==="meta"||a==="cmd"||a==="command")i.meta=!0;else if(a==="alt"||a==="option"||a==="opt")i.alt=!0;else if(a==="shift")i.shift=!0;else return null;return i}function $m(o,n=mo()){let e=td(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function km(o,n,e=mo()){let t=td(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function id(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var Qv={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},ey={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},ty={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},iy=o=>ty[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function rd(o,n=mo()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=td(t,n);if(!i)return[o.trim()];let a=n?Qv:ey,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(a[d]);e.push(iy(i.key))}return e}function Mg(o,n=mo()){if(/\s/.test(o.trim()))return"";let e=td(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,a,l)=>a?`${a[0].toUpperCase()}${a.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var
|
|
640
|
+
`];$("cm-combobox",hi);function mo(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var Zv={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function td(o,n){let e=o.trim().toLowerCase().split("+").map(a=>a.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:Zv[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let a of e)if(a==="mod")n?i.meta=!0:i.ctrl=!0;else if(a==="ctrl"||a==="control")i.ctrl=!0;else if(a==="meta"||a==="cmd"||a==="command")i.meta=!0;else if(a==="alt"||a==="option"||a==="opt")i.alt=!0;else if(a==="shift")i.shift=!0;else return null;return i}function $m(o,n=mo()){let e=td(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function km(o,n,e=mo()){let t=td(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function id(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var Qv={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},ey={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},ty={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},iy=o=>ty[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function rd(o,n=mo()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=td(t,n);if(!i)return[o.trim()];let a=n?Qv:ey,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(a[d]);e.push(iy(i.key))}return e}function Mg(o,n=mo()){if(/\s/.test(o.trim()))return"";let e=td(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,a,l)=>a?`${a[0].toUpperCase()}${a.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var a0=z("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),Je,po,X,ad,sd,ca,Em,nd,Tg,od,uo,Mm,zg,tr=class extends T{constructor(){super(...arguments);p(this,X);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;p(this,Je,A("cm-gs"));p(this,po);p(this,nd,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),s(this,X,Em).call(this)});p(this,od,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),s(this,X,Tg).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,X,sd)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,Je)}-o${this._active}`)?.click());break;case"Escape":r(this,X,sd)?(e.preventDefault(),e.stopPropagation(),s(this,X,ca).call(this)):this.value&&(e.preventDefault(),s(this,X,Mm).call(this,!1));break;case"Tab":s(this,X,ca).call(this);break;default:}});p(this,uo,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||id(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,po,Nc(this,()=>this.open,()=>s(this,X,ca).call(this))),document.addEventListener("keydown",r(this,uo))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=r(this,po))==null||e.call(this),document.removeEventListener("keydown",r(this,uo))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=s(this,X,ad).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,Je)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=s(this,X,ad).call(this),t=r(this,X,sd),i=e.filter(u=>u.item).length,a=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(u=>u?.items?.length),m=(u,v,b="")=>{let w=++l;return Bc({id:`${r(this,Je)}-o${w}`,active:w===this._active,href:u.href,cls:b,onHover:()=>this._active=w,onChoose:y=>s(this,X,zg).call(this,y,u)},v)};return c`<div class="wrap">
|
|
641
641
|
<div class="box" part="box" @click=${u=>{u.target===u.currentTarget&&this.focus()}}>
|
|
642
642
|
<cm-icon class="icon" name="search" size="16"></cm-icon>
|
|
643
643
|
|
|
@@ -731,7 +731,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
731
731
|
|
|
732
732
|
}
|
|
733
733
|
@keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
|
|
734
|
-
`];var
|
|
734
|
+
`];var y0=z("commandPalette",{label:"Command palette",placeholder:"Search or run a command",recent:"Recent",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all"}),Cg=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function Sg(o,n){let e=Cg(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=Cg([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var fo,ve,Cm,Sm,bo,ud,gd,Lg,Dg,pa=class extends ee{constructor(){super();p(this,ve);this.value="";this.results=[];this.actions=[];this.recent=[];this.loading=!1;this.shortcut="";this._active=-1;p(this,fo,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!km(e,this.shortcut)||!this.open&&!$m(this.shortcut)&&id(e)||this.open&&!$m(this.shortcut)||(e.preventDefault(),this.toggle())});p(this,ud,e=>{this.value=e.target.value,this._active=s(this,ve,bo).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});p(this,gd,e=>{let t=s(this,ve,bo).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Fc(this._active,e.key==="ArrowDown"?1:-1,t);break;case"Home":case"End":if(e.shiftKey||!t)break;e.preventDefault(),this._active=e.key==="Home"?0:t-1;break;case"Enter":if(e.isComposing||this._active<0)break;e.preventDefault(),this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.click();break;default:}});this.label=void 0}toggle(){this.open?this.requestClose("method"):this.show()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",r(this,fo))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,fo))}willUpdate(e){if(super.willUpdate?.(e),e.has("open")&&!this.open&&e.get("open")&&(this.value="",this._active=-1),["results","actions","recent","loading","value","open"].some(t=>e.has(t))){let t=s(this,ve,bo).call(this).length;(this._active>=t||this._active<0)&&(this._active=t?0:-1)}}updated(e){super.updated(e),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.scrollIntoView({block:"nearest"})}focusFirst(){let e=this.renderRoot.querySelector("input");e?.focus(),e?.select()}render(){let e=this.open?s(this,ve,Sm).call(this):[],t=s(this,ve,bo).call(this,e),i=r(this,ve,Cm),a=t.filter(u=>u.item).length,l=!this.open||!i?"":this.loading?this.loadingText:t.length?this.t("results",{count:a}):this.emptyText,d=this.uid,m=-1;return this.renderDialog(c`<div class="panel" part="panel">
|
|
735
735
|
<div class="top">
|
|
736
736
|
<div class="box" part="box">
|
|
737
737
|
<cm-icon name="search" size="16"></cm-icon>
|
|
@@ -874,7 +874,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
874
874
|
.wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); }
|
|
875
875
|
.wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
|
|
876
876
|
.wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--_cm-field-pad); }
|
|
877
|
-
`;var
|
|
877
|
+
`;var L0=z("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."}}),$a,he,et,ka,Ot,bi,Re,qe,Ea,Ma,E,xo,pi,Ta,Ed,rr,ya,Nt,ui,It,Pt,Md,Am,Rm,xa,ar,Hm,Nm,Ig,Td,Pg,Im,wa,wo,$o,Pm,Og,zd,Om,qm,_d,Cd,Sd,Ld,Dd,ko,gi=class extends T{constructor(){super(...arguments);p(this,E);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";p(this,$a,"");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;p(this,he,this.attachInternals());p(this,et,A("cm-dp"));p(this,ka,null);p(this,Ot,!1);p(this,bi,!1);p(this,Re,"");p(this,qe,"");p(this,Ea,!1);p(this,Ma,"");p(this,Ta,!1);p(this,zd,e=>{e.key==="Enter"?s(this,E,Pm).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),s(this,E,Og).call(this,e.key==="ArrowUp"?1:-1))});p(this,_d,()=>{this.disabled||(this.open?this.open=!1:(s(this,E,$o).call(this),this.show()))});p(this,Cd,e=>{e.key==="Enter"?s(this,E,$o).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),s(this,E,$o).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});p(this,Sd,e=>{let t=yd(J(e,this),e,this._focus,r(this,E,Am));if(t){e.preventDefault(),this._focus=mi(t,r(this,E,It),r(this,E,Pt)),g(this,bi,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),s(this,E,Om).call(this,this._focus))});p(this,Ld,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,s(this,E,qm).call(this);return}$d(e,e.currentTarget)});p(this,Dd,e=>{this._focus=mi(Ze(this._focus,e),r(this,E,It),r(this,E,Pt))});p(this,ko,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,$a)}set locale(e){let t=r(this,$a);g(this,$a,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,ka)===null&&g(this,ka,this.value),document.addEventListener("pointerdown",r(this,ko),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,ko),!0)}get form(){return r(this,he).form}get validity(){return r(this,he).validity}get validationMessage(){return r(this,he).validationMessage}get valueAsDate(){return this.time?this.value?vt(this.value):null:N(this.value)}checkValidity(){return s(this,E,Td).call(this),r(this,he).checkValidity()}reportValidity(){return s(this,E,Td).call(this),r(this,he).reportValidity()}formResetCallback(){this.value=r(this,ka)??"",this.time&&(s(this,E,Nm).call(this,this.value),g(this,E,s(this,E,ar).call(this,r(this,qe)),pi)),this._text=s(this,E,xa).call(this,r(this,E,Nt)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(s(this,E,Ig).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=N(e);if(!t)return!0;let i=r(this,E,It),a=r(this,E,Pt);return i&&t<i||a&&t>a?!0:yo(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Ta)?(s(this,E,Nm).call(this,this.value),r(this,Ea)||g(this,E,s(this,E,ar).call(this,r(this,qe)),pi)):this.time&&(e.has("locale")||e.has("hourCycle"))&&r(this,qe)&&g(this,E,s(this,E,ar).call(this,r(this,qe)),pi),(e.has("value")||e.has("time"))&&!r(this,Ot)?this._text=s(this,E,xa).call(this,r(this,E,Nt)):e.has("locale")&&N(r(this,E,Nt))&&(this._text=s(this,E,xa).call(this,r(this,E,Nt))),g(this,Ot,!1),g(this,Ea,!1),g(this,Ta,!1)}updated(e){r(this,he).setFormValue(this.value||null,this.time?this.value:this._text),s(this,E,Td).call(this),this.open&&r(this,bi)&&(g(this,bi,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,bi,!1)}render(){let e=r(this,E,rr),t=N(r(this,E,Nt)),i=[this.error&&`${r(this,et)}-err`,this.helpText&&`${r(this,et)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),l=this.label||a||"",d=Ht(this._focus);return c`<div class="field">
|
|
878
878
|
${this.label?c`<label class="label" for="${r(this,et)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
|
|
879
879
|
<div class="wrap ${this.time?"timed":""}">
|
|
880
880
|
<div class="box" part="box">
|
|
@@ -906,7 +906,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
906
906
|
</div>
|
|
907
907
|
${this.error?c`<p class="error" id="${r(this,et)}-err" role="alert">${this.error}</p>`:h}
|
|
908
908
|
${this.helpText?c`<p class="help" id="${r(this,et)}-help">${this.helpText}</p>`:h}
|
|
909
|
-
</div>`}};$a=new WeakMap,he=new WeakMap,et=new WeakMap,ka=new WeakMap,Ot=new WeakMap,bi=new WeakMap,Re=new WeakMap,qe=new WeakMap,Ea=new WeakMap,Ma=new WeakMap,E=new WeakSet,xo=function(){return r(this,Ma)},pi=function(e){e!==r(this,Ma)&&(g(this,Ma,e),this.requestUpdate())},Ta=new WeakMap,Ed=function(){return ba(this,this.locale)},rr=function(){return va(r(this,E,Ed))},ya=function(){return bd(r(this,E,Ed),this.hourCycle)},Nt=function(){return this.time?r(this,Re):this.value},ui=function(e){return this.time&&e.trim().toLowerCase()==="now"?Hg():e},It=function(){return N(Qe(s(this,E,ui).call(this,this.min)).date||this.min)},Pt=function(){return N(Qe(s(this,E,ui).call(this,this.max)).date||this.max)},Md=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Am=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?fa(r(this,E,Ed)):(Math.trunc(e)%7+7)%7},Rm=function(){return fd(r(this,E,rr),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},xa=function(e){let t=N(e);return t?r(this,E,rr).short(t):e},ar=function(e){let t=ir(e);return t===null?"":r(this,E,ya).format(t)},Hm=function(){return Ng(r(this,E,ya),{h:this.t("patternHour"),m:this.t("patternMinute")})},Nm=function(e){let{date:t,time:i}=Qe(e);g(this,Re,t),g(this,qe,t?i:"")},Ig=function(){let e=new Date,t=N(r(this,E,Nt))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=mi(t,r(this,E,It),r(this,E,Pt)),g(this,bi,!0)},Td=function(){let e=this.renderRoot.querySelector("input")??void 0,t=N(r(this,E,Nt)),i=r(this,E,rr);this.error?r(this,he).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,he).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,E,Rm)}),e):this.time?s(this,E,Pg).call(this,t,e):this.required&&!t?r(this,he).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,E,It)&&t<r(this,E,It)?r(this,he).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,E,It))}),e):t&&r(this,E,Pt)&&t>r(this,E,Pt)?r(this,he).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,E,Pt))}),e):t&&this.isUnavailable(this.value)?r(this,he).setValidity({customError:!0},this.t("unavailable"),e):r(this,he).setValidity({})},Pg=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,a=(b,w,y,M=t)=>r(this,he).setValidity(b,this.t(w,y),M),l=ir(r(this,qe));if(r(this,E,xo).trim()&&l===null)return a({badInput:!0},"badTime",{pattern:r(this,E,Hm)},i);if(!e&&l===null)return this.required?a({valueMissing:!0},"required"):r(this,he).setValidity({});if(!e)return a({badInput:!0},"required");if(l===null)return a({badInput:!0},"timeMissing",void 0,i);let d=vt(`${r(this,Re)}T${r(this,qe)}`),m=vt(s(this,E,ui).call(this,this.min)),u=vt(s(this,E,ui).call(this,this.max),!0),v=(b,w)=>Qe(b).time?r(this,E,ya).dateTime(w):r(this,E,rr).medium(w);if(m&&d<m)return a({rangeUnderflow:!0},"rangeUnderflow",{date:v(s(this,E,ui).call(this,this.min),m)},i);if(u&&d>u)return a({rangeOverflow:!0},"rangeOverflow",{date:v(s(this,E,ui).call(this,this.max),u)},i);if(l%r(this,E,Md))return a({stepMismatch:!0},"stepMismatch",{count:r(this,E,Md)},i);if(this.isUnavailable(r(this,Re)))return a({customError:!0},"unavailable");r(this,he).setValidity({})},Im=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})))},wa=function(e,t){g(this,Re,e),g(this,qe,t);let i=e&&t?`${e}T${t}`:"";g(this,Ta,!0),this.requestUpdate(),s(this,E,Im).call(this,i)},wo=function(e){this.time?s(this,E,wa).call(this,e,r(this,qe)):s(this,E,Im).call(this,e)},$o=function(){let e=this._text.trim();if(!e){s(this,E,wo).call(this,"");return}let t=vd(e,r(this,E,rr));t?(s(this,E,wo).call(this,t),this._text=s(this,E,xa).call(this,t)):(g(this,Ot,!0),s(this,E,wo).call(this,""))},Pm=function(){let e=r(this,E,xo).trim(),t=e?Dm(e,r(this,E,ya)):"";if(g(this,Ot,!0),t===null){g(this,Ea,!0),s(this,E,wa).call(this,r(this,Re),"");return}s(this,E,wa).call(this,r(this,Re),t),g(this,E,s(this,E,ar).call(this,t),pi)},Og=function(e){let t=r(this,E,Md),i=Dm(r(this,E,xo),r(this,E,ya));if(!i){let m=Qe(s(this,E,ui).call(this,this.min)),u=new Date;if(i=m.time&&(!r(this,Re)||r(this,Re)===m.date)?m.time:vo(u.getHours()*60+u.getMinutes()),ir(i)%t===0){g(this,Ot,!0),s(this,E,wa).call(this,r(this,Re),i),g(this,E,s(this,E,ar).call(this,i),pi);return}e=1}let a=ir(i),l=e>0?(Math.floor(a/t)+1)*t:(Math.ceil(a/t)-1)*t,d=vo(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,Ot,!0),s(this,E,wa).call(this,r(this,Re),d),g(this,E,s(this,E,ar).call(this,d),pi)},zd=new WeakMap,Om=function(e){let t=P(e);this.isUnavailable(t)||(this.open=!1,s(this,E,wo).call(this,t),this._text=s(this,E,xa).call(this,t),this.time&&!r(this,qe)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):s(this,E,qm).call(this))},qm=function(){this.renderRoot.querySelector(".trigger")?.focus()},_d=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Ld=new WeakMap,Dd=new WeakMap,ko=new WeakMap,gi.formAssociated=!0,gi.shadowRootOptions={...S.shadowRootOptions,delegatesFocus:!0},gi.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:ga},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}},gi.styles=[k,kd,wd,x`.pop { min-width: 0; }`];$("cm-date-picker",gi);var B0=z("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"}),sy={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[G(o,-1),G(o,-1)]],"last-7-days":["Last 7 days",o=>[G(o,-6),o]],"last-30-days":["Last 30 days",o=>[G(o,-29),o]],"last-90-days":["Last 90 days",o=>[G(o,-89),o]],"this-month":["This month",o=>[Ht(o),o]],"last-month":["Last month",o=>[Ht(Ze(o,-1)),ua(Ze(o,-1))]]},ny=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function qg(o,n=new Date,e){if(typeof o=="object"&&o)return o;let t=sy[o];if(!t)return null;let i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[a,l]=t[1](i);return{label:e?.(ny(o))||t[0],start:P(a),end:P(l)}}var Ca,be,Be,Sa,La,vi,I,Bm,za,Fm,Bt,Ad,qt,Bg,Rd,_a,jm,Fg,Hd,Nd,Id,Pd,Od,Eo,Um,fi=class extends T{constructor(){super(...arguments);p(this,I);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";p(this,Ca,"");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;p(this,be,this.attachInternals());p(this,Be,A("cm-drp"));p(this,Sa,null);p(this,La,!1);p(this,vi,!1);p(this,Bt,"start");p(this,Nd,()=>{this.disabled||(this.open?this.open=!1:(s(this,I,_a).call(this,"start"),s(this,I,_a).call(this,"end"),this.show()))});p(this,Id,e=>t=>{t.key==="Enter"?s(this,I,_a).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),s(this,I,_a).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});p(this,Pd,e=>{let t=yd(J(e,this),e,this._focus,r(this,I,Fm));if(t){e.preventDefault(),this._focus=mi(t,N(this.min),N(this.max)),g(this,vi,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),s(this,I,jm).call(this,this._focus))});p(this,Od,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,s(this,I,Hd).call(this);return}$d(e,e.currentTarget)});p(this,Eo,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Ca)}set locale(e){let t=r(this,Ca);g(this,Ca,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Sa)||g(this,Sa,[this.start,this.end]),document.addEventListener("pointerdown",r(this,Eo),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,Eo),!0)}get form(){return r(this,be).form}get validity(){return r(this,be).validity}get validationMessage(){return r(this,be).validationMessage}checkValidity(){return r(this,be).checkValidity()}reportValidity(){return r(this,be).reportValidity()}formResetCallback(){[this.start,this.end]=r(this,Sa)??["",""],this._startText=s(this,I,qt).call(this,this.start),this._endText=s(this,I,qt).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=N(this.start)?this.start:"",this._draftEnd=N(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=mi(N(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),N(this.min),N(this.max)),g(this,Bt,"start"),g(this,vi,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=N(e);if(!t)return!0;let i=N(this.min),a=N(this.max);return i&&t<i||a&&t>a?!0:yo(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){r(this,La)||(e.has("start")&&(this._startText=s(this,I,qt).call(this,this.start)),e.has("end")&&(this._endText=s(this,I,qt).call(this,this.end))),g(this,La,!1),e.has("locale")&&(N(this.start)&&(this._startText=s(this,I,qt).call(this,this.start)),N(this.end)&&(this._endText=s(this,I,qt).call(this,this.end)))}updated(){let e=N(this.start),t=N(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),r(this,be).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let a=this.renderRoot.querySelectorAll("input"),[l,d]=[a[0]??void 0,a[1]??void 0],m=r(this,I,za),u=N(this.min),v=N(this.max);this.error?r(this,be).setValidity({customError:!0},this.error,l):this._startText.trim()&&!e?r(this,be).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,I,Ad)}),l):this._endText.trim()&&!t?r(this,be).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,I,Ad)}),d):this.required&&(!e||!t)?r(this,be).setValidity({valueMissing:!0},this.t("required"),e?d:l):e&&t&&t<e?r(this,be).setValidity({badInput:!0},this.t("endBeforeStart"),d):e&&u&&e<u||t&&u&&t<u?r(this,be).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:m.medium(u)}),l):e&&v&&e>v||t&&v&&t>v?r(this,be).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:m.medium(v)}),d):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,be).setValidity({customError:!0},this.t("unavailable"),l):r(this,be).setValidity({}),this.open&&r(this,vi)&&(g(this,vi,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,I,za),t=N(this.start),i=N(this.end),a=[this.error&&`${r(this,Be)}-err`,this.helpText&&`${r(this,Be)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",m=yo(this.presets).map(b=>qg(b,new Date,w=>this.t(w))).filter(b=>!!b),u=r(this,Bt)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(N(this._draftStart))}):this.t("chooseStart"),v=b=>{let w=b==="start"?this._startText:this._endText;return c`<input id="${r(this,Be)}-${b}" type="text" autocomplete="off" spellcheck="false"
|
|
909
|
+
</div>`}};$a=new WeakMap,he=new WeakMap,et=new WeakMap,ka=new WeakMap,Ot=new WeakMap,bi=new WeakMap,Re=new WeakMap,qe=new WeakMap,Ea=new WeakMap,Ma=new WeakMap,E=new WeakSet,xo=function(){return r(this,Ma)},pi=function(e){e!==r(this,Ma)&&(g(this,Ma,e),this.requestUpdate())},Ta=new WeakMap,Ed=function(){return ba(this,this.locale)},rr=function(){return va(r(this,E,Ed))},ya=function(){return bd(r(this,E,Ed),this.hourCycle)},Nt=function(){return this.time?r(this,Re):this.value},ui=function(e){return this.time&&e.trim().toLowerCase()==="now"?Hg():e},It=function(){return N(Qe(s(this,E,ui).call(this,this.min)).date||this.min)},Pt=function(){return N(Qe(s(this,E,ui).call(this,this.max)).date||this.max)},Md=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Am=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?fa(r(this,E,Ed)):(Math.trunc(e)%7+7)%7},Rm=function(){return fd(r(this,E,rr),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},xa=function(e){let t=N(e);return t?r(this,E,rr).short(t):e},ar=function(e){let t=ir(e);return t===null?"":r(this,E,ya).format(t)},Hm=function(){return Ng(r(this,E,ya),{h:this.t("patternHour"),m:this.t("patternMinute")})},Nm=function(e){let{date:t,time:i}=Qe(e);g(this,Re,t),g(this,qe,t?i:"")},Ig=function(){let e=new Date,t=N(r(this,E,Nt))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=mi(t,r(this,E,It),r(this,E,Pt)),g(this,bi,!0)},Td=function(){let e=this.renderRoot.querySelector("input")??void 0,t=N(r(this,E,Nt)),i=r(this,E,rr);this.error?r(this,he).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,he).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,E,Rm)}),e):this.time?s(this,E,Pg).call(this,t,e):this.required&&!t?r(this,he).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,E,It)&&t<r(this,E,It)?r(this,he).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,E,It))}),e):t&&r(this,E,Pt)&&t>r(this,E,Pt)?r(this,he).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,E,Pt))}),e):t&&this.isUnavailable(this.value)?r(this,he).setValidity({customError:!0},this.t("unavailable"),e):r(this,he).setValidity({})},Pg=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,a=(b,w,y,M=t)=>r(this,he).setValidity(b,this.t(w,y),M),l=ir(r(this,qe));if(r(this,E,xo).trim()&&l===null)return a({badInput:!0},"badTime",{pattern:r(this,E,Hm)},i);if(!e&&l===null)return this.required?a({valueMissing:!0},"required"):r(this,he).setValidity({});if(!e)return a({badInput:!0},"required");if(l===null)return a({badInput:!0},"timeMissing",void 0,i);let d=vt(`${r(this,Re)}T${r(this,qe)}`),m=vt(s(this,E,ui).call(this,this.min)),u=vt(s(this,E,ui).call(this,this.max),!0),v=(b,w)=>Qe(b).time?r(this,E,ya).dateTime(w):r(this,E,rr).medium(w);if(m&&d<m)return a({rangeUnderflow:!0},"rangeUnderflow",{date:v(s(this,E,ui).call(this,this.min),m)},i);if(u&&d>u)return a({rangeOverflow:!0},"rangeOverflow",{date:v(s(this,E,ui).call(this,this.max),u)},i);if(l%r(this,E,Md))return a({stepMismatch:!0},"stepMismatch",{count:r(this,E,Md)},i);if(this.isUnavailable(r(this,Re)))return a({customError:!0},"unavailable");r(this,he).setValidity({})},Im=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})))},wa=function(e,t){g(this,Re,e),g(this,qe,t);let i=e&&t?`${e}T${t}`:"";g(this,Ta,!0),this.requestUpdate(),s(this,E,Im).call(this,i)},wo=function(e){this.time?s(this,E,wa).call(this,e,r(this,qe)):s(this,E,Im).call(this,e)},$o=function(){let e=this._text.trim();if(!e){s(this,E,wo).call(this,"");return}let t=vd(e,r(this,E,rr));t?(s(this,E,wo).call(this,t),this._text=s(this,E,xa).call(this,t)):(g(this,Ot,!0),s(this,E,wo).call(this,""))},Pm=function(){let e=r(this,E,xo).trim(),t=e?Dm(e,r(this,E,ya)):"";if(g(this,Ot,!0),t===null){g(this,Ea,!0),s(this,E,wa).call(this,r(this,Re),"");return}s(this,E,wa).call(this,r(this,Re),t),g(this,E,s(this,E,ar).call(this,t),pi)},Og=function(e){let t=r(this,E,Md),i=Dm(r(this,E,xo),r(this,E,ya));if(!i){let m=Qe(s(this,E,ui).call(this,this.min)),u=new Date;if(i=m.time&&(!r(this,Re)||r(this,Re)===m.date)?m.time:vo(u.getHours()*60+u.getMinutes()),ir(i)%t===0){g(this,Ot,!0),s(this,E,wa).call(this,r(this,Re),i),g(this,E,s(this,E,ar).call(this,i),pi);return}e=1}let a=ir(i),l=e>0?(Math.floor(a/t)+1)*t:(Math.ceil(a/t)-1)*t,d=vo(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,Ot,!0),s(this,E,wa).call(this,r(this,Re),d),g(this,E,s(this,E,ar).call(this,d),pi)},zd=new WeakMap,Om=function(e){let t=P(e);this.isUnavailable(t)||(this.open=!1,s(this,E,wo).call(this,t),this._text=s(this,E,xa).call(this,t),this.time&&!r(this,qe)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):s(this,E,qm).call(this))},qm=function(){this.renderRoot.querySelector(".trigger")?.focus()},_d=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Ld=new WeakMap,Dd=new WeakMap,ko=new WeakMap,gi.formAssociated=!0,gi.shadowRootOptions={...S.shadowRootOptions,delegatesFocus:!0},gi.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:ga},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}},gi.styles=[k,kd,wd,x`.pop { min-width: 0; }`];$("cm-date-picker",gi);var O0=z("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"}),sy={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[G(o,-1),G(o,-1)]],"last-7-days":["Last 7 days",o=>[G(o,-6),o]],"last-30-days":["Last 30 days",o=>[G(o,-29),o]],"last-90-days":["Last 90 days",o=>[G(o,-89),o]],"this-month":["This month",o=>[Ht(o),o]],"last-month":["Last month",o=>[Ht(Ze(o,-1)),ua(Ze(o,-1))]]},ny=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function qg(o,n=new Date,e){if(typeof o=="object"&&o)return o;let t=sy[o];if(!t)return null;let i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[a,l]=t[1](i);return{label:e?.(ny(o))||t[0],start:P(a),end:P(l)}}var Ca,be,Be,Sa,La,vi,I,Bm,za,Fm,Bt,Ad,qt,Bg,Rd,_a,jm,Fg,Hd,Nd,Id,Pd,Od,Eo,Um,fi=class extends T{constructor(){super(...arguments);p(this,I);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";p(this,Ca,"");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;p(this,be,this.attachInternals());p(this,Be,A("cm-drp"));p(this,Sa,null);p(this,La,!1);p(this,vi,!1);p(this,Bt,"start");p(this,Nd,()=>{this.disabled||(this.open?this.open=!1:(s(this,I,_a).call(this,"start"),s(this,I,_a).call(this,"end"),this.show()))});p(this,Id,e=>t=>{t.key==="Enter"?s(this,I,_a).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),s(this,I,_a).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});p(this,Pd,e=>{let t=yd(J(e,this),e,this._focus,r(this,I,Fm));if(t){e.preventDefault(),this._focus=mi(t,N(this.min),N(this.max)),g(this,vi,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),s(this,I,jm).call(this,this._focus))});p(this,Od,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,s(this,I,Hd).call(this);return}$d(e,e.currentTarget)});p(this,Eo,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Ca)}set locale(e){let t=r(this,Ca);g(this,Ca,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Sa)||g(this,Sa,[this.start,this.end]),document.addEventListener("pointerdown",r(this,Eo),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,Eo),!0)}get form(){return r(this,be).form}get validity(){return r(this,be).validity}get validationMessage(){return r(this,be).validationMessage}checkValidity(){return r(this,be).checkValidity()}reportValidity(){return r(this,be).reportValidity()}formResetCallback(){[this.start,this.end]=r(this,Sa)??["",""],this._startText=s(this,I,qt).call(this,this.start),this._endText=s(this,I,qt).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=N(this.start)?this.start:"",this._draftEnd=N(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=mi(N(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),N(this.min),N(this.max)),g(this,Bt,"start"),g(this,vi,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=N(e);if(!t)return!0;let i=N(this.min),a=N(this.max);return i&&t<i||a&&t>a?!0:yo(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){r(this,La)||(e.has("start")&&(this._startText=s(this,I,qt).call(this,this.start)),e.has("end")&&(this._endText=s(this,I,qt).call(this,this.end))),g(this,La,!1),e.has("locale")&&(N(this.start)&&(this._startText=s(this,I,qt).call(this,this.start)),N(this.end)&&(this._endText=s(this,I,qt).call(this,this.end)))}updated(){let e=N(this.start),t=N(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),r(this,be).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let a=this.renderRoot.querySelectorAll("input"),[l,d]=[a[0]??void 0,a[1]??void 0],m=r(this,I,za),u=N(this.min),v=N(this.max);this.error?r(this,be).setValidity({customError:!0},this.error,l):this._startText.trim()&&!e?r(this,be).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,I,Ad)}),l):this._endText.trim()&&!t?r(this,be).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,I,Ad)}),d):this.required&&(!e||!t)?r(this,be).setValidity({valueMissing:!0},this.t("required"),e?d:l):e&&t&&t<e?r(this,be).setValidity({badInput:!0},this.t("endBeforeStart"),d):e&&u&&e<u||t&&u&&t<u?r(this,be).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:m.medium(u)}),l):e&&v&&e>v||t&&v&&t>v?r(this,be).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:m.medium(v)}),d):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,be).setValidity({customError:!0},this.t("unavailable"),l):r(this,be).setValidity({}),this.open&&r(this,vi)&&(g(this,vi,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,I,za),t=N(this.start),i=N(this.end),a=[this.error&&`${r(this,Be)}-err`,this.helpText&&`${r(this,Be)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",m=yo(this.presets).map(b=>qg(b,new Date,w=>this.t(w))).filter(b=>!!b),u=r(this,Bt)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(N(this._draftStart))}):this.t("chooseStart"),v=b=>{let w=b==="start"?this._startText:this._endText;return c`<input id="${r(this,Be)}-${b}" type="text" autocomplete="off" spellcheck="false"
|
|
910
910
|
.value=${ne(w)} placeholder=${r(this,I,Ad)}
|
|
911
911
|
aria-label=${b==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
|
|
912
912
|
?required=${this.required} ?disabled=${this.disabled}
|
|
@@ -956,7 +956,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
956
956
|
.presets li { flex: 0 0 auto; }
|
|
957
957
|
.preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-full); min-height: 32px; }
|
|
958
958
|
}
|
|
959
|
-
`];$("cm-date-range-picker",fi);var
|
|
959
|
+
`];$("cm-date-range-picker",fi);var V0=z("fileUpload",{prompt:"Drag files here or {browse}",browse:"Browse",drop:"Drop files to upload",uploading:"Uploading {name}",cancel:"Cancel uploading {name}",cancelShort:"Cancel",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",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function oy(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.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 tt,ie,Ft,O,Mo,Vm,qd,Bd,Km,Wm,Gm,Ym,sr,jg,Ug,Xm,Vg,Kg,yi=class extends T{constructor(){super(...arguments);p(this,O);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="";this._progress=new Map;this._fileErrors=new Map;this._over=!1;p(this,tt,this.attachInternals());p(this,ie,A("cm-fu"));p(this,Ft,new Map)}get form(){return r(this,tt).form}get validity(){return r(this,tt).validity}get validationMessage(){return r(this,tt).validationMessage}checkValidity(){return r(this,tt).checkValidity()}reportValidity(){return r(this,tt).reportValidity()}formResetCallback(){this.files=[],this._rejected="",this._progress=new Map,this._fileErrors=new Map}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,Ft).values())URL.revokeObjectURL(e);r(this,Ft).clear()}updated(e){if(e.has("files"))for(let[l,d]of r(this,Ft))this.files.includes(l)||(URL.revokeObjectURL(d),r(this,Ft).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);r(this,tt).setFormValue(this.files.length?t:null);let i=(r(this,O,Mo)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,a=this.error||this._rejected;a?r(this,tt).setValidity({customError:!0},a,i):this.required&&!this.files.length?r(this,tt).setValidity({valueMissing:!0},this.t("required"),i):r(this,tt).setValidity({})}addFiles(e){let t=[...e],i=[],a=[],l=[];for(let m of t)oy(m,r(this,O,Vm))?this.maxSize&&m.size>this.maxSize?(a.push(m),l.push(this.t("tooLarge",{name:m.name,size:s(this,O,Bd).call(this,this.maxSize)}))):i.push(m):(a.push(m),l.push(this.t("wrongType",{name:m.name})));let d=r(this,O,qd)?[...this.files,...i]:i.slice(-1);!r(this,O,qd)&&!i.length&&(d=this.files),r(this,O,qd)&&this.maxFiles&&d.length>this.maxFiles&&(a.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),a.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:a}})),d!==this.files&&(d.length!==this.files.length||d.some((m,u)=>m!==this.files[u]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}setProgress(e,t){let i=new Map(this._progress);t==null?i.delete(e):i.set(e,Math.min(100,Math.max(0,Number(t)||0))),this._progress=i}setFileError(e,t){let i=new Map(this._fileErrors);t?i.set(e,t):i.delete(e),this._fileErrors=i}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this._progress.has(e)&&this.setProgress(e,null),this._fileErrors.has(e)&&this.setFileError(e,""),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(r(this,O,Mo))return s(this,O,Kg).call(this);let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
|
|
960
960
|
${this.label||this.hint&&i?c`<div class="head">
|
|
961
961
|
${this.label?c`<span class="label" id="${r(this,ie)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
|
|
962
962
|
${this.hint&&i?c`<span class="hint" id="${r(this,ie)}-hint">${this.hint}</span>`:h}
|
|
@@ -1089,7 +1089,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1089
1089
|
@media (max-width: 640px) {
|
|
1090
1090
|
.label { font-size: var(--cm-type-heading-sm-resp-size); }
|
|
1091
1091
|
}
|
|
1092
|
-
`];$("cm-file-upload",yi);var
|
|
1092
|
+
`];$("cm-file-upload",yi);var Q0=z("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),ly=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}];function jt(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}var cy=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function dy(o){let n=cy(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var Fe,yt,To,Da,Y,nr,Jm,Wg,Gg,Zm,Yg,Xg,Jg,Zg,xi=class extends T{constructor(){super(...arguments);p(this,Y);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.required=!1;this.disabled=!1;this._invalid=!1;p(this,Fe,this.attachInternals());p(this,yt,A("cm-cf"));p(this,To,"");p(this,Da)}connectedCallback(){super.connectedCallback(),g(this,To,jt(this.value)??this.value)}get form(){return r(this,Fe).form}get validity(){return r(this,Fe).validity}get validationMessage(){return r(this,Fe).validationMessage}checkValidity(){return r(this,Fe).checkValidity()}reportValidity(){return r(this,Fe).reportValidity()}formResetCallback(){this.value=r(this,To),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=jt(t?.value??"");return i?[{value:i,name:t.name}]:[]}):ly.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=jt(this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==r(this,Da)&&(this._draft=void 0,this._invalid=!1),g(this,Da,void 0)}}updated(){let e=!this.value||jt(this.value)!==null;r(this,Fe).setFormValue(this.value&&e?this.value:null,this.value);let t=this.renderRoot.querySelector(".input")??void 0;this.error?r(this,Fe).setValidity({customError:!0},this.error,t):this._invalid||!e?r(this,Fe).setValidity({patternMismatch:!0},this.t("invalid"),t):this.required&&!this.value?r(this,Fe).setValidity({valueMissing:!0},this.t("required"),t):r(this,Fe).setValidity({})}render(){let e=this.items,t=jt(this.value??""),i=e.findIndex(u=>u.value===t),a=this.error||(this._invalid||this.value&&!t?this.t("invalid"):""),l=[a&&`${r(this,yt)}-err`,this.helpText&&`${r(this,yt)}-help`].filter(Boolean).join(" ")||h,d=this.getAttribute("aria-label"),m=this.label||d||"";return c`<div class="field">
|
|
1093
1093
|
${this.label?c`<span class="label" id="${r(this,yt)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
|
|
1094
1094
|
${e.length?c`<div class="swatches" part="swatches" role="radiogroup"
|
|
1095
1095
|
aria-labelledby=${this.label?`${r(this,yt)}-l`:h} aria-label=${!this.label&&d?d:h}
|
|
@@ -1154,7 +1154,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1154
1154
|
.input:disabled { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
|
|
1155
1155
|
:host([disabled]) .pick { cursor: not-allowed; opacity: 0.4; }
|
|
1156
1156
|
:host([disabled]) .preview { opacity: 0.4; }
|
|
1157
|
-
`];$("cm-color-field",xi);var
|
|
1157
|
+
`];$("cm-color-field",xi);var n$=z("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),Qm=3,Fd=.7,hy=.0055,jd="#000000",Qg=8,zo=2,my=400,py=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),it,_o,Aa,Co,rt,at,st,$i,ki,ze,So,Ei,Ra,C,ep,Ud,tp,Ut,Vd,ip,rp,eb,ap,Kd,sp,Wd,tb,np,ib,or,Gd,op,lp,rb,cp,ab,dp,sb,nb,wi=class extends T{constructor(){super(...arguments);p(this,C);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";p(this,it,this.attachInternals());p(this,_o,A("cm-sig"));p(this,Aa,"");p(this,Co,"");p(this,rt,[]);p(this,at);p(this,st);p(this,$i,"");p(this,ki,0);p(this,ze);p(this,So,"");p(this,Ei);p(this,Ra,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?s(this,C,ep).call(this):(g(this,Aa,this.value),g(this,Co,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),r(this,Ei)?.disconnect(),g(this,Ei,void 0),cancelAnimationFrame(r(this,ki)),g(this,ki,0),r(this,ze)&&(clearTimeout(r(this,ze)),g(this,ze,void 0))}get form(){return r(this,it).form}get validity(){return r(this,it).validity}get validationMessage(){return r(this,it).validationMessage}checkValidity(){return r(this,it).checkValidity()}reportValidity(){return r(this,it).reportValidity()}formResetCallback(){g(this,rt,[]),g(this,at,void 0),g(this,st,void 0),r(this,ze)&&(clearTimeout(r(this,ze)),g(this,ze,void 0)),this.typedName=r(this,Co),r(this,Aa)?(g(this,$i,""),this.value=r(this,Aa)):this.updateComplete.then(()=>s(this,C,or).call(this,!1)),s(this,C,Ut).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!r(this,rt).length&&!r(this,st)}toDataURL(){return s(this,C,op).call(this)?.toDataURL("image/png")??""}toBlob(){let e=s(this,C,op).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,rt,[]),g(this,at,void 0),g(this,st,void 0),s(this,C,Ut).call(this)),s(this,C,or).call(this,!0)}undo(){this.mode==="draw"&&(r(this,rt).length?r(this,rt).pop():g(this,st,void 0),g(this,at,void 0),s(this,C,Ut).call(this),s(this,C,or).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==r(this,$i)){let t=this.value??"";if(g(this,$i,t),g(this,rt,[]),g(this,at,void 0),!t)g(this,st,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.addEventListener("load",()=>{r(this,st)===i&&s(this,C,Ut).call(this)}),i.src=t,g(this,st,i),this.mode="draw"}s(this,C,Ut).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,$i,t),this.value=t}}firstUpdated(){s(this,C,ep).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>s(this,C,or).call(this,!1)),s(this,C,Wd).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&s(this,C,Wd).call(this),r(this,it).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?r(this,it).setValidity({customError:!0},this.error,t):this.required&&this.empty?r(this,it).setValidity({valueMissing:!0},this.t("required"),t):r(this,it).setValidity({})}render(){let e=r(this,_o),t=this.getAttribute("aria-label"),i=this.error,a=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!r(this,rt).length&&!r(this,st),m=u=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${u}"
|
|
1158
1158
|
aria-selected=${this.mode===u?"true":"false"} aria-controls="${e}-panel-${u}"
|
|
1159
1159
|
tabindex=${this.mode===u?"0":"-1"} ?disabled=${this.disabled}
|
|
1160
1160
|
@click=${()=>s(this,C,lp).call(this,u,!0)} @keydown=${s(this,C,rb)}>${this.t(u)}</button>`;return c`<div class="field">
|
|
@@ -1260,7 +1260,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1260
1260
|
@media (pointer: coarse) { .act, .tab { min-height: var(--cm-control-height-touch); } }
|
|
1261
1261
|
|
|
1262
1262
|
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1263
|
-
`];function uy(o,n,e){let t=d=>e*hy*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],a=n[0];for(let d=1;d<n.length-1;d++){let m=py(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(a)),o.quadraticCurveTo(...i(n[d]),...i(m)),o.lineWidth=t(n[d].p),o.stroke(),a=m}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(a)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function gy(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,a=t,l=e,d=-1,m=-1;for(let v=0;v<t;v++){let b=v*e*4;for(let w=0;w<e;w++)i[b+w*4+3]>8&&(w<l&&(l=w),w>d&&(d=w),v<a&&(a=v),m=v)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=m-a+1+2*n,u.getContext("2d").drawImage(o,l,a,d-l+1,m-a+1,n,n,d-l+1,m-a+1),u}function by(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let a=parseInt(i[1],16);return`${a>>16&255},${a>>8&255},${a&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",wi);var
|
|
1263
|
+
`];function uy(o,n,e){let t=d=>e*hy*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],a=n[0];for(let d=1;d<n.length-1;d++){let m=py(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(a)),o.quadraticCurveTo(...i(n[d]),...i(m)),o.lineWidth=t(n[d].p),o.stroke(),a=m}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(a)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function gy(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,a=t,l=e,d=-1,m=-1;for(let v=0;v<t;v++){let b=v*e*4;for(let w=0;w<e;w++)i[b+w*4+3]>8&&(w<l&&(l=w),w>d&&(d=w),v<a&&(a=v),m=v)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=m-a+1+2*n,u.getContext("2d").drawImage(o,l,a,d-l+1,m-a+1,n,n,d-l+1,m-a+1),u}function by(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let a=parseInt(i[1],16);return`${a>>16&255},${a>>8&255},${a&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",wi);var m$=z("optionGroup",{required:"Please select one of these options."}),ct,Lo,Ha,Do,wt,hp,mp,ob,xt=class extends T{constructor(){super(...arguments);p(this,wt);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];p(this,ct,this.attachInternals());p(this,Lo,A("cm-og"));p(this,Ha,"");p(this,Do,new MutationObserver(()=>s(this,wt,hp).call(this)))}connectedCallback(){super.connectedCallback(),s(this,wt,hp).call(this),r(this,Do).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Do).disconnect()}get form(){return r(this,ct).form}get validity(){return r(this,ct).validity}get validationMessage(){return r(this,ct).validationMessage}checkValidity(){return r(this,ct).checkValidity()}reportValidity(){return r(this,ct).reportValidity()}formResetCallback(){this.value=r(this,Ha)}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(){r(this,Ha)||g(this,Ha,this.value)}updated(){r(this,ct).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,ct).setValidity({valueMissing:!0},this.t("required"),e):r(this,ct).setValidity({})}render(){let e=this.items,t=e.findIndex(l=>l.value===this.value&&!l.disabled),i=t>=0?t:e.findIndex(l=>!l.disabled),a=this.getAttribute("aria-label");return c`
|
|
1264
1264
|
${this.label?c`<span class="label" id="${r(this,Lo)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
|
|
1265
1265
|
<div class="options" part="options" role="radiogroup"
|
|
1266
1266
|
aria-labelledby=${this.label?`${r(this,Lo)}-l`:h} aria-label=${!this.label&&a?a:h}
|
|
@@ -1302,7 +1302,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1302
1302
|
}
|
|
1303
1303
|
slot { display: none; }
|
|
1304
1304
|
@media (pointer: coarse) { button { min-height: var(--cm-control-height-touch, 44px); } }
|
|
1305
|
-
`];$("cm-option-group",xt);var
|
|
1305
|
+
`];$("cm-option-group",xt);var y$=z("segmentedControl",{required:"Please select one of these options."}),Na=class extends xt{constructor(){super(...arguments);this.size="default"}};Na.properties={...xt.properties,size:{reflect:!0}},Na.styles=[k,x`
|
|
1306
1306
|
:host { display: inline-block; vertical-align: middle; max-width: 100%; --_h: var(--cm-control-height-md, 36px); }
|
|
1307
1307
|
:host([size='small']) { --_h: var(--cm-control-height-sm, 32px); }
|
|
1308
1308
|
@media (pointer: coarse) { :host, :host([size='small']) { --_h: var(--cm-control-height-touch, 44px); } }
|
|
@@ -1332,7 +1332,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1332
1332
|
button[aria-checked='true']:disabled { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
1333
1333
|
:host([disabled]) .options { background: var(--cm-bg-input-filled); }
|
|
1334
1334
|
slot { display: none; }
|
|
1335
|
-
`];$("cm-segmented-control",Na);var
|
|
1335
|
+
`];$("cm-segmented-control",Na);var E$=z("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Ao,pp,Ia=class extends T{constructor(){super(...arguments);p(this,Ao);this.heading="";this.description="";this.breadcrumbs=[];this.backHref="";this.backLabel="";this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=this.backHref?{href:this.backHref,label:this.backLabel}:[...e].reverse().find(i=>i.href);return c`<header part="header">
|
|
1336
1336
|
<div class=${this.description?"lead described":"lead"}>
|
|
1337
1337
|
${t?c`<a class=${this.backHref?"back always":"back"} part="back" href=${t.href} aria-label=${t.label?this.t("back",{label:t.label}):this.t("backOnly")}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:h}
|
|
1338
1338
|
<div class="titles">
|
|
@@ -1408,7 +1408,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1408
1408
|
h1 { font-size: var(--cm-type-heading-lg-resp-size); line-height: var(--cm-type-heading-lg-resp-line-height); }
|
|
1409
1409
|
.actions { gap: var(--cm-space-8); }
|
|
1410
1410
|
}
|
|
1411
|
-
`];$("cm-page-header",Ia);var
|
|
1411
|
+
`];$("cm-page-header",Ia);var S$=z("actionBar",{label:"Actions"}),Pa=class extends T{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
|
|
1412
1412
|
<div class="lead">
|
|
1413
1413
|
${e?c`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:h}
|
|
1414
1414
|
<div class="text">
|
|
@@ -1449,7 +1449,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1449
1449
|
|
|
1450
1450
|
.actions { gap: var(--cm-space-8); }
|
|
1451
1451
|
}
|
|
1452
|
-
`];$("cm-action-bar",Pa);var
|
|
1452
|
+
`];$("cm-action-bar",Pa);var H$=z("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),$t,lr,Ro,_e,up,gp,bp,lb,cb,Oa=class extends T{constructor(){super(...arguments);p(this,_e);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";p(this,$t,null);p(this,lr,()=>{this.open=!0});p(this,Ro,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>s(this,_e,up).call(this))}disconnectedCallback(){super.disconnectedCallback(),s(this,_e,gp).call(this)}updated(e){e.has("form")&&this.isConnected&&s(this,_e,up).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
|
|
1453
1453
|
<p class="message" part="message" role="status">${this.open?this.message:""}</p>
|
|
1454
1454
|
<div class="actions">
|
|
1455
1455
|
<cm-button size="large" ?disabled=${this.loading} @click=${s(this,_e,cb)}>${this.discardLabel}</cm-button>
|
|
@@ -1659,7 +1659,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1659
1659
|
.body { grid-template-columns: minmax(0, 1fr); }
|
|
1660
1660
|
.head { height: 60px; }
|
|
1661
1661
|
}
|
|
1662
|
-
`];$("cm-skeleton-display",Va);var
|
|
1662
|
+
`];$("cm-skeleton-display",Va);var s1=z("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Yd,mb,Ka=class extends T{constructor(){super(...arguments);p(this,Yd);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=s(this,Yd,mb).call(this);return c`<article part="comment">
|
|
1663
1663
|
${e?c`<time class="meta" part="time" datetime=${this.datetime||h}>${e}</time>`:h}
|
|
1664
1664
|
<div class="body" part="body"><slot></slot></div>
|
|
1665
1665
|
${this.author?c`<div class="meta" part="author">– ${this.author}</div>`:h}
|
|
@@ -1718,7 +1718,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1718
1718
|
:host([open]) .tip { opacity: 1; visibility: visible; transition: opacity var(--cm-duration-fast) var(--cm-easing-standard); }
|
|
1719
1719
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
1720
1720
|
@media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
|
|
1721
|
-
`];$("cm-tooltip",Ga);var
|
|
1721
|
+
`];$("cm-tooltip",Ga);var g1=z("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"}),b1=z("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),yy=7,No=new Set,Io;function gb(o,n){n?No.add(o):No.delete(o),No.size&&!Io&&(Io=setInterval(()=>No.forEach(e=>e.requestUpdate()),6e4)),!No.size&&Io&&(clearInterval(Io),Io=void 0)}var Po,pr,dt,wp,ih,bb,Qa=class extends T{constructor(){super(...arguments);p(this,dt);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;p(this,Po,A("cm-tl"));p(this,pr)}connectedCallback(){super.connectedCallback(),gb(this,!0)}disconnectedCallback(){super.disconnectedCallback(),gb(this,!1),r(this,pr)?.disconnect(),g(this,pr,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,pr,new ResizeObserver(()=>s(this,dt,wp).call(this))),r(this,pr).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&s(this,dt,wp).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,a=Math.floor(Math.abs(t)/6e4);if(a<1)return this.t("justNow");if(a<60)return this.t(i?"inMinutes":"minutesAgo",{count:a});let l=Math.floor(a/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<yy?this.t(i?"inDays":"daysAgo",{count:d}):ae(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?ae(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",a=this.lines>0&&!this.expanded,l=e?t?c`<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>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
|
|
1722
1722
|
<span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:c`<span class="dot"></span>`}</span>
|
|
1723
1723
|
<div class="main">
|
|
1724
1724
|
<div class="head">
|
|
@@ -1801,7 +1801,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1801
1801
|
@media (max-width: 640px) {
|
|
1802
1802
|
.more { padding-inline-start: 0; }
|
|
1803
1803
|
}
|
|
1804
|
-
`];$("cm-timeline",mr);var
|
|
1804
|
+
`];$("cm-timeline",mr);var $1=z("smartTip",{newTab:"(opens in a new tab)"}),k1=z("smartTips",{heading:"Smart tips",tourAction:"Start"}),ts=class extends T{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 c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
|
|
1805
1805
|
<span class="text">
|
|
1806
1806
|
<span class="title" part="heading">${this.heading}</span>
|
|
1807
1807
|
<span class="desc" part="description"><slot></slot></span>
|
|
@@ -1853,7 +1853,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1853
1853
|
margin: var(--cm-space-8) 0 var(--cm-space-16); text-align: center; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600;
|
|
1854
1854
|
}
|
|
1855
1855
|
.list { display: flex; flex-direction: column; gap: var(--cm-space-8); }
|
|
1856
|
-
`];$("cm-smart-tips",is);var
|
|
1856
|
+
`];$("cm-smart-tips",is);var _1=z("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"}),Wt,as,vb,yb,rs=class extends T{constructor(){super(...arguments);p(this,as);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;p(this,Wt,A("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,a=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
|
|
1857
1857
|
<nav part="bar" aria-label=${this.label}>
|
|
1858
1858
|
${l.length?c`<div class="rows" part="rows">
|
|
1859
1859
|
<label for="${r(this,Wt)}-s">${this.t("rows")}</label>
|
|
@@ -1923,7 +1923,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1923
1923
|
select, input { height: var(--cm-control-height-touch); }
|
|
1924
1924
|
button { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
|
|
1925
1925
|
}
|
|
1926
|
-
`];$("cm-pagination",rs);var
|
|
1926
|
+
`];$("cm-pagination",rs);var R1=z("statusTabs",{label:"Status",option:"{label} ({count})"}),ns,Bo,me,qo,xb,kp,wb,Ep,$b,ss=class extends T{constructor(){super(...arguments);p(this,me);this.value="";this.tabs=[];this.controls="";this.size="large";this.mobile="scroll";this._more="";p(this,ns,new ResizeObserver(()=>s(this,me,qo).call(this)));this._slotted=[];p(this,Bo,new MutationObserver(()=>s(this,me,kp).call(this)))}connectedCallback(){super.connectedCallback(),s(this,me,kp).call(this),r(this,Bo).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Bo).disconnect(),r(this,ns).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,ns).observe(e),e.addEventListener("scroll",()=>s(this,me,qo).call(this),{passive:!0}),document.fonts?.ready.then(()=>s(this,me,qo).call(this))}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){let t=this.renderRoot.querySelector(".pick select");t&&t.offsetParent!==null?t.focus(e):this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(e){s(this,me,qo).call(this);for(let a of this.renderRoot.querySelectorAll(".tabs > *"))r(this,ns).observe(a);if(!("ariaControlsElements"in Element.prototype))return;let t=this.getRootNode(),i=this.controls?t.getElementById?.(this.controls):null;for(let a of this.renderRoot.querySelectorAll("button, select"))a.ariaControlsElements=i?[i]:null}render(){let e=this.items,t=s(this,me,wb).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
|
|
1927
1927
|
<div class=${`tabs${this._more?` more-${this._more}`:""}`} part="tabs" role="tablist" aria-label=${i}>
|
|
1928
1928
|
${e.map((a,l)=>c`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
|
|
1929
1929
|
tabindex=${l===t?"0":"-1"} ?disabled=${!!a.disabled}
|
|
@@ -1992,7 +1992,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1992
1992
|
:host([mobile='select']) .tabs { display: none; }
|
|
1993
1993
|
:host([mobile='select']) .pick { display: block; }
|
|
1994
1994
|
}
|
|
1995
|
-
`];$("cm-status-tabs",ss);var
|
|
1995
|
+
`];$("cm-status-tabs",ss);var q1=z("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),rh,Fo,Gt,Mp,kb,Eb,os=class extends T{constructor(){super(...arguments);p(this,Gt);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;p(this,rh,A("cm-th"));p(this,Fo,new MutationObserver(()=>s(this,Gt,Mp).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),s(this,Gt,Mp).call(this),r(this,Fo).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Fo).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 c`
|
|
1996
1996
|
<div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":h}
|
|
1997
1997
|
style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
|
|
1998
1998
|
${this.selectable?c`<span class="cell" role=${e?"columnheader":h}><span class="check">
|
|
@@ -2060,7 +2060,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
2060
2060
|
`];$("cm-table-header",os);var xy=`
|
|
2061
2061
|
[data-cm-density="compact"] { --cm-table-row-height: 40px; --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
|
|
2062
2062
|
[data-cm-density="comfortable"] { --cm-table-row-height: 48px; --cm-resource-row-height: 56px; --cm-resource-row-padding: 8px; --cm-resource-media-size: 40px; }
|
|
2063
|
-
`,ah=null,Mb=new WeakSet;function sh(o){if(typeof document>"u"||typeof CSSStyleSheet>"u")return;let n=[document],e=o.getRootNode();e instanceof ShadowRoot&&n.push(e);for(let t of n)if(!Mb.has(t)){Mb.add(t);try{ah||(ah=new CSSStyleSheet,ah.replaceSync(xy)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,ah]}catch{}}}var
|
|
2063
|
+
`,ah=null,Mb=new WeakSet;function sh(o){if(typeof document>"u"||typeof CSSStyleSheet>"u")return;let n=[document],e=o.getRootNode();e instanceof ShadowRoot&&n.push(e);for(let t of n)if(!Mb.has(t)){Mb.add(t);try{ah||(ah=new CSSStyleSheet,ah.replaceSync(xy)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,ah]}catch{}}}var G1=z("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}",scrollHint:"Scroll for more",columns:"Columns",showColumns:"Show columns",resize:"Resize {column} column",resized:"{column} column, {width} pixels wide",viewAll:"View all fields",viewLess:"Hide fields",rowAction:"{action}, {name}"}),Tb=48,zb=16,_b=!1,wy=`
|
|
2064
2064
|
cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); font-variant-numeric: tabular-nums; color: var(--cm-text-default); }
|
|
2065
2065
|
cm-data-table > table caption { text-align: start; font-weight: 600; font-size: var(--cm-font-size-16); line-height: var(--cm-line-height-16); padding-block-end: var(--cm-space-8); }
|
|
2066
2066
|
cm-data-table > table th, cm-data-table > table td { box-sizing: border-box; }
|
|
@@ -2084,7 +2084,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
2084
2084
|
cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'], cm-data-table > table [data-type='date'] { white-space: nowrap; }
|
|
2085
2085
|
cm-data-table > table [data-type='actions'] { width: 1%; white-space: nowrap; }
|
|
2086
2086
|
cm-data-table > table td [data-lines] { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
|
|
2087
|
-
cm-data-table > table td [data-lines='1'] { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; max-inline-size: var(--cm-data-table-cell-max-width, 320px); }
|
|
2087
|
+
cm-data-table > table td [data-lines='1'] { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; max-inline-size: min(var(--cm-data-table-cell-max-width, 320px), 100%); }
|
|
2088
2088
|
cm-data-table > table td [data-lines='3'] { -webkit-line-clamp: 3; line-clamp: 3; }
|
|
2089
2089
|
cm-data-table > table td [data-lines='4'] { -webkit-line-clamp: 4; line-clamp: 4; }
|
|
2090
2090
|
cm-data-table > table tbody td[data-type='actions'] { padding-block: 0; }
|
|
@@ -2102,6 +2102,8 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2102
2102
|
cm-data-table[mobile='cards'] > table tr { display: block; margin-block-end: var(--cm-space-8); padding: var(--cm-space-12) var(--cm-space-16); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
|
|
2103
2103
|
cm-data-table[mobile='cards'] > table tr > * { display: flex; justify-content: space-between; gap: var(--cm-space-12); height: auto; padding: var(--cm-space-4) 0; border: 0; background: none; text-align: end; white-space: normal; }
|
|
2104
2104
|
cm-data-table[mobile='cards'] > table tbody tr:hover > * { background: none; }
|
|
2105
|
+
/* The value side of a card row may shrink, so one-line [data-lines] items end in "\u2026" inside the card (CRM 1.7.1). */
|
|
2106
|
+
cm-data-table[mobile='cards'] > table tr > * > * { min-inline-size: 0; max-inline-size: 100%; box-sizing: border-box; }
|
|
2105
2107
|
cm-data-table[mobile='cards'] > table tr > :first-child { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 600; text-align: start; }
|
|
2106
2108
|
cm-data-table[mobile='cards'] > table tr > :not(:first-child)[data-label]::before { content: attr(data-label); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); text-align: start; font-weight: 400; }
|
|
2107
2109
|
cm-data-table[mobile='cards'] > table td[data-type='actions'] { justify-content: flex-start; flex-wrap: wrap; padding-block-start: var(--cm-space-8); }
|
|
@@ -2312,7 +2314,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2312
2314
|
:host([mobile='priority']) tr.more { display: table-row; }
|
|
2313
2315
|
}
|
|
2314
2316
|
@media (forced-colors: active) { button.sort cm-icon { opacity: 1; } .acts { opacity: 1 !important; } }
|
|
2315
|
-
`];$("cm-data-table",ms);var
|
|
2317
|
+
`];$("cm-data-table",ms);var tk=z("resourceItem",{select:"Select {name}"}),ik=z("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}"}),Xb=x`
|
|
2316
2318
|
.check { position: relative; display: inline-flex; flex: none; width: 16px; height: 16px; }
|
|
2317
2319
|
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
|
2318
2320
|
.check input:disabled { cursor: not-allowed; }
|
|
@@ -2458,7 +2460,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2458
2460
|
.toolbar .check { width: 20px; height: 20px; }
|
|
2459
2461
|
.spinner { width: 32px; height: 32px; margin: -16px; border-width: 3px; }
|
|
2460
2462
|
}
|
|
2461
|
-
`];$("cm-resource-list",xs);var
|
|
2463
|
+
`];$("cm-resource-list",xs);var lk=z("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),ck=z("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),fh,re,Np,Ip,ef,tf,zi,rf,af,sf,Pp,nf,ht=class ht extends T{constructor(){super();p(this,re);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;p(this,fh,this.attachInternals());p(this,zi,!1);r(this,fh).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let a=e.items,l=Math.max(0,Math.min(a.length,t??a.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,a[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:a.length+1})),!0):!1}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 a=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(a))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
|
|
2462
2464
|
<div class="row" part="row" @dragover=${s(this,re,sf)} @dragleave=${s(this,re,Pp)} @drop=${s(this,re,nf)}>
|
|
2463
2465
|
${this.sortable?c`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
|
|
2464
2466
|
aria-describedby="hint"
|
|
@@ -2535,7 +2537,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2535
2537
|
.title { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); }
|
|
2536
2538
|
.rows { margin-inline-start: var(--cm-space-8); }
|
|
2537
2539
|
}
|
|
2538
|
-
`];$("cm-nested-list",$s);var df=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},hf=Gr(class extends ti{constructor(o){if(super(o),o.type!==ot.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],a=[],l=0;for(let d of o)i[l]=t?t(d,l):l,a[l]=e(d,l),l++;return{values:a,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=hg(o),{values:a,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,a;let d=this.ut??=[],m=[],u,v,b=0,w=i.length-1,y=0,M=a.length-1;for(;b<=w&&y<=M;)if(i[b]===null)b++;else if(i[w]===null)w--;else if(d[b]===l[y])m[y]=ii(i[b],a[y]),b++,y++;else if(d[w]===l[M])m[M]=ii(i[w],a[M]),w--,M--;else if(d[b]===l[M])m[M]=ii(i[b],a[M]),Yr(o,m[M+1],i[b]),b++,M--;else if(d[w]===l[y])m[y]=ii(i[w],a[y]),Yr(o,i[b],i[w]),w--,y++;else if(u===void 0&&(u=df(l,y,M),v=df(d,b,w)),u.has(d[b]))if(u.has(d[w])){let D=v.get(l[y]),H=D!==void 0?i[D]:null;if(H===null){let q=Yr(o,i[b]);ii(q,a[y]),m[y]=q}else m[y]=ii(H,a[y]),Yr(o,i[b],H),i[D]=null;y++}else zc(i[w]),w--;else zc(i[b]),b++;for(;y<=M;){let D=Yr(o,m[M+1]);ii(D,a[y]),m[y++]=D}for(;b<=w;){let D=i[b++];D!==null&&zc(D)}return this.ut=l,Tc(o,m),we}});function mf(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),a=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return a(1);case"ArrowLeft":return a(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var le,Ue,Ve,xr=class{constructor(n){p(this,le);p(this,Ue,null);p(this,Ve,null);g(this,le,n)}get active(){return r(this,Ue)!==null}get from(){return r(this,Ue)&&{...r(this,Ue)}}get target(){return r(this,Ve)&&{...r(this,Ve)}}groupCount(){return r(this,le).groupCount()}slotCount(n){return n>=0&&n<r(this,le).groupCount()?r(this,le).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,Ue,{...n}),g(this,Ve,{...n}),r(this,le).onTarget?.(this.target),r(this,le).announce(r(this,le).messages.pickedUp(this.target))}moveTo(n){if(!r(this,Ve))return;let e=Math.max(0,Math.min(n.group,r(this,le).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,Ve,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,le).onTarget?.(this.target),r(this,le).announce(r(this,le).messages.over(this.target)))}drop(){if(!r(this,Ue)||!r(this,Ve))return;let n=r(this,Ue),e=r(this,Ve);g(this,Ue,g(this,Ve,null)),r(this,le).onTarget?.(null),r(this,le).onDrop(n,e)}cancel(n=!1){if(!r(this,Ue))return;let e=r(this,Ue),t=n?"":r(this,le).messages.cancelled(e);g(this,Ue,g(this,Ve,null)),r(this,le).onTarget?.(null),r(this,le).onCancel?.(e),t&&r(this,le).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(r(this,le).navigate??mf)(e,r(this,Ve),this);return t?(this.moveTo(t),!0):!1}};le=new WeakMap,Ue=new WeakMap,Ve=new WeakMap;var Go,yr,wr=class{constructor(n=document,e="assertive"){p(this,Go);p(this,yr);let t=n.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return r(this,yr)??this.element.textContent??""}announce(n){clearTimeout(r(this,Go)),this.element.textContent===n?(this.element.textContent="",g(this,yr,n),g(this,Go,setTimeout(()=>{this.element.textContent=n,g(this,yr,void 0)},50))):(g(this,yr,void 0),this.element.textContent=n)}};Go=new WeakMap,yr=new WeakMap;var
|
|
2540
|
+
`];$("cm-nested-list",$s);var df=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},hf=Gr(class extends ti{constructor(o){if(super(o),o.type!==ot.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],a=[],l=0;for(let d of o)i[l]=t?t(d,l):l,a[l]=e(d,l),l++;return{values:a,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=hg(o),{values:a,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,a;let d=this.ut??=[],m=[],u,v,b=0,w=i.length-1,y=0,M=a.length-1;for(;b<=w&&y<=M;)if(i[b]===null)b++;else if(i[w]===null)w--;else if(d[b]===l[y])m[y]=ii(i[b],a[y]),b++,y++;else if(d[w]===l[M])m[M]=ii(i[w],a[M]),w--,M--;else if(d[b]===l[M])m[M]=ii(i[b],a[M]),Yr(o,m[M+1],i[b]),b++,M--;else if(d[w]===l[y])m[y]=ii(i[w],a[y]),Yr(o,i[b],i[w]),w--,y++;else if(u===void 0&&(u=df(l,y,M),v=df(d,b,w)),u.has(d[b]))if(u.has(d[w])){let D=v.get(l[y]),H=D!==void 0?i[D]:null;if(H===null){let q=Yr(o,i[b]);ii(q,a[y]),m[y]=q}else m[y]=ii(H,a[y]),Yr(o,i[b],H),i[D]=null;y++}else zc(i[w]),w--;else zc(i[b]),b++;for(;y<=M;){let D=Yr(o,m[M+1]);ii(D,a[y]),m[y++]=D}for(;b<=w;){let D=i[b++];D!==null&&zc(D)}return this.ut=l,Tc(o,m),we}});function mf(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),a=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return a(1);case"ArrowLeft":return a(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var le,Ue,Ve,xr=class{constructor(n){p(this,le);p(this,Ue,null);p(this,Ve,null);g(this,le,n)}get active(){return r(this,Ue)!==null}get from(){return r(this,Ue)&&{...r(this,Ue)}}get target(){return r(this,Ve)&&{...r(this,Ve)}}groupCount(){return r(this,le).groupCount()}slotCount(n){return n>=0&&n<r(this,le).groupCount()?r(this,le).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,Ue,{...n}),g(this,Ve,{...n}),r(this,le).onTarget?.(this.target),r(this,le).announce(r(this,le).messages.pickedUp(this.target))}moveTo(n){if(!r(this,Ve))return;let e=Math.max(0,Math.min(n.group,r(this,le).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,Ve,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,le).onTarget?.(this.target),r(this,le).announce(r(this,le).messages.over(this.target)))}drop(){if(!r(this,Ue)||!r(this,Ve))return;let n=r(this,Ue),e=r(this,Ve);g(this,Ue,g(this,Ve,null)),r(this,le).onTarget?.(null),r(this,le).onDrop(n,e)}cancel(n=!1){if(!r(this,Ue))return;let e=r(this,Ue),t=n?"":r(this,le).messages.cancelled(e);g(this,Ue,g(this,Ve,null)),r(this,le).onTarget?.(null),r(this,le).onCancel?.(e),t&&r(this,le).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(r(this,le).navigate??mf)(e,r(this,Ve),this);return t?(this.moveTo(t),!0):!1}};le=new WeakMap,Ue=new WeakMap,Ve=new WeakMap;var Go,yr,wr=class{constructor(n=document,e="assertive"){p(this,Go);p(this,yr);let t=n.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return r(this,yr)??this.element.textContent??""}announce(n){clearTimeout(r(this,Go)),this.element.textContent===n?(this.element.textContent="",g(this,yr,n),g(this,Go,setTimeout(()=>{this.element.textContent=n,g(this,yr,void 0)},50))):(g(this,yr,void 0),this.element.textContent=n)}};Go=new WeakMap,yr=new WeakMap;var Tk=z("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),zk=z("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),_k=z("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."}),Ty="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",Yo,wh,pf,$r=class extends T{constructor(){super(...arguments);p(this,wh);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";p(this,Yo,A("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return c`<div class="card" part="card">
|
|
2539
2541
|
${this.locked?h:c`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
|
|
2540
2542
|
aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,Yo)}-help"></div>`}
|
|
2541
2543
|
<div class="content">
|
|
@@ -2642,7 +2644,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2642
2644
|
::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
|
|
2643
2645
|
::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
|
|
2644
2646
|
}
|
|
2645
|
-
`];$("cm-board",Ms);var Xk=z("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),Ls=class extends S{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};Ls.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},Ls.styles=x`:host { display: none !important; }`;$("cm-calendar-event",Ls);var _h=o=>String(o).padStart(2,"0"),kf=o=>`${P(o)}T${_h(o.getHours())}:${_h(o.getMinutes())}`,$h=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),Ef=["month","week","day"],zy=600,Mf=new Map,Tf=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=Mf.get(e);return t||(t=new Intl.DateTimeFormat(o,n),Mf.set(e,t)),t},Gp=o=>o.replace(/[ ]/g," ").trim(),As,Se,Le,xe,Z,Q,Tr,Et,We,ul,Di,Rs,Hs,Ns,Is,gl,f,Ee,Si,nl,kh,kt,Yp,ol,mt,Xp,zf,pt,Cs,_f,Cf,Ke,ll,cl,Eh,Sf,Lf,Df,Mr,Jp,dl,Af,hl,Rf,Hf,Nf,If,bl,fl,Pf,Of,vl,ml,qf,Zp,Qp,eu,Bf,Ff,tu,iu,ru,yl,au,jf,xl,wl,$l,kl,El,Ml,su,Mh,Uf,Li,pl,Vf,nu,Kf,Th,ou,Ss,zh,Wf,Gf,Yf,Xf,Jf,Ds=class extends T{constructor(){super();p(this,f);this.view="month";this.date="";this.today="";this.step=15;p(this,As,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;p(this,Se,A("cm-cal"));p(this,Le,new wr);p(this,xe);p(this,Z,null);p(this,Q,null);p(this,Tr,new WeakMap);p(this,Et,"");p(this,We,null);p(this,ul,"");p(this,Di,!0);p(this,Rs,0);p(this,Hs,!1);p(this,Ns);p(this,Is,0);p(this,gl,new MutationObserver(()=>this.requestUpdate()));p(this,bl,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Et,t.dataset.k);for(let i of s(this,f,hl).call(this))i.tabIndex=i===t?0:-1}});p(this,fl,e=>{let t=e.relatedTarget;if(this._more&&!r(this,Z)){let i=this.renderRoot.querySelector(".pop"),a=e.composedPath()[0];i&&i.contains(a)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,xe).active||!r(this,Z)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,xe).active||!r(this,Z))return;this.renderRoot.activeElement?.dataset.ev!==r(this,Z).ev.key&&r(this,xe).cancel()}))});p(this,vl,e=>{if(r(this,Q)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=J(e,this);if(r(this,xe).active){r(this,xe).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let a=i.closest(".pop");if(a&&e.key==="Escape"){e.preventDefault(),s(this,f,Th).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,Rs,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(a&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...a.querySelectorAll(".chip")],m=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];m&&(e.preventDefault(),m.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),s(this,f,Of).call(this,i,e.key==="PageUp"?-1:1);return}let l=s(this,f,Pf).call(this,i,t);l?(e.preventDefault(),s(this,f,If).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});p(this,yl,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});p(this,xl,e=>{if(r(this,Q)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(m=>m.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),a=i&&s(this,f,Cs).call(this,i);if(!a||i.locked||i.pending)return;let l=s(this,f,Qp).call(this,a,t.dataset.day??a.days[0]);if(!l)return;r(this,xe).active&&r(this,xe).cancel();let d=0;if(l.mode==="time"){let m=s(this,f,au).call(this,e.clientX,e.clientY);m&&t.classList.contains("time")&&(d=Math.max(0,Math.min(a.dur,m.min-a.min)))}g(this,Q,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,Q).timer=setTimeout(()=>{r(this,Q)&&!r(this,Q).started&&s(this,f,su).call(this)},300)),window.addEventListener("pointermove",r(this,kl),!0),window.addEventListener("pointerup",r(this,El),!0),window.addEventListener("pointercancel",r(this,Ml),!0),window.addEventListener("touchmove",r(this,wl),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,$l),!0)});p(this,wl,e=>{r(this,Q)?.started&&e.cancelable&&e.preventDefault()});p(this,$l,e=>{r(this,Q)&&e.preventDefault()});p(this,kl,e=>{let t=r(this,Q);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?s(this,f,su).call(this):s(this,f,Li).call(this,!1));return}e.preventDefault(),s(this,f,Mh).call(this)}});p(this,El,e=>{let t=r(this,Q);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){s(this,f,Li).call(this,!1);return}let i=a=>{a.stopPropagation(),a.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),s(this,f,Li).call(this,!0)});p(this,Ml,e=>{r(this,Q)&&e.pointerId===r(this,Q).pointerId&&s(this,f,Li).call(this,!1)});g(this,xe,new xr({groupCount:()=>s(this,f,pt).call(this).length,slotCount:()=>r(this,Z)?r(this,Z).mode==="day"?1:s(this,f,ml).call(this,r(this,Z).ev.dur):0,navigate:(e,t)=>s(this,f,qf).call(this,e,t),onTarget:e=>s(this,f,Bf).call(this,e),onDrop:(e,t)=>s(this,f,Ff).call(this,e,t),onCancel:()=>s(this,f,eu).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,Z)?.ev.name??"",place:s(this,f,Mr).call(this,r(this,Z),e)}),over:e=>this.t("over",{place:s(this,f,Mr).call(this,r(this,Z),e)}),cancelled:e=>this.t("cancelled",{event:r(this,Z)?.ev.name??"",place:s(this,f,Mr).call(this,r(this,Z),e)})},announce:e=>r(this,Le).announce(e)}))}get locale(){return r(this,As)}set locale(e){let t=r(this,As);g(this,As,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=s(this,f,pt).call(this);return{view:r(this,f,Ee),start:P(e[0]),end:P(e[e.length-1])}}get heldEvent(){return r(this,Z)?.ev.el??null}get announcement(){return r(this,Le).text}announce(e){r(this,Le).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,vl)),this.addEventListener("focusin",r(this,bl)),this.addEventListener("focusout",r(this,fl)),this.addEventListener("pointerdown",r(this,xl)),this.addEventListener("dragstart",r(this,yl)),r(this,gl).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,Ns,new ResizeObserver(()=>{cancelAnimationFrame(r(this,Is)),g(this,Is,requestAnimationFrame(()=>s(this,f,Jp).call(this)))})),r(this,Ns).observe(this)),s(this,f,Jp).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,vl)),this.removeEventListener("focusin",r(this,bl)),this.removeEventListener("focusout",r(this,fl)),this.removeEventListener("pointerdown",r(this,xl)),this.removeEventListener("dragstart",r(this,yl)),r(this,gl).disconnect(),r(this,Ns)?.disconnect(),cancelAnimationFrame(r(this,Is)),r(this,xe).cancel(!0),s(this,f,Li).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,Di,!0),e.get("view")!==void 0&&(this._more="",r(this,xe).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Le).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,Di,!0),s(this,f,Nf).call(this),r(this,We)){let l=s(this,f,Rf).call(this,r(this,We).key);l?(g(this,We,null),l.focus({preventScroll:!1})):Date.now()>r(this,We).until&&g(this,We,null)}r(this,Hs)&&(g(this,Hs,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,Di)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,Di,!1)}t||g(this,Di,!0),r(this,Z)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,a=`${i.view}|${i.start}|${i.end}`;a!==r(this,ul)&&(g(this,ul,a),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=P(s(this,f,dl).call(this,r(this,f,mt),-1))}next(){this.date=P(s(this,f,dl).call(this,r(this,f,mt),1))}goToToday(){this.date=r(this,f,ol)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let a=s(this,f,Cs).call(this,i);if(!a)return!1;let l=s(this,f,pt).call(this).map(P),d=t&&a.days.includes(t)&&l.includes(t)?t:a.days.find(v=>l.includes(v));if(!d)return!1;let m=s(this,f,Qp).call(this,a,d);if(!m)return!1;s(this,f,Li).call(this,!1),r(this,xe).cancel(!0),this._more="",g(this,Z,m),i.moving=!0;let u=`ev:${a.key}:${d}`;return g(this,Et,u),g(this,We,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,xe).pickUp(m.from),!0}cancelMove(){let e=r(this,Q);e?.started&&(s(this,f,Li).call(this,!1),r(this,Le).announce(this.t("cancelled",{event:e.ev.name,place:s(this,f,Mr).call(this,e,e.from)}))),r(this,xe).cancel()}moveEvent(e,t,i){let a=typeof e=="string"?this.event(e):e,l=a&&s(this,f,Cs).call(this,a);if(!l)return!1;let d=l.allDay?N(Qe(t).date||t):vt(t);if(!d)return!1;let m=i?l.allDay?N(Qe(i).date||i):vt(i):null;return(!m||m<d)&&(m=l.allDay?G(d,$h(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),s(this,f,ru).call(this,l,d,m,"api",!1,P(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Tr).get(t);if(this.controlled||!i)return!1;r(this,Tr).delete(t);let a=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=s(this,f,Cs).call(this,t);return l&&a&&g(this,We,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Le).announce(this.t("reverted",{event:t.name,place:l?s(this,f,Eh).call(this,l):i.start})),!0}render(){let e=s(this,f,pt).call(this),t=s(this,f,Cf).call(this,s(this,f,_f).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
|
|
2647
|
+
`];$("cm-board",Ms);var Nk=z("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),Ls=class extends S{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};Ls.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},Ls.styles=x`:host { display: none !important; }`;$("cm-calendar-event",Ls);var _h=o=>String(o).padStart(2,"0"),kf=o=>`${P(o)}T${_h(o.getHours())}:${_h(o.getMinutes())}`,$h=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),Ef=["month","week","day"],zy=600,Mf=new Map,Tf=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=Mf.get(e);return t||(t=new Intl.DateTimeFormat(o,n),Mf.set(e,t)),t},Gp=o=>o.replace(/[ ]/g," ").trim(),As,Se,Le,xe,Z,Q,Tr,Et,We,ul,Di,Rs,Hs,Ns,Is,gl,f,Ee,Si,nl,kh,kt,Yp,ol,mt,Xp,zf,pt,Cs,_f,Cf,Ke,ll,cl,Eh,Sf,Lf,Df,Mr,Jp,dl,Af,hl,Rf,Hf,Nf,If,bl,fl,Pf,Of,vl,ml,qf,Zp,Qp,eu,Bf,Ff,tu,iu,ru,yl,au,jf,xl,wl,$l,kl,El,Ml,su,Mh,Uf,Li,pl,Vf,nu,Kf,Th,ou,Ss,zh,Wf,Gf,Yf,Xf,Jf,Ds=class extends T{constructor(){super();p(this,f);this.view="month";this.date="";this.today="";this.step=15;p(this,As,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;p(this,Se,A("cm-cal"));p(this,Le,new wr);p(this,xe);p(this,Z,null);p(this,Q,null);p(this,Tr,new WeakMap);p(this,Et,"");p(this,We,null);p(this,ul,"");p(this,Di,!0);p(this,Rs,0);p(this,Hs,!1);p(this,Ns);p(this,Is,0);p(this,gl,new MutationObserver(()=>this.requestUpdate()));p(this,bl,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Et,t.dataset.k);for(let i of s(this,f,hl).call(this))i.tabIndex=i===t?0:-1}});p(this,fl,e=>{let t=e.relatedTarget;if(this._more&&!r(this,Z)){let i=this.renderRoot.querySelector(".pop"),a=e.composedPath()[0];i&&i.contains(a)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,xe).active||!r(this,Z)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,xe).active||!r(this,Z))return;this.renderRoot.activeElement?.dataset.ev!==r(this,Z).ev.key&&r(this,xe).cancel()}))});p(this,vl,e=>{if(r(this,Q)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=J(e,this);if(r(this,xe).active){r(this,xe).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let a=i.closest(".pop");if(a&&e.key==="Escape"){e.preventDefault(),s(this,f,Th).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,Rs,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(a&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...a.querySelectorAll(".chip")],m=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];m&&(e.preventDefault(),m.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),s(this,f,Of).call(this,i,e.key==="PageUp"?-1:1);return}let l=s(this,f,Pf).call(this,i,t);l?(e.preventDefault(),s(this,f,If).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});p(this,yl,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});p(this,xl,e=>{if(r(this,Q)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(m=>m.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),a=i&&s(this,f,Cs).call(this,i);if(!a||i.locked||i.pending)return;let l=s(this,f,Qp).call(this,a,t.dataset.day??a.days[0]);if(!l)return;r(this,xe).active&&r(this,xe).cancel();let d=0;if(l.mode==="time"){let m=s(this,f,au).call(this,e.clientX,e.clientY);m&&t.classList.contains("time")&&(d=Math.max(0,Math.min(a.dur,m.min-a.min)))}g(this,Q,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,Q).timer=setTimeout(()=>{r(this,Q)&&!r(this,Q).started&&s(this,f,su).call(this)},300)),window.addEventListener("pointermove",r(this,kl),!0),window.addEventListener("pointerup",r(this,El),!0),window.addEventListener("pointercancel",r(this,Ml),!0),window.addEventListener("touchmove",r(this,wl),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,$l),!0)});p(this,wl,e=>{r(this,Q)?.started&&e.cancelable&&e.preventDefault()});p(this,$l,e=>{r(this,Q)&&e.preventDefault()});p(this,kl,e=>{let t=r(this,Q);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?s(this,f,su).call(this):s(this,f,Li).call(this,!1));return}e.preventDefault(),s(this,f,Mh).call(this)}});p(this,El,e=>{let t=r(this,Q);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){s(this,f,Li).call(this,!1);return}let i=a=>{a.stopPropagation(),a.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),s(this,f,Li).call(this,!0)});p(this,Ml,e=>{r(this,Q)&&e.pointerId===r(this,Q).pointerId&&s(this,f,Li).call(this,!1)});g(this,xe,new xr({groupCount:()=>s(this,f,pt).call(this).length,slotCount:()=>r(this,Z)?r(this,Z).mode==="day"?1:s(this,f,ml).call(this,r(this,Z).ev.dur):0,navigate:(e,t)=>s(this,f,qf).call(this,e,t),onTarget:e=>s(this,f,Bf).call(this,e),onDrop:(e,t)=>s(this,f,Ff).call(this,e,t),onCancel:()=>s(this,f,eu).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,Z)?.ev.name??"",place:s(this,f,Mr).call(this,r(this,Z),e)}),over:e=>this.t("over",{place:s(this,f,Mr).call(this,r(this,Z),e)}),cancelled:e=>this.t("cancelled",{event:r(this,Z)?.ev.name??"",place:s(this,f,Mr).call(this,r(this,Z),e)})},announce:e=>r(this,Le).announce(e)}))}get locale(){return r(this,As)}set locale(e){let t=r(this,As);g(this,As,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=s(this,f,pt).call(this);return{view:r(this,f,Ee),start:P(e[0]),end:P(e[e.length-1])}}get heldEvent(){return r(this,Z)?.ev.el??null}get announcement(){return r(this,Le).text}announce(e){r(this,Le).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,vl)),this.addEventListener("focusin",r(this,bl)),this.addEventListener("focusout",r(this,fl)),this.addEventListener("pointerdown",r(this,xl)),this.addEventListener("dragstart",r(this,yl)),r(this,gl).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,Ns,new ResizeObserver(()=>{cancelAnimationFrame(r(this,Is)),g(this,Is,requestAnimationFrame(()=>s(this,f,Jp).call(this)))})),r(this,Ns).observe(this)),s(this,f,Jp).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,vl)),this.removeEventListener("focusin",r(this,bl)),this.removeEventListener("focusout",r(this,fl)),this.removeEventListener("pointerdown",r(this,xl)),this.removeEventListener("dragstart",r(this,yl)),r(this,gl).disconnect(),r(this,Ns)?.disconnect(),cancelAnimationFrame(r(this,Is)),r(this,xe).cancel(!0),s(this,f,Li).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,Di,!0),e.get("view")!==void 0&&(this._more="",r(this,xe).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Le).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,Di,!0),s(this,f,Nf).call(this),r(this,We)){let l=s(this,f,Rf).call(this,r(this,We).key);l?(g(this,We,null),l.focus({preventScroll:!1})):Date.now()>r(this,We).until&&g(this,We,null)}r(this,Hs)&&(g(this,Hs,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,Di)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,Di,!1)}t||g(this,Di,!0),r(this,Z)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,a=`${i.view}|${i.start}|${i.end}`;a!==r(this,ul)&&(g(this,ul,a),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=P(s(this,f,dl).call(this,r(this,f,mt),-1))}next(){this.date=P(s(this,f,dl).call(this,r(this,f,mt),1))}goToToday(){this.date=r(this,f,ol)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let a=s(this,f,Cs).call(this,i);if(!a)return!1;let l=s(this,f,pt).call(this).map(P),d=t&&a.days.includes(t)&&l.includes(t)?t:a.days.find(v=>l.includes(v));if(!d)return!1;let m=s(this,f,Qp).call(this,a,d);if(!m)return!1;s(this,f,Li).call(this,!1),r(this,xe).cancel(!0),this._more="",g(this,Z,m),i.moving=!0;let u=`ev:${a.key}:${d}`;return g(this,Et,u),g(this,We,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,xe).pickUp(m.from),!0}cancelMove(){let e=r(this,Q);e?.started&&(s(this,f,Li).call(this,!1),r(this,Le).announce(this.t("cancelled",{event:e.ev.name,place:s(this,f,Mr).call(this,e,e.from)}))),r(this,xe).cancel()}moveEvent(e,t,i){let a=typeof e=="string"?this.event(e):e,l=a&&s(this,f,Cs).call(this,a);if(!l)return!1;let d=l.allDay?N(Qe(t).date||t):vt(t);if(!d)return!1;let m=i?l.allDay?N(Qe(i).date||i):vt(i):null;return(!m||m<d)&&(m=l.allDay?G(d,$h(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),s(this,f,ru).call(this,l,d,m,"api",!1,P(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Tr).get(t);if(this.controlled||!i)return!1;r(this,Tr).delete(t);let a=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=s(this,f,Cs).call(this,t);return l&&a&&g(this,We,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Le).announce(this.t("reverted",{event:t.name,place:l?s(this,f,Eh).call(this,l):i.start})),!0}render(){let e=s(this,f,pt).call(this),t=s(this,f,Cf).call(this,s(this,f,_f).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
|
|
2646
2648
|
${s(this,f,Wf).call(this,e)}
|
|
2647
2649
|
${r(this,f,Ee)==="month"?s(this,f,Yf).call(this,e,t):s(this,f,Jf).call(this,e,t)}
|
|
2648
2650
|
<span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
|
|
@@ -2886,7 +2888,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2886
2888
|
.chip.time > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2887
2889
|
.chip.time .lead { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
|
2888
2890
|
.ph.time { position: absolute; z-index: 3; inset-inline: 0 2px; inset-block-start: calc(var(--top) * var(--h)); height: calc(var(--len) * var(--h)); align-items: flex-start; }
|
|
2889
|
-
`];$("cm-calendar",Ds);var
|
|
2891
|
+
`];$("cm-calendar",Ds);var Fk=z("reportTile",{pinned:", pinned"}),zr=class extends T{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
|
|
2890
2892
|
<span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="40"></cm-icon></slot></span>
|
|
2891
2893
|
<span class="label">${this.label}</span>
|
|
2892
2894
|
${this.pinned?c`<span class="pin" part="pin"><cm-icon name="pin" size="16"></cm-icon>
|
|
@@ -2923,7 +2925,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2923
2925
|
.title { margin-bottom: var(--cm-space-8); }
|
|
2924
2926
|
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-8); }
|
|
2925
2927
|
}
|
|
2926
|
-
`];$("cm-report-tiles",Ps);var
|
|
2928
|
+
`];$("cm-report-tiles",Ps);var Wk=z("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Zf=/^\s*-?\d+(\.\d+)?\s*$/,Os=class extends T{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:Zf.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 h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),a=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
|
|
2927
2929
|
<cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${a}</span>
|
|
2928
2930
|
</span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?c`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),a=i!==h||e,l=c`
|
|
2929
2931
|
<span class="label" id="label" part="label">${this.label}</span>
|
|
@@ -2968,7 +2970,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2968
2970
|
.value { font-size: var(--cm-type-heading-lg-resp-size); }
|
|
2969
2971
|
}
|
|
2970
2972
|
@media (forced-colors: active) { .change { color: CanvasText; } }
|
|
2971
|
-
`];$("cm-metric",Os);var qs=class extends S{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 Qf(this)}};qs.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}},qs.styles=x`:host { display: none !important; }`;$("cm-nav-item",qs);function Qf(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Yt(o);return t.length&&(e.items=t),e}var Yt=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(Qf),lu=o=>o.value||o.href||o.label,Ch=o=>!!o.current||!!o.items?.some(Ch),Ai=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},Ri=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:lu(n),href:n.href??""}}));var
|
|
2973
|
+
`];$("cm-metric",Os);var qs=class extends S{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 Qf(this)}};qs.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}},qs.styles=x`:host { display: none !important; }`;$("cm-nav-item",qs);function Qf(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Yt(o);return t.length&&(e.items=t),e}var Yt=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(Qf),lu=o=>o.value||o.href||o.label,Ch=o=>!!o.current||!!o.items?.some(Ch),Ai=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},Ri=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:lu(n),href:n.href??""}}));var iE=z("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Tl,zl,Dh,j,cu,Sh,du,ev,tv,hu,mu,iv,pu,uu,Lh,gu,rv,Bs=class extends T{constructor(){super(...arguments);p(this,j);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;p(this,Tl,new Set);p(this,zl);p(this,Dh,A("cm-sidenav"))}connectedCallback(){super.connectedCallback(),s(this,j,cu).call(this),g(this,zl,Ai(this,()=>s(this,j,cu).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,zl)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=s(this,j,Sh).call(this,e,t);r(this,Tl).has(i)||!e.items?.length||(r(this,Tl).add(i),(e.expanded||Ch(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let a=s(this,j,Sh).call(this,i,e),l=t??!this._open.has(a);if(l===this._open.has(a))return;let d=new Set(this._open);l?d.add(a):d.delete(a),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
|
|
2972
2974
|
<nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${s(this,j,tv)}>
|
|
2973
2975
|
<slot name="header"></slot>
|
|
2974
2976
|
<ul part="list">
|
|
@@ -2987,7 +2989,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
2987
2989
|
<slot name="footer"></slot>
|
|
2988
2990
|
<slot hidden></slot>
|
|
2989
2991
|
</nav>
|
|
2990
|
-
`}};Tl=new WeakMap,zl=new WeakMap,Dh=new WeakMap,j=new WeakSet,cu=function(){this._slotted=Yt(this)},Sh=function(e,t){return`${t}:${lu(e)}`},du=function(e,t){Ri(this,t)||e.preventDefault()},ev=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},tv=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=s(this,j,ev).call(this),a=i.indexOf(t),l=Number(t.dataset.index),d=J(e,this),m;if(e.key==="ArrowDown")m=i[(a+1)%i.length];else if(e.key==="ArrowUp")m=i[(a-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&&(d==="ArrowRight"||d==="ArrowLeft"))return;if(d==="ArrowRight"&&t.classList.contains("parent")){this.toggle(l,!0),e.preventDefault();return}else if(d==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(l,!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()},hu=function(e,t=0){return e.flatMap(i=>[[i,t],...s(this,j,hu).call(this,i.items??[],t+1)])},mu=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},iv=function(e){
|
|
2992
|
+
`}};Tl=new WeakMap,zl=new WeakMap,Dh=new WeakMap,j=new WeakSet,cu=function(){this._slotted=Yt(this)},Sh=function(e,t){return`${t}:${lu(e)}`},du=function(e,t){Ri(this,t)||e.preventDefault()},ev=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},tv=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=s(this,j,ev).call(this),a=i.indexOf(t),l=Number(t.dataset.index),d=J(e,this),m;if(e.key==="ArrowDown")m=i[(a+1)%i.length];else if(e.key==="ArrowUp")m=i[(a-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&&(d==="ArrowRight"||d==="ArrowLeft"))return;if(d==="ArrowRight"&&t.classList.contains("parent")){this.toggle(l,!0),e.preventDefault();return}else if(d==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(l,!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()},hu=function(e,t=0){return e.flatMap(i=>[[i,t],...s(this,j,hu).call(this,i.items??[],t+1)])},mu=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},iv=function(e){s(this,j,mu).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},pu=function(e){return e.icon?c`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?c`<span class="initial" aria-hidden="true">${([...e.label.trim()][0]??"").toLocaleUpperCase(this.locale)}</span>`:h},uu=function(e){if(!this.collapsed)return c`<span class="label">${e.label}</span>${e.badge?c`<span class="badge">${e.badge}</span>`:h}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return c`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?c`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:h}</span>`:h}`},Lh=function(e,t){return this.collapsed?c`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},gu=function(e,t,i={}){let a=c`${s(this,j,pu).call(this,e)}${s(this,j,uu).call(this,e)}`;return s(this,j,Lh).call(this,e,e.href?c`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":h}
|
|
2991
2993
|
data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>s(this,j,du).call(this,l,e)}>${a}</a>`:c`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":h}
|
|
2992
2994
|
data-index=${i.index??h} data-parent=${i.parent??h} @click=${l=>s(this,j,du).call(this,l,e)}>${a}</button>`)},rv=function(){if(!this.collapsible)return h;let e=this.t(this.collapsed?"expand":"collapse"),t=c`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?c`<span class="sr">${e}</span>`:c`<span class="label">${e}</span>`}`;return c`<div class="toggle-row">${s(this,j,Lh).call(this,{label:e},c`<button type="button" class="item toggle" part="collapse-button"
|
|
2993
2995
|
@click=${()=>s(this,j,mu).call(this,!this.collapsed)}>${t}</button>`)}</div>`},Bs.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},Bs.styles=[k,x`
|
|
@@ -3048,7 +3050,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
3048
3050
|
.icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
|
|
3049
3051
|
img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
|
|
3050
3052
|
@media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
|
|
3051
|
-
`];$("cm-avatar",Fs);var
|
|
3053
|
+
`];$("cm-avatar",Fs);var mE=z("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),Vs,Xt,Ks,Me,_l,bu,js,Us=class extends T{constructor(){super();p(this,Me);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;p(this,Vs);p(this,Xt,!1);p(this,Ks,null);this.addEventListener("cm-select",e=>{let t=s(this,Me,_l).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){s(this,Me,_l).call(this)?.focus();return}this._searchOpen||(g(this,Ks,_m()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,Vs,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,Vs).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Vs)?.disconnect(),r(this,Xt)&&(go(),g(this,Xt,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,Xt)||(zm(),g(this,Xt,!0)),s(this,Me,_l).call(this)?.focus(),s(this,Me,js).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,Xt)&&(go(),g(this,Xt,!1));let i=r(this,Ks)??this.renderRoot.querySelector(".search-btn");g(this,Ks,null),i?.isConnected&&i.focus(),s(this,Me,js).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
|
|
3052
3054
|
<header part="bar" role="banner" aria-label=${this.label||h}>
|
|
3053
3055
|
<div class="logo"><slot name="logo"></slot></div>
|
|
3054
3056
|
${this.store?c`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
|
|
@@ -3152,7 +3154,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
3152
3154
|
@media (pointer: coarse) {
|
|
3153
3155
|
@container (max-width: 640px) { .user { min-width: var(--_touch); } }
|
|
3154
3156
|
}
|
|
3155
|
-
`];$("cm-header-bar",Us);var
|
|
3157
|
+
`];$("cm-header-bar",Us);var yE=z("bottomNavigation",{label:"Main"}),Cl,_r,fu,sv,Ws=class extends T{constructor(){super(...arguments);p(this,_r);this.items=[];this.fixed=!1;this._slotted=[];p(this,Cl)}connectedCallback(){super.connectedCallback(),s(this,_r,fu).call(this),g(this,Cl,Ai(this,()=>s(this,_r,fu).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Cl)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
3156
3158
|
<ul>${this.navItems.slice(0,5).map(e=>c`<li>${s(this,_r,sv).call(this,e)}</li>`)}</ul>
|
|
3157
3159
|
<slot hidden></slot>
|
|
3158
3160
|
</nav>`}};Cl=new WeakMap,_r=new WeakSet,fu=function(){this._slotted=Yt(this)},sv=function(e){let t=`item ${e.primary?"primary":""}`,i=c`<span class="icon">${e.icon?c`<cm-icon name=${e.icon} size=${e.primary?16:20}></cm-icon>`:h}</span><span class="label">${e.label}</span>`,a=l=>{Ri(this,e)||l.preventDefault()};return e.href?c`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":h} @click=${a}>${i}</a>`:c`<button type="button" class=${t} part="item" aria-current=${e.current?"page":h} @click=${a}>${i}</button>`},Ws.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},Ws.styles=[k,x`
|
|
@@ -3177,7 +3179,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
3177
3179
|
.icon { display: grid; place-items: center; width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
|
|
3178
3180
|
.primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
|
|
3179
3181
|
.label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3180
|
-
`];$("cm-bottom-navigation",Ws);var
|
|
3182
|
+
`];$("cm-bottom-navigation",Ws);var TE=z("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Sl,Cr,De,vu,nv,yu,xu,ov,Gs=class extends T{constructor(){super(...arguments);p(this,De);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;p(this,Sl);p(this,Cr,A("cm-mmenu"))}connectedCallback(){super.connectedCallback(),s(this,De,vu).call(this),g(this,Sl,Ai(this,()=>s(this,De,vu).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Sl)?.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?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Cr)}-sub"
|
|
3181
3183
|
@keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
|
|
3182
3184
|
<button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="16"></cm-icon>
|
|
3183
3185
|
${t.label}</button>
|
|
@@ -3239,7 +3241,7 @@ ${t.label}</button>
|
|
|
3239
3241
|
}
|
|
3240
3242
|
.back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
3241
3243
|
.sub .row { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
|
|
3242
|
-
`];$("cm-mobile-menu",Gs);var
|
|
3244
|
+
`];$("cm-mobile-menu",Gs);var DE=z("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Ah,lv,Ys=class extends T{constructor(){super(...arguments);p(this,Ah);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
|
|
3243
3245
|
<span class="icon" aria-hidden="true"><slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h}</slot></span>
|
|
3244
3246
|
<span class="text"><slot></slot></span>
|
|
3245
3247
|
${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${s(this,Ah,lv)}><cm-icon name="close" size="16"></cm-icon>
|
|
@@ -3266,7 +3268,7 @@ ${t.label}</button>
|
|
|
3266
3268
|
@media (max-width: 640px) {
|
|
3267
3269
|
.bar { min-height: 44px; justify-content: flex-start; text-align: start; }
|
|
3268
3270
|
}
|
|
3269
|
-
`];$("cm-flash-offer-bar",Ys);var
|
|
3271
|
+
`];$("cm-flash-offer-bar",Ys);var OE=z("linkTabs",{label:"Sections"}),Ll,Dl,wu,Xs=class extends T{constructor(){super(...arguments);p(this,Dl);this.items=[];this._slotted=[];p(this,Ll)}connectedCallback(){super.connectedCallback(),s(this,Dl,wu).call(this),g(this,Ll,Ai(this,()=>s(this,Dl,wu).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Ll)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
|
|
3270
3272
|
<ul part="tabs">${this.tabs.map(e=>c`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":h}
|
|
3271
3273
|
@click=${t=>{Ri(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
|
|
3272
3274
|
<slot hidden></slot>
|
|
@@ -3289,7 +3291,7 @@ ${t.label}</button>
|
|
|
3289
3291
|
.badge { font-size: var(--cm-font-size-12); color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
|
|
3290
3292
|
@media (max-width: 640px) { ul { gap: var(--cm-space-16); } }
|
|
3291
3293
|
|
|
3292
|
-
`];$("cm-link-tabs",Xs);var
|
|
3294
|
+
`];$("cm-link-tabs",Xs);var VE=z("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}"}),Js=class extends T{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}):"",a=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
|
|
3293
3295
|
<div class="logo" part="logo"><slot name="logo"></slot></div>
|
|
3294
3296
|
<div class="status"><slot name="status"></slot></div>
|
|
3295
3297
|
<div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
|
|
@@ -3370,7 +3372,7 @@ ${t.label}</button>
|
|
|
3370
3372
|
.panel { border-radius: var(--cm-radius-lg); }
|
|
3371
3373
|
|
|
3372
3374
|
}
|
|
3373
|
-
`];$("cm-side-panel",Mt);var
|
|
3375
|
+
`];$("cm-side-panel",Mt);var oM=z("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),en,Nh,Qs=class extends Mt{constructor(){super(...arguments);this.search=!1;this.query="";p(this,en,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});p(this,Nh,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(a,l)=>{if(l==="")return;let d=e[a];e[a]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[a,l]of new FormData(i))typeof l=="string"&&t(a,l);return e}return this.querySelectorAll("[name]").forEach(a=>{let l=a.getAttribute("name");"checked"in a&&(a.type==="checkbox"||a.type==="radio"||a.localName.match(/^cm-(checkbox|radio|toggle)$/))?a.checked&&t(l,a.value||"on"):typeof a.value=="string"&&t(l,a.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
|
|
3374
3376
|
placeholder=${this.searchPlaceholder}
|
|
3375
3377
|
@input=${e=>{this.query=e.target.value}}
|
|
3376
3378
|
@cm-search=${e=>{e.stopPropagation(),r(this,en).call(this)}}></cm-search>`:h}
|
|
@@ -3423,7 +3425,7 @@ ${t.label}</button>
|
|
|
3423
3425
|
}
|
|
3424
3426
|
@keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
3425
3427
|
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
3426
|
-
`];$("cm-bottom-sheet",tn);var
|
|
3428
|
+
`];$("cm-bottom-sheet",tn);var xM=z("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),_y={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},rn=class extends S{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};rn.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},rn.styles=x`:host { display: none; }`;$("cm-notification-item",rn);var sn,Ie,ku,Eu,mv,pv,uv,an=class extends ee{constructor(){super(...arguments);p(this,Ie);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;p(this,sn)}connectedCallback(){super.connectedCallback(),s(this,Ie,ku).call(this),g(this,sn,new MutationObserver(()=>s(this,Ie,ku).call(this))),r(this,sn).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,sn)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(a=>a.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${s(this,Ie,pv)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
|
|
3427
3429
|
<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?c`<ul class="list" part="list">${e.map(a=>c`<li>${s(this,Ie,mv).call(this,a)}</li>`)}</ul>`:c`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
|
|
3428
3430
|
${this.renderHeader(t)}
|
|
3429
3431
|
${i}
|
|
@@ -3483,7 +3485,7 @@ ${t.label}</button>
|
|
|
3483
3485
|
@media (max-width: 599px) {
|
|
3484
3486
|
dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
|
|
3485
3487
|
}
|
|
3486
|
-
`];$("cm-notification-panel",an);var
|
|
3488
|
+
`];$("cm-notification-panel",an);var TM=z("toastRegion",{label:"Notifications"}),zM=z("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),gv=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},Mu=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},Cy=2e3,bv=1e4,fv=150,Rl,ut,Jt,Hl,cn,dn,Lr,Hi,Dr,pe,Ih,vv,nn,Tu,Nl,Il,Pl,Ol,yv,on=class extends T{constructor(){super(...arguments);p(this,pe);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;p(this,Rl);p(this,ut);p(this,Jt,0);p(this,Hl,0);p(this,cn,!1);p(this,dn,!1);p(this,Lr);p(this,Hi);p(this,Dr);p(this,Nl,()=>{g(this,cn,!0),s(this,pe,Tu).call(this)});p(this,Il,()=>{g(this,cn,!1),s(this,pe,nn).call(this)});p(this,Pl,()=>{g(this,dn,!0),s(this,pe,Tu).call(this)});p(this,Ol,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,dn,!1),s(this,pe,nn).call(this))})}get closed(){if(!r(this,Lr)){if(!this.open&&r(this,Dr))return Promise.resolve(r(this,Dr));g(this,Lr,new Promise(e=>{g(this,Hi,e)}))}return r(this,Lr)}get effectiveDuration(){let e=this.duration??(this.actionLabel?bv:5e3);return Math.min(bv,Math.max(Cy,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,Rl,setTimeout(()=>{this._primed=!0},fv)),this.addEventListener("pointerenter",r(this,Nl)),this.addEventListener("pointerleave",r(this,Il)),this.addEventListener("focusin",r(this,Pl)),this.addEventListener("focusout",r(this,Ol))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,Hi)&&queueMicrotask(()=>{!this.isConnected&&this.open&&s(this,pe,Ih).call(this,"removed")}),clearTimeout(r(this,ut)),clearTimeout(r(this,Rl)),this.removeEventListener("pointerenter",r(this,Nl)),this.removeEventListener("pointerleave",r(this,Il)),this.removeEventListener("focusin",r(this,Pl)),this.removeEventListener("focusout",r(this,Ol))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Dr,void 0):r(this,Hi)&&s(this,pe,Ih).call(this,"close")),(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,ut)),this.open&&(this._inRegion||this._primed)&&(g(this,Jt,this.effectiveDuration),s(this,pe,nn).call(this)))}show(){this.open?(g(this,Jt,this.effectiveDuration),s(this,pe,nn).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(r(this,ut)),this.open=!1,s(this,pe,Ih).call(this,e),!0):(e==="timeout"&&(g(this,Jt,this.effectiveDuration),s(this,pe,nn).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
|
|
3487
3489
|
${this.tone==="critical"?c`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:h}
|
|
3488
3490
|
<div class="message" part="message">${this.message}<slot></slot></div>
|
|
3489
3491
|
${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${s(this,pe,yv)}>${this.actionLabel}</button>`:h}
|
|
@@ -3529,7 +3531,7 @@ ${t.label}</button>
|
|
|
3529
3531
|
display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-8);
|
|
3530
3532
|
padding-inline: var(--cm-space-12); pointer-events: none;
|
|
3531
3533
|
}
|
|
3532
|
-
`];$("cm-toast-region",ln);function xv(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let a=document.createElement("cm-toast");if(a.message=String(o),n.tone&&(a.tone=n.tone),n.duration!==void 0&&(a.duration=n.duration),n.action){a.actionLabel=n.action.label;let l=n.action.onAction;a.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(a),fv),a}return t.add(a)}async function Sy(o,n,e){await o();let{message:t,undoLabel:i,...a}=e,l=i??mc("toast","undo",void 0,a.root??document.body),d=await xv(t,{...a,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var
|
|
3534
|
+
`];$("cm-toast-region",ln);function xv(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let a=document.createElement("cm-toast");if(a.message=String(o),n.tone&&(a.tone=n.tone),n.duration!==void 0&&(a.duration=n.duration),n.action){a.actionLabel=n.action.label;let l=n.action.onAction;a.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(a),fv),a}return t.add(a)}async function Sy(o,n,e){await o();let{message:t,undoLabel:i,...a}=e,l=i??mc("toast","undo",void 0,a.root??document.body),d=await xv(t,{...a,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var AM=z("progressBar",{inProgress:"In progress"}),Oh,mn=class extends T{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";p(this,Oh,A("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=`${r(this,Oh)}-label`;return c`
|
|
3533
3535
|
<div class="head ${this.labelHidden?"vh":""}">
|
|
3534
3536
|
<span id=${t} part="label">${this.label}</span>
|
|
3535
3537
|
${this.showValue&&e!==null?c`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:h}
|
|
@@ -3767,7 +3769,7 @@ ${t.label}</button>
|
|
|
3767
3769
|
border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
|
|
3768
3770
|
}
|
|
3769
3771
|
.close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
3770
|
-
`];$("cm-banner",Mn);var
|
|
3772
|
+
`];$("cm-banner",Mn);var T2=z("thumbnail",{noImage:"{alt} (no image)"}),zn=class extends T{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 c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
|
|
3771
3773
|
@error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return c`<span class="box" part="thumbnail" role=${this.alt?"img":h}
|
|
3772
3774
|
aria-label=${this.alt?this.t("noImage",{alt:this.alt}):h} aria-hidden=${this.alt?h:"true"}>
|
|
3773
3775
|
<cm-icon name="box" size=${e}></cm-icon></span>`}};zn.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},zn.styles=[k,x`
|
package/dist/components/board.js
CHANGED
|
@@ -56,7 +56,6 @@ const boardStrings = defineStrings('board', {
|
|
|
56
56
|
/** Announced when a move fails and the card goes back (`revert()`, or a rejected `waitUntil()` promise). `{column}` is where it went back to. */
|
|
57
57
|
reverted: 'Couldn\'t move {card}. It is back in {column}.',
|
|
58
58
|
});
|
|
59
|
-
const INTERACTIVE = 'a[href], button, input, select, textarea, label, summary, [contenteditable], [tabindex]:not([tabindex="-1"]), cm-button, cm-action-menu, cm-checkbox, cm-toggle, cm-select';
|
|
60
59
|
const NO_DRAG = 'input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]';
|
|
61
60
|
/**
|
|
62
61
|
* One record on a `cm-board`: a title (`heading`, or a link in the `heading` slot), secondary lines, badges and an
|
|
@@ -72,7 +72,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
|
|
|
72
72
|
cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'], cm-data-table > table [data-type='date'] { white-space: nowrap; }
|
|
73
73
|
cm-data-table > table [data-type='actions'] { width: 1%; white-space: nowrap; }
|
|
74
74
|
cm-data-table > table td [data-lines] { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
|
|
75
|
-
cm-data-table > table td [data-lines='1'] { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; max-inline-size: var(--cm-data-table-cell-max-width, 320px); }
|
|
75
|
+
cm-data-table > table td [data-lines='1'] { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; max-inline-size: min(var(--cm-data-table-cell-max-width, 320px), 100%); }
|
|
76
76
|
cm-data-table > table td [data-lines='3'] { -webkit-line-clamp: 3; line-clamp: 3; }
|
|
77
77
|
cm-data-table > table td [data-lines='4'] { -webkit-line-clamp: 4; line-clamp: 4; }
|
|
78
78
|
cm-data-table > table tbody td[data-type='actions'] { padding-block: 0; }
|
|
@@ -90,6 +90,8 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
90
90
|
cm-data-table[mobile='cards'] > table tr { display: block; margin-block-end: var(--cm-space-8); padding: var(--cm-space-12) var(--cm-space-16); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
|
|
91
91
|
cm-data-table[mobile='cards'] > table tr > * { display: flex; justify-content: space-between; gap: var(--cm-space-12); height: auto; padding: var(--cm-space-4) 0; border: 0; background: none; text-align: end; white-space: normal; }
|
|
92
92
|
cm-data-table[mobile='cards'] > table tbody tr:hover > * { background: none; }
|
|
93
|
+
/* The value side of a card row may shrink, so one-line [data-lines] items end in "…" inside the card (CRM 1.7.1). */
|
|
94
|
+
cm-data-table[mobile='cards'] > table tr > * > * { min-inline-size: 0; max-inline-size: 100%; box-sizing: border-box; }
|
|
93
95
|
cm-data-table[mobile='cards'] > table tr > :first-child { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 600; text-align: start; }
|
|
94
96
|
cm-data-table[mobile='cards'] > table tr > :not(:first-child)[data-label]::before { content: attr(data-label); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); text-align: start; font-weight: 400; }
|
|
95
97
|
cm-data-table[mobile='cards'] > table td[data-type='actions'] { justify-content: flex-start; flex-wrap: wrap; padding-block-start: var(--cm-space-8); }
|
|
@@ -93,7 +93,10 @@ export class CmSideNavigation extends CmLocalizedElement {
|
|
|
93
93
|
if (next === this._open.has(k))
|
|
94
94
|
return;
|
|
95
95
|
const s = new Set(this._open);
|
|
96
|
-
|
|
96
|
+
if (next)
|
|
97
|
+
s.add(k);
|
|
98
|
+
else
|
|
99
|
+
s.delete(k);
|
|
97
100
|
this._open = s;
|
|
98
101
|
this.dispatchEvent(new CustomEvent('cm-expand', { bubbles: true, composed: true, detail: { item: it, expanded: next } }));
|
|
99
102
|
}
|
|
@@ -180,7 +183,6 @@ _CmSideNavigation_seen = new WeakMap(), _CmSideNavigation_observer = new WeakMap
|
|
|
180
183
|
this.collapsed = next;
|
|
181
184
|
return ok;
|
|
182
185
|
}, _CmSideNavigation_openFromRail = function _CmSideNavigation_openFromRail(i) {
|
|
183
|
-
const it = this.navItems[i];
|
|
184
186
|
if (!__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_setCollapsed).call(this, false))
|
|
185
187
|
return;
|
|
186
188
|
this.toggle(i, true);
|
|
@@ -226,8 +226,8 @@ export class CmSignatureField extends CmLocalizedElement {
|
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
228
228
|
const img = new Image();
|
|
229
|
-
img.
|
|
230
|
-
__classPrivateFieldGet(this, _CmSignatureField_instances, "m", _CmSignatureField_draw).call(this); };
|
|
229
|
+
img.addEventListener('load', () => { if (__classPrivateFieldGet(this, _CmSignatureField_image, "f") === img)
|
|
230
|
+
__classPrivateFieldGet(this, _CmSignatureField_instances, "m", _CmSignatureField_draw).call(this); });
|
|
231
231
|
img.src = v;
|
|
232
232
|
__classPrivateFieldSet(this, _CmSignatureField_image, img, "f");
|
|
233
233
|
this.mode = 'draw';
|
|
@@ -169,8 +169,8 @@ _CmTextField_internals = new WeakMap(), _CmTextField_id = new WeakMap(), _CmText
|
|
|
169
169
|
const probe = document.createElement('input');
|
|
170
170
|
probe.type = this.type;
|
|
171
171
|
probe.value = this.min ?? '';
|
|
172
|
-
const
|
|
173
|
-
const lower =
|
|
172
|
+
const origin = Number.isFinite(probe.valueAsNumber) ? probe.valueAsNumber : 0;
|
|
173
|
+
const lower = origin + Math.floor((v - origin) / step) * step;
|
|
174
174
|
const show = (n) => {
|
|
175
175
|
if (this.type === 'number')
|
|
176
176
|
return this.formatNumber(Number(n.toPrecision(12)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Commmerce UI web components: build apps that feel native to the Commmerce admin. Works in plain HTML, React, Vue and server-rendered pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"test": "vitest run"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@commmerce/icons": "1.
|
|
54
|
-
"@commmerce/tokens": "1.
|
|
53
|
+
"@commmerce/icons": "1.8.0",
|
|
54
|
+
"@commmerce/tokens": "1.8.0",
|
|
55
55
|
"lit": "3.2.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|