react-ui-suite 1.1.10 → 1.1.12
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.
|
@@ -14,15 +14,19 @@
|
|
|
14
14
|
color: var(--rui-color-text-muted);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.rui-textarea__shell {
|
|
18
|
-
--rui-textarea-footer-height: 1.75rem;
|
|
19
|
-
--rui-textarea-footer-offset: 0.5rem;
|
|
20
|
-
position: relative;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
.rui-textarea__shell {
|
|
18
|
+
--rui-textarea-footer-height: 1.75rem;
|
|
19
|
+
--rui-textarea-footer-offset: 0.5rem;
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
overflow: hidden;
|
|
26
30
|
border-radius: 1rem;
|
|
27
31
|
border: 1px solid var(--rui-color-border);
|
|
28
32
|
background-color: var(--rui-color-surface);
|
|
@@ -52,12 +56,14 @@
|
|
|
52
56
|
box-shadow: none;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
.rui-textarea__control {
|
|
56
|
-
box-sizing: border-box;
|
|
57
|
-
display: block;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
.rui-textarea__control {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
display: block;
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
min-width: 0;
|
|
61
67
|
min-height: 120px;
|
|
62
68
|
border: none;
|
|
63
69
|
background: transparent;
|
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-PT4QYEE7.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;
|
|
@@ -4652,6 +4652,7 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
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
4654
|
const [height, setHeight] = React23.useState(void 0);
|
|
4655
|
+
const [isUserResized, setIsUserResized] = React23.useState(false);
|
|
4655
4656
|
const [width, setWidth] = React23.useState(void 0);
|
|
4656
4657
|
const setRefs = React23.useCallback(
|
|
4657
4658
|
(node) => {
|
|
@@ -4669,11 +4670,6 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4669
4670
|
setValue(rest.value);
|
|
4670
4671
|
}
|
|
4671
4672
|
}, [rest.value]);
|
|
4672
|
-
React23.useLayoutEffect(() => {
|
|
4673
|
-
if (textareaRef.current && height === void 0) {
|
|
4674
|
-
setHeight(textareaRef.current.offsetHeight);
|
|
4675
|
-
}
|
|
4676
|
-
}, [height]);
|
|
4677
4673
|
React23.useLayoutEffect(() => {
|
|
4678
4674
|
const el = textareaRef.current;
|
|
4679
4675
|
if (!el) return;
|
|
@@ -4720,12 +4716,19 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4720
4716
|
}
|
|
4721
4717
|
};
|
|
4722
4718
|
}, []);
|
|
4719
|
+
React23.useEffect(() => {
|
|
4720
|
+
const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4721
|
+
if (!allowY2) {
|
|
4722
|
+
setIsUserResized(false);
|
|
4723
|
+
setHeight(void 0);
|
|
4724
|
+
}
|
|
4725
|
+
}, [resizeDirection]);
|
|
4723
4726
|
const handleResizeStart = (event) => {
|
|
4724
4727
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
4725
4728
|
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
4726
4729
|
event.preventDefault();
|
|
4727
4730
|
if (!textareaRef.current) return;
|
|
4728
|
-
const
|
|
4731
|
+
const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4729
4732
|
const allowX2 = resizeDirection === "horizontal" || resizeDirection === "both";
|
|
4730
4733
|
const startY = event.clientY;
|
|
4731
4734
|
const startX = event.clientX;
|
|
@@ -4735,9 +4738,10 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4735
4738
|
const minWidth = 240;
|
|
4736
4739
|
const parentWidth = (_e = (_d = (_c = shellRef.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.clientWidth) != null ? _e : startWidth;
|
|
4737
4740
|
const onMove = (moveEvent) => {
|
|
4738
|
-
if (
|
|
4741
|
+
if (allowY2) {
|
|
4739
4742
|
const nextHeight = Math.max(minHeight, startHeight + (moveEvent.clientY - startY));
|
|
4740
4743
|
setHeight(nextHeight);
|
|
4744
|
+
setIsUserResized(true);
|
|
4741
4745
|
}
|
|
4742
4746
|
if (allowX2) {
|
|
4743
4747
|
const proposed = startWidth + (moveEvent.clientX - startX);
|
|
@@ -4802,9 +4806,10 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4802
4806
|
const count = value.length;
|
|
4803
4807
|
const limit = maxLength != null ? maxLength : void 0;
|
|
4804
4808
|
const { style, ...restProps } = rest;
|
|
4809
|
+
const allowY = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4805
4810
|
const textareaStyle = {
|
|
4806
4811
|
...style,
|
|
4807
|
-
...height !== void 0 ? { height } : null
|
|
4812
|
+
...isUserResized && allowY && height !== void 0 ? { height } : null
|
|
4808
4813
|
};
|
|
4809
4814
|
const allowX = resizeDirection === "horizontal" || resizeDirection === "both";
|
|
4810
4815
|
const shellStyle = width !== void 0 && allowX ? { width } : void 0;
|