@commmerce/ui 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn.js +26 -16
- package/dist/components/app-frame.js +1 -1
- package/dist/components/layout.d.ts +7 -2
- package/dist/components/layout.js +15 -0
- package/dist/components/page-header.d.ts +2 -0
- package/dist/components/page-header.js +3 -1
- package/dist/custom-elements.json +13 -7
- package/package.json +3 -3
package/dist/cdn.js
CHANGED
|
@@ -1095,7 +1095,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1095
1095
|
@media (max-width: 640px) {
|
|
1096
1096
|
.label { font-size: var(--cm-type-heading-sm-resp-size); }
|
|
1097
1097
|
}
|
|
1098
|
-
`];$("cm-file-upload",yi);var
|
|
1098
|
+
`];$("cm-file-upload",yi);var e1=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"}),cy=[{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 dy=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 hy(o){let n=dy(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var Fe,yt,To,Da,Y,nr,Jm,Gg,Yg,Zm,Xg,Jg,Zg,Qg,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}]:[]}):cy.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">
|
|
1099
1099
|
${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}
|
|
1100
1100
|
${e.length?c`<div class="swatches" part="swatches" role="radiogroup"
|
|
1101
1101
|
aria-labelledby=${this.label?`${r(this,yt)}-l`:h} aria-label=${!this.label&&d?d:h}
|
|
@@ -1160,7 +1160,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1160
1160
|
.input:disabled { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
|
|
1161
1161
|
:host([disabled]) .pick { cursor: not-allowed; opacity: 0.4; }
|
|
1162
1162
|
:host([disabled]) .preview { opacity: 0.4; }
|
|
1163
|
-
`];$("cm-color-field",xi);var
|
|
1163
|
+
`];$("cm-color-field",xi);var o1=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,my=.0055,jd="#000000",eb=8,zo=2,py=400,uy=(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,tb,ap,Kd,sp,Wd,ib,np,rb,or,Gd,op,lp,ab,cp,sb,dp,nb,ob,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}"
|
|
1164
1164
|
aria-selected=${this.mode===u?"true":"false"} aria-controls="${e}-panel-${u}"
|
|
1165
1165
|
tabindex=${this.mode===u?"0":"-1"} ?disabled=${this.disabled}
|
|
1166
1166
|
@click=${()=>s(this,C,lp).call(this,u,!0)} @keydown=${s(this,C,ab)}>${this.t(u)}</button>`;return c`<div class="field">
|
|
@@ -1266,7 +1266,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1266
1266
|
@media (pointer: coarse) { .act, .tab { min-height: var(--cm-control-height-touch); } }
|
|
1267
1267
|
|
|
1268
1268
|
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1269
|
-
`];function gy(o,n,e){let t=d=>e*my*(.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=uy(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 by(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 fy(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
|
|
1269
|
+
`];function gy(o,n,e){let t=d=>e*my*(.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=uy(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 by(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 fy(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 p1=z("optionGroup",{required:"Please select one of these options."}),ct,Lo,Ha,Do,wt,hp,mp,lb,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`
|
|
1270
1270
|
${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}
|
|
1271
1271
|
<div class="options" part="options" role="radiogroup"
|
|
1272
1272
|
aria-labelledby=${this.label?`${r(this,Lo)}-l`:h} aria-label=${!this.label&&a?a:h}
|
|
@@ -1308,7 +1308,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1308
1308
|
}
|
|
1309
1309
|
slot { display: none; }
|
|
1310
1310
|
@media (pointer: coarse) { button { min-height: var(--cm-control-height-touch, 44px); } }
|
|
1311
|
-
`];$("cm-option-group",xt);var
|
|
1311
|
+
`];$("cm-option-group",xt);var x1=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`
|
|
1312
1312
|
:host { display: inline-block; vertical-align: middle; max-width: 100%; --_h: var(--cm-control-height-md, 36px); }
|
|
1313
1313
|
:host([size='small']) { --_h: var(--cm-control-height-sm, 32px); }
|
|
1314
1314
|
@media (pointer: coarse) { :host, :host([size='small']) { --_h: var(--cm-control-height-touch, 44px); } }
|
|
@@ -1338,7 +1338,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1338
1338
|
button[aria-checked='true']:disabled { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
1339
1339
|
:host([disabled]) .options { background: var(--cm-bg-input-filled); }
|
|
1340
1340
|
slot { display: none; }
|
|
1341
|
-
`];$("cm-segmented-control",Na);var
|
|
1341
|
+
`];$("cm-segmented-control",Na);var M1=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">
|
|
1342
1342
|
<div class=${this.description?"lead described":"lead"}>
|
|
1343
1343
|
${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}
|
|
1344
1344
|
<div class="titles">
|
|
@@ -1362,7 +1362,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1362
1362
|
header {
|
|
1363
1363
|
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-12) var(--cm-space-20);
|
|
1364
1364
|
min-height: 64px; padding: var(--cm-space-12) var(--cm-space-24);
|
|
1365
|
-
background: var(--cm-bg-surface); border-bottom: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
1365
|
+
background: var(--cm-page-header-background, var(--cm-bg-surface)); border-bottom: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
1366
1366
|
}
|
|
1367
1367
|
.lead { flex: 1 1 280px; display: flex; align-items: center; gap: var(--cm-space-8); min-width: 0; }
|
|
1368
1368
|
/* flex: 1 (issue #32): the titles column takes the room the lead has, so a title-adornment badge sits beside the
|
|
@@ -1414,7 +1414,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1414
1414
|
h1 { font-size: var(--cm-type-heading-lg-resp-size); line-height: var(--cm-type-heading-lg-resp-line-height); }
|
|
1415
1415
|
.actions { gap: var(--cm-space-8); }
|
|
1416
1416
|
}
|
|
1417
|
-
`];$("cm-page-header",Ia);var
|
|
1417
|
+
`];$("cm-page-header",Ia);var L1=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")}>
|
|
1418
1418
|
<div class="lead">
|
|
1419
1419
|
${e?c`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:h}
|
|
1420
1420
|
<div class="text">
|
|
@@ -1455,7 +1455,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1455
1455
|
|
|
1456
1456
|
.actions { gap: var(--cm-space-8); }
|
|
1457
1457
|
}
|
|
1458
|
-
`];$("cm-action-bar",Pa);var
|
|
1458
|
+
`];$("cm-action-bar",Pa);var N1=z("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),$t,lr,Ro,_e,up,gp,bp,cb,db,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}>
|
|
1459
1459
|
<p class="message" part="message" role="status">${this.open?this.message:""}</p>
|
|
1460
1460
|
<div class="actions">
|
|
1461
1461
|
<cm-button size="large" ?disabled=${this.loading} @click=${s(this,_e,db)}>${this.discardLabel}</cm-button>
|
|
@@ -1665,7 +1665,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1665
1665
|
.body { grid-template-columns: minmax(0, 1fr); }
|
|
1666
1666
|
.head { height: 60px; }
|
|
1667
1667
|
}
|
|
1668
|
-
`];$("cm-skeleton-display",Va);var
|
|
1668
|
+
`];$("cm-skeleton-display",Va);var n$=z("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Yd,pb,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,pb).call(this);return c`<article part="comment">
|
|
1669
1669
|
${e?c`<time class="meta" part="time" datetime=${this.datetime||h}>${e}</time>`:h}
|
|
1670
1670
|
<div class="body" part="body"><slot></slot></div>
|
|
1671
1671
|
${this.author?c`<div class="meta" part="author">– ${this.author}</div>`:h}
|
|
@@ -1724,7 +1724,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1724
1724
|
:host([open]) .tip { opacity: 1; visibility: visible; transition: opacity var(--cm-duration-fast) var(--cm-easing-standard); }
|
|
1725
1725
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
1726
1726
|
@media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
|
|
1727
|
-
`];$("cm-tooltip",Ga);var
|
|
1727
|
+
`];$("cm-tooltip",Ga);var b$=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"}),f$=z("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),xy=7,No=new Set,Io;function bb(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,fb,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(),bb(this,!0)}disconnectedCallback(){super.disconnectedCallback(),bb(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<xy?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">
|
|
1728
1728
|
<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>
|
|
1729
1729
|
<div class="main">
|
|
1730
1730
|
<div class="head">
|
|
@@ -1816,7 +1816,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1816
1816
|
@media (max-width: 640px) {
|
|
1817
1817
|
.more { padding-inline-start: 0; }
|
|
1818
1818
|
}
|
|
1819
|
-
`];$("cm-timeline",mr);var
|
|
1819
|
+
`];$("cm-timeline",mr);var k$=z("smartTip",{newTab:"(opens in a new tab)"}),E$=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}>
|
|
1820
1820
|
<span class="text">
|
|
1821
1821
|
<span class="title" part="heading">${this.heading}</span>
|
|
1822
1822
|
<span class="desc" part="description"><slot></slot></span>
|
|
@@ -1868,7 +1868,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1868
1868
|
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;
|
|
1869
1869
|
}
|
|
1870
1870
|
.list { display: flex; flex-direction: column; gap: var(--cm-space-8); }
|
|
1871
|
-
`];$("cm-smart-tips",is);var
|
|
1871
|
+
`];$("cm-smart-tips",is);var C$=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,yb,xb,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`
|
|
1872
1872
|
<nav part="bar" aria-label=${this.label}>
|
|
1873
1873
|
${l.length?c`<div class="rows" part="rows">
|
|
1874
1874
|
<label for="${r(this,Wt)}-s">${this.t("rows")}</label>
|
|
@@ -1938,7 +1938,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
1938
1938
|
select, input { height: var(--cm-control-height-touch); }
|
|
1939
1939
|
button { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
|
|
1940
1940
|
}
|
|
1941
|
-
`];$("cm-pagination",rs);var
|
|
1941
|
+
`];$("cm-pagination",rs);var H$=z("statusTabs",{label:"Status",option:"{label} ({count})"}),ns,Bo,me,qo,wb,kp,$b,Ep,kb,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,$b).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
|
|
1942
1942
|
<div class=${`tabs${this._more?` more-${this._more}`:""}`} part="tabs" role="tablist" aria-label=${i}>
|
|
1943
1943
|
${e.map((a,l)=>c`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
|
|
1944
1944
|
tabindex=${l===t?"0":"-1"} ?disabled=${!!a.disabled}
|
|
@@ -2007,7 +2007,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
2007
2007
|
:host([mobile='select']) .tabs { display: none; }
|
|
2008
2008
|
:host([mobile='select']) .pick { display: block; }
|
|
2009
2009
|
}
|
|
2010
|
-
`];$("cm-status-tabs",ss);var
|
|
2010
|
+
`];$("cm-status-tabs",ss);var B$=z("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),rh,Fo,Gt,Mp,Eb,Mb,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`
|
|
2011
2011
|
<div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":h}
|
|
2012
2012
|
style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
|
|
2013
2013
|
${this.selectable?c`<span class="cell" role=${e?"columnheader":h}><span class="check">
|
|
@@ -2075,7 +2075,7 @@ var Ru=o=>{throw TypeError(o)};var Uh=(o,n,e)=>n.has(o)||Ru("Cannot "+e);var r=(
|
|
|
2075
2075
|
`];$("cm-table-header",os);var wy=`
|
|
2076
2076
|
[data-cm-density="compact"] { --cm-table-row-height: 40px; --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
|
|
2077
2077
|
[data-cm-density="comfortable"] { --cm-table-row-height: 48px; --cm-resource-row-height: 56px; --cm-resource-row-padding: 8px; --cm-resource-media-size: 40px; }
|
|
2078
|
-
`,ah=null,Tb=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(!Tb.has(t)){Tb.add(t);try{ah||(ah=new CSSStyleSheet,ah.replaceSync(wy)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,ah]}catch{}}}var
|
|
2078
|
+
`,ah=null,Tb=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(!Tb.has(t)){Tb.add(t);try{ah||(ah=new CSSStyleSheet,ah.replaceSync(wy)),t.adoptedStyleSheets=[...t.adoptedStyleSheets,ah]}catch{}}}var Y$=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}"}),zb=48,_b=16,Cb=!1,$y=`
|
|
2079
2079
|
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); }
|
|
2080
2080
|
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); }
|
|
2081
2081
|
cm-data-table > table th, cm-data-table > table td { box-sizing: border-box; }
|
|
@@ -3695,6 +3695,16 @@ ${t.label}</button>
|
|
|
3695
3695
|
:host([variant='record']) ::slotted([variant='aside']) { grid-column: 2; }
|
|
3696
3696
|
:host([variant='record'][sticky-aside]:state(aside-fits)) ::slotted([variant='aside']) { position: sticky; }
|
|
3697
3697
|
}
|
|
3698
|
+
/* Sidebar layout (1.8.2): a 240px column of views, folders or filters beside the list it filters (a ticket inbox,
|
|
3699
|
+
a mailbox), from 768px of the layout's width; stacked above the list on phones. */
|
|
3700
|
+
:host([variant='sidebar']) .layout { grid-template-columns: minmax(0, 1fr); }
|
|
3701
|
+
:host([variant='sidebar']) ::slotted(*) { grid-column: 1 / -1; }
|
|
3702
|
+
:host([variant='sidebar']) ::slotted([variant='sidebar']) { order: -1; }
|
|
3703
|
+
@container cm-layout (min-width: 768px) {
|
|
3704
|
+
:host([variant='sidebar']) .layout { grid-template-columns: 240px minmax(0, 1fr); grid-auto-flow: dense; } /* scale-exempt: the sidebar is a fixed 240px column */
|
|
3705
|
+
:host([variant='sidebar']) ::slotted(*) { grid-column: 2; }
|
|
3706
|
+
:host([variant='sidebar']) ::slotted([variant='sidebar']) { grid-column: 1; }
|
|
3707
|
+
}
|
|
3698
3708
|
:host([variant='record'][sticky-aside]) ::slotted([variant='aside']) {
|
|
3699
3709
|
/* Read back by #measure(); only takes effect once the aside is sticky. --_header: cm-app-frame's header height. */
|
|
3700
3710
|
inset-block-start: var(--cm-layout-sticky-top, calc(var(--_header, 0px) + var(--cm-space-24)));
|
|
@@ -3730,7 +3740,7 @@ ${t.label}</button>
|
|
|
3730
3740
|
border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-lg);
|
|
3731
3741
|
}
|
|
3732
3742
|
/* Inherited, so a cm-page inside a wrapper element (not slotted directly) is transparent too. */
|
|
3733
|
-
:host([panel]) { --cm-page-background: transparent; }
|
|
3743
|
+
:host([panel]) { --cm-page-background: transparent; --cm-page-header-background: transparent; } /* the white panel shows through, rounded corners intact (1.8.2) */
|
|
3734
3744
|
:host([panel]) ::slotted(cm-page) { background: transparent; }
|
|
3735
3745
|
main:focus { outline: none; }
|
|
3736
3746
|
.bottom { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 40; }
|
|
@@ -208,7 +208,7 @@ CmAppFrame.styles = [
|
|
|
208
208
|
border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-lg);
|
|
209
209
|
}
|
|
210
210
|
/* Inherited, so a cm-page inside a wrapper element (not slotted directly) is transparent too. */
|
|
211
|
-
:host([panel]) { --cm-page-background: transparent; }
|
|
211
|
+
:host([panel]) { --cm-page-background: transparent; --cm-page-header-background: transparent; } /* the white panel shows through, rounded corners intact (1.8.2) */
|
|
212
212
|
:host([panel]) ::slotted(cm-page) { background: transparent; }
|
|
213
213
|
main:focus { outline: none; }
|
|
214
214
|
.bottom { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 40; }
|
|
@@ -12,6 +12,10 @@ import { type SpaceStep } from '../spacing.js';
|
|
|
12
12
|
* below it with `aside-position="below"`, and the gap is `space-16` once the layout is 640px wide or less. The aside
|
|
13
13
|
* is placed by its variant, not by where it is in the source. Cards in a record layout's sections are as far apart as
|
|
14
14
|
* the columns.
|
|
15
|
+
*
|
|
16
|
+
* `variant="sidebar"` (since 1.8.2) puts a 240px `cm-layout-section variant="sidebar"` (views, folders or filters) on the
|
|
17
|
+
* start side of the list it filters, from 768px of the layout's own width; narrower, it stacks above the list. Use it
|
|
18
|
+
* for a ticket inbox or a mailbox instead of `one-third` / `two-thirds`, which give the views a third of the page.
|
|
15
19
|
* @element cm-layout
|
|
16
20
|
* @slot - `cm-layout-section` elements.
|
|
17
21
|
* @cssprop --cm-layout-sticky-top - With `sticky-aside`: how far from the top of the window the aside stops. Default
|
|
@@ -45,7 +49,7 @@ export declare class CmLayout extends LitElement {
|
|
|
45
49
|
* `default`: a six-track grid for `full`, `one-half`, `one-third` and `two-thirds` sections.
|
|
46
50
|
* `record` (since 1.7): a main column and a 320px `aside` section on the end side from 880px (a 1280px laptop window with the side navigation gives about 950px); see the element description.
|
|
47
51
|
*/
|
|
48
|
-
variant: 'default' | 'record';
|
|
52
|
+
variant: 'default' | 'record' | 'sidebar';
|
|
49
53
|
/** Record layout: where the aside goes once the columns stack (below 880px), `above` the main content (default) or `below` it. Since 1.7. */
|
|
50
54
|
asidePosition: 'above' | 'below';
|
|
51
55
|
/**
|
|
@@ -78,8 +82,9 @@ export declare class CmLayoutSection extends LitElement {
|
|
|
78
82
|
* Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a
|
|
79
83
|
* `two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.
|
|
80
84
|
* `aside` (since 1.7) is the 320px side column of a `cm-layout variant="record"`; in other layouts it is `one-third`.
|
|
85
|
+
* `sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant="sidebar"`.
|
|
81
86
|
*/
|
|
82
|
-
variant: 'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside';
|
|
87
|
+
variant: 'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside' | 'sidebar';
|
|
83
88
|
static styles: import("lit").CSSResult[];
|
|
84
89
|
render(): import("lit-html").TemplateResult<1>;
|
|
85
90
|
}
|
|
@@ -25,6 +25,10 @@ import { spaceRules } from '../spacing.js';
|
|
|
25
25
|
* below it with `aside-position="below"`, and the gap is `space-16` once the layout is 640px wide or less. The aside
|
|
26
26
|
* is placed by its variant, not by where it is in the source. Cards in a record layout's sections are as far apart as
|
|
27
27
|
* the columns.
|
|
28
|
+
*
|
|
29
|
+
* `variant="sidebar"` (since 1.8.2) puts a 240px `cm-layout-section variant="sidebar"` (views, folders or filters) on the
|
|
30
|
+
* start side of the list it filters, from 768px of the layout's own width; narrower, it stacks above the list. Use it
|
|
31
|
+
* for a ticket inbox or a mailbox instead of `one-third` / `two-thirds`, which give the views a third of the page.
|
|
28
32
|
* @element cm-layout
|
|
29
33
|
* @slot - `cm-layout-section` elements.
|
|
30
34
|
* @cssprop --cm-layout-sticky-top - With `sticky-aside`: how far from the top of the window the aside stops. Default
|
|
@@ -158,6 +162,16 @@ CmLayout.styles = [
|
|
|
158
162
|
:host([variant='record']) ::slotted([variant='aside']) { grid-column: 2; }
|
|
159
163
|
:host([variant='record'][sticky-aside]:state(aside-fits)) ::slotted([variant='aside']) { position: sticky; }
|
|
160
164
|
}
|
|
165
|
+
/* Sidebar layout (1.8.2): a 240px column of views, folders or filters beside the list it filters (a ticket inbox,
|
|
166
|
+
a mailbox), from 768px of the layout's width; stacked above the list on phones. */
|
|
167
|
+
:host([variant='sidebar']) .layout { grid-template-columns: minmax(0, 1fr); }
|
|
168
|
+
:host([variant='sidebar']) ::slotted(*) { grid-column: 1 / -1; }
|
|
169
|
+
:host([variant='sidebar']) ::slotted([variant='sidebar']) { order: -1; }
|
|
170
|
+
@container cm-layout (min-width: 768px) {
|
|
171
|
+
:host([variant='sidebar']) .layout { grid-template-columns: 240px minmax(0, 1fr); grid-auto-flow: dense; } /* scale-exempt: the sidebar is a fixed 240px column */
|
|
172
|
+
:host([variant='sidebar']) ::slotted(*) { grid-column: 2; }
|
|
173
|
+
:host([variant='sidebar']) ::slotted([variant='sidebar']) { grid-column: 1; }
|
|
174
|
+
}
|
|
161
175
|
:host([variant='record'][sticky-aside]) ::slotted([variant='aside']) {
|
|
162
176
|
/* Read back by #measure(); only takes effect once the aside is sticky. --_header: cm-app-frame's header height. */
|
|
163
177
|
inset-block-start: var(--cm-layout-sticky-top, calc(var(--_header, 0px) + var(--cm-space-24)));
|
|
@@ -178,6 +192,7 @@ export class CmLayoutSection extends LitElement {
|
|
|
178
192
|
* Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a
|
|
179
193
|
* `two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.
|
|
180
194
|
* `aside` (since 1.7) is the 320px side column of a `cm-layout variant="record"`; in other layouts it is `one-third`.
|
|
195
|
+
* `sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant="sidebar"`.
|
|
181
196
|
*/
|
|
182
197
|
this.variant = 'full';
|
|
183
198
|
}
|
|
@@ -33,6 +33,8 @@ export interface Breadcrumb {
|
|
|
33
33
|
* @slot actions - Buttons, right-aligned, secondary first and the primary action last (large size).
|
|
34
34
|
* @slot title-adornment - Badge or count next to the title.
|
|
35
35
|
* @csspart description - The `description` line under the title.
|
|
36
|
+
* @cssprop --cm-page-header-background - The header's background (default `bg-surface`). `cm-app-frame panel` makes it
|
|
37
|
+
* transparent, so the header doesn't square off the panel's rounded corners. Since 1.8.2.
|
|
36
38
|
* @fires cm-previous - When the previous-record arrow is pressed (with `pagination`).
|
|
37
39
|
* @fires cm-next - When the next-record arrow is pressed (with `pagination`).
|
|
38
40
|
*/
|
|
@@ -31,6 +31,8 @@ const strings = defineStrings('pageHeader', {
|
|
|
31
31
|
* @slot actions - Buttons, right-aligned, secondary first and the primary action last (large size).
|
|
32
32
|
* @slot title-adornment - Badge or count next to the title.
|
|
33
33
|
* @csspart description - The `description` line under the title.
|
|
34
|
+
* @cssprop --cm-page-header-background - The header's background (default `bg-surface`). `cm-app-frame panel` makes it
|
|
35
|
+
* transparent, so the header doesn't square off the panel's rounded corners. Since 1.8.2.
|
|
34
36
|
* @fires cm-previous - When the previous-record arrow is pressed (with `pagination`).
|
|
35
37
|
* @fires cm-next - When the next-record arrow is pressed (with `pagination`).
|
|
36
38
|
*/
|
|
@@ -116,7 +118,7 @@ CmPageHeader.styles = [
|
|
|
116
118
|
header {
|
|
117
119
|
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-12) var(--cm-space-20);
|
|
118
120
|
min-height: 64px; padding: var(--cm-space-12) var(--cm-space-24);
|
|
119
|
-
background: var(--cm-bg-surface); border-bottom: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
121
|
+
background: var(--cm-page-header-background, var(--cm-bg-surface)); border-bottom: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
120
122
|
}
|
|
121
123
|
.lead { flex: 1 1 280px; display: flex; align-items: center; gap: var(--cm-space-8); min-width: 0; }
|
|
122
124
|
/* flex: 1 (issue #32): the titles column takes the room the lead has, so a title-adornment badge sits beside the
|
|
@@ -18458,7 +18458,7 @@
|
|
|
18458
18458
|
"declarations": [
|
|
18459
18459
|
{
|
|
18460
18460
|
"kind": "class",
|
|
18461
|
-
"description": "The body of an admin page: sections side by side, for example the main column and side column of a detail page.\nSections stack into one column, in source order, when the layout is narrower than 768px (a container query, so\nit follows the space the layout gets, not the window). Put the main section first.\n\n`variant=\"record\"` (since 1.7) is the standard record page: a lead, contact, deal, account or ticket, an order or a\nproduct. Put in one main `cm-layout-section` and one `cm-layout-section variant=\"aside\"`. From 880px of the layout's\nown width the aside is a 320px column on the end side (on the left in right-to-left pages) and the main column takes\nthe rest, `space-24` apart. Narrower, they stack: the aside goes above the main content (the key facts first) or\nbelow it with `aside-position=\"below\"`, and the gap is `space-16` once the layout is 640px wide or less. The aside\nis placed by its variant, not by where it is in the source. Cards in a record layout's sections are as far apart as\nthe columns.",
|
|
18461
|
+
"description": "The body of an admin page: sections side by side, for example the main column and side column of a detail page.\nSections stack into one column, in source order, when the layout is narrower than 768px (a container query, so\nit follows the space the layout gets, not the window). Put the main section first.\n\n`variant=\"record\"` (since 1.7) is the standard record page: a lead, contact, deal, account or ticket, an order or a\nproduct. Put in one main `cm-layout-section` and one `cm-layout-section variant=\"aside\"`. From 880px of the layout's\nown width the aside is a 320px column on the end side (on the left in right-to-left pages) and the main column takes\nthe rest, `space-24` apart. Narrower, they stack: the aside goes above the main content (the key facts first) or\nbelow it with `aside-position=\"below\"`, and the gap is `space-16` once the layout is 640px wide or less. The aside\nis placed by its variant, not by where it is in the source. Cards in a record layout's sections are as far apart as\nthe columns.\n\n`variant=\"sidebar\"` (since 1.8.2) puts a 240px `cm-layout-section variant=\"sidebar\"` (views, folders or filters) on the\nstart side of the list it filters, from 768px of the layout's own width; narrower, it stacks above the list. Use it\nfor a ticket inbox or a mailbox instead of `one-third` / `two-thirds`, which give the views a third of the page.",
|
|
18462
18462
|
"name": "CmLayout",
|
|
18463
18463
|
"cssProperties": [
|
|
18464
18464
|
{
|
|
@@ -18490,7 +18490,7 @@
|
|
|
18490
18490
|
"name": "variant",
|
|
18491
18491
|
"privacy": "public",
|
|
18492
18492
|
"type": {
|
|
18493
|
-
"text": "'default' | 'record'"
|
|
18493
|
+
"text": "'default' | 'record' | 'sidebar'"
|
|
18494
18494
|
},
|
|
18495
18495
|
"default": "'default'",
|
|
18496
18496
|
"description": "`default`: a six-track grid for `full`, `one-half`, `one-third` and `two-thirds` sections.\n`record` (since 1.7): a main column and a 320px `aside` section on the end side from 880px (a 1280px laptop window with the side navigation gives about 950px); see the element description.",
|
|
@@ -18602,7 +18602,7 @@
|
|
|
18602
18602
|
{
|
|
18603
18603
|
"name": "variant",
|
|
18604
18604
|
"type": {
|
|
18605
|
-
"text": "'default' | 'record'"
|
|
18605
|
+
"text": "'default' | 'record' | 'sidebar'"
|
|
18606
18606
|
},
|
|
18607
18607
|
"default": "'default'",
|
|
18608
18608
|
"description": "`default`: a six-track grid for `full`, `one-half`, `one-third` and `two-thirds` sections.\n`record` (since 1.7): a main column and a 320px `aside` section on the end side from 880px (a 1280px laptop window with the side navigation gives about 950px); see the element description.",
|
|
@@ -18650,10 +18650,10 @@
|
|
|
18650
18650
|
"name": "variant",
|
|
18651
18651
|
"privacy": "public",
|
|
18652
18652
|
"type": {
|
|
18653
|
-
"text": "'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside'"
|
|
18653
|
+
"text": "'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside' | 'sidebar'"
|
|
18654
18654
|
},
|
|
18655
18655
|
"default": "'full'",
|
|
18656
|
-
"description": "Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.",
|
|
18656
|
+
"description": "Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.\n`sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant=\"sidebar\"`.",
|
|
18657
18657
|
"attribute": "variant",
|
|
18658
18658
|
"reflects": true
|
|
18659
18659
|
}
|
|
@@ -18662,10 +18662,10 @@
|
|
|
18662
18662
|
{
|
|
18663
18663
|
"name": "variant",
|
|
18664
18664
|
"type": {
|
|
18665
|
-
"text": "'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside'"
|
|
18665
|
+
"text": "'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside' | 'sidebar'"
|
|
18666
18666
|
},
|
|
18667
18667
|
"default": "'full'",
|
|
18668
|
-
"description": "Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.",
|
|
18668
|
+
"description": "Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.\n`sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant=\"sidebar\"`.",
|
|
18669
18669
|
"fieldName": "variant"
|
|
18670
18670
|
}
|
|
18671
18671
|
],
|
|
@@ -23130,6 +23130,12 @@
|
|
|
23130
23130
|
"kind": "class",
|
|
23131
23131
|
"description": "Top of an admin page: breadcrumbs, the page title and the page's main actions.\nThe Figma file calls this the \"Save Bar\" (80px desktop, 50px mobile).\nOn narrow screens the breadcrumbs collapse to a back link to the parent page. `back-href` (since 1.7) shows that\nback link at every width instead, before the title: use it on record pages opened from a list (a lead, an order).\nType (owner standard, 1.6): title 24/32 semibold (20/28 on phones), description 13/18, breadcrumbs 13/18.\nA badge in `title-adornment` sits beside the title and wraps under it only when the title runs out of room.",
|
|
23132
23132
|
"name": "CmPageHeader",
|
|
23133
|
+
"cssProperties": [
|
|
23134
|
+
{
|
|
23135
|
+
"description": "The header's background (default `bg-surface`). `cm-app-frame panel` makes it transparent, so the header doesn't square off the panel's rounded corners. Since 1.8.2.",
|
|
23136
|
+
"name": "--cm-page-header-background"
|
|
23137
|
+
}
|
|
23138
|
+
],
|
|
23133
23139
|
"cssParts": [
|
|
23134
23140
|
{
|
|
23135
23141
|
"description": "The `description` line under the title.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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.9.0",
|
|
54
|
+
"@commmerce/tokens": "1.9.0",
|
|
55
55
|
"lit": "3.2.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|