@cas-smartdesign/radio-button-group 4.4.0 → 5.0.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/dist/docs/4_validation.js +1 -1
- package/dist/docs/5_segmented_button.js +1 -1
- package/dist/docs/doc.css +1 -1
- package/dist/docs/doc.mjs +115 -115
- package/dist/radio-button-group.d.ts +9 -15
- package/dist/radio-button-group.d.ts.map +1 -0
- package/dist/radio-button-group.mjs +238 -243
- package/dist/radio-button-group.mjs.map +1 -1
- package/dist/radio-button.d.ts +2 -1
- package/dist/radio-button.d.ts.map +1 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -0
- package/npm-third-party-licenses.json +56 -106
- package/package.json +15 -14
- package/readme.md +1 -1
- package/dist/radio-button-group-with-externals.js +0 -84
- package/dist/radio-button-group-with-externals.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button-group.mjs","sources":["../radio-button.ts","../radio-button-group.ts"],"sourcesContent":["import { LitElement, TemplateResult, html, unsafeCSS, css, nothing } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [RadioButton.ID]: RadioButton;\n }\n}\n\nimport style from \"./scss/button.scss?inline\";\nlet idCounter = 0;\n\nexport class RadioButton extends LitElement {\n public static readonly ID = \"sd-radio-button\";\n public static ensureDefined = (): void => {\n if (!customElements.get(RadioButton.ID)) {\n customElements.define(RadioButton.ID, RadioButton);\n }\n };\n @property({ type: Boolean, reflect: true, attribute: true })\n public checked = false;\n @property({ type: String, reflect: true, attribute: true })\n public value = \"\";\n @property({ type: Boolean, reflect: true, attribute: true })\n public disabled = false;\n @property({ type: String, reflect: true, attribute: true })\n public label = \"\";\n\n private a11yID;\n\n constructor() {\n super();\n this.a11yID = RadioButton.ID + \"_\" + idCounter++;\n }\n\n static get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"root\">\n <div class=\"radio-button-container\">\n <input\n type=\"radio\"\n id=\"${this.a11yID}\"\n .checked=\"${this.checked}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleClick}\"\n class=\"radio-button\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-14 -14 28 28\">\n <circle\n class=\"highlight\"\n style=\"display:none\"\n r=\"11px\"\n fill=\"transparent\"\n stroke-width=\"6px\"\n ></circle>\n <circle class=\"inner\" r=\"6px\" style=\"display:none\" stroke=\"none\"></circle>\n <circle class=\"outer\" r=\"9px\" fill=\"transparent\" stroke-width=\"2px\"></circle>\n </svg>\n </div>\n <label class=\"label\" for=\"${this.a11yID}\" @click=\"${this.handleClick}\">${this.label}</label>\n </div>\n `;\n }\n\n private handleClick = (event: MouseEvent): void => {\n event.preventDefault();\n };\n}\n","import { LitElement, TemplateResult, html, PropertyValues, ComplexAttributeConverter, unsafeCSS, css } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { RadioButton } from \"./radio-button\";\nimport { ValidationLevel } from \"@cas-smartdesign/field-validation-message\";\nimport type { LayoutType, IValueChangeEvent } from \"./types\";\n\nexport { RadioButton } from \"./radio-button\";\nexport type * from \"./types\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [RadioButtonGroup.ID]: RadioButtonGroup;\n }\n}\nimport style from \"./scss/group.scss?inline\";\n\nexport interface CustomEventMap extends HTMLElementEventMap {\n \"value-change\": CustomEvent<IValueChangeEvent>;\n}\n\nexport interface RadioButtonGroup {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport class RadioButtonGroup extends LitElement {\n public static readonly ID = \"sd-radio-button-group\";\n public static ensureDefined = (): void => {\n RadioButton.ensureDefined();\n if (!customElements.get(RadioButtonGroup.ID)) {\n customElements.define(RadioButtonGroup.ID, RadioButtonGroup);\n }\n };\n @property({ type: String, reflect: true, attribute: true })\n public layout: LayoutType = \"horizontal\";\n @property({ type: String })\n public value = \"\";\n @property({ type: Boolean, reflect: true, attribute: \"uncheck-allowed\" })\n public uncheckAllowed = false;\n @property({ type: Boolean, reflect: true, attribute: true })\n public disabled = false;\n @property({ type: String })\n public validationMessage: string;\n @property({ type: String })\n public validationIconSrc: string;\n @property({\n type: {\n fromAttribute(value: string): ValidationLevel {\n return value && ValidationLevel[value.toLowerCase()];\n },\n toAttribute(value: ValidationLevel): string {\n return value && value.toLowerCase();\n },\n } as ComplexAttributeConverter,\n reflect: true,\n })\n public validationLevel: ValidationLevel;\n\n private _buttonsSlot: HTMLSlotElement;\n private _buttons: HTMLElement[];\n private _focusIndex = -1;\n private _checkedButton: HTMLElement = null;\n\n public get focusIndex(): number {\n return this._focusIndex;\n }\n\n public set focusIndex(index: number) {\n if (index >= -1 && index < this.childElementCount) {\n const oldValue = this._focusIndex;\n this._focusIndex = index;\n if (oldValue !== index) {\n const previousButton = this._buttons[oldValue];\n const currentButton = this._buttons[this.focusIndex];\n this.updateFocused(previousButton, currentButton);\n }\n }\n }\n\n protected firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.buttonsSlot.addEventListener(\"slotchange\", this.handleSlotChange);\n this.addEventListener(\"focusin\", this.handleFocusIn);\n this.addEventListener(\"focusout\", this.handleFocusOut);\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has(\"disabled\")) {\n if (this.disabled) {\n this.disableButtons();\n } else {\n this.enableButtons();\n }\n }\n }\n\n static get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n public render(): TemplateResult {\n return html`\n <div\n class=\"buttons-container ${this.layout === \"vertical\" ? \"vertical\" : \"horizontal\"}\"\n @click=\"${ifDefined(this.disabled ? undefined : this.handleButtonClick)}\"\n >\n <slot></slot>\n </div>\n ${this.validationMessage &&\n html`\n <sd-field-validation-message\n class=\"validation-message\"\n .message=${this.validationMessage}\n .icon=${this.validationIconSrc}\n .level=${this.validationLevel}\n >\n </sd-field-validation-message>\n `}\n `;\n }\n\n private handleSlotChange = (): void => {\n this._buttons = this.buttonsSlot.assignedElements() as HTMLElement[];\n this._buttons.forEach((button) => {\n if (!button.hasAttribute(\"disabled\") && this.disabled) {\n button.setAttribute(\"disabled\", \"\");\n }\n // prevent radio buttons to be able to get focus by tabbing\n // as focus is handled by this element\n button.setAttribute(\"tabIndex\", \"-1\");\n this.updateCheckedButton(button);\n });\n };\n\n private updateCheckedButton(button: HTMLElement): void {\n if (this._checkedButton && this._checkedButton !== button) {\n this.uncheckButton(button);\n } else if (button.hasAttribute(\"checked\")) {\n this._checkedButton = button;\n const value = button.getAttribute(\"value\");\n this.updateValue(value);\n }\n }\n\n private handleFocusIn = (event: FocusEvent): void => {\n const target = event.target as HTMLElement;\n const ind = this._buttons.findIndex((button) => button == target);\n this.focusIndex = this.focusIndex >= 0 ? this.focusIndex : this.getNextFocusIndex(ind !== -1 ? ind : 0);\n this.updateFocused(null, this._buttons[this.focusIndex]);\n };\n\n private handleFocusOut = (): void => {\n this.updateFocused(this._buttons[this.focusIndex]);\n };\n\n private disableButtons(): void {\n this._buttons?.forEach((button) => {\n button.setAttribute(\"disabled\", \"\");\n });\n }\n\n private enableButtons(): void {\n this._buttons?.forEach((button) => {\n button.removeAttribute(\"disabled\");\n });\n }\n\n private handleButtonClick = (event: MouseEvent): void => {\n // the individual buttons are not focusable\n this.focus();\n const target = this._buttons.find((button) => button.contains(event.target as Node));\n const targetIndex = this._buttons.findIndex((button) => button == target);\n if (targetIndex >= 0) {\n this.focusIndex = targetIndex;\n this.updateChecked();\n }\n };\n\n private fireValueChangeEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IValueChangeEvent>(\"value-change\", {\n detail: {\n value: this.value,\n selectedIndex: this.selectedIndex,\n },\n }),\n );\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n let shouldPrevent = true;\n switch (event.key) {\n case \"Down\":\n case \"ArrowDown\":\n case \"Right\":\n case \"ArrowRight\": {\n this.focusNext();\n break;\n }\n case \"Up\":\n case \"ArrowUp\":\n case \"Left\":\n case \"ArrowLeft\": {\n this.focusPrevious();\n break;\n }\n case \"Enter\": {\n this.updateChecked();\n break;\n }\n default: {\n shouldPrevent = false;\n }\n }\n if (shouldPrevent) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private focusNext() {\n const newIndex = this.getNextFocusIndex(this.focusIndex + 1);\n this.focusIndex = newIndex !== -1 ? newIndex : this.getNextFocusIndex(0);\n if (!this.uncheckAllowed) {\n this.updateChecked();\n }\n }\n\n private focusPrevious() {\n const newIndex = this.getPreviousFocusIndex(this.focusIndex - 1);\n this.focusIndex = newIndex !== -1 ? newIndex : this.getPreviousFocusIndex(this.childElementCount - 1);\n if (!this.uncheckAllowed) {\n this.updateChecked();\n }\n }\n\n private getNextFocusIndex(index: number): number {\n for (let i = index; i < this.childElementCount; i++) {\n const button = this._buttons[i];\n if (this.isFocusable(button)) {\n return i;\n }\n }\n\n return -1;\n }\n\n private getPreviousFocusIndex(index: number): number {\n for (let i = index; i >= 0; i--) {\n const button = this._buttons[i];\n if (this.isFocusable(button)) {\n return i;\n }\n }\n\n return -1;\n }\n\n private isFocusable(button: HTMLElement): boolean {\n return !button.hasAttribute(\"disabled\");\n }\n\n private updateChecked(): void {\n const previousChecked = this._checkedButton;\n const currentChecked = this._buttons[this.focusIndex];\n this._checkedButton = currentChecked;\n if (previousChecked && previousChecked !== currentChecked) {\n this.uncheckButton(previousChecked);\n }\n if (currentChecked) {\n this.toggleButton(currentChecked);\n }\n }\n\n private toggleButton(button: HTMLElement): void {\n const checked = button.hasAttribute(\"checked\");\n if (checked) {\n if (this.uncheckAllowed) {\n this.uncheckButton(button);\n this._checkedButton = null;\n this.updateValue(\"\");\n }\n } else {\n this.checkButton(button);\n this.updateValue(button.getAttribute(\"value\"));\n }\n }\n\n private updateValue(newValue: string): void {\n this.value = newValue;\n this.fireValueChangeEvent();\n }\n\n private updateFocused(previousFocused?: HTMLElement, currentFocused?: HTMLElement): void {\n previousFocused?.removeAttribute?.(\"focused\");\n currentFocused?.setAttribute?.(\"focused\", \"\");\n }\n\n private checkButton(button: HTMLElement): void {\n button.setAttribute(\"checked\", \"\");\n }\n\n private uncheckButton(button: HTMLElement): void {\n button.removeAttribute(\"checked\");\n }\n\n private get buttonsSlot(): HTMLSlotElement {\n if (this.shadowRoot && !this._buttonsSlot) {\n this._buttonsSlot = this.shadowRoot.querySelector(\"slot\");\n }\n return this._buttonsSlot;\n }\n\n private get selectedIndex(): number {\n return this._buttons.indexOf(this._checkedButton);\n }\n}\n\nRadioButtonGroup.ensureDefined();\n"],"names":["idCounter","_RadioButton","_a","LitElement","event","css","unsafeCSS","style","html","__decorateClass","property","RadioButton","_RadioButtonGroup","button","target","ind","targetIndex","shouldPrevent","index","oldValue","previousButton","currentButton","changedProperties","ifDefined","value","newIndex","i","previousChecked","currentChecked","newValue","previousFocused","currentFocused","ValidationLevel","RadioButtonGroup"],"mappings":";;;;;;;;;;AAUA,IAAIA,IAAY;;AAET,MAAMC,KAANC,IAAA,cAA0BC,EAAW;AAAA,EAkBxC,cAAc;AACV,UAAA,GAXJ,KAAO,UAAU,IAEjB,KAAO,QAAQ,IAEf,KAAO,WAAW,IAElB,KAAO,QAAQ,I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;AAAA,IAEJ,SAAS;AAAA,EAAA,CACZ;AAAA,GA9BQZ,EA+BF,WAAA,iBAAA;AA/BJ,IAAMqB,IAANrB;AA0SPqB,EAAiB,cAAA;"}
|
|
1
|
+
{"version":3,"file":"radio-button-group.mjs","names":[],"sources":["../scss/button.scss?inline","../radio-button.ts","../scss/group.scss?inline","../radio-button-group.ts"],"sourcesContent":["@use \"@cas-smartdesign/styles/scss/variables/colors\";\n@use \"@cas-smartdesign/styles/scss/variables/typography\";\n\n:host {\n\tdisplay: block;\n}\n\n:host,\n.label,\n.checkbox {\n\toutline: none;\n}\n\n:host([disabled]) {\n\tpointer-events: none;\n\n\t.root {\n\t\topacity: 0.6;\n\t\tcursor: default;\n\t\tfilter: grayscale(100%);\n\t}\n}\n\n:host(:not([disabled])[focused]) .highlight {\n\tdisplay: block !important;\n}\n\n:host([checked]) {\n\tcircle.inner {\n\t\tdisplay: block !important;\n\t}\n\tcircle.outer {\n\t\tstroke: var(--sd-radio-button-checked-color, colors.$sd-blue) !important;\n\t}\n}\n\n:host([oneline]) .label {\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.root {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tvertical-align: middle;\n\twidth: 100%;\n\tpadding: var(--sd-radio-button-padding, 6px 0px);\n\n\t.radio-button-container {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\twidth: 28px;\n\t\theight: 28px;\n\t\tbox-sizing: border-box;\n\t\tcursor: pointer;\n\t\tmargin-right: 5px;\n\t\tflex-shrink: 0;\n\n\t\tinput {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\topacity: 0;\n\t\t}\n\n\t\tcircle.highlight {\n\t\t\tstroke: var(--sd-radio-button-highlight-color, rgba(colors.$sd-blue, 0.3));\n\t\t}\n\t\tcircle.inner {\n\t\t\tfill: var(--sd-radio-button-checked-color, colors.$sd-blue);\n\t\t}\n\t\tcircle.outer {\n\t\t\tstroke: var(--sd-radio-button-unchecked-color, colors.$sd-grey);\n\t\t}\n\t}\n\n\t.label {\n\t\tfont-family: var(--sd-radio-button-font-family, typography.$sd-font-family);\n\t\ttext-overflow: ellipsis;\n\t\toverflow-x: hidden;\n\t\tuser-select: none;\n\t\tcursor: pointer;\n\t\tpadding-top: 2px;\n\t\tpadding-bottom: 2px;\n\t}\n}\n","import { LitElement, type TemplateResult, html, unsafeCSS, css } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [RadioButton.ID]: RadioButton;\n }\n}\n\nimport style from \"./scss/button.scss?inline\";\nlet idCounter = 0;\n\nexport class RadioButton extends LitElement {\n public static readonly ID = \"sd-radio-button\";\n public static ensureDefined = (): void => {\n if (!customElements.get(RadioButton.ID)) {\n customElements.define(RadioButton.ID, RadioButton);\n }\n };\n @property({ type: Boolean, reflect: true, attribute: true })\n public checked = false;\n @property({ type: String, reflect: true, attribute: true })\n public value = \"\";\n @property({ type: Boolean, reflect: true, attribute: true })\n public disabled = false;\n @property({ type: String, reflect: true, attribute: true })\n public label = \"\";\n\n private a11yID;\n\n constructor() {\n super();\n this.a11yID = RadioButton.ID + \"_\" + idCounter++;\n }\n\n static override get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n\n public override render(): TemplateResult {\n return html`\n <div class=\"root\">\n <div class=\"radio-button-container\">\n <input\n type=\"radio\"\n id=\"${this.a11yID}\"\n .checked=\"${this.checked}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleClick}\"\n class=\"radio-button\"\n />\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-14 -14 28 28\">\n <circle\n class=\"highlight\"\n style=\"display:none\"\n r=\"11px\"\n fill=\"transparent\"\n stroke-width=\"6px\"\n ></circle>\n <circle class=\"inner\" r=\"6px\" style=\"display:none\" stroke=\"none\"></circle>\n <circle class=\"outer\" r=\"9px\" fill=\"transparent\" stroke-width=\"2px\"></circle>\n </svg>\n </div>\n <label class=\"label\" for=\"${this.a11yID}\" @click=\"${this.handleClick}\">${this.label}</label>\n </div>\n `;\n }\n\n private handleClick = (event: MouseEvent): void => {\n event.preventDefault();\n };\n}\n",":host(:focus) {\n\toutline: none;\n}\n\n.buttons-container {\n\tdisplay: flex;\n\tgap: var(--sd-radio-button-group-gap, 0);\n}\n\n.buttons-container.vertical {\n\tflex-direction: column;\n}\n\n.validation-message {\n\tmargin-left: 5px;\n}\n","import SDFieldValidationMessage, { ValidationLevel } from \"@cas-smartdesign/field-validation-message\";\nimport {\n LitElement,\n type TemplateResult,\n html,\n type PropertyValues,\n type ComplexAttributeConverter,\n unsafeCSS,\n css,\n} from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nimport type { LayoutType, IValueChangeEvent } from \"./types\";\n\nimport { RadioButton } from \"./radio-button\";\n\nexport { RadioButton } from \"./radio-button\";\nexport type * from \"./types\";\n\nimport style from \"./scss/group.scss?inline\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [RadioButtonGroup.ID]: RadioButtonGroup;\n }\n interface HTMLElementEventMap {\n \"sd-radio-button-group-value-change\": CustomEvent<IValueChangeEvent>;\n }\n}\n\nexport class RadioButtonGroup extends LitElement {\n public static readonly ID = \"sd-radio-button-group\";\n public static ensureDefined = (): void => {\n RadioButton.ensureDefined();\n if (!customElements.get(RadioButtonGroup.ID)) {\n customElements.define(RadioButtonGroup.ID, RadioButtonGroup);\n }\n };\n @property({ type: String, reflect: true, attribute: true })\n public layout: LayoutType = \"horizontal\";\n @property({ type: String })\n public value: string | undefined = \"\";\n @property({ type: Boolean, reflect: true, attribute: \"uncheck-allowed\" })\n public uncheckAllowed = false;\n @property({ type: Boolean, reflect: true, attribute: true })\n public disabled = false;\n @property({ type: String })\n public validationMessage: string | undefined;\n @property({ type: String })\n public validationIconSrc: string | undefined;\n @property({\n type: {\n fromAttribute(value: string): ValidationLevel | undefined {\n return SDFieldValidationMessage.parseLevel(value);\n },\n toAttribute(value: ValidationLevel | undefined): string | undefined {\n return value != null ? value.toLowerCase() : undefined;\n },\n } as ComplexAttributeConverter,\n reflect: true,\n })\n public validationLevel: ValidationLevel | undefined;\n\n private _buttonsSlot: HTMLSlotElement | undefined;\n private _buttons: HTMLElement[] = [];\n private _focusIndex = -1;\n private _checkedButton: HTMLElement | undefined = undefined;\n\n public get focusIndex(): number {\n return this._focusIndex;\n }\n\n public set focusIndex(index: number) {\n if (index >= -1 && index < this.childElementCount) {\n const oldValue = this._focusIndex;\n this._focusIndex = index;\n if (oldValue !== index) {\n const previousButton = this._buttons[oldValue];\n const currentButton = this._buttons[this.focusIndex];\n this.updateFocused(previousButton, currentButton);\n }\n }\n }\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.buttonsSlot!.addEventListener(\"slotchange\", this.handleSlotChange);\n this.addEventListener(\"focusin\", this.handleFocusIn);\n this.addEventListener(\"focusout\", this.handleFocusOut);\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has(\"disabled\")) {\n if (this.disabled) {\n this.disableButtons();\n } else {\n this.enableButtons();\n }\n }\n }\n\n static override get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n public override render(): TemplateResult {\n return html`\n <div\n class=\"buttons-container ${this.layout === \"vertical\" ? \"vertical\" : \"horizontal\"}\"\n @click=\"${ifDefined(this.disabled ? undefined : this.handleButtonClick)}\"\n >\n <slot></slot>\n </div>\n ${this.validationMessage &&\n html`\n <sd-field-validation-message\n class=\"validation-message\"\n .message=${this.validationMessage}\n .icon=${this.validationIconSrc}\n .level=${this.validationLevel}\n >\n </sd-field-validation-message>\n `}\n `;\n }\n\n private handleSlotChange = (): void => {\n this._buttons = this.buttonsSlot!.assignedElements() as HTMLElement[];\n this._buttons.forEach((button) => {\n if (!button.hasAttribute(\"disabled\") && this.disabled) {\n button.setAttribute(\"disabled\", \"\");\n }\n // prevent radio buttons to be able to get focus by tabbing\n // as focus is handled by this element\n button.setAttribute(\"tabIndex\", \"-1\");\n this.updateCheckedButton(button);\n });\n };\n\n private updateCheckedButton(button: HTMLElement): void {\n if (this._checkedButton && this._checkedButton !== button) {\n this.uncheckButton(button);\n } else if (button.hasAttribute(\"checked\")) {\n this._checkedButton = button;\n const value = button.getAttribute(\"value\");\n this.updateValue(value);\n }\n }\n\n private handleFocusIn = (event: FocusEvent): void => {\n const target = event.target as HTMLElement;\n const ind = this._buttons.findIndex((button) => button == target);\n this.focusIndex = this.focusIndex >= 0 ? this.focusIndex : this.getNextFocusIndex(ind !== -1 ? ind : 0);\n this.updateFocused(undefined, this._buttons[this.focusIndex]);\n };\n\n private handleFocusOut = (): void => {\n this.updateFocused(this._buttons[this.focusIndex]);\n };\n\n private disableButtons(): void {\n this._buttons?.forEach((button) => {\n button.setAttribute(\"disabled\", \"\");\n });\n }\n\n private enableButtons(): void {\n this._buttons?.forEach((button) => {\n button.removeAttribute(\"disabled\");\n });\n }\n\n private handleButtonClick = (event: MouseEvent): void => {\n // the individual buttons are not focusable\n this.focus();\n const target = this._buttons.find((button) => button.contains(event.target as Node));\n const targetIndex = this._buttons.findIndex((button) => button == target);\n if (targetIndex >= 0) {\n this.focusIndex = targetIndex;\n this.updateChecked();\n }\n };\n\n private fireValueChangeEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IValueChangeEvent>(\"sd-radio-button-group-value-change\", {\n detail: {\n value: this.value,\n selectedIndex: this.selectedIndex,\n },\n }),\n );\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n let shouldPrevent = true;\n switch (event.key) {\n case \"Down\":\n case \"ArrowDown\":\n case \"Right\":\n case \"ArrowRight\": {\n this.focusNext();\n break;\n }\n case \"Up\":\n case \"ArrowUp\":\n case \"Left\":\n case \"ArrowLeft\": {\n this.focusPrevious();\n break;\n }\n case \"Enter\": {\n this.updateChecked();\n break;\n }\n default: {\n shouldPrevent = false;\n }\n }\n if (shouldPrevent) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private focusNext() {\n const newIndex = this.getNextFocusIndex(this.focusIndex + 1);\n this.focusIndex = newIndex !== -1 ? newIndex : this.getNextFocusIndex(0);\n if (!this.uncheckAllowed) {\n this.updateChecked();\n }\n }\n\n private focusPrevious() {\n const newIndex = this.getPreviousFocusIndex(this.focusIndex - 1);\n this.focusIndex = newIndex !== -1 ? newIndex : this.getPreviousFocusIndex(this.childElementCount - 1);\n if (!this.uncheckAllowed) {\n this.updateChecked();\n }\n }\n\n private getNextFocusIndex(index: number): number {\n for (let i = index; i < this.childElementCount; i++) {\n const button = this._buttons[i];\n if (button != null && this.isFocusable(button)) {\n return i;\n }\n }\n\n return -1;\n }\n\n private getPreviousFocusIndex(index: number): number {\n for (let i = index; i >= 0; i--) {\n const button = this._buttons[i];\n if (button != null && this.isFocusable(button)) {\n return i;\n }\n }\n\n return -1;\n }\n\n private isFocusable(button: HTMLElement): boolean {\n return !button.hasAttribute(\"disabled\");\n }\n\n private updateChecked(): void {\n const previousChecked = this._checkedButton;\n const currentChecked = this._buttons[this.focusIndex];\n this._checkedButton = currentChecked;\n if (previousChecked && previousChecked !== currentChecked) {\n this.uncheckButton(previousChecked);\n }\n if (currentChecked) {\n this.toggleButton(currentChecked);\n }\n }\n\n private toggleButton(button: HTMLElement): void {\n const checked = button.hasAttribute(\"checked\");\n if (checked) {\n if (this.uncheckAllowed) {\n this.uncheckButton(button);\n this._checkedButton = undefined;\n this.updateValue(\"\");\n }\n } else {\n this.checkButton(button);\n this.updateValue(button.getAttribute(\"value\"));\n }\n }\n\n private updateValue(newValue: string | null | undefined): void {\n this.value = newValue ?? undefined;\n this.fireValueChangeEvent();\n }\n\n private updateFocused(previousFocused?: HTMLElement, currentFocused?: HTMLElement): void {\n previousFocused?.removeAttribute?.(\"focused\");\n currentFocused?.setAttribute?.(\"focused\", \"\");\n }\n\n private checkButton(button: HTMLElement): void {\n button.setAttribute(\"checked\", \"\");\n }\n\n private uncheckButton(button: HTMLElement): void {\n button.removeAttribute(\"checked\");\n }\n\n private get buttonsSlot(): HTMLSlotElement | undefined {\n if (this.shadowRoot && !this._buttonsSlot) {\n this._buttonsSlot = this.shadowRoot.querySelector(\"slot\") ?? undefined;\n }\n return this._buttonsSlot;\n }\n\n private get selectedIndex(): number {\n if (this._buttons == undefined || this._checkedButton == undefined) {\n return -1;\n }\n return this._buttons.indexOf(this._checkedButton);\n }\n}\n\nRadioButtonGroup.ensureDefined();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;ACUA,IAAI,IAAY,GAEH,IAAb,MAAa,UAAoB,EAAW;;YACZ;;;6BACc;AACtC,GAAK,eAAe,IAAI,EAAY,GAAG,IACnC,eAAe,OAAO,EAAY,IAAI,EAAY;;;CAc1D,cAAc;AAEV,EADA,OAAO,iBAXM,iBAEF,oBAEG,iBAEH,wBA8CQ,MAA4B;AAC/C,KAAM,gBAAgB;KAzCtB,KAAK,SAAS,EAAY,KAAK,MAAM;;CAGzC,WAAoB,SAAS;AACzB,SAAO,CACH,CAAG;kBACG,EAAU,EAAM,CAAC;cAE1B;;CAGL,SAAyC;AACrC,SAAO,CAAI;;;;;8BAKW,KAAK,OAAO;oCACN,KAAK,QAAQ;qCACZ,KAAK,SAAS;kCACjB,KAAK,YAAY;;;;;;;;;;;;;;;4CAeP,KAAK,OAAO,YAAY,KAAK,YAAY,IAAI,KAAK,MAAM;;;;;GAhD/F,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAE3D,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAE1D,EAAS;CAAE,MAAM;CAA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A,EAAA,KAExE,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAM,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAE3D,EAAS,EAAE,MAAM,QAAQ,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA,KAE1B,EAAS,EAAE,MAAM,QAAQ,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA,KAE1B,EAAS;CACN,MAAM;EACF,cAAc,GAA4C;AACtD,UAAO,EAAyB,WAAW,EAAM;;EAErD,YAAY,GAAwD;AAChE,UAAO,GAAsB,aAAa;;EAEjD;CACD,SAAS;CACZ,CAAC,EAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,EA+QN,EAAiB,eAAe"}
|
package/dist/radio-button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, TemplateResult } from "lit";
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLElementTagNameMap {
|
|
4
4
|
[RadioButton.ID]: RadioButton;
|
|
@@ -17,3 +17,4 @@ export declare class RadioButton extends LitElement {
|
|
|
17
17
|
render(): TemplateResult;
|
|
18
18
|
private handleClick;
|
|
19
19
|
}
|
|
20
|
+
//# sourceMappingURL=radio-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../radio-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAwB,MAAM,KAAK,CAAC;AAG5E,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC;KACjC;CACJ;AAKD,qBAAa,WAAY,SAAQ,UAAU;IACvC,gBAAuB,EAAE,qBAAqB;IAC9C,OAAc,aAAa,QAAO,IAAI,CAIpC;IAEK,OAAO,UAAS;IAEhB,KAAK,SAAM;IAEX,QAAQ,UAAS;IAEjB,KAAK,SAAM;IAElB,OAAO,CAAC,MAAM,CAAC;;IAOf,WAAoB,MAAM,8BAMzB;IAEe,MAAM,IAAI,cAAc;IA6BxC,OAAO,CAAC,WAAW,CAEjB;CACL"}
|
package/dist/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1,88 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@cypress/vite-dev-server@7.
|
|
2
|
+
"@cypress/vite-dev-server@7.2.1": {
|
|
3
3
|
"licenses": "MIT",
|
|
4
4
|
"repository": "https://github.com/cypress-io/cypress",
|
|
5
5
|
"licenseUrl": "https://github.com/cypress-io/cypress/tree/develop/npm/vite-dev-server#readme"
|
|
6
6
|
},
|
|
7
|
-
"@
|
|
7
|
+
"@tsdown/css@0.21.7": {
|
|
8
8
|
"licenses": "MIT",
|
|
9
|
-
"repository": "https://github.com/
|
|
10
|
-
"licenseUrl": "https://unpkg.com/@
|
|
9
|
+
"repository": "https://github.com/rolldown/tsdown",
|
|
10
|
+
"licenseUrl": "https://unpkg.com/@tsdown/css@0.21.7/LICENSE"
|
|
11
11
|
},
|
|
12
|
-
"@
|
|
13
|
-
"licenses": "MIT",
|
|
14
|
-
"repository": "https://github.com/rollup/plugins",
|
|
15
|
-
"licenseUrl": "https://unpkg.com/@rollup/plugin-node-resolve@16.0.1/LICENSE"
|
|
16
|
-
},
|
|
17
|
-
"@types/node@24.3.0": {
|
|
12
|
+
"@types/node@25.5.2": {
|
|
18
13
|
"licenses": "MIT",
|
|
19
14
|
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
20
|
-
"licenseUrl": "https://unpkg.com/@types/node@
|
|
15
|
+
"licenseUrl": "https://unpkg.com/@types/node@25.5.2/LICENSE"
|
|
21
16
|
},
|
|
22
17
|
"@types/postcss-prefix-selector@1.16.3": {
|
|
23
18
|
"licenses": "MIT",
|
|
24
19
|
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
25
20
|
"licenseUrl": "https://unpkg.com/@types/postcss-prefix-selector@1.16.3/LICENSE"
|
|
26
21
|
},
|
|
27
|
-
"@
|
|
22
|
+
"@types/yargs@17.0.35": {
|
|
28
23
|
"licenses": "MIT",
|
|
29
|
-
"repository": "https://github.com/
|
|
30
|
-
"licenseUrl": "https://unpkg.com/@
|
|
31
|
-
},
|
|
32
|
-
"@typescript-eslint/parser@8.41.0": {
|
|
33
|
-
"licenses": "MIT",
|
|
34
|
-
"repository": "https://github.com/typescript-eslint/typescript-eslint",
|
|
35
|
-
"licenseUrl": "https://unpkg.com/@typescript-eslint/parser@8.41.0/LICENSE"
|
|
24
|
+
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
|
25
|
+
"licenseUrl": "https://unpkg.com/@types/yargs@17.0.35/LICENSE"
|
|
36
26
|
},
|
|
37
|
-
"@vitest/coverage-v8@4.
|
|
27
|
+
"@vitest/coverage-v8@4.1.2": {
|
|
38
28
|
"licenses": "MIT",
|
|
39
29
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
40
|
-
"licenseUrl": "https://unpkg.com/@vitest/coverage-v8@4.
|
|
30
|
+
"licenseUrl": "https://unpkg.com/@vitest/coverage-v8@4.1.2/LICENSE"
|
|
41
31
|
},
|
|
42
|
-
"@vitest/ui@4.
|
|
32
|
+
"@vitest/ui@4.1.2": {
|
|
43
33
|
"licenses": "MIT",
|
|
44
34
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
45
|
-
"licenseUrl": "https://unpkg.com/@vitest/ui@4.
|
|
35
|
+
"licenseUrl": "https://unpkg.com/@vitest/ui@4.1.2/LICENSE"
|
|
46
36
|
},
|
|
47
|
-
"axe-core@4.
|
|
37
|
+
"axe-core@4.11.2": {
|
|
48
38
|
"licenses": "MPL-2.0",
|
|
49
39
|
"repository": "https://github.com/dequelabs/axe-core",
|
|
50
|
-
"licenseUrl": "https://unpkg.com/axe-core@4.
|
|
40
|
+
"licenseUrl": "https://unpkg.com/axe-core@4.11.2/LICENSE"
|
|
51
41
|
},
|
|
52
42
|
"cypress-axe@1.7.0": {
|
|
53
43
|
"licenses": "MIT",
|
|
54
44
|
"repository": "https://github.com/component-driven/cypress-axe",
|
|
55
45
|
"licenseUrl": "https://unpkg.com/cypress-axe@1.7.0/License.md"
|
|
56
46
|
},
|
|
57
|
-
"cypress@15.
|
|
47
|
+
"cypress@15.13.0": {
|
|
58
48
|
"licenses": "MIT",
|
|
59
49
|
"repository": "https://github.com/cypress-io/cypress",
|
|
60
50
|
"licenseUrl": "https://cypress.io"
|
|
61
51
|
},
|
|
62
|
-
"
|
|
63
|
-
"licenses": "MIT",
|
|
64
|
-
"repository": "https://github.com/evanw/esbuild",
|
|
65
|
-
"licenseUrl": "https://unpkg.com/esbuild@0.27.2/LICENSE.md"
|
|
66
|
-
},
|
|
67
|
-
"eslint-config-google@0.14.0": {
|
|
68
|
-
"licenses": "Apache-2.0",
|
|
69
|
-
"repository": "https://github.com/google/eslint-config-google",
|
|
70
|
-
"licenseUrl": "https://unpkg.com/eslint-config-google@0.14.0/LICENSE"
|
|
71
|
-
},
|
|
72
|
-
"eslint-config-prettier@10.1.8": {
|
|
73
|
-
"licenses": "MIT",
|
|
74
|
-
"repository": "https://github.com/prettier/eslint-config-prettier",
|
|
75
|
-
"licenseUrl": "https://unpkg.com/eslint-config-prettier@10.1.8/LICENSE"
|
|
76
|
-
},
|
|
77
|
-
"eslint@9.34.0": {
|
|
78
|
-
"licenses": "MIT",
|
|
79
|
-
"repository": "https://github.com/eslint/eslint",
|
|
80
|
-
"licenseUrl": "https://unpkg.com/eslint@9.34.0/LICENSE"
|
|
81
|
-
},
|
|
82
|
-
"github-markdown-css@5.8.1": {
|
|
52
|
+
"github-markdown-css@5.9.0": {
|
|
83
53
|
"licenses": "MIT",
|
|
84
54
|
"repository": "https://github.com/sindresorhus/github-markdown-css",
|
|
85
|
-
"licenseUrl": "https://unpkg.com/github-markdown-css@5.
|
|
55
|
+
"licenseUrl": "https://unpkg.com/github-markdown-css@5.9.0/license"
|
|
86
56
|
},
|
|
87
57
|
"highlight.js@11.11.1": {
|
|
88
58
|
"licenses": "BSD-3-Clause",
|
|
@@ -94,100 +64,80 @@
|
|
|
94
64
|
"repository": "https://github.com/davidparsson/junit-report-builder",
|
|
95
65
|
"licenseUrl": "https://unpkg.com/junit-report-builder@5.1.1/LICENSE"
|
|
96
66
|
},
|
|
97
|
-
"lint-staged@16.
|
|
67
|
+
"lint-staged@16.4.0": {
|
|
98
68
|
"licenses": "MIT",
|
|
99
69
|
"repository": "https://github.com/lint-staged/lint-staged",
|
|
100
|
-
"licenseUrl": "https://unpkg.com/lint-staged@16.
|
|
70
|
+
"licenseUrl": "https://unpkg.com/lint-staged@16.4.0/LICENSE"
|
|
101
71
|
},
|
|
102
|
-
"lit@3.3.
|
|
72
|
+
"lit@3.3.2": {
|
|
103
73
|
"licenses": "BSD-3-Clause",
|
|
104
74
|
"repository": "https://github.com/lit/lit",
|
|
105
|
-
"licenseUrl": "https://unpkg.com/lit@3.3.
|
|
75
|
+
"licenseUrl": "https://unpkg.com/lit@3.3.2/LICENSE"
|
|
106
76
|
},
|
|
107
|
-
"marked@
|
|
77
|
+
"marked@18.0.0": {
|
|
108
78
|
"licenses": "MIT",
|
|
109
79
|
"repository": "https://github.com/markedjs/marked",
|
|
110
|
-
"licenseUrl": "https://unpkg.com/marked@
|
|
80
|
+
"licenseUrl": "https://unpkg.com/marked@18.0.0/LICENSE.md"
|
|
111
81
|
},
|
|
112
|
-
"
|
|
82
|
+
"oxfmt@0.44.0": {
|
|
113
83
|
"licenses": "MIT",
|
|
114
|
-
"repository": "https://github.com/
|
|
115
|
-
"licenseUrl": "https://unpkg.com/
|
|
84
|
+
"repository": "https://github.com/oxc-project/oxc",
|
|
85
|
+
"licenseUrl": "https://unpkg.com/oxfmt@0.44.0/LICENSE"
|
|
116
86
|
},
|
|
117
|
-
"
|
|
87
|
+
"oxlint-tsgolint@0.20.0": {
|
|
118
88
|
"licenses": "MIT",
|
|
119
|
-
"repository": "https://github.com/
|
|
120
|
-
"licenseUrl": "https://unpkg.com/
|
|
89
|
+
"repository": "https://github.com/oxc-project/tsgolint",
|
|
90
|
+
"licenseUrl": "https://unpkg.com/oxlint-tsgolint@0.20.0/LICENSE"
|
|
121
91
|
},
|
|
122
|
-
"
|
|
92
|
+
"oxlint@1.59.0": {
|
|
123
93
|
"licenses": "MIT",
|
|
124
|
-
"repository": "https://github.com/
|
|
125
|
-
"licenseUrl": "https://unpkg.com/
|
|
94
|
+
"repository": "https://github.com/oxc-project/oxc",
|
|
95
|
+
"licenseUrl": "https://unpkg.com/oxlint@1.59.0/LICENSE"
|
|
126
96
|
},
|
|
127
|
-
"
|
|
128
|
-
"licenses": "MIT",
|
|
129
|
-
"repository": "https://github.com/sindresorhus/resolve-pkg",
|
|
130
|
-
"licenseUrl": "https://unpkg.com/resolve-pkg@2.0.0/license"
|
|
131
|
-
},
|
|
132
|
-
"sass@1.91.0": {
|
|
133
|
-
"licenses": "MIT",
|
|
134
|
-
"repository": "https://github.com/sass/dart-sass",
|
|
135
|
-
"licenseUrl": "https://unpkg.com/sass@1.91.0/LICENSE"
|
|
136
|
-
},
|
|
137
|
-
"stylelint-config-recommended-scss@16.0.0": {
|
|
97
|
+
"postcss-prefix-selector@2.1.1": {
|
|
138
98
|
"licenses": "MIT",
|
|
139
|
-
"repository": "https://github.com/
|
|
140
|
-
"licenseUrl": "https://unpkg.com/
|
|
99
|
+
"repository": "https://github.com/RadValentin/postcss-prefix-selector",
|
|
100
|
+
"licenseUrl": "https://unpkg.com/postcss-prefix-selector@2.1.1/LICENSE"
|
|
141
101
|
},
|
|
142
|
-
"
|
|
102
|
+
"postcss@8.5.8": {
|
|
143
103
|
"licenses": "MIT",
|
|
144
|
-
"repository": "https://github.com/
|
|
145
|
-
"licenseUrl": "https://unpkg.com/
|
|
104
|
+
"repository": "https://github.com/postcss/postcss",
|
|
105
|
+
"licenseUrl": "https://unpkg.com/postcss@8.5.8/LICENSE"
|
|
146
106
|
},
|
|
147
|
-
"
|
|
107
|
+
"resolve-pkg@3.0.1": {
|
|
148
108
|
"licenses": "MIT",
|
|
149
|
-
"repository": "https://github.com/
|
|
150
|
-
"licenseUrl": "https://unpkg.com/
|
|
109
|
+
"repository": "https://github.com/sindresorhus/resolve-pkg",
|
|
110
|
+
"licenseUrl": "https://unpkg.com/resolve-pkg@3.0.1/license"
|
|
151
111
|
},
|
|
152
|
-
"
|
|
112
|
+
"sass@1.99.0": {
|
|
153
113
|
"licenses": "MIT",
|
|
154
|
-
"repository": "https://github.com/
|
|
155
|
-
"licenseUrl": "https://unpkg.com/
|
|
114
|
+
"repository": "https://github.com/sass/dart-sass",
|
|
115
|
+
"licenseUrl": "https://unpkg.com/sass@1.99.0/LICENSE"
|
|
156
116
|
},
|
|
157
|
-
"
|
|
117
|
+
"tsdown@0.21.7": {
|
|
158
118
|
"licenses": "MIT",
|
|
159
|
-
"repository": "https://github.com/
|
|
160
|
-
"licenseUrl": "https://unpkg.com/
|
|
119
|
+
"repository": "https://github.com/rolldown/tsdown",
|
|
120
|
+
"licenseUrl": "https://unpkg.com/tsdown@0.21.7/LICENSE"
|
|
161
121
|
},
|
|
162
|
-
"turbo@2.
|
|
122
|
+
"turbo@2.9.4": {
|
|
163
123
|
"licenses": "MIT",
|
|
164
124
|
"repository": "https://github.com/vercel/turborepo",
|
|
165
|
-
"licenseUrl": "https://unpkg.com/turbo@2.
|
|
125
|
+
"licenseUrl": "https://unpkg.com/turbo@2.9.4/LICENSE"
|
|
166
126
|
},
|
|
167
|
-
"typescript
|
|
168
|
-
"licenses": "MIT",
|
|
169
|
-
"repository": "https://github.com/typescript-eslint/typescript-eslint",
|
|
170
|
-
"licenseUrl": "https://unpkg.com/typescript-eslint@8.41.0/LICENSE"
|
|
171
|
-
},
|
|
172
|
-
"typescript@5.9.3": {
|
|
127
|
+
"typescript@6.0.2": {
|
|
173
128
|
"licenses": "Apache-2.0",
|
|
174
129
|
"repository": "https://github.com/microsoft/TypeScript",
|
|
175
|
-
"licenseUrl": "https://unpkg.com/typescript@
|
|
176
|
-
},
|
|
177
|
-
"vite-tsconfig-paths@5.1.4": {
|
|
178
|
-
"licenses": "MIT",
|
|
179
|
-
"repository": "https://github.com/aleclarson/vite-tsconfig-paths",
|
|
180
|
-
"licenseUrl": "https://unpkg.com/vite-tsconfig-paths@5.1.4/LICENSE"
|
|
130
|
+
"licenseUrl": "https://unpkg.com/typescript@6.0.2/LICENSE.txt"
|
|
181
131
|
},
|
|
182
|
-
"vite@
|
|
132
|
+
"vite@8.0.5": {
|
|
183
133
|
"licenses": "MIT",
|
|
184
134
|
"repository": "https://github.com/vitejs/vite",
|
|
185
|
-
"licenseUrl": "https://unpkg.com/vite@
|
|
135
|
+
"licenseUrl": "https://unpkg.com/vite@8.0.5/LICENSE.md"
|
|
186
136
|
},
|
|
187
|
-
"vitest@4.
|
|
137
|
+
"vitest@4.1.2": {
|
|
188
138
|
"licenses": "MIT",
|
|
189
139
|
"repository": "https://github.com/vitest-dev/vitest",
|
|
190
|
-
"licenseUrl": "https://unpkg.com/vitest@4.
|
|
140
|
+
"licenseUrl": "https://unpkg.com/vitest@4.1.2/LICENSE.md"
|
|
191
141
|
},
|
|
192
142
|
"yargs@18.0.0": {
|
|
193
143
|
"licenses": "MIT",
|
package/package.json
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cas-smartdesign/radio-button-group",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Radio button and radio button group elements with SmartDesign look & feel",
|
|
5
|
-
"main": "dist/radio-button-group-with-externals.js",
|
|
6
|
-
"module": "dist/radio-button-group.mjs",
|
|
7
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
-
"types": "dist/radio-button-group.d.ts",
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"lit": "^3.3.1",
|
|
11
|
-
"@cas-smartdesign/field-validation-message": "^5.3.2",
|
|
12
|
-
"@cas-smartdesign/styles": "^3.8.0"
|
|
13
|
-
},
|
|
14
6
|
"files": [
|
|
15
7
|
"dist",
|
|
16
8
|
"npm-third-party-licenses.json"
|
|
17
9
|
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/radio-button-group.mjs",
|
|
12
|
+
"module": "dist/radio-button-group.mjs",
|
|
13
|
+
"types": "dist/radio-button-group.d.ts",
|
|
18
14
|
"publishConfig": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"lit": "^3.3.2",
|
|
20
|
+
"@cas-smartdesign/field-validation-message": "^6.0.0",
|
|
21
|
+
"@cas-smartdesign/styles": "^3.9.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
|
-
"@cas-smartdesign/
|
|
24
|
-
"@cas-smartdesign/
|
|
25
|
-
"@cas-smartdesign/
|
|
24
|
+
"@cas-smartdesign/element-preview": "^1.0.0",
|
|
25
|
+
"@cas-smartdesign/button": "^6.0.0",
|
|
26
|
+
"@cas-smartdesign/license-generator": "^1.10.0"
|
|
26
27
|
},
|
|
27
28
|
"scripts": {
|
|
28
29
|
"version": "pnpm version",
|
package/readme.md
CHANGED
|
@@ -23,7 +23,7 @@ A radio-button-group and a radio-button element based on [lit-element](https://g
|
|
|
23
23
|
|
|
24
24
|
### Custom events
|
|
25
25
|
|
|
26
|
-
- `value-change`: **_CustomEvent\<IValueChangeEvent\>_**
|
|
26
|
+
- `sd-radio-button-group-value-change`: **_CustomEvent\<IValueChangeEvent\>_**
|
|
27
27
|
- This event is dispatched when the value is changed because of a user interaction
|
|
28
28
|
|
|
29
29
|
### Validation
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/radio-button-group"]=(()=>{var Q=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Bt=Object.prototype.hasOwnProperty;var Mt=(e,t)=>{for(var s in t)Q(e,s,{get:t[s],enumerable:!0})},Ot=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ut(t))!Bt.call(e,o)&&o!==s&&Q(e,o,{get:()=>t[o],enumerable:!(i=It(t,o))||i.enumerable});return e};var Lt=e=>Ot(Q({},"__esModule",{value:!0}),e);var ae={};Mt(ae,{RadioButton:()=>kt,RadioButtonGroup:()=>Pt});var q=globalThis,W=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),ut=new WeakMap,M=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o,s=this.t;if(W&&t===void 0){let i=s!==void 0&&s.length===1;i&&(t=ut.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ut.set(s,t))}return t}toString(){return this.cssText}},y=e=>new M(typeof e=="string"?e:e+"",void 0,X),P=(e,...t)=>{let s=e.length===1?e[0]:t.reduce(((i,o,n)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[n+1]),e[0]);return new M(s,e,X)},pt=(e,t)=>{if(W)e.adoptedStyleSheets=t.map((s=>s instanceof CSSStyleSheet?s:s.styleSheet));else for(let s of t){let i=document.createElement("style"),o=q.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=s.cssText,e.appendChild(i)}},Y=W?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return y(s)})(e):e;var{is:Dt,defineProperty:Ht,getOwnPropertyDescriptor:Rt,getOwnPropertyNames:Tt,getOwnPropertySymbols:Nt,getPrototypeOf:zt}=Object,K=globalThis,ft=K.trustedTypes,jt=ft?ft.emptyScript:"",Ft=K.reactiveElementPolyfillSupport,O=(e,t)=>e,L={toAttribute(e,t){switch(t){case Boolean:e=e?jt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Z=(e,t)=>!Dt(e,t),gt={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),K.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=gt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){let i=Symbol(),o=this.getPropertyDescriptor(t,i,s);o!==void 0&&Ht(this.prototype,t,o)}}static getPropertyDescriptor(t,s,i){let{get:o,set:n}=Rt(this.prototype,t)??{get(){return this[s]},set(r){this[s]=r}};return{get:o,set(r){let h=o?.call(this);n?.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??gt}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;let t=zt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){let s=this.properties,i=[...Tt(s),...Nt(s)];for(let o of i)this.createProperty(o,s[o])}let t=this[Symbol.metadata];if(t!==null){let s=litPropertyMetadata.get(t);if(s!==void 0)for(let[i,o]of s)this.elementProperties.set(i,o)}this._$Eh=new Map;for(let[s,i]of this.elementProperties){let o=this._$Eu(s,i);o!==void 0&&this._$Eh.set(o,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let s=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let o of i)s.unshift(Y(o))}else t!==void 0&&s.push(Y(t));return s}static _$Eu(t,s){let i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,s=this.constructor.elementProperties;for(let i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){let i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(o!==void 0&&i.reflect===!0){let n=(i.converter?.toAttribute!==void 0?i.converter:L).toAttribute(s,i.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,s){let i=this.constructor,o=i._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=i.getPropertyOptions(o),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:L;this._$Em=o;let h=r.fromAttribute(s,n.type);this[o]=h??this._$Ej?.get(o)??h,this._$Em=null}}requestUpdate(t,s,i){if(t!==void 0){let o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??Z)(n,s)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:o,wrapped:n},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[o,n]of i){let{wrapped:r}=n,h=this[o];r!==!0||this._$AL.has(o)||h===void 0||this.C(o,void 0,n,h)}}let t=!1,s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(s)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((s=>s.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((s=>this._$ET(s,this[s]))),this._$EM()}updated(t){}firstUpdated(t){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[O("elementProperties")]=new Map,v[O("finalized")]=new Map,Ft?.({ReactiveElement:v}),(K.reactiveElementVersions??=[]).push("2.1.1");var rt=globalThis,J=rt.trustedTypes,vt=J?J.createPolicy("lit-html",{createHTML:e=>e}):void 0,At="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,xt="?"+$,Vt=`<${xt}>`,S=document,H=()=>S.createComment(""),R=e=>e===null||typeof e!="object"&&typeof e!="function",at=Array.isArray,qt=e=>at(e)||typeof e?.[Symbol.iterator]=="function",tt=`[
|
|
2
|
-
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,mt=/-->/g,$t=/>/g,A=RegExp(`>|${tt}(?:([^\\s"'>=/]+)(${tt}*=${tt}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),_t=/'/g,bt=/"/g,St=/^(?:script|style|textarea|title)$/i,ht=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),E=ht(1),pe=ht(2),fe=ht(3),w=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),yt=new WeakMap,x=S.createTreeWalker(S,129);function wt(e,t){if(!at(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return vt!==void 0?vt.createHTML(t):t}var Wt=(e,t)=>{let s=e.length-1,i=[],o,n=t===2?"<svg>":t===3?"<math>":"",r=D;for(let h=0;h<s;h++){let a=e[h],d,u,l=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===D?u[1]==="!--"?r=mt:u[1]!==void 0?r=$t:u[2]!==void 0?(St.test(u[2])&&(o=RegExp("</"+u[2],"g")),r=A):u[3]!==void 0&&(r=A):r===A?u[0]===">"?(r=o??D,l=-1):u[1]===void 0?l=-2:(l=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?A:u[3]==='"'?bt:_t):r===bt||r===_t?r=A:r===mt||r===$t?r=D:(r=A,o=void 0);let m=r===A&&e[h+1].startsWith("/>")?" ":"";n+=r===D?a+Vt:l>=0?(i.push(d),a.slice(0,l)+At+a.slice(l)+$+m):a+$+(l===-2?h:m)}return[wt(e,n+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},T=class e{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,u]=Wt(t,s);if(this.el=e.createElement(d,i),x.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(o=x.nextNode())!==null&&a.length<h;){if(o.nodeType===1){if(o.hasAttributes())for(let l of o.getAttributeNames())if(l.endsWith(At)){let g=u[r++],m=o.getAttribute(l).split($),V=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:V[2],strings:m,ctor:V[1]==="."?st:V[1]==="?"?it:V[1]==="@"?ot:U}),o.removeAttribute(l)}else l.startsWith($)&&(a.push({type:6,index:n}),o.removeAttribute(l));if(St.test(o.tagName)){let l=o.textContent.split($),g=l.length-1;if(g>0){o.textContent=J?J.emptyScript:"";for(let m=0;m<g;m++)o.append(l[m],H()),x.nextNode(),a.push({type:2,index:++n});o.append(l[g],H())}}}else if(o.nodeType===8)if(o.data===xt)a.push({type:2,index:n});else{let l=-1;for(;(l=o.data.indexOf($,l+1))!==-1;)a.push({type:7,index:n}),l+=$.length-1}n++}}static createElement(t,s){let i=S.createElement("template");return i.innerHTML=t,i}};function I(e,t,s=e,i){if(t===w)return t;let o=i!==void 0?s._$Co?.[i]:s._$Cl,n=R(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(e),o._$AT(e,s,i)),i!==void 0?(s._$Co??=[])[i]=o:s._$Cl=o),o!==void 0&&(t=I(e,o._$AS(e,t.values),o,i)),t}var et=class{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:s},parts:i}=this._$AD,o=(t?.creationScope??S).importNode(s,!0);x.currentNode=o;let n=x.nextNode(),r=0,h=0,a=i[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new N(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new nt(n,this,t)),this._$AV.push(d),a=i[++h]}r!==a?.index&&(n=x.nextNode(),r++)}return x.currentNode=S,o}p(t){let s=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}},N=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,o){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=I(this,t,s),R(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==c&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=T.createElement(wt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(s);else{let n=new et(o,this),r=n.u(this.options);n.p(s),this.T(r),this._$AH=n}}_$AC(t){let s=yt.get(t.strings);return s===void 0&&yt.set(t.strings,s=new T(t)),s}k(t){at(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,o=0;for(let n of t)o===s.length?s.push(i=new e(this.O(H()),this.O(H()),this,this.options)):i=s[o],i._$AI(n),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},U=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,o,n){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=c}_$AI(t,s=this,i,o){let n=this.strings,r=!1;if(n===void 0)t=I(this,t,s,0),r=!R(t)||t!==this._$AH&&t!==w,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a<n.length-1;a++)d=I(this,h[i+a],s,a),d===w&&(d=this._$AH[a]),r||=!R(d)||d!==this._$AH[a],d===c?t=c:t!==c&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}r&&!o&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},st=class extends U{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}},it=class extends U{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}},ot=class extends U{constructor(t,s,i,o,n){super(t,s,i,o,n),this.type=5}_$AI(t,s=this){if((t=I(this,t,s,0)??c)===w)return;let i=this._$AH,o=t===c&&i!==c||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==c&&(i===c||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},nt=class{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){I(this,t)}};var Kt=rt.litHtmlPolyfillSupport;Kt?.(T,N),(rt.litHtmlVersions??=[]).push("3.3.1");var Et=(e,t,s)=>{let i=s?.renderBefore??t,o=i._$litPart$;if(o===void 0){let n=s?.renderBefore??null;i._$litPart$=o=new N(t.insertBefore(H(),n),n,void 0,s??{})}return o._$AI(e),o};var lt=globalThis,f=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Et(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};f._$litElement$=!0,f.finalized=!0,lt.litElementHydrateSupport?.({LitElement:f});var Zt=lt.litElementPolyfillSupport;Zt?.({LitElement:f});(lt.litElementVersions??=[]).push("4.2.1");var Jt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Z},Gt=(e=Jt,t,s)=>{let{kind:i,metadata:o}=s,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),n.set(s.name,e),i==="accessor"){let{name:r}=s;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,e)},init(h){return h!==void 0&&this.C(r,void 0,e,h),h}}}if(i==="setter"){let{name:r}=s;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,e)}}throw Error("Unsupported decorator location: "+i)};function p(e){return(t,s)=>typeof s=="object"?Gt(e,t,s):((i,o,n)=>{let r=o.hasOwnProperty(n);return o.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(o,n):void 0})(e,t,s)}var Ct=e=>e??c;var Qt=':host{display:inline-block;font-size:var(--sd-field-validation-message-font-size, 13px);line-height:var(--sd-field-validation-message-line-height, 20px);font-family:var(--sd-field-validation-message-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);color:var(--sd-field-validation-message-color, #111);contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:var(--sd-field-validation-message-warn-color, #555555)}:host([level=suggest i]){color:var(--sd-field-validation-message-suggest-color, #bf8800)}:host([level=error i]){color:var(--sd-field-validation-message-error-color, #cc0017)}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}',Xt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",Yt="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",ee=Object.defineProperty,dt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&ee(t,s,o),o},B,z=(B=class extends f{static parseLevel(e){if(e){let t=Object.keys(j).find(s=>s.toLowerCase()===e.toLowerCase());return t&&j[t]}}static get styles(){return[P`
|
|
4
|
-
${y(Qt)}
|
|
5
|
-
`]}render(){return E`${this.iconToUse&&E`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(B.parseLevel(this.level)){case"warn":return te;case"suggest":return Yt;case"error":return Xt;default:return null}}},B.ID="sd-field-validation-message",B.levelConverter={fromAttribute(e){return B.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},B);dt([p({type:String,attribute:!0})],z.prototype,"message");dt([p({type:String,attribute:!0})],z.prototype,"icon");dt([p({converter:z.levelConverter,reflect:!0})],z.prototype,"level");var ct=z,j=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(j||{});customElements.get(ct.ID)||customElements.define(ct.ID,ct);var se=':host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding:var(--sd-radio-button-padding, 6px 0px)}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:var(--sd-radio-button-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}',ie=Object.defineProperty,G=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&ie(t,s,o),o},oe=0,_,F=(_=class extends f{constructor(){super(),this.checked=!1,this.value="",this.disabled=!1,this.label="",this.handleClick=e=>{e.preventDefault()},this.a11yID=_.ID+"_"+oe++}static get styles(){return[P`
|
|
6
|
-
${y(se)}
|
|
7
|
-
`]}render(){return E`
|
|
8
|
-
<div class="root">
|
|
9
|
-
<div class="radio-button-container">
|
|
10
|
-
<input
|
|
11
|
-
type="radio"
|
|
12
|
-
id="${this.a11yID}"
|
|
13
|
-
.checked="${this.checked}"
|
|
14
|
-
?disabled="${this.disabled}"
|
|
15
|
-
@click="${this.handleClick}"
|
|
16
|
-
class="radio-button"
|
|
17
|
-
/>
|
|
18
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-14 -14 28 28">
|
|
19
|
-
<circle
|
|
20
|
-
class="highlight"
|
|
21
|
-
style="display:none"
|
|
22
|
-
r="11px"
|
|
23
|
-
fill="transparent"
|
|
24
|
-
stroke-width="6px"
|
|
25
|
-
></circle>
|
|
26
|
-
<circle class="inner" r="6px" style="display:none" stroke="none"></circle>
|
|
27
|
-
<circle class="outer" r="9px" fill="transparent" stroke-width="2px"></circle>
|
|
28
|
-
</svg>
|
|
29
|
-
</div>
|
|
30
|
-
<label class="label" for="${this.a11yID}" @click="${this.handleClick}">${this.label}</label>
|
|
31
|
-
</div>
|
|
32
|
-
`}},_.ID="sd-radio-button",_.ensureDefined=()=>{customElements.get(_.ID)||customElements.define(_.ID,_)},_);G([p({type:Boolean,reflect:!0,attribute:!0})],F.prototype,"checked");G([p({type:String,reflect:!0,attribute:!0})],F.prototype,"value");G([p({type:Boolean,reflect:!0,attribute:!0})],F.prototype,"disabled");G([p({type:String,reflect:!0,attribute:!0})],F.prototype,"label");var kt=F,ne=":host(:focus){outline:none}.buttons-container{display:flex;gap:var(--sd-radio-button-group-gap, 0)}.buttons-container.vertical{flex-direction:column}.validation-message{margin-left:5px}",re=Object.defineProperty,k=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&re(t,s,o),o},C,b=(C=class extends f{constructor(){super(...arguments),this.layout="horizontal",this.value="",this.uncheckAllowed=!1,this.disabled=!1,this._focusIndex=-1,this._checkedButton=null,this.handleSlotChange=()=>{this._buttons=this.buttonsSlot.assignedElements(),this._buttons.forEach(e=>{!e.hasAttribute("disabled")&&this.disabled&&e.setAttribute("disabled",""),e.setAttribute("tabIndex","-1"),this.updateCheckedButton(e)})},this.handleFocusIn=e=>{let t=e.target,s=this._buttons.findIndex(i=>i==t);this.focusIndex=this.focusIndex>=0?this.focusIndex:this.getNextFocusIndex(s!==-1?s:0),this.updateFocused(null,this._buttons[this.focusIndex])},this.handleFocusOut=()=>{this.updateFocused(this._buttons[this.focusIndex])},this.handleButtonClick=e=>{this.focus();let t=this._buttons.find(i=>i.contains(e.target)),s=this._buttons.findIndex(i=>i==t);s>=0&&(this.focusIndex=s,this.updateChecked())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":case"Right":case"ArrowRight":{this.focusNext();break}case"Up":case"ArrowUp":case"Left":case"ArrowLeft":{this.focusPrevious();break}case"Enter":{this.updateChecked();break}default:t=!1}t&&(e.preventDefault(),e.stopPropagation())}}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.childElementCount){let t=this._focusIndex;if(this._focusIndex=e,t!==e){let s=this._buttons[t],i=this._buttons[this.focusIndex];this.updateFocused(s,i)}}}firstUpdated(e){super.firstUpdated(e),this.buttonsSlot.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("keydown",this.handleKeyDown)}updated(e){super.updated(e),e.has("disabled")&&(this.disabled?this.disableButtons():this.enableButtons())}static get styles(){return[P`
|
|
33
|
-
${y(ne)}
|
|
34
|
-
`]}render(){return E`
|
|
35
|
-
<div
|
|
36
|
-
class="buttons-container ${this.layout==="vertical"?"vertical":"horizontal"}"
|
|
37
|
-
@click="${Ct(this.disabled?void 0:this.handleButtonClick)}"
|
|
38
|
-
>
|
|
39
|
-
<slot></slot>
|
|
40
|
-
</div>
|
|
41
|
-
${this.validationMessage&&E`
|
|
42
|
-
<sd-field-validation-message
|
|
43
|
-
class="validation-message"
|
|
44
|
-
.message=${this.validationMessage}
|
|
45
|
-
.icon=${this.validationIconSrc}
|
|
46
|
-
.level=${this.validationLevel}
|
|
47
|
-
>
|
|
48
|
-
</sd-field-validation-message>
|
|
49
|
-
`}
|
|
50
|
-
`}updateCheckedButton(e){if(this._checkedButton&&this._checkedButton!==e)this.uncheckButton(e);else if(e.hasAttribute("checked")){this._checkedButton=e;let t=e.getAttribute("value");this.updateValue(t)}}disableButtons(){this._buttons?.forEach(e=>{e.setAttribute("disabled","")})}enableButtons(){this._buttons?.forEach(e=>{e.removeAttribute("disabled")})}fireValueChangeEvent(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.value,selectedIndex:this.selectedIndex}}))}focusNext(){let e=this.getNextFocusIndex(this.focusIndex+1);this.focusIndex=e!==-1?e:this.getNextFocusIndex(0),this.uncheckAllowed||this.updateChecked()}focusPrevious(){let e=this.getPreviousFocusIndex(this.focusIndex-1);this.focusIndex=e!==-1?e:this.getPreviousFocusIndex(this.childElementCount-1),this.uncheckAllowed||this.updateChecked()}getNextFocusIndex(e){for(let t=e;t<this.childElementCount;t++){let s=this._buttons[t];if(this.isFocusable(s))return t}return-1}getPreviousFocusIndex(e){for(let t=e;t>=0;t--){let s=this._buttons[t];if(this.isFocusable(s))return t}return-1}isFocusable(e){return!e.hasAttribute("disabled")}updateChecked(){let e=this._checkedButton,t=this._buttons[this.focusIndex];this._checkedButton=t,e&&e!==t&&this.uncheckButton(e),t&&this.toggleButton(t)}toggleButton(e){e.hasAttribute("checked")?this.uncheckAllowed&&(this.uncheckButton(e),this._checkedButton=null,this.updateValue("")):(this.checkButton(e),this.updateValue(e.getAttribute("value")))}updateValue(e){this.value=e,this.fireValueChangeEvent()}updateFocused(e,t){e?.removeAttribute?.("focused"),t?.setAttribute?.("focused","")}checkButton(e){e.setAttribute("checked","")}uncheckButton(e){e.removeAttribute("checked")}get buttonsSlot(){return this.shadowRoot&&!this._buttonsSlot&&(this._buttonsSlot=this.shadowRoot.querySelector("slot")),this._buttonsSlot}get selectedIndex(){return this._buttons.indexOf(this._checkedButton)}},C.ID="sd-radio-button-group",C.ensureDefined=()=>{kt.ensureDefined(),customElements.get(C.ID)||customElements.define(C.ID,C)},C);k([p({type:String,reflect:!0,attribute:!0})],b.prototype,"layout");k([p({type:String})],b.prototype,"value");k([p({type:Boolean,reflect:!0,attribute:"uncheck-allowed"})],b.prototype,"uncheckAllowed");k([p({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"disabled");k([p({type:String})],b.prototype,"validationMessage");k([p({type:String})],b.prototype,"validationIconSrc");k([p({type:{fromAttribute(e){return e&&j[e.toLowerCase()]},toAttribute(e){return e&&e.toLowerCase()}},reflect:!0})],b.prototype,"validationLevel");var Pt=b;Pt.ensureDefined();return Lt(ae);})();
|
|
51
|
-
/*! Bundled license information:
|
|
52
|
-
|
|
53
|
-
@lit/reactive-element/css-tag.js:
|
|
54
|
-
(**
|
|
55
|
-
* @license
|
|
56
|
-
* Copyright 2019 Google LLC
|
|
57
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*)
|
|
59
|
-
|
|
60
|
-
@lit/reactive-element/reactive-element.js:
|
|
61
|
-
lit-html/lit-html.js:
|
|
62
|
-
lit-element/lit-element.js:
|
|
63
|
-
@lit/reactive-element/decorators/property.js:
|
|
64
|
-
(**
|
|
65
|
-
* @license
|
|
66
|
-
* Copyright 2017 Google LLC
|
|
67
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
-
*)
|
|
69
|
-
|
|
70
|
-
lit-html/is-server.js:
|
|
71
|
-
(**
|
|
72
|
-
* @license
|
|
73
|
-
* Copyright 2022 Google LLC
|
|
74
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*)
|
|
76
|
-
|
|
77
|
-
lit-html/directives/if-defined.js:
|
|
78
|
-
(**
|
|
79
|
-
* @license
|
|
80
|
-
* Copyright 2018 Google LLC
|
|
81
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*)
|
|
83
|
-
*/
|
|
84
|
-
//# sourceMappingURL=radio-button-group-with-externals.js.map
|