@autobest-ui/components 1.1.2 → 1.2.1

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 (106) hide show
  1. package/README.md +10 -10
  2. package/esm/accordion/__stories__/style.scss +58 -58
  3. package/esm/affix/__stories__/style.scss +13 -13
  4. package/esm/affix/style/index.scss +34 -34
  5. package/esm/base.scss +42 -42
  6. package/esm/carousel/__stories__/style.scss +41 -41
  7. package/esm/carousel/index.d.ts +21 -13
  8. package/esm/carousel/index.js +77 -44
  9. package/esm/carousel/style/index.css +1 -1
  10. package/esm/carousel/style/index.scss +43 -37
  11. package/esm/checkbox/style/index.scss +117 -117
  12. package/esm/collapse/__stories__/style.scss +18 -18
  13. package/esm/collapse/style/index.scss +42 -42
  14. package/esm/confirm/style/index.scss +44 -44
  15. package/esm/date-picker/calendar/grid/index.scss +85 -85
  16. package/esm/date-picker/calendar/index.scss +57 -57
  17. package/esm/date-picker/style/index.scss +18 -18
  18. package/esm/drawer/style/index.scss +44 -44
  19. package/esm/ellipsis/style/index.scss +35 -35
  20. package/esm/guide/__stories__/style.scss +13 -13
  21. package/esm/guide/style/index.scss +17 -17
  22. package/esm/icon/__stories__/style.scss +39 -39
  23. package/esm/icon/style/index.scss +6 -6
  24. package/esm/index.d.ts +1 -1
  25. package/esm/index.js +1 -1
  26. package/esm/input-number/style/index.scss +86 -86
  27. package/esm/lazy-image/__stories__/style.scss +9 -9
  28. package/esm/lazy-image/style/index.scss +24 -24
  29. package/esm/link-list/style/index.scss +125 -125
  30. package/esm/loading/style/index.scss +30 -30
  31. package/esm/loading-bar/style/index.scss +62 -62
  32. package/esm/loading-container/__stories__/style.scss +5 -5
  33. package/esm/loading-container/style/index.scss +27 -27
  34. package/esm/loading-icon/style/index.scss +23 -23
  35. package/esm/mask/style/index.scss +34 -34
  36. package/esm/message/style/index.scss +70 -70
  37. package/esm/modal/style/index.scss +112 -112
  38. package/esm/move/__stories__/style.scss +6 -6
  39. package/esm/move/style/index.scss +7 -7
  40. package/esm/popover/__stories__/style.scss +15 -15
  41. package/esm/popover/style/index.scss +59 -59
  42. package/esm/select/__stories__/style.scss +8 -8
  43. package/esm/select/style/index.scss +126 -126
  44. package/esm/show-more/style/index.scss +22 -22
  45. package/esm/skeleton/__stories__/style.scss +2 -2
  46. package/esm/skeleton/style/index.scss +26 -26
  47. package/esm/style.css +16 -16
  48. package/esm/table/__stories__/style.scss +33 -33
  49. package/esm/table/style/index.scss +51 -51
  50. package/esm/tabs/__stories__/style.scss +8 -8
  51. package/esm/tabs/style/index.scss +62 -62
  52. package/esm/tooltip/style/index.scss +61 -61
  53. package/esm/trigger/style/index.scss +79 -79
  54. package/lib/accordion/__stories__/style.scss +58 -58
  55. package/lib/affix/__stories__/style.scss +13 -13
  56. package/lib/affix/style/index.scss +34 -34
  57. package/lib/base.scss +42 -42
  58. package/lib/carousel/__stories__/style.scss +41 -41
  59. package/lib/carousel/index.d.ts +21 -13
  60. package/lib/carousel/index.js +80 -45
  61. package/lib/carousel/style/index.css +1 -1
  62. package/lib/carousel/style/index.scss +43 -37
  63. package/lib/checkbox/style/index.scss +117 -117
  64. package/lib/collapse/__stories__/style.scss +18 -18
  65. package/lib/collapse/style/index.scss +42 -42
  66. package/lib/confirm/style/index.scss +44 -44
  67. package/lib/date-picker/calendar/grid/index.scss +85 -85
  68. package/lib/date-picker/calendar/index.scss +57 -57
  69. package/lib/date-picker/style/index.scss +18 -18
  70. package/lib/drawer/style/index.scss +44 -44
  71. package/lib/ellipsis/style/index.scss +35 -35
  72. package/lib/guide/__stories__/style.scss +13 -13
  73. package/lib/guide/style/index.scss +17 -17
  74. package/lib/icon/__stories__/style.scss +39 -39
  75. package/lib/icon/style/index.scss +6 -6
  76. package/lib/index.d.ts +1 -1
  77. package/lib/index.js +14 -2
  78. package/lib/input-number/style/index.scss +86 -86
  79. package/lib/lazy-image/__stories__/style.scss +9 -9
  80. package/lib/lazy-image/style/index.scss +24 -24
  81. package/lib/link-list/style/index.scss +125 -125
  82. package/lib/loading/style/index.scss +30 -30
  83. package/lib/loading-bar/style/index.scss +62 -62
  84. package/lib/loading-container/__stories__/style.scss +5 -5
  85. package/lib/loading-container/style/index.scss +27 -27
  86. package/lib/loading-icon/style/index.scss +23 -23
  87. package/lib/mask/style/index.scss +34 -34
  88. package/lib/message/style/index.scss +70 -70
  89. package/lib/modal/style/index.scss +112 -112
  90. package/lib/move/__stories__/style.scss +6 -6
  91. package/lib/move/style/index.scss +7 -7
  92. package/lib/popover/__stories__/style.scss +15 -15
  93. package/lib/popover/style/index.scss +59 -59
  94. package/lib/select/__stories__/style.scss +8 -8
  95. package/lib/select/style/index.scss +126 -126
  96. package/lib/show-more/style/index.scss +22 -22
  97. package/lib/skeleton/__stories__/style.scss +2 -2
  98. package/lib/skeleton/style/index.scss +26 -26
  99. package/lib/style.css +16 -16
  100. package/lib/table/__stories__/style.scss +33 -33
  101. package/lib/table/style/index.scss +51 -51
  102. package/lib/tabs/__stories__/style.scss +8 -8
  103. package/lib/tabs/style/index.scss +62 -62
  104. package/lib/tooltip/style/index.scss +61 -61
  105. package/lib/trigger/style/index.scss +79 -79
  106. package/package.json +2 -2
@@ -28,6 +28,12 @@ import React from 'react';
28
28
  import classNames from 'classnames';
29
29
  import { isTouchScreen, addEventListener, throttleWithRAF, getElementSize } from '@autobest-ui/utils';
30
30
  import Transition from './transition';
31
+ export var CarouselDirection;
32
+
33
+ (function (CarouselDirection) {
34
+ CarouselDirection["vertical"] = "vertical";
35
+ CarouselDirection["horizontal"] = "horizontal";
36
+ })(CarouselDirection || (CarouselDirection = {}));
31
37
 
32
38
  var Carousel =
33
39
  /** @class */
@@ -38,14 +44,15 @@ function (_super) {
38
44
  var _this = _super.call(this, props) || this;
39
45
 
40
46
  _this.prefixCls = 'ab-carousel';
41
- _this.listRef = React.createRef();
42
- _this.sliderWidth = 0;
43
- _this.contentWidth = 0;
44
- _this.isDirectionLeft = true;
45
- _this.startX = 0;
46
- _this.prevX = 0;
47
- _this.moveX = 0;
48
- _this.endX = 0;
47
+ _this.listRef = React.createRef(); // 当是horizontal时是width, 否则是height
48
+
49
+ _this.sliderSize = 0;
50
+ _this.contentSize = 0;
51
+ _this.isDirectionLeftOrTop = true;
52
+ _this.startSize = 0;
53
+ _this.prevSize = 0;
54
+ _this.moveSize = 0;
55
+ _this.endSize = 0;
49
56
  _this.autoplayTimer = null;
50
57
  _this.fadeEffectTimer = null;
51
58
 
@@ -60,6 +67,20 @@ function (_super) {
60
67
  _this.goTo = function (nextIndex, transition) {
61
68
  _this.interceptorChangePage(nextIndex - 1, transition);
62
69
  };
70
+
71
+ _this.isHorizontalDirection = function () {
72
+ return _this.props.direction === CarouselDirection.horizontal;
73
+ };
74
+
75
+ _this.setElementSizeByDirection = function (element, value) {
76
+ var isHr = _this.isHorizontalDirection();
77
+
78
+ if (isHr) {
79
+ element.style.width = value;
80
+ } else {
81
+ element.style.height = value;
82
+ }
83
+ };
63
84
  /**
64
85
  * 获取滚动元素数量
65
86
  */
@@ -92,11 +113,14 @@ function (_super) {
92
113
  return;
93
114
  }
94
115
 
116
+ var isHr = _this.isHorizontalDirection();
117
+
95
118
  var childCount = _this.getChildCount();
96
119
 
97
- _this.contentWidth = getElementSize(element.parentNode).width; // 没有子元素或者获取不到宽度
120
+ var parentNodeOffset = getElementSize(element.parentNode);
121
+ _this.contentSize = isHr ? parentNodeOffset.width : parentNodeOffset.height; // 没有子元素或者获取不到宽度
98
122
 
99
- if (!childCount || !_this.contentWidth) {
123
+ if (!childCount || !_this.contentSize) {
100
124
  return;
101
125
  } // 执行一次,控制样式,显示slider
102
126
 
@@ -108,23 +132,18 @@ function (_super) {
108
132
  }
109
133
 
110
134
  var currentPage = _this.state.currentPage;
111
- var _a = _this.props,
112
- slidesPerView = _a.slidesPerView,
113
- height = _a.height;
114
- _this.sliderWidth = _this.contentWidth / slidesPerView;
115
- element.style.width = _this.sliderWidth * childCount + "px";
135
+ var slidesPerView = _this.props.slidesPerView;
136
+ _this.sliderSize = _this.contentSize / slidesPerView;
116
137
 
117
- if (height) {
118
- element.style.height = height;
119
- }
138
+ _this.setElementSizeByDirection(element, _this.sliderSize * childCount + "px");
120
139
 
121
140
  var childList = Array.from(element.children);
122
141
  childList.forEach(function (child) {
123
- child.style.width = _this.sliderWidth + "px";
142
+ _this.setElementSizeByDirection(child, _this.sliderSize + "px");
124
143
  });
125
- _this.prevX = -currentPage * _this.sliderWidth;
144
+ _this.prevSize = -currentPage * _this.sliderSize;
126
145
 
127
- _this.setListStyles(element, _this.prevX);
146
+ _this.setListStyles(element, _this.prevSize);
128
147
 
129
148
  _this.onAutoplay();
130
149
  };
@@ -161,11 +180,11 @@ function (_super) {
161
180
  nextPage = 0;
162
181
  }
163
182
 
164
- _this.prevX = -nextPage * _this.sliderWidth;
183
+ _this.prevSize = -nextPage * _this.sliderSize;
165
184
 
166
185
  _this.onBeforeChange(nextPage);
167
186
 
168
- _this.setListStyles(element, _this.prevX, transition);
187
+ _this.setListStyles(element, _this.prevSize, transition);
169
188
 
170
189
  _this.setState({
171
190
  currentPage: nextPage
@@ -178,12 +197,12 @@ function (_super) {
178
197
  /**
179
198
  * 设置容器元素样式,分别是:透明度渐变与位置偏移
180
199
  * @param element
181
- * @param translateX
200
+ * @param translateSize
182
201
  * @param transition
183
202
  */
184
203
 
185
204
 
186
- _this.setListStyles = function (element, translateX, transition) {
205
+ _this.setListStyles = function (element, translateSize, transition) {
187
206
  element.style.transition = ''; // 当开启渐变时,直接执行渐变,将没有位置偏移动画
188
207
 
189
208
  if (_this.props.fadeEffect) {
@@ -199,7 +218,17 @@ function (_super) {
199
218
  element.style.transition = transition || Transition.TransformEaseInOut;
200
219
  }
201
220
 
202
- element.style.transform = "translateX(" + translateX + "px)";
221
+ element.style.transform = _this.isHorizontalDirection() ? "translateX(" + translateSize + "px)" : "translateY(" + translateSize + "px)";
222
+ };
223
+
224
+ _this.getTouchSize = function (event) {
225
+ var isHr = _this.isHorizontalDirection();
226
+
227
+ if (event.touches) {
228
+ return isHr ? event.touches[0].pageX : event.touches[0].pageY;
229
+ }
230
+
231
+ return isHr ? event.clientX : event.clientY;
203
232
  };
204
233
 
205
234
  _this.onBeforeChange = function (currentPage) {
@@ -236,8 +265,8 @@ function (_super) {
236
265
 
237
266
  event.preventDefault();
238
267
  clearTimeout(_this.autoplayTimer);
239
- _this.endX = 0;
240
- _this.startX = event.touches ? event.touches[0].pageX : event.clientX;
268
+ _this.endSize = 0;
269
+ _this.startSize = _this.getTouchSize(event);
241
270
 
242
271
  var element = _this.getListDomNode();
243
272
 
@@ -259,9 +288,9 @@ function (_super) {
259
288
  }
260
289
 
261
290
  event.preventDefault();
262
- _this.endX = event.touches ? event.touches[0].pageX : event.clientX;
263
- _this.moveX = _this.prevX + _this.endX - _this.startX;
264
- _this.isDirectionLeft = _this.prevX - _this.startX <= _this.prevX - _this.endX;
291
+ _this.endSize = _this.getTouchSize(event);
292
+ _this.moveSize = _this.prevSize + _this.endSize - _this.startSize;
293
+ _this.isDirectionLeftOrTop = _this.prevSize - _this.startSize <= _this.prevSize - _this.endSize;
265
294
 
266
295
  var element = _this.getListDomNode();
267
296
 
@@ -269,7 +298,7 @@ function (_super) {
269
298
  return;
270
299
  }
271
300
 
272
- element.style.transform = "translateX(" + _this.moveX + "px)";
301
+ element.style.transform = _this.isHorizontalDirection() ? "translateX(" + _this.moveSize + "px)" : "translateY(" + _this.moveSize + "px)";
273
302
  };
274
303
  /**
275
304
  * 停止滑动,判断用户移动位置,确定用户最终滑动位置
@@ -296,9 +325,9 @@ function (_super) {
296
325
  var currentPage = _this.state.currentPage;
297
326
  var transition = Transition.TransformEaseOut; // 移动的偏移量
298
327
 
299
- var translateX = Math.abs(_this.startX - _this.endX); // 判断用户未产生滑动,认为是点击
328
+ var translateSize = Math.abs(_this.startSize - _this.endSize); // 判断用户未产生滑动,认为是点击
300
329
 
301
- if (_this.endX === 0 || translateX < sensitivity) {
330
+ if (_this.endSize === 0 || translateSize < sensitivity) {
302
331
  if (onClick) {
303
332
  onClick(_this.state.currentPage + 1);
304
333
  }
@@ -310,7 +339,7 @@ function (_super) {
310
339
 
311
340
  event.preventDefault(); // 移出左边临界点
312
341
 
313
- if (_this.moveX >= 0) {
342
+ if (_this.moveSize >= 0) {
314
343
  _this.interceptorChangePage(0, transition);
315
344
 
316
345
  return;
@@ -319,21 +348,21 @@ function (_super) {
319
348
  var childCount = _this.getChildCount(); // 移出右边临界点
320
349
 
321
350
 
322
- var listWidth = _this.sliderWidth * childCount;
323
- var moveX = Math.abs(_this.moveX);
351
+ var listSize = _this.sliderSize * childCount;
352
+ var moveX = Math.abs(_this.moveSize);
324
353
 
325
- if (moveX >= listWidth - _this.contentWidth) {
354
+ if (moveX >= listSize - _this.contentSize) {
326
355
  _this.interceptorChangePage(childCount - slidesPerView, transition);
327
356
 
328
357
  return;
329
358
  } // 未达到一页,判断是否超出sensitivity, 超出将加1
330
359
 
331
360
 
332
- var skipOne = translateX % _this.sliderWidth >= _this.props.sensitivity ? 1 : 0; // 滑动的完整页数
361
+ var skipOne = translateSize % _this.sliderSize >= _this.props.sensitivity ? 1 : 0; // 滑动的完整页数
333
362
 
334
- var skipCount = Math.floor(translateX / _this.sliderWidth); // 判断是否向左滑动
363
+ var skipCount = Math.floor(translateSize / _this.sliderSize); // 判断是否向左滑动
335
364
 
336
- if (_this.isDirectionLeft) {
365
+ if (_this.isDirectionLeftOrTop) {
337
366
  currentPage = currentPage + skipCount + skipOne;
338
367
  } else {
339
368
  currentPage -= skipCount + skipOne;
@@ -376,9 +405,11 @@ function (_super) {
376
405
  Carousel.prototype.componentDidUpdate = function (prevProps) {
377
406
  var _this = this;
378
407
 
379
- var children = this.props.children;
408
+ var _a = this.props,
409
+ children = _a.children,
410
+ direction = _a.direction;
380
411
 
381
- if (React.Children.count(children) !== React.Children.count(prevProps.children)) {
412
+ if (React.Children.count(children) !== React.Children.count(prevProps.children) || direction !== prevProps.direction) {
382
413
  this.init();
383
414
  } // 加入 resize 监听
384
415
 
@@ -429,8 +460,9 @@ function (_super) {
429
460
  className = _b.className,
430
461
  children = _b.children,
431
462
  pagination = _b.pagination;
463
+ var isHr = this.isHorizontalDirection();
432
464
  return React.createElement("div", {
433
- className: classNames(cls, className, (_a = {}, _a[cls + "-init"] = this.state.initialized, _a))
465
+ className: classNames(cls, className, (_a = {}, _a[cls + "-init"] = this.state.initialized, _a[cls + "-hr"] = isHr, _a[cls + "-vt"] = !isHr, _a))
434
466
  }, React.createElement("div", {
435
467
  className: cls + "-content"
436
468
  }, React.createElement("div", {
@@ -451,6 +483,7 @@ function (_super) {
451
483
 
452
484
 
453
485
  Carousel.defaultProps = {
486
+ direction: CarouselDirection.horizontal,
454
487
  slidesPerView: 1,
455
488
  defaultValue: 1,
456
489
  className: '',
@@ -1 +1 @@
1
- .ab-carousel{position:relative}.ab-carousel-content{position:relative;display:block;height:100%;width:100%;margin:0;padding:0;overflow:hidden}.ab-carousel-list{user-select:none;position:relative;top:0;left:0;display:block;overflow:hidden}.ab-carousel-slider{outline:0;overflow:hidden;float:left;display:none}.ab-carousel.ab-carousel-init .ab-carousel-slider{display:block}
1
+ .ab-carousel{position:relative;height:100%}.ab-carousel-content{position:relative;display:block;height:100%;width:100%;margin:0;padding:0;overflow:hidden}.ab-carousel-list{user-select:none;position:relative;top:0;left:0;display:block;overflow:hidden}.ab-carousel-slider{outline:0;overflow:hidden;display:none}.ab-carousel.ab-carousel-init .ab-carousel-slider{display:block}.ab-carousel.ab-carousel-hr .ab-carousel-slider{float:left}
@@ -1,37 +1,43 @@
1
- $namespace: ab-carousel;
2
-
3
- .#{$namespace} {
4
- position: relative;
5
-
6
- &-content {
7
- position: relative;
8
- display: block;
9
- height: 100%;
10
- width: 100%;
11
- margin: 0;
12
- padding: 0;
13
- overflow: hidden;
14
- }
15
-
16
- &-list {
17
- user-select: none;
18
- position: relative;
19
- top: 0;
20
- left: 0;
21
- display: block;
22
- overflow: hidden;
23
- }
24
-
25
- &-slider {
26
- outline: none;
27
- overflow: hidden;
28
- float: left;
29
- display: none;
30
- }
31
-
32
- &.#{$namespace}-init {
33
- .#{$namespace}-slider {
34
- display: block;
35
- }
36
- }
37
- }
1
+ $namespace: ab-carousel;
2
+
3
+ .#{$namespace} {
4
+ position: relative;
5
+ height: 100%;
6
+
7
+ &-content {
8
+ position: relative;
9
+ display: block;
10
+ height: 100%;
11
+ width: 100%;
12
+ margin: 0;
13
+ padding: 0;
14
+ overflow: hidden;
15
+ }
16
+
17
+ &-list {
18
+ user-select: none;
19
+ position: relative;
20
+ top: 0;
21
+ left: 0;
22
+ display: block;
23
+ overflow: hidden;
24
+ }
25
+
26
+ &-slider {
27
+ outline: none;
28
+ overflow: hidden;
29
+ display: none;
30
+ }
31
+
32
+ &.#{$namespace}-init {
33
+ .#{$namespace}-slider {
34
+ display: block;
35
+ }
36
+ }
37
+
38
+ &.#{$namespace}-hr {
39
+ .#{$namespace}-slider {
40
+ float: left;
41
+ }
42
+ }
43
+ }
@@ -1,118 +1,118 @@
1
- $namespace: ab-checkbox;
2
-
3
- .#{$namespace} {
4
- display: inline-block;
5
- position: relative;
6
- font-size: 0;
7
- cursor: pointer;
8
-
9
- &-input {
10
- position: absolute;
11
- opacity: 0;
12
- margin: 0;
13
- padding: 0;
14
- width: 100%;
15
- height: 100%;
16
- cursor: pointer;
17
- z-index: 2;
18
- }
19
-
20
- &-inner {
21
- display: inline-block;
22
- position: relative;
23
- width: .16rem;
24
- height: .16rem;
25
- transition: all .3s;
26
- border: .02rem solid #B0B0B0;
27
- border-radius: .02rem;
28
- background-color: #fff;
29
- }
30
-
31
- &-icon {
32
- visibility: hidden;
33
- position: absolute;
34
- width: .06rem;
35
- height: .1rem;
36
- left: 20%;
37
- top: 40%;
38
- transform: rotate(45deg) scale(0) translate(-50%, -50%);
39
- transition: all .2s;
40
- border: .02rem solid #E84040;
41
- border-top: none;
42
- border-left: none;
43
- }
44
-
45
- &.#{$namespace}-checked {
46
- .#{$namespace} {
47
- &-icon {
48
- visibility: visible;
49
- transform: rotate(45deg) scale(1) translate(-50%, -50%);
50
- }
51
- }
52
- }
53
-
54
- &.#{$namespace}-disabled {
55
- cursor: not-allowed;
56
- color: rgba(0, 0, 0, .25);
57
-
58
- .#{$namespace} {
59
- &-inner {
60
- border-color: #f0f0f0 !important;
61
- background-color: #f5f5f5 !important;
62
- }
63
-
64
- &-icon {
65
- border-color: #cecece;
66
- }
67
-
68
- &-content {
69
- text-decoration: none !important;
70
- }
71
- }
72
- }
73
-
74
- &-wrap {
75
- display: inline-block;
76
- position: relative;
77
- cursor: pointer;
78
-
79
- .#{$namespace} {
80
- position: absolute;
81
- transform: translateY(-50%);
82
- top: 50%;
83
- left: 0;
84
- }
85
-
86
- &:hover {
87
- .#{$namespace}-content {
88
- text-decoration: underline;
89
- }
90
- }
91
- }
92
-
93
- &-content {
94
- padding-left: .24rem;
95
- display: inline-block;
96
- }
97
-
98
- &-wrap.#{$namespace}-reverse {
99
- .#{$namespace} {
100
- left: auto;
101
- right: 0;
102
-
103
- &-content {
104
- padding-left: 0;
105
- padding-right: .24rem;
106
- }
107
- }
108
- }
109
-
110
- &-wrap.#{$namespace}-disabled {
111
- cursor: not-allowed;
112
- color: rgba(0, 0, 0, .25);
113
-
114
- .#{$namespace}-content {
115
- text-decoration: none !important;
116
- }
117
- }
1
+ $namespace: ab-checkbox;
2
+
3
+ .#{$namespace} {
4
+ display: inline-block;
5
+ position: relative;
6
+ font-size: 0;
7
+ cursor: pointer;
8
+
9
+ &-input {
10
+ position: absolute;
11
+ opacity: 0;
12
+ margin: 0;
13
+ padding: 0;
14
+ width: 100%;
15
+ height: 100%;
16
+ cursor: pointer;
17
+ z-index: 2;
18
+ }
19
+
20
+ &-inner {
21
+ display: inline-block;
22
+ position: relative;
23
+ width: .16rem;
24
+ height: .16rem;
25
+ transition: all .3s;
26
+ border: .02rem solid #B0B0B0;
27
+ border-radius: .02rem;
28
+ background-color: #fff;
29
+ }
30
+
31
+ &-icon {
32
+ visibility: hidden;
33
+ position: absolute;
34
+ width: .06rem;
35
+ height: .1rem;
36
+ left: 20%;
37
+ top: 40%;
38
+ transform: rotate(45deg) scale(0) translate(-50%, -50%);
39
+ transition: all .2s;
40
+ border: .02rem solid #E84040;
41
+ border-top: none;
42
+ border-left: none;
43
+ }
44
+
45
+ &.#{$namespace}-checked {
46
+ .#{$namespace} {
47
+ &-icon {
48
+ visibility: visible;
49
+ transform: rotate(45deg) scale(1) translate(-50%, -50%);
50
+ }
51
+ }
52
+ }
53
+
54
+ &.#{$namespace}-disabled {
55
+ cursor: not-allowed;
56
+ color: rgba(0, 0, 0, .25);
57
+
58
+ .#{$namespace} {
59
+ &-inner {
60
+ border-color: #f0f0f0 !important;
61
+ background-color: #f5f5f5 !important;
62
+ }
63
+
64
+ &-icon {
65
+ border-color: #cecece;
66
+ }
67
+
68
+ &-content {
69
+ text-decoration: none !important;
70
+ }
71
+ }
72
+ }
73
+
74
+ &-wrap {
75
+ display: inline-block;
76
+ position: relative;
77
+ cursor: pointer;
78
+
79
+ .#{$namespace} {
80
+ position: absolute;
81
+ transform: translateY(-50%);
82
+ top: 50%;
83
+ left: 0;
84
+ }
85
+
86
+ &:hover {
87
+ .#{$namespace}-content {
88
+ text-decoration: underline;
89
+ }
90
+ }
91
+ }
92
+
93
+ &-content {
94
+ padding-left: .24rem;
95
+ display: inline-block;
96
+ }
97
+
98
+ &-wrap.#{$namespace}-reverse {
99
+ .#{$namespace} {
100
+ left: auto;
101
+ right: 0;
102
+
103
+ &-content {
104
+ padding-left: 0;
105
+ padding-right: .24rem;
106
+ }
107
+ }
108
+ }
109
+
110
+ &-wrap.#{$namespace}-disabled {
111
+ cursor: not-allowed;
112
+ color: rgba(0, 0, 0, .25);
113
+
114
+ .#{$namespace}-content {
115
+ text-decoration: none !important;
116
+ }
117
+ }
118
118
  }
@@ -1,19 +1,19 @@
1
- .demo-collapse{
2
- min-height: 200px;
3
- padding: 0.2rem;
4
- }
5
-
6
- .title-wrap {
7
- width: 1rem;
8
- height: .4rem;
9
- background-color: #3B82F6;
10
- color: #F3F4F6;
11
-
12
- > strong {
13
- display: block;
14
- width: 1rem;
15
- height: .2rem;
16
- background-color: #10B981;
17
- cursor: pointer;
18
- }
1
+ .demo-collapse{
2
+ min-height: 200px;
3
+ padding: 0.2rem;
4
+ }
5
+
6
+ .title-wrap {
7
+ width: 1rem;
8
+ height: .4rem;
9
+ background-color: #3B82F6;
10
+ color: #F3F4F6;
11
+
12
+ > strong {
13
+ display: block;
14
+ width: 1rem;
15
+ height: .2rem;
16
+ background-color: #10B981;
17
+ cursor: pointer;
18
+ }
19
19
  }