@servicetitan/table 19.3.0 → 20.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/demo/index.js +3 -15
- package/dist/demo/index.js.map +1 -1
- package/dist/demo/master-detail/detail-table.js +15 -18
- package/dist/demo/master-detail/detail-table.js.map +1 -1
- package/dist/demo/master-detail/detail-table.store.js +14 -17
- package/dist/demo/master-detail/detail-table.store.js.map +1 -1
- package/dist/demo/master-detail/index.js +1 -13
- package/dist/demo/master-detail/index.js.map +1 -1
- package/dist/demo/master-detail/master-table.store.js +14 -17
- package/dist/demo/master-detail/master-table.store.js.map +1 -1
- package/dist/demo/master-detail/product-detail.js +1 -2
- package/dist/demo/master-detail/product-details.js +1 -4
- package/dist/demo/master-detail/product-details.js.map +1 -1
- package/dist/demo/master-detail/product.js +4 -7
- package/dist/demo/master-detail/product.js.map +1 -1
- package/dist/demo/master-detail/products.js +15 -18
- package/dist/demo/master-detail/products.js.map +1 -1
- package/dist/demo/master-detail/table-master-detail.js +13 -16
- package/dist/demo/master-detail/table-master-detail.js.map +1 -1
- package/dist/demo/overview/actions-cell.js +8 -11
- package/dist/demo/overview/actions-cell.js.map +1 -1
- package/dist/demo/overview/index.js +1 -13
- package/dist/demo/overview/index.js.map +1 -1
- package/dist/demo/overview/product.js +4 -7
- package/dist/demo/overview/product.js.map +1 -1
- package/dist/demo/overview/products.js +15 -18
- package/dist/demo/overview/products.js.map +1 -1
- package/dist/demo/overview/table.js +24 -27
- package/dist/demo/overview/table.js.map +1 -1
- package/dist/demo/overview/table.store.js +27 -30
- package/dist/demo/overview/table.store.js.map +1 -1
- package/dist/demo/state-caching/beverages.js +1 -4
- package/dist/demo/state-caching/beverages.js.map +1 -1
- package/dist/demo/state-caching/index.js +1 -13
- package/dist/demo/state-caching/index.js.map +1 -1
- package/dist/demo/state-caching/product.js +1 -2
- package/dist/demo/state-caching/products.js +1 -4
- package/dist/demo/state-caching/products.js.map +1 -1
- package/dist/demo/state-caching/state-caching-table.js +12 -15
- package/dist/demo/state-caching/state-caching-table.js.map +1 -1
- package/dist/demo/state-caching/state-caching-table.store.js +9 -12
- package/dist/demo/state-caching/state-caching-table.store.js.map +1 -1
- package/dist/editable-cell/boolean-editable-cell.js +7 -10
- package/dist/editable-cell/boolean-editable-cell.js.map +1 -1
- package/dist/editable-cell/date-editable-cell.js +7 -10
- package/dist/editable-cell/date-editable-cell.js.map +1 -1
- package/dist/editable-cell/get-action-cell.js +6 -10
- package/dist/editable-cell/get-action-cell.js.map +1 -1
- package/dist/editable-cell/get-editable-cell.js +6 -10
- package/dist/editable-cell/get-editable-cell.js.map +1 -1
- package/dist/editable-cell/get-select-editable-cell.js +9 -16
- package/dist/editable-cell/get-select-editable-cell.js.map +1 -1
- package/dist/editable-cell/index.js +7 -19
- package/dist/editable-cell/index.js.map +1 -1
- package/dist/editable-cell/numeric-editable-cell.js +7 -10
- package/dist/editable-cell/numeric-editable-cell.js.map +1 -1
- package/dist/editable-cell/text-editable-cell.js +10 -14
- package/dist/editable-cell/text-editable-cell.js.map +1 -1
- package/dist/export/export.js +5 -28
- package/dist/export/export.js.map +1 -1
- package/dist/export/index.js +1 -13
- package/dist/export/index.js.map +1 -1
- package/dist/filters/column-menu-filters.js +7 -12
- package/dist/filters/column-menu-filters.js.map +1 -1
- package/dist/filters/datetime-filter/datetime-filter.js +17 -39
- package/dist/filters/datetime-filter/datetime-filter.js.map +1 -1
- package/dist/filters/field-values-filter.js +21 -26
- package/dist/filters/field-values-filter.js.map +1 -1
- package/dist/filters/index.js +8 -20
- package/dist/filters/index.js.map +1 -1
- package/dist/filters/multiselect-filter.js +17 -23
- package/dist/filters/multiselect-filter.js.map +1 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +2 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +1 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +13 -16
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +1 -1
- package/dist/filters/range-filter/range-filter.js +20 -45
- package/dist/filters/range-filter/range-filter.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +16 -38
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +2 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +12 -16
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +8 -12
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +1 -1
- package/dist/filters/time-filter/time-filter.js +17 -39
- package/dist/filters/time-filter/time-filter.js.map +1 -1
- package/dist/index.js +8 -29
- package/dist/index.js.map +1 -1
- package/dist/select-cell/index.js +1 -13
- package/dist/select-cell/index.js.map +1 -1
- package/dist/select-cell/select-cell.js +10 -35
- package/dist/select-cell/select-cell.js.map +1 -1
- package/dist/table-state.js +63 -68
- package/dist/table-state.js.map +1 -1
- package/dist/table.js +35 -60
- package/dist/table.js.map +1 -1
- package/package.json +16 -15
package/dist/demo/index.js
CHANGED
@@ -1,16 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./overview"), exports);
|
14
|
-
__exportStar(require("./master-detail"), exports);
|
15
|
-
__exportStar(require("./state-caching"), exports);
|
1
|
+
export * from './overview';
|
2
|
+
export * from './master-detail';
|
3
|
+
export * from './state-caching';
|
16
4
|
//# sourceMappingURL=index.js.map
|
package/dist/demo/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
@@ -1,31 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
})((0, mobx_react_1.observer)(({ dataItem }) => {
|
14
|
-
const [store] = (0, react_ioc_1.useDependencies)(detail_table_store_1.DetailTableStore);
|
15
|
-
(0, react_1.useEffect)(() => {
|
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 { observer } from 'mobx-react';
|
5
|
+
import { Icon, Checkbox } from '@servicetitan/design-system';
|
6
|
+
import { Table, TableColumn } from '../..';
|
7
|
+
import { DetailTableStore } from './detail-table.store';
|
8
|
+
export const DetailTable = provide({
|
9
|
+
singletons: [DetailTableStore],
|
10
|
+
})(observer(({ dataItem }) => {
|
11
|
+
const [store] = useDependencies(DetailTableStore);
|
12
|
+
useEffect(() => {
|
16
13
|
store.initialize(dataItem);
|
17
14
|
return () => store.dispose();
|
18
15
|
}, [store, dataItem]);
|
19
16
|
if (!store.tableState) {
|
20
17
|
return null;
|
21
18
|
}
|
22
|
-
return ((
|
19
|
+
return (_jsxs(Table, Object.assign({ selectable: true, hideSelectAll: true, tableState: store.tableState, selectionControl: LockFieldIcon }, { children: [_jsx(TableColumn, { field: "Field" }, void 0), _jsx(TableColumn, { field: "OldValue" }, void 0), _jsx(TableColumn, { field: "NewValue" }, void 0)] }), void 0));
|
23
20
|
}));
|
24
21
|
const LockFieldIcon = props => {
|
25
22
|
const { checked, disabled } = props;
|
26
23
|
if (!disabled) {
|
27
|
-
return (
|
24
|
+
return _jsx(Checkbox, Object.assign({}, props), void 0);
|
28
25
|
}
|
29
|
-
return ((
|
26
|
+
return (_jsx("div", { children: checked ? (_jsx(Icon, { name: "check", className: "c-blue-300" }, void 0)) : (_jsx(Icon, { name: "remove", className: "c-neutral-70" }, void 0)) }, void 0));
|
30
27
|
};
|
31
28
|
//# sourceMappingURL=detail-table.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"detail-table.js","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"detail-table.js","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAM,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAiB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,WAAW,EAAuB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAA4B,OAAO,CAAC;IACxD,UAAU,EAAE,CAAC,gBAAgB,CAAC;CACjC,CAAC,CACE,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtB,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3B,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACnB,OAAO,IAAI,CAAC;KACf;IAED,OAAO,CACH,MAAC,KAAK,kBACF,UAAU,QACV,aAAa,QACb,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,gBAAgB,EAAE,aAAa,iBAE/B,KAAC,WAAW,IAAC,KAAK,EAAC,OAAO,WAAG,EAE7B,KAAC,WAAW,IAAC,KAAK,EAAC,UAAU,WAAG,EAEhC,KAAC,WAAW,IAAC,KAAK,EAAC,UAAU,WAAG,aAC5B,CACX,CAAC;AACN,CAAC,CAAC,CACL,CAAC;AAEF,MAAM,aAAa,GAA6B,KAAK,CAAC,EAAE;IACpD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEpC,IAAI,CAAC,QAAQ,EAAE;QACX,OAAO,KAAC,QAAQ,oBAAK,KAAK,UAAI,CAAC;KAClC;IAED,OAAO,CACH,wBACK,OAAO,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,WAAG,CAC/C,CAAC,CAAC,CAAC,CACA,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,cAAc,WAAG,CAClD,WACC,CACT,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
@@ -17,12 +16,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
17
16
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18
17
|
});
|
19
18
|
};
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
const __1 = require("../..");
|
25
|
-
const master_table_store_1 = require("./master-table.store");
|
19
|
+
import { injectable, inject } from '@servicetitan/react-ioc';
|
20
|
+
import { observable, action, observe, computed, makeObservable } from 'mobx';
|
21
|
+
import { TableState } from '../..';
|
22
|
+
import { MasterTableStore } from './master-table.store';
|
26
23
|
let DetailTableStore = class DetailTableStore {
|
27
24
|
constructor() {
|
28
25
|
Object.defineProperty(this, "tableState", {
|
@@ -47,8 +44,8 @@ let DetailTableStore = class DetailTableStore {
|
|
47
44
|
writable: true,
|
48
45
|
value: void 0
|
49
46
|
});
|
50
|
-
|
51
|
-
this.disposeSelectedObserve =
|
47
|
+
makeObservable(this);
|
48
|
+
this.disposeSelectedObserve = observe(this, 'selected', ({ oldValue, newValue }) => {
|
52
49
|
if (!oldValue && newValue) {
|
53
50
|
this.setLockedRowsSelection(true);
|
54
51
|
}
|
@@ -81,27 +78,27 @@ let DetailTableStore = class DetailTableStore {
|
|
81
78
|
}
|
82
79
|
};
|
83
80
|
__decorate([
|
84
|
-
|
85
|
-
__metadata("design:type",
|
81
|
+
observable,
|
82
|
+
__metadata("design:type", TableState)
|
86
83
|
], DetailTableStore.prototype, "tableState", void 0);
|
87
84
|
__decorate([
|
88
|
-
|
89
|
-
__metadata("design:type",
|
85
|
+
inject(MasterTableStore),
|
86
|
+
__metadata("design:type", MasterTableStore)
|
90
87
|
], DetailTableStore.prototype, "masterTableStore", void 0);
|
91
88
|
__decorate([
|
92
|
-
|
89
|
+
computed,
|
93
90
|
__metadata("design:type", Object),
|
94
91
|
__metadata("design:paramtypes", [])
|
95
92
|
], DetailTableStore.prototype, "selected", null);
|
96
93
|
__decorate([
|
97
|
-
|
94
|
+
action,
|
98
95
|
__metadata("design:type", Function),
|
99
96
|
__metadata("design:paramtypes", [Object]),
|
100
97
|
__metadata("design:returntype", void 0)
|
101
98
|
], DetailTableStore.prototype, "initialize", null);
|
102
99
|
DetailTableStore = __decorate([
|
103
|
-
|
100
|
+
injectable(),
|
104
101
|
__metadata("design:paramtypes", [])
|
105
102
|
], DetailTableStore);
|
106
|
-
|
103
|
+
export { DetailTableStore };
|
107
104
|
//# sourceMappingURL=detail-table.store.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"detail-table.store.js","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.store.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"detail-table.store.js","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAU,cAAc,EAAE,MAAM,MAAM,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMxD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAgBzB;QAfY;;;;;WAAgE;QAE5E;;;WAGG;QAEH;;;;;WAA4C;QAM5C;;;;;WAAuC;QAGnC,cAAc,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/E,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE;gBACvB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;aACrC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAdS,IAAI,QAAQ;;QAClB,OAAO,MAAA,MAAA,IAAI,CAA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
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./table-master-detail"), exports);
|
1
|
+
export * from './table-master-detail';
|
14
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
@@ -8,21 +7,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
const products_1 = require("./products");
|
17
|
-
const product_details_1 = require("./product-details");
|
10
|
+
import { injectable } from '@servicetitan/react-ioc';
|
11
|
+
import { computed, observe, makeObservable } from 'mobx';
|
12
|
+
import { InMemoryDataSource, TableState } from '../..';
|
13
|
+
import { products } from './products';
|
14
|
+
import { productDetails } from './product-details';
|
18
15
|
let MasterTableStore = class MasterTableStore {
|
19
16
|
constructor() {
|
20
17
|
Object.defineProperty(this, "tableState", {
|
21
18
|
enumerable: true,
|
22
19
|
configurable: true,
|
23
20
|
writable: true,
|
24
|
-
value: new
|
25
|
-
dataSource: new
|
21
|
+
value: new TableState({
|
22
|
+
dataSource: new InMemoryDataSource(products, row => row.ProductID),
|
26
23
|
getDetailTableState: row => this.getDetailTableState(row),
|
27
24
|
})
|
28
25
|
});
|
@@ -38,8 +35,8 @@ let MasterTableStore = class MasterTableStore {
|
|
38
35
|
writable: true,
|
39
36
|
value: void 0
|
40
37
|
});
|
41
|
-
|
42
|
-
this.disposeSelectedIdsObserve =
|
38
|
+
makeObservable(this);
|
39
|
+
this.disposeSelectedIdsObserve = observe(this, 'selectedIds', change => {
|
43
40
|
const { oldValue = [], newValue } = change;
|
44
41
|
const before = new Set(oldValue);
|
45
42
|
const after = new Set(newValue);
|
@@ -66,8 +63,8 @@ let MasterTableStore = class MasterTableStore {
|
|
66
63
|
if (this.details.has(id)) {
|
67
64
|
return this.details.get(id);
|
68
65
|
}
|
69
|
-
const detailTableState = new
|
70
|
-
dataSource: new
|
66
|
+
const detailTableState = new TableState({
|
67
|
+
dataSource: new InMemoryDataSource(productDetails.filter(x => x.ProductID === id), row => row.Field),
|
71
68
|
isRowUnselectable: row => !!row.IsLocked,
|
72
69
|
parent: {
|
73
70
|
row,
|
@@ -94,13 +91,13 @@ let MasterTableStore = class MasterTableStore {
|
|
94
91
|
}
|
95
92
|
};
|
96
93
|
__decorate([
|
97
|
-
|
94
|
+
computed,
|
98
95
|
__metadata("design:type", Object),
|
99
96
|
__metadata("design:paramtypes", [])
|
100
97
|
], MasterTableStore.prototype, "selectedIds", null);
|
101
98
|
MasterTableStore = __decorate([
|
102
|
-
|
99
|
+
injectable(),
|
103
100
|
__metadata("design:paramtypes", [])
|
104
101
|
], MasterTableStore);
|
105
|
-
|
102
|
+
export { MasterTableStore };
|
106
103
|
//# sourceMappingURL=master-table.store.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"master-table.store.js","sourceRoot":"","sources":["../../../src/demo/master-detail/master-table.store.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"master-table.store.js","sourceRoot":"","sources":["../../../src/demo/master-detail/master-table.store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAU,cAAc,EAAE,MAAM,MAAM,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAczB;QAbA;;;;mBAA0C,IAAI,UAAU,CAAC;gBACrD,UAAU,EAAE,IAAI,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;gBAClE,mBAAmB,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC;aAC5D,CAAC;WAAC;QAEH;;;;mBAAU,IAAI,GAAG,EAA8D;WAAC;QAMhF;;;;;WAA0C;QAGtC,cAAc,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE;YACnE,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,MAGnC,CAAC;YAEF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;YAEhC,K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AU,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACrC,gBAAgB,CAAC,SAAS,EAAE,CAAC;SAChC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;QAEvC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAEO,kBAAkB,CAAC,EAAU,EAAE,KAAc;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAoB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAa,CAAC,CAAC;QAElF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YAC/B,OAAO;SACV;QAED,IAAI,KAAK,EAAE;YACP,MAAM,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;SACnD;aAAM,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE;YACvC,MAAM,CAAC,WAAW,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;SACrD;IACL,CAAC;CACJ,CAAA;AA7Ea;IAAT,QAAQ;;;mDAER;AAVQ,gBAAgB;IAD5B,UAAU,EAAE;;GACA,gBAAgB,CAqF5B;SArFY,gBAAgB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"product-details.js","sourceRoot":"","sources":["../../../src/demo/master-detail/product-details.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"product-details.js","sourceRoot":"","sources":["../../../src/demo/master-detail/product-details.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC3C;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,iBAAiB;QACxB,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE,oBAAoB;KACjC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,MAAM;KACnB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,KAAK;KAClB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,MAAM;KACnB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,IAAI;KACjB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,OAAO;KACpB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,MAAM;KACnB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;KAChB;CACJ,CAAC"}
|
@@ -1,19 +1,16 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Supplier = exports.UserRole = void 0;
|
4
|
-
var UserRole;
|
1
|
+
export var UserRole;
|
5
2
|
(function (UserRole) {
|
6
3
|
UserRole[UserRole["Unspecified"] = 0] = "Unspecified";
|
7
4
|
UserRole[UserRole["Technician"] = 1] = "Technician";
|
8
5
|
UserRole[UserRole["GeneralOffice"] = 2] = "GeneralOffice";
|
9
6
|
UserRole[UserRole["Admin"] = 3] = "Admin";
|
10
7
|
UserRole[UserRole["Owner"] = 4] = "Owner";
|
11
|
-
})(UserRole
|
12
|
-
var Supplier;
|
8
|
+
})(UserRole || (UserRole = {}));
|
9
|
+
export var Supplier;
|
13
10
|
(function (Supplier) {
|
14
11
|
Supplier[Supplier["Dan"] = 1] = "Dan";
|
15
12
|
Supplier[Supplier["Adam"] = 2] = "Adam";
|
16
13
|
Supplier[Supplier["Charlie"] = 3] = "Charlie";
|
17
14
|
Supplier[Supplier["Benjamin"] = 4] = "Benjamin";
|
18
|
-
})(Supplier
|
15
|
+
})(Supplier || (Supplier = {}));
|
19
16
|
//# sourceMappingURL=product.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/demo/master-detail/product.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/demo/master-detail/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,24 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.products = void 0;
|
4
|
-
const product_1 = require("./product");
|
5
|
-
exports.products = [
|
1
|
+
import { UserRole, Supplier } from './product';
|
2
|
+
export const products = [
|
6
3
|
{
|
7
4
|
ProductID: 1,
|
8
5
|
ProductName: 'Chai',
|
9
|
-
Supplier:
|
6
|
+
Supplier: Supplier.Dan,
|
10
7
|
CategoryID: 1,
|
11
8
|
QuantityPerUnit: '10 boxes x 20 bags',
|
12
9
|
UnitPrice: 18.0,
|
13
10
|
UnitsInStock: 39,
|
14
11
|
UnitsOnOrder: new Date('1/11/2019'),
|
15
12
|
Discontinued: false,
|
16
|
-
AvailableFor:
|
13
|
+
AvailableFor: UserRole.Admin,
|
17
14
|
},
|
18
15
|
{
|
19
16
|
ProductID: 2,
|
20
17
|
ProductName: 'Chang',
|
21
|
-
Supplier:
|
18
|
+
Supplier: Supplier.Dan,
|
22
19
|
CategoryID: 1,
|
23
20
|
QuantityPerUnit: '24 - 12 oz bottles',
|
24
21
|
UnitPrice: 19.0,
|
@@ -29,19 +26,19 @@ exports.products = [
|
|
29
26
|
{
|
30
27
|
ProductID: 3,
|
31
28
|
ProductName: 'Aniseed Syrup',
|
32
|
-
Supplier:
|
29
|
+
Supplier: Supplier.Dan,
|
33
30
|
CategoryID: 2,
|
34
31
|
QuantityPerUnit: '12 - 550 ml bottles',
|
35
32
|
UnitPrice: 10.0,
|
36
33
|
UnitsInStock: 13,
|
37
34
|
UnitsOnOrder: new Date('3/11/2019'),
|
38
35
|
Discontinued: false,
|
39
|
-
AvailableFor:
|
36
|
+
AvailableFor: UserRole.Owner,
|
40
37
|
},
|
41
38
|
{
|
42
39
|
ProductID: 4,
|
43
40
|
ProductName: "Chef Anton's Cajun Seasoning",
|
44
|
-
Supplier:
|
41
|
+
Supplier: Supplier.Adam,
|
45
42
|
CategoryID: 2,
|
46
43
|
QuantityPerUnit: '48 - 6 oz jars',
|
47
44
|
UnitPrice: 22.0,
|
@@ -52,19 +49,19 @@ exports.products = [
|
|
52
49
|
{
|
53
50
|
ProductID: 5,
|
54
51
|
ProductName: "Chef Anton's Gumbo Mix",
|
55
|
-
Supplier:
|
52
|
+
Supplier: Supplier.Adam,
|
56
53
|
CategoryID: 2,
|
57
54
|
QuantityPerUnit: '36 boxes',
|
58
55
|
UnitPrice: 21.35,
|
59
56
|
UnitsInStock: 0,
|
60
57
|
UnitsOnOrder: new Date('5/11/2019'),
|
61
58
|
Discontinued: true,
|
62
|
-
AvailableFor:
|
59
|
+
AvailableFor: UserRole.GeneralOffice,
|
63
60
|
},
|
64
61
|
{
|
65
62
|
ProductID: 6,
|
66
63
|
ProductName: "Grandma's Boysenberry Spread",
|
67
|
-
Supplier:
|
64
|
+
Supplier: Supplier.Charlie,
|
68
65
|
CategoryID: 2,
|
69
66
|
QuantityPerUnit: '12 - 8 oz jars',
|
70
67
|
UnitPrice: 25.0,
|
@@ -75,7 +72,7 @@ exports.products = [
|
|
75
72
|
{
|
76
73
|
ProductID: 7,
|
77
74
|
ProductName: "Uncle Bob's Organic Dried Pears",
|
78
|
-
Supplier:
|
75
|
+
Supplier: Supplier.Charlie,
|
79
76
|
CategoryID: 7,
|
80
77
|
QuantityPerUnit: '12 - 1 lb pkgs.',
|
81
78
|
UnitPrice: 30.0,
|
@@ -86,7 +83,7 @@ exports.products = [
|
|
86
83
|
{
|
87
84
|
ProductID: 8,
|
88
85
|
ProductName: 'Northwoods Cranberry Sauce',
|
89
|
-
Supplier:
|
86
|
+
Supplier: Supplier.Charlie,
|
90
87
|
CategoryID: 2,
|
91
88
|
QuantityPerUnit: '12 - 12 oz jars',
|
92
89
|
UnitPrice: 40.0,
|
@@ -97,7 +94,7 @@ exports.products = [
|
|
97
94
|
{
|
98
95
|
ProductID: 9,
|
99
96
|
ProductName: 'Mishi Kobe Niku',
|
100
|
-
Supplier:
|
97
|
+
Supplier: Supplier.Benjamin,
|
101
98
|
CategoryID: 6,
|
102
99
|
QuantityPerUnit: '18 - 500 g pkgs.',
|
103
100
|
UnitPrice: 97.0,
|
@@ -108,7 +105,7 @@ exports.products = [
|
|
108
105
|
{
|
109
106
|
ProductID: 10,
|
110
107
|
ProductName: 'Ikura',
|
111
|
-
Supplier:
|
108
|
+
Supplier: Supplier.Benjamin,
|
112
109
|
CategoryID: 8,
|
113
110
|
QuantityPerUnit: '12 - 200 ml jars',
|
114
111
|
UnitPrice: 31.0,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/demo/master-detail/products.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/demo/master-detail/products.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;QAC3B,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,13 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const __1 = require("../..");
|
9
|
-
const master_table_store_1 = require("./master-table.store");
|
10
|
-
const detail_table_1 = require("./detail-table");
|
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';
|
11
8
|
const ExpandCell = ({ tableState, dataItem }) => {
|
12
9
|
const handleExpandChange = () => {
|
13
10
|
tableState.handleExpandChange({
|
@@ -15,13 +12,13 @@ const ExpandCell = ({ tableState, dataItem }) => {
|
|
15
12
|
value: !dataItem.expanded,
|
16
13
|
});
|
17
14
|
};
|
18
|
-
return ((
|
15
|
+
return (_jsx("td", { children: _jsx(Button, Object.assign({ full: true, text: true, primary: true, onClick: handleExpandChange }, { children: "Show / Hide" }), void 0) }, void 0));
|
19
16
|
};
|
20
|
-
|
21
|
-
singletons: [
|
17
|
+
export const TableMasterDetailExample = provide({
|
18
|
+
singletons: [MasterTableStore],
|
22
19
|
})(() => {
|
23
|
-
const [store] =
|
24
|
-
|
25
|
-
return ((
|
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" }, void 0), _jsx(TableColumn, { field: "ProductName", title: "Product Name" }, void 0), _jsx(TableColumn, { cell: ExpandCell, width: "150px" }, void 0)] }), void 0));
|
26
23
|
});
|
27
24
|
//# sourceMappingURL=table-master-detail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-master-detail.js","sourceRoot":"","sources":["../../../src/demo/master-detail/table-master-detail.tsx"],"names":[],"mappings":"
|
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,yCAE5C,WACR,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,WAAG,EAE1D,KAAC,WAAW,IAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,cAAc,WAAG,EAExD,KAAC,WAAW,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,OAAO,WAAG,aAC3C,CACX,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,21 +7,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const design_system_1 = require("@servicetitan/design-system");
|
15
|
-
const __1 = require("../..");
|
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 '../..';
|
16
13
|
const ViewAction = ({ tableState, dataItem }) => {
|
17
14
|
if (!tableState) {
|
18
|
-
return (
|
15
|
+
return _jsx("td", {}, void 0);
|
19
16
|
}
|
20
17
|
const edit = () => tableState.edit(dataItem);
|
21
|
-
return ((
|
18
|
+
return (_jsx("td", { children: _jsx(Button, Object.assign({ text: true, primary: true, onClick: edit }, { children: _jsx(Icon, { name: "edit" }, void 0) }), void 0) }, void 0));
|
22
19
|
};
|
23
20
|
const EditAction = ({ tableState, formState, dataItem }) => {
|
24
21
|
if (!tableState) {
|
25
|
-
return (
|
22
|
+
return _jsx("td", {}, void 0);
|
26
23
|
}
|
27
24
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
28
25
|
const { hasError } = yield formState.validate();
|
@@ -32,9 +29,9 @@ const EditAction = ({ tableState, formState, dataItem }) => {
|
|
32
29
|
yield tableState.saveEdit(dataItem);
|
33
30
|
});
|
34
31
|
const cancel = () => tableState.cancelEdit(dataItem);
|
35
|
-
return ((
|
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" }, void 0) }), void 0), _jsx(Button, Object.assign({ text: true, primary: true, onClick: save }, { children: _jsx(Icon, { name: "done" }, void 0) }), void 0)] }), void 0) }, void 0));
|
36
33
|
};
|
37
|
-
|
34
|
+
export const ActionsCell = getActionCell({
|
38
35
|
view: ViewAction,
|
39
36
|
edit: EditAction,
|
40
37
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"actions-cell.js","sourceRoot":"","sources":["../../../src/demo/overview/actions-cell.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"actions-cell.js","sourceRoot":"","sources":["../../../src/demo/overview/actions-cell.tsx"],"names":[],"mappings":";;;;;;;;;;A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C,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,YACf,aACL,WACP,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACrC,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;CACnB,CAAC,CAAC"}
|
@@ -1,14 +1,2 @@
|
|
1
|
-
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./table"), exports);
|
1
|
+
export * from './table';
|
14
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/overview/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/overview/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -1,19 +1,16 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Supplier = exports.UserRole = void 0;
|
4
|
-
var UserRole;
|
1
|
+
export var UserRole;
|
5
2
|
(function (UserRole) {
|
6
3
|
UserRole[UserRole["Unspecified"] = 0] = "Unspecified";
|
7
4
|
UserRole[UserRole["Technician"] = 1] = "Technician";
|
8
5
|
UserRole[UserRole["GeneralOffice"] = 2] = "GeneralOffice";
|
9
6
|
UserRole[UserRole["Admin"] = 3] = "Admin";
|
10
7
|
UserRole[UserRole["Owner"] = 4] = "Owner";
|
11
|
-
})(UserRole
|
12
|
-
var Supplier;
|
8
|
+
})(UserRole || (UserRole = {}));
|
9
|
+
export var Supplier;
|
13
10
|
(function (Supplier) {
|
14
11
|
Supplier[Supplier["Dan"] = 1] = "Dan";
|
15
12
|
Supplier[Supplier["Adam"] = 2] = "Adam";
|
16
13
|
Supplier[Supplier["Charlie"] = 3] = "Charlie";
|
17
14
|
Supplier[Supplier["Benjamin"] = 4] = "Benjamin";
|
18
|
-
})(Supplier
|
15
|
+
})(Supplier || (Supplier = {}));
|
19
16
|
//# sourceMappingURL=product.js.map
|