@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
@@ -0,0 +1,53 @@
1
+ export const products = [
2
+ {
3
+ ProductID: 1,
4
+ ProductName: 'Chai',
5
+ Description: '10 boxes x 20 bags',
6
+ },
7
+ {
8
+ ProductID: 2,
9
+ ProductName: 'Chang',
10
+ Description: '24 - 12 oz bottles',
11
+ },
12
+ {
13
+ ProductID: 3,
14
+ ProductName: 'Aniseed Syrup',
15
+ Description: '12 - 550 ml bottles',
16
+ },
17
+ {
18
+ ProductID: 4,
19
+ ProductName: "Chef Anton's Cajun Seasoning",
20
+ Description: '48 - 6 oz jars',
21
+ },
22
+ {
23
+ ProductID: 5,
24
+ ProductName: "Chef Anton's Gumbo Mix",
25
+ Description: '36 boxes',
26
+ },
27
+ {
28
+ ProductID: 6,
29
+ ProductName: "Grandma's Boysenberry Spread",
30
+ Description: '12 - 8 oz jars',
31
+ },
32
+ {
33
+ ProductID: 7,
34
+ ProductName: "Uncle Bob's Organic Dried Pears",
35
+ Description: '12 - 1 lb pkgs.',
36
+ },
37
+ {
38
+ ProductID: 8,
39
+ ProductName: 'Northwoods Cranberry Sauce',
40
+ Description: '12 - 12 oz jars',
41
+ },
42
+ {
43
+ ProductID: 9,
44
+ ProductName: 'Mishi Kobe Niku',
45
+ Description: '18 - 500 g pkgs.',
46
+ },
47
+ {
48
+ ProductID: 10,
49
+ ProductName: 'Ikura',
50
+ Description: '12 - 200 ml jars',
51
+ },
52
+ ];
53
+ //# sourceMappingURL=products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/demo/state-caching/products.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAc;IAC/B;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,oBAAoB;KACpC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,oBAAoB;KACpC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,qBAAqB;KACrC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,8BAA8B;QAC3C,WAAW,EAAE,gBAAgB;KAChC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE,UAAU;KAC1B;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,8BAA8B;QAC3C,WAAW,EAAE,gBAAgB;KAChC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EAAE,iBAAiB;KACjC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,4BAA4B;QACzC,WAAW,EAAE,iBAAiB;KACjC;IACD;QACI,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,kBAAkB;KAClC;IACD;QACI,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,kBAAkB;KAClC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ export declare const TableStateCachingExample: FC;
3
+ //# sourceMappingURL=state-caching-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-caching-table.d.ts","sourceRoot":"","sources":["../../../src/demo/state-caching/state-caching-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,EAAE,EAAE,MAAM,OAAO,CAAC;AAOrC,eAAO,MAAM,wBAAwB,EAAE,EA2BtC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { provide, useDependencies } from '@servicetitan/react-ioc';
4
+ import { observer } from 'mobx-react';
5
+ import { ButtonGroup, Button } from '@servicetitan/design-system';
6
+ import { Table, TableColumn } from '../..';
7
+ import { TableStore } from './state-caching-table.store';
8
+ export const TableStateCachingExample = provide({
9
+ singletons: [TableStore],
10
+ })(observer(() => {
11
+ const [{ tableState, showProducts, showBeverages }] = useDependencies(TableStore);
12
+ return (_jsxs(Fragment, { children: [_jsxs(ButtonGroup, Object.assign({ className: "m-b-2" }, { children: [_jsx(Button, Object.assign({ small: true, onClick: showProducts }, { children: "Show Products" })), _jsx(Button, Object.assign({ small: true, onClick: showBeverages }, { children: "Show Beverages" }))] })), _jsxs(Table, Object.assign({ tableState: tableState, striped: true, sortable: true }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name" }), _jsx(TableColumn, { field: "Description", title: "Product Description" })] }))] }));
13
+ }));
14
+ //# sourceMappingURL=state-caching-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-caching-table.js","sourceRoot":"","sources":["../../../src/demo/state-caching/state-caching-table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAM,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,CAAC,MAAM,wBAAwB,GAAO,OAAO,CAAC;IAChD,UAAU,EAAE,CAAC,UAAU,CAAC;CAC3B,CAAC,CACE,QAAQ,CAAC,GAAG,EAAE;IACV,MAAM,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAElF,OAAO,CACH,MAAC,QAAQ,eACL,MAAC,WAAW,kBAAC,SAAS,EAAC,OAAO,iBAC1B,KAAC,MAAM,kBAAC,KAAK,QAAC,OAAO,EAAE,YAAY,mCAE1B,EACT,KAAC,MAAM,kBAAC,KAAK,QAAC,OAAO,EAAE,aAAa,oCAE3B,KACC,EAEd,MAAC,KAAK,kBAAC,UAAU,EAAE,UAAU,EAAE,OAAO,QAAC,QAAQ,uBAC3C,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,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,qBAAqB,GAAG,KAC3D,IACD,CACd,CAAC;AACN,CAAC,CAAC,CACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { TableState } from '../..';
2
+ import { Product } from './product';
3
+ import { TableStateModel } from '../../table-state';
4
+ export declare class TableStore {
5
+ productsTableState?: TableStateModel<number>;
6
+ beveragesTableState?: TableStateModel<number>;
7
+ tableState: TableState<Product, number, never, never>;
8
+ showProducts: () => void;
9
+ showBeverages: () => void;
10
+ private getProductsDataSource;
11
+ private getBeveragesDataSource;
12
+ }
13
+ //# sourceMappingURL=state-caching-table.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-caching-table.store.d.ts","sourceRoot":"","sources":["../../../src/demo/state-caching/state-caching-table.store.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,UAAU,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBACa,UAAU;IACnB,kBAAkB,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7C,mBAAmB,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAE9C,UAAU,4CAGP;IAEH,YAAY,aAMV;IAEF,aAAa,aAMX;IAEF,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,sBAAsB;CAGjC"}
@@ -0,0 +1,70 @@
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
+ import { injectable } from '@servicetitan/react-ioc';
8
+ import { InMemoryDataSource, TableState } from '../..';
9
+ import { products } from './products';
10
+ import { beverages } from './beverages';
11
+ let TableStore = class TableStore {
12
+ constructor() {
13
+ Object.defineProperty(this, "productsTableState", {
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true,
17
+ value: void 0
18
+ });
19
+ Object.defineProperty(this, "beveragesTableState", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "tableState", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: new TableState({
30
+ dataSource: this.getProductsDataSource(),
31
+ pageSize: 5,
32
+ })
33
+ });
34
+ Object.defineProperty(this, "showProducts", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: () => {
39
+ this.beveragesTableState = this.tableState.exportState();
40
+ this.tableState.setDataSource(this.getProductsDataSource(), {
41
+ reset: true,
42
+ initialState: this.productsTableState,
43
+ });
44
+ }
45
+ });
46
+ Object.defineProperty(this, "showBeverages", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: () => {
51
+ this.productsTableState = this.tableState.exportState();
52
+ this.tableState.setDataSource(this.getBeveragesDataSource(), {
53
+ reset: true,
54
+ initialState: this.beveragesTableState,
55
+ });
56
+ }
57
+ });
58
+ }
59
+ getProductsDataSource() {
60
+ return new InMemoryDataSource(products);
61
+ }
62
+ getBeveragesDataSource() {
63
+ return new InMemoryDataSource(beverages);
64
+ }
65
+ };
66
+ TableStore = __decorate([
67
+ injectable()
68
+ ], TableStore);
69
+ export { TableStore };
70
+ //# sourceMappingURL=state-caching-table.store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-caching-table.store.js","sourceRoot":"","sources":["../../../src/demo/state-caching/state-caching-table.store.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC,IAAa,UAAU,GAAvB,MAAa,UAAU;IAAvB;QACI;;;;;WAA6C;QAC7C;;;;;WAA8C;QAE9C;;;;mBAAa,IAAI,UAAU,CAAkB;gBACzC,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE;gBACxC,QAAQ,EAAE,CAAC;aACd,CAAC;WAAC;QAEH;;;;mBAAe,GAAG,EAAE;gBAChB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;gBACzD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE;oBACxD,KAAK,EAAE,IAAI;oBACX,YAAY,EAAE,IAAI,CAAC,kBAAkB;iBACxC,CAAC,CAAC;YACP,CAAC;WAAC;QAEF;;;;mBAAgB,GAAG,EAAE;gBACjB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;gBACxD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE;oBACzD,KAAK,EAAE,IAAI;oBACX,YAAY,EAAE,IAAI,CAAC,mBAAmB;iBACzC,CAAC,CAAC;YACP,CAAC;WAAC;IASN,CAAC;IAPW,qBAAqB;QACzB,OAAO,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEO,sBAAsB;QAC1B,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAA;AAhCY,UAAU;IADtB,UAAU,EAAE;GACA,UAAU,CAgCtB;SAhCY,UAAU"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const BooleanEditableCell: (props: import("..").TableCellProps<any, any, never, never>) => JSX.Element;
3
+ //# sourceMappingURL=boolean-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/boolean-editable-cell.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,mBAAmB,6EAE9B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { Checkbox } from '@servicetitan/design-system';
4
+ import { getEditableCell } from './get-editable-cell';
5
+ const Editor = observer(({ fieldState: { value, onChange }, className }) => {
6
+ const handleChange = (_0, checked) => {
7
+ onChange(checked);
8
+ };
9
+ return (_jsx("td", Object.assign({ className: className }, { children: _jsx(Checkbox, { checked: value, onChange: handleChange, style: { marginRight: 0 } }) })));
10
+ });
11
+ export const BooleanEditableCell = getEditableCell({
12
+ editor: Editor,
13
+ });
14
+ //# sourceMappingURL=boolean-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/boolean-editable-cell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC/C,MAAM,YAAY,GAAG,CAAC,EAAS,EAAE,OAAgB,EAAE,EAAE;QACjD,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACH,2BAAI,SAAS,EAAE,SAAS,gBACpB,KAAC,QAAQ,IAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,GAAI,IAC9E,CACR,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;IAC/C,MAAM,EAAE,MAAM;CACjB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const DateEditableCell: (props: import("..").TableCellProps<any, any, never, never>) => JSX.Element;
3
+ //# sourceMappingURL=date-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/date-editable-cell.tsx"],"names":[],"mappings":";AA0BA,eAAO,MAAM,gBAAgB,6EAE3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { DatePicker } from '@progress/kendo-react-dateinputs';
4
+ import { getEditableCell } from './get-editable-cell';
5
+ const Editor = observer(({ fieldState: { value, onChange, hasError, error }, className }) => {
6
+ const handleChange = (event) => {
7
+ onChange(event.value);
8
+ };
9
+ return (_jsx("td", Object.assign({ className: className }, { children: _jsx(DatePicker, { value: value, onChange: handleChange, valid: !hasError, validationMessage: error }) })));
10
+ });
11
+ export const DateEditableCell = getEditableCell({
12
+ editor: Editor,
13
+ });
14
+ //# sourceMappingURL=date-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/date-editable-cell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAyB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAChE,MAAM,YAAY,GAAG,CAAC,KAA4B,EAAE,EAAE;QAClD,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACH,2BAAI,SAAS,EAAE,SAAS,gBACpB,KAAC,UAAU,IACP,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,CAAC,QAAQ,EAChB,iBAAiB,EAAE,KAAK,GAC1B,IACD,CACR,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC5C,MAAM,EAAE,MAAM;CACjB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ComponentType } from 'react';
2
+ import { TableCellProps } from '../table';
3
+ import { PossibleFormState } from '../table-state';
4
+ export interface EditActionProps<T> extends TableCellProps<T> {
5
+ formState: PossibleFormState<T>;
6
+ }
7
+ interface GetActionCellParams<T> {
8
+ view: ComponentType<TableCellProps<T>>;
9
+ edit: ComponentType<EditActionProps<T>>;
10
+ }
11
+ export declare function getActionCell<T>({ view: ViewAction, edit: EditAction }: GetActionCellParams<T>): (props: TableCellProps<T>) => JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=get-action-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-action-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/get-action-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACzD,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;CACnC;AAED,UAAU,mBAAmB,CAAC,CAAC;IAC3B,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,IAAI,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,WAC5E,eAAe,CAAC,CAAC,iBAiBnC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { TableCell } from '@servicetitan/design-system';
3
+ export function getActionCell({ view: ViewAction, edit: EditAction }) {
4
+ return (props) => {
5
+ var _a;
6
+ const { tableState, dataItem, rowType } = props;
7
+ if (rowType !== 'data') {
8
+ return _jsx(TableCell, Object.assign({}, props));
9
+ }
10
+ const editingForm = ((_a = tableState === null || tableState === void 0 ? void 0 : tableState.dataSource) === null || _a === void 0 ? void 0 : _a.idSelector) &&
11
+ tableState.inEdit.get(tableState.dataSource.idSelector(dataItem));
12
+ if (editingForm) {
13
+ return _jsx(EditAction, Object.assign({}, props, { formState: editingForm.form }));
14
+ }
15
+ return _jsx(ViewAction, Object.assign({}, props));
16
+ };
17
+ }
18
+ //# sourceMappingURL=get-action-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-action-cell.js","sourceRoot":"","sources":["../../src/editable-cell/get-action-cell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAcxD,MAAM,UAAU,aAAa,CAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAA0B;IAC3F,OAAO,CAAC,KAAwB,EAAE,EAAE;;QAChC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QAEhD,IAAI,OAAO,KAAK,MAAM,EAAE;YACpB,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAI,CAAC;SACnC;QAED,MAAM,WAAW,GACb,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,UAAU;YAClC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEtE,IAAI,WAAW,EAAE;YACb,OAAO,KAAC,UAAU,oBAAK,KAAK,IAAE,SAAS,EAAE,WAAW,CAAC,IAAI,IAAI,CAAC;SACjE;QAED,OAAO,KAAC,UAAU,oBAAK,KAAK,EAAI,CAAC;IACrC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ComponentType } from 'react';
2
+ import { FieldState } from 'formstate';
3
+ import { TableCellProps } from '../table';
4
+ export interface EditorProps<T> extends TableCellProps<any> {
5
+ fieldState: FieldState<T>;
6
+ }
7
+ interface GetEditableCellParams<T> {
8
+ viewer?: ComponentType<TableCellProps<any>>;
9
+ editor: ComponentType<EditorProps<T>>;
10
+ }
11
+ export declare function getEditableCell<T>({ viewer: Viewer, editor: Editor, }: GetEditableCellParams<T>): (props: TableCellProps<any>) => JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=get-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/get-editable-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,GAAG,CAAC;IACvD,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAC7B;AAED,UAAU,qBAAqB,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACzC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,EAC/B,MAAM,EAAE,MAAkB,EAC1B,MAAM,EAAE,MAAM,GACjB,EAAE,qBAAqB,CAAC,CAAC,CAAC,WACR,eAAe,GAAG,CAAC,iBAiBrC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { TableCell } from '@servicetitan/design-system';
3
+ export function getEditableCell({ viewer: Viewer = TableCell, editor: Editor, }) {
4
+ return (props) => {
5
+ var _a;
6
+ const { tableState, field, dataItem, rowType } = props;
7
+ if (rowType !== 'data') {
8
+ return _jsx(TableCell, Object.assign({}, props));
9
+ }
10
+ const editingForm = ((_a = tableState === null || tableState === void 0 ? void 0 : tableState.dataSource) === null || _a === void 0 ? void 0 : _a.idSelector) &&
11
+ tableState.inEdit.get(tableState.dataSource.idSelector(dataItem));
12
+ if (field && editingForm && (!editingForm.field || editingForm.field === field)) {
13
+ return _jsx(Editor, Object.assign({}, props, { fieldState: editingForm.form.$[field] }));
14
+ }
15
+ return _jsx(Viewer, Object.assign({}, props));
16
+ };
17
+ }
18
+ //# sourceMappingURL=get-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/get-editable-cell.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAYxD,MAAM,UAAU,eAAe,CAAI,EAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,MAAM,GACS;IACvB,OAAO,CAAC,KAA0B,EAAE,EAAE;;QAClC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QAEvD,IAAI,OAAO,KAAK,MAAM,EAAE;YACpB,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAI,CAAC;SACnC;QAED,MAAM,WAAW,GACb,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,UAAU;YAClC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEtE,IAAI,KAAK,IAAI,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE;YAC7E,OAAO,KAAC,MAAM,oBAAK,KAAK,IAAE,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;SACvE;QAED,OAAO,KAAC,MAAM,oBAAK,KAAK,EAAI,CAAC;IACjC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ComponentType } from 'react';
2
+ import { TableCellProps } from '../table';
3
+ import { Option } from '@servicetitan/form';
4
+ interface GetSelectEditableCellParams<T> {
5
+ options: Option<T>[];
6
+ viewer?: ComponentType<TableCellProps<any>>;
7
+ }
8
+ export declare function getSelectEditableCell<T>({ options, viewer }: GetSelectEditableCellParams<T>): (props: TableCellProps<any, any, never, never>) => JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=get-select-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-select-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/get-select-editable-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAM,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,UAAU,2BAA2B,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,2BAA2B,CAAC,CAAC,CAAC,kEA8B3F"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { DropDownList } from '@progress/kendo-react-dropdowns';
4
+ import { getEditableCell } from './get-editable-cell';
5
+ import classNames from 'classnames';
6
+ export function getSelectEditableCell({ options, viewer }) {
7
+ const Editor = observer(({ fieldState: { value, onChange, hasError, error }, className }) => {
8
+ const selected = options.find(option => option.value === value);
9
+ const handleChange = (event) => {
10
+ onChange(event.target.value.value);
11
+ };
12
+ return (_jsx("td", Object.assign({ className: classNames('of-visible', className) }, { children: _jsx(DropDownList, { data: options, value: selected, onChange: handleChange, dataItemKey: "value", textField: "text", valid: !hasError, validationMessage: error, className: "w-100" }) })));
13
+ });
14
+ return getEditableCell({
15
+ viewer,
16
+ editor: Editor,
17
+ });
18
+ }
19
+ //# sourceMappingURL=get-select-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-select-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/get-select-editable-cell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,YAAY,EAA2B,MAAM,iCAAiC,CAAC;AAGxF,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAInE,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAAM,UAAU,qBAAqB,CAAI,EAAE,OAAO,EAAE,MAAM,EAAkC;IACxF,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAEhE,MAAM,YAAY,GAAG,CAAC,KAA8B,EAAE,EAAE;YACpD,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,OAAO,CACH,2BAAI,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,gBAC9C,KAAC,YAAY,IACT,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAC,OAAO,EACnB,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,CAAC,QAAQ,EAChB,iBAAiB,EAAE,KAAK,EACxB,SAAS,EAAC,OAAO,GACnB,IACD,CACR,CAAC;IACN,CAAC,CACJ,CAAC;IAEF,OAAO,eAAe,CAAC;QACnB,MAAM;QACN,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './get-action-cell';
2
+ export * from './get-editable-cell';
3
+ export * from './text-editable-cell';
4
+ export * from './numeric-editable-cell';
5
+ export * from './boolean-editable-cell';
6
+ export * from './date-editable-cell';
7
+ export * from './get-select-editable-cell';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './get-action-cell';
2
+ export * from './get-editable-cell';
3
+ export * from './text-editable-cell';
4
+ export * from './numeric-editable-cell';
5
+ export * from './boolean-editable-cell';
6
+ export * from './date-editable-cell';
7
+ export * from './get-select-editable-cell';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const NumericEditableCell: (props: import("..").TableCellProps<any, any, never, never>) => JSX.Element;
3
+ //# sourceMappingURL=numeric-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/numeric-editable-cell.tsx"],"names":[],"mappings":";AA2BA,eAAO,MAAM,mBAAmB,6EAE9B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { NumericTextBox } from '@progress/kendo-react-inputs';
4
+ import { getEditableCell } from './get-editable-cell';
5
+ const Editor = observer(({ fieldState: { value, onChange, hasError, error }, className }) => {
6
+ const handleChange = (event) => {
7
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
8
+ onChange(event.value || undefined);
9
+ };
10
+ return (_jsx("td", Object.assign({ className: className }, { children: _jsx(NumericTextBox, { value: value, onChange: handleChange, valid: !hasError, validationMessage: error }) })));
11
+ });
12
+ export const NumericEditableCell = getEditableCell({
13
+ editor: Editor,
14
+ });
15
+ //# sourceMappingURL=numeric-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/numeric-editable-cell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAA6B,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAChE,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAE,EAAE;QACtD,wEAAwE;QACxE,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,OAAO,CACH,2BAAI,SAAS,EAAE,SAAS,gBACpB,KAAC,cAAc,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,CAAC,QAAQ,EAChB,iBAAiB,EAAE,KAAK,GAC1B,IACD,CACR,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;IAC/C,MAAM,EAAE,MAAM;CACjB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface GetTextEditableCellParams<T> {
3
+ placeholder?: string;
4
+ isDisabled?(dataItem: T): boolean;
5
+ }
6
+ export declare function getTextEditableCell<T>({ placeholder, isDisabled, }?: GetTextEditableCellParams<T>): (props: import("..").TableCellProps<any, any, never, never>) => JSX.Element;
7
+ export declare const TextEditableCell: (props: import("..").TableCellProps<any, any, never, never>) => JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=text-editable-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/text-editable-cell.tsx"],"names":[],"mappings":";AAUA,UAAU,yBAAyB,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EACnC,WAAW,EACX,UAAU,GACb,GAAE,yBAAyB,CAAC,CAAC,CAAM,+EA2BnC;AAED,eAAO,MAAM,gBAAgB,6EAAwB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { Input } from '@progress/kendo-react-inputs';
4
+ import { getEditableCell } from './get-editable-cell';
5
+ import { Label } from '@servicetitan/form';
6
+ export function getTextEditableCell({ placeholder, isDisabled, } = {}) {
7
+ const Editor = observer(({ fieldState: { value, onChange, hasError, error }, dataItem, className }) => {
8
+ const handleChange = (event) => {
9
+ if (typeof event.target.value === 'string') {
10
+ onChange(event.target.value);
11
+ }
12
+ };
13
+ return (_jsxs("td", Object.assign({ className: className }, { children: [_jsx(Input, { value: value, onChange: handleChange, valid: !hasError, placeholder: placeholder, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(dataItem) }), hasError && _jsx(Label, { label: "", hasError: true, error: error })] })));
14
+ });
15
+ return getEditableCell({
16
+ editor: Editor,
17
+ });
18
+ }
19
+ export const TextEditableCell = getTextEditableCell();
20
+ //# sourceMappingURL=text-editable-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/text-editable-cell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAoB,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAO3C,MAAM,UAAU,mBAAmB,CAAI,EACnC,WAAW,EACX,UAAU,MACoB,EAAE;IAChC,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;QAC1E,MAAM,YAAY,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC7C,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;gBACxC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAChC;QACL,CAAC,CAAC;QAEF,OAAO,CACH,4BAAI,SAAS,EAAE,SAAS,iBACpB,KAAC,KAAK,IACF,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,CAAC,QAAQ,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,CAAC,GAClC,EACD,QAAQ,IAAI,KAAC,KAAK,IAAC,KAAK,EAAC,EAAE,EAAC,QAAQ,QAAC,KAAK,EAAE,KAAK,GAAI,KACrD,CACR,CAAC;IACN,CAAC,CACJ,CAAC;IAEF,OAAO,eAAe,CAAC;QACnB,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ interface ExportProps {
3
+ className?: string;
4
+ totalCount?: number;
5
+ exportPdf?: () => void;
6
+ exportExcel?: () => void;
7
+ }
8
+ export declare const Export: FC<ExportProps>;
9
+ export {};
10
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/export/export.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAM3B,UAAU,WAAW;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAqBlC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Dropdown, Icon } from '@servicetitan/design-system';
3
+ import { formatNumber } from 'accounting';
4
+ import * as Styles from './export.module.css';
5
+ export const Export = ({ className, totalCount, exportPdf, exportExcel }) => (_jsx("div", Object.assign({ className: className }, { children: _jsx(Dropdown, Object.assign({ trigger: _jsxs(Button, Object.assign({ className: "qa-export-dropdown", iconName: "expand_more", iconPosition: "right" }, { children: [_jsx(Icon, { name: "file_download" }), _jsxs("span", { children: ["Download", !!totalCount && ` (${formatNumber(totalCount, 0)})`] })] })), icon: null }, { children: _jsxs(Dropdown.Menu, Object.assign({ className: Styles.dropdown }, { children: [exportPdf && (_jsx(Dropdown.Item, { className: "qa-export-pdf", text: ".PDF", onClick: exportPdf })), exportExcel && (_jsx(Dropdown.Item, { className: "qa-export-excel", text: ".XLSX", onClick: exportExcel }))] })) })) })));
6
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/export/export.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAS9C,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC1F,4BAAK,SAAS,EAAE,SAAS,gBACrB,KAAC,QAAQ,kBACL,OAAO,EACH,MAAC,MAAM,kBAAC,SAAS,EAAC,oBAAoB,EAAC,QAAQ,EAAC,aAAa,EAAC,YAAY,EAAC,OAAO,iBAC9E,KAAC,IAAI,IAAC,IAAI,EAAC,eAAe,GAAG,EAC7B,uCAAe,CAAC,CAAC,UAAU,IAAI,KAAK,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,IAAQ,KACrE,EAEb,IAAI,EAAE,IAAI,gBAEV,MAAC,QAAQ,CAAC,IAAI,kBAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,iBACpC,SAAS,IAAI,CACV,KAAC,QAAQ,CAAC,IAAI,IAAC,SAAS,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,SAAS,GAAI,CAC9E,EACA,WAAW,IAAI,CACZ,KAAC,QAAQ,CAAC,IAAI,IAAC,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,WAAW,GAAI,CACnF,KACW,IACT,IACT,CACT,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './export';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './export';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ComponentType } from 'react';
2
+ import { TableColumnMenuProps, TableFilterCellProps } from '@servicetitan/design-system';
3
+ export declare const StandardColumnMenuFilter: (props: TableColumnMenuProps) => JSX.Element;
4
+ export declare function renderCustomColumnMenuFilter(FilterCell: ComponentType<TableFilterCellProps>, double?: boolean): (props: TableColumnMenuProps) => JSX.Element;
5
+ //# sourceMappingURL=column-menu-filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-menu-filters.d.ts","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAM,MAAM,OAAO,CAAC;AAC1C,OAAO,EAEH,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,wBAAwB,UAAW,oBAAoB,gBAEnE,CAAC;AAEF,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC/C,MAAM,CAAC,EAAE,OAAO,WA0BD,oBAAoB,iBAGtC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TableColumnMenuFilter, } from '@servicetitan/design-system';
3
+ import { DropDownList } from '@progress/kendo-react-dropdowns';
4
+ export const StandardColumnMenuFilter = (props) => (_jsx(TableColumnMenuFilter, Object.assign({}, props, { expanded: true })));
5
+ export function renderCustomColumnMenuFilter(FilterCell, double) {
6
+ const filterUI = ({ firstFilterProps, secondFilterProps, logicData, logicValue, onLogicChange, }) => (_jsxs("div", { children: [_jsx(FilterCell, Object.assign({}, firstFilterProps)), double && (_jsxs("div", { children: [_jsx(DropDownList, { data: logicData, value: logicValue, onChange: onLogicChange, className: "k-filter-and", textField: "text" }), _jsx(FilterCell, Object.assign({}, secondFilterProps))] }))] }));
7
+ return (props) => (_jsx(TableColumnMenuFilter, Object.assign({}, props, { filterUI: filterUI, expanded: true })));
8
+ }
9
+ //# sourceMappingURL=column-menu-filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-menu-filters.js","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":";AACA,OAAO,EACH,qBAAqB,GAGxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,CACrE,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,UAAG,CAChD,CAAC;AAEF,MAAM,UAAU,4BAA4B,CACxC,UAA+C,EAC/C,MAAgB;IAEhB,MAAM,QAAQ,GAAqC,CAAC,EAChD,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,EAAE,CAAC,CACF,0BACI,KAAC,UAAU,oBAAK,gBAAgB,EAAI,EACnC,MAAM,IAAI,CACP,0BACI,KAAC,YAAY,IACT,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAC,cAAc,EACxB,SAAS,EAAC,MAAM,GAClB,EACF,KAAC,UAAU,oBAAK,iBAAiB,EAAI,IACnC,CACT,IACC,CACT,CAAC;IAEF,OAAO,CAAC,KAA2B,EAAE,EAAE,CAAC,CACpC,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,UAAG,CACpE,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const DateTimeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
3
+ //# sourceMappingURL=datetime-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/datetime-filter/datetime-filter.tsx"],"names":[],"mappings":";AAgFA,eAAO,MAAM,wBAAwB,oFAAyD,CAAC"}