@planeasyinc/le-angular 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fesm2022/planeasyinc-le-angular.mjs +172 -41
- package/dist/fesm2022/planeasyinc-le-angular.mjs.map +1 -1
- package/dist/lib/components/dialog/dialog.component.d.ts +7 -0
- package/dist/lib/components/node/node.component.d.ts +2 -1
- package/dist/lib/icons/icons-map.d.ts +5 -0
- package/dist/lib/icons/le-icon.component.d.ts +6 -1
- package/dist/lib/icons/svg/history.d.ts +5 -0
- package/dist/lib/icons/svg/index.d.ts +5 -0
- package/dist/lib/services/le-api.service.d.ts +6 -1
- package/dist/lib/services/le-dialog.service.d.ts +10 -0
- package/dist/lib/templates/reference.template.d.ts +2 -1
- package/dist/lib/types/le-dialog.d.ts +13 -0
- package/dist/lib/views/chart-view/chart-view.component.d.ts +2 -1
- package/dist/lib/views/form-view/form-view.component.d.ts +2 -1
- package/dist/lib/views/gird-col-view/grid-col-view.component.d.ts +2 -1
- package/dist/lib/views/gird-view/grid-view.component.d.ts +2 -1
- package/dist/lib/views/section-view/section-view.component.d.ts +2 -1
- package/dist/lib/views/table-view/table-data-sourse.d.ts +1 -0
- package/dist/lib/views/table-view/table-view-cell.directive.d.ts +2 -1
- package/dist/lib/views/table-view/table-view.component.d.ts +9 -4
- package/dist/styles/styles.scss +27 -3
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, signal, Injectable, computed, effect, untracked, Directive, input, ChangeDetectionStrategy, Component, output, forwardRef, ViewContainerRef, Renderer2, ElementRef, DestroyRef, viewChild } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, signal, Injectable, computed, effect, untracked, Directive, input, ChangeDetectionStrategy, Component, output, forwardRef, ViewContainerRef, Injector, Renderer2, ElementRef, DestroyRef, viewChild } from '@angular/core';
|
|
3
3
|
import { HttpContextToken, HttpClient, HttpContext, HttpRequest, HttpEventType } from '@angular/common/http';
|
|
4
4
|
import { map, filter, distinctUntilChanged, BehaviorSubject, Subject, takeUntil, firstValueFrom, of, tap, catchError, from, concatMap, finalize, fromEvent, startWith } from 'rxjs';
|
|
5
5
|
import { decodeJwt, UrlFragmentBuilder, normalizeConfig } from '@planeasyinc/le-core';
|
|
6
|
-
import { Location, JsonPipe, ViewportScroller } from '@angular/common';
|
|
6
|
+
import { Location, JsonPipe, DatePipe, ViewportScroller } from '@angular/common';
|
|
7
7
|
import { CdkDrag } from '@angular/cdk/drag-drop';
|
|
8
8
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
9
9
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
10
10
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
11
11
|
import { DataSource, CdkTable, CdkColumnDef, CdkHeaderCell, CdkHeaderCellDef, CdkCell, CdkCellDef, CdkHeaderRowDef, CdkHeaderRow, CdkRow, CdkRowDef } from '@angular/cdk/table';
|
|
12
|
+
import { DIALOG_DATA, Dialog, DialogModule } from '@angular/cdk/dialog';
|
|
12
13
|
import { CdkMenuTrigger, CdkMenu, CdkMenuItem } from '@angular/cdk/menu';
|
|
13
14
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
14
15
|
import { adaptOld } from '@planeasyinc/fe-adapters-old';
|
|
@@ -98,10 +99,10 @@ class LEApiService {
|
|
|
98
99
|
context: new HttpContext().set(IS_LIBRARY_REQUEST, true),
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
|
-
getObjectByAddress(address,
|
|
102
|
+
getObjectByAddress(address, params) {
|
|
102
103
|
const url = new UrlFragmentBuilder(this.apiUrl())
|
|
103
104
|
.setFragment(`api/objects/${address}/`)
|
|
104
|
-
.setQuery(`all_versions=${includeVersions}&include_metadata=${includeMeta}&load_references
|
|
105
|
+
.setQuery(`all_versions=${params.includeVersions ?? false}&include_metadata=${params.includeMeta ?? false}&load_references=${params.loadReferences ?? false}&file_optimized=${params.fileOptimized ?? true}`)
|
|
105
106
|
.build();
|
|
106
107
|
return this.http.get(url, {
|
|
107
108
|
context: new HttpContext().set(IS_LIBRARY_REQUEST, true),
|
|
@@ -392,12 +393,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
392
393
|
}]
|
|
393
394
|
}] });
|
|
394
395
|
|
|
395
|
-
const
|
|
396
|
-
name: '
|
|
396
|
+
const history = {
|
|
397
|
+
name: 'history',
|
|
397
398
|
viewBox: '0 -960 960 960',
|
|
398
399
|
content: [
|
|
399
|
-
'
|
|
400
|
-
]
|
|
400
|
+
'M480-120q-138 0-240.5-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm112-192L440-464v-216h80v184l128 128-56 56Z',
|
|
401
|
+
],
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
const close = {
|
|
405
|
+
name: 'close',
|
|
406
|
+
viewBox: '0 -960 960 960',
|
|
407
|
+
content: [
|
|
408
|
+
'm256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z',
|
|
409
|
+
],
|
|
401
410
|
};
|
|
402
411
|
|
|
403
412
|
const arrowDown = {
|
|
@@ -416,12 +425,12 @@ const sort = {
|
|
|
416
425
|
]
|
|
417
426
|
};
|
|
418
427
|
|
|
419
|
-
const
|
|
420
|
-
name: '
|
|
428
|
+
const chevron = {
|
|
429
|
+
name: 'chevron',
|
|
421
430
|
viewBox: '0 -960 960 960',
|
|
422
431
|
content: [
|
|
423
|
-
'
|
|
424
|
-
]
|
|
432
|
+
'M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z'
|
|
433
|
+
]
|
|
425
434
|
};
|
|
426
435
|
|
|
427
436
|
const ICONS_MAP = {
|
|
@@ -429,6 +438,7 @@ const ICONS_MAP = {
|
|
|
429
438
|
'arrow-down': arrowDown,
|
|
430
439
|
sort: sort,
|
|
431
440
|
close: close,
|
|
441
|
+
history: history,
|
|
432
442
|
};
|
|
433
443
|
|
|
434
444
|
class LeIconComponent {
|
|
@@ -558,8 +568,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
558
568
|
|
|
559
569
|
class ChartViewComponent {
|
|
560
570
|
node = input.required();
|
|
571
|
+
config = input();
|
|
561
572
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: ChartViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
562
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.21", type: ChartViewComponent, isStandalone: true, selector: "chart-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<h2>{{ node()?.title }}</h2>\n" });
|
|
573
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.21", type: ChartViewComponent, isStandalone: true, selector: "chart-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<h2>{{ node()?.title }}</h2>\n" });
|
|
563
574
|
}
|
|
564
575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: ChartViewComponent, decorators: [{
|
|
565
576
|
type: Component,
|
|
@@ -568,15 +579,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
568
579
|
|
|
569
580
|
class GridComponent {
|
|
570
581
|
node = input.required();
|
|
582
|
+
config = input();
|
|
571
583
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GridComponent, isStandalone: true, selector: "grid-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.le-gird-view": "true", "style.grid-template-columns": "node().layout.columns ?? 1" } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node"] }] });
|
|
584
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GridComponent, isStandalone: true, selector: "grid-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.le-gird-view": "true", "style.grid-template-columns": "node().layout.columns ?? 1" } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node", "config"] }] });
|
|
573
585
|
}
|
|
574
586
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GridComponent, decorators: [{
|
|
575
587
|
type: Component,
|
|
576
588
|
args: [{ selector: 'grid-view', imports: [forwardRef(() => NodeComponent)], host: {
|
|
577
589
|
'[class.le-gird-view]': 'true',
|
|
578
590
|
'[style.grid-template-columns]': 'node().layout.columns ?? 1',
|
|
579
|
-
}, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n" }]
|
|
591
|
+
}, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n" }]
|
|
580
592
|
}] });
|
|
581
593
|
|
|
582
594
|
class TableDataSource extends DataSource {
|
|
@@ -588,6 +600,9 @@ class TableDataSource extends DataSource {
|
|
|
588
600
|
super();
|
|
589
601
|
this.data = new BehaviorSubject(data);
|
|
590
602
|
}
|
|
603
|
+
getValueByIndex(index) {
|
|
604
|
+
return this.data.value[index];
|
|
605
|
+
}
|
|
591
606
|
connect() {
|
|
592
607
|
return this.data;
|
|
593
608
|
}
|
|
@@ -833,30 +848,34 @@ class ReferenceTemplate {
|
|
|
833
848
|
data = input.required();
|
|
834
849
|
attribute = input.required();
|
|
835
850
|
metadata = input.required();
|
|
851
|
+
clicked = output();
|
|
836
852
|
reference = computed(() => {
|
|
837
|
-
const
|
|
853
|
+
const ref = this.data()?.ref;
|
|
838
854
|
return {
|
|
839
|
-
text: this.generateText(
|
|
840
|
-
href: this.generateLink(
|
|
855
|
+
text: this.generateText(ref),
|
|
856
|
+
href: this.generateLink(ref),
|
|
841
857
|
};
|
|
842
858
|
});
|
|
843
859
|
onClick(event) {
|
|
860
|
+
event.preventDefault();
|
|
844
861
|
event.stopImmediatePropagation();
|
|
862
|
+
this.clicked.emit(this.data());
|
|
845
863
|
}
|
|
846
|
-
generateText(
|
|
847
|
-
if (
|
|
848
|
-
return
|
|
864
|
+
generateText(ref) {
|
|
865
|
+
if (ref) {
|
|
866
|
+
return ref.display_name || ref.object_id;
|
|
849
867
|
}
|
|
850
868
|
return '';
|
|
851
869
|
}
|
|
852
|
-
generateLink(
|
|
853
|
-
if (
|
|
854
|
-
|
|
855
|
-
|
|
870
|
+
generateLink(ref) {
|
|
871
|
+
if (ref) {
|
|
872
|
+
// statedb%23Tag%3ALATEST%3Atag_01%3ALATEST
|
|
873
|
+
const href = `/details/object/${ref.class_name}/${ref.resource}%2523${ref.class_name}%253A${ref.class_version}%253A${ref.object_id}%253A${ref.object_version}`;
|
|
874
|
+
return ref?.address ? `${href}?address=${ref.address}` : href;
|
|
856
875
|
}
|
|
857
876
|
}
|
|
858
877
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: ReferenceTemplate, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
859
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: ReferenceTemplate, isStandalone: true, selector: "ng-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: true, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
878
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: ReferenceTemplate, isStandalone: true, selector: "ng-component", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attribute: { classPropertyName: "attribute", publicName: "attribute", isSignal: true, isRequired: true, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
860
879
|
<span class="le-table-template le-template-reference">
|
|
861
880
|
@if (reference(); as reference) {
|
|
862
881
|
@if (reference.href) {
|
|
@@ -932,6 +951,7 @@ class TableViewCellDirective {
|
|
|
932
951
|
data = input.required();
|
|
933
952
|
column = input();
|
|
934
953
|
metadata = input();
|
|
954
|
+
clicked = output();
|
|
935
955
|
constructor() {
|
|
936
956
|
this.setEffects();
|
|
937
957
|
}
|
|
@@ -955,12 +975,16 @@ class TableViewCellDirective {
|
|
|
955
975
|
if (metadata) {
|
|
956
976
|
this.componentRef?.setInput('metadata', metadata);
|
|
957
977
|
}
|
|
978
|
+
const sub = (this.componentRef?.instance).clicked.subscribe(data => {
|
|
979
|
+
this.clicked.emit(data);
|
|
980
|
+
});
|
|
981
|
+
this.componentRef?.onDestroy(() => sub.unsubscribe());
|
|
958
982
|
}
|
|
959
983
|
});
|
|
960
984
|
});
|
|
961
985
|
}
|
|
962
986
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TableViewCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
963
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.21", type: TableViewCellDirective, isStandalone: true, selector: "[tableViewCell]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
987
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.21", type: TableViewCellDirective, isStandalone: true, selector: "[tableViewCell]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0 });
|
|
964
988
|
}
|
|
965
989
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TableViewCellDirective, decorators: [{
|
|
966
990
|
type: Directive,
|
|
@@ -969,11 +993,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
969
993
|
}]
|
|
970
994
|
}], ctorParameters: () => [] });
|
|
971
995
|
|
|
996
|
+
class DialogComponent {
|
|
997
|
+
data = inject(DIALOG_DATA);
|
|
998
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
999
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: DialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@if (data.title) {\n <div>{{ data.title }}</div>\n}\n\n@if (data.node) {\n <le-node [node]=\"data.node\" [config]=\"data.config\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node", "config"] }] });
|
|
1000
|
+
}
|
|
1001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: DialogComponent, decorators: [{
|
|
1002
|
+
type: Component,
|
|
1003
|
+
args: [{ imports: [forwardRef(() => NodeComponent)], template: "@if (data.title) {\n <div>{{ data.title }}</div>\n}\n\n@if (data.node) {\n <le-node [node]=\"data.node\" [config]=\"data.config\"></le-node>\n}\n" }]
|
|
1004
|
+
}] });
|
|
1005
|
+
|
|
1006
|
+
class LeDialogService {
|
|
1007
|
+
dialog = inject(Dialog);
|
|
1008
|
+
open(data, config = {}) {
|
|
1009
|
+
const dialogRef = this.dialog.open(DialogComponent, {
|
|
1010
|
+
maxWidth: '80vw',
|
|
1011
|
+
maxHeight: '80vw',
|
|
1012
|
+
minWidth: '40vw',
|
|
1013
|
+
panelClass: 'le-dialog-container',
|
|
1014
|
+
data,
|
|
1015
|
+
injector: config?.injector,
|
|
1016
|
+
});
|
|
1017
|
+
return dialogRef.closed;
|
|
1018
|
+
}
|
|
1019
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LeDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1020
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LeDialogService, providedIn: 'root' });
|
|
1021
|
+
}
|
|
1022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LeDialogService, decorators: [{
|
|
1023
|
+
type: Injectable,
|
|
1024
|
+
args: [{
|
|
1025
|
+
providedIn: 'root',
|
|
1026
|
+
}]
|
|
1027
|
+
}] });
|
|
1028
|
+
|
|
972
1029
|
class TableViewComponent {
|
|
973
1030
|
apiService = inject(LEApiService);
|
|
974
1031
|
dataService = inject(LEDataService);
|
|
975
1032
|
filtersService = inject(LEFiltersService);
|
|
1033
|
+
dialogService = inject(LeDialogService);
|
|
1034
|
+
injector = inject(Injector);
|
|
976
1035
|
node = input.required();
|
|
1036
|
+
config = input();
|
|
977
1037
|
_columns = signal([]);
|
|
978
1038
|
_data = signal(new TableDataSource());
|
|
979
1039
|
_total = signal(0);
|
|
@@ -988,7 +1048,18 @@ class TableViewComponent {
|
|
|
988
1048
|
columns = this._columns.asReadonly();
|
|
989
1049
|
data = this._data.asReadonly();
|
|
990
1050
|
displayedColumns = computed(() => {
|
|
991
|
-
|
|
1051
|
+
const result = [];
|
|
1052
|
+
const firstRow = this.data().getValueByIndex(0);
|
|
1053
|
+
const columnKeys = this.columns().map((column) => column.key);
|
|
1054
|
+
const hasVersion = !!(firstRow && firstRow._metadata && firstRow._metadata.object_version);
|
|
1055
|
+
if (!this.config()?.hideMetadata && hasVersion) {
|
|
1056
|
+
result.push('versions');
|
|
1057
|
+
}
|
|
1058
|
+
result.push(...columnKeys);
|
|
1059
|
+
if (hasVersion) {
|
|
1060
|
+
result.push('modified');
|
|
1061
|
+
}
|
|
1062
|
+
return result;
|
|
992
1063
|
});
|
|
993
1064
|
isLoading = this._isLoading.asReadonly();
|
|
994
1065
|
pageIndex = this._pageIndex.asReadonly();
|
|
@@ -1045,6 +1116,39 @@ class TableViewComponent {
|
|
|
1045
1116
|
const actions = this.node().actions?.onRowClick ?? [];
|
|
1046
1117
|
actions.forEach((action) => this.processTableAction(action, row));
|
|
1047
1118
|
}
|
|
1119
|
+
onRowVersionClick(event, row) {
|
|
1120
|
+
event.preventDefault();
|
|
1121
|
+
event.stopImmediatePropagation();
|
|
1122
|
+
const node = {
|
|
1123
|
+
id: row._metadata.lakehouse_address,
|
|
1124
|
+
type: 'table',
|
|
1125
|
+
title: 'Versions',
|
|
1126
|
+
dataSource: {
|
|
1127
|
+
kind: 'object',
|
|
1128
|
+
entity: row._metadata.lakehouse_address,
|
|
1129
|
+
params: {
|
|
1130
|
+
includeVersions: true,
|
|
1131
|
+
includeMeta: true,
|
|
1132
|
+
loadReferences: false,
|
|
1133
|
+
fileOptimized: true,
|
|
1134
|
+
},
|
|
1135
|
+
},
|
|
1136
|
+
};
|
|
1137
|
+
this.dialogService
|
|
1138
|
+
.open({ node, config: { hideFilters: true, hideMetadata: true, showCloseButton: true } }, { injector: this.injector })
|
|
1139
|
+
.subscribe();
|
|
1140
|
+
}
|
|
1141
|
+
onCellClicked(data) {
|
|
1142
|
+
const path = `${data.ref.resource}%23${data.ref.class_name}%3A${data.ref.class_version}%3A${data.ref.object_id}%3A${data.ref.object_version}`;
|
|
1143
|
+
this.dataService.setView({
|
|
1144
|
+
id: path,
|
|
1145
|
+
type: 'form',
|
|
1146
|
+
controlSource: {
|
|
1147
|
+
kind: 'object',
|
|
1148
|
+
entity: path,
|
|
1149
|
+
},
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1048
1152
|
processTableAction(action, row) {
|
|
1049
1153
|
if (action.type === 'update_form') {
|
|
1050
1154
|
const dataSource = action.dataSource;
|
|
@@ -1088,6 +1192,9 @@ class TableViewComponent {
|
|
|
1088
1192
|
const body = Object.assign({}, node.dataSource.params, buildRequestBody(ctx));
|
|
1089
1193
|
this.apiService.executeTransaction(node.dataSource.entity, body);
|
|
1090
1194
|
}
|
|
1195
|
+
if (node.dataSource?.kind === 'object') {
|
|
1196
|
+
return this.apiService.getObjectByAddress(node.dataSource.entity, node.dataSource.params ?? {});
|
|
1197
|
+
}
|
|
1091
1198
|
throw new Error(`Datasource type should be class or transaction. Received: ${node.dataSource?.kind}`);
|
|
1092
1199
|
}
|
|
1093
1200
|
handleTableDataSuccessResponse(response) {
|
|
@@ -1095,7 +1202,10 @@ class TableViewComponent {
|
|
|
1095
1202
|
this._data.set(new TableDataSource(response.rows));
|
|
1096
1203
|
this._total.set(response.total ?? response.rows.length);
|
|
1097
1204
|
this._isLoading.set(false);
|
|
1098
|
-
this.
|
|
1205
|
+
const showFilters = !this.config()?.hideFilters;
|
|
1206
|
+
if (showFilters) {
|
|
1207
|
+
this.filtersService.setOptions(this.getFilters(response.columns));
|
|
1208
|
+
}
|
|
1099
1209
|
}
|
|
1100
1210
|
handleTableDataErrorResponse(error) {
|
|
1101
1211
|
console.error(error);
|
|
@@ -1103,7 +1213,6 @@ class TableViewComponent {
|
|
|
1103
1213
|
this._data.set(new TableDataSource());
|
|
1104
1214
|
this._total.set(0);
|
|
1105
1215
|
this._isLoading.set(false);
|
|
1106
|
-
// this.filtersService.setOptions(this.getFilters([]));
|
|
1107
1216
|
}
|
|
1108
1217
|
getFilters(columns) {
|
|
1109
1218
|
return columns.reduce((acc, column) => {
|
|
@@ -1172,7 +1281,7 @@ class TableViewComponent {
|
|
|
1172
1281
|
});
|
|
1173
1282
|
}
|
|
1174
1283
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1175
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: TableViewComponent, isStandalone: true, selector: "table-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"le-toolbar\">\n @if (node(); as node) {\n <h2>{{ node?.title }}</h2>\n\n\n <span class=\"spacer\"></span>\n\n @if (filters().length) {\n <button class=\"le-button\" (click)=\"onFiltersClick($event)\">Filters</button>\n }\n\n @if (node.actions?.tableActions) {\n <table-view-actions\n [actions]=\"node.actions!.tableActions\"\n (actionClicked)=\"onToolbarActionClick($event)\"\n ></table-view-actions>\n }\n }\n</div>\n\n@if (pageSize()) {\n <table-view-pagination\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [entriesCount]=\"entriesCount()\"\n (pageChange)=\"onPageChange($event)\"\n ></table-view-pagination>\n}\n\n<div class=\"le-table-container\">\n @if (displayedColumns().length) {\n <table cdk-table [dataSource]=\"data()\" class=\"le-table\" [class.le-table--loading]=\"isLoading()\">\n @for (column of columns(); track column) {\n <ng-container [cdkColumnDef]=\"column.key\">\n <th\n class=\"le-table-header-cell\"\n cdk-header-cell\n *cdkHeaderCellDef\n [tabindex]=\"sortColumnKeys().has(column.key) ? 0 : -1\"\n [class.le-table-header-cell--sortable]=\"sortColumnKeys().has(column.key)\"\n (click)=\"sortColumnKeys().has(column.key) && onSortClick($event, column)\"\n >\n <div class=\"le-cell-content\">\n <ng-template\n tableViewCell\n [data]=\"column.label\"\n [type]=\"column.column_format?.headerTemplate\"\n ></ng-template>\n\n @if (sortColumnKeys().has(column.key)) {\n <div class=\"le-sort-container\">\n @if (sortMap().has(column.key)) {\n <div class=\"le-sort-icon\">\n <i\n class=\"le-sort-arrow\"\n [class.le-sort-arrow--asc]=\"sortMap().get(column.key) === 'asc'\"\n [class.le-sort-arrow--desc]=\"sortMap().get(column.key) === 'desc'\"\n ></i>\n </div>\n\n <div class=\"le-sort-order\">\n @if (sortOrder().has(column.key)) {\n <span>\n {{ sortOrder().get(column.key) }}\n </span>\n }\n </div>\n } @else {\n <le-icon name=\"sort\" class=\"le-sort-icon le-sort-icon--unfold\"></le-icon>\n }\n </div>\n }\n </div>\n </th>\n\n <td class=\"le-table-cell\" cdk-cell *cdkCellDef=\"let row\">\n <ng-template\n tableViewCell\n [data]=\"row[column.key]\"\n [type]=\"column.column_format?.cellTemplate\"\n [column]=\"column\"\n [metadata]=\"row._metadata\"\n ></ng-template>\n </td>\n </ng-container>\n }\n\n <tr cdk-header-row class=\"le-header-row\" *cdkHeaderRowDef=\"displayedColumns()\"></tr>\n <tr\n cdk-row\n class=\"le-table-row\"\n [tabindex]=\"0\"\n [class.le-table-row--clickable]=\"hasRowClickAction()\"\n *cdkRowDef=\"let row; columns: displayedColumns()\"\n (click)=\"onRowClick(row)\"\n ></tr>\n </table>\n }\n</div>\n\n@if (data().count === 0) {\n @if (isLoading()) {\n <app-loading-view [headerHeight]=\"65\" [rowCount]=\"pageSize() || 10\"></app-loading-view>\n } @else {\n <div class=\"no-entities\">\n <span>No Entities</span>\n </div>\n }\n}\n", dependencies: [{ kind: "component", type: CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "component", type: CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { kind: "component", type: CdkRow, selector: "cdk-row, tr[cdk-row]" }, { kind: "directive", type: CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "component", type: TableViewPaginationComponent, selector: "table-view-pagination", inputs: ["pageSize", "pageSizeOptions", "entriesCount"], outputs: ["pageChange"] }, { kind: "component", type: LoadingViewComponent, selector: "app-loading-view", inputs: ["headerHeight", "rowHeight", "rowCount"] }, { kind: "component", type: TableViewActions, selector: "table-view-actions", inputs: ["actions"], outputs: ["actionClicked"] }, { kind: "directive", type: TableViewCellDirective, selector: "[tableViewCell]", inputs: ["type", "data", "column", "metadata"] }, { kind: "component", type: LeIconComponent, selector: "le-icon", inputs: ["name", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1284
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: TableViewComponent, isStandalone: true, selector: "table-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"le-toolbar\">\n @if (node(); as node) {\n <h2>{{ node?.title }}</h2>\n\n\n <span class=\"spacer\"></span>\n\n @if (filters().length) {\n <button class=\"le-button\" (click)=\"onFiltersClick($event)\">Filters</button>\n }\n\n @if (node.actions?.tableActions) {\n <table-view-actions\n [actions]=\"node.actions!.tableActions\"\n (actionClicked)=\"onToolbarActionClick($event)\"\n ></table-view-actions>\n }\n }\n</div>\n\n@if (pageSize()) {\n <table-view-pagination\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [entriesCount]=\"entriesCount()\"\n (pageChange)=\"onPageChange($event)\"\n ></table-view-pagination>\n}\n\n<div class=\"le-table-container\">\n @if (displayedColumns().length) {\n <table cdk-table [dataSource]=\"data()\" class=\"le-table\" [class.le-table--loading]=\"isLoading()\">\n <!-- Version column -->\n <ng-container cdkColumnDef=\"versions\">\n <th class=\"le-table-header-cell le-table-icon-cell\" cdk-header-cell *cdkHeaderCellDef>\n <le-icon size=\"16\" class=\"le-icon\" name=\"history\"></le-icon>\n </th>\n\n <td class=\"le-table-cell le-table-icon-cell\" cdk-cell *cdkCellDef=\"let row\">\n <button class=\"le-button le-button-basic le-button--success\" aria-label=\"View versions\" (click)=\"onRowVersionClick($event, row)\">\n <le-icon size=\"16\" class=\"le-icon\" name=\"history\"></le-icon>\n </button>\n </td>\n </ng-container>\n <!-- Modified column -->\n <ng-container cdkColumnDef=\"modified\">\n <th class=\"le-table-header-cell\" cdk-header-cell *cdkHeaderCellDef>\n <div class=\"le-cell-content\">\n Modified\n </div>\n </th>\n\n <td class=\"le-table-cell\" cdk-cell *cdkCellDef=\"let row\">\n <span class=\"le-table-template le-template-string\">\n {{ row._metadata.updated_at | date:'medium' }}\n </span>\n </td>\n </ng-container>\n\n <!-- Columns -->\n @for (column of columns(); track column) {\n <ng-container [cdkColumnDef]=\"column.key\">\n <th\n class=\"le-table-header-cell\"\n cdk-header-cell\n *cdkHeaderCellDef\n [tabindex]=\"sortColumnKeys().has(column.key) ? 0 : -1\"\n [class.le-table-header-cell--sortable]=\"sortColumnKeys().has(column.key)\"\n (click)=\"sortColumnKeys().has(column.key) && onSortClick($event, column)\"\n >\n <div class=\"le-cell-content\">\n <ng-template\n tableViewCell\n [data]=\"column.label\"\n [type]=\"column.column_format?.headerTemplate\"\n ></ng-template>\n\n @if (sortColumnKeys().has(column.key)) {\n <div class=\"le-sort-container\">\n @if (sortMap().has(column.key)) {\n <div class=\"le-sort-icon\">\n <i\n class=\"le-sort-arrow\"\n [class.le-sort-arrow--asc]=\"sortMap().get(column.key) === 'asc'\"\n [class.le-sort-arrow--desc]=\"sortMap().get(column.key) === 'desc'\"\n ></i>\n </div>\n\n <div class=\"le-sort-order\">\n @if (sortOrder().has(column.key)) {\n <span>\n {{ sortOrder().get(column.key) }}\n </span>\n }\n </div>\n } @else {\n <le-icon name=\"sort\" class=\"le-sort-icon le-sort-icon--unfold\"></le-icon>\n }\n </div>\n }\n </div>\n </th>\n\n <td class=\"le-table-cell\" cdk-cell *cdkCellDef=\"let row\">\n <ng-template\n tableViewCell\n [data]=\"row[column.key]\"\n [type]=\"column.column_format?.cellTemplate\"\n [column]=\"column\"\n [metadata]=\"row._metadata\"\n (clicked)=\"onCellClicked($event)\"\n ></ng-template>\n </td>\n </ng-container>\n }\n\n <tr cdk-header-row class=\"le-header-row\" *cdkHeaderRowDef=\"displayedColumns()\"></tr>\n <tr\n cdk-row\n class=\"le-table-row\"\n [tabindex]=\"0\"\n [class.le-table-row--clickable]=\"hasRowClickAction()\"\n *cdkRowDef=\"let row; columns: displayedColumns()\"\n (click)=\"onRowClick(row)\"\n ></tr>\n </table>\n }\n</div>\n\n@if (data().count === 0) {\n @if (isLoading()) {\n <app-loading-view [headerHeight]=\"65\" [rowCount]=\"pageSize() || 10\"></app-loading-view>\n } @else {\n <div class=\"no-entities\">\n <span>No Entities</span>\n </div>\n }\n}\n", dependencies: [{ kind: "component", type: CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "component", type: CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { kind: "component", type: CdkRow, selector: "cdk-row, tr[cdk-row]" }, { kind: "directive", type: CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "component", type: TableViewPaginationComponent, selector: "table-view-pagination", inputs: ["pageSize", "pageSizeOptions", "entriesCount"], outputs: ["pageChange"] }, { kind: "component", type: LoadingViewComponent, selector: "app-loading-view", inputs: ["headerHeight", "rowHeight", "rowCount"] }, { kind: "component", type: TableViewActions, selector: "table-view-actions", inputs: ["actions"], outputs: ["actionClicked"] }, { kind: "directive", type: TableViewCellDirective, selector: "[tableViewCell]", inputs: ["type", "data", "column", "metadata"], outputs: ["clicked"] }, { kind: "component", type: LeIconComponent, selector: "le-icon", inputs: ["name", "size"] }, { kind: "ngmodule", type: DialogModule }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1176
1285
|
}
|
|
1177
1286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TableViewComponent, decorators: [{
|
|
1178
1287
|
type: Component,
|
|
@@ -1192,7 +1301,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
1192
1301
|
TableViewActions,
|
|
1193
1302
|
TableViewCellDirective,
|
|
1194
1303
|
LeIconComponent,
|
|
1195
|
-
|
|
1304
|
+
DialogModule,
|
|
1305
|
+
DatePipe,
|
|
1306
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"le-toolbar\">\n @if (node(); as node) {\n <h2>{{ node?.title }}</h2>\n\n\n <span class=\"spacer\"></span>\n\n @if (filters().length) {\n <button class=\"le-button\" (click)=\"onFiltersClick($event)\">Filters</button>\n }\n\n @if (node.actions?.tableActions) {\n <table-view-actions\n [actions]=\"node.actions!.tableActions\"\n (actionClicked)=\"onToolbarActionClick($event)\"\n ></table-view-actions>\n }\n }\n</div>\n\n@if (pageSize()) {\n <table-view-pagination\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [entriesCount]=\"entriesCount()\"\n (pageChange)=\"onPageChange($event)\"\n ></table-view-pagination>\n}\n\n<div class=\"le-table-container\">\n @if (displayedColumns().length) {\n <table cdk-table [dataSource]=\"data()\" class=\"le-table\" [class.le-table--loading]=\"isLoading()\">\n <!-- Version column -->\n <ng-container cdkColumnDef=\"versions\">\n <th class=\"le-table-header-cell le-table-icon-cell\" cdk-header-cell *cdkHeaderCellDef>\n <le-icon size=\"16\" class=\"le-icon\" name=\"history\"></le-icon>\n </th>\n\n <td class=\"le-table-cell le-table-icon-cell\" cdk-cell *cdkCellDef=\"let row\">\n <button class=\"le-button le-button-basic le-button--success\" aria-label=\"View versions\" (click)=\"onRowVersionClick($event, row)\">\n <le-icon size=\"16\" class=\"le-icon\" name=\"history\"></le-icon>\n </button>\n </td>\n </ng-container>\n <!-- Modified column -->\n <ng-container cdkColumnDef=\"modified\">\n <th class=\"le-table-header-cell\" cdk-header-cell *cdkHeaderCellDef>\n <div class=\"le-cell-content\">\n Modified\n </div>\n </th>\n\n <td class=\"le-table-cell\" cdk-cell *cdkCellDef=\"let row\">\n <span class=\"le-table-template le-template-string\">\n {{ row._metadata.updated_at | date:'medium' }}\n </span>\n </td>\n </ng-container>\n\n <!-- Columns -->\n @for (column of columns(); track column) {\n <ng-container [cdkColumnDef]=\"column.key\">\n <th\n class=\"le-table-header-cell\"\n cdk-header-cell\n *cdkHeaderCellDef\n [tabindex]=\"sortColumnKeys().has(column.key) ? 0 : -1\"\n [class.le-table-header-cell--sortable]=\"sortColumnKeys().has(column.key)\"\n (click)=\"sortColumnKeys().has(column.key) && onSortClick($event, column)\"\n >\n <div class=\"le-cell-content\">\n <ng-template\n tableViewCell\n [data]=\"column.label\"\n [type]=\"column.column_format?.headerTemplate\"\n ></ng-template>\n\n @if (sortColumnKeys().has(column.key)) {\n <div class=\"le-sort-container\">\n @if (sortMap().has(column.key)) {\n <div class=\"le-sort-icon\">\n <i\n class=\"le-sort-arrow\"\n [class.le-sort-arrow--asc]=\"sortMap().get(column.key) === 'asc'\"\n [class.le-sort-arrow--desc]=\"sortMap().get(column.key) === 'desc'\"\n ></i>\n </div>\n\n <div class=\"le-sort-order\">\n @if (sortOrder().has(column.key)) {\n <span>\n {{ sortOrder().get(column.key) }}\n </span>\n }\n </div>\n } @else {\n <le-icon name=\"sort\" class=\"le-sort-icon le-sort-icon--unfold\"></le-icon>\n }\n </div>\n }\n </div>\n </th>\n\n <td class=\"le-table-cell\" cdk-cell *cdkCellDef=\"let row\">\n <ng-template\n tableViewCell\n [data]=\"row[column.key]\"\n [type]=\"column.column_format?.cellTemplate\"\n [column]=\"column\"\n [metadata]=\"row._metadata\"\n (clicked)=\"onCellClicked($event)\"\n ></ng-template>\n </td>\n </ng-container>\n }\n\n <tr cdk-header-row class=\"le-header-row\" *cdkHeaderRowDef=\"displayedColumns()\"></tr>\n <tr\n cdk-row\n class=\"le-table-row\"\n [tabindex]=\"0\"\n [class.le-table-row--clickable]=\"hasRowClickAction()\"\n *cdkRowDef=\"let row; columns: displayedColumns()\"\n (click)=\"onRowClick(row)\"\n ></tr>\n </table>\n }\n</div>\n\n@if (data().count === 0) {\n @if (isLoading()) {\n <app-loading-view [headerHeight]=\"65\" [rowCount]=\"pageSize() || 10\"></app-loading-view>\n } @else {\n <div class=\"no-entities\">\n <span>No Entities</span>\n </div>\n }\n}\n" }]
|
|
1196
1307
|
}], ctorParameters: () => [] });
|
|
1197
1308
|
|
|
1198
1309
|
const isSectionsSchema = (raw) => {
|
|
@@ -1496,7 +1607,10 @@ class FormViewAttachmentService {
|
|
|
1496
1607
|
return null;
|
|
1497
1608
|
}
|
|
1498
1609
|
async fetchAttachmentData(attachment) {
|
|
1499
|
-
const response = await firstValueFrom(this.apiService.getObjectByAddress(getAttachmentUrl(attachment),
|
|
1610
|
+
const response = await firstValueFrom(this.apiService.getObjectByAddress(getAttachmentUrl(attachment), {
|
|
1611
|
+
includeVersions: false,
|
|
1612
|
+
includeMeta: false,
|
|
1613
|
+
}));
|
|
1500
1614
|
const row = response?.rows?.[0];
|
|
1501
1615
|
if (!row?.data)
|
|
1502
1616
|
return null;
|
|
@@ -1648,6 +1762,7 @@ class FormViewComponent {
|
|
|
1648
1762
|
},
|
|
1649
1763
|
};
|
|
1650
1764
|
node = input.required();
|
|
1765
|
+
config = input();
|
|
1651
1766
|
isLoading = this._isLoading.asReadonly();
|
|
1652
1767
|
data = computed(() => {
|
|
1653
1768
|
const engine = this._engine();
|
|
@@ -1726,6 +1841,19 @@ class FormViewComponent {
|
|
|
1726
1841
|
return of(null);
|
|
1727
1842
|
}));
|
|
1728
1843
|
}
|
|
1844
|
+
if (node.controlSource?.kind === 'object') {
|
|
1845
|
+
this._isLoading.set(true);
|
|
1846
|
+
return this.apiService
|
|
1847
|
+
.getObjectByAddress(node.controlSource.entity, node.controlSource.params ?? {})
|
|
1848
|
+
.pipe(tap((response) => {
|
|
1849
|
+
this._form.set(adaptForm(response.control));
|
|
1850
|
+
this._isLoading.set(false);
|
|
1851
|
+
}), map(() => null), catchError((error) => {
|
|
1852
|
+
console.error(error);
|
|
1853
|
+
this._isLoading.set(false);
|
|
1854
|
+
return of(null);
|
|
1855
|
+
}));
|
|
1856
|
+
}
|
|
1729
1857
|
throw new Error(`Unsupported control source kind ${node.controlSource?.kind}`);
|
|
1730
1858
|
}
|
|
1731
1859
|
mapUpdateFormActionToFormNode(source) {
|
|
@@ -1761,7 +1889,7 @@ class FormViewComponent {
|
|
|
1761
1889
|
.subscribe();
|
|
1762
1890
|
}
|
|
1763
1891
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: FormViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1764
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: FormViewComponent, isStandalone: true, selector: "form-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, providers: [FormViewAttachmentService], ngImport: i0, template: "<h2>{{ node()?.title }}</h2>\n\n@if (isLoading()) {\n <app-loading-view [rowCount]=\"5\"></app-loading-view>\n} @else {\n @if (data(); as data) {\n <le-form-renderer\n [engine]=\"data.engine\"\n [sections]=\"data.sections\"\n [customCss]=\"data.customCss\"\n [topLevelControls]=\"data.topLevelControls\"\n ></le-form-renderer>\n }\n}\n", dependencies: [{ kind: "component", type: LoadingViewComponent, selector: "app-loading-view", inputs: ["headerHeight", "rowHeight", "rowCount"] }, { kind: "component", type: FormRendererComponent, selector: "le-form-renderer", inputs: ["engine", "sections", "topLevelControls", "customCss"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1892
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: FormViewComponent, isStandalone: true, selector: "form-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, providers: [FormViewAttachmentService], ngImport: i0, template: "<h2>{{ node()?.title }}</h2>\n\n@if (isLoading()) {\n <app-loading-view [rowCount]=\"5\"></app-loading-view>\n} @else {\n @if (data(); as data) {\n <le-form-renderer\n [engine]=\"data.engine\"\n [sections]=\"data.sections\"\n [customCss]=\"data.customCss\"\n [topLevelControls]=\"data.topLevelControls\"\n ></le-form-renderer>\n }\n}\n", dependencies: [{ kind: "component", type: LoadingViewComponent, selector: "app-loading-view", inputs: ["headerHeight", "rowHeight", "rowCount"] }, { kind: "component", type: FormRendererComponent, selector: "le-form-renderer", inputs: ["engine", "sections", "topLevelControls", "customCss"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1765
1893
|
}
|
|
1766
1894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: FormViewComponent, decorators: [{
|
|
1767
1895
|
type: Component,
|
|
@@ -1770,28 +1898,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
1770
1898
|
|
|
1771
1899
|
class SectionComponent {
|
|
1772
1900
|
node = input.required();
|
|
1901
|
+
config = input();
|
|
1773
1902
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1774
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SectionComponent, isStandalone: true, selector: "section-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node"] }] });
|
|
1903
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SectionComponent, isStandalone: true, selector: "section-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node", "config"] }] });
|
|
1775
1904
|
}
|
|
1776
1905
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SectionComponent, decorators: [{
|
|
1777
1906
|
type: Component,
|
|
1778
|
-
args: [{ selector: 'section-view', imports: [forwardRef(() => NodeComponent)], template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n" }]
|
|
1907
|
+
args: [{ selector: 'section-view', imports: [forwardRef(() => NodeComponent)], template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n" }]
|
|
1779
1908
|
}] });
|
|
1780
1909
|
|
|
1781
1910
|
class GridColViewComponent {
|
|
1782
1911
|
node = input.required();
|
|
1912
|
+
config = input();
|
|
1783
1913
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GridColViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1784
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GridColViewComponent, isStandalone: true, selector: "grid-col-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node"] }] });
|
|
1914
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GridColViewComponent, isStandalone: true, selector: "grid-col-view", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => NodeComponent), selector: "le-node", inputs: ["node", "config"] }] });
|
|
1785
1915
|
}
|
|
1786
1916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GridColViewComponent, decorators: [{
|
|
1787
1917
|
type: Component,
|
|
1788
|
-
args: [{ selector: 'grid-col-view', imports: [forwardRef(() => NodeComponent)], template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\"></le-node>\n}\n" }]
|
|
1918
|
+
args: [{ selector: 'grid-col-view', imports: [forwardRef(() => NodeComponent)], template: "@for (child of node().children; track child.id) {\n <le-node [node]=\"child\" [config]=\"config()\"></le-node>\n}\n" }]
|
|
1789
1919
|
}] });
|
|
1790
1920
|
|
|
1791
1921
|
class NodeComponent {
|
|
1792
1922
|
node = input.required();
|
|
1923
|
+
config = input();
|
|
1793
1924
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: NodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1794
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: NodeComponent, isStandalone: true, selector: "le-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (node(); as node) {\n @switch (node.type) {\n @case ('section') {\n <section-view [node]=\"node\"></section-view>\n }\n @case ('grid') {\n <grid-view [node]=\"node\"></grid-view>\n }\n @case ('grid_col') {\n <grid-col-view [node]=\"node\"></grid-col-view>\n }\n @case ('table') {\n <table-view [node]=\"node\"></table-view>\n }\n @case ('chart') {\n <chart-view [node]=\"node\"></chart-view>\n }\n @case ('form') {\n <form-view [node]=\"node\"></form-view>\n }\n }\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => ChartViewComponent), selector: "chart-view", inputs: ["node"] }, { kind: "component", type: i0.forwardRef(() => GridComponent), selector: "grid-view", inputs: ["node"] }, { kind: "component", type: i0.forwardRef(() => TableViewComponent), selector: "table-view", inputs: ["node"] }, { kind: "component", type: i0.forwardRef(() => FormViewComponent), selector: "form-view", inputs: ["node"] }, { kind: "component", type: i0.forwardRef(() => GridColViewComponent), selector: "grid-col-view", inputs: ["node"] }, { kind: "component", type: i0.forwardRef(() => SectionComponent), selector: "section-view", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: NodeComponent, isStandalone: true, selector: "le-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (node(); as node) {\n @switch (node.type) {\n @case ('section') {\n <section-view [node]=\"node\" [config]=\"config()\"></section-view>\n }\n @case ('grid') {\n <grid-view [node]=\"node\" [config]=\"config()\"></grid-view>\n }\n @case ('grid_col') {\n <grid-col-view [node]=\"node\" [config]=\"config()\"></grid-col-view>\n }\n @case ('table') {\n <table-view [node]=\"node\" [config]=\"config()\"></table-view>\n }\n @case ('chart') {\n <chart-view [node]=\"node\" [config]=\"config()\"></chart-view>\n }\n @case ('form') {\n <form-view [node]=\"node\" [config]=\"config()\"></form-view>\n }\n }\n}\n", dependencies: [{ kind: "component", type: i0.forwardRef(() => ChartViewComponent), selector: "chart-view", inputs: ["node", "config"] }, { kind: "component", type: i0.forwardRef(() => GridComponent), selector: "grid-view", inputs: ["node", "config"] }, { kind: "component", type: i0.forwardRef(() => TableViewComponent), selector: "table-view", inputs: ["node", "config"] }, { kind: "component", type: i0.forwardRef(() => FormViewComponent), selector: "form-view", inputs: ["node", "config"] }, { kind: "component", type: i0.forwardRef(() => GridColViewComponent), selector: "grid-col-view", inputs: ["node", "config"] }, { kind: "component", type: i0.forwardRef(() => SectionComponent), selector: "section-view", inputs: ["node", "config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1795
1926
|
}
|
|
1796
1927
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: NodeComponent, decorators: [{
|
|
1797
1928
|
type: Component,
|
|
@@ -1802,7 +1933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
1802
1933
|
FormViewComponent,
|
|
1803
1934
|
GridColViewComponent,
|
|
1804
1935
|
forwardRef(() => SectionComponent),
|
|
1805
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (node(); as node) {\n @switch (node.type) {\n @case ('section') {\n <section-view [node]=\"node\"></section-view>\n }\n @case ('grid') {\n <grid-view [node]=\"node\"></grid-view>\n }\n @case ('grid_col') {\n <grid-col-view [node]=\"node\"></grid-col-view>\n }\n @case ('table') {\n <table-view [node]=\"node\"></table-view>\n }\n @case ('chart') {\n <chart-view [node]=\"node\"></chart-view>\n }\n @case ('form') {\n <form-view [node]=\"node\"></form-view>\n }\n }\n}\n" }]
|
|
1936
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (node(); as node) {\n @switch (node.type) {\n @case ('section') {\n <section-view [node]=\"node\" [config]=\"config()\"></section-view>\n }\n @case ('grid') {\n <grid-view [node]=\"node\" [config]=\"config()\"></grid-view>\n }\n @case ('grid_col') {\n <grid-col-view [node]=\"node\" [config]=\"config()\"></grid-col-view>\n }\n @case ('table') {\n <table-view [node]=\"node\" [config]=\"config()\"></table-view>\n }\n @case ('chart') {\n <chart-view [node]=\"node\" [config]=\"config()\"></chart-view>\n }\n @case ('form') {\n <form-view [node]=\"node\" [config]=\"config()\"></form-view>\n }\n }\n}\n" }]
|
|
1806
1937
|
}] });
|
|
1807
1938
|
|
|
1808
1939
|
class FiltersComponent {
|
|
@@ -2036,7 +2167,7 @@ class LeContainerComponent {
|
|
|
2036
2167
|
});
|
|
2037
2168
|
}
|
|
2038
2169
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LeContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2039
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: LeContainerComponent, isStandalone: true, selector: "le-container", providers: [LEDataService, LEApiService, LEFiltersService, LeNavigationService], viewQueries: [{ propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (data(); as data) {\n <le-sidebar\n [config]=\"data.config\"\n [view]=\"data.view\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n <le-filters>\n <le-node [node]=\"data.view\"></le-node>\n </le-filters>\n </le-sidebar>\n}\n", dependencies: [{ kind: "component", type: SidebarComponent, selector: "le-sidebar", inputs: ["config", "view"], outputs: ["selectionChange"] }, { kind: "component", type: NodeComponent, selector: "le-node", inputs: ["node"] }, { kind: "component", type: FiltersComponent, selector: "le-filters" }] });
|
|
2170
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: LeContainerComponent, isStandalone: true, selector: "le-container", providers: [LEDataService, LEApiService, LEFiltersService, LeNavigationService], viewQueries: [{ propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (data(); as data) {\n <le-sidebar\n [config]=\"data.config\"\n [view]=\"data.view\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n <le-filters>\n <le-node [node]=\"data.view\"></le-node>\n </le-filters>\n </le-sidebar>\n}\n", dependencies: [{ kind: "component", type: SidebarComponent, selector: "le-sidebar", inputs: ["config", "view"], outputs: ["selectionChange"] }, { kind: "component", type: NodeComponent, selector: "le-node", inputs: ["node", "config"] }, { kind: "component", type: FiltersComponent, selector: "le-filters" }] });
|
|
2040
2171
|
}
|
|
2041
2172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: LeContainerComponent, decorators: [{
|
|
2042
2173
|
type: Component,
|