suis 0.10.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -0
- package/esm2022/lib/components/index.mjs +4 -1
- package/esm2022/lib/components/suis-alert/suis-alert.component.mjs +1 -1
- package/esm2022/lib/components/suis-button/suis-button.component.mjs +2 -2
- package/esm2022/lib/components/suis-chip/suis-chip.component.mjs +2 -2
- package/esm2022/lib/components/suis-icon/suis-icon-type.pipe.mjs +5 -1
- package/esm2022/lib/components/suis-icon/suis-icon.component.mjs +10 -4
- package/esm2022/lib/components/suis-icon/suis-icon.enums.mjs +3 -1
- package/esm2022/lib/components/suis-input-chips/suis-input-chips.component.mjs +2 -2
- package/esm2022/lib/components/suis-input-number/index.mjs +2 -0
- package/esm2022/lib/components/suis-input-number/suis-input-number.component.mjs +51 -0
- package/esm2022/lib/components/suis-input-text/suis-input-text.component.mjs +4 -4
- package/esm2022/lib/components/suis-select/index.mjs +2 -0
- package/esm2022/lib/components/suis-select/suis-select-is-selected.pipe.mjs +18 -0
- package/esm2022/lib/components/suis-select/suis-select-label.pipe.mjs +23 -0
- package/esm2022/lib/components/suis-select/suis-select.component.mjs +69 -0
- package/esm2022/lib/components/suis-select-option/index.mjs +4 -0
- package/esm2022/lib/components/suis-select-option/suis-select-option.component.mjs +46 -0
- package/esm2022/lib/components/suis-select-option/suis-select-option.directive.mjs +21 -0
- package/esm2022/lib/components/suis-select-option/suis-select-option.interfaces.mjs +2 -0
- package/esm2022/lib/shared/classes/index.mjs +4 -0
- package/esm2022/lib/shared/classes/suis-button.base.mjs +35 -0
- package/esm2022/lib/shared/classes/suis-input.base.mjs +60 -0
- package/esm2022/lib/shared/classes/suis-select.base.mjs +80 -0
- package/esm2022/lib/shared/pipes/suis-select-filter-options.pipe.mjs +20 -0
- package/esm2022/lib/shared/pipes/suis-select-sort-options.pipe.mjs +18 -0
- package/fesm2022/suis.mjs +323 -10
- package/fesm2022/suis.mjs.map +1 -1
- package/lib/components/index.d.ts +3 -0
- package/lib/components/suis-button/suis-button.component.d.ts +1 -1
- package/lib/components/suis-icon/suis-icon.component.d.ts +6 -2
- package/lib/components/suis-icon/suis-icon.enums.d.ts +3 -1
- package/lib/components/suis-input-chips/suis-input-chips.component.d.ts +1 -1
- package/lib/components/suis-input-number/index.d.ts +1 -0
- package/lib/components/suis-input-number/suis-input-number.component.d.ts +14 -0
- package/lib/components/suis-input-text/suis-input-text.component.d.ts +1 -1
- package/lib/components/suis-select/index.d.ts +1 -0
- package/lib/components/suis-select/suis-select-is-selected.pipe.d.ts +7 -0
- package/lib/components/suis-select/suis-select-label.pipe.d.ts +8 -0
- package/lib/components/suis-select/suis-select.component.d.ts +12 -0
- package/lib/components/suis-select-option/index.d.ts +3 -0
- package/lib/components/suis-select-option/suis-select-option.component.d.ts +34 -0
- package/lib/components/suis-select-option/suis-select-option.directive.d.ts +10 -0
- package/lib/components/suis-select-option/suis-select-option.interfaces.d.ts +4 -0
- package/lib/{classes → shared/classes}/index.d.ts +1 -0
- package/lib/{classes → shared/classes}/suis-button.base.d.ts +1 -1
- package/lib/{classes → shared/classes}/suis-input.base.d.ts +3 -1
- package/lib/shared/classes/suis-select.base.d.ts +46 -0
- package/lib/shared/pipes/suis-select-filter-options.pipe.d.ts +8 -0
- package/lib/shared/pipes/suis-select-sort-options.pipe.d.ts +8 -0
- package/package.json +1 -1
- package/esm2022/lib/classes/index.mjs +0 -3
- package/esm2022/lib/classes/suis-button.base.mjs +0 -35
- package/esm2022/lib/classes/suis-input.base.mjs +0 -58
package/fesm2022/suis.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Pipe, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, inject, ElementRef, Renderer2, Directive, ChangeDetectorRef,
|
2
|
+
import { Pipe, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, inject, ElementRef, Renderer2, Directive, ChangeDetectorRef, TemplateRef, ContentChild, HostListener, ViewEncapsulation, forwardRef, ViewChild } 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
7
|
|
8
8
|
class SuisNgClassPipe {
|
9
9
|
transform(prefix, ...args) {
|
@@ -34,6 +34,8 @@ var SuisIconType;
|
|
34
34
|
SuisIconType["ARROW_LEFT"] = "arrow-left";
|
35
35
|
SuisIconType["ARROW_RIGHT"] = "arrow-right";
|
36
36
|
SuisIconType["ARROW_DOWN"] = "arrow-down";
|
37
|
+
SuisIconType["CHEVRON_UP"] = "chevron-up";
|
38
|
+
SuisIconType["CHEVRON_DOWN"] = "chevron-down";
|
37
39
|
})(SuisIconType || (SuisIconType = {}));
|
38
40
|
|
39
41
|
class SuisIconTypePipe {
|
@@ -59,6 +61,10 @@ class SuisIconTypePipe {
|
|
59
61
|
return '→';
|
60
62
|
case SuisIconType.ARROW_DOWN:
|
61
63
|
return '↓';
|
64
|
+
case SuisIconType.CHEVRON_UP:
|
65
|
+
return '‹';
|
66
|
+
case SuisIconType.CHEVRON_DOWN:
|
67
|
+
return '›';
|
62
68
|
}
|
63
69
|
}
|
64
70
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
@@ -97,16 +103,20 @@ class SuisIconComponent {
|
|
97
103
|
*/
|
98
104
|
this.filled = false;
|
99
105
|
/**
|
100
|
-
* Shows the pointer cursor when hovered. By
|
106
|
+
* Shows the pointer cursor when hovered. By default set to false.
|
101
107
|
*/
|
102
108
|
this.pointer = false;
|
109
|
+
/**
|
110
|
+
* Sets HTML Entity font weight to bold. By default set to false.
|
111
|
+
*/
|
112
|
+
this.bold = false;
|
103
113
|
}
|
104
114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
105
|
-
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.
|
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 }); }
|
106
116
|
}
|
107
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisIconComponent, decorators: [{
|
108
118
|
type: Component,
|
109
|
-
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.
|
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"] }]
|
110
120
|
}], propDecorators: { size: [{
|
111
121
|
type: Input
|
112
122
|
}], color: [{
|
@@ -119,6 +129,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
119
129
|
type: Input
|
120
130
|
}], pointer: [{
|
121
131
|
type: Input
|
132
|
+
}], bold: [{
|
133
|
+
type: Input
|
122
134
|
}] } });
|
123
135
|
|
124
136
|
class SuisAlertComponent {
|
@@ -143,7 +155,7 @@ class SuisAlertComponent {
|
|
143
155
|
this.hiddenChange.emit(true);
|
144
156
|
}
|
145
157
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
146
|
-
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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
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 }); }
|
147
159
|
}
|
148
160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisAlertComponent, decorators: [{
|
149
161
|
type: Component,
|
@@ -209,6 +221,8 @@ class SuisInputBase {
|
|
209
221
|
constructor() {
|
210
222
|
/** @internal */
|
211
223
|
this.cdRef = inject(ChangeDetectorRef);
|
224
|
+
/** @internal */
|
225
|
+
this.elRef = inject(ElementRef);
|
212
226
|
/**
|
213
227
|
* Sets input disabled state. By default set to false.
|
214
228
|
*/
|
@@ -260,6 +274,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
260
274
|
type: Output
|
261
275
|
}] } });
|
262
276
|
|
277
|
+
class SuisSelectOptionDirective {
|
278
|
+
constructor() {
|
279
|
+
/**
|
280
|
+
* Custom template of the option.
|
281
|
+
*/
|
282
|
+
this.templateRef = inject((TemplateRef));
|
283
|
+
}
|
284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
285
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectOptionDirective, isStandalone: true, selector: "[suisSelectOption]", ngImport: i0 }); }
|
286
|
+
}
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionDirective, decorators: [{
|
288
|
+
type: Directive,
|
289
|
+
args: [{
|
290
|
+
selector: '[suisSelectOption]',
|
291
|
+
standalone: true,
|
292
|
+
}]
|
293
|
+
}] });
|
294
|
+
|
295
|
+
class SuisSelectBase extends SuisInputBase {
|
296
|
+
constructor() {
|
297
|
+
super(...arguments);
|
298
|
+
/** @internal */
|
299
|
+
this.SuisIconType = SuisIconType;
|
300
|
+
/** @internal */
|
301
|
+
this.searchPhrase = '';
|
302
|
+
/** @internal */
|
303
|
+
this.expanded = false;
|
304
|
+
/**
|
305
|
+
* Options displayed in dropdown list. Type of SuisSelectOption[].
|
306
|
+
*/
|
307
|
+
this.options = [];
|
308
|
+
/**
|
309
|
+
* Displays search input above options. By default set to true.
|
310
|
+
*/
|
311
|
+
this.search = true;
|
312
|
+
/**
|
313
|
+
* Placeholder text displayed in options search. By default set to 'Search...'.
|
314
|
+
*/
|
315
|
+
this.searchPlaceholder = 'Search...';
|
316
|
+
/**
|
317
|
+
* Placeholder text displayed when value is not selected. By default set to 'Select option...'.
|
318
|
+
*/
|
319
|
+
this.placeholder = 'Select option...';
|
320
|
+
/**
|
321
|
+
* Emits on search phrase changed.
|
322
|
+
*/
|
323
|
+
this.searchPhraseChanged = new EventEmitter();
|
324
|
+
}
|
325
|
+
onClear(event) {
|
326
|
+
this.clearValue();
|
327
|
+
event.stopPropagation();
|
328
|
+
}
|
329
|
+
onSearchPhraseChange(text) {
|
330
|
+
this.searchPhrase = text;
|
331
|
+
this.searchPhraseChanged.emit(text);
|
332
|
+
}
|
333
|
+
onExpand() {
|
334
|
+
this.toggle(!this.expanded);
|
335
|
+
this.onTouch();
|
336
|
+
}
|
337
|
+
toggle(value) {
|
338
|
+
this.expanded = value;
|
339
|
+
this.searchPhrase = '';
|
340
|
+
}
|
341
|
+
onDocumentClick(event) {
|
342
|
+
if (!this.elRef.nativeElement.contains(event.target)) {
|
343
|
+
this.expanded = false;
|
344
|
+
}
|
345
|
+
}
|
346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
347
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectBase, inputs: { options: "options", search: "search", searchPlaceholder: "searchPlaceholder", placeholder: "placeholder" }, outputs: { searchPhraseChanged: "searchPhraseChanged" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, queries: [{ propertyName: "suisSelectOption", first: true, predicate: SuisSelectOptionDirective, descendants: true }], usesInheritance: true, ngImport: i0 }); }
|
348
|
+
}
|
349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectBase, decorators: [{
|
350
|
+
type: Directive
|
351
|
+
}], propDecorators: { suisSelectOption: [{
|
352
|
+
type: ContentChild,
|
353
|
+
args: [SuisSelectOptionDirective]
|
354
|
+
}], options: [{
|
355
|
+
type: Input
|
356
|
+
}], search: [{
|
357
|
+
type: Input
|
358
|
+
}], searchPlaceholder: [{
|
359
|
+
type: Input
|
360
|
+
}], placeholder: [{
|
361
|
+
type: Input
|
362
|
+
}], searchPhraseChanged: [{
|
363
|
+
type: Output
|
364
|
+
}], onDocumentClick: [{
|
365
|
+
type: HostListener,
|
366
|
+
args: ['document:click', ['$event']]
|
367
|
+
}] } });
|
368
|
+
|
263
369
|
class SuisButtonComponent extends SuisButtonBase {
|
264
370
|
ngAfterViewInit() {
|
265
371
|
this.renderer2.addClass(this.elementRef.nativeElement, 'suis-button');
|
@@ -340,7 +446,7 @@ class SuisChipComponent {
|
|
340
446
|
this.remove.emit();
|
341
447
|
}
|
342
448
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
343
|
-
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 }); }
|
449
|
+
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 }); }
|
344
450
|
}
|
345
451
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisChipComponent, decorators: [{
|
346
452
|
type: Component,
|
@@ -415,7 +521,7 @@ class SuisInputTextComponent extends SuisInputBase {
|
|
415
521
|
multi: true,
|
416
522
|
useExisting: forwardRef(() => SuisInputTextComponent),
|
417
523
|
},
|
418
|
-
], 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;
|
524
|
+
], usesInheritance: true, ngImport: i0, template: "<input\n class=\"suis-input-text\"\n [class.suis-input-text--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-text{width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;min-height:2rem}.suis-input-text:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input-text--invalid{box-shadow:0 2px 5px #ff4757bf}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
419
525
|
}
|
420
526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisInputTextComponent, decorators: [{
|
421
527
|
type: Component,
|
@@ -425,7 +531,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
425
531
|
multi: true,
|
426
532
|
useExisting: forwardRef(() => SuisInputTextComponent),
|
427
533
|
},
|
428
|
-
], 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;
|
534
|
+
], template: "<input\n class=\"suis-input-text\"\n [class.suis-input-text--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-text{width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;min-height:2rem}.suis-input-text:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input-text--invalid{box-shadow:0 2px 5px #ff4757bf}\n"] }]
|
429
535
|
}], propDecorators: { type: [{
|
430
536
|
type: Input
|
431
537
|
}], placeholder: [{
|
@@ -516,6 +622,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
516
622
|
args: ['document:click', ['$event']]
|
517
623
|
}] } });
|
518
624
|
|
625
|
+
class SuisInputNumberComponent extends SuisInputBase {
|
626
|
+
constructor() {
|
627
|
+
super(...arguments);
|
628
|
+
/**
|
629
|
+
* Placeholder text displayed in input. By default set to empty string.
|
630
|
+
*/
|
631
|
+
this.placeholder = '';
|
632
|
+
/** @internal */
|
633
|
+
this.value = null;
|
634
|
+
}
|
635
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
636
|
+
writeValue(obj) {
|
637
|
+
this.value = obj;
|
638
|
+
this._onChange(this.value);
|
639
|
+
this.cdRef.markForCheck();
|
640
|
+
}
|
641
|
+
onChange(event) {
|
642
|
+
const target = event.target;
|
643
|
+
this.value = target.value ? Number(target.value) : null;
|
644
|
+
this._onChange(this.value);
|
645
|
+
this.changed.emit(this.value);
|
646
|
+
this.cdRef.markForCheck();
|
647
|
+
}
|
648
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisInputNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
649
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisInputNumberComponent, isStandalone: true, selector: "suis-input-number", inputs: { placeholder: "placeholder" }, providers: [
|
650
|
+
{
|
651
|
+
provide: NG_VALUE_ACCESSOR,
|
652
|
+
multi: true,
|
653
|
+
useExisting: forwardRef(() => SuisInputNumberComponent),
|
654
|
+
},
|
655
|
+
], usesInheritance: true, ngImport: i0, template: "<input\n class=\"suis-input-number\"\n [class.suis-input-number--invalid]=\"invalid\"\n type=\"number\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input-number{width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;min-height:2rem;-moz-appearance:textfield}.suis-input-number:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input-number--invalid{box-shadow:0 2px 5px #ff4757bf}.suis-input-number::-webkit-outer-spin-button,.suis-input-number::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
656
|
+
}
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisInputNumberComponent, decorators: [{
|
658
|
+
type: Component,
|
659
|
+
args: [{ selector: 'suis-input-number', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
660
|
+
{
|
661
|
+
provide: NG_VALUE_ACCESSOR,
|
662
|
+
multi: true,
|
663
|
+
useExisting: forwardRef(() => SuisInputNumberComponent),
|
664
|
+
},
|
665
|
+
], template: "<input\n class=\"suis-input-number\"\n [class.suis-input-number--invalid]=\"invalid\"\n type=\"number\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"readonly\"\n (input)=\"onChange($event)\"\n (focus)=\"onTouch()\"\n/>\n", styles: ["*{margin:0;padding:0;box-sizing:border-box}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.suis-input-number{width:100%;background-color:#fff;box-shadow:0 2px 5px #00000080;border-radius:.25rem;padding:.5rem 1rem;border:0;min-height:2rem;-moz-appearance:textfield}.suis-input-number:focus{box-shadow:0 2px 5px #192a56bf;outline:none}.suis-input-number--invalid{box-shadow:0 2px 5px #ff4757bf}.suis-input-number::-webkit-outer-spin-button,.suis-input-number::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}\n"] }]
|
666
|
+
}], propDecorators: { placeholder: [{
|
667
|
+
type: Input
|
668
|
+
}] } });
|
669
|
+
|
519
670
|
class SuisLabelComponent {
|
520
671
|
constructor() {
|
521
672
|
/**
|
@@ -539,6 +690,168 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
539
690
|
type: Input
|
540
691
|
}] } });
|
541
692
|
|
693
|
+
class SuisSelectLabelPipe {
|
694
|
+
transform(value, options, placeholder) {
|
695
|
+
if (!value)
|
696
|
+
return placeholder;
|
697
|
+
const selectedOption = options.find((option) => JSON.stringify(option.value) === JSON.stringify(value));
|
698
|
+
if (!selectedOption)
|
699
|
+
throw Error('[SuisSelectLabelPipe] Provided value does not belong to valid values');
|
700
|
+
return selectedOption.label;
|
701
|
+
}
|
702
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
703
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, isStandalone: true, name: "suisSelectLabel" }); }
|
704
|
+
}
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectLabelPipe, decorators: [{
|
706
|
+
type: Pipe,
|
707
|
+
args: [{
|
708
|
+
standalone: true,
|
709
|
+
name: 'suisSelectLabel',
|
710
|
+
}]
|
711
|
+
}] });
|
712
|
+
|
713
|
+
class SuisSelectIsSelectedPipe {
|
714
|
+
transform(optionValue, value) {
|
715
|
+
return JSON.stringify(optionValue) === JSON.stringify(value);
|
716
|
+
}
|
717
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
718
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, isStandalone: true, name: "suisSelectIsSelected" }); }
|
719
|
+
}
|
720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectIsSelectedPipe, decorators: [{
|
721
|
+
type: Pipe,
|
722
|
+
args: [{
|
723
|
+
standalone: true,
|
724
|
+
name: 'suisSelectIsSelected',
|
725
|
+
}]
|
726
|
+
}] });
|
727
|
+
|
728
|
+
class SuisSelectOptionComponent {
|
729
|
+
constructor() {
|
730
|
+
/** @internal */
|
731
|
+
this.SuisIconType = SuisIconType;
|
732
|
+
/**
|
733
|
+
* Adds checkmark icon to checkbox (if checkbox input set to true). By default set to false.
|
734
|
+
*/
|
735
|
+
this.selected = false;
|
736
|
+
/**
|
737
|
+
* Display checkbox next to option label. By default set to true.
|
738
|
+
*/
|
739
|
+
this.checkbox = true;
|
740
|
+
/**
|
741
|
+
* Emits on option selected.
|
742
|
+
*/
|
743
|
+
this.clicked = new EventEmitter();
|
744
|
+
}
|
745
|
+
/** @internal */
|
746
|
+
onClick() {
|
747
|
+
this.clicked.emit();
|
748
|
+
}
|
749
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
750
|
+
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", checkbox: "checkbox" }, 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 *ngIf=\"checkbox\"\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 }); }
|
751
|
+
}
|
752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectOptionComponent, decorators: [{
|
753
|
+
type: Component,
|
754
|
+
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 *ngIf=\"checkbox\"\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"] }]
|
755
|
+
}], propDecorators: { option: [{
|
756
|
+
type: Input,
|
757
|
+
args: [{ required: true }]
|
758
|
+
}], templateRef: [{
|
759
|
+
type: Input
|
760
|
+
}], selected: [{
|
761
|
+
type: Input
|
762
|
+
}], checkbox: [{
|
763
|
+
type: Input
|
764
|
+
}], clicked: [{
|
765
|
+
type: Output
|
766
|
+
}] } });
|
767
|
+
|
768
|
+
class SuisSelectSortOptionsPipe {
|
769
|
+
transform(options) {
|
770
|
+
return options.sort((a, b) => a.label.localeCompare(b.label));
|
771
|
+
}
|
772
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
773
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, isStandalone: true, name: "suisSelectSortOptions" }); }
|
774
|
+
}
|
775
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectSortOptionsPipe, decorators: [{
|
776
|
+
type: Pipe,
|
777
|
+
args: [{
|
778
|
+
standalone: true,
|
779
|
+
name: 'suisSelectSortOptions',
|
780
|
+
}]
|
781
|
+
}] });
|
782
|
+
|
783
|
+
class SuisSelectFilterOptionsPipe {
|
784
|
+
transform(options, phrase) {
|
785
|
+
if (!phrase)
|
786
|
+
return options;
|
787
|
+
return options.filter((option) => option.label.toLocaleLowerCase().includes(phrase.toLocaleLowerCase()));
|
788
|
+
}
|
789
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
790
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, isStandalone: true, name: "suisSelectFilterOptions" }); }
|
791
|
+
}
|
792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectFilterOptionsPipe, decorators: [{
|
793
|
+
type: Pipe,
|
794
|
+
args: [{
|
795
|
+
standalone: true,
|
796
|
+
name: 'suisSelectFilterOptions',
|
797
|
+
}]
|
798
|
+
}] });
|
799
|
+
|
800
|
+
class SuisSelectComponent extends SuisSelectBase {
|
801
|
+
constructor() {
|
802
|
+
super(...arguments);
|
803
|
+
/** @internal */
|
804
|
+
this.value = null;
|
805
|
+
}
|
806
|
+
writeValue(obj) {
|
807
|
+
this.value = obj;
|
808
|
+
this._onChange(this.value);
|
809
|
+
this.cdRef.markForCheck();
|
810
|
+
}
|
811
|
+
onSelect(value) {
|
812
|
+
if (JSON.stringify(this.value) === JSON.stringify(value))
|
813
|
+
return this.clearValue();
|
814
|
+
this.setValue(value);
|
815
|
+
}
|
816
|
+
clearValue() {
|
817
|
+
this.setValue(null);
|
818
|
+
}
|
819
|
+
setValue(value) {
|
820
|
+
this.value = value;
|
821
|
+
this.toggle(false);
|
822
|
+
this._onChange(this.value);
|
823
|
+
this.changed.emit();
|
824
|
+
this.cdRef.markForCheck();
|
825
|
+
}
|
826
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
827
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: SuisSelectComponent, isStandalone: true, selector: "suis-select", providers: [
|
828
|
+
{
|
829
|
+
provide: NG_VALUE_ACCESSOR,
|
830
|
+
multi: true,
|
831
|
+
useExisting: forwardRef(() => SuisSelectComponent),
|
832
|
+
},
|
833
|
+
], 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 (ngModelChange)=\"onSearchPhraseChange($event)\"\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", "checkbox"], 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 }); }
|
834
|
+
}
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: SuisSelectComponent, decorators: [{
|
836
|
+
type: Component,
|
837
|
+
args: [{ selector: 'suis-select', standalone: true, imports: [
|
838
|
+
CommonModule,
|
839
|
+
FormsModule,
|
840
|
+
SuisIconComponent,
|
841
|
+
SuisSelectOptionComponent,
|
842
|
+
SuisSelectLabelPipe,
|
843
|
+
SuisSelectIsSelectedPipe,
|
844
|
+
SuisSelectSortOptionsPipe,
|
845
|
+
SuisSelectFilterOptionsPipe,
|
846
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
847
|
+
{
|
848
|
+
provide: NG_VALUE_ACCESSOR,
|
849
|
+
multi: true,
|
850
|
+
useExisting: forwardRef(() => SuisSelectComponent),
|
851
|
+
},
|
852
|
+
], 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 (ngModelChange)=\"onSearchPhraseChange($event)\"\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"] }]
|
853
|
+
}] });
|
854
|
+
|
542
855
|
class SuisSpinnerComponent {
|
543
856
|
constructor() {
|
544
857
|
/**
|
@@ -601,5 +914,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
601
914
|
* Generated bundle index. Do not edit.
|
602
915
|
*/
|
603
916
|
|
604
|
-
export { SuisAlertComponent, SuisAnchorButtonComponent, SuisBoxComponent, SuisButtonComponent, SuisButtonOutlinedComponent, SuisChipComponent, SuisFormFieldComponent, SuisIconComponent, SuisIconType, SuisInputChipsComponent, SuisInputTextComponent, SuisLabelComponent, SuisNgClassPipe, SuisSpinnerComponent, SuisSpinnerContainerComponent };
|
917
|
+
export { SuisAlertComponent, SuisAnchorButtonComponent, SuisBoxComponent, SuisButtonComponent, SuisButtonOutlinedComponent, SuisChipComponent, SuisFormFieldComponent, SuisIconComponent, SuisIconType, SuisInputChipsComponent, SuisInputNumberComponent, SuisInputTextComponent, SuisLabelComponent, SuisNgClassPipe, SuisSelectComponent, SuisSelectOptionComponent, SuisSelectOptionDirective, SuisSpinnerComponent, SuisSpinnerContainerComponent };
|
605
918
|
//# sourceMappingURL=suis.mjs.map
|