@servicetitan/table 25.8.0 → 25.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts +1 -0
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.d.ts.map +1 -1
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js +19 -0
- package/dist/filters/numeric-filter-extended/numeric-filter-extended.js.map +1 -1
- package/package.json +6 -6
- package/src/filters/numeric-filter-extended/numeric-filter-extended.tsx +23 -1
@@ -1,3 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
export declare const NumericFilterExtended: (props: import("@progress/kendo-react-grid").GridColumnMenuProps) => JSX.Element;
|
3
|
+
export declare const PercentageFilterExtended: (props: import("@progress/kendo-react-grid").GridColumnMenuProps) => JSX.Element;
|
3
4
|
//# sourceMappingURL=numeric-filter-extended.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numeric-filter-extended.d.ts","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-filter-extended.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"numeric-filter-extended.d.ts","sourceRoot":"","sources":["../../../src/filters/numeric-filter-extended/numeric-filter-extended.tsx"],"names":[],"mappings":";AAkFA,eAAO,MAAM,qBAAqB,kFAA2D,CAAC;AAE9F,eAAO,MAAM,wBAAwB,kFAA8D,CAAC"}
|
@@ -1,3 +1,14 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
13
|
import { NumericTextBox } from '@progress/kendo-react-inputs';
|
3
14
|
import { DropDownList } from '@progress/kendo-react-dropdowns';
|
@@ -23,5 +34,13 @@ const NumericExtFilterCell = ({ operators, operator = '', value, onChange, }) =>
|
|
23
34
|
isNumericExtendedOperator(operator);
|
24
35
|
return (_jsxs("div", { children: [_jsx(DropDownList, { className: "m-b-1", value: operatorValue, onChange: handleOperatorChange, data: operatorsExt, textField: "text" }), _jsx(NumericTextBox, { value: value, onChange: handleInputChange, disabled: isUnary, className: "m-b-1" })] }));
|
25
36
|
};
|
37
|
+
const PercentageExtFilterCell = (_a) => {
|
38
|
+
var { onChange, value } = _a, restProps = __rest(_a, ["onChange", "value"]);
|
39
|
+
const handleInputChange = (event) => {
|
40
|
+
onChange(Object.assign(Object.assign({}, event), { value: event.value ? event.value / 100 : event.value }));
|
41
|
+
};
|
42
|
+
return (_jsx(NumericExtFilterCell, Object.assign({ onChange: handleInputChange, value: value ? value * 100 : value }, restProps)));
|
43
|
+
};
|
26
44
|
export const NumericFilterExtended = renderCustomColumnMenuFilter(NumericExtFilterCell, true);
|
45
|
+
export const PercentageFilterExtended = renderCustomColumnMenuFilter(PercentageExtFilterCell, true);
|
27
46
|
//# 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-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,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AAM,GAClB,EACF,KAAC,cAAc,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAC,OAAO,GACnB,IACA,CACT,CAAC;AACN,CAAC,CAAC;AACF,MAAM,uBAAuB,GAAuC,CAAC,EAIpE,EAAE,EAAE;QAJgE,EACjE,QAAQ,EACR,KAAK,OAER,EADM,SAAS,cAHqD,qBAIpE,CADe;IAEZ,MAAM,iBAAiB,GAAG,CAAC,KAI1B,EAAE,EAAE;QACD,QAAQ,iCAAM,KAAK,KAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAG,CAAC;IACjF,CAAC,CAAC;IACF,OAAO,CACH,KAAC,oBAAoB,kBACjB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,IAC9B,SAAS,EACf,CACL,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@servicetitan/table",
|
3
|
-
"version": "25.8.
|
3
|
+
"version": "25.8.1",
|
4
4
|
"description": "",
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/table",
|
6
6
|
"repository": {
|
@@ -37,9 +37,9 @@
|
|
37
37
|
"memoize-one": "~6.0.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@servicetitan/data-query": "^25.8.
|
40
|
+
"@servicetitan/data-query": "^25.8.1",
|
41
41
|
"@servicetitan/design-system": ">=12.4.1",
|
42
|
-
"@servicetitan/form": "^25.8.
|
42
|
+
"@servicetitan/form": "^25.8.1",
|
43
43
|
"@servicetitan/react-ioc": "^21.6.0",
|
44
44
|
"@servicetitan/suppress-warnings": "^21.6.0",
|
45
45
|
"@types/accounting": "~0.4.2",
|
@@ -53,9 +53,9 @@
|
|
53
53
|
"react": "~17.0.2"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|
56
|
-
"@servicetitan/data-query": "^25.8.
|
56
|
+
"@servicetitan/data-query": "^25.8.1",
|
57
57
|
"@servicetitan/design-system": ">=12.4.1",
|
58
|
-
"@servicetitan/form": "^25.8.
|
58
|
+
"@servicetitan/form": "^25.8.1",
|
59
59
|
"@servicetitan/react-ioc": ">21.0.0",
|
60
60
|
"@servicetitan/suppress-warnings": ">21.0.0",
|
61
61
|
"accounting": "~0.4.1",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"cli": {
|
73
73
|
"webpack": false
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "7ff86e7a40bab18082b6d972addbab9f4b2ff88c"
|
76
76
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FC } from 'react';
|
1
|
+
import { FC, SyntheticEvent } from 'react';
|
2
2
|
|
3
3
|
import { NumericTextBox, NumericTextBoxChangeEvent } from '@progress/kendo-react-inputs';
|
4
4
|
import { DropDownList, DropDownListChangeEvent } from '@progress/kendo-react-dropdowns';
|
@@ -59,5 +59,27 @@ const NumericExtFilterCell: FC<TableColumnMenuFilterCellProps> = ({
|
|
59
59
|
</div>
|
60
60
|
);
|
61
61
|
};
|
62
|
+
const PercentageExtFilterCell: FC<TableColumnMenuFilterCellProps> = ({
|
63
|
+
onChange,
|
64
|
+
value,
|
65
|
+
...restProps
|
66
|
+
}) => {
|
67
|
+
const handleInputChange = (event: {
|
68
|
+
value: any;
|
69
|
+
operator: string | Function;
|
70
|
+
syntheticEvent: SyntheticEvent<any>;
|
71
|
+
}) => {
|
72
|
+
onChange({ ...event, value: event.value ? event.value / 100 : event.value });
|
73
|
+
};
|
74
|
+
return (
|
75
|
+
<NumericExtFilterCell
|
76
|
+
onChange={handleInputChange}
|
77
|
+
value={value ? value * 100 : value}
|
78
|
+
{...restProps}
|
79
|
+
/>
|
80
|
+
);
|
81
|
+
};
|
62
82
|
|
63
83
|
export const NumericFilterExtended = renderCustomColumnMenuFilter(NumericExtFilterCell, true);
|
84
|
+
|
85
|
+
export const PercentageFilterExtended = renderCustomColumnMenuFilter(PercentageExtFilterCell, true);
|