@one-paragon/angular-utilities 0.1.37 → 0.1.39
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/ngrx/actionable-selector.mjs +16 -14
- package/esm2022/table-builder/classes/GenericTableDataSource.mjs +3 -5
- package/esm2022/table-builder/classes/TableState.mjs +5 -5
- package/esm2022/table-builder/classes/table-builder-general-settings.mjs +3 -3
- package/esm2022/table-builder/classes/table-store.mjs +12 -7
- package/esm2022/table-builder/components/column-builder/column-builder.component.mjs +3 -3
- package/esm2022/table-builder/components/sort-menu/sort-menu.component-store.mjs +3 -2
- package/esm2022/table-builder/components/sort-menu/sort-menu.component.mjs +1 -1
- package/esm2022/table-builder/directives/custom-cell-directive.mjs +1 -1
- package/esm2022/table-builder/directives/multi-sort.directive.mjs +15 -3
- package/esm2022/table-builder/interfaces/report-def.mjs +1 -1
- package/fesm2022/one-paragon-angular-utilities.mjs +86 -69
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/ngrx/actionable-selector.d.ts +1 -0
- package/package.json +1 -1
- package/table-builder/classes/GenericTableDataSource.d.ts +0 -3
- package/table-builder/classes/TableState.d.ts +3 -3
- package/table-builder/classes/table-builder-general-settings.d.ts +3 -3
- package/table-builder/classes/table-store.d.ts +3 -3
- package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +2 -2
- package/table-builder/interfaces/report-def.d.ts +5 -0
|
@@ -27,7 +27,7 @@ import { LetModule } from '@ngrx/component';
|
|
|
27
27
|
import * as i5 from '@angular/material/tooltip';
|
|
28
28
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
29
29
|
import * as i1$1 from '@angular/material/sort';
|
|
30
|
-
import {
|
|
30
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
31
31
|
import * as i6$1 from '@angular/material/menu';
|
|
32
32
|
import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
|
|
33
33
|
import * as i3$1 from '@angular/material/form-field';
|
|
@@ -1275,7 +1275,7 @@ class TableColumnHeaderSettings {
|
|
|
1275
1275
|
this.noHeader = false;
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
class
|
|
1278
|
+
class PersistedTableSettings {
|
|
1279
1279
|
constructor(tableSettings) {
|
|
1280
1280
|
this.collapseHeader = false;
|
|
1281
1281
|
this.collapseFooter = false;
|
|
@@ -1285,7 +1285,7 @@ class PesrsistedTableSettings {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
class
|
|
1288
|
+
class NotPersistedTableSettings {
|
|
1289
1289
|
constructor(tableSettings) {
|
|
1290
1290
|
this.hideExport = true;
|
|
1291
1291
|
this.hideFilter = true;
|
|
@@ -1312,7 +1312,7 @@ class KeysToDelete {
|
|
|
1312
1312
|
constructor() {
|
|
1313
1313
|
this.initializationState = null;
|
|
1314
1314
|
this.metaData = null;
|
|
1315
|
-
this.
|
|
1315
|
+
this.notPersistedTableSettings = null;
|
|
1316
1316
|
this.linkMaps = null;
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
@@ -1331,8 +1331,8 @@ const defaultTableState = {
|
|
|
1331
1331
|
hiddenKeys: [],
|
|
1332
1332
|
sorted: [],
|
|
1333
1333
|
userDefined: { order: {}, widths: {}, table: {} },
|
|
1334
|
-
persistedTableSettings: new
|
|
1335
|
-
|
|
1334
|
+
persistedTableSettings: new PersistedTableSettings(),
|
|
1335
|
+
notPersistedTableSettings: new NotPersistedTableSettings(),
|
|
1336
1336
|
pageSize: 10,
|
|
1337
1337
|
linkMaps: {},
|
|
1338
1338
|
groupByKeys: [],
|
|
@@ -1770,6 +1770,11 @@ class TableStore extends ComponentStore {
|
|
|
1770
1770
|
customCell: merge.customCell ?? orig.customCell,
|
|
1771
1771
|
transform: merge.transform ?? orig.transform,
|
|
1772
1772
|
click: merge.click ?? orig.click,
|
|
1773
|
+
classes: merge.classes ?? orig.classes,
|
|
1774
|
+
noSort: merge.noSort ?? orig.noSort,
|
|
1775
|
+
template: merge.template ?? orig.template,
|
|
1776
|
+
toolTip: merge.toolTip ?? orig.toolTip,
|
|
1777
|
+
useIcon: merge.useIcon ?? orig.useIcon,
|
|
1773
1778
|
};
|
|
1774
1779
|
};
|
|
1775
1780
|
this.setIntializationState = this.updater((state, initializationState) => {
|
|
@@ -1805,12 +1810,12 @@ class TableStore extends ComponentStore {
|
|
|
1805
1810
|
this.toggleCollapseHeader = this.updater((state) => {
|
|
1806
1811
|
const tableSettings = { ...state.persistedTableSettings };
|
|
1807
1812
|
tableSettings.collapseHeader = !tableSettings.collapseHeader;
|
|
1808
|
-
return ({ ...state, persistedTableSettings: new
|
|
1813
|
+
return ({ ...state, persistedTableSettings: new PersistedTableSettings(tableSettings) });
|
|
1809
1814
|
});
|
|
1810
1815
|
this.toggleCollapseFooter = this.updater((state) => {
|
|
1811
1816
|
const tableSettings = { ...state.persistedTableSettings };
|
|
1812
1817
|
tableSettings.collapseFooter = !tableSettings.collapseFooter;
|
|
1813
|
-
return ({ ...state, persistedTableSettings: new
|
|
1818
|
+
return ({ ...state, persistedTableSettings: new PersistedTableSettings(tableSettings) });
|
|
1814
1819
|
});
|
|
1815
1820
|
this.addGroupByKey = this.updater((state, groupByKey) => ({
|
|
1816
1821
|
...state,
|
|
@@ -1829,13 +1834,13 @@ class TableStore extends ComponentStore {
|
|
|
1829
1834
|
this.setTableSettings = this.updater((state, settings) => {
|
|
1830
1835
|
const s = {
|
|
1831
1836
|
...state,
|
|
1832
|
-
persistedTableSettings: new
|
|
1833
|
-
|
|
1837
|
+
persistedTableSettings: new PersistedTableSettings(settings),
|
|
1838
|
+
notPersistedTableSettings: new NotPersistedTableSettings(settings)
|
|
1834
1839
|
};
|
|
1835
1840
|
return s;
|
|
1836
1841
|
});
|
|
1837
1842
|
this.tableSettings$ = this.select(state => {
|
|
1838
|
-
const ts = { ...state.persistedTableSettings, ...state.
|
|
1843
|
+
const ts = { ...state.persistedTableSettings, ...state.notPersistedTableSettings };
|
|
1839
1844
|
return ts;
|
|
1840
1845
|
});
|
|
1841
1846
|
this.setLinkMaps = this.updater((state, maps) => {
|
|
@@ -2406,7 +2411,7 @@ class ColumnBuilderComponent {
|
|
|
2406
2411
|
}
|
|
2407
2412
|
}
|
|
2408
2413
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: ColumnBuilderComponent, deps: [{ token: TransformCreator }, { token: i4$3.MatTable }, { token: TableStore }, { token: TableTemplateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2409
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: ColumnBuilderComponent, selector: "tb-column-builder", inputs: { metaData: "metaData", customCell: "customCell", data$: "data$" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: MatColumnDef, descendants: true }, { propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true }], ngImport: i0, template: "<ng-container [matColumnDef]=\"metaData.key\" *ngrxLet=\"styles$ as styles\" >\r\n\r\n
|
|
2414
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: ColumnBuilderComponent, selector: "tb-column-builder", inputs: { metaData: "metaData", customCell: "customCell", data$: "data$" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: MatColumnDef, descendants: true }, { propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true }], ngImport: i0, template: "<ng-container [matColumnDef]=\"metaData.key\" *ngrxLet=\"styles$ as styles\" >\r\n\r\n <!-- header -->\r\n <ng-template matHeaderCellDef #myHeader>\r\n <ng-container *ngIf=\"customCell?.columnDef?.headerCell;else header;\">\r\n <ng-container *ngTemplateOutlet=\"customCell.columnDef.headerCell.template; context: {metaData: metaData, styles: styles.header} \"/>\r\n </ng-container>\r\n\r\n <ng-template #header>\r\n <mat-header-cell cdkDrag [styler]='styles.header' [resizeColumn]=\"true\" [key]=\"metaData.key\" class=\"column-head drag-header\" #headref \r\n [conditionalClasses]='metaData.additional?.columnPartClasses?.header' >\r\n <div class=\"header-container\" cdkDragHandle>\r\n <div *ngIf=\"!metaData._internalNotUserDefined || !customCell?.columnDef?.cell ; else headerWithoutMenu\" mat-sort-header [disabled]=\"metaData.noSort\" style=\"width: 100%\">\r\n {{ metaData.displayName ? metaData.displayName : ( metaData.key | spaceCase ) }}\r\n </div>\r\n <ng-template #headerWithoutMenu >\r\n <div *ngIf=\"metaData._internalNotUserDefined;\" style=\"width: 100%\">\r\n {{ metaData.displayName ? metaData.displayName : ( metaData.key | spaceCase ) }}\r\n </div>\r\n </ng-template>\r\n <tb-header-menu\r\n *ngIf=\"(!metaData._internalNotUserDefined || !customCell?.columnDef?.cell) && (showfilters$ | async);\" #menu [metaData]='metaData' [filter]='filter' >\r\n </tb-header-menu>\r\n </div>\r\n </mat-header-cell>\r\n </ng-template>\r\n </ng-template>\r\n\r\n <!-- body -->\r\n <ng-container *matCellDef=\"let element;\">\r\n <ng-container *ngTemplateOutlet=\"outerTemplate; context: {metaData: metaData, element: element , styles: styles.body }\"/>\r\n </ng-container>\r\n <ng-template #body let-element='element' >\r\n <mat-cell [matTooltip]=\"metaData.toolTip ?? ''\" [conditionalClasses]='metaData.classes' [element]='element' [styler]='styles.body' [class.group-footer]=\"element.isGroupFooter\" (click)='cellClicked(element, metaData.key)' >\r\n <ng-container *ngTemplateOutlet=\"innerTemplate;context: {metaData: metaData, element: element, transform: transform }; Injector: injector\" />\r\n </mat-cell>\r\n </ng-template>\r\n \r\n <!-- footer -->\r\n <ng-template matFooterCellDef>\r\n <ng-container *ngIf=\"customCell?.columnDef?.footerCell;else footer\">\r\n <ng-container\r\n *ngTemplateOutlet=\"customCell.columnDef.footerCell.template;context: {metaData: metaData, data: data$, styles : styles.footer }\"/>\r\n </ng-container>\r\n\r\n <ng-template #footer>\r\n <mat-footer-cell [styler]='styles.footer' *ngrxLet=\"data$ as data\" [conditionalClasses]='metaData.additional?.columnPartClasses?.footer'>\r\n <span *ngIf=\"!!data?.length && metaData.additional?.footer\" [ngSwitch]=\"metaData.fieldType\" class=\"bold\">\r\n <span *ngSwitchCase=\"FieldType.Currency\">\r\n {{ data | columnTotal: metaData | currency }}\r\n </span>\r\n <span *ngSwitchCase=\"FieldType.Number\">\r\n {{ data | columnTotal: metaData | number }}\r\n </span>\r\n </span>\r\n </mat-footer-cell>\r\n </ng-template>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".header-container{display:flex;flex-direction:row;width:100%;align-items:center}.negative-currency{color:red}.column-head{position:relative}.bold,.group-footer{font-weight:900}.cdk-drag-preview{background:white;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:33%;border-right-width:0px}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.drag-handle{color:#add8e6;cursor:move;margin-right:9px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i4$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i4$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i4$3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i1$1.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i8.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "directive", type: i9.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i9.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["styler"] }, { kind: "directive", type: ConditionalClassesDirective, selector: "[conditionalClasses]", inputs: ["element", "conditionalClasses"] }, { kind: "component", type: HeaderMenuComponent, selector: "tb-header-menu", inputs: ["filter", "metaData"] }, { kind: "directive", type: ResizeColumnDirective, selector: "[resizeColumn]", inputs: ["resizeColumn", "key"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i2.CurrencyPipe, name: "currency" }, { kind: "pipe", type: SpaceCasePipe, name: "spaceCase" }, { kind: "pipe", type: ColumnTotalPipe, name: "columnTotal" }], viewProviders: [
|
|
2410
2415
|
{ provide: CDK_DROP_LIST, useExisting: CdkDropList },
|
|
2411
2416
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2412
2417
|
}
|
|
@@ -2414,7 +2419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
2414
2419
|
type: Component,
|
|
2415
2420
|
args: [{ selector: 'tb-column-builder', changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [
|
|
2416
2421
|
{ provide: CDK_DROP_LIST, useExisting: CdkDropList },
|
|
2417
|
-
], template: "<ng-container [matColumnDef]=\"metaData.key\" *ngrxLet=\"styles$ as styles\" >\r\n\r\n
|
|
2422
|
+
], template: "<ng-container [matColumnDef]=\"metaData.key\" *ngrxLet=\"styles$ as styles\" >\r\n\r\n <!-- header -->\r\n <ng-template matHeaderCellDef #myHeader>\r\n <ng-container *ngIf=\"customCell?.columnDef?.headerCell;else header;\">\r\n <ng-container *ngTemplateOutlet=\"customCell.columnDef.headerCell.template; context: {metaData: metaData, styles: styles.header} \"/>\r\n </ng-container>\r\n\r\n <ng-template #header>\r\n <mat-header-cell cdkDrag [styler]='styles.header' [resizeColumn]=\"true\" [key]=\"metaData.key\" class=\"column-head drag-header\" #headref \r\n [conditionalClasses]='metaData.additional?.columnPartClasses?.header' >\r\n <div class=\"header-container\" cdkDragHandle>\r\n <div *ngIf=\"!metaData._internalNotUserDefined || !customCell?.columnDef?.cell ; else headerWithoutMenu\" mat-sort-header [disabled]=\"metaData.noSort\" style=\"width: 100%\">\r\n {{ metaData.displayName ? metaData.displayName : ( metaData.key | spaceCase ) }}\r\n </div>\r\n <ng-template #headerWithoutMenu >\r\n <div *ngIf=\"metaData._internalNotUserDefined;\" style=\"width: 100%\">\r\n {{ metaData.displayName ? metaData.displayName : ( metaData.key | spaceCase ) }}\r\n </div>\r\n </ng-template>\r\n <tb-header-menu\r\n *ngIf=\"(!metaData._internalNotUserDefined || !customCell?.columnDef?.cell) && (showfilters$ | async);\" #menu [metaData]='metaData' [filter]='filter' >\r\n </tb-header-menu>\r\n </div>\r\n </mat-header-cell>\r\n </ng-template>\r\n </ng-template>\r\n\r\n <!-- body -->\r\n <ng-container *matCellDef=\"let element;\">\r\n <ng-container *ngTemplateOutlet=\"outerTemplate; context: {metaData: metaData, element: element , styles: styles.body }\"/>\r\n </ng-container>\r\n <ng-template #body let-element='element' >\r\n <mat-cell [matTooltip]=\"metaData.toolTip ?? ''\" [conditionalClasses]='metaData.classes' [element]='element' [styler]='styles.body' [class.group-footer]=\"element.isGroupFooter\" (click)='cellClicked(element, metaData.key)' >\r\n <ng-container *ngTemplateOutlet=\"innerTemplate;context: {metaData: metaData, element: element, transform: transform }; Injector: injector\" />\r\n </mat-cell>\r\n </ng-template>\r\n \r\n <!-- footer -->\r\n <ng-template matFooterCellDef>\r\n <ng-container *ngIf=\"customCell?.columnDef?.footerCell;else footer\">\r\n <ng-container\r\n *ngTemplateOutlet=\"customCell.columnDef.footerCell.template;context: {metaData: metaData, data: data$, styles : styles.footer }\"/>\r\n </ng-container>\r\n\r\n <ng-template #footer>\r\n <mat-footer-cell [styler]='styles.footer' *ngrxLet=\"data$ as data\" [conditionalClasses]='metaData.additional?.columnPartClasses?.footer'>\r\n <span *ngIf=\"!!data?.length && metaData.additional?.footer\" [ngSwitch]=\"metaData.fieldType\" class=\"bold\">\r\n <span *ngSwitchCase=\"FieldType.Currency\">\r\n {{ data | columnTotal: metaData | currency }}\r\n </span>\r\n <span *ngSwitchCase=\"FieldType.Number\">\r\n {{ data | columnTotal: metaData | number }}\r\n </span>\r\n </span>\r\n </mat-footer-cell>\r\n </ng-template>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".header-container{display:flex;flex-direction:row;width:100%;align-items:center}.negative-currency{color:red}.column-head{position:relative}.bold,.group-footer{font-weight:900}.cdk-drag-preview{background:white;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:33%;border-right-width:0px}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.drag-handle{color:#add8e6;cursor:move;margin-right:9px}\n"] }]
|
|
2418
2423
|
}], ctorParameters: function () { return [{ type: TransformCreator }, { type: i4$3.MatTable }, { type: TableStore }, { type: TableTemplateService }, { type: i0.Injector }]; }, propDecorators: { metaData: [{
|
|
2419
2424
|
type: Input
|
|
2420
2425
|
}], customCell: [{
|
|
@@ -2429,6 +2434,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
2429
2434
|
args: ['body']
|
|
2430
2435
|
}] } });
|
|
2431
2436
|
|
|
2437
|
+
class MultiSortDirective extends MatSort {
|
|
2438
|
+
constructor(state) {
|
|
2439
|
+
super();
|
|
2440
|
+
this.state = state;
|
|
2441
|
+
this.rules = [];
|
|
2442
|
+
this.state.setSort(this.sortChange.pipe(map(sc => ({ key: sc.active, direction: sc.direction }))));
|
|
2443
|
+
this.state.on(this.state.sorted$, (rules) => {
|
|
2444
|
+
const oldRules = this.rules;
|
|
2445
|
+
this.rules = rules;
|
|
2446
|
+
if (this.active && rules.length === 0) {
|
|
2447
|
+
this.active = '';
|
|
2448
|
+
this.direction = '';
|
|
2449
|
+
this.sortChange.emit({ active: '', direction: '' });
|
|
2450
|
+
}
|
|
2451
|
+
else if (!!rules.length && isDifferent(oldRules, rules)) {
|
|
2452
|
+
this.active = rules[0].active;
|
|
2453
|
+
this.direction = rules[0].direction;
|
|
2454
|
+
this.sortChange.emit(rules[0]);
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MultiSortDirective, deps: [{ token: TableStore }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2459
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: MultiSortDirective, selector: "[multiSort]", inputs: { disabled: ["matSortDisabled", "disabled"] }, providers: [
|
|
2460
|
+
{ provide: MatSort, useExisting: MultiSortDirective }
|
|
2461
|
+
], exportAs: ["multiSort"], usesInheritance: true, ngImport: i0 }); }
|
|
2462
|
+
}
|
|
2463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MultiSortDirective, decorators: [{
|
|
2464
|
+
type: Directive,
|
|
2465
|
+
args: [{
|
|
2466
|
+
selector: '[multiSort]',
|
|
2467
|
+
exportAs: 'multiSort',
|
|
2468
|
+
inputs: ['disabled: matSortDisabled'],
|
|
2469
|
+
providers: [
|
|
2470
|
+
{ provide: MatSort, useExisting: MultiSortDirective }
|
|
2471
|
+
]
|
|
2472
|
+
}]
|
|
2473
|
+
}], ctorParameters: function () { return [{ type: TableStore }]; } });
|
|
2474
|
+
function isDifferent(a, b) {
|
|
2475
|
+
if (a.length !== b.length) {
|
|
2476
|
+
return true;
|
|
2477
|
+
}
|
|
2478
|
+
for (let i = 0; i < a.length; i++) {
|
|
2479
|
+
if (a[i].active !== b[i].active || a[i].direction !== b[i].direction) {
|
|
2480
|
+
return true;
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
return false;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2432
2486
|
class MatTableObservableDataSource extends MatTableDataSource {
|
|
2433
2487
|
constructor(dataSrc) {
|
|
2434
2488
|
super([]);
|
|
@@ -2453,14 +2507,11 @@ function sortData(data, sorted) {
|
|
|
2453
2507
|
return orderBy(data, sorted.map(r => r.active), sorted.map(r => r.direction));
|
|
2454
2508
|
}
|
|
2455
2509
|
|
|
2456
|
-
function isMultiSort(sort) {
|
|
2457
|
-
return Array.isArray(sort.rules);
|
|
2458
|
-
}
|
|
2459
2510
|
class GenericTableDataSource extends MatTableObservableDataSource {
|
|
2460
2511
|
constructor(dataSrc) {
|
|
2461
2512
|
super(dataSrc);
|
|
2462
2513
|
const baseSort = this.sortData;
|
|
2463
|
-
this.sortData = ((data, sort) =>
|
|
2514
|
+
this.sortData = ((data, sort) => sort instanceof MultiSortDirective ? sortData(data, sort.rules) : baseSort(data, sort));
|
|
2464
2515
|
}
|
|
2465
2516
|
}
|
|
2466
2517
|
|
|
@@ -3158,43 +3209,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
3158
3209
|
}]
|
|
3159
3210
|
}] });
|
|
3160
3211
|
|
|
3161
|
-
class MultiSortDirective extends MatSort {
|
|
3162
|
-
constructor(state) {
|
|
3163
|
-
super();
|
|
3164
|
-
this.state = state;
|
|
3165
|
-
this.rules = [];
|
|
3166
|
-
this.state.setSort(this.sortChange.pipe(map(sc => ({ key: sc.active, direction: sc.direction }))));
|
|
3167
|
-
this.state.on(this.state.sorted$, rules => {
|
|
3168
|
-
this.rules = rules;
|
|
3169
|
-
if (this.active && rules.length === 0) {
|
|
3170
|
-
this.active = '';
|
|
3171
|
-
this.direction = '';
|
|
3172
|
-
this.sortChange.emit({ active: '', direction: '' });
|
|
3173
|
-
}
|
|
3174
|
-
if (rules.length > 0 && (this.active !== rules[0].active || this.direction !== rules[0].direction)) {
|
|
3175
|
-
this.active = rules[0].active;
|
|
3176
|
-
this.direction = rules[0].direction;
|
|
3177
|
-
this.sortChange.emit(rules[0]);
|
|
3178
|
-
}
|
|
3179
|
-
});
|
|
3180
|
-
}
|
|
3181
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MultiSortDirective, deps: [{ token: TableStore }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3182
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: MultiSortDirective, selector: "[multiSort]", inputs: { disabled: ["matSortDisabled", "disabled"] }, providers: [
|
|
3183
|
-
{ provide: MatSort, useExisting: MultiSortDirective }
|
|
3184
|
-
], exportAs: ["multiSort"], usesInheritance: true, ngImport: i0 }); }
|
|
3185
|
-
}
|
|
3186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MultiSortDirective, decorators: [{
|
|
3187
|
-
type: Directive,
|
|
3188
|
-
args: [{
|
|
3189
|
-
selector: '[multiSort]',
|
|
3190
|
-
exportAs: 'multiSort',
|
|
3191
|
-
inputs: ['disabled: matSortDisabled'],
|
|
3192
|
-
providers: [
|
|
3193
|
-
{ provide: MatSort, useExisting: MultiSortDirective }
|
|
3194
|
-
]
|
|
3195
|
-
}]
|
|
3196
|
-
}], ctorParameters: function () { return [{ type: TableStore }]; } });
|
|
3197
|
-
|
|
3198
3212
|
const inputs = [
|
|
3199
3213
|
'predicate: tbCustomFilter',
|
|
3200
3214
|
'filterId: filterId',
|
|
@@ -3808,7 +3822,8 @@ class SortMenuComponentStore extends ComponentStore {
|
|
|
3808
3822
|
const sorted = this.tableState.sorted$.pipe(mergeMap(sort => this.tableState.metaData$.pipe(notNull(), map(meta => sort.map(s => {
|
|
3809
3823
|
return { ...s, displayName: meta[s.active]?.displayName };
|
|
3810
3824
|
})))));
|
|
3811
|
-
const notSorted = this.tableState.metaDataArray$.pipe(mergeMap(metas => this.tableState.sorted$.pipe(map(s => metas
|
|
3825
|
+
const notSorted = this.tableState.metaDataArray$.pipe(mergeMap(metas => this.tableState.sorted$.pipe(map(s => metas
|
|
3826
|
+
.filter(meta => !s.some(s => s.active === meta.key) && !meta.noSort)
|
|
3812
3827
|
.map(meta => ({ active: meta.key, displayName: meta.displayName }))))));
|
|
3813
3828
|
this.set(combineLatest([
|
|
3814
3829
|
sorted.pipe(distinctSortArray), notSorted.pipe(distinctSortArray)
|
|
@@ -4682,26 +4697,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImpor
|
|
|
4682
4697
|
|
|
4683
4698
|
class AppStoreCache {
|
|
4684
4699
|
constructor() {
|
|
4685
|
-
this.cache =
|
|
4700
|
+
this.cache = {};
|
|
4686
4701
|
this.isInCache = (props, actionableSelectorId) => {
|
|
4687
4702
|
if (typeof props != 'object')
|
|
4688
4703
|
props = { props };
|
|
4689
|
-
const
|
|
4690
|
-
if (
|
|
4691
|
-
return
|
|
4704
|
+
const itemInCache = this.cache[actionableSelectorId];
|
|
4705
|
+
if (!!itemInCache) {
|
|
4706
|
+
return shallowEquals(itemInCache, props);
|
|
4692
4707
|
}
|
|
4693
|
-
this.cache
|
|
4708
|
+
this.cache[actionableSelectorId] = props;
|
|
4694
4709
|
return false;
|
|
4695
4710
|
};
|
|
4696
4711
|
}
|
|
4697
4712
|
}
|
|
4698
4713
|
let _store;
|
|
4699
|
-
let _cache
|
|
4714
|
+
let _cache;
|
|
4715
|
+
const clearActionableSelectorRequestCache = () => _cache.cache = {};
|
|
4700
4716
|
const setStore = (store) => {
|
|
4701
4717
|
if (store instanceof Store)
|
|
4702
4718
|
_store = store;
|
|
4703
4719
|
};
|
|
4704
4720
|
function setUpStoreFactory(store) {
|
|
4721
|
+
_cache = new AppStoreCache();
|
|
4705
4722
|
return () => new Promise((resolve, reject) => {
|
|
4706
4723
|
setStore(store);
|
|
4707
4724
|
resolve(null);
|
|
@@ -4738,15 +4755,15 @@ const deleteProp = (t, prop) => {
|
|
|
4738
4755
|
delete copy[prop];
|
|
4739
4756
|
return copy;
|
|
4740
4757
|
};
|
|
4741
|
-
const shallowEquals = (
|
|
4742
|
-
const
|
|
4743
|
-
const secondKeys = Object.keys(
|
|
4744
|
-
if (
|
|
4758
|
+
const shallowEquals = (cachedItem, newItem) => {
|
|
4759
|
+
const cachedItemKeys = Object.keys(cachedItem);
|
|
4760
|
+
const secondKeys = Object.keys(newItem);
|
|
4761
|
+
if (cachedItemKeys.length !== secondKeys.length) {
|
|
4745
4762
|
return false;
|
|
4746
4763
|
}
|
|
4747
|
-
for (let index = 0; index <
|
|
4748
|
-
const currentKey =
|
|
4749
|
-
if (
|
|
4764
|
+
for (let index = 0; index < cachedItemKeys.length; index++) {
|
|
4765
|
+
const currentKey = cachedItemKeys[index];
|
|
4766
|
+
if (cachedItem[currentKey] !== newItem[currentKey]) {
|
|
4750
4767
|
return false;
|
|
4751
4768
|
}
|
|
4752
4769
|
}
|
|
@@ -4761,5 +4778,5 @@ const shallowEquals = (first, second) => {
|
|
|
4761
4778
|
* Generated bundle index. Do not edit.
|
|
4762
4779
|
*/
|
|
4763
4780
|
|
|
4764
|
-
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule,
|
|
4781
|
+
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, TableBuilder, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionableSelector, createFailure, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, notNull, notStarted, onWait, onceWhen, previousAndCurrent, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, spaceCase, statusAdapter, statusIsSuccessOrInProgress, switchOff, tapError, tapSuccess };
|
|
4765
4782
|
//# sourceMappingURL=one-paragon-angular-utilities.mjs.map
|