q2-tecton-elements 1.51.1 → 1.52.1
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/click-elsewhere_2.cjs.entry.js +16 -5
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-9aa4a776.js → index-07285783.js} +86 -2
- package/dist/cjs/index-07285783.js.map +1 -0
- package/dist/cjs/{index-14c3693c.js → index-e7e68b1e.js} +40 -5
- package/dist/cjs/index-e7e68b1e.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q2-action-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-action-sheet.cjs.entry.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge_7.cjs.entry.js +49 -44
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +17 -20
- package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +4 -2
- package/dist/cjs/q2-card.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +4 -4
- package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +16 -3
- package/dist/cjs/q2-chart-area.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-donut.cjs.entry.js +19 -3
- package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -5
- package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/q2-currency.cjs.entry.js +14 -2
- package/dist/cjs/q2-currency.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +3 -3
- package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +3 -3
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +12 -14
- package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +7 -5
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +3 -3
- package/dist/cjs/q2-example.cjs.entry.js +145 -0
- package/dist/cjs/q2-example.cjs.entry.js.map +1 -0
- package/dist/cjs/q2-formatted-text.cjs.entry.js +2 -2
- package/dist/cjs/q2-item.cjs.entry.js +3 -3
- package/dist/cjs/q2-legend.cjs.entry.js +2 -2
- package/dist/cjs/q2-link.cjs.entry.js +4 -4
- package/dist/cjs/q2-link.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-list.cjs.entry.js +6 -7
- package/dist/cjs/q2-list.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-loading-element.cjs.entry.js +2 -2
- package/dist/cjs/q2-loc.cjs.entry.js +52 -3
- package/dist/cjs/q2-loc.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +3 -3
- package/dist/cjs/q2-month-picker.cjs.entry.js +4 -4
- package/dist/cjs/q2-optgroup.cjs.entry.js +5 -4
- package/dist/cjs/q2-optgroup.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +50 -33
- package/dist/cjs/q2-option.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +11 -7
- package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +19 -18
- package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-radio-group.cjs.entry.js +5 -5
- package/dist/cjs/q2-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +3 -3
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-resize-observer.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +8 -6
- package/dist/cjs/q2-section.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +6 -5
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +5 -4
- package/dist/cjs/q2-stepper-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +16 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +6 -4
- package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +6 -4
- package/dist/cjs/q2-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +2 -2
- package/dist/cjs/q2-textarea.cjs.entry.js +3 -3
- package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{shapes-be198cc0.js → shapes-5d45fc11.js} +2 -2
- package/dist/cjs/{shapes-be198cc0.js.map → shapes-5d45fc11.js.map} +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-calendar.js +16 -18
- package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +27 -0
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-card/q2-card.js +2 -0
- package/dist/collection/components/q2-card/q2-card.js.map +1 -1
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +42 -1
- package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js +15 -0
- package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +41 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js +11 -0
- package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +30 -23
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +4 -3
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +37 -1
- package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
- package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js +34 -23
- package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js +6 -4
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.css +5 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +10 -4
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +59 -14
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.css +29 -11
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +9 -11
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js +108 -74
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
- package/dist/collection/components/q2-example/q2-example.css +66 -0
- package/dist/collection/components/q2-example/q2-example.js +312 -0
- package/dist/collection/components/q2-example/q2-example.js.map +1 -0
- package/dist/collection/components/q2-example/test/q2-example.e2e.js +27 -0
- package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -0
- package/dist/collection/components/q2-example/test/q2-example.spec.js +126 -0
- package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -0
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-input/formatting/alpha.spec.js +10 -0
- package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/currency.spec.js +20 -0
- package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/date.spec.js +17 -0
- package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/numeric.spec.js +32 -0
- package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/phone.spec.js +16 -0
- package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
- package/dist/collection/components/q2-input/formatting/postal.spec.js +28 -0
- package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/ssn.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -0
- package/dist/collection/components/q2-input/formatting/tin.spec.js +7 -0
- package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -0
- package/dist/collection/components/q2-input/q2-input.js +58 -44
- package/dist/collection/components/q2-input/q2-input.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.e2e.js +259 -2106
- package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js +4035 -0
- package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -0
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-link/q2-link.css +17 -20
- package/dist/collection/components/q2-link/q2-link.js +2 -2
- package/dist/collection/components/q2-link/q2-link.js.map +1 -1
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js +6 -6
- package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-list/q2-list.js +4 -5
- package/dist/collection/components/q2-list/q2-list.js.map +1 -1
- package/dist/collection/components/q2-loc/q2-loc.js +66 -4
- package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js +19 -30
- package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js +164 -0
- package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -0
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +3 -2
- package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
- package/dist/collection/components/q2-option/q2-option.css +1 -1
- package/dist/collection/components/q2-option/q2-option.js +57 -34
- package/dist/collection/components/q2-option/q2-option.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js +110 -106
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js +532 -0
- package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -0
- package/dist/collection/components/q2-pagination/q2-pagination.js +9 -5
- package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +18 -1
- package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-pill/q2-pill.js +18 -17
- package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +128 -57
- package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +17 -4
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +19 -9
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +2 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +6 -4
- package/dist/collection/components/q2-section/q2-section.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +5 -3
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +123 -62
- package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +4 -2
- package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +3 -2
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +46 -2
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
- package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js +26 -0
- package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +4 -3
- package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +5 -2
- package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +55 -4
- package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/collection/utils/helpers.js +63 -41
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/index.js +83 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +84 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/q2-action-group.js +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-calendar.js +16 -18
- package/dist/components/q2-calendar.js.map +1 -1
- package/dist/components/q2-card.js +2 -0
- package/dist/components/q2-card.js.map +1 -1
- package/dist/components/q2-carousel-pane.js +2 -2
- package/dist/components/q2-chart-area.js +16 -2
- package/dist/components/q2-chart-area.js.map +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +19 -2
- package/dist/components/q2-chart-donut.js.map +1 -1
- package/dist/components/q2-checkbox-group.js +5 -4
- package/dist/components/q2-checkbox-group.js.map +1 -1
- package/dist/components/q2-currency.js +15 -2
- package/dist/components/q2-currency.js.map +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-data-table.js.map +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown-item2.js +12 -26
- package/dist/components/q2-dropdown-item2.js.map +1 -1
- package/dist/components/q2-dropdown.js +6 -3
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-example.d.ts +11 -0
- package/dist/components/q2-example.js +170 -0
- package/dist/components/q2-example.js.map +1 -0
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-input2.js +41 -37
- package/dist/components/q2-input2.js.map +1 -1
- package/dist/components/q2-item.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-link.js +3 -3
- package/dist/components/q2-link.js.map +1 -1
- package/dist/components/q2-list.js +4 -5
- package/dist/components/q2-list.js.map +1 -1
- package/dist/components/q2-loc.js +55 -2
- package/dist/components/q2-loc.js.map +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-optgroup2.js +3 -2
- package/dist/components/q2-optgroup2.js.map +1 -1
- package/dist/components/q2-option-list2.js +1 -1
- package/dist/components/q2-option2.js +52 -33
- package/dist/components/q2-option2.js.map +1 -1
- package/dist/components/q2-pagination.js +9 -5
- package/dist/components/q2-pagination.js.map +1 -1
- package/dist/components/q2-pill.js +18 -17
- package/dist/components/q2-pill.js.map +1 -1
- package/dist/components/q2-popover2.js +16 -4
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-radio-group.js +3 -3
- package/dist/components/q2-radio-group.js.map +1 -1
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +6 -4
- package/dist/components/q2-section.js.map +1 -1
- package/dist/components/q2-select2.js +6 -4
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-stepper-pane.js +3 -2
- package/dist/components/q2-stepper-pane.js.map +1 -1
- package/dist/components/q2-stepper-vertical.js +16 -3
- package/dist/components/q2-stepper-vertical.js.map +1 -1
- package/dist/components/q2-stepper.js +4 -2
- package/dist/components/q2-stepper.js.map +1 -1
- package/dist/components/q2-tab-container.js +4 -3
- package/dist/components/q2-tab-container.js.map +1 -1
- package/dist/components/q2-tab-pane.js +1 -1
- package/dist/components/q2-tag.js +5 -2
- package/dist/components/q2-tag.js.map +1 -1
- package/dist/components/q2-textarea.js +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/click-elsewhere_2.entry.js +16 -5
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/{index-1e1ce94e.js → index-7a5365e2.js} +40 -5
- package/dist/esm/index-7a5365e2.js.map +1 -0
- package/dist/esm/{index-844fc010.js → index-d18e2a20.js} +86 -3
- package/dist/esm/index-d18e2a20.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q2-action-group.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +3 -3
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge_7.entry.js +49 -44
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-calendar.entry.js +17 -20
- package/dist/esm/q2-calendar.entry.js.map +1 -1
- package/dist/esm/q2-card.entry.js +4 -2
- package/dist/esm/q2-card.entry.js.map +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +4 -4
- package/dist/esm/q2-carousel.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +16 -3
- package/dist/esm/q2-chart-area.entry.js.map +1 -1
- package/dist/esm/q2-chart-bar.entry.js +3 -3
- package/dist/esm/q2-chart-donut.entry.js +19 -3
- package/dist/esm/q2-chart-donut.entry.js.map +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +6 -5
- package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
- package/dist/esm/q2-checkbox.entry.js +2 -2
- package/dist/esm/q2-currency.entry.js +14 -2
- package/dist/esm/q2-currency.entry.js.map +1 -1
- package/dist/esm/q2-data-table.entry.js +3 -3
- package/dist/esm/q2-data-table.entry.js.map +1 -1
- package/dist/esm/q2-detail.entry.js +3 -3
- package/dist/esm/q2-dropdown-item.entry.js +12 -14
- package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +7 -5
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +3 -3
- package/dist/esm/q2-example.entry.js +141 -0
- package/dist/esm/q2-example.entry.js.map +1 -0
- package/dist/esm/q2-formatted-text.entry.js +2 -2
- package/dist/esm/q2-item.entry.js +3 -3
- package/dist/esm/q2-legend.entry.js +2 -2
- package/dist/esm/q2-link.entry.js +4 -4
- package/dist/esm/q2-link.entry.js.map +1 -1
- package/dist/esm/q2-list.entry.js +6 -7
- package/dist/esm/q2-list.entry.js.map +1 -1
- package/dist/esm/q2-loading-element.entry.js +2 -2
- package/dist/esm/q2-loc.entry.js +52 -3
- package/dist/esm/q2-loc.entry.js.map +1 -1
- package/dist/esm/q2-message.entry.js +3 -3
- package/dist/esm/q2-month-picker.entry.js +4 -4
- package/dist/esm/q2-optgroup.entry.js +5 -4
- package/dist/esm/q2-optgroup.entry.js.map +1 -1
- package/dist/esm/q2-option-list.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +50 -33
- package/dist/esm/q2-option.entry.js.map +1 -1
- package/dist/esm/q2-pagination.entry.js +11 -7
- package/dist/esm/q2-pagination.entry.js.map +1 -1
- package/dist/esm/q2-pill.entry.js +19 -18
- package/dist/esm/q2-pill.entry.js.map +1 -1
- package/dist/esm/q2-radio-group.entry.js +5 -5
- package/dist/esm/q2-radio-group.entry.js.map +1 -1
- package/dist/esm/q2-radio.entry.js +3 -3
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-resize-observer.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +8 -6
- package/dist/esm/q2-section.entry.js.map +1 -1
- package/dist/esm/q2-select.entry.js +6 -5
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper-pane.entry.js +5 -4
- package/dist/esm/q2-stepper-pane.entry.js.map +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +16 -4
- package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
- package/dist/esm/q2-stepper.entry.js +6 -4
- package/dist/esm/q2-stepper.entry.js.map +1 -1
- package/dist/esm/q2-tag.entry.js +6 -4
- package/dist/esm/q2-tag.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +3 -3
- package/dist/esm/q2-tooltip.entry.js +2 -2
- package/dist/esm/{shapes-36183b2a.js → shapes-c7e1a3fa.js} +2 -2
- package/dist/esm/{shapes-36183b2a.js.map → shapes-c7e1a3fa.js.map} +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +3 -3
- package/dist/q2-tecton-elements/action-sheet-e64cb6f7.js +77 -0
- package/dist/q2-tecton-elements/{p-b7554a79.js.map → action-sheet-e64cb6f7.js.map} +1 -1
- package/dist/q2-tecton-elements/app-globals-0f993ce5.js +4 -0
- package/dist/q2-tecton-elements/{p-e1255160.js.map → app-globals-0f993ce5.js.map} +1 -1
- package/dist/q2-tecton-elements/charting-1abfb877.js +34872 -0
- package/dist/q2-tecton-elements/{p-2941aafa.js.map → charting-1abfb877.js.map} +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +410 -0
- package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -0
- package/dist/q2-tecton-elements/dataSample-7b62e101.js +2602 -0
- package/dist/q2-tecton-elements/{p-ad80aef0.js.map → dataSample-7b62e101.js.map} +1 -1
- package/dist/q2-tecton-elements/index-3184c760.js +18168 -0
- package/dist/q2-tecton-elements/{p-f1e887f5.js.map → index-3184c760.js.map} +1 -1
- package/dist/q2-tecton-elements/index-7a5365e2.js +1792 -0
- package/dist/q2-tecton-elements/index-7a5365e2.js.map +1 -0
- package/dist/q2-tecton-elements/index-d18e2a20.js +323 -0
- package/dist/q2-tecton-elements/index-d18e2a20.js.map +1 -0
- package/dist/q2-tecton-elements/q2-action-group.entry.js +56 -0
- package/dist/q2-tecton-elements/{p-5637c486.entry.js.map → q2-action-group.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1480 -0
- package/dist/q2-tecton-elements/{p-188eb162.entry.js.map → q2-action-sheet.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-avatar.entry.js +101 -0
- package/dist/q2-tecton-elements/{p-07d1c3ae.entry.js.map → q2-avatar.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +5449 -0
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-calendar.entry.js +1313 -0
- package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-card.entry.js +170 -0
- package/dist/q2-tecton-elements/q2-card.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +130 -0
- package/dist/q2-tecton-elements/{p-7aef0c08.entry.js.map → q2-carousel-pane.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +4613 -0
- package/dist/q2-tecton-elements/{p-e216ef3f.entry.js.map → q2-carousel.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +4330 -0
- package/dist/q2-tecton-elements/q2-chart-area.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +1479 -0
- package/dist/q2-tecton-elements/{p-7906f49e.entry.js.map → q2-chart-bar.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +4537 -0
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +166 -0
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-checkbox.entry.js +223 -0
- package/dist/q2-tecton-elements/{p-b7de110e.entry.js.map → q2-checkbox.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-currency.entry.js +153 -0
- package/dist/q2-tecton-elements/q2-currency.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-data-table.entry.js +622 -0
- package/dist/q2-tecton-elements/{p-7903cd15.entry.js.map → q2-data-table.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-detail.entry.js +128 -0
- package/dist/q2-tecton-elements/{p-f5f23659.entry.js.map → q2-detail.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +146 -0
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +430 -0
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +296 -0
- package/dist/q2-tecton-elements/{p-896c7008.entry.js.map → q2-editable-field.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-example.entry.js +152 -0
- package/dist/q2-tecton-elements/q2-example.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +73 -0
- package/dist/q2-tecton-elements/{p-7c9f8b62.entry.js.map → q2-formatted-text.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +158 -0
- package/dist/q2-tecton-elements/{p-7c9a0122.entry.js.map → q2-item.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-legend.entry.js +146 -0
- package/dist/q2-tecton-elements/{p-ff8f1a32.entry.js.map → q2-legend.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-link.entry.js +83 -0
- package/dist/q2-tecton-elements/q2-link.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-list.entry.js +100 -0
- package/dist/q2-tecton-elements/q2-list.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-loading-element.entry.js +36 -0
- package/dist/q2-tecton-elements/{p-a068c84c.entry.js.map → q2-loading-element.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +82 -0
- package/dist/q2-tecton-elements/q2-loc.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-message.entry.js +99 -0
- package/dist/q2-tecton-elements/{p-8d2b02e1.entry.js.map → q2-message.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +198 -0
- package/dist/q2-tecton-elements/{p-8d07cf91.entry.js.map → q2-month-picker.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +88 -0
- package/dist/q2-tecton-elements/q2-optgroup.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-option-list.entry.js +585 -0
- package/dist/q2-tecton-elements/{p-a5d0e252.entry.js.map → q2-option-list.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +110 -0
- package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-pagination.entry.js +377 -0
- package/dist/q2-tecton-elements/q2-pagination.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-pill.entry.js +434 -0
- package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +227 -0
- package/dist/q2-tecton-elements/q2-radio-group.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-radio.entry.js +144 -0
- package/dist/q2-tecton-elements/{p-c235ab3f.entry.js.map → q2-radio.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +162 -0
- package/dist/q2-tecton-elements/{p-95a7c042.entry.js.map → q2-relative-time.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +100 -0
- package/dist/q2-tecton-elements/{p-e2c800ef.entry.js.map → q2-resize-observer.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +256 -0
- package/dist/q2-tecton-elements/q2-section.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-select.entry.js +684 -0
- package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +124 -0
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +356 -0
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-stepper.entry.js +332 -0
- package/dist/q2-tecton-elements/q2-stepper.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tag.entry.js +213 -0
- package/dist/q2-tecton-elements/q2-tag.entry.js.map +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +21 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +364 -0
- package/dist/q2-tecton-elements/{p-f135b265.entry.js.map → q2-textarea.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +105 -0
- package/dist/q2-tecton-elements/{p-c5667d5d.entry.js.map → q2-tooltip.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/sectorHelper-183cedd0.js +949 -0
- package/dist/q2-tecton-elements/{p-eea5aa01.js.map → sectorHelper-183cedd0.js.map} +1 -1
- package/dist/q2-tecton-elements/shapes-c7e1a3fa.js +132 -0
- package/dist/q2-tecton-elements/{p-50b425de.js.map → shapes-c7e1a3fa.js.map} +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +134 -0
- package/dist/q2-tecton-elements/{p-96b1406c.entry.js.map → tecton-tab-pane.entry.js.map} +1 -1
- package/dist/types/components/q2-calendar/q2-calendar.d.ts +4 -5
- package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +6 -0
- package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +6 -0
- package/dist/types/components/q2-currency/q2-currency.d.ts +7 -0
- package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +1 -1
- package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +2 -2
- package/dist/types/components/q2-example/q2-example.d.ts +119 -0
- package/dist/types/components/q2-input/formatting/date.d.ts +22 -0
- package/dist/types/components/q2-input/formatting/postal.d.ts +197 -0
- package/dist/types/components/q2-input/q2-input.d.ts +15 -12
- package/dist/types/components/q2-loc/q2-loc.d.ts +15 -1
- package/dist/types/components/q2-option/q2-option.d.ts +11 -3
- package/dist/types/components/q2-pill/q2-pill.d.ts +3 -3
- package/dist/types/components/q2-popover/q2-popover.d.ts +1 -0
- package/dist/types/components/q2-select/q2-select.d.ts +1 -1
- package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +6 -0
- package/dist/types/components/q2-tag/q2-tag.d.ts +1 -1
- package/dist/types/components.d.ts +104 -14
- package/dist/types/utils/helpers.d.ts +13 -0
- package/dist/types/utils/index.d.ts +11 -0
- package/package.json +7 -7
- package/dist/cjs/index-14c3693c.js.map +0 -1
- package/dist/cjs/index-9aa4a776.js.map +0 -1
- package/dist/esm/index-1e1ce94e.js.map +0 -1
- package/dist/esm/index-844fc010.js.map +0 -1
- package/dist/q2-tecton-elements/p-06701928.entry.js +0 -2
- package/dist/q2-tecton-elements/p-06701928.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-07d1c3ae.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1305f7ca.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1305f7ca.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-15ac45d6.js +0 -2
- package/dist/q2-tecton-elements/p-15ac45d6.js.map +0 -1
- package/dist/q2-tecton-elements/p-16910682.entry.js +0 -2
- package/dist/q2-tecton-elements/p-16910682.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-188eb162.entry.js +0 -3
- package/dist/q2-tecton-elements/p-1c760a89.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1c760a89.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-1c88d057.entry.js +0 -2
- package/dist/q2-tecton-elements/p-1c88d057.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-20a3d6ed.entry.js +0 -2
- package/dist/q2-tecton-elements/p-20a3d6ed.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-2733583e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-2733583e.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-2941aafa.js +0 -39
- package/dist/q2-tecton-elements/p-3e428290.entry.js +0 -2
- package/dist/q2-tecton-elements/p-3e428290.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4774e5b3.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4774e5b3.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-490ef8e5.entry.js +0 -2
- package/dist/q2-tecton-elements/p-490ef8e5.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-4e10550d.entry.js +0 -2
- package/dist/q2-tecton-elements/p-4e10550d.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-50b425de.js +0 -2
- package/dist/q2-tecton-elements/p-50f7328f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-50f7328f.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5637c486.entry.js +0 -2
- package/dist/q2-tecton-elements/p-56df21b0.entry.js +0 -2
- package/dist/q2-tecton-elements/p-56df21b0.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5a834214.entry.js +0 -2
- package/dist/q2-tecton-elements/p-5a834214.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-5f99a4a8.entry.js +0 -2
- package/dist/q2-tecton-elements/p-5f99a4a8.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-72d948b4.entry.js +0 -2
- package/dist/q2-tecton-elements/p-72d948b4.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-7903cd15.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7906f49e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7aef0c08.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7c9a0122.entry.js +0 -2
- package/dist/q2-tecton-elements/p-7c9f8b62.entry.js +0 -2
- package/dist/q2-tecton-elements/p-81fbe718.entry.js +0 -2
- package/dist/q2-tecton-elements/p-81fbe718.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-896c7008.entry.js +0 -2
- package/dist/q2-tecton-elements/p-8d07cf91.entry.js +0 -2
- package/dist/q2-tecton-elements/p-8d2b02e1.entry.js +0 -2
- package/dist/q2-tecton-elements/p-95a7c042.entry.js +0 -2
- package/dist/q2-tecton-elements/p-96b1406c.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a068c84c.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a47597dd.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a47597dd.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-a5d0e252.entry.js +0 -2
- package/dist/q2-tecton-elements/p-a5f18e27.js +0 -3
- package/dist/q2-tecton-elements/p-a5f18e27.js.map +0 -1
- package/dist/q2-tecton-elements/p-ac6aa392.entry.js +0 -2
- package/dist/q2-tecton-elements/p-ac6aa392.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ad057d10.entry.js +0 -2
- package/dist/q2-tecton-elements/p-ad057d10.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ad80aef0.js +0 -2
- package/dist/q2-tecton-elements/p-b0e5e9dc.entry.js +0 -2
- package/dist/q2-tecton-elements/p-b0e5e9dc.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-b1784be3.entry.js +0 -2
- package/dist/q2-tecton-elements/p-b1784be3.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-b7554a79.js +0 -2
- package/dist/q2-tecton-elements/p-b7de110e.entry.js +0 -2
- package/dist/q2-tecton-elements/p-c235ab3f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-c5667d5d.entry.js +0 -2
- package/dist/q2-tecton-elements/p-e1255160.js +0 -2
- package/dist/q2-tecton-elements/p-e216ef3f.entry.js +0 -2
- package/dist/q2-tecton-elements/p-e2c800ef.entry.js +0 -2
- package/dist/q2-tecton-elements/p-eea5aa01.js +0 -2
- package/dist/q2-tecton-elements/p-f135b265.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f1e887f5.js +0 -2
- package/dist/q2-tecton-elements/p-f5f23659.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f7867f21.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f7867f21.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-ff8f1a32.entry.js +0 -2
- package/dist/q2-tecton-elements/p-fff01dc1.entry.js +0 -2
- package/dist/q2-tecton-elements/p-fff01dc1.entry.js.map +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { r as t, c as i, h as e, F as a, g as o } from "./index-7a5365e2.js";
|
|
2
|
+
|
|
3
|
+
import { c as r, o as n, i as s, f as d } from "./index-d18e2a20.js";
|
|
4
|
+
|
|
5
|
+
const l = '*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{margin-top:var(--tct-radio-group-margin-top, var(--app-scale-2x, 10px))}fieldset{padding:var(--tct-radio-group-fieldset-padding, 0);margin:0;border:0;position:relative}.label-row{display:grid;grid-template-columns:1fr 24px;grid-template-areas:"label icon";column-gap:var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px))}.label-row q2-icon{grid-area:icon;margin-top:-2px;margin-bottom:-2px}.group-legend{font-weight:600}legend.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}.optional-tag{margin-left:var(--tct-radio-group-label-optional-margin-left, var(--app-scale-1x, 5px));color:var(--tct-radio-group-label-optional-color, var(--t-radio-group-label-optional-color, var(--tct-a11y-color, var(--t-a11y-color, var(--tct-a11y-gray-color, var(--t-a11y-gray-color, var(--tct-gray-7, var(--t-gray-7, var(--tct-gray-d1, var(--t-gray-d1, var(--app-gray-d1, rgba(77, 77, 77, 0.77))))))))))));font-size:var(--tct-radio-group-label-optional-font-size, var(--t-radio-group-label-optional-font-size, 12px));font-weight:var(--tct-radio-group-label-optional-font-weight, var(--t-radio-group-label-optional-font-weight, 400))}.tile-container,.tile-container .options-container{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;flex-grow:1}.options-container{--comp-default-margin:var(--app-scale-1x, 5px) 0;--comp-options-margin:var(--tct-radio-group-options-margin, var(--t-radio-group-options-margin, var(--comp-default-margin, 5px 0)));margin:var(--comp-options-margin);padding:var(--tct-radio-group-options-padding, var(--t-radio-group-options-padding, var(--app-scale-1x, 5px)));border-width:1px;border-color:transparent;border-style:solid;border-radius:var(--tct-radio-group-border-radius, var(--app-border-radius-1, 4px))}:host([has-error]) .options-container{border-color:var(--tct-radio-group-error-border-color, var(--const-stoplight-alert, #d20a0a))}:host([has-error=false]) .options-container{border-color:transparent}.tile-container.left{justify-content:start}.tile-container.right{justify-content:end}.tile-container .options-container{gap:var(--tct-radio-group-tile-gap, var(--t-radio-group-tile-gap, var(--app-scale-2x, 10px)));justify-content:inherit}';
|
|
6
|
+
|
|
7
|
+
const p = l;
|
|
8
|
+
|
|
9
|
+
const c = class {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
t(this, e);
|
|
12
|
+
this.change = i(this, "change", 7);
|
|
13
|
+
// #region Own Properties
|
|
14
|
+
this._id = `radio-group-${r()}`;
|
|
15
|
+
this.checkedRadioExists = () => {
|
|
16
|
+
// Returns first checked individual q2-radio or undefined if none are set to checked={true}
|
|
17
|
+
const t = this.radioElements.find((t => t.checked === true)) || undefined;
|
|
18
|
+
// Changes radio-group["value"] if inital value is not set and if a any individual q2-radio is checked
|
|
19
|
+
if (!this.value && !!t) {
|
|
20
|
+
this.value = t.value;
|
|
21
|
+
} else if (!this.value && !t) {
|
|
22
|
+
// if no radios are meant to be checked, then assign first radio tabIndex of 0
|
|
23
|
+
if (this.radioElements.length) this.radioElements[0].tabIndex = 0;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.onInnerRadioChange = t => {
|
|
27
|
+
t.stopImmediatePropagation();
|
|
28
|
+
if (this.readonly) return;
|
|
29
|
+
this.change.emit({
|
|
30
|
+
value: t.detail.value
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
this.onMutationObserved = () => {
|
|
34
|
+
this.valueUpdated(this.value);
|
|
35
|
+
this.nameUpdated();
|
|
36
|
+
this.disabledUpdated();
|
|
37
|
+
this.readonlyUpdated();
|
|
38
|
+
this.tileLayoutUpdated(this.tileLayout);
|
|
39
|
+
};
|
|
40
|
+
this.disabled = false;
|
|
41
|
+
this.hasError = false;
|
|
42
|
+
this.hideLabel = undefined;
|
|
43
|
+
this.label = undefined;
|
|
44
|
+
this.name = undefined;
|
|
45
|
+
this.optional = undefined;
|
|
46
|
+
this.readonly = undefined;
|
|
47
|
+
this.tileAlignment = "center";
|
|
48
|
+
this.tilelayout = undefined;
|
|
49
|
+
this.tileLayout = undefined;
|
|
50
|
+
this.value = undefined;
|
|
51
|
+
}
|
|
52
|
+
// #endregion
|
|
53
|
+
// #region Component Lifecycle Events
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.checkedRadioExists();
|
|
56
|
+
this.onMutationObserved();
|
|
57
|
+
this.handleDeprecatedTilelayout(this.tilelayout);
|
|
58
|
+
}
|
|
59
|
+
componentDidLoad() {
|
|
60
|
+
const t = new MutationObserver(this.onMutationObserved);
|
|
61
|
+
t.observe(this.hostElement, {
|
|
62
|
+
childList: true
|
|
63
|
+
});
|
|
64
|
+
this.mutationObserver = t;
|
|
65
|
+
n(this.hostElement);
|
|
66
|
+
this.checkedRadioExists();
|
|
67
|
+
}
|
|
68
|
+
// #endregion
|
|
69
|
+
// #region Listeners
|
|
70
|
+
onHostElementChange(t) {
|
|
71
|
+
if (t.target === this.hostElement) {
|
|
72
|
+
if (!this.hostElement.onchange) {
|
|
73
|
+
this.value = t.detail.value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
delegateFocus(t) {
|
|
78
|
+
if (!s(t, this.hostElement)) return;
|
|
79
|
+
const i = this.hostElement.querySelector("q2-radio[checked]") || this.hostElement.querySelector("q2-radio");
|
|
80
|
+
i === null || i === void 0 ? void 0 : i.dispatchEvent(new FocusEvent("focus"));
|
|
81
|
+
}
|
|
82
|
+
keydownHandler(t) {
|
|
83
|
+
const i = t.target.getAttribute("value") || this.value;
|
|
84
|
+
let e = this.radioElements.findIndex((e => e === t.target || e.getAttribute("value") === i));
|
|
85
|
+
let a = 0;
|
|
86
|
+
switch (t.key) {
|
|
87
|
+
case "ArrowLeft":
|
|
88
|
+
case "ArrowUp":
|
|
89
|
+
a = -1;
|
|
90
|
+
break;
|
|
91
|
+
|
|
92
|
+
case "ArrowRight":
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
a = 1;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
if (e === -1 || a === 0) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
e += a;
|
|
101
|
+
e = a < 0 ? Math.max(0, e) : Math.min(this.radioElements.length - 1, e);
|
|
102
|
+
t.preventDefault();
|
|
103
|
+
if (!this.readonly) {
|
|
104
|
+
this.value = this.radioElements[e].value;
|
|
105
|
+
}
|
|
106
|
+
this.radioElements[e].dispatchEvent(new FocusEvent("focus"));
|
|
107
|
+
}
|
|
108
|
+
// #endregion
|
|
109
|
+
// #region Public Methods API
|
|
110
|
+
/**
|
|
111
|
+
* Emulates clicking the `<q2-radio>` option with the provided value.
|
|
112
|
+
*
|
|
113
|
+
* @testOnly
|
|
114
|
+
*/
|
|
115
|
+
setValue(t) {
|
|
116
|
+
this.radioElements.forEach((i => {
|
|
117
|
+
if (t !== i.value) return;
|
|
118
|
+
i.click();
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
// #endregion
|
|
122
|
+
// #region Watchers
|
|
123
|
+
disabledUpdated() {
|
|
124
|
+
this.radioElements.forEach((t => {
|
|
125
|
+
t.groupDisabled = this.disabled;
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
nameUpdated() {
|
|
129
|
+
this.radioElements.forEach((t => {
|
|
130
|
+
t.name = this.name || this._id;
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
readonlyUpdated() {
|
|
134
|
+
const t = this.readonly;
|
|
135
|
+
this.radioElements.forEach((i => i.groupReadonly = t));
|
|
136
|
+
}
|
|
137
|
+
handleDeprecatedTilelayout(t) {
|
|
138
|
+
if (typeof t !== "boolean") return;
|
|
139
|
+
this.tileLayout = t;
|
|
140
|
+
this.tilelayout = undefined;
|
|
141
|
+
}
|
|
142
|
+
tileLayoutUpdated(t) {
|
|
143
|
+
this.radioElements.forEach((i => {
|
|
144
|
+
i.groupTileLayout = t;
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
valueUpdated(t) {
|
|
148
|
+
this.radioElements.forEach((i => {
|
|
149
|
+
i.checked = t === i.value;
|
|
150
|
+
// Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad
|
|
151
|
+
if (!i.checked) {
|
|
152
|
+
i.removeAttribute("checked");
|
|
153
|
+
i.tabIndex = -1;
|
|
154
|
+
} else if (i.checked) {
|
|
155
|
+
i.tabIndex = 0;
|
|
156
|
+
}
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
// #endregion
|
|
160
|
+
// #region Local Methods
|
|
161
|
+
get inputId() {
|
|
162
|
+
return this._id;
|
|
163
|
+
}
|
|
164
|
+
get radioElements() {
|
|
165
|
+
return Array.from(this.hostElement.querySelectorAll("q2-radio"));
|
|
166
|
+
}
|
|
167
|
+
inputDom() {
|
|
168
|
+
if (this.tileLayout) {
|
|
169
|
+
const {tileAlignment: t} = this;
|
|
170
|
+
const i = [ "left", "center", "right" ].includes(t) ? t : "center";
|
|
171
|
+
return e("div", {
|
|
172
|
+
class: `tile-container ${i}`
|
|
173
|
+
}, e("div", {
|
|
174
|
+
class: "options-container"
|
|
175
|
+
}, e("slot", null)));
|
|
176
|
+
} else {
|
|
177
|
+
return e("div", {
|
|
178
|
+
class: "options-container"
|
|
179
|
+
}, e("slot", null));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// #endregion
|
|
183
|
+
// #region Render Methods
|
|
184
|
+
render() {
|
|
185
|
+
const t = this.label || this.optional || this.readonly;
|
|
186
|
+
const {hasError: i} = this;
|
|
187
|
+
const o = t && !this.hideLabel || i;
|
|
188
|
+
return e(a, {
|
|
189
|
+
key: "d1d5bc5ec6dd3fc33332fa49e64ccb1dac4b542e"
|
|
190
|
+
}, o && e("div", {
|
|
191
|
+
key: "f2de38984a59682953612d73981a2de1afa1bc58",
|
|
192
|
+
class: "label-row"
|
|
193
|
+
}, t && !this.hideLabel && e("div", {
|
|
194
|
+
key: "24d1a40c5ad7546e5901dd96e46a15e71d8ca4c3",
|
|
195
|
+
class: "group-legend"
|
|
196
|
+
}, d(this)), i && e("q2-icon", {
|
|
197
|
+
key: "24be48ddc9c8cc60fa356056da6c59224a358a59",
|
|
198
|
+
type: "error",
|
|
199
|
+
"test-id": "iconError"
|
|
200
|
+
})), e("fieldset", {
|
|
201
|
+
key: "48da393294f67ac8349606b563a122e0b6e70917",
|
|
202
|
+
onChange: this.onInnerRadioChange,
|
|
203
|
+
"aria-invalid": i ? `${i}` : undefined
|
|
204
|
+
}, t && e("legend", {
|
|
205
|
+
key: "544ba2b62bebcb501806527fec2354aaa70c3dd9",
|
|
206
|
+
class: "sr-only"
|
|
207
|
+
}, d(this)), this.inputDom()));
|
|
208
|
+
}
|
|
209
|
+
get hostElement() {
|
|
210
|
+
return o(this);
|
|
211
|
+
}
|
|
212
|
+
static get watchers() {
|
|
213
|
+
return {
|
|
214
|
+
disabled: [ "disabledUpdated" ],
|
|
215
|
+
name: [ "nameUpdated" ],
|
|
216
|
+
readonly: [ "readonlyUpdated" ],
|
|
217
|
+
tilelayout: [ "handleDeprecatedTilelayout" ],
|
|
218
|
+
tileLayout: [ "tileLayoutUpdated" ],
|
|
219
|
+
value: [ "valueUpdated" ]
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
c.style = p;
|
|
225
|
+
|
|
226
|
+
export { c as q2_radio_group };
|
|
227
|
+
//# sourceMappingURL=q2-radio-group.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["q2RadioGroupCss","Q2RadioGroupStyle0","Q2RadioGroup","this","_id","createGuid","checkedRadioExists","firstCheckedRadio","radioElements","find","radio","checked","undefined","value","length","tabIndex","onInnerRadioChange","event","stopImmediatePropagation","readonly","change","emit","detail","onMutationObserved","valueUpdated","nameUpdated","disabledUpdated","readonlyUpdated","tileLayoutUpdated","tileLayout","componentWillLoad","handleDeprecatedTilelayout","tilelayout","componentDidLoad","observer","MutationObserver","observe","hostElement","childList","mutationObserver","overrideFocus","onHostElementChange","target","onchange","delegateFocus","isEventFromElement","querySelector","dispatchEvent","FocusEvent","keydownHandler","currentValue","getAttribute","index","findIndex","el","sign","key","Math","max","min","preventDefault","setValue","forEach","click","groupDisabled","disabled","name","groupReadonly","groupTileLayout","newVal","removeAttribute","inputId","Array","from","querySelectorAll","inputDom","tileAlignment","alignment","includes","h","class","render","showLabel","label","optional","hasError","showLabelRow","hideLabel","Fragment","renderLabel","type","onChange"],"sources":["src/components/q2-radio-group/q2-radio-group.scss?tag=q2-radio-group&encapsulation=shadow","src/components/q2-radio-group/q2-radio-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n margin-top: var-list(--tct-radio-group-margin-top, --app-scale-2x, 10px);\n}\n\nfieldset {\n padding: var(--tct-radio-group-fieldset-padding, 0);\n margin: 0;\n border: 0;\n position: relative;\n}\n\n.label-row {\n display: grid;\n grid-template-columns: 1fr 24px;\n grid-template-areas: 'label icon';\n column-gap: var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));\n\n q2-icon {\n grid-area: icon;\n margin-top: -2px;\n margin-bottom: -2px;\n }\n}\n\n.group-legend {\n font-weight: 600;\n}\n\nlegend.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n border: 0;\n}\n\n.optional-tag {\n margin-left: var-list(--tct-radio-group-label-optional-margin-left, --app-scale-1x, 5px);\n color: var-list(\n var-prefixer(radio-group-label-optional-color),\n var-prefixer(a11y-color),\n var-prefixer(a11y-gray-color),\n var-prefixer(gray-7),\n var-prefixer(gray-d1),\n --app-gray-d1,\n rgba(77, 77, 77, 0.77)\n );\n font-size: var-list(var-prefixer(radio-group-label-optional-font-size), 12px);\n font-weight: var-list(var-prefixer(radio-group-label-optional-font-weight), 400);\n}\n\n.tile-container {\n &,\n .options-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n}\n\n.options-container {\n --comp-default-margin: #{var-list(--app-scale-1x, 5px)} 0;\n --comp-options-margin: #{var-list(var-prefixer(radio-group-options-margin), --comp-default-margin, unquote('5px 0'))};\n margin: var(--comp-options-margin);\n padding: var-list(var-prefixer(radio-group-options-padding), --app-scale-1x, 5px);\n border-width: 1px;\n border-color: transparent;\n border-style: solid;\n border-radius: var-list(--tct-radio-group-border-radius, --app-border-radius-1, 4px);\n\n :host([has-error]) & {\n border-color: var-list(--tct-radio-group-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n :host([has-error='false']) & {\n border-color: transparent;\n }\n}\n\n.tile-container {\n &.left {\n justify-content: start;\n }\n &.right {\n justify-content: end;\n }\n\n .options-container {\n gap: var-list(var-prefixer(radio-group-tile-gap), --app-scale-2x, 10px);\n justify-content: inherit;\n }\n}\n","import {\n Component,\n Prop,\n Element,\n h,\n Listen,\n EventEmitter,\n Event,\n ComponentInterface,\n Watch,\n Fragment,\n Method,\n} from '@stencil/core';\nimport { createGuid, isEventFromElement, overrideFocus, renderLabel } from 'src/utils';\n\n@Component({ tag: 'q2-radio-group', shadow: true, styleUrl: 'q2-radio-group.scss' })\nexport class Q2RadioGroup implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-group-${createGuid()}`;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determines if all radios in the group are put into a `disabled` state. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the group's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Text for the fieldset legend describing the radio group.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /** Identifier which ties all radios together for accessibility and DOM selection. */\n @Prop({ reflect: true })\n name: string;\n\n /** Appends \"(optional)\" to the group label, and sets `aria-required` on the nested input tag to `false`. */\n @Prop({ reflect: true })\n optional: boolean;\n\n /** Determines if all radios in the group can be focused, but not interacted with. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** Provides alignment direction for tile-style radio group. */\n @Prop({ reflect: true })\n tileAlignment: 'left' | 'center' | 'right' = 'center';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n tilelayout: boolean;\n\n /** Show the radio group as a horizontal set of tiles. */\n @Prop({ reflect: true, mutable: true })\n tileLayout: boolean;\n\n /** The `value` of the currently selected `q2-radio` within the `q2-radio-group`. */\n @Prop({ mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.checkedRadioExists();\n this.onMutationObserved();\n this.handleDeprecatedTilelayout(this.tilelayout);\n }\n\n componentDidLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true });\n this.mutationObserver = observer;\n overrideFocus(this.hostElement);\n this.checkedRadioExists();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (event.target === this.hostElement) {\n if (!this.hostElement.onchange) {\n this.value = event.detail.value;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');\n radio?.dispatchEvent(new FocusEvent('focus'));\n }\n\n @Listen('keydown')\n keydownHandler(event: KeyboardEvent) {\n const currentValue = (event.target as HTMLElement).getAttribute('value') || this.value;\n let index = this.radioElements.findIndex(\n el => el === event.target || (el as HTMLElement).getAttribute('value') === currentValue\n );\n let sign = 0;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n sign = -1;\n break;\n\n case 'ArrowRight':\n case 'ArrowDown':\n sign = 1;\n break;\n }\n\n if (index === -1 || sign === 0) {\n return;\n }\n index += sign;\n index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);\n event.preventDefault();\n if (!this.readonly) {\n this.value = this.radioElements[index].value;\n }\n this.radioElements[index].dispatchEvent(new FocusEvent('focus'));\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<q2-radio>` option with the provided value.\n *\n * @testOnly\n */\n @Method()\n setValue(value: string) {\n this.radioElements.forEach(radio => {\n if (value !== radio.value) return;\n radio.click();\n });\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('disabled')\n disabledUpdated() {\n this.radioElements.forEach(radio => {\n radio.groupDisabled = this.disabled;\n });\n }\n\n @Watch('name')\n nameUpdated() {\n this.radioElements.forEach(radio => {\n radio.name = this.name || this._id;\n });\n }\n\n @Watch('readonly')\n readonlyUpdated() {\n const readonly = this.readonly;\n this.radioElements.forEach(radio => (radio.groupReadonly = readonly));\n }\n\n @Watch('tilelayout')\n handleDeprecatedTilelayout(tilelayout: boolean) {\n if (typeof tilelayout !== 'boolean') return;\n this.tileLayout = tilelayout;\n this.tilelayout = undefined;\n }\n\n @Watch('tileLayout')\n tileLayoutUpdated(tileLayout: boolean) {\n this.radioElements.forEach(radio => {\n radio.groupTileLayout = tileLayout;\n });\n }\n\n @Watch('value')\n valueUpdated(newVal: string) {\n this.radioElements.forEach(radio => {\n radio.checked = newVal === radio.value;\n // Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad\n if (!radio.checked) {\n radio.removeAttribute('checked');\n radio.tabIndex = -1;\n } else if (radio.checked) {\n radio.tabIndex = 0;\n }\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get inputId() {\n return this._id;\n }\n\n get radioElements() {\n return Array.from(this.hostElement.querySelectorAll('q2-radio')) as HTMLQ2RadioElement[];\n }\n\n checkedRadioExists = () => {\n // Returns first checked individual q2-radio or undefined if none are set to checked={true}\n const firstCheckedRadio = this.radioElements.find(radio => radio.checked === true) || undefined;\n\n // Changes radio-group[\"value\"] if inital value is not set and if a any individual q2-radio is checked\n if (!this.value && !!firstCheckedRadio) {\n this.value = firstCheckedRadio.value;\n } else if (!this.value && !firstCheckedRadio) {\n // if no radios are meant to be checked, then assign first radio tabIndex of 0\n if (this.radioElements.length) this.radioElements[0].tabIndex = 0;\n }\n };\n\n inputDom() {\n if (this.tileLayout) {\n const { tileAlignment } = this;\n const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';\n return (\n <div class={`tile-container ${alignment}`}>\n <div class=\"options-container\">\n <slot />\n </div>\n </div>\n );\n } else {\n return (\n <div class=\"options-container\">\n <slot />\n </div>\n );\n }\n }\n\n onInnerRadioChange = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n if (this.readonly) return;\n\n this.change.emit({ value: event.detail.value });\n };\n\n onMutationObserved = () => {\n this.valueUpdated(this.value);\n this.nameUpdated();\n this.disabledUpdated();\n this.readonlyUpdated();\n this.tileLayoutUpdated(this.tileLayout);\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const showLabel = this.label || this.optional || this.readonly;\n const { hasError } = this;\n const showLabelRow = (showLabel && !this.hideLabel) || hasError;\n return (\n <Fragment>\n {showLabelRow && (\n <div class=\"label-row\">\n {showLabel && !this.hideLabel && <div class=\"group-legend\">{renderLabel(this)}</div>}\n {hasError && (\n <q2-icon\n type=\"error\"\n test-id=\"iconError\"\n ></q2-icon>\n )}\n </div>\n )}\n <fieldset\n onChange={this.onInnerRadioChange}\n aria-invalid={hasError ? `${hasError}` : undefined}\n >\n {showLabel && <legend class=\"sr-only\">{renderLabel(this)}</legend>}\n {this.inputDom()}\n </fieldset>\n </Fragment>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAkB;;AACxB,MAAAC,IAAeD;;MCeFE,IAAY;;;;;QAGrBC,KAAAC,MAAc,eAAeC;IA0N7BF,KAAAG,qBAAqB;;MAEjB,MAAMC,IAAoBJ,KAAKK,cAAcC,MAAKC,KAASA,EAAMC,YAAY,UAASC;;YAGtF,KAAKT,KAAKU,WAAWN,GAAmB;QACpCJ,KAAKU,QAAQN,EAAkBM;aAC5B,KAAKV,KAAKU,UAAUN,GAAmB;;QAE1C,IAAIJ,KAAKK,cAAcM,QAAQX,KAAKK,cAAc,GAAGO,WAAW;;;IAwBxEZ,KAAAa,qBAAsBC;MAClBA,EAAMC;MACN,IAAIf,KAAKgB,UAAU;MAEnBhB,KAAKiB,OAAOC,KAAK;QAAER,OAAOI,EAAMK,OAAOT;;AAAQ;IAGnDV,KAAAoB,qBAAqB;MACjBpB,KAAKqB,aAAarB,KAAKU;MACvBV,KAAKsB;MACLtB,KAAKuB;MACLvB,KAAKwB;MACLxB,KAAKyB,kBAAkBzB,KAAK0B;AAAW;oBAzPvB;oBAIA;;;;;;yBA+ByB;;;;;;;EA2B7C,iBAAAC;IACI3B,KAAKG;IACLH,KAAKoB;IACLpB,KAAK4B,2BAA2B5B,KAAK6B;;EAGzC,gBAAAC;IACI,MAAMC,IAAW,IAAIC,iBAAiBhC,KAAKoB;IAC3CW,EAASE,QAAQjC,KAAKkC,aAAa;MAAEC,WAAW;;IAChDnC,KAAKoC,mBAAmBL;IACxBM,EAAcrC,KAAKkC;IACnBlC,KAAKG;;;;EAOT,mBAAAmC,CAAoBxB;IAChB,IAAIA,EAAMyB,WAAWvC,KAAKkC,aAAa;MACnC,KAAKlC,KAAKkC,YAAYM,UAAU;QAC5BxC,KAAKU,QAAQI,EAAMK,OAAOT;;;;EAMtC,aAAA+B,CAAc3B;IACV,KAAK4B,EAAmB5B,GAAOd,KAAKkC,cAAc;IAClD,MAAM3B,IAAQP,KAAKkC,YAAYS,cAAc,wBAAwB3C,KAAKkC,YAAYS,cAAc;IACpGpC,MAAK,QAALA,WAAK,aAALA,EAAOqC,cAAc,IAAIC,WAAW;;EAIxC,cAAAC,CAAehC;IACX,MAAMiC,IAAgBjC,EAAMyB,OAAuBS,aAAa,YAAYhD,KAAKU;IACjF,IAAIuC,IAAQjD,KAAKK,cAAc6C,WAC3BC,KAAMA,MAAOrC,EAAMyB,UAAWY,EAAmBH,aAAa,aAAaD;IAE/E,IAAIK,IAAO;IACX,QAAQtC,EAAMuC;KACV,KAAK;KACL,KAAK;MACDD,KAAQ;MACR;;KAEJ,KAAK;KACL,KAAK;MACDA,IAAO;MACP;;IAGR,IAAIH,OAAW,KAAKG,MAAS,GAAG;MAC5B;;IAEJH,KAASG;IACTH,IAAQG,IAAO,IAAIE,KAAKC,IAAI,GAAGN,KAASK,KAAKE,IAAIxD,KAAKK,cAAcM,SAAS,GAAGsC;IAChFnC,EAAM2C;IACN,KAAKzD,KAAKgB,UAAU;MAChBhB,KAAKU,QAAQV,KAAKK,cAAc4C,GAAOvC;;IAE3CV,KAAKK,cAAc4C,GAAOL,cAAc,IAAIC,WAAW;;;;;;;;;EAY3D,QAAAa,CAAShD;IACLV,KAAKK,cAAcsD,SAAQpD;MACvB,IAAIG,MAAUH,EAAMG,OAAO;MAC3BH,EAAMqD;AAAO;;;;EAQrB,eAAArC;IACIvB,KAAKK,cAAcsD,SAAQpD;MACvBA,EAAMsD,gBAAgB7D,KAAK8D;AAAQ;;EAK3C,WAAAxC;IACItB,KAAKK,cAAcsD,SAAQpD;MACvBA,EAAMwD,OAAO/D,KAAK+D,QAAQ/D,KAAKC;AAAG;;EAK1C,eAAAuB;IACI,MAAMR,IAAWhB,KAAKgB;IACtBhB,KAAKK,cAAcsD,SAAQpD,KAAUA,EAAMyD,gBAAgBhD;;EAI/D,0BAAAY,CAA2BC;IACvB,WAAWA,MAAe,WAAW;IACrC7B,KAAK0B,aAAaG;IAClB7B,KAAK6B,aAAapB;;EAItB,iBAAAgB,CAAkBC;IACd1B,KAAKK,cAAcsD,SAAQpD;MACvBA,EAAM0D,kBAAkBvC;AAAU;;EAK1C,YAAAL,CAAa6C;IACTlE,KAAKK,cAAcsD,SAAQpD;MACvBA,EAAMC,UAAU0D,MAAW3D,EAAMG;;YAEjC,KAAKH,EAAMC,SAAS;QAChBD,EAAM4D,gBAAgB;QACtB5D,EAAMK,YAAY;aACf,IAAIL,EAAMC,SAAS;QACtBD,EAAMK,WAAW;;;;;;EAQ7B,WAAIwD;IACA,OAAOpE,KAAKC;;EAGhB,iBAAII;IACA,OAAOgE,MAAMC,KAAKtE,KAAKkC,YAAYqC,iBAAiB;;EAgBxD,QAAAC;IACI,IAAIxE,KAAK0B,YAAY;MACjB,OAAM+C,eAAEA,KAAkBzE;MAC1B,MAAM0E,IAAY,EAAC,QAAQ,UAAU,UAASC,SAASF,KAAiBA,IAAgB;MACxF,OACIG,EAAA;QAAKC,OAAO,kBAAkBH;SAC1BE,EAAA;QAAKC,OAAM;SACPD,EAAA;WAIT;MACH,OACIA,EAAA;QAAKC,OAAM;SACPD,EAAA;;;;;EAwBhB,MAAAE;IACI,MAAMC,IAAY/E,KAAKgF,SAAShF,KAAKiF,YAAYjF,KAAKgB;IACtD,OAAMkE,UAAEA,KAAalF;IACrB,MAAMmF,IAAgBJ,MAAc/E,KAAKoF,aAAcF;IACvD,OACIN,EAACS,GAAQ;MAAAhC,KAAA;OACJ8B,KACGP,EAAA;MAAAvB,KAAA;MAAKwB,OAAM;OACNE,MAAc/E,KAAKoF,aAAaR,EAAA;MAAAvB,KAAA;MAAKwB,OAAM;OAAgBS,EAAYtF,QACvEkF,KACGN,EAAA;MAAAvB,KAAA;MACIkC,MAAK;MAAO,WACJ;SAKxBX,EAAA;MAAAvB,KAAA;MACImC,UAAUxF,KAAKa;MAAkB,gBACnBqE,IAAW,GAAGA,MAAazE;OAExCsE,KAAaH,EAAA;MAAAvB,KAAA;MAAQwB,OAAM;OAAWS,EAAYtF,QAClDA,KAAKwE"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { r as e, c as t, h as r, g as o } from "./index-7a5365e2.js";
|
|
2
|
+
|
|
3
|
+
import { c as a, a as i, o as c, l } from "./index-d18e2a20.js";
|
|
4
|
+
|
|
5
|
+
const n = '*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.radio-container{--comp-radio-margin:var(--tct-radio-margin, var(--tct-radio-margin-vertical, var(--tct-scale-2, 10px)) var(--tct-radio-margin-horizontal, var(--tct-scale-3, 15px)));margin:var(--comp-radio-margin)}.radio-container label[for]{color:var(--tct-radio-label-color, inherit);font-weight:var(--tct-radio-font-weight, var(--tct-checkbox-font-weight, 400));align-items:center;cursor:pointer;margin-right:var(--tct-radio-label-margin-right, 1rem);display:grid;grid-template-columns:18px 1fr;gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}.radio-container label[for].label-hidden{grid-template-columns:var(--tct-radio-label-hidden-columns, 18px 1fr)}.radio-container svg{border-radius:50%;transition:box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));outline:0;width:100%}.radio-container circle:nth-child(1){stroke-width:2;stroke:var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494));fill:var(--tct-radio-background-fill, transparent)}.radio-container input:checked+label circle:nth-child(1){fill:var(--tct-radio-checked-background-fill, var(--tct-radio-checked-bg, transparent));stroke:var(--tct-radio-checked-stroke-color, var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494)))}.radio-container input:checked+label .label-content{font-weight:var(--tct-radio-checked-label-font-weight, var(--tct-checkbox-selected-font-weight, 600));letter-spacing:var(--tct-radio-checked-label-letter-spacing, var(--tct-checkbox-selected-letter-spacing, 0.25));color:var(--tct-radio-checked-label-font-color, var(--tct-radio-checked-label-color, inherit))}.radio-container input:checked+label circle:nth-child(2){fill:var(--tct-radio-checked-fill, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)))}.radio-container input:hover+label circle:nth-child(1){fill:var(--tct-radio-hover-background-fill, transparent);stroke:var(--tct-radio-hover-stroke-color, var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494)))}.radio-container input:hover+label .label-content{color:var(--tct-radio-hover-label-color, inherit)}.radio-container input:focus+label svg{box-shadow:var(--const-double-focus-ring)}.radio-container input:focus+label circle:nth-child(1){fill:var(--tct-radio-focus-background-fill, transparent);stroke:var(--tct-radio-focus-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e)))}.radio-container input:focus+label .label-content{color:var(--tct-radio-focus-label-color, var(--tct-radio-checked-label-color, inherit))}.radio-tile{flex-basis:100px;flex-grow:0;flex-wrap:wrap}.radio-tile label[for]{color:var(--tct-radio-label-font-color, var(--tct-radio-label-color, inherit));align-items:center;border-radius:3px;border:2px solid var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494));background:var(--tct-radio-background-fill, transparent);cursor:pointer;display:block;padding:10px;position:relative;text-align:center;transition:border-color var(--tct-tween-1, var(--app-tween-1, 0.2s ease));white-space:nowrap}.radio-tile input:checked+label{border-color:var(--tct-radio-checked-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e))));box-shadow:inset 0 0 0 2px #ffffff;background:var(--tct-radio-checked-background-fill, transparent);color:var(--tct-radio-checked-label-color, inherit)}.radio-tile input:checked+label:after{border-bottom-width:3px;border-bottom:5px solid var(--tct-radio-checked-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e))));border-left-width:5px;border-left:8px solid transparent;border-right-width:5px;border-right:8px solid transparent;bottom:0;content:"";height:0;left:50%;margin-left:-5px;position:absolute;width:0}.radio-tile input:hover+label{border-color:var(--tct-radio-hover-stroke-color, var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494)));background:var(--tct-radio-hover-background-fill, transparent);color:var(--tct-radio-hover-label-color, var(--tct-radio-label-color, inherit))}.radio-tile input:focus+label,.radio-tile input:focus:checked+label{border-color:var(--tct-radio-focus-stroke-color, var(--tct-checkbox-check-stroke-color, var(--t-checkbox-check-stroke-color, var(--t-checkbox-fill, #2e2e2e))));background:var(--tct-radio-focus-background-fill, transparent);box-shadow:var(--const-double-focus-ring), var(--tct-global-focus, 0 0 0 2px #33b4ff);color:var(--tct-radio-focus-label-color, var(--tct-radio-checked-label-color, inherit))}input:disabled+label[for]{cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))}';
|
|
6
|
+
|
|
7
|
+
const d = n;
|
|
8
|
+
|
|
9
|
+
const s = class {
|
|
10
|
+
constructor(r) {
|
|
11
|
+
e(this, r);
|
|
12
|
+
this.change = t(this, "change", 7);
|
|
13
|
+
// #region Own Properties
|
|
14
|
+
this._id = `radio-${a()}`;
|
|
15
|
+
this.isLoaded = false;
|
|
16
|
+
// #endregion
|
|
17
|
+
// #region Local Methods
|
|
18
|
+
this.inputChange = e => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
if (this.disabled || this.readonly || this.groupReadonly || this.groupDisabled) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (e.target instanceof HTMLInputElement) {
|
|
25
|
+
this.checked = e.target.checked;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.ariaLabel = undefined;
|
|
29
|
+
this.checked = false;
|
|
30
|
+
this.disabled = false;
|
|
31
|
+
this.groupDisabled = false;
|
|
32
|
+
this.groupReadonly = false;
|
|
33
|
+
this.groupTileLayout = false;
|
|
34
|
+
this.hideLabel = undefined;
|
|
35
|
+
this.label = undefined;
|
|
36
|
+
this.name = undefined;
|
|
37
|
+
this.readonly = undefined;
|
|
38
|
+
this.tabIndex = 0;
|
|
39
|
+
this.value = undefined;
|
|
40
|
+
}
|
|
41
|
+
// #endregion
|
|
42
|
+
// #region Component Lifecycle Events
|
|
43
|
+
componentWillLoad() {
|
|
44
|
+
i(this);
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.isLoaded = true;
|
|
48
|
+
c(this.hostElement);
|
|
49
|
+
this.hostElement.click = () => {
|
|
50
|
+
this.inputField.focus();
|
|
51
|
+
this.inputField.click();
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// #endregion
|
|
55
|
+
// #region Listeners
|
|
56
|
+
onHostClick(e) {
|
|
57
|
+
if (this.disabled) {
|
|
58
|
+
e.stopImmediatePropagation();
|
|
59
|
+
} else if (this.groupReadonly) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopImmediatePropagation();
|
|
62
|
+
this.inputField.focus();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
delegateFocus(e) {
|
|
66
|
+
if (e.target === this.hostElement) {
|
|
67
|
+
this.inputField.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// #endregion
|
|
71
|
+
// #region Watchers
|
|
72
|
+
ariaLabelObserver() {
|
|
73
|
+
i(this);
|
|
74
|
+
}
|
|
75
|
+
checkedObserver() {
|
|
76
|
+
if (!this.isLoaded) return;
|
|
77
|
+
if (!this.checked) return;
|
|
78
|
+
this.change.emit({
|
|
79
|
+
value: this.value
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// #endregion
|
|
83
|
+
// #region Render Methods
|
|
84
|
+
render() {
|
|
85
|
+
return r("div", {
|
|
86
|
+
key: "ed4340f095788108ea8112d28a3c45dbc1f2e4c4",
|
|
87
|
+
class: this.groupTileLayout ? "radio-tile" : "radio-container"
|
|
88
|
+
}, r("input", {
|
|
89
|
+
key: "30011c8b29f8bdf48e978904052e02b920e602b9",
|
|
90
|
+
ref: e => this.inputField = e,
|
|
91
|
+
class: "sr",
|
|
92
|
+
id: this._id,
|
|
93
|
+
type: "radio",
|
|
94
|
+
name: this.name,
|
|
95
|
+
value: this.value,
|
|
96
|
+
disabled: this.disabled || this.groupDisabled,
|
|
97
|
+
checked: this.checked,
|
|
98
|
+
"aria-label": this.label && this.hideLabel ? l(this.label) : undefined,
|
|
99
|
+
onChange: this.inputChange,
|
|
100
|
+
"test-id": "q2RadioInnerRadioBox"
|
|
101
|
+
}), r("label", {
|
|
102
|
+
key: "657078aca6278f6bbd8997a1992109aecd2ad8a6",
|
|
103
|
+
htmlFor: this._id,
|
|
104
|
+
class: this.hideLabel ? "label-hidden" : undefined,
|
|
105
|
+
"test-id": "radioButton"
|
|
106
|
+
}, !this.groupTileLayout && r("svg", {
|
|
107
|
+
key: "9b4cf7c9e1968f862509c760a0dfee5cb90c3ce1",
|
|
108
|
+
viewBox: "0 0 18 18"
|
|
109
|
+
}, r("circle", {
|
|
110
|
+
key: "269619ffb0671e2f67dfa3da58b5da8264508586",
|
|
111
|
+
stroke: "none",
|
|
112
|
+
fill: "none",
|
|
113
|
+
cx: "9",
|
|
114
|
+
cy: "9",
|
|
115
|
+
r: "8"
|
|
116
|
+
}), r("circle", {
|
|
117
|
+
key: "9325caea79a38fe661db33ca62da9f075a06597f",
|
|
118
|
+
stroke: "none",
|
|
119
|
+
fill: "none",
|
|
120
|
+
cx: "9",
|
|
121
|
+
cy: "9",
|
|
122
|
+
r: "4"
|
|
123
|
+
})), !this.hideLabel && r("div", {
|
|
124
|
+
key: "fb674a98b4d028e35397da9ead2ab5083e8617fd",
|
|
125
|
+
class: "label-content"
|
|
126
|
+
}, this.label && l(this.label) || "", r("slot", {
|
|
127
|
+
key: "39a40ee6024f16b059ebad2675ee922a5c95324d"
|
|
128
|
+
}))));
|
|
129
|
+
}
|
|
130
|
+
get hostElement() {
|
|
131
|
+
return o(this);
|
|
132
|
+
}
|
|
133
|
+
static get watchers() {
|
|
134
|
+
return {
|
|
135
|
+
ariaLabel: [ "ariaLabelObserver" ],
|
|
136
|
+
checked: [ "checkedObserver" ]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
s.style = d;
|
|
142
|
+
|
|
143
|
+
export { s as q2_radio };
|
|
144
|
+
//# sourceMappingURL=q2-radio.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["q2RadioCss","Q2RadioStyle0","Q2Radio","this","_id","createGuid","isLoaded","inputChange","event","stopPropagation","disabled","readonly","groupReadonly","groupDisabled","preventDefault","target","HTMLInputElement","checked","componentWillLoad","handleAriaLabel","componentDidLoad","overrideFocus","hostElement","click","inputField","focus","onHostClick","stopImmediatePropagation","delegateFocus","ariaLabelObserver","checkedObserver","change","emit","value","render","h","key","class","groupTileLayout","ref","el","id","type","name","label","hideLabel","loc","undefined","onChange","htmlFor","viewBox","stroke","fill","cx","cy","r"],"sources":["src/components/q2-radio/q2-radio.scss?tag=q2-radio&encapsulation=shadow","src/components/q2-radio/q2-radio.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: block;\n}\n\n.radio-container {\n --comp-radio-margin: #{var-list(\n --tct-radio-margin,\n unquote(\n '#{var-list(--tct-radio-margin-vertical, --tct-scale-2, 10px)} #{var-list(--tct-radio-margin-horizontal, --tct-scale-3, 15px)}'\n )\n )};\n margin: var(--comp-radio-margin);\n\n label[for] {\n color: var-list(--tct-radio-label-color, inherit);\n font-weight: var-list(--tct-radio-font-weight, --tct-checkbox-font-weight, 400);\n align-items: center;\n cursor: pointer;\n margin-right: var-list(--tct-radio-label-margin-right, 1rem);\n display: grid;\n grid-template-columns: 18px 1fr;\n gap: var-list(--tct-scale-1, --app-scale-1x, 5px);\n\n &.label-hidden {\n grid-template-columns: var(--tct-radio-label-hidden-columns, 18px 1fr);\n }\n }\n\n svg {\n border-radius: 50%;\n transition: box-shadow var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'));\n outline: 0;\n width: 100%;\n }\n\n circle:nth-child(1) {\n stroke-width: 2;\n stroke: var-list(--tct-radio-stroke-color, --t-a11y-gray-color-AA, #949494);\n fill: var-list(--tct-radio-background-fill, transparent);\n }\n\n input {\n &:checked {\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-checked-background-fill, --tct-radio-checked-bg, transparent);\n stroke: var-list(\n --tct-radio-checked-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n }\n & + label .label-content {\n font-weight: var-list(--tct-radio-checked-label-font-weight, --tct-checkbox-selected-font-weight, 600);\n letter-spacing: var-list(\n --tct-radio-checked-label-letter-spacing,\n --tct-checkbox-selected-letter-spacing,\n 0.25\n );\n color: var-list(--tct-radio-checked-label-font-color, --tct-radio-checked-label-color, inherit);\n }\n & + label circle:nth-child(2) {\n fill: var-list(--tct-radio-checked-fill, --tct-checkbox-check-stroke-color, --t-checkbox-fill, #2e2e2e);\n }\n }\n\n &:hover {\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-hover-background-fill, transparent);\n stroke: var-list(\n --tct-radio-hover-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n }\n & + label .label-content {\n color: var-list(--tct-radio-hover-label-color, inherit);\n }\n }\n\n &:focus {\n & + label svg {\n box-shadow: var(--const-double-focus-ring);\n }\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-focus-background-fill, transparent);\n stroke: var-list(\n --tct-radio-focus-stroke-color,\n --tct-checkbox-check-stroke-color,\n --t-checkbox-fill,\n #2e2e2e\n );\n }\n & + label .label-content {\n color: var-list(--tct-radio-focus-label-color, --tct-radio-checked-label-color, inherit);\n }\n }\n }\n}\n\n.radio-tile {\n flex-basis: 100px;\n flex-grow: 0;\n flex-wrap: wrap;\n\n label[for] {\n color: var-list(--tct-radio-label-font-color, --tct-radio-label-color, inherit);\n align-items: center;\n border-radius: 3px;\n border: 2px solid var-list(--tct-radio-stroke-color, --t-a11y-gray-color-AA, #949494);\n background: var-list(--tct-radio-background-fill, transparent);\n cursor: pointer;\n display: block;\n padding: 10px;\n position: relative;\n text-align: center;\n transition: border-color var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'));\n white-space: nowrap;\n }\n\n input {\n &:checked + label {\n border-color: var-list(\n --tct-radio-checked-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n box-shadow: inset 0 0 0 2px #ffffff;\n background: var-list(--tct-radio-checked-background-fill, transparent);\n color: var-list(--tct-radio-checked-label-color, inherit);\n\n &:after {\n border-bottom-width: 3px;\n border-bottom: 5px solid\n var-list(\n --tct-radio-checked-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n border-left-width: 5px;\n border-left: 8px solid transparent;\n border-right-width: 5px;\n border-right: 8px solid transparent;\n bottom: 0;\n content: '';\n height: 0;\n left: 50%;\n margin-left: -5px;\n position: absolute;\n width: 0;\n }\n }\n\n &:hover + label {\n border-color: var-list(\n --tct-radio-hover-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n background: var-list(--tct-radio-hover-background-fill, transparent);\n color: var-list(--tct-radio-hover-label-color, --tct-radio-label-color, inherit);\n }\n\n &:focus + label,\n &:focus:checked + label {\n border-color: var-list(\n --tct-radio-focus-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n background: var-list(--tct-radio-focus-background-fill, transparent);\n box-shadow: var(--const-double-focus-ring), var-list(--tct-global-focus, unquote('0 0 0 2px #33b4ff'));\n color: var-list(--tct-radio-focus-label-color, --tct-radio-checked-label-color, inherit);\n }\n }\n}\n\ninput:disabled + label[for] {\n cursor: not-allowed;\n opacity: var-list(--tct-disabled-opacity, --app-disabled-opacity, 0.4);\n}\n","import { Component, Prop, h, Element, ComponentInterface, Listen, Watch, Event, EventEmitter } from '@stencil/core';\nimport { createGuid, handleAriaLabel, loc, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-radio', shadow: true, styleUrl: 'q2-radio.scss' })\nexport class Q2Radio implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-${createGuid()}`;\n inputField: HTMLInputElement;\n isLoaded: boolean = false;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the radio. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /** Disables the radio and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /**\n * Used by q2-radio-group to disable all options in the group\n * @private\n */\n @Prop({ reflect: false })\n groupDisabled: boolean = false;\n\n /**\n * Used by q2-radio-group to make all options in the group readonly\n * @private\n */\n @Prop({ reflect: false })\n groupReadonly: boolean = false;\n\n /**\n * Used by q2-radio-group to make the options display as tiles\n * @private\n */\n @Prop({ reflect: false })\n groupTileLayout: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * The text that describes the individual radio option.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /**\n * Used by q2-radio-group to apply a name to all options in the group\n * @private\n */\n @Prop({ reflect: true })\n name: string;\n\n /** The radio is non-interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** @private */\n @Prop()\n tabIndex: number = 0;\n\n /** The value that is returned in the `change` event that is emitted from the `q2-radio-group`. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the radio is checked.\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n this.isLoaded = true;\n overrideFocus(this.hostElement);\n this.hostElement.click = () => {\n this.inputField.focus();\n this.inputField.click();\n };\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('click')\n onHostClick(event: Event) {\n if (this.disabled) {\n event.stopImmediatePropagation();\n } else if (this.groupReadonly) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.inputField.focus();\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (event.target === this.hostElement) {\n this.inputField.focus();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('checked')\n checkedObserver() {\n if (!this.isLoaded) return;\n if (!this.checked) return;\n this.change.emit({ value: this.value });\n }\n\n // #endregion\n // #region Local Methods\n\n inputChange = (event: Event) => {\n event.stopPropagation();\n if (this.disabled || this.readonly || this.groupReadonly || this.groupDisabled) {\n event.preventDefault();\n return false;\n }\n\n if (event.target instanceof HTMLInputElement) {\n this.checked = event.target.checked;\n }\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div class={this.groupTileLayout ? 'radio-tile' : 'radio-container'}>\n <input\n ref={el => (this.inputField = el)}\n class=\"sr\"\n id={this._id}\n type=\"radio\"\n name={this.name}\n value={this.value}\n disabled={this.disabled || this.groupDisabled}\n checked={this.checked}\n aria-label={this.label && this.hideLabel ? loc(this.label) : undefined}\n onChange={this.inputChange}\n test-id=\"q2RadioInnerRadioBox\"\n ></input>\n\n <label\n htmlFor={this._id}\n class={this.hideLabel ? 'label-hidden' : undefined}\n test-id=\"radioButton\"\n >\n {!this.groupTileLayout && (\n <svg viewBox=\"0 0 18 18\">\n <circle\n stroke=\"none\"\n fill=\"none\"\n cx=\"9\"\n cy=\"9\"\n r=\"8\"\n />\n <circle\n stroke=\"none\"\n fill=\"none\"\n cx=\"9\"\n cy=\"9\"\n r=\"4\"\n />\n </svg>\n )}\n {!this.hideLabel && (\n <div class=\"label-content\">\n {(this.label && loc(this.label)) || ''}\n <slot></slot>\n </div>\n )}\n </label>\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":"6GAAA,MAAMA,EAAa,qvKACnB,MAAAC,EAAeD,E,MCGFE,EAAO,M,wDAGhBC,KAAAC,IAAc,SAASC,MAEvBF,KAAAG,SAAoB,MA+IpBH,KAAAI,YAAeC,IACXA,EAAMC,kBACN,GAAIN,KAAKO,UAAYP,KAAKQ,UAAYR,KAAKS,eAAiBT,KAAKU,cAAe,CAC5EL,EAAMM,iBACN,OAAO,K,CAGX,GAAIN,EAAMO,kBAAkBC,iBAAkB,CAC1Cb,KAAKc,QAAUT,EAAMO,OAAOE,O,yCAtIjB,M,cAIC,M,mBAOK,M,mBAOA,M,qBAOE,M,wGA+BR,E,qBAkBnB,iBAAAC,GACIC,EAAgBhB,K,CAGpB,gBAAAiB,GACIjB,KAAKG,SAAW,KAChBe,EAAclB,KAAKmB,aACnBnB,KAAKmB,YAAYC,MAAQ,KACrBpB,KAAKqB,WAAWC,QAChBtB,KAAKqB,WAAWD,OAAO,C,CAQ/B,WAAAG,CAAYlB,GACR,GAAIL,KAAKO,SAAU,CACfF,EAAMmB,0B,MACH,GAAIxB,KAAKS,cAAe,CAC3BJ,EAAMM,iBACNN,EAAMmB,2BACNxB,KAAKqB,WAAWC,O,EAKxB,aAAAG,CAAcpB,GACV,GAAIA,EAAMO,SAAWZ,KAAKmB,YAAa,CACnCnB,KAAKqB,WAAWC,O,EAQxB,iBAAAI,GACIV,EAAgBhB,K,CAIpB,eAAA2B,GACI,IAAK3B,KAAKG,SAAU,OACpB,IAAKH,KAAKc,QAAS,OACnBd,KAAK4B,OAAOC,KAAK,CAAEC,MAAO9B,KAAK8B,O,CAqBnC,MAAAC,GACI,OACIC,EAAA,OAAAC,IAAA,2CAAKC,MAAOlC,KAAKmC,gBAAkB,aAAe,mBAC9CH,EAAA,SAAAC,IAAA,2CACIG,IAAKC,GAAOrC,KAAKqB,WAAagB,EAC9BH,MAAM,KACNI,GAAItC,KAAKC,IACTsC,KAAK,QACLC,KAAMxC,KAAKwC,KACXV,MAAO9B,KAAK8B,MACZvB,SAAUP,KAAKO,UAAYP,KAAKU,cAChCI,QAASd,KAAKc,QAAO,aACTd,KAAKyC,OAASzC,KAAK0C,UAAYC,EAAI3C,KAAKyC,OAASG,UAC7DC,SAAU7C,KAAKI,YAAW,UAClB,yBAGZ4B,EAAA,SAAAC,IAAA,2CACIa,QAAS9C,KAAKC,IACdiC,MAAOlC,KAAK0C,UAAY,eAAiBE,UAAS,UAC1C,gBAEN5C,KAAKmC,iBACHH,EAAA,OAAAC,IAAA,2CAAKc,QAAQ,aACTf,EAAA,UAAAC,IAAA,2CACIe,OAAO,OACPC,KAAK,OACLC,GAAG,IACHC,GAAG,IACHC,EAAE,MAENpB,EAAA,UAAAC,IAAA,2CACIe,OAAO,OACPC,KAAK,OACLC,GAAG,IACHC,GAAG,IACHC,EAAE,QAIZpD,KAAK0C,WACHV,EAAA,OAAAC,IAAA,2CAAKC,MAAM,iBACLlC,KAAKyC,OAASE,EAAI3C,KAAKyC,QAAW,GACpCT,EAAA,QAAAC,IAAA,+C"}
|
|
1
|
+
{"version":3,"names":["q2RadioCss","Q2RadioStyle0","Q2Radio","this","_id","createGuid","isLoaded","inputChange","event","stopPropagation","disabled","readonly","groupReadonly","groupDisabled","preventDefault","target","HTMLInputElement","checked","componentWillLoad","handleAriaLabel","componentDidLoad","overrideFocus","hostElement","click","inputField","focus","onHostClick","stopImmediatePropagation","delegateFocus","ariaLabelObserver","checkedObserver","change","emit","value","render","h","key","class","groupTileLayout","ref","el","id","type","name","label","hideLabel","loc","undefined","onChange","htmlFor","viewBox","stroke","fill","cx","cy","r"],"sources":["src/components/q2-radio/q2-radio.scss?tag=q2-radio&encapsulation=shadow","src/components/q2-radio/q2-radio.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: block;\n}\n\n.radio-container {\n --comp-radio-margin: #{var-list(\n --tct-radio-margin,\n unquote(\n '#{var-list(--tct-radio-margin-vertical, --tct-scale-2, 10px)} #{var-list(--tct-radio-margin-horizontal, --tct-scale-3, 15px)}'\n )\n )};\n margin: var(--comp-radio-margin);\n\n label[for] {\n color: var-list(--tct-radio-label-color, inherit);\n font-weight: var-list(--tct-radio-font-weight, --tct-checkbox-font-weight, 400);\n align-items: center;\n cursor: pointer;\n margin-right: var-list(--tct-radio-label-margin-right, 1rem);\n display: grid;\n grid-template-columns: 18px 1fr;\n gap: var-list(--tct-scale-1, --app-scale-1x, 5px);\n\n &.label-hidden {\n grid-template-columns: var(--tct-radio-label-hidden-columns, 18px 1fr);\n }\n }\n\n svg {\n border-radius: 50%;\n transition: box-shadow var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'));\n outline: 0;\n width: 100%;\n }\n\n circle:nth-child(1) {\n stroke-width: 2;\n stroke: var-list(--tct-radio-stroke-color, --t-a11y-gray-color-AA, #949494);\n fill: var-list(--tct-radio-background-fill, transparent);\n }\n\n input {\n &:checked {\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-checked-background-fill, --tct-radio-checked-bg, transparent);\n stroke: var-list(\n --tct-radio-checked-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n }\n & + label .label-content {\n font-weight: var-list(--tct-radio-checked-label-font-weight, --tct-checkbox-selected-font-weight, 600);\n letter-spacing: var-list(\n --tct-radio-checked-label-letter-spacing,\n --tct-checkbox-selected-letter-spacing,\n 0.25\n );\n color: var-list(--tct-radio-checked-label-font-color, --tct-radio-checked-label-color, inherit);\n }\n & + label circle:nth-child(2) {\n fill: var-list(--tct-radio-checked-fill, --tct-checkbox-check-stroke-color, --t-checkbox-fill, #2e2e2e);\n }\n }\n\n &:hover {\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-hover-background-fill, transparent);\n stroke: var-list(\n --tct-radio-hover-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n }\n & + label .label-content {\n color: var-list(--tct-radio-hover-label-color, inherit);\n }\n }\n\n &:focus {\n & + label svg {\n box-shadow: var(--const-double-focus-ring);\n }\n & + label circle:nth-child(1) {\n fill: var-list(--tct-radio-focus-background-fill, transparent);\n stroke: var-list(\n --tct-radio-focus-stroke-color,\n --tct-checkbox-check-stroke-color,\n --t-checkbox-fill,\n #2e2e2e\n );\n }\n & + label .label-content {\n color: var-list(--tct-radio-focus-label-color, --tct-radio-checked-label-color, inherit);\n }\n }\n }\n}\n\n.radio-tile {\n flex-basis: 100px;\n flex-grow: 0;\n flex-wrap: wrap;\n\n label[for] {\n color: var-list(--tct-radio-label-font-color, --tct-radio-label-color, inherit);\n align-items: center;\n border-radius: 3px;\n border: 2px solid var-list(--tct-radio-stroke-color, --t-a11y-gray-color-AA, #949494);\n background: var-list(--tct-radio-background-fill, transparent);\n cursor: pointer;\n display: block;\n padding: 10px;\n position: relative;\n text-align: center;\n transition: border-color var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'));\n white-space: nowrap;\n }\n\n input {\n &:checked + label {\n border-color: var-list(\n --tct-radio-checked-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n box-shadow: inset 0 0 0 2px #ffffff;\n background: var-list(--tct-radio-checked-background-fill, transparent);\n color: var-list(--tct-radio-checked-label-color, inherit);\n\n &:after {\n border-bottom-width: 3px;\n border-bottom: 5px solid\n var-list(\n --tct-radio-checked-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n border-left-width: 5px;\n border-left: 8px solid transparent;\n border-right-width: 5px;\n border-right: 8px solid transparent;\n bottom: 0;\n content: '';\n height: 0;\n left: 50%;\n margin-left: -5px;\n position: absolute;\n width: 0;\n }\n }\n\n &:hover + label {\n border-color: var-list(\n --tct-radio-hover-stroke-color,\n --tct-radio-stroke-color,\n --t-a11y-gray-color-AA,\n #949494\n );\n background: var-list(--tct-radio-hover-background-fill, transparent);\n color: var-list(--tct-radio-hover-label-color, --tct-radio-label-color, inherit);\n }\n\n &:focus + label,\n &:focus:checked + label {\n border-color: var-list(\n --tct-radio-focus-stroke-color,\n var-prefixer(checkbox-check-stroke-color),\n --t-checkbox-fill,\n #2e2e2e\n );\n background: var-list(--tct-radio-focus-background-fill, transparent);\n box-shadow: var(--const-double-focus-ring), var-list(--tct-global-focus, unquote('0 0 0 2px #33b4ff'));\n color: var-list(--tct-radio-focus-label-color, --tct-radio-checked-label-color, inherit);\n }\n }\n}\n\ninput:disabled + label[for] {\n cursor: not-allowed;\n opacity: var-list(--tct-disabled-opacity, --app-disabled-opacity, 0.4);\n}\n","import { Component, Prop, h, Element, ComponentInterface, Listen, Watch, Event, EventEmitter } from '@stencil/core';\nimport { createGuid, handleAriaLabel, loc, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-radio', shadow: true, styleUrl: 'q2-radio.scss' })\nexport class Q2Radio implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-${createGuid()}`;\n inputField: HTMLInputElement;\n isLoaded: boolean = false;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the radio. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /** Disables the radio and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /**\n * Used by q2-radio-group to disable all options in the group\n * @private\n */\n @Prop({ reflect: false })\n groupDisabled: boolean = false;\n\n /**\n * Used by q2-radio-group to make all options in the group readonly\n * @private\n */\n @Prop({ reflect: false })\n groupReadonly: boolean = false;\n\n /**\n * Used by q2-radio-group to make the options display as tiles\n * @private\n */\n @Prop({ reflect: false })\n groupTileLayout: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * The text that describes the individual radio option.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /**\n * Used by q2-radio-group to apply a name to all options in the group\n * @private\n */\n @Prop({ reflect: true })\n name: string;\n\n /** The radio is non-interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** @private */\n @Prop()\n tabIndex: number = 0;\n\n /** The value that is returned in the `change` event that is emitted from the `q2-radio-group`. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the radio is checked.\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n this.isLoaded = true;\n overrideFocus(this.hostElement);\n this.hostElement.click = () => {\n this.inputField.focus();\n this.inputField.click();\n };\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('click')\n onHostClick(event: Event) {\n if (this.disabled) {\n event.stopImmediatePropagation();\n } else if (this.groupReadonly) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.inputField.focus();\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (event.target === this.hostElement) {\n this.inputField.focus();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('checked')\n checkedObserver() {\n if (!this.isLoaded) return;\n if (!this.checked) return;\n this.change.emit({ value: this.value });\n }\n\n // #endregion\n // #region Local Methods\n\n inputChange = (event: Event) => {\n event.stopPropagation();\n if (this.disabled || this.readonly || this.groupReadonly || this.groupDisabled) {\n event.preventDefault();\n return false;\n }\n\n if (event.target instanceof HTMLInputElement) {\n this.checked = event.target.checked;\n }\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div class={this.groupTileLayout ? 'radio-tile' : 'radio-container'}>\n <input\n ref={el => (this.inputField = el)}\n class=\"sr\"\n id={this._id}\n type=\"radio\"\n name={this.name}\n value={this.value}\n disabled={this.disabled || this.groupDisabled}\n checked={this.checked}\n aria-label={this.label && this.hideLabel ? loc(this.label) : undefined}\n onChange={this.inputChange}\n test-id=\"q2RadioInnerRadioBox\"\n ></input>\n\n <label\n htmlFor={this._id}\n class={this.hideLabel ? 'label-hidden' : undefined}\n test-id=\"radioButton\"\n >\n {!this.groupTileLayout && (\n <svg viewBox=\"0 0 18 18\">\n <circle\n stroke=\"none\"\n fill=\"none\"\n cx=\"9\"\n cy=\"9\"\n r=\"8\"\n />\n <circle\n stroke=\"none\"\n fill=\"none\"\n cx=\"9\"\n cy=\"9\"\n r=\"4\"\n />\n </svg>\n )}\n {!this.hideLabel && (\n <div class=\"label-content\">\n {(this.label && loc(this.label)) || ''}\n <slot></slot>\n </div>\n )}\n </label>\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAa;;AACnB,MAAAC,IAAeD;;MCGFE,IAAO;;;;;QAGhBC,KAAAC,MAAc,SAASC;IAEvBF,KAAAG,WAAoB;;;QA+IpBH,KAAAI,cAAeC;MACXA,EAAMC;MACN,IAAIN,KAAKO,YAAYP,KAAKQ,YAAYR,KAAKS,iBAAiBT,KAAKU,eAAe;QAC5EL,EAAMM;QACN,OAAO;;MAGX,IAAIN,EAAMO,kBAAkBC,kBAAkB;QAC1Cb,KAAKc,UAAUT,EAAMO,OAAOE;;;;mBAtIjB;oBAIC;yBAOK;yBAOA;2BAOE;;;;;oBA+BR;;;;;EAkBnB,iBAAAC;IACIC,EAAgBhB;;EAGpB,gBAAAiB;IACIjB,KAAKG,WAAW;IAChBe,EAAclB,KAAKmB;IACnBnB,KAAKmB,YAAYC,QAAQ;MACrBpB,KAAKqB,WAAWC;MAChBtB,KAAKqB,WAAWD;AAAO;;;;EAQ/B,WAAAG,CAAYlB;IACR,IAAIL,KAAKO,UAAU;MACfF,EAAMmB;WACH,IAAIxB,KAAKS,eAAe;MAC3BJ,EAAMM;MACNN,EAAMmB;MACNxB,KAAKqB,WAAWC;;;EAKxB,aAAAG,CAAcpB;IACV,IAAIA,EAAMO,WAAWZ,KAAKmB,aAAa;MACnCnB,KAAKqB,WAAWC;;;;;EAQxB,iBAAAI;IACIV,EAAgBhB;;EAIpB,eAAA2B;IACI,KAAK3B,KAAKG,UAAU;IACpB,KAAKH,KAAKc,SAAS;IACnBd,KAAK4B,OAAOC,KAAK;MAAEC,OAAO9B,KAAK8B;;;;;EAqBnC,MAAAC;IACI,OACIC,EAAA;MAAAC,KAAA;MAAKC,OAAOlC,KAAKmC,kBAAkB,eAAe;OAC9CH,EAAA;MAAAC,KAAA;MACIG,KAAKC,KAAOrC,KAAKqB,aAAagB;MAC9BH,OAAM;MACNI,IAAItC,KAAKC;MACTsC,MAAK;MACLC,MAAMxC,KAAKwC;MACXV,OAAO9B,KAAK8B;MACZvB,UAAUP,KAAKO,YAAYP,KAAKU;MAChCI,SAASd,KAAKc;MAAO,cACTd,KAAKyC,SAASzC,KAAK0C,YAAYC,EAAI3C,KAAKyC,SAASG;MAC7DC,UAAU7C,KAAKI;MAAW,WAClB;QAGZ4B,EAAA;MAAAC,KAAA;MACIa,SAAS9C,KAAKC;MACdiC,OAAOlC,KAAK0C,YAAY,iBAAiBE;MAAS,WAC1C;QAEN5C,KAAKmC,mBACHH,EAAA;MAAAC,KAAA;MAAKc,SAAQ;OACTf,EAAA;MAAAC,KAAA;MACIe,QAAO;MACPC,MAAK;MACLC,IAAG;MACHC,IAAG;MACHC,GAAE;QAENpB,EAAA;MAAAC,KAAA;MACIe,QAAO;MACPC,MAAK;MACLC,IAAG;MACHC,IAAG;MACHC,GAAE;UAIZpD,KAAK0C,aACHV,EAAA;MAAAC,KAAA;MAAKC,OAAM;OACLlC,KAAKyC,SAASE,EAAI3C,KAAKyC,UAAW,IACpCT,EAAA;MAAAC,KAAA"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { r as e, h as t, F as i, g as s } from "./index-7a5365e2.js";
|
|
2
|
+
|
|
3
|
+
import { d as n } from "./index-3184c760.js";
|
|
4
|
+
|
|
5
|
+
import { l as a } from "./index-d18e2a20.js";
|
|
6
|
+
|
|
7
|
+
const r = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline}";
|
|
8
|
+
|
|
9
|
+
const o = r;
|
|
10
|
+
|
|
11
|
+
const d = class {
|
|
12
|
+
constructor(t) {
|
|
13
|
+
e(this, t);
|
|
14
|
+
// #region Own Properties
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
* Used to manage the sync timer that updates the time since the component was connected to the DOM.
|
|
18
|
+
* Will be set to null if a valid `baseDate` is provided.
|
|
19
|
+
*/ this.syncTimer = null;
|
|
20
|
+
/** @private Will be set to true if a valid `baseDate` is provided. */ this.trimSuffix = false;
|
|
21
|
+
this.displayedMessage = undefined;
|
|
22
|
+
this.baseDate = undefined;
|
|
23
|
+
this.date = undefined;
|
|
24
|
+
this.locale = document.documentElement.lang || "en-US";
|
|
25
|
+
this.messageFormat = "short";
|
|
26
|
+
this.numeric = "auto";
|
|
27
|
+
this.sync = true;
|
|
28
|
+
this.unit = undefined;
|
|
29
|
+
}
|
|
30
|
+
// #endregion
|
|
31
|
+
// #region Component Lifecycle Events
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
this.syncUpdated();
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
window.clearInterval(this.syncTimer);
|
|
37
|
+
this.syncTimer = null;
|
|
38
|
+
}
|
|
39
|
+
componentWillLoad() {
|
|
40
|
+
this.updateMessage();
|
|
41
|
+
}
|
|
42
|
+
// #endregion
|
|
43
|
+
// #region Public Methods API
|
|
44
|
+
/** Retrieves the value of the displayed messages. */
|
|
45
|
+
async displayedMessageValue() {
|
|
46
|
+
return this.displayedMessage;
|
|
47
|
+
}
|
|
48
|
+
/** Checks the provided baseDate prop is a valid date. */ async validBaseDateProp() {
|
|
49
|
+
return this.isValidBaseDate;
|
|
50
|
+
}
|
|
51
|
+
/** Checks the provided date prop is a valid date. */ async validDateProp() {
|
|
52
|
+
return this.isValidDate;
|
|
53
|
+
}
|
|
54
|
+
// #endregion
|
|
55
|
+
// #region Watchers
|
|
56
|
+
updateMessage() {
|
|
57
|
+
const {isValidDate: e, isBaseDateProvided: t, isValidBaseDate: i, dateObject: s, baseDateObject: r, locale: o, handleNumeric: d, messageFormat: h, isValidUnit: l, unit: u, trimSuffix: c} = this;
|
|
58
|
+
if (!e || t && !i) {
|
|
59
|
+
this.sync = false;
|
|
60
|
+
this.displayedMessage = a("tecton.element.relativeTime.invalidDate");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const p = n.intlFormatDistance(new Date(s), new Date(r), {
|
|
64
|
+
locale: o,
|
|
65
|
+
localeMatcher: "best fit",
|
|
66
|
+
numeric: d,
|
|
67
|
+
style: h,
|
|
68
|
+
unit: l ? u : null
|
|
69
|
+
});
|
|
70
|
+
if (c) {
|
|
71
|
+
this.displayedMessage = this.trimMessage(p);
|
|
72
|
+
} else {
|
|
73
|
+
this.displayedMessage = p;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
syncUpdated() {
|
|
77
|
+
if (this.sync) {
|
|
78
|
+
this.syncTimer = window.setInterval((() => {
|
|
79
|
+
this.updateMessage();
|
|
80
|
+
}), 1e3);
|
|
81
|
+
} else {
|
|
82
|
+
window.clearInterval(this.syncTimer);
|
|
83
|
+
this.syncTimer = null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// #endregion
|
|
87
|
+
// #region Local Methods
|
|
88
|
+
get baseDateObject() {
|
|
89
|
+
if (this.isBaseDateProvided && this.isValidBaseDate) {
|
|
90
|
+
this.trimSuffix = true;
|
|
91
|
+
this.sync = false;
|
|
92
|
+
return new Date(this.baseDate);
|
|
93
|
+
} else {
|
|
94
|
+
this.trimSuffix = false;
|
|
95
|
+
this.sync = true;
|
|
96
|
+
return new Date;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
get dateObject() {
|
|
100
|
+
return new Date(this.date);
|
|
101
|
+
}
|
|
102
|
+
get handleNumeric() {
|
|
103
|
+
if (this.isValidBaseDate) return "always";
|
|
104
|
+
return this.numeric;
|
|
105
|
+
}
|
|
106
|
+
get isBaseDateProvided() {
|
|
107
|
+
return this.baseDate !== undefined;
|
|
108
|
+
}
|
|
109
|
+
get isValidBaseDate() {
|
|
110
|
+
const e = new Date(this.baseDate);
|
|
111
|
+
const t = n.isValid(e);
|
|
112
|
+
if (!t && this.isBaseDateProvided) {
|
|
113
|
+
console.warn("Error: Invalid baseDate provided to q2-relative-time.");
|
|
114
|
+
}
|
|
115
|
+
return t;
|
|
116
|
+
}
|
|
117
|
+
get isValidDate() {
|
|
118
|
+
const e = new Date(this.date);
|
|
119
|
+
const t = n.isValid(e);
|
|
120
|
+
if (!t) console.warn("Error: Invalid date provided to q2-relative-time.");
|
|
121
|
+
return t;
|
|
122
|
+
}
|
|
123
|
+
get isValidUnit() {
|
|
124
|
+
if ([ "second", "minute", "hour", "day", "month", "quarter", "year" ].includes(this.unit)) return true;
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
get shouldShow() {
|
|
128
|
+
return !!this.displayedMessage;
|
|
129
|
+
}
|
|
130
|
+
trimMessage(e) {
|
|
131
|
+
return e.replace(/^in\s?/, "").replace(/\sago$/, "");
|
|
132
|
+
}
|
|
133
|
+
// #endregion
|
|
134
|
+
// #region Render Methods
|
|
135
|
+
render() {
|
|
136
|
+
const {shouldShow: e, displayedMessage: s} = this;
|
|
137
|
+
return t(i, {
|
|
138
|
+
key: "78b7e35a4534ff20a2bace5450b860a95b5354ce"
|
|
139
|
+
}, e ? t("time", {
|
|
140
|
+
dateTime: s
|
|
141
|
+
}, s) : null);
|
|
142
|
+
}
|
|
143
|
+
get hostElement() {
|
|
144
|
+
return s(this);
|
|
145
|
+
}
|
|
146
|
+
static get watchers() {
|
|
147
|
+
return {
|
|
148
|
+
messageFormat: [ "updateMessage" ],
|
|
149
|
+
locale: [ "updateMessage" ],
|
|
150
|
+
date: [ "updateMessage" ],
|
|
151
|
+
baseDate: [ "updateMessage" ],
|
|
152
|
+
numeric: [ "updateMessage" ],
|
|
153
|
+
unit: [ "updateMessage" ],
|
|
154
|
+
sync: [ "syncUpdated" ]
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
d.style = o;
|
|
160
|
+
|
|
161
|
+
export { d as q2_relative_time };
|
|
162
|
+
//# sourceMappingURL=q2-relative-time.entry.js.map
|