@faasjs/ant-design 0.0.3-beta.33 → 0.0.3-beta.35

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 CHANGED
@@ -106,6 +106,7 @@ function ConfigProvider({
106
106
  }) {
107
107
  const [values, setValues] = (0, import_react2.useState)(baseConfig);
108
108
  (0, import_react2.useEffect)(() => {
109
+ console.log(config);
109
110
  if (config.lang === "zh") {
110
111
  setValues((0, import_lodash_es.defaultsDeep)(config, {
111
112
  lang: "zh",
@@ -114,7 +115,7 @@ function ConfigProvider({
114
115
  Form: { submit: { text: zh.submit } }
115
116
  }, baseConfig));
116
117
  } else
117
- setValues(values);
118
+ setValues((0, import_lodash_es.defaultsDeep)(config, values));
118
119
  }, []);
119
120
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, {
120
121
  value: values,
@@ -963,31 +964,29 @@ var import_jsx_runtime = require("react/jsx-runtime");
963
964
  function Link(props) {
964
965
  var _a, _b, _c, _d;
965
966
  const { Link: Link2 } = useConfigContext();
966
- props.style = Object.assign({ cursor: "pointer" }, props.style);
967
+ let style = {
968
+ ...Link2.style || {},
969
+ cursor: "pointer",
970
+ ...props.style
971
+ };
967
972
  if (props.block)
968
- props.style = Object.assign({
973
+ style = Object.assign({
969
974
  display: "block",
970
975
  width: "100%"
971
- }, props.style);
976
+ }, style);
972
977
  if (props.href.startsWith("http")) {
973
978
  if (props.button)
974
979
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
975
980
  ...props.button,
976
981
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
977
- style: {
978
- ...Link2.style,
979
- ...props.style || {}
980
- },
982
+ style,
981
983
  href: props.href,
982
984
  children: (_a = props.text) != null ? _a : props.children
983
985
  });
984
986
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
985
987
  href: props.href,
986
988
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
987
- style: {
988
- ...Link2.style,
989
- ...props.style || {}
990
- },
989
+ style,
991
990
  children: (_b = props.text) != null ? _b : props.children
992
991
  });
993
992
  }
@@ -997,20 +996,14 @@ function Link(props) {
997
996
  target: props.target || (Link2 == null ? void 0 : Link2.target),
998
997
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
999
998
  ...props.button,
1000
- style: {
1001
- ...Link2.style,
1002
- ...props.style || {}
1003
- },
999
+ style,
1004
1000
  children: (_c = props.text) != null ? _c : props.children
1005
1001
  })
1006
1002
  });
1007
1003
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
1008
1004
  to: props.href,
1009
1005
  target: props.target || (Link2 == null ? void 0 : Link2.target),
1010
- style: {
1011
- ...Link2.style,
1012
- ...props.style || {}
1013
- },
1006
+ style,
1014
1007
  children: (_d = props.text) != null ? _d : props.children
1015
1008
  });
1016
1009
  }
package/dist/index.mjs CHANGED
@@ -59,6 +59,7 @@ function ConfigProvider({
59
59
  }) {
60
60
  const [values, setValues] = useState(baseConfig);
61
61
  useEffect(() => {
62
+ console.log(config);
62
63
  if (config.lang === "zh") {
63
64
  setValues(defaultsDeep(config, {
64
65
  lang: "zh",
@@ -67,7 +68,7 @@ function ConfigProvider({
67
68
  Form: { submit: { text: zh.submit } }
68
69
  }, baseConfig));
69
70
  } else
70
- setValues(values);
71
+ setValues(defaultsDeep(config, values));
71
72
  }, []);
72
73
  return /* @__PURE__ */ jsx(ConfigContext.Provider, {
73
74
  value: values,
@@ -946,31 +947,29 @@ import { jsx as jsx10 } from "react/jsx-runtime";
946
947
  function Link(props) {
947
948
  var _a, _b, _c, _d;
948
949
  const { Link: Link2 } = useConfigContext();
949
- props.style = Object.assign({ cursor: "pointer" }, props.style);
950
+ let style = {
951
+ ...Link2.style || {},
952
+ cursor: "pointer",
953
+ ...props.style
954
+ };
950
955
  if (props.block)
951
- props.style = Object.assign({
956
+ style = Object.assign({
952
957
  display: "block",
953
958
  width: "100%"
954
- }, props.style);
959
+ }, style);
955
960
  if (props.href.startsWith("http")) {
956
961
  if (props.button)
957
962
  return /* @__PURE__ */ jsx10(Button3, {
958
963
  ...props.button,
959
964
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
960
- style: {
961
- ...Link2.style,
962
- ...props.style || {}
963
- },
965
+ style,
964
966
  href: props.href,
965
967
  children: (_a = props.text) != null ? _a : props.children
966
968
  });
967
969
  return /* @__PURE__ */ jsx10("a", {
968
970
  href: props.href,
969
971
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
970
- style: {
971
- ...Link2.style,
972
- ...props.style || {}
973
- },
972
+ style,
974
973
  children: (_b = props.text) != null ? _b : props.children
975
974
  });
976
975
  }
@@ -980,20 +979,14 @@ function Link(props) {
980
979
  target: props.target || (Link2 == null ? void 0 : Link2.target),
981
980
  children: /* @__PURE__ */ jsx10(Button3, {
982
981
  ...props.button,
983
- style: {
984
- ...Link2.style,
985
- ...props.style || {}
986
- },
982
+ style,
987
983
  children: (_c = props.text) != null ? _c : props.children
988
984
  })
989
985
  });
990
986
  return /* @__PURE__ */ jsx10(RouterLink, {
991
987
  to: props.href,
992
988
  target: props.target || (Link2 == null ? void 0 : Link2.target),
993
- style: {
994
- ...Link2.style,
995
- ...props.style || {}
996
- },
989
+ style,
997
990
  children: (_d = props.text) != null ? _d : props.children
998
991
  });
999
992
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.33",
3
+ "version": "0.0.3-beta.35",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "lodash-es": "*",
29
29
  "react": "*",
30
30
  "react-dom": "*",
31
- "@faasjs/react": "^0.0.3-beta.33",
31
+ "@faasjs/react": "^0.0.3-beta.35",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },