@qn-pandora/pandora-component 2.1.2 → 3.0.0

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.
Files changed (121) hide show
  1. package/CHANGELOG.json +25 -0
  2. package/CHANGELOG.md +11 -0
  3. package/es/components/AutoComplete/style.css +17 -13
  4. package/es/components/Button/style.css +2 -3
  5. package/es/components/Button/style.less +0 -1
  6. package/es/components/Card/index.js +2 -1
  7. package/es/components/CheckTransformList/Item/index.js +1 -1
  8. package/es/components/CheckTransformList/style.css +25 -17
  9. package/es/components/CheckboxList/index.d.ts +1 -0
  10. package/es/components/CheckboxList/index.js +3 -2
  11. package/es/components/Collapse/index.js +2 -1
  12. package/es/components/CollapsiblePanel/index.d.ts +2 -2
  13. package/es/components/ConfigProvider/index.js +2 -1
  14. package/es/components/DateTimePicker/Base/index.js +2 -2
  15. package/es/components/DateTimePicker/Base/style.css +13 -13
  16. package/es/components/DateTimePicker/BaseMobile/index.d.ts +1 -0
  17. package/es/components/DateTimePicker/BaseMobile/index.js +2 -2
  18. package/es/components/DateTimePicker/DisplayInput/style.css +16 -16
  19. package/es/components/DateTimePicker/index.d.ts +6 -1
  20. package/es/components/DateTimePicker/index.js +2 -2
  21. package/es/components/Input/NumberInput/index.d.ts +29 -0
  22. package/es/components/Input/NumberInput/index.js +116 -0
  23. package/es/components/Input/index.d.ts +1 -0
  24. package/es/components/Input/index.js +4 -1
  25. package/es/components/Input/style.css +19 -16
  26. package/es/components/Input/style.less +4 -0
  27. package/es/components/InputNumber/style.css +6 -6
  28. package/es/components/Menu/index.d.ts +2 -2
  29. package/es/components/NameLimiter/index.d.ts +3 -13
  30. package/es/components/NameLimiter/index.js +30 -39
  31. package/es/components/NameLimiter/style.css +9 -1
  32. package/es/components/NameLimiter/style.less +10 -1
  33. package/es/components/OptionList/index.js +2 -1
  34. package/es/components/RangeInput/style.css +22 -22
  35. package/es/components/RemarkName/index.d.ts +0 -2
  36. package/es/components/RemarkName/index.js +2 -4
  37. package/es/components/RemarkName/style.css +9 -5
  38. package/es/components/RemarkName/style.less +0 -5
  39. package/es/components/Selector/style.css +17 -13
  40. package/es/components/Selector/style.less +7 -3
  41. package/es/components/SolidRadioGroup/index.d.ts +3 -2
  42. package/es/components/SolidRadioGroup/index.js +7 -4
  43. package/es/components/SolidRadioGroup/style.css +13 -6
  44. package/es/components/SolidRadioGroup/style.less +16 -3
  45. package/es/components/Steps/index.js +2 -1
  46. package/es/components/Table/index.d.ts +9 -24
  47. package/es/components/Table/index.js +40 -8
  48. package/es/components/Table/style.css +11 -8
  49. package/es/components/Table/style.less +6 -0
  50. package/es/components/TagList/Tag/style.css +3 -3
  51. package/es/components/TagList/Tag/style.less +3 -3
  52. package/es/components/TagList/index.js +3 -2
  53. package/es/components/TagList/style.css +3 -3
  54. package/es/components/TagList/style.less +8 -8
  55. package/es/index.css +1804 -1784
  56. package/es/index.d.ts +2 -2
  57. package/es/index.js +1 -1
  58. package/es/index.less +2 -2
  59. package/es/style/theme.less +9 -7
  60. package/lib/components/AutoComplete/style.css +17 -13
  61. package/lib/components/Button/style.css +2 -3
  62. package/lib/components/Button/style.less +0 -1
  63. package/lib/components/Card/index.js +1 -1
  64. package/lib/components/CheckTransformList/Item/index.js +1 -1
  65. package/lib/components/CheckTransformList/style.css +25 -17
  66. package/lib/components/CheckboxList/index.d.ts +1 -0
  67. package/lib/components/CheckboxList/index.js +3 -2
  68. package/lib/components/Collapse/index.js +1 -1
  69. package/lib/components/CollapsiblePanel/index.d.ts +2 -2
  70. package/lib/components/ConfigProvider/index.js +1 -1
  71. package/lib/components/DateTimePicker/Base/index.js +2 -2
  72. package/lib/components/DateTimePicker/Base/style.css +13 -13
  73. package/lib/components/DateTimePicker/BaseMobile/index.d.ts +1 -0
  74. package/lib/components/DateTimePicker/BaseMobile/index.js +2 -2
  75. package/lib/components/DateTimePicker/DisplayInput/style.css +16 -16
  76. package/lib/components/DateTimePicker/index.d.ts +6 -1
  77. package/lib/components/DateTimePicker/index.js +2 -2
  78. package/lib/components/Input/NumberInput/index.d.ts +29 -0
  79. package/lib/components/Input/NumberInput/index.js +121 -0
  80. package/lib/components/Input/index.d.ts +1 -0
  81. package/lib/components/Input/index.js +3 -1
  82. package/lib/components/Input/style.css +19 -16
  83. package/lib/components/Input/style.less +4 -0
  84. package/lib/components/InputNumber/style.css +6 -6
  85. package/lib/components/Menu/index.d.ts +2 -2
  86. package/lib/components/NameLimiter/index.d.ts +3 -13
  87. package/lib/components/NameLimiter/index.js +30 -38
  88. package/lib/components/NameLimiter/style.css +9 -1
  89. package/lib/components/NameLimiter/style.less +10 -1
  90. package/lib/components/OptionList/index.js +1 -1
  91. package/lib/components/RangeInput/style.css +22 -22
  92. package/lib/components/RemarkName/index.d.ts +0 -2
  93. package/lib/components/RemarkName/index.js +2 -4
  94. package/lib/components/RemarkName/style.css +9 -5
  95. package/lib/components/RemarkName/style.less +0 -5
  96. package/lib/components/Selector/style.css +17 -13
  97. package/lib/components/Selector/style.less +7 -3
  98. package/lib/components/SolidRadioGroup/index.d.ts +3 -2
  99. package/lib/components/SolidRadioGroup/index.js +6 -3
  100. package/lib/components/SolidRadioGroup/style.css +13 -6
  101. package/lib/components/SolidRadioGroup/style.less +16 -3
  102. package/lib/components/Steps/index.js +1 -1
  103. package/lib/components/Table/index.d.ts +9 -24
  104. package/lib/components/Table/index.js +39 -7
  105. package/lib/components/Table/style.css +11 -8
  106. package/lib/components/Table/style.less +6 -0
  107. package/lib/components/TagList/Tag/style.css +3 -3
  108. package/lib/components/TagList/Tag/style.less +3 -3
  109. package/lib/components/TagList/index.js +2 -2
  110. package/lib/components/TagList/style.css +3 -3
  111. package/lib/components/TagList/style.less +8 -8
  112. package/lib/index.css +116 -96
  113. package/lib/index.d.ts +2 -2
  114. package/lib/index.js +0 -1
  115. package/lib/index.less +2 -2
  116. package/lib/style/theme.less +9 -7
  117. package/package.json +23 -23
  118. package/es/components/NameLimiter/transformer.d.ts +0 -6
  119. package/es/components/NameLimiter/transformer.js +0 -84
  120. package/lib/components/NameLimiter/transformer.d.ts +0 -6
  121. package/lib/components/NameLimiter/transformer.js +0 -91
@@ -13,7 +13,7 @@
13
13
  line-height: 1.5715;
14
14
  background-color: transparent;
15
15
  background-image: none;
16
- border: 1px solid #d9d9d9;
16
+ border: 1px solid #bfbfbf;
17
17
  border-radius: 2px;
18
18
  -webkit-transition: all 0.3s;
19
19
  transition: all 0.3s;
@@ -64,7 +64,7 @@
64
64
  opacity: 1;
65
65
  }
66
66
  .ant-input-affix-wrapper-disabled:hover {
67
- border-color: #d9d9d9;
67
+ border-color: #bfbfbf;
68
68
  border-right-width: 1px !important;
69
69
  }
70
70
  .ant-input-affix-wrapper[disabled] {
@@ -74,7 +74,7 @@
74
74
  opacity: 1;
75
75
  }
76
76
  .ant-input-affix-wrapper[disabled]:hover {
77
- border-color: #d9d9d9;
77
+ border-color: #bfbfbf;
78
78
  border-right-width: 1px !important;
79
79
  }
80
80
  .ant-input-affix-wrapper-borderless,
@@ -98,7 +98,7 @@ textarea.ant-input-affix-wrapper {
98
98
  transition: all 0.3s, height 0s;
99
99
  }
100
100
  .ant-input-affix-wrapper-lg {
101
- padding: 2.5px 11px;
101
+ padding: 6.5px 11px;
102
102
  font-size: 16px;
103
103
  }
104
104
  .ant-input-affix-wrapper-sm {
@@ -209,7 +209,7 @@ textarea.ant-input-affix-wrapper {
209
209
  line-height: 1.5715;
210
210
  background-color: transparent;
211
211
  background-image: none;
212
- border: 1px solid #d9d9d9;
212
+ border: 1px solid #bfbfbf;
213
213
  border-radius: 2px;
214
214
  -webkit-transition: all 0.3s;
215
215
  transition: all 0.3s;
@@ -257,7 +257,7 @@ textarea.ant-input-affix-wrapper {
257
257
  opacity: 1;
258
258
  }
259
259
  .ant-input-disabled:hover {
260
- border-color: #d9d9d9;
260
+ border-color: #bfbfbf;
261
261
  border-right-width: 1px !important;
262
262
  }
263
263
  .ant-input[disabled] {
@@ -267,7 +267,7 @@ textarea.ant-input-affix-wrapper {
267
267
  opacity: 1;
268
268
  }
269
269
  .ant-input[disabled]:hover {
270
- border-color: #d9d9d9;
270
+ border-color: #bfbfbf;
271
271
  border-right-width: 1px !important;
272
272
  }
273
273
  .ant-input-borderless,
@@ -291,7 +291,7 @@ textarea.ant-input {
291
291
  transition: all 0.3s, height 0s;
292
292
  }
293
293
  .ant-input-lg {
294
- padding: 2.5px 11px;
294
+ padding: 6.5px 11px;
295
295
  font-size: 16px;
296
296
  }
297
297
  .ant-input-sm {
@@ -373,7 +373,7 @@ textarea.ant-input {
373
373
  font-size: 14px;
374
374
  text-align: center;
375
375
  background-color: #fafafa;
376
- border: 1px solid #d9d9d9;
376
+ border: 1px solid #bfbfbf;
377
377
  border-radius: 2px;
378
378
  -webkit-transition: all 0.3s;
379
379
  transition: all 0.3s;
@@ -427,7 +427,7 @@ textarea.ant-input {
427
427
  }
428
428
  .ant-input-group-lg .ant-input,
429
429
  .ant-input-group-lg > .ant-input-group-addon {
430
- padding: 2.5px 11px;
430
+ padding: 6.5px 11px;
431
431
  font-size: 16px;
432
432
  }
433
433
  .ant-input-group-sm .ant-input,
@@ -435,7 +435,7 @@ textarea.ant-input {
435
435
  padding: 1px 7px;
436
436
  }
437
437
  .ant-input-group-lg .ant-select-single .ant-select-selector {
438
- height: 32px;
438
+ height: 40px;
439
439
  }
440
440
  .ant-input-group-sm .ant-select-single .ant-select-selector {
441
441
  height: 26px;
@@ -562,12 +562,12 @@ textarea.ant-input {
562
562
  border-radius: 0 2px 2px 0;
563
563
  }
564
564
  .ant-input-group-rtl .ant-input-group-addon:first-child {
565
- border-right: 1px solid #d9d9d9;
565
+ border-right: 1px solid #bfbfbf;
566
566
  border-left: 0;
567
567
  }
568
568
  .ant-input-group-rtl .ant-input-group-addon:last-child {
569
569
  border-right: 0;
570
- border-left: 1px solid #d9d9d9;
570
+ border-left: 1px solid #bfbfbf;
571
571
  }
572
572
  .ant-input-group-rtl.ant-input-group > .ant-input:last-child,
573
573
  .ant-input-group-rtl.ant-input-group-addon:last-child {
@@ -624,7 +624,7 @@ textarea.ant-input {
624
624
  height: 32px;
625
625
  }
626
626
  .ant-input[type='color'].ant-input-lg {
627
- height: 32px;
627
+ height: 40px;
628
628
  }
629
629
  .ant-input[type='color'].ant-input-sm {
630
630
  height: 26px;
@@ -679,7 +679,7 @@ textarea.ant-input {
679
679
  z-index: 1;
680
680
  }
681
681
  .ant-input-search-large .ant-input-search-button {
682
- height: 32px;
682
+ height: 40px;
683
683
  }
684
684
  .ant-input-search-small .ant-input-search-button {
685
685
  height: 26px;
@@ -738,7 +738,7 @@ textarea.ant-input {
738
738
  height: 32px;
739
739
  }
740
740
  .ant-input-lg {
741
- height: 32px;
741
+ height: 40px;
742
742
  }
743
743
  .ant-input-sm {
744
744
  height: 26px;
@@ -14,11 +14,15 @@ export interface IDateTimePickerProps extends IBaseProps {
14
14
  * 时间组件class name
15
15
  */
16
16
  timeClassName?: string;
17
+ /**
18
+ * 展示组件class name
19
+ */
20
+ contentClassName?: string;
17
21
  }
18
22
  /**
19
23
  * 弹出层时间选择组件封装
20
24
  */
21
- export default class DateTimePicker extends React.Component<IDateTimePickerProps, any> {
25
+ declare class DateTimePicker extends React.Component<IDateTimePickerProps, any> {
22
26
  static Base: typeof Base;
23
27
  static BaseMobile: typeof BaseMobile;
24
28
  visible: boolean;
@@ -27,3 +31,4 @@ export default class DateTimePicker extends React.Component<IDateTimePickerProps
27
31
  handleChange(value: Time): void;
28
32
  render(): JSX.Element;
29
33
  }
34
+ export default DateTimePicker;
@@ -80,11 +80,11 @@ var DateTimePicker = /** @class */ (function (_super) {
80
80
  this.hide();
81
81
  };
82
82
  DateTimePicker.prototype.render = function () {
83
- var _a = this.props, overlayClassName = _a.overlayClassName, getPopupContainer = _a.getPopupContainer, children = _a.children, value = _a.value, showTimeType = _a.showTimeType, timeClassName = _a.timeClassName, restProps = __rest(_a, ["overlayClassName", "getPopupContainer", "children", "value", "showTimeType", "timeClassName"]);
83
+ var _a = this.props, overlayClassName = _a.overlayClassName, getPopupContainer = _a.getPopupContainer, children = _a.children, value = _a.value, showTimeType = _a.showTimeType, timeClassName = _a.timeClassName, contentClassName = _a.contentClassName, restProps = __rest(_a, ["overlayClassName", "getPopupContainer", "children", "value", "showTimeType", "timeClassName", "contentClassName"]);
84
84
  var ismobile = isMobileDevice() && showTimeType && showTimeType.length;
85
85
  return (React.createElement("div", null,
86
86
  ismobile && (React.createElement(BaseMobile, __assign({}, restProps, { showTimeType: showTimeType, buttonType: EButtonType.Normal, value: value || this.props.defaultValue, onChange: this.handleChange }))),
87
- !ismobile && (React.createElement(Popover, { placement: this.props.placement, trigger: "click", visible: this.visible, openClassName: overlayClassName, getPopupContainer: getPopupContainer, onVisibleChange: this.setVisible, getTooltipContainer: this.props.getPopupContainer, content: React.createElement(Base, __assign({}, restProps, { showTimeType: showTimeType, onChange: this.handleChange, className: classnames(SDK_PREFIX + "-datetime-pick-popover", timeClassName), getPopupContainer: getPopupContainer, value: value || this.props.defaultValue })) }, children || (React.createElement(DisplayInput, { value: value || this.props.defaultValue, timeFormat: this.props.timeFormat, presets: this.props.presets }))))));
87
+ !ismobile && (React.createElement(Popover, { placement: this.props.placement, trigger: "click", visible: this.visible, openClassName: overlayClassName, getPopupContainer: getPopupContainer, onVisibleChange: this.setVisible, getTooltipContainer: this.props.getPopupContainer, content: React.createElement(Base, __assign({}, restProps, { showTimeType: showTimeType, onChange: this.handleChange, className: classnames(SDK_PREFIX + "-datetime-pick-popover", timeClassName), getPopupContainer: getPopupContainer, value: value || this.props.defaultValue })) }, children || (React.createElement(DisplayInput, { value: value || this.props.defaultValue, timeFormat: this.props.timeFormat, presets: this.props.presets, className: contentClassName }))))));
88
88
  };
89
89
  DateTimePicker.Base = Base;
90
90
  DateTimePicker.BaseMobile = BaseMobile;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ export interface INumberInputProps {
3
+ /** 当前值 */
4
+ value?: number;
5
+ /** placeholder */
6
+ placeholder?: string;
7
+ /** 最大值 */
8
+ min?: number;
9
+ /** 最小值 */
10
+ max?: number;
11
+ /** 小数保留的位数 */
12
+ precision?: number;
13
+ /** 前缀 */
14
+ addonAfter?: React.ReactNode;
15
+ /** 后缀 */
16
+ addonBefore?: React.ReactNode;
17
+ /** 组件类名 */
18
+ className?: string;
19
+ /** 设置当前值 */
20
+ onChange?: (value?: number) => void;
21
+ }
22
+ export default class NumberInput extends React.Component<INumberInputProps, any> {
23
+ value: string;
24
+ setValue(value: string): void;
25
+ handleChange(value: string): void;
26
+ handleBlur(): void;
27
+ componentDidMount(): void;
28
+ render(): JSX.Element;
29
+ }
@@ -0,0 +1,116 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
+ var __metadata = (this && this.__metadata) || function (k, v) {
21
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
+ };
23
+ import React from 'react';
24
+ import { observer } from 'mobx-react';
25
+ import { action, observable } from 'mobx';
26
+ import { isNumber, toString, floor } from 'lodash';
27
+ import Input from '../index';
28
+ import bind from '../../../utils/bind';
29
+ var NumberInput = /** @class */ (function (_super) {
30
+ __extends(NumberInput, _super);
31
+ function NumberInput() {
32
+ var _this = _super !== null && _super.apply(this, arguments) || this;
33
+ _this.value = '';
34
+ return _this;
35
+ }
36
+ NumberInput.prototype.setValue = function (value) {
37
+ this.value = value;
38
+ };
39
+ NumberInput.prototype.handleChange = function (value) {
40
+ var onChange = this.props.onChange;
41
+ var result = Number(value);
42
+ if (!onChange) {
43
+ return;
44
+ }
45
+ if (!isNaN(result)) {
46
+ onChange(value === '' ? undefined : result);
47
+ }
48
+ this.setValue(value);
49
+ };
50
+ NumberInput.prototype.handleBlur = function () {
51
+ var _a = this.props, min = _a.min, max = _a.max, precision = _a.precision, onChange = _a.onChange;
52
+ var result = Number(this.value);
53
+ if (!onChange) {
54
+ return;
55
+ }
56
+ if (this.value === '') {
57
+ onChange(undefined);
58
+ this.setValue('');
59
+ return;
60
+ }
61
+ if (isNaN(result)) {
62
+ onChange(min);
63
+ this.setValue(toString(min));
64
+ return;
65
+ }
66
+ if (isNumber(min) && min > result) {
67
+ onChange(min);
68
+ this.setValue(toString(min));
69
+ return;
70
+ }
71
+ if (isNumber(max) && max < result) {
72
+ onChange(max);
73
+ this.setValue(toString(max));
74
+ return;
75
+ }
76
+ if (isNumber(precision)) {
77
+ this.setValue(toString(floor(result, precision)));
78
+ onChange(floor(result, precision));
79
+ }
80
+ };
81
+ NumberInput.prototype.componentDidMount = function () {
82
+ this.setValue(toString(this.props.value));
83
+ };
84
+ NumberInput.prototype.render = function () {
85
+ var _a = this.props, placeholder = _a.placeholder, addonAfter = _a.addonAfter, addonBefore = _a.addonBefore, className = _a.className;
86
+ return (React.createElement(Input, { className: className, value: this.value, onChange: this.handleChange, onBlur: this.handleBlur, placeholder: placeholder, addonAfter: addonAfter, addonBefore: addonBefore }));
87
+ };
88
+ __decorate([
89
+ observable,
90
+ __metadata("design:type", String)
91
+ ], NumberInput.prototype, "value", void 0);
92
+ __decorate([
93
+ bind,
94
+ action,
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", [String]),
97
+ __metadata("design:returntype", void 0)
98
+ ], NumberInput.prototype, "setValue", null);
99
+ __decorate([
100
+ bind,
101
+ __metadata("design:type", Function),
102
+ __metadata("design:paramtypes", [String]),
103
+ __metadata("design:returntype", void 0)
104
+ ], NumberInput.prototype, "handleChange", null);
105
+ __decorate([
106
+ bind,
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", []),
109
+ __metadata("design:returntype", void 0)
110
+ ], NumberInput.prototype, "handleBlur", null);
111
+ NumberInput = __decorate([
112
+ observer
113
+ ], NumberInput);
114
+ return NumberInput;
115
+ }(React.Component));
116
+ export default NumberInput;
@@ -14,5 +14,6 @@ declare namespace Input {
14
14
  }) => JSX.Element;
15
15
  var Password: typeof import("./Password").Password;
16
16
  var TextArea: typeof import("./TextArea").TextArea;
17
+ var NumberInput: typeof import("./NumberInput").default;
17
18
  }
18
19
  export default Input;
@@ -25,8 +25,9 @@ import { Input as AntdInput } from 'antd';
25
25
  import debounceWrapper from '../../hoc/debounce';
26
26
  import { Password } from './Password';
27
27
  import { TextArea } from './TextArea';
28
+ import NumberInput from './NumberInput';
28
29
  var useCallback = React.useCallback;
29
- export default function Input(props) {
30
+ function Input(props) {
30
31
  var onChange = props.onChange, restProps = __rest(props, ["onChange"]);
31
32
  var handleChange = useCallback(function (e) {
32
33
  if (onChange) {
@@ -38,3 +39,5 @@ export default function Input(props) {
38
39
  Input.DebounceInput = debounceWrapper(Input);
39
40
  Input.Password = Password;
40
41
  Input.TextArea = TextArea;
42
+ Input.NumberInput = NumberInput;
43
+ export default Input;
@@ -13,7 +13,7 @@
13
13
  line-height: 1.5715;
14
14
  background-color: transparent;
15
15
  background-image: none;
16
- border: 1px solid #d9d9d9;
16
+ border: 1px solid #bfbfbf;
17
17
  border-radius: 2px;
18
18
  -webkit-transition: all 0.3s;
19
19
  transition: all 0.3s;
@@ -64,7 +64,7 @@
64
64
  opacity: 1;
65
65
  }
66
66
  .ant-input-affix-wrapper-disabled:hover {
67
- border-color: #d9d9d9;
67
+ border-color: #bfbfbf;
68
68
  border-right-width: 1px !important;
69
69
  }
70
70
  .ant-input-affix-wrapper[disabled] {
@@ -74,7 +74,7 @@
74
74
  opacity: 1;
75
75
  }
76
76
  .ant-input-affix-wrapper[disabled]:hover {
77
- border-color: #d9d9d9;
77
+ border-color: #bfbfbf;
78
78
  border-right-width: 1px !important;
79
79
  }
80
80
  .ant-input-affix-wrapper-borderless,
@@ -98,7 +98,7 @@ textarea.ant-input-affix-wrapper {
98
98
  transition: all 0.3s, height 0s;
99
99
  }
100
100
  .ant-input-affix-wrapper-lg {
101
- padding: 2.5px 11px;
101
+ padding: 6.5px 11px;
102
102
  font-size: 16px;
103
103
  }
104
104
  .ant-input-affix-wrapper-sm {
@@ -209,7 +209,7 @@ textarea.ant-input-affix-wrapper {
209
209
  line-height: 1.5715;
210
210
  background-color: transparent;
211
211
  background-image: none;
212
- border: 1px solid #d9d9d9;
212
+ border: 1px solid #bfbfbf;
213
213
  border-radius: 2px;
214
214
  -webkit-transition: all 0.3s;
215
215
  transition: all 0.3s;
@@ -257,7 +257,7 @@ textarea.ant-input-affix-wrapper {
257
257
  opacity: 1;
258
258
  }
259
259
  .ant-input-disabled:hover {
260
- border-color: #d9d9d9;
260
+ border-color: #bfbfbf;
261
261
  border-right-width: 1px !important;
262
262
  }
263
263
  .ant-input[disabled] {
@@ -267,7 +267,7 @@ textarea.ant-input-affix-wrapper {
267
267
  opacity: 1;
268
268
  }
269
269
  .ant-input[disabled]:hover {
270
- border-color: #d9d9d9;
270
+ border-color: #bfbfbf;
271
271
  border-right-width: 1px !important;
272
272
  }
273
273
  .ant-input-borderless,
@@ -291,7 +291,7 @@ textarea.ant-input {
291
291
  transition: all 0.3s, height 0s;
292
292
  }
293
293
  .ant-input-lg {
294
- padding: 2.5px 11px;
294
+ padding: 6.5px 11px;
295
295
  font-size: 16px;
296
296
  }
297
297
  .ant-input-sm {
@@ -373,7 +373,7 @@ textarea.ant-input {
373
373
  font-size: 14px;
374
374
  text-align: center;
375
375
  background-color: #fafafa;
376
- border: 1px solid #d9d9d9;
376
+ border: 1px solid #bfbfbf;
377
377
  border-radius: 2px;
378
378
  -webkit-transition: all 0.3s;
379
379
  transition: all 0.3s;
@@ -427,7 +427,7 @@ textarea.ant-input {
427
427
  }
428
428
  .ant-input-group-lg .ant-input,
429
429
  .ant-input-group-lg > .ant-input-group-addon {
430
- padding: 2.5px 11px;
430
+ padding: 6.5px 11px;
431
431
  font-size: 16px;
432
432
  }
433
433
  .ant-input-group-sm .ant-input,
@@ -435,7 +435,7 @@ textarea.ant-input {
435
435
  padding: 1px 7px;
436
436
  }
437
437
  .ant-input-group-lg .ant-select-single .ant-select-selector {
438
- height: 32px;
438
+ height: 40px;
439
439
  }
440
440
  .ant-input-group-sm .ant-select-single .ant-select-selector {
441
441
  height: 26px;
@@ -562,12 +562,12 @@ textarea.ant-input {
562
562
  border-radius: 0 2px 2px 0;
563
563
  }
564
564
  .ant-input-group-rtl .ant-input-group-addon:first-child {
565
- border-right: 1px solid #d9d9d9;
565
+ border-right: 1px solid #bfbfbf;
566
566
  border-left: 0;
567
567
  }
568
568
  .ant-input-group-rtl .ant-input-group-addon:last-child {
569
569
  border-right: 0;
570
- border-left: 1px solid #d9d9d9;
570
+ border-left: 1px solid #bfbfbf;
571
571
  }
572
572
  .ant-input-group-rtl.ant-input-group > .ant-input:last-child,
573
573
  .ant-input-group-rtl.ant-input-group-addon:last-child {
@@ -624,7 +624,7 @@ textarea.ant-input {
624
624
  height: 32px;
625
625
  }
626
626
  .ant-input[type='color'].ant-input-lg {
627
- height: 32px;
627
+ height: 40px;
628
628
  }
629
629
  .ant-input[type='color'].ant-input-sm {
630
630
  height: 26px;
@@ -679,7 +679,7 @@ textarea.ant-input {
679
679
  z-index: 1;
680
680
  }
681
681
  .ant-input-search-large .ant-input-search-button {
682
- height: 32px;
682
+ height: 40px;
683
683
  }
684
684
  .ant-input-search-small .ant-input-search-button {
685
685
  height: 26px;
@@ -738,7 +738,7 @@ textarea.ant-input {
738
738
  height: 32px;
739
739
  }
740
740
  .ant-input-lg {
741
- height: 32px;
741
+ height: 40px;
742
742
  }
743
743
  .ant-input-sm {
744
744
  height: 26px;
@@ -756,3 +756,6 @@ textarea.ant-input {
756
756
  .ant-input[disabled] {
757
757
  border-color: #d9d9d9;
758
758
  }
759
+ .ant-input-group-addon {
760
+ color: #666;
761
+ }
@@ -6,3 +6,7 @@
6
6
  border-color: @input-disabled-border-color;
7
7
  }
8
8
  }
9
+
10
+ .@{ant-prefix}-input-group-addon {
11
+ color: @font-color-6;
12
+ }
@@ -19,7 +19,7 @@
19
19
  line-height: 1.5715;
20
20
  background-color: transparent;
21
21
  background-image: none;
22
- border: 1px solid #d9d9d9;
22
+ border: 1px solid #bfbfbf;
23
23
  -webkit-transition: all 0.3s;
24
24
  transition: all 0.3s;
25
25
  display: inline-block;
@@ -63,7 +63,7 @@
63
63
  opacity: 1;
64
64
  }
65
65
  .ant-input-number-disabled:hover {
66
- border-color: #d9d9d9;
66
+ border-color: #bfbfbf;
67
67
  border-right-width: 1px !important;
68
68
  }
69
69
  .ant-input-number[disabled] {
@@ -73,7 +73,7 @@
73
73
  opacity: 1;
74
74
  }
75
75
  .ant-input-number[disabled]:hover {
76
- border-color: #d9d9d9;
76
+ border-color: #bfbfbf;
77
77
  border-right-width: 1px !important;
78
78
  }
79
79
  .ant-input-number-borderless,
@@ -97,7 +97,7 @@ textarea.ant-input-number {
97
97
  transition: all 0.3s, height 0s;
98
98
  }
99
99
  .ant-input-number-lg {
100
- padding: 2.5px 11px;
100
+ padding: 6.5px 11px;
101
101
  font-size: 16px;
102
102
  }
103
103
  .ant-input-number-sm {
@@ -189,7 +189,7 @@ textarea.ant-input-number {
189
189
  opacity: 1;
190
190
  }
191
191
  .ant-input-number-disabled:hover {
192
- border-color: #d9d9d9;
192
+ border-color: #bfbfbf;
193
193
  border-right-width: 1px !important;
194
194
  }
195
195
  .ant-input-number-disabled .ant-input-number-input {
@@ -239,7 +239,7 @@ textarea.ant-input-number {
239
239
  font-size: 16px;
240
240
  }
241
241
  .ant-input-number-lg input {
242
- height: 30px;
242
+ height: 38px;
243
243
  }
244
244
  .ant-input-number-sm {
245
245
  padding: 0;
@@ -13,9 +13,9 @@ export interface IMenuProps extends Omit<MenuProps, 'options' | 'mode'> {
13
13
  }
14
14
  export declare function Menue(props: React.PropsWithChildren<IMenuProps>): JSX.Element;
15
15
  export declare namespace Menue {
16
- var Divider: typeof import("rc-menu").Divider;
16
+ var Divider;
17
17
  var Item: typeof import("antd/lib/menu/MenuItem").default;
18
18
  var SubMenu: typeof import("antd/lib/menu/SubMenu").default;
19
- var ItemGroup: typeof import("rc-menu").MenuItemGroup;
19
+ var ItemGroup;
20
20
  }
21
21
  export default Menue;
@@ -1,21 +1,11 @@
1
- import * as React from 'react';
2
- export declare enum SplitType {
3
- End = "end",
4
- Between = "between"
5
- }
1
+ /// <reference types="react" />
6
2
  /**
7
- * 对于过长的名称进行format,并增加Tooltip
3
+ * 对于超出容器宽度的名称进行省略,使用Tooltip展示。
8
4
  */
9
5
  export interface INameLimiterProps {
10
6
  /** 资源名称 */
11
7
  name: string;
12
- /** 展示的最大长度,资源名称超过该长度会展示前后个一半的资源名称,中间使用省略号 */
13
- length: number;
14
8
  /** 用于显示Tooltip的title */
15
9
  title?: string;
16
- /** 省略号位置 */
17
- type?: SplitType;
18
- }
19
- export default class NameLimiter extends React.PureComponent<INameLimiterProps, any> {
20
- render(): JSX.Element;
21
10
  }
11
+ export default function NameLimiter({ name, title }: INameLimiterProps): JSX.Element;
@@ -1,42 +1,33 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- import * as React from 'react';
1
+ var __read = (this && this.__read) || function (o, n) {
2
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3
+ if (!m) return o;
4
+ var i = m.call(o), r, ar = [], e;
5
+ try {
6
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
+ }
8
+ catch (error) { e = { error: error }; }
9
+ finally {
10
+ try {
11
+ if (r && !r.done && (m = i["return"])) m.call(i);
12
+ }
13
+ finally { if (e) throw e.error; }
14
+ }
15
+ return ar;
16
+ };
17
+ import React, { useLayoutEffect, useRef, useState } from 'react';
15
18
  import { Tooltip } from 'antd';
16
19
  import { SDK_PREFIX } from '../../constants/style';
17
- import { getBytes, getTransformerString } from './transformer';
18
- export var SplitType;
19
- (function (SplitType) {
20
- SplitType["End"] = "end";
21
- SplitType["Between"] = "between";
22
- })(SplitType || (SplitType = {}));
23
- var NameLimiter = /** @class */ (function (_super) {
24
- __extends(NameLimiter, _super);
25
- function NameLimiter() {
26
- return _super !== null && _super.apply(this, arguments) || this;
27
- }
28
- NameLimiter.prototype.render = function () {
29
- var _a = this.props, name = _a.name, length = _a.length, title = _a.title, type = _a.type;
30
- var displayName = name;
31
- var needFormat = getBytes(displayName) > length;
32
- var nameSpan = (React.createElement("span", null, needFormat
33
- ? getTransformerString(displayName, length, type)
34
- : displayName));
35
- if (title || needFormat) {
36
- return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-tooltip", placement: "top", title: title || displayName }, nameSpan));
20
+ export default function NameLimiter(_a) {
21
+ var name = _a.name, title = _a.title;
22
+ var _b = __read(useState(false), 2), ellipsis = _b[0], setEllipsis = _b[1];
23
+ var _c = __read(useState(false), 2), visible = _c[0], setVisible = _c[1];
24
+ var ref = useRef(null);
25
+ useLayoutEffect(function () {
26
+ if (!ref.current) {
27
+ return;
37
28
  }
38
- return nameSpan;
39
- };
40
- return NameLimiter;
41
- }(React.PureComponent));
42
- export default NameLimiter;
29
+ setEllipsis(ref.current.clientWidth < ref.current.scrollWidth);
30
+ });
31
+ return (React.createElement(Tooltip, { overlayClassName: SDK_PREFIX + "-name-limit-tooltip", placement: "top", title: title || name, visible: (!!title || ellipsis) && visible, onVisibleChange: setVisible },
32
+ React.createElement("span", { className: SDK_PREFIX + "-name-limit", ref: ref }, name)));
33
+ }
@@ -268,7 +268,15 @@
268
268
  .ant-btn-sm {
269
269
  padding: 0 7px;
270
270
  }
271
- .pandora-sdk-name-tooltip .ant-tooltip-inner {
271
+ .pandora-sdk-name-limit {
272
+ max-width: 100%;
273
+ display: inline-block;
274
+ vertical-align: top;
275
+ white-space: nowrap;
276
+ text-overflow: ellipsis;
277
+ overflow: hidden;
278
+ }
279
+ .pandora-sdk-name-limit-tooltip .ant-tooltip-inner {
272
280
  max-width: 400px !important;
273
281
  max-height: 200px !important;
274
282
  overflow: auto;