@firestitch/chip 13.1.6 → 15.0.0

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.
@@ -1,381 +1,379 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, ChangeDetectionStrategy, HostBinding, Input, Output, HostListener, forwardRef, ContentChildren, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/common';
3
+ import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import * as i1 from '@angular/material/icon';
5
+ import * as i2 from '@angular/material/icon';
6
6
  import { MatIconModule } from '@angular/material/icon';
7
7
  import { FsLabelModule } from '@firestitch/label';
8
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
9
  import { Subject } from 'rxjs';
10
10
  import { takeUntil } from 'rxjs/operators';
11
11
 
12
- class FsChipComponent {
13
- constructor(_cdRef) {
14
- this._cdRef = _cdRef;
15
- this.fsChip = true;
16
- this._outlined = false;
17
- this.selectable = false;
18
- this.removable = true;
19
- this.styleBackgroundColor = '';
20
- this.styleColor = '';
21
- this.styleBorderColor = '';
22
- this.classSmall = false;
23
- this.classTiny = false;
24
- this.classMicro = false;
25
- this.selected = false;
26
- this.selectedToggled = new EventEmitter();
27
- this.removed = new EventEmitter();
28
- this._destroy$ = new Subject();
29
- this._backgroundColor = '';
30
- this._color = '';
31
- }
32
- set setSize(value) {
33
- this.classSmall = value === 'small';
34
- this.classTiny = value === 'tiny';
35
- this.classMicro = value === 'micro';
36
- }
37
- click() {
38
- if (this.selectable) {
39
- this.selected = !this.selected;
40
- this.selectedToggled.emit({ value: this.value, selected: this.selected });
41
- }
42
- }
43
- set backgroundColor(value) {
44
- this._backgroundColor = value;
45
- this._updateStyles();
46
- }
47
- set borderColor(value) {
48
- this.styleBorderColor = value;
49
- this._updateStyles();
50
- }
51
- set color(value) {
52
- this._color = value;
53
- this._updateStyles();
54
- }
55
- get destroy$() {
56
- return this._destroy$.asObservable();
57
- }
58
- set outlined(value) {
59
- this._outlined = value;
60
- this._updateStyles();
61
- }
62
- select() {
63
- this.selected = true;
64
- this._cdRef.markForCheck();
65
- }
66
- unselect() {
67
- this.selected = false;
68
- this._cdRef.markForCheck();
69
- }
70
- ngOnInit() {
71
- if (this.removed.observers.length === 0) {
72
- this.removable = false;
73
- }
74
- }
75
- ngOnDestroy() {
76
- this._destroy$.next();
77
- this._destroy$.complete();
78
- }
79
- remove(event) {
80
- event.stopImmediatePropagation();
81
- event.stopPropagation();
82
- this.removed.next(event);
83
- }
84
- _isContrastYIQBlack(hexcolor) {
85
- if (!hexcolor) {
86
- return true;
87
- }
88
- hexcolor = hexcolor.replace('#', '');
89
- const r = parseInt(hexcolor.substr(0, 2), 16);
90
- const g = parseInt(hexcolor.substr(2, 2), 16);
91
- const b = parseInt(hexcolor.substr(4, 2), 16);
92
- const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
93
- return yiq >= 200;
94
- }
95
- _updateStyles() {
96
- this.styleBackgroundColor = this._backgroundColor;
97
- if (this._color) {
98
- this.styleColor = this._color;
99
- }
100
- else if (!this._outlined) {
101
- this.styleColor = this._isContrastYIQBlack(this.styleBackgroundColor) ? '#474747' : '#fff';
102
- }
103
- if (this._outlined) {
104
- this.styleBackgroundColor = '';
105
- if (this._color) {
106
- this.styleBorderColor = this._color;
107
- }
108
- }
109
- this._cdRef.markForCheck();
110
- }
111
- }
112
- FsChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
113
- FsChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsChipComponent, selector: "fs-chip", inputs: { selectable: "selectable", removable: "removable", value: "value", icon: "icon", image: "image", selected: "selected", setSize: ["size", "setSize"], backgroundColor: "backgroundColor", borderColor: "borderColor", color: "color", outlined: "outlined" }, outputs: { selectedToggled: "selectedToggled", removed: "removed" }, host: { listeners: { "click": "click()" }, properties: { "class.fs-chip": "this.fsChip", "class.outlined": "this._outlined", "class.selectable": "this.selectable", "class.removable": "this.removable", "style.backgroundColor": "this.styleBackgroundColor", "style.color": "this.styleColor", "style.borderColor": "this.styleBorderColor", "class.size-small": "this.classSmall", "class.size-tiny": "this.classTiny", "class.size-micro": "this.classMicro", "class.iconed": "this.icon", "class.imaged": "this.image", "class.selected": "this.selected" } }, ngImport: i0, template: "<img *ngIf=\"image\" [src]=\"image\" class=\"image\" alt=\"\">\n<ng-container *ngIf=\"icon\">\n <mat-icon class=\"icon\">{{icon}}</mat-icon>\n</ng-container>\n<div class=\"fs-chip-content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"selected\">\n <div class=\"selected-check\">\n <mat-icon [style.color]=\"styleColor\">check</mat-icon>\n </div>\n</ng-container>\n<div *ngIf=\"removed.observers.length && removable\" class=\"remove\" (click)=\"remove($event)\">\n <mat-icon [style.color]=\"styleColor\">remove_circle_outline</mat-icon>\n</div>", styles: [":host{-webkit-user-select:none;user-select:none;transition:box-shadow .28s cubic-bezier(.4,0,.2,1);display:inline-flex;padding:0 12px;border-radius:16px;align-items:center;cursor:default;height:30px;background-color:#e0e0e0;overflow:hidden}:host.imaged{overflow:visible;padding-left:0;vertical-align:middle}:host.imaged.outlined .image{margin-left:-2px}:host.iconed:not(.imaged){padding-left:5px}:host.removable,:host.selected{padding-right:3px}:host.selectable{cursor:pointer}:host.outlined{background-color:transparent;border:1px solid #e0e0e0;box-sizing:border-box}:host .icon{margin-right:5px}:host mat-icon{font-size:25px}:host .image{height:30px;width:30px;border-radius:50%;object-fit:cover;margin-left:-1px;margin-right:8px}:host .fs-chip-content{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .selected-check{margin:0 5px;display:flex}:host .remove{display:flex;margin-left:5px;cursor:pointer}:host.size-micro{padding:0 5px;height:16px;line-height:normal}:host.size-micro .fs-chip-content{font-size:65%}:host.size-micro .image{height:100%;width:16px;margin-right:2px}:host.size-micro .remove{margin-left:1px}:host.size-micro .selected-check{margin:0 1px 0 0}:host.size-micro.imaged{padding-left:0}:host.size-micro.removable,:host.size-micro.selected{padding-right:0}:host.size-micro mat-icon{width:12px;height:12px;font-size:11px}:host.size-tiny{padding:0 6px;height:18px;line-height:normal}:host.size-tiny .fs-chip-content{font-size:75%}:host.size-tiny .image{height:18px;width:18px;margin-right:3px}:host.size-tiny.iconed:not(.imaged){padding-left:3px}:host.size-tiny .remove{margin-left:2px;margin-right:2px}:host.size-tiny .selected-check{margin:0 1px 0 0}:host.size-tiny.imaged{padding-left:0}:host.size-tiny.removable,:host.size-tiny.selected{padding-right:0}:host.size-tiny mat-icon{height:13px;width:13px;font-size:13px}:host.size-small{padding:0 8px;font-size:85%;height:25px;line-height:normal}:host.size-small .image{height:25px;width:25px;margin-right:5px}:host.size-small.iconed:not(.imaged){padding-left:4px}:host.size-small.imaged{padding-left:0}:host.size-small .remove{margin-right:2px}:host.size-small .selected-check{margin:0 2px 0 0}:host.size-small .selected-check mat-icon{transform:scale(.7)}:host.size-small.removable,:host.size-small.selected{padding-right:0}:host.size-small mat-icon{height:22px;width:22px;font-size:22px}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipComponent, decorators: [{
115
- type: Component,
116
- args: [{ selector: 'fs-chip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<img *ngIf=\"image\" [src]=\"image\" class=\"image\" alt=\"\">\n<ng-container *ngIf=\"icon\">\n <mat-icon class=\"icon\">{{icon}}</mat-icon>\n</ng-container>\n<div class=\"fs-chip-content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"selected\">\n <div class=\"selected-check\">\n <mat-icon [style.color]=\"styleColor\">check</mat-icon>\n </div>\n</ng-container>\n<div *ngIf=\"removed.observers.length && removable\" class=\"remove\" (click)=\"remove($event)\">\n <mat-icon [style.color]=\"styleColor\">remove_circle_outline</mat-icon>\n</div>", styles: [":host{-webkit-user-select:none;user-select:none;transition:box-shadow .28s cubic-bezier(.4,0,.2,1);display:inline-flex;padding:0 12px;border-radius:16px;align-items:center;cursor:default;height:30px;background-color:#e0e0e0;overflow:hidden}:host.imaged{overflow:visible;padding-left:0;vertical-align:middle}:host.imaged.outlined .image{margin-left:-2px}:host.iconed:not(.imaged){padding-left:5px}:host.removable,:host.selected{padding-right:3px}:host.selectable{cursor:pointer}:host.outlined{background-color:transparent;border:1px solid #e0e0e0;box-sizing:border-box}:host .icon{margin-right:5px}:host mat-icon{font-size:25px}:host .image{height:30px;width:30px;border-radius:50%;object-fit:cover;margin-left:-1px;margin-right:8px}:host .fs-chip-content{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .selected-check{margin:0 5px;display:flex}:host .remove{display:flex;margin-left:5px;cursor:pointer}:host.size-micro{padding:0 5px;height:16px;line-height:normal}:host.size-micro .fs-chip-content{font-size:65%}:host.size-micro .image{height:100%;width:16px;margin-right:2px}:host.size-micro .remove{margin-left:1px}:host.size-micro .selected-check{margin:0 1px 0 0}:host.size-micro.imaged{padding-left:0}:host.size-micro.removable,:host.size-micro.selected{padding-right:0}:host.size-micro mat-icon{width:12px;height:12px;font-size:11px}:host.size-tiny{padding:0 6px;height:18px;line-height:normal}:host.size-tiny .fs-chip-content{font-size:75%}:host.size-tiny .image{height:18px;width:18px;margin-right:3px}:host.size-tiny.iconed:not(.imaged){padding-left:3px}:host.size-tiny .remove{margin-left:2px;margin-right:2px}:host.size-tiny .selected-check{margin:0 1px 0 0}:host.size-tiny.imaged{padding-left:0}:host.size-tiny.removable,:host.size-tiny.selected{padding-right:0}:host.size-tiny mat-icon{height:13px;width:13px;font-size:13px}:host.size-small{padding:0 8px;font-size:85%;height:25px;line-height:normal}:host.size-small .image{height:25px;width:25px;margin-right:5px}:host.size-small.iconed:not(.imaged){padding-left:4px}:host.size-small.imaged{padding-left:0}:host.size-small .remove{margin-right:2px}:host.size-small .selected-check{margin:0 2px 0 0}:host.size-small .selected-check mat-icon{transform:scale(.7)}:host.size-small.removable,:host.size-small.selected{padding-right:0}:host.size-small mat-icon{height:22px;width:22px;font-size:22px}\n"] }]
117
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { fsChip: [{
118
- type: HostBinding,
119
- args: ['class.fs-chip']
120
- }], _outlined: [{
121
- type: HostBinding,
122
- args: ['class.outlined']
123
- }], selectable: [{
124
- type: Input
125
- }, {
126
- type: HostBinding,
127
- args: ['class.selectable']
128
- }], removable: [{
129
- type: Input
130
- }, {
131
- type: HostBinding,
132
- args: ['class.removable']
133
- }], styleBackgroundColor: [{
134
- type: HostBinding,
135
- args: ['style.backgroundColor']
136
- }], styleColor: [{
137
- type: HostBinding,
138
- args: ['style.color']
139
- }], styleBorderColor: [{
140
- type: HostBinding,
141
- args: ['style.borderColor']
142
- }], classSmall: [{
143
- type: HostBinding,
144
- args: ['class.size-small']
145
- }], classTiny: [{
146
- type: HostBinding,
147
- args: ['class.size-tiny']
148
- }], classMicro: [{
149
- type: HostBinding,
150
- args: ['class.size-micro']
151
- }], value: [{
152
- type: Input
153
- }], icon: [{
154
- type: Input
155
- }, {
156
- type: HostBinding,
157
- args: ['class.iconed']
158
- }], image: [{
159
- type: Input
160
- }, {
161
- type: HostBinding,
162
- args: ['class.imaged']
163
- }], selected: [{
164
- type: Input
165
- }, {
166
- type: HostBinding,
167
- args: ['class.selected']
168
- }], selectedToggled: [{
169
- type: Output
170
- }], removed: [{
171
- type: Output
172
- }], setSize: [{
173
- type: Input,
174
- args: ['size']
175
- }], click: [{
176
- type: HostListener,
177
- args: ['click']
178
- }], backgroundColor: [{
179
- type: Input
180
- }], borderColor: [{
181
- type: Input
182
- }], color: [{
183
- type: Input
184
- }], outlined: [{
185
- type: Input
12
+ class FsChipComponent {
13
+ constructor(_cdRef) {
14
+ this._cdRef = _cdRef;
15
+ this.fsChip = true;
16
+ this._outlined = false;
17
+ this.selectable = false;
18
+ this.removable = true;
19
+ this.styleBackgroundColor = '';
20
+ this.styleColor = '';
21
+ this.styleBorderColor = '';
22
+ this.classSmall = false;
23
+ this.classTiny = false;
24
+ this.classMicro = false;
25
+ this.selected = false;
26
+ this.selectedToggled = new EventEmitter();
27
+ this.removed = new EventEmitter();
28
+ this._destroy$ = new Subject();
29
+ this._backgroundColor = '';
30
+ this._color = '';
31
+ }
32
+ set setSize(value) {
33
+ this.classSmall = value === 'small';
34
+ this.classTiny = value === 'tiny';
35
+ this.classMicro = value === 'micro';
36
+ }
37
+ click() {
38
+ if (this.selectable) {
39
+ this.selected = !this.selected;
40
+ this.selectedToggled.emit({ value: this.value, selected: this.selected });
41
+ }
42
+ }
43
+ set backgroundColor(value) {
44
+ this._backgroundColor = value;
45
+ this._updateStyles();
46
+ }
47
+ set borderColor(value) {
48
+ this.styleBorderColor = value;
49
+ this._updateStyles();
50
+ }
51
+ set color(value) {
52
+ this._color = value;
53
+ this._updateStyles();
54
+ }
55
+ get destroy$() {
56
+ return this._destroy$.asObservable();
57
+ }
58
+ set outlined(value) {
59
+ this._outlined = value;
60
+ this._updateStyles();
61
+ }
62
+ select() {
63
+ this.selected = true;
64
+ this._cdRef.markForCheck();
65
+ }
66
+ unselect() {
67
+ this.selected = false;
68
+ this._cdRef.markForCheck();
69
+ }
70
+ ngOnInit() {
71
+ if (this.removed.observers.length === 0) {
72
+ this.removable = false;
73
+ }
74
+ }
75
+ ngOnDestroy() {
76
+ this._destroy$.next();
77
+ this._destroy$.complete();
78
+ }
79
+ remove(event) {
80
+ event.stopImmediatePropagation();
81
+ event.stopPropagation();
82
+ this.removed.next(event);
83
+ }
84
+ _isContrastYIQBlack(hexcolor) {
85
+ if (!hexcolor) {
86
+ return true;
87
+ }
88
+ hexcolor = hexcolor.replace('#', '');
89
+ const r = parseInt(hexcolor.substr(0, 2), 16);
90
+ const g = parseInt(hexcolor.substr(2, 2), 16);
91
+ const b = parseInt(hexcolor.substr(4, 2), 16);
92
+ const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
93
+ return yiq >= 200;
94
+ }
95
+ _updateStyles() {
96
+ this.styleBackgroundColor = this._backgroundColor;
97
+ if (this._color) {
98
+ this.styleColor = this._color;
99
+ }
100
+ else if (!this._outlined) {
101
+ this.styleColor = this._isContrastYIQBlack(this.styleBackgroundColor) ? '#474747' : '#fff';
102
+ }
103
+ if (this._outlined) {
104
+ this.styleBackgroundColor = '';
105
+ if (this._color) {
106
+ this.styleBorderColor = this._color;
107
+ }
108
+ }
109
+ this._cdRef.markForCheck();
110
+ }
111
+ }
112
+ FsChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
113
+ FsChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FsChipComponent, selector: "fs-chip", inputs: { selectable: "selectable", removable: "removable", value: "value", icon: "icon", image: "image", selected: "selected", setSize: ["size", "setSize"], backgroundColor: "backgroundColor", borderColor: "borderColor", color: "color", outlined: "outlined" }, outputs: { selectedToggled: "selectedToggled", removed: "removed" }, host: { listeners: { "click": "click()" }, properties: { "class.fs-chip": "this.fsChip", "class.outlined": "this._outlined", "class.selectable": "this.selectable", "class.removable": "this.removable", "style.backgroundColor": "this.styleBackgroundColor", "style.color": "this.styleColor", "style.borderColor": "this.styleBorderColor", "class.size-small": "this.classSmall", "class.size-tiny": "this.classTiny", "class.size-micro": "this.classMicro", "class.iconed": "this.icon", "class.imaged": "this.image", "class.selected": "this.selected" } }, ngImport: i0, template: "<img *ngIf=\"image\" [src]=\"image\" class=\"image\" alt=\"\">\n<ng-container *ngIf=\"icon\">\n <mat-icon class=\"icon\">{{icon}}</mat-icon>\n</ng-container>\n<div class=\"fs-chip-content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"selected\">\n <div class=\"selected-check\">\n <mat-icon [style.color]=\"styleColor\">check</mat-icon>\n </div>\n</ng-container>\n<div *ngIf=\"removed.observers.length && removable\" class=\"remove\" (click)=\"remove($event)\">\n <mat-icon [style.color]=\"styleColor\">remove_circle_outline</mat-icon>\n</div>", styles: [":host{-webkit-user-select:none;user-select:none;transition:box-shadow .28s cubic-bezier(.4,0,.2,1);display:inline-flex;padding:0 12px;border-radius:16px;align-items:center;cursor:default;height:30px;background-color:#e0e0e0;overflow:hidden}:host.imaged{overflow:visible;padding-left:0;vertical-align:middle}:host.imaged.outlined .image{margin-left:-2px}:host.iconed:not(.imaged){padding-left:5px}:host.removable,:host.selected{padding-right:3px}:host.selectable{cursor:pointer}:host.outlined{background-color:transparent;border:1px solid #e0e0e0;box-sizing:border-box}:host .icon{margin-right:5px}:host mat-icon{font-size:25px}:host .image{height:30px;width:30px;border-radius:50%;object-fit:cover;margin-left:-1px;margin-right:8px}:host .fs-chip-content{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .selected-check{margin:0 5px;display:flex}:host .remove{display:flex;margin-left:5px;cursor:pointer}:host.size-micro{padding:0 5px;height:16px;line-height:normal}:host.size-micro .fs-chip-content{font-size:65%}:host.size-micro .image{height:100%;width:16px;margin-right:2px}:host.size-micro .remove{margin-left:1px}:host.size-micro .selected-check{margin:0 1px 0 0}:host.size-micro.imaged{padding-left:0}:host.size-micro.removable,:host.size-micro.selected{padding-right:0}:host.size-micro mat-icon{width:12px;height:12px;font-size:11px}:host.size-tiny{padding:0 6px;height:18px;line-height:normal}:host.size-tiny .fs-chip-content{font-size:75%}:host.size-tiny .image{height:18px;width:18px;margin-right:3px}:host.size-tiny.iconed:not(.imaged){padding-left:3px}:host.size-tiny .remove{margin-left:2px;margin-right:2px}:host.size-tiny .selected-check{margin:0 1px 0 0}:host.size-tiny.imaged{padding-left:0}:host.size-tiny.removable,:host.size-tiny.selected{padding-right:0}:host.size-tiny mat-icon{height:13px;width:13px;font-size:13px}:host.size-small{padding:0 8px;font-size:85%;height:25px;line-height:normal}:host.size-small .image{height:25px;width:25px;margin-right:5px}:host.size-small.iconed:not(.imaged){padding-left:4px}:host.size-small.imaged{padding-left:0}:host.size-small .remove{margin-right:2px}:host.size-small .selected-check{margin:0 2px 0 0}:host.size-small .selected-check mat-icon{transform:scale(.7)}:host.size-small.removable,:host.size-small.selected{padding-right:0}:host.size-small mat-icon{height:22px;width:22px;font-size:22px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipComponent, decorators: [{
115
+ type: Component,
116
+ args: [{ selector: 'fs-chip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<img *ngIf=\"image\" [src]=\"image\" class=\"image\" alt=\"\">\n<ng-container *ngIf=\"icon\">\n <mat-icon class=\"icon\">{{icon}}</mat-icon>\n</ng-container>\n<div class=\"fs-chip-content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"selected\">\n <div class=\"selected-check\">\n <mat-icon [style.color]=\"styleColor\">check</mat-icon>\n </div>\n</ng-container>\n<div *ngIf=\"removed.observers.length && removable\" class=\"remove\" (click)=\"remove($event)\">\n <mat-icon [style.color]=\"styleColor\">remove_circle_outline</mat-icon>\n</div>", styles: [":host{-webkit-user-select:none;user-select:none;transition:box-shadow .28s cubic-bezier(.4,0,.2,1);display:inline-flex;padding:0 12px;border-radius:16px;align-items:center;cursor:default;height:30px;background-color:#e0e0e0;overflow:hidden}:host.imaged{overflow:visible;padding-left:0;vertical-align:middle}:host.imaged.outlined .image{margin-left:-2px}:host.iconed:not(.imaged){padding-left:5px}:host.removable,:host.selected{padding-right:3px}:host.selectable{cursor:pointer}:host.outlined{background-color:transparent;border:1px solid #e0e0e0;box-sizing:border-box}:host .icon{margin-right:5px}:host mat-icon{font-size:25px}:host .image{height:30px;width:30px;border-radius:50%;object-fit:cover;margin-left:-1px;margin-right:8px}:host .fs-chip-content{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .selected-check{margin:0 5px;display:flex}:host .remove{display:flex;margin-left:5px;cursor:pointer}:host.size-micro{padding:0 5px;height:16px;line-height:normal}:host.size-micro .fs-chip-content{font-size:65%}:host.size-micro .image{height:100%;width:16px;margin-right:2px}:host.size-micro .remove{margin-left:1px}:host.size-micro .selected-check{margin:0 1px 0 0}:host.size-micro.imaged{padding-left:0}:host.size-micro.removable,:host.size-micro.selected{padding-right:0}:host.size-micro mat-icon{width:12px;height:12px;font-size:11px}:host.size-tiny{padding:0 6px;height:18px;line-height:normal}:host.size-tiny .fs-chip-content{font-size:75%}:host.size-tiny .image{height:18px;width:18px;margin-right:3px}:host.size-tiny.iconed:not(.imaged){padding-left:3px}:host.size-tiny .remove{margin-left:2px;margin-right:2px}:host.size-tiny .selected-check{margin:0 1px 0 0}:host.size-tiny.imaged{padding-left:0}:host.size-tiny.removable,:host.size-tiny.selected{padding-right:0}:host.size-tiny mat-icon{height:13px;width:13px;font-size:13px}:host.size-small{padding:0 8px;font-size:85%;height:25px;line-height:normal}:host.size-small .image{height:25px;width:25px;margin-right:5px}:host.size-small.iconed:not(.imaged){padding-left:4px}:host.size-small.imaged{padding-left:0}:host.size-small .remove{margin-right:2px}:host.size-small .selected-check{margin:0 2px 0 0}:host.size-small .selected-check mat-icon{transform:scale(.7)}:host.size-small.removable,:host.size-small.selected{padding-right:0}:host.size-small mat-icon{height:22px;width:22px;font-size:22px}\n"] }]
117
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { fsChip: [{
118
+ type: HostBinding,
119
+ args: ['class.fs-chip']
120
+ }], _outlined: [{
121
+ type: HostBinding,
122
+ args: ['class.outlined']
123
+ }], selectable: [{
124
+ type: Input
125
+ }, {
126
+ type: HostBinding,
127
+ args: ['class.selectable']
128
+ }], removable: [{
129
+ type: Input
130
+ }, {
131
+ type: HostBinding,
132
+ args: ['class.removable']
133
+ }], styleBackgroundColor: [{
134
+ type: HostBinding,
135
+ args: ['style.backgroundColor']
136
+ }], styleColor: [{
137
+ type: HostBinding,
138
+ args: ['style.color']
139
+ }], styleBorderColor: [{
140
+ type: HostBinding,
141
+ args: ['style.borderColor']
142
+ }], classSmall: [{
143
+ type: HostBinding,
144
+ args: ['class.size-small']
145
+ }], classTiny: [{
146
+ type: HostBinding,
147
+ args: ['class.size-tiny']
148
+ }], classMicro: [{
149
+ type: HostBinding,
150
+ args: ['class.size-micro']
151
+ }], value: [{
152
+ type: Input
153
+ }], icon: [{
154
+ type: Input
155
+ }, {
156
+ type: HostBinding,
157
+ args: ['class.iconed']
158
+ }], image: [{
159
+ type: Input
160
+ }, {
161
+ type: HostBinding,
162
+ args: ['class.imaged']
163
+ }], selected: [{
164
+ type: Input
165
+ }, {
166
+ type: HostBinding,
167
+ args: ['class.selected']
168
+ }], selectedToggled: [{
169
+ type: Output
170
+ }], removed: [{
171
+ type: Output
172
+ }], setSize: [{
173
+ type: Input,
174
+ args: ['size']
175
+ }], click: [{
176
+ type: HostListener,
177
+ args: ['click']
178
+ }], backgroundColor: [{
179
+ type: Input
180
+ }], borderColor: [{
181
+ type: Input
182
+ }], color: [{
183
+ type: Input
184
+ }], outlined: [{
185
+ type: Input
186
186
  }] } });
187
187
 
188
- class FsChipsComponent {
189
- constructor(_cdRef, _iterable) {
190
- this._cdRef = _cdRef;
191
- this._iterable = _iterable;
192
- this.classFsChips = true;
193
- this.classHasChips = false;
194
- this.multiple = true;
195
- this._value = [];
196
- this._destroy$ = new Subject();
197
- this._chipDiffer = this._iterable.find([]).create();
198
- }
199
- setDisabledState(isDisabled) {
200
- //
201
- }
202
- ngAfterContentInit() {
203
- this._subscribeToSelectionChanges();
204
- this._subscribeToItemsChange();
205
- }
206
- set value(value) {
207
- if (this._value !== value) {
208
- this._value = value;
209
- this.onChange(this._value);
210
- this.onTouch(this._value);
211
- }
212
- }
213
- get value() {
214
- return this._value;
215
- }
216
- ngOnDestroy() {
217
- this._destroy$.next();
218
- this._destroy$.complete();
219
- }
220
- writeValue(value) {
221
- if (value !== this.value) {
222
- this._value = value;
223
- }
224
- this._updateChips();
225
- }
226
- registerOnChange(fn) {
227
- this.onChange = fn;
228
- }
229
- registerOnTouched(fn) {
230
- this.onTouch = fn;
231
- }
232
- _subscribeToSelectionChange() {
233
- const changed = this._chipDiffer.diff(this.chips);
234
- changed === null || changed === void 0 ? void 0 : changed.forEachAddedItem((change) => {
235
- change.item.selectedToggled
236
- .pipe(takeUntil(change.item.destroy$), takeUntil(this._destroy$))
237
- .subscribe(({ selected, value }) => {
238
- if (!selected) {
239
- const valueIndex = this.value.findIndex((item) => {
240
- return this._compareFn(item, value);
241
- });
242
- if (valueIndex > -1) {
243
- this.value.splice(valueIndex, 1);
244
- this.onChange(this._value);
245
- this.onTouch(this._value);
246
- }
247
- }
248
- else {
249
- this.value.push(value);
250
- this.onChange(this._value);
251
- this.onTouch(this._value);
252
- }
253
- });
254
- });
255
- }
256
- /**
257
- * Update ngModel value when selection changed
258
- */
259
- _subscribeToSelectionChanges() {
260
- this._subscribeToSelectionChange();
261
- this.chips.changes
262
- .pipe(takeUntil(this._destroy$))
263
- .subscribe(() => {
264
- this._subscribeToSelectionChange();
265
- });
266
- }
267
- /**
268
- * Update selection if item was added or removed
269
- */
270
- _subscribeToItemsChange() {
271
- this.chips.changes
272
- .pipe(takeUntil(this._destroy$))
273
- .subscribe(() => {
274
- this.classHasChips = this.chips.length !== 0;
275
- this._cdRef.markForCheck();
276
- this._updateChips();
277
- });
278
- this.classHasChips = this.chips.length !== 0;
279
- this._cdRef.markForCheck();
280
- }
281
- _compareFn(o1, o2) {
282
- if (this.compare) {
283
- return this.compare(o1, o2);
284
- }
285
- return o1 === o2;
286
- }
287
- _updateChips() {
288
- if (this.multiple && Array.isArray(this.value) && this.chips) {
289
- this.chips.forEach((chip) => {
290
- const selected = this.value
291
- .some((o) => {
292
- return this._compareFn(o, chip.value);
293
- });
294
- if (selected) {
295
- chip.select();
296
- }
297
- else {
298
- chip.unselect();
299
- }
300
- });
301
- }
302
- }
303
- }
304
- FsChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component });
305
- FsChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FsChipsComponent, selector: "fs-chips", inputs: { compare: "compare", multiple: "multiple" }, host: { properties: { "class.fs-chips": "this.classFsChips", "class.has-chips": "this.classHasChips" } }, providers: [
306
- {
307
- provide: NG_VALUE_ACCESSOR,
308
- useExisting: forwardRef(() => FsChipsComponent),
309
- multi: true,
310
- },
311
- ], queries: [{ propertyName: "chips", predicate: FsChipComponent }], ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-wrap:wrap}:host.has-chips{margin-top:-5px}:host ::ng-deep .fs-chip{margin-top:5px}:host ::ng-deep .fs-chip+.fs-chip{margin-left:5px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipsComponent, decorators: [{
313
- type: Component,
314
- args: [{ selector: 'fs-chips', providers: [
315
- {
316
- provide: NG_VALUE_ACCESSOR,
317
- useExisting: forwardRef(() => FsChipsComponent),
318
- multi: true,
319
- },
320
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-wrap:wrap}:host.has-chips{margin-top:-5px}:host ::ng-deep .fs-chip{margin-top:5px}:host ::ng-deep .fs-chip+.fs-chip{margin-left:5px}\n"] }]
321
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }]; }, propDecorators: { classFsChips: [{
322
- type: HostBinding,
323
- args: ['class.fs-chips']
324
- }], classHasChips: [{
325
- type: HostBinding,
326
- args: ['class.has-chips']
327
- }], chips: [{
328
- type: ContentChildren,
329
- args: [FsChipComponent]
330
- }], compare: [{
331
- type: Input
332
- }], multiple: [{
333
- type: Input
188
+ class FsChipsComponent {
189
+ constructor(_cdRef, _iterable) {
190
+ this._cdRef = _cdRef;
191
+ this._iterable = _iterable;
192
+ this.classFsChips = true;
193
+ this.classHasChips = false;
194
+ this.multiple = true;
195
+ this._value = [];
196
+ this._destroy$ = new Subject();
197
+ this._chipDiffer = this._iterable.find([]).create();
198
+ }
199
+ setDisabledState(isDisabled) {
200
+ //
201
+ }
202
+ ngAfterContentInit() {
203
+ this._subscribeToSelectionChanges();
204
+ this._subscribeToItemsChange();
205
+ }
206
+ set value(value) {
207
+ if (this._value !== value) {
208
+ this._value = value;
209
+ this.onChange(this._value);
210
+ this.onTouch(this._value);
211
+ }
212
+ }
213
+ get value() {
214
+ return this._value;
215
+ }
216
+ ngOnDestroy() {
217
+ this._destroy$.next();
218
+ this._destroy$.complete();
219
+ }
220
+ writeValue(value) {
221
+ if (value !== this.value) {
222
+ this._value = value;
223
+ }
224
+ this._updateChips();
225
+ }
226
+ registerOnChange(fn) {
227
+ this.onChange = fn;
228
+ }
229
+ registerOnTouched(fn) {
230
+ this.onTouch = fn;
231
+ }
232
+ _subscribeToSelectionChange() {
233
+ const changed = this._chipDiffer.diff(this.chips);
234
+ changed === null || changed === void 0 ? void 0 : changed.forEachAddedItem((change) => {
235
+ change.item.selectedToggled
236
+ .pipe(takeUntil(change.item.destroy$), takeUntil(this._destroy$))
237
+ .subscribe(({ selected, value }) => {
238
+ if (!selected) {
239
+ const valueIndex = this.value.findIndex((item) => {
240
+ return this._compareFn(item, value);
241
+ });
242
+ if (valueIndex > -1) {
243
+ this.value.splice(valueIndex, 1);
244
+ this.onChange(this._value);
245
+ this.onTouch(this._value);
246
+ }
247
+ }
248
+ else {
249
+ this.value.push(value);
250
+ this.onChange(this._value);
251
+ this.onTouch(this._value);
252
+ }
253
+ });
254
+ });
255
+ }
256
+ /**
257
+ * Update ngModel value when selection changed
258
+ */
259
+ _subscribeToSelectionChanges() {
260
+ this._subscribeToSelectionChange();
261
+ this.chips.changes
262
+ .pipe(takeUntil(this._destroy$))
263
+ .subscribe(() => {
264
+ this._subscribeToSelectionChange();
265
+ });
266
+ }
267
+ /**
268
+ * Update selection if item was added or removed
269
+ */
270
+ _subscribeToItemsChange() {
271
+ this.chips.changes
272
+ .pipe(takeUntil(this._destroy$))
273
+ .subscribe(() => {
274
+ this.classHasChips = this.chips.length !== 0;
275
+ this._cdRef.markForCheck();
276
+ this._updateChips();
277
+ });
278
+ this.classHasChips = this.chips.length !== 0;
279
+ this._cdRef.markForCheck();
280
+ }
281
+ _compareFn(o1, o2) {
282
+ if (this.compare) {
283
+ return this.compare(o1, o2);
284
+ }
285
+ return o1 === o2;
286
+ }
287
+ _updateChips() {
288
+ if (this.multiple && Array.isArray(this.value) && this.chips) {
289
+ this.chips.forEach((chip) => {
290
+ const selected = this.value
291
+ .some((o) => {
292
+ return this._compareFn(o, chip.value);
293
+ });
294
+ if (selected) {
295
+ chip.select();
296
+ }
297
+ else {
298
+ chip.unselect();
299
+ }
300
+ });
301
+ }
302
+ }
303
+ }
304
+ FsChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component });
305
+ FsChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FsChipsComponent, selector: "fs-chips", inputs: { compare: "compare", multiple: "multiple" }, host: { properties: { "class.fs-chips": "this.classFsChips", "class.has-chips": "this.classHasChips" } }, providers: [
306
+ {
307
+ provide: NG_VALUE_ACCESSOR,
308
+ useExisting: forwardRef(() => FsChipsComponent),
309
+ multi: true,
310
+ },
311
+ ], queries: [{ propertyName: "chips", predicate: FsChipComponent }], ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-wrap:wrap}:host.has-chips{margin-top:-5px}:host ::ng-deep .fs-chip{margin-top:5px}:host ::ng-deep .fs-chip+.fs-chip{margin-left:5px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipsComponent, decorators: [{
313
+ type: Component,
314
+ args: [{ selector: 'fs-chips', providers: [
315
+ {
316
+ provide: NG_VALUE_ACCESSOR,
317
+ useExisting: forwardRef(() => FsChipsComponent),
318
+ multi: true,
319
+ },
320
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;flex-wrap:wrap}:host.has-chips{margin-top:-5px}:host ::ng-deep .fs-chip{margin-top:5px}:host ::ng-deep .fs-chip+.fs-chip{margin-left:5px}\n"] }]
321
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }]; }, propDecorators: { classFsChips: [{
322
+ type: HostBinding,
323
+ args: ['class.fs-chips']
324
+ }], classHasChips: [{
325
+ type: HostBinding,
326
+ args: ['class.has-chips']
327
+ }], chips: [{
328
+ type: ContentChildren,
329
+ args: [FsChipComponent]
330
+ }], compare: [{
331
+ type: Input
332
+ }], multiple: [{
333
+ type: Input
334
334
  }] } });
335
335
 
336
- class FsChipModule {
337
- static forRoot() {
338
- return {
339
- ngModule: FsChipModule
340
- };
341
- }
342
- }
343
- FsChipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
344
- FsChipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipModule, declarations: [FsChipsComponent,
345
- FsChipComponent], imports: [CommonModule,
346
- MatIconModule,
347
- FsLabelModule], exports: [FsChipsComponent,
348
- FsChipComponent] });
349
- FsChipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipModule, imports: [[
350
- CommonModule,
351
- MatIconModule,
352
- FsLabelModule
353
- ]] });
354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsChipModule, decorators: [{
355
- type: NgModule,
356
- args: [{
357
- imports: [
358
- CommonModule,
359
- MatIconModule,
360
- FsLabelModule
361
- ],
362
- exports: [
363
- FsChipsComponent,
364
- FsChipComponent,
365
- ],
366
- declarations: [
367
- FsChipsComponent,
368
- FsChipComponent,
369
- ]
370
- }]
336
+ class FsChipModule {
337
+ static forRoot() {
338
+ return {
339
+ ngModule: FsChipModule
340
+ };
341
+ }
342
+ }
343
+ FsChipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
344
+ FsChipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsChipModule, declarations: [FsChipsComponent,
345
+ FsChipComponent], imports: [CommonModule,
346
+ MatIconModule,
347
+ FsLabelModule], exports: [FsChipsComponent,
348
+ FsChipComponent] });
349
+ FsChipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipModule, imports: [CommonModule,
350
+ MatIconModule,
351
+ FsLabelModule] });
352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsChipModule, decorators: [{
353
+ type: NgModule,
354
+ args: [{
355
+ imports: [
356
+ CommonModule,
357
+ MatIconModule,
358
+ FsLabelModule
359
+ ],
360
+ exports: [
361
+ FsChipsComponent,
362
+ FsChipComponent,
363
+ ],
364
+ declarations: [
365
+ FsChipsComponent,
366
+ FsChipComponent,
367
+ ]
368
+ }]
371
369
  }] });
372
370
 
373
- /*
374
- * Public API Surface of fs-menu
371
+ /*
372
+ * Public API Surface of fs-menu
375
373
  */
376
374
 
377
- /**
378
- * Generated bundle index. Do not edit.
375
+ /**
376
+ * Generated bundle index. Do not edit.
379
377
  */
380
378
 
381
379
  export { FsChipComponent, FsChipModule, FsChipsComponent };