UNPKG

12.9 kBJavaScriptView Raw
1module.exports =
2/******/ (function(modules) { // webpackBootstrap
3/******/ // The module cache
4/******/ var installedModules = {};
5/******/
6/******/ // The require function
7/******/ function __webpack_require__(moduleId) {
8/******/
9/******/ // Check if module is in cache
10/******/ if(installedModules[moduleId]) {
11/******/ return installedModules[moduleId].exports;
12/******/ }
13/******/ // Create a new module (and put it into the cache)
14/******/ var module = installedModules[moduleId] = {
15/******/ i: moduleId,
16/******/ l: false,
17/******/ exports: {}
18/******/ };
19/******/
20/******/ // Execute the module function
21/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22/******/
23/******/ // Flag the module as loaded
24/******/ module.l = true;
25/******/
26/******/ // Return the exports of the module
27/******/ return module.exports;
28/******/ }
29/******/
30/******/
31/******/ // expose the modules object (__webpack_modules__)
32/******/ __webpack_require__.m = modules;
33/******/
34/******/ // expose the module cache
35/******/ __webpack_require__.c = installedModules;
36/******/
37/******/ // define getter function for harmony exports
38/******/ __webpack_require__.d = function(exports, name, getter) {
39/******/ if(!__webpack_require__.o(exports, name)) {
40/******/ Object.defineProperty(exports, name, {
41/******/ configurable: false,
42/******/ enumerable: true,
43/******/ get: getter
44/******/ });
45/******/ }
46/******/ };
47/******/
48/******/ // getDefaultExport function for compatibility with non-harmony modules
49/******/ __webpack_require__.n = function(module) {
50/******/ var getter = module && module.__esModule ?
51/******/ function getDefault() { return module['default']; } :
52/******/ function getModuleExports() { return module; };
53/******/ __webpack_require__.d(getter, 'a', getter);
54/******/ return getter;
55/******/ };
56/******/
57/******/ // Object.prototype.hasOwnProperty.call
58/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
59/******/
60/******/ // __webpack_public_path__
61/******/ __webpack_require__.p = "/dist/";
62/******/
63/******/ // Load entry module and return exports
64/******/ return __webpack_require__(__webpack_require__.s = 328);
65/******/ })
66/************************************************************************/
67/******/ ({
68
69/***/ 0:
70/***/ (function(module, exports) {
71
72/* globals __VUE_SSR_CONTEXT__ */
73
74// IMPORTANT: Do NOT use ES2015 features in this file.
75// This module is a runtime utility for cleaner component module output and will
76// be included in the final webpack user bundle.
77
78module.exports = function normalizeComponent (
79 rawScriptExports,
80 compiledTemplate,
81 functionalTemplate,
82 injectStyles,
83 scopeId,
84 moduleIdentifier /* server only */
85) {
86 var esModule
87 var scriptExports = rawScriptExports = rawScriptExports || {}
88
89 // ES6 modules interop
90 var type = typeof rawScriptExports.default
91 if (type === 'object' || type === 'function') {
92 esModule = rawScriptExports
93 scriptExports = rawScriptExports.default
94 }
95
96 // Vue.extend constructor export interop
97 var options = typeof scriptExports === 'function'
98 ? scriptExports.options
99 : scriptExports
100
101 // render functions
102 if (compiledTemplate) {
103 options.render = compiledTemplate.render
104 options.staticRenderFns = compiledTemplate.staticRenderFns
105 options._compiled = true
106 }
107
108 // functional template
109 if (functionalTemplate) {
110 options.functional = true
111 }
112
113 // scopedId
114 if (scopeId) {
115 options._scopeId = scopeId
116 }
117
118 var hook
119 if (moduleIdentifier) { // server build
120 hook = function (context) {
121 // 2.3 injection
122 context =
123 context || // cached call
124 (this.$vnode && this.$vnode.ssrContext) || // stateful
125 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
126 // 2.2 with runInNewContext: true
127 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
128 context = __VUE_SSR_CONTEXT__
129 }
130 // inject component styles
131 if (injectStyles) {
132 injectStyles.call(this, context)
133 }
134 // register component module identifier for async chunk inferrence
135 if (context && context._registeredComponents) {
136 context._registeredComponents.add(moduleIdentifier)
137 }
138 }
139 // used by ssr in case component is cached and beforeCreate
140 // never gets called
141 options._ssrRegister = hook
142 } else if (injectStyles) {
143 hook = injectStyles
144 }
145
146 if (hook) {
147 var functional = options.functional
148 var existing = functional
149 ? options.render
150 : options.beforeCreate
151
152 if (!functional) {
153 // inject component registration as beforeCreate hook
154 options.beforeCreate = existing
155 ? [].concat(existing, hook)
156 : [hook]
157 } else {
158 // for template-only hot-reload because in that case the render fn doesn't
159 // go through the normalizer
160 options._injectStyles = hook
161 // register for functioal component in vue file
162 options.render = function renderWithStyleInjection (h, context) {
163 hook.call(context)
164 return existing(h, context)
165 }
166 }
167 }
168
169 return {
170 esModule: esModule,
171 exports: scriptExports,
172 options: options
173 }
174}
175
176
177/***/ }),
178
179/***/ 328:
180/***/ (function(module, exports, __webpack_require__) {
181
182"use strict";
183
184
185exports.__esModule = true;
186
187var _step = __webpack_require__(329);
188
189var _step2 = _interopRequireDefault(_step);
190
191function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
192
193/* istanbul ignore next */
194_step2.default.install = function (Vue) {
195 Vue.component(_step2.default.name, _step2.default);
196};
197
198exports.default = _step2.default;
199
200/***/ }),
201
202/***/ 329:
203/***/ (function(module, __webpack_exports__, __webpack_require__) {
204
205"use strict";
206Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
207/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__ = __webpack_require__(330);
208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__);
209/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6521d5e0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__ = __webpack_require__(331);
210var normalizeComponent = __webpack_require__(0)
211/* script */
212
213/* template */
214
215/* template functional */
216 var __vue_template_functional__ = false
217/* styles */
218var __vue_styles__ = null
219/* scopeId */
220var __vue_scopeId__ = null
221/* moduleIdentifier (server only) */
222var __vue_module_identifier__ = null
223var Component = normalizeComponent(
224 __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default.a,
225 __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6521d5e0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__["a" /* default */],
226 __vue_template_functional__,
227 __vue_styles__,
228 __vue_scopeId__,
229 __vue_module_identifier__
230)
231
232/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
233
234
235/***/ }),
236
237/***/ 330:
238/***/ (function(module, exports, __webpack_require__) {
239
240"use strict";
241
242
243exports.__esModule = true;
244//
245//
246//
247//
248//
249//
250//
251//
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//
279//
280//
281//
282//
283//
284//
285//
286//
287//
288//
289//
290//
291//
292//
293//
294//
295//
296//
297//
298//
299
300exports.default = {
301 name: 'ElStep',
302
303 props: {
304 title: String,
305 icon: String,
306 description: String,
307 status: String
308 },
309
310 data: function data() {
311 return {
312 index: -1,
313 lineStyle: {},
314 internalStatus: ''
315 };
316 },
317 beforeCreate: function beforeCreate() {
318 this.$parent.steps.push(this);
319 },
320 beforeDestroy: function beforeDestroy() {
321 var steps = this.$parent.steps;
322 var index = steps.indexOf(this);
323 if (index >= 0) {
324 steps.splice(index, 1);
325 }
326 },
327
328
329 computed: {
330 currentStatus: function currentStatus() {
331 return this.status || this.internalStatus;
332 },
333 prevStatus: function prevStatus() {
334 var prevStep = this.$parent.steps[this.index - 1];
335 return prevStep ? prevStep.currentStatus : 'wait';
336 },
337 isCenter: function isCenter() {
338 return this.$parent.alignCenter;
339 },
340 isVertical: function isVertical() {
341 return this.$parent.direction === 'vertical';
342 },
343 isSimple: function isSimple() {
344 return this.$parent.simple;
345 },
346 isLast: function isLast() {
347 var parent = this.$parent;
348 return parent.steps[parent.steps.length - 1] === this;
349 },
350 stepsCount: function stepsCount() {
351 return this.$parent.steps.length;
352 },
353 space: function space() {
354 var isSimple = this.isSimple,
355 space = this.$parent.space;
356
357 return isSimple ? '' : space;
358 },
359
360 style: function style() {
361 var style = {};
362 var parent = this.$parent;
363 var len = parent.steps.length;
364
365 var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
366 style.flexBasis = space;
367 if (this.isVertical) return style;
368 if (this.isLast) {
369 style.maxWidth = 100 / this.stepsCount + '%';
370 } else {
371 style.marginRight = -this.$parent.stepOffset + 'px';
372 }
373
374 return style;
375 }
376 },
377
378 methods: {
379 updateStatus: function updateStatus(val) {
380 var prevChild = this.$parent.$children[this.index - 1];
381
382 if (val > this.index) {
383 this.internalStatus = this.$parent.finishStatus;
384 } else if (val === this.index && this.prevStatus !== 'error') {
385 this.internalStatus = this.$parent.processStatus;
386 } else {
387 this.internalStatus = 'wait';
388 }
389
390 if (prevChild) prevChild.calcProgress(this.internalStatus);
391 },
392 calcProgress: function calcProgress(status) {
393 var step = 100;
394 var style = {};
395
396 style.transitionDelay = 150 * this.index + 'ms';
397 if (status === this.$parent.processStatus) {
398 step = this.currentStatus !== 'error' ? 0 : 0;
399 } else if (status === 'wait') {
400 step = 0;
401 style.transitionDelay = -150 * this.index + 'ms';
402 }
403
404 style.borderWidth = step ? '1px' : 0;
405 this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
406
407 this.lineStyle = style;
408 }
409 },
410
411 mounted: function mounted() {
412 var _this = this;
413
414 var unwatch = this.$watch('index', function (val) {
415 _this.$watch('$parent.active', _this.updateStatus, { immediate: true });
416 unwatch();
417 });
418 }
419};
420
421/***/ }),
422
423/***/ 331:
424/***/ (function(module, __webpack_exports__, __webpack_require__) {
425
426"use strict";
427var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-step",class:[
428 !_vm.isSimple && ("is-" + (_vm.$parent.direction)),
429 _vm.isSimple && 'is-simple',
430 _vm.isLast && !_vm.space && !_vm.isCenter && 'is-flex',
431 _vm.isCenter && !_vm.isVertical && !_vm.isSimple && 'is-center'
432 ],style:(_vm.style)},[_c('div',{staticClass:"el-step__head",class:("is-" + _vm.currentStatus)},[_c('div',{staticClass:"el-step__line",style:(_vm.isLast ? '' : { marginRight: _vm.$parent.stepOffset + 'px' })},[_c('i',{staticClass:"el-step__line-inner",style:(_vm.lineStyle)})]),_c('div',{staticClass:"el-step__icon",class:("is-" + (_vm.icon ? 'icon' : 'text'))},[(_vm.currentStatus !== 'success' && _vm.currentStatus !== 'error')?_vm._t("icon",[(_vm.icon)?_c('i',{staticClass:"el-step__icon-inner",class:[_vm.icon]}):_vm._e(),(!_vm.icon && !_vm.isSimple)?_c('div',{staticClass:"el-step__icon-inner"},[_vm._v(_vm._s(_vm.index + 1))]):_vm._e()]):_c('i',{staticClass:"el-step__icon-inner is-status",class:['el-icon-' + (_vm.currentStatus === 'success' ? 'check' : 'close')]})],2)]),_c('div',{staticClass:"el-step__main"},[_c('div',{ref:"title",staticClass:"el-step__title",class:['is-' + _vm.currentStatus]},[_vm._t("title",[_vm._v(_vm._s(_vm.title))])],2),(_vm.isSimple)?_c('div',{staticClass:"el-step__arrow"}):_c('div',{staticClass:"el-step__description",class:['is-' + _vm.currentStatus]},[_vm._t("description",[_vm._v(_vm._s(_vm.description))])],2)])])}
433var staticRenderFns = []
434var esExports = { render: render, staticRenderFns: staticRenderFns }
435/* harmony default export */ __webpack_exports__["a"] = (esExports);
436
437/***/ })
438
439/******/ });
\No newline at end of file