acsi-core 0.1.11 → 0.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.
@@ -10,6 +10,7 @@ interface IProps {
10
10
  width?: number;
11
11
  tooltip?: string;
12
12
  isOptional?: boolean;
13
+ minHeight?: string;
13
14
  }
14
15
  declare const CoreTextArea: (props: IProps) => React.JSX.Element;
15
16
  export default CoreTextArea;
package/dist/index.js CHANGED
@@ -1489,13 +1489,22 @@ var CoreTextArea = function CoreTextArea(props) {
1489
1489
  _props$tooltip = props.tooltip,
1490
1490
  tooltip = _props$tooltip === void 0 ? '' : _props$tooltip,
1491
1491
  _props$isOptional = props.isOptional,
1492
- isOptional = _props$isOptional === void 0 ? false : _props$isOptional;
1492
+ isOptional = _props$isOptional === void 0 ? false : _props$isOptional,
1493
+ minHeight = props.minHeight;
1494
+ var textareaRef = React.useRef(null);
1493
1495
  var _useState = React.useState(false),
1494
1496
  isOpenTooltip = _useState[0],
1495
1497
  setIsOpenTooltip = _useState[1];
1496
1498
  var toggleTooltip = function toggleTooltip() {
1497
1499
  return setIsOpenTooltip(!isOpenTooltip);
1498
1500
  };
1501
+ React.useEffect(function () {
1502
+ if (textareaRef.current) {
1503
+ var _textareaRef$current;
1504
+ textareaRef.current.style.height = "auto";
1505
+ textareaRef.current.style.height = ((_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 ? void 0 : _textareaRef$current.scrollHeight) + "px";
1506
+ }
1507
+ }, [value]);
1499
1508
  return React__default.createElement("div", {
1500
1509
  className: styles$8["core-text-area"],
1501
1510
  style: {
@@ -1515,10 +1524,15 @@ var CoreTextArea = function CoreTextArea(props) {
1515
1524
  isOpen: isOpenTooltip,
1516
1525
  toggle: toggleTooltip
1517
1526
  }, tooltip) : null), React__default.createElement("textarea", {
1527
+ ref: textareaRef,
1528
+ placeholder: placeholder,
1518
1529
  style: {
1519
- whiteSpace: "pre-wrap"
1530
+ whiteSpace: "pre-wrap",
1531
+ width: "100%",
1532
+ minHeight: minHeight ? minHeight : "123px",
1533
+ resize: "none",
1534
+ overflow: "hidden"
1520
1535
  },
1521
- placeholder: placeholder,
1522
1536
  value: value,
1523
1537
  cols: cols,
1524
1538
  rows: rows,