suis 0.9.0 → 0.11.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.
Files changed (39) hide show
  1. package/README.md +3 -0
  2. package/esm2022/lib/classes/suis-input.base.mjs +4 -2
  3. package/esm2022/lib/components/index.mjs +4 -1
  4. package/esm2022/lib/components/suis-alert/index.mjs +2 -0
  5. package/esm2022/lib/components/suis-alert/suis-alert.component.mjs +42 -0
  6. package/esm2022/lib/components/suis-chip/suis-chip.component.mjs +2 -2
  7. package/esm2022/lib/components/suis-icon/suis-icon-type.pipe.mjs +5 -1
  8. package/esm2022/lib/components/suis-icon/suis-icon.component.mjs +10 -4
  9. package/esm2022/lib/components/suis-icon/suis-icon.enums.mjs +3 -1
  10. package/esm2022/lib/components/suis-input-text/suis-input-text.component.mjs +3 -3
  11. package/esm2022/lib/components/suis-select/index.mjs +2 -0
  12. package/esm2022/lib/components/suis-select/suis-select-filter-options.pipe.mjs +20 -0
  13. package/esm2022/lib/components/suis-select/suis-select-is-selected.pipe.mjs +18 -0
  14. package/esm2022/lib/components/suis-select/suis-select-label.pipe.mjs +23 -0
  15. package/esm2022/lib/components/suis-select/suis-select-sort-options.pipe.mjs +18 -0
  16. package/esm2022/lib/components/suis-select/suis-select.component.mjs +123 -0
  17. package/esm2022/lib/components/suis-select-option/index.mjs +4 -0
  18. package/esm2022/lib/components/suis-select-option/suis-select-option.component.mjs +40 -0
  19. package/esm2022/lib/components/suis-select-option/suis-select-option.directive.mjs +21 -0
  20. package/esm2022/lib/components/suis-select-option/suis-select-option.interfaces.mjs +2 -0
  21. package/fesm2022/suis.mjs +398 -122
  22. package/fesm2022/suis.mjs.map +1 -1
  23. package/lib/classes/suis-input.base.d.ts +3 -1
  24. package/lib/components/index.d.ts +3 -0
  25. package/lib/components/suis-alert/index.d.ts +1 -0
  26. package/lib/components/suis-alert/suis-alert.component.d.ts +23 -0
  27. package/lib/components/suis-icon/suis-icon.component.d.ts +6 -2
  28. package/lib/components/suis-icon/suis-icon.enums.d.ts +3 -1
  29. package/lib/components/suis-select/index.d.ts +1 -0
  30. package/lib/components/suis-select/suis-select-filter-options.pipe.d.ts +8 -0
  31. package/lib/components/suis-select/suis-select-is-selected.pipe.d.ts +7 -0
  32. package/lib/components/suis-select/suis-select-label.pipe.d.ts +8 -0
  33. package/lib/components/suis-select/suis-select-sort-options.pipe.d.ts +8 -0
  34. package/lib/components/suis-select/suis-select.component.d.ts +43 -0
  35. package/lib/components/suis-select-option/index.d.ts +3 -0
  36. package/lib/components/suis-select-option/suis-select-option.component.d.ts +30 -0
  37. package/lib/components/suis-select-option/suis-select-option.directive.d.ts +10 -0
  38. package/lib/components/suis-select-option/suis-select-option.interfaces.d.ts +4 -0
  39. package/package.json +1 -1
package/fesm2022/suis.mjs CHANGED
@@ -1,9 +1,172 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, inject, ElementRef, Renderer2, Directive, ChangeDetectorRef, EventEmitter, Output, ViewEncapsulation, HostListener, Pipe, forwardRef, ViewChild } from '@angular/core';
2
+ import { Pipe, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, inject, ElementRef, Renderer2, Directive, ChangeDetectorRef, ViewEncapsulation, HostListener, forwardRef, ViewChild, TemplateRef, ContentChild } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
- import { NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
6
+ import { NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
7
+
8
+ class SuisNgClassPipe {
9
+ transform(prefix, ...args) {
10
+ const classes = [];
11
+ args.forEach((arg) => classes.push(`${prefix}--${arg}`));
12
+ return classes;
13
+ }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
15
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, isStandalone: true, name: "suisNgClass" }); }
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, decorators: [{
18
+ type: Pipe,
19
+ args: [{
20
+ standalone: true,
21
+ name: 'suisNgClass',
22
+ }]
23
+ }] });
24
+
25
+ var SuisIconType;
26
+ (function (SuisIconType) {
27
+ SuisIconType["INFO"] = "info";
28
+ SuisIconType["WARNING"] = "warning";
29
+ SuisIconType["CHECK"] = "check";
30
+ SuisIconType["CROSS"] = "cross";
31
+ SuisIconType["PLUS"] = "plus";
32
+ SuisIconType["MINUS"] = "minus";
33
+ SuisIconType["ARROW_UP"] = "arrow-up";
34
+ SuisIconType["ARROW_LEFT"] = "arrow-left";
35
+ SuisIconType["ARROW_RIGHT"] = "arrow-right";
36
+ SuisIconType["ARROW_DOWN"] = "arrow-down";
37
+ SuisIconType["CHEVRON_UP"] = "chevron-up";
38
+ SuisIconType["CHEVRON_DOWN"] = "chevron-down";
39
+ })(SuisIconType || (SuisIconType = {}));
40
+
41
+ class SuisIconTypePipe {
42
+ transform(type) {
43
+ switch (type) {
44
+ case SuisIconType.INFO:
45
+ return '?';
46
+ case SuisIconType.WARNING:
47
+ return '!';
48
+ case SuisIconType.CHECK:
49
+ return '✓';
50
+ case SuisIconType.CROSS:
51
+ return '×';
52
+ case SuisIconType.PLUS:
53
+ return '+';
54
+ case SuisIconType.MINUS:
55
+ return '−';
56
+ case SuisIconType.ARROW_LEFT:
57
+ return '←';
58
+ case SuisIconType.ARROW_UP:
59
+ return '↑';
60
+ case SuisIconType.ARROW_RIGHT:
61
+ return '→';
62
+ case SuisIconType.ARROW_DOWN:
63
+ return '↓';
64
+ case SuisIconType.CHEVRON_UP:
65
+ return '‹';
66
+ case SuisIconType.CHEVRON_DOWN:
67
+ return '›';
68
+ }
69
+ }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
71
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, isStandalone: true, name: "suisIconType" }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, decorators: [{
74
+ type: Pipe,
75
+ args: [{
76
+ standalone: true,
77
+ name: 'suisIconType',
78
+ }]
79
+ }] });
80
+
81
+ class SuisIconComponent {
82
+ constructor() {
83
+ /** @internal */
84
+ this.SuisIconType = SuisIconType;
85
+ /**
86
+ * Sets the font size of the HTML Entity itself. Type of SuisSize. By default set to 'md'.
87
+ */
88
+ this.size = 'md';
89
+ /**
90
+ * Sets the color pallette of the icon and surroundings. Type of SuisColor. By default set to 'dark'.
91
+ */
92
+ this.color = 'dark';
93
+ /**
94
+ * Sets the HTML Entity displayed in content. Type of SuisIconType. By default set to SuisIconType.INFO.
95
+ */
96
+ this.type = SuisIconType.INFO;
97
+ /**
98
+ * Shows the circled border around the icon. By default set to false. Can not be combined with filled (will be overriden then).
99
+ */
100
+ this.outlined = false;
101
+ /**
102
+ * Shows the circled background behind the icon. By default set to false. Overrides outlined behavior if used at the sime time.
103
+ */
104
+ this.filled = false;
105
+ /**
106
+ * Shows the pointer cursor when hovered. By default set to false.
107
+ */
108
+ this.pointer = false;
109
+ /**
110
+ * Sets HTML Entity font weight to bold. By default set to false.
111
+ */
112
+ this.bold = false;
113
+ }
114
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
115
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisIconComponent, isStandalone: true, selector: "suis-icon", inputs: { size: "size", color: "color", type: "type", outlined: "outlined", filled: "filled", pointer: "pointer", bold: "bold" }, ngImport: i0, template: "<div\n class=\"suis-icon\"\n [class.suis-icon--outlined]=\"outlined\"\n [class.suis-icon--filled]=\"filled\"\n [class.suis-icon--pointer]=\"pointer\"\n [class.suis-icon--bold]=\"bold\"\n [class.suis-icon--rotate]=\"\n type === SuisIconType.CHEVRON_UP || type === SuisIconType.CHEVRON_DOWN\n \"\n [ngClass]=\"'suis-icon' | suisNgClass : color : size\"\n>\n <span [innerHTML]=\"type | suisIconType\"></span>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-icon{display:flex;justify-content:center;align-items:center;width:1rem;height:1rem;border-radius:100%;line-height:1rem;background-color:transparent;border:none}.suis-icon--rotate{transform:rotate(90deg)}.suis-icon--outlined{border-width:.0625rem;border-style:solid}.suis-icon--bold{font-weight:700}.suis-icon--pointer{cursor:pointer}.suis-icon--xs{font-size:.5rem}.suis-icon--sm{font-size:.75rem}.suis-icon--md{font-size:1rem}.suis-icon--lg{font-size:1.25rem;width:1.25rem;height:1.25rem}.suis-icon--xl{font-size:2rem;width:2rem;height:2rem}.suis-icon--primary{color:#192a56;border-color:#192a56}.suis-icon--secondary{color:#273c75;border-color:#273c75}.suis-icon--tertiary{color:#dcdde1;border-color:#dcdde1}.suis-icon--complementary{color:#f5f6fa;border-color:#f5f6fa}.suis-icon--success{color:#2ed573;border-color:#2ed573}.suis-icon--warning{color:#ffa502;border-color:#ffa502}.suis-icon--danger{color:#ff4757;border-color:#ff4757}.suis-icon--white{color:#fff;border-color:#fff}.suis-icon--gray{color:#bcbcbc;border-color:#bcbcbc}.suis-icon--dark{color:#000;border-color:#000}.suis-icon--filled{border:none;background-color:#000;color:#fff}.suis-icon--filled.suis-icon--primary{background-color:#192a56}.suis-icon--filled.suis-icon--secondary{background-color:#273c75}.suis-icon--filled.suis-icon--tertiary{background-color:#dcdde1;color:#2f3640}.suis-icon--filled.suis-icon--complementary{background-color:#f5f6fa;color:#2f3640}.suis-icon--filled.suis-icon--success{background-color:#2ed573}.suis-icon--filled.suis-icon--warning{background-color:#ffa502}.suis-icon--filled.suis-icon--danger{background-color:#ff4757}.suis-icon--filled.suis-icon--white{background-color:#fff;color:#2f3640}.suis-icon--filled.suis-icon--gray{background-color:#bcbcbc}.suis-icon--filled.suis-icon--dark{background-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: SuisIconTypePipe, name: "suisIconType" }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
116
+ }
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, decorators: [{
118
+ type: Component,
119
+ args: [{ selector: 'suis-icon', standalone: true, imports: [CommonModule, SuisIconTypePipe, SuisNgClassPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"suis-icon\"\n [class.suis-icon--outlined]=\"outlined\"\n [class.suis-icon--filled]=\"filled\"\n [class.suis-icon--pointer]=\"pointer\"\n [class.suis-icon--bold]=\"bold\"\n [class.suis-icon--rotate]=\"\n type === SuisIconType.CHEVRON_UP || type === SuisIconType.CHEVRON_DOWN\n \"\n [ngClass]=\"'suis-icon' | suisNgClass : color : size\"\n>\n <span [innerHTML]=\"type | suisIconType\"></span>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-icon{display:flex;justify-content:center;align-items:center;width:1rem;height:1rem;border-radius:100%;line-height:1rem;background-color:transparent;border:none}.suis-icon--rotate{transform:rotate(90deg)}.suis-icon--outlined{border-width:.0625rem;border-style:solid}.suis-icon--bold{font-weight:700}.suis-icon--pointer{cursor:pointer}.suis-icon--xs{font-size:.5rem}.suis-icon--sm{font-size:.75rem}.suis-icon--md{font-size:1rem}.suis-icon--lg{font-size:1.25rem;width:1.25rem;height:1.25rem}.suis-icon--xl{font-size:2rem;width:2rem;height:2rem}.suis-icon--primary{color:#192a56;border-color:#192a56}.suis-icon--secondary{color:#273c75;border-color:#273c75}.suis-icon--tertiary{color:#dcdde1;border-color:#dcdde1}.suis-icon--complementary{color:#f5f6fa;border-color:#f5f6fa}.suis-icon--success{color:#2ed573;border-color:#2ed573}.suis-icon--warning{color:#ffa502;border-color:#ffa502}.suis-icon--danger{color:#ff4757;border-color:#ff4757}.suis-icon--white{color:#fff;border-color:#fff}.suis-icon--gray{color:#bcbcbc;border-color:#bcbcbc}.suis-icon--dark{color:#000;border-color:#000}.suis-icon--filled{border:none;background-color:#000;color:#fff}.suis-icon--filled.suis-icon--primary{background-color:#192a56}.suis-icon--filled.suis-icon--secondary{background-color:#273c75}.suis-icon--filled.suis-icon--tertiary{background-color:#dcdde1;color:#2f3640}.suis-icon--filled.suis-icon--complementary{background-color:#f5f6fa;color:#2f3640}.suis-icon--filled.suis-icon--success{background-color:#2ed573}.suis-icon--filled.suis-icon--warning{background-color:#ffa502}.suis-icon--filled.suis-icon--danger{background-color:#ff4757}.suis-icon--filled.suis-icon--white{background-color:#fff;color:#2f3640}.suis-icon--filled.suis-icon--gray{background-color:#bcbcbc}.suis-icon--filled.suis-icon--dark{background-color:#000}\n"] }]
120
+ }], propDecorators: { size: [{
121
+ type: Input
122
+ }], color: [{
123
+ type: Input
124
+ }], type: [{
125
+ type: Input
126
+ }], outlined: [{
127
+ type: Input
128
+ }], filled: [{
129
+ type: Input
130
+ }], pointer: [{
131
+ type: Input
132
+ }], bold: [{
133
+ type: Input
134
+ }] } });
135
+
136
+ class SuisAlertComponent {
137
+ constructor() {
138
+ /** @internal */
139
+ this.SuisIconType = SuisIconType;
140
+ /**
141
+ * Controls visibilty of the alert. By default set to false.
142
+ */
143
+ this.hidden = false;
144
+ /**
145
+ * Emits change of hidden state.
146
+ */
147
+ this.hiddenChange = new EventEmitter();
148
+ /**
149
+ * Sets the color pallette of the alert. Type of SuisInfoColor. By default set to 'danger'.
150
+ */
151
+ this.color = 'danger';
152
+ }
153
+ onCancel() {
154
+ this.hidden = true;
155
+ this.hiddenChange.emit(true);
156
+ }
157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
158
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisAlertComponent, isStandalone: true, selector: "suis-alert", inputs: { hidden: "hidden", color: "color" }, outputs: { hiddenChange: "hiddenChange" }, ngImport: i0, template: "<div\n *ngIf=\"!hidden\"\n class=\"suis-alert\"\n [ngClass]=\"'suis-alert' | suisNgClass : color\"\n>\n <ng-content></ng-content>\n <button class=\"suis-alert__cancel\" type=\"button\" (click)=\"onCancel()\">\n <suis-icon\n [type]=\"SuisIconType.CROSS\"\n [color]=\"'white'\"\n [size]=\"'lg'\"\n ></suis-icon>\n </button>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-alert{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1.25rem;border-radius:.25rem;color:#fff;font-weight:500}.suis-alert__cancel{background-color:transparent;border:none;cursor:pointer}.suis-alert--success{background-color:#2ed573}.suis-alert--warning{background-color:#ffa502}.suis-alert--danger{background-color:#ff4757}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }, { kind: "component", type: SuisIconComponent, selector: "suis-icon", inputs: ["size", "color", "type", "outlined", "filled", "pointer", "bold"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
159
+ }
160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisAlertComponent, decorators: [{
161
+ type: Component,
162
+ args: [{ selector: 'suis-alert', standalone: true, imports: [CommonModule, SuisNgClassPipe, SuisIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"!hidden\"\n class=\"suis-alert\"\n [ngClass]=\"'suis-alert' | suisNgClass : color\"\n>\n <ng-content></ng-content>\n <button class=\"suis-alert__cancel\" type=\"button\" (click)=\"onCancel()\">\n <suis-icon\n [type]=\"SuisIconType.CROSS\"\n [color]=\"'white'\"\n [size]=\"'lg'\"\n ></suis-icon>\n </button>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-alert{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1.25rem;border-radius:.25rem;color:#fff;font-weight:500}.suis-alert__cancel{background-color:transparent;border:none;cursor:pointer}.suis-alert--success{background-color:#2ed573}.suis-alert--warning{background-color:#ffa502}.suis-alert--danger{background-color:#ff4757}\n"] }]
163
+ }], propDecorators: { hidden: [{
164
+ type: Input
165
+ }], hiddenChange: [{
166
+ type: Output
167
+ }], color: [{
168
+ type: Input
169
+ }] } });
7
170
 
8
171
  class SuisBoxComponent {
9
172
  constructor() {
@@ -58,6 +221,8 @@ class SuisInputBase {
58
221
  constructor() {
59
222
  /** @internal */
60
223
  this.cdRef = inject(ChangeDetectorRef);
224
+ /** @internal */
225
+ this.elRef = inject(ElementRef);
61
226
  /**
62
227
  * Sets input disabled state. By default set to false.
63
228
  */
@@ -163,122 +328,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
163
328
  args: ['click']
164
329
  }] } });
165
330
 
166
- var SuisIconType;
167
- (function (SuisIconType) {
168
- SuisIconType["INFO"] = "info";
169
- SuisIconType["WARNING"] = "warning";
170
- SuisIconType["CHECK"] = "check";
171
- SuisIconType["CROSS"] = "cross";
172
- SuisIconType["PLUS"] = "plus";
173
- SuisIconType["MINUS"] = "minus";
174
- SuisIconType["ARROW_UP"] = "arrow-up";
175
- SuisIconType["ARROW_LEFT"] = "arrow-left";
176
- SuisIconType["ARROW_RIGHT"] = "arrow-right";
177
- SuisIconType["ARROW_DOWN"] = "arrow-down";
178
- })(SuisIconType || (SuisIconType = {}));
179
-
180
- class SuisIconTypePipe {
181
- transform(type) {
182
- switch (type) {
183
- case SuisIconType.INFO:
184
- return '&quest;';
185
- case SuisIconType.WARNING:
186
- return '&excl;';
187
- case SuisIconType.CHECK:
188
- return '&check;';
189
- case SuisIconType.CROSS:
190
- return '&times;';
191
- case SuisIconType.PLUS:
192
- return '&plus;';
193
- case SuisIconType.MINUS:
194
- return '&minus;';
195
- case SuisIconType.ARROW_LEFT:
196
- return '&#8592;';
197
- case SuisIconType.ARROW_UP:
198
- return '&#8593;';
199
- case SuisIconType.ARROW_RIGHT:
200
- return '&#8594;';
201
- case SuisIconType.ARROW_DOWN:
202
- return '&#8595;';
203
- }
204
- }
205
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
206
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, isStandalone: true, name: "suisIconType" }); }
207
- }
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, decorators: [{
209
- type: Pipe,
210
- args: [{
211
- standalone: true,
212
- name: 'suisIconType',
213
- }]
214
- }] });
215
-
216
- class SuisNgClassPipe {
217
- transform(prefix, ...args) {
218
- const classes = [];
219
- args.forEach((arg) => classes.push(`${prefix}--${arg}`));
220
- return classes;
221
- }
222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
223
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, isStandalone: true, name: "suisNgClass" }); }
224
- }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisNgClassPipe, decorators: [{
226
- type: Pipe,
227
- args: [{
228
- standalone: true,
229
- name: 'suisNgClass',
230
- }]
231
- }] });
232
-
233
- class SuisIconComponent {
234
- constructor() {
235
- /** @internal */
236
- this.SuisIconType = SuisIconType;
237
- /**
238
- * Sets the font size of the HTML Entity itself. Type of SuisSize. By default set to 'md'.
239
- */
240
- this.size = 'md';
241
- /**
242
- * Sets the color pallette of the icon and surroundings. Type of SuisColor. By default set to 'dark'.
243
- */
244
- this.color = 'dark';
245
- /**
246
- * Sets the HTML Entity displayed in content. Type of SuisIconType. By default set to SuisIconType.INFO.
247
- */
248
- this.type = SuisIconType.INFO;
249
- /**
250
- * Shows the circled border around the icon. By default set to false. Can not be combined with filled (will be overriden then).
251
- */
252
- this.outlined = false;
253
- /**
254
- * Shows the circled background behind the icon. By default set to false. Overrides outlined behavior if used at the sime time.
255
- */
256
- this.filled = false;
257
- /**
258
- * Shows the pointer cursor when hovered. By defauly set to false.
259
- */
260
- this.pointer = false;
261
- }
262
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
263
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisIconComponent, isStandalone: true, selector: "suis-icon", inputs: { size: "size", color: "color", type: "type", outlined: "outlined", filled: "filled", pointer: "pointer" }, ngImport: i0, template: "<div\n class=\"suis-icon\"\n [class.suis-icon--outlined]=\"outlined\"\n [class.suis-icon--filled]=\"filled\"\n [class.suis-icon--pointer]=\"pointer\"\n [ngClass]=\"'suis-icon' | suisNgClass : color : size\"\n>\n <span [innerHTML]=\"type | suisIconType\"></span>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-icon{display:flex;justify-content:center;align-items:center;width:1rem;height:1rem;border-radius:100%;line-height:1rem;background-color:transparent;border:none}.suis-icon--outlined{border-width:.0625rem;border-style:solid}.suis-icon--pointer{cursor:pointer}.suis-icon--xs{font-size:.5rem}.suis-icon--sm{font-size:.75rem}.suis-icon--md{font-size:1rem}.suis-icon--lg{font-size:1.5rem;width:1.5rem;height:1.5rem}.suis-icon--xl{font-size:2rem;width:2rem;height:2rem}.suis-icon--primary{color:#192a56;border-color:#192a56}.suis-icon--secondary{color:#273c75;border-color:#273c75}.suis-icon--tertiary{color:#dcdde1;border-color:#dcdde1}.suis-icon--complementary{color:#f5f6fa;border-color:#f5f6fa}.suis-icon--success{color:#2ed573;border-color:#2ed573}.suis-icon--warning{color:#ffa502;border-color:#ffa502}.suis-icon--danger{color:#ff4757;border-color:#ff4757}.suis-icon--white{color:#fff;border-color:#fff}.suis-icon--gray{color:#bcbcbc;border-color:#bcbcbc}.suis-icon--dark{color:#000;border-color:#000}.suis-icon--filled{border:none;background-color:#000;color:#fff}.suis-icon--filled.suis-icon--primary{background-color:#192a56}.suis-icon--filled.suis-icon--secondary{background-color:#273c75}.suis-icon--filled.suis-icon--tertiary{background-color:#dcdde1;color:#2f3640}.suis-icon--filled.suis-icon--complementary{background-color:#f5f6fa;color:#2f3640}.suis-icon--filled.suis-icon--success{background-color:#2ed573}.suis-icon--filled.suis-icon--warning{background-color:#ffa502}.suis-icon--filled.suis-icon--danger{background-color:#ff4757}.suis-icon--filled.suis-icon--white{background-color:#fff;color:#2f3640}.suis-icon--filled.suis-icon--gray{background-color:#bcbcbc}.suis-icon--filled.suis-icon--dark{background-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: SuisIconTypePipe, name: "suisIconType" }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
264
- }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, decorators: [{
266
- type: Component,
267
- args: [{ selector: 'suis-icon', standalone: true, imports: [CommonModule, SuisIconTypePipe, SuisNgClassPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"suis-icon\"\n [class.suis-icon--outlined]=\"outlined\"\n [class.suis-icon--filled]=\"filled\"\n [class.suis-icon--pointer]=\"pointer\"\n [ngClass]=\"'suis-icon' | suisNgClass : color : size\"\n>\n <span [innerHTML]=\"type | suisIconType\"></span>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-icon{display:flex;justify-content:center;align-items:center;width:1rem;height:1rem;border-radius:100%;line-height:1rem;background-color:transparent;border:none}.suis-icon--outlined{border-width:.0625rem;border-style:solid}.suis-icon--pointer{cursor:pointer}.suis-icon--xs{font-size:.5rem}.suis-icon--sm{font-size:.75rem}.suis-icon--md{font-size:1rem}.suis-icon--lg{font-size:1.5rem;width:1.5rem;height:1.5rem}.suis-icon--xl{font-size:2rem;width:2rem;height:2rem}.suis-icon--primary{color:#192a56;border-color:#192a56}.suis-icon--secondary{color:#273c75;border-color:#273c75}.suis-icon--tertiary{color:#dcdde1;border-color:#dcdde1}.suis-icon--complementary{color:#f5f6fa;border-color:#f5f6fa}.suis-icon--success{color:#2ed573;border-color:#2ed573}.suis-icon--warning{color:#ffa502;border-color:#ffa502}.suis-icon--danger{color:#ff4757;border-color:#ff4757}.suis-icon--white{color:#fff;border-color:#fff}.suis-icon--gray{color:#bcbcbc;border-color:#bcbcbc}.suis-icon--dark{color:#000;border-color:#000}.suis-icon--filled{border:none;background-color:#000;color:#fff}.suis-icon--filled.suis-icon--primary{background-color:#192a56}.suis-icon--filled.suis-icon--secondary{background-color:#273c75}.suis-icon--filled.suis-icon--tertiary{background-color:#dcdde1;color:#2f3640}.suis-icon--filled.suis-icon--complementary{background-color:#f5f6fa;color:#2f3640}.suis-icon--filled.suis-icon--success{background-color:#2ed573}.suis-icon--filled.suis-icon--warning{background-color:#ffa502}.suis-icon--filled.suis-icon--danger{background-color:#ff4757}.suis-icon--filled.suis-icon--white{background-color:#fff;color:#2f3640}.suis-icon--filled.suis-icon--gray{background-color:#bcbcbc}.suis-icon--filled.suis-icon--dark{background-color:#000}\n"] }]
268
- }], propDecorators: { size: [{
269
- type: Input
270
- }], color: [{
271
- type: Input
272
- }], type: [{
273
- type: Input
274
- }], outlined: [{
275
- type: Input
276
- }], filled: [{
277
- type: Input
278
- }], pointer: [{
279
- type: Input
280
- }] } });
281
-
282
331
  class SuisChipComponent {
283
332
  constructor() {
284
333
  /** @internal */
@@ -305,7 +354,7 @@ class SuisChipComponent {
305
354
  this.remove.emit();
306
355
  }
307
356
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
308
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisChipComponent, isStandalone: true, selector: "suis-chip", inputs: { color: "color", iconColor: "iconColor", removable: "removable" }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"suis-chip\" [ngClass]=\"'suis-chip' | suisNgClass : color\">\n <ng-content></ng-content>\n <button\n *ngIf=\"removable\"\n class=\"suis-chip__remove\"\n type=\"button\"\n (click)=\"onRemove()\"\n >\n <suis-icon\n [color]=\"iconColor\"\n [type]=\"SuisIconType.CROSS\"\n [pointer]=\"true\"\n [size]=\"'md'\"\n ></suis-icon>\n </button>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-chip{display:flex;align-items:center;justify-content:center;width:-moz-fit-content;width:fit-content;border-radius:1rem;font-size:.875rem;padding:.25rem .5rem;color:#fff}.suis-chip__remove{border:none;background-color:transparent}.suis-chip--primary{background-color:#192a56}.suis-chip--secondary{background-color:#273c75}.suis-chip--tertiary{background-color:#dcdde1;color:#2f3640}.suis-chip--complementary{background-color:#f5f6fa;color:#2f3640}.suis-chip--success{background-color:#2ed573}.suis-chip--warning{background-color:#ffa502}.suis-chip--danger{background-color:#ff4757}.suis-chip--gray{background-color:#bcbcbc}.suis-chip--white{background-color:#fff;color:#2f3640}.suis-chip--dark{background-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SuisIconComponent, selector: "suis-icon", inputs: ["size", "color", "type", "outlined", "filled", "pointer"] }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
357
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisChipComponent, isStandalone: true, selector: "suis-chip", inputs: { color: "color", iconColor: "iconColor", removable: "removable" }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"suis-chip\" [ngClass]=\"'suis-chip' | suisNgClass : color\">\n <ng-content></ng-content>\n <button\n *ngIf=\"removable\"\n class=\"suis-chip__remove\"\n type=\"button\"\n (click)=\"onRemove()\"\n >\n <suis-icon\n [color]=\"iconColor\"\n [type]=\"SuisIconType.CROSS\"\n [pointer]=\"true\"\n [size]=\"'md'\"\n ></suis-icon>\n </button>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-chip{display:flex;align-items:center;justify-content:center;width:-moz-fit-content;width:fit-content;border-radius:1rem;font-size:.875rem;padding:.25rem .5rem;color:#fff}.suis-chip__remove{border:none;background-color:transparent}.suis-chip--primary{background-color:#192a56}.suis-chip--secondary{background-color:#273c75}.suis-chip--tertiary{background-color:#dcdde1;color:#2f3640}.suis-chip--complementary{background-color:#f5f6fa;color:#2f3640}.suis-chip--success{background-color:#2ed573}.suis-chip--warning{background-color:#ffa502}.suis-chip--danger{background-color:#ff4757}.suis-chip--gray{background-color:#bcbcbc}.suis-chip--white{background-color:#fff;color:#2f3640}.suis-chip--dark{background-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SuisIconComponent, selector: "suis-icon", inputs: ["size", "color", "type", "outlined", "filled", "pointer", "bold"] }, { kind: "pipe", type: SuisNgClassPipe, name: "suisNgClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
309
358
  }
310
359
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisChipComponent, decorators: [{
311
360
  type: Component,
@@ -380,7 +429,7 @@ class SuisInputTextComponent extends SuisInputBase {
380
429
  multi: true,
381
430
  useExisting: forwardRef(() => SuisInputTextComponent),
382
431
  },
383
- ], usesInheritance: true, ngImport: i0, template: "<input\n class=\"suis-input\"\n [class.suis-input--invalid]=\"invalid\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n (keydown.enter)=\"onEnter()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input{background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;width:100%}.suis-input:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input--invalid{box-shadow:0 2px 5px #ff4757bf}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
432
+ ], usesInheritance: true, ngImport: i0, template: "<input\n class=\"suis-input\"\n [class.suis-input--invalid]=\"invalid\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n (keydown.enter)=\"onEnter()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input{background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;width:100%;height:2rem}.suis-input:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input--invalid{box-shadow:0 2px 5px #ff4757bf}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
384
433
  }
385
434
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisInputTextComponent, decorators: [{
386
435
  type: Component,
@@ -390,7 +439,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
390
439
  multi: true,
391
440
  useExisting: forwardRef(() => SuisInputTextComponent),
392
441
  },
393
- ], template: "<input\n class=\"suis-input\"\n [class.suis-input--invalid]=\"invalid\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n (keydown.enter)=\"onEnter()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input{background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;width:100%}.suis-input:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input--invalid{box-shadow:0 2px 5px #ff4757bf}\n"] }]
442
+ ], template: "<input\n class=\"suis-input\"\n [class.suis-input--invalid]=\"invalid\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n (keydown.enter)=\"onEnter()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input{background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;width:100%;height:2rem}.suis-input:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input--invalid{box-shadow:0 2px 5px #ff4757bf}\n"] }]
394
443
  }], propDecorators: { type: [{
395
444
  type: Input
396
445
  }], placeholder: [{
@@ -504,6 +553,233 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
504
553
  type: Input
505
554
  }] } });
506
555
 
556
+ class SuisSelectLabelPipe {
557
+ transform(value, options, placeholder) {
558
+ if (!value)
559
+ return placeholder;
560
+ const selectedOption = options.find((option) => JSON.stringify(option.value) === JSON.stringify(value));
561
+ if (!selectedOption)
562
+ throw Error('[SuisSelectLabelPipe] Provided value does not belong to valid values');
563
+ return selectedOption.label;
564
+ }
565
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
566
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, isStandalone: true, name: "suisSelectLabel" }); }
567
+ }
568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, decorators: [{
569
+ type: Pipe,
570
+ args: [{
571
+ standalone: true,
572
+ name: 'suisSelectLabel',
573
+ }]
574
+ }] });
575
+
576
+ class SuisSelectIsSelectedPipe {
577
+ transform(optionValue, value) {
578
+ return JSON.stringify(optionValue) === JSON.stringify(value);
579
+ }
580
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
581
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, isStandalone: true, name: "suisSelectIsSelected" }); }
582
+ }
583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, decorators: [{
584
+ type: Pipe,
585
+ args: [{
586
+ standalone: true,
587
+ name: 'suisSelectIsSelected',
588
+ }]
589
+ }] });
590
+
591
+ class SuisSelectOptionDirective {
592
+ constructor() {
593
+ /**
594
+ * Custom template of the option.
595
+ */
596
+ this.templateRef = inject((TemplateRef));
597
+ }
598
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
599
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectOptionDirective, isStandalone: true, selector: "[suisSelectOption]", ngImport: i0 }); }
600
+ }
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionDirective, decorators: [{
602
+ type: Directive,
603
+ args: [{
604
+ selector: '[suisSelectOption]',
605
+ standalone: true,
606
+ }]
607
+ }] });
608
+
609
+ class SuisSelectOptionComponent {
610
+ constructor() {
611
+ /** @internal */
612
+ this.SuisIconType = SuisIconType;
613
+ /**
614
+ * Adds checkmark icon to checkbox.
615
+ */
616
+ this.selected = false;
617
+ /**
618
+ * Emits on option selected.
619
+ */
620
+ this.clicked = new EventEmitter();
621
+ }
622
+ /** @internal */
623
+ onClick() {
624
+ this.clicked.emit();
625
+ }
626
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
627
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectOptionComponent, isStandalone: true, selector: "suis-select-option", inputs: { option: "option", templateRef: "templateRef", selected: "selected" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n class=\"suis-select-option\"\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"onClick()\"\n>\n <span\n class=\"suis-select-option__checkbox\"\n [class.suis-select-option__checkbox--selected]=\"selected\"\n >\n <suis-icon\n *ngIf=\"selected\"\n [bold]=\"true\"\n color=\"primary\"\n [type]=\"SuisIconType.CHECK\"\n size=\"sm\"\n ></suis-icon>\n </span>\n <span class=\"suis-select-option__label\">\n <ng-container *ngIf=\"templateRef; else label\">\n <ng-container\n *ngTemplateOutlet=\"templateRef; context: { $implicit: option }\"\n ></ng-container>\n </ng-container>\n <ng-template #label>\n {{ option?.label }}\n </ng-template>\n </span>\n</button>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-select-option{width:100%;display:flex;align-items:center;background-color:transparent;border:none;border-bottom:1px solid #dcdde1;padding:.375rem 1rem;cursor:pointer}.suis-select-option:hover{background-color:#f5f6fa}.suis-select-option__checkbox{width:1rem;height:1rem;border:.0625rem solid #dcdde1;margin-right:.75rem;display:flex;justify-content:center;align-items:center}.suis-select-option__checkbox--selected{border:.0625rem solid #bcbcbc}.suis-select-option__label{display:flex;justify-content:left;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SuisIconComponent, selector: "suis-icon", inputs: ["size", "color", "type", "outlined", "filled", "pointer", "bold"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
628
+ }
629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionComponent, decorators: [{
630
+ type: Component,
631
+ args: [{ selector: 'suis-select-option', standalone: true, imports: [CommonModule, SuisIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"suis-select-option\"\n type=\"button\"\n tabindex=\"-1\"\n (click)=\"onClick()\"\n>\n <span\n class=\"suis-select-option__checkbox\"\n [class.suis-select-option__checkbox--selected]=\"selected\"\n >\n <suis-icon\n *ngIf=\"selected\"\n [bold]=\"true\"\n color=\"primary\"\n [type]=\"SuisIconType.CHECK\"\n size=\"sm\"\n ></suis-icon>\n </span>\n <span class=\"suis-select-option__label\">\n <ng-container *ngIf=\"templateRef; else label\">\n <ng-container\n *ngTemplateOutlet=\"templateRef; context: { $implicit: option }\"\n ></ng-container>\n </ng-container>\n <ng-template #label>\n {{ option?.label }}\n </ng-template>\n </span>\n</button>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-select-option{width:100%;display:flex;align-items:center;background-color:transparent;border:none;border-bottom:1px solid #dcdde1;padding:.375rem 1rem;cursor:pointer}.suis-select-option:hover{background-color:#f5f6fa}.suis-select-option__checkbox{width:1rem;height:1rem;border:.0625rem solid #dcdde1;margin-right:.75rem;display:flex;justify-content:center;align-items:center}.suis-select-option__checkbox--selected{border:.0625rem solid #bcbcbc}.suis-select-option__label{display:flex;justify-content:left;align-items:center}\n"] }]
632
+ }], propDecorators: { option: [{
633
+ type: Input,
634
+ args: [{ required: true }]
635
+ }], templateRef: [{
636
+ type: Input
637
+ }], selected: [{
638
+ type: Input
639
+ }], clicked: [{
640
+ type: Output
641
+ }] } });
642
+
643
+ class SuisSelectSortOptionsPipe {
644
+ transform(options) {
645
+ return options.sort((a, b) => a.label.localeCompare(b.label));
646
+ }
647
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
648
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, isStandalone: true, name: "suisSelectSortOptions" }); }
649
+ }
650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, decorators: [{
651
+ type: Pipe,
652
+ args: [{
653
+ standalone: true,
654
+ name: 'suisSelectSortOptions',
655
+ }]
656
+ }] });
657
+
658
+ class SuisSelectFilterOptionsPipe {
659
+ transform(options, phrase) {
660
+ if (!phrase)
661
+ return options;
662
+ return options.filter((option) => option.label.toLocaleLowerCase().includes(phrase.toLocaleLowerCase()));
663
+ }
664
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
665
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, isStandalone: true, name: "suisSelectFilterOptions" }); }
666
+ }
667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, decorators: [{
668
+ type: Pipe,
669
+ args: [{
670
+ standalone: true,
671
+ name: 'suisSelectFilterOptions',
672
+ }]
673
+ }] });
674
+
675
+ class SuisSelectComponent extends SuisInputBase {
676
+ constructor() {
677
+ super(...arguments);
678
+ /** @internal */
679
+ this.SuisIconType = SuisIconType;
680
+ /** @internal */
681
+ this.value = null;
682
+ /** @internal */
683
+ this.searchPhrase = '';
684
+ /** @internal */
685
+ this.expanded = false;
686
+ /**
687
+ * Options displayed in dropdown list. Type of SuisSelectOption[].
688
+ */
689
+ this.options = [];
690
+ /**
691
+ * Displays search input above options. By default set to true.
692
+ */
693
+ this.search = true;
694
+ /**
695
+ * Placeholder text displayed in options search. By default set to 'Search...'.
696
+ */
697
+ this.searchPlaceholder = 'Search...';
698
+ /**
699
+ * Placeholder text displayed when value is not selected. By default set to 'Select option...'.
700
+ */
701
+ this.placeholder = 'Select option...';
702
+ }
703
+ writeValue(obj) {
704
+ this.value = obj;
705
+ this._onChange(this.value);
706
+ this.cdRef.markForCheck();
707
+ }
708
+ onSelect(value) {
709
+ if (JSON.stringify(this.value) === JSON.stringify(value))
710
+ return this.clearValue();
711
+ this.setValue(value);
712
+ }
713
+ onExpand() {
714
+ this.toggle(!this.expanded);
715
+ this.onTouch();
716
+ }
717
+ clearValue() {
718
+ this.setValue(null);
719
+ }
720
+ setValue(value) {
721
+ this.value = value;
722
+ this.toggle(false);
723
+ this._onChange(this.value);
724
+ this.changed.emit();
725
+ this.cdRef.markForCheck();
726
+ }
727
+ onClear(event) {
728
+ this.clearValue();
729
+ event.stopPropagation();
730
+ }
731
+ toggle(value) {
732
+ this.expanded = value;
733
+ this.searchPhrase = '';
734
+ }
735
+ onDocumentClick(event) {
736
+ if (!this.elRef.nativeElement.contains(event.target)) {
737
+ this.expanded = false;
738
+ }
739
+ }
740
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
741
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectComponent, isStandalone: true, selector: "suis-select", inputs: { options: "options", search: "search", searchPlaceholder: "searchPlaceholder", placeholder: "placeholder" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
742
+ {
743
+ provide: NG_VALUE_ACCESSOR,
744
+ multi: true,
745
+ useExisting: forwardRef(() => SuisSelectComponent),
746
+ },
747
+ ], queries: [{ propertyName: "suisSelectOption", first: true, predicate: SuisSelectOptionDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"suis-select\">\n <button\n type=\"button\"\n (click)=\"onExpand()\"\n class=\"suis-select__button\"\n [class.suis-select__button--invalid]=\"invalid\"\n [disabled]=\"readonly\"\n >\n <span class=\"suis-select__button__value\">\n {{ value | suisSelectLabel : options : placeholder }}\n </span>\n <suis-icon\n *ngIf=\"value\"\n class=\"suis-select__button__cross\"\n [type]=\"SuisIconType.CROSS\"\n size=\"lg\"\n color=\"primary\"\n (click)=\"onClear($event)\"\n ></suis-icon>\n <suis-icon\n class=\"suis-select__button__chevron\"\n [type]=\"expanded ? SuisIconType.CHEVRON_UP : SuisIconType.CHEVRON_DOWN\"\n size=\"lg\"\n color=\"primary\"\n ></suis-icon>\n </button>\n <div *ngIf=\"expanded\" class=\"suis-select__list\">\n <input\n *ngIf=\"search\"\n [(ngModel)]=\"searchPhrase\"\n class=\"suis-select__list__search\"\n type=\"search\"\n [placeholder]=\"searchPlaceholder\"\n />\n <suis-select-option\n *ngFor=\"\n let option of options\n | suisSelectSortOptions\n | suisSelectFilterOptions : searchPhrase\n \"\n [option]=\"option\"\n [templateRef]=\"suisSelectOption?.templateRef\"\n [selected]=\"option.value | suisSelectIsSelected : value\"\n (clicked)=\"onSelect(option.value)\"\n ></suis-select-option>\n </div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-select{position:relative}.suis-select__button{position:relative;width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 2.75rem .5rem 1rem;border:0;cursor:pointer;height:2rem}.suis-select__button:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-select__button--invalid{box-shadow:0 2px 5px #ff4757bf}.suis-select__button__value{width:100%;text-align:left;display:block}.suis-select__button__chevron{position:absolute;right:.5rem;top:.375rem}.suis-select__button__cross{position:absolute;right:1.75rem;top:.375rem}.suis-select__list{position:absolute;z-index:10;background-color:#fff;box-shadow:0 2px 5px #00000080;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;width:100%;top:2rem;left:0;max-height:12.25rem;overflow-y:auto}.suis-select__list__search{width:100%;border:none;border-bottom:1px solid #dcdde1;padding:.375rem 1rem}.suis-select__list__search:focus{outline:none}.suis-select__list::-webkit-scrollbar{width:.5rem}.suis-select__list::-webkit-scrollbar-track{background:#f5f6fa}.suis-select__list::-webkit-scrollbar-thumb{background:#dcdde1}.suis-select__list::-webkit-scrollbar-thumb:hover{background:#bcbcbc}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SuisIconComponent, selector: "suis-icon", inputs: ["size", "color", "type", "outlined", "filled", "pointer", "bold"] }, { kind: "component", type: SuisSelectOptionComponent, selector: "suis-select-option", inputs: ["option", "templateRef", "selected"], outputs: ["clicked"] }, { kind: "pipe", type: SuisSelectLabelPipe, name: "suisSelectLabel" }, { kind: "pipe", type: SuisSelectIsSelectedPipe, name: "suisSelectIsSelected" }, { kind: "pipe", type: SuisSelectSortOptionsPipe, name: "suisSelectSortOptions" }, { kind: "pipe", type: SuisSelectFilterOptionsPipe, name: "suisSelectFilterOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
748
+ }
749
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectComponent, decorators: [{
750
+ type: Component,
751
+ args: [{ selector: 'suis-select', standalone: true, imports: [
752
+ CommonModule,
753
+ FormsModule,
754
+ SuisIconComponent,
755
+ SuisSelectOptionComponent,
756
+ SuisSelectLabelPipe,
757
+ SuisSelectIsSelectedPipe,
758
+ SuisSelectSortOptionsPipe,
759
+ SuisSelectFilterOptionsPipe,
760
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
761
+ {
762
+ provide: NG_VALUE_ACCESSOR,
763
+ multi: true,
764
+ useExisting: forwardRef(() => SuisSelectComponent),
765
+ },
766
+ ], template: "<div class=\"suis-select\">\n <button\n type=\"button\"\n (click)=\"onExpand()\"\n class=\"suis-select__button\"\n [class.suis-select__button--invalid]=\"invalid\"\n [disabled]=\"readonly\"\n >\n <span class=\"suis-select__button__value\">\n {{ value | suisSelectLabel : options : placeholder }}\n </span>\n <suis-icon\n *ngIf=\"value\"\n class=\"suis-select__button__cross\"\n [type]=\"SuisIconType.CROSS\"\n size=\"lg\"\n color=\"primary\"\n (click)=\"onClear($event)\"\n ></suis-icon>\n <suis-icon\n class=\"suis-select__button__chevron\"\n [type]=\"expanded ? SuisIconType.CHEVRON_UP : SuisIconType.CHEVRON_DOWN\"\n size=\"lg\"\n color=\"primary\"\n ></suis-icon>\n </button>\n <div *ngIf=\"expanded\" class=\"suis-select__list\">\n <input\n *ngIf=\"search\"\n [(ngModel)]=\"searchPhrase\"\n class=\"suis-select__list__search\"\n type=\"search\"\n [placeholder]=\"searchPlaceholder\"\n />\n <suis-select-option\n *ngFor=\"\n let option of options\n | suisSelectSortOptions\n | suisSelectFilterOptions : searchPhrase\n \"\n [option]=\"option\"\n [templateRef]=\"suisSelectOption?.templateRef\"\n [selected]=\"option.value | suisSelectIsSelected : value\"\n (clicked)=\"onSelect(option.value)\"\n ></suis-select-option>\n </div>\n</div>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-select{position:relative}.suis-select__button{position:relative;width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 2.75rem .5rem 1rem;border:0;cursor:pointer;height:2rem}.suis-select__button:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-select__button--invalid{box-shadow:0 2px 5px #ff4757bf}.suis-select__button__value{width:100%;text-align:left;display:block}.suis-select__button__chevron{position:absolute;right:.5rem;top:.375rem}.suis-select__button__cross{position:absolute;right:1.75rem;top:.375rem}.suis-select__list{position:absolute;z-index:10;background-color:#fff;box-shadow:0 2px 5px #00000080;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;width:100%;top:2rem;left:0;max-height:12.25rem;overflow-y:auto}.suis-select__list__search{width:100%;border:none;border-bottom:1px solid #dcdde1;padding:.375rem 1rem}.suis-select__list__search:focus{outline:none}.suis-select__list::-webkit-scrollbar{width:.5rem}.suis-select__list::-webkit-scrollbar-track{background:#f5f6fa}.suis-select__list::-webkit-scrollbar-thumb{background:#dcdde1}.suis-select__list::-webkit-scrollbar-thumb:hover{background:#bcbcbc}\n"] }]
767
+ }], propDecorators: { suisSelectOption: [{
768
+ type: ContentChild,
769
+ args: [SuisSelectOptionDirective]
770
+ }], options: [{
771
+ type: Input
772
+ }], search: [{
773
+ type: Input
774
+ }], searchPlaceholder: [{
775
+ type: Input
776
+ }], placeholder: [{
777
+ type: Input
778
+ }], onDocumentClick: [{
779
+ type: HostListener,
780
+ args: ['document:click', ['$event']]
781
+ }] } });
782
+
507
783
  class SuisSpinnerComponent {
508
784
  constructor() {
509
785
  /**
@@ -566,5 +842,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
566
842
  * Generated bundle index. Do not edit.
567
843
  */
568
844
 
569
- export { SuisAnchorButtonComponent, SuisBoxComponent, SuisButtonComponent, SuisButtonOutlinedComponent, SuisChipComponent, SuisFormFieldComponent, SuisIconComponent, SuisIconType, SuisInputChipsComponent, SuisInputTextComponent, SuisLabelComponent, SuisNgClassPipe, SuisSpinnerComponent, SuisSpinnerContainerComponent };
845
+ export { SuisAlertComponent, SuisAnchorButtonComponent, SuisBoxComponent, SuisButtonComponent, SuisButtonOutlinedComponent, SuisChipComponent, SuisFormFieldComponent, SuisIconComponent, SuisIconType, SuisInputChipsComponent, SuisInputTextComponent, SuisLabelComponent, SuisNgClassPipe, SuisSelectComponent, SuisSelectOptionComponent, SuisSelectOptionDirective, SuisSpinnerComponent, SuisSpinnerContainerComponent };
570
846
  //# sourceMappingURL=suis.mjs.map