@spicainternational/ngx-sds-components 2.5.2 → 2.5.3
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/esm2020/src/lib/app-switcher/app-switcher.module.mjs +8 -5
- package/esm2020/src/lib/avatar/avatar.module.mjs +8 -5
- package/esm2020/src/lib/color-picker/color-picker.module.mjs +8 -5
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-app-switcher.mjs +7 -3
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-app-switcher.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-avatar.mjs +7 -3
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-avatar.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-color-picker.mjs +7 -3
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-color-picker.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-app-switcher.mjs +7 -3
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-app-switcher.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-avatar.mjs +7 -3
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-avatar.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-color-picker.mjs +7 -3
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-color-picker.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4,16 +4,18 @@ import { SdsAppSwitcherComponent } from './app-switcher.component';
|
|
|
4
4
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
5
5
|
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "ngx-bootstrap/dropdown";
|
|
8
7
|
export class SdsAppSwitcherModule {
|
|
9
8
|
}
|
|
10
9
|
SdsAppSwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
10
|
SdsAppSwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, declarations: [SdsAppSwitcherComponent], imports: [CommonModule,
|
|
12
|
-
FontAwesomeModule,
|
|
11
|
+
FontAwesomeModule,
|
|
12
|
+
// BsDropdownModule.forRoot()
|
|
13
|
+
BsDropdownModule], exports: [SdsAppSwitcherComponent] });
|
|
13
14
|
SdsAppSwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, imports: [[
|
|
14
15
|
CommonModule,
|
|
15
16
|
FontAwesomeModule,
|
|
16
|
-
BsDropdownModule.forRoot()
|
|
17
|
+
// BsDropdownModule.forRoot()
|
|
18
|
+
BsDropdownModule
|
|
17
19
|
]] });
|
|
18
20
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, decorators: [{
|
|
19
21
|
type: NgModule,
|
|
@@ -24,11 +26,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
24
26
|
imports: [
|
|
25
27
|
CommonModule,
|
|
26
28
|
FontAwesomeModule,
|
|
27
|
-
BsDropdownModule.forRoot()
|
|
29
|
+
// BsDropdownModule.forRoot()
|
|
30
|
+
BsDropdownModule
|
|
28
31
|
],
|
|
29
32
|
exports: [
|
|
30
33
|
SdsAppSwitcherComponent
|
|
31
34
|
]
|
|
32
35
|
}]
|
|
33
36
|
}] });
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLXN3aXRjaGVyLm1vZHVsZS5qcyIsInNvdXJjZV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dAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcclxuaW1wb3J0IHsgU2RzQXBwU3dpdGNoZXJDb21wb25lbnQgfSBmcm9tICcuL2FwcC1zd2l0Y2hlci5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBGb250QXdlc29tZU1vZHVsZSB9IGZyb20gJ0Bmb3J0YXdlc29tZS9hbmd1bGFyLWZvbnRhd2Vzb21lJztcclxuaW1wb3J0IHsgQnNEcm9wZG93bk1vZHVsZSB9IGZyb20gJ25neC1ib290c3RyYXAvZHJvcGRvd24nO1xyXG5cclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgZGVjbGFyYXRpb25zOiBbXHJcbiAgICBTZHNBcHBTd2l0Y2hlckNvbXBvbmVudFxyXG4gIF0sXHJcbiAgaW1wb3J0czogW1xyXG4gICAgQ29tbW9uTW9kdWxlLFxyXG4gICAgRm9udEF3ZXNvbWVNb2R1bGUsXHJcbiAgICAvLyBCc0Ryb3Bkb3duTW9kdWxlLmZvclJvb3QoKVxyXG4gICAgQnNEcm9wZG93bk1vZHVsZVxyXG4gIF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgICBTZHNBcHBTd2l0Y2hlckNvbXBvbmVudFxyXG4gIF1cclxufSlcclxuZXhwb3J0IGNsYXNzIFNkc0FwcFN3aXRjaGVyTW9kdWxlIHsgfVxyXG4iXX0=
|
|
@@ -4,7 +4,6 @@ import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
|
4
4
|
import { SdsAvatarComponent } from './avatar.component';
|
|
5
5
|
import { SdsAvatarGroupComponent } from './avatar-group.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "ngx-bootstrap/popover";
|
|
8
7
|
const components = [
|
|
9
8
|
SdsAvatarComponent,
|
|
10
9
|
SdsAvatarGroupComponent
|
|
@@ -13,11 +12,14 @@ export class SdsAvatarModule {
|
|
|
13
12
|
}
|
|
14
13
|
SdsAvatarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
15
14
|
SdsAvatarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, declarations: [SdsAvatarComponent,
|
|
16
|
-
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
15
|
+
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
16
|
+
// PopoverModule.forRoot()
|
|
17
|
+
PopoverModule], exports: [SdsAvatarComponent,
|
|
17
18
|
SdsAvatarGroupComponent] });
|
|
18
19
|
SdsAvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, imports: [[
|
|
19
20
|
CommonModule,
|
|
20
|
-
PopoverModule.forRoot()
|
|
21
|
+
// PopoverModule.forRoot()
|
|
22
|
+
PopoverModule
|
|
21
23
|
]] });
|
|
22
24
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, decorators: [{
|
|
23
25
|
type: NgModule,
|
|
@@ -27,11 +29,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
27
29
|
],
|
|
28
30
|
imports: [
|
|
29
31
|
CommonModule,
|
|
30
|
-
PopoverModule.forRoot()
|
|
32
|
+
// PopoverModule.forRoot()
|
|
33
|
+
PopoverModule
|
|
31
34
|
],
|
|
32
35
|
exports: [
|
|
33
36
|
...components
|
|
34
37
|
]
|
|
35
38
|
}]
|
|
36
39
|
}] });
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGF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ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XHJcblxyXG5pbXBvcnQgeyBQb3BvdmVyTW9kdWxlIH0gZnJvbSAnbmd4LWJvb3RzdHJhcC9wb3BvdmVyJztcclxuXHJcbmltcG9ydCB7IFNkc0F2YXRhckNvbXBvbmVudCB9IGZyb20gJy4vYXZhdGFyLmNvbXBvbmVudCc7XHJcbmltcG9ydCB7IFNkc0F2YXRhckdyb3VwQ29tcG9uZW50IH0gZnJvbSAnLi9hdmF0YXItZ3JvdXAuY29tcG9uZW50JztcclxuXHJcblxyXG5jb25zdCBjb21wb25lbnRzID0gW1xyXG4gICAgU2RzQXZhdGFyQ29tcG9uZW50LFxyXG4gICAgU2RzQXZhdGFyR3JvdXBDb21wb25lbnRcclxuXTtcclxuQE5nTW9kdWxlKHtcclxuICBkZWNsYXJhdGlvbnM6IFtcclxuICAgIC4uLmNvbXBvbmVudHNcclxuICBdLFxyXG4gIGltcG9ydHM6IFtcclxuICAgIENvbW1vbk1vZHVsZSxcclxuICAgIC8vIFBvcG92ZXJNb2R1bGUuZm9yUm9vdCgpXHJcbiAgICBQb3BvdmVyTW9kdWxlXHJcblxyXG4gIF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgICAuLi5jb21wb25lbnRzXHJcbiAgXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgU2RzQXZhdGFyTW9kdWxlIHsgfVxyXG4iXX0=
|
|
@@ -4,17 +4,19 @@ import { SdsColorPickerComponent } from './color-picker.component';
|
|
|
4
4
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
5
5
|
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "ngx-bootstrap/dropdown";
|
|
8
7
|
const components = [SdsColorPickerComponent];
|
|
9
8
|
export class SdsColorPickerModule {
|
|
10
9
|
}
|
|
11
10
|
SdsColorPickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
11
|
SdsColorPickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, declarations: [SdsColorPickerComponent], imports: [CommonModule,
|
|
13
|
-
FontAwesomeModule,
|
|
12
|
+
FontAwesomeModule,
|
|
13
|
+
// BsDropdownModule.forRoot()
|
|
14
|
+
BsDropdownModule], exports: [SdsColorPickerComponent] });
|
|
14
15
|
SdsColorPickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, imports: [[
|
|
15
16
|
CommonModule,
|
|
16
17
|
FontAwesomeModule,
|
|
17
|
-
BsDropdownModule.forRoot()
|
|
18
|
+
// BsDropdownModule.forRoot()
|
|
19
|
+
BsDropdownModule
|
|
18
20
|
]] });
|
|
19
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, decorators: [{
|
|
20
22
|
type: NgModule,
|
|
@@ -25,11 +27,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
25
27
|
imports: [
|
|
26
28
|
CommonModule,
|
|
27
29
|
FontAwesomeModule,
|
|
28
|
-
BsDropdownModule.forRoot()
|
|
30
|
+
// BsDropdownModule.forRoot()
|
|
31
|
+
BsDropdownModule
|
|
29
32
|
],
|
|
30
33
|
exports: [
|
|
31
34
|
...components
|
|
32
35
|
]
|
|
33
36
|
}]
|
|
34
37
|
}] });
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
38
|
+
//# sourceMappingURL=data:application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IsZ0JBQWdCO3FCQUNqQjtvQkFDRCxPQUFPLEVBQUU7d0JBQ0wsR0FBRyxVQUFVO3FCQUNoQjtpQkFDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgU2RzQ29sb3JQaWNrZXJDb21wb25lbnQgfSBmcm9tICcuL2NvbG9yLXBpY2tlci5jb21wb25lbnQnO1xuaW1wb3J0IHsgRm9udEF3ZXNvbWVNb2R1bGUgfSBmcm9tICdAZm9ydGF3ZXNvbWUvYW5ndWxhci1mb250YXdlc29tZSc7XG5pbXBvcnQgeyBCc0Ryb3Bkb3duTW9kdWxlIH0gZnJvbSAnbmd4LWJvb3RzdHJhcC9kcm9wZG93bic7XG5cblxuY29uc3QgY29tcG9uZW50cyA9IFtTZHNDb2xvclBpY2tlckNvbXBvbmVudF07XG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtcbiAgICAuLi5jb21wb25lbnRzXG4gIF0sXG4gIGltcG9ydHM6IFtcbiAgICBDb21tb25Nb2R1bGUsXG4gICAgRm9udEF3ZXNvbWVNb2R1bGUsXG4gICAgLy8gQnNEcm9wZG93bk1vZHVsZS5mb3JSb290KClcbiAgICBCc0Ryb3Bkb3duTW9kdWxlXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICAgIC4uLmNvbXBvbmVudHNcbiAgXVxufSlcbmV4cG9ydCBjbGFzcyBTZHNDb2xvclBpY2tlck1vZHVsZSB7IH1cbiJdfQ==
|
|
@@ -69,11 +69,14 @@ class SdsAppSwitcherModule {
|
|
|
69
69
|
}
|
|
70
70
|
SdsAppSwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
71
71
|
SdsAppSwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, declarations: [SdsAppSwitcherComponent], imports: [CommonModule,
|
|
72
|
-
FontAwesomeModule,
|
|
72
|
+
FontAwesomeModule,
|
|
73
|
+
// BsDropdownModule.forRoot()
|
|
74
|
+
BsDropdownModule], exports: [SdsAppSwitcherComponent] });
|
|
73
75
|
SdsAppSwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, imports: [[
|
|
74
76
|
CommonModule,
|
|
75
77
|
FontAwesomeModule,
|
|
76
|
-
BsDropdownModule.forRoot()
|
|
78
|
+
// BsDropdownModule.forRoot()
|
|
79
|
+
BsDropdownModule
|
|
77
80
|
]] });
|
|
78
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, decorators: [{
|
|
79
82
|
type: NgModule,
|
|
@@ -84,7 +87,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
84
87
|
imports: [
|
|
85
88
|
CommonModule,
|
|
86
89
|
FontAwesomeModule,
|
|
87
|
-
BsDropdownModule.forRoot()
|
|
90
|
+
// BsDropdownModule.forRoot()
|
|
91
|
+
BsDropdownModule
|
|
88
92
|
],
|
|
89
93
|
exports: [
|
|
90
94
|
SdsAppSwitcherComponent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-app-switcher.mjs","sources":["../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.html","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.module.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/spicainternational-ngx-sds-components-src-lib-app-switcher.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\r\nimport { faGrid } from '@fortawesome/pro-solid-svg-icons';\r\n\r\nimport { ProductModel } from './app-switcher.model';\r\n\r\n@Component({\r\n selector: 'sds-app-switcher',\r\n templateUrl: './app-switcher.component.html',\r\n styleUrls: ['./app-switcher.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdsAppSwitcherComponent implements OnInit, OnChanges {\r\n \r\n @Input() public productCode: Number | undefined;\r\n @Input() public userProductCodes: Number[] | undefined;\r\n @Input() public tenantProducts: ProductModel[] | undefined;\r\n\r\n @Input() public switchText: string = '';\r\n @Input() public discoverText: string = '';\r\n\r\n @Output() public productClick: EventEmitter<ProductModel> = new EventEmitter();\r\n\r\n\r\n public activatedProducts: ProductModel[];\r\n public discoverProducts: ProductModel[];\r\n \r\n public showSkeleton: boolean;\r\n public selectorIcon = faGrid;\r\n \r\n\r\n constructor() {\r\n this.showSkeleton = true;\r\n this.activatedProducts = new Array<ProductModel>();\r\n this.discoverProducts = new Array<ProductModel>(); \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['userProductCodes'] || changes['tenantProducts'] || changes['productCode']) {\r\n if (this.userProductCodes !== undefined && this.tenantProducts !== undefined && this.productCode !== undefined) {\r\n this.activatedProducts = [];\r\n this.discoverProducts = [];\r\n\r\n this.tenantProducts.forEach(product => {\r\n if ((this.userProductCodes as Number[]).includes(product.code)) {\r\n // exclude current product from the list\r\n if (product.code != this.productCode) {\r\n this.activatedProducts.push(product);\r\n }\r\n } else {\r\n this.discoverProducts.push(product);\r\n }\r\n });\r\n this.showSkeleton = false;\r\n } else {\r\n this.showSkeleton = true;\r\n }\r\n }\r\n }\r\n\r\n public emitProductClick(product: ProductModel): void {\r\n this.productClick.emit(product);\r\n }\r\n\r\n}\r\n","<ng-template #productTemplate let-product=\"product\">\r\n <div class=\"product-logo\">\r\n <img [src]=\"product.logoUri\" alt=\"{{ product.Name }}\">\r\n </div>\r\n <div class=\"product-title d-flex align-items-center\">\r\n {{product.name}}\r\n </div>\r\n <div class=\"product-description\">\r\n {{product.description}}\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"btn-group app-switcher\" dropdown>\r\n <!-- id=\"button-basic\" -->\r\n <button \r\n dropdownToggle \r\n type=\"button\" \r\n class=\"btn btn-link rounded p-0 text-dark\"\r\n aria-controls=\"dropdown-basic\">\r\n <fa-icon \r\n [icon]=\"selectorIcon\" \r\n [fixedWidth]=\"true\">\r\n </fa-icon>\r\n </button>\r\n\r\n <div \r\n *dropdownMenu\r\n class=\"dropdown-menu\" \r\n role=\"menu\"\r\n aria-labelledby=\"app-switcher-button\">\r\n\r\n <ng-container *ngIf=\"showSkeleton\">\r\n <div class=\"dropdown-header skeleton skeleton-height-1 w-50 \"></div>\r\n <div class=\"dropdown-item product-container mt-2 skeleton skeleton-height-2\"></div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && activatedProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ switchText }}</h6>\r\n <a *ngFor=\"let activatedProduct of activatedProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(activatedProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: activatedProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && discoverProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ discoverText }}</h6>\r\n\r\n <a *ngFor=\"let discoverProduct of discoverProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(discoverProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: discoverProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n ","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsAppSwitcherComponent } from './app-switcher.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsAppSwitcherComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n BsDropdownModule.forRoot()\r\n ],\r\n exports: [\r\n SdsAppSwitcherComponent\r\n ]\r\n})\r\nexport class SdsAppSwitcherModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAWa,uBAAuB,CAAA;AAmBhC,IAAA,WAAA,GAAA;AAbgB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;AACxB,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE,CAAC;AAEzB,QAAA,IAAA,CAAA,YAAY,GAA+B,IAAI,YAAY,EAAE,CAAC;AAOxE,QAAA,IAAY,CAAA,YAAA,GAAG,MAAM,CAAC;AAIzB,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,KAAK,EAAgB,CAAC;AACnD,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,KAAK,EAAgB,CAAC;KACrD;AAED,IAAA,QAAQ,MAAW;AAEnB,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE;AACpF,YAAA,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE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A,CAAA;kBANnC,SAAS;+BACI,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,86EAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;0EAI/B,WAAW,EAAA,CAAA;sBAA1B,KAAK;gBACU,gBAAgB,EAAA,CAAA;sBAA/B,KAAK;gBACU,cAAc,EAAA,CAAA;sBAA7B,KAAK;gBAEU,UAAU,EAAA,CAAA;sBAAzB,KAAK;gBACU,YAAY,EAAA,CAAA;sBAA3B,KAAK;gBAEW,YAAY,EAAA,CAAA;sBAA5B,MAAM;;;
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-app-switcher.mjs","sources":["../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.html","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.module.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/spicainternational-ngx-sds-components-src-lib-app-switcher.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\r\nimport { faGrid } from '@fortawesome/pro-solid-svg-icons';\r\n\r\nimport { ProductModel } from './app-switcher.model';\r\n\r\n@Component({\r\n selector: 'sds-app-switcher',\r\n templateUrl: './app-switcher.component.html',\r\n styleUrls: ['./app-switcher.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdsAppSwitcherComponent implements OnInit, OnChanges {\r\n \r\n @Input() public productCode: Number | undefined;\r\n @Input() public userProductCodes: Number[] | undefined;\r\n @Input() public tenantProducts: ProductModel[] | undefined;\r\n\r\n @Input() public switchText: string = '';\r\n @Input() public discoverText: string = '';\r\n\r\n @Output() public productClick: EventEmitter<ProductModel> = new EventEmitter();\r\n\r\n\r\n public activatedProducts: ProductModel[];\r\n public discoverProducts: ProductModel[];\r\n \r\n public showSkeleton: boolean;\r\n public selectorIcon = faGrid;\r\n \r\n\r\n constructor() {\r\n this.showSkeleton = true;\r\n this.activatedProducts = new Array<ProductModel>();\r\n this.discoverProducts = new Array<ProductModel>(); \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['userProductCodes'] || changes['tenantProducts'] || changes['productCode']) {\r\n if (this.userProductCodes !== undefined && this.tenantProducts !== undefined && this.productCode !== undefined) {\r\n this.activatedProducts = [];\r\n this.discoverProducts = [];\r\n\r\n this.tenantProducts.forEach(product => {\r\n if ((this.userProductCodes as Number[]).includes(product.code)) {\r\n // exclude current product from the list\r\n if (product.code != this.productCode) {\r\n this.activatedProducts.push(product);\r\n }\r\n } else {\r\n this.discoverProducts.push(product);\r\n }\r\n });\r\n this.showSkeleton = false;\r\n } else {\r\n this.showSkeleton = true;\r\n }\r\n }\r\n }\r\n\r\n public emitProductClick(product: ProductModel): void {\r\n this.productClick.emit(product);\r\n }\r\n\r\n}\r\n","<ng-template #productTemplate let-product=\"product\">\r\n <div class=\"product-logo\">\r\n <img [src]=\"product.logoUri\" alt=\"{{ product.Name }}\">\r\n </div>\r\n <div class=\"product-title d-flex align-items-center\">\r\n {{product.name}}\r\n </div>\r\n <div class=\"product-description\">\r\n {{product.description}}\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"btn-group app-switcher\" dropdown>\r\n <!-- id=\"button-basic\" -->\r\n <button \r\n dropdownToggle \r\n type=\"button\" \r\n class=\"btn btn-link rounded p-0 text-dark\"\r\n aria-controls=\"dropdown-basic\">\r\n <fa-icon \r\n [icon]=\"selectorIcon\" \r\n [fixedWidth]=\"true\">\r\n </fa-icon>\r\n </button>\r\n\r\n <div \r\n *dropdownMenu\r\n class=\"dropdown-menu\" \r\n role=\"menu\"\r\n aria-labelledby=\"app-switcher-button\">\r\n\r\n <ng-container *ngIf=\"showSkeleton\">\r\n <div class=\"dropdown-header skeleton skeleton-height-1 w-50 \"></div>\r\n <div class=\"dropdown-item product-container mt-2 skeleton skeleton-height-2\"></div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && activatedProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ switchText }}</h6>\r\n <a *ngFor=\"let activatedProduct of activatedProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(activatedProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: activatedProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && discoverProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ discoverText }}</h6>\r\n\r\n <a *ngFor=\"let discoverProduct of discoverProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(discoverProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: discoverProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n ","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsAppSwitcherComponent } from './app-switcher.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsAppSwitcherComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n // BsDropdownModule.forRoot()\r\n BsDropdownModule\r\n ],\r\n exports: [\r\n SdsAppSwitcherComponent\r\n ]\r\n})\r\nexport class SdsAppSwitcherModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAWa,uBAAuB,CAAA;AAmBhC,IAAA,WAAA,GAAA;AAbgB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;AACxB,Q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GvB,YAAY;QACZ,iBAAiB;;QAEjB,gBAAgB,aAGd,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAGhB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAVtB,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,iBAAiB;;YAEjB,gBAAgB;SACjB,CAAA,EAAA,CAAA,CAAA;2FAKU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAdhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,uBAAuB;AACxB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,iBAAiB;;wBAEjB,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,uBAAuB;AAC1B,qBAAA;iBACF,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -150,11 +150,14 @@ class SdsAvatarModule {
|
|
|
150
150
|
}
|
|
151
151
|
SdsAvatarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
152
152
|
SdsAvatarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, declarations: [SdsAvatarComponent,
|
|
153
|
-
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
153
|
+
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
154
|
+
// PopoverModule.forRoot()
|
|
155
|
+
PopoverModule], exports: [SdsAvatarComponent,
|
|
154
156
|
SdsAvatarGroupComponent] });
|
|
155
157
|
SdsAvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, imports: [[
|
|
156
158
|
CommonModule,
|
|
157
|
-
PopoverModule.forRoot()
|
|
159
|
+
// PopoverModule.forRoot()
|
|
160
|
+
PopoverModule
|
|
158
161
|
]] });
|
|
159
162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, decorators: [{
|
|
160
163
|
type: NgModule,
|
|
@@ -164,7 +167,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
164
167
|
],
|
|
165
168
|
imports: [
|
|
166
169
|
CommonModule,
|
|
167
|
-
PopoverModule.forRoot()
|
|
170
|
+
// PopoverModule.forRoot()
|
|
171
|
+
PopoverModule
|
|
168
172
|
],
|
|
169
173
|
exports: [
|
|
170
174
|
...components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-avatar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar.module.ts","../../../projects/ngx-sds-components/src/lib/avatar/spicainternational-ngx-sds-components-src-lib-avatar.ts"],"sourcesContent":["import {\r\n AfterViewInit,\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sds-avatar',\r\n templateUrl: './avatar.component.html',\r\n styleUrls: ['./avatar.component.scss'],\r\n})\r\nexport class SdsAvatarComponent implements AfterViewInit, OnChanges {\r\n @Input() text: string = '';\r\n @Input() colorKey: string = '';\r\n @Input() pictureUri: string = '';\r\n @Input() showHint: boolean = false;\r\n @Input() borderStyle: 'solid' | 'dashed' | 'dotted' | 'none' = 'none';\r\n @Input() borderColor?: string;\r\n @Input() initialsText?: string;\r\n @Input() cursor?: string;\r\n\r\n public isPictureReady: boolean = false;\r\n public initials: string = '';\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit() {\r\n this.loadUserPicture();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (\r\n changes['text'] &&\r\n changes['text'].currentValue != changes['text'].previousValue &&\r\n this.initialsText == undefined\r\n ) {\r\n this.extractInitials();\r\n }\r\n\r\n if (\r\n changes['pictureUri'] &&\r\n changes['pictureUri'].currentValue !=\r\n changes['pictureUri'].previousValue\r\n ) {\r\n this.loadUserPicture();\r\n }\r\n\r\n if (changes['initialsText'] && this.initialsText) {\r\n this.initials = this.initialsText;\r\n }\r\n }\r\n\r\n public setColorClass(): string {\r\n if (this.colorKey) {\r\n return 'color' + this.getColorIndex(this.colorKey);\r\n }\r\n return 'color18';\r\n }\r\n\r\n private extractInitials(): void {\r\n this.initials = this.text\r\n ? this.text\r\n .toUpperCase()\r\n .split(' ')\r\n .map((n) => n[0])\r\n .slice(0, 2)\r\n .join('')\r\n : '';\r\n }\r\n\r\n private getColorIndex(s: string): number {\r\n const length = 10;\r\n if (!s) {\r\n return 0;\r\n }\r\n let sumOfChars = s\r\n .split('')\r\n .map((x) => x.charCodeAt(0))\r\n .reduce((a, b) => a + b, 0);\r\n return sumOfChars % length;\r\n }\r\n\r\n public loadUserPicture() {\r\n if (this.pictureUri && this.pictureUri !== '') {\r\n this.isPictureReady = true;\r\n } else {\r\n this.isPictureReady = false;\r\n }\r\n }\r\n}\r\n","<div\r\n class=\"avatar circle d-flex justify-content-center align-items-center\"\r\n [class.hasPicture]=\"isPictureReady\"\r\n [ngClass]=\"setColorClass()\"\r\n [title]=\"showHint ? text : ''\"\r\n [style.border-style]=\"borderStyle.toString()\"\r\n [style.border-color]=\"borderColor\"\r\n [style.cursor]=\"cursor ? cursor : 'default'\"\r\n>\r\n <span \r\n *ngIf=\"!isPictureReady\" \r\n class=\"initials\"\r\n >\r\n {{ initials }}\r\n </span>\r\n\r\n <img \r\n *ngIf=\"isPictureReady\" \r\n [src]=\"pictureUri\"\r\n alt=\"\" />\r\n</div>\r\n","import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { AvatarModel } from './avatar-group.model';\n\n@Component({\n selector: 'sds-avatar-group',\n templateUrl: './avatar-group.component.html',\n styleUrls: ['./avatar-group.component.scss'],\n})\nexport class SdsAvatarGroupComponent implements OnInit, OnChanges {\n @ViewChild('popover', {static: false}) private _popover: PopoverDirective | undefined;\n\n @Input() public stacked: boolean = false;\n @Input() public maxCount?: number;\n @Input() public fontSize: number = 2;\n @Input() public borderColor?: string;\n @Input() public data: Array<AvatarModel> = [];\n\n public overflow: Array<AvatarModel> = [];\n public inflow: Array<AvatarModel> = [];\n\n\n public overflowCountDisplay: string = '';\n public overFlowBorderStyle: 'solid' | 'none' = 'none';\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['data'] || changes['maxCount']){\n if (this.maxCount && this.data) {\n this.overflow = [...this.data];\n this.inflow = this.overflow.splice(0, this.maxCount);\n console.log(this.overflow.length);\n this.overflowCountDisplay = `+${Math.min(99, this.overflow.length)}`;\n this.overFlowBorderStyle = this.data.filter(x => x.borderStyle).length > 0 ? 'solid' : 'none';\n } else {\n this.inflow = [...this.data];\n }\n }\n }\n\n ngOnInit(): void {}\n\n public overflowAvatarClicked(event: MouseEvent) {\n this._popover?.show();\n }\n\n}\n","<div class=\"d-flex avatar-group-container\">\n <sds-avatar *ngFor=\"let avatar of inflow\"\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n [showHint]=\"true\"\n [style.font-size.rem]=\"fontSize\"\n [style.margin-right.rem]=\"stacked ? fontSize/-3 : fontSize/15\"\n >\n </sds-avatar>\n \n <sds-avatar \n *ngIf=\"overflow.length > 0\"\n class=\"overflow\"\n [initialsText]=\"overflowCountDisplay\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"overFlowBorderStyle\"\n cursor=\"pointer\"\n [style.font-size.rem]=\"fontSize\"\n\n [popover]=\"avatarGroupPopupTemplate\"\n placement=\"bottom\"\n [outsideClick]=\"true\"\n container=\"body\"\n triggers=\"\" \n #popover=\"bs-popover\"\n (click)=\"overflowAvatarClicked($event)\"\n >\n </sds-avatar>\n</div>\n\n<ng-template #avatarGroupPopupTemplate>\n <div class=\"overflow-avatars-container rounded\">\n <div *ngFor=\"let avatar of overflow\"\n class=\"d-flex align-items-center pl-3 py-2 pr-5 my-2 overflow-avatar-container\" >\n <sds-avatar\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n borderColor=\"transparent\"\n [style.font-size.rem]=\"1.8\" \n >\n </sds-avatar>\n <div class=\"ml-3\">{{avatar.text}}</div>\n </div>\n </div>\n</ng-template>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { PopoverModule } from 'ngx-bootstrap/popover';\r\n\r\nimport { SdsAvatarComponent } from './avatar.component';\r\nimport { SdsAvatarGroupComponent } from './avatar-group.component';\r\n\r\n\r\nconst components = [\r\n SdsAvatarComponent,\r\n SdsAvatarGroupComponent\r\n];\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n PopoverModule.forRoot()\r\n\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsAvatarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsAvatarComponent","i2","i1"],"mappings":";;;;;;;MAca,kBAAkB,CAAA;AAa3B,IAAA,WAA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;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-avatar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar.module.ts","../../../projects/ngx-sds-components/src/lib/avatar/spicainternational-ngx-sds-components-src-lib-avatar.ts"],"sourcesContent":["import {\r\n AfterViewInit,\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sds-avatar',\r\n templateUrl: './avatar.component.html',\r\n styleUrls: ['./avatar.component.scss'],\r\n})\r\nexport class SdsAvatarComponent implements AfterViewInit, OnChanges {\r\n @Input() text: string = '';\r\n @Input() colorKey: string = '';\r\n @Input() pictureUri: string = '';\r\n @Input() showHint: boolean = false;\r\n @Input() borderStyle: 'solid' | 'dashed' | 'dotted' | 'none' = 'none';\r\n @Input() borderColor?: string;\r\n @Input() initialsText?: string;\r\n @Input() cursor?: string;\r\n\r\n public isPictureReady: boolean = false;\r\n public initials: string = '';\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit() {\r\n this.loadUserPicture();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (\r\n changes['text'] &&\r\n changes['text'].currentValue != changes['text'].previousValue &&\r\n this.initialsText == undefined\r\n ) {\r\n this.extractInitials();\r\n }\r\n\r\n if (\r\n changes['pictureUri'] &&\r\n changes['pictureUri'].currentValue !=\r\n changes['pictureUri'].previousValue\r\n ) {\r\n this.loadUserPicture();\r\n }\r\n\r\n if (changes['initialsText'] && this.initialsText) {\r\n this.initials = this.initialsText;\r\n }\r\n }\r\n\r\n public setColorClass(): string {\r\n if (this.colorKey) {\r\n return 'color' + this.getColorIndex(this.colorKey);\r\n }\r\n return 'color18';\r\n }\r\n\r\n private extractInitials(): void {\r\n this.initials = this.text\r\n ? this.text\r\n .toUpperCase()\r\n .split(' ')\r\n .map((n) => n[0])\r\n .slice(0, 2)\r\n .join('')\r\n : '';\r\n }\r\n\r\n private getColorIndex(s: string): number {\r\n const length = 10;\r\n if (!s) {\r\n return 0;\r\n }\r\n let sumOfChars = s\r\n .split('')\r\n .map((x) => x.charCodeAt(0))\r\n .reduce((a, b) => a + b, 0);\r\n return sumOfChars % length;\r\n }\r\n\r\n public loadUserPicture() {\r\n if (this.pictureUri && this.pictureUri !== '') {\r\n this.isPictureReady = true;\r\n } else {\r\n this.isPictureReady = false;\r\n }\r\n }\r\n}\r\n","<div\r\n class=\"avatar circle d-flex justify-content-center align-items-center\"\r\n [class.hasPicture]=\"isPictureReady\"\r\n [ngClass]=\"setColorClass()\"\r\n [title]=\"showHint ? text : ''\"\r\n [style.border-style]=\"borderStyle.toString()\"\r\n [style.border-color]=\"borderColor\"\r\n [style.cursor]=\"cursor ? cursor : 'default'\"\r\n>\r\n <span \r\n *ngIf=\"!isPictureReady\" \r\n class=\"initials\"\r\n >\r\n {{ initials }}\r\n </span>\r\n\r\n <img \r\n *ngIf=\"isPictureReady\" \r\n [src]=\"pictureUri\"\r\n alt=\"\" />\r\n</div>\r\n","import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { AvatarModel } from './avatar-group.model';\n\n@Component({\n selector: 'sds-avatar-group',\n templateUrl: './avatar-group.component.html',\n styleUrls: ['./avatar-group.component.scss'],\n})\nexport class SdsAvatarGroupComponent implements OnInit, OnChanges {\n @ViewChild('popover', {static: false}) private _popover: PopoverDirective | undefined;\n\n @Input() public stacked: boolean = false;\n @Input() public maxCount?: number;\n @Input() public fontSize: number = 2;\n @Input() public borderColor?: string;\n @Input() public data: Array<AvatarModel> = [];\n\n public overflow: Array<AvatarModel> = [];\n public inflow: Array<AvatarModel> = [];\n\n\n public overflowCountDisplay: string = '';\n public overFlowBorderStyle: 'solid' | 'none' = 'none';\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['data'] || changes['maxCount']){\n if (this.maxCount && this.data) {\n this.overflow = [...this.data];\n this.inflow = this.overflow.splice(0, this.maxCount);\n console.log(this.overflow.length);\n this.overflowCountDisplay = `+${Math.min(99, this.overflow.length)}`;\n this.overFlowBorderStyle = this.data.filter(x => x.borderStyle).length > 0 ? 'solid' : 'none';\n } else {\n this.inflow = [...this.data];\n }\n }\n }\n\n ngOnInit(): void {}\n\n public overflowAvatarClicked(event: MouseEvent) {\n this._popover?.show();\n }\n\n}\n","<div class=\"d-flex avatar-group-container\">\n <sds-avatar *ngFor=\"let avatar of inflow\"\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n [showHint]=\"true\"\n [style.font-size.rem]=\"fontSize\"\n [style.margin-right.rem]=\"stacked ? fontSize/-3 : fontSize/15\"\n >\n </sds-avatar>\n \n <sds-avatar \n *ngIf=\"overflow.length > 0\"\n class=\"overflow\"\n [initialsText]=\"overflowCountDisplay\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"overFlowBorderStyle\"\n cursor=\"pointer\"\n [style.font-size.rem]=\"fontSize\"\n\n [popover]=\"avatarGroupPopupTemplate\"\n placement=\"bottom\"\n [outsideClick]=\"true\"\n container=\"body\"\n triggers=\"\" \n #popover=\"bs-popover\"\n (click)=\"overflowAvatarClicked($event)\"\n >\n </sds-avatar>\n</div>\n\n<ng-template #avatarGroupPopupTemplate>\n <div class=\"overflow-avatars-container rounded\">\n <div *ngFor=\"let avatar of overflow\"\n class=\"d-flex align-items-center pl-3 py-2 pr-5 my-2 overflow-avatar-container\" >\n <sds-avatar\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n borderColor=\"transparent\"\n [style.font-size.rem]=\"1.8\" \n >\n </sds-avatar>\n <div class=\"ml-3\">{{avatar.text}}</div>\n </div>\n </div>\n</ng-template>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { PopoverModule } from 'ngx-bootstrap/popover';\r\n\r\nimport { SdsAvatarComponent } from './avatar.component';\r\nimport { SdsAvatarGroupComponent } from './avatar-group.component';\r\n\r\n\r\nconst components = [\r\n SdsAvatarComponent,\r\n SdsAvatarGroupComponent\r\n];\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n // PopoverModule.forRoot()\r\n PopoverModule\r\n\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsAvatarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsAvatarComponent","i2"],"mappings":";;;;;;;MAca,kBAAkB,CAAA;AAa3B,IAAA,WAAA,GAAA;AAZS,QAAA,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;AAClB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;AACtB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;AACxB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;AAC1B,QAAA,IAAW,CAAA,WAAA,GAA2C,MAAM,CAAC;AAK/D,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK,CAAC;AAChC,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;KAEb;IAEhB,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,EAAE,CAAC;KAC1B;AAED,IAAA,WAAW,CAAC,OAAsB,EAAA;QAC9B,IACI,OAAO,CAAC,MAAM,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,CA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AAuB,aAOvB,YAAY;;AAEZ,QAAA,aAAa,aAVb,kBAAkB;QAClB,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAgBd,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAVjB,OAAA,EAAA,CAAA;YACP,YAAY;;YAEZ,aAAa;SAEd,CAAA,EAAA,CAAA,CAAA;2FAKU,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;;wBAEZ,aAAa;AAEd,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AAChB,qBAAA;iBACF,CAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -54,11 +54,14 @@ class SdsColorPickerModule {
|
|
|
54
54
|
}
|
|
55
55
|
SdsColorPickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
56
56
|
SdsColorPickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, declarations: [SdsColorPickerComponent], imports: [CommonModule,
|
|
57
|
-
FontAwesomeModule,
|
|
57
|
+
FontAwesomeModule,
|
|
58
|
+
// BsDropdownModule.forRoot()
|
|
59
|
+
BsDropdownModule], exports: [SdsColorPickerComponent] });
|
|
58
60
|
SdsColorPickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, imports: [[
|
|
59
61
|
CommonModule,
|
|
60
62
|
FontAwesomeModule,
|
|
61
|
-
BsDropdownModule.forRoot()
|
|
63
|
+
// BsDropdownModule.forRoot()
|
|
64
|
+
BsDropdownModule
|
|
62
65
|
]] });
|
|
63
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, decorators: [{
|
|
64
67
|
type: NgModule,
|
|
@@ -69,7 +72,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
69
72
|
imports: [
|
|
70
73
|
CommonModule,
|
|
71
74
|
FontAwesomeModule,
|
|
72
|
-
BsDropdownModule.forRoot()
|
|
75
|
+
// BsDropdownModule.forRoot()
|
|
76
|
+
BsDropdownModule
|
|
73
77
|
],
|
|
74
78
|
exports: [
|
|
75
79
|
...components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-color-picker.mjs","sources":["../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.ts","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.html","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.module.ts","../../../projects/ngx-sds-components/src/lib/color-picker/spicainternational-ngx-sds-components-src-lib-color-picker.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons';\n\n\n@Component({\n selector: 'sds-color-picker',\n templateUrl: './color-picker.component.html',\n styleUrls: ['./color-picker.component.scss'],\n})\nexport class SdsColorPickerComponent implements OnInit, OnChanges {\n @Input() colors: Array<string> = [];\n @Input() disabled: boolean = false;\n @Input() selectedColor?: string;\n @Input() defaultColor?: string;\n @Output() selectedColorChange: EventEmitter<string>;\n @Input() style: 'inline' | 'dropdown' = 'inline'\n\n public checkIcon = faCheck;\n public dropdownGridTemplateColumns?: string;\n\n constructor() {\n this.selectedColorChange = new EventEmitter<string>();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['colors']) {\n const gridSize = Math.ceil(Math.sqrt(this.colors.length));\n this.dropdownGridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n }\n }\n\n ngOnInit(): void {}\n\n public selectColor(color: string): void {\n if (!this.disabled) {\n this.selectedColor = color;\n this.selectedColorChange.emit(color);\n }\n }\n}\n","<div\n *ngIf=\"style === 'inline'\"\n class=\"color-tiles-container-inline\">\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n</div>\n\n<div\n *ngIf=\"style === 'dropdown'\"\n class=\"btn-group\"\n dropdown\n>\n <button\n dropdownToggle\n type=\"button\"\n class=\"btn dropdown-toggle d-flex align-items-center\"\n aria-controls=\"dropdown-basic\"\n >\n <div\n class=\"color-tile\"\n [style.background-color]=\"selectedColor || defaultColor\"\n [class.undefined-color]=\"!(selectedColor || defaultColor)\"\n >\n </div>\n <div class=\"caret\"></div>\n </button>\n\n <div\n *dropdownMenu\n class=\"dropdown-menu\"\n role=\"menu\"\n aria-labelledby=\"app-switcher-button\"\n >\n <div\n class=\"color-tiles-container-square\"\n [ngStyle]=\"{ 'grid-template-columns': dropdownGridTemplateColumns}\"\n >\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile rounded-circle\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n </div>\n\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SdsColorPickerComponent } from './color-picker.component';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\n\n\nconst components = [SdsColorPickerComponent];\n@NgModule({\n declarations: [\n ...components\n ],\n imports: [\n CommonModule,\n FontAwesomeModule,\n BsDropdownModule.forRoot()\n ],\n exports: [\n ...components\n ]\n})\nexport class SdsColorPickerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,uBAAuB,CAAA;AAWhC,IAAA,WAAA,GAAA;AAVS,QAAA,IAAM,CAAA,MAAA,GAAkB,EAAE,CAAC;AAC3B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;AAI1B,QAAA,IAAK,CAAA,KAAA,GAA0B,QAAQ,CAAA;AAEzC,QAAA,IAAS,CAAA,SAAA,GAAG,OAAO,CAAC;AAIvB,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,YAAY,EAAU,CAAC;KACzD;AACD,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;AACnB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,YAAA,IAAI,CAAC,2BAA2B,GAAG,CAAU,OAAA,EAAA,QAAQ,QAAQ,CAAC;AACjE,SAAA;KACJ;AAED,IAAA,QAAQ,MAAW;AAEZ,IAAA,WAAW,CAAC,KAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAChB,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;AAC3B,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,SAAA;KACJ;;oHA5BQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA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A,EAAA,CAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDtDa,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;+BACI,kBAAkB,EAAA,QAAA,EAAA,grDAAA,EAAA,MAAA,EAAA,CAAA,mZAAA,CAAA,EAAA,CAAA;0EAKnB,MAAM,EAAA,CAAA;sBAAd,KAAK;gBACG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACI,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACE,KAAK,EAAA,CAAA;sBAAb,KAAK;;;AERV,MAAM,UAAU,GAAG,CAAC,uBAAuB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-color-picker.mjs","sources":["../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.ts","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.html","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.module.ts","../../../projects/ngx-sds-components/src/lib/color-picker/spicainternational-ngx-sds-components-src-lib-color-picker.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons';\n\n\n@Component({\n selector: 'sds-color-picker',\n templateUrl: './color-picker.component.html',\n styleUrls: ['./color-picker.component.scss'],\n})\nexport class SdsColorPickerComponent implements OnInit, OnChanges {\n @Input() colors: Array<string> = [];\n @Input() disabled: boolean = false;\n @Input() selectedColor?: string;\n @Input() defaultColor?: string;\n @Output() selectedColorChange: EventEmitter<string>;\n @Input() style: 'inline' | 'dropdown' = 'inline'\n\n public checkIcon = faCheck;\n public dropdownGridTemplateColumns?: string;\n\n constructor() {\n this.selectedColorChange = new EventEmitter<string>();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['colors']) {\n const gridSize = Math.ceil(Math.sqrt(this.colors.length));\n this.dropdownGridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n }\n }\n\n ngOnInit(): void {}\n\n public selectColor(color: string): void {\n if (!this.disabled) {\n this.selectedColor = color;\n this.selectedColorChange.emit(color);\n }\n }\n}\n","<div\n *ngIf=\"style === 'inline'\"\n class=\"color-tiles-container-inline\">\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n</div>\n\n<div\n *ngIf=\"style === 'dropdown'\"\n class=\"btn-group\"\n dropdown\n>\n <button\n dropdownToggle\n type=\"button\"\n class=\"btn dropdown-toggle d-flex align-items-center\"\n aria-controls=\"dropdown-basic\"\n >\n <div\n class=\"color-tile\"\n [style.background-color]=\"selectedColor || defaultColor\"\n [class.undefined-color]=\"!(selectedColor || defaultColor)\"\n >\n </div>\n <div class=\"caret\"></div>\n </button>\n\n <div\n *dropdownMenu\n class=\"dropdown-menu\"\n role=\"menu\"\n aria-labelledby=\"app-switcher-button\"\n >\n <div\n class=\"color-tiles-container-square\"\n [ngStyle]=\"{ 'grid-template-columns': dropdownGridTemplateColumns}\"\n >\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile rounded-circle\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n </div>\n\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SdsColorPickerComponent } from './color-picker.component';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\n\n\nconst components = [SdsColorPickerComponent];\n@NgModule({\n declarations: [\n ...components\n ],\n imports: [\n CommonModule,\n FontAwesomeModule,\n // BsDropdownModule.forRoot()\n BsDropdownModule\n ],\n exports: [\n ...components\n ]\n})\nexport class SdsColorPickerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,uBAAuB,CAAA;AAWhC,IAAA,WAAA,GAAA;AAVS,QAAA,IAAM,CAAA,MAAA,GAAkB,EAAE,CAAC;AAC3B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;AAI1B,QAAA,IAAK,CAAA,KAAA,GAA0B,QAAQ,CAAA;AAEzC,QAAA,IAAS,CAAA,SAAA,GAAG,OAAO,CAAC;AAIvB,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,YAAY,EAAU,CAAC;KACzD;AACD,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;AACnB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,YAAA,IAAI,CAAC,2BAA2B,GAAG,CAAU,OAAA,EAAA,QAAQ,QAAQ,CAAC;AACjE,SAAA;KACJ;AAED,IAAA,QAAQ,MAAW;AAEZ,IAAA,WAAW,CAAC,KAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAChB,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;AAC3B,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,SAAA;KACJ;;oHA5BQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CA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A;kBAdhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,iBAAiB;;wBAEjB,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AAChB,qBAAA;iBACF,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -69,11 +69,14 @@ class SdsAppSwitcherModule {
|
|
|
69
69
|
}
|
|
70
70
|
SdsAppSwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
71
71
|
SdsAppSwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, declarations: [SdsAppSwitcherComponent], imports: [CommonModule,
|
|
72
|
-
FontAwesomeModule,
|
|
72
|
+
FontAwesomeModule,
|
|
73
|
+
// BsDropdownModule.forRoot()
|
|
74
|
+
BsDropdownModule], exports: [SdsAppSwitcherComponent] });
|
|
73
75
|
SdsAppSwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, imports: [[
|
|
74
76
|
CommonModule,
|
|
75
77
|
FontAwesomeModule,
|
|
76
|
-
BsDropdownModule.forRoot()
|
|
78
|
+
// BsDropdownModule.forRoot()
|
|
79
|
+
BsDropdownModule
|
|
77
80
|
]] });
|
|
78
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAppSwitcherModule, decorators: [{
|
|
79
82
|
type: NgModule,
|
|
@@ -84,7 +87,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
84
87
|
imports: [
|
|
85
88
|
CommonModule,
|
|
86
89
|
FontAwesomeModule,
|
|
87
|
-
BsDropdownModule.forRoot()
|
|
90
|
+
// BsDropdownModule.forRoot()
|
|
91
|
+
BsDropdownModule
|
|
88
92
|
],
|
|
89
93
|
exports: [
|
|
90
94
|
SdsAppSwitcherComponent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-app-switcher.mjs","sources":["../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.html","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.module.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/spicainternational-ngx-sds-components-src-lib-app-switcher.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\r\nimport { faGrid } from '@fortawesome/pro-solid-svg-icons';\r\n\r\nimport { ProductModel } from './app-switcher.model';\r\n\r\n@Component({\r\n selector: 'sds-app-switcher',\r\n templateUrl: './app-switcher.component.html',\r\n styleUrls: ['./app-switcher.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdsAppSwitcherComponent implements OnInit, OnChanges {\r\n \r\n @Input() public productCode: Number | undefined;\r\n @Input() public userProductCodes: Number[] | undefined;\r\n @Input() public tenantProducts: ProductModel[] | undefined;\r\n\r\n @Input() public switchText: string = '';\r\n @Input() public discoverText: string = '';\r\n\r\n @Output() public productClick: EventEmitter<ProductModel> = new EventEmitter();\r\n\r\n\r\n public activatedProducts: ProductModel[];\r\n public discoverProducts: ProductModel[];\r\n \r\n public showSkeleton: boolean;\r\n public selectorIcon = faGrid;\r\n \r\n\r\n constructor() {\r\n this.showSkeleton = true;\r\n this.activatedProducts = new Array<ProductModel>();\r\n this.discoverProducts = new Array<ProductModel>(); \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['userProductCodes'] || changes['tenantProducts'] || changes['productCode']) {\r\n if (this.userProductCodes !== undefined && this.tenantProducts !== undefined && this.productCode !== undefined) {\r\n this.activatedProducts = [];\r\n this.discoverProducts = [];\r\n\r\n this.tenantProducts.forEach(product => {\r\n if ((this.userProductCodes as Number[]).includes(product.code)) {\r\n // exclude current product from the list\r\n if (product.code != this.productCode) {\r\n this.activatedProducts.push(product);\r\n }\r\n } else {\r\n this.discoverProducts.push(product);\r\n }\r\n });\r\n this.showSkeleton = false;\r\n } else {\r\n this.showSkeleton = true;\r\n }\r\n }\r\n }\r\n\r\n public emitProductClick(product: ProductModel): void {\r\n this.productClick.emit(product);\r\n }\r\n\r\n}\r\n","<ng-template #productTemplate let-product=\"product\">\r\n <div class=\"product-logo\">\r\n <img [src]=\"product.logoUri\" alt=\"{{ product.Name }}\">\r\n </div>\r\n <div class=\"product-title d-flex align-items-center\">\r\n {{product.name}}\r\n </div>\r\n <div class=\"product-description\">\r\n {{product.description}}\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"btn-group app-switcher\" dropdown>\r\n <!-- id=\"button-basic\" -->\r\n <button \r\n dropdownToggle \r\n type=\"button\" \r\n class=\"btn btn-link rounded p-0 text-dark\"\r\n aria-controls=\"dropdown-basic\">\r\n <fa-icon \r\n [icon]=\"selectorIcon\" \r\n [fixedWidth]=\"true\">\r\n </fa-icon>\r\n </button>\r\n\r\n <div \r\n *dropdownMenu\r\n class=\"dropdown-menu\" \r\n role=\"menu\"\r\n aria-labelledby=\"app-switcher-button\">\r\n\r\n <ng-container *ngIf=\"showSkeleton\">\r\n <div class=\"dropdown-header skeleton skeleton-height-1 w-50 \"></div>\r\n <div class=\"dropdown-item product-container mt-2 skeleton skeleton-height-2\"></div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && activatedProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ switchText }}</h6>\r\n <a *ngFor=\"let activatedProduct of activatedProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(activatedProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: activatedProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && discoverProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ discoverText }}</h6>\r\n\r\n <a *ngFor=\"let discoverProduct of discoverProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(discoverProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: discoverProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n ","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsAppSwitcherComponent } from './app-switcher.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsAppSwitcherComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n BsDropdownModule.forRoot()\r\n ],\r\n exports: [\r\n SdsAppSwitcherComponent\r\n ]\r\n})\r\nexport class SdsAppSwitcherModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAWa,uBAAuB,CAAA;AAmBhC,IAAA,WAAA,GAAA;QAbgB,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;QACxB,IAAY,CAAA,YAAA,GAAW,EAAE,CAAC;AAEzB,QAAA,IAAA,CAAA,YAAY,GAA+B,IAAI,YAAY,EAAE,CAAC;QAOxE,IAAY,CAAA,YAAA,GAAG,MAAM,CAAC;AAIzB,QAAA,IAAI,CAAC,YAAY,GAA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AA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;2FDnDW,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;+BACI,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,86EAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;0EAI/B,WAAW,EAAA,CAAA;sBAA1B,KAAK;gBACU,gBAAgB,EAAA,CAAA;sBAA/B,KAAK;gBACU,cAAc,EAAA,CAAA;sBAA7B,KAAK;gBAEU,UAAU,EAAA,CAAA;sBAAzB,KAAK;gBACU,YAAY,EAAA,CAAA;sBAA3B,KAAK;gBAEW,YAAY,EAAA,CAAA;sBAA5B,MAAM;;;
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-app-switcher.mjs","sources":["../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.component.html","../../../projects/ngx-sds-components/src/lib/app-switcher/app-switcher.module.ts","../../../projects/ngx-sds-components/src/lib/app-switcher/spicainternational-ngx-sds-components-src-lib-app-switcher.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\r\nimport { faGrid } from '@fortawesome/pro-solid-svg-icons';\r\n\r\nimport { ProductModel } from './app-switcher.model';\r\n\r\n@Component({\r\n selector: 'sds-app-switcher',\r\n templateUrl: './app-switcher.component.html',\r\n styleUrls: ['./app-switcher.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdsAppSwitcherComponent implements OnInit, OnChanges {\r\n \r\n @Input() public productCode: Number | undefined;\r\n @Input() public userProductCodes: Number[] | undefined;\r\n @Input() public tenantProducts: ProductModel[] | undefined;\r\n\r\n @Input() public switchText: string = '';\r\n @Input() public discoverText: string = '';\r\n\r\n @Output() public productClick: EventEmitter<ProductModel> = new EventEmitter();\r\n\r\n\r\n public activatedProducts: ProductModel[];\r\n public discoverProducts: ProductModel[];\r\n \r\n public showSkeleton: boolean;\r\n public selectorIcon = faGrid;\r\n \r\n\r\n constructor() {\r\n this.showSkeleton = true;\r\n this.activatedProducts = new Array<ProductModel>();\r\n this.discoverProducts = new Array<ProductModel>(); \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['userProductCodes'] || changes['tenantProducts'] || changes['productCode']) {\r\n if (this.userProductCodes !== undefined && this.tenantProducts !== undefined && this.productCode !== undefined) {\r\n this.activatedProducts = [];\r\n this.discoverProducts = [];\r\n\r\n this.tenantProducts.forEach(product => {\r\n if ((this.userProductCodes as Number[]).includes(product.code)) {\r\n // exclude current product from the list\r\n if (product.code != this.productCode) {\r\n this.activatedProducts.push(product);\r\n }\r\n } else {\r\n this.discoverProducts.push(product);\r\n }\r\n });\r\n this.showSkeleton = false;\r\n } else {\r\n this.showSkeleton = true;\r\n }\r\n }\r\n }\r\n\r\n public emitProductClick(product: ProductModel): void {\r\n this.productClick.emit(product);\r\n }\r\n\r\n}\r\n","<ng-template #productTemplate let-product=\"product\">\r\n <div class=\"product-logo\">\r\n <img [src]=\"product.logoUri\" alt=\"{{ product.Name }}\">\r\n </div>\r\n <div class=\"product-title d-flex align-items-center\">\r\n {{product.name}}\r\n </div>\r\n <div class=\"product-description\">\r\n {{product.description}}\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"btn-group app-switcher\" dropdown>\r\n <!-- id=\"button-basic\" -->\r\n <button \r\n dropdownToggle \r\n type=\"button\" \r\n class=\"btn btn-link rounded p-0 text-dark\"\r\n aria-controls=\"dropdown-basic\">\r\n <fa-icon \r\n [icon]=\"selectorIcon\" \r\n [fixedWidth]=\"true\">\r\n </fa-icon>\r\n </button>\r\n\r\n <div \r\n *dropdownMenu\r\n class=\"dropdown-menu\" \r\n role=\"menu\"\r\n aria-labelledby=\"app-switcher-button\">\r\n\r\n <ng-container *ngIf=\"showSkeleton\">\r\n <div class=\"dropdown-header skeleton skeleton-height-1 w-50 \"></div>\r\n <div class=\"dropdown-item product-container mt-2 skeleton skeleton-height-2\"></div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && activatedProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ switchText }}</h6>\r\n <a *ngFor=\"let activatedProduct of activatedProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(activatedProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: activatedProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!showSkeleton && discoverProducts.length > 0\">\r\n <h6 class=\"dropdown-header\">{{ discoverText }}</h6>\r\n\r\n <a *ngFor=\"let discoverProduct of discoverProducts\" \r\n class=\"dropdown-item product-container\"\r\n (click)=\"emitProductClick(discoverProduct)\">\r\n <ng-container \r\n [ngTemplateOutlet]=\"productTemplate\"\r\n [ngTemplateOutletContext]=\"{ product: discoverProduct }\">\r\n </ng-container>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </div>\r\n ","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsAppSwitcherComponent } from './app-switcher.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsAppSwitcherComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n // BsDropdownModule.forRoot()\r\n BsDropdownModule\r\n ],\r\n exports: [\r\n SdsAppSwitcherComponent\r\n ]\r\n})\r\nexport class SdsAppSwitcherModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAWa,uBAAuB,CAAA;AAmBhC,IAAA,WAAA,GAAA;QAbgB,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;QACxB,IAAY,CAAA,YAAA,GAAW,EAAE,CAAC;AAEzB,QAAA,IAAA,CAAA,YAAY,GAA+B,IAAI,YAAY,EAAE,CAAC;QAOxE,IAAY,CAAA,YAAA,GAAG,MAAM,CAAC;AAIzB,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,KAAK,EAAgB,CAAC;AACnD,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,KAAK,EAAgB,CAAC;KACrD;AAED,IAAA,QAAQ,MAAW;AAEnB,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE;AACpF,YAAA,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;AAC5G,gBAAA,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;AAC5B,gBAAA,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;AAE3B,gBAAA,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,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ngImport: i0, type: SdsAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
151
151
|
SdsAvatarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, declarations: [SdsAvatarComponent,
|
|
152
|
-
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
152
|
+
SdsAvatarGroupComponent], imports: [CommonModule,
|
|
153
|
+
// PopoverModule.forRoot()
|
|
154
|
+
PopoverModule], exports: [SdsAvatarComponent,
|
|
153
155
|
SdsAvatarGroupComponent] });
|
|
154
156
|
SdsAvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, imports: [[
|
|
155
157
|
CommonModule,
|
|
156
|
-
PopoverModule.forRoot()
|
|
158
|
+
// PopoverModule.forRoot()
|
|
159
|
+
PopoverModule
|
|
157
160
|
]] });
|
|
158
161
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsAvatarModule, decorators: [{
|
|
159
162
|
type: NgModule,
|
|
@@ -163,7 +166,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
163
166
|
],
|
|
164
167
|
imports: [
|
|
165
168
|
CommonModule,
|
|
166
|
-
PopoverModule.forRoot()
|
|
169
|
+
// PopoverModule.forRoot()
|
|
170
|
+
PopoverModule
|
|
167
171
|
],
|
|
168
172
|
exports: [
|
|
169
173
|
...components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-avatar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar.module.ts","../../../projects/ngx-sds-components/src/lib/avatar/spicainternational-ngx-sds-components-src-lib-avatar.ts"],"sourcesContent":["import {\r\n AfterViewInit,\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sds-avatar',\r\n templateUrl: './avatar.component.html',\r\n styleUrls: ['./avatar.component.scss'],\r\n})\r\nexport class SdsAvatarComponent implements AfterViewInit, OnChanges {\r\n @Input() text: string = '';\r\n @Input() colorKey: string = '';\r\n @Input() pictureUri: string = '';\r\n @Input() showHint: boolean = false;\r\n @Input() borderStyle: 'solid' | 'dashed' | 'dotted' | 'none' = 'none';\r\n @Input() borderColor?: string;\r\n @Input() initialsText?: string;\r\n @Input() cursor?: string;\r\n\r\n public isPictureReady: boolean = false;\r\n public initials: string = '';\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit() {\r\n this.loadUserPicture();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (\r\n changes['text'] &&\r\n changes['text'].currentValue != changes['text'].previousValue &&\r\n this.initialsText == undefined\r\n ) {\r\n this.extractInitials();\r\n }\r\n\r\n if (\r\n changes['pictureUri'] &&\r\n changes['pictureUri'].currentValue !=\r\n changes['pictureUri'].previousValue\r\n ) {\r\n this.loadUserPicture();\r\n }\r\n\r\n if (changes['initialsText'] && this.initialsText) {\r\n this.initials = this.initialsText;\r\n }\r\n }\r\n\r\n public setColorClass(): string {\r\n if (this.colorKey) {\r\n return 'color' + this.getColorIndex(this.colorKey);\r\n }\r\n return 'color18';\r\n }\r\n\r\n private extractInitials(): void {\r\n this.initials = this.text\r\n ? this.text\r\n .toUpperCase()\r\n .split(' ')\r\n .map((n) => n[0])\r\n .slice(0, 2)\r\n .join('')\r\n : '';\r\n }\r\n\r\n private getColorIndex(s: string): number {\r\n const length = 10;\r\n if (!s) {\r\n return 0;\r\n }\r\n let sumOfChars = s\r\n .split('')\r\n .map((x) => x.charCodeAt(0))\r\n .reduce((a, b) => a + b, 0);\r\n return sumOfChars % length;\r\n }\r\n\r\n public loadUserPicture() {\r\n if (this.pictureUri && this.pictureUri !== '') {\r\n this.isPictureReady = true;\r\n } else {\r\n this.isPictureReady = false;\r\n }\r\n }\r\n}\r\n","<div\r\n class=\"avatar circle d-flex justify-content-center align-items-center\"\r\n [class.hasPicture]=\"isPictureReady\"\r\n [ngClass]=\"setColorClass()\"\r\n [title]=\"showHint ? text : ''\"\r\n [style.border-style]=\"borderStyle.toString()\"\r\n [style.border-color]=\"borderColor\"\r\n [style.cursor]=\"cursor ? cursor : 'default'\"\r\n>\r\n <span \r\n *ngIf=\"!isPictureReady\" \r\n class=\"initials\"\r\n >\r\n {{ initials }}\r\n </span>\r\n\r\n <img \r\n *ngIf=\"isPictureReady\" \r\n [src]=\"pictureUri\"\r\n alt=\"\" />\r\n</div>\r\n","import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { AvatarModel } from './avatar-group.model';\n\n@Component({\n selector: 'sds-avatar-group',\n templateUrl: './avatar-group.component.html',\n styleUrls: ['./avatar-group.component.scss'],\n})\nexport class SdsAvatarGroupComponent implements OnInit, OnChanges {\n @ViewChild('popover', {static: false}) private _popover: PopoverDirective | undefined;\n\n @Input() public stacked: boolean = false;\n @Input() public maxCount?: number;\n @Input() public fontSize: number = 2;\n @Input() public borderColor?: string;\n @Input() public data: Array<AvatarModel> = [];\n\n public overflow: Array<AvatarModel> = [];\n public inflow: Array<AvatarModel> = [];\n\n\n public overflowCountDisplay: string = '';\n public overFlowBorderStyle: 'solid' | 'none' = 'none';\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['data'] || changes['maxCount']){\n if (this.maxCount && this.data) {\n this.overflow = [...this.data];\n this.inflow = this.overflow.splice(0, this.maxCount);\n console.log(this.overflow.length);\n this.overflowCountDisplay = `+${Math.min(99, this.overflow.length)}`;\n this.overFlowBorderStyle = this.data.filter(x => x.borderStyle).length > 0 ? 'solid' : 'none';\n } else {\n this.inflow = [...this.data];\n }\n }\n }\n\n ngOnInit(): void {}\n\n public overflowAvatarClicked(event: MouseEvent) {\n this._popover?.show();\n }\n\n}\n","<div class=\"d-flex avatar-group-container\">\n <sds-avatar *ngFor=\"let avatar of inflow\"\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n [showHint]=\"true\"\n [style.font-size.rem]=\"fontSize\"\n [style.margin-right.rem]=\"stacked ? fontSize/-3 : fontSize/15\"\n >\n </sds-avatar>\n \n <sds-avatar \n *ngIf=\"overflow.length > 0\"\n class=\"overflow\"\n [initialsText]=\"overflowCountDisplay\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"overFlowBorderStyle\"\n cursor=\"pointer\"\n [style.font-size.rem]=\"fontSize\"\n\n [popover]=\"avatarGroupPopupTemplate\"\n placement=\"bottom\"\n [outsideClick]=\"true\"\n container=\"body\"\n triggers=\"\" \n #popover=\"bs-popover\"\n (click)=\"overflowAvatarClicked($event)\"\n >\n </sds-avatar>\n</div>\n\n<ng-template #avatarGroupPopupTemplate>\n <div class=\"overflow-avatars-container rounded\">\n <div *ngFor=\"let avatar of overflow\"\n class=\"d-flex align-items-center pl-3 py-2 pr-5 my-2 overflow-avatar-container\" >\n <sds-avatar\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n borderColor=\"transparent\"\n [style.font-size.rem]=\"1.8\" \n >\n </sds-avatar>\n <div class=\"ml-3\">{{avatar.text}}</div>\n </div>\n </div>\n</ng-template>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { PopoverModule } from 'ngx-bootstrap/popover';\r\n\r\nimport { SdsAvatarComponent } from './avatar.component';\r\nimport { SdsAvatarGroupComponent } from './avatar-group.component';\r\n\r\n\r\nconst components = [\r\n SdsAvatarComponent,\r\n SdsAvatarGroupComponent\r\n];\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n PopoverModule.forRoot()\r\n\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsAvatarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsAvatarComponent","i2","i1"],"mappings":";;;;;;;MAca,kBAAkB,CAAA;AAa3B,IAAA,WAAA,GAAA;QAZS,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAClB,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;QACtB,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;QACxB,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAC1B,IAAW,CAAA,WAAA,GAA2C,MAAM,CAAC;QAK/D,IAAc,CAAA,cAAA,GAAY,KAAK,CAAC;QAChC,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;KAEb;IAEhB,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,EAAE,CAAC;KAC1B;AAED,IAAA,WAAW,CAAC,OAAsB,EAAA;QAC9B,IACI,OAAO,CAAC,MAAM,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa;AAC7D,YAAA,IAAI,CAAC,YAAY,IAAI,SAAS,EAChC;YACE,IAAI,CAAC,eAAe,EAAE,CAAC;AAC1B,SAAA;QAED,IACI,OAAO,CAAC,YAAY,CAAC;AACrB,YAAA,OAAO,CAAC,YAAY,CAAC,CAAC,YAAY;AAC9B,gBAAA,OAAO,CAAC,YAAY,CAAC,CAAC,aAAa,EACzC;YACE,IAAI,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A;kBAb3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa,CAAC,OAAO,EAAE;AAExB,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AAChB,qBAAA;AACF,iBAAA,CAAA;;;ACzBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-avatar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.ts","../../../projects/ngx-sds-components/src/lib/avatar/avatar-group.component.html","../../../projects/ngx-sds-components/src/lib/avatar/avatar.module.ts","../../../projects/ngx-sds-components/src/lib/avatar/spicainternational-ngx-sds-components-src-lib-avatar.ts"],"sourcesContent":["import {\r\n AfterViewInit,\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sds-avatar',\r\n templateUrl: './avatar.component.html',\r\n styleUrls: ['./avatar.component.scss'],\r\n})\r\nexport class SdsAvatarComponent implements AfterViewInit, OnChanges {\r\n @Input() text: string = '';\r\n @Input() colorKey: string = '';\r\n @Input() pictureUri: string = '';\r\n @Input() showHint: boolean = false;\r\n @Input() borderStyle: 'solid' | 'dashed' | 'dotted' | 'none' = 'none';\r\n @Input() borderColor?: string;\r\n @Input() initialsText?: string;\r\n @Input() cursor?: string;\r\n\r\n public isPictureReady: boolean = false;\r\n public initials: string = '';\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit() {\r\n this.loadUserPicture();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (\r\n changes['text'] &&\r\n changes['text'].currentValue != changes['text'].previousValue &&\r\n this.initialsText == undefined\r\n ) {\r\n this.extractInitials();\r\n }\r\n\r\n if (\r\n changes['pictureUri'] &&\r\n changes['pictureUri'].currentValue !=\r\n changes['pictureUri'].previousValue\r\n ) {\r\n this.loadUserPicture();\r\n }\r\n\r\n if (changes['initialsText'] && this.initialsText) {\r\n this.initials = this.initialsText;\r\n }\r\n }\r\n\r\n public setColorClass(): string {\r\n if (this.colorKey) {\r\n return 'color' + this.getColorIndex(this.colorKey);\r\n }\r\n return 'color18';\r\n }\r\n\r\n private extractInitials(): void {\r\n this.initials = this.text\r\n ? this.text\r\n .toUpperCase()\r\n .split(' ')\r\n .map((n) => n[0])\r\n .slice(0, 2)\r\n .join('')\r\n : '';\r\n }\r\n\r\n private getColorIndex(s: string): number {\r\n const length = 10;\r\n if (!s) {\r\n return 0;\r\n }\r\n let sumOfChars = s\r\n .split('')\r\n .map((x) => x.charCodeAt(0))\r\n .reduce((a, b) => a + b, 0);\r\n return sumOfChars % length;\r\n }\r\n\r\n public loadUserPicture() {\r\n if (this.pictureUri && this.pictureUri !== '') {\r\n this.isPictureReady = true;\r\n } else {\r\n this.isPictureReady = false;\r\n }\r\n }\r\n}\r\n","<div\r\n class=\"avatar circle d-flex justify-content-center align-items-center\"\r\n [class.hasPicture]=\"isPictureReady\"\r\n [ngClass]=\"setColorClass()\"\r\n [title]=\"showHint ? text : ''\"\r\n [style.border-style]=\"borderStyle.toString()\"\r\n [style.border-color]=\"borderColor\"\r\n [style.cursor]=\"cursor ? cursor : 'default'\"\r\n>\r\n <span \r\n *ngIf=\"!isPictureReady\" \r\n class=\"initials\"\r\n >\r\n {{ initials }}\r\n </span>\r\n\r\n <img \r\n *ngIf=\"isPictureReady\" \r\n [src]=\"pictureUri\"\r\n alt=\"\" />\r\n</div>\r\n","import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';\nimport { PopoverDirective } from 'ngx-bootstrap/popover';\nimport { AvatarModel } from './avatar-group.model';\n\n@Component({\n selector: 'sds-avatar-group',\n templateUrl: './avatar-group.component.html',\n styleUrls: ['./avatar-group.component.scss'],\n})\nexport class SdsAvatarGroupComponent implements OnInit, OnChanges {\n @ViewChild('popover', {static: false}) private _popover: PopoverDirective | undefined;\n\n @Input() public stacked: boolean = false;\n @Input() public maxCount?: number;\n @Input() public fontSize: number = 2;\n @Input() public borderColor?: string;\n @Input() public data: Array<AvatarModel> = [];\n\n public overflow: Array<AvatarModel> = [];\n public inflow: Array<AvatarModel> = [];\n\n\n public overflowCountDisplay: string = '';\n public overFlowBorderStyle: 'solid' | 'none' = 'none';\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['data'] || changes['maxCount']){\n if (this.maxCount && this.data) {\n this.overflow = [...this.data];\n this.inflow = this.overflow.splice(0, this.maxCount);\n console.log(this.overflow.length);\n this.overflowCountDisplay = `+${Math.min(99, this.overflow.length)}`;\n this.overFlowBorderStyle = this.data.filter(x => x.borderStyle).length > 0 ? 'solid' : 'none';\n } else {\n this.inflow = [...this.data];\n }\n }\n }\n\n ngOnInit(): void {}\n\n public overflowAvatarClicked(event: MouseEvent) {\n this._popover?.show();\n }\n\n}\n","<div class=\"d-flex avatar-group-container\">\n <sds-avatar *ngFor=\"let avatar of inflow\"\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n [showHint]=\"true\"\n [style.font-size.rem]=\"fontSize\"\n [style.margin-right.rem]=\"stacked ? fontSize/-3 : fontSize/15\"\n >\n </sds-avatar>\n \n <sds-avatar \n *ngIf=\"overflow.length > 0\"\n class=\"overflow\"\n [initialsText]=\"overflowCountDisplay\"\n [borderColor]=\"borderColor\"\n [borderStyle]=\"overFlowBorderStyle\"\n cursor=\"pointer\"\n [style.font-size.rem]=\"fontSize\"\n\n [popover]=\"avatarGroupPopupTemplate\"\n placement=\"bottom\"\n [outsideClick]=\"true\"\n container=\"body\"\n triggers=\"\" \n #popover=\"bs-popover\"\n (click)=\"overflowAvatarClicked($event)\"\n >\n </sds-avatar>\n</div>\n\n<ng-template #avatarGroupPopupTemplate>\n <div class=\"overflow-avatars-container rounded\">\n <div *ngFor=\"let avatar of overflow\"\n class=\"d-flex align-items-center pl-3 py-2 pr-5 my-2 overflow-avatar-container\" >\n <sds-avatar\n [text]=\"avatar.text\"\n [colorKey]=\"avatar.colorKey\"\n [borderStyle]=\"avatar.borderStyle ? avatar.borderStyle : 'none'\"\n [pictureUri]=\"avatar.pictureUri ?? ''\"\n borderColor=\"transparent\"\n [style.font-size.rem]=\"1.8\" \n >\n </sds-avatar>\n <div class=\"ml-3\">{{avatar.text}}</div>\n </div>\n </div>\n</ng-template>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { PopoverModule } from 'ngx-bootstrap/popover';\r\n\r\nimport { SdsAvatarComponent } from './avatar.component';\r\nimport { SdsAvatarGroupComponent } from './avatar-group.component';\r\n\r\n\r\nconst components = [\r\n SdsAvatarComponent,\r\n SdsAvatarGroupComponent\r\n];\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n // PopoverModule.forRoot()\r\n PopoverModule\r\n\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsAvatarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsAvatarComponent","i2"],"mappings":";;;;;;;MAca,kBAAkB,CAAA;AAa3B,IAAA,WAAA,GAAA;QAZS,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAClB,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;QACtB,IAAU,CAAA,UAAA,GAAW,EAAE,CAAC;QACxB,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAC1B,IAAW,CAAA,WAAA,GAA2C,MAAM,CAAC;QAK/D,IAA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A,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,iBAjBxB,kBAAkB;AAClB,QAAA,uBAAuB,aAOvB,YAAY;;AAEZ,QAAA,aAAa,aAVb,kBAAkB;QAClB,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAgBd,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAVjB,OAAA,EAAA,CAAA;YACP,YAAY;;YAEZ,aAAa;AAEd,SAAA,CAAA,EAAA,CAAA,CAAA;2FAKU,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;;wBAEZ,aAAa;AAEd,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AAChB,qBAAA;AACF,iBAAA,CAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -54,11 +54,14 @@ class SdsColorPickerModule {
|
|
|
54
54
|
}
|
|
55
55
|
SdsColorPickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
56
56
|
SdsColorPickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, declarations: [SdsColorPickerComponent], imports: [CommonModule,
|
|
57
|
-
FontAwesomeModule,
|
|
57
|
+
FontAwesomeModule,
|
|
58
|
+
// BsDropdownModule.forRoot()
|
|
59
|
+
BsDropdownModule], exports: [SdsColorPickerComponent] });
|
|
58
60
|
SdsColorPickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, imports: [[
|
|
59
61
|
CommonModule,
|
|
60
62
|
FontAwesomeModule,
|
|
61
|
-
BsDropdownModule.forRoot()
|
|
63
|
+
// BsDropdownModule.forRoot()
|
|
64
|
+
BsDropdownModule
|
|
62
65
|
]] });
|
|
63
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsColorPickerModule, decorators: [{
|
|
64
67
|
type: NgModule,
|
|
@@ -69,7 +72,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
69
72
|
imports: [
|
|
70
73
|
CommonModule,
|
|
71
74
|
FontAwesomeModule,
|
|
72
|
-
BsDropdownModule.forRoot()
|
|
75
|
+
// BsDropdownModule.forRoot()
|
|
76
|
+
BsDropdownModule
|
|
73
77
|
],
|
|
74
78
|
exports: [
|
|
75
79
|
...components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-color-picker.mjs","sources":["../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.ts","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.html","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.module.ts","../../../projects/ngx-sds-components/src/lib/color-picker/spicainternational-ngx-sds-components-src-lib-color-picker.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons';\n\n\n@Component({\n selector: 'sds-color-picker',\n templateUrl: './color-picker.component.html',\n styleUrls: ['./color-picker.component.scss'],\n})\nexport class SdsColorPickerComponent implements OnInit, OnChanges {\n @Input() colors: Array<string> = [];\n @Input() disabled: boolean = false;\n @Input() selectedColor?: string;\n @Input() defaultColor?: string;\n @Output() selectedColorChange: EventEmitter<string>;\n @Input() style: 'inline' | 'dropdown' = 'inline'\n\n public checkIcon = faCheck;\n public dropdownGridTemplateColumns?: string;\n\n constructor() {\n this.selectedColorChange = new EventEmitter<string>();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['colors']) {\n const gridSize = Math.ceil(Math.sqrt(this.colors.length));\n this.dropdownGridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n }\n }\n\n ngOnInit(): void {}\n\n public selectColor(color: string): void {\n if (!this.disabled) {\n this.selectedColor = color;\n this.selectedColorChange.emit(color);\n }\n }\n}\n","<div\n *ngIf=\"style === 'inline'\"\n class=\"color-tiles-container-inline\">\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n</div>\n\n<div\n *ngIf=\"style === 'dropdown'\"\n class=\"btn-group\"\n dropdown\n>\n <button\n dropdownToggle\n type=\"button\"\n class=\"btn dropdown-toggle d-flex align-items-center\"\n aria-controls=\"dropdown-basic\"\n >\n <div\n class=\"color-tile\"\n [style.background-color]=\"selectedColor || defaultColor\"\n [class.undefined-color]=\"!(selectedColor || defaultColor)\"\n >\n </div>\n <div class=\"caret\"></div>\n </button>\n\n <div\n *dropdownMenu\n class=\"dropdown-menu\"\n role=\"menu\"\n aria-labelledby=\"app-switcher-button\"\n >\n <div\n class=\"color-tiles-container-square\"\n [ngStyle]=\"{ 'grid-template-columns': dropdownGridTemplateColumns}\"\n >\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile rounded-circle\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n </div>\n\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SdsColorPickerComponent } from './color-picker.component';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\n\n\nconst components = [SdsColorPickerComponent];\n@NgModule({\n declarations: [\n ...components\n ],\n imports: [\n CommonModule,\n FontAwesomeModule,\n BsDropdownModule.forRoot()\n ],\n exports: [\n ...components\n ]\n})\nexport class SdsColorPickerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,uBAAuB,CAAA;AAWhC,IAAA,WAAA,GAAA;QAVS,IAAM,CAAA,MAAA,GAAkB,EAAE,CAAC;QAC3B,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAI1B,IAAK,CAAA,KAAA,GAA0B,QAAQ,CAAA;QAEzC,IAAS,CAAA,SAAA,GAAG,OAAO,CAAC;AAIvB,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,YAAY,EAAU,CAAC;KACzD;AACD,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;AACnB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,YAAA,IAAI,CAAC,2BAA2B,GAAG,CAAU,OAAA,EAAA,QAAQ,QAAQ,CAAC;AACjE,SAAA;KACJ;AAED,IAAA,QAAQ,MAAW;AAEZ,IAAA,WAAW,CAAC,KAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAChB,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;AAC3B,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,SAAA;KACJ;;oHA5BQ,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAA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AA,CAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,uBAAA,EAAA,QAAA,EAAA,iCAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDtDa,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;+BACI,kBAAkB,EAAA,QAAA,EAAA,grDAAA,EAAA,MAAA,EAAA,CAAA,mZAAA,CAAA,EAAA,CAAA;0EAKnB,MAAM,EAAA,CAAA;sBAAd,KAAK;gBACG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACI,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACE,KAAK,EAAA,CAAA;sBAAb,KAAK;;;AERV,MAAM,UAAU,GAAG,CAAC,uBAAuB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-color-picker.mjs","sources":["../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.ts","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.component.html","../../../projects/ngx-sds-components/src/lib/color-picker/color-picker.module.ts","../../../projects/ngx-sds-components/src/lib/color-picker/spicainternational-ngx-sds-components-src-lib-color-picker.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons';\n\n\n@Component({\n selector: 'sds-color-picker',\n templateUrl: './color-picker.component.html',\n styleUrls: ['./color-picker.component.scss'],\n})\nexport class SdsColorPickerComponent implements OnInit, OnChanges {\n @Input() colors: Array<string> = [];\n @Input() disabled: boolean = false;\n @Input() selectedColor?: string;\n @Input() defaultColor?: string;\n @Output() selectedColorChange: EventEmitter<string>;\n @Input() style: 'inline' | 'dropdown' = 'inline'\n\n public checkIcon = faCheck;\n public dropdownGridTemplateColumns?: string;\n\n constructor() {\n this.selectedColorChange = new EventEmitter<string>();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['colors']) {\n const gridSize = Math.ceil(Math.sqrt(this.colors.length));\n this.dropdownGridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n }\n }\n\n ngOnInit(): void {}\n\n public selectColor(color: string): void {\n if (!this.disabled) {\n this.selectedColor = color;\n this.selectedColorChange.emit(color);\n }\n }\n}\n","<div\n *ngIf=\"style === 'inline'\"\n class=\"color-tiles-container-inline\">\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n</div>\n\n<div\n *ngIf=\"style === 'dropdown'\"\n class=\"btn-group\"\n dropdown\n>\n <button\n dropdownToggle\n type=\"button\"\n class=\"btn dropdown-toggle d-flex align-items-center\"\n aria-controls=\"dropdown-basic\"\n >\n <div\n class=\"color-tile\"\n [style.background-color]=\"selectedColor || defaultColor\"\n [class.undefined-color]=\"!(selectedColor || defaultColor)\"\n >\n </div>\n <div class=\"caret\"></div>\n </button>\n\n <div\n *dropdownMenu\n class=\"dropdown-menu\"\n role=\"menu\"\n aria-labelledby=\"app-switcher-button\"\n >\n <div\n class=\"color-tiles-container-square\"\n [ngStyle]=\"{ 'grid-template-columns': dropdownGridTemplateColumns}\"\n >\n <div\n *ngFor=\"let color of colors\"\n [style.background-color]=\"color\"\n class=\"color-tile rounded-circle\"\n (click)=\"selectColor(color)\"\n >\n <fa-icon\n *ngIf=\"selectedColor === color\"\n [icon]=\"checkIcon\"\n >\n </fa-icon>\n </div>\n </div>\n\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SdsColorPickerComponent } from './color-picker.component';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\n\n\nconst components = [SdsColorPickerComponent];\n@NgModule({\n declarations: [\n ...components\n ],\n imports: [\n CommonModule,\n FontAwesomeModule,\n // BsDropdownModule.forRoot()\n BsDropdownModule\n ],\n exports: [\n ...components\n ]\n})\nexport class SdsColorPickerModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,uBAAuB,CAAA;AAWhC,IAAA,WAAA,GAAA;QAVS,IAAM,CAAA,MAAA,GAAkB,EAAE,CAAC;QAC3B,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAI1B,IAAK,CAAA,KAAA,GAA0B,QAAQ,CAAA;QAEzC,IAAS,CAAA,SAAA,GAAG,OAAO,CAAC;AAIvB,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,YAAY,EAAU,CAAC;KACzD;AACD,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;AACnB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,YAAA,IAAI,CAAC,2BAA2B,GAAG,CAAU,OAAA,EAAA,QAAQ,QAAQ,CAAC;AACjE,SAAA;KACJ;AAED,IAAA,QAAQ,MAAW;AAEZ,IAAA,WAAW,CAAC,KAAa,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAChB,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;AAC3B,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,SAAA;KACJ;;oHA5BQ,uBAAu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