@haiilo/catalyst 0.2.1 → 0.3.1
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 +2 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -0
- package/dist/catalyst/index.esm.js +2 -0
- package/dist/catalyst/index.esm.js.map +1 -0
- package/dist/catalyst/p-31b500c7.entry.js +10 -0
- package/dist/catalyst/p-31b500c7.entry.js.map +1 -0
- package/dist/catalyst/p-ed826597.js +2 -0
- package/dist/catalyst/p-ed826597.js.map +1 -0
- package/dist/catalyst/p-ef0a8ae9.js +2 -0
- package/dist/catalyst/p-ef0a8ae9.js.map +1 -0
- package/dist/catalyst/p-f151cb13.js +2 -0
- package/dist/catalyst/p-f151cb13.js.map +1 -0
- package/dist/cjs/{app-globals-814f34aa.js → app-globals-7f2b1f8e.js} +39 -1
- package/dist/cjs/app-globals-7f2b1f8e.js.map +1 -0
- package/dist/cjs/{cat-alert_7.cjs.entry.js → cat-alert_8.cjs.entry.js} +1370 -35
- package/dist/cjs/cat-alert_8.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-icon-registry-850c538c.js +47 -0
- package/dist/cjs/cat-icon-registry-850c538c.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +7 -4
- package/dist/cjs/catalyst.cjs.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-909e38e7.js → index-c0881ae0.js} +6 -43
- package/dist/cjs/index-c0881ae0.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +7 -4
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/cat-alert/cat-alert.js +1 -0
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -0
- package/dist/collection/components/cat-badge/cat-badge.css +4 -4
- package/dist/collection/components/cat-badge/cat-badge.js +1 -0
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -0
- package/dist/collection/components/cat-button/cat-button.css +12 -8
- package/dist/collection/components/cat-button/cat-button.js +1 -0
- package/dist/collection/components/cat-button/cat-button.js.map +1 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -0
- package/dist/collection/components/cat-icon/cat-icon.js +1 -0
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -0
- package/dist/collection/components/cat-menu/cat-menu.js +1 -0
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +69 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +309 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -0
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -0
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -0
- package/dist/collection/components/cat-spinner/cat-spinner.js +1 -0
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -0
- package/dist/collection/index.js +2 -1
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/init.js +1 -0
- package/dist/collection/init.js.map +1 -0
- package/dist/collection/utils/breakpoints.js +1 -0
- package/dist/collection/utils/breakpoints.js.map +1 -0
- package/dist/collection/utils/media-matcher.js +1 -0
- package/dist/collection/utils/media-matcher.js.map +1 -0
- package/dist/collection/utils/platform.js +1 -0
- package/dist/collection/utils/platform.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/cat-alert.js +2 -0
- package/dist/components/cat-alert.js.map +1 -0
- package/dist/components/cat-badge.js +3 -1
- package/dist/components/cat-badge.js.map +1 -0
- package/dist/components/cat-button.js +3 -1
- package/dist/components/cat-button.js.map +1 -0
- package/dist/components/cat-icon-registry.js +2 -0
- package/dist/components/cat-icon-registry.js.map +1 -0
- package/dist/components/cat-icon.js +2 -0
- package/dist/components/cat-icon.js.map +1 -0
- package/dist/components/cat-icon2.js +2 -0
- package/dist/components/cat-icon2.js.map +1 -0
- package/dist/components/cat-menu.js +6 -5
- package/dist/components/cat-menu.js.map +1 -0
- package/dist/components/cat-scrollable.d.ts +11 -0
- package/dist/components/cat-scrollable.js +1363 -0
- package/dist/components/cat-scrollable.js.map +1 -0
- package/dist/components/cat-skeleton.js +2 -0
- package/dist/components/cat-skeleton.js.map +1 -0
- package/dist/components/cat-spinner.js +2 -0
- package/dist/components/cat-spinner.js.map +1 -0
- package/dist/components/cat-spinner2.js +2 -0
- package/dist/components/cat-spinner2.js.map +1 -0
- package/dist/components/index.js +39 -0
- package/dist/components/index.js.map +1 -0
- package/dist/esm/{app-globals-e1679c2d.js → app-globals-8af9b2cf.js} +39 -1
- package/dist/esm/app-globals-8af9b2cf.js.map +1 -0
- package/dist/esm/{cat-alert_7.entry.js → cat-alert_8.entry.js} +1343 -9
- package/dist/esm/cat-alert_8.entry.js.map +1 -0
- package/dist/esm/cat-icon-registry-59da2e37.js +45 -0
- package/dist/esm/cat-icon-registry-59da2e37.js.map +1 -0
- package/dist/esm/catalyst.js +6 -3
- package/dist/esm/catalyst.js.map +1 -0
- package/dist/esm/{cat-icon-registry-4d02ee6c.js → index-0ff35bca.js} +5 -42
- package/dist/esm/index-0ff35bca.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +50 -0
- package/dist/types/components.d.ts +85 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +12 -16
- package/dist/catalyst/p-22fac0fb.js +0 -1
- package/dist/catalyst/p-2dc28db3.entry.js +0 -11
- package/dist/catalyst/p-e08f13c7.js +0 -1
|
@@ -2,32 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const index = require('./index-c0881ae0.js');
|
|
6
|
+
const catIconRegistry = require('./cat-icon-registry-850c538c.js');
|
|
6
7
|
|
|
7
8
|
const catAlertCss = ":host{display:block;margin-bottom:1rem}:host([hidden]){display:none}.cat-alert{font:inherit;color:rgb(var(--text));background-color:rgba(var(--bg), 0.1);box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);border-radius:0.25rem;padding:0.75rem 1rem;width:100%}::slotted(:last-child){margin-bottom:0 !important}.cat-alert-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.cat-alert-secondary{--bg:105, 118, 135;--text:0, 0, 0;--border:105, 118, 135}.cat-alert-success{--bg:0, 132, 88;--text:0, 132, 88;--border:0, 132, 88}.cat-alert-warning{--bg:255, 206, 128;--text:159, 97, 0;--border:159, 97, 0}.cat-alert-danger{--bg:217, 52, 13;--text:217, 52, 13;--border:217, 52, 13}";
|
|
8
9
|
|
|
9
10
|
const CatAlert = class {
|
|
10
11
|
constructor(hostRef) {
|
|
11
|
-
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
12
13
|
/**
|
|
13
14
|
* The color palette of the alert.
|
|
14
15
|
*/
|
|
15
16
|
this.color = 'primary';
|
|
16
17
|
}
|
|
17
18
|
render() {
|
|
18
|
-
return (
|
|
19
|
+
return (index.h("div", { part: "alert", class: {
|
|
19
20
|
'cat-alert': true,
|
|
20
21
|
[`cat-alert-${this.color}`]: Boolean(this.color)
|
|
21
|
-
} },
|
|
22
|
+
} }, index.h("slot", null)));
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
CatAlert.style = catAlertCss;
|
|
25
26
|
|
|
26
|
-
const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.cat-badge{font:inherit;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:0.125rem;text-decoration:none;width:100%;box-sizing:border-box;line-height:1;white-space:nowrap}.cat-badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-badge-round{border-radius:10rem}.cat-badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.cat-badge-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.cat-badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.cat-badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.cat-badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.cat-badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.cat-badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0 0.1875rem}.cat-badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}.cat-badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0 0.3125rem}.cat-badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0 0.375rem}.cat-badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:0 0.4375rem}.cat-badge-pulse.cat-badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.cat-badge-pulse.cat-badge-outlined{animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent
|
|
27
|
+
const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.cat-badge{font:inherit;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:0.125rem;text-decoration:none;width:100%;box-sizing:border-box;line-height:1;white-space:nowrap}.cat-badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-badge-round{border-radius:10rem}.cat-badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.cat-badge-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.cat-badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.cat-badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.cat-badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.cat-badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.cat-badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0 0.1875rem}.cat-badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}.cat-badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0 0.3125rem}.cat-badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0 0.375rem}.cat-badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:0 0.4375rem}.cat-badge-pulse.cat-badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.cat-badge-pulse.cat-badge-outlined{animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--border), 0.2)}70%{box-shadow:transparent 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--border), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--border), 0.2)}}";
|
|
27
28
|
|
|
28
29
|
const CatBadge = class {
|
|
29
30
|
constructor(hostRef) {
|
|
30
|
-
|
|
31
|
+
index.registerInstance(this, hostRef);
|
|
31
32
|
/**
|
|
32
33
|
* The rendering style of the badge.
|
|
33
34
|
*/
|
|
@@ -50,14 +51,14 @@ const CatBadge = class {
|
|
|
50
51
|
this.pulse = false;
|
|
51
52
|
}
|
|
52
53
|
render() {
|
|
53
|
-
return (
|
|
54
|
+
return (index.h("span", { part: "badge", class: {
|
|
54
55
|
'cat-badge': true,
|
|
55
56
|
'cat-badge-round': this.round,
|
|
56
57
|
'cat-badge-pulse': this.pulse,
|
|
57
58
|
[`cat-badge-${this.variant}`]: Boolean(this.variant),
|
|
58
59
|
[`cat-badge-${this.color}`]: Boolean(this.color),
|
|
59
60
|
[`cat-badge-${this.size}`]: Boolean(this.size)
|
|
60
|
-
} },
|
|
61
|
+
} }, index.h("slot", null)));
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
64
|
CatBadge.style = catBadgeCss;
|
|
@@ -489,14 +490,14 @@ function createEmptyStyleRule(query) {
|
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
492
|
|
|
492
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}
|
|
493
|
+
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cat-button{font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius: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 #0071ff;outline-offset:1px}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.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-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.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:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:underline}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.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:1rem;padding-right:1rem}.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:1rem;padding-right:1rem}.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:1rem;padding-right:1rem}.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:1rem;padding-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:1rem;padding-right:1rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host-context(nav) .cat-button-content{text-align:left}:host([hidden]){display:none}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
|
|
493
494
|
|
|
494
495
|
const CatButton = class {
|
|
495
496
|
constructor(hostRef) {
|
|
496
|
-
|
|
497
|
-
this.catClick =
|
|
498
|
-
this.catFocus =
|
|
499
|
-
this.catBlur =
|
|
497
|
+
index.registerInstance(this, hostRef);
|
|
498
|
+
this.catClick = index.createEvent(this, "catClick", 7);
|
|
499
|
+
this.catFocus = index.createEvent(this, "catFocus", 7);
|
|
500
|
+
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
500
501
|
this._iconOnly = true;
|
|
501
502
|
/**
|
|
502
503
|
* The rendering style of the button.
|
|
@@ -587,7 +588,7 @@ const CatButton = class {
|
|
|
587
588
|
render() {
|
|
588
589
|
var _a;
|
|
589
590
|
if (this.url) {
|
|
590
|
-
return (
|
|
591
|
+
return (index.h("a", { ref: el => (this.button = el), href: this.disabled ? undefined : this.url, target: this.urlTarget, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
|
|
591
592
|
'cat-button': true,
|
|
592
593
|
'cat-button-icon': this.isIconButton,
|
|
593
594
|
'cat-button-round': this.round,
|
|
@@ -600,7 +601,7 @@ const CatButton = class {
|
|
|
600
601
|
}, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
601
602
|
}
|
|
602
603
|
else {
|
|
603
|
-
return (
|
|
604
|
+
return (index.h("button", { ref: el => (this.button = el), type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
|
|
604
605
|
'cat-button': true,
|
|
605
606
|
'cat-button-icon': this.isIconButton,
|
|
606
607
|
'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
|
|
@@ -640,10 +641,10 @@ const CatButton = class {
|
|
|
640
641
|
}
|
|
641
642
|
get content() {
|
|
642
643
|
return [
|
|
643
|
-
this.hasPrefixIcon ? (
|
|
644
|
-
this.isIconButton ? (
|
|
645
|
-
this.hasSuffixIcon ? (
|
|
646
|
-
this.loading ?
|
|
644
|
+
this.hasPrefixIcon ? (index.h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-prefix", part: "prefix" })) : null,
|
|
645
|
+
this.isIconButton ? (index.h("cat-icon", { icon: this.icon, size: this.iconSize })) : (index.h("span", { class: "cat-button-content", part: "content" }, index.h("slot", null))),
|
|
646
|
+
this.hasSuffixIcon ? (index.h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-suffix", part: "suffix" })) : null,
|
|
647
|
+
this.loading ? index.h("cat-spinner", { size: this.spinnerSize }) : null
|
|
647
648
|
];
|
|
648
649
|
}
|
|
649
650
|
onClick(event) {
|
|
@@ -665,7 +666,7 @@ const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user
|
|
|
665
666
|
|
|
666
667
|
const CatIcon = class {
|
|
667
668
|
constructor(hostRef) {
|
|
668
|
-
|
|
669
|
+
index.registerInstance(this, hostRef);
|
|
669
670
|
this.iconRegistry = catIconRegistry.CatIconRegistry.getInstance();
|
|
670
671
|
/**
|
|
671
672
|
* The name of the icon.
|
|
@@ -677,7 +678,7 @@ const CatIcon = class {
|
|
|
677
678
|
this.size = 'm';
|
|
678
679
|
}
|
|
679
680
|
render() {
|
|
680
|
-
return (
|
|
681
|
+
return (index.h("span", { innerHTML: this.iconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
681
682
|
[`cat-icon-${this.size}`]: this.size !== 'inline'
|
|
682
683
|
} }));
|
|
683
684
|
}
|
|
@@ -1069,9 +1070,9 @@ const flip = function (options) {
|
|
|
1069
1070
|
switch (fallbackStrategy) {
|
|
1070
1071
|
case 'bestFit':
|
|
1071
1072
|
{
|
|
1072
|
-
var _overflowsData$
|
|
1073
|
+
var _overflowsData$map$so;
|
|
1073
1074
|
|
|
1074
|
-
const placement = (_overflowsData$
|
|
1075
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
|
1075
1076
|
|
|
1076
1077
|
if (placement) {
|
|
1077
1078
|
resetPlacement = placement;
|
|
@@ -1112,14 +1113,13 @@ function convertValueToCoords(placement, rects, value, rtl) {
|
|
|
1112
1113
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1113
1114
|
const rawValue = typeof value === 'function' ? value({ ...rects,
|
|
1114
1115
|
placement
|
|
1115
|
-
}) : value;
|
|
1116
|
-
const isNumber = typeof rawValue === 'number'; // eslint-disable-next-line prefer-const
|
|
1116
|
+
}) : value; // eslint-disable-next-line prefer-const
|
|
1117
1117
|
|
|
1118
1118
|
let {
|
|
1119
1119
|
mainAxis,
|
|
1120
1120
|
crossAxis,
|
|
1121
1121
|
alignmentAxis
|
|
1122
|
-
} =
|
|
1122
|
+
} = typeof rawValue === 'number' ? {
|
|
1123
1123
|
mainAxis: rawValue,
|
|
1124
1124
|
crossAxis: 0,
|
|
1125
1125
|
alignmentAxis: null
|
|
@@ -2937,9 +2937,9 @@ const catMenuCss = ":host{display:inline-block}:host([hidden]){display:none}.con
|
|
|
2937
2937
|
let nextUniqueId = 0;
|
|
2938
2938
|
const CatMenu = class {
|
|
2939
2939
|
constructor(hostRef) {
|
|
2940
|
-
|
|
2941
|
-
this.catOpen =
|
|
2942
|
-
this.catClose =
|
|
2940
|
+
index.registerInstance(this, hostRef);
|
|
2941
|
+
this.catOpen = index.createEvent(this, "catOpen", 7);
|
|
2942
|
+
this.catClose = index.createEvent(this, "catClose", 7);
|
|
2943
2943
|
this.id = nextUniqueId++;
|
|
2944
2944
|
/**
|
|
2945
2945
|
* The placement of the menu.
|
|
@@ -2984,7 +2984,7 @@ const CatMenu = class {
|
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
render() {
|
|
2987
|
-
return (
|
|
2987
|
+
return (index.h(index.Host, null, index.h("slot", { name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { class: "content", ref: el => (this.content = el) }, index.h("slot", { name: "content" }))));
|
|
2988
2988
|
}
|
|
2989
2989
|
get contentId() {
|
|
2990
2990
|
return `cat-menu-${this.id}`;
|
|
@@ -3038,11 +3038,1343 @@ const CatMenu = class {
|
|
|
3038
3038
|
CatMenu.OFFSET = 4;
|
|
3039
3039
|
CatMenu.style = catMenuCss;
|
|
3040
3040
|
|
|
3041
|
+
function isFunction(value) {
|
|
3042
|
+
return typeof value === 'function';
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
function createErrorClass(createImpl) {
|
|
3046
|
+
const _super = (instance) => {
|
|
3047
|
+
Error.call(instance);
|
|
3048
|
+
instance.stack = new Error().stack;
|
|
3049
|
+
};
|
|
3050
|
+
const ctorFunc = createImpl(_super);
|
|
3051
|
+
ctorFunc.prototype = Object.create(Error.prototype);
|
|
3052
|
+
ctorFunc.prototype.constructor = ctorFunc;
|
|
3053
|
+
return ctorFunc;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
|
|
3057
|
+
_super(this);
|
|
3058
|
+
this.message = errors
|
|
3059
|
+
? `${errors.length} errors occurred during unsubscription:
|
|
3060
|
+
${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}`
|
|
3061
|
+
: '';
|
|
3062
|
+
this.name = 'UnsubscriptionError';
|
|
3063
|
+
this.errors = errors;
|
|
3064
|
+
});
|
|
3065
|
+
|
|
3066
|
+
function arrRemove(arr, item) {
|
|
3067
|
+
if (arr) {
|
|
3068
|
+
const index = arr.indexOf(item);
|
|
3069
|
+
0 <= index && arr.splice(index, 1);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
class Subscription {
|
|
3074
|
+
constructor(initialTeardown) {
|
|
3075
|
+
this.initialTeardown = initialTeardown;
|
|
3076
|
+
this.closed = false;
|
|
3077
|
+
this._parentage = null;
|
|
3078
|
+
this._finalizers = null;
|
|
3079
|
+
}
|
|
3080
|
+
unsubscribe() {
|
|
3081
|
+
let errors;
|
|
3082
|
+
if (!this.closed) {
|
|
3083
|
+
this.closed = true;
|
|
3084
|
+
const { _parentage } = this;
|
|
3085
|
+
if (_parentage) {
|
|
3086
|
+
this._parentage = null;
|
|
3087
|
+
if (Array.isArray(_parentage)) {
|
|
3088
|
+
for (const parent of _parentage) {
|
|
3089
|
+
parent.remove(this);
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
else {
|
|
3093
|
+
_parentage.remove(this);
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
const { initialTeardown: initialFinalizer } = this;
|
|
3097
|
+
if (isFunction(initialFinalizer)) {
|
|
3098
|
+
try {
|
|
3099
|
+
initialFinalizer();
|
|
3100
|
+
}
|
|
3101
|
+
catch (e) {
|
|
3102
|
+
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
const { _finalizers } = this;
|
|
3106
|
+
if (_finalizers) {
|
|
3107
|
+
this._finalizers = null;
|
|
3108
|
+
for (const finalizer of _finalizers) {
|
|
3109
|
+
try {
|
|
3110
|
+
execFinalizer(finalizer);
|
|
3111
|
+
}
|
|
3112
|
+
catch (err) {
|
|
3113
|
+
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
3114
|
+
if (err instanceof UnsubscriptionError) {
|
|
3115
|
+
errors = [...errors, ...err.errors];
|
|
3116
|
+
}
|
|
3117
|
+
else {
|
|
3118
|
+
errors.push(err);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
if (errors) {
|
|
3124
|
+
throw new UnsubscriptionError(errors);
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
add(teardown) {
|
|
3129
|
+
var _a;
|
|
3130
|
+
if (teardown && teardown !== this) {
|
|
3131
|
+
if (this.closed) {
|
|
3132
|
+
execFinalizer(teardown);
|
|
3133
|
+
}
|
|
3134
|
+
else {
|
|
3135
|
+
if (teardown instanceof Subscription) {
|
|
3136
|
+
if (teardown.closed || teardown._hasParent(this)) {
|
|
3137
|
+
return;
|
|
3138
|
+
}
|
|
3139
|
+
teardown._addParent(this);
|
|
3140
|
+
}
|
|
3141
|
+
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
_hasParent(parent) {
|
|
3146
|
+
const { _parentage } = this;
|
|
3147
|
+
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
3148
|
+
}
|
|
3149
|
+
_addParent(parent) {
|
|
3150
|
+
const { _parentage } = this;
|
|
3151
|
+
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
3152
|
+
}
|
|
3153
|
+
_removeParent(parent) {
|
|
3154
|
+
const { _parentage } = this;
|
|
3155
|
+
if (_parentage === parent) {
|
|
3156
|
+
this._parentage = null;
|
|
3157
|
+
}
|
|
3158
|
+
else if (Array.isArray(_parentage)) {
|
|
3159
|
+
arrRemove(_parentage, parent);
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
remove(teardown) {
|
|
3163
|
+
const { _finalizers } = this;
|
|
3164
|
+
_finalizers && arrRemove(_finalizers, teardown);
|
|
3165
|
+
if (teardown instanceof Subscription) {
|
|
3166
|
+
teardown._removeParent(this);
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
Subscription.EMPTY = (() => {
|
|
3171
|
+
const empty = new Subscription();
|
|
3172
|
+
empty.closed = true;
|
|
3173
|
+
return empty;
|
|
3174
|
+
})();
|
|
3175
|
+
const EMPTY_SUBSCRIPTION = Subscription.EMPTY;
|
|
3176
|
+
function isSubscription(value) {
|
|
3177
|
+
return (value instanceof Subscription ||
|
|
3178
|
+
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
3179
|
+
}
|
|
3180
|
+
function execFinalizer(finalizer) {
|
|
3181
|
+
if (isFunction(finalizer)) {
|
|
3182
|
+
finalizer();
|
|
3183
|
+
}
|
|
3184
|
+
else {
|
|
3185
|
+
finalizer.unsubscribe();
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
const config = {
|
|
3190
|
+
onUnhandledError: null,
|
|
3191
|
+
onStoppedNotification: null,
|
|
3192
|
+
Promise: undefined,
|
|
3193
|
+
useDeprecatedSynchronousErrorHandling: false,
|
|
3194
|
+
useDeprecatedNextContext: false,
|
|
3195
|
+
};
|
|
3196
|
+
|
|
3197
|
+
const timeoutProvider = {
|
|
3198
|
+
setTimeout(handler, timeout, ...args) {
|
|
3199
|
+
const { delegate } = timeoutProvider;
|
|
3200
|
+
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
3201
|
+
return delegate.setTimeout(handler, timeout, ...args);
|
|
3202
|
+
}
|
|
3203
|
+
return setTimeout(handler, timeout, ...args);
|
|
3204
|
+
},
|
|
3205
|
+
clearTimeout(handle) {
|
|
3206
|
+
const { delegate } = timeoutProvider;
|
|
3207
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
3208
|
+
},
|
|
3209
|
+
delegate: undefined,
|
|
3210
|
+
};
|
|
3211
|
+
|
|
3212
|
+
function reportUnhandledError(err) {
|
|
3213
|
+
timeoutProvider.setTimeout(() => {
|
|
3214
|
+
const { onUnhandledError } = config;
|
|
3215
|
+
if (onUnhandledError) {
|
|
3216
|
+
onUnhandledError(err);
|
|
3217
|
+
}
|
|
3218
|
+
else {
|
|
3219
|
+
throw err;
|
|
3220
|
+
}
|
|
3221
|
+
});
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
function noop() { }
|
|
3225
|
+
|
|
3226
|
+
const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();
|
|
3227
|
+
function errorNotification(error) {
|
|
3228
|
+
return createNotification('E', undefined, error);
|
|
3229
|
+
}
|
|
3230
|
+
function nextNotification(value) {
|
|
3231
|
+
return createNotification('N', value, undefined);
|
|
3232
|
+
}
|
|
3233
|
+
function createNotification(kind, value, error) {
|
|
3234
|
+
return {
|
|
3235
|
+
kind,
|
|
3236
|
+
value,
|
|
3237
|
+
error,
|
|
3238
|
+
};
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
function errorContext(cb) {
|
|
3242
|
+
{
|
|
3243
|
+
cb();
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
class Subscriber extends Subscription {
|
|
3248
|
+
constructor(destination) {
|
|
3249
|
+
super();
|
|
3250
|
+
this.isStopped = false;
|
|
3251
|
+
if (destination) {
|
|
3252
|
+
this.destination = destination;
|
|
3253
|
+
if (isSubscription(destination)) {
|
|
3254
|
+
destination.add(this);
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
else {
|
|
3258
|
+
this.destination = EMPTY_OBSERVER;
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
static create(next, error, complete) {
|
|
3262
|
+
return new SafeSubscriber(next, error, complete);
|
|
3263
|
+
}
|
|
3264
|
+
next(value) {
|
|
3265
|
+
if (this.isStopped) {
|
|
3266
|
+
handleStoppedNotification(nextNotification(value), this);
|
|
3267
|
+
}
|
|
3268
|
+
else {
|
|
3269
|
+
this._next(value);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
error(err) {
|
|
3273
|
+
if (this.isStopped) {
|
|
3274
|
+
handleStoppedNotification(errorNotification(err), this);
|
|
3275
|
+
}
|
|
3276
|
+
else {
|
|
3277
|
+
this.isStopped = true;
|
|
3278
|
+
this._error(err);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
complete() {
|
|
3282
|
+
if (this.isStopped) {
|
|
3283
|
+
handleStoppedNotification(COMPLETE_NOTIFICATION, this);
|
|
3284
|
+
}
|
|
3285
|
+
else {
|
|
3286
|
+
this.isStopped = true;
|
|
3287
|
+
this._complete();
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
unsubscribe() {
|
|
3291
|
+
if (!this.closed) {
|
|
3292
|
+
this.isStopped = true;
|
|
3293
|
+
super.unsubscribe();
|
|
3294
|
+
this.destination = null;
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
_next(value) {
|
|
3298
|
+
this.destination.next(value);
|
|
3299
|
+
}
|
|
3300
|
+
_error(err) {
|
|
3301
|
+
try {
|
|
3302
|
+
this.destination.error(err);
|
|
3303
|
+
}
|
|
3304
|
+
finally {
|
|
3305
|
+
this.unsubscribe();
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
_complete() {
|
|
3309
|
+
try {
|
|
3310
|
+
this.destination.complete();
|
|
3311
|
+
}
|
|
3312
|
+
finally {
|
|
3313
|
+
this.unsubscribe();
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
const _bind = Function.prototype.bind;
|
|
3318
|
+
function bind(fn, thisArg) {
|
|
3319
|
+
return _bind.call(fn, thisArg);
|
|
3320
|
+
}
|
|
3321
|
+
class ConsumerObserver {
|
|
3322
|
+
constructor(partialObserver) {
|
|
3323
|
+
this.partialObserver = partialObserver;
|
|
3324
|
+
}
|
|
3325
|
+
next(value) {
|
|
3326
|
+
const { partialObserver } = this;
|
|
3327
|
+
if (partialObserver.next) {
|
|
3328
|
+
try {
|
|
3329
|
+
partialObserver.next(value);
|
|
3330
|
+
}
|
|
3331
|
+
catch (error) {
|
|
3332
|
+
handleUnhandledError(error);
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
error(err) {
|
|
3337
|
+
const { partialObserver } = this;
|
|
3338
|
+
if (partialObserver.error) {
|
|
3339
|
+
try {
|
|
3340
|
+
partialObserver.error(err);
|
|
3341
|
+
}
|
|
3342
|
+
catch (error) {
|
|
3343
|
+
handleUnhandledError(error);
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
else {
|
|
3347
|
+
handleUnhandledError(err);
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
complete() {
|
|
3351
|
+
const { partialObserver } = this;
|
|
3352
|
+
if (partialObserver.complete) {
|
|
3353
|
+
try {
|
|
3354
|
+
partialObserver.complete();
|
|
3355
|
+
}
|
|
3356
|
+
catch (error) {
|
|
3357
|
+
handleUnhandledError(error);
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
class SafeSubscriber extends Subscriber {
|
|
3363
|
+
constructor(observerOrNext, error, complete) {
|
|
3364
|
+
super();
|
|
3365
|
+
let partialObserver;
|
|
3366
|
+
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
3367
|
+
partialObserver = {
|
|
3368
|
+
next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,
|
|
3369
|
+
error: error !== null && error !== void 0 ? error : undefined,
|
|
3370
|
+
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
3371
|
+
};
|
|
3372
|
+
}
|
|
3373
|
+
else {
|
|
3374
|
+
let context;
|
|
3375
|
+
if (this && config.useDeprecatedNextContext) {
|
|
3376
|
+
context = Object.create(observerOrNext);
|
|
3377
|
+
context.unsubscribe = () => this.unsubscribe();
|
|
3378
|
+
partialObserver = {
|
|
3379
|
+
next: observerOrNext.next && bind(observerOrNext.next, context),
|
|
3380
|
+
error: observerOrNext.error && bind(observerOrNext.error, context),
|
|
3381
|
+
complete: observerOrNext.complete && bind(observerOrNext.complete, context),
|
|
3382
|
+
};
|
|
3383
|
+
}
|
|
3384
|
+
else {
|
|
3385
|
+
partialObserver = observerOrNext;
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
this.destination = new ConsumerObserver(partialObserver);
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
function handleUnhandledError(error) {
|
|
3392
|
+
{
|
|
3393
|
+
reportUnhandledError(error);
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
function defaultErrorHandler(err) {
|
|
3397
|
+
throw err;
|
|
3398
|
+
}
|
|
3399
|
+
function handleStoppedNotification(notification, subscriber) {
|
|
3400
|
+
const { onStoppedNotification } = config;
|
|
3401
|
+
onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
|
|
3402
|
+
}
|
|
3403
|
+
const EMPTY_OBSERVER = {
|
|
3404
|
+
closed: true,
|
|
3405
|
+
next: noop,
|
|
3406
|
+
error: defaultErrorHandler,
|
|
3407
|
+
complete: noop,
|
|
3408
|
+
};
|
|
3409
|
+
|
|
3410
|
+
const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();
|
|
3411
|
+
|
|
3412
|
+
function identity(x) {
|
|
3413
|
+
return x;
|
|
3414
|
+
}
|
|
3415
|
+
|
|
3416
|
+
function pipeFromArray(fns) {
|
|
3417
|
+
if (fns.length === 0) {
|
|
3418
|
+
return identity;
|
|
3419
|
+
}
|
|
3420
|
+
if (fns.length === 1) {
|
|
3421
|
+
return fns[0];
|
|
3422
|
+
}
|
|
3423
|
+
return function piped(input) {
|
|
3424
|
+
return fns.reduce((prev, fn) => fn(prev), input);
|
|
3425
|
+
};
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3428
|
+
class Observable {
|
|
3429
|
+
constructor(subscribe) {
|
|
3430
|
+
if (subscribe) {
|
|
3431
|
+
this._subscribe = subscribe;
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
lift(operator) {
|
|
3435
|
+
const observable = new Observable();
|
|
3436
|
+
observable.source = this;
|
|
3437
|
+
observable.operator = operator;
|
|
3438
|
+
return observable;
|
|
3439
|
+
}
|
|
3440
|
+
subscribe(observerOrNext, error, complete) {
|
|
3441
|
+
const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
|
3442
|
+
errorContext(() => {
|
|
3443
|
+
const { operator, source } = this;
|
|
3444
|
+
subscriber.add(operator
|
|
3445
|
+
?
|
|
3446
|
+
operator.call(subscriber, source)
|
|
3447
|
+
: source
|
|
3448
|
+
?
|
|
3449
|
+
this._subscribe(subscriber)
|
|
3450
|
+
:
|
|
3451
|
+
this._trySubscribe(subscriber));
|
|
3452
|
+
});
|
|
3453
|
+
return subscriber;
|
|
3454
|
+
}
|
|
3455
|
+
_trySubscribe(sink) {
|
|
3456
|
+
try {
|
|
3457
|
+
return this._subscribe(sink);
|
|
3458
|
+
}
|
|
3459
|
+
catch (err) {
|
|
3460
|
+
sink.error(err);
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
forEach(next, promiseCtor) {
|
|
3464
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
3465
|
+
return new promiseCtor((resolve, reject) => {
|
|
3466
|
+
const subscriber = new SafeSubscriber({
|
|
3467
|
+
next: (value) => {
|
|
3468
|
+
try {
|
|
3469
|
+
next(value);
|
|
3470
|
+
}
|
|
3471
|
+
catch (err) {
|
|
3472
|
+
reject(err);
|
|
3473
|
+
subscriber.unsubscribe();
|
|
3474
|
+
}
|
|
3475
|
+
},
|
|
3476
|
+
error: reject,
|
|
3477
|
+
complete: resolve,
|
|
3478
|
+
});
|
|
3479
|
+
this.subscribe(subscriber);
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
_subscribe(subscriber) {
|
|
3483
|
+
var _a;
|
|
3484
|
+
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
|
3485
|
+
}
|
|
3486
|
+
[observable]() {
|
|
3487
|
+
return this;
|
|
3488
|
+
}
|
|
3489
|
+
pipe(...operations) {
|
|
3490
|
+
return pipeFromArray(operations)(this);
|
|
3491
|
+
}
|
|
3492
|
+
toPromise(promiseCtor) {
|
|
3493
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
3494
|
+
return new promiseCtor((resolve, reject) => {
|
|
3495
|
+
let value;
|
|
3496
|
+
this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));
|
|
3497
|
+
});
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
Observable.create = (subscribe) => {
|
|
3501
|
+
return new Observable(subscribe);
|
|
3502
|
+
};
|
|
3503
|
+
function getPromiseCtor(promiseCtor) {
|
|
3504
|
+
var _a;
|
|
3505
|
+
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
3506
|
+
}
|
|
3507
|
+
function isObserver(value) {
|
|
3508
|
+
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
3509
|
+
}
|
|
3510
|
+
function isSubscriber(value) {
|
|
3511
|
+
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
function hasLift(source) {
|
|
3515
|
+
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
|
|
3516
|
+
}
|
|
3517
|
+
function operate(init) {
|
|
3518
|
+
return (source) => {
|
|
3519
|
+
if (hasLift(source)) {
|
|
3520
|
+
return source.lift(function (liftedSource) {
|
|
3521
|
+
try {
|
|
3522
|
+
return init(liftedSource, this);
|
|
3523
|
+
}
|
|
3524
|
+
catch (err) {
|
|
3525
|
+
this.error(err);
|
|
3526
|
+
}
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3529
|
+
throw new TypeError('Unable to lift unknown Observable type');
|
|
3530
|
+
};
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
|
|
3534
|
+
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
|
|
3535
|
+
}
|
|
3536
|
+
class OperatorSubscriber extends Subscriber {
|
|
3537
|
+
constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
|
|
3538
|
+
super(destination);
|
|
3539
|
+
this.onFinalize = onFinalize;
|
|
3540
|
+
this.shouldUnsubscribe = shouldUnsubscribe;
|
|
3541
|
+
this._next = onNext
|
|
3542
|
+
? function (value) {
|
|
3543
|
+
try {
|
|
3544
|
+
onNext(value);
|
|
3545
|
+
}
|
|
3546
|
+
catch (err) {
|
|
3547
|
+
destination.error(err);
|
|
3548
|
+
}
|
|
3549
|
+
}
|
|
3550
|
+
: super._next;
|
|
3551
|
+
this._error = onError
|
|
3552
|
+
? function (err) {
|
|
3553
|
+
try {
|
|
3554
|
+
onError(err);
|
|
3555
|
+
}
|
|
3556
|
+
catch (err) {
|
|
3557
|
+
destination.error(err);
|
|
3558
|
+
}
|
|
3559
|
+
finally {
|
|
3560
|
+
this.unsubscribe();
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
: super._error;
|
|
3564
|
+
this._complete = onComplete
|
|
3565
|
+
? function () {
|
|
3566
|
+
try {
|
|
3567
|
+
onComplete();
|
|
3568
|
+
}
|
|
3569
|
+
catch (err) {
|
|
3570
|
+
destination.error(err);
|
|
3571
|
+
}
|
|
3572
|
+
finally {
|
|
3573
|
+
this.unsubscribe();
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
: super._complete;
|
|
3577
|
+
}
|
|
3578
|
+
unsubscribe() {
|
|
3579
|
+
var _a;
|
|
3580
|
+
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
3581
|
+
const { closed } = this;
|
|
3582
|
+
super.unsubscribe();
|
|
3583
|
+
!closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
3589
|
+
_super(this);
|
|
3590
|
+
this.name = 'ObjectUnsubscribedError';
|
|
3591
|
+
this.message = 'object unsubscribed';
|
|
3592
|
+
});
|
|
3593
|
+
|
|
3594
|
+
class Subject extends Observable {
|
|
3595
|
+
constructor() {
|
|
3596
|
+
super();
|
|
3597
|
+
this.closed = false;
|
|
3598
|
+
this.currentObservers = null;
|
|
3599
|
+
this.observers = [];
|
|
3600
|
+
this.isStopped = false;
|
|
3601
|
+
this.hasError = false;
|
|
3602
|
+
this.thrownError = null;
|
|
3603
|
+
}
|
|
3604
|
+
lift(operator) {
|
|
3605
|
+
const subject = new AnonymousSubject(this, this);
|
|
3606
|
+
subject.operator = operator;
|
|
3607
|
+
return subject;
|
|
3608
|
+
}
|
|
3609
|
+
_throwIfClosed() {
|
|
3610
|
+
if (this.closed) {
|
|
3611
|
+
throw new ObjectUnsubscribedError();
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
next(value) {
|
|
3615
|
+
errorContext(() => {
|
|
3616
|
+
this._throwIfClosed();
|
|
3617
|
+
if (!this.isStopped) {
|
|
3618
|
+
if (!this.currentObservers) {
|
|
3619
|
+
this.currentObservers = Array.from(this.observers);
|
|
3620
|
+
}
|
|
3621
|
+
for (const observer of this.currentObservers) {
|
|
3622
|
+
observer.next(value);
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
});
|
|
3626
|
+
}
|
|
3627
|
+
error(err) {
|
|
3628
|
+
errorContext(() => {
|
|
3629
|
+
this._throwIfClosed();
|
|
3630
|
+
if (!this.isStopped) {
|
|
3631
|
+
this.hasError = this.isStopped = true;
|
|
3632
|
+
this.thrownError = err;
|
|
3633
|
+
const { observers } = this;
|
|
3634
|
+
while (observers.length) {
|
|
3635
|
+
observers.shift().error(err);
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
});
|
|
3639
|
+
}
|
|
3640
|
+
complete() {
|
|
3641
|
+
errorContext(() => {
|
|
3642
|
+
this._throwIfClosed();
|
|
3643
|
+
if (!this.isStopped) {
|
|
3644
|
+
this.isStopped = true;
|
|
3645
|
+
const { observers } = this;
|
|
3646
|
+
while (observers.length) {
|
|
3647
|
+
observers.shift().complete();
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
});
|
|
3651
|
+
}
|
|
3652
|
+
unsubscribe() {
|
|
3653
|
+
this.isStopped = this.closed = true;
|
|
3654
|
+
this.observers = this.currentObservers = null;
|
|
3655
|
+
}
|
|
3656
|
+
get observed() {
|
|
3657
|
+
var _a;
|
|
3658
|
+
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
3659
|
+
}
|
|
3660
|
+
_trySubscribe(subscriber) {
|
|
3661
|
+
this._throwIfClosed();
|
|
3662
|
+
return super._trySubscribe(subscriber);
|
|
3663
|
+
}
|
|
3664
|
+
_subscribe(subscriber) {
|
|
3665
|
+
this._throwIfClosed();
|
|
3666
|
+
this._checkFinalizedStatuses(subscriber);
|
|
3667
|
+
return this._innerSubscribe(subscriber);
|
|
3668
|
+
}
|
|
3669
|
+
_innerSubscribe(subscriber) {
|
|
3670
|
+
const { hasError, isStopped, observers } = this;
|
|
3671
|
+
if (hasError || isStopped) {
|
|
3672
|
+
return EMPTY_SUBSCRIPTION;
|
|
3673
|
+
}
|
|
3674
|
+
this.currentObservers = null;
|
|
3675
|
+
observers.push(subscriber);
|
|
3676
|
+
return new Subscription(() => {
|
|
3677
|
+
this.currentObservers = null;
|
|
3678
|
+
arrRemove(observers, subscriber);
|
|
3679
|
+
});
|
|
3680
|
+
}
|
|
3681
|
+
_checkFinalizedStatuses(subscriber) {
|
|
3682
|
+
const { hasError, thrownError, isStopped } = this;
|
|
3683
|
+
if (hasError) {
|
|
3684
|
+
subscriber.error(thrownError);
|
|
3685
|
+
}
|
|
3686
|
+
else if (isStopped) {
|
|
3687
|
+
subscriber.complete();
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
asObservable() {
|
|
3691
|
+
const observable = new Observable();
|
|
3692
|
+
observable.source = this;
|
|
3693
|
+
return observable;
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
Subject.create = (destination, source) => {
|
|
3697
|
+
return new AnonymousSubject(destination, source);
|
|
3698
|
+
};
|
|
3699
|
+
class AnonymousSubject extends Subject {
|
|
3700
|
+
constructor(destination, source) {
|
|
3701
|
+
super();
|
|
3702
|
+
this.destination = destination;
|
|
3703
|
+
this.source = source;
|
|
3704
|
+
}
|
|
3705
|
+
next(value) {
|
|
3706
|
+
var _a, _b;
|
|
3707
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
3708
|
+
}
|
|
3709
|
+
error(err) {
|
|
3710
|
+
var _a, _b;
|
|
3711
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
3712
|
+
}
|
|
3713
|
+
complete() {
|
|
3714
|
+
var _a, _b;
|
|
3715
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3716
|
+
}
|
|
3717
|
+
_subscribe(subscriber) {
|
|
3718
|
+
var _a, _b;
|
|
3719
|
+
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
const EMPTY = new Observable((subscriber) => subscriber.complete());
|
|
3724
|
+
|
|
3725
|
+
function isScheduler(value) {
|
|
3726
|
+
return value && isFunction(value.schedule);
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
function last(arr) {
|
|
3730
|
+
return arr[arr.length - 1];
|
|
3731
|
+
}
|
|
3732
|
+
function popScheduler(args) {
|
|
3733
|
+
return isScheduler(last(args)) ? args.pop() : undefined;
|
|
3734
|
+
}
|
|
3735
|
+
function popNumber(args, defaultValue) {
|
|
3736
|
+
return typeof last(args) === 'number' ? args.pop() : defaultValue;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
/******************************************************************************
|
|
3740
|
+
Copyright (c) Microsoft Corporation.
|
|
3741
|
+
|
|
3742
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3743
|
+
purpose with or without fee is hereby granted.
|
|
3744
|
+
|
|
3745
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3746
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3747
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3748
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3749
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3750
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3751
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3752
|
+
***************************************************************************** */
|
|
3753
|
+
|
|
3754
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
3755
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3756
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3757
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
3758
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
3759
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
3760
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3761
|
+
});
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
function __values(o) {
|
|
3765
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3766
|
+
if (m) return m.call(o);
|
|
3767
|
+
if (o && typeof o.length === "number") return {
|
|
3768
|
+
next: function () {
|
|
3769
|
+
if (o && i >= o.length) o = void 0;
|
|
3770
|
+
return { value: o && o[i++], done: !o };
|
|
3771
|
+
}
|
|
3772
|
+
};
|
|
3773
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
function __await(v) {
|
|
3777
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
3781
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
3782
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
3783
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
3784
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
3785
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
3786
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
3787
|
+
function fulfill(value) { resume("next", value); }
|
|
3788
|
+
function reject(value) { resume("throw", value); }
|
|
3789
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
function __asyncValues(o) {
|
|
3793
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
3794
|
+
var m = o[Symbol.asyncIterator], i;
|
|
3795
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
3796
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
3797
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
|
|
3801
|
+
|
|
3802
|
+
function isPromise(value) {
|
|
3803
|
+
return isFunction(value === null || value === void 0 ? void 0 : value.then);
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
function isInteropObservable(input) {
|
|
3807
|
+
return isFunction(input[observable]);
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
function isAsyncIterable(obj) {
|
|
3811
|
+
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
function createInvalidObservableTypeError(input) {
|
|
3815
|
+
return new TypeError(`You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3818
|
+
function getSymbolIterator() {
|
|
3819
|
+
if (typeof Symbol !== 'function' || !Symbol.iterator) {
|
|
3820
|
+
return '@@iterator';
|
|
3821
|
+
}
|
|
3822
|
+
return Symbol.iterator;
|
|
3823
|
+
}
|
|
3824
|
+
const iterator = getSymbolIterator();
|
|
3825
|
+
|
|
3826
|
+
function isIterable(input) {
|
|
3827
|
+
return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
function readableStreamLikeToAsyncGenerator(readableStream) {
|
|
3831
|
+
return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
|
|
3832
|
+
const reader = readableStream.getReader();
|
|
3833
|
+
try {
|
|
3834
|
+
while (true) {
|
|
3835
|
+
const { value, done } = yield __await(reader.read());
|
|
3836
|
+
if (done) {
|
|
3837
|
+
return yield __await(void 0);
|
|
3838
|
+
}
|
|
3839
|
+
yield yield __await(value);
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
finally {
|
|
3843
|
+
reader.releaseLock();
|
|
3844
|
+
}
|
|
3845
|
+
});
|
|
3846
|
+
}
|
|
3847
|
+
function isReadableStreamLike(obj) {
|
|
3848
|
+
return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
function innerFrom(input) {
|
|
3852
|
+
if (input instanceof Observable) {
|
|
3853
|
+
return input;
|
|
3854
|
+
}
|
|
3855
|
+
if (input != null) {
|
|
3856
|
+
if (isInteropObservable(input)) {
|
|
3857
|
+
return fromInteropObservable(input);
|
|
3858
|
+
}
|
|
3859
|
+
if (isArrayLike(input)) {
|
|
3860
|
+
return fromArrayLike(input);
|
|
3861
|
+
}
|
|
3862
|
+
if (isPromise(input)) {
|
|
3863
|
+
return fromPromise(input);
|
|
3864
|
+
}
|
|
3865
|
+
if (isAsyncIterable(input)) {
|
|
3866
|
+
return fromAsyncIterable(input);
|
|
3867
|
+
}
|
|
3868
|
+
if (isIterable(input)) {
|
|
3869
|
+
return fromIterable(input);
|
|
3870
|
+
}
|
|
3871
|
+
if (isReadableStreamLike(input)) {
|
|
3872
|
+
return fromReadableStreamLike(input);
|
|
3873
|
+
}
|
|
3874
|
+
}
|
|
3875
|
+
throw createInvalidObservableTypeError(input);
|
|
3876
|
+
}
|
|
3877
|
+
function fromInteropObservable(obj) {
|
|
3878
|
+
return new Observable((subscriber) => {
|
|
3879
|
+
const obs = obj[observable]();
|
|
3880
|
+
if (isFunction(obs.subscribe)) {
|
|
3881
|
+
return obs.subscribe(subscriber);
|
|
3882
|
+
}
|
|
3883
|
+
throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
function fromArrayLike(array) {
|
|
3887
|
+
return new Observable((subscriber) => {
|
|
3888
|
+
for (let i = 0; i < array.length && !subscriber.closed; i++) {
|
|
3889
|
+
subscriber.next(array[i]);
|
|
3890
|
+
}
|
|
3891
|
+
subscriber.complete();
|
|
3892
|
+
});
|
|
3893
|
+
}
|
|
3894
|
+
function fromPromise(promise) {
|
|
3895
|
+
return new Observable((subscriber) => {
|
|
3896
|
+
promise
|
|
3897
|
+
.then((value) => {
|
|
3898
|
+
if (!subscriber.closed) {
|
|
3899
|
+
subscriber.next(value);
|
|
3900
|
+
subscriber.complete();
|
|
3901
|
+
}
|
|
3902
|
+
}, (err) => subscriber.error(err))
|
|
3903
|
+
.then(null, reportUnhandledError);
|
|
3904
|
+
});
|
|
3905
|
+
}
|
|
3906
|
+
function fromIterable(iterable) {
|
|
3907
|
+
return new Observable((subscriber) => {
|
|
3908
|
+
for (const value of iterable) {
|
|
3909
|
+
subscriber.next(value);
|
|
3910
|
+
if (subscriber.closed) {
|
|
3911
|
+
return;
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
subscriber.complete();
|
|
3915
|
+
});
|
|
3916
|
+
}
|
|
3917
|
+
function fromAsyncIterable(asyncIterable) {
|
|
3918
|
+
return new Observable((subscriber) => {
|
|
3919
|
+
process(asyncIterable, subscriber).catch((err) => subscriber.error(err));
|
|
3920
|
+
});
|
|
3921
|
+
}
|
|
3922
|
+
function fromReadableStreamLike(readableStream) {
|
|
3923
|
+
return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
|
|
3924
|
+
}
|
|
3925
|
+
function process(asyncIterable, subscriber) {
|
|
3926
|
+
var asyncIterable_1, asyncIterable_1_1;
|
|
3927
|
+
var e_1, _a;
|
|
3928
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3929
|
+
try {
|
|
3930
|
+
for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {
|
|
3931
|
+
const value = asyncIterable_1_1.value;
|
|
3932
|
+
subscriber.next(value);
|
|
3933
|
+
if (subscriber.closed) {
|
|
3934
|
+
return;
|
|
3935
|
+
}
|
|
3936
|
+
}
|
|
3937
|
+
}
|
|
3938
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3939
|
+
finally {
|
|
3940
|
+
try {
|
|
3941
|
+
if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
|
|
3942
|
+
}
|
|
3943
|
+
finally { if (e_1) throw e_1.error; }
|
|
3944
|
+
}
|
|
3945
|
+
subscriber.complete();
|
|
3946
|
+
});
|
|
3947
|
+
}
|
|
3948
|
+
|
|
3949
|
+
function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {
|
|
3950
|
+
const scheduleSubscription = scheduler.schedule(function () {
|
|
3951
|
+
work();
|
|
3952
|
+
if (repeat) {
|
|
3953
|
+
parentSubscription.add(this.schedule(null, delay));
|
|
3954
|
+
}
|
|
3955
|
+
else {
|
|
3956
|
+
this.unsubscribe();
|
|
3957
|
+
}
|
|
3958
|
+
}, delay);
|
|
3959
|
+
parentSubscription.add(scheduleSubscription);
|
|
3960
|
+
if (!repeat) {
|
|
3961
|
+
return scheduleSubscription;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
function observeOn(scheduler, delay = 0) {
|
|
3966
|
+
return operate((source, subscriber) => {
|
|
3967
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => executeSchedule(subscriber, scheduler, () => subscriber.next(value), delay), () => executeSchedule(subscriber, scheduler, () => subscriber.complete(), delay), (err) => executeSchedule(subscriber, scheduler, () => subscriber.error(err), delay)));
|
|
3968
|
+
});
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3971
|
+
function subscribeOn(scheduler, delay = 0) {
|
|
3972
|
+
return operate((source, subscriber) => {
|
|
3973
|
+
subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
|
|
3974
|
+
});
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
function scheduleObservable(input, scheduler) {
|
|
3978
|
+
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3981
|
+
function schedulePromise(input, scheduler) {
|
|
3982
|
+
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3985
|
+
function scheduleArray(input, scheduler) {
|
|
3986
|
+
return new Observable((subscriber) => {
|
|
3987
|
+
let i = 0;
|
|
3988
|
+
return scheduler.schedule(function () {
|
|
3989
|
+
if (i === input.length) {
|
|
3990
|
+
subscriber.complete();
|
|
3991
|
+
}
|
|
3992
|
+
else {
|
|
3993
|
+
subscriber.next(input[i++]);
|
|
3994
|
+
if (!subscriber.closed) {
|
|
3995
|
+
this.schedule();
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
});
|
|
3999
|
+
});
|
|
4000
|
+
}
|
|
4001
|
+
|
|
4002
|
+
function scheduleIterable(input, scheduler) {
|
|
4003
|
+
return new Observable((subscriber) => {
|
|
4004
|
+
let iterator$1;
|
|
4005
|
+
executeSchedule(subscriber, scheduler, () => {
|
|
4006
|
+
iterator$1 = input[iterator]();
|
|
4007
|
+
executeSchedule(subscriber, scheduler, () => {
|
|
4008
|
+
let value;
|
|
4009
|
+
let done;
|
|
4010
|
+
try {
|
|
4011
|
+
({ value, done } = iterator$1.next());
|
|
4012
|
+
}
|
|
4013
|
+
catch (err) {
|
|
4014
|
+
subscriber.error(err);
|
|
4015
|
+
return;
|
|
4016
|
+
}
|
|
4017
|
+
if (done) {
|
|
4018
|
+
subscriber.complete();
|
|
4019
|
+
}
|
|
4020
|
+
else {
|
|
4021
|
+
subscriber.next(value);
|
|
4022
|
+
}
|
|
4023
|
+
}, 0, true);
|
|
4024
|
+
});
|
|
4025
|
+
return () => isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return();
|
|
4026
|
+
});
|
|
4027
|
+
}
|
|
4028
|
+
|
|
4029
|
+
function scheduleAsyncIterable(input, scheduler) {
|
|
4030
|
+
if (!input) {
|
|
4031
|
+
throw new Error('Iterable cannot be null');
|
|
4032
|
+
}
|
|
4033
|
+
return new Observable((subscriber) => {
|
|
4034
|
+
executeSchedule(subscriber, scheduler, () => {
|
|
4035
|
+
const iterator = input[Symbol.asyncIterator]();
|
|
4036
|
+
executeSchedule(subscriber, scheduler, () => {
|
|
4037
|
+
iterator.next().then((result) => {
|
|
4038
|
+
if (result.done) {
|
|
4039
|
+
subscriber.complete();
|
|
4040
|
+
}
|
|
4041
|
+
else {
|
|
4042
|
+
subscriber.next(result.value);
|
|
4043
|
+
}
|
|
4044
|
+
});
|
|
4045
|
+
}, 0, true);
|
|
4046
|
+
});
|
|
4047
|
+
});
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
function scheduleReadableStreamLike(input, scheduler) {
|
|
4051
|
+
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
function scheduled(input, scheduler) {
|
|
4055
|
+
if (input != null) {
|
|
4056
|
+
if (isInteropObservable(input)) {
|
|
4057
|
+
return scheduleObservable(input, scheduler);
|
|
4058
|
+
}
|
|
4059
|
+
if (isArrayLike(input)) {
|
|
4060
|
+
return scheduleArray(input, scheduler);
|
|
4061
|
+
}
|
|
4062
|
+
if (isPromise(input)) {
|
|
4063
|
+
return schedulePromise(input, scheduler);
|
|
4064
|
+
}
|
|
4065
|
+
if (isAsyncIterable(input)) {
|
|
4066
|
+
return scheduleAsyncIterable(input, scheduler);
|
|
4067
|
+
}
|
|
4068
|
+
if (isIterable(input)) {
|
|
4069
|
+
return scheduleIterable(input, scheduler);
|
|
4070
|
+
}
|
|
4071
|
+
if (isReadableStreamLike(input)) {
|
|
4072
|
+
return scheduleReadableStreamLike(input, scheduler);
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
throw createInvalidObservableTypeError(input);
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
function from(input, scheduler) {
|
|
4079
|
+
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4082
|
+
function map(project, thisArg) {
|
|
4083
|
+
return operate((source, subscriber) => {
|
|
4084
|
+
let index = 0;
|
|
4085
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4086
|
+
subscriber.next(project.call(thisArg, value, index++));
|
|
4087
|
+
}));
|
|
4088
|
+
});
|
|
4089
|
+
}
|
|
4090
|
+
|
|
4091
|
+
const { isArray } = Array;
|
|
4092
|
+
function callOrApply(fn, args) {
|
|
4093
|
+
return isArray(args) ? fn(...args) : fn(args);
|
|
4094
|
+
}
|
|
4095
|
+
function mapOneOrManyArgs(fn) {
|
|
4096
|
+
return map(args => callOrApply(fn, args));
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
|
|
4100
|
+
const buffer = [];
|
|
4101
|
+
let active = 0;
|
|
4102
|
+
let index = 0;
|
|
4103
|
+
let isComplete = false;
|
|
4104
|
+
const checkComplete = () => {
|
|
4105
|
+
if (isComplete && !buffer.length && !active) {
|
|
4106
|
+
subscriber.complete();
|
|
4107
|
+
}
|
|
4108
|
+
};
|
|
4109
|
+
const outerNext = (value) => (active < concurrent ? doInnerSub(value) : buffer.push(value));
|
|
4110
|
+
const doInnerSub = (value) => {
|
|
4111
|
+
expand && subscriber.next(value);
|
|
4112
|
+
active++;
|
|
4113
|
+
let innerComplete = false;
|
|
4114
|
+
innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, (innerValue) => {
|
|
4115
|
+
onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
|
|
4116
|
+
if (expand) {
|
|
4117
|
+
outerNext(innerValue);
|
|
4118
|
+
}
|
|
4119
|
+
else {
|
|
4120
|
+
subscriber.next(innerValue);
|
|
4121
|
+
}
|
|
4122
|
+
}, () => {
|
|
4123
|
+
innerComplete = true;
|
|
4124
|
+
}, undefined, () => {
|
|
4125
|
+
if (innerComplete) {
|
|
4126
|
+
try {
|
|
4127
|
+
active--;
|
|
4128
|
+
while (buffer.length && active < concurrent) {
|
|
4129
|
+
const bufferedValue = buffer.shift();
|
|
4130
|
+
if (innerSubScheduler) {
|
|
4131
|
+
executeSchedule(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue));
|
|
4132
|
+
}
|
|
4133
|
+
else {
|
|
4134
|
+
doInnerSub(bufferedValue);
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
checkComplete();
|
|
4138
|
+
}
|
|
4139
|
+
catch (err) {
|
|
4140
|
+
subscriber.error(err);
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
}));
|
|
4144
|
+
};
|
|
4145
|
+
source.subscribe(createOperatorSubscriber(subscriber, outerNext, () => {
|
|
4146
|
+
isComplete = true;
|
|
4147
|
+
checkComplete();
|
|
4148
|
+
}));
|
|
4149
|
+
return () => {
|
|
4150
|
+
additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
|
|
4151
|
+
};
|
|
4152
|
+
}
|
|
4153
|
+
|
|
4154
|
+
function mergeMap(project, resultSelector, concurrent = Infinity) {
|
|
4155
|
+
if (isFunction(resultSelector)) {
|
|
4156
|
+
return mergeMap((a, i) => map((b, ii) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);
|
|
4157
|
+
}
|
|
4158
|
+
else if (typeof resultSelector === 'number') {
|
|
4159
|
+
concurrent = resultSelector;
|
|
4160
|
+
}
|
|
4161
|
+
return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4164
|
+
function mergeAll(concurrent = Infinity) {
|
|
4165
|
+
return mergeMap(identity, concurrent);
|
|
4166
|
+
}
|
|
4167
|
+
|
|
4168
|
+
const nodeEventEmitterMethods = ['addListener', 'removeListener'];
|
|
4169
|
+
const eventTargetMethods = ['addEventListener', 'removeEventListener'];
|
|
4170
|
+
const jqueryMethods = ['on', 'off'];
|
|
4171
|
+
function fromEvent(target, eventName, options, resultSelector) {
|
|
4172
|
+
if (isFunction(options)) {
|
|
4173
|
+
resultSelector = options;
|
|
4174
|
+
options = undefined;
|
|
4175
|
+
}
|
|
4176
|
+
if (resultSelector) {
|
|
4177
|
+
return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));
|
|
4178
|
+
}
|
|
4179
|
+
const [add, remove] = isEventTarget(target)
|
|
4180
|
+
? eventTargetMethods.map((methodName) => (handler) => target[methodName](eventName, handler, options))
|
|
4181
|
+
:
|
|
4182
|
+
isNodeStyleEventEmitter(target)
|
|
4183
|
+
? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName))
|
|
4184
|
+
: isJQueryStyleEventEmitter(target)
|
|
4185
|
+
? jqueryMethods.map(toCommonHandlerRegistry(target, eventName))
|
|
4186
|
+
: [];
|
|
4187
|
+
if (!add) {
|
|
4188
|
+
if (isArrayLike(target)) {
|
|
4189
|
+
return mergeMap((subTarget) => fromEvent(subTarget, eventName, options))(innerFrom(target));
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
if (!add) {
|
|
4193
|
+
throw new TypeError('Invalid event target');
|
|
4194
|
+
}
|
|
4195
|
+
return new Observable((subscriber) => {
|
|
4196
|
+
const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]);
|
|
4197
|
+
add(handler);
|
|
4198
|
+
return () => remove(handler);
|
|
4199
|
+
});
|
|
4200
|
+
}
|
|
4201
|
+
function toCommonHandlerRegistry(target, eventName) {
|
|
4202
|
+
return (methodName) => (handler) => target[methodName](eventName, handler);
|
|
4203
|
+
}
|
|
4204
|
+
function isNodeStyleEventEmitter(target) {
|
|
4205
|
+
return isFunction(target.addListener) && isFunction(target.removeListener);
|
|
4206
|
+
}
|
|
4207
|
+
function isJQueryStyleEventEmitter(target) {
|
|
4208
|
+
return isFunction(target.on) && isFunction(target.off);
|
|
4209
|
+
}
|
|
4210
|
+
function isEventTarget(target) {
|
|
4211
|
+
return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
|
|
4212
|
+
}
|
|
4213
|
+
|
|
4214
|
+
function merge(...args) {
|
|
4215
|
+
const scheduler = popScheduler(args);
|
|
4216
|
+
const concurrent = popNumber(args, Infinity);
|
|
4217
|
+
const sources = args;
|
|
4218
|
+
return !sources.length
|
|
4219
|
+
?
|
|
4220
|
+
EMPTY
|
|
4221
|
+
: sources.length === 1
|
|
4222
|
+
?
|
|
4223
|
+
innerFrom(sources[0])
|
|
4224
|
+
:
|
|
4225
|
+
mergeAll(concurrent)(from(sources, scheduler));
|
|
4226
|
+
}
|
|
4227
|
+
|
|
4228
|
+
function filter(predicate, thisArg) {
|
|
4229
|
+
return operate((source, subscriber) => {
|
|
4230
|
+
let index = 0;
|
|
4231
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value)));
|
|
4232
|
+
});
|
|
4233
|
+
}
|
|
4234
|
+
|
|
4235
|
+
function distinctUntilChanged(comparator, keySelector = identity) {
|
|
4236
|
+
comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
|
|
4237
|
+
return operate((source, subscriber) => {
|
|
4238
|
+
let previousKey;
|
|
4239
|
+
let first = true;
|
|
4240
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4241
|
+
const currentKey = keySelector(value);
|
|
4242
|
+
if (first || !comparator(previousKey, currentKey)) {
|
|
4243
|
+
first = false;
|
|
4244
|
+
previousKey = currentKey;
|
|
4245
|
+
subscriber.next(value);
|
|
4246
|
+
}
|
|
4247
|
+
}));
|
|
4248
|
+
});
|
|
4249
|
+
}
|
|
4250
|
+
function defaultCompare(a, b) {
|
|
4251
|
+
return a === b;
|
|
4252
|
+
}
|
|
4253
|
+
|
|
4254
|
+
function takeUntil(notifier) {
|
|
4255
|
+
return operate((source, subscriber) => {
|
|
4256
|
+
innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));
|
|
4257
|
+
!subscriber.closed && source.subscribe(subscriber);
|
|
4258
|
+
});
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
const catScrollableCss = ":host{overflow:hidden;position:relative;display:flex}:host([hidden]){display:none}.shadow-bottom,.shadow-right,.shadow-left,.shadow-top{position:absolute;transition:box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)}.shadow-top{z-index:2;width:100%;top:0}.shadow-left{z-index:4;height:100%;left:0}.shadow-right{z-index:4;height:100%;right:0}.shadow-bottom{z-index:2;width:100%;bottom:0}.scrollable-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.scrollable-wrapper.cat-scrollable-top .shadow-top,.scrollable-wrapper.cat-scrollable-bottom .shadow-bottom,.scrollable-wrapper.cat-scrollable-left .shadow-left,.scrollable-wrapper.cat-scrollable-right .shadow-right{box-shadow:0 0 4px 1px rgba(16, 29, 48, 0.2)}.scrollable-content{overflow:hidden;white-space:nowrap}.scrollable-content.scroll-x{overflow-x:auto}.scrollable-content.scroll-y{overflow-y:auto}.scrollable-content.no-overscroll{overscroll-behavior:contain}";
|
|
4262
|
+
|
|
4263
|
+
const CatScrollable = class {
|
|
4264
|
+
constructor(hostRef) {
|
|
4265
|
+
index.registerInstance(this, hostRef);
|
|
4266
|
+
this.scrolledTop = index.createEvent(this, "scrolledTop", 7);
|
|
4267
|
+
this.scrolledLeft = index.createEvent(this, "scrolledLeft", 7);
|
|
4268
|
+
this.scrolledRight = index.createEvent(this, "scrolledRight", 7);
|
|
4269
|
+
this.scrolledBottom = index.createEvent(this, "scrolledBottom", 7);
|
|
4270
|
+
this.init = new Subject();
|
|
4271
|
+
this.destroyed = new Subject();
|
|
4272
|
+
/** Flags to enable/disable scroll shadowX. */
|
|
4273
|
+
this.shadowX = true;
|
|
4274
|
+
/** Flags to enable/disable scroll shadowY. */
|
|
4275
|
+
this.shadowY = true;
|
|
4276
|
+
/** Flags to enable/disable overflowX. */
|
|
4277
|
+
this.overflowX = true;
|
|
4278
|
+
/** Flags to enable/disable overflowY. */
|
|
4279
|
+
this.overflowY = true;
|
|
4280
|
+
/** Flag to enable/disable overscroll behavior. */
|
|
4281
|
+
this.overscroll = true;
|
|
4282
|
+
/**
|
|
4283
|
+
* Flag to fire an initial event after content initialization.
|
|
4284
|
+
*/
|
|
4285
|
+
this.scrolledInit = true;
|
|
4286
|
+
/**
|
|
4287
|
+
* Buffer to be used to calculate the scroll distance.
|
|
4288
|
+
*/
|
|
4289
|
+
this.scrolledBuffer = 0;
|
|
4290
|
+
}
|
|
4291
|
+
componentDidRender() {
|
|
4292
|
+
if (this.scrollElement) {
|
|
4293
|
+
this.scrolled = fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.destroyed));
|
|
4294
|
+
}
|
|
4295
|
+
this.attachEmitter('left', this.scrolledLeft, this.scrolledBuffer);
|
|
4296
|
+
this.attachEmitter('right', this.scrolledRight, this.scrolledBuffer);
|
|
4297
|
+
this.attachEmitter('bottom', this.scrolledBottom, this.scrolledBuffer);
|
|
4298
|
+
this.attachEmitter('top', this.scrolledTop, this.scrolledBuffer);
|
|
4299
|
+
merge(this.init, this.scrolled)
|
|
4300
|
+
.pipe(map(() => ({
|
|
4301
|
+
top: this.getScrollOffset('top') > 0,
|
|
4302
|
+
left: this.getScrollOffset('left') > 0,
|
|
4303
|
+
right: this.getScrollOffset('right') > 0,
|
|
4304
|
+
bottom: this.getScrollOffset('bottom') > 0
|
|
4305
|
+
})), distinctUntilChanged(), takeUntil(this.destroyed))
|
|
4306
|
+
.subscribe(({ top, left, right, bottom }) => {
|
|
4307
|
+
this.toggleClass('cat-scrollable-top', top);
|
|
4308
|
+
this.toggleClass('cat-scrollable-left', left);
|
|
4309
|
+
this.toggleClass('cat-scrollable-right', right);
|
|
4310
|
+
this.toggleClass('cat-scrollable-bottom', bottom);
|
|
4311
|
+
});
|
|
4312
|
+
}
|
|
4313
|
+
componentDidLoad() {
|
|
4314
|
+
if (this.scrolledInit) {
|
|
4315
|
+
this.init.next();
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
disconnectedCallback() {
|
|
4319
|
+
this.init.complete();
|
|
4320
|
+
this.destroyed.next();
|
|
4321
|
+
this.destroyed.complete();
|
|
4322
|
+
}
|
|
4323
|
+
render() {
|
|
4324
|
+
return [
|
|
4325
|
+
index.h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, this.shadowY && index.h("div", { class: "shadow-top" }), this.shadowX && index.h("div", { class: "shadow-left" }), this.shadowX && index.h("div", { class: "shadow-right" }), this.shadowY && index.h("div", { class: "shadow-bottom" })),
|
|
4326
|
+
index.h("div", { ref: el => (this.scrollElement = el), class: {
|
|
4327
|
+
'scrollable-content': true,
|
|
4328
|
+
'scroll-x': this.overflowX,
|
|
4329
|
+
'scroll-y': this.overflowY,
|
|
4330
|
+
'no-overscroll': !this.overscroll
|
|
4331
|
+
} }, index.h("slot", null))
|
|
4332
|
+
];
|
|
4333
|
+
}
|
|
4334
|
+
attachEmitter(from, emitter, buffer) {
|
|
4335
|
+
merge(this.init, this.scrolled)
|
|
4336
|
+
.pipe(map(() => this.getScrollOffset(from)))
|
|
4337
|
+
.pipe(map(offset => offset <= buffer))
|
|
4338
|
+
.pipe(distinctUntilChanged())
|
|
4339
|
+
.pipe(filter(isLower => isLower))
|
|
4340
|
+
.pipe(takeUntil(this.destroyed))
|
|
4341
|
+
.subscribe(() => emitter.emit());
|
|
4342
|
+
}
|
|
4343
|
+
getScrollOffset(from) {
|
|
4344
|
+
if (this.scrollElement) {
|
|
4345
|
+
switch (from) {
|
|
4346
|
+
case 'top':
|
|
4347
|
+
return this.scrollElement.scrollTop;
|
|
4348
|
+
case 'left':
|
|
4349
|
+
return this.scrollElement.scrollLeft;
|
|
4350
|
+
case 'right':
|
|
4351
|
+
return this.scrollElement.scrollWidth - this.scrollElement.clientWidth - this.scrollElement.scrollLeft;
|
|
4352
|
+
case 'bottom':
|
|
4353
|
+
return this.scrollElement.scrollHeight - this.scrollElement.clientHeight - this.scrollElement.scrollTop;
|
|
4354
|
+
default:
|
|
4355
|
+
return 0;
|
|
4356
|
+
}
|
|
4357
|
+
}
|
|
4358
|
+
return 0;
|
|
4359
|
+
}
|
|
4360
|
+
toggleClass(name, value) {
|
|
4361
|
+
var _a, _b;
|
|
4362
|
+
if (value) {
|
|
4363
|
+
(_a = this.scrollWrapperElement) === null || _a === void 0 ? void 0 : _a.classList.add(name);
|
|
4364
|
+
}
|
|
4365
|
+
else {
|
|
4366
|
+
(_b = this.scrollWrapperElement) === null || _b === void 0 ? void 0 : _b.classList.remove(name);
|
|
4367
|
+
}
|
|
4368
|
+
}
|
|
4369
|
+
get el() { return index.getElement(this); }
|
|
4370
|
+
};
|
|
4371
|
+
CatScrollable.style = catScrollableCss;
|
|
4372
|
+
|
|
3041
4373
|
const catSkeletonCss = ":host{display:flex;flex-direction:column;position:relative;--background:#ebecf0;--highlight:#d7dbe0;--speed:2s}:host([variant=square]),:host([variant=circle]){display:inline-flex}:host([hidden]){display:none}:host([variant=head]){margin-bottom:0.5rem}:host([variant=body]){margin-bottom:1rem}.cat-skeleton{display:block;border-radius:0.25rem;background:var(--background)}.cat-skeleton-circle{border-radius:10rem}.cat-skeleton-xs.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 1.5rem)}.cat-skeleton-xs.cat-skeleton-square,.cat-skeleton-xs.cat-skeleton-circle{width:var(--width, 1.5rem);height:var(--height, 1.5rem)}.cat-skeleton-xs.cat-skeleton-head,.cat-skeleton-xs.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-xs.cat-skeleton-head{height:calc(0.9375rem - 4px);margin:calc((1.25rem - 0.9375rem + 4px) * 0.5) 0}.cat-skeleton-xs.cat-skeleton-body{height:calc(0.75rem - 4px);margin:calc((1rem - 0.75rem + 4px) * 0.5) 0}.cat-skeleton-s.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 2rem)}.cat-skeleton-s.cat-skeleton-square,.cat-skeleton-s.cat-skeleton-circle{width:var(--width, 2rem);height:var(--height, 2rem)}.cat-skeleton-s.cat-skeleton-head,.cat-skeleton-s.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-s.cat-skeleton-head{height:calc(1.125rem - 4px);margin:calc((1.5rem - 1.125rem + 4px) * 0.5) 0}.cat-skeleton-s.cat-skeleton-body{height:calc(0.875rem - 4px);margin:calc((1rem - 0.875rem + 4px) * 0.5) 0}.cat-skeleton-m.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 2.5rem)}.cat-skeleton-m.cat-skeleton-square,.cat-skeleton-m.cat-skeleton-circle{width:var(--width, 2.5rem);height:var(--height, 2.5rem)}.cat-skeleton-m.cat-skeleton-head,.cat-skeleton-m.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-m.cat-skeleton-head{height:calc(1.25rem - 4px);margin:calc((1.5rem - 1.25rem + 4px) * 0.5) 0}.cat-skeleton-m.cat-skeleton-body{height:calc(0.9375rem - 4px);margin:calc((1.25rem - 0.9375rem + 4px) * 0.5) 0}.cat-skeleton-l.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 3rem)}.cat-skeleton-l.cat-skeleton-square,.cat-skeleton-l.cat-skeleton-circle{width:var(--width, 3rem);height:var(--height, 3rem)}.cat-skeleton-l.cat-skeleton-head,.cat-skeleton-l.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-l.cat-skeleton-head{height:calc(1.5rem - 4px);margin:calc((1.75rem - 1.5rem + 4px) * 0.5) 0}.cat-skeleton-l.cat-skeleton-body{height:calc(1.125rem - 4px);margin:calc((1.5rem - 1.125rem + 4px) * 0.5) 0}.cat-skeleton-xl.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 3.5rem)}.cat-skeleton-xl.cat-skeleton-square,.cat-skeleton-xl.cat-skeleton-circle{width:var(--width, 3.5rem);height:var(--height, 3.5rem)}.cat-skeleton-xl.cat-skeleton-head,.cat-skeleton-xl.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-xl.cat-skeleton-head{height:calc(1.75rem - 4px);margin:calc((2rem - 1.75rem + 4px) * 0.5) 0}.cat-skeleton-xl.cat-skeleton-body{height:calc(1.25rem - 4px);margin:calc((1.5rem - 1.25rem + 4px) * 0.5) 0}.cat-skeleton-sheen{background:linear-gradient(90deg, var(--background) 33%, var(--highlight) 50%, var(--background) 66%) var(--background);background-size:300% 100%;animation:sheen var(--speed) ease-in-out infinite}.cat-skeleton-pulse{position:relative;overflow:hidden}.cat-skeleton-pulse::before{content:\"\";display:block;position:absolute;width:100%;height:100%;background-color:var(--highlight);animation:var(--speed) ease-in-out 0.5s infinite normal none running pulse;opacity:0}@keyframes sheen{0%{background-position:right}}@keyframes pulse{50%{opacity:1}}";
|
|
3042
4374
|
|
|
3043
4375
|
const CatSkeleton = class {
|
|
3044
4376
|
constructor(hostRef) {
|
|
3045
|
-
|
|
4377
|
+
index.registerInstance(this, hostRef);
|
|
3046
4378
|
/**
|
|
3047
4379
|
* The animation style of the skeleton.
|
|
3048
4380
|
*/
|
|
@@ -3058,7 +4390,7 @@ const CatSkeleton = class {
|
|
|
3058
4390
|
this.size = 'm';
|
|
3059
4391
|
}
|
|
3060
4392
|
render() {
|
|
3061
|
-
return (
|
|
4393
|
+
return (index.h(index.Host, null, Array.from(Array(this.count)).map(() => (index.h("div", { style: this.style, class: {
|
|
3062
4394
|
'cat-skeleton': true,
|
|
3063
4395
|
[`cat-skeleton-${this.effect}`]: Boolean(this.effect),
|
|
3064
4396
|
[`cat-skeleton-${this.variant}`]: Boolean(this.variant),
|
|
@@ -3092,16 +4424,16 @@ const catSpinnerCss = ":host{display:inline-flex;vertical-align:middle;-webkit-u
|
|
|
3092
4424
|
|
|
3093
4425
|
const CatSpinner = class {
|
|
3094
4426
|
constructor(hostRef) {
|
|
3095
|
-
|
|
4427
|
+
index.registerInstance(this, hostRef);
|
|
3096
4428
|
/**
|
|
3097
4429
|
* The size of the spinner.
|
|
3098
4430
|
*/
|
|
3099
4431
|
this.size = 'm';
|
|
3100
4432
|
}
|
|
3101
4433
|
render() {
|
|
3102
|
-
return (
|
|
4434
|
+
return (index.h("span", { "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
3103
4435
|
[`cat-spinner-${this.size}`]: this.size !== 'inline'
|
|
3104
|
-
} },
|
|
4436
|
+
} }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, index.h("circle", { cx: "24", cy: "24", r: "21.5" }))));
|
|
3105
4437
|
}
|
|
3106
4438
|
};
|
|
3107
4439
|
CatSpinner.style = catSpinnerCss;
|
|
@@ -3111,5 +4443,8 @@ exports.cat_badge = CatBadge;
|
|
|
3111
4443
|
exports.cat_button = CatButton;
|
|
3112
4444
|
exports.cat_icon = CatIcon;
|
|
3113
4445
|
exports.cat_menu = CatMenu;
|
|
4446
|
+
exports.cat_scrollable = CatScrollable;
|
|
3114
4447
|
exports.cat_skeleton = CatSkeleton;
|
|
3115
4448
|
exports.cat_spinner = CatSpinner;
|
|
4449
|
+
|
|
4450
|
+
//# sourceMappingURL=cat-alert_8.cjs.entry.js.map
|