@mdsfe/mds-ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +778 -0
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/dist/_locale/index.js +18 -0
- package/dist/_locale/zh-CN.js +123 -0
- package/dist/_mixin/emitter.js +35 -0
- package/dist/_mixin/focus.js +13 -0
- package/dist/_mixin/locale.js +17 -0
- package/dist/_mixin/popper.js +192 -0
- package/dist/_mixin/tooltip.js +218 -0
- package/dist/_util/__test__/switchcase.test.js +43 -0
- package/dist/_util/autoprefixer.js +249 -0
- package/dist/_util/clickoutside.js +79 -0
- package/dist/_util/date.js +368 -0
- package/dist/_util/dateUtil.js +311 -0
- package/dist/_util/dom.js +240 -0
- package/dist/_util/getRequestAnimationFrame.js +50 -0
- package/dist/_util/getScroll.js +21 -0
- package/dist/_util/loaders/loaders.css.js +52 -0
- package/dist/_util/loaders/loading.js +53 -0
- package/dist/_util/merge.js +18 -0
- package/dist/_util/popper.js +1261 -0
- package/dist/_util/popup/index.js +232 -0
- package/dist/_util/popup/popup-manager.js +205 -0
- package/dist/_util/proptype.js +12 -0
- package/dist/_util/repeatClick.js +30 -0
- package/dist/_util/resize.js +61 -0
- package/dist/_util/resizeEvent.js +59 -0
- package/dist/_util/scrollIntoView.js +38 -0
- package/dist/_util/scrollbar-width.js +37 -0
- package/dist/_util/soda.js +54 -0
- package/dist/_util/switchcase.js +22 -0
- package/dist/_util/throttleByAnimationFrame.js +70 -0
- package/dist/_util/tree/node.js +412 -0
- package/dist/_util/tree/tree.js +410 -0
- package/dist/_util/util.js +166 -0
- package/dist/_util/vue-popper.js +213 -0
- package/dist/affix.js +509 -0
- package/dist/anchor.js +522 -0
- package/dist/avatar.js +437 -0
- package/dist/backtop.js +469 -0
- package/dist/badge.js +439 -0
- package/dist/bordershadow.js +310 -0
- package/dist/breadcrumb.js +434 -0
- package/dist/button.js +579 -0
- package/dist/card.js +514 -0
- package/dist/carousel.js +1326 -0
- package/dist/cascaderpanel.js +2320 -0
- package/dist/checkbox.js +681 -0
- package/dist/col.js +546 -0
- package/dist/collapse.js +671 -0
- package/dist/color.js +306 -0
- package/dist/datepicker.js +8089 -0
- package/dist/divider.js +346 -0
- package/dist/drawer.js +652 -0
- package/dist/dropdown.js +687 -0
- package/dist/empty.js +416 -0
- package/dist/font.js +306 -0
- package/dist/form.js +878 -0
- package/dist/icon.js +401 -0
- package/dist/index.js +1 -0
- package/dist/input.js +1251 -0
- package/dist/inputnumber.js +689 -0
- package/dist/layout.js +786 -0
- package/dist/list.js +789 -0
- package/dist/loading.js +430 -0
- package/dist/mds-ui.min.css +7 -0
- package/dist/mds-ui.min.js +64911 -0
- package/dist/menu.js +1131 -0
- package/dist/message.js +1016 -0
- package/dist/modal.js +895 -0
- package/dist/notification.js +818 -0
- package/dist/pagination.js +1213 -0
- package/dist/popconfirm.js +336 -0
- package/dist/popover.js +206 -0
- package/dist/progress.js +1023 -0
- package/dist/radio.js +760 -0
- package/dist/rate.js +765 -0
- package/dist/row.js +546 -0
- package/dist/select.js +4950 -0
- package/dist/slider.js +1411 -0
- package/dist/slottable.js +1414 -0
- package/dist/steps.js +546 -0
- package/dist/style/affix.css +5524 -0
- package/dist/style/anchor.css +5572 -0
- package/dist/style/avatar.css +5587 -0
- package/dist/style/backtop.css +34 -0
- package/dist/style/badge.css +5655 -0
- package/dist/style/bordershadow.css +5601 -0
- package/dist/style/breadcrumb.css +5551 -0
- package/dist/style/button.css +7679 -0
- package/dist/style/card.css +5670 -0
- package/dist/style/carousel.css +5731 -0
- package/dist/style/cascaderpanel.css +125 -0
- package/dist/style/checkbox.css +5700 -0
- package/dist/style/col.css +8121 -0
- package/dist/style/collapse.css +5593 -0
- package/dist/style/color.css +6136 -0
- package/dist/style/datepicker.css +5977 -0
- package/dist/style/divider.css +5558 -0
- package/dist/style/drawer.css +7979 -0
- package/dist/style/dropdown.css +7950 -0
- package/dist/style/empty.css +5563 -0
- package/dist/style/font.css +5559 -0
- package/dist/style/form.css +5662 -0
- package/dist/style/icon.css +5538 -0
- package/dist/style/input.css +6256 -0
- package/dist/style/inputnumber.css +5828 -0
- package/dist/style/layout.css +5572 -0
- package/dist/style/list.css +5655 -0
- package/dist/style/loading.css +5540 -0
- package/dist/style/menu.css +6183 -0
- package/dist/style/message.css +194 -0
- package/dist/style/modal.css +5637 -0
- package/dist/style/notification.css +5706 -0
- package/dist/style/pagination.css +6683 -0
- package/dist/style/popconfirm.css +7951 -0
- package/dist/style/popover.css +5727 -0
- package/dist/style/progress.css +5714 -0
- package/dist/style/radio.css +5769 -0
- package/dist/style/rate.css +5616 -0
- package/dist/style/row.css +8121 -0
- package/dist/style/select.css +5729 -0
- package/dist/style/slider.css +5594 -0
- package/dist/style/slottable.css +5831 -0
- package/dist/style/steps.css +6100 -0
- package/dist/style/switch.css +5624 -0
- package/dist/style/table.css +8392 -0
- package/dist/style/tabs.css +6047 -0
- package/dist/style/tag.css +5935 -0
- package/dist/style/text.css +5636 -0
- package/dist/style/timeline.css +5602 -0
- package/dist/style/timepicker.css +5904 -0
- package/dist/style/tooltip.css +5686 -0
- package/dist/style/transfer.css +101 -0
- package/dist/style/transition.css +1417 -0
- package/dist/style/tree.css +5598 -0
- package/dist/style/typography.css +5640 -0
- package/dist/style/upload.css +5834 -0
- package/dist/switch.js +448 -0
- package/dist/table.js +3809 -0
- package/dist/tabs.js +1273 -0
- package/dist/tag.js +478 -0
- package/dist/text.js +1100 -0
- package/dist/timeline.js +495 -0
- package/dist/timepicker.js +1567 -0
- package/dist/tooltip.js +179 -0
- package/dist/transfer.js +981 -0
- package/dist/transition.js +246 -0
- package/dist/tree.js +1866 -0
- package/dist/typography.js +469 -0
- package/dist/upload.js +1990 -0
- package/package.json +144 -0
package/dist/radio.js
ADDED
|
@@ -0,0 +1,760 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("./_util/proptype"), require("./_mixin/emitter"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["./_util/proptype", "./_mixin/emitter"], factory);
|
|
6
|
+
else {
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("./_util/proptype"), require("./_mixin/emitter")) : factory(root["./_util/proptype"], root["./_mixin/emitter"]);
|
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
+
}
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__6__) {
|
|
11
|
+
return /******/ (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 = 95);
|
|
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
|
+
|
|
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
|
+
// 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
|
+
/***/ 1:
|
|
207
|
+
/***/ (function(module, exports) {
|
|
208
|
+
|
|
209
|
+
module.exports = require("babel-runtime/helpers/defineProperty");
|
|
210
|
+
|
|
211
|
+
/***/ }),
|
|
212
|
+
|
|
213
|
+
/***/ 131:
|
|
214
|
+
/***/ (function(module, exports) {
|
|
215
|
+
|
|
216
|
+
// removed by extract-text-webpack-plugin
|
|
217
|
+
|
|
218
|
+
/***/ }),
|
|
219
|
+
|
|
220
|
+
/***/ 197:
|
|
221
|
+
/***/ (function(module, exports) {
|
|
222
|
+
|
|
223
|
+
// removed by extract-text-webpack-plugin
|
|
224
|
+
|
|
225
|
+
/***/ }),
|
|
226
|
+
|
|
227
|
+
/***/ 3:
|
|
228
|
+
/***/ (function(module, exports) {
|
|
229
|
+
|
|
230
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
|
|
231
|
+
|
|
232
|
+
/***/ }),
|
|
233
|
+
|
|
234
|
+
/***/ 6:
|
|
235
|
+
/***/ (function(module, exports) {
|
|
236
|
+
|
|
237
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__6__;
|
|
238
|
+
|
|
239
|
+
/***/ }),
|
|
240
|
+
|
|
241
|
+
/***/ 8:
|
|
242
|
+
/***/ (function(module, exports) {
|
|
243
|
+
|
|
244
|
+
module.exports = require("babel-runtime/helpers/typeof");
|
|
245
|
+
|
|
246
|
+
/***/ }),
|
|
247
|
+
|
|
248
|
+
/***/ 95:
|
|
249
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
250
|
+
|
|
251
|
+
"use strict";
|
|
252
|
+
// ESM COMPAT FLAG
|
|
253
|
+
__webpack_require__.r(__webpack_exports__);
|
|
254
|
+
|
|
255
|
+
// EXTERNAL MODULE: ./components/style/index.less
|
|
256
|
+
var style = __webpack_require__(131);
|
|
257
|
+
|
|
258
|
+
// EXTERNAL MODULE: ./components/radio/style/index.less
|
|
259
|
+
var radio_style = __webpack_require__(197);
|
|
260
|
+
|
|
261
|
+
// CONCATENATED MODULE: ./components/radio/style/index.js
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/radio/radio.vue?vue&type=template&id=0cfde37c&
|
|
265
|
+
var radiovue_type_template_id_0cfde37c_render = function () {
|
|
266
|
+
var _vm = this
|
|
267
|
+
var _h = _vm.$createElement
|
|
268
|
+
var _c = _vm._self._c || _h
|
|
269
|
+
return _c("label", { class: _vm.classes, on: { click: _vm.handleClick } }, [
|
|
270
|
+
_c("span", { class: _vm.spanClasses }, [
|
|
271
|
+
_c("input", {
|
|
272
|
+
directives: [
|
|
273
|
+
{
|
|
274
|
+
name: "model",
|
|
275
|
+
rawName: "v-model",
|
|
276
|
+
value: _vm.model,
|
|
277
|
+
expression: "model",
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
class: this.prefixCls + "-input",
|
|
281
|
+
attrs: { type: "radio", name: _vm.name },
|
|
282
|
+
domProps: { value: _vm.value, checked: _vm._q(_vm.model, _vm.value) },
|
|
283
|
+
on: {
|
|
284
|
+
change: function ($event) {
|
|
285
|
+
_vm.model = _vm.value
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
}),
|
|
289
|
+
_c("span", { class: this.prefixCls + "-inner" }),
|
|
290
|
+
]),
|
|
291
|
+
_c("span", [_vm._t("default")], 2),
|
|
292
|
+
])
|
|
293
|
+
}
|
|
294
|
+
var staticRenderFns = []
|
|
295
|
+
radiovue_type_template_id_0cfde37c_render._withStripped = true
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
// CONCATENATED MODULE: ./components/radio/radio.vue?vue&type=template&id=0cfde37c&
|
|
299
|
+
|
|
300
|
+
// EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
|
|
301
|
+
var defineProperty_ = __webpack_require__(1);
|
|
302
|
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
303
|
+
|
|
304
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/radio/radio.vue?vue&type=script&lang=js&
|
|
305
|
+
|
|
306
|
+
//
|
|
307
|
+
//
|
|
308
|
+
//
|
|
309
|
+
//
|
|
310
|
+
//
|
|
311
|
+
//
|
|
312
|
+
//
|
|
313
|
+
//
|
|
314
|
+
//
|
|
315
|
+
//
|
|
316
|
+
//
|
|
317
|
+
//
|
|
318
|
+
//
|
|
319
|
+
//
|
|
320
|
+
//
|
|
321
|
+
//
|
|
322
|
+
//
|
|
323
|
+
//
|
|
324
|
+
|
|
325
|
+
/* harmony default export */ var radiovue_type_script_lang_js_ = ({
|
|
326
|
+
name: 'MdsRadio',
|
|
327
|
+
props: {
|
|
328
|
+
checked: {
|
|
329
|
+
type: Boolean,
|
|
330
|
+
default: false
|
|
331
|
+
},
|
|
332
|
+
disabled: {
|
|
333
|
+
type: Boolean,
|
|
334
|
+
default: false
|
|
335
|
+
},
|
|
336
|
+
name: {
|
|
337
|
+
type: String,
|
|
338
|
+
default: ''
|
|
339
|
+
},
|
|
340
|
+
prefixCls: {
|
|
341
|
+
type: String,
|
|
342
|
+
default: 'mds-radio'
|
|
343
|
+
},
|
|
344
|
+
modelValue: null,
|
|
345
|
+
value: null,
|
|
346
|
+
check: null
|
|
347
|
+
},
|
|
348
|
+
model: {
|
|
349
|
+
prop: 'modelValue',
|
|
350
|
+
event: 'input'
|
|
351
|
+
},
|
|
352
|
+
data: function data() {
|
|
353
|
+
return {
|
|
354
|
+
checkedValue: this.checked,
|
|
355
|
+
_radioGroup: null,
|
|
356
|
+
parent: null
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
|
|
360
|
+
computed: {
|
|
361
|
+
classes: function classes() {
|
|
362
|
+
var _ref;
|
|
363
|
+
|
|
364
|
+
return [this.prefixCls + '-wrapper', (_ref = {}, defineProperty_default()(_ref, this.prefixCls + '-wrapper-checked', this.checkedValue), defineProperty_default()(_ref, this.prefixCls + '-wrapper-disabled', this.isDisabled), _ref)];
|
|
365
|
+
},
|
|
366
|
+
spanClasses: function spanClasses() {
|
|
367
|
+
var _ref2;
|
|
368
|
+
|
|
369
|
+
return [this.prefixCls, (_ref2 = {}, defineProperty_default()(_ref2, this.prefixCls + '-checked', this.checkedValue), defineProperty_default()(_ref2, this.prefixCls + '-disabled', this.isDisabled), _ref2)];
|
|
370
|
+
},
|
|
371
|
+
isDisabled: function isDisabled() {
|
|
372
|
+
return this.isRadioGroup ? this._radioGroup.disabled || this.disabled : this.disabled;
|
|
373
|
+
},
|
|
374
|
+
isRadioGroup: function isRadioGroup() {
|
|
375
|
+
this.parent = this.$parent;
|
|
376
|
+
while (this.parent) {
|
|
377
|
+
if (this.parent.$options.name !== 'MdsRadioGroup') {
|
|
378
|
+
this.parent = this.parent.$parent;
|
|
379
|
+
} else {
|
|
380
|
+
this._radioGroup = this.parent;
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return false;
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
model: {
|
|
388
|
+
get: function get() {
|
|
389
|
+
this.checkedValue = this.modelValue === this.value;
|
|
390
|
+
return this.modelValue;
|
|
391
|
+
},
|
|
392
|
+
set: function set(val) {}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
methods: {
|
|
396
|
+
handleClick: function handleClick() {
|
|
397
|
+
var _this = this;
|
|
398
|
+
|
|
399
|
+
if (this.checkedValue === true) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
if (!this.isDisabled) {
|
|
403
|
+
this.checkedValue = true;
|
|
404
|
+
}
|
|
405
|
+
if (this.isRadioGroup && this.isDisabled !== true) {
|
|
406
|
+
this.parent.change(this.value);
|
|
407
|
+
} else if (!this.isRadioGroup && this.isDisabled !== true) {
|
|
408
|
+
this.$emit('input', this.value);
|
|
409
|
+
this.$nextTick(function () {
|
|
410
|
+
_this.$emit('change', _this.model);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
checkChange: function checkChange(value) {
|
|
415
|
+
this.checkedValue = value;
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
watch: {
|
|
419
|
+
check: function check() {
|
|
420
|
+
this.checkedValue = this.checked === this.value;
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
value: {
|
|
424
|
+
handler: function handler(val) {
|
|
425
|
+
this.checkedValue = this.checked === this.value;
|
|
426
|
+
if (this.isRadioGroup) {
|
|
427
|
+
this.parent.checkModel(this.value);
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
immediate: true
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
// CONCATENATED MODULE: ./components/radio/radio.vue?vue&type=script&lang=js&
|
|
436
|
+
/* harmony default export */ var radio_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
|
|
437
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
438
|
+
var componentNormalizer = __webpack_require__(0);
|
|
439
|
+
|
|
440
|
+
// CONCATENATED MODULE: ./components/radio/radio.vue
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
/* normalize component */
|
|
447
|
+
|
|
448
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
449
|
+
radio_radiovue_type_script_lang_js_,
|
|
450
|
+
radiovue_type_template_id_0cfde37c_render,
|
|
451
|
+
staticRenderFns,
|
|
452
|
+
false,
|
|
453
|
+
null,
|
|
454
|
+
null,
|
|
455
|
+
null
|
|
456
|
+
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
/* hot reload */
|
|
460
|
+
if (false) { var api; }
|
|
461
|
+
component.options.__file = "components/radio/radio.vue"
|
|
462
|
+
/* harmony default export */ var radio_radio = (component.exports);
|
|
463
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/radio/group.vue?vue&type=template&id=23243800&
|
|
464
|
+
var groupvue_type_template_id_23243800_render = function () {
|
|
465
|
+
var _vm = this
|
|
466
|
+
var _h = _vm.$createElement
|
|
467
|
+
var _c = _vm._self._c || _h
|
|
468
|
+
return _c(
|
|
469
|
+
"div",
|
|
470
|
+
{ class: _vm.classes },
|
|
471
|
+
[
|
|
472
|
+
_vm.isOptions
|
|
473
|
+
? _c(
|
|
474
|
+
"div",
|
|
475
|
+
_vm._l(_vm.options, function (option, index) {
|
|
476
|
+
return _c(
|
|
477
|
+
"span",
|
|
478
|
+
{ key: index },
|
|
479
|
+
[
|
|
480
|
+
_c(
|
|
481
|
+
"radio",
|
|
482
|
+
{
|
|
483
|
+
attrs: {
|
|
484
|
+
value: _vm.calculateValue(option),
|
|
485
|
+
disabled: _vm.calculateDisabled(option),
|
|
486
|
+
name: _vm.name,
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
[_vm._v(_vm._s(_vm.calculateLabel(option)))]
|
|
490
|
+
),
|
|
491
|
+
],
|
|
492
|
+
1
|
|
493
|
+
)
|
|
494
|
+
}),
|
|
495
|
+
0
|
|
496
|
+
)
|
|
497
|
+
: _vm._e(),
|
|
498
|
+
!_vm.isOptions ? _vm._t("default") : _vm._e(),
|
|
499
|
+
],
|
|
500
|
+
2
|
|
501
|
+
)
|
|
502
|
+
}
|
|
503
|
+
var groupvue_type_template_id_23243800_staticRenderFns = []
|
|
504
|
+
groupvue_type_template_id_23243800_render._withStripped = true
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
// CONCATENATED MODULE: ./components/radio/group.vue?vue&type=template&id=23243800&
|
|
508
|
+
|
|
509
|
+
// EXTERNAL MODULE: external "babel-runtime/helpers/typeof"
|
|
510
|
+
var typeof_ = __webpack_require__(8);
|
|
511
|
+
var typeof_default = /*#__PURE__*/__webpack_require__.n(typeof_);
|
|
512
|
+
|
|
513
|
+
// EXTERNAL MODULE: external "./_util/proptype"
|
|
514
|
+
var proptype_ = __webpack_require__(3);
|
|
515
|
+
|
|
516
|
+
// EXTERNAL MODULE: external "./_mixin/emitter"
|
|
517
|
+
var emitter_ = __webpack_require__(6);
|
|
518
|
+
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
519
|
+
|
|
520
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/radio/group.vue?vue&type=script&lang=js&
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
//
|
|
524
|
+
//
|
|
525
|
+
//
|
|
526
|
+
//
|
|
527
|
+
//
|
|
528
|
+
//
|
|
529
|
+
//
|
|
530
|
+
//
|
|
531
|
+
//
|
|
532
|
+
//
|
|
533
|
+
//
|
|
534
|
+
//
|
|
535
|
+
//
|
|
536
|
+
//
|
|
537
|
+
//
|
|
538
|
+
//
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
/* harmony default export */ var groupvue_type_script_lang_js_ = ({
|
|
545
|
+
name: 'MdsRadioGroup',
|
|
546
|
+
mixins: [emitter_default.a],
|
|
547
|
+
props: {
|
|
548
|
+
disabled: {
|
|
549
|
+
type: Boolean,
|
|
550
|
+
default: undefined
|
|
551
|
+
},
|
|
552
|
+
name: {
|
|
553
|
+
type: String,
|
|
554
|
+
default: ''
|
|
555
|
+
},
|
|
556
|
+
options: {
|
|
557
|
+
type: Array,
|
|
558
|
+
default: function _default() {
|
|
559
|
+
return [];
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
prefixCls: {
|
|
563
|
+
type: String,
|
|
564
|
+
default: 'mds-radio'
|
|
565
|
+
},
|
|
566
|
+
size: {
|
|
567
|
+
type: String,
|
|
568
|
+
default: 'default',
|
|
569
|
+
validator: function validator(value) {
|
|
570
|
+
return Object(proptype_["oneOf"])(value, ['large', 'default', 'small']);
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
value: null
|
|
574
|
+
},
|
|
575
|
+
data: function data() {
|
|
576
|
+
return {
|
|
577
|
+
currentValue: this.value,
|
|
578
|
+
valueList: [],
|
|
579
|
+
radioList: []
|
|
580
|
+
};
|
|
581
|
+
},
|
|
582
|
+
|
|
583
|
+
computed: {
|
|
584
|
+
classes: function classes() {
|
|
585
|
+
return [this.prefixCls + '-group', defineProperty_default()({}, this.prefixCls + '-group-' + this.size, this.size)];
|
|
586
|
+
},
|
|
587
|
+
isOptions: function isOptions() {
|
|
588
|
+
return this.options.length !== 0;
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
methods: {
|
|
592
|
+
checkModel: function checkModel(val) {
|
|
593
|
+
var _this = this;
|
|
594
|
+
|
|
595
|
+
this.initValueList();
|
|
596
|
+
if (val === this.value) {
|
|
597
|
+
this.$nextTick(function () {
|
|
598
|
+
_this.change(val);
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
change: function change(val) {
|
|
603
|
+
// 在子组件调用,点击子组件,当其父组件为groupRadio时,会出发此事件
|
|
604
|
+
this.currentValue = val;
|
|
605
|
+
this.judge();
|
|
606
|
+
this.$emit('input', val);
|
|
607
|
+
this.$emit('change', this.currentValue);
|
|
608
|
+
this.dispatch('MdsFormItem', 'formItemChange', val);
|
|
609
|
+
},
|
|
610
|
+
initValueList: function initValueList() {
|
|
611
|
+
// 获取子组件的values列表
|
|
612
|
+
this.radioList = this.$children.filter(function (item) {
|
|
613
|
+
return item.$options.name === 'MdsRadio';
|
|
614
|
+
});
|
|
615
|
+
this.valueList = this.radioList.map(function (item) {
|
|
616
|
+
return item.value;
|
|
617
|
+
});
|
|
618
|
+
this.disableChildren();
|
|
619
|
+
this.judge();
|
|
620
|
+
},
|
|
621
|
+
judge: function judge() {
|
|
622
|
+
var _this2 = this;
|
|
623
|
+
|
|
624
|
+
// 判断点击的是哪一个子组件并为其设置选中状态
|
|
625
|
+
this.valueList.forEach(function (item, index) {
|
|
626
|
+
if (item === _this2.currentValue) {
|
|
627
|
+
_this2.radioList[index].checkChange(true);
|
|
628
|
+
} else {
|
|
629
|
+
_this2.radioList[index].checkChange(false);
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
},
|
|
633
|
+
calculateValue: function calculateValue(option) {
|
|
634
|
+
var type = option ? typeof option === 'undefined' ? 'undefined' : typeof_default()(option) : '';
|
|
635
|
+
if (type === 'object') {
|
|
636
|
+
return option.value;
|
|
637
|
+
} else {
|
|
638
|
+
return option;
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
calculateLabel: function calculateLabel(option) {
|
|
642
|
+
var type = option ? typeof option === 'undefined' ? 'undefined' : typeof_default()(option) : '';
|
|
643
|
+
if (type === 'object') {
|
|
644
|
+
return option.label;
|
|
645
|
+
} else {
|
|
646
|
+
return option;
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
calculateDisabled: function calculateDisabled(option) {
|
|
650
|
+
if (typeof option.disabled === 'undefined') {
|
|
651
|
+
return false;
|
|
652
|
+
} else {
|
|
653
|
+
return option.disabled;
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
disableChildren: function disableChildren() {
|
|
657
|
+
if (this.disabled === undefined) {
|
|
658
|
+
return '';
|
|
659
|
+
}
|
|
660
|
+
// 如果处于禁用状态,为子slot设上disable
|
|
661
|
+
if (this.disabled) {
|
|
662
|
+
this.radioList.forEach(function (item) {
|
|
663
|
+
item.$data.disabledValue = true;
|
|
664
|
+
});
|
|
665
|
+
} else {
|
|
666
|
+
this.radioList.forEach(function (item) {
|
|
667
|
+
item.$data.disabledValue = false;
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
watch: {
|
|
673
|
+
value: function value(val) {
|
|
674
|
+
this.currentValue = val;
|
|
675
|
+
this.judge();
|
|
676
|
+
// this.$emit('change', this.currentValue)
|
|
677
|
+
},
|
|
678
|
+
disabled: function disabled() {
|
|
679
|
+
this.disableChildren();
|
|
680
|
+
},
|
|
681
|
+
options: function options() {
|
|
682
|
+
var _this3 = this;
|
|
683
|
+
|
|
684
|
+
this.$nextTick(function () {
|
|
685
|
+
_this3.initValueList();
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
mounted: function mounted() {
|
|
690
|
+
this.initValueList();
|
|
691
|
+
},
|
|
692
|
+
beforeUpdate: function beforeUpdate() {
|
|
693
|
+
this.initValueList();
|
|
694
|
+
},
|
|
695
|
+
|
|
696
|
+
components: {
|
|
697
|
+
Radio: radio_radio
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
// CONCATENATED MODULE: ./components/radio/group.vue?vue&type=script&lang=js&
|
|
701
|
+
/* harmony default export */ var radio_groupvue_type_script_lang_js_ = (groupvue_type_script_lang_js_);
|
|
702
|
+
// CONCATENATED MODULE: ./components/radio/group.vue
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
/* normalize component */
|
|
709
|
+
|
|
710
|
+
var group_component = Object(componentNormalizer["a" /* default */])(
|
|
711
|
+
radio_groupvue_type_script_lang_js_,
|
|
712
|
+
groupvue_type_template_id_23243800_render,
|
|
713
|
+
groupvue_type_template_id_23243800_staticRenderFns,
|
|
714
|
+
false,
|
|
715
|
+
null,
|
|
716
|
+
null,
|
|
717
|
+
null
|
|
718
|
+
|
|
719
|
+
)
|
|
720
|
+
|
|
721
|
+
/* hot reload */
|
|
722
|
+
if (false) { var group_api; }
|
|
723
|
+
group_component.options.__file = "components/radio/group.vue"
|
|
724
|
+
/* harmony default export */ var group = (group_component.exports);
|
|
725
|
+
// CONCATENATED MODULE: ./components/radio/radio-button.js
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
/* harmony default export */ var radio_button = ({
|
|
729
|
+
name: 'MdsRadioBtn',
|
|
730
|
+
functional: true,
|
|
731
|
+
render: function render(h, ctx) {
|
|
732
|
+
ctx.props.prefixCls = ctx.props.prefixCls || 'mds-radio-button';
|
|
733
|
+
return h(radio_radio, ctx, ctx.children);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
// CONCATENATED MODULE: ./components/radio/index.js
|
|
737
|
+
/**
|
|
738
|
+
* Created by echaoo on 17/10/5.
|
|
739
|
+
*/
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
radio_radio.Group = group;
|
|
747
|
+
radio_radio.Button = radio_button;
|
|
748
|
+
|
|
749
|
+
/* istanbul ignore next */
|
|
750
|
+
radio_radio.install = function (Vue) {
|
|
751
|
+
Vue.component(radio_radio.name, radio_radio);
|
|
752
|
+
Vue.component(group.name, group);
|
|
753
|
+
Vue.component(radio_button.name, radio_button);
|
|
754
|
+
};
|
|
755
|
+
/* harmony default export */ var components_radio = __webpack_exports__["default"] = (radio_radio);
|
|
756
|
+
|
|
757
|
+
/***/ })
|
|
758
|
+
|
|
759
|
+
/******/ });
|
|
760
|
+
});
|