@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.
- package/CHANGELOG.md +566 -0
- package/package.json +10 -10
- package/src/select-cell/select-cell.tsx +44 -16
- package/dist/demo/index.d.ts +0 -4
- package/dist/demo/index.d.ts.map +0 -1
- package/dist/demo/index.js +0 -4
- package/dist/demo/index.js.map +0 -1
- package/dist/demo/master-detail/detail-table.d.ts +0 -4
- package/dist/demo/master-detail/detail-table.d.ts.map +0 -1
- package/dist/demo/master-detail/detail-table.js +0 -28
- package/dist/demo/master-detail/detail-table.js.map +0 -1
- package/dist/demo/master-detail/detail-table.store.d.ts +0 -14
- package/dist/demo/master-detail/detail-table.store.d.ts.map +0 -1
- package/dist/demo/master-detail/detail-table.store.js +0 -104
- package/dist/demo/master-detail/detail-table.store.js.map +0 -1
- package/dist/demo/master-detail/index.d.ts +0 -2
- package/dist/demo/master-detail/index.d.ts.map +0 -1
- package/dist/demo/master-detail/index.js +0 -2
- package/dist/demo/master-detail/index.js.map +0 -1
- package/dist/demo/master-detail/master-table.store.d.ts +0 -14
- package/dist/demo/master-detail/master-table.store.d.ts.map +0 -1
- package/dist/demo/master-detail/master-table.store.js +0 -103
- package/dist/demo/master-detail/master-table.store.js.map +0 -1
- package/dist/demo/master-detail/product-detail.d.ts +0 -8
- package/dist/demo/master-detail/product-detail.d.ts.map +0 -1
- package/dist/demo/master-detail/product-detail.js +0 -2
- package/dist/demo/master-detail/product-detail.js.map +0 -1
- package/dist/demo/master-detail/product-details.d.ts +0 -3
- package/dist/demo/master-detail/product-details.d.ts.map +0 -1
- package/dist/demo/master-detail/product-details.js +0 -55
- package/dist/demo/master-detail/product-details.js.map +0 -1
- package/dist/demo/master-detail/product.d.ts +0 -26
- package/dist/demo/master-detail/product.d.ts.map +0 -1
- package/dist/demo/master-detail/product.js +0 -16
- package/dist/demo/master-detail/product.js.map +0 -1
- package/dist/demo/master-detail/products.d.ts +0 -3
- package/dist/demo/master-detail/products.d.ts.map +0 -1
- package/dist/demo/master-detail/products.js +0 -117
- package/dist/demo/master-detail/products.js.map +0 -1
- package/dist/demo/master-detail/table-master-detail.d.ts +0 -3
- package/dist/demo/master-detail/table-master-detail.d.ts.map +0 -1
- package/dist/demo/master-detail/table-master-detail.js +0 -24
- package/dist/demo/master-detail/table-master-detail.js.map +0 -1
- package/dist/demo/overview/actions-cell.d.ts +0 -5
- package/dist/demo/overview/actions-cell.d.ts.map +0 -1
- package/dist/demo/overview/actions-cell.js +0 -38
- package/dist/demo/overview/actions-cell.js.map +0 -1
- package/dist/demo/overview/index.d.ts +0 -2
- package/dist/demo/overview/index.d.ts.map +0 -1
- package/dist/demo/overview/index.js +0 -2
- package/dist/demo/overview/index.js.map +0 -1
- package/dist/demo/overview/product.d.ts +0 -27
- package/dist/demo/overview/product.d.ts.map +0 -1
- package/dist/demo/overview/product.js +0 -16
- package/dist/demo/overview/product.js.map +0 -1
- package/dist/demo/overview/products.d.ts +0 -3
- package/dist/demo/overview/products.d.ts.map +0 -1
- package/dist/demo/overview/products.js +0 -127
- package/dist/demo/overview/products.js.map +0 -1
- package/dist/demo/overview/table.d.ts +0 -6
- package/dist/demo/overview/table.d.ts.map +0 -1
- package/dist/demo/overview/table.js +0 -44
- package/dist/demo/overview/table.js.map +0 -1
- package/dist/demo/overview/table.store.d.ts +0 -15
- package/dist/demo/overview/table.store.d.ts.map +0 -1
- package/dist/demo/overview/table.store.js +0 -92
- package/dist/demo/overview/table.store.js.map +0 -1
- package/dist/demo/state-caching/beverages.d.ts +0 -3
- package/dist/demo/state-caching/beverages.d.ts.map +0 -1
- package/dist/demo/state-caching/beverages.js +0 -48
- package/dist/demo/state-caching/beverages.js.map +0 -1
- package/dist/demo/state-caching/index.d.ts +0 -2
- package/dist/demo/state-caching/index.d.ts.map +0 -1
- package/dist/demo/state-caching/index.js +0 -2
- package/dist/demo/state-caching/index.js.map +0 -1
- package/dist/demo/state-caching/product.d.ts +0 -6
- package/dist/demo/state-caching/product.d.ts.map +0 -1
- package/dist/demo/state-caching/product.js +0 -2
- package/dist/demo/state-caching/product.js.map +0 -1
- package/dist/demo/state-caching/products.d.ts +0 -3
- package/dist/demo/state-caching/products.d.ts.map +0 -1
- package/dist/demo/state-caching/products.js +0 -53
- package/dist/demo/state-caching/products.js.map +0 -1
- package/dist/demo/state-caching/state-caching-table.d.ts +0 -3
- package/dist/demo/state-caching/state-caching-table.d.ts.map +0 -1
- package/dist/demo/state-caching/state-caching-table.js +0 -14
- package/dist/demo/state-caching/state-caching-table.js.map +0 -1
- package/dist/demo/state-caching/state-caching-table.store.d.ts +0 -13
- package/dist/demo/state-caching/state-caching-table.store.d.ts.map +0 -1
- package/dist/demo/state-caching/state-caching-table.store.js +0 -70
- package/dist/demo/state-caching/state-caching-table.store.js.map +0 -1
- package/dist/editable-cell/boolean-editable-cell.d.ts +0 -3
- package/dist/editable-cell/boolean-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/boolean-editable-cell.js +0 -14
- package/dist/editable-cell/boolean-editable-cell.js.map +0 -1
- package/dist/editable-cell/date-editable-cell.d.ts +0 -3
- package/dist/editable-cell/date-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/date-editable-cell.js +0 -14
- package/dist/editable-cell/date-editable-cell.js.map +0 -1
- package/dist/editable-cell/get-action-cell.d.ts +0 -13
- package/dist/editable-cell/get-action-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-action-cell.js +0 -18
- package/dist/editable-cell/get-action-cell.js.map +0 -1
- package/dist/editable-cell/get-editable-cell.d.ts +0 -13
- package/dist/editable-cell/get-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-editable-cell.js +0 -18
- package/dist/editable-cell/get-editable-cell.js.map +0 -1
- package/dist/editable-cell/get-select-editable-cell.d.ts +0 -10
- package/dist/editable-cell/get-select-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/get-select-editable-cell.js +0 -19
- package/dist/editable-cell/get-select-editable-cell.js.map +0 -1
- package/dist/editable-cell/index.d.ts +0 -8
- package/dist/editable-cell/index.d.ts.map +0 -1
- package/dist/editable-cell/index.js +0 -8
- package/dist/editable-cell/index.js.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.d.ts +0 -3
- package/dist/editable-cell/numeric-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.js +0 -15
- package/dist/editable-cell/numeric-editable-cell.js.map +0 -1
- package/dist/editable-cell/text-editable-cell.d.ts +0 -9
- package/dist/editable-cell/text-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/text-editable-cell.js +0 -20
- package/dist/editable-cell/text-editable-cell.js.map +0 -1
- package/dist/export/export.d.ts +0 -10
- package/dist/export/export.d.ts.map +0 -1
- package/dist/export/export.js +0 -6
- package/dist/export/export.js.map +0 -1
- package/dist/export/index.d.ts +0 -2
- package/dist/export/index.d.ts.map +0 -1
- package/dist/export/index.js +0 -2
- package/dist/export/index.js.map +0 -1
- package/dist/filters/column-menu-filters.d.ts +0 -5
- package/dist/filters/column-menu-filters.d.ts.map +0 -1
- package/dist/filters/column-menu-filters.js +0 -9
- package/dist/filters/column-menu-filters.js.map +0 -1
- package/dist/filters/datetime-filter/datetime-filter.d.ts +0 -3
- package/dist/filters/datetime-filter/datetime-filter.d.ts.map +0 -1
- package/dist/filters/datetime-filter/datetime-filter.js +0 -71
- package/dist/filters/datetime-filter/datetime-filter.js.map +0 -1
- package/dist/filters/field-values-filter.d.ts +0 -6
- package/dist/filters/field-values-filter.d.ts.map +0 -1
- package/dist/filters/field-values-filter.js +0 -155
- package/dist/filters/field-values-filter.js.map +0 -1
- package/dist/filters/index.d.ts +0 -9
- package/dist/filters/index.d.ts.map +0 -1
- package/dist/filters/index.js +0 -9
- package/dist/filters/index.js.map +0 -1
- package/dist/filters/multiselect-filter.d.ts +0 -5
- package/dist/filters/multiselect-filter.d.ts.map +0 -1
- package/dist/filters/multiselect-filter.js +0 -107
- package/dist/filters/multiselect-filter.js.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts +0 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.d.ts.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js +0 -6
- package/dist/filters/numeric-filter-extended/numeric-extended-operators.js.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +0 -3
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +0 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +0 -27
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +0 -1
- package/dist/filters/range-filter/range-filter.d.ts +0 -6
- package/dist/filters/range-filter/range-filter.d.ts.map +0 -1
- package/dist/filters/range-filter/range-filter.js +0 -117
- package/dist/filters/range-filter/range-filter.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts +0 -21
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js +0 -82
- package/dist/filters/standard-filter-with-multiselect/filter-cell-ext.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts +0 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js +0 -6
- package/dist/filters/standard-filter-with-multiselect/multiselect-operators.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts +0 -26
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js +0 -69
- package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts +0 -6
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.d.ts.map +0 -1
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js +0 -30
- package/dist/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.js.map +0 -1
- package/dist/filters/time-filter/time-filter.d.ts +0 -3
- package/dist/filters/time-filter/time-filter.d.ts.map +0 -1
- package/dist/filters/time-filter/time-filter.js +0 -71
- package/dist/filters/time-filter/time-filter.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/select-cell/index.d.ts +0 -2
- package/dist/select-cell/index.d.ts.map +0 -1
- package/dist/select-cell/index.js +0 -2
- package/dist/select-cell/index.js.map +0 -1
- package/dist/select-cell/select-cell.d.ts +0 -25
- package/dist/select-cell/select-cell.d.ts.map +0 -1
- package/dist/select-cell/select-cell.js +0 -35
- package/dist/select-cell/select-cell.js.map +0 -1
- package/dist/table-state.d.ts +0 -161
- package/dist/table-state.d.ts.map +0 -1
- package/dist/table-state.js +0 -1106
- package/dist/table-state.js.map +0 -1
- package/dist/table.d.ts +0 -40
- package/dist/table.d.ts.map +0 -1
- package/dist/table.js +0 -231
- package/dist/table.js.map +0 -1
@@ -1,117 +0,0 @@
|
|
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';
|
8
|
-
const NoSSR = ({ children }) => {
|
9
|
-
const [isMounted, setIsMounted] = useState(false);
|
10
|
-
useEffect(() => {
|
11
|
-
setIsMounted(true);
|
12
|
-
}, []);
|
13
|
-
return isMounted ? children : null;
|
14
|
-
};
|
15
|
-
class RangeFilterCellBase extends Component {
|
16
|
-
constructor(props, controlClass, controlProps = {}) {
|
17
|
-
super(props);
|
18
|
-
Object.defineProperty(this, "controlClass", {
|
19
|
-
enumerable: true,
|
20
|
-
configurable: true,
|
21
|
-
writable: true,
|
22
|
-
value: controlClass
|
23
|
-
});
|
24
|
-
Object.defineProperty(this, "controlProps", {
|
25
|
-
enumerable: true,
|
26
|
-
configurable: true,
|
27
|
-
writable: true,
|
28
|
-
value: controlProps
|
29
|
-
});
|
30
|
-
Object.defineProperty(this, "minValueBox", {
|
31
|
-
enumerable: true,
|
32
|
-
configurable: true,
|
33
|
-
writable: true,
|
34
|
-
value: null
|
35
|
-
});
|
36
|
-
Object.defineProperty(this, "maxValueBox", {
|
37
|
-
enumerable: true,
|
38
|
-
configurable: true,
|
39
|
-
writable: true,
|
40
|
-
value: null
|
41
|
-
});
|
42
|
-
Object.defineProperty(this, "onChange", {
|
43
|
-
enumerable: true,
|
44
|
-
configurable: true,
|
45
|
-
writable: true,
|
46
|
-
value: (ev) => {
|
47
|
-
if (!this.minValueBox || !this.maxValueBox) {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
this.props.onChange({
|
51
|
-
value: { min: this.minValueBox.value, max: this.maxValueBox.value },
|
52
|
-
operator: this.inRange,
|
53
|
-
syntheticEvent: ev.syntheticEvent,
|
54
|
-
});
|
55
|
-
}
|
56
|
-
});
|
57
|
-
Object.defineProperty(this, "setMinValueRef", {
|
58
|
-
enumerable: true,
|
59
|
-
configurable: true,
|
60
|
-
writable: true,
|
61
|
-
value: (el) => {
|
62
|
-
this.minValueBox = el;
|
63
|
-
}
|
64
|
-
});
|
65
|
-
Object.defineProperty(this, "setMaxValueRef", {
|
66
|
-
enumerable: true,
|
67
|
-
configurable: true,
|
68
|
-
writable: true,
|
69
|
-
value: (el) => {
|
70
|
-
this.maxValueBox = el;
|
71
|
-
}
|
72
|
-
});
|
73
|
-
}
|
74
|
-
/** override this if additional type support needed */
|
75
|
-
inRange(current, values) {
|
76
|
-
return ((values.min === null || values.min === undefined || current >= values.min) &&
|
77
|
-
(values.max === null || values.max === undefined || current <= values.max));
|
78
|
-
}
|
79
|
-
render() {
|
80
|
-
const filterValue = this.props.value;
|
81
|
-
const Control = this.controlClass;
|
82
|
-
return (_jsxs(Fragment, { children: [_jsx("span", Object.assign({ className: "k-widget" }, { children: "From:" })), _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 })) }) })), _jsx("span", Object.assign({ className: "k-widget" }, { children: "To:" })), _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 })) }) }))] }));
|
83
|
-
}
|
84
|
-
}
|
85
|
-
class NumericRangeFilterCell extends RangeFilterCellBase {
|
86
|
-
constructor(props) {
|
87
|
-
super(props, NumericTextBox);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
class CurrencyRangeFilterCell extends RangeFilterCellBase {
|
91
|
-
constructor(props) {
|
92
|
-
super(props, NumericTextBox, {
|
93
|
-
format: 'c',
|
94
|
-
});
|
95
|
-
}
|
96
|
-
}
|
97
|
-
class DateRangeFilterCell extends RangeFilterCellBase {
|
98
|
-
constructor(props) {
|
99
|
-
super(props, DatePicker);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
function getTimeString(date) {
|
103
|
-
return `${date.getHours()}:${date.getMinutes()}`;
|
104
|
-
}
|
105
|
-
class TimeRangeFilterCell extends RangeFilterCellBase {
|
106
|
-
constructor(props) {
|
107
|
-
super(props, TimePicker);
|
108
|
-
}
|
109
|
-
inRange(current, values) {
|
110
|
-
return moment(getTimeString(current), 'h:mma').isBetween(moment(getTimeString(values.min || current), 'h:mma'), moment(getTimeString(values.max || current), 'h:mma'), 'minutes', '[]');
|
111
|
-
}
|
112
|
-
}
|
113
|
-
export const NumericRangeColumnMenuFilter = renderCustomColumnMenuFilter(NumericRangeFilterCell);
|
114
|
-
export const CurrencyRangeColumnMenuFilter = renderCustomColumnMenuFilter(CurrencyRangeFilterCell);
|
115
|
-
export const DateRangeColumnMenuFilter = renderCustomColumnMenuFilter(DateRangeFilterCell);
|
116
|
-
export const TimeRangeColumnMenuFilter = renderCustomColumnMenuFilter(TimeRangeFilterCell);
|
117
|
-
//# sourceMappingURL=range-filter.js.map
|
@@ -1 +0,0 @@
|
|
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;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a,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CACpD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,EACrD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,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,21 +0,0 @@
|
|
1
|
-
import { ReactElement, ReactNode, FC } from 'react';
|
2
|
-
import { ListItemProps, MultiSelectTagData } from '@progress/kendo-react-dropdowns';
|
3
|
-
import { GridColumnMenuFilterCellProps as TableColumnMenuFilterCellProps } from '@progress/kendo-react-grid/dist/npm/columnMenu/GridColumnMenuFilterCell';
|
4
|
-
interface ValueWithLowerCase {
|
5
|
-
value: any;
|
6
|
-
text: string;
|
7
|
-
textLC: string;
|
8
|
-
}
|
9
|
-
export interface FilterCellExtProps extends TableColumnMenuFilterCellProps {
|
10
|
-
options: ValueWithLowerCase[];
|
11
|
-
maxFoundValues?: number;
|
12
|
-
allowCustomValues?: boolean;
|
13
|
-
onlyMultiselectAndEmptyOperators?: boolean;
|
14
|
-
handleCustomValuesAsNumber?: boolean;
|
15
|
-
multiselectItemRender?(li: ReactElement<HTMLLIElement>, itemProps: ListItemProps): ReactNode;
|
16
|
-
multiselectTagRender?(tagData: MultiSelectTagData, li: ReactElement<HTMLLIElement>): ReactElement<HTMLLIElement> | null;
|
17
|
-
multiselectListNoDataRender?(element: ReactElement<HTMLDivElement>): ReactNode;
|
18
|
-
}
|
19
|
-
export declare const FilterCellExt: FC<FilterCellExtProps>;
|
20
|
-
export {};
|
21
|
-
//# sourceMappingURL=filter-cell-ext.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filter-cell-ext.d.ts","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/filter-cell-ext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AAKjE,OAAO,EAMH,aAAa,EACb,kBAAkB,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,6BAA6B,IAAI,8BAA8B,EAAE,MAAM,yEAAyE,CAAC;AAS1J,UAAU,kBAAkB;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAmB,SAAQ,8BAA8B;IACtE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,qBAAqB,CAAC,CAAC,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7F,oBAAoB,CAAC,CACjB,OAAO,EAAE,kBAAkB,EAC3B,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,GAChC,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IACtC,2BAA2B,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAClF;AAGD,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAuI/C,CAAC"}
|
@@ -1,82 +0,0 @@
|
|
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';
|
9
|
-
// like standard filter cell (rendered for string type), but with support of multiselect operators
|
10
|
-
export const FilterCellExt = observer(props => {
|
11
|
-
const store = useLocalStore(oprops => ({
|
12
|
-
get operators() {
|
13
|
-
return multiselectOperators.concat(oprops.onlyMultiselectAndEmptyOperators
|
14
|
-
? oprops.operators.filter(o => o.operator === 'isempty' || o.operator === 'isnotempty')
|
15
|
-
: oprops.operators);
|
16
|
-
},
|
17
|
-
get operatorValue() {
|
18
|
-
return this.operators.find(item => item.operator === oprops.operator);
|
19
|
-
},
|
20
|
-
searchQuery: '',
|
21
|
-
filterChange(event) {
|
22
|
-
runInAction(() => (this.searchQuery = event.filter.value));
|
23
|
-
},
|
24
|
-
get filteredValuesSet() {
|
25
|
-
const queryLC = this.searchQuery.toLowerCase();
|
26
|
-
return oprops.options.filter(v => v.textLC.includes(queryLC));
|
27
|
-
},
|
28
|
-
get onlyFirstValues() {
|
29
|
-
return oprops.maxFoundValues &&
|
30
|
-
oprops.maxFoundValues < this.filteredValuesSet.length
|
31
|
-
? oprops.maxFoundValues
|
32
|
-
: false;
|
33
|
-
},
|
34
|
-
get filteredVisibleValues() {
|
35
|
-
return this.onlyFirstValues
|
36
|
-
? this.filteredValuesSet.slice(0, this.onlyFirstValues)
|
37
|
-
: this.filteredValuesSet;
|
38
|
-
},
|
39
|
-
get valueTextMap() {
|
40
|
-
return new Map(oprops.options.map(o => [o.value, o.text]));
|
41
|
-
},
|
42
|
-
get multiselectValue() {
|
43
|
-
return Array.isArray(oprops.value)
|
44
|
-
? oprops.value.map(v => {
|
45
|
-
var _a;
|
46
|
-
return ({
|
47
|
-
value: v,
|
48
|
-
text: (_a = this.valueTextMap.get(v)) !== null && _a !== void 0 ? _a : v.toString(),
|
49
|
-
});
|
50
|
-
})
|
51
|
-
: [];
|
52
|
-
},
|
53
|
-
}), props);
|
54
|
-
const { operator = '', onChange, allowCustomValues, multiselectItemRender, multiselectTagRender, multiselectListNoDataRender, } = props;
|
55
|
-
const handleInputChange = (e) => onChange({
|
56
|
-
operator,
|
57
|
-
value: e.target.value,
|
58
|
-
syntheticEvent: e,
|
59
|
-
});
|
60
|
-
const handleMultiselectChange = (e) => {
|
61
|
-
const newValue = e.value.map((v) => { var _a; return (_a = v.value) !== null && _a !== void 0 ? _a : (props.handleCustomValuesAsNumber ? +v.text : v.text); });
|
62
|
-
onChange({
|
63
|
-
operator,
|
64
|
-
value: newValue.length ? newValue : '',
|
65
|
-
syntheticEvent: e.syntheticEvent,
|
66
|
-
});
|
67
|
-
};
|
68
|
-
// conversions for better compatibility when switching plain/array operators
|
69
|
-
const handleOperatorChange = (event) => {
|
70
|
-
const newValue = isMultiselectOperator(operator) === isMultiselectOperator(event.target.value.operator)
|
71
|
-
? props.value
|
72
|
-
: '';
|
73
|
-
cellOperatorChange(event, newValue, onChange);
|
74
|
-
};
|
75
|
-
const allowCustomAdd = (allowCustomValues &&
|
76
|
-
store.searchQuery &&
|
77
|
-
(!props.handleCustomValuesAsNumber || !isNaN(+store.searchQuery))) ||
|
78
|
-
false;
|
79
|
-
return (_jsxs("div", { children: [_jsx(DropDownList, { value: store.operatorValue, onChange: handleOperatorChange, data: store.operators, textField: "text" }), (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 }), footer: allowCustomAdd ? (_jsxs("div", Object.assign({ className: Styles.returnToUse }, { children: [_jsx(Icon, { name: "keyboard_return" }), "to create filter"] }))) : (store.onlyFirstValues && (_jsxs("div", Object.assign({ className: Styles.returnToUse }, { children: ["First ", store.onlyFirstValues, " values are shown. ", _jsx("br", {}), "Type to search for other values."] })))), itemRender: multiselectItemRender, tagRender: multiselectTagRender, listNoDataRender: multiselectListNoDataRender })) : (_jsx("input", { className: "k-textbox", value: props.value, onChange: handleInputChange })))] }));
|
81
|
-
});
|
82
|
-
//# sourceMappingURL=filter-cell-ext.js.map
|
@@ -1 +0,0 @@
|
|
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,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,EACH,YAAY,EAEZ,WAAW,GAKd,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACH,aAAa,EACb,kBAAkB,GACrB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAuBvD,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAA2B,QAAQ,CAAC,KAAK,CAAC,EAAE;IAClE,MAAM,KAAK,GAAG,aAAa,CACvB,MAAM,CAAC,EAAE,CAAC,CAAC;QACP,IAAI,SAAS;YACT,OAAO,oBAAoB,CAAC,MAAM,CAC9B,MAAM,CAAC,gCAAgC;gBACnC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AAM,CAAC,mBAAmB,GAAI,EACxE,MAAM,EACF,cAAc,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAE,MAAM,CAAC,WAAW,iBAC9B,KAAC,IAAI,IAAC,IAAI,EAAC,iBAAiB,GAAG,yBAE7B,CACT,CAAC,CAAC,CAAC,CACA,KAAK,CAAC,eAAe,IAAI,CACrB,6BAAK,SAAS,EAAE,MAAM,CAAC,WAAW,2BACvB,KAAK,CAAC,eAAe,yBAAoB,cAAM,yCAEpD,CACT,CACJ,EAEL,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,oBAAoB,EAC/B,gBAAgB,EAAE,2BAA2B,GAC/C,CACL,CAAC,CAAC,CAAC,CACA,gBAAO,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,GAAI,CACnF,CAAC,IACJ,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"multiselect-operators.d.ts","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/multiselect-operators.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;GAGhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAc,MAAM,GAAG,QAAQ,YACN,CAAC"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
export const multiselectOperators = [
|
2
|
-
{ text: 'Is one of', operator: 'in' },
|
3
|
-
{ text: 'Is not one of', operator: 'notin' },
|
4
|
-
];
|
5
|
-
export const isMultiselectOperator = (operator) => multiselectOperators.some(o => o.operator === operator);
|
6
|
-
//# sourceMappingURL=multiselect-operators.js.map
|
@@ -1 +0,0 @@
|
|
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,26 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { TableColumnMenuProps } from '@servicetitan/design-system';
|
3
|
-
import { IdType } from '@servicetitan/data-query';
|
4
|
-
import { TableState } from '../../table-state';
|
5
|
-
import { FilterCellExtProps } from './filter-cell-ext';
|
6
|
-
declare type AcceptableOption = string | number | {
|
7
|
-
value: any;
|
8
|
-
text: string;
|
9
|
-
};
|
10
|
-
interface OptionsConfig<T, TId extends IdType = never> {
|
11
|
-
tableState?: TableState<T, TId>;
|
12
|
-
maxExtractedLength?: number;
|
13
|
-
options?: AcceptableOption[];
|
14
|
-
}
|
15
|
-
interface FilterCellConfig {
|
16
|
-
maxFoundValues?: number;
|
17
|
-
allowCustomValues?: boolean;
|
18
|
-
handleCustomValuesAsNumber?: boolean;
|
19
|
-
onlyMultiselectAndEmptyOperators?: boolean;
|
20
|
-
multiselectItemRender?: FilterCellExtProps['multiselectItemRender'];
|
21
|
-
multiselectTagRender?: FilterCellExtProps['multiselectTagRender'];
|
22
|
-
multiselectListNoDataRender?: FilterCellExtProps['multiselectListNoDataRender'];
|
23
|
-
}
|
24
|
-
export declare function standardFilterWithMultiselect<T, TId extends IdType = never>(optionsConfig?: OptionsConfig<T, TId>, filterCellConfig?: FilterCellConfig): (props: TableColumnMenuProps) => JSX.Element;
|
25
|
-
export {};
|
26
|
-
//# sourceMappingURL=standard-filter-with-multiselect.d.ts.map
|
package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"standard-filter-with-multiselect.d.ts","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAiB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,aAAK,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,UAAU,aAAa,CAAC,CAAC,EAAE,GAAG,SAAS,MAAM,GAAG,KAAK;IAEjD,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEhC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,UAAU,gBAAgB;IAEtB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAE3C,qBAAqB,CAAC,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;IAEpE,oBAAoB,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAElE,2BAA2B,CAAC,EAAE,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;CACnF;AAOD,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,GAAG,SAAS,MAAM,GAAG,KAAK,EACvE,aAAa,GAAE,aAAa,CAAC,CAAC,EAAE,GAAG,CAAM,EACzC,gBAAgB,GAAE,gBAAqB,WA8GxB,oBAAoB,iBAGtC"}
|
@@ -1,69 +0,0 @@
|
|
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';
|
7
|
-
/*
|
8
|
-
* StandardFilterWithMultiselect is like standard Kendo filter, but with additional operators 'Is one of' / 'Is not one of'.
|
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).
|
10
|
-
*/
|
11
|
-
export function standardFilterWithMultiselect(optionsConfig = {}, filterCellConfig = {}) {
|
12
|
-
const optionsConfigFull = Object.assign({ maxExtractedLength: 64, options: [] }, optionsConfig);
|
13
|
-
const filterCellConfigFull = Object.assign({ allowCustomValues: true, maxFoundValues: 1000 }, filterCellConfig);
|
14
|
-
// Filter UI with data fetcher
|
15
|
-
const FilterUIWithValues = observer(props => {
|
16
|
-
const store = useLocalStore(oprops => ({
|
17
|
-
get field() {
|
18
|
-
return oprops.firstFilterProps.field;
|
19
|
-
},
|
20
|
-
get itemsFromDataSource() {
|
21
|
-
var _a;
|
22
|
-
const dataSource = (_a = optionsConfigFull.tableState) === null || _a === void 0 ? void 0 : _a.dataSource;
|
23
|
-
return dataSource && this.field && fromPromise(dataSource.getData({}));
|
24
|
-
},
|
25
|
-
get valuesfromTableState() {
|
26
|
-
if (!this.itemsFromDataSource ||
|
27
|
-
!(this.itemsFromDataSource.state === 'fulfilled')) {
|
28
|
-
return [];
|
29
|
-
}
|
30
|
-
return this.itemsFromDataSource.value.data
|
31
|
-
.map(i => i[this.field])
|
32
|
-
.filter(v => typeof v === 'number' ||
|
33
|
-
(typeof v === 'string' &&
|
34
|
-
v.length > 0 &&
|
35
|
-
v.length <= optionsConfigFull.maxExtractedLength));
|
36
|
-
},
|
37
|
-
get options() {
|
38
|
-
return Array.from(new Set(this.valuesfromTableState.concat(optionsConfigFull.options))).map(v => {
|
39
|
-
switch (typeof v) {
|
40
|
-
case 'string':
|
41
|
-
return {
|
42
|
-
value: v,
|
43
|
-
text: v,
|
44
|
-
textLC: v.toLowerCase(),
|
45
|
-
};
|
46
|
-
case 'number':
|
47
|
-
return {
|
48
|
-
value: v,
|
49
|
-
text: v.toString(),
|
50
|
-
textLC: v.toString().toLowerCase(),
|
51
|
-
};
|
52
|
-
case 'object':
|
53
|
-
return {
|
54
|
-
value: v.value,
|
55
|
-
text: v.text,
|
56
|
-
textLC: v.text.toLowerCase(),
|
57
|
-
};
|
58
|
-
default:
|
59
|
-
throw 'Incompatible option type.';
|
60
|
-
}
|
61
|
-
});
|
62
|
-
},
|
63
|
-
}), props);
|
64
|
-
const { firstFilterProps, secondFilterProps, hideSecondFilter, logicData, logicValue, onLogicChange, } = props;
|
65
|
-
return (_jsxs("div", { children: [_jsx(FilterCellExt, Object.assign({}, firstFilterProps, { options: store.options }, filterCellConfigFull)), !hideSecondFilter && (_jsxs("div", { children: [_jsx(DropDownList, { data: logicData, value: logicValue, onChange: onLogicChange, className: "k-filter-and", textField: "text" }), _jsx(FilterCellExt, Object.assign({}, secondFilterProps, { options: store.options }, filterCellConfigFull))] }))] }));
|
66
|
-
});
|
67
|
-
return (props) => (_jsx(TableColumnMenuFilterExt, Object.assign({}, props, { filterUI: FilterUIWithValues, expanded: true })));
|
68
|
-
}
|
69
|
-
//# sourceMappingURL=standard-filter-with-multiselect.js.map
|
package/dist/filters/standard-filter-with-multiselect/standard-filter-with-multiselect.js.map
DELETED
@@ -1 +0,0 @@
|
|
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,EA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AAC,gBAAgB,IAAI,CAClB,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,aAAa,oBACN,iBAAiB,IACrB,OAAO,EAAE,KAAK,CAAC,OAAO,IAClB,oBAAoB,EAC1B,IACA,CACT,IACC,CACT,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,KAA2B,EAAE,EAAE,CAAC,CACpC,KAAC,wBAAwB,oBAAK,KAAK,IAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,UAAG,CACjF,CAAC;AACN,CAAC"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { TableColumnMenuFilter } from '@servicetitan/design-system';
|
2
|
-
import { GridColumnMenuFilterProps as TableColumnMenuFilterProps } from '@progress/kendo-react-grid/dist/npm/columnMenu/GridColumnMenuFilter';
|
3
|
-
export declare class TableColumnMenuFilterExt extends TableColumnMenuFilter {
|
4
|
-
constructor(props: TableColumnMenuFilterProps);
|
5
|
-
}
|
6
|
-
//# sourceMappingURL=table-column-menu-filter-ext.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"table-column-menu-filter-ext.d.ts","sourceRoot":"","sources":["../../../src/filters/standard-filter-with-multiselect/table-column-menu-filter-ext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,yBAAyB,IAAI,0BAA0B,EAAE,MAAM,qEAAqE,CAAC;AAM9I,qBAAa,wBAAyB,SAAQ,qBAAqB;gBACnD,KAAK,EAAE,0BAA0B;CA8BhD"}
|
@@ -1,30 +0,0 @@
|
|
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';
|
5
|
-
// constructor override: if state.filterGroup was filled with default, we override it with new default
|
6
|
-
export class TableColumnMenuFilterExt extends TableColumnMenuFilter {
|
7
|
-
constructor(props) {
|
8
|
-
var _a;
|
9
|
-
super(props);
|
10
|
-
const defaultOperator = getDefaultOperator(props.filterOperators, (_a = props.column.filter) !== null && _a !== void 0 ? _a : 'text');
|
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
|
12
|
-
if (comparer.structural(this.state.filterGroup, {
|
13
|
-
logic: 'and',
|
14
|
-
filters: [
|
15
|
-
{ field: props.column.field, operator: defaultOperator },
|
16
|
-
{ field: props.column.field, operator: defaultOperator },
|
17
|
-
],
|
18
|
-
})) {
|
19
|
-
const newDefaultOperator = multiselectOperators[0].operator;
|
20
|
-
this.state = Object.assign(Object.assign({}, this.state), { filterGroup: {
|
21
|
-
logic: 'and',
|
22
|
-
filters: [
|
23
|
-
{ field: props.column.field, operator: newDefaultOperator },
|
24
|
-
{ field: props.column.field, operator: newDefaultOperator },
|
25
|
-
],
|
26
|
-
} });
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
//# sourceMappingURL=table-column-menu-filter-ext.js.map
|
@@ -1 +0,0 @@
|
|
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,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE;qBAC9D;iBACJ,GACJ,CAAC;SACL;IACL,CAAC;CACJ"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"time-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/time-filter/time-filter.tsx"],"names":[],"mappings":";AAoEA,eAAO,MAAM,oBAAoB,oFAAqD,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 { 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 './time-filter.module.css';
|
19
|
-
let TimeFilterCell = class TimeFilterCell 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: value ? new Date(2000, 0, 1, value.getHours(), value.getMinutes()) : null,
|
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) && (_jsx(TimePicker, { value: this.props.value, onChange: this.handleChange, className: Styles.timePicker }))] }));
|
56
|
-
}
|
57
|
-
};
|
58
|
-
__decorate([
|
59
|
-
observable,
|
60
|
-
__metadata("design:type", Object)
|
61
|
-
], TimeFilterCell.prototype, "operator", void 0);
|
62
|
-
__decorate([
|
63
|
-
action,
|
64
|
-
__metadata("design:type", Object)
|
65
|
-
], TimeFilterCell.prototype, "handleOperatorChange", void 0);
|
66
|
-
TimeFilterCell = __decorate([
|
67
|
-
observer,
|
68
|
-
__metadata("design:paramtypes", [Object])
|
69
|
-
], TimeFilterCell);
|
70
|
-
export const TimeColumnMenuFilter = renderCustomColumnMenuFilter(TimeFilterCell, true);
|
71
|
-
//# sourceMappingURL=time-filter.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"time-filter.js","sourceRoot":"","sources":["../../../src/filters/time-filter/time-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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AAC,CAAC;YACP,CAAC;WAAC;QAjBE,cAAc,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAkBD,MAAM;QACF,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,YAAY,IACT,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EACnC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAC,UAAU,EACtB,SAAS,EAAC,MAAM,GAClB,EACD,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CACvC,KAAC,UAAU,IACP,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,SAAS,EAAE,MAAM,CAAC,UAAU,GAC9B,CACL,IACM,CACd,CAAC;IACN,CAAC;CACJ,CAAA;AA7Ce;IAAX,UAAU;;gDAEiB;AAQ5B;IADC,MAAM;;4DAIL;AAdA,cAAc;IADnB,QAAQ;;GACH,cAAc,CA8CnB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC"}
|
package/dist/index.d.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
export * from './table';
|
2
|
-
export * from './table-state';
|
3
|
-
export * from './editable-cell';
|
4
|
-
export * from './filters';
|
5
|
-
export * from './export';
|
6
|
-
export * from './select-cell';
|
7
|
-
export { TableColumn, TableColumnProps, TableColumnMenuProps, TableColumnMenuFilter, TableColumnReorderEvent, TableCell, TableHeaderCellProps, TableRowProps, TableRowClickEvent, TableDetailRow, TableDetailRowProps, TableExpandChangeEvent, TableToolbar, TableNoRecords, TableFilterCellProps, TableFilterChangeEvent, } from '@servicetitan/design-system';
|
8
|
-
export { GridColumnMenuFilterUIProps as TableColumnMenuFilterUIProps } from '@progress/kendo-react-grid/dist/npm/interfaces/GridColumnMenuFilterUIProps';
|
9
|
-
export { IdType, DataSource, InMemoryDataSource, AsyncDataSource } from '@servicetitan/data-query';
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAE9B,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,2BAA2B,IAAI,4BAA4B,EAAE,MAAM,4EAA4E,CAAC;AAEzJ,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
export * from './table';
|
2
|
-
export * from './table-state';
|
3
|
-
export * from './editable-cell';
|
4
|
-
export * from './filters';
|
5
|
-
export * from './export';
|
6
|
-
export * from './select-cell';
|
7
|
-
export { TableColumn, TableColumnMenuFilter, TableCell, TableDetailRow, TableToolbar, TableNoRecords, } from '@servicetitan/design-system';
|
8
|
-
export { InMemoryDataSource, AsyncDataSource } from '@servicetitan/data-query';
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAE9B,OAAO,EACH,WAAW,EAGX,qBAAqB,EAErB,SAAS,EAIT,cAAc,EAGd,YAAY,EACZ,cAAc,GAGjB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAsB,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/select-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/select-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { ComponentType, SyntheticEvent, FC } from 'react';
|
2
|
-
import { TableCellProps, TableHeaderCellProps, CheckboxProps } from '@servicetitan/design-system';
|
3
|
-
export declare type SelectionControlType = ComponentType<CheckboxProps<never>>;
|
4
|
-
interface SelectColumnCellProps extends TableCellProps {
|
5
|
-
isRowSelectable?: boolean;
|
6
|
-
control?: SelectionControlType;
|
7
|
-
}
|
8
|
-
interface SelectHeaderCellProps extends TableHeaderCellProps {
|
9
|
-
isSomeRowsSelected?: boolean;
|
10
|
-
control?: SelectionControlType;
|
11
|
-
}
|
12
|
-
interface SelectCellProps {
|
13
|
-
checked: boolean;
|
14
|
-
disabled?: boolean;
|
15
|
-
indeterminate?: boolean;
|
16
|
-
selectionChange?: (event: {
|
17
|
-
syntheticEvent: SyntheticEvent<any>;
|
18
|
-
}) => void;
|
19
|
-
control?: SelectionControlType;
|
20
|
-
}
|
21
|
-
export declare const SelectCell: FC<SelectCellProps>;
|
22
|
-
export declare const SelectColumnCell: FC<SelectColumnCellProps>;
|
23
|
-
export declare const SelectHeaderCell: FC<SelectHeaderCellProps>;
|
24
|
-
export {};
|
25
|
-
//# sourceMappingURL=select-cell.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"select-cell.d.ts","sourceRoot":"","sources":["../../src/select-cell/select-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EACH,cAAc,EACd,oBAAoB,EAEpB,aAAa,EAChB,MAAM,6BAA6B,CAAC;AAGrC,oBAAY,oBAAoB,GAAG,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAEvE,UAAU,qBAAsB,SAAQ,cAAc;IAClD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED,UAAU,qBAAsB,SAAQ,oBAAoB;IACxD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED,UAAU,eAAe;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3E,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAa1C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoBtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAOtD,CAAC"}
|