@autobest-ui/components 1.1.5 → 1.2.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.
- package/README.md +10 -10
- package/esm/accordion/__stories__/style.scss +58 -58
- package/esm/affix/__stories__/style.scss +13 -13
- package/esm/affix/style/index.scss +34 -34
- package/esm/base.scss +42 -42
- package/esm/carousel/__stories__/style.scss +41 -41
- package/esm/carousel/index.d.ts +21 -13
- package/esm/carousel/index.js +77 -44
- package/esm/carousel/style/index.css +1 -1
- package/esm/carousel/style/index.scss +43 -37
- package/esm/checkbox/style/index.scss +117 -117
- package/esm/collapse/__stories__/style.scss +18 -18
- package/esm/collapse/style/index.scss +42 -42
- package/esm/confirm/style/index.scss +44 -44
- package/esm/date-picker/calendar/grid/index.scss +85 -85
- package/esm/date-picker/calendar/index.scss +57 -57
- package/esm/date-picker/style/index.scss +18 -18
- package/esm/drawer/style/index.scss +44 -44
- package/esm/ellipsis/style/index.scss +35 -35
- package/esm/guide/__stories__/style.scss +13 -13
- package/esm/guide/style/index.scss +17 -17
- package/esm/icon/__stories__/style.scss +39 -39
- package/esm/icon/style/index.scss +6 -6
- package/esm/index.d.ts +1 -1
- package/esm/input-number/style/index.scss +86 -86
- package/esm/lazy-image/__stories__/style.scss +9 -9
- package/esm/lazy-image/style/index.scss +24 -24
- package/esm/link-list/style/index.scss +125 -125
- package/esm/loading/style/index.scss +30 -30
- package/esm/loading-bar/style/index.scss +62 -62
- package/esm/loading-container/__stories__/style.scss +5 -5
- package/esm/loading-container/style/index.scss +27 -27
- package/esm/loading-icon/style/index.scss +23 -23
- package/esm/mask/style/index.scss +34 -34
- package/esm/message/style/index.scss +70 -70
- package/esm/modal/style/index.scss +112 -112
- package/esm/move/__stories__/style.scss +6 -6
- package/esm/move/style/index.scss +7 -7
- package/esm/popover/__stories__/style.scss +15 -15
- package/esm/popover/style/index.scss +59 -59
- package/esm/select/__stories__/style.scss +8 -8
- package/esm/select/style/index.scss +126 -126
- package/esm/show-more/style/index.scss +22 -22
- package/esm/skeleton/__stories__/style.scss +2 -2
- package/esm/skeleton/style/index.scss +26 -26
- package/esm/style.css +15 -15
- package/esm/table/__stories__/style.scss +33 -33
- package/esm/table/style/index.scss +51 -51
- package/esm/tabs/__stories__/style.scss +8 -8
- package/esm/tabs/style/index.scss +62 -62
- package/esm/tooltip/style/index.scss +61 -61
- package/esm/trigger/style/index.scss +79 -79
- package/lib/accordion/__stories__/style.scss +58 -58
- package/lib/affix/__stories__/style.scss +13 -13
- package/lib/affix/style/index.scss +34 -34
- package/lib/base.scss +42 -42
- package/lib/carousel/__stories__/style.scss +41 -41
- package/lib/carousel/index.d.ts +21 -13
- package/lib/carousel/index.js +80 -45
- package/lib/carousel/style/index.css +1 -1
- package/lib/carousel/style/index.scss +43 -37
- package/lib/checkbox/style/index.scss +117 -117
- package/lib/collapse/__stories__/style.scss +18 -18
- package/lib/collapse/style/index.scss +42 -42
- package/lib/confirm/style/index.scss +44 -44
- package/lib/date-picker/calendar/grid/index.scss +85 -85
- package/lib/date-picker/calendar/index.scss +57 -57
- package/lib/date-picker/style/index.scss +18 -18
- package/lib/drawer/style/index.scss +44 -44
- package/lib/ellipsis/style/index.scss +35 -35
- package/lib/guide/__stories__/style.scss +13 -13
- package/lib/guide/style/index.scss +17 -17
- package/lib/icon/__stories__/style.scss +39 -39
- package/lib/icon/style/index.scss +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/input-number/style/index.scss +86 -86
- package/lib/lazy-image/__stories__/style.scss +9 -9
- package/lib/lazy-image/style/index.scss +24 -24
- package/lib/link-list/style/index.scss +125 -125
- package/lib/loading/style/index.scss +30 -30
- package/lib/loading-bar/style/index.scss +62 -62
- package/lib/loading-container/__stories__/style.scss +5 -5
- package/lib/loading-container/style/index.scss +27 -27
- package/lib/loading-icon/style/index.scss +23 -23
- package/lib/mask/style/index.scss +34 -34
- package/lib/message/style/index.scss +70 -70
- package/lib/modal/style/index.scss +112 -112
- package/lib/move/__stories__/style.scss +6 -6
- package/lib/move/style/index.scss +7 -7
- package/lib/popover/__stories__/style.scss +15 -15
- package/lib/popover/style/index.scss +59 -59
- package/lib/select/__stories__/style.scss +8 -8
- package/lib/select/style/index.scss +126 -126
- package/lib/show-more/style/index.scss +22 -22
- package/lib/skeleton/__stories__/style.scss +2 -2
- package/lib/skeleton/style/index.scss +26 -26
- package/lib/style.css +15 -15
- package/lib/table/__stories__/style.scss +33 -33
- package/lib/table/style/index.scss +51 -51
- package/lib/tabs/__stories__/style.scss +8 -8
- package/lib/tabs/style/index.scss +62 -62
- package/lib/tooltip/style/index.scss +61 -61
- package/lib/trigger/style/index.scss +79 -79
- package/package.json +2 -2
package/esm/carousel/index.js
CHANGED
|
@@ -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
|
-
|
|
43
|
-
_this.
|
|
44
|
-
_this.
|
|
45
|
-
_this.
|
|
46
|
-
_this.
|
|
47
|
-
_this.
|
|
48
|
-
_this.
|
|
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
|
-
|
|
120
|
+
var parentNodeOffset = getElementSize(element.parentNode);
|
|
121
|
+
_this.contentSize = isHr ? parentNodeOffset.width : parentNodeOffset.height; // 没有子元素或者获取不到宽度
|
|
98
122
|
|
|
99
|
-
if (!childCount || !_this.
|
|
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
|
|
112
|
-
|
|
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
|
-
|
|
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
|
|
142
|
+
_this.setElementSizeByDirection(child, _this.sliderSize + "px");
|
|
124
143
|
});
|
|
125
|
-
_this.
|
|
144
|
+
_this.prevSize = -currentPage * _this.sliderSize;
|
|
126
145
|
|
|
127
|
-
_this.setListStyles(element, _this.
|
|
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.
|
|
183
|
+
_this.prevSize = -nextPage * _this.sliderSize;
|
|
165
184
|
|
|
166
185
|
_this.onBeforeChange(nextPage);
|
|
167
186
|
|
|
168
|
-
_this.setListStyles(element, _this.
|
|
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
|
|
200
|
+
* @param translateSize
|
|
182
201
|
* @param transition
|
|
183
202
|
*/
|
|
184
203
|
|
|
185
204
|
|
|
186
|
-
_this.setListStyles = function (element,
|
|
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(" +
|
|
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.
|
|
240
|
-
_this.
|
|
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.
|
|
263
|
-
_this.
|
|
264
|
-
_this.
|
|
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.
|
|
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
|
|
328
|
+
var translateSize = Math.abs(_this.startSize - _this.endSize); // 判断用户未产生滑动,认为是点击
|
|
300
329
|
|
|
301
|
-
if (_this.
|
|
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.
|
|
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
|
|
323
|
-
var moveX = Math.abs(_this.
|
|
351
|
+
var listSize = _this.sliderSize * childCount;
|
|
352
|
+
var moveX = Math.abs(_this.moveSize);
|
|
324
353
|
|
|
325
|
-
if (moveX >=
|
|
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 =
|
|
361
|
+
var skipOne = translateSize % _this.sliderSize >= _this.props.sensitivity ? 1 : 0; // 滑动的完整页数
|
|
333
362
|
|
|
334
|
-
var skipCount = Math.floor(
|
|
363
|
+
var skipCount = Math.floor(translateSize / _this.sliderSize); // 判断是否向左滑动
|
|
335
364
|
|
|
336
|
-
if (_this.
|
|
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
|
|
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;
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
}
|