@haiilo/catalyst 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/p-270fd91d.entry.js +2 -0
- package/dist/catalyst/{p-394f6b20.entry.js.map → p-270fd91d.entry.js.map} +1 -1
- package/dist/catalyst/p-692e49d6.js +3 -0
- package/dist/catalyst/p-692e49d6.js.map +1 -0
- package/dist/catalyst/p-cdac3176.entry.js +2 -0
- package/dist/catalyst/p-cdac3176.entry.js.map +1 -0
- package/dist/catalyst/scss/_variables.tokens.scss +2 -2
- package/dist/catalyst/scss/index.scss +4 -4
- package/dist/cjs/cat-alert_22.cjs.entry.js +108 -60
- package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -1
- package/dist/cjs/cat-modal.cjs.entry.js +2 -2
- package/dist/cjs/cat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +2 -2
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-8ab22379.js → index-b2134f1b.js} +13 -5
- package/dist/cjs/index-b2134f1b.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/cat-button/cat-button.css +4 -0
- package/dist/collection/components/cat-menu/cat-menu.js +0 -1
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-menu.js +0 -1
- package/dist/components/cat-menu.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +106 -57
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/esm/cat-alert_22.entry.js +108 -60
- package/dist/esm/cat-alert_22.entry.js.map +1 -1
- package/dist/esm/cat-modal.entry.js +2 -2
- package/dist/esm/cat-modal.entry.js.map +1 -1
- package/dist/esm/catalyst.js +2 -2
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-df195301.js → index-033048ed.js} +13 -6
- package/dist/esm/index-033048ed.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/loader.js.map +1 -1
- package/package.json +16 -13
- package/dist/catalyst/p-394f6b20.entry.js +0 -2
- package/dist/catalyst/p-e7265b52.entry.js +0 -2
- package/dist/catalyst/p-e7265b52.entry.js.map +0 -1
- package/dist/catalyst/p-f80e3399.js +0 -3
- package/dist/catalyst/p-f80e3399.js.map +0 -1
- package/dist/cjs/index-8ab22379.js.map +0 -1
- package/dist/esm/index-df195301.js.map +0 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@use 'sass:color';
|
|
5
5
|
@use 'sass:string';
|
|
6
6
|
|
|
7
|
-
@use '
|
|
8
|
-
@forward '
|
|
7
|
+
@use '@haiilo/catalyst-tokens/dist/scss/variables' as *;
|
|
8
|
+
@forward '@haiilo/catalyst-tokens/dist/scss/variables' show $tokens;
|
|
9
9
|
|
|
10
10
|
// -----
|
|
11
11
|
// -- Split a string using the given separator.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// -- Reset
|
|
2
|
-
@import '
|
|
3
|
-
@import '
|
|
4
|
-
@import '
|
|
2
|
+
@import 'sanitize.css/sanitize.css';
|
|
3
|
+
@import 'sanitize.css/assets.css';
|
|
4
|
+
@import 'sanitize.css/reduce-motion.css';
|
|
5
5
|
|
|
6
6
|
// -- Vendor
|
|
7
|
-
@import '
|
|
7
|
+
@import 'toastify-js/src/toastify.css';
|
|
8
8
|
|
|
9
9
|
// -- Fonts
|
|
10
10
|
@import 'fonts/fonts-mixins';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b2134f1b.js');
|
|
6
6
|
const catNotification = require('./cat-notification-bcb9fb86.js');
|
|
7
7
|
const firstTabbable = require('./first-tabbable-7966cf1c.js');
|
|
8
8
|
|
|
@@ -293,7 +293,7 @@ function createEmptyStyleRule(query) {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:var(--cat-opacity-disabled, 0.65)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:235, 236, 240;--fill:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 105, 118, 135);--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.1)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-catsecondary-text-active, 0, 0, 0)}.cat-button-success{--bg:var(--cat-success-bg-, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-catdanger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xs]){margin:-0.25rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.25rem;margin-bottom:-0.25rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.25rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.25rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
|
|
296
|
+
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:var(--cat-opacity-disabled, 0.65)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:235, 236, 240;--fill:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 105, 118, 135);--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.1)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-catsecondary-text-active, 0, 0, 0)}.cat-button-success{--bg:var(--cat-success-bg-, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-catdanger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xs]){margin:-0.25rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.25rem;margin-bottom:-0.25rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.25rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.25rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host-context(cat-tabs) .cat-button{background-color:transparent !important}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
|
|
297
297
|
|
|
298
298
|
const CatButton = class {
|
|
299
299
|
constructor(hostRef) {
|
|
@@ -813,9 +813,9 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
813
813
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
814
814
|
let statefulPlacement = placement;
|
|
815
815
|
let middlewareData = {};
|
|
816
|
+
let resetCount = 0;
|
|
816
817
|
|
|
817
818
|
for (let i = 0; i < middleware.length; i++) {
|
|
818
|
-
|
|
819
819
|
const {
|
|
820
820
|
name,
|
|
821
821
|
fn
|
|
@@ -847,7 +847,9 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
847
847
|
}
|
|
848
848
|
};
|
|
849
849
|
|
|
850
|
-
if (reset) {
|
|
850
|
+
if (reset && resetCount <= 50) {
|
|
851
|
+
resetCount++;
|
|
852
|
+
|
|
851
853
|
if (typeof reset === 'object') {
|
|
852
854
|
if (reset.placement) {
|
|
853
855
|
statefulPlacement = reset.placement;
|
|
@@ -955,9 +957,7 @@ async function detectOverflow(middlewareArguments, options) {
|
|
|
955
957
|
} : rects.reference,
|
|
956
958
|
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
957
959
|
strategy
|
|
958
|
-
}) : rects[elementContext]);
|
|
959
|
-
// 0 or negative = within the clipping rect
|
|
960
|
-
|
|
960
|
+
}) : rects[elementContext]);
|
|
961
961
|
return {
|
|
962
962
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
963
963
|
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
@@ -1122,19 +1122,19 @@ const flip = function (options) {
|
|
|
1122
1122
|
};
|
|
1123
1123
|
};
|
|
1124
1124
|
|
|
1125
|
-
function convertValueToCoords(
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1125
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
|
1126
|
+
const {
|
|
1127
|
+
placement,
|
|
1128
|
+
platform,
|
|
1129
|
+
elements
|
|
1130
|
+
} = middlewareArguments;
|
|
1131
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1130
1132
|
const side = getSide(placement);
|
|
1131
1133
|
const alignment = getAlignment(placement);
|
|
1132
1134
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
1133
1135
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
1134
1136
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1135
|
-
const rawValue = typeof value === 'function' ? value(
|
|
1136
|
-
placement
|
|
1137
|
-
}) : value; // eslint-disable-next-line prefer-const
|
|
1137
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
|
1138
1138
|
|
|
1139
1139
|
let {
|
|
1140
1140
|
mainAxis,
|
|
@@ -1180,13 +1180,9 @@ const offset = function (value) {
|
|
|
1180
1180
|
async fn(middlewareArguments) {
|
|
1181
1181
|
const {
|
|
1182
1182
|
x,
|
|
1183
|
-
y
|
|
1184
|
-
placement,
|
|
1185
|
-
rects,
|
|
1186
|
-
platform,
|
|
1187
|
-
elements
|
|
1183
|
+
y
|
|
1188
1184
|
} = middlewareArguments;
|
|
1189
|
-
const diffCoords = convertValueToCoords(
|
|
1185
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
1190
1186
|
return {
|
|
1191
1187
|
x: x + diffCoords.x,
|
|
1192
1188
|
y: y + diffCoords.y,
|
|
@@ -1198,7 +1194,7 @@ const offset = function (value) {
|
|
|
1198
1194
|
};
|
|
1199
1195
|
|
|
1200
1196
|
function isWindow(value) {
|
|
1201
|
-
return
|
|
1197
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
|
1202
1198
|
}
|
|
1203
1199
|
function getWindow(node) {
|
|
1204
1200
|
if (node == null) {
|
|
@@ -1213,7 +1209,7 @@ function getWindow(node) {
|
|
|
1213
1209
|
return node;
|
|
1214
1210
|
}
|
|
1215
1211
|
|
|
1216
|
-
function getComputedStyle
|
|
1212
|
+
function getComputedStyle(element) {
|
|
1217
1213
|
return getWindow(element).getComputedStyle(element);
|
|
1218
1214
|
}
|
|
1219
1215
|
|
|
@@ -1221,6 +1217,16 @@ function getNodeName(node) {
|
|
|
1221
1217
|
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
|
1222
1218
|
}
|
|
1223
1219
|
|
|
1220
|
+
function getUAString() {
|
|
1221
|
+
const uaData = navigator.userAgentData;
|
|
1222
|
+
|
|
1223
|
+
if (uaData != null && uaData.brands) {
|
|
1224
|
+
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
return navigator.userAgent;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1224
1230
|
function isHTMLElement(value) {
|
|
1225
1231
|
return value instanceof getWindow(value).HTMLElement;
|
|
1226
1232
|
}
|
|
@@ -1231,6 +1237,11 @@ function isNode(value) {
|
|
|
1231
1237
|
return value instanceof getWindow(value).Node;
|
|
1232
1238
|
}
|
|
1233
1239
|
function isShadowRoot(node) {
|
|
1240
|
+
// Browsers without `ShadowRoot` support
|
|
1241
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1242
|
+
return false;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1234
1245
|
const OwnElement = getWindow(node).ShadowRoot;
|
|
1235
1246
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1236
1247
|
}
|
|
@@ -1239,36 +1250,46 @@ function isOverflowElement(element) {
|
|
|
1239
1250
|
const {
|
|
1240
1251
|
overflow,
|
|
1241
1252
|
overflowX,
|
|
1242
|
-
overflowY
|
|
1243
|
-
|
|
1244
|
-
|
|
1253
|
+
overflowY,
|
|
1254
|
+
display
|
|
1255
|
+
} = getComputedStyle(element);
|
|
1256
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
1245
1257
|
}
|
|
1246
1258
|
function isTableElement(element) {
|
|
1247
1259
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1248
1260
|
}
|
|
1249
1261
|
function isContainingBlock(element) {
|
|
1250
1262
|
// TODO: Try and use feature detection here instead
|
|
1251
|
-
const isFirefox =
|
|
1252
|
-
const css = getComputedStyle
|
|
1263
|
+
const isFirefox = /firefox/i.test(getUAString());
|
|
1264
|
+
const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
|
|
1253
1265
|
// create a containing block.
|
|
1254
1266
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1255
1267
|
|
|
1256
|
-
return css.transform !== 'none' || css.perspective !== 'none' ||
|
|
1268
|
+
return css.transform !== 'none' || css.perspective !== 'none' || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some( // TS 4.1 compat
|
|
1269
|
+
value => {
|
|
1270
|
+
const contain = css.contain;
|
|
1271
|
+
return contain != null ? contain.includes(value) : false;
|
|
1272
|
+
});
|
|
1257
1273
|
}
|
|
1258
1274
|
function isLayoutViewport() {
|
|
1259
1275
|
// Not Safari
|
|
1260
|
-
return !/^((?!chrome|android).)*safari/i.test(
|
|
1276
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
|
1261
1277
|
// • Always-visible scrollbar or not
|
|
1262
1278
|
// • Width of <html>, etc.
|
|
1263
1279
|
// const vV = win.visualViewport;
|
|
1264
1280
|
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
1265
1281
|
}
|
|
1282
|
+
function isLastTraversableNode(node) {
|
|
1283
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1284
|
+
}
|
|
1266
1285
|
|
|
1267
1286
|
const min = Math.min;
|
|
1268
1287
|
const max = Math.max;
|
|
1269
1288
|
const round = Math.round;
|
|
1270
1289
|
|
|
1271
1290
|
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1291
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
|
1292
|
+
|
|
1272
1293
|
if (includeScale === void 0) {
|
|
1273
1294
|
includeScale = false;
|
|
1274
1295
|
}
|
|
@@ -1288,8 +1309,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
1288
1309
|
|
|
1289
1310
|
const win = isElement(element) ? getWindow(element) : window;
|
|
1290
1311
|
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1291
|
-
const x = (clientRect.left + (addVisualOffsets ? win.visualViewport.offsetLeft : 0)) / scaleX;
|
|
1292
|
-
const y = (clientRect.top + (addVisualOffsets ? win.visualViewport.offsetTop : 0)) / scaleY;
|
|
1312
|
+
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
|
1313
|
+
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
|
1293
1314
|
const width = clientRect.width / scaleX;
|
|
1294
1315
|
const height = clientRect.height / scaleY;
|
|
1295
1316
|
return {
|
|
@@ -1309,16 +1330,16 @@ function getDocumentElement(node) {
|
|
|
1309
1330
|
}
|
|
1310
1331
|
|
|
1311
1332
|
function getNodeScroll(element) {
|
|
1312
|
-
if (
|
|
1333
|
+
if (isElement(element)) {
|
|
1313
1334
|
return {
|
|
1314
|
-
scrollLeft: element.
|
|
1315
|
-
scrollTop: element.
|
|
1335
|
+
scrollLeft: element.scrollLeft,
|
|
1336
|
+
scrollTop: element.scrollTop
|
|
1316
1337
|
};
|
|
1317
1338
|
}
|
|
1318
1339
|
|
|
1319
1340
|
return {
|
|
1320
|
-
scrollLeft: element.
|
|
1321
|
-
scrollTop: element.
|
|
1341
|
+
scrollLeft: element.pageXOffset,
|
|
1342
|
+
scrollTop: element.pageYOffset
|
|
1322
1343
|
};
|
|
1323
1344
|
}
|
|
1324
1345
|
|
|
@@ -1336,7 +1357,8 @@ function isScaled(element) {
|
|
|
1336
1357
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1337
1358
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1338
1359
|
const documentElement = getDocumentElement(offsetParent);
|
|
1339
|
-
const rect = getBoundingClientRect(element,
|
|
1360
|
+
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
|
1361
|
+
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1340
1362
|
let scroll = {
|
|
1341
1363
|
scrollLeft: 0,
|
|
1342
1364
|
scrollTop: 0
|
|
@@ -1398,11 +1420,12 @@ function getContainingBlock(element) {
|
|
|
1398
1420
|
currentNode = currentNode.host;
|
|
1399
1421
|
}
|
|
1400
1422
|
|
|
1401
|
-
while (isHTMLElement(currentNode) && !
|
|
1423
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1402
1424
|
if (isContainingBlock(currentNode)) {
|
|
1403
1425
|
return currentNode;
|
|
1404
1426
|
} else {
|
|
1405
|
-
|
|
1427
|
+
const parent = currentNode.parentNode;
|
|
1428
|
+
currentNode = isShadowRoot(parent) ? parent.host : parent;
|
|
1406
1429
|
}
|
|
1407
1430
|
}
|
|
1408
1431
|
|
|
@@ -1526,7 +1549,7 @@ function getDocumentRect(element) {
|
|
|
1526
1549
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1527
1550
|
const y = -scroll.scrollTop;
|
|
1528
1551
|
|
|
1529
|
-
if (getComputedStyle
|
|
1552
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1530
1553
|
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1531
1554
|
}
|
|
1532
1555
|
|
|
@@ -1541,7 +1564,7 @@ function getDocumentRect(element) {
|
|
|
1541
1564
|
function getNearestOverflowAncestor(node) {
|
|
1542
1565
|
const parentNode = getParentNode(node);
|
|
1543
1566
|
|
|
1544
|
-
if (
|
|
1567
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1545
1568
|
// @ts-ignore assume body is always available
|
|
1546
1569
|
return node.ownerDocument.body;
|
|
1547
1570
|
}
|
|
@@ -1566,7 +1589,7 @@ function getOverflowAncestors(node, list) {
|
|
|
1566
1589
|
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
1567
1590
|
const updatedList = list.concat(target);
|
|
1568
1591
|
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
1569
|
-
updatedList.concat(getOverflowAncestors(
|
|
1592
|
+
updatedList.concat(getOverflowAncestors(target));
|
|
1570
1593
|
}
|
|
1571
1594
|
|
|
1572
1595
|
function contains(parent, child) {
|
|
@@ -1592,6 +1615,22 @@ function contains(parent, child) {
|
|
|
1592
1615
|
return false;
|
|
1593
1616
|
}
|
|
1594
1617
|
|
|
1618
|
+
function getNearestParentCapableOfEscapingClipping(element, clippingAncestors) {
|
|
1619
|
+
let currentNode = element;
|
|
1620
|
+
|
|
1621
|
+
while (currentNode && !isLastTraversableNode(currentNode) && // @ts-expect-error
|
|
1622
|
+
!clippingAncestors.includes(currentNode)) {
|
|
1623
|
+
if (isElement(currentNode) && ['absolute', 'fixed'].includes(getComputedStyle(currentNode).position)) {
|
|
1624
|
+
break;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
const parentNode = getParentNode(currentNode);
|
|
1628
|
+
currentNode = isShadowRoot(parentNode) ? parentNode.host : parentNode;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
return currentNode;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1595
1634
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1596
1635
|
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
1597
1636
|
const top = clientRect.top + element.clientTop;
|
|
@@ -1625,15 +1664,25 @@ function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
|
|
|
1625
1664
|
|
|
1626
1665
|
function getClippingAncestors(element) {
|
|
1627
1666
|
const clippingAncestors = getOverflowAncestors(element);
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1667
|
+
const nearestEscapableParent = getNearestParentCapableOfEscapingClipping(element, clippingAncestors);
|
|
1668
|
+
let clipperElement = null;
|
|
1669
|
+
|
|
1670
|
+
if (nearestEscapableParent && isHTMLElement(nearestEscapableParent)) {
|
|
1671
|
+
const offsetParent = getOffsetParent(nearestEscapableParent);
|
|
1672
|
+
|
|
1673
|
+
if (isOverflowElement(nearestEscapableParent)) {
|
|
1674
|
+
clipperElement = nearestEscapableParent;
|
|
1675
|
+
} else if (isHTMLElement(offsetParent)) {
|
|
1676
|
+
clipperElement = offsetParent;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1630
1679
|
|
|
1631
1680
|
if (!isElement(clipperElement)) {
|
|
1632
1681
|
return [];
|
|
1633
1682
|
} // @ts-ignore isElement check ensures we return Array<Element>
|
|
1634
1683
|
|
|
1635
1684
|
|
|
1636
|
-
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1685
|
+
return clippingAncestors.filter(clippingAncestors => clipperElement && isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1637
1686
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
1638
1687
|
// clipping ancestors
|
|
1639
1688
|
|
|
@@ -1686,7 +1735,7 @@ const platform = {
|
|
|
1686
1735
|
};
|
|
1687
1736
|
},
|
|
1688
1737
|
getClientRects: element => Array.from(element.getClientRects()),
|
|
1689
|
-
isRTL: element => getComputedStyle
|
|
1738
|
+
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1690
1739
|
};
|
|
1691
1740
|
|
|
1692
1741
|
/**
|
|
@@ -1700,14 +1749,11 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1700
1749
|
|
|
1701
1750
|
const {
|
|
1702
1751
|
ancestorScroll: _ancestorScroll = true,
|
|
1703
|
-
ancestorResize
|
|
1704
|
-
elementResize
|
|
1752
|
+
ancestorResize = true,
|
|
1753
|
+
elementResize = true,
|
|
1705
1754
|
animationFrame = false
|
|
1706
1755
|
} = options;
|
|
1707
|
-
let cleanedUp = false;
|
|
1708
1756
|
const ancestorScroll = _ancestorScroll && !animationFrame;
|
|
1709
|
-
const ancestorResize = _ancestorResize && !animationFrame;
|
|
1710
|
-
const elementResize = _elementResize && !animationFrame;
|
|
1711
1757
|
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
|
|
1712
1758
|
ancestors.forEach(ancestor => {
|
|
1713
1759
|
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
@@ -1718,8 +1764,15 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1718
1764
|
let observer = null;
|
|
1719
1765
|
|
|
1720
1766
|
if (elementResize) {
|
|
1721
|
-
|
|
1722
|
-
|
|
1767
|
+
let initialUpdate = true;
|
|
1768
|
+
observer = new ResizeObserver(() => {
|
|
1769
|
+
if (!initialUpdate) {
|
|
1770
|
+
update();
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
initialUpdate = false;
|
|
1774
|
+
});
|
|
1775
|
+
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
1723
1776
|
observer.observe(floating);
|
|
1724
1777
|
}
|
|
1725
1778
|
|
|
@@ -1731,10 +1784,6 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1731
1784
|
}
|
|
1732
1785
|
|
|
1733
1786
|
function frameLoop() {
|
|
1734
|
-
if (cleanedUp) {
|
|
1735
|
-
return;
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
1787
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1739
1788
|
|
|
1740
1789
|
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
@@ -1745,10 +1794,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1745
1794
|
frameId = requestAnimationFrame(frameLoop);
|
|
1746
1795
|
}
|
|
1747
1796
|
|
|
1797
|
+
update();
|
|
1748
1798
|
return () => {
|
|
1749
1799
|
var _observer;
|
|
1750
1800
|
|
|
1751
|
-
cleanedUp = true;
|
|
1752
1801
|
ancestors.forEach(ancestor => {
|
|
1753
1802
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1754
1803
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
@@ -1894,7 +1943,6 @@ const CatMenu = class {
|
|
|
1894
1943
|
if (!trigger) {
|
|
1895
1944
|
catNotification.loglevel.error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');
|
|
1896
1945
|
}
|
|
1897
|
-
console.log(trigger);
|
|
1898
1946
|
return trigger;
|
|
1899
1947
|
}
|
|
1900
1948
|
};
|