@kaiheila/ui-components 0.1.15 → 0.1.16

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/dist/main.css CHANGED
@@ -1296,7 +1296,6 @@ body .__react_component_tooltip.type-dark.place-right:after {
1296
1296
  border: 2px solid var(--text-tip-color);
1297
1297
  cursor: pointer;
1298
1298
  transition: 0.3s ease-out all;
1299
- top: -1px;
1300
1299
  }
1301
1300
  /*adding a wide width for larger switch text*/
1302
1301
  .ui-switch.wide {
@@ -1437,18 +1436,19 @@ body .__react_component_tooltip.type-dark.place-right:after {
1437
1436
  position: relative;
1438
1437
  border: 1px solid var(--border-color);
1439
1438
  border-radius: 12px;
1439
+ padding: 12px 16px;
1440
1440
  }
1441
- .textarea-box.show-max-length textarea {
1442
- padding-right: 24px;
1441
+ .textarea-box.show-max-length {
1442
+ padding-bottom: 30px;
1443
1443
  }
1444
1444
  .textarea-box textarea {
1445
+ padding: 0;
1446
+ margin: 0;
1445
1447
  width: 100%;
1446
1448
  height: 70px;
1447
- padding: 8px 0 0 16px;
1448
1449
  border: none;
1449
1450
  background-color: initial;
1450
1451
  color: inherit;
1451
- margin-top: 1px;
1452
1452
  line-height: 1.5;
1453
1453
  resize: none;
1454
1454
  }
@@ -1477,10 +1477,13 @@ body .__react_component_tooltip.type-dark.place-right:after {
1477
1477
  font-family: "Helvetica Neue", "Helvetica", "Arial", "sans-serif";
1478
1478
  position: absolute;
1479
1479
  bottom: 7px;
1480
- right: 12px;
1480
+ right: 16px;
1481
1481
  font-size: 12px;
1482
1482
  color: var(--text-tip-color);
1483
1483
  }
1484
+ .textarea-box .footer.error {
1485
+ color: var(--color-error);
1486
+ }
1484
1487
  .textarea-box.size-sm {
1485
1488
  border-width: 0px;
1486
1489
  }
@@ -2803,7 +2803,7 @@ module.exports = require("react-dom");
2803
2803
  /* 6 */
2804
2804
  /***/ (function(module) {
2805
2805
 
2806
- module.exports = JSON.parse("{\"name\":\"@kaiheila/ui-components\",\"version\":\"0.1.14\",\"description\":\"开黑啦 UI Components\",\"main\":\"dist/ui-components.js\",\"scripts\":{\"build\":\"webpack\",\"demo\":\"webpack-dev-server --config webpack.config.demo.js\"},\"keywords\":[\"UI\",\"Components\"],\"author\":\"yangchuan\",\"license\":\"ISC\",\"files\":[\"dist\"],\"devDependencies\":{\"@babel/core\":\"^7.15.5\",\"@babel/preset-env\":\"^7.15.6\",\"@babel/preset-react\":\"^7.14.5\",\"@webpack-cli/serve\":\"^1.6.0\",\"babel-loader\":\"^8.2.2\",\"classnames\":\"^2.3.1\",\"css-loader\":\"^2.1.1\",\"html-webpack-plugin\":\"^4.5.2\",\"less\":\"^4.1.2\",\"less-loader\":\"^5.0.0\",\"mini-css-extract-plugin\":\"^0.8.0\",\"prop-types\":\"^15.7.2\",\"react\":\"^16.9.0\",\"react-dom\":\"^16.9.0\",\"react-tooltip\":\"^4.2.21\",\"style-loader\":\"^1.0.0\",\"url-loader\":\"^2.1.0\",\"webpack\":\"^4.40.2\",\"webpack-cli\":\"^3.3.1\",\"webpack-dev-server\":\"^3.2.1\"},\"peerDependencies\":{\"react\":\"^16.9.0\",\"react-dom\":\"^16.9.0\"},\"browserslist\":{\"production\":[\">0.2%\",\"not dead\",\"not op_mini all\"],\"development\":[\"last 1 chrome version\",\"last 1 firefox version\",\"last 1 safari version\"]}}");
2806
+ module.exports = JSON.parse("{\"name\":\"@kaiheila/ui-components\",\"version\":\"0.1.15\",\"description\":\"开黑啦 UI Components\",\"main\":\"dist/ui-components.js\",\"scripts\":{\"build\":\"webpack\",\"demo\":\"webpack-dev-server --config webpack.config.demo.js\"},\"keywords\":[\"UI\",\"Components\"],\"author\":\"yangchuan\",\"license\":\"ISC\",\"files\":[\"dist\"],\"devDependencies\":{\"@babel/core\":\"^7.15.5\",\"@babel/preset-env\":\"^7.15.6\",\"@babel/preset-react\":\"^7.14.5\",\"@webpack-cli/serve\":\"^1.6.0\",\"babel-loader\":\"^8.2.2\",\"classnames\":\"^2.3.1\",\"css-loader\":\"^2.1.1\",\"html-webpack-plugin\":\"^4.5.2\",\"less\":\"^4.1.2\",\"less-loader\":\"^5.0.0\",\"mini-css-extract-plugin\":\"^0.8.0\",\"prop-types\":\"^15.7.2\",\"react\":\"^16.9.0\",\"react-dom\":\"^16.9.0\",\"react-tooltip\":\"^4.2.21\",\"style-loader\":\"^1.0.0\",\"url-loader\":\"^2.1.0\",\"webpack\":\"^4.40.2\",\"webpack-cli\":\"^3.3.1\",\"webpack-dev-server\":\"^3.2.1\"},\"peerDependencies\":{\"react\":\"^16.9.0\",\"react-dom\":\"^16.9.0\"},\"browserslist\":{\"production\":[\">0.2%\",\"not dead\",\"not op_mini all\"],\"development\":[\"last 1 chrome version\",\"last 1 firefox version\",\"last 1 safari version\"]}}");
2807
2807
 
2808
2808
  /***/ }),
2809
2809
  /* 7 */
@@ -4819,7 +4819,8 @@ var search_input_SearchInput = /*#__PURE__*/function (_Component) {
4819
4819
  _this$props$size = _this$props.size,
4820
4820
  size = _this$props$size === void 0 ? '' : _this$props$size,
4821
4821
  _this$props$type = _this$props.type,
4822
- type = _this$props$type === void 0 ? '' : _this$props$type;
4822
+ type = _this$props$type === void 0 ? '' : _this$props$type,
4823
+ maxLength = _this$props.maxLength;
4823
4824
  return /*#__PURE__*/external_react_default.a.createElement("div", {
4824
4825
  className: external_classnames_default()('search-input', size, type, {
4825
4826
  'active': isFocus
@@ -4827,6 +4828,7 @@ var search_input_SearchInput = /*#__PURE__*/function (_Component) {
4827
4828
  }, /*#__PURE__*/external_react_default.a.createElement("input", {
4828
4829
  ref: this.refInput,
4829
4830
  value: value,
4831
+ maxLength: maxLength,
4830
4832
  onChange: this.onChange,
4831
4833
  onBlur: function onBlur() {
4832
4834
  return _this2.onFocusChange(false);
@@ -6876,7 +6878,7 @@ var textarea_Textarea = /*#__PURE__*/function (_Component) {
6876
6878
  _this.props.onChange && _this.props.onChange(value);
6877
6879
  });
6878
6880
 
6879
- _this.maxLength = 512;
6881
+ _this.maxLength = 500;
6880
6882
  _this.state = {
6881
6883
  focus: false,
6882
6884
  value: props.value
@@ -6910,12 +6912,14 @@ var textarea_Textarea = /*#__PURE__*/function (_Component) {
6910
6912
  size = _this$props$size === void 0 ? '' : _this$props$size,
6911
6913
  disabled = _this$props.disabled,
6912
6914
  _this$props$themeFocu = _this$props.themeFocus,
6913
- themeFocus = _this$props$themeFocu === void 0 ? true : _this$props$themeFocu;
6915
+ themeFocus = _this$props$themeFocu === void 0 ? true : _this$props$themeFocu,
6916
+ _this$props$maxLength = _this$props.maxLength,
6917
+ maxLength = _this$props$maxLength === void 0 ? this.maxLength : _this$props$maxLength;
6914
6918
  var _this$state = this.state,
6915
6919
  focus = _this$state.focus,
6916
6920
  _this$state$value = _this$state.value,
6917
6921
  value = _this$state$value === void 0 ? '' : _this$state$value;
6918
- var length = (this.props.maxLength || this.maxLength) - value.length;
6922
+ var lengthLimit = value.length >= maxLength;
6919
6923
  return /*#__PURE__*/external_react_default.a.createElement("div", {
6920
6924
  className: external_classnames_default()('textarea-box', className, size ? "size-".concat(size) : '', {
6921
6925
  'theme-focus': themeFocus && focus,
@@ -6934,8 +6938,10 @@ var textarea_Textarea = /*#__PURE__*/function (_Component) {
6934
6938
  onCompositionStart: this.onCompositionStart,
6935
6939
  onCompositionEnd: this.onCompositionEnd
6936
6940
  }), showMaxLength && /*#__PURE__*/external_react_default.a.createElement("div", {
6937
- className: "footer"
6938
- }, Math.max(0, length)));
6941
+ className: external_classnames_default()('footer', {
6942
+ error: lengthLimit
6943
+ })
6944
+ }, value.length, "/", maxLength));
6939
6945
  }
6940
6946
  }]);
6941
6947
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaiheila/ui-components",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "开黑啦 UI Components",
5
5
  "main": "dist/ui-components.js",
6
6
  "scripts": {