@creative-web-solution/front-library 7.1.28 → 7.1.30
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/CHANGELOG.md +10 -0
- package/Modules/DragSlider.ts +381 -383
- package/README.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Modules/DragSlider.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { wait }
|
|
2
|
-
import { debounce }
|
|
3
|
-
import { offset }
|
|
4
|
-
import { gesture, gestureOff }
|
|
5
|
-
import { prop }
|
|
6
|
-
import { aClass, rClass, tClass }
|
|
7
|
-
import { on, off }
|
|
8
|
-
import { isTouchDevice }
|
|
9
|
-
import { extend }
|
|
1
|
+
import { wait } from "../Helpers/Wait";
|
|
2
|
+
import { debounce } from "../Helpers/Debounce";
|
|
3
|
+
import { offset } from "../DOM/Offset";
|
|
4
|
+
import { gesture, gestureOff } from "../Events/Gesture";
|
|
5
|
+
import { prop } from "../DOM/Styles";
|
|
6
|
+
import { aClass, rClass, tClass } from "../DOM/Class";
|
|
7
|
+
import { on, off } from "../Events/EventsManager";
|
|
8
|
+
import { isTouchDevice } from "../Tools/TouchDeviceSupport";
|
|
9
|
+
import { extend } from "../Helpers/Extend";
|
|
10
10
|
|
|
11
11
|
const defaultOptions = {
|
|
12
12
|
swipeTresholdMin: 40,
|
|
13
13
|
swipeTresholdSize: 0.5,
|
|
14
|
-
lockedClass:
|
|
15
|
-
_animReset: function($list) {
|
|
14
|
+
lockedClass: "is-locked",
|
|
15
|
+
_animReset: function ($list) {
|
|
16
16
|
// gsap.set( $list, {
|
|
17
17
|
// "x": 0,
|
|
18
18
|
// "y": 0,
|
|
19
19
|
// "z": 0
|
|
20
20
|
// } );
|
|
21
21
|
},
|
|
22
|
-
_animClear: function($list) {
|
|
22
|
+
_animClear: function ($list) {
|
|
23
23
|
// gsap.set( $list, {
|
|
24
24
|
// "clearProps": "all"
|
|
25
25
|
// } );
|
|
26
26
|
},
|
|
27
|
-
_animKill: function($list) {
|
|
27
|
+
_animKill: function ($list) {
|
|
28
28
|
// gsap.killTweensOf( $list );
|
|
29
29
|
},
|
|
30
|
-
_animMoveItem: function($list, x, onUpdate) {
|
|
30
|
+
_animMoveItem: function ($list, x, onUpdate) {
|
|
31
31
|
// return gsap.to( $list, {
|
|
32
32
|
// "duration": 0.3,
|
|
33
33
|
// "x": x,
|
|
@@ -38,14 +38,14 @@ const defaultOptions = {
|
|
|
38
38
|
// }
|
|
39
39
|
// } );
|
|
40
40
|
},
|
|
41
|
-
_setCoordinates: function($list, x) {
|
|
41
|
+
_setCoordinates: function ($list, x) {
|
|
42
42
|
// gsap.set( $list, {
|
|
43
43
|
// "x": x,
|
|
44
44
|
// "y": 0,
|
|
45
45
|
// "z": 0
|
|
46
46
|
// } );
|
|
47
|
-
}
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
49
|
|
|
50
50
|
const MINIMUM_MOVEMENT_TO_START_DRAG = 3; // px
|
|
51
51
|
|
|
@@ -53,34 +53,35 @@ const MINIMUM_MOVEMENT_TO_START_DRAG = 3; // px
|
|
|
53
53
|
* DragSlider
|
|
54
54
|
*/
|
|
55
55
|
export default class DragSlider {
|
|
56
|
-
#isDraggingActive:
|
|
57
|
-
#options:
|
|
58
|
-
#deltaMove:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
#isDraggingActive: boolean;
|
|
57
|
+
#options: FLib.DragSlider.Options;
|
|
58
|
+
#deltaMove: FLib.DragSlider.DeltaMove = {
|
|
59
|
+
x: 0,
|
|
60
|
+
deltaX: 0,
|
|
61
|
+
deltaY: 0,
|
|
62
|
+
newX: 0,
|
|
63
63
|
};
|
|
64
|
-
#itemArray:
|
|
65
|
-
#$slider:
|
|
64
|
+
#itemArray: FLib.DragSlider.Item[];
|
|
65
|
+
#$slider: HTMLElement;
|
|
66
66
|
#viewportInfo;
|
|
67
|
-
#siteOffsetLeft
|
|
68
|
-
#siteOffsetRight
|
|
69
|
-
#listDelta
|
|
70
|
-
#$viewport:
|
|
71
|
-
#$items:
|
|
72
|
-
#$list:
|
|
73
|
-
#isDragging
|
|
74
|
-
#itemMap
|
|
75
|
-
#firstItem:
|
|
76
|
-
#currentSnapItem:
|
|
77
|
-
#hasAlreadyBeenDragged
|
|
78
|
-
#startDragCoords:
|
|
79
|
-
#isInitialized
|
|
80
|
-
#visibleItems:
|
|
81
|
-
#hiddenItems:
|
|
67
|
+
#siteOffsetLeft = 0;
|
|
68
|
+
#siteOffsetRight = 0;
|
|
69
|
+
#listDelta = 0;
|
|
70
|
+
#$viewport: HTMLElement | undefined;
|
|
71
|
+
#$items: NodeList | undefined;
|
|
72
|
+
#$list: HTMLElement | undefined;
|
|
73
|
+
#isDragging = false;
|
|
74
|
+
#itemMap = new Map<HTMLElement, FLib.DragSlider.Item>();
|
|
75
|
+
#firstItem: FLib.DragSlider.Item | undefined;
|
|
76
|
+
#currentSnapItem: FLib.DragSlider.Item | undefined;
|
|
77
|
+
#hasAlreadyBeenDragged = false;
|
|
78
|
+
#startDragCoords: FLib.Events.Gesture.Coords | undefined;
|
|
79
|
+
#isInitialized = false;
|
|
80
|
+
#visibleItems: FLib.DragSlider.Item[] = [];
|
|
81
|
+
#hiddenItems: FLib.DragSlider.Item[] = [];
|
|
82
82
|
#debouncedOnResize;
|
|
83
|
-
|
|
83
|
+
#minXPos: number = 0;
|
|
84
|
+
#maxXPos: number = 0;
|
|
84
85
|
|
|
85
86
|
get count(): number {
|
|
86
87
|
return this.#$items?.length ?? 0;
|
|
@@ -106,83 +107,108 @@ export default class DragSlider {
|
|
|
106
107
|
return this.#hiddenItems;
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
get firstItem(): FLib.DragSlider.Item | undefined {
|
|
111
|
+
return this.#itemArray[0];
|
|
112
|
+
}
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
get lastItem(): FLib.DragSlider.Item | undefined {
|
|
115
|
+
return this.#itemArray[this.#itemArray.length - 1];
|
|
116
|
+
}
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
constructor(
|
|
119
|
+
$slider: HTMLElement,
|
|
120
|
+
userOptions: Partial<FLib.DragSlider.Options>
|
|
121
|
+
) {
|
|
122
|
+
if (
|
|
123
|
+
!userOptions.viewportSelector ||
|
|
124
|
+
!userOptions.listSelector ||
|
|
125
|
+
!userOptions.itemSelector ||
|
|
126
|
+
!userOptions.dragClass
|
|
127
|
+
) {
|
|
128
|
+
throw "[Drag Slider]: Missing at least one of viewportSelector, listSelector, itemSelector, dragClass";
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
this.#$slider = $slider;
|
|
117
132
|
|
|
118
133
|
this.#isDraggingActive = false;
|
|
119
134
|
|
|
120
|
-
this.#options = extend(
|
|
135
|
+
this.#options = extend(defaultOptions, userOptions);
|
|
121
136
|
|
|
122
137
|
this.#itemArray = [];
|
|
123
138
|
|
|
124
|
-
wait(
|
|
139
|
+
wait("idle").then(this.init);
|
|
125
140
|
}
|
|
126
141
|
|
|
127
|
-
|
|
128
142
|
#cancelLinkClick = (): void => {
|
|
129
|
-
aClass(
|
|
130
|
-
}
|
|
131
|
-
|
|
143
|
+
wait().then(() => aClass(this.#$slider, this.#options.dragClass));
|
|
144
|
+
};
|
|
132
145
|
|
|
133
146
|
#activeLinkClick = (): void => {
|
|
134
|
-
wait().then(
|
|
135
|
-
|
|
136
|
-
} );
|
|
137
|
-
}
|
|
138
|
-
|
|
147
|
+
wait().then(() => rClass(this.#$slider, this.#options.dragClass));
|
|
148
|
+
};
|
|
139
149
|
|
|
140
150
|
#onResize = (): void => {
|
|
141
|
-
if (
|
|
151
|
+
if (!this.#$items || !this.#$list) {
|
|
142
152
|
return;
|
|
143
153
|
}
|
|
144
154
|
|
|
145
|
-
this.#viewportInfo
|
|
146
|
-
this.#siteOffsetLeft
|
|
147
|
-
|
|
155
|
+
this.#viewportInfo = offset(this.#$viewport as HTMLElement);
|
|
156
|
+
this.#siteOffsetLeft = parseInt(
|
|
157
|
+
prop(this.#$items[0] as HTMLElement, "marginLeft"),
|
|
158
|
+
10
|
|
159
|
+
);
|
|
160
|
+
this.#siteOffsetRight = parseInt(
|
|
161
|
+
prop(
|
|
162
|
+
this.#$items[this.#$items.length - 1] as HTMLElement,
|
|
163
|
+
"marginRight"
|
|
164
|
+
),
|
|
165
|
+
10
|
|
166
|
+
);
|
|
148
167
|
|
|
149
|
-
this.#listDelta
|
|
168
|
+
this.#listDelta = this.#getMaxMoveSize();
|
|
169
|
+
|
|
170
|
+
this.#minXPos = 0;
|
|
171
|
+
this.#maxXPos = this.#listDelta;
|
|
150
172
|
|
|
151
173
|
const prevIsDraggingActive = this.#isDraggingActive;
|
|
152
|
-
this.#isDraggingActive
|
|
174
|
+
this.#isDraggingActive = this.#listDelta < 0;
|
|
153
175
|
|
|
154
|
-
if (
|
|
176
|
+
if (!this.#isDraggingActive) {
|
|
155
177
|
this.#isDragging = false;
|
|
156
|
-
this.#options._animKill(
|
|
157
|
-
this.#options._animReset(
|
|
178
|
+
this.#options._animKill(this.#$list);
|
|
179
|
+
this.#options._animReset(this.#$list);
|
|
158
180
|
}
|
|
159
181
|
|
|
160
|
-
tClass(
|
|
182
|
+
tClass(
|
|
183
|
+
this.#$slider,
|
|
184
|
+
this.#options.lockedClass,
|
|
185
|
+
!this.#isDraggingActive
|
|
186
|
+
);
|
|
161
187
|
|
|
162
|
-
if (
|
|
163
|
-
this.#options.onChangeState?.(
|
|
188
|
+
if (prevIsDraggingActive !== this.#isDraggingActive) {
|
|
189
|
+
this.#options.onChangeState?.(this.#isDraggingActive);
|
|
164
190
|
}
|
|
165
191
|
|
|
166
192
|
this.#itemArray.length = 0;
|
|
167
|
-
const ABS_LIST_DELTA = Math.abs(
|
|
193
|
+
const ABS_LIST_DELTA = Math.abs(this.#listDelta);
|
|
168
194
|
|
|
169
195
|
let flag = false;
|
|
170
196
|
|
|
171
197
|
for (let index = 0; index < this.#$items.length; ++index) {
|
|
172
|
-
const $ITEM
|
|
173
|
-
const ITEM_OFFSET = offset(
|
|
198
|
+
const $ITEM = this.#$items[index] as HTMLElement;
|
|
199
|
+
const ITEM_OFFSET = offset($ITEM, false, this.#$list);
|
|
174
200
|
const DATA = {
|
|
175
201
|
index,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
202
|
+
isFirst: index === 0,
|
|
203
|
+
isLast: false,
|
|
204
|
+
$item: $ITEM,
|
|
205
|
+
info: ITEM_OFFSET,
|
|
180
206
|
};
|
|
181
207
|
|
|
182
208
|
if (ITEM_OFFSET.left - this.#siteOffsetLeft <= ABS_LIST_DELTA) {
|
|
183
209
|
this.#itemArray.push(DATA);
|
|
184
210
|
|
|
185
|
-
this.#itemMap.set(
|
|
211
|
+
this.#itemMap.set($ITEM, DATA);
|
|
186
212
|
continue;
|
|
187
213
|
}
|
|
188
214
|
|
|
@@ -201,84 +227,84 @@ export default class DragSlider {
|
|
|
201
227
|
}
|
|
202
228
|
flag = true;
|
|
203
229
|
|
|
204
|
-
this.#itemMap.set(
|
|
230
|
+
this.#itemMap.set($ITEM, DATA);
|
|
205
231
|
}
|
|
206
232
|
|
|
207
|
-
this.#firstItem = this.#itemMap.get(
|
|
233
|
+
this.#firstItem = this.#itemMap.get(
|
|
234
|
+
this.#$items[0] as HTMLElement
|
|
235
|
+
) as FLib.DragSlider.Item;
|
|
208
236
|
|
|
209
|
-
if (
|
|
237
|
+
if (!this.#currentSnapItem) {
|
|
210
238
|
this.#currentSnapItem = this.#firstItem;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
239
|
+
} else {
|
|
240
|
+
this.#currentSnapItem =
|
|
241
|
+
this.#itemArray[this.#currentSnapItem.index];
|
|
214
242
|
}
|
|
215
243
|
|
|
216
244
|
this.#updateAccessibilityFeature();
|
|
217
|
-
}
|
|
218
|
-
|
|
245
|
+
};
|
|
219
246
|
|
|
220
|
-
#snapToItemAnimation =
|
|
247
|
+
#snapToItemAnimation = (snapItem: FLib.DragSlider.Item): Promise<any> => {
|
|
221
248
|
if (!snapItem) {
|
|
222
249
|
return Promise.resolve();
|
|
223
250
|
}
|
|
224
251
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
252
|
+
const finalX = Math.max(
|
|
253
|
+
Math.min(
|
|
254
|
+
this.#minXPos,
|
|
255
|
+
-1 * snapItem.info.left + this.#siteOffsetLeft
|
|
256
|
+
),
|
|
257
|
+
this.#maxXPos
|
|
258
|
+
);
|
|
228
259
|
|
|
229
|
-
|
|
260
|
+
this.#options.onSnap?.(this.#getCallbackOptions(finalX, snapItem));
|
|
230
261
|
|
|
231
|
-
|
|
232
|
-
if ( Math.abs( finalX - this.#listDelta ) <= 3 ) {
|
|
233
|
-
finalX = this.#listDelta;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// If close to the start, then snap to it
|
|
237
|
-
if ( Math.abs( finalX ) <= 3 ) {
|
|
238
|
-
finalX = 0;
|
|
239
|
-
}
|
|
262
|
+
this.#currentSnapItem = snapItem;
|
|
240
263
|
|
|
241
|
-
|
|
242
|
-
|
|
264
|
+
return this.#options
|
|
265
|
+
._animMoveItem(this.#$list, finalX, (newX) => {
|
|
266
|
+
this.#deltaMove.x = newX;
|
|
243
267
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
268
|
+
this.#options.onSnapUpdate?.(
|
|
269
|
+
this.#getCallbackOptions(newX, snapItem)
|
|
270
|
+
);
|
|
271
|
+
})
|
|
272
|
+
.then(() => {
|
|
273
|
+
return this.#updateAccessibilityFeature();
|
|
274
|
+
})
|
|
275
|
+
.then(() => {
|
|
276
|
+
this.#deltaMove.x = finalX;
|
|
277
|
+
this.#options.onSnapEnd?.(
|
|
278
|
+
this.#getCallbackOptions(this.#deltaMove.x)
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
};
|
|
253
282
|
|
|
254
|
-
|
|
283
|
+
#getCallbackOptions(xPos: number, snapItem?: FLib.DragSlider.Item) {
|
|
284
|
+
const IS_SNAP_TO_END = xPos === this.#listDelta;
|
|
285
|
+
const IS_SNAP_TO_START = xPos === 0;
|
|
255
286
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
this.#
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"isAtStart": IS_SNAP_TO_START,
|
|
266
|
-
"isAtEnd": IS_SNAP_TO_END,
|
|
267
|
-
"visibleItems": this.#visibleItems,
|
|
268
|
-
"hiddenItems": this.#hiddenItems
|
|
269
|
-
} );
|
|
270
|
-
} ).then(() => this.#updateAccessibilityFeature());
|
|
287
|
+
return {
|
|
288
|
+
item: snapItem ?? this.#currentSnapItem,
|
|
289
|
+
xPos: this.#deltaMove.x,
|
|
290
|
+
moveMaxSize: this.#listDelta,
|
|
291
|
+
isAtStart: IS_SNAP_TO_START,
|
|
292
|
+
isAtEnd: IS_SNAP_TO_END,
|
|
293
|
+
visibleItems: this.#visibleItems,
|
|
294
|
+
hiddenItems: this.#hiddenItems,
|
|
295
|
+
};
|
|
271
296
|
}
|
|
272
297
|
|
|
273
|
-
|
|
274
|
-
|
|
298
|
+
#getFirstPreviousItem = (
|
|
299
|
+
xPos: number
|
|
300
|
+
): { snapItem: FLib.DragSlider.Item; snapToEnd: boolean } => {
|
|
275
301
|
let snapItem;
|
|
276
302
|
|
|
277
|
-
const absXPos = Math.abs(
|
|
303
|
+
const absXPos = Math.abs(xPos);
|
|
278
304
|
|
|
279
|
-
for (
|
|
280
|
-
if (
|
|
281
|
-
snapItem
|
|
305
|
+
for (const item of this.#itemArray) {
|
|
306
|
+
if (item.info.left <= absXPos) {
|
|
307
|
+
snapItem = item;
|
|
282
308
|
continue;
|
|
283
309
|
}
|
|
284
310
|
break;
|
|
@@ -286,168 +312,173 @@ export default class DragSlider {
|
|
|
286
312
|
|
|
287
313
|
return {
|
|
288
314
|
snapItem,
|
|
289
|
-
|
|
315
|
+
snapToEnd: false,
|
|
290
316
|
};
|
|
291
|
-
}
|
|
292
|
-
|
|
317
|
+
};
|
|
293
318
|
|
|
294
|
-
#getFirstNextItem = (
|
|
319
|
+
#getFirstNextItem = (
|
|
320
|
+
xPos: number
|
|
321
|
+
): { snapItem: FLib.DragSlider.Item; snapToEnd: boolean } => {
|
|
295
322
|
let snapItem;
|
|
296
323
|
|
|
297
|
-
const absXPos = Math.abs(
|
|
324
|
+
const absXPos = Math.abs(xPos);
|
|
298
325
|
|
|
299
|
-
for (
|
|
300
|
-
if (
|
|
326
|
+
for (const item of this.#itemArray) {
|
|
327
|
+
if (item.info.left < absXPos) {
|
|
301
328
|
continue;
|
|
302
329
|
}
|
|
303
330
|
|
|
304
|
-
snapItem
|
|
331
|
+
snapItem = item;
|
|
305
332
|
break;
|
|
306
333
|
}
|
|
307
334
|
|
|
308
335
|
return {
|
|
309
|
-
|
|
310
|
-
|
|
336
|
+
snapItem: snapItem
|
|
337
|
+
? snapItem
|
|
338
|
+
: this.#itemArray[this.#itemArray.length - 1],
|
|
339
|
+
snapToEnd: !snapItem,
|
|
311
340
|
};
|
|
312
|
-
}
|
|
313
|
-
|
|
341
|
+
};
|
|
314
342
|
|
|
315
|
-
#getClosestItem = (
|
|
343
|
+
#getClosestItem = (
|
|
344
|
+
xPos: number
|
|
345
|
+
): { snapItem: FLib.DragSlider.Item; snapToEnd: boolean } => {
|
|
316
346
|
let lastDelta, snapItem;
|
|
317
347
|
|
|
318
|
-
const absXPos = Math.abs(
|
|
348
|
+
const absXPos = Math.abs(xPos);
|
|
319
349
|
|
|
320
|
-
for (
|
|
321
|
-
const IS_LAST_DELTA = typeof lastDelta !==
|
|
322
|
-
const newDelta = Math.abs(
|
|
350
|
+
for (const item of this.#itemArray) {
|
|
351
|
+
const IS_LAST_DELTA = typeof lastDelta !== "undefined";
|
|
352
|
+
const newDelta = Math.abs(
|
|
353
|
+
absXPos - item.info.left + this.#siteOffsetLeft
|
|
354
|
+
);
|
|
323
355
|
|
|
324
|
-
if (
|
|
356
|
+
if (!IS_LAST_DELTA || newDelta <= lastDelta) {
|
|
325
357
|
lastDelta = newDelta;
|
|
326
|
-
snapItem
|
|
358
|
+
snapItem = item;
|
|
327
359
|
}
|
|
328
360
|
}
|
|
329
361
|
|
|
330
362
|
return {
|
|
331
363
|
snapItem,
|
|
332
|
-
snapToEnd: false
|
|
364
|
+
snapToEnd: false,
|
|
333
365
|
};
|
|
334
|
-
}
|
|
335
|
-
|
|
366
|
+
};
|
|
336
367
|
|
|
337
368
|
#snapToItem = (): void => {
|
|
338
369
|
let snapItem;
|
|
339
370
|
|
|
340
|
-
const ABS_DELTA_X = Math.abs(
|
|
371
|
+
const ABS_DELTA_X = Math.abs(this.#deltaMove.deltaX);
|
|
341
372
|
|
|
342
373
|
// If move a bit on right or left, juste move by one item only
|
|
343
|
-
if (
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
374
|
+
if (
|
|
375
|
+
ABS_DELTA_X >= this.#options.swipeTresholdMin &&
|
|
376
|
+
ABS_DELTA_X <
|
|
377
|
+
Math.min(
|
|
378
|
+
(this.#firstItem as FLib.DragSlider.Item).info.width *
|
|
379
|
+
this.#options.swipeTresholdSize,
|
|
380
|
+
this.#options.swipeTresholdMin * 3
|
|
381
|
+
)
|
|
382
|
+
) {
|
|
383
|
+
if (this.#deltaMove.deltaX < 0) {
|
|
384
|
+
snapItem = this.#getFirstNextItem(this.#deltaMove.x);
|
|
385
|
+
} else {
|
|
386
|
+
snapItem = this.#getFirstPreviousItem(this.#deltaMove.x);
|
|
349
387
|
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
snapItem = this.#getClosestItem( this.#deltaMove.x );
|
|
388
|
+
} else {
|
|
389
|
+
snapItem = this.#getClosestItem(this.#deltaMove.x);
|
|
353
390
|
}
|
|
354
391
|
|
|
355
|
-
if (
|
|
392
|
+
if (!snapItem) {
|
|
356
393
|
return;
|
|
357
394
|
}
|
|
358
395
|
|
|
359
|
-
this.#snapToItemAnimation(
|
|
360
|
-
|
|
361
|
-
"item": this.#currentSnapItem,
|
|
362
|
-
"xPos": this.#deltaMove.x,
|
|
363
|
-
"moveMaxSize": this.#listDelta,
|
|
364
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
365
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
366
|
-
"visibleItems": this.#visibleItems,
|
|
367
|
-
"hiddenItems": this.#hiddenItems
|
|
368
|
-
})
|
|
369
|
-
});
|
|
370
|
-
}
|
|
396
|
+
this.#snapToItemAnimation(snapItem.snapItem);
|
|
397
|
+
};
|
|
371
398
|
|
|
399
|
+
#getMaxMoveSize(): number {
|
|
400
|
+
return (
|
|
401
|
+
this.#viewportInfo.width -
|
|
402
|
+
this.#$list!.scrollWidth -
|
|
403
|
+
this.#siteOffsetLeft
|
|
404
|
+
);
|
|
405
|
+
}
|
|
372
406
|
|
|
373
|
-
#onStartDrag = (
|
|
374
|
-
|
|
407
|
+
#onStartDrag = (
|
|
408
|
+
e: Event,
|
|
409
|
+
$target: HTMLElement,
|
|
410
|
+
coords: FLib.Events.Gesture.Coords
|
|
411
|
+
): void => {
|
|
412
|
+
if (!this.#hasAlreadyBeenDragged) {
|
|
375
413
|
this.#onResize();
|
|
376
414
|
this.#hasAlreadyBeenDragged = true;
|
|
377
415
|
}
|
|
378
416
|
|
|
379
|
-
if (
|
|
417
|
+
if (!this.#isDraggingActive || !this.#$list) {
|
|
380
418
|
return;
|
|
381
419
|
}
|
|
382
420
|
|
|
383
421
|
this.#isDragging = true;
|
|
384
422
|
|
|
385
|
-
this.#options._animKill(
|
|
423
|
+
this.#options._animKill(this.#$list);
|
|
386
424
|
|
|
387
425
|
this.#startDragCoords = coords;
|
|
388
|
-
this.#listDelta
|
|
389
|
-
this.#deltaMove.newX
|
|
390
|
-
|
|
391
|
-
gesture(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (
|
|
426
|
+
this.#listDelta = this.#getMaxMoveSize();
|
|
427
|
+
this.#deltaMove.newX = this.#deltaMove.x;
|
|
428
|
+
|
|
429
|
+
gesture(document.body, "dragSlider", {
|
|
430
|
+
move: this.#onMove,
|
|
431
|
+
end: this.#onStopDrag,
|
|
432
|
+
preventMove: (e) => {
|
|
433
|
+
if (!e.cancelable) {
|
|
396
434
|
return false;
|
|
397
435
|
}
|
|
398
436
|
|
|
399
|
-
return
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
"moveMaxSize": this.#listDelta,
|
|
408
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
409
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
410
|
-
"visibleItems": this.#visibleItems,
|
|
411
|
-
"hiddenItems": this.#hiddenItems
|
|
412
|
-
} );
|
|
413
|
-
}
|
|
414
|
-
|
|
437
|
+
return (
|
|
438
|
+
!isTouchDevice ||
|
|
439
|
+
(isTouchDevice &&
|
|
440
|
+
Math.abs(this.#deltaMove.deltaY) <
|
|
441
|
+
Math.abs(this.#deltaMove.deltaX))
|
|
442
|
+
);
|
|
443
|
+
},
|
|
444
|
+
});
|
|
415
445
|
|
|
416
|
-
|
|
417
|
-
|
|
446
|
+
this.#options.onStartDrag?.(
|
|
447
|
+
this.#getCallbackOptions(this.#deltaMove.x)
|
|
448
|
+
);
|
|
449
|
+
};
|
|
418
450
|
|
|
419
|
-
|
|
420
|
-
|
|
451
|
+
#onMove = (
|
|
452
|
+
e: Event,
|
|
453
|
+
$target: HTMLElement,
|
|
454
|
+
coords: FLib.Events.Gesture.Coords
|
|
455
|
+
): void => {
|
|
456
|
+
this.#deltaMove.deltaX =
|
|
457
|
+
coords.pageX -
|
|
458
|
+
(this.#startDragCoords as FLib.Events.Gesture.Coords).pageX;
|
|
459
|
+
this.#deltaMove.deltaY =
|
|
460
|
+
coords.pageY -
|
|
461
|
+
(this.#startDragCoords as FLib.Events.Gesture.Coords).pageY;
|
|
421
462
|
|
|
422
463
|
if (Math.abs(this.#deltaMove.deltaX) < MINIMUM_MOVEMENT_TO_START_DRAG) {
|
|
423
464
|
return;
|
|
424
465
|
}
|
|
425
466
|
|
|
426
|
-
this.#
|
|
467
|
+
this.#cancelLinkClick();
|
|
427
468
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
469
|
+
this.#deltaMove.newX = this.#deltaMove.deltaX + this.#deltaMove.x;
|
|
470
|
+
this.#deltaMove.newX = Math.max(
|
|
471
|
+
Math.min(this.#minXPos, this.#deltaMove.newX),
|
|
472
|
+
this.#maxXPos
|
|
473
|
+
);
|
|
434
474
|
|
|
435
475
|
this.#options._setCoordinates(this.#$list, this.#deltaMove.newX);
|
|
436
476
|
|
|
437
|
-
this.#options.onDrag?.(
|
|
438
|
-
|
|
439
|
-
"xPos": this.#deltaMove.newX,
|
|
440
|
-
"moveMaxSize": this.#listDelta,
|
|
441
|
-
"isAtStart": this.#deltaMove.newX === 0,
|
|
442
|
-
"isAtEnd": this.#deltaMove.newX === this.#listDelta,
|
|
443
|
-
"visibleItems": this.#visibleItems,
|
|
444
|
-
"hiddenItems": this.#hiddenItems
|
|
445
|
-
} );
|
|
446
|
-
}
|
|
447
|
-
|
|
477
|
+
this.#options.onDrag?.(this.#getCallbackOptions(this.#deltaMove.newX));
|
|
478
|
+
};
|
|
448
479
|
|
|
449
480
|
#onStopDrag = (): void => {
|
|
450
|
-
gestureOff(
|
|
481
|
+
gestureOff(document.body, "dragSlider");
|
|
451
482
|
this.#isDragging = false;
|
|
452
483
|
|
|
453
484
|
this.#activeLinkClick();
|
|
@@ -460,138 +491,109 @@ export default class DragSlider {
|
|
|
460
491
|
|
|
461
492
|
this.#snapToItem();
|
|
462
493
|
|
|
463
|
-
this.#options.onStopDrag?.(
|
|
464
|
-
|
|
465
|
-
"xPos": this.#deltaMove.x,
|
|
466
|
-
"moveMaxSize": this.#listDelta,
|
|
467
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
468
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
469
|
-
"visibleItems": this.#visibleItems,
|
|
470
|
-
"hiddenItems": this.#hiddenItems
|
|
471
|
-
} );
|
|
472
|
-
}
|
|
473
|
-
|
|
494
|
+
this.#options.onStopDrag?.(this.#getCallbackOptions(this.#deltaMove.x));
|
|
495
|
+
};
|
|
474
496
|
|
|
475
497
|
#onMouseenter = (): void => {
|
|
476
|
-
if (
|
|
498
|
+
if (this.#isDragging || !this.#isDraggingActive) {
|
|
477
499
|
return;
|
|
478
500
|
}
|
|
479
501
|
|
|
480
|
-
this.#options.onMouseEnter?.(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
485
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
486
|
-
"visibleItems": this.#visibleItems,
|
|
487
|
-
"hiddenItems": this.#hiddenItems
|
|
488
|
-
} );
|
|
489
|
-
}
|
|
490
|
-
|
|
502
|
+
this.#options.onMouseEnter?.(
|
|
503
|
+
this.#getCallbackOptions(this.#deltaMove.x)
|
|
504
|
+
);
|
|
505
|
+
};
|
|
491
506
|
|
|
492
507
|
#onMouseleave = (): void => {
|
|
493
|
-
if (
|
|
508
|
+
if (this.#isDragging || !this.#isDraggingActive) {
|
|
494
509
|
return;
|
|
495
510
|
}
|
|
496
511
|
|
|
497
|
-
this.#options.onMouseLeave?.(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
502
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
503
|
-
"visibleItems": this.#visibleItems,
|
|
504
|
-
"hiddenItems": this.#hiddenItems
|
|
505
|
-
} );
|
|
506
|
-
}
|
|
507
|
-
|
|
512
|
+
this.#options.onMouseLeave?.(
|
|
513
|
+
this.#getCallbackOptions(this.#deltaMove.x)
|
|
514
|
+
);
|
|
515
|
+
};
|
|
508
516
|
|
|
509
|
-
#cancelDrag = (
|
|
517
|
+
#cancelDrag = (e: Event): void => {
|
|
510
518
|
e.preventDefault();
|
|
511
|
-
}
|
|
512
|
-
|
|
519
|
+
};
|
|
513
520
|
|
|
514
521
|
next(): Promise<any> {
|
|
515
522
|
const CURRENT_ITEM = this.#currentSnapItem as FLib.DragSlider.Item;
|
|
516
523
|
|
|
517
|
-
if (
|
|
524
|
+
if (
|
|
525
|
+
!this.#isDraggingActive ||
|
|
526
|
+
!this.#itemArray[CURRENT_ITEM.index + 1]
|
|
527
|
+
) {
|
|
518
528
|
return Promise.resolve();
|
|
519
529
|
}
|
|
520
530
|
|
|
521
|
-
return this.#snapToItemAnimation(
|
|
531
|
+
return this.#snapToItemAnimation(
|
|
532
|
+
this.#itemArray[CURRENT_ITEM.index + 1]
|
|
533
|
+
);
|
|
522
534
|
}
|
|
523
535
|
|
|
524
|
-
|
|
525
536
|
previous(): Promise<any> {
|
|
526
537
|
const CURRENT_ITEM = this.#currentSnapItem as FLib.DragSlider.Item;
|
|
527
538
|
|
|
528
|
-
if (
|
|
539
|
+
if (!this.#isDraggingActive || CURRENT_ITEM.isFirst) {
|
|
529
540
|
return Promise.resolve();
|
|
530
541
|
}
|
|
531
542
|
|
|
532
|
-
return this.#snapToItemAnimation(
|
|
543
|
+
return this.#snapToItemAnimation(
|
|
544
|
+
this.#itemArray[CURRENT_ITEM.index - 1]
|
|
545
|
+
);
|
|
533
546
|
}
|
|
534
547
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
if ( !this.#isDraggingActive ) {
|
|
548
|
+
goToItem(blockOrIndex: HTMLElement | number): Promise<any> {
|
|
549
|
+
if (!this.#isDraggingActive) {
|
|
539
550
|
return Promise.resolve();
|
|
540
551
|
}
|
|
541
552
|
|
|
542
553
|
let $block;
|
|
543
554
|
|
|
544
|
-
if (typeof blockOrIndex ===
|
|
555
|
+
if (typeof blockOrIndex === "number") {
|
|
545
556
|
$block = this.#$items?.[blockOrIndex] as HTMLElement;
|
|
546
|
-
}
|
|
547
|
-
else {
|
|
557
|
+
} else {
|
|
548
558
|
$block = blockOrIndex;
|
|
549
559
|
}
|
|
550
560
|
|
|
551
|
-
if (
|
|
561
|
+
if (!$block) {
|
|
552
562
|
return Promise.resolve();
|
|
553
563
|
}
|
|
554
564
|
|
|
555
|
-
const ITEM = this.#itemMap.get(
|
|
565
|
+
const ITEM = this.#itemMap.get($block);
|
|
556
566
|
|
|
557
|
-
if (
|
|
567
|
+
if (!ITEM) {
|
|
558
568
|
return Promise.resolve();
|
|
559
569
|
}
|
|
560
570
|
|
|
561
571
|
this.#currentSnapItem = ITEM;
|
|
562
572
|
|
|
563
|
-
this.#
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
this.#options.onSnapUpdate?.( {
|
|
577
|
-
"item": ITEM,
|
|
578
|
-
"xPos": this.#deltaMove.x,
|
|
579
|
-
"moveMaxSize": this.#listDelta,
|
|
580
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
581
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
582
|
-
"visibleItems": this.#visibleItems,
|
|
583
|
-
"hiddenItems": this.#hiddenItems
|
|
584
|
-
} );
|
|
585
|
-
}).then(() => this.#updateAccessibilityFeature());
|
|
573
|
+
const xPos = -1 * ITEM.info.left + this.#siteOffsetLeft;
|
|
574
|
+
|
|
575
|
+
this.#options.onSnap?.(this.#getCallbackOptions(xPos, ITEM));
|
|
576
|
+
|
|
577
|
+
return this.#options
|
|
578
|
+
._animMoveItem(this.#$list, xPos, (x) => {
|
|
579
|
+
this.#deltaMove.x = x;
|
|
580
|
+
|
|
581
|
+
this.#options.onSnapUpdate?.(
|
|
582
|
+
this.#getCallbackOptions(this.#deltaMove.x, ITEM)
|
|
583
|
+
);
|
|
584
|
+
})
|
|
585
|
+
.then(() => this.#updateAccessibilityFeature());
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
#updateAccessibilityFeature = (): void => {
|
|
589
589
|
this.#visibleItems.length = 0;
|
|
590
590
|
this.#hiddenItems.length = 0;
|
|
591
591
|
|
|
592
|
-
this.#itemMap.forEach(item => {
|
|
592
|
+
this.#itemMap.forEach((item) => {
|
|
593
593
|
const hideElement1 = item.info.left + this.#deltaMove.x < 0;
|
|
594
|
-
const hideElement2 =
|
|
594
|
+
const hideElement2 =
|
|
595
|
+
item.info.left + item.info.width + this.#deltaMove.x >
|
|
596
|
+
this.#viewportInfo.width;
|
|
595
597
|
|
|
596
598
|
if (hideElement1 || hideElement2) {
|
|
597
599
|
item.$item.setAttribute("tabindex", "-1");
|
|
@@ -606,132 +608,128 @@ export default class DragSlider {
|
|
|
606
608
|
item.$item.setAttribute("aria-hidden", "false");
|
|
607
609
|
this.#visibleItems.push(item);
|
|
608
610
|
});
|
|
609
|
-
}
|
|
611
|
+
};
|
|
610
612
|
|
|
611
613
|
refresh = (): this => {
|
|
612
614
|
this.#onResize();
|
|
613
615
|
|
|
614
616
|
return this;
|
|
615
|
-
}
|
|
617
|
+
};
|
|
616
618
|
|
|
617
619
|
init = (): this => {
|
|
618
|
-
if (
|
|
620
|
+
if (this.#isInitialized) {
|
|
619
621
|
return this;
|
|
620
622
|
}
|
|
621
623
|
|
|
622
624
|
this.#isInitialized = true;
|
|
623
625
|
|
|
624
|
-
if (
|
|
625
|
-
const $VP = this.#$slider.querySelector(
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
if (!this.#$viewport) {
|
|
627
|
+
const $VP = this.#$slider.querySelector(
|
|
628
|
+
this.#options.viewportSelector
|
|
629
|
+
);
|
|
630
|
+
if (!$VP) {
|
|
631
|
+
throw `"${this.#options.viewportSelector}" not found`;
|
|
628
632
|
}
|
|
629
|
-
this.#$viewport
|
|
633
|
+
this.#$viewport = $VP as HTMLElement;
|
|
630
634
|
|
|
631
|
-
const $LST = this.#$viewport.querySelector(
|
|
632
|
-
|
|
633
|
-
|
|
635
|
+
const $LST = this.#$viewport.querySelector(
|
|
636
|
+
this.#options.listSelector
|
|
637
|
+
);
|
|
638
|
+
if (!$LST) {
|
|
639
|
+
throw `"${this.#options.listSelector}" not found`;
|
|
634
640
|
}
|
|
635
|
-
this.#$list
|
|
641
|
+
this.#$list = $LST as HTMLElement;
|
|
636
642
|
|
|
637
|
-
const $ITEMS = this.#$list.querySelectorAll(
|
|
638
|
-
|
|
639
|
-
|
|
643
|
+
const $ITEMS = this.#$list.querySelectorAll(
|
|
644
|
+
this.#options.itemSelector
|
|
645
|
+
);
|
|
646
|
+
if (!$ITEMS) {
|
|
647
|
+
throw `"${this.#options.itemSelector}" not found`;
|
|
640
648
|
}
|
|
641
|
-
this.#$items
|
|
649
|
+
this.#$items = $ITEMS as NodeList;
|
|
642
650
|
|
|
643
|
-
this.#debouncedOnResize = debounce(
|
|
651
|
+
this.#debouncedOnResize = debounce(this.#onResize);
|
|
644
652
|
}
|
|
645
653
|
|
|
646
|
-
if (
|
|
654
|
+
if (!this.#$items?.length) {
|
|
647
655
|
return this;
|
|
648
656
|
}
|
|
649
657
|
|
|
650
|
-
aClass(
|
|
658
|
+
aClass(this.#$slider, "is-active");
|
|
651
659
|
|
|
652
660
|
this.#onResize();
|
|
653
661
|
|
|
654
|
-
on(
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}
|
|
662
|
+
on(window, {
|
|
663
|
+
eventsName: "resize",
|
|
664
|
+
callback: this.#debouncedOnResize,
|
|
665
|
+
});
|
|
658
666
|
|
|
659
|
-
gesture(
|
|
660
|
-
|
|
661
|
-
}
|
|
667
|
+
gesture(this.#$viewport, "dragSlider", {
|
|
668
|
+
start: this.#onStartDrag,
|
|
669
|
+
});
|
|
662
670
|
|
|
663
671
|
// Avoid image or content drag on Firefox
|
|
664
|
-
on(
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
on( this.#$viewport, {
|
|
670
|
-
"eventsName": "mouseenter",
|
|
671
|
-
"callback": this.#onMouseenter
|
|
672
|
-
} );
|
|
673
|
-
|
|
674
|
-
on( this.#$viewport, {
|
|
675
|
-
"eventsName": "mouseleave",
|
|
676
|
-
"callback": this.#onMouseleave
|
|
677
|
-
} );
|
|
678
|
-
|
|
679
|
-
this.#options.onInit?.( {
|
|
680
|
-
"item": this.#currentSnapItem,
|
|
681
|
-
"xPos": this.#deltaMove.x,
|
|
682
|
-
"moveMaxSize": this.#listDelta,
|
|
683
|
-
"isAtStart": this.#deltaMove.x === 0,
|
|
684
|
-
"isAtEnd": this.#deltaMove.x === this.#listDelta,
|
|
685
|
-
"visibleItems": this.#visibleItems,
|
|
686
|
-
"hiddenItems": this.#hiddenItems
|
|
687
|
-
} );
|
|
672
|
+
on(this.#$items, {
|
|
673
|
+
eventsName: "dragstart",
|
|
674
|
+
callback: this.#cancelDrag,
|
|
675
|
+
});
|
|
688
676
|
|
|
689
|
-
|
|
690
|
-
|
|
677
|
+
on(this.#$viewport, {
|
|
678
|
+
eventsName: "mouseenter",
|
|
679
|
+
callback: this.#onMouseenter,
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
on(this.#$viewport, {
|
|
683
|
+
eventsName: "mouseleave",
|
|
684
|
+
callback: this.#onMouseleave,
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
this.#options.onInit?.(this.#getCallbackOptions(this.#deltaMove.x));
|
|
691
688
|
|
|
689
|
+
return this;
|
|
690
|
+
};
|
|
692
691
|
|
|
693
692
|
destroy(): this {
|
|
694
|
-
this.#isInitialized
|
|
693
|
+
this.#isInitialized = false;
|
|
695
694
|
this.#hasAlreadyBeenDragged = false;
|
|
696
695
|
|
|
697
|
-
if (
|
|
696
|
+
if (!this.#$items?.length) {
|
|
698
697
|
return this;
|
|
699
698
|
}
|
|
700
699
|
|
|
701
|
-
off(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}
|
|
700
|
+
off(window, {
|
|
701
|
+
eventsName: "resize",
|
|
702
|
+
callback: this.#debouncedOnResize,
|
|
703
|
+
});
|
|
705
704
|
|
|
706
|
-
this.#$viewport && gestureOff(
|
|
705
|
+
this.#$viewport && gestureOff(this.#$viewport, "dragSlider");
|
|
707
706
|
|
|
708
|
-
gestureOff(
|
|
707
|
+
gestureOff(document.body, "dragSlider");
|
|
709
708
|
|
|
710
|
-
off(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
709
|
+
off(this.#$items, {
|
|
710
|
+
eventsName: "dragstart",
|
|
711
|
+
callback: this.#cancelDrag,
|
|
712
|
+
});
|
|
714
713
|
|
|
715
|
-
off(
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
714
|
+
off(this.#$viewport, {
|
|
715
|
+
eventsName: "mouseenter",
|
|
716
|
+
callback: this.#onMouseenter,
|
|
717
|
+
});
|
|
719
718
|
|
|
720
|
-
off(
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
}
|
|
719
|
+
off(this.#$viewport, {
|
|
720
|
+
eventsName: "mouseleave",
|
|
721
|
+
callback: this.#onMouseleave,
|
|
722
|
+
});
|
|
724
723
|
|
|
725
|
-
if (
|
|
726
|
-
this.#options._animKill(
|
|
727
|
-
this.#options._animClear(
|
|
724
|
+
if (this.#$list) {
|
|
725
|
+
this.#options._animKill(this.#$list);
|
|
726
|
+
this.#options._animClear(this.#$list);
|
|
728
727
|
}
|
|
729
728
|
|
|
730
|
-
this.#$viewport && rClass(
|
|
729
|
+
this.#$viewport && rClass(this.#$viewport, this.#options.dragClass);
|
|
731
730
|
|
|
732
|
-
rClass(
|
|
731
|
+
rClass(this.#$slider, "is-active");
|
|
733
732
|
|
|
734
733
|
return this;
|
|
735
734
|
}
|
|
736
|
-
|
|
737
735
|
}
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@creative-web-solution/front-library",
|
|
3
3
|
"title": "Frontend library",
|
|
4
4
|
"description": "Frontend functions and modules",
|
|
5
|
-
"version": "7.1.
|
|
5
|
+
"version": "7.1.30",
|
|
6
6
|
"homepage": "https://github.com/creative-web-solution/front-library",
|
|
7
7
|
"author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
|
|
8
8
|
"keywords": [],
|