1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
41 | }
|
42 | };
|
43 |
|
44 |
|
45 | __webpack_require__.r = function(exports) {
|
46 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
48 | }
|
49 | Object.defineProperty(exports, '__esModule', { value: true });
|
50 | };
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | __webpack_require__.t = function(value, mode) {
|
58 | if(mode & 1) value = __webpack_require__(value);
|
59 | if(mode & 8) return value;
|
60 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
61 | var ns = Object.create(null);
|
62 | __webpack_require__.r(ns);
|
63 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
64 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
65 | return ns;
|
66 | };
|
67 |
|
68 |
|
69 | __webpack_require__.n = function(module) {
|
70 | var getter = module && module.__esModule ?
|
71 | function getDefault() { return module['default']; } :
|
72 | function getModuleExports() { return module; };
|
73 | __webpack_require__.d(getter, 'a', getter);
|
74 | return getter;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
|
80 |
|
81 | __webpack_require__.p = "/dist/";
|
82 |
|
83 |
|
84 |
|
85 | return __webpack_require__(__webpack_require__.s = 111);
|
86 | })
|
87 |
|
88 | ({
|
89 |
|
90 | 0:
|
91 | (function(module, __webpack_exports__, __webpack_require__) {
|
92 |
|
93 | "use strict";
|
94 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | function normalizeComponent (
|
102 | scriptExports,
|
103 | render,
|
104 | staticRenderFns,
|
105 | functionalTemplate,
|
106 | injectStyles,
|
107 | scopeId,
|
108 | moduleIdentifier, /* server only */
|
109 | shadowMode /* vue-cli only */
|
110 | ) {
|
111 |
|
112 | var options = typeof scriptExports === 'function'
|
113 | ? scriptExports.options
|
114 | : scriptExports
|
115 |
|
116 |
|
117 | if (render) {
|
118 | options.render = render
|
119 | options.staticRenderFns = staticRenderFns
|
120 | options._compiled = true
|
121 | }
|
122 |
|
123 |
|
124 | if (functionalTemplate) {
|
125 | options.functional = true
|
126 | }
|
127 |
|
128 |
|
129 | if (scopeId) {
|
130 | options._scopeId = 'data-v-' + scopeId
|
131 | }
|
132 |
|
133 | var hook
|
134 | if (moduleIdentifier) {
|
135 | hook = function (context) {
|
136 |
|
137 | context =
|
138 | context ||
|
139 | (this.$vnode && this.$vnode.ssrContext) ||
|
140 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
141 |
|
142 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
143 | context = __VUE_SSR_CONTEXT__
|
144 | }
|
145 |
|
146 | if (injectStyles) {
|
147 | injectStyles.call(this, context)
|
148 | }
|
149 |
|
150 | if (context && context._registeredComponents) {
|
151 | context._registeredComponents.add(moduleIdentifier)
|
152 | }
|
153 | }
|
154 |
|
155 |
|
156 | options._ssrRegister = hook
|
157 | } else if (injectStyles) {
|
158 | hook = shadowMode
|
159 | ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
160 | : injectStyles
|
161 | }
|
162 |
|
163 | if (hook) {
|
164 | if (options.functional) {
|
165 |
|
166 |
|
167 | options._injectStyles = hook
|
168 |
|
169 | var originalRender = options.render
|
170 | options.render = function renderWithStyleInjection (h, context) {
|
171 | hook.call(context)
|
172 | return originalRender(h, context)
|
173 | }
|
174 | } else {
|
175 |
|
176 | var existing = options.beforeCreate
|
177 | options.beforeCreate = existing
|
178 | ? [].concat(existing, hook)
|
179 | : [hook]
|
180 | }
|
181 | }
|
182 |
|
183 | return {
|
184 | exports: scriptExports,
|
185 | options: options
|
186 | }
|
187 | }
|
188 |
|
189 |
|
190 | }),
|
191 |
|
192 | 111:
|
193 | (function(module, __webpack_exports__, __webpack_require__) {
|
194 |
|
195 | "use strict";
|
196 | __webpack_require__.r(__webpack_exports__);
|
197 |
|
198 |
|
199 | var render = function() {
|
200 | var _vm = this
|
201 | var _h = _vm.$createElement
|
202 | var _c = _vm._self._c || _h
|
203 | return _c(
|
204 | "div",
|
205 | {
|
206 | directives: [
|
207 | {
|
208 | name: "show",
|
209 | rawName: "v-show",
|
210 | value: _vm.ready,
|
211 | expression: "ready"
|
212 | }
|
213 | ],
|
214 | staticClass: "el-carousel__item",
|
215 | class: {
|
216 | "is-active": _vm.active,
|
217 | "el-carousel__item--card": _vm.$parent.type === "card",
|
218 | "is-in-stage": _vm.inStage,
|
219 | "is-hover": _vm.hover,
|
220 | "is-animating": _vm.animating
|
221 | },
|
222 | style: _vm.itemStyle,
|
223 | on: { click: _vm.handleItemClick }
|
224 | },
|
225 | [
|
226 | _vm.$parent.type === "card"
|
227 | ? _c("div", {
|
228 | directives: [
|
229 | {
|
230 | name: "show",
|
231 | rawName: "v-show",
|
232 | value: !_vm.active,
|
233 | expression: "!active"
|
234 | }
|
235 | ],
|
236 | staticClass: "el-carousel__mask"
|
237 | })
|
238 | : _vm._e(),
|
239 | _vm._t("default")
|
240 | ],
|
241 | 2
|
242 | )
|
243 | }
|
244 | var staticRenderFns = []
|
245 | render._withStripped = true
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 | var util_ = __webpack_require__(3);
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 | var CARD_SCALE = 0.83;
|
279 | var itemvue_type_script_lang_js_ = ({
|
280 | name: 'ElCarouselItem',
|
281 |
|
282 | props: {
|
283 | name: String,
|
284 | label: {
|
285 | type: [String, Number],
|
286 | default: ''
|
287 | }
|
288 | },
|
289 |
|
290 | data: function data() {
|
291 | return {
|
292 | hover: false,
|
293 | translate: 0,
|
294 | scale: 1,
|
295 | active: false,
|
296 | ready: false,
|
297 | inStage: false,
|
298 | animating: false
|
299 | };
|
300 | },
|
301 |
|
302 |
|
303 | methods: {
|
304 | processIndex: function processIndex(index, activeIndex, length) {
|
305 | if (activeIndex === 0 && index === length - 1) {
|
306 | return -1;
|
307 | } else if (activeIndex === length - 1 && index === 0) {
|
308 | return length;
|
309 | } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
|
310 | return length + 1;
|
311 | } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
|
312 | return -2;
|
313 | }
|
314 | return index;
|
315 | },
|
316 | calcCardTranslate: function calcCardTranslate(index, activeIndex) {
|
317 | var parentWidth = this.$parent.$el.offsetWidth;
|
318 | if (this.inStage) {
|
319 | return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
|
320 | } else if (index < activeIndex) {
|
321 | return -(1 + CARD_SCALE) * parentWidth / 4;
|
322 | } else {
|
323 | return (3 + CARD_SCALE) * parentWidth / 4;
|
324 | }
|
325 | },
|
326 | calcTranslate: function calcTranslate(index, activeIndex, isVertical) {
|
327 | var distance = this.$parent.$el[isVertical ? 'offsetHeight' : 'offsetWidth'];
|
328 | return distance * (index - activeIndex);
|
329 | },
|
330 | translateItem: function translateItem(index, activeIndex, oldIndex) {
|
331 | var parentType = this.$parent.type;
|
332 | var parentDirection = this.parentDirection;
|
333 | var length = this.$parent.items.length;
|
334 | if (parentType !== 'card' && oldIndex !== undefined) {
|
335 | this.animating = index === activeIndex || index === oldIndex;
|
336 | }
|
337 | if (index !== activeIndex && length > 2 && this.$parent.loop) {
|
338 | index = this.processIndex(index, activeIndex, length);
|
339 | }
|
340 | if (parentType === 'card') {
|
341 | if (parentDirection === 'vertical') {
|
342 | console.warn('[Element Warn][Carousel]vertical direction is not supported in card mode');
|
343 | }
|
344 | this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
|
345 | this.active = index === activeIndex;
|
346 | this.translate = this.calcCardTranslate(index, activeIndex);
|
347 | this.scale = this.active ? 1 : CARD_SCALE;
|
348 | } else {
|
349 | this.active = index === activeIndex;
|
350 | var isVertical = parentDirection === 'vertical';
|
351 | this.translate = this.calcTranslate(index, activeIndex, isVertical);
|
352 | }
|
353 | this.ready = true;
|
354 | },
|
355 | handleItemClick: function handleItemClick() {
|
356 | var parent = this.$parent;
|
357 | if (parent && parent.type === 'card') {
|
358 | var index = parent.items.indexOf(this);
|
359 | parent.setActiveItem(index);
|
360 | }
|
361 | }
|
362 | },
|
363 |
|
364 | computed: {
|
365 | parentDirection: function parentDirection() {
|
366 | return this.$parent.direction;
|
367 | },
|
368 | itemStyle: function itemStyle() {
|
369 | var translateType = this.parentDirection === 'vertical' ? 'translateY' : 'translateX';
|
370 | var value = translateType + '(' + this.translate + 'px) scale(' + this.scale + ')';
|
371 | var style = {
|
372 | transform: value
|
373 | };
|
374 | return Object(util_["autoprefixer"])(style);
|
375 | }
|
376 | },
|
377 |
|
378 | created: function created() {
|
379 | this.$parent && this.$parent.updateItems();
|
380 | },
|
381 | destroyed: function destroyed() {
|
382 | this.$parent && this.$parent.updateItems();
|
383 | }
|
384 | });
|
385 |
|
386 | var src_itemvue_type_script_lang_js_ = (itemvue_type_script_lang_js_);
|
387 |
|
388 | var componentNormalizer = __webpack_require__(0);
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 | var component = Object(componentNormalizer["a" ])(
|
399 | src_itemvue_type_script_lang_js_,
|
400 | render,
|
401 | staticRenderFns,
|
402 | false,
|
403 | null,
|
404 | null,
|
405 | null
|
406 |
|
407 | )
|
408 |
|
409 |
|
410 | if (false) { var api; }
|
411 | component.options.__file = "packages/carousel/src/item.vue"
|
412 | var item = (component.exports);
|
413 |
|
414 |
|
415 |
|
416 |
|
417 | item.install = function (Vue) {
|
418 | Vue.component(item.name, item);
|
419 | };
|
420 |
|
421 | var carousel_item = __webpack_exports__["default"] = (item);
|
422 |
|
423 | }),
|
424 |
|
425 | 3:
|
426 | (function(module, exports) {
|
427 |
|
428 | module.exports = require("element-ui/lib/utils/util");
|
429 |
|
430 | })
|
431 |
|
432 | }); |
\ | No newline at end of file |