@sarasanalytics-com/design-system 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/interfaces/avatar-interface.mjs +2 -0
- package/esm2022/interfaces/button-interface.mjs +2 -0
- package/esm2022/interfaces/chip-interface.mjs +2 -0
- package/esm2022/interfaces/grid-interface.mjs +2 -0
- package/esm2022/interfaces/select-interface.mjs +2 -0
- package/esm2022/interfaces/tab-interface.mjs +2 -0
- package/esm2022/lib/avatar/avatar.component.mjs +56 -0
- package/esm2022/lib/button/button.component.mjs +84 -0
- package/esm2022/lib/calendar-header/calendar-header.component.mjs +168 -0
- package/esm2022/lib/card/card-footer-actions/card-footer-actions.component.mjs +11 -0
- package/esm2022/lib/card/card-icon/card-icon.component.mjs +11 -0
- package/esm2022/lib/card/card-title-actions/card-title-actions.component.mjs +11 -0
- package/esm2022/lib/card/card.component.mjs +53 -0
- package/esm2022/lib/chips/chips.component.mjs +62 -0
- package/esm2022/lib/component-library.component.mjs +19 -0
- package/esm2022/lib/component-library.service.mjs +14 -0
- package/esm2022/lib/datepicker/datepicker.component.mjs +40 -0
- package/esm2022/lib/form-input/form-input.component.mjs +152 -0
- package/esm2022/lib/form-select/form-select.component.mjs +59 -0
- package/esm2022/lib/grid-cell/grid-cell.component.mjs +84 -0
- package/esm2022/lib/header/header.component.mjs +37 -0
- package/esm2022/lib/icon/icon.component.mjs +50 -0
- package/esm2022/lib/icon/icon.service.mjs +29 -0
- package/esm2022/lib/left-nav/left-nav.component.mjs +117 -0
- package/esm2022/lib/stepper/stepper.component.mjs +64 -0
- package/esm2022/lib/tabs/tabs.component.mjs +38 -0
- package/esm2022/lib/toast/toast.component.mjs +100 -0
- package/esm2022/lib/tool-tip/tool-tip.component.mjs +41 -0
- package/esm2022/public-api.mjs +30 -0
- package/esm2022/sarasanalytics-com-design-system.mjs +5 -0
- package/esm2022/utils/validators.mjs +70 -0
- package/fesm2022/sarasanalytics-com-design-system.mjs +1274 -0
- package/fesm2022/sarasanalytics-com-design-system.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/interfaces/avatar-interface.d.ts +6 -0
- package/interfaces/button-interface.d.ts +12 -0
- package/interfaces/chip-interface.d.ts +11 -0
- package/interfaces/grid-interface.d.ts +24 -0
- package/interfaces/select-interface.d.ts +20 -0
- package/interfaces/tab-interface.d.ts +6 -0
- package/lib/avatar/avatar.component.d.ts +18 -0
- package/lib/button/button.component.d.ts +26 -0
- package/lib/calendar-header/calendar-header.component.d.ts +31 -0
- package/lib/card/card-footer-actions/card-footer-actions.component.d.ts +5 -0
- package/lib/card/card-icon/card-icon.component.d.ts +5 -0
- package/lib/card/card-title-actions/card-title-actions.component.d.ts +5 -0
- package/lib/card/card.component.d.ts +17 -0
- package/lib/chips/chips.component.d.ts +22 -0
- package/lib/component-library.component.d.ts +5 -0
- package/lib/component-library.service.d.ts +6 -0
- package/lib/datepicker/datepicker.component.d.ts +9 -0
- package/lib/form-input/form-input.component.d.ts +62 -0
- package/lib/form-select/form-select.component.d.ts +17 -0
- package/lib/grid-cell/grid-cell.component.d.ts +20 -0
- package/lib/header/header.component.d.ts +14 -0
- package/lib/icon/icon.component.d.ts +16 -0
- package/lib/icon/icon.service.d.ts +11 -0
- package/lib/left-nav/left-nav.component.d.ts +38 -0
- package/lib/stepper/stepper.component.d.ts +17 -0
- package/lib/tabs/tabs.component.d.ts +15 -0
- package/lib/toast/toast.component.d.ts +33 -0
- package/lib/tool-tip/tool-tip.component.d.ts +15 -0
- package/package.json +15 -2
- package/{src/public-api.ts → public-api.d.ts} +1 -8
- package/utils/validators.d.ts +3 -0
- package/ng-package.json +0 -8
- package/src/interfaces/avatar-interface.ts +0 -6
- package/src/interfaces/button-interface.ts +0 -12
- package/src/interfaces/chip-interface.ts +0 -11
- package/src/interfaces/grid-interface.ts +0 -24
- package/src/interfaces/select-interface.ts +0 -20
- package/src/interfaces/tab-interface.ts +0 -6
- package/src/lib/avatar/avatar.component.css +0 -48
- package/src/lib/avatar/avatar.component.html +0 -5
- package/src/lib/avatar/avatar.component.spec.ts +0 -23
- package/src/lib/avatar/avatar.component.ts +0 -50
- package/src/lib/button/button.component.css +0 -145
- package/src/lib/button/button.component.html +0 -11
- package/src/lib/button/button.component.spec.ts +0 -23
- package/src/lib/button/button.component.ts +0 -68
- package/src/lib/calendar-header/calendar-header.component.css +0 -67
- package/src/lib/calendar-header/calendar-header.component.html +0 -20
- package/src/lib/calendar-header/calendar-header.component.spec.ts +0 -23
- package/src/lib/calendar-header/calendar-header.component.ts +0 -191
- package/src/lib/card/card-body/card-body.component.css +0 -0
- package/src/lib/card/card-body/card-body.component.html +0 -1
- package/src/lib/card/card-body/card-body.component.spec.ts +0 -23
- package/src/lib/card/card-body/card-body.component.ts +0 -12
- package/src/lib/card/card-footer-actions/card-footer-actions.component.css +0 -4
- package/src/lib/card/card-footer-actions/card-footer-actions.component.html +0 -3
- package/src/lib/card/card-footer-actions/card-footer-actions.component.spec.ts +0 -23
- package/src/lib/card/card-footer-actions/card-footer-actions.component.ts +0 -12
- package/src/lib/card/card-icon/card-icon.component.css +0 -0
- package/src/lib/card/card-icon/card-icon.component.html +0 -1
- package/src/lib/card/card-icon/card-icon.component.spec.ts +0 -23
- package/src/lib/card/card-icon/card-icon.component.ts +0 -12
- package/src/lib/card/card-title-actions/card-title-actions.component.css +0 -3
- package/src/lib/card/card-title-actions/card-title-actions.component.html +0 -1
- package/src/lib/card/card-title-actions/card-title-actions.component.spec.ts +0 -23
- package/src/lib/card/card-title-actions/card-title-actions.component.ts +0 -12
- package/src/lib/card/card.component.css +0 -84
- package/src/lib/card/card.component.html +0 -34
- package/src/lib/card/card.component.spec.ts +0 -23
- package/src/lib/card/card.component.ts +0 -33
- package/src/lib/chips/chips.component.css +0 -129
- package/src/lib/chips/chips.component.html +0 -17
- package/src/lib/chips/chips.component.spec.ts +0 -23
- package/src/lib/chips/chips.component.ts +0 -54
- package/src/lib/component-library.component.spec.ts +0 -23
- package/src/lib/component-library.component.ts +0 -16
- package/src/lib/component-library.service.spec.ts +0 -16
- package/src/lib/component-library.service.ts +0 -9
- package/src/lib/datepicker/datepicker.component.css +0 -33
- package/src/lib/datepicker/datepicker.component.html +0 -11
- package/src/lib/datepicker/datepicker.component.spec.ts +0 -23
- package/src/lib/datepicker/datepicker.component.ts +0 -36
- package/src/lib/form-input/form-input.component.css +0 -109
- package/src/lib/form-input/form-input.component.html +0 -27
- package/src/lib/form-input/form-input.component.spec.ts +0 -23
- package/src/lib/form-input/form-input.component.ts +0 -196
- package/src/lib/form-select/form-select.component.css +0 -157
- package/src/lib/form-select/form-select.component.html +0 -38
- package/src/lib/form-select/form-select.component.spec.ts +0 -23
- package/src/lib/form-select/form-select.component.ts +0 -54
- package/src/lib/grid-cell/grid-cell.component.css +0 -78
- package/src/lib/grid-cell/grid-cell.component.html +0 -31
- package/src/lib/grid-cell/grid-cell.component.spec.ts +0 -23
- package/src/lib/grid-cell/grid-cell.component.ts +0 -89
- package/src/lib/header/header.component.css +0 -62
- package/src/lib/header/header.component.html +0 -23
- package/src/lib/header/header.component.spec.ts +0 -23
- package/src/lib/header/header.component.ts +0 -28
- package/src/lib/icon/icon.component.css +0 -21
- package/src/lib/icon/icon.component.html +0 -5
- package/src/lib/icon/icon.component.ts +0 -49
- package/src/lib/icon/icon.service.ts +0 -27
- package/src/lib/left-nav/left-nav.component.css +0 -106
- package/src/lib/left-nav/left-nav.component.html +0 -48
- package/src/lib/left-nav/left-nav.component.spec.ts +0 -23
- package/src/lib/left-nav/left-nav.component.ts +0 -146
- package/src/lib/stepper/stepper.component.css +0 -96
- package/src/lib/stepper/stepper.component.html +0 -14
- package/src/lib/stepper/stepper.component.spec.ts +0 -23
- package/src/lib/stepper/stepper.component.ts +0 -61
- package/src/lib/tabs/tabs.component.css +0 -100
- package/src/lib/tabs/tabs.component.html +0 -16
- package/src/lib/tabs/tabs.component.spec.ts +0 -23
- package/src/lib/tabs/tabs.component.ts +0 -37
- package/src/lib/toast/toast.component.css +0 -107
- package/src/lib/toast/toast.component.html +0 -29
- package/src/lib/toast/toast.component.spec.ts +0 -23
- package/src/lib/toast/toast.component.ts +0 -87
- package/src/lib/tool-tip/tool-tip.component.css +0 -139
- package/src/lib/tool-tip/tool-tip.component.html +0 -31
- package/src/lib/tool-tip/tool-tip.component.spec.ts +0 -23
- package/src/lib/tool-tip/tool-tip.component.ts +0 -37
- package/src/utils/validators.ts +0 -68
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,1274 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, EventEmitter, Input, Output, inject, ViewEncapsulation, Inject, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
4
|
+
import { NgIf, NgStyle, CommonModule, NgFor } from '@angular/common';
|
|
5
|
+
import * as i3$2 from '@angular/material/icon';
|
|
6
|
+
import { MatIcon, MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i1 from '@angular/platform-browser';
|
|
8
|
+
import * as i3 from '@angular/forms';
|
|
9
|
+
import { ReactiveFormsModule, Validators, FormsModule } from '@angular/forms';
|
|
10
|
+
import * as i2 from '@ngx-formly/core';
|
|
11
|
+
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
12
|
+
import * as i3$1 from '@ng-select/ng-select';
|
|
13
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
14
|
+
import * as i2$1 from '@angular/material/datepicker';
|
|
15
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import * as i1$2 from '@angular/material/form-field';
|
|
18
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
19
|
+
import * as i2$2 from '@angular/material/core';
|
|
20
|
+
import { MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';
|
|
21
|
+
import { Subject } from 'rxjs';
|
|
22
|
+
import { takeUntil } from 'rxjs/operators';
|
|
23
|
+
import { MatButton } from '@angular/material/button';
|
|
24
|
+
import * as i1$3 from '@angular/router';
|
|
25
|
+
|
|
26
|
+
class TestLibraryService {
|
|
27
|
+
constructor() { }
|
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TestLibraryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
29
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TestLibraryService, providedIn: 'root' }); }
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TestLibraryService, decorators: [{
|
|
32
|
+
type: Injectable,
|
|
33
|
+
args: [{
|
|
34
|
+
providedIn: 'root'
|
|
35
|
+
}]
|
|
36
|
+
}], ctorParameters: () => [] });
|
|
37
|
+
|
|
38
|
+
class TestLibraryComponent {
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TestLibraryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: TestLibraryComponent, isStandalone: true, selector: "lib-component-library", ngImport: i0, template: `
|
|
41
|
+
<p>
|
|
42
|
+
component-library works!
|
|
43
|
+
</p>
|
|
44
|
+
`, isInline: true, styles: [""] }); }
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TestLibraryComponent, decorators: [{
|
|
47
|
+
type: Component,
|
|
48
|
+
args: [{ selector: 'lib-component-library', standalone: true, imports: [], template: `
|
|
49
|
+
<p>
|
|
50
|
+
component-library works!
|
|
51
|
+
</p>
|
|
52
|
+
` }]
|
|
53
|
+
}] });
|
|
54
|
+
|
|
55
|
+
let nextId$4 = 0; // used to give unique ids to inputs used in html
|
|
56
|
+
class ButtonComponent {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.isSubmit = false;
|
|
59
|
+
this.onClickEvent = new EventEmitter();
|
|
60
|
+
this.onMouseInEvent = new EventEmitter();
|
|
61
|
+
this.onMouseOutEvent = new EventEmitter();
|
|
62
|
+
this.svgStyle = {};
|
|
63
|
+
this.eventEmitObject = {};
|
|
64
|
+
this.uuid = nextId$4++;
|
|
65
|
+
}
|
|
66
|
+
ngOnChanges() {
|
|
67
|
+
this.svgStyle = {
|
|
68
|
+
'-webkit-mask-image': `url(${this.ImagePath})`,
|
|
69
|
+
'mask-image': `url(${this.ImagePath})`,
|
|
70
|
+
};
|
|
71
|
+
this.eventEmitObject = {
|
|
72
|
+
id: this.id
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
buttonClicked(evt) {
|
|
76
|
+
if (this.state == "disabled")
|
|
77
|
+
return;
|
|
78
|
+
this.onClickEvent.emit({
|
|
79
|
+
...this.eventEmitObject,
|
|
80
|
+
evt
|
|
81
|
+
});
|
|
82
|
+
if (this.href != "") {
|
|
83
|
+
if (this.hrefTarget == "blank")
|
|
84
|
+
window.open(this.href);
|
|
85
|
+
else if (this.hrefTarget == "self")
|
|
86
|
+
location.href = this.href;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
mouseIn() {
|
|
90
|
+
if (this.state == "disabled")
|
|
91
|
+
return;
|
|
92
|
+
this.onMouseInEvent.emit();
|
|
93
|
+
}
|
|
94
|
+
mouseOut() {
|
|
95
|
+
if (this.state == "disabled")
|
|
96
|
+
return;
|
|
97
|
+
this.onMouseOutEvent.emit();
|
|
98
|
+
}
|
|
99
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: ButtonComponent, isStandalone: true, selector: "sa-button", inputs: { id: "id", type: "type", state: "state", size: "size", text: "text", ImagePath: "ImagePath", iconPosition: "iconPosition", href: "href", hrefTarget: "hrefTarget", isSubmit: "isSubmit" }, outputs: { onClickEvent: "onClickEvent", onMouseInEvent: "onMouseInEvent", onMouseOutEvent: "onMouseOutEvent" }, usesOnChanges: true, ngImport: i0, template: "<button (click)=\"buttonClicked($event)\" id=\"sa-button-{{uuid}}\" class=\"btn-hide\"\n [type]=\"isSubmit ? 'submit' : 'button'\"></button>\n<!-- (click)=\"buttonClicked()\" on button instead of label breaks whole thing -->\n<label for=\"sa-button-{{uuid}}\" role=\"button\" tabindex=\"0\" (mouseenter)=\"mouseIn()\" (mouseleave)=\"mouseOut()\"\n (keydown.enter)=\"buttonClicked($event)\" for=\"sa-button\" class=\"sa-button {{state}} {{type}} {{size}}\">\n <div class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"(iconPosition == 'left' || iconPosition == 'both') ? 'block' : 'none'\"></div>\n {{text}}\n <div class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"(iconPosition == 'right' || iconPosition == 'both') ? 'block' : 'none'\"></div>\n</label>\n", styles: [".primary{--default-bg: var(--primary-500);--default-color: var(--text-white);--default-border: transparent;--hover-bg: var(--primary-700);--hover-color: var(--text-white);--hover-border: transparent;--disabled-bg: var(--grey-100);--disabled-color: var(--text-white);--disabled-border: transparent;--error-default-bg: var(--semantic-error-500);--error-hover-bg: var(--semantic-error-600);--error-default-color: var(--text-white);--error-hover-color: var(--text-white);--error-default-border: var(--semantic-error-500);--error-hover-border: var(--semantic-error-500);--svg-icon-color: var(--default-color)}.outline{--default-bg: none;--default-color: var(--primary-500);--default-border: var(--primary-500);--hover-bg: var(--primary-50);--hover-color: var(--primary-700);--hover-border: var(--primary-700);--disabled-bg: none;--disabled-color: var(--grey-100);--disabled-border: var(--grey-100);--error-default-bg: none;--error-hover-bg: var(--semantic-error-50);--error-default-color: var(--semantic-error-500);--error-hover-color: var(--semantic-error-600);--error-default-border: var(--semantic-error-500);--error-hover-border: var(--semantic-error-600);--svg-icon-color: var(--default-color)}.transparent{--default-bg: none;--default-color: var(--primary-500);--default-border: transparent;--hover-bg: var(--primary-50);--hover-color: var(--primary-700);--hover-border: transparent;--disabled-bg: none;--disabled-color: var(--grey-100);--disabled-border: transparent;--error-default-bg: none;--error-hover-bg: var(--semantic-error-50);--error-default-color: var(--semantic-error-500);--error-hover-color: var(--semantic-error-600);--error-default-border: transparent;--error-hover-border: transparent;--svg-icon-color: var(--default-color)}.large{--sizing-1: var(--small-8px);--sizing-2: var(--small-16px);--sizing-3: var(--small-8px);--height: var(--medium-36px);--font-size: var(--small-14px)}.medium{--sizing-1: var(--small-6px);--sizing-2: var(--small-12px);--sizing-3: var(--small-8px);--height: var(--medium-32px);--font-size: var(--small-14px)}.small{--sizing-1: var(--small-4px);--sizing-2: var(--small-8px);--sizing-3: var(--small-8px);--height: var(--medium-24px);--font-size: var(--small-12px)}.disabled{background-color:var(--disabled-bg)!important;color:var(--disabled-color)!important;border:1px solid var(--disabled-border)!important;cursor:default!important;--svg-icon-color: var(--disabled-color) !important}.error{background-color:var(--error-default-bg)!important;color:var(--error-default-color)!important;border:1px solid var(--error-default-border)!important;--svg-icon-color: var(--error-default-color) !important}.error:hover{background-color:var(--error-hover-bg)!important;color:var(--error-hover-color)!important;--svg-icon-color: var(--error-hover-color) !important}.sa-button{display:flex;width:max-content;padding:var(--sizing-1) var(--sizing-2);justify-content:center;align-items:center;gap:var(--sizing-3);box-sizing:border-box;height:var(--height);border-radius:4px;font-family:var(--font);font-size:var(--font-size);cursor:pointer;background-color:var(--default-bg);border:1px solid var(--default-border);color:var(--default-color);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.sa-button:hover{background-color:var(--hover-bg);border:1px solid var(--hover-border);color:var(--hover-color);--svg-icon-color: var(--hover-color)}.svg-icon{-webkit-mask-size:contain;mask-size:contain;width:16px;height:16px;background-color:var(--svg-icon-color)}.btn-hide{display:none}\n"] }); }
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{ selector: 'sa-button', standalone: true, imports: [NgIf, NgStyle], template: "<button (click)=\"buttonClicked($event)\" id=\"sa-button-{{uuid}}\" class=\"btn-hide\"\n [type]=\"isSubmit ? 'submit' : 'button'\"></button>\n<!-- (click)=\"buttonClicked()\" on button instead of label breaks whole thing -->\n<label for=\"sa-button-{{uuid}}\" role=\"button\" tabindex=\"0\" (mouseenter)=\"mouseIn()\" (mouseleave)=\"mouseOut()\"\n (keydown.enter)=\"buttonClicked($event)\" for=\"sa-button\" class=\"sa-button {{state}} {{type}} {{size}}\">\n <div class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"(iconPosition == 'left' || iconPosition == 'both') ? 'block' : 'none'\"></div>\n {{text}}\n <div class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"(iconPosition == 'right' || iconPosition == 'both') ? 'block' : 'none'\"></div>\n</label>\n", styles: [".primary{--default-bg: var(--primary-500);--default-color: var(--text-white);--default-border: transparent;--hover-bg: var(--primary-700);--hover-color: var(--text-white);--hover-border: transparent;--disabled-bg: var(--grey-100);--disabled-color: var(--text-white);--disabled-border: transparent;--error-default-bg: var(--semantic-error-500);--error-hover-bg: var(--semantic-error-600);--error-default-color: var(--text-white);--error-hover-color: var(--text-white);--error-default-border: var(--semantic-error-500);--error-hover-border: var(--semantic-error-500);--svg-icon-color: var(--default-color)}.outline{--default-bg: none;--default-color: var(--primary-500);--default-border: var(--primary-500);--hover-bg: var(--primary-50);--hover-color: var(--primary-700);--hover-border: var(--primary-700);--disabled-bg: none;--disabled-color: var(--grey-100);--disabled-border: var(--grey-100);--error-default-bg: none;--error-hover-bg: var(--semantic-error-50);--error-default-color: var(--semantic-error-500);--error-hover-color: var(--semantic-error-600);--error-default-border: var(--semantic-error-500);--error-hover-border: var(--semantic-error-600);--svg-icon-color: var(--default-color)}.transparent{--default-bg: none;--default-color: var(--primary-500);--default-border: transparent;--hover-bg: var(--primary-50);--hover-color: var(--primary-700);--hover-border: transparent;--disabled-bg: none;--disabled-color: var(--grey-100);--disabled-border: transparent;--error-default-bg: none;--error-hover-bg: var(--semantic-error-50);--error-default-color: var(--semantic-error-500);--error-hover-color: var(--semantic-error-600);--error-default-border: transparent;--error-hover-border: transparent;--svg-icon-color: var(--default-color)}.large{--sizing-1: var(--small-8px);--sizing-2: var(--small-16px);--sizing-3: var(--small-8px);--height: var(--medium-36px);--font-size: var(--small-14px)}.medium{--sizing-1: var(--small-6px);--sizing-2: var(--small-12px);--sizing-3: var(--small-8px);--height: var(--medium-32px);--font-size: var(--small-14px)}.small{--sizing-1: var(--small-4px);--sizing-2: var(--small-8px);--sizing-3: var(--small-8px);--height: var(--medium-24px);--font-size: var(--small-12px)}.disabled{background-color:var(--disabled-bg)!important;color:var(--disabled-color)!important;border:1px solid var(--disabled-border)!important;cursor:default!important;--svg-icon-color: var(--disabled-color) !important}.error{background-color:var(--error-default-bg)!important;color:var(--error-default-color)!important;border:1px solid var(--error-default-border)!important;--svg-icon-color: var(--error-default-color) !important}.error:hover{background-color:var(--error-hover-bg)!important;color:var(--error-hover-color)!important;--svg-icon-color: var(--error-hover-color) !important}.sa-button{display:flex;width:max-content;padding:var(--sizing-1) var(--sizing-2);justify-content:center;align-items:center;gap:var(--sizing-3);box-sizing:border-box;height:var(--height);border-radius:4px;font-family:var(--font);font-size:var(--font-size);cursor:pointer;background-color:var(--default-bg);border:1px solid var(--default-border);color:var(--default-color);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.sa-button:hover{background-color:var(--hover-bg);border:1px solid var(--hover-border);color:var(--hover-color);--svg-icon-color: var(--hover-color)}.svg-icon{-webkit-mask-size:contain;mask-size:contain;width:16px;height:16px;background-color:var(--svg-icon-color)}.btn-hide{display:none}\n"] }]
|
|
105
|
+
}], propDecorators: { id: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], type: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], state: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], size: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], text: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], ImagePath: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}], iconPosition: [{
|
|
118
|
+
type: Input
|
|
119
|
+
}], href: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}], hrefTarget: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}], isSubmit: [{
|
|
124
|
+
type: Input
|
|
125
|
+
}], onClickEvent: [{
|
|
126
|
+
type: Output
|
|
127
|
+
}], onMouseInEvent: [{
|
|
128
|
+
type: Output
|
|
129
|
+
}], onMouseOutEvent: [{
|
|
130
|
+
type: Output
|
|
131
|
+
}] } });
|
|
132
|
+
|
|
133
|
+
let nextId$3 = 0; // used to give unique ids to inputs used in html
|
|
134
|
+
class ChipsComponent {
|
|
135
|
+
constructor() {
|
|
136
|
+
this.onClickEvent = new EventEmitter();
|
|
137
|
+
this.svgStyle = {};
|
|
138
|
+
this.secondSvgStyle = {};
|
|
139
|
+
this.eventEmitObject = {};
|
|
140
|
+
this.uuid = nextId$3++;
|
|
141
|
+
}
|
|
142
|
+
ngOnChanges() {
|
|
143
|
+
this.svgStyle = {
|
|
144
|
+
'-webkit-mask-image': `url(${this.iconPath})`,
|
|
145
|
+
'mask-image': `url(${this.iconPath})`,
|
|
146
|
+
};
|
|
147
|
+
this.secondSvgStyle = {
|
|
148
|
+
'-webkit-mask-image': `url(${this.largeStateIcon})`,
|
|
149
|
+
'mask-image': `url(${this.largeStateIcon})`,
|
|
150
|
+
};
|
|
151
|
+
this.eventEmitObject = {
|
|
152
|
+
id: this.id
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
buttonClicked(evt) {
|
|
156
|
+
this.onClickEvent.emit({
|
|
157
|
+
...this.eventEmitObject,
|
|
158
|
+
evt
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: ChipsComponent, isStandalone: true, selector: "sa-chip", inputs: { id: "id", iconPath: "iconPath", text: "text", type: "type", state: "state", filling: "filling", iconPosition: "iconPosition", largeStateIcon: "largeStateIcon", largeStateText: "largeStateText" }, outputs: { onClickEvent: "onClickEvent" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"chip {{type}} {{state}} {{filling}}\">\n <button type=\"button\" (click)=\"buttonClicked($event)\" id=\"icon-button_{{uuid}}\" class=\"btn_hide\"></button>\n <!-- (click)=\"buttonClicked()\" on button instead of label breaks whole thing -->\n <label for=\"icon-button_{{uuid}}\" class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"((iconPosition == 'left' || iconPosition == 'both') && type != 'large') ? 'block' : 'none'\">\n </label>\n\n {{text}}\n\n <div class=\"second-svg-icon\" [style]=\"secondSvgStyle\" [style.display]=\"(type == 'large') ? 'block' : 'none'\"></div>\n\n {{type == 'large' ? largeStateText : \"\"}}\n\n <label for=\"icon-button_{{uuid}}\" class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"((iconPosition == 'right' || iconPosition == 'both') && type != 'large') ? 'block' : 'none'\">\n </label>\n</div>\n", styles: [".regular{--chip-height: var(--medium-24px);--chip-padding: var(--small-4px) var(--small-8px);--chip-gap: var(--small-4px);--border-radius: var(--small-16px);--font-weight: 500;--line-height: 16px;--font-size: 12px }.small{--chip-height: var(--small-18px);--chip-padding: var(--small-4px) var(--small-8px);--chip-gap: var(--small-4px);--border-radius: var(--small-4px);--font-weight: 500;--line-height: 16px;--font-size: 11px }.large{--chip-height: 40px;--chip-padding: var(--small-12px) var(--medium-24px) var(--small-12px) var(--small-16px);--chip-gap: var(--small-8px);--border-radius: var(--small-16px) 0px;--font-weight: 600;--line-height: 20px;--font-size: 14px;background-color:var(--light-color)!important;color:var(--dark-color)!important;border:1px solid transparent!important}.primary{--light-color: var(--primary-50);--dark-color: var(--primary-500)}.secondary{--light-color: var(--secondary-50);--dark-color: var(--secondary-500)}.neutral{--light-color: var(--grey-50);--dark-color: var(--text-mediumemphasis)}.success{--light-color: var(--semantic-success-50);--dark-color: var(--semantic-success-500)}.error{--light-color: var(--semantic-error-50);--dark-color: var(--semantic-error-500)}.warning{--light-color: var(--semantic-yellow-50);--dark-color: var(--semantic-yellow-500)}.filled{--background-color: var(--light-color);--color: var(--dark-color);--border: 1px solid transparent}.outline{--background-color: none;--color: var(--dark-color);--border: 1px solid var(--dark-color)}.chip{display:flex;width:max-content;height:var(--chip-height);padding:var(--chip-padding);justify-content:center;align-items:center;gap:var(--chip-gap);flex-shrink:0;letter-spacing:.5px;box-sizing:border-box;font-family:var(--font);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height);background-color:var(--background-color);color:var(--color);border-radius:var(--border-radius);border:var(--border);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.svg-icon{width:16px;height:16px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--dark-color);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.svg-icon:hover{cursor:pointer}.second-svg-icon{width:18px;height:18px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--dark-color);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.btn_hide{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
163
|
+
}
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ChipsComponent, decorators: [{
|
|
165
|
+
type: Component,
|
|
166
|
+
args: [{ selector: 'sa-chip', standalone: true, imports: [CommonModule], template: "<div class=\"chip {{type}} {{state}} {{filling}}\">\n <button type=\"button\" (click)=\"buttonClicked($event)\" id=\"icon-button_{{uuid}}\" class=\"btn_hide\"></button>\n <!-- (click)=\"buttonClicked()\" on button instead of label breaks whole thing -->\n <label for=\"icon-button_{{uuid}}\" class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"((iconPosition == 'left' || iconPosition == 'both') && type != 'large') ? 'block' : 'none'\">\n </label>\n\n {{text}}\n\n <div class=\"second-svg-icon\" [style]=\"secondSvgStyle\" [style.display]=\"(type == 'large') ? 'block' : 'none'\"></div>\n\n {{type == 'large' ? largeStateText : \"\"}}\n\n <label for=\"icon-button_{{uuid}}\" class=\"svg-icon\" [style]=\"svgStyle\"\n [style.display]=\"((iconPosition == 'right' || iconPosition == 'both') && type != 'large') ? 'block' : 'none'\">\n </label>\n</div>\n", styles: [".regular{--chip-height: var(--medium-24px);--chip-padding: var(--small-4px) var(--small-8px);--chip-gap: var(--small-4px);--border-radius: var(--small-16px);--font-weight: 500;--line-height: 16px;--font-size: 12px }.small{--chip-height: var(--small-18px);--chip-padding: var(--small-4px) var(--small-8px);--chip-gap: var(--small-4px);--border-radius: var(--small-4px);--font-weight: 500;--line-height: 16px;--font-size: 11px }.large{--chip-height: 40px;--chip-padding: var(--small-12px) var(--medium-24px) var(--small-12px) var(--small-16px);--chip-gap: var(--small-8px);--border-radius: var(--small-16px) 0px;--font-weight: 600;--line-height: 20px;--font-size: 14px;background-color:var(--light-color)!important;color:var(--dark-color)!important;border:1px solid transparent!important}.primary{--light-color: var(--primary-50);--dark-color: var(--primary-500)}.secondary{--light-color: var(--secondary-50);--dark-color: var(--secondary-500)}.neutral{--light-color: var(--grey-50);--dark-color: var(--text-mediumemphasis)}.success{--light-color: var(--semantic-success-50);--dark-color: var(--semantic-success-500)}.error{--light-color: var(--semantic-error-50);--dark-color: var(--semantic-error-500)}.warning{--light-color: var(--semantic-yellow-50);--dark-color: var(--semantic-yellow-500)}.filled{--background-color: var(--light-color);--color: var(--dark-color);--border: 1px solid transparent}.outline{--background-color: none;--color: var(--dark-color);--border: 1px solid var(--dark-color)}.chip{display:flex;width:max-content;height:var(--chip-height);padding:var(--chip-padding);justify-content:center;align-items:center;gap:var(--chip-gap);flex-shrink:0;letter-spacing:.5px;box-sizing:border-box;font-family:var(--font);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height);background-color:var(--background-color);color:var(--color);border-radius:var(--border-radius);border:var(--border);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.svg-icon{width:16px;height:16px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--dark-color);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.svg-icon:hover{cursor:pointer}.second-svg-icon{width:18px;height:18px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--dark-color);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.btn_hide{display:none}\n"] }]
|
|
167
|
+
}], propDecorators: { id: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], iconPath: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}], text: [{
|
|
172
|
+
type: Input
|
|
173
|
+
}], type: [{
|
|
174
|
+
type: Input
|
|
175
|
+
}], state: [{
|
|
176
|
+
type: Input
|
|
177
|
+
}], filling: [{
|
|
178
|
+
type: Input
|
|
179
|
+
}], iconPosition: [{
|
|
180
|
+
type: Input
|
|
181
|
+
}], largeStateIcon: [{
|
|
182
|
+
type: Input
|
|
183
|
+
}], largeStateText: [{
|
|
184
|
+
type: Input
|
|
185
|
+
}], onClickEvent: [{
|
|
186
|
+
type: Output
|
|
187
|
+
}] } });
|
|
188
|
+
|
|
189
|
+
class AvatarComponent {
|
|
190
|
+
constructor() {
|
|
191
|
+
this.onClickEvent = new EventEmitter;
|
|
192
|
+
this.onMouseInEvent = new EventEmitter;
|
|
193
|
+
this.onMouseOutEvent = new EventEmitter;
|
|
194
|
+
this.eventEmitObject = {};
|
|
195
|
+
}
|
|
196
|
+
ngOnChanges() {
|
|
197
|
+
this.eventEmitObject = {
|
|
198
|
+
id: this.id
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
avatarClicked(evt) {
|
|
202
|
+
this.onClickEvent.emit({
|
|
203
|
+
...this.eventEmitObject,
|
|
204
|
+
evt
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
mouseEnter(evt) {
|
|
208
|
+
this.onMouseInEvent.emit({
|
|
209
|
+
...this.eventEmitObject,
|
|
210
|
+
evt
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
mouseLeave(evt) {
|
|
214
|
+
this.onMouseOutEvent.emit({
|
|
215
|
+
...this.eventEmitObject,
|
|
216
|
+
evt
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: AvatarComponent, isStandalone: true, selector: "sa-avatar", inputs: { id: "id", imagePath: "imagePath", altText: "altText", size: "size" }, outputs: { onClickEvent: "onClickEvent", onMouseInEvent: "onMouseInEvent", onMouseOutEvent: "onMouseOutEvent" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"avatar {{size}}\" (click)=\"avatarClicked($event)\" (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\">\n <img *ngIf=\"imagePath\" class=\"avatar-img\" alt=\"{{altText}}\" src=\"{{imagePath}}\">\n <p *ngIf=\"!imagePath\" class=\"avatar-img\">{{altText}}</p>\n</div>\n", styles: [".extra-small{--width: var(--medium-24px);--height: var(--medium-24px)}.small{--width: 28px;--height: 28px}.medium{--width: 32px;--height: 32px}.large{--width: 36px;--height: 36px}.extra-large{--width: 40px;--height: 40px}.avatar{display:flex}.avatar-img{background-color:var(--primary-50);height:var(--height);width:var(--width);border-radius:var(--height);object-fit:cover;font-family:var(--font);font-size:11px;font-weight:500;line-height:var(--height);letter-spacing:.5px;text-align:center;overflow:none}.avatar:hover{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
221
|
+
}
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
223
|
+
type: Component,
|
|
224
|
+
args: [{ selector: 'sa-avatar', standalone: true, imports: [NgIf], template: "<div class=\"avatar {{size}}\" (click)=\"avatarClicked($event)\" (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\">\n <img *ngIf=\"imagePath\" class=\"avatar-img\" alt=\"{{altText}}\" src=\"{{imagePath}}\">\n <p *ngIf=\"!imagePath\" class=\"avatar-img\">{{altText}}</p>\n</div>\n", styles: [".extra-small{--width: var(--medium-24px);--height: var(--medium-24px)}.small{--width: 28px;--height: 28px}.medium{--width: 32px;--height: 32px}.large{--width: 36px;--height: 36px}.extra-large{--width: 40px;--height: 40px}.avatar{display:flex}.avatar-img{background-color:var(--primary-50);height:var(--height);width:var(--width);border-radius:var(--height);object-fit:cover;font-family:var(--font);font-size:11px;font-weight:500;line-height:var(--height);letter-spacing:.5px;text-align:center;overflow:none}.avatar:hover{cursor:pointer}\n"] }]
|
|
225
|
+
}], propDecorators: { id: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], imagePath: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], altText: [{
|
|
230
|
+
type: Input
|
|
231
|
+
}], size: [{
|
|
232
|
+
type: Input
|
|
233
|
+
}], onClickEvent: [{
|
|
234
|
+
type: Output
|
|
235
|
+
}], onMouseInEvent: [{
|
|
236
|
+
type: Output
|
|
237
|
+
}], onMouseOutEvent: [{
|
|
238
|
+
type: Output
|
|
239
|
+
}] } });
|
|
240
|
+
|
|
241
|
+
class GridCellComponent {
|
|
242
|
+
constructor() {
|
|
243
|
+
this.onClickButtonEvent = new EventEmitter();
|
|
244
|
+
this.onClickChipEvent = new EventEmitter();
|
|
245
|
+
this.onClickLinkEvent = new EventEmitter();
|
|
246
|
+
this.onClickAvatarEvent = new EventEmitter();
|
|
247
|
+
}
|
|
248
|
+
buttonClicked(evt) {
|
|
249
|
+
this.params.buttonClicked && this.params.buttonClicked({
|
|
250
|
+
...evt,
|
|
251
|
+
rowId: this.rowNum
|
|
252
|
+
});
|
|
253
|
+
this.onClickButtonEvent.emit({ ...evt, rowId: this.rowNum }); // this event isn't caught by anything.
|
|
254
|
+
}
|
|
255
|
+
// above function behavior is same for all functions in this class
|
|
256
|
+
chipClicked(evt) {
|
|
257
|
+
this.params.chipClicked && this.params.chipClicked({
|
|
258
|
+
...evt,
|
|
259
|
+
rowId: this.rowNum
|
|
260
|
+
});
|
|
261
|
+
this.onClickChipEvent.emit({ ...evt, rowId: this.rowNum });
|
|
262
|
+
}
|
|
263
|
+
linkClicked() {
|
|
264
|
+
if (this.params.cellType != "interactive")
|
|
265
|
+
return;
|
|
266
|
+
this.params.linkClicked && this.params.linkClicked({
|
|
267
|
+
rowId: this.rowNum
|
|
268
|
+
});
|
|
269
|
+
if (this.params.interactiveLink != "") {
|
|
270
|
+
if (this.params.interactiveLinkTarget == "blank") {
|
|
271
|
+
window.open(this.params.interactiveLink);
|
|
272
|
+
}
|
|
273
|
+
else if (this.params.interactiveLinkTarget == "self") {
|
|
274
|
+
location.href = this.params.interactiveLink;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
this.onClickLinkEvent.emit({ rowId: this.rowNum });
|
|
278
|
+
}
|
|
279
|
+
avatarClicked(evt) {
|
|
280
|
+
this.params.avatarClicked && this.params.avatarClicked({
|
|
281
|
+
...evt,
|
|
282
|
+
rowId: this.rowNum
|
|
283
|
+
});
|
|
284
|
+
this.onClickChipEvent.emit({ ...evt, rowId: this.rowNum });
|
|
285
|
+
}
|
|
286
|
+
agInit(inParams) {
|
|
287
|
+
this.rowNum = inParams.rowIndex;
|
|
288
|
+
this.params = inParams.value; // inParams.value exists when gridCell is rendered as cell, `cellRenderer: GridCellComponent`
|
|
289
|
+
if (inParams.value == undefined) { // inParams.value is undefined when gridCell is rendered as header, `headerComponent: GridCellComponent`,
|
|
290
|
+
this.params = inParams;
|
|
291
|
+
}
|
|
292
|
+
// console.log(this.params);
|
|
293
|
+
}
|
|
294
|
+
refresh(params) {
|
|
295
|
+
return false; // not sure what this return value does.
|
|
296
|
+
}
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: GridCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: GridCellComponent, isStandalone: true, selector: "lib-grid-cell", outputs: { onClickButtonEvent: "onClickButtonEvent", onClickChipEvent: "onClickChipEvent", onClickLinkEvent: "onClickLinkEvent", onClickAvatarEvent: "onClickAvatarEvent" }, ngImport: i0, template: "<div class=\"grid-cell {{params.cellType}}\">\n\n <img class=\"icons\" src={{params.iconPath}} [style.display]=\"(params.viewLeadingIcon) ? 'block' : 'none'\" alt=\"\">\n\n <sa-avatar [id]=\"params.avatarConfig?.id\" [altText]=\"params.avatarConfig?.altText\"\n [imagePath]=\"params.avatarConfig?.imagePath\" [size]=\"params.avatarConfig?.size\"\n [style.display]=\"(params.viewAvatar) ? 'block' : 'none'\" (onClickEvent)=\"avatarClicked($event)\">\n </sa-avatar>\n\n <div class=\"grid-text\" [style.display]=\"(params.viewText) ? 'block' : 'none'\">\n <div [style.display]=\"(params.text) ? 'block' : 'none'\" (click)=\"linkClicked()\" class=\"main-text\">{{params.text}}\n </div>\n\n <div [style.display]=\"(params.subText) ? 'block' : 'none'\" class=\"sub-text\">{{params.subText}}</div>\n </div>\n\n <img class=\"icons\" src={{params.iconPath}} [style.display]=\"(params.viewTrailingIcon) ? 'block' : 'none'\" alt=\"\">\n\n\n <sa-chip *ngFor=\"let config of params.chipConfig, let i = index\" [id]=\"config.id\" [filling]=\"config.filling\"\n id=\"chip_{{rowNum}}_{{config.id}}\" [iconPath]=\"config.iconPath\" [iconPosition]=\"config.iconPosition\"\n [largeStateIcon]=\"config.largeStateIcon\" [state]=\"config.state\" [type]=\"config.type\" [text]=\"config.text\"\n [style.display]=\"(params.viewChip) ? 'block' : 'none'\" (onClickEvent)=\"chipClicked($event)\"></sa-chip>\n\n <sa-button [iconPosition]=\"params.buttonConfig?.iconPosition\" [ImagePath]=\"params.buttonConfig?.imagePath\"\n [id]=\"params.buttonConfig?.id\" [size]=\"params.buttonConfig?.size\" [state]=\"params.buttonConfig?.state\"\n [type]=\"params.buttonConfig?.type\" [text]=\"params.buttonConfig?.text\" [href]=\"params.buttonConfig?.href\"\n [hrefTarget]=\"params.buttonConfig?.hrefTarget\" [style.display]=\"(params.viewButton) ? 'block' : 'none'\"\n (onClickEvent)=\"buttonClicked($event)\"></sa-button>\n\n</div>\n", styles: [".header{--bg: var(--primary-50);--color: var(--text-highemphasis);--border: none;--flex-direction: left}.header:hover{cursor:pointer}.row{--color: var(--text-highemphasis);--cursor: default;--border: var(--grey-50);--flex-direction: left}.numeric{--color: var(--text-highemphasis);--cursor: default;--border: var(--grey-50);--flex-direction: right}.interactive{--color: var(--primary-500);--cursor: pointer;--border: var(--grey-50);--flex-direction: left}.grid-cell{display:flex;height:48px;padding:var(--small-12px);justify-content:var(--flex-direction);align-items:center;gap:var(--small-8px);flex-shrink:0;font-family:var(--font);box-sizing:border-box;border-bottom:1px solid var(--border);width:calc(100% - 20px);background-color:var(--bg)}.grid-text{display:flex;flex-direction:column}.main-text{color:var(--color);font-size:14px;font-weight:400;height:20px;line-height:20px}.main-text:hover{cursor:var(--cursor)}.sub-text{font-size:11px;font-weight:400;height:16px;line-height:16px;color:var(--text-mediumemphasis)}.icons{width:var(--medium-20px);height:var(--medium-20px)}\n"], dependencies: [{ kind: "component", type: AvatarComponent, selector: "sa-avatar", inputs: ["id", "imagePath", "altText", "size"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "component", type: ChipsComponent, selector: "sa-chip", inputs: ["id", "iconPath", "text", "type", "state", "filling", "iconPosition", "largeStateIcon", "largeStateText"], outputs: ["onClickEvent"] }, { kind: "component", type: ButtonComponent, selector: "sa-button", inputs: ["id", "type", "state", "size", "text", "ImagePath", "iconPosition", "href", "hrefTarget", "isSubmit"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
299
|
+
}
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: GridCellComponent, decorators: [{
|
|
301
|
+
type: Component,
|
|
302
|
+
args: [{ selector: 'lib-grid-cell', standalone: true, imports: [
|
|
303
|
+
AvatarComponent,
|
|
304
|
+
ChipsComponent,
|
|
305
|
+
ButtonComponent,
|
|
306
|
+
NgFor
|
|
307
|
+
], template: "<div class=\"grid-cell {{params.cellType}}\">\n\n <img class=\"icons\" src={{params.iconPath}} [style.display]=\"(params.viewLeadingIcon) ? 'block' : 'none'\" alt=\"\">\n\n <sa-avatar [id]=\"params.avatarConfig?.id\" [altText]=\"params.avatarConfig?.altText\"\n [imagePath]=\"params.avatarConfig?.imagePath\" [size]=\"params.avatarConfig?.size\"\n [style.display]=\"(params.viewAvatar) ? 'block' : 'none'\" (onClickEvent)=\"avatarClicked($event)\">\n </sa-avatar>\n\n <div class=\"grid-text\" [style.display]=\"(params.viewText) ? 'block' : 'none'\">\n <div [style.display]=\"(params.text) ? 'block' : 'none'\" (click)=\"linkClicked()\" class=\"main-text\">{{params.text}}\n </div>\n\n <div [style.display]=\"(params.subText) ? 'block' : 'none'\" class=\"sub-text\">{{params.subText}}</div>\n </div>\n\n <img class=\"icons\" src={{params.iconPath}} [style.display]=\"(params.viewTrailingIcon) ? 'block' : 'none'\" alt=\"\">\n\n\n <sa-chip *ngFor=\"let config of params.chipConfig, let i = index\" [id]=\"config.id\" [filling]=\"config.filling\"\n id=\"chip_{{rowNum}}_{{config.id}}\" [iconPath]=\"config.iconPath\" [iconPosition]=\"config.iconPosition\"\n [largeStateIcon]=\"config.largeStateIcon\" [state]=\"config.state\" [type]=\"config.type\" [text]=\"config.text\"\n [style.display]=\"(params.viewChip) ? 'block' : 'none'\" (onClickEvent)=\"chipClicked($event)\"></sa-chip>\n\n <sa-button [iconPosition]=\"params.buttonConfig?.iconPosition\" [ImagePath]=\"params.buttonConfig?.imagePath\"\n [id]=\"params.buttonConfig?.id\" [size]=\"params.buttonConfig?.size\" [state]=\"params.buttonConfig?.state\"\n [type]=\"params.buttonConfig?.type\" [text]=\"params.buttonConfig?.text\" [href]=\"params.buttonConfig?.href\"\n [hrefTarget]=\"params.buttonConfig?.hrefTarget\" [style.display]=\"(params.viewButton) ? 'block' : 'none'\"\n (onClickEvent)=\"buttonClicked($event)\"></sa-button>\n\n</div>\n", styles: [".header{--bg: var(--primary-50);--color: var(--text-highemphasis);--border: none;--flex-direction: left}.header:hover{cursor:pointer}.row{--color: var(--text-highemphasis);--cursor: default;--border: var(--grey-50);--flex-direction: left}.numeric{--color: var(--text-highemphasis);--cursor: default;--border: var(--grey-50);--flex-direction: right}.interactive{--color: var(--primary-500);--cursor: pointer;--border: var(--grey-50);--flex-direction: left}.grid-cell{display:flex;height:48px;padding:var(--small-12px);justify-content:var(--flex-direction);align-items:center;gap:var(--small-8px);flex-shrink:0;font-family:var(--font);box-sizing:border-box;border-bottom:1px solid var(--border);width:calc(100% - 20px);background-color:var(--bg)}.grid-text{display:flex;flex-direction:column}.main-text{color:var(--color);font-size:14px;font-weight:400;height:20px;line-height:20px}.main-text:hover{cursor:var(--cursor)}.sub-text{font-size:11px;font-weight:400;height:16px;line-height:16px;color:var(--text-mediumemphasis)}.icons{width:var(--medium-20px);height:var(--medium-20px)}\n"] }]
|
|
308
|
+
}], propDecorators: { onClickButtonEvent: [{
|
|
309
|
+
type: Output
|
|
310
|
+
}], onClickChipEvent: [{
|
|
311
|
+
type: Output
|
|
312
|
+
}], onClickLinkEvent: [{
|
|
313
|
+
type: Output
|
|
314
|
+
}], onClickAvatarEvent: [{
|
|
315
|
+
type: Output
|
|
316
|
+
}] } });
|
|
317
|
+
|
|
318
|
+
class HeaderComponent {
|
|
319
|
+
constructor() {
|
|
320
|
+
this.mainButtonClicked = new EventEmitter();
|
|
321
|
+
this.helperButtonClicked = new EventEmitter();
|
|
322
|
+
}
|
|
323
|
+
clicked(num) {
|
|
324
|
+
num ? this.mainButtonClicked.emit() : this.helperButtonClicked.emit();
|
|
325
|
+
}
|
|
326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
327
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: HeaderComponent, isStandalone: true, selector: "sa-header", inputs: { info: "info", headerName: "headerName", chipConfig: "chipConfig", buttonHelper: "buttonHelper", buttonMain: "buttonMain" }, outputs: { mainButtonClicked: "mainButtonClicked", helperButtonClicked: "helperButtonClicked" }, ngImport: i0, template: "<div class=\"header\">\n <div class=\"header-content\">\n <div class=\"heading\">\n <div class=\"header-name\">{{headerName}}</div>\n <div *ngFor=\"let chip of chipConfig\">\n <sa-chip type=\"regular\" [state]=\"chip[1]\" filling=\"filled\" [text]=\"chip[0]\"></sa-chip>\n </div>\n </div>\n <div class=\"header-info\">\n <div class=\"info-item\" *ngFor=\"let item of info\">\n <img [src]=\"item[1]\" alt=\"\">\n {{item[0]}}\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <sa-button *ngIf=\"buttonHelper\" (onClickEvent)=\"clicked(0)\" [text]=\"buttonHelper\" type=\"transparent\" size=\"medium\"\n state=\"default\">\n </sa-button>\n <sa-button *ngIf=\"buttonMain\" (onClickEvent)=\"clicked(1)\" [text]=\"buttonMain\" type=\"primary\" size=\"medium\"\n state=\"default\"></sa-button>\n </div>\n</div>\n", styles: [".header{width:100%;height:96px;font-family:var(--font);padding:var(--medium-20px, 20px) var(--medium-32px, 32px);display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:var(--small-8px, 8px);border:1px solid var(--grey-50, #E9EAEB);background:var(--Structural-White, #FFF)}.header-content{display:flex;flex-direction:column;gap:var(--small-8px, 8px)}.heading{display:flex;justify-content:flex-start;align-items:center;gap:var(--small-8px, 8px)}.header-name{font-size:22px;font-style:normal;font-weight:500;line-height:28px}.header-info{display:flex;gap:var(--small-12px, 12px)}.info-item{display:flex;justify-content:center;align-items:center;gap:var(--small-4px, 4px);font-size:12px;font-style:normal;font-weight:400;line-height:16px;color:var(--text-mediumemphasis)}.info-item img{width:20px;height:20px}.actions{display:flex;gap:var(--small-12px, 12px)}\n"], dependencies: [{ kind: "component", type: ChipsComponent, selector: "sa-chip", inputs: ["id", "iconPath", "text", "type", "state", "filling", "iconPosition", "largeStateIcon", "largeStateText"], outputs: ["onClickEvent"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ButtonComponent, selector: "sa-button", inputs: ["id", "type", "state", "size", "text", "ImagePath", "iconPosition", "href", "hrefTarget", "isSubmit"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
328
|
+
}
|
|
329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: HeaderComponent, decorators: [{
|
|
330
|
+
type: Component,
|
|
331
|
+
args: [{ selector: 'sa-header', standalone: true, imports: [ChipsComponent, NgFor, ButtonComponent, NgIf], template: "<div class=\"header\">\n <div class=\"header-content\">\n <div class=\"heading\">\n <div class=\"header-name\">{{headerName}}</div>\n <div *ngFor=\"let chip of chipConfig\">\n <sa-chip type=\"regular\" [state]=\"chip[1]\" filling=\"filled\" [text]=\"chip[0]\"></sa-chip>\n </div>\n </div>\n <div class=\"header-info\">\n <div class=\"info-item\" *ngFor=\"let item of info\">\n <img [src]=\"item[1]\" alt=\"\">\n {{item[0]}}\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <sa-button *ngIf=\"buttonHelper\" (onClickEvent)=\"clicked(0)\" [text]=\"buttonHelper\" type=\"transparent\" size=\"medium\"\n state=\"default\">\n </sa-button>\n <sa-button *ngIf=\"buttonMain\" (onClickEvent)=\"clicked(1)\" [text]=\"buttonMain\" type=\"primary\" size=\"medium\"\n state=\"default\"></sa-button>\n </div>\n</div>\n", styles: [".header{width:100%;height:96px;font-family:var(--font);padding:var(--medium-20px, 20px) var(--medium-32px, 32px);display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;border-radius:var(--small-8px, 8px);border:1px solid var(--grey-50, #E9EAEB);background:var(--Structural-White, #FFF)}.header-content{display:flex;flex-direction:column;gap:var(--small-8px, 8px)}.heading{display:flex;justify-content:flex-start;align-items:center;gap:var(--small-8px, 8px)}.header-name{font-size:22px;font-style:normal;font-weight:500;line-height:28px}.header-info{display:flex;gap:var(--small-12px, 12px)}.info-item{display:flex;justify-content:center;align-items:center;gap:var(--small-4px, 4px);font-size:12px;font-style:normal;font-weight:400;line-height:16px;color:var(--text-mediumemphasis)}.info-item img{width:20px;height:20px}.actions{display:flex;gap:var(--small-12px, 12px)}\n"] }]
|
|
332
|
+
}], propDecorators: { info: [{
|
|
333
|
+
type: Input
|
|
334
|
+
}], headerName: [{
|
|
335
|
+
type: Input
|
|
336
|
+
}], chipConfig: [{
|
|
337
|
+
type: Input
|
|
338
|
+
}], buttonHelper: [{
|
|
339
|
+
type: Input
|
|
340
|
+
}], buttonMain: [{
|
|
341
|
+
type: Input
|
|
342
|
+
}], mainButtonClicked: [{
|
|
343
|
+
type: Output
|
|
344
|
+
}], helperButtonClicked: [{
|
|
345
|
+
type: Output
|
|
346
|
+
}] } });
|
|
347
|
+
|
|
348
|
+
class IconService {
|
|
349
|
+
constructor(sanitizer) {
|
|
350
|
+
this.sanitizer = sanitizer;
|
|
351
|
+
this.path = '';
|
|
352
|
+
}
|
|
353
|
+
// getSvg(iconName: string): Observable<string> {
|
|
354
|
+
// return this.http.get(`${this.path}${iconName}.svg`, { responseType: 'text' });
|
|
355
|
+
// }
|
|
356
|
+
getSvg(iconName) {
|
|
357
|
+
const iconPath = `${this.path}${iconName}`;
|
|
358
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(iconPath);
|
|
359
|
+
}
|
|
360
|
+
setIconPath(path) {
|
|
361
|
+
if (path)
|
|
362
|
+
this.path = path;
|
|
363
|
+
}
|
|
364
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: IconService, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
365
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: IconService, providedIn: 'root' }); }
|
|
366
|
+
}
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: IconService, decorators: [{
|
|
368
|
+
type: Injectable,
|
|
369
|
+
args: [{
|
|
370
|
+
providedIn: 'root'
|
|
371
|
+
}]
|
|
372
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }] });
|
|
373
|
+
|
|
374
|
+
class IconComponent {
|
|
375
|
+
constructor() {
|
|
376
|
+
this.iconService = inject(IconService);
|
|
377
|
+
this.iconStyles = {
|
|
378
|
+
fontSize: '44px',
|
|
379
|
+
color: 'red'
|
|
380
|
+
};
|
|
381
|
+
console.log('icon comp constructor');
|
|
382
|
+
}
|
|
383
|
+
ngOnInit() {
|
|
384
|
+
console.log('icon comp');
|
|
385
|
+
}
|
|
386
|
+
ngOnChanges(changes) {
|
|
387
|
+
if (changes['icon']) {
|
|
388
|
+
if (this.icon) {
|
|
389
|
+
// Fetch sanitized URL for the SVG icon
|
|
390
|
+
this.svgIcon = this.iconService.getSvg(this.icon);
|
|
391
|
+
console.log('svg', this.icon, this.svgIcon);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
this.svgIcon = '';
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (changes['size'] || changes['color']) {
|
|
398
|
+
this.iconStyles.fontSize = this.size + 'px';
|
|
399
|
+
this.iconStyles.color = this.color;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
403
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: IconComponent, isStandalone: true, selector: "sa-icon", inputs: { icon: "icon", size: "size", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<span class=\"sa-icon\" [innerHTML]=\"svgIcon\" [ngStyle]=\"iconStyles\">\n\n</span>\n\n<!-- <img *ngIf=\"svgIcon\" [src]=\"svgIcon\" [ngStyle]=\"iconStyles\" alt=\"icon\"> -->", styles: [".sa-icon{display:inline-flex;align-items:center;justify-content:center;color:inherit;font-size:inherit}.sa-icon>svg{width:1em;height:1em;vertical-align:middle}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
404
|
+
}
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: IconComponent, decorators: [{
|
|
406
|
+
type: Component,
|
|
407
|
+
args: [{ selector: 'sa-icon', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, template: "<span class=\"sa-icon\" [innerHTML]=\"svgIcon\" [ngStyle]=\"iconStyles\">\n\n</span>\n\n<!-- <img *ngIf=\"svgIcon\" [src]=\"svgIcon\" [ngStyle]=\"iconStyles\" alt=\"icon\"> -->", styles: [".sa-icon{display:inline-flex;align-items:center;justify-content:center;color:inherit;font-size:inherit}.sa-icon>svg{width:1em;height:1em;vertical-align:middle}\n"] }]
|
|
408
|
+
}], ctorParameters: () => [], propDecorators: { icon: [{
|
|
409
|
+
type: Input,
|
|
410
|
+
args: ['icon']
|
|
411
|
+
}], size: [{
|
|
412
|
+
type: Input,
|
|
413
|
+
args: ['size']
|
|
414
|
+
}], color: [{
|
|
415
|
+
type: Input,
|
|
416
|
+
args: ['color']
|
|
417
|
+
}] } });
|
|
418
|
+
|
|
419
|
+
class ToastComponent {
|
|
420
|
+
constructor() {
|
|
421
|
+
this.finishPercentage = -1;
|
|
422
|
+
this.statusIcon = '';
|
|
423
|
+
this.filled = true;
|
|
424
|
+
this.width = '';
|
|
425
|
+
this.toastEvent = new EventEmitter();
|
|
426
|
+
this.firstButton = new EventEmitter();
|
|
427
|
+
this.secondButton = new EventEmitter();
|
|
428
|
+
this.closed = new EventEmitter();
|
|
429
|
+
this.toastStyles = { backgroundColor: 'transparent', color: '', width: this.width + '%' };
|
|
430
|
+
}
|
|
431
|
+
ngOnChanges(changes) {
|
|
432
|
+
if (changes && (changes['status'] || changes['filled'])) {
|
|
433
|
+
this.statusIcon = toastInfo[this.status].icon;
|
|
434
|
+
this.toastStyles.backgroundColor = toastInfo[this.status].bgColor;
|
|
435
|
+
this.toastStyles.color = toastInfo[this.status].color;
|
|
436
|
+
}
|
|
437
|
+
if (changes && changes['width']) {
|
|
438
|
+
this.toastStyles.width = typeof this.width === 'number' ? this.width + '%' : this.width;
|
|
439
|
+
}
|
|
440
|
+
if (this.finishPercentage > 100)
|
|
441
|
+
this.finishPercentage = 100;
|
|
442
|
+
}
|
|
443
|
+
clicked(num) {
|
|
444
|
+
if (num == 0)
|
|
445
|
+
this.firstButton.emit();
|
|
446
|
+
else if (num == 1)
|
|
447
|
+
this.secondButton.emit();
|
|
448
|
+
else if (num == 2)
|
|
449
|
+
this.closed.emit();
|
|
450
|
+
}
|
|
451
|
+
closeToast() {
|
|
452
|
+
this.toastEvent.emit({
|
|
453
|
+
type: 'TOAST_CLOSED',
|
|
454
|
+
params: {}
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
458
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.4", type: ToastComponent, isStandalone: true, selector: "sa-toast", inputs: { finishPercentage: "finishPercentage", heading: "heading", subHeading: "subHeading", statusIcon: "statusIcon", status: "status", firstButtonName: "firstButtonName", secondButtonName: "secondButtonName", closable: "closable", filled: "filled", width: "width" }, outputs: { toastEvent: "toastEvent", firstButton: "firstButton", secondButton: "secondButton", closed: "closed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"toast\" [ngStyle]=\"toastStyles\">\n <div class=\"content\">\n <div class=\"toast-icon {{status}}\">\n <sa-icon [icon]=\"statusIcon\" size=\"32\"></sa-icon>\n <!-- <img [src]=\"statusIcon\" alt=\"\"> -->\n </div>\n <div class=\"head-subhead\">\n <p class=\"heading\">{{heading}}</p>\n <p class=\"subheading\">{{subHeading}}</p>\n </div>\n @if(closable){\n <!-- <img class=\"cross\" (click)=\"closeToast()\" [src]=\"crossmark\" alt=\"\"> -->\n <sa-icon class=\"cross\" icon=\"crossmark\" size=\"24\" (click)=\"closeToast()\"></sa-icon>\n }\n </div>\n <div class=\"controls\">\n <sa-button *ngIf=\"firstButtonName\" (onClickEvent)=\"clicked(0)\" [text]=\"firstButtonName\" type=\"transparent\"\n size=\"medium\" state=\"default\">\n </sa-button>\n <sa-button *ngIf=\"secondButtonName\" (onClickEvent)=\"clicked(1)\" [text]=\"secondButtonName\" type=\"outline\"\n size=\"medium\" state=\"default\">\n </sa-button>\n </div>\n\n <div *ngIf=\"finishPercentage >= 0\" class=\"progress-bar\">\n <div class=\"progress-done\" [style.width]=\"finishPercentage+'%'\"></div>\n <div class=\"progress-left\" [style.width]=\"100-finishPercentage+'%'\"></div>\n </div>\n</div>", styles: [".toast{display:flex;width:max-content;flex-direction:column;justify-content:center;align-items:center;padding:var(--small-16px, 16px);gap:var(--small-16px, 16px);border-radius:var(--small-8px, 8px);border:1px solid var(--grey-50, #E9EAEB);background:var(--structural-white, #FFF);box-shadow:0 0 12px #0000000d;font-family:var(--font)}.cross{cursor:pointer}.heading{width:359px;font-size:16px;font-style:normal;font-weight:600;line-height:24px;letter-spacing:.15px}.toast-icon{display:flex;justify-content:center;border-radius:50%}.positive{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-success-50);background-color:var(--semantic-success-50)}.negative{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-error-50);background-color:var(--semantic-error-50)}.tentative{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-yellow-50);background-color:var(--semantic-yellow-50)}.toast-icon img{width:24px;height:24px}.subheading{font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.5px;color:var(--text-mediumemphasis, #697079)}.heading,.subheading{margin:0}.content{display:flex;justify-content:center;align-items:flex-start;gap:var(--small-12px, 12px)}.head-subhead{justify-content:space-between;display:flex;flex-direction:column;gap:var(--small-4px, 4px)}.controls{width:100%;display:flex;justify-content:flex-end;align-items:center;gap:var(--small-12px, 12px)}.progress-bar{display:flex;width:100%}.progress-done{height:3px;background-color:var(--primary-500);border-radius:2px}.progress-left{height:3px;background-color:#c5c5c5;border-top-right-radius:2px;border-bottom-right-radius:2px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ButtonComponent, selector: "sa-button", inputs: ["id", "type", "state", "size", "text", "ImagePath", "iconPosition", "href", "hrefTarget", "isSubmit"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "component", type: IconComponent, selector: "sa-icon", inputs: ["icon", "size", "color"] }] }); }
|
|
459
|
+
}
|
|
460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ToastComponent, decorators: [{
|
|
461
|
+
type: Component,
|
|
462
|
+
args: [{ selector: 'sa-toast', standalone: true, imports: [CommonModule, ButtonComponent, IconComponent, ButtonComponent, MatIcon, NgIf], template: "<div class=\"toast\" [ngStyle]=\"toastStyles\">\n <div class=\"content\">\n <div class=\"toast-icon {{status}}\">\n <sa-icon [icon]=\"statusIcon\" size=\"32\"></sa-icon>\n <!-- <img [src]=\"statusIcon\" alt=\"\"> -->\n </div>\n <div class=\"head-subhead\">\n <p class=\"heading\">{{heading}}</p>\n <p class=\"subheading\">{{subHeading}}</p>\n </div>\n @if(closable){\n <!-- <img class=\"cross\" (click)=\"closeToast()\" [src]=\"crossmark\" alt=\"\"> -->\n <sa-icon class=\"cross\" icon=\"crossmark\" size=\"24\" (click)=\"closeToast()\"></sa-icon>\n }\n </div>\n <div class=\"controls\">\n <sa-button *ngIf=\"firstButtonName\" (onClickEvent)=\"clicked(0)\" [text]=\"firstButtonName\" type=\"transparent\"\n size=\"medium\" state=\"default\">\n </sa-button>\n <sa-button *ngIf=\"secondButtonName\" (onClickEvent)=\"clicked(1)\" [text]=\"secondButtonName\" type=\"outline\"\n size=\"medium\" state=\"default\">\n </sa-button>\n </div>\n\n <div *ngIf=\"finishPercentage >= 0\" class=\"progress-bar\">\n <div class=\"progress-done\" [style.width]=\"finishPercentage+'%'\"></div>\n <div class=\"progress-left\" [style.width]=\"100-finishPercentage+'%'\"></div>\n </div>\n</div>", styles: [".toast{display:flex;width:max-content;flex-direction:column;justify-content:center;align-items:center;padding:var(--small-16px, 16px);gap:var(--small-16px, 16px);border-radius:var(--small-8px, 8px);border:1px solid var(--grey-50, #E9EAEB);background:var(--structural-white, #FFF);box-shadow:0 0 12px #0000000d;font-family:var(--font)}.cross{cursor:pointer}.heading{width:359px;font-size:16px;font-style:normal;font-weight:600;line-height:24px;letter-spacing:.15px}.toast-icon{display:flex;justify-content:center;border-radius:50%}.positive{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-success-50);background-color:var(--semantic-success-50)}.negative{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-error-50);background-color:var(--semantic-error-50)}.tentative{box-shadow:0 0 0 var(--small-4px, 4px) var(--semantic-yellow-50);background-color:var(--semantic-yellow-50)}.toast-icon img{width:24px;height:24px}.subheading{font-size:16px;font-style:normal;font-weight:400;line-height:24px;letter-spacing:.5px;color:var(--text-mediumemphasis, #697079)}.heading,.subheading{margin:0}.content{display:flex;justify-content:center;align-items:flex-start;gap:var(--small-12px, 12px)}.head-subhead{justify-content:space-between;display:flex;flex-direction:column;gap:var(--small-4px, 4px)}.controls{width:100%;display:flex;justify-content:flex-end;align-items:center;gap:var(--small-12px, 12px)}.progress-bar{display:flex;width:100%}.progress-done{height:3px;background-color:var(--primary-500);border-radius:2px}.progress-left{height:3px;background-color:#c5c5c5;border-top-right-radius:2px;border-bottom-right-radius:2px}\n"] }]
|
|
463
|
+
}], propDecorators: { finishPercentage: [{
|
|
464
|
+
type: Input
|
|
465
|
+
}], heading: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], subHeading: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], statusIcon: [{
|
|
470
|
+
type: Input
|
|
471
|
+
}], status: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], firstButtonName: [{
|
|
474
|
+
type: Input
|
|
475
|
+
}], secondButtonName: [{
|
|
476
|
+
type: Input
|
|
477
|
+
}], closable: [{
|
|
478
|
+
type: Input
|
|
479
|
+
}], filled: [{
|
|
480
|
+
type: Input
|
|
481
|
+
}], width: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], toastEvent: [{
|
|
484
|
+
type: Output
|
|
485
|
+
}], firstButton: [{
|
|
486
|
+
type: Output
|
|
487
|
+
}], secondButton: [{
|
|
488
|
+
type: Output
|
|
489
|
+
}], closed: [{
|
|
490
|
+
type: Output
|
|
491
|
+
}] } });
|
|
492
|
+
const toastInfo = {
|
|
493
|
+
'success': {
|
|
494
|
+
icon: 'checkmark',
|
|
495
|
+
bgColor: '#EBF5E9',
|
|
496
|
+
color: '#246B16'
|
|
497
|
+
},
|
|
498
|
+
'failure': {
|
|
499
|
+
icon: 'error-circle',
|
|
500
|
+
bgColor: '#F8E9E9',
|
|
501
|
+
color: '#861C15'
|
|
502
|
+
},
|
|
503
|
+
'causion': {
|
|
504
|
+
icon: 'warning',
|
|
505
|
+
bgColor: '',
|
|
506
|
+
color: ''
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
class FormSelectComponent extends FieldType {
|
|
511
|
+
constructor() {
|
|
512
|
+
super(...arguments);
|
|
513
|
+
this.svgStyle = {};
|
|
514
|
+
this.openState = false;
|
|
515
|
+
this.startInd = 0;
|
|
516
|
+
this.labelLimit = 2;
|
|
517
|
+
}
|
|
518
|
+
ngOnInit() {
|
|
519
|
+
this.selectables = this.field.props.options;
|
|
520
|
+
this.params = this.field.props['params'];
|
|
521
|
+
this.svgStyle = {
|
|
522
|
+
'-webkit-mask-image': `url(${this.params.dropIcon})})`,
|
|
523
|
+
'mask-image': `url(${this.params.dropIcon})`,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
openClose(state) {
|
|
527
|
+
if (this.field.props.disabled)
|
|
528
|
+
return;
|
|
529
|
+
this.openState = state;
|
|
530
|
+
}
|
|
531
|
+
shiftLabel(action) {
|
|
532
|
+
if (action == 'clicked')
|
|
533
|
+
this.startInd++;
|
|
534
|
+
if (action == 'cleared')
|
|
535
|
+
this.startInd = 0;
|
|
536
|
+
if (action == 'removed' && this.startInd > 0)
|
|
537
|
+
this.startInd--;
|
|
538
|
+
}
|
|
539
|
+
checkForZero(selected) {
|
|
540
|
+
this.topLabel = selected.length == 0 ? false : true;
|
|
541
|
+
}
|
|
542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FormSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: FormSelectComponent, isStandalone: true, selector: "lib-form-select", usesInheritance: true, ngImport: i0, template: "<div [style.visibility]=\"(openState || topLabel) ? 'visible' : 'hidden'\" class=\"clicked-label\">{{params.label}}</div>\n<div class=\"ng-select-field {{openState ? 'activated' : 'idle'}} {{field.props.disabled ? 'disabled' : ''}}\">\n\n <div role=\"button\" title=\"drop-button\" tabindex=\"0\" class=\"left-icon svg-icon\" [style]=\"svgStyle\"\n (click)=\"openClose(true)\" (blur)=\"openClose(false)\"\n *ngIf=\"(params.dropIconPosition == 'left' || params.dropIconPosition == 'both')\">\n </div>\n\n <ng-select (change)=\"checkForZero($event)\" (remove)=\"shiftLabel('removed')\" (clear)=\"shiftLabel('cleared')\"\n (search)=\"openClose(true)\" (focus)=\"openClose(true)\" (blur)=\" openClose(false)\" [isOpen]=\"openState\"\n placeholder={{params.label}} bindLabel=\"name\" [items]=\"selectables\" [multiple]=\"params.multiple\"\n [formControl]=\"formControl\" [style] [formlyAttributes]=\"field\">\n <ng-template ng-multi-label-tmp let-items=\"items\" let-clear=\"clear\">\n <div *ngFor=\"let item of (items ? items.slice(startInd,startInd+labelLimit): [])\">\n <sa-chip (onClickEvent)=\" (!field.props.disabled) ? clear(item) : null\" [id]=\"item.id\"\n [iconPath]=\"params.iconPath\" [text]=\"item.name\" [type]=\"params.type\"\n [state]=\"field.props.disabled ? 'neutral' : params.state\" [filling]=\"params.filling\"\n [iconPosition]=\"params.iconPosition\">\n </sa-chip>\n </div>\n <div (click)=\"shiftLabel('clicked')\" class=\"ng-value overflow-label\" *ngIf=\"items.length > (startInd+labelLimit)\">\n <sa-chip text=\"+{{items.length-(startInd+labelLimit)}}\" type=\"regular\" state=\"default\" filling=\"filled\">\n </sa-chip>\n </div>\n <div (click)=\"shiftLabel('cleared')\" *ngIf=\"startInd == items.length-labelLimit\" class=\"ng-value overflow-label\">\n <sa-chip text=\"...\" type=\"regular\" state=\"default\" filling=\"filled\">\n </sa-chip>\n </div>\n </ng-template>\n </ng-select>\n\n <div role=\"button\" title=\"drop-button\" tabindex=\"0\" class=\"right-icon svg-icon\" [style]=\"svgStyle\"\n (click)=\"openClose(true)\" (blur)=\"openClose(false)\"\n *ngIf=\"(params.dropIconPosition == 'right' || params.dropIconPosition == 'both')\">\n </div>\n\n</div>\n<div class=\"support-label\">{{params.supportText}}</div>\n", styles: [".idle{--border: 1px solid var(--grey-50)}.activated{--border: 1px solid var(--primary-300)}.disabled{border:1px solid var(--grey-50)!important}.ng-select-field:hover{--border: 1px solid var(--primary-300);--font-color: var(--text-highemphasis)}.ng-select-field{width:100%;box-sizing:border-box;position:relative;display:inline-flex;padding:0px var(--small-12px);height:40px;justify-content:center;align-items:center;border:var(--border);border-radius:var(--small-4px);font-family:var(--font);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;--font-color: var(--text-lowemphasis)}.ng-select{width:inherit;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0}.ng-select ::ng-deep .ng-select-container{display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;font-family:var(--font);box-sizing:border-box;border:none}.ng-select ::ng-deep .ng-dropdown-panel{margin-top:2px;border:1px solid var(--grey-50);box-shadow:none!important}.ng-select ::ng-deep .ng-select-container{box-shadow:none!important;position:relative!important;z-index:1!important}.ng-select ::ng-deep .ng-value-container{padding:0!important;flex-wrap:nowrap!important;display:flex;justify-content:flex-start;gap:5px;overflow-x:hidden}.ng-select ::ng-deep .ng-value{flex:none;margin:0!important}.overflow-label{padding:0 5px;cursor:pointer}.ng-select ::ng-deep .ng-placeholder{padding:0!important;position:inherit!important;color:var(--text-lowemphasis)}.ng-select ::ng-deep .ng-input{padding:0!important;position:inherit!important}.ng-select ::ng-deep .ng-clear-wrapper{z-index:9;display:flex;margin-left:5px}.ng-select ::ng-deep .ng-arrow{border-color:none!important;border-style:none!important;border-width:0!important}.svg-icon{-webkit-mask-size:contain;mask-size:contain;width:20px;height:20px;background-color:gray}.svg-icon:hover{cursor:pointer}.ng-select ::ng-deep .ng-arrow-wrapper{display:none}.support-label{font-family:var(--font);font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:var(--small-4px) var(--small-16px) 0px var(--small-16px)}.clicked-label{position:relative;width:max-content;font-family:var(--font);font-size:11px;font-style:normal;font-weight:500;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:0 var(--small-8px);margin-left:12px;margin-bottom:-8px;z-index:99;background-color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "directive", type: i2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3$1.NgMultiLabelTemplateDirective, selector: "[ng-multi-label-tmp]" }, { kind: "component", type: ChipsComponent, selector: "sa-chip", inputs: ["id", "iconPath", "text", "type", "state", "filling", "iconPosition", "largeStateIcon", "largeStateText"], outputs: ["onClickEvent"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
544
|
+
}
|
|
545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FormSelectComponent, decorators: [{
|
|
546
|
+
type: Component,
|
|
547
|
+
args: [{ selector: 'lib-form-select', standalone: true, imports: [
|
|
548
|
+
ReactiveFormsModule,
|
|
549
|
+
FormlyModule,
|
|
550
|
+
ReactiveFormsModule,
|
|
551
|
+
NgSelectModule,
|
|
552
|
+
ChipsComponent,
|
|
553
|
+
NgIf,
|
|
554
|
+
NgFor
|
|
555
|
+
], template: "<div [style.visibility]=\"(openState || topLabel) ? 'visible' : 'hidden'\" class=\"clicked-label\">{{params.label}}</div>\n<div class=\"ng-select-field {{openState ? 'activated' : 'idle'}} {{field.props.disabled ? 'disabled' : ''}}\">\n\n <div role=\"button\" title=\"drop-button\" tabindex=\"0\" class=\"left-icon svg-icon\" [style]=\"svgStyle\"\n (click)=\"openClose(true)\" (blur)=\"openClose(false)\"\n *ngIf=\"(params.dropIconPosition == 'left' || params.dropIconPosition == 'both')\">\n </div>\n\n <ng-select (change)=\"checkForZero($event)\" (remove)=\"shiftLabel('removed')\" (clear)=\"shiftLabel('cleared')\"\n (search)=\"openClose(true)\" (focus)=\"openClose(true)\" (blur)=\" openClose(false)\" [isOpen]=\"openState\"\n placeholder={{params.label}} bindLabel=\"name\" [items]=\"selectables\" [multiple]=\"params.multiple\"\n [formControl]=\"formControl\" [style] [formlyAttributes]=\"field\">\n <ng-template ng-multi-label-tmp let-items=\"items\" let-clear=\"clear\">\n <div *ngFor=\"let item of (items ? items.slice(startInd,startInd+labelLimit): [])\">\n <sa-chip (onClickEvent)=\" (!field.props.disabled) ? clear(item) : null\" [id]=\"item.id\"\n [iconPath]=\"params.iconPath\" [text]=\"item.name\" [type]=\"params.type\"\n [state]=\"field.props.disabled ? 'neutral' : params.state\" [filling]=\"params.filling\"\n [iconPosition]=\"params.iconPosition\">\n </sa-chip>\n </div>\n <div (click)=\"shiftLabel('clicked')\" class=\"ng-value overflow-label\" *ngIf=\"items.length > (startInd+labelLimit)\">\n <sa-chip text=\"+{{items.length-(startInd+labelLimit)}}\" type=\"regular\" state=\"default\" filling=\"filled\">\n </sa-chip>\n </div>\n <div (click)=\"shiftLabel('cleared')\" *ngIf=\"startInd == items.length-labelLimit\" class=\"ng-value overflow-label\">\n <sa-chip text=\"...\" type=\"regular\" state=\"default\" filling=\"filled\">\n </sa-chip>\n </div>\n </ng-template>\n </ng-select>\n\n <div role=\"button\" title=\"drop-button\" tabindex=\"0\" class=\"right-icon svg-icon\" [style]=\"svgStyle\"\n (click)=\"openClose(true)\" (blur)=\"openClose(false)\"\n *ngIf=\"(params.dropIconPosition == 'right' || params.dropIconPosition == 'both')\">\n </div>\n\n</div>\n<div class=\"support-label\">{{params.supportText}}</div>\n", styles: [".idle{--border: 1px solid var(--grey-50)}.activated{--border: 1px solid var(--primary-300)}.disabled{border:1px solid var(--grey-50)!important}.ng-select-field:hover{--border: 1px solid var(--primary-300);--font-color: var(--text-highemphasis)}.ng-select-field{width:100%;box-sizing:border-box;position:relative;display:inline-flex;padding:0px var(--small-12px);height:40px;justify-content:center;align-items:center;border:var(--border);border-radius:var(--small-4px);font-family:var(--font);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;--font-color: var(--text-lowemphasis)}.ng-select{width:inherit;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0}.ng-select ::ng-deep .ng-select-container{display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;font-family:var(--font);box-sizing:border-box;border:none}.ng-select ::ng-deep .ng-dropdown-panel{margin-top:2px;border:1px solid var(--grey-50);box-shadow:none!important}.ng-select ::ng-deep .ng-select-container{box-shadow:none!important;position:relative!important;z-index:1!important}.ng-select ::ng-deep .ng-value-container{padding:0!important;flex-wrap:nowrap!important;display:flex;justify-content:flex-start;gap:5px;overflow-x:hidden}.ng-select ::ng-deep .ng-value{flex:none;margin:0!important}.overflow-label{padding:0 5px;cursor:pointer}.ng-select ::ng-deep .ng-placeholder{padding:0!important;position:inherit!important;color:var(--text-lowemphasis)}.ng-select ::ng-deep .ng-input{padding:0!important;position:inherit!important}.ng-select ::ng-deep .ng-clear-wrapper{z-index:9;display:flex;margin-left:5px}.ng-select ::ng-deep .ng-arrow{border-color:none!important;border-style:none!important;border-width:0!important}.svg-icon{-webkit-mask-size:contain;mask-size:contain;width:20px;height:20px;background-color:gray}.svg-icon:hover{cursor:pointer}.ng-select ::ng-deep .ng-arrow-wrapper{display:none}.support-label{font-family:var(--font);font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:var(--small-4px) var(--small-16px) 0px var(--small-16px)}.clicked-label{position:relative;width:max-content;font-family:var(--font);font-size:11px;font-style:normal;font-weight:500;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:0 var(--small-8px);margin-left:12px;margin-bottom:-8px;z-index:99;background-color:#fff}\n"] }]
|
|
556
|
+
}] });
|
|
557
|
+
|
|
558
|
+
let nextId$2 = 0; // used to give unique ids to inputs used in html
|
|
559
|
+
class StepperComponent extends FieldType {
|
|
560
|
+
constructor() {
|
|
561
|
+
super(...arguments);
|
|
562
|
+
this.latestStep = -1;
|
|
563
|
+
this.editable = true;
|
|
564
|
+
this.stepped = new EventEmitter;
|
|
565
|
+
this.uuid = nextId$2++;
|
|
566
|
+
this.isDisabled = false;
|
|
567
|
+
this.tickIcon = {};
|
|
568
|
+
}
|
|
569
|
+
// {
|
|
570
|
+
// '-webkit-mask-image': `url(${this.ImagePath})`,
|
|
571
|
+
// 'mask-image': `url(${this.ImagePath})`,
|
|
572
|
+
// }
|
|
573
|
+
ngOnInit() {
|
|
574
|
+
if (this.field.props) {
|
|
575
|
+
this.stepLabels = this.field.props.options;
|
|
576
|
+
this.editable = this.field.props['params'].editable;
|
|
577
|
+
this.latestStep = this.model[`${this.key}`] ? this.model[`${this.key}`].id : -1;
|
|
578
|
+
this.doneIcon = this.field.props['params'].doneIcon;
|
|
579
|
+
this.isDisabled = this.field.props.disabled;
|
|
580
|
+
}
|
|
581
|
+
console.log(this.doneIcon);
|
|
582
|
+
this.tickIcon = {
|
|
583
|
+
'-webkit-mask-image': `url(${this.doneIcon})`,
|
|
584
|
+
'mask-image': `url(${this.doneIcon})`
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
update(chosen) {
|
|
588
|
+
if (!this.editable || this.field.props?.disabled)
|
|
589
|
+
return;
|
|
590
|
+
this.latestStep = chosen;
|
|
591
|
+
if (!this.formControl) {
|
|
592
|
+
this.stepped.emit(this.latestStep);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
this.formControl.setValue({
|
|
596
|
+
id: this.latestStep
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: StepperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
600
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: StepperComponent, isStandalone: true, selector: "sa-stepper", inputs: { latestStep: "latestStep", editable: "editable", stepLabels: "stepLabels", doneIcon: "doneIcon" }, outputs: { stepped: "stepped" }, usesInheritance: true, ngImport: i0, template: "<div class=\"stepper {{isDisabled ? 'disabled' : 'active'}}\">\n <div class=\"steps\" *ngFor=\"let label of stepLabels; let i = index\">\n <input id=\"stepper-{{uuid}}-{{i}}\" (change)=\"update(i)\" name=\"stepper-radio-{{uuid}}\"\n [checked]=\"i == latestStep ? true: false\" class=\"step-hide\" type=\"radio\">\n <div\n class=\"label-wrapper {{i < latestStep ? 'done' : ''}} {{i > latestStep ? 'default' : ''}} {{i == latestStep ? 'latest' : ''}}\">\n <label [style]=\"i < latestStep ? tickIcon : ''\" for=\"stepper-{{uuid}}-{{i}}\"\n class=\"step-label-icon {{i > latestStep ? 'undone' : ''}}\">\n </label>\n <label for=\"stepper-{{uuid}}-{{i}}\" class=\"step-label-text\">{{label.name}}</label>\n </div>\n <div *ngIf=\" i !=stepLabels.length-1\" class=\"line {{i < latestStep ? 'done' : 'default'}}\"></div>\n </div>\n</div>\n", styles: [".stepper{display:flex;width:max-content;justify-content:center;align-items:center;font-family:var(--font)}.active{--main-bg: var(--primary-500);--main-line: var(--primary-500)}.disabled{--main-bg: var(--grey-100);--main-line: var(--grey-50)}.done{--bg-line: var(--main-line);--bg: var(--main-bg);--border: none}.default{--bg-line: var(--grey-50);--bg: var(--grey-100);--border: 4px solid white}.latest{--bg: white;--border: 4px solid var(--main-bg)}.steps{display:flex;justify-content:center;align-items:center;position:relative}.line{width:140px;height:2px;background-color:var(--bg-line);transition:.25s}.label-wrapper{width:16px;height:16px;height:fit-content;border-radius:16px;background-color:var(--bg);display:flex;justify-content:center}.step-label-icon{display:flex;justify-content:center;width:16px;height:16px;border-radius:16px;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;background-position:center;background-color:#fff;border:var(--border);box-sizing:border-box;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;cursor:pointer}.undone{background-color:var(--grey-100)}.step-label-text{color:var(--text-mediumemphasis, #697079);position:absolute;top:20px;cursor:pointer}.step-hide{display:none}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
601
|
+
}
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: StepperComponent, decorators: [{
|
|
603
|
+
type: Component,
|
|
604
|
+
args: [{ selector: 'sa-stepper', standalone: true, imports: [NgFor, NgIf], template: "<div class=\"stepper {{isDisabled ? 'disabled' : 'active'}}\">\n <div class=\"steps\" *ngFor=\"let label of stepLabels; let i = index\">\n <input id=\"stepper-{{uuid}}-{{i}}\" (change)=\"update(i)\" name=\"stepper-radio-{{uuid}}\"\n [checked]=\"i == latestStep ? true: false\" class=\"step-hide\" type=\"radio\">\n <div\n class=\"label-wrapper {{i < latestStep ? 'done' : ''}} {{i > latestStep ? 'default' : ''}} {{i == latestStep ? 'latest' : ''}}\">\n <label [style]=\"i < latestStep ? tickIcon : ''\" for=\"stepper-{{uuid}}-{{i}}\"\n class=\"step-label-icon {{i > latestStep ? 'undone' : ''}}\">\n </label>\n <label for=\"stepper-{{uuid}}-{{i}}\" class=\"step-label-text\">{{label.name}}</label>\n </div>\n <div *ngIf=\" i !=stepLabels.length-1\" class=\"line {{i < latestStep ? 'done' : 'default'}}\"></div>\n </div>\n</div>\n", styles: [".stepper{display:flex;width:max-content;justify-content:center;align-items:center;font-family:var(--font)}.active{--main-bg: var(--primary-500);--main-line: var(--primary-500)}.disabled{--main-bg: var(--grey-100);--main-line: var(--grey-50)}.done{--bg-line: var(--main-line);--bg: var(--main-bg);--border: none}.default{--bg-line: var(--grey-50);--bg: var(--grey-100);--border: 4px solid white}.latest{--bg: white;--border: 4px solid var(--main-bg)}.steps{display:flex;justify-content:center;align-items:center;position:relative}.line{width:140px;height:2px;background-color:var(--bg-line);transition:.25s}.label-wrapper{width:16px;height:16px;height:fit-content;border-radius:16px;background-color:var(--bg);display:flex;justify-content:center}.step-label-icon{display:flex;justify-content:center;width:16px;height:16px;border-radius:16px;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;background-position:center;background-color:#fff;border:var(--border);box-sizing:border-box;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;cursor:pointer}.undone{background-color:var(--grey-100)}.step-label-text{color:var(--text-mediumemphasis, #697079);position:absolute;top:20px;cursor:pointer}.step-hide{display:none}\n"] }]
|
|
605
|
+
}], propDecorators: { latestStep: [{
|
|
606
|
+
type: Input
|
|
607
|
+
}], editable: [{
|
|
608
|
+
type: Input
|
|
609
|
+
}], stepLabels: [{
|
|
610
|
+
type: Input
|
|
611
|
+
}], doneIcon: [{
|
|
612
|
+
type: Input
|
|
613
|
+
}], stepped: [{
|
|
614
|
+
type: Output
|
|
615
|
+
}] } });
|
|
616
|
+
|
|
617
|
+
class ToolTipComponent {
|
|
618
|
+
constructor() {
|
|
619
|
+
this.toolTipSkipped = new EventEmitter();
|
|
620
|
+
this.toolTipSeen = new EventEmitter();
|
|
621
|
+
this.arrowIcon = "../assets/arrow.svg";
|
|
622
|
+
this.pointer = "../assets/pointer-polygon.svg";
|
|
623
|
+
this.msgInd = 0; // is the index of current message being displayed
|
|
624
|
+
}
|
|
625
|
+
updateMsgInd(k) {
|
|
626
|
+
this.msgInd += k;
|
|
627
|
+
if (this.msgInd < 0)
|
|
628
|
+
this.msgInd = 0;
|
|
629
|
+
if (this.msgInd > this.messages.length - 1) {
|
|
630
|
+
this.msgInd = this.messages.length - 1;
|
|
631
|
+
this.toolTipSeen.emit();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
skipToolTip() {
|
|
635
|
+
this.toolTipSkipped.emit();
|
|
636
|
+
}
|
|
637
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ToolTipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
638
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: ToolTipComponent, isStandalone: true, selector: "sa-tool-tip", inputs: { messages: "messages", pointerPosition: "pointerPosition" }, outputs: { toolTipSkipped: "toolTipSkipped", toolTipSeen: "toolTipSeen" }, ngImport: i0, template: "<div class=\"tool-tip-vertical\">\n <div class=\"tool-tip-pointer-icon pointer-top\" *ngIf=\"pointerPosition == 'top'\"></div>\n <div class=\"tool-tip-horizontal\">\n <div class=\"tool-tip-pointer-icon pointer-left\" *ngIf=\"pointerPosition == 'left'\"></div>\n <div class=\"tool-tip\">\n <div class=\"tool-tip-content\">\n <div class=\"tool-tip-heading\">Heading</div>\n <div *ngFor=\"let msg of messages, let i = index\" class=\"tool-tip-message {{msgInd != i ? 'hidden-msg': ''}}\">\n {{msg}}\n </div>\n </div>\n <div class=\"tool-tip-break\">\n </div>\n <div class=\"tool-tip-controls\">\n <div class=\"tool-tip-navigate\">\n <img class=\"left-icon tool-tip-navigate-icon\" (click)=\"updateMsgInd(-1)\" [src]=\"arrowIcon\" alt=\"\">\n {{msgInd+1}} of {{messages.length}}\n <img class=\"right-icon tool-tip-navigate-icon\" (click)=\"updateMsgInd(1)\" [src]=\"arrowIcon\" alt=\"\">\n </div>\n <div class=\"tool-tip-control-buttons\">\n <sa-button (onClickEvent)=\"skipToolTip()\" class=\"skip-button\" text=\"Skip\" type=\"transparent\" size=\"medium\"\n state=\"default\"></sa-button>\n <sa-button (onClickEvent)=\"updateMsgInd(1)\" text=\"Next\" type=\"primary\" size=\"medium\" state=\"default\">\n </sa-button>\n </div>\n </div>\n </div>\n <div class=\"tool-tip-pointer-icon pointer-right\" *ngIf=\"pointerPosition == 'right'\"></div>\n </div>\n <div class=\"tool-tip-pointer-icon pointer-bottom\" *ngIf=\"pointerPosition == 'bottom'\"></div>\n</div>\n", styles: [".tool-tip-horizontal{display:flex;width:max-content;justify-content:center;align-items:center}.tool-tip-vertical{display:flex;flex-direction:column;width:max-content;justify-content:center;align-items:center}.tool-tip{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--small-16px, 16px);width:375px;height:auto;box-sizing:border-box;padding:var(--medium-20px, 20px) var(--medium-24px, 24px);border-radius:var(--small-4px, 4px);background:var(--grey-700, #161E27);font-family:var(--font)}.tool-tip-content{display:flex;width:100%;flex-direction:column;gap:var(--small-8px, 8px)}.tool-tip-heading{font-size:16px;font-style:normal;color:var(--text-white, #FFF);font-weight:600;line-height:24px;letter-spacing:.15px}.tool-tip-message{font-size:14px;color:var(--grey-50, #E9EAEB);font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px}.tool-tip-controls{display:flex;width:100%;justify-content:space-between;font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px}.tool-tip-navigate{color:var(--text-lowemphasis, #989DA3);display:flex;justify-content:center;align-items:center}.skip-button ::ng-deep .sa-button{color:var(--grey-100, #BABDC1)!important}.skip-button ::ng-deep .sa-button:hover{background-color:transparent}.tool-tip-navigate-icon{cursor:pointer}.left-icon{transform:rotate(180deg)}.tool-tip-control-buttons{display:flex;gap:4px}.tool-tip-break{width:100%;height:.5px;background:var(--grey-50, #E9EAEB)}.hidden-msg{display:none}.tool-tip-pointer-icon{display:flex;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:11px solid var(--grey-700, #161E27)}.pointer-left{transform:rotate(-90deg);margin-right:-3px}.pointer-right{transform:rotate(90deg);margin-left:-3px}.pointer-top{margin-bottom:-3px}.pointer-bottom{transform:rotate(180deg);margin-top:-3px}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "sa-button", inputs: ["id", "type", "state", "size", "text", "ImagePath", "iconPosition", "href", "hrefTarget", "isSubmit"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
639
|
+
}
|
|
640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ToolTipComponent, decorators: [{
|
|
641
|
+
type: Component,
|
|
642
|
+
args: [{ selector: 'sa-tool-tip', standalone: true, imports: [ButtonComponent, NgFor, NgIf], template: "<div class=\"tool-tip-vertical\">\n <div class=\"tool-tip-pointer-icon pointer-top\" *ngIf=\"pointerPosition == 'top'\"></div>\n <div class=\"tool-tip-horizontal\">\n <div class=\"tool-tip-pointer-icon pointer-left\" *ngIf=\"pointerPosition == 'left'\"></div>\n <div class=\"tool-tip\">\n <div class=\"tool-tip-content\">\n <div class=\"tool-tip-heading\">Heading</div>\n <div *ngFor=\"let msg of messages, let i = index\" class=\"tool-tip-message {{msgInd != i ? 'hidden-msg': ''}}\">\n {{msg}}\n </div>\n </div>\n <div class=\"tool-tip-break\">\n </div>\n <div class=\"tool-tip-controls\">\n <div class=\"tool-tip-navigate\">\n <img class=\"left-icon tool-tip-navigate-icon\" (click)=\"updateMsgInd(-1)\" [src]=\"arrowIcon\" alt=\"\">\n {{msgInd+1}} of {{messages.length}}\n <img class=\"right-icon tool-tip-navigate-icon\" (click)=\"updateMsgInd(1)\" [src]=\"arrowIcon\" alt=\"\">\n </div>\n <div class=\"tool-tip-control-buttons\">\n <sa-button (onClickEvent)=\"skipToolTip()\" class=\"skip-button\" text=\"Skip\" type=\"transparent\" size=\"medium\"\n state=\"default\"></sa-button>\n <sa-button (onClickEvent)=\"updateMsgInd(1)\" text=\"Next\" type=\"primary\" size=\"medium\" state=\"default\">\n </sa-button>\n </div>\n </div>\n </div>\n <div class=\"tool-tip-pointer-icon pointer-right\" *ngIf=\"pointerPosition == 'right'\"></div>\n </div>\n <div class=\"tool-tip-pointer-icon pointer-bottom\" *ngIf=\"pointerPosition == 'bottom'\"></div>\n</div>\n", styles: [".tool-tip-horizontal{display:flex;width:max-content;justify-content:center;align-items:center}.tool-tip-vertical{display:flex;flex-direction:column;width:max-content;justify-content:center;align-items:center}.tool-tip{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--small-16px, 16px);width:375px;height:auto;box-sizing:border-box;padding:var(--medium-20px, 20px) var(--medium-24px, 24px);border-radius:var(--small-4px, 4px);background:var(--grey-700, #161E27);font-family:var(--font)}.tool-tip-content{display:flex;width:100%;flex-direction:column;gap:var(--small-8px, 8px)}.tool-tip-heading{font-size:16px;font-style:normal;color:var(--text-white, #FFF);font-weight:600;line-height:24px;letter-spacing:.15px}.tool-tip-message{font-size:14px;color:var(--grey-50, #E9EAEB);font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px}.tool-tip-controls{display:flex;width:100%;justify-content:space-between;font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px}.tool-tip-navigate{color:var(--text-lowemphasis, #989DA3);display:flex;justify-content:center;align-items:center}.skip-button ::ng-deep .sa-button{color:var(--grey-100, #BABDC1)!important}.skip-button ::ng-deep .sa-button:hover{background-color:transparent}.tool-tip-navigate-icon{cursor:pointer}.left-icon{transform:rotate(180deg)}.tool-tip-control-buttons{display:flex;gap:4px}.tool-tip-break{width:100%;height:.5px;background:var(--grey-50, #E9EAEB)}.hidden-msg{display:none}.tool-tip-pointer-icon{display:flex;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:11px solid var(--grey-700, #161E27)}.pointer-left{transform:rotate(-90deg);margin-right:-3px}.pointer-right{transform:rotate(90deg);margin-left:-3px}.pointer-top{margin-bottom:-3px}.pointer-bottom{transform:rotate(180deg);margin-top:-3px}\n"] }]
|
|
643
|
+
}], propDecorators: { messages: [{
|
|
644
|
+
type: Input
|
|
645
|
+
}], pointerPosition: [{
|
|
646
|
+
type: Input
|
|
647
|
+
}], toolTipSkipped: [{
|
|
648
|
+
type: Output
|
|
649
|
+
}], toolTipSeen: [{
|
|
650
|
+
type: Output
|
|
651
|
+
}] } });
|
|
652
|
+
|
|
653
|
+
let nextId$1 = 0; // used to give unique ids to inputs used in html
|
|
654
|
+
class CalendarHeaderComponent {
|
|
655
|
+
constructor(calendar, // calendar instance of picker
|
|
656
|
+
dateAdapter, // native or moment date adapter
|
|
657
|
+
picker, dateFormats, // for formatting
|
|
658
|
+
cdr) {
|
|
659
|
+
this.calendar = calendar;
|
|
660
|
+
this.dateAdapter = dateAdapter;
|
|
661
|
+
this.picker = picker;
|
|
662
|
+
this.dateFormats = dateFormats;
|
|
663
|
+
this.uuid = nextId$1++;
|
|
664
|
+
this.destroy$ = new Subject();
|
|
665
|
+
this.selectedPreset = "Custom";
|
|
666
|
+
this.presets = [
|
|
667
|
+
"This Quarter",
|
|
668
|
+
"Last Quarter",
|
|
669
|
+
"Last 6 Months",
|
|
670
|
+
"This Year",
|
|
671
|
+
"Last Year",
|
|
672
|
+
"Custom"
|
|
673
|
+
];
|
|
674
|
+
this.today = new Date();
|
|
675
|
+
// make sure your header stays in sync with the calendar:
|
|
676
|
+
calendar.stateChanges
|
|
677
|
+
.pipe(takeUntil(this.destroy$)) // unsubscribe when destroyed
|
|
678
|
+
.subscribe(() => cdr.markForCheck());
|
|
679
|
+
}
|
|
680
|
+
// active date label rendered between the arrow buttons
|
|
681
|
+
ngOnInit() {
|
|
682
|
+
const currentRange = this.calendar.selected;
|
|
683
|
+
currentRange?.start.setHours(0, 0, 0, 0);
|
|
684
|
+
currentRange?.end.setHours(0, 0, 0, 0);
|
|
685
|
+
// To pre-select a preset when the calendar opens.
|
|
686
|
+
// Match the already selected date range with the date-ranges of all presets.
|
|
687
|
+
// If already selected date range matches with a preset, pre-select it.
|
|
688
|
+
for (let i = 0; i < this.presets.length; i++) {
|
|
689
|
+
const tempRange = this.findDate(this.presets[i]);
|
|
690
|
+
if (tempRange.newStart.getTime() == currentRange.start.getTime() && tempRange.newEnd.getTime() == currentRange.end.getTime()) {
|
|
691
|
+
this.selectedPreset = this.presets[i];
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
get periodLabel() {
|
|
697
|
+
// use date adapter to format the label, e.g. "SEP 2020"
|
|
698
|
+
return this.dateAdapter
|
|
699
|
+
.format(this.calendar.activeDate, this.dateFormats.display.monthYearLabel)
|
|
700
|
+
.toLocaleUpperCase();
|
|
701
|
+
}
|
|
702
|
+
previousClicked(mode) {
|
|
703
|
+
this.changeDate(mode, -1);
|
|
704
|
+
}
|
|
705
|
+
nextClicked(mode) {
|
|
706
|
+
this.changeDate(mode, 1);
|
|
707
|
+
}
|
|
708
|
+
changeView() {
|
|
709
|
+
this.calendar.currentView =
|
|
710
|
+
this.calendar.currentView == "month"
|
|
711
|
+
? "year"
|
|
712
|
+
: this.calendar.currentView == "year"
|
|
713
|
+
? "multi-year"
|
|
714
|
+
: "month";
|
|
715
|
+
}
|
|
716
|
+
presetChanged(evt) {
|
|
717
|
+
const newRange = this.findDate(evt.target.value);
|
|
718
|
+
this.calendar.activeDate = newRange.newStart;
|
|
719
|
+
this.picker.select(newRange.newStart);
|
|
720
|
+
this.picker.select(newRange.newEnd);
|
|
721
|
+
}
|
|
722
|
+
findDate(selected) {
|
|
723
|
+
const date = this.today.getDate();
|
|
724
|
+
const month = this.today.getMonth();
|
|
725
|
+
const year = this.today.getFullYear();
|
|
726
|
+
let newRange;
|
|
727
|
+
this.selectedPreset = selected;
|
|
728
|
+
switch (selected) {
|
|
729
|
+
case "This Quarter": {
|
|
730
|
+
const thisQuarterMonth = Math.floor(month / 3) * 3;
|
|
731
|
+
const start = this.dateAdapter.createDate(year, thisQuarterMonth, 1);
|
|
732
|
+
const end = this.dateAdapter.createDate(year, thisQuarterMonth + 3, 1);
|
|
733
|
+
newRange = {
|
|
734
|
+
newStart: start,
|
|
735
|
+
newEnd: end,
|
|
736
|
+
};
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
case "Last Quarter": {
|
|
740
|
+
const lastQuarterMonth = (Math.floor(month / 3) * 3) - 3;
|
|
741
|
+
const start = this.dateAdapter.createDate(year, lastQuarterMonth, 1);
|
|
742
|
+
const end = this.dateAdapter.createDate(year, lastQuarterMonth + 3, 1);
|
|
743
|
+
newRange = {
|
|
744
|
+
newStart: start,
|
|
745
|
+
newEnd: end,
|
|
746
|
+
};
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
case "Last 6 Months": {
|
|
750
|
+
const end = this.dateAdapter.createDate(year, month, date);
|
|
751
|
+
const start = this.dateAdapter.addCalendarMonths(end, -6);
|
|
752
|
+
newRange = {
|
|
753
|
+
newStart: start,
|
|
754
|
+
newEnd: end,
|
|
755
|
+
};
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
case "This Year": {
|
|
759
|
+
const start = this.dateAdapter.createDate(year, 0, 1);
|
|
760
|
+
const end = this.dateAdapter.createDate(year, 11, 31);
|
|
761
|
+
newRange = {
|
|
762
|
+
newStart: start,
|
|
763
|
+
newEnd: end,
|
|
764
|
+
};
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
case "Last Year": {
|
|
768
|
+
const start = this.dateAdapter.createDate(year - 1, 0, 1);
|
|
769
|
+
const end = this.dateAdapter.createDate(year - 1, 11, 31);
|
|
770
|
+
newRange = {
|
|
771
|
+
newStart: start,
|
|
772
|
+
newEnd: end,
|
|
773
|
+
};
|
|
774
|
+
break;
|
|
775
|
+
}
|
|
776
|
+
default: {
|
|
777
|
+
newRange = {
|
|
778
|
+
newStart: new Date(),
|
|
779
|
+
newEnd: new Date(),
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
return newRange;
|
|
784
|
+
}
|
|
785
|
+
changeDate(mode, amount) {
|
|
786
|
+
// increment or decrement month or year
|
|
787
|
+
this.calendar.activeDate =
|
|
788
|
+
mode === 'month'
|
|
789
|
+
? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, amount)
|
|
790
|
+
: this.dateAdapter.addCalendarYears(this.calendar.activeDate, amount);
|
|
791
|
+
}
|
|
792
|
+
ngOnDestroy() {
|
|
793
|
+
this.destroy$.next(); // will trigger unsubscription in takeUntil
|
|
794
|
+
}
|
|
795
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CalendarHeaderComponent, deps: [{ token: i2$1.MatCalendar }, { token: i2$2.DateAdapter }, { token: i2$1.MatDateRangePicker }, { token: MAT_DATE_FORMATS }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
796
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: CalendarHeaderComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<div class=\"range-preset\">\n <div class=\"preset\" *ngFor=\"let preset of presets, let i = index\">\n <label class=\"preset-label {{preset == selectedPreset ? 'preset-selected' : ''}}\"\n for=\"preset-radio-{{i}}\">{{preset}}</label>\n <input class=\"preset-radio\" (change)=\"presetChanged($event)\" [checked]=\"preset == selectedPreset\"\n id=\"preset-radio-{{i}}\" type=\"radio\" name=\"preset-radios-{{uuid}}\" value=\"{{preset}}\">\n </div>\n</div>\n\n<div class=\"header\">\n <button mat-icon-button (click)=\"previousClicked('month')\">\n <mat-icon>keyboard_arrow_left</mat-icon>\n </button>\n\n <button mat-button class=\"header-label\" (click)=\"changeView()\">{{ periodLabel }}</button>\n\n <button mat-icon-button (click)=\"nextClicked('month')\">\n <mat-icon>keyboard_arrow_right</mat-icon>\n </button>\n</div>\n", styles: [".header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--grey-50);margin-top:-4px;margin-bottom:var(--small-8px, 8px)}.header-label{font-family:Roboto;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px}.range-preset{width:180px;position:absolute;padding:var(--small-12px, 12px) 0 0 var(--medium-24px, 24px);box-sizing:border-box;margin-top:-9px;margin-left:-180px;height:356px;background-color:#fff;border-top:1px solid var(--grey-50);border-left:1px solid var(--grey-50);border-bottom:1px solid var(--grey-50);border-bottom-left-radius:var(--small-8px, 8px);border-top-left-radius:var(--small-8px, 8px);gap:var(--small-8px, 8px);display:flex;flex-direction:column}.preset{padding:var(--small-8px, 8px);display:flex;gap:var(--small-4px, 4px);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;color:var(--text-mediumemphasis);margin-bottom:-5px}.preset-radio,.preset-label{cursor:pointer}.preset-selected{color:var(--primary-500)}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
797
|
+
}
|
|
798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CalendarHeaderComponent, decorators: [{
|
|
799
|
+
type: Component,
|
|
800
|
+
args: [{ standalone: true, imports: [
|
|
801
|
+
NgFor,
|
|
802
|
+
MatIconModule,
|
|
803
|
+
MatButton
|
|
804
|
+
], template: "<div class=\"range-preset\">\n <div class=\"preset\" *ngFor=\"let preset of presets, let i = index\">\n <label class=\"preset-label {{preset == selectedPreset ? 'preset-selected' : ''}}\"\n for=\"preset-radio-{{i}}\">{{preset}}</label>\n <input class=\"preset-radio\" (change)=\"presetChanged($event)\" [checked]=\"preset == selectedPreset\"\n id=\"preset-radio-{{i}}\" type=\"radio\" name=\"preset-radios-{{uuid}}\" value=\"{{preset}}\">\n </div>\n</div>\n\n<div class=\"header\">\n <button mat-icon-button (click)=\"previousClicked('month')\">\n <mat-icon>keyboard_arrow_left</mat-icon>\n </button>\n\n <button mat-button class=\"header-label\" (click)=\"changeView()\">{{ periodLabel }}</button>\n\n <button mat-icon-button (click)=\"nextClicked('month')\">\n <mat-icon>keyboard_arrow_right</mat-icon>\n </button>\n</div>\n", styles: [".header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--grey-50);margin-top:-4px;margin-bottom:var(--small-8px, 8px)}.header-label{font-family:Roboto;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px}.range-preset{width:180px;position:absolute;padding:var(--small-12px, 12px) 0 0 var(--medium-24px, 24px);box-sizing:border-box;margin-top:-9px;margin-left:-180px;height:356px;background-color:#fff;border-top:1px solid var(--grey-50);border-left:1px solid var(--grey-50);border-bottom:1px solid var(--grey-50);border-bottom-left-radius:var(--small-8px, 8px);border-top-left-radius:var(--small-8px, 8px);gap:var(--small-8px, 8px);display:flex;flex-direction:column}.preset{padding:var(--small-8px, 8px);display:flex;gap:var(--small-4px, 4px);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;color:var(--text-mediumemphasis);margin-bottom:-5px}.preset-radio,.preset-label{cursor:pointer}.preset-selected{color:var(--primary-500)}\n"] }]
|
|
805
|
+
}], ctorParameters: () => [{ type: i2$1.MatCalendar }, { type: i2$2.DateAdapter }, { type: i2$1.MatDateRangePicker }, { type: undefined, decorators: [{
|
|
806
|
+
type: Inject,
|
|
807
|
+
args: [MAT_DATE_FORMATS]
|
|
808
|
+
}] }, { type: i0.ChangeDetectorRef }] });
|
|
809
|
+
|
|
810
|
+
class DatepickerComponent extends FieldType {
|
|
811
|
+
constructor() {
|
|
812
|
+
super(...arguments);
|
|
813
|
+
this.CalendarHeaderComponent = CalendarHeaderComponent;
|
|
814
|
+
}
|
|
815
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: DatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
816
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: DatepickerComponent, isStandalone: true, selector: "sa-datepicker", inputs: { range: "range" }, providers: [], usesInheritance: true, ngImport: i0, template: "<mat-form-field class=\"date-picker\">\n <mat-label>Choose a date</mat-label>\n <mat-date-range-input [rangePicker]=\"picker\" [formGroup]=\"range\">\n <input formControlName=\"start\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"end\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n <mat-hint>MM/DD/YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker [calendarHeaderComponent]=\"CalendarHeaderComponent\" #picker>\n </mat-date-range-picker>\n</mat-form-field>\n", styles: ["::ng-deep .cdk-overlay-container{--mat-datepicker-calendar-container-elevation-shadow: none;--mat-datepicker-calendar-container-shape: 0px;--mat-datepicker-calendar-date-selected-state-background-color: var(--primary-500);--mat-datepicker-calendar-date-hover-state-background-color: var(--grey-50);--mat-datepicker-calendar-date-in-range-state-background-color: var(--grey-50);--mat-datepicker-calendar-date-focus-state-background-color: var(--grey-50)}::ng-deep .cdk-overlay-container .mat-datepicker-popup{border-top:1px solid var(--grey-50);border-right:1px solid var(--grey-50);border-bottom:1px solid var(--grey-50);border-radius:var(--small-8px, 8px);height:356px;padding:12px;margin-top:0;margin-left:180px;background-color:#fff}::ng-deep .cdk-overlay-container .mat-datepicker-content .mat-calendar{box-shadow:none;height:300px}::ng-deep .mat-calendar-content .mat-calendar-table-header-divider{display:none}.date-picker{margin:30px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$1.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$1.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$1.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$1.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatNativeDateModule }] }); }
|
|
817
|
+
}
|
|
818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
819
|
+
type: Component,
|
|
820
|
+
args: [{ selector: 'sa-datepicker', standalone: true, providers: [], imports: [
|
|
821
|
+
MatFormFieldModule,
|
|
822
|
+
MatInputModule,
|
|
823
|
+
MatDatepickerModule,
|
|
824
|
+
NgFor,
|
|
825
|
+
NgIf,
|
|
826
|
+
ReactiveFormsModule,
|
|
827
|
+
CalendarHeaderComponent,
|
|
828
|
+
CommonModule,
|
|
829
|
+
MatNativeDateModule
|
|
830
|
+
], template: "<mat-form-field class=\"date-picker\">\n <mat-label>Choose a date</mat-label>\n <mat-date-range-input [rangePicker]=\"picker\" [formGroup]=\"range\">\n <input formControlName=\"start\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"end\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n <mat-hint>MM/DD/YYYY</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker [calendarHeaderComponent]=\"CalendarHeaderComponent\" #picker>\n </mat-date-range-picker>\n</mat-form-field>\n", styles: ["::ng-deep .cdk-overlay-container{--mat-datepicker-calendar-container-elevation-shadow: none;--mat-datepicker-calendar-container-shape: 0px;--mat-datepicker-calendar-date-selected-state-background-color: var(--primary-500);--mat-datepicker-calendar-date-hover-state-background-color: var(--grey-50);--mat-datepicker-calendar-date-in-range-state-background-color: var(--grey-50);--mat-datepicker-calendar-date-focus-state-background-color: var(--grey-50)}::ng-deep .cdk-overlay-container .mat-datepicker-popup{border-top:1px solid var(--grey-50);border-right:1px solid var(--grey-50);border-bottom:1px solid var(--grey-50);border-radius:var(--small-8px, 8px);height:356px;padding:12px;margin-top:0;margin-left:180px;background-color:#fff}::ng-deep .cdk-overlay-container .mat-datepicker-content .mat-calendar{box-shadow:none;height:300px}::ng-deep .mat-calendar-content .mat-calendar-table-header-divider{display:none}.date-picker{margin:30px}\n"] }]
|
|
831
|
+
}], propDecorators: { range: [{
|
|
832
|
+
type: Input
|
|
833
|
+
}] } });
|
|
834
|
+
|
|
835
|
+
let nextId = 0; // used to give unique ids to inputs used in html
|
|
836
|
+
class TabsComponent {
|
|
837
|
+
constructor() {
|
|
838
|
+
this.tabChanged = new EventEmitter();
|
|
839
|
+
this.uuid = nextId++;
|
|
840
|
+
this.svgStyle = [];
|
|
841
|
+
}
|
|
842
|
+
ngOnChanges() {
|
|
843
|
+
this.svgStyle = this.tabs.map((item) => {
|
|
844
|
+
return {
|
|
845
|
+
'-webkit-mask-image': `url(${item.tabIcon})`,
|
|
846
|
+
'mask-image': `url(${item.tabIcon})`,
|
|
847
|
+
};
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
tabChange(evt) {
|
|
851
|
+
this.tabChanged.emit(evt.target.value);
|
|
852
|
+
}
|
|
853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
854
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: TabsComponent, isStandalone: true, selector: "sa-tabs", inputs: { tabs: "tabs", type: "type", defaultTab: "defaultTab" }, outputs: { tabChanged: "tabChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"tab-wrapper {{type}}\">\n <div class=\"tabs\">\n <div *ngFor=\"let item of tabs, let i = index\" class=\"tab-item\">\n <input [checked]=\"(defaultTab == i) ? true : false\" [value]=\"i\" (change)=\"tabChange($event)\"\n id=\"tab-check-{{i}}-{{uuid}}\" class=\"tab-checks\" type=\"radio\" name=\"tab-checkbox-{{uuid}}\">\n <label for=\"tab-check-{{i}}-{{uuid}}\" class=\"tab-label\">\n <div *ngIf=\"item.iconPosition == 'left' || item.iconPosition == 'both'\" class=\"svg-icon\" [style]=\"svgStyle[i]\">\n </div>\n {{item.tabName}}\n <div *ngIf=\"item.iconPosition == 'right' || item.iconPosition == 'both'\" class=\"svg-icon\" [style]=\"svgStyle[i]\">\n </div>\n <div class=\"badge\" *ngIf=\"item.badgeContent\">{{item.badgeContent}}</div>\n </label>\n </div>\n </div>\n</div>\n", styles: [".box{--bg: var(--grey-50);--tab-bg: white;--border: none;--tab-border: none;--tab-border-radius: 2px;--icon-color: var(--text-mediumemphasis)}.inline{--bg: white;--tab-bg: white;--border: 1px solid var(--grey-50, #E9EAEB);--tab-border: var(--primary-500, #1B77E4);--tab-border-radius: none;--icon-color: var(--text-mediumemphasis)}.tab-wrapper{width:max-content;padding:var(--small-8px, 8px);background-color:var(--bg);border-radius:var(--Small-4px, 4px)}.tabs{display:flex;height:42px;gap:var(--small-8px, 8px);font-family:var(--font);border-bottom:var(--border)}.tab-item{display:flex;justify-content:center;align-items:center;gap:var(--small-8px, 8px)}.tab-label{display:flex;justify-content:center;align-items:center;gap:var(--small-4px, 4px);padding:var(--small-8px, 8px) var(--small-12px, 12px);border-bottom:none;transition:.1s;font-size:14px;font-style:normal;font-weight:500;line-height:20px;letter-spacing:.1px;color:var(--text-mediumemphasis);cursor:pointer}.tab-checks{display:none}.tab-checks:checked+label{background-color:var(--tab-bg);border-bottom:2px solid var(--tab-border);border-radius:var(--tab-border-radius);color:var(--primary-500);--icon-color: var(--primary-500) }.tab-checks:checked+label .badge{width:auto;height:auto;padding:var(--Small-4px, 4px) var(--Small-12px, 12px);border-radius:16px;font-size:12px;font-style:normal;font-weight:500;line-height:16px;letter-spacing:.5px}.badge{width:var(--small-8px);height:var(--small-8px);border-radius:var(--small-8px);background-color:var(--secondary-500, #FE8235);color:#fff;margin-left:var(--small-4px);overflow:hidden;transition:.25s;font-size:0}.svg-icon{height:16px;width:16px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--icon-color)}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
855
|
+
}
|
|
856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: TabsComponent, decorators: [{
|
|
857
|
+
type: Component,
|
|
858
|
+
args: [{ selector: 'sa-tabs', standalone: true, imports: [NgFor, NgIf], template: "<div class=\"tab-wrapper {{type}}\">\n <div class=\"tabs\">\n <div *ngFor=\"let item of tabs, let i = index\" class=\"tab-item\">\n <input [checked]=\"(defaultTab == i) ? true : false\" [value]=\"i\" (change)=\"tabChange($event)\"\n id=\"tab-check-{{i}}-{{uuid}}\" class=\"tab-checks\" type=\"radio\" name=\"tab-checkbox-{{uuid}}\">\n <label for=\"tab-check-{{i}}-{{uuid}}\" class=\"tab-label\">\n <div *ngIf=\"item.iconPosition == 'left' || item.iconPosition == 'both'\" class=\"svg-icon\" [style]=\"svgStyle[i]\">\n </div>\n {{item.tabName}}\n <div *ngIf=\"item.iconPosition == 'right' || item.iconPosition == 'both'\" class=\"svg-icon\" [style]=\"svgStyle[i]\">\n </div>\n <div class=\"badge\" *ngIf=\"item.badgeContent\">{{item.badgeContent}}</div>\n </label>\n </div>\n </div>\n</div>\n", styles: [".box{--bg: var(--grey-50);--tab-bg: white;--border: none;--tab-border: none;--tab-border-radius: 2px;--icon-color: var(--text-mediumemphasis)}.inline{--bg: white;--tab-bg: white;--border: 1px solid var(--grey-50, #E9EAEB);--tab-border: var(--primary-500, #1B77E4);--tab-border-radius: none;--icon-color: var(--text-mediumemphasis)}.tab-wrapper{width:max-content;padding:var(--small-8px, 8px);background-color:var(--bg);border-radius:var(--Small-4px, 4px)}.tabs{display:flex;height:42px;gap:var(--small-8px, 8px);font-family:var(--font);border-bottom:var(--border)}.tab-item{display:flex;justify-content:center;align-items:center;gap:var(--small-8px, 8px)}.tab-label{display:flex;justify-content:center;align-items:center;gap:var(--small-4px, 4px);padding:var(--small-8px, 8px) var(--small-12px, 12px);border-bottom:none;transition:.1s;font-size:14px;font-style:normal;font-weight:500;line-height:20px;letter-spacing:.1px;color:var(--text-mediumemphasis);cursor:pointer}.tab-checks{display:none}.tab-checks:checked+label{background-color:var(--tab-bg);border-bottom:2px solid var(--tab-border);border-radius:var(--tab-border-radius);color:var(--primary-500);--icon-color: var(--primary-500) }.tab-checks:checked+label .badge{width:auto;height:auto;padding:var(--Small-4px, 4px) var(--Small-12px, 12px);border-radius:16px;font-size:12px;font-style:normal;font-weight:500;line-height:16px;letter-spacing:.5px}.badge{width:var(--small-8px);height:var(--small-8px);border-radius:var(--small-8px);background-color:var(--secondary-500, #FE8235);color:#fff;margin-left:var(--small-4px);overflow:hidden;transition:.25s;font-size:0}.svg-icon{height:16px;width:16px;-webkit-mask-size:contain;mask-size:contain;background-color:var(--icon-color)}\n"] }]
|
|
859
|
+
}], propDecorators: { tabs: [{
|
|
860
|
+
type: Input
|
|
861
|
+
}], type: [{
|
|
862
|
+
type: Input
|
|
863
|
+
}], defaultTab: [{
|
|
864
|
+
type: Input
|
|
865
|
+
}], tabChanged: [{
|
|
866
|
+
type: Output
|
|
867
|
+
}] } });
|
|
868
|
+
|
|
869
|
+
// import { AvatarComponent } from '../avatar/avatar.component';
|
|
870
|
+
class LeftNavComponent {
|
|
871
|
+
constructor(route, router) {
|
|
872
|
+
this.route = route;
|
|
873
|
+
this.router = router;
|
|
874
|
+
this.clickEvent = new EventEmitter();
|
|
875
|
+
}
|
|
876
|
+
ngOnInit() {
|
|
877
|
+
console.log(this.data.items);
|
|
878
|
+
if (!this.data.footerItems) {
|
|
879
|
+
this.data.footerItems = data.footerItems;
|
|
880
|
+
}
|
|
881
|
+
if (this.data?.items?.length) {
|
|
882
|
+
this.onNavItemClick(this.data.items[0], 0);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
setItemActive(index) {
|
|
886
|
+
try {
|
|
887
|
+
if (this.activeItem) {
|
|
888
|
+
this.activeItem.active = false;
|
|
889
|
+
}
|
|
890
|
+
if (this.data?.items?.length) {
|
|
891
|
+
this.activeItem = this.data.items[index];
|
|
892
|
+
this.activeItem.active = true;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
catch (e) {
|
|
896
|
+
console.log(e);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
onNavItemClick(item, index, event = null) {
|
|
900
|
+
console.log(item, index);
|
|
901
|
+
this.clickEvent.emit({
|
|
902
|
+
event,
|
|
903
|
+
type: 'NAV_ITEM_CLICK',
|
|
904
|
+
item
|
|
905
|
+
});
|
|
906
|
+
if (!item.disable && item.path) {
|
|
907
|
+
this.setItemActive(index);
|
|
908
|
+
this.router.navigate([item.path]);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
onFooterItemClick(item, index, event = null) {
|
|
912
|
+
this.clickEvent.emit({
|
|
913
|
+
event,
|
|
914
|
+
type: 'FOOTER_ITEM_CLICK',
|
|
915
|
+
item
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: LeftNavComponent, deps: [{ token: i1$3.ActivatedRoute }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
919
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.4", type: LeftNavComponent, isStandalone: true, selector: "sa-left-nav", inputs: { data: "data" }, outputs: { clickEvent: "click" }, ngImport: i0, template: "<div class=\"sa-left-nav\">\n\n <div class=\"sa-left-nav-container\">\n <div class=\"sa-left-nav-logo\">\n <!-- <span class=\"sa-logo\"></span> -->\n <sa-icon icon=\"saras_white\" size=\"40\"></sa-icon>\n </div>\n <div class=\"sa-left-nav-items\">\n @if(data && data.items && !!data.items.length){\n <div class=\"sa-left-nav-items-container\">\n <ng-container *ngFor=\"let item of data.items; let i = index\">\n <div class=\"sa-left-nav-item\" [ngClass]=\"item.active ? 'active' : '' \"\n (click)=\"onNavItemClick(item, i, $event)\">\n\n <sa-icon class=\"sa-left-nav-item-icon\" [icon]=\"item.icon\" size=\"24\" color=\"white\"></sa-icon>\n <!-- <span class=\"sa-left-nav-item-icon\"\n [ngStyle]=\"{ 'background-image': 'url(' + item.icon_url + ')' }\"></span> -->\n </div>\n </ng-container>\n </div>\n }\n </div>\n <div class=\"sa-left-nav-footer\">\n @if(data && data.footerItems && !!data.footerItems.length){\n <div class=\"sa-left-nav-footer-container\">\n <ng-container *ngFor=\"let item of data.footerItems; let i = index\">\n <div class=\"sa-left-nav-footer-item\" [ngClass]=\"item.active ? 'active' : '' \"\n (click)=\"onFooterItemClick(item, i, $event)\">\n @if(item.type === 'AVATAR'){\n <!-- <span class=\"sa-left-nav-footer-name\">ET</span> -->\n <sa-avatar altText=\"ET\" [imagePath]=\"''\" size=\"extra-small\"></sa-avatar>\n }@else{\n <sa-icon class=\"sa-left-nav-footer-icon\" [icon]=\"item.icon\" size=\"24\" color=\"white\"></sa-icon>\n <!-- <span class=\"sa-left-nav-footer-icon\"\n [ngStyle]=\"{ 'background-image': 'url(' + item.icon_url || '' + ')' }\"></span> -->\n }\n </div>\n </ng-container>\n </div>\n }\n </div>\n </div>\n\n <div class=\"sa-left-nav-content\">\n <ng-content></ng-content>\n </div>\n\n</div>", styles: [".sa-left-nav{height:calc(100vh - 32px);width:calc(100vw - 32px);padding:8px;display:flex}.sa-left-nav-logo{display:block;height:40px;width:40px;margin:auto;padding:20px 0;border-bottom:1px #fff solid;min-height:40px}.sa-logo{height:40px;width:20px;display:block;margin:auto;background-position:center;background:url('data:image/svg+xml,<svg viewBox=\"0 0 20 38\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15.5544 13.5489C15.5034 13.5489 15.4525 13.5489 15.4021 13.5458V13.5489C15.4021 13.5489 14.8606 13.5359 13.0068 13.5253C9.95959 13.4986 8.83176 14.762 8.47545 15.3415H8.46938C8.2094 15.8311 8.13711 16.4024 8.26664 16.9437L8.26299 16.9549C8.28242 17.0836 8.5665 18.5783 11.0255 18.5267C12.9965 18.4851 14.1753 18.3619 14.6506 18.3016C15.2478 18.1597 15.869 18.1613 16.4656 18.3063C17.0621 18.4513 17.6178 18.7357 18.0892 19.1373C18.5605 19.539 18.9347 20.0469 19.1824 20.6213C19.4302 21.1957 19.5448 21.8211 19.5173 22.4485C19.4897 23.0758 19.3208 23.6882 19.0238 24.2375C18.7267 24.7869 18.3095 25.2583 17.8049 25.615C17.3003 25.9717 16.7219 26.2039 16.1151 26.2935C15.5083 26.3831 14.8894 26.3276 14.307 26.1314C14.0163 26.063 13.6253 25.9623 13.0985 25.8162C9.93167 25.0272 8.19258 29.8974 8.19258 29.8974L8.18651 29.9017C7.9393 30.6023 7.5091 31.22 6.94278 31.6874C6.37647 32.1549 5.69576 32.4541 4.97485 32.5526C4.25393 32.6511 3.52045 32.545 2.85434 32.2459C2.18822 31.9468 1.61502 31.4662 1.1972 30.8565C0.779378 30.2467 0.532961 29.5312 0.484798 28.7878C0.436635 28.0445 0.588573 27.3019 0.924059 26.6409C1.25955 25.9799 1.76571 25.426 2.38739 25.0393C3.00908 24.6527 3.72244 24.4483 4.44974 24.4483C4.56628 24.4483 4.68101 24.4539 4.79513 24.4638C5.23461 24.4601 6.14816 24.4639 7.98498 24.4956C11.1208 24.5528 11.5409 23.0537 11.5815 22.44C11.5815 22.3822 11.5779 22.3244 11.5779 22.2666C11.5779 22.2411 11.5779 22.2162 11.5779 22.1913C11.5783 22.1889 11.5783 22.1863 11.5779 22.1839C11.5524 21.7349 11.3963 21.3039 11.1298 20.9465C10.8632 20.5891 10.4984 20.3215 10.0822 20.1781C8.53918 19.4942 4.66948 19.8007 4.66948 19.8007V19.7957C4.60392 19.799 4.53796 19.8007 4.47159 19.8007C3.91809 19.8001 3.37082 19.6811 2.86485 19.4512C2.35888 19.2214 1.90539 18.8857 1.53344 18.4659C1.1615 18.046 0.879303 17.5512 0.704954 17.0131C0.530606 16.475 0.467948 15.9056 0.521 15.3413C0.574053 14.7769 0.741643 14.2302 1.01303 13.7361C1.28441 13.2419 1.6536 12.8113 2.09693 12.4719C2.54026 12.1325 3.04794 11.8917 3.58743 11.7649C4.12692 11.6382 4.68631 11.6283 5.22975 11.7359C6.48742 11.8174 7.74991 11.7689 8.99809 11.591C11.0176 11.3367 11.4783 10.1573 11.5779 9.5125V9.47955C11.5779 8.6747 11.8109 7.88792 12.2474 7.21872C12.684 6.54951 13.3045 6.02792 14.0304 5.71992C14.7564 5.41192 15.5552 5.33133 16.3259 5.48835C17.0965 5.64537 17.8044 6.03294 18.3601 6.60205C18.9157 7.17117 19.2941 7.89627 19.4474 8.68565C19.6006 9.47503 19.522 10.2933 19.2213 11.0368C18.9206 11.7804 18.4114 12.416 17.758 12.8631C17.1047 13.3103 16.3366 13.5489 15.5508 13.5489H15.5544Z\" fill=\"white\"/>%0A<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.47607 9.04307C3.69031 9.04307 2.92219 8.80441 2.26885 8.35726C1.61551 7.91011 1.10629 7.27456 0.805595 6.53097C0.504895 5.78739 0.426219 4.96917 0.579514 4.17979C0.732809 3.3904 1.11119 2.66531 1.66681 2.09619C2.22243 1.52708 2.93033 1.13951 3.701 0.982491C4.47167 0.825473 5.27049 0.90606 5.99644 1.21406C6.72239 1.52206 7.34287 2.04365 7.77942 2.71286C8.21597 3.38206 8.44897 4.16884 8.44897 4.97369C8.44897 6.05295 8.0304 7.08802 7.28534 7.85118C6.54028 8.61434 5.52975 9.04307 4.47607 9.04307Z\" fill=\"white\"/>%0A<path d=\"M15.5314 37.0946C17.7252 37.0946 19.5037 35.2729 19.5037 33.0258C19.5037 30.7787 17.7252 28.957 15.5314 28.957C13.3375 28.957 11.5591 30.7787 11.5591 33.0258C11.5591 35.2729 13.3375 37.0946 15.5314 37.0946Z\" fill=\"white\"/>%0A</svg>%0A') no-repeat}.sa-left-nav-container{height:inherit;width:64px;background-color:var(--primary-900);border-radius:8px;padding:8px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-evenly}.sa-left-nav-items{flex:1;overflow-y:auto}.sa-left-nav-items-container{padding:40px 0;height:100%;overflow:auto;box-sizing:border-box}.sa-left-nav-item,.sa-left-nav-footer-item{height:40px;width:40px;margin:8px auto;cursor:pointer;border-radius:4px;display:flex;justify-content:center;align-items:center}.sa-left-nav-footer-item{margin:4px auto}.sa-left-nav-item:hover,.sa-left-nav-item.active,.sa-left-nav-footer-item.active,.sa-left-nav-footer-item:hover{background-color:var(--primary-500)}.sa-left-nav-item-name,.sa-left-nav-item-icon,.sa-left-nav-footer-icon,.sa-left-nav-footer-name{height:24px;width:24px;display:block}.sa-left-nav-item-name,mn.sa-left-nav-footer-name{display:flex;justify-content:center;align-items:center}.sa-left-nav-footer{min-height:fit-content;border-top:1px solid #fff}.sa-left-nav-content{width:calc(100% - 64px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: AvatarComponent, selector: "sa-avatar", inputs: ["id", "imagePath", "altText", "size"], outputs: ["onClickEvent", "onMouseInEvent", "onMouseOutEvent"] }, { kind: "component", type: IconComponent, selector: "sa-icon", inputs: ["icon", "size", "color"] }] }); }
|
|
920
|
+
}
|
|
921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: LeftNavComponent, decorators: [{
|
|
922
|
+
type: Component,
|
|
923
|
+
args: [{ selector: 'sa-left-nav', standalone: true, imports: [
|
|
924
|
+
CommonModule,
|
|
925
|
+
AvatarComponent,
|
|
926
|
+
IconComponent
|
|
927
|
+
], template: "<div class=\"sa-left-nav\">\n\n <div class=\"sa-left-nav-container\">\n <div class=\"sa-left-nav-logo\">\n <!-- <span class=\"sa-logo\"></span> -->\n <sa-icon icon=\"saras_white\" size=\"40\"></sa-icon>\n </div>\n <div class=\"sa-left-nav-items\">\n @if(data && data.items && !!data.items.length){\n <div class=\"sa-left-nav-items-container\">\n <ng-container *ngFor=\"let item of data.items; let i = index\">\n <div class=\"sa-left-nav-item\" [ngClass]=\"item.active ? 'active' : '' \"\n (click)=\"onNavItemClick(item, i, $event)\">\n\n <sa-icon class=\"sa-left-nav-item-icon\" [icon]=\"item.icon\" size=\"24\" color=\"white\"></sa-icon>\n <!-- <span class=\"sa-left-nav-item-icon\"\n [ngStyle]=\"{ 'background-image': 'url(' + item.icon_url + ')' }\"></span> -->\n </div>\n </ng-container>\n </div>\n }\n </div>\n <div class=\"sa-left-nav-footer\">\n @if(data && data.footerItems && !!data.footerItems.length){\n <div class=\"sa-left-nav-footer-container\">\n <ng-container *ngFor=\"let item of data.footerItems; let i = index\">\n <div class=\"sa-left-nav-footer-item\" [ngClass]=\"item.active ? 'active' : '' \"\n (click)=\"onFooterItemClick(item, i, $event)\">\n @if(item.type === 'AVATAR'){\n <!-- <span class=\"sa-left-nav-footer-name\">ET</span> -->\n <sa-avatar altText=\"ET\" [imagePath]=\"''\" size=\"extra-small\"></sa-avatar>\n }@else{\n <sa-icon class=\"sa-left-nav-footer-icon\" [icon]=\"item.icon\" size=\"24\" color=\"white\"></sa-icon>\n <!-- <span class=\"sa-left-nav-footer-icon\"\n [ngStyle]=\"{ 'background-image': 'url(' + item.icon_url || '' + ')' }\"></span> -->\n }\n </div>\n </ng-container>\n </div>\n }\n </div>\n </div>\n\n <div class=\"sa-left-nav-content\">\n <ng-content></ng-content>\n </div>\n\n</div>", styles: [".sa-left-nav{height:calc(100vh - 32px);width:calc(100vw - 32px);padding:8px;display:flex}.sa-left-nav-logo{display:block;height:40px;width:40px;margin:auto;padding:20px 0;border-bottom:1px #fff solid;min-height:40px}.sa-logo{height:40px;width:20px;display:block;margin:auto;background-position:center;background:url('data:image/svg+xml,<svg viewBox=\"0 0 20 38\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15.5544 13.5489C15.5034 13.5489 15.4525 13.5489 15.4021 13.5458V13.5489C15.4021 13.5489 14.8606 13.5359 13.0068 13.5253C9.95959 13.4986 8.83176 14.762 8.47545 15.3415H8.46938C8.2094 15.8311 8.13711 16.4024 8.26664 16.9437L8.26299 16.9549C8.28242 17.0836 8.5665 18.5783 11.0255 18.5267C12.9965 18.4851 14.1753 18.3619 14.6506 18.3016C15.2478 18.1597 15.869 18.1613 16.4656 18.3063C17.0621 18.4513 17.6178 18.7357 18.0892 19.1373C18.5605 19.539 18.9347 20.0469 19.1824 20.6213C19.4302 21.1957 19.5448 21.8211 19.5173 22.4485C19.4897 23.0758 19.3208 23.6882 19.0238 24.2375C18.7267 24.7869 18.3095 25.2583 17.8049 25.615C17.3003 25.9717 16.7219 26.2039 16.1151 26.2935C15.5083 26.3831 14.8894 26.3276 14.307 26.1314C14.0163 26.063 13.6253 25.9623 13.0985 25.8162C9.93167 25.0272 8.19258 29.8974 8.19258 29.8974L8.18651 29.9017C7.9393 30.6023 7.5091 31.22 6.94278 31.6874C6.37647 32.1549 5.69576 32.4541 4.97485 32.5526C4.25393 32.6511 3.52045 32.545 2.85434 32.2459C2.18822 31.9468 1.61502 31.4662 1.1972 30.8565C0.779378 30.2467 0.532961 29.5312 0.484798 28.7878C0.436635 28.0445 0.588573 27.3019 0.924059 26.6409C1.25955 25.9799 1.76571 25.426 2.38739 25.0393C3.00908 24.6527 3.72244 24.4483 4.44974 24.4483C4.56628 24.4483 4.68101 24.4539 4.79513 24.4638C5.23461 24.4601 6.14816 24.4639 7.98498 24.4956C11.1208 24.5528 11.5409 23.0537 11.5815 22.44C11.5815 22.3822 11.5779 22.3244 11.5779 22.2666C11.5779 22.2411 11.5779 22.2162 11.5779 22.1913C11.5783 22.1889 11.5783 22.1863 11.5779 22.1839C11.5524 21.7349 11.3963 21.3039 11.1298 20.9465C10.8632 20.5891 10.4984 20.3215 10.0822 20.1781C8.53918 19.4942 4.66948 19.8007 4.66948 19.8007V19.7957C4.60392 19.799 4.53796 19.8007 4.47159 19.8007C3.91809 19.8001 3.37082 19.6811 2.86485 19.4512C2.35888 19.2214 1.90539 18.8857 1.53344 18.4659C1.1615 18.046 0.879303 17.5512 0.704954 17.0131C0.530606 16.475 0.467948 15.9056 0.521 15.3413C0.574053 14.7769 0.741643 14.2302 1.01303 13.7361C1.28441 13.2419 1.6536 12.8113 2.09693 12.4719C2.54026 12.1325 3.04794 11.8917 3.58743 11.7649C4.12692 11.6382 4.68631 11.6283 5.22975 11.7359C6.48742 11.8174 7.74991 11.7689 8.99809 11.591C11.0176 11.3367 11.4783 10.1573 11.5779 9.5125V9.47955C11.5779 8.6747 11.8109 7.88792 12.2474 7.21872C12.684 6.54951 13.3045 6.02792 14.0304 5.71992C14.7564 5.41192 15.5552 5.33133 16.3259 5.48835C17.0965 5.64537 17.8044 6.03294 18.3601 6.60205C18.9157 7.17117 19.2941 7.89627 19.4474 8.68565C19.6006 9.47503 19.522 10.2933 19.2213 11.0368C18.9206 11.7804 18.4114 12.416 17.758 12.8631C17.1047 13.3103 16.3366 13.5489 15.5508 13.5489H15.5544Z\" fill=\"white\"/>%0A<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.47607 9.04307C3.69031 9.04307 2.92219 8.80441 2.26885 8.35726C1.61551 7.91011 1.10629 7.27456 0.805595 6.53097C0.504895 5.78739 0.426219 4.96917 0.579514 4.17979C0.732809 3.3904 1.11119 2.66531 1.66681 2.09619C2.22243 1.52708 2.93033 1.13951 3.701 0.982491C4.47167 0.825473 5.27049 0.90606 5.99644 1.21406C6.72239 1.52206 7.34287 2.04365 7.77942 2.71286C8.21597 3.38206 8.44897 4.16884 8.44897 4.97369C8.44897 6.05295 8.0304 7.08802 7.28534 7.85118C6.54028 8.61434 5.52975 9.04307 4.47607 9.04307Z\" fill=\"white\"/>%0A<path d=\"M15.5314 37.0946C17.7252 37.0946 19.5037 35.2729 19.5037 33.0258C19.5037 30.7787 17.7252 28.957 15.5314 28.957C13.3375 28.957 11.5591 30.7787 11.5591 33.0258C11.5591 35.2729 13.3375 37.0946 15.5314 37.0946Z\" fill=\"white\"/>%0A</svg>%0A') no-repeat}.sa-left-nav-container{height:inherit;width:64px;background-color:var(--primary-900);border-radius:8px;padding:8px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-evenly}.sa-left-nav-items{flex:1;overflow-y:auto}.sa-left-nav-items-container{padding:40px 0;height:100%;overflow:auto;box-sizing:border-box}.sa-left-nav-item,.sa-left-nav-footer-item{height:40px;width:40px;margin:8px auto;cursor:pointer;border-radius:4px;display:flex;justify-content:center;align-items:center}.sa-left-nav-footer-item{margin:4px auto}.sa-left-nav-item:hover,.sa-left-nav-item.active,.sa-left-nav-footer-item.active,.sa-left-nav-footer-item:hover{background-color:var(--primary-500)}.sa-left-nav-item-name,.sa-left-nav-item-icon,.sa-left-nav-footer-icon,.sa-left-nav-footer-name{height:24px;width:24px;display:block}.sa-left-nav-item-name,mn.sa-left-nav-footer-name{display:flex;justify-content:center;align-items:center}.sa-left-nav-footer{min-height:fit-content;border-top:1px solid #fff}.sa-left-nav-content{width:calc(100% - 64px)}\n"] }]
|
|
928
|
+
}], ctorParameters: () => [{ type: i1$3.ActivatedRoute }, { type: i1$3.Router }], propDecorators: { data: [{
|
|
929
|
+
type: Input,
|
|
930
|
+
args: ['data']
|
|
931
|
+
}], clickEvent: [{
|
|
932
|
+
type: Output,
|
|
933
|
+
args: ['click']
|
|
934
|
+
}] } });
|
|
935
|
+
var ILeftNavTypes;
|
|
936
|
+
(function (ILeftNavTypes) {
|
|
937
|
+
})(ILeftNavTypes || (ILeftNavTypes = {}));
|
|
938
|
+
const data = {
|
|
939
|
+
items: [{
|
|
940
|
+
title: 'Home',
|
|
941
|
+
icon: '',
|
|
942
|
+
disable: false,
|
|
943
|
+
tooltip: '',
|
|
944
|
+
relativePath: true,
|
|
945
|
+
path: 'home'
|
|
946
|
+
}, {
|
|
947
|
+
title: 'Pricing',
|
|
948
|
+
icon: '',
|
|
949
|
+
disable: true,
|
|
950
|
+
tooltip: '',
|
|
951
|
+
relativePath: true,
|
|
952
|
+
path: ''
|
|
953
|
+
}, {
|
|
954
|
+
title: '',
|
|
955
|
+
icon: '',
|
|
956
|
+
disable: true,
|
|
957
|
+
tooltip: '',
|
|
958
|
+
relativePath: true,
|
|
959
|
+
path: ''
|
|
960
|
+
}],
|
|
961
|
+
footerItems: [{
|
|
962
|
+
title: 'Help',
|
|
963
|
+
icon: 'chathelp',
|
|
964
|
+
disable: true,
|
|
965
|
+
tooltip: ''
|
|
966
|
+
}, {
|
|
967
|
+
title: 'Name',
|
|
968
|
+
disable: false,
|
|
969
|
+
tooltip: '',
|
|
970
|
+
type: 'AVATAR'
|
|
971
|
+
}, {
|
|
972
|
+
title: 'Chevron',
|
|
973
|
+
icon: 'doublechevron',
|
|
974
|
+
disable: true,
|
|
975
|
+
tooltip: ''
|
|
976
|
+
}]
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
function phoneNumberValidator(dependent) {
|
|
980
|
+
return (control) => {
|
|
981
|
+
const dependentFormControl = dependent ? control.parent?.get(dependent) : null;
|
|
982
|
+
if (dependentFormControl && !!dependentFormControl.value?.length) {
|
|
983
|
+
console.log('validator', dependentFormControl.value);
|
|
984
|
+
if (dependentFormControl.value[0].id === 0) {
|
|
985
|
+
if (!/^\+1[2-9]\d{2}[2-9]\d{6}$/.test(control.value)) {
|
|
986
|
+
return { invalid: 'invalid phone number' };
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
return null;
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
/*
|
|
994
|
+
export function workEmailValidation(): AsyncValidatorFn {
|
|
995
|
+
return (control: AbstractControl): Observable<ValidationErrors | null> => {
|
|
996
|
+
if (!control.value) {
|
|
997
|
+
return of(null); // No value to validate
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
!control.pending && control.markAsPending();
|
|
1001
|
+
// !control.touched && control.markAsTouched();
|
|
1002
|
+
// return of({ invalid: 'Enter your work email' });
|
|
1003
|
+
return of(null);
|
|
1004
|
+
return new Observable((ob) => {
|
|
1005
|
+
setTimeout(() => {
|
|
1006
|
+
if (control.value === 'sairaj@gmail.com')
|
|
1007
|
+
return ob.next(null)
|
|
1008
|
+
return ob.next({ invalid: 'This is not a workemail' });
|
|
1009
|
+
}, 500)
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
return of(control.value).pipe(
|
|
1013
|
+
delay(500), // Simulate network delay
|
|
1014
|
+
|
|
1015
|
+
map(value => {
|
|
1016
|
+
return of({ invalid: 'This is not a workemail' })//existingUsernames.includes(username) ? { usernameTaken: true } : null;
|
|
1017
|
+
})
|
|
1018
|
+
// catchError(() => of(null)) // Handle any errors
|
|
1019
|
+
);
|
|
1020
|
+
};
|
|
1021
|
+
}*/
|
|
1022
|
+
function getValidationMessage(errors) {
|
|
1023
|
+
if (errors) {
|
|
1024
|
+
if (errors['minlength']) {
|
|
1025
|
+
return `minimum ${errors['minlength']['requiredLength']} required`;
|
|
1026
|
+
}
|
|
1027
|
+
else if (errors['maxlength']) {
|
|
1028
|
+
return `maximum ${errors['maxlength']['requiredLength']} characters`;
|
|
1029
|
+
}
|
|
1030
|
+
else if (errors['required']) {
|
|
1031
|
+
return 'Input cannot be empty';
|
|
1032
|
+
}
|
|
1033
|
+
else if (errors['invalid']) {
|
|
1034
|
+
return errors['invalid'];
|
|
1035
|
+
}
|
|
1036
|
+
else if (errors['email']) {
|
|
1037
|
+
return 'Enter a valid email';
|
|
1038
|
+
}
|
|
1039
|
+
else if (errors['pattern']) {
|
|
1040
|
+
return 'Enter a valid phone number';
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
return 'Invalid input';
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
return 'Invalid input';
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
class FormInputComponent extends FieldType {
|
|
1050
|
+
constructor() {
|
|
1051
|
+
super();
|
|
1052
|
+
this.inputState = 'idle';
|
|
1053
|
+
this.inputVal = '';
|
|
1054
|
+
this.dependentVal = null;
|
|
1055
|
+
// dynamicIcon: DynamicIcon | null;
|
|
1056
|
+
// icon: IInputIcon | null;
|
|
1057
|
+
this.type = '';
|
|
1058
|
+
this.inputErrorText = 'invalid input';
|
|
1059
|
+
this.suppressOnBlur = false;
|
|
1060
|
+
this.predefinedValidators = {
|
|
1061
|
+
email: [Validators.email, Validators.required],
|
|
1062
|
+
password: [Validators.minLength(8), Validators.required],
|
|
1063
|
+
tel: [Validators.pattern('^[0-9 +\\-()]*$')]
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
ngOnInit() {
|
|
1067
|
+
this.inputVal = this.field.props['value'];
|
|
1068
|
+
this.formControl?.setValue(this.inputVal);
|
|
1069
|
+
this.params = this.field.props['params'];
|
|
1070
|
+
this.icon = this.field.props['icon'] || {};
|
|
1071
|
+
this.type = this.params?.type || '';
|
|
1072
|
+
// this.dynamicIcon = this.field.props['dynamicIcon'];
|
|
1073
|
+
this.setValidators();
|
|
1074
|
+
this.setDependents();
|
|
1075
|
+
this.formControl.statusChanges.subscribe((state) => {
|
|
1076
|
+
// console.log(state, this.formControl.pending, this.formControl.valid);
|
|
1077
|
+
});
|
|
1078
|
+
this.formControl.valueChanges.subscribe((val) => {
|
|
1079
|
+
this.formInput.nativeElement.value = val;
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
setValidators() {
|
|
1083
|
+
this.validators = this.params?.validators || [];
|
|
1084
|
+
this.asyncValidators = this.params?.asyncValidators || [];
|
|
1085
|
+
this.formControl?.setValidators([...(this.type ? this.predefinedValidators[this.type] || [] : []), ...this.validators]);
|
|
1086
|
+
if (this.asyncValidators)
|
|
1087
|
+
this.formControl?.setAsyncValidators(this.asyncValidators);
|
|
1088
|
+
}
|
|
1089
|
+
/*
|
|
1090
|
+
Assuming dependent field is a single select dropdown
|
|
1091
|
+
*/
|
|
1092
|
+
setDependents() {
|
|
1093
|
+
if (this.params?.dependent) {
|
|
1094
|
+
this.dependent = this.form.get([this.params?.dependent]);
|
|
1095
|
+
this.dependent?.valueChanges.subscribe((val) => {
|
|
1096
|
+
this.dependentVal = val.length ? val[0] : null;
|
|
1097
|
+
this.formControl.reset();
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
checkValidity(defaultInputState = 'focus') {
|
|
1102
|
+
if (this.formControl && !this.formControl.valid && this.formControl.touched && !this.formControl.pending) {
|
|
1103
|
+
this.inputState = 'invalid';
|
|
1104
|
+
this.inputErrorText = getValidationMessage(this.formControl.errors) || 'invalid input';
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
this.inputState = defaultInputState;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
onFocus() {
|
|
1111
|
+
if (this.formControl.valid)
|
|
1112
|
+
this.inputState = 'focus';
|
|
1113
|
+
}
|
|
1114
|
+
onBlur() {
|
|
1115
|
+
setTimeout(() => {
|
|
1116
|
+
if (!this.suppressOnBlur) {
|
|
1117
|
+
this.formControl.markAsTouched();
|
|
1118
|
+
this.checkValidity('idle');
|
|
1119
|
+
}
|
|
1120
|
+
this.suppressOnBlur = false;
|
|
1121
|
+
}, 200);
|
|
1122
|
+
}
|
|
1123
|
+
onInput(event) {
|
|
1124
|
+
if (this.params?.type === 'tel') {
|
|
1125
|
+
this.inputVal = this.inputVal.replace(/[^0-9()+\- ]/g, '');
|
|
1126
|
+
}
|
|
1127
|
+
this.formControl?.setValue(this.inputVal);
|
|
1128
|
+
this.checkValidity();
|
|
1129
|
+
if (this.params?.eventListener) {
|
|
1130
|
+
this.params?.eventListener({
|
|
1131
|
+
type: IInputEventType.INPUT_CHANGE,
|
|
1132
|
+
value: this.inputVal,
|
|
1133
|
+
formControl: this.formControl
|
|
1134
|
+
}).then(this.onFieldCallback.bind(this));
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
onInputFieldClick(event = 'input') {
|
|
1138
|
+
if (event === 'input' || event.target.classList.contains('sa-input-field')) {
|
|
1139
|
+
this.formInput.nativeElement.focus();
|
|
1140
|
+
if (this.params?.type !== 'email')
|
|
1141
|
+
setTimeout(() => {
|
|
1142
|
+
this.formInput.nativeElement.setSelectionRange(this.inputVal.length, this.inputVal.length);
|
|
1143
|
+
}, 10);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
inputIconClick() {
|
|
1147
|
+
if (this.params?.type === 'password') {
|
|
1148
|
+
this.suppressOnBlur = true;
|
|
1149
|
+
if (this.type === 'password') {
|
|
1150
|
+
this.type = 'text';
|
|
1151
|
+
this.icon.name = 'eye_filled';
|
|
1152
|
+
}
|
|
1153
|
+
else {
|
|
1154
|
+
this.type = 'password';
|
|
1155
|
+
this.icon.name = 'eye';
|
|
1156
|
+
}
|
|
1157
|
+
this.onInputFieldClick();
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
onFieldCallback(param) {
|
|
1161
|
+
console.log(this.icon, param.icon);
|
|
1162
|
+
this.icon = param.icon || this.icon;
|
|
1163
|
+
this.checkValidity();
|
|
1164
|
+
}
|
|
1165
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FormInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1166
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.4", type: FormInputComponent, isStandalone: true, selector: "sa-input", inputs: { icon: "icon" }, viewQueries: [{ propertyName: "formInput", first: true, predicate: ["formInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"sa-input\">\n @if(!!inputVal.length && !!params?.placeholder){\n <span class=\"sa-input-tag\">{{params?.placeholder}}</span>\n }\n <div class=\"sa-input-field\" [ngClass]=\"inputState\" (click)=\"onInputFieldClick($event)\">\n <input matInput [type]=\"type\" value=\"\" [pattern]=\"type==='tel' ? '[0-9]' : '' \"\n [placeholder]=\"params?.placeholder || '' \" (focus)=\"onFocus()\" (blur)=\"onBlur()\" (input)=\"onInput($event)\"\n [(ngModel)]=\"inputVal\" #formInput />\n @if(params?.type === 'password'){\n <sa-icon icon=\"eye\" size=\"24\" (click)=\"inputIconClick()\"\n [ngClass]=\"!icon.name || icon.name === 'eye' ? '' : 'hide'\"></sa-icon>\n <sa-icon icon=\"eye_filled\" size=\"24\" (click)=\"inputIconClick()\"\n [ngClass]=\"icon.name === 'eye_filled' ? '' : 'hide'\"></sa-icon>\n } @else if(icon.name){\n <sa-icon [icon]=\"icon.name\" [size]=\"icon.size || '24'\" [color]=\"icon.color || ''\"\n [ngClass]=\"icon.show ? '' : 'hide'\"></sa-icon>\n }\n\n\n <!-- <sa-icon [icon]=\"icon\" size=\"24\" (click)=\"inputIconClick()\"></sa-icon> -->\n </div>\n @if((inputState === 'invalid') || (params && params.supportText)){\n <div class=\"support-label\" [ngClass]=\"inputState === 'invalid' ? inputState : '' \">\n {{inputState === 'invalid' ? inputErrorText : params.supportText}}\n </div>\n }\n</div>", styles: ["*{--error-red: #e25c61 }.idle{--border: 1px solid var(--grey-50)}.focus{--border: 1px solid var(--primary-300)}.disabled,[disabled]{border:1px solid var(--grey-50)!important}.sa-input-field>input,.sa-input-field>input:focus-visible{--border: 1px solid var(--primary-300);border:none;outline:none}.sa-input-field:hover{--border: 1px solid var(--primary-300);--font-color: var(--text-highemphasis)}.sa-input-field>input:focus-visible~sa-icon,.sa-input-field:hover sa-icon{color:var(--primary-300)}.sa-input-field.invalid>input,.sa-input-field.invalid sa-icon{color:#e25c61!important}.sa-input-field.invalid{--border: 1px solid #e25c61}.sa-input{position:relative;padding:8px 0}.sa-input-field{width:100%;box-sizing:border-box;position:relative;display:inline-flex;padding:0px var(--small-12px);height:40px;justify-content:center;align-items:center;border:var(--border);border-radius:var(--small-4px);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;--font-color: var(--text-lowemphasis)}.sa-input-field input{width:inherit}.sa-input-tag{position:absolute;background:#fff;padding:2px 6px;top:-1px;left:12px;z-index:2;font-size:11px;font-weight:500;line-height:16px;letter-spacing:.5px;text-align:left;color:var(--text-lowemphasis)}.support-label{font-family:var(--font);font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:var(--small-4px) var(--small-16px) 0px var(--small-16px)}.support-label.invalid{color:var(--error-red)}.hide{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: IconComponent, selector: "sa-icon", inputs: ["icon", "size", "color"] }] }); }
|
|
1167
|
+
}
|
|
1168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FormInputComponent, decorators: [{
|
|
1169
|
+
type: Component,
|
|
1170
|
+
args: [{ selector: 'sa-input', standalone: true, imports: [
|
|
1171
|
+
CommonModule,
|
|
1172
|
+
FormsModule,
|
|
1173
|
+
ReactiveFormsModule,
|
|
1174
|
+
FormlyModule,
|
|
1175
|
+
IconComponent
|
|
1176
|
+
], template: "<div class=\"sa-input\">\n @if(!!inputVal.length && !!params?.placeholder){\n <span class=\"sa-input-tag\">{{params?.placeholder}}</span>\n }\n <div class=\"sa-input-field\" [ngClass]=\"inputState\" (click)=\"onInputFieldClick($event)\">\n <input matInput [type]=\"type\" value=\"\" [pattern]=\"type==='tel' ? '[0-9]' : '' \"\n [placeholder]=\"params?.placeholder || '' \" (focus)=\"onFocus()\" (blur)=\"onBlur()\" (input)=\"onInput($event)\"\n [(ngModel)]=\"inputVal\" #formInput />\n @if(params?.type === 'password'){\n <sa-icon icon=\"eye\" size=\"24\" (click)=\"inputIconClick()\"\n [ngClass]=\"!icon.name || icon.name === 'eye' ? '' : 'hide'\"></sa-icon>\n <sa-icon icon=\"eye_filled\" size=\"24\" (click)=\"inputIconClick()\"\n [ngClass]=\"icon.name === 'eye_filled' ? '' : 'hide'\"></sa-icon>\n } @else if(icon.name){\n <sa-icon [icon]=\"icon.name\" [size]=\"icon.size || '24'\" [color]=\"icon.color || ''\"\n [ngClass]=\"icon.show ? '' : 'hide'\"></sa-icon>\n }\n\n\n <!-- <sa-icon [icon]=\"icon\" size=\"24\" (click)=\"inputIconClick()\"></sa-icon> -->\n </div>\n @if((inputState === 'invalid') || (params && params.supportText)){\n <div class=\"support-label\" [ngClass]=\"inputState === 'invalid' ? inputState : '' \">\n {{inputState === 'invalid' ? inputErrorText : params.supportText}}\n </div>\n }\n</div>", styles: ["*{--error-red: #e25c61 }.idle{--border: 1px solid var(--grey-50)}.focus{--border: 1px solid var(--primary-300)}.disabled,[disabled]{border:1px solid var(--grey-50)!important}.sa-input-field>input,.sa-input-field>input:focus-visible{--border: 1px solid var(--primary-300);border:none;outline:none}.sa-input-field:hover{--border: 1px solid var(--primary-300);--font-color: var(--text-highemphasis)}.sa-input-field>input:focus-visible~sa-icon,.sa-input-field:hover sa-icon{color:var(--primary-300)}.sa-input-field.invalid>input,.sa-input-field.invalid sa-icon{color:#e25c61!important}.sa-input-field.invalid{--border: 1px solid #e25c61}.sa-input{position:relative;padding:8px 0}.sa-input-field{width:100%;box-sizing:border-box;position:relative;display:inline-flex;padding:0px var(--small-12px);height:40px;justify-content:center;align-items:center;border:var(--border);border-radius:var(--small-4px);font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;--font-color: var(--text-lowemphasis)}.sa-input-field input{width:inherit}.sa-input-tag{position:absolute;background:#fff;padding:2px 6px;top:-1px;left:12px;z-index:2;font-size:11px;font-weight:500;line-height:16px;letter-spacing:.5px;text-align:left;color:var(--text-lowemphasis)}.support-label{font-family:var(--font);font-size:11px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:.5px;color:var(--text-lowemphasis);padding:var(--small-4px) var(--small-16px) 0px var(--small-16px)}.support-label.invalid{color:var(--error-red)}.hide{display:none}\n"] }]
|
|
1177
|
+
}], ctorParameters: () => [], propDecorators: { formInput: [{
|
|
1178
|
+
type: ViewChild,
|
|
1179
|
+
args: ['formInput']
|
|
1180
|
+
}], icon: [{
|
|
1181
|
+
type: Input,
|
|
1182
|
+
args: ['icon']
|
|
1183
|
+
}] } });
|
|
1184
|
+
var IInputEventType;
|
|
1185
|
+
(function (IInputEventType) {
|
|
1186
|
+
IInputEventType["INPUT_CHANGE"] = "INPUT_CHANGE";
|
|
1187
|
+
IInputEventType["STATE_CHANGE"] = "STATE_CHANGE";
|
|
1188
|
+
IInputEventType["ICON_CLICK"] = "ICON_CLICK";
|
|
1189
|
+
})(IInputEventType || (IInputEventType = {}));
|
|
1190
|
+
|
|
1191
|
+
class CardComponent {
|
|
1192
|
+
constructor() {
|
|
1193
|
+
this.title = '';
|
|
1194
|
+
this.chip = null;
|
|
1195
|
+
this.body = '';
|
|
1196
|
+
this.avatar = '';
|
|
1197
|
+
this.icon = '';
|
|
1198
|
+
this.column = false;
|
|
1199
|
+
this.cardStyles = {};
|
|
1200
|
+
}
|
|
1201
|
+
ngOnChanges(changes) {
|
|
1202
|
+
if (changes['width']?.currentValue) {
|
|
1203
|
+
this.cardStyles['width'] = typeof changes['width']?.currentValue === 'string' ? changes['width']?.currentValue : changes['width']?.currentValue + '%';
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.4", type: CardComponent, isStandalone: true, selector: "sa-card", inputs: { title: "title", chip: "chip", body: "body", avatar: "avatar", icon: "icon", iconSize: "iconSize", width: "width", column: "column" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"sa-card\" [ngStyle]=\"cardStyles\">\n <div class=\"sa-card-wrapper\" [ngClass]=\"column ? 'column' : ''\">\n <div class=\"\" [ngClass]=\"avatar ? 'sa-card-img' : 'sa-card-icon'\">\n @if(avatar){\n <img [src]=\"avatar\" />\n }@else if(icon){\n <sa-icon [icon]=\"icon\" [size]=\"iconSize\"></sa-icon>\n }@else{\n <ng-content select=\"sa-card-icon\"></ng-content>\n }\n @if(column){\n <ng-content select=\"sa-card-title-actions\"></ng-content>\n }\n </div>\n <div class=\"sa-card-container\">\n @if(title){\n <div class=\"sa-card-title-container\">\n <div class=\"sa-card-title\">{{title}}</div>\n @if(chip){\n <sa-chip [text]=\"chip.text\" [type]=\"chip.type\" [state]=\"chip.state\"></sa-chip>\n }\n <ng-content select=\"sa-card-title-actions\"></ng-content>\n\n </div>\n }\n @if(body){\n <div class=\"sa-card-body\">\n {{body}}\n </div>\n }\n <ng-content select=\"sa-card-footer-actions\"></ng-content>\n </div>\n </div>\n</div>", styles: ["*{font-family:var(--font)}.sa-card-wrapper{display:flex;border:1px solid var(--grey-50);border-radius:6px;padding:12px;background:var(--structural-white)}.sa-card-wrapper.column{flex-direction:column}.sa-card-img,.sa-card-icon{margin-right:12px}.column .sa-card-img,.column .sa-card-icon{margin:0 0 12px;display:flex;justify-content:space-between}.sa-card-img img{height:auto;width:200px}.sa-card-icon span{background-repeat:no-repeat;background-size:cover;background-position:center;display:block;height:24px;width:24px}.sa-card-container{display:flex;flex-direction:column;justify-content:space-between;width:-webkit-fill-available}.sa-card-title-container{display:flex;justify-content:space-between}.column .sa-card-title-container{flex-direction:column;margin-bottom:8px}.sa-card-title{font-size:16px;font-weight:600;line-height:24px;margin-bottom:4px}.sa-card-body{font-size:14px;font-weight:400;line-height:20px;letter-spacing:.25px;text-align:left;color:var(--grey-300);flex:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: ChipsComponent, selector: "sa-chip", inputs: ["id", "iconPath", "text", "type", "state", "filling", "iconPosition", "largeStateIcon", "largeStateText"], outputs: ["onClickEvent"] }, { kind: "component", type: IconComponent, selector: "sa-icon", inputs: ["icon", "size", "color"] }] }); }
|
|
1208
|
+
}
|
|
1209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardComponent, decorators: [{
|
|
1210
|
+
type: Component,
|
|
1211
|
+
args: [{ selector: 'sa-card', standalone: true, imports: [CommonModule, ChipsComponent, IconComponent], template: "<div class=\"sa-card\" [ngStyle]=\"cardStyles\">\n <div class=\"sa-card-wrapper\" [ngClass]=\"column ? 'column' : ''\">\n <div class=\"\" [ngClass]=\"avatar ? 'sa-card-img' : 'sa-card-icon'\">\n @if(avatar){\n <img [src]=\"avatar\" />\n }@else if(icon){\n <sa-icon [icon]=\"icon\" [size]=\"iconSize\"></sa-icon>\n }@else{\n <ng-content select=\"sa-card-icon\"></ng-content>\n }\n @if(column){\n <ng-content select=\"sa-card-title-actions\"></ng-content>\n }\n </div>\n <div class=\"sa-card-container\">\n @if(title){\n <div class=\"sa-card-title-container\">\n <div class=\"sa-card-title\">{{title}}</div>\n @if(chip){\n <sa-chip [text]=\"chip.text\" [type]=\"chip.type\" [state]=\"chip.state\"></sa-chip>\n }\n <ng-content select=\"sa-card-title-actions\"></ng-content>\n\n </div>\n }\n @if(body){\n <div class=\"sa-card-body\">\n {{body}}\n </div>\n }\n <ng-content select=\"sa-card-footer-actions\"></ng-content>\n </div>\n </div>\n</div>", styles: ["*{font-family:var(--font)}.sa-card-wrapper{display:flex;border:1px solid var(--grey-50);border-radius:6px;padding:12px;background:var(--structural-white)}.sa-card-wrapper.column{flex-direction:column}.sa-card-img,.sa-card-icon{margin-right:12px}.column .sa-card-img,.column .sa-card-icon{margin:0 0 12px;display:flex;justify-content:space-between}.sa-card-img img{height:auto;width:200px}.sa-card-icon span{background-repeat:no-repeat;background-size:cover;background-position:center;display:block;height:24px;width:24px}.sa-card-container{display:flex;flex-direction:column;justify-content:space-between;width:-webkit-fill-available}.sa-card-title-container{display:flex;justify-content:space-between}.column .sa-card-title-container{flex-direction:column;margin-bottom:8px}.sa-card-title{font-size:16px;font-weight:600;line-height:24px;margin-bottom:4px}.sa-card-body{font-size:14px;font-weight:400;line-height:20px;letter-spacing:.25px;text-align:left;color:var(--grey-300);flex:1}\n"] }]
|
|
1212
|
+
}], propDecorators: { title: [{
|
|
1213
|
+
type: Input,
|
|
1214
|
+
args: ['title']
|
|
1215
|
+
}], chip: [{
|
|
1216
|
+
type: Input,
|
|
1217
|
+
args: ['chip']
|
|
1218
|
+
}], body: [{
|
|
1219
|
+
type: Input,
|
|
1220
|
+
args: ['body']
|
|
1221
|
+
}], avatar: [{
|
|
1222
|
+
type: Input,
|
|
1223
|
+
args: ['avatar']
|
|
1224
|
+
}], icon: [{
|
|
1225
|
+
type: Input,
|
|
1226
|
+
args: ['icon']
|
|
1227
|
+
}], iconSize: [{
|
|
1228
|
+
type: Input,
|
|
1229
|
+
args: ['iconSize']
|
|
1230
|
+
}], width: [{
|
|
1231
|
+
type: Input,
|
|
1232
|
+
args: ['width']
|
|
1233
|
+
}], column: [{
|
|
1234
|
+
type: Input,
|
|
1235
|
+
args: ['column']
|
|
1236
|
+
}] } });
|
|
1237
|
+
|
|
1238
|
+
class CardIconComponent {
|
|
1239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1240
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: CardIconComponent, isStandalone: true, selector: "sa-card-icon", ngImport: i0, template: "<ng-content></ng-content>", styles: [""] }); }
|
|
1241
|
+
}
|
|
1242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardIconComponent, decorators: [{
|
|
1243
|
+
type: Component,
|
|
1244
|
+
args: [{ selector: 'sa-card-icon', standalone: true, imports: [], template: "<ng-content></ng-content>" }]
|
|
1245
|
+
}] });
|
|
1246
|
+
|
|
1247
|
+
class CardFooterActionsComponent {
|
|
1248
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardFooterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1249
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: CardFooterActionsComponent, isStandalone: true, selector: "sa-card-footer-actions", ngImport: i0, template: "<div class=\"sa-card-footer-actions\">\n <ng-content></ng-content>\n</div>", styles: [".sa-card-footer-actions{display:flex;justify-content:end}\n"] }); }
|
|
1250
|
+
}
|
|
1251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardFooterActionsComponent, decorators: [{
|
|
1252
|
+
type: Component,
|
|
1253
|
+
args: [{ selector: 'sa-card-footer-actions', standalone: true, imports: [], template: "<div class=\"sa-card-footer-actions\">\n <ng-content></ng-content>\n</div>", styles: [".sa-card-footer-actions{display:flex;justify-content:end}\n"] }]
|
|
1254
|
+
}] });
|
|
1255
|
+
|
|
1256
|
+
class CardTitleActionsComponent {
|
|
1257
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardTitleActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1258
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: CardTitleActionsComponent, isStandalone: true, selector: "sa-card-title-actions", ngImport: i0, template: "<div class=\"sa-card-title-actions\"><ng-content></ng-content></div>", styles: [".sa-card-title-actions{margin-bottom:8px}\n"] }); }
|
|
1259
|
+
}
|
|
1260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: CardTitleActionsComponent, decorators: [{
|
|
1261
|
+
type: Component,
|
|
1262
|
+
args: [{ selector: 'sa-card-title-actions', standalone: true, imports: [], template: "<div class=\"sa-card-title-actions\"><ng-content></ng-content></div>", styles: [".sa-card-title-actions{margin-bottom:8px}\n"] }]
|
|
1263
|
+
}] });
|
|
1264
|
+
|
|
1265
|
+
/*
|
|
1266
|
+
* Public API Surface of component-library
|
|
1267
|
+
*/
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Generated bundle index. Do not edit.
|
|
1271
|
+
*/
|
|
1272
|
+
|
|
1273
|
+
export { AvatarComponent, ButtonComponent, CardComponent, CardFooterActionsComponent, CardIconComponent, CardTitleActionsComponent, ChipsComponent, DatepickerComponent, FormInputComponent, FormSelectComponent, GridCellComponent, HeaderComponent, IInputEventType, ILeftNavTypes, IconComponent, LeftNavComponent, StepperComponent, TabsComponent, TestLibraryComponent, TestLibraryService, ToastComponent, ToolTipComponent };
|
|
1274
|
+
//# sourceMappingURL=sarasanalytics-com-design-system.mjs.map
|