@doist/reactist 17.9.1 → 17.10.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.
- package/dist/reactist.cjs.development.js +32 -8
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/new-components/text-area/text-area.js +33 -8
- package/es/new-components/text-area/text-area.js.map +1 -1
- package/es/new-components/text-area/text-area.module.css.js +1 -1
- package/lib/new-components/text-area/text-area.d.ts +18 -2
- package/lib/new-components/text-area/text-area.js +1 -1
- package/lib/new-components/text-area/text-area.js.map +1 -1
- package/lib/new-components/text-area/text-area.module.css.js +1 -1
- package/package.json +1 -1
- package/styles/modal.css +1 -1
- package/styles/modal.module.css.css +1 -1
- package/styles/reactist.css +1 -1
- package/styles/text-area.css +1 -1
- package/styles/text-area.module.css.css +1 -1
|
@@ -1910,11 +1910,10 @@ const SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref
|
|
|
1910
1910
|
}, hint) : null);
|
|
1911
1911
|
});
|
|
1912
1912
|
|
|
1913
|
-
var modules_2728c236 = {"textAreaContainer":"
|
|
1913
|
+
var modules_2728c236 = {"textAreaContainer":"_21dbfa84","innerContainer":"_43588660","bordered":"f081b428","error":"a862f0e5","autoExpand":"_46360b15"};
|
|
1914
1914
|
|
|
1915
|
-
const _excluded$m = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "hidden", "aria-describedby"];
|
|
1916
|
-
|
|
1917
|
-
function TextArea(_ref) {
|
|
1915
|
+
const _excluded$m = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "maxWidth", "hidden", "aria-describedby", "rows", "autoExpand"];
|
|
1916
|
+
const TextArea = /*#__PURE__*/React.forwardRef(function TextArea(_ref, ref) {
|
|
1918
1917
|
let {
|
|
1919
1918
|
variant = 'default',
|
|
1920
1919
|
id,
|
|
@@ -1926,10 +1925,29 @@ function TextArea(_ref) {
|
|
|
1926
1925
|
tone,
|
|
1927
1926
|
maxWidth,
|
|
1928
1927
|
hidden,
|
|
1929
|
-
'aria-describedby': ariaDescribedBy
|
|
1928
|
+
'aria-describedby': ariaDescribedBy,
|
|
1929
|
+
rows,
|
|
1930
|
+
autoExpand = false
|
|
1930
1931
|
} = _ref,
|
|
1931
1932
|
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
1932
1933
|
|
|
1934
|
+
const containerRef = React.useRef(null);
|
|
1935
|
+
const internalRef = React.useRef(null);
|
|
1936
|
+
const combinedRef = useCallbackRef.useMergeRefs([ref, internalRef]);
|
|
1937
|
+
React.useEffect(function setupAutoExpand() {
|
|
1938
|
+
const containerElement = containerRef.current;
|
|
1939
|
+
|
|
1940
|
+
function handleInput(event) {
|
|
1941
|
+
if (containerElement) {
|
|
1942
|
+
containerElement.dataset.replicatedValue = event.currentTarget.value;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
const textAreaElement = internalRef.current;
|
|
1947
|
+
if (!textAreaElement || !autoExpand) return undefined;
|
|
1948
|
+
textAreaElement.addEventListener('input', handleInput);
|
|
1949
|
+
return () => textAreaElement.removeEventListener('input', handleInput);
|
|
1950
|
+
}, [autoExpand]);
|
|
1933
1951
|
return /*#__PURE__*/React.createElement(BaseField, {
|
|
1934
1952
|
variant: variant,
|
|
1935
1953
|
id: id,
|
|
@@ -1945,9 +1963,15 @@ function TextArea(_ref) {
|
|
|
1945
1963
|
maxWidth: maxWidth
|
|
1946
1964
|
}, extraProps => /*#__PURE__*/React.createElement(Box, {
|
|
1947
1965
|
width: "full",
|
|
1948
|
-
display: "flex"
|
|
1949
|
-
|
|
1950
|
-
|
|
1966
|
+
display: "flex",
|
|
1967
|
+
className: modules_2728c236.innerContainer,
|
|
1968
|
+
ref: containerRef
|
|
1969
|
+
}, /*#__PURE__*/React.createElement("textarea", _objectSpread2(_objectSpread2(_objectSpread2({}, props), extraProps), {}, {
|
|
1970
|
+
ref: combinedRef,
|
|
1971
|
+
rows: rows,
|
|
1972
|
+
className: autoExpand ? modules_2728c236.autoExpand : undefined
|
|
1973
|
+
}))));
|
|
1974
|
+
});
|
|
1951
1975
|
|
|
1952
1976
|
const _excluded$n = ["variant", "id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "message", "tone", "type", "maxWidth", "hidden", "aria-describedby", "startIcon"];
|
|
1953
1977
|
const TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|