react-ui-suite 1.1.12 → 1.1.13
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,8 +1,10 @@
|
|
|
1
|
-
.rui-textarea {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
.rui-textarea {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100%;
|
|
5
|
+
min-height: 0;
|
|
6
|
+
gap: var(--rui-space-1-5);
|
|
7
|
+
}
|
|
6
8
|
|
|
7
9
|
.rui-textarea__label {
|
|
8
10
|
margin: 0;
|
|
@@ -20,6 +22,7 @@
|
|
|
20
22
|
position: relative;
|
|
21
23
|
display: flex;
|
|
22
24
|
flex-direction: column;
|
|
25
|
+
flex: 1 1 auto;
|
|
23
26
|
box-sizing: border-box;
|
|
24
27
|
width: 100%;
|
|
25
28
|
height: 100%;
|
package/dist/index.js
CHANGED
|
@@ -4615,7 +4615,7 @@ function Table({
|
|
|
4615
4615
|
// components/Textarea/Textarea.tsx
|
|
4616
4616
|
import * as React23 from "react";
|
|
4617
4617
|
import clsx25 from "clsx";
|
|
4618
|
-
import "./Textarea-
|
|
4618
|
+
import "./Textarea-R5GRAK6Y.css";
|
|
4619
4619
|
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4620
4620
|
var MIN_THUMB2 = 24;
|
|
4621
4621
|
var TRACK_THICKNESS2 = 6;
|
|
@@ -4651,9 +4651,9 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4651
4651
|
const hintIds = [description ? descriptionId : null, error ? errorId : null].filter(Boolean);
|
|
4652
4652
|
const resolvedAriaDescribedBy = hintIds.length ? hintIds.join(" ") : void 0;
|
|
4653
4653
|
const [value, setValue] = React23.useState((_b = (_a = rest.defaultValue) == null ? void 0 : _a.toString()) != null ? _b : "");
|
|
4654
|
-
const [
|
|
4655
|
-
const [
|
|
4656
|
-
const [
|
|
4654
|
+
const [manualHeight, setManualHeight] = React23.useState(void 0);
|
|
4655
|
+
const [isManualHeightActive, setIsManualHeightActive] = React23.useState(false);
|
|
4656
|
+
const [manualWidth, setManualWidth] = React23.useState(void 0);
|
|
4657
4657
|
const setRefs = React23.useCallback(
|
|
4658
4658
|
(node) => {
|
|
4659
4659
|
textareaRef.current = node;
|
|
@@ -4704,7 +4704,7 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4704
4704
|
el.removeEventListener("scroll", handleScroll);
|
|
4705
4705
|
cancelAnimationFrame(raf);
|
|
4706
4706
|
};
|
|
4707
|
-
}, [
|
|
4707
|
+
}, [manualHeight]);
|
|
4708
4708
|
React23.useEffect(() => {
|
|
4709
4709
|
return () => {
|
|
4710
4710
|
if (resizeListenersRef.current.move) {
|
|
@@ -4719,8 +4719,8 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4719
4719
|
React23.useEffect(() => {
|
|
4720
4720
|
const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4721
4721
|
if (!allowY2) {
|
|
4722
|
-
|
|
4723
|
-
|
|
4722
|
+
setIsManualHeightActive(false);
|
|
4723
|
+
setManualHeight(void 0);
|
|
4724
4724
|
}
|
|
4725
4725
|
}, [resizeDirection]);
|
|
4726
4726
|
const handleResizeStart = (event) => {
|
|
@@ -4739,14 +4739,17 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4739
4739
|
const parentWidth = (_e = (_d = (_c = shellRef.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.clientWidth) != null ? _e : startWidth;
|
|
4740
4740
|
const onMove = (moveEvent) => {
|
|
4741
4741
|
if (allowY2) {
|
|
4742
|
-
const
|
|
4743
|
-
|
|
4744
|
-
|
|
4742
|
+
const deltaY = moveEvent.clientY - startY;
|
|
4743
|
+
const nextHeight = Math.max(minHeight, startHeight + deltaY);
|
|
4744
|
+
setManualHeight(nextHeight);
|
|
4745
|
+
if (Math.abs(deltaY) >= 1) {
|
|
4746
|
+
setIsManualHeightActive(true);
|
|
4747
|
+
}
|
|
4745
4748
|
}
|
|
4746
4749
|
if (allowX2) {
|
|
4747
4750
|
const proposed = startWidth + (moveEvent.clientX - startX);
|
|
4748
4751
|
const nextWidth = Math.min(parentWidth, Math.max(minWidth, proposed));
|
|
4749
|
-
|
|
4752
|
+
setManualWidth(nextWidth);
|
|
4750
4753
|
}
|
|
4751
4754
|
};
|
|
4752
4755
|
const onUp = () => {
|
|
@@ -4807,12 +4810,10 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4807
4810
|
const limit = maxLength != null ? maxLength : void 0;
|
|
4808
4811
|
const { style, ...restProps } = rest;
|
|
4809
4812
|
const allowY = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4810
|
-
const
|
|
4811
|
-
|
|
4812
|
-
...isUserResized && allowY && height !== void 0 ? { height } : null
|
|
4813
|
-
};
|
|
4813
|
+
const manualHeightStyle = isManualHeightActive && allowY && manualHeight !== void 0 ? { height: manualHeight } : void 0;
|
|
4814
|
+
const textareaStyle = manualHeightStyle ? { ...style, ...manualHeightStyle } : style;
|
|
4814
4815
|
const allowX = resizeDirection === "horizontal" || resizeDirection === "both";
|
|
4815
|
-
const shellStyle =
|
|
4816
|
+
const shellStyle = manualWidth !== void 0 && allowX ? { width: manualWidth } : void 0;
|
|
4816
4817
|
return /* @__PURE__ */ jsxs25("div", { className: rootClasses, children: [
|
|
4817
4818
|
label ? /* @__PURE__ */ jsx27(
|
|
4818
4819
|
"label",
|