UNPKG

12.9 kBJavaScriptView Raw
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__) {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
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/******/ // define __esModule on exports
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/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
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/******/ // getDefaultExport function for compatibility with non-harmony modules
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/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "/dist/";
91/******/
92/******/
93/******/ // Load entry module and return exports
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/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
104/* globals __VUE_SSR_CONTEXT__ */
105
106// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
107// This module is a runtime utility for cleaner component module output and will
108// be included in the final webpack user bundle.
109
110function normalizeComponent (
111 scriptExports,
112 render,
113 staticRenderFns,
114 functionalTemplate,
115 injectStyles,
116 scopeId,
117 moduleIdentifier, /* server only */
118 shadowMode /* vue-cli only */
119) {
120 // Vue.extend constructor export interop
121 var options = typeof scriptExports === 'function'
122 ? scriptExports.options
123 : scriptExports
124
125 // render functions
126 if (render) {
127 options.render = render
128 options.staticRenderFns = staticRenderFns
129 options._compiled = true
130 }
131
132 // functional template
133 if (functionalTemplate) {
134 options.functional = true
135 }
136
137 // scopedId
138 if (scopeId) {
139 options._scopeId = 'data-v-' + scopeId
140 }
141
142 var hook
143 if (moduleIdentifier) { // server build
144 hook = function (context) {
145 // 2.3 injection
146 context =
147 context || // cached call
148 (this.$vnode && this.$vnode.ssrContext) || // stateful
149 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
150 // 2.2 with runInNewContext: true
151 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
152 context = __VUE_SSR_CONTEXT__
153 }
154 // inject component styles
155 if (injectStyles) {
156 injectStyles.call(this, context)
157 }
158 // register component module identifier for async chunk inferrence
159 if (context && context._registeredComponents) {
160 context._registeredComponents.add(moduleIdentifier)
161 }
162 }
163 // used by ssr in case component is cached and beforeCreate
164 // never gets called
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 // for template-only hot-reload because in that case the render fn doesn't
180 // go through the normalizer
181 options._injectStyles = hook
182 // register for functional component in vue file
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 // inject component registration as beforeCreate hook
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// ESM COMPAT FLAG
211__webpack_require__.r(__webpack_exports__);
212
213// EXTERNAL MODULE: ./components/style/index.less
214var style = __webpack_require__(139);
215
216// EXTERNAL MODULE: ./components/switch/style/index.less
217var switch_style = __webpack_require__(220);
218
219// CONCATENATED MODULE: ./components/switch/style/index.js
220
221
222// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/switch/switch.vue?vue&type=template&id=0eee4dc4&
223var 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}
252var staticRenderFns = []
253render._withStripped = true
254
255
256// CONCATENATED MODULE: ./components/switch/switch.vue?vue&type=template&id=0eee4dc4&
257
258// EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
259var defineProperty_ = __webpack_require__(3);
260var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
261
262// EXTERNAL MODULE: external "./_util/proptype"
263var proptype_ = __webpack_require__(7);
264
265// EXTERNAL MODULE: external "./_util/util"
266var util_ = __webpack_require__(20);
267
268// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/switch/switch.vue?vue&type=script&lang=js&
269
270//
271//
272//
273//
274//
275//
276//
277//
278//
279//
280//
281//
282//
283//
284//
285//
286//
287//
288
289
290
291
292/* harmony default export */ 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// CONCATENATED MODULE: ./components/switch/switch.vue?vue&type=script&lang=js&
373 /* harmony default export */ var switch_switchvue_type_script_lang_js_ = (switchvue_type_script_lang_js_);
374// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
375var componentNormalizer = __webpack_require__(0);
376
377// CONCATENATED MODULE: ./components/switch/switch.vue
378
379
380
381
382
383/* normalize component */
384
385var component = Object(componentNormalizer["a" /* default */])(
386 switch_switchvue_type_script_lang_js_,
387 render,
388 staticRenderFns,
389 false,
390 null,
391 null,
392 null
393
394)
395
396/* hot reload */
397if (false) { var api; }
398component.options.__file = "components/switch/switch.vue"
399/* harmony default export */ var switch_switch = (component.exports);
400// CONCATENATED MODULE: ./components/switch/index.js
401
402
403
404/* istanbul ignore next */
405switch_switch.install = function (Vue) {
406 Vue.component(switch_switch.name, switch_switch);
407};
408/* harmony default export */ var components_switch = __webpack_exports__["default"] = (switch_switch);
409
410/***/ }),
411
412/***/ 139:
413/***/ (function(module, exports) {
414
415// removed by extract-text-webpack-plugin
416
417/***/ }),
418
419/***/ 20:
420/***/ (function(module, exports) {
421
422module.exports = __WEBPACK_EXTERNAL_MODULE__20__;
423
424/***/ }),
425
426/***/ 220:
427/***/ (function(module, exports) {
428
429// removed by extract-text-webpack-plugin
430
431/***/ }),
432
433/***/ 3:
434/***/ (function(module, exports) {
435
436module.exports = require("babel-runtime/helpers/defineProperty");
437
438/***/ }),
439
440/***/ 7:
441/***/ (function(module, exports) {
442
443module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
444
445/***/ })
446
447/******/ });
448});
\No newline at end of file