@fluid-topics/ftds-chip-group 2.2.13 → 2.2.14
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
|
@@ -80,7 +80,7 @@ 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, _e;
|
|
84
84
|
return html `
|
|
85
85
|
<li>
|
|
86
86
|
<ft-tooltip
|
|
@@ -91,11 +91,11 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
91
91
|
exportparts="chip"
|
|
92
92
|
?removable=${this.removable}
|
|
93
93
|
.family=${(_b = chip.family) !== null && _b !== void 0 ? _b : DesignSystemFamily.neutral}
|
|
94
|
-
.icon=${this.getFamilyIcon(chip.family)}
|
|
95
|
-
.iconVariant=${
|
|
96
|
-
.removeButtonLabel=${(
|
|
94
|
+
.icon=${(_c = chip.icon) !== null && _c !== void 0 ? _c : this.getFamilyIcon(chip.family)}
|
|
95
|
+
.iconVariant=${this.getIconVariant(chip.icon, chip.iconVariant)}
|
|
96
|
+
.removeButtonLabel=${(_d = chip.removeLabel) !== null && _d !== void 0 ? _d : chipGroupContext.messages.defaultRemoveLabel()}
|
|
97
97
|
@remove=${() => this.onChipRemoved(chip)}>
|
|
98
|
-
${(
|
|
98
|
+
${(_e = chip.label) !== null && _e !== void 0 ? _e : chip.value}
|
|
99
99
|
</ftds-chip>
|
|
100
100
|
</ft-tooltip>
|
|
101
101
|
</li>
|
|
@@ -136,6 +136,12 @@ export class FtdsChipGroup extends withI18n(FtdsBase) {
|
|
|
136
136
|
return undefined;
|
|
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;
|
|
144
|
+
}
|
|
139
145
|
}
|
|
140
146
|
FtdsChipGroup.elementDefinitions = {
|
|
141
147
|
"ftds-chip": FtdsChip,
|
|
@@ -5,6 +5,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
5
5
|
max-width: 100%;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-wrap: wrap;
|
|
8
|
+
align-items: center;
|
|
8
9
|
gap: ${Le.verticalGap} ${Le.horizontalGap};
|
|
9
10
|
padding-left: 0;
|
|
10
11
|
margin: ${c.spacing1} 0;
|
|
@@ -2473,7 +2474,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
|
|
|
2473
2474
|
</div>
|
|
2474
2475
|
</ftds-popover>
|
|
2475
2476
|
</li>
|
|
2476
|
-
`}renderChip(t){var o,n,a,i;return Gn.html`
|
|
2477
|
+
`}renderChip(t){var o,n,a,i,s;return Gn.html`
|
|
2477
2478
|
<li>
|
|
2478
2479
|
<ft-tooltip
|
|
2479
2480
|
text="${(o=t.label)!==null&&o!==void 0?o:t.value}"
|
|
@@ -2483,15 +2484,15 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
|
|
|
2483
2484
|
exportparts="chip"
|
|
2484
2485
|
?removable=${this.removable}
|
|
2485
2486
|
.family=${(n=t.family)!==null&&n!==void 0?n:nt.DesignSystemFamily.neutral}
|
|
2486
|
-
.icon=${this.getFamilyIcon(t.family)}
|
|
2487
|
-
.iconVariant=${
|
|
2488
|
-
.removeButtonLabel=${(
|
|
2487
|
+
.icon=${(a=t.icon)!==null&&a!==void 0?a:this.getFamilyIcon(t.family)}
|
|
2488
|
+
.iconVariant=${this.getIconVariant(t.icon,t.iconVariant)}
|
|
2489
|
+
.removeButtonLabel=${(i=t.removeLabel)!==null&&i!==void 0?i:yo.messages.defaultRemoveLabel()}
|
|
2489
2490
|
@remove=${()=>this.onChipRemoved(t)}>
|
|
2490
|
-
${(
|
|
2491
|
+
${(s=t.label)!==null&&s!==void 0?s:t.value}
|
|
2491
2492
|
</ftds-chip>
|
|
2492
2493
|
</ft-tooltip>
|
|
2493
2494
|
</li>
|
|
2494
|
-
`}onChipRemoved(t){this.lastRemovedChipIndex=this.chips.findIndex(o=>o.value===t.value),this.dispatchEvent(new _r(t))}handleFocusOnChipDeleted(t){var o;let n=Array.from((o=this.allChips)!==null&&o!==void 0?o:[]);n.length!==0&&(n[t]?this.focusChip(n[t]):this.focusChip(n[t-1]))}async focusChip(t){var o;await t.updateComplete;let n=(o=t.shadowRoot)===null||o===void 0?void 0:o.querySelector(".ftds-chip--remove-button");await n?.updateComplete,n?.focus()}toggleExtraChips(t){this.isPopoverOpened=t.detail.opened}getFamilyIcon(t){if(t===nt.DesignSystemFamily.warning)return p.TRIANGLE_EXCLAMATION}};ke.elementDefinitions={"ftds-chip":ue,"ftds-popover":$,"ftds-typography":de,"ft-tooltip":ee};ke.styles=Xi;Rr([(0,er.property)({type:Boolean})],ke.prototype,"removable",void 0);Rr([(0,nt.numberProperty)()],ke.prototype,"maxNumberOfChips",void 0);Rr([(0,er.property)()],ke.prototype,"popoverTitle",void 0);Rr([(0,nt.jsonProperty)([])],ke.prototype,"chips",void 0);Rr([(0,er.state)()],ke.prototype,"isPopoverOpened",void 0);Rr([(0,er.queryAll)(".chip-group-chip")],ke.prototype,"allChips",void 0);var o4={"ftds-chip-group":ke};(0,n4.customElements)(o4);})();
|
|
2495
|
+
`}onChipRemoved(t){this.lastRemovedChipIndex=this.chips.findIndex(o=>o.value===t.value),this.dispatchEvent(new _r(t))}handleFocusOnChipDeleted(t){var o;let n=Array.from((o=this.allChips)!==null&&o!==void 0?o:[]);n.length!==0&&(n[t]?this.focusChip(n[t]):this.focusChip(n[t-1]))}async focusChip(t){var o;await t.updateComplete;let n=(o=t.shadowRoot)===null||o===void 0?void 0:o.querySelector(".ftds-chip--remove-button");await n?.updateComplete,n?.focus()}toggleExtraChips(t){this.isPopoverOpened=t.detail.opened}getFamilyIcon(t){if(t===nt.DesignSystemFamily.warning)return p.TRIANGLE_EXCLAMATION}getIconVariant(t,o){return t?o??u.regular:u.solid}};ke.elementDefinitions={"ftds-chip":ue,"ftds-popover":$,"ftds-typography":de,"ft-tooltip":ee};ke.styles=Xi;Rr([(0,er.property)({type:Boolean})],ke.prototype,"removable",void 0);Rr([(0,nt.numberProperty)()],ke.prototype,"maxNumberOfChips",void 0);Rr([(0,er.property)()],ke.prototype,"popoverTitle",void 0);Rr([(0,nt.jsonProperty)([])],ke.prototype,"chips",void 0);Rr([(0,er.state)()],ke.prototype,"isPopoverOpened",void 0);Rr([(0,er.queryAll)(".chip-group-chip")],ke.prototype,"allChips",void 0);var o4={"ftds-chip-group":ke};(0,n4.customElements)(o4);})();
|
|
2495
2496
|
/*! Bundled license information:
|
|
2496
2497
|
|
|
2497
2498
|
@fortawesome/fontawesome-svg-core/index.mjs:
|
|
@@ -87,6 +87,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:n.extend("--ftds-con
|
|
|
87
87
|
max-width: 100%;
|
|
88
88
|
display: flex;
|
|
89
89
|
flex-wrap: wrap;
|
|
90
|
+
align-items: center;
|
|
90
91
|
gap: ${ke.verticalGap} ${ke.horizontalGap};
|
|
91
92
|
padding-left: 0;
|
|
92
93
|
margin: ${l.spacing1} 0;
|
|
@@ -2553,7 +2554,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
|
|
|
2553
2554
|
</div>
|
|
2554
2555
|
</ftds-popover>
|
|
2555
2556
|
</li>
|
|
2556
|
-
`}renderChip(e){var r,o,a,i;return $`
|
|
2557
|
+
`}renderChip(e){var r,o,a,i,s;return $`
|
|
2557
2558
|
<li>
|
|
2558
2559
|
<ft-tooltip
|
|
2559
2560
|
text="${(r=e.label)!==null&&r!==void 0?r:e.value}"
|
|
@@ -2563,15 +2564,15 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
|
|
|
2563
2564
|
exportparts="chip"
|
|
2564
2565
|
?removable=${this.removable}
|
|
2565
2566
|
.family=${(o=e.family)!==null&&o!==void 0?o:xe.neutral}
|
|
2566
|
-
.icon=${this.getFamilyIcon(e.family)}
|
|
2567
|
-
.iconVariant=${
|
|
2568
|
-
.removeButtonLabel=${(
|
|
2567
|
+
.icon=${(a=e.icon)!==null&&a!==void 0?a:this.getFamilyIcon(e.family)}
|
|
2568
|
+
.iconVariant=${this.getIconVariant(e.icon,e.iconVariant)}
|
|
2569
|
+
.removeButtonLabel=${(i=e.removeLabel)!==null&&i!==void 0?i:Ko.messages.defaultRemoveLabel()}
|
|
2569
2570
|
@remove=${()=>this.onChipRemoved(e)}>
|
|
2570
|
-
${(
|
|
2571
|
+
${(s=e.label)!==null&&s!==void 0?s:e.value}
|
|
2571
2572
|
</ftds-chip>
|
|
2572
2573
|
</ft-tooltip>
|
|
2573
2574
|
</li>
|
|
2574
|
-
`}onChipRemoved(e){this.lastRemovedChipIndex=this.chips.findIndex(r=>r.value===e.value),this.dispatchEvent(new Mo(e))}handleFocusOnChipDeleted(e){var r;let o=Array.from((r=this.allChips)!==null&&r!==void 0?r:[]);o.length!==0&&(o[e]?this.focusChip(o[e]):this.focusChip(o[e-1]))}async focusChip(e){var r;await e.updateComplete;let o=(r=e.shadowRoot)===null||r===void 0?void 0:r.querySelector(".ftds-chip--remove-button");await o?.updateComplete,o?.focus()}toggleExtraChips(e){this.isPopoverOpened=e.detail.opened}getFamilyIcon(e){if(e===xe.warning)return h.TRIANGLE_EXCLAMATION}};Be.elementDefinitions={"ftds-chip":Ee,"ftds-popover":Y,"ftds-typography":ve,"ft-tooltip":ce};Be.styles=O2;Jr([E({type:Boolean})],Be.prototype,"removable",void 0);Jr([Lr()],Be.prototype,"maxNumberOfChips",void 0);Jr([E()],Be.prototype,"popoverTitle",void 0);Jr([Le([])],Be.prototype,"chips",void 0);Jr([Q()],Be.prototype,"isPopoverOpened",void 0);Jr([Na(".chip-group-chip")],Be.prototype,"allChips",void 0);var g4={"ftds-chip-group":Be};ee(g4);})();
|
|
2575
|
+
`}onChipRemoved(e){this.lastRemovedChipIndex=this.chips.findIndex(r=>r.value===e.value),this.dispatchEvent(new Mo(e))}handleFocusOnChipDeleted(e){var r;let o=Array.from((r=this.allChips)!==null&&r!==void 0?r:[]);o.length!==0&&(o[e]?this.focusChip(o[e]):this.focusChip(o[e-1]))}async focusChip(e){var r;await e.updateComplete;let o=(r=e.shadowRoot)===null||r===void 0?void 0:r.querySelector(".ftds-chip--remove-button");await o?.updateComplete,o?.focus()}toggleExtraChips(e){this.isPopoverOpened=e.detail.opened}getFamilyIcon(e){if(e===xe.warning)return h.TRIANGLE_EXCLAMATION}getIconVariant(e,r){return e?r??p.regular:p.solid}};Be.elementDefinitions={"ftds-chip":Ee,"ftds-popover":Y,"ftds-typography":ve,"ft-tooltip":ce};Be.styles=O2;Jr([E({type:Boolean})],Be.prototype,"removable",void 0);Jr([Lr()],Be.prototype,"maxNumberOfChips",void 0);Jr([E()],Be.prototype,"popoverTitle",void 0);Jr([Le([])],Be.prototype,"chips",void 0);Jr([Q()],Be.prototype,"isPopoverOpened",void 0);Jr([Na(".chip-group-chip")],Be.prototype,"allChips",void 0);var g4={"ftds-chip-group":Be};ee(g4);})();
|
|
2575
2576
|
/*! Bundled license information:
|
|
2576
2577
|
|
|
2577
2578
|
@webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
|
|
2
|
+
import { FtdsIcons, FtdsIconVariants } from "@fluid-topics/ftds-icon";
|
|
2
3
|
export interface FtdsChipGroupProperties {
|
|
3
4
|
removable: boolean;
|
|
4
5
|
maxNumberOfChips?: number;
|
|
@@ -14,4 +15,6 @@ export interface ChipElement {
|
|
|
14
15
|
label?: string;
|
|
15
16
|
family?: DesignSystemFamily;
|
|
16
17
|
removeLabel?: string;
|
|
18
|
+
icon?: FtdsIcons;
|
|
19
|
+
iconVariant?: FtdsIconVariants;
|
|
17
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ftds-chip-group",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.14",
|
|
4
4
|
"description": "A generic Fluid Topics chip",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fluid-topics/design-system-variables": "3.8.0",
|
|
23
|
-
"@fluid-topics/ft-i18n": "2.2.
|
|
24
|
-
"@fluid-topics/ft-tooltip": "2.2.
|
|
25
|
-
"@fluid-topics/ft-wc-utils": "2.2.
|
|
26
|
-
"@fluid-topics/ftds-button": "2.2.
|
|
27
|
-
"@fluid-topics/ftds-chip": "2.2.
|
|
28
|
-
"@fluid-topics/ftds-icon": "2.2.
|
|
29
|
-
"@fluid-topics/ftds-popover": "2.2.
|
|
30
|
-
"@fluid-topics/ftds-typography": "2.2.
|
|
23
|
+
"@fluid-topics/ft-i18n": "2.2.14",
|
|
24
|
+
"@fluid-topics/ft-tooltip": "2.2.14",
|
|
25
|
+
"@fluid-topics/ft-wc-utils": "2.2.14",
|
|
26
|
+
"@fluid-topics/ftds-button": "2.2.14",
|
|
27
|
+
"@fluid-topics/ftds-chip": "2.2.14",
|
|
28
|
+
"@fluid-topics/ftds-icon": "2.2.14",
|
|
29
|
+
"@fluid-topics/ftds-popover": "2.2.14",
|
|
30
|
+
"@fluid-topics/ftds-typography": "2.2.14",
|
|
31
31
|
"lit": "3.3.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@fluid-topics/ft-wc-test-utils": "2.2.
|
|
34
|
+
"@fluid-topics/ft-wc-test-utils": "2.2.14"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "854d6984b9b23dbce23a195e12814084a8317fa5"
|
|
37
37
|
}
|