@progressio_resources/gravity-design-system 2.1.8 → 2.2.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/esm2022/lib/components/gravity-dialog/gravity-dialog.component.mjs +3 -3
- package/esm2022/lib/components/gravity-notification-instant/gravity-notification-instant-container.component.mjs +3 -3
- package/esm2022/lib/components/gravity-tree-view/gravity-tree-view.component.mjs +62 -0
- package/esm2022/lib/components/gravity-tree-view/models/node-item.mjs +2 -0
- package/esm2022/lib/components/gravity-tree-view/models/node-selected-state.mjs +7 -0
- package/esm2022/lib/components/gravity-tree-view/models/node-state.mjs +2 -0
- package/esm2022/lib/components/gravity-tree-view/models/tree-callbacks.mjs +2 -0
- package/esm2022/lib/components/gravity-tree-view/node/node-checkbox/node-checkbox.component.mjs +26 -0
- package/esm2022/lib/components/gravity-tree-view/node/node-name/node-name.component.mjs +13 -0
- package/esm2022/lib/components/gravity-tree-view/node/node-toggle/node-toggle.component.mjs +15 -0
- package/esm2022/lib/components/gravity-tree-view/node/node.component.mjs +17 -0
- package/esm2022/lib/components/gravity-tree-view/service/tree-service.mjs +350 -0
- package/esm2022/lib/gravity-design-system.module.mjs +22 -5
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/progressio_resources-gravity-design-system.mjs +485 -9
- package/fesm2022/progressio_resources-gravity-design-system.mjs.map +1 -1
- package/lib/components/gravity-tree-view/gravity-tree-view.component.d.ts +19 -0
- package/lib/components/gravity-tree-view/models/node-item.d.ts +9 -0
- package/lib/components/gravity-tree-view/models/node-selected-state.d.ts +5 -0
- package/lib/components/gravity-tree-view/models/node-state.d.ts +13 -0
- package/lib/components/gravity-tree-view/models/tree-callbacks.d.ts +9 -0
- package/lib/components/gravity-tree-view/node/node-checkbox/node-checkbox.component.d.ts +11 -0
- package/lib/components/gravity-tree-view/node/node-name/node-name.component.d.ts +7 -0
- package/lib/components/gravity-tree-view/node/node-toggle/node-toggle.component.d.ts +7 -0
- package/lib/components/gravity-tree-view/node/node.component.d.ts +7 -0
- package/lib/components/gravity-tree-view/service/tree-service.d.ts +57 -0
- package/lib/gravity-design-system.module.d.ts +14 -9
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -14,6 +14,8 @@ import * as i2$2 from 'angular-svg-icon-preloader';
|
|
|
14
14
|
import { AngularSvgIconPreloaderModule } from 'angular-svg-icon-preloader';
|
|
15
15
|
import * as i2$1 from 'ngx-pretty-checkbox';
|
|
16
16
|
import { NgxPrettyCheckboxModule } from 'ngx-pretty-checkbox';
|
|
17
|
+
import { BehaviorSubject, timer } from 'rxjs';
|
|
18
|
+
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
17
19
|
|
|
18
20
|
class GravityIconComponent {
|
|
19
21
|
constructor() {
|
|
@@ -1392,11 +1394,11 @@ class GravityDialogComponent {
|
|
|
1392
1394
|
this.ngbActiveModal.close();
|
|
1393
1395
|
}
|
|
1394
1396
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityDialogComponent, deps: [{ token: i1$2.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1395
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GravityDialogComponent, selector: "ng-component", inputs: { dialogContent: "dialogContent" }, ngImport: i0, template: "<div class=\"dialog-header\">\n <div class=\"hr-title lg-bold title\">\n <gravity-icon class=\"title-icon\" *ngIf=\"dialogContent.titleIconName && dialogContent.titleIconName.length > 0\"\n [iconName]=\"dialogContent.titleIconName\" [title]=\"dialogContent.titleIconName\"
|
|
1397
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GravityDialogComponent, selector: "ng-component", inputs: { dialogContent: "dialogContent" }, ngImport: i0, template: "<div class=\"dialog-header\">\n <div class=\"hr-title lg-bold title\">\n <gravity-icon class=\"title-icon\" *ngIf=\"dialogContent.titleIconName && dialogContent.titleIconName.length > 0\"\n [iconName]=\"dialogContent.titleIconName\" [title]=\"dialogContent.titleIconName\"></gravity-icon>\n {{dialogContent.title}}\n </div>\n <gravity-icon class=\"close\" (click)=\"closeModal()\" [iconName]=\"'unsuccess'\" *ngIf=\"dialogContent.showCloseIcon\"\n [size]=\"'sm'\" [title]=\"'Close'\"></gravity-icon>\n</div>\n\n<div class=\"dialog-body\" [class.with-footer]=\"dialogContent.footerTemplateRef || dialogContent.footerTemplateComponent\">\n <ng-container *ngIf=\"dialogContent.contentTemplateRef\">\n <ng-container *ngTemplateOutlet=\"dialogContent.contentTemplateRef\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"dialogContent.contentTemplateComponent\">\n <ng-container\n *ngComponentOutlet=\"dialogContent.contentTemplateComponent; inputs: dialogContent.componentInputs\"></ng-container>\n </ng-container>\n</div>\n\n<div class=\"dialog-footer\" *ngIf=\"dialogContent.footerTemplateRef || dialogContent.footerTemplateComponent\">\n <ng-container *ngIf=\"dialogContent.footerTemplateRef\">\n <ng-container *ngTemplateOutlet=\"dialogContent.footerTemplateRef\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"dialogContent.footerTemplateComponent\">\n <ng-container *ngComponentOutlet=\"dialogContent.footerTemplateComponent\"></ng-container>\n </ng-container>\n</div>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}.dialog-header{align-items:center;background-color:var(--bg-dialog-header-primary);border-radius:.625rem .625rem 0 0;color:var(--on-bg-dialog-header-primary);display:flex;height:5rem;justify-content:space-between;padding:1rem 3rem}.dialog-header .title{align-items:center;display:flex}.dialog-header .title .title-icon{align-items:center;background-color:var(--bg-icon-dialog-primary);display:flex;border-radius:50%;justify-content:center;line-height:0;margin-right:1rem;min-height:2.5rem;min-width:2.5rem;padding:.5rem}.dialog-header .title .title-icon ::ng-deep svg-icon{--icon-color: var(--on-bg-icon-dialog-primary)}.dialog-header gravity-icon.close{align-items:center;border-radius:50%;cursor:pointer;display:flex;height:1rem;line-height:0;justify-content:center;width:1rem}.dialog-header gravity-icon.close ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-active-primary)}.dialog-header gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}.dialog-header gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.dialog-body{padding:1.5rem 3rem 2rem;position:relative}.dialog-body.with-footer{padding-bottom:1rem}.dialog-footer:not(:empty){padding:1rem 3rem 1.5rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GravityIconComponent, selector: "gravity-icon", inputs: ["customIconColorVariable", "iconName", "hoverIcon", "size"] }] }); }
|
|
1396
1398
|
}
|
|
1397
1399
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityDialogComponent, decorators: [{
|
|
1398
1400
|
type: Component,
|
|
1399
|
-
args: [{ template: "<div class=\"dialog-header\">\n <div class=\"hr-title lg-bold title\">\n <gravity-icon class=\"title-icon\" *ngIf=\"dialogContent.titleIconName && dialogContent.titleIconName.length > 0\"\n [iconName]=\"dialogContent.titleIconName\" [title]=\"dialogContent.titleIconName\"
|
|
1401
|
+
args: [{ template: "<div class=\"dialog-header\">\n <div class=\"hr-title lg-bold title\">\n <gravity-icon class=\"title-icon\" *ngIf=\"dialogContent.titleIconName && dialogContent.titleIconName.length > 0\"\n [iconName]=\"dialogContent.titleIconName\" [title]=\"dialogContent.titleIconName\"></gravity-icon>\n {{dialogContent.title}}\n </div>\n <gravity-icon class=\"close\" (click)=\"closeModal()\" [iconName]=\"'unsuccess'\" *ngIf=\"dialogContent.showCloseIcon\"\n [size]=\"'sm'\" [title]=\"'Close'\"></gravity-icon>\n</div>\n\n<div class=\"dialog-body\" [class.with-footer]=\"dialogContent.footerTemplateRef || dialogContent.footerTemplateComponent\">\n <ng-container *ngIf=\"dialogContent.contentTemplateRef\">\n <ng-container *ngTemplateOutlet=\"dialogContent.contentTemplateRef\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"dialogContent.contentTemplateComponent\">\n <ng-container\n *ngComponentOutlet=\"dialogContent.contentTemplateComponent; inputs: dialogContent.componentInputs\"></ng-container>\n </ng-container>\n</div>\n\n<div class=\"dialog-footer\" *ngIf=\"dialogContent.footerTemplateRef || dialogContent.footerTemplateComponent\">\n <ng-container *ngIf=\"dialogContent.footerTemplateRef\">\n <ng-container *ngTemplateOutlet=\"dialogContent.footerTemplateRef\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"dialogContent.footerTemplateComponent\">\n <ng-container *ngComponentOutlet=\"dialogContent.footerTemplateComponent\"></ng-container>\n </ng-container>\n</div>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}.dialog-header{align-items:center;background-color:var(--bg-dialog-header-primary);border-radius:.625rem .625rem 0 0;color:var(--on-bg-dialog-header-primary);display:flex;height:5rem;justify-content:space-between;padding:1rem 3rem}.dialog-header .title{align-items:center;display:flex}.dialog-header .title .title-icon{align-items:center;background-color:var(--bg-icon-dialog-primary);display:flex;border-radius:50%;justify-content:center;line-height:0;margin-right:1rem;min-height:2.5rem;min-width:2.5rem;padding:.5rem}.dialog-header .title .title-icon ::ng-deep svg-icon{--icon-color: var(--on-bg-icon-dialog-primary)}.dialog-header gravity-icon.close{align-items:center;border-radius:50%;cursor:pointer;display:flex;height:1rem;line-height:0;justify-content:center;width:1rem}.dialog-header gravity-icon.close ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-active-primary)}.dialog-header gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}.dialog-header gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.dialog-body{padding:1.5rem 3rem 2rem;position:relative}.dialog-body.with-footer{padding-bottom:1rem}.dialog-footer:not(:empty){padding:1rem 3rem 1.5rem}\n"] }]
|
|
1400
1402
|
}], ctorParameters: function () { return [{ type: i1$2.NgbActiveModal }]; }, propDecorators: { dialogContent: [{
|
|
1401
1403
|
type: Input
|
|
1402
1404
|
}] } });
|
|
@@ -1445,11 +1447,11 @@ class GravityNotificationInstantContainerComponent {
|
|
|
1445
1447
|
this.delay = 5000;
|
|
1446
1448
|
}
|
|
1447
1449
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityNotificationInstantContainerComponent, deps: [{ token: GravityInstantNotificationsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1448
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GravityNotificationInstantContainerComponent, selector: "gravity-notification-instant-container", inputs: { delay: "delay" }, ngImport: i0, template: "<ngb-toast [autohide]=\"true\"\n [delay]=\"delay\"\n\n (hidden)=\"gravityInstantNotificationsService.hideNotification(i)\"\n\n *ngFor=\"let notification of gravityInstantNotificationsService.notifications; index as i\">\n <main class=\"alert-content {{notification.state}}\">\n <gravity-icon class=\"close\" (click)=\"gravityInstantNotificationsService.hideNotification(i)\"\n data-cy=\"gravity_notification_instant_close_icon\" [iconName]=\"'unsuccess'\" [title]=\"'Close'\"></gravity-icon>\n\n <div class=\"title\">\n <gravity-icon class=\"title-icon\" [iconName]=\"'notification_' + notification.state\"></gravity-icon>\n <h1 class=\"hr-title lg-bold\">{{notification.title}}</h1>\n </div>\n\n <div class=\"content\">\n <h2 class=\"hr-body-text md-regular\">{{notification.text}}</h2>\n </div>\n </main>\n</ngb-toast>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}:host{padding:1rem;position:fixed;right:0;top:0;z-index:1200}main.alert-content{background-color:var(--bg-notification-primary);border-bottom:.75rem solid var(--notification-highlight-color);border-radius:.625rem;box-shadow:0 27px 34px #000c208f;color:var(--on-bg-notification-primary);margin-bottom:1rem;padding:1rem 1.5rem;position:relative;width:23rem}main.alert-content.success{--notification-highlight-color: var(--notification-success-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-success-primary);--notification-icon-color: var(--on-bg-icon-notification-success-primary)}main.alert-content.error{--notification-highlight-color: var(--notification-error-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-error-primary);--notification-icon-color: var(--on-bg-icon-notification-error-primary)}main.alert-content.warning{--notification-highlight-color: var(--notification-warning-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-warning-primary);--notification-icon-color: var(--on-bg-icon-notification-warning-primary)}gravity-icon.close{cursor:pointer;height:1rem;position:absolute;right:.75rem;top:.625rem;width:1rem}gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.title{align-items:center;display:flex}.title gravity-icon.title-icon{align-items:center;background-color:var(--notification-icon-background-color);border-radius:50%;display:flex;height:2rem;line-height:0;justify-content:center;margin-right:1rem;max-height:2rem;max-width:2rem;min-height:2rem;min-width:2rem;padding:.5rem;width:2rem}.title gravity-icon.title-icon ::ng-deep svg-icon{--icon-color: var(--notification-icon-color)}.content{margin-left:3rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i1$2.NgbToast, selector: "ngb-toast", inputs: ["animation", "delay", "autohide", "header"], outputs: ["shown", "hidden"], exportAs: ["ngbToast"] }, { kind: "component", type: GravityIconComponent, selector: "gravity-icon", inputs: ["customIconColorVariable", "iconName", "hoverIcon", "size"] }] }); }
|
|
1450
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GravityNotificationInstantContainerComponent, selector: "gravity-notification-instant-container", inputs: { delay: "delay" }, ngImport: i0, template: "<ngb-toast [autohide]=\"true\"\n [delay]=\"delay\"\n\n (hidden)=\"gravityInstantNotificationsService.hideNotification(i)\"\n\n *ngFor=\"let notification of gravityInstantNotificationsService.notifications; index as i\">\n <main class=\"alert-content {{notification.state}}\">\n <gravity-icon class=\"close\" (click)=\"gravityInstantNotificationsService.hideNotification(i)\"\n data-cy=\"gravity_notification_instant_close_icon\" [iconName]=\"'unsuccess'\" [size]=\"'sm'\"\n [title]=\"'Close'\"></gravity-icon>\n\n <div class=\"title\">\n <gravity-icon class=\"title-icon\" [iconName]=\"'notification_' + notification.state\"></gravity-icon>\n <h1 class=\"hr-title lg-bold\">{{notification.title}}</h1>\n </div>\n\n <div class=\"content\">\n <h2 class=\"hr-body-text md-regular\">{{notification.text}}</h2>\n </div>\n </main>\n</ngb-toast>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}:host{padding:1rem;position:fixed;right:0;top:0;z-index:1200}main.alert-content{background-color:var(--bg-notification-primary);border-bottom:.75rem solid var(--notification-highlight-color);border-radius:.625rem;box-shadow:0 27px 34px #000c208f;color:var(--on-bg-notification-primary);margin-bottom:1rem;padding:1rem 1.5rem;position:relative;width:23rem}main.alert-content.success{--notification-highlight-color: var(--notification-success-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-success-primary);--notification-icon-color: var(--on-bg-icon-notification-success-primary)}main.alert-content.error{--notification-highlight-color: var(--notification-error-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-error-primary);--notification-icon-color: var(--on-bg-icon-notification-error-primary)}main.alert-content.warning{--notification-highlight-color: var(--notification-warning-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-warning-primary);--notification-icon-color: var(--on-bg-icon-notification-warning-primary)}gravity-icon.close{cursor:pointer;height:1rem;position:absolute;right:.75rem;top:.625rem;width:1rem}gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.title{align-items:center;display:flex}.title gravity-icon.title-icon{align-items:center;background-color:var(--notification-icon-background-color);border-radius:50%;display:flex;height:2rem;line-height:0;justify-content:center;margin-right:1rem;max-height:2rem;max-width:2rem;min-height:2rem;min-width:2rem;padding:.5rem;width:2rem}.title gravity-icon.title-icon ::ng-deep svg-icon{--icon-color: var(--notification-icon-color)}.content{margin-left:3rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i1$2.NgbToast, selector: "ngb-toast", inputs: ["animation", "delay", "autohide", "header"], outputs: ["shown", "hidden"], exportAs: ["ngbToast"] }, { kind: "component", type: GravityIconComponent, selector: "gravity-icon", inputs: ["customIconColorVariable", "iconName", "hoverIcon", "size"] }] }); }
|
|
1449
1451
|
}
|
|
1450
1452
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityNotificationInstantContainerComponent, decorators: [{
|
|
1451
1453
|
type: Component,
|
|
1452
|
-
args: [{ selector: 'gravity-notification-instant-container', template: "<ngb-toast [autohide]=\"true\"\n [delay]=\"delay\"\n\n (hidden)=\"gravityInstantNotificationsService.hideNotification(i)\"\n\n *ngFor=\"let notification of gravityInstantNotificationsService.notifications; index as i\">\n <main class=\"alert-content {{notification.state}}\">\n <gravity-icon class=\"close\" (click)=\"gravityInstantNotificationsService.hideNotification(i)\"\n data-cy=\"gravity_notification_instant_close_icon\" [iconName]=\"'unsuccess'\" [title]=\"'Close'\"></gravity-icon>\n\n <div class=\"title\">\n <gravity-icon class=\"title-icon\" [iconName]=\"'notification_' + notification.state\"></gravity-icon>\n <h1 class=\"hr-title lg-bold\">{{notification.title}}</h1>\n </div>\n\n <div class=\"content\">\n <h2 class=\"hr-body-text md-regular\">{{notification.text}}</h2>\n </div>\n </main>\n</ngb-toast>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}:host{padding:1rem;position:fixed;right:0;top:0;z-index:1200}main.alert-content{background-color:var(--bg-notification-primary);border-bottom:.75rem solid var(--notification-highlight-color);border-radius:.625rem;box-shadow:0 27px 34px #000c208f;color:var(--on-bg-notification-primary);margin-bottom:1rem;padding:1rem 1.5rem;position:relative;width:23rem}main.alert-content.success{--notification-highlight-color: var(--notification-success-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-success-primary);--notification-icon-color: var(--on-bg-icon-notification-success-primary)}main.alert-content.error{--notification-highlight-color: var(--notification-error-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-error-primary);--notification-icon-color: var(--on-bg-icon-notification-error-primary)}main.alert-content.warning{--notification-highlight-color: var(--notification-warning-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-warning-primary);--notification-icon-color: var(--on-bg-icon-notification-warning-primary)}gravity-icon.close{cursor:pointer;height:1rem;position:absolute;right:.75rem;top:.625rem;width:1rem}gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.title{align-items:center;display:flex}.title gravity-icon.title-icon{align-items:center;background-color:var(--notification-icon-background-color);border-radius:50%;display:flex;height:2rem;line-height:0;justify-content:center;margin-right:1rem;max-height:2rem;max-width:2rem;min-height:2rem;min-width:2rem;padding:.5rem;width:2rem}.title gravity-icon.title-icon ::ng-deep svg-icon{--icon-color: var(--notification-icon-color)}.content{margin-left:3rem}\n"] }]
|
|
1454
|
+
args: [{ selector: 'gravity-notification-instant-container', template: "<ngb-toast [autohide]=\"true\"\n [delay]=\"delay\"\n\n (hidden)=\"gravityInstantNotificationsService.hideNotification(i)\"\n\n *ngFor=\"let notification of gravityInstantNotificationsService.notifications; index as i\">\n <main class=\"alert-content {{notification.state}}\">\n <gravity-icon class=\"close\" (click)=\"gravityInstantNotificationsService.hideNotification(i)\"\n data-cy=\"gravity_notification_instant_close_icon\" [iconName]=\"'unsuccess'\" [size]=\"'sm'\"\n [title]=\"'Close'\"></gravity-icon>\n\n <div class=\"title\">\n <gravity-icon class=\"title-icon\" [iconName]=\"'notification_' + notification.state\"></gravity-icon>\n <h1 class=\"hr-title lg-bold\">{{notification.title}}</h1>\n </div>\n\n <div class=\"content\">\n <h2 class=\"hr-body-text md-regular\">{{notification.text}}</h2>\n </div>\n </main>\n</ngb-toast>\n", styles: [".border-radius-none{border-radius:0}.border-radius-xs{border-radius:.0625rem}.border-radius-sm{border-radius:.3125rem}.border-radius-md{border-radius:.625rem}.border-radius-lg{border-radius:.9375rem}.border-radius-xl{border-radius:1.25rem}.border-radius-xxl{border-radius:2rem}.border-radius-rounded{border-radius:50%}:host{padding:1rem;position:fixed;right:0;top:0;z-index:1200}main.alert-content{background-color:var(--bg-notification-primary);border-bottom:.75rem solid var(--notification-highlight-color);border-radius:.625rem;box-shadow:0 27px 34px #000c208f;color:var(--on-bg-notification-primary);margin-bottom:1rem;padding:1rem 1.5rem;position:relative;width:23rem}main.alert-content.success{--notification-highlight-color: var(--notification-success-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-success-primary);--notification-icon-color: var(--on-bg-icon-notification-success-primary)}main.alert-content.error{--notification-highlight-color: var(--notification-error-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-error-primary);--notification-icon-color: var(--on-bg-icon-notification-error-primary)}main.alert-content.warning{--notification-highlight-color: var(--notification-warning-highlight-primary);--notification-icon-background-color: var(--bg-icon-notification-warning-primary);--notification-icon-color: var(--on-bg-icon-notification-warning-primary)}gravity-icon.close{cursor:pointer;height:1rem;position:absolute;right:.75rem;top:.625rem;width:1rem}gravity-icon.close:hover{background-color:var(--bg-close-dialog-header-hover-primary)}gravity-icon.close:hover ::ng-deep svg-icon{--icon-color: var(--close-dialog-header-hover-primary)}.title{align-items:center;display:flex}.title gravity-icon.title-icon{align-items:center;background-color:var(--notification-icon-background-color);border-radius:50%;display:flex;height:2rem;line-height:0;justify-content:center;margin-right:1rem;max-height:2rem;max-width:2rem;min-height:2rem;min-width:2rem;padding:.5rem;width:2rem}.title gravity-icon.title-icon ::ng-deep svg-icon{--icon-color: var(--notification-icon-color)}.content{margin-left:3rem}\n"] }]
|
|
1453
1455
|
}], ctorParameters: function () { return [{ type: GravityInstantNotificationsService }]; }, propDecorators: { delay: [{
|
|
1454
1456
|
type: Input
|
|
1455
1457
|
}] } });
|
|
@@ -1740,6 +1742,468 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1740
1742
|
args: ['window:resize', ['$event']]
|
|
1741
1743
|
}] } });
|
|
1742
1744
|
|
|
1745
|
+
var NodeSelectedState;
|
|
1746
|
+
(function (NodeSelectedState) {
|
|
1747
|
+
NodeSelectedState[NodeSelectedState["checked"] = 0] = "checked";
|
|
1748
|
+
NodeSelectedState[NodeSelectedState["unChecked"] = 1] = "unChecked";
|
|
1749
|
+
NodeSelectedState[NodeSelectedState["indeterminate"] = 2] = "indeterminate";
|
|
1750
|
+
})(NodeSelectedState || (NodeSelectedState = {}));
|
|
1751
|
+
|
|
1752
|
+
class TreeService {
|
|
1753
|
+
constructor() {
|
|
1754
|
+
this.filterChangeSubject = new BehaviorSubject('');
|
|
1755
|
+
this.selectedItems = [];
|
|
1756
|
+
this.selectedItemsSubject = new BehaviorSubject(this.selectedItems);
|
|
1757
|
+
this.selectedStates = [];
|
|
1758
|
+
this.filterChangeSubjectSubscription = this.filterChangeSubject.pipe(debounceTime(300), distinctUntilChanged()).subscribe(() => {
|
|
1759
|
+
this.filterTraverse(this.treeState, '');
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
ngOnDestroy() {
|
|
1763
|
+
this.filterChangeSubjectSubscription.unsubscribe();
|
|
1764
|
+
}
|
|
1765
|
+
connect() {
|
|
1766
|
+
return this.selectedItemsSubject.asObservable();
|
|
1767
|
+
}
|
|
1768
|
+
setInitialState() {
|
|
1769
|
+
this.setInitialSelectedState(this.treeState);
|
|
1770
|
+
}
|
|
1771
|
+
setInitialSelectedState(nodeStates) {
|
|
1772
|
+
for (const state of nodeStates) {
|
|
1773
|
+
if (state.nodeItem.selected && (!state.children || state.children.length === 0)) {
|
|
1774
|
+
this.toggleSelectedState(state, true);
|
|
1775
|
+
}
|
|
1776
|
+
this.setInitialSelectedState(state.children);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
clear() {
|
|
1780
|
+
for (let state of this.selectedStates) {
|
|
1781
|
+
state.selected = false;
|
|
1782
|
+
state.selectedState = NodeSelectedState.unChecked;
|
|
1783
|
+
}
|
|
1784
|
+
this.selectedItems.length = 0;
|
|
1785
|
+
this.selectedStates.length = 0;
|
|
1786
|
+
}
|
|
1787
|
+
filterTraverse(states, filter) {
|
|
1788
|
+
let results = [];
|
|
1789
|
+
for (let state of states) {
|
|
1790
|
+
if (state.children.length > 0) {
|
|
1791
|
+
state.hasFilteredChildren = false;
|
|
1792
|
+
state.hasFilteredChildren = this.filterTraverse(state.children, filter);
|
|
1793
|
+
if (this.applyFilter(state, filter)) {
|
|
1794
|
+
state.hasFilteredChildren = true;
|
|
1795
|
+
}
|
|
1796
|
+
results.push(state.hasFilteredChildren);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
return results.some((item) => item);
|
|
1800
|
+
}
|
|
1801
|
+
applyFilter(state, filter) {
|
|
1802
|
+
state.filteredChildren = this.filter(state.children, filter);
|
|
1803
|
+
return state.filteredChildren.length > 0;
|
|
1804
|
+
}
|
|
1805
|
+
filter(states, value) {
|
|
1806
|
+
return states.filter((nodeState) => nodeState.hasFilteredChildren || value === '' || nodeState.nodeItem.name.toLowerCase().indexOf(value) !== -1);
|
|
1807
|
+
}
|
|
1808
|
+
checkboxClick(state) {
|
|
1809
|
+
this.toggleSelectedState(state, false);
|
|
1810
|
+
if (this.callbacks?.toggle) {
|
|
1811
|
+
this.callbacks.toggle(state.nodeItem);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
toggleSelectedState(state, ignoreDisabled) {
|
|
1815
|
+
if (state.disabled && !ignoreDisabled) {
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
if (state.selectedState === NodeSelectedState.unChecked) {
|
|
1819
|
+
this.setChecked(state, true, ignoreDisabled);
|
|
1820
|
+
}
|
|
1821
|
+
else if (state.selectedState === NodeSelectedState.checked) {
|
|
1822
|
+
this.setUnchecked(state, true, ignoreDisabled);
|
|
1823
|
+
}
|
|
1824
|
+
else {
|
|
1825
|
+
if (this.anyActiveSelected(state) && !state.selected) {
|
|
1826
|
+
this.setUnchecked(state, true, ignoreDisabled);
|
|
1827
|
+
}
|
|
1828
|
+
else {
|
|
1829
|
+
this.setChecked(state, true, ignoreDisabled);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
if (state.parent) {
|
|
1833
|
+
this.childStateChanged(state.parent);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
setChecked(state, propagate, ignoreDisabled) {
|
|
1837
|
+
if (state.disabled && !ignoreDisabled) {
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
state.selectedState = NodeSelectedState.checked;
|
|
1841
|
+
state.selected = true;
|
|
1842
|
+
if (TreeService.hasNoChildren(state)) {
|
|
1843
|
+
this.addSelected(state);
|
|
1844
|
+
}
|
|
1845
|
+
else if (propagate) {
|
|
1846
|
+
for (const child of state.children) {
|
|
1847
|
+
this.setChecked(child, propagate, ignoreDisabled);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
setUnchecked(state, propagate, ignoreDisabled) {
|
|
1852
|
+
if (state.disabled && !ignoreDisabled) {
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
state.selectedState = NodeSelectedState.unChecked;
|
|
1856
|
+
state.selected = false;
|
|
1857
|
+
if (TreeService.hasNoChildren(state)) {
|
|
1858
|
+
this.removeSelected(state.nodeItem.item);
|
|
1859
|
+
if (this.callbacks?.unSelect) {
|
|
1860
|
+
this.callbacks.unSelect(state.nodeItem);
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
else if (propagate) {
|
|
1864
|
+
for (const child of state.children) {
|
|
1865
|
+
this.setUnchecked(child, propagate, ignoreDisabled);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
if (!this.anyChildSelected(state)) {
|
|
1869
|
+
this.removeSelected(state.nodeItem.item);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
removeSelected(item) {
|
|
1873
|
+
let index = this.selectedItems.indexOf(item);
|
|
1874
|
+
if (index !== -1) {
|
|
1875
|
+
this.selectedItems.splice(index, 1);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
static hasNoChildren(state) {
|
|
1879
|
+
return !state.children || state.children.length === 0;
|
|
1880
|
+
}
|
|
1881
|
+
addSelected(state) {
|
|
1882
|
+
this.selectedItems.push(state.nodeItem.item);
|
|
1883
|
+
this.selectedStates.push(state);
|
|
1884
|
+
if (this.callbacks?.select) {
|
|
1885
|
+
this.callbacks.select(state.nodeItem);
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
reEvaluateSelectedState(state) {
|
|
1889
|
+
if (!TreeService.hasNoChildren(state)) {
|
|
1890
|
+
this.childStateChanged(state);
|
|
1891
|
+
for (const child of state.children) {
|
|
1892
|
+
this.reEvaluateSelectedState(child);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
childStateChanged(state) {
|
|
1897
|
+
if (this.anyChildSelected(state)) {
|
|
1898
|
+
if (state.nodeItem.id != '0') {
|
|
1899
|
+
let itemIndex = this.selectedItems.indexOf(state.nodeItem.item);
|
|
1900
|
+
if (itemIndex === -1) {
|
|
1901
|
+
this.selectedItems.push(state.nodeItem.item);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
if (this.allChildrenSelected(state)) {
|
|
1905
|
+
this.setChecked(state, false);
|
|
1906
|
+
}
|
|
1907
|
+
else {
|
|
1908
|
+
state.selectedState = NodeSelectedState.indeterminate;
|
|
1909
|
+
state.selected = false;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
this.setUnchecked(state, false);
|
|
1914
|
+
}
|
|
1915
|
+
if (state.parent) {
|
|
1916
|
+
this.childStateChanged(state.parent);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
anyChildSelected(state) {
|
|
1920
|
+
return state.children.find((item) => item.selectedState === NodeSelectedState.checked || item.selectedState === NodeSelectedState.indeterminate) != null;
|
|
1921
|
+
}
|
|
1922
|
+
static initState(parent, nodeItem) {
|
|
1923
|
+
return {
|
|
1924
|
+
parent: parent,
|
|
1925
|
+
children: [],
|
|
1926
|
+
filteredChildren: [],
|
|
1927
|
+
hasFilteredChildren: false,
|
|
1928
|
+
nodeItem: nodeItem,
|
|
1929
|
+
expanded: nodeItem.expanded !== false,
|
|
1930
|
+
disabled: nodeItem.disabled === true,
|
|
1931
|
+
selectedState: NodeSelectedState.unChecked,
|
|
1932
|
+
selected: false
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
deleteById(id) {
|
|
1936
|
+
let result = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
1937
|
+
if (result) {
|
|
1938
|
+
this.deleteByState(result);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
deleteByState(state) {
|
|
1942
|
+
this.delete(state);
|
|
1943
|
+
this.childStateChanged(state);
|
|
1944
|
+
this.filterTraverse(this.treeState, '');
|
|
1945
|
+
}
|
|
1946
|
+
delete(state) {
|
|
1947
|
+
while (state.children.length > 0) {
|
|
1948
|
+
let result = state.children.pop();
|
|
1949
|
+
if (result) {
|
|
1950
|
+
this.delete(result);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
this.removeSelected(state.nodeItem.item);
|
|
1954
|
+
TreeService.remove(state);
|
|
1955
|
+
if (!state.parent) {
|
|
1956
|
+
TreeService.deleteRoot(state, this.treeState, this.nodeItems);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
toggleExpandedTraverse(nodeStates, value) {
|
|
1960
|
+
for (let state of nodeStates) {
|
|
1961
|
+
state.expanded = value;
|
|
1962
|
+
this.toggleExpandedTraverse(state.children, value);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
static deleteRoot(state, nodeStates, nodeItems) {
|
|
1966
|
+
let itemIndex = nodeItems.indexOf(state.nodeItem);
|
|
1967
|
+
if (itemIndex !== -1) {
|
|
1968
|
+
nodeItems.splice(itemIndex, 1);
|
|
1969
|
+
}
|
|
1970
|
+
let index = nodeStates.indexOf(state);
|
|
1971
|
+
if (index !== -1) {
|
|
1972
|
+
nodeStates.splice(index, 1);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
addNewNode(nodeState, parent) {
|
|
1976
|
+
nodeState.parent = parent;
|
|
1977
|
+
parent.children.push(nodeState);
|
|
1978
|
+
if (parent.nodeItem.children) {
|
|
1979
|
+
parent.nodeItem.children.push(nodeState.nodeItem);
|
|
1980
|
+
}
|
|
1981
|
+
this.childStateChanged(parent);
|
|
1982
|
+
this.filterTraverse(this.treeState, '');
|
|
1983
|
+
}
|
|
1984
|
+
static remove(state) {
|
|
1985
|
+
if (state.parent) {
|
|
1986
|
+
state.parent.hasFilteredChildren = false;
|
|
1987
|
+
if (state.parent.nodeItem.children) {
|
|
1988
|
+
let itemIndex = state.parent.nodeItem.children.indexOf(state.nodeItem);
|
|
1989
|
+
if (itemIndex !== -1) {
|
|
1990
|
+
state.parent.nodeItem.children.splice(itemIndex, 1);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
let index = state.parent.children.indexOf(state);
|
|
1994
|
+
if (index !== -1) {
|
|
1995
|
+
state.parent.children.splice(index, 1);
|
|
1996
|
+
}
|
|
1997
|
+
let filteredIndex = state.parent.filteredChildren.indexOf(state);
|
|
1998
|
+
if (filteredIndex !== -1) {
|
|
1999
|
+
state.parent.filteredChildren.splice(filteredIndex, 1);
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
allChildrenSelected(state) {
|
|
2004
|
+
if (state.nodeItem.children) {
|
|
2005
|
+
return state.children.every(it => it.selectedState === NodeSelectedState.checked) && state.children.length === state.nodeItem.children.length;
|
|
2006
|
+
}
|
|
2007
|
+
else {
|
|
2008
|
+
return state.children.every(it => it.selectedState === NodeSelectedState.checked);
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
toggleExpandedTraverseAsc(nodeState, value) {
|
|
2012
|
+
nodeState.expanded = value;
|
|
2013
|
+
if (nodeState.parent) {
|
|
2014
|
+
this.toggleExpandedTraverseAsc(nodeState.parent, value);
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
anyActiveSelected(state) {
|
|
2018
|
+
let result = state.children.filter(it => !it.disabled && it.selected).length > 0;
|
|
2019
|
+
for (const child of state.children) {
|
|
2020
|
+
if (!TreeService.hasNoChildren(child) && this.anyActiveSelected(child)) {
|
|
2021
|
+
result = true;
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
return result;
|
|
2025
|
+
}
|
|
2026
|
+
static findById(state, arg) {
|
|
2027
|
+
return state.nodeItem.id === arg;
|
|
2028
|
+
}
|
|
2029
|
+
getNodeState(nodeStates, arg, compare) {
|
|
2030
|
+
let nodeState = nodeStates.find((it) => compare(it, arg));
|
|
2031
|
+
if (nodeState) {
|
|
2032
|
+
return nodeState;
|
|
2033
|
+
}
|
|
2034
|
+
else {
|
|
2035
|
+
for (let state of nodeStates) {
|
|
2036
|
+
let children = this.getNodeState(state.children, arg, compare);
|
|
2037
|
+
if (children) {
|
|
2038
|
+
return children;
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
toggleExpanded(value) {
|
|
2044
|
+
this.toggleExpandedTraverse(this.treeState, value);
|
|
2045
|
+
}
|
|
2046
|
+
addNodeById(nodeState, id) {
|
|
2047
|
+
let result = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
2048
|
+
if (result) {
|
|
2049
|
+
if (!result.children) {
|
|
2050
|
+
result.children = [];
|
|
2051
|
+
}
|
|
2052
|
+
this.addNewNode(nodeState, result);
|
|
2053
|
+
if (result.nodeItem.item) {
|
|
2054
|
+
this.removeSelected(result.nodeItem.item);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
editItemById(id, item) {
|
|
2059
|
+
const nodeState = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
2060
|
+
if (nodeState && nodeState.nodeItem) {
|
|
2061
|
+
if (this.selectedItems.includes(nodeState.nodeItem.item)) {
|
|
2062
|
+
this.removeSelected(nodeState.nodeItem.item);
|
|
2063
|
+
this.selectedItems.push(item);
|
|
2064
|
+
this.selectedItemsSubject.next(this.selectedItems);
|
|
2065
|
+
}
|
|
2066
|
+
nodeState.nodeItem.item = item;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
expandById(id) {
|
|
2070
|
+
const result = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
2071
|
+
if (result) {
|
|
2072
|
+
this.toggleExpandedTraverseAsc(result, true);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
collapseById(id) {
|
|
2076
|
+
const result = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
2077
|
+
if (result) {
|
|
2078
|
+
result.expanded = false;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
getParentById(id) {
|
|
2082
|
+
const result = this.getNodeState(this.treeState, id, TreeService.findById);
|
|
2083
|
+
if (result) {
|
|
2084
|
+
return result.parent.nodeItem;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
forceFilterTraverse() {
|
|
2088
|
+
this.filterTraverse(this.treeState, '');
|
|
2089
|
+
}
|
|
2090
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2091
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TreeService }); }
|
|
2092
|
+
}
|
|
2093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TreeService, decorators: [{
|
|
2094
|
+
type: Injectable
|
|
2095
|
+
}], ctorParameters: function () { return []; } });
|
|
2096
|
+
|
|
2097
|
+
class NodeToggleComponent {
|
|
2098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NodeToggleComponent, selector: "node-toggle", inputs: { state: "state" }, ngImport: i0, template: "<div class=\"node-toggle-wrapper\" [class.collapsable]=\"state.nodeItem?.children?.length > 0\"\n (click)=\"state.expanded = !state.expanded\">\n <gravity-icon [iconName]=\"(state.expanded ? 'arrow_down' : 'arrow_right')\" [size]=\"'sm'\"\n *ngIf=\"state.nodeItem?.children?.length > 0\"></gravity-icon>\n</div>\n", styles: [".node-toggle-wrapper{align-items:center;display:inline-flex;height:1.25rem;width:1.75rem}.collapsable{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GravityIconComponent, selector: "gravity-icon", inputs: ["customIconColorVariable", "iconName", "hoverIcon", "size"] }] }); }
|
|
2100
|
+
}
|
|
2101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeToggleComponent, decorators: [{
|
|
2102
|
+
type: Component,
|
|
2103
|
+
args: [{ selector: 'node-toggle', template: "<div class=\"node-toggle-wrapper\" [class.collapsable]=\"state.nodeItem?.children?.length > 0\"\n (click)=\"state.expanded = !state.expanded\">\n <gravity-icon [iconName]=\"(state.expanded ? 'arrow_down' : 'arrow_right')\" [size]=\"'sm'\"\n *ngIf=\"state.nodeItem?.children?.length > 0\"></gravity-icon>\n</div>\n", styles: [".node-toggle-wrapper{align-items:center;display:inline-flex;height:1.25rem;width:1.75rem}.collapsable{cursor:pointer}\n"] }]
|
|
2104
|
+
}], propDecorators: { state: [{
|
|
2105
|
+
type: Input
|
|
2106
|
+
}] } });
|
|
2107
|
+
|
|
2108
|
+
class NodeCheckboxComponent {
|
|
2109
|
+
constructor(treeService) {
|
|
2110
|
+
this.treeService = treeService;
|
|
2111
|
+
}
|
|
2112
|
+
clickOnCheckbox() {
|
|
2113
|
+
if (!this.state.disabled) {
|
|
2114
|
+
this.treeService.checkboxClick(this.state);
|
|
2115
|
+
setTimeout(() => {
|
|
2116
|
+
this.treeService.reEvaluateSelectedState(this.state);
|
|
2117
|
+
}, 1);
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeCheckboxComponent, deps: [{ token: TreeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2121
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NodeCheckboxComponent, selector: "node-checkbox", inputs: { state: "state" }, ngImport: i0, template: "<gravity-icon class=\"border-radius-sm checkbox-icon\"\n [class]=\"state.selectedState == 1 ? 'unselect' : 'select'\"\n [class.disabled]=\"state.disabled\"\n\n (click)=\"clickOnCheckbox()\"\n\n [iconName]=\"state.selectedState == 2 ? 'uncheck' : 'success'\"></gravity-icon>\n", styles: [".checkbox-icon{background-color:var(--cta-primary);cursor:pointer;height:1.5rem;--icon-color: var(--surface-secondary);padding:.35rem;width:1.5rem}.checkbox-icon.unselect{opacity:.5}.checkbox-icon.disabled{cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: GravityIconComponent, selector: "gravity-icon", inputs: ["customIconColorVariable", "iconName", "hoverIcon", "size"] }] }); }
|
|
2122
|
+
}
|
|
2123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeCheckboxComponent, decorators: [{
|
|
2124
|
+
type: Component,
|
|
2125
|
+
args: [{ selector: 'node-checkbox', template: "<gravity-icon class=\"border-radius-sm checkbox-icon\"\n [class]=\"state.selectedState == 1 ? 'unselect' : 'select'\"\n [class.disabled]=\"state.disabled\"\n\n (click)=\"clickOnCheckbox()\"\n\n [iconName]=\"state.selectedState == 2 ? 'uncheck' : 'success'\"></gravity-icon>\n", styles: [".checkbox-icon{background-color:var(--cta-primary);cursor:pointer;height:1.5rem;--icon-color: var(--surface-secondary);padding:.35rem;width:1.5rem}.checkbox-icon.unselect{opacity:.5}.checkbox-icon.disabled{cursor:not-allowed}\n"] }]
|
|
2126
|
+
}], ctorParameters: function () { return [{ type: TreeService }]; }, propDecorators: { state: [{
|
|
2127
|
+
type: Input
|
|
2128
|
+
}] } });
|
|
2129
|
+
|
|
2130
|
+
class NodeNameComponent {
|
|
2131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeNameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NodeNameComponent, selector: "node-name", inputs: { state: "state" }, ngImport: i0, template: "<div [class.disabled]=\"state.disabled\" class=\"node-name\">\n <span class=\"hr-label md-regular\">{{state.nodeItem.name}}</span>\n</div>\n", styles: [".node-name{display:inline-block;padding:.1325rem 0 .1325rem .4375rem}.node-name.disabled{opacity:.6}\n"] }); }
|
|
2133
|
+
}
|
|
2134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeNameComponent, decorators: [{
|
|
2135
|
+
type: Component,
|
|
2136
|
+
args: [{ selector: 'node-name', template: "<div [class.disabled]=\"state.disabled\" class=\"node-name\">\n <span class=\"hr-label md-regular\">{{state.nodeItem.name}}</span>\n</div>\n", styles: [".node-name{display:inline-block;padding:.1325rem 0 .1325rem .4375rem}.node-name.disabled{opacity:.6}\n"] }]
|
|
2137
|
+
}], propDecorators: { state: [{
|
|
2138
|
+
type: Input
|
|
2139
|
+
}] } });
|
|
2140
|
+
|
|
2141
|
+
class NodeComponent {
|
|
2142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2143
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NodeComponent, selector: "tree-node", inputs: { nodeState: "nodeState" }, ngImport: i0, template: "<div class=\"node-container\">\n <div class=\"node-content\">\n <node-toggle [state]=\"nodeState\"></node-toggle>\n <node-checkbox [state]=\"nodeState\"></node-checkbox>\n <node-name [state]=\"nodeState\"></node-name>\n </div>\n <div class=\"collapsible-wrapper\" *ngIf=\"nodeState.nodeItem.children\"\n [class.collapsed]=\"!nodeState.expanded && nodeState.nodeItem.children.length > 0 && nodeState.filteredChildren.length > 0\">\n <div class=\"collapsible\">\n <tree-node class=\"node-offset\" [nodeState]=\"child\"\n *ngFor=\"let child of nodeState.filteredChildren\"></tree-node>\n </div>\n </div>\n</div>\n", styles: [".node-container{display:flex;flex:1 1 auto;flex-direction:column}.node-container .node-content{display:inline-flex;padding-bottom:.1rem}.node-container node-toggle,.node-container node-checkbox{display:inline-flex;align-items:center}.node-container .collapsible-wrapper{display:flex;overflow:hidden}.node-container .collapsible-wrapper .collapsible{transition:margin-bottom .3s cubic-bezier(0,0,0,1);margin-bottom:0;max-height:1000000px}.node-container .collapsible-wrapper .collapsible tree-node.node-offset{display:flex;margin-left:1.25rem}.node-container .collapsible-wrapper.collapsed>.collapsible{margin-bottom:-20000px;transition:margin-bottom .3s cubic-bezier(1,0,1,1),visibility 0s .3s,max-height 0s .3s;visibility:hidden;max-height:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NodeComponent, selector: "tree-node", inputs: ["nodeState"] }, { kind: "component", type: NodeToggleComponent, selector: "node-toggle", inputs: ["state"] }, { kind: "component", type: NodeCheckboxComponent, selector: "node-checkbox", inputs: ["state"] }, { kind: "component", type: NodeNameComponent, selector: "node-name", inputs: ["state"] }] }); }
|
|
2144
|
+
}
|
|
2145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NodeComponent, decorators: [{
|
|
2146
|
+
type: Component,
|
|
2147
|
+
args: [{ selector: 'tree-node', template: "<div class=\"node-container\">\n <div class=\"node-content\">\n <node-toggle [state]=\"nodeState\"></node-toggle>\n <node-checkbox [state]=\"nodeState\"></node-checkbox>\n <node-name [state]=\"nodeState\"></node-name>\n </div>\n <div class=\"collapsible-wrapper\" *ngIf=\"nodeState.nodeItem.children\"\n [class.collapsed]=\"!nodeState.expanded && nodeState.nodeItem.children.length > 0 && nodeState.filteredChildren.length > 0\">\n <div class=\"collapsible\">\n <tree-node class=\"node-offset\" [nodeState]=\"child\"\n *ngFor=\"let child of nodeState.filteredChildren\"></tree-node>\n </div>\n </div>\n</div>\n", styles: [".node-container{display:flex;flex:1 1 auto;flex-direction:column}.node-container .node-content{display:inline-flex;padding-bottom:.1rem}.node-container node-toggle,.node-container node-checkbox{display:inline-flex;align-items:center}.node-container .collapsible-wrapper{display:flex;overflow:hidden}.node-container .collapsible-wrapper .collapsible{transition:margin-bottom .3s cubic-bezier(0,0,0,1);margin-bottom:0;max-height:1000000px}.node-container .collapsible-wrapper .collapsible tree-node.node-offset{display:flex;margin-left:1.25rem}.node-container .collapsible-wrapper.collapsed>.collapsible{margin-bottom:-20000px;transition:margin-bottom .3s cubic-bezier(1,0,1,1),visibility 0s .3s,max-height 0s .3s;visibility:hidden;max-height:0}\n"] }]
|
|
2148
|
+
}], propDecorators: { nodeState: [{
|
|
2149
|
+
type: Input
|
|
2150
|
+
}] } });
|
|
2151
|
+
|
|
2152
|
+
class GravityTreeViewComponent {
|
|
2153
|
+
constructor(treeService) {
|
|
2154
|
+
this.treeService = treeService;
|
|
2155
|
+
this.selectedItems = new EventEmitter();
|
|
2156
|
+
this.treeServiceSubscription = treeService.connect().subscribe((items) => {
|
|
2157
|
+
const subscription = timer(0).subscribe(() => {
|
|
2158
|
+
this.selectedItems.emit(items);
|
|
2159
|
+
subscription.unsubscribe();
|
|
2160
|
+
});
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
ngOnDestroy() {
|
|
2164
|
+
this.treeServiceSubscription.unsubscribe();
|
|
2165
|
+
}
|
|
2166
|
+
ngOnChanges(changes) {
|
|
2167
|
+
if (changes.callbacks) {
|
|
2168
|
+
this.treeService.callbacks = this.callbacks;
|
|
2169
|
+
}
|
|
2170
|
+
if (changes.nodeItems) {
|
|
2171
|
+
this.initialize();
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
initialize() {
|
|
2175
|
+
this.treeService.callbacks = this.callbacks;
|
|
2176
|
+
this.treeService.nodeItems = this.nodeItems;
|
|
2177
|
+
this.treeService.treeState = this.initTreeStructure(null, this.treeService.nodeItems);
|
|
2178
|
+
this.treeService.clear();
|
|
2179
|
+
this.treeService.setInitialState();
|
|
2180
|
+
}
|
|
2181
|
+
initTreeStructure(parent, nodeItems) {
|
|
2182
|
+
const treeStructure = [];
|
|
2183
|
+
nodeItems.forEach((nodeItem) => {
|
|
2184
|
+
const nodeState = TreeService.initState(parent, nodeItem);
|
|
2185
|
+
if (nodeItem.children) {
|
|
2186
|
+
nodeState.children = this.initTreeStructure(nodeState, nodeItem.children);
|
|
2187
|
+
nodeState.filteredChildren = nodeState.children;
|
|
2188
|
+
}
|
|
2189
|
+
treeStructure.push(nodeState);
|
|
2190
|
+
});
|
|
2191
|
+
return treeStructure;
|
|
2192
|
+
}
|
|
2193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityTreeViewComponent, deps: [{ token: TreeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GravityTreeViewComponent, selector: "gravity-tree-view", inputs: { callbacks: "callbacks", nodeItems: "nodeItems" }, outputs: { selectedItems: "selectedItems" }, providers: [TreeService], usesOnChanges: true, ngImport: i0, template: "<tree-node [nodeState]=\"state\" *ngFor=\"let state of treeService.treeState\"></tree-node>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: NodeComponent, selector: "tree-node", inputs: ["nodeState"] }] }); }
|
|
2195
|
+
}
|
|
2196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityTreeViewComponent, decorators: [{
|
|
2197
|
+
type: Component,
|
|
2198
|
+
args: [{ selector: 'gravity-tree-view', providers: [TreeService], template: "<tree-node [nodeState]=\"state\" *ngFor=\"let state of treeService.treeState\"></tree-node>\n" }]
|
|
2199
|
+
}], ctorParameters: function () { return [{ type: TreeService }]; }, propDecorators: { callbacks: [{
|
|
2200
|
+
type: Input
|
|
2201
|
+
}], nodeItems: [{
|
|
2202
|
+
type: Input
|
|
2203
|
+
}], selectedItems: [{
|
|
2204
|
+
type: Output
|
|
2205
|
+
}] } });
|
|
2206
|
+
|
|
1743
2207
|
class GravityDesignSystemModule {
|
|
1744
2208
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityDesignSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1745
2209
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: GravityDesignSystemModule, declarations: [GravityAttachFileComponent,
|
|
@@ -1755,7 +2219,12 @@ class GravityDesignSystemModule {
|
|
|
1755
2219
|
GravityRadioButtonComponent,
|
|
1756
2220
|
GravitySwitchComponent,
|
|
1757
2221
|
GravityTableComponent,
|
|
1758
|
-
GravityTextFieldComponent
|
|
2222
|
+
GravityTextFieldComponent,
|
|
2223
|
+
GravityTreeViewComponent,
|
|
2224
|
+
NodeComponent,
|
|
2225
|
+
NodeToggleComponent,
|
|
2226
|
+
NodeCheckboxComponent,
|
|
2227
|
+
NodeNameComponent], imports: [i1.AngularSvgIconModule, i2$2.AngularSvgIconPreloaderModule, CommonModule,
|
|
1759
2228
|
FormsModule, GravityTooltipModule, NgbDatepickerModule,
|
|
1760
2229
|
NgbProgressbarModule,
|
|
1761
2230
|
NgbToastModule,
|
|
@@ -1773,7 +2242,8 @@ class GravityDesignSystemModule {
|
|
|
1773
2242
|
GravitySwitchComponent,
|
|
1774
2243
|
GravityTableComponent,
|
|
1775
2244
|
GravityTextFieldComponent,
|
|
1776
|
-
GravityTooltipModule
|
|
2245
|
+
GravityTooltipModule,
|
|
2246
|
+
GravityTreeViewComponent] }); }
|
|
1777
2247
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GravityDesignSystemModule, imports: [AngularSvgIconModule.forRoot(),
|
|
1778
2248
|
AngularSvgIconPreloaderModule.forRoot({
|
|
1779
2249
|
configUrl: './assets/gravity/json/icons.json',
|
|
@@ -1805,7 +2275,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1805
2275
|
GravityRadioButtonComponent,
|
|
1806
2276
|
GravitySwitchComponent,
|
|
1807
2277
|
GravityTableComponent,
|
|
1808
|
-
GravityTextFieldComponent
|
|
2278
|
+
GravityTextFieldComponent,
|
|
2279
|
+
GravityTreeViewComponent,
|
|
2280
|
+
NodeComponent,
|
|
2281
|
+
NodeToggleComponent,
|
|
2282
|
+
NodeCheckboxComponent,
|
|
2283
|
+
NodeNameComponent
|
|
1809
2284
|
],
|
|
1810
2285
|
imports: [
|
|
1811
2286
|
AngularSvgIconModule.forRoot(),
|
|
@@ -1835,7 +2310,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1835
2310
|
GravitySwitchComponent,
|
|
1836
2311
|
GravityTableComponent,
|
|
1837
2312
|
GravityTextFieldComponent,
|
|
1838
|
-
GravityTooltipModule
|
|
2313
|
+
GravityTooltipModule,
|
|
2314
|
+
GravityTreeViewComponent
|
|
1839
2315
|
]
|
|
1840
2316
|
}]
|
|
1841
2317
|
}] });
|
|
@@ -1889,5 +2365,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1889
2365
|
* Generated bundle index. Do not edit.
|
|
1890
2366
|
*/
|
|
1891
2367
|
|
|
1892
|
-
export { GravityAttachFileComponent, GravityButtonComponent, GravityCalendarComponent, GravityCheckboxComponent, GravityDesignSystemModule, GravityDialogComponent, GravityDialogManagerService, GravityDropdownListComponent, GravityIconComponent, GravityNotificationInstantContainerComponent, GravityRadioButtonComponent, GravitySwitchComponent, GravityTableComponent, GravityTextFieldComponent, GravityTooltipComponent, GravityTooltipDirective, GravityTooltipModule };
|
|
2368
|
+
export { GravityAttachFileComponent, GravityButtonComponent, GravityCalendarComponent, GravityCheckboxComponent, GravityDesignSystemModule, GravityDialogComponent, GravityDialogManagerService, GravityDropdownListComponent, GravityIconComponent, GravityNotificationInstantContainerComponent, GravityRadioButtonComponent, GravitySwitchComponent, GravityTableComponent, GravityTextFieldComponent, GravityTooltipComponent, GravityTooltipDirective, GravityTooltipModule, GravityTreeViewComponent };
|
|
1893
2369
|
//# sourceMappingURL=progressio_resources-gravity-design-system.mjs.map
|