@haiilo/catalyst 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.css +1 -1
- 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-3ad731e4.entry.js +2 -0
- package/dist/catalyst/p-3ad731e4.entry.js.map +1 -0
- package/dist/catalyst/p-692e49d6.js +3 -0
- package/dist/catalyst/p-692e49d6.js.map +1 -0
- package/dist/catalyst/scss/_variables.scss +2 -10
- package/dist/catalyst/scss/_variables.tokens.scss +2 -2
- package/dist/catalyst/scss/core/_base.scss +5 -1
- package/dist/catalyst/scss/core/_toast.scss +3 -3
- package/dist/catalyst/scss/core/_typography.scss +2 -17
- package/dist/catalyst/scss/index.scss +4 -4
- package/dist/catalyst/scss/utils/_typography.mixins.scss +9 -2
- package/dist/cjs/cat-alert_22.cjs.entry.js +174 -108
- 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 +3 -3
- 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 +3 -3
- 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 +9 -5
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +1 -1
- package/dist/collection/components/cat-input/cat-input.css +1 -1
- package/dist/collection/components/cat-menu/cat-menu.css +0 -2
- package/dist/collection/components/cat-menu/cat-menu.js +47 -14
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +0 -2
- package/dist/collection/components/cat-select/cat-select.css +1 -1
- package/dist/collection/components/cat-select/cat-select.js +30 -28
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +3 -3
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +1 -1
- package/dist/collection/scss/_variables.scss +2 -10
- package/dist/collection/scss/core/_base.scss +5 -1
- package/dist/collection/scss/core/_toast.scss +3 -3
- package/dist/collection/scss/core/_typography.scss +2 -17
- package/dist/collection/scss/utils/_typography.mixins.scss +9 -2
- package/dist/components/cat-avatar2.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-checkbox2.js +1 -1
- package/dist/components/cat-input.js +1 -1
- package/dist/components/cat-menu.js +30 -14
- package/dist/components/cat-menu.js.map +1 -1
- package/dist/components/cat-radio.js +1 -1
- package/dist/components/cat-select-demo.js +2 -2
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +31 -29
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-textarea.js +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 +174 -108
- 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 +3 -3
- 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 +3 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/components/cat-menu/cat-menu.d.ts +5 -0
- package/dist/types/components/cat-select/cat-select.d.ts +4 -3
- package/dist/types/components.d.ts +8 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-033048ed.js';
|
|
2
2
|
import { l as loglevel, a as CatIconRegistry, C as CatI18nRegistry, N as NotificationsService } from './cat-notification-8bcf6fa2.js';
|
|
3
3
|
import { t as tabbable, f as firstTabbable, c as createFocusTrap } from './first-tabbable-4a00de61.js';
|
|
4
4
|
|
|
@@ -289,7 +289,7 @@ function createEmptyStyleRule(query) {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
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}";
|
|
292
|
+
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:var(--cat-link-button-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:var(--cat-link-button-decoration-hover, none);background-color:rgba(var(--base), 0.05)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-button-decoration-hover, 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-secondary-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-danger-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}";
|
|
293
293
|
|
|
294
294
|
const CatButton = class {
|
|
295
295
|
constructor(hostRef) {
|
|
@@ -493,7 +493,7 @@ const CatFormHint = props => {
|
|
|
493
493
|
]));
|
|
494
494
|
};
|
|
495
495
|
|
|
496
|
-
const catCheckboxCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 0.13s ease, border-color 0.13s ease;pointer-events:none}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#
|
|
496
|
+
const catCheckboxCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 0.13s ease, border-color 0.13s ease;pointer-events:none}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#f2f4f7;border-color:rgb(var(--cat-border-color-dark, 215, 219, 224));stroke:rgb(var(--cat-font-color-muted, 105, 118, 135))}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
497
497
|
|
|
498
498
|
let nextUniqueId$8 = 0;
|
|
499
499
|
const CatCheckbox = class {
|
|
@@ -601,7 +601,7 @@ const CatIcon = class {
|
|
|
601
601
|
};
|
|
602
602
|
CatIcon.style = catIconCss;
|
|
603
603
|
|
|
604
|
-
const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#
|
|
604
|
+
const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .input-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
|
|
605
605
|
|
|
606
606
|
let nextUniqueId$7 = 0;
|
|
607
607
|
const CatInput = class {
|
|
@@ -809,9 +809,9 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
809
809
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
810
810
|
let statefulPlacement = placement;
|
|
811
811
|
let middlewareData = {};
|
|
812
|
+
let resetCount = 0;
|
|
812
813
|
|
|
813
814
|
for (let i = 0; i < middleware.length; i++) {
|
|
814
|
-
|
|
815
815
|
const {
|
|
816
816
|
name,
|
|
817
817
|
fn
|
|
@@ -843,7 +843,9 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
843
843
|
}
|
|
844
844
|
};
|
|
845
845
|
|
|
846
|
-
if (reset) {
|
|
846
|
+
if (reset && resetCount <= 50) {
|
|
847
|
+
resetCount++;
|
|
848
|
+
|
|
847
849
|
if (typeof reset === 'object') {
|
|
848
850
|
if (reset.placement) {
|
|
849
851
|
statefulPlacement = reset.placement;
|
|
@@ -951,9 +953,7 @@ async function detectOverflow(middlewareArguments, options) {
|
|
|
951
953
|
} : rects.reference,
|
|
952
954
|
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
953
955
|
strategy
|
|
954
|
-
}) : rects[elementContext]);
|
|
955
|
-
// 0 or negative = within the clipping rect
|
|
956
|
-
|
|
956
|
+
}) : rects[elementContext]);
|
|
957
957
|
return {
|
|
958
958
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
959
959
|
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
@@ -1118,19 +1118,19 @@ const flip = function (options) {
|
|
|
1118
1118
|
};
|
|
1119
1119
|
};
|
|
1120
1120
|
|
|
1121
|
-
function convertValueToCoords(
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1121
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
|
1122
|
+
const {
|
|
1123
|
+
placement,
|
|
1124
|
+
platform,
|
|
1125
|
+
elements
|
|
1126
|
+
} = middlewareArguments;
|
|
1127
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1126
1128
|
const side = getSide(placement);
|
|
1127
1129
|
const alignment = getAlignment(placement);
|
|
1128
1130
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
1129
1131
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
1130
1132
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1131
|
-
const rawValue = typeof value === 'function' ? value(
|
|
1132
|
-
placement
|
|
1133
|
-
}) : value; // eslint-disable-next-line prefer-const
|
|
1133
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
|
1134
1134
|
|
|
1135
1135
|
let {
|
|
1136
1136
|
mainAxis,
|
|
@@ -1176,13 +1176,9 @@ const offset = function (value) {
|
|
|
1176
1176
|
async fn(middlewareArguments) {
|
|
1177
1177
|
const {
|
|
1178
1178
|
x,
|
|
1179
|
-
y
|
|
1180
|
-
placement,
|
|
1181
|
-
rects,
|
|
1182
|
-
platform,
|
|
1183
|
-
elements
|
|
1179
|
+
y
|
|
1184
1180
|
} = middlewareArguments;
|
|
1185
|
-
const diffCoords = convertValueToCoords(
|
|
1181
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
1186
1182
|
return {
|
|
1187
1183
|
x: x + diffCoords.x,
|
|
1188
1184
|
y: y + diffCoords.y,
|
|
@@ -1194,7 +1190,7 @@ const offset = function (value) {
|
|
|
1194
1190
|
};
|
|
1195
1191
|
|
|
1196
1192
|
function isWindow(value) {
|
|
1197
|
-
return
|
|
1193
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
|
1198
1194
|
}
|
|
1199
1195
|
function getWindow(node) {
|
|
1200
1196
|
if (node == null) {
|
|
@@ -1209,7 +1205,7 @@ function getWindow(node) {
|
|
|
1209
1205
|
return node;
|
|
1210
1206
|
}
|
|
1211
1207
|
|
|
1212
|
-
function getComputedStyle
|
|
1208
|
+
function getComputedStyle(element) {
|
|
1213
1209
|
return getWindow(element).getComputedStyle(element);
|
|
1214
1210
|
}
|
|
1215
1211
|
|
|
@@ -1217,6 +1213,16 @@ function getNodeName(node) {
|
|
|
1217
1213
|
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
|
1218
1214
|
}
|
|
1219
1215
|
|
|
1216
|
+
function getUAString() {
|
|
1217
|
+
const uaData = navigator.userAgentData;
|
|
1218
|
+
|
|
1219
|
+
if (uaData != null && uaData.brands) {
|
|
1220
|
+
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
return navigator.userAgent;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1220
1226
|
function isHTMLElement(value) {
|
|
1221
1227
|
return value instanceof getWindow(value).HTMLElement;
|
|
1222
1228
|
}
|
|
@@ -1227,6 +1233,11 @@ function isNode(value) {
|
|
|
1227
1233
|
return value instanceof getWindow(value).Node;
|
|
1228
1234
|
}
|
|
1229
1235
|
function isShadowRoot(node) {
|
|
1236
|
+
// Browsers without `ShadowRoot` support
|
|
1237
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1238
|
+
return false;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1230
1241
|
const OwnElement = getWindow(node).ShadowRoot;
|
|
1231
1242
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1232
1243
|
}
|
|
@@ -1235,36 +1246,46 @@ function isOverflowElement(element) {
|
|
|
1235
1246
|
const {
|
|
1236
1247
|
overflow,
|
|
1237
1248
|
overflowX,
|
|
1238
|
-
overflowY
|
|
1239
|
-
|
|
1240
|
-
|
|
1249
|
+
overflowY,
|
|
1250
|
+
display
|
|
1251
|
+
} = getComputedStyle(element);
|
|
1252
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
1241
1253
|
}
|
|
1242
1254
|
function isTableElement(element) {
|
|
1243
1255
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1244
1256
|
}
|
|
1245
1257
|
function isContainingBlock(element) {
|
|
1246
1258
|
// TODO: Try and use feature detection here instead
|
|
1247
|
-
const isFirefox =
|
|
1248
|
-
const css = getComputedStyle
|
|
1259
|
+
const isFirefox = /firefox/i.test(getUAString());
|
|
1260
|
+
const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
|
|
1249
1261
|
// create a containing block.
|
|
1250
1262
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1251
1263
|
|
|
1252
|
-
return css.transform !== 'none' || css.perspective !== 'none' ||
|
|
1264
|
+
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
|
|
1265
|
+
value => {
|
|
1266
|
+
const contain = css.contain;
|
|
1267
|
+
return contain != null ? contain.includes(value) : false;
|
|
1268
|
+
});
|
|
1253
1269
|
}
|
|
1254
1270
|
function isLayoutViewport() {
|
|
1255
1271
|
// Not Safari
|
|
1256
|
-
return !/^((?!chrome|android).)*safari/i.test(
|
|
1272
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
|
1257
1273
|
// • Always-visible scrollbar or not
|
|
1258
1274
|
// • Width of <html>, etc.
|
|
1259
1275
|
// const vV = win.visualViewport;
|
|
1260
1276
|
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
1261
1277
|
}
|
|
1278
|
+
function isLastTraversableNode(node) {
|
|
1279
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1280
|
+
}
|
|
1262
1281
|
|
|
1263
1282
|
const min = Math.min;
|
|
1264
1283
|
const max = Math.max;
|
|
1265
1284
|
const round = Math.round;
|
|
1266
1285
|
|
|
1267
1286
|
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1287
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
|
1288
|
+
|
|
1268
1289
|
if (includeScale === void 0) {
|
|
1269
1290
|
includeScale = false;
|
|
1270
1291
|
}
|
|
@@ -1284,8 +1305,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
|
1284
1305
|
|
|
1285
1306
|
const win = isElement(element) ? getWindow(element) : window;
|
|
1286
1307
|
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1287
|
-
const x = (clientRect.left + (addVisualOffsets ? win.visualViewport.offsetLeft : 0)) / scaleX;
|
|
1288
|
-
const y = (clientRect.top + (addVisualOffsets ? win.visualViewport.offsetTop : 0)) / scaleY;
|
|
1308
|
+
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;
|
|
1309
|
+
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;
|
|
1289
1310
|
const width = clientRect.width / scaleX;
|
|
1290
1311
|
const height = clientRect.height / scaleY;
|
|
1291
1312
|
return {
|
|
@@ -1305,16 +1326,16 @@ function getDocumentElement(node) {
|
|
|
1305
1326
|
}
|
|
1306
1327
|
|
|
1307
1328
|
function getNodeScroll(element) {
|
|
1308
|
-
if (
|
|
1329
|
+
if (isElement(element)) {
|
|
1309
1330
|
return {
|
|
1310
|
-
scrollLeft: element.
|
|
1311
|
-
scrollTop: element.
|
|
1331
|
+
scrollLeft: element.scrollLeft,
|
|
1332
|
+
scrollTop: element.scrollTop
|
|
1312
1333
|
};
|
|
1313
1334
|
}
|
|
1314
1335
|
|
|
1315
1336
|
return {
|
|
1316
|
-
scrollLeft: element.
|
|
1317
|
-
scrollTop: element.
|
|
1337
|
+
scrollLeft: element.pageXOffset,
|
|
1338
|
+
scrollTop: element.pageYOffset
|
|
1318
1339
|
};
|
|
1319
1340
|
}
|
|
1320
1341
|
|
|
@@ -1332,7 +1353,8 @@ function isScaled(element) {
|
|
|
1332
1353
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1333
1354
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1334
1355
|
const documentElement = getDocumentElement(offsetParent);
|
|
1335
|
-
const rect = getBoundingClientRect(element,
|
|
1356
|
+
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
|
1357
|
+
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
1336
1358
|
let scroll = {
|
|
1337
1359
|
scrollLeft: 0,
|
|
1338
1360
|
scrollTop: 0
|
|
@@ -1394,11 +1416,12 @@ function getContainingBlock(element) {
|
|
|
1394
1416
|
currentNode = currentNode.host;
|
|
1395
1417
|
}
|
|
1396
1418
|
|
|
1397
|
-
while (isHTMLElement(currentNode) && !
|
|
1419
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1398
1420
|
if (isContainingBlock(currentNode)) {
|
|
1399
1421
|
return currentNode;
|
|
1400
1422
|
} else {
|
|
1401
|
-
|
|
1423
|
+
const parent = currentNode.parentNode;
|
|
1424
|
+
currentNode = isShadowRoot(parent) ? parent.host : parent;
|
|
1402
1425
|
}
|
|
1403
1426
|
}
|
|
1404
1427
|
|
|
@@ -1522,7 +1545,7 @@ function getDocumentRect(element) {
|
|
|
1522
1545
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1523
1546
|
const y = -scroll.scrollTop;
|
|
1524
1547
|
|
|
1525
|
-
if (getComputedStyle
|
|
1548
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1526
1549
|
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1527
1550
|
}
|
|
1528
1551
|
|
|
@@ -1537,7 +1560,7 @@ function getDocumentRect(element) {
|
|
|
1537
1560
|
function getNearestOverflowAncestor(node) {
|
|
1538
1561
|
const parentNode = getParentNode(node);
|
|
1539
1562
|
|
|
1540
|
-
if (
|
|
1563
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1541
1564
|
// @ts-ignore assume body is always available
|
|
1542
1565
|
return node.ownerDocument.body;
|
|
1543
1566
|
}
|
|
@@ -1562,7 +1585,7 @@ function getOverflowAncestors(node, list) {
|
|
|
1562
1585
|
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
1563
1586
|
const updatedList = list.concat(target);
|
|
1564
1587
|
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
1565
|
-
updatedList.concat(getOverflowAncestors(
|
|
1588
|
+
updatedList.concat(getOverflowAncestors(target));
|
|
1566
1589
|
}
|
|
1567
1590
|
|
|
1568
1591
|
function contains(parent, child) {
|
|
@@ -1588,6 +1611,22 @@ function contains(parent, child) {
|
|
|
1588
1611
|
return false;
|
|
1589
1612
|
}
|
|
1590
1613
|
|
|
1614
|
+
function getNearestParentCapableOfEscapingClipping(element, clippingAncestors) {
|
|
1615
|
+
let currentNode = element;
|
|
1616
|
+
|
|
1617
|
+
while (currentNode && !isLastTraversableNode(currentNode) && // @ts-expect-error
|
|
1618
|
+
!clippingAncestors.includes(currentNode)) {
|
|
1619
|
+
if (isElement(currentNode) && ['absolute', 'fixed'].includes(getComputedStyle(currentNode).position)) {
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
const parentNode = getParentNode(currentNode);
|
|
1624
|
+
currentNode = isShadowRoot(parentNode) ? parentNode.host : parentNode;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
return currentNode;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1591
1630
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1592
1631
|
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
1593
1632
|
const top = clientRect.top + element.clientTop;
|
|
@@ -1621,15 +1660,25 @@ function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
|
|
|
1621
1660
|
|
|
1622
1661
|
function getClippingAncestors(element) {
|
|
1623
1662
|
const clippingAncestors = getOverflowAncestors(element);
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1663
|
+
const nearestEscapableParent = getNearestParentCapableOfEscapingClipping(element, clippingAncestors);
|
|
1664
|
+
let clipperElement = null;
|
|
1665
|
+
|
|
1666
|
+
if (nearestEscapableParent && isHTMLElement(nearestEscapableParent)) {
|
|
1667
|
+
const offsetParent = getOffsetParent(nearestEscapableParent);
|
|
1668
|
+
|
|
1669
|
+
if (isOverflowElement(nearestEscapableParent)) {
|
|
1670
|
+
clipperElement = nearestEscapableParent;
|
|
1671
|
+
} else if (isHTMLElement(offsetParent)) {
|
|
1672
|
+
clipperElement = offsetParent;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1626
1675
|
|
|
1627
1676
|
if (!isElement(clipperElement)) {
|
|
1628
1677
|
return [];
|
|
1629
1678
|
} // @ts-ignore isElement check ensures we return Array<Element>
|
|
1630
1679
|
|
|
1631
1680
|
|
|
1632
|
-
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1681
|
+
return clippingAncestors.filter(clippingAncestors => clipperElement && isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1633
1682
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
1634
1683
|
// clipping ancestors
|
|
1635
1684
|
|
|
@@ -1682,7 +1731,7 @@ const platform = {
|
|
|
1682
1731
|
};
|
|
1683
1732
|
},
|
|
1684
1733
|
getClientRects: element => Array.from(element.getClientRects()),
|
|
1685
|
-
isRTL: element => getComputedStyle
|
|
1734
|
+
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1686
1735
|
};
|
|
1687
1736
|
|
|
1688
1737
|
/**
|
|
@@ -1696,14 +1745,11 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1696
1745
|
|
|
1697
1746
|
const {
|
|
1698
1747
|
ancestorScroll: _ancestorScroll = true,
|
|
1699
|
-
ancestorResize
|
|
1700
|
-
elementResize
|
|
1748
|
+
ancestorResize = true,
|
|
1749
|
+
elementResize = true,
|
|
1701
1750
|
animationFrame = false
|
|
1702
1751
|
} = options;
|
|
1703
|
-
let cleanedUp = false;
|
|
1704
1752
|
const ancestorScroll = _ancestorScroll && !animationFrame;
|
|
1705
|
-
const ancestorResize = _ancestorResize && !animationFrame;
|
|
1706
|
-
const elementResize = _elementResize && !animationFrame;
|
|
1707
1753
|
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
|
|
1708
1754
|
ancestors.forEach(ancestor => {
|
|
1709
1755
|
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
@@ -1714,8 +1760,15 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1714
1760
|
let observer = null;
|
|
1715
1761
|
|
|
1716
1762
|
if (elementResize) {
|
|
1717
|
-
|
|
1718
|
-
|
|
1763
|
+
let initialUpdate = true;
|
|
1764
|
+
observer = new ResizeObserver(() => {
|
|
1765
|
+
if (!initialUpdate) {
|
|
1766
|
+
update();
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
initialUpdate = false;
|
|
1770
|
+
});
|
|
1771
|
+
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
1719
1772
|
observer.observe(floating);
|
|
1720
1773
|
}
|
|
1721
1774
|
|
|
@@ -1727,10 +1780,6 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1727
1780
|
}
|
|
1728
1781
|
|
|
1729
1782
|
function frameLoop() {
|
|
1730
|
-
if (cleanedUp) {
|
|
1731
|
-
return;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
1783
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1735
1784
|
|
|
1736
1785
|
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
@@ -1741,10 +1790,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1741
1790
|
frameId = requestAnimationFrame(frameLoop);
|
|
1742
1791
|
}
|
|
1743
1792
|
|
|
1793
|
+
update();
|
|
1744
1794
|
return () => {
|
|
1745
1795
|
var _observer;
|
|
1746
1796
|
|
|
1747
|
-
cleanedUp = true;
|
|
1748
1797
|
ancestors.forEach(ancestor => {
|
|
1749
1798
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1750
1799
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
@@ -1782,10 +1831,18 @@ const CatMenu = class {
|
|
|
1782
1831
|
* The placement of the menu.
|
|
1783
1832
|
*/
|
|
1784
1833
|
this.placement = 'bottom-start';
|
|
1834
|
+
/**
|
|
1835
|
+
* Do not close the menu on outside clicks.
|
|
1836
|
+
*/
|
|
1837
|
+
this.noAutoClose = false;
|
|
1785
1838
|
}
|
|
1786
1839
|
clickHandler(event) {
|
|
1840
|
+
if (!this.trigger) {
|
|
1841
|
+
this.initTrigger();
|
|
1842
|
+
this.show();
|
|
1843
|
+
}
|
|
1787
1844
|
// hide menu on button click
|
|
1788
|
-
if (this.content && event.composedPath().includes(this.content)) {
|
|
1845
|
+
if (!this.noAutoClose && this.content && event.composedPath().includes(this.content)) {
|
|
1789
1846
|
this.close();
|
|
1790
1847
|
}
|
|
1791
1848
|
}
|
|
@@ -1798,16 +1855,7 @@ const CatMenu = class {
|
|
|
1798
1855
|
this.hide();
|
|
1799
1856
|
}
|
|
1800
1857
|
componentDidLoad() {
|
|
1801
|
-
|
|
1802
|
-
this.trigger = this.findTrigger();
|
|
1803
|
-
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-haspopup', 'true');
|
|
1804
|
-
(_b = this.trigger) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'false');
|
|
1805
|
-
(_c = this.trigger) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-controls', this.contentId);
|
|
1806
|
-
(_d = this.content) === null || _d === void 0 ? void 0 : _d.setAttribute('id', this.contentId);
|
|
1807
|
-
if (this.trigger && this.content) {
|
|
1808
|
-
(_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => this.show());
|
|
1809
|
-
autoUpdate(this.trigger, this.content, () => this.update());
|
|
1810
|
-
}
|
|
1858
|
+
this.initTrigger();
|
|
1811
1859
|
this.keyListener = event => {
|
|
1812
1860
|
if (this.content && ['ArrowDown', 'ArrowUp'].includes(event.key)) {
|
|
1813
1861
|
const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });
|
|
@@ -1832,6 +1880,21 @@ const CatMenu = class {
|
|
|
1832
1880
|
get contentId() {
|
|
1833
1881
|
return `cat-menu-${this.id}`;
|
|
1834
1882
|
}
|
|
1883
|
+
initTrigger() {
|
|
1884
|
+
var _a, _b, _c, _d, _e;
|
|
1885
|
+
this.trigger = this.findTrigger();
|
|
1886
|
+
(_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-haspopup', 'true');
|
|
1887
|
+
(_b = this.trigger) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'false');
|
|
1888
|
+
(_c = this.trigger) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-controls', this.contentId);
|
|
1889
|
+
(_d = this.content) === null || _d === void 0 ? void 0 : _d.setAttribute('id', this.contentId);
|
|
1890
|
+
if (this.trigger && this.content) {
|
|
1891
|
+
(_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => {
|
|
1892
|
+
var _a;
|
|
1893
|
+
((_a = this.trap) === null || _a === void 0 ? void 0 : _a.active) ? this.close() : this.show();
|
|
1894
|
+
});
|
|
1895
|
+
autoUpdate(this.trigger, this.content, () => this.update());
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1835
1898
|
show() {
|
|
1836
1899
|
var _a;
|
|
1837
1900
|
if (this.content) {
|
|
@@ -1845,8 +1908,10 @@ const CatMenu = class {
|
|
|
1845
1908
|
getShadowRoot: true
|
|
1846
1909
|
},
|
|
1847
1910
|
allowOutsideClick: true,
|
|
1848
|
-
clickOutsideDeactivates: event => !this.
|
|
1849
|
-
|
|
1911
|
+
clickOutsideDeactivates: event => !this.noAutoClose &&
|
|
1912
|
+
(!this.content || !event.composedPath().includes(this.content)) &&
|
|
1913
|
+
(!this.trigger || !event.composedPath().includes(this.trigger)),
|
|
1914
|
+
onPostDeactivate: () => this.close()
|
|
1850
1915
|
});
|
|
1851
1916
|
this.trap.activate();
|
|
1852
1917
|
}
|
|
@@ -1890,14 +1955,13 @@ const CatMenu = class {
|
|
|
1890
1955
|
if (!trigger) {
|
|
1891
1956
|
loglevel.error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');
|
|
1892
1957
|
}
|
|
1893
|
-
console.log(trigger);
|
|
1894
1958
|
return trigger;
|
|
1895
1959
|
}
|
|
1896
1960
|
};
|
|
1897
1961
|
CatMenu.OFFSET = 4;
|
|
1898
1962
|
CatMenu.style = catMenuCss;
|
|
1899
1963
|
|
|
1900
|
-
const catRadioCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.is-disabled input{background-color:#
|
|
1964
|
+
const catRadioCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.is-disabled input{background-color:#f2f4f7}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}";
|
|
1901
1965
|
|
|
1902
1966
|
let nextUniqueId$5 = 0;
|
|
1903
1967
|
const CatRadio = class {
|
|
@@ -3909,7 +3973,7 @@ var autosizeInput = function (element, options) {
|
|
|
3909
3973
|
}
|
|
3910
3974
|
};
|
|
3911
3975
|
|
|
3912
|
-
const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;padding:0.25rem}.select-wrapper:not(.select-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.select-wrapper:not(.select-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#
|
|
3976
|
+
const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;padding:0.25rem}.select-wrapper:not(.select-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.select-wrapper:not(.select-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));pointer-events:none}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:0.25rem;min-width:0}.select-wrapper-inner>cat-avatar{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem}.select-input{font:inherit;background:none;border:none;outline:none;padding:0.375rem 0.5rem;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0%}.pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.select-btn{transition:transform 0.13s linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:absolute;right:0;background:white;display:none;overflow:auto;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:var(--cat-border-radius-m, 0.25rem);z-index:100}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-inner{display:flex;gap:0.5rem;--cat-avatar-size:1.25rem}.select-option-text{flex:1 1 0%;min-width:0}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-wrap:break-word;word-break:break-word}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
3913
3977
|
|
|
3914
3978
|
const INIT_STATE = {
|
|
3915
3979
|
term: '',
|
|
@@ -4142,15 +4206,12 @@ const CatSelect = class {
|
|
|
4142
4206
|
.pipe(debounce(term => (term ? timer(this.debounce) : of(0))), distinctUntilChanged(), tap(() => (number$ = this.more$.pipe(filter(() => !this.state.isLoading), scan(n => n + 1, 0), startWith(0)))), tap(() => this.patchState({ options: [] })), switchMap(term => number$.pipe(tap(() => this.patchState({ isLoading: true })), switchMap(number => this.connectorSafe.retrieve(term, number)), tap(page => this.patchState({ isLoading: false, totalElements: page.totalElements })), takeWhile(page => !page.last, true), scan((items, page) => [...items, ...page.content], []))))
|
|
4143
4207
|
.subscribe(items => {
|
|
4144
4208
|
var _a;
|
|
4145
|
-
const options =
|
|
4146
|
-
item: Object.assign(Object.assign({}, item), { id: this.connectorSafe.customId ? this.connectorSafe.customId(item) : item.id }),
|
|
4147
|
-
render: this.connectorSafe.render(item)
|
|
4148
|
-
}));
|
|
4209
|
+
const options = this.toSelectItems(items);
|
|
4149
4210
|
if (this.tags &&
|
|
4150
4211
|
this.state.term.trim().length &&
|
|
4151
4212
|
!options.find(value1 => value1.render.label.toLowerCase() === this.state.term.toLowerCase())) {
|
|
4152
4213
|
let label;
|
|
4153
|
-
if (this.
|
|
4214
|
+
if (this.isTagSelected(this.state.term)) {
|
|
4154
4215
|
label = (_a = this.state.selection.find(item => item.render.label.toLowerCase() === this.state.term.toLowerCase())) === null || _a === void 0 ? void 0 : _a.render.label;
|
|
4155
4216
|
}
|
|
4156
4217
|
options.unshift({
|
|
@@ -4179,19 +4240,14 @@ const CatSelect = class {
|
|
|
4179
4240
|
get optionsList() {
|
|
4180
4241
|
return this.state.options.map((item, i) => {
|
|
4181
4242
|
const isTagOption = this.tags && item.item.id === `select-${this.id}-option-tag`;
|
|
4182
|
-
const
|
|
4183
|
-
if (isTagOption) {
|
|
4184
|
-
return this.isAlreadyCreated(item.render.label) ? 'true' : 'false';
|
|
4185
|
-
}
|
|
4186
|
-
return this.isSelected(item.item.id) ? 'true' : 'false';
|
|
4187
|
-
};
|
|
4243
|
+
const isOptionSelected = this.isSelected(item.item.id) || (this.tags && this.isTagSelected(item.render.label));
|
|
4188
4244
|
const getLabel = () => {
|
|
4189
4245
|
if (isTagOption) {
|
|
4190
4246
|
return item.render.label + this.tagTextHelp;
|
|
4191
4247
|
}
|
|
4192
4248
|
return item.render.label;
|
|
4193
4249
|
};
|
|
4194
|
-
return (h("li", { role: "option", class: "select-option", id: `select-${this.id}-option-${i}`, "aria-selected":
|
|
4250
|
+
return (h("li", { role: "option", class: "select-option", id: `select-${this.id}-option-${i}`, "aria-selected": isOptionSelected ? 'true' : 'false' }, this.multiple ? (h("cat-checkbox", { class: { 'select-option-active': this.state.activeOptionIndex === i }, checked: isOptionSelected, tabIndex: -1, labelLeft: true, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onCatChange: e => {
|
|
4195
4251
|
!isTagOption ? this.toggle(item) : this.toggleTag(item);
|
|
4196
4252
|
e.stopPropagation();
|
|
4197
4253
|
} }, h("span", { slot: "label", class: "select-option-inner" }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, initials: '' })) : null, h("span", { class: "select-option-text" }, h("span", { class: "select-option-label" }, getLabel()), h("span", { class: "select-option-description" }, item.render.description))))) : (h("div", { class: {
|
|
@@ -4220,9 +4276,9 @@ const CatSelect = class {
|
|
|
4220
4276
|
}
|
|
4221
4277
|
const data$ = ids.length ? this.connectorSafe.resolve(ids).pipe(first()) : of([]);
|
|
4222
4278
|
data$.pipe(catchError(() => of([]))).subscribe(items => {
|
|
4223
|
-
const selection = items.length ?
|
|
4279
|
+
const selection = items.length ? this.toSelectItems(items) : [];
|
|
4224
4280
|
if (this.tags) {
|
|
4225
|
-
tags === null || tags === void 0 ? void 0 : tags.forEach((tag, index) => {
|
|
4281
|
+
tags === null || tags === void 0 ? void 0 : tags.filter(tag => !this.isTagSelected(tag, selection)).forEach((tag, index) => {
|
|
4226
4282
|
const item = { id: `select-${this.id}-tag-${index}`, name: tag };
|
|
4227
4283
|
selection.push({ item, render: { label: item.name } });
|
|
4228
4284
|
});
|
|
@@ -4234,6 +4290,12 @@ const CatSelect = class {
|
|
|
4234
4290
|
});
|
|
4235
4291
|
});
|
|
4236
4292
|
}
|
|
4293
|
+
toSelectItems(items) {
|
|
4294
|
+
return items === null || items === void 0 ? void 0 : items.map(item => ({
|
|
4295
|
+
item: Object.assign(Object.assign({}, item), { id: this.connectorSafe.customId ? this.connectorSafe.customId(item) : item.id }),
|
|
4296
|
+
render: this.connectorSafe.render(item)
|
|
4297
|
+
}));
|
|
4298
|
+
}
|
|
4237
4299
|
show() {
|
|
4238
4300
|
var _a;
|
|
4239
4301
|
if (!this.state.isOpen) {
|
|
@@ -4284,7 +4346,11 @@ const CatSelect = class {
|
|
|
4284
4346
|
}
|
|
4285
4347
|
}
|
|
4286
4348
|
toggle(item) {
|
|
4287
|
-
this.isSelected(item.item.id)
|
|
4349
|
+
this.isSelected(item.item.id)
|
|
4350
|
+
? this.deselect(item.item.id)
|
|
4351
|
+
: this.tags && this.isTagSelected(item.render.label)
|
|
4352
|
+
? this.removeTag(item.render.label)
|
|
4353
|
+
: this.select(item);
|
|
4288
4354
|
}
|
|
4289
4355
|
clear() {
|
|
4290
4356
|
if (this.input && this.state.term) {
|
|
@@ -4411,13 +4477,13 @@ const CatSelect = class {
|
|
|
4411
4477
|
}
|
|
4412
4478
|
}
|
|
4413
4479
|
get tagTextHelp() {
|
|
4414
|
-
return this.tagHint && !this.
|
|
4480
|
+
return this.tagHint && !this.isTagSelected(this.state.term) ? ' (' + this.tagHint + ')' : '';
|
|
4415
4481
|
}
|
|
4416
|
-
|
|
4417
|
-
return
|
|
4482
|
+
isTagSelected(term, selection = this.state.selection) {
|
|
4483
|
+
return selection.findIndex(item => item.render.label.toLowerCase() === term.toLowerCase()) >= 0;
|
|
4418
4484
|
}
|
|
4419
4485
|
createTag(term) {
|
|
4420
|
-
if (term.trim().length && !this.
|
|
4486
|
+
if (term.trim().length && !this.isTagSelected(term)) {
|
|
4421
4487
|
const value = this.value;
|
|
4422
4488
|
const tags = value === null || value === void 0 ? void 0 : value.tags;
|
|
4423
4489
|
const tag = { id: `select-${this.id}-tag-${tags ? tags.length : 0}`, name: term };
|
|
@@ -4425,6 +4491,15 @@ const CatSelect = class {
|
|
|
4425
4491
|
}
|
|
4426
4492
|
this.setTransparentCaret();
|
|
4427
4493
|
}
|
|
4494
|
+
removeTag(label) {
|
|
4495
|
+
if (this.isTagSelected(label)) {
|
|
4496
|
+
const item = this.state.selection.find(item => item.render.label.toLowerCase() === label.toLowerCase());
|
|
4497
|
+
item && this.deselect(item.item.id);
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4500
|
+
toggleTag(item) {
|
|
4501
|
+
this.isTagSelected(item.render.label) ? this.removeTag(item.render.label) : this.createTag(item.render.label);
|
|
4502
|
+
}
|
|
4428
4503
|
initIds() {
|
|
4429
4504
|
let ids = [];
|
|
4430
4505
|
if (this.value) {
|
|
@@ -4463,15 +4538,6 @@ const CatSelect = class {
|
|
|
4463
4538
|
}
|
|
4464
4539
|
return tags;
|
|
4465
4540
|
}
|
|
4466
|
-
toggleTag(item) {
|
|
4467
|
-
this.isAlreadyCreated(item.render.label) ? this.removeTag(item.render.label) : this.createTag(item.render.label);
|
|
4468
|
-
}
|
|
4469
|
-
removeTag(label) {
|
|
4470
|
-
if (this.isAlreadyCreated(label)) {
|
|
4471
|
-
const item = this.state.selection.find(item => item.render.label.toLowerCase() === label.toLowerCase());
|
|
4472
|
-
item && this.deselect(item.item.id);
|
|
4473
|
-
}
|
|
4474
|
-
}
|
|
4475
4541
|
setTransparentCaret() {
|
|
4476
4542
|
var _a;
|
|
4477
4543
|
if (!this.multiple) {
|
|
@@ -4559,7 +4625,7 @@ const CatSelectTest = class {
|
|
|
4559
4625
|
}
|
|
4560
4626
|
})
|
|
4561
4627
|
});
|
|
4562
|
-
(_c = this.multipleSelectTagging) === null || _c === void 0 ? void 0 : _c.connect(
|
|
4628
|
+
(_c = this.multipleSelectTagging) === null || _c === void 0 ? void 0 : _c.connect(this.countryConnector);
|
|
4563
4629
|
(_d = this.singleSelect) === null || _d === void 0 ? void 0 : _d.connect({
|
|
4564
4630
|
resolve: (ids) => {
|
|
4565
4631
|
console.info(`Resolving data... (${ids.join(', ')})`);
|
|
@@ -4594,7 +4660,7 @@ const CatSelectTest = class {
|
|
|
4594
4660
|
(_f = this.singleSelectTagging) === null || _f === void 0 ? void 0 : _f.connect(this.countryConnector);
|
|
4595
4661
|
}
|
|
4596
4662
|
render() {
|
|
4597
|
-
return (h(Host, { style: { display: 'flex', flexDirection: 'column' } }, h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => { var _a; return console.log((_a = this.multipleSelect) === null || _a === void 0 ? void 0 : _a.value); }, onCatBlur: e => console.log('Multiple blur', e), multiple: true, clearable: true }, h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true }), h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania'] }, placeholder: "Select country", onCatChange: () => { var _a; return console.log((_a = this.multipleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, multiple: true, tags: true, clearable: true }), h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true }), h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', onCatChange: () => { var _a; return console.log((_a = this.singleSelectAvatar) === null || _a === void 0 ? void 0 : _a.value); }, placeholder: "Search for a country or capital", clearable: true }), h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '
|
|
4663
|
+
return (h(Host, { style: { display: 'flex', flexDirection: 'column' } }, h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => { var _a; return console.log((_a = this.multipleSelect) === null || _a === void 0 ? void 0 : _a.value); }, onCatBlur: e => console.log('Multiple blur', e), multiple: true, clearable: true }, h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true }), h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => { var _a; return console.log((_a = this.multipleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, multiple: true, tags: true, clearable: true }), h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true }), h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', onCatChange: () => { var _a; return console.log((_a = this.singleSelectAvatar) === null || _a === void 0 ? void 0 : _a.value); }, placeholder: "Search for a country or capital", clearable: true }), h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => { var _a; return console.log('Single', (_a = this.singleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, tagHint: "new country", tags: true, clearable: true })));
|
|
4598
4664
|
}
|
|
4599
4665
|
get countryConnector() {
|
|
4600
4666
|
return {
|
|
@@ -6030,7 +6096,7 @@ CatTabs.style = catTabsCss;
|
|
|
6030
6096
|
|
|
6031
6097
|
var e,t,n="function"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o));},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1));}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test");}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t};}function r(e){var t=n.get(e);t&&t.destroy();}function i(e){var t=n.get(e);t&&t.update();}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c();},a=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n];}),n.delete(e);}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c();}function u(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t;}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop;}),n&&(document.documentElement.scrollTop=n);}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(u("scroll"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(u("hidden"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o("autosize:resized");try{e.dispatchEvent(i);}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;
|
|
6032
6098
|
|
|
6033
|
-
const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}textarea:disabled{background:#
|
|
6099
|
+
const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}textarea:disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
6034
6100
|
|
|
6035
6101
|
let nextUniqueId$2 = 0;
|
|
6036
6102
|
const CatTextarea = class {
|