@lumx/react 3.21.0 → 3.21.1
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/index.js +15 -12
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/text-field/RawInputText.test.tsx +1 -0
- package/src/components/text-field/RawInputText.tsx +17 -4
- package/src/components/text-field/RawInputTextarea.test.tsx +1 -0
- package/src/components/text-field/RawInputTextarea.tsx +10 -4
package/index.js
CHANGED
|
@@ -13203,7 +13203,7 @@ const CLASSNAME$5 = getRootClassName(COMPONENT_NAME$5);
|
|
|
13203
13203
|
*/
|
|
13204
13204
|
const INPUT_NATIVE_CLASSNAME = `${CLASSNAME$5}__input-native`;
|
|
13205
13205
|
|
|
13206
|
-
const _excluded$7 = ["className", "theme", "value", "onChange", "type"];
|
|
13206
|
+
const _excluded$7 = ["className", "theme", "value", "onChange", "type", "name"];
|
|
13207
13207
|
|
|
13208
13208
|
/**
|
|
13209
13209
|
* Defines the props of the component.
|
|
@@ -13227,20 +13227,22 @@ const RawInputText = forwardRef((props, ref) => {
|
|
|
13227
13227
|
theme = defaultTheme,
|
|
13228
13228
|
value,
|
|
13229
13229
|
onChange,
|
|
13230
|
-
type = DEFAULT_PROPS$7.type
|
|
13230
|
+
type = DEFAULT_PROPS$7.type,
|
|
13231
|
+
name
|
|
13231
13232
|
} = props,
|
|
13232
13233
|
forwardedProps = _objectWithoutProperties(props, _excluded$7);
|
|
13233
13234
|
const textareaRef = useRef(null);
|
|
13234
13235
|
const handleChange = useCallback(evt => {
|
|
13235
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(evt.target.value,
|
|
13236
|
-
}, [onChange]);
|
|
13236
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(evt.target.value, name, evt);
|
|
13237
|
+
}, [onChange, name]);
|
|
13237
13238
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, forwardedProps, {
|
|
13239
|
+
name: name,
|
|
13238
13240
|
type: type,
|
|
13239
13241
|
ref: useMergeRefs(ref, textareaRef),
|
|
13240
13242
|
className: classNames(className, handleBasicClasses({
|
|
13241
13243
|
prefix: INPUT_NATIVE_CLASSNAME,
|
|
13242
13244
|
theme
|
|
13243
|
-
})),
|
|
13245
|
+
}), `${INPUT_NATIVE_CLASSNAME}--text`),
|
|
13244
13246
|
onChange: handleChange,
|
|
13245
13247
|
value: value
|
|
13246
13248
|
}));
|
|
@@ -13287,7 +13289,7 @@ function useFitRowsToContent(minimumRows, textareaRef, value) {
|
|
|
13287
13289
|
return rows;
|
|
13288
13290
|
}
|
|
13289
13291
|
|
|
13290
|
-
const _excluded$6 = ["className", "theme", "minimumRows", "value", "onChange"];
|
|
13292
|
+
const _excluded$6 = ["className", "theme", "minimumRows", "value", "name", "onChange"];
|
|
13291
13293
|
|
|
13292
13294
|
/**
|
|
13293
13295
|
* Defines the props of the component.
|
|
@@ -13311,21 +13313,22 @@ const RawInputTextarea = forwardRef((props, ref) => {
|
|
|
13311
13313
|
theme = defaultTheme,
|
|
13312
13314
|
minimumRows = DEFAULT_PROPS$6.minimumRows,
|
|
13313
13315
|
value,
|
|
13316
|
+
name,
|
|
13314
13317
|
onChange
|
|
13315
13318
|
} = props,
|
|
13316
13319
|
forwardedProps = _objectWithoutProperties(props, _excluded$6);
|
|
13317
13320
|
const textareaRef = useRef(null);
|
|
13318
13321
|
const rows = useFitRowsToContent(minimumRows, textareaRef, value);
|
|
13319
13322
|
const handleChange = useCallback(evt => {
|
|
13320
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(evt.target.value,
|
|
13321
|
-
}, [onChange]);
|
|
13322
|
-
return /*#__PURE__*/React__default.createElement("textarea", _extends({
|
|
13323
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(evt.target.value, name, evt);
|
|
13324
|
+
}, [onChange, name]);
|
|
13325
|
+
return /*#__PURE__*/React__default.createElement("textarea", _extends({}, forwardedProps, {
|
|
13326
|
+
name: name,
|
|
13323
13327
|
className: classNames(className, handleBasicClasses({
|
|
13324
13328
|
prefix: INPUT_NATIVE_CLASSNAME,
|
|
13325
13329
|
theme
|
|
13326
|
-
})),
|
|
13327
|
-
ref: useMergeRefs(ref, textareaRef)
|
|
13328
|
-
}, forwardedProps, {
|
|
13330
|
+
}), `${INPUT_NATIVE_CLASSNAME}--textarea`),
|
|
13331
|
+
ref: useMergeRefs(ref, textareaRef),
|
|
13329
13332
|
onChange: handleChange,
|
|
13330
13333
|
value: value,
|
|
13331
13334
|
rows: rows
|