@faasjs/ant-design 0.0.3-beta.103 → 0.0.3-beta.104

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 CHANGED
@@ -448,6 +448,7 @@ interface LinkProps {
448
448
  block?: boolean;
449
449
  /** only use for text without button */
450
450
  copyable?: boolean;
451
+ onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
451
452
  }
452
453
  /**
453
454
  * Link component with button.
package/dist/index.d.ts CHANGED
@@ -448,6 +448,7 @@ interface LinkProps {
448
448
  block?: boolean;
449
449
  /** only use for text without button */
450
450
  copyable?: boolean;
451
+ onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
451
452
  }
452
453
  /**
453
454
  * Link component with button.
package/dist/index.js CHANGED
@@ -884,6 +884,7 @@ function Link(props) {
884
884
  target: props.target || (Config == null ? void 0 : Config.target) || "_blank",
885
885
  style: computedStyle,
886
886
  href: props.href,
887
+ onClick: props.onClick,
887
888
  children: (_a = props.text) != null ? _a : props.children
888
889
  }
889
890
  );
@@ -894,6 +895,7 @@ function Link(props) {
894
895
  href: props.href,
895
896
  target: props.target || (Config == null ? void 0 : Config.target),
896
897
  style: computedStyle,
898
+ onClick: props.onClick,
897
899
  children: props.children
898
900
  }
899
901
  );
@@ -904,6 +906,7 @@ function Link(props) {
904
906
  target: props.target || (Config == null ? void 0 : Config.target) || "_blank",
905
907
  style: computedStyle,
906
908
  copyable: props.copyable,
909
+ onClick: props.onClick,
907
910
  children: props.text
908
911
  }
909
912
  );
@@ -914,7 +917,7 @@ function Link(props) {
914
917
  {
915
918
  ...props.button,
916
919
  style: computedStyle,
917
- onClick: () => (props.target || (Config == null ? void 0 : Config.target)) === "_blank" ? window.open(props.href) : navigate(props.href),
920
+ onClick: (e) => props.onClick ? props.onClick(e) : (props.target || (Config == null ? void 0 : Config.target)) === "_blank" ? window.open(props.href) : navigate(props.href),
918
921
  children: (_b = props.text) != null ? _b : props.children
919
922
  }
920
923
  );
@@ -925,6 +928,7 @@ function Link(props) {
925
928
  to: props.href,
926
929
  target: props.target || (Config == null ? void 0 : Config.target),
927
930
  style: computedStyle,
931
+ onClick: props.onClick,
928
932
  children: props.children
929
933
  }
930
934
  );
@@ -936,6 +940,10 @@ function Link(props) {
936
940
  style: computedStyle,
937
941
  copyable: props.copyable,
938
942
  onClick: (e) => {
943
+ if (props.onClick) {
944
+ props.onClick(e);
945
+ return;
946
+ }
939
947
  if ((props.target || (Config == null ? void 0 : Config.target)) !== "_blank") {
940
948
  e.preventDefault();
941
949
  navigate(props.href);
package/dist/index.mjs CHANGED
@@ -881,6 +881,7 @@ function Link(props) {
881
881
  target: props.target || (Config == null ? void 0 : Config.target) || "_blank",
882
882
  style: computedStyle,
883
883
  href: props.href,
884
+ onClick: props.onClick,
884
885
  children: (_a = props.text) != null ? _a : props.children
885
886
  }
886
887
  );
@@ -891,6 +892,7 @@ function Link(props) {
891
892
  href: props.href,
892
893
  target: props.target || (Config == null ? void 0 : Config.target),
893
894
  style: computedStyle,
895
+ onClick: props.onClick,
894
896
  children: props.children
895
897
  }
896
898
  );
@@ -901,6 +903,7 @@ function Link(props) {
901
903
  target: props.target || (Config == null ? void 0 : Config.target) || "_blank",
902
904
  style: computedStyle,
903
905
  copyable: props.copyable,
906
+ onClick: props.onClick,
904
907
  children: props.text
905
908
  }
906
909
  );
@@ -911,7 +914,7 @@ function Link(props) {
911
914
  {
912
915
  ...props.button,
913
916
  style: computedStyle,
914
- onClick: () => (props.target || (Config == null ? void 0 : Config.target)) === "_blank" ? window.open(props.href) : navigate(props.href),
917
+ onClick: (e) => props.onClick ? props.onClick(e) : (props.target || (Config == null ? void 0 : Config.target)) === "_blank" ? window.open(props.href) : navigate(props.href),
915
918
  children: (_b = props.text) != null ? _b : props.children
916
919
  }
917
920
  );
@@ -922,6 +925,7 @@ function Link(props) {
922
925
  to: props.href,
923
926
  target: props.target || (Config == null ? void 0 : Config.target),
924
927
  style: computedStyle,
928
+ onClick: props.onClick,
925
929
  children: props.children
926
930
  }
927
931
  );
@@ -933,6 +937,10 @@ function Link(props) {
933
937
  style: computedStyle,
934
938
  copyable: props.copyable,
935
939
  onClick: (e) => {
940
+ if (props.onClick) {
941
+ props.onClick(e);
942
+ return;
943
+ }
936
944
  if ((props.target || (Config == null ? void 0 : Config.target)) !== "_blank") {
937
945
  e.preventDefault();
938
946
  navigate(props.href);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.103",
3
+ "version": "0.0.3-beta.104",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@faasjs/react": "0.0.3-beta.103",
25
+ "@faasjs/react": "0.0.3-beta.104",
26
26
  "@ant-design/icons": "*",
27
27
  "lodash-es": "*",
28
28
  "dayjs": "*"