@fluid-topics/ftds-chip-group 2.2.14 → 2.2.16
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/ftds-chip-group.d.ts +1 -2
- package/build/ftds-chip-group.js +13 -17
- package/build/ftds-chip-group.light.js +35 -35
- package/build/ftds-chip-group.min.js +42 -42
- package/package.json +12 -12
|
@@ -22,7 +22,6 @@ export declare class FtdsChipGroup extends FtdsChipGroup_base implements FtdsChi
|
|
|
22
22
|
private handleFocusOnChipDeleted;
|
|
23
23
|
private focusChip;
|
|
24
24
|
private toggleExtraChips;
|
|
25
|
-
private
|
|
26
|
-
private getIconVariant;
|
|
25
|
+
private getIconAndVariant;
|
|
27
26
|
}
|
|
28
27
|
export {};
|
package/build/ftds-chip-group.js
CHANGED
|
@@ -80,7 +80,8 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
80
80
|
`;
|
|
81
81
|
}
|
|
82
82
|
renderChip(chip) {
|
|
83
|
-
var _a, _b, _c, _d
|
|
83
|
+
var _a, _b, _c, _d;
|
|
84
|
+
const { icon, iconVariant } = this.getIconAndVariant(chip);
|
|
84
85
|
return html `
|
|
85
86
|
<li>
|
|
86
87
|
<ft-tooltip
|
|
@@ -91,11 +92,11 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
91
92
|
exportparts="chip"
|
|
92
93
|
?removable=${this.removable}
|
|
93
94
|
.family=${(_b = chip.family) !== null && _b !== void 0 ? _b : DesignSystemFamily.neutral}
|
|
94
|
-
.icon=${
|
|
95
|
-
.iconVariant=${
|
|
96
|
-
.removeButtonLabel=${(
|
|
95
|
+
.icon=${icon}
|
|
96
|
+
.iconVariant=${iconVariant}
|
|
97
|
+
.removeButtonLabel=${(_c = chip.removeLabel) !== null && _c !== void 0 ? _c : chipGroupContext.messages.defaultRemoveLabel()}
|
|
97
98
|
@remove=${() => this.onChipRemoved(chip)}>
|
|
98
|
-
${(
|
|
99
|
+
${(_d = chip.label) !== null && _d !== void 0 ? _d : chip.value}
|
|
99
100
|
</ftds-chip>
|
|
100
101
|
</ft-tooltip>
|
|
101
102
|
</li>
|
|
@@ -128,19 +129,14 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
128
129
|
toggleExtraChips(e) {
|
|
129
130
|
this.isPopoverOpened = e.detail.opened;
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
getIconAndVariant(chip) {
|
|
133
|
+
if (chip.family === DesignSystemFamily.warning) {
|
|
134
|
+
return {
|
|
135
|
+
icon: FtdsIcons.TRIANGLE_EXCLAMATION,
|
|
136
|
+
iconVariant: FtdsIconVariants.solid,
|
|
137
|
+
};
|
|
137
138
|
}
|
|
138
|
-
|
|
139
|
-
getIconVariant(icon, iconVariant) {
|
|
140
|
-
if (icon) {
|
|
141
|
-
return iconVariant !== null && iconVariant !== void 0 ? iconVariant : FtdsIconVariants.regular;
|
|
142
|
-
}
|
|
143
|
-
return FtdsIconVariants.solid;
|
|
139
|
+
return { icon: chip.icon, iconVariant: chip.iconVariant };
|
|
144
140
|
}
|
|
145
141
|
}
|
|
146
142
|
FtdsChipGroup.elementDefinitions = {
|