@faasjs/ant-design 0.0.2-beta.413 → 0.0.2-beta.415
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/index.js +45 -0
- package/dist/index.mjs +49 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -967,6 +967,47 @@ function Table(props) {
|
|
|
967
967
|
continue;
|
|
968
968
|
}
|
|
969
969
|
switch (item.type) {
|
|
970
|
+
case "string":
|
|
971
|
+
item.render = (value) => processValue(item, value);
|
|
972
|
+
if (!item.onFilter) {
|
|
973
|
+
item.onFilter = (value, row) => row[item.id].includes(value);
|
|
974
|
+
if (item.filterDropdown !== false)
|
|
975
|
+
item.filterDropdown = ({
|
|
976
|
+
setSelectedKeys,
|
|
977
|
+
selectedKeys,
|
|
978
|
+
confirm,
|
|
979
|
+
clearFilters
|
|
980
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
981
|
+
style: { padding: 8 },
|
|
982
|
+
children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
984
|
+
value: selectedKeys[0],
|
|
985
|
+
onChange: (e) => setSelectedKeys(e.target.value ? [e.target.value] : []),
|
|
986
|
+
style: {
|
|
987
|
+
width: 188,
|
|
988
|
+
marginBottom: 8,
|
|
989
|
+
display: "block"
|
|
990
|
+
}
|
|
991
|
+
}),
|
|
992
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
993
|
+
type: "button",
|
|
994
|
+
onClick: () => confirm(),
|
|
995
|
+
style: {
|
|
996
|
+
width: 90,
|
|
997
|
+
marginRight: 8
|
|
998
|
+
},
|
|
999
|
+
children: "Search"
|
|
1000
|
+
}),
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
1002
|
+
type: "button",
|
|
1003
|
+
onClick: () => clearFilters(),
|
|
1004
|
+
style: { width: 90 },
|
|
1005
|
+
children: "Reset"
|
|
1006
|
+
})
|
|
1007
|
+
]
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
break;
|
|
970
1011
|
case "string[]":
|
|
971
1012
|
item.render = (value) => processValue(item, value).join(", ");
|
|
972
1013
|
if (!item.onFilter)
|
|
@@ -1055,11 +1096,15 @@ function Table(props) {
|
|
|
1055
1096
|
item.render = (value) => processValue(item, value);
|
|
1056
1097
|
if (!item.onFilter)
|
|
1057
1098
|
item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
|
|
1099
|
+
if (!item.sorter)
|
|
1100
|
+
item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1058
1101
|
break;
|
|
1059
1102
|
case "time":
|
|
1060
1103
|
item.render = (value) => processValue(item, value);
|
|
1061
1104
|
if (!item.onFilter)
|
|
1062
1105
|
item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
|
|
1106
|
+
if (!item.sorter)
|
|
1107
|
+
item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1063
1108
|
break;
|
|
1064
1109
|
default:
|
|
1065
1110
|
item.render = (value) => processValue(item, value);
|
package/dist/index.mjs
CHANGED
|
@@ -882,7 +882,10 @@ import {
|
|
|
882
882
|
Skeleton as Skeleton3
|
|
883
883
|
} from "antd";
|
|
884
884
|
import dayjs3 from "dayjs";
|
|
885
|
-
import {
|
|
885
|
+
import {
|
|
886
|
+
CheckOutlined as CheckOutlined2,
|
|
887
|
+
CloseOutlined as CloseOutlined2
|
|
888
|
+
} from "@ant-design/icons";
|
|
886
889
|
import { isNil as isNil2, upperFirst as upperFirst4 } from "lodash";
|
|
887
890
|
import { FaasDataWrapper as FaasDataWrapper2 } from "@faasjs/react";
|
|
888
891
|
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -956,6 +959,47 @@ function Table(props) {
|
|
|
956
959
|
continue;
|
|
957
960
|
}
|
|
958
961
|
switch (item.type) {
|
|
962
|
+
case "string":
|
|
963
|
+
item.render = (value) => processValue(item, value);
|
|
964
|
+
if (!item.onFilter) {
|
|
965
|
+
item.onFilter = (value, row) => row[item.id].includes(value);
|
|
966
|
+
if (item.filterDropdown !== false)
|
|
967
|
+
item.filterDropdown = ({
|
|
968
|
+
setSelectedKeys,
|
|
969
|
+
selectedKeys,
|
|
970
|
+
confirm,
|
|
971
|
+
clearFilters
|
|
972
|
+
}) => /* @__PURE__ */ jsxs4("div", {
|
|
973
|
+
style: { padding: 8 },
|
|
974
|
+
children: [
|
|
975
|
+
/* @__PURE__ */ jsx11("input", {
|
|
976
|
+
value: selectedKeys[0],
|
|
977
|
+
onChange: (e) => setSelectedKeys(e.target.value ? [e.target.value] : []),
|
|
978
|
+
style: {
|
|
979
|
+
width: 188,
|
|
980
|
+
marginBottom: 8,
|
|
981
|
+
display: "block"
|
|
982
|
+
}
|
|
983
|
+
}),
|
|
984
|
+
/* @__PURE__ */ jsx11("button", {
|
|
985
|
+
type: "button",
|
|
986
|
+
onClick: () => confirm(),
|
|
987
|
+
style: {
|
|
988
|
+
width: 90,
|
|
989
|
+
marginRight: 8
|
|
990
|
+
},
|
|
991
|
+
children: "Search"
|
|
992
|
+
}),
|
|
993
|
+
/* @__PURE__ */ jsx11("button", {
|
|
994
|
+
type: "button",
|
|
995
|
+
onClick: () => clearFilters(),
|
|
996
|
+
style: { width: 90 },
|
|
997
|
+
children: "Reset"
|
|
998
|
+
})
|
|
999
|
+
]
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
break;
|
|
959
1003
|
case "string[]":
|
|
960
1004
|
item.render = (value) => processValue(item, value).join(", ");
|
|
961
1005
|
if (!item.onFilter)
|
|
@@ -1044,11 +1088,15 @@ function Table(props) {
|
|
|
1044
1088
|
item.render = (value) => processValue(item, value);
|
|
1045
1089
|
if (!item.onFilter)
|
|
1046
1090
|
item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
|
|
1091
|
+
if (!item.sorter)
|
|
1092
|
+
item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1047
1093
|
break;
|
|
1048
1094
|
case "time":
|
|
1049
1095
|
item.render = (value) => processValue(item, value);
|
|
1050
1096
|
if (!item.onFilter)
|
|
1051
1097
|
item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
|
|
1098
|
+
if (!item.sorter)
|
|
1099
|
+
item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1052
1100
|
break;
|
|
1053
1101
|
default:
|
|
1054
1102
|
item.render = (value) => processValue(item, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.415",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.2-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.2-beta.415",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|