@govtechsg/sgds-web-component 3.11.0 → 3.12.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Checkbox/index.umd.min.js +6 -6
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +240 -240
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +22 -22
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +8 -8
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +14 -14
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.d.ts +1 -0
- package/components/Input/sgds-input.js +1 -4
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/sgds-modal.d.ts +1 -1
- package/components/Modal/sgds-modal.js +1 -1
- package/components/Modal/sgds-modal.js.map +1 -1
- package/components/QuantityToggle/index.umd.min.js +2 -2
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Radio/index.umd.min.js +9 -9
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +11 -11
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Tab/index.umd.min.js.map +1 -1
- package/components/Tab/sgds-tab-group.d.ts +2 -2
- package/components/Tab/sgds-tab-group.js +2 -2
- package/components/Tab/sgds-tab-group.js.map +1 -1
- package/components/Textarea/index.umd.min.js +6 -6
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/Textarea/sgds-textarea.d.ts +2 -0
- package/components/Textarea/sgds-textarea.js +14 -2
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/index.umd.min.js +4 -4
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +2 -2
- package/index.umd.min.js +49 -49
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Input/sgds-input.cjs.js +1 -4
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +1 -4
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Modal/sgds-modal.cjs.js +1 -1
- package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
- package/react/components/Modal/sgds-modal.js +1 -1
- package/react/components/Modal/sgds-modal.js.map +1 -1
- package/react/components/Tab/sgds-tab-group.cjs.js +2 -2
- package/react/components/Tab/sgds-tab-group.cjs.js.map +1 -1
- package/react/components/Tab/sgds-tab-group.js +2 -2
- package/react/components/Tab/sgds-tab-group.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js +14 -2
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.js +14 -2
- package/react/components/Textarea/sgds-textarea.js.map +1 -1
- package/react/index.cjs.js +12 -12
- package/react/index.d.ts +2 -2
- package/react/index.js +2 -2
- package/react/utils/inputValidationController.cjs.js +2 -1
- package/react/utils/inputValidationController.cjs.js.map +1 -1
- package/react/utils/inputValidationController.js +2 -1
- package/react/utils/inputValidationController.js.map +1 -1
- package/react/utils/validatorMixin.cjs.js +24 -6
- package/react/utils/validatorMixin.cjs.js.map +1 -1
- package/react/utils/validatorMixin.js +24 -6
- package/react/utils/validatorMixin.js.map +1 -1
- package/utils/inputValidationController.js +2 -1
- package/utils/inputValidationController.js.map +1 -1
- package/utils/validatorMixin.js +24 -6
- package/utils/validatorMixin.js.map +1 -1
|
@@ -10,7 +10,7 @@ const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const C=globalThis,S=e=>{C.emitLitDebugLogEvents&&C.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let V,P=0;C.litIssuedWarnings??=new Set,V=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",C.litIssuedWarnings.has(t)||C.litIssuedWarnings.has(e)||(console.warn(t),C.litIssuedWarnings.add(t))},queueMicrotask(()=>{V("dev-mode","Lit is in dev mode. Not recommended for production!")});const E=C.ShadyDOM?.inUse&&!0===C.ShadyDOM?.noPatch?C.ShadyDOM.wrap:e=>e,T=C.trustedTypes,I=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,U=e=>e,M=(e,t,i)=>U,N=e=>{if(re!==M)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");re=e},O=()=>{re=M},z=(e,t,i)=>re(e,t,i),R="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+F,A=`<${L}>`,D=document,W=()=>D.createComment(""),q=e=>null===e||"object"!=typeof e&&"function"!=typeof e,j=Array.isArray,H="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,G=/>/g,K=new RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),J=/'/g,Y=/"/g,X=/^(?:script|style|textarea|title)$/i,Q=(ee=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&V("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:ee,strings:e,values:t}));var ee;const te=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),se=new WeakMap,ne=D.createTreeWalker(D,129);let re=M;function oe(e,t){if(!j(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==I?I.createHTML(t):t}class ae{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,r=0;const o=e.length-1,a=this.parts,[l,d]=((e,t)=>{const i=e.length-1,s=[];let n,r=2===t?"<svg>":3===t?"<math>":"",o=B;for(let t=0;t<i;t++){const i=e[t];let a,l,d=-1,h=0;for(;h<i.length&&(o.lastIndex=h,l=o.exec(i),null!==l);)if(h=o.lastIndex,o===B){if("!--"===l[1])o=Z;else if(void 0!==l[1])o=G;else if(void 0!==l[2])X.test(l[2])&&(n=new RegExp(`</${l[2]}`,"g")),o=K;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===K?">"===l[0]?(o=n??B,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?K:'"'===l[3]?Y:J):o===Y||o===J?o=K:o===Z||o===G?o=B:(o=K,n=void 0);console.assert(-1===d||o===K||o===J||o===Y,"unexpected parse state B");const c=o===K&&e[t+1].startsWith("/>")?" ":"";r+=o===B?i+A:d>=0?(s.push(a),i.slice(0,d)+R+i.slice(d)+F+c):i+F+(-2===d?t:c)}return[oe(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=ae.createElement(l,i),ne.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=ne.nextNode())&&a.length<o;){if(1===s.nodeType){{const e=s.localName;if(/^(?:textarea|template)$/i.test(e)&&s.innerHTML.includes(F)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);V("",t)}}if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(R)){const t=d[r++],i=s.getAttribute(e).split(F),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:o[2],strings:i,ctor:"."===o[1]?ue:"?"===o[1]?pe:"@"===o[1]?me:ce}),s.removeAttribute(e)}else e.startsWith(F)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(X.test(s.tagName)){const e=s.textContent.split(F),t=e.length-1;if(t>0){s.textContent=T?T.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],W()),ne.nextNode(),a.push({type:2,index:++n});s.append(e[t],W())}}}else if(8===s.nodeType){if(s.data===L)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(F,e+1));)a.push({type:7,index:n}),e+=F.length-1}}n++}if(d.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");S&&S({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=D.createElement("template");return i.innerHTML=e,i}}function le(e,t,i=e,s){if(t===te)return t;let n=void 0!==s?i.__directives?.[s]:i.__directive;const r=q(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?n=void 0:(n=new r(e),n._$initialize(e,i,s)),void 0!==s?(i.__directives??=[])[s]=n:i.__directive=n),void 0!==n&&(t=le(e,n._$resolve(e,t.values),n,s)),t}class de{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,s=(e?.creationScope??D).importNode(t,!0);ne.currentNode=s;let n=ne.nextNode(),r=0,o=0,a=i[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new he(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new fe(n,this,e)),this._$parts.push(t),a=i[++o]}r!==a?.index&&(n=ne.nextNode(),r++)}return ne.currentNode=D,s}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(S&&S({kind:"set part",part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class he{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,s){this.type=2,this._$committedValue=ie,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=s,this.__isConnected=s?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=E(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=le(this,e,t),q(e))e===ie||null==e||""===e?(this._$committedValue!==ie&&(S&&S({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ie):e!==this._$committedValue&&e!==te&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>j(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return E(E(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),re!==M){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}S&&S({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==ie&&q(this._$committedValue)){const t=E(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),S&&S({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=D.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),S&&S({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=ae.createElement(oe(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===s)S&&S({kind:"template updating",template:s,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new de(s,this),i=e._clone(this.options);S&&S({kind:"template instantiated",template:s,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),S&&S({kind:"template instantiated and updated",template:s,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=se.get(e.strings);return void 0===t&&se.set(e.strings,t=new ae(e)),t}_commitIterable(e){j(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,s=0;for(const n of e)s===t.length?t.push(i=new he(this._insert(W()),this._insert(W()),this,this.options)):i=t[s],i._$setValue(n),s++;s<t.length&&(this._$clear(i&&E(i._$endNode).nextSibling,s),t.length=s)}_$clear(e=E(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=E(e).nextSibling;E(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ce{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,s,n){this.type=1,this._$committedValue=ie,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=ie,this._sanitizer=void 0}_$setValue(e,t=this,i,s){const n=this.strings;let r=!1;if(void 0===n)e=le(this,e,t,0),r=!q(e)||e!==this._$committedValue&&e!==te,r&&(this._$committedValue=e);else{const s=e;let o,a;for(e=n[0],o=0;o<n.length-1;o++)a=le(this,s[i+o],t,o),a===te&&(a=this._$committedValue[o]),r||=!q(a)||a!==this._$committedValue[o],a===ie?e=ie:e!==ie&&(e+=(a??"")+n[o+1]),this._$committedValue[o]=a}r&&!s&&this._commitValue(e)}_commitValue(e){e===ie?E(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"attribute")),e=this._sanitizer(e??""),S&&S({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),E(this.element).setAttribute(this.name,e??""))}}class ue extends ce{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"property")),e=this._sanitizer(e),S&&S({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===ie?void 0:e}}class pe extends ce{constructor(){super(...arguments),this.type=4}_commitValue(e){S&&S({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===ie),options:this.options}),E(this.element).toggleAttribute(this.name,!!e&&e!==ie)}}class me extends ce{constructor(e,t,i,s,n){if(super(e,t,i,s,n),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=le(this,e,t,0)??ie)===te)return;const i=this._$committedValue,s=e===ie&&i!==ie||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==ie&&(i===ie||s);S&&S({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:s,addListener:n,oldListener:i}),s&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class fe{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){S&&S({kind:"commit to element binding",element:this.element,value:e,options:this.options}),le(this,e)}}const ge=C.litHtmlPolyfillSupportDevMode;ge?.(ae,he),(C.litHtmlVersions??=[]).push("3.3.2"),C.litHtmlVersions.length>1&&queueMicrotask(()=>{V("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const ve=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const s=P++,n=i?.renderBefore??t;let r=n._$litPart$;if(S&&S({kind:"begin render",id:s,value:e,container:t,options:i,part:r}),void 0===r){const e=i?.renderBefore??null;n._$litPart$=r=new he(t.insertBefore(W(),e),e,void 0,i??{})}return r._$setValue(e),S&&S({kind:"end render",id:s,value:e,container:t,options:i,part:r}),r};ve.setSanitizer=N,ve.createSanitizer=z,ve._testOnlyClearSanitizerFactoryDoNotCallOrElse=O;
|
|
13
|
+
const S=globalThis,C=e=>{S.emitLitDebugLogEvents&&S.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let V,P=0;S.litIssuedWarnings??=new Set,V=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",S.litIssuedWarnings.has(t)||S.litIssuedWarnings.has(e)||(console.warn(t),S.litIssuedWarnings.add(t))},queueMicrotask(()=>{V("dev-mode","Lit is in dev mode. Not recommended for production!")});const E=S.ShadyDOM?.inUse&&!0===S.ShadyDOM?.noPatch?S.ShadyDOM.wrap:e=>e,T=S.trustedTypes,I=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,U=e=>e,M=(e,t,i)=>U,N=e=>{if(re!==M)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");re=e},O=()=>{re=M},z=(e,t,i)=>re(e,t,i),R="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+F,A=`<${L}>`,D=document,W=()=>D.createComment(""),q=e=>null===e||"object"!=typeof e&&"function"!=typeof e,j=Array.isArray,H="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,G=/>/g,K=new RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),J=/'/g,Y=/"/g,X=/^(?:script|style|textarea|title)$/i,Q=(ee=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&V("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:ee,strings:e,values:t}));var ee;const te=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),se=new WeakMap,ne=D.createTreeWalker(D,129);let re=M;function oe(e,t){if(!j(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==I?I.createHTML(t):t}class ae{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,r=0;const o=e.length-1,a=this.parts,[l,d]=((e,t)=>{const i=e.length-1,s=[];let n,r=2===t?"<svg>":3===t?"<math>":"",o=B;for(let t=0;t<i;t++){const i=e[t];let a,l,d=-1,h=0;for(;h<i.length&&(o.lastIndex=h,l=o.exec(i),null!==l);)if(h=o.lastIndex,o===B){if("!--"===l[1])o=Z;else if(void 0!==l[1])o=G;else if(void 0!==l[2])X.test(l[2])&&(n=new RegExp(`</${l[2]}`,"g")),o=K;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===K?">"===l[0]?(o=n??B,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?K:'"'===l[3]?Y:J):o===Y||o===J?o=K:o===Z||o===G?o=B:(o=K,n=void 0);console.assert(-1===d||o===K||o===J||o===Y,"unexpected parse state B");const c=o===K&&e[t+1].startsWith("/>")?" ":"";r+=o===B?i+A:d>=0?(s.push(a),i.slice(0,d)+R+i.slice(d)+F+c):i+F+(-2===d?t:c)}return[oe(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=ae.createElement(l,i),ne.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=ne.nextNode())&&a.length<o;){if(1===s.nodeType){{const e=s.localName;if(/^(?:textarea|template)$/i.test(e)&&s.innerHTML.includes(F)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);V("",t)}}if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(R)){const t=d[r++],i=s.getAttribute(e).split(F),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:o[2],strings:i,ctor:"."===o[1]?ue:"?"===o[1]?pe:"@"===o[1]?me:ce}),s.removeAttribute(e)}else e.startsWith(F)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(X.test(s.tagName)){const e=s.textContent.split(F),t=e.length-1;if(t>0){s.textContent=T?T.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],W()),ne.nextNode(),a.push({type:2,index:++n});s.append(e[t],W())}}}else if(8===s.nodeType){if(s.data===L)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(F,e+1));)a.push({type:7,index:n}),e+=F.length-1}}n++}if(d.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");C&&C({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=D.createElement("template");return i.innerHTML=e,i}}function le(e,t,i=e,s){if(t===te)return t;let n=void 0!==s?i.__directives?.[s]:i.__directive;const r=q(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?n=void 0:(n=new r(e),n._$initialize(e,i,s)),void 0!==s?(i.__directives??=[])[s]=n:i.__directive=n),void 0!==n&&(t=le(e,n._$resolve(e,t.values),n,s)),t}class de{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,s=(e?.creationScope??D).importNode(t,!0);ne.currentNode=s;let n=ne.nextNode(),r=0,o=0,a=i[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new he(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new fe(n,this,e)),this._$parts.push(t),a=i[++o]}r!==a?.index&&(n=ne.nextNode(),r++)}return ne.currentNode=D,s}_update(e){let t=0;for(const i of this._$parts)void 0!==i&&(C&&C({kind:"set part",part:i,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==i.strings?(i._$setValue(e,i,t),t+=i.strings.length-2):i._$setValue(e[t])),t++}}class he{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,s){this.type=2,this._$committedValue=ie,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=s,this.__isConnected=s?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=E(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=le(this,e,t),q(e))e===ie||null==e||""===e?(this._$committedValue!==ie&&(C&&C({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ie):e!==this._$committedValue&&e!==te&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>j(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return E(E(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),re!==M){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}C&&C({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==ie&&q(this._$committedValue)){const t=E(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),C&&C({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=D.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=z(t,"data","property")),e=this._textSanitizer(e),C&&C({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$getTemplate(e):(void 0===i.el&&(i.el=ae.createElement(oe(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===s)C&&C({kind:"template updating",template:s,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new de(s,this),i=e._clone(this.options);C&&C({kind:"template instantiated",template:s,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),e._update(t),C&&C({kind:"template instantiated and updated",template:s,instance:e,parts:e._$parts,options:this.options,fragment:i,values:t}),this._commitNode(i),this._$committedValue=e}}_$getTemplate(e){let t=se.get(e.strings);return void 0===t&&se.set(e.strings,t=new ae(e)),t}_commitIterable(e){j(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,s=0;for(const n of e)s===t.length?t.push(i=new he(this._insert(W()),this._insert(W()),this,this.options)):i=t[s],i._$setValue(n),s++;s<t.length&&(this._$clear(i&&E(i._$endNode).nextSibling,s),t.length=s)}_$clear(e=E(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=E(e).nextSibling;E(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ce{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,s,n){this.type=1,this._$committedValue=ie,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=ie,this._sanitizer=void 0}_$setValue(e,t=this,i,s){const n=this.strings;let r=!1;if(void 0===n)e=le(this,e,t,0),r=!q(e)||e!==this._$committedValue&&e!==te,r&&(this._$committedValue=e);else{const s=e;let o,a;for(e=n[0],o=0;o<n.length-1;o++)a=le(this,s[i+o],t,o),a===te&&(a=this._$committedValue[o]),r||=!q(a)||a!==this._$committedValue[o],a===ie?e=ie:e!==ie&&(e+=(a??"")+n[o+1]),this._$committedValue[o]=a}r&&!s&&this._commitValue(e)}_commitValue(e){e===ie?E(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"attribute")),e=this._sanitizer(e??""),C&&C({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),E(this.element).setAttribute(this.name,e??""))}}class ue extends ce{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"property")),e=this._sanitizer(e),C&&C({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===ie?void 0:e}}class pe extends ce{constructor(){super(...arguments),this.type=4}_commitValue(e){C&&C({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===ie),options:this.options}),E(this.element).toggleAttribute(this.name,!!e&&e!==ie)}}class me extends ce{constructor(e,t,i,s,n){if(super(e,t,i,s,n),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=le(this,e,t,0)??ie)===te)return;const i=this._$committedValue,s=e===ie&&i!==ie||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==ie&&(i===ie||s);C&&C({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:s,addListener:n,oldListener:i}),s&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class fe{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){C&&C({kind:"commit to element binding",element:this.element,value:e,options:this.options}),le(this,e)}}const ge=S.litHtmlPolyfillSupportDevMode;ge?.(ae,he),(S.litHtmlVersions??=[]).push("3.3.2"),S.litHtmlVersions.length>1&&queueMicrotask(()=>{V("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const ve=(e,t,i)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const s=P++,n=i?.renderBefore??t;let r=n._$litPart$;if(C&&C({kind:"begin render",id:s,value:e,container:t,options:i,part:r}),void 0===r){const e=i?.renderBefore??null;n._$litPart$=r=new he(t.insertBefore(W(),e),e,void 0,i??{})}return r._$setValue(e),C&&C({kind:"end render",id:s,value:e,container:t,options:i,part:r}),r};ve.setSanitizer=N,ve.createSanitizer=z,ve._testOnlyClearSanitizerFactoryDoNotCallOrElse=O;
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
@@ -22,12 +22,12 @@ const _e=globalThis;let be;_e.litIssuedWarnings??=new Set,be=(e,t)=>{t+=` See ht
|
|
|
22
22
|
* Copyright 2017 Google LLC
|
|
23
23
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
24
|
*/
|
|
25
|
-
let $e;ke?.({LitElement:ye}),(_e.litElementVersions??=[]).push("4.2.2"),_e.litElementVersions.length>1&&queueMicrotask(()=>{be("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,$e=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,globalThis.litIssuedWarnings.has(t)||globalThis.litIssuedWarnings.has(e)||(console.warn(t),globalThis.litIssuedWarnings.add(t))};const xe={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:k},
|
|
25
|
+
let $e;ke?.({LitElement:ye}),(_e.litElementVersions??=[]).push("4.2.2"),_e.litElementVersions.length>1&&queueMicrotask(()=>{be("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,$e=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,globalThis.litIssuedWarnings.has(t)||globalThis.litIssuedWarnings.has(e)||(console.warn(t),globalThis.litIssuedWarnings.add(t))};const xe={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:k},Se=(e=xe,t,i)=>{const{kind:s,metadata:n}=i;null==n&&$e("missing-class-metadata",`The class ${t} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);let r=globalThis.litPropertyMetadata.get(n);if(void 0===r&&globalThis.litPropertyMetadata.set(n,r=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===s){const{name:s}=i;return{set(i){const n=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,n,e,!0,i)},init(t){return void 0!==t&&this._$changeProperty(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=i;return function(i){const n=this[s];t.call(this,i),this.requestUpdate(s,n,e,!0,i)}}throw new Error(`Unsupported decorator location: ${s}`)};function Ce(e){return(t,i)=>"object"==typeof i?Se(e,t,i):((e,t,i)=>{const s=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}
|
|
26
26
|
/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
29
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
-
*/function Ve(e){return
|
|
30
|
+
*/function Ve(e){return Ce({...e,state:!0,attribute:!1})}
|
|
31
31
|
/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2017 Google LLC
|
|
@@ -76,7 +76,7 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
|
|
|
76
76
|
* Copyright 2020 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
class extends Ne{constructor(e){if(super(e),e.type!==Ie&&e.type!==Te&&e.type!==Ue)throw new Error("The `live` directive is not allowed on child or event bindings");if(void 0!==e.strings)throw new Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===te||t===ie)return t;const i=e.element,s=e.name;if(e.type===Ie){if(t===i[s])return te}else if(e.type===Ue){if(!!t===i.hasAttribute(s))return te}else if(e.type===Te&&i.getAttribute(s)===String(t))return te;return((e,t=ze)=>{e._$committedValue=t})(e),t}});var Fe=o`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Le=o`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ae=o`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,De=o`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`,We=o`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class qe extends ye{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(s){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function je(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}qe.styles=[We],qe.dependencies={},e([Se({type:Boolean,reflect:!0})],qe.prototype,"ssr",void 0);class He extends qe{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=je("input"),this._labelId=je("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}He.styles=[...qe.styles,Fe,Le,Ae,De],e([Se({reflect:!0})],He.prototype,"label",void 0),e([Se({reflect:!0})],He.prototype,"hintText",void 0),e([Se({reflect:!0})],He.prototype,"name",void 0),e([Se({type:Boolean,reflect:!0})],He.prototype,"disabled",void 0),e([Se({type:Boolean,reflect:!0})],He.prototype,"invalid",void 0);const Be=(e="value")=>(t,i)=>{const s=t.constructor,n=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(t,r,o){var a;const l=s.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e).toLowerCase()){const t=l.converter||w,s=("function"==typeof t?t:null!==(a=null==t?void 0:t.fromAttribute)&&void 0!==a?a:w.fromAttribute)(o,l.type);this[e]!==s&&(this[i]=s)}n.call(this,t,r,o)}};class Ze{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Ge=t=>{class i extends t{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ze(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||(this._mixinSetFormValue(),this._mixinValidate(this.input))}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,i){return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ee("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ee("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};function Ke(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,s)=>{const{update:n}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),n=this[r];t!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](t,n))}n.call(this,e)}}}}var Je=o`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path d="M14.347 3.979a.522.522 0 0 1 0 .739L7.043 12.02a.521.521 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0Z" fill="%23fff"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5Z" fill="%23fff"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`,Ye=o`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);height:var(--sgds-form-height-sm);width:var(--sgds-form-width-xs)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Xe extends(Ge(He)){constructor(){super(...arguments),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.invalidFeedback="",this._isTouched=!1}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&(this.indeterminate=!this.indeterminate),this.checked=!this.checked,super._mixinHandleChange(e),this.emit("sgds-change",{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit("sgds-check",{detail:{value:this.value}}):this.emit("sgds-uncheck",{detail:{value:this.value}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleBlur(){this._isTouched=!0,this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent("reset")),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit("sgds-check",{detail:{value:this.value}})}render(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback;return Q`
|
|
79
|
+
class extends Ne{constructor(e){if(super(e),e.type!==Ie&&e.type!==Te&&e.type!==Ue)throw new Error("The `live` directive is not allowed on child or event bindings");if(void 0!==e.strings)throw new Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===te||t===ie)return t;const i=e.element,s=e.name;if(e.type===Ie){if(t===i[s])return te}else if(e.type===Ue){if(!!t===i.hasAttribute(s))return te}else if(e.type===Te&&i.getAttribute(s)===String(t))return te;return((e,t=ze)=>{e._$committedValue=t})(e),t}});var Fe=o`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Le=o`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,Ae=o`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,De=o`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`,We=o`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class qe extends ye{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(s){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function je(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}qe.styles=[We],qe.dependencies={},e([Ce({type:Boolean,reflect:!0})],qe.prototype,"ssr",void 0);class He extends qe{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=je("input"),this._labelId=je("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}He.styles=[...qe.styles,Fe,Le,Ae,De],e([Ce({reflect:!0})],He.prototype,"label",void 0),e([Ce({reflect:!0})],He.prototype,"hintText",void 0),e([Ce({reflect:!0})],He.prototype,"name",void 0),e([Ce({type:Boolean,reflect:!0})],He.prototype,"disabled",void 0),e([Ce({type:Boolean,reflect:!0})],He.prototype,"invalid",void 0);const Be=(e="value")=>(t,i)=>{const s=t.constructor,n=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(t,r,o){var a;const l=s.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e).toLowerCase()){const t=l.converter||w,s=("function"==typeof t?t:null!==(a=null==t?void 0:t.fromAttribute)&&void 0!==a?a:w.fromAttribute)(o,l.type);this[e]!==s&&(this[i]=s)}n.call(this,t,r,o)}};class Ze{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Ge=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ze(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1))}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ee("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ee("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};function Ke(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,s)=>{const{update:n}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),n=this[r];t!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](t,n))}n.call(this,e)}}}}var Je=o`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-md)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path d="M14.347 3.979a.522.522 0 0 1 0 .739L7.043 12.02a.521.521 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0Z" fill="%23fff"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5Z" fill="%23fff"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1}.form-check{margin:var(--sgds-form-padding-inline-sm) 0;padding:0}`,Ye=o`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);height:var(--sgds-form-height-sm);width:var(--sgds-form-width-xs)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Xe extends(Ge(He)){constructor(){super(...arguments),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.invalidFeedback="",this._isTouched=!1}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&(this.indeterminate=!this.indeterminate),this.checked=!this.checked,super._mixinHandleChange(e),this.emit("sgds-change",{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit("sgds-check",{detail:{value:this.value}}):this.emit("sgds-uncheck",{detail:{value:this.value}})}_handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||this.click()}_handleBlur(){this._isTouched=!0,this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent("reset")),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit("sgds-check",{detail:{value:this.value}})}render(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback;return Q`
|
|
80
80
|
<div class="form-check">
|
|
81
81
|
<input
|
|
82
82
|
class=${Oe({"form-check-input":!0,"is-invalid":e&&this.invalid})}
|
|
@@ -114,7 +114,7 @@ class extends Ne{constructor(e){if(super(e),e.type!==Ie&&e.type!==Te&&e.type!==U
|
|
|
114
114
|
</div>
|
|
115
115
|
</div>
|
|
116
116
|
`:ie}
|
|
117
|
-
`;var i}}Xe.styles=[...He.styles,Ye,Je],e([
|
|
117
|
+
`;var i}}Xe.styles=[...He.styles,Ye,Je],e([Ce({type:String,reflect:!0})],Xe.prototype,"value",void 0),e([Ce({type:Boolean,reflect:!0})],Xe.prototype,"checked",void 0),e([Ce({type:String,reflect:!0})],Xe.prototype,"hasFeedback",void 0),e([Be("checked")],Xe.prototype,"defaultChecked",void 0),e([Ce({type:Boolean,reflect:!0})],Xe.prototype,"indeterminate",void 0),e([Ce({type:Boolean,reflect:!0})],Xe.prototype,"required",void 0),e([Ce({type:String,reflect:!0})],Xe.prototype,"invalidFeedback",void 0),e([Ve()],Xe.prototype,"_isTouched",void 0),e([Ke("disabled",{waitUntilFirstUpdate:!0})],Xe.prototype,"_handleDisabledChange",null),e([Ke("_isTouched",{waitUntilFirstUpdate:!0})],Xe.prototype,"_handleIsTouched",null);var Qe,et=o`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-50)}`;class tt extends(Ge(He)){constructor(){super(...arguments),this.label="",this.invalidFeedback="Please tick at least one box if you want to proceed",this.hasFeedback=!1,this.hintText="",this.required=!1,this.value="",this._isTouched=!1,this.defaultValue="",this._blurredCheckboxes=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-check",e=>{const{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener("sgds-uncheck",e=>{const{value:t}=e.detail;this._removeValue(t)}),this.addEventListener("sgds-blur",e=>{const t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())})}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){const e=Q` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){const t=this.value?this.value.split(";"):[];t.push(e),this.value=t.join(";")}_removeValue(e){const t=(this.value?this.value.split(";"):[]).filter(t=>t!==e);this.value=t.join(";")}_sanitizeSlot(){this._checkboxes.forEach(e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?"style":null,e.required&&(console.error("Checkboxes in a group cannot have required or hasFeedback prop set to true"),e.remove())}),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){if(this.disabled){this._checkboxes.forEach(e=>e.disabled=this.disabled)}}_handleValueChange(){if("reset"===this.formEvent&&this.value===this.defaultValue)return void(this.formEvent=null);this.emit("sgds-change");this._checkboxes.forEach(e=>{e.checked=this.value.includes(e.value)}),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach(e=>e.invalid=this.invalid)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue("reset"),this._mixinResetValidity(this.input)}async _updateInputValue(e="change"){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e)),this.formEvent=e}render(){return Q`
|
|
118
118
|
<fieldset>
|
|
119
119
|
<div class="label-hint-container">
|
|
120
120
|
<label class="form-label">${this.label}</label>
|
|
@@ -148,5 +148,5 @@ class extends Ne{constructor(e){if(super(e),e.type!==Ie&&e.type!==Te&&e.type!==U
|
|
|
148
148
|
</div>
|
|
149
149
|
`:ie}
|
|
150
150
|
</fieldset>
|
|
151
|
-
`}}function it(e,t){customElements.get(e)||customElements.define(e,t)}tt.styles=[...He.styles,et],e([
|
|
151
|
+
`}}function it(e,t){customElements.get(e)||customElements.define(e,t)}tt.styles=[...He.styles,et],e([Ce({reflect:!0})],tt.prototype,"label",void 0),e([Ce({type:String,reflect:!0})],tt.prototype,"invalidFeedback",void 0),e([Ce({type:Boolean,reflect:!0})],tt.prototype,"hasFeedback",void 0),e([Ce({reflect:!0})],tt.prototype,"hintText",void 0),e([Ce({type:Boolean,reflect:!0})],tt.prototype,"required",void 0),e([Ce({reflect:!0})],tt.prototype,"value",void 0),e([Ve()],tt.prototype,"_isTouched",void 0),e([Be()],tt.prototype,"defaultValue",void 0),e([Ve()],tt.prototype,"_blurredCheckboxes",void 0),e([Ve()],tt.prototype,"formEvent",void 0),e([(e,t)=>{const{slot:i,selector:s}=Qe??{},n="slot"+(i?`[name=${i}]`:":not([name])");return Pe(e,t,{get(){const e=this.renderRoot?.querySelector(n),t=e?.assignedElements(Qe)??[];return void 0===s?t:t.filter(e=>e.matches(s))}})}],tt.prototype,"_checkboxes",void 0),e([Ke("value",{waitUntilFirstUpdate:!0})],tt.prototype,"_handleValueChange",null),e([Ke("_isTouched",{waitUntilFirstUpdate:!0})],tt.prototype,"_handleIsTouched",null),e([Ke("invalid",{waitUntilFirstUpdate:!0})],tt.prototype,"_updateInvalid",null),it("sgds-checkbox",Xe),it("sgds-checkbox-group",tt)});
|
|
152
152
|
//# sourceMappingURL=index.umd.min.js.map
|