@progressio_resources/gravity-design-system 2.1.9 → 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-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 +481 -5
- 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 +2 -3
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { TreeService } from "./service/tree-service";
|
|
3
|
+
import { NodeItem } from "./models/node-item";
|
|
4
|
+
import { TreeCallbacks } from "./models/tree-callbacks";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class GravityTreeViewComponent implements OnDestroy, OnChanges {
|
|
7
|
+
readonly treeService: TreeService;
|
|
8
|
+
private readonly treeServiceSubscription;
|
|
9
|
+
callbacks: TreeCallbacks;
|
|
10
|
+
nodeItems: NodeItem<any>[];
|
|
11
|
+
selectedItems: EventEmitter<any>;
|
|
12
|
+
constructor(treeService: TreeService);
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
+
private initialize;
|
|
16
|
+
private initTreeStructure;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GravityTreeViewComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GravityTreeViewComponent, "gravity-tree-view", never, { "callbacks": { "alias": "callbacks"; "required": false; }; "nodeItems": { "alias": "nodeItems"; "required": false; }; }, { "selectedItems": "selectedItems"; }, never, never, false, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NodeItem } from './node-item';
|
|
2
|
+
import { NodeSelectedState } from './node-selected-state';
|
|
3
|
+
export interface NodeState {
|
|
4
|
+
children: NodeState[];
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
filteredChildren: NodeState[];
|
|
8
|
+
hasFilteredChildren: boolean;
|
|
9
|
+
nodeItem: NodeItem<any>;
|
|
10
|
+
parent: NodeState;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
selectedState: NodeSelectedState;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeItem } from './node-item';
|
|
2
|
+
export interface TreeCallbacks {
|
|
3
|
+
/** Callback triggers on node selection. */
|
|
4
|
+
select?: (item: NodeItem<any>) => void;
|
|
5
|
+
/** Callback triggers on unselection of a node. */
|
|
6
|
+
unSelect?: (item: NodeItem<any>) => void;
|
|
7
|
+
/** Callback triggers on toggling of a node. */
|
|
8
|
+
toggle?: (item: NodeItem<any>) => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TreeService } from '../../service/tree-service';
|
|
2
|
+
import { NodeState } from "../../models/node-state";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NodeCheckboxComponent {
|
|
5
|
+
private readonly treeService;
|
|
6
|
+
state: NodeState;
|
|
7
|
+
constructor(treeService: TreeService);
|
|
8
|
+
clickOnCheckbox(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NodeCheckboxComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NodeCheckboxComponent, "node-checkbox", never, { "state": { "alias": "state"; "required": false; }; }, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeState } from '../../models/node-state';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NodeNameComponent {
|
|
4
|
+
state: NodeState;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NodeNameComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NodeNameComponent, "node-name", never, { "state": { "alias": "state"; "required": false; }; }, {}, never, never, false, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeState } from '../../models/node-state';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NodeToggleComponent {
|
|
4
|
+
state: NodeState;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NodeToggleComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NodeToggleComponent, "node-toggle", never, { "state": { "alias": "state"; "required": false; }; }, {}, never, never, false, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeState } from '../models/node-state';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NodeComponent {
|
|
4
|
+
nodeState: NodeState;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NodeComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NodeComponent, "tree-node", never, { "nodeState": { "alias": "nodeState"; "required": false; }; }, {}, never, never, false, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { NodeItem } from '../models/node-item';
|
|
4
|
+
import { NodeState } from '../models/node-state';
|
|
5
|
+
import { TreeCallbacks } from '../models/tree-callbacks';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class TreeService implements OnDestroy {
|
|
8
|
+
private readonly filterChangeSubjectSubscription;
|
|
9
|
+
callbacks: TreeCallbacks;
|
|
10
|
+
nodeItems: NodeItem<any>[];
|
|
11
|
+
treeState: NodeState[];
|
|
12
|
+
private filterChangeSubject;
|
|
13
|
+
private selectedItems;
|
|
14
|
+
private selectedItemsSubject;
|
|
15
|
+
private selectedStates;
|
|
16
|
+
constructor();
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
connect(): Observable<any[]>;
|
|
19
|
+
setInitialState(): void;
|
|
20
|
+
private setInitialSelectedState;
|
|
21
|
+
clear(): void;
|
|
22
|
+
private filterTraverse;
|
|
23
|
+
private applyFilter;
|
|
24
|
+
private filter;
|
|
25
|
+
checkboxClick(state: NodeState): void;
|
|
26
|
+
private toggleSelectedState;
|
|
27
|
+
private setChecked;
|
|
28
|
+
private setUnchecked;
|
|
29
|
+
private removeSelected;
|
|
30
|
+
private static hasNoChildren;
|
|
31
|
+
private addSelected;
|
|
32
|
+
reEvaluateSelectedState(state: NodeState): void;
|
|
33
|
+
childStateChanged(state: NodeState): void;
|
|
34
|
+
private anyChildSelected;
|
|
35
|
+
static initState(parent: NodeState, nodeItem: NodeItem<any>): NodeState;
|
|
36
|
+
deleteById(id: string): void;
|
|
37
|
+
deleteByState(state: NodeState): void;
|
|
38
|
+
private delete;
|
|
39
|
+
private toggleExpandedTraverse;
|
|
40
|
+
private static deleteRoot;
|
|
41
|
+
private addNewNode;
|
|
42
|
+
private static remove;
|
|
43
|
+
private allChildrenSelected;
|
|
44
|
+
private toggleExpandedTraverseAsc;
|
|
45
|
+
private anyActiveSelected;
|
|
46
|
+
private static findById;
|
|
47
|
+
private getNodeState;
|
|
48
|
+
toggleExpanded(value: boolean): void;
|
|
49
|
+
addNodeById(nodeState: NodeState, id: string): void;
|
|
50
|
+
editItemById(id: string, item: any): void;
|
|
51
|
+
expandById(id: string): void;
|
|
52
|
+
collapseById(id: string): void;
|
|
53
|
+
getParentById(id: string): NodeItem<any>;
|
|
54
|
+
forceFilterTraverse(): void;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeService, never>;
|
|
56
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TreeService>;
|
|
57
|
+
}
|
|
@@ -13,16 +13,21 @@ import * as i11 from "./components/gravity-radio-button/gravity-radio-button.com
|
|
|
13
13
|
import * as i12 from "./components/gravity-switch/gravity-switch.component";
|
|
14
14
|
import * as i13 from "./components/gravity-table/gravity-table.component";
|
|
15
15
|
import * as i14 from "./components/gravity-text-field/gravity-text-field.component";
|
|
16
|
-
import * as i15 from "
|
|
17
|
-
import * as i16 from "
|
|
18
|
-
import * as i17 from "
|
|
19
|
-
import * as i18 from "
|
|
20
|
-
import * as i19 from "./
|
|
21
|
-
import * as i20 from "
|
|
22
|
-
import * as i21 from "
|
|
23
|
-
import * as i22 from "
|
|
16
|
+
import * as i15 from "./components/gravity-tree-view/gravity-tree-view.component";
|
|
17
|
+
import * as i16 from "./components/gravity-tree-view/node/node.component";
|
|
18
|
+
import * as i17 from "./components/gravity-tree-view/node/node-toggle/node-toggle.component";
|
|
19
|
+
import * as i18 from "./components/gravity-tree-view/node/node-checkbox/node-checkbox.component";
|
|
20
|
+
import * as i19 from "./components/gravity-tree-view/node/node-name/node-name.component";
|
|
21
|
+
import * as i20 from "angular-svg-icon";
|
|
22
|
+
import * as i21 from "angular-svg-icon-preloader";
|
|
23
|
+
import * as i22 from "@angular/common";
|
|
24
|
+
import * as i23 from "@angular/forms";
|
|
25
|
+
import * as i24 from "./vendor/gravity-tooltip/gravity-tooltip.module";
|
|
26
|
+
import * as i25 from "@ng-bootstrap/ng-bootstrap";
|
|
27
|
+
import * as i26 from "@ng-select/ng-select";
|
|
28
|
+
import * as i27 from "ngx-pretty-checkbox";
|
|
24
29
|
export declare class GravityDesignSystemModule {
|
|
25
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<GravityDesignSystemModule, never>;
|
|
26
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<GravityDesignSystemModule, [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i8.GravityMonthPickerComponent, typeof i9.GravityNotificationComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTableComponent, typeof i14.GravityTextFieldComponent], [typeof
|
|
31
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<GravityDesignSystemModule, [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i8.GravityMonthPickerComponent, typeof i9.GravityNotificationComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTableComponent, typeof i14.GravityTextFieldComponent, typeof i15.GravityTreeViewComponent, typeof i16.NodeComponent, typeof i17.NodeToggleComponent, typeof i18.NodeCheckboxComponent, typeof i19.NodeNameComponent], [typeof i20.AngularSvgIconModule, typeof i21.AngularSvgIconPreloaderModule, typeof i22.CommonModule, typeof i23.FormsModule, typeof i24.GravityTooltipModule, typeof i25.NgbDatepickerModule, typeof i25.NgbProgressbarModule, typeof i25.NgbToastModule, typeof i26.NgSelectModule, typeof i27.NgxPrettyCheckboxModule, typeof i23.ReactiveFormsModule], [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTableComponent, typeof i14.GravityTextFieldComponent, typeof i24.GravityTooltipModule, typeof i15.GravityTreeViewComponent]>;
|
|
27
32
|
static ɵinj: i0.ɵɵInjectorDeclaration<GravityDesignSystemModule>;
|
|
28
33
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressio_resources/gravity-design-system",
|
|
3
3
|
"description": "Gravity Design System",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"license": "SEE LICENSE IN LIBRARY-LICENSE",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/common": "^16.2.12",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"pretty-checkbox": "^3.0.3"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@progressio_resources/gravity-design-system": "^2.1.8",
|
|
20
19
|
"tslib": "^2.6.2"
|
|
21
20
|
},
|
|
22
21
|
"sideEffects": false,
|
|
@@ -33,4 +32,4 @@
|
|
|
33
32
|
"default": "./fesm2022/progressio_resources-gravity-design-system.mjs"
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
}
|
|
35
|
+
}
|
package/public-api.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './lib/components/gravity-radio-button/gravity-radio-button.compon
|
|
|
11
11
|
export * from './lib/components/gravity-switch/gravity-switch.component';
|
|
12
12
|
export * from './lib/components/gravity-table/gravity-table.component';
|
|
13
13
|
export * from './lib/components/gravity-text-field/gravity-text-field.component';
|
|
14
|
+
export * from './lib/components/gravity-tree-view/gravity-tree-view.component';
|
|
14
15
|
export * from './lib/services/gravity-dialog-manager.service';
|
|
15
16
|
export * from './lib/vendor/gravity-tooltip';
|
|
16
17
|
export * from './lib/components/gravity-notification/gravity-notification-content.interface';
|