@faasjs/ant-design 0.0.2-beta.450 → 0.0.2-beta.451
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 +7 -28
- package/dist/index.mjs +7 -28
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -383,7 +383,6 @@ var TimePicker = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
383
383
|
TimePicker.displayName = "TimePicker";
|
|
384
384
|
|
|
385
385
|
// src/FormItem.tsx
|
|
386
|
-
var import_dayjs4 = __toESM(require("dayjs"));
|
|
387
386
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
388
387
|
function processProps(propsCopy, config) {
|
|
389
388
|
if (!propsCopy.title)
|
|
@@ -431,26 +430,6 @@ function processProps(propsCopy, config) {
|
|
|
431
430
|
}
|
|
432
431
|
return propsCopy;
|
|
433
432
|
}
|
|
434
|
-
function DateItem(options) {
|
|
435
|
-
const [value, setValue] = (0, import_react7.useState)();
|
|
436
|
-
(0, import_react7.useEffect)(() => {
|
|
437
|
-
setValue(options.value && !(0, import_dayjs4.isDayjs)(options.value) ? (0, import_dayjs4.default)(options.value) : null);
|
|
438
|
-
}, [options.value]);
|
|
439
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DatePicker, {
|
|
440
|
-
...options,
|
|
441
|
-
value
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
function TimeItem(options) {
|
|
445
|
-
const [value, setValue] = (0, import_react7.useState)();
|
|
446
|
-
(0, import_react7.useEffect)(() => {
|
|
447
|
-
setValue(options.value && !(0, import_dayjs4.isDayjs)(options.value) ? (0, import_dayjs4.default)(options.value) : null);
|
|
448
|
-
}, [options.value]);
|
|
449
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TimePicker, {
|
|
450
|
-
...options,
|
|
451
|
-
value
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
433
|
function FormItem(props) {
|
|
455
434
|
var _a;
|
|
456
435
|
const [computedProps, setComputedProps] = (0, import_react7.useState)();
|
|
@@ -654,14 +633,14 @@ function FormItem(props) {
|
|
|
654
633
|
case "date":
|
|
655
634
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Form.Item, {
|
|
656
635
|
...computedProps,
|
|
657
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DatePicker, {
|
|
658
637
|
...computedProps.input
|
|
659
638
|
})
|
|
660
639
|
});
|
|
661
640
|
case "time":
|
|
662
641
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Form.Item, {
|
|
663
642
|
...computedProps,
|
|
664
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TimePicker, {
|
|
665
644
|
...computedProps.input
|
|
666
645
|
})
|
|
667
646
|
});
|
|
@@ -983,7 +962,7 @@ function Routes(props) {
|
|
|
983
962
|
// src/Table.tsx
|
|
984
963
|
var import_react12 = require("react");
|
|
985
964
|
var import_antd10 = require("antd");
|
|
986
|
-
var
|
|
965
|
+
var import_dayjs4 = __toESM(require("dayjs"));
|
|
987
966
|
var import_icons3 = require("@ant-design/icons");
|
|
988
967
|
var import_lodash6 = require("lodash");
|
|
989
968
|
var import_react13 = require("@faasjs/react");
|
|
@@ -1229,17 +1208,17 @@ function Table(props) {
|
|
|
1229
1208
|
if (!item.render)
|
|
1230
1209
|
item.render = (value) => processValue(item, value);
|
|
1231
1210
|
if (!item.onFilter)
|
|
1232
|
-
item.onFilter = (value, row) => (0,
|
|
1211
|
+
item.onFilter = (value, row) => (0, import_dayjs4.default)(row[item.id]).isSame((0, import_dayjs4.default)(value));
|
|
1233
1212
|
if (!item.sorter)
|
|
1234
|
-
item.sorter = (a, b) => (0,
|
|
1213
|
+
item.sorter = (a, b) => (0, import_dayjs4.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1235
1214
|
break;
|
|
1236
1215
|
case "time":
|
|
1237
1216
|
if (!item.render)
|
|
1238
1217
|
item.render = (value) => processValue(item, value);
|
|
1239
1218
|
if (!item.onFilter)
|
|
1240
|
-
item.onFilter = (value, row) => (0,
|
|
1219
|
+
item.onFilter = (value, row) => (0, import_dayjs4.default)(row[item.id]).isSame((0, import_dayjs4.default)(value));
|
|
1241
1220
|
if (!item.sorter)
|
|
1242
|
-
item.sorter = (a, b) => (0,
|
|
1221
|
+
item.sorter = (a, b) => (0, import_dayjs4.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1243
1222
|
break;
|
|
1244
1223
|
case "object":
|
|
1245
1224
|
if (!item.render)
|
package/dist/index.mjs
CHANGED
|
@@ -363,7 +363,6 @@ var TimePicker = forwardRef((props, ref) => {
|
|
|
363
363
|
TimePicker.displayName = "TimePicker";
|
|
364
364
|
|
|
365
365
|
// src/FormItem.tsx
|
|
366
|
-
import dayjs2, { isDayjs } from "dayjs";
|
|
367
366
|
import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
368
367
|
function processProps(propsCopy, config) {
|
|
369
368
|
if (!propsCopy.title)
|
|
@@ -411,26 +410,6 @@ function processProps(propsCopy, config) {
|
|
|
411
410
|
}
|
|
412
411
|
return propsCopy;
|
|
413
412
|
}
|
|
414
|
-
function DateItem(options) {
|
|
415
|
-
const [value, setValue] = useState4();
|
|
416
|
-
useEffect3(() => {
|
|
417
|
-
setValue(options.value && !isDayjs(options.value) ? dayjs2(options.value) : null);
|
|
418
|
-
}, [options.value]);
|
|
419
|
-
return /* @__PURE__ */ jsx6(DatePicker, {
|
|
420
|
-
...options,
|
|
421
|
-
value
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function TimeItem(options) {
|
|
425
|
-
const [value, setValue] = useState4();
|
|
426
|
-
useEffect3(() => {
|
|
427
|
-
setValue(options.value && !isDayjs(options.value) ? dayjs2(options.value) : null);
|
|
428
|
-
}, [options.value]);
|
|
429
|
-
return /* @__PURE__ */ jsx6(TimePicker, {
|
|
430
|
-
...options,
|
|
431
|
-
value
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
413
|
function FormItem(props) {
|
|
435
414
|
var _a;
|
|
436
415
|
const [computedProps, setComputedProps] = useState4();
|
|
@@ -634,14 +613,14 @@ function FormItem(props) {
|
|
|
634
613
|
case "date":
|
|
635
614
|
return /* @__PURE__ */ jsx6(AntdForm.Item, {
|
|
636
615
|
...computedProps,
|
|
637
|
-
children: /* @__PURE__ */ jsx6(
|
|
616
|
+
children: /* @__PURE__ */ jsx6(DatePicker, {
|
|
638
617
|
...computedProps.input
|
|
639
618
|
})
|
|
640
619
|
});
|
|
641
620
|
case "time":
|
|
642
621
|
return /* @__PURE__ */ jsx6(AntdForm.Item, {
|
|
643
622
|
...computedProps,
|
|
644
|
-
children: /* @__PURE__ */ jsx6(
|
|
623
|
+
children: /* @__PURE__ */ jsx6(TimePicker, {
|
|
645
624
|
...computedProps.input
|
|
646
625
|
})
|
|
647
626
|
});
|
|
@@ -977,7 +956,7 @@ import {
|
|
|
977
956
|
Skeleton as Skeleton3,
|
|
978
957
|
Input as Input2
|
|
979
958
|
} from "antd";
|
|
980
|
-
import
|
|
959
|
+
import dayjs2 from "dayjs";
|
|
981
960
|
import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
|
|
982
961
|
import {
|
|
983
962
|
isNil as isNil2,
|
|
@@ -1227,17 +1206,17 @@ function Table(props) {
|
|
|
1227
1206
|
if (!item.render)
|
|
1228
1207
|
item.render = (value) => processValue(item, value);
|
|
1229
1208
|
if (!item.onFilter)
|
|
1230
|
-
item.onFilter = (value, row) =>
|
|
1209
|
+
item.onFilter = (value, row) => dayjs2(row[item.id]).isSame(dayjs2(value));
|
|
1231
1210
|
if (!item.sorter)
|
|
1232
|
-
item.sorter = (a, b) =>
|
|
1211
|
+
item.sorter = (a, b) => dayjs2(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1233
1212
|
break;
|
|
1234
1213
|
case "time":
|
|
1235
1214
|
if (!item.render)
|
|
1236
1215
|
item.render = (value) => processValue(item, value);
|
|
1237
1216
|
if (!item.onFilter)
|
|
1238
|
-
item.onFilter = (value, row) =>
|
|
1217
|
+
item.onFilter = (value, row) => dayjs2(row[item.id]).isSame(dayjs2(value));
|
|
1239
1218
|
if (!item.sorter)
|
|
1240
|
-
item.sorter = (a, b) =>
|
|
1219
|
+
item.sorter = (a, b) => dayjs2(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1241
1220
|
break;
|
|
1242
1221
|
case "object":
|
|
1243
1222
|
if (!item.render)
|
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.451",
|
|
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.451",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|