@luscii-healthtech/web-ui 6.1.4 → 6.2.0
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.
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type InfoFieldLinkType = "none" | "link" | "clipboard" | "tel";
|
|
3
2
|
interface InfoFieldProps {
|
|
4
3
|
label: string;
|
|
5
4
|
value: string;
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Gives the component interactive abilities. The `value` prop
|
|
7
|
+
* is used in conjunction with this.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // The `value` prop will be used as the `href` attribute of the link. This will open a new tab.
|
|
12
|
+
* <InfoField linkType="link" value="https://www.nos.nl" />
|
|
13
|
+
*
|
|
14
|
+
* // The `value` prop will be copied to the clipboard when the user clicks the component.
|
|
15
|
+
* <InfoField linkType="clipboard" value="14/09/1988" />
|
|
16
|
+
*
|
|
17
|
+
* // A phone call will be triggered based on the phone number in the `value` prop.
|
|
18
|
+
* <InfoField linkType="tel" value="+31612345678" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
linkType: "none" | "link" | "clipboard" | "tel";
|
|
7
22
|
supportsMultiline?: boolean;
|
|
8
|
-
onCopyToClipboard?: () => void;
|
|
23
|
+
onCopyToClipboard?: (value?: string) => void;
|
|
9
24
|
icon?: JSX.Element;
|
|
10
25
|
className?: string;
|
|
11
26
|
}
|
|
12
|
-
export declare const InfoField:
|
|
13
|
-
(props: InfoFieldProps): JSX.Element;
|
|
14
|
-
defaultProps: {
|
|
15
|
-
linkType: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
27
|
+
export declare const InfoField: (props: InfoFieldProps) => JSX.Element;
|
|
18
28
|
export {};
|
|
@@ -2977,7 +2977,8 @@ const InfoField = (props) => {
|
|
|
2977
2977
|
React.useEffect(() => {
|
|
2978
2978
|
const clipboard = new ClipboardJS__default.default("button");
|
|
2979
2979
|
clipboard.on("success", function(e) {
|
|
2980
|
-
|
|
2980
|
+
var _a;
|
|
2981
|
+
(_a = props.onCopyToClipboard) === null || _a === void 0 ? void 0 : _a.call(props, e.text);
|
|
2981
2982
|
e.clearSelection();
|
|
2982
2983
|
});
|
|
2983
2984
|
return () => clipboard.destroy();
|
|
@@ -3020,9 +3021,6 @@ const InfoField = (props) => {
|
|
|
3020
3021
|
)
|
|
3021
3022
|
);
|
|
3022
3023
|
};
|
|
3023
|
-
InfoField.defaultProps = {
|
|
3024
|
-
linkType: "none"
|
|
3025
|
-
};
|
|
3026
3024
|
|
|
3027
3025
|
const Line = ({ left, right, className }) => /* @__PURE__ */ React__namespace.default.createElement(
|
|
3028
3026
|
"div",
|