@faasjs/ant-design 0.0.2-beta.412 → 0.0.2-beta.414
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 +33 -0
- package/dist/index.mjs +33 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -779,6 +779,30 @@ function Link({
|
|
|
779
779
|
}) {
|
|
780
780
|
const { Link: Link2 } = useConfigContext();
|
|
781
781
|
style = Object.assign({ cursor: "pointer" }, style);
|
|
782
|
+
if (href.startsWith("http")) {
|
|
783
|
+
if (button)
|
|
784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
|
|
785
|
+
...button,
|
|
786
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
787
|
+
href,
|
|
788
|
+
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
789
|
+
style: {
|
|
790
|
+
...Link2.style,
|
|
791
|
+
...style || {}
|
|
792
|
+
},
|
|
793
|
+
children: text || children
|
|
794
|
+
})
|
|
795
|
+
});
|
|
796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
797
|
+
href,
|
|
798
|
+
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
799
|
+
style: {
|
|
800
|
+
...Link2.style,
|
|
801
|
+
...style || {}
|
|
802
|
+
},
|
|
803
|
+
children: text || children
|
|
804
|
+
});
|
|
805
|
+
}
|
|
782
806
|
if (button)
|
|
783
807
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
|
|
784
808
|
...button,
|
|
@@ -943,6 +967,11 @@ function Table(props) {
|
|
|
943
967
|
continue;
|
|
944
968
|
}
|
|
945
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
|
+
break;
|
|
946
975
|
case "string[]":
|
|
947
976
|
item.render = (value) => processValue(item, value).join(", ");
|
|
948
977
|
if (!item.onFilter)
|
|
@@ -1031,11 +1060,15 @@ function Table(props) {
|
|
|
1031
1060
|
item.render = (value) => processValue(item, value);
|
|
1032
1061
|
if (!item.onFilter)
|
|
1033
1062
|
item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
|
|
1063
|
+
if (!item.sorter)
|
|
1064
|
+
item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1034
1065
|
break;
|
|
1035
1066
|
case "time":
|
|
1036
1067
|
item.render = (value) => processValue(item, value);
|
|
1037
1068
|
if (!item.onFilter)
|
|
1038
1069
|
item.onFilter = (value, row) => (0, import_dayjs5.default)(row[item.id]).isSame((0, import_dayjs5.default)(value));
|
|
1070
|
+
if (!item.sorter)
|
|
1071
|
+
item.sorter = (a, b) => (0, import_dayjs5.default)(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1039
1072
|
break;
|
|
1040
1073
|
default:
|
|
1041
1074
|
item.render = (value) => processValue(item, value);
|
package/dist/index.mjs
CHANGED
|
@@ -755,6 +755,30 @@ function Link({
|
|
|
755
755
|
}) {
|
|
756
756
|
const { Link: Link2 } = useConfigContext();
|
|
757
757
|
style = Object.assign({ cursor: "pointer" }, style);
|
|
758
|
+
if (href.startsWith("http")) {
|
|
759
|
+
if (button)
|
|
760
|
+
return /* @__PURE__ */ jsx8(Button3, {
|
|
761
|
+
...button,
|
|
762
|
+
children: /* @__PURE__ */ jsx8("a", {
|
|
763
|
+
href,
|
|
764
|
+
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
765
|
+
style: {
|
|
766
|
+
...Link2.style,
|
|
767
|
+
...style || {}
|
|
768
|
+
},
|
|
769
|
+
children: text || children
|
|
770
|
+
})
|
|
771
|
+
});
|
|
772
|
+
return /* @__PURE__ */ jsx8("a", {
|
|
773
|
+
href,
|
|
774
|
+
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
775
|
+
style: {
|
|
776
|
+
...Link2.style,
|
|
777
|
+
...style || {}
|
|
778
|
+
},
|
|
779
|
+
children: text || children
|
|
780
|
+
});
|
|
781
|
+
}
|
|
758
782
|
if (button)
|
|
759
783
|
return /* @__PURE__ */ jsx8(Button3, {
|
|
760
784
|
...button,
|
|
@@ -932,6 +956,11 @@ function Table(props) {
|
|
|
932
956
|
continue;
|
|
933
957
|
}
|
|
934
958
|
switch (item.type) {
|
|
959
|
+
case "string":
|
|
960
|
+
item.render = (value) => processValue(item, value);
|
|
961
|
+
if (!item.onFilter)
|
|
962
|
+
item.onFilter = (value, row) => row[item.id].includes(value);
|
|
963
|
+
break;
|
|
935
964
|
case "string[]":
|
|
936
965
|
item.render = (value) => processValue(item, value).join(", ");
|
|
937
966
|
if (!item.onFilter)
|
|
@@ -1020,11 +1049,15 @@ function Table(props) {
|
|
|
1020
1049
|
item.render = (value) => processValue(item, value);
|
|
1021
1050
|
if (!item.onFilter)
|
|
1022
1051
|
item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
|
|
1052
|
+
if (!item.sorter)
|
|
1053
|
+
item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1023
1054
|
break;
|
|
1024
1055
|
case "time":
|
|
1025
1056
|
item.render = (value) => processValue(item, value);
|
|
1026
1057
|
if (!item.onFilter)
|
|
1027
1058
|
item.onFilter = (value, row) => dayjs3(row[item.id]).isSame(dayjs3(value));
|
|
1059
|
+
if (!item.sorter)
|
|
1060
|
+
item.sorter = (a, b) => dayjs3(a[item.id]).isBefore(b[item.id]) ? -1 : 1;
|
|
1028
1061
|
break;
|
|
1029
1062
|
default:
|
|
1030
1063
|
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.414",
|
|
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.414",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|