@fluid-topics/ft-chip 1.2.49 → 1.2.51
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/build/ft-chip.d.ts +1 -0
- package/build/ft-chip.js +17 -12
- package/build/ft-chip.light.js +62 -59
- package/build/ft-chip.min.js +178 -175
- package/build/ft-chip.property.d.ts +1 -0
- package/build/ftds-chip.d.ts +2 -1
- package/build/ftds-chip.js +23 -15
- package/build/ftds-chip.styles.js +2 -2
- package/package.json +6 -6
package/build/ftds-chip.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare class RemoveEvent extends CustomEvent<void> {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class FtdsChip extends FtdsBase implements FtdsChipProperties {
|
|
7
7
|
static elementDefinitions: ElementDefinitionsMap;
|
|
8
|
+
withAction: boolean;
|
|
8
9
|
removable: boolean;
|
|
9
10
|
removeButtonLabel: string;
|
|
10
11
|
label: string;
|
|
@@ -13,7 +14,7 @@ export declare class FtdsChip extends FtdsBase implements FtdsChipProperties {
|
|
|
13
14
|
static styles: import("lit").CSSResult[];
|
|
14
15
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
15
16
|
private renderIcon;
|
|
16
|
-
private
|
|
17
|
+
private renderAction;
|
|
17
18
|
private resolveButtonSize;
|
|
18
19
|
private getLabel;
|
|
19
20
|
get textContent(): string;
|
package/build/ftds-chip.js
CHANGED
|
@@ -21,6 +21,7 @@ export class RemoveEvent extends CustomEvent {
|
|
|
21
21
|
class FtdsChip extends FtdsBase {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
+
this.withAction = false;
|
|
24
25
|
this.removable = false;
|
|
25
26
|
this.removeButtonLabel = "Remove";
|
|
26
27
|
this.label = "";
|
|
@@ -28,7 +29,7 @@ class FtdsChip extends FtdsBase {
|
|
|
28
29
|
render() {
|
|
29
30
|
const classes = {
|
|
30
31
|
"ftds-chip": true,
|
|
31
|
-
"ftds-chip--
|
|
32
|
+
"ftds-chip--with-action": this.removable || this.withAction,
|
|
32
33
|
"ftds-chip--with-icon": !!this.icon,
|
|
33
34
|
...this.getDesignSystemBaseClasses()
|
|
34
35
|
};
|
|
@@ -40,7 +41,7 @@ class FtdsChip extends FtdsBase {
|
|
|
40
41
|
<ft-typography variant=${this.typographyVariant()} element="span" class="ftds-chip--label" part="label">
|
|
41
42
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
42
43
|
</ft-typography>
|
|
43
|
-
${this.
|
|
44
|
+
${this.renderAction()}
|
|
44
45
|
</div>
|
|
45
46
|
`;
|
|
46
47
|
}
|
|
@@ -52,19 +53,23 @@ class FtdsChip extends FtdsBase {
|
|
|
52
53
|
</div>
|
|
53
54
|
` : nothing;
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
html `
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
renderAction() {
|
|
57
|
+
if (this.removable) {
|
|
58
|
+
return html `
|
|
59
|
+
<ftds-button round
|
|
60
|
+
class="ftds-chip--remove-button"
|
|
61
|
+
@click=${this.dispatchRemoveEvent}
|
|
62
|
+
icon=${FtIcons.X_MARK}
|
|
63
|
+
label=${this.removeButtonLabel}
|
|
64
|
+
family=${DesignSystemFamily.neutral}
|
|
65
|
+
size=${this.resolveButtonSize()}
|
|
66
|
+
part="icon-button"
|
|
67
|
+
></ftds-button>
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
return this.withAction ? html `
|
|
71
|
+
<slot name="action"></slot>
|
|
72
|
+
` : nothing;
|
|
68
73
|
}
|
|
69
74
|
resolveButtonSize() {
|
|
70
75
|
switch (this.size) {
|
|
@@ -105,6 +110,9 @@ FtdsChip.elementDefinitions = {
|
|
|
105
110
|
"ftds-button": FtdsButton,
|
|
106
111
|
};
|
|
107
112
|
FtdsChip.styles = designSystemStyle;
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Boolean })
|
|
115
|
+
], FtdsChip.prototype, "withAction", void 0);
|
|
108
116
|
__decorate([
|
|
109
117
|
property({ type: Boolean })
|
|
110
118
|
], FtdsChip.prototype, "removable", void 0);
|
|
@@ -31,7 +31,7 @@ export const designSystemStyle = [
|
|
|
31
31
|
${setVariable(FtIconCssVariables.size, chip.mediumIconSize)}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.ftds--size-medium.ftds-chip--
|
|
34
|
+
.ftds--size-medium.ftds-chip--with-action {
|
|
35
35
|
padding-right: ${chip.mediumButtonRightPadding};
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -47,7 +47,7 @@ export const designSystemStyle = [
|
|
|
47
47
|
${setVariable(FtIconCssVariables.size, chip.largeIconSize)}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.ftds--size-large.ftds-chip--
|
|
50
|
+
.ftds--size-large.ftds-chip--with-action {
|
|
51
51
|
padding-right: ${chip.largeButtonRightPadding};
|
|
52
52
|
}
|
|
53
53
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-chip",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.51",
|
|
4
4
|
"description": "A generic Fluid Topics chip",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fluid-topics/design-system-variables": "0.1.92",
|
|
23
|
-
"@fluid-topics/ft-icon": "1.2.
|
|
24
|
-
"@fluid-topics/ft-ripple": "1.2.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.2.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
23
|
+
"@fluid-topics/ft-icon": "1.2.51",
|
|
24
|
+
"@fluid-topics/ft-ripple": "1.2.51",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.2.51",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.2.51",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f37803963479545409bdddea3571d34dbad90413"
|
|
30
30
|
}
|