indicator-ui 0.0.222 → 0.0.223
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.css +1 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +6 -21
- package/dist/index.js.map +1 -1
- package/dist/types/src/ui/InputFields/TextareaField/types/TextareaFieldTypes.d.ts +0 -6
- package/dist/types/src/ui/InputFields/TextareaField/ui/TextareaField.d.ts +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -22097,34 +22097,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22097
22097
|
/* harmony export */ "default": () => (/* binding */ TextareaField)
|
|
22098
22098
|
/* harmony export */ });
|
|
22099
22099
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
|
22100
|
-
/* harmony import */ var
|
|
22101
|
-
/* harmony import */ var
|
|
22102
|
-
/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
|
|
22103
|
-
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../styles */ "./src/ui/InputFields/TextareaField/styles/index.ts");
|
|
22104
|
-
|
|
22100
|
+
/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
|
|
22101
|
+
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../styles */ "./src/ui/InputFields/TextareaField/styles/index.ts");
|
|
22105
22102
|
|
|
22106
22103
|
|
|
22107
22104
|
|
|
22108
|
-
function TextareaField({ value, name, placeholder, onChange, required = false, disabled = false, isError = false, offFocus = false,
|
|
22109
|
-
const textareaRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
22110
|
-
const resizeTextarea = () => {
|
|
22111
|
-
if (autoResize) {
|
|
22112
|
-
const textarea = textareaRef.current;
|
|
22113
|
-
if (textarea) {
|
|
22114
|
-
textarea.style.height = 'auto';
|
|
22115
|
-
textarea.style.height = textarea.scrollHeight + 'px';
|
|
22116
|
-
}
|
|
22117
|
-
}
|
|
22118
|
-
};
|
|
22119
|
-
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
22120
|
-
resizeTextarea();
|
|
22121
|
-
}, []);
|
|
22105
|
+
function TextareaField({ value, name, placeholder, onChange, required = false, disabled = false, isError = false, offFocus = false, additionStyles, }) {
|
|
22122
22106
|
const handleOnChange = (e) => {
|
|
22123
22107
|
e.preventDefault();
|
|
22124
22108
|
onChange && onChange(e.target.value);
|
|
22125
|
-
resizeTextarea();
|
|
22126
22109
|
};
|
|
22127
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: name, placeholder: placeholder, value: value, onChange: handleOnChange, required: required, disabled: disabled, className: (0,
|
|
22110
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: name, placeholder: placeholder, value: value ?? undefined, onChange: handleOnChange, required: required, disabled: disabled, className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_styles__WEBPACK_IMPORTED_MODULE_2__.TextareaFieldStyle.textareaField, {
|
|
22111
|
+
[_styles__WEBPACK_IMPORTED_MODULE_2__.TextareaFieldStyle.isError]: isError,
|
|
22112
|
+
}, additionStyles) }));
|
|
22128
22113
|
}
|
|
22129
22114
|
|
|
22130
22115
|
|