@fluid-topics/ftds-chip-group 2.2.13 → 2.2.15
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.js
CHANGED
|
@@ -81,6 +81,7 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
81
81
|
}
|
|
82
82
|
renderChip(chip) {
|
|
83
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,8 +92,8 @@ 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=${
|
|
95
|
+
.icon=${icon}
|
|
96
|
+
.iconVariant=${iconVariant}
|
|
96
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}
|
|
@@ -128,13 +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
|
}
|
|
139
|
+
return { icon: chip.icon, iconVariant: chip.iconVariant };
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
FtdsChipGroup.elementDefinitions = {
|