@talxis/base-controls 1.2410.3 → 1.2410.5
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/README.md +20 -11
- package/dist/components/DatasetControl/DatasetControl.d.ts +3 -0
- package/dist/components/DatasetControl/DatasetControl.js +58 -0
- package/dist/components/DatasetControl/DatasetControl.js.map +1 -0
- package/dist/components/DatasetControl/hooks/useRerender.d.ts +1 -0
- package/dist/components/DatasetControl/hooks/useRerender.js +9 -0
- package/dist/components/DatasetControl/hooks/useRerender.js.map +1 -0
- package/dist/components/DatasetControl/index.d.ts +2 -0
- package/dist/components/DatasetControl/index.js +2 -0
- package/dist/components/DatasetControl/index.js.map +1 -0
- package/dist/components/DatasetControl/interfaces.d.ts +10 -0
- package/dist/components/DatasetControl/styles.d.ts +8 -0
- package/dist/components/DatasetControl/styles.js +17 -0
- package/dist/components/DatasetControl/styles.js.map +1 -0
- package/dist/components/DatasetControl/translations.d.ts +10 -0
- package/dist/components/DatasetControl/translations.js +7 -0
- package/dist/components/DatasetControl/translations.js.map +1 -0
- package/dist/components/Decimal/Decimal.js +1 -1
- package/dist/components/Decimal/Decimal.js.map +1 -1
- package/dist/components/Duration/Duration.js +1 -1
- package/dist/components/Duration/Duration.js.map +1 -1
- package/dist/components/Grid/Grid.js +9 -2
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/constants.d.ts +1 -2
- package/dist/components/Grid/constants.js +2 -2
- package/dist/components/Grid/constants.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js +21 -47
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/controllers/useAgGridController.d.ts +2 -3
- package/dist/components/Grid/core/components/AgGrid/controllers/useAgGridController.js +12 -8
- package/dist/components/Grid/core/components/AgGrid/controllers/useAgGridController.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +1 -2
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +20 -16
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/styles.d.ts +1 -4
- package/dist/components/Grid/core/components/AgGrid/styles.js +6 -9
- package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Commands/Commands.d.ts +2 -2
- package/dist/components/Grid/core/components/Cell/Commands/Commands.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Commands/Icon.d.ts +2 -2
- package/dist/components/Grid/core/components/Cell/Commands/Icon.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Commands/useCommands.d.ts +2 -2
- package/dist/components/Grid/core/components/Cell/Commands/useCommands.js +2 -0
- package/dist/components/Grid/core/components/Cell/Commands/useCommands.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +4 -6
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +11 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +93 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +36 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +42 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +2 -2
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +106 -29
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +2 -2
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +3 -3
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +49 -2
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +51 -4
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
- package/dist/components/Grid/core/components/Component/model/Component.js +18 -11
- package/dist/components/Grid/core/components/Component/model/Component.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/RecordGrids.js +8 -0
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/RecordGrids/RecordGrids.js.map +1 -1
- package/dist/components/Grid/core/constants.d.ts +1 -0
- package/dist/components/Grid/core/constants.js +4 -0
- package/dist/components/Grid/core/constants.js.map +1 -0
- package/dist/components/Grid/core/controllers/useGridController.d.ts +0 -2
- package/dist/components/Grid/core/controllers/useGridController.js +1 -17
- package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
- package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +9 -18
- package/dist/components/Grid/core/model/Grid.d.ts +17 -10
- package/dist/components/Grid/core/model/Grid.js +93 -74
- package/dist/components/Grid/core/model/Grid.js.map +1 -1
- package/dist/components/Grid/core/model/GridDependency.d.ts +1 -1
- package/dist/components/Grid/core/model/Metadata.d.ts +2 -3
- package/dist/components/Grid/core/model/Metadata.js +13 -9
- package/dist/components/Grid/core/model/Metadata.js.map +1 -1
- package/dist/components/Grid/core/services/KeyListener.d.ts +8 -0
- package/dist/components/Grid/core/services/KeyListener.js +22 -0
- package/dist/components/Grid/core/services/KeyListener.js.map +1 -0
- package/dist/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.d.ts +8 -8
- package/dist/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.js +22 -26
- package/dist/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +16 -16
- package/dist/components/Grid/filtering/controller/useColumnFilterConditionController.js.map +1 -1
- package/dist/components/Grid/filtering/model/Condition.js +7 -3
- package/dist/components/Grid/filtering/model/Condition.js.map +1 -1
- package/dist/components/Grid/filtering/model/Filtering.js +4 -4
- package/dist/components/Grid/filtering/model/Filtering.js.map +1 -1
- package/dist/components/Grid/interfaces.d.ts +5 -14
- package/dist/components/Grid/paging/components/Paging/Paging.js +7 -1
- package/dist/components/Grid/paging/components/Paging/Paging.js.map +1 -1
- package/dist/components/Grid/paging/controllers/usePagingController.d.ts +2 -1
- package/dist/components/Grid/paging/controllers/usePagingController.js +1 -0
- package/dist/components/Grid/paging/controllers/usePagingController.js.map +1 -1
- package/dist/components/Grid/paging/model/Paging.d.ts +2 -1
- package/dist/components/Grid/paging/model/Paging.js +22 -4
- package/dist/components/Grid/paging/model/Paging.js.map +1 -1
- package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +2 -2
- package/dist/components/Grid/selection/controllers/useSelectionController.js +7 -3
- package/dist/components/Grid/selection/controllers/useSelectionController.js.map +1 -1
- package/dist/components/Grid/selection/model/Selection.d.ts +3 -3
- package/dist/components/Grid/selection/model/Selection.js +7 -4
- package/dist/components/Grid/selection/model/Selection.js.map +1 -1
- package/dist/components/Grid/sorting/Sorting.js +5 -6
- package/dist/components/Grid/sorting/Sorting.js.map +1 -1
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +3 -3
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
- package/dist/components/Grid/translations.d.ts +8 -0
- package/dist/components/Grid/translations.js +3 -1
- package/dist/components/Grid/translations.js.map +1 -1
- package/dist/components/Grid/validation/controllers/useRecordValidationController.d.ts +2 -2
- package/dist/components/Grid/validation/controllers/useRecordValidationController.js +2 -2
- package/dist/components/Grid/validation/controllers/useRecordValidationController.js.map +1 -1
- package/dist/hooks/useControl.js +1 -1
- package/dist/hooks/useControl.js.map +1 -1
- package/dist/hooks/useThemeOverride.d.ts +1 -0
- package/dist/hooks/useThemeOverride.js +23 -0
- package/dist/hooks/useThemeOverride.js.map +1 -0
- package/dist/index.d.ts +351 -367
- package/dist/index.js +1 -1
- package/dist/interfaces/property.d.ts +0 -29
- package/dist/utils/Theme.js +26 -0
- package/dist/utils/Theme.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +4 -3
- package/dist/components/Grid/core/hooks/useRerender.js +0 -13
- package/dist/components/Grid/core/hooks/useRerender.js.map +0 -1
- package/dist/utils/Numeral.d.ts +0 -6
- package/dist/utils/Numeral.js +0 -64
- package/dist/utils/Numeral.js.map +0 -1
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IGridColumn {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
isSortable?: boolean;
|
|
11
|
-
isSorted?: boolean;
|
|
12
|
-
isFiltered?: boolean;
|
|
13
|
-
isSortedDescending?: boolean;
|
|
14
|
-
isEditable?: boolean;
|
|
15
|
-
isResizable?: boolean;
|
|
16
|
-
isRequired?: boolean;
|
|
17
|
-
isHidden?: boolean;
|
|
18
|
-
width?: number;
|
|
1
|
+
import { IColumn } from "@talxis/client-libraries";
|
|
2
|
+
export interface IGridColumn extends IColumn {
|
|
3
|
+
isRequired: boolean;
|
|
4
|
+
isEditable: boolean;
|
|
5
|
+
isFilterable: boolean;
|
|
6
|
+
isSorted: boolean;
|
|
7
|
+
isFiltered: boolean;
|
|
8
|
+
isSortedDescending: boolean;
|
|
9
|
+
isResizable: boolean;
|
|
19
10
|
}
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
/// <reference types="powerapps-component-framework" />
|
|
2
|
-
import {
|
|
2
|
+
import { IDataset, IRecord } from "@talxis/client-libraries";
|
|
3
3
|
import { Filtering } from "../../filtering/model/Filtering";
|
|
4
|
-
import {
|
|
4
|
+
import { IGrid } from "../../interfaces";
|
|
5
5
|
import { Paging } from "../../paging/model/Paging";
|
|
6
6
|
import { Selection } from "../../selection/model/Selection";
|
|
7
7
|
import { Sorting } from "../../sorting/Sorting";
|
|
8
|
-
import {
|
|
8
|
+
import { KeyHoldListener } from "../services/KeyListener";
|
|
9
9
|
import { RecordUpdateService } from "../services/RecordUpdateService/model/RecordUpdateService";
|
|
10
10
|
import { Metadata } from "./Metadata";
|
|
11
|
+
import { IGridColumn } from "../interfaces/IGridColumn";
|
|
11
12
|
export declare class Grid {
|
|
12
13
|
private _props;
|
|
13
14
|
private _dataset;
|
|
14
15
|
private _pcfContext;
|
|
15
16
|
private _columns;
|
|
16
|
-
private
|
|
17
|
+
private _previousRecordsReference;
|
|
17
18
|
private _labels;
|
|
18
19
|
private _shouldRerender;
|
|
20
|
+
private _records;
|
|
19
21
|
private _dependencies;
|
|
20
|
-
|
|
22
|
+
private _maxHeight;
|
|
23
|
+
private _minHeight;
|
|
24
|
+
private _initialPageSize;
|
|
25
|
+
readonly keyHoldListener: KeyHoldListener;
|
|
26
|
+
constructor(props: IGrid, labels: any, keyHoldListener: KeyHoldListener);
|
|
21
27
|
get isNavigationEnabled(): boolean;
|
|
22
28
|
get isEditable(): boolean;
|
|
23
29
|
get parameters(): import("../../interfaces").IGridParameters;
|
|
24
|
-
get error(): boolean
|
|
25
|
-
get errorMessage(): string
|
|
30
|
+
get error(): boolean;
|
|
31
|
+
get errorMessage(): string;
|
|
26
32
|
get labels(): any;
|
|
27
|
-
get dataset():
|
|
33
|
+
get dataset(): IDataset;
|
|
28
34
|
get pcfContext(): ComponentFramework.Context<any, ComponentFramework.IEventBag>;
|
|
29
35
|
get props(): IGrid;
|
|
30
36
|
get columns(): IGridColumn[];
|
|
31
|
-
get records():
|
|
37
|
+
get records(): IRecord[];
|
|
32
38
|
get recordUpdateService(): RecordUpdateService;
|
|
33
39
|
get sorting(): Sorting;
|
|
34
40
|
get metadata(): Metadata;
|
|
@@ -42,12 +48,13 @@ export declare class Grid {
|
|
|
42
48
|
get enableOptionSetColors(): boolean;
|
|
43
49
|
get linking(): ComponentFramework.PropertyHelper.DataSetApi.Linking;
|
|
44
50
|
get inlineRibbonButtonIds(): string[] | undefined;
|
|
51
|
+
get height(): string;
|
|
45
52
|
openDatasetItem(entityReference: ComponentFramework.EntityReference): void;
|
|
46
53
|
updateDependencies(props: IGrid): void;
|
|
47
54
|
refreshColumns(): Promise<IGridColumn[]>;
|
|
48
|
-
refreshRecords(): IEntityRecord[];
|
|
49
55
|
private _isColumnEditable;
|
|
50
56
|
private _isColumnRequired;
|
|
51
57
|
private _isColumnSortable;
|
|
52
58
|
private _isColumnFilterable;
|
|
59
|
+
private _getMaxHeight;
|
|
53
60
|
}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataTypes, Constants, Attribute } from '@talxis/client-libraries';
|
|
2
2
|
import { Filtering } from '../../filtering/model/Filtering.js';
|
|
3
3
|
import { Paging } from '../../paging/model/Paging.js';
|
|
4
4
|
import { Selection } from '../../selection/model/Selection.js';
|
|
5
5
|
import { Sorting } from '../../sorting/Sorting.js';
|
|
6
|
+
import { ROW_HEIGHT } from '../constants.js';
|
|
6
7
|
import { DataType } from '../enums/DataType.js';
|
|
7
8
|
import { RecordUpdateService } from '../services/RecordUpdateService/model/RecordUpdateService.js';
|
|
8
9
|
import { Metadata } from './Metadata.js';
|
|
10
|
+
import { CHECKBOX_COLUMN_KEY } from '../../constants.js';
|
|
9
11
|
|
|
10
12
|
class Grid {
|
|
11
|
-
constructor(props, labels) {
|
|
13
|
+
constructor(props, labels, keyHoldListener) {
|
|
12
14
|
this._columns = [];
|
|
13
|
-
|
|
15
|
+
//used for optimization
|
|
16
|
+
this._previousRecordsReference = {};
|
|
14
17
|
this._shouldRerender = false;
|
|
18
|
+
this._records = [];
|
|
19
|
+
this._minHeight = 150;
|
|
15
20
|
this._props = props;
|
|
16
21
|
this._dataset = props.parameters.Grid;
|
|
17
22
|
this._pcfContext = props.context;
|
|
18
23
|
this._labels = labels;
|
|
24
|
+
this.keyHoldListener = keyHoldListener;
|
|
19
25
|
this._dependencies = {
|
|
20
26
|
recordUpdateService: new RecordUpdateService(this),
|
|
21
27
|
filtering: new Filtering(this),
|
|
@@ -24,6 +30,8 @@ class Grid {
|
|
|
24
30
|
sorting: new Sorting(this),
|
|
25
31
|
paging: new Paging(this)
|
|
26
32
|
};
|
|
33
|
+
this._initialPageSize = this.paging.pageSize;
|
|
34
|
+
this._maxHeight = this._getMaxHeight();
|
|
27
35
|
}
|
|
28
36
|
;
|
|
29
37
|
get isNavigationEnabled() {
|
|
@@ -103,9 +111,25 @@ class Grid {
|
|
|
103
111
|
}
|
|
104
112
|
return idString.split(',');
|
|
105
113
|
}
|
|
114
|
+
get height() {
|
|
115
|
+
let height = this._maxHeight;
|
|
116
|
+
if (this.parameters.Height?.raw) {
|
|
117
|
+
return this.parameters.Height?.raw;
|
|
118
|
+
}
|
|
119
|
+
if (this._records.length === 0) {
|
|
120
|
+
height = this._minHeight;
|
|
121
|
+
}
|
|
122
|
+
else if (this._records.length <= this._initialPageSize) {
|
|
123
|
+
height = this._records.length * ROW_HEIGHT;
|
|
124
|
+
}
|
|
125
|
+
if (height > this._maxHeight) {
|
|
126
|
+
height = this._maxHeight;
|
|
127
|
+
}
|
|
128
|
+
return `${height}px`;
|
|
129
|
+
}
|
|
106
130
|
openDatasetItem(entityReference) {
|
|
107
131
|
this._dataset.openDatasetItem(entityReference);
|
|
108
|
-
const clickedRecord = this.
|
|
132
|
+
const clickedRecord = this.records.find(x => x.getRecordId() === entityReference.id.guid);
|
|
109
133
|
//we need to make sure the item we are opening gets selected in order for the
|
|
110
134
|
//OnOpenRecord ribbon scripts to work correctly
|
|
111
135
|
//if no record found we have clicked a lookup, no selection should be happening in that case
|
|
@@ -117,92 +141,62 @@ class Grid {
|
|
|
117
141
|
this._props = props;
|
|
118
142
|
this._dataset = props.parameters.Grid;
|
|
119
143
|
this._pcfContext = props.context;
|
|
120
|
-
|
|
121
|
-
|
|
144
|
+
//THIS COULD MAKE GRID STOP WORKING IN POWER APPS!
|
|
145
|
+
if (this._previousRecordsReference !== this._dataset.records) {
|
|
146
|
+
this._records = Object.values(this._dataset.records);
|
|
147
|
+
this._previousRecordsReference = this._dataset.records;
|
|
122
148
|
}
|
|
149
|
+
Object.values(this._dependencies).map(dep => {
|
|
150
|
+
dep.onDependenciesUpdated();
|
|
151
|
+
});
|
|
123
152
|
this._shouldRerender = !this.shouldRerender;
|
|
124
153
|
}
|
|
125
154
|
async refreshColumns() {
|
|
126
155
|
const gridColumns = [];
|
|
127
156
|
for (const column of this._dataset.columns) {
|
|
128
|
-
if (column.isHidden) {
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
157
|
const sorted = this._dataset.sorting?.find(sort => sort.name === column.name);
|
|
132
|
-
const entityAliasName = column.name?.includes('.') ? column.name.split('.')[0] : null;
|
|
133
|
-
const attributeName = entityAliasName ? column.name.split('.')[1] : column.name;
|
|
134
|
-
const key = entityAliasName ? `${entityAliasName}.${attributeName}` : attributeName;
|
|
135
|
-
switch (column.dataType) {
|
|
136
|
-
case DataType.FILE:
|
|
137
|
-
case DataType.IMAGE: {
|
|
138
|
-
if (entityAliasName) {
|
|
139
|
-
//we do not support file fields with linked entities
|
|
140
|
-
//the getValue API throws an error in Power Apps
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
158
|
const gridColumn = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
displayName: column.displayName,
|
|
152
|
-
isEditable: column.isEditable,
|
|
153
|
-
isFilterable: this._isColumnFilterable(column),
|
|
154
|
-
isRequired: column.isRequired,
|
|
155
|
-
isSortable: this._isColumnSortable(column),
|
|
156
|
-
isSorted: sorted ? true : false,
|
|
159
|
+
...column,
|
|
160
|
+
isEditable: await this._isColumnEditable(column),
|
|
161
|
+
isRequired: await this._isColumnRequired(column),
|
|
162
|
+
isFilterable: await this._isColumnFilterable(column),
|
|
163
|
+
disableSorting: !this._isColumnSortable(column),
|
|
157
164
|
isSortedDescending: sorted?.sortDirection === 1 ? true : false,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
isResizable: true,
|
|
166
|
+
isSorted: sorted ? true : false,
|
|
167
|
+
isFiltered: false
|
|
161
168
|
};
|
|
162
169
|
const condition = await this.filtering.condition(gridColumn);
|
|
163
170
|
gridColumn.isFiltered = condition.isAppliedToDataset;
|
|
164
|
-
gridColumn.isEditable = await this._isColumnEditable(gridColumn);
|
|
165
|
-
gridColumn.isRequired = await this._isColumnRequired(gridColumn);
|
|
166
|
-
if (gridColumn.key === RIBBON_COLUMN_KEY) {
|
|
167
|
-
gridColumn.isFilterable = false;
|
|
168
|
-
gridColumn.isSortable = false;
|
|
169
|
-
}
|
|
170
171
|
gridColumns.push(gridColumn);
|
|
171
172
|
}
|
|
172
|
-
/* gridColumns.unshift({
|
|
173
|
-
key: RIBBON_COLUMN_KEY,
|
|
174
|
-
attributeName: RIBBON_COLUMN_KEY,
|
|
175
|
-
}) */
|
|
176
173
|
if (this.selection.type !== undefined) {
|
|
177
174
|
gridColumns.unshift({
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
name: CHECKBOX_COLUMN_KEY,
|
|
176
|
+
alias: CHECKBOX_COLUMN_KEY,
|
|
177
|
+
dataType: DataTypes.SingleLineText,
|
|
178
|
+
displayName: '',
|
|
179
|
+
isEditable: true,
|
|
180
|
+
isFilterable: false,
|
|
181
|
+
isFiltered: false,
|
|
182
|
+
isRequired: false,
|
|
183
|
+
isResizable: false,
|
|
184
|
+
disableSorting: true,
|
|
185
|
+
isSorted: false,
|
|
186
|
+
isSortedDescending: false,
|
|
187
|
+
order: 0,
|
|
188
|
+
visualSizeFactor: 45,
|
|
182
189
|
});
|
|
183
190
|
}
|
|
184
191
|
this._columns = gridColumns;
|
|
185
192
|
return gridColumns;
|
|
186
193
|
}
|
|
187
|
-
refreshRecords() {
|
|
188
|
-
const records = [];
|
|
189
|
-
for (const [_, record] of Object.entries(this._dataset.records)) {
|
|
190
|
-
records.push(record);
|
|
191
|
-
}
|
|
192
|
-
this._records = records;
|
|
193
|
-
return records;
|
|
194
|
-
}
|
|
195
194
|
async _isColumnEditable(column) {
|
|
196
|
-
//top priority, overriden through props
|
|
197
|
-
if (typeof column.isEditable === 'boolean') {
|
|
198
|
-
return column.isEditable;
|
|
199
|
-
}
|
|
200
195
|
//only allow editing if specifically allowed
|
|
201
196
|
if (!this._props.parameters.EnableEditing?.raw) {
|
|
202
197
|
return false;
|
|
203
198
|
}
|
|
204
|
-
|
|
205
|
-
if (column.entityAliasName) {
|
|
199
|
+
if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {
|
|
206
200
|
return false;
|
|
207
201
|
}
|
|
208
202
|
//these field types do not support editing
|
|
@@ -212,40 +206,65 @@ class Grid {
|
|
|
212
206
|
return false;
|
|
213
207
|
}
|
|
214
208
|
}
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
return metadata.Attributes.get(
|
|
209
|
+
const attributeName = Attribute.GetNameFromAlias(column.name);
|
|
210
|
+
const metadata = await this.metadata.get(column.name);
|
|
211
|
+
return metadata.Attributes.get(attributeName)?.attributeDescriptor?.IsValidForUpdate ?? false;
|
|
218
212
|
}
|
|
219
213
|
async _isColumnRequired(column) {
|
|
220
|
-
if (typeof column.isRequired === 'boolean') {
|
|
221
|
-
return column.isRequired;
|
|
222
|
-
}
|
|
223
214
|
if (!this.parameters.EnableEditing?.raw) {
|
|
224
215
|
return false;
|
|
225
216
|
}
|
|
226
|
-
|
|
227
|
-
|
|
217
|
+
if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
const metadata = await this.metadata.get(column.name);
|
|
221
|
+
const attributeName = Attribute.GetNameFromAlias(column.name);
|
|
222
|
+
const requiredLevel = metadata.Attributes.get(attributeName)?.attributeDescriptor?.RequiredLevel;
|
|
228
223
|
if (requiredLevel === 1 || requiredLevel === 2) {
|
|
229
224
|
return true;
|
|
230
225
|
}
|
|
231
226
|
return false;
|
|
232
227
|
}
|
|
233
228
|
_isColumnSortable(column) {
|
|
229
|
+
if (column.name.endsWith('__virtual')) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
234
232
|
if (this._props.parameters.EnableSorting?.raw === false) {
|
|
235
233
|
return false;
|
|
236
234
|
}
|
|
235
|
+
if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
237
238
|
switch (column.dataType) {
|
|
238
239
|
case DataType.IMAGE: {
|
|
239
240
|
return false;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
243
|
+
if (column.disableSorting === undefined) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
242
246
|
return !column.disableSorting;
|
|
243
247
|
}
|
|
244
|
-
_isColumnFilterable(column) {
|
|
248
|
+
async _isColumnFilterable(column) {
|
|
249
|
+
if (column.name.endsWith('__virtual')) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
245
252
|
if (this.props.parameters.EnableFiltering?.raw === false) {
|
|
246
253
|
return false;
|
|
247
254
|
}
|
|
248
|
-
|
|
255
|
+
if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
const metadata = await this.metadata.get(column.name);
|
|
259
|
+
const attributeName = Attribute.GetNameFromAlias(column.name);
|
|
260
|
+
return metadata.Attributes.get(attributeName)?.attributeDescriptor?.isFilterable ?? true;
|
|
261
|
+
}
|
|
262
|
+
_getMaxHeight() {
|
|
263
|
+
let maxHeight = this._initialPageSize * ROW_HEIGHT;
|
|
264
|
+
if (maxHeight > 600) {
|
|
265
|
+
maxHeight = 600;
|
|
266
|
+
}
|
|
267
|
+
return maxHeight;
|
|
249
268
|
}
|
|
250
269
|
}
|
|
251
270
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","sources":["../../../../../src/components/Grid/core/model/Grid.ts"],"sourcesContent":["import { IDatasetProperty } from \"../../../../interfaces\";\nimport { RIBBON_COLUMN_KEY } from \"../../constants\";\nimport { Filtering } from \"../../filtering/model/Filtering\";\nimport { IEntityColumn, IEntityRecord, IGrid } from \"../../interfaces\";\nimport { Paging } from \"../../paging/model/Paging\";\nimport { Selection } from \"../../selection/model/Selection\";\nimport { Sorting } from \"../../sorting/Sorting\";\nimport { DataType } from \"../enums/DataType\";\nimport { IGridColumn } from \"../interfaces/IGridColumn\";\nimport { RecordUpdateService } from \"../services/RecordUpdateService/model/RecordUpdateService\";\nimport { Metadata } from \"./Metadata\";\n\nexport class Grid {\n private _props: IGrid;\n private _dataset: IDatasetProperty\n private _pcfContext: ComponentFramework.Context<any>;\n private _columns: IGridColumn[] = [];\n private _records: IEntityRecord[] = [];\n //TODO: fix\n private _labels: any;\n private _shouldRerender: boolean = false;\n //TODO: the dependencies might not have fully loaded grid\n //need to make sure that the grid is initialized before creating them\n private _dependencies: {\n recordUpdateService: RecordUpdateService,\n filtering: Filtering,\n sorting: Sorting,\n metadata: Metadata,\n selection: Selection,\n paging: Paging\n };\n constructor(props: IGrid, labels: any) {\n this._props = props;\n this._dataset = props.parameters.Grid;\n this._pcfContext = props.context;\n this._labels = labels;\n\n this._dependencies = {\n recordUpdateService: new RecordUpdateService(this),\n filtering: new Filtering(this),\n selection: new Selection(this),\n metadata: new Metadata(this),\n sorting: new Sorting(this),\n paging: new Paging(this)\n }\n\n };\n public get isNavigationEnabled() {\n //enabled by default\n return this.parameters.EnableNavigation?.raw !== false;\n }\n public get isEditable() {\n return this._columns.find(x => x.isEditable) ? true : false;\n }\n public get parameters() {\n return this._props.parameters\n }\n public get error() {\n return this._dataset.error;\n }\n public get errorMessage() {\n return this._dataset.errorMessage\n }\n public get labels() {\n return this._labels;\n }\n public get dataset() {\n return this._dataset;\n }\n public get pcfContext() {\n return this._pcfContext;\n }\n public get props() {\n return this._props;\n }\n public get columns() {\n return this._columns;\n }\n public get records() {\n return this._records;\n }\n public get recordUpdateService() {\n return this._dependencies.recordUpdateService;\n }\n public get sorting() {\n return this._dependencies.sorting;\n }\n public get metadata() {\n return this._dependencies.metadata;\n }\n public get filtering() {\n return this._dependencies.filtering;\n }\n public get selection() {\n return this._dependencies.selection;\n }\n public get paging() {\n return this._dependencies.paging;\n }\n public get shouldRerender() {\n return this._shouldRerender;\n }\n public get loading() {\n return this._dataset.loading;\n }\n public get state() {\n return this._props.state;\n }\n public get useContainerAsHeight() {\n return this.parameters.UseContainerAsHeight?.raw === true;\n }\n public get enableOptionSetColors() {\n return this.parameters.EnableOptionSetColors?.raw === true;\n }\n public get linking() {\n return this.dataset.linking;\n }\n public get inlineRibbonButtonIds() {\n const idString = this.parameters.InlineRibbonButtonIds?.raw;\n if (!idString) {\n return undefined;\n }\n return idString.split(',');\n }\n\n public openDatasetItem(entityReference: ComponentFramework.EntityReference) {\n this._dataset.openDatasetItem(entityReference);\n const clickedRecord = this._records.find(x => x.getRecordId() === entityReference.id.guid);\n //we need to make sure the item we are opening gets selected in order for the\n //OnOpenRecord ribbon scripts to work correctly\n //if no record found we have clicked a lookup, no selection should be happening in that case\n if (clickedRecord) {\n this.selection.toggle(clickedRecord, true, true, true);\n }\n }\n\n public updateDependencies(props: IGrid): void {\n this._props = props;\n this._dataset = props.parameters.Grid;\n this._pcfContext = props.context;\n for (const [key, dependency] of Object.entries(this._dependencies)) {\n dependency.onDependenciesUpdated()\n }\n this._shouldRerender = !this.shouldRerender;\n }\n public async refreshColumns(): Promise<IGridColumn[]> {\n const gridColumns: IGridColumn[] = [];\n for (const column of this._dataset.columns) {\n if(column.isHidden) {\n continue;\n }\n const sorted = this._dataset.sorting?.find(sort => sort.name === column.name);\n const entityAliasName = column.name?.includes('.') ? column.name.split('.')[0] : null;\n const attributeName = entityAliasName ? column.name.split('.')[1] : column.name;\n const key = entityAliasName ? `${entityAliasName}.${attributeName}` : attributeName;\n switch (column.dataType) {\n case DataType.FILE:\n case DataType.IMAGE: {\n if (entityAliasName) {\n //we do not support file fields with linked entities\n //the getValue API throws an error in Power Apps\n continue;\n }\n }\n }\n const gridColumn = {\n entityAliasName: entityAliasName,\n attributeName: attributeName,\n key: entityAliasName ? `${entityAliasName}.${attributeName}` : attributeName,\n isPrimary: column.isPrimary,\n dataType: column.dataType as DataType,\n displayName: column.displayName,\n isEditable: column.isEditable,\n isFilterable: this._isColumnFilterable(column),\n isRequired: column.isRequired,\n isSortable: this._isColumnSortable(column),\n isSorted: sorted ? true : false,\n isSortedDescending: sorted?.sortDirection === 1 ? true : false,\n width: this.state?.columnSizing?.columnSizingModel?.find((x: any) => x.colId === key)?.width || column.visualSizeFactor,\n isResizable: column.isResizable ?? true,\n isHidden: column.isHidden\n } as IGridColumn;\n\n const condition = await this.filtering.condition(gridColumn);\n gridColumn.isFiltered = condition.isAppliedToDataset;\n gridColumn.isEditable = await this._isColumnEditable(gridColumn);\n gridColumn.isRequired = await this._isColumnRequired(gridColumn);\n\n if (gridColumn.key === RIBBON_COLUMN_KEY) {\n gridColumn.isFilterable = false;\n gridColumn.isSortable = false;\n }\n gridColumns.push(gridColumn);\n }\n/* gridColumns.unshift({\n key: RIBBON_COLUMN_KEY,\n attributeName: RIBBON_COLUMN_KEY,\n }) */\n if (this.selection.type !== undefined) {\n gridColumns.unshift({\n key: '__checkbox',\n attributeName: '__checkbox',\n width: 45,\n isResizable: false\n })\n }\n this._columns = gridColumns;\n return gridColumns;\n }\n\n public refreshRecords(): IEntityRecord[] {\n const records = [];\n for (const [_, record] of Object.entries(this._dataset.records)) {\n records.push(record);\n }\n this._records = records;\n return records\n }\n\n private async _isColumnEditable(column: IGridColumn): Promise<boolean> {\n //top priority, overriden through props\n if (typeof column.isEditable === 'boolean') {\n return column.isEditable\n }\n //only allow editing if specifically allowed\n if (!this._props.parameters.EnableEditing?.raw) {\n return false;\n }\n //we are not supporting editing for linked entities\n if (column.entityAliasName) {\n return false;\n }\n //these field types do not support editing\n switch (column.dataType) {\n case DataType.FILE:\n case DataType.IMAGE: {\n return false;\n }\n }\n const metadata = await this._pcfContext.utils.getEntityMetadata(this._dataset.getTargetEntityType(), [column.attributeName]);\n //IsEditable is not available in Power Apps\n return metadata.Attributes.get(column.attributeName)?.attributeDescriptor.IsValidForUpdate ?? false;\n }\n\n private async _isColumnRequired(column: IGridColumn) {\n if (typeof column.isRequired === 'boolean') {\n return column.isRequired;\n }\n if (!this.parameters.EnableEditing?.raw) {\n return false;\n }\n const metadata = await this.metadata.get(column);\n const requiredLevel = metadata.Attributes.get(column.attributeName)?.attributeDescriptor.RequiredLevel;\n if (requiredLevel === 1 || requiredLevel === 2) {\n return true;\n }\n return false;\n }\n private _isColumnSortable(column: IEntityColumn) {\n if (this._props.parameters.EnableSorting?.raw === false) {\n return false;\n }\n switch (column.dataType) {\n case DataType.IMAGE: {\n return false;\n }\n }\n return !column.disableSorting;\n }\n private _isColumnFilterable(column: IEntityColumn) {\n if (this.props.parameters.EnableFiltering?.raw === false) {\n return false;\n }\n return column.isFilterable ?? true;\n }\n}"],"names":[],"mappings":";;;;;;;;;MAYa,IAAI,CAAA;IAmBb,WAAY,CAAA,KAAY,EAAE,MAAW,EAAA;QAf7B,IAAQ,CAAA,QAAA,GAAkB,EAAE,CAAC;QAC7B,IAAQ,CAAA,QAAA,GAAoB,EAAE,CAAC;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EAAE;AACjB,gBAAA,OAAO,KAAK,CAAC;AAChB,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;KACjC;AACO,IAAA,mBAAmB,CAAC,MAAqB,EAAA;QAC7C,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,GAAG,KAAK,KAAK,EAAE;AACtD,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AACD,QAAA,OAAO,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC;KACtC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Grid.js","sources":["../../../../../src/components/Grid/core/model/Grid.ts"],"sourcesContent":["import { Attribute, Constants, DataTypes, IColumn, IDataset, IRecord } from \"@talxis/client-libraries\";\nimport { Filtering } from \"../../filtering/model/Filtering\";\nimport { IGrid } from \"../../interfaces\";\nimport { Paging } from \"../../paging/model/Paging\";\nimport { Selection } from \"../../selection/model/Selection\";\nimport { Sorting } from \"../../sorting/Sorting\";\nimport { ROW_HEIGHT } from \"../constants\";\nimport { DataType } from \"../enums/DataType\";\nimport { KeyHoldListener } from \"../services/KeyListener\";\nimport { RecordUpdateService } from \"../services/RecordUpdateService/model/RecordUpdateService\";\nimport { Metadata } from \"./Metadata\";\nimport { CHECKBOX_COLUMN_KEY } from \"../../constants\";\nimport { IGridColumn } from \"../interfaces/IGridColumn\";\n\nexport class Grid {\n private _props: IGrid;\n private _dataset: IDataset\n private _pcfContext: ComponentFramework.Context<any>;\n private _columns: IGridColumn[] = [];\n //used for optimization\n private _previousRecordsReference: {\n [id: string]: IRecord;\n } = {};\n //TODO: fix types\n private _labels: any;\n private _shouldRerender: boolean = false;\n private _records: IRecord[] = [];\n //TODO: the dependencies might not have fully loaded grid\n //need to make sure that the grid is initialized before creating them\n private _dependencies: {\n recordUpdateService: RecordUpdateService,\n filtering: Filtering,\n sorting: Sorting,\n metadata: Metadata,\n selection: Selection,\n paging: Paging\n };\n private _maxHeight: number;\n private _minHeight: number = 150;\n private _initialPageSize: number;\n public readonly keyHoldListener: KeyHoldListener;\n\n constructor(props: IGrid, labels: any, keyHoldListener: KeyHoldListener) {\n this._props = props;\n this._dataset = props.parameters.Grid;\n this._pcfContext = props.context;\n this._labels = labels;\n this.keyHoldListener = keyHoldListener;\n\n this._dependencies = {\n recordUpdateService: new RecordUpdateService(this),\n filtering: new Filtering(this),\n selection: new Selection(this),\n metadata: new Metadata(this),\n sorting: new Sorting(this),\n paging: new Paging(this)\n }\n this._initialPageSize = this.paging.pageSize;\n this._maxHeight = this._getMaxHeight();\n\n };\n public get isNavigationEnabled() {\n //enabled by default\n return this.parameters.EnableNavigation?.raw !== false;\n }\n public get isEditable() {\n return this._columns.find(x => x.isEditable) ? true : false;\n }\n public get parameters() {\n return this._props.parameters\n }\n public get error() {\n return this._dataset.error;\n }\n public get errorMessage() {\n return this._dataset.errorMessage\n }\n public get labels() {\n return this._labels;\n }\n public get dataset() {\n return this._dataset;\n }\n public get pcfContext() {\n return this._pcfContext;\n }\n public get props() {\n return this._props;\n }\n public get columns() {\n return this._columns;\n }\n public get records() {\n return this._records\n }\n public get recordUpdateService() {\n return this._dependencies.recordUpdateService;\n }\n public get sorting() {\n return this._dependencies.sorting;\n }\n public get metadata() {\n return this._dependencies.metadata;\n }\n public get filtering() {\n return this._dependencies.filtering;\n }\n public get selection() {\n return this._dependencies.selection;\n }\n public get paging() {\n return this._dependencies.paging;\n }\n public get shouldRerender() {\n return this._shouldRerender;\n }\n public get loading() {\n return this._dataset.loading;\n }\n public get state() {\n return this._props.state;\n }\n public get useContainerAsHeight() {\n return this.parameters.UseContainerAsHeight?.raw === true;\n }\n public get enableOptionSetColors() {\n return this.parameters.EnableOptionSetColors?.raw === true;\n }\n public get linking() {\n return this.dataset.linking;\n }\n public get inlineRibbonButtonIds() {\n const idString = this.parameters.InlineRibbonButtonIds?.raw;\n if (!idString) {\n return undefined;\n }\n return idString.split(',');\n }\n\n public get height() {\n let height = this._maxHeight;\n if (this.parameters.Height?.raw) {\n return this.parameters.Height?.raw;\n }\n if (this._records.length === 0) {\n height = this._minHeight;\n }\n else if (this._records.length <= this._initialPageSize) {\n height = this._records.length * ROW_HEIGHT;\n }\n if (height > this._maxHeight) {\n height = this._maxHeight;\n }\n return `${height}px`;\n\n }\n\n public openDatasetItem(entityReference: ComponentFramework.EntityReference) {\n this._dataset.openDatasetItem(entityReference);\n const clickedRecord = this.records.find(x => x.getRecordId() === entityReference.id.guid);\n //we need to make sure the item we are opening gets selected in order for the\n //OnOpenRecord ribbon scripts to work correctly\n //if no record found we have clicked a lookup, no selection should be happening in that case\n if (clickedRecord) {\n this.selection.toggle(clickedRecord, true, true, true);\n }\n }\n\n public updateDependencies(props: IGrid): void {\n this._props = props;\n this._dataset = props.parameters.Grid;\n this._pcfContext = props.context;\n //THIS COULD MAKE GRID STOP WORKING IN POWER APPS!\n if (this._previousRecordsReference !== this._dataset.records) {\n this._records = Object.values(this._dataset.records);\n this._previousRecordsReference = this._dataset.records;\n }\n Object.values(this._dependencies).map(dep => {\n dep.onDependenciesUpdated()\n })\n this._shouldRerender = !this.shouldRerender;\n }\n public async refreshColumns(): Promise<IGridColumn[]> {\n const gridColumns: IGridColumn[] = [];\n for (const column of this._dataset.columns) {\n const sorted = this._dataset.sorting?.find(sort => sort.name === column.name);\n const gridColumn: IGridColumn = {\n ...column,\n isEditable: await this._isColumnEditable(column),\n isRequired: await this._isColumnRequired(column),\n isFilterable: await this._isColumnFilterable(column),\n disableSorting: !this._isColumnSortable(column),\n isSortedDescending: sorted?.sortDirection === 1 ? true : false,\n isResizable: true,\n isSorted: sorted ? true : false,\n isFiltered: false\n }\n const condition = await this.filtering.condition(gridColumn);\n gridColumn.isFiltered = condition.isAppliedToDataset;\n gridColumns.push(gridColumn);\n }\n if (this.selection.type !== undefined) {\n gridColumns.unshift({\n name: CHECKBOX_COLUMN_KEY,\n alias: CHECKBOX_COLUMN_KEY,\n dataType: DataTypes.SingleLineText,\n displayName: '',\n isEditable: true,\n isFilterable: false,\n isFiltered: false,\n isRequired: false,\n isResizable: false,\n disableSorting: true,\n isSorted: false,\n isSortedDescending: false,\n order: 0,\n visualSizeFactor: 45,\n });\n }\n this._columns = gridColumns;\n return gridColumns;\n }\n\n private async _isColumnEditable(column: IColumn): Promise<boolean> {\n //only allow editing if specifically allowed\n if (!this._props.parameters.EnableEditing?.raw) {\n return false;\n }\n if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {\n return false;\n }\n //these field types do not support editing\n switch (column.dataType) {\n case DataType.FILE:\n case DataType.IMAGE: {\n return false;\n }\n }\n const attributeName = Attribute.GetNameFromAlias(column.name);\n const metadata = await this.metadata.get(column.name);\n return metadata.Attributes.get(attributeName)?.attributeDescriptor?.IsValidForUpdate ?? false;\n }\n\n private async _isColumnRequired(column: IColumn): Promise<boolean> {\n if (!this.parameters.EnableEditing?.raw) {\n return false;\n }\n if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {\n return false;\n }\n const metadata = await this.metadata.get(column.name);\n const attributeName = Attribute.GetNameFromAlias(column.name);\n const requiredLevel = metadata.Attributes.get(attributeName)?.attributeDescriptor?.RequiredLevel;\n if (requiredLevel === 1 || requiredLevel === 2) {\n return true;\n }\n return false;\n }\n private _isColumnSortable(column: IColumn): boolean {\n if (column.name.endsWith('__virtual')) {\n return false;\n }\n if (this._props.parameters.EnableSorting?.raw === false) {\n return false;\n }\n if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {\n return false;\n }\n switch (column.dataType) {\n case DataType.IMAGE: {\n return false;\n }\n }\n if(column.disableSorting === undefined) {\n return true;\n }\n return !column.disableSorting;\n }\n private async _isColumnFilterable(column: IColumn): Promise<boolean> {\n if (column.name.endsWith('__virtual')) {\n return false;\n }\n if (this.props.parameters.EnableFiltering?.raw === false) {\n return false;\n }\n if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {\n return false;\n }\n const metadata = await this.metadata.get(column.name);\n const attributeName = Attribute.GetNameFromAlias(column.name);\n return metadata.Attributes.get(attributeName)?.attributeDescriptor?.isFilterable ?? true;\n }\n private _getMaxHeight(): number {\n let maxHeight = this._initialPageSize * ROW_HEIGHT;\n if (maxHeight > 600) {\n maxHeight = 600;\n }\n return maxHeight;\n }\n}"],"names":[],"mappings":";;;;;;;;;;;MAca,IAAI,CAAA;AA4Bb,IAAA,WAAA,CAAY,KAAY,EAAE,MAAW,EAAE,eAAgC,EAAA;QAxB/D,IAAQ,CAAA,QAAA,GAAkB,EAAE,CAAC;;QAE7B,IAAyB,CAAA,yBAAA,GAE7B,EAAE,CAAC;QAGC,IAAe,CAAA,eAAA,GAAY,KAAK,CAAC;QACjC,IAAQ,CAAA,QAAA,GAAc,EAAE,CAAC;QAYzB,IAAU,CAAA,UAAA,GAAW,GAAG,CAAC;AAK7B,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;AACtC,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC;AACjC,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;AACtB,QAAA,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAEvC,IAAI,CAAC,aAAa,GAAG;AACjB,YAAA,mBAAmB,EAAE,IAAI,mBAAmB,CAAC,IAAI,CAAC;AAClD,YAAA,SAAS,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC;AAC9B,YAAA,SAAS,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC;AAC9B,YAAA,QAAQ,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;AAC5B,YAAA,OAAO,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;AAC1B,YAAA,MAAM,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC;SAC3B,CAAA;QACD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC7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CAAC,EAAE,mBAAmB,EAAE,YAAY,IAAI,IAAI,CAAC;KAC5F;IACO,aAAa,GAAA;AACjB,QAAA,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;QACnD,IAAI,SAAS,GAAG,GAAG,EAAE;YACjB,SAAS,GAAG,GAAG,CAAC;AACnB,SAAA;AACD,QAAA,OAAO,SAAS,CAAC;KACpB;AACJ;;;;"}
|
|
@@ -8,6 +8,6 @@ export declare class GridDependency {
|
|
|
8
8
|
removeRefreshCallback(id: string): void;
|
|
9
9
|
onDependenciesUpdated(): void;
|
|
10
10
|
protected _triggerRefreshCallbacks(): void;
|
|
11
|
-
protected get _dataset(): import("
|
|
11
|
+
protected get _dataset(): import("@talxis/client-libraries").IDataset;
|
|
12
12
|
protected get _pcfContext(): ComponentFramework.Context<any, ComponentFramework.IEventBag>;
|
|
13
13
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="powerapps-component-framework" />
|
|
2
|
-
import { IGridColumn } from "../interfaces/IGridColumn";
|
|
3
2
|
import { GridDependency } from "./GridDependency";
|
|
4
3
|
export declare class Metadata extends GridDependency {
|
|
5
|
-
get(
|
|
6
|
-
getOptions(
|
|
4
|
+
get(columnName: string): Promise<ComponentFramework.PropertyHelper.EntityMetadata>;
|
|
5
|
+
getOptions(columnName: string): Promise<[number | boolean, ComponentFramework.PropertyHelper.OptionMetadata[]]>;
|
|
7
6
|
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import { Attribute } from '@talxis/client-libraries';
|
|
1
2
|
import { GridDependency } from './GridDependency.js';
|
|
2
3
|
|
|
3
4
|
class Metadata extends GridDependency {
|
|
4
|
-
async get(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
async get(columnName) {
|
|
6
|
+
const entityAliasName = Attribute.GetLinkedEntityAlias(columnName);
|
|
7
|
+
const attributeName = Attribute.GetNameFromAlias(columnName);
|
|
8
|
+
if (entityAliasName) {
|
|
9
|
+
const linkedEntity = this._grid.dataset.linking.getLinkedEntities().find(x => x.alias === entityAliasName);
|
|
10
|
+
return await this._grid.pcfContext.utils.getEntityMetadata(linkedEntity.name, [attributeName]);
|
|
8
11
|
}
|
|
9
12
|
else {
|
|
10
|
-
return await this._grid.pcfContext.utils.getEntityMetadata(this._grid.dataset.getTargetEntityType(), [
|
|
13
|
+
return await this._grid.pcfContext.utils.getEntityMetadata(this._grid.dataset.getTargetEntityType(), [attributeName]);
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
|
-
async getOptions(
|
|
14
|
-
const columnMetadata = await this.get(
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
async getOptions(columnName) {
|
|
17
|
+
const columnMetadata = await this.get(columnName);
|
|
18
|
+
const attributeName = Attribute.GetNameFromAlias(columnName);
|
|
19
|
+
const options = columnMetadata.Attributes.get(attributeName).attributeDescriptor.OptionSet;
|
|
20
|
+
const defaultValue = columnMetadata.Attributes.get(attributeName).DefaultFormValue;
|
|
17
21
|
return [defaultValue, options];
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Metadata.js","sources":["../../../../../src/components/Grid/core/model/Metadata.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Metadata.js","sources":["../../../../../src/components/Grid/core/model/Metadata.ts"],"sourcesContent":["import { Attribute } from \"@talxis/client-libraries\";\nimport { GridDependency } from \"./GridDependency\";\n\nexport class Metadata extends GridDependency {\n public async get(columnName: string): Promise<ComponentFramework.PropertyHelper.EntityMetadata> {\n const entityAliasName = Attribute.GetLinkedEntityAlias(columnName);\n const attributeName = Attribute.GetNameFromAlias(columnName);\n if(entityAliasName) {\n const linkedEntity = this._grid.dataset.linking.getLinkedEntities().find(x => x.alias === entityAliasName)!;\n return await this._grid.pcfContext.utils.getEntityMetadata(linkedEntity.name, [attributeName]);\n }\n else {\n return await this._grid.pcfContext.utils.getEntityMetadata(this._grid.dataset.getTargetEntityType(), [attributeName]);\n }\n }\n public async getOptions(columnName: string): Promise<[number | boolean, ComponentFramework.PropertyHelper.OptionMetadata[]]> {\n const columnMetadata = await this.get(columnName);\n const attributeName = Attribute.GetNameFromAlias(columnName);\n const options = columnMetadata.Attributes.get(attributeName).attributeDescriptor.OptionSet as ComponentFramework.PropertyHelper.OptionMetadata[]\n const defaultValue = columnMetadata.Attributes.get(attributeName).DefaultFormValue as number | boolean;\n return [defaultValue, options];\n }\n}\n"],"names":[],"mappings":";;;AAGM,MAAO,QAAS,SAAQ,cAAc,CAAA;IACjC,MAAM,GAAG,CAAC,UAAkB,EAAA;QAC/B,MAAM,eAAe,GAAG,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACnE,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAC7D,QAAA,IAAG,eAAe,EAAE;YAChB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,eAAe,CAAE,CAAC;AAC5G,YAAA,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AAClG,SAAA;AACI,aAAA;YACD,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AACzH,SAAA;KACJ;IACM,MAAM,UAAU,CAAC,UAAkB,EAAA;QACtC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAC7D,QAAA,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,mBAAmB,CAAC,SAA+D,CAAA;AAChJ,QAAA,MAAM,YAAY,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,gBAAoC,CAAC;AACvG,QAAA,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;KAClC;AACJ;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class KeyHoldListener {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._currentlyHeldKey = null;
|
|
4
|
+
window.addEventListener('keydown', this._onKeyDown.bind(this));
|
|
5
|
+
window.addEventListener('keyup', this._onKeyUp.bind(this));
|
|
6
|
+
}
|
|
7
|
+
getHeldKey() {
|
|
8
|
+
return this._currentlyHeldKey;
|
|
9
|
+
}
|
|
10
|
+
_onKeyDown(e) {
|
|
11
|
+
this._currentlyHeldKey = e.key;
|
|
12
|
+
}
|
|
13
|
+
_onKeyUp(e) {
|
|
14
|
+
this._currentlyHeldKey = null;
|
|
15
|
+
}
|
|
16
|
+
destroy() {
|
|
17
|
+
window.removeEventListener('keydown', this._onKeyDown);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { KeyHoldListener };
|
|
22
|
+
//# sourceMappingURL=KeyListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyListener.js","sources":["../../../../../src/components/Grid/core/services/KeyListener.ts"],"sourcesContent":["export class KeyHoldListener {\n private _currentlyHeldKey: string | null = null;\n constructor() {\n window.addEventListener('keydown', this._onKeyDown.bind(this));\n window.addEventListener('keyup', this._onKeyUp.bind(this));\n }\n public getHeldKey(): string | null {\n return this._currentlyHeldKey;\n }\n private _onKeyDown(e: KeyboardEvent) {\n this._currentlyHeldKey = e.key;\n }\n private _onKeyUp(e: KeyboardEvent) {\n this._currentlyHeldKey = null;\n }\n destroy() {\n window.removeEventListener('keydown', this._onKeyDown);\n }\n}"],"names":[],"mappings":"MAAa,eAAe,CAAA;AAExB,IAAA,WAAA,GAAA;QADQ,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAC;AAE5C,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/D,QAAA,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KAC9D;IACM,UAAU,GAAA;QACb,OAAO,IAAI,CAAC,iBAAiB,CAAC;KACjC;AACO,IAAA,UAAU,CAAC,CAAgB,EAAA;AAC/B,QAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,GAAG,CAAC;KAClC;AACO,IAAA,QAAQ,CAAC,CAAgB,EAAA;AAC7B,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;KACjC;IACD,OAAO,GAAA;QACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC1D;AACJ;;;;"}
|
package/dist/components/Grid/core/services/RecordUpdateService/model/RecordUpdateService.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IEntityColumn, IEntityRecord } from "../../../../interfaces";
|
|
2
1
|
import { Grid } from "../../../model/Grid";
|
|
3
2
|
import { GridDependency } from "../../../model/GridDependency";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { IColumn, IRecord } from "@talxis/client-libraries";
|
|
4
|
+
export interface IUpdatedRecord extends Omit<IRecord, 'save'> {
|
|
5
|
+
columns: Map<string, IColumn>;
|
|
6
|
+
isValid: (columnName: string) => boolean;
|
|
7
|
+
getOriginalValue: (columnName: string) => any;
|
|
8
|
+
getOriginalFormattedValue: (columnName: string) => any;
|
|
9
9
|
getOriginalFormattedPrimaryNameValue: () => any;
|
|
10
10
|
save: () => Promise<boolean>;
|
|
11
11
|
clear: () => void;
|
|
@@ -19,12 +19,12 @@ export declare class RecordUpdateService extends GridDependency {
|
|
|
19
19
|
get hasInvalidRecords(): boolean;
|
|
20
20
|
record(recordId: string): {
|
|
21
21
|
get: () => IUpdatedRecord | undefined;
|
|
22
|
-
setValue: (
|
|
22
|
+
setValue: (columnName: string, value: any, doNotPropagateToDatasetRecord?: boolean) => void;
|
|
23
23
|
};
|
|
24
24
|
saveAll(): Promise<boolean>;
|
|
25
25
|
clearAll(): Promise<void>;
|
|
26
26
|
onDependenciesUpdated(): void;
|
|
27
|
-
private
|
|
27
|
+
private _getColumnByName;
|
|
28
28
|
private _isReadOnlyChangeEditor;
|
|
29
29
|
private _isEqual;
|
|
30
30
|
}
|