@haiilo/catalyst 0.5.1 → 0.5.3
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/package.json +5 -6
- package/dist/catalyst/app-globals-23d8c4a8.js +0 -948
- package/dist/catalyst/app-globals-23d8c4a8.js.map +0 -1
- package/dist/catalyst/app-globals-3dd6a26b.js +0 -948
- package/dist/catalyst/app-globals-3dd6a26b.js.map +0 -1
- package/dist/catalyst/app-globals-42ce39cc.js +0 -948
- package/dist/catalyst/app-globals-42ce39cc.js.map +0 -1
- package/dist/catalyst/app-globals-5cf43b57.js +0 -949
- package/dist/catalyst/app-globals-5cf43b57.js.map +0 -1
- package/dist/catalyst/app-globals-8598c768.js +0 -948
- package/dist/catalyst/app-globals-8598c768.js.map +0 -1
- package/dist/catalyst/app-globals-a41af143.js +0 -948
- package/dist/catalyst/app-globals-a41af143.js.map +0 -1
- package/dist/catalyst/app-globals-c6a8b994.js +0 -949
- package/dist/catalyst/app-globals-c6a8b994.js.map +0 -1
- package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/catalyst/cat-alert.entry.js +0 -33
- package/dist/catalyst/cat-alert.entry.js.map +0 -1
- package/dist/catalyst/cat-badge.entry.js +0 -44
- package/dist/catalyst/cat-badge.entry.js.map +0 -1
- package/dist/catalyst/cat-button.entry.js +0 -298
- package/dist/catalyst/cat-button.entry.js.map +0 -1
- package/dist/catalyst/cat-card.entry.js +0 -17
- package/dist/catalyst/cat-card.entry.js.map +0 -1
- package/dist/catalyst/cat-checkbox.entry.js +0 -75
- package/dist/catalyst/cat-checkbox.entry.js.map +0 -1
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js +0 -75
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js.map +0 -1
- package/dist/catalyst/cat-i18n-registry-330db605.js +0 -74
- package/dist/catalyst/cat-i18n-registry-330db605.js.map +0 -1
- package/dist/catalyst/cat-i18n-registry-83d20604.js +0 -74
- package/dist/catalyst/cat-i18n-registry-83d20604.js.map +0 -1
- package/dist/catalyst/cat-i18n-registry-dd55821d.js +0 -73
- package/dist/catalyst/cat-i18n-registry-dd55821d.js.map +0 -1
- package/dist/catalyst/cat-i18n-registry-f6560651.js +0 -75
- package/dist/catalyst/cat-i18n-registry-f6560651.js.map +0 -1
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js +0 -59
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js.map +0 -1
- package/dist/catalyst/cat-icon.entry.js +0 -31
- package/dist/catalyst/cat-icon.entry.js.map +0 -1
- package/dist/catalyst/cat-input.entry.js +0 -111
- package/dist/catalyst/cat-input.entry.js.map +0 -1
- package/dist/catalyst/cat-menu.entry.js +0 -850
- package/dist/catalyst/cat-menu.entry.js.map +0 -1
- package/dist/catalyst/cat-radio.entry.js +0 -66
- package/dist/catalyst/cat-radio.entry.js.map +0 -1
- package/dist/catalyst/cat-scrollable.entry.js +0 -4522
- package/dist/catalyst/cat-scrollable.entry.js.map +0 -1
- package/dist/catalyst/cat-skeleton.entry.js +0 -55
- package/dist/catalyst/cat-skeleton.entry.js.map +0 -1
- package/dist/catalyst/cat-spinner.entry.js +0 -23
- package/dist/catalyst/cat-spinner.entry.js.map +0 -1
- package/dist/catalyst/cat-textarea.entry.js +0 -87
- package/dist/catalyst/cat-textarea.entry.js.map +0 -1
- package/dist/catalyst/cat-toggle.entry.js +0 -66
- package/dist/catalyst/cat-toggle.entry.js.map +0 -1
- package/dist/catalyst/cat-tooltip.entry.js +0 -129
- package/dist/catalyst/cat-tooltip.entry.js.map +0 -1
- package/dist/catalyst/catalyst.css +0 -2033
- package/dist/catalyst/catalyst.esm.js +0 -134
- package/dist/catalyst/catalyst.esm.js.map +0 -1
- package/dist/catalyst/css-shim-e6dd2538.js +0 -6
- package/dist/catalyst/css-shim-e6dd2538.js.map +0 -1
- package/dist/catalyst/dom-7fc649b0.js +0 -75
- package/dist/catalyst/dom-7fc649b0.js.map +0 -1
- package/dist/catalyst/first-tabbable-2d9f9e9a.js +0 -2123
- package/dist/catalyst/first-tabbable-2d9f9e9a.js.map +0 -1
- package/dist/catalyst/index-471d4e05.js +0 -3059
- package/dist/catalyst/index-471d4e05.js.map +0 -1
- package/dist/catalyst/index-bbb694f5.js +0 -3059
- package/dist/catalyst/index-bbb694f5.js.map +0 -1
- package/dist/catalyst/index.cdn.js +0 -21
- package/dist/catalyst/index.esm.js +0 -5
- package/dist/catalyst/index.esm.js.map +0 -1
- package/dist/catalyst/loglevel-7f0f71af.js +0 -346
- package/dist/catalyst/loglevel-7f0f71af.js.map +0 -1
- package/dist/catalyst/shadow-css-4d56fa31.js +0 -390
- package/dist/catalyst/shadow-css-4d56fa31.js.map +0 -1
- package/dist/cjs/app-globals-aaefc070.js +0 -950
- package/dist/cjs/app-globals-aaefc070.js.map +0 -1
- package/dist/cjs/cat-alert.cjs.entry.js +0 -37
- package/dist/cjs/cat-alert.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-badge.cjs.entry.js +0 -48
- package/dist/cjs/cat-badge.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-button.cjs.entry.js +0 -302
- package/dist/cjs/cat-button.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-card.cjs.entry.js +0 -21
- package/dist/cjs/cat-card.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-checkbox.cjs.entry.js +0 -79
- package/dist/cjs/cat-checkbox.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-i18n-registry-a1379d1e.js +0 -76
- package/dist/cjs/cat-i18n-registry-a1379d1e.js.map +0 -1
- package/dist/cjs/cat-icon-registry-74247389.js +0 -61
- package/dist/cjs/cat-icon-registry-74247389.js.map +0 -1
- package/dist/cjs/cat-icon.cjs.entry.js +0 -35
- package/dist/cjs/cat-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-input.cjs.entry.js +0 -115
- package/dist/cjs/cat-input.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-menu.cjs.entry.js +0 -854
- package/dist/cjs/cat-menu.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-radio.cjs.entry.js +0 -70
- package/dist/cjs/cat-radio.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-scrollable.cjs.entry.js +0 -4526
- package/dist/cjs/cat-scrollable.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-skeleton.cjs.entry.js +0 -59
- package/dist/cjs/cat-skeleton.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-spinner.cjs.entry.js +0 -27
- package/dist/cjs/cat-spinner.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-textarea.cjs.entry.js +0 -91
- package/dist/cjs/cat-textarea.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-toggle.cjs.entry.js +0 -70
- package/dist/cjs/cat-toggle.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-tooltip.cjs.entry.js +0 -133
- package/dist/cjs/cat-tooltip.cjs.entry.js.map +0 -1
- package/dist/cjs/catalyst.cjs.js +0 -136
- package/dist/cjs/catalyst.cjs.js.map +0 -1
- package/dist/cjs/css-shim-6ca600c2.js +0 -8
- package/dist/cjs/css-shim-6ca600c2.js.map +0 -1
- package/dist/cjs/dom-8d415461.js +0 -77
- package/dist/cjs/dom-8d415461.js.map +0 -1
- package/dist/cjs/first-tabbable-2068dcc6.js +0 -2133
- package/dist/cjs/first-tabbable-2068dcc6.js.map +0 -1
- package/dist/cjs/index-abcb3941.js +0 -3094
- package/dist/cjs/index-abcb3941.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -14
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -42
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loglevel-24040e9d.js +0 -348
- package/dist/cjs/loglevel-24040e9d.js.map +0 -1
- package/dist/cjs/shadow-css-78860e39.js +0 -392
- package/dist/cjs/shadow-css-78860e39.js.map +0 -1
- package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/collection/collection-manifest.json +0 -27
- package/dist/collection/components/cat-alert/cat-alert.css +0 -62
- package/dist/collection/components/cat-alert/cat-alert.js +0 -61
- package/dist/collection/components/cat-alert/cat-alert.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.css +0 -154
- package/dist/collection/components/cat-badge/cat-badge.js +0 -143
- package/dist/collection/components/cat-badge/cat-badge.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.css +0 -333
- package/dist/collection/components/cat-button/cat-button.js +0 -615
- package/dist/collection/components/cat-button/cat-button.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.css +0 -25
- package/dist/collection/components/cat-card/cat-card.js +0 -20
- package/dist/collection/components/cat-card/cat-card.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +0 -105
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +0 -314
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +0 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +0 -70
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +0 -55
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.css +0 -50
- package/dist/collection/components/cat-icon/cat-icon.js +0 -91
- package/dist/collection/components/cat-icon/cat-icon.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.css +0 -131
- package/dist/collection/components/cat-input/cat-input.js +0 -606
- package/dist/collection/components/cat-input/cat-input.js.map +0 -1
- package/dist/collection/components/cat-menu/cat-menu.css +0 -34
- package/dist/collection/components/cat-menu/cat-menu.js +0 -184
- package/dist/collection/components/cat-menu/cat-menu.js.map +0 -1
- package/dist/collection/components/cat-radio/cat-radio.css +0 -84
- package/dist/collection/components/cat-radio/cat-radio.js +0 -283
- package/dist/collection/components/cat-radio/cat-radio.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +0 -69
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +0 -311
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +0 -177
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +0 -131
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.css +0 -63
- package/dist/collection/components/cat-spinner/cat-spinner.js +0 -65
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +0 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +0 -74
- package/dist/collection/components/cat-textarea/cat-textarea.js +0 -393
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.css +0 -93
- package/dist/collection/components/cat-toggle/cat-toggle.js +0 -283
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +0 -41
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +0 -254
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +0 -1
- package/dist/collection/index.cdn.js +0 -21
- package/dist/collection/index.js +0 -3
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/init.js +0 -17
- package/dist/collection/init.js.map +0 -1
- package/dist/collection/utils/breakpoints.js +0 -12
- package/dist/collection/utils/breakpoints.js.map +0 -1
- package/dist/collection/utils/first-tabbable.js +0 -6
- package/dist/collection/utils/first-tabbable.js.map +0 -1
- package/dist/collection/utils/is-touch-screen.js +0 -3
- package/dist/collection/utils/is-touch-screen.js.map +0 -1
- package/dist/collection/utils/media-matcher.js +0 -55
- package/dist/collection/utils/media-matcher.js.map +0 -1
- package/dist/collection/utils/platform.js +0 -50
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/components/cat-alert.d.ts +0 -11
- package/dist/components/cat-alert.js +0 -53
- package/dist/components/cat-alert.js.map +0 -1
- package/dist/components/cat-badge.d.ts +0 -11
- package/dist/components/cat-badge.js +0 -68
- package/dist/components/cat-badge.js.map +0 -1
- package/dist/components/cat-button.d.ts +0 -11
- package/dist/components/cat-button.js +0 -8
- package/dist/components/cat-button.js.map +0 -1
- package/dist/components/cat-button2.js +0 -346
- package/dist/components/cat-button2.js.map +0 -1
- package/dist/components/cat-card.d.ts +0 -11
- package/dist/components/cat-card.js +0 -35
- package/dist/components/cat-card.js.map +0 -1
- package/dist/components/cat-checkbox.d.ts +0 -11
- package/dist/components/cat-checkbox.js +0 -103
- package/dist/components/cat-checkbox.js.map +0 -1
- package/dist/components/cat-i18n-registry.js +0 -74
- package/dist/components/cat-i18n-registry.js.map +0 -1
- package/dist/components/cat-icon-registry.js +0 -59
- package/dist/components/cat-icon-registry.js.map +0 -1
- package/dist/components/cat-icon.d.ts +0 -11
- package/dist/components/cat-icon.js +0 -8
- package/dist/components/cat-icon.js.map +0 -1
- package/dist/components/cat-icon2.js +0 -49
- package/dist/components/cat-icon2.js.map +0 -1
- package/dist/components/cat-input.d.ts +0 -11
- package/dist/components/cat-input.js +0 -172
- package/dist/components/cat-input.js.map +0 -1
- package/dist/components/cat-menu.d.ts +0 -11
- package/dist/components/cat-menu.js +0 -870
- package/dist/components/cat-menu.js.map +0 -1
- package/dist/components/cat-radio.d.ts +0 -11
- package/dist/components/cat-radio.js +0 -93
- package/dist/components/cat-radio.js.map +0 -1
- package/dist/components/cat-scrollable.d.ts +0 -11
- package/dist/components/cat-scrollable.js +0 -4548
- package/dist/components/cat-scrollable.js.map +0 -1
- package/dist/components/cat-skeleton.d.ts +0 -11
- package/dist/components/cat-skeleton.js +0 -78
- package/dist/components/cat-skeleton.js.map +0 -1
- package/dist/components/cat-spinner.d.ts +0 -11
- package/dist/components/cat-spinner.js +0 -8
- package/dist/components/cat-spinner.js.map +0 -1
- package/dist/components/cat-spinner2.js +0 -41
- package/dist/components/cat-spinner2.js.map +0 -1
- package/dist/components/cat-textarea.d.ts +0 -11
- package/dist/components/cat-textarea.js +0 -119
- package/dist/components/cat-textarea.js.map +0 -1
- package/dist/components/cat-toggle.d.ts +0 -11
- package/dist/components/cat-toggle.js +0 -93
- package/dist/components/cat-toggle.js.map +0 -1
- package/dist/components/cat-tooltip.d.ts +0 -11
- package/dist/components/cat-tooltip.js +0 -154
- package/dist/components/cat-tooltip.js.map +0 -1
- package/dist/components/first-tabbable.js +0 -2123
- package/dist/components/first-tabbable.js.map +0 -1
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -951
- package/dist/components/index.js.map +0 -1
- package/dist/components/loglevel.js +0 -346
- package/dist/components/loglevel.js.map +0 -1
- package/dist/esm/app-globals-3dd6a26b.js +0 -948
- package/dist/esm/app-globals-3dd6a26b.js.map +0 -1
- package/dist/esm/cat-alert.entry.js +0 -33
- package/dist/esm/cat-alert.entry.js.map +0 -1
- package/dist/esm/cat-badge.entry.js +0 -44
- package/dist/esm/cat-badge.entry.js.map +0 -1
- package/dist/esm/cat-button.entry.js +0 -298
- package/dist/esm/cat-button.entry.js.map +0 -1
- package/dist/esm/cat-card.entry.js +0 -17
- package/dist/esm/cat-card.entry.js.map +0 -1
- package/dist/esm/cat-checkbox.entry.js +0 -75
- package/dist/esm/cat-checkbox.entry.js.map +0 -1
- package/dist/esm/cat-i18n-registry-83d20604.js +0 -74
- package/dist/esm/cat-i18n-registry-83d20604.js.map +0 -1
- package/dist/esm/cat-icon-registry-2dcfc9fb.js +0 -59
- package/dist/esm/cat-icon-registry-2dcfc9fb.js.map +0 -1
- package/dist/esm/cat-icon.entry.js +0 -31
- package/dist/esm/cat-icon.entry.js.map +0 -1
- package/dist/esm/cat-input.entry.js +0 -111
- package/dist/esm/cat-input.entry.js.map +0 -1
- package/dist/esm/cat-menu.entry.js +0 -850
- package/dist/esm/cat-menu.entry.js.map +0 -1
- package/dist/esm/cat-radio.entry.js +0 -66
- package/dist/esm/cat-radio.entry.js.map +0 -1
- package/dist/esm/cat-scrollable.entry.js +0 -4522
- package/dist/esm/cat-scrollable.entry.js.map +0 -1
- package/dist/esm/cat-skeleton.entry.js +0 -55
- package/dist/esm/cat-skeleton.entry.js.map +0 -1
- package/dist/esm/cat-spinner.entry.js +0 -23
- package/dist/esm/cat-spinner.entry.js.map +0 -1
- package/dist/esm/cat-textarea.entry.js +0 -87
- package/dist/esm/cat-textarea.entry.js.map +0 -1
- package/dist/esm/cat-toggle.entry.js +0 -66
- package/dist/esm/cat-toggle.entry.js.map +0 -1
- package/dist/esm/cat-tooltip.entry.js +0 -129
- package/dist/esm/cat-tooltip.entry.js.map +0 -1
- package/dist/esm/catalyst.js +0 -134
- package/dist/esm/catalyst.js.map +0 -1
- package/dist/esm/css-shim-e6dd2538.js +0 -6
- package/dist/esm/css-shim-e6dd2538.js.map +0 -1
- package/dist/esm/dom-7fc649b0.js +0 -75
- package/dist/esm/dom-7fc649b0.js.map +0 -1
- package/dist/esm/first-tabbable-2d9f9e9a.js +0 -2123
- package/dist/esm/first-tabbable-2d9f9e9a.js.map +0 -1
- package/dist/esm/index-471d4e05.js +0 -3059
- package/dist/esm/index-471d4e05.js.map +0 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -38
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loglevel-7f0f71af.js +0 -346
- package/dist/esm/loglevel-7f0f71af.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/shadow-css-4d56fa31.js +0 -390
- package/dist/esm/shadow-css-4d56fa31.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/types/components/cat-alert/cat-alert.d.ts +0 -14
- package/dist/types/components/cat-alert/cat-alert.e2e.d.ts +0 -1
- package/dist/types/components/cat-alert/cat-alert.spec.d.ts +0 -1
- package/dist/types/components/cat-badge/cat-badge.d.ts +0 -29
- package/dist/types/components/cat-badge/cat-badge.e2e.d.ts +0 -1
- package/dist/types/components/cat-badge/cat-badge.spec.d.ts +0 -1
- package/dist/types/components/cat-button/cat-button.d.ts +0 -134
- package/dist/types/components/cat-button/cat-button.e2e.d.ts +0 -1
- package/dist/types/components/cat-button/cat-button.spec.d.ts +0 -1
- package/dist/types/components/cat-card/cat-card.d.ts +0 -7
- package/dist/types/components/cat-card/cat-card.e2e.d.ts +0 -1
- package/dist/types/components/cat-card/cat-card.spec.d.ts +0 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +0 -69
- package/dist/types/components/cat-checkbox/cat-checkbox.e2e.d.ts +0 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.spec.d.ts +0 -1
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +0 -18
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +0 -15
- package/dist/types/components/cat-icon/cat-icon.d.ts +0 -23
- package/dist/types/components/cat-icon/cat-icon.e2e.d.ts +0 -1
- package/dist/types/components/cat-icon/cat-icon.spec.d.ts +0 -1
- package/dist/types/components/cat-input/cat-input.d.ts +0 -130
- package/dist/types/components/cat-input/cat-input.e2e.d.ts +0 -1
- package/dist/types/components/cat-input/cat-input.spec.d.ts +0 -1
- package/dist/types/components/cat-menu/cat-menu.d.ts +0 -31
- package/dist/types/components/cat-menu/cat-menu.e2e.d.ts +0 -1
- package/dist/types/components/cat-menu/cat-menu.spec.d.ts +0 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +0 -63
- package/dist/types/components/cat-radio/cat-radio.e2e.d.ts +0 -1
- package/dist/types/components/cat-radio/cat-radio.spec.d.ts +0 -1
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +0 -52
- package/dist/types/components/cat-scrollable/cat-scrollable.e2e.d.ts +0 -1
- package/dist/types/components/cat-scrollable/cat-scrollable.spec.d.ts +0 -1
- package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +0 -28
- package/dist/types/components/cat-skeleton/cat-skeleton.e2e.d.ts +0 -1
- package/dist/types/components/cat-skeleton/cat-skeleton.spec.d.ts +0 -1
- package/dist/types/components/cat-spinner/cat-spinner.d.ts +0 -15
- package/dist/types/components/cat-spinner/cat-spinner.e2e.d.ts +0 -1
- package/dist/types/components/cat-spinner/cat-spinner.spec.d.ts +0 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +0 -85
- package/dist/types/components/cat-textarea/cat-textarea.e2e.d.ts +0 -1
- package/dist/types/components/cat-textarea/cat-textarea.spec.d.ts +0 -1
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +0 -64
- package/dist/types/components/cat-toggle/cat-toggle.e2e.d.ts +0 -1
- package/dist/types/components/cat-toggle/cat-toggle.spec.d.ts +0 -1
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +0 -46
- package/dist/types/components/cat-tooltip/cat-tooltip.e2e.d.ts +0 -1
- package/dist/types/components/cat-tooltip/cat-tooltip.spec.d.ts +0 -1
- package/dist/types/components.d.ts +0 -1167
- package/dist/types/index.d.ts +0 -3
- package/dist/types/init.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/breakpoints.d.ts +0 -7
- package/dist/types/utils/first-tabbable.d.ts +0 -4
- package/dist/types/utils/is-touch-screen.d.ts +0 -2
- package/dist/types/utils/media-matcher.d.ts +0 -13
- package/dist/types/utils/media-matcher.spec.d.ts +0 -1
- package/dist/types/utils/platform.d.ts +0 -18
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
|
@@ -1,2133 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function getSide(placement) {
|
|
4
|
-
return placement.split('-')[0];
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function getAlignment(placement) {
|
|
8
|
-
return placement.split('-')[1];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function getMainAxisFromPlacement(placement) {
|
|
12
|
-
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function getLengthFromAxis(axis) {
|
|
16
|
-
return axis === 'y' ? 'height' : 'width';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
20
|
-
let {
|
|
21
|
-
reference,
|
|
22
|
-
floating
|
|
23
|
-
} = _ref;
|
|
24
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
25
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
26
|
-
const mainAxis = getMainAxisFromPlacement(placement);
|
|
27
|
-
const length = getLengthFromAxis(mainAxis);
|
|
28
|
-
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
29
|
-
const side = getSide(placement);
|
|
30
|
-
const isVertical = mainAxis === 'x';
|
|
31
|
-
let coords;
|
|
32
|
-
|
|
33
|
-
switch (side) {
|
|
34
|
-
case 'top':
|
|
35
|
-
coords = {
|
|
36
|
-
x: commonX,
|
|
37
|
-
y: reference.y - floating.height
|
|
38
|
-
};
|
|
39
|
-
break;
|
|
40
|
-
|
|
41
|
-
case 'bottom':
|
|
42
|
-
coords = {
|
|
43
|
-
x: commonX,
|
|
44
|
-
y: reference.y + reference.height
|
|
45
|
-
};
|
|
46
|
-
break;
|
|
47
|
-
|
|
48
|
-
case 'right':
|
|
49
|
-
coords = {
|
|
50
|
-
x: reference.x + reference.width,
|
|
51
|
-
y: commonY
|
|
52
|
-
};
|
|
53
|
-
break;
|
|
54
|
-
|
|
55
|
-
case 'left':
|
|
56
|
-
coords = {
|
|
57
|
-
x: reference.x - floating.width,
|
|
58
|
-
y: commonY
|
|
59
|
-
};
|
|
60
|
-
break;
|
|
61
|
-
|
|
62
|
-
default:
|
|
63
|
-
coords = {
|
|
64
|
-
x: reference.x,
|
|
65
|
-
y: reference.y
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
switch (getAlignment(placement)) {
|
|
70
|
-
case 'start':
|
|
71
|
-
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
72
|
-
break;
|
|
73
|
-
|
|
74
|
-
case 'end':
|
|
75
|
-
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return coords;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Computes the `x` and `y` coordinates that will place the floating element
|
|
84
|
-
* next to a reference element when it is given a certain positioning strategy.
|
|
85
|
-
*
|
|
86
|
-
* This export does not have any `platform` interface logic. You will need to
|
|
87
|
-
* write one for the platform you are using Floating UI with.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
const computePosition$1 = async (reference, floating, config) => {
|
|
91
|
-
const {
|
|
92
|
-
placement = 'bottom',
|
|
93
|
-
strategy = 'absolute',
|
|
94
|
-
middleware = [],
|
|
95
|
-
platform
|
|
96
|
-
} = config;
|
|
97
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
98
|
-
|
|
99
|
-
if ("development" !== "production") {
|
|
100
|
-
if (platform == null) {
|
|
101
|
-
console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (middleware.filter(_ref => {
|
|
105
|
-
let {
|
|
106
|
-
name
|
|
107
|
-
} = _ref;
|
|
108
|
-
return name === 'autoPlacement' || name === 'flip';
|
|
109
|
-
}).length > 1) {
|
|
110
|
-
throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement`', 'middleware detected. This will lead to an infinite loop. Ensure only', 'one of either has been passed to the `middleware` array.'].join(' '));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
let rects = await platform.getElementRects({
|
|
115
|
-
reference,
|
|
116
|
-
floating,
|
|
117
|
-
strategy
|
|
118
|
-
});
|
|
119
|
-
let {
|
|
120
|
-
x,
|
|
121
|
-
y
|
|
122
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
123
|
-
let statefulPlacement = placement;
|
|
124
|
-
let middlewareData = {};
|
|
125
|
-
let _debug_loop_count_ = 0;
|
|
126
|
-
|
|
127
|
-
for (let i = 0; i < middleware.length; i++) {
|
|
128
|
-
if ("development" !== "production") {
|
|
129
|
-
_debug_loop_count_++;
|
|
130
|
-
|
|
131
|
-
if (_debug_loop_count_ > 100) {
|
|
132
|
-
throw new Error(['Floating UI: The middleware lifecycle appears to be', 'running in an infinite loop. This is usually caused by a `reset`', 'continually being returned without a break condition.'].join(' '));
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const {
|
|
137
|
-
name,
|
|
138
|
-
fn
|
|
139
|
-
} = middleware[i];
|
|
140
|
-
const {
|
|
141
|
-
x: nextX,
|
|
142
|
-
y: nextY,
|
|
143
|
-
data,
|
|
144
|
-
reset
|
|
145
|
-
} = await fn({
|
|
146
|
-
x,
|
|
147
|
-
y,
|
|
148
|
-
initialPlacement: placement,
|
|
149
|
-
placement: statefulPlacement,
|
|
150
|
-
strategy,
|
|
151
|
-
middlewareData,
|
|
152
|
-
rects,
|
|
153
|
-
platform,
|
|
154
|
-
elements: {
|
|
155
|
-
reference,
|
|
156
|
-
floating
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
x = nextX != null ? nextX : x;
|
|
160
|
-
y = nextY != null ? nextY : y;
|
|
161
|
-
middlewareData = { ...middlewareData,
|
|
162
|
-
[name]: { ...middlewareData[name],
|
|
163
|
-
...data
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
if (reset) {
|
|
168
|
-
if (typeof reset === 'object') {
|
|
169
|
-
if (reset.placement) {
|
|
170
|
-
statefulPlacement = reset.placement;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (reset.rects) {
|
|
174
|
-
rects = reset.rects === true ? await platform.getElementRects({
|
|
175
|
-
reference,
|
|
176
|
-
floating,
|
|
177
|
-
strategy
|
|
178
|
-
}) : reset.rects;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
({
|
|
182
|
-
x,
|
|
183
|
-
y
|
|
184
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
i = -1;
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return {
|
|
193
|
-
x,
|
|
194
|
-
y,
|
|
195
|
-
placement: statefulPlacement,
|
|
196
|
-
strategy,
|
|
197
|
-
middlewareData
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
function expandPaddingObject(padding) {
|
|
202
|
-
return {
|
|
203
|
-
top: 0,
|
|
204
|
-
right: 0,
|
|
205
|
-
bottom: 0,
|
|
206
|
-
left: 0,
|
|
207
|
-
...padding
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function getSideObjectFromPadding(padding) {
|
|
212
|
-
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
213
|
-
top: padding,
|
|
214
|
-
right: padding,
|
|
215
|
-
bottom: padding,
|
|
216
|
-
left: padding
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function rectToClientRect(rect) {
|
|
221
|
-
return { ...rect,
|
|
222
|
-
top: rect.y,
|
|
223
|
-
left: rect.x,
|
|
224
|
-
right: rect.x + rect.width,
|
|
225
|
-
bottom: rect.y + rect.height
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
231
|
-
* element is overflowing a given clipping boundary.
|
|
232
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
233
|
-
* - negative = how many pixels left before it will overflow
|
|
234
|
-
* - 0 = lies flush with the boundary
|
|
235
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
236
|
-
*/
|
|
237
|
-
async function detectOverflow(middlewareArguments, options) {
|
|
238
|
-
var _await$platform$isEle;
|
|
239
|
-
|
|
240
|
-
if (options === void 0) {
|
|
241
|
-
options = {};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
const {
|
|
245
|
-
x,
|
|
246
|
-
y,
|
|
247
|
-
platform,
|
|
248
|
-
rects,
|
|
249
|
-
elements,
|
|
250
|
-
strategy
|
|
251
|
-
} = middlewareArguments;
|
|
252
|
-
const {
|
|
253
|
-
boundary = 'clippingAncestors',
|
|
254
|
-
rootBoundary = 'viewport',
|
|
255
|
-
elementContext = 'floating',
|
|
256
|
-
altBoundary = false,
|
|
257
|
-
padding = 0
|
|
258
|
-
} = options;
|
|
259
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
|
260
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
261
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
262
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
263
|
-
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))),
|
|
264
|
-
boundary,
|
|
265
|
-
rootBoundary,
|
|
266
|
-
strategy
|
|
267
|
-
}));
|
|
268
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
269
|
-
rect: elementContext === 'floating' ? { ...rects.floating,
|
|
270
|
-
x,
|
|
271
|
-
y
|
|
272
|
-
} : rects.reference,
|
|
273
|
-
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
274
|
-
strategy
|
|
275
|
-
}) : rects[elementContext]); // positive = overflowing the clipping rect
|
|
276
|
-
// 0 or negative = within the clipping rect
|
|
277
|
-
|
|
278
|
-
return {
|
|
279
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
280
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
281
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
282
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const min$1 = Math.min;
|
|
287
|
-
const max$1 = Math.max;
|
|
288
|
-
|
|
289
|
-
function within(min$1$1, value, max$1$1) {
|
|
290
|
-
return max$1(min$1$1, min$1(value, max$1$1));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Positions an inner element of the floating element such that it is centered
|
|
295
|
-
* to the reference element.
|
|
296
|
-
* @see https://floating-ui.com/docs/arrow
|
|
297
|
-
*/
|
|
298
|
-
const arrow = options => ({
|
|
299
|
-
name: 'arrow',
|
|
300
|
-
options,
|
|
301
|
-
|
|
302
|
-
async fn(middlewareArguments) {
|
|
303
|
-
// Since `element` is required, we don't Partial<> the type
|
|
304
|
-
const {
|
|
305
|
-
element,
|
|
306
|
-
padding = 0
|
|
307
|
-
} = options != null ? options : {};
|
|
308
|
-
const {
|
|
309
|
-
x,
|
|
310
|
-
y,
|
|
311
|
-
placement,
|
|
312
|
-
rects,
|
|
313
|
-
platform
|
|
314
|
-
} = middlewareArguments;
|
|
315
|
-
|
|
316
|
-
if (element == null) {
|
|
317
|
-
if ("development" !== "production") {
|
|
318
|
-
console.warn('Floating UI: No `element` was passed to the `arrow` middleware.');
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return {};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
|
325
|
-
const coords = {
|
|
326
|
-
x,
|
|
327
|
-
y
|
|
328
|
-
};
|
|
329
|
-
const axis = getMainAxisFromPlacement(placement);
|
|
330
|
-
const length = getLengthFromAxis(axis);
|
|
331
|
-
const arrowDimensions = await platform.getDimensions(element);
|
|
332
|
-
const minProp = axis === 'y' ? 'top' : 'left';
|
|
333
|
-
const maxProp = axis === 'y' ? 'bottom' : 'right';
|
|
334
|
-
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
335
|
-
const startDiff = coords[axis] - rects.reference[axis];
|
|
336
|
-
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
337
|
-
const clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
338
|
-
const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
|
|
339
|
-
// point is outside of the floating element's bounds
|
|
340
|
-
|
|
341
|
-
const min = paddingObject[minProp];
|
|
342
|
-
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
343
|
-
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
344
|
-
const offset = within(min, center, max);
|
|
345
|
-
return {
|
|
346
|
-
data: {
|
|
347
|
-
[axis]: offset,
|
|
348
|
-
centerOffset: center - offset
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
const hash$1 = {
|
|
356
|
-
left: 'right',
|
|
357
|
-
right: 'left',
|
|
358
|
-
bottom: 'top',
|
|
359
|
-
top: 'bottom'
|
|
360
|
-
};
|
|
361
|
-
function getOppositePlacement(placement) {
|
|
362
|
-
return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
366
|
-
if (rtl === void 0) {
|
|
367
|
-
rtl = false;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
const alignment = getAlignment(placement);
|
|
371
|
-
const mainAxis = getMainAxisFromPlacement(placement);
|
|
372
|
-
const length = getLengthFromAxis(mainAxis);
|
|
373
|
-
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
374
|
-
|
|
375
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
376
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return {
|
|
380
|
-
main: mainAlignmentSide,
|
|
381
|
-
cross: getOppositePlacement(mainAlignmentSide)
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
const hash = {
|
|
386
|
-
start: 'end',
|
|
387
|
-
end: 'start'
|
|
388
|
-
};
|
|
389
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
390
|
-
return placement.replace(/start|end/g, matched => hash[matched]);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
const sides = ['top', 'right', 'bottom', 'left'];
|
|
394
|
-
const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
|
|
395
|
-
|
|
396
|
-
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
397
|
-
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
398
|
-
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
399
|
-
if (alignment) {
|
|
400
|
-
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
return true;
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Automatically chooses the `placement` which has the most space available.
|
|
409
|
-
* @see https://floating-ui.com/docs/autoPlacement
|
|
410
|
-
*/
|
|
411
|
-
const autoPlacement = function (options) {
|
|
412
|
-
if (options === void 0) {
|
|
413
|
-
options = {};
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return {
|
|
417
|
-
name: 'autoPlacement',
|
|
418
|
-
options,
|
|
419
|
-
|
|
420
|
-
async fn(middlewareArguments) {
|
|
421
|
-
var _middlewareData$autoP, _middlewareData$autoP2, _middlewareData$autoP3, _middlewareData$autoP4, _placementsSortedByLe;
|
|
422
|
-
|
|
423
|
-
const {
|
|
424
|
-
x,
|
|
425
|
-
y,
|
|
426
|
-
rects,
|
|
427
|
-
middlewareData,
|
|
428
|
-
placement,
|
|
429
|
-
platform,
|
|
430
|
-
elements
|
|
431
|
-
} = middlewareArguments;
|
|
432
|
-
const {
|
|
433
|
-
alignment = null,
|
|
434
|
-
allowedPlacements = allPlacements,
|
|
435
|
-
autoAlignment = true,
|
|
436
|
-
...detectOverflowOptions
|
|
437
|
-
} = options;
|
|
438
|
-
const placements = getPlacementList(alignment, autoAlignment, allowedPlacements);
|
|
439
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
440
|
-
const currentIndex = (_middlewareData$autoP = (_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.index) != null ? _middlewareData$autoP : 0;
|
|
441
|
-
const currentPlacement = placements[currentIndex];
|
|
442
|
-
|
|
443
|
-
if (currentPlacement == null) {
|
|
444
|
-
return {};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
const {
|
|
448
|
-
main,
|
|
449
|
-
cross
|
|
450
|
-
} = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place
|
|
451
|
-
|
|
452
|
-
if (placement !== currentPlacement) {
|
|
453
|
-
return {
|
|
454
|
-
x,
|
|
455
|
-
y,
|
|
456
|
-
reset: {
|
|
457
|
-
placement: placements[0]
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];
|
|
463
|
-
const allOverflows = [...((_middlewareData$autoP3 = (_middlewareData$autoP4 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP4.overflows) != null ? _middlewareData$autoP3 : []), {
|
|
464
|
-
placement: currentPlacement,
|
|
465
|
-
overflows: currentOverflows
|
|
466
|
-
}];
|
|
467
|
-
const nextPlacement = placements[currentIndex + 1]; // There are more placements to check
|
|
468
|
-
|
|
469
|
-
if (nextPlacement) {
|
|
470
|
-
return {
|
|
471
|
-
data: {
|
|
472
|
-
index: currentIndex + 1,
|
|
473
|
-
overflows: allOverflows
|
|
474
|
-
},
|
|
475
|
-
reset: {
|
|
476
|
-
placement: nextPlacement
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);
|
|
482
|
-
const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {
|
|
483
|
-
let {
|
|
484
|
-
overflows
|
|
485
|
-
} = _ref;
|
|
486
|
-
return overflows.every(overflow => overflow <= 0);
|
|
487
|
-
})) == null ? void 0 : _placementsSortedByLe.placement;
|
|
488
|
-
const resetPlacement = placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement;
|
|
489
|
-
|
|
490
|
-
if (resetPlacement !== placement) {
|
|
491
|
-
return {
|
|
492
|
-
data: {
|
|
493
|
-
index: currentIndex + 1,
|
|
494
|
-
overflows: allOverflows
|
|
495
|
-
},
|
|
496
|
-
reset: {
|
|
497
|
-
placement: resetPlacement
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
return {};
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
};
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
function getExpandedPlacements(placement) {
|
|
509
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
510
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Changes the placement of the floating element to one that will fit if the
|
|
515
|
-
* initially specified `placement` does not.
|
|
516
|
-
* @see https://floating-ui.com/docs/flip
|
|
517
|
-
*/
|
|
518
|
-
const flip = function (options) {
|
|
519
|
-
if (options === void 0) {
|
|
520
|
-
options = {};
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
return {
|
|
524
|
-
name: 'flip',
|
|
525
|
-
options,
|
|
526
|
-
|
|
527
|
-
async fn(middlewareArguments) {
|
|
528
|
-
var _middlewareData$flip;
|
|
529
|
-
|
|
530
|
-
const {
|
|
531
|
-
placement,
|
|
532
|
-
middlewareData,
|
|
533
|
-
rects,
|
|
534
|
-
initialPlacement,
|
|
535
|
-
platform,
|
|
536
|
-
elements
|
|
537
|
-
} = middlewareArguments;
|
|
538
|
-
const {
|
|
539
|
-
mainAxis: checkMainAxis = true,
|
|
540
|
-
crossAxis: checkCrossAxis = true,
|
|
541
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
542
|
-
fallbackStrategy = 'bestFit',
|
|
543
|
-
flipAlignment = true,
|
|
544
|
-
...detectOverflowOptions
|
|
545
|
-
} = options;
|
|
546
|
-
const side = getSide(placement);
|
|
547
|
-
const isBasePlacement = side === initialPlacement;
|
|
548
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
549
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
550
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
551
|
-
const overflows = [];
|
|
552
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
553
|
-
|
|
554
|
-
if (checkMainAxis) {
|
|
555
|
-
overflows.push(overflow[side]);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
if (checkCrossAxis) {
|
|
559
|
-
const {
|
|
560
|
-
main,
|
|
561
|
-
cross
|
|
562
|
-
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
563
|
-
overflows.push(overflow[main], overflow[cross]);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
overflowsData = [...overflowsData, {
|
|
567
|
-
placement,
|
|
568
|
-
overflows
|
|
569
|
-
}]; // One or more sides is overflowing
|
|
570
|
-
|
|
571
|
-
if (!overflows.every(side => side <= 0)) {
|
|
572
|
-
var _middlewareData$flip$, _middlewareData$flip2;
|
|
573
|
-
|
|
574
|
-
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
|
|
575
|
-
const nextPlacement = placements[nextIndex];
|
|
576
|
-
|
|
577
|
-
if (nextPlacement) {
|
|
578
|
-
// Try next placement and re-run the lifecycle
|
|
579
|
-
return {
|
|
580
|
-
data: {
|
|
581
|
-
index: nextIndex,
|
|
582
|
-
overflows: overflowsData
|
|
583
|
-
},
|
|
584
|
-
reset: {
|
|
585
|
-
placement: nextPlacement
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
let resetPlacement = 'bottom';
|
|
591
|
-
|
|
592
|
-
switch (fallbackStrategy) {
|
|
593
|
-
case 'bestFit':
|
|
594
|
-
{
|
|
595
|
-
var _overflowsData$slice$;
|
|
596
|
-
|
|
597
|
-
const placement = (_overflowsData$slice$ = overflowsData.slice().sort((a, b) => a.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0) - b.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0))[0]) == null ? void 0 : _overflowsData$slice$.placement;
|
|
598
|
-
|
|
599
|
-
if (placement) {
|
|
600
|
-
resetPlacement = placement;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
break;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
case 'initialPlacement':
|
|
607
|
-
resetPlacement = initialPlacement;
|
|
608
|
-
break;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
if (placement !== resetPlacement) {
|
|
612
|
-
return {
|
|
613
|
-
reset: {
|
|
614
|
-
placement: resetPlacement
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
return {};
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
};
|
|
624
|
-
};
|
|
625
|
-
|
|
626
|
-
function getSideOffsets(overflow, rect) {
|
|
627
|
-
return {
|
|
628
|
-
top: overflow.top - rect.height,
|
|
629
|
-
right: overflow.right - rect.width,
|
|
630
|
-
bottom: overflow.bottom - rect.height,
|
|
631
|
-
left: overflow.left - rect.width
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
function isAnySideFullyClipped(overflow) {
|
|
636
|
-
return sides.some(side => overflow[side] >= 0);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Provides data to hide the floating element in applicable situations, such as
|
|
641
|
-
* when it is not in the same clipping context as the reference element.
|
|
642
|
-
* @see https://floating-ui.com/docs/hide
|
|
643
|
-
*/
|
|
644
|
-
const hide = function (_temp) {
|
|
645
|
-
let {
|
|
646
|
-
strategy = 'referenceHidden',
|
|
647
|
-
...detectOverflowOptions
|
|
648
|
-
} = _temp === void 0 ? {} : _temp;
|
|
649
|
-
return {
|
|
650
|
-
name: 'hide',
|
|
651
|
-
|
|
652
|
-
async fn(middlewareArguments) {
|
|
653
|
-
const {
|
|
654
|
-
rects
|
|
655
|
-
} = middlewareArguments;
|
|
656
|
-
|
|
657
|
-
switch (strategy) {
|
|
658
|
-
case 'referenceHidden':
|
|
659
|
-
{
|
|
660
|
-
const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
|
|
661
|
-
elementContext: 'reference'
|
|
662
|
-
});
|
|
663
|
-
const offsets = getSideOffsets(overflow, rects.reference);
|
|
664
|
-
return {
|
|
665
|
-
data: {
|
|
666
|
-
referenceHiddenOffsets: offsets,
|
|
667
|
-
referenceHidden: isAnySideFullyClipped(offsets)
|
|
668
|
-
}
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
case 'escaped':
|
|
673
|
-
{
|
|
674
|
-
const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
|
|
675
|
-
altBoundary: true
|
|
676
|
-
});
|
|
677
|
-
const offsets = getSideOffsets(overflow, rects.floating);
|
|
678
|
-
return {
|
|
679
|
-
data: {
|
|
680
|
-
escapedOffsets: offsets,
|
|
681
|
-
escaped: isAnySideFullyClipped(offsets)
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
default:
|
|
687
|
-
{
|
|
688
|
-
return {};
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
};
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
function convertValueToCoords(placement, rects, value, rtl) {
|
|
697
|
-
if (rtl === void 0) {
|
|
698
|
-
rtl = false;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
const side = getSide(placement);
|
|
702
|
-
const alignment = getAlignment(placement);
|
|
703
|
-
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
704
|
-
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
705
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
706
|
-
const rawValue = typeof value === 'function' ? value({ ...rects,
|
|
707
|
-
placement
|
|
708
|
-
}) : value;
|
|
709
|
-
const isNumber = typeof rawValue === 'number'; // eslint-disable-next-line prefer-const
|
|
710
|
-
|
|
711
|
-
let {
|
|
712
|
-
mainAxis,
|
|
713
|
-
crossAxis,
|
|
714
|
-
alignmentAxis
|
|
715
|
-
} = isNumber ? {
|
|
716
|
-
mainAxis: rawValue,
|
|
717
|
-
crossAxis: 0,
|
|
718
|
-
alignmentAxis: null
|
|
719
|
-
} : {
|
|
720
|
-
mainAxis: 0,
|
|
721
|
-
crossAxis: 0,
|
|
722
|
-
alignmentAxis: null,
|
|
723
|
-
...rawValue
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
if (alignment && typeof alignmentAxis === 'number') {
|
|
727
|
-
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
return isVertical ? {
|
|
731
|
-
x: crossAxis * crossAxisMulti,
|
|
732
|
-
y: mainAxis * mainAxisMulti
|
|
733
|
-
} : {
|
|
734
|
-
x: mainAxis * mainAxisMulti,
|
|
735
|
-
y: crossAxis * crossAxisMulti
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* Displaces the floating element from its reference element.
|
|
740
|
-
* @see https://floating-ui.com/docs/offset
|
|
741
|
-
*/
|
|
742
|
-
|
|
743
|
-
const offset = function (value) {
|
|
744
|
-
if (value === void 0) {
|
|
745
|
-
value = 0;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return {
|
|
749
|
-
name: 'offset',
|
|
750
|
-
options: value,
|
|
751
|
-
|
|
752
|
-
async fn(middlewareArguments) {
|
|
753
|
-
const {
|
|
754
|
-
x,
|
|
755
|
-
y,
|
|
756
|
-
placement,
|
|
757
|
-
rects,
|
|
758
|
-
platform,
|
|
759
|
-
elements
|
|
760
|
-
} = middlewareArguments;
|
|
761
|
-
const diffCoords = convertValueToCoords(placement, rects, value, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
762
|
-
return {
|
|
763
|
-
x: x + diffCoords.x,
|
|
764
|
-
y: y + diffCoords.y,
|
|
765
|
-
data: diffCoords
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
};
|
|
770
|
-
};
|
|
771
|
-
|
|
772
|
-
function getCrossAxis(axis) {
|
|
773
|
-
return axis === 'x' ? 'y' : 'x';
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* Shifts the floating element in order to keep it in view when it will overflow
|
|
778
|
-
* a clipping boundary.
|
|
779
|
-
* @see https://floating-ui.com/docs/shift
|
|
780
|
-
*/
|
|
781
|
-
const shift = function (options) {
|
|
782
|
-
if (options === void 0) {
|
|
783
|
-
options = {};
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
return {
|
|
787
|
-
name: 'shift',
|
|
788
|
-
options,
|
|
789
|
-
|
|
790
|
-
async fn(middlewareArguments) {
|
|
791
|
-
const {
|
|
792
|
-
x,
|
|
793
|
-
y,
|
|
794
|
-
placement
|
|
795
|
-
} = middlewareArguments;
|
|
796
|
-
const {
|
|
797
|
-
mainAxis: checkMainAxis = true,
|
|
798
|
-
crossAxis: checkCrossAxis = false,
|
|
799
|
-
limiter = {
|
|
800
|
-
fn: _ref => {
|
|
801
|
-
let {
|
|
802
|
-
x,
|
|
803
|
-
y
|
|
804
|
-
} = _ref;
|
|
805
|
-
return {
|
|
806
|
-
x,
|
|
807
|
-
y
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
},
|
|
811
|
-
...detectOverflowOptions
|
|
812
|
-
} = options;
|
|
813
|
-
const coords = {
|
|
814
|
-
x,
|
|
815
|
-
y
|
|
816
|
-
};
|
|
817
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
818
|
-
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
819
|
-
const crossAxis = getCrossAxis(mainAxis);
|
|
820
|
-
let mainAxisCoord = coords[mainAxis];
|
|
821
|
-
let crossAxisCoord = coords[crossAxis];
|
|
822
|
-
|
|
823
|
-
if (checkMainAxis) {
|
|
824
|
-
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
825
|
-
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
826
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
827
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
828
|
-
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
if (checkCrossAxis) {
|
|
832
|
-
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
833
|
-
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
834
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
835
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
836
|
-
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
const limitedCoords = limiter.fn({ ...middlewareArguments,
|
|
840
|
-
[mainAxis]: mainAxisCoord,
|
|
841
|
-
[crossAxis]: crossAxisCoord
|
|
842
|
-
});
|
|
843
|
-
return { ...limitedCoords,
|
|
844
|
-
data: {
|
|
845
|
-
x: limitedCoords.x - x,
|
|
846
|
-
y: limitedCoords.y - y
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
};
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
856
|
-
*/
|
|
857
|
-
const limitShift = function (options) {
|
|
858
|
-
if (options === void 0) {
|
|
859
|
-
options = {};
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
return {
|
|
863
|
-
options,
|
|
864
|
-
|
|
865
|
-
fn(middlewareArguments) {
|
|
866
|
-
const {
|
|
867
|
-
x,
|
|
868
|
-
y,
|
|
869
|
-
placement,
|
|
870
|
-
rects,
|
|
871
|
-
middlewareData
|
|
872
|
-
} = middlewareArguments;
|
|
873
|
-
const {
|
|
874
|
-
offset = 0,
|
|
875
|
-
mainAxis: checkMainAxis = true,
|
|
876
|
-
crossAxis: checkCrossAxis = true
|
|
877
|
-
} = options;
|
|
878
|
-
const coords = {
|
|
879
|
-
x,
|
|
880
|
-
y
|
|
881
|
-
};
|
|
882
|
-
const mainAxis = getMainAxisFromPlacement(placement);
|
|
883
|
-
const crossAxis = getCrossAxis(mainAxis);
|
|
884
|
-
let mainAxisCoord = coords[mainAxis];
|
|
885
|
-
let crossAxisCoord = coords[crossAxis];
|
|
886
|
-
const rawOffset = typeof offset === 'function' ? offset({ ...rects,
|
|
887
|
-
placement
|
|
888
|
-
}) : offset;
|
|
889
|
-
const computedOffset = typeof rawOffset === 'number' ? {
|
|
890
|
-
mainAxis: rawOffset,
|
|
891
|
-
crossAxis: 0
|
|
892
|
-
} : {
|
|
893
|
-
mainAxis: 0,
|
|
894
|
-
crossAxis: 0,
|
|
895
|
-
...rawOffset
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
if (checkMainAxis) {
|
|
899
|
-
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
900
|
-
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
901
|
-
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
902
|
-
|
|
903
|
-
if (mainAxisCoord < limitMin) {
|
|
904
|
-
mainAxisCoord = limitMin;
|
|
905
|
-
} else if (mainAxisCoord > limitMax) {
|
|
906
|
-
mainAxisCoord = limitMax;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
if (checkCrossAxis) {
|
|
911
|
-
var _middlewareData$offse, _middlewareData$offse2, _middlewareData$offse3, _middlewareData$offse4;
|
|
912
|
-
|
|
913
|
-
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
914
|
-
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
915
|
-
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? (_middlewareData$offse = (_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) != null ? _middlewareData$offse : 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
916
|
-
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : (_middlewareData$offse3 = (_middlewareData$offse4 = middlewareData.offset) == null ? void 0 : _middlewareData$offse4[crossAxis]) != null ? _middlewareData$offse3 : 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
917
|
-
|
|
918
|
-
if (crossAxisCoord < limitMin) {
|
|
919
|
-
crossAxisCoord = limitMin;
|
|
920
|
-
} else if (crossAxisCoord > limitMax) {
|
|
921
|
-
crossAxisCoord = limitMax;
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
return {
|
|
926
|
-
[mainAxis]: mainAxisCoord,
|
|
927
|
-
[crossAxis]: crossAxisCoord
|
|
928
|
-
};
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
};
|
|
932
|
-
};
|
|
933
|
-
|
|
934
|
-
/**
|
|
935
|
-
* Provides data to change the size of the floating element. For instance,
|
|
936
|
-
* prevent it from overflowing its clipping boundary or match the width of the
|
|
937
|
-
* reference element.
|
|
938
|
-
* @see https://floating-ui.com/docs/size
|
|
939
|
-
*/
|
|
940
|
-
const size = function (options) {
|
|
941
|
-
if (options === void 0) {
|
|
942
|
-
options = {};
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
return {
|
|
946
|
-
name: 'size',
|
|
947
|
-
options,
|
|
948
|
-
|
|
949
|
-
async fn(middlewareArguments) {
|
|
950
|
-
const {
|
|
951
|
-
placement,
|
|
952
|
-
rects,
|
|
953
|
-
platform,
|
|
954
|
-
elements
|
|
955
|
-
} = middlewareArguments;
|
|
956
|
-
const {
|
|
957
|
-
apply,
|
|
958
|
-
...detectOverflowOptions
|
|
959
|
-
} = options;
|
|
960
|
-
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
961
|
-
const side = getSide(placement);
|
|
962
|
-
const alignment = getAlignment(placement);
|
|
963
|
-
let heightSide;
|
|
964
|
-
let widthSide;
|
|
965
|
-
|
|
966
|
-
if (side === 'top' || side === 'bottom') {
|
|
967
|
-
heightSide = side;
|
|
968
|
-
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
969
|
-
} else {
|
|
970
|
-
widthSide = side;
|
|
971
|
-
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
const xMin = max$1(overflow.left, 0);
|
|
975
|
-
const xMax = max$1(overflow.right, 0);
|
|
976
|
-
const yMin = max$1(overflow.top, 0);
|
|
977
|
-
const yMax = max$1(overflow.bottom, 0);
|
|
978
|
-
const dimensions = {
|
|
979
|
-
height: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom)) : overflow[heightSide]),
|
|
980
|
-
width: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right)) : overflow[widthSide])
|
|
981
|
-
};
|
|
982
|
-
const prevDimensions = await platform.getDimensions(elements.floating);
|
|
983
|
-
apply == null ? void 0 : apply({ ...dimensions,
|
|
984
|
-
...rects
|
|
985
|
-
});
|
|
986
|
-
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
987
|
-
|
|
988
|
-
if (prevDimensions.width !== nextDimensions.width || prevDimensions.height !== nextDimensions.height) {
|
|
989
|
-
return {
|
|
990
|
-
reset: {
|
|
991
|
-
rects: true
|
|
992
|
-
}
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
return {};
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
};
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
/**
|
|
1003
|
-
* Provides improved positioning for inline reference elements that can span
|
|
1004
|
-
* over multiple lines, such as hyperlinks or range selections.
|
|
1005
|
-
* @see https://floating-ui.com/docs/inline
|
|
1006
|
-
*/
|
|
1007
|
-
const inline = function (options) {
|
|
1008
|
-
if (options === void 0) {
|
|
1009
|
-
options = {};
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
return {
|
|
1013
|
-
name: 'inline',
|
|
1014
|
-
options,
|
|
1015
|
-
|
|
1016
|
-
async fn(middlewareArguments) {
|
|
1017
|
-
var _await$platform$getCl;
|
|
1018
|
-
|
|
1019
|
-
const {
|
|
1020
|
-
placement,
|
|
1021
|
-
elements,
|
|
1022
|
-
rects,
|
|
1023
|
-
platform,
|
|
1024
|
-
strategy
|
|
1025
|
-
} = middlewareArguments; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
1026
|
-
// ClientRect's bounds, despite the event listener being triggered. A
|
|
1027
|
-
// padding of 2 seems to handle this issue.
|
|
1028
|
-
|
|
1029
|
-
const {
|
|
1030
|
-
padding = 2,
|
|
1031
|
-
x,
|
|
1032
|
-
y
|
|
1033
|
-
} = options;
|
|
1034
|
-
const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1035
|
-
rect: rects.reference,
|
|
1036
|
-
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
1037
|
-
strategy
|
|
1038
|
-
}) : rects.reference);
|
|
1039
|
-
const clientRects = (_await$platform$getCl = await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) != null ? _await$platform$getCl : [];
|
|
1040
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
|
1041
|
-
|
|
1042
|
-
function getBoundingClientRect() {
|
|
1043
|
-
// There are two rects and they are disjoined
|
|
1044
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
1045
|
-
var _clientRects$find;
|
|
1046
|
-
|
|
1047
|
-
// Find the first rect in which the point is fully inside
|
|
1048
|
-
return (_clientRects$find = clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom)) != null ? _clientRects$find : fallback;
|
|
1049
|
-
} // There are 2 or more connected rects
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
if (clientRects.length >= 2) {
|
|
1053
|
-
if (getMainAxisFromPlacement(placement) === 'x') {
|
|
1054
|
-
const firstRect = clientRects[0];
|
|
1055
|
-
const lastRect = clientRects[clientRects.length - 1];
|
|
1056
|
-
const isTop = getSide(placement) === 'top';
|
|
1057
|
-
const top = firstRect.top;
|
|
1058
|
-
const bottom = lastRect.bottom;
|
|
1059
|
-
const left = isTop ? firstRect.left : lastRect.left;
|
|
1060
|
-
const right = isTop ? firstRect.right : lastRect.right;
|
|
1061
|
-
const width = right - left;
|
|
1062
|
-
const height = bottom - top;
|
|
1063
|
-
return {
|
|
1064
|
-
top,
|
|
1065
|
-
bottom,
|
|
1066
|
-
left,
|
|
1067
|
-
right,
|
|
1068
|
-
width,
|
|
1069
|
-
height,
|
|
1070
|
-
x: left,
|
|
1071
|
-
y: top
|
|
1072
|
-
};
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
const isLeftSide = getSide(placement) === 'left';
|
|
1076
|
-
const maxRight = max$1(...clientRects.map(rect => rect.right));
|
|
1077
|
-
const minLeft = min$1(...clientRects.map(rect => rect.left));
|
|
1078
|
-
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
1079
|
-
const top = measureRects[0].top;
|
|
1080
|
-
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
1081
|
-
const left = minLeft;
|
|
1082
|
-
const right = maxRight;
|
|
1083
|
-
const width = right - left;
|
|
1084
|
-
const height = bottom - top;
|
|
1085
|
-
return {
|
|
1086
|
-
top,
|
|
1087
|
-
bottom,
|
|
1088
|
-
left,
|
|
1089
|
-
right,
|
|
1090
|
-
width,
|
|
1091
|
-
height,
|
|
1092
|
-
x: left,
|
|
1093
|
-
y: top
|
|
1094
|
-
};
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
return fallback;
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
const resetRects = await platform.getElementRects({
|
|
1101
|
-
reference: {
|
|
1102
|
-
getBoundingClientRect
|
|
1103
|
-
},
|
|
1104
|
-
floating: elements.floating,
|
|
1105
|
-
strategy
|
|
1106
|
-
});
|
|
1107
|
-
|
|
1108
|
-
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
1109
|
-
return {
|
|
1110
|
-
reset: {
|
|
1111
|
-
rects: resetRects
|
|
1112
|
-
}
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
return {};
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
};
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
function isWindow(value) {
|
|
1123
|
-
return (value == null ? void 0 : value.toString()) === '[object Window]';
|
|
1124
|
-
}
|
|
1125
|
-
function getWindow(node) {
|
|
1126
|
-
if (node == null) {
|
|
1127
|
-
return window;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
if (!isWindow(node)) {
|
|
1131
|
-
const ownerDocument = node.ownerDocument;
|
|
1132
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
return node;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
function getComputedStyle$1(element) {
|
|
1139
|
-
return getWindow(element).getComputedStyle(element);
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
function getNodeName(node) {
|
|
1143
|
-
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
function isHTMLElement(value) {
|
|
1147
|
-
return value instanceof getWindow(value).HTMLElement;
|
|
1148
|
-
}
|
|
1149
|
-
function isElement(value) {
|
|
1150
|
-
return value instanceof getWindow(value).Element;
|
|
1151
|
-
}
|
|
1152
|
-
function isNode(value) {
|
|
1153
|
-
return value instanceof getWindow(value).Node;
|
|
1154
|
-
}
|
|
1155
|
-
function isShadowRoot(node) {
|
|
1156
|
-
const OwnElement = getWindow(node).ShadowRoot;
|
|
1157
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1158
|
-
}
|
|
1159
|
-
function isOverflowElement(element) {
|
|
1160
|
-
// Firefox wants us to check `-x` and `-y` variations as well
|
|
1161
|
-
const {
|
|
1162
|
-
overflow,
|
|
1163
|
-
overflowX,
|
|
1164
|
-
overflowY
|
|
1165
|
-
} = getComputedStyle$1(element);
|
|
1166
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
1167
|
-
}
|
|
1168
|
-
function isTableElement(element) {
|
|
1169
|
-
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1170
|
-
}
|
|
1171
|
-
function isContainingBlock(element) {
|
|
1172
|
-
// TODO: Try and use feature detection here instead
|
|
1173
|
-
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
|
|
1174
|
-
const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
|
|
1175
|
-
// create a containing block.
|
|
1176
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1177
|
-
|
|
1178
|
-
return css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
|
|
1179
|
-
}
|
|
1180
|
-
function isLayoutViewport() {
|
|
1181
|
-
// Not Safari
|
|
1182
|
-
return !/^((?!chrome|android).)*safari/i.test(navigator.userAgent); // Feature detection for this fails in various ways
|
|
1183
|
-
// • Always-visible scrollbar or not
|
|
1184
|
-
// • Width of <html>, etc.
|
|
1185
|
-
// const vV = win.visualViewport;
|
|
1186
|
-
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
const min = Math.min;
|
|
1190
|
-
const max = Math.max;
|
|
1191
|
-
const round = Math.round;
|
|
1192
|
-
|
|
1193
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1194
|
-
if (includeScale === void 0) {
|
|
1195
|
-
includeScale = false;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
if (isFixedStrategy === void 0) {
|
|
1199
|
-
isFixedStrategy = false;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
const clientRect = element.getBoundingClientRect();
|
|
1203
|
-
let scaleX = 1;
|
|
1204
|
-
let scaleY = 1;
|
|
1205
|
-
|
|
1206
|
-
if (includeScale && isHTMLElement(element)) {
|
|
1207
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
1208
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
const win = isElement(element) ? getWindow(element) : window;
|
|
1212
|
-
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1213
|
-
const x = (clientRect.left + (addVisualOffsets ? win.visualViewport.offsetLeft : 0)) / scaleX;
|
|
1214
|
-
const y = (clientRect.top + (addVisualOffsets ? win.visualViewport.offsetTop : 0)) / scaleY;
|
|
1215
|
-
const width = clientRect.width / scaleX;
|
|
1216
|
-
const height = clientRect.height / scaleY;
|
|
1217
|
-
return {
|
|
1218
|
-
width,
|
|
1219
|
-
height,
|
|
1220
|
-
top: y,
|
|
1221
|
-
right: x + width,
|
|
1222
|
-
bottom: y + height,
|
|
1223
|
-
left: x,
|
|
1224
|
-
x,
|
|
1225
|
-
y
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
function getDocumentElement(node) {
|
|
1230
|
-
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
function getNodeScroll(element) {
|
|
1234
|
-
if (isWindow(element)) {
|
|
1235
|
-
return {
|
|
1236
|
-
scrollLeft: element.pageXOffset,
|
|
1237
|
-
scrollTop: element.pageYOffset
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
return {
|
|
1242
|
-
scrollLeft: element.scrollLeft,
|
|
1243
|
-
scrollTop: element.scrollTop
|
|
1244
|
-
};
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
function getWindowScrollBarX(element) {
|
|
1248
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1249
|
-
// incorrect for RTL.
|
|
1250
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
function isScaled(element) {
|
|
1254
|
-
const rect = getBoundingClientRect(element);
|
|
1255
|
-
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1259
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1260
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1261
|
-
const rect = getBoundingClientRect(element, isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1262
|
-
let scroll = {
|
|
1263
|
-
scrollLeft: 0,
|
|
1264
|
-
scrollTop: 0
|
|
1265
|
-
};
|
|
1266
|
-
const offsets = {
|
|
1267
|
-
x: 0,
|
|
1268
|
-
y: 0
|
|
1269
|
-
};
|
|
1270
|
-
|
|
1271
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1272
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1273
|
-
scroll = getNodeScroll(offsetParent);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
if (isHTMLElement(offsetParent)) {
|
|
1277
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1278
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1279
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1280
|
-
} else if (documentElement) {
|
|
1281
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
return {
|
|
1286
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1287
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1288
|
-
width: rect.width,
|
|
1289
|
-
height: rect.height
|
|
1290
|
-
};
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
function getParentNode(node) {
|
|
1294
|
-
if (getNodeName(node) === 'html') {
|
|
1295
|
-
return node;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
1299
|
-
// @ts-ignore
|
|
1300
|
-
node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
1301
|
-
node.parentNode || ( // DOM Element detected
|
|
1302
|
-
isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
|
|
1303
|
-
getDocumentElement(node) // fallback
|
|
1304
|
-
|
|
1305
|
-
);
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
function getTrueOffsetParent(element) {
|
|
1309
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1310
|
-
return null;
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
return element.offsetParent;
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
function getContainingBlock(element) {
|
|
1317
|
-
let currentNode = getParentNode(element);
|
|
1318
|
-
|
|
1319
|
-
if (isShadowRoot(currentNode)) {
|
|
1320
|
-
currentNode = currentNode.host;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
|
|
1324
|
-
if (isContainingBlock(currentNode)) {
|
|
1325
|
-
return currentNode;
|
|
1326
|
-
} else {
|
|
1327
|
-
currentNode = currentNode.parentNode;
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
return null;
|
|
1332
|
-
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1333
|
-
// such as table ancestors and cross browser bugs.
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
function getOffsetParent(element) {
|
|
1337
|
-
const window = getWindow(element);
|
|
1338
|
-
let offsetParent = getTrueOffsetParent(element);
|
|
1339
|
-
|
|
1340
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1341
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1345
|
-
return window;
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
return offsetParent || getContainingBlock(element) || window;
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
function getDimensions(element) {
|
|
1352
|
-
if (isHTMLElement(element)) {
|
|
1353
|
-
return {
|
|
1354
|
-
width: element.offsetWidth,
|
|
1355
|
-
height: element.offsetHeight
|
|
1356
|
-
};
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
const rect = getBoundingClientRect(element);
|
|
1360
|
-
return {
|
|
1361
|
-
width: rect.width,
|
|
1362
|
-
height: rect.height
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1367
|
-
let {
|
|
1368
|
-
rect,
|
|
1369
|
-
offsetParent,
|
|
1370
|
-
strategy
|
|
1371
|
-
} = _ref;
|
|
1372
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1373
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1374
|
-
|
|
1375
|
-
if (offsetParent === documentElement) {
|
|
1376
|
-
return rect;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
let scroll = {
|
|
1380
|
-
scrollLeft: 0,
|
|
1381
|
-
scrollTop: 0
|
|
1382
|
-
};
|
|
1383
|
-
const offsets = {
|
|
1384
|
-
x: 0,
|
|
1385
|
-
y: 0
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1389
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1390
|
-
scroll = getNodeScroll(offsetParent);
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
if (isHTMLElement(offsetParent)) {
|
|
1394
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1395
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1396
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1397
|
-
} // This doesn't appear to be need to be negated.
|
|
1398
|
-
// else if (documentElement) {
|
|
1399
|
-
// offsets.x = getWindowScrollBarX(documentElement);
|
|
1400
|
-
// }
|
|
1401
|
-
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
return { ...rect,
|
|
1405
|
-
x: rect.x - scroll.scrollLeft + offsets.x,
|
|
1406
|
-
y: rect.y - scroll.scrollTop + offsets.y
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
function getViewportRect(element, strategy) {
|
|
1411
|
-
const win = getWindow(element);
|
|
1412
|
-
const html = getDocumentElement(element);
|
|
1413
|
-
const visualViewport = win.visualViewport;
|
|
1414
|
-
let width = html.clientWidth;
|
|
1415
|
-
let height = html.clientHeight;
|
|
1416
|
-
let x = 0;
|
|
1417
|
-
let y = 0;
|
|
1418
|
-
|
|
1419
|
-
if (visualViewport) {
|
|
1420
|
-
width = visualViewport.width;
|
|
1421
|
-
height = visualViewport.height;
|
|
1422
|
-
const layoutViewport = isLayoutViewport();
|
|
1423
|
-
|
|
1424
|
-
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
1425
|
-
x = visualViewport.offsetLeft;
|
|
1426
|
-
y = visualViewport.offsetTop;
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
return {
|
|
1431
|
-
width,
|
|
1432
|
-
height,
|
|
1433
|
-
x,
|
|
1434
|
-
y
|
|
1435
|
-
};
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
1439
|
-
|
|
1440
|
-
function getDocumentRect(element) {
|
|
1441
|
-
var _element$ownerDocumen;
|
|
1442
|
-
|
|
1443
|
-
const html = getDocumentElement(element);
|
|
1444
|
-
const scroll = getNodeScroll(element);
|
|
1445
|
-
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1446
|
-
const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1447
|
-
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1448
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1449
|
-
const y = -scroll.scrollTop;
|
|
1450
|
-
|
|
1451
|
-
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
|
1452
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
return {
|
|
1456
|
-
width,
|
|
1457
|
-
height,
|
|
1458
|
-
x,
|
|
1459
|
-
y
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
function getNearestOverflowAncestor(node) {
|
|
1464
|
-
const parentNode = getParentNode(node);
|
|
1465
|
-
|
|
1466
|
-
if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
|
|
1467
|
-
// @ts-ignore assume body is always available
|
|
1468
|
-
return node.ownerDocument.body;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1472
|
-
return parentNode;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
return getNearestOverflowAncestor(parentNode);
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
function getOverflowAncestors(node, list) {
|
|
1479
|
-
var _node$ownerDocument;
|
|
1480
|
-
|
|
1481
|
-
if (list === void 0) {
|
|
1482
|
-
list = [];
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1486
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1487
|
-
const win = getWindow(scrollableAncestor);
|
|
1488
|
-
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
1489
|
-
const updatedList = list.concat(target);
|
|
1490
|
-
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
1491
|
-
updatedList.concat(getOverflowAncestors(getParentNode(target)));
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
function contains(parent, child) {
|
|
1495
|
-
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
|
|
1496
|
-
|
|
1497
|
-
if (parent.contains(child)) {
|
|
1498
|
-
return true;
|
|
1499
|
-
} // then fallback to custom implementation with Shadow DOM support
|
|
1500
|
-
else if (rootNode && isShadowRoot(rootNode)) {
|
|
1501
|
-
let next = child;
|
|
1502
|
-
|
|
1503
|
-
do {
|
|
1504
|
-
// use `===` replace node.isSameNode()
|
|
1505
|
-
if (next && parent === next) {
|
|
1506
|
-
return true;
|
|
1507
|
-
} // @ts-ignore: need a better way to handle this...
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
next = next.parentNode || next.host;
|
|
1511
|
-
} while (next);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
return false;
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
1518
|
-
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
1519
|
-
const top = clientRect.top + element.clientTop;
|
|
1520
|
-
const left = clientRect.left + element.clientLeft;
|
|
1521
|
-
return {
|
|
1522
|
-
top,
|
|
1523
|
-
left,
|
|
1524
|
-
x: left,
|
|
1525
|
-
y: top,
|
|
1526
|
-
right: left + element.clientWidth,
|
|
1527
|
-
bottom: top + element.clientHeight,
|
|
1528
|
-
width: element.clientWidth,
|
|
1529
|
-
height: element.clientHeight
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
|
|
1534
|
-
if (clippingParent === 'viewport') {
|
|
1535
|
-
return rectToClientRect(getViewportRect(element, strategy));
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
if (isElement(clippingParent)) {
|
|
1539
|
-
return getInnerBoundingClientRect(clippingParent, strategy);
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1543
|
-
} // A "clipping ancestor" is an overflowable container with the characteristic of
|
|
1544
|
-
// clipping (or hiding) overflowing elements with a position different from
|
|
1545
|
-
// `initial`
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
function getClippingAncestors(element) {
|
|
1549
|
-
const clippingAncestors = getOverflowAncestors(element);
|
|
1550
|
-
const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
|
|
1551
|
-
const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
1552
|
-
|
|
1553
|
-
if (!isElement(clipperElement)) {
|
|
1554
|
-
return [];
|
|
1555
|
-
} // @ts-ignore isElement check ensures we return Array<Element>
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1559
|
-
} // Gets the maximum area that the element is visible in due to any number of
|
|
1560
|
-
// clipping ancestors
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
function getClippingRect(_ref) {
|
|
1564
|
-
let {
|
|
1565
|
-
element,
|
|
1566
|
-
boundary,
|
|
1567
|
-
rootBoundary,
|
|
1568
|
-
strategy
|
|
1569
|
-
} = _ref;
|
|
1570
|
-
const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
|
|
1571
|
-
const clippingAncestors = [...mainClippingAncestors, rootBoundary];
|
|
1572
|
-
const firstClippingAncestor = clippingAncestors[0];
|
|
1573
|
-
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1574
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1575
|
-
accRect.top = max(rect.top, accRect.top);
|
|
1576
|
-
accRect.right = min(rect.right, accRect.right);
|
|
1577
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1578
|
-
accRect.left = max(rect.left, accRect.left);
|
|
1579
|
-
return accRect;
|
|
1580
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1581
|
-
return {
|
|
1582
|
-
width: clippingRect.right - clippingRect.left,
|
|
1583
|
-
height: clippingRect.bottom - clippingRect.top,
|
|
1584
|
-
x: clippingRect.left,
|
|
1585
|
-
y: clippingRect.top
|
|
1586
|
-
};
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
const platform = {
|
|
1590
|
-
getClippingRect,
|
|
1591
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1592
|
-
isElement,
|
|
1593
|
-
getDimensions,
|
|
1594
|
-
getOffsetParent,
|
|
1595
|
-
getDocumentElement,
|
|
1596
|
-
getElementRects: _ref => {
|
|
1597
|
-
let {
|
|
1598
|
-
reference,
|
|
1599
|
-
floating,
|
|
1600
|
-
strategy
|
|
1601
|
-
} = _ref;
|
|
1602
|
-
return {
|
|
1603
|
-
reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
|
|
1604
|
-
floating: { ...getDimensions(floating),
|
|
1605
|
-
x: 0,
|
|
1606
|
-
y: 0
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
|
-
},
|
|
1610
|
-
getClientRects: element => Array.from(element.getClientRects()),
|
|
1611
|
-
isRTL: element => getComputedStyle$1(element).direction === 'rtl'
|
|
1612
|
-
};
|
|
1613
|
-
|
|
1614
|
-
/**
|
|
1615
|
-
* Automatically updates the position of the floating element when necessary.
|
|
1616
|
-
* @see https://floating-ui.com/docs/autoUpdate
|
|
1617
|
-
*/
|
|
1618
|
-
function autoUpdate(reference, floating, update, options) {
|
|
1619
|
-
if (options === void 0) {
|
|
1620
|
-
options = {};
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
const {
|
|
1624
|
-
ancestorScroll: _ancestorScroll = true,
|
|
1625
|
-
ancestorResize: _ancestorResize = true,
|
|
1626
|
-
elementResize: _elementResize = true,
|
|
1627
|
-
animationFrame = false
|
|
1628
|
-
} = options;
|
|
1629
|
-
let cleanedUp = false;
|
|
1630
|
-
const ancestorScroll = _ancestorScroll && !animationFrame;
|
|
1631
|
-
const ancestorResize = _ancestorResize && !animationFrame;
|
|
1632
|
-
const elementResize = _elementResize && !animationFrame;
|
|
1633
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
|
|
1634
|
-
ancestors.forEach(ancestor => {
|
|
1635
|
-
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1636
|
-
passive: true
|
|
1637
|
-
});
|
|
1638
|
-
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1639
|
-
});
|
|
1640
|
-
let observer = null;
|
|
1641
|
-
|
|
1642
|
-
if (elementResize) {
|
|
1643
|
-
observer = new ResizeObserver(update);
|
|
1644
|
-
isElement(reference) && observer.observe(reference);
|
|
1645
|
-
observer.observe(floating);
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
let frameId;
|
|
1649
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1650
|
-
|
|
1651
|
-
if (animationFrame) {
|
|
1652
|
-
frameLoop();
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
function frameLoop() {
|
|
1656
|
-
if (cleanedUp) {
|
|
1657
|
-
return;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
1661
|
-
|
|
1662
|
-
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1663
|
-
update();
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
prevRefRect = nextRefRect;
|
|
1667
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
return () => {
|
|
1671
|
-
var _observer;
|
|
1672
|
-
|
|
1673
|
-
cleanedUp = true;
|
|
1674
|
-
ancestors.forEach(ancestor => {
|
|
1675
|
-
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1676
|
-
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1677
|
-
});
|
|
1678
|
-
(_observer = observer) == null ? void 0 : _observer.disconnect();
|
|
1679
|
-
observer = null;
|
|
1680
|
-
|
|
1681
|
-
if (animationFrame) {
|
|
1682
|
-
cancelAnimationFrame(frameId);
|
|
1683
|
-
}
|
|
1684
|
-
};
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
/**
|
|
1688
|
-
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1689
|
-
* next to a reference element when it is given a certain CSS positioning
|
|
1690
|
-
* strategy.
|
|
1691
|
-
*/
|
|
1692
|
-
|
|
1693
|
-
const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
|
|
1694
|
-
platform,
|
|
1695
|
-
...options
|
|
1696
|
-
});
|
|
1697
|
-
|
|
1698
|
-
/*!
|
|
1699
|
-
* tabbable 5.3.1
|
|
1700
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1701
|
-
*/
|
|
1702
|
-
var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
|
|
1703
|
-
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
|
|
1704
|
-
var NoElement = typeof Element === 'undefined';
|
|
1705
|
-
var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
1706
|
-
var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
|
|
1707
|
-
return element.getRootNode();
|
|
1708
|
-
} : function (element) {
|
|
1709
|
-
return element.ownerDocument;
|
|
1710
|
-
};
|
|
1711
|
-
/**
|
|
1712
|
-
* @param {Element} el container to check in
|
|
1713
|
-
* @param {boolean} includeContainer add container to check
|
|
1714
|
-
* @param {(node: Element) => boolean} filter filter candidates
|
|
1715
|
-
* @returns {Element[]}
|
|
1716
|
-
*/
|
|
1717
|
-
|
|
1718
|
-
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
1719
|
-
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
1720
|
-
|
|
1721
|
-
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
1722
|
-
candidates.unshift(el);
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
candidates = candidates.filter(filter);
|
|
1726
|
-
return candidates;
|
|
1727
|
-
};
|
|
1728
|
-
/**
|
|
1729
|
-
* @callback GetShadowRoot
|
|
1730
|
-
* @param {Element} element to check for shadow root
|
|
1731
|
-
* @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
|
|
1732
|
-
*/
|
|
1733
|
-
|
|
1734
|
-
/**
|
|
1735
|
-
* @typedef {Object} CandidatesScope
|
|
1736
|
-
* @property {Element} scope contains inner candidates
|
|
1737
|
-
* @property {Element[]} candidates
|
|
1738
|
-
*/
|
|
1739
|
-
|
|
1740
|
-
/**
|
|
1741
|
-
* @typedef {Object} IterativeOptions
|
|
1742
|
-
* @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
|
|
1743
|
-
* if a function, implies shadow support is enabled and either returns the shadow root of an element
|
|
1744
|
-
* or a boolean stating if it has an undisclosed shadow root
|
|
1745
|
-
* @property {(node: Element) => boolean} filter filter candidates
|
|
1746
|
-
* @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list
|
|
1747
|
-
*/
|
|
1748
|
-
|
|
1749
|
-
/**
|
|
1750
|
-
* @param {Element[]} elements list of element containers to match candidates from
|
|
1751
|
-
* @param {boolean} includeContainer add container list to check
|
|
1752
|
-
* @param {IterativeOptions} options
|
|
1753
|
-
* @returns {Array.<Element|CandidatesScope>}
|
|
1754
|
-
*/
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
1758
|
-
var candidates = [];
|
|
1759
|
-
var elementsToCheck = Array.from(elements);
|
|
1760
|
-
|
|
1761
|
-
while (elementsToCheck.length) {
|
|
1762
|
-
var element = elementsToCheck.shift();
|
|
1763
|
-
|
|
1764
|
-
if (element.tagName === 'SLOT') {
|
|
1765
|
-
// add shadow dom slot scope (slot itself cannot be focusable)
|
|
1766
|
-
var assigned = element.assignedElements();
|
|
1767
|
-
var content = assigned.length ? assigned : element.children;
|
|
1768
|
-
var nestedCandidates = getCandidatesIteratively(content, true, options);
|
|
1769
|
-
|
|
1770
|
-
if (options.flatten) {
|
|
1771
|
-
candidates.push.apply(candidates, nestedCandidates);
|
|
1772
|
-
} else {
|
|
1773
|
-
candidates.push({
|
|
1774
|
-
scope: element,
|
|
1775
|
-
candidates: nestedCandidates
|
|
1776
|
-
});
|
|
1777
|
-
}
|
|
1778
|
-
} else {
|
|
1779
|
-
// check candidate element
|
|
1780
|
-
var validCandidate = matches.call(element, candidateSelector);
|
|
1781
|
-
|
|
1782
|
-
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
1783
|
-
candidates.push(element);
|
|
1784
|
-
} // iterate over shadow content if possible
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
|
|
1788
|
-
typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
|
|
1789
|
-
|
|
1790
|
-
if (shadowRoot) {
|
|
1791
|
-
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
|
|
1792
|
-
// shadow exists, so look at light dom children as fallback BUT create a scope for any
|
|
1793
|
-
// child candidates found because they're likely slotted elements (elements that are
|
|
1794
|
-
// children of the web component element (which has the shadow), in the light dom, but
|
|
1795
|
-
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
|
|
1796
|
-
// _after_ we return from this recursive call
|
|
1797
|
-
var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
1798
|
-
|
|
1799
|
-
if (options.flatten) {
|
|
1800
|
-
candidates.push.apply(candidates, _nestedCandidates);
|
|
1801
|
-
} else {
|
|
1802
|
-
candidates.push({
|
|
1803
|
-
scope: element,
|
|
1804
|
-
candidates: _nestedCandidates
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
} else {
|
|
1808
|
-
// there's not shadow so just dig into the element's (light dom) children
|
|
1809
|
-
// __without__ giving the element special scope treatment
|
|
1810
|
-
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
return candidates;
|
|
1816
|
-
};
|
|
1817
|
-
|
|
1818
|
-
var getTabindex = function getTabindex(node, isScope) {
|
|
1819
|
-
if (node.tabIndex < 0) {
|
|
1820
|
-
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
1821
|
-
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
1822
|
-
// yet they are still part of the regular tab order; in FF, they get a default
|
|
1823
|
-
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
1824
|
-
// order, consider their tab index to be 0.
|
|
1825
|
-
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
1826
|
-
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
1827
|
-
//
|
|
1828
|
-
// isScope is positive for custom element with shadow root or slot that by default
|
|
1829
|
-
// have tabIndex -1, but need to be sorted by document order in order for their
|
|
1830
|
-
// content to be inserted in the correct position
|
|
1831
|
-
if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
|
|
1832
|
-
return 0;
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
return node.tabIndex;
|
|
1837
|
-
};
|
|
1838
|
-
|
|
1839
|
-
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
1840
|
-
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
1841
|
-
};
|
|
1842
|
-
|
|
1843
|
-
var isInput = function isInput(node) {
|
|
1844
|
-
return node.tagName === 'INPUT';
|
|
1845
|
-
};
|
|
1846
|
-
|
|
1847
|
-
var isHiddenInput = function isHiddenInput(node) {
|
|
1848
|
-
return isInput(node) && node.type === 'hidden';
|
|
1849
|
-
};
|
|
1850
|
-
|
|
1851
|
-
var isDetailsWithSummary = function isDetailsWithSummary(node) {
|
|
1852
|
-
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
|
|
1853
|
-
return child.tagName === 'SUMMARY';
|
|
1854
|
-
});
|
|
1855
|
-
return r;
|
|
1856
|
-
};
|
|
1857
|
-
|
|
1858
|
-
var getCheckedRadio = function getCheckedRadio(nodes, form) {
|
|
1859
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
1860
|
-
if (nodes[i].checked && nodes[i].form === form) {
|
|
1861
|
-
return nodes[i];
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
};
|
|
1865
|
-
|
|
1866
|
-
var isTabbableRadio = function isTabbableRadio(node) {
|
|
1867
|
-
if (!node.name) {
|
|
1868
|
-
return true;
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
var radioScope = node.form || getRootNode(node);
|
|
1872
|
-
|
|
1873
|
-
var queryRadios = function queryRadios(name) {
|
|
1874
|
-
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
|
-
var radioSet;
|
|
1878
|
-
|
|
1879
|
-
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
|
|
1880
|
-
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
1881
|
-
} else {
|
|
1882
|
-
try {
|
|
1883
|
-
radioSet = queryRadios(node.name);
|
|
1884
|
-
} catch (err) {
|
|
1885
|
-
// eslint-disable-next-line no-console
|
|
1886
|
-
console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
|
|
1887
|
-
return false;
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
var checked = getCheckedRadio(radioSet, node.form);
|
|
1892
|
-
return !checked || checked === node;
|
|
1893
|
-
};
|
|
1894
|
-
|
|
1895
|
-
var isRadio = function isRadio(node) {
|
|
1896
|
-
return isInput(node) && node.type === 'radio';
|
|
1897
|
-
};
|
|
1898
|
-
|
|
1899
|
-
var isNonTabbableRadio = function isNonTabbableRadio(node) {
|
|
1900
|
-
return isRadio(node) && !isTabbableRadio(node);
|
|
1901
|
-
};
|
|
1902
|
-
|
|
1903
|
-
var isZeroArea = function isZeroArea(node) {
|
|
1904
|
-
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
1905
|
-
width = _node$getBoundingClie.width,
|
|
1906
|
-
height = _node$getBoundingClie.height;
|
|
1907
|
-
|
|
1908
|
-
return width === 0 && height === 0;
|
|
1909
|
-
};
|
|
1910
|
-
|
|
1911
|
-
var isHidden = function isHidden(node, _ref) {
|
|
1912
|
-
var displayCheck = _ref.displayCheck,
|
|
1913
|
-
getShadowRoot = _ref.getShadowRoot;
|
|
1914
|
-
|
|
1915
|
-
if (getComputedStyle(node).visibility === 'hidden') {
|
|
1916
|
-
return true;
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
|
|
1920
|
-
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
1921
|
-
|
|
1922
|
-
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
1923
|
-
return true;
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
if (!displayCheck || displayCheck === 'full') {
|
|
1927
|
-
if (typeof getShadowRoot === 'function') {
|
|
1928
|
-
// figure out if we should consider the node to be in an undisclosed shadow and use the
|
|
1929
|
-
// 'non-zero-area' fallback
|
|
1930
|
-
var originalNode = node;
|
|
1931
|
-
|
|
1932
|
-
while (node) {
|
|
1933
|
-
var parentElement = node.parentElement;
|
|
1934
|
-
var rootNode = getRootNode(node);
|
|
1935
|
-
|
|
1936
|
-
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
|
|
1937
|
-
) {
|
|
1938
|
-
// node has an undisclosed shadow which means we can only treat it as a black box, so we
|
|
1939
|
-
// fall back to a non-zero-area test
|
|
1940
|
-
return isZeroArea(node);
|
|
1941
|
-
} else if (node.assignedSlot) {
|
|
1942
|
-
// iterate up slot
|
|
1943
|
-
node = node.assignedSlot;
|
|
1944
|
-
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
1945
|
-
// cross shadow boundary
|
|
1946
|
-
node = rootNode.host;
|
|
1947
|
-
} else {
|
|
1948
|
-
// iterate up normal dom
|
|
1949
|
-
node = parentElement;
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
node = originalNode;
|
|
1954
|
-
} // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
|
|
1955
|
-
// (i.e. it does not also presume that all nodes might have undisclosed shadows); or
|
|
1956
|
-
// it might be a falsy value, which means shadow DOM support is disabled
|
|
1957
|
-
// didn't find it sitting in an undisclosed shadow (or shadows are disabled) so now we
|
|
1958
|
-
// can just test to see if it would normally be visible or not
|
|
1959
|
-
// this works wherever the node is: if there's at least one client rect, it's
|
|
1960
|
-
// somehow displayed; it also covers the CSS 'display: contents' case where the
|
|
1961
|
-
// node itself is hidden in place of its contents; and there's no need to search
|
|
1962
|
-
// up the hierarchy either
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
return !node.getClientRects().length;
|
|
1966
|
-
} else if (displayCheck === 'non-zero-area') {
|
|
1967
|
-
return isZeroArea(node);
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
return false;
|
|
1971
|
-
}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable
|
|
1972
|
-
// unless they are in the _first_ <legend> element of the top-most disabled
|
|
1973
|
-
// fieldset
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
|
|
1977
|
-
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
1978
|
-
var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>
|
|
1979
|
-
|
|
1980
|
-
while (parentNode) {
|
|
1981
|
-
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
|
|
1982
|
-
// look for the first <legend> among the children of the disabled <fieldset>
|
|
1983
|
-
for (var i = 0; i < parentNode.children.length; i++) {
|
|
1984
|
-
var child = parentNode.children.item(i); // when the first <legend> (in document order) is found
|
|
1985
|
-
|
|
1986
|
-
if (child.tagName === 'LEGEND') {
|
|
1987
|
-
// if its parent <fieldset> is not nested in another disabled <fieldset>,
|
|
1988
|
-
// return whether `node` is a descendant of its first <legend>
|
|
1989
|
-
return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
|
|
1990
|
-
}
|
|
1991
|
-
} // the disabled <fieldset> containing `node` has no <legend>
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
return true;
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
parentNode = parentNode.parentElement;
|
|
1998
|
-
}
|
|
1999
|
-
} // else, node's tabbable/focusable state should not be affected by a fieldset's
|
|
2000
|
-
// enabled/disabled state
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
return false;
|
|
2004
|
-
};
|
|
2005
|
-
|
|
2006
|
-
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
|
|
2007
|
-
if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
|
|
2008
|
-
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
2009
|
-
return false;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
return true;
|
|
2013
|
-
};
|
|
2014
|
-
|
|
2015
|
-
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
2016
|
-
if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
2017
|
-
return false;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
return true;
|
|
2021
|
-
};
|
|
2022
|
-
/**
|
|
2023
|
-
* @param {Array.<Element|CandidatesScope>} candidates
|
|
2024
|
-
* @returns Element[]
|
|
2025
|
-
*/
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
var sortByOrder = function sortByOrder(candidates) {
|
|
2029
|
-
var regularTabbables = [];
|
|
2030
|
-
var orderedTabbables = [];
|
|
2031
|
-
candidates.forEach(function (item, i) {
|
|
2032
|
-
var isScope = !!item.scope;
|
|
2033
|
-
var element = isScope ? item.scope : item;
|
|
2034
|
-
var candidateTabindex = getTabindex(element, isScope);
|
|
2035
|
-
var elements = isScope ? sortByOrder(item.candidates) : element;
|
|
2036
|
-
|
|
2037
|
-
if (candidateTabindex === 0) {
|
|
2038
|
-
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
2039
|
-
} else {
|
|
2040
|
-
orderedTabbables.push({
|
|
2041
|
-
documentOrder: i,
|
|
2042
|
-
tabIndex: candidateTabindex,
|
|
2043
|
-
item: item,
|
|
2044
|
-
isScope: isScope,
|
|
2045
|
-
content: elements
|
|
2046
|
-
});
|
|
2047
|
-
}
|
|
2048
|
-
});
|
|
2049
|
-
return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
|
|
2050
|
-
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
2051
|
-
return acc;
|
|
2052
|
-
}, []).concat(regularTabbables);
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
var tabbable = function tabbable(el, options) {
|
|
2056
|
-
options = options || {};
|
|
2057
|
-
var candidates;
|
|
2058
|
-
|
|
2059
|
-
if (options.getShadowRoot) {
|
|
2060
|
-
candidates = getCandidatesIteratively([el], options.includeContainer, {
|
|
2061
|
-
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
2062
|
-
flatten: false,
|
|
2063
|
-
getShadowRoot: options.getShadowRoot
|
|
2064
|
-
});
|
|
2065
|
-
} else {
|
|
2066
|
-
candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
2067
|
-
}
|
|
2068
|
-
|
|
2069
|
-
return sortByOrder(candidates);
|
|
2070
|
-
};
|
|
2071
|
-
|
|
2072
|
-
var focusable = function focusable(el, options) {
|
|
2073
|
-
options = options || {};
|
|
2074
|
-
var candidates;
|
|
2075
|
-
|
|
2076
|
-
if (options.getShadowRoot) {
|
|
2077
|
-
candidates = getCandidatesIteratively([el], options.includeContainer, {
|
|
2078
|
-
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
2079
|
-
flatten: true,
|
|
2080
|
-
getShadowRoot: options.getShadowRoot
|
|
2081
|
-
});
|
|
2082
|
-
} else {
|
|
2083
|
-
candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
return candidates;
|
|
2087
|
-
};
|
|
2088
|
-
|
|
2089
|
-
var isTabbable = function isTabbable(node, options) {
|
|
2090
|
-
options = options || {};
|
|
2091
|
-
|
|
2092
|
-
if (!node) {
|
|
2093
|
-
throw new Error('No node provided');
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
if (matches.call(node, candidateSelector) === false) {
|
|
2097
|
-
return false;
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
return isNodeMatchingSelectorTabbable(options, node);
|
|
2101
|
-
};
|
|
2102
|
-
|
|
2103
|
-
var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
|
|
2104
|
-
|
|
2105
|
-
var isFocusable = function isFocusable(node, options) {
|
|
2106
|
-
options = options || {};
|
|
2107
|
-
|
|
2108
|
-
if (!node) {
|
|
2109
|
-
throw new Error('No node provided');
|
|
2110
|
-
}
|
|
2111
|
-
|
|
2112
|
-
if (matches.call(node, focusableCandidateSelector) === false) {
|
|
2113
|
-
return false;
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
return isNodeMatchingSelectorFocusable(options, node);
|
|
2117
|
-
};
|
|
2118
|
-
|
|
2119
|
-
const firstTabbable = (container) => {
|
|
2120
|
-
return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
|
|
2121
|
-
};
|
|
2122
|
-
|
|
2123
|
-
exports.autoUpdate = autoUpdate;
|
|
2124
|
-
exports.computePosition = computePosition;
|
|
2125
|
-
exports.firstTabbable = firstTabbable;
|
|
2126
|
-
exports.flip = flip;
|
|
2127
|
-
exports.focusable = focusable;
|
|
2128
|
-
exports.isFocusable = isFocusable;
|
|
2129
|
-
exports.isTabbable = isTabbable;
|
|
2130
|
-
exports.offset = offset;
|
|
2131
|
-
exports.tabbable = tabbable;
|
|
2132
|
-
|
|
2133
|
-
//# sourceMappingURL=first-tabbable-2068dcc6.js.map
|