@servicetitan/table 19.3.0 → 20.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/demo/index.js +3 -15
- package/dist/demo/index.js.map +1 -1
- package/dist/demo/master-detail/detail-table.js +15 -18
- package/dist/demo/master-detail/detail-table.js.map +1 -1
- package/dist/demo/master-detail/detail-table.store.js +14 -17
- package/dist/demo/master-detail/detail-table.store.js.map +1 -1
- package/dist/demo/master-detail/index.js +1 -13
- package/dist/demo/master-detail/index.js.map +1 -1
- package/dist/demo/master-detail/master-table.store.js +14 -17
- package/dist/demo/master-detail/master-table.store.js.map +1 -1
- package/dist/demo/master-detail/product-detail.js +1 -2
- package/dist/demo/master-detail/product-details.js +1 -4
- package/dist/demo/master-detail/product-details.js.map +1 -1
- package/dist/demo/master-detail/product.js +4 -7
- package/dist/demo/master-detail/product.js.map +1 -1
- package/dist/demo/master-detail/products.js +15 -18
- package/dist/demo/master-detail/products.js.map +1 -1
- package/dist/demo/master-detail/table-master-detail.js +13 -16
- package/dist/demo/master-detail/table-master-detail.js.map +1 -1
- package/dist/demo/overview/actions-cell.js +8 -11
- package/dist/demo/overview/actions-cell.js.map +1 -1
- package/dist/demo/overview/index.js +1 -13
- package/dist/demo/overview/index.js.map +1 -1
- package/dist/demo/overview/product.js +4 -7
- package/dist/demo/overview/product.js.map +1 -1
- package/dist/demo/overview/products.js +15 -18
- package/dist/demo/overview/products.js.map +1 -1
- package/dist/demo/overview/table.js +24 -27
- package/dist/demo/overview/table.js.map +1 -1
- package/dist/demo/overview/table.store.js +27 -30
- package/dist/demo/overview/table.store.js.map +1 -1
- package/dist/demo/state-caching/beverages.js +1 -4
- package/dist/demo/state-caching/beverages.js.map +1 -1
- package/dist/demo/state-caching/index.js +1 -13
- package/dist/demo/state-caching/index.js.map +1 -1
- package/dist/demo/state-caching/product.js +1 -2
- package/dist/demo/state-caching/products.js +1 -4
- package/dist/demo/state-caching/products.js.map +1 -1
- package/dist/demo/state-caching/state-caching-table.js +12 -15
- package/dist/demo/state-caching/state-caching-table.js.map +1 -1
- package/dist/demo/state-caching/state-caching-table.store.js +9 -12
- package/dist/demo/state-caching/state-caching-table.store.js.map +1 -1
- package/dist/editable-cell/boolean-editable-cell.js +7 -10
- package/dist/editable-cell/boolean-editable-cell.js.map +1 -1
- package/dist/editable-cell/date-editable-cell.js +7 -10
- package/dist/editable-cell/date-editable-cell.js.map +1 -1
- package/dist/editable-cell/get-action-cell.js +6 -10
- package/dist/editable-cell/get-action-cell.js.map +1 -1
- package/dist/editable-cell/get-editable-cell.js +6 -10
- package/dist/editable-cell/get-editable-cell.js.map +1 -1
- package/dist/editable-cell/get-select-editable-cell.js +9 -16
- package/dist/editable-cell/get-select-editable-cell.js.map +1 -1
- package/dist/editable-cell/index.js +7 -19
- package/dist/editable-cell/index.js.map +1 -1
- package/dist/editable-cell/numeric-editable-cell.js +7 -10
- package/dist/editable-cell/numeric-editable-cell.js.map +1 -1
- package/dist/editable-cell/text-editable-cell.js +10 -14
- package/dist/editable-cell/text-editable-cell.js.map +1 -1
- package/dist/export/export.js +5 -28
- package/dist/export/export.js.map +1 -1
- package/dist/export/index.js +1 -13
- package/dist/export/index.js.map +1 -1
- package/dist/filters/column-menu-filters.js +7 -12
- package/dist/filters/column-menu-filters.js.map +1 -1
- package/dist/filters/datetime-filter/datetime-filter.js +17 -39
- package/dist/filters/datetime-filter/datetime-filter.js.map +1 -1
- package/dist/filters/field-values-filter.js +21 -26
- package/dist/filters/field-values-filter.js.map +1 -1
- package/dist/filters/index.js +8 -20
- package/dist/filters/index.js.map +1 -1
- package/dist/filters/multiselect-filter.js +17 -23
- package/dist/filters/multiselect-filter.js.map +1 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +2 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +1 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +13 -16
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +1 -1
- package/dist/filters/range-filter/range-filter.js +20 -45
- package/dist/filters/range-filter/range-filter.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +16 -38
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +2 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +12 -16
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +1 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +8 -12
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +1 -1
- package/dist/filters/time-filter/time-filter.js +17 -39
- package/dist/filters/time-filter/time-filter.js.map +1 -1
- package/dist/index.js +8 -29
- package/dist/index.js.map +1 -1
- package/dist/select-cell/index.js +1 -13
- package/dist/select-cell/index.js.map +1 -1
- package/dist/select-cell/select-cell.js +10 -35
- package/dist/select-cell/select-cell.js.map +1 -1
- package/dist/table-state.js +63 -68
- package/dist/table-state.js.map +1 -1
- package/dist/table.js +35 -60
- package/dist/table.js.map +1 -1
- package/package.json +16 -15
package/dist/filters/index.js
CHANGED
@@ -1,21 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./datetime-filter/datetime-filter"), exports);
|
14
|
-
__exportStar(require("./range-filter/range-filter"), exports);
|
15
|
-
__exportStar(require("./standard-filter-with-multiselect/standard-filter-with-multiselect"), exports);
|
16
|
-
__exportStar(require("./time-filter/time-filter"), exports);
|
17
|
-
__exportStar(require("./column-menu-filters"), exports);
|
18
|
-
__exportStar(require("./field-values-filter"), exports);
|
19
|
-
__exportStar(require("./multiselect-filter"), exports);
|
20
|
-
__exportStar(require("./numeric-filter-extended/numeric-filter-extended"), exports);
|
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';
|
21
9
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"
|
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,11 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
const design_system_1 = require("@servicetitan/design-system");
|
7
|
-
const column_menu_filters_1 = require("./column-menu-filters");
|
8
|
-
class Selector extends react_1.Component {
|
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 {
|
9
6
|
constructor() {
|
10
7
|
super(...arguments);
|
11
8
|
Object.defineProperty(this, "handleChange", {
|
@@ -25,10 +22,10 @@ class Selector extends react_1.Component {
|
|
25
22
|
const { options, value, renderer } = this.props;
|
26
23
|
return options.map((option, index) => (
|
27
24
|
// eslint-disable-next-line react/no-array-index-key
|
28
|
-
(
|
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 }, void 0) }), index)));
|
29
26
|
}
|
30
27
|
}
|
31
|
-
function multiSelectColumnMenuFilter(data, renderItem) {
|
28
|
+
export function multiSelectColumnMenuFilter(data, renderItem) {
|
32
29
|
const FilterCell = ({ value, onChange }) => {
|
33
30
|
const handleChange = (value, event) => {
|
34
31
|
onChange({
|
@@ -37,13 +34,12 @@ function multiSelectColumnMenuFilter(data, renderItem) {
|
|
37
34
|
syntheticEvent: event,
|
38
35
|
});
|
39
36
|
};
|
40
|
-
return ((
|
37
|
+
return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: handleChange, renderer: renderItem }, void 0));
|
41
38
|
};
|
42
|
-
return
|
39
|
+
return renderCustomColumnMenuFilter(FilterCell);
|
43
40
|
}
|
44
|
-
|
45
|
-
|
46
|
-
class FilterCell extends react_1.Component {
|
41
|
+
export function complexItemMultiSelectColumnMenuFilter(data, renderItem) {
|
42
|
+
class FilterCell extends Component {
|
47
43
|
constructor() {
|
48
44
|
super(...arguments);
|
49
45
|
Object.defineProperty(this, "contains", {
|
@@ -70,14 +66,13 @@ function complexItemMultiSelectColumnMenuFilter(data, renderItem) {
|
|
70
66
|
}
|
71
67
|
render() {
|
72
68
|
const { value } = this.props;
|
73
|
-
return ((
|
69
|
+
return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }, void 0));
|
74
70
|
}
|
75
71
|
}
|
76
|
-
return
|
72
|
+
return renderCustomColumnMenuFilter(FilterCell);
|
77
73
|
}
|
78
|
-
|
79
|
-
|
80
|
-
class FilterCell extends react_1.Component {
|
74
|
+
export function multiItemMultiSelectColumnMenuFilter(data, renderItem) {
|
75
|
+
class FilterCell extends Component {
|
81
76
|
constructor() {
|
82
77
|
super(...arguments);
|
83
78
|
Object.defineProperty(this, "contains", {
|
@@ -104,10 +99,9 @@ function multiItemMultiSelectColumnMenuFilter(data, renderItem) {
|
|
104
99
|
}
|
105
100
|
render() {
|
106
101
|
const { value } = this.props;
|
107
|
-
return ((
|
102
|
+
return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }, void 0));
|
108
103
|
}
|
109
104
|
}
|
110
|
-
return
|
105
|
+
return renderCustomColumnMenuFilter(FilterCell);
|
111
106
|
}
|
112
|
-
exports.multiItemMultiSelectColumnMenuFilter = multiItemMultiSelectColumnMenuFilter;
|
113
107
|
//# sourceMappingURL=multiselect-filter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"multiselect-filter.js","sourceRoot":"","sources":["../../src/filters/multiselect-filter.tsx"],"names":[],"mappings":"
|
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;AASrE,MAAM,QAAY,SAAQ,SAA2B;IAArD;;QACI;;;;mBAAe,CAAC,MAAS,EAAE,OAAgB,EAAE,KAAuC,EAAE,EAAE;;gBACpF,MAAM,QAAQ,GAAG,OAAO;oBACpB,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;oBACzC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAA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ChD,IAAS,EACT,UAAmC;IAEnC,MAAM,UAAW,SAAQ,SAA+B;QAAxD;;YACI;;;;uBAAW,CAAC,IAAS,EAAE,EAAE;oBACrB,MAAM,KAAK,GAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;oBAE1C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzE,CAAC;eAAC;YAEF;;;;uBAAe,CAAC,KAAsB,EAAE,KAAuC,EAAE,EAAE;oBAC/E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;wBAChB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;wBAClB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;wBACpC,cAAc,EAAE,KAAK;qBACxB,CAAC,CAAC;gBACP,CAAC;eAAC;QAcN,CAAC;QAZG,MAAM;YACF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAE7B,OAAO,CACH,KAAC,QAAQ,IACL,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACvC,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,QAAQ,EAAE,UAAU,WACtB,CACL,CAAC;QACN,CAAC;KACJ;IAED,OAAO,4BAA4B,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC"}
|
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.isNumericExtendedOperator = exports.numericExtendedOperators = void 0;
|
4
|
-
exports.numericExtendedOperators = [
|
1
|
+
export const numericExtendedOperators = [
|
5
2
|
{ text: 'Is integer', operator: 'isinteger' },
|
6
3
|
{ text: 'Is fractional', operator: 'isfractional' },
|
7
4
|
];
|
8
|
-
const isNumericExtendedOperator = (operator) =>
|
9
|
-
exports.isNumericExtendedOperator = isNumericExtendedOperator;
|
5
|
+
export const isNumericExtendedOperator = (operator) => numericExtendedOperators.some(o => o.operator === operator);
|
10
6
|
//# sourceMappingURL=numeric-extended-operators.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numeric-extended-operators.js","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-extended-operators.ts"],"names":[],"mappings":"
|
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,16 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
const filterCommon_1 = require("@progress/kendo-react-grid/dist/npm/filterCommon");
|
8
|
-
const numeric_extended_operators_1 = require("./numeric-extended-operators");
|
9
|
-
const column_menu_filters_1 = require("../column-menu-filters");
|
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';
|
10
7
|
//
|
11
8
|
// like standard filter cell (rendered for numeric type), but with support of some special numeric operators
|
12
9
|
const NumericExtFilterCell = ({ operators, operator = '', value, onChange, }) => {
|
13
|
-
const operatorsExt = operators.concat(
|
10
|
+
const operatorsExt = operators.concat(numericExtendedOperators);
|
14
11
|
const operatorValue = operatorsExt.find(item => item.operator === operator);
|
15
12
|
const handleInputChange = (e) => onChange({
|
16
13
|
operator,
|
@@ -19,12 +16,12 @@ const NumericExtFilterCell = ({ operators, operator = '', value, onChange, }) =>
|
|
19
16
|
});
|
20
17
|
const handleOperatorChange = (event) => {
|
21
18
|
// set value to null when switching to unary operator
|
22
|
-
const newValue =
|
23
|
-
|
19
|
+
const newValue = isNumericExtendedOperator(event.target.value.operator) ? null : value;
|
20
|
+
cellOperatorChange(event, newValue, onChange);
|
24
21
|
};
|
25
|
-
const isUnary = (typeof operator === 'string' &&
|
26
|
-
|
27
|
-
return ((
|
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" }, void 0), _jsx(NumericTextBox, { value: value, onChange: handleInputChange, disabled: isUnary }, void 0)] }, void 0));
|
28
25
|
};
|
29
|
-
|
26
|
+
export const NumericFilterExtended = renderCustomColumnMenuFilter(NumericExtFilterCell, true);
|
30
27
|
//# sourceMappingURL=numeric-filter-extended.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numeric-filter-extended.js","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-filter-extended.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"numeric-filter-extended.js","sourceRoot":"","sources":["../../../src/filters/numeric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AAQ,CAAC,CAAC;IAExC,OAAO,CACH,0BACI,KAAC,YAAY,IACT,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAC,MAAM,WAClB,EACF,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,WAAI,YAC9E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC"}
|
@@ -1,43 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}));
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
-
}) : function(o, v) {
|
12
|
-
o["default"] = v;
|
13
|
-
});
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
-
if (mod && mod.__esModule) return mod;
|
16
|
-
var result = {};
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
-
__setModuleDefault(result, mod);
|
19
|
-
return result;
|
20
|
-
};
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
-
};
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
-
exports.TimeRangeColumnMenuFilter = exports.DateRangeColumnMenuFilter = exports.CurrencyRangeColumnMenuFilter = exports.NumericRangeColumnMenuFilter = void 0;
|
26
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
27
|
-
const react_1 = require("react");
|
28
|
-
const kendo_react_dateinputs_1 = require("@progress/kendo-react-dateinputs");
|
29
|
-
const kendo_react_inputs_1 = require("@progress/kendo-react-inputs");
|
30
|
-
const moment_1 = __importDefault(require("moment"));
|
31
|
-
const column_menu_filters_1 = require("../column-menu-filters");
|
32
|
-
const Styles = __importStar(require("./range-filter.module.css"));
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useState, useEffect, Component, Fragment } from 'react';
|
3
|
+
import { DatePicker, TimePicker } from '@progress/kendo-react-dateinputs';
|
4
|
+
import { NumericTextBox } from '@progress/kendo-react-inputs';
|
5
|
+
import moment from 'moment';
|
6
|
+
import { renderCustomColumnMenuFilter } from '../column-menu-filters';
|
7
|
+
import * as Styles from './range-filter.module.css';
|
33
8
|
const NoSSR = ({ children }) => {
|
34
|
-
const [isMounted, setIsMounted] =
|
35
|
-
|
9
|
+
const [isMounted, setIsMounted] = useState(false);
|
10
|
+
useEffect(() => {
|
36
11
|
setIsMounted(true);
|
37
12
|
}, []);
|
38
13
|
return isMounted ? children : null;
|
39
14
|
};
|
40
|
-
class RangeFilterCellBase extends
|
15
|
+
class RangeFilterCellBase extends Component {
|
41
16
|
constructor(props, controlClass, controlProps = {}) {
|
42
17
|
super(props);
|
43
18
|
Object.defineProperty(this, "controlClass", {
|
@@ -104,24 +79,24 @@ class RangeFilterCellBase extends react_1.Component {
|
|
104
79
|
render() {
|
105
80
|
const filterValue = this.props.value;
|
106
81
|
const Control = this.controlClass;
|
107
|
-
return ((
|
82
|
+
return (_jsxs(Fragment, { children: [_jsx("span", Object.assign({ className: "k-widget" }, { children: "From:" }), void 0), _jsx("span", Object.assign({ className: Styles.from }, { children: _jsx(NoSSR, { children: _jsx(Control, Object.assign({}, this.controlProps, { value: filterValue === null || filterValue === void 0 ? void 0 : filterValue.min, ref: this.setMinValueRef, onChange: this.onChange }), void 0) }, void 0) }), void 0), _jsx("span", Object.assign({ className: "k-widget" }, { children: "To:" }), void 0), _jsx("span", Object.assign({ className: Styles.to }, { children: _jsx(NoSSR, { children: _jsx(Control, Object.assign({}, this.controlProps, { value: filterValue === null || filterValue === void 0 ? void 0 : filterValue.max, ref: this.setMaxValueRef, onChange: this.onChange }), void 0) }, void 0) }), void 0)] }, void 0));
|
108
83
|
}
|
109
84
|
}
|
110
85
|
class NumericRangeFilterCell extends RangeFilterCellBase {
|
111
86
|
constructor(props) {
|
112
|
-
super(props,
|
87
|
+
super(props, NumericTextBox);
|
113
88
|
}
|
114
89
|
}
|
115
90
|
class CurrencyRangeFilterCell extends RangeFilterCellBase {
|
116
91
|
constructor(props) {
|
117
|
-
super(props,
|
92
|
+
super(props, NumericTextBox, {
|
118
93
|
format: 'c',
|
119
94
|
});
|
120
95
|
}
|
121
96
|
}
|
122
97
|
class DateRangeFilterCell extends RangeFilterCellBase {
|
123
98
|
constructor(props) {
|
124
|
-
super(props,
|
99
|
+
super(props, DatePicker);
|
125
100
|
}
|
126
101
|
}
|
127
102
|
function getTimeString(date) {
|
@@ -129,14 +104,14 @@ function getTimeString(date) {
|
|
129
104
|
}
|
130
105
|
class TimeRangeFilterCell extends RangeFilterCellBase {
|
131
106
|
constructor(props) {
|
132
|
-
super(props,
|
107
|
+
super(props, TimePicker);
|
133
108
|
}
|
134
109
|
inRange(current, values) {
|
135
|
-
return (
|
110
|
+
return moment(getTimeString(current), 'h:mma').isBetween(moment(getTimeString(values.min || current), 'h:mma'), moment(getTimeString(values.max || current), 'h:mma'), 'minutes', '[]');
|
136
111
|
}
|
137
112
|
}
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
113
|
+
export const NumericRangeColumnMenuFilter = renderCustomColumnMenuFilter(NumericRangeFilterCell);
|
114
|
+
export const CurrencyRangeColumnMenuFilter = renderCustomColumnMenuFilter(CurrencyRangeFilterCell);
|
115
|
+
export const DateRangeColumnMenuFilter = renderCustomColumnMenuFilter(DateRangeFilterCell);
|
116
|
+
export const TimeRangeColumnMenuFilter = renderCustomColumnMenuFilter(TimeRangeFilterCell);
|
142
117
|
//# sourceMappingURL=range-filter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"range-filter.js","sourceRoot":"","sources":["../../../src/filters/range-filter/range-filter.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"range-filter.js","sourceRoot":"","sources":["../../../src/filters/range-filter/range-filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAuB,MAAM,8BAA8B,CAAC;AACnF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAoBpD,MAAM,KAAK,GAAkC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACX,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,mBAAsC,SAAQ,SAA+B;IAI/E,YACI,KAA2B,EACnB,YAA6E,EAC7E,eAAuB,EAAS;QAExC,KAAK,CAAC,KAAK,CAAC,CAAC;;;;;mBAHL;;;;;;mBACA;;QANZ;;;;mBAAsD,IAAI;WAAC;QAC3D;;;;mBAAsD,IAAI;WAAC;QAkB3D;;;;mBAAW,CAAC,EAAO,EAAE,EAAE;gBACnB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;oBACxC,OAAO;iBACV;gBACD,IAAI,CAAC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GAAG,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,EACrD,SAAS,EACT,IAAI,CACP,CAAC;IACN,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC,uBAAuB,CAAC,CAAC;AACnG,MAAM,CAAC,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,mBAAmB,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,mBAAmB,CAAC,CAAC"}
|
@@ -1,38 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
-
}) : function(o, v) {
|
12
|
-
o["default"] = v;
|
13
|
-
});
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
-
if (mod && mod.__esModule) return mod;
|
16
|
-
var result = {};
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
-
__setModuleDefault(result, mod);
|
19
|
-
return result;
|
20
|
-
};
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
-
exports.FilterCellExt = void 0;
|
23
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
24
|
-
const mobx_1 = require("mobx");
|
25
|
-
const mobx_react_1 = require("mobx-react");
|
26
|
-
const multiselect_operators_1 = require("./multiselect-operators");
|
27
|
-
const kendo_react_dropdowns_1 = require("@progress/kendo-react-dropdowns");
|
28
|
-
const filterCommon_1 = require("@progress/kendo-react-grid/dist/npm/filterCommon");
|
29
|
-
const design_system_1 = require("@servicetitan/design-system");
|
30
|
-
const Styles = __importStar(require("./filter-cell-ext.module.css"));
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { runInAction } from 'mobx';
|
3
|
+
import { observer, useLocalStore } from 'mobx-react';
|
4
|
+
import { multiselectOperators, isMultiselectOperator } from './multiselect-operators';
|
5
|
+
import { DropDownList, MultiSelect, } from '@progress/kendo-react-dropdowns';
|
6
|
+
import { IsUnaryFilter, cellOperatorChange, } from '@progress/kendo-react-grid/dist/npm/filterCommon';
|
7
|
+
import { Icon } from '@servicetitan/design-system';
|
8
|
+
import * as Styles from './filter-cell-ext.module.css';
|
31
9
|
// like standard filter cell (rendered for string type), but with support of multiselect operators
|
32
|
-
|
33
|
-
const store =
|
10
|
+
export const FilterCellExt = observer(props => {
|
11
|
+
const store = useLocalStore(oprops => ({
|
34
12
|
get operators() {
|
35
|
-
return
|
13
|
+
return multiselectOperators.concat(oprops.onlyMultiselectAndEmptyOperators
|
36
14
|
? oprops.operators.filter(o => o.operator === 'isempty' || o.operator === 'isnotempty')
|
37
15
|
: oprops.operators);
|
38
16
|
},
|
@@ -41,7 +19,7 @@ exports.FilterCellExt = (0, mobx_react_1.observer)(props => {
|
|
41
19
|
},
|
42
20
|
searchQuery: '',
|
43
21
|
filterChange(event) {
|
44
|
-
|
22
|
+
runInAction(() => (this.searchQuery = event.filter.value));
|
45
23
|
},
|
46
24
|
get filteredValuesSet() {
|
47
25
|
const queryLC = this.searchQuery.toLowerCase();
|
@@ -89,16 +67,16 @@ exports.FilterCellExt = (0, mobx_react_1.observer)(props => {
|
|
89
67
|
};
|
90
68
|
// conversions for better compatibility when switching plain/array operators
|
91
69
|
const handleOperatorChange = (event) => {
|
92
|
-
const newValue =
|
70
|
+
const newValue = isMultiselectOperator(operator) === isMultiselectOperator(event.target.value.operator)
|
93
71
|
? props.value
|
94
72
|
: '';
|
95
|
-
|
73
|
+
cellOperatorChange(event, newValue, onChange);
|
96
74
|
};
|
97
75
|
const allowCustomAdd = (allowCustomValues &&
|
98
76
|
store.searchQuery &&
|
99
77
|
(!props.handleCustomValuesAsNumber || !isNaN(+store.searchQuery))) ||
|
100
78
|
false;
|
101
|
-
return ((
|
102
|
-
(
|
79
|
+
return (_jsxs("div", { children: [_jsx(DropDownList, { value: store.operatorValue, onChange: handleOperatorChange, data: store.operators, textField: "text" }, void 0), (typeof operator !== 'string' || !IsUnaryFilter(operator)) &&
|
80
|
+
(isMultiselectOperator(operator) ? (_jsx(MultiSelect, { value: store.multiselectValue, onChange: handleMultiselectChange, filterable: true, onFilterChange: store.filterChange, allowCustom: allowCustomAdd, data: store.filteredVisibleValues, textField: "text", dataItemKey: "value", header: allowCustomAdd && _jsx("div", { className: Styles.customItemAddMarker }, void 0), footer: allowCustomAdd ? (_jsxs("div", Object.assign({ className: Styles.returnToUse }, { children: [_jsx(Icon, { name: "keyboard_return" }, void 0), "to create filter"] }), void 0)) : (store.onlyFirstValues && (_jsxs("div", Object.assign({ className: Styles.returnToUse }, { children: ["First ", store.onlyFirstValues, " values are shown. ", _jsx("br", {}, void 0), "Type to search for other values."] }), void 0))), itemRender: multiselectItemRender, tagRender: multiselectTagRender, listNoDataRender: multiselectListNoDataRender }, void 0)) : (_jsx("input", { className: "k-textbox", value: props.value, onChange: handleInputChange }, void 0)))] }, void 0));
|
103
81
|
});
|
104
82
|
//# sourceMappingURL=filter-cell-ext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filter-cell-ext.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/filter-cell-ext.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"filter-cell-ext.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/filter-cell-ext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,qBAA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EAAE,KAAK,CAAC,SAAS,EACrB,SAAS,EAAC,MAAM,WAClB,EACD,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBACvD,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC/B,KAAC,WAAW,IACR,KAAK,EAAE,KAAK,CAAC,gBAAgB,EAC7B,QAAQ,EAAE,uBAAuB,EACjC,UAAU,QACV,cAAc,EAAE,KAAK,CAAC,YAAY,EAClC,WAAW,EAAE,cAAc,EAC3B,IAAI,EAAE,KAAK,CAAC,qBAAqB,EACjC,SAAS,EAAC,MAAM,EAChB,WAAW,EAAC,OAAO,EACnB,MAAM,EAAE,cAAc,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,mBAAmB,WAAI,EACxE,MAAM,EACF,cAAc,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAE,MAAM,CAAC,WAAW,iBAC9B,KAAC,IAAI,IAAC,IAAI,EAAC,iBAAiB,WAAG,iCAE7B,CACT,CAAC,CAAC,CAAC,CACA,KAAK,CAAC,eAAe,IAAI,CACrB,6BAAK,SAAS,EAAE,MAAM,CAAC,WAAW,2BACvB,KAAK,CAAC,eAAe,yBAAoB,sBAAM,iDAEpD,CACT,CACJ,EAEL,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,oBAAoB,EAC/B,gBAAgB,EAAE,2BAA2B,WAC/C,CACL,CAAC,CAAC,CAAC,CACA,gBAAO,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,WAAI,CACnF,CAAC,YACJ,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.isMultiselectOperator = exports.multiselectOperators = void 0;
|
4
|
-
exports.multiselectOperators = [
|
1
|
+
export const multiselectOperators = [
|
5
2
|
{ text: 'Is one of', operator: 'in' },
|
6
3
|
{ text: 'Is not one of', operator: 'notin' },
|
7
4
|
];
|
8
|
-
const isMultiselectOperator = (operator) =>
|
9
|
-
exports.isMultiselectOperator = isMultiselectOperator;
|
5
|
+
export const isMultiselectOperator = (operator) => multiselectOperators.some(o => o.operator === operator);
|
10
6
|
//# sourceMappingURL=multiselect-operators.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"multiselect-operators.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/multiselect-operators.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"multiselect-operators.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/multiselect-operators.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;IACrC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAA2B,EAAE,EAAE,CACjE,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC"}
|
@@ -1,29 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
const kendo_react_dropdowns_1 = require("@progress/kendo-react-dropdowns");
|
8
|
-
const table_column_menu_filter_ext_1 = require("./table-column-menu-filter-ext");
|
9
|
-
const filter_cell_ext_1 = require("./filter-cell-ext");
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { observer, useLocalStore } from 'mobx-react';
|
3
|
+
import { fromPromise } from 'mobx-utils';
|
4
|
+
import { DropDownList } from '@progress/kendo-react-dropdowns';
|
5
|
+
import { TableColumnMenuFilterExt } from './table-column-menu-filter-ext';
|
6
|
+
import { FilterCellExt } from './filter-cell-ext';
|
10
7
|
/*
|
11
8
|
* StandardFilterWithMultiselect is like standard Kendo filter, but with additional operators 'Is one of' / 'Is not one of'.
|
12
9
|
* Intended to be used with string fields (though it's possible to adopt for number fields as well, if someone will have a need).
|
13
10
|
*/
|
14
|
-
function standardFilterWithMultiselect(optionsConfig = {}, filterCellConfig = {}) {
|
11
|
+
export function standardFilterWithMultiselect(optionsConfig = {}, filterCellConfig = {}) {
|
15
12
|
const optionsConfigFull = Object.assign({ maxExtractedLength: 64, options: [] }, optionsConfig);
|
16
13
|
const filterCellConfigFull = Object.assign({ allowCustomValues: true, maxFoundValues: 1000 }, filterCellConfig);
|
17
14
|
// Filter UI with data fetcher
|
18
|
-
const FilterUIWithValues =
|
19
|
-
const store =
|
15
|
+
const FilterUIWithValues = observer(props => {
|
16
|
+
const store = useLocalStore(oprops => ({
|
20
17
|
get field() {
|
21
18
|
return oprops.firstFilterProps.field;
|
22
19
|
},
|
23
20
|
get itemsFromDataSource() {
|
24
21
|
var _a;
|
25
22
|
const dataSource = (_a = optionsConfigFull.tableState) === null || _a === void 0 ? void 0 : _a.dataSource;
|
26
|
-
return dataSource && this.field &&
|
23
|
+
return dataSource && this.field && fromPromise(dataSource.getData({}));
|
27
24
|
},
|
28
25
|
get valuesfromTableState() {
|
29
26
|
if (!this.itemsFromDataSource ||
|
@@ -65,9 +62,8 @@ function standardFilterWithMultiselect(optionsConfig = {}, filterCellConfig = {}
|
|
65
62
|
},
|
66
63
|
}), props);
|
67
64
|
const { firstFilterProps, secondFilterProps, hideSecondFilter, logicData, logicValue, onLogicChange, } = props;
|
68
|
-
return ((
|
65
|
+
return (_jsxs("div", { children: [_jsx(FilterCellExt, Object.assign({}, firstFilterProps, { options: store.options }, filterCellConfigFull), void 0), !hideSecondFilter && (_jsxs("div", { children: [_jsx(DropDownList, { data: logicData, value: logicValue, onChange: onLogicChange, className: "k-filter-and", textField: "text" }, void 0), _jsx(FilterCellExt, Object.assign({}, secondFilterProps, { options: store.options }, filterCellConfigFull), void 0)] }, void 0))] }, void 0));
|
69
66
|
});
|
70
|
-
return (props) => ((
|
67
|
+
return (props) => (_jsx(TableColumnMenuFilterExt, Object.assign({}, props, { filterUI: FilterUIWithValues, expanded: true }), void 0));
|
71
68
|
}
|
72
|
-
exports.standardFilterWithMultiselect = standardFilterWithMultiselect;
|
73
69
|
//# sourceMappingURL=standard-filter-with-multiselect.js.map
|
package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"standard-filter-with-multiselect.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"standard-filter-with-multiselect.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAO/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AA+BtE;;;GAGG;AAEH,MAAM,UAAU,6BAA6B,CACzC,gBAAuC,EAAE,EACzC,mBAAqC,EAAE;IAEvC,MAAM,iBAAiB,mBACnB,kBAAkB,EAAE,EAAE,EACtB,OAAO,EAAE,EAAc,IACpB,aAAa,CACnB,CAAC;IAEF,MAAM,oBAAoB,mBACtB,iBAAiB,EAAE,IAAI,EACvB,cAAc,EAAE,IAAI,IACjB,gBAAgB,CACtB,CAAC;IAEF,8BAA8B;IAC9B,MAAM,kBAAkB,GAAqC,QAAQ,CAAC,KAAK,CAAC,EAAE;Q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= require("@servicetitan/design-system");
|
6
|
-
const filterCommon_1 = require("@progress/kendo-react-grid/dist/npm/filterCommon");
|
7
|
-
const multiselect_operators_1 = require("./multiselect-operators");
|
1
|
+
import { comparer } from 'mobx';
|
2
|
+
import { TableColumnMenuFilter } from '@servicetitan/design-system';
|
3
|
+
import { getDefaultOperator } from '@progress/kendo-react-grid/dist/npm/filterCommon';
|
4
|
+
import { multiselectOperators } from './multiselect-operators';
|
8
5
|
// constructor override: if state.filterGroup was filled with default, we override it with new default
|
9
|
-
class TableColumnMenuFilterExt extends
|
6
|
+
export class TableColumnMenuFilterExt extends TableColumnMenuFilter {
|
10
7
|
constructor(props) {
|
11
8
|
var _a;
|
12
9
|
super(props);
|
13
|
-
const defaultOperator =
|
10
|
+
const defaultOperator = getDefaultOperator(props.filterOperators, (_a = props.column.filter) !== null && _a !== void 0 ? _a : 'text');
|
14
11
|
// I know the check is a bit hacky, but that's compensated with its low criticality: even if it fails, nothing really bad happens
|
15
|
-
if (
|
12
|
+
if (comparer.structural(this.state.filterGroup, {
|
16
13
|
logic: 'and',
|
17
14
|
filters: [
|
18
15
|
{ field: props.column.field, operator: defaultOperator },
|
19
16
|
{ field: props.column.field, operator: defaultOperator },
|
20
17
|
],
|
21
18
|
})) {
|
22
|
-
const newDefaultOperator =
|
19
|
+
const newDefaultOperator = multiselectOperators[0].operator;
|
23
20
|
this.state = Object.assign(Object.assign({}, this.state), { filterGroup: {
|
24
21
|
logic: 'and',
|
25
22
|
filters: [
|
@@ -30,5 +27,4 @@ class TableColumnMenuFilterExt extends design_system_1.TableColumnMenuFilter {
|
|
30
27
|
}
|
31
28
|
}
|
32
29
|
}
|
33
|
-
exports.TableColumnMenuFilterExt = TableColumnMenuFilterExt;
|
34
30
|
//# sourceMappingURL=table-column-menu-filter-ext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-column-menu-filter-ext.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"table-column-menu-filter-ext.js","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAEtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,sGAAsG;AACtG,MAAM,OAAO,wBAAyB,SAAQ,qBAAqB;IAC/D,YAAY,KAAiC;;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,MAAM,eAAe,GAAG,kBAAkB,CACtC,KAAK,CAAC,eAAe,EACrB,MAAA,KAAK,CAAC,MAAM,CAAC,MAAM,mCAAI,MAAM,CAChC,CAAC;QACF,iIAAiI;QACjI,IACI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACxC,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACL,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE;gBACxD,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE;aAC3D;SACJ,CAAC,EACJ;YACE,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC5D,IAAI,CAAC,KAAK,mCACH,IAAI,CAAC,KAAK,KACb,WAAW,EAAE;oBACT,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE;wBAC3D,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,K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