@servicetitan/table 22.1.0 → 22.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/demo/index.d.ts +4 -0
  3. package/dist/demo/index.d.ts.map +1 -0
  4. package/dist/demo/index.js +4 -0
  5. package/dist/demo/index.js.map +1 -0
  6. package/dist/demo/master-detail/detail-table.d.ts +4 -0
  7. package/dist/demo/master-detail/detail-table.d.ts.map +1 -0
  8. package/dist/demo/master-detail/detail-table.js +28 -0
  9. package/dist/demo/master-detail/detail-table.js.map +1 -0
  10. package/dist/demo/master-detail/detail-table.store.d.ts +14 -0
  11. package/dist/demo/master-detail/detail-table.store.d.ts.map +1 -0
  12. package/dist/demo/master-detail/detail-table.store.js +104 -0
  13. package/dist/demo/master-detail/detail-table.store.js.map +1 -0
  14. package/dist/demo/master-detail/index.d.ts +2 -0
  15. package/dist/demo/master-detail/index.d.ts.map +1 -0
  16. package/dist/demo/master-detail/index.js +2 -0
  17. package/dist/demo/master-detail/index.js.map +1 -0
  18. package/dist/demo/master-detail/master-table.store.d.ts +14 -0
  19. package/dist/demo/master-detail/master-table.store.d.ts.map +1 -0
  20. package/dist/demo/master-detail/master-table.store.js +103 -0
  21. package/dist/demo/master-detail/master-table.store.js.map +1 -0
  22. package/dist/demo/master-detail/product-detail.d.ts +8 -0
  23. package/dist/demo/master-detail/product-detail.d.ts.map +1 -0
  24. package/dist/demo/master-detail/product-detail.js +2 -0
  25. package/dist/demo/master-detail/product-detail.js.map +1 -0
  26. package/dist/demo/master-detail/product-details.d.ts +3 -0
  27. package/dist/demo/master-detail/product-details.d.ts.map +1 -0
  28. package/dist/demo/master-detail/product-details.js +55 -0
  29. package/dist/demo/master-detail/product-details.js.map +1 -0
  30. package/dist/demo/master-detail/product.d.ts +26 -0
  31. package/dist/demo/master-detail/product.d.ts.map +1 -0
  32. package/dist/demo/master-detail/product.js +16 -0
  33. package/dist/demo/master-detail/product.js.map +1 -0
  34. package/dist/demo/master-detail/products.d.ts +3 -0
  35. package/dist/demo/master-detail/products.d.ts.map +1 -0
  36. package/dist/demo/master-detail/products.js +117 -0
  37. package/dist/demo/master-detail/products.js.map +1 -0
  38. package/dist/demo/master-detail/table-master-detail.d.ts +3 -0
  39. package/dist/demo/master-detail/table-master-detail.d.ts.map +1 -0
  40. package/dist/demo/master-detail/table-master-detail.js +24 -0
  41. package/dist/demo/master-detail/table-master-detail.js.map +1 -0
  42. package/dist/demo/overview/actions-cell.d.ts +5 -0
  43. package/dist/demo/overview/actions-cell.d.ts.map +1 -0
  44. package/dist/demo/overview/actions-cell.js +38 -0
  45. package/dist/demo/overview/actions-cell.js.map +1 -0
  46. package/dist/demo/overview/index.d.ts +2 -0
  47. package/dist/demo/overview/index.d.ts.map +1 -0
  48. package/dist/demo/overview/index.js +2 -0
  49. package/dist/demo/overview/index.js.map +1 -0
  50. package/dist/demo/overview/product.d.ts +27 -0
  51. package/dist/demo/overview/product.d.ts.map +1 -0
  52. package/dist/demo/overview/product.js +16 -0
  53. package/dist/demo/overview/product.js.map +1 -0
  54. package/dist/demo/overview/products.d.ts +3 -0
  55. package/dist/demo/overview/products.d.ts.map +1 -0
  56. package/dist/demo/overview/products.js +127 -0
  57. package/dist/demo/overview/products.js.map +1 -0
  58. package/dist/demo/overview/table.d.ts +6 -0
  59. package/dist/demo/overview/table.d.ts.map +1 -0
  60. package/dist/demo/overview/table.js +44 -0
  61. package/dist/demo/overview/table.js.map +1 -0
  62. package/dist/demo/overview/table.store.d.ts +15 -0
  63. package/dist/demo/overview/table.store.d.ts.map +1 -0
  64. package/dist/demo/overview/table.store.js +92 -0
  65. package/dist/demo/overview/table.store.js.map +1 -0
  66. package/dist/demo/state-caching/beverages.d.ts +3 -0
  67. package/dist/demo/state-caching/beverages.d.ts.map +1 -0
  68. package/dist/demo/state-caching/beverages.js +48 -0
  69. package/dist/demo/state-caching/beverages.js.map +1 -0
  70. package/dist/demo/state-caching/index.d.ts +2 -0
  71. package/dist/demo/state-caching/index.d.ts.map +1 -0
  72. package/dist/demo/state-caching/index.js +2 -0
  73. package/dist/demo/state-caching/index.js.map +1 -0
  74. package/dist/demo/state-caching/product.d.ts +6 -0
  75. package/dist/demo/state-caching/product.d.ts.map +1 -0
  76. package/dist/demo/state-caching/product.js +2 -0
  77. package/dist/demo/state-caching/product.js.map +1 -0
  78. package/dist/demo/state-caching/products.d.ts +3 -0
  79. package/dist/demo/state-caching/products.d.ts.map +1 -0
  80. package/dist/demo/state-caching/products.js +53 -0
  81. package/dist/demo/state-caching/products.js.map +1 -0
  82. package/dist/demo/state-caching/state-caching-table.d.ts +3 -0
  83. package/dist/demo/state-caching/state-caching-table.d.ts.map +1 -0
  84. package/dist/demo/state-caching/state-caching-table.js +14 -0
  85. package/dist/demo/state-caching/state-caching-table.js.map +1 -0
  86. package/dist/demo/state-caching/state-caching-table.store.d.ts +13 -0
  87. package/dist/demo/state-caching/state-caching-table.store.d.ts.map +1 -0
  88. package/dist/demo/state-caching/state-caching-table.store.js +70 -0
  89. package/dist/demo/state-caching/state-caching-table.store.js.map +1 -0
  90. package/dist/editable-cell/boolean-editable-cell.d.ts +3 -0
  91. package/dist/editable-cell/boolean-editable-cell.d.ts.map +1 -0
  92. package/dist/editable-cell/boolean-editable-cell.js +14 -0
  93. package/dist/editable-cell/boolean-editable-cell.js.map +1 -0
  94. package/dist/editable-cell/date-editable-cell.d.ts +3 -0
  95. package/dist/editable-cell/date-editable-cell.d.ts.map +1 -0
  96. package/dist/editable-cell/date-editable-cell.js +14 -0
  97. package/dist/editable-cell/date-editable-cell.js.map +1 -0
  98. package/dist/editable-cell/get-action-cell.d.ts +13 -0
  99. package/dist/editable-cell/get-action-cell.d.ts.map +1 -0
  100. package/dist/editable-cell/get-action-cell.js +18 -0
  101. package/dist/editable-cell/get-action-cell.js.map +1 -0
  102. package/dist/editable-cell/get-editable-cell.d.ts +13 -0
  103. package/dist/editable-cell/get-editable-cell.d.ts.map +1 -0
  104. package/dist/editable-cell/get-editable-cell.js +18 -0
  105. package/dist/editable-cell/get-editable-cell.js.map +1 -0
  106. package/dist/editable-cell/get-select-editable-cell.d.ts +10 -0
  107. package/dist/editable-cell/get-select-editable-cell.d.ts.map +1 -0
  108. package/dist/editable-cell/get-select-editable-cell.js +19 -0
  109. package/dist/editable-cell/get-select-editable-cell.js.map +1 -0
  110. package/dist/editable-cell/index.d.ts +8 -0
  111. package/dist/editable-cell/index.d.ts.map +1 -0
  112. package/dist/editable-cell/index.js +8 -0
  113. package/dist/editable-cell/index.js.map +1 -0
  114. package/dist/editable-cell/numeric-editable-cell.d.ts +3 -0
  115. package/dist/editable-cell/numeric-editable-cell.d.ts.map +1 -0
  116. package/dist/editable-cell/numeric-editable-cell.js +15 -0
  117. package/dist/editable-cell/numeric-editable-cell.js.map +1 -0
  118. package/dist/editable-cell/text-editable-cell.d.ts +9 -0
  119. package/dist/editable-cell/text-editable-cell.d.ts.map +1 -0
  120. package/dist/editable-cell/text-editable-cell.js +20 -0
  121. package/dist/editable-cell/text-editable-cell.js.map +1 -0
  122. package/dist/export/export.d.ts +10 -0
  123. package/dist/export/export.d.ts.map +1 -0
  124. package/dist/export/export.js +6 -0
  125. package/dist/export/export.js.map +1 -0
  126. package/dist/export/index.d.ts +2 -0
  127. package/dist/export/index.d.ts.map +1 -0
  128. package/dist/export/index.js +2 -0
  129. package/dist/export/index.js.map +1 -0
  130. package/dist/filters/column-menu-filters.d.ts +5 -0
  131. package/dist/filters/column-menu-filters.d.ts.map +1 -0
  132. package/dist/filters/column-menu-filters.js +9 -0
  133. package/dist/filters/column-menu-filters.js.map +1 -0
  134. package/dist/filters/datetime-filter/datetime-filter.d.ts +3 -0
  135. package/dist/filters/datetime-filter/datetime-filter.d.ts.map +1 -0
  136. package/dist/filters/datetime-filter/datetime-filter.js +71 -0
  137. package/dist/filters/datetime-filter/datetime-filter.js.map +1 -0
  138. package/dist/filters/field-values-filter.d.ts +6 -0
  139. package/dist/filters/field-values-filter.d.ts.map +1 -0
  140. package/dist/filters/field-values-filter.js +155 -0
  141. package/dist/filters/field-values-filter.js.map +1 -0
  142. package/dist/filters/index.d.ts +9 -0
  143. package/dist/filters/index.d.ts.map +1 -0
  144. package/dist/filters/index.js +9 -0
  145. package/dist/filters/index.js.map +1 -0
  146. package/dist/filters/multiselect-filter.d.ts +5 -0
  147. package/dist/filters/multiselect-filter.d.ts.map +1 -0
  148. package/dist/filters/multiselect-filter.js +107 -0
  149. package/dist/filters/multiselect-filter.js.map +1 -0
  150. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts +6 -0
  151. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts.map +1 -0
  152. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +6 -0
  153. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +1 -0
  154. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +3 -0
  155. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +1 -0
  156. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +27 -0
  157. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +1 -0
  158. package/dist/filters/range-filter/range-filter.d.ts +6 -0
  159. package/dist/filters/range-filter/range-filter.d.ts.map +1 -0
  160. package/dist/filters/range-filter/range-filter.js +117 -0
  161. package/dist/filters/range-filter/range-filter.js.map +1 -0
  162. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts +21 -0
  163. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts.map +1 -0
  164. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +82 -0
  165. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +1 -0
  166. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts +6 -0
  167. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts.map +1 -0
  168. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +6 -0
  169. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +1 -0
  170. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts +26 -0
  171. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map +1 -0
  172. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +69 -0
  173. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +1 -0
  174. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts +6 -0
  175. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts.map +1 -0
  176. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +30 -0
  177. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +1 -0
  178. package/dist/filters/time-filter/time-filter.d.ts +3 -0
  179. package/dist/filters/time-filter/time-filter.d.ts.map +1 -0
  180. package/dist/filters/time-filter/time-filter.js +71 -0
  181. package/dist/filters/time-filter/time-filter.js.map +1 -0
  182. package/dist/index.d.ts +10 -0
  183. package/dist/index.d.ts.map +1 -0
  184. package/dist/index.js +9 -0
  185. package/dist/index.js.map +1 -0
  186. package/dist/select-cell/index.d.ts +2 -0
  187. package/dist/select-cell/index.d.ts.map +1 -0
  188. package/dist/select-cell/index.js +2 -0
  189. package/dist/select-cell/index.js.map +1 -0
  190. package/dist/select-cell/select-cell.d.ts +25 -0
  191. package/dist/select-cell/select-cell.d.ts.map +1 -0
  192. package/dist/select-cell/select-cell.js +35 -0
  193. package/dist/select-cell/select-cell.js.map +1 -0
  194. package/dist/table-state.d.ts +161 -0
  195. package/dist/table-state.d.ts.map +1 -0
  196. package/dist/table-state.js +1106 -0
  197. package/dist/table-state.js.map +1 -0
  198. package/dist/table.d.ts +40 -0
  199. package/dist/table.d.ts.map +1 -0
  200. package/dist/table.js +231 -0
  201. package/dist/table.js.map +1 -0
  202. package/package.json +6 -6
  203. package/src/select-cell/select-cell.tsx +16 -44
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v22.1.3 (Wed Jun 29 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Revert "Table: allow user to select table row by clicking on any spot within cell with selection" [#120](https://github.com/servicetitan/anvil-uikit-contrib/pull/120) ([@kanoshin](https://github.com/kanoshin))
6
+
7
+ #### Authors: 1
8
+
9
+ - Kirill Anoshin ([@kanoshin](https://github.com/kanoshin))
10
+
11
+ ---
12
+
13
+ # v22.1.2 (Wed Jun 29 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Table: fix select cell behavior [#118](https://github.com/servicetitan/anvil-uikit-contrib/pull/118) ([@kanoshin](https://github.com/kanoshin))
18
+
19
+ #### Authors: 1
20
+
21
+ - Kirill Anoshin ([@kanoshin](https://github.com/kanoshin))
22
+
23
+ ---
24
+
1
25
  # v22.1.0 (Mon Jun 27 2022)
2
26
 
3
27
  :tada: This release contains work from a new contributor! :tada:
@@ -0,0 +1,4 @@
1
+ export * from './overview';
2
+ export * from './master-detail';
3
+ export * from './state-caching';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './overview';
2
+ export * from './master-detail';
3
+ export * from './state-caching';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { TableDetailRowProps } from '../..';
3
+ export declare const DetailTable: FC<TableDetailRowProps>;
4
+ //# sourceMappingURL=detail-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detail-table.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,EAAE,EAAE,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAsB,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAIhE,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,mBAAmB,CA8B/C,CAAC"}
@@ -0,0 +1,28 @@
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(() => {
13
+ store.initialize(dataItem);
14
+ return () => store.dispose();
15
+ }, [store, dataItem]);
16
+ if (!store.tableState) {
17
+ return null;
18
+ }
19
+ return (_jsxs(Table, Object.assign({ selectable: true, hideSelectAll: true, tableState: store.tableState, selectionControl: LockFieldIcon }, { children: [_jsx(TableColumn, { field: "Field" }), _jsx(TableColumn, { field: "OldValue" }), _jsx(TableColumn, { field: "NewValue" })] })));
20
+ }));
21
+ const LockFieldIcon = props => {
22
+ const { checked, disabled } = props;
23
+ if (!disabled) {
24
+ return _jsx(Checkbox, Object.assign({}, props));
25
+ }
26
+ return (_jsx("div", { children: checked ? (_jsx(Icon, { name: "check", className: "c-blue-300" })) : (_jsx(Icon, { name: "remove", className: "c-neutral-70" })) }));
27
+ };
28
+ //# sourceMappingURL=detail-table.js.map
@@ -0,0 +1 @@
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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,EAAE;QACX,OAAO,KAAC,QAAQ,oBAAK,KAAK,EAAI,CAAC;KAClC;IAED,OAAO,CACH,wBACK,OAAO,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,GAAG,CAC/C,CAAC,CAAC,CAAC,CACA,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,cAAc,GAAG,CAClD,GACC,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,104 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detail-table.store.js","sourceRoot":"","sources":["../../../src/demo/master-detail/detail-table.store.ts"],"names":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C,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;gBACrC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;aACjC,CAAC,CACL,CAAC,IAAuB,CAAC;YAE1B,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;YAEvF,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;QACvF,CAAC;KAAA;CACJ,CAAA;AA1De;IAAX,UAAU;8BAAc,UAAU;oDAAyC;AAO5E;IADC,MAAM,CAAC,gBAAgB,CAAC;8BACE,gBAAgB;0DAAC;AAElC;IAAT,QAAQ;;;gDAER;AAeD;IADC,MAAM;;;;kDAQN;AAlCQ,gBAAgB;IAD5B,UAAU,EAAE;;GACA,gBAAgB,CA2D5B;SA3DY,gBAAgB"}
@@ -0,0 +1,2 @@
1
+ export * from './table-master-detail';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './table-master-detail';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/demo/master-detail/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,103 @@
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
@@ -0,0 +1 @@
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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QAAQ;YACxC,MAAM,EAAE;gBACJ,GAAG;gBACH,UAAU,EAAE,IAAI,CAAC,UAAU;aAC9B;SACJ,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,UAAU,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"}
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=product-detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-detail.js","sourceRoot":"","sources":["../../../src/demo/master-detail/product-detail.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { ProductDetail } from './product-detail';
2
+ export declare const productDetails: ProductDetail[];
3
+ //# sourceMappingURL=product-details.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,55 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,26 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,16 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ import { Product } from './product';
2
+ export declare const products: Product[];
3
+ //# sourceMappingURL=products.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,117 @@
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
@@ -0,0 +1 @@
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,QAA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