@autobest-ui/components 1.1.4 → 1.1.10

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 (162) hide show
  1. package/README.md +10 -10
  2. package/esm/affix/style/index.scss +34 -34
  3. package/esm/base.scss +42 -42
  4. package/esm/carousel/style/index.scss +37 -37
  5. package/esm/checkbox/style/index.scss +117 -117
  6. package/esm/collapse/style/index.scss +42 -42
  7. package/esm/confirm/style/index.scss +44 -44
  8. package/esm/date-picker/calendar/grid/index.scss +85 -85
  9. package/esm/date-picker/calendar/index.d.ts +4 -0
  10. package/esm/date-picker/calendar/index.js +1 -1
  11. package/esm/date-picker/calendar/index.scss +57 -57
  12. package/esm/date-picker/index.d.ts +17 -6
  13. package/esm/date-picker/index.js +49 -8
  14. package/esm/date-picker/style/index.css +1 -1
  15. package/esm/date-picker/style/index.scss +23 -19
  16. package/esm/drawer/style/index.scss +44 -44
  17. package/esm/ellipsis/style/index.scss +35 -35
  18. package/esm/guide/style/index.scss +17 -17
  19. package/esm/icon/style/index.scss +6 -6
  20. package/esm/index.d.ts +2 -1
  21. package/esm/input-number/index.d.ts +30 -17
  22. package/esm/input-number/index.js +116 -36
  23. package/esm/input-number/style/index.scss +86 -86
  24. package/esm/lazy-image/style/index.scss +24 -24
  25. package/esm/link-list/style/index.scss +125 -125
  26. package/esm/loading/style/index.scss +30 -30
  27. package/esm/loading-bar/style/index.scss +62 -62
  28. package/esm/loading-container/style/index.scss +27 -27
  29. package/esm/loading-icon/style/index.scss +23 -23
  30. package/esm/mask/style/index.scss +34 -34
  31. package/esm/message/style/index.scss +70 -70
  32. package/esm/modal/style/index.scss +112 -112
  33. package/esm/move/style/index.scss +7 -7
  34. package/esm/popover/style/index.scss +59 -59
  35. package/esm/select/style/index.scss +126 -126
  36. package/esm/show-more/style/index.scss +22 -22
  37. package/esm/skeleton/style/index.scss +26 -26
  38. package/esm/style.css +5 -19
  39. package/esm/table/body/BodyRow.d.ts +9 -3
  40. package/esm/table/body/BodyRow.js +6 -2
  41. package/esm/table/body/index.d.ts +2 -2
  42. package/esm/table/body/index.js +8 -7
  43. package/esm/table/header/HeaderCell.d.ts +2 -2
  44. package/esm/table/header/HeaderRow.d.ts +2 -2
  45. package/esm/table/index.d.ts +4 -4
  46. package/esm/table/index.js +3 -3
  47. package/esm/table/interface.d.ts +9 -3
  48. package/esm/table/style/index.scss +51 -51
  49. package/esm/tabs/style/index.scss +62 -62
  50. package/esm/tooltip/style/index.scss +61 -61
  51. package/esm/trigger/style/index.scss +79 -79
  52. package/lib/affix/style/index.scss +34 -34
  53. package/lib/base.scss +42 -42
  54. package/lib/carousel/style/index.scss +37 -37
  55. package/lib/checkbox/style/index.scss +117 -117
  56. package/lib/collapse/style/index.scss +42 -42
  57. package/lib/confirm/style/index.scss +44 -44
  58. package/lib/date-picker/calendar/grid/index.scss +85 -85
  59. package/lib/date-picker/calendar/index.d.ts +4 -0
  60. package/lib/date-picker/calendar/index.js +1 -1
  61. package/lib/date-picker/calendar/index.scss +57 -57
  62. package/lib/date-picker/index.d.ts +17 -6
  63. package/lib/date-picker/index.js +49 -8
  64. package/lib/date-picker/style/index.css +1 -1
  65. package/lib/date-picker/style/index.scss +23 -19
  66. package/lib/drawer/style/index.scss +44 -44
  67. package/lib/ellipsis/style/index.scss +35 -35
  68. package/lib/guide/style/index.scss +17 -17
  69. package/lib/icon/style/index.scss +6 -6
  70. package/lib/index.d.ts +2 -1
  71. package/lib/input-number/index.d.ts +30 -17
  72. package/lib/input-number/index.js +116 -36
  73. package/lib/input-number/style/index.scss +86 -86
  74. package/lib/lazy-image/style/index.scss +24 -24
  75. package/lib/link-list/style/index.scss +125 -125
  76. package/lib/loading/style/index.scss +30 -30
  77. package/lib/loading-bar/style/index.scss +62 -62
  78. package/lib/loading-container/style/index.scss +27 -27
  79. package/lib/loading-icon/style/index.scss +23 -23
  80. package/lib/mask/style/index.scss +34 -34
  81. package/lib/message/style/index.scss +70 -70
  82. package/lib/modal/style/index.scss +112 -112
  83. package/lib/move/style/index.scss +7 -7
  84. package/lib/popover/style/index.scss +59 -59
  85. package/lib/select/style/index.scss +126 -126
  86. package/lib/show-more/style/index.scss +22 -22
  87. package/lib/skeleton/style/index.scss +26 -26
  88. package/lib/style.css +5 -19
  89. package/lib/table/body/BodyRow.d.ts +9 -3
  90. package/lib/table/body/BodyRow.js +6 -2
  91. package/lib/table/body/index.d.ts +2 -2
  92. package/lib/table/body/index.js +8 -7
  93. package/lib/table/header/HeaderCell.d.ts +2 -2
  94. package/lib/table/header/HeaderRow.d.ts +2 -2
  95. package/lib/table/index.d.ts +4 -4
  96. package/lib/table/index.js +3 -3
  97. package/lib/table/interface.d.ts +9 -3
  98. package/lib/table/style/index.scss +51 -51
  99. package/lib/tabs/style/index.scss +62 -62
  100. package/lib/tooltip/style/index.scss +61 -61
  101. package/lib/trigger/style/index.scss +79 -79
  102. package/package.json +2 -2
  103. package/esm/accordion/__stories__/style.css +0 -1
  104. package/esm/accordion/__stories__/style.scss +0 -59
  105. package/esm/affix/__stories__/style.css +0 -1
  106. package/esm/affix/__stories__/style.scss +0 -13
  107. package/esm/carousel/__stories__/style.css +0 -1
  108. package/esm/carousel/__stories__/style.scss +0 -41
  109. package/esm/collapse/__stories__/style.css +0 -1
  110. package/esm/collapse/__stories__/style.scss +0 -19
  111. package/esm/guide/__stories__/style.css +0 -1
  112. package/esm/guide/__stories__/style.scss +0 -14
  113. package/esm/icon/__stories__/iconNames.d.ts +0 -2
  114. package/esm/icon/__stories__/iconNames.js +0 -1
  115. package/esm/icon/__stories__/style.css +0 -1
  116. package/esm/icon/__stories__/style.scss +0 -40
  117. package/esm/lazy-image/__stories__/style.css +0 -1
  118. package/esm/lazy-image/__stories__/style.scss +0 -9
  119. package/esm/loading-container/__stories__/style.css +0 -1
  120. package/esm/loading-container/__stories__/style.scss +0 -6
  121. package/esm/move/__stories__/style.css +0 -1
  122. package/esm/move/__stories__/style.scss +0 -6
  123. package/esm/popover/__stories__/style.css +0 -1
  124. package/esm/popover/__stories__/style.scss +0 -16
  125. package/esm/select/__stories__/style.css +0 -1
  126. package/esm/select/__stories__/style.scss +0 -8
  127. package/esm/skeleton/__stories__/style.css +0 -1
  128. package/esm/skeleton/__stories__/style.scss +0 -3
  129. package/esm/table/__stories__/style.css +0 -1
  130. package/esm/table/__stories__/style.scss +0 -34
  131. package/esm/tabs/__stories__/style.css +0 -1
  132. package/esm/tabs/__stories__/style.scss +0 -8
  133. package/lib/accordion/__stories__/style.css +0 -1
  134. package/lib/accordion/__stories__/style.scss +0 -59
  135. package/lib/affix/__stories__/style.css +0 -1
  136. package/lib/affix/__stories__/style.scss +0 -13
  137. package/lib/carousel/__stories__/style.css +0 -1
  138. package/lib/carousel/__stories__/style.scss +0 -41
  139. package/lib/collapse/__stories__/style.css +0 -1
  140. package/lib/collapse/__stories__/style.scss +0 -19
  141. package/lib/guide/__stories__/style.css +0 -1
  142. package/lib/guide/__stories__/style.scss +0 -14
  143. package/lib/icon/__stories__/iconNames.d.ts +0 -2
  144. package/lib/icon/__stories__/iconNames.js +0 -8
  145. package/lib/icon/__stories__/style.css +0 -1
  146. package/lib/icon/__stories__/style.scss +0 -40
  147. package/lib/lazy-image/__stories__/style.css +0 -1
  148. package/lib/lazy-image/__stories__/style.scss +0 -9
  149. package/lib/loading-container/__stories__/style.css +0 -1
  150. package/lib/loading-container/__stories__/style.scss +0 -6
  151. package/lib/move/__stories__/style.css +0 -1
  152. package/lib/move/__stories__/style.scss +0 -6
  153. package/lib/popover/__stories__/style.css +0 -1
  154. package/lib/popover/__stories__/style.scss +0 -16
  155. package/lib/select/__stories__/style.css +0 -1
  156. package/lib/select/__stories__/style.scss +0 -8
  157. package/lib/skeleton/__stories__/style.css +0 -1
  158. package/lib/skeleton/__stories__/style.scss +0 -3
  159. package/lib/table/__stories__/style.css +0 -1
  160. package/lib/table/__stories__/style.scss +0 -34
  161. package/lib/tabs/__stories__/style.css +0 -1
  162. package/lib/tabs/__stories__/style.scss +0 -8
@@ -1,58 +1,58 @@
1
- $namespace: ab-dp-cal;
2
-
3
- .#{$namespace} {
4
- display: flex;
5
-
6
- &-my {
7
- padding-left: .12rem;
8
- margin-left: .12rem;
9
- border-left: 1px solid #B0B0B0;
10
- }
11
-
12
- &-day, &-my {
13
- width: 2.1rem;
14
- }
15
-
16
- &-dis {
17
- color: #C8C8C8;
18
- }
19
-
20
- &-dg {
21
- > ul {
22
- > li {
23
- width: 14.28%;
24
- height: .28rem;
25
-
26
- &.#{$namespace}-out {
27
- color: #666666;
28
- }
29
- }
30
- }
31
- }
32
-
33
- &-myg {
34
- padding-bottom: .62rem;
35
-
36
- > ul {
37
- justify-content: space-between;
38
-
39
- > li {
40
- width: .4rem;
41
- height: .4rem;
42
- margin-bottom: .1rem;
43
- }
44
- }
45
- }
46
-
47
- &-t {
48
- cursor: pointer;
49
- position: absolute;
50
- right: .08rem;
51
- bottom: .3rem;
52
-
53
- &.#{$namespace}-t-dis {
54
- color: #b0b0b0;
55
- cursor: default;
56
- }
57
- }
1
+ $namespace: ab-dp-cal;
2
+
3
+ .#{$namespace} {
4
+ display: flex;
5
+
6
+ &-my {
7
+ padding-left: .12rem;
8
+ margin-left: .12rem;
9
+ border-left: 1px solid #B0B0B0;
10
+ }
11
+
12
+ &-day, &-my {
13
+ width: 2.1rem;
14
+ }
15
+
16
+ &-dis {
17
+ color: #C8C8C8;
18
+ }
19
+
20
+ &-dg {
21
+ > ul {
22
+ > li {
23
+ width: 14.28%;
24
+ height: .28rem;
25
+
26
+ &.#{$namespace}-out {
27
+ color: #666666;
28
+ }
29
+ }
30
+ }
31
+ }
32
+
33
+ &-myg {
34
+ padding-bottom: .62rem;
35
+
36
+ > ul {
37
+ justify-content: space-between;
38
+
39
+ > li {
40
+ width: .4rem;
41
+ height: .4rem;
42
+ margin-bottom: .1rem;
43
+ }
44
+ }
45
+ }
46
+
47
+ &-t {
48
+ cursor: pointer;
49
+ position: absolute;
50
+ right: .08rem;
51
+ bottom: .3rem;
52
+
53
+ &.#{$namespace}-t-dis {
54
+ color: #b0b0b0;
55
+ cursor: default;
56
+ }
57
+ }
58
58
  }
@@ -1,6 +1,6 @@
1
1
  import React, { ReactText } from 'react';
2
2
  import Calendar, { CalendarProps } from './calendar';
3
- export interface DatePickerProps extends Partial<CalendarProps> {
3
+ export interface DatePickerProps extends Partial<Omit<CalendarProps, 'defaultDate'>> {
4
4
  /**
5
5
  * 组件整体样式
6
6
  */
@@ -13,6 +13,14 @@ export interface DatePickerProps extends Partial<CalendarProps> {
13
13
  * 需要显示在input框中的日期格式
14
14
  */
15
15
  onFormatDate?: (v: Date, name?: ReactText) => string;
16
+ /**
17
+ * 默认选中的值,用于初始化展示
18
+ */
19
+ defaultValue?: Date;
20
+ /**
21
+ * 外部控制value
22
+ */
23
+ value?: Date;
16
24
  /**
17
25
  * 是否显示input框中的日历图标
18
26
  */
@@ -29,10 +37,6 @@ export interface DatePickerProps extends Partial<CalendarProps> {
29
37
  * 是否禁用
30
38
  */
31
39
  disabled?: boolean;
32
- /**
33
- * 默认选中的值,用于初始化展示
34
- */
35
- defaultValue?: Date;
36
40
  /**
37
41
  * 与onFormatDate正相反,将input框中的字符串转为Date,当onFormatDate有值时,该属性``也需要有值
38
42
  */
@@ -45,7 +49,9 @@ interface DatePickerState {
45
49
  declare class DatePicker extends React.Component<DatePickerProps, DatePickerState> {
46
50
  prefixCls: string;
47
51
  calendarRef: React.RefObject<Calendar>;
48
- constructor(props: any);
52
+ defaultDate?: Date;
53
+ popoverTriggered: boolean;
54
+ constructor(props: DatePickerProps);
49
55
  static defaultProps: {
50
56
  onFormatDate: (date: any) => any;
51
57
  iconVisible: boolean;
@@ -53,7 +59,12 @@ declare class DatePicker extends React.Component<DatePickerProps, DatePickerStat
53
59
  disabled: boolean;
54
60
  parseDateFromString: (value: any) => Date;
55
61
  };
62
+ static getDerivedStateFromProps(nextProps: DatePickerProps, prevState: DatePickerState): {
63
+ inputValue: string;
64
+ calendarVisible: boolean;
65
+ };
56
66
  onCalendarSelect: (date: Date) => void;
67
+ updateDate: () => void;
57
68
  onInputFocus: () => void;
58
69
  onInputChange: (ev: any) => void;
59
70
  onChangeDate: () => void;
@@ -76,6 +76,7 @@ function (_super) {
76
76
 
77
77
  _this.prefixCls = 'ab-date-picker';
78
78
  _this.calendarRef = (0, _react.createRef)();
79
+ _this.popoverTriggered = false;
79
80
 
80
81
  _this.onCalendarSelect = function (date) {
81
82
  _this.setState({
@@ -88,14 +89,35 @@ function (_super) {
88
89
  }
89
90
  };
90
91
 
91
- _this.onInputFocus = function () {
92
- if (_this.calendarRef.current && _this.state.inputValue) {
93
- _this.calendarRef.current.updateDate(_this.props.parseDateFromString(_this.state.inputValue, _this.props.name));
92
+ _this.updateDate = function () {
93
+ if (!_this.calendarRef.current || !_this.state.inputValue) {
94
+ return;
95
+ }
96
+
97
+ var date = _this.props.parseDateFromString(_this.state.inputValue, _this.props.name);
98
+
99
+ if (isNaN(date.getTime())) {
100
+ return;
94
101
  }
95
102
 
103
+ _this.calendarRef.current.updateDate(date);
104
+ };
105
+
106
+ _this.onInputFocus = function () {
107
+ _this.updateDate();
108
+
96
109
  _this.setState({
97
110
  calendarVisible: true
98
111
  });
112
+
113
+ if (!_this.popoverTriggered) {
114
+ // 标记触发过popover visible
115
+ _this.popoverTriggered = true;
116
+
117
+ if ('value' in _this.props && _this.props.value) {
118
+ _this.defaultDate = _this.props.value;
119
+ }
120
+ }
99
121
  };
100
122
 
101
123
  _this.onInputChange = function (ev) {
@@ -109,13 +131,11 @@ function (_super) {
109
131
  };
110
132
 
111
133
  _this.onChangeDate = function () {
112
- if (!_this.props.allowTextInput || !_this.calendarRef.current || !_this.state.inputValue) {
134
+ if (!_this.props.allowTextInput) {
113
135
  return;
114
136
  }
115
137
 
116
- var date = _this.props.parseDateFromString(_this.state.inputValue, _this.props.name);
117
-
118
- _this.calendarRef.current.updateDate(date);
138
+ _this.updateDate();
119
139
  };
120
140
 
121
141
  _this.onPopoverVisibleChange = function (visible) {
@@ -143,12 +163,14 @@ function (_super) {
143
163
  return _react.default.createElement(_calendar.default, __assign({}, copyProps, {
144
164
  ref: _this.calendarRef,
145
165
  onSelect: _this.onCalendarSelect,
146
- className: copyProps.calendarClassName
166
+ className: copyProps.calendarClassName,
167
+ defaultDate: _this.defaultDate
147
168
  }));
148
169
  };
149
170
 
150
171
  var defaultValue = props.defaultValue,
151
172
  onFormatDate = props.onFormatDate;
173
+ _this.defaultDate = defaultValue;
152
174
  _this.state = {
153
175
  calendarVisible: false,
154
176
  inputValue: defaultValue ? onFormatDate(defaultValue) : ''
@@ -156,6 +178,25 @@ function (_super) {
156
178
  return _this;
157
179
  }
158
180
 
181
+ DatePicker.getDerivedStateFromProps = function (nextProps, prevState) {
182
+ if ('value' in nextProps) {
183
+ var onFormatDate = nextProps.onFormatDate,
184
+ value = nextProps.value;
185
+ var currentValue = value ? onFormatDate(value) : '';
186
+
187
+ if (prevState.inputValue === currentValue) {
188
+ return null;
189
+ }
190
+
191
+ return {
192
+ inputValue: currentValue,
193
+ calendarVisible: false
194
+ };
195
+ }
196
+
197
+ return null;
198
+ };
199
+
159
200
  DatePicker.prototype.render = function () {
160
201
  var cls = this.prefixCls;
161
202
  var _a = this.props,
@@ -1 +1 @@
1
- .ab-date-picker{position:relative}.ab-date-picker-input{outline:0;font-size:.14rem;padding:.04rem;width:1.44rem}.ab-date-picker-icon{position:absolute;right:.05rem;top:50%;transform:translateY(-50%)}
1
+ .ab-date-picker{position:relative}.ab-date-picker-input{outline:0;font-size:.14rem;padding:.04rem;width:1.44rem}.ab-date-picker-input.ab-date-picker-error{background:#fffacd}.ab-date-picker-icon{position:absolute;right:.05rem;top:50%;transform:translateY(-50%)}
@@ -1,19 +1,23 @@
1
- $namespace: ab-date-picker;
2
-
3
- .#{$namespace} {
4
- position: relative;
5
-
6
- &-input {
7
- outline: none;
8
- font-size: .14rem;
9
- padding: .04rem;
10
- width: 1.44rem;
11
- }
12
-
13
- &-icon {
14
- position: absolute;
15
- right: 0.05rem;
16
- top: 50%;
17
- transform: translateY(-50%);
18
- }
19
- }
1
+ $namespace: ab-date-picker;
2
+
3
+ .#{$namespace} {
4
+ position: relative;
5
+
6
+ &-input {
7
+ outline: none;
8
+ font-size: .14rem;
9
+ padding: .04rem;
10
+ width: 1.44rem;
11
+
12
+ &.#{$namespace}-error {
13
+ background: #fffacd;
14
+ }
15
+ }
16
+
17
+ &-icon {
18
+ position: absolute;
19
+ right: 0.05rem;
20
+ top: 50%;
21
+ transform: translateY(-50%);
22
+ }
23
+ }
@@ -1,44 +1,44 @@
1
- $namespace: ab-drawer;
2
-
3
- .#{$namespace} {
4
- position: fixed;
5
- z-index: 101;
6
- background-color: #fff;
7
- overflow: auto;
8
- transition: transform 300ms cubic-bezier(.7, .3, .1, 1);
9
-
10
- &-times {
11
- position: absolute;
12
- right: .17rem;
13
- font-size: .16rem;
14
- color: #b0b0b0;
15
- cursor: pointer;
16
- top: .11rem;
17
-
18
- &:hover {
19
- color: #333;
20
- }
21
- }
22
-
23
- &-tf-top {
24
- transform: translate(0, -100%);
25
- }
26
-
27
- &-tf-bottom {
28
- transform: translate(0, 100%);
29
- }
30
-
31
- &-tf-left {
32
- transform: translate(-100%, 0);
33
- }
34
-
35
- &-tf-right {
36
- transform: translate(100%, 0);
37
- }
38
-
39
- &-hidden {
40
- &.ab-mask, &.ab-drawer {
41
- display: none;
42
- }
43
- }
44
- }
1
+ $namespace: ab-drawer;
2
+
3
+ .#{$namespace} {
4
+ position: fixed;
5
+ z-index: 101;
6
+ background-color: #fff;
7
+ overflow: auto;
8
+ transition: transform 300ms cubic-bezier(.7, .3, .1, 1);
9
+
10
+ &-times {
11
+ position: absolute;
12
+ right: .17rem;
13
+ font-size: .16rem;
14
+ color: #b0b0b0;
15
+ cursor: pointer;
16
+ top: .11rem;
17
+
18
+ &:hover {
19
+ color: #333;
20
+ }
21
+ }
22
+
23
+ &-tf-top {
24
+ transform: translate(0, -100%);
25
+ }
26
+
27
+ &-tf-bottom {
28
+ transform: translate(0, 100%);
29
+ }
30
+
31
+ &-tf-left {
32
+ transform: translate(-100%, 0);
33
+ }
34
+
35
+ &-tf-right {
36
+ transform: translate(100%, 0);
37
+ }
38
+
39
+ &-hidden {
40
+ &.ab-mask, &.ab-drawer {
41
+ display: none;
42
+ }
43
+ }
44
+ }
@@ -1,35 +1,35 @@
1
- $namespace: ab-ellipsis;
2
-
3
- $lines: (1) (2) (3) (4) (5);
4
- @mixin generateLines($type) {
5
- @each $val in $lines {
6
- &.#{$namespace}#{$type}#{$val} {
7
- -webkit-line-clamp: $val;
8
- }
9
- }
10
- }
11
-
12
- @mixin clearLines($type) {
13
- @each $val in $lines {
14
- &.#{$namespace}#{$type}#{$val} {
15
- -webkit-line-clamp: unset;
16
- }
17
- }
18
- }
19
-
20
- .#{$namespace} {
21
- overflow: hidden;
22
- display: block;
23
- display: -webkit-box;
24
- -webkit-box-orient: vertical;
25
-
26
- @include generateLines('-line');
27
- }
28
-
29
-
30
- @media only screen and (max-width: 767px) {
31
- .#{$namespace} {
32
- @include clearLines('-line');
33
- @include generateLines('-m-line');
34
- }
35
- }
1
+ $namespace: ab-ellipsis;
2
+
3
+ $lines: (1) (2) (3) (4) (5);
4
+ @mixin generateLines($type) {
5
+ @each $val in $lines {
6
+ &.#{$namespace}#{$type}#{$val} {
7
+ -webkit-line-clamp: $val;
8
+ }
9
+ }
10
+ }
11
+
12
+ @mixin clearLines($type) {
13
+ @each $val in $lines {
14
+ &.#{$namespace}#{$type}#{$val} {
15
+ -webkit-line-clamp: unset;
16
+ }
17
+ }
18
+ }
19
+
20
+ .#{$namespace} {
21
+ overflow: hidden;
22
+ display: block;
23
+ display: -webkit-box;
24
+ -webkit-box-orient: vertical;
25
+
26
+ @include generateLines('-line');
27
+ }
28
+
29
+
30
+ @media only screen and (max-width: 767px) {
31
+ .#{$namespace} {
32
+ @include clearLines('-line');
33
+ @include generateLines('-m-line');
34
+ }
35
+ }
@@ -1,18 +1,18 @@
1
- $namespace: ab-guide;
2
-
3
- .#{$namespace} {
4
- &-mask.ab-mask {
5
- background-color: rgba(0, 0, 0, .7);
6
- z-index: 4;
7
- }
8
-
9
- &-icon {
10
- position: absolute;
11
- z-index: 5;
12
- }
13
-
14
- &-content {
15
- position: relative;
16
- z-index: 6;
17
- }
1
+ $namespace: ab-guide;
2
+
3
+ .#{$namespace} {
4
+ &-mask.ab-mask {
5
+ background-color: rgba(0, 0, 0, .7);
6
+ z-index: 4;
7
+ }
8
+
9
+ &-icon {
10
+ position: absolute;
11
+ z-index: 5;
12
+ }
13
+
14
+ &-content {
15
+ position: relative;
16
+ z-index: 6;
17
+ }
18
18
  }
@@ -1,7 +1,7 @@
1
- $namespace: ab-icon;
2
-
3
- .#{$namespace}{
4
- &, span, div, svg{
5
- display: block;
6
- }
1
+ $namespace: ab-icon;
2
+
3
+ .#{$namespace}{
4
+ &, span, div, svg{
5
+ display: block;
6
+ }
7
7
  }
package/lib/index.d.ts CHANGED
@@ -43,7 +43,8 @@ export type { ScriptAttributes, ScriptProps } from './script';
43
43
  export { default as Script } from './script';
44
44
  export type { MessageProps } from './message';
45
45
  export { default as Message } from './message';
46
- export type { TableProps } from './table';
46
+ export type { TableProps, TableRowSelectionInfo } from './table';
47
+ export type { TableColumnInfo, TableColumnOnRenderReturnObjectInfo } from './table/interface';
47
48
  export { default as Table } from './table';
48
49
  export type { DatePickerProps } from './date-picker';
49
50
  export { default as DatePicker } from './date-picker';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AddListenerEventHandler } from '@autobest-ui/utils';
3
- interface OnchangeHandler {
2
+ import { debounce, AddListenerEventHandler } from '@autobest-ui/utils';
3
+ interface OnChangeHandler {
4
4
  (value: string, name?: string): void;
5
5
  }
6
6
  interface ChangeEvent {
@@ -12,7 +12,7 @@ export interface InputNumberProps extends Omit<React.InputHTMLAttributes<any>, '
12
12
  /**
13
13
  * 值修改后的回调函数,用于修改value属性
14
14
  */
15
- onChange: OnchangeHandler;
15
+ onChange: OnChangeHandler;
16
16
  /**
17
17
  * input样式
18
18
  */
@@ -30,7 +30,8 @@ export interface InputNumberProps extends Omit<React.InputHTMLAttributes<any>, '
30
30
  */
31
31
  max?: number;
32
32
  /**
33
- * 打包值,向上取整
33
+ * 打包值,向上取整,不赋值或者赋值为0表示不做取整操作
34
+ * 注:packMultiple不允许传小数
34
35
  */
35
36
  packMultiple?: number;
36
37
  /**
@@ -38,9 +39,13 @@ export interface InputNumberProps extends Omit<React.InputHTMLAttributes<any>, '
38
39
  */
39
40
  disabled?: boolean;
40
41
  /**
41
- * 只能输入整数
42
+ * 可输入的小数位数,0或没有值表示只能输入整数
42
43
  */
43
- isPositive?: boolean;
44
+ digital?: number;
45
+ /**
46
+ * 为true则自动补全小数位数
47
+ */
48
+ padDigital?: boolean;
44
49
  /**
45
50
  * 输入框默认字符大小
46
51
  */
@@ -56,11 +61,11 @@ export interface InputNumberProps extends Omit<React.InputHTMLAttributes<any>, '
56
61
  /**
57
62
  * packMultiple 有值时,判断前的回调函数
58
63
  */
59
- onChangePackMultipleBefore?: OnchangeHandler;
64
+ onChangePackMultipleBefore?: OnChangeHandler;
60
65
  /**
61
66
  * packMultiple 有值时,判断后的回调函数
62
67
  */
63
- onChangePackMultipleAfter?: OnchangeHandler;
68
+ onChangePackMultipleAfter?: OnChangeHandler;
64
69
  /**
65
70
  * 是否需要显示增加按钮
66
71
  */
@@ -70,10 +75,6 @@ interface InputNumberStates {
70
75
  enter: boolean;
71
76
  focus: boolean;
72
77
  }
73
- interface DebounceRef {
74
- (value: string): void;
75
- cancel: () => void;
76
- }
77
78
  interface LocationInfo {
78
79
  left: number;
79
80
  top: number;
@@ -86,13 +87,15 @@ declare class InputNumber extends React.Component<InputNumberProps, InputNumberS
86
87
  name: string;
87
88
  size: number;
88
89
  disabled: boolean;
89
- isPositive: boolean;
90
+ digital: number;
91
+ padDigital: boolean;
90
92
  delay: number;
91
93
  visibleButton: boolean;
92
94
  };
93
95
  constructor(props: InputNumberProps);
94
96
  currentRef: React.RefObject<HTMLLabelElement>;
95
- debounce: DebounceRef;
97
+ changePackMultipleValueDebounce: ReturnType<typeof debounce>;
98
+ padDigitalDebounce: ReturnType<typeof debounce>;
96
99
  addLocationInfo: LocationInfo;
97
100
  subLocationInfo: LocationInfo;
98
101
  mouseUpHandler: AddListenerEventHandler;
@@ -120,10 +123,20 @@ declare class InputNumber extends React.Component<InputNumberProps, InputNumberS
120
123
  isInside: (ev: React.MouseEvent<Element, MouseEvent>, locationInfo: LocationInfo) => boolean;
121
124
  getLocationInfo: () => void;
122
125
  getCurrentValue: (value: string) => number;
126
+ getPadDigitalValue: (value: string) => string;
123
127
  onChangePackMultipleValue: (value: string) => void;
124
- getDebounce: () => DebounceRef;
125
- callback: (value: string) => void;
126
- onValueChange: (ev: ChangeEvent) => void;
128
+ onPadDigital: (value: any) => void;
129
+ getPadDigitalDebounce: () => {
130
+ (...arg: any[]): void;
131
+ cancel(): void;
132
+ };
133
+ getChangePackMultipleValueDebounce: () => {
134
+ (...arg: any[]): void;
135
+ cancel(): void;
136
+ };
137
+ callback: (value: string, ignoreDelay?: any) => void;
138
+ onValueChange: (ev: ChangeEvent, ignoreDelay?: any) => void;
139
+ getValueCalculate: (value: number, offset: number) => number;
127
140
  onAdd: () => void;
128
141
  onSub: () => void;
129
142
  renderButton: () => JSX.Element;