@cas-smartdesign/combo-box 7.4.0 → 7.4.2
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/docs/doc.mjs
CHANGED
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
--sd-input-validation-message-minheight: 20px;
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
}
|
|
32
|
+
sd-combo-box.legacy-validation-layout {
|
|
33
|
+
--sd-input-validation-message-minheight: unset;
|
|
34
|
+
padding-bottom: 16px;
|
|
35
|
+
}
|
|
32
36
|
|
|
33
37
|
.grid-example-container {
|
|
34
38
|
display: grid;
|
|
@@ -1362,6 +1366,10 @@ duplicateExample.comboBoxValue = { index: 88, item: itemsWithDuplicate[88] };
|
|
|
1362
1366
|
allow-custom-value></sd-combo-box>
|
|
1363
1367
|
<sd-combo-box null-setting-disallowed label="Null setting not allowed and mandatory"></sd-combo-box>
|
|
1364
1368
|
<sd-combo-box long-validation-message label="Long validation message"></sd-combo-box>
|
|
1369
|
+
<sd-combo-box
|
|
1370
|
+
class="legacy-validation-layout"
|
|
1371
|
+
long-validation-message
|
|
1372
|
+
label="Long validation message with single line layout"></sd-combo-box>
|
|
1365
1373
|
</div>
|
|
1366
1374
|
`,$r=`<h3 id="validation-examples">Validation examples</h3>
|
|
1367
1375
|
`,Or=`import "@cas-smartdesign/combo-box";
|
|
@@ -1409,7 +1417,7 @@ function updateMandatory(combobox: ComboBox) {
|
|
|
1409
1417
|
\f\r]`,gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vs=/-->/g,Fs=/>/g,Te=RegExp(`>|${Li}(?:([^\\s"'>=/]+)(${Li}*=${Li}*(?:[^
|
|
1410
1418
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),Hs=/'/g,Us=/"/g,La=/^(?:script|style|textarea|title)$/i,Br=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),ne=Br(1),Ue=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),Gs=new WeakMap,je=He.createTreeWalker(He,129,null,!1);function Pa(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return js!==void 0?js.createHTML(e):e}const Tr=(s,e)=>{const t=s.length-1,i=[];let a,r=e===2?"<svg>":"",n=gt;for(let o=0;o<t;o++){const l=s[o];let c,m,u=-1,h=0;for(;h<l.length&&(n.lastIndex=h,m=n.exec(l),m!==null);)h=n.lastIndex,n===gt?m[1]==="!--"?n=Vs:m[1]!==void 0?n=Fs:m[2]!==void 0?(La.test(m[2])&&(a=RegExp("</"+m[2],"g")),n=Te):m[3]!==void 0&&(n=Te):n===Te?m[0]===">"?(n=a??gt,u=-1):m[1]===void 0?u=-2:(u=n.lastIndex-m[2].length,c=m[1],n=m[3]===void 0?Te:m[3]==='"'?Us:Hs):n===Us||n===Hs?n=Te:n===Vs||n===Fs?n=gt:(n=Te,a=void 0);const g=n===Te&&s[o+1].startsWith("/>")?" ":"";r+=n===gt?l+Pr:u>=0?(i.push(c),l.slice(0,u)+Gi+l.slice(u)+Ie+g):l+Ie+(u===-2?(i.push(void 0),o):g)}return[Pa(s,r+(s[t]||"<?>")+(e===2?"</svg>":"")),i]};class At{constructor({strings:e,_$litType$:t},i){let a;this.parts=[];let r=0,n=0;const o=e.length-1,l=this.parts,[c,m]=Tr(e,t);if(this.el=At.createElement(c,i),je.currentNode=this.el.content,t===2){const u=this.el.content,h=u.firstChild;h.remove(),u.append(...h.childNodes)}for(;(a=je.nextNode())!==null&&l.length<o;){if(a.nodeType===1){if(a.hasAttributes()){const u=[];for(const h of a.getAttributeNames())if(h.endsWith(Gi)||h.startsWith(Ie)){const g=m[n++];if(u.push(h),g!==void 0){const _=a.getAttribute(g.toLowerCase()+Gi).split(Ie),y=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:y[2],strings:_,ctor:y[1]==="."?jr:y[1]==="?"?Fr:y[1]==="@"?Hr:yi})}else l.push({type:6,index:r})}for(const h of u)a.removeAttribute(h)}if(La.test(a.tagName)){const u=a.textContent.split(Ie),h=u.length-1;if(h>0){a.textContent=it?it.emptyScript:"";for(let g=0;g<h;g++)a.append(u[g],Ct()),je.nextNode(),l.push({type:2,index:++r});a.append(u[h],Ct())}}}else if(a.nodeType===8)if(a.data===Ia)l.push({type:2,index:r});else{let u=-1;for(;(u=a.data.indexOf(Ie,u+1))!==-1;)l.push({type:7,index:r}),u+=Ie.length-1}r++}}static createElement(e,t){const i=He.createElement("template");return i.innerHTML=e,i}}function st(s,e,t=s,i){var a,r,n,o;if(e===Ue)return e;let l=i!==void 0?(a=t._$Co)===null||a===void 0?void 0:a[i]:t._$Cl;const c=Et(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==c&&((r=l==null?void 0:l._$AO)===null||r===void 0||r.call(l,!1),c===void 0?l=void 0:(l=new c(s),l._$AT(s,t,i)),i!==void 0?((n=(o=t)._$Co)!==null&&n!==void 0?n:o._$Co=[])[i]=l:t._$Cl=l),l!==void 0&&(e=st(s,l._$AS(s,e.values),l,i)),e}class zr{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:i},parts:a}=this._$AD,r=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:He).importNode(i,!0);je.currentNode=r;let n=je.nextNode(),o=0,l=0,c=a[0];for(;c!==void 0;){if(o===c.index){let m;c.type===2?m=new zt(n,n.nextSibling,this,e):c.type===1?m=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(m=new Ur(n,this,e)),this._$AV.push(m),c=a[++l]}o!==(c==null?void 0:c.index)&&(n=je.nextNode(),o++)}return je.currentNode=He,r}v(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class zt{constructor(e,t,i,a){var r;this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=a,this._$Cp=(r=a==null?void 0:a.isConnected)===null||r===void 0||r}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=st(this,e,t),Et(e)?e===F||e==null||e===""?(this._$AH!==F&&this._$AR(),this._$AH=F):e!==this._$AH&&e!==Ue&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Dr(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==F&&Et(this._$AH)?this._$AA.nextSibling.data=e:this.$(He.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:a}=e,r=typeof a=="number"?this._$AC(e):(a.el===void 0&&(a.el=At.createElement(Pa(a.h,a.h[0]),this.options)),a);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===r)this._$AH.v(i);else{const n=new zr(r,this),o=n.u(this.options);n.v(i),this.$(o),this._$AH=n}}_$AC(e){let t=Gs.get(e.strings);return t===void 0&&Gs.set(e.strings,t=new At(e)),t}T(e){Ra(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,a=0;for(const r of e)a===t.length?t.push(i=new zt(this.k(Ct()),this.k(Ct()),this,this.options)):i=t[a],i._$AI(r),a++;a<t.length&&(this._$AR(i&&i._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,t);e&&e!==this._$AB;){const a=e.nextSibling;e.remove(),e=a}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}let yi=class{constructor(e,t,i,a,r){this.type=1,this._$AH=F,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,a){const r=this.strings;let n=!1;if(r===void 0)e=st(this,e,t,0),n=!Et(e)||e!==this._$AH&&e!==Ue,n&&(this._$AH=e);else{const o=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=st(this,o[i+l],t,l),c===Ue&&(c=this._$AH[l]),n||(n=!Et(c)||c!==this._$AH[l]),c===F?e=F:e!==F&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}n&&!a&&this.j(e)}j(e){e===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class jr extends yi{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===F?void 0:e}}const Vr=it?it.emptyScript:"";let Fr=class extends yi{constructor(){super(...arguments),this.type=4}j(e){e&&e!==F?this.element.setAttribute(this.name,Vr):this.element.removeAttribute(this.name)}},Hr=class extends yi{constructor(e,t,i,a,r){super(e,t,i,a,r),this.type=5}_$AI(e,t=this){var i;if((e=(i=st(this,e,t,0))!==null&&i!==void 0?i:F)===Ue)return;const a=this._$AH,r=e===F&&a!==F||e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive,n=e!==F&&(a===F||r);r&&this.element.removeEventListener(this.name,this,a),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;typeof this._$AH=="function"?this._$AH.call((i=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}};class Ur{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){st(this,e)}}const Ws=di.litHtmlPolyfillSupport;Ws==null||Ws(At,zt),((Ri=di.litHtmlVersions)!==null&&Ri!==void 0?Ri:di.litHtmlVersions=[]).push("2.8.0");const Gr=(s,e,t)=>{var i,a;const r=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=r._$litPart$;if(n===void 0){const o=(a=t==null?void 0:t.renderBefore)!==null&&a!==void 0?a:null;r._$litPart$=n=new zt(e.insertBefore(Ct(),o),o,void 0,t??{})}return n._$AI(s),n};var Pi,Di;let Ee=class extends et{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Gr(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Ue}};Ee.finalized=!0,Ee._$litElement$=!0,(Pi=globalThis.litElementHydrateSupport)===null||Pi===void 0||Pi.call(globalThis,{LitElement:Ee});const Ks=globalThis.litElementPolyfillSupport;Ks==null||Ks({LitElement:Ee});((Di=globalThis.litElementVersions)!==null&&Di!==void 0?Di:globalThis.litElementVersions=[]).push("3.3.3");const Wr=(s,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,s)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,s)}},Kr=(s,e,t)=>{e.constructor.createProperty(t,s)};function v(s){return(e,t)=>t!==void 0?Kr(s,e,t):Wr(s,e)}var re="top",ue="bottom",he="right",oe="left",hs="auto",jt=[re,ue,he,oe],at="start",kt="end",qr="clippingParents",Da="viewport",Nt="popper",Jr="reference",qs=jt.reduce(function(s,e){return s.concat([e+"-"+at,e+"-"+kt])},[]),Ba=[].concat(jt,[hs]).reduce(function(s,e){return s.concat([e,e+"-"+at,e+"-"+kt])},[]),Zr="beforeRead",Xr="read",Yr="afterRead",Qr="beforeMain",eo="main",to="afterMain",io="beforeWrite",so="write",ao="afterWrite",no=[Zr,Xr,Yr,Qr,eo,to,io,so,ao];function _e(s){return s?(s.nodeName||"").toLowerCase():null}function me(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Ge(s){var e=me(s).Element;return s instanceof e||s instanceof Element}function de(s){var e=me(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function fs(s){if(typeof ShadowRoot>"u")return!1;var e=me(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function ro(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},a=e.attributes[t]||{},r=e.elements[t];!de(r)||!_e(r)||(Object.assign(r.style,i),Object.keys(a).forEach(function(n){var o=a[n];o===!1?r.removeAttribute(n):r.setAttribute(n,o===!0?"":o)}))})}function oo(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var a=e.elements[i],r=e.attributes[i]||{},n=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),o=n.reduce(function(l,c){return l[c]="",l},{});!de(a)||!_e(a)||(Object.assign(a.style,o),Object.keys(r).forEach(function(l){a.removeAttribute(l)}))})}}const lo={name:"applyStyles",enabled:!0,phase:"write",fn:ro,effect:oo,requires:["computeStyles"]};function we(s){return s.split("-")[0]}var Ve=Math.max,ui=Math.min,nt=Math.round;function Wi(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ta(){return!/^((?!chrome|android).)*safari/i.test(Wi())}function rt(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),a=1,r=1;e&&de(s)&&(a=s.offsetWidth>0&&nt(i.width)/s.offsetWidth||1,r=s.offsetHeight>0&&nt(i.height)/s.offsetHeight||1);var n=Ge(s)?me(s):window,o=n.visualViewport,l=!Ta()&&t,c=(i.left+(l&&o?o.offsetLeft:0))/a,m=(i.top+(l&&o?o.offsetTop:0))/r,u=i.width/a,h=i.height/r;return{width:u,height:h,top:m,right:c+u,bottom:m+h,left:c,x:c,y:m}}function ps(s){var e=rt(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function za(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&fs(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ae(s){return me(s).getComputedStyle(s)}function co(s){return["table","td","th"].indexOf(_e(s))>=0}function Le(s){return((Ge(s)?s.ownerDocument:s.document)||window.document).documentElement}function xi(s){return _e(s)==="html"?s:s.assignedSlot||s.parentNode||(fs(s)?s.host:null)||Le(s)}function Js(s){return!de(s)||Ae(s).position==="fixed"?null:s.offsetParent}function mo(s){var e=/firefox/i.test(Wi()),t=/Trident/i.test(Wi());if(t&&de(s)){var i=Ae(s);if(i.position==="fixed")return null}var a=xi(s);for(fs(a)&&(a=a.host);de(a)&&["html","body"].indexOf(_e(a))<0;){var r=Ae(a);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return a;a=a.parentNode}return null}function Vt(s){for(var e=me(s),t=Js(s);t&&co(t)&&Ae(t).position==="static";)t=Js(t);return t&&(_e(t)==="html"||_e(t)==="body"&&Ae(t).position==="static")?e:t||mo(s)||e}function gs(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function wt(s,e,t){return Ve(s,ui(e,t))}function uo(s,e,t){var i=wt(s,e,t);return i>t?t:i}function ja(){return{top:0,right:0,bottom:0,left:0}}function Va(s){return Object.assign({},ja(),s)}function Fa(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var ho=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Va(typeof e!="number"?e:Fa(e,jt))};function fo(s){var e,t=s.state,i=s.name,a=s.options,r=t.elements.arrow,n=t.modifiersData.popperOffsets,o=we(t.placement),l=gs(o),c=[oe,he].indexOf(o)>=0,m=c?"height":"width";if(!(!r||!n)){var u=ho(a.padding,t),h=ps(r),g=l==="y"?re:oe,_=l==="y"?ue:he,y=t.rects.reference[m]+t.rects.reference[l]-n[l]-t.rects.popper[m],f=n[l]-t.rects.reference[l],A=Vt(r),M=A?l==="y"?A.clientHeight||0:A.clientWidth||0:0,I=y/2-f/2,x=u[g],E=M-h[m]-u[_],$=M/2-h[m]/2+I,R=wt(x,$,E),P=l;t.modifiersData[i]=(e={},e[P]=R,e.centerOffset=R-$,e)}}function po(s){var e=s.state,t=s.options,i=t.element,a=i===void 0?"[data-popper-arrow]":i;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||za(e.elements.popper,a)&&(e.elements.arrow=a))}const go={name:"arrow",enabled:!0,phase:"main",fn:fo,effect:po,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ot(s){return s.split("-")[1]}var No={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bo(s,e){var t=s.x,i=s.y,a=e.devicePixelRatio||1;return{x:nt(t*a)/a||0,y:nt(i*a)/a||0}}function Zs(s){var e,t=s.popper,i=s.popperRect,a=s.placement,r=s.variation,n=s.offsets,o=s.position,l=s.gpuAcceleration,c=s.adaptive,m=s.roundOffsets,u=s.isFixed,h=n.x,g=h===void 0?0:h,_=n.y,y=_===void 0?0:_,f=typeof m=="function"?m({x:g,y}):{x:g,y};g=f.x,y=f.y;var A=n.hasOwnProperty("x"),M=n.hasOwnProperty("y"),I=oe,x=re,E=window;if(c){var $=Vt(t),R="clientHeight",P="clientWidth";if($===me(t)&&($=Le(t),Ae($).position!=="static"&&o==="absolute"&&(R="scrollHeight",P="scrollWidth")),$=$,a===re||(a===oe||a===he)&&r===kt){x=ue;var O=u&&$===E&&E.visualViewport?E.visualViewport.height:$[R];y-=O-i.height,y*=l?1:-1}if(a===oe||(a===re||a===ue)&&r===kt){I=he;var T=u&&$===E&&E.visualViewport?E.visualViewport.width:$[P];g-=T-i.width,g*=l?1:-1}}var K=Object.assign({position:o},c&&No),ee=m===!0?bo({x:g,y},me(t)):{x:g,y};if(g=ee.x,y=ee.y,l){var q;return Object.assign({},K,(q={},q[x]=M?"0":"",q[I]=A?"0":"",q.transform=(E.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",q))}return Object.assign({},K,(e={},e[x]=M?y+"px":"",e[I]=A?g+"px":"",e.transform="",e))}function vo(s){var e=s.state,t=s.options,i=t.gpuAcceleration,a=i===void 0?!0:i,r=t.adaptive,n=r===void 0?!0:r,o=t.roundOffsets,l=o===void 0?!0:o,c={placement:we(e.placement),variation:ot(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Zs(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:n,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Zs(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const yo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vo,data:{}};var Kt={passive:!0};function xo(s){var e=s.state,t=s.instance,i=s.options,a=i.scroll,r=a===void 0?!0:a,n=i.resize,o=n===void 0?!0:n,l=me(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(m){m.addEventListener("scroll",t.update,Kt)}),o&&l.addEventListener("resize",t.update,Kt),function(){r&&c.forEach(function(m){m.removeEventListener("scroll",t.update,Kt)}),o&&l.removeEventListener("resize",t.update,Kt)}}const wo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xo,data:{}};var _o={left:"right",right:"left",bottom:"top",top:"bottom"};function ri(s){return s.replace(/left|right|bottom|top/g,function(e){return _o[e]})}var So={start:"end",end:"start"};function Xs(s){return s.replace(/start|end/g,function(e){return So[e]})}function Ns(s){var e=me(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function bs(s){return rt(Le(s)).left+Ns(s).scrollLeft}function Co(s,e){var t=me(s),i=Le(s),a=t.visualViewport,r=i.clientWidth,n=i.clientHeight,o=0,l=0;if(a){r=a.width,n=a.height;var c=Ta();(c||!c&&e==="fixed")&&(o=a.offsetLeft,l=a.offsetTop)}return{width:r,height:n,x:o+bs(s),y:l}}function Eo(s){var e,t=Le(s),i=Ns(s),a=(e=s.ownerDocument)==null?void 0:e.body,r=Ve(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),n=Ve(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),o=-i.scrollLeft+bs(s),l=-i.scrollTop;return Ae(a||t).direction==="rtl"&&(o+=Ve(t.clientWidth,a?a.clientWidth:0)-r),{width:r,height:n,x:o,y:l}}function vs(s){var e=Ae(s),t=e.overflow,i=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+i)}function Ha(s){return["html","body","#document"].indexOf(_e(s))>=0?s.ownerDocument.body:de(s)&&vs(s)?s:Ha(xi(s))}function _t(s,e){var t;e===void 0&&(e=[]);var i=Ha(s),a=i===((t=s.ownerDocument)==null?void 0:t.body),r=me(i),n=a?[r].concat(r.visualViewport||[],vs(i)?i:[]):i,o=e.concat(n);return a?o:o.concat(_t(xi(n)))}function Ki(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function Ao(s,e){var t=rt(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function Ys(s,e,t){return e===Da?Ki(Co(s,t)):Ge(e)?Ao(e,t):Ki(Eo(Le(s)))}function ko(s){var e=_t(xi(s)),t=["absolute","fixed"].indexOf(Ae(s).position)>=0,i=t&&de(s)?Vt(s):s;return Ge(i)?e.filter(function(a){return Ge(a)&&za(a,i)&&_e(a)!=="body"}):[]}function $o(s,e,t,i){var a=e==="clippingParents"?ko(s):[].concat(e),r=[].concat(a,[t]),n=r[0],o=r.reduce(function(l,c){var m=Ys(s,c,i);return l.top=Ve(m.top,l.top),l.right=ui(m.right,l.right),l.bottom=ui(m.bottom,l.bottom),l.left=Ve(m.left,l.left),l},Ys(s,n,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Ua(s){var e=s.reference,t=s.element,i=s.placement,a=i?we(i):null,r=i?ot(i):null,n=e.x+e.width/2-t.width/2,o=e.y+e.height/2-t.height/2,l;switch(a){case re:l={x:n,y:e.y-t.height};break;case ue:l={x:n,y:e.y+e.height};break;case he:l={x:e.x+e.width,y:o};break;case oe:l={x:e.x-t.width,y:o};break;default:l={x:e.x,y:e.y}}var c=a?gs(a):null;if(c!=null){var m=c==="y"?"height":"width";switch(r){case at:l[c]=l[c]-(e[m]/2-t[m]/2);break;case kt:l[c]=l[c]+(e[m]/2-t[m]/2);break}}return l}function $t(s,e){e===void 0&&(e={});var t=e,i=t.placement,a=i===void 0?s.placement:i,r=t.strategy,n=r===void 0?s.strategy:r,o=t.boundary,l=o===void 0?qr:o,c=t.rootBoundary,m=c===void 0?Da:c,u=t.elementContext,h=u===void 0?Nt:u,g=t.altBoundary,_=g===void 0?!1:g,y=t.padding,f=y===void 0?0:y,A=Va(typeof f!="number"?f:Fa(f,jt)),M=h===Nt?Jr:Nt,I=s.rects.popper,x=s.elements[_?M:h],E=$o(Ge(x)?x:x.contextElement||Le(s.elements.popper),l,m,n),$=rt(s.elements.reference),R=Ua({reference:$,element:I,strategy:"absolute",placement:a}),P=Ki(Object.assign({},I,R)),O=h===Nt?P:$,T={top:E.top-O.top+A.top,bottom:O.bottom-E.bottom+A.bottom,left:E.left-O.left+A.left,right:O.right-E.right+A.right},K=s.modifiersData.offset;if(h===Nt&&K){var ee=K[a];Object.keys(T).forEach(function(q){var fe=[he,ue].indexOf(q)>=0?1:-1,te=[re,ue].indexOf(q)>=0?"y":"x";T[q]+=ee[te]*fe})}return T}function Oo(s,e){e===void 0&&(e={});var t=e,i=t.placement,a=t.boundary,r=t.rootBoundary,n=t.padding,o=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?Ba:l,m=ot(i),u=m?o?qs:qs.filter(function(_){return ot(_)===m}):jt,h=u.filter(function(_){return c.indexOf(_)>=0});h.length===0&&(h=u);var g=h.reduce(function(_,y){return _[y]=$t(s,{placement:y,boundary:a,rootBoundary:r,padding:n})[we(y)],_},{});return Object.keys(g).sort(function(_,y){return g[_]-g[y]})}function Mo(s){if(we(s)===hs)return[];var e=ri(s);return[Xs(s),e,Xs(e)]}function Io(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var a=t.mainAxis,r=a===void 0?!0:a,n=t.altAxis,o=n===void 0?!0:n,l=t.fallbackPlacements,c=t.padding,m=t.boundary,u=t.rootBoundary,h=t.altBoundary,g=t.flipVariations,_=g===void 0?!0:g,y=t.allowedAutoPlacements,f=e.options.placement,A=we(f),M=A===f,I=l||(M||!_?[ri(f)]:Mo(f)),x=[f].concat(I).reduce(function(pe,U){return pe.concat(we(U)===hs?Oo(e,{placement:U,boundary:m,rootBoundary:u,padding:c,flipVariations:_,allowedAutoPlacements:y}):U)},[]),E=e.rects.reference,$=e.rects.popper,R=new Map,P=!0,O=x[0],T=0;T<x.length;T++){var K=x[T],ee=we(K),q=ot(K)===at,fe=[re,ue].indexOf(ee)>=0,te=fe?"width":"height",Z=$t(e,{placement:K,boundary:m,rootBoundary:u,altBoundary:h,padding:c}),d=fe?q?he:oe:q?ue:re;E[te]>$[te]&&(d=ri(d));var N=ri(d),w=[];if(r&&w.push(Z[ee]<=0),o&&w.push(Z[d]<=0,Z[N]<=0),w.every(function(pe){return pe})){O=K,P=!1;break}R.set(K,w)}if(P)for(var k=_?3:1,z=function(U){var X=x.find(function(De){var be=R.get(De);if(be)return be.slice(0,U).every(function(qe){return qe})});if(X)return O=X,"break"},J=k;J>0;J--){var le=z(J);if(le==="break")break}e.placement!==O&&(e.modifiersData[i]._skip=!0,e.placement=O,e.reset=!0)}}const Ro={name:"flip",enabled:!0,phase:"main",fn:Io,requiresIfExists:["offset"],data:{_skip:!1}};function Qs(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function ea(s){return[re,he,ue,oe].some(function(e){return s[e]>=0})}function Lo(s){var e=s.state,t=s.name,i=e.rects.reference,a=e.rects.popper,r=e.modifiersData.preventOverflow,n=$t(e,{elementContext:"reference"}),o=$t(e,{altBoundary:!0}),l=Qs(n,i),c=Qs(o,a,r),m=ea(l),u=ea(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:m,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":u})}const Po={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Lo};function Do(s,e,t){var i=we(s),a=[oe,re].indexOf(i)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,n=r[0],o=r[1];return n=n||0,o=(o||0)*a,[oe,he].indexOf(i)>=0?{x:o,y:n}:{x:n,y:o}}function Bo(s){var e=s.state,t=s.options,i=s.name,a=t.offset,r=a===void 0?[0,0]:a,n=Ba.reduce(function(m,u){return m[u]=Do(u,e.rects,r),m},{}),o=n[e.placement],l=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=n}const To={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bo};function zo(s){var e=s.state,t=s.name;e.modifiersData[t]=Ua({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const jo={name:"popperOffsets",enabled:!0,phase:"read",fn:zo,data:{}};function Vo(s){return s==="x"?"y":"x"}function Fo(s){var e=s.state,t=s.options,i=s.name,a=t.mainAxis,r=a===void 0?!0:a,n=t.altAxis,o=n===void 0?!1:n,l=t.boundary,c=t.rootBoundary,m=t.altBoundary,u=t.padding,h=t.tether,g=h===void 0?!0:h,_=t.tetherOffset,y=_===void 0?0:_,f=$t(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:m}),A=we(e.placement),M=ot(e.placement),I=!M,x=gs(A),E=Vo(x),$=e.modifiersData.popperOffsets,R=e.rects.reference,P=e.rects.popper,O=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,T=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),K=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ee={x:0,y:0};if($){if(r){var q,fe=x==="y"?re:oe,te=x==="y"?ue:he,Z=x==="y"?"height":"width",d=$[x],N=d+f[fe],w=d-f[te],k=g?-P[Z]/2:0,z=M===at?R[Z]:P[Z],J=M===at?-P[Z]:-R[Z],le=e.elements.arrow,pe=g&&le?ps(le):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ja(),X=U[fe],De=U[te],be=wt(0,R[Z],pe[Z]),qe=I?R[Z]/2-k-be-X-T.mainAxis:z-be-X-T.mainAxis,$i=I?-R[Z]/2+k+be+De+T.mainAxis:J+be+De+T.mainAxis,ft=e.elements.arrow&&Vt(e.elements.arrow),Oi=ft?x==="y"?ft.clientTop||0:ft.clientLeft||0:0,Ut=(q=K==null?void 0:K[x])!=null?q:0,Je=d+qe-Ut-Oi,Gt=d+$i-Ut,ce=wt(g?ui(N,Je):N,d,g?Ve(w,Gt):w);$[x]=ce,ee[x]=ce-d}if(o){var Wt,pt=x==="x"?re:oe,S=x==="x"?ue:he,ve=$[E],G=E==="y"?"height":"width",D=ve+f[pt],Be=ve-f[S],ge=[re,oe].indexOf(A)!==-1,Ze=(Wt=K==null?void 0:K[E])!=null?Wt:0,Xe=ge?D:ve-R[G]-P[G]-Ze+T.altAxis,p=ge?ve+R[G]+P[G]-Ze-T.altAxis:Be,b=g&&ge?uo(Xe,ve,p):wt(g?Xe:D,ve,g?p:Be);$[E]=b,ee[E]=b-ve}e.modifiersData[i]=ee}}const Ho={name:"preventOverflow",enabled:!0,phase:"main",fn:Fo,requiresIfExists:["offset"]};function Uo(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function Go(s){return s===me(s)||!de(s)?Ns(s):Uo(s)}function Wo(s){var e=s.getBoundingClientRect(),t=nt(e.width)/s.offsetWidth||1,i=nt(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Ko(s,e,t){t===void 0&&(t=!1);var i=de(e),a=de(e)&&Wo(e),r=Le(e),n=rt(s,a,t),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((_e(e)!=="body"||vs(r))&&(o=Go(e)),de(e)?(l=rt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=bs(r))),{x:n.left+o.scrollLeft-l.x,y:n.top+o.scrollTop-l.y,width:n.width,height:n.height}}function qo(s){var e=new Map,t=new Set,i=[];s.forEach(function(r){e.set(r.name,r)});function a(r){t.add(r.name);var n=[].concat(r.requires||[],r.requiresIfExists||[]);n.forEach(function(o){if(!t.has(o)){var l=e.get(o);l&&a(l)}}),i.push(r)}return s.forEach(function(r){t.has(r.name)||a(r)}),i}function Jo(s){var e=qo(s);return no.reduce(function(t,i){return t.concat(e.filter(function(a){return a.phase===i}))},[])}function Zo(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Xo(s){var e=s.reduce(function(t,i){var a=t[i.name];return t[i.name]=a?Object.assign({},a,i,{options:Object.assign({},a.options,i.options),data:Object.assign({},a.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var ta={placement:"bottom",modifiers:[],strategy:"absolute"};function ia(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Yo(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,a=e.defaultOptions,r=a===void 0?ta:a;return function(o,l,c){c===void 0&&(c=r);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},ta,r),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},u=[],h=!1,g={state:m,setOptions:function(A){var M=typeof A=="function"?A(m.options):A;y(),m.options=Object.assign({},r,m.options,M),m.scrollParents={reference:Ge(o)?_t(o):o.contextElement?_t(o.contextElement):[],popper:_t(l)};var I=Jo(Xo([].concat(i,m.options.modifiers)));return m.orderedModifiers=I.filter(function(x){return x.enabled}),_(),g.update()},forceUpdate:function(){if(!h){var A=m.elements,M=A.reference,I=A.popper;if(ia(M,I)){m.rects={reference:Ko(M,Vt(I),m.options.strategy==="fixed"),popper:ps(I)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(T){return m.modifiersData[T.name]=Object.assign({},T.data)});for(var x=0;x<m.orderedModifiers.length;x++){if(m.reset===!0){m.reset=!1,x=-1;continue}var E=m.orderedModifiers[x],$=E.fn,R=E.options,P=R===void 0?{}:R,O=E.name;typeof $=="function"&&(m=$({state:m,options:P,name:O,instance:g})||m)}}}},update:Zo(function(){return new Promise(function(f){g.forceUpdate(),f(m)})}),destroy:function(){y(),h=!0}};if(!ia(o,l))return g;g.setOptions(c).then(function(f){!h&&c.onFirstUpdate&&c.onFirstUpdate(f)});function _(){m.orderedModifiers.forEach(function(f){var A=f.name,M=f.options,I=M===void 0?{}:M,x=f.effect;if(typeof x=="function"){var E=x({state:m,name:A,instance:g,options:I}),$=function(){};u.push(E||$)}})}function y(){u.forEach(function(f){return f()}),u=[]}return g}}var Qo=[wo,jo,yo,lo,To,Ro,Ho,go,Po],el=Yo({defaultModifiers:Qo});const ie=s=>s??F,tl=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",il="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",sl="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",al="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e";var nl=Object.defineProperty,rl=Object.getOwnPropertyDescriptor,ys=(s,e,t,i)=>{for(var a=i>1?void 0:i?rl(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(a=(i?n(e,t,a):n(a))||a);return i&&a&&nl(e,t,a),a},Ye;const Ot=(Ye=class extends Ee{static parseLevel(s){if(s){const e=Object.keys(hi).find(t=>t.toLowerCase()===s.toLowerCase());return e&&hi[e]}}static get styles(){return[Tt`
|
|
1411
1419
|
${ht(tl)}
|
|
1412
|
-
`]}render(){return ne`${this.iconToUse&&ne`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(s){return s.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(s)}get iconForLevel(){switch(Ye.parseLevel(this.level)){case"warn":return al;case"suggest":return sl;case"error":return il;default:return null}}},Ye.ID="sd-field-validation-message",Ye.levelConverter={fromAttribute(s){return Ye.parseLevel(s)},toAttribute(s){return s&&s.toLowerCase()}},Ye);ys([v({type:String,attribute:!0})],Ot.prototype,"message",2);ys([v({type:String,attribute:!0})],Ot.prototype,"icon",2);ys([v({converter:Ot.levelConverter,reflect:!0})],Ot.prototype,"level",2);let Bi=Ot;var hi=(s=>(s.Warn="warn",s.Suggest="suggest",s.Error="error",s))(hi||{});customElements.get(Bi.ID)||customElements.define(Bi.ID,Bi);const ol=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input
|
|
1420
|
+
`]}render(){return ne`${this.iconToUse&&ne`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(s){return s.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(s)}get iconForLevel(){switch(Ye.parseLevel(this.level)){case"warn":return al;case"suggest":return sl;case"error":return il;default:return null}}},Ye.ID="sd-field-validation-message",Ye.levelConverter={fromAttribute(s){return Ye.parseLevel(s)},toAttribute(s){return s&&s.toLowerCase()}},Ye);ys([v({type:String,attribute:!0})],Ot.prototype,"message",2);ys([v({type:String,attribute:!0})],Ot.prototype,"icon",2);ys([v({converter:Ot.levelConverter,reflect:!0})],Ot.prototype,"level",2);let Bi=Ot;var hi=(s=>(s.Warn="warn",s.Suggest="suggest",s.Error="error",s))(hi||{});customElements.get(Bi.ID)||customElements.define(Bi.ID,Bi);const ol=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:normal;white-space:var(--sd-input-validation-message-minheight, nowrap)}.input::placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;top:0;right:0;bottom:0;left:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}";var ll=Object.defineProperty,cl=Object.getOwnPropertyDescriptor,W=(s,e,t,i)=>{for(var a=i>1?void 0:i?cl(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(a=(i?n(e,t,a):n(a))||a);return i&&a&&ll(e,t,a),a};const ml="sd-lit-input",sa="delegatesFocus"in window.ShadowRoot.prototype;let dl=0;var ye;const H=(ye=class extends Ee{constructor(){super(),this.rows=1,this.effectiveDisabled=!1,this.type="text",this.autocomplete="off";const s=dl++;this._validationMessageId=ye.ID+"_message_"+s,this._inputId=ye.ID+"_input_"+s,this.attachInternals&&!this.activeShadyDOM&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabIndex")||(this.tabIndex=0)}firstUpdated(s){super.firstUpdated(s),this.initAutocompleted(this.inputElement),this.updateInitialValue(),this.updateFormValidity(),this.hasAttribute("disabled")&&(this.disabled=!0),this.inputElement.oninput=e=>{this.autocompleted=e.inputType==="insertReplacementText"||!("data"in e),this.currentText=this.inputElement.value,this.fireValueChange(!0)},this.inputElement.onchange=()=>this.fireValueChange(),sa||(this.inputElement.onfocus=()=>this.setAttribute("focused",""),this.inputElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",e=>{e.target===this&&this.inputElement.focus()})),this.inputElement.addEventListener("keyup",()=>{this.updateFormValidity()}),this.addEventListener("keydown",e=>{var t,i;e.key=="Enter"&&((i=(t=this._internals)==null?void 0:t.form)==null||i.requestSubmit())}),this._initialized=!0}initAutocompleted(s){const e=t=>{/^onautofillstart(-sd-lit-input-\d+|\s?)$/.test(t.animationName)?this.autocompleted=!0:/^onautofillcancel(-sd-lit-input-\d+|\s?)$/.test(t.animationName)&&(this.autocompleted=!1)};this.activeShadyDOM?(this._needsAutocompletedCheck=!0,this.activeShadyDOM.nativeMethods.addEventListener.call(s,"animationstart",e)):s.addEventListener("animationstart",e)}get activeShadyDOM(){const s=window.ShadyDOM;return s&&s.inUse?s:null}updateInitialValue(){typeof this.currentText<"u"?this.value=this.currentText:this.value=this.getAttribute("value"),this.value&&(this.currentText=this.inputElement.value),this._initialValue=this.value}get disabled(){return this.hasAttribute("disabled")}set disabled(s){s?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._internals||(this.effectiveDisabled=s)}get inputElement(){return this.shadowRoot&&!this._inputElement&&(this._inputElement=this.shadowRoot.querySelector(".input")),this._inputElement}get value(){return this.inputElement&&this.inputElement.value}set value(s){this.currentText=s||"",this.inputElement&&(this.inputElement.value=this.currentText),this.setFormValue(this.currentText)}get selectionStart(){return this.inputElement?this.inputElement.selectionStart:0}focus(){this.inputElement?this.inputElement.focus():super.focus()}select(){this.inputElement&&this.inputElement.select()}setSelectionRange(s,e){this.updateComplete.then(()=>{this.inputElement&&this.inputElement.setSelectionRange(s,e)})}static get styles(){return[Tt`
|
|
1413
1421
|
${ht(ol)}
|
|
1414
1422
|
`]}render(){var s;let e;const t=this.validationMessage||((s=this.inputElement)==null?void 0:s.validationMessage),i=t||this.validationLevel!=null;return this.rows===1?e=ne`
|
|
1415
1423
|
<input
|
|
@@ -1516,7 +1524,7 @@ function updateMandatory(combobox: ComboBox) {
|
|
|
1516
1524
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|
|
1517
1525
|
<slot name="items"></slot>
|
|
1518
1526
|
</div>
|
|
1519
|
-
`}updated(s){if(super.updated(s),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const e=new MutationObserver(()=>{this.adjustWidthIfNeeded(),e.disconnect()});e.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const s=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(s==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const e=[...this.querySelectorAll("[item-index]")].map(i=>{if(i instanceof tt){i.enableLineClamp=!1;const a=i.missingWidthForTexts;return a>s&&(i.enableLineClamp=!0),a}}),t=Math.max(...e);t>0&&(this.style.width=`${this.offsetWidth+t}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(s=>{s instanceof tt&&(s.enableLineClamp=s.enableLineClamp||s.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const s=[...this.querySelectorAll("[item-index]")],e=new Map,t=document.createDocumentFragment();for(const i of this._itemsRenderData){const a=this.renderItem(i);a.parentElement||t.appendChild(a),e.set(i.dataHash,a);const r=s.indexOf(a);r!==-1&&s.splice(r,1)}this.appendChild(t);for(const i of s)i instanceof tt&&(i.enableLineClamp=!1),this.removeChild(i);e.forEach((i,a)=>{this._elementCache.set(a,i)})}renderItem({index:s,top:e,dataHash:t,data:i}){let a;return i?this._elementCache.has(t)?(a=this._elementCache.get(t),this._elementCache.delete(t)):(a=this.itemGenerator(i,s),a.setAttribute("slot","items")):(a=document.createElement("div"),a.setAttribute("placeholder-item",""),a.setAttribute("slot","items")),Object.assign(a.style,{transform:`translateY(${e}px)`,height:`${this.itemHeight}px`}),a.setAttribute("item-index",s.toString()),a.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),a.setAttribute("aria-posinset",String(s+1)),(!a.id||a.id.startsWith(this.id+"_item_"))&&(a.id=this.id+"_item_"+s),this.itemCount-1==s?a.setAttribute("last",""):a.removeAttribute("last"),this.updateSelectedAttribute(s,a),this.updateFocusedAttribute(s,a),a}updateFocusedAttribute(s,e){this.focusIndex==s&&(this.focusTarget||document.activeElement==this)?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):e.removeAttribute("focused")}updateSelectedAttribute(s,e){const t=this.selectedIndices.indexOf(s)!==-1;t?e.setAttribute("selected",""):e.removeAttribute("selected"),e.setAttribute("aria-selected",String(t))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const s=this.normalizeIndex(this._firstVisibleIndex-2),e=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(s,e);for(let t=s;t<=e;t++){const i=t-s,a=this.items[i];let r;a?r=JSON.stringify(a):r=`placeholder-${i}`,this._itemsRenderData.push({index:t,top:this.itemHeight*t,physicalIndex:i,dataHash:r,data:a})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(s){return Math.max(0,Math.min(s,this.itemCount-1))}get height(){return this.offsetHeight}requestData(s,e){!Number.isNaN(s)&&!Number.isNaN(e)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:s,stopIndex:e}}))}handleSelection(s,e){if(s<0||this.itemCount<=s)return;const t=this.getListItem(s);if(t.getAttribute("aria-disabled")=="true"||t.hasAttribute("disabled"))return;let i=!0;if(this.selectionType!=="trigger-only"){const a=this.selectedIndices.indexOf(s);i=a==-1,i?this.selectionType==="single"?this.selectedIndices=[s]:this.selectedIndices.push(s):this.selectedIndices.splice(a,1),this.requestUpdate("selectedIndices")}this.focusIndex=s,this.dispatchSelectionEvent(s,i,e)}dispatchSelectionEvent(s,e,t){this.dispatchEvent(new CustomEvent("selection",{detail:{index:s,selected:e,hasModifier:t}}))}handleClick(s){const e=s.composedPath().find(t=>t.hasAttribute&&t.hasAttribute("item-index"));if(e){const t=parseInt(e.getAttribute("item-index"));if(Number.isInteger(t)){if(s.button==0||s.button==1){const i=s.type=="auxclick"&&s.button==1||s.metaKey||s.ctrlKey;this.handleSelection(t,i)}this.focusIndex=t}}}},Me.ID="sd-virtual-list",Me.ensureDefined=()=>{tt.ensureDefined(),customElements.get(Me.ID)||customElements.define(Me.ID,Me)},Me);Pe([v({type:Number,attribute:"item-height",reflect:!0})],$e.prototype,"itemHeight",2);Pe([v({type:Number})],$e.prototype,"itemCount",2);Pe([v({type:Array,attribute:!1})],$e.prototype,"items",2);Pe([v({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],$e.prototype,"selectionType",2);Pe([v({type:String,attribute:!0,reflect:!0})],$e.prototype,"id",2);Pe([v({type:String,reflect:!0})],$e.prototype,"role",2);Pe([v({type:Number,attribute:"focus-index",reflect:!0})],$e.prototype,"focusIndex",1);Pe([v({type:Array,attribute:!1})],$e.prototype,"selectedIndices",1);let Ji=$e;Ji.ensureDefined();const El=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input,.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:normal;white-space:var(--sd-input-validation-message-minheight, nowrap)}.input::placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;top:0;right:0;bottom:0;left:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}:host(:focus){outline:none}.suffix ::slotted(.clear-button),.suffix ::slotted(.toggle-button){cursor:pointer;width:16px;height:32px;padding:0 8px;margin-top:-8px;margin-bottom:-8px;fill:#666;outline:none;flex-shrink:0}.suffix ::slotted(.toggle-button){transition:transform .2s}:host([opened]) .suffix ::slotted(.toggle-button){transform:rotate(180deg)}:host([disabled]) .suffix ::slotted(.clear-button),:host([disabled]) .suffix ::slotted(.toggle-button){display:none!important}.prefix ::slotted(.icon-wrapper){width:32px;height:32px;padding-right:4px;margin-top:-8px;margin-bottom:-8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}:host(:not([has-value])) .suffix ::slotted(.clear-button),:host([null-setting-disallowed]) .suffix ::slotted(.clear-button){display:none!important}:host(:not([allow-custom-value]):not([trigger-only])) .input{caret-color:transparent}:host(:not([allow-custom-value]):not([disabled])) .input{cursor:pointer}#default-slot{display:none}",Al=`<svg xmlns="http://www.w3.org/2000/svg" class="toggle-button" slot="suffix" viewBox="0 0 16 16">\r
|
|
1527
|
+
`}updated(s){if(super.updated(s),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const e=new MutationObserver(()=>{this.adjustWidthIfNeeded(),e.disconnect()});e.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const s=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(s==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const e=[...this.querySelectorAll("[item-index]")].map(i=>{if(i instanceof tt){i.enableLineClamp=!1;const a=i.missingWidthForTexts;return a>s&&(i.enableLineClamp=!0),a}}),t=Math.max(...e);t>0&&(this.style.width=`${this.offsetWidth+t}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(s=>{s instanceof tt&&(s.enableLineClamp=s.enableLineClamp||s.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const s=[...this.querySelectorAll("[item-index]")],e=new Map,t=document.createDocumentFragment();for(const i of this._itemsRenderData){const a=this.renderItem(i);a.parentElement||t.appendChild(a),e.set(i.dataHash,a);const r=s.indexOf(a);r!==-1&&s.splice(r,1)}this.appendChild(t);for(const i of s)i instanceof tt&&(i.enableLineClamp=!1),this.removeChild(i);e.forEach((i,a)=>{this._elementCache.set(a,i)})}renderItem({index:s,top:e,dataHash:t,data:i}){let a;return i?this._elementCache.has(t)?(a=this._elementCache.get(t),this._elementCache.delete(t)):(a=this.itemGenerator(i,s),a.setAttribute("slot","items")):(a=document.createElement("div"),a.setAttribute("placeholder-item",""),a.setAttribute("slot","items")),Object.assign(a.style,{transform:`translateY(${e}px)`,height:`${this.itemHeight}px`}),a.setAttribute("item-index",s.toString()),a.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),a.setAttribute("aria-posinset",String(s+1)),(!a.id||a.id.startsWith(this.id+"_item_"))&&(a.id=this.id+"_item_"+s),this.itemCount-1==s?a.setAttribute("last",""):a.removeAttribute("last"),this.updateSelectedAttribute(s,a),this.updateFocusedAttribute(s,a),a}updateFocusedAttribute(s,e){this.focusIndex==s&&(this.focusTarget||document.activeElement==this)?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):e.removeAttribute("focused")}updateSelectedAttribute(s,e){const t=this.selectedIndices.indexOf(s)!==-1;t?e.setAttribute("selected",""):e.removeAttribute("selected"),e.setAttribute("aria-selected",String(t))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const s=this.normalizeIndex(this._firstVisibleIndex-2),e=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(s,e);for(let t=s;t<=e;t++){const i=t-s,a=this.items[i];let r;a?r=JSON.stringify(a):r=`placeholder-${i}`,this._itemsRenderData.push({index:t,top:this.itemHeight*t,physicalIndex:i,dataHash:r,data:a})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(s){return Math.max(0,Math.min(s,this.itemCount-1))}get height(){return this.offsetHeight}requestData(s,e){!Number.isNaN(s)&&!Number.isNaN(e)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:s,stopIndex:e}}))}handleSelection(s,e){if(s<0||this.itemCount<=s)return;const t=this.getListItem(s);if(t.getAttribute("aria-disabled")=="true"||t.hasAttribute("disabled"))return;let i=!0;if(this.selectionType!=="trigger-only"){const a=this.selectedIndices.indexOf(s);i=a==-1,i?this.selectionType==="single"?this.selectedIndices=[s]:this.selectedIndices.push(s):this.selectedIndices.splice(a,1),this.requestUpdate("selectedIndices")}this.focusIndex=s,this.dispatchSelectionEvent(s,i,e)}dispatchSelectionEvent(s,e,t){this.dispatchEvent(new CustomEvent("selection",{detail:{index:s,selected:e,hasModifier:t}}))}handleClick(s){const e=s.composedPath().find(t=>t.hasAttribute&&t.hasAttribute("item-index"));if(e){const t=parseInt(e.getAttribute("item-index"));if(Number.isInteger(t)){if(s.button==0||s.button==1){const i=s.type=="auxclick"&&s.button==1||s.metaKey||s.ctrlKey;this.handleSelection(t,i)}this.focusIndex=t}}}},Me.ID="sd-virtual-list",Me.ensureDefined=()=>{tt.ensureDefined(),customElements.get(Me.ID)||customElements.define(Me.ID,Me)},Me);Pe([v({type:Number,attribute:"item-height",reflect:!0})],$e.prototype,"itemHeight",2);Pe([v({type:Number})],$e.prototype,"itemCount",2);Pe([v({type:Array,attribute:!1})],$e.prototype,"items",2);Pe([v({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],$e.prototype,"selectionType",2);Pe([v({type:String,attribute:!0,reflect:!0})],$e.prototype,"id",2);Pe([v({type:String,reflect:!0})],$e.prototype,"role",2);Pe([v({type:Number,attribute:"focus-index",reflect:!0})],$e.prototype,"focusIndex",1);Pe([v({type:Array,attribute:!1})],$e.prototype,"selectedIndices",1);let Ji=$e;Ji.ensureDefined();const El=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:normal;white-space:var(--sd-input-validation-message-minheight, nowrap)}.input::placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;top:0;right:0;bottom:0;left:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}:host(:focus){outline:none}.suffix ::slotted(.clear-button),.suffix ::slotted(.toggle-button){cursor:pointer;width:16px;height:32px;padding:0 8px;margin-top:-8px;margin-bottom:-8px;fill:#666;outline:none;flex-shrink:0}.suffix ::slotted(.toggle-button){transition:transform .2s}:host([opened]) .suffix ::slotted(.toggle-button){transform:rotate(180deg)}:host([disabled]) .suffix ::slotted(.clear-button),:host([disabled]) .suffix ::slotted(.toggle-button){display:none!important}.prefix ::slotted(.icon-wrapper){width:32px;height:32px;padding-right:4px;margin-top:-8px;margin-bottom:-8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}:host(:not([has-value])) .suffix ::slotted(.clear-button),:host([null-setting-disallowed]) .suffix ::slotted(.clear-button){display:none!important}:host(:not([allow-custom-value]):not([trigger-only])) .input{caret-color:transparent}:host(:not([allow-custom-value]):not([disabled])) .input{cursor:pointer}#default-slot{display:none}",Al=`<svg xmlns="http://www.w3.org/2000/svg" class="toggle-button" slot="suffix" viewBox="0 0 16 16">\r
|
|
1520
1528
|
<path d="M13 4v2l-5 5-5-5v-2l5 5z"/>\r
|
|
1521
1529
|
</svg>\r
|
|
1522
1530
|
`,kl=`<svg xmlns="http://www.w3.org/2000/svg" class="clear-button" slot="suffix" viewBox="0 0 16 16">\r
|
|
@@ -1529,7 +1537,7 @@ function updateMandatory(combobox: ComboBox) {
|
|
|
1529
1537
|
<slot @slotchange=${this.onDefaultSlotChange} id="default-slot"></slot>
|
|
1530
1538
|
`}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),t!==i)switch(e){case"opened":{this.handleOpenedStateChange();break}case"item-height":{this._list&&(this._list.itemHeight=this.itemHeight);break}case"id":{this.updateListId();break}}}firstUpdated(e){super.firstUpdated(e),this.value&&!this.comboBoxValue&&this.updateComboBoxValueFromValue(),window.requestAnimationFrame(()=>{this.initClearButtton(),this.initToggleButtton(),this.updateHasValue(),this.addEventListener("click",()=>{this.disabled||(this.opened=!this.opened)}),this.addEventListener("keydown",t=>{this.disabled||this.handleKeyDown(t)})}),this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-autocomplete","list")}updateComboBoxValueFromValue(){if(this.value){const e=this._itemCache.findIndex(t=>(t[this.displayValuePath]??"")===this.value);e>-1?this._comboBoxValue={index:e,item:this._itemCache[e]}:this.allowCustomValue?this._comboBoxValue=this.value:this._comboBoxValue=null,this.updateHasValue(),this.updateIconFromCurrentValue()}}updated(e){super.updated(e),e.has("showIcon")&&(this.showIcon?this._icon==null&&this.initIconWrapper():this._icon!=null&&(this._icon.remove(),this._icon=null)),e.has("currentText")&&this.updateHasValue(),e.has("triggerOnly")&&this._list&&(this._list.selectionType=this.triggerOnly?xt.TriggerOnly:xt.Single)}initIconWrapper(){this._icon=document.createElement("div"),this._icon.className="icon-wrapper",this._icon.role="img";const e=document.createElement("div");e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center",e.style.backgroundSize="cover",e.style.height="24px",e.style.width="24px",this._icon.appendChild(e),this._icon.slot="prefix",this.appendChild(this._icon),this.updateIconFromCurrentValue()}updateIconFromCurrentValue(){var e;this.isCustomValue(this.comboBoxValue)?this.updateIcon(null):this.updateIcon((e=this.comboBoxValue)==null?void 0:e.item)}updateIcon(e){if(this._icon)if(e&&(e.icon||e.iconPlaceholder)){const t=e;t.attributes==null?(this._icon.title="",this._icon.ariaLabel=""):(this._icon.title=t.attributes["icon-attr-title"]??"",this._icon.ariaLabel=t.attributes["icon-attr-aria-label"]??""),this._icon.style.backgroundColor=t.iconBackgroundColor,this._icon.style.display="",Ga.showImage(this._icon.querySelector("div"),e.icon,e.iconPlaceholder)}else this._icon&&(this._icon.style.display="none")}updateHasValue(){this.currentText||this.comboBoxValue!=null&&this.comboBoxValue!=""?(this.setAttribute("has-value",""),this._clearButton&&(this._clearButton.style.display="")):this.removeAttribute("has-value")}shouldFloat(){return super.shouldFloat()||this.comboBoxValue!=null&&this.comboBoxValue!=""}initClearButtton(){const e=document.createElement("template");e.innerHTML=kl,this._clearButton=e.content.firstChild,this.appendChild(this._clearButton),this._clearButton.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.opened=!1,this.clearValue()})}initToggleButtton(){const e=document.createElement("template");e.innerHTML=Al,this._toggleButton=e.content.firstChild,this.appendChild(this._toggleButton),this._toggleButton.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.opened=!this.opened,this.select()})}filterItemsInMemory(){if(this.isLazyLoadConfigured)return;let e=!1;if(this.filterText&&(this.filterProperty?(this._dataProvider.items=this._itemCache.filter(t=>t[this.filterProperty]&&String(t[this.filterProperty]).indexOf(this.filterText)>-1),e=!0):this.inMemoryFilter&&(this._dataProvider.items=this._itemCache.filter(t=>this.inMemoryFilter(this.filterText,t)),e=!0)),!e)this._dataProvider.items=this._itemCache,this._list&&this.updateFocusAndSelectedIndexFromValue();else if(this._list)if(this.comboBoxValue&&!this.isCustomValue(this.comboBoxValue)){let t=this._dataProvider.items.indexOf(this.comboBoxValue.item);if(t==-1){const i=this.comboBoxValue.item.id;i!=null&&(t=this._dataProvider.items.findIndex(a=>a.id==i))}this._list.focusIndex=t,this._list.selectedIndices=t==-1?[]:[t]}else this._list.focusIndex=null;this.opened&&this._popper&&this._popper.update()}ensureListAndPopperInitialized(){if(this._list||(this._list=document.createElement(Ji.ID),this.updateListId(),this._list.classList.add("combo-box-dropdown"),this._list.itemHeight=this.itemHeight,this._list.itemGenerator=this.itemGenerator,this._list.selectionType=this.triggerOnly?xt.TriggerOnly:xt.Single,this._list.setAttribute("focus-target",""),Object.assign(this._list.style,{zIndex:"21000",boxShadow:`rgba(0, 0, 0, 0.14) 0px 2px 2px 0px,
|
|
1531
1539
|
rgba(0, 0, 0, 0.12) 0px 1px 5px 0px,
|
|
1532
|
-
rgba(0, 0, 0, 0.2) 0px 3px 1px -2px`,background:"white",overflowY:"auto"}),this._list.addEventListener("selection",this.handleSelection),this._dataProvider.connectList(this._list)),!this._popper){const e=this;this._popper=el(this,this._list,{placement:"bottom-start",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"hide",enabled:!1},{name:"closeIfReferenceHidden",enabled:!0,phase:"afterWrite",fn({state:t}){t.elements.reference.closeIfNotVisible()}},{name:"offset",options:{offset:({placement:t})=>t.indexOf("top")>-1?[0,-parseInt(getComputedStyle(e).paddingTop,10)]:t.indexOf("bottom")>-1?[0,-parseInt(getComputedStyle(e).paddingBottom,10)]:[0,0]}},{name:"adjustWidthIfNeeded",enabled:!0,phase:"read",fn({state:t}){t.elements.popper.increaseWidthOnNextRenderIfNeeded()}}]})}}closeIfNotVisible(){const e=this.elementFromMiddleOfComboBox();!this.contains(e)&&!this.shadowRoot.contains(e)&&e!==this._list&&(this.triggerOnly&&(this.value=null),this.opened=!1)}elementFromMiddleOfComboBox(){const e=this.getBoundingClientRect();return document.elementFromPoint(e.left+e.width/2,e.top+e.height/2)}async handleOpenedStateChange(){if(this.inputElement.setAttribute("aria-expanded",String(this.opened)),this.opened){if(!this.disabled){this.ensureListAndPopperInitialized();const e=(this.filterText??"")!==(this._lastRequestedFilterText??"");this.isLazyLoadConfigured&&(this.items.length==0||e)&&this.requestData(0,e),this.updateDropdownSizes(),this.ownerDocument.body.appendChild(this._list),this.updateFocusAndSelectedIndexFromValue(),window.requestAnimationFrame(()=>{this._popper&&this._popper.update()}),window.addEventListener("pointerdown",this.handleWindowPointerDown),!this.allowCustomValue&&!this._openedByFilterTextChange&&this.select()}this._openedByFilterTextChange=!1}else await this._list.updateComplete,this._popper&&await this._popper.update,this.ownerDocument.body.removeChild(this._list),window.removeEventListener("pointerdown",this.handleWindowPointerDown),this.updateValueOnClose(),this.clearFilter(),this.setSelectionRange(0,0),this.inputElement.removeAttribute("aria-activedescendant"),this._popper&&(this._popper.destroy(),this._popper=null)}updateValueOnClose(){var t;const e=this.comboBoxValue??"";if(this.nullSettingDisallowed&&!this.value&&this.comboBoxValue)this.restorePreviousSelection();else if(this.value!==(this.convertToDisplayValue(null)??"")){const i=this._dataProvider.items[this._list.focusIndex];if(i&&(i[this.displayValuePath]??"")===this.value){if(i.disabled){this.restorePreviousSelection();return}this.comboBoxValue={index:this._itemCache.indexOf(i),item:i}}else if(this.allowCustomValue||!this.value)this.comboBoxValue=this.value;else{const a=this._itemCache.findIndex(r=>(r[this.displayValuePath]??"")===this.value&&!r.disabled);a>-1?this.comboBoxValue={index:a,item:this._itemCache[a]}:this.restorePreviousSelection()}}else{const i=this._dataProvider.items[this._list.focusIndex];if(i&&i.id!=null){if(i.disabled){this.restorePreviousSelection();return}(!this.comboBoxValue||this.isCustomValue(this.comboBoxValue)||this.comboBoxValue.item.id!=i.id)&&(this.comboBoxValue={index:this._itemCache.indexOf(i),item:i})}}e!==(this.comboBoxValue??"")&&this.dispatchSelectionChangeEvent(),this.updateIcon(this.isCustomValue(this.comboBoxValue)?null:(t=this.comboBoxValue)==null?void 0:t.item)}restorePreviousSelection(){this.updateInputValue(null)}updateFocusAndSelectedIndexFromValue(){if(this.comboBoxValue&&!this.isCustomValue(this.comboBoxValue)&&!this._openedByFilterTextChange){let e=this.comboBoxValue.index;if((e==-1||this.isLazyLoadConfigured)&&(e=this.items.indexOf(this.comboBoxValue.item),e==-1)){const t=this.comboBoxValue.item.id;t!=null&&(e=this.items.findIndex(i=>i.id==t))}this._list.focusIndex=e,this._list.selectedIndices=e==-1?[]:[e]}else this._list.focusIndex=-1,this._list.selectedIndices=[];this.updateActiveDescendant()}navigateInList(e){this.opened?(this._list.focusIndex==null?e>0?this._list.focusIndex=0:this._list.focusIndex=Math.max(0,this._dataProvider.items.length-1):this._list.focusIndex=Math.max(0,Math.min(this._dataProvider.items.length-1,this._list.focusIndex+e)),this.updateInputValue(this._dataProvider.items[this._list.focusIndex]),this.updateActiveDescendant(),this.allowCustomValue||this.select()):this.opened=!0}updateActiveDescendant(){const e=this._list&&this._list.getListItem(this._list.focusIndex);e?this.inputElement.setAttribute("aria-activedescendant",e.id):this.inputElement.removeAttribute("aria-activedescendant")}updateInputValue(e){this.updateComplete.then(()=>{this.value=this.convertToDisplayValue(e),e?this.updateIcon(e):this.updateIconFromCurrentValue()})}convertToDisplayValue(e){return e?e[this.displayValuePath]:this.comboBoxValue?this.isCustomValue(this.comboBoxValue)?this.comboBoxValue:this.comboBoxValue.item[this.displayValuePath]:null}fireValueChange(e){if(e&&this.filterText!==this.value){const t=(this.filterText??"")!==this.value;this.filterText=this.value,this.updateIcon(null),this.opened||(this._openedByFilterTextChange=!0,this.opened=!0),t&&(this.dispatchFilterChangeEvent(),this.debouncedFilterItemsInMemory())}}clearValue(){this.nullSettingDisallowed||(this.value=null,this.inputElement.removeAttribute("aria-activedescendant"),this._list&&(this._list.selectedIndices=[]),this.clearFilter(),this.comboBoxValue&&(this.comboBoxValue=null,this.dispatchSelectionChangeEvent()),this.requestUpdate())}clearFilter(){this.filterText!=null&&(this.filterText=void 0,this.filterItemsInMemory(),this.dispatchFilterChangeEvent(),this.updateIconFromCurrentValue())}updateDropdownSizes(){const t=((window.innerHeight||document.documentElement.clientHeight)-this.offsetHeight)*.5;Object.assign(this._list.style,{maxHeight:`${t}px`,minWidth:`${Math.max(this.offsetWidth,this.minimumOverlayWidth)}px`,maxWidth:`max(50vw, ${this.offsetWidth}px)`})}updateListId(){this.inputElement&&this._list&&(this._list.id=this.id+"_list",this.inputElement.setAttribute("aria-controls",this._list.id))}isCustomValue(e){return typeof e=="string"}dispatchSelectionChangeEvent(){this.updateComplete.then(()=>{var e;if(this.dispatchEvent(new CustomEvent("selection-change",{detail:{selection:this.comboBoxValue,isCustomValue:this.isCustomValue(this.comboBoxValue)}})),this.triggerOnly)this.comboBoxValue=null;else{const t=this.comboBoxValue;this.isCustomValue(t)?this.setFormValue(t):this.setFormValue((e=t==null?void 0:t.item)==null?void 0:e.caption)}}).catch(e=>{console.error("Could not dispatch selection change event due to:",e)})}dispatchFilterChangeEvent(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{value:this.filterText},composed:!0})),this.debouncedRequestData(0)}get isLazyLoadConfigured(){return!!this._onDataRequest}requestData(e,t){if(t==null&&(t=(this.filterText??"")!==(this._lastRequestedFilterText??"")),this.isLazyLoadConfigured){if(!this.opened){t&&(this._dataProvider.items=[],this._itemCache=[]);return}if(this._lastRequestedPage==e&&!t)return;this._pendingDataRequest&&this._pendingDataRequest.cancel(ae.DATA_REQUEST_CANCELLED);const i=new Promise((a,r)=>{this._pendingDataRequest={cancel:r}});this._lastRequestedPage=e,this._lastRequestedFilterText=this.filterText,this.setAttribute("loading",""),Promise.race([i,this._onDataRequest(this._lastRequestedFilterText,e)]).then(a=>{if(this.filterText==this._lastRequestedFilterText&&this._lastRequestedPage==e&&(this._dataProvider.finalSizeIsKnown=a.finalSizeIsKnown,t?(this._dataProvider.items=a.items,this._itemCache=a.items):(this._dataProvider.addItems(a.items),this._itemCache=this._dataProvider.items),this._list&&(this._list.itemCount=this._dataProvider.items.length),this._popper&&this.opened)){if(this.comboBoxValue&&!this.isCustomValue(this.comboBoxValue)){const r=this.comboBoxValue.item;if(this._list.selectedIndices.length==0||this.items[this._list.selectedIndices[0]]!=r){let n=this.items.indexOf(r);if(n==-1){const o=r.id;o!=null&&(n=this.items.findIndex(l=>l.id==o))}this.comboBoxValue.index=n,this._list.selectedIndices=n==-1?[]:[n]}}this.updateDropdownSizes(),this._popper.update()}this._pendingDataRequest=null,this.removeAttribute("loading")}).catch(a=>{a!==ae.DATA_REQUEST_CANCELLED&&(console.error(`Data could not be loaded for filter "${this._lastRequestedFilterText}" and page number "${e}" due to the following error:
|
|
1540
|
+
rgba(0, 0, 0, 0.2) 0px 3px 1px -2px`,background:"white",overflowY:"auto"}),this._list.addEventListener("selection",this.handleSelection),this._dataProvider.connectList(this._list)),!this._popper){const e=this;this._popper=el(this,this._list,{placement:"bottom-start",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"hide",enabled:!1},{name:"closeIfReferenceHidden",enabled:!0,phase:"afterWrite",fn({state:t}){t.elements.reference.closeIfNotVisible()}},{name:"offset",options:{offset:({placement:t})=>{var i;return t.indexOf("top")>-1?[0,-parseInt(getComputedStyle(e).paddingTop,10)]:t.indexOf("bottom")>-1?[0,-parseInt(getComputedStyle(e).paddingBottom,10)-(((i=this.shadowRoot.querySelector(".validation-message-wrapper"))==null?void 0:i.offsetHeight)??0)]:[0,0]}}},{name:"adjustWidthIfNeeded",enabled:!0,phase:"read",fn({state:t}){t.elements.popper.increaseWidthOnNextRenderIfNeeded()}}]})}}closeIfNotVisible(){const e=this.elementFromMiddleOfComboBox();!this.contains(e)&&!this.shadowRoot.contains(e)&&e!==this._list&&(this.triggerOnly&&(this.value=null),this.opened=!1)}elementFromMiddleOfComboBox(){const e=this.getBoundingClientRect();return document.elementFromPoint(e.left+e.width/2,e.top+e.height/2)}async handleOpenedStateChange(){if(this.inputElement.setAttribute("aria-expanded",String(this.opened)),this.opened){if(!this.disabled){this.ensureListAndPopperInitialized();const e=(this.filterText??"")!==(this._lastRequestedFilterText??"");this.isLazyLoadConfigured&&(this.items.length==0||e)&&this.requestData(0,e),this.updateDropdownSizes(),this.ownerDocument.body.appendChild(this._list),this.updateFocusAndSelectedIndexFromValue(),window.requestAnimationFrame(()=>{this._popper&&this._popper.update()}),window.addEventListener("pointerdown",this.handleWindowPointerDown),!this.allowCustomValue&&!this._openedByFilterTextChange&&this.select()}this._openedByFilterTextChange=!1}else await this._list.updateComplete,this._popper&&await this._popper.update,this.ownerDocument.body.removeChild(this._list),window.removeEventListener("pointerdown",this.handleWindowPointerDown),this.updateValueOnClose(),this.clearFilter(),this.setSelectionRange(0,0),this.inputElement.removeAttribute("aria-activedescendant"),this._popper&&(this._popper.destroy(),this._popper=null)}updateValueOnClose(){var t;const e=this.comboBoxValue??"";if(this.nullSettingDisallowed&&!this.value&&this.comboBoxValue)this.restorePreviousSelection();else if(this.value!==(this.convertToDisplayValue(null)??"")){const i=this._dataProvider.items[this._list.focusIndex];if(i&&(i[this.displayValuePath]??"")===this.value){if(i.disabled){this.restorePreviousSelection();return}this.comboBoxValue={index:this._itemCache.indexOf(i),item:i}}else if(this.allowCustomValue||!this.value)this.comboBoxValue=this.value;else{const a=this._itemCache.findIndex(r=>(r[this.displayValuePath]??"")===this.value&&!r.disabled);a>-1?this.comboBoxValue={index:a,item:this._itemCache[a]}:this.restorePreviousSelection()}}else{const i=this._dataProvider.items[this._list.focusIndex];if(i&&i.id!=null){if(i.disabled){this.restorePreviousSelection();return}(!this.comboBoxValue||this.isCustomValue(this.comboBoxValue)||this.comboBoxValue.item.id!=i.id)&&(this.comboBoxValue={index:this._itemCache.indexOf(i),item:i})}}e!==(this.comboBoxValue??"")&&this.dispatchSelectionChangeEvent(),this.updateIcon(this.isCustomValue(this.comboBoxValue)?null:(t=this.comboBoxValue)==null?void 0:t.item)}restorePreviousSelection(){this.updateInputValue(null)}updateFocusAndSelectedIndexFromValue(){if(this.comboBoxValue&&!this.isCustomValue(this.comboBoxValue)&&!this._openedByFilterTextChange){let e=this.comboBoxValue.index;if((e==-1||this.isLazyLoadConfigured)&&(e=this.items.indexOf(this.comboBoxValue.item),e==-1)){const t=this.comboBoxValue.item.id;t!=null&&(e=this.items.findIndex(i=>i.id==t))}this._list.focusIndex=e,this._list.selectedIndices=e==-1?[]:[e]}else this._list.focusIndex=-1,this._list.selectedIndices=[];this.updateActiveDescendant()}navigateInList(e){this.opened?(this._list.focusIndex==null?e>0?this._list.focusIndex=0:this._list.focusIndex=Math.max(0,this._dataProvider.items.length-1):this._list.focusIndex=Math.max(0,Math.min(this._dataProvider.items.length-1,this._list.focusIndex+e)),this.updateInputValue(this._dataProvider.items[this._list.focusIndex]),this.updateActiveDescendant(),this.allowCustomValue||this.select()):this.opened=!0}updateActiveDescendant(){const e=this._list&&this._list.getListItem(this._list.focusIndex);e?this.inputElement.setAttribute("aria-activedescendant",e.id):this.inputElement.removeAttribute("aria-activedescendant")}updateInputValue(e){this.updateComplete.then(()=>{this.value=this.convertToDisplayValue(e),e?this.updateIcon(e):this.updateIconFromCurrentValue()})}convertToDisplayValue(e){return e?e[this.displayValuePath]:this.comboBoxValue?this.isCustomValue(this.comboBoxValue)?this.comboBoxValue:this.comboBoxValue.item[this.displayValuePath]:null}fireValueChange(e){if(e&&this.filterText!==this.value){const t=(this.filterText??"")!==this.value;this.filterText=this.value,this.updateIcon(null),this.opened||(this._openedByFilterTextChange=!0,this.opened=!0),t&&(this.dispatchFilterChangeEvent(),this.debouncedFilterItemsInMemory())}}clearValue(){this.nullSettingDisallowed||(this.value=null,this.inputElement.removeAttribute("aria-activedescendant"),this._list&&(this._list.selectedIndices=[]),this.clearFilter(),this.comboBoxValue&&(this.comboBoxValue=null,this.dispatchSelectionChangeEvent()),this.requestUpdate())}clearFilter(){this.filterText!=null&&(this.filterText=void 0,this.filterItemsInMemory(),this.dispatchFilterChangeEvent(),this.updateIconFromCurrentValue())}updateDropdownSizes(){const t=((window.innerHeight||document.documentElement.clientHeight)-this.offsetHeight)*.5;Object.assign(this._list.style,{maxHeight:`${t}px`,minWidth:`${Math.max(this.offsetWidth,this.minimumOverlayWidth)}px`,maxWidth:`max(50vw, ${this.offsetWidth}px)`})}updateListId(){this.inputElement&&this._list&&(this._list.id=this.id+"_list",this.inputElement.setAttribute("aria-controls",this._list.id))}isCustomValue(e){return typeof e=="string"}dispatchSelectionChangeEvent(){this.updateComplete.then(()=>{var e;if(this.dispatchEvent(new CustomEvent("selection-change",{detail:{selection:this.comboBoxValue,isCustomValue:this.isCustomValue(this.comboBoxValue)}})),this.triggerOnly)this.comboBoxValue=null;else{const t=this.comboBoxValue;this.isCustomValue(t)?this.setFormValue(t):this.setFormValue((e=t==null?void 0:t.item)==null?void 0:e.caption)}}).catch(e=>{console.error("Could not dispatch selection change event due to:",e)})}dispatchFilterChangeEvent(){this.dispatchEvent(new CustomEvent("filter-change",{detail:{value:this.filterText},composed:!0})),this.debouncedRequestData(0)}get isLazyLoadConfigured(){return!!this._onDataRequest}requestData(e,t){if(t==null&&(t=(this.filterText??"")!==(this._lastRequestedFilterText??"")),this.isLazyLoadConfigured){if(!this.opened){t&&(this._dataProvider.items=[],this._itemCache=[]);return}if(this._lastRequestedPage==e&&!t)return;this._pendingDataRequest&&this._pendingDataRequest.cancel(ae.DATA_REQUEST_CANCELLED);const i=new Promise((a,r)=>{this._pendingDataRequest={cancel:r}});this._lastRequestedPage=e,this._lastRequestedFilterText=this.filterText,this.setAttribute("loading",""),Promise.race([i,this._onDataRequest(this._lastRequestedFilterText,e)]).then(a=>{if(this.filterText==this._lastRequestedFilterText&&this._lastRequestedPage==e&&(this._dataProvider.finalSizeIsKnown=a.finalSizeIsKnown,t?(this._dataProvider.items=a.items,this._itemCache=a.items):(this._dataProvider.addItems(a.items),this._itemCache=this._dataProvider.items),this._list&&(this._list.itemCount=this._dataProvider.items.length),this._popper&&this.opened)){if(this.comboBoxValue&&!this.isCustomValue(this.comboBoxValue)){const r=this.comboBoxValue.item;if(this._list.selectedIndices.length==0||this.items[this._list.selectedIndices[0]]!=r){let n=this.items.indexOf(r);if(n==-1){const o=r.id;o!=null&&(n=this.items.findIndex(l=>l.id==o))}this.comboBoxValue.index=n,this._list.selectedIndices=n==-1?[]:[n]}}this.updateDropdownSizes(),this._popper.update()}this._pendingDataRequest=null,this.removeAttribute("loading")}).catch(a=>{a!==ae.DATA_REQUEST_CANCELLED&&(console.error(`Data could not be loaded for filter "${this._lastRequestedFilterText}" and page number "${e}" due to the following error:
|
|
1533
1541
|
${a}`),this._dataProvider.finalSizeIsKnown=!0,this.items.length==0?this.opened=!1:this._list&&(this._list.itemCount=this.items.length),this.removeAttribute("loading")),this._pendingDataRequest=null})}}get defaultSlot(){return this.shadowRoot.querySelector("#default-slot")}onDefaultSlotChange(){this._declarativeItems=this.defaultSlot.assignedElements(),this._declarativeItems.length>0&&(this.finalSizeIsKnown=!0,this.itemGenerator=(e,t)=>this._declarativeItems[t].cloneNode(!0),this.items=this._declarativeItems.map(e=>{const t={caption:e.getAttribute("caption"),description:e.getAttribute("description")};return this.displayValuePath!="caption"&&this.displayValuePath!="description"&&(t[this.displayValuePath]=e[this.displayValuePath]||e.getAttribute(this.displayValuePath)),t}))}},ae.ID=Ml,ae.ensureDefined=()=>{Ji.ensureDefined(),customElements.get(ae.ID)||customElements.define(ae.ID,ae)},ae.formAssociated=!0,ae.DATA_REQUEST_CANCELLED="cancel_data_request",ae);Oe([v({type:Boolean,reflect:!0})],Se.prototype,"opened",2);Oe([v({type:Number,attribute:"item-height"})],Se.prototype,"itemHeight",2);Oe([v({type:Boolean,attribute:"allow-custom-value",reflect:!0})],Se.prototype,"allowCustomValue",2);Oe([v({type:Boolean,attribute:"trigger-only",reflect:!0})],Se.prototype,"triggerOnly",2);Oe([v({type:Boolean,attribute:"null-setting-disallowed",reflect:!0})],Se.prototype,"nullSettingDisallowed",2);Oe([v({type:Boolean,attribute:"show-icon",reflect:!0})],Se.prototype,"showIcon",2);Oe([v({type:String,attribute:"display-value-path",noAccessor:!0})],Se.prototype,"displayValuePath",2);Oe([v({type:String,attribute:"filter-property",noAccessor:!0})],Se.prototype,"filterProperty",2);Oe([v({type:String,attribute:!0,reflect:!0})],Se.prototype,"id",2);let Rl=Se;Rl.ensureDefined();function Ka(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ll(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var a=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:function(){return s[i]}})}),t}var xs={exports:{}},j=String,qa=function(){return{isColorSupported:!1,reset:j,bold:j,dim:j,italic:j,underline:j,inverse:j,hidden:j,strikethrough:j,black:j,red:j,green:j,yellow:j,blue:j,magenta:j,cyan:j,white:j,gray:j,bgBlack:j,bgRed:j,bgGreen:j,bgYellow:j,bgBlue:j,bgMagenta:j,bgCyan:j,bgWhite:j}};xs.exports=qa();xs.exports.createColors=qa;var Pl=xs.exports;const Dl={},Bl=Object.freeze(Object.defineProperty({__proto__:null,default:Dl},Symbol.toStringTag,{value:"Module"})),Ne=Ll(Bl);let na=Pl,ra=Ne,Zi=class Ja extends Error{constructor(e,t,i,a,r,n){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),a&&(this.source=a),n&&(this.plugin=n),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ja)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=na.isColorSupported),ra&&e&&(t=ra(t));let i=t.split(/\r?\n/),a=Math.max(this.line-3,0),r=Math.min(this.line+2,i.length),n=String(r).length,o,l;if(e){let{bold:c,gray:m,red:u}=na.createColors(!0);o=h=>c(u(h)),l=h=>m(h)}else o=l=c=>c;return i.slice(a,r).map((c,m)=>{let u=a+1+m,h=" "+(" "+u).slice(-n)+" | ";if(u===this.line){let g=l(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+l(h)+c+`
|
|
1534
1542
|
`+g+o("^")}return" "+l(h)+c}).join(`
|
|
1535
1543
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
package/dist/docs/index.html
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
margin: 0 auto !important;
|
|
14
14
|
padding-bottom: 45px;
|
|
15
15
|
}
|
|
16
|
+
/* Give space for the popover also below the last example */
|
|
17
|
+
.example-container:last-child {
|
|
18
|
+
margin-bottom: 100px;
|
|
19
|
+
}
|
|
16
20
|
</style>
|
|
17
21
|
<script type="module" crossorigin src="./doc.mjs"></script>
|
|
18
22
|
<link rel="stylesheet" crossorigin href="./doc.css">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cas-smartdesign/combo-box",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.2",
|
|
4
4
|
"description": "A combo-box element with the look and feel of the SmartDesign inputs & list item layouts",
|
|
5
5
|
"main": "dist/combo-box-with-externals.js",
|
|
6
6
|
"module": "dist/combo-box.mjs",
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"@popperjs/core": "^2.11.8",
|
|
11
11
|
"lit": "^2.8.0",
|
|
12
12
|
"@cas-smartdesign/image-tools": "^3.0.2",
|
|
13
|
-
"@cas-smartdesign/lit-input": "^7.3.
|
|
13
|
+
"@cas-smartdesign/lit-input": "^7.3.1",
|
|
14
14
|
"@cas-smartdesign/virtual-list": "^6.2.4",
|
|
15
15
|
"@cas-smartdesign/list-item": "^7.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@cas-smartdesign/element-preview": "^0.2.2",
|
|
19
18
|
"@cas-smartdesign/license-generator": "^1.6.3",
|
|
19
|
+
"@cas-smartdesign/element-preview": "^0.2.2",
|
|
20
20
|
"@cas-smartdesign/field-validation-message": "^5.0.2"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|