@riverty/web-components 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +78 -0
- package/custom-elements.json +4 -0
- package/package.json +3 -2
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/focusable-Oll_rmtP.js +0 -28
- package/dist/cjs/formData-B2DZyLxP.js +0 -44
- package/dist/cjs/index-BnETQtSf.js +0 -1834
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -13
- package/dist/cjs/r-accordion-panel.cjs.entry.js +0 -24
- package/dist/cjs/r-accordion-section.cjs.entry.js +0 -125
- package/dist/cjs/r-accordion-trigger.cjs.entry.js +0 -93
- package/dist/cjs/r-accordion.cjs.entry.js +0 -20
- package/dist/cjs/r-alert.cjs.entry.js +0 -146
- package/dist/cjs/r-badge.cjs.entry.js +0 -40
- package/dist/cjs/r-button.cjs.entry.js +0 -149
- package/dist/cjs/r-checkbox-group.cjs.entry.js +0 -232
- package/dist/cjs/r-checkbox.cjs.entry.js +0 -269
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +0 -31
- package/dist/cjs/r-dialog.cjs.entry.js +0 -107
- package/dist/cjs/r-hint_2.cjs.entry.js +0 -50
- package/dist/cjs/r-icon-button_2.cjs.entry.js +0 -467
- package/dist/cjs/r-icon.cjs.entry.js +0 -284
- package/dist/cjs/r-illustration.cjs.entry.js +0 -396
- package/dist/cjs/r-input-code.cjs.entry.js +0 -432
- package/dist/cjs/r-input-date.cjs.entry.js +0 -519
- package/dist/cjs/r-input-password.cjs.entry.js +0 -265
- package/dist/cjs/r-input-phone-number.cjs.entry.js +0 -2525
- package/dist/cjs/r-input.cjs.entry.js +0 -402
- package/dist/cjs/r-list-item.cjs.entry.js +0 -109
- package/dist/cjs/r-pagination.cjs.entry.js +0 -314
- package/dist/cjs/r-panel.cjs.entry.js +0 -184
- package/dist/cjs/r-popover-action.cjs.entry.js +0 -80
- package/dist/cjs/r-popover-content.cjs.entry.js +0 -62
- package/dist/cjs/r-popover-headline.cjs.entry.js +0 -28
- package/dist/cjs/r-popover-trigger.cjs.entry.js +0 -70
- package/dist/cjs/r-popover.cjs.entry.js +0 -347
- package/dist/cjs/r-progress-bar.cjs.entry.js +0 -25
- package/dist/cjs/r-radio-button-description.cjs.entry.js +0 -18
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +0 -18
- package/dist/cjs/r-radio-button-title.cjs.entry.js +0 -18
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +0 -18
- package/dist/cjs/r-radio-button.cjs.entry.js +0 -139
- package/dist/cjs/r-radio-group.cjs.entry.js +0 -425
- package/dist/cjs/r-select-option.cjs.entry.js +0 -130
- package/dist/cjs/r-select.cjs.entry.js +0 -1101
- package/dist/cjs/r-skip-link.cjs.entry.js +0 -19
- package/dist/cjs/r-stepper-item.cjs.entry.js +0 -42
- package/dist/cjs/r-stepper.cjs.entry.js +0 -99
- package/dist/cjs/r-tab-panel.cjs.entry.js +0 -26
- package/dist/cjs/r-tab.cjs.entry.js +0 -62
- package/dist/cjs/r-tabs-list.cjs.entry.js +0 -175
- package/dist/cjs/r-tabs.cjs.entry.js +0 -277
- package/dist/cjs/r-textarea.cjs.entry.js +0 -270
- package/dist/cjs/r-toast-group.cjs.entry.js +0 -46
- package/dist/cjs/r-toast.cjs.entry.js +0 -306
- package/dist/cjs/style-observer-D9zSP9wP.js +0 -1118
- package/dist/cjs/theming-NqxjhVJS.js +0 -109
- package/dist/cjs/web-components.cjs.js +0 -25
- package/dist/collection/collection-manifest.json +0 -60
- package/dist/collection/components/accordion/accordion.css +0 -24
- package/dist/collection/components/accordion/accordion.js +0 -90
- package/dist/collection/components/accordion/exports.js +0 -1
- package/dist/collection/components/accordion-panel/accordion-panel.css +0 -50
- package/dist/collection/components/accordion-panel/accordion-panel.js +0 -86
- package/dist/collection/components/accordion-section/accordion-section.css +0 -27
- package/dist/collection/components/accordion-section/accordion-section.js +0 -235
- package/dist/collection/components/accordion-trigger/accordion-trigger.css +0 -93
- package/dist/collection/components/accordion-trigger/accordion-trigger.js +0 -220
- package/dist/collection/components/alert/alert.css +0 -119
- package/dist/collection/components/alert/alert.js +0 -526
- package/dist/collection/components/alert/exports.js +0 -2
- package/dist/collection/components/badge/badge.css +0 -52
- package/dist/collection/components/badge/badge.js +0 -120
- package/dist/collection/components/badge/exports.js +0 -1
- package/dist/collection/components/button/button.css +0 -180
- package/dist/collection/components/button/button.js +0 -510
- package/dist/collection/components/button/exports.js +0 -5
- package/dist/collection/components/checkbox/checkbox.css +0 -116
- package/dist/collection/components/checkbox/checkbox.js +0 -777
- package/dist/collection/components/checkbox-group/checkbox-group.css +0 -48
- package/dist/collection/components/checkbox-group/checkbox-group.js +0 -718
- package/dist/collection/components/design-system-devtools/design-system-devtools.js +0 -59
- package/dist/collection/components/dialog/dialog.css +0 -125
- package/dist/collection/components/dialog/dialog.js +0 -345
- package/dist/collection/components/dialog/exports.js +0 -9
- package/dist/collection/components/hint/exports.js +0 -1
- package/dist/collection/components/hint/hint.css +0 -63
- package/dist/collection/components/hint/hint.js +0 -114
- package/dist/collection/components/icon/all-kit.js +0 -2
- package/dist/collection/components/icon/data.js +0 -90
- package/dist/collection/components/icon/exports.js +0 -7
- package/dist/collection/components/icon/icon.css +0 -105
- package/dist/collection/components/icon/icon.js +0 -379
- package/dist/collection/components/icon/riverty-kit.js +0 -2
- package/dist/collection/components/icon-button/icon-button.css +0 -105
- package/dist/collection/components/icon-button/icon-button.js +0 -343
- package/dist/collection/components/illustration/data.js +0 -112
- package/dist/collection/components/illustration/exports.js +0 -3
- package/dist/collection/components/illustration/illustration.js +0 -540
- package/dist/collection/components/illustration/illustration.scss +0 -56
- package/dist/collection/components/illustration/illustrations-ui-kit.js +0 -2
- package/dist/collection/components/input/exports.js +0 -16
- package/dist/collection/components/input/input.css +0 -180
- package/dist/collection/components/input/input.js +0 -1572
- package/dist/collection/components/input-code/exports.js +0 -2
- package/dist/collection/components/input-code/input-code.css +0 -127
- package/dist/collection/components/input-code/input-code.js +0 -1139
- package/dist/collection/components/input-date/exports.js +0 -1
- package/dist/collection/components/input-date/input-date.css +0 -148
- package/dist/collection/components/input-date/input-date.js +0 -1228
- package/dist/collection/components/input-password/exports.js +0 -1
- package/dist/collection/components/input-password/input-password.css +0 -25
- package/dist/collection/components/input-password/input-password.js +0 -1051
- package/dist/collection/components/input-phone-number/input-phone-number.css +0 -61
- package/dist/collection/components/input-phone-number/input-phone-number.js +0 -874
- package/dist/collection/components/label/label.css +0 -38
- package/dist/collection/components/label/label.js +0 -47
- package/dist/collection/components/list-item/list-item/exports.js +0 -2
- package/dist/collection/components/list-item/list-item/list-item.css +0 -199
- package/dist/collection/components/list-item/list-item/list-item.js +0 -467
- package/dist/collection/components/pagination/exports.js +0 -3
- package/dist/collection/components/pagination/pagination.css +0 -118
- package/dist/collection/components/pagination/pagination.js +0 -799
- package/dist/collection/components/panel/exports.js +0 -1
- package/dist/collection/components/panel/panel.css +0 -192
- package/dist/collection/components/panel/panel.js +0 -473
- package/dist/collection/components/popover/exports.js +0 -3
- package/dist/collection/components/popover/popover.css +0 -251
- package/dist/collection/components/popover/popover.js +0 -741
- package/dist/collection/components/popover-action/popover-action.css +0 -21
- package/dist/collection/components/popover-action/popover-action.js +0 -150
- package/dist/collection/components/popover-content/popover-content.css +0 -9
- package/dist/collection/components/popover-content/popover-content.js +0 -130
- package/dist/collection/components/popover-headline/popover-headline.css +0 -7
- package/dist/collection/components/popover-headline/popover-headline.js +0 -28
- package/dist/collection/components/popover-trigger/exports.js +0 -1
- package/dist/collection/components/popover-trigger/popover-trigger.css +0 -4
- package/dist/collection/components/popover-trigger/popover-trigger.js +0 -163
- package/dist/collection/components/progress-bar/progress-bar.css +0 -41
- package/dist/collection/components/progress-bar/progress-bar.js +0 -71
- package/dist/collection/components/radio-button/radio-button.css +0 -126
- package/dist/collection/components/radio-button/radio-button.js +0 -559
- package/dist/collection/components/radio-button-description/radio-button-description.css +0 -5
- package/dist/collection/components/radio-button-description/radio-button-description.js +0 -22
- package/dist/collection/components/radio-button-leading/radio-button-leading.css +0 -3
- package/dist/collection/components/radio-button-leading/radio-button-leading.js +0 -22
- package/dist/collection/components/radio-button-title/radio-button-title.css +0 -8
- package/dist/collection/components/radio-button-title/radio-button-title.js +0 -22
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.css +0 -6
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +0 -22
- package/dist/collection/components/radio-group/exports.js +0 -1
- package/dist/collection/components/radio-group/radio-group.css +0 -65
- package/dist/collection/components/radio-group/radio-group.js +0 -1020
- package/dist/collection/components/select/exports.js +0 -1
- package/dist/collection/components/select/select.css +0 -247
- package/dist/collection/components/select/select.js +0 -2011
- package/dist/collection/components/select-option/select-option.css +0 -93
- package/dist/collection/components/select-option/select-option.js +0 -459
- package/dist/collection/components/skip-link/exports.js +0 -1
- package/dist/collection/components/skip-link/skip-link.css +0 -37
- package/dist/collection/components/skip-link/skip-link.js +0 -52
- package/dist/collection/components/stepper/stepper.css +0 -25
- package/dist/collection/components/stepper/stepper.js +0 -216
- package/dist/collection/components/stepper-item/stepper-item.css +0 -62
- package/dist/collection/components/stepper-item/stepper-item.js +0 -171
- package/dist/collection/components/tab/tab.css +0 -81
- package/dist/collection/components/tab/tab.js +0 -169
- package/dist/collection/components/tab-panel/tab-panel.css +0 -19
- package/dist/collection/components/tab-panel/tab-panel.js +0 -72
- package/dist/collection/components/tabs/tabs.css +0 -4
- package/dist/collection/components/tabs/tabs.js +0 -345
- package/dist/collection/components/tabs-list/exports.js +0 -2
- package/dist/collection/components/tabs-list/tabs-list.css +0 -58
- package/dist/collection/components/tabs-list/tabs-list.js +0 -294
- package/dist/collection/components/textarea/exports.js +0 -8
- package/dist/collection/components/textarea/textarea.css +0 -148
- package/dist/collection/components/textarea/textarea.js +0 -1055
- package/dist/collection/components/toast/exports.js +0 -3
- package/dist/collection/components/toast/toast.css +0 -179
- package/dist/collection/components/toast/toast.js +0 -812
- package/dist/collection/components/toast-group/exports.js +0 -1
- package/dist/collection/components/toast-group/toast-group.css +0 -37
- package/dist/collection/components/toast-group/toast-group.js +0 -49
- package/dist/collection/components/tooltip/exports.js +0 -3
- package/dist/collection/components/tooltip/tooltip.css +0 -106
- package/dist/collection/components/tooltip/tooltip.js +0 -500
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/focusable.js +0 -24
- package/dist/collection/utils/formData.js +0 -40
- package/dist/collection/utils/theming.js +0 -103
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/focusable-ky1yonnS.js +0 -26
- package/dist/esm/formData-DvLT8-y3.js +0 -42
- package/dist/esm/index-CTxpqopm.js +0 -1806
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -11
- package/dist/esm/r-accordion-panel.entry.js +0 -22
- package/dist/esm/r-accordion-section.entry.js +0 -123
- package/dist/esm/r-accordion-trigger.entry.js +0 -91
- package/dist/esm/r-accordion.entry.js +0 -18
- package/dist/esm/r-alert.entry.js +0 -144
- package/dist/esm/r-badge.entry.js +0 -38
- package/dist/esm/r-button.entry.js +0 -147
- package/dist/esm/r-checkbox-group.entry.js +0 -230
- package/dist/esm/r-checkbox.entry.js +0 -267
- package/dist/esm/r-design-system-devtools.entry.js +0 -29
- package/dist/esm/r-dialog.entry.js +0 -105
- package/dist/esm/r-hint_2.entry.js +0 -47
- package/dist/esm/r-icon-button_2.entry.js +0 -464
- package/dist/esm/r-icon.entry.js +0 -282
- package/dist/esm/r-illustration.entry.js +0 -394
- package/dist/esm/r-input-code.entry.js +0 -430
- package/dist/esm/r-input-date.entry.js +0 -517
- package/dist/esm/r-input-password.entry.js +0 -263
- package/dist/esm/r-input-phone-number.entry.js +0 -2523
- package/dist/esm/r-input.entry.js +0 -400
- package/dist/esm/r-list-item.entry.js +0 -107
- package/dist/esm/r-pagination.entry.js +0 -312
- package/dist/esm/r-panel.entry.js +0 -182
- package/dist/esm/r-popover-action.entry.js +0 -78
- package/dist/esm/r-popover-content.entry.js +0 -60
- package/dist/esm/r-popover-headline.entry.js +0 -26
- package/dist/esm/r-popover-trigger.entry.js +0 -68
- package/dist/esm/r-popover.entry.js +0 -345
- package/dist/esm/r-progress-bar.entry.js +0 -23
- package/dist/esm/r-radio-button-description.entry.js +0 -16
- package/dist/esm/r-radio-button-leading.entry.js +0 -16
- package/dist/esm/r-radio-button-title.entry.js +0 -16
- package/dist/esm/r-radio-button-trailing.entry.js +0 -16
- package/dist/esm/r-radio-button.entry.js +0 -137
- package/dist/esm/r-radio-group.entry.js +0 -423
- package/dist/esm/r-select-option.entry.js +0 -128
- package/dist/esm/r-select.entry.js +0 -1099
- package/dist/esm/r-skip-link.entry.js +0 -17
- package/dist/esm/r-stepper-item.entry.js +0 -40
- package/dist/esm/r-stepper.entry.js +0 -97
- package/dist/esm/r-tab-panel.entry.js +0 -24
- package/dist/esm/r-tab.entry.js +0 -60
- package/dist/esm/r-tabs-list.entry.js +0 -173
- package/dist/esm/r-tabs.entry.js +0 -275
- package/dist/esm/r-textarea.entry.js +0 -268
- package/dist/esm/r-toast-group.entry.js +0 -44
- package/dist/esm/r-toast.entry.js +0 -304
- package/dist/esm/style-observer-4Uv3PpKT.js +0 -1116
- package/dist/esm/theming-DD2IrjpG.js +0 -106
- package/dist/esm/web-components.js +0 -21
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/types/components/accordion/accordion.d.ts +0 -27
- package/dist/types/components/accordion/exports.d.ts +0 -2
- package/dist/types/components/accordion-panel/accordion-panel.d.ts +0 -10
- package/dist/types/components/accordion-section/accordion-section.d.ts +0 -36
- package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +0 -33
- package/dist/types/components/alert/alert.d.ts +0 -67
- package/dist/types/components/alert/exports.d.ts +0 -4
- package/dist/types/components/badge/badge.d.ts +0 -23
- package/dist/types/components/badge/exports.d.ts +0 -2
- package/dist/types/components/button/button.d.ts +0 -89
- package/dist/types/components/button/exports.d.ts +0 -10
- package/dist/types/components/checkbox/checkbox.d.ts +0 -136
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +0 -122
- package/dist/types/components/design-system-devtools/design-system-devtools.d.ts +0 -15
- package/dist/types/components/dialog/dialog.d.ts +0 -69
- package/dist/types/components/dialog/exports.d.ts +0 -10
- package/dist/types/components/hint/exports.d.ts +0 -2
- package/dist/types/components/hint/hint.d.ts +0 -20
- package/dist/types/components/icon/all-kit.d.ts +0 -2890
- package/dist/types/components/icon/data.d.ts +0 -145
- package/dist/types/components/icon/exports.d.ts +0 -152
- package/dist/types/components/icon/icon.d.ts +0 -37
- package/dist/types/components/icon/riverty-kit.d.ts +0 -139
- package/dist/types/components/icon-button/icon-button.d.ts +0 -69
- package/dist/types/components/illustration/data.d.ts +0 -52
- package/dist/types/components/illustration/exports.d.ts +0 -23
- package/dist/types/components/illustration/illustration.d.ts +0 -51
- package/dist/types/components/illustration/illustrations-ui-kit.d.ts +0 -21
- package/dist/types/components/input/exports.d.ts +0 -10
- package/dist/types/components/input/input.d.ts +0 -300
- package/dist/types/components/input-code/exports.d.ts +0 -4
- package/dist/types/components/input-code/input-code.d.ts +0 -175
- package/dist/types/components/input-date/exports.d.ts +0 -5
- package/dist/types/components/input-date/input-date.d.ts +0 -172
- package/dist/types/components/input-password/exports.d.ts +0 -1
- package/dist/types/components/input-password/input-password.d.ts +0 -184
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +0 -128
- package/dist/types/components/label/label.d.ts +0 -9
- package/dist/types/components/list-item/list-item/exports.d.ts +0 -4
- package/dist/types/components/list-item/list-item/list-item.d.ts +0 -61
- package/dist/types/components/pagination/exports.d.ts +0 -6
- package/dist/types/components/pagination/pagination.d.ts +0 -140
- package/dist/types/components/panel/exports.d.ts +0 -2
- package/dist/types/components/panel/panel.d.ts +0 -56
- package/dist/types/components/popover/exports.d.ts +0 -6
- package/dist/types/components/popover/popover.d.ts +0 -131
- package/dist/types/components/popover-action/popover-action.d.ts +0 -24
- package/dist/types/components/popover-content/popover-content.d.ts +0 -22
- package/dist/types/components/popover-headline/popover-headline.d.ts +0 -6
- package/dist/types/components/popover-trigger/exports.d.ts +0 -2
- package/dist/types/components/popover-trigger/popover-trigger.d.ts +0 -31
- package/dist/types/components/progress-bar/progress-bar.d.ts +0 -10
- package/dist/types/components/radio-button/radio-button.d.ts +0 -92
- package/dist/types/components/radio-button-description/radio-button-description.d.ts +0 -8
- package/dist/types/components/radio-button-leading/radio-button-leading.d.ts +0 -8
- package/dist/types/components/radio-button-title/radio-button-title.d.ts +0 -8
- package/dist/types/components/radio-button-trailing/radio-button-trailing.d.ts +0 -8
- package/dist/types/components/radio-group/exports.d.ts +0 -2
- package/dist/types/components/radio-group/radio-group.d.ts +0 -178
- package/dist/types/components/select/exports.d.ts +0 -2
- package/dist/types/components/select/select.d.ts +0 -317
- package/dist/types/components/select-option/select-option.d.ts +0 -113
- package/dist/types/components/skip-link/exports.d.ts +0 -2
- package/dist/types/components/skip-link/skip-link.d.ts +0 -6
- package/dist/types/components/stepper/stepper.d.ts +0 -22
- package/dist/types/components/stepper-item/stepper-item.d.ts +0 -23
- package/dist/types/components/tab/tab.d.ts +0 -23
- package/dist/types/components/tab-panel/tab-panel.d.ts +0 -7
- package/dist/types/components/tabs/tabs.d.ts +0 -49
- package/dist/types/components/tabs-list/exports.d.ts +0 -4
- package/dist/types/components/tabs-list/tabs-list.d.ts +0 -41
- package/dist/types/components/textarea/exports.d.ts +0 -2
- package/dist/types/components/textarea/textarea.d.ts +0 -158
- package/dist/types/components/toast/exports.d.ts +0 -6
- package/dist/types/components/toast/toast.d.ts +0 -146
- package/dist/types/components/toast-group/exports.d.ts +0 -2
- package/dist/types/components/toast-group/toast-group.d.ts +0 -9
- package/dist/types/components/tooltip/exports.d.ts +0 -6
- package/dist/types/components/tooltip/tooltip.d.ts +0 -131
- package/dist/types/components.d.ts +0 -6286
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1732
- package/dist/types/types/jsx-shim.d.ts +0 -13
- package/dist/types/types/style-observer.d.ts +0 -20
- package/dist/types/utils/focusable.d.ts +0 -1
- package/dist/types/utils/formData.d.ts +0 -1
- package/dist/types/utils/theming.d.ts +0 -15
- package/dist/web-components/index.esm.js +0 -0
- package/dist/web-components/p-02b22f8e.entry.js +0 -1
- package/dist/web-components/p-075a8dc8.entry.js +0 -1
- package/dist/web-components/p-0a34d33b.entry.js +0 -1
- package/dist/web-components/p-10cc9983.entry.js +0 -1
- package/dist/web-components/p-253068b9.entry.js +0 -1
- package/dist/web-components/p-3b8c8951.entry.js +0 -1
- package/dist/web-components/p-3beacdab.entry.js +0 -1
- package/dist/web-components/p-4214867d.entry.js +0 -1
- package/dist/web-components/p-42c857e9.entry.js +0 -1
- package/dist/web-components/p-44f87e16.entry.js +0 -1
- package/dist/web-components/p-477614c5.entry.js +0 -1
- package/dist/web-components/p-495ba3d2.entry.js +0 -1
- package/dist/web-components/p-4Uv3PpKT.js +0 -1
- package/dist/web-components/p-4de76291.entry.js +0 -1
- package/dist/web-components/p-55600d47.entry.js +0 -1
- package/dist/web-components/p-562051aa.entry.js +0 -1
- package/dist/web-components/p-5b850e0f.entry.js +0 -1
- package/dist/web-components/p-6013dfc8.entry.js +0 -1
- package/dist/web-components/p-62e7ae04.entry.js +0 -1
- package/dist/web-components/p-71519d37.entry.js +0 -1
- package/dist/web-components/p-88f7b47f.entry.js +0 -1
- package/dist/web-components/p-8975a6a3.entry.js +0 -1
- package/dist/web-components/p-8e125826.entry.js +0 -1
- package/dist/web-components/p-91cc0bde.entry.js +0 -1
- package/dist/web-components/p-93435fcd.entry.js +0 -1
- package/dist/web-components/p-947969d7.entry.js +0 -1
- package/dist/web-components/p-95396b5c.entry.js +0 -1
- package/dist/web-components/p-9de3a1a5.entry.js +0 -1
- package/dist/web-components/p-9f583ed1.entry.js +0 -1
- package/dist/web-components/p-B9rsR6cQ.js +0 -1
- package/dist/web-components/p-CTxpqopm.js +0 -2
- package/dist/web-components/p-DQuL1Twl.js +0 -1
- package/dist/web-components/p-DvLT8-y3.js +0 -1
- package/dist/web-components/p-a1086abe.entry.js +0 -1
- package/dist/web-components/p-bbba6d79.entry.js +0 -1
- package/dist/web-components/p-bde44ec4.entry.js +0 -1
- package/dist/web-components/p-bfc7e6c0.entry.js +0 -1
- package/dist/web-components/p-c1030394.entry.js +0 -1
- package/dist/web-components/p-c1f59ed1.entry.js +0 -1
- package/dist/web-components/p-c80a5541.entry.js +0 -1
- package/dist/web-components/p-c96ee61a.entry.js +0 -1
- package/dist/web-components/p-caf8f067.entry.js +0 -1
- package/dist/web-components/p-cc363c3d.entry.js +0 -1
- package/dist/web-components/p-cf4ff357.entry.js +0 -1
- package/dist/web-components/p-d0310ed4.entry.js +0 -1
- package/dist/web-components/p-d1412932.entry.js +0 -1
- package/dist/web-components/p-d2447e30.entry.js +0 -1
- package/dist/web-components/p-dc9cca06.entry.js +0 -1
- package/dist/web-components/p-e5b943a2.entry.js +0 -1
- package/dist/web-components/p-e67b13df.entry.js +0 -1
- package/dist/web-components/p-efec231a.entry.js +0 -1
- package/dist/web-components/p-f867e4c3.entry.js +0 -1
- package/dist/web-components/p-ky1yonnS.js +0 -1
- package/dist/web-components/web-components.esm.js +0 -1
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.d.ts +0 -24
- package/loader/index.es2017.js +0 -1
- package/loader/index.js +0 -2
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
-
|
|
3
|
-
const radioButtonCss = ":host{display:inline-flex;outline:none;position:relative;pointer-events:auto;border:0.0625rem solid transparent;cursor:pointer;min-width:17.5rem}:host slot{display:contents}:host(:hover:not([disabled]:not([disabled=false])):not([checked]:not([checked=false]))){--r-radio-button--cursor:pointer;--r-radio-button--box--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host(:active:not([disabled]:not([disabled=false])):not([checked]:not([checked=false]))){--r-radio-button--box--border-color:var(--r-border-regular, #282828);--r-radio-button--box--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host(:focus-within),:host(.focused){--r-radio-button--box--box-shadow:0 0 0 4px var(--r-border-focused-outlined, #fff);--r-radio-button--box--outline:2px solid var(--r-border-focused, #0071e3);--r-radio-button--box--outline-offset:1px}:host([checked]:not([checked=false])),:host([checked]:not([checked=false]):hover){cursor:default;--r-radio-button--box--border-color:var(--r-border-regular, #282828);--r-radio-button--box--background-color:var(--r-background-interactive-softest, #fff);--r-radio-button--marker--transform:scale(1)}:host([invalid]:not([invalid=false])),:host([invalid]:not([invalid=false])[checked]:not([checked=false])){--r-radio-button--box--border-color:var(--r-status-error-regular, #b00c15);--r-radio-button--box--background-color:var(--r-status-error-soft, #fef6f6)}:host([disabled]:not([disabled=false])){--r-radio-button--box--opacity:0.4;cursor:not-allowed}.r-radio-button{display:var(--r-radio-button--display, flex);flex:var(--r-radio-button--flex, 1);gap:var(--r-radio-button--gap, var(--r-spacing-075, 0.75rem));position:var(--r-radio-button--position, relative);min-height:var(--r-radio-button--min-height, 24px);user-select:var(--r-radio-button--user-select, none);box-sizing:var(--r-radio-button--box-sizing, border-box);font-family:var(--r-radio-button--font-family, var(--r-font-family-text, system-ui));font-size:var(--r-radio-button--font-size, var(--r-font-size-400, 1rem));line-height:var(--r-radio-button--line-height, var(--r-line-height-m, 1.5rem));text-align:var(--r-radio-button--text-align, left);color:var(--r-radio-button--color, var(--r-text-regular, #282828));opacity:var(--r-radio-button--opacity, 1);box-shadow:var(--r-radio-button--box-shadow, none);outline:var(--r-radio-button--outline, none);cursor:var(--r-radio-button--cursor, inherit);padding:var(--r-radio-button--padding, var(--r-spacing-100, 1rem));margin:var(--r-radio-button--margin, 0);background-color:var(--r-radio-button--background-color, transparent);border-color:var(--r-radio-button--border-color, transparent);border-width:var(--r-radio-button--border-width, 0);border-style:var(--r-radio-button--border-style, solid)}.r-radio-button--input{position:var(--r-radio-button--input--position, absolute);z-index:var(--r-radio-button--input--z-index, -1);opacity:var(--r-radio-button--input--opacity, 0)}.r-radio-button--box{position:var(--r-radio-button--box--position, relative);display:var(--r-radio-button--box--display, block);top:var(--r-radio-button--box--top, 0);left:var(--r-radio-button--box--left, 0);width:var(--r-radio-button--box--width, 1.5rem);height:var(--r-radio-button--box--height, 1.5rem);background-color:var(--r-radio-button--box--background-color, var(--r-background-interactive-softest, #fff));border-width:var(--r-radio-button--box--border-width, 0.0625rem);border-style:var(--r-radio-button--box--border-style, solid);border-color:var(--r-radio-button--box--border-color, var(--r-border-soft, #686868));border-radius:var(--r-radio-button--box--border-radius, 50%);box-sizing:var(--r-radio-button--box--box-sizing, border-box);box-shadow:var(--r-radio-button--box--box-shadow, none);outline:var(--r-radio-button--box--outline, none);outline-offset:var(--r-radio-button--box--outline-offset, 0);cursor:var(--r-radio-button--box--cursor, inherit);opacity:var(--r-radio-button--box--opacity, 1)}.r-radio-button--box::before{content:var(--r-radio-button--marker--content, \"\");display:var(--r-radio-button--marker--display, block);width:var(--r-radio-button--marker--width, 0.75rem);height:var(--r-radio-button--marker--height, 0.75rem);position:var(--r-radio-button--marker--position, absolute);top:var(--r-radio-button--marker--top, calc(50% - 0.375rem));left:var(--r-radio-button--marker--left, calc(50% - 0.375rem));border-radius:var(--r-radio-button--marker--border-radius, 50%);background-color:var(--r-radio-button--marker--background-color, var(--r-background-interactive-regular, #282828));transition:var(--r-radio-button--marker--transition, 0.1s all);transform:var(--r-radio-button--marker--transform, scale(0));transform-origin:var(--r-radio-button--marker--transform-origin, center)}.r-radio-button--text{flex:var(--r-radio-button--text--flex, 1);display:var(--r-radio-button--text--display, flex);flex-direction:var(--r-radio-button--text--flex-direction, column);gap:var(--r-radio-button--text--gap, var(--r-spacing-025, 0.25rem));font-weight:var(--r-radio-button--text--font-weight, var(--r-font-weight-semibold, 600))}.r-radio-button--leading{min-height:var(--r-radio-button--leading--min-height, var(--r-spacing-150, 1.5rem));min-width:var(--r-radio-button--leading--min-width, calc(var(--r-spacing-150, 1.5rem) + 2 * var(--r-spacing-075, 0.75rem)));color:var(--r-radio-button--leading--color, var(--r-icon-soft, #686868));display:var(--r-radio-button--leading--display, flex);justify-content:var(--r-radio-button--leading--justify-content, center);align-items:var(--r-radio-button--leading--align-items, start)}";
|
|
4
|
-
|
|
5
|
-
const RadioButton = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.rChange = createEvent(this, "rChange");
|
|
9
|
-
this.rReset = createEvent(this, "rReset");
|
|
10
|
-
this.radioButtonClick = createEvent(this, "radioButtonClick");
|
|
11
|
-
this.radioButtonKeydown = createEvent(this, "radioButtonKeydown");
|
|
12
|
-
this.radioButtonDeselect = createEvent(this, "radioButtonDeselect");
|
|
13
|
-
/** Value of element data within a form */
|
|
14
|
-
this.value = this.slotTextValue;
|
|
15
|
-
/** Automatically focus the radio button when the component is mounted. Note: Only one element per page should have autofocus set to true, following browser standard behavior. */
|
|
16
|
-
this.autofocus = false;
|
|
17
|
-
/** Unique id */
|
|
18
|
-
this.uniqueId = `r-radio-button-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
19
|
-
this.onClick = (event) => {
|
|
20
|
-
if (this.disabled)
|
|
21
|
-
return;
|
|
22
|
-
event.stopPropagation();
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
this.radioButtonClick.emit(event);
|
|
25
|
-
};
|
|
26
|
-
this.onKeydown = (event) => {
|
|
27
|
-
if (this.disabled)
|
|
28
|
-
return;
|
|
29
|
-
this.radioButtonKeydown.emit(event);
|
|
30
|
-
};
|
|
31
|
-
this.onFocus = () => {
|
|
32
|
-
this.host.classList.add('focused');
|
|
33
|
-
};
|
|
34
|
-
this.onBlur = () => {
|
|
35
|
-
this.host.classList.remove('focused');
|
|
36
|
-
};
|
|
37
|
-
this.applyAutofocus = () => {
|
|
38
|
-
queueMicrotask(() => {
|
|
39
|
-
this.setFocus();
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/** Sets focus on the radio button element */
|
|
44
|
-
async setFocus() {
|
|
45
|
-
var _a;
|
|
46
|
-
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
47
|
-
}
|
|
48
|
-
/** Blurs the radio button element */
|
|
49
|
-
async setBlur() {
|
|
50
|
-
var _a;
|
|
51
|
-
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.blur();
|
|
52
|
-
}
|
|
53
|
-
/** Selects the radio button element */
|
|
54
|
-
async select() {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
if (this.checked)
|
|
57
|
-
return;
|
|
58
|
-
if (this.disabled)
|
|
59
|
-
return;
|
|
60
|
-
(_a = this.radioElements) === null || _a === void 0 ? void 0 : _a.forEach(radio => {
|
|
61
|
-
radio.checked = false;
|
|
62
|
-
radio.shadowRoot.querySelector('.r-radio-button--input').setAttribute('tabindex', '-1');
|
|
63
|
-
});
|
|
64
|
-
this.checked = true;
|
|
65
|
-
(_b = this.nativeEl) === null || _b === void 0 ? void 0 : _b.setAttribute('tabindex', '0');
|
|
66
|
-
(_c = this.nativeEl) === null || _c === void 0 ? void 0 : _c.focus();
|
|
67
|
-
const { host, value, checked } = this;
|
|
68
|
-
this.rChange.emit({ element: host, value, checked });
|
|
69
|
-
}
|
|
70
|
-
/** Reference to the radio button elements */
|
|
71
|
-
get radioElements() {
|
|
72
|
-
if (this.groupEl) {
|
|
73
|
-
// Use :scope > to only select direct children, excluding nested radio-group buttons
|
|
74
|
-
return this.groupEl.querySelectorAll(`:scope > r-radio-button`);
|
|
75
|
-
}
|
|
76
|
-
if (this.parentFormEl) {
|
|
77
|
-
return this.parentFormEl.querySelectorAll(`r-radio-button[name=${this.name}]`);
|
|
78
|
-
}
|
|
79
|
-
return document.querySelectorAll(`r-radio-button[name=${this.name}]`);
|
|
80
|
-
}
|
|
81
|
-
/** Get the text content of the slot */
|
|
82
|
-
get slotTextValue() {
|
|
83
|
-
return this.host.textContent || null;
|
|
84
|
-
}
|
|
85
|
-
/** Identify wrapping radio group element */
|
|
86
|
-
get groupEl() {
|
|
87
|
-
return this.host.closest('r-radio-group') || null;
|
|
88
|
-
}
|
|
89
|
-
/** Identify wrapping form element */
|
|
90
|
-
get parentFormEl() {
|
|
91
|
-
return this.host.closest('form') || null;
|
|
92
|
-
}
|
|
93
|
-
/** Check if the radio button is leading */
|
|
94
|
-
get isLeading() {
|
|
95
|
-
return this.icon !== undefined || this.host.querySelector('[slot="leading"]') !== null || this.host.querySelector('r-radio-button-leading') !== null;
|
|
96
|
-
}
|
|
97
|
-
/** Check if the radio button is trailing */
|
|
98
|
-
get isTrailing() {
|
|
99
|
-
return this.host.querySelector('[slot="trailing"]') !== null || this.host.querySelector('r-radio-button-trailing') !== null;
|
|
100
|
-
}
|
|
101
|
-
get shouldAutofocus() {
|
|
102
|
-
return this.autofocus && (!this.groupEl || !this.groupEl.autofocus);
|
|
103
|
-
}
|
|
104
|
-
componentWillLoad() {
|
|
105
|
-
if (!this.initialState)
|
|
106
|
-
this.initialState = this.checked;
|
|
107
|
-
if (this.groupEl && !this.name) {
|
|
108
|
-
this.name = this.groupEl.name;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
componentDidLoad() {
|
|
112
|
-
if (this.shouldAutofocus)
|
|
113
|
-
this.applyAutofocus();
|
|
114
|
-
}
|
|
115
|
-
render() {
|
|
116
|
-
const { name, value, checked, disabled, hint, uniqueId, required, invalid, error, autofocus } = this;
|
|
117
|
-
const inputAttrs = {
|
|
118
|
-
type: 'radio',
|
|
119
|
-
tabindex: '-1',
|
|
120
|
-
name,
|
|
121
|
-
value,
|
|
122
|
-
disabled,
|
|
123
|
-
checked,
|
|
124
|
-
required,
|
|
125
|
-
autofocus
|
|
126
|
-
};
|
|
127
|
-
return (h(Host, { key: 'cf6b1b5db202773a2c6eea4df6a9303275054a73' }, h("label", { key: '4e203583a2b779e239c2893eadccc3514f84b0c4', class: "r-radio-button", onClick: this.onClick, onKeyDown: this.onKeydown }, h("input", Object.assign({ key: '14e89b050928abd51b66e8637c39bbd8da8e9856' }, inputAttrs, { id: `${uniqueId}-input`, class: "r-radio-button--input", ref: el => this.nativeEl = el, onFocus: this.onFocus, onBlur: this.onBlur })), h("span", { key: 'ee55afd60c5dbb947e9c12fffc401f7acfcefada', class: "r-radio-button--box" }), this.isLeading &&
|
|
128
|
-
h("div", { key: 'eabd27b399dee0bc2cef0fb7a92adad55095708b', class: "r-radio-button--leading" }, h("slot", { key: '5ec99653141268456cf9c8b2398f70c7b1afd36d', name: "leading" }, this.icon && h("r-icon", { key: '47662e84ad1aac02e867ddd040b5b7e1890ba986', name: this.icon, size: "m" }))), h("div", { key: 'bcaaf67c6cdf95a0bfa0dd5784d69c237e551a0e', class: "r-radio-button--text" }, h("slot", { key: 'a54f1823afe368d85f9bd4743ac0aa1df7298049', name: "title" }, h("div", { key: 'b531b659b920d7f064f10e622b83099d14270935', style: { display: 'contents' } }, h("slot", { key: 'b51f3e83234681804c49cb1043d90de70e4929db' }))), h("slot", { key: 'd217abfd3675898afd5b41a543200f7104019aed', name: "description" }, this.description)), this.isTrailing &&
|
|
129
|
-
h("div", { key: '664ddcc19dba3029343532caa13b05a6e3834977', class: "r-radio-button--trailing" }, h("slot", { key: 'b4ec626236a01c9c74b20ae09194ea414bc7699c', name: "trailing" }))), invalid && error &&
|
|
130
|
-
h("r-hint", { key: 'bd60d4337984662f410613b470b6e3be695343f5', role: "alert", variant: "error", id: `${uniqueId}-hint` }, this.error), hint &&
|
|
131
|
-
h("r-hint", { key: '31c5712fe6f2164219e28484a40ce5452a836743', role: "note", variant: "information", id: `${uniqueId}-hint` }, hint)));
|
|
132
|
-
}
|
|
133
|
-
get host() { return getElement(this); }
|
|
134
|
-
};
|
|
135
|
-
RadioButton.style = radioButtonCss;
|
|
136
|
-
|
|
137
|
-
export { RadioButton as r_radio_button };
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
-
import { a as appendControlToFormData } from './formData-DvLT8-y3.js';
|
|
3
|
-
|
|
4
|
-
const radioGroupCss = ":host{display:flex;flex-direction:column;box-sizing:border-box;margin-bottom:var(--r-spacing-100)}:host ::slotted(r-radio-button){display:var(--r-radio-group--slotted-radio-button--display, flex)}:host ::slotted(.focused){--r-radio-button--box-shadow:0 0 0 3px var(--r-border-focused-outlined, #fff), inset 0 0 0 1px var(--r-border-focused-outlined, #fff);--r-radio-button--outline:2px solid var(--r-border-focused, #0071e3);--r-radio-button--outline-offset:2px}:host slot{display:contents}:host([variant=contained]) ::slotted(r-radio-button){padding:0;--r-radio-button--padding:var(--r-spacing-100, 1rem);--r-radio-button--border-color:var(--r-border-soft, #686868);--r-radio-button--border-width:1px}:host([invalid]:not([invalid=false])) ::slotted(r-radio-button){--r-radio-button--box--border-color:var(--r-status-error-regular, #b00c15);--r-radio-button--box--background-color:var(--r-status-error-soft, #fef6f6);--r-radio-button--marker--background-color:var(--r-status-error-regular, #b00c15)}:host .r-radio-group{display:var(--r-radio-group--display, flex);flex-direction:var(--r-radio-group--flex-direction, column);padding:var(--r-radio-group--padding, 0);margin:var(--r-radio-group--margin, 0);border:var(--r-radio-group--border, none)}:host .r-radio-group--label-container{display:var(--r-radio-group--label-container--display, flex);gap:var(--r-radio-group--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-radio-group--label-container--align-items, center);justify-content:var(--r-radio-group--label-container--justify-content, space-between)}:host .r-radio-group--label-container ::slotted([slot=popover]){display:var(--r-radio-group--popover--display, inline-flex);height:var(--r-radio-group--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-radio-group--popover--align-items, center);justify-content:var(--r-radio-group--popover--justify-content, center);margin-right:var(--r-radio-group--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-radio-group--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-radio-group--popover--trigger--min-height, var(--r-spacing-150, 1.5))}:host .r-radio-group--hint{margin-bottom:var(--r-radio-group--hint--margin-bottom, var(--r-spacing-100, 1rem))}:host .r-radio-group--content{display:var(--r-radio-group--content--display, flex);flex-direction:var(--r-radio-group--content--flex-direction, column);flex-wrap:var(--r-radio-group--content--flex-wrap, nowrap);gap:var(--r-radio-group--content--gap, var(--r-spacing-050, 0.5rem))}:host .r-radio-group+.r-radio-group--message r-hint{margin-top:var(--r-radio-group--hint--margin-top, var(--r-spacing-050, 0.5rem))}";
|
|
5
|
-
|
|
6
|
-
const RadioGroup = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.rValidate = createEvent(this, "rValidate");
|
|
10
|
-
this.rChange = createEvent(this, "rChange");
|
|
11
|
-
this.rReset = createEvent(this, "rReset");
|
|
12
|
-
/** Controls the style variation of the radio buttons. */
|
|
13
|
-
this.variant = 'standard';
|
|
14
|
-
/**
|
|
15
|
-
* When set to `true`, automatically focuses the first enabled radio button in the group on mount.
|
|
16
|
-
* This will focus the selected radio button if one exists, or the first enabled radio button otherwise.
|
|
17
|
-
*/
|
|
18
|
-
this.autofocus = false;
|
|
19
|
-
this.validityState = '';
|
|
20
|
-
this.validityMessage = '';
|
|
21
|
-
/**
|
|
22
|
-
* Initial attributes state
|
|
23
|
-
* */
|
|
24
|
-
this.initial = {};
|
|
25
|
-
/** Unique id */
|
|
26
|
-
this.uniqueId = `r-radio-group-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
27
|
-
this.getValidityStateData = element => {
|
|
28
|
-
let validityState = '';
|
|
29
|
-
let validityMessage = '';
|
|
30
|
-
if (element === null)
|
|
31
|
-
return { validityState, validityMessage };
|
|
32
|
-
for (const state in element.validity) {
|
|
33
|
-
if (element.validity[state]) {
|
|
34
|
-
validityState = state;
|
|
35
|
-
if (this[state + 'Message']) {
|
|
36
|
-
validityMessage = this[state + 'Message'];
|
|
37
|
-
return { validityState, validityMessage };
|
|
38
|
-
}
|
|
39
|
-
validityMessage = element.validationMessage;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return { validityState, validityMessage };
|
|
43
|
-
};
|
|
44
|
-
this.validateFormElement = (element = null) => {
|
|
45
|
-
if (element === null)
|
|
46
|
-
return;
|
|
47
|
-
if (this.isNoValidate)
|
|
48
|
-
return;
|
|
49
|
-
if (this.error)
|
|
50
|
-
return;
|
|
51
|
-
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
52
|
-
this.validityState = validityState;
|
|
53
|
-
this.validityMessage = validityMessage;
|
|
54
|
-
const isValid = this.validityState === 'valid';
|
|
55
|
-
this.valid = isValid;
|
|
56
|
-
this.invalid = !isValid;
|
|
57
|
-
this.rValidate.emit({
|
|
58
|
-
state: this.validityState,
|
|
59
|
-
message: this.validityMessage
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
this.onSubmitForm = (event) => {
|
|
63
|
-
if (this.isNoValidate)
|
|
64
|
-
return;
|
|
65
|
-
this.validateFormElement(this.nativeSelectedEl || this.nativeFirstEl);
|
|
66
|
-
if (!this.hasSelected || this.invalid) {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
this.onResetForm = () => {
|
|
72
|
-
this.reset();
|
|
73
|
-
};
|
|
74
|
-
this.onLabelClick = () => {
|
|
75
|
-
const radioButtonEl = this.radioButtonElements[0].shadowRoot.querySelector('[type="radio"]');
|
|
76
|
-
radioButtonEl === null || radioButtonEl === void 0 ? void 0 : radioButtonEl.focus();
|
|
77
|
-
};
|
|
78
|
-
this.contributeToFormData = (event) => {
|
|
79
|
-
appendControlToFormData(this.host, event.formData);
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Handles parent radio group value changes for nested groups.
|
|
83
|
-
* If this is a nested group with a parentValue specified, it will reset when
|
|
84
|
-
* the parent group's value changes to something other than the parentValue.
|
|
85
|
-
*/
|
|
86
|
-
this.onParentGroupChange = (event) => {
|
|
87
|
-
// Only proceed if this group has a parentValue specified (indicating it's nested)
|
|
88
|
-
if (!this.parentValue)
|
|
89
|
-
return;
|
|
90
|
-
const parentNewValue = event.detail.value;
|
|
91
|
-
// If parent changed to a different value than our parentValue, reset this nested group
|
|
92
|
-
if (parentNewValue !== this.parentValue) {
|
|
93
|
-
this.clearValue();
|
|
94
|
-
// Emit rReset event to notify that the nested group was automatically reset
|
|
95
|
-
this.rReset.emit({
|
|
96
|
-
element: this.host,
|
|
97
|
-
value: null
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
rChangeAction(event) {
|
|
103
|
-
// Only handle events from direct children, not from nested radio-groups
|
|
104
|
-
const targetElement = event.target;
|
|
105
|
-
const isDirectChild = targetElement.parentElement === this.host;
|
|
106
|
-
if (!isDirectChild) {
|
|
107
|
-
return; // Ignore events from nested radio-groups
|
|
108
|
-
}
|
|
109
|
-
// Stop event from bubbling to parent radio-groups
|
|
110
|
-
event.stopPropagation();
|
|
111
|
-
this.resetValidity();
|
|
112
|
-
this.setValue(event.detail.value);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Resets the radio group to its initial state.
|
|
116
|
-
* This method clears the validity state and message, and sets the value and validity
|
|
117
|
-
* to their initial values.
|
|
118
|
-
*/
|
|
119
|
-
radioButtonClickAction(event) {
|
|
120
|
-
// Only handle events from direct children, not from nested radio-groups
|
|
121
|
-
const targetElement = event.target;
|
|
122
|
-
const isDirectChild = targetElement.parentElement === this.host;
|
|
123
|
-
if (!isDirectChild) {
|
|
124
|
-
return; // Ignore events from nested radio-groups
|
|
125
|
-
}
|
|
126
|
-
// Stop event from bubbling to parent radio-groups
|
|
127
|
-
event.stopPropagation();
|
|
128
|
-
!event.target.disabled && event.target.select();
|
|
129
|
-
}
|
|
130
|
-
get selectedIndex() {
|
|
131
|
-
return Array.from(this.radioButtonElements).findIndex(el => el.hasAttribute('checked'));
|
|
132
|
-
}
|
|
133
|
-
get prevIndex() {
|
|
134
|
-
const isNoSelected = this.selectedIndex === -1;
|
|
135
|
-
const isnativeFirstElement = this.selectedIndex === 0;
|
|
136
|
-
return isnativeFirstElement || isNoSelected ? this.radioButtonElements.length - 1 : this.selectedIndex - 1;
|
|
137
|
-
}
|
|
138
|
-
get focusedRadioButtonEl() {
|
|
139
|
-
// Query all descendants to find focused element, but it will only be used for direct children
|
|
140
|
-
return this.host.querySelector('r-radio-button.focused');
|
|
141
|
-
}
|
|
142
|
-
get focusedRadioButtonElIndex() {
|
|
143
|
-
return Array.from(this.radioButtonElements).indexOf(this.focusedRadioButtonEl);
|
|
144
|
-
}
|
|
145
|
-
get nextIndex() {
|
|
146
|
-
const isNoSelected = this.selectedIndex === -1;
|
|
147
|
-
if (isNoSelected) {
|
|
148
|
-
return this.focusedRadioButtonElIndex === -1 ? 0 : this.focusedRadioButtonElIndex + 1;
|
|
149
|
-
}
|
|
150
|
-
const isLastElement = this.selectedIndex === this.radioButtonElements.length - 1;
|
|
151
|
-
return isLastElement ? 0 : this.selectedIndex + 1;
|
|
152
|
-
}
|
|
153
|
-
radioButtonKeydownAction(event) {
|
|
154
|
-
var _a;
|
|
155
|
-
// Only handle events from direct children, not from nested radio-groups
|
|
156
|
-
const targetElement = event.target;
|
|
157
|
-
const isDirectChild = targetElement.parentElement === this.host;
|
|
158
|
-
if (!isDirectChild) {
|
|
159
|
-
return; // Ignore events from nested radio-groups
|
|
160
|
-
}
|
|
161
|
-
// Stop event from bubbling to parent radio-groups
|
|
162
|
-
event.stopPropagation();
|
|
163
|
-
switch (event.detail.code) {
|
|
164
|
-
case 'ArrowUp':
|
|
165
|
-
case 'ArrowLeft':
|
|
166
|
-
// Select previous radio button
|
|
167
|
-
this.radioButtonElements[this.prevIndex].select();
|
|
168
|
-
break;
|
|
169
|
-
case 'ArrowDown':
|
|
170
|
-
case 'ArrowRight':
|
|
171
|
-
// Select next radio button
|
|
172
|
-
this.radioButtonElements[this.nextIndex].select();
|
|
173
|
-
break;
|
|
174
|
-
case 'Enter': {
|
|
175
|
-
const submitEl = this.host.querySelector('[type="submit"]') ||
|
|
176
|
-
((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.querySelector('[type="submit"]'));
|
|
177
|
-
if (submitEl && 'triggerClick' in submitEl) {
|
|
178
|
-
submitEl === null || submitEl === void 0 ? void 0 : submitEl.triggerClick();
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
this.parentFormEl.requestSubmit();
|
|
182
|
-
}
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Resets the validity state and message of the radio group.
|
|
189
|
-
* This method clears the validity message and state, and sets the invalid
|
|
190
|
-
* property to its initial value.
|
|
191
|
-
*/
|
|
192
|
-
async resetValidity() {
|
|
193
|
-
this.validityMessage = null;
|
|
194
|
-
this.validityState = null;
|
|
195
|
-
this.invalid = this.initial['invalid'];
|
|
196
|
-
this.valid = !this.invalid;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Resets the radio group to its initial state.
|
|
200
|
-
*
|
|
201
|
-
* This method:
|
|
202
|
-
* - clears the validity state and message,
|
|
203
|
-
* - sets the value and validity to initial values,
|
|
204
|
-
* - if no initial value the radio group will be deselected,
|
|
205
|
-
* - restores the tabindex on the first element.
|
|
206
|
-
*/
|
|
207
|
-
async reset() {
|
|
208
|
-
this.resetValidity();
|
|
209
|
-
if (this.initial['value']) {
|
|
210
|
-
this.setValue(this.initial['value']);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
// Set default value to null
|
|
214
|
-
this.clearValue();
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Sets the value of the radio group to the specified value.
|
|
218
|
-
* If a radio button with the specified value exists, it will be selected.
|
|
219
|
-
*
|
|
220
|
-
* @param value - The value to set for the radio group.
|
|
221
|
-
*/
|
|
222
|
-
async setValue(value) {
|
|
223
|
-
const element = Array.from(this.radioButtonElements).find(el => el.value === value);
|
|
224
|
-
if (element === undefined) {
|
|
225
|
-
this.clearValue();
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
this.value = value;
|
|
229
|
-
element === null || element === void 0 ? void 0 : element.select();
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Gets the current value of the radio group.
|
|
233
|
-
*
|
|
234
|
-
* @returns The current value of the radio group.
|
|
235
|
-
*/
|
|
236
|
-
async getValue() {
|
|
237
|
-
return this.value || null;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Clears the value of the radio group and deselects all radio buttons.
|
|
241
|
-
* This method sets the value to null and deselects all radio buttons in the group.
|
|
242
|
-
*/
|
|
243
|
-
async clearValue() {
|
|
244
|
-
var _a, _b, _c, _d, _e, _f;
|
|
245
|
-
const isSelectedEqualsFirst = ((_a = this.nativeSelectedEl) === null || _a === void 0 ? void 0 : _a.value) === ((_b = this.nativeFirstEl) === null || _b === void 0 ? void 0 : _b.value);
|
|
246
|
-
if (!isSelectedEqualsFirst) {
|
|
247
|
-
(_c = this.nativeSelectedEl) === null || _c === void 0 ? void 0 : _c.setAttribute('tabindex', '-1');
|
|
248
|
-
}
|
|
249
|
-
(_d = this.nativeSelectedEl) === null || _d === void 0 ? void 0 : _d.setAttribute('tabindex', '-1');
|
|
250
|
-
(_e = this.nativeFirstEl) === null || _e === void 0 ? void 0 : _e.setAttribute('tabindex', '0');
|
|
251
|
-
(_f = this.selectedRadioButtonElement) === null || _f === void 0 ? void 0 : _f.removeAttribute('checked');
|
|
252
|
-
this.value = null;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Validates the radio group without triggering UI and returns a boolean indicating its validity.
|
|
256
|
-
* @returns A boolean indicating whether the radio group is valid.
|
|
257
|
-
*/
|
|
258
|
-
async checkValidity() {
|
|
259
|
-
const element = this.nativeSelectedEl || this.nativeFirstEl || null;
|
|
260
|
-
const { validityState } = this.getValidityStateData(element);
|
|
261
|
-
return validityState === 'valid';
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Validates the radio group and displays the validity state.
|
|
265
|
-
*/
|
|
266
|
-
async reportValidity() {
|
|
267
|
-
const element = this.nativeSelectedEl || this.nativeFirstEl || null;
|
|
268
|
-
this.validateFormElement(element);
|
|
269
|
-
return this.validityState === 'valid';
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Sets a custom validity message for the radio group.
|
|
273
|
-
* If the message is not empty, the radio group will be considered invalid.
|
|
274
|
-
*
|
|
275
|
-
* @param message - The custom validity message to set.
|
|
276
|
-
*/
|
|
277
|
-
async setCustomValidity(message) {
|
|
278
|
-
const element = this.nativeSelectedEl || this.nativeFirstEl || null;
|
|
279
|
-
this.customErrorMessage = message;
|
|
280
|
-
this.validateFormElement(element);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Sets focus on the radio button element.
|
|
284
|
-
* */
|
|
285
|
-
async setFocus() {
|
|
286
|
-
const element = this.selectedRadioButtonElement || this.radioButtonElements[0] || null;
|
|
287
|
-
element === null || element === void 0 ? void 0 : element.setFocus();
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Blurs the radio button element.
|
|
291
|
-
* */
|
|
292
|
-
async setBlur() {
|
|
293
|
-
var _a;
|
|
294
|
-
(_a = this.focusedRadioButtonEl) === null || _a === void 0 ? void 0 : _a.setBlur();
|
|
295
|
-
}
|
|
296
|
-
/** Determine whether this element should be ignored during Constraint Validation API validation. */
|
|
297
|
-
get isNoValidate() {
|
|
298
|
-
var _a;
|
|
299
|
-
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
300
|
-
this.novalidate ||
|
|
301
|
-
!this.required ||
|
|
302
|
-
false);
|
|
303
|
-
}
|
|
304
|
-
/** Identify wrapping form element */
|
|
305
|
-
get parentFormEl() {
|
|
306
|
-
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
307
|
-
}
|
|
308
|
-
get radioButtonElements() {
|
|
309
|
-
// Use :scope > to only select direct children, excluding nested radio-group buttons
|
|
310
|
-
return this.host.querySelectorAll(':scope > r-radio-button:not([disabled]:not([disabled="false"]))');
|
|
311
|
-
}
|
|
312
|
-
get selectedRadioButtonElement() {
|
|
313
|
-
return Array.from(this.radioButtonElements).find(el => el.checked || el.hasAttribute('checked')) || null;
|
|
314
|
-
}
|
|
315
|
-
get hasSelected() {
|
|
316
|
-
return Array.from(this.radioButtonElements).some(el => el.checked || el.hasAttribute('checked'));
|
|
317
|
-
}
|
|
318
|
-
get nativeSelectedEl() {
|
|
319
|
-
var _a, _b;
|
|
320
|
-
if (this.selectedRadioButtonElement === null)
|
|
321
|
-
return null;
|
|
322
|
-
return ((_b = (_a = this.selectedRadioButtonElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.r-radio-button--input')) || null;
|
|
323
|
-
}
|
|
324
|
-
get nativeFirstEl() {
|
|
325
|
-
var _a, _b;
|
|
326
|
-
return ((_b = (_a = this.radioButtonElements[0]) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.r-radio-button--input')) || null;
|
|
327
|
-
}
|
|
328
|
-
passPropsToGroupItems(props = {}) {
|
|
329
|
-
Object.entries(props).forEach(([key, value]) => {
|
|
330
|
-
this.radioButtonElements.forEach(el => {
|
|
331
|
-
if (typeof value === 'string')
|
|
332
|
-
el.setAttribute(key, value);
|
|
333
|
-
if (typeof value === 'boolean' && value)
|
|
334
|
-
el.setAttribute(key, '');
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
selectGroupItemByValue() {
|
|
339
|
-
if (this.hasSelected && !this.value) {
|
|
340
|
-
this.value = this.selectedRadioButtonElement.value;
|
|
341
|
-
}
|
|
342
|
-
this.setValue(this.value);
|
|
343
|
-
}
|
|
344
|
-
setTabindex() {
|
|
345
|
-
const el = this.nativeSelectedEl || this.nativeFirstEl;
|
|
346
|
-
el === null || el === void 0 ? void 0 : el.setAttribute('tabindex', '0');
|
|
347
|
-
}
|
|
348
|
-
get parentRadioGroup() {
|
|
349
|
-
var _a;
|
|
350
|
-
// Find the parent radio group element
|
|
351
|
-
return ((_a = this.host.parentElement) === null || _a === void 0 ? void 0 : _a.closest('r-radio-group')) || null;
|
|
352
|
-
}
|
|
353
|
-
connectFormEventListeners() {
|
|
354
|
-
var _a, _b, _c;
|
|
355
|
-
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('formdata', this.contributeToFormData);
|
|
356
|
-
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.addEventListener('reset', this.onResetForm);
|
|
357
|
-
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
358
|
-
}
|
|
359
|
-
disconnectFormEventListeners() {
|
|
360
|
-
var _a, _b, _c;
|
|
361
|
-
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('formdata', this.contributeToFormData);
|
|
362
|
-
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('reset', this.onResetForm);
|
|
363
|
-
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('submit', this.onSubmitForm);
|
|
364
|
-
}
|
|
365
|
-
connectParentGroupListener() {
|
|
366
|
-
// Only connect if this is a nested group (has parentValue specified)
|
|
367
|
-
if (this.parentValue && this.parentRadioGroup) {
|
|
368
|
-
this.parentRadioGroup.addEventListener('rChange', this.onParentGroupChange);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
disconnectParentGroupListener() {
|
|
372
|
-
if (this.parentValue && this.parentRadioGroup) {
|
|
373
|
-
this.parentRadioGroup.removeEventListener('rChange', this.onParentGroupChange);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
get ariaDescribedBy() {
|
|
377
|
-
const messageId = `${this.uniqueId}-message`;
|
|
378
|
-
return this.hint ? `${this.uniqueId}-hint ${messageId}` : messageId;
|
|
379
|
-
}
|
|
380
|
-
connectedCallback() {
|
|
381
|
-
this.connectFormEventListeners();
|
|
382
|
-
this.connectParentGroupListener();
|
|
383
|
-
}
|
|
384
|
-
disconnectedCallback() {
|
|
385
|
-
this.disconnectFormEventListeners();
|
|
386
|
-
this.disconnectParentGroupListener();
|
|
387
|
-
}
|
|
388
|
-
componentWillLoad() {
|
|
389
|
-
const { required, name } = this;
|
|
390
|
-
this.passPropsToGroupItems({ required, name });
|
|
391
|
-
// If `value` is provided: item within group with such value shall be selected
|
|
392
|
-
this.selectGroupItemByValue();
|
|
393
|
-
this.initial['value'] = this.value;
|
|
394
|
-
this.initial['invalid'] = this.invalid;
|
|
395
|
-
}
|
|
396
|
-
componentDidLoad() {
|
|
397
|
-
const { name, required } = this;
|
|
398
|
-
this.passPropsToGroupItems({ name, required });
|
|
399
|
-
this.setTabindex();
|
|
400
|
-
if (this.autofocus) {
|
|
401
|
-
// Use setTimeout to ensure setValue has completed and checked state is synced
|
|
402
|
-
setTimeout(() => {
|
|
403
|
-
this.setFocus();
|
|
404
|
-
}, 0);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
render() {
|
|
408
|
-
const { label, hint, fieldIndicator, error, uniqueId, invalid } = this;
|
|
409
|
-
const fieldsetAttrs = {
|
|
410
|
-
'aria-invalid': `${invalid || false}`,
|
|
411
|
-
'aria-describedby': this.ariaDescribedBy
|
|
412
|
-
};
|
|
413
|
-
return (h(Host, { key: 'bd1b1d42f3efab78cf0a2cce7b1a1e2568f21765' }, h("fieldset", Object.assign({ key: 'c449667b014cf8aeea4176b0d94c82573b661182', class: "r-radio-group" }, fieldsetAttrs, { onClick: this.onLabelClick }), label &&
|
|
414
|
-
h("legend", { key: '212e27fd8d20b31cf6d84078870ec59796bb59c6', class: "r-radio-group--label-container" }, h("r-label", { key: '69907b0e2bdb49bcdea00d1849bc0c5c4d3404ae', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, label), h("slot", { key: 'd208c147248154ba26ecc5b412233d2cf479bb68', name: "popover" })), hint &&
|
|
415
|
-
h("r-hint", { key: 'b409e053226d88ac3619524b2d63864b49972985', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), h("div", { key: 'c8e98214e9b14f6fdcf97677b392abd14d653a56', class: "r-radio-group--content" }, h("slot", { key: '5e4aa07801e8f1bd7ec3262511d28f553d8740a7' })), h("div", { key: 'a576e8c91d33877eb677d5551ac18d10924586fd', id: `${uniqueId}-message`, "aria-live": "polite", role: "alert", class: "r-radio-group--message" }, invalid && error &&
|
|
416
|
-
h("r-hint", { key: '98f7fa6855c0803ae5d31a3a248c146679204af9', variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
417
|
-
h("r-hint", { key: 'de1997af842a7e5fdb887a830fd0fe701e4fa5ce', variant: "error" }, this.customErrorMessage || this.validityMessage)))));
|
|
418
|
-
}
|
|
419
|
-
get host() { return getElement(this); }
|
|
420
|
-
};
|
|
421
|
-
RadioGroup.style = radioGroupCss;
|
|
422
|
-
|
|
423
|
-
export { RadioGroup as r_radio_group };
|