@sebgroup/green-angular 3.6.3 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/context-menu/context-menu.component.mjs +4 -4
- package/esm2020/lib/context-menu/context-menu.module.mjs +2 -2
- package/esm2020/lib/datepicker/datepicker.component.mjs +4 -4
- package/esm2020/lib/datepicker/datepicker.module.mjs +5 -6
- package/esm2020/lib/dropdown/dropdown.component.mjs +4 -4
- package/esm2020/lib/dropdown/dropdown.module.mjs +2 -2
- package/esm2020/lib/modal/modal.component.mjs +16 -9
- package/esm2020/lib/shared/index.mjs +2 -1
- package/esm2020/src/lib/accordion/accordion-list-item.component.mjs +47 -0
- package/esm2020/src/lib/accordion/accordion.component.mjs +72 -0
- package/esm2020/src/lib/accordion/accordion.module.mjs +19 -0
- package/esm2020/src/lib/accordion/index.mjs +4 -0
- package/esm2020/src/lib/accordion/sebgroup-green-angular-src-lib-accordion.mjs +5 -0
- package/esm2020/src/lib/badge/badge.component.mjs +80 -0
- package/esm2020/src/lib/badge/badge.module.mjs +18 -0
- package/esm2020/src/lib/badge/index.mjs +3 -0
- package/esm2020/src/lib/badge/sebgroup-green-angular-src-lib-badge.mjs +5 -0
- package/esm2020/src/lib/button/button.component.mjs +28 -0
- package/esm2020/src/lib/button/button.module.mjs +18 -0
- package/esm2020/src/lib/button/index.mjs +3 -0
- package/esm2020/src/lib/button/sebgroup-green-angular-src-lib-button.mjs +5 -0
- package/esm2020/src/lib/cell-table/cell-table-item.component.mjs +91 -0
- package/esm2020/src/lib/cell-table/cell-table.component.mjs +97 -0
- package/esm2020/src/lib/cell-table/cell-table.module.mjs +26 -0
- package/esm2020/src/lib/cell-table/cell-table.types.mjs +7 -0
- package/esm2020/src/lib/cell-table/cell-underline.directive.mjs +55 -0
- package/esm2020/src/lib/cell-table/index.mjs +4 -0
- package/esm2020/src/lib/cell-table/sebgroup-green-angular-src-lib-cell-table.mjs +5 -0
- package/esm2020/src/lib/context-menu/context-menu.component.mjs +80 -0
- package/esm2020/src/lib/context-menu/context-menu.module.mjs +20 -0
- package/esm2020/src/lib/context-menu/index.mjs +3 -0
- package/esm2020/src/lib/context-menu/sebgroup-green-angular-src-lib-context-menu.mjs +5 -0
- package/esm2020/src/lib/datepicker/datepicker.component.mjs +138 -0
- package/esm2020/src/lib/datepicker/datepicker.module.mjs +20 -0
- package/esm2020/src/lib/datepicker/index.mjs +3 -0
- package/esm2020/src/lib/datepicker/sebgroup-green-angular-src-lib-datepicker.mjs +5 -0
- package/esm2020/src/lib/dropdown/dropdown-button.directive.mjs +16 -0
- package/esm2020/src/lib/dropdown/dropdown-option.directive.mjs +16 -0
- package/esm2020/src/lib/dropdown/dropdown.component.mjs +212 -0
- package/esm2020/src/lib/dropdown/dropdown.module.mjs +34 -0
- package/esm2020/src/lib/dropdown/index.mjs +5 -0
- package/esm2020/src/lib/dropdown/sebgroup-green-angular-src-lib-dropdown.mjs +5 -0
- package/esm2020/src/lib/in-page-wizard/in-page-wizard-step-card.component.mjs +50 -0
- package/esm2020/src/lib/in-page-wizard/in-page-wizard.module.mjs +18 -0
- package/esm2020/src/lib/in-page-wizard/index.mjs +3 -0
- package/esm2020/src/lib/in-page-wizard/sebgroup-green-angular-src-lib-in-page-wizard.mjs +5 -0
- package/esm2020/src/lib/modal/index.mjs +5 -0
- package/esm2020/src/lib/modal/modal-footer.directive.mjs +16 -0
- package/esm2020/src/lib/modal/modal-header.directive.mjs +16 -0
- package/esm2020/src/lib/modal/modal.component.mjs +258 -0
- package/esm2020/src/lib/modal/modal.module.mjs +41 -0
- package/esm2020/src/lib/modal/sebgroup-green-angular-src-lib-modal.mjs +5 -0
- package/esm2020/src/lib/pagination/index.mjs +3 -0
- package/esm2020/src/lib/pagination/pagination.component.mjs +175 -0
- package/esm2020/src/lib/pagination/pagination.module.mjs +18 -0
- package/esm2020/src/lib/pagination/sebgroup-green-angular-src-lib-pagination.mjs +5 -0
- package/esm2020/src/lib/progress-circle/index.mjs +3 -0
- package/esm2020/src/lib/progress-circle/progress-circle.component.mjs +41 -0
- package/esm2020/src/lib/progress-circle/progress-circle.module.mjs +18 -0
- package/esm2020/src/lib/progress-circle/sebgroup-green-angular-src-lib-progress-circle.mjs +5 -0
- package/esm2020/src/lib/segmented-control/index.mjs +3 -0
- package/esm2020/src/lib/segmented-control/sebgroup-green-angular-src-lib-segmented-control.mjs +5 -0
- package/esm2020/src/lib/segmented-control/segmented-control.component.mjs +35 -0
- package/esm2020/src/lib/segmented-control/segmented-control.module.mjs +19 -0
- package/esm2020/src/lib/shared/core-element/core-element.directive.mjs +33 -0
- package/esm2020/src/lib/shared/core-element/core-element.module.mjs +18 -0
- package/esm2020/src/lib/shared/core-element/index.mjs +3 -0
- package/esm2020/src/lib/shared/index.mjs +4 -0
- package/esm2020/src/lib/shared/on-scroll.directive.mjs +47 -0
- package/esm2020/src/lib/shared/sebgroup-green-angular-src-lib-shared.mjs +5 -0
- package/esm2020/src/lib/shared/shared.module.mjs +18 -0
- package/esm2020/src/lib/slider/index.mjs +3 -0
- package/esm2020/src/lib/slider/sebgroup-green-angular-src-lib-slider.mjs +5 -0
- package/esm2020/src/lib/slider/slider.component.mjs +113 -0
- package/esm2020/src/lib/slider/slider.module.mjs +19 -0
- package/esm2020/src/lib/sortable-list/index.mjs +3 -0
- package/esm2020/src/lib/sortable-list/sebgroup-green-angular-src-lib-sortable-list.mjs +5 -0
- package/esm2020/src/lib/sortable-list/sortable-list.component.mjs +181 -0
- package/esm2020/src/lib/sortable-list/sortable-list.module.mjs +20 -0
- package/fesm2015/sebgroup-green-angular-src-lib-accordion.mjs +140 -0
- package/fesm2015/sebgroup-green-angular-src-lib-accordion.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-badge.mjs +102 -0
- package/fesm2015/sebgroup-green-angular-src-lib-badge.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-button.mjs +50 -0
- package/fesm2015/sebgroup-green-angular-src-lib-button.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-cell-table.mjs +272 -0
- package/fesm2015/sebgroup-green-angular-src-lib-cell-table.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-context-menu.mjs +104 -0
- package/fesm2015/sebgroup-green-angular-src-lib-context-menu.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-datepicker.mjs +166 -0
- package/fesm2015/sebgroup-green-angular-src-lib-datepicker.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-dropdown.mjs +266 -0
- package/fesm2015/sebgroup-green-angular-src-lib-dropdown.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-in-page-wizard.mjs +72 -0
- package/fesm2015/sebgroup-green-angular-src-lib-in-page-wizard.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-modal.mjs +328 -0
- package/fesm2015/sebgroup-green-angular-src-lib-modal.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-pagination.mjs +197 -0
- package/fesm2015/sebgroup-green-angular-src-lib-pagination.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-progress-circle.mjs +63 -0
- package/fesm2015/sebgroup-green-angular-src-lib-progress-circle.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-segmented-control.mjs +58 -0
- package/fesm2015/sebgroup-green-angular-src-lib-segmented-control.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-shared.mjs +114 -0
- package/fesm2015/sebgroup-green-angular-src-lib-shared.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-slider.mjs +136 -0
- package/fesm2015/sebgroup-green-angular-src-lib-slider.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular-src-lib-sortable-list.mjs +204 -0
- package/fesm2015/sebgroup-green-angular-src-lib-sortable-list.mjs.map +1 -0
- package/fesm2015/sebgroup-green-angular.mjs +96 -85
- package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
- package/fesm2020/sebgroup-green-angular-src-lib-accordion.mjs +138 -0
- package/fesm2020/sebgroup-green-angular-src-lib-accordion.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-badge.mjs +102 -0
- package/fesm2020/sebgroup-green-angular-src-lib-badge.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-button.mjs +50 -0
- package/fesm2020/sebgroup-green-angular-src-lib-button.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-cell-table.mjs +270 -0
- package/fesm2020/sebgroup-green-angular-src-lib-cell-table.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-context-menu.mjs +104 -0
- package/fesm2020/sebgroup-green-angular-src-lib-context-menu.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-datepicker.mjs +162 -0
- package/fesm2020/sebgroup-green-angular-src-lib-datepicker.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-dropdown.mjs +274 -0
- package/fesm2020/sebgroup-green-angular-src-lib-dropdown.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-in-page-wizard.mjs +72 -0
- package/fesm2020/sebgroup-green-angular-src-lib-in-page-wizard.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-modal.mjs +326 -0
- package/fesm2020/sebgroup-green-angular-src-lib-modal.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-pagination.mjs +197 -0
- package/fesm2020/sebgroup-green-angular-src-lib-pagination.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-progress-circle.mjs +63 -0
- package/fesm2020/sebgroup-green-angular-src-lib-progress-circle.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-segmented-control.mjs +58 -0
- package/fesm2020/sebgroup-green-angular-src-lib-segmented-control.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-shared.mjs +113 -0
- package/fesm2020/sebgroup-green-angular-src-lib-shared.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-slider.mjs +135 -0
- package/fesm2020/sebgroup-green-angular-src-lib-slider.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular-src-lib-sortable-list.mjs +204 -0
- package/fesm2020/sebgroup-green-angular-src-lib-sortable-list.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular.mjs +96 -85
- package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
- package/lib/context-menu/context-menu.component.d.ts +1 -1
- package/lib/context-menu/context-menu.module.d.ts +1 -1
- package/lib/datepicker/datepicker.module.d.ts +2 -3
- package/lib/dropdown/dropdown.module.d.ts +1 -1
- package/lib/modal/modal.component.d.ts +2 -1
- package/lib/shared/index.d.ts +1 -0
- package/package.json +125 -4
- package/src/lib/accordion/accordion-list-item.component.d.ts +15 -0
- package/src/lib/accordion/accordion.component.d.ts +16 -0
- package/src/lib/accordion/accordion.module.d.ts +9 -0
- package/src/lib/accordion/index.d.ts +3 -0
- package/src/lib/badge/badge.component.d.ts +25 -0
- package/src/lib/badge/badge.module.d.ts +8 -0
- package/src/lib/badge/index.d.ts +2 -0
- package/src/lib/button/button.component.d.ts +9 -0
- package/src/lib/button/button.module.d.ts +8 -0
- package/src/lib/button/index.d.ts +2 -0
- package/src/lib/cell-table/cell-table-item.component.d.ts +14 -0
- package/src/lib/cell-table/cell-table.component.d.ts +44 -0
- package/src/lib/cell-table/cell-table.module.d.ts +10 -0
- package/src/lib/cell-table/cell-table.types.d.ts +34 -0
- package/src/lib/cell-table/cell-underline.directive.d.ts +14 -0
- package/src/lib/cell-table/index.d.ts +3 -0
- package/src/lib/context-menu/context-menu.component.d.ts +49 -0
- package/src/lib/context-menu/context-menu.module.d.ts +9 -0
- package/src/lib/context-menu/index.d.ts +2 -0
- package/src/lib/datepicker/datepicker.component.d.ts +66 -0
- package/src/lib/datepicker/datepicker.module.d.ts +9 -0
- package/src/lib/datepicker/index.d.ts +2 -0
- package/src/lib/dropdown/dropdown-button.directive.d.ts +8 -0
- package/src/lib/dropdown/dropdown-option.directive.d.ts +8 -0
- package/src/lib/dropdown/dropdown.component.d.ts +79 -0
- package/src/lib/dropdown/dropdown.module.d.ts +11 -0
- package/src/lib/dropdown/index.d.ts +4 -0
- package/src/lib/in-page-wizard/in-page-wizard-step-card.component.d.ts +17 -0
- package/src/lib/in-page-wizard/in-page-wizard.module.d.ts +8 -0
- package/src/lib/in-page-wizard/index.d.ts +2 -0
- package/src/lib/modal/index.d.ts +4 -0
- package/src/lib/modal/modal-footer.directive.d.ts +8 -0
- package/src/lib/modal/modal-header.directive.d.ts +8 -0
- package/src/lib/modal/modal.component.d.ts +66 -0
- package/src/lib/modal/modal.module.d.ts +11 -0
- package/src/lib/pagination/index.d.ts +2 -0
- package/src/lib/pagination/pagination.component.d.ts +42 -0
- package/src/lib/pagination/pagination.module.d.ts +8 -0
- package/src/lib/progress-circle/index.d.ts +2 -0
- package/src/lib/progress-circle/progress-circle.component.d.ts +14 -0
- package/src/lib/progress-circle/progress-circle.module.d.ts +8 -0
- package/src/lib/segmented-control/index.d.ts +2 -0
- package/src/lib/segmented-control/segmented-control.component.d.ts +11 -0
- package/src/lib/segmented-control/segmented-control.module.d.ts +9 -0
- package/src/lib/shared/core-element/core-element.directive.d.ts +13 -0
- package/src/lib/shared/core-element/core-element.module.d.ts +8 -0
- package/src/lib/shared/core-element/index.d.ts +2 -0
- package/src/lib/shared/index.d.ts +3 -0
- package/src/lib/shared/on-scroll.directive.d.ts +14 -0
- package/src/lib/shared/shared.module.d.ts +8 -0
- package/src/lib/slider/index.d.ts +2 -0
- package/src/lib/slider/slider.component.d.ts +38 -0
- package/src/lib/slider/slider.module.d.ts +9 -0
- package/src/lib/sortable-list/index.d.ts +2 -0
- package/src/lib/sortable-list/sortable-list.component.d.ts +91 -0
- package/src/lib/sortable-list/sortable-list.module.d.ts +10 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import { randomId } from '@sebgroup/extract';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
class NggAccordionListItemComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.id = randomId();
|
|
10
|
+
this.listItemHeader = '';
|
|
11
|
+
this.listItemSubHeader = '';
|
|
12
|
+
this.expandedChange = new EventEmitter();
|
|
13
|
+
this.contentHeight = '0px';
|
|
14
|
+
this.isExpanded = false;
|
|
15
|
+
}
|
|
16
|
+
shrink() {
|
|
17
|
+
this.isExpanded = false;
|
|
18
|
+
this.contentHeight = '0px';
|
|
19
|
+
}
|
|
20
|
+
expand() {
|
|
21
|
+
this.isExpanded = true;
|
|
22
|
+
this.contentHeight = 'auto';
|
|
23
|
+
}
|
|
24
|
+
toggleExpanded() {
|
|
25
|
+
this.isExpanded = !this.isExpanded;
|
|
26
|
+
if (this.isExpanded) {
|
|
27
|
+
this.contentHeight = 'auto';
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.contentHeight = '0px';
|
|
31
|
+
}
|
|
32
|
+
this.expandedChange.emit(this);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
NggAccordionListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
NggAccordionListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NggAccordionListItemComponent, selector: "div[ngg-accordion-list-item]", inputs: { id: "id", listItemHeader: "listItemHeader", listItemSubHeader: "listItemSubHeader" }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: "<ng-container data-testid=\"accordion-list-item-root\">\n <div role=\"heading\" aria-level=\"2\" [attr.id]=\"id\">\n <button\n data-testid=\"accordion-list-item-expander-button\"\n [attr.id]=\"id + '_header'\"\n (click)=\"toggleExpanded()\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"this.isExpanded\"\n [attr.aria-controls]=\"id + '_section'\"\n >\n <span data-testid=\"accordion-list-item-header\">{{ listItemHeader }}</span>\n <span data-testid=\"accordion-list-item-subheader\">{{\n listItemSubHeader\n }}</span>\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.8095 9.22817L18.1907 8.60942C18.0438 8.46255 17.8063 8.46255 17.6595 8.60942L12.0001 14.2563L6.34072 8.60942C6.19385 8.46255 5.95635 8.46255 5.80947 8.60942L5.19072 9.22817C5.04385 9.37505 5.04385 9.61255 5.19072 9.75942L11.7345 16.3032C11.8813 16.45 12.1188 16.45 12.2657 16.3032L18.8095 9.75942C18.9563 9.61255 18.9563 9.37505 18.8095 9.22817Z\"\n fill=\"#333333\"\n />\n </svg>\n </button>\n <div\n role=\"region\"\n [hidden]=\"!this.isExpanded\"\n [ngStyle]=\"{ height: this.contentHeight }\"\n [id]=\"id + '_section'\"\n [attr.aria-labelledby]=\"id + '_header'\"\n data-testid=\"accordion-list-item-content\"\n >\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionListItemComponent, decorators: [{
|
|
38
|
+
type: Component,
|
|
39
|
+
args: [{ selector: 'div[ngg-accordion-list-item]', template: "<ng-container data-testid=\"accordion-list-item-root\">\n <div role=\"heading\" aria-level=\"2\" [attr.id]=\"id\">\n <button\n data-testid=\"accordion-list-item-expander-button\"\n [attr.id]=\"id + '_header'\"\n (click)=\"toggleExpanded()\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"this.isExpanded\"\n [attr.aria-controls]=\"id + '_section'\"\n >\n <span data-testid=\"accordion-list-item-header\">{{ listItemHeader }}</span>\n <span data-testid=\"accordion-list-item-subheader\">{{\n listItemSubHeader\n }}</span>\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.8095 9.22817L18.1907 8.60942C18.0438 8.46255 17.8063 8.46255 17.6595 8.60942L12.0001 14.2563L6.34072 8.60942C6.19385 8.46255 5.95635 8.46255 5.80947 8.60942L5.19072 9.22817C5.04385 9.37505 5.04385 9.61255 5.19072 9.75942L11.7345 16.3032C11.8813 16.45 12.1188 16.45 12.2657 16.3032L18.8095 9.75942C18.9563 9.61255 18.9563 9.37505 18.8095 9.22817Z\"\n fill=\"#333333\"\n />\n </svg>\n </button>\n <div\n role=\"region\"\n [hidden]=\"!this.isExpanded\"\n [ngStyle]=\"{ height: this.contentHeight }\"\n [id]=\"id + '_section'\"\n [attr.aria-labelledby]=\"id + '_header'\"\n data-testid=\"accordion-list-item-content\"\n >\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</ng-container>\n" }]
|
|
40
|
+
}], propDecorators: { id: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}], listItemHeader: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}], listItemSubHeader: [{
|
|
45
|
+
type: Input
|
|
46
|
+
}], expandedChange: [{
|
|
47
|
+
type: Output
|
|
48
|
+
}] } });
|
|
49
|
+
|
|
50
|
+
class NggAccordionComponent {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.closeOthers = false;
|
|
53
|
+
}
|
|
54
|
+
get expandAll() {
|
|
55
|
+
return this._expandAll;
|
|
56
|
+
}
|
|
57
|
+
set expandAll(value) {
|
|
58
|
+
if (value === this._expandAll)
|
|
59
|
+
return;
|
|
60
|
+
if (this._expandAll) {
|
|
61
|
+
this.expandAllSubscription?.unsubscribe();
|
|
62
|
+
}
|
|
63
|
+
this._expandAll = value;
|
|
64
|
+
this.expandAllSubscription = this._expandAll?.subscribe(() => {
|
|
65
|
+
if (this.closeOthers === false) {
|
|
66
|
+
const itemArray = this.items ? Array.from(this.items) : undefined;
|
|
67
|
+
if (itemArray) {
|
|
68
|
+
for (const i of itemArray) {
|
|
69
|
+
i.expand();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
ngAfterContentChecked() {
|
|
76
|
+
if (this.closeOthers) {
|
|
77
|
+
const itemArray = this.items ? Array.from(this.items) : undefined;
|
|
78
|
+
if (itemArray) {
|
|
79
|
+
for (const i of itemArray) {
|
|
80
|
+
i.expandedChange.subscribe((child) => this.onChildExpanded(child));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
ngOnDestroy() {
|
|
86
|
+
if (this.closeOthers) {
|
|
87
|
+
const itemArray = this.items ? Array.from(this.items) : undefined;
|
|
88
|
+
if (itemArray) {
|
|
89
|
+
for (const i of itemArray) {
|
|
90
|
+
i.expandedChange.unsubscribe();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.expandAllSubscription?.unsubscribe();
|
|
95
|
+
}
|
|
96
|
+
onChildExpanded(childIdentity) {
|
|
97
|
+
if (this.closeOthers && childIdentity.isExpanded && this.items) {
|
|
98
|
+
this.items.forEach((item) => {
|
|
99
|
+
if (item !== childIdentity)
|
|
100
|
+
item.shrink();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
NggAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
NggAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NggAccordionComponent, selector: "ngg-accordion", inputs: { closeOthers: "closeOthers", expandAll: "expandAll" }, queries: [{ propertyName: "items", predicate: NggAccordionListItemComponent }], ngImport: i0, template: "<div class=\"accordion\" data-testid=\"accordion-root\">\n <ng-content></ng-content>\n</div>\n" });
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionComponent, decorators: [{
|
|
108
|
+
type: Component,
|
|
109
|
+
args: [{ selector: 'ngg-accordion', template: "<div class=\"accordion\" data-testid=\"accordion-root\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
110
|
+
}], propDecorators: { items: [{
|
|
111
|
+
type: ContentChildren,
|
|
112
|
+
args: [NggAccordionListItemComponent]
|
|
113
|
+
}], closeOthers: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], expandAll: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}] } });
|
|
118
|
+
|
|
119
|
+
class NggAccordionModule {
|
|
120
|
+
}
|
|
121
|
+
NggAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
122
|
+
NggAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionModule, declarations: [NggAccordionListItemComponent, NggAccordionComponent], imports: [CommonModule], exports: [NggAccordionListItemComponent, NggAccordionComponent] });
|
|
123
|
+
NggAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionModule, imports: [CommonModule] });
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggAccordionModule, decorators: [{
|
|
125
|
+
type: NgModule,
|
|
126
|
+
args: [{
|
|
127
|
+
imports: [CommonModule],
|
|
128
|
+
exports: [NggAccordionListItemComponent, NggAccordionComponent],
|
|
129
|
+
declarations: [NggAccordionListItemComponent, NggAccordionComponent],
|
|
130
|
+
}]
|
|
131
|
+
}] });
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Generated bundle index. Do not edit.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
export { NggAccordionComponent, NggAccordionListItemComponent, NggAccordionModule };
|
|
138
|
+
//# sourceMappingURL=sebgroup-green-angular-src-lib-accordion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sebgroup-green-angular-src-lib-accordion.mjs","sources":["../../../../libs/angular/src/lib/accordion/accordion-list-item.component.ts","../../../../libs/angular/src/lib/accordion/accordion-list-item.component.html","../../../../libs/angular/src/lib/accordion/accordion.component.ts","../../../../libs/angular/src/lib/accordion/accordion.component.html","../../../../libs/angular/src/lib/accordion/accordion.module.ts","../../../../libs/angular/src/lib/accordion/sebgroup-green-angular-src-lib-accordion.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core'\nimport { randomId } from '@sebgroup/extract'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'div[ngg-accordion-list-item]',\n templateUrl: './accordion-list-item.component.html',\n})\nexport class NggAccordionListItemComponent {\n @Input() public id: string = randomId()\n @Input() public listItemHeader = ''\n @Input() public listItemSubHeader = ''\n @Output() public expandedChange: EventEmitter<NggAccordionListItemComponent> =\n new EventEmitter<NggAccordionListItemComponent>()\n\n public contentHeight = '0px'\n public isExpanded = false\n\n public shrink(): void {\n this.isExpanded = false\n this.contentHeight = '0px'\n }\n\n public expand(): void {\n this.isExpanded = true\n this.contentHeight = 'auto'\n }\n\n public toggleExpanded(): void {\n this.isExpanded = !this.isExpanded\n if (this.isExpanded) {\n this.contentHeight = 'auto'\n } else {\n this.contentHeight = '0px'\n }\n\n this.expandedChange.emit(this)\n }\n}\n","<ng-container data-testid=\"accordion-list-item-root\">\n <div role=\"heading\" aria-level=\"2\" [attr.id]=\"id\">\n <button\n data-testid=\"accordion-list-item-expander-button\"\n [attr.id]=\"id + '_header'\"\n (click)=\"toggleExpanded()\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"this.isExpanded\"\n [attr.aria-controls]=\"id + '_section'\"\n >\n <span data-testid=\"accordion-list-item-header\">{{ listItemHeader }}</span>\n <span data-testid=\"accordion-list-item-subheader\">{{\n listItemSubHeader\n }}</span>\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.8095 9.22817L18.1907 8.60942C18.0438 8.46255 17.8063 8.46255 17.6595 8.60942L12.0001 14.2563L6.34072 8.60942C6.19385 8.46255 5.95635 8.46255 5.80947 8.60942L5.19072 9.22817C5.04385 9.37505 5.04385 9.61255 5.19072 9.75942L11.7345 16.3032C11.8813 16.45 12.1188 16.45 12.2657 16.3032L18.8095 9.75942C18.9563 9.61255 18.9563 9.37505 18.8095 9.22817Z\"\n fill=\"#333333\"\n />\n </svg>\n </button>\n <div\n role=\"region\"\n [hidden]=\"!this.isExpanded\"\n [ngStyle]=\"{ height: this.contentHeight }\"\n [id]=\"id + '_section'\"\n [attr.aria-labelledby]=\"id + '_header'\"\n data-testid=\"accordion-list-item-content\"\n >\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</ng-container>\n","import {\n AfterContentChecked,\n Component,\n ContentChildren,\n Input,\n OnDestroy,\n QueryList,\n} from '@angular/core'\nimport { Observable, Subscription } from 'rxjs'\nimport { NggAccordionListItemComponent } from './accordion-list-item.component'\n\n@Component({\n selector: 'ngg-accordion',\n templateUrl: './accordion.component.html',\n})\nexport class NggAccordionComponent implements AfterContentChecked, OnDestroy {\n @ContentChildren(NggAccordionListItemComponent) private items:\n | QueryList<NggAccordionListItemComponent>\n | undefined\n private _expandAll: Observable<void> | undefined\n private expandAllSubscription: Subscription | undefined\n @Input() public closeOthers = false\n @Input()\n public get expandAll(): Observable<void> | undefined {\n return this._expandAll\n }\n public set expandAll(value: Observable<void> | undefined) {\n if (value === this._expandAll) return\n if (this._expandAll) {\n this.expandAllSubscription?.unsubscribe()\n }\n\n this._expandAll = value\n this.expandAllSubscription = this._expandAll?.subscribe(() => {\n if (this.closeOthers === false) {\n const itemArray = this.items ? Array.from(this.items) : undefined\n if (itemArray) {\n for (const i of itemArray) {\n i.expand()\n }\n }\n }\n })\n }\n\n public ngAfterContentChecked(): void {\n if (this.closeOthers) {\n const itemArray = this.items ? Array.from(this.items) : undefined\n if (itemArray) {\n for (const i of itemArray) {\n i.expandedChange.subscribe((child) => this.onChildExpanded(child))\n }\n }\n }\n }\n\n public ngOnDestroy(): void {\n if (this.closeOthers) {\n const itemArray = this.items ? Array.from(this.items) : undefined\n if (itemArray) {\n for (const i of itemArray) {\n i.expandedChange.unsubscribe()\n }\n }\n }\n\n this.expandAllSubscription?.unsubscribe()\n }\n\n private onChildExpanded(childIdentity: NggAccordionListItemComponent) {\n if (this.closeOthers && childIdentity.isExpanded && this.items) {\n this.items.forEach((item) => {\n if (item !== childIdentity) item.shrink()\n })\n }\n }\n}\n","<div class=\"accordion\" data-testid=\"accordion-root\">\n <ng-content></ng-content>\n</div>\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { NggAccordionListItemComponent } from './accordion-list-item.component'\nimport { NggAccordionComponent } from './accordion.component'\n\n@NgModule({\n imports: [CommonModule],\n exports: [NggAccordionListItemComponent, NggAccordionComponent],\n declarations: [NggAccordionListItemComponent, NggAccordionComponent],\n})\nexport class NggAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAQa,6BAA6B,CAAA;AAL1C,IAAA,WAAA,GAAA;QAMkB,IAAE,CAAA,EAAA,GAAW,QAAQ,EAAE,CAAA;QACvB,IAAc,CAAA,cAAA,GAAG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ostBinding, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
class NggBadgeComponent {
|
|
7
|
+
//eslint-disable-next-line
|
|
8
|
+
constructor() {
|
|
9
|
+
/** The color of the component */
|
|
10
|
+
this.badgeType = '';
|
|
11
|
+
/** Callback when component is dismissed */
|
|
12
|
+
this.handleClose = new EventEmitter();
|
|
13
|
+
}
|
|
14
|
+
/** Flag whether the component can be dismissed */
|
|
15
|
+
set isCloseable(value) {
|
|
16
|
+
this._isCloseable = value;
|
|
17
|
+
}
|
|
18
|
+
get isCloseable() {
|
|
19
|
+
return this._isCloseable === '' || !!this._isCloseable;
|
|
20
|
+
}
|
|
21
|
+
get class() {
|
|
22
|
+
return ['badge', this.badgeType].join(' ');
|
|
23
|
+
}
|
|
24
|
+
ngOnInit() {
|
|
25
|
+
if (!!this.customColor || !!this.customBackgroundColor) {
|
|
26
|
+
this.badgeType = '';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
close(e) {
|
|
30
|
+
this.handleClose.emit(e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
NggBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
NggBadgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NggBadgeComponent, selector: "[ngg-badge]", inputs: { badgeType: "badgeType", isCloseable: "isCloseable", closeText: "closeText", customColor: "customColor", customBackgroundColor: "customBackgroundColor" }, outputs: { handleClose: "handleClose" }, host: { properties: { "style.color": "this.customColor", "style.background-color": "this.customBackgroundColor", "class": "this.class" } }, ngImport: i0, template: `
|
|
35
|
+
<strong>
|
|
36
|
+
<ng-content></ng-content>
|
|
37
|
+
</strong>
|
|
38
|
+
<button *ngIf="isCloseable" class="close" (click)="close($event)">
|
|
39
|
+
{{ closeText }}
|
|
40
|
+
<i></i>
|
|
41
|
+
</button>
|
|
42
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeComponent, decorators: [{
|
|
44
|
+
type: Component,
|
|
45
|
+
args: [{
|
|
46
|
+
// we need to disable this warning since we don't want the badge component to create a new element
|
|
47
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
48
|
+
selector: '[ngg-badge]',
|
|
49
|
+
template: `
|
|
50
|
+
<strong>
|
|
51
|
+
<ng-content></ng-content>
|
|
52
|
+
</strong>
|
|
53
|
+
<button *ngIf="isCloseable" class="close" (click)="close($event)">
|
|
54
|
+
{{ closeText }}
|
|
55
|
+
<i></i>
|
|
56
|
+
</button>
|
|
57
|
+
`,
|
|
58
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
59
|
+
}]
|
|
60
|
+
}], ctorParameters: function () { return []; }, propDecorators: { badgeType: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], isCloseable: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], closeText: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], customColor: [{
|
|
67
|
+
type: HostBinding,
|
|
68
|
+
args: ['style.color']
|
|
69
|
+
}, {
|
|
70
|
+
type: Input
|
|
71
|
+
}], customBackgroundColor: [{
|
|
72
|
+
type: HostBinding,
|
|
73
|
+
args: ['style.background-color']
|
|
74
|
+
}, {
|
|
75
|
+
type: Input
|
|
76
|
+
}], class: [{
|
|
77
|
+
type: HostBinding,
|
|
78
|
+
args: ['class']
|
|
79
|
+
}], handleClose: [{
|
|
80
|
+
type: Output
|
|
81
|
+
}] } });
|
|
82
|
+
|
|
83
|
+
class NggBadgeModule {
|
|
84
|
+
}
|
|
85
|
+
NggBadgeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
86
|
+
NggBadgeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeModule, declarations: [NggBadgeComponent], imports: [CommonModule], exports: [NggBadgeComponent] });
|
|
87
|
+
NggBadgeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeModule, imports: [CommonModule] });
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggBadgeModule, decorators: [{
|
|
89
|
+
type: NgModule,
|
|
90
|
+
args: [{
|
|
91
|
+
declarations: [NggBadgeComponent],
|
|
92
|
+
imports: [CommonModule],
|
|
93
|
+
exports: [NggBadgeComponent],
|
|
94
|
+
}]
|
|
95
|
+
}] });
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Generated bundle index. Do not edit.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
export { NggBadgeComponent, NggBadgeModule };
|
|
102
|
+
//# sourceMappingURL=sebgroup-green-angular-src-lib-badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sebgroup-green-angular-src-lib-badge.mjs","sources":["../../../../libs/angular/src/lib/badge/badge.component.ts","../../../../libs/angular/src/lib/badge/badge.module.ts","../../../../libs/angular/src/lib/badge/sebgroup-green-angular-src-lib-badge.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Input,\n OnInit,\n Output,\n} from '@angular/core'\nimport { BadgeType } from '@sebgroup/extract'\n\n@Component({\n // we need to disable this warning since we don't want the badge component to create a new element\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[ngg-badge]',\n template: `\n <strong>\n <ng-content></ng-content>\n </strong>\n <button *ngIf=\"isCloseable\" class=\"close\" (click)=\"close($event)\">\n {{ closeText }}\n <i></i>\n </button>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggBadgeComponent implements OnInit {\n /** The color of the component */\n @Input() badgeType?: BadgeType | '' = ''\n /** Flag whether the component can be dismissed */\n @Input() set isCloseable(value: boolean | '') {\n this._isCloseable = value\n }\n get isCloseable(): boolean {\n return this._isCloseable === '' || !!this._isCloseable\n }\n /** Close text */\n @Input() closeText?: string\n /** Custom text color */\n @HostBinding('style.color') @Input() customColor?: string\n /** Custom background color */\n @HostBinding('style.background-color') @Input() customBackgroundColor?: string\n\n @HostBinding('class') get class(): string {\n return ['badge', this.badgeType].join(' ')\n }\n\n /** Callback when component is dismissed */\n @Output() handleClose: EventEmitter<Event> = new EventEmitter()\n\n private _isCloseable?: boolean | ''\n\n //eslint-disable-next-line\n constructor() {}\n\n ngOnInit(): void {\n if (!!this.customColor || !!this.customBackgroundColor) {\n this.badgeType = ''\n }\n }\n\n close(e: Event) {\n this.handleClose.emit(e)\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\n\nimport { NggBadgeComponent } from './badge.component'\n\n@NgModule({\n declarations: [NggBadgeComponent],\n imports: [CommonModule],\n exports: [NggBadgeComponent],\n})\nexport class NggBadgeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA0Ba,iBAAiB,CAAA;;AA2B5B,IAAA,WAAA,GAAA;;QAzBS,IAAS,CAAA,SAAA,GAAoB,EAAE,CAAA;;AAoB9B,QAAA,IAAA,CAAA,WAAW,GAAwB,IAAI,YAAY,EAAE,CAAA;KAK/C;;IAvBhB,IAAa,WAAW,CAAC,KAAmB,EAAA;AAC1C,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAA;KAC1B;AAC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AAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHf,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGX,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class NggButtonComponent {
|
|
6
|
+
get classes() {
|
|
7
|
+
return [this.variant, this.size ? this.size : false]
|
|
8
|
+
.filter(Boolean)
|
|
9
|
+
.join(' ');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
NggButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
NggButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NggButtonComponent, selector: "[ngg-button]", inputs: { variant: "variant", size: "size" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggButtonComponent, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{
|
|
17
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
18
|
+
selector: '[ngg-button]',
|
|
19
|
+
template: `<ng-content></ng-content>`,
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
}]
|
|
22
|
+
}], propDecorators: { variant: [{
|
|
23
|
+
type: Input
|
|
24
|
+
}], size: [{
|
|
25
|
+
type: Input
|
|
26
|
+
}], classes: [{
|
|
27
|
+
type: HostBinding,
|
|
28
|
+
args: ['class']
|
|
29
|
+
}] } });
|
|
30
|
+
|
|
31
|
+
class NggButtonModule {
|
|
32
|
+
}
|
|
33
|
+
NggButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
34
|
+
NggButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NggButtonModule, declarations: [NggButtonComponent], imports: [CommonModule], exports: [NggButtonComponent] });
|
|
35
|
+
NggButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggButtonModule, imports: [CommonModule] });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggButtonModule, decorators: [{
|
|
37
|
+
type: NgModule,
|
|
38
|
+
args: [{
|
|
39
|
+
declarations: [NggButtonComponent],
|
|
40
|
+
imports: [CommonModule],
|
|
41
|
+
exports: [NggButtonComponent],
|
|
42
|
+
}]
|
|
43
|
+
}] });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generated bundle index. Do not edit.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
export { NggButtonComponent, NggButtonModule };
|
|
50
|
+
//# sourceMappingURL=sebgroup-green-angular-src-lib-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sebgroup-green-angular-src-lib-button.mjs","sources":["../../../../libs/angular/src/lib/button/button.component.ts","../../../../libs/angular/src/lib/button/button.module.ts","../../../../libs/angular/src/lib/button/sebgroup-green-angular-src-lib-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n} from '@angular/core'\nimport { ButtonSize, ButtonVariant } from '@sebgroup/extract'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[ngg-button]',\n template: `<ng-content></ng-content>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggButtonComponent {\n @Input() variant?: ButtonVariant\n @Input() size?: ButtonSize\n\n @HostBinding('class') get classes(): string {\n return [this.variant, this.size ? this.size : false]\n .filter(Boolean)\n .join(' ')\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\n\nimport { NggButtonComponent } from './button.component'\n\n@NgModule({\n declarations: [NggButtonComponent],\n imports: [CommonModule],\n exports: [NggButtonComponent],\n})\nexport class NggButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAca,kBAAkB,CAAA;AAI7B,IAAA,IAA0B,OAAO,GAAA;AAC/B,QAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;aACjD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAA;KACb;;+GARU,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,qJAHnB,CAA2B,yBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,e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;"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, Input, Component, QueryList, EventEmitter, ChangeDetectionStrategy, ViewChildren, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@angular/platform-browser';
|
|
6
|
+
|
|
7
|
+
class SlidingUnderlineDirective {
|
|
8
|
+
constructor(element) {
|
|
9
|
+
this.element = element;
|
|
10
|
+
}
|
|
11
|
+
ngOnInit() {
|
|
12
|
+
if (this.element?.nativeElement) {
|
|
13
|
+
this.element.nativeElement.classList.add('slider');
|
|
14
|
+
this.element.nativeElement.addEventListener('animationend', () => {
|
|
15
|
+
this.element.nativeElement.classList.remove('left', 'slider-positive', 'slider-negative');
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
ngOnChanges(changes) {
|
|
20
|
+
if (!this.disabled) {
|
|
21
|
+
if (changes.slidingUnderline &&
|
|
22
|
+
changes.key &&
|
|
23
|
+
!changes.slidingUnderline.isFirstChange() &&
|
|
24
|
+
!changes?.key?.isFirstChange()) {
|
|
25
|
+
if (changes.key.currentValue === changes.key.previousValue) {
|
|
26
|
+
this.addAnimation(changes.slidingUnderline.currentValue, changes.slidingUnderline.previousValue);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (changes.slidingUnderline &&
|
|
31
|
+
!changes.slidingUnderline.isFirstChange()) {
|
|
32
|
+
this.addAnimation(changes.slidingUnderline.currentValue, changes.slidingUnderline.previousValue);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
addAnimation(current, previous) {
|
|
38
|
+
if (current > previous)
|
|
39
|
+
this.element.nativeElement.classList.add('slider-positive');
|
|
40
|
+
else
|
|
41
|
+
this.element.nativeElement.classList.add('slider-negative');
|
|
42
|
+
this.element.nativeElement.classList.add('left');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
SlidingUnderlineDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SlidingUnderlineDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
46
|
+
SlidingUnderlineDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SlidingUnderlineDirective, selector: "[nggSlidingUnderline]", inputs: { nggSlidingUnderline: "nggSlidingUnderline", key: "key", disabled: "disabled" }, usesOnChanges: true, ngImport: i0 });
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SlidingUnderlineDirective, decorators: [{
|
|
48
|
+
type: Directive,
|
|
49
|
+
args: [{
|
|
50
|
+
selector: '[nggSlidingUnderline]',
|
|
51
|
+
}]
|
|
52
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { nggSlidingUnderline: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], key: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], disabled: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}] } });
|
|
59
|
+
|
|
60
|
+
class CellTableItemComponent {
|
|
61
|
+
constructor(sanitizer) {
|
|
62
|
+
this.sanitizer = sanitizer;
|
|
63
|
+
this.valueType = 'string';
|
|
64
|
+
this.id = '';
|
|
65
|
+
this.getSignColor = (value) => {
|
|
66
|
+
if (/[−-]/.test(String(value)))
|
|
67
|
+
return 'text-danger';
|
|
68
|
+
else if (/[1-9]/.test(String(value)))
|
|
69
|
+
return 'text-success';
|
|
70
|
+
return '';
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
transformHTML(value) {
|
|
74
|
+
if (value && value.length) {
|
|
75
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
CellTableItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CellTableItemComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
83
|
+
CellTableItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CellTableItemComponent, selector: "[nggCellTableItem]", inputs: { row: "row", valueType: "valueType", id: "id" }, ngImport: i0, template: `
|
|
84
|
+
<ng-container [ngSwitch]="valueType">
|
|
85
|
+
<span *ngSwitchCase="'string'">{{ row || '–' }}</span>
|
|
86
|
+
<span *ngSwitchCase="'number'">{{ (row | number) || '–' }}</span>
|
|
87
|
+
<span *ngSwitchCase="'datetime'">{{
|
|
88
|
+
(row | date: 'HH:mm:ss') || '–'
|
|
89
|
+
}}</span>
|
|
90
|
+
<span *ngSwitchCase="'date'">{{
|
|
91
|
+
(row | date: 'YYYY-MM-dd') || '–'
|
|
92
|
+
}}</span>
|
|
93
|
+
<span
|
|
94
|
+
*ngSwitchCase="'custom-html'"
|
|
95
|
+
[innerHtml]="transformHTML(row) || '–'"
|
|
96
|
+
></span>
|
|
97
|
+
<span *ngSwitchCase="'sign'" [ngClass]="getSignColor(row)">{{
|
|
98
|
+
row || '–'
|
|
99
|
+
}}</span>
|
|
100
|
+
<span *ngSwitchCase="'pct'">{{ row || '–' }}</span>
|
|
101
|
+
<span *ngSwitchCase="'streamSign'" [nggSlidingUnderline]="row">{{
|
|
102
|
+
row || '–'
|
|
103
|
+
}}</span>
|
|
104
|
+
<span *ngSwitchDefault>–</span>
|
|
105
|
+
</ng-container>
|
|
106
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: SlidingUnderlineDirective, selector: "[nggSlidingUnderline]", inputs: ["nggSlidingUnderline", "key", "disabled"] }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i2.DatePipe, name: "date" }] });
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CellTableItemComponent, decorators: [{
|
|
108
|
+
type: Component,
|
|
109
|
+
args: [{
|
|
110
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
111
|
+
selector: '[nggCellTableItem]',
|
|
112
|
+
template: `
|
|
113
|
+
<ng-container [ngSwitch]="valueType">
|
|
114
|
+
<span *ngSwitchCase="'string'">{{ row || '–' }}</span>
|
|
115
|
+
<span *ngSwitchCase="'number'">{{ (row | number) || '–' }}</span>
|
|
116
|
+
<span *ngSwitchCase="'datetime'">{{
|
|
117
|
+
(row | date: 'HH:mm:ss') || '–'
|
|
118
|
+
}}</span>
|
|
119
|
+
<span *ngSwitchCase="'date'">{{
|
|
120
|
+
(row | date: 'YYYY-MM-dd') || '–'
|
|
121
|
+
}}</span>
|
|
122
|
+
<span
|
|
123
|
+
*ngSwitchCase="'custom-html'"
|
|
124
|
+
[innerHtml]="transformHTML(row) || '–'"
|
|
125
|
+
></span>
|
|
126
|
+
<span *ngSwitchCase="'sign'" [ngClass]="getSignColor(row)">{{
|
|
127
|
+
row || '–'
|
|
128
|
+
}}</span>
|
|
129
|
+
<span *ngSwitchCase="'pct'">{{ row || '–' }}</span>
|
|
130
|
+
<span *ngSwitchCase="'streamSign'" [nggSlidingUnderline]="row">{{
|
|
131
|
+
row || '–'
|
|
132
|
+
}}</span>
|
|
133
|
+
<span *ngSwitchDefault>–</span>
|
|
134
|
+
</ng-container>
|
|
135
|
+
`,
|
|
136
|
+
}]
|
|
137
|
+
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; }, propDecorators: { row: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], valueType: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], id: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}] } });
|
|
144
|
+
|
|
145
|
+
class NggCellTableComponent {
|
|
146
|
+
constructor() {
|
|
147
|
+
this.items = new QueryList();
|
|
148
|
+
/** Make the most left element wrap */
|
|
149
|
+
this.overflowReverse = false;
|
|
150
|
+
/** List of table headers */
|
|
151
|
+
this.headerList = [];
|
|
152
|
+
/** List of data */
|
|
153
|
+
this.rows = [];
|
|
154
|
+
/** Make rows clickable and add arrow to the right */
|
|
155
|
+
this.clickableRows = false;
|
|
156
|
+
/** Label for the chevron of clickable rows */
|
|
157
|
+
this.clickLabel = 'View details';
|
|
158
|
+
/** Callback when a row is clicked */
|
|
159
|
+
this.rowClicked = new EventEmitter();
|
|
160
|
+
// ------------- EVENTS ------------------
|
|
161
|
+
/**
|
|
162
|
+
* handles the logic for when a row is clicked
|
|
163
|
+
* @param {TableRowClickedEvent} value the TableRowClickedEvent
|
|
164
|
+
*/
|
|
165
|
+
this.handleClickRow = (value) => {
|
|
166
|
+
if (this.clickableRows)
|
|
167
|
+
this.rowClicked.emit(value);
|
|
168
|
+
};
|
|
169
|
+
this.getValueTypeFromMain = () => {
|
|
170
|
+
const getMain = this.headerList.find((x) => x.main);
|
|
171
|
+
if (getMain)
|
|
172
|
+
return getMain.valueType || '';
|
|
173
|
+
return '';
|
|
174
|
+
};
|
|
175
|
+
this.getTableHeaderListValueFromNonMain = (header) => {
|
|
176
|
+
if (header.valueType)
|
|
177
|
+
return header.valueType || '';
|
|
178
|
+
return '';
|
|
179
|
+
};
|
|
180
|
+
this.mainHeader = (row) => {
|
|
181
|
+
const getMain = this.headerList.find((x) => x.main);
|
|
182
|
+
if (row && getMain) {
|
|
183
|
+
return {
|
|
184
|
+
value: row[getMain.tableKeySelector],
|
|
185
|
+
valueType: getMain.valueType || 'string',
|
|
186
|
+
tableKeySelector: getMain.tableKeySelector,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
value: '-',
|
|
191
|
+
valueType: 'string',
|
|
192
|
+
tableKeySelector: '-',
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
this.headerNoneMain = (headers) => {
|
|
196
|
+
if (this.overflowReverse)
|
|
197
|
+
return headers.filter((x) => !x.main).reverse();
|
|
198
|
+
return headers.filter((x) => !x.main);
|
|
199
|
+
};
|
|
200
|
+
this.getTableKeySelector = (row) => {
|
|
201
|
+
return this.mainHeader(row).tableKeySelector + row.rowId;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
// ------- TRACKBY FOR STREAM ------------
|
|
205
|
+
trackByrowId(_, b) {
|
|
206
|
+
return b.rowId;
|
|
207
|
+
}
|
|
208
|
+
KeySelector(_, b) {
|
|
209
|
+
return b.tableKeySelector;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
NggCellTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
213
|
+
NggCellTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NggCellTableComponent, selector: "ngg-cell-table", inputs: { minWidth: "minWidth", overflowReverse: "overflowReverse", className: "className", headerList: "headerList", rows: "rows", clickableRows: "clickableRows", clickLabel: "clickLabel" }, outputs: { rowClicked: "rowClicked" }, viewQueries: [{ propertyName: "items", predicate: ["items"], descendants: true }], ngImport: i0, template: "<div #targetElement role=\"table\" [ngClass]=\"className\">\n <div class=\"cell-table-table d-flex flex-column\">\n <div\n *ngFor=\"let row of rows; trackBy: trackByrowId\"\n (click)=\"handleClickRow(row)\"\n class=\"cell-table--row-wrapper\"\n role=\"rowgroup\"\n [class.is-clickable]=\"clickableRows\"\n >\n <div>\n <div #items [class.overflow-reverse]=\"overflowReverse\">\n <!-- Main header -->\n <div role=\"row\">\n <div\n nggCellTableItem\n [row]=\"mainHeader(row).value\"\n [valueType]=\"getValueTypeFromMain()\"\n [attr.valueType]=\"getValueTypeFromMain()\"\n [attr.id]=\"getTableKeySelector(row)\"\n role=\"rowheader\"\n aria-rowspan=\"3\"\n aria-colspan=\"3\"\n ></div>\n </div>\n <div role=\"row\">\n <div class=\"d-flex\">\n <!-- Sub Header -->\n <div\n nggCellTableItem\n class=\"sub-header py-0 fw-bold\"\n [row]=\"header.label\"\n [valueType]=\"getTableHeaderListValueFromNonMain(header)\"\n role=\"columnheader\"\n *ngFor=\"\n let header of headerNoneMain(headerList);\n trackBy: KeySelector\n \"\n ></div>\n </div>\n </div>\n\n <div role=\"row\">\n <!-- Sub Values -->\n <div class=\"d-flex\">\n <div\n nggCellTableItem\n class=\"sub-value py-0\"\n [row]=\"row[header.tableKeySelector]\"\n [valueType]=\"getTableHeaderListValueFromNonMain(header)\"\n [attr.valueType]=\"header.valueType\"\n role=\"cell\"\n *ngFor=\"\n let header of headerNoneMain(headerList);\n trackBy: KeySelector\n \"\n ></div>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"clickableRows\"\n role=\"row\"\n class=\"d-grid align-items-center ms-4 me-4 cell-table--arrow-container\"\n >\n <div role=\"cell\">\n <div\n role=\"button\"\n [attr.aria-label]=\"clickLabel\"\n tabindex=\"0\"\n [attr.aria-describedby]=\"getTableKeySelector(row)\"\n (keydown.enter)=\"handleClickRow(row)\"\n >\n <svg\n data-prefix=\"far\"\n data-icon=\"chevron-right\"\n class=\"svg-inline--fa fa-chevron-right fa-w-10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z\"\n ></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["[role=rowheader]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:.5rem}[role=cell],[role=columnheader]{flex:1 1 0;margin-bottom:.125rem}.cell-table--row-wrapper{border-top:1px solid var(--gds-ref-pallet-base400);display:flex;padding:1rem}.cell-table--row-wrapper>div:first-child{flex:1 1 0}.cell-table--row-wrapper.is-clickable{cursor:pointer}.cell-table--row-wrapper.is-clickable:hover{background-color:var(--gds-ref-pallet-base100)}.cell-table--arrow-container{flex:0 0 auto;width:10px}.cell-table--arrow-container [tabindex=\"0\"]:focus{outline:2px solid var(--gds-ref-pallet-base800)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CellTableItemComponent, selector: "[nggCellTableItem]", inputs: ["row", "valueType", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableComponent, decorators: [{
|
|
215
|
+
type: Component,
|
|
216
|
+
args: [{ selector: 'ngg-cell-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #targetElement role=\"table\" [ngClass]=\"className\">\n <div class=\"cell-table-table d-flex flex-column\">\n <div\n *ngFor=\"let row of rows; trackBy: trackByrowId\"\n (click)=\"handleClickRow(row)\"\n class=\"cell-table--row-wrapper\"\n role=\"rowgroup\"\n [class.is-clickable]=\"clickableRows\"\n >\n <div>\n <div #items [class.overflow-reverse]=\"overflowReverse\">\n <!-- Main header -->\n <div role=\"row\">\n <div\n nggCellTableItem\n [row]=\"mainHeader(row).value\"\n [valueType]=\"getValueTypeFromMain()\"\n [attr.valueType]=\"getValueTypeFromMain()\"\n [attr.id]=\"getTableKeySelector(row)\"\n role=\"rowheader\"\n aria-rowspan=\"3\"\n aria-colspan=\"3\"\n ></div>\n </div>\n <div role=\"row\">\n <div class=\"d-flex\">\n <!-- Sub Header -->\n <div\n nggCellTableItem\n class=\"sub-header py-0 fw-bold\"\n [row]=\"header.label\"\n [valueType]=\"getTableHeaderListValueFromNonMain(header)\"\n role=\"columnheader\"\n *ngFor=\"\n let header of headerNoneMain(headerList);\n trackBy: KeySelector\n \"\n ></div>\n </div>\n </div>\n\n <div role=\"row\">\n <!-- Sub Values -->\n <div class=\"d-flex\">\n <div\n nggCellTableItem\n class=\"sub-value py-0\"\n [row]=\"row[header.tableKeySelector]\"\n [valueType]=\"getTableHeaderListValueFromNonMain(header)\"\n [attr.valueType]=\"header.valueType\"\n role=\"cell\"\n *ngFor=\"\n let header of headerNoneMain(headerList);\n trackBy: KeySelector\n \"\n ></div>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"clickableRows\"\n role=\"row\"\n class=\"d-grid align-items-center ms-4 me-4 cell-table--arrow-container\"\n >\n <div role=\"cell\">\n <div\n role=\"button\"\n [attr.aria-label]=\"clickLabel\"\n tabindex=\"0\"\n [attr.aria-describedby]=\"getTableKeySelector(row)\"\n (keydown.enter)=\"handleClickRow(row)\"\n >\n <svg\n data-prefix=\"far\"\n data-icon=\"chevron-right\"\n class=\"svg-inline--fa fa-chevron-right fa-w-10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z\"\n ></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["[role=rowheader]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:.5rem}[role=cell],[role=columnheader]{flex:1 1 0;margin-bottom:.125rem}.cell-table--row-wrapper{border-top:1px solid var(--gds-ref-pallet-base400);display:flex;padding:1rem}.cell-table--row-wrapper>div:first-child{flex:1 1 0}.cell-table--row-wrapper.is-clickable{cursor:pointer}.cell-table--row-wrapper.is-clickable:hover{background-color:var(--gds-ref-pallet-base100)}.cell-table--arrow-container{flex:0 0 auto;width:10px}.cell-table--arrow-container [tabindex=\"0\"]:focus{outline:2px solid var(--gds-ref-pallet-base800)}\n"] }]
|
|
217
|
+
}], propDecorators: { items: [{
|
|
218
|
+
type: ViewChildren,
|
|
219
|
+
args: ['items']
|
|
220
|
+
}], minWidth: [{
|
|
221
|
+
type: Input
|
|
222
|
+
}], overflowReverse: [{
|
|
223
|
+
type: Input
|
|
224
|
+
}], className: [{
|
|
225
|
+
type: Input
|
|
226
|
+
}], headerList: [{
|
|
227
|
+
type: Input
|
|
228
|
+
}], rows: [{
|
|
229
|
+
type: Input
|
|
230
|
+
}], clickableRows: [{
|
|
231
|
+
type: Input
|
|
232
|
+
}], clickLabel: [{
|
|
233
|
+
type: Input
|
|
234
|
+
}], rowClicked: [{
|
|
235
|
+
type: Output
|
|
236
|
+
}] } });
|
|
237
|
+
|
|
238
|
+
class NggCellTableModule {
|
|
239
|
+
}
|
|
240
|
+
NggCellTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
241
|
+
NggCellTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableModule, declarations: [NggCellTableComponent,
|
|
242
|
+
CellTableItemComponent,
|
|
243
|
+
SlidingUnderlineDirective], imports: [CommonModule], exports: [NggCellTableComponent] });
|
|
244
|
+
NggCellTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableModule, imports: [CommonModule] });
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NggCellTableModule, decorators: [{
|
|
246
|
+
type: NgModule,
|
|
247
|
+
args: [{
|
|
248
|
+
imports: [CommonModule],
|
|
249
|
+
exports: [NggCellTableComponent],
|
|
250
|
+
declarations: [
|
|
251
|
+
NggCellTableComponent,
|
|
252
|
+
CellTableItemComponent,
|
|
253
|
+
SlidingUnderlineDirective,
|
|
254
|
+
],
|
|
255
|
+
}]
|
|
256
|
+
}] });
|
|
257
|
+
|
|
258
|
+
class Table {
|
|
259
|
+
constructor(table) {
|
|
260
|
+
this.data = table.data;
|
|
261
|
+
this.header = table.header;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Generated bundle index. Do not edit.
|
|
267
|
+
*/
|
|
268
|
+
|
|
269
|
+
export { NggCellTableComponent, NggCellTableModule };
|
|
270
|
+
//# sourceMappingURL=sebgroup-green-angular-src-lib-cell-table.mjs.map
|