react-ui-suite 1.1.11 → 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;
|
|
@@ -14,15 +16,20 @@
|
|
|
14
16
|
color: var(--rui-color-text-muted);
|
|
15
17
|
}
|
|
16
18
|
|
|
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
|
-
|
|
19
|
+
.rui-textarea__shell {
|
|
20
|
+
--rui-textarea-footer-height: 1.75rem;
|
|
21
|
+
--rui-textarea-footer-offset: 0.5rem;
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
min-width: 0;
|
|
31
|
+
min-height: 0;
|
|
32
|
+
overflow: hidden;
|
|
26
33
|
border-radius: 1rem;
|
|
27
34
|
border: 1px solid var(--rui-color-border);
|
|
28
35
|
background-color: var(--rui-color-surface);
|
|
@@ -52,12 +59,14 @@
|
|
|
52
59
|
box-shadow: none;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
|
-
.rui-textarea__control {
|
|
56
|
-
box-sizing: border-box;
|
|
57
|
-
display: block;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
.rui-textarea__control {
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
display: block;
|
|
65
|
+
flex: 1 1 auto;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
max-width: 100%;
|
|
69
|
+
min-width: 0;
|
|
61
70
|
min-height: 120px;
|
|
62
71
|
border: none;
|
|
63
72
|
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-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,8 +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 [
|
|
4654
|
+
const [manualHeight, setManualHeight] = React23.useState(void 0);
|
|
4655
|
+
const [isManualHeightActive, setIsManualHeightActive] = React23.useState(false);
|
|
4656
|
+
const [manualWidth, setManualWidth] = React23.useState(void 0);
|
|
4656
4657
|
const setRefs = React23.useCallback(
|
|
4657
4658
|
(node) => {
|
|
4658
4659
|
textareaRef.current = node;
|
|
@@ -4703,7 +4704,7 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4703
4704
|
el.removeEventListener("scroll", handleScroll);
|
|
4704
4705
|
cancelAnimationFrame(raf);
|
|
4705
4706
|
};
|
|
4706
|
-
}, [
|
|
4707
|
+
}, [manualHeight]);
|
|
4707
4708
|
React23.useEffect(() => {
|
|
4708
4709
|
return () => {
|
|
4709
4710
|
if (resizeListenersRef.current.move) {
|
|
@@ -4715,12 +4716,19 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4715
4716
|
}
|
|
4716
4717
|
};
|
|
4717
4718
|
}, []);
|
|
4719
|
+
React23.useEffect(() => {
|
|
4720
|
+
const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4721
|
+
if (!allowY2) {
|
|
4722
|
+
setIsManualHeightActive(false);
|
|
4723
|
+
setManualHeight(void 0);
|
|
4724
|
+
}
|
|
4725
|
+
}, [resizeDirection]);
|
|
4718
4726
|
const handleResizeStart = (event) => {
|
|
4719
4727
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
4720
4728
|
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
4721
4729
|
event.preventDefault();
|
|
4722
4730
|
if (!textareaRef.current) return;
|
|
4723
|
-
const
|
|
4731
|
+
const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4724
4732
|
const allowX2 = resizeDirection === "horizontal" || resizeDirection === "both";
|
|
4725
4733
|
const startY = event.clientY;
|
|
4726
4734
|
const startX = event.clientX;
|
|
@@ -4730,14 +4738,18 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4730
4738
|
const minWidth = 240;
|
|
4731
4739
|
const parentWidth = (_e = (_d = (_c = shellRef.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.clientWidth) != null ? _e : startWidth;
|
|
4732
4740
|
const onMove = (moveEvent) => {
|
|
4733
|
-
if (
|
|
4734
|
-
const
|
|
4735
|
-
|
|
4741
|
+
if (allowY2) {
|
|
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
|
+
}
|
|
4736
4748
|
}
|
|
4737
4749
|
if (allowX2) {
|
|
4738
4750
|
const proposed = startWidth + (moveEvent.clientX - startX);
|
|
4739
4751
|
const nextWidth = Math.min(parentWidth, Math.max(minWidth, proposed));
|
|
4740
|
-
|
|
4752
|
+
setManualWidth(nextWidth);
|
|
4741
4753
|
}
|
|
4742
4754
|
};
|
|
4743
4755
|
const onUp = () => {
|
|
@@ -4797,12 +4809,11 @@ var Textarea = React23.forwardRef(function Textarea2({
|
|
|
4797
4809
|
const count = value.length;
|
|
4798
4810
|
const limit = maxLength != null ? maxLength : void 0;
|
|
4799
4811
|
const { style, ...restProps } = rest;
|
|
4800
|
-
const
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
};
|
|
4812
|
+
const allowY = resizeDirection === "vertical" || resizeDirection === "both";
|
|
4813
|
+
const manualHeightStyle = isManualHeightActive && allowY && manualHeight !== void 0 ? { height: manualHeight } : void 0;
|
|
4814
|
+
const textareaStyle = manualHeightStyle ? { ...style, ...manualHeightStyle } : style;
|
|
4804
4815
|
const allowX = resizeDirection === "horizontal" || resizeDirection === "both";
|
|
4805
|
-
const shellStyle =
|
|
4816
|
+
const shellStyle = manualWidth !== void 0 && allowX ? { width: manualWidth } : void 0;
|
|
4806
4817
|
return /* @__PURE__ */ jsxs25("div", { className: rootClasses, children: [
|
|
4807
4818
|
label ? /* @__PURE__ */ jsx27(
|
|
4808
4819
|
"label",
|