@servicetitan/table 26.1.0 → 26.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/filters/field-values-filter.js +0 -10
- package/dist/filters/field-values-filter.js.map +1 -1
- package/dist/table.d.ts +6 -0
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +68 -8
- package/dist/table.js.map +1 -1
- package/package.json +10 -10
- package/src/filters/field-values-filter.tsx +2 -2
- package/src/table.tsx +28 -5
@@ -125,16 +125,6 @@ export function fieldValuesColumnMenuFilter(tableState, renderItem = defaultRend
|
|
125
125
|
__metadata("design:type", Object),
|
126
126
|
__metadata("design:paramtypes", [])
|
127
127
|
], FieldValuesFilterCell.prototype, "processedData", null);
|
128
|
-
__decorate([
|
129
|
-
computed,
|
130
|
-
__metadata("design:type", Object),
|
131
|
-
__metadata("design:paramtypes", [])
|
132
|
-
], FieldValuesFilterCell.prototype, "field", null);
|
133
|
-
__decorate([
|
134
|
-
computed,
|
135
|
-
__metadata("design:type", Array),
|
136
|
-
__metadata("design:paramtypes", [])
|
137
|
-
], FieldValuesFilterCell.prototype, "value", null);
|
138
128
|
__decorate([
|
139
129
|
action,
|
140
130
|
__metadata("design:type", Object)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"field-values-filter.js","sourceRoot":"","sources":["../../src/filters/field-values-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAwB,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEjF,OAAO,EAAE,KAAK,EAAoB,MAAM,8BAA8B,CAAC;AAIvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,UAAU,QA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IAAI,EAAE;QACX,OAAO,EAAE,CAAC;KACb;IAED,4BAA4B;IAC5B,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
|
package/dist/table.d.ts
CHANGED
@@ -21,6 +21,10 @@ export interface TableProps<T, TId extends IdType = any, P = never, PId extends
|
|
21
21
|
pager?: TablePagerSettings;
|
22
22
|
}
|
23
23
|
export declare class Table<T, TId extends IdType = any, P = never, PId extends IdType = never> extends Component<TableProps<T, TId, P, PId>> {
|
24
|
+
observableScrollable: TableProps<T, TId, P, PId>['scrollable'];
|
25
|
+
observableSelectionControl: TableProps<T, TId, P, PId>['selectionControl'];
|
26
|
+
observableHideSelectAll: TableProps<T, TId, P, PId>['hideSelectAll'];
|
27
|
+
observableSelectable: TableProps<T, TId, P, PId>['selectable'];
|
24
28
|
private tableState;
|
25
29
|
private ref;
|
26
30
|
private lastSelection?;
|
@@ -28,6 +32,8 @@ export declare class Table<T, TId extends IdType = any, P = never, PId extends I
|
|
28
32
|
private customCellMap;
|
29
33
|
private selectHeaderCell;
|
30
34
|
private withCellTableState;
|
35
|
+
constructor(props: TableProps<T, TId, P, PId>);
|
36
|
+
componentDidUpdate(): void;
|
31
37
|
rowRender: (row: ReactElement, rowProps: TableRowProps) => string | number | boolean | ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined;
|
32
38
|
applyToColumns(children: ReactNode, transformer: (column: ReactElement<TableColumnProps<T, TId, P, PId>>) => ReactElement<TableColumnProps<T, TId, P, PId>>): ReactNode;
|
33
39
|
handleHeaderSelectionChange: (ev: TableHeaderSelectionChangeEvent) => void;
|
package/dist/table.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,SAAS,EAKT,SAAS,EACT,YAAY,EACZ,aAAa,EAEhB,MAAM,OAAO,CAAC;AACf,OAAO,EAGH,UAAU,I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L"}
|
package/dist/table.js
CHANGED
@@ -4,6 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
7
10
|
var __rest = (this && this.__rest) || function (s, e) {
|
8
11
|
var t = {};
|
9
12
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
@@ -27,6 +30,7 @@ import { SelectColumnCell, SelectHeaderCell, } from './select-cell/select-cell';
|
|
27
30
|
import memoizeOne from 'memoize-one';
|
28
31
|
import classNames from 'classnames';
|
29
32
|
import * as Styles from './table.module.css';
|
33
|
+
import { action, makeObservable, observable } from 'mobx';
|
30
34
|
const { text: textOperators } = kendoOperators, operators = __rest(kendoOperators, ["text"]);
|
31
35
|
operators.text = [
|
32
36
|
...textOperators.filter(o => o.operator !== 'isnull' && o.operator !== 'isnotnull'),
|
@@ -39,8 +43,32 @@ function isColumnElement(element) {
|
|
39
43
|
return elementType === TableColumn || elementType.originalType === TableColumn;
|
40
44
|
}
|
41
45
|
let Table = class Table extends Component {
|
42
|
-
constructor() {
|
43
|
-
super(
|
46
|
+
constructor(props) {
|
47
|
+
super(props);
|
48
|
+
Object.defineProperty(this, "observableScrollable", {
|
49
|
+
enumerable: true,
|
50
|
+
configurable: true,
|
51
|
+
writable: true,
|
52
|
+
value: void 0
|
53
|
+
});
|
54
|
+
Object.defineProperty(this, "observableSelectionControl", {
|
55
|
+
enumerable: true,
|
56
|
+
configurable: true,
|
57
|
+
writable: true,
|
58
|
+
value: void 0
|
59
|
+
});
|
60
|
+
Object.defineProperty(this, "observableHideSelectAll", {
|
61
|
+
enumerable: true,
|
62
|
+
configurable: true,
|
63
|
+
writable: true,
|
64
|
+
value: void 0
|
65
|
+
});
|
66
|
+
Object.defineProperty(this, "observableSelectable", {
|
67
|
+
enumerable: true,
|
68
|
+
configurable: true,
|
69
|
+
writable: true,
|
70
|
+
value: void 0
|
71
|
+
});
|
44
72
|
Object.defineProperty(this, "tableState", {
|
45
73
|
enumerable: true,
|
46
74
|
configurable: true,
|
@@ -63,7 +91,7 @@ let Table = class Table extends Component {
|
|
63
91
|
enumerable: true,
|
64
92
|
configurable: true,
|
65
93
|
writable: true,
|
66
|
-
value: observer((props) => (_jsx(SelectColumnCell, Object.assign({}, props, { isRowSelectable: this.tableState.isRowSelectable(props.dataItem), control: this.
|
94
|
+
value: observer((props) => (_jsx(SelectColumnCell, Object.assign({}, props, { isRowSelectable: this.tableState.isRowSelectable(props.dataItem), control: this.observableSelectionControl }))))
|
67
95
|
});
|
68
96
|
Object.defineProperty(this, "customCellMap", {
|
69
97
|
enumerable: true,
|
@@ -76,12 +104,12 @@ let Table = class Table extends Component {
|
|
76
104
|
configurable: true,
|
77
105
|
writable: true,
|
78
106
|
value: observer((props) => {
|
79
|
-
if (this.
|
107
|
+
if (this.observableHideSelectAll || this.tableState.selectionLimit !== Infinity) {
|
80
108
|
return null;
|
81
109
|
}
|
82
|
-
return (_jsx(SelectHeaderCell, Object.assign({}, props, { isSomeRowsSelected: this.
|
110
|
+
return (_jsx(SelectHeaderCell, Object.assign({}, props, { isSomeRowsSelected: this.observableScrollable !== 'virtual'
|
83
111
|
? this.tableState.isSomePageRowsSelected
|
84
|
-
: this.tableState.isSomeRowsSelected, control: this.
|
112
|
+
: this.tableState.isSomeRowsSelected, control: this.observableSelectionControl })));
|
85
113
|
})
|
86
114
|
});
|
87
115
|
// TODO: rid of "memoizeOne" after migration on React.FC
|
@@ -117,7 +145,7 @@ let Table = class Table extends Component {
|
|
117
145
|
writable: true,
|
118
146
|
value: (ev) => {
|
119
147
|
const checked = ev.syntheticEvent.currentTarget.checked;
|
120
|
-
if (this.
|
148
|
+
if (this.observableScrollable !== 'virtual') {
|
121
149
|
if (checked) {
|
122
150
|
this.tableState.selectPage();
|
123
151
|
}
|
@@ -217,6 +245,15 @@ let Table = class Table extends Component {
|
|
217
245
|
return CellWithTableState;
|
218
246
|
}
|
219
247
|
});
|
248
|
+
makeObservable(this);
|
249
|
+
this.observableScrollable = this.props.scrollable;
|
250
|
+
this.observableSelectionControl = this.props.selectionControl;
|
251
|
+
this.observableHideSelectAll = this.props.hideSelectAll;
|
252
|
+
}
|
253
|
+
componentDidUpdate() {
|
254
|
+
this.observableScrollable = this.props.scrollable;
|
255
|
+
this.observableSelectionControl = this.props.selectionControl;
|
256
|
+
this.observableHideSelectAll = this.props.hideSelectAll;
|
220
257
|
}
|
221
258
|
applyToColumns(children, transformer) {
|
222
259
|
return Children.map(children, child => {
|
@@ -247,8 +284,31 @@ let Table = class Table extends Component {
|
|
247
284
|
return (_a = this.props.pager) !== null && _a !== void 0 ? _a : true;
|
248
285
|
}
|
249
286
|
};
|
287
|
+
__decorate([
|
288
|
+
observable,
|
289
|
+
__metadata("design:type", Object)
|
290
|
+
], Table.prototype, "observableScrollable", void 0);
|
291
|
+
__decorate([
|
292
|
+
observable,
|
293
|
+
__metadata("design:type", Object)
|
294
|
+
], Table.prototype, "observableSelectionControl", void 0);
|
295
|
+
__decorate([
|
296
|
+
observable,
|
297
|
+
__metadata("design:type", Object)
|
298
|
+
], Table.prototype, "observableHideSelectAll", void 0);
|
299
|
+
__decorate([
|
300
|
+
observable,
|
301
|
+
__metadata("design:type", Object)
|
302
|
+
], Table.prototype, "observableSelectable", void 0);
|
303
|
+
__decorate([
|
304
|
+
action,
|
305
|
+
__metadata("design:type", Function),
|
306
|
+
__metadata("design:paramtypes", []),
|
307
|
+
__metadata("design:returntype", void 0)
|
308
|
+
], Table.prototype, "componentDidUpdate", null);
|
250
309
|
Table = __decorate([
|
251
|
-
observer
|
310
|
+
observer,
|
311
|
+
__metadata("design:paramtypes", [Object])
|
252
312
|
], Table);
|
253
313
|
export { Table };
|
254
314
|
const sanitizeExportFileName = memoizeOne((fileName) => fileName === null || fileName === void 0 ? void 0 : fileName.replace(/\.+/g, '_'));
|
package/dist/table.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../src/table.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../src/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACH,cAAc,EACd,SAAS,EACT,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,GAKX,MAAM,OAAO,CAAC;AACf,OAAO,EACH,YAAY,EACZ,KAAK,IAAI,UAAU,EAGnB,WAAW,GAOd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAU,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,EAAE,IAAI,EAAE,aAAa,KAAmB,cAAc,EAA5B,SAAS,UAAK,cAAc,EAAtD,QAAqC,CAAiB,CAAC;AAC7D,SAAS,CAAC,IAAI,GAAG;IACb,GAAG,aAAa,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C,CACjC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@servicetitan/table",
|
3
|
-
"version": "26.
|
3
|
+
"version": "26.3.0",
|
4
4
|
"description": "",
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/table",
|
6
6
|
"repository": {
|
@@ -32,35 +32,35 @@
|
|
32
32
|
"@progress/kendo-react-pdf": "^5.5.0",
|
33
33
|
"@progress/kendo-react-popup": "^5.5.0",
|
34
34
|
"@progress/kendo-react-treeview": "^5.5.0",
|
35
|
-
"@servicetitan/react-hooks": "^4.
|
35
|
+
"@servicetitan/react-hooks": "^4.2.0",
|
36
36
|
"classnames": "~2.3.1",
|
37
37
|
"memoize-one": "~6.0.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@servicetitan/data-query": "^26.
|
40
|
+
"@servicetitan/data-query": "^26.3.0",
|
41
41
|
"@servicetitan/design-system": "~13.4.5",
|
42
|
-
"@servicetitan/form": "^26.
|
42
|
+
"@servicetitan/form": "^26.3.0",
|
43
43
|
"@servicetitan/react-ioc": "^23.2.1",
|
44
44
|
"@servicetitan/suppress-warnings": "^23.2.1",
|
45
45
|
"@types/accounting": "~0.4.2",
|
46
46
|
"@types/react": "~18.2.55",
|
47
47
|
"accounting": "~0.4.1",
|
48
48
|
"formstate": "~2.1.0",
|
49
|
-
"mobx": "~6.
|
50
|
-
"mobx-react": "~
|
49
|
+
"mobx": "~6.10.2",
|
50
|
+
"mobx-react": "~9.0.2",
|
51
51
|
"mobx-utils": "~6.0.5",
|
52
52
|
"moment": "~2.29.3",
|
53
53
|
"react": "~18.2.0"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|
56
|
-
"@servicetitan/data-query": "^26.
|
56
|
+
"@servicetitan/data-query": "^26.3.0",
|
57
57
|
"@servicetitan/design-system": ">=12.4.1",
|
58
|
-
"@servicetitan/form": "^26.
|
58
|
+
"@servicetitan/form": "^26.3.0",
|
59
59
|
"@servicetitan/react-ioc": ">21.0.0",
|
60
60
|
"@servicetitan/suppress-warnings": ">21.0.0",
|
61
61
|
"accounting": "~0.4.1",
|
62
62
|
"formstate": "~2.1.0",
|
63
|
-
"mobx": "
|
63
|
+
"mobx": ">=6.6.0",
|
64
64
|
"mobx-react": ">=7.5.1",
|
65
65
|
"mobx-utils": "~6.0.5",
|
66
66
|
"moment": "~2.29.3",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"cli": {
|
73
73
|
"webpack": false
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "f2d53e9b8f0a73cfc2c9286dac5ba6c0d7c41332"
|
76
76
|
}
|
@@ -44,7 +44,7 @@ export function fieldValuesColumnMenuFilter<T, TId extends IdType = never>(
|
|
44
44
|
});
|
45
45
|
}
|
46
46
|
|
47
|
-
|
47
|
+
get field() {
|
48
48
|
const field = this.props.field;
|
49
49
|
|
50
50
|
if (field === undefined) {
|
@@ -54,7 +54,7 @@ export function fieldValuesColumnMenuFilter<T, TId extends IdType = never>(
|
|
54
54
|
return field as keyof T;
|
55
55
|
}
|
56
56
|
|
57
|
-
|
57
|
+
get value(): T[keyof T][] {
|
58
58
|
return this.props.value || [];
|
59
59
|
}
|
60
60
|
|
package/src/table.tsx
CHANGED
@@ -39,6 +39,7 @@ import memoizeOne from 'memoize-one';
|
|
39
39
|
|
40
40
|
import classNames from 'classnames';
|
41
41
|
import * as Styles from './table.module.css';
|
42
|
+
import { action, makeObservable, observable } from 'mobx';
|
42
43
|
|
43
44
|
const { text: textOperators, ...operators } = kendoOperators;
|
44
45
|
operators.text = [
|
@@ -120,6 +121,11 @@ export class Table<
|
|
120
121
|
P = never,
|
121
122
|
PId extends IdType = never
|
122
123
|
> extends Component<TableProps<T, TId, P, PId>> {
|
124
|
+
@observable observableScrollable: TableProps<T, TId, P, PId>['scrollable'];
|
125
|
+
@observable observableSelectionControl: TableProps<T, TId, P, PId>['selectionControl'];
|
126
|
+
@observable observableHideSelectAll: TableProps<T, TId, P, PId>['hideSelectAll'];
|
127
|
+
@observable observableSelectable: TableProps<T, TId, P, PId>['selectable'];
|
128
|
+
|
123
129
|
private tableState = this.props.tableState;
|
124
130
|
|
125
131
|
private ref = createRef<HTMLElement>();
|
@@ -130,14 +136,14 @@ export class Table<
|
|
130
136
|
<SelectColumnCell
|
131
137
|
{...props}
|
132
138
|
isRowSelectable={this.tableState.isRowSelectable(props.dataItem)}
|
133
|
-
control={this.
|
139
|
+
control={this.observableSelectionControl}
|
134
140
|
/>
|
135
141
|
));
|
136
142
|
|
137
143
|
private customCellMap = new Map<string, FC<TableCellProps<T, TId, P, PId>>>();
|
138
144
|
|
139
145
|
private selectHeaderCell: FC<TableHeaderCellProps> = observer((props: TableHeaderCellProps) => {
|
140
|
-
if (this.
|
146
|
+
if (this.observableHideSelectAll || this.tableState.selectionLimit !== Infinity) {
|
141
147
|
return null;
|
142
148
|
}
|
143
149
|
|
@@ -145,11 +151,11 @@ export class Table<
|
|
145
151
|
<SelectHeaderCell
|
146
152
|
{...props}
|
147
153
|
isSomeRowsSelected={
|
148
|
-
this.
|
154
|
+
this.observableScrollable !== 'virtual'
|
149
155
|
? this.tableState.isSomePageRowsSelected
|
150
156
|
: this.tableState.isSomeRowsSelected
|
151
157
|
}
|
152
|
-
control={this.
|
158
|
+
control={this.observableSelectionControl}
|
153
159
|
/>
|
154
160
|
);
|
155
161
|
});
|
@@ -165,6 +171,23 @@ export class Table<
|
|
165
171
|
})
|
166
172
|
);
|
167
173
|
|
174
|
+
constructor(props: TableProps<T, TId, P, PId>) {
|
175
|
+
super(props);
|
176
|
+
|
177
|
+
makeObservable(this);
|
178
|
+
|
179
|
+
this.observableScrollable = this.props.scrollable;
|
180
|
+
this.observableSelectionControl = this.props.selectionControl;
|
181
|
+
this.observableHideSelectAll = this.props.hideSelectAll;
|
182
|
+
}
|
183
|
+
|
184
|
+
@action
|
185
|
+
componentDidUpdate() {
|
186
|
+
this.observableScrollable = this.props.scrollable;
|
187
|
+
this.observableSelectionControl = this.props.selectionControl;
|
188
|
+
this.observableHideSelectAll = this.props.hideSelectAll;
|
189
|
+
}
|
190
|
+
|
168
191
|
rowRender = (row: ReactElement, rowProps: TableRowProps) => {
|
169
192
|
const overrides: typeof row.props = {};
|
170
193
|
|
@@ -206,7 +229,7 @@ export class Table<
|
|
206
229
|
handleHeaderSelectionChange = (ev: TableHeaderSelectionChangeEvent) => {
|
207
230
|
const checked = ev.syntheticEvent.currentTarget.checked;
|
208
231
|
|
209
|
-
if (this.
|
232
|
+
if (this.observableScrollable !== 'virtual') {
|
210
233
|
if (checked) {
|
211
234
|
this.tableState.selectPage();
|
212
235
|
} else {
|