@hw-component/form 1.9.59 → 1.9.60
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.
- package/es/TextArea/index.d.ts +4 -1
- package/es/TextArea/index.js +12 -3
- package/es/index.css +6 -0
- package/lib/TextArea/index.d.ts +4 -1
- package/lib/TextArea/index.js +12 -3
- package/lib/index.css +6 -0
- package/package.json +1 -1
- package/src/components/TextArea/index.less +8 -0
- package/src/components/TextArea/index.tsx +11 -2
- package/src/components/styles/index.less +1 -0
- package/src/pages/Input/index.tsx +2 -0
package/es/TextArea/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { TextAreaProps } from "antd/es/input";
|
|
2
|
-
|
|
2
|
+
interface HTextAreaProps extends TextAreaProps {
|
|
3
|
+
bordered?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: ({ autoSize, bordered, className, ...props }: HTextAreaProps) => JSX.Element;
|
|
3
6
|
export default _default;
|
package/es/TextArea/index.js
CHANGED
|
@@ -3,8 +3,9 @@ import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Input } from 'antd';
|
|
6
|
+
import { useClassName } from '../hooks/index.js';
|
|
6
7
|
|
|
7
|
-
var _excluded = ["autoSize"];
|
|
8
|
+
var _excluded = ["autoSize", "bordered", "className"];
|
|
8
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
11
|
var TextArea = (function (_ref) {
|
|
@@ -13,10 +14,18 @@ var TextArea = (function (_ref) {
|
|
|
13
14
|
minRows: 4,
|
|
14
15
|
maxRows: 4
|
|
15
16
|
} : _ref$autoSize,
|
|
17
|
+
_ref$bordered = _ref.bordered,
|
|
18
|
+
bordered = _ref$bordered === void 0 ? true : _ref$bordered,
|
|
19
|
+
_ref$className = _ref.className,
|
|
20
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
16
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
|
|
22
|
+
var noBorderClassName = useClassName("hw-text-area-no-border");
|
|
23
|
+
var borderClassName = !bordered ? noBorderClassName : "";
|
|
24
|
+
return jsx(Input.TextArea, _objectSpread(_objectSpread({
|
|
18
25
|
autoSize: autoSize
|
|
19
|
-
}, props)
|
|
26
|
+
}, props), {}, {
|
|
27
|
+
className: "".concat(borderClassName, " ").concat(className)
|
|
28
|
+
}));
|
|
20
29
|
});
|
|
21
30
|
|
|
22
31
|
export { TextArea as default };
|
package/es/index.css
CHANGED
|
@@ -262,6 +262,12 @@
|
|
|
262
262
|
.ant-hw-switch .ant-hw-switch-after {
|
|
263
263
|
margin-left: 4px;
|
|
264
264
|
}
|
|
265
|
+
.ant-hw-text-area-no-border {
|
|
266
|
+
border: none !important;
|
|
267
|
+
}
|
|
268
|
+
.ant-hw-text-area-no-border:focus {
|
|
269
|
+
box-shadow: none !important;
|
|
270
|
+
}
|
|
265
271
|
.ant-hw-addon {
|
|
266
272
|
display: -webkit-box !important;
|
|
267
273
|
display: -webkit-flex !important;
|
package/lib/TextArea/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { TextAreaProps } from "antd/es/input";
|
|
2
|
-
|
|
2
|
+
interface HTextAreaProps extends TextAreaProps {
|
|
3
|
+
bordered?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: ({ autoSize, bordered, className, ...props }: HTextAreaProps) => JSX.Element;
|
|
3
6
|
export default _default;
|
package/lib/TextArea/index.js
CHANGED
|
@@ -6,8 +6,9 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var antd = require('antd');
|
|
9
|
+
var index = require('../hooks/index.js');
|
|
9
10
|
|
|
10
|
-
var _excluded = ["autoSize"];
|
|
11
|
+
var _excluded = ["autoSize", "bordered", "className"];
|
|
11
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
14
|
var TextArea = (function (_ref) {
|
|
@@ -16,10 +17,18 @@ var TextArea = (function (_ref) {
|
|
|
16
17
|
minRows: 4,
|
|
17
18
|
maxRows: 4
|
|
18
19
|
} : _ref$autoSize,
|
|
20
|
+
_ref$bordered = _ref.bordered,
|
|
21
|
+
bordered = _ref$bordered === void 0 ? true : _ref$bordered,
|
|
22
|
+
_ref$className = _ref.className,
|
|
23
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
19
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
|
|
25
|
+
var noBorderClassName = index.useClassName("hw-text-area-no-border");
|
|
26
|
+
var borderClassName = !bordered ? noBorderClassName : "";
|
|
27
|
+
return jsxRuntime.jsx(antd.Input.TextArea, _objectSpread(_objectSpread({
|
|
21
28
|
autoSize: autoSize
|
|
22
|
-
}, props)
|
|
29
|
+
}, props), {}, {
|
|
30
|
+
className: "".concat(borderClassName, " ").concat(className)
|
|
31
|
+
}));
|
|
23
32
|
});
|
|
24
33
|
|
|
25
34
|
exports.default = TextArea;
|
package/lib/index.css
CHANGED
|
@@ -262,6 +262,12 @@
|
|
|
262
262
|
.ant-hw-switch .ant-hw-switch-after {
|
|
263
263
|
margin-left: 4px;
|
|
264
264
|
}
|
|
265
|
+
.ant-hw-text-area-no-border {
|
|
266
|
+
border: none !important;
|
|
267
|
+
}
|
|
268
|
+
.ant-hw-text-area-no-border:focus {
|
|
269
|
+
box-shadow: none !important;
|
|
270
|
+
}
|
|
265
271
|
.ant-hw-addon {
|
|
266
272
|
display: -webkit-box !important;
|
|
267
273
|
display: -webkit-flex !important;
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Input } from "antd";
|
|
2
2
|
import type { TextAreaProps } from "antd/es/input";
|
|
3
|
+
import {useClassName} from "../hooks";
|
|
4
|
+
interface HTextAreaProps extends TextAreaProps{
|
|
5
|
+
bordered?:boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
export default ({
|
|
4
9
|
autoSize = { minRows: 4, maxRows: 4 },
|
|
10
|
+
bordered=true,
|
|
11
|
+
className="",
|
|
5
12
|
...props
|
|
6
|
-
}:
|
|
7
|
-
|
|
13
|
+
}: HTextAreaProps) => {
|
|
14
|
+
const noBorderClassName=useClassName("hw-text-area-no-border") ;
|
|
15
|
+
const borderClassName=!bordered?noBorderClassName:"";
|
|
16
|
+
return <Input.TextArea autoSize={autoSize} {...props} className={`${borderClassName} ${className}`}/>;
|
|
8
17
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
HColorInput,
|
|
7
7
|
HVerificationCodeInput,
|
|
8
8
|
HInputNumberGroup,
|
|
9
|
+
HTextArea,
|
|
9
10
|
} from "../../components";
|
|
10
11
|
import { Space } from "antd";
|
|
11
12
|
import { useState } from "react";
|
|
@@ -36,6 +37,7 @@ export default () => {
|
|
|
36
37
|
},
|
|
37
38
|
]}
|
|
38
39
|
/>
|
|
40
|
+
<HTextArea />
|
|
39
41
|
</Space>
|
|
40
42
|
);
|
|
41
43
|
};
|