@riverty/web-components 6.2.1 → 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 +24 -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.css +0 -52
- package/dist/collection/components/illustration/illustration.js +0 -540
- 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-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-ff6b1b8f.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,1101 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-BnETQtSf.js');
|
|
4
|
-
var formData = require('./formData-B2DZyLxP.js');
|
|
5
|
-
var styleObserver = require('./style-observer-D9zSP9wP.js');
|
|
6
|
-
|
|
7
|
-
const selectCss = ":host{display:inline-flex;flex-direction:column;width:var(--width, auto);transition:width 0.2s ease-out;max-width:none;opacity:1;outline:none}:host slot{display:contents}:host(:hover:not([disabled]:not([disabled=false]))){--r-select--container--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([expanded]:not([expanded=false])){--r-select--options--visibility:visible;--r-select--options--z-index:1;--r-select--background-color:var(--r-background-interactive-softest, #fff);--r-select--value--border-color:var(--r-border-soft, #686868);--r-select--value--background-color:var(--r-background-interactive-softest, #fff);--r-select--trailing-icon--transform:rotate(180deg)}:host([invalid]:not([invalid=false])){--r-select--container--background-color:var(--r-status-error-soft, #fef6f6);--r-select--value--border-color:var(--r-status-error-regular, #b00c15);--r-select--options--border-color:var(--r-status-error-regular, #b00c15)}:host([disabled]:not([disabled=false])){--r-select--opacity:0.4;--r-select--pointer-events:none;--r-select--cursor:not-allowed}:host([data-is-placeholder=true]){--r-select--value-diplay--color:var(--r-text-soft, #686868)}:host([data-max-width=set]){width:100%;--r-select--options--right:0}:host([full-width]){width:100%}:host([data-listbox-position=top]){--r-select--options--top:auto;--r-select--options--bottom:2.875em;--r-select--options--border-width:1px 1px 0 1px}:host([data-listbox-position=bottom]){--r-select--options--top:100%;--r-select--options--bottom:auto;--r-select--options--border-width:0 1px 1px 1px}:host([data-readonly=true]){--r-select--color:var(--r-text-soft, #686868);--r-select--value--background-color:var(--r-background-soft, #f3f1f0);--r-select--value--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-select--value--cursor:text;--r-select--value-arrow--visiblility:hidden}.r-select{display:var(--r-select--display, flex);flex-grow:var(--r-select--flex-grow, 1);flex-direction:var(--r-select--flex-direction, column);position:var(--r-select--position, relative);box-sizing:var(--r-select--box-sizing, border-box);max-width:var(--r-select--max-width, 100%);min-width:var(--r-select--min-width, fit-content);font-family:var(--r-select--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-select--font-weight, var(--r-font-weight-regular, 400));font-size:var(--r-select--font-size, var(--r-font-size-400, 1rem));text-align:var(--r-select--text-align, left);color:var(--r-select--color, var(--r-text-regular, #282828));opacity:var(--r-select--opacity, 1);pointer-events:var(--r-select--pointer-events, auto);cursor:var(--r-select--cursor, pointer)}.r-select--label__margin-bottom{margin-bottom:var(--r-select--label--margin-bottom, var(--r-spacing-025, 0.25rem))}.r-select--label-container{display:var(--r-select--label-container--display, flex);gap:var(--r-select--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-select--label-container--align-items, center);justify-content:var(--r-select--label-container--align-items, space-between)}.r-select--label-container ::slotted([slot=popover]){display:var(--r-select--popover--display, inline-flex);height:var(--r-select--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-select--popover--align-items, center);justify-content:var(--r-select--popover--justify-content, center);margin-right:var(--r-select--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-select--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-select--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-select--trailing-icon{transform:var(--r-select--trailing-icon--transform, rotate(0deg));transition:var(--r-select--trailing-icon--transition, transform 0.15s)}.r-select ::slotted([name=leading]){display:var(--r-select--value--leading-icon--display, flex);align-items:var(--r-select--value--leading-icon--align-items, center);color:var(--r-select--value--leading-icon--color, var(--r-icon-soft, #686868))}.r-select--container{background-color:var(--r-select--container--background-color, var(--r-background-softest, #fff));opacity:var(--r-select--container--opacity, 1);pointer-events:var(--r-select--container--pointer-events, auto)}.r-select--input{height:var(--r-select--input--height, 100%);width:var(--r-select--input--width, 100%);border:var(--r-select--input--border, none);outline:var(--r-select--input--outline, none);background-color:var(--r-select--input--background-color, inherit);color:var(--r-select--input--color, inherit);font-family:var(--r-select--input--font-family, inherit);font-size:var(--r-select--input--font-size, inherit);font-weight:var(--r-select--input--font-weight, inherit);padding:var(--r-select--input--padding, 0)}.r-select--native{position:var(--r-select--native--position, fixed);top:var(--r-select--native--top, -100vh);z-index:var(--r-select--native--z-index, -1);opacity:var(--r-select--native--opacity, 0);font-size:var(--r-select--native--font-size, 1rem);padding:var(--r-select--native--padding, 0 calc(48px + 0.75em) 0 0.75em)}.r-select--value:not([aria-readonly=true]):not(:has(input:read-only)):not(:has(input:disabled)):active{--r-select--value--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}.r-select--value[aria-disabled=false]:focus,.r-select--value:has(input:focus){outline:var(--r-select--value--outline, none);--r-select--value--z-index:2;--r-select--value--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-select--value--outline:2px solid var(--r-border-focused, #0071e3);--r-select--value--outline-offset:2px}.r-select--value{position:var(--r-select--value--position, relative);display:var(--r-select--value--display, inline-grid);grid-template-columns:var(--r-select--value--grid-template-columns, 1fr 1.75rem);box-sizing:var(--r-select--value--box-sizing, border-box);align-items:var(--r-select--value--align-items, center);justify-content:var(--r-select--value--justify-content, space-between);text-align:var(--r-select--value--text-align, left);min-width:var(--r-select--value--min-width, 100%);min-height:var(--r-select--value--min-height, var(--r-spacing-275, 2.75rem));padding:var(--r-select--value--padding, 0);white-space:var(--r-select--value--white-space, nowrap);background-color:var(--r-select--value--background-color, transparent);border-width:var(--r-select--value--border-width, 1px);border-style:var(--r-select--value--border-style, solid);border-color:var(--r-select--value--border-color, var(--r-border-soft, #686868));box-shadow:var(--r-select--value--box-shadow, none);outline:var(--r-select--value--outline, none);outline-offset:var(--r-select--value--outline-offset, 0);z-index:var(--r-select--value--z-index, 0);cursor:var(--r-select--value--cursor, inherit)}.r-select--value-display{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.5em);align-items:var(--r-select--value-diplay--align-tems, center);flex:var(--r-select--value-diplay--flex, 1);padding:var(--r-select--value-diplay--padding, 0 0.75em);overflow:var(--r-select--value-diplay--overflow, hidden);text-overflow:var(--r-select--value-diplay--text-overflow, ellipsis);color:var(--r-select--value-diplay--color, inherit);min-width:var(--r-select--value-diplay--min-width, fit-content);height:var(--r-select--value-diplay--height, 100%)}.r-select--value-selected{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.75em);align-items:var(--r-select--value-diplay--align-items, center)}.r-select--value-arrow{display:var(--r-select--value-arrow--display, flex);align-items:var(--r-select--value-arrow--align-items, center);justify-content:var(--r-select--value-arrow--justify-content, center);padding:var(--r-select--value-arrow--padding, 0 0.75em 0 0);visibility:var(--r-select--value-arrow--visiblility, visible)}.r-select--value-arrow-button{height:var(--r-select--value-arrow-button--height, 100%);background-color:var(--r-select--value-arrow-button--background-color, transparent);color:var(--r-select--value-arrow-button--color, inherit);border:var(--r-select--value-arrow-button--border, none);outline:var(--r-select--value-arrow-button--outline, none);cursor:var(--r-select--value-arrow-button--cursor, inherit)}.r-select--options{visibility:var(--r-select--options--visibility, hidden);position:var(--r-select--options--position, absolute);top:var(--r-select--options--top, 100%);right:var(--r-select--options--right, 0);bottom:var(--r-select--options--bottom, auto);left:var(--r-select--options--left, 0);margin:var(--r-select--options--margin, 0);padding:var(--r-select--options--padding, 0);list-style:var(--r-select--options--list-style, none);max-height:var(--r-select--options--max-height, 14.375em);min-width:var(--r-select--options--min-width, fit-content);overflow-y:var(--r-select--options--overflow-y, auto);background-color:var(--r-select--options--background-color, var(--r-background-interactive-softest, #fff));border-style:var(--r-select--options--border-style, solid);border-color:var(--r-select--options--border-color, var(--r-border-soft, #686868));border-width:var(--r-select--options--border-width, 0 1px 1px 1px);z-index:var(--r-select--options--z-index, -1)}.r-select--message{margin-top:var(--r-select--message--margin-top, var(--r-spacing-025, 0.25rem))}.hidden{display:none}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}@media (prefers-reduced-motion){:host{transition:none}}";
|
|
8
|
-
|
|
9
|
-
const Select = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.rValidate = index.createEvent(this, "rValidate");
|
|
13
|
-
this.rChange = index.createEvent(this, "rChange");
|
|
14
|
-
this.rReset = index.createEvent(this, "rReset");
|
|
15
|
-
/** Define if select should render as a text item or a block */
|
|
16
|
-
this.fullWidth = false;
|
|
17
|
-
/** Define wether listbox appears on top or at the bottom of the select */
|
|
18
|
-
this.listboxPosition = 'bottom';
|
|
19
|
-
/**
|
|
20
|
-
* Defines aria label for combobox toggle button
|
|
21
|
-
* @default "Toggle combobox"
|
|
22
|
-
*/
|
|
23
|
-
this.toggleButtonAriaLabel = 'Toggle combobox';
|
|
24
|
-
/**
|
|
25
|
-
* Defines the text that will be displayed if no results are found
|
|
26
|
-
* @default "No results found"
|
|
27
|
-
*/
|
|
28
|
-
this.noResultsFound = 'No results found';
|
|
29
|
-
/** Custom validity state passed after validation */
|
|
30
|
-
this.validityState = '';
|
|
31
|
-
/** Custom validity message passed after validation */
|
|
32
|
-
this.validityMessage = '';
|
|
33
|
-
/** Is select expanded */
|
|
34
|
-
this.isExpanded = false;
|
|
35
|
-
/** Current state, reflecting if select is readonly */
|
|
36
|
-
this.isReadonly = false;
|
|
37
|
-
/** Save current value */
|
|
38
|
-
this.currentValue = '';
|
|
39
|
-
/** Value that must be displayed as selected option */
|
|
40
|
-
this.valueToDisplay = '';
|
|
41
|
-
this.isInitializing = false;
|
|
42
|
-
this.isResetting = false;
|
|
43
|
-
this.focusedOption = null;
|
|
44
|
-
this.isValueFocused = false;
|
|
45
|
-
this.isNoResultsFound = false;
|
|
46
|
-
/** Indicates if the user has interacted with the select (focused/clicked) */
|
|
47
|
-
this.touched = false;
|
|
48
|
-
/** Indicates if the value has been changed by user interaction */
|
|
49
|
-
this.dirty = false;
|
|
50
|
-
this.handleSlotChange = () => {
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
this.initialize();
|
|
53
|
-
this.defineHostWidth();
|
|
54
|
-
}, 0);
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Initial attributes state
|
|
58
|
-
* */
|
|
59
|
-
this.initial = {};
|
|
60
|
-
/** Unique id */
|
|
61
|
-
this.uniqueId = `r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
62
|
-
this.getValidityStateData = (element) => {
|
|
63
|
-
let validityState = '';
|
|
64
|
-
let validityMessage = '';
|
|
65
|
-
for (const state in element.validity) {
|
|
66
|
-
if (element.validity[state]) {
|
|
67
|
-
validityState = state;
|
|
68
|
-
if (this[state + 'Message']) {
|
|
69
|
-
validityMessage = this[state + 'Message'];
|
|
70
|
-
return { validityState, validityMessage };
|
|
71
|
-
}
|
|
72
|
-
validityMessage = element.validationMessage;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return { validityState, validityMessage };
|
|
76
|
-
};
|
|
77
|
-
this.validateFormElement = (element = null) => {
|
|
78
|
-
if (element === null)
|
|
79
|
-
return;
|
|
80
|
-
if (this.isNoValidate)
|
|
81
|
-
return;
|
|
82
|
-
if (this.error)
|
|
83
|
-
return;
|
|
84
|
-
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
85
|
-
this.validityState = validityState;
|
|
86
|
-
this.validityMessage = validityMessage;
|
|
87
|
-
const isValid = this.validityState === 'valid';
|
|
88
|
-
this.valid = isValid;
|
|
89
|
-
this.invalid = !isValid;
|
|
90
|
-
this.rValidate.emit({
|
|
91
|
-
state: this.validityState,
|
|
92
|
-
message: this.validityMessage
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
// Typeahead buffer + last matched index
|
|
96
|
-
this.typeaheadBuffer = '';
|
|
97
|
-
this.typeaheadTimeout = null;
|
|
98
|
-
this.lastTypeaheadIndex = -1;
|
|
99
|
-
this.contributeToFormData = (event) => {
|
|
100
|
-
formData.appendControlToFormData(this.nativeElement, event.formData);
|
|
101
|
-
};
|
|
102
|
-
this.onValueClick = (e) => {
|
|
103
|
-
var _a;
|
|
104
|
-
if (this.disabled)
|
|
105
|
-
return;
|
|
106
|
-
e.preventDefault();
|
|
107
|
-
e.stopPropagation();
|
|
108
|
-
// Mark as touched when user clicks on the select
|
|
109
|
-
this.touched = true;
|
|
110
|
-
this.toggle();
|
|
111
|
-
if (!this.isExpanded)
|
|
112
|
-
return;
|
|
113
|
-
if (this.combobox)
|
|
114
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
115
|
-
this.defineListboxPositionState();
|
|
116
|
-
};
|
|
117
|
-
// Returns a handler for a key
|
|
118
|
-
this.keyboardEventHandlerFactory = (code, altKey = false) => {
|
|
119
|
-
switch (code) {
|
|
120
|
-
case 'Enter':
|
|
121
|
-
return () => {
|
|
122
|
-
var _a;
|
|
123
|
-
if (this.isExpanded) {
|
|
124
|
-
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
125
|
-
if (newValue !== this.currentValue) {
|
|
126
|
-
this.dirty = true;
|
|
127
|
-
}
|
|
128
|
-
this.setValueFromUserInteraction(newValue);
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.expand();
|
|
132
|
-
this.setOptionFocus(this.selectedElement);
|
|
133
|
-
};
|
|
134
|
-
case 'Escape':
|
|
135
|
-
return () => {
|
|
136
|
-
this.collapse();
|
|
137
|
-
this.reportValidity();
|
|
138
|
-
};
|
|
139
|
-
case 'ArrowUp':
|
|
140
|
-
return () => {
|
|
141
|
-
var _a;
|
|
142
|
-
if (!this.isExpanded) {
|
|
143
|
-
this.expand();
|
|
144
|
-
const indexToFocus = this.combobox ? this.optionElements.length - 1 : 0;
|
|
145
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[indexToFocus]);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (this.focusedOption && altKey) {
|
|
149
|
-
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
150
|
-
if (newValue !== this.currentValue) {
|
|
151
|
-
this.dirty = true;
|
|
152
|
-
}
|
|
153
|
-
this.setValueFromUserInteraction(newValue);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (!this.combobox && this.focusedOption === this.optionElements[0])
|
|
157
|
-
return;
|
|
158
|
-
if (this.focusedOption) {
|
|
159
|
-
this.focusPrevOption();
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
163
|
-
};
|
|
164
|
-
case 'ArrowDown':
|
|
165
|
-
return () => {
|
|
166
|
-
if (!this.isExpanded) {
|
|
167
|
-
this.expand();
|
|
168
|
-
if (altKey)
|
|
169
|
-
return;
|
|
170
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
if (!this.combobox && this.focusedOption === this.optionElements[this.optionElements.length - 1])
|
|
174
|
-
return;
|
|
175
|
-
if (this.focusedOption) {
|
|
176
|
-
this.focusNextOption();
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
180
|
-
};
|
|
181
|
-
case 'Home':
|
|
182
|
-
return () => {
|
|
183
|
-
if (!this.isExpanded) {
|
|
184
|
-
this.expand();
|
|
185
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
this.setOptionFocus(this.optionElements[0]);
|
|
189
|
-
};
|
|
190
|
-
case 'End':
|
|
191
|
-
return () => {
|
|
192
|
-
if (!this.isExpanded) {
|
|
193
|
-
this.expand();
|
|
194
|
-
this.setOptionFocus(this.selectedElement || this.optionElements[this.optionElements.length - 1]);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
this.setOptionFocus(this.optionElements[this.optionElements.length - 1]);
|
|
198
|
-
};
|
|
199
|
-
case 'PageUp': {
|
|
200
|
-
return () => {
|
|
201
|
-
if (!this.isExpanded)
|
|
202
|
-
return;
|
|
203
|
-
if (this.focusedOption === null)
|
|
204
|
-
return;
|
|
205
|
-
const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
|
|
206
|
-
if (currentIndex === -1)
|
|
207
|
-
return;
|
|
208
|
-
const targetIndex = currentIndex - 10 >= 0 ? currentIndex - 10 : 0;
|
|
209
|
-
this.setOptionFocus(this.optionElements[targetIndex]);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
case 'PageDown': {
|
|
213
|
-
return () => {
|
|
214
|
-
if (!this.isExpanded)
|
|
215
|
-
return;
|
|
216
|
-
if (this.focusedOption === null)
|
|
217
|
-
return;
|
|
218
|
-
const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
|
|
219
|
-
if (currentIndex === -1)
|
|
220
|
-
return;
|
|
221
|
-
const lastIndex = this.optionElements.length - 1;
|
|
222
|
-
const targetIndex = currentIndex + 10 <= lastIndex ? currentIndex + 10 : lastIndex;
|
|
223
|
-
this.setOptionFocus(this.optionElements[targetIndex]);
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
case 'Tab':
|
|
227
|
-
return () => {
|
|
228
|
-
var _a;
|
|
229
|
-
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
230
|
-
if (newValue !== this.currentValue) {
|
|
231
|
-
this.dirty = true;
|
|
232
|
-
}
|
|
233
|
-
this.setValueFromUserInteraction(newValue);
|
|
234
|
-
};
|
|
235
|
-
default:
|
|
236
|
-
// No matching key handler: intentional no-op
|
|
237
|
-
return () => { };
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
this.onValueKeydown = (e) => {
|
|
241
|
-
e.stopPropagation();
|
|
242
|
-
const preventCodes = [
|
|
243
|
-
'ArrowUp',
|
|
244
|
-
'ArrowDown',
|
|
245
|
-
'Home',
|
|
246
|
-
'End',
|
|
247
|
-
'PageUp',
|
|
248
|
-
'PageDown',
|
|
249
|
-
'Space',
|
|
250
|
-
'Enter',
|
|
251
|
-
'Escape'
|
|
252
|
-
];
|
|
253
|
-
if (preventCodes.includes(e.code)) {
|
|
254
|
-
e.preventDefault();
|
|
255
|
-
}
|
|
256
|
-
else if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
257
|
-
// Tab will also be skipped here
|
|
258
|
-
if (!this.isExpanded)
|
|
259
|
-
this.expand();
|
|
260
|
-
this.handleTypeahead(e.key);
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
switch (e.code) {
|
|
264
|
-
case 'Space':
|
|
265
|
-
this.keyboardEventHandlerFactory('Enter')();
|
|
266
|
-
break;
|
|
267
|
-
case 'Tab':
|
|
268
|
-
if (this.focusedOption === null)
|
|
269
|
-
break;
|
|
270
|
-
this.keyboardEventHandlerFactory('Tab')();
|
|
271
|
-
break;
|
|
272
|
-
default:
|
|
273
|
-
this.keyboardEventHandlerFactory(e.code, e.altKey)();
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
this.onComboboxKeydown = (e) => {
|
|
278
|
-
e.stopPropagation();
|
|
279
|
-
const preventCodes = [
|
|
280
|
-
'ArrowUp',
|
|
281
|
-
'ArrowDown',
|
|
282
|
-
'Home',
|
|
283
|
-
'End',
|
|
284
|
-
'PageUp',
|
|
285
|
-
'PageDown',
|
|
286
|
-
'Enter',
|
|
287
|
-
'Escape'
|
|
288
|
-
];
|
|
289
|
-
if (preventCodes.includes(e.code)) {
|
|
290
|
-
e.preventDefault();
|
|
291
|
-
}
|
|
292
|
-
switch (e.code) {
|
|
293
|
-
case 'Tab':
|
|
294
|
-
if (this.focusedOption === null) {
|
|
295
|
-
this.collapse();
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
this.keyboardEventHandlerFactory('Tab')();
|
|
299
|
-
break;
|
|
300
|
-
case 'Escape':
|
|
301
|
-
if (this.isExpanded) {
|
|
302
|
-
this.keyboardEventHandlerFactory('Escape')();
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
this.valueElement.value = '';
|
|
306
|
-
const newValue = '';
|
|
307
|
-
if (newValue !== this.currentValue) {
|
|
308
|
-
this.dirty = true;
|
|
309
|
-
}
|
|
310
|
-
this.setValueFromUserInteraction(newValue);
|
|
311
|
-
this.reportValidity();
|
|
312
|
-
break;
|
|
313
|
-
default:
|
|
314
|
-
this.keyboardEventHandlerFactory(e.code, e.altKey)();
|
|
315
|
-
break;
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
this.onValueBlur = () => {
|
|
319
|
-
this.isValueFocused = false;
|
|
320
|
-
const { isBusy, isExpanded } = this;
|
|
321
|
-
if (isBusy || isExpanded)
|
|
322
|
-
return;
|
|
323
|
-
this.reportValidity();
|
|
324
|
-
};
|
|
325
|
-
this.onValueFocus = () => {
|
|
326
|
-
this.isValueFocused = true;
|
|
327
|
-
// Mark as touched when user focuses on the select
|
|
328
|
-
this.touched = true;
|
|
329
|
-
};
|
|
330
|
-
this.filterOptionsListByComboboxValue = (value = '') => {
|
|
331
|
-
const options = Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));
|
|
332
|
-
options.forEach((option) => {
|
|
333
|
-
var _a, _b;
|
|
334
|
-
const optionText = (_b = (_a = option === null || option === void 0 ? void 0 : option.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
335
|
-
const hasMatch = optionText.search(value.toLowerCase()) !== -1;
|
|
336
|
-
option.setAttribute('aria-hidden', `${!hasMatch}`);
|
|
337
|
-
});
|
|
338
|
-
this.isNoResultsFound = options.every((option) => (option === null || option === void 0 ? void 0 : option.getAttribute('aria-hidden')) === 'true');
|
|
339
|
-
if (this.isNoResultsFound) {
|
|
340
|
-
this.statusElement.innerHTML = this.noResultsFound;
|
|
341
|
-
setTimeout(() => {
|
|
342
|
-
this.statusElement.innerText = '';
|
|
343
|
-
}, 1000);
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
this.clearComboboxOptions = () => {
|
|
347
|
-
if (!this.combobox)
|
|
348
|
-
return;
|
|
349
|
-
this.filterOptionsListByComboboxValue();
|
|
350
|
-
};
|
|
351
|
-
this.onComboboxChange = (event) => {
|
|
352
|
-
this.filterOptionsListByComboboxValue(event.target.value);
|
|
353
|
-
};
|
|
354
|
-
this.onComboboxInput = (event) => {
|
|
355
|
-
this.filterOptionsListByComboboxValue(event.target.value);
|
|
356
|
-
if (!this.isExpanded) {
|
|
357
|
-
this.expand();
|
|
358
|
-
this.defineListboxPositionState();
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
this.onSubmitForm = (event) => {
|
|
362
|
-
if (this.isNoValidate)
|
|
363
|
-
return;
|
|
364
|
-
this.reportValidity();
|
|
365
|
-
if (this.invalid) {
|
|
366
|
-
event.preventDefault();
|
|
367
|
-
event.stopPropagation();
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
// Clear validation results and emit rReset event
|
|
371
|
-
this.onResetForm = () => {
|
|
372
|
-
// Clear validation results
|
|
373
|
-
this.resetValidation();
|
|
374
|
-
// Reset touched and dirty states
|
|
375
|
-
this.markAsPristine();
|
|
376
|
-
// Restore initial value
|
|
377
|
-
this.setValue(this.initial['value']);
|
|
378
|
-
// Emit rReset
|
|
379
|
-
this.rReset.emit({
|
|
380
|
-
element: this.host,
|
|
381
|
-
value: this.currentValue
|
|
382
|
-
});
|
|
383
|
-
};
|
|
384
|
-
this.renderSelect = (comboboxAttrs) => {
|
|
385
|
-
var _a, _b;
|
|
386
|
-
return (index.h("span", Object.assign({ class: "r-select--value", role: "combobox" }, comboboxAttrs, { ref: el => this.valueElement = el, onClick: this.isInteractive ? this.onValueClick : null, onKeyDown: this.isInteractive ? this.onValueKeydown : null, onBlur: this.isInteractive ? this.onValueBlur : null, onFocus: this.isInteractive ? this.onValueFocus : null }), index.h("span", { class: "r-select--value-display" }, this.isLeadingSlotRendered ? index.h("slot", { name: "leading" }) : null, index.h("span", { class: "r-select--value-selected", innerHTML: ((_b = (_a = this.valueToDisplay) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) || this.placeholder || '' })), index.h("span", { class: "r-select--value-arrow" }, index.h("r-icon", { class: "r-select--trailing-icon", name: "angle-down", size: "s" }))));
|
|
387
|
-
};
|
|
388
|
-
this.renderCombobox = (comboboxAttrs) => {
|
|
389
|
-
var _a, _b, _c;
|
|
390
|
-
return (index.h("div", { class: "r-select--value", onClick: this.isInteractive ? this.onValueClick : null, ref: el => this.comboboxContainerElement = el }, index.h("div", { class: "r-select--value-display" }, this.isLeadingSlotRendered ? index.h("slot", { name: "leading" }) : null, index.h("input", Object.assign({ role: "combobox", autocomplete: "off", "aria-autocomplete": "list", disabled: this.disabled, readonly: this.readonly, type: "text" }, comboboxAttrs, { class: "r-select--input", ref: el => this.valueElement = el, onKeyDown: this.isInteractive ? this.onComboboxKeydown : null, onBlur: this.isInteractive ? this.onValueBlur : null, onFocus: this.isInteractive ? this.onValueFocus : null, onChange: this.isInteractive ? this.onComboboxChange : null, onInput: this.isInteractive ? this.onComboboxInput : null, placeholder: this.placeholder || '', value: ((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || '' }))), index.h("button", { "aria-label": this.toggleButtonAriaLabel, "aria-expanded": `${this.expanded || false}`, "aria-controls": `${this.uniqueId}-list`, disabled: this.disabled, tabindex: "-1", class: "r-select--value-arrow-button r-select--value-arrow" }, index.h("r-icon", { class: "r-select--trailing-icon", name: "angle-down", size: "s" })), index.h("div", { class: "visually-hidden", role: "status", ref: (el) => this.statusElement = el })));
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
/** Sets the component into `readonly` state */
|
|
394
|
-
async setReadonly() {
|
|
395
|
-
this.collapse();
|
|
396
|
-
this.resetValidation();
|
|
397
|
-
this.isReadonly = true;
|
|
398
|
-
}
|
|
399
|
-
/** Clears readonly state from the component */
|
|
400
|
-
async clearReadonly() {
|
|
401
|
-
this.isReadonly = false;
|
|
402
|
-
}
|
|
403
|
-
handleListboxPositionChange() {
|
|
404
|
-
this.defineListboxPositionState();
|
|
405
|
-
}
|
|
406
|
-
handleExpandedChange() {
|
|
407
|
-
this.expanded ? this.expand() : this.collapse();
|
|
408
|
-
}
|
|
409
|
-
handleReadonlyChange() {
|
|
410
|
-
this.readonly ? this.setReadonly() : this.clearReadonly();
|
|
411
|
-
}
|
|
412
|
-
handleValueChange(value, oldValue) {
|
|
413
|
-
if (this.isInitializing)
|
|
414
|
-
return;
|
|
415
|
-
// Only process if this is not the initial load (oldValue is defined)
|
|
416
|
-
if (oldValue !== undefined && oldValue !== value) {
|
|
417
|
-
// This is a programmatic change from parent attribute
|
|
418
|
-
// Do NOT mark as dirty, do NOT emit rChange
|
|
419
|
-
this._renderSelected(value, false);
|
|
420
|
-
this.clearComboboxOptions();
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
/** Listen for custom event triggered by "onClick" event on `<r-select-option>` */
|
|
424
|
-
optionSelectAction(e) {
|
|
425
|
-
e.stopPropagation();
|
|
426
|
-
if (this.disabled)
|
|
427
|
-
return;
|
|
428
|
-
// Mark as dirty only if value actually changes
|
|
429
|
-
if (e.target.value !== this.currentValue) {
|
|
430
|
-
this.dirty = true;
|
|
431
|
-
}
|
|
432
|
-
this.setValueFromUserInteraction(e.target.value);
|
|
433
|
-
}
|
|
434
|
-
tooltipFocusAction() {
|
|
435
|
-
this.collapse();
|
|
436
|
-
this.reportValidity();
|
|
437
|
-
}
|
|
438
|
-
onMouseup(e) {
|
|
439
|
-
if (!this.isExpanded)
|
|
440
|
-
return;
|
|
441
|
-
e.stopPropagation();
|
|
442
|
-
if (!this.host.contains(e.target)) {
|
|
443
|
-
this.collapse();
|
|
444
|
-
this.reportValidity();
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
onKeyup(e) {
|
|
448
|
-
if (!this.isExpanded)
|
|
449
|
-
return;
|
|
450
|
-
e.stopPropagation();
|
|
451
|
-
const path = e.composedPath ? e.composedPath() : [];
|
|
452
|
-
const isInsideSelect = path.includes(this.host);
|
|
453
|
-
if (!isInsideSelect) {
|
|
454
|
-
this.collapse();
|
|
455
|
-
this.reportValidity();
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Listen on window scroll
|
|
460
|
-
* and update tooltip position if needed
|
|
461
|
-
*/
|
|
462
|
-
handleScrolling() {
|
|
463
|
-
if (this.isExpanded)
|
|
464
|
-
this.defineListboxPositionState();
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Listen on window resizing
|
|
468
|
-
* and update tooltip position if needed
|
|
469
|
-
*/
|
|
470
|
-
handleResizing() {
|
|
471
|
-
if (this.isExpanded)
|
|
472
|
-
this.defineListboxPositionState();
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Set value of the select programmatically.
|
|
476
|
-
* Does NOT mark as dirty or emit change events.
|
|
477
|
-
* Use this for programmatic value updates.
|
|
478
|
-
*/
|
|
479
|
-
async setValue(value = '') {
|
|
480
|
-
// Clear validation results
|
|
481
|
-
this.resetValidation();
|
|
482
|
-
// Don't emit change event for programmatic updates
|
|
483
|
-
this._renderSelected(value, false);
|
|
484
|
-
this.clearComboboxOptions();
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Internal method to set value from user interaction.
|
|
488
|
-
* Assumes dirty flag is already set by the caller.
|
|
489
|
-
* Will emit rChange if dirty flag is true.
|
|
490
|
-
*/
|
|
491
|
-
setValueFromUserInteraction(value = '') {
|
|
492
|
-
// Clear validation results
|
|
493
|
-
this.resetValidation();
|
|
494
|
-
// Emit change event for user interactions (if dirty is set)
|
|
495
|
-
this._renderSelected(value, true);
|
|
496
|
-
this.clearComboboxOptions();
|
|
497
|
-
}
|
|
498
|
-
/** Set value of the select */
|
|
499
|
-
async getValue() {
|
|
500
|
-
return this.currentValue || '';
|
|
501
|
-
}
|
|
502
|
-
/** Reset select to its initial state */
|
|
503
|
-
async reset() {
|
|
504
|
-
// Clear validation results
|
|
505
|
-
this.resetValidation();
|
|
506
|
-
// Reset touched and dirty states
|
|
507
|
-
this.markAsPristine();
|
|
508
|
-
// Collapse options listbox
|
|
509
|
-
this.collapse();
|
|
510
|
-
// Restore unfiltered list
|
|
511
|
-
this.clearComboboxOptions();
|
|
512
|
-
// If value has not changed --> nothing to reset
|
|
513
|
-
if (this.currentValue === this.initial['value'])
|
|
514
|
-
return;
|
|
515
|
-
// If initial value is not an empty string
|
|
516
|
-
if (this.initial['value'] !== '' && this.initiallySelectedElement) {
|
|
517
|
-
this.isResetting = true;
|
|
518
|
-
this.setValue(this.initial['value']);
|
|
519
|
-
this.isResetting = false;
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
// Clear any selected option
|
|
523
|
-
this.deselectOptions();
|
|
524
|
-
// Set value of the select to null
|
|
525
|
-
this.currentValue = '';
|
|
526
|
-
this.valueToDisplay = '';
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Clears validation results.
|
|
530
|
-
*/
|
|
531
|
-
async resetValidation() {
|
|
532
|
-
// Clear validity message
|
|
533
|
-
this.validityMessage = null;
|
|
534
|
-
// Clear validity state
|
|
535
|
-
this.validityState = null;
|
|
536
|
-
// Reset props to initial
|
|
537
|
-
this.invalid = this.initial['invalid'];
|
|
538
|
-
this.valid = !this.invalid;
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Returns whether the select has been touched (focused/clicked by user).
|
|
542
|
-
* @returns A boolean indicating whether the select has been touched.
|
|
543
|
-
*/
|
|
544
|
-
async isTouched() {
|
|
545
|
-
return this.touched;
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Returns whether the select value has been changed by user interaction.
|
|
549
|
-
* @returns A boolean indicating whether the select is dirty.
|
|
550
|
-
*/
|
|
551
|
-
async isDirty() {
|
|
552
|
-
return this.dirty;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Marks the select as untouched and pristine (not dirty).
|
|
556
|
-
*/
|
|
557
|
-
async markAsPristine() {
|
|
558
|
-
this.touched = false;
|
|
559
|
-
this.dirty = false;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Validates the textarea without triggering UI and returns a boolean indicating its validity.
|
|
563
|
-
* @returns A boolean indicating whether the textarea is valid.
|
|
564
|
-
*/
|
|
565
|
-
async checkValidity() {
|
|
566
|
-
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
567
|
-
return validityState === 'valid';
|
|
568
|
-
}
|
|
569
|
-
/** Check validity and reveal validation state and message */
|
|
570
|
-
async reportValidity() {
|
|
571
|
-
this.validateFormElement(this.nativeElement);
|
|
572
|
-
return this.validityState === 'valid';
|
|
573
|
-
}
|
|
574
|
-
/** Set focus on the element */
|
|
575
|
-
async setFocus() {
|
|
576
|
-
var _a;
|
|
577
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
578
|
-
}
|
|
579
|
-
/** Remove focus from the element */
|
|
580
|
-
async setBlur() {
|
|
581
|
-
var _a;
|
|
582
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
583
|
-
}
|
|
584
|
-
/** Expand options listbox */
|
|
585
|
-
async expand() {
|
|
586
|
-
this.isExpanded = true;
|
|
587
|
-
}
|
|
588
|
-
/** Collapse options listbox */
|
|
589
|
-
async collapse() {
|
|
590
|
-
this.isExpanded = false;
|
|
591
|
-
if (this.isBusy)
|
|
592
|
-
return;
|
|
593
|
-
this.clearOptionsFocus();
|
|
594
|
-
this.setComboboxValueOnCollapse();
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Retrieves the currently focused option within this select component.
|
|
598
|
-
*
|
|
599
|
-
* The focused option is identified by the presence of the `data-focused="true"`
|
|
600
|
-
* attribute on an `r-select-option` element inside the component's host.
|
|
601
|
-
*
|
|
602
|
-
* @returns Promise resolving to the focused `HTMLRSelectOptionElement`, or `null`
|
|
603
|
-
* if no option is currently marked as focused.
|
|
604
|
-
*/
|
|
605
|
-
async getFocusedOption() {
|
|
606
|
-
return this.host.querySelector('r-select-option[data-focused="true"]') || null;
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* Sets focus to the option at the specified index.
|
|
610
|
-
*
|
|
611
|
-
* Retrieves the option element from the internal optionElements collection
|
|
612
|
-
* and delegates focusing logic to `setOptionFocus`.
|
|
613
|
-
*
|
|
614
|
-
* @param index - Zero-based index of the option to focus. If the index is out of bounds
|
|
615
|
-
* or the corresponding option element is unavailable, the method will no-op.
|
|
616
|
-
*
|
|
617
|
-
* @returns A promise that resolves with the result of `setOptionFocus`, typically indicating
|
|
618
|
-
* success or failure of applying focus (implementation dependent).
|
|
619
|
-
*/
|
|
620
|
-
async setFocusedOption(index) {
|
|
621
|
-
return this.setOptionFocus(this.optionElements[index]);
|
|
622
|
-
}
|
|
623
|
-
clearOptionsFocus() {
|
|
624
|
-
var _a;
|
|
625
|
-
this.focusedOption = null;
|
|
626
|
-
try {
|
|
627
|
-
this.valueElement.ariaActiveDescendantElement = null;
|
|
628
|
-
}
|
|
629
|
-
catch (_b) {
|
|
630
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.removeAttribute('aria-activedescendant');
|
|
631
|
-
}
|
|
632
|
-
this.focusedOptions.forEach(option => option.setBlur());
|
|
633
|
-
}
|
|
634
|
-
setComboboxValueOnCollapse() {
|
|
635
|
-
var _a, _b, _c;
|
|
636
|
-
if (!this.combobox)
|
|
637
|
-
return;
|
|
638
|
-
this.valueElement.value = ((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || '';
|
|
639
|
-
this.clearComboboxOptions();
|
|
640
|
-
}
|
|
641
|
-
get focusedOptions() {
|
|
642
|
-
return Array.from(this.host.querySelectorAll('r-select-option[data-focused="true"]'));
|
|
643
|
-
}
|
|
644
|
-
toggle() {
|
|
645
|
-
this.isExpanded = !this.isExpanded;
|
|
646
|
-
}
|
|
647
|
-
get selectedElement() {
|
|
648
|
-
return this.host.querySelector(`r-select-option[value="${this.currentValue}"]`);
|
|
649
|
-
}
|
|
650
|
-
get initiallySelectedElement() {
|
|
651
|
-
return this.host.querySelector(`r-select-option[value="${this.initial['value']}"]`) || null;
|
|
652
|
-
}
|
|
653
|
-
/** Identify wrapping form element */
|
|
654
|
-
get parentFormEl() {
|
|
655
|
-
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Determine whether this element should be ignored
|
|
659
|
-
* during Constraint Validation API validation.
|
|
660
|
-
* */
|
|
661
|
-
get isNoValidate() {
|
|
662
|
-
var _a;
|
|
663
|
-
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
664
|
-
this.novalidate ||
|
|
665
|
-
false);
|
|
666
|
-
}
|
|
667
|
-
get optionElements() {
|
|
668
|
-
return this.host.querySelectorAll('r-select-option:not([disabled]:not([disabled="false"])):not([aria-hidden="true"])') || null;
|
|
669
|
-
}
|
|
670
|
-
get optionElementsArray() {
|
|
671
|
-
return Array.from(this.optionElements);
|
|
672
|
-
}
|
|
673
|
-
deselectOptions() {
|
|
674
|
-
if (!this.optionElements)
|
|
675
|
-
return;
|
|
676
|
-
this.optionElements.forEach(option => option.clearSelected());
|
|
677
|
-
}
|
|
678
|
-
get isBusy() {
|
|
679
|
-
return this.isInitializing || this.isResetting;
|
|
680
|
-
}
|
|
681
|
-
_renderSelected(value = '', emitValue = true) {
|
|
682
|
-
var _a, _b;
|
|
683
|
-
// Update value of `<r-select>`
|
|
684
|
-
this.currentValue = value;
|
|
685
|
-
if (this.currentValue === null)
|
|
686
|
-
this.host.removeAttribute('value');
|
|
687
|
-
else
|
|
688
|
-
this.host.setAttribute('value', this.currentValue);
|
|
689
|
-
const elementToSelect = this.host.querySelector(`r-select-option[value="${(_a = this.currentValue) === null || _a === void 0 ? void 0 : _a.trim()}"]`);
|
|
690
|
-
this.valueToDisplay = (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.innerHTML) || (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.textContent) || this.currentValue || '';
|
|
691
|
-
// Switch `selected` value for each option
|
|
692
|
-
(_b = this.optionElements) === null || _b === void 0 ? void 0 : _b.forEach(option => {
|
|
693
|
-
option.value === value ? option.setSelected() : option.clearSelected();
|
|
694
|
-
});
|
|
695
|
-
this._renderNativeOption();
|
|
696
|
-
if (this.isExpanded)
|
|
697
|
-
this.collapse();
|
|
698
|
-
if (!this.isBusy) {
|
|
699
|
-
this.reportValidity();
|
|
700
|
-
}
|
|
701
|
-
// Only emit rChange if:
|
|
702
|
-
// 1. emitValue is true
|
|
703
|
-
// 2. Not during initialization or reset
|
|
704
|
-
// 3. The component is dirty (user has interacted)
|
|
705
|
-
if (emitValue && !this.isBusy && this.dirty) {
|
|
706
|
-
this.rChange.emit({
|
|
707
|
-
element: this.host,
|
|
708
|
-
value: value
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
setOptionFocus(element = this.selectedElement) {
|
|
713
|
-
if (!element)
|
|
714
|
-
return;
|
|
715
|
-
if (this.optionElements === null)
|
|
716
|
-
return;
|
|
717
|
-
// Helper: fallback to scrollIntoView
|
|
718
|
-
const _scrollIntoViewFallback = (element, container) => {
|
|
719
|
-
const top = element.offsetTop;
|
|
720
|
-
const bottom = top + element.offsetHeight;
|
|
721
|
-
const viewTop = container.scrollTop;
|
|
722
|
-
const viewBottom = viewTop + container.clientHeight;
|
|
723
|
-
if (top < viewTop) {
|
|
724
|
-
container.scrollTop = top;
|
|
725
|
-
}
|
|
726
|
-
else if (bottom > viewBottom) {
|
|
727
|
-
container.scrollTop = bottom - container.clientHeight;
|
|
728
|
-
}
|
|
729
|
-
};
|
|
730
|
-
// Helper: defines if scrollIntoView can be used or calls optional fallback
|
|
731
|
-
const _scrollIntoView = (element, container) => {
|
|
732
|
-
var _a, _b;
|
|
733
|
-
if (!container)
|
|
734
|
-
return;
|
|
735
|
-
// Try native scrollIntoView first (some browsers optimize this)
|
|
736
|
-
try {
|
|
737
|
-
(_a = element.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(element, {
|
|
738
|
-
block: 'nearest',
|
|
739
|
-
inline: 'nearest'
|
|
740
|
-
});
|
|
741
|
-
}
|
|
742
|
-
catch (_c) {
|
|
743
|
-
// Older Safari without options signature
|
|
744
|
-
(_b = element.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(element, false);
|
|
745
|
-
}
|
|
746
|
-
// Manual correction if still out of view
|
|
747
|
-
const optRect = element.getBoundingClientRect();
|
|
748
|
-
const contRect = container.getBoundingClientRect();
|
|
749
|
-
const outside = optRect.top < contRect.top || optRect.bottom > contRect.bottom;
|
|
750
|
-
if (outside) {
|
|
751
|
-
_scrollIntoViewFallback(element, container);
|
|
752
|
-
}
|
|
753
|
-
};
|
|
754
|
-
requestAnimationFrame(() => {
|
|
755
|
-
var _a;
|
|
756
|
-
this.clearOptionsFocus();
|
|
757
|
-
element.setFocus();
|
|
758
|
-
this.focusedOption = element;
|
|
759
|
-
try {
|
|
760
|
-
this.valueElement.ariaActiveDescendantElement = element;
|
|
761
|
-
}
|
|
762
|
-
catch (_b) {
|
|
763
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', element.id);
|
|
764
|
-
}
|
|
765
|
-
_scrollIntoView(element, this.listboxElement);
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
focusPrevOption(currentElement = this.focusedOption || this.selectedElement) {
|
|
769
|
-
if (this.optionElements === null)
|
|
770
|
-
return;
|
|
771
|
-
const currentIndex = this.optionElementsArray.indexOf(currentElement);
|
|
772
|
-
const prevIndex = currentIndex - 1;
|
|
773
|
-
const isPrevIndex = prevIndex >= 0;
|
|
774
|
-
const prevElement = isPrevIndex ? this.optionElements[prevIndex] : this.optionElements[this.optionElements.length - 1];
|
|
775
|
-
this.setOptionFocus(prevElement);
|
|
776
|
-
}
|
|
777
|
-
focusNextOption(currentElement = this.focusedOption || this.selectedElement) {
|
|
778
|
-
if (this.optionElements === null)
|
|
779
|
-
return;
|
|
780
|
-
const currentIndex = this.optionElementsArray.indexOf(currentElement);
|
|
781
|
-
const nextIndex = currentIndex + 1;
|
|
782
|
-
const lastIndex = this.optionElements.length - 1;
|
|
783
|
-
const isNextIndex = nextIndex <= lastIndex;
|
|
784
|
-
const nextElement = isNextIndex ? this.optionElements[nextIndex] : this.optionElements[0];
|
|
785
|
-
this.setOptionFocus(nextElement);
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* Return option elements whose label starts with the filter text (case-insensitive).
|
|
789
|
-
*/
|
|
790
|
-
filterOptions(options, filter) {
|
|
791
|
-
if (!filter)
|
|
792
|
-
return [];
|
|
793
|
-
const f = filter.toLowerCase();
|
|
794
|
-
return options.filter(o => !o.disabled &&
|
|
795
|
-
(o.textContent || '').trim().toLowerCase().startsWith(f));
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* Return the index (within the provided array) of an option matching the filter.
|
|
799
|
-
* If the filter is multiple iterations of the same letter (e.g. 'aaa'), cycle through
|
|
800
|
-
* first-letter matches starting from startIndex.
|
|
801
|
-
* Returns -1 if no match.
|
|
802
|
-
*/
|
|
803
|
-
getIndexByLetter(options, filter, startIndex = 0) {
|
|
804
|
-
if (!options.length || !filter)
|
|
805
|
-
return -1;
|
|
806
|
-
const ordered = [...options.slice(startIndex), ...options.slice(0, startIndex)];
|
|
807
|
-
const matchesFull = this
|
|
808
|
-
.filterOptions(ordered, filter)
|
|
809
|
-
.sort((a, b) => ((a.textContent || '').trim().toLowerCase())
|
|
810
|
-
.localeCompare((b.textContent || '').trim().toLowerCase()));
|
|
811
|
-
const allSame = filter.split('').every(c => c === filter[0]);
|
|
812
|
-
if (matchesFull[0]) {
|
|
813
|
-
return options.indexOf(matchesFull[0]);
|
|
814
|
-
}
|
|
815
|
-
else if (allSame) {
|
|
816
|
-
const firstLetterMatches = this.filterOptions(ordered, filter[0]);
|
|
817
|
-
if (firstLetterMatches[0]) {
|
|
818
|
-
return options.indexOf(firstLetterMatches[0]);
|
|
819
|
-
}
|
|
820
|
-
return -1;
|
|
821
|
-
}
|
|
822
|
-
return -1;
|
|
823
|
-
}
|
|
824
|
-
handleTypeahead(char) {
|
|
825
|
-
const RESET_MS = 500;
|
|
826
|
-
clearTimeout(this.typeaheadTimeout);
|
|
827
|
-
const options = this.optionElementsArray;
|
|
828
|
-
// Append character
|
|
829
|
-
this.typeaheadBuffer += char.toLowerCase();
|
|
830
|
-
const allSame = this.typeaheadBuffer.split('').every(c => c === this.typeaheadBuffer[0]);
|
|
831
|
-
// Starting point for search:
|
|
832
|
-
let startIndex;
|
|
833
|
-
if (allSame && this.lastTypeaheadIndex !== -1) {
|
|
834
|
-
// Cycle through same-letter matches
|
|
835
|
-
startIndex = (this.lastTypeaheadIndex + 1) % options.length;
|
|
836
|
-
}
|
|
837
|
-
else {
|
|
838
|
-
const focusBase = (this.focusedOption || this.selectedElement);
|
|
839
|
-
const baseIndex = options.indexOf(focusBase);
|
|
840
|
-
startIndex = baseIndex === -1 ? 0 : (baseIndex + 1) % options.length;
|
|
841
|
-
}
|
|
842
|
-
const idx = this.getIndexByLetter(options, this.typeaheadBuffer, startIndex);
|
|
843
|
-
if (idx !== -1) {
|
|
844
|
-
this.lastTypeaheadIndex = idx;
|
|
845
|
-
const el = options[idx];
|
|
846
|
-
if (!this.isExpanded)
|
|
847
|
-
this.expand();
|
|
848
|
-
this.setOptionFocus(el);
|
|
849
|
-
}
|
|
850
|
-
// Reset buffer after inactivity
|
|
851
|
-
this.typeaheadTimeout = setTimeout(() => {
|
|
852
|
-
this.typeaheadBuffer = '';
|
|
853
|
-
}, RESET_MS);
|
|
854
|
-
}
|
|
855
|
-
connectFormEventListeners() {
|
|
856
|
-
if (!this.parentFormEl)
|
|
857
|
-
return;
|
|
858
|
-
this.parentFormEl.addEventListener('formdata', this.contributeToFormData);
|
|
859
|
-
this.parentFormEl.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
860
|
-
this.parentFormEl.addEventListener('reset', this.onResetForm);
|
|
861
|
-
}
|
|
862
|
-
disconnectFormEventListeners() {
|
|
863
|
-
if (!this.parentFormEl)
|
|
864
|
-
return;
|
|
865
|
-
this.parentFormEl.removeEventListener('formdata', this.contributeToFormData);
|
|
866
|
-
this.parentFormEl.removeEventListener('submit', this.onSubmitForm);
|
|
867
|
-
this.parentFormEl.removeEventListener('reset', this.onResetForm);
|
|
868
|
-
}
|
|
869
|
-
defineHostWidth() {
|
|
870
|
-
if (this.fullWidth)
|
|
871
|
-
return;
|
|
872
|
-
const nativeWidth = this.host.shadowRoot.querySelector('.r-select--native').getBoundingClientRect().width;
|
|
873
|
-
const valueWidth = (this.combobox ? this.comboboxContainerElement : this.valueElement).getBoundingClientRect().width;
|
|
874
|
-
const listWidth = this.listboxElement.getBoundingClientRect().width;
|
|
875
|
-
const structuralWidth = Math.max(nativeWidth, valueWidth, listWidth);
|
|
876
|
-
this.host.style.setProperty('--width', `${structuralWidth}px`);
|
|
877
|
-
}
|
|
878
|
-
_renderNativeOption() {
|
|
879
|
-
var _a, _b, _c, _d, _e;
|
|
880
|
-
const optionElement = document.createElement("option");
|
|
881
|
-
const optionText = document.createTextNode((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b));
|
|
882
|
-
optionElement.value = this.currentValue;
|
|
883
|
-
optionElement.selected = true;
|
|
884
|
-
optionElement.appendChild(optionText);
|
|
885
|
-
if (!this.nativeElement)
|
|
886
|
-
return;
|
|
887
|
-
this.nativeElement.innerHTML = '';
|
|
888
|
-
(_d = this.nativeElement) === null || _d === void 0 ? void 0 : _d.appendChild(optionElement);
|
|
889
|
-
this.nativeElement.value = this.currentValue;
|
|
890
|
-
(_e = this.nativeElement) === null || _e === void 0 ? void 0 : _e.setAttribute('value', this.currentValue);
|
|
891
|
-
}
|
|
892
|
-
notVisible(element) {
|
|
893
|
-
return getComputedStyle(element).overflow !== "visible";
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Finds first element's parent with not visible overflow.
|
|
897
|
-
* @param element -- parent element
|
|
898
|
-
* @param initEl -- initial(child) element
|
|
899
|
-
*/
|
|
900
|
-
findOverflowParent(element) {
|
|
901
|
-
var _a, _b;
|
|
902
|
-
if (((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.DOCUMENT_FRAGMENT_NODE) {
|
|
903
|
-
return this.findOverflowParent((_b = element.parentNode) === null || _b === void 0 ? void 0 : _b.host);
|
|
904
|
-
}
|
|
905
|
-
if (this.notVisible(element)) {
|
|
906
|
-
return element;
|
|
907
|
-
}
|
|
908
|
-
if (element.parentElement) {
|
|
909
|
-
return this.findOverflowParent(element.parentElement);
|
|
910
|
-
}
|
|
911
|
-
return null;
|
|
912
|
-
}
|
|
913
|
-
get ariaDescribedBy() {
|
|
914
|
-
const describedBy = `${this.uniqueId}-message`;
|
|
915
|
-
return this.hint ? `${this.uniqueId}-hint ${describedBy}` : describedBy;
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* Parent with non visible overflow
|
|
919
|
-
*/
|
|
920
|
-
get overflowedParent() {
|
|
921
|
-
return this.findOverflowParent(this.host.parentElement);
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* Available space at the top
|
|
925
|
-
*/
|
|
926
|
-
get top() {
|
|
927
|
-
var _a, _b;
|
|
928
|
-
return (!this.overflowedParent ?
|
|
929
|
-
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top :
|
|
930
|
-
Math.abs(this.overflowedParent.getBoundingClientRect().top - ((_b = this.valueElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().top)));
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Available space at the bottom
|
|
934
|
-
*/
|
|
935
|
-
get bottom() {
|
|
936
|
-
var _a;
|
|
937
|
-
function calculateBottomSpace(element) {
|
|
938
|
-
return window.innerHeight - element.getBoundingClientRect().top - element.getBoundingClientRect().height;
|
|
939
|
-
}
|
|
940
|
-
const styles = window.getComputedStyle(this.messageContainer);
|
|
941
|
-
const messageContainerHeight = ((_a = this.messageContainer) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) + parseFloat(styles['marginTop']);
|
|
942
|
-
const calculatedHostBottomSpace = calculateBottomSpace(this.host) + messageContainerHeight;
|
|
943
|
-
return !this.overflowedParent ? calculatedHostBottomSpace + messageContainerHeight : Math.abs(calculateBottomSpace(this.overflowedParent) - calculatedHostBottomSpace);
|
|
944
|
-
}
|
|
945
|
-
/**
|
|
946
|
-
* Set correct tooltip position.
|
|
947
|
-
* First it checks the available space for a defined position and then sets the new one based on the available space.
|
|
948
|
-
*/
|
|
949
|
-
defineListboxPositionState() {
|
|
950
|
-
var _a, _b;
|
|
951
|
-
const isBottomSpace = ((_a = this.listboxElement) === null || _a === void 0 ? void 0 : _a.offsetHeight) < this.bottom;
|
|
952
|
-
const isTopSpace = ((_b = this.listboxElement) === null || _b === void 0 ? void 0 : _b.offsetHeight) < this.top;
|
|
953
|
-
const isTop = this.listboxPosition === 'top';
|
|
954
|
-
const isBottom = this.listboxPosition === 'bottom';
|
|
955
|
-
/** Don't change the position if there is sufficient space for the listbox
|
|
956
|
-
* or insufficient space for another position.
|
|
957
|
-
* */
|
|
958
|
-
if ((isTop && (isTopSpace || !isBottomSpace)) || (isBottom && (isBottomSpace || !isTopSpace))) {
|
|
959
|
-
this.listboxPositionState = this.listboxPosition;
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
switch (this.listboxPosition) {
|
|
963
|
-
case 'top':
|
|
964
|
-
this.listboxPositionState = !isTopSpace ? 'bottom' : 'top';
|
|
965
|
-
break;
|
|
966
|
-
case 'bottom':
|
|
967
|
-
this.listboxPositionState = !isBottomSpace ? 'top' : 'bottom';
|
|
968
|
-
break;
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
initialize() {
|
|
972
|
-
var _a;
|
|
973
|
-
const currentValue = this.value || '';
|
|
974
|
-
this.initial['value'] = this.value || '';
|
|
975
|
-
this.initial['invalid'] = this.invalid || false;
|
|
976
|
-
this.listboxPositionState = this.listboxPosition;
|
|
977
|
-
// Search for the option to select
|
|
978
|
-
const elementToSelect = this.optionElementsArray.find((el) => el.value.trim() === currentValue);
|
|
979
|
-
// Select the matching element if found
|
|
980
|
-
if (elementToSelect) {
|
|
981
|
-
this.isInitializing = true;
|
|
982
|
-
this.setValue(currentValue);
|
|
983
|
-
this.isInitializing = false;
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
if (this.placeholder)
|
|
987
|
-
return;
|
|
988
|
-
if (this.combobox)
|
|
989
|
-
return;
|
|
990
|
-
const firstOption = (_a = this.optionElements) === null || _a === void 0 ? void 0 : _a[0];
|
|
991
|
-
if (firstOption) {
|
|
992
|
-
this.isInitializing = true;
|
|
993
|
-
this.setValue(firstOption === null || firstOption === void 0 ? void 0 : firstOption.value);
|
|
994
|
-
this.isInitializing = false;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
initializeStyleObserver() {
|
|
998
|
-
if (this.listboxWidthObserver || !this.listboxElement)
|
|
999
|
-
return;
|
|
1000
|
-
const observerCallback = () => {
|
|
1001
|
-
if (!this.listboxElement)
|
|
1002
|
-
return;
|
|
1003
|
-
// Only recompute if listbox grew beyond current host width
|
|
1004
|
-
const listboxWidth = this.listboxElement.getBoundingClientRect().width;
|
|
1005
|
-
const hostWidth = this.host.getBoundingClientRect().width;
|
|
1006
|
-
if (listboxWidth <= hostWidth)
|
|
1007
|
-
return;
|
|
1008
|
-
this.defineHostWidth();
|
|
1009
|
-
};
|
|
1010
|
-
this.listboxWidthObserver = new styleObserver.StyleObserver(observerCallback);
|
|
1011
|
-
this.listboxWidthObserver
|
|
1012
|
-
.observe([this.listboxElement], ['width']);
|
|
1013
|
-
}
|
|
1014
|
-
get hasError() {
|
|
1015
|
-
var _a;
|
|
1016
|
-
return this.invalid && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1017
|
-
}
|
|
1018
|
-
get hasValidationError() {
|
|
1019
|
-
var _a;
|
|
1020
|
-
return this.validityState !== 'valid' && ((_a = this.validityMessage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1021
|
-
}
|
|
1022
|
-
get hasMessage() {
|
|
1023
|
-
return this.hasError || this.hasValidationError;
|
|
1024
|
-
}
|
|
1025
|
-
get isInteractive() {
|
|
1026
|
-
return !this.disabled && !this.isReadonly;
|
|
1027
|
-
}
|
|
1028
|
-
get hasLeadingSlot() {
|
|
1029
|
-
return !!this.host.querySelector('[slot="leading"]');
|
|
1030
|
-
}
|
|
1031
|
-
get hasOptionIcon() {
|
|
1032
|
-
return !!this.optionElementsArray.find(el => !!el.querySelector('[slot="icon"]'));
|
|
1033
|
-
}
|
|
1034
|
-
get isLeadingSlotRendered() {
|
|
1035
|
-
return this.hasLeadingSlot && this.hasOptionIcon && !this.currentValue;
|
|
1036
|
-
}
|
|
1037
|
-
get isPlaceholder() {
|
|
1038
|
-
var _a, _b;
|
|
1039
|
-
const { placeholder } = this;
|
|
1040
|
-
return (((_b = (_a = this.valueToDisplay) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) || placeholder || '') === placeholder;
|
|
1041
|
-
}
|
|
1042
|
-
connectedCallback() {
|
|
1043
|
-
this.connectFormEventListeners();
|
|
1044
|
-
}
|
|
1045
|
-
disconnectedCallback() {
|
|
1046
|
-
this.disconnectFormEventListeners();
|
|
1047
|
-
}
|
|
1048
|
-
componentWillLoad() {
|
|
1049
|
-
this.isExpanded = this.expanded;
|
|
1050
|
-
this.isReadonly = this.readonly;
|
|
1051
|
-
}
|
|
1052
|
-
componentDidLoad() {
|
|
1053
|
-
this.defineListboxPositionState();
|
|
1054
|
-
this.initializeStyleObserver();
|
|
1055
|
-
}
|
|
1056
|
-
render() {
|
|
1057
|
-
var _a;
|
|
1058
|
-
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal } = this;
|
|
1059
|
-
const labelAttr = label ? {
|
|
1060
|
-
fieldIndicator
|
|
1061
|
-
} : {};
|
|
1062
|
-
const isRequired = this.isInteractive ? !!required : false;
|
|
1063
|
-
const comboboxAttrs = {
|
|
1064
|
-
id: `${uniqueId}-value`,
|
|
1065
|
-
tabindex: `${disabled ? -1 : 0}`,
|
|
1066
|
-
'aria-controls': `${uniqueId}-list`,
|
|
1067
|
-
'aria-describedby': this.ariaDescribedBy,
|
|
1068
|
-
'aria-disabled': `${disabled || false}`,
|
|
1069
|
-
'aria-expanded': `${isExpanded || false}`,
|
|
1070
|
-
'aria-invalid': `${invalid || false}`,
|
|
1071
|
-
'aria-readonly': `${!this.isInteractive || false}`,
|
|
1072
|
-
'aria-required': `${isRequired}`,
|
|
1073
|
-
'aria-labelledby': `${uniqueId}-label`
|
|
1074
|
-
};
|
|
1075
|
-
const listboxAttrs = {
|
|
1076
|
-
'aria-label': label
|
|
1077
|
-
};
|
|
1078
|
-
const nativeAttrs = {
|
|
1079
|
-
placeholder,
|
|
1080
|
-
name: this.name,
|
|
1081
|
-
value: this.currentValue,
|
|
1082
|
-
'aria-hidden': 'true',
|
|
1083
|
-
tabindex: '-1',
|
|
1084
|
-
invalid,
|
|
1085
|
-
disabled,
|
|
1086
|
-
required: isRequired
|
|
1087
|
-
};
|
|
1088
|
-
return (index.h(index.Host, { key: 'f52fa96bdacace6070cd2baa15f8fab939d05916', "data-value": this.currentValue, expanded: !this.disabled && this.isExpanded, "data-listbox-position": this.listboxPositionState, "data-initial-value": this.initial['value'], "data-is-placeholder": `${!!this.isPlaceholder}`, "data-value-focused": `${!!this.isValueFocused}`, "data-option-focused": `${!!this.focusedOption}`, "data-validity-state": `${this.validityState || ''}`, "data-validity-message": `${this.validityMessage || ''}`, "data-readonly": `${!!this.isReadonly}`, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, index.h("div", { key: '80326d43674f8caac11678ca4d5a6ca8178f9454', class: `r-select--label ${!internal ? 'r-select--label__margin-bottom' : ''}` }, index.h("div", { key: '25fa25960350a338c7c9156d38c974c0ad8a0861', class: internal ? 'visually-hidden' : 'r-select--label-container' }, index.h("label", { key: 'b52ac4d91e32df39459492bbeaf166d2a71d165c', id: `${uniqueId}-label`, onClick: this.isInteractive ? this.onValueClick : null }, index.h("r-label", Object.assign({ key: 'ac75955086f424e781baf66e6853cbc89ec20d56' }, labelAttr), label)), index.h("slot", { key: '4cd953da5c64a473070ce4b8a3e5721a36561685', name: "popover" })), hint &&
|
|
1089
|
-
index.h("r-hint", { key: '2d6a2e9eae51d56f31886725274c637e76ab4d75', id: `${uniqueId}-hint`, class: "r-select--hint" }, hint)), index.h("div", { key: '8107a1d2475d11d6e827d7394ade84f9c4c85ea5', class: "r-select" }, index.h("select", Object.assign({ key: 'd7a60a4ff2f8f568da1ea90d859d5de78a1e73ef', class: "r-select--native", ref: el => this.nativeElement = el }, nativeAttrs)), index.h("div", { key: '9d49470c7e4cc179dfd93cb1233e2bbf86ac7641', class: "r-select--container" }, this.combobox ? this.renderCombobox(comboboxAttrs) : this.renderSelect(comboboxAttrs), index.h("div", Object.assign({ key: '9594f3439c7591a4e4ef359a205a55d1c56dbb80', role: "listbox", tabindex: "-1", id: `${uniqueId}-list`, class: "r-select--options", ref: el => this.listboxElement = el }, listboxAttrs), (this.isNoResultsFound || !((_a = this.optionElements) === null || _a === void 0 ? void 0 : _a.length)) && index.h("r-select-option", { key: 'ae0ef701ff3e7db4c17aba7d57265122c3bf6587', "data-no-results": "true", value: "no_results" }, this.noResultsFound), index.h("slot", { key: '012fcee55283c7bc5a3230ff23b692eca33d853b', onSlotchange: this.handleSlotChange })))), index.h("div", { key: '94fc769d8eeb0bd92f1d12d553b033a3de9ad8dc', id: `${uniqueId}-message`, "aria-live": "polite", "aria-atomic": "true", ref: (el) => this.messageContainer = el, class: this.hasMessage && !internal ? 'r-select--message' : 'visually-hidden' }, this.hasMessage && index.h("r-hint", { key: '881e60130bd3cbc9004aacbb027911357286a516', variant: this.invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && this.validityMessage))));
|
|
1090
|
-
}
|
|
1091
|
-
get host() { return index.getElement(this); }
|
|
1092
|
-
static get watchers() { return {
|
|
1093
|
-
"listboxPosition": ["handleListboxPositionChange"],
|
|
1094
|
-
"expanded": ["handleExpandedChange"],
|
|
1095
|
-
"readonly": ["handleReadonlyChange"],
|
|
1096
|
-
"value": ["handleValueChange"]
|
|
1097
|
-
}; }
|
|
1098
|
-
};
|
|
1099
|
-
Select.style = selectCss;
|
|
1100
|
-
|
|
1101
|
-
exports.r_select = Select;
|