@ctrliq/quantic-components 1.61.0 → 1.61.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/checkbox/index.js +3 -1
- package/dist/code-input/index.d.ts +2 -0
- package/dist/code-input/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/meta/index.js.map +1 -1
- package/dist/quantic-components.js +15 -2
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +3 -3
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/types/code-input/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -33956,7 +33956,7 @@ function Ki({context:e}){return(t,i)=>{const n=new WeakMap;if("object"==typeof i
|
|
|
33956
33956
|
[hidden] {
|
|
33957
33957
|
display: none;
|
|
33958
33958
|
}
|
|
33959
|
-
`,e.CardTitle=t([Ce("quantic-card-title")],e.CardTitle);const sn={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.CodeInput=class extends(Si(fe)){constructor(){super(),this.value="",this.rows=4,this.name="",this.placeholder="",this.size=sn.Medium,this.disabled=!1,this.readOnly=!1,this.required=!1,this.invalid=!1,this.lineNumbers=!1,this.stretch=!1,this.lineCount=1,this.internals=this.attachInternals()}updated(e){e.has("value")&&(this.internals.setFormValue(this.value),this.updateValidity(),this.lineCount=Math.max(1,this.value.split("\n").length))}handleInput(e){const t=e.target;this.value=t.value,this.lineCount=Math.max(1,this.value.split("\n").length),this.internals.setFormValue(this.value),this.updateValidity(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value},bubbles:!0,composed:!0}))}forwardNative(e){const t={bubbles:!0,cancelable:e.cancelable,composed:!0};e instanceof KeyboardEvent?this.dispatchEvent(new KeyboardEvent(e.type,{...t,key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey})):e instanceof FocusEvent?this.dispatchEvent(new FocusEvent(e.type,{...t,relatedTarget:e.relatedTarget})):this.dispatchEvent(new Event(e.type,t))}handleScroll(e){const t=e.target;this.lineNumbersEl&&(this.lineNumbersEl.scrollTop=t.scrollTop)}formResetCallback(){this.value="",this.internals.setFormValue(""),this.lineCount=1}formStateRestoreCallback(e){this.value=e,this.internals.setFormValue(e),this.lineCount=Math.max(1,e.split("\n").length)}formDisabledCallback(e){this.disabled=e}updateValidity(){const e=this.shadowRoot?.querySelector("textarea");e&&this.internals.setValidity(e.validity,e.validationMessage,e)}renderLineNumbers(){const e=Math.max(2,String(this.lineCount).length);return Array.from({length:this.lineCount},(t,i)=>Z`<span>${String(i+1).padStart(e,"0")}</span>`)}render(){const e=this.getA11yAttributes({invalid:this.invalid}),t=Oe({main:!0,[`size--${this.size}`]:!0,"has-line-numbers":this.lineNumbers,stretch:this.stretch});return Z`
|
|
33959
|
+
`,e.CardTitle=t([Ce("quantic-card-title")],e.CardTitle);const sn={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.CodeInput=class extends(Si(fe)){constructor(){super(),this.value="",this.rows=4,this.name="",this.placeholder="",this.size=sn.Medium,this.disabled=!1,this.readOnly=!1,this.required=!1,this.invalid=!1,this.lineNumbers=!1,this.stretch=!1,this.tabIndent=!1,this.lineCount=1,this.handleKeydown=e=>{!this.tabIndent||"Tab"!==e.key||this.disabled||this.readOnly||(e.preventDefault(),document.execCommand("insertText",!1,"\t")),this.forwardNative(e)},this.internals=this.attachInternals()}updated(e){e.has("value")&&(this.internals.setFormValue(this.value),this.updateValidity(),this.lineCount=Math.max(1,this.value.split("\n").length))}handleInput(e){const t=e.target;this.value=t.value,this.lineCount=Math.max(1,this.value.split("\n").length),this.internals.setFormValue(this.value),this.updateValidity(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value},bubbles:!0,composed:!0}))}forwardNative(e){const t={bubbles:!0,cancelable:e.cancelable,composed:!0};e instanceof KeyboardEvent?this.dispatchEvent(new KeyboardEvent(e.type,{...t,key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey})):e instanceof FocusEvent?this.dispatchEvent(new FocusEvent(e.type,{...t,relatedTarget:e.relatedTarget})):this.dispatchEvent(new Event(e.type,t))}handleScroll(e){const t=e.target;this.lineNumbersEl&&(this.lineNumbersEl.scrollTop=t.scrollTop)}formResetCallback(){this.value="",this.internals.setFormValue(""),this.lineCount=1}formStateRestoreCallback(e){this.value=e,this.internals.setFormValue(e),this.lineCount=Math.max(1,e.split("\n").length)}formDisabledCallback(e){this.disabled=e}updateValidity(){const e=this.shadowRoot?.querySelector("textarea");e&&this.internals.setValidity(e.validity,e.validationMessage,e)}renderLineNumbers(){const e=Math.max(2,String(this.lineCount).length);return Array.from({length:this.lineCount},(t,i)=>Z`<span>${String(i+1).padStart(e,"0")}</span>`)}render(){const e=this.getA11yAttributes({invalid:this.invalid}),t=Oe({main:!0,[`size--${this.size}`]:!0,"has-line-numbers":this.lineNumbers,stretch:this.stretch});return Z`
|
|
33960
33960
|
<div class=${t}>
|
|
33961
33961
|
${this.lineNumbers?Z`<div class="line-numbers" aria-hidden="true">
|
|
33962
33962
|
${this.renderLineNumbers()}
|
|
@@ -33982,7 +33982,7 @@ function Ki({context:e}){return(t,i)=>{const n=new WeakMap;if("object"==typeof i
|
|
|
33982
33982
|
@change=${this.forwardNative}
|
|
33983
33983
|
@focus=${this.forwardNative}
|
|
33984
33984
|
@blur=${this.forwardNative}
|
|
33985
|
-
@keydown=${this.
|
|
33985
|
+
@keydown=${this.handleKeydown}
|
|
33986
33986
|
@keyup=${this.forwardNative}
|
|
33987
33987
|
@keypress=${this.forwardNative}
|
|
33988
33988
|
@scroll=${this.handleScroll}
|
|
@@ -34188,7 +34188,7 @@ function Ki({context:e}){return(t,i)=>{const n=new WeakMap;if("object"==typeof i
|
|
|
34188
34188
|
.textarea:read-only {
|
|
34189
34189
|
cursor: default;
|
|
34190
34190
|
}
|
|
34191
|
-
`,t([Le({type:"string",default:"''",description:"Current value of the editor."})],e.CodeInput.prototype,"value",void 0),t([Le({type:"number",default:"4",description:"Number of visible text rows in the textarea."})],e.CodeInput.prototype,"rows",void 0),t([Le({type:"string",default:"''",description:"Name submitted with form data."})],e.CodeInput.prototype,"name",void 0),t([Le({type:"string",default:"''",description:"Placeholder text shown when the editor is empty."})],e.CodeInput.prototype,"placeholder",void 0),t([Le({type:"CodeInputSize",options:Object.values(sn),default:sn.Medium,description:"Controls font size and padding."})],e.CodeInput.prototype,"size",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Prevents interaction and applies disabled styling."})],e.CodeInput.prototype,"disabled",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Allows text to be read but not edited."})],e.CodeInput.prototype,"readOnly",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Marks the field as required for form validation."})],e.CodeInput.prototype,"required",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Applies error styling when the field fails validation."})],e.CodeInput.prototype,"invalid",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Shows a line-number gutter on the left side of the editor.",attribute:"line-numbers"})],e.CodeInput.prototype,"lineNumbers",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Makes the editor fill the height of its container. Overrides rows."})],e.CodeInput.prototype,"stretch",void 0),t([me(".line-numbers")],e.CodeInput.prototype,"lineNumbersEl",void 0),t([ve()],e.CodeInput.prototype,"lineCount",void 0),e.CodeInput=t([Ie("value-changed",{description:"Fired whenever the textarea's value is updated (on input).",detail:"{ value: string }"}),Ie("change",{forwarded:!0}),Ie("focus",{forwarded:!0}),Ie("blur",{forwarded:!0}),Ie("keydown",{forwarded:!0}),Ie("keyup",{forwarded:!0}),Ie("keypress",{forwarded:!0}),Ce("quantic-code-input")],e.CodeInput);const cn={Small:"sm",Medium:"md",Large:"lg"};e.Checkbox=class extends(Si(fe)){constructor(){super(),this.checked=!1,this.required=!1,this.disabled=!1,this.invalid=!1,this.indeterminate=!1,this.label="",this.name="",this.size=cn.Medium,this.defaultChecked=!1,this.defaultIndeterminate=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.defaultChecked=this.hasAttribute("checked"),this.defaultIndeterminate=this.hasAttribute("indeterminate")}forwardNative(e){const t=e.target;this.checked=t.checked,this.dispatchEvent(new Event(e.type,{bubbles:!0,composed:!0}))}updated(e){super.updated(e);const t=this.renderRoot.querySelector("input");t&&(t.indeterminate=this.indeterminate),e.has("checked")&&this.internals.setFormValue(this.checked?"on":null)}dispatchValueChanged(e){this.dispatchEvent(new CustomEvent("value-changed",{detail:{checked:this.checked,indeterminate:this.indeterminate},bubbles:!0,composed:!0}))}formResetCallback(){const e=this.renderRoot.querySelector("input");this.checked=this.defaultChecked,this.indeterminate=this.defaultIndeterminate,this.internals.setFormValue(this.defaultChecked?"on":null),e&&(e.checked=this.defaultChecked,e.indeterminate=this.defaultIndeterminate)}formStateRestoreCallback(e){this.checked="on"===e,this.internals.setFormValue(e)}formDisabledCallback(e){this.disabled=e}get computedLabel(){return this.ariaLabel||this.label}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0}),t=this.getA11yAttributes({label:this.computedLabel,invalid:this.invalid});return Z`
|
|
34191
|
+
`,t([Le({type:"string",default:"''",description:"Current value of the editor."})],e.CodeInput.prototype,"value",void 0),t([Le({type:"number",default:"4",description:"Number of visible text rows in the textarea."})],e.CodeInput.prototype,"rows",void 0),t([Le({type:"string",default:"''",description:"Name submitted with form data."})],e.CodeInput.prototype,"name",void 0),t([Le({type:"string",default:"''",description:"Placeholder text shown when the editor is empty."})],e.CodeInput.prototype,"placeholder",void 0),t([Le({type:"CodeInputSize",options:Object.values(sn),default:sn.Medium,description:"Controls font size and padding."})],e.CodeInput.prototype,"size",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Prevents interaction and applies disabled styling."})],e.CodeInput.prototype,"disabled",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Allows text to be read but not edited."})],e.CodeInput.prototype,"readOnly",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Marks the field as required for form validation."})],e.CodeInput.prototype,"required",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Applies error styling when the field fails validation."})],e.CodeInput.prototype,"invalid",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Shows a line-number gutter on the left side of the editor.",attribute:"line-numbers"})],e.CodeInput.prototype,"lineNumbers",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Makes the editor fill the height of its container. Overrides rows."})],e.CodeInput.prototype,"stretch",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Inserts a tab character when pressing Tab instead of moving focus. Disabled by default to preserve keyboard navigation.",attribute:"tab-indent"})],e.CodeInput.prototype,"tabIndent",void 0),t([me(".line-numbers")],e.CodeInput.prototype,"lineNumbersEl",void 0),t([ve()],e.CodeInput.prototype,"lineCount",void 0),e.CodeInput=t([Ie("value-changed",{description:"Fired whenever the textarea's value is updated (on input).",detail:"{ value: string }"}),Ie("change",{forwarded:!0}),Ie("focus",{forwarded:!0}),Ie("blur",{forwarded:!0}),Ie("keydown",{forwarded:!0}),Ie("keyup",{forwarded:!0}),Ie("keypress",{forwarded:!0}),Ce("quantic-code-input")],e.CodeInput);const cn={Small:"sm",Medium:"md",Large:"lg"};e.Checkbox=class extends(Si(fe)){constructor(){super(),this.checked=!1,this.required=!1,this.disabled=!1,this.invalid=!1,this.indeterminate=!1,this.label="",this.name="",this.size=cn.Medium,this.defaultChecked=!1,this.defaultIndeterminate=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.defaultChecked=this.hasAttribute("checked"),this.defaultIndeterminate=this.hasAttribute("indeterminate")}forwardNative(e){const t=e.target;this.checked=t.checked,this.dispatchEvent(new Event(e.type,{bubbles:!0,composed:!0}))}updated(e){super.updated(e);const t=this.renderRoot.querySelector("input");t&&(t.indeterminate=this.indeterminate,e.has("checked")&&(t.checked=this.checked)),e.has("checked")&&this.internals.setFormValue(this.checked?"on":null)}dispatchValueChanged(e){this.dispatchEvent(new CustomEvent("value-changed",{detail:{checked:this.checked,indeterminate:this.indeterminate},bubbles:!0,composed:!0}))}formResetCallback(){const e=this.renderRoot.querySelector("input");this.checked=this.defaultChecked,this.indeterminate=this.defaultIndeterminate,this.internals.setFormValue(this.defaultChecked?"on":null),e&&(e.checked=this.defaultChecked,e.indeterminate=this.defaultIndeterminate)}formStateRestoreCallback(e){this.checked="on"===e,this.internals.setFormValue(e)}formDisabledCallback(e){this.disabled=e}get computedLabel(){return this.ariaLabel||this.label}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0}),t=this.getA11yAttributes({label:this.computedLabel,invalid:this.invalid});return Z`
|
|
34192
34192
|
<label class=${e}>
|
|
34193
34193
|
<input
|
|
34194
34194
|
type="checkbox"
|