rc-textarea
Advanced tools
Comparing version 1.0.0-1 to 1.0.0-2
@@ -22,3 +22,8 @@ import type { BaseInputProps, ShowCountProps } from 'rc-input/lib/interface'; | ||
showCount?: boolean | ShowCountProps; | ||
} & Pick<BaseInputProps, 'allowClear' | 'suffix' | 'affixWrapperClassName'>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<BaseInputProps, 'allowClear' | 'suffix'>; | ||
export declare type TextAreaRef = { | ||
@@ -25,0 +30,0 @@ resizableTextArea: ResizableTextAreaRef; |
import * as React from 'react'; | ||
import { ResizableTextAreaRef } from './interface'; | ||
import type { ResizableTextAreaRef } from './interface'; | ||
declare const ResizableTextArea: React.ForwardRefExoticComponent<Omit<import("./interface").HTMLTextareaProps, "onResize"> & { | ||
@@ -14,3 +14,8 @@ prefixCls?: string; | ||
showCount?: boolean | import("rc-input/lib/interface").ShowCountProps; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix" | "affixWrapperClassName"> & React.RefAttributes<ResizableTextAreaRef>>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix"> & React.RefAttributes<ResizableTextAreaRef>>; | ||
export default ResizableTextArea; |
@@ -8,8 +8,8 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _excluded = ["prefixCls", "onPressEnter", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"]; | ||
import * as React from 'react'; | ||
import classNames from 'classnames'; | ||
import ResizeObserver from 'rc-resize-observer'; | ||
import useLayoutEffect from "rc-util/es/hooks/useLayoutEffect"; | ||
import useMergedState from "rc-util/es/hooks/useMergedState"; | ||
import raf from "rc-util/es/raf"; | ||
import useMergedState from "rc-util/es/hooks/useMergedState"; | ||
import classNames from 'classnames'; | ||
import * as React from 'react'; | ||
import calculateAutoSizeStyle from "./calculateNodeHeight"; | ||
@@ -21,4 +21,3 @@ var RESIZE_START = 0; | ||
var _ref = props, | ||
_ref$prefixCls = _ref.prefixCls, | ||
prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls, | ||
prefixCls = _ref.prefixCls, | ||
onPressEnter = _ref.onPressEnter, | ||
@@ -25,0 +24,0 @@ defaultValue = _ref.defaultValue, |
@@ -14,3 +14,8 @@ import React from 'react'; | ||
showCount?: boolean | import("rc-input/lib/interface").ShowCountProps; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix" | "affixWrapperClassName"> & React.RefAttributes<TextAreaRef>>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix"> & React.RefAttributes<TextAreaRef>>; | ||
export default TextArea; |
@@ -6,3 +6,3 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
var _excluded = ["defaultValue", "value", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "affixWrapperClassName", "showCount", "className", "style", "disabled"]; | ||
var _excluded = ["defaultValue", "value", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "classes", "showCount", "className", "style", "disabled"]; | ||
import classNames from 'classnames'; | ||
@@ -44,3 +44,3 @@ import { BaseInput } from 'rc-input'; | ||
prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls, | ||
affixWrapperClassName = _ref.affixWrapperClassName, | ||
classes = _ref.classes, | ||
showCount = _ref.showCount, | ||
@@ -160,4 +160,8 @@ className = _ref.className, | ||
prefixCls: prefixCls, | ||
affixWrapperClassName: affixWrapperClassName, | ||
affixWrapperClassName: classes === null || classes === void 0 ? void 0 : classes.affixWrapper, | ||
disabled: disabled, | ||
style: style, | ||
inputStyle: { | ||
resize: style === null || style === void 0 ? void 0 : style.resize | ||
}, | ||
inputElement: /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, rest, { | ||
@@ -169,7 +173,6 @@ onKeyDown: handleKeyDown, | ||
maxLength: maxLength, | ||
className: showCount ? className : '', | ||
style: showCount ? { | ||
resize: style === null || style === void 0 ? void 0 : style.resize | ||
} : style, | ||
className: classNames(showCount ? '' : className, classes === null || classes === void 0 ? void 0 : classes.textarea), | ||
style: !showCount && style, | ||
disabled: disabled, | ||
prefixCls: prefixCls, | ||
ref: resizableTextAreaRef | ||
@@ -182,3 +185,3 @@ })) | ||
var dataCount = ''; | ||
var dataCount; | ||
@@ -197,3 +200,3 @@ if (_typeof(showCount) === 'object') { | ||
hidden: rest.hidden, | ||
className: classNames("".concat(prefixCls, "-show-count"), className), | ||
className: classNames("".concat(prefixCls, "-show-count"), className, classes === null || classes === void 0 ? void 0 : classes.countWrapper), | ||
style: style, | ||
@@ -200,0 +203,0 @@ "data-count": dataCount |
@@ -22,3 +22,8 @@ import type { BaseInputProps, ShowCountProps } from 'rc-input/lib/interface'; | ||
showCount?: boolean | ShowCountProps; | ||
} & Pick<BaseInputProps, 'allowClear' | 'suffix' | 'affixWrapperClassName'>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<BaseInputProps, 'allowClear' | 'suffix'>; | ||
export declare type TextAreaRef = { | ||
@@ -25,0 +30,0 @@ resizableTextArea: ResizableTextAreaRef; |
import * as React from 'react'; | ||
import { ResizableTextAreaRef } from './interface'; | ||
import type { ResizableTextAreaRef } from './interface'; | ||
declare const ResizableTextArea: React.ForwardRefExoticComponent<Omit<import("./interface").HTMLTextareaProps, "onResize"> & { | ||
@@ -14,3 +14,8 @@ prefixCls?: string; | ||
showCount?: boolean | import("rc-input/lib/interface").ShowCountProps; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix" | "affixWrapperClassName"> & React.RefAttributes<ResizableTextAreaRef>>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix"> & React.RefAttributes<ResizableTextAreaRef>>; | ||
export default ResizableTextArea; |
@@ -24,3 +24,3 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
@@ -31,8 +31,8 @@ var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer")); | ||
var _useMergedState3 = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState")); | ||
var _raf = _interopRequireDefault(require("rc-util/lib/raf")); | ||
var _useMergedState3 = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState")); | ||
var React = _interopRequireWildcard(require("react")); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _calculateNodeHeight = _interopRequireDefault(require("./calculateNodeHeight")); | ||
@@ -51,4 +51,3 @@ | ||
var _ref = props, | ||
_ref$prefixCls = _ref.prefixCls, | ||
prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls, | ||
prefixCls = _ref.prefixCls, | ||
onPressEnter = _ref.onPressEnter, | ||
@@ -55,0 +54,0 @@ defaultValue = _ref.defaultValue, |
@@ -14,3 +14,8 @@ import React from 'react'; | ||
showCount?: boolean | import("rc-input/lib/interface").ShowCountProps; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix" | "affixWrapperClassName"> & React.RefAttributes<TextAreaRef>>; | ||
classes?: { | ||
textarea?: string; | ||
countWrapper?: string; | ||
affixWrapper?: string; | ||
}; | ||
} & Pick<import("rc-input/lib/interface").BaseInputProps, "allowClear" | "suffix"> & React.RefAttributes<TextAreaRef>>; | ||
export default TextArea; |
@@ -34,3 +34,3 @@ "use strict"; | ||
var _excluded = ["defaultValue", "value", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "affixWrapperClassName", "showCount", "className", "style", "disabled"]; | ||
var _excluded = ["defaultValue", "value", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "classes", "showCount", "className", "style", "disabled"]; | ||
@@ -70,3 +70,3 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls, | ||
affixWrapperClassName = _ref.affixWrapperClassName, | ||
classes = _ref.classes, | ||
showCount = _ref.showCount, | ||
@@ -187,4 +187,8 @@ className = _ref.className, | ||
prefixCls: prefixCls, | ||
affixWrapperClassName: affixWrapperClassName, | ||
affixWrapperClassName: classes === null || classes === void 0 ? void 0 : classes.affixWrapper, | ||
disabled: disabled, | ||
style: style, | ||
inputStyle: { | ||
resize: style === null || style === void 0 ? void 0 : style.resize | ||
}, | ||
inputElement: /*#__PURE__*/_react.default.createElement(_ResizableTextArea.default, (0, _extends2.default)({}, rest, { | ||
@@ -196,7 +200,6 @@ onKeyDown: handleKeyDown, | ||
maxLength: maxLength, | ||
className: showCount ? className : '', | ||
style: showCount ? { | ||
resize: style === null || style === void 0 ? void 0 : style.resize | ||
} : style, | ||
className: (0, _classnames.default)(showCount ? '' : className, classes === null || classes === void 0 ? void 0 : classes.textarea), | ||
style: !showCount && style, | ||
disabled: disabled, | ||
prefixCls: prefixCls, | ||
ref: resizableTextAreaRef | ||
@@ -208,3 +211,3 @@ })) | ||
var valueLength = (0, _toConsumableArray2.default)(val).length; | ||
var dataCount = ''; | ||
var dataCount; | ||
@@ -223,3 +226,3 @@ if ((0, _typeof2.default)(showCount) === 'object') { | ||
hidden: rest.hidden, | ||
className: (0, _classnames.default)("".concat(prefixCls, "-show-count"), className), | ||
className: (0, _classnames.default)("".concat(prefixCls, "-show-count"), className, classes === null || classes === void 0 ? void 0 : classes.countWrapper), | ||
style: style, | ||
@@ -226,0 +229,0 @@ "data-count": dataCount |
{ | ||
"name": "rc-textarea", | ||
"version": "1.0.0-1", | ||
"version": "1.0.0-2", | ||
"description": "Pretty Textarea react component used in used in ant.design", | ||
@@ -48,3 +48,3 @@ "keywords": [ | ||
"classnames": "^2.2.1", | ||
"rc-input": "^0.1.4", | ||
"rc-input": "^0.2.1", | ||
"rc-resize-observer": "^1.0.0", | ||
@@ -51,0 +51,0 @@ "rc-util": "^5.27.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
57454
1074
0
+ Addedrc-input@0.2.2(transitive)
- Removedrc-input@0.1.4(transitive)
Updatedrc-input@^0.2.1