@servicetitan/table 21.7.2 → 22.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +566 -0
- package/package.json +10 -10
- package/src/select-cell/select-cell.tsx +44 -16
- package/dist/demo/index.d.ts +0 -4
- package/dist/demo/index.d.ts.map +0 -1
- package/dist/demo/index.js +0 -4
- package/dist/demo/index.js.map +0 -1
- package/dist/demo/master-detail/detail-table.d.ts +0 -4
- package/dist/demo/master-detail/detail-table.d.ts.map +0 -1
- package/dist/demo/master-detail/detail-table.js +0 -28
- package/dist/demo/master-detail/detail-table.js.map +0 -1
- package/dist/demo/master-detail/detail-table.store.d.ts +0 -14
- package/dist/demo/master-detail/detail-table.store.d.ts.map +0 -1
- package/dist/demo/master-detail/detail-table.store.js +0 -104
- package/dist/demo/master-detail/detail-table.store.js.map +0 -1
- package/dist/demo/master-detail/index.d.ts +0 -2
- package/dist/demo/master-detail/index.d.ts.map +0 -1
- package/dist/demo/master-detail/index.js +0 -2
- package/dist/demo/master-detail/index.js.map +0 -1
- package/dist/demo/master-detail/master-table.store.d.ts +0 -14
- package/dist/demo/master-detail/master-table.store.d.ts.map +0 -1
- package/dist/demo/master-detail/master-table.store.js +0 -103
- package/dist/demo/master-detail/master-table.store.js.map +0 -1
- package/dist/demo/master-detail/product-detail.d.ts +0 -8
- package/dist/demo/master-detail/product-detail.d.ts.map +0 -1
- package/dist/demo/master-detail/product-detail.js +0 -2
- package/dist/demo/master-detail/product-detail.js.map +0 -1
- package/dist/demo/master-detail/product-details.d.ts +0 -3
- package/dist/demo/master-detail/product-details.d.ts.map +0 -1
- package/dist/demo/master-detail/product-details.js +0 -55
- package/dist/demo/master-detail/product-details.js.map +0 -1
- package/dist/demo/master-detail/product.d.ts +0 -26
- package/dist/demo/master-detail/product.d.ts.map +0 -1
- package/dist/demo/master-detail/product.js +0 -16
- package/dist/demo/master-detail/product.js.map +0 -1
- package/dist/demo/master-detail/products.d.ts +0 -3
- package/dist/demo/master-detail/products.d.ts.map +0 -1
- package/dist/demo/master-detail/products.js +0 -117
- package/dist/demo/master-detail/products.js.map +0 -1
- package/dist/demo/master-detail/table-master-detail.d.ts +0 -3
- package/dist/demo/master-detail/table-master-detail.d.ts.map +0 -1
- package/dist/demo/master-detail/table-master-detail.js +0 -24
- package/dist/demo/master-detail/table-master-detail.js.map +0 -1
- package/dist/demo/overview/actions-cell.d.ts +0 -5
- package/dist/demo/overview/actions-cell.d.ts.map +0 -1
- package/dist/demo/overview/actions-cell.js +0 -38
- package/dist/demo/overview/actions-cell.js.map +0 -1
- package/dist/demo/overview/index.d.ts +0 -2
- package/dist/demo/overview/index.d.ts.map +0 -1
- package/dist/demo/overview/index.js +0 -2
- package/dist/demo/overview/index.js.map +0 -1
- package/dist/demo/overview/product.d.ts +0 -27
- package/dist/demo/overview/product.d.ts.map +0 -1
- package/dist/demo/overview/product.js +0 -16
- package/dist/demo/overview/product.js.map +0 -1
- package/dist/demo/overview/products.d.ts +0 -3
- package/dist/demo/overview/products.d.ts.map +0 -1
- package/dist/demo/overview/products.js +0 -127
- package/dist/demo/overview/products.js.map +0 -1
- package/dist/demo/overview/table.d.ts +0 -6
- package/dist/demo/overview/table.d.ts.map +0 -1
- package/dist/demo/overview/table.js +0 -44
- package/dist/demo/overview/table.js.map +0 -1
- package/dist/demo/overview/table.store.d.ts +0 -15
- package/dist/demo/overview/table.store.d.ts.map +0 -1
- package/dist/demo/overview/table.store.js +0 -92
- package/dist/demo/overview/table.store.js.map +0 -1
- package/dist/demo/state-caching/beverages.d.ts +0 -3
- package/dist/demo/state-caching/beverages.d.ts.map +0 -1
- package/dist/demo/state-caching/beverages.js +0 -48
- package/dist/demo/state-caching/beverages.js.map +0 -1
- package/dist/demo/state-caching/index.d.ts +0 -2
- package/dist/demo/state-caching/index.d.ts.map +0 -1
- package/dist/demo/state-caching/index.js +0 -2
- package/dist/demo/state-caching/index.js.map +0 -1
- package/dist/demo/state-caching/product.d.ts +0 -6
- package/dist/demo/state-caching/product.d.ts.map +0 -1
- package/dist/demo/state-caching/product.js +0 -2
- package/dist/demo/state-caching/product.js.map +0 -1
- package/dist/demo/state-caching/products.d.ts +0 -3
- package/dist/demo/state-caching/products.d.ts.map +0 -1
- package/dist/demo/state-caching/products.js +0 -53
- package/dist/demo/state-caching/products.js.map +0 -1
- package/dist/demo/state-caching/state-caching-table.d.ts +0 -3
- package/dist/demo/state-caching/state-caching-table.d.ts.map +0 -1
- package/dist/demo/state-caching/state-caching-table.js +0 -14
- package/dist/demo/state-caching/state-caching-table.js.map +0 -1
- package/dist/demo/state-caching/state-caching-table.store.d.ts +0 -13
- package/dist/demo/state-caching/state-caching-table.store.d.ts.map +0 -1
- package/dist/demo/state-caching/state-caching-table.store.js +0 -70
- package/dist/demo/state-caching/state-caching-table.store.js.map +0 -1
- package/dist/editable-cell/boolean-editable-cell.d.ts +0 -3
- package/dist/editable-cell/boolean-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/boolean-editable-cell.js +0 -14
- package/dist/editable-cell/boolean-editable-cell.js.map +0 -1
- package/dist/editable-cell/date-editable-cell.d.ts +0 -3
- package/dist/editable-cell/date-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/date-editable-cell.js +0 -14
- package/dist/editable-cell/date-editable-cell.js.map +0 -1
- package/dist/editable-cell/get-action-cell.d.ts +0 -13
- package/dist/editable-cell/get-action-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-action-cell.js +0 -18
- package/dist/editable-cell/get-action-cell.js.map +0 -1
- package/dist/editable-cell/get-editable-cell.d.ts +0 -13
- package/dist/editable-cell/get-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-editable-cell.js +0 -18
- package/dist/editable-cell/get-editable-cell.js.map +0 -1
- package/dist/editable-cell/get-select-editable-cell.d.ts +0 -10
- package/dist/editable-cell/get-select-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-select-editable-cell.js +0 -19
- package/dist/editable-cell/get-select-editable-cell.js.map +0 -1
- package/dist/editable-cell/index.d.ts +0 -8
- package/dist/editable-cell/index.d.ts.map +0 -1
- package/dist/editable-cell/index.js +0 -8
- package/dist/editable-cell/index.js.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.d.ts +0 -3
- package/dist/editable-cell/numeric-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.js +0 -15
- package/dist/editable-cell/numeric-editable-cell.js.map +0 -1
- package/dist/editable-cell/text-editable-cell.d.ts +0 -9
- package/dist/editable-cell/text-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/text-editable-cell.js +0 -20
- package/dist/editable-cell/text-editable-cell.js.map +0 -1
- package/dist/export/export.d.ts +0 -10
- package/dist/export/export.d.ts.map +0 -1
- package/dist/export/export.js +0 -6
- package/dist/export/export.js.map +0 -1
- package/dist/export/index.d.ts +0 -2
- package/dist/export/index.d.ts.map +0 -1
- package/dist/export/index.js +0 -2
- package/dist/export/index.js.map +0 -1
- package/dist/filters/column-menu-filters.d.ts +0 -5
- package/dist/filters/column-menu-filters.d.ts.map +0 -1
- package/dist/filters/column-menu-filters.js +0 -9
- package/dist/filters/column-menu-filters.js.map +0 -1
- package/dist/filters/datetime-filter/datetime-filter.d.ts +0 -3
- package/dist/filters/datetime-filter/datetime-filter.d.ts.map +0 -1
- package/dist/filters/datetime-filter/datetime-filter.js +0 -71
- package/dist/filters/datetime-filter/datetime-filter.js.map +0 -1
- package/dist/filters/field-values-filter.d.ts +0 -6
- package/dist/filters/field-values-filter.d.ts.map +0 -1
- package/dist/filters/field-values-filter.js +0 -155
- package/dist/filters/field-values-filter.js.map +0 -1
- package/dist/filters/index.d.ts +0 -9
- package/dist/filters/index.d.ts.map +0 -1
- package/dist/filters/index.js +0 -9
- package/dist/filters/index.js.map +0 -1
- package/dist/filters/multiselect-filter.d.ts +0 -5
- package/dist/filters/multiselect-filter.d.ts.map +0 -1
- package/dist/filters/multiselect-filter.js +0 -107
- package/dist/filters/multiselect-filter.js.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts +0 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +0 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +0 -3
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +0 -27
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +0 -1
- package/dist/filters/range-filter/range-filter.d.ts +0 -6
- package/dist/filters/range-filter/range-filter.d.ts.map +0 -1
- package/dist/filters/range-filter/range-filter.js +0 -117
- package/dist/filters/range-filter/range-filter.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts +0 -21
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +0 -82
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts +0 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +0 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts +0 -26
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +0 -69
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts +0 -6
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +0 -30
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +0 -1
- package/dist/filters/time-filter/time-filter.d.ts +0 -3
- package/dist/filters/time-filter/time-filter.d.ts.map +0 -1
- package/dist/filters/time-filter/time-filter.js +0 -71
- package/dist/filters/time-filter/time-filter.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/select-cell/index.d.ts +0 -2
- package/dist/select-cell/index.d.ts.map +0 -1
- package/dist/select-cell/index.js +0 -2
- package/dist/select-cell/index.js.map +0 -1
- package/dist/select-cell/select-cell.d.ts +0 -25
- package/dist/select-cell/select-cell.d.ts.map +0 -1
- package/dist/select-cell/select-cell.js +0 -35
- package/dist/select-cell/select-cell.js.map +0 -1
- package/dist/table-state.d.ts +0 -161
- package/dist/table-state.d.ts.map +0 -1
- package/dist/table-state.js +0 -1106
- package/dist/table-state.js.map +0 -1
- package/dist/table.d.ts +0 -40
- package/dist/table.d.ts.map +0 -1
- package/dist/table.js +0 -231
- package/dist/table.js.map +0 -1
@@ -1,117 +0,0 @@
|
|
1
|
-
import { UserRole, Supplier } from './product';
|
2
|
-
export const products = [
|
3
|
-
{
|
4
|
-
ProductID: 1,
|
5
|
-
ProductName: 'Chai',
|
6
|
-
Supplier: Supplier.Dan,
|
7
|
-
CategoryID: 1,
|
8
|
-
QuantityPerUnit: '10 boxes x 20 bags',
|
9
|
-
UnitPrice: 18.0,
|
10
|
-
UnitsInStock: 39,
|
11
|
-
UnitsOnOrder: new Date('1/11/2019'),
|
12
|
-
Discontinued: false,
|
13
|
-
AvailableFor: UserRole.Admin,
|
14
|
-
},
|
15
|
-
{
|
16
|
-
ProductID: 2,
|
17
|
-
ProductName: 'Chang',
|
18
|
-
Supplier: Supplier.Dan,
|
19
|
-
CategoryID: 1,
|
20
|
-
QuantityPerUnit: '24 - 12 oz bottles',
|
21
|
-
UnitPrice: 19.0,
|
22
|
-
UnitsInStock: 17,
|
23
|
-
UnitsOnOrder: new Date('2/11/2019'),
|
24
|
-
Discontinued: false,
|
25
|
-
},
|
26
|
-
{
|
27
|
-
ProductID: 3,
|
28
|
-
ProductName: 'Aniseed Syrup',
|
29
|
-
Supplier: Supplier.Dan,
|
30
|
-
CategoryID: 2,
|
31
|
-
QuantityPerUnit: '12 - 550 ml bottles',
|
32
|
-
UnitPrice: 10.0,
|
33
|
-
UnitsInStock: 13,
|
34
|
-
UnitsOnOrder: new Date('3/11/2019'),
|
35
|
-
Discontinued: false,
|
36
|
-
AvailableFor: UserRole.Owner,
|
37
|
-
},
|
38
|
-
{
|
39
|
-
ProductID: 4,
|
40
|
-
ProductName: "Chef Anton's Cajun Seasoning",
|
41
|
-
Supplier: Supplier.Adam,
|
42
|
-
CategoryID: 2,
|
43
|
-
QuantityPerUnit: '48 - 6 oz jars',
|
44
|
-
UnitPrice: 22.0,
|
45
|
-
UnitsInStock: 53,
|
46
|
-
UnitsOnOrder: new Date('4/11/2019'),
|
47
|
-
Discontinued: false,
|
48
|
-
},
|
49
|
-
{
|
50
|
-
ProductID: 5,
|
51
|
-
ProductName: "Chef Anton's Gumbo Mix",
|
52
|
-
Supplier: Supplier.Adam,
|
53
|
-
CategoryID: 2,
|
54
|
-
QuantityPerUnit: '36 boxes',
|
55
|
-
UnitPrice: 21.35,
|
56
|
-
UnitsInStock: 0,
|
57
|
-
UnitsOnOrder: new Date('5/11/2019'),
|
58
|
-
Discontinued: true,
|
59
|
-
AvailableFor: UserRole.GeneralOffice,
|
60
|
-
},
|
61
|
-
{
|
62
|
-
ProductID: 6,
|
63
|
-
ProductName: "Grandma's Boysenberry Spread",
|
64
|
-
Supplier: Supplier.Charlie,
|
65
|
-
CategoryID: 2,
|
66
|
-
QuantityPerUnit: '12 - 8 oz jars',
|
67
|
-
UnitPrice: 25.0,
|
68
|
-
UnitsInStock: 120,
|
69
|
-
UnitsOnOrder: new Date('6/11/2019'),
|
70
|
-
Discontinued: false,
|
71
|
-
},
|
72
|
-
{
|
73
|
-
ProductID: 7,
|
74
|
-
ProductName: "Uncle Bob's Organic Dried Pears",
|
75
|
-
Supplier: Supplier.Charlie,
|
76
|
-
CategoryID: 7,
|
77
|
-
QuantityPerUnit: '12 - 1 lb pkgs.',
|
78
|
-
UnitPrice: 30.0,
|
79
|
-
UnitsInStock: 15,
|
80
|
-
UnitsOnOrder: new Date('7/11/2019'),
|
81
|
-
Discontinued: false,
|
82
|
-
},
|
83
|
-
{
|
84
|
-
ProductID: 8,
|
85
|
-
ProductName: 'Northwoods Cranberry Sauce',
|
86
|
-
Supplier: Supplier.Charlie,
|
87
|
-
CategoryID: 2,
|
88
|
-
QuantityPerUnit: '12 - 12 oz jars',
|
89
|
-
UnitPrice: 40.0,
|
90
|
-
UnitsInStock: 6,
|
91
|
-
UnitsOnOrder: new Date('8/11/2019'),
|
92
|
-
Discontinued: false,
|
93
|
-
},
|
94
|
-
{
|
95
|
-
ProductID: 9,
|
96
|
-
ProductName: 'Mishi Kobe Niku',
|
97
|
-
Supplier: Supplier.Benjamin,
|
98
|
-
CategoryID: 6,
|
99
|
-
QuantityPerUnit: '18 - 500 g pkgs.',
|
100
|
-
UnitPrice: 97.0,
|
101
|
-
UnitsInStock: 29,
|
102
|
-
UnitsOnOrder: new Date('9/11/2019'),
|
103
|
-
Discontinued: true,
|
104
|
-
},
|
105
|
-
{
|
106
|
-
ProductID: 10,
|
107
|
-
ProductName: 'Ikura',
|
108
|
-
Supplier: Supplier.Benjamin,
|
109
|
-
CategoryID: 8,
|
110
|
-
QuantityPerUnit: '12 - 200 ml jars',
|
111
|
-
UnitPrice: 31.0,
|
112
|
-
UnitsInStock: 31,
|
113
|
-
UnitsOnOrder: new Date('10/11/2019'),
|
114
|
-
Discontinued: false,
|
115
|
-
},
|
116
|
-
];
|
117
|
-
//# sourceMappingURL=products.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/demo/master-detail/products.ts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AC3B,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,kBAAkB;QACnC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QACnC,YAAY,EAAE,IAAI;KACrB;IACD;QACI,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,kBAAkB;QACnC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;QACpC,YAAY,EAAE,KAAK;KACtB;CACJ,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table-master-detail.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/table-master-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,EAAE,EAAE,MAAM,OAAO,CAAC;AA6BtC,eAAO,MAAM,wBAAwB,EAAE,EAgBrC,CAAC"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useEffect } from 'react';
|
3
|
-
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
4
|
-
import { Button } from '@servicetitan/design-system';
|
5
|
-
import { Table, TableColumn } from '../..';
|
6
|
-
import { MasterTableStore } from './master-table.store';
|
7
|
-
import { DetailTable } from './detail-table';
|
8
|
-
const ExpandCell = ({ tableState, dataItem }) => {
|
9
|
-
const handleExpandChange = () => {
|
10
|
-
tableState.handleExpandChange({
|
11
|
-
dataItem,
|
12
|
-
value: !dataItem.expanded,
|
13
|
-
});
|
14
|
-
};
|
15
|
-
return (_jsx("td", { children: _jsx(Button, Object.assign({ full: true, text: true, primary: true, onClick: handleExpandChange }, { children: "Show / Hide" })) }));
|
16
|
-
};
|
17
|
-
export const TableMasterDetailExample = provide({
|
18
|
-
singletons: [MasterTableStore],
|
19
|
-
})(() => {
|
20
|
-
const [store] = useDependencies(MasterTableStore);
|
21
|
-
useEffect(() => () => store.dispose());
|
22
|
-
return (_jsxs(Table, Object.assign({ tableState: store.tableState, selectable: true, detail: DetailTable }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name" }), _jsx(TableColumn, { cell: ExpandCell, width: "150px" })] })));
|
23
|
-
});
|
24
|
-
//# sourceMappingURL=table-master-detail.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table-master-detail.js","sourceRoot":"","sources":["../../../src/demo/master-detail/table-master-detail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAM,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,WAAW,EAA0C,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,GAAuB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChE,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC5B,UAAW,CAAC,kBAAkB,CAAC;YAC3B,QAAQ;YACR,KAAK,EAAE,CAAC,QAAQ,CAAC,QAAQ;SACF,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,OAAO,CACH,uBACI,KAAC,MAAM,kBAAC,IAAI,QAAC,IAAI,QAAC,OAAO,QAAC,OAAO,EAAE,kBAAkB,iCAE5C,GACR,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAO,OAAO,CAAC;IAChD,UAAU,EAAE,CAAC,gBAAgB,CAAC;CACjC,CAAC,CAAC,GAAG,EAAE;IACJ,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAEvC,OAAO,CACH,MAAC,KAAK,kBAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,QAAC,MAAM,EAAE,WAAW,iBAC/D,KAAC,WAAW,IAAC,KAAK,EAAC,WAAW,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,GAAG,EAE1D,KAAC,WAAW,IAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,cAAc,GAAG,EAExD,KAAC,WAAW,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,OAAO,GAAG,KAC3C,CACX,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"actions-cell.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/actions-cell.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,cAAc,EAAkC,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiDpC,eAAO,MAAM,WAAW,oEAGtB,CAAC"}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
-
import { Button, Icon, Stack } from '@servicetitan/design-system';
|
12
|
-
import { getActionCell } from '../..';
|
13
|
-
const ViewAction = ({ tableState, dataItem }) => {
|
14
|
-
if (!tableState) {
|
15
|
-
return _jsx("td", {});
|
16
|
-
}
|
17
|
-
const edit = () => tableState.edit(dataItem);
|
18
|
-
return (_jsx("td", { children: _jsx(Button, Object.assign({ text: true, primary: true, onClick: edit }, { children: _jsx(Icon, { name: "edit" }) })) }));
|
19
|
-
};
|
20
|
-
const EditAction = ({ tableState, formState, dataItem }) => {
|
21
|
-
if (!tableState) {
|
22
|
-
return _jsx("td", {});
|
23
|
-
}
|
24
|
-
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
const { hasError } = yield formState.validate();
|
26
|
-
if (hasError) {
|
27
|
-
return;
|
28
|
-
}
|
29
|
-
yield tableState.saveEdit(dataItem);
|
30
|
-
});
|
31
|
-
const cancel = () => tableState.cancelEdit(dataItem);
|
32
|
-
return (_jsx("td", { children: _jsxs(Stack, Object.assign({ justifyContent: "space-between" }, { children: [_jsx(Button, Object.assign({ text: true, onClick: cancel }, { children: _jsx(Icon, { name: "do_not_disturb" }) })), _jsx(Button, Object.assign({ text: true, primary: true, onClick: save }, { children: _jsx(Icon, { name: "done" }) }))] })) }));
|
33
|
-
};
|
34
|
-
export const ActionsCell = getActionCell({
|
35
|
-
view: ViewAction,
|
36
|
-
edit: EditAction,
|
37
|
-
});
|
38
|
-
//# sourceMappingURL=actions-cell.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"actions-cell.js","sourceRoot":"","sources":["../../../src/demo/overview/actions-cell.tsx"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAkB,aAAa,EAAmB,MAA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AAG,aAAa,CAAC;IACrC,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;CACnB,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/overview/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
export declare enum UserRole {
|
2
|
-
Unspecified = 0,
|
3
|
-
Technician = 1,
|
4
|
-
GeneralOffice = 2,
|
5
|
-
Admin = 3,
|
6
|
-
Owner = 4
|
7
|
-
}
|
8
|
-
export declare enum Supplier {
|
9
|
-
Dan = 1,
|
10
|
-
Adam = 2,
|
11
|
-
Charlie = 3,
|
12
|
-
Benjamin = 4
|
13
|
-
}
|
14
|
-
export interface Product {
|
15
|
-
ProductID: number;
|
16
|
-
ProductName: string;
|
17
|
-
Supplier: Supplier;
|
18
|
-
CategoryID: number;
|
19
|
-
MadeIn: string;
|
20
|
-
QuantityPerUnit: string;
|
21
|
-
UnitPrice: number;
|
22
|
-
UnitsInStock: number;
|
23
|
-
UnitsOnOrder: Date;
|
24
|
-
Discontinued: boolean;
|
25
|
-
AvailableFor?: UserRole;
|
26
|
-
}
|
27
|
-
//# sourceMappingURL=product.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/product.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,WAAW,IAAA;IACX,UAAU,IAAA;IACV,aAAa,IAAA;IACb,KAAK,IAAA;IACL,KAAK,IAAA;CACR;AAED,oBAAY,QAAQ;IAChB,GAAG,IAAI;IACP,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,QAAQ,IAAA;CACX;AAED,MAAM,WAAW,OAAO;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,IAAI,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
export var UserRole;
|
2
|
-
(function (UserRole) {
|
3
|
-
UserRole[UserRole["Unspecified"] = 0] = "Unspecified";
|
4
|
-
UserRole[UserRole["Technician"] = 1] = "Technician";
|
5
|
-
UserRole[UserRole["GeneralOffice"] = 2] = "GeneralOffice";
|
6
|
-
UserRole[UserRole["Admin"] = 3] = "Admin";
|
7
|
-
UserRole[UserRole["Owner"] = 4] = "Owner";
|
8
|
-
})(UserRole || (UserRole = {}));
|
9
|
-
export var Supplier;
|
10
|
-
(function (Supplier) {
|
11
|
-
Supplier[Supplier["Dan"] = 1] = "Dan";
|
12
|
-
Supplier[Supplier["Adam"] = 2] = "Adam";
|
13
|
-
Supplier[Supplier["Charlie"] = 3] = "Charlie";
|
14
|
-
Supplier[Supplier["Benjamin"] = 4] = "Benjamin";
|
15
|
-
})(Supplier || (Supplier = {}));
|
16
|
-
//# sourceMappingURL=product.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/demo/overview/product.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,qDAAW,CAAA;IACX,mDAAU,CAAA;IACV,yDAAa,CAAA;IACb,yCAAK,CAAA;IACL,yCAAK,CAAA;AACT,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,qCAAO,CAAA;IACP,uCAAI,CAAA;IACJ,6CAAO,CAAA;IACP,+CAAQ,CAAA;AACZ,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,WAAW,CAAC;AAExD,eAAO,MAAM,QAAQ,EAAE,OAAO,EA4H7B,CAAC"}
|
@@ -1,127 +0,0 @@
|
|
1
|
-
import { UserRole, Supplier } from './product';
|
2
|
-
export const products = [
|
3
|
-
{
|
4
|
-
ProductID: 1,
|
5
|
-
ProductName: 'Chai',
|
6
|
-
Supplier: Supplier.Dan,
|
7
|
-
CategoryID: 1,
|
8
|
-
MadeIn: 'China',
|
9
|
-
QuantityPerUnit: '10 boxes x 20 bags',
|
10
|
-
UnitPrice: 18.0,
|
11
|
-
UnitsInStock: 39,
|
12
|
-
UnitsOnOrder: new Date('1/11/2019'),
|
13
|
-
Discontinued: false,
|
14
|
-
AvailableFor: UserRole.Admin,
|
15
|
-
},
|
16
|
-
{
|
17
|
-
ProductID: 2,
|
18
|
-
ProductName: 'Chang',
|
19
|
-
Supplier: Supplier.Dan,
|
20
|
-
CategoryID: 1,
|
21
|
-
MadeIn: 'Thailand',
|
22
|
-
QuantityPerUnit: '24 - 12 oz bottles',
|
23
|
-
UnitPrice: 19.0,
|
24
|
-
UnitsInStock: 17,
|
25
|
-
UnitsOnOrder: new Date('2/11/2019'),
|
26
|
-
Discontinued: false,
|
27
|
-
},
|
28
|
-
{
|
29
|
-
ProductID: 3,
|
30
|
-
ProductName: 'Aniseed Syrup',
|
31
|
-
Supplier: Supplier.Dan,
|
32
|
-
CategoryID: 2,
|
33
|
-
MadeIn: 'France',
|
34
|
-
QuantityPerUnit: '12 - 550 ml bottles',
|
35
|
-
UnitPrice: 10.0,
|
36
|
-
UnitsInStock: 13,
|
37
|
-
UnitsOnOrder: new Date('3/11/2019'),
|
38
|
-
Discontinued: false,
|
39
|
-
AvailableFor: UserRole.Owner,
|
40
|
-
},
|
41
|
-
{
|
42
|
-
ProductID: 4,
|
43
|
-
ProductName: "Chef Anton's Cajun Seasoning",
|
44
|
-
Supplier: Supplier.Adam,
|
45
|
-
CategoryID: 2,
|
46
|
-
MadeIn: 'USA',
|
47
|
-
QuantityPerUnit: '48 - 6 oz jars',
|
48
|
-
UnitPrice: 22.0,
|
49
|
-
UnitsInStock: 53,
|
50
|
-
UnitsOnOrder: new Date('4/11/2019'),
|
51
|
-
Discontinued: false,
|
52
|
-
},
|
53
|
-
{
|
54
|
-
ProductID: 5,
|
55
|
-
ProductName: "Chef Anton's Gumbo Mix",
|
56
|
-
Supplier: Supplier.Adam,
|
57
|
-
CategoryID: 2,
|
58
|
-
MadeIn: 'USA',
|
59
|
-
QuantityPerUnit: '36 boxes',
|
60
|
-
UnitPrice: 21.35,
|
61
|
-
UnitsInStock: 0,
|
62
|
-
UnitsOnOrder: new Date('5/11/2019'),
|
63
|
-
Discontinued: true,
|
64
|
-
AvailableFor: UserRole.GeneralOffice,
|
65
|
-
},
|
66
|
-
{
|
67
|
-
ProductID: 6,
|
68
|
-
ProductName: "Grandma's Boysenberry Spread",
|
69
|
-
Supplier: Supplier.Charlie,
|
70
|
-
CategoryID: 2,
|
71
|
-
MadeIn: 'Norway',
|
72
|
-
QuantityPerUnit: '12 - 8 oz jars',
|
73
|
-
UnitPrice: 25.0,
|
74
|
-
UnitsInStock: 120,
|
75
|
-
UnitsOnOrder: new Date('6/11/2019'),
|
76
|
-
Discontinued: false,
|
77
|
-
},
|
78
|
-
{
|
79
|
-
ProductID: 7,
|
80
|
-
ProductName: "Uncle Bob's Organic Dried Pears",
|
81
|
-
Supplier: Supplier.Charlie,
|
82
|
-
CategoryID: 7,
|
83
|
-
MadeIn: 'USA',
|
84
|
-
QuantityPerUnit: '12 - 1 lb pkgs.',
|
85
|
-
UnitPrice: 30.0,
|
86
|
-
UnitsInStock: 15,
|
87
|
-
UnitsOnOrder: new Date('7/11/2019'),
|
88
|
-
Discontinued: false,
|
89
|
-
},
|
90
|
-
{
|
91
|
-
ProductID: 8,
|
92
|
-
ProductName: 'Northwoods Cranberry Sauce',
|
93
|
-
Supplier: Supplier.Charlie,
|
94
|
-
CategoryID: 2,
|
95
|
-
MadeIn: 'Norway',
|
96
|
-
QuantityPerUnit: '12 - 12 oz jars',
|
97
|
-
UnitPrice: 40.0,
|
98
|
-
UnitsInStock: 6,
|
99
|
-
UnitsOnOrder: new Date('8/11/2019'),
|
100
|
-
Discontinued: false,
|
101
|
-
},
|
102
|
-
{
|
103
|
-
ProductID: 9,
|
104
|
-
ProductName: 'Mishi Kobe Niku',
|
105
|
-
Supplier: Supplier.Benjamin,
|
106
|
-
CategoryID: 6,
|
107
|
-
MadeIn: 'Japan',
|
108
|
-
QuantityPerUnit: '18 - 500 g pkgs.',
|
109
|
-
UnitPrice: 97.0,
|
110
|
-
UnitsInStock: 29,
|
111
|
-
UnitsOnOrder: new Date('9/11/2019'),
|
112
|
-
Discontinued: true,
|
113
|
-
},
|
114
|
-
{
|
115
|
-
ProductID: 10,
|
116
|
-
ProductName: 'Ikura',
|
117
|
-
Supplier: Supplier.Benjamin,
|
118
|
-
CategoryID: 8,
|
119
|
-
MadeIn: 'Japan',
|
120
|
-
QuantityPerUnit: '12 - 200 ml jars',
|
121
|
-
UnitPrice: 31.0,
|
122
|
-
UnitsInStock: 31,
|
123
|
-
UnitsOnOrder: new Date('10/11/2019'),
|
124
|
-
Discontinued: false,
|
125
|
-
},
|
126
|
-
];
|
127
|
-
//# sourceMappingURL=products.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/demo/overview/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,QAAQ,EAAE,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AAC;QACnC,YAAY,EAAE,KAAK;KACtB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,CAAC;QACb,MAAM,EAAE,OAAO;QACf,eAAe,EAAE,kBAAkB;QACnC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QACnC,YAAY,EAAE,IAAI;KACrB;IACD;QACI,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,CAAC;QACb,MAAM,EAAE,OAAO;QACf,eAAe,EAAE,kBAAkB;QACnC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;QACpC,YAAY,EAAE,KAAK;KACtB;CACJ,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,EAAE,EAAgB,MAAM,OAAO,CAAC;AA0D1E,MAAM,WAAW,iBAAiB;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+H9C,CAAC"}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useMemo, cloneElement, Fragment } from 'react';
|
3
|
-
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
4
|
-
import { observer } from 'mobx-react';
|
5
|
-
import { Stack, ButtonGroup, Button, Tag } from '@servicetitan/design-system';
|
6
|
-
import { Table, TableColumn, TableCell, TextEditableCell, NumericEditableCell, BooleanEditableCell, DateEditableCell, getSelectEditableCell, CurrencyRangeColumnMenuFilter, DateRangeColumnMenuFilter, StandardColumnMenuFilter, standardFilterWithMultiselect, multiSelectColumnMenuFilter, } from '../..';
|
7
|
-
import { Export } from '../../export';
|
8
|
-
import { TableStore } from './table.store';
|
9
|
-
import { ActionsCell } from './actions-cell';
|
10
|
-
import { enumToOptions, getEnumKeys } from '@servicetitan/form';
|
11
|
-
import { UserRole, Supplier } from './product';
|
12
|
-
const UserRoleColumnMenuFilter = multiSelectColumnMenuFilter(getEnumKeys(UserRole), userRole => (_jsx(Tag, Object.assign({ compact: true, color: UserRole[userRole] === UserRole.Owner ? 'success' : 'default' }, { children: userRole }))));
|
13
|
-
const AvailableForEditableCell = getSelectEditableCell({
|
14
|
-
options: enumToOptions(UserRole),
|
15
|
-
viewer: ({ dataItem, field }) => {
|
16
|
-
const value = dataItem[field];
|
17
|
-
return _jsx("td", { children: value && UserRole[value] });
|
18
|
-
},
|
19
|
-
});
|
20
|
-
const SupplierCell = props => {
|
21
|
-
const { field, dataItem, rowType } = props;
|
22
|
-
if (rowType !== 'data') {
|
23
|
-
return _jsx(TableCell, Object.assign({}, props));
|
24
|
-
}
|
25
|
-
return _jsx("td", { children: Supplier[dataItem[field]] });
|
26
|
-
};
|
27
|
-
export const TableExample = provide({
|
28
|
-
singletons: [TableStore],
|
29
|
-
})(observer((props) => {
|
30
|
-
const [{ tableState, inEdit, editAll, cancelAll, saveAll }] = useDependencies(TableStore);
|
31
|
-
const madeInColumnMenu = useMemo(() => standardFilterWithMultiselect({ tableState }), [tableState]);
|
32
|
-
const cellRender = (td, { dataItem, field }) => {
|
33
|
-
if (!td) {
|
34
|
-
return null;
|
35
|
-
}
|
36
|
-
return cloneElement(td, {
|
37
|
-
onClick: () => {
|
38
|
-
tableState.edit(dataItem, field);
|
39
|
-
},
|
40
|
-
});
|
41
|
-
};
|
42
|
-
return (_jsxs(Fragment, { children: [_jsxs(Stack, Object.assign({ justifyContent: "space-between", alignContent: "center", className: "m-b-2" }, { children: [_jsx(Export, { totalCount: tableState.totalCount, exportPdf: tableState.exportPdf, exportExcel: tableState.exportExcel }), inEdit ? (_jsxs(ButtonGroup, { children: [_jsx(Button, Object.assign({ small: true, onClick: cancelAll, className: "m-r-2" }, { children: "Cancel All" })), _jsx(Button, Object.assign({ small: true, primary: true, onClick: saveAll }, { children: "Save All" }))] })) : (_jsx(Button, Object.assign({ small: true, primary: true, onClick: editAll }, { children: "Edit All" })))] })), _jsxs(Table, Object.assign({ tableState: tableState, striped: false, selectable: true, groupable: true, sortable: true, exportable: true, exportFileName: "Table.Export.Test...File.Name.01.01.2020..~!@#$%^(*_+';", cellRender: cellRender }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", editable: false, width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name", cell: TextEditableCell, columnMenu: StandardColumnMenuFilter, width: "240px" }), _jsx(TableColumn, { field: "Supplier", title: "Supplier", cell: SupplierCell, columnMenu: StandardColumnMenuFilter, width: "150px" }), _jsx(TableColumn, { field: "MadeIn", title: "Made In", cell: TextEditableCell, columnMenu: madeInColumnMenu, width: "175px" }), _jsx(TableColumn, { field: "UnitsOnOrder", title: "First Ordered On", cell: DateEditableCell, columnMenu: DateRangeColumnMenuFilter, format: "{0:d}", width: "240px" }), _jsx(TableColumn, { field: "UnitPrice", title: "Unit Price", cell: NumericEditableCell, columnMenu: CurrencyRangeColumnMenuFilter, format: "{0:c}", width: "125px" }), _jsx(TableColumn, { field: "Discontinued", title: "Discontinued", cell: BooleanEditableCell, sortable: false, width: "125px" }), _jsx(TableColumn, { field: "AvailableFor", title: "Available For", cell: AvailableForEditableCell, columnMenu: UserRoleColumnMenuFilter, width: "240px" }), _jsx(TableColumn, Object.assign({ cell: ActionsCell, sortable: false }, (props.fixedWidthColumns ? { width: '125px' } : {})))] }))] }));
|
43
|
-
}));
|
44
|
-
//# sourceMappingURL=table.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot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,EAC5B,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,yBAAyB,EACrC,MAAM,EAAC,OAAO,EACd,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,WAAW,EACjB,KAAK,EAAC,YAAY,EAClB,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE,6BAA6B,EACzC,MAAM,EAAC,OAAO,EACd,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,KAAK,EACf,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,eAAe,EACrB,IAAI,EAAE,wBAAwB,EAC9B,UAAU,EAAE,wBAAwB,EACpC,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,kBACR,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,KAAK,IACX,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzD,KACE,IACD,CACd,CAAC;AACN,CAAC,CAAC,CACL,CAAC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { TableState } from '../..';
|
2
|
-
import { Product } from './product';
|
3
|
-
export declare class TableStore {
|
4
|
-
tableState: TableState<Product, number, never, never>;
|
5
|
-
constructor();
|
6
|
-
get inEdit(): boolean;
|
7
|
-
editAll: () => Promise<void>;
|
8
|
-
saveAll: () => Promise<void>;
|
9
|
-
cancelAll: () => void;
|
10
|
-
private getDataSource;
|
11
|
-
private idSelector;
|
12
|
-
private isRowUnselectable;
|
13
|
-
private getFormState;
|
14
|
-
}
|
15
|
-
//# sourceMappingURL=table.store.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table.store.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/table.store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,UAAU,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAAE,OAAO,EAAsB,MAAM,WAAW,CAAC;AAGxD,qBACa,UAAU;IACnB,UAAU,4CAMP;;IAMH,IAAc,MAAM,YAEnB;IAED,OAAO,sBAAmC;IAC1C,OAAO,sBAAuC;IAC9C,SAAS,aAAyC;IAElD,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,YAAY;CAsBvB"}
|
@@ -1,92 +0,0 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
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
|
-
};
|
10
|
-
import { injectable } from '@servicetitan/react-ioc';
|
11
|
-
import { computed, makeObservable } from 'mobx';
|
12
|
-
import { InMemoryDataSource, TableState } from '../..';
|
13
|
-
import { setFormStateValues, FormValidators } from '@servicetitan/form';
|
14
|
-
import { FormState, FieldState } from 'formstate';
|
15
|
-
import { UserRole, Supplier } from './product';
|
16
|
-
import { products } from './products';
|
17
|
-
let TableStore = class TableStore {
|
18
|
-
constructor() {
|
19
|
-
Object.defineProperty(this, "tableState", {
|
20
|
-
enumerable: true,
|
21
|
-
configurable: true,
|
22
|
-
writable: true,
|
23
|
-
value: new TableState({
|
24
|
-
dataSource: this.getDataSource(),
|
25
|
-
isRowUnselectable: this.isRowUnselectable,
|
26
|
-
selectionLimit: 3,
|
27
|
-
getFormState: this.getFormState,
|
28
|
-
pageSize: 5,
|
29
|
-
})
|
30
|
-
});
|
31
|
-
Object.defineProperty(this, "editAll", {
|
32
|
-
enumerable: true,
|
33
|
-
configurable: true,
|
34
|
-
writable: true,
|
35
|
-
value: () => this.tableState.editAll()
|
36
|
-
});
|
37
|
-
Object.defineProperty(this, "saveAll", {
|
38
|
-
enumerable: true,
|
39
|
-
configurable: true,
|
40
|
-
writable: true,
|
41
|
-
value: () => this.tableState.saveEditAll()
|
42
|
-
});
|
43
|
-
Object.defineProperty(this, "cancelAll", {
|
44
|
-
enumerable: true,
|
45
|
-
configurable: true,
|
46
|
-
writable: true,
|
47
|
-
value: () => this.tableState.cancelEditAll()
|
48
|
-
});
|
49
|
-
makeObservable(this);
|
50
|
-
}
|
51
|
-
get inEdit() {
|
52
|
-
return this.tableState.inEdit.size > 0;
|
53
|
-
}
|
54
|
-
getDataSource() {
|
55
|
-
return new InMemoryDataSource(products, this.idSelector, {
|
56
|
-
Supplier: (value) => Supplier[value],
|
57
|
-
AvailableFor: (value) => value && UserRole[value],
|
58
|
-
});
|
59
|
-
}
|
60
|
-
idSelector(row) {
|
61
|
-
return row.ProductID;
|
62
|
-
}
|
63
|
-
isRowUnselectable(row) {
|
64
|
-
return row.Discontinued;
|
65
|
-
}
|
66
|
-
getFormState(row) {
|
67
|
-
return setFormStateValues(new FormState({
|
68
|
-
ProductID: new FieldState(0),
|
69
|
-
ProductName: new FieldState('').validators(FormValidators.required),
|
70
|
-
Supplier: new FieldState(Supplier.Adam),
|
71
|
-
CategoryID: new FieldState(0),
|
72
|
-
MadeIn: new FieldState(''),
|
73
|
-
QuantityPerUnit: new FieldState(''),
|
74
|
-
UnitPrice: new FieldState(0).validators(value => value <= 0 && 'Price must be positive'),
|
75
|
-
UnitsInStock: new FieldState(0),
|
76
|
-
UnitsOnOrder: new FieldState(new Date()).validators(value => value > new Date() && 'Invalid date'),
|
77
|
-
Discontinued: new FieldState(false),
|
78
|
-
AvailableFor: new FieldState(undefined),
|
79
|
-
}), row);
|
80
|
-
}
|
81
|
-
};
|
82
|
-
__decorate([
|
83
|
-
computed,
|
84
|
-
__metadata("design:type", Object),
|
85
|
-
__metadata("design:paramtypes", [])
|
86
|
-
], TableStore.prototype, "inEdit", null);
|
87
|
-
TableStore = __decorate([
|
88
|
-
injectable(),
|
89
|
-
__metadata("design:paramtypes", [])
|
90
|
-
], TableStore);
|
91
|
-
export { TableStore };
|
92
|
-
//# sourceMappingURL=table.store.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table.store.js","sourceRoot":"","sources":["../../../src/demo/overview/table.store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAW,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,IAAa,UAAU,GAAvB,MAAa,UAAU;IASnB;QARA;;;;mBAAa,IAAI,UAAU,CAAC;gBACxB,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE;gBAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,cAAc,EAAE,CAAC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