@faasjs/ant-design 0.0.4-beta.12 → 0.0.4-beta.14
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.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +236 -230
- package/dist/index.mjs +236 -230
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -316,6 +316,11 @@ type TableProps<T = any, ExtendTypes = any> = {
|
|
|
316
316
|
/**
|
|
317
317
|
* Table component with Ant Design & FaasJS
|
|
318
318
|
*
|
|
319
|
+
* - Support all Ant Design Table props.
|
|
320
|
+
* - Support FaasJS injection.
|
|
321
|
+
* - Auto generate filter dropdown (disable with `filterDropdown: false`).
|
|
322
|
+
* - Auto generate sorter (disable with `sorter: false`).
|
|
323
|
+
*
|
|
319
324
|
* @ref https://ant.design/components/table/
|
|
320
325
|
*/
|
|
321
326
|
declare function Table<T extends Record<string, any>, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): react_jsx_runtime.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -316,6 +316,11 @@ type TableProps<T = any, ExtendTypes = any> = {
|
|
|
316
316
|
/**
|
|
317
317
|
* Table component with Ant Design & FaasJS
|
|
318
318
|
*
|
|
319
|
+
* - Support all Ant Design Table props.
|
|
320
|
+
* - Support FaasJS injection.
|
|
321
|
+
* - Auto generate filter dropdown (disable with `filterDropdown: false`).
|
|
322
|
+
* - Auto generate sorter (disable with `sorter: false`).
|
|
323
|
+
*
|
|
319
324
|
* @ref https://ant.design/components/table/
|
|
320
325
|
*/
|
|
321
326
|
declare function Table<T extends Record<string, any>, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -989,7 +989,7 @@ function Table(props) {
|
|
|
989
989
|
const [columns, setColumns] = react$1.useState();
|
|
990
990
|
const { common: common2 } = useConfigContext();
|
|
991
991
|
const generateFilterDropdown = (item) => {
|
|
992
|
-
if (
|
|
992
|
+
if (item.filterDropdown && item.filterDropdown !== true)
|
|
993
993
|
return;
|
|
994
994
|
if (item.options.length < 11) {
|
|
995
995
|
if (!item.filters)
|
|
@@ -1088,146 +1088,146 @@ function Table(props) {
|
|
|
1088
1088
|
case "string":
|
|
1089
1089
|
if (!item.render)
|
|
1090
1090
|
item.render = (value) => processValue(item, value);
|
|
1091
|
-
if (
|
|
1092
|
-
item.onFilter
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1091
|
+
if (item.filterDropdown !== false) {
|
|
1092
|
+
if (!item.onFilter)
|
|
1093
|
+
item.onFilter = (value, row) => {
|
|
1094
|
+
if (!value || lodashEs.isNil(value))
|
|
1095
|
+
return true;
|
|
1096
|
+
if (lodashEs.isNil(row[item.id]))
|
|
1097
|
+
return false;
|
|
1098
|
+
return row[item.id].trim().toLowerCase().includes(value.trim().toLowerCase());
|
|
1099
|
+
};
|
|
1100
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters && item.optionsType !== "auto")
|
|
1101
|
+
item.filterDropdown = ({
|
|
1102
|
+
setSelectedKeys,
|
|
1103
|
+
confirm,
|
|
1104
|
+
clearFilters
|
|
1105
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
|
+
antd.Input.Search,
|
|
1107
|
+
{
|
|
1108
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1109
|
+
allowClear: true,
|
|
1110
|
+
onSearch: (v) => {
|
|
1111
|
+
if (v) {
|
|
1112
|
+
setSelectedKeys([v]);
|
|
1113
|
+
} else {
|
|
1114
|
+
setSelectedKeys([]);
|
|
1115
|
+
clearFilters();
|
|
1116
|
+
}
|
|
1117
|
+
confirm();
|
|
1117
1118
|
}
|
|
1118
|
-
confirm();
|
|
1119
1119
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1122
1122
|
break;
|
|
1123
1123
|
case "string[]":
|
|
1124
1124
|
if (!item.render)
|
|
1125
1125
|
item.render = (value) => processValue(item, value);
|
|
1126
|
-
if (
|
|
1127
|
-
item.onFilter
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1126
|
+
if (item.filterDropdown !== false) {
|
|
1127
|
+
if (!item.onFilter)
|
|
1128
|
+
item.onFilter = (value, row) => {
|
|
1129
|
+
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1130
|
+
return true;
|
|
1131
|
+
if (!row[item.id] || !row[item.id].length || !value)
|
|
1132
|
+
return false;
|
|
1133
|
+
return row[item.id].some(
|
|
1134
|
+
(v) => v.trim().toLowerCase().includes(value.trim().toLowerCase())
|
|
1135
|
+
);
|
|
1136
|
+
};
|
|
1137
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters && item.optionsType !== "auto")
|
|
1138
|
+
item.filterDropdown = ({
|
|
1139
|
+
setSelectedKeys,
|
|
1140
|
+
confirm,
|
|
1141
|
+
clearFilters
|
|
1142
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
|
+
antd.Input.Search,
|
|
1144
|
+
{
|
|
1145
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1146
|
+
allowClear: true,
|
|
1147
|
+
onSearch: (v) => {
|
|
1148
|
+
if (v) {
|
|
1149
|
+
setSelectedKeys([v]);
|
|
1150
|
+
} else {
|
|
1151
|
+
setSelectedKeys([]);
|
|
1152
|
+
clearFilters();
|
|
1153
|
+
}
|
|
1154
|
+
confirm();
|
|
1154
1155
|
}
|
|
1155
|
-
confirm();
|
|
1156
1156
|
}
|
|
1157
|
-
|
|
1158
|
-
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
1159
|
break;
|
|
1160
1160
|
case "number":
|
|
1161
1161
|
if (!item.render)
|
|
1162
1162
|
item.render = (value) => processValue(item, value);
|
|
1163
|
-
if (
|
|
1163
|
+
if (typeof item.sorter === "undefined")
|
|
1164
1164
|
item.sorter = (a, b) => a[item.id] - b[item.id];
|
|
1165
|
-
if (
|
|
1166
|
-
item.onFilter
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1165
|
+
if (item.filterDropdown !== false) {
|
|
1166
|
+
if (!item.onFilter)
|
|
1167
|
+
item.onFilter = (value, row) => {
|
|
1168
|
+
if (value === null)
|
|
1169
|
+
return true;
|
|
1170
|
+
if (lodashEs.isNil(row[item.id]))
|
|
1171
|
+
return false;
|
|
1172
|
+
return value == row[item.id];
|
|
1173
|
+
};
|
|
1174
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters)
|
|
1175
|
+
item.filterDropdown = ({
|
|
1176
|
+
setSelectedKeys,
|
|
1177
|
+
confirm,
|
|
1178
|
+
clearFilters
|
|
1179
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1180
|
+
antd.Input.Search,
|
|
1181
|
+
{
|
|
1182
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1183
|
+
allowClear: true,
|
|
1184
|
+
onSearch: (v) => {
|
|
1185
|
+
if (v) {
|
|
1186
|
+
setSelectedKeys([Number(v)]);
|
|
1187
|
+
} else {
|
|
1188
|
+
setSelectedKeys([]);
|
|
1189
|
+
clearFilters();
|
|
1190
|
+
}
|
|
1191
|
+
confirm();
|
|
1191
1192
|
}
|
|
1192
|
-
confirm();
|
|
1193
1193
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
1196
|
break;
|
|
1197
1197
|
case "number[]":
|
|
1198
1198
|
if (!item.render)
|
|
1199
1199
|
item.render = (value) => processValue(item, value).join(", ");
|
|
1200
|
-
if (
|
|
1201
|
-
item.onFilter
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1200
|
+
if (item.filterDropdown !== false) {
|
|
1201
|
+
if (!item.onFilter)
|
|
1202
|
+
item.onFilter = (value, row) => {
|
|
1203
|
+
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1204
|
+
return true;
|
|
1205
|
+
if (!row[item.id] || !row[item.id].length)
|
|
1206
|
+
return false;
|
|
1207
|
+
return row[item.id].includes(Number(value));
|
|
1208
|
+
};
|
|
1209
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters)
|
|
1210
|
+
item.filterDropdown = ({
|
|
1211
|
+
setSelectedKeys,
|
|
1212
|
+
confirm,
|
|
1213
|
+
clearFilters
|
|
1214
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1215
|
+
antd.Input.Search,
|
|
1216
|
+
{
|
|
1217
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1218
|
+
allowClear: true,
|
|
1219
|
+
onSearch: (v) => {
|
|
1220
|
+
if (v) {
|
|
1221
|
+
setSelectedKeys([Number(v)]);
|
|
1222
|
+
} else {
|
|
1223
|
+
setSelectedKeys([]);
|
|
1224
|
+
clearFilters();
|
|
1225
|
+
}
|
|
1226
|
+
confirm();
|
|
1226
1227
|
}
|
|
1227
|
-
confirm();
|
|
1228
1228
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1229
|
+
);
|
|
1230
|
+
}
|
|
1231
1231
|
break;
|
|
1232
1232
|
case "boolean":
|
|
1233
1233
|
if (!item.render)
|
|
@@ -1248,68 +1248,70 @@ function Table(props) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
1250
|
);
|
|
1251
|
-
if (item.filterDropdown !== false)
|
|
1252
|
-
item.filterDropdown
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1251
|
+
if (item.filterDropdown !== false) {
|
|
1252
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1253
|
+
item.filterDropdown = ({
|
|
1254
|
+
setSelectedKeys,
|
|
1255
|
+
selectedKeys,
|
|
1256
|
+
confirm
|
|
1257
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1258
|
+
antd.Radio.Group,
|
|
1259
|
+
{
|
|
1260
|
+
style: { padding: 8 },
|
|
1261
|
+
buttonStyle: "solid",
|
|
1262
|
+
value: JSON.stringify(selectedKeys[0]),
|
|
1263
|
+
onChange: (e) => {
|
|
1264
|
+
const Values = {
|
|
1265
|
+
true: true,
|
|
1266
|
+
false: false,
|
|
1267
|
+
null: null
|
|
1268
|
+
};
|
|
1269
|
+
setSelectedKeys(
|
|
1270
|
+
e.target.value ? [Values[e.target.value]] : []
|
|
1271
|
+
);
|
|
1272
|
+
confirm();
|
|
1273
|
+
},
|
|
1274
|
+
children: [
|
|
1275
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Radio.Button, { children: common2.all }),
|
|
1276
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Radio.Button, { value: "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1277
|
+
icons.CheckOutlined,
|
|
1278
|
+
{
|
|
1279
|
+
style: {
|
|
1280
|
+
color: "#52c41a",
|
|
1281
|
+
verticalAlign: "middle"
|
|
1282
|
+
}
|
|
1281
1283
|
}
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1284
|
+
) }),
|
|
1285
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Radio.Button, { value: "false", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1286
|
+
icons.CloseOutlined,
|
|
1287
|
+
{
|
|
1288
|
+
style: {
|
|
1289
|
+
verticalAlign: "middle",
|
|
1290
|
+
color: "#ff4d4f"
|
|
1291
|
+
}
|
|
1290
1292
|
}
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
)
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1293
|
+
) }),
|
|
1294
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Radio.Button, { value: "null", children: common2.blank })
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1298
|
+
if (!item.onFilter)
|
|
1299
|
+
item.onFilter = (value, row) => {
|
|
1300
|
+
switch (value) {
|
|
1301
|
+
case true:
|
|
1302
|
+
return !lodashEs.isNil(row[item.id]) && row[item.id] !== false;
|
|
1303
|
+
case false:
|
|
1304
|
+
return !lodashEs.isNil(row[item.id]) && !row[item.id];
|
|
1305
|
+
default:
|
|
1306
|
+
return lodashEs.isNil(row[item.id]);
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1308
1310
|
break;
|
|
1309
1311
|
case "date":
|
|
1310
1312
|
if (!item.render)
|
|
1311
1313
|
item.render = (value) => processValue(item, value);
|
|
1312
|
-
if (
|
|
1314
|
+
if (typeof item.sorter === "undefined")
|
|
1313
1315
|
item.sorter = (a, b, order) => {
|
|
1314
1316
|
if (lodashEs.isNil(a[item.id]))
|
|
1315
1317
|
return order === "ascend" ? 1 : -1;
|
|
@@ -1317,36 +1319,38 @@ function Table(props) {
|
|
|
1317
1319
|
return order === "ascend" ? -1 : 1;
|
|
1318
1320
|
return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
|
|
1319
1321
|
};
|
|
1320
|
-
if (
|
|
1321
|
-
item.filterDropdown
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
(
|
|
1327
|
-
[
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1322
|
+
if (item.filterDropdown !== false) {
|
|
1323
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1324
|
+
item.filterDropdown = ({ setSelectedKeys, confirm }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
|
+
antd.DatePicker.RangePicker,
|
|
1326
|
+
{
|
|
1327
|
+
onChange: (dates) => {
|
|
1328
|
+
setSelectedKeys(
|
|
1329
|
+
(dates == null ? void 0 : dates[0]) && dates[1] ? [
|
|
1330
|
+
[
|
|
1331
|
+
dates[0].startOf("day").toISOString(),
|
|
1332
|
+
dates[1].endOf("day").toISOString()
|
|
1333
|
+
]
|
|
1334
|
+
] : []
|
|
1335
|
+
);
|
|
1336
|
+
confirm();
|
|
1337
|
+
}
|
|
1334
1338
|
}
|
|
1335
|
-
|
|
1336
|
-
)
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
return
|
|
1343
|
-
|
|
1344
|
-
|
|
1339
|
+
);
|
|
1340
|
+
if (!item.onFilter)
|
|
1341
|
+
item.onFilter = (value, row) => {
|
|
1342
|
+
if (lodashEs.isNil(value[0]))
|
|
1343
|
+
return true;
|
|
1344
|
+
if (lodashEs.isNil(row[item.id]))
|
|
1345
|
+
return false;
|
|
1346
|
+
return dayjs2__default.default(row[item.id]) >= dayjs2__default.default(value[0]) && dayjs2__default.default(row[item.id]) <= dayjs2__default.default(value[1]);
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1345
1349
|
break;
|
|
1346
1350
|
case "time":
|
|
1347
1351
|
if (!item.render)
|
|
1348
1352
|
item.render = (value) => processValue(item, value);
|
|
1349
|
-
if (
|
|
1353
|
+
if (typeof item.sorter === "undefined")
|
|
1350
1354
|
item.sorter = (a, b, order) => {
|
|
1351
1355
|
if (lodashEs.isNil(a[item.id]))
|
|
1352
1356
|
return order === "ascend" ? 1 : -1;
|
|
@@ -1354,31 +1358,33 @@ function Table(props) {
|
|
|
1354
1358
|
return order === "ascend" ? -1 : 1;
|
|
1355
1359
|
return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
|
|
1356
1360
|
};
|
|
1357
|
-
if (
|
|
1358
|
-
item.filterDropdown
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
(
|
|
1364
|
-
[
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1361
|
+
if (item.filterDropdown !== false) {
|
|
1362
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1363
|
+
item.filterDropdown = ({ setSelectedKeys, confirm }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1364
|
+
antd.DatePicker.RangePicker,
|
|
1365
|
+
{
|
|
1366
|
+
onChange: (dates) => {
|
|
1367
|
+
setSelectedKeys(
|
|
1368
|
+
(dates == null ? void 0 : dates[0]) && dates[1] ? [
|
|
1369
|
+
[
|
|
1370
|
+
dates[0].startOf("day").toISOString(),
|
|
1371
|
+
dates[1].endOf("day").toISOString()
|
|
1372
|
+
]
|
|
1373
|
+
] : []
|
|
1374
|
+
);
|
|
1375
|
+
confirm();
|
|
1376
|
+
}
|
|
1371
1377
|
}
|
|
1372
|
-
|
|
1373
|
-
)
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
return
|
|
1380
|
-
|
|
1381
|
-
|
|
1378
|
+
);
|
|
1379
|
+
if (!item.onFilter)
|
|
1380
|
+
item.onFilter = (value, row) => {
|
|
1381
|
+
if (lodashEs.isNil(value[0]))
|
|
1382
|
+
return true;
|
|
1383
|
+
if (lodashEs.isNil(row[item.id]))
|
|
1384
|
+
return false;
|
|
1385
|
+
return dayjs2__default.default(row[item.id]) >= dayjs2__default.default(value[0]) && dayjs2__default.default(row[item.id]) <= dayjs2__default.default(value[1]);
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1382
1388
|
break;
|
|
1383
1389
|
case "object":
|
|
1384
1390
|
if (!item.render)
|
|
@@ -1406,7 +1412,7 @@ function Table(props) {
|
|
|
1406
1412
|
default:
|
|
1407
1413
|
if (!item.render)
|
|
1408
1414
|
item.render = (value) => processValue(item, value);
|
|
1409
|
-
if (!item.onFilter)
|
|
1415
|
+
if (item.filterDropdown !== false && !item.onFilter)
|
|
1410
1416
|
item.onFilter = (value, row) => {
|
|
1411
1417
|
if (value === null && lodashEs.isNil(row[item.id]))
|
|
1412
1418
|
return true;
|
|
@@ -1444,7 +1450,7 @@ function Table(props) {
|
|
|
1444
1450
|
antd.Table,
|
|
1445
1451
|
{
|
|
1446
1452
|
...props,
|
|
1447
|
-
rowKey: props.rowKey || "id",
|
|
1453
|
+
rowKey: props.rowKey || columns[0].id || "id",
|
|
1448
1454
|
columns,
|
|
1449
1455
|
dataSource: props.dataSource
|
|
1450
1456
|
}
|
|
@@ -1501,7 +1507,7 @@ function FaasDataTable({
|
|
|
1501
1507
|
{
|
|
1502
1508
|
...props,
|
|
1503
1509
|
loading: props.loading,
|
|
1504
|
-
rowKey: props.rowKey || "id",
|
|
1510
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1505
1511
|
columns: currentColumns,
|
|
1506
1512
|
dataSource: []
|
|
1507
1513
|
}
|
|
@@ -1512,7 +1518,7 @@ function FaasDataTable({
|
|
|
1512
1518
|
{
|
|
1513
1519
|
...props,
|
|
1514
1520
|
loading: props.loading,
|
|
1515
|
-
rowKey: props.rowKey || "id",
|
|
1521
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1516
1522
|
columns: currentColumns,
|
|
1517
1523
|
dataSource: data
|
|
1518
1524
|
}
|
|
@@ -1522,7 +1528,7 @@ function FaasDataTable({
|
|
|
1522
1528
|
{
|
|
1523
1529
|
...props,
|
|
1524
1530
|
loading: props.loading,
|
|
1525
|
-
rowKey: props.rowKey || "id",
|
|
1531
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1526
1532
|
columns: currentColumns,
|
|
1527
1533
|
dataSource: data.rows,
|
|
1528
1534
|
pagination: {
|
package/dist/index.mjs
CHANGED
|
@@ -986,7 +986,7 @@ function Table(props) {
|
|
|
986
986
|
const [columns, setColumns] = useState();
|
|
987
987
|
const { common: common2 } = useConfigContext();
|
|
988
988
|
const generateFilterDropdown = (item) => {
|
|
989
|
-
if (
|
|
989
|
+
if (item.filterDropdown && item.filterDropdown !== true)
|
|
990
990
|
return;
|
|
991
991
|
if (item.options.length < 11) {
|
|
992
992
|
if (!item.filters)
|
|
@@ -1085,146 +1085,146 @@ function Table(props) {
|
|
|
1085
1085
|
case "string":
|
|
1086
1086
|
if (!item.render)
|
|
1087
1087
|
item.render = (value) => processValue(item, value);
|
|
1088
|
-
if (
|
|
1089
|
-
item.onFilter
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1088
|
+
if (item.filterDropdown !== false) {
|
|
1089
|
+
if (!item.onFilter)
|
|
1090
|
+
item.onFilter = (value, row) => {
|
|
1091
|
+
if (!value || isNil(value))
|
|
1092
|
+
return true;
|
|
1093
|
+
if (isNil(row[item.id]))
|
|
1094
|
+
return false;
|
|
1095
|
+
return row[item.id].trim().toLowerCase().includes(value.trim().toLowerCase());
|
|
1096
|
+
};
|
|
1097
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters && item.optionsType !== "auto")
|
|
1098
|
+
item.filterDropdown = ({
|
|
1099
|
+
setSelectedKeys,
|
|
1100
|
+
confirm,
|
|
1101
|
+
clearFilters
|
|
1102
|
+
}) => /* @__PURE__ */ jsx(
|
|
1103
|
+
Input.Search,
|
|
1104
|
+
{
|
|
1105
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1106
|
+
allowClear: true,
|
|
1107
|
+
onSearch: (v) => {
|
|
1108
|
+
if (v) {
|
|
1109
|
+
setSelectedKeys([v]);
|
|
1110
|
+
} else {
|
|
1111
|
+
setSelectedKeys([]);
|
|
1112
|
+
clearFilters();
|
|
1113
|
+
}
|
|
1114
|
+
confirm();
|
|
1114
1115
|
}
|
|
1115
|
-
confirm();
|
|
1116
1116
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
1119
|
break;
|
|
1120
1120
|
case "string[]":
|
|
1121
1121
|
if (!item.render)
|
|
1122
1122
|
item.render = (value) => processValue(item, value);
|
|
1123
|
-
if (
|
|
1124
|
-
item.onFilter
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1123
|
+
if (item.filterDropdown !== false) {
|
|
1124
|
+
if (!item.onFilter)
|
|
1125
|
+
item.onFilter = (value, row) => {
|
|
1126
|
+
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1127
|
+
return true;
|
|
1128
|
+
if (!row[item.id] || !row[item.id].length || !value)
|
|
1129
|
+
return false;
|
|
1130
|
+
return row[item.id].some(
|
|
1131
|
+
(v) => v.trim().toLowerCase().includes(value.trim().toLowerCase())
|
|
1132
|
+
);
|
|
1133
|
+
};
|
|
1134
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters && item.optionsType !== "auto")
|
|
1135
|
+
item.filterDropdown = ({
|
|
1136
|
+
setSelectedKeys,
|
|
1137
|
+
confirm,
|
|
1138
|
+
clearFilters
|
|
1139
|
+
}) => /* @__PURE__ */ jsx(
|
|
1140
|
+
Input.Search,
|
|
1141
|
+
{
|
|
1142
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1143
|
+
allowClear: true,
|
|
1144
|
+
onSearch: (v) => {
|
|
1145
|
+
if (v) {
|
|
1146
|
+
setSelectedKeys([v]);
|
|
1147
|
+
} else {
|
|
1148
|
+
setSelectedKeys([]);
|
|
1149
|
+
clearFilters();
|
|
1150
|
+
}
|
|
1151
|
+
confirm();
|
|
1151
1152
|
}
|
|
1152
|
-
confirm();
|
|
1153
1153
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
1156
|
break;
|
|
1157
1157
|
case "number":
|
|
1158
1158
|
if (!item.render)
|
|
1159
1159
|
item.render = (value) => processValue(item, value);
|
|
1160
|
-
if (
|
|
1160
|
+
if (typeof item.sorter === "undefined")
|
|
1161
1161
|
item.sorter = (a, b) => a[item.id] - b[item.id];
|
|
1162
|
-
if (
|
|
1163
|
-
item.onFilter
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1162
|
+
if (item.filterDropdown !== false) {
|
|
1163
|
+
if (!item.onFilter)
|
|
1164
|
+
item.onFilter = (value, row) => {
|
|
1165
|
+
if (value === null)
|
|
1166
|
+
return true;
|
|
1167
|
+
if (isNil(row[item.id]))
|
|
1168
|
+
return false;
|
|
1169
|
+
return value == row[item.id];
|
|
1170
|
+
};
|
|
1171
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters)
|
|
1172
|
+
item.filterDropdown = ({
|
|
1173
|
+
setSelectedKeys,
|
|
1174
|
+
confirm,
|
|
1175
|
+
clearFilters
|
|
1176
|
+
}) => /* @__PURE__ */ jsx(
|
|
1177
|
+
Input.Search,
|
|
1178
|
+
{
|
|
1179
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1180
|
+
allowClear: true,
|
|
1181
|
+
onSearch: (v) => {
|
|
1182
|
+
if (v) {
|
|
1183
|
+
setSelectedKeys([Number(v)]);
|
|
1184
|
+
} else {
|
|
1185
|
+
setSelectedKeys([]);
|
|
1186
|
+
clearFilters();
|
|
1187
|
+
}
|
|
1188
|
+
confirm();
|
|
1188
1189
|
}
|
|
1189
|
-
confirm();
|
|
1190
1190
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
1193
|
break;
|
|
1194
1194
|
case "number[]":
|
|
1195
1195
|
if (!item.render)
|
|
1196
1196
|
item.render = (value) => processValue(item, value).join(", ");
|
|
1197
|
-
if (
|
|
1198
|
-
item.onFilter
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1197
|
+
if (item.filterDropdown !== false) {
|
|
1198
|
+
if (!item.onFilter)
|
|
1199
|
+
item.onFilter = (value, row) => {
|
|
1200
|
+
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1201
|
+
return true;
|
|
1202
|
+
if (!row[item.id] || !row[item.id].length)
|
|
1203
|
+
return false;
|
|
1204
|
+
return row[item.id].includes(Number(value));
|
|
1205
|
+
};
|
|
1206
|
+
if (typeof item.filterDropdown === "undefined" && !item.filters)
|
|
1207
|
+
item.filterDropdown = ({
|
|
1208
|
+
setSelectedKeys,
|
|
1209
|
+
confirm,
|
|
1210
|
+
clearFilters
|
|
1211
|
+
}) => /* @__PURE__ */ jsx(
|
|
1212
|
+
Input.Search,
|
|
1213
|
+
{
|
|
1214
|
+
placeholder: `${common2.search} ${item.title}`,
|
|
1215
|
+
allowClear: true,
|
|
1216
|
+
onSearch: (v) => {
|
|
1217
|
+
if (v) {
|
|
1218
|
+
setSelectedKeys([Number(v)]);
|
|
1219
|
+
} else {
|
|
1220
|
+
setSelectedKeys([]);
|
|
1221
|
+
clearFilters();
|
|
1222
|
+
}
|
|
1223
|
+
confirm();
|
|
1223
1224
|
}
|
|
1224
|
-
confirm();
|
|
1225
1225
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1226
|
+
);
|
|
1227
|
+
}
|
|
1228
1228
|
break;
|
|
1229
1229
|
case "boolean":
|
|
1230
1230
|
if (!item.render)
|
|
@@ -1245,68 +1245,70 @@ function Table(props) {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
1247
|
);
|
|
1248
|
-
if (item.filterDropdown !== false)
|
|
1249
|
-
item.filterDropdown
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1248
|
+
if (item.filterDropdown !== false) {
|
|
1249
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1250
|
+
item.filterDropdown = ({
|
|
1251
|
+
setSelectedKeys,
|
|
1252
|
+
selectedKeys,
|
|
1253
|
+
confirm
|
|
1254
|
+
}) => /* @__PURE__ */ jsxs(
|
|
1255
|
+
Radio.Group,
|
|
1256
|
+
{
|
|
1257
|
+
style: { padding: 8 },
|
|
1258
|
+
buttonStyle: "solid",
|
|
1259
|
+
value: JSON.stringify(selectedKeys[0]),
|
|
1260
|
+
onChange: (e) => {
|
|
1261
|
+
const Values = {
|
|
1262
|
+
true: true,
|
|
1263
|
+
false: false,
|
|
1264
|
+
null: null
|
|
1265
|
+
};
|
|
1266
|
+
setSelectedKeys(
|
|
1267
|
+
e.target.value ? [Values[e.target.value]] : []
|
|
1268
|
+
);
|
|
1269
|
+
confirm();
|
|
1270
|
+
},
|
|
1271
|
+
children: [
|
|
1272
|
+
/* @__PURE__ */ jsx(Radio.Button, { children: common2.all }),
|
|
1273
|
+
/* @__PURE__ */ jsx(Radio.Button, { value: "true", children: /* @__PURE__ */ jsx(
|
|
1274
|
+
CheckOutlined,
|
|
1275
|
+
{
|
|
1276
|
+
style: {
|
|
1277
|
+
color: "#52c41a",
|
|
1278
|
+
verticalAlign: "middle"
|
|
1279
|
+
}
|
|
1278
1280
|
}
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1281
|
+
) }),
|
|
1282
|
+
/* @__PURE__ */ jsx(Radio.Button, { value: "false", children: /* @__PURE__ */ jsx(
|
|
1283
|
+
CloseOutlined,
|
|
1284
|
+
{
|
|
1285
|
+
style: {
|
|
1286
|
+
verticalAlign: "middle",
|
|
1287
|
+
color: "#ff4d4f"
|
|
1288
|
+
}
|
|
1287
1289
|
}
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
)
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1290
|
+
) }),
|
|
1291
|
+
/* @__PURE__ */ jsx(Radio.Button, { value: "null", children: common2.blank })
|
|
1292
|
+
]
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
if (!item.onFilter)
|
|
1296
|
+
item.onFilter = (value, row) => {
|
|
1297
|
+
switch (value) {
|
|
1298
|
+
case true:
|
|
1299
|
+
return !isNil(row[item.id]) && row[item.id] !== false;
|
|
1300
|
+
case false:
|
|
1301
|
+
return !isNil(row[item.id]) && !row[item.id];
|
|
1302
|
+
default:
|
|
1303
|
+
return isNil(row[item.id]);
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1305
1307
|
break;
|
|
1306
1308
|
case "date":
|
|
1307
1309
|
if (!item.render)
|
|
1308
1310
|
item.render = (value) => processValue(item, value);
|
|
1309
|
-
if (
|
|
1311
|
+
if (typeof item.sorter === "undefined")
|
|
1310
1312
|
item.sorter = (a, b, order) => {
|
|
1311
1313
|
if (isNil(a[item.id]))
|
|
1312
1314
|
return order === "ascend" ? 1 : -1;
|
|
@@ -1314,36 +1316,38 @@ function Table(props) {
|
|
|
1314
1316
|
return order === "ascend" ? -1 : 1;
|
|
1315
1317
|
return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
|
|
1316
1318
|
};
|
|
1317
|
-
if (
|
|
1318
|
-
item.filterDropdown
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
(
|
|
1324
|
-
[
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1319
|
+
if (item.filterDropdown !== false) {
|
|
1320
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1321
|
+
item.filterDropdown = ({ setSelectedKeys, confirm }) => /* @__PURE__ */ jsx(
|
|
1322
|
+
DatePicker.RangePicker,
|
|
1323
|
+
{
|
|
1324
|
+
onChange: (dates) => {
|
|
1325
|
+
setSelectedKeys(
|
|
1326
|
+
(dates == null ? void 0 : dates[0]) && dates[1] ? [
|
|
1327
|
+
[
|
|
1328
|
+
dates[0].startOf("day").toISOString(),
|
|
1329
|
+
dates[1].endOf("day").toISOString()
|
|
1330
|
+
]
|
|
1331
|
+
] : []
|
|
1332
|
+
);
|
|
1333
|
+
confirm();
|
|
1334
|
+
}
|
|
1331
1335
|
}
|
|
1332
|
-
|
|
1333
|
-
)
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
return
|
|
1340
|
-
|
|
1341
|
-
|
|
1336
|
+
);
|
|
1337
|
+
if (!item.onFilter)
|
|
1338
|
+
item.onFilter = (value, row) => {
|
|
1339
|
+
if (isNil(value[0]))
|
|
1340
|
+
return true;
|
|
1341
|
+
if (isNil(row[item.id]))
|
|
1342
|
+
return false;
|
|
1343
|
+
return dayjs2(row[item.id]) >= dayjs2(value[0]) && dayjs2(row[item.id]) <= dayjs2(value[1]);
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1342
1346
|
break;
|
|
1343
1347
|
case "time":
|
|
1344
1348
|
if (!item.render)
|
|
1345
1349
|
item.render = (value) => processValue(item, value);
|
|
1346
|
-
if (
|
|
1350
|
+
if (typeof item.sorter === "undefined")
|
|
1347
1351
|
item.sorter = (a, b, order) => {
|
|
1348
1352
|
if (isNil(a[item.id]))
|
|
1349
1353
|
return order === "ascend" ? 1 : -1;
|
|
@@ -1351,31 +1355,33 @@ function Table(props) {
|
|
|
1351
1355
|
return order === "ascend" ? -1 : 1;
|
|
1352
1356
|
return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
|
|
1353
1357
|
};
|
|
1354
|
-
if (
|
|
1355
|
-
item.filterDropdown
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
(
|
|
1361
|
-
[
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1358
|
+
if (item.filterDropdown !== false) {
|
|
1359
|
+
if (typeof item.filterDropdown === "undefined")
|
|
1360
|
+
item.filterDropdown = ({ setSelectedKeys, confirm }) => /* @__PURE__ */ jsx(
|
|
1361
|
+
DatePicker.RangePicker,
|
|
1362
|
+
{
|
|
1363
|
+
onChange: (dates) => {
|
|
1364
|
+
setSelectedKeys(
|
|
1365
|
+
(dates == null ? void 0 : dates[0]) && dates[1] ? [
|
|
1366
|
+
[
|
|
1367
|
+
dates[0].startOf("day").toISOString(),
|
|
1368
|
+
dates[1].endOf("day").toISOString()
|
|
1369
|
+
]
|
|
1370
|
+
] : []
|
|
1371
|
+
);
|
|
1372
|
+
confirm();
|
|
1373
|
+
}
|
|
1368
1374
|
}
|
|
1369
|
-
|
|
1370
|
-
)
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
return
|
|
1377
|
-
|
|
1378
|
-
|
|
1375
|
+
);
|
|
1376
|
+
if (!item.onFilter)
|
|
1377
|
+
item.onFilter = (value, row) => {
|
|
1378
|
+
if (isNil(value[0]))
|
|
1379
|
+
return true;
|
|
1380
|
+
if (isNil(row[item.id]))
|
|
1381
|
+
return false;
|
|
1382
|
+
return dayjs2(row[item.id]) >= dayjs2(value[0]) && dayjs2(row[item.id]) <= dayjs2(value[1]);
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1379
1385
|
break;
|
|
1380
1386
|
case "object":
|
|
1381
1387
|
if (!item.render)
|
|
@@ -1403,7 +1409,7 @@ function Table(props) {
|
|
|
1403
1409
|
default:
|
|
1404
1410
|
if (!item.render)
|
|
1405
1411
|
item.render = (value) => processValue(item, value);
|
|
1406
|
-
if (!item.onFilter)
|
|
1412
|
+
if (item.filterDropdown !== false && !item.onFilter)
|
|
1407
1413
|
item.onFilter = (value, row) => {
|
|
1408
1414
|
if (value === null && isNil(row[item.id]))
|
|
1409
1415
|
return true;
|
|
@@ -1441,7 +1447,7 @@ function Table(props) {
|
|
|
1441
1447
|
Table$1,
|
|
1442
1448
|
{
|
|
1443
1449
|
...props,
|
|
1444
|
-
rowKey: props.rowKey || "id",
|
|
1450
|
+
rowKey: props.rowKey || columns[0].id || "id",
|
|
1445
1451
|
columns,
|
|
1446
1452
|
dataSource: props.dataSource
|
|
1447
1453
|
}
|
|
@@ -1498,7 +1504,7 @@ function FaasDataTable({
|
|
|
1498
1504
|
{
|
|
1499
1505
|
...props,
|
|
1500
1506
|
loading: props.loading,
|
|
1501
|
-
rowKey: props.rowKey || "id",
|
|
1507
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1502
1508
|
columns: currentColumns,
|
|
1503
1509
|
dataSource: []
|
|
1504
1510
|
}
|
|
@@ -1509,7 +1515,7 @@ function FaasDataTable({
|
|
|
1509
1515
|
{
|
|
1510
1516
|
...props,
|
|
1511
1517
|
loading: props.loading,
|
|
1512
|
-
rowKey: props.rowKey || "id",
|
|
1518
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1513
1519
|
columns: currentColumns,
|
|
1514
1520
|
dataSource: data
|
|
1515
1521
|
}
|
|
@@ -1519,7 +1525,7 @@ function FaasDataTable({
|
|
|
1519
1525
|
{
|
|
1520
1526
|
...props,
|
|
1521
1527
|
loading: props.loading,
|
|
1522
|
-
rowKey: props.rowKey || "id",
|
|
1528
|
+
rowKey: props.rowKey || currentColumns[0].id || "id",
|
|
1523
1529
|
columns: currentColumns,
|
|
1524
1530
|
dataSource: data.rows,
|
|
1525
1531
|
pagination: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
3
|
+
"version": "0.0.4-beta.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lodash-es": "*"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@faasjs/react": "0.0.4-beta.
|
|
29
|
+
"@faasjs/react": "0.0.4-beta.14",
|
|
30
30
|
"antd": "*",
|
|
31
31
|
"react": "*",
|
|
32
32
|
"react-dom": "*",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@testing-library/jest-dom": "*",
|
|
38
38
|
"@testing-library/react": "*",
|
|
39
39
|
"@testing-library/user-event": "*",
|
|
40
|
-
"@faasjs/react": "0.0.4-beta.
|
|
40
|
+
"@faasjs/react": "0.0.4-beta.14",
|
|
41
41
|
"antd": "*",
|
|
42
42
|
"react": "*",
|
|
43
43
|
"react-dom": "*",
|