@daouypkgs/react-slick 0.0.256
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 +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +8 -0
- package/dist/react-slick.cjs.development.js +632 -0
- package/dist/react-slick.cjs.development.js.map +1 -0
- package/dist/react-slick.cjs.production.min.js +2 -0
- package/dist/react-slick.cjs.production.min.js.map +1 -0
- package/dist/react-slick.esm.js +623 -0
- package/dist/react-slick.esm.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Daouy registration call for react-slick
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import registerComponent, { ComponentHelpers } from "@daouy/host/registerComponent";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Slider, { Settings } from "react-slick";
|
|
4
|
+
declare type SliderProps = Settings & {
|
|
5
|
+
arrowColor?: string;
|
|
6
|
+
sliderScopeClassName: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sliderHelpers: ComponentHelpers<SliderProps>;
|
|
9
|
+
export declare type SliderMethods = Pick<Slider, "slickGoTo" | "slickNext" | "slickPause" | "slickPlay" | "slickPrev">;
|
|
10
|
+
export declare const SliderWrapper: React.ForwardRefExoticComponent<Settings & {
|
|
11
|
+
arrowColor?: string | undefined;
|
|
12
|
+
sliderScopeClassName: string;
|
|
13
|
+
} & React.RefAttributes<Pick<Slider, "slickGoTo" | "slickNext" | "slickPause" | "slickPlay" | "slickPrev">>>;
|
|
14
|
+
export declare function registerSlider(loader?: {
|
|
15
|
+
registerComponent: typeof registerComponent;
|
|
16
|
+
}): void;
|
|
17
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var host = require('@daouy/host');
|
|
8
|
+
var registerComponent = _interopDefault(require('@daouy/host/registerComponent'));
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var React__default = _interopDefault(React);
|
|
11
|
+
var Slider = _interopDefault(require('react-slick'));
|
|
12
|
+
|
|
13
|
+
function _extends() {
|
|
14
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
15
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
16
|
+
var t = arguments[e];
|
|
17
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}, _extends.apply(null, arguments);
|
|
21
|
+
}
|
|
22
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
23
|
+
if (null == r) return {};
|
|
24
|
+
var t = {};
|
|
25
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
26
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
27
|
+
t[n] = r[n];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var _excluded = ["initialSlide", "arrowColor", "className", "sliderScopeClassName", "autoplay"];
|
|
33
|
+
var sliderHelpers = {
|
|
34
|
+
states: {
|
|
35
|
+
currentSlide: {
|
|
36
|
+
onChangeArgsToValue: function onChangeArgsToValue(_, newIndex) {
|
|
37
|
+
return newIndex;
|
|
38
|
+
},
|
|
39
|
+
onMutate: function onMutate(stateValue, $ref) {
|
|
40
|
+
$ref.slickGoTo(stateValue);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
function useDebounce(value, delay) {
|
|
46
|
+
var _useState = React.useState(value),
|
|
47
|
+
debouncedValue = _useState[0],
|
|
48
|
+
setDebouncedValue = _useState[1];
|
|
49
|
+
React.useEffect(function () {
|
|
50
|
+
var timer = setTimeout(function () {
|
|
51
|
+
return setDebouncedValue(value);
|
|
52
|
+
}, delay || 500);
|
|
53
|
+
return function () {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
};
|
|
56
|
+
}, [value, delay]);
|
|
57
|
+
return debouncedValue;
|
|
58
|
+
}
|
|
59
|
+
var SliderWrapper = /*#__PURE__*/React.forwardRef(function SliderWrapper_(props, userRef) {
|
|
60
|
+
var initialSlide = props.initialSlide,
|
|
61
|
+
arrowColor = props.arrowColor,
|
|
62
|
+
className = props.className,
|
|
63
|
+
sliderScopeClassName = props.sliderScopeClassName,
|
|
64
|
+
autoplay = props.autoplay,
|
|
65
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
66
|
+
// "data-daouy-canvas-envs" prop only exists in studio canvas
|
|
67
|
+
var inCanvas = !!host.useDaouyCanvasContext();
|
|
68
|
+
var slider = React.useRef(null);
|
|
69
|
+
var debouncedInitialSlide = useDebounce(initialSlide);
|
|
70
|
+
React.useEffect(function () {
|
|
71
|
+
if (debouncedInitialSlide !== undefined) {
|
|
72
|
+
var _slider$current;
|
|
73
|
+
(_slider$current = slider.current) == null || _slider$current.slickGoTo(debouncedInitialSlide);
|
|
74
|
+
}
|
|
75
|
+
}, [debouncedInitialSlide, inCanvas]);
|
|
76
|
+
React__default.useImperativeHandle(userRef, function () {
|
|
77
|
+
return {
|
|
78
|
+
slickGoTo: function slickGoTo(index, dontAnimate) {
|
|
79
|
+
if (slider.current) {
|
|
80
|
+
var slickGoTo = slider.current.slickGoTo;
|
|
81
|
+
slickGoTo(index, dontAnimate);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
slickNext: function slickNext() {
|
|
85
|
+
if (slider.current) {
|
|
86
|
+
var slickNext = slider.current.slickNext;
|
|
87
|
+
slickNext();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
slickPause: function slickPause() {
|
|
91
|
+
if (slider.current) {
|
|
92
|
+
var slickPause = slider.current.slickPause;
|
|
93
|
+
slickPause();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
slickPlay: function slickPlay() {
|
|
97
|
+
if (slider.current) {
|
|
98
|
+
var slickPlay = slider.current.slickPlay;
|
|
99
|
+
slickPlay();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
slickPrev: function slickPrev() {
|
|
103
|
+
if (slider.current) {
|
|
104
|
+
var slickPrev = slider.current.slickPrev;
|
|
105
|
+
slickPrev();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
110
|
+
var css = "\n ." + sliderScopeClassName + " .slick-arrow:before {\n color: " + (arrowColor != null ? arrowColor : "black") + ";\n }\n ." + sliderScopeClassName + " .slick-slide img:only-child,\n ." + sliderScopeClassName + " .slick-slide .__wab_img-wrapper:only-child {\n " + "\n " + "\n display: inline-block;\n vertical-align: top;\n }\n ";
|
|
111
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Slider, Object.assign({
|
|
112
|
+
className: className + " " + sliderScopeClassName,
|
|
113
|
+
ref: slider,
|
|
114
|
+
// We don't want to turn on autoplay while editing in canvas, because this
|
|
115
|
+
// leads to a state update for current slide, which ends up re-rendering
|
|
116
|
+
// the entire artboard.
|
|
117
|
+
autoplay: autoplay && !inCanvas ? autoplay : undefined
|
|
118
|
+
}, rest)), React__default.createElement("style", {
|
|
119
|
+
dangerouslySetInnerHTML: {
|
|
120
|
+
__html: css
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
function registerSlider(loader) {
|
|
125
|
+
function getSlideInfo(_ref) {
|
|
126
|
+
var _ref$rows = _ref.rows,
|
|
127
|
+
rows = _ref$rows === void 0 ? 1 : _ref$rows,
|
|
128
|
+
_ref$slidesPerRow = _ref.slidesPerRow,
|
|
129
|
+
slidesPerRow = _ref$slidesPerRow === void 0 ? 1 : _ref$slidesPerRow,
|
|
130
|
+
_ref$initialSlide = _ref.initialSlide,
|
|
131
|
+
initialSlide = _ref$initialSlide === void 0 ? 0 : _ref$initialSlide,
|
|
132
|
+
children = _ref.children;
|
|
133
|
+
var slidesCnt = Array.isArray(children) ? children.length : 1;
|
|
134
|
+
var slidesPerDot = rows * slidesPerRow;
|
|
135
|
+
var dotCount = Math.ceil(slidesCnt / slidesPerDot);
|
|
136
|
+
var currentDotIndex = initialSlide >= dotCount ? dotCount - 1 : initialSlide;
|
|
137
|
+
return {
|
|
138
|
+
currentDotIndex: currentDotIndex,
|
|
139
|
+
slidesPerDot: slidesPerDot,
|
|
140
|
+
dotCount: dotCount,
|
|
141
|
+
totalSlides: slidesCnt
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function CurrentSlideDropdown(_ref2) {
|
|
145
|
+
var componentProps = _ref2.componentProps,
|
|
146
|
+
studioOps = _ref2.studioOps;
|
|
147
|
+
var _getSlideInfo = getSlideInfo(componentProps),
|
|
148
|
+
dotCount = _getSlideInfo.dotCount,
|
|
149
|
+
currentDotIndex = _getSlideInfo.currentDotIndex;
|
|
150
|
+
var options = Array.from({
|
|
151
|
+
length: dotCount
|
|
152
|
+
}, function (_, i) {
|
|
153
|
+
return i;
|
|
154
|
+
}).map(function (i) {
|
|
155
|
+
return React__default.createElement("option", {
|
|
156
|
+
key: i,
|
|
157
|
+
value: i.toString()
|
|
158
|
+
}, "Slide ", i);
|
|
159
|
+
});
|
|
160
|
+
var handleChange = function handleChange(e) {
|
|
161
|
+
studioOps.updateStates({
|
|
162
|
+
currentSlide: Number(e.target.value)
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return React__default.createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
width: "100%",
|
|
168
|
+
display: "flex",
|
|
169
|
+
flexDirection: "row",
|
|
170
|
+
gap: "10px",
|
|
171
|
+
justifyContent: "space-between"
|
|
172
|
+
}
|
|
173
|
+
}, React__default.createElement("div", null, "Current slide:"), React__default.createElement("select", {
|
|
174
|
+
defaultValue: currentDotIndex.toString(),
|
|
175
|
+
style: {
|
|
176
|
+
width: "100%"
|
|
177
|
+
},
|
|
178
|
+
onChange: handleChange,
|
|
179
|
+
value: currentDotIndex.toString()
|
|
180
|
+
}, options));
|
|
181
|
+
}
|
|
182
|
+
function NavigateSlides(_ref3) {
|
|
183
|
+
var componentProps = _ref3.componentProps,
|
|
184
|
+
studioOps = _ref3.studioOps;
|
|
185
|
+
var _getSlideInfo2 = getSlideInfo(componentProps),
|
|
186
|
+
dotCount = _getSlideInfo2.dotCount,
|
|
187
|
+
currentDotIndex = _getSlideInfo2.currentDotIndex;
|
|
188
|
+
var btnStyles = {
|
|
189
|
+
width: "100%",
|
|
190
|
+
backgroundColor: "#f3f3f2",
|
|
191
|
+
borderRadius: 6
|
|
192
|
+
};
|
|
193
|
+
return React__default.createElement("div", {
|
|
194
|
+
style: {
|
|
195
|
+
width: "100%",
|
|
196
|
+
display: "flex",
|
|
197
|
+
flexDirection: "row",
|
|
198
|
+
gap: "10px",
|
|
199
|
+
justifyContent: "space-between"
|
|
200
|
+
}
|
|
201
|
+
}, React__default.createElement("button", {
|
|
202
|
+
style: btnStyles,
|
|
203
|
+
onClick: function onClick() {
|
|
204
|
+
var prevSlide = currentDotIndex === 0 ? dotCount - 1 : (currentDotIndex - 1) % dotCount;
|
|
205
|
+
studioOps.updateStates({
|
|
206
|
+
currentSlide: prevSlide
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}, "Prev slide"), React__default.createElement("button", {
|
|
210
|
+
style: btnStyles,
|
|
211
|
+
onClick: function onClick() {
|
|
212
|
+
var nextSlide = (currentDotIndex + 1) % dotCount;
|
|
213
|
+
studioOps.updateStates({
|
|
214
|
+
currentSlide: nextSlide
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}, "Next slide"));
|
|
218
|
+
}
|
|
219
|
+
function OutlineMessage() {
|
|
220
|
+
return React__default.createElement("div", null, "* To re-arrange slides, use the Outline panel");
|
|
221
|
+
}
|
|
222
|
+
var sliderMeta = {
|
|
223
|
+
name: "hostless-slider",
|
|
224
|
+
displayName: "Slider Carousel",
|
|
225
|
+
importName: "SliderWrapper",
|
|
226
|
+
importPath: "@daouypkgs/react-slick",
|
|
227
|
+
description: "[See tutorial video](https://www.youtube.com/watch?v=GMgXLbNHX8c)",
|
|
228
|
+
actions: [{
|
|
229
|
+
type: "custom-action",
|
|
230
|
+
control: CurrentSlideDropdown
|
|
231
|
+
}, {
|
|
232
|
+
type: "custom-action",
|
|
233
|
+
control: NavigateSlides
|
|
234
|
+
}, {
|
|
235
|
+
type: "button-action",
|
|
236
|
+
label: "Append new slide",
|
|
237
|
+
onClick: function onClick(_ref4) {
|
|
238
|
+
var componentProps = _ref4.componentProps,
|
|
239
|
+
studioOps = _ref4.studioOps;
|
|
240
|
+
var _getSlideInfo3 = getSlideInfo(componentProps),
|
|
241
|
+
dotCount = _getSlideInfo3.dotCount,
|
|
242
|
+
slidesPerDot = _getSlideInfo3.slidesPerDot,
|
|
243
|
+
totalSlides = _getSlideInfo3.totalSlides;
|
|
244
|
+
var currentSlide = totalSlides % slidesPerDot ? dotCount - 1 : dotCount;
|
|
245
|
+
studioOps.appendToSlot({
|
|
246
|
+
type: "img",
|
|
247
|
+
src: "",
|
|
248
|
+
styles: {
|
|
249
|
+
maxWidth: "100%"
|
|
250
|
+
}
|
|
251
|
+
}, "children");
|
|
252
|
+
studioOps.updateStates({
|
|
253
|
+
currentSlide: currentSlide
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}, {
|
|
257
|
+
type: "button-action",
|
|
258
|
+
label: "Delete current slide",
|
|
259
|
+
hidden: function hidden(ps) {
|
|
260
|
+
var _ps$children;
|
|
261
|
+
return ((_ps$children = ps.children) == null || (_ps$children = _ps$children.type) == null ? void 0 : _ps$children.name) === "CanvasSlotPlaceholder";
|
|
262
|
+
},
|
|
263
|
+
onClick: function onClick(_ref5) {
|
|
264
|
+
var componentProps = _ref5.componentProps,
|
|
265
|
+
studioOps = _ref5.studioOps;
|
|
266
|
+
var _getSlideInfo4 = getSlideInfo(componentProps),
|
|
267
|
+
currentDotIndex = _getSlideInfo4.currentDotIndex,
|
|
268
|
+
dotCount = _getSlideInfo4.dotCount,
|
|
269
|
+
slidesPerDot = _getSlideInfo4.slidesPerDot,
|
|
270
|
+
totalSlides = _getSlideInfo4.totalSlides;
|
|
271
|
+
studioOps.removeFromSlotAt(currentDotIndex * slidesPerDot, "children");
|
|
272
|
+
var newPos = currentDotIndex;
|
|
273
|
+
if (dotCount === 1) {
|
|
274
|
+
// not the only dot
|
|
275
|
+
newPos = 0;
|
|
276
|
+
} else if (currentDotIndex !== dotCount - 1) {
|
|
277
|
+
// not the last dot
|
|
278
|
+
if (slidesPerDot === 1) {
|
|
279
|
+
newPos = currentDotIndex - 1;
|
|
280
|
+
} else {
|
|
281
|
+
newPos = currentDotIndex;
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
// the last dot
|
|
285
|
+
newPos = totalSlides % slidesPerDot === 1 ? currentDotIndex - 1 : currentDotIndex;
|
|
286
|
+
}
|
|
287
|
+
studioOps.updateStates({
|
|
288
|
+
currentSlide: newPos
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}, {
|
|
292
|
+
type: "custom-action",
|
|
293
|
+
control: OutlineMessage
|
|
294
|
+
}],
|
|
295
|
+
refActions: {
|
|
296
|
+
slickGoTo: {
|
|
297
|
+
displayName: "Jump to slide",
|
|
298
|
+
argTypes: [{
|
|
299
|
+
name: "index",
|
|
300
|
+
displayName: "Slide index",
|
|
301
|
+
type: "number"
|
|
302
|
+
}, {
|
|
303
|
+
name: "dontAnimate",
|
|
304
|
+
displayName: "Animate?",
|
|
305
|
+
type: "boolean"
|
|
306
|
+
}]
|
|
307
|
+
},
|
|
308
|
+
slickNext: {
|
|
309
|
+
displayName: "Go to Next slide",
|
|
310
|
+
argTypes: []
|
|
311
|
+
},
|
|
312
|
+
slickPause: {
|
|
313
|
+
displayName: "Pause",
|
|
314
|
+
argTypes: []
|
|
315
|
+
},
|
|
316
|
+
slickPlay: {
|
|
317
|
+
displayName: "Play",
|
|
318
|
+
argTypes: []
|
|
319
|
+
},
|
|
320
|
+
slickPrev: {
|
|
321
|
+
displayName: "Go to Previous slide",
|
|
322
|
+
argTypes: []
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
props: {
|
|
326
|
+
children: {
|
|
327
|
+
type: "slot",
|
|
328
|
+
defaultValue: [0, 1, 2].map(function (i) {
|
|
329
|
+
return {
|
|
330
|
+
type: "vbox",
|
|
331
|
+
children: {
|
|
332
|
+
type: "img",
|
|
333
|
+
src: "https://static1.quocuy.cloud/components/react-slick/slide" + (i + 1) + ".png",
|
|
334
|
+
styles: {
|
|
335
|
+
maxWidth: "100%"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
})
|
|
340
|
+
},
|
|
341
|
+
accessibility: {
|
|
342
|
+
advanced: true,
|
|
343
|
+
displayName: "Accessibility",
|
|
344
|
+
type: "boolean",
|
|
345
|
+
description: "Enables tabbing and arrow key navigation",
|
|
346
|
+
defaultValueHint: true
|
|
347
|
+
},
|
|
348
|
+
adaptiveHeight: {
|
|
349
|
+
advanced: true,
|
|
350
|
+
displayName: "Adaptive Height",
|
|
351
|
+
type: "boolean",
|
|
352
|
+
description: "Adjust the slide's height automatically",
|
|
353
|
+
defaultValueHint: false
|
|
354
|
+
},
|
|
355
|
+
arrows: {
|
|
356
|
+
displayName: "Arrows",
|
|
357
|
+
type: "boolean",
|
|
358
|
+
description: "Show next/prev arrows",
|
|
359
|
+
defaultValueHint: true
|
|
360
|
+
},
|
|
361
|
+
sliderScopeClassName: {
|
|
362
|
+
type: "styleScopeClass",
|
|
363
|
+
scopeName: "slider"
|
|
364
|
+
},
|
|
365
|
+
arrowColor: {
|
|
366
|
+
type: "color",
|
|
367
|
+
description: "Color of next/prev arrow buttons",
|
|
368
|
+
defaultValueHint: "#000000",
|
|
369
|
+
hidden: function hidden(ps) {
|
|
370
|
+
return ps.arrows === undefined ? false : !ps.arrows;
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
autoplay: {
|
|
374
|
+
displayName: "Auto Play",
|
|
375
|
+
type: "boolean",
|
|
376
|
+
description: "Automatically start scrolling; does not take effect while in the editor, but you can see it in live preview.",
|
|
377
|
+
defaultValueHint: false
|
|
378
|
+
},
|
|
379
|
+
autoplaySpeed: {
|
|
380
|
+
displayName: "Auto Play Speed",
|
|
381
|
+
type: "number",
|
|
382
|
+
description: "Delay between each auto scroll, in milliseconds",
|
|
383
|
+
defaultValueHint: 3000,
|
|
384
|
+
hidden: function hidden(props) {
|
|
385
|
+
return !props.autoplay;
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
centerMode: {
|
|
389
|
+
displayName: "Center Mode",
|
|
390
|
+
type: "boolean",
|
|
391
|
+
description: "Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts",
|
|
392
|
+
defaultValueHint: false
|
|
393
|
+
},
|
|
394
|
+
centerPadding: {
|
|
395
|
+
displayName: "Center Padding",
|
|
396
|
+
type: "string",
|
|
397
|
+
description: "Side padding when in center mode (px or %)",
|
|
398
|
+
defaultValueHint: "50px",
|
|
399
|
+
hidden: function hidden(props) {
|
|
400
|
+
return !props.centerMode;
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
dots: {
|
|
404
|
+
displayName: "Dots",
|
|
405
|
+
type: "boolean",
|
|
406
|
+
description: "Show dots for each slide",
|
|
407
|
+
defaultValueHint: false
|
|
408
|
+
},
|
|
409
|
+
draggable: {
|
|
410
|
+
advanced: true,
|
|
411
|
+
displayName: "Draggable",
|
|
412
|
+
type: "boolean",
|
|
413
|
+
description: "Enables mouse dragging on desktop",
|
|
414
|
+
defaultValueHint: true
|
|
415
|
+
},
|
|
416
|
+
cssEase: {
|
|
417
|
+
advanced: true,
|
|
418
|
+
displayName: "Easing",
|
|
419
|
+
type: "string",
|
|
420
|
+
description: "Easing method for transition",
|
|
421
|
+
defaultValueHint: "linear"
|
|
422
|
+
},
|
|
423
|
+
/** Deprecated, this was apparently never working:
|
|
424
|
+
* https://github.com/akiran/react-slick/issues/363 */
|
|
425
|
+
easing: {
|
|
426
|
+
hidden: function hidden() {
|
|
427
|
+
return true;
|
|
428
|
+
},
|
|
429
|
+
advanced: true,
|
|
430
|
+
displayName: "Easing",
|
|
431
|
+
type: "string",
|
|
432
|
+
description: "Easing method for transition",
|
|
433
|
+
defaultValueHint: "linear"
|
|
434
|
+
},
|
|
435
|
+
fade: {
|
|
436
|
+
advanced: true,
|
|
437
|
+
displayName: "Fade",
|
|
438
|
+
type: "boolean",
|
|
439
|
+
description: "Cross-fade between slides",
|
|
440
|
+
defaultValueHint: false
|
|
441
|
+
},
|
|
442
|
+
focusOnSelect: {
|
|
443
|
+
advanced: true,
|
|
444
|
+
displayName: "Focus On Select",
|
|
445
|
+
type: "boolean",
|
|
446
|
+
description: "Go to slide on click",
|
|
447
|
+
defaultValueHint: false
|
|
448
|
+
},
|
|
449
|
+
infinite: {
|
|
450
|
+
displayName: "Infinite",
|
|
451
|
+
type: "boolean",
|
|
452
|
+
description: "Infinitely wrap around contents",
|
|
453
|
+
defaultValueHint: true
|
|
454
|
+
},
|
|
455
|
+
initialSlide: {
|
|
456
|
+
displayName: "Initial Slide",
|
|
457
|
+
type: "number",
|
|
458
|
+
description: "Index of the first visible slide (first is 0), accounting for multiple slides per view if applicable.",
|
|
459
|
+
defaultValueHint: 0,
|
|
460
|
+
defaultValue: 0
|
|
461
|
+
},
|
|
462
|
+
lazyLoad: {
|
|
463
|
+
advanced: true,
|
|
464
|
+
displayName: "Lazy Load",
|
|
465
|
+
type: "choice",
|
|
466
|
+
options: ["ondemand", "progressive"],
|
|
467
|
+
description: "Load images or render components on demand or progressively"
|
|
468
|
+
},
|
|
469
|
+
pauseOnDotsHover: {
|
|
470
|
+
displayName: "Pause On Dots Hover",
|
|
471
|
+
type: "boolean",
|
|
472
|
+
description: "Prevents autoplay while hovering on dots",
|
|
473
|
+
defaultValueHint: false
|
|
474
|
+
},
|
|
475
|
+
pauseOnFocus: {
|
|
476
|
+
displayName: "Pause On Focus",
|
|
477
|
+
type: "boolean",
|
|
478
|
+
description: "Prevents autoplay while focused on slides",
|
|
479
|
+
defaultValueHint: false
|
|
480
|
+
},
|
|
481
|
+
pauseOnHover: {
|
|
482
|
+
displayName: "Pause On Hover",
|
|
483
|
+
type: "boolean",
|
|
484
|
+
description: "Prevents autoplay while hovering on track",
|
|
485
|
+
defaultValueHint: true
|
|
486
|
+
},
|
|
487
|
+
rows: {
|
|
488
|
+
displayName: "Rows",
|
|
489
|
+
type: "number",
|
|
490
|
+
description: "Number of rows per slide (enables grid mode)",
|
|
491
|
+
defaultValueHint: 1
|
|
492
|
+
},
|
|
493
|
+
rtl: {
|
|
494
|
+
advanced: true,
|
|
495
|
+
displayName: "Reverse",
|
|
496
|
+
type: "boolean",
|
|
497
|
+
description: "Reverses the slide order",
|
|
498
|
+
defaultValueHint: false
|
|
499
|
+
},
|
|
500
|
+
// Looks like the `slide` prop is not being used to set the container tag:
|
|
501
|
+
// https://github.com/akiran/react-slick/issues/1318
|
|
502
|
+
// https://github.com/akiran/react-slick/pull/1885
|
|
503
|
+
// https://stackoverflow.com/questions/51492535/wrap-react-slick-li-slides-inside-ul
|
|
504
|
+
//
|
|
505
|
+
// slide: {
|
|
506
|
+
// displayName: "Slide Tag",
|
|
507
|
+
// type: "string",
|
|
508
|
+
// description: 'Slide container element type',
|
|
509
|
+
// defaultValueHint: "div",
|
|
510
|
+
// },
|
|
511
|
+
slidesPerRow: {
|
|
512
|
+
displayName: "Slides Per Row",
|
|
513
|
+
type: "number",
|
|
514
|
+
description: "Number of slides to display in grid mode, this is useful with rows option",
|
|
515
|
+
defaultValueHint: 1
|
|
516
|
+
},
|
|
517
|
+
slidesToScroll: {
|
|
518
|
+
advanced: true,
|
|
519
|
+
displayName: "Slides To Scroll",
|
|
520
|
+
type: "number",
|
|
521
|
+
description: "Number of slides to scroll at once",
|
|
522
|
+
defaultValueHint: 1
|
|
523
|
+
},
|
|
524
|
+
slidesToShow: {
|
|
525
|
+
advanced: true,
|
|
526
|
+
displayName: "Slides To Show",
|
|
527
|
+
type: "number",
|
|
528
|
+
description: "Number of slides to show in one frame",
|
|
529
|
+
defaultValueHint: 1
|
|
530
|
+
},
|
|
531
|
+
speed: {
|
|
532
|
+
advanced: true,
|
|
533
|
+
displayName: "Speed",
|
|
534
|
+
type: "number",
|
|
535
|
+
description: "Transition speed in milliseconds",
|
|
536
|
+
defaultValueHint: 500
|
|
537
|
+
},
|
|
538
|
+
swipe: {
|
|
539
|
+
advanced: true,
|
|
540
|
+
displayName: "Swipe",
|
|
541
|
+
type: "boolean",
|
|
542
|
+
description: "Enable swiping to change slides",
|
|
543
|
+
defaultValueHint: true
|
|
544
|
+
},
|
|
545
|
+
swipeToSlide: {
|
|
546
|
+
advanced: true,
|
|
547
|
+
displayName: "Swipe To Slide",
|
|
548
|
+
type: "boolean",
|
|
549
|
+
description: "Enable drag/swipe irrespective of 'slidesToScroll'",
|
|
550
|
+
defaultValueHint: false
|
|
551
|
+
},
|
|
552
|
+
touchMove: {
|
|
553
|
+
advanced: true,
|
|
554
|
+
displayName: "Touch Move",
|
|
555
|
+
type: "boolean",
|
|
556
|
+
description: "Enable slide moving on touch",
|
|
557
|
+
defaultValueHint: true
|
|
558
|
+
},
|
|
559
|
+
touchThreshold: {
|
|
560
|
+
advanced: true,
|
|
561
|
+
displayName: "Touch Threshold",
|
|
562
|
+
type: "number",
|
|
563
|
+
description: "Swipe distance threshold in pixels",
|
|
564
|
+
defaultValueHint: 5
|
|
565
|
+
},
|
|
566
|
+
useCSS: {
|
|
567
|
+
advanced: true,
|
|
568
|
+
displayName: "Use CSS",
|
|
569
|
+
type: "boolean",
|
|
570
|
+
description: "Enable/Disable CSS Transitions",
|
|
571
|
+
defaultValueHint: true
|
|
572
|
+
},
|
|
573
|
+
useTransform: {
|
|
574
|
+
advanced: true,
|
|
575
|
+
displayName: "Use Transform",
|
|
576
|
+
type: "boolean",
|
|
577
|
+
description: "Enable/Disable CSS Transforms",
|
|
578
|
+
defaultValueHint: true
|
|
579
|
+
},
|
|
580
|
+
variableWidth: {
|
|
581
|
+
advanced: true,
|
|
582
|
+
displayName: "Variable Width",
|
|
583
|
+
type: "boolean",
|
|
584
|
+
description: "Variable width slides",
|
|
585
|
+
defaultValueHint: false
|
|
586
|
+
},
|
|
587
|
+
vertical: {
|
|
588
|
+
advanced: true,
|
|
589
|
+
displayName: "Vertical",
|
|
590
|
+
type: "boolean",
|
|
591
|
+
description: "Vertical slide mode",
|
|
592
|
+
defaultValueHint: false
|
|
593
|
+
},
|
|
594
|
+
beforeChange: {
|
|
595
|
+
type: "eventHandler",
|
|
596
|
+
advanced: true,
|
|
597
|
+
argTypes: [{
|
|
598
|
+
name: "currentSlide",
|
|
599
|
+
type: "number"
|
|
600
|
+
}]
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
states: {
|
|
604
|
+
currentSlide: _extends({
|
|
605
|
+
type: "writable",
|
|
606
|
+
valueProp: "initialSlide",
|
|
607
|
+
onChangeProp: "beforeChange",
|
|
608
|
+
variableType: "number"
|
|
609
|
+
}, sliderHelpers.states.currentSlide)
|
|
610
|
+
},
|
|
611
|
+
componentHelpers: {
|
|
612
|
+
helpers: sliderHelpers,
|
|
613
|
+
importName: "sliderHelpers",
|
|
614
|
+
importPath: "@daouypkgs/react-slick"
|
|
615
|
+
},
|
|
616
|
+
defaultStyles: {
|
|
617
|
+
width: "stretch",
|
|
618
|
+
maxWidth: "100%",
|
|
619
|
+
flexDirection: "column"
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
if (loader) {
|
|
623
|
+
loader.registerComponent(SliderWrapper, sliderMeta);
|
|
624
|
+
} else {
|
|
625
|
+
registerComponent(SliderWrapper, sliderMeta);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
exports.SliderWrapper = SliderWrapper;
|
|
630
|
+
exports.registerSlider = registerSlider;
|
|
631
|
+
exports.sliderHelpers = sliderHelpers;
|
|
632
|
+
//# sourceMappingURL=react-slick.cjs.development.js.map
|