@haiilo/catalyst 0.5.12 → 0.6.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 +7 -1
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/{p-e82b63e9.js → p-12486027.js} +2 -2
- package/dist/catalyst/{p-e82b63e9.js.map → p-12486027.js.map} +1 -1
- package/dist/catalyst/p-2ec5c87a.js +2 -0
- package/dist/catalyst/p-2ec5c87a.js.map +1 -0
- package/dist/catalyst/p-6a5f0d4a.entry.js +10 -0
- package/dist/catalyst/p-6a5f0d4a.entry.js.map +1 -0
- package/dist/catalyst/p-7c06183a.js +2 -0
- package/dist/catalyst/p-7c06183a.js.map +1 -0
- package/dist/catalyst/p-a8629c54.entry.js +2 -0
- package/dist/catalyst/p-a8629c54.entry.js.map +1 -0
- package/dist/catalyst/p-c7f3b231.js +10 -0
- package/dist/catalyst/p-c7f3b231.js.map +1 -0
- package/dist/cjs/{app-globals-2a30d681.js → app-globals-aa29ad72.js} +2 -2
- package/dist/cjs/{app-globals-2a30d681.js.map → app-globals-aa29ad72.js.map} +1 -1
- package/dist/cjs/{cat-alert_15.cjs.entry.js → cat-alert_16.cjs.entry.js} +161 -111
- package/dist/cjs/cat-alert_16.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-icon-registry-49b11b51.js +131 -0
- package/dist/cjs/cat-icon-registry-49b11b51.js.map +1 -0
- package/dist/cjs/cat-notification-156f4cf5.js +552 -0
- package/dist/cjs/cat-notification-156f4cf5.js.map +1 -0
- package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
- package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +4 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{cat-icon-registry-b3a95a6b.js → loglevel-c9b2d01f.js} +3 -126
- package/dist/cjs/loglevel-c9b2d01f.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/cat-avatar/cat-avatar.css +81 -0
- package/dist/collection/components/cat-avatar/cat-avatar.js +225 -0
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -0
- package/dist/collection/components/cat-badge/cat-badge.css +5 -5
- package/dist/collection/components/cat-button/cat-button.js +8 -8
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +106 -0
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +44 -44
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.css +3 -0
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.js +51 -0
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/load-img.js +16 -0
- package/dist/collection/utils/load-img.js.map +1 -0
- package/dist/components/cat-avatar.d.ts +11 -0
- package/dist/components/cat-avatar.js +125 -0
- package/dist/components/cat-avatar.js.map +1 -0
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button2.js +5 -5
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-notification.js +550 -0
- package/dist/components/cat-notification.js.map +1 -0
- package/dist/components/cat-scrollable.js +23 -23
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/components/cat-toast-demo.d.ts +11 -0
- package/dist/components/cat-toast-demo.js +84 -0
- package/dist/components/cat-toast-demo.js.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +1 -1
- package/dist/esm/{app-globals-77cd8c8e.js → app-globals-cf55f7f5.js} +2 -2
- package/dist/esm/{app-globals-77cd8c8e.js.map → app-globals-cf55f7f5.js.map} +1 -1
- package/dist/esm/{cat-alert_15.entry.js → cat-alert_16.entry.js} +154 -105
- package/dist/esm/cat-alert_16.entry.js.map +1 -0
- package/dist/esm/cat-icon-registry-3ea75755.js +128 -0
- package/dist/esm/cat-icon-registry-3ea75755.js.map +1 -0
- package/dist/esm/cat-notification-cd98c266.js +550 -0
- package/dist/esm/cat-notification-cd98c266.js.map +1 -0
- package/dist/esm/cat-textarea.entry.js +87 -0
- package/dist/esm/cat-textarea.entry.js.map +1 -0
- package/dist/esm/catalyst.js +4 -3
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{cat-icon-registry-a7acd6f7.js → loglevel-39a9e3f9.js} +2 -125
- package/dist/esm/loglevel-39a9e3f9.js.map +1 -0
- package/dist/types/components/cat-avatar/cat-avatar.d.ts +46 -0
- package/dist/types/components/cat-button/cat-button.d.ts +2 -2
- package/dist/types/components/cat-notification/cat-notification.d.ts +51 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +12 -12
- package/dist/types/components/cat-toast-demo/cat-toast-demo.d.ts +9 -0
- package/dist/types/components.d.ts +134 -44
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/load-img.d.ts +8 -0
- package/package.json +5 -3
- package/dist/catalyst/p-9a3c2375.js +0 -2
- package/dist/catalyst/p-9a3c2375.js.map +0 -1
- package/dist/catalyst/p-a6b8ebe9.entry.js +0 -10
- package/dist/catalyst/p-a6b8ebe9.entry.js.map +0 -1
- package/dist/cjs/cat-alert_15.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-b3a95a6b.js.map +0 -1
- package/dist/esm/cat-alert_15.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-a7acd6f7.js.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, c as createEvent } from './index-fd12be19.js';
|
|
2
|
-
import { l as loglevel
|
|
2
|
+
import { l as loglevel } from './loglevel-39a9e3f9.js';
|
|
3
|
+
import { C as CatIconRegistry, a as CatI18nRegistry } from './cat-icon-registry-3ea75755.js';
|
|
4
|
+
import { N as NotificationsService } from './cat-notification-cd98c266.js';
|
|
3
5
|
|
|
4
6
|
const catAlertCss = ":host{display:block;margin-bottom:1rem}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host([hidden]){display:none}.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}::slotted(:last-child){margin-bottom:0 !important}.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)}.alert-secondary{--bg:105, 118, 135;--text:0, 0, 0;--border:105, 118, 135}.alert-success{--bg:0, 132, 88;--text:0, 132, 88;--border:0, 132, 88}.alert-warning{--bg:255, 206, 128;--text:159, 97, 0;--border:159, 97, 0}.alert-danger{--bg:217, 52, 13;--text:217, 52, 13;--border:217, 52, 13}";
|
|
5
7
|
|
|
@@ -29,7 +31,92 @@ const CatAlert = class {
|
|
|
29
31
|
};
|
|
30
32
|
CatAlert.style = catAlertCss;
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Loads an image and wraps the result in a promise.
|
|
36
|
+
*
|
|
37
|
+
* @param src the image URL
|
|
38
|
+
* @returns a promise
|
|
39
|
+
*/
|
|
40
|
+
const loadImg = (src) => {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const image = new Image();
|
|
43
|
+
image.addEventListener('load', resolve);
|
|
44
|
+
image.addEventListener('error', reject);
|
|
45
|
+
image.src = src;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const catAvatarCss = ":host{display:inline-block;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.avatar{display:flex;align-items:center;justify-content:center;border-radius:0.25rem;text-decoration:inherit;color:var(--cat-avatar-fill, white);background-color:var(--cat-avatar-bg, #697687);background-size:cover;background-position:center;white-space:nowrap;overflow:hidden}.avatar:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.avatar-round{border-radius:50%}.avatar-xs{width:var(--cat-avatar-size, 1.5rem);height:var(--cat-avatar-size, 1.5rem);line-height:var(--cat-avatar-size, 1.5rem);font-size:var(--cat-avatar-font-size, 0.75rem)}.avatar-s{width:var(--cat-avatar-size, 2rem);height:var(--cat-avatar-size, 2rem);line-height:var(--cat-avatar-size, 2rem);font-size:var(--cat-avatar-font-size, 0.875rem)}.avatar-m{width:var(--cat-avatar-size, 2.5rem);height:var(--cat-avatar-size, 2.5rem);line-height:var(--cat-avatar-size, 2.5rem);font-size:var(--cat-avatar-font-size, 0.9375rem)}.avatar-l{width:var(--cat-avatar-size, 3rem);height:var(--cat-avatar-size, 3rem);line-height:var(--cat-avatar-size, 3rem);font-size:var(--cat-avatar-font-size, 1.125rem)}.avatar-xl{width:var(--cat-avatar-size, 3.5rem);height:var(--cat-avatar-size, 3.5rem);line-height:var(--cat-avatar-size, 3.5rem);font-size:var(--cat-avatar-font-size, 1.25rem)}";
|
|
50
|
+
|
|
51
|
+
const CatAvatar = class {
|
|
52
|
+
constructor(hostRef) {
|
|
53
|
+
registerInstance(this, hostRef);
|
|
54
|
+
/**
|
|
55
|
+
* The size of the avatar.
|
|
56
|
+
*/
|
|
57
|
+
this.size = 'm';
|
|
58
|
+
/**
|
|
59
|
+
* Use round avatar edges.
|
|
60
|
+
*/
|
|
61
|
+
this.round = false;
|
|
62
|
+
/**
|
|
63
|
+
* The label of the avatar.
|
|
64
|
+
*/
|
|
65
|
+
this.label = '';
|
|
66
|
+
}
|
|
67
|
+
onSrcChanged(value) {
|
|
68
|
+
if (value) {
|
|
69
|
+
loadImg(value).then(() => (this.backgroundImage = `url(${value})`), () => (this.backgroundImage = undefined));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.backgroundImage = undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
componentWillLoad() {
|
|
76
|
+
this.onSrcChanged(this.src);
|
|
77
|
+
}
|
|
78
|
+
componentWillRender() {
|
|
79
|
+
if (!this.label) {
|
|
80
|
+
loglevel.warn('[A11y] Missing ARIA label on avatar', this);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
if (this.url) {
|
|
85
|
+
return (h("a", { href: this.url, target: this.urlTarget, style: this.cssStyle, class: this.cssClass, "aria-label": this.label }, this.content));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return (h("span", { style: this.cssStyle, class: this.cssClass, "aria-label": this.label }, this.content));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
get content() {
|
|
92
|
+
return !this.backgroundImage
|
|
93
|
+
? [this.icon ? h("cat-icon", { icon: this.icon, size: this.size }) : this.getInitials()]
|
|
94
|
+
: [];
|
|
95
|
+
}
|
|
96
|
+
get cssStyle() {
|
|
97
|
+
return { 'background-image': this.backgroundImage };
|
|
98
|
+
}
|
|
99
|
+
get cssClass() {
|
|
100
|
+
return {
|
|
101
|
+
avatar: true,
|
|
102
|
+
'avatar-round': this.round,
|
|
103
|
+
[`avatar-${this.size}`]: Boolean(this.size)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
getInitials() {
|
|
107
|
+
var _a;
|
|
108
|
+
return ((_a = this.initials) !== null && _a !== void 0 ? _a : this.label
|
|
109
|
+
.split(' ')
|
|
110
|
+
.map(n => n[0])
|
|
111
|
+
.join(''));
|
|
112
|
+
}
|
|
113
|
+
static get watchers() { return {
|
|
114
|
+
"src": ["onSrcChanged"]
|
|
115
|
+
}; }
|
|
116
|
+
};
|
|
117
|
+
CatAvatar.style = catAvatarCss;
|
|
118
|
+
|
|
119
|
+
const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.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}.badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.badge-round{border-radius:10rem}.badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.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)}.badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0rem 0.25rem}.badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0.25rem 0.5rem}.badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0.5rem 0.75rem}.badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0.75rem 1rem}.badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:1rem 1.25rem}.badge-pulse.badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.badge-pulse.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)}}";
|
|
33
120
|
|
|
34
121
|
const CatBadge = class {
|
|
35
122
|
constructor(hostRef) {
|
|
@@ -224,9 +311,9 @@ const CatButton = class {
|
|
|
224
311
|
*/
|
|
225
312
|
this.submit = false;
|
|
226
313
|
/**
|
|
227
|
-
*
|
|
314
|
+
* Disables ellipse overflowing button content.
|
|
228
315
|
*/
|
|
229
|
-
this.
|
|
316
|
+
this.noEllipsis = false;
|
|
230
317
|
/**
|
|
231
318
|
* Use round button edges.
|
|
232
319
|
*/
|
|
@@ -291,7 +378,7 @@ const CatButton = class {
|
|
|
291
378
|
'cat-button-round': this.round,
|
|
292
379
|
'cat-button-loading': this.loading,
|
|
293
380
|
'cat-button-disabled': this.disabled,
|
|
294
|
-
'cat-button-ellipsed': this.
|
|
381
|
+
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,
|
|
295
382
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
296
383
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
297
384
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
@@ -305,7 +392,7 @@ const CatButton = class {
|
|
|
305
392
|
'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
|
|
306
393
|
'cat-button-loading': this.loading,
|
|
307
394
|
'cat-button-disabled': this.disabled,
|
|
308
|
-
'cat-button-ellipsed': this.
|
|
395
|
+
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,
|
|
309
396
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
310
397
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
311
398
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
@@ -374,14 +461,14 @@ CatCard.style = catCardCss;
|
|
|
374
461
|
|
|
375
462
|
const catCheckboxCss = ":host{display:flex;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;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{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}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid #d7dbe0;border-radius:0.125rem;transition:background-color 0.13s ease, border-color 0.13s ease}.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:70%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));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}.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))}";
|
|
376
463
|
|
|
377
|
-
let nextUniqueId$
|
|
464
|
+
let nextUniqueId$5 = 0;
|
|
378
465
|
const CatCheckbox = class {
|
|
379
466
|
constructor(hostRef) {
|
|
380
467
|
registerInstance(this, hostRef);
|
|
381
468
|
this.catChange = createEvent(this, "catChange", 7);
|
|
382
469
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
383
470
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
384
|
-
this.id = `cat-checkbox-${nextUniqueId$
|
|
471
|
+
this.id = `cat-checkbox-${nextUniqueId$5++}`;
|
|
385
472
|
/**
|
|
386
473
|
* Checked state of the checkbox
|
|
387
474
|
*/
|
|
@@ -467,7 +554,7 @@ CatIcon.style = catIconCss;
|
|
|
467
554
|
|
|
468
555
|
const catInputCss = ":host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;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:0.25rem;box-shadow:0 0 0 1px #d7dbe0;transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f8f8fb;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 #d7dbe0}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}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;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 #d7dbe0;padding-right:0.75rem}.text-suffix{border-left:1px solid #d7dbe0;padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;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}.input-hint{font-size:0.875rem;line-height:1rem;margin:0}";
|
|
469
556
|
|
|
470
|
-
let nextUniqueId$
|
|
557
|
+
let nextUniqueId$4 = 0;
|
|
471
558
|
const CatInput = class {
|
|
472
559
|
constructor(hostRef) {
|
|
473
560
|
registerInstance(this, hostRef);
|
|
@@ -475,7 +562,7 @@ const CatInput = class {
|
|
|
475
562
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
476
563
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
477
564
|
this.i18n = CatI18nRegistry.getInstance();
|
|
478
|
-
this.id = `cat-input-${nextUniqueId$
|
|
565
|
+
this.id = `cat-input-${nextUniqueId$4++}`;
|
|
479
566
|
this.inputValue = '';
|
|
480
567
|
/**
|
|
481
568
|
* Whether the input should show a clear button.
|
|
@@ -2804,13 +2891,13 @@ const firstTabbable = (container) => {
|
|
|
2804
2891
|
|
|
2805
2892
|
const catMenuCss = ":host{display:contents}:host([hidden]){display:none}.content{padding-top:0.5rem;padding-bottom:0.5rem;position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-width:8rem;max-width:16rem;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}";
|
|
2806
2893
|
|
|
2807
|
-
let nextUniqueId$
|
|
2894
|
+
let nextUniqueId$3 = 0;
|
|
2808
2895
|
const CatMenu = class {
|
|
2809
2896
|
constructor(hostRef) {
|
|
2810
2897
|
registerInstance(this, hostRef);
|
|
2811
2898
|
this.catOpen = createEvent(this, "catOpen", 7);
|
|
2812
2899
|
this.catClose = createEvent(this, "catClose", 7);
|
|
2813
|
-
this.id = nextUniqueId$
|
|
2900
|
+
this.id = nextUniqueId$3++;
|
|
2814
2901
|
/**
|
|
2815
2902
|
* The placement of the menu.
|
|
2816
2903
|
*/
|
|
@@ -2907,14 +2994,14 @@ CatMenu.style = catMenuCss;
|
|
|
2907
2994
|
|
|
2908
2995
|
const catRadioCss = ":host{display:flex;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;cursor:pointer}.radio{display:flex;position:relative}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid #d7dbe0;border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 32, 127, 138))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.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:#f8f8fb}.is-disabled input:checked{border-color:#d7dbe0}.is-disabled .circle{background-color:#d7dbe0}";
|
|
2909
2996
|
|
|
2910
|
-
let nextUniqueId$
|
|
2997
|
+
let nextUniqueId$2 = 0;
|
|
2911
2998
|
const CatRadio = class {
|
|
2912
2999
|
constructor(hostRef) {
|
|
2913
3000
|
registerInstance(this, hostRef);
|
|
2914
3001
|
this.catChange = createEvent(this, "catChange", 7);
|
|
2915
3002
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
2916
3003
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
2917
|
-
this.id = `cat-radio-${++nextUniqueId$
|
|
3004
|
+
this.id = `cat-radio-${++nextUniqueId$2}`;
|
|
2918
3005
|
/**
|
|
2919
3006
|
* Whether this radio is checked.
|
|
2920
3007
|
*/
|
|
@@ -4196,20 +4283,20 @@ const CatScrollable = class {
|
|
|
4196
4283
|
this.scrolledBottom = createEvent(this, "scrolledBottom", 7);
|
|
4197
4284
|
this.init = new Subject();
|
|
4198
4285
|
this.destroyed = new Subject();
|
|
4199
|
-
/** Flags to enable
|
|
4200
|
-
this.
|
|
4201
|
-
/** Flags to enable
|
|
4202
|
-
this.
|
|
4203
|
-
/** Flags to enable
|
|
4204
|
-
this.
|
|
4205
|
-
/** Flags to enable
|
|
4206
|
-
this.
|
|
4207
|
-
/** Flag to enable
|
|
4208
|
-
this.
|
|
4286
|
+
/** Flags to disable/enable scroll shadowX. */
|
|
4287
|
+
this.noShadowX = false;
|
|
4288
|
+
/** Flags to disable/enable scroll shadowY. */
|
|
4289
|
+
this.noShadowY = false;
|
|
4290
|
+
/** Flags to disable/enable overflowX. */
|
|
4291
|
+
this.noOverflowX = false;
|
|
4292
|
+
/** Flags to disable/enable overflowY. */
|
|
4293
|
+
this.noOverflowY = false;
|
|
4294
|
+
/** Flag to disable/enable overscroll behavior. */
|
|
4295
|
+
this.noOverscroll = false;
|
|
4209
4296
|
/**
|
|
4210
|
-
* Flag to fire an initial event after content initialization.
|
|
4297
|
+
* Flag to not fire an initial event after content initialization.
|
|
4211
4298
|
*/
|
|
4212
|
-
this.
|
|
4299
|
+
this.noScrolledInit = false;
|
|
4213
4300
|
/**
|
|
4214
4301
|
* Buffer to be used to calculate the scroll distance.
|
|
4215
4302
|
*/
|
|
@@ -4238,7 +4325,7 @@ const CatScrollable = class {
|
|
|
4238
4325
|
});
|
|
4239
4326
|
}
|
|
4240
4327
|
componentDidLoad() {
|
|
4241
|
-
if (this.
|
|
4328
|
+
if (!this.noScrolledInit) {
|
|
4242
4329
|
this.init.next();
|
|
4243
4330
|
}
|
|
4244
4331
|
}
|
|
@@ -4249,12 +4336,12 @@ const CatScrollable = class {
|
|
|
4249
4336
|
}
|
|
4250
4337
|
render() {
|
|
4251
4338
|
return [
|
|
4252
|
-
h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, this.
|
|
4339
|
+
h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
|
|
4253
4340
|
h("div", { ref: el => (this.scrollElement = el), class: {
|
|
4254
4341
|
'scrollable-content': true,
|
|
4255
|
-
'scroll-x': this.
|
|
4256
|
-
'scroll-y': this.
|
|
4257
|
-
'no-overscroll':
|
|
4342
|
+
'scroll-x': !this.noOverflowX,
|
|
4343
|
+
'scroll-y': !this.noOverflowY,
|
|
4344
|
+
'no-overscroll': this.noOverscroll
|
|
4258
4345
|
} }, h("slot", null))
|
|
4259
4346
|
];
|
|
4260
4347
|
}
|
|
@@ -4364,86 +4451,48 @@ const CatSpinner = class {
|
|
|
4364
4451
|
};
|
|
4365
4452
|
CatSpinner.style = catSpinnerCss;
|
|
4366
4453
|
|
|
4367
|
-
|
|
4454
|
+
const catToastDemoCss = ":host{display:block}";
|
|
4368
4455
|
|
|
4369
|
-
const
|
|
4370
|
-
|
|
4371
|
-
let nextUniqueId$2 = 0;
|
|
4372
|
-
const CatTextarea = class {
|
|
4456
|
+
const CatToastDemo = class {
|
|
4373
4457
|
constructor(hostRef) {
|
|
4374
4458
|
registerInstance(this, hostRef);
|
|
4375
|
-
this.catChange = createEvent(this, "catChange", 7);
|
|
4376
|
-
this.catFocus = createEvent(this, "catFocus", 7);
|
|
4377
|
-
this.catBlur = createEvent(this, "catBlur", 7);
|
|
4378
|
-
this.id = `cat-textarea-${nextUniqueId$2++}`;
|
|
4379
|
-
/**
|
|
4380
|
-
* Whether the textarea is disabled.
|
|
4381
|
-
*/
|
|
4382
|
-
this.disabled = false;
|
|
4383
|
-
/**
|
|
4384
|
-
* The label for the textarea.
|
|
4385
|
-
*/
|
|
4386
|
-
this.label = '';
|
|
4387
|
-
/**
|
|
4388
|
-
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
4389
|
-
*/
|
|
4390
|
-
this.labelHidden = false;
|
|
4391
|
-
/**
|
|
4392
|
-
* The name of the form control. Submitted with the form as part of a name/value pair.
|
|
4393
|
-
*/
|
|
4394
|
-
this.name = '';
|
|
4395
|
-
/**
|
|
4396
|
-
* The value is not editable.
|
|
4397
|
-
*/
|
|
4398
|
-
this.readonly = false;
|
|
4399
|
-
/**
|
|
4400
|
-
* A value is required or must be check for the form to be submittable.
|
|
4401
|
-
*/
|
|
4402
|
-
this.required = false;
|
|
4403
|
-
/**
|
|
4404
|
-
* Specifies the initial number of lines in the textarea.
|
|
4405
|
-
*/
|
|
4406
|
-
this.rows = 3;
|
|
4407
|
-
}
|
|
4408
|
-
componentWillRender() {
|
|
4409
|
-
if (!this.label) {
|
|
4410
|
-
loglevel.error('[A11y] Missing ARIA label on textarea', this);
|
|
4411
|
-
}
|
|
4412
|
-
}
|
|
4413
|
-
componentDidLoad() {
|
|
4414
|
-
d(this.textarea);
|
|
4415
4459
|
}
|
|
4416
|
-
/**
|
|
4417
|
-
* Sets focus on the textarea. Use this method instead of `textarea.focus()`.
|
|
4418
|
-
*
|
|
4419
|
-
* @param options An optional object providing options to control aspects of
|
|
4420
|
-
* the focusing process.
|
|
4421
|
-
*/
|
|
4422
|
-
async setFocus(options) {
|
|
4423
|
-
this.textarea.focus(options);
|
|
4424
|
-
}
|
|
4425
|
-
// /**
|
|
4426
|
-
// * Clear the input.
|
|
4427
|
-
// */
|
|
4428
|
-
// @Method()
|
|
4429
|
-
// async clear(): Promise<void> {
|
|
4430
|
-
// this.inputValue = '';
|
|
4431
|
-
// }
|
|
4432
4460
|
render() {
|
|
4433
|
-
return
|
|
4461
|
+
return h("cat-button", { onClick: this.onClick.bind(this) }, "Show Notifications");
|
|
4434
4462
|
}
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4463
|
+
onClick() {
|
|
4464
|
+
const infoOptions = {
|
|
4465
|
+
position: 'top-left'
|
|
4466
|
+
};
|
|
4467
|
+
const errorOptions = {
|
|
4468
|
+
position: 'top-center',
|
|
4469
|
+
type: 'error'
|
|
4470
|
+
};
|
|
4471
|
+
const errorOptions2 = {
|
|
4472
|
+
position: 'bottom-left',
|
|
4473
|
+
type: 'error'
|
|
4474
|
+
};
|
|
4475
|
+
const successOptions3 = {
|
|
4476
|
+
position: 'bottom-right',
|
|
4477
|
+
type: 'success'
|
|
4478
|
+
};
|
|
4479
|
+
const template = document.createElement('template');
|
|
4480
|
+
template.innerHTML = `<div style="padding: 7px 30px 7px 10px">Custom HTML Node Content</div>`;
|
|
4481
|
+
const successOptions4 = {
|
|
4482
|
+
position: 'bottom-right',
|
|
4483
|
+
type: 'success',
|
|
4484
|
+
content: template.content.firstChild
|
|
4485
|
+
};
|
|
4486
|
+
NotificationsService.error('Default Click');
|
|
4487
|
+
NotificationsService.error('Long default title, long default title, long default title, long default title');
|
|
4488
|
+
NotificationsService.info('Info Click', 'Info message', infoOptions);
|
|
4489
|
+
NotificationsService.success('', ' ', successOptions4);
|
|
4490
|
+
NotificationsService.error('Error Title', ' ', errorOptions);
|
|
4491
|
+
NotificationsService.error('Error 2 Title', 'Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message,Very long message, Very long message, Very long message, Very long message, Very long message, ', errorOptions2);
|
|
4492
|
+
NotificationsService.success('Success Title - very long title without message', ' ', successOptions3);
|
|
4444
4493
|
}
|
|
4445
4494
|
};
|
|
4446
|
-
|
|
4495
|
+
CatToastDemo.style = catToastDemoCss;
|
|
4447
4496
|
|
|
4448
4497
|
const catToggleCss = ":host{display:flex;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;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{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}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:#d7dbe0;transition:background-color 0.13s ease}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 32, 127, 138))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem))}.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))}";
|
|
4449
4498
|
|
|
@@ -4628,6 +4677,6 @@ const CatTooltip = class {
|
|
|
4628
4677
|
CatTooltip.OFFSET = 4;
|
|
4629
4678
|
CatTooltip.style = catTooltipCss;
|
|
4630
4679
|
|
|
4631
|
-
export { CatAlert as cat_alert, CatBadge as cat_badge, CatButton as cat_button, CatCard as cat_card, CatCheckbox as cat_checkbox, CatIcon as cat_icon, CatInput as cat_input, CatMenu as cat_menu, CatRadio as cat_radio, CatScrollable as cat_scrollable, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner,
|
|
4680
|
+
export { CatAlert as cat_alert, CatAvatar as cat_avatar, CatBadge as cat_badge, CatButton as cat_button, CatCard as cat_card, CatCheckbox as cat_checkbox, CatIcon as cat_icon, CatInput as cat_input, CatMenu as cat_menu, CatRadio as cat_radio, CatScrollable as cat_scrollable, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner, CatToastDemo as cat_toast_demo, CatToggle as cat_toggle, CatTooltip as cat_tooltip };
|
|
4632
4681
|
|
|
4633
|
-
//# sourceMappingURL=cat-
|
|
4682
|
+
//# sourceMappingURL=cat-alert_16.entry.js.map
|