@oiz/stzh-components 4.0.1 → 4.0.3
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/cjs/{app-globals-bad16218.js → app-globals-439b15c8.js} +2 -2
- package/dist/cjs/{app-globals-bad16218.js.map → app-globals-439b15c8.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-card.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js +18 -6
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-ghettobox_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ghettobox_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +4 -4
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/collection/components/stzh-card/stzh-card.css +0 -3
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.css +1 -1
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +18 -5
- package/dist/collection/components/stzh-checkbox/stzh-checkbox.js.map +1 -1
- package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +6 -0
- package/dist/collection/components/stzh-upload/stzh-upload.css +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +3 -3
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-a8454c30.js → p-57db4298.js} +2 -2
- package/dist/components/p-57db4298.js.map +1 -0
- package/dist/components/{p-1e02d63c.js → p-c64f4bd8.js} +2 -2
- package/dist/components/p-c64f4bd8.js.map +1 -0
- package/dist/components/{p-e48a4be2.js → p-cb6a2b1c.js} +19 -7
- package/dist/components/p-cb6a2b1c.js.map +1 -0
- package/dist/components/stzh-card.js +1 -1
- package/dist/components/stzh-checkbox.js +1 -1
- package/dist/components/stzh-geo-ref-data.js +1 -1
- package/dist/components/stzh-ghettobox.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +1 -1
- package/dist/components/stzh-upload.js +4 -4
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/components/stzh-vbz-majorticker.js +1 -1
- package/dist/esm/{app-globals-d5c59941.js → app-globals-b639468a.js} +2 -2
- package/dist/esm/{app-globals-d5c59941.js.map → app-globals-b639468a.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-card.entry.js +1 -1
- package/dist/esm/stzh-card.entry.js.map +1 -1
- package/dist/esm/stzh-checkbox_3.entry.js +18 -6
- package/dist/esm/stzh-checkbox_3.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-ghettobox_3.entry.js +1 -1
- package/dist/esm/stzh-ghettobox_3.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +4 -4
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/stzh-components/{p-79a63bd9.entry.js → p-120cc8be.entry.js} +2 -2
- package/dist/stzh-components/p-120cc8be.entry.js.map +1 -0
- package/dist/stzh-components/p-3d7508f7.entry.js +2 -0
- package/dist/stzh-components/p-3d7508f7.entry.js.map +1 -0
- package/dist/stzh-components/p-4a00611c.entry.js +2 -0
- package/dist/stzh-components/p-4a00611c.entry.js.map +1 -0
- package/dist/stzh-components/{p-ffed4972.entry.js → p-8721622f.entry.js} +2 -2
- package/dist/stzh-components/p-8721622f.entry.js.map +1 -0
- package/dist/stzh-components/{p-6f138c27.js → p-ea95a5b1.js} +2 -2
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/types/components/stzh-checkbox/stzh-checkbox.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-1e02d63c.js.map +0 -1
- package/dist/components/p-a8454c30.js.map +0 -1
- package/dist/components/p-e48a4be2.js.map +0 -1
- package/dist/stzh-components/p-79a63bd9.entry.js.map +0 -1
- package/dist/stzh-components/p-836ee7e5.entry.js +0 -2
- package/dist/stzh-components/p-836ee7e5.entry.js.map +0 -1
- package/dist/stzh-components/p-e452b478.entry.js +0 -2
- package/dist/stzh-components/p-e452b478.entry.js.map +0 -1
- package/dist/stzh-components/p-ffed4972.entry.js.map +0 -1
- /package/dist/stzh-components/{p-6f138c27.js.map → p-ea95a5b1.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-a8454c30.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,s1QAAs1Q,CAAC;AACh3Q,4BAAe,gBAAgB;;MCelB,aAAa;;;;;;QA6ChB,uBAAkB,GAAG;YAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;SACb,CAAC;QAEM,SAAI,GAAG;YACb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;YAExE,IAAI,MAAM,EAAE;gBACV,cAAc,CAAC,MAAM,EAAE;oBACrB,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,SAAS;oBACrB,OAAO,EAAE,WAAW;oBACpB,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,aAAa;oBACnB,YAAY,EAAE,OAAO;iBACG,CAAC,CAAC;aAC7B;SACF,CAAC;2BA5D4B,EAAE;yBAGJ,EAAE;2BAGA,EAAE;yBAGH,KAAK;;oBAcT,IAAI;;IAG7B,MAAM,IAAI;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;KACJ;IAGD,MAAM,IAAI;QACR,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAClB,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;KACJ;IAuBD,MAAM,iBAAiB;QACrB,IAAI,CAAC,I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AAK,KAAK,EAAC,wBAAwB,IACjC,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,EACL,CAAC,IAAI,CAAC,SAAS,KACd,oEACE,KAAK,EAAC,uBAAuB,EAC7B,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAChC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,EAClC,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,EACd,IAAI,EAAC,WAAW,GACH,CAChB,CACG,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/stzh-ghettobox/stzh-ghettobox.scss?tag=stzh-ghettobox&encapsulation=scoped","src/components/stzh-ghettobox/stzh-ghettobox.tsx"],"sourcesContent":["/*\n * @prop --background-color: Background color of ghettobox\n */\n\n:host {\n @include base-invert;\n @include button-invert;\n\n --background-color: #{$colorError60};\n --color: #{$baseInvertColor};\n --richtext-color: var(--color);\n}\n\n.stzh-ghettobox {\n position: relative;\n color: var(--color);\n box-shadow: $boxShadowMessage;\n background-color: var(--background-color);\n\n &__container {\n @include container;\n @include spaceCurve('padding-top', 'large');\n @include spaceCurve('padding-bottom', 'large');\n }\n\n &__hidden-title {\n @include visuallyhidden;\n }\n\n &__message {\n @include spaceCurve('gap', 'regular');\n display: flex;\n flex-direction: column;\n }\n\n &__main-title {\n @include font('title');\n @include fontCurve('h2', 'heading');\n margin: 0;\n color: inherit;\n\n &:not(:empty) {\n @include spaceCurve('margin-bottom', 'regular');\n }\n }\n\n &__description {\n @include fontCurve('p1');\n --stzh-base-color: var(--richtext-color);\n\n &:not(:empty) {\n @include spaceCurve('margin-bottom', 'small');\n }\n }\n\n &__button {\n display: grid;\n\n @include mq($from: small) {\n justify-content: start;\n }\n }\n\n &__close {\n position: absolute;\n top: 0;\n right: 0;\n\n @include mq($from: small) {\n top: 10px;\n right: 10px;\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from \"@stencil/core\";\n\nimport { StzhGhettoboxCloseEvent, StzhGhettoboxOpenEvent } from \"../../index\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\nimport { StzhGhettoboxLocalizedText } from \"./stzh-ghettobox.localization\";\n\n/**\n * @slot - Slot for description content (use instead of description property)\n * @slot button - Slot for button element\n */\n@Component({\n tag: \"stzh-ghettobox\",\n styleUrl: \"stzh-ghettobox.scss\",\n scoped: true,\n})\nexport class StzhGhettobox {\n /** Overwrite hidden h1 title */\n @Prop() hiddenTitle: string = \"\";\n\n /** Main title */\n @Prop() mainTitle: string = \"\";\n\n /** Description */\n @Prop() description: string = \"\";\n\n /** Hide close button */\n @Prop() hideClose: boolean = false;\n\n /** Translation strings */\n @Prop() localization: StzhGhettoboxLocalizedText;\n\n /** Ghettobox open event */\n @Event() stzhOpen: EventEmitter<StzhGhettoboxOpenEvent>;\n\n /** Ghettobox close event */\n @Event() stzhClose: EventEmitter<StzhGhettoboxCloseEvent>;\n\n @Element() element: HTMLStzhGhettoboxElement;\n\n /** Open state */\n @State() open: boolean = true;\n\n @Method()\n async show() {\n this.open = true;\n this.stzhOpen.emit({\n component: \"stzh-ghettobox\",\n });\n }\n\n @Method()\n async hide() {\n this.open = false;\n this.stzhClose.emit({\n component: \"stzh-ghettobox\",\n });\n }\n\n private observer: MutationObserver;\n\n private onCloseButtonClick = () => {\n this.hide();\n };\n\n private init = () => {\n const button = this.element.querySelector('stzh-button[slot=\"button\"]');\n\n if (button) {\n setPropsIfNull(button, {\n size: \"small\",\n sizeMedium: \"default\",\n variant: \"secondary\",\n effect: \"cta\",\n icon: \"arrow-right\",\n iconPosition: \"right\",\n } as HTMLStzhButtonElement);\n }\n };\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"ghettobox\");\n }\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-ghettobox\": true,\n \"stzh-ghettobox--has-close-button\": !this.hideClose,\n };\n\n // TODO: Temporary workaround/bugfix for readspeaker class \"rs_skip\" can be removed once Readspeaker update with bugfix has arrived (ETA end of 2024).\n return (\n <Host hidden={!this.open}>\n <div class={{ ...classes, rs_skip: !this.open }} aria-hidden={this.open ? \"false\" : \"true\"}>\n <div class=\"stzh-ghettobox__container\">\n <h1 class=\"stzh-ghettobox__hidden-title\">{this.hiddenTitle || this.localization.hiddenTitle}</h1>\n <div class=\"stzh-ghettobox__message\">\n <div class=\"stzh-ghettobox__text\">\n <h2 class=\"stzh-ghettobox__main-title\">{this.mainTitle}</h2>\n <div class=\"stzh-ghettobox__description\">{this.description ? this.description : <slot></slot>}</div>\n </div>\n <div class=\"stzh-ghettobox__button\">\n <slot name=\"button\"></slot>\n </div>\n </div>\n {!this.hideClose && (\n <stzh-button\n class=\"stzh-ghettobox__close\"\n onClick={this.onCloseButtonClick}\n a11yLabel={this.localization.close}\n variant=\"tertiary\"\n size=\"small\"\n iconOnly={true}\n icon=\"close-big\"\n ></stzh-button>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-e48a4be2.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,qsOAAqsO,CAAC;AAC9tO,2BAAe,eAAe;;ACwB9B,IAAI,eAAe,GAAG,CAAC,CAAC;MAcX,YAAY;;;;;;;QAwFf,mBAAc,GAAY,KAAK,CAAC;QAEhC,gBAAW,GAAG;YACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC;SACpC,CAAA;QAEO,YAAO,GAAG,CAAC,KAAiB;YAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC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,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACH,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/stzh-checkbox/stzh-checkbox.scss?tag=stzh-checkbox&encapsulation=scoped","src/components/stzh-checkbox/stzh-checkbox.tsx"],"sourcesContent":[":host {\n --label-color: var(--stzh-checkbox-label-color, #{$baseColor});\n --label-hover-color: var(--stzh-checkbox-label-hover-color, #{$colorPrimary70});\n --label-hover-checked-color: var(--stzh-checkbox-label-hover-checked-color, #{$colorPrimary90});\n --check-color: var(--stzh-checkbox-check-color, #{$colorPrimary});\n\n display: inline-block;\n\n &[disabled]:not([disabled=\"false\"]) {\n --description-color: #{$formDisabledColor};\n }\n}\n\n.stzh-checkbox {\n @include input-description;\n display: grid;\n\n &__field-wrapper {\n @include fontSize('milli');\n position: relative;\n display: flex;\n user-select: none;\n cursor: pointer;\n }\n\n &__input {\n @include visuallyhiddenInput;\n border-radius: $formInputBorderRadius;\n }\n\n &__mark {\n border: 2px solid $colorBlack;\n background-color: $colorWhite;\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: $formInputBorderRadius;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n transition: border-color $baseTransitionAnimationSpeed;\n }\n\n &__check {\n display: flex;\n flex-direction: column;\n justify-content: center;\n opacity: 0;\n color: var(--check-color);\n transition-property: color;\n transition-duration: $baseTransitionAnimationSpeed;\n }\n\n &__label {\n --stzh-base-color: initial;\n\n display: inline-block;\n color: var(--label-color);\n transition: color $baseTransitionAnimationSpeed;\n margin-left: space('small');\n line-height: 24px;\n\n &:empty {\n display: none;\n }\n }\n\n &__marker {\n @include fontSize('micro');\n margin-left: calc(-0.25em + #{space('xsmall')});\n }\n\n /* Hover / Focus / Checked */\n\n &:hover &__label,\n &__input:checked ~ &__label {\n color: var(--label-hover-color);\n }\n\n &__input:checked:hover ~ &__label,\n &__input:checked:hover ~ &__mark &__check {\n color: var(--label-hover-checked-color);\n }\n\n &:hover &__mark,\n &__input:checked ~ &__mark {\n border-color: var(--label-hover-color);\n }\n\n &__input:checked:hover ~ &__mark {\n border-color: var(--label-hover-checked-color);\n }\n\n &__input:checked ~ &__mark &__check {\n opacity: 1;\n }\n\n /* Invalid */\n\n &--is-invalid &__input ~ &__label,\n &--is-invalid &__input ~ &__mark &__check {\n color: $colorError60;\n }\n\n &--is-invalid &__input ~ &__mark {\n border-color: $colorError60;\n }\n\n /* Disabled */\n\n\t&--is-disabled &__field-wrapper {\n cursor: not-allowed;\n }\n\n &--is-disabled &__input ~ &__label {\n color: $colorGrey60;\n }\n\n &--is-disabled &__input ~ &__mark &__check {\n color: $colorGrey50;\n }\n\n &--is-disabled &__input ~ &__mark {\n border-color: $colorGrey50;\n }\n\n &--is-disabled &__mark {\n background-color: $colorGrey20;\n }\n}\n","import {\n Host,\n Component,\n Prop,\n Event,\n EventEmitter,\n Element,\n h,\n Watch,\n Listen\n} from \"@stencil/core\";\n\nimport {\n StzhCheckboxChangeEvent,\n StzhCheckboxFocusEvent,\n StzhCheckboxBlurEvent\n} from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\nimport { StzhLocaleComponent } from \"../../index\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport Check from './assets/check.svg';\n\nlet checkboxCounter = 0;\n\n/**\n * @slot - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-checkbox\",\n styleUrl: \"stzh-checkbox.scss\",\n scoped: true\n})\nexport class StzhCheckbox {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the checkbox is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Name of the input element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of the input element */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Checked status */\n @Prop({ mutable: true, reflect: true }) checked: boolean = false;\n\n /** Default checked (used by reset) */\n @Prop({ mutable: true }) defaultChecked: boolean;\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** Hide `(optional)` label (or use `required` inside form to hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhCheckboxChangeEvent>;\n\n /** Focus event */\n @Event() stzhFocus: EventEmitter<StzhCheckboxFocusEvent>;\n\n /** Input blur event */\n @Event() stzhBlur: EventEmitter<StzhCheckboxBlurEvent>;\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Element() element: HTMLStzhRadioElement;\n\n private input: HTMLInputElement;\n private inputId: string;\n private focusedByInput: boolean = false;\n\n private handleReset = async () => {\n this.checked = this.defaultChecked;\n }\n\n private onInput = (event: InputEvent) => {\n this.checked = this.input.checked;\n this.stzhChange.emit({\n component: \"stzh-checkbox\",\n originalEvent: event,\n value: this.value,\n checked: this.checked\n });\n }\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.input.focus();\n }\n\n this.focusedByInput = false;\n }\n\n private onFocus = (event: FocusEvent) => {\n this.focusedByInput = true;\n\n const focusEvent = new FocusEvent('focus', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-checkbox\",\n originalEvent: event\n });\n }\n\n private onBlur = (event: FocusEvent) => {\n const blurEvent = new FocusEvent('blur', {\n view: window,\n bubbles: false,\n cancelable: false\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-checkbox\",\n originalEvent: event\n });\n }\n\n async componentWillLoad() {\n this.inputId = `stzh-checkbox-${checkboxCounter++}`;\n this.errorWatcher(this.error);\n\n this.defaultChecked = typeof this.defaultChecked === \"boolean\" ? this.defaultChecked : this.checked;\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'checkbox');\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, 'error') || this._error?.length > 0;\n\n const classes = {\n \"stzh-checkbox\": true,\n \"stzh-checkbox--has-description\": descriptionUsed,\n \"stzh-checkbox--has-description-long\": descriptionLongUsed,\n \"stzh-checkbox--has-error\": errorUsed,\n \"stzh-checkbox--is-required\": this.required,\n \"stzh-checkbox--is-invalid\": this.invalid || errorUsed,\n \"stzh-checkbox--is-disabled\": this.disabled\n };\n\n return (\n <Host is-invalid={this.invalid || errorUsed} tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <label class=\"stzh-checkbox__field-wrapper\">\n <input\n class=\"stzh-checkbox__input\"\n ref={(el) => (this.input = el as HTMLInputElement)}\n type=\"checkbox\"\n id={this.inputId}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-describedby={`${this.inputId}-description ${this.a11yDescribedby}`}\n aria-required={this.required ? \"true\" : \"false\"}\n aria-invalid={this.invalid ? \"true\" : \"false\"}\n checked={this.checked}\n defaultChecked={this.defaultChecked}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <div class=\"stzh-checkbox__mark\">\n <div class=\"stzh-checkbox__check\" innerHTML={Check} />\n </div>\n <div class=\"stzh-checkbox__label\">\n {this.label ? this.label : <slot></slot>}\n {!this.hideOptional &&\n <span class=\"stzh-checkbox__marker\">\n <span class=\"stzh-checkbox__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker\n }\n </span>\n <span class=\"stzh-checkbox__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText\n }\n </span>\n </span>\n }\n </div>\n </label>\n {(this._error?.length > 0 || this.description || this.descriptionLong) && (\n <StzhInputDescription\n classPrefix=\"stzh-checkbox\"\n id={`${this.inputId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|