@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
5 lines • 25.7 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{h as n,r as e,g as t}from"./index-BQlHOxik.js";import{a as o,_ as i}from"./tslib.es6-QNbPBOk5.js";import{c as l}from"./clsx-COFh-Vc8.js";import{c as a}from"./dev.utils-02Sl9bQo.js";import{d as r,a as s,c}from"./element-interaction-Bv-mPSBn.js";import{e as d,b as h,i as f,s as m}from"./common-Cx_AGO_M.js";import{I as k}from"./controller-DKPaX3Tu.js";import{I as p}from"./component-DzaT2WlJ.js";import{g as b,i as u,a as v,F as g}from"./FormFieldStateWrapper-BWTMRKXT.js";import{I as y}from"./Input-DQJln-L5.js";import{F as x}from"./FieldControlStateWrapper-DF2tVpwY.js";import{p as _}from"./controller-DRE7PRMK.js";import"./element-focus-CRwW4N4R.js";import"./label-Fyi30H9j.js";import"./required-DFzRSWky.js";import"./orientation-CjNmUJp-.js";import"./bem-registry-CWvl2xho.js";import"./access-and-short-key-D734WtlX.js";import"./disabled-gyBUQRnY.js";import"./hide-label-6Bx1MH20.js";import"./tooltip-align-mwhvx9nK.js";import"./align-DxZmRFcp.js";import"./variant-class-name-BCcQYpIV.js";import"./events-VVvk1win.js";import"./associated.controller-Bagx9pCw.js";import"./bootstrap-DPKvOz00.js";import"./component-names-Dy77vq43.js";import"./i18n-B2d_exHc.js";import"./_Uint8Array-kJHDjtoP.js";import"./isArray-CcrBs4JM.js";import"./variant-quote-y0Z1TRdz.js";import"./normalizers-m3s9sgmq.js";import"./component-Dh0cPCxF.js";import"./component-DvjvBJeK.js";import"./controller-Bdve6A-Q.js";import"./align-floating-elements-D5XJiLiU.js";import"./tooltip-open-tracking-D3tCiiGP.js";import"./label-KTv-zMW0.js";import"./base-controller-CXhqh4cR.js";import"./i18n-Br16IAnY.js";import"./Alert-BP_7bRZF.js";import"./Heading-q2Ue3Ixd.js";const w=(n,e)=>{d(n,"_checked",e)};const j=(n,e)=>{d(n,"_indeterminate",e)};const z=["left","right"];const B=(n,e)=>{h(n,`_labelAlign`,(n=>typeof n==="string"&&z.includes(n)),new Set([`KoliBriLabelAlign {${z.join(", ")}`]),e)};const S=["button","default","switch"];const T=n=>typeof n==="string"&&S.includes(n);const C=(n,e)=>{h(n,"_variant",T,new Set(S),e)};class A extends k{constructor(n,e,t){super(n,e,t);this.setFormAssociatedCheckboxValue=n=>{if(this.component._checked){this.setFormAssociatedValue(n)}else{this.setFormAssociatedValue(null)}};this.component=n}validateChecked(n){w(this.component,n);this.setFormAssociatedCheckboxValue(this.component.state._value)}validateIcons(n){h(this.component,"_icons",(n=>{const e=n;return typeof e==="object"&&e!==null&&(f(e.checked,1)||f(e.indeterminate,1)||f(e.unchecked,1))}),new Set(["InputCheckboxIcons"]),n,{hooks:{beforePatch:(n,e,t)=>{e.set("_icons",Object.assign(Object.assign({},t.state._icons),n))}}})}validateIndeterminate(n){j(this.component,n)}validateLabelAlign(n){B(this.component,n)}validateValue(n){m(this.component,"_value",n);this.setFormAssociatedCheckboxValue(this.component.state._value)}validateVariant(n){C(this.component,n)}componentWillLoad(){super.componentWillLoad();this.validateChecked(this.component._checked);this.validateIcons(this.component._icons);this.validateIndeterminate(this.component._indeterminate);this.validateValue(this.component._value);this.validateVariant(this.component._variant);this.validateLabelAlign(this.component._labelAlign)}}const D=e=>{var{class:t,variant:i="default",icon:a,inputProps:r}=e,s=o(e,["class","variant","icon","inputProps"]);const{class:c}=r,d=o(r,["class"]);const h={[`kol-checkbox--variant-${i}`]:true,[`kol-checkbox--checked`]:r===null||r===void 0?void 0:r.checked,[`kol-checkbox--indeterminate`]:r===null||r===void 0?void 0:r.indeterminate,["kol-checkbox--disabled"]:Boolean(r===null||r===void 0?void 0:r.disabled),["kol-checkbox--required"]:Boolean(r===null||r===void 0?void 0:r.required),["kol-checkbox--touched"]:Boolean(r===null||r===void 0?void 0:r.touched),[`kol-checkbox--${b(r===null||r===void 0?void 0:r.msg)}`]:Boolean(u(r===null||r===void 0?void 0:r.msg,r===null||r===void 0?void 0:r.touched))};return n("label",Object.assign({class:l("kol-checkbox",h,t)},s),n(p,{label:"",icons:a,class:l("kol-checkbox__icon")}),n(y,Object.assign({class:l("kol-checkbox__input",c)},d,{type:"checkbox"})))};function V(n,e={}){const{ariaDescribedBy:t}=v(n);const o={id:n._id,hideLabel:n._hideLabel,label:n._label,value:n._value,accessKey:n._accessKey,disabled:n._disabled,name:n._name,ariaDescribedBy:t};if("_required"in n)o.required=n._required;if("_checked"in n)o.checked=n._checked;if("_indeterminate"in n)o.indeterminate=n._indeterminate;if("_touched"in n)o.touched=n._touched;if("_msg"in n)o.msg=n._msg;if("_shortKey"in n)o["aria-keyshortcuts"]=n._shortKey;return Object.assign(Object.assign({},o),e)}const q=e=>{var{state:t,inputProps:i}=e,l=o(e,["state","inputProps"]);const a=(t===null||t===void 0?void 0:t._variant)||"default";return n(D,Object.assign({variant:a,inputProps:V(t,i)},l))};const P='@charset "UTF-8";\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n /*\n * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type=\'checkbox\'], [type=\'radio\'], [type=\'range\']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the text color from his parent element.\n */\n color: inherit;\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don\'t want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: white;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n align-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1780571516250"); /* IE9*/\n src: url("kolicons.eot?t=1780571516250#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1780571516250") format("woff2"), url("kolicons.woff?t=1780571516250") format("woff"), url("kolicons.ttf?t=1780571516250") format("truetype"), url("kolicons.svg?t=1780571516250#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: black;\n background-color: white;\n position: absolute;\n z-index: 999;\n width: calc(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: black;\n background-color: white;\n position: relative;\n z-index: 1000;\n }\n @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field__label-text {\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n }\n .kol-form-field--required .kol-form-field__label-text:has(.kol-span__slot[hidden])::after,\n .kol-form-field--required .kol-tooltip__content .kol-span__label::after {\n content: "*"/"";\n }\n .kol-field-control {\n display: grid;\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: left;\n grid-template-areas: "input label";\n grid-template-columns: auto 1fr;\n grid-template-rows: auto;\n }\n .kol-field-control:has(.kol-field-control__hint) {\n grid-template-areas: "input label" "hint hint";\n grid-template-columns: auto 1fr;\n grid-template-rows: auto auto;\n }\n .kol-field-control--label-align-left:not(.kol-field-control--hide-label) {\n grid-template-areas: "label input";\n grid-template-columns: 1fr auto;\n grid-template-rows: auto;\n }\n .kol-field-control--label-align-left:not(.kol-field-control--hide-label):has(.kol-field-control__hint) {\n grid-template-areas: "label input" "hint hint";\n grid-template-columns: 1fr auto;\n grid-template-rows: auto auto;\n }\n .kol-field-control__input {\n display: flex;\n min-height: var(--a11y-min-size);\n align-items: center;\n grid-area: input;\n }\n .kol-field-control__label {\n display: flex;\n min-height: var(--a11y-min-size);\n flex-grow: 1;\n align-items: center;\n cursor: pointer;\n grid-area: label;\n }\n .kol-field-control__label--visually-hidden {\n height: 0;\n margin: 0;\n padding: 0;\n visibility: hidden;\n }\n .kol-field-control__label-text {\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n }\n .kol-field-control__hint {\n grid-area: hint;\n }\n .kol-field-control--disabled .kol-field-control__label {\n cursor: not-allowed;\n }\n .kol-field-control--required .kol-field-control__label-text::after {\n content: "*"/"";\n }\n .kol-field-control--required .kol-tooltip .kol-span__label::after {\n content: "*"/"";\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-form-field {\n display: grid;\n }\n .kol-form-field__label-text {\n display: ruby;\n }\n .kol-checkbox {\n display: flex;\n position: relative;\n align-items: center;\n cursor: pointer;\n }\n .kol-checkbox--disabled {\n cursor: not-allowed;\n }\n .kol-checkbox .kol-input {\n background-color: white;\n border-style: solid;\n margin: 0;\n border-width: 2px;\n appearance: none;\n cursor: inherit;\n }\n .kol-checkbox .kol-input:before {\n content: "";\n }\n /**\n * Variant: Checkbox\n */\n .kol-checkbox--variant-default {\n position: relative;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n justify-content: center;\n }\n .kol-checkbox--variant-default .kol-icon {\n display: none;\n position: absolute;\n inset: auto;\n z-index: 1;\n pointer-events: none;\n }\n .kol-checkbox--variant-default .kol-input {\n width: calc(22 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(22 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-checkbox--variant-default.kol-checkbox--checked .kol-icon, .kol-checkbox--variant-default.kol-checkbox--indeterminate .kol-icon {\n display: block;\n }\n /**\n * Variant: Switch\n */\n .kol-checkbox--variant-switch {\n position: relative;\n }\n .kol-checkbox--variant-switch .kol-input {\n display: inline-block;\n position: relative;\n width: 3.2em;\n min-width: 3.2em;\n height: 1.7em;\n }\n .kol-checkbox--variant-switch .kol-input::before {\n background-color: black;\n position: absolute;\n top: calc(0.25em - 2 * 1rem / var(--kolibri-root-font-size, 16));\n left: calc(0.25em - 2 * 1rem / var(--kolibri-root-font-size, 16));\n width: 1.2em;\n height: 1.2em;\n transition: 0.5s;\n }\n .kol-checkbox--variant-switch .kol-input:checked::before {\n transform: translateX(1.5em);\n }\n .kol-checkbox--variant-switch .kol-input:indeterminate::before {\n transform: translateX(0.75em);\n }\n .kol-checkbox--variant-switch .kol-icon {\n transform: translate(0, -50%);\n color: black;\n display: flex;\n position: absolute;\n top: 50%;\n left: calc(4 * 1rem / var(--kolibri-root-font-size, 16));\n z-index: 1;\n width: 1.2em;\n height: 1.2em;\n align-items: center;\n justify-content: center;\n transition: 0.5s;\n }\n .kol-checkbox--variant-switch.kol-checkbox--checked .kol-icon {\n transform: translate(1.5em, -50%);\n }\n .kol-checkbox--variant-switch.kol-checkbox--indeterminate .kol-icon {\n transform: translate(0.75em, -50%);\n }\n /**\n * Variant: Button\n */\n .kol-checkbox--variant-button {\n min-width: var(--a11y-min-size);\n }\n .kol-checkbox--variant-button .kol-icon {\n display: flex;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n }\n}';const I=class{getModelValue(){return this._checked?this.state._value:null}async getValue(){return this.getModelValue()}async focus(){}async click(){}getFormFieldProps(){return{state:this.state,class:l("kol-input-checkbox",{[`kol-input-checkbox--checked`]:this.state._checked,[`kol-input-checkbox--indeterminate`]:this.state._indeterminate,[`kol-input-checkbox--variant-${this.state._variant||"default"}`]:true,[`kol-input-checkbox--label-align-${this.state._labelAlign||"right"}`]:true}),tooltipAlign:this._tooltipAlign,alert:this.showAsAlert(),renderNoTooltip:true}}getFieldControlProps(){return{class:l("kol-input-checkbox__field-control",{[`kol-input-checkbox__field-control--checked`]:this.state._checked,[`kol-input-checkbox__field-control--indeterminate`]:this.state._indeterminate,[`kol-input-checkbox__field-control--variant-${this.state._variant||"default"}`]:true}),state:this.state,fieldControlLabelProps:{onMouseDown:n=>{if(this.inputHasFocus){n.preventDefault()}}}}}getInputProps(){return{state:this.state,icon:this.getIcon(),onMouseDown:n=>{if(this.inputHasFocus&&!(n.target instanceof HTMLInputElement)){n.preventDefault()}},inputProps:Object.assign(Object.assign({class:l({"visually-hidden":this.state._variant==="button"}),ref:this.ctaRef},this.controller.onFacade),{onInput:this.onInput,onChange:this.onChange,onKeyDown:this.onKeyDown,onFocus:n=>{this.controller.onFacade.onFocus(n);this.inputHasFocus=true},onBlur:n=>{if(this._disabled){return}this.controller.onFacade.onBlur(n);this.inputHasFocus=false},onClick:undefined})}}getIcon(){if(this.state._indeterminate)return this.state._icons.indeterminate;if(this.state._checked)return this.state._icons.checked;return this.state._icons.unchecked}render(){return n(g,Object.assign({key:"e19d056690c7e9f4fd0281fbc3d61fcf2936d23b"},this.getFormFieldProps(),{renderNoLabel:true}),n(x,Object.assign({key:"aa9db978e7584e102fe07c741e47a2f032754e22"},this.getFieldControlProps(),{renderNoHint:true}),n(q,Object.assign({key:"8b1fc962d3d3e1ced0ddc9ae56c7cfce1804996f"},this.getInputProps()))))}constructor(n){e(this,n);this.ctaRef=c();this._checked=false;this._hideMsg=false;this._disabled=false;this._hideLabel=false;this._hint="";this._labelAlign="right";this._required=false;this._tooltipAlign="top";this._touched=false;this._value=true;this._variant="default";this.state={_checked:false,_hideMsg:false,_icons:{checked:"kolicon-check",indeterminate:"kolicon-minus",unchecked:"kolicon-cross"},_id:a("input-checkbox"),_indeterminate:false,_label:"",_value:true,_variant:"default",_labelAlign:"right"};this.inputHasFocus=false;this.onInput=n=>{this._checked=!this._checked;this._indeterminate=false;const e=this.getModelValue();this.controller.onFacade.onInput(n,false,e);this.controller.setFormAssociatedCheckboxValue(e)};this.onChange=n=>{this.controller.onFacade.onChange(n,this.getModelValue())};this.onKeyDown=n=>{this.controller.onFacade.onKeyDown(n);if(n.code==="Enter"||n.code==="NumpadEnter"){_({form:this.host})}};this.controller=new A(this,"checkbox",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(n){this.controller.validateAccessKey(n)}validateChecked(n){this.controller.validateChecked(n)}validateDisabled(n){this.controller.validateDisabled(n)}validateHideMsg(n){this.controller.validateHideMsg(n)}validateHideLabel(n){this.controller.validateHideLabel(n)}validateHint(n){this.controller.validateHint(n)}validateIcons(n){this.controller.validateIcons(n)}validateIndeterminate(n){this.controller.validateIndeterminate(n)}validateLabel(n){this.controller.validateLabel(n)}validateLabelAlign(n){this.controller.validateLabelAlign(n)}validateMsg(n){this.controller.validateMsg(n)}validateName(n){this.controller.validateName(n)}validateOn(n){this.controller.validateOn(n)}validateRequired(n){this.controller.validateRequired(n)}validateShortKey(n){this.controller.validateShortKey(n)}validateSyncValueBySelector(n){this.controller.validateSyncValueBySelector(n)}validateTouched(n){this.controller.validateTouched(n)}validateValue(n){this.controller.validateValue(n)}validateVariant(n){this.controller.validateVariant(n)}componentWillLoad(){this._touched=this._touched===true;this.controller.componentWillLoad()}get host(){return t(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_checked:["validateChecked"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_indeterminate:["validateIndeterminate"],_label:["validateLabel"],_labelAlign:["validateLabelAlign"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_required:["validateRequired"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"],_variant:["validateVariant"]}}};i([r("ctaRef")],I.prototype,"focus",null);i([s("ctaRef")],I.prototype,"click",null);I.style={default:P};export{I as kol_input_checkbox};
//# sourceMappingURL=kol-input-checkbox.entry.js.map