assui 3.2.86 → 3.2.87

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.
@@ -3,10 +3,23 @@ import type { NumberInputProps } from '../number-input';
3
3
  export interface LabelNumberInputProps extends NumberInputProps {
4
4
  /** label 标签的文本 */
5
5
  label?: React.ReactNode;
6
+ /** label 是否省略 */
7
+ labelEllipsis?: false;
6
8
  /** 输入框除去label之后的最小末尾宽度 */
7
9
  baseMinWidth?: number;
8
10
  /** 组件dom id */
9
11
  id?: string;
10
12
  }
11
- declare const LabelNumberInput: (props: LabelNumberInputProps) => JSX.Element;
13
+ /** 当label需要省略时,label为string且必填 */
14
+ export interface LabelNumberInputEllipsisProps extends NumberInputProps {
15
+ /** label 标签的文本 */
16
+ label: string;
17
+ /** label 是否省略 */
18
+ labelEllipsis: true;
19
+ /** 输入框除去label之后的最小末尾宽度 */
20
+ baseMinWidth?: number;
21
+ /** 组件dom id */
22
+ id?: string;
23
+ }
24
+ declare const LabelNumberInput: (props: LabelNumberInputProps | LabelNumberInputEllipsisProps) => JSX.Element;
12
25
  export default LabelNumberInput;
@@ -37,11 +37,13 @@ import isUndefined from 'lodash/isUndefined';
37
37
  import classNames from 'classnames';
38
38
  import omit from 'lodash/omit';
39
39
  import NumberInput from '../number-input';
40
+ import MultiLineEllipsisText from '../multi-line-ellipsis-text';
40
41
  var LabelNumberInput = function LabelNumberInput(props) {
41
42
  var className = props.className,
42
43
  label = props.label,
43
44
  onBlur = props.onBlur,
44
45
  onFocus = props.onFocus,
46
+ labelEllipsis = props.labelEllipsis,
45
47
  id = props.id,
46
48
  _a = props.baseMinWidth,
47
49
  baseMinWidth = _a === void 0 ? 50 : _a;
@@ -88,7 +90,13 @@ var LabelNumberInput = function LabelNumberInput(props) {
88
90
  onChange: function onChange(inputValue) {
89
91
  return setValue(inputValue);
90
92
  }
91
- })), /*#__PURE__*/React.createElement("label", {
93
+ })), labelEllipsis ? /*#__PURE__*/React.createElement(MultiLineEllipsisText, {
94
+ text: label,
95
+ lines: 1,
96
+ tipType: "tooltip",
97
+ className: "label-number-input-ellipsis",
98
+ onClick: handleLabelClick
99
+ }) : /*#__PURE__*/React.createElement("label", {
92
100
  className: "label-number-input-text",
93
101
  onClick: handleLabelClick
94
102
  }, label)));
@@ -1251,7 +1251,9 @@ html {
1251
1251
  outline: 0;
1252
1252
  }
1253
1253
  .label-number-input-warper .label-number-input:focus + label,
1254
- .label-number-input-warper .label-number-input:not([data-value='0']) + label {
1254
+ .label-number-input-warper .label-number-input:not([data-value='0']) + label,
1255
+ .label-number-input-warper .label-number-input:focus + div,
1256
+ .label-number-input-warper .label-number-input:not([data-value='0']) + div {
1255
1257
  transform: translateY(-8px) scale(0.8);
1256
1258
  }
1257
1259
  .label-number-input-warper .label-number-input-field {
@@ -1280,3 +1282,24 @@ html {
1280
1282
  cursor: text;
1281
1283
  transition: all 0.2s ease-out;
1282
1284
  }
1285
+ .label-number-input-warper .label-number-input-ellipsis {
1286
+ position: absolute;
1287
+ top: 12px;
1288
+ left: 16px;
1289
+ z-index: 2;
1290
+ width: 85%;
1291
+ /* 必须设置固定宽度 */
1292
+ height: 20px;
1293
+ overflow: hidden;
1294
+ /* 溢出隐藏 */
1295
+ color: #9e9e9e;
1296
+ font-size: 14px;
1297
+ line-height: 20px;
1298
+ white-space: nowrap;
1299
+ /* 强制不换行 */
1300
+ text-overflow: ellipsis;
1301
+ /* 超出部分显示省略号 */
1302
+ transform-origin: top left;
1303
+ cursor: text;
1304
+ transition: all 0.2s ease-out;
1305
+ }
@@ -1 +1,2 @@
1
1
  import './index.less';
2
+ import '../../multi-line-ellipsis-text/style';
@@ -1 +1,2 @@
1
- import './index.less';
1
+ import './index.less';
2
+ import '../../multi-line-ellipsis-text/style';
@@ -19,7 +19,9 @@
19
19
  outline: 0;
20
20
 
21
21
  &:focus + label,
22
- &:not([data-value='0']) + label {
22
+ &:not([data-value='0']) + label,
23
+ &:focus + div,
24
+ &:not([data-value='0']) + div {
23
25
  transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
24
26
  }
25
27
 
@@ -52,5 +54,26 @@
52
54
  cursor: text;
53
55
  transition: all 0.2s ease-out;
54
56
  }
57
+
58
+ &-ellipsis {
59
+ position: absolute;
60
+ top: 12px;
61
+ left: 16px;
62
+ z-index: 2;
63
+ width: 85%; /* 必须设置固定宽度 */
64
+ height: 20px;
65
+ overflow: hidden; /* 溢出隐藏 */
66
+ color: @color_9aa5b5;
67
+ font-size: @font-size-base;
68
+ line-height: 20px;
69
+ white-space: nowrap; /* 强制不换行 */
70
+ text-overflow: ellipsis; /* 超出部分显示省略号 */
71
+ transform-origin: top left;
72
+ cursor: text;
73
+ transition: all 0.2s ease-out;
74
+ }
55
75
  }
76
+
56
77
  }
78
+
79
+
@@ -3,10 +3,23 @@ import type { NumberInputProps } from '../number-input';
3
3
  export interface LabelNumberInputProps extends NumberInputProps {
4
4
  /** label 标签的文本 */
5
5
  label?: React.ReactNode;
6
+ /** label 是否省略 */
7
+ labelEllipsis?: false;
6
8
  /** 输入框除去label之后的最小末尾宽度 */
7
9
  baseMinWidth?: number;
8
10
  /** 组件dom id */
9
11
  id?: string;
10
12
  }
11
- declare const LabelNumberInput: (props: LabelNumberInputProps) => JSX.Element;
13
+ /** 当label需要省略时,label为string且必填 */
14
+ export interface LabelNumberInputEllipsisProps extends NumberInputProps {
15
+ /** label 标签的文本 */
16
+ label: string;
17
+ /** label 是否省略 */
18
+ labelEllipsis: true;
19
+ /** 输入框除去label之后的最小末尾宽度 */
20
+ baseMinWidth?: number;
21
+ /** 组件dom id */
22
+ id?: string;
23
+ }
24
+ declare const LabelNumberInput: (props: LabelNumberInputProps | LabelNumberInputEllipsisProps) => JSX.Element;
12
25
  export default LabelNumberInput;
@@ -47,11 +47,13 @@ var isUndefined_1 = __importDefault(require("lodash/isUndefined"));
47
47
  var classnames_1 = __importDefault(require("classnames"));
48
48
  var omit_1 = __importDefault(require("lodash/omit"));
49
49
  var number_input_1 = __importDefault(require("../number-input"));
50
+ var multi_line_ellipsis_text_1 = __importDefault(require("../multi-line-ellipsis-text"));
50
51
  var LabelNumberInput = function LabelNumberInput(props) {
51
52
  var className = props.className,
52
53
  label = props.label,
53
54
  onBlur = props.onBlur,
54
55
  onFocus = props.onFocus,
56
+ labelEllipsis = props.labelEllipsis,
55
57
  id = props.id,
56
58
  _a = props.baseMinWidth,
57
59
  baseMinWidth = _a === void 0 ? 50 : _a;
@@ -98,7 +100,13 @@ var LabelNumberInput = function LabelNumberInput(props) {
98
100
  onChange: function onChange(inputValue) {
99
101
  return setValue(inputValue);
100
102
  }
101
- })), react_1["default"].createElement("label", {
103
+ })), labelEllipsis ? react_1["default"].createElement(multi_line_ellipsis_text_1["default"], {
104
+ text: label,
105
+ lines: 1,
106
+ tipType: "tooltip",
107
+ className: "label-number-input-ellipsis",
108
+ onClick: handleLabelClick
109
+ }) : react_1["default"].createElement("label", {
102
110
  className: "label-number-input-text",
103
111
  onClick: handleLabelClick
104
112
  }, label)));
@@ -1251,7 +1251,9 @@ html {
1251
1251
  outline: 0;
1252
1252
  }
1253
1253
  .label-number-input-warper .label-number-input:focus + label,
1254
- .label-number-input-warper .label-number-input:not([data-value='0']) + label {
1254
+ .label-number-input-warper .label-number-input:not([data-value='0']) + label,
1255
+ .label-number-input-warper .label-number-input:focus + div,
1256
+ .label-number-input-warper .label-number-input:not([data-value='0']) + div {
1255
1257
  transform: translateY(-8px) scale(0.8);
1256
1258
  }
1257
1259
  .label-number-input-warper .label-number-input-field {
@@ -1280,3 +1282,24 @@ html {
1280
1282
  cursor: text;
1281
1283
  transition: all 0.2s ease-out;
1282
1284
  }
1285
+ .label-number-input-warper .label-number-input-ellipsis {
1286
+ position: absolute;
1287
+ top: 12px;
1288
+ left: 16px;
1289
+ z-index: 2;
1290
+ width: 85%;
1291
+ /* 必须设置固定宽度 */
1292
+ height: 20px;
1293
+ overflow: hidden;
1294
+ /* 溢出隐藏 */
1295
+ color: #9e9e9e;
1296
+ font-size: 14px;
1297
+ line-height: 20px;
1298
+ white-space: nowrap;
1299
+ /* 强制不换行 */
1300
+ text-overflow: ellipsis;
1301
+ /* 超出部分显示省略号 */
1302
+ transform-origin: top left;
1303
+ cursor: text;
1304
+ transition: all 0.2s ease-out;
1305
+ }
@@ -1 +1,2 @@
1
1
  import './index.less';
2
+ import '../../multi-line-ellipsis-text/style';
@@ -3,4 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- require("./index.less");
6
+ require("./index.less");
7
+ require("../../multi-line-ellipsis-text/style");
@@ -19,7 +19,9 @@
19
19
  outline: 0;
20
20
 
21
21
  &:focus + label,
22
- &:not([data-value='0']) + label {
22
+ &:not([data-value='0']) + label,
23
+ &:focus + div,
24
+ &:not([data-value='0']) + div {
23
25
  transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
24
26
  }
25
27
 
@@ -52,5 +54,26 @@
52
54
  cursor: text;
53
55
  transition: all 0.2s ease-out;
54
56
  }
57
+
58
+ &-ellipsis {
59
+ position: absolute;
60
+ top: 12px;
61
+ left: 16px;
62
+ z-index: 2;
63
+ width: 85%; /* 必须设置固定宽度 */
64
+ height: 20px;
65
+ overflow: hidden; /* 溢出隐藏 */
66
+ color: @color_9aa5b5;
67
+ font-size: @font-size-base;
68
+ line-height: 20px;
69
+ white-space: nowrap; /* 强制不换行 */
70
+ text-overflow: ellipsis; /* 超出部分显示省略号 */
71
+ transform-origin: top left;
72
+ cursor: text;
73
+ transition: all 0.2s ease-out;
74
+ }
55
75
  }
76
+
56
77
  }
78
+
79
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "3.2.86",
3
+ "version": "3.2.87",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",