@coolon/angular-ui-powerups 13.1.7 → 13.3.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/assets/table.scss +2 -2
- package/esm2020/lib/components/commands/command/command.component.mjs +18 -5
- package/esm2020/lib/components/components.module.mjs +22 -19
- package/esm2020/lib/components/exports.mjs +28 -21
- package/esm2020/lib/components/tables/abstract-table-model.mjs +70 -29
- package/esm2020/lib/components/tables/abstract-table.component.mjs +12 -10
- package/esm2020/lib/components/tables/column/column-list-model.mjs +39 -0
- package/esm2020/lib/components/tables/column/column-model.mjs +180 -0
- package/esm2020/lib/components/tables/column/column-template/column-template.directive.mjs +35 -0
- package/esm2020/lib/components/tables/column/column-text-properties.mjs +2 -0
- package/esm2020/lib/components/tables/column/custom-template-column-model.mjs +16 -0
- package/esm2020/lib/components/tables/column/custom-value-column-model.mjs +37 -0
- package/esm2020/lib/components/tables/column/editor-controls-column-model.mjs +21 -0
- package/esm2020/lib/components/tables/column/list-propery-column-model.mjs +48 -0
- package/esm2020/lib/components/tables/column/property-column-model.mjs +92 -0
- package/esm2020/lib/components/tables/column/selection-column-model.mjs +40 -0
- package/esm2020/lib/components/tables/editor/edit-row-controls/edit-row-controls.component.mjs +55 -0
- package/esm2020/lib/components/tables/editor/edit-session.mjs +23 -0
- package/esm2020/lib/components/tables/editor/editable-cell-renderer.mjs +2 -0
- package/esm2020/lib/components/tables/{table/paginator → paginator}/paginator.component.mjs +4 -4
- package/esm2020/lib/components/tables/renderer/cell-editors.mjs +2 -0
- package/esm2020/lib/components/tables/renderer/cell-portal-ref.mjs +93 -0
- package/esm2020/lib/components/tables/renderer/cell-renderer.mjs +2 -0
- package/esm2020/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.mjs +30 -0
- package/esm2020/lib/components/tables/{table → renderer}/default-header-cell-renderer/default-header-cell-renderer.component.mjs +1 -1
- package/esm2020/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.mjs +40 -0
- package/esm2020/lib/components/tables/renderer/select-header-cell/selection-header-cell.component.mjs +31 -0
- package/esm2020/lib/components/tables/renderer/selection-cell/selection-cell.component.mjs +26 -0
- package/esm2020/lib/components/tables/renderer/table-cell/table-cell.component.mjs +93 -0
- package/esm2020/lib/components/tables/renderer/table-header-cell/table-header-cell.component.mjs +32 -0
- package/esm2020/lib/components/tables/search/column-text-search-formatter.mjs +52 -0
- package/esm2020/lib/components/tables/search/enable-cell-text-search.decorator.mjs +30 -0
- package/esm2020/lib/components/tables/table/table-model.mjs +2 -10
- package/esm2020/lib/components/tables/table/table.component.mjs +12 -12
- package/esm2020/lib/components/tables/table-row-menu/table-row-menu.component.mjs +84 -0
- package/esm2020/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.mjs +1 -1
- package/esm2020/lib/components/tables/tree-table/tree-label-column-model.mjs +3 -3
- package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +10 -10
- package/esm2020/lib/components/tables/tree-table/tree-table-model.mjs +1 -1
- package/esm2020/lib/interaction/activity-ref.mjs +2 -2
- package/esm2020/lib/interaction/activity.mjs +36 -27
- package/esm2020/lib/interaction/components/abstract-confirm-dialog.component.mjs +1 -1
- package/esm2020/lib/interaction/components/abstract-dialog.component.mjs +6 -1
- package/esm2020/lib/interaction/components/activity-actions/activity-actions.component.mjs +18 -5
- package/esm2020/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.mjs +5 -2
- package/esm2020/lib/interaction/components/input-activities/input-activity.mjs +2 -4
- package/fesm2015/coolon-angular-ui-powerups.mjs +660 -460
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +801 -602
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/commands/command/command.component.d.ts +5 -2
- package/lib/components/components.module.d.ts +55 -54
- package/lib/components/exports.d.ts +27 -20
- package/lib/components/tables/abstract-table-model.d.ts +24 -13
- package/lib/components/tables/abstract-table.component.d.ts +6 -5
- package/lib/components/tables/{column-list-model.d.ts → column/column-list-model.d.ts} +4 -4
- package/lib/components/tables/column/column-model.d.ts +77 -0
- package/lib/components/tables/column/custom-template-column-model.d.ts +8 -0
- package/lib/components/tables/column/custom-value-column-model.d.ts +10 -0
- package/lib/components/tables/column/editor-controls-column-model.d.ts +13 -0
- package/lib/components/tables/column/list-propery-column-model.d.ts +15 -0
- package/lib/components/tables/column/property-column-model.d.ts +24 -0
- package/lib/components/tables/column/selection-column-model.d.ts +12 -0
- package/lib/components/tables/{table → editor}/edit-row-controls/edit-row-controls.component.d.ts +1 -1
- package/lib/components/tables/{edit-session.d.ts → editor/edit-session.d.ts} +2 -2
- package/lib/components/tables/{table/mutable-cell-renderer.d.ts → editor/editable-cell-renderer.d.ts} +2 -2
- package/lib/components/tables/{table/paginator → paginator}/paginator.component.d.ts +1 -1
- package/lib/components/tables/{table → renderer}/cell-portal-ref.d.ts +18 -18
- package/lib/components/tables/renderer/cell-renderer.d.ts +3 -0
- package/lib/components/tables/{table → renderer}/default-cell-renderer/default-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.d.ts +12 -0
- package/lib/components/tables/{table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts → renderer/select-header-cell/selection-header-cell.component.d.ts} +3 -3
- package/lib/components/tables/{table/select-cell-renderer/select-cell-renderer.component.d.ts → renderer/selection-cell/selection-cell.component.d.ts} +3 -3
- package/lib/components/tables/{table/table-cell-renderer/table-cell-renderer.component.d.ts → renderer/table-cell/table-cell.component.d.ts} +5 -5
- package/lib/components/tables/{table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts → renderer/table-header-cell/table-header-cell.component.d.ts} +4 -4
- package/lib/components/tables/search/column-text-search-formatter.d.ts +28 -0
- package/lib/components/tables/search/enable-cell-text-search.decorator.d.ts +25 -0
- package/lib/components/tables/table/table-model.d.ts +3 -9
- package/lib/components/tables/table/table.component.d.ts +4 -4
- package/lib/components/tables/{table/table-row-menu → table-row-menu}/table-row-menu.component.d.ts +3 -3
- package/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/tree-table/tree-label-column-model.d.ts +1 -1
- package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -2
- package/lib/components/tables/tree-table/tree-table-model.d.ts +1 -1
- package/lib/interaction/activity.d.ts +15 -10
- package/lib/interaction/components/activity-actions/activity-actions.component.d.ts +6 -1
- package/lib/interaction/components/input-activities/input-activity.d.ts +0 -1
- package/package.json +2 -1
- package/esm2020/lib/components/tables/column-list-model.mjs +0 -39
- package/esm2020/lib/components/tables/edit-session.mjs +0 -23
- package/esm2020/lib/components/tables/table/cell-editors.mjs +0 -2
- package/esm2020/lib/components/tables/table/cell-portal-ref.mjs +0 -93
- package/esm2020/lib/components/tables/table/cell-renderer.mjs +0 -2
- package/esm2020/lib/components/tables/table/column-model.mjs +0 -392
- package/esm2020/lib/components/tables/table/column-template/column-template.directive.mjs +0 -35
- package/esm2020/lib/components/tables/table/column-text-properties.mjs +0 -2
- package/esm2020/lib/components/tables/table/default-cell-renderer/default-cell-renderer.component.mjs +0 -22
- package/esm2020/lib/components/tables/table/edit-row-controls/edit-row-controls.component.mjs +0 -55
- package/esm2020/lib/components/tables/table/mutable-cell-renderer.mjs +0 -2
- package/esm2020/lib/components/tables/table/select-cell-renderer/select-cell-renderer.component.mjs +0 -26
- package/esm2020/lib/components/tables/table/select-header-cell-renderer/select-header-cell-renderer.component.mjs +0 -31
- package/esm2020/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.mjs +0 -93
- package/esm2020/lib/components/tables/table/table-def.mjs +0 -2
- package/esm2020/lib/components/tables/table/table-header-cell-renderer/table-header-cell-renderer.component.mjs +0 -32
- package/esm2020/lib/components/tables/table/table-row-menu/table-row-menu.component.mjs +0 -84
- package/esm2020/lib/components/tables/table/text-search-predicate.mjs +0 -2
- package/lib/components/tables/table/cell-renderer.d.ts +0 -5
- package/lib/components/tables/table/column-model.d.ts +0 -145
- package/lib/components/tables/table/table-def.d.ts +0 -7
- package/lib/components/tables/table/text-search-predicate.d.ts +0 -1
- /package/lib/components/tables/{table → column}/column-template/column-template.directive.d.ts +0 -0
- /package/lib/components/tables/{table → column}/column-text-properties.d.ts +0 -0
- /package/lib/components/tables/{table → renderer}/cell-editors.d.ts +0 -0
- /package/lib/components/tables/{table → renderer}/default-header-cell-renderer/default-header-cell-renderer.component.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
2
|
import { TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
|
-
import { ColumnModel, RowData } from '
|
|
4
|
-
import { EditSession } from '../edit-session';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { ColumnModel, RowData } from '../column/column-model';
|
|
4
|
+
import { EditSession } from '../editor/edit-session';
|
|
5
|
+
import { TableCellComponent } from './table-cell/table-cell.component';
|
|
6
|
+
import { TableHeaderCellComponent } from './table-header-cell/table-header-cell.component';
|
|
7
7
|
export declare const HEADER_CELL_RENDERER_PORTAL: unique symbol;
|
|
8
8
|
export declare const CELL_RENDERER_PORTAL: unique symbol;
|
|
9
9
|
export declare const CELL_EDITOR_PORTAL: unique symbol;
|
|
@@ -14,30 +14,30 @@ export declare abstract class CellPortalRef<Row, Host, Portal> {
|
|
|
14
14
|
abstract initialiseHost(host: Host, columnModel: ColumnModel<Row>): any;
|
|
15
15
|
abstract onPortalAttached(host: Host, portalComponent: Portal): any;
|
|
16
16
|
}
|
|
17
|
-
export declare class CellHeaderPortalRef<Row, C> extends CellPortalRef<Row,
|
|
17
|
+
export declare class CellHeaderPortalRef<Row, C> extends CellPortalRef<Row, TableHeaderCellComponent, C> {
|
|
18
18
|
readonly componentType: ComponentType<C>;
|
|
19
19
|
readonly initialiseHeader: (component: C, columnModel: ColumnModel<Row>) => void;
|
|
20
20
|
constructor(componentType: ComponentType<C>, initialiseHeader: (component: C, columnModel: ColumnModel<Row>) => void);
|
|
21
|
-
initialiseHost(host:
|
|
22
|
-
onPortalAttached(host:
|
|
21
|
+
initialiseHost(host: TableHeaderCellComponent, columnModel: ColumnModel<Row>): void;
|
|
22
|
+
onPortalAttached(host: TableHeaderCellComponent, portalComponent: C): void;
|
|
23
23
|
}
|
|
24
|
-
export declare abstract class CellRendererPortalRef<Row, Portal> extends CellPortalRef<Row,
|
|
25
|
-
abstract pushState(host:
|
|
24
|
+
export declare abstract class CellRendererPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellComponent<Row>, Portal> {
|
|
25
|
+
abstract pushState(host: TableCellComponent<Row>): void;
|
|
26
26
|
}
|
|
27
27
|
export declare class ComponentCellRendererPortalRef<Row, Portal> extends CellRendererPortalRef<Row, Portal> {
|
|
28
28
|
readonly componentType: ComponentType<Portal>;
|
|
29
29
|
readonly updateComponent: (component: Portal, rowData: RowData<Row>, firstTime: boolean) => void;
|
|
30
30
|
constructor(componentType: ComponentType<Portal>, updateComponent: (component: Portal, rowData: RowData<Row>, firstTime: boolean) => void);
|
|
31
|
-
initialiseHost(host:
|
|
32
|
-
onPortalAttached(host:
|
|
33
|
-
pushState(host:
|
|
31
|
+
initialiseHost(host: TableCellComponent<Row>, columnModel: ColumnModel<Row>): void;
|
|
32
|
+
onPortalAttached(host: TableCellComponent<Row>, portalComponent: Portal): void;
|
|
33
|
+
pushState(host: TableCellComponent<Row>): void;
|
|
34
34
|
}
|
|
35
|
-
export declare class CellEditorPortalRef<Row, Portal> extends CellPortalRef<Row,
|
|
35
|
+
export declare class CellEditorPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellComponent<Row>, Portal> {
|
|
36
36
|
readonly componentType: ComponentType<Portal>;
|
|
37
37
|
readonly initialiseEditorSession: (component: Portal, editSession: EditSession<Row>) => void;
|
|
38
38
|
constructor(componentType: ComponentType<Portal>, initialiseEditorSession: (component: Portal, editSession: EditSession<Row>) => void);
|
|
39
|
-
initialiseHost(host:
|
|
40
|
-
onPortalAttached(host:
|
|
39
|
+
initialiseHost(host: TableCellComponent<Row>, columnModel: ColumnModel<Row>): void;
|
|
40
|
+
onPortalAttached(host: TableCellComponent<Row>, portalComponent: Portal): void;
|
|
41
41
|
}
|
|
42
42
|
export declare class TemplateCellRendererPortalRef<Row> extends CellRendererPortalRef<Row, undefined> {
|
|
43
43
|
private templateRef;
|
|
@@ -46,8 +46,8 @@ export declare class TemplateCellRendererPortalRef<Row> extends CellRendererPort
|
|
|
46
46
|
private padChild;
|
|
47
47
|
constructor();
|
|
48
48
|
registerPortal(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean): void;
|
|
49
|
-
initialiseHost(host:
|
|
50
|
-
onPortalAttached(host:
|
|
51
|
-
pushState(host:
|
|
49
|
+
initialiseHost(host: TableCellComponent<Row>, columnModel: ColumnModel<Row>): void;
|
|
50
|
+
onPortalAttached(host: TableCellComponent<Row>, portalComponent: undefined): void;
|
|
51
|
+
pushState(host: TableCellComponent<Row>): void;
|
|
52
52
|
private createPortal;
|
|
53
53
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ListModel, ValueModelChain } from "@coolon/pectin";
|
|
2
|
+
import { DisposableComponent } from "../../../disposable-component";
|
|
3
|
+
import { CellRenderer } from "../cell-renderer";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DefaultListCellRendererComponent<T> extends DisposableComponent implements CellRenderer<T[]> {
|
|
6
|
+
value$: ListModel<T>;
|
|
7
|
+
value: T[];
|
|
8
|
+
readonly text$: ValueModelChain<string>;
|
|
9
|
+
constructor();
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultListCellRendererComponent<any>, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DefaultListCellRendererComponent<any>, "aup-default-list-cell-renderer", never, { "value$": "value$"; "value": "value"; }, {}, never, never>;
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, DelegatingSelectionModel } from '@coolon/pectin';
|
|
2
2
|
import { DisposableComponent } from '../../../disposable-component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class SelectionHeaderCellComponent<Row> extends DisposableComponent {
|
|
5
5
|
readonly selectCommand: Command<void>;
|
|
6
6
|
selectionModel: DelegatingSelectionModel<Row, any>;
|
|
7
7
|
enableHeaderControls: boolean;
|
|
@@ -9,6 +9,6 @@ export declare class SelectHeaderCellRendererComponent<Row> extends DisposableCo
|
|
|
9
9
|
isSelected(): boolean;
|
|
10
10
|
isIntermediate(): any;
|
|
11
11
|
isVisible(): boolean;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionHeaderCellComponent<any>, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionHeaderCellComponent<any>, "aup-selection-header-cell", never, {}, {}, never, never>;
|
|
14
14
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command, DelegatingSelectionModel } from '@coolon/pectin';
|
|
2
2
|
import { DisposableComponent } from '../../../disposable-component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class SelectionCellComponent<Row> extends DisposableComponent {
|
|
5
5
|
readonly selectCommand: Command<void>;
|
|
6
6
|
row: Row;
|
|
7
7
|
selectionModel: DelegatingSelectionModel<Row, unknown>;
|
|
8
8
|
constructor();
|
|
9
9
|
isSelected(): boolean;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionCellComponent<any>, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionCellComponent<any>, "aup-selection-cell", never, { "row": "row"; }, {}, never, never>;
|
|
12
12
|
}
|
|
@@ -3,11 +3,11 @@ import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal/portal-directive
|
|
|
3
3
|
import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
4
4
|
import { DisposableComponent } from '../../../disposable-component';
|
|
5
5
|
import { AbstractTableModel } from '../../abstract-table-model';
|
|
6
|
-
import { ColumnModel, RowData } from '
|
|
7
|
-
import { EditSession } from '../../edit-session';
|
|
6
|
+
import { ColumnModel, RowData } from '../../column/column-model';
|
|
7
|
+
import { EditSession } from '../../editor/edit-session';
|
|
8
8
|
import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class TableCellComponent<Row> extends DisposableComponent implements OnInit, OnChanges {
|
|
11
11
|
row: Row;
|
|
12
12
|
column: ColumnModel<Row>;
|
|
13
13
|
editSession: EditSession<Row>;
|
|
@@ -29,6 +29,6 @@ export declare class TableCellRendererComponent<Row> extends DisposableComponent
|
|
|
29
29
|
getRendererPortal(): Portal<any>;
|
|
30
30
|
getEditorPortal(): Portal<any>;
|
|
31
31
|
getRowData(): RowData<Row>;
|
|
32
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
33
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableCellComponent<any>, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableCellComponent<any>, "aup-table-cell", never, { "row": "row"; "column": "column"; "editSession": "editSession"; "tableModel": "tableModel"; }, {}, never, never>;
|
|
34
34
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Portal } from '@angular/cdk/portal';
|
|
2
2
|
import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal/portal-directives";
|
|
3
3
|
import { OnInit } from '@angular/core';
|
|
4
|
-
import { ColumnModel } from '
|
|
4
|
+
import { ColumnModel } from '../../column/column-model';
|
|
5
5
|
import { HEADER_CELL_RENDERER_PORTAL } from '../cell-portal-ref';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class TableHeaderCellComponent implements OnInit {
|
|
8
8
|
column: ColumnModel<any>;
|
|
9
9
|
defaultClassNames: string;
|
|
10
10
|
[HEADER_CELL_RENDERER_PORTAL]: Portal<any>;
|
|
@@ -12,6 +12,6 @@ export declare class TableHeaderCellRendererComponent implements OnInit {
|
|
|
12
12
|
ngOnInit(): void;
|
|
13
13
|
initialiseHeader(ref: CdkPortalOutletAttachedRef): void;
|
|
14
14
|
getPortal(): Portal<any>;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableHeaderCellComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableHeaderCellComponent, "aup-table-header-cell", never, { "column": "column"; }, {}, never, never>;
|
|
17
17
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Injector } from "@angular/core";
|
|
2
|
+
import { Constructor } from "@coolon/typescript-utilities";
|
|
3
|
+
export declare abstract class ColumnTextSearchFormatter<T> {
|
|
4
|
+
abstract format(value: T): string;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace ColumnTextSearchFormatter {
|
|
7
|
+
abstract class Delegate<T> extends ColumnTextSearchFormatter<T> {
|
|
8
|
+
abstract initialise(injector: Injector): any;
|
|
9
|
+
}
|
|
10
|
+
class Delegating<Row> extends ColumnTextSearchFormatter.Delegate<Row> {
|
|
11
|
+
private readonly delegateClass;
|
|
12
|
+
private _delegate;
|
|
13
|
+
constructor(delegateClass: Constructor<ColumnTextSearchFormatter<Row>>);
|
|
14
|
+
initialise(injector: Injector): void;
|
|
15
|
+
format(row: Row): string;
|
|
16
|
+
}
|
|
17
|
+
type Format<T> = (item: T) => string;
|
|
18
|
+
function forFormatter<Row>(formatter: (item: Row) => string): ColumnTextSearchFormatter<Row>;
|
|
19
|
+
class Null extends ColumnTextSearchFormatter<any> {
|
|
20
|
+
format(value: any): string;
|
|
21
|
+
}
|
|
22
|
+
class DefaultValueFormatter extends ColumnTextSearchFormatter<any> {
|
|
23
|
+
format(value: any): string;
|
|
24
|
+
}
|
|
25
|
+
class DefaultArrayFormatter extends ColumnTextSearchFormatter<any[]> {
|
|
26
|
+
format(value: any[]): string;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentType } from "@angular/cdk/overlay";
|
|
2
|
+
import { Constructable } from "@coolon/typescript-utilities";
|
|
3
|
+
import { Enum } from "typescript-string-enums";
|
|
4
|
+
import { ColumnTextSearchFormatter } from "./column-text-search-formatter";
|
|
5
|
+
import { CellRenderer } from "../renderer/cell-renderer";
|
|
6
|
+
export declare const Keys: {
|
|
7
|
+
useFunction: "useFunction";
|
|
8
|
+
useInstance: "useInstance";
|
|
9
|
+
useClass: "useClass";
|
|
10
|
+
};
|
|
11
|
+
export declare type Keys = Enum<typeof Keys>;
|
|
12
|
+
interface UseFunction<Row> {
|
|
13
|
+
[Keys.useFunction]: (row: Row) => string;
|
|
14
|
+
}
|
|
15
|
+
interface UseInstance<Row> {
|
|
16
|
+
[Keys.useInstance]: ColumnTextSearchFormatter<Row>;
|
|
17
|
+
}
|
|
18
|
+
interface UseClass<Row> {
|
|
19
|
+
[Keys.useClass]: Constructable<ColumnTextSearchFormatter<Row>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function EnableCellTextSearch<Row>(options: UseFunction<Row> | UseInstance<Row> | UseClass<Row>): ClassDecorator;
|
|
22
|
+
export declare namespace EnableCellTextSearch {
|
|
23
|
+
function getFormatter(renderer: ComponentType<CellRenderer<any>>, useDefault: () => ColumnTextSearchFormatter<any>): ColumnTextSearchFormatter<any>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ListModel, SelectionModel, ValueModel } from
|
|
2
|
-
import { AbstractTableModel } from
|
|
3
|
-
import { SelectionColumnModel } from
|
|
1
|
+
import { ListModel, SelectionModel, ValueModel } from "@coolon/pectin";
|
|
2
|
+
import { AbstractTableModel } from "../abstract-table-model";
|
|
3
|
+
import { SelectionColumnModel } from "../column/selection-column-model";
|
|
4
4
|
/**
|
|
5
5
|
* Example:
|
|
6
6
|
* @example
|
|
@@ -82,11 +82,5 @@ import { SelectionColumnModel } from './column-model';
|
|
|
82
82
|
*/
|
|
83
83
|
export declare class TableModel<Row> extends AbstractTableModel<Row> {
|
|
84
84
|
constructor(sourceOfTruth: ListModel<Row>, builder?: (table: TableModel<Row>) => void);
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated use new TableModel(sourceOfTruth, table => {...}); instead.
|
|
87
|
-
* @param sourceOfTruth
|
|
88
|
-
* @param builder
|
|
89
|
-
*/
|
|
90
|
-
static fromList<Row>(sourceOfTruth: ListModel<Row>, builder?: (tableModel: TableModel<Row>) => void): TableModel<Row>;
|
|
91
85
|
addSelectionColumn(selectionModel?: SelectionModel<Row>, showSelectionColumn?: ValueModel<boolean> | boolean): SelectionColumnModel<Row>;
|
|
92
86
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ElementRef, NgZone } from
|
|
1
|
+
import { ElementRef, Injector, NgZone } from "@angular/core";
|
|
2
2
|
import { AbstractTableModel } from '../abstract-table-model';
|
|
3
3
|
import { AbstractTableComponent } from '../abstract-table.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* Create your model:
|
|
7
7
|
* @example
|
|
8
|
-
* this.heroTableModel = TableModel
|
|
8
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
9
9
|
* table.pluck("firstName");
|
|
10
10
|
* table.pluck("lastName");
|
|
11
11
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
@@ -17,7 +17,7 @@ import * as i0 from "@angular/core";
|
|
|
17
17
|
*
|
|
18
18
|
* Column templates
|
|
19
19
|
* @example
|
|
20
|
-
* this.heroTableModel = TableModel
|
|
20
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
21
21
|
* table.pluck("firstName");
|
|
22
22
|
* table.pluck("lastName");
|
|
23
23
|
* table.addTemplateColumn("specialColumn");
|
|
@@ -64,7 +64,7 @@ import * as i0 from "@angular/core";
|
|
|
64
64
|
*/
|
|
65
65
|
export declare class TableComponent<Row> extends AbstractTableComponent<Row> {
|
|
66
66
|
tableModel: AbstractTableModel<Row>;
|
|
67
|
-
constructor(elementRef: ElementRef, ngZone: NgZone);
|
|
67
|
+
constructor(elementRef: ElementRef, ngZone: NgZone, injector: Injector);
|
|
68
68
|
getModel(): AbstractTableModel<Row>;
|
|
69
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
70
70
|
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "aup-table", never, { "tableModel": "tableModel"; }, {}, never, never>;
|
package/lib/components/tables/{table/table-row-menu → table-row-menu}/table-row-menu.component.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MatMenuTrigger } from '@angular/material/menu';
|
|
2
2
|
import { Command } from '@coolon/pectin';
|
|
3
|
-
import { CommandFace } from '
|
|
4
|
-
import { DisposableComponent } from '
|
|
5
|
-
import { CellRenderer } from '../cell-renderer';
|
|
3
|
+
import { CommandFace } from '../../commands/command-face';
|
|
4
|
+
import { DisposableComponent } from '../../disposable-component';
|
|
5
|
+
import { CellRenderer } from '../renderer/cell-renderer';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
declare class MenuItemData<T> {
|
|
8
8
|
readonly factory: Command.Factory<T, void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ListModelChain, ValueModelChain } from '@coolon/pectin';
|
|
3
3
|
import { DisposableComponent } from '../../../disposable-component';
|
|
4
|
-
import { CellRenderer } from '../../
|
|
4
|
+
import { CellRenderer } from '../../renderer/cell-renderer';
|
|
5
5
|
import { TreeInheritanceIconComponent } from '../tree-inheritance-icon/tree-inheritance-icon.component';
|
|
6
6
|
import { TreeTableModel } from '../tree-table-model';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
2
|
import { Types } from '@coolon/pectin';
|
|
3
|
-
import { ColumnModel } from '../
|
|
3
|
+
import { ColumnModel } from '../column/column-model';
|
|
4
4
|
import { TreeLabelCellRendererComponent } from './tree-label-cell-renderer/tree-label-cell-renderer.component';
|
|
5
5
|
import { TreeTableModel } from './tree-table-model';
|
|
6
6
|
export declare class TreeLabelColumnModel<Row> extends ColumnModel<Row> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRef, NgZone } from
|
|
1
|
+
import { ElementRef, Injector, NgZone } from "@angular/core";
|
|
2
2
|
import { TreeNode } from '@coolon/typescript-utilities';
|
|
3
3
|
import { AbstractTableModel } from '../abstract-table-model';
|
|
4
4
|
import { AbstractTableComponent } from '../abstract-table.component';
|
|
@@ -66,7 +66,7 @@ import * as i0 from "@angular/core";
|
|
|
66
66
|
*/
|
|
67
67
|
export declare class TreeTableComponent<T extends TreeNode<T>> extends AbstractTableComponent<T> {
|
|
68
68
|
treeTableModel: TreeTableModel<T>;
|
|
69
|
-
constructor(elementRef: ElementRef, ngZone: NgZone);
|
|
69
|
+
constructor(elementRef: ElementRef, ngZone: NgZone, injector: Injector);
|
|
70
70
|
getModel(): AbstractTableModel<T>;
|
|
71
71
|
static ɵfac: i0.ɵɵFactoryDeclaration<TreeTableComponent<any>, never>;
|
|
72
72
|
static ɵcmp: i0.ɵɵComponentDeclaration<TreeTableComponent<any>, "aup-tree-table", never, { "treeTableModel": "treeTableModel"; }, {}, never, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ListModel, MutableValueModel, SelectionModel, ValueModel } from '@coolon/pectin';
|
|
2
2
|
import { AbstractTableModel } from '../abstract-table-model';
|
|
3
|
-
import { SelectionColumnModel } from
|
|
3
|
+
import { SelectionColumnModel } from "../column/selection-column-model";
|
|
4
4
|
import { TreeExpansionModel } from './tree-expansion-model';
|
|
5
5
|
import { TreeLabelColumnModel } from './tree-label-column-model';
|
|
6
6
|
export declare type ChildArrayPropertiesOf<T> = {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { AfterViewInit, InjectionToken } from
|
|
2
|
-
import { Command, ValueModel } from
|
|
3
|
-
import { DisposableComponent } from
|
|
4
|
-
import { ActivityActionsComponent } from
|
|
5
|
-
import { InteractionContext } from
|
|
1
|
+
import { AfterViewInit, InjectionToken } from "@angular/core";
|
|
2
|
+
import { Command, Disposable, ValueModel } from "@coolon/pectin";
|
|
3
|
+
import { DisposableComponent } from "../components/disposable-component";
|
|
4
|
+
import { ActivityActionsComponent } from "./components/activity-actions/activity-actions.component";
|
|
5
|
+
import { InteractionContext } from "./interaction-context";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const ACTIVITY_DATA: InjectionToken<any>;
|
|
8
|
+
declare type OnActivityReadyParams<D, R, E = any> = (activity: Activity<D, R, E>) => void;
|
|
8
9
|
export declare class Activity<D, R, E = any> extends DisposableComponent implements AfterViewInit {
|
|
9
|
-
private readonly
|
|
10
|
-
private
|
|
10
|
+
private readonly activityReadyListeners;
|
|
11
|
+
private readonly _busy$;
|
|
12
|
+
private _focused$;
|
|
11
13
|
private _activityContext;
|
|
12
14
|
protected activityActions: ActivityActionsComponent;
|
|
13
15
|
confirmCommand: Command<unknown>;
|
|
@@ -18,12 +20,14 @@ export declare class Activity<D, R, E = any> extends DisposableComponent impleme
|
|
|
18
20
|
constructor();
|
|
19
21
|
initialise(nestedInteractionContext: InteractionContext, activityContext: Activity.Context<R, E>): void;
|
|
20
22
|
ngAfterViewInit(): void;
|
|
23
|
+
protected initialiseActivityAction(activityActions: ActivityActionsComponent): void;
|
|
21
24
|
get interactionContext(): InteractionContext;
|
|
22
25
|
done(result?: R): void;
|
|
23
26
|
cancel(error?: E): void;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
get
|
|
27
|
+
notifyActivityReady(): void;
|
|
28
|
+
onActivityReady(callback: OnActivityReadyParams<D, R, E>): Disposable;
|
|
29
|
+
get busy$(): ValueModel<boolean>;
|
|
30
|
+
get focused$(): ValueModel<boolean>;
|
|
27
31
|
busyWhile(busyModel: ValueModel<boolean>): void;
|
|
28
32
|
isBusy(): boolean;
|
|
29
33
|
isInitialised(): boolean;
|
|
@@ -37,3 +41,4 @@ export declare namespace Activity {
|
|
|
37
41
|
focused: ValueModel<boolean>;
|
|
38
42
|
}
|
|
39
43
|
}
|
|
44
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ChangeDetectorRef, OnInit } from
|
|
1
|
+
import { ChangeDetectorRef, OnInit } from "@angular/core";
|
|
2
2
|
import { Command } from '@coolon/pectin';
|
|
3
3
|
import { Enum } from 'typescript-string-enums';
|
|
4
4
|
import { CommandFace } from '../../../components/commands/command-face';
|
|
5
|
+
import { CommandComponent } from "../../../components/commands/command/command.component";
|
|
5
6
|
import { DisposableComponent } from '../../../components/disposable-component';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
@@ -27,6 +28,8 @@ import * as i0 from "@angular/core";
|
|
|
27
28
|
*/
|
|
28
29
|
export declare class ActivityActionsComponent extends DisposableComponent implements OnInit {
|
|
29
30
|
private readonly cdr;
|
|
31
|
+
protected confirmCommandComponent: CommandComponent;
|
|
32
|
+
protected cancelCommandComponent: CommandComponent;
|
|
30
33
|
/**
|
|
31
34
|
* @deprecated activity actions now use the confirm command of the activity automatically
|
|
32
35
|
*/
|
|
@@ -52,6 +55,8 @@ export declare class ActivityActionsComponent extends DisposableComponent implem
|
|
|
52
55
|
confirmCommand: Command<unknown>;
|
|
53
56
|
cancelCommand: Command<unknown>;
|
|
54
57
|
}): void;
|
|
58
|
+
focusConfirm(): void;
|
|
59
|
+
focusCancel(): void;
|
|
55
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActivityActionsComponent, never>;
|
|
56
61
|
static ɵcmp: i0.ɵɵComponentDeclaration<ActivityActionsComponent, "aup-activity-actions", never, { "confirmCommand": "confirmCommand"; "cancelCommand": "cancelCommand"; "faces": "faces"; "confirmFace": "confirmFace"; "cancelFace": "cancelFace"; "style": "style"; "layout": "layout"; "align": "align"; }, {}, never, ["*"]>;
|
|
57
62
|
}
|
|
@@ -13,7 +13,6 @@ export declare class InputActivity<T, D extends InputActivity.Data<T> = InputAct
|
|
|
13
13
|
readonly cancelFace: CommandFace;
|
|
14
14
|
get layout(): InputActivity.Layout;
|
|
15
15
|
constructor(data: D);
|
|
16
|
-
onActivityReady(): void;
|
|
17
16
|
get additionalCssClassName(): string;
|
|
18
17
|
onEscape(): void;
|
|
19
18
|
shouldCancelOnEscape(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolon/angular-ui-powerups",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"schematics": "./schematics/collection.json",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^13.2.3",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"typescript-string-enums": "^1.0.0",
|
|
24
24
|
"json5": "^2.1.0",
|
|
25
25
|
"immer": ">=7.0.15",
|
|
26
|
+
"escape-string-regexp": "^5.0.0",
|
|
26
27
|
"rxjs": "~6.6.0",
|
|
27
28
|
"@types/circular-json": "^0.4.0",
|
|
28
29
|
"circular-json": "^0.5.9",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { AbstractComputedListModel, Dsl, lang, MutableListModel } from '@coolon/pectin';
|
|
2
|
-
import { isNil } from 'lodash';
|
|
3
|
-
export class ColumnListModel extends AbstractComputedListModel {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this._allColumns = new MutableListModel();
|
|
7
|
-
const { chain } = Dsl.disposeWith(this);
|
|
8
|
-
this.columnsById = chain(this._allColumns).indexBy('columnId');
|
|
9
|
-
}
|
|
10
|
-
get allColumns() {
|
|
11
|
-
return this._allColumns.readonly;
|
|
12
|
-
}
|
|
13
|
-
getColumn(id) {
|
|
14
|
-
return this.columnsById.get(id);
|
|
15
|
-
}
|
|
16
|
-
hasColumn(id) {
|
|
17
|
-
return !!this.columnsById.get(id);
|
|
18
|
-
}
|
|
19
|
-
addColumn(column, index) {
|
|
20
|
-
if (this.hasColumn(column.columnId)) {
|
|
21
|
-
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
22
|
-
}
|
|
23
|
-
this.registerDisposable(column);
|
|
24
|
-
this.runInTransaction(() => {
|
|
25
|
-
if (!isNil(index)) {
|
|
26
|
-
this._allColumns.insert(index, column);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this._allColumns.push(column);
|
|
30
|
-
}
|
|
31
|
-
this.registerDisposable(this.trackSource(column.visible));
|
|
32
|
-
});
|
|
33
|
-
return column;
|
|
34
|
-
}
|
|
35
|
-
doComputeValue() {
|
|
36
|
-
return this._allColumns.value.filter(c => c.visible.value);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1uLWxpc3QtbW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItd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FzQ29sdW1uKGNvbHVtbi5jb2x1bW5JZCkpIHtcbiAgICAgIGxhbmcuaWxsZWdhbFN0YXRlKGBDb2x1bW4gd2l0aCBpZD0ke2NvbHVtbi5jb2x1bW5JZH0gYWxyZWFkeSBleGlzdHNgKTtcbiAgICB9XG4gICAgdGhpcy5yZWdpc3RlckRpc3Bvc2FibGUoY29sdW1uKTtcbiAgICB0aGlzLnJ1bkluVHJhbnNhY3Rpb24oKCkgPT4ge1xuICAgICAgaWYgKCFpc05pbChpbmRleCkpIHtcbiAgICAgICAgdGhpcy5fYWxsQ29sdW1ucy5pbnNlcnQoaW5kZXgsIGNvbHVtbik7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLl9hbGxDb2x1bW5zLnB1c2goY29sdW1uKTtcbiAgICAgIH1cbiAgICAgIHRoaXMucmVnaXN0ZXJEaXNwb3NhYmxlKHRoaXMudHJhY2tTb3VyY2UoY29sdW1uLnZpc2libGUpKTtcbiAgICB9KTtcbiAgICByZXR1cm4gY29sdW1uO1xuICB9XG5cbiAgZG9Db21wdXRlVmFsdWUoKTogQ29sdW1uTW9kZWw8Um93PltdIHtcbiAgICByZXR1cm4gdGhpcy5fYWxsQ29sdW1ucy52YWx1ZS5maWx0ZXIoYyA9PiBjLnZpc2libGUudmFsdWUpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GarbageCollector, MutableValueModel } from '@coolon/pectin';
|
|
2
|
-
import produce from 'immer';
|
|
3
|
-
export class EditSession extends GarbageCollector {
|
|
4
|
-
constructor(rowId, row, form, saveCommand) {
|
|
5
|
-
super();
|
|
6
|
-
this.rowId = rowId;
|
|
7
|
-
this.form = form;
|
|
8
|
-
this.saveCommand = saveCommand;
|
|
9
|
-
this._liveRowValue = new MutableValueModel();
|
|
10
|
-
this.liveRowValue = this._liveRowValue.readonly;
|
|
11
|
-
this.form.load(row);
|
|
12
|
-
this._liveRowValue.value = row;
|
|
13
|
-
this.form.onEdit(() => {
|
|
14
|
-
// if (!this._liveRowValue.value[immerable]) {
|
|
15
|
-
// console.warn()
|
|
16
|
-
// }
|
|
17
|
-
this._liveRowValue.value = produce(this._liveRowValue.value, draft => {
|
|
18
|
-
this.form.writeDirtyStateTo(draft);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdC1zZXNzaW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLXVpLXBvd2VydXBzL3NyYy9saWIvY29tcG9uZW50cy90YWJsZXMvZWRpdC1zZXNzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBOEIsZ0JBQWdCLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUVqRyxPQUFPLE9BQU8sTUFBTSxPQUFPLENBQUM7QUFFNUIsTUFBTSxPQUFPLFdBQWlCLFNBQVEsZ0JBQWdCO0lBSXBELFlBQXFCLEtBQVUsRUFBRSxHQUFRLEVBQVcsSUFBNEIsRUFBVyxXQUFnRDtRQUN6SSxLQUFLLEVBQUUsQ0FBQztRQURXLFVBQUssR0FBTCxLQUFLLENBQUs7UUFBcUIsU0FBSSxHQUFKLElBQUksQ0FBd0I7UUFBVyxnQkFBVyxHQUFYLFdBQVcsQ0FBcUM7UUFIbkksa0JBQWEsR0FBRyxJQUFJLGlCQUFpQixFQUFPLENBQUM7UUFDNUMsaUJBQVksR0FBRyxJQUFJLENBQUMsYUFBYSxDQUFDLFFBQVEsQ0FBQztRQUlsRCxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNwQixJQUFJLENBQUMsYUFBYSxDQUFDLEtBQUssR0FB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