@haiilo/catalyst 1.1.0 → 1.1.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.esm.js +1 -1
- package/dist/catalyst/p-a4d0b054.entry.js +10 -0
- package/dist/catalyst/p-a4d0b054.entry.js.map +1 -0
- package/dist/cjs/cat-alert_23.cjs.entry.js +35 -23
- package/dist/cjs/cat-alert_23.cjs.entry.js.map +1 -1
- package/dist/collection/components/cat-alert/cat-alert.js +8 -8
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.css +8 -8
- package/dist/collection/components/cat-badge/cat-badge.css +20 -26
- package/dist/collection/components/cat-badge/cat-badge.js +9 -12
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.js +2 -3
- package/dist/collection/components/cat-card/cat-card.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +5 -0
- package/dist/collection/components/cat-select/cat-select.js +6 -1
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +5 -5
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/utils/setDefault.js +9 -0
- package/dist/collection/utils/setDefault.js.map +1 -0
- package/dist/components/cat-alert.js +7 -7
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar2.js +1 -1
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +9 -9
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-card.js +2 -2
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-select-demo.js +3 -3
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +7 -2
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/setDefault.js +12 -0
- package/dist/components/setDefault.js.map +1 -0
- package/dist/esm/cat-alert_23.entry.js +35 -23
- package/dist/esm/cat-alert_23.entry.js.map +1 -1
- package/dist/types/components/cat-alert/cat-alert.d.ts +1 -2
- package/dist/types/components/cat-badge/cat-badge.d.ts +2 -2
- package/dist/types/components/cat-select/cat-select.d.ts +2 -0
- package/dist/types/utils/setDefault.d.ts +6 -0
- package/package.json +2 -2
- package/dist/catalyst/p-78b3fc17.entry.js +0 -10
- package/dist/catalyst/p-78b3fc17.entry.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component, h, Host, Prop
|
|
1
|
+
import { Component, Element, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
import { setAttributeDefault, setPropertyDefault } from '../../utils/setDefault';
|
|
2
3
|
/**
|
|
3
4
|
* Informs user about important changes or conditions in the interface. Use this
|
|
4
5
|
* component if you need to capture user’s attention in a prominent way.
|
|
@@ -28,18 +29,17 @@ export class CatAlert {
|
|
|
28
29
|
*/
|
|
29
30
|
this.noIcon = false;
|
|
30
31
|
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
setAttributeDefault(this, 'tabindex', 0);
|
|
34
|
+
setAttributeDefault(this, 'role', this.mapRole.get(this.color));
|
|
35
|
+
setPropertyDefault(this, 'color');
|
|
36
|
+
}
|
|
31
37
|
render() {
|
|
32
|
-
return (h(Host,
|
|
38
|
+
return (h(Host, null,
|
|
33
39
|
!this.noIcon && h("cat-icon", { size: "l", icon: this.icon ? this.icon : this.mapIcon.get(this.color) }),
|
|
34
40
|
h("div", { class: "content" },
|
|
35
41
|
h("slot", null))));
|
|
36
42
|
}
|
|
37
|
-
get tabIndex() {
|
|
38
|
-
return this.hostElement.getAttribute('tabindex') || '0';
|
|
39
|
-
}
|
|
40
|
-
get role() {
|
|
41
|
-
return this.hostElement.getAttribute('role') || this.mapRole.get(this.color) || null;
|
|
42
|
-
}
|
|
43
43
|
static get is() { return "cat-alert"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
45
45
|
static get originalStyleUrls() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-alert.js","sourceRoot":"","sources":["../../../src/components/cat-alert/cat-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cat-alert.js","sourceRoot":"","sources":["../../../src/components/cat-alert/cat-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjF;;;GAGG;AAMH,MAAM,OAAO,QAAQ;EALrB;IAMmB,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,WAAW,EAAE,cAAc,CAAC;MAC7B,CAAC,SAAS,EAAE,qBAAqB,CAAC;MAClC,CAAC,SAAS,EAAE,eAAe,CAAC;MAC5B,CAAC,QAAQ,EAAE,qBAAqB,CAAC;KAClC,CAAC,CAAC;IACc,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,WAAW,EAAE,QAAQ,CAAC;MACvB,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,SAAS,EAAE,OAAO,CAAC;MACpB,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;IAIH;;OAEG;IACK,UAAK,GAA+D,SAAS,CAAC;IAOtF;;OAEG;IACK,WAAM,GAAG,KAAK,CAAC;GAkBxB;EAhBC,iBAAiB;IACf,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;EACpC,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACF,CAAC,IAAI,CAAC,MAAM,IAAI,gBAAU,IAAI,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa;MAC3G,WAAK,KAAK,EAAC,SAAS;QAClB,eAAa,CACT,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { setAttributeDefault, setPropertyDefault } from '../../utils/setDefault';\n\n/**\n * Informs user about important changes or conditions in the interface. Use this\n * component if you need to capture user’s attention in a prominent way.\n */\n@Component({\n tag: 'cat-alert',\n styleUrl: 'cat-alert.scss',\n shadow: true\n})\nexport class CatAlert {\n private readonly mapIcon: Map<string, string> = new Map([\n ['primary', 'star-circle-filled'],\n ['secondary', 'clock-filled'],\n ['success', 'check-circle-filled'],\n ['warning', 'danger-filled'],\n ['danger', 'cross-circle-filled']\n ]);\n private readonly mapRole: Map<string, string> = new Map([\n ['primary', 'status'],\n ['secondary', 'status'],\n ['success', 'status'],\n ['warning', 'alert'],\n ['danger', 'alert']\n ]);\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The color palette of the alert.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The name of an icon to be displayed in the alert.\n */\n @Prop() icon?: string;\n\n /**\n * Whether the icon of the alert is deactivated.\n */\n @Prop() noIcon = false;\n\n connectedCallback() {\n setAttributeDefault(this, 'tabindex', 0);\n setAttributeDefault(this, 'role', this.mapRole.get(this.color));\n setPropertyDefault(this, 'color');\n }\n\n render() {\n return (\n <Host>\n {!this.noIcon && <cat-icon size=\"l\" icon={this.icon ? this.icon : this.mapIcon.get(this.color)}></cat-icon>}\n <div class=\"content\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -10,13 +10,7 @@
|
|
|
10
10
|
* @prop --cat-avatar-size: The size of the avatar.
|
|
11
11
|
* @prop --cat-avatar-font-size: The font size of the avatar.
|
|
12
12
|
*/
|
|
13
|
-
display:
|
|
14
|
-
vertical-align: middle;
|
|
15
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
16
|
-
-webkit-user-select: none;
|
|
17
|
-
-ms-user-select: none;
|
|
18
|
-
user-select: none;
|
|
19
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
13
|
+
display: contents;
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
:host([hidden]) {
|
|
@@ -24,7 +18,7 @@
|
|
|
24
18
|
}
|
|
25
19
|
|
|
26
20
|
.avatar {
|
|
27
|
-
display: flex;
|
|
21
|
+
display: inline-flex;
|
|
28
22
|
align-items: center;
|
|
29
23
|
justify-content: center;
|
|
30
24
|
border-radius: 0.25rem;
|
|
@@ -35,6 +29,12 @@
|
|
|
35
29
|
background-position: center;
|
|
36
30
|
white-space: nowrap;
|
|
37
31
|
overflow: hidden;
|
|
32
|
+
vertical-align: middle;
|
|
33
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
34
|
+
-webkit-user-select: none;
|
|
35
|
+
-ms-user-select: none;
|
|
36
|
+
user-select: none;
|
|
37
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
38
38
|
}
|
|
39
39
|
.avatar:focus-visible {
|
|
40
40
|
outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
|
|
@@ -3,28 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/* stylelint-disable value-keyword-case */
|
|
5
5
|
/* stylelint-enable value-keyword-case */
|
|
6
|
-
:host {
|
|
7
|
-
display: inline-block;
|
|
8
|
-
max-width: 100%;
|
|
9
|
-
vertical-align: baseline;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
:host([hidden]) {
|
|
13
7
|
display: none;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
font: inherit;
|
|
10
|
+
:host {
|
|
18
11
|
display: inline-flex;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
vertical-align: baseline;
|
|
19
14
|
align-items: center;
|
|
20
15
|
justify-content: center;
|
|
21
16
|
border-radius: 0.125rem;
|
|
22
17
|
text-decoration: none;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
width: 100%;
|
|
25
18
|
line-height: 1;
|
|
26
19
|
}
|
|
27
|
-
|
|
20
|
+
:host slot {
|
|
28
21
|
display: inline-block;
|
|
29
22
|
/* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
30
23
|
overflow: hidden;
|
|
@@ -33,11 +26,11 @@
|
|
|
33
26
|
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
34
27
|
}
|
|
35
28
|
|
|
36
|
-
|
|
29
|
+
:host([round]) {
|
|
37
30
|
border-radius: 10rem;
|
|
38
31
|
}
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
:host([variant=filled]) {
|
|
41
34
|
background-color: rgb(var(--bg));
|
|
42
35
|
color: rgb(var(--fill));
|
|
43
36
|
font-weight: 600;
|
|
@@ -45,86 +38,87 @@
|
|
|
45
38
|
-moz-osx-font-smoothing: greyscale;
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
:host([variant=outlined]) {
|
|
49
42
|
background-color: white;
|
|
50
43
|
box-shadow: inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
51
44
|
color: rgb(var(--text));
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
|
|
47
|
+
:host([color=primary]) {
|
|
55
48
|
--bg: var(--cat-primary-bg, 32, 127, 138);
|
|
56
49
|
--fill: var(--cat-primary-fill, 255, 255, 255);
|
|
57
50
|
--text: var(--cat-primary-text, 32, 127, 138);
|
|
58
51
|
--border: var(--cat-primary-text, 32, 127, 138);
|
|
59
52
|
}
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
:host([color=secondary]) {
|
|
62
55
|
--bg: 105, 118, 135;
|
|
63
56
|
--fill: 255, 255, 255;
|
|
64
57
|
--text: 0, 0, 0;
|
|
65
58
|
--border: 105, 118, 135;
|
|
66
59
|
}
|
|
67
60
|
|
|
68
|
-
|
|
61
|
+
:host([color=success]) {
|
|
69
62
|
--bg: 0, 132, 88;
|
|
70
63
|
--fill: 255, 255, 255;
|
|
71
64
|
--text: 0, 132, 88;
|
|
72
65
|
--border: 0, 132, 88;
|
|
73
66
|
}
|
|
74
67
|
|
|
75
|
-
|
|
68
|
+
:host([color=warning]) {
|
|
76
69
|
--bg: 255, 206, 128;
|
|
77
70
|
--fill: 0, 0, 0;
|
|
78
71
|
--text: 159, 97, 0;
|
|
79
72
|
--border: 159, 97, 0;
|
|
80
73
|
}
|
|
81
74
|
|
|
82
|
-
|
|
75
|
+
:host([color=danger]) {
|
|
83
76
|
--bg: 217, 52, 13;
|
|
84
77
|
--fill: 255, 255, 255;
|
|
85
78
|
--text: 217, 52, 13;
|
|
86
79
|
--border: 217, 52, 13;
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
|
|
82
|
+
:host([size=xs]) {
|
|
90
83
|
height: 1rem;
|
|
91
84
|
min-width: 1rem;
|
|
92
85
|
font-size: 0.75rem;
|
|
93
86
|
padding: 0 0.25rem;
|
|
94
87
|
}
|
|
95
88
|
|
|
96
|
-
|
|
89
|
+
:host([size=s]) {
|
|
97
90
|
height: 1.5rem;
|
|
98
91
|
min-width: 1.5rem;
|
|
99
92
|
font-size: 0.75rem;
|
|
100
93
|
padding: 0 0.5rem;
|
|
101
94
|
}
|
|
102
95
|
|
|
103
|
-
|
|
96
|
+
:host([size=m]) {
|
|
104
97
|
height: 2rem;
|
|
105
98
|
min-width: 2rem;
|
|
106
99
|
font-size: 0.875rem;
|
|
107
100
|
padding: 0 0.75rem;
|
|
108
101
|
}
|
|
109
102
|
|
|
110
|
-
|
|
103
|
+
:host([size=l]) {
|
|
111
104
|
height: 2.5rem;
|
|
112
105
|
min-width: 2.5rem;
|
|
113
106
|
font-size: 0.9375rem;
|
|
114
107
|
padding: 0 1rem;
|
|
115
108
|
}
|
|
116
109
|
|
|
117
|
-
|
|
110
|
+
:host([size=xl]) {
|
|
118
111
|
height: 3rem;
|
|
119
112
|
min-width: 3rem;
|
|
120
113
|
font-size: 1.125rem;
|
|
121
114
|
padding: 0 1rem;
|
|
122
115
|
}
|
|
123
116
|
|
|
124
|
-
|
|
117
|
+
:host([pulse][variant=filled]) {
|
|
125
118
|
animation: 1.5s ease 0s infinite normal none running pulse;
|
|
126
119
|
}
|
|
127
|
-
|
|
120
|
+
|
|
121
|
+
:host([pulse][variant=outlined]) {
|
|
128
122
|
animation: 1.5s ease 0s infinite normal none running pulse-outlined;
|
|
129
123
|
}
|
|
130
124
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Component, h, Prop } from '@stencil/core';
|
|
1
|
+
import { Component, Element, h, Prop } from '@stencil/core';
|
|
2
|
+
import { setPropertyDefault } from '../../utils/setDefault';
|
|
2
3
|
/**
|
|
3
4
|
* Badges are used to inform users of the status of an object or of an action
|
|
4
5
|
* that’s been taken.
|
|
5
|
-
*
|
|
6
|
-
* @part badge - The badge element.
|
|
7
6
|
*/
|
|
8
7
|
export class CatBadge {
|
|
9
8
|
constructor() {
|
|
@@ -28,16 +27,13 @@ export class CatBadge {
|
|
|
28
27
|
*/
|
|
29
28
|
this.pulse = false;
|
|
30
29
|
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
setPropertyDefault(this, 'variant');
|
|
32
|
+
setPropertyDefault(this, 'color');
|
|
33
|
+
setPropertyDefault(this, 'size');
|
|
34
|
+
}
|
|
31
35
|
render() {
|
|
32
|
-
return
|
|
33
|
-
badge: true,
|
|
34
|
-
'badge-round': this.round,
|
|
35
|
-
'badge-pulse': this.pulse,
|
|
36
|
-
[`badge-${this.variant}`]: Boolean(this.variant),
|
|
37
|
-
[`badge-${this.color}`]: Boolean(this.color),
|
|
38
|
-
[`badge-${this.size}`]: Boolean(this.size)
|
|
39
|
-
} },
|
|
40
|
-
h("slot", null)));
|
|
36
|
+
return h("slot", null);
|
|
41
37
|
}
|
|
42
38
|
static get is() { return "cat-badge"; }
|
|
43
39
|
static get encapsulation() { return "shadow"; }
|
|
@@ -139,5 +135,6 @@ export class CatBadge {
|
|
|
139
135
|
"defaultValue": "false"
|
|
140
136
|
}
|
|
141
137
|
}; }
|
|
138
|
+
static get elementRef() { return "hostElement"; }
|
|
142
139
|
}
|
|
143
140
|
//# sourceMappingURL=cat-badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-badge.js","sourceRoot":"","sources":["../../../src/components/cat-badge/cat-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cat-badge.js","sourceRoot":"","sources":["../../../src/components/cat-badge/cat-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;GAGG;AAMH,MAAM,OAAO,QAAQ;EALrB;IAQE;;OAEG;IACK,YAAO,GAA0B,QAAQ,CAAC;IAElD;;OAEG;IACK,UAAK,GAA+D,SAAS,CAAC;IAEtF;;OAEG;IACK,SAAI,GAAkC,GAAG,CAAC;IAElD;;OAEG;IACK,UAAK,GAAG,KAAK,CAAC;IAEtB;;OAEG;IACK,UAAK,GAAG,KAAK,CAAC;GAWvB;EATC,iBAAiB;IACf,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACpC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACnC,CAAC;EAED,MAAM;IACJ,OAAO,eAAa,CAAC;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop } from '@stencil/core';\nimport { setPropertyDefault } from '../../utils/setDefault';\n\n/**\n * Badges are used to inform users of the status of an object or of an action\n * that’s been taken.\n */\n@Component({\n tag: 'cat-badge',\n styleUrl: 'cat-badge.scss',\n shadow: true\n})\nexport class CatBadge {\n @Element() hostElement!: HTMLElement;\n\n /**\n * The rendering style of the badge.\n */\n @Prop() variant: 'filled' | 'outlined' = 'filled';\n\n /**\n * The color palette of the badge.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The size of the badge.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * Use round badge edges.\n */\n @Prop() round = false;\n\n /**\n * Draw attention to the badge with a subtle animation.\n */\n @Prop() pulse = false;\n\n connectedCallback() {\n setPropertyDefault(this, 'variant');\n setPropertyDefault(this, 'color');\n setPropertyDefault(this, 'size');\n }\n\n render() {\n return <slot></slot>;\n }\n}\n"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, h } from '@stencil/core';
|
|
2
2
|
/**
|
|
3
3
|
* Cards are surfaces that display content and actions on a single topic. They
|
|
4
4
|
* should be easy to scan for relevant and actionable information.
|
|
5
5
|
*/
|
|
6
6
|
export class CatCard {
|
|
7
7
|
render() {
|
|
8
|
-
return
|
|
9
|
-
h("slot", null)));
|
|
8
|
+
return h("slot", null);
|
|
10
9
|
}
|
|
11
10
|
static get is() { return "cat-card"; }
|
|
12
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-card.js","sourceRoot":"","sources":["../../../src/components/cat-card/cat-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"cat-card.js","sourceRoot":"","sources":["../../../src/components/cat-card/cat-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AAMH,MAAM,OAAO,OAAO;EAClB,MAAM;IACJ,OAAO,eAAa,CAAC;EACvB,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, h } from '@stencil/core';\n\n/**\n * Cards are surfaces that display content and actions on a single topic. They\n * should be easy to scan for relevant and actionable information.\n */\n@Component({\n tag: 'cat-card',\n styleUrl: 'cat-card.scss',\n shadow: true\n})\nexport class CatCard {\n render() {\n return <slot></slot>;\n }\n}\n"]}
|
|
@@ -134,6 +134,7 @@ label.hidden {
|
|
|
134
134
|
.pill > span {
|
|
135
135
|
overflow: hidden;
|
|
136
136
|
text-overflow: ellipsis;
|
|
137
|
+
flex: 1 1 0%;
|
|
137
138
|
}
|
|
138
139
|
.pill > cat-button {
|
|
139
140
|
margin-right: -0.25rem;
|
|
@@ -193,6 +194,10 @@ cat-spinner {
|
|
|
193
194
|
--cat-avatar-size: 1.25rem;
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
.select-option-text {
|
|
198
|
+
flex: 1 1 0%;
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
.select-option-single {
|
|
197
202
|
cursor: pointer;
|
|
198
203
|
}
|
|
@@ -182,6 +182,11 @@ export class CatSelect {
|
|
|
182
182
|
if (this.state.activeSelectionIndex >= 0) {
|
|
183
183
|
this.deselect(this.state.selection[this.state.activeSelectionIndex].item.id);
|
|
184
184
|
}
|
|
185
|
+
else if (this.state.selection.length) {
|
|
186
|
+
const selectionClone = [...this.state.selection];
|
|
187
|
+
selectionClone.pop();
|
|
188
|
+
this.patchState({ selection: selectionClone });
|
|
189
|
+
}
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
192
|
else if (event.key === 'Tab') {
|
|
@@ -236,7 +241,7 @@ export class CatSelect {
|
|
|
236
241
|
.subscribe(items => {
|
|
237
242
|
var _a;
|
|
238
243
|
const options = items === null || items === void 0 ? void 0 : items.map(item => ({
|
|
239
|
-
item,
|
|
244
|
+
item: Object.assign(Object.assign({}, item), { id: this.connectorSafe.customId ? this.connectorSafe.customId(item) : item.id }),
|
|
240
245
|
render: this.connectorSafe.render(item)
|
|
241
246
|
}));
|
|
242
247
|
if (this.tags &&
|