@servicetitan/table 21.7.2 → 22.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. package/CHANGELOG.md +566 -0
  2. package/package.json +10 -10
  3. package/src/select-cell/select-cell.tsx +44 -16
  4. package/dist/demo/index.d.ts +0 -4
  5. package/dist/demo/index.d.ts.map +0 -1
  6. package/dist/demo/index.js +0 -4
  7. package/dist/demo/index.js.map +0 -1
  8. package/dist/demo/master-detail/detail-table.d.ts +0 -4
  9. package/dist/demo/master-detail/detail-table.d.ts.map +0 -1
  10. package/dist/demo/master-detail/detail-table.js +0 -28
  11. package/dist/demo/master-detail/detail-table.js.map +0 -1
  12. package/dist/demo/master-detail/detail-table.store.d.ts +0 -14
  13. package/dist/demo/master-detail/detail-table.store.d.ts.map +0 -1
  14. package/dist/demo/master-detail/detail-table.store.js +0 -104
  15. package/dist/demo/master-detail/detail-table.store.js.map +0 -1
  16. package/dist/demo/master-detail/index.d.ts +0 -2
  17. package/dist/demo/master-detail/index.d.ts.map +0 -1
  18. package/dist/demo/master-detail/index.js +0 -2
  19. package/dist/demo/master-detail/index.js.map +0 -1
  20. package/dist/demo/master-detail/master-table.store.d.ts +0 -14
  21. package/dist/demo/master-detail/master-table.store.d.ts.map +0 -1
  22. package/dist/demo/master-detail/master-table.store.js +0 -103
  23. package/dist/demo/master-detail/master-table.store.js.map +0 -1
  24. package/dist/demo/master-detail/product-detail.d.ts +0 -8
  25. package/dist/demo/master-detail/product-detail.d.ts.map +0 -1
  26. package/dist/demo/master-detail/product-detail.js +0 -2
  27. package/dist/demo/master-detail/product-detail.js.map +0 -1
  28. package/dist/demo/master-detail/product-details.d.ts +0 -3
  29. package/dist/demo/master-detail/product-details.d.ts.map +0 -1
  30. package/dist/demo/master-detail/product-details.js +0 -55
  31. package/dist/demo/master-detail/product-details.js.map +0 -1
  32. package/dist/demo/master-detail/product.d.ts +0 -26
  33. package/dist/demo/master-detail/product.d.ts.map +0 -1
  34. package/dist/demo/master-detail/product.js +0 -16
  35. package/dist/demo/master-detail/product.js.map +0 -1
  36. package/dist/demo/master-detail/products.d.ts +0 -3
  37. package/dist/demo/master-detail/products.d.ts.map +0 -1
  38. package/dist/demo/master-detail/products.js +0 -117
  39. package/dist/demo/master-detail/products.js.map +0 -1
  40. package/dist/demo/master-detail/table-master-detail.d.ts +0 -3
  41. package/dist/demo/master-detail/table-master-detail.d.ts.map +0 -1
  42. package/dist/demo/master-detail/table-master-detail.js +0 -24
  43. package/dist/demo/master-detail/table-master-detail.js.map +0 -1
  44. package/dist/demo/overview/actions-cell.d.ts +0 -5
  45. package/dist/demo/overview/actions-cell.d.ts.map +0 -1
  46. package/dist/demo/overview/actions-cell.js +0 -38
  47. package/dist/demo/overview/actions-cell.js.map +0 -1
  48. package/dist/demo/overview/index.d.ts +0 -2
  49. package/dist/demo/overview/index.d.ts.map +0 -1
  50. package/dist/demo/overview/index.js +0 -2
  51. package/dist/demo/overview/index.js.map +0 -1
  52. package/dist/demo/overview/product.d.ts +0 -27
  53. package/dist/demo/overview/product.d.ts.map +0 -1
  54. package/dist/demo/overview/product.js +0 -16
  55. package/dist/demo/overview/product.js.map +0 -1
  56. package/dist/demo/overview/products.d.ts +0 -3
  57. package/dist/demo/overview/products.d.ts.map +0 -1
  58. package/dist/demo/overview/products.js +0 -127
  59. package/dist/demo/overview/products.js.map +0 -1
  60. package/dist/demo/overview/table.d.ts +0 -6
  61. package/dist/demo/overview/table.d.ts.map +0 -1
  62. package/dist/demo/overview/table.js +0 -44
  63. package/dist/demo/overview/table.js.map +0 -1
  64. package/dist/demo/overview/table.store.d.ts +0 -15
  65. package/dist/demo/overview/table.store.d.ts.map +0 -1
  66. package/dist/demo/overview/table.store.js +0 -92
  67. package/dist/demo/overview/table.store.js.map +0 -1
  68. package/dist/demo/state-caching/beverages.d.ts +0 -3
  69. package/dist/demo/state-caching/beverages.d.ts.map +0 -1
  70. package/dist/demo/state-caching/beverages.js +0 -48
  71. package/dist/demo/state-caching/beverages.js.map +0 -1
  72. package/dist/demo/state-caching/index.d.ts +0 -2
  73. package/dist/demo/state-caching/index.d.ts.map +0 -1
  74. package/dist/demo/state-caching/index.js +0 -2
  75. package/dist/demo/state-caching/index.js.map +0 -1
  76. package/dist/demo/state-caching/product.d.ts +0 -6
  77. package/dist/demo/state-caching/product.d.ts.map +0 -1
  78. package/dist/demo/state-caching/product.js +0 -2
  79. package/dist/demo/state-caching/product.js.map +0 -1
  80. package/dist/demo/state-caching/products.d.ts +0 -3
  81. package/dist/demo/state-caching/products.d.ts.map +0 -1
  82. package/dist/demo/state-caching/products.js +0 -53
  83. package/dist/demo/state-caching/products.js.map +0 -1
  84. package/dist/demo/state-caching/state-caching-table.d.ts +0 -3
  85. package/dist/demo/state-caching/state-caching-table.d.ts.map +0 -1
  86. package/dist/demo/state-caching/state-caching-table.js +0 -14
  87. package/dist/demo/state-caching/state-caching-table.js.map +0 -1
  88. package/dist/demo/state-caching/state-caching-table.store.d.ts +0 -13
  89. package/dist/demo/state-caching/state-caching-table.store.d.ts.map +0 -1
  90. package/dist/demo/state-caching/state-caching-table.store.js +0 -70
  91. package/dist/demo/state-caching/state-caching-table.store.js.map +0 -1
  92. package/dist/editable-cell/boolean-editable-cell.d.ts +0 -3
  93. package/dist/editable-cell/boolean-editable-cell.d.ts.map +0 -1
  94. package/dist/editable-cell/boolean-editable-cell.js +0 -14
  95. package/dist/editable-cell/boolean-editable-cell.js.map +0 -1
  96. package/dist/editable-cell/date-editable-cell.d.ts +0 -3
  97. package/dist/editable-cell/date-editable-cell.d.ts.map +0 -1
  98. package/dist/editable-cell/date-editable-cell.js +0 -14
  99. package/dist/editable-cell/date-editable-cell.js.map +0 -1
  100. package/dist/editable-cell/get-action-cell.d.ts +0 -13
  101. package/dist/editable-cell/get-action-cell.d.ts.map +0 -1
  102. package/dist/editable-cell/get-action-cell.js +0 -18
  103. package/dist/editable-cell/get-action-cell.js.map +0 -1
  104. package/dist/editable-cell/get-editable-cell.d.ts +0 -13
  105. package/dist/editable-cell/get-editable-cell.d.ts.map +0 -1
  106. package/dist/editable-cell/get-editable-cell.js +0 -18
  107. package/dist/editable-cell/get-editable-cell.js.map +0 -1
  108. package/dist/editable-cell/get-select-editable-cell.d.ts +0 -10
  109. package/dist/editable-cell/get-select-editable-cell.d.ts.map +0 -1
  110. package/dist/editable-cell/get-select-editable-cell.js +0 -19
  111. package/dist/editable-cell/get-select-editable-cell.js.map +0 -1
  112. package/dist/editable-cell/index.d.ts +0 -8
  113. package/dist/editable-cell/index.d.ts.map +0 -1
  114. package/dist/editable-cell/index.js +0 -8
  115. package/dist/editable-cell/index.js.map +0 -1
  116. package/dist/editable-cell/numeric-editable-cell.d.ts +0 -3
  117. package/dist/editable-cell/numeric-editable-cell.d.ts.map +0 -1
  118. package/dist/editable-cell/numeric-editable-cell.js +0 -15
  119. package/dist/editable-cell/numeric-editable-cell.js.map +0 -1
  120. package/dist/editable-cell/text-editable-cell.d.ts +0 -9
  121. package/dist/editable-cell/text-editable-cell.d.ts.map +0 -1
  122. package/dist/editable-cell/text-editable-cell.js +0 -20
  123. package/dist/editable-cell/text-editable-cell.js.map +0 -1
  124. package/dist/export/export.d.ts +0 -10
  125. package/dist/export/export.d.ts.map +0 -1
  126. package/dist/export/export.js +0 -6
  127. package/dist/export/export.js.map +0 -1
  128. package/dist/export/index.d.ts +0 -2
  129. package/dist/export/index.d.ts.map +0 -1
  130. package/dist/export/index.js +0 -2
  131. package/dist/export/index.js.map +0 -1
  132. package/dist/filters/column-menu-filters.d.ts +0 -5
  133. package/dist/filters/column-menu-filters.d.ts.map +0 -1
  134. package/dist/filters/column-menu-filters.js +0 -9
  135. package/dist/filters/column-menu-filters.js.map +0 -1
  136. package/dist/filters/datetime-filter/datetime-filter.d.ts +0 -3
  137. package/dist/filters/datetime-filter/datetime-filter.d.ts.map +0 -1
  138. package/dist/filters/datetime-filter/datetime-filter.js +0 -71
  139. package/dist/filters/datetime-filter/datetime-filter.js.map +0 -1
  140. package/dist/filters/field-values-filter.d.ts +0 -6
  141. package/dist/filters/field-values-filter.d.ts.map +0 -1
  142. package/dist/filters/field-values-filter.js +0 -155
  143. package/dist/filters/field-values-filter.js.map +0 -1
  144. package/dist/filters/index.d.ts +0 -9
  145. package/dist/filters/index.d.ts.map +0 -1
  146. package/dist/filters/index.js +0 -9
  147. package/dist/filters/index.js.map +0 -1
  148. package/dist/filters/multiselect-filter.d.ts +0 -5
  149. package/dist/filters/multiselect-filter.d.ts.map +0 -1
  150. package/dist/filters/multiselect-filter.js +0 -107
  151. package/dist/filters/multiselect-filter.js.map +0 -1
  152. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts +0 -6
  153. package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts.map +0 -1
  154. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +0 -6
  155. package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +0 -1
  156. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +0 -3
  157. package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +0 -1
  158. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +0 -27
  159. package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +0 -1
  160. package/dist/filters/range-filter/range-filter.d.ts +0 -6
  161. package/dist/filters/range-filter/range-filter.d.ts.map +0 -1
  162. package/dist/filters/range-filter/range-filter.js +0 -117
  163. package/dist/filters/range-filter/range-filter.js.map +0 -1
  164. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts +0 -21
  165. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts.map +0 -1
  166. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +0 -82
  167. package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +0 -1
  168. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts +0 -6
  169. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts.map +0 -1
  170. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +0 -6
  171. package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +0 -1
  172. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts +0 -26
  173. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map +0 -1
  174. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +0 -69
  175. package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +0 -1
  176. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts +0 -6
  177. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts.map +0 -1
  178. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +0 -30
  179. package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +0 -1
  180. package/dist/filters/time-filter/time-filter.d.ts +0 -3
  181. package/dist/filters/time-filter/time-filter.d.ts.map +0 -1
  182. package/dist/filters/time-filter/time-filter.js +0 -71
  183. package/dist/filters/time-filter/time-filter.js.map +0 -1
  184. package/dist/index.d.ts +0 -10
  185. package/dist/index.d.ts.map +0 -1
  186. package/dist/index.js +0 -9
  187. package/dist/index.js.map +0 -1
  188. package/dist/select-cell/index.d.ts +0 -2
  189. package/dist/select-cell/index.d.ts.map +0 -1
  190. package/dist/select-cell/index.js +0 -2
  191. package/dist/select-cell/index.js.map +0 -1
  192. package/dist/select-cell/select-cell.d.ts +0 -25
  193. package/dist/select-cell/select-cell.d.ts.map +0 -1
  194. package/dist/select-cell/select-cell.js +0 -35
  195. package/dist/select-cell/select-cell.js.map +0 -1
  196. package/dist/table-state.d.ts +0 -161
  197. package/dist/table-state.d.ts.map +0 -1
  198. package/dist/table-state.js +0 -1106
  199. package/dist/table-state.js.map +0 -1
  200. package/dist/table.d.ts +0 -40
  201. package/dist/table.d.ts.map +0 -1
  202. package/dist/table.js +0 -231
  203. package/dist/table.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1,5 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const DateTimeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
3
- //# sourceMappingURL=datetime-filter.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,71 +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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { Component, Fragment } from 'react';
12
- import { observer } from 'mobx-react';
13
- import { observable, action, makeObservable } from 'mobx';
14
- import { DropDownList } from '@progress/kendo-react-dropdowns';
15
- import { DatePicker, TimePicker, } from '@progress/kendo-react-dateinputs';
16
- import { IsUnaryFilter, cellOperatorChange, } from '@progress/kendo-react-grid/dist/npm/filterCommon';
17
- import { renderCustomColumnMenuFilter } from '../column-menu-filters';
18
- import * as Styles from './datetime-filter.module.css';
19
- let DateTimeFilterCell = class DateTimeFilterCell extends Component {
20
- constructor(props) {
21
- var _a;
22
- super(props);
23
- Object.defineProperty(this, "operator", {
24
- enumerable: true,
25
- configurable: true,
26
- writable: true,
27
- value: (_a = this.props.operators.find(o => o.operator === this.props.operator)) !== null && _a !== void 0 ? _a : this.props.operators[0]
28
- });
29
- Object.defineProperty(this, "handleOperatorChange", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: (event) => {
34
- this.operator = event.target.value;
35
- cellOperatorChange(event, this.props.value, this.props.onChange);
36
- }
37
- });
38
- Object.defineProperty(this, "handleChange", {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: (event) => {
43
- var _a;
44
- const value = event.value;
45
- this.props.onChange({
46
- value,
47
- operator: (_a = this.props.operator) !== null && _a !== void 0 ? _a : '',
48
- syntheticEvent: event.syntheticEvent,
49
- });
50
- }
51
- });
52
- makeObservable(this);
53
- }
54
- render() {
55
- return (_jsxs(Fragment, { children: [_jsx(DropDownList, { value: this.operator, onChange: this.handleOperatorChange, data: this.props.operators, dataItemKey: "operator", textField: "text" }), !IsUnaryFilter(this.operator.operator) && (_jsxs(Fragment, { children: [_jsx(DatePicker, { value: this.props.value, onChange: this.handleChange, className: Styles.datePicker }), _jsx(TimePicker, { value: this.props.value, onChange: this.handleChange, className: Styles.timePicker })] }))] }));
56
- }
57
- };
58
- __decorate([
59
- observable,
60
- __metadata("design:type", Object)
61
- ], DateTimeFilterCell.prototype, "operator", void 0);
62
- __decorate([
63
- action,
64
- __metadata("design:type", Object)
65
- ], DateTimeFilterCell.prototype, "handleOperatorChange", void 0);
66
- DateTimeFilterCell = __decorate([
67
- observer,
68
- __metadata("design:paramtypes", [Object])
69
- ], DateTimeFilterCell);
70
- export const DateTimeColumnMenuFilter = renderCustomColumnMenuFilter(DateTimeFilterCell, true);
71
- //# sourceMappingURL=datetime-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datetime-filter.js","sourceRoot":"","sources":["../../../src/filters/datetime-filter/datetime-filter.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,YAAY,EAA2B,MAAM,iCAAiC,CAAC;AACxF,OAAO,EACH,UAAU,EAEV,UAAU,GAEb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACH,aAAa,EACb,kBAAkB,GACr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B,WAAW,EAAC,UAAU,EACtB,SAAS,EAAC,MAAM,GAClB,EACD,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CACvC,MAAC,QAAQ,eACL,KAAC,UAAU,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,SAAS,EAAE,MAAM,CAAC,UAAU,GAC9B,EACF,KAAC,UAAU,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,SAAS,EAAE,MAAM,CAAC,UAAU,GAC9B,IACK,CACd,IACM,CACd,CAAC;IACN,CAAC;CACJ,CAAA;AApDe;IAAX,UAAU;;oDAEiB;AAQ5B;IADC,MAAM;;gEAIL;AAdA,kBAAkB;IADvB,QAAQ;;GACH,kBAAkB,CAqDvB;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { IdType } from '@servicetitan/data-query';
3
- import { TableState } from '../table-state';
4
- export declare function operator<T>(item: T, value: T[]): boolean;
5
- export declare function fieldValuesColumnMenuFilter<T, TId extends IdType = never>(tableState: TableState<T, TId>, renderItem?: (value: T[keyof T]) => string): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
6
- //# sourceMappingURL=field-values-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-values-filter.d.ts","sourceRoot":"","sources":["../../src/filters/field-values-filter.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAc,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,WAE9C;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,GAAG,SAAS,MAAM,GAAG,KAAK,EACrE,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,EAC9B,UAAU,GAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,MAA0B,sFAiHhE"}
@@ -1,155 +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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
- import { Checkbox } from '@servicetitan/design-system';
21
- import { Component, Fragment } from 'react';
22
- import { observer } from 'mobx-react';
23
- import { observable, computed, runInAction, action, makeObservable } from 'mobx';
24
- import { Input } from '@progress/kendo-react-inputs';
25
- import { renderCustomColumnMenuFilter } from './column-menu-filters';
26
- export function operator(item, value) {
27
- return value.includes(item);
28
- }
29
- export function fieldValuesColumnMenuFilter(tableState, renderItem = defaultRenderItem) {
30
- let FieldValuesFilterCell = class FieldValuesFilterCell extends Component {
31
- constructor(props) {
32
- super(props);
33
- Object.defineProperty(this, "data", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: []
38
- });
39
- Object.defineProperty(this, "searchQuery", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: ''
44
- });
45
- Object.defineProperty(this, "handleSearchQueryChange", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: (ev) => {
50
- if (typeof ev.target.value === 'string') {
51
- this.searchQuery = ev.target.value;
52
- }
53
- }
54
- });
55
- Object.defineProperty(this, "handleChange", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: (value, checked, ev) => {
60
- const newFilterValue = checked
61
- ? this.value.concat(value.value)
62
- : this.value.filter((v) => v !== value.value);
63
- const hasValue = newFilterValue.length > 0;
64
- this.props.onChange({
65
- value: hasValue ? newFilterValue : '',
66
- operator: hasValue ? operator : '',
67
- syntheticEvent: ev,
68
- });
69
- }
70
- });
71
- makeObservable(this);
72
- }
73
- get processedData() {
74
- const searchQuery = this.searchQuery.toLowerCase();
75
- const filteredData = !searchQuery
76
- ? this.data
77
- : this.data.filter(v => v.text.toLowerCase().includes(searchQuery));
78
- return filteredData.slice().sort((a, b) => {
79
- if (a.text === b.text) {
80
- return 0;
81
- }
82
- return a.text < b.text ? -1 : 1;
83
- });
84
- }
85
- get field() {
86
- const field = this.props.field;
87
- if (field === undefined) {
88
- throw 'missing field';
89
- }
90
- return field;
91
- }
92
- get value() {
93
- return this.props.value || [];
94
- }
95
- componentDidMount() {
96
- this.fetchData(tableState.dataSource);
97
- }
98
- render() {
99
- return (_jsxs(Fragment, { children: [_jsx(Input, { value: this.searchQuery, onChange: this.handleSearchQueryChange, placeholder: "Search" }), this.processedData.map(item => (_jsx("span", Object.assign({ className: "k-widget" }, { children: _jsx(Checkbox, { label: item.text, checked: this.value.includes(item.value), onChange: this.handleChange, value: item }) }), JSON.stringify(item))))] }));
100
- }
101
- fetchData(dataSource) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- if (!dataSource) {
104
- return;
105
- }
106
- const items = (yield dataSource.getData({})).data;
107
- const values = items.map(i => i[this.field]);
108
- const distinctValues = values.filter((v, idx) => values.indexOf(v) === idx);
109
- runInAction(() => {
110
- this.data = distinctValues.map(value => ({ value, text: renderItem(value) }));
111
- });
112
- });
113
- }
114
- };
115
- __decorate([
116
- observable,
117
- __metadata("design:type", Array)
118
- ], FieldValuesFilterCell.prototype, "data", void 0);
119
- __decorate([
120
- observable,
121
- __metadata("design:type", Object)
122
- ], FieldValuesFilterCell.prototype, "searchQuery", void 0);
123
- __decorate([
124
- computed,
125
- __metadata("design:type", Object),
126
- __metadata("design:paramtypes", [])
127
- ], FieldValuesFilterCell.prototype, "processedData", null);
128
- __decorate([
129
- computed,
130
- __metadata("design:type", Object),
131
- __metadata("design:paramtypes", [])
132
- ], FieldValuesFilterCell.prototype, "field", null);
133
- __decorate([
134
- computed,
135
- __metadata("design:type", Array),
136
- __metadata("design:paramtypes", [])
137
- ], FieldValuesFilterCell.prototype, "value", null);
138
- __decorate([
139
- action,
140
- __metadata("design:type", Object)
141
- ], FieldValuesFilterCell.prototype, "handleSearchQueryChange", void 0);
142
- FieldValuesFilterCell = __decorate([
143
- observer,
144
- __metadata("design:paramtypes", [Object])
145
- ], FieldValuesFilterCell);
146
- return renderCustomColumnMenuFilter(FieldValuesFilterCell);
147
- }
148
- function defaultRenderItem(v) {
149
- if (v == null) {
150
- return '';
151
- }
152
- // suppose v has toString();
153
- return v.toString();
154
- }
155
- //# sourceMappingURL=field-values-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-values-filter.js","sourceRoot":"","sources":["../../src/filters/field-values-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAwB,QAAQ,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E,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBAClF,CAAC,CAAC,CAAC;YACP,CAAC;SAAA;KACJ,CAAA;IAtGe;QAAX,UAAU;;uDAAmB;IAElB;QAAX,UAAU;;8DAAkB;IAEnB;QAAT,QAAQ;;;8DAcR;IAES;QAAT,QAAQ;;;sDAQR;IAES;QAAT,QAAQ;;;sDAER;IAQD;QADC,MAAM;;0EAKL;IA7CA,qBAAqB;QAD1B,QAAQ;;OACH,qBAAqB,CAuG1B;IAED,OAAO,4BAA4B,CAAC,qBAAqB,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAM;IAC7B,IAAI,CAAC,IAAI,IAAI,EAAE;QACX,OAAO,EAAE,CAAC;KACb;IAED,4BAA4B;IAC5B,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
@@ -1,9 +0,0 @@
1
- export * from './datetime-filter/datetime-filter';
2
- export * from './range-filter/range-filter';
3
- export * from './standard-filter-with-multiselect/standard-filter-with-multiselect';
4
- export * from './time-filter/time-filter';
5
- export * from './column-menu-filters';
6
- export * from './field-values-filter';
7
- export * from './multiselect-filter';
8
- export * from './numeric-filter-extended/numeric-filter-extended';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mDAAmD,CAAC"}
@@ -1,9 +0,0 @@
1
- export * from './datetime-filter/datetime-filter';
2
- export * from './range-filter/range-filter';
3
- export * from './standard-filter-with-multiselect/standard-filter-with-multiselect';
4
- export * from './time-filter/time-filter';
5
- export * from './column-menu-filters';
6
- export * from './field-values-filter';
7
- export * from './multiselect-filter';
8
- export * from './numeric-filter-extended/numeric-filter-extended';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mDAAmD,CAAC"}
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare function multiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
3
- export declare function complexItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
4
- export declare function multiItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
5
- //# sourceMappingURL=multiselect-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multiselect-filter.d.ts","sourceRoot":"","sources":["../../src/filters/multiselect-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAM,MAAM,OAAO,CAAC;AAuCjE,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAqB5F;AAED,wBAAgB,sCAAsC,CAAC,CAAC,EACpD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAgCtC;AAED,wBAAgB,oCAAoC,CAAC,CAAC,EAClD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAgCtC"}
@@ -1,107 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Component } from 'react';
3
- import { Checkbox } from '@servicetitan/design-system';
4
- import { renderCustomColumnMenuFilter } from './column-menu-filters';
5
- class Selector extends Component {
6
- constructor() {
7
- super(...arguments);
8
- Object.defineProperty(this, "handleChange", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: (option, checked, event) => {
13
- var _a, _b;
14
- const newValue = checked
15
- ? ((_a = this.props.value) !== null && _a !== void 0 ? _a : []).concat(option)
16
- : ((_b = this.props.value) !== null && _b !== void 0 ? _b : []).filter(v => v !== option);
17
- this.props.onChange(newValue.length ? newValue : undefined, event);
18
- }
19
- });
20
- }
21
- render() {
22
- const { options, value, renderer } = this.props;
23
- return options.map((option, index) => (
24
- // eslint-disable-next-line react/no-array-index-key
25
- _jsx("span", Object.assign({ className: "k-widget" }, { children: _jsx(Checkbox, { value: option, label: renderer ? renderer(option) : option, checked: (value !== null && value !== void 0 ? value : []).includes(option), onChange: this.handleChange }) }), index)));
26
- }
27
- }
28
- export function multiSelectColumnMenuFilter(data, renderItem) {
29
- const FilterCell = ({ value, onChange }) => {
30
- const handleChange = (value, event) => {
31
- onChange({
32
- value: value !== null && value !== void 0 ? value : '',
33
- operator: value ? 'in' : '',
34
- syntheticEvent: event,
35
- });
36
- };
37
- return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: handleChange, renderer: renderItem }));
38
- };
39
- return renderCustomColumnMenuFilter(FilterCell);
40
- }
41
- export function complexItemMultiSelectColumnMenuFilter(data, renderItem) {
42
- class FilterCell extends Component {
43
- constructor() {
44
- super(...arguments);
45
- Object.defineProperty(this, "contains", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: (item) => {
50
- const value = this.props.value || [];
51
- return value.some((v) => item[v] === true);
52
- }
53
- });
54
- Object.defineProperty(this, "handleChange", {
55
- enumerable: true,
56
- configurable: true,
57
- writable: true,
58
- value: (value, event) => {
59
- this.props.onChange({
60
- value: value !== null && value !== void 0 ? value : '',
61
- operator: value ? this.contains : '',
62
- syntheticEvent: event,
63
- });
64
- }
65
- });
66
- }
67
- render() {
68
- const { value } = this.props;
69
- return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }));
70
- }
71
- }
72
- return renderCustomColumnMenuFilter(FilterCell);
73
- }
74
- export function multiItemMultiSelectColumnMenuFilter(data, renderItem) {
75
- class FilterCell extends Component {
76
- constructor() {
77
- super(...arguments);
78
- Object.defineProperty(this, "contains", {
79
- enumerable: true,
80
- configurable: true,
81
- writable: true,
82
- value: (item) => {
83
- const value = this.props.value || [];
84
- return value.some((v) => Array.isArray(item) && item.includes(v));
85
- }
86
- });
87
- Object.defineProperty(this, "handleChange", {
88
- enumerable: true,
89
- configurable: true,
90
- writable: true,
91
- value: (value, event) => {
92
- this.props.onChange({
93
- value: value !== null && value !== void 0 ? value : '',
94
- operator: value ? this.contains : '',
95
- syntheticEvent: event,
96
- });
97
- }
98
- });
99
- }
100
- render() {
101
- const { value } = this.props;
102
- return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }));
103
- }
104
- }
105
- return renderCustomColumnMenuFilter(FilterCell);
106
- }
107
- //# sourceMappingURL=multiselect-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multiselect-filter.js","sourceRoot":"","sources":["../../src/filters/multiselect-filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAwB,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC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KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACvC,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,QAAQ,EAAE,UAAU,GACtB,CACL,CAAC;QACN,CAAC;KACJ;IAED,OAAO,4BAA4B,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const numericExtendedOperators: {
2
- text: string;
3
- operator: string;
4
- }[];
5
- export declare const isNumericExtendedOperator: (operator: string | Function) => boolean;
6
- //# sourceMappingURL=numeric-extended-operators.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numeric-extended-operators.d.ts","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-extended-operators.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;;GAGpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAAc,MAAM,GAAG,QAAQ,YACN,CAAC"}
@@ -1,6 +0,0 @@
1
- export const numericExtendedOperators = [
2
- { text: 'Is integer', operator: 'isinteger' },
3
- { text: 'Is fractional', operator: 'isfractional' },
4
- ];
5
- export const isNumericExtendedOperator = (operator) => numericExtendedOperators.some(o => o.operator === operator);
6
- //# sourceMappingURL=numeric-extended-operators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numeric-extended-operators.js","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-extended-operators.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE;IAC7C,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAA2B,EAAE,EAAE,CACrE,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const NumericFilterExtended: (props: import("@progress/kendo-react-grid").GridColumnMenuProps) => JSX.Element;
3
- //# sourceMappingURL=numeric-filter-extended.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numeric-filter-extended.d.ts","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-filter-extended.tsx"],"names":[],"mappings":";AAwDA,eAAO,MAAM,qBAAqB,kFAA2D,CAAC"}
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { NumericTextBox } from '@progress/kendo-react-inputs';
3
- import { DropDownList } from '@progress/kendo-react-dropdowns';
4
- import { IsUnaryFilter, cellOperatorChange, } from '@progress/kendo-react-grid/dist/npm/filterCommon';
5
- import { numericExtendedOperators, isNumericExtendedOperator } from './numeric-extended-operators';
6
- import { renderCustomColumnMenuFilter } from '../column-menu-filters';
7
- //
8
- // like standard filter cell (rendered for numeric type), but with support of some special numeric operators
9
- const NumericExtFilterCell = ({ operators, operator = '', value, onChange, }) => {
10
- const operatorsExt = operators.concat(numericExtendedOperators);
11
- const operatorValue = operatorsExt.find(item => item.operator === operator);
12
- const handleInputChange = (e) => onChange({
13
- operator,
14
- value: e.value,
15
- syntheticEvent: e.syntheticEvent,
16
- });
17
- const handleOperatorChange = (event) => {
18
- // set value to null when switching to unary operator
19
- const newValue = isNumericExtendedOperator(event.target.value.operator) ? null : value;
20
- cellOperatorChange(event, newValue, onChange);
21
- };
22
- const isUnary = (typeof operator === 'string' && IsUnaryFilter(operator)) ||
23
- isNumericExtendedOperator(operator);
24
- return (_jsxs("div", { children: [_jsx(DropDownList, { value: operatorValue, onChange: handleOperatorChange, data: operatorsExt, textField: "text" }), _jsx(NumericTextBox, { value: value, onChange: handleInputChange, disabled: isUnary })] }));
25
- };
26
- export const NumericFilterExtended = renderCustomColumnMenuFilter(NumericExtFilterCell, true);
27
- //# sourceMappingURL=numeric-filter-extended.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numeric-filter-extended.js","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-filter-extended.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAA6B,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,YAAY,EAA2B,MAAM,iCAAiC,CAAC;AAGxF,OAAO,EACH,aAAa,EACb,kBAAkB,GACrB,MAAM,kDAAkD,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,EAAE;AAEF,4GAA4G;AAC5G,MAAM,oBAAoB,GAAuC,CAAC,EAC9D,SAAS,EACT,QAAQ,GAAG,EAAE,EACb,KAAK,EACL,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAE5E,MAAM,iBAAiB,GAAG,CAAC,CAA4B,EAAE,EAAE,CACvD,QAAQ,CAAC;QACL,QAAQ;QACR,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,cAAc,EAAE,CAAC,CAAC,cAAc;KACnC,CAAC,CAAC;IAEP,MAAM,oBAAoB,GAAG,CAAC,KAA8B,EAAE,EAAE;QAC5D,qDAAqD;QACrD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QACvF,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC;IAEF,MAAM,OAAO,GACT,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;QACzD,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAExC,OAAO,CACH,0BACI,KAAC,YAAY,IACT,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAC,MAAM,GAClB,EACF,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,GAAI,IAC9E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const NumericRangeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
3
- export declare const CurrencyRangeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
4
- export declare const DateRangeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
5
- export declare const TimeRangeColumnMenuFilter: (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
6
- //# sourceMappingURL=range-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"range-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/range-filter/range-filter.tsx"],"names":[],"mappings":";AAsJA,eAAO,MAAM,4BAA4B,oFAAuD,CAAC;AACjG,eAAO,MAAM,6BAA6B,oFAAwD,CAAC;AACnG,eAAO,MAAM,yBAAyB,oFAAoD,CAAC;AAC3F,eAAO,MAAM,yBAAyB,oFAAoD,CAAC"}