1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,516 +0,0 @@ |
1 |
-/* swiper.svelte generated by Svelte v3.24.1 */ |
|
2 |
-"use strict"; |
|
3 |
- |
|
4 |
-const { SvelteComponent, append, assign, attr, binding_callbacks, compute_rest_props, create_slot, detach, element, exclude_internal_props, get_spread_update, init, insert, noop, safe_not_equal, set_attributes, space, transition_in, transition_out, update_slot } = require("svelte/internal"); |
|
5 |
-const { onMount, onDestroy, afterUpdate, createEventDispatcher, tick, beforeUpdate } = require("svelte"); |
|
6 |
-const { getParams } = require("./get-params"); |
|
7 |
-const { initSwiper } = require("./init-swiper"); |
|
8 |
-const { needsScrollbar, needsNavigation, needsPagination, uniqueClasses } = require("./utils"); |
|
9 |
-const { getChangedParams } = require("./get-changed-params"); |
|
10 |
-const { updateSwiper } = require("./update-swiper"); |
|
11 |
-const get_content_end_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
12 |
-const get_content_end_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
13 |
-const get_wrapper_end_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
14 |
-const get_wrapper_end_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
15 |
-const get_default_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
16 |
-const get_default_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
17 |
-const get_wrapper_start_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
18 |
-const get_wrapper_start_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
19 |
-const get_content_start_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
20 |
-const get_content_start_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
21 |
- |
|
22 |
-// (142:2) {#if needsNavigation(swiperParams)} |
|
23 |
-function create_if_block_2(ctx) { |
|
24 |
- let div0; |
|
25 |
- let t; |
|
26 |
- let div1; |
|
27 |
- |
|
28 |
- return { |
|
29 |
- c() { |
|
30 |
- div0 = element("div"); |
|
31 |
- t = space(); |
|
32 |
- div1 = element("div"); |
|
33 |
- attr(div0, "class", "swiper-button-prev"); |
|
34 |
- attr(div1, "class", "swiper-button-next"); |
|
35 |
- }, |
|
36 |
- m(target, anchor) { |
|
37 |
- insert(target, div0, anchor); |
|
38 |
- /*div0_binding*/ ctx[13](div0); |
|
39 |
- insert(target, t, anchor); |
|
40 |
- insert(target, div1, anchor); |
|
41 |
- /*div1_binding*/ ctx[14](div1); |
|
42 |
- }, |
|
43 |
- p: noop, |
|
44 |
- d(detaching) { |
|
45 |
- if (detaching) detach(div0); |
|
46 |
- /*div0_binding*/ ctx[13](null); |
|
47 |
- if (detaching) detach(t); |
|
48 |
- if (detaching) detach(div1); |
|
49 |
- /*div1_binding*/ ctx[14](null); |
|
50 |
- } |
|
51 |
- }; |
|
52 |
-} |
|
53 |
- |
|
54 |
-// (146:2) {#if needsScrollbar(swiperParams)} |
|
55 |
-function create_if_block_1(ctx) { |
|
56 |
- let div; |
|
57 |
- |
|
58 |
- return { |
|
59 |
- c() { |
|
60 |
- div = element("div"); |
|
61 |
- attr(div, "class", "swiper-scrollbar"); |
|
62 |
- }, |
|
63 |
- m(target, anchor) { |
|
64 |
- insert(target, div, anchor); |
|
65 |
- /*div_binding*/ ctx[15](div); |
|
66 |
- }, |
|
67 |
- p: noop, |
|
68 |
- d(detaching) { |
|
69 |
- if (detaching) detach(div); |
|
70 |
- /*div_binding*/ ctx[15](null); |
|
71 |
- } |
|
72 |
- }; |
|
73 |
-} |
|
74 |
- |
|
75 |
-// (149:2) {#if needsPagination(swiperParams)} |
|
76 |
-function create_if_block(ctx) { |
|
77 |
- let div; |
|
78 |
- |
|
79 |
- return { |
|
80 |
- c() { |
|
81 |
- div = element("div"); |
|
82 |
- attr(div, "class", "swiper-pagination"); |
|
83 |
- }, |
|
84 |
- m(target, anchor) { |
|
85 |
- insert(target, div, anchor); |
|
86 |
- /*div_binding_1*/ ctx[16](div); |
|
87 |
- }, |
|
88 |
- p: noop, |
|
89 |
- d(detaching) { |
|
90 |
- if (detaching) detach(div); |
|
91 |
- /*div_binding_1*/ ctx[16](null); |
|
92 |
- } |
|
93 |
- }; |
|
94 |
-} |
|
95 |
- |
|
96 |
-function create_fragment(ctx) { |
|
97 |
- let div1; |
|
98 |
- let t0; |
|
99 |
- let show_if_2 = needsNavigation(/*swiperParams*/ ctx[2]); |
|
100 |
- let t1; |
|
101 |
- let show_if_1 = needsScrollbar(/*swiperParams*/ ctx[2]); |
|
102 |
- let t2; |
|
103 |
- let show_if = needsPagination(/*swiperParams*/ ctx[2]); |
|
104 |
- let t3; |
|
105 |
- let div0; |
|
106 |
- let t4; |
|
107 |
- let t5; |
|
108 |
- let t6; |
|
109 |
- let div1_class_value; |
|
110 |
- let current; |
|
111 |
- const content_start_slot_template = /*$$slots*/ ctx[12]["content-start"]; |
|
112 |
- const content_start_slot = create_slot(content_start_slot_template, ctx, /*$$scope*/ ctx[11], get_content_start_slot_context); |
|
113 |
- let if_block0 = show_if_2 && create_if_block_2(ctx); |
|
114 |
- let if_block1 = show_if_1 && create_if_block_1(ctx); |
|
115 |
- let if_block2 = show_if && create_if_block(ctx); |
|
116 |
- const wrapper_start_slot_template = /*$$slots*/ ctx[12]["wrapper-start"]; |
|
117 |
- const wrapper_start_slot = create_slot(wrapper_start_slot_template, ctx, /*$$scope*/ ctx[11], get_wrapper_start_slot_context); |
|
118 |
- const default_slot_template = /*$$slots*/ ctx[12].default; |
|
119 |
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[11], get_default_slot_context); |
|
120 |
- const wrapper_end_slot_template = /*$$slots*/ ctx[12]["wrapper-end"]; |
|
121 |
- const wrapper_end_slot = create_slot(wrapper_end_slot_template, ctx, /*$$scope*/ ctx[11], get_wrapper_end_slot_context); |
|
122 |
- const content_end_slot_template = /*$$slots*/ ctx[12]["content-end"]; |
|
123 |
- const content_end_slot = create_slot(content_end_slot_template, ctx, /*$$scope*/ ctx[11], get_content_end_slot_context); |
|
124 |
- |
|
125 |
- let div1_levels = [ |
|
126 |
- { |
|
127 |
- class: div1_class_value = uniqueClasses(`${/*containerClasses*/ ctx[1]}${/*className*/ ctx[0] ? ` ${/*className*/ ctx[0]}` : ""}`) |
|
128 |
- }, |
|
129 |
- /*restProps*/ ctx[3] |
|
130 |
- ]; |
|
131 |
- |
|
132 |
- let div1_data = {}; |
|
133 |
- |
|
134 |
- for (let i = 0; i < div1_levels.length; i += 1) { |
|
135 |
- div1_data = assign(div1_data, div1_levels[i]); |
|
136 |
- } |
|
137 |
- |
|
138 |
- return { |
|
139 |
- c() { |
|
140 |
- div1 = element("div"); |
|
141 |
- if (content_start_slot) content_start_slot.c(); |
|
142 |
- t0 = space(); |
|
143 |
- if (if_block0) if_block0.c(); |
|
144 |
- t1 = space(); |
|
145 |
- if (if_block1) if_block1.c(); |
|
146 |
- t2 = space(); |
|
147 |
- if (if_block2) if_block2.c(); |
|
148 |
- t3 = space(); |
|
149 |
- div0 = element("div"); |
|
150 |
- if (wrapper_start_slot) wrapper_start_slot.c(); |
|
151 |
- t4 = space(); |
|
152 |
- if (default_slot) default_slot.c(); |
|
153 |
- t5 = space(); |
|
154 |
- if (wrapper_end_slot) wrapper_end_slot.c(); |
|
155 |
- t6 = space(); |
|
156 |
- if (content_end_slot) content_end_slot.c(); |
|
157 |
- attr(div0, "class", "swiper-wrapper"); |
|
158 |
- set_attributes(div1, div1_data); |
|
159 |
- }, |
|
160 |
- m(target, anchor) { |
|
161 |
- insert(target, div1, anchor); |
|
162 |
- |
|
163 |
- if (content_start_slot) { |
|
164 |
- content_start_slot.m(div1, null); |
|
165 |
- } |
|
166 |
- |
|
167 |
- append(div1, t0); |
|
168 |
- if (if_block0) if_block0.m(div1, null); |
|
169 |
- append(div1, t1); |
|
170 |
- if (if_block1) if_block1.m(div1, null); |
|
171 |
- append(div1, t2); |
|
172 |
- if (if_block2) if_block2.m(div1, null); |
|
173 |
- append(div1, t3); |
|
174 |
- append(div1, div0); |
|
175 |
- |
|
176 |
- if (wrapper_start_slot) { |
|
177 |
- wrapper_start_slot.m(div0, null); |
|
178 |
- } |
|
179 |
- |
|
180 |
- append(div0, t4); |
|
181 |
- |
|
182 |
- if (default_slot) { |
|
183 |
- default_slot.m(div0, null); |
|
184 |
- } |
|
185 |
- |
|
186 |
- append(div0, t5); |
|
187 |
- |
|
188 |
- if (wrapper_end_slot) { |
|
189 |
- wrapper_end_slot.m(div0, null); |
|
190 |
- } |
|
191 |
- |
|
192 |
- append(div1, t6); |
|
193 |
- |
|
194 |
- if (content_end_slot) { |
|
195 |
- content_end_slot.m(div1, null); |
|
196 |
- } |
|
197 |
- |
|
198 |
- /*div1_binding_1*/ ctx[17](div1); |
|
199 |
- current = true; |
|
200 |
- }, |
|
201 |
- p(ctx, [dirty]) { |
|
202 |
- if (content_start_slot) { |
|
203 |
- if (content_start_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
204 |
- update_slot(content_start_slot, content_start_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_content_start_slot_changes, get_content_start_slot_context); |
|
205 |
- } |
|
206 |
- } |
|
207 |
- |
|
208 |
- if (dirty & /*swiperParams*/ 4) show_if_2 = needsNavigation(/*swiperParams*/ ctx[2]); |
|
209 |
- |
|
210 |
- if (show_if_2) { |
|
211 |
- if (if_block0) { |
|
212 |
- if_block0.p(ctx, dirty); |
|
213 |
- } else { |
|
214 |
- if_block0 = create_if_block_2(ctx); |
|
215 |
- if_block0.c(); |
|
216 |
- if_block0.m(div1, t1); |
|
217 |
- } |
|
218 |
- } else if (if_block0) { |
|
219 |
- if_block0.d(1); |
|
220 |
- if_block0 = null; |
|
221 |
- } |
|
222 |
- |
|
223 |
- if (dirty & /*swiperParams*/ 4) show_if_1 = needsScrollbar(/*swiperParams*/ ctx[2]); |
|
224 |
- |
|
225 |
- if (show_if_1) { |
|
226 |
- if (if_block1) { |
|
227 |
- if_block1.p(ctx, dirty); |
|
228 |
- } else { |
|
229 |
- if_block1 = create_if_block_1(ctx); |
|
230 |
- if_block1.c(); |
|
231 |
- if_block1.m(div1, t2); |
|
232 |
- } |
|
233 |
- } else if (if_block1) { |
|
234 |
- if_block1.d(1); |
|
235 |
- if_block1 = null; |
|
236 |
- } |
|
237 |
- |
|
238 |
- if (dirty & /*swiperParams*/ 4) show_if = needsPagination(/*swiperParams*/ ctx[2]); |
|
239 |
- |
|
240 |
- if (show_if) { |
|
241 |
- if (if_block2) { |
|
242 |
- if_block2.p(ctx, dirty); |
|
243 |
- } else { |
|
244 |
- if_block2 = create_if_block(ctx); |
|
245 |
- if_block2.c(); |
|
246 |
- if_block2.m(div1, t3); |
|
247 |
- } |
|
248 |
- } else if (if_block2) { |
|
249 |
- if_block2.d(1); |
|
250 |
- if_block2 = null; |
|
251 |
- } |
|
252 |
- |
|
253 |
- if (wrapper_start_slot) { |
|
254 |
- if (wrapper_start_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
255 |
- update_slot(wrapper_start_slot, wrapper_start_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_wrapper_start_slot_changes, get_wrapper_start_slot_context); |
|
256 |
- } |
|
257 |
- } |
|
258 |
- |
|
259 |
- if (default_slot) { |
|
260 |
- if (default_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
261 |
- update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_default_slot_changes, get_default_slot_context); |
|
262 |
- } |
|
263 |
- } |
|
264 |
- |
|
265 |
- if (wrapper_end_slot) { |
|
266 |
- if (wrapper_end_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
267 |
- update_slot(wrapper_end_slot, wrapper_end_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_wrapper_end_slot_changes, get_wrapper_end_slot_context); |
|
268 |
- } |
|
269 |
- } |
|
270 |
- |
|
271 |
- if (content_end_slot) { |
|
272 |
- if (content_end_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
273 |
- update_slot(content_end_slot, content_end_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_content_end_slot_changes, get_content_end_slot_context); |
|
274 |
- } |
|
275 |
- } |
|
276 |
- |
|
277 |
- set_attributes(div1, div1_data = get_spread_update(div1_levels, [ |
|
278 |
- (!current || dirty & /*containerClasses, className*/ 3 && div1_class_value !== (div1_class_value = uniqueClasses(`${/*containerClasses*/ ctx[1]}${/*className*/ ctx[0] ? ` ${/*className*/ ctx[0]}` : ""}`))) && { class: div1_class_value }, |
|
279 |
- dirty & /*restProps*/ 8 && /*restProps*/ ctx[3] |
|
280 |
- ])); |
|
281 |
- }, |
|
282 |
- i(local) { |
|
283 |
- if (current) return; |
|
284 |
- transition_in(content_start_slot, local); |
|
285 |
- transition_in(wrapper_start_slot, local); |
|
286 |
- transition_in(default_slot, local); |
|
287 |
- transition_in(wrapper_end_slot, local); |
|
288 |
- transition_in(content_end_slot, local); |
|
289 |
- current = true; |
|
290 |
- }, |
|
291 |
- o(local) { |
|
292 |
- transition_out(content_start_slot, local); |
|
293 |
- transition_out(wrapper_start_slot, local); |
|
294 |
- transition_out(default_slot, local); |
|
295 |
- transition_out(wrapper_end_slot, local); |
|
296 |
- transition_out(content_end_slot, local); |
|
297 |
- current = false; |
|
298 |
- }, |
|
299 |
- d(detaching) { |
|
300 |
- if (detaching) detach(div1); |
|
301 |
- if (content_start_slot) content_start_slot.d(detaching); |
|
302 |
- if (if_block0) if_block0.d(); |
|
303 |
- if (if_block1) if_block1.d(); |
|
304 |
- if (if_block2) if_block2.d(); |
|
305 |
- if (wrapper_start_slot) wrapper_start_slot.d(detaching); |
|
306 |
- if (default_slot) default_slot.d(detaching); |
|
307 |
- if (wrapper_end_slot) wrapper_end_slot.d(detaching); |
|
308 |
- if (content_end_slot) content_end_slot.d(detaching); |
|
309 |
- /*div1_binding_1*/ ctx[17](null); |
|
310 |
- } |
|
311 |
- }; |
|
312 |
-} |
|
313 |
- |
|
314 |
-function instance($$self, $$props, $$invalidate) { |
|
315 |
- const omit_props_names = ["class","swiper"]; |
|
316 |
- let $$restProps = compute_rest_props($$props, omit_props_names); |
|
317 |
- const dispatch = createEventDispatcher(); |
|
318 |
- let { class: className = undefined } = $$props; |
|
319 |
- let containerClasses = "swiper-container"; |
|
320 |
- let breakpointChanged = false; |
|
321 |
- let swiperInstance = null; |
|
322 |
- let oldPassedParams = null; |
|
323 |
- let paramsData; |
|
324 |
- let swiperParams; |
|
325 |
- let passedParams; |
|
326 |
- let restProps; |
|
327 |
- let swiperEl = null; |
|
328 |
- let prevEl = null; |
|
329 |
- let nextEl = null; |
|
330 |
- let scrollbarEl = null; |
|
331 |
- let paginationEl = null; |
|
332 |
- let virtualData = { slides: [] }; |
|
333 |
- |
|
334 |
- function swiper() { |
|
335 |
- return swiperInstance; |
|
336 |
- } |
|
337 |
- |
|
338 |
- const setVirtualData = data => { |
|
339 |
- $$invalidate(9, virtualData = data); |
|
340 |
- |
|
341 |
- tick().then(() => { |
|
342 |
- swiperInstance.$wrapperEl.children(".swiper-slide").each(el => { |
|
343 |
- if (el.onSwiper) el.onSwiper(swiperInstance); |
|
344 |
- }); |
|
345 |
- |
|
346 |
- swiperInstance.updateSlides(); |
|
347 |
- swiperInstance.updateProgress(); |
|
348 |
- swiperInstance.updateSlidesClasses(); |
|
349 |
- |
|
350 |
- if (swiperInstance.lazy && swiperInstance.params.lazy.enabled) { |
|
351 |
- swiperInstance.lazy.load(); |
|
352 |
- } |
|
353 |
- }); |
|
354 |
- }; |
|
355 |
- |
|
356 |
- const calcParams = () => { |
|
357 |
- paramsData = getParams($$restProps); |
|
358 |
- $$invalidate(2, swiperParams = paramsData.params); |
|
359 |
- passedParams = paramsData.passedParams; |
|
360 |
- $$invalidate(3, restProps = paramsData.rest); |
|
361 |
- }; |
|
362 |
- |
|
363 |
- calcParams(); |
|
364 |
- oldPassedParams = passedParams; |
|
365 |
- |
|
366 |
- const onBeforeBreakpoint = () => { |
|
367 |
- breakpointChanged = true; |
|
368 |
- }; |
|
369 |
- |
|
370 |
- swiperParams.onAny = (event, ...args) => { |
|
371 |
- dispatch(event, [args]); |
|
372 |
- }; |
|
373 |
- |
|
374 |
- Object.assign(swiperParams.on, { |
|
375 |
- _beforeBreakpoint: onBeforeBreakpoint, |
|
376 |
- _containerClasses(_swiper, classes) { |
|
377 |
- $$invalidate(1, containerClasses = classes); |
|
378 |
- }, |
|
379 |
- _swiper(_swiper) { |
|
380 |
- swiperInstance = _swiper; |
|
381 |
- |
|
382 |
- if (_swiper.virtual && _swiper.params.virtual.enabled) { |
|
383 |
- _swiper.params.virtual.cache = false; |
|
384 |
- _swiper.params.virtual.renderExternalUpdate = false; |
|
385 |
- |
|
386 |
- _swiper.params.virtual.renderExternal = data => { |
|
387 |
- setVirtualData(data); |
|
388 |
- |
|
389 |
- if (swiperParams.virtual && swiperParams.virtual.renderExternal) { |
|
390 |
- swiperParams.virtual.renderExternal(data); |
|
391 |
- } |
|
392 |
- }; |
|
393 |
- } |
|
394 |
- |
|
395 |
- dispatch("swiper", [_swiper]); |
|
396 |
- } |
|
397 |
- }); |
|
398 |
- |
|
399 |
- onMount(() => { |
|
400 |
- if (!swiperEl) return; |
|
401 |
- |
|
402 |
- initSwiper( |
|
403 |
- { |
|
404 |
- el: swiperEl, |
|
405 |
- nextEl, |
|
406 |
- prevEl, |
|
407 |
- paginationEl, |
|
408 |
- scrollbarEl |
|
409 |
- }, |
|
410 |
- swiperParams |
|
411 |
- ); |
|
412 |
- |
|
413 |
- if (swiperParams.virtual) return; |
|
414 |
- |
|
415 |
- swiperInstance.slides.each(el => { |
|
416 |
- if (el.onSwiper) el.onSwiper(swiperInstance); |
|
417 |
- }); |
|
418 |
- }); |
|
419 |
- |
|
420 |
- afterUpdate(() => { |
|
421 |
- if (!swiperInstance) return; |
|
422 |
- calcParams(); |
|
423 |
- const changedParams = getChangedParams(passedParams, oldPassedParams); |
|
424 |
- |
|
425 |
- if ((changedParams.length || breakpointChanged) && swiperInstance && !swiperInstance.destroyed) { |
|
426 |
- updateSwiper(swiperInstance, passedParams, changedParams); |
|
427 |
- } |
|
428 |
- |
|
429 |
- breakpointChanged = false; |
|
430 |
- oldPassedParams = passedParams; |
|
431 |
- }); |
|
432 |
- |
|
433 |
- onDestroy(() => { |
|
434 |
- if (swiperInstance && !swiperInstance.destroyed) { |
|
435 |
- swiperInstance.destroy(); |
|
436 |
- } |
|
437 |
- }); |
|
438 |
- |
|
439 |
- let { $$slots = {}, $$scope } = $$props; |
|
440 |
- |
|
441 |
- function div0_binding($$value) { |
|
442 |
- binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
443 |
- prevEl = $$value; |
|
444 |
- $$invalidate(5, prevEl); |
|
445 |
- }); |
|
446 |
- } |
|
447 |
- |
|
448 |
- function div1_binding($$value) { |
|
449 |
- binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
450 |
- nextEl = $$value; |
|
451 |
- $$invalidate(6, nextEl); |
|
452 |
- }); |
|
453 |
- } |
|
454 |
- |
|
455 |
- function div_binding($$value) { |
|
456 |
- binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
457 |
- scrollbarEl = $$value; |
|
458 |
- $$invalidate(7, scrollbarEl); |
|
459 |
- }); |
|
460 |
- } |
|
461 |
- |
|
462 |
- function div_binding_1($$value) { |
|
463 |
- binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
464 |
- paginationEl = $$value; |
|
465 |
- $$invalidate(8, paginationEl); |
|
466 |
- }); |
|
467 |
- } |
|
468 |
- |
|
469 |
- function div1_binding_1($$value) { |
|
470 |
- binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
471 |
- swiperEl = $$value; |
|
472 |
- $$invalidate(4, swiperEl); |
|
473 |
- }); |
|
474 |
- } |
|
475 |
- |
|
476 |
- $$self.$$set = $$new_props => { |
|
477 |
- $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)); |
|
478 |
- $$invalidate(27, $$restProps = compute_rest_props($$props, omit_props_names)); |
|
479 |
- if ("class" in $$new_props) $$invalidate(0, className = $$new_props.class); |
|
480 |
- if ("$$scope" in $$new_props) $$invalidate(11, $$scope = $$new_props.$$scope); |
|
481 |
- }; |
|
482 |
- |
|
483 |
- return [ |
|
484 |
- className, |
|
485 |
- containerClasses, |
|
486 |
- swiperParams, |
|
487 |
- restProps, |
|
488 |
- swiperEl, |
|
489 |
- prevEl, |
|
490 |
- nextEl, |
|
491 |
- scrollbarEl, |
|
492 |
- paginationEl, |
|
493 |
- virtualData, |
|
494 |
- swiper, |
|
495 |
- $$scope, |
|
496 |
- $$slots, |
|
497 |
- div0_binding, |
|
498 |
- div1_binding, |
|
499 |
- div_binding, |
|
500 |
- div_binding_1, |
|
501 |
- div1_binding_1 |
|
502 |
- ]; |
|
503 |
-} |
|
504 |
- |
|
505 |
-class Swiper extends SvelteComponent { |
|
506 |
- constructor(options) { |
|
507 |
- super(); |
|
508 |
- init(this, options, instance, create_fragment, safe_not_equal, { class: 0, swiper: 10 }); |
|
509 |
- } |
|
510 |
- |
|
511 |
- get swiper() { |
|
512 |
- return this.$$.ctx[10]; |
|
513 |
- } |
|
514 |
-} |
|
515 |
- |
|
516 |
-exports.default = Swiper; |
|
517 | 0 |
\ No newline at end of file |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,516 @@ |
1 |
+/* swiper.svelte generated by Svelte v3.24.1 */ |
|
2 |
+"use strict"; |
|
3 |
+ |
|
4 |
+const { SvelteComponent, append, assign, attr, binding_callbacks, compute_rest_props, create_slot, detach, element, exclude_internal_props, get_spread_update, init, insert, noop, safe_not_equal, set_attributes, space, transition_in, transition_out, update_slot } = require("svelte/internal"); |
|
5 |
+const { onMount, onDestroy, afterUpdate, createEventDispatcher, tick, beforeUpdate } = require("svelte"); |
|
6 |
+const { getParams } = require("./get-params"); |
|
7 |
+const { initSwiper } = require("./init-swiper"); |
|
8 |
+const { needsScrollbar, needsNavigation, needsPagination, uniqueClasses } = require("./utils"); |
|
9 |
+const { getChangedParams } = require("./get-changed-params"); |
|
10 |
+const { updateSwiper } = require("./update-swiper"); |
|
11 |
+const get_content_end_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
12 |
+const get_content_end_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
13 |
+const get_wrapper_end_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
14 |
+const get_wrapper_end_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
15 |
+const get_default_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
16 |
+const get_default_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
17 |
+const get_wrapper_start_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
18 |
+const get_wrapper_start_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
19 |
+const get_content_start_slot_changes = dirty => ({ virtualData: dirty & /*virtualData*/ 512 }); |
|
20 |
+const get_content_start_slot_context = ctx => ({ virtualData: /*virtualData*/ ctx[9] }); |
|
21 |
+ |
|
22 |
+// (142:2) {#if needsNavigation(swiperParams)} |
|
23 |
+function create_if_block_2(ctx) { |
|
24 |
+ let div0; |
|
25 |
+ let t; |
|
26 |
+ let div1; |
|
27 |
+ |
|
28 |
+ return { |
|
29 |
+ c() { |
|
30 |
+ div0 = element("div"); |
|
31 |
+ t = space(); |
|
32 |
+ div1 = element("div"); |
|
33 |
+ attr(div0, "class", "swiper-button-prev"); |
|
34 |
+ attr(div1, "class", "swiper-button-next"); |
|
35 |
+ }, |
|
36 |
+ m(target, anchor) { |
|
37 |
+ insert(target, div0, anchor); |
|
38 |
+ /*div0_binding*/ ctx[13](div0); |
|
39 |
+ insert(target, t, anchor); |
|
40 |
+ insert(target, div1, anchor); |
|
41 |
+ /*div1_binding*/ ctx[14](div1); |
|
42 |
+ }, |
|
43 |
+ p: noop, |
|
44 |
+ d(detaching) { |
|
45 |
+ if (detaching) detach(div0); |
|
46 |
+ /*div0_binding*/ ctx[13](null); |
|
47 |
+ if (detaching) detach(t); |
|
48 |
+ if (detaching) detach(div1); |
|
49 |
+ /*div1_binding*/ ctx[14](null); |
|
50 |
+ } |
|
51 |
+ }; |
|
52 |
+} |
|
53 |
+ |
|
54 |
+// (146:2) {#if needsScrollbar(swiperParams)} |
|
55 |
+function create_if_block_1(ctx) { |
|
56 |
+ let div; |
|
57 |
+ |
|
58 |
+ return { |
|
59 |
+ c() { |
|
60 |
+ div = element("div"); |
|
61 |
+ attr(div, "class", "swiper-scrollbar"); |
|
62 |
+ }, |
|
63 |
+ m(target, anchor) { |
|
64 |
+ insert(target, div, anchor); |
|
65 |
+ /*div_binding*/ ctx[15](div); |
|
66 |
+ }, |
|
67 |
+ p: noop, |
|
68 |
+ d(detaching) { |
|
69 |
+ if (detaching) detach(div); |
|
70 |
+ /*div_binding*/ ctx[15](null); |
|
71 |
+ } |
|
72 |
+ }; |
|
73 |
+} |
|
74 |
+ |
|
75 |
+// (149:2) {#if needsPagination(swiperParams)} |
|
76 |
+function create_if_block(ctx) { |
|
77 |
+ let div; |
|
78 |
+ |
|
79 |
+ return { |
|
80 |
+ c() { |
|
81 |
+ div = element("div"); |
|
82 |
+ attr(div, "class", "swiper-pagination"); |
|
83 |
+ }, |
|
84 |
+ m(target, anchor) { |
|
85 |
+ insert(target, div, anchor); |
|
86 |
+ /*div_binding_1*/ ctx[16](div); |
|
87 |
+ }, |
|
88 |
+ p: noop, |
|
89 |
+ d(detaching) { |
|
90 |
+ if (detaching) detach(div); |
|
91 |
+ /*div_binding_1*/ ctx[16](null); |
|
92 |
+ } |
|
93 |
+ }; |
|
94 |
+} |
|
95 |
+ |
|
96 |
+function create_fragment(ctx) { |
|
97 |
+ let div1; |
|
98 |
+ let t0; |
|
99 |
+ let show_if_2 = needsNavigation(/*swiperParams*/ ctx[2]); |
|
100 |
+ let t1; |
|
101 |
+ let show_if_1 = needsScrollbar(/*swiperParams*/ ctx[2]); |
|
102 |
+ let t2; |
|
103 |
+ let show_if = needsPagination(/*swiperParams*/ ctx[2]); |
|
104 |
+ let t3; |
|
105 |
+ let div0; |
|
106 |
+ let t4; |
|
107 |
+ let t5; |
|
108 |
+ let t6; |
|
109 |
+ let div1_class_value; |
|
110 |
+ let current; |
|
111 |
+ const content_start_slot_template = /*$$slots*/ ctx[12]["content-start"]; |
|
112 |
+ const content_start_slot = create_slot(content_start_slot_template, ctx, /*$$scope*/ ctx[11], get_content_start_slot_context); |
|
113 |
+ let if_block0 = show_if_2 && create_if_block_2(ctx); |
|
114 |
+ let if_block1 = show_if_1 && create_if_block_1(ctx); |
|
115 |
+ let if_block2 = show_if && create_if_block(ctx); |
|
116 |
+ const wrapper_start_slot_template = /*$$slots*/ ctx[12]["wrapper-start"]; |
|
117 |
+ const wrapper_start_slot = create_slot(wrapper_start_slot_template, ctx, /*$$scope*/ ctx[11], get_wrapper_start_slot_context); |
|
118 |
+ const default_slot_template = /*$$slots*/ ctx[12].default; |
|
119 |
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[11], get_default_slot_context); |
|
120 |
+ const wrapper_end_slot_template = /*$$slots*/ ctx[12]["wrapper-end"]; |
|
121 |
+ const wrapper_end_slot = create_slot(wrapper_end_slot_template, ctx, /*$$scope*/ ctx[11], get_wrapper_end_slot_context); |
|
122 |
+ const content_end_slot_template = /*$$slots*/ ctx[12]["content-end"]; |
|
123 |
+ const content_end_slot = create_slot(content_end_slot_template, ctx, /*$$scope*/ ctx[11], get_content_end_slot_context); |
|
124 |
+ |
|
125 |
+ let div1_levels = [ |
|
126 |
+ { |
|
127 |
+ class: div1_class_value = uniqueClasses(`${/*containerClasses*/ ctx[1]}${/*className*/ ctx[0] ? ` ${/*className*/ ctx[0]}` : ""}`) |
|
128 |
+ }, |
|
129 |
+ /*restProps*/ ctx[3] |
|
130 |
+ ]; |
|
131 |
+ |
|
132 |
+ let div1_data = {}; |
|
133 |
+ |
|
134 |
+ for (let i = 0; i < div1_levels.length; i += 1) { |
|
135 |
+ div1_data = assign(div1_data, div1_levels[i]); |
|
136 |
+ } |
|
137 |
+ |
|
138 |
+ return { |
|
139 |
+ c() { |
|
140 |
+ div1 = element("div"); |
|
141 |
+ if (content_start_slot) content_start_slot.c(); |
|
142 |
+ t0 = space(); |
|
143 |
+ if (if_block0) if_block0.c(); |
|
144 |
+ t1 = space(); |
|
145 |
+ if (if_block1) if_block1.c(); |
|
146 |
+ t2 = space(); |
|
147 |
+ if (if_block2) if_block2.c(); |
|
148 |
+ t3 = space(); |
|
149 |
+ div0 = element("div"); |
|
150 |
+ if (wrapper_start_slot) wrapper_start_slot.c(); |
|
151 |
+ t4 = space(); |
|
152 |
+ if (default_slot) default_slot.c(); |
|
153 |
+ t5 = space(); |
|
154 |
+ if (wrapper_end_slot) wrapper_end_slot.c(); |
|
155 |
+ t6 = space(); |
|
156 |
+ if (content_end_slot) content_end_slot.c(); |
|
157 |
+ attr(div0, "class", "swiper-wrapper"); |
|
158 |
+ set_attributes(div1, div1_data); |
|
159 |
+ }, |
|
160 |
+ m(target, anchor) { |
|
161 |
+ insert(target, div1, anchor); |
|
162 |
+ |
|
163 |
+ if (content_start_slot) { |
|
164 |
+ content_start_slot.m(div1, null); |
|
165 |
+ } |
|
166 |
+ |
|
167 |
+ append(div1, t0); |
|
168 |
+ if (if_block0) if_block0.m(div1, null); |
|
169 |
+ append(div1, t1); |
|
170 |
+ if (if_block1) if_block1.m(div1, null); |
|
171 |
+ append(div1, t2); |
|
172 |
+ if (if_block2) if_block2.m(div1, null); |
|
173 |
+ append(div1, t3); |
|
174 |
+ append(div1, div0); |
|
175 |
+ |
|
176 |
+ if (wrapper_start_slot) { |
|
177 |
+ wrapper_start_slot.m(div0, null); |
|
178 |
+ } |
|
179 |
+ |
|
180 |
+ append(div0, t4); |
|
181 |
+ |
|
182 |
+ if (default_slot) { |
|
183 |
+ default_slot.m(div0, null); |
|
184 |
+ } |
|
185 |
+ |
|
186 |
+ append(div0, t5); |
|
187 |
+ |
|
188 |
+ if (wrapper_end_slot) { |
|
189 |
+ wrapper_end_slot.m(div0, null); |
|
190 |
+ } |
|
191 |
+ |
|
192 |
+ append(div1, t6); |
|
193 |
+ |
|
194 |
+ if (content_end_slot) { |
|
195 |
+ content_end_slot.m(div1, null); |
|
196 |
+ } |
|
197 |
+ |
|
198 |
+ /*div1_binding_1*/ ctx[17](div1); |
|
199 |
+ current = true; |
|
200 |
+ }, |
|
201 |
+ p(ctx, [dirty]) { |
|
202 |
+ if (content_start_slot) { |
|
203 |
+ if (content_start_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
204 |
+ update_slot(content_start_slot, content_start_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_content_start_slot_changes, get_content_start_slot_context); |
|
205 |
+ } |
|
206 |
+ } |
|
207 |
+ |
|
208 |
+ if (dirty & /*swiperParams*/ 4) show_if_2 = needsNavigation(/*swiperParams*/ ctx[2]); |
|
209 |
+ |
|
210 |
+ if (show_if_2) { |
|
211 |
+ if (if_block0) { |
|
212 |
+ if_block0.p(ctx, dirty); |
|
213 |
+ } else { |
|
214 |
+ if_block0 = create_if_block_2(ctx); |
|
215 |
+ if_block0.c(); |
|
216 |
+ if_block0.m(div1, t1); |
|
217 |
+ } |
|
218 |
+ } else if (if_block0) { |
|
219 |
+ if_block0.d(1); |
|
220 |
+ if_block0 = null; |
|
221 |
+ } |
|
222 |
+ |
|
223 |
+ if (dirty & /*swiperParams*/ 4) show_if_1 = needsScrollbar(/*swiperParams*/ ctx[2]); |
|
224 |
+ |
|
225 |
+ if (show_if_1) { |
|
226 |
+ if (if_block1) { |
|
227 |
+ if_block1.p(ctx, dirty); |
|
228 |
+ } else { |
|
229 |
+ if_block1 = create_if_block_1(ctx); |
|
230 |
+ if_block1.c(); |
|
231 |
+ if_block1.m(div1, t2); |
|
232 |
+ } |
|
233 |
+ } else if (if_block1) { |
|
234 |
+ if_block1.d(1); |
|
235 |
+ if_block1 = null; |
|
236 |
+ } |
|
237 |
+ |
|
238 |
+ if (dirty & /*swiperParams*/ 4) show_if = needsPagination(/*swiperParams*/ ctx[2]); |
|
239 |
+ |
|
240 |
+ if (show_if) { |
|
241 |
+ if (if_block2) { |
|
242 |
+ if_block2.p(ctx, dirty); |
|
243 |
+ } else { |
|
244 |
+ if_block2 = create_if_block(ctx); |
|
245 |
+ if_block2.c(); |
|
246 |
+ if_block2.m(div1, t3); |
|
247 |
+ } |
|
248 |
+ } else if (if_block2) { |
|
249 |
+ if_block2.d(1); |
|
250 |
+ if_block2 = null; |
|
251 |
+ } |
|
252 |
+ |
|
253 |
+ if (wrapper_start_slot) { |
|
254 |
+ if (wrapper_start_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
255 |
+ update_slot(wrapper_start_slot, wrapper_start_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_wrapper_start_slot_changes, get_wrapper_start_slot_context); |
|
256 |
+ } |
|
257 |
+ } |
|
258 |
+ |
|
259 |
+ if (default_slot) { |
|
260 |
+ if (default_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
261 |
+ update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_default_slot_changes, get_default_slot_context); |
|
262 |
+ } |
|
263 |
+ } |
|
264 |
+ |
|
265 |
+ if (wrapper_end_slot) { |
|
266 |
+ if (wrapper_end_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
267 |
+ update_slot(wrapper_end_slot, wrapper_end_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_wrapper_end_slot_changes, get_wrapper_end_slot_context); |
|
268 |
+ } |
|
269 |
+ } |
|
270 |
+ |
|
271 |
+ if (content_end_slot) { |
|
272 |
+ if (content_end_slot.p && dirty & /*$$scope, virtualData*/ 2560) { |
|
273 |
+ update_slot(content_end_slot, content_end_slot_template, ctx, /*$$scope*/ ctx[11], dirty, get_content_end_slot_changes, get_content_end_slot_context); |
|
274 |
+ } |
|
275 |
+ } |
|
276 |
+ |
|
277 |
+ set_attributes(div1, div1_data = get_spread_update(div1_levels, [ |
|
278 |
+ (!current || dirty & /*containerClasses, className*/ 3 && div1_class_value !== (div1_class_value = uniqueClasses(`${/*containerClasses*/ ctx[1]}${/*className*/ ctx[0] ? ` ${/*className*/ ctx[0]}` : ""}`))) && { class: div1_class_value }, |
|
279 |
+ dirty & /*restProps*/ 8 && /*restProps*/ ctx[3] |
|
280 |
+ ])); |
|
281 |
+ }, |
|
282 |
+ i(local) { |
|
283 |
+ if (current) return; |
|
284 |
+ transition_in(content_start_slot, local); |
|
285 |
+ transition_in(wrapper_start_slot, local); |
|
286 |
+ transition_in(default_slot, local); |
|
287 |
+ transition_in(wrapper_end_slot, local); |
|
288 |
+ transition_in(content_end_slot, local); |
|
289 |
+ current = true; |
|
290 |
+ }, |
|
291 |
+ o(local) { |
|
292 |
+ transition_out(content_start_slot, local); |
|
293 |
+ transition_out(wrapper_start_slot, local); |
|
294 |
+ transition_out(default_slot, local); |
|
295 |
+ transition_out(wrapper_end_slot, local); |
|
296 |
+ transition_out(content_end_slot, local); |
|
297 |
+ current = false; |
|
298 |
+ }, |
|
299 |
+ d(detaching) { |
|
300 |
+ if (detaching) detach(div1); |
|
301 |
+ if (content_start_slot) content_start_slot.d(detaching); |
|
302 |
+ if (if_block0) if_block0.d(); |
|
303 |
+ if (if_block1) if_block1.d(); |
|
304 |
+ if (if_block2) if_block2.d(); |
|
305 |
+ if (wrapper_start_slot) wrapper_start_slot.d(detaching); |
|
306 |
+ if (default_slot) default_slot.d(detaching); |
|
307 |
+ if (wrapper_end_slot) wrapper_end_slot.d(detaching); |
|
308 |
+ if (content_end_slot) content_end_slot.d(detaching); |
|
309 |
+ /*div1_binding_1*/ ctx[17](null); |
|
310 |
+ } |
|
311 |
+ }; |
|
312 |
+} |
|
313 |
+ |
|
314 |
+function instance($$self, $$props, $$invalidate) { |
|
315 |
+ const omit_props_names = ["class","swiper"]; |
|
316 |
+ let $$restProps = compute_rest_props($$props, omit_props_names); |
|
317 |
+ const dispatch = createEventDispatcher(); |
|
318 |
+ let { class: className = undefined } = $$props; |
|
319 |
+ let containerClasses = "swiper-container"; |
|
320 |
+ let breakpointChanged = false; |
|
321 |
+ let swiperInstance = null; |
|
322 |
+ let oldPassedParams = null; |
|
323 |
+ let paramsData; |
|
324 |
+ let swiperParams; |
|
325 |
+ let passedParams; |
|
326 |
+ let restProps; |
|
327 |
+ let swiperEl = null; |
|
328 |
+ let prevEl = null; |
|
329 |
+ let nextEl = null; |
|
330 |
+ let scrollbarEl = null; |
|
331 |
+ let paginationEl = null; |
|
332 |
+ let virtualData = { slides: [] }; |
|
333 |
+ |
|
334 |
+ function swiper() { |
|
335 |
+ return swiperInstance; |
|
336 |
+ } |
|
337 |
+ |
|
338 |
+ const setVirtualData = data => { |
|
339 |
+ $$invalidate(9, virtualData = data); |
|
340 |
+ |
|
341 |
+ tick().then(() => { |
|
342 |
+ swiperInstance.$wrapperEl.children(".swiper-slide").each(el => { |
|
343 |
+ if (el.onSwiper) el.onSwiper(swiperInstance); |
|
344 |
+ }); |
|
345 |
+ |
|
346 |
+ swiperInstance.updateSlides(); |
|
347 |
+ swiperInstance.updateProgress(); |
|
348 |
+ swiperInstance.updateSlidesClasses(); |
|
349 |
+ |
|
350 |
+ if (swiperInstance.lazy && swiperInstance.params.lazy.enabled) { |
|
351 |
+ swiperInstance.lazy.load(); |
|
352 |
+ } |
|
353 |
+ }); |
|
354 |
+ }; |
|
355 |
+ |
|
356 |
+ const calcParams = () => { |
|
357 |
+ paramsData = getParams($$restProps); |
|
358 |
+ $$invalidate(2, swiperParams = paramsData.params); |
|
359 |
+ passedParams = paramsData.passedParams; |
|
360 |
+ $$invalidate(3, restProps = paramsData.rest); |
|
361 |
+ }; |
|
362 |
+ |
|
363 |
+ calcParams(); |
|
364 |
+ oldPassedParams = passedParams; |
|
365 |
+ |
|
366 |
+ const onBeforeBreakpoint = () => { |
|
367 |
+ breakpointChanged = true; |
|
368 |
+ }; |
|
369 |
+ |
|
370 |
+ swiperParams.onAny = (event, ...args) => { |
|
371 |
+ dispatch(event, [args]); |
|
372 |
+ }; |
|
373 |
+ |
|
374 |
+ Object.assign(swiperParams.on, { |
|
375 |
+ _beforeBreakpoint: onBeforeBreakpoint, |
|
376 |
+ _containerClasses(_swiper, classes) { |
|
377 |
+ $$invalidate(1, containerClasses = classes); |
|
378 |
+ }, |
|
379 |
+ _swiper(_swiper) { |
|
380 |
+ swiperInstance = _swiper; |
|
381 |
+ |
|
382 |
+ if (_swiper.virtual && _swiper.params.virtual.enabled) { |
|
383 |
+ _swiper.params.virtual.cache = false; |
|
384 |
+ _swiper.params.virtual.renderExternalUpdate = false; |
|
385 |
+ |
|
386 |
+ _swiper.params.virtual.renderExternal = data => { |
|
387 |
+ setVirtualData(data); |
|
388 |
+ |
|
389 |
+ if (swiperParams.virtual && swiperParams.virtual.renderExternal) { |
|
390 |
+ swiperParams.virtual.renderExternal(data); |
|
391 |
+ } |
|
392 |
+ }; |
|
393 |
+ } |
|
394 |
+ |
|
395 |
+ dispatch("swiper", [_swiper]); |
|
396 |
+ } |
|
397 |
+ }); |
|
398 |
+ |
|
399 |
+ onMount(() => { |
|
400 |
+ if (!swiperEl) return; |
|
401 |
+ |
|
402 |
+ initSwiper( |
|
403 |
+ { |
|
404 |
+ el: swiperEl, |
|
405 |
+ nextEl, |
|
406 |
+ prevEl, |
|
407 |
+ paginationEl, |
|
408 |
+ scrollbarEl |
|
409 |
+ }, |
|
410 |
+ swiperParams |
|
411 |
+ ); |
|
412 |
+ |
|
413 |
+ if (swiperParams.virtual) return; |
|
414 |
+ |
|
415 |
+ swiperInstance.slides.each(el => { |
|
416 |
+ if (el.onSwiper) el.onSwiper(swiperInstance); |
|
417 |
+ }); |
|
418 |
+ }); |
|
419 |
+ |
|
420 |
+ afterUpdate(() => { |
|
421 |
+ if (!swiperInstance) return; |
|
422 |
+ calcParams(); |
|
423 |
+ const changedParams = getChangedParams(passedParams, oldPassedParams); |
|
424 |
+ |
|
425 |
+ if ((changedParams.length || breakpointChanged) && swiperInstance && !swiperInstance.destroyed) { |
|
426 |
+ updateSwiper(swiperInstance, passedParams, changedParams); |
|
427 |
+ } |
|
428 |
+ |
|
429 |
+ breakpointChanged = false; |
|
430 |
+ oldPassedParams = passedParams; |
|
431 |
+ }); |
|
432 |
+ |
|
433 |
+ onDestroy(() => { |
|
434 |
+ if (swiperInstance && !swiperInstance.destroyed) { |
|
435 |
+ swiperInstance.destroy(); |
|
436 |
+ } |
|
437 |
+ }); |
|
438 |
+ |
|
439 |
+ let { $$slots = {}, $$scope } = $$props; |
|
440 |
+ |
|
441 |
+ function div0_binding($$value) { |
|
442 |
+ binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
443 |
+ prevEl = $$value; |
|
444 |
+ $$invalidate(5, prevEl); |
|
445 |
+ }); |
|
446 |
+ } |
|
447 |
+ |
|
448 |
+ function div1_binding($$value) { |
|
449 |
+ binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
450 |
+ nextEl = $$value; |
|
451 |
+ $$invalidate(6, nextEl); |
|
452 |
+ }); |
|
453 |
+ } |
|
454 |
+ |
|
455 |
+ function div_binding($$value) { |
|
456 |
+ binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
457 |
+ scrollbarEl = $$value; |
|
458 |
+ $$invalidate(7, scrollbarEl); |
|
459 |
+ }); |
|
460 |
+ } |
|
461 |
+ |
|
462 |
+ function div_binding_1($$value) { |
|
463 |
+ binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
464 |
+ paginationEl = $$value; |
|
465 |
+ $$invalidate(8, paginationEl); |
|
466 |
+ }); |
|
467 |
+ } |
|
468 |
+ |
|
469 |
+ function div1_binding_1($$value) { |
|
470 |
+ binding_callbacks[$$value ? "unshift" : "push"](() => { |
|
471 |
+ swiperEl = $$value; |
|
472 |
+ $$invalidate(4, swiperEl); |
|
473 |
+ }); |
|
474 |
+ } |
|
475 |
+ |
|
476 |
+ $$self.$$set = $$new_props => { |
|
477 |
+ $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)); |
|
478 |
+ $$invalidate(27, $$restProps = compute_rest_props($$props, omit_props_names)); |
|
479 |
+ if ("class" in $$new_props) $$invalidate(0, className = $$new_props.class); |
|
480 |
+ if ("$$scope" in $$new_props) $$invalidate(11, $$scope = $$new_props.$$scope); |
|
481 |
+ }; |
|
482 |
+ |
|
483 |
+ return [ |
|
484 |
+ className, |
|
485 |
+ containerClasses, |
|
486 |
+ swiperParams, |
|
487 |
+ restProps, |
|
488 |
+ swiperEl, |
|
489 |
+ prevEl, |
|
490 |
+ nextEl, |
|
491 |
+ scrollbarEl, |
|
492 |
+ paginationEl, |
|
493 |
+ virtualData, |
|
494 |
+ swiper, |
|
495 |
+ $$scope, |
|
496 |
+ $$slots, |
|
497 |
+ div0_binding, |
|
498 |
+ div1_binding, |
|
499 |
+ div_binding, |
|
500 |
+ div_binding_1, |
|
501 |
+ div1_binding_1 |
|
502 |
+ ]; |
|
503 |
+} |
|
504 |
+ |
|
505 |
+class Swiper extends SvelteComponent { |
|
506 |
+ constructor(options) { |
|
507 |
+ super(); |
|
508 |
+ init(this, options, instance, create_fragment, safe_not_equal, { class: 0, swiper: 10 }); |
|
509 |
+ } |
|
510 |
+ |
|
511 |
+ get swiper() { |
|
512 |
+ return this.$$.ctx[10]; |
|
513 |
+ } |
|
514 |
+} |
|
515 |
+ |
|
516 |
+exports.default = Swiper; |
|
0 | 517 |
\ No newline at end of file |