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, {
|
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 |
|
58 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
|
60 |
|
61 | __webpack_require__.p = "/dist/";
|
62 |
|
63 |
|
64 | return __webpack_require__(__webpack_require__.s = 134);
|
65 | })
|
66 |
|
67 | ({
|
68 |
|
69 | 0:
|
70 | (function(module, exports) {
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | module.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 |
|
90 | var type = typeof rawScriptExports.default
|
91 | if (type === 'object' || type === 'function') {
|
92 | esModule = rawScriptExports
|
93 | scriptExports = rawScriptExports.default
|
94 | }
|
95 |
|
96 |
|
97 | var options = typeof scriptExports === 'function'
|
98 | ? scriptExports.options
|
99 | : scriptExports
|
100 |
|
101 |
|
102 | if (compiledTemplate) {
|
103 | options.render = compiledTemplate.render
|
104 | options.staticRenderFns = compiledTemplate.staticRenderFns
|
105 | options._compiled = true
|
106 | }
|
107 |
|
108 |
|
109 | if (functionalTemplate) {
|
110 | options.functional = true
|
111 | }
|
112 |
|
113 |
|
114 | if (scopeId) {
|
115 | options._scopeId = scopeId
|
116 | }
|
117 |
|
118 | var hook
|
119 | if (moduleIdentifier) {
|
120 | hook = function (context) {
|
121 |
|
122 | context =
|
123 | context ||
|
124 | (this.$vnode && this.$vnode.ssrContext) ||
|
125 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
126 |
|
127 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
128 | context = __VUE_SSR_CONTEXT__
|
129 | }
|
130 |
|
131 | if (injectStyles) {
|
132 | injectStyles.call(this, context)
|
133 | }
|
134 |
|
135 | if (context && context._registeredComponents) {
|
136 | context._registeredComponents.add(moduleIdentifier)
|
137 | }
|
138 | }
|
139 |
|
140 |
|
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 |
|
154 | options.beforeCreate = existing
|
155 | ? [].concat(existing, hook)
|
156 | : [hook]
|
157 | } else {
|
158 |
|
159 |
|
160 | options._injectStyles = hook
|
161 |
|
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 | 134:
|
180 | (function(module, exports, __webpack_require__) {
|
181 |
|
182 | "use strict";
|
183 |
|
184 |
|
185 | exports.__esModule = true;
|
186 |
|
187 | var _component = __webpack_require__(135);
|
188 |
|
189 | var _component2 = _interopRequireDefault(_component);
|
190 |
|
191 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
192 |
|
193 |
|
194 | _component2.default.install = function (Vue) {
|
195 | Vue.component(_component2.default.name, _component2.default);
|
196 | };
|
197 |
|
198 | exports.default = _component2.default;
|
199 |
|
200 | }),
|
201 |
|
202 | 135:
|
203 | (function(module, __webpack_exports__, __webpack_require__) {
|
204 |
|
205 | "use strict";
|
206 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
207 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_component_vue__ = __webpack_require__(136);
|
208 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_component_vue__);
|
209 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_80721fd0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_component_vue__ = __webpack_require__(137);
|
210 | var normalizeComponent = __webpack_require__(0)
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | var __vue_template_functional__ = false
|
217 |
|
218 | var __vue_styles__ = null
|
219 |
|
220 | var __vue_scopeId__ = null
|
221 |
|
222 | var __vue_module_identifier__ = null
|
223 | var Component = normalizeComponent(
|
224 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_component_vue___default.a,
|
225 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_80721fd0_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_component_vue__["a" ],
|
226 | __vue_template_functional__,
|
227 | __vue_styles__,
|
228 | __vue_scopeId__,
|
229 | __vue_module_identifier__
|
230 | )
|
231 |
|
232 | __webpack_exports__["default"] = (Component.exports);
|
233 |
|
234 |
|
235 | }),
|
236 |
|
237 | 136:
|
238 | (function(module, exports, __webpack_require__) {
|
239 |
|
240 | "use strict";
|
241 |
|
242 |
|
243 | exports.__esModule = true;
|
244 |
|
245 | var _focus = __webpack_require__(19);
|
246 |
|
247 | var _focus2 = _interopRequireDefault(_focus);
|
248 |
|
249 | var _migrating = __webpack_require__(8);
|
250 |
|
251 | var _migrating2 = _interopRequireDefault(_migrating);
|
252 |
|
253 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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 | exports.default = {
|
294 | name: 'ElSwitch',
|
295 | mixins: [(0, _focus2.default)('input'), _migrating2.default],
|
296 | inject: {
|
297 | elForm: {
|
298 | default: ''
|
299 | }
|
300 | },
|
301 | props: {
|
302 | value: {
|
303 | type: [Boolean, String, Number],
|
304 | default: false
|
305 | },
|
306 | disabled: {
|
307 | type: Boolean,
|
308 | default: false
|
309 | },
|
310 | width: {
|
311 | type: Number,
|
312 | default: 40
|
313 | },
|
314 | activeIconClass: {
|
315 | type: String,
|
316 | default: ''
|
317 | },
|
318 | inactiveIconClass: {
|
319 | type: String,
|
320 | default: ''
|
321 | },
|
322 | activeText: String,
|
323 | inactiveText: String,
|
324 | activeColor: {
|
325 | type: String,
|
326 | default: ''
|
327 | },
|
328 | inactiveColor: {
|
329 | type: String,
|
330 | default: ''
|
331 | },
|
332 | activeValue: {
|
333 | type: [Boolean, String, Number],
|
334 | default: true
|
335 | },
|
336 | inactiveValue: {
|
337 | type: [Boolean, String, Number],
|
338 | default: false
|
339 | },
|
340 | name: {
|
341 | type: String,
|
342 | default: ''
|
343 | },
|
344 | id: String
|
345 | },
|
346 | data: function data() {
|
347 | return {
|
348 | coreWidth: this.width
|
349 | };
|
350 | },
|
351 | created: function created() {
|
352 | if (!~[this.activeValue, this.inactiveValue].indexOf(this.value)) {
|
353 | this.$emit('input', this.inactiveValue);
|
354 | }
|
355 | },
|
356 |
|
357 | computed: {
|
358 | checked: function checked() {
|
359 | return this.value === this.activeValue;
|
360 | },
|
361 | switchDisabled: function switchDisabled() {
|
362 | return this.disabled || (this.elForm || {}).disabled;
|
363 | }
|
364 | },
|
365 | watch: {
|
366 | checked: function checked() {
|
367 | this.$refs.input.checked = this.checked;
|
368 | if (this.activeColor || this.inactiveColor) {
|
369 | this.setBackgroundColor();
|
370 | }
|
371 | }
|
372 | },
|
373 | methods: {
|
374 | handleChange: function handleChange(event) {
|
375 | var _this = this;
|
376 |
|
377 | this.$emit('input', !this.checked ? this.activeValue : this.inactiveValue);
|
378 | this.$emit('change', !this.checked ? this.activeValue : this.inactiveValue);
|
379 | this.$nextTick(function () {
|
380 |
|
381 |
|
382 | _this.$refs.input.checked = _this.checked;
|
383 | });
|
384 | },
|
385 | setBackgroundColor: function setBackgroundColor() {
|
386 | var newColor = this.checked ? this.activeColor : this.inactiveColor;
|
387 | this.$refs.core.style.borderColor = newColor;
|
388 | this.$refs.core.style.backgroundColor = newColor;
|
389 | },
|
390 | switchValue: function switchValue() {
|
391 | !this.switchDisabled && this.handleChange();
|
392 | },
|
393 | getMigratingConfig: function getMigratingConfig() {
|
394 | return {
|
395 | props: {
|
396 | 'on-color': 'on-color is renamed to active-color.',
|
397 | 'off-color': 'off-color is renamed to inactive-color.',
|
398 | 'on-text': 'on-text is renamed to active-text.',
|
399 | 'off-text': 'off-text is renamed to inactive-text.',
|
400 | 'on-value': 'on-value is renamed to active-value.',
|
401 | 'off-value': 'off-value is renamed to inactive-value.',
|
402 | 'on-icon-class': 'on-icon-class is renamed to active-icon-class.',
|
403 | 'off-icon-class': 'off-icon-class is renamed to inactive-icon-class.'
|
404 | }
|
405 | };
|
406 | }
|
407 | },
|
408 | mounted: function mounted() {
|
409 |
|
410 | this.coreWidth = this.width || 40;
|
411 | if (this.activeColor || this.inactiveColor) {
|
412 | this.setBackgroundColor();
|
413 | }
|
414 | this.$refs.input.checked = this.checked;
|
415 | }
|
416 | };
|
417 |
|
418 | }),
|
419 |
|
420 | 137:
|
421 | (function(module, __webpack_exports__, __webpack_require__) {
|
422 |
|
423 | "use strict";
|
424 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-switch",class:{ 'is-disabled': _vm.switchDisabled, 'is-checked': _vm.checked },attrs:{"role":"switch","aria-checked":_vm.checked,"aria-disabled":_vm.switchDisabled},on:{"click":_vm.switchValue}},[_c('input',{ref:"input",staticClass:"el-switch__input",attrs:{"type":"checkbox","id":_vm.id,"name":_vm.name,"true-value":_vm.activeValue,"false-value":_vm.inactiveValue,"disabled":_vm.switchDisabled},on:{"change":_vm.handleChange,"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.switchValue($event)}}}),(_vm.inactiveIconClass || _vm.inactiveText)?_c('span',{class:['el-switch__label', 'el-switch__label--left', !_vm.checked ? 'is-active' : '']},[(_vm.inactiveIconClass)?_c('i',{class:[_vm.inactiveIconClass]}):_vm._e(),(!_vm.inactiveIconClass && _vm.inactiveText)?_c('span',{attrs:{"aria-hidden":_vm.checked}},[_vm._v(_vm._s(_vm.inactiveText))]):_vm._e()]):_vm._e(),_c('span',{ref:"core",staticClass:"el-switch__core",style:({ 'width': _vm.coreWidth + 'px' })}),(_vm.activeIconClass || _vm.activeText)?_c('span',{class:['el-switch__label', 'el-switch__label--right', _vm.checked ? 'is-active' : '']},[(_vm.activeIconClass)?_c('i',{class:[_vm.activeIconClass]}):_vm._e(),(!_vm.activeIconClass && _vm.activeText)?_c('span',{attrs:{"aria-hidden":!_vm.checked}},[_vm._v(_vm._s(_vm.activeText))]):_vm._e()]):_vm._e()])}
|
425 | var staticRenderFns = []
|
426 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
427 | __webpack_exports__["a"] = (esExports);
|
428 |
|
429 | }),
|
430 |
|
431 | 19:
|
432 | (function(module, exports) {
|
433 |
|
434 | module.exports = require("element-ui/lib/mixins/focus");
|
435 |
|
436 | }),
|
437 |
|
438 | 8:
|
439 | (function(module, exports) {
|
440 |
|
441 | module.exports = require("element-ui/lib/mixins/migrating");
|
442 |
|
443 | })
|
444 |
|
445 | }); |
\ | No newline at end of file |