diff --git a/uniquely/soffit-pwa/src/lottery-form.ts b/uniquely/soffit-pwa/src/lottery-form.ts index c5fd54b6b..5a56f01e1 100644 --- a/uniquely/soffit-pwa/src/lottery-form.ts +++ b/uniquely/soffit-pwa/src/lottery-form.ts @@ -7,7 +7,7 @@ import type {AlwatrTextField} from '@alwatr/ui-kit/text-field/text-field.js'; import '@alwatr/ui-kit/text-field/text-field.js'; import '@alwatr/ui-kit/button/button.js'; -import './radio-group.js'; +import './tech-dep/radio-group.js'; declare global { interface HTMLElementTagNameMap { diff --git a/uniquely/soffit-pwa/src/tech-dep/radio-group.ts b/uniquely/soffit-pwa/src/tech-dep/radio-group.ts index e497e800a..db1f81620 100644 --- a/uniquely/soffit-pwa/src/tech-dep/radio-group.ts +++ b/uniquely/soffit-pwa/src/tech-dep/radio-group.ts @@ -6,7 +6,32 @@ declare global { } } -const _activityType = ['پخش کننده تایل', 'نصاب تایل', 'فروشنده و مغازه‌دار', 'پیمانکار', 'سازنده', 'سایر']; +const _optionList = [ + { + label: 'پخش کننده تایل', + value: '', + }, + { + label: 'نصاب تایل', + value: '', + }, + { + label: 'فروشنده و مغازه‌دار', + value: '', + }, + { + label: 'پیمانکار', + value: '', + }, + { + label: 'سازنده', + value: '', + }, + { + label: 'سایر', + value: '', + }, +]; /** * Alwatr fieldset element @@ -59,6 +84,13 @@ export class AlwatrFieldSet extends AlwatrDummyElement { } `; + get value(): string { + for (const inputElement of this.renderRoot.querySelectorAll('input')) { + if (inputElement.checked) return inputElement.value; + } + return ''; + } + override render(): unknown { super.render(); return html` @@ -70,11 +102,11 @@ export class AlwatrFieldSet extends AlwatrDummyElement { } protected _inputTemplate(): unknown { - return map(_activityType, (activity, index) => { - const id: string = 'activityType' + index; + return map(_optionList, (item, index) => { + const id: string = 'radioInput' + index; return html`
- - + +
`; }); }