@pnkx-lib/ui 1.9.458 → 1.9.459
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/es/fields/Textarea.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { g as get } from '../chunks/get-DPccfEM4.js';
|
|
4
|
-
import { Input } from 'antd';
|
|
4
|
+
import { Input, Tooltip } from 'antd';
|
|
5
5
|
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
6
6
|
import { Label } from '../ui/Label.js';
|
|
7
7
|
import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
|
|
@@ -19,6 +19,7 @@ const Textarea = forwardRef(
|
|
|
19
19
|
required,
|
|
20
20
|
autoSize,
|
|
21
21
|
classNameLabel,
|
|
22
|
+
contentTooltip,
|
|
22
23
|
...restProps
|
|
23
24
|
} = props;
|
|
24
25
|
const { name, value, onChange, onBlur } = field || {};
|
|
@@ -37,6 +38,21 @@ const Textarea = forwardRef(
|
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
};
|
|
41
|
+
const wrapWithTooltip = (node) => {
|
|
42
|
+
if (contentTooltip) {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Tooltip,
|
|
45
|
+
{
|
|
46
|
+
trigger: ["hover"],
|
|
47
|
+
title: contentTooltip,
|
|
48
|
+
placement: "topLeft",
|
|
49
|
+
classNames: { root: "numeric-input" },
|
|
50
|
+
children: node
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return node;
|
|
55
|
+
};
|
|
40
56
|
//! Render
|
|
41
57
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
42
58
|
label && /* @__PURE__ */ jsx(
|
|
@@ -47,27 +63,31 @@ const Textarea = forwardRef(
|
|
|
47
63
|
classNameLabel
|
|
48
64
|
}
|
|
49
65
|
),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
wrapWithTooltip(
|
|
67
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
TextArea,
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
className: twMerge(
|
|
73
|
+
autoSize ? "textarea-custom" : "",
|
|
74
|
+
customStyleTextarea,
|
|
75
|
+
"pnkx-default-input"
|
|
76
|
+
),
|
|
77
|
+
value,
|
|
78
|
+
onBlur,
|
|
79
|
+
onChange: (e) => {
|
|
80
|
+
onChange?.(e);
|
|
81
|
+
afterOnChange?.(e.target.value);
|
|
82
|
+
},
|
|
83
|
+
status: (isTouched || isSubmitted) && errorMessage ? "error" : void 0,
|
|
84
|
+
autoSize,
|
|
85
|
+
...restProps
|
|
86
|
+
}
|
|
58
87
|
),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
onChange?.(e);
|
|
63
|
-
afterOnChange?.(e.target.value);
|
|
64
|
-
},
|
|
65
|
-
status: (isTouched || isSubmitted) && errorMessage ? "error" : void 0,
|
|
66
|
-
autoSize,
|
|
67
|
-
...restProps
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
renderErrorMessage()
|
|
88
|
+
renderErrorMessage()
|
|
89
|
+
] })
|
|
90
|
+
)
|
|
71
91
|
] });
|
|
72
92
|
}
|
|
73
93
|
);
|
package/package.json
CHANGED
|
@@ -8,5 +8,6 @@ export interface TextAreaProps extends TextAreaPropsAntd {
|
|
|
8
8
|
afterOnChange?: (value: string) => void;
|
|
9
9
|
required?: boolean;
|
|
10
10
|
classNameLabel?: string;
|
|
11
|
+
contentTooltip?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const Textarea: import('react').ForwardRefExoticComponent<TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|