@servicetitan/table 21.7.1 → 22.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. package/CHANGELOG.md +550 -0
  2. package/package.json +8 -8
  3. package/dist/demo/index.d.ts +0 -4
  4. package/dist/demo/index.d.ts.map +0 -1
  5. package/dist/demo/index.js +0 -4
  6. package/dist/demo/index.js.map +0 -1
  7. package/dist/demo/master-detail/detail-table.d.ts +0 -4
  8. package/dist/demo/master-detail/detail-table.d.ts.map +0 -1
  9. package/dist/demo/master-detail/detail-table.js +0 -28
  10. package/dist/demo/master-detail/detail-table.js.map +0 -1
  11. package/dist/demo/master-detail/detail-table.store.d.ts +0 -14
  12. package/dist/demo/master-detail/detail-table.store.d.ts.map +0 -1
  13. package/dist/demo/master-detail/detail-table.store.js +0 -104
  14. package/dist/demo/master-detail/detail-table.store.js.map +0 -1
  15. package/dist/demo/master-detail/index.d.ts +0 -2
  16. package/dist/demo/master-detail/index.d.ts.map +0 -1
  17. package/dist/demo/master-detail/index.js +0 -2
  18. package/dist/demo/master-detail/index.js.map +0 -1
  19. package/dist/demo/master-detail/master-table.store.d.ts +0 -14
  20. package/dist/demo/master-detail/master-table.store.d.ts.map +0 -1
  21. package/dist/demo/master-detail/master-table.store.js +0 -103
  22. package/dist/demo/master-detail/master-table.store.js.map +0 -1
  23. package/dist/demo/master-detail/product-detail.d.ts +0 -8
  24. package/dist/demo/master-detail/product-detail.d.ts.map +0 -1
  25. package/dist/demo/master-detail/product-detail.js +0 -2
  26. package/dist/demo/master-detail/product-detail.js.map +0 -1
  27. package/dist/demo/master-detail/product-details.d.ts +0 -3
  28. package/dist/demo/master-detail/product-details.d.ts.map +0 -1
  29. package/dist/demo/master-detail/product-details.js +0 -55
  30. package/dist/demo/master-detail/product-details.js.map +0 -1
  31. package/dist/demo/master-detail/product.d.ts +0 -26
  32. package/dist/demo/master-detail/product.d.ts.map +0 -1
  33. package/dist/demo/master-detail/product.js +0 -16
  34. package/dist/demo/master-detail/product.js.map +0 -1
  35. package/dist/demo/master-detail/products.d.ts +0 -3
  36. package/dist/demo/master-detail/products.d.ts.map +0 -1
  37. package/dist/demo/master-detail/products.js +0 -117
  38. package/dist/demo/master-detail/products.js.map +0 -1
  39. package/dist/demo/master-detail/table-master-detail.d.ts +0 -3
  40. package/dist/demo/master-detail/table-master-detail.d.ts.map +0 -1
  41. package/dist/demo/master-detail/table-master-detail.js +0 -24
  42. package/dist/demo/master-detail/table-master-detail.js.map +0 -1
  43. package/dist/demo/overview/actions-cell.d.ts +0 -5
  44. package/dist/demo/overview/actions-cell.d.ts.map +0 -1
  45. package/dist/demo/overview/actions-cell.js +0 -38
  46. package/dist/demo/overview/actions-cell.js.map +0 -1
  47. package/dist/demo/overview/index.d.ts +0 -2
  48. package/dist/demo/overview/index.d.ts.map +0 -1
  49. package/dist/demo/overview/index.js +0 -2
  50. package/dist/demo/overview/index.js.map +0 -1
  51. package/dist/demo/overview/product.d.ts +0 -27
  52. package/dist/demo/overview/product.d.ts.map +0 -1
  53. package/dist/demo/overview/product.js +0 -16
  54. package/dist/demo/overview/product.js.map +0 -1
  55. package/dist/demo/overview/products.d.ts +0 -3
  56. package/dist/demo/overview/products.d.ts.map +0 -1
  57. package/dist/demo/overview/products.js +0 -127
  58. package/dist/demo/overview/products.js.map +0 -1
  59. package/dist/demo/overview/table.d.ts +0 -6
  60. package/dist/demo/overview/table.d.ts.map +0 -1
  61. package/dist/demo/overview/table.js +0 -44
  62. package/dist/demo/overview/table.js.map +0 -1
  63. package/dist/demo/overview/table.store.d.ts +0 -15
  64. package/dist/demo/overview/table.store.d.ts.map +0 -1
  65. package/dist/demo/overview/table.store.js +0 -92
  66. package/dist/demo/overview/table.store.js.map +0 -1
  67. package/dist/demo/state-caching/beverages.d.ts +0 -3
  68. package/dist/demo/state-caching/beverages.d.ts.map +0 -1
  69. package/dist/demo/state-caching/beverages.js +0 -48
  70. package/dist/demo/state-caching/beverages.js.map +0 -1
  71. package/dist/demo/state-caching/index.d.ts +0 -2
  72. package/dist/demo/state-caching/index.d.ts.map +0 -1
  73. package/dist/demo/state-caching/index.js +0 -2
  74. package/dist/demo/state-caching/index.js.map +0 -1
  75. package/dist/demo/state-caching/product.d.ts +0 -6
  76. package/dist/demo/state-caching/product.d.ts.map +0 -1
  77. package/dist/demo/state-caching/product.js +0 -2
  78. package/dist/demo/state-caching/product.js.map +0 -1
  79. package/dist/demo/state-caching/products.d.ts +0 -3
  80. package/dist/demo/state-caching/products.d.ts.map +0 -1
  81. package/dist/demo/state-caching/products.js +0 -53
  82. package/dist/demo/state-caching/products.js.map +0 -1
  83. package/dist/demo/state-caching/state-caching-table.d.ts +0 -3
  84. package/dist/demo/state-caching/state-caching-table.d.ts.map +0 -1
  85. package/dist/demo/state-caching/state-caching-table.js +0 -14
  86. package/dist/demo/state-caching/state-caching-table.js.map +0 -1
  87. package/dist/demo/state-caching/state-caching-table.store.d.ts +0 -13
  88. package/dist/demo/state-caching/state-caching-table.store.d.ts.map +0 -1
  89. package/dist/demo/state-caching/state-caching-table.store.js +0 -70
  90. package/dist/demo/state-caching/state-caching-table.store.js.map +0 -1
  91. package/dist/editable-cell/boolean-editable-cell.d.ts +0 -3
  92. package/dist/editable-cell/boolean-editable-cell.d.ts.map +0 -1
  93. package/dist/editable-cell/boolean-editable-cell.js +0 -14
  94. package/dist/editable-cell/boolean-editable-cell.js.map +0 -1
  95. package/dist/editable-cell/date-editable-cell.d.ts +0 -3
  96. package/dist/editable-cell/date-editable-cell.d.ts.map +0 -1
  97. package/dist/editable-cell/date-editable-cell.js +0 -14
  98. package/dist/editable-cell/date-editable-cell.js.map +0 -1
  99. package/dist/editable-cell/get-action-cell.d.ts +0 -13
  100. package/dist/editable-cell/get-action-cell.d.ts.map +0 -1
  101. package/dist/editable-cell/get-action-cell.js +0 -18
  102. package/dist/editable-cell/get-action-cell.js.map +0 -1
  103. package/dist/editable-cell/get-editable-cell.d.ts +0 -13
  104. package/dist/editable-cell/get-editable-cell.d.ts.map +0 -1
  105. package/dist/editable-cell/get-editable-cell.js +0 -18
  106. package/dist/editable-cell/get-editable-cell.js.map +0 -1
  107. package/dist/editable-cell/get-select-editable-cell.d.ts +0 -10
  108. package/dist/editable-cell/get-select-editable-cell.d.ts.map +0 -1
  109. package/dist/editable-cell/get-select-editable-cell.js +0 -19
  110. package/dist/editable-cell/get-select-editable-cell.js.map +0 -1
  111. package/dist/editable-cell/index.d.ts +0 -8
  112. package/dist/editable-cell/index.d.ts.map +0 -1
  113. package/dist/editable-cell/index.js +0 -8
  114. package/dist/editable-cell/index.js.map +0 -1
  115. package/dist/editable-cell/numeric-editable-cell.d.ts +0 -3
  116. package/dist/editable-cell/numeric-editable-cell.d.ts.map +0 -1
  117. package/dist/editable-cell/numeric-editable-cell.js +0 -15
  118. package/dist/editable-cell/numeric-editable-cell.js.map +0 -1
  119. package/dist/editable-cell/text-editable-cell.d.ts +0 -9
  120. package/dist/editable-cell/text-editable-cell.d.ts.map +0 -1
  121. package/dist/editable-cell/text-editable-cell.js +0 -20
  122. package/dist/editable-cell/text-editable-cell.js.map +0 -1
  123. package/dist/export/export.d.ts +0 -10
  124. package/dist/export/export.d.ts.map +0 -1
  125. package/dist/export/export.js +0 -6
  126. package/dist/export/export.js.map +0 -1
  127. package/dist/export/index.d.ts +0 -2
  128. package/dist/export/index.d.ts.map +0 -1
  129. package/dist/export/index.js +0 -2
  130. package/dist/export/index.js.map +0 -1
  131. package/dist/filters/column-menu-filters.d.ts +0 -5
  132. package/dist/filters/column-menu-filters.d.ts.map +0 -1
  133. package/dist/filters/column-menu-filters.js +0 -9
  134. package/dist/filters/column-menu-filters.js.map +0 -1
  135. package/dist/filters/datetime-filter/datetime-filter.d.ts +0 -3
  136. package/dist/filters/datetime-filter/datetime-filter.d.ts.map +0 -1
  137. package/dist/filters/datetime-filter/datetime-filter.js +0 -71
  138. package/dist/filters/datetime-filter/datetime-filter.js.map +0 -1
  139. package/dist/filters/field-values-filter.d.ts +0 -6
  140. package/dist/filters/field-values-filter.d.ts.map +0 -1
  141. package/dist/filters/field-values-filter.js +0 -155
  142. package/dist/filters/field-values-filter.js.map +0 -1
  143. package/dist/filters/index.d.ts +0 -9
  144. package/dist/filters/index.d.ts.map +0 -1
  145. package/dist/filters/index.js +0 -9
  146. package/dist/filters/index.js.map +0 -1
  147. package/dist/filters/multiselect-filter.d.ts +0 -5
  148. package/dist/filters/multiselect-filter.d.ts.map +0 -1
  149. package/dist/filters/multiselect-filter.js +0 -107
  150. package/dist/filters/multiselect-filter.js.map +0 -1
  151. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts +0 -6
  152. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts.map +0 -1
  153. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +0 -6
  154. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +0 -1
  155. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +0 -3
  156. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +0 -1
  157. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +0 -27
  158. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +0 -1
  159. package/dist/filters/range-filter/range-filter.d.ts +0 -6
  160. package/dist/filters/range-filter/range-filter.d.ts.map +0 -1
  161. package/dist/filters/range-filter/range-filter.js +0 -117
  162. package/dist/filters/range-filter/range-filter.js.map +0 -1
  163. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts +0 -21
  164. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts.map +0 -1
  165. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +0 -82
  166. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +0 -1
  167. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts +0 -6
  168. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts.map +0 -1
  169. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +0 -6
  170. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +0 -1
  171. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts +0 -26
  172. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map +0 -1
  173. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +0 -69
  174. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +0 -1
  175. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts +0 -6
  176. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts.map +0 -1
  177. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +0 -30
  178. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +0 -1
  179. package/dist/filters/time-filter/time-filter.d.ts +0 -3
  180. package/dist/filters/time-filter/time-filter.d.ts.map +0 -1
  181. package/dist/filters/time-filter/time-filter.js +0 -71
  182. package/dist/filters/time-filter/time-filter.js.map +0 -1
  183. package/dist/index.d.ts +0 -10
  184. package/dist/index.d.ts.map +0 -1
  185. package/dist/index.js +0 -9
  186. package/dist/index.js.map +0 -1
  187. package/dist/select-cell/index.d.ts +0 -2
  188. package/dist/select-cell/index.d.ts.map +0 -1
  189. package/dist/select-cell/index.js +0 -2
  190. package/dist/select-cell/index.js.map +0 -1
  191. package/dist/select-cell/select-cell.d.ts +0 -25
  192. package/dist/select-cell/select-cell.d.ts.map +0 -1
  193. package/dist/select-cell/select-cell.js +0 -35
  194. package/dist/select-cell/select-cell.js.map +0 -1
  195. package/dist/table-state.d.ts +0 -161
  196. package/dist/table-state.d.ts.map +0 -1
  197. package/dist/table-state.js +0 -1106
  198. package/dist/table-state.js.map +0 -1
  199. package/dist/table.d.ts +0 -40
  200. package/dist/table.d.ts.map +0 -1
  201. package/dist/table.js +0 -231
  202. package/dist/table.js.map +0 -1
@@ -1,14 +0,0 @@
1
- import { TableState } from '../..';
2
- import { Product } from './product';
3
- import { ProductDetail } from './product-detail';
4
- export declare class DetailTableStore {
5
- tableState?: TableState<ProductDetail, string, Product, number>;
6
- private masterTableStore;
7
- get selected(): number;
8
- private disposeSelectedObserve;
9
- constructor();
10
- initialize(row: Product): void;
11
- dispose(): void;
12
- private setLockedRowsSelection;
13
- }
14
- //# sourceMappingURL=detail-table.store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detail-table.store.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBACa,gBAAgB;IACb,UAAU,CAAC,EAAE,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAO5E,OAAO,CAAC,gBAAgB,CAAoB;IAE5C,IAAc,QAAQ,WAErB;IAED,OAAO,CAAC,sBAAsB,CAAS;;IAavC,UAAU,CAAC,GAAG,EAAE,OAAO;IASvB,OAAO;YAIO,sBAAsB;CAmBvC"}
@@ -1,104 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
- return new (P || (P = Promise))(function (resolve, reject) {
13
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
- step((generator = generator.apply(thisArg, _arguments || [])).next());
17
- });
18
- };
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';
23
- let DetailTableStore = class DetailTableStore {
24
- constructor() {
25
- Object.defineProperty(this, "tableState", {
26
- enumerable: true,
27
- configurable: true,
28
- writable: true,
29
- value: void 0
30
- });
31
- /*
32
- * Please use constructor injection instead.
33
- * Injecting without constructor only to make it work in Codesandbox.
34
- */
35
- Object.defineProperty(this, "masterTableStore", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: void 0
40
- });
41
- Object.defineProperty(this, "disposeSelectedObserve", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: void 0
46
- });
47
- makeObservable(this);
48
- this.disposeSelectedObserve = observe(this, 'selected', ({ oldValue, newValue }) => {
49
- if (!oldValue && newValue) {
50
- this.setLockedRowsSelection(true);
51
- }
52
- });
53
- }
54
- get selected() {
55
- var _a, _b;
56
- return (_b = (_a = this.tableState) === null || _a === void 0 ? void 0 : _a.selectedIds.size) !== null && _b !== void 0 ? _b : 0;
57
- }
58
- initialize(row) {
59
- this.tableState = this.masterTableStore.tableState.getDetailTableState(row);
60
- }
61
- dispose() {
62
- this.disposeSelectedObserve();
63
- }
64
- setLockedRowsSelection(value) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- if (!this.tableState) {
67
- return;
68
- }
69
- if (!this.tableState.dataSource) {
70
- return;
71
- }
72
- const filteredData = (yield this.tableState.dataSource.getData({
73
- filter: this.tableState.filter,
74
- })).data;
75
- const lockedData = filteredData.filter(row => this.tableState.isRowUnselectable(row));
76
- this.tableState.setRowsSelection(lockedData, value, { ignoreUnselectable: false });
77
- });
78
- }
79
- };
80
- __decorate([
81
- observable,
82
- __metadata("design:type", TableState)
83
- ], DetailTableStore.prototype, "tableState", void 0);
84
- __decorate([
85
- inject(MasterTableStore),
86
- __metadata("design:type", MasterTableStore)
87
- ], DetailTableStore.prototype, "masterTableStore", void 0);
88
- __decorate([
89
- computed,
90
- __metadata("design:type", Object),
91
- __metadata("design:paramtypes", [])
92
- ], DetailTableStore.prototype, "selected", null);
93
- __decorate([
94
- action,
95
- __metadata("design:type", Function),
96
- __metadata("design:paramtypes", [Object]),
97
- __metadata("design:returntype", void 0)
98
- ], DetailTableStore.prototype, "initialize", null);
99
- DetailTableStore = __decorate([
100
- injectable(),
101
- __metadata("design:paramtypes", [])
102
- ], DetailTableStore);
103
- export { DetailTableStore };
104
- //# sourceMappingURL=detail-table.store.js.map
@@ -1 +0,0 @@
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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C,MAAM;;;;kDAQN;AAlCQ,gBAAgB;IAD5B,UAAU,EAAE;;GACA,gBAAgB,CA2D5B;SA3DY,gBAAgB"}
@@ -1,2 +0,0 @@
1
- export * from './table-master-detail';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './table-master-detail';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1,14 +0,0 @@
1
- import { TableState } from '../..';
2
- import { Product } from './product';
3
- import { ProductDetail } from './product-detail';
4
- export declare class MasterTableStore {
5
- tableState: TableState<Product, number>;
6
- details: Map<number, TableState<ProductDetail, string, Product, number>>;
7
- get selectedIds(): number[];
8
- private disposeSelectedIdsObserve;
9
- constructor();
10
- dispose(): void;
11
- private getDetailTableState;
12
- private setDetailSelection;
13
- }
14
- //# sourceMappingURL=master-table.store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"master-table.store.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/master-table.store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,qBACa,gBAAgB;IACzB,UAAU,EAAE,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAGpC;IAEH,OAAO,kEAAyE;IAEhF,IAAc,WAAW,aAExB;IAED,OAAO,CAAC,yBAAyB,CAAS;;IA4B1C,OAAO;IAIP,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,kBAAkB;CAa7B"}
@@ -1,103 +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, observe, makeObservable } from 'mobx';
12
- import { InMemoryDataSource, TableState } from '../..';
13
- import { products } from './products';
14
- import { productDetails } from './product-details';
15
- let MasterTableStore = class MasterTableStore {
16
- constructor() {
17
- Object.defineProperty(this, "tableState", {
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- value: new TableState({
22
- dataSource: new InMemoryDataSource(products, row => row.ProductID),
23
- getDetailTableState: row => this.getDetailTableState(row),
24
- })
25
- });
26
- Object.defineProperty(this, "details", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: new Map()
31
- });
32
- Object.defineProperty(this, "disposeSelectedIdsObserve", {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: void 0
37
- });
38
- makeObservable(this);
39
- this.disposeSelectedIdsObserve = observe(this, 'selectedIds', change => {
40
- const { oldValue = [], newValue } = change;
41
- const before = new Set(oldValue);
42
- const after = new Set(newValue);
43
- for (const id of oldValue) {
44
- if (!after.has(id)) {
45
- this.setDetailSelection(id, false);
46
- }
47
- }
48
- for (const id of newValue) {
49
- if (!before.has(id)) {
50
- this.setDetailSelection(id, true);
51
- }
52
- }
53
- });
54
- }
55
- get selectedIds() {
56
- return Array.from(this.tableState.selectedIds);
57
- }
58
- dispose() {
59
- this.disposeSelectedIdsObserve();
60
- }
61
- getDetailTableState(row) {
62
- const id = this.tableState.dataSource.idSelector(row);
63
- if (this.details.has(id)) {
64
- return this.details.get(id);
65
- }
66
- const detailTableState = new TableState({
67
- dataSource: new InMemoryDataSource(productDetails.filter(x => x.ProductID === id), row => row.Field),
68
- isRowUnselectable: row => !!row.IsLocked,
69
- parent: {
70
- row,
71
- tableState: this.tableState,
72
- },
73
- });
74
- if (this.tableState.selectedIds.has(id)) {
75
- detailTableState.selectAll();
76
- }
77
- this.details.set(id, detailTableState);
78
- return detailTableState;
79
- }
80
- setDetailSelection(id, value) {
81
- const detail = this.tableState.getDetailTableState({ ProductID: id });
82
- if (!detail || !detail.totalCount) {
83
- return;
84
- }
85
- if (value) {
86
- detail.selectAll({ ignoreUnselectable: false });
87
- }
88
- else if (!detail.isSomePageRowsSelected) {
89
- detail.deselectAll({ ignoreUnselectable: false });
90
- }
91
- }
92
- };
93
- __decorate([
94
- computed,
95
- __metadata("design:type", Object),
96
- __metadata("design:paramtypes", [])
97
- ], MasterTableStore.prototype, "selectedIds", null);
98
- MasterTableStore = __decorate([
99
- injectable(),
100
- __metadata("design:paramtypes", [])
101
- ], MasterTableStore);
102
- export { MasterTableStore };
103
- //# sourceMappingURL=master-table.store.js.map
@@ -1 +0,0 @@
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,g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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,8 +0,0 @@
1
- export interface ProductDetail {
2
- ProductID: number;
3
- Field: string;
4
- IsLocked?: boolean;
5
- OldValue: string;
6
- NewValue: string;
7
- }
8
- //# sourceMappingURL=product-detail.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-detail.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/product-detail.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=product-detail.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-detail.js","sourceRoot":"","sources":["../../../src/demo/master-detail/product-detail.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { ProductDetail } from './product-detail';
2
- export declare const productDetails: ProductDetail[];
3
- //# sourceMappingURL=product-details.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-details.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/product-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,cAAc,EAAE,aAAa,EAqDzC,CAAC"}
@@ -1,55 +0,0 @@
1
- export const productDetails = [
2
- {
3
- ProductID: 1,
4
- Field: 'QuantityPerUnit',
5
- OldValue: '12 boxes x 24 bags',
6
- NewValue: '10 boxes x 20 bags',
7
- },
8
- {
9
- ProductID: 1,
10
- Field: 'UnitPrice',
11
- OldValue: '25.0',
12
- NewValue: '18.0',
13
- },
14
- {
15
- ProductID: 2,
16
- Field: 'Supplier',
17
- IsLocked: true,
18
- OldValue: 'Adam',
19
- NewValue: 'Dan',
20
- },
21
- {
22
- ProductID: 2,
23
- Field: 'UnitPrice',
24
- OldValue: '18.5',
25
- NewValue: '19.0',
26
- },
27
- {
28
- ProductID: 2,
29
- Field: 'UnitsInStock',
30
- OldValue: '5',
31
- NewValue: '17',
32
- },
33
- {
34
- ProductID: 2,
35
- Field: 'Discontinued',
36
- IsLocked: true,
37
- OldValue: 'true',
38
- NewValue: 'false',
39
- },
40
- {
41
- ProductID: 3,
42
- Field: 'Discontinued',
43
- IsLocked: true,
44
- OldValue: 'false',
45
- NewValue: 'true',
46
- },
47
- {
48
- ProductID: 3,
49
- Field: 'UnitsInStock',
50
- IsLocked: true,
51
- OldValue: '7',
52
- NewValue: '5',
53
- },
54
- ];
55
- //# sourceMappingURL=product-details.js.map
@@ -1 +0,0 @@
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,26 +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
- QuantityPerUnit: string;
20
- UnitPrice: number;
21
- UnitsInStock: number;
22
- UnitsOnOrder: Date;
23
- Discontinued: boolean;
24
- AvailableFor?: UserRole;
25
- }
26
- //# sourceMappingURL=product.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/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,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/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,3 +0,0 @@
1
- import { Product } from './product';
2
- export declare const products: Product[];
3
- //# sourceMappingURL=products.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,WAAW,CAAC;AAExD,eAAO,MAAM,QAAQ,EAAE,OAAO,EAkH7B,CAAC"}
@@ -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"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAc;IAC/B;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,QAAQ,CAAC,GAAG;QACtB,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,oBAAoB;QACrC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QACnC,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,QAAQ,CAAC,KAAK;KAC/B;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,QAAQ,CAAC,GAAG;QACtB,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,oBAAoB;QACrC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QACnC,YAAY,EAAE,KAAK;KACtB;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,QAAQ,CAAC,GAAG;QACtB,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,qBAAqB;QACtC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QACnC,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,QAAQ,CAAC,KAAK;KAC/B;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,8BAA8B;QAC3C,QAAQ,EAAE,QAAQ,CAAC,IAAI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AAI,CAAC,WAAW,CAAC;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,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,3 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const TableMasterDetailExample: FC;
3
- //# sourceMappingURL=table-master-detail.d.ts.map
@@ -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,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { TableCellProps } from '../..';
3
- import { Product } from './product';
4
- export declare const ActionsCell: (props: TableCellProps<Product, any, never, never>) => JSX.Element;
5
- //# sourceMappingURL=actions-cell.d.ts.map
@@ -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