1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory(require("./_util/proptype"), require("./_util/util"));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["./_util/proptype", "./_util/util"], factory);
|
6 | else {
|
7 | var a = typeof exports === 'object' ? factory(require("./_util/proptype"), require("./_util/util")) : factory(root["./_util/proptype"], root["./_util/util"]);
|
8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9 | }
|
10 | })(window, function(__WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__20__) {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50 | }
|
51 | };
|
52 |
|
53 |
|
54 | __webpack_require__.r = function(exports) {
|
55 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57 | }
|
58 | Object.defineProperty(exports, '__esModule', { value: true });
|
59 | };
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | __webpack_require__.t = function(value, mode) {
|
67 | if(mode & 1) value = __webpack_require__(value);
|
68 | if(mode & 8) return value;
|
69 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70 | var ns = Object.create(null);
|
71 | __webpack_require__.r(ns);
|
72 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74 | return ns;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.n = function(module) {
|
79 | var getter = module && module.__esModule ?
|
80 | function getDefault() { return module['default']; } :
|
81 | function getModuleExports() { return module; };
|
82 | __webpack_require__.d(getter, 'a', getter);
|
83 | return getter;
|
84 | };
|
85 |
|
86 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "/dist/";
|
91 |
|
92 |
|
93 |
|
94 | return __webpack_require__(__webpack_require__.s = 127);
|
95 | })
|
96 |
|
97 | ({
|
98 |
|
99 | 0:
|
100 | (function(module, __webpack_exports__, __webpack_require__) {
|
101 |
|
102 | "use strict";
|
103 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | function normalizeComponent (
|
111 | scriptExports,
|
112 | render,
|
113 | staticRenderFns,
|
114 | functionalTemplate,
|
115 | injectStyles,
|
116 | scopeId,
|
117 | moduleIdentifier, /* server only */
|
118 | shadowMode /* vue-cli only */
|
119 | ) {
|
120 |
|
121 | var options = typeof scriptExports === 'function'
|
122 | ? scriptExports.options
|
123 | : scriptExports
|
124 |
|
125 |
|
126 | if (render) {
|
127 | options.render = render
|
128 | options.staticRenderFns = staticRenderFns
|
129 | options._compiled = true
|
130 | }
|
131 |
|
132 |
|
133 | if (functionalTemplate) {
|
134 | options.functional = true
|
135 | }
|
136 |
|
137 |
|
138 | if (scopeId) {
|
139 | options._scopeId = 'data-v-' + scopeId
|
140 | }
|
141 |
|
142 | var hook
|
143 | if (moduleIdentifier) {
|
144 | hook = function (context) {
|
145 |
|
146 | context =
|
147 | context ||
|
148 | (this.$vnode && this.$vnode.ssrContext) ||
|
149 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
150 |
|
151 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
152 | context = __VUE_SSR_CONTEXT__
|
153 | }
|
154 |
|
155 | if (injectStyles) {
|
156 | injectStyles.call(this, context)
|
157 | }
|
158 |
|
159 | if (context && context._registeredComponents) {
|
160 | context._registeredComponents.add(moduleIdentifier)
|
161 | }
|
162 | }
|
163 |
|
164 |
|
165 | options._ssrRegister = hook
|
166 | } else if (injectStyles) {
|
167 | hook = shadowMode
|
168 | ? function () {
|
169 | injectStyles.call(
|
170 | this,
|
171 | (options.functional ? this.parent : this).$root.$options.shadowRoot
|
172 | )
|
173 | }
|
174 | : injectStyles
|
175 | }
|
176 |
|
177 | if (hook) {
|
178 | if (options.functional) {
|
179 |
|
180 |
|
181 | options._injectStyles = hook
|
182 |
|
183 | var originalRender = options.render
|
184 | options.render = function renderWithStyleInjection (h, context) {
|
185 | hook.call(context)
|
186 | return originalRender(h, context)
|
187 | }
|
188 | } else {
|
189 |
|
190 | var existing = options.beforeCreate
|
191 | options.beforeCreate = existing
|
192 | ? [].concat(existing, hook)
|
193 | : [hook]
|
194 | }
|
195 | }
|
196 |
|
197 | return {
|
198 | exports: scriptExports,
|
199 | options: options
|
200 | }
|
201 | }
|
202 |
|
203 |
|
204 | }),
|
205 |
|
206 | 127:
|
207 | (function(module, __webpack_exports__, __webpack_require__) {
|
208 |
|
209 | "use strict";
|
210 |
|
211 | __webpack_require__.r(__webpack_exports__);
|
212 |
|
213 |
|
214 | var style = __webpack_require__(139);
|
215 |
|
216 |
|
217 | var switch_style = __webpack_require__(220);
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | var render = function () {
|
224 | var _vm = this
|
225 | var _h = _vm.$createElement
|
226 | var _c = _vm._self._c || _h
|
227 | return _c(
|
228 | "span",
|
229 | {
|
230 | class: _vm.classes,
|
231 | attrs: { tabindex: _vm.number },
|
232 | on: {
|
233 | click: _vm.toggle,
|
234 | mouseup: _vm.handleMouseUp,
|
235 | keydown: _vm.handleKeyDown,
|
236 | },
|
237 | },
|
238 | [
|
239 | _c(
|
240 | "span",
|
241 | { class: _vm.prefixCls + "-inner" },
|
242 | [
|
243 | _vm.checked
|
244 | ? _vm._t("on", [_vm._v("\n " + _vm._s(_vm.on) + "\n ")])
|
245 | : _vm._t("off", [_vm._v("\n " + _vm._s(_vm.off) + "\n ")]),
|
246 | ],
|
247 | 2
|
248 | ),
|
249 | ]
|
250 | )
|
251 | }
|
252 | var staticRenderFns = []
|
253 | render._withStripped = true
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 | var defineProperty_ = __webpack_require__(3);
|
260 | var defineProperty_default = __webpack_require__.n(defineProperty_);
|
261 |
|
262 |
|
263 | var proptype_ = __webpack_require__(7);
|
264 |
|
265 |
|
266 | var util_ = __webpack_require__(20);
|
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 | var switchvue_type_script_lang_js_ = ({
|
293 | name: 'MdsSwitch',
|
294 | model: {
|
295 | prop: 'checked',
|
296 | event: 'change'
|
297 | },
|
298 | data: function data() {
|
299 | return {
|
300 | state: false
|
301 | };
|
302 | },
|
303 |
|
304 | props: {
|
305 | prefixCls: {
|
306 | type: String,
|
307 | default: 'mds-switch'
|
308 | },
|
309 | checked: {
|
310 | type: String | Boolean | Number,
|
311 | required: true
|
312 | },
|
313 | on: String,
|
314 | disabled: {
|
315 | type: Boolean,
|
316 | default: false
|
317 | },
|
318 | number: {
|
319 | type: Number,
|
320 | default: 0
|
321 | },
|
322 | size: {
|
323 | type: String,
|
324 | default: 'small',
|
325 | validator: function validator(value) {
|
326 | return Object(proptype_["oneOf"])(value, ['default', 'small', 'large']);
|
327 | }
|
328 | },
|
329 | off: String,
|
330 | onValue: {
|
331 | type: String | Boolean | Number,
|
332 | default: true
|
333 | },
|
334 | offValue: {
|
335 | type: String | Boolean | Number,
|
336 | default: false
|
337 | }
|
338 | },
|
339 | watch: {
|
340 | checked: function checked(newVal) {
|
341 | this.state = this.checked === this.onValue;
|
342 | }
|
343 | },
|
344 | computed: {
|
345 | classes: function classes() {
|
346 | var _ref;
|
347 |
|
348 | var prefixCls = this.prefixCls;
|
349 | return [prefixCls, (_ref = {}, defineProperty_default()(_ref, prefixCls + '-checked', this.state), defineProperty_default()(_ref, prefixCls + '-disabled', this.disabled), defineProperty_default()(_ref, prefixCls + '-small', this.size === 'small'), _ref)];
|
350 | }
|
351 | },
|
352 | methods: {
|
353 | handleKeyDown: function handleKeyDown(e) {
|
354 | var keyCode = e.keyCode;
|
355 | keyCode === 37 ? this.setChecked(false) : keyCode === 39 ? this.setChecked(true) : keyCode === 32 || keyCode === 13 ? this.toggle() : Object(util_["noop"])();
|
356 | },
|
357 | handleMouseUp: function handleMouseUp(e) {
|
358 | e.currentTarget.blur();
|
359 | },
|
360 | toggle: function toggle() {
|
361 | var state = !this.state;
|
362 | this.setChecked(state);
|
363 | },
|
364 | setChecked: function setChecked(checked) {
|
365 | if (this.disabled) return;checked !== this.state && this.$emit('change', checked ? this.onValue : this.offValue);
|
366 | }
|
367 | },
|
368 | mounted: function mounted() {
|
369 | this.state = this.checked === this.onValue;
|
370 | }
|
371 | });
|
372 |
|
373 | var switch_switchvue_type_script_lang_js_ = (switchvue_type_script_lang_js_);
|
374 |
|
375 | var componentNormalizer = __webpack_require__(0);
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 | var component = Object(componentNormalizer["a" ])(
|
386 | switch_switchvue_type_script_lang_js_,
|
387 | render,
|
388 | staticRenderFns,
|
389 | false,
|
390 | null,
|
391 | null,
|
392 | null
|
393 |
|
394 | )
|
395 |
|
396 |
|
397 | if (false) { var api; }
|
398 | component.options.__file = "components/switch/switch.vue"
|
399 | var switch_switch = (component.exports);
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 | switch_switch.install = function (Vue) {
|
406 | Vue.component(switch_switch.name, switch_switch);
|
407 | };
|
408 | var components_switch = __webpack_exports__["default"] = (switch_switch);
|
409 |
|
410 | }),
|
411 |
|
412 | 139:
|
413 | (function(module, exports) {
|
414 |
|
415 |
|
416 |
|
417 | }),
|
418 |
|
419 | 20:
|
420 | (function(module, exports) {
|
421 |
|
422 | module.exports = __WEBPACK_EXTERNAL_MODULE__20__;
|
423 |
|
424 | }),
|
425 |
|
426 | 220:
|
427 | (function(module, exports) {
|
428 |
|
429 |
|
430 |
|
431 | }),
|
432 |
|
433 | 3:
|
434 | (function(module, exports) {
|
435 |
|
436 | module.exports = require("babel-runtime/helpers/defineProperty");
|
437 |
|
438 | }),
|
439 |
|
440 | 7:
|
441 | (function(module, exports) {
|
442 |
|
443 | module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
|
444 |
|
445 | })
|
446 |
|
447 | });
|
448 | }); |
\ | No newline at end of file |