@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.
- 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/index.js +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 +16 -16
- 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/index.js +14 -2
- 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 +16 -16
- 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/lib/carousel/index.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddListenerEventHandler } from '@autobest-ui/utils';
|
|
3
|
+
export declare enum CarouselDirection {
|
|
4
|
+
vertical = "vertical",
|
|
5
|
+
horizontal = "horizontal"
|
|
6
|
+
}
|
|
3
7
|
export interface CarouselProps {
|
|
4
8
|
children: React.ReactElement[] | React.ReactElement;
|
|
5
9
|
/**
|
|
6
10
|
* 一行显示的数量
|
|
7
11
|
*/
|
|
8
12
|
slidesPerView?: number;
|
|
13
|
+
/**
|
|
14
|
+
* 滚动方向
|
|
15
|
+
*/
|
|
16
|
+
direction?: CarouselDirection;
|
|
9
17
|
/**
|
|
10
18
|
* 监听resize
|
|
11
19
|
*/
|
|
@@ -14,10 +22,6 @@ export interface CarouselProps {
|
|
|
14
22
|
* 是否可以手动控制 只支持移动端
|
|
15
23
|
*/
|
|
16
24
|
controllable?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 组件高度,可以不写,不写情况下,自动获取高度
|
|
19
|
-
*/
|
|
20
|
-
height?: string;
|
|
21
25
|
/**
|
|
22
26
|
* 敏感值,设置多少后可以进行切换, 只有在 controllable = true时生效
|
|
23
27
|
*/
|
|
@@ -53,17 +57,18 @@ interface CarouselStates {
|
|
|
53
57
|
declare class Carousel extends React.Component<CarouselProps, CarouselStates> {
|
|
54
58
|
readonly prefixCls = "ab-carousel";
|
|
55
59
|
listRef: React.RefObject<HTMLDivElement>;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
sliderSize: number;
|
|
61
|
+
contentSize: number;
|
|
62
|
+
isDirectionLeftOrTop: boolean;
|
|
59
63
|
intersectionObserver: IntersectionObserver;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
startSize: number;
|
|
65
|
+
prevSize: number;
|
|
66
|
+
moveSize: number;
|
|
67
|
+
endSize: number;
|
|
64
68
|
autoplayTimer: any;
|
|
65
69
|
fadeEffectTimer: any;
|
|
66
70
|
static defaultProps: {
|
|
71
|
+
direction: CarouselDirection;
|
|
67
72
|
slidesPerView: number;
|
|
68
73
|
defaultValue: number;
|
|
69
74
|
className: string;
|
|
@@ -82,6 +87,8 @@ declare class Carousel extends React.Component<CarouselProps, CarouselStates> {
|
|
|
82
87
|
next: (transition?: string) => void;
|
|
83
88
|
prev: (transition?: string) => void;
|
|
84
89
|
goTo: (nextIndex: number, transition?: string) => void;
|
|
90
|
+
isHorizontalDirection: () => boolean;
|
|
91
|
+
setElementSizeByDirection: (element: HTMLElement, value: string) => void;
|
|
85
92
|
/**
|
|
86
93
|
* 获取滚动元素数量
|
|
87
94
|
*/
|
|
@@ -103,10 +110,11 @@ declare class Carousel extends React.Component<CarouselProps, CarouselStates> {
|
|
|
103
110
|
/**
|
|
104
111
|
* 设置容器元素样式,分别是:透明度渐变与位置偏移
|
|
105
112
|
* @param element
|
|
106
|
-
* @param
|
|
113
|
+
* @param translateSize
|
|
107
114
|
* @param transition
|
|
108
115
|
*/
|
|
109
|
-
setListStyles: (element: HTMLElement,
|
|
116
|
+
setListStyles: (element: HTMLElement, translateSize: number, transition?: string) => void;
|
|
117
|
+
getTouchSize: (event: any) => any;
|
|
110
118
|
/**
|
|
111
119
|
* 开启自动偏移或者渐变,当元素少于2时,将不会开启
|
|
112
120
|
*/
|
package/lib/carousel/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
8
|
+
exports.default = exports.CarouselDirection = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
@@ -41,6 +41,14 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
41
41
|
};
|
|
42
42
|
}();
|
|
43
43
|
|
|
44
|
+
var CarouselDirection;
|
|
45
|
+
exports.CarouselDirection = CarouselDirection;
|
|
46
|
+
|
|
47
|
+
(function (CarouselDirection) {
|
|
48
|
+
CarouselDirection["vertical"] = "vertical";
|
|
49
|
+
CarouselDirection["horizontal"] = "horizontal";
|
|
50
|
+
})(CarouselDirection || (exports.CarouselDirection = CarouselDirection = {}));
|
|
51
|
+
|
|
44
52
|
var Carousel =
|
|
45
53
|
/** @class */
|
|
46
54
|
function (_super) {
|
|
@@ -50,14 +58,15 @@ function (_super) {
|
|
|
50
58
|
var _this = _super.call(this, props) || this;
|
|
51
59
|
|
|
52
60
|
_this.prefixCls = 'ab-carousel';
|
|
53
|
-
_this.listRef = _react.default.createRef();
|
|
54
|
-
|
|
55
|
-
_this.
|
|
56
|
-
_this.
|
|
57
|
-
_this.
|
|
58
|
-
_this.
|
|
59
|
-
_this.
|
|
60
|
-
_this.
|
|
61
|
+
_this.listRef = _react.default.createRef(); // 当是horizontal时是width, 否则是height
|
|
62
|
+
|
|
63
|
+
_this.sliderSize = 0;
|
|
64
|
+
_this.contentSize = 0;
|
|
65
|
+
_this.isDirectionLeftOrTop = true;
|
|
66
|
+
_this.startSize = 0;
|
|
67
|
+
_this.prevSize = 0;
|
|
68
|
+
_this.moveSize = 0;
|
|
69
|
+
_this.endSize = 0;
|
|
61
70
|
_this.autoplayTimer = null;
|
|
62
71
|
_this.fadeEffectTimer = null;
|
|
63
72
|
|
|
@@ -72,6 +81,20 @@ function (_super) {
|
|
|
72
81
|
_this.goTo = function (nextIndex, transition) {
|
|
73
82
|
_this.interceptorChangePage(nextIndex - 1, transition);
|
|
74
83
|
};
|
|
84
|
+
|
|
85
|
+
_this.isHorizontalDirection = function () {
|
|
86
|
+
return _this.props.direction === CarouselDirection.horizontal;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
_this.setElementSizeByDirection = function (element, value) {
|
|
90
|
+
var isHr = _this.isHorizontalDirection();
|
|
91
|
+
|
|
92
|
+
if (isHr) {
|
|
93
|
+
element.style.width = value;
|
|
94
|
+
} else {
|
|
95
|
+
element.style.height = value;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
75
98
|
/**
|
|
76
99
|
* 获取滚动元素数量
|
|
77
100
|
*/
|
|
@@ -104,11 +127,14 @@ function (_super) {
|
|
|
104
127
|
return;
|
|
105
128
|
}
|
|
106
129
|
|
|
130
|
+
var isHr = _this.isHorizontalDirection();
|
|
131
|
+
|
|
107
132
|
var childCount = _this.getChildCount();
|
|
108
133
|
|
|
109
|
-
|
|
134
|
+
var parentNodeOffset = (0, _utils.getElementSize)(element.parentNode);
|
|
135
|
+
_this.contentSize = isHr ? parentNodeOffset.width : parentNodeOffset.height; // 没有子元素或者获取不到宽度
|
|
110
136
|
|
|
111
|
-
if (!childCount || !_this.
|
|
137
|
+
if (!childCount || !_this.contentSize) {
|
|
112
138
|
return;
|
|
113
139
|
} // 执行一次,控制样式,显示slider
|
|
114
140
|
|
|
@@ -120,23 +146,18 @@ function (_super) {
|
|
|
120
146
|
}
|
|
121
147
|
|
|
122
148
|
var currentPage = _this.state.currentPage;
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
height = _a.height;
|
|
126
|
-
_this.sliderWidth = _this.contentWidth / slidesPerView;
|
|
127
|
-
element.style.width = _this.sliderWidth * childCount + "px";
|
|
149
|
+
var slidesPerView = _this.props.slidesPerView;
|
|
150
|
+
_this.sliderSize = _this.contentSize / slidesPerView;
|
|
128
151
|
|
|
129
|
-
|
|
130
|
-
element.style.height = height;
|
|
131
|
-
}
|
|
152
|
+
_this.setElementSizeByDirection(element, _this.sliderSize * childCount + "px");
|
|
132
153
|
|
|
133
154
|
var childList = Array.from(element.children);
|
|
134
155
|
childList.forEach(function (child) {
|
|
135
|
-
child
|
|
156
|
+
_this.setElementSizeByDirection(child, _this.sliderSize + "px");
|
|
136
157
|
});
|
|
137
|
-
_this.
|
|
158
|
+
_this.prevSize = -currentPage * _this.sliderSize;
|
|
138
159
|
|
|
139
|
-
_this.setListStyles(element, _this.
|
|
160
|
+
_this.setListStyles(element, _this.prevSize);
|
|
140
161
|
|
|
141
162
|
_this.onAutoplay();
|
|
142
163
|
};
|
|
@@ -173,11 +194,11 @@ function (_super) {
|
|
|
173
194
|
nextPage = 0;
|
|
174
195
|
}
|
|
175
196
|
|
|
176
|
-
_this.
|
|
197
|
+
_this.prevSize = -nextPage * _this.sliderSize;
|
|
177
198
|
|
|
178
199
|
_this.onBeforeChange(nextPage);
|
|
179
200
|
|
|
180
|
-
_this.setListStyles(element, _this.
|
|
201
|
+
_this.setListStyles(element, _this.prevSize, transition);
|
|
181
202
|
|
|
182
203
|
_this.setState({
|
|
183
204
|
currentPage: nextPage
|
|
@@ -190,12 +211,12 @@ function (_super) {
|
|
|
190
211
|
/**
|
|
191
212
|
* 设置容器元素样式,分别是:透明度渐变与位置偏移
|
|
192
213
|
* @param element
|
|
193
|
-
* @param
|
|
214
|
+
* @param translateSize
|
|
194
215
|
* @param transition
|
|
195
216
|
*/
|
|
196
217
|
|
|
197
218
|
|
|
198
|
-
_this.setListStyles = function (element,
|
|
219
|
+
_this.setListStyles = function (element, translateSize, transition) {
|
|
199
220
|
element.style.transition = ''; // 当开启渐变时,直接执行渐变,将没有位置偏移动画
|
|
200
221
|
|
|
201
222
|
if (_this.props.fadeEffect) {
|
|
@@ -211,7 +232,17 @@ function (_super) {
|
|
|
211
232
|
element.style.transition = transition || _transition.default.TransformEaseInOut;
|
|
212
233
|
}
|
|
213
234
|
|
|
214
|
-
element.style.transform = "translateX(" +
|
|
235
|
+
element.style.transform = _this.isHorizontalDirection() ? "translateX(" + translateSize + "px)" : "translateY(" + translateSize + "px)";
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
_this.getTouchSize = function (event) {
|
|
239
|
+
var isHr = _this.isHorizontalDirection();
|
|
240
|
+
|
|
241
|
+
if (event.touches) {
|
|
242
|
+
return isHr ? event.touches[0].pageX : event.touches[0].pageY;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return isHr ? event.clientX : event.clientY;
|
|
215
246
|
};
|
|
216
247
|
|
|
217
248
|
_this.onBeforeChange = function (currentPage) {
|
|
@@ -248,8 +279,8 @@ function (_super) {
|
|
|
248
279
|
|
|
249
280
|
event.preventDefault();
|
|
250
281
|
clearTimeout(_this.autoplayTimer);
|
|
251
|
-
_this.
|
|
252
|
-
_this.
|
|
282
|
+
_this.endSize = 0;
|
|
283
|
+
_this.startSize = _this.getTouchSize(event);
|
|
253
284
|
|
|
254
285
|
var element = _this.getListDomNode();
|
|
255
286
|
|
|
@@ -271,9 +302,9 @@ function (_super) {
|
|
|
271
302
|
}
|
|
272
303
|
|
|
273
304
|
event.preventDefault();
|
|
274
|
-
_this.
|
|
275
|
-
_this.
|
|
276
|
-
_this.
|
|
305
|
+
_this.endSize = _this.getTouchSize(event);
|
|
306
|
+
_this.moveSize = _this.prevSize + _this.endSize - _this.startSize;
|
|
307
|
+
_this.isDirectionLeftOrTop = _this.prevSize - _this.startSize <= _this.prevSize - _this.endSize;
|
|
277
308
|
|
|
278
309
|
var element = _this.getListDomNode();
|
|
279
310
|
|
|
@@ -281,7 +312,7 @@ function (_super) {
|
|
|
281
312
|
return;
|
|
282
313
|
}
|
|
283
314
|
|
|
284
|
-
element.style.transform = "translateX(" + _this.
|
|
315
|
+
element.style.transform = _this.isHorizontalDirection() ? "translateX(" + _this.moveSize + "px)" : "translateY(" + _this.moveSize + "px)";
|
|
285
316
|
};
|
|
286
317
|
/**
|
|
287
318
|
* 停止滑动,判断用户移动位置,确定用户最终滑动位置
|
|
@@ -308,9 +339,9 @@ function (_super) {
|
|
|
308
339
|
var currentPage = _this.state.currentPage;
|
|
309
340
|
var transition = _transition.default.TransformEaseOut; // 移动的偏移量
|
|
310
341
|
|
|
311
|
-
var
|
|
342
|
+
var translateSize = Math.abs(_this.startSize - _this.endSize); // 判断用户未产生滑动,认为是点击
|
|
312
343
|
|
|
313
|
-
if (_this.
|
|
344
|
+
if (_this.endSize === 0 || translateSize < sensitivity) {
|
|
314
345
|
if (onClick) {
|
|
315
346
|
onClick(_this.state.currentPage + 1);
|
|
316
347
|
}
|
|
@@ -322,7 +353,7 @@ function (_super) {
|
|
|
322
353
|
|
|
323
354
|
event.preventDefault(); // 移出左边临界点
|
|
324
355
|
|
|
325
|
-
if (_this.
|
|
356
|
+
if (_this.moveSize >= 0) {
|
|
326
357
|
_this.interceptorChangePage(0, transition);
|
|
327
358
|
|
|
328
359
|
return;
|
|
@@ -331,21 +362,21 @@ function (_super) {
|
|
|
331
362
|
var childCount = _this.getChildCount(); // 移出右边临界点
|
|
332
363
|
|
|
333
364
|
|
|
334
|
-
var
|
|
335
|
-
var moveX = Math.abs(_this.
|
|
365
|
+
var listSize = _this.sliderSize * childCount;
|
|
366
|
+
var moveX = Math.abs(_this.moveSize);
|
|
336
367
|
|
|
337
|
-
if (moveX >=
|
|
368
|
+
if (moveX >= listSize - _this.contentSize) {
|
|
338
369
|
_this.interceptorChangePage(childCount - slidesPerView, transition);
|
|
339
370
|
|
|
340
371
|
return;
|
|
341
372
|
} // 未达到一页,判断是否超出sensitivity, 超出将加1
|
|
342
373
|
|
|
343
374
|
|
|
344
|
-
var skipOne =
|
|
375
|
+
var skipOne = translateSize % _this.sliderSize >= _this.props.sensitivity ? 1 : 0; // 滑动的完整页数
|
|
345
376
|
|
|
346
|
-
var skipCount = Math.floor(
|
|
377
|
+
var skipCount = Math.floor(translateSize / _this.sliderSize); // 判断是否向左滑动
|
|
347
378
|
|
|
348
|
-
if (_this.
|
|
379
|
+
if (_this.isDirectionLeftOrTop) {
|
|
349
380
|
currentPage = currentPage + skipCount + skipOne;
|
|
350
381
|
} else {
|
|
351
382
|
currentPage -= skipCount + skipOne;
|
|
@@ -388,9 +419,11 @@ function (_super) {
|
|
|
388
419
|
Carousel.prototype.componentDidUpdate = function (prevProps) {
|
|
389
420
|
var _this = this;
|
|
390
421
|
|
|
391
|
-
var
|
|
422
|
+
var _a = this.props,
|
|
423
|
+
children = _a.children,
|
|
424
|
+
direction = _a.direction;
|
|
392
425
|
|
|
393
|
-
if (_react.default.Children.count(children) !== _react.default.Children.count(prevProps.children)) {
|
|
426
|
+
if (_react.default.Children.count(children) !== _react.default.Children.count(prevProps.children) || direction !== prevProps.direction) {
|
|
394
427
|
this.init();
|
|
395
428
|
} // 加入 resize 监听
|
|
396
429
|
|
|
@@ -441,8 +474,9 @@ function (_super) {
|
|
|
441
474
|
className = _b.className,
|
|
442
475
|
children = _b.children,
|
|
443
476
|
pagination = _b.pagination;
|
|
477
|
+
var isHr = this.isHorizontalDirection();
|
|
444
478
|
return _react.default.createElement("div", {
|
|
445
|
-
className: (0, _classnames.default)(cls, className, (_a = {}, _a[cls + "-init"] = this.state.initialized, _a))
|
|
479
|
+
className: (0, _classnames.default)(cls, className, (_a = {}, _a[cls + "-init"] = this.state.initialized, _a[cls + "-hr"] = isHr, _a[cls + "-vt"] = !isHr, _a))
|
|
446
480
|
}, _react.default.createElement("div", {
|
|
447
481
|
className: cls + "-content"
|
|
448
482
|
}, _react.default.createElement("div", {
|
|
@@ -463,6 +497,7 @@ function (_super) {
|
|
|
463
497
|
|
|
464
498
|
|
|
465
499
|
Carousel.defaultProps = {
|
|
500
|
+
direction: CarouselDirection.horizontal,
|
|
466
501
|
slidesPerView: 1,
|
|
467
502
|
defaultValue: 1,
|
|
468
503
|
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
|
}
|