@akinon/akifilter 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AppliedFilters/AppliedFilterItem.js +1 -1
- package/dist/cjs/components/ShownFilters/index.d.ts.map +1 -1
- package/dist/cjs/components/ShownFilters/index.js +5 -6
- package/dist/esm/components/AppliedFilters/AppliedFilterItem.js +1 -1
- package/dist/esm/components/ShownFilters/index.d.ts.map +1 -1
- package/dist/esm/components/ShownFilters/index.js +5 -6
- package/package.json +5 -5
|
@@ -49,7 +49,7 @@ const AppliedFilterItem = ({ filterKeyValue }) => {
|
|
|
49
49
|
if ((0, lodash_1.isArray)(value)) {
|
|
50
50
|
return value.join(', ');
|
|
51
51
|
}
|
|
52
|
-
return value;
|
|
52
|
+
return String(value);
|
|
53
53
|
};
|
|
54
54
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
55
55
|
react_1.default.createElement(ui_space_1.Space, { key: filterKey, align: "center", className: "active-filter-item" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ShownFilters/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ShownFilters/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,yBAkExB,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ShownFilters = void 0;
|
|
4
4
|
const akiform_builder_1 = require("@akinon/akiform-builder");
|
|
5
5
|
const ui_typography_1 = require("@akinon/ui-typography");
|
|
6
|
-
const dayjs_1 = require("dayjs");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const FilterContext_1 = require("../FilterContext");
|
|
9
8
|
const ShownFilters = () => {
|
|
@@ -24,12 +23,12 @@ const ShownFilters = () => {
|
|
|
24
23
|
delete item.label;
|
|
25
24
|
});
|
|
26
25
|
const handleChange = (changedValues) => {
|
|
27
|
-
// for datepicker values, convert them to string
|
|
28
26
|
Object.keys(changedValues).forEach(key => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
typeof
|
|
32
|
-
|
|
27
|
+
const value = changedValues[key];
|
|
28
|
+
if (value &&
|
|
29
|
+
typeof value.isValid === 'function' &&
|
|
30
|
+
typeof value.format === 'function') {
|
|
31
|
+
changedValues[key] = value.format('YYYY-MM-DD');
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
34
|
dispatch({
|
|
@@ -46,7 +46,7 @@ export const AppliedFilterItem = ({ filterKeyValue }) => {
|
|
|
46
46
|
if (isArray(value)) {
|
|
47
47
|
return value.join(', ');
|
|
48
48
|
}
|
|
49
|
-
return value;
|
|
49
|
+
return String(value);
|
|
50
50
|
};
|
|
51
51
|
return (React.createElement(React.Fragment, null,
|
|
52
52
|
React.createElement(Space, { key: filterKey, align: "center", className: "active-filter-item" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ShownFilters/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ShownFilters/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,yBAkExB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FormBuilderWatch } from '@akinon/akiform-builder';
|
|
2
2
|
import { Paragraph } from '@akinon/ui-typography';
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { useFilterContext } from '../FilterContext';
|
|
6
5
|
export const ShownFilters = () => {
|
|
@@ -21,12 +20,12 @@ export const ShownFilters = () => {
|
|
|
21
20
|
delete item.label;
|
|
22
21
|
});
|
|
23
22
|
const handleChange = (changedValues) => {
|
|
24
|
-
// for datepicker values, convert them to string
|
|
25
23
|
Object.keys(changedValues).forEach(key => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
typeof
|
|
29
|
-
|
|
24
|
+
const value = changedValues[key];
|
|
25
|
+
if (value &&
|
|
26
|
+
typeof value.isValid === 'function' &&
|
|
27
|
+
typeof value.format === 'function') {
|
|
28
|
+
changedValues[key] = value.format('YYYY-MM-DD');
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
31
|
dispatch({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akifilter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"react-hook-form": "7.48.2",
|
|
16
16
|
"react-hook-form-antd": "1.0.1",
|
|
17
17
|
"use-immer": "^0.9.0",
|
|
18
|
-
"@akinon/akiform-builder": "^0.
|
|
18
|
+
"@akinon/akiform-builder": "^0.6.0",
|
|
19
|
+
"@akinon/icons": "^0.4.0",
|
|
19
20
|
"@akinon/ui-divider": "0.3.0",
|
|
20
21
|
"@akinon/ui-input": "0.4.0",
|
|
21
|
-
"@akinon/icons": "^0.4.0",
|
|
22
22
|
"@akinon/ui-pagination": "0.3.0",
|
|
23
23
|
"@akinon/ui-layout": "0.4.0",
|
|
24
24
|
"@akinon/ui-modal": "0.3.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"copyfiles": "^2.4.1",
|
|
33
33
|
"rimraf": "^5.0.5",
|
|
34
34
|
"typescript": "^5.2.2",
|
|
35
|
-
"@akinon/typescript-config": "0.2.0",
|
|
36
35
|
"@akinon/vite-config": "0.4.0",
|
|
37
|
-
"@akinon/eslint-config": "0.1.0"
|
|
36
|
+
"@akinon/eslint-config": "0.1.0",
|
|
37
|
+
"@akinon/typescript-config": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=18",
|