@ni/nimble-components 18.11.0 → 18.12.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/dist/all-components-bundle.js +255 -226
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1136 -1127
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/icon-base/icon-metadata.js +3 -0
- package/dist/esm/icon-base/icon-metadata.js.map +1 -1
- package/dist/esm/icons/all-icons.d.ts +1 -0
- package/dist/esm/icons/all-icons.js +1 -0
- package/dist/esm/icons/all-icons.js.map +1 -1
- package/dist/esm/icons/file-export.d.ts +13 -0
- package/dist/esm/icons/file-export.js +16 -0
- package/dist/esm/icons/file-export.js.map +1 -0
- package/dist/esm/table/components/cell/template.d.ts +1 -3
- package/dist/esm/table/components/cell/template.js +0 -5
- package/dist/esm/table/components/cell/template.js.map +1 -1
- package/dist/esm/table/components/group-row/styles.js +1 -1
- package/dist/esm/table/components/group-row/template.js +1 -1
- package/dist/esm/table/components/group-row/template.js.map +1 -1
- package/dist/esm/table/components/row/index.js +3 -3
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/components/row/template.js +1 -1
- package/dist/esm/table/components/row/template.js.map +1 -1
- package/dist/esm/table/index.js +17 -11
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/table-layout-helper.js +9 -13
- package/dist/esm/table/models/table-layout-helper.js.map +1 -1
- package/dist/esm/table/models/update-tracker.js +12 -3
- package/dist/esm/table/models/update-tracker.js.map +1 -1
- package/dist/esm/table-column/base/cell-view/template.d.ts +3 -0
- package/dist/esm/table-column/base/cell-view/template.js +26 -0
- package/dist/esm/table-column/base/cell-view/template.js.map +1 -0
- package/dist/esm/table-column/base/group-header-view/template.js +20 -4
- package/dist/esm/table-column/base/group-header-view/template.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +5 -106
- package/dist/esm/table-column/base/index.js +7 -110
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/base/models/column-internals.d.ts +97 -0
- package/dist/esm/table-column/base/models/column-internals.js +88 -0
- package/dist/esm/table-column/base/models/column-internals.js.map +1 -0
- package/dist/esm/table-column/base/template.d.ts +2 -1
- package/dist/esm/table-column/base/template.js +1 -1
- package/dist/esm/table-column/base/template.js.map +1 -1
- package/dist/esm/table-column/mixins/fractional-width-column.d.ts +2 -3
- package/dist/esm/table-column/mixins/fractional-width-column.js +4 -9
- package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -1
- package/dist/esm/table-column/mixins/groupable-column.d.ts +2 -3
- package/dist/esm/table-column/mixins/groupable-column.js +3 -3
- package/dist/esm/table-column/mixins/groupable-column.js.map +1 -1
- package/dist/esm/table-column/text/group-header-view/index.d.ts +0 -1
- package/dist/esm/table-column/text/group-header-view/index.js +0 -3
- package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text/index.d.ts +15 -18
- package/dist/esm/table-column/text/index.js +15 -20
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { ViewTemplate } from '@microsoft/fast-element';
|
|
2
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TableColumnSortDirection, TableFieldName } from '../../table/types';
|
|
6
|
-
import { TableColumnSortOperation } from './types';
|
|
2
|
+
import { TableColumnSortDirection } from '../../table/types';
|
|
3
|
+
import { ColumnInternalsOptions, ColumnInternals } from './models/column-internals';
|
|
7
4
|
/**
|
|
8
5
|
* The base class for table columns
|
|
9
6
|
*/
|
|
@@ -14,109 +11,11 @@ export declare abstract class TableColumn<TColumnConfig = unknown> extends Found
|
|
|
14
11
|
columnHidden: boolean;
|
|
15
12
|
sortIndex?: number | null;
|
|
16
13
|
sortDirection: TableColumnSortDirection;
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
* Used by the Table in order to give a column a specific pixel width.
|
|
20
|
-
* When set 'currentFractionalWidth' will be ignored.
|
|
21
|
-
*/
|
|
22
|
-
currentPixelWidth?: number;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
* Used by the Table in order to size a column proportionally to the available
|
|
26
|
-
* width of a row.
|
|
27
|
-
*/
|
|
28
|
-
currentFractionalWidth: number;
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
* Used by column plugins to set a specific pixel width. Sets currentPixelWidth when changed.
|
|
32
|
-
*/
|
|
33
|
-
internalPixelWidth?: number;
|
|
34
|
-
/**
|
|
35
|
-
* @internal
|
|
36
|
-
* Used by column plugins to size a column proportionally to the available
|
|
37
|
-
* width of a row. Sets currentFractionalWidth when changed.
|
|
38
|
-
*/
|
|
39
|
-
internalFractionalWidth: number;
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
* The minimum size in pixels according to the design doc
|
|
43
|
-
*/
|
|
44
|
-
internalMinPixelWidth: number;
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
* Whether or not this column can be used to group rows by
|
|
48
|
-
*/
|
|
49
|
-
internalGroupingDisabled: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* @internal
|
|
52
|
-
* Specifies the grouping precedence of the column within the set of all columns participating in grouping.
|
|
53
|
-
* Columns are rendered in the grouping tree from lowest group-index as the tree root to highest
|
|
54
|
-
* group-index as tree leaves.
|
|
55
|
-
*/
|
|
56
|
-
internalGroupIndex?: number;
|
|
57
|
-
/**
|
|
58
|
-
* The tag to use to render the group header content for a column.
|
|
59
|
-
* The element this tag refers to must derive from TableGroupHeaderView.
|
|
60
|
-
*/
|
|
61
|
-
abstract readonly groupHeaderViewTag?: string;
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
internalGroupHeaderViewTemplate?: ViewTemplate<TableGroupRow>;
|
|
66
14
|
/**
|
|
67
15
|
* @internal
|
|
68
16
|
*
|
|
69
|
-
*
|
|
70
|
-
* The tag (element name) of the custom element that renders the cell content for the column.
|
|
71
|
-
* That element should derive from TableCellView<TCellRecord, TColumnConfig>.
|
|
72
|
-
*/
|
|
73
|
-
abstract readonly cellViewTag: string;
|
|
74
|
-
currentCellViewTemplate?: ViewTemplate<TableCell>;
|
|
75
|
-
/**
|
|
76
|
-
* @internal
|
|
77
|
-
*
|
|
78
|
-
* The names of the fields that should be present in TCellRecord.
|
|
79
|
-
* This array is parallel with the field names specified by `dataRecordFieldNames`.
|
|
80
|
-
*/
|
|
81
|
-
abstract readonly cellRecordFieldNames: readonly TableFieldName[];
|
|
82
|
-
/**
|
|
83
|
-
* @internal
|
|
84
|
-
*
|
|
85
|
-
* The names of the fields from the row's record that correlate to the data that will be in TCellRecord.
|
|
86
|
-
* This array is parallel with the field names specified by `cellRecordFieldNames`.
|
|
87
|
-
*/
|
|
88
|
-
dataRecordFieldNames: readonly (TableFieldName | undefined)[];
|
|
89
|
-
/**
|
|
90
|
-
* @internal
|
|
91
|
-
*
|
|
92
|
-
* The relevant, static configuration a column requires its cell view to have access to.
|
|
93
|
-
*/
|
|
94
|
-
columnConfig?: TColumnConfig;
|
|
95
|
-
/**
|
|
96
|
-
* @internal
|
|
97
|
-
*
|
|
98
|
-
* The name of the data field that will be used for operations on the table, such as sorting and grouping.
|
|
99
|
-
*/
|
|
100
|
-
operandDataRecordFieldName?: TableFieldName;
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
*
|
|
104
|
-
* The operation to use when sorting the table by this column.
|
|
105
|
-
*/
|
|
106
|
-
sortOperation: TableColumnSortOperation;
|
|
107
|
-
/**
|
|
108
|
-
* @internal
|
|
109
|
-
*
|
|
110
|
-
* Properties prefixed with `internal` are for internal table-use only.
|
|
111
|
-
*/
|
|
112
|
-
readonly internalUniqueId: string;
|
|
113
|
-
constructor();
|
|
114
|
-
/**
|
|
115
|
-
* @internal
|
|
17
|
+
* Column properties configurable by plugin authors
|
|
116
18
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
protected internalFractionalWidthChanged(): void;
|
|
120
|
-
protected internalPixelWidthChanged(): void;
|
|
121
|
-
protected groupHeaderViewTagChanged(): void;
|
|
19
|
+
readonly columnInternals: ColumnInternals<TColumnConfig>;
|
|
20
|
+
constructor(options: ColumnInternalsOptions);
|
|
122
21
|
}
|
|
@@ -1,78 +1,20 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { attr, nullableNumberConverter
|
|
2
|
+
import { attr, nullableNumberConverter } from '@microsoft/fast-element';
|
|
3
3
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
|
-
import { uniqueId } from '@microsoft/fast-web-utilities';
|
|
5
|
-
import { createGroupHeaderViewTemplate } from './group-header-view/template';
|
|
6
|
-
import { createCellViewTemplate } from '../../table/components/cell/template';
|
|
7
4
|
import { TableColumnSortDirection } from '../../table/types';
|
|
8
|
-
import {
|
|
5
|
+
import { ColumnInternals } from './models/column-internals';
|
|
9
6
|
/**
|
|
10
7
|
* The base class for table columns
|
|
11
8
|
*/
|
|
12
9
|
export class TableColumn extends FoundationElement {
|
|
13
|
-
constructor() {
|
|
10
|
+
constructor(options) {
|
|
14
11
|
super();
|
|
15
12
|
this.columnHidden = false;
|
|
16
13
|
this.sortDirection = TableColumnSortDirection.none;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
this.currentFractionalWidth = defaultFractionalWidth;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
* Used by column plugins to size a column proportionally to the available
|
|
26
|
-
* width of a row. Sets currentFractionalWidth when changed.
|
|
27
|
-
*/
|
|
28
|
-
this.internalFractionalWidth = defaultFractionalWidth;
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
* The minimum size in pixels according to the design doc
|
|
32
|
-
*/
|
|
33
|
-
this.internalMinPixelWidth = defaultMinPixelWidth;
|
|
34
|
-
/**
|
|
35
|
-
* @internal
|
|
36
|
-
* Whether or not this column can be used to group rows by
|
|
37
|
-
*/
|
|
38
|
-
this.internalGroupingDisabled = false;
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*
|
|
42
|
-
* The names of the fields from the row's record that correlate to the data that will be in TCellRecord.
|
|
43
|
-
* This array is parallel with the field names specified by `cellRecordFieldNames`.
|
|
44
|
-
*/
|
|
45
|
-
this.dataRecordFieldNames = [];
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*
|
|
49
|
-
* The operation to use when sorting the table by this column.
|
|
50
|
-
*/
|
|
51
|
-
this.sortOperation = TableColumnSortOperation.basic;
|
|
52
|
-
this.internalUniqueId = uniqueId('table-column-slot');
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
connectedCallback() {
|
|
58
|
-
super.connectedCallback();
|
|
59
|
-
this.setAttribute('slot', this.internalUniqueId);
|
|
60
|
-
}
|
|
61
|
-
cellViewTagChanged() {
|
|
62
|
-
this.currentCellViewTemplate = this.cellViewTag
|
|
63
|
-
? createCellViewTemplate(this.cellViewTag)
|
|
64
|
-
: undefined;
|
|
65
|
-
}
|
|
66
|
-
internalFractionalWidthChanged() {
|
|
67
|
-
this.currentFractionalWidth = this.internalFractionalWidth;
|
|
68
|
-
}
|
|
69
|
-
internalPixelWidthChanged() {
|
|
70
|
-
this.currentPixelWidth = this.internalPixelWidth;
|
|
71
|
-
}
|
|
72
|
-
groupHeaderViewTagChanged() {
|
|
73
|
-
this.internalGroupHeaderViewTemplate = this.groupHeaderViewTag
|
|
74
|
-
? createGroupHeaderViewTemplate(this.groupHeaderViewTag)
|
|
75
|
-
: undefined;
|
|
14
|
+
if (!options) {
|
|
15
|
+
throw new Error('ColumnInternalsOptions must be provided to constructor');
|
|
16
|
+
}
|
|
17
|
+
this.columnInternals = new ColumnInternals(options);
|
|
76
18
|
}
|
|
77
19
|
}
|
|
78
20
|
__decorate([
|
|
@@ -93,49 +35,4 @@ __decorate([
|
|
|
93
35
|
__decorate([
|
|
94
36
|
attr({ attribute: 'sort-direction' })
|
|
95
37
|
], TableColumn.prototype, "sortDirection", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
observable
|
|
98
|
-
], TableColumn.prototype, "currentPixelWidth", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
observable
|
|
101
|
-
], TableColumn.prototype, "currentFractionalWidth", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
observable
|
|
104
|
-
], TableColumn.prototype, "internalPixelWidth", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
observable
|
|
107
|
-
], TableColumn.prototype, "internalFractionalWidth", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
observable
|
|
110
|
-
], TableColumn.prototype, "internalMinPixelWidth", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
observable
|
|
113
|
-
], TableColumn.prototype, "internalGroupingDisabled", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
observable
|
|
116
|
-
], TableColumn.prototype, "internalGroupIndex", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
observable
|
|
119
|
-
], TableColumn.prototype, "groupHeaderViewTag", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
observable
|
|
122
|
-
], TableColumn.prototype, "internalGroupHeaderViewTemplate", void 0);
|
|
123
|
-
__decorate([
|
|
124
|
-
observable
|
|
125
|
-
], TableColumn.prototype, "cellViewTag", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
observable
|
|
128
|
-
], TableColumn.prototype, "currentCellViewTemplate", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
observable
|
|
131
|
-
], TableColumn.prototype, "dataRecordFieldNames", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
observable
|
|
134
|
-
], TableColumn.prototype, "columnConfig", void 0);
|
|
135
|
-
__decorate([
|
|
136
|
-
observable
|
|
137
|
-
], TableColumn.prototype, "operandDataRecordFieldName", void 0);
|
|
138
|
-
__decorate([
|
|
139
|
-
observable
|
|
140
|
-
], TableColumn.prototype, "sortOperation", void 0);
|
|
141
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAEH,eAAe,EAClB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAgB,WAEpB,SAAQ,iBAAiB;IA0BvB,YAAmB,OAA+B;QAC9C,KAAK,EAAE,CAAC;QAhBL,iBAAY,GAAG,KAAK,CAAC;QAMrB,kBAAa,GAA6B,wBAAwB,CAAC,IAAI,CAAC;QAW3E,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,IAAI,KAAK,CACX,wDAAwD,CAC3D,CAAC;SACL;QACD,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;CACJ;AAjCG;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;6CACR;AAGzB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;mDACT;AAG/B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;oDACT;AAGhC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDAC1B;AAG5B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;8CACrC;AAGjC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;kDACyC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import type { TableFieldName } from '../../../table/types';
|
|
3
|
+
import type { TableCell } from '../../../table/components/cell';
|
|
4
|
+
import { TableColumnSortOperation } from '../types';
|
|
5
|
+
import type { TableGroupRow } from '../../../table/components/group-row';
|
|
6
|
+
export interface ColumnInternalsOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The tag (element name) of the custom element that renders the cell content for the column.
|
|
9
|
+
* That element should derive from TableCellView<TCellRecord, TColumnConfig>.
|
|
10
|
+
*/
|
|
11
|
+
readonly cellViewTag: string;
|
|
12
|
+
/**
|
|
13
|
+
* The names of the fields that should be present in TCellRecord.
|
|
14
|
+
* This array is parallel with the field names specified by `dataRecordFieldNames`.
|
|
15
|
+
*/
|
|
16
|
+
readonly cellRecordFieldNames: readonly TableFieldName[];
|
|
17
|
+
/**
|
|
18
|
+
* The tag to use to render the group header content for a column.
|
|
19
|
+
* The element this tag refers to must derive from TableGroupHeaderView.
|
|
20
|
+
*/
|
|
21
|
+
readonly groupHeaderViewTag: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Internal column state configured by plugin authors
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare class ColumnInternals<TColumnConfig> {
|
|
28
|
+
/**
|
|
29
|
+
* @see ColumnInternalsOptions.cellRecordFieldNames
|
|
30
|
+
*/
|
|
31
|
+
readonly cellRecordFieldNames: readonly TableFieldName[];
|
|
32
|
+
/**
|
|
33
|
+
* A unique id used internally in the table to identify specific column instances
|
|
34
|
+
*/
|
|
35
|
+
readonly uniqueId: string;
|
|
36
|
+
/**
|
|
37
|
+
* Template for the cell view
|
|
38
|
+
*/
|
|
39
|
+
readonly cellViewTemplate: ViewTemplate<TableCell>;
|
|
40
|
+
/**
|
|
41
|
+
* The relevant, static configuration a column requires its cell view to have access to.
|
|
42
|
+
*/
|
|
43
|
+
columnConfig?: TColumnConfig;
|
|
44
|
+
/**
|
|
45
|
+
* The name of the data field that will be used for operations on the table, such as sorting and grouping.
|
|
46
|
+
*/
|
|
47
|
+
operandDataRecordFieldName?: TableFieldName;
|
|
48
|
+
/**
|
|
49
|
+
* The operation to use when sorting the table by this column.
|
|
50
|
+
*/
|
|
51
|
+
sortOperation: TableColumnSortOperation;
|
|
52
|
+
/**
|
|
53
|
+
* The names of the fields from the row's record that correlate to the data that will be in TCellRecord.
|
|
54
|
+
* This array is parallel with the field names specified by `cellRecordFieldNames`.
|
|
55
|
+
*/
|
|
56
|
+
dataRecordFieldNames: readonly (TableFieldName | undefined)[];
|
|
57
|
+
/**
|
|
58
|
+
* Template for the group header view
|
|
59
|
+
*/
|
|
60
|
+
readonly groupHeaderViewTemplate: ViewTemplate<TableGroupRow>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether or not this column can be used to group rows by
|
|
63
|
+
*/
|
|
64
|
+
groupingDisabled: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Specifies the grouping precedence of the column within the set of all columns participating in grouping.
|
|
67
|
+
* Columns are rendered in the grouping tree from lowest group-index as the tree root to highest
|
|
68
|
+
* group-index as tree leaves.
|
|
69
|
+
*/
|
|
70
|
+
groupIndex?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Used by column plugins to set a specific pixel width. Sets currentPixelWidth when changed.
|
|
73
|
+
*/
|
|
74
|
+
pixelWidth?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Used by column plugins to size a column proportionally to the available
|
|
77
|
+
* width of a row. Sets currentFractionalWidth when changed.
|
|
78
|
+
*/
|
|
79
|
+
fractionalWidth: number;
|
|
80
|
+
/**
|
|
81
|
+
* The minimum size in pixels according to the design doc
|
|
82
|
+
*/
|
|
83
|
+
minPixelWidth: number;
|
|
84
|
+
/**
|
|
85
|
+
* @internal Do not write to this value directly. It is used by the Table in order to store
|
|
86
|
+
* the resolved value of the fractionalWidth after updates programmatic or interactive updates.
|
|
87
|
+
*/
|
|
88
|
+
currentFractionalWidth: number;
|
|
89
|
+
/**
|
|
90
|
+
* @internal Do not write to this value directly. It is used by the Table in order to store
|
|
91
|
+
* the resolved value of the pixelWidth after programmatic or interactive updates.
|
|
92
|
+
*/
|
|
93
|
+
currentPixelWidth?: number;
|
|
94
|
+
constructor(options: ColumnInternalsOptions);
|
|
95
|
+
protected fractionalWidthChanged(): void;
|
|
96
|
+
protected pixelWidthChanged(): void;
|
|
97
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { uniqueId } from '@microsoft/fast-web-utilities';
|
|
3
|
+
import { observable } from '@microsoft/fast-element';
|
|
4
|
+
import { TableColumnSortOperation, defaultFractionalWidth, defaultMinPixelWidth } from '../types';
|
|
5
|
+
import { createGroupHeaderViewTemplate } from '../group-header-view/template';
|
|
6
|
+
import { createCellViewTemplate } from '../cell-view/template';
|
|
7
|
+
/**
|
|
8
|
+
* Internal column state configured by plugin authors
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export class ColumnInternals {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
/**
|
|
14
|
+
* A unique id used internally in the table to identify specific column instances
|
|
15
|
+
*/
|
|
16
|
+
this.uniqueId = uniqueId('table-column-slot');
|
|
17
|
+
/**
|
|
18
|
+
* The operation to use when sorting the table by this column.
|
|
19
|
+
*/
|
|
20
|
+
this.sortOperation = TableColumnSortOperation.basic;
|
|
21
|
+
/**
|
|
22
|
+
* The names of the fields from the row's record that correlate to the data that will be in TCellRecord.
|
|
23
|
+
* This array is parallel with the field names specified by `cellRecordFieldNames`.
|
|
24
|
+
*/
|
|
25
|
+
this.dataRecordFieldNames = [];
|
|
26
|
+
/**
|
|
27
|
+
* Whether or not this column can be used to group rows by
|
|
28
|
+
*/
|
|
29
|
+
this.groupingDisabled = false;
|
|
30
|
+
/**
|
|
31
|
+
* Used by column plugins to size a column proportionally to the available
|
|
32
|
+
* width of a row. Sets currentFractionalWidth when changed.
|
|
33
|
+
*/
|
|
34
|
+
this.fractionalWidth = defaultFractionalWidth;
|
|
35
|
+
/**
|
|
36
|
+
* The minimum size in pixels according to the design doc
|
|
37
|
+
*/
|
|
38
|
+
this.minPixelWidth = defaultMinPixelWidth;
|
|
39
|
+
/**
|
|
40
|
+
* @internal Do not write to this value directly. It is used by the Table in order to store
|
|
41
|
+
* the resolved value of the fractionalWidth after updates programmatic or interactive updates.
|
|
42
|
+
*/
|
|
43
|
+
this.currentFractionalWidth = defaultFractionalWidth;
|
|
44
|
+
this.cellRecordFieldNames = options.cellRecordFieldNames;
|
|
45
|
+
this.cellViewTemplate = createCellViewTemplate(options.cellViewTag);
|
|
46
|
+
this.groupHeaderViewTemplate = createGroupHeaderViewTemplate(options.groupHeaderViewTag);
|
|
47
|
+
}
|
|
48
|
+
fractionalWidthChanged() {
|
|
49
|
+
this.currentFractionalWidth = this.fractionalWidth;
|
|
50
|
+
}
|
|
51
|
+
pixelWidthChanged() {
|
|
52
|
+
this.currentPixelWidth = this.pixelWidth;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
__decorate([
|
|
56
|
+
observable
|
|
57
|
+
], ColumnInternals.prototype, "columnConfig", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
observable
|
|
60
|
+
], ColumnInternals.prototype, "operandDataRecordFieldName", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
observable
|
|
63
|
+
], ColumnInternals.prototype, "sortOperation", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
observable
|
|
66
|
+
], ColumnInternals.prototype, "dataRecordFieldNames", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
observable
|
|
69
|
+
], ColumnInternals.prototype, "groupingDisabled", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
observable
|
|
72
|
+
], ColumnInternals.prototype, "groupIndex", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
observable
|
|
75
|
+
], ColumnInternals.prototype, "pixelWidth", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
observable
|
|
78
|
+
], ColumnInternals.prototype, "fractionalWidth", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
observable
|
|
81
|
+
], ColumnInternals.prototype, "minPixelWidth", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
observable
|
|
84
|
+
], ColumnInternals.prototype, "currentFractionalWidth", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
observable
|
|
87
|
+
], ColumnInternals.prototype, "currentPixelWidth", void 0);
|
|
88
|
+
//# sourceMappingURL=column-internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-internals.js","sourceRoot":"","sources":["../../../../../src/table-column/base/models/column-internals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAgB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACvB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAsB/D;;;GAGG;AACH,MAAM,OAAO,eAAe;IA6FxB,YAAmB,OAA+B;QAvFlD;;WAEG;QACa,aAAQ,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAmBzD;;WAEG;QAEI,kBAAa,GAA6B,wBAAwB,CAAC,KAAK,CAAC;QAEhF;;;WAGG;QAEI,yBAAoB,GAA4C,EAAE,CAAC;QAO1E;;WAEG;QAEI,qBAAgB,GAAG,KAAK,CAAC;QAgBhC;;;WAGG;QAEI,oBAAe,GAAG,sBAAsB,CAAC;QAEhD;;WAEG;QAEI,kBAAa,GAAG,oBAAoB,CAAC;QAE5C;;;WAGG;QAEI,2BAAsB,GAAG,sBAAsB,CAAC;QAUnD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QACzD,IAAI,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACpE,IAAI,CAAC,uBAAuB,GAAG,6BAA6B,CACxD,OAAO,CAAC,kBAAkB,CAC7B,CAAC;IACN,CAAC;IAES,sBAAsB;QAC5B,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,eAAe,CAAC;IACvD,CAAC;IAES,iBAAiB;QACvB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7C,CAAC;CACJ;AAxFG;IADC,UAAU;qDACyB;AAMpC;IADC,UAAU;mEACwC;AAMnD;IADC,UAAU;sDACqE;AAOhF;IADC,UAAU;6DAC+D;AAW1E;IADC,UAAU;yDACqB;AAQhC;IADC,UAAU;mDACgB;AAM3B;IADC,UAAU;mDACgB;AAO3B;IADC,UAAU;wDACqC;AAMhD;IADC,UAAU;sDACiC;AAO5C;IADC,UAAU;+DAC4C;AAOvD;IADC,UAAU;0DACuB"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TableColumn } from '.';
|
|
2
|
+
export declare const template: import("@microsoft/fast-element").ViewTemplate<TableColumn<unknown>, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAa;sBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ;;;;;CAKpD,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { TableColumn } from '../base';
|
|
2
|
-
declare type SizedTableColumn = Pick<TableColumn, '
|
|
2
|
+
declare type SizedTableColumn = Pick<TableColumn, 'columnInternals'>;
|
|
3
3
|
declare type SizedTableColumnConstructor = abstract new (...args: any[]) => SizedTableColumn;
|
|
4
4
|
export declare function mixinFractionalWidthColumnAPI<TBase extends SizedTableColumnConstructor>(base: TBase): (abstract new (...args: any[]) => {
|
|
5
5
|
fractionalWidth?: number | null | undefined;
|
|
6
6
|
minPixelWidth?: number | null | undefined;
|
|
7
7
|
fractionalWidthChanged(): void;
|
|
8
8
|
minPixelWidthChanged(): void;
|
|
9
|
-
|
|
10
|
-
internalMinPixelWidth: number;
|
|
9
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
11
10
|
}) & TBase;
|
|
12
11
|
export {};
|
|
@@ -8,25 +8,20 @@ export function mixinFractionalWidthColumnAPI(base) {
|
|
|
8
8
|
* proportionally within a Table.
|
|
9
9
|
*/
|
|
10
10
|
class FractionalWidthColumn extends base {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.fractionalWidth = defaultFractionalWidth;
|
|
14
|
-
this.minPixelWidth = defaultMinPixelWidth;
|
|
15
|
-
}
|
|
16
11
|
fractionalWidthChanged() {
|
|
17
12
|
if (typeof this.fractionalWidth === 'number') {
|
|
18
|
-
this.
|
|
13
|
+
this.columnInternals.fractionalWidth = this.fractionalWidth;
|
|
19
14
|
}
|
|
20
15
|
else {
|
|
21
|
-
this.
|
|
16
|
+
this.columnInternals.fractionalWidth = defaultFractionalWidth;
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
minPixelWidthChanged() {
|
|
25
20
|
if (typeof this.minPixelWidth === 'number') {
|
|
26
|
-
this.
|
|
21
|
+
this.columnInternals.minPixelWidth = this.minPixelWidth;
|
|
27
22
|
}
|
|
28
23
|
else {
|
|
29
|
-
this.
|
|
24
|
+
this.columnInternals.minPixelWidth = defaultMinPixelWidth;
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractional-width-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/fractional-width-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"fractional-width-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/fractional-width-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAQ7E,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;QAKtC,sBAAsB;YACzB,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;gBAC1C,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;aAC/D;iBAAM;gBACH,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,sBAAsB,CAAC;aACjE;QACL,CAAC;QAEM,oBAAoB;YACvB,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE;gBACxC,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;aAC3D;iBAAM;gBACH,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,oBAAoB,CAAC;aAC7D;QACL,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACvE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACtE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,eAAe,CAClB,CAAC;IACF,OAAO,qBAAqB,CAAC;AACjC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { TableColumn } from '../base';
|
|
2
|
-
declare type GroupableTableColumn = Pick<TableColumn, '
|
|
2
|
+
declare type GroupableTableColumn = Pick<TableColumn, 'columnInternals'>;
|
|
3
3
|
declare type GroupableTableColumnConstructor = abstract new (...args: any[]) => GroupableTableColumn;
|
|
4
4
|
export declare function mixinGroupableColumnAPI<TBase extends GroupableTableColumnConstructor>(base: TBase): (abstract new (...args: any[]) => {
|
|
5
5
|
groupingDisabled: boolean;
|
|
6
6
|
groupIndex?: number | null | undefined;
|
|
7
7
|
groupingDisabledChanged(): void;
|
|
8
8
|
groupIndexChanged(): void;
|
|
9
|
-
|
|
10
|
-
internalGroupIndex?: number | undefined;
|
|
9
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
11
10
|
}) & TBase;
|
|
12
11
|
export {};
|
|
@@ -13,14 +13,14 @@ export function mixinGroupableColumnAPI(base) {
|
|
|
13
13
|
this.groupIndex = null;
|
|
14
14
|
}
|
|
15
15
|
groupingDisabledChanged() {
|
|
16
|
-
this.
|
|
16
|
+
this.columnInternals.groupingDisabled = this.groupingDisabled;
|
|
17
17
|
}
|
|
18
18
|
groupIndexChanged() {
|
|
19
19
|
if (typeof this.groupIndex === 'number') {
|
|
20
|
-
this.
|
|
20
|
+
this.columnInternals.groupIndex = this.groupIndex;
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
this.
|
|
23
|
+
this.columnInternals.groupIndex = undefined;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/groupable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"groupable-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/groupable-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AASxE,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,uBAAuB,CAErC,IAAW;IACT;;;OAGG;IACH,MAAe,eAAgB,SAAQ,IAAI;QAA3C;;YACW,qBAAgB,GAAG,KAAK,CAAC;YAEzB,eAAU,GAAmB,IAAI,CAAC;QAa7C,CAAC;QAXU,uBAAuB;YAC1B,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClE,CAAC;QAEM,iBAAiB;YACpB,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE;gBACrC,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;aACrD;iBAAM;gBACH,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,SAAS,CAAC;aAC/C;QACL,CAAC;KACJ;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACrD,iEAAiE;IACjE,eAAe,CAAC,SAAS,EACzB,kBAAkB,CACrB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IAClE,iEAAiE;IACjE,eAAe,CAAC,SAAS,EACzB,YAAY,CACf,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -10,7 +10,6 @@ declare global {
|
|
|
10
10
|
* grouped by a TableColumnText column.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnTextGroupHeaderView extends TableGroupHeaderView<string | null | undefined, TableColumnTextColumnConfig> {
|
|
13
|
-
columnConfig?: TableColumnTextColumnConfig;
|
|
14
13
|
/** @internal */
|
|
15
14
|
textSpan: HTMLElement;
|
|
16
15
|
/** @internal */
|
|
@@ -26,9 +26,6 @@ export class TableColumnTextGroupHeaderView extends TableGroupHeaderView {
|
|
|
26
26
|
this.isValidContentAndHasOverflow = false;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
__decorate([
|
|
30
|
-
observable
|
|
31
|
-
], TableColumnTextGroupHeaderView.prototype, "columnConfig", void 0);
|
|
32
29
|
__decorate([
|
|
33
30
|
observable
|
|
34
31
|
], TableColumnTextGroupHeaderView.prototype, "isValidContentAndHasOverflow", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,oBAGnD;IAHD;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,oBAGnD;IAHD;;QAOI,gBAAgB;QAET,iCAA4B,GAAG,KAAK,CAAC;IAgBhD,CAAC;IAbG,IAAW,OAAO;QACd,OAAO,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ;YAC5C,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACvB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,EAAE,CAAC;IAC/C,CAAC;IAEM,mBAAmB;QACtB,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC9F,CAAC;IAEM,kBAAkB;QACrB,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAC;IAC9C,CAAC;CACJ;AAhBG;IADC,UAAU;oFACiC;AAG5C;IADC,QAAQ;6DAKR;AAWL,MAAM,8BAA8B,GAAG,8BAA8B,CAAC,OAAO,CAAC;IAC1E,QAAQ,EAAE,gCAAgC;IAC1C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,8BAA8B,EAAE,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAC,MAAM,CAC5D,8BAA8B,CACjC,CAAC"}
|