@aurodesignsystem/auro-formkit 2.0.0-beta.5 → 2.0.0-beta.51
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 +522 -0
- package/NOTICE +2 -0
- package/README.md +83 -15
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +38 -0
- package/components/{combobox/dist/formkit/auro-dropdownVersion.d.ts → bibtemplate/dist/headerVersion.d.ts} +0 -1
- package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
- package/components/bibtemplate/dist/index.d.ts +2 -0
- package/components/bibtemplate/dist/index.js +790 -0
- package/components/bibtemplate/dist/registered.js +790 -0
- package/components/{input/dist/styles/helpText-css.d.ts → bibtemplate/dist/styles/color-css.d.ts} +0 -1
- package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
- package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
- package/components/checkbox/README.md +27 -35
- package/components/checkbox/demo/api.md +67 -68
- package/components/checkbox/demo/api.min.js +498 -102
- package/components/checkbox/demo/index.html +49 -0
- package/components/checkbox/demo/index.md +62 -62
- package/components/checkbox/demo/index.min.js +498 -102
- package/components/checkbox/dist/auro-checkbox-group.d.ts +45 -18
- package/components/checkbox/dist/auro-checkbox.d.ts +19 -7
- package/components/checkbox/dist/helptextVersion.d.ts +2 -0
- package/components/checkbox/dist/index.d.ts +0 -1
- package/components/checkbox/dist/index.js +498 -105
- package/components/checkbox/dist/registered.js +1279 -0
- package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +0 -1
- package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +0 -1
- package/components/checkbox/dist/styles/color-css.d.ts +0 -1
- package/components/checkbox/dist/styles/colorGroup-css.d.ts +0 -1
- package/components/checkbox/dist/styles/tokens-css.d.ts +0 -1
- package/components/combobox/README.md +25 -28
- package/components/combobox/demo/api.js +1 -1
- package/components/combobox/demo/api.md +116 -32
- package/components/combobox/demo/api.min.js +8211 -3863
- package/components/combobox/demo/index.html +57 -0
- package/components/combobox/demo/index.js +1 -1
- package/components/combobox/demo/index.md +19 -3
- package/components/combobox/demo/index.min.js +8208 -3860
- package/components/combobox/dist/auro-combobox.d.ts +123 -76
- package/components/combobox/dist/bibtemplateVersion.d.ts +2 -0
- package/components/{select/dist/formkit/auro-dropdownVersion.d.ts → combobox/dist/dropdownVersion.d.ts} +0 -1
- package/components/combobox/dist/index.d.ts +0 -1
- package/components/combobox/dist/index.js +7848 -3816
- package/components/combobox/dist/{formkit/auro-inputVersion.d.ts → inputVersion.d.ts} +0 -1
- package/components/combobox/dist/registered.js +12269 -0
- package/components/combobox/dist/styles/style-css.d.ts +0 -1
- package/components/counter/README.md +188 -0
- package/components/counter/demo/api.js +3 -2
- package/components/counter/demo/api.md +185 -1018
- package/components/counter/demo/api.min.js +6190 -40
- package/components/counter/demo/index.html +53 -0
- package/components/counter/demo/index.js +2 -1
- package/components/counter/demo/index.md +298 -0
- package/components/counter/demo/index.min.js +6187 -19
- package/components/counter/dist/auro-counter-button.d.ts +12 -0
- package/components/counter/dist/auro-counter-group.d.ts +168 -5
- package/components/counter/dist/auro-counter-wrapper.d.ts +22 -0
- package/components/counter/dist/auro-counter.d.ts +91 -1
- package/components/counter/dist/bibtemplateVersion.d.ts +2 -0
- package/components/{datepicker/dist/formkit/auro-dropdownVersion.d.ts → counter/dist/dropdownVersion.d.ts} +0 -1
- package/components/counter/dist/iconVersion.d.ts +2 -0
- package/components/counter/dist/index.d.ts +0 -1
- package/components/counter/dist/index.js +6158 -38
- package/components/counter/dist/registered.js +6231 -0
- package/components/counter/dist/styles/color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-button-tokens-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-group-css.d.ts +0 -1
- package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
- package/components/counter/dist/styles/style-css.d.ts +0 -1
- package/components/counter/dist/styles/tokens-css.d.ts +2 -0
- package/components/datepicker/README.md +25 -28
- package/components/datepicker/demo/api.js +3 -3
- package/components/datepicker/demo/api.md +219 -105
- package/components/datepicker/demo/api.min.js +6367 -2448
- package/components/datepicker/demo/index.html +57 -0
- package/components/datepicker/demo/index.md +7 -1
- package/components/datepicker/demo/index.min.js +6355 -2435
- package/components/datepicker/dist/auro-calendar-cell.d.ts +0 -1
- package/components/datepicker/dist/auro-calendar-month.d.ts +15 -1
- package/components/datepicker/dist/auro-calendar.d.ts +25 -2
- package/components/datepicker/dist/auro-datepicker.d.ts +41 -12
- package/components/datepicker/dist/bibtemplateVersion.d.ts +2 -0
- package/components/datepicker/dist/dropdownVersion.d.ts +2 -1
- package/components/datepicker/dist/index.d.ts +0 -1
- package/components/datepicker/dist/index.js +6353 -2435
- package/components/datepicker/dist/{formkit/auro-inputVersion.d.ts → inputVersion.d.ts} +0 -1
- package/components/datepicker/dist/popoverVersion.d.ts +0 -1
- package/components/datepicker/dist/registered.js +22466 -0
- package/components/datepicker/dist/styles/color-calendar-css.d.ts +0 -1
- package/components/datepicker/dist/styles/color-cell-css.d.ts +0 -1
- package/components/datepicker/dist/styles/color-css.d.ts +0 -1
- package/components/datepicker/dist/styles/color-month-css.d.ts +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +0 -1
- package/components/datepicker/dist/styles/style-css.d.ts +0 -1
- package/components/datepicker/dist/styles/tokens-css.d.ts +0 -1
- package/components/datepicker/dist/utilities.d.ts +25 -1
- package/components/datepicker/dist/utilitiesCalendar.d.ts +2 -2
- package/components/datepicker/dist/utilitiesCalendarRender.d.ts +2 -3
- package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +0 -1
- package/components/dropdown/README.md +19 -27
- package/components/dropdown/demo/api.js +1 -1
- package/components/dropdown/demo/api.md +43 -29
- package/components/dropdown/demo/api.min.js +525 -124
- package/components/dropdown/demo/index.html +53 -0
- package/components/dropdown/demo/index.js +0 -3
- package/components/dropdown/demo/index.min.js +525 -127
- package/components/dropdown/dist/auro-dropdown.d.ts +38 -7
- package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -2
- package/components/dropdown/dist/dropdownVersion.d.ts +2 -0
- package/components/dropdown/dist/helptextVersion.d.ts +2 -0
- package/components/dropdown/dist/iconVersion.d.ts +0 -1
- package/components/dropdown/dist/index.d.ts +0 -1
- package/components/dropdown/dist/index.js +525 -126
- package/components/dropdown/dist/registered.js +3365 -0
- package/components/dropdown/dist/styles/bibColors-css.d.ts +0 -1
- package/components/dropdown/dist/styles/bibStyles-css.d.ts +0 -1
- package/components/dropdown/dist/styles/color-css.d.ts +0 -1
- package/components/dropdown/dist/styles/style-css.d.ts +0 -1
- package/components/dropdown/dist/styles/tokens-css.d.ts +0 -1
- package/components/form/README.md +29 -35
- package/components/form/demo/api.js +1 -1
- package/components/form/demo/api.min.js +497 -25
- package/components/form/demo/index.html +48 -0
- package/components/form/demo/index.min.js +497 -25
- package/components/form/demo/registerDemoDeps.js +22 -0
- package/components/form/demo/working.html +117 -0
- package/components/form/dist/auro-form.d.ts +194 -3
- package/components/form/dist/index.d.ts +0 -1
- package/components/form/dist/index.js +497 -27
- package/components/form/dist/registered.d.ts +1 -0
- package/components/form/dist/registered.js +632 -0
- package/components/form/dist/styles/style-css.d.ts +0 -1
- package/components/helptext/dist/auro-helptext.d.ts +53 -0
- package/components/helptext/dist/index.d.ts +2 -0
- package/components/helptext/dist/index.js +224 -0
- package/components/helptext/dist/registered.js +224 -0
- package/components/helptext/dist/styles/color-css.d.ts +2 -0
- package/components/helptext/dist/styles/style-css.d.ts +2 -0
- package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
- package/components/input/README.md +19 -29
- package/components/input/demo/api.md +152 -318
- package/components/input/demo/api.min.js +4214 -1780
- package/components/input/demo/index.html +41 -0
- package/components/input/demo/index.md +11 -61
- package/components/input/demo/index.min.js +4214 -1780
- package/components/input/dist/auro-input.d.ts +4 -2
- package/components/input/dist/base-input.d.ts +49 -16
- package/components/input/dist/buttonVersion.d.ts +0 -1
- package/components/input/dist/helptextVersion.d.ts +2 -0
- package/components/input/dist/i18n.d.ts +0 -1
- package/components/input/dist/iconVersion.d.ts +0 -1
- package/components/input/dist/index.d.ts +0 -1
- package/components/input/dist/index.js +4214 -1782
- package/components/input/dist/registered.js +6591 -0
- package/components/input/dist/styles/borders-css.d.ts +0 -1
- package/components/input/dist/styles/color-css.d.ts +0 -1
- package/components/input/dist/styles/input-css.d.ts +0 -1
- package/components/input/dist/styles/label-css.d.ts +0 -1
- package/components/input/dist/styles/mixins-css.d.ts +0 -1
- package/components/input/dist/styles/notificationIcons-css.d.ts +0 -1
- package/components/input/dist/styles/style-css.d.ts +0 -1
- package/components/input/dist/styles/tokens-css.d.ts +0 -1
- package/components/input/dist/utilities.d.ts +25 -0
- package/components/menu/README.md +19 -27
- package/components/menu/demo/api.js +1 -1
- package/components/menu/demo/api.md +57 -20
- package/components/menu/demo/api.min.js +628 -314
- package/components/menu/demo/index.html +50 -0
- package/components/menu/demo/index.min.js +626 -312
- package/components/menu/dist/auro-menu-utils.d.ts +42 -0
- package/components/menu/dist/auro-menu.d.ts +97 -82
- package/components/menu/dist/auro-menuoption.d.ts +0 -1
- package/components/menu/dist/dropdownVersion.d.ts +2 -0
- package/components/menu/dist/iconVersion.d.ts +0 -1
- package/components/menu/dist/index.d.ts +1 -1
- package/components/menu/dist/index.js +627 -316
- package/components/menu/dist/registered.js +1510 -0
- package/components/menu/dist/styles/color-menu-css.d.ts +0 -1
- package/components/menu/dist/styles/color-menuoption-css.d.ts +0 -1
- package/components/menu/dist/styles/style-menu-css.d.ts +0 -1
- package/components/menu/dist/styles/style-menuoption-css.d.ts +0 -1
- package/components/menu/dist/styles/tokens-css.d.ts +0 -1
- package/components/radio/README.md +19 -27
- package/components/radio/demo/api.md +9 -8
- package/components/radio/demo/api.min.js +429 -75
- package/components/radio/demo/index.html +48 -0
- package/components/radio/demo/index.min.js +429 -75
- package/components/radio/dist/auro-radio-group.d.ts +12 -3
- package/components/radio/dist/auro-radio.d.ts +0 -1
- package/components/radio/dist/helptextVersion.d.ts +2 -0
- package/components/radio/dist/index.d.ts +0 -1
- package/components/radio/dist/index.js +429 -78
- package/components/radio/dist/registered.js +1396 -0
- package/components/radio/dist/styles/auro-radio-group-css.d.ts +0 -1
- package/components/radio/dist/styles/color-css.d.ts +0 -1
- package/components/radio/dist/styles/groupColor-css.d.ts +0 -1
- package/components/radio/dist/styles/style-css.d.ts +0 -1
- package/components/radio/dist/styles/tokens-css.d.ts +0 -1
- package/components/select/README.md +24 -43
- package/components/select/demo/api.js +1 -1
- package/components/select/demo/api.md +149 -32
- package/components/select/demo/api.min.js +2563 -749
- package/components/select/demo/index.html +49 -0
- package/components/select/demo/index.js +1 -1
- package/components/select/demo/index.md +21 -16
- package/components/select/demo/index.min.js +2570 -756
- package/components/select/dist/auro-select.d.ts +60 -8
- package/components/select/dist/bibtemplateVersion.d.ts +2 -0
- package/components/select/dist/dropdownVersion.d.ts +2 -0
- package/components/select/dist/index.d.ts +0 -1
- package/components/select/dist/index.js +1932 -434
- package/components/select/dist/registered.js +5425 -0
- package/components/select/dist/styles/color-css.d.ts +0 -1
- package/components/select/dist/styles/style-css.d.ts +0 -1
- package/components/select/dist/styles/tokens-css.d.ts +0 -1
- package/package.json +138 -66
- package/packages/build-tools/src/postinstall.mjs +8 -0
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -3
- package/.turbo/cache/013a48308b893dac-meta.json +0 -1
- package/.turbo/cache/013a48308b893dac.tar.zst +0 -0
- package/.turbo/cache/02244170c798a2bd-meta.json +0 -1
- package/.turbo/cache/02244170c798a2bd.tar.zst +0 -0
- package/.turbo/cache/051ff97a20add0e2-meta.json +0 -1
- package/.turbo/cache/051ff97a20add0e2.tar.zst +0 -0
- package/.turbo/cache/07ca42419b9f050c-meta.json +0 -1
- package/.turbo/cache/07ca42419b9f050c.tar.zst +0 -0
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +0 -1
- package/.turbo/cache/0cea4c1f34f3683b.tar.zst +0 -0
- package/.turbo/cache/0ea853339c064fa1-meta.json +0 -1
- package/.turbo/cache/0ea853339c064fa1.tar.zst +0 -0
- package/.turbo/cache/16658beec9f4a809-meta.json +0 -1
- package/.turbo/cache/16658beec9f4a809.tar.zst +0 -0
- package/.turbo/cache/17259cf94d8f8925-meta.json +0 -1
- package/.turbo/cache/17259cf94d8f8925.tar.zst +0 -0
- package/.turbo/cache/1b9818717e4bdf9f-meta.json +0 -1
- package/.turbo/cache/1b9818717e4bdf9f.tar.zst +0 -0
- package/.turbo/cache/1c0f580d37370ba2-meta.json +0 -1
- package/.turbo/cache/1c0f580d37370ba2.tar.zst +0 -0
- package/.turbo/cache/1c99a949ec63ab35-meta.json +0 -1
- package/.turbo/cache/1c99a949ec63ab35.tar.zst +0 -0
- package/.turbo/cache/1df4710eef8ed00d-meta.json +0 -1
- package/.turbo/cache/1df4710eef8ed00d.tar.zst +0 -0
- package/.turbo/cache/204b66d1b253e9cc-meta.json +0 -1
- package/.turbo/cache/204b66d1b253e9cc.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +0 -1
- package/.turbo/cache/257a7a26ea72dbc5.tar.zst +0 -0
- package/.turbo/cache/2a5d0939d6fc1052-meta.json +0 -1
- package/.turbo/cache/2a5d0939d6fc1052.tar.zst +0 -0
- package/.turbo/cache/2e3b829fcf75c836-meta.json +0 -1
- package/.turbo/cache/2e3b829fcf75c836.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +0 -1
- package/.turbo/cache/3bf45120d0cc9bd8.tar.zst +0 -0
- package/.turbo/cache/3d380d0d40404cac-meta.json +0 -1
- package/.turbo/cache/3d380d0d40404cac.tar.zst +0 -0
- package/.turbo/cache/3e12285c614db539-meta.json +0 -1
- package/.turbo/cache/3e12285c614db539.tar.zst +0 -0
- package/.turbo/cache/45035bf5c4147ccd-meta.json +0 -1
- package/.turbo/cache/45035bf5c4147ccd.tar.zst +0 -0
- package/.turbo/cache/5bf2d3f7ba5891e0-meta.json +0 -1
- package/.turbo/cache/5bf2d3f7ba5891e0.tar.zst +0 -0
- package/.turbo/cache/5f304c0f37ef25f3-meta.json +0 -1
- package/.turbo/cache/5f304c0f37ef25f3.tar.zst +0 -0
- package/.turbo/cache/64de7a53e02db647-meta.json +0 -1
- package/.turbo/cache/64de7a53e02db647.tar.zst +0 -0
- package/.turbo/cache/68e5c7af799e011d-meta.json +0 -1
- package/.turbo/cache/68e5c7af799e011d.tar.zst +0 -0
- package/.turbo/cache/691a74627ec57993-meta.json +0 -1
- package/.turbo/cache/691a74627ec57993.tar.zst +0 -0
- package/.turbo/cache/6dd67d179191bda8-meta.json +0 -1
- package/.turbo/cache/6dd67d179191bda8.tar.zst +0 -0
- package/.turbo/cache/6dd7058e6703cb35-meta.json +0 -1
- package/.turbo/cache/6dd7058e6703cb35.tar.zst +0 -0
- package/.turbo/cache/73e9073a5274616d-meta.json +0 -1
- package/.turbo/cache/73e9073a5274616d.tar.zst +0 -0
- package/.turbo/cache/773edc0f83c8c5a5-meta.json +0 -1
- package/.turbo/cache/773edc0f83c8c5a5.tar.zst +0 -0
- package/.turbo/cache/786a822763403879-meta.json +0 -1
- package/.turbo/cache/786a822763403879.tar.zst +0 -0
- package/.turbo/cache/7e1043cffa69f327-meta.json +0 -1
- package/.turbo/cache/7e1043cffa69f327.tar.zst +0 -0
- package/.turbo/cache/7ffd501e81790676-meta.json +0 -1
- package/.turbo/cache/7ffd501e81790676.tar.zst +0 -0
- package/.turbo/cache/80a13352066a9801-meta.json +0 -1
- package/.turbo/cache/80a13352066a9801.tar.zst +0 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +0 -1
- package/.turbo/cache/80b5d974184a01df.tar.zst +0 -0
- package/.turbo/cache/8954c6073396fadd-meta.json +0 -1
- package/.turbo/cache/8954c6073396fadd.tar.zst +0 -0
- package/.turbo/cache/8e79bd5c3a16a72e-meta.json +0 -1
- package/.turbo/cache/8e79bd5c3a16a72e.tar.zst +0 -0
- package/.turbo/cache/8e9ebc3df0e18de0-meta.json +0 -1
- package/.turbo/cache/8e9ebc3df0e18de0.tar.zst +0 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +0 -1
- package/.turbo/cache/92daa6d7c389d548.tar.zst +0 -0
- package/.turbo/cache/973d0eea26083f4b-meta.json +0 -1
- package/.turbo/cache/973d0eea26083f4b.tar.zst +0 -0
- package/.turbo/cache/9c6ad42729c7b2d8-meta.json +0 -1
- package/.turbo/cache/9c6ad42729c7b2d8.tar.zst +0 -0
- package/.turbo/cache/a77bc920ea508bb8-meta.json +0 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/a9a9d012c83882d8-meta.json +0 -1
- package/.turbo/cache/a9a9d012c83882d8.tar.zst +0 -0
- package/.turbo/cache/b4c851d4bebf3b47-meta.json +0 -1
- package/.turbo/cache/b4c851d4bebf3b47.tar.zst +0 -0
- package/.turbo/cache/ba4418918621fbcd-meta.json +0 -1
- package/.turbo/cache/ba4418918621fbcd.tar.zst +0 -0
- package/.turbo/cache/be7c23c37b8ec74b-meta.json +0 -1
- package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
- package/.turbo/cache/bffc7582905c2a5e-meta.json +0 -1
- package/.turbo/cache/bffc7582905c2a5e.tar.zst +0 -0
- package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +0 -1
- package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
- package/.turbo/cache/cc81de9c0b452a7c-meta.json +0 -1
- package/.turbo/cache/cc81de9c0b452a7c.tar.zst +0 -0
- package/.turbo/cache/d572ebb3c833e8f4-meta.json +0 -1
- package/.turbo/cache/d572ebb3c833e8f4.tar.zst +0 -0
- package/.turbo/cache/d61543843c932504-meta.json +0 -1
- package/.turbo/cache/d61543843c932504.tar.zst +0 -0
- package/.turbo/cache/dad1301ac69bcb85-meta.json +0 -1
- package/.turbo/cache/dad1301ac69bcb85.tar.zst +0 -0
- package/.turbo/cache/db361cb6578dca84-meta.json +0 -1
- package/.turbo/cache/db361cb6578dca84.tar.zst +0 -0
- package/.turbo/cache/dea5945f55c6aba5-meta.json +0 -1
- package/.turbo/cache/dea5945f55c6aba5.tar.zst +0 -0
- package/.turbo/cache/dfe1f17e7fce890d-meta.json +0 -1
- package/.turbo/cache/dfe1f17e7fce890d.tar.zst +0 -0
- package/.turbo/cache/e3a224a17cf55bdb-meta.json +0 -1
- package/.turbo/cache/e3a224a17cf55bdb.tar.zst +0 -0
- package/.turbo/cache/e992dab20aeefbaf-meta.json +0 -1
- package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
- package/.turbo/cache/f3ff9040a2196834-meta.json +0 -1
- package/.turbo/cache/f3ff9040a2196834.tar.zst +0 -0
- package/.turbo/cache/fc57c17867dcac3d-meta.json +0 -1
- package/.turbo/cache/fc57c17867dcac3d.tar.zst +0 -0
- package/components/checkbox/.stylelintrc.json +0 -3
- package/components/checkbox/.turbo/turbo-build$colon$sass.log +0 -98
- package/components/checkbox/.turbo/turbo-build.log +0 -185
- package/components/checkbox/.turbo/turbo-bundler.log +0 -13
- package/components/checkbox/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/checkbox/.turbo/turbo-sass$colon$render.log +0 -34
- package/components/checkbox/.turbo/turbo-types.log +0 -4
- package/components/checkbox/dist/auro-checkbox-group.d.ts.map +0 -1
- package/components/checkbox/dist/auro-checkbox.d.ts.map +0 -1
- package/components/checkbox/dist/index.d.ts.map +0 -1
- package/components/checkbox/dist/styles/auro-checkbox-css.d.ts.map +0 -1
- package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts.map +0 -1
- package/components/checkbox/dist/styles/color-css.d.ts.map +0 -1
- package/components/checkbox/dist/styles/colorGroup-css.d.ts.map +0 -1
- package/components/checkbox/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/checkbox/node_modules/chalk/package.json +0 -83
- package/components/checkbox/node_modules/chalk/readme.md +0 -325
- package/components/checkbox/node_modules/chalk/source/index.d.ts +0 -320
- package/components/checkbox/node_modules/chalk/source/index.js +0 -225
- package/components/checkbox/node_modules/chalk/source/utilities.js +0 -33
- package/components/checkbox/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/checkbox/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/checkbox/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/checkbox/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/checkbox/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/checkbox/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/checkbox/package.json +0 -68
- package/components/checkbox/src/auro-checkbox-group.js +0 -331
- package/components/checkbox/src/auro-checkbox.js +0 -193
- package/components/checkbox/src/index.js +0 -8
- package/components/checkbox/src/styles/auro-checkbox-css.js +0 -2
- package/components/checkbox/src/styles/auro-checkbox-group-css.js +0 -2
- package/components/checkbox/src/styles/auro-checkbox-group.css +0 -26
- package/components/checkbox/src/styles/auro-checkbox-group.scss +0 -38
- package/components/checkbox/src/styles/auro-checkbox.css +0 -123
- package/components/checkbox/src/styles/auro-checkbox.scss +0 -100
- package/components/checkbox/src/styles/color-css.js +0 -2
- package/components/checkbox/src/styles/color.css +0 -84
- package/components/checkbox/src/styles/color.scss +0 -118
- package/components/checkbox/src/styles/colorGroup-css.js +0 -2
- package/components/checkbox/src/styles/colorGroup.css +0 -16
- package/components/checkbox/src/styles/colorGroup.scss +0 -24
- package/components/checkbox/src/styles/tokens-css.js +0 -2
- package/components/checkbox/src/styles/tokens.css +0 -9
- package/components/checkbox/src/styles/tokens.scss +0 -11
- package/components/combobox/.stylelintrc.json +0 -3
- package/components/combobox/.turbo/turbo-build$colon$sass.log +0 -46
- package/components/combobox/.turbo/turbo-build.log +0 -163
- package/components/combobox/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/combobox/.turbo/turbo-sass$colon$render.log +0 -10
- package/components/combobox/dist/auro-combobox.d.ts.map +0 -1
- package/components/combobox/dist/formkit/auro-dropdownVersion.d.ts.map +0 -1
- package/components/combobox/dist/formkit/auro-inputVersion.d.ts.map +0 -1
- package/components/combobox/dist/index.d.ts.map +0 -1
- package/components/combobox/dist/styles/style-css.d.ts.map +0 -1
- package/components/combobox/node_modules/chalk/package.json +0 -83
- package/components/combobox/node_modules/chalk/readme.md +0 -325
- package/components/combobox/node_modules/chalk/source/index.d.ts +0 -320
- package/components/combobox/node_modules/chalk/source/index.js +0 -225
- package/components/combobox/node_modules/chalk/source/utilities.js +0 -33
- package/components/combobox/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/combobox/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/combobox/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/combobox/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/combobox/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/combobox/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/combobox/package.json +0 -67
- package/components/combobox/src/auro-combobox.js +0 -724
- package/components/combobox/src/formkit/auro-dropdownVersion.js +0 -1
- package/components/combobox/src/formkit/auro-inputVersion.js +0 -1
- package/components/combobox/src/index.js +0 -6
- package/components/combobox/src/styles/style-css.js +0 -2
- package/components/combobox/src/styles/style.css +0 -60
- package/components/combobox/src/styles/style.scss +0 -46
- package/components/counter/.stylelintrc.json +0 -3
- package/components/counter/.turbo/turbo-build$colon$sass.log +0 -66
- package/components/counter/.turbo/turbo-build.log +0 -87
- package/components/counter/.turbo/turbo-bundler.log +0 -13
- package/components/counter/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/counter/.turbo/turbo-sass$colon$render.log +0 -16
- package/components/counter/.turbo/turbo-types.log +0 -4
- package/components/counter/dist/auro-counter-group.d.ts.map +0 -1
- package/components/counter/dist/auro-counter.d.ts.map +0 -1
- package/components/counter/dist/index.d.ts.map +0 -1
- package/components/counter/dist/styles/counter-group-css.d.ts.map +0 -1
- package/components/counter/dist/styles/style-css.d.ts.map +0 -1
- package/components/counter/node_modules/chalk/package.json +0 -83
- package/components/counter/node_modules/chalk/readme.md +0 -325
- package/components/counter/node_modules/chalk/source/index.d.ts +0 -320
- package/components/counter/node_modules/chalk/source/index.js +0 -225
- package/components/counter/node_modules/chalk/source/utilities.js +0 -33
- package/components/counter/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/counter/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/counter/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/counter/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/counter/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/counter/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/counter/package.json +0 -50
- package/components/counter/src/auro-counter-group.js +0 -48
- package/components/counter/src/auro-counter.js +0 -29
- package/components/counter/src/index.js +0 -8
- package/components/counter/src/styles/counter-group-css.js +0 -2
- package/components/counter/src/styles/counter-group.css +0 -4
- package/components/counter/src/styles/counter-group.scss +0 -17
- package/components/counter/src/styles/style-css.js +0 -2
- package/components/counter/src/styles/style.css +0 -4
- package/components/counter/src/styles/style.scss +0 -17
- package/components/datepicker/.stylelintrc.json +0 -3
- package/components/datepicker/.turbo/turbo-build$colon$sass.log +0 -352
- package/components/datepicker/.turbo/turbo-build.log +0 -493
- package/components/datepicker/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/datepicker/.turbo/turbo-sass$colon$render.log +0 -58
- package/components/datepicker/dist/auro-calendar-cell.d.ts.map +0 -1
- package/components/datepicker/dist/auro-calendar-month.d.ts.map +0 -1
- package/components/datepicker/dist/auro-calendar.d.ts.map +0 -1
- package/components/datepicker/dist/auro-datepicker.d.ts.map +0 -1
- package/components/datepicker/dist/dropdownVersion.d.ts.map +0 -1
- package/components/datepicker/dist/formkit/auro-dropdownVersion.d.ts.map +0 -1
- package/components/datepicker/dist/formkit/auro-inputVersion.d.ts.map +0 -1
- package/components/datepicker/dist/index.d.ts.map +0 -1
- package/components/datepicker/dist/popoverVersion.d.ts.map +0 -1
- package/components/datepicker/dist/styles/color-calendar-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/color-cell-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/color-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/color-month-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/style-css.d.ts.map +0 -1
- package/components/datepicker/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/datepicker/dist/utilities.d.ts.map +0 -1
- package/components/datepicker/dist/utilitiesCalendar.d.ts.map +0 -1
- package/components/datepicker/dist/utilitiesCalendarRender.d.ts.map +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts.map +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts.map +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts.map +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts.map +0 -1
- package/components/datepicker/node_modules/chalk/package.json +0 -83
- package/components/datepicker/node_modules/chalk/readme.md +0 -325
- package/components/datepicker/node_modules/chalk/source/index.d.ts +0 -320
- package/components/datepicker/node_modules/chalk/source/index.js +0 -225
- package/components/datepicker/node_modules/chalk/source/utilities.js +0 -33
- package/components/datepicker/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/datepicker/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/datepicker/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/datepicker/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/datepicker/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/datepicker/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/datepicker/node_modules/rollup-plugin-serve/LICENSE.md +0 -21
- package/components/datepicker/node_modules/rollup-plugin-serve/README.md +0 -137
- package/components/datepicker/node_modules/rollup-plugin-serve/dist/index.cjs +0 -181
- package/components/datepicker/node_modules/rollup-plugin-serve/dist/index.mjs +0 -173
- package/components/datepicker/node_modules/rollup-plugin-serve/index.d.ts +0 -75
- package/components/datepicker/node_modules/rollup-plugin-serve/package.json +0 -51
- package/components/datepicker/package.json +0 -79
- package/components/datepicker/src/auro-calendar-cell.js +0 -381
- package/components/datepicker/src/auro-calendar-month.js +0 -128
- package/components/datepicker/src/auro-calendar.js +0 -329
- package/components/datepicker/src/auro-datepicker.js +0 -1002
- package/components/datepicker/src/dropdownVersion.js +0 -0
- package/components/datepicker/src/formkit/auro-dropdownVersion.js +0 -1
- package/components/datepicker/src/formkit/auro-inputVersion.js +0 -1
- package/components/datepicker/src/index.js +0 -6
- package/components/datepicker/src/popoverVersion.js +0 -1
- package/components/datepicker/src/styles/color-calendar-css.js +0 -2
- package/components/datepicker/src/styles/color-calendar.css +0 -35
- package/components/datepicker/src/styles/color-calendar.scss +0 -51
- package/components/datepicker/src/styles/color-cell-css.js +0 -2
- package/components/datepicker/src/styles/color-cell.css +0 -45
- package/components/datepicker/src/styles/color-cell.scss +0 -73
- package/components/datepicker/src/styles/color-css.js +0 -2
- package/components/datepicker/src/styles/color-month-css.js +0 -2
- package/components/datepicker/src/styles/color-month.css +0 -34
- package/components/datepicker/src/styles/color-month.scss +0 -27
- package/components/datepicker/src/styles/color.css +0 -43
- package/components/datepicker/src/styles/color.scss +0 -30
- package/components/datepicker/src/styles/style-auro-calendar-cell-css.js +0 -2
- package/components/datepicker/src/styles/style-auro-calendar-cell.css +0 -123
- package/components/datepicker/src/styles/style-auro-calendar-cell.scss +0 -147
- package/components/datepicker/src/styles/style-auro-calendar-css.js +0 -2
- package/components/datepicker/src/styles/style-auro-calendar-month-css.js +0 -2
- package/components/datepicker/src/styles/style-auro-calendar-month.css +0 -121
- package/components/datepicker/src/styles/style-auro-calendar-month.scss +0 -141
- package/components/datepicker/src/styles/style-auro-calendar.css +0 -152
- package/components/datepicker/src/styles/style-auro-calendar.scss +0 -191
- package/components/datepicker/src/styles/style-css.js +0 -2
- package/components/datepicker/src/styles/style.css +0 -111
- package/components/datepicker/src/styles/style.scss +0 -107
- package/components/datepicker/src/styles/tokens-css.js +0 -2
- package/components/datepicker/src/styles/tokens.css +0 -22
- package/components/datepicker/src/styles/tokens.scss +0 -25
- package/components/datepicker/src/utilities.js +0 -87
- package/components/datepicker/src/utilitiesCalendar.js +0 -138
- package/components/datepicker/src/utilitiesCalendarRender.js +0 -156
- package/components/datepicker/src/vendor/wc-range-datepicker/day.js +0 -8
- package/components/datepicker/src/vendor/wc-range-datepicker/range-datepicker-calendar.js +0 -521
- package/components/datepicker/src/vendor/wc-range-datepicker/range-datepicker-cell.js +0 -211
- package/components/datepicker/src/vendor/wc-range-datepicker/range-datepicker.js +0 -254
- package/components/dropdown/.stylelintrc.json +0 -3
- package/components/dropdown/.turbo/turbo-build$colon$sass.log +0 -75
- package/components/dropdown/.turbo/turbo-build$colon$version.log +0 -7
- package/components/dropdown/.turbo/turbo-build.log +0 -206
- package/components/dropdown/.turbo/turbo-bundler.log +0 -13
- package/components/dropdown/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/dropdown/.turbo/turbo-sass$colon$render.log +0 -34
- package/components/dropdown/.turbo/turbo-types.log +0 -4
- package/components/dropdown/dist/auro-dropdown.d.ts.map +0 -1
- package/components/dropdown/dist/auro-dropdownBib.d.ts.map +0 -1
- package/components/dropdown/dist/iconVersion.d.ts.map +0 -1
- package/components/dropdown/dist/index.d.ts.map +0 -1
- package/components/dropdown/dist/styles/bibColors-css.d.ts.map +0 -1
- package/components/dropdown/dist/styles/bibStyles-css.d.ts.map +0 -1
- package/components/dropdown/dist/styles/color-css.d.ts.map +0 -1
- package/components/dropdown/dist/styles/style-css.d.ts.map +0 -1
- package/components/dropdown/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/dropdown/node_modules/chalk/package.json +0 -83
- package/components/dropdown/node_modules/chalk/readme.md +0 -325
- package/components/dropdown/node_modules/chalk/source/index.d.ts +0 -320
- package/components/dropdown/node_modules/chalk/source/index.js +0 -225
- package/components/dropdown/node_modules/chalk/source/utilities.js +0 -33
- package/components/dropdown/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/dropdown/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/dropdown/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/dropdown/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/dropdown/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/dropdown/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/dropdown/package.json +0 -57
- package/components/dropdown/src/auro-dropdown.js +0 -474
- package/components/dropdown/src/auro-dropdownBib.js +0 -106
- package/components/dropdown/src/iconVersion.js +0 -1
- package/components/dropdown/src/index.js +0 -6
- package/components/dropdown/src/styles/bibColors-css.js +0 -2
- package/components/dropdown/src/styles/bibColors.css +0 -6
- package/components/dropdown/src/styles/bibColors.scss +0 -18
- package/components/dropdown/src/styles/bibStyles-css.js +0 -2
- package/components/dropdown/src/styles/bibStyles.css +0 -43
- package/components/dropdown/src/styles/bibStyles.scss +0 -60
- package/components/dropdown/src/styles/color-css.js +0 -2
- package/components/dropdown/src/styles/color.css +0 -59
- package/components/dropdown/src/styles/color.scss +0 -79
- package/components/dropdown/src/styles/style-css.js +0 -2
- package/components/dropdown/src/styles/style.css +0 -92
- package/components/dropdown/src/styles/style.scss +0 -122
- package/components/dropdown/src/styles/tokens-css.js +0 -2
- package/components/dropdown/src/styles/tokens.css +0 -13
- package/components/dropdown/src/styles/tokens.scss +0 -15
- package/components/form/.stylelintrc.json +0 -3
- package/components/form/.turbo/turbo-build$colon$sass.log +0 -57
- package/components/form/.turbo/turbo-build$colon$version.log +0 -4
- package/components/form/.turbo/turbo-build.log +0 -113
- package/components/form/.turbo/turbo-bundler.log +0 -13
- package/components/form/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/form/.turbo/turbo-sass$colon$render.log +0 -10
- package/components/form/.turbo/turbo-types.log +0 -4
- package/components/form/dist/auro-form.d.ts.map +0 -1
- package/components/form/dist/index.d.ts.map +0 -1
- package/components/form/dist/styles/style-css.d.ts.map +0 -1
- package/components/form/node_modules/chalk/package.json +0 -83
- package/components/form/node_modules/chalk/readme.md +0 -325
- package/components/form/node_modules/chalk/source/index.d.ts +0 -320
- package/components/form/node_modules/chalk/source/index.js +0 -225
- package/components/form/node_modules/chalk/source/utilities.js +0 -33
- package/components/form/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/form/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/form/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/form/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/form/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/form/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/form/package.json +0 -72
- package/components/form/src/auro-form.js +0 -74
- package/components/form/src/index.js +0 -6
- package/components/form/src/styles/style-css.js +0 -2
- package/components/form/src/styles/style.css +0 -36
- package/components/form/src/styles/style.scss +0 -37
- package/components/input/.stylelintrc.json +0 -3
- package/components/input/.turbo/turbo-build$colon$sass.log +0 -198
- package/components/input/.turbo/turbo-build$colon$version.log +0 -10
- package/components/input/.turbo/turbo-build.log +0 -353
- package/components/input/.turbo/turbo-bundler.log +0 -13
- package/components/input/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/input/.turbo/turbo-sass$colon$render.log +0 -58
- package/components/input/.turbo/turbo-types.log +0 -4
- package/components/input/dist/auro-input.d.ts.map +0 -1
- package/components/input/dist/base-input.d.ts.map +0 -1
- package/components/input/dist/buttonVersion.d.ts.map +0 -1
- package/components/input/dist/i18n.d.ts.map +0 -1
- package/components/input/dist/iconVersion.d.ts.map +0 -1
- package/components/input/dist/index.d.ts.map +0 -1
- package/components/input/dist/styles/borders-css.d.ts.map +0 -1
- package/components/input/dist/styles/color-css.d.ts.map +0 -1
- package/components/input/dist/styles/helpText-css.d.ts.map +0 -1
- package/components/input/dist/styles/input-css.d.ts.map +0 -1
- package/components/input/dist/styles/label-css.d.ts.map +0 -1
- package/components/input/dist/styles/mixins-css.d.ts.map +0 -1
- package/components/input/dist/styles/notificationIcons-css.d.ts.map +0 -1
- package/components/input/dist/styles/style-css.d.ts.map +0 -1
- package/components/input/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/input/node_modules/chalk/package.json +0 -83
- package/components/input/node_modules/chalk/readme.md +0 -325
- package/components/input/node_modules/chalk/source/index.d.ts +0 -320
- package/components/input/node_modules/chalk/source/index.js +0 -225
- package/components/input/node_modules/chalk/source/utilities.js +0 -33
- package/components/input/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/input/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/input/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/input/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/input/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/input/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/input/package.json +0 -75
- package/components/input/src/auro-input.js +0 -241
- package/components/input/src/base-input.js +0 -1103
- package/components/input/src/buttonVersion.js +0 -1
- package/components/input/src/i18n.js +0 -102
- package/components/input/src/iconVersion.js +0 -1
- package/components/input/src/index.js +0 -6
- package/components/input/src/styles/@aurodesignsystem/webcorestylesheets/src/breakpoints +0 -0
- package/components/input/src/styles/borders-css.js +0 -2
- package/components/input/src/styles/borders.css +0 -35
- package/components/input/src/styles/borders.scss +0 -49
- package/components/input/src/styles/color-css.js +0 -2
- package/components/input/src/styles/color.css +0 -62
- package/components/input/src/styles/color.scss +0 -89
- package/components/input/src/styles/helpText-css.js +0 -2
- package/components/input/src/styles/helpText.css +0 -6
- package/components/input/src/styles/helpText.scss +0 -9
- package/components/input/src/styles/input-css.js +0 -2
- package/components/input/src/styles/input.css +0 -35
- package/components/input/src/styles/input.scss +0 -53
- package/components/input/src/styles/label-css.js +0 -2
- package/components/input/src/styles/label.css +0 -45
- package/components/input/src/styles/label.scss +0 -71
- package/components/input/src/styles/mixins-css.js +0 -2
- package/components/input/src/styles/mixins.css +0 -1
- package/components/input/src/styles/mixins.scss +0 -45
- package/components/input/src/styles/notificationIcons-css.js +0 -2
- package/components/input/src/styles/notificationIcons.css +0 -84
- package/components/input/src/styles/notificationIcons.scss +0 -109
- package/components/input/src/styles/style-css.js +0 -2
- package/components/input/src/styles/style.css +0 -290
- package/components/input/src/styles/style.scss +0 -53
- package/components/input/src/styles/tokens-css.js +0 -2
- package/components/input/src/styles/tokens.css +0 -9
- package/components/input/src/styles/tokens.scss +0 -11
- package/components/menu/.stylelintrc.json +0 -3
- package/components/menu/.turbo/turbo-build$colon$sass.log +0 -86
- package/components/menu/.turbo/turbo-build$colon$version.log +0 -7
- package/components/menu/.turbo/turbo-build.log +0 -184
- package/components/menu/.turbo/turbo-bundler.log +0 -13
- package/components/menu/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/menu/.turbo/turbo-sass$colon$render.log +0 -34
- package/components/menu/.turbo/turbo-types.log +0 -4
- package/components/menu/dist/auro-menu.d.ts.map +0 -1
- package/components/menu/dist/auro-menuoption.d.ts.map +0 -1
- package/components/menu/dist/iconVersion.d.ts.map +0 -1
- package/components/menu/dist/index.d.ts.map +0 -1
- package/components/menu/dist/styles/color-menu-css.d.ts.map +0 -1
- package/components/menu/dist/styles/color-menuoption-css.d.ts.map +0 -1
- package/components/menu/dist/styles/style-menu-css.d.ts.map +0 -1
- package/components/menu/dist/styles/style-menuoption-css.d.ts.map +0 -1
- package/components/menu/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/menu/node_modules/chalk/package.json +0 -83
- package/components/menu/node_modules/chalk/readme.md +0 -325
- package/components/menu/node_modules/chalk/source/index.d.ts +0 -320
- package/components/menu/node_modules/chalk/source/index.js +0 -225
- package/components/menu/node_modules/chalk/source/utilities.js +0 -33
- package/components/menu/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/menu/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/menu/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/menu/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/menu/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/menu/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/menu/node_modules/mime/CHANGELOG.md +0 -296
- package/components/menu/node_modules/mime/Mime.js +0 -97
- package/components/menu/node_modules/mime/README.md +0 -187
- package/components/menu/node_modules/mime/cli.js +0 -46
- package/components/menu/node_modules/mime/index.js +0 -4
- package/components/menu/node_modules/mime/lite.js +0 -4
- package/components/menu/node_modules/mime/package.json +0 -52
- package/components/menu/node_modules/mime/types/other.js +0 -1
- package/components/menu/node_modules/mime/types/standard.js +0 -1
- package/components/menu/node_modules/rollup-plugin-serve/LICENSE.md +0 -21
- package/components/menu/node_modules/rollup-plugin-serve/README.md +0 -135
- package/components/menu/node_modules/rollup-plugin-serve/dist/index.cjs +0 -181
- package/components/menu/node_modules/rollup-plugin-serve/dist/index.cjs.js +0 -197
- package/components/menu/node_modules/rollup-plugin-serve/dist/index.es.js +0 -193
- package/components/menu/node_modules/rollup-plugin-serve/dist/index.mjs +0 -173
- package/components/menu/node_modules/rollup-plugin-serve/package.json +0 -44
- package/components/menu/package.json +0 -70
- package/components/menu/src/auro-menu.js +0 -539
- package/components/menu/src/auro-menuoption.js +0 -147
- package/components/menu/src/iconVersion.js +0 -1
- package/components/menu/src/index.js +0 -8
- package/components/menu/src/styles/color-menu-css.js +0 -2
- package/components/menu/src/styles/color-menu.css +0 -4
- package/components/menu/src/styles/color-menu.scss +0 -12
- package/components/menu/src/styles/color-menuoption-css.js +0 -2
- package/components/menu/src/styles/color-menuoption.css +0 -23
- package/components/menu/src/styles/color-menuoption.scss +0 -33
- package/components/menu/src/styles/style-menu-css.js +0 -2
- package/components/menu/src/styles/style-menu.css +0 -2061
- package/components/menu/src/styles/style-menu.scss +0 -80
- package/components/menu/src/styles/style-menuoption-css.js +0 -2
- package/components/menu/src/styles/style-menuoption.css +0 -45
- package/components/menu/src/styles/style-menuoption.scss +0 -66
- package/components/menu/src/styles/tokens-css.js +0 -2
- package/components/menu/src/styles/tokens.css +0 -6
- package/components/menu/src/styles/tokens.scss +0 -6
- package/components/radio/.stylelintrc.json +0 -3
- package/components/radio/.turbo/turbo-build$colon$sass.log +0 -130
- package/components/radio/.turbo/turbo-build.log +0 -216
- package/components/radio/.turbo/turbo-bundler.log +0 -13
- package/components/radio/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/radio/.turbo/turbo-sass$colon$render.log +0 -34
- package/components/radio/.turbo/turbo-types.log +0 -4
- package/components/radio/dist/auro-radio-group.d.ts.map +0 -1
- package/components/radio/dist/auro-radio.d.ts.map +0 -1
- package/components/radio/dist/index.d.ts.map +0 -1
- package/components/radio/dist/styles/auro-radio-group-css.d.ts.map +0 -1
- package/components/radio/dist/styles/color-css.d.ts.map +0 -1
- package/components/radio/dist/styles/groupColor-css.d.ts.map +0 -1
- package/components/radio/dist/styles/style-css.d.ts.map +0 -1
- package/components/radio/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/radio/node_modules/chalk/package.json +0 -83
- package/components/radio/node_modules/chalk/readme.md +0 -325
- package/components/radio/node_modules/chalk/source/index.d.ts +0 -320
- package/components/radio/node_modules/chalk/source/index.js +0 -225
- package/components/radio/node_modules/chalk/source/utilities.js +0 -33
- package/components/radio/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/radio/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/radio/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/radio/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/radio/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/radio/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/radio/package.json +0 -69
- package/components/radio/src/auro-radio-group.js +0 -433
- package/components/radio/src/auro-radio.js +0 -256
- package/components/radio/src/index.js +0 -8
- package/components/radio/src/styles/auro-radio-group-css.js +0 -2
- package/components/radio/src/styles/auro-radio-group.css +0 -23
- package/components/radio/src/styles/auro-radio-group.scss +0 -36
- package/components/radio/src/styles/color-css.js +0 -2
- package/components/radio/src/styles/color.css +0 -45
- package/components/radio/src/styles/color.scss +0 -56
- package/components/radio/src/styles/groupColor-css.js +0 -2
- package/components/radio/src/styles/groupColor.css +0 -21
- package/components/radio/src/styles/groupColor.scss +0 -33
- package/components/radio/src/styles/style-css.js +0 -2
- package/components/radio/src/styles/style.css +0 -113
- package/components/radio/src/styles/style.scss +0 -99
- package/components/radio/src/styles/tokens-css.js +0 -2
- package/components/radio/src/styles/tokens.css +0 -9
- package/components/radio/src/styles/tokens.scss +0 -12
- package/components/select/.stylelintrc.json +0 -3
- package/components/select/.turbo/turbo-build$colon$sass.log +0 -122
- package/components/select/.turbo/turbo-build.log +0 -241
- package/components/select/.turbo/turbo-postCss$colon$component.log +0 -5
- package/components/select/.turbo/turbo-sass$colon$render.log +0 -22
- package/components/select/dist/auro-select.d.ts.map +0 -1
- package/components/select/dist/formkit/auro-dropdownVersion.d.ts.map +0 -1
- package/components/select/dist/index.d.ts.map +0 -1
- package/components/select/dist/styles/color-css.d.ts.map +0 -1
- package/components/select/dist/styles/style-css.d.ts.map +0 -1
- package/components/select/dist/styles/tokens-css.d.ts.map +0 -1
- package/components/select/node_modules/chalk/package.json +0 -83
- package/components/select/node_modules/chalk/readme.md +0 -325
- package/components/select/node_modules/chalk/source/index.d.ts +0 -320
- package/components/select/node_modules/chalk/source/index.js +0 -225
- package/components/select/node_modules/chalk/source/utilities.js +0 -33
- package/components/select/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
- package/components/select/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
- package/components/select/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
- package/components/select/node_modules/chalk/source/vendor/supports-color/browser.js +0 -30
- package/components/select/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
- package/components/select/node_modules/chalk/source/vendor/supports-color/index.js +0 -182
- package/components/select/node_modules/mime/CHANGELOG.md +0 -296
- package/components/select/node_modules/mime/Mime.js +0 -97
- package/components/select/node_modules/mime/README.md +0 -187
- package/components/select/node_modules/mime/cli.js +0 -46
- package/components/select/node_modules/mime/index.js +0 -4
- package/components/select/node_modules/mime/lite.js +0 -4
- package/components/select/node_modules/mime/package.json +0 -52
- package/components/select/node_modules/mime/types/other.js +0 -1
- package/components/select/node_modules/mime/types/standard.js +0 -1
- package/components/select/node_modules/rollup-plugin-serve/LICENSE.md +0 -21
- package/components/select/node_modules/rollup-plugin-serve/README.md +0 -135
- package/components/select/node_modules/rollup-plugin-serve/dist/index.cjs +0 -181
- package/components/select/node_modules/rollup-plugin-serve/dist/index.cjs.js +0 -197
- package/components/select/node_modules/rollup-plugin-serve/dist/index.es.js +0 -193
- package/components/select/node_modules/rollup-plugin-serve/dist/index.mjs +0 -173
- package/components/select/node_modules/rollup-plugin-serve/package.json +0 -44
- package/components/select/package.json +0 -70
- package/components/select/packageScripts/postinstall.mjs +0 -28
- package/components/select/src/auro-select.js +0 -559
- package/components/select/src/formkit/auro-dropdownVersion.js +0 -1
- package/components/select/src/index.js +0 -6
- package/components/select/src/styles/color-css.js +0 -2
- package/components/select/src/styles/color.css +0 -63
- package/components/select/src/styles/color.scss +0 -33
- package/components/select/src/styles/style-css.js +0 -2
- package/components/select/src/styles/style.css +0 -104
- package/components/select/src/styles/style.scss +0 -76
- package/components/select/src/styles/tokens-css.js +0 -2
- package/components/select/src/styles/tokens.css +0 -3
- package/components/select/src/styles/tokens.scss +0 -5
- package/packages/build-tools/package.json +0 -15
- package/packages/build-tools/src/docProcessor.mjs +0 -104
- package/packages/build-tools/src/formVersionWriter.mjs +0 -75
- package/packages/build-tools/src/index.js +0 -1
- package/packages/build-tools/src/kitDocProcessor.mjs +0 -66
- package/packages/form-validation/package.json +0 -12
- package/packages/form-validation/src/index.js +0 -1
- package/packages/form-validation/src/validation.js +0 -259
- package/packages/typescript/base.json +0 -19
- package/packages/typescript/package.json +0 -20
- package/turbo.json +0 -100
|
@@ -0,0 +1,3365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const t$4=globalThis,i$9=t$4.trustedTypes,s$4=i$9?i$9.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$7="$lit$",h$3=`lit$${Math.random().toFixed(9).slice(2)}$`,o$7="?"+h$3,n$6=`<${o$7}>`,r$7=document,l$4=()=>r$7.createComment(""),c$5=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$4=Array.isArray,u$4=t=>a$4(t)||"function"==typeof t?.[Symbol.iterator],d$3="[ \t\n\f\r]",f$3=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v$1=/-->/g,_$1=/>/g,m$1=RegExp(`>|${d$3}(?:([^\\s"'>=/]+)(${d$3}*=${d$3}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p$3=/'/g,g$1=/"/g,$$1=/^(?:script|style|textarea|title)$/i,y$3=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x$1=y$3(1),T$1=Symbol.for("lit-noChange"),E$1=Symbol.for("lit-nothing"),A$1=new WeakMap,C$1=r$7.createTreeWalker(r$7,129);function P$1(t,i){if(!a$4(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$4?s$4.createHTML(i):i}const V$1=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f$3;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f$3?"!--"===u[1]?c=v$1:void 0!==u[1]?c=_$1:void 0!==u[2]?($$1.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m$1):void 0!==u[3]&&(c=m$1):c===m$1?">"===u[0]?(c=r??f$3,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m$1:'"'===u[3]?g$1:p$3):c===g$1||c===p$3?c=m$1:c===v$1||c===_$1?c=f$3:(c=m$1,r=void 0);const x=c===m$1&&t[i+1].startsWith("/>")?" ":"";l+=c===f$3?s+n$6:d>=0?(o.push(a),s.slice(0,d)+e$7+s.slice(d)+h$3+x):s+h$3+(-2===d?i:x);}return [P$1(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};let N$1 = class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V$1(t,s);if(this.el=N.createElement(f,n),C$1.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C$1.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$7)){const i=v[a++],s=r.getAttribute(t).split(h$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H$1:"?"===e[1]?I$1:"@"===e[1]?L$1:k$1}),r.removeAttribute(t);}else t.startsWith(h$3)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($$1.test(r.tagName)){const t=r.textContent.split(h$3),s=t.length-1;if(s>0){r.textContent=i$9?i$9.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$4()),C$1.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$4());}}}else if(8===r.nodeType)if(r.data===o$7)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h$3,t+1));)d.push({type:7,index:c}),t+=h$3.length-1;}c++;}}static createElement(t,i){const s=r$7.createElement("template");return s.innerHTML=t,s}};function S$3(t,i,s=t,e){if(i===T$1)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c$5(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S$3(t,h._$AS(t,i.values),h,e)),i}let M$1 = class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$7).importNode(i,true);C$1.currentNode=e;let h=C$1.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R$1(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z$1(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C$1.nextNode(),o++);}return C$1.currentNode=r$7,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}};let R$1 = class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E$1,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S$3(this,t,i),c$5(t)?t===E$1||null==t||""===t?(this._$AH!==E$1&&this._$AR(),this._$AH=E$1):t!==this._$AH&&t!==T$1&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$4(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E$1&&c$5(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$7.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N$1.createElement(P$1(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M$1(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A$1.get(t.strings);return void 0===i&&A$1.set(t.strings,i=new N$1(t)),i}k(t){a$4(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$4()),this.O(l$4()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}};let k$1 = class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E$1,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E$1;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S$3(this,t,i,0),o=!c$5(t)||t!==this._$AH&&t!==T$1,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S$3(this,e[s+n],i,n),r===T$1&&(r=this._$AH[n]),o||=!c$5(r)||r!==this._$AH[n],r===E$1?t=E$1:t!==E$1&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E$1?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}};let H$1 = class H extends k$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E$1?void 0:t;}};let I$1 = class I extends k$1{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E$1);}};let L$1 = class L extends k$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S$3(this,t,i,0)??E$1)===T$1)return;const s=this._$AH,e=t===E$1&&s!==E$1||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E$1&&(s===E$1||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}};let z$1 = class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S$3(this,t);}};const j$1=t$4.litHtmlPolyfillSupport;j$1?.(N$1,R$1),(t$4.litHtmlVersions??=[]).push("3.2.1");const B$1=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R$1(i.insertBefore(l$4(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2020 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/
|
|
13
|
+
const a$3=Symbol.for(""),o$6=t=>{if(t?.r===a$3)return t?._$litStatic$},s$3=t=>({_$litStatic$:t,r:a$3}),i$8=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a$3}),l$3=new Map,n$5=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$6(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l$3.get(t))&&(n.raw=n,l$3.set(t,r=n)),e=u;}return t(r,...e)},u$3=n$5(x$1);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2019 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/
|
|
20
|
+
const t$3=globalThis,e$6=t$3.ShadowRoot&&(void 0===t$3.ShadyCSS||t$3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$6&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$6=t=>new n$4("string"==typeof t?t:t+"",void 0,s$2),i$7=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$4(o,t,s$2)},S$2=(s,o)=>{if(e$6)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$3.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$4=e$6?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$6(e)})(t):t;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2017 Google LLC
|
|
25
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
+
*/const{is:i$6,defineProperty:e$5,getOwnPropertyDescriptor:r$5,getOwnPropertyNames:h$2,getOwnPropertySymbols:o$4,getPrototypeOf:n$3}=Object,a$2=globalThis,c$3=a$2.trustedTypes,l$2=c$3?c$3.emptyScript:"",p$2=a$2.reactiveElementPolyfillSupport,d$2=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$2=(t,s)=>!i$6(t,s),y$2={attribute:true,type:String,converter:u$2,reflect:false,hasChanged:f$2};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let b$1 = class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y$2){if(s.state&&(s.attribute=false),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$5(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$5(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$2}static _$Ei(){if(this.hasOwnProperty(d$2("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$2("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$2("properties"))){const t=this.properties,s=[...h$2(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$4(s));}else void 0!==s&&i.push(c$4(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$2(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$2)(this[t],s))return;this.P(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),true===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t) true!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=false,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$2("elementProperties")]=new Map,b$1[d$2("finalized")]=new Map,p$2?.({ReactiveElement:b$1}),(a$2.reactiveElementVersions??=[]).push("2.0.4");
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/let r$4 = class r extends b$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B$1(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T$1}};r$4._$litElement$=true,r$4["finalized"]=true,globalThis.litElementHydrateSupport?.({LitElement:r$4});const i$5=globalThis.litElementPolyfillSupport;i$5?.({LitElement:r$4});(globalThis.litElementVersions??=[]).push("4.1.1");
|
|
33
|
+
|
|
34
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
35
|
+
// See LICENSE in the project root for license information.
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
40
|
+
|
|
41
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
42
|
+
|
|
43
|
+
/* eslint-disable jsdoc/require-param */
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* This will register a new custom element with the browser.
|
|
47
|
+
* @param {String} name - The name of the custom element.
|
|
48
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
49
|
+
* @returns {void}
|
|
50
|
+
*/
|
|
51
|
+
registerComponent(name, componentClass) {
|
|
52
|
+
if (!customElements.get(name)) {
|
|
53
|
+
customElements.define(name, class extends componentClass {});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
closestElement(
|
|
62
|
+
selector, // selector like in .closest()
|
|
63
|
+
base = this, // extra functionality to skip a parent
|
|
64
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
65
|
+
!el || el === document || el === window
|
|
66
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
67
|
+
: found
|
|
68
|
+
? found // found a selector INside this element
|
|
69
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
70
|
+
) {
|
|
71
|
+
return __Closest(base);
|
|
72
|
+
}
|
|
73
|
+
/* eslint-enable jsdoc/require-param */
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
77
|
+
* @param {Object} elem - The element to check.
|
|
78
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
79
|
+
* @returns {void}
|
|
80
|
+
*/
|
|
81
|
+
handleComponentTagRename(elem, tagName) {
|
|
82
|
+
const tag = tagName.toLowerCase();
|
|
83
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
84
|
+
|
|
85
|
+
if (elemTag !== tag) {
|
|
86
|
+
elem.setAttribute(tag, true);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Validates if an element is a specific Auro component.
|
|
92
|
+
* @param {Object} elem - The element to validate.
|
|
93
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
94
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
95
|
+
*/
|
|
96
|
+
elementMatch(elem, tagName) {
|
|
97
|
+
const tag = tagName.toLowerCase();
|
|
98
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
99
|
+
|
|
100
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Custom positioning reference element.
|
|
106
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
110
|
+
const alignments = ['start', 'end'];
|
|
111
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
112
|
+
const min = Math.min;
|
|
113
|
+
const max = Math.max;
|
|
114
|
+
const round = Math.round;
|
|
115
|
+
const floor = Math.floor;
|
|
116
|
+
const createCoords = v => ({
|
|
117
|
+
x: v,
|
|
118
|
+
y: v
|
|
119
|
+
});
|
|
120
|
+
const oppositeSideMap = {
|
|
121
|
+
left: 'right',
|
|
122
|
+
right: 'left',
|
|
123
|
+
bottom: 'top',
|
|
124
|
+
top: 'bottom'
|
|
125
|
+
};
|
|
126
|
+
const oppositeAlignmentMap = {
|
|
127
|
+
start: 'end',
|
|
128
|
+
end: 'start'
|
|
129
|
+
};
|
|
130
|
+
function evaluate(value, param) {
|
|
131
|
+
return typeof value === 'function' ? value(param) : value;
|
|
132
|
+
}
|
|
133
|
+
function getSide(placement) {
|
|
134
|
+
return placement.split('-')[0];
|
|
135
|
+
}
|
|
136
|
+
function getAlignment(placement) {
|
|
137
|
+
return placement.split('-')[1];
|
|
138
|
+
}
|
|
139
|
+
function getOppositeAxis(axis) {
|
|
140
|
+
return axis === 'x' ? 'y' : 'x';
|
|
141
|
+
}
|
|
142
|
+
function getAxisLength(axis) {
|
|
143
|
+
return axis === 'y' ? 'height' : 'width';
|
|
144
|
+
}
|
|
145
|
+
function getSideAxis(placement) {
|
|
146
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
147
|
+
}
|
|
148
|
+
function getAlignmentAxis(placement) {
|
|
149
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
150
|
+
}
|
|
151
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
152
|
+
if (rtl === void 0) {
|
|
153
|
+
rtl = false;
|
|
154
|
+
}
|
|
155
|
+
const alignment = getAlignment(placement);
|
|
156
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
157
|
+
const length = getAxisLength(alignmentAxis);
|
|
158
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
159
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
160
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
161
|
+
}
|
|
162
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
163
|
+
}
|
|
164
|
+
function getExpandedPlacements(placement) {
|
|
165
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
166
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
167
|
+
}
|
|
168
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
169
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
170
|
+
}
|
|
171
|
+
function getSideList(side, isStart, rtl) {
|
|
172
|
+
const lr = ['left', 'right'];
|
|
173
|
+
const rl = ['right', 'left'];
|
|
174
|
+
const tb = ['top', 'bottom'];
|
|
175
|
+
const bt = ['bottom', 'top'];
|
|
176
|
+
switch (side) {
|
|
177
|
+
case 'top':
|
|
178
|
+
case 'bottom':
|
|
179
|
+
if (rtl) return isStart ? rl : lr;
|
|
180
|
+
return isStart ? lr : rl;
|
|
181
|
+
case 'left':
|
|
182
|
+
case 'right':
|
|
183
|
+
return isStart ? tb : bt;
|
|
184
|
+
default:
|
|
185
|
+
return [];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
189
|
+
const alignment = getAlignment(placement);
|
|
190
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
191
|
+
if (alignment) {
|
|
192
|
+
list = list.map(side => side + "-" + alignment);
|
|
193
|
+
if (flipAlignment) {
|
|
194
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return list;
|
|
198
|
+
}
|
|
199
|
+
function getOppositePlacement(placement) {
|
|
200
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
201
|
+
}
|
|
202
|
+
function expandPaddingObject(padding) {
|
|
203
|
+
return {
|
|
204
|
+
top: 0,
|
|
205
|
+
right: 0,
|
|
206
|
+
bottom: 0,
|
|
207
|
+
left: 0,
|
|
208
|
+
...padding
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function getPaddingObject(padding) {
|
|
212
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
213
|
+
top: padding,
|
|
214
|
+
right: padding,
|
|
215
|
+
bottom: padding,
|
|
216
|
+
left: padding
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function rectToClientRect(rect) {
|
|
220
|
+
const {
|
|
221
|
+
x,
|
|
222
|
+
y,
|
|
223
|
+
width,
|
|
224
|
+
height
|
|
225
|
+
} = rect;
|
|
226
|
+
return {
|
|
227
|
+
width,
|
|
228
|
+
height,
|
|
229
|
+
top: y,
|
|
230
|
+
left: x,
|
|
231
|
+
right: x + width,
|
|
232
|
+
bottom: y + height,
|
|
233
|
+
x,
|
|
234
|
+
y
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
239
|
+
let {
|
|
240
|
+
reference,
|
|
241
|
+
floating
|
|
242
|
+
} = _ref;
|
|
243
|
+
const sideAxis = getSideAxis(placement);
|
|
244
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
245
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
246
|
+
const side = getSide(placement);
|
|
247
|
+
const isVertical = sideAxis === 'y';
|
|
248
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
249
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
250
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
251
|
+
let coords;
|
|
252
|
+
switch (side) {
|
|
253
|
+
case 'top':
|
|
254
|
+
coords = {
|
|
255
|
+
x: commonX,
|
|
256
|
+
y: reference.y - floating.height
|
|
257
|
+
};
|
|
258
|
+
break;
|
|
259
|
+
case 'bottom':
|
|
260
|
+
coords = {
|
|
261
|
+
x: commonX,
|
|
262
|
+
y: reference.y + reference.height
|
|
263
|
+
};
|
|
264
|
+
break;
|
|
265
|
+
case 'right':
|
|
266
|
+
coords = {
|
|
267
|
+
x: reference.x + reference.width,
|
|
268
|
+
y: commonY
|
|
269
|
+
};
|
|
270
|
+
break;
|
|
271
|
+
case 'left':
|
|
272
|
+
coords = {
|
|
273
|
+
x: reference.x - floating.width,
|
|
274
|
+
y: commonY
|
|
275
|
+
};
|
|
276
|
+
break;
|
|
277
|
+
default:
|
|
278
|
+
coords = {
|
|
279
|
+
x: reference.x,
|
|
280
|
+
y: reference.y
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
switch (getAlignment(placement)) {
|
|
284
|
+
case 'start':
|
|
285
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
286
|
+
break;
|
|
287
|
+
case 'end':
|
|
288
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
return coords;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
296
|
+
* next to a given reference element.
|
|
297
|
+
*
|
|
298
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
299
|
+
* write one for the platform you are using Floating UI with.
|
|
300
|
+
*/
|
|
301
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
302
|
+
const {
|
|
303
|
+
placement = 'bottom',
|
|
304
|
+
strategy = 'absolute',
|
|
305
|
+
middleware = [],
|
|
306
|
+
platform
|
|
307
|
+
} = config;
|
|
308
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
309
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
310
|
+
let rects = await platform.getElementRects({
|
|
311
|
+
reference,
|
|
312
|
+
floating,
|
|
313
|
+
strategy
|
|
314
|
+
});
|
|
315
|
+
let {
|
|
316
|
+
x,
|
|
317
|
+
y
|
|
318
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
319
|
+
let statefulPlacement = placement;
|
|
320
|
+
let middlewareData = {};
|
|
321
|
+
let resetCount = 0;
|
|
322
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
323
|
+
const {
|
|
324
|
+
name,
|
|
325
|
+
fn
|
|
326
|
+
} = validMiddleware[i];
|
|
327
|
+
const {
|
|
328
|
+
x: nextX,
|
|
329
|
+
y: nextY,
|
|
330
|
+
data,
|
|
331
|
+
reset
|
|
332
|
+
} = await fn({
|
|
333
|
+
x,
|
|
334
|
+
y,
|
|
335
|
+
initialPlacement: placement,
|
|
336
|
+
placement: statefulPlacement,
|
|
337
|
+
strategy,
|
|
338
|
+
middlewareData,
|
|
339
|
+
rects,
|
|
340
|
+
platform,
|
|
341
|
+
elements: {
|
|
342
|
+
reference,
|
|
343
|
+
floating
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
x = nextX != null ? nextX : x;
|
|
347
|
+
y = nextY != null ? nextY : y;
|
|
348
|
+
middlewareData = {
|
|
349
|
+
...middlewareData,
|
|
350
|
+
[name]: {
|
|
351
|
+
...middlewareData[name],
|
|
352
|
+
...data
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
if (reset && resetCount <= 50) {
|
|
356
|
+
resetCount++;
|
|
357
|
+
if (typeof reset === 'object') {
|
|
358
|
+
if (reset.placement) {
|
|
359
|
+
statefulPlacement = reset.placement;
|
|
360
|
+
}
|
|
361
|
+
if (reset.rects) {
|
|
362
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
363
|
+
reference,
|
|
364
|
+
floating,
|
|
365
|
+
strategy
|
|
366
|
+
}) : reset.rects;
|
|
367
|
+
}
|
|
368
|
+
({
|
|
369
|
+
x,
|
|
370
|
+
y
|
|
371
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
372
|
+
}
|
|
373
|
+
i = -1;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
x,
|
|
378
|
+
y,
|
|
379
|
+
placement: statefulPlacement,
|
|
380
|
+
strategy,
|
|
381
|
+
middlewareData
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
387
|
+
* element is overflowing a given clipping boundary on each side.
|
|
388
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
389
|
+
* - negative = how many pixels left before it will overflow
|
|
390
|
+
* - 0 = lies flush with the boundary
|
|
391
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
392
|
+
*/
|
|
393
|
+
async function detectOverflow(state, options) {
|
|
394
|
+
var _await$platform$isEle;
|
|
395
|
+
if (options === void 0) {
|
|
396
|
+
options = {};
|
|
397
|
+
}
|
|
398
|
+
const {
|
|
399
|
+
x,
|
|
400
|
+
y,
|
|
401
|
+
platform,
|
|
402
|
+
rects,
|
|
403
|
+
elements,
|
|
404
|
+
strategy
|
|
405
|
+
} = state;
|
|
406
|
+
const {
|
|
407
|
+
boundary = 'clippingAncestors',
|
|
408
|
+
rootBoundary = 'viewport',
|
|
409
|
+
elementContext = 'floating',
|
|
410
|
+
altBoundary = false,
|
|
411
|
+
padding = 0
|
|
412
|
+
} = evaluate(options, state);
|
|
413
|
+
const paddingObject = getPaddingObject(padding);
|
|
414
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
415
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
416
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
417
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
418
|
+
boundary,
|
|
419
|
+
rootBoundary,
|
|
420
|
+
strategy
|
|
421
|
+
}));
|
|
422
|
+
const rect = elementContext === 'floating' ? {
|
|
423
|
+
x,
|
|
424
|
+
y,
|
|
425
|
+
width: rects.floating.width,
|
|
426
|
+
height: rects.floating.height
|
|
427
|
+
} : rects.reference;
|
|
428
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
429
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
430
|
+
x: 1,
|
|
431
|
+
y: 1
|
|
432
|
+
} : {
|
|
433
|
+
x: 1,
|
|
434
|
+
y: 1
|
|
435
|
+
};
|
|
436
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
437
|
+
elements,
|
|
438
|
+
rect,
|
|
439
|
+
offsetParent,
|
|
440
|
+
strategy
|
|
441
|
+
}) : rect);
|
|
442
|
+
return {
|
|
443
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
444
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
445
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
446
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
451
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
452
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
453
|
+
if (alignment) {
|
|
454
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
455
|
+
}
|
|
456
|
+
return true;
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
461
|
+
* that has the most space available automatically, without needing to specify a
|
|
462
|
+
* preferred placement. Alternative to `flip`.
|
|
463
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
464
|
+
*/
|
|
465
|
+
const autoPlacement$1 = function (options) {
|
|
466
|
+
if (options === void 0) {
|
|
467
|
+
options = {};
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
name: 'autoPlacement',
|
|
471
|
+
options,
|
|
472
|
+
async fn(state) {
|
|
473
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
474
|
+
const {
|
|
475
|
+
rects,
|
|
476
|
+
middlewareData,
|
|
477
|
+
placement,
|
|
478
|
+
platform,
|
|
479
|
+
elements
|
|
480
|
+
} = state;
|
|
481
|
+
const {
|
|
482
|
+
crossAxis = false,
|
|
483
|
+
alignment,
|
|
484
|
+
allowedPlacements = placements,
|
|
485
|
+
autoAlignment = true,
|
|
486
|
+
...detectOverflowOptions
|
|
487
|
+
} = evaluate(options, state);
|
|
488
|
+
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
489
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
490
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
491
|
+
const currentPlacement = placements$1[currentIndex];
|
|
492
|
+
if (currentPlacement == null) {
|
|
493
|
+
return {};
|
|
494
|
+
}
|
|
495
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
496
|
+
|
|
497
|
+
// Make `computeCoords` start from the right place.
|
|
498
|
+
if (placement !== currentPlacement) {
|
|
499
|
+
return {
|
|
500
|
+
reset: {
|
|
501
|
+
placement: placements$1[0]
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
506
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
507
|
+
placement: currentPlacement,
|
|
508
|
+
overflows: currentOverflows
|
|
509
|
+
}];
|
|
510
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
511
|
+
|
|
512
|
+
// There are more placements to check.
|
|
513
|
+
if (nextPlacement) {
|
|
514
|
+
return {
|
|
515
|
+
data: {
|
|
516
|
+
index: currentIndex + 1,
|
|
517
|
+
overflows: allOverflows
|
|
518
|
+
},
|
|
519
|
+
reset: {
|
|
520
|
+
placement: nextPlacement
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
const placementsSortedByMostSpace = allOverflows.map(d => {
|
|
525
|
+
const alignment = getAlignment(d.placement);
|
|
526
|
+
return [d.placement, alignment && crossAxis ?
|
|
527
|
+
// Check along the mainAxis and main crossAxis side.
|
|
528
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
|
529
|
+
// Check only the mainAxis.
|
|
530
|
+
d.overflows[0], d.overflows];
|
|
531
|
+
}).sort((a, b) => a[1] - b[1]);
|
|
532
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
|
533
|
+
// Aligned placements should not check their opposite crossAxis
|
|
534
|
+
// side.
|
|
535
|
+
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
536
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
537
|
+
if (resetPlacement !== placement) {
|
|
538
|
+
return {
|
|
539
|
+
data: {
|
|
540
|
+
index: currentIndex + 1,
|
|
541
|
+
overflows: allOverflows
|
|
542
|
+
},
|
|
543
|
+
reset: {
|
|
544
|
+
placement: resetPlacement
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
return {};
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
555
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
556
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
557
|
+
* @see https://floating-ui.com/docs/flip
|
|
558
|
+
*/
|
|
559
|
+
const flip$1 = function (options) {
|
|
560
|
+
if (options === void 0) {
|
|
561
|
+
options = {};
|
|
562
|
+
}
|
|
563
|
+
return {
|
|
564
|
+
name: 'flip',
|
|
565
|
+
options,
|
|
566
|
+
async fn(state) {
|
|
567
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
568
|
+
const {
|
|
569
|
+
placement,
|
|
570
|
+
middlewareData,
|
|
571
|
+
rects,
|
|
572
|
+
initialPlacement,
|
|
573
|
+
platform,
|
|
574
|
+
elements
|
|
575
|
+
} = state;
|
|
576
|
+
const {
|
|
577
|
+
mainAxis: checkMainAxis = true,
|
|
578
|
+
crossAxis: checkCrossAxis = true,
|
|
579
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
580
|
+
fallbackStrategy = 'bestFit',
|
|
581
|
+
fallbackAxisSideDirection = 'none',
|
|
582
|
+
flipAlignment = true,
|
|
583
|
+
...detectOverflowOptions
|
|
584
|
+
} = evaluate(options, state);
|
|
585
|
+
|
|
586
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
587
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
588
|
+
// work.
|
|
589
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
590
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
591
|
+
return {};
|
|
592
|
+
}
|
|
593
|
+
const side = getSide(placement);
|
|
594
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
595
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
596
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
597
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
598
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
599
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
600
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
601
|
+
}
|
|
602
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
603
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
604
|
+
const overflows = [];
|
|
605
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
606
|
+
if (checkMainAxis) {
|
|
607
|
+
overflows.push(overflow[side]);
|
|
608
|
+
}
|
|
609
|
+
if (checkCrossAxis) {
|
|
610
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
611
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
612
|
+
}
|
|
613
|
+
overflowsData = [...overflowsData, {
|
|
614
|
+
placement,
|
|
615
|
+
overflows
|
|
616
|
+
}];
|
|
617
|
+
|
|
618
|
+
// One or more sides is overflowing.
|
|
619
|
+
if (!overflows.every(side => side <= 0)) {
|
|
620
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
621
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
622
|
+
const nextPlacement = placements[nextIndex];
|
|
623
|
+
if (nextPlacement) {
|
|
624
|
+
// Try next placement and re-run the lifecycle.
|
|
625
|
+
return {
|
|
626
|
+
data: {
|
|
627
|
+
index: nextIndex,
|
|
628
|
+
overflows: overflowsData
|
|
629
|
+
},
|
|
630
|
+
reset: {
|
|
631
|
+
placement: nextPlacement
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
637
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
638
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
639
|
+
|
|
640
|
+
// Otherwise fallback.
|
|
641
|
+
if (!resetPlacement) {
|
|
642
|
+
switch (fallbackStrategy) {
|
|
643
|
+
case 'bestFit':
|
|
644
|
+
{
|
|
645
|
+
var _overflowsData$filter2;
|
|
646
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
647
|
+
if (hasFallbackAxisSideDirection) {
|
|
648
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
649
|
+
return currentSideAxis === initialSideAxis ||
|
|
650
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
651
|
+
// reading directions favoring greater width.
|
|
652
|
+
currentSideAxis === 'y';
|
|
653
|
+
}
|
|
654
|
+
return true;
|
|
655
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
656
|
+
if (placement) {
|
|
657
|
+
resetPlacement = placement;
|
|
658
|
+
}
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
case 'initialPlacement':
|
|
662
|
+
resetPlacement = initialPlacement;
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if (placement !== resetPlacement) {
|
|
667
|
+
return {
|
|
668
|
+
reset: {
|
|
669
|
+
placement: resetPlacement
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return {};
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
680
|
+
// Derivable.
|
|
681
|
+
|
|
682
|
+
async function convertValueToCoords(state, options) {
|
|
683
|
+
const {
|
|
684
|
+
placement,
|
|
685
|
+
platform,
|
|
686
|
+
elements
|
|
687
|
+
} = state;
|
|
688
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
689
|
+
const side = getSide(placement);
|
|
690
|
+
const alignment = getAlignment(placement);
|
|
691
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
692
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
693
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
694
|
+
const rawValue = evaluate(options, state);
|
|
695
|
+
|
|
696
|
+
// eslint-disable-next-line prefer-const
|
|
697
|
+
let {
|
|
698
|
+
mainAxis,
|
|
699
|
+
crossAxis,
|
|
700
|
+
alignmentAxis
|
|
701
|
+
} = typeof rawValue === 'number' ? {
|
|
702
|
+
mainAxis: rawValue,
|
|
703
|
+
crossAxis: 0,
|
|
704
|
+
alignmentAxis: null
|
|
705
|
+
} : {
|
|
706
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
707
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
708
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
709
|
+
};
|
|
710
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
711
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
712
|
+
}
|
|
713
|
+
return isVertical ? {
|
|
714
|
+
x: crossAxis * crossAxisMulti,
|
|
715
|
+
y: mainAxis * mainAxisMulti
|
|
716
|
+
} : {
|
|
717
|
+
x: mainAxis * mainAxisMulti,
|
|
718
|
+
y: crossAxis * crossAxisMulti
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Modifies the placement by translating the floating element along the
|
|
724
|
+
* specified axes.
|
|
725
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
726
|
+
* object may be passed.
|
|
727
|
+
* @see https://floating-ui.com/docs/offset
|
|
728
|
+
*/
|
|
729
|
+
const offset$1 = function (options) {
|
|
730
|
+
if (options === void 0) {
|
|
731
|
+
options = 0;
|
|
732
|
+
}
|
|
733
|
+
return {
|
|
734
|
+
name: 'offset',
|
|
735
|
+
options,
|
|
736
|
+
async fn(state) {
|
|
737
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
738
|
+
const {
|
|
739
|
+
x,
|
|
740
|
+
y,
|
|
741
|
+
placement,
|
|
742
|
+
middlewareData
|
|
743
|
+
} = state;
|
|
744
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
745
|
+
|
|
746
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
747
|
+
// then we don't need to change the positioning coordinates.
|
|
748
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
749
|
+
return {};
|
|
750
|
+
}
|
|
751
|
+
return {
|
|
752
|
+
x: x + diffCoords.x,
|
|
753
|
+
y: y + diffCoords.y,
|
|
754
|
+
data: {
|
|
755
|
+
...diffCoords,
|
|
756
|
+
placement
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
function hasWindow() {
|
|
764
|
+
return typeof window !== 'undefined';
|
|
765
|
+
}
|
|
766
|
+
function getNodeName(node) {
|
|
767
|
+
if (isNode(node)) {
|
|
768
|
+
return (node.nodeName || '').toLowerCase();
|
|
769
|
+
}
|
|
770
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
771
|
+
// returning `#document` an infinite loop won't occur.
|
|
772
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
773
|
+
return '#document';
|
|
774
|
+
}
|
|
775
|
+
function getWindow(node) {
|
|
776
|
+
var _node$ownerDocument;
|
|
777
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
778
|
+
}
|
|
779
|
+
function getDocumentElement(node) {
|
|
780
|
+
var _ref;
|
|
781
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
782
|
+
}
|
|
783
|
+
function isNode(value) {
|
|
784
|
+
if (!hasWindow()) {
|
|
785
|
+
return false;
|
|
786
|
+
}
|
|
787
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
788
|
+
}
|
|
789
|
+
function isElement(value) {
|
|
790
|
+
if (!hasWindow()) {
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
794
|
+
}
|
|
795
|
+
function isHTMLElement(value) {
|
|
796
|
+
if (!hasWindow()) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
800
|
+
}
|
|
801
|
+
function isShadowRoot(value) {
|
|
802
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
806
|
+
}
|
|
807
|
+
function isOverflowElement(element) {
|
|
808
|
+
const {
|
|
809
|
+
overflow,
|
|
810
|
+
overflowX,
|
|
811
|
+
overflowY,
|
|
812
|
+
display
|
|
813
|
+
} = getComputedStyle$1(element);
|
|
814
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
815
|
+
}
|
|
816
|
+
function isTableElement(element) {
|
|
817
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
818
|
+
}
|
|
819
|
+
function isTopLayer(element) {
|
|
820
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
821
|
+
try {
|
|
822
|
+
return element.matches(selector);
|
|
823
|
+
} catch (e) {
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
function isContainingBlock(elementOrCss) {
|
|
829
|
+
const webkit = isWebKit();
|
|
830
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
831
|
+
|
|
832
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
833
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
834
|
+
}
|
|
835
|
+
function getContainingBlock(element) {
|
|
836
|
+
let currentNode = getParentNode(element);
|
|
837
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
838
|
+
if (isContainingBlock(currentNode)) {
|
|
839
|
+
return currentNode;
|
|
840
|
+
} else if (isTopLayer(currentNode)) {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
currentNode = getParentNode(currentNode);
|
|
844
|
+
}
|
|
845
|
+
return null;
|
|
846
|
+
}
|
|
847
|
+
function isWebKit() {
|
|
848
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
849
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
850
|
+
}
|
|
851
|
+
function isLastTraversableNode(node) {
|
|
852
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
853
|
+
}
|
|
854
|
+
function getComputedStyle$1(element) {
|
|
855
|
+
return getWindow(element).getComputedStyle(element);
|
|
856
|
+
}
|
|
857
|
+
function getNodeScroll(element) {
|
|
858
|
+
if (isElement(element)) {
|
|
859
|
+
return {
|
|
860
|
+
scrollLeft: element.scrollLeft,
|
|
861
|
+
scrollTop: element.scrollTop
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
return {
|
|
865
|
+
scrollLeft: element.scrollX,
|
|
866
|
+
scrollTop: element.scrollY
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
function getParentNode(node) {
|
|
870
|
+
if (getNodeName(node) === 'html') {
|
|
871
|
+
return node;
|
|
872
|
+
}
|
|
873
|
+
const result =
|
|
874
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
875
|
+
node.assignedSlot ||
|
|
876
|
+
// DOM Element detected.
|
|
877
|
+
node.parentNode ||
|
|
878
|
+
// ShadowRoot detected.
|
|
879
|
+
isShadowRoot(node) && node.host ||
|
|
880
|
+
// Fallback.
|
|
881
|
+
getDocumentElement(node);
|
|
882
|
+
return isShadowRoot(result) ? result.host : result;
|
|
883
|
+
}
|
|
884
|
+
function getNearestOverflowAncestor(node) {
|
|
885
|
+
const parentNode = getParentNode(node);
|
|
886
|
+
if (isLastTraversableNode(parentNode)) {
|
|
887
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
888
|
+
}
|
|
889
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
890
|
+
return parentNode;
|
|
891
|
+
}
|
|
892
|
+
return getNearestOverflowAncestor(parentNode);
|
|
893
|
+
}
|
|
894
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
895
|
+
var _node$ownerDocument2;
|
|
896
|
+
if (list === void 0) {
|
|
897
|
+
list = [];
|
|
898
|
+
}
|
|
899
|
+
if (traverseIframes === void 0) {
|
|
900
|
+
traverseIframes = true;
|
|
901
|
+
}
|
|
902
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
903
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
904
|
+
const win = getWindow(scrollableAncestor);
|
|
905
|
+
if (isBody) {
|
|
906
|
+
const frameElement = getFrameElement(win);
|
|
907
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
908
|
+
}
|
|
909
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
910
|
+
}
|
|
911
|
+
function getFrameElement(win) {
|
|
912
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
function getCssDimensions(element) {
|
|
916
|
+
const css = getComputedStyle$1(element);
|
|
917
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
918
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
919
|
+
let width = parseFloat(css.width) || 0;
|
|
920
|
+
let height = parseFloat(css.height) || 0;
|
|
921
|
+
const hasOffset = isHTMLElement(element);
|
|
922
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
923
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
924
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
925
|
+
if (shouldFallback) {
|
|
926
|
+
width = offsetWidth;
|
|
927
|
+
height = offsetHeight;
|
|
928
|
+
}
|
|
929
|
+
return {
|
|
930
|
+
width,
|
|
931
|
+
height,
|
|
932
|
+
$: shouldFallback
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function unwrapElement(element) {
|
|
937
|
+
return !isElement(element) ? element.contextElement : element;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function getScale(element) {
|
|
941
|
+
const domElement = unwrapElement(element);
|
|
942
|
+
if (!isHTMLElement(domElement)) {
|
|
943
|
+
return createCoords(1);
|
|
944
|
+
}
|
|
945
|
+
const rect = domElement.getBoundingClientRect();
|
|
946
|
+
const {
|
|
947
|
+
width,
|
|
948
|
+
height,
|
|
949
|
+
$
|
|
950
|
+
} = getCssDimensions(domElement);
|
|
951
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
952
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
953
|
+
|
|
954
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
955
|
+
|
|
956
|
+
if (!x || !Number.isFinite(x)) {
|
|
957
|
+
x = 1;
|
|
958
|
+
}
|
|
959
|
+
if (!y || !Number.isFinite(y)) {
|
|
960
|
+
y = 1;
|
|
961
|
+
}
|
|
962
|
+
return {
|
|
963
|
+
x,
|
|
964
|
+
y
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
969
|
+
function getVisualOffsets(element) {
|
|
970
|
+
const win = getWindow(element);
|
|
971
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
972
|
+
return noOffsets;
|
|
973
|
+
}
|
|
974
|
+
return {
|
|
975
|
+
x: win.visualViewport.offsetLeft,
|
|
976
|
+
y: win.visualViewport.offsetTop
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
980
|
+
if (isFixed === void 0) {
|
|
981
|
+
isFixed = false;
|
|
982
|
+
}
|
|
983
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
984
|
+
return false;
|
|
985
|
+
}
|
|
986
|
+
return isFixed;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
990
|
+
if (includeScale === void 0) {
|
|
991
|
+
includeScale = false;
|
|
992
|
+
}
|
|
993
|
+
if (isFixedStrategy === void 0) {
|
|
994
|
+
isFixedStrategy = false;
|
|
995
|
+
}
|
|
996
|
+
const clientRect = element.getBoundingClientRect();
|
|
997
|
+
const domElement = unwrapElement(element);
|
|
998
|
+
let scale = createCoords(1);
|
|
999
|
+
if (includeScale) {
|
|
1000
|
+
if (offsetParent) {
|
|
1001
|
+
if (isElement(offsetParent)) {
|
|
1002
|
+
scale = getScale(offsetParent);
|
|
1003
|
+
}
|
|
1004
|
+
} else {
|
|
1005
|
+
scale = getScale(element);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1009
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1010
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1011
|
+
let width = clientRect.width / scale.x;
|
|
1012
|
+
let height = clientRect.height / scale.y;
|
|
1013
|
+
if (domElement) {
|
|
1014
|
+
const win = getWindow(domElement);
|
|
1015
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1016
|
+
let currentWin = win;
|
|
1017
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1018
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1019
|
+
const iframeScale = getScale(currentIFrame);
|
|
1020
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1021
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
1022
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1023
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1024
|
+
x *= iframeScale.x;
|
|
1025
|
+
y *= iframeScale.y;
|
|
1026
|
+
width *= iframeScale.x;
|
|
1027
|
+
height *= iframeScale.y;
|
|
1028
|
+
x += left;
|
|
1029
|
+
y += top;
|
|
1030
|
+
currentWin = getWindow(currentIFrame);
|
|
1031
|
+
currentIFrame = getFrameElement(currentWin);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
return rectToClientRect({
|
|
1035
|
+
width,
|
|
1036
|
+
height,
|
|
1037
|
+
x,
|
|
1038
|
+
y
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1043
|
+
// incorrect for RTL.
|
|
1044
|
+
function getWindowScrollBarX(element, rect) {
|
|
1045
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1046
|
+
if (!rect) {
|
|
1047
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1048
|
+
}
|
|
1049
|
+
return rect.left + leftScroll;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1053
|
+
if (ignoreScrollbarX === void 0) {
|
|
1054
|
+
ignoreScrollbarX = false;
|
|
1055
|
+
}
|
|
1056
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1057
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
|
|
1058
|
+
// RTL <body> scrollbar.
|
|
1059
|
+
getWindowScrollBarX(documentElement, htmlRect));
|
|
1060
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1061
|
+
return {
|
|
1062
|
+
x,
|
|
1063
|
+
y
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1068
|
+
let {
|
|
1069
|
+
elements,
|
|
1070
|
+
rect,
|
|
1071
|
+
offsetParent,
|
|
1072
|
+
strategy
|
|
1073
|
+
} = _ref;
|
|
1074
|
+
const isFixed = strategy === 'fixed';
|
|
1075
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1076
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1077
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1078
|
+
return rect;
|
|
1079
|
+
}
|
|
1080
|
+
let scroll = {
|
|
1081
|
+
scrollLeft: 0,
|
|
1082
|
+
scrollTop: 0
|
|
1083
|
+
};
|
|
1084
|
+
let scale = createCoords(1);
|
|
1085
|
+
const offsets = createCoords(0);
|
|
1086
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1087
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1088
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1089
|
+
scroll = getNodeScroll(offsetParent);
|
|
1090
|
+
}
|
|
1091
|
+
if (isHTMLElement(offsetParent)) {
|
|
1092
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1093
|
+
scale = getScale(offsetParent);
|
|
1094
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1095
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1099
|
+
return {
|
|
1100
|
+
width: rect.width * scale.x,
|
|
1101
|
+
height: rect.height * scale.y,
|
|
1102
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1103
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
function getClientRects(element) {
|
|
1108
|
+
return Array.from(element.getClientRects());
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1112
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1113
|
+
function getDocumentRect(element) {
|
|
1114
|
+
const html = getDocumentElement(element);
|
|
1115
|
+
const scroll = getNodeScroll(element);
|
|
1116
|
+
const body = element.ownerDocument.body;
|
|
1117
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1118
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1119
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1120
|
+
const y = -scroll.scrollTop;
|
|
1121
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
1122
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1123
|
+
}
|
|
1124
|
+
return {
|
|
1125
|
+
width,
|
|
1126
|
+
height,
|
|
1127
|
+
x,
|
|
1128
|
+
y
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function getViewportRect(element, strategy) {
|
|
1133
|
+
const win = getWindow(element);
|
|
1134
|
+
const html = getDocumentElement(element);
|
|
1135
|
+
const visualViewport = win.visualViewport;
|
|
1136
|
+
let width = html.clientWidth;
|
|
1137
|
+
let height = html.clientHeight;
|
|
1138
|
+
let x = 0;
|
|
1139
|
+
let y = 0;
|
|
1140
|
+
if (visualViewport) {
|
|
1141
|
+
width = visualViewport.width;
|
|
1142
|
+
height = visualViewport.height;
|
|
1143
|
+
const visualViewportBased = isWebKit();
|
|
1144
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1145
|
+
x = visualViewport.offsetLeft;
|
|
1146
|
+
y = visualViewport.offsetTop;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
return {
|
|
1150
|
+
width,
|
|
1151
|
+
height,
|
|
1152
|
+
x,
|
|
1153
|
+
y
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1158
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1159
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1160
|
+
const top = clientRect.top + element.clientTop;
|
|
1161
|
+
const left = clientRect.left + element.clientLeft;
|
|
1162
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1163
|
+
const width = element.clientWidth * scale.x;
|
|
1164
|
+
const height = element.clientHeight * scale.y;
|
|
1165
|
+
const x = left * scale.x;
|
|
1166
|
+
const y = top * scale.y;
|
|
1167
|
+
return {
|
|
1168
|
+
width,
|
|
1169
|
+
height,
|
|
1170
|
+
x,
|
|
1171
|
+
y
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1175
|
+
let rect;
|
|
1176
|
+
if (clippingAncestor === 'viewport') {
|
|
1177
|
+
rect = getViewportRect(element, strategy);
|
|
1178
|
+
} else if (clippingAncestor === 'document') {
|
|
1179
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1180
|
+
} else if (isElement(clippingAncestor)) {
|
|
1181
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1182
|
+
} else {
|
|
1183
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1184
|
+
rect = {
|
|
1185
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1186
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1187
|
+
width: clippingAncestor.width,
|
|
1188
|
+
height: clippingAncestor.height
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
return rectToClientRect(rect);
|
|
1192
|
+
}
|
|
1193
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1194
|
+
const parentNode = getParentNode(element);
|
|
1195
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1196
|
+
return false;
|
|
1197
|
+
}
|
|
1198
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1202
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1203
|
+
// of the given element up the tree.
|
|
1204
|
+
function getClippingElementAncestors(element, cache) {
|
|
1205
|
+
const cachedResult = cache.get(element);
|
|
1206
|
+
if (cachedResult) {
|
|
1207
|
+
return cachedResult;
|
|
1208
|
+
}
|
|
1209
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1210
|
+
let currentContainingBlockComputedStyle = null;
|
|
1211
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1212
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1213
|
+
|
|
1214
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1215
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1216
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1217
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1218
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1219
|
+
currentContainingBlockComputedStyle = null;
|
|
1220
|
+
}
|
|
1221
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1222
|
+
if (shouldDropCurrentNode) {
|
|
1223
|
+
// Drop non-containing blocks.
|
|
1224
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1225
|
+
} else {
|
|
1226
|
+
// Record last containing block for next iteration.
|
|
1227
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1228
|
+
}
|
|
1229
|
+
currentNode = getParentNode(currentNode);
|
|
1230
|
+
}
|
|
1231
|
+
cache.set(element, result);
|
|
1232
|
+
return result;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1236
|
+
// clipping ancestors.
|
|
1237
|
+
function getClippingRect(_ref) {
|
|
1238
|
+
let {
|
|
1239
|
+
element,
|
|
1240
|
+
boundary,
|
|
1241
|
+
rootBoundary,
|
|
1242
|
+
strategy
|
|
1243
|
+
} = _ref;
|
|
1244
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1245
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1246
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1247
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1248
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1249
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1250
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1251
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1252
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1253
|
+
return accRect;
|
|
1254
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1255
|
+
return {
|
|
1256
|
+
width: clippingRect.right - clippingRect.left,
|
|
1257
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1258
|
+
x: clippingRect.left,
|
|
1259
|
+
y: clippingRect.top
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
function getDimensions(element) {
|
|
1264
|
+
const {
|
|
1265
|
+
width,
|
|
1266
|
+
height
|
|
1267
|
+
} = getCssDimensions(element);
|
|
1268
|
+
return {
|
|
1269
|
+
width,
|
|
1270
|
+
height
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1275
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1276
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1277
|
+
const isFixed = strategy === 'fixed';
|
|
1278
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1279
|
+
let scroll = {
|
|
1280
|
+
scrollLeft: 0,
|
|
1281
|
+
scrollTop: 0
|
|
1282
|
+
};
|
|
1283
|
+
const offsets = createCoords(0);
|
|
1284
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1285
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1286
|
+
scroll = getNodeScroll(offsetParent);
|
|
1287
|
+
}
|
|
1288
|
+
if (isOffsetParentAnElement) {
|
|
1289
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1290
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1291
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1292
|
+
} else if (documentElement) {
|
|
1293
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1294
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1295
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1299
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1300
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1301
|
+
return {
|
|
1302
|
+
x,
|
|
1303
|
+
y,
|
|
1304
|
+
width: rect.width,
|
|
1305
|
+
height: rect.height
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
function isStaticPositioned(element) {
|
|
1310
|
+
return getComputedStyle$1(element).position === 'static';
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1314
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
1315
|
+
return null;
|
|
1316
|
+
}
|
|
1317
|
+
if (polyfill) {
|
|
1318
|
+
return polyfill(element);
|
|
1319
|
+
}
|
|
1320
|
+
let rawOffsetParent = element.offsetParent;
|
|
1321
|
+
|
|
1322
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1323
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1324
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
1325
|
+
// non-static.
|
|
1326
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1327
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1328
|
+
}
|
|
1329
|
+
return rawOffsetParent;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1333
|
+
// such as table ancestors and cross browser bugs.
|
|
1334
|
+
function getOffsetParent(element, polyfill) {
|
|
1335
|
+
const win = getWindow(element);
|
|
1336
|
+
if (isTopLayer(element)) {
|
|
1337
|
+
return win;
|
|
1338
|
+
}
|
|
1339
|
+
if (!isHTMLElement(element)) {
|
|
1340
|
+
let svgOffsetParent = getParentNode(element);
|
|
1341
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1342
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1343
|
+
return svgOffsetParent;
|
|
1344
|
+
}
|
|
1345
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1346
|
+
}
|
|
1347
|
+
return win;
|
|
1348
|
+
}
|
|
1349
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1350
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1351
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1352
|
+
}
|
|
1353
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1354
|
+
return win;
|
|
1355
|
+
}
|
|
1356
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
const getElementRects = async function (data) {
|
|
1360
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1361
|
+
const getDimensionsFn = this.getDimensions;
|
|
1362
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1363
|
+
return {
|
|
1364
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1365
|
+
floating: {
|
|
1366
|
+
x: 0,
|
|
1367
|
+
y: 0,
|
|
1368
|
+
width: floatingDimensions.width,
|
|
1369
|
+
height: floatingDimensions.height
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
function isRTL(element) {
|
|
1375
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
const platform = {
|
|
1379
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1380
|
+
getDocumentElement,
|
|
1381
|
+
getClippingRect,
|
|
1382
|
+
getOffsetParent,
|
|
1383
|
+
getElementRects,
|
|
1384
|
+
getClientRects,
|
|
1385
|
+
getDimensions,
|
|
1386
|
+
getScale,
|
|
1387
|
+
isElement,
|
|
1388
|
+
isRTL
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
// https://samthor.au/2021/observing-dom/
|
|
1392
|
+
function observeMove(element, onMove) {
|
|
1393
|
+
let io = null;
|
|
1394
|
+
let timeoutId;
|
|
1395
|
+
const root = getDocumentElement(element);
|
|
1396
|
+
function cleanup() {
|
|
1397
|
+
var _io;
|
|
1398
|
+
clearTimeout(timeoutId);
|
|
1399
|
+
(_io = io) == null || _io.disconnect();
|
|
1400
|
+
io = null;
|
|
1401
|
+
}
|
|
1402
|
+
function refresh(skip, threshold) {
|
|
1403
|
+
if (skip === void 0) {
|
|
1404
|
+
skip = false;
|
|
1405
|
+
}
|
|
1406
|
+
if (threshold === void 0) {
|
|
1407
|
+
threshold = 1;
|
|
1408
|
+
}
|
|
1409
|
+
cleanup();
|
|
1410
|
+
const {
|
|
1411
|
+
left,
|
|
1412
|
+
top,
|
|
1413
|
+
width,
|
|
1414
|
+
height
|
|
1415
|
+
} = element.getBoundingClientRect();
|
|
1416
|
+
if (!skip) {
|
|
1417
|
+
onMove();
|
|
1418
|
+
}
|
|
1419
|
+
if (!width || !height) {
|
|
1420
|
+
return;
|
|
1421
|
+
}
|
|
1422
|
+
const insetTop = floor(top);
|
|
1423
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1424
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1425
|
+
const insetLeft = floor(left);
|
|
1426
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1427
|
+
const options = {
|
|
1428
|
+
rootMargin,
|
|
1429
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1430
|
+
};
|
|
1431
|
+
let isFirstUpdate = true;
|
|
1432
|
+
function handleObserve(entries) {
|
|
1433
|
+
const ratio = entries[0].intersectionRatio;
|
|
1434
|
+
if (ratio !== threshold) {
|
|
1435
|
+
if (!isFirstUpdate) {
|
|
1436
|
+
return refresh();
|
|
1437
|
+
}
|
|
1438
|
+
if (!ratio) {
|
|
1439
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1440
|
+
// to prevent an infinite loop of updates.
|
|
1441
|
+
timeoutId = setTimeout(() => {
|
|
1442
|
+
refresh(false, 1e-7);
|
|
1443
|
+
}, 1000);
|
|
1444
|
+
} else {
|
|
1445
|
+
refresh(false, ratio);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
isFirstUpdate = false;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
1452
|
+
// error.
|
|
1453
|
+
try {
|
|
1454
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1455
|
+
...options,
|
|
1456
|
+
// Handle <iframe>s
|
|
1457
|
+
root: root.ownerDocument
|
|
1458
|
+
});
|
|
1459
|
+
} catch (e) {
|
|
1460
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1461
|
+
}
|
|
1462
|
+
io.observe(element);
|
|
1463
|
+
}
|
|
1464
|
+
refresh(true);
|
|
1465
|
+
return cleanup;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
/**
|
|
1469
|
+
* Automatically updates the position of the floating element when necessary.
|
|
1470
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
1471
|
+
* visible on the screen.
|
|
1472
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
1473
|
+
* removed from the DOM or hidden from the screen.
|
|
1474
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
1475
|
+
*/
|
|
1476
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1477
|
+
if (options === void 0) {
|
|
1478
|
+
options = {};
|
|
1479
|
+
}
|
|
1480
|
+
const {
|
|
1481
|
+
ancestorScroll = true,
|
|
1482
|
+
ancestorResize = true,
|
|
1483
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
1484
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
1485
|
+
animationFrame = false
|
|
1486
|
+
} = options;
|
|
1487
|
+
const referenceEl = unwrapElement(reference);
|
|
1488
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
1489
|
+
ancestors.forEach(ancestor => {
|
|
1490
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1491
|
+
passive: true
|
|
1492
|
+
});
|
|
1493
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1494
|
+
});
|
|
1495
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1496
|
+
let reobserveFrame = -1;
|
|
1497
|
+
let resizeObserver = null;
|
|
1498
|
+
if (elementResize) {
|
|
1499
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
1500
|
+
let [firstEntry] = _ref;
|
|
1501
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1502
|
+
// Prevent update loops when using the `size` middleware.
|
|
1503
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
1504
|
+
resizeObserver.unobserve(floating);
|
|
1505
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1506
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1507
|
+
var _resizeObserver;
|
|
1508
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
update();
|
|
1512
|
+
});
|
|
1513
|
+
if (referenceEl && !animationFrame) {
|
|
1514
|
+
resizeObserver.observe(referenceEl);
|
|
1515
|
+
}
|
|
1516
|
+
resizeObserver.observe(floating);
|
|
1517
|
+
}
|
|
1518
|
+
let frameId;
|
|
1519
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1520
|
+
if (animationFrame) {
|
|
1521
|
+
frameLoop();
|
|
1522
|
+
}
|
|
1523
|
+
function frameLoop() {
|
|
1524
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1525
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1526
|
+
update();
|
|
1527
|
+
}
|
|
1528
|
+
prevRefRect = nextRefRect;
|
|
1529
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1530
|
+
}
|
|
1531
|
+
update();
|
|
1532
|
+
return () => {
|
|
1533
|
+
var _resizeObserver2;
|
|
1534
|
+
ancestors.forEach(ancestor => {
|
|
1535
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1536
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1537
|
+
});
|
|
1538
|
+
cleanupIo == null || cleanupIo();
|
|
1539
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1540
|
+
resizeObserver = null;
|
|
1541
|
+
if (animationFrame) {
|
|
1542
|
+
cancelAnimationFrame(frameId);
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* Modifies the placement by translating the floating element along the
|
|
1549
|
+
* specified axes.
|
|
1550
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1551
|
+
* object may be passed.
|
|
1552
|
+
* @see https://floating-ui.com/docs/offset
|
|
1553
|
+
*/
|
|
1554
|
+
const offset = offset$1;
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
1558
|
+
* that has the most space available automatically, without needing to specify a
|
|
1559
|
+
* preferred placement. Alternative to `flip`.
|
|
1560
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
1561
|
+
*/
|
|
1562
|
+
const autoPlacement = autoPlacement$1;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1566
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1567
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1568
|
+
* @see https://floating-ui.com/docs/flip
|
|
1569
|
+
*/
|
|
1570
|
+
const flip = flip$1;
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1574
|
+
* next to a given reference element.
|
|
1575
|
+
*/
|
|
1576
|
+
const computePosition = (reference, floating, options) => {
|
|
1577
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1578
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1579
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1580
|
+
const cache = new Map();
|
|
1581
|
+
const mergedOptions = {
|
|
1582
|
+
platform,
|
|
1583
|
+
...options
|
|
1584
|
+
};
|
|
1585
|
+
const platformWithCache = {
|
|
1586
|
+
...mergedOptions.platform,
|
|
1587
|
+
_c: cache
|
|
1588
|
+
};
|
|
1589
|
+
return computePosition$1(reference, floating, {
|
|
1590
|
+
...mergedOptions,
|
|
1591
|
+
platform: platformWithCache
|
|
1592
|
+
});
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
/* eslint-disable line-comment-position, no-inline-comments */
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
class AuroFloatingUI {
|
|
1599
|
+
constructor() {
|
|
1600
|
+
// Store event listener references for cleanup
|
|
1601
|
+
this.focusHandler = null;
|
|
1602
|
+
this.clickHandler = null;
|
|
1603
|
+
this.keyDownHandler = null;
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* @private
|
|
1607
|
+
*/
|
|
1608
|
+
this.eventPrefix = undefined;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Mirrors the size of the bibSizer element to the bib content.
|
|
1613
|
+
* Copies the width, height, max-width, and max-height styles from the bibSizer element to the bib content container.
|
|
1614
|
+
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
1615
|
+
*/
|
|
1616
|
+
mirrorSize() {
|
|
1617
|
+
// mirror the boxsize from bibSizer
|
|
1618
|
+
if (this.element.bibSizer) {
|
|
1619
|
+
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
1620
|
+
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1621
|
+
if (sizerStyle.width !== '0px') {
|
|
1622
|
+
bibContent.style.width = sizerStyle.width;
|
|
1623
|
+
}
|
|
1624
|
+
if (sizerStyle.height !== '0px') {
|
|
1625
|
+
bibContent.style.height = sizerStyle.height;
|
|
1626
|
+
}
|
|
1627
|
+
bibContent.style.maxWidth = sizerStyle.maxWidth;
|
|
1628
|
+
bibContent.style.maxHeight = sizerStyle.maxHeight;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* @private
|
|
1634
|
+
* Determines the positioning strategy based on the current viewport size and mobile breakpoint.
|
|
1635
|
+
*
|
|
1636
|
+
* This method checks if the current viewport width is less than or equal to the specified mobile fullscreen breakpoint
|
|
1637
|
+
* defined in the bib element. If it is, the strategy is set to 'fullscreen'; otherwise, it defaults to 'floating'.
|
|
1638
|
+
*
|
|
1639
|
+
* @returns {String} The positioning strategy, either 'fullscreen' or 'floating'.
|
|
1640
|
+
*/
|
|
1641
|
+
getPositioningStrategy() {
|
|
1642
|
+
let strategy = 'floating';
|
|
1643
|
+
if (this.element.bib.mobileFullscreenBreakpoint) {
|
|
1644
|
+
const smallerThanBreakpoint = window.matchMedia(`(max-width: ${this.element.bib.mobileFullscreenBreakpoint})`).matches;
|
|
1645
|
+
if (smallerThanBreakpoint) {
|
|
1646
|
+
strategy = 'fullscreen';
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
return strategy;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* @private
|
|
1655
|
+
* Positions the bib element based on the current configuration and positioning strategy.
|
|
1656
|
+
*
|
|
1657
|
+
* This method determines the appropriate positioning strategy (fullscreen or not) and configures the bib accordingly.
|
|
1658
|
+
* It also sets up middleware for the floater configuration, computes the position of the bib relative to the trigger element,
|
|
1659
|
+
* and applies the calculated position to the bib's style.
|
|
1660
|
+
*/
|
|
1661
|
+
position() {
|
|
1662
|
+
const strategy = this.getPositioningStrategy();
|
|
1663
|
+
this.configureBibStrategy(strategy);
|
|
1664
|
+
|
|
1665
|
+
if (strategy === 'floating') {
|
|
1666
|
+
this.mirrorSize();
|
|
1667
|
+
// Define the middlware for the floater configuration
|
|
1668
|
+
const middleware = [
|
|
1669
|
+
offset(this.element.floaterConfig.offset || 0),
|
|
1670
|
+
...(this.element.floaterConfig.flip ? [flip()] : []), // Add flip middleware if flip is enabled
|
|
1671
|
+
...(this.element.floaterConfig.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled
|
|
1672
|
+
];
|
|
1673
|
+
|
|
1674
|
+
// Compute the position of the bib
|
|
1675
|
+
computePosition(this.element.trigger, this.element.bib, {
|
|
1676
|
+
placement: this.element.floaterConfig.placement || 'bottom',
|
|
1677
|
+
middleware: middleware || []
|
|
1678
|
+
}).then(({x, y}) => { // eslint-disable-line id-length
|
|
1679
|
+
Object.assign(this.element.bib.style, {
|
|
1680
|
+
left: `${x}px`,
|
|
1681
|
+
top: `${y}px`,
|
|
1682
|
+
});
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* @private
|
|
1689
|
+
* Controls whether to lock the scrolling for the document's body.
|
|
1690
|
+
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
1691
|
+
*/
|
|
1692
|
+
lockScroll(lock = true) {
|
|
1693
|
+
if (lock) {
|
|
1694
|
+
document.body.style.overflow = 'hidden'; // hide body's scrollbar
|
|
1695
|
+
|
|
1696
|
+
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
1697
|
+
this.element.bib.style.transform = `translateY(${visualViewport.offsetTop}px)`;
|
|
1698
|
+
} else {
|
|
1699
|
+
document.body.style.overflow = '';
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* @private
|
|
1705
|
+
* Configures the bib element's display strategy.
|
|
1706
|
+
*
|
|
1707
|
+
* Sets the bib to fullscreen or floating mode based on the provided strategy.
|
|
1708
|
+
* Dispatches a 'strategy-change' event if the strategy changes.
|
|
1709
|
+
*
|
|
1710
|
+
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
1711
|
+
*/
|
|
1712
|
+
configureBibStrategy(strategy) {
|
|
1713
|
+
const prevStrategy = this.element.isBibFullscreen ? 'fullscreen' : 'floating';
|
|
1714
|
+
if (strategy === 'fullscreen') {
|
|
1715
|
+
this.element.isBibFullscreen = true;
|
|
1716
|
+
// reset the prev position
|
|
1717
|
+
this.element.bib.style.top = "0px";
|
|
1718
|
+
this.element.bib.style.left = "0px";
|
|
1719
|
+
|
|
1720
|
+
// reset the size that was mirroring `size` css-part
|
|
1721
|
+
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1722
|
+
bibContent.style.width = '';
|
|
1723
|
+
bibContent.style.height = '';
|
|
1724
|
+
bibContent.style.maxWidth = '';
|
|
1725
|
+
bibContent.style.maxHeight = `${window.visualViewport.height}px`;
|
|
1726
|
+
|
|
1727
|
+
if (this.element.isPopoverVisible) {
|
|
1728
|
+
this.lockScroll(true);
|
|
1729
|
+
}
|
|
1730
|
+
} else {
|
|
1731
|
+
this.element.isBibFullscreen = false;
|
|
1732
|
+
|
|
1733
|
+
this.lockScroll(false);
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
if (prevStrategy !== strategy) {
|
|
1737
|
+
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-strategy-change` : 'strategy-change', {
|
|
1738
|
+
detail: {
|
|
1739
|
+
strategy,
|
|
1740
|
+
},
|
|
1741
|
+
composed: true
|
|
1742
|
+
});
|
|
1743
|
+
|
|
1744
|
+
this.element.dispatchEvent(event);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
updateState() {
|
|
1749
|
+
const isVisible = this.element.isPopoverVisible;
|
|
1750
|
+
|
|
1751
|
+
// Refactor this to apply attribute to correct focusable element
|
|
1752
|
+
// Reference Issue: https://github.com/AlaskaAirlines/auro-library/issues/105
|
|
1753
|
+
//
|
|
1754
|
+
// this.element.trigger.setAttribute('aria-expanded', isVisible);
|
|
1755
|
+
|
|
1756
|
+
if (isVisible) {
|
|
1757
|
+
this.element.bib.setAttribute('data-show', true);
|
|
1758
|
+
} else {
|
|
1759
|
+
this.element.bib.removeAttribute('data-show');
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
if (!isVisible) {
|
|
1763
|
+
this.cleanupHideHandlers();
|
|
1764
|
+
try {
|
|
1765
|
+
this.element.cleanup?.();
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
// Do nothing
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
handleFocusLoss() {
|
|
1773
|
+
if (this.element.noHideOnThisFocusLoss ||
|
|
1774
|
+
this.element.hasAttribute('noHideOnThisFocusLoss')) {
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
const {activeElement} = document;
|
|
1779
|
+
if (activeElement === document.querySelector('body') ||
|
|
1780
|
+
this.element.contains(activeElement) ||
|
|
1781
|
+
this.element.bibContent?.contains(activeElement)) {
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
this.hideBib();
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
setupHideHandlers() {
|
|
1789
|
+
// Define handlers & store references
|
|
1790
|
+
this.focusHandler = () => this.handleFocusLoss();
|
|
1791
|
+
|
|
1792
|
+
this.clickHandler = (evt) => {
|
|
1793
|
+
if (!evt.composedPath().includes(this.element.trigger) &&
|
|
1794
|
+
!evt.composedPath().includes(this.element.bibContent)) {
|
|
1795
|
+
this.hideBib();
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
// ESC key handler
|
|
1800
|
+
this.keyDownHandler = (evt) => {
|
|
1801
|
+
if (evt.key === 'Escape' && this.element.isPopoverVisible) {
|
|
1802
|
+
this.hideBib();
|
|
1803
|
+
}
|
|
1804
|
+
};
|
|
1805
|
+
|
|
1806
|
+
// Add event listeners using the stored references
|
|
1807
|
+
document.addEventListener('focusin', this.focusHandler);
|
|
1808
|
+
window.addEventListener('click', this.clickHandler);
|
|
1809
|
+
document.addEventListener('keydown', this.keyDownHandler);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
cleanupHideHandlers() {
|
|
1813
|
+
// Remove event listeners if they exist
|
|
1814
|
+
if (this.focusHandler) {
|
|
1815
|
+
document.removeEventListener('focusin', this.focusHandler);
|
|
1816
|
+
this.focusHandler = null;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
if (this.clickHandler) {
|
|
1820
|
+
window.removeEventListener('click', this.clickHandler);
|
|
1821
|
+
this.clickHandler = null;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
if (this.keyDownHandler) {
|
|
1825
|
+
document.removeEventListener('keydown', this.keyDownHandler);
|
|
1826
|
+
this.keyDownHandler = null;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
handleUpdate(changedProperties) {
|
|
1831
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
1832
|
+
this.updateState();
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
updateCurrentExpandedDropdown() {
|
|
1837
|
+
// Close any other dropdown that is already open
|
|
1838
|
+
if (document.expandedAuroDropdown) {
|
|
1839
|
+
this.hideBib(document.expandedAuroDropdown);
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
document.expandedAuroDropdown = this;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
showBib() {
|
|
1846
|
+
if (!this.element.disabled && !this.element.isPopoverVisible) {
|
|
1847
|
+
this.updateCurrentExpandedDropdown();
|
|
1848
|
+
this.element.isPopoverVisible = true;
|
|
1849
|
+
this.element.triggerChevron?.setAttribute('data-expanded', true);
|
|
1850
|
+
|
|
1851
|
+
this.dispatchEventDropdownToggle();
|
|
1852
|
+
this.position();
|
|
1853
|
+
|
|
1854
|
+
// Clean up any existing handlers before setting up new ones
|
|
1855
|
+
this.cleanupHideHandlers();
|
|
1856
|
+
this.setupHideHandlers();
|
|
1857
|
+
|
|
1858
|
+
// Setup auto update to handle resize and scroll
|
|
1859
|
+
this.element.cleanup = autoUpdate(this.element.trigger, this.element.bib, () => {
|
|
1860
|
+
this.position();
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
hideBib() {
|
|
1866
|
+
if (this.element.isPopoverVisible && !this.element.disabled && !this.element.noToggle) {
|
|
1867
|
+
this.element.isPopoverVisible = false;
|
|
1868
|
+
this.lockScroll(false);
|
|
1869
|
+
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
1870
|
+
this.dispatchEventDropdownToggle();
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* @private
|
|
1876
|
+
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
1877
|
+
*/
|
|
1878
|
+
dispatchEventDropdownToggle() {
|
|
1879
|
+
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
1880
|
+
detail: {
|
|
1881
|
+
expanded: this.element.isPopoverVisible,
|
|
1882
|
+
},
|
|
1883
|
+
composed: true
|
|
1884
|
+
});
|
|
1885
|
+
|
|
1886
|
+
this.element.dispatchEvent(event);
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
handleClick() {
|
|
1890
|
+
if (this.element.isPopoverVisible) {
|
|
1891
|
+
this.hideBib();
|
|
1892
|
+
} else {
|
|
1893
|
+
this.showBib();
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-triggerClick` : "triggerClick", {
|
|
1897
|
+
composed: true,
|
|
1898
|
+
detail: {
|
|
1899
|
+
expanded: this.element.isPopoverVisible
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1903
|
+
this.element.dispatchEvent(event);
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
handleEvent(event) {
|
|
1907
|
+
if (!this.element.disableEventShow) {
|
|
1908
|
+
switch (event.type) {
|
|
1909
|
+
case 'keydown':
|
|
1910
|
+
// Support both Enter and Space keys for accessibility
|
|
1911
|
+
// Space is included as it's expected behavior for interactive elements
|
|
1912
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1913
|
+
event.preventDefault(); // Prevent page scroll on space
|
|
1914
|
+
this.handleClick();
|
|
1915
|
+
}
|
|
1916
|
+
break;
|
|
1917
|
+
case 'mouseenter':
|
|
1918
|
+
if (this.element.hoverToggle) {
|
|
1919
|
+
this.showBib();
|
|
1920
|
+
}
|
|
1921
|
+
break;
|
|
1922
|
+
case 'mouseleave':
|
|
1923
|
+
if (this.element.hoverToggle) {
|
|
1924
|
+
this.hideBib();
|
|
1925
|
+
}
|
|
1926
|
+
break;
|
|
1927
|
+
case 'focus':
|
|
1928
|
+
if (this.element.focusShow) {
|
|
1929
|
+
/*
|
|
1930
|
+
This needs to better handle clicking that gives focus -
|
|
1931
|
+
currently it shows and then immediately hides the bib
|
|
1932
|
+
*/
|
|
1933
|
+
this.showBib();
|
|
1934
|
+
}
|
|
1935
|
+
break;
|
|
1936
|
+
case 'blur':
|
|
1937
|
+
this.handleFocusLoss();
|
|
1938
|
+
break;
|
|
1939
|
+
case 'click':
|
|
1940
|
+
if (document.activeElement === document.body) {
|
|
1941
|
+
event.currentTarget.focus();
|
|
1942
|
+
}
|
|
1943
|
+
this.handleClick();
|
|
1944
|
+
break;
|
|
1945
|
+
// Do nothing
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* Manages the tabIndex of the trigger element based on its focusability.
|
|
1952
|
+
*
|
|
1953
|
+
* If the trigger element or any of its children are inherently focusable, the tabIndex of the component is set to -1.
|
|
1954
|
+
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
1955
|
+
*/
|
|
1956
|
+
handleTriggerTabIndex() {
|
|
1957
|
+
const focusableElementSelectors = [
|
|
1958
|
+
'a',
|
|
1959
|
+
'button',
|
|
1960
|
+
'input:not([type="hidden"])',
|
|
1961
|
+
'select',
|
|
1962
|
+
'textarea',
|
|
1963
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
1964
|
+
'auro-button',
|
|
1965
|
+
'auro-input',
|
|
1966
|
+
'auro-hyperlink'
|
|
1967
|
+
];
|
|
1968
|
+
|
|
1969
|
+
const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
|
|
1970
|
+
if (!triggerNode) {
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
const triggerNodeTagName = triggerNode.tagName.toLowerCase();
|
|
1974
|
+
|
|
1975
|
+
focusableElementSelectors.forEach((selector) => {
|
|
1976
|
+
// Check if the trigger node element is focusable
|
|
1977
|
+
if (triggerNodeTagName === selector) {
|
|
1978
|
+
this.element.tabIndex = -1;
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
// Check if any child is focusable
|
|
1983
|
+
if (triggerNode.querySelector(selector)) {
|
|
1984
|
+
this.element.tabIndex = -1;
|
|
1985
|
+
}
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
configure(elem, eventPrefix) {
|
|
1990
|
+
this.eventPrefix = eventPrefix;
|
|
1991
|
+
this.element = elem;
|
|
1992
|
+
this.element.trigger = this.element.shadowRoot.querySelector('#trigger');
|
|
1993
|
+
this.element.bib = this.element.shadowRoot.querySelector('#bib');
|
|
1994
|
+
this.element.bibSizer = this.element.shadowRoot.querySelector('#bibSizer');
|
|
1995
|
+
this.element.triggerChevron = this.element.shadowRoot.querySelector('#showStateIcon');
|
|
1996
|
+
|
|
1997
|
+
document.body.append(this.element.bib);
|
|
1998
|
+
|
|
1999
|
+
this.handleTriggerTabIndex();
|
|
2000
|
+
|
|
2001
|
+
this.handleEvent = this.handleEvent.bind(this);
|
|
2002
|
+
this.element.trigger.addEventListener('keydown', this.handleEvent);
|
|
2003
|
+
this.element.trigger.addEventListener('click', this.handleEvent);
|
|
2004
|
+
this.element.trigger.addEventListener('mouseenter', this.handleEvent);
|
|
2005
|
+
this.element.trigger.addEventListener('mouseleave', this.handleEvent);
|
|
2006
|
+
this.element.trigger.addEventListener('focus', this.handleEvent);
|
|
2007
|
+
this.element.trigger.addEventListener('blur', this.handleEvent);
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
disconnect() {
|
|
2011
|
+
this.cleanupHideHandlers();
|
|
2012
|
+
this.element.cleanup?.();
|
|
2013
|
+
|
|
2014
|
+
// Remove event & keyboard listeners
|
|
2015
|
+
if (this.element?.trigger) {
|
|
2016
|
+
this.element.trigger.removeEventListener('keydown', this.handleEvent);
|
|
2017
|
+
this.element.trigger.removeEventListener('click', this.handleEvent);
|
|
2018
|
+
this.element.trigger.removeEventListener('mouseenter', this.handleEvent);
|
|
2019
|
+
this.element.trigger.removeEventListener('mouseleave', this.handleEvent);
|
|
2020
|
+
this.element.trigger.removeEventListener('focus', this.handleEvent);
|
|
2021
|
+
this.element.trigger.removeEventListener('blur', this.handleEvent);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2027
|
+
// See LICENSE in the project root for license information.
|
|
2028
|
+
|
|
2029
|
+
|
|
2030
|
+
class AuroDependencyVersioning {
|
|
2031
|
+
|
|
2032
|
+
/**
|
|
2033
|
+
* Generates a unique string to be used for child auro element naming.
|
|
2034
|
+
* @private
|
|
2035
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
2036
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
2037
|
+
* @returns {string} - Unique string to be used for naming.
|
|
2038
|
+
*/
|
|
2039
|
+
generateElementName(baseName, version) {
|
|
2040
|
+
let result = baseName;
|
|
2041
|
+
|
|
2042
|
+
result += '-';
|
|
2043
|
+
result += version.replace(/[.]/g, '_');
|
|
2044
|
+
|
|
2045
|
+
return result;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
/**
|
|
2049
|
+
* Generates a unique string to be used for child auro element naming.
|
|
2050
|
+
* @param {string} baseName - Defines the first part of the unique element name.
|
|
2051
|
+
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
2052
|
+
* @returns {string} - Unique string to be used for naming.
|
|
2053
|
+
*/
|
|
2054
|
+
generateTag(baseName, version, tagClass) {
|
|
2055
|
+
const elementName = this.generateElementName(baseName, version);
|
|
2056
|
+
const tag = i$8`${s$3(elementName)}`;
|
|
2057
|
+
|
|
2058
|
+
if (!customElements.get(elementName)) {
|
|
2059
|
+
customElements.define(elementName, class extends tagClass {});
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
return tag;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
/**
|
|
2067
|
+
* @license
|
|
2068
|
+
* Copyright 2017 Google LLC
|
|
2069
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2070
|
+
*/
|
|
2071
|
+
const t$2={ATTRIBUTE:1},e$4=t=>(...e)=>({_$litDirective$:t,values:e});let i$4 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* @license
|
|
2075
|
+
* Copyright 2018 Google LLC
|
|
2076
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2077
|
+
*/const e$3=e$4(class extends i$4{constructor(t){if(super(t),t.type!==t$2.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T$1}});
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* @license
|
|
2081
|
+
* Copyright 2018 Google LLC
|
|
2082
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2083
|
+
*/const o$3=o=>o??E$1;
|
|
2084
|
+
|
|
2085
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2086
|
+
// See LICENSE in the project root for license information.
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
/**
|
|
2090
|
+
* @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
|
|
2091
|
+
* @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
|
|
2092
|
+
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
2093
|
+
*/
|
|
2094
|
+
|
|
2095
|
+
class AuroElement extends r$4 {
|
|
2096
|
+
|
|
2097
|
+
// function to define props used within the scope of this component
|
|
2098
|
+
static get properties() {
|
|
2099
|
+
return {
|
|
2100
|
+
hidden: { type: Boolean,
|
|
2101
|
+
reflect: true },
|
|
2102
|
+
hiddenVisually: { type: Boolean,
|
|
2103
|
+
reflect: true },
|
|
2104
|
+
hiddenAudible: { type: Boolean,
|
|
2105
|
+
reflect: true },
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* @private Function that determines state of aria-hidden
|
|
2111
|
+
*/
|
|
2112
|
+
hideAudible(value) {
|
|
2113
|
+
if (value) {
|
|
2114
|
+
return 'true'
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
return 'false'
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
2122
|
+
|
|
2123
|
+
/* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
|
|
2124
|
+
|
|
2125
|
+
const _fetchMap = new Map();
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* A callback to parse Response body.
|
|
2129
|
+
*
|
|
2130
|
+
* @callback ResponseParser
|
|
2131
|
+
* @param {Fetch.Response} response
|
|
2132
|
+
* @returns {Promise}
|
|
2133
|
+
*/
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* A minimal in-memory map to de-duplicate Fetch API media requests.
|
|
2137
|
+
*
|
|
2138
|
+
* @param {String} uri
|
|
2139
|
+
* @param {Object} [options={}]
|
|
2140
|
+
* @param {ResponseParser} [options.responseParser=(response) => response.text()]
|
|
2141
|
+
* @returns {Promise}
|
|
2142
|
+
*/
|
|
2143
|
+
const cacheFetch = (uri, options = {}) => {
|
|
2144
|
+
const responseParser = options.responseParser || ((response) => response.text());
|
|
2145
|
+
if (!_fetchMap.has(uri)) {
|
|
2146
|
+
_fetchMap.set(uri, fetch(uri).then(responseParser));
|
|
2147
|
+
}
|
|
2148
|
+
return _fetchMap.get(uri);
|
|
2149
|
+
};
|
|
2150
|
+
|
|
2151
|
+
var styleCss$3 = i$7`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}:host .logo{color:var(--ds-color-brand-midnight-400, #01426a)}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.label{display:flex;align-items:flex-start}.label svg{margin:0 var(--ds-size-50, 0.25rem)}.wrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelContainer{line-height:1.8}`;
|
|
2152
|
+
|
|
2153
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2154
|
+
// See LICENSE in the project root for license information.
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
2158
|
+
/**
|
|
2159
|
+
* @attr {Boolean} onDark - Set value for on-dark version of auro-icon
|
|
2160
|
+
* @slot - Hidden from visibility, used for a11y if icon description is needed
|
|
2161
|
+
*/
|
|
2162
|
+
|
|
2163
|
+
// build the component class
|
|
2164
|
+
class BaseIcon extends AuroElement {
|
|
2165
|
+
constructor() {
|
|
2166
|
+
super();
|
|
2167
|
+
this.onDark = false;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
// function to define props used within the scope of this component
|
|
2171
|
+
static get properties() {
|
|
2172
|
+
return {
|
|
2173
|
+
...super.properties,
|
|
2174
|
+
onDark: {
|
|
2175
|
+
type: Boolean,
|
|
2176
|
+
reflect: true
|
|
2177
|
+
},
|
|
2178
|
+
|
|
2179
|
+
/**
|
|
2180
|
+
* @private
|
|
2181
|
+
*/
|
|
2182
|
+
svg: {
|
|
2183
|
+
attribute: false,
|
|
2184
|
+
reflect: true
|
|
2185
|
+
}
|
|
2186
|
+
};
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
static get styles() {
|
|
2190
|
+
return i$7`
|
|
2191
|
+
${styleCss$3}
|
|
2192
|
+
`;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Async function to fetch requested icon from npm CDN.
|
|
2197
|
+
* @private
|
|
2198
|
+
* @param {string} category - Icon category.
|
|
2199
|
+
* @param {string} name - Icon name.
|
|
2200
|
+
* @returns {SVGElement} DOM - Ready HTML to be appended.
|
|
2201
|
+
*/
|
|
2202
|
+
async fetchIcon(category, name) {
|
|
2203
|
+
let iconHTML = '';
|
|
2204
|
+
|
|
2205
|
+
if (category === 'logos') {
|
|
2206
|
+
iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
|
|
2207
|
+
} else {
|
|
2208
|
+
iconHTML = await cacheFetch(`${this.uri}/icons/${category}/${name}.svg`);
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
const dom = new DOMParser().parseFromString(iconHTML, 'text/html');
|
|
2212
|
+
|
|
2213
|
+
return dom.body.querySelector('svg');
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
// lifecycle function
|
|
2217
|
+
async firstUpdated() {
|
|
2218
|
+
if (!this.customSvg) {
|
|
2219
|
+
const svg = await this.fetchIcon(this.category, this.name);
|
|
2220
|
+
|
|
2221
|
+
if (svg) {
|
|
2222
|
+
this.svg = svg;
|
|
2223
|
+
} else if (!svg) {
|
|
2224
|
+
const penDOM = new DOMParser().parseFromString(error.svg, 'text/html');
|
|
2225
|
+
|
|
2226
|
+
this.svg = penDOM.body.firstChild;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
var tokensCss$2 = i$7`:host{--ds-auro-icon-color: var(--ds-color-icon-primary-default, $ds-color-icon-primary-default);--ds-auro-icon-size: var(--ds-size-300, $ds-size-300)}`;
|
|
2233
|
+
|
|
2234
|
+
var colorCss$3 = i$7`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[accent]){--ds-auro-icon-color: var(--ds-color-icon-accent-default, #a2c270)}:host(:not([onDark])[disabled]){--ds-auro-icon-color: var(--ds-color-icon-ui-primary-disabled-default, #adadad)}:host(:not([onDark])[emphasis]){--ds-auro-icon-color: var(--ds-color-icon-emphasis-default, #2a2a2a)}:host(:not([onDark])[error]){--ds-auro-icon-color: var(--ds-color-icon-error-default, #cc1816)}:host(:not([onDark])[info]){--ds-auro-icon-color: var(--ds-color-icon-info-default, #326aa5)}:host(:not([onDark])[secondary]){--ds-auro-icon-color: var(--ds-color-icon-secondary-default, #7e8894)}:host(:not([onDark])[subtle]){--ds-auro-icon-color: var(--ds-color-icon-subtle-default, #a0c9f1)}:host(:not([onDark])[success]){--ds-auro-icon-color: var(--ds-color-icon-success-default, #40a080)}:host(:not([onDark])[tertiary]){--ds-auro-icon-color: var(--ds-color-icon-tertiary-default, #afb9c6)}:host(:not([onDark])[warning]){--ds-auro-icon-color: var(--ds-color-icon-warning-default, #c49432)}:host([onDark]){--ds-auro-icon-color: var(--ds-color-icon-primary-inverse, #f7f7f7)}:host([onDark][accent]){--ds-auro-icon-color: var(--ds-color-icon-accent-inverse, #badd81)}:host([onDark][disabled]){--ds-auro-icon-color: var(--ds-color-icon-ui-primary-disabled-inverse, #7e7e7e)}:host([onDark][emphasis]){--ds-auro-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([onDark][error]){--ds-auro-icon-color: var(--ds-color-icon-error-inverse, #f9aca6)}:host([onDark][info]){--ds-auro-icon-color: var(--ds-color-icon-info-inverse, #89b2d4)}:host([onDark][secondary]){--ds-auro-icon-color: var(--ds-color-icon-secondary-inverse, #ccd2db)}:host([onDark][subtle]){--ds-auro-icon-color: var(--ds-color-icon-subtle-inverse, #326aa5)}:host([onDark][success]){--ds-auro-icon-color: var(--ds-color-icon-success-inverse, #8eceb9)}:host([onDark][tertiary]){--ds-auro-icon-color: var(--ds-color-icon-tertiary-inverse, #939fad)}:host([onDark][warning]){--ds-auro-icon-color: var(--ds-color-icon-warning-inverse, #f2c153)}`;
|
|
2235
|
+
|
|
2236
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2237
|
+
// See LICENSE in the project root for license information.
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
2241
|
+
/**
|
|
2242
|
+
* auro-icon provides users a way to use the Auro Icons by simply passing in the category and name.
|
|
2243
|
+
*
|
|
2244
|
+
* @attr {String} category - The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
|
|
2245
|
+
* @attr {String} name - The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage
|
|
2246
|
+
* @attr {Boolean} customColor - Removes primary selector.
|
|
2247
|
+
* @attr {Boolean} customSvg - When true, auro-icon will render a custom SVG inside the default slot.
|
|
2248
|
+
* @attr {Boolean} label - Exposes content in slot as icon label.
|
|
2249
|
+
* @attr {Boolean} primary - DEPRECATED: Sets the icon to use the baseline primary icon style.
|
|
2250
|
+
* @attr {Boolean} accent - Sets the icon to use the accent style.
|
|
2251
|
+
* @attr {Boolean} emphasis - Sets the icon to use the emphasis style.
|
|
2252
|
+
* @attr {Boolean} disabled - Sets the icon to use the disabled style.
|
|
2253
|
+
* @attr {Boolean} error - Sets the icon to use the error style.
|
|
2254
|
+
* @attr {Boolean} info - Sets the icon to use the info style.
|
|
2255
|
+
* @attr {Boolean} secondary - Sets the icon to use the secondary style.
|
|
2256
|
+
* @attr {Boolean} tertiary - Sets the icon to use the tertiary style.
|
|
2257
|
+
* @attr {Boolean} subtle - Sets the icon to use the subtle style.
|
|
2258
|
+
* @attr {Boolean} success - Sets the icon to use the success style.
|
|
2259
|
+
* @attr {Boolean} warning - Sets the icon to use the warning style.
|
|
2260
|
+
* @attr {String} ariaHidden - Set aria-hidden value. Default is `true`. Option is `false`.
|
|
2261
|
+
* @attr {String} uri - Set the uri for CDN used when fetching icons
|
|
2262
|
+
* @slot - Hidden from visibility, used for a11y if icon description is needed.
|
|
2263
|
+
* @slot svg - Used for custom SVG content.
|
|
2264
|
+
*/
|
|
2265
|
+
|
|
2266
|
+
// build the component class
|
|
2267
|
+
class AuroIcon extends BaseIcon {
|
|
2268
|
+
constructor() {
|
|
2269
|
+
super();
|
|
2270
|
+
|
|
2271
|
+
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
2272
|
+
|
|
2273
|
+
this.privateDefaults();
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* Internal Defaults.
|
|
2278
|
+
* @private
|
|
2279
|
+
* @returns {void}
|
|
2280
|
+
*/
|
|
2281
|
+
privateDefaults() {
|
|
2282
|
+
this.accent = false;
|
|
2283
|
+
this.customColor = false;
|
|
2284
|
+
this.customSvg = false;
|
|
2285
|
+
this.disabled = false;
|
|
2286
|
+
this.emphasis = false;
|
|
2287
|
+
this.error = false;
|
|
2288
|
+
this.info = false;
|
|
2289
|
+
this.label = false;
|
|
2290
|
+
this.primary = false;
|
|
2291
|
+
this.secondary = false;
|
|
2292
|
+
this.subtle = false;
|
|
2293
|
+
this.success = false;
|
|
2294
|
+
this.tertiary = false;
|
|
2295
|
+
this.warning = false;
|
|
2296
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
// function to define props used within the scope of this component
|
|
2300
|
+
static get properties() {
|
|
2301
|
+
return {
|
|
2302
|
+
...super.properties,
|
|
2303
|
+
accent: {
|
|
2304
|
+
type: Boolean,
|
|
2305
|
+
reflect: true
|
|
2306
|
+
},
|
|
2307
|
+
ariaHidden: {
|
|
2308
|
+
type: String,
|
|
2309
|
+
reflect: true
|
|
2310
|
+
},
|
|
2311
|
+
category: {
|
|
2312
|
+
type: String,
|
|
2313
|
+
reflect: true
|
|
2314
|
+
},
|
|
2315
|
+
customColor: {
|
|
2316
|
+
type: Boolean
|
|
2317
|
+
},
|
|
2318
|
+
customSvg: {
|
|
2319
|
+
type: Boolean
|
|
2320
|
+
},
|
|
2321
|
+
disabled: {
|
|
2322
|
+
type: Boolean,
|
|
2323
|
+
reflect: true
|
|
2324
|
+
},
|
|
2325
|
+
emphasis: {
|
|
2326
|
+
type: Boolean,
|
|
2327
|
+
reflect: true
|
|
2328
|
+
},
|
|
2329
|
+
error: {
|
|
2330
|
+
type: Boolean,
|
|
2331
|
+
reflect: true
|
|
2332
|
+
},
|
|
2333
|
+
info: {
|
|
2334
|
+
type: Boolean,
|
|
2335
|
+
reflect: true
|
|
2336
|
+
},
|
|
2337
|
+
label: {
|
|
2338
|
+
type: Boolean,
|
|
2339
|
+
reflect: true
|
|
2340
|
+
},
|
|
2341
|
+
name: {
|
|
2342
|
+
type: String,
|
|
2343
|
+
reflect: true
|
|
2344
|
+
},
|
|
2345
|
+
primary: {
|
|
2346
|
+
type: Boolean,
|
|
2347
|
+
reflect: true
|
|
2348
|
+
},
|
|
2349
|
+
secondary: {
|
|
2350
|
+
type: Boolean,
|
|
2351
|
+
reflect: true
|
|
2352
|
+
},
|
|
2353
|
+
subtle: {
|
|
2354
|
+
type: Boolean,
|
|
2355
|
+
reflect: true
|
|
2356
|
+
},
|
|
2357
|
+
success: {
|
|
2358
|
+
type: Boolean,
|
|
2359
|
+
reflect: true
|
|
2360
|
+
},
|
|
2361
|
+
tertiary: {
|
|
2362
|
+
type: Boolean,
|
|
2363
|
+
reflect: true
|
|
2364
|
+
},
|
|
2365
|
+
uri: {
|
|
2366
|
+
type: String
|
|
2367
|
+
},
|
|
2368
|
+
warning: {
|
|
2369
|
+
type: Boolean,
|
|
2370
|
+
reflect: true
|
|
2371
|
+
}
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
static get styles() {
|
|
2376
|
+
return [
|
|
2377
|
+
super.styles,
|
|
2378
|
+
i$7`${tokensCss$2}`,
|
|
2379
|
+
i$7`${styleCss$3}`,
|
|
2380
|
+
i$7`${colorCss$3}`
|
|
2381
|
+
];
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
/**
|
|
2385
|
+
* This will register this element with the browser.
|
|
2386
|
+
* @param {string} [name="auro-icon"] - The name of element that you want to register to.
|
|
2387
|
+
*
|
|
2388
|
+
* @example
|
|
2389
|
+
* AuroIcon.register("custom-icon") // this will register this element to <custom-icon/>
|
|
2390
|
+
*
|
|
2391
|
+
*/
|
|
2392
|
+
static register(name = "auro-icon") {
|
|
2393
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
connectedCallback() {
|
|
2397
|
+
super.connectedCallback();
|
|
2398
|
+
|
|
2399
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
2400
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-icon');
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* @returns {void} Exposes CSS parts for styling from parent components.
|
|
2405
|
+
*/
|
|
2406
|
+
exposeCssParts() {
|
|
2407
|
+
this.setAttribute('exportparts', 'svg:iconSvg');
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
2411
|
+
render() {
|
|
2412
|
+
const a11y = {
|
|
2413
|
+
'labelContainer': true,
|
|
2414
|
+
'util_displayHiddenVisually': !this.label
|
|
2415
|
+
};
|
|
2416
|
+
|
|
2417
|
+
const classes = {
|
|
2418
|
+
'label': this.label,
|
|
2419
|
+
'wrapper': true,
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
return x$1`
|
|
2423
|
+
<div
|
|
2424
|
+
class="${e$3(classes)}"
|
|
2425
|
+
title="${o$3(this.title || undefined)}">
|
|
2426
|
+
<span aria-hidden="${o$3(this.ariaHidden ? this.ariaHidden : true)}" part="svg">
|
|
2427
|
+
${this.customSvg ? x$1`
|
|
2428
|
+
<slot name="svg"></slot>
|
|
2429
|
+
` : x$1`
|
|
2430
|
+
${this.svg}
|
|
2431
|
+
`
|
|
2432
|
+
}
|
|
2433
|
+
</span>
|
|
2434
|
+
|
|
2435
|
+
<div class="${e$3(a11y)}">
|
|
2436
|
+
<slot></slot>
|
|
2437
|
+
</div>
|
|
2438
|
+
</div>
|
|
2439
|
+
`;
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
var iconVersion = '6.1.2';
|
|
2444
|
+
|
|
2445
|
+
var styleCss$2 = i$7`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}`;
|
|
2446
|
+
|
|
2447
|
+
var colorCss$2 = i$7`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2448
|
+
|
|
2449
|
+
var tokensCss$1 = i$7`:host{--ds-auro-dropdown-label-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-popover-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-popover-border-color: transparent;--ds-auro-dropdown-popover-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-trigger-border-color: transparent;--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-color-text-primary-default, #2a2a2a)}`;
|
|
2450
|
+
|
|
2451
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2452
|
+
// See LICENSE in the project root for license information.
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
|
|
2456
|
+
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2457
|
+
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2458
|
+
'lg',
|
|
2459
|
+
'md',
|
|
2460
|
+
'sm',
|
|
2461
|
+
'xs',
|
|
2462
|
+
];
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* @prop { String } fullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
2466
|
+
* @csspart bibContainer - Apply css to the bib container.
|
|
2467
|
+
*/
|
|
2468
|
+
|
|
2469
|
+
class AuroDropdownBib extends r$4 {
|
|
2470
|
+
|
|
2471
|
+
constructor() {
|
|
2472
|
+
super();
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* @private
|
|
2476
|
+
*/
|
|
2477
|
+
this._mobileBreakpointValue = undefined;
|
|
2478
|
+
|
|
2479
|
+
AuroLibraryRuntimeUtils$1.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
static get styles() {
|
|
2483
|
+
return [
|
|
2484
|
+
styleCss$2,
|
|
2485
|
+
colorCss$2,
|
|
2486
|
+
tokensCss$1
|
|
2487
|
+
];
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
static get properties() {
|
|
2491
|
+
return {
|
|
2492
|
+
|
|
2493
|
+
/**
|
|
2494
|
+
* If declared, will take the fullscreen when the bib is displayed.
|
|
2495
|
+
*/
|
|
2496
|
+
isFullscreen: {
|
|
2497
|
+
type: Boolean,
|
|
2498
|
+
reflect: true
|
|
2499
|
+
},
|
|
2500
|
+
|
|
2501
|
+
/**
|
|
2502
|
+
* If declared, will apply all styles for the common theme.
|
|
2503
|
+
*/
|
|
2504
|
+
common: {
|
|
2505
|
+
type: Boolean,
|
|
2506
|
+
reflect: true
|
|
2507
|
+
},
|
|
2508
|
+
|
|
2509
|
+
/**
|
|
2510
|
+
* If declared, will apply extra padding to bib content.
|
|
2511
|
+
*/
|
|
2512
|
+
inset: {
|
|
2513
|
+
type: Boolean,
|
|
2514
|
+
reflect: true
|
|
2515
|
+
},
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* If declared, will apply border-radius to the bib.
|
|
2519
|
+
*/
|
|
2520
|
+
rounded: {
|
|
2521
|
+
type: Boolean,
|
|
2522
|
+
reflect: true
|
|
2523
|
+
},
|
|
2524
|
+
};
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
set mobileFullscreenBreakpoint(value) {
|
|
2528
|
+
// verify the defined breakpoint is valid and exit out if not
|
|
2529
|
+
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
2530
|
+
if (!validatedValue) {
|
|
2531
|
+
this._mobileBreakpointValue = undefined;
|
|
2532
|
+
} else {
|
|
2533
|
+
// get the pixel value for the defined breakpoint
|
|
2534
|
+
const docStyle = getComputedStyle(document.documentElement);
|
|
2535
|
+
this._mobileBreakpointValue = docStyle.getPropertyValue(DESIGN_TOKEN_BREAKPOINT_PREFIX + value);
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
get mobileFullscreenBreakpoint() {
|
|
2540
|
+
return this._mobileBreakpointValue;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
updated(changedProperties) {
|
|
2544
|
+
if (changedProperties.has('isFullscreen')) {
|
|
2545
|
+
this.childNodes.forEach((child) => {
|
|
2546
|
+
// skip any text that is not in an HTMLElement on setting `isFullscreen` attr.
|
|
2547
|
+
if (child.nodeName !== '#text') {
|
|
2548
|
+
if (this.isFullscreen) {
|
|
2549
|
+
child.setAttribute('isFullscreen', 'true');
|
|
2550
|
+
} else {
|
|
2551
|
+
child.removeAttribute('isFullscreen');
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
2559
|
+
render() {
|
|
2560
|
+
return u$3`
|
|
2561
|
+
<div class="container" part="bibContainer">
|
|
2562
|
+
<slot></slot>
|
|
2563
|
+
</div>
|
|
2564
|
+
`;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
var dropdownVersion = '3.0.0';
|
|
2569
|
+
|
|
2570
|
+
var styleCss$1 = i$7`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
2571
|
+
|
|
2572
|
+
var colorCss$1 = i$7`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);--ds-auro-dropdown-trigger-outline-color: var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* @license
|
|
2576
|
+
* Copyright 2019 Google LLC
|
|
2577
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2578
|
+
*/
|
|
2579
|
+
const t$1=globalThis,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$2("string"==typeof t?t:t+"",void 0,s$1),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$2(o,t,s$1)},S$1=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$3(e)})(t):t;
|
|
2580
|
+
|
|
2581
|
+
/**
|
|
2582
|
+
* @license
|
|
2583
|
+
* Copyright 2017 Google LLC
|
|
2584
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2585
|
+
*/const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:r$2,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$2(t,s),y$1={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y$1){if(s.state&&(s.attribute=false),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$1(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...h$1(t),...o$1(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$1)(this[t],s))return;this.P(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),true===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t) true!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=false,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[d$1("elementProperties")]=new Map,b[d$1("finalized")]=new Map,p$1?.({ReactiveElement:b}),(a$1.reactiveElementVersions??=[]).push("2.0.4");
|
|
2586
|
+
|
|
2587
|
+
/**
|
|
2588
|
+
* @license
|
|
2589
|
+
* Copyright 2017 Google LLC
|
|
2590
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2591
|
+
*/
|
|
2592
|
+
const t=globalThis,i$1=t.trustedTypes,s=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+h,n=`<${o}>`,r$1=document,l=()=>r$1.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$1.createTreeWalker(r$1,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$1.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$1).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.2.1");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
2593
|
+
|
|
2594
|
+
/**
|
|
2595
|
+
* @license
|
|
2596
|
+
* Copyright 2017 Google LLC
|
|
2597
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2598
|
+
*/class r extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}}r._$litElement$=true,r["finalized"]=true,globalThis.litElementHydrateSupport?.({LitElement:r});const i=globalThis.litElementPolyfillSupport;i?.({LitElement:r});(globalThis.litElementVersions??=[]).push("4.1.1");
|
|
2599
|
+
|
|
2600
|
+
var colorCss = i$3`:host([error]){--ds-auro-helptext-color: var(--ds-color-text-error-default, #cc1816)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
2601
|
+
|
|
2602
|
+
var styleCss = i$3`.helptext-wrapper{display:none;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-size-200, 1rem)}:host([large]) .helptext-wrapper{font-size:var(--ds-text-body-size-default, 1rem)}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
2603
|
+
|
|
2604
|
+
var tokensCss = i$3`:host{--ds-auro-helptext-color: var(--ds-color-text-tertiary-default, #6a717c)}`;
|
|
2605
|
+
|
|
2606
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2607
|
+
// See LICENSE in the project root for license information.
|
|
2608
|
+
|
|
2609
|
+
// ---------------------------------------------------------------------
|
|
2610
|
+
|
|
2611
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
2612
|
+
|
|
2613
|
+
class AuroLibraryRuntimeUtils {
|
|
2614
|
+
|
|
2615
|
+
/* eslint-disable jsdoc/require-param */
|
|
2616
|
+
|
|
2617
|
+
/**
|
|
2618
|
+
* This will register a new custom element with the browser.
|
|
2619
|
+
* @param {String} name - The name of the custom element.
|
|
2620
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
2621
|
+
* @returns {void}
|
|
2622
|
+
*/
|
|
2623
|
+
registerComponent(name, componentClass) {
|
|
2624
|
+
if (!customElements.get(name)) {
|
|
2625
|
+
customElements.define(name, class extends componentClass {});
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
/**
|
|
2630
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
2631
|
+
* @returns {void}
|
|
2632
|
+
*/
|
|
2633
|
+
closestElement(
|
|
2634
|
+
selector, // selector like in .closest()
|
|
2635
|
+
base = this, // extra functionality to skip a parent
|
|
2636
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
2637
|
+
!el || el === document || el === window
|
|
2638
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
2639
|
+
: found
|
|
2640
|
+
? found // found a selector INside this element
|
|
2641
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
2642
|
+
) {
|
|
2643
|
+
return __Closest(base);
|
|
2644
|
+
}
|
|
2645
|
+
/* eslint-enable jsdoc/require-param */
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
2649
|
+
* @param {Object} elem - The element to check.
|
|
2650
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
2651
|
+
* @returns {void}
|
|
2652
|
+
*/
|
|
2653
|
+
handleComponentTagRename(elem, tagName) {
|
|
2654
|
+
const tag = tagName.toLowerCase();
|
|
2655
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2656
|
+
|
|
2657
|
+
if (elemTag !== tag) {
|
|
2658
|
+
elem.setAttribute(tag, true);
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
/**
|
|
2663
|
+
* Validates if an element is a specific Auro component.
|
|
2664
|
+
* @param {Object} elem - The element to validate.
|
|
2665
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
2666
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
2667
|
+
*/
|
|
2668
|
+
elementMatch(elem, tagName) {
|
|
2669
|
+
const tag = tagName.toLowerCase();
|
|
2670
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2671
|
+
|
|
2672
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2677
|
+
// See LICENSE in the project root for license information.
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
/**
|
|
2681
|
+
* Displays help text or error messages within form elements - Internal Use Only.
|
|
2682
|
+
*
|
|
2683
|
+
* @attr { Boolean } large - If declared, make font-size to 1rem(16px).
|
|
2684
|
+
*/
|
|
2685
|
+
class AuroHelpText extends r {
|
|
2686
|
+
|
|
2687
|
+
constructor() {
|
|
2688
|
+
super();
|
|
2689
|
+
|
|
2690
|
+
this.error = false;
|
|
2691
|
+
this.hasTextContent = false;
|
|
2692
|
+
|
|
2693
|
+
AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
static get styles() {
|
|
2697
|
+
return [
|
|
2698
|
+
colorCss,
|
|
2699
|
+
styleCss,
|
|
2700
|
+
tokensCss
|
|
2701
|
+
];
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
// function to define props used within the scope of this component
|
|
2705
|
+
static get properties() {
|
|
2706
|
+
return {
|
|
2707
|
+
|
|
2708
|
+
/**
|
|
2709
|
+
* @private
|
|
2710
|
+
*/
|
|
2711
|
+
slotNodes: {
|
|
2712
|
+
type: Boolean,
|
|
2713
|
+
},
|
|
2714
|
+
|
|
2715
|
+
/**
|
|
2716
|
+
* @private
|
|
2717
|
+
*/
|
|
2718
|
+
hasTextContent: {
|
|
2719
|
+
type: Boolean,
|
|
2720
|
+
},
|
|
2721
|
+
|
|
2722
|
+
/**
|
|
2723
|
+
* If declared, make font color red.
|
|
2724
|
+
*/
|
|
2725
|
+
error: {
|
|
2726
|
+
type: Boolean,
|
|
2727
|
+
reflect: true,
|
|
2728
|
+
},
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
/**
|
|
2733
|
+
* This will register this element with the browser.
|
|
2734
|
+
* @param {string} [name="auro-helptext"] - The name of element that you want to register to.
|
|
2735
|
+
*
|
|
2736
|
+
* @example
|
|
2737
|
+
* AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
|
|
2738
|
+
*
|
|
2739
|
+
*/
|
|
2740
|
+
static register(name = "auro-helptext") {
|
|
2741
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
updated() {
|
|
2745
|
+
this.handleSlotChange();
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
handleSlotChange(event) {
|
|
2749
|
+
if (event) {
|
|
2750
|
+
this.slotNodes = event.target.assignedNodes();
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/**
|
|
2757
|
+
* Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
|
|
2758
|
+
*
|
|
2759
|
+
* @param {NodeList|Array} nodes - The list of nodes to check for content.
|
|
2760
|
+
* @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
|
|
2761
|
+
* @private
|
|
2762
|
+
*/
|
|
2763
|
+
checkSlotsForContent(nodes) {
|
|
2764
|
+
if (!nodes) {
|
|
2765
|
+
return false;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
return nodes.some((node) => {
|
|
2769
|
+
if (node.textContent.trim()) {
|
|
2770
|
+
return true;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
if (!node.querySelector) {
|
|
2774
|
+
return false;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
|
|
2778
|
+
if (!nestedSlot) {
|
|
2779
|
+
return false;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
const nestedSlotNodes = nestedSlot.assignedNodes();
|
|
2783
|
+
return this.checkSlotsForContent(nestedSlotNodes);
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
2788
|
+
render() {
|
|
2789
|
+
return x`
|
|
2790
|
+
<div class="helptext-wrapper" ?visible="${this.hasTextContent}">
|
|
2791
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
2792
|
+
</div>
|
|
2793
|
+
`;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
var helpTextVersion = '1.0.0';
|
|
2798
|
+
|
|
2799
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2800
|
+
// See LICENSE in the project root for license information.
|
|
2801
|
+
|
|
2802
|
+
|
|
2803
|
+
/**
|
|
2804
|
+
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
2805
|
+
* @slot - Default slot for the popover content.
|
|
2806
|
+
* @slot label - Defines the content of the label.
|
|
2807
|
+
* @slot helpText - Defines the content of the helpText.
|
|
2808
|
+
* @slot trigger - Defines the content of the trigger.
|
|
2809
|
+
* @csspart trigger - The trigger content container.
|
|
2810
|
+
* @csspart chevron - The collapsed/expanded state icon container.
|
|
2811
|
+
* @csspart helpText - The helpText content container.
|
|
2812
|
+
* @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
|
|
2813
|
+
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
2814
|
+
*/
|
|
2815
|
+
class AuroDropdown extends r$4 {
|
|
2816
|
+
constructor() {
|
|
2817
|
+
super();
|
|
2818
|
+
|
|
2819
|
+
this.isPopoverVisible = false;
|
|
2820
|
+
this.isBibFullscreen = false;
|
|
2821
|
+
this.matchWidth = false;
|
|
2822
|
+
this.noHideOnThisFocusLoss = false;
|
|
2823
|
+
|
|
2824
|
+
this.privateDefaults();
|
|
2825
|
+
|
|
2826
|
+
/**
|
|
2827
|
+
* @private
|
|
2828
|
+
* @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
|
|
2829
|
+
*/
|
|
2830
|
+
this.constructor.shadowRootOptions = {
|
|
2831
|
+
...r$4.shadowRootOptions,
|
|
2832
|
+
delegatesFocus: true,
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2835
|
+
/**
|
|
2836
|
+
* @private
|
|
2837
|
+
*/
|
|
2838
|
+
this.triggerContentFocusable = false;
|
|
2839
|
+
|
|
2840
|
+
/**
|
|
2841
|
+
* @private
|
|
2842
|
+
*/
|
|
2843
|
+
this.showTriggerBorders = true;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* @private
|
|
2848
|
+
* @returns {void} Internal defaults.
|
|
2849
|
+
*/
|
|
2850
|
+
privateDefaults() {
|
|
2851
|
+
this.bordered = false;
|
|
2852
|
+
this.chevron = false;
|
|
2853
|
+
this.disabled = false;
|
|
2854
|
+
this.error = false;
|
|
2855
|
+
this.inset = false;
|
|
2856
|
+
this.placement = 'bottom-start';
|
|
2857
|
+
this.rounded = false;
|
|
2858
|
+
this.tabIndex = 0;
|
|
2859
|
+
this.noToggle = false;
|
|
2860
|
+
|
|
2861
|
+
/**
|
|
2862
|
+
* @private
|
|
2863
|
+
*/
|
|
2864
|
+
this.hasTriggerContent = false;
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* @private
|
|
2868
|
+
*/
|
|
2869
|
+
this.triggerContentSlot = undefined;
|
|
2870
|
+
|
|
2871
|
+
/**
|
|
2872
|
+
* @private
|
|
2873
|
+
*/
|
|
2874
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
2875
|
+
|
|
2876
|
+
/**
|
|
2877
|
+
* @private
|
|
2878
|
+
*/
|
|
2879
|
+
this.floater = new AuroFloatingUI();
|
|
2880
|
+
|
|
2881
|
+
/**
|
|
2882
|
+
* @private
|
|
2883
|
+
*/
|
|
2884
|
+
this.floaterConfig = {
|
|
2885
|
+
placement: 'bottom-start',
|
|
2886
|
+
flip: true,
|
|
2887
|
+
autoPlacement: false,
|
|
2888
|
+
offset: 0,
|
|
2889
|
+
};
|
|
2890
|
+
|
|
2891
|
+
/**
|
|
2892
|
+
* Generate unique names for dependency components.
|
|
2893
|
+
*/
|
|
2894
|
+
const versioning = new AuroDependencyVersioning();
|
|
2895
|
+
|
|
2896
|
+
/**
|
|
2897
|
+
* @private
|
|
2898
|
+
*/
|
|
2899
|
+
this.iconTag = versioning.generateTag('auro-icon', iconVersion, AuroIcon);
|
|
2900
|
+
|
|
2901
|
+
/**
|
|
2902
|
+
* @private
|
|
2903
|
+
*/
|
|
2904
|
+
this.dropdownBibTag = versioning.generateTag('auro-dropdownbib', dropdownVersion, AuroDropdownBib);
|
|
2905
|
+
|
|
2906
|
+
/**
|
|
2907
|
+
* @private
|
|
2908
|
+
*/
|
|
2909
|
+
this.helpTextTag = versioning.generateTag('auro-helptext', helpTextVersion, AuroHelpText);
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
/**
|
|
2913
|
+
* Public method to hide the dropdown.
|
|
2914
|
+
* @returns {void}
|
|
2915
|
+
*/
|
|
2916
|
+
hide() {
|
|
2917
|
+
this.floater.hideBib();
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
/**
|
|
2921
|
+
* Public method to show the dropdown.
|
|
2922
|
+
* @returns {void}
|
|
2923
|
+
*/
|
|
2924
|
+
show() {
|
|
2925
|
+
this.floater.showBib();
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
// function to define props used within the scope of this component
|
|
2929
|
+
static get properties() {
|
|
2930
|
+
return {
|
|
2931
|
+
|
|
2932
|
+
/**
|
|
2933
|
+
* If declared, applies a border around the trigger slot.
|
|
2934
|
+
*/
|
|
2935
|
+
bordered: {
|
|
2936
|
+
type: Boolean,
|
|
2937
|
+
reflect: true
|
|
2938
|
+
},
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
2942
|
+
* @attr {Boolean} chevron
|
|
2943
|
+
*/
|
|
2944
|
+
chevron: {
|
|
2945
|
+
type: Boolean,
|
|
2946
|
+
reflect: true
|
|
2947
|
+
},
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* If declared, the dropdown will be styled with the common theme.
|
|
2951
|
+
*/
|
|
2952
|
+
common: {
|
|
2953
|
+
type: Boolean,
|
|
2954
|
+
reflect: true
|
|
2955
|
+
},
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* If declared, the dropdown is not interactive.
|
|
2959
|
+
*/
|
|
2960
|
+
disabled: {
|
|
2961
|
+
type: Boolean,
|
|
2962
|
+
reflect: true
|
|
2963
|
+
},
|
|
2964
|
+
|
|
2965
|
+
/**
|
|
2966
|
+
* @private
|
|
2967
|
+
*/
|
|
2968
|
+
dropdownWidth: {
|
|
2969
|
+
type: Number
|
|
2970
|
+
},
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
2974
|
+
*/
|
|
2975
|
+
error: {
|
|
2976
|
+
type: Boolean,
|
|
2977
|
+
reflect: true
|
|
2978
|
+
},
|
|
2979
|
+
|
|
2980
|
+
/**
|
|
2981
|
+
* If declared, the bib will display when focus is applied to the trigger.
|
|
2982
|
+
*/
|
|
2983
|
+
focusShow: {
|
|
2984
|
+
type: Boolean,
|
|
2985
|
+
reflect: true
|
|
2986
|
+
},
|
|
2987
|
+
|
|
2988
|
+
/**
|
|
2989
|
+
* Makes the trigger to be full width of its parent container.
|
|
2990
|
+
*/
|
|
2991
|
+
fluid: {
|
|
2992
|
+
type: Boolean,
|
|
2993
|
+
reflect: true
|
|
2994
|
+
},
|
|
2995
|
+
|
|
2996
|
+
/**
|
|
2997
|
+
* If declared, will apply padding around trigger slot content.
|
|
2998
|
+
*/
|
|
2999
|
+
inset: {
|
|
3000
|
+
type: Boolean,
|
|
3001
|
+
reflect: true
|
|
3002
|
+
},
|
|
3003
|
+
|
|
3004
|
+
/**
|
|
3005
|
+
* If true, the dropdown bib is displayed.
|
|
3006
|
+
*/
|
|
3007
|
+
isPopoverVisible: {
|
|
3008
|
+
type: Boolean
|
|
3009
|
+
},
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* If true, the dropdown bib is taking the fullscreen when it's open
|
|
3013
|
+
*/
|
|
3014
|
+
isBibFullscreen: {
|
|
3015
|
+
type: Boolean,
|
|
3016
|
+
reflect: true,
|
|
3017
|
+
},
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
* If declared, the trigger will toggle the dropdown on mouseover/mouseout.
|
|
3021
|
+
*/
|
|
3022
|
+
hoverToggle: {
|
|
3023
|
+
type: Boolean,
|
|
3024
|
+
reflect: true
|
|
3025
|
+
},
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* @private
|
|
3029
|
+
*/
|
|
3030
|
+
hasTriggerContent: {
|
|
3031
|
+
type: Boolean
|
|
3032
|
+
},
|
|
3033
|
+
|
|
3034
|
+
/**
|
|
3035
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
3036
|
+
*/
|
|
3037
|
+
fullscreenBreakpoint: {
|
|
3038
|
+
type: String,
|
|
3039
|
+
reflect: true
|
|
3040
|
+
},
|
|
3041
|
+
|
|
3042
|
+
/**
|
|
3043
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
3044
|
+
*/
|
|
3045
|
+
matchWidth: {
|
|
3046
|
+
type: Boolean,
|
|
3047
|
+
reflect: true
|
|
3048
|
+
},
|
|
3049
|
+
|
|
3050
|
+
/**
|
|
3051
|
+
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3052
|
+
*/
|
|
3053
|
+
noHideOnThisFocusLoss: {
|
|
3054
|
+
type: Boolean,
|
|
3055
|
+
reflect: true
|
|
3056
|
+
},
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* If declared, the trigger will only show the dropdown bib.
|
|
3060
|
+
*/
|
|
3061
|
+
noToggle: {
|
|
3062
|
+
type: Boolean,
|
|
3063
|
+
reflect: true
|
|
3064
|
+
},
|
|
3065
|
+
|
|
3066
|
+
onSlotChange: {
|
|
3067
|
+
type: Function,
|
|
3068
|
+
reflect: false
|
|
3069
|
+
},
|
|
3070
|
+
|
|
3071
|
+
/**
|
|
3072
|
+
* @private
|
|
3073
|
+
*/
|
|
3074
|
+
placement: {
|
|
3075
|
+
type: String
|
|
3076
|
+
},
|
|
3077
|
+
|
|
3078
|
+
/**
|
|
3079
|
+
* If declared, will apply border-radius to trigger and default slots.
|
|
3080
|
+
*/
|
|
3081
|
+
rounded: {
|
|
3082
|
+
type: Boolean,
|
|
3083
|
+
reflect: true
|
|
3084
|
+
},
|
|
3085
|
+
|
|
3086
|
+
/**
|
|
3087
|
+
* @private
|
|
3088
|
+
*/
|
|
3089
|
+
tabIndex: {
|
|
3090
|
+
type: Number
|
|
3091
|
+
}
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
static get styles() {
|
|
3096
|
+
return [
|
|
3097
|
+
colorCss$1,
|
|
3098
|
+
styleCss$1,
|
|
3099
|
+
tokensCss$1
|
|
3100
|
+
];
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* This will register this element with the browser.
|
|
3105
|
+
* @param {string} [name="auro-dropdown"] - The name of element that you want to register to.
|
|
3106
|
+
*
|
|
3107
|
+
* @example
|
|
3108
|
+
* AuroDropdown.register("custom-dropdown") // this will register this element to <custom-dropdown/>
|
|
3109
|
+
*
|
|
3110
|
+
*/
|
|
3111
|
+
static register(name = "auro-dropdown") {
|
|
3112
|
+
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroDropdown);
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
connectedCallback() {
|
|
3116
|
+
super.connectedCallback();
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
disconnectedCallback() {
|
|
3120
|
+
super.disconnectedCallback();
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
updated(changedProperties) {
|
|
3124
|
+
this.floater.handleUpdate(changedProperties);
|
|
3125
|
+
|
|
3126
|
+
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
3127
|
+
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
// when trigger's content is changed without any attribute or node change,
|
|
3131
|
+
// `requestUpdate` needs to be called to update hasTriggerContnet
|
|
3132
|
+
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3133
|
+
this.handleTriggerContentSlotChange();
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
firstUpdated() {
|
|
3138
|
+
this.floater.configure(this, 'auroDropdown');
|
|
3139
|
+
this.bibContent = this.floater.element.bib;
|
|
3140
|
+
|
|
3141
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
3142
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
/**
|
|
3146
|
+
* Exposes CSS parts for styling from parent components.
|
|
3147
|
+
* @returns {void}
|
|
3148
|
+
*/
|
|
3149
|
+
exposeCssParts() {
|
|
3150
|
+
this.setAttribute('exportparts', 'trigger:dropdownTrigger, chevron:dropdownChevron, helpText:dropdownHelpText, size:dropdownSize');
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
/**
|
|
3154
|
+
* Determines if content is within a custom slot.
|
|
3155
|
+
* @private
|
|
3156
|
+
* @param {HTMLElement} element - The element to check.
|
|
3157
|
+
* @returns {Boolean}
|
|
3158
|
+
*/
|
|
3159
|
+
isCustomSlotContent(element) {
|
|
3160
|
+
let currentElement = element;
|
|
3161
|
+
|
|
3162
|
+
let inCustomSlot = false;
|
|
3163
|
+
|
|
3164
|
+
while (currentElement) {
|
|
3165
|
+
currentElement = currentElement.parentElement;
|
|
3166
|
+
|
|
3167
|
+
if (currentElement && currentElement.hasAttribute('slot')) {
|
|
3168
|
+
inCustomSlot = true;
|
|
3169
|
+
break;
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
return inCustomSlot;
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3176
|
+
/**
|
|
3177
|
+
* Determines if the element or any children are focusable.
|
|
3178
|
+
* @private
|
|
3179
|
+
* @param {HTMLElement} element - Element to check.
|
|
3180
|
+
* @returns {Boolean} - True if the element or any children are focusable.
|
|
3181
|
+
*/
|
|
3182
|
+
containsFocusableElement(element) {
|
|
3183
|
+
this.showTriggerBorders = true;
|
|
3184
|
+
|
|
3185
|
+
const nodes = [
|
|
3186
|
+
element,
|
|
3187
|
+
...element.children
|
|
3188
|
+
];
|
|
3189
|
+
|
|
3190
|
+
const focusableElements = [
|
|
3191
|
+
'a',
|
|
3192
|
+
'auro-hyperlink',
|
|
3193
|
+
'button',
|
|
3194
|
+
'auro-button',
|
|
3195
|
+
'input',
|
|
3196
|
+
'auro-input',
|
|
3197
|
+
];
|
|
3198
|
+
|
|
3199
|
+
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
3200
|
+
|
|
3201
|
+
const result = nodes.some((node) => {
|
|
3202
|
+
const tagName = node.tagName.toLowerCase();
|
|
3203
|
+
|
|
3204
|
+
if (node.tabIndex > -1) {
|
|
3205
|
+
return true;
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
if (focusableElements.includes(tagName)) {
|
|
3209
|
+
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
3210
|
+
return true;
|
|
3211
|
+
}
|
|
3212
|
+
if (!node.hasAttribute('disabled')) {
|
|
3213
|
+
return true;
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
3218
|
+
return true;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
return false;
|
|
3222
|
+
});
|
|
3223
|
+
|
|
3224
|
+
if (result) {
|
|
3225
|
+
this.showTriggerBorders = !nodes.some((node) => {
|
|
3226
|
+
const tagName = node.tagName.toLowerCase();
|
|
3227
|
+
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
return result;
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
/**
|
|
3235
|
+
* Handles changes to the trigger content slot and updates related properties.
|
|
3236
|
+
*
|
|
3237
|
+
* It first updates the floater settings
|
|
3238
|
+
* Then, it retrieves the assigned nodes from the event target and checks if any of
|
|
3239
|
+
* the nodes contain non-empty text content, updating the `hasTriggerContent` property accordingly.
|
|
3240
|
+
*
|
|
3241
|
+
* @private
|
|
3242
|
+
* @method handleTriggerContentSlotChange
|
|
3243
|
+
* @param {Event} event - Native slotchange event.
|
|
3244
|
+
* @returns {void}
|
|
3245
|
+
*/
|
|
3246
|
+
handleTriggerContentSlotChange(event) {
|
|
3247
|
+
this.floater.handleTriggerTabIndex();
|
|
3248
|
+
|
|
3249
|
+
const triggerContentNodes = this.shadowRoot.querySelector('.triggerContent slot').assignedNodes();
|
|
3250
|
+
|
|
3251
|
+
triggerContentNodes.forEach((node) => {
|
|
3252
|
+
if (!this.triggerContentFocusable) {
|
|
3253
|
+
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3254
|
+
}
|
|
3255
|
+
});
|
|
3256
|
+
|
|
3257
|
+
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3258
|
+
|
|
3259
|
+
if (!this.triggerContentFocusable) {
|
|
3260
|
+
trigger.setAttribute('tabindex', '0');
|
|
3261
|
+
trigger.setAttribute('role', 'button');
|
|
3262
|
+
} else {
|
|
3263
|
+
trigger.removeAttribute('tabindex');
|
|
3264
|
+
trigger.removeAttribute('role');
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
if (event) {
|
|
3268
|
+
this.triggerNode = event.target;
|
|
3269
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
if (this.triggerContentSlot) {
|
|
3273
|
+
this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
|
|
3274
|
+
if (slot.textContent.trim()) {
|
|
3275
|
+
return true;
|
|
3276
|
+
}
|
|
3277
|
+
const slotInSlot = slot.querySelector('slot');
|
|
3278
|
+
if (!slotInSlot) {
|
|
3279
|
+
return false;
|
|
3280
|
+
}
|
|
3281
|
+
const slotsInSlotNodes = slotInSlot.assignedNodes();
|
|
3282
|
+
return slotsInSlotNodes.some((ss) => Boolean(ss.textContent.trim()));
|
|
3283
|
+
});
|
|
3284
|
+
} else {
|
|
3285
|
+
this.hasTriggerContent = false;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* Handles the default slot change event and updates the content.
|
|
3291
|
+
*
|
|
3292
|
+
* This method retrieves all nodes assigned to the default slot of the event target and appends them
|
|
3293
|
+
* to the `bibContent` element. If a callback function `onSlotChange` is defined, it is invoked to
|
|
3294
|
+
* notify about the slot change.
|
|
3295
|
+
*
|
|
3296
|
+
* @private
|
|
3297
|
+
* @method handleDefaultSlot
|
|
3298
|
+
* @param {Event} event - The event object representing the slot change.
|
|
3299
|
+
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
3300
|
+
*/
|
|
3301
|
+
handleDefaultSlot(event) {
|
|
3302
|
+
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
3303
|
+
|
|
3304
|
+
if (this.onSlotChange) {
|
|
3305
|
+
this.onSlotChange();
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
3310
|
+
render() {
|
|
3311
|
+
return u$3`
|
|
3312
|
+
<div>
|
|
3313
|
+
<div
|
|
3314
|
+
id="trigger"
|
|
3315
|
+
class="trigger"
|
|
3316
|
+
part="trigger"
|
|
3317
|
+
aria-labelledby="triggerLabel"
|
|
3318
|
+
tabindex="${this.tabIndex}"
|
|
3319
|
+
?showBorder="${this.showTriggerBorders}"
|
|
3320
|
+
>
|
|
3321
|
+
<div class="triggerContentWrapper">
|
|
3322
|
+
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3323
|
+
<slot name="label"></slot>
|
|
3324
|
+
</label>
|
|
3325
|
+
<div class="triggerContent">
|
|
3326
|
+
<slot
|
|
3327
|
+
name="trigger"
|
|
3328
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
3329
|
+
</div>
|
|
3330
|
+
</div>
|
|
3331
|
+
${this.chevron || this.common ? u$3`
|
|
3332
|
+
<div
|
|
3333
|
+
id="showStateIcon"
|
|
3334
|
+
part="chevron">
|
|
3335
|
+
<${this.iconTag}
|
|
3336
|
+
category="interface"
|
|
3337
|
+
name="chevron-down"
|
|
3338
|
+
customColor
|
|
3339
|
+
?disabled=${this.disabled}
|
|
3340
|
+
>
|
|
3341
|
+
</${this.iconTag}>
|
|
3342
|
+
</div>
|
|
3343
|
+
` : undefined }
|
|
3344
|
+
</div>
|
|
3345
|
+
<${this.helpTextTag} part="helpText" ?error="${this.error}">
|
|
3346
|
+
<slot name="helpText"></slot>
|
|
3347
|
+
</${this.helpTextTag}>
|
|
3348
|
+
<div class="slotContent">
|
|
3349
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
3350
|
+
</div>
|
|
3351
|
+
<div id="bibSizer" part="size"></div>
|
|
3352
|
+
<${this.dropdownBibTag}
|
|
3353
|
+
id="bib"
|
|
3354
|
+
role="tooltip"
|
|
3355
|
+
?isfullscreen="${this.isBibFullscreen}"
|
|
3356
|
+
?common="${this.common}"
|
|
3357
|
+
?rounded="${this.common || this.rounded}"
|
|
3358
|
+
?inset="${this.common || this.inset}">
|
|
3359
|
+
</${this.dropdownBibTag}>
|
|
3360
|
+
</div>
|
|
3361
|
+
`;
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
AuroDropdown.register();
|