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 = 126);
|
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 | 1:
|
180 | (function(module, exports) {
|
181 |
|
182 | module.exports = require("element-ui/lib/mixins/emitter");
|
183 |
|
184 | }),
|
185 |
|
186 | 126:
|
187 | (function(module, exports, __webpack_require__) {
|
188 |
|
189 | "use strict";
|
190 |
|
191 |
|
192 | exports.__esModule = true;
|
193 |
|
194 | var _checkboxButton = __webpack_require__(127);
|
195 |
|
196 | var _checkboxButton2 = _interopRequireDefault(_checkboxButton);
|
197 |
|
198 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
199 |
|
200 |
|
201 | _checkboxButton2.default.install = function (Vue) {
|
202 | Vue.component(_checkboxButton2.default.name, _checkboxButton2.default);
|
203 | };
|
204 |
|
205 | exports.default = _checkboxButton2.default;
|
206 |
|
207 | }),
|
208 |
|
209 | 127:
|
210 | (function(module, __webpack_exports__, __webpack_require__) {
|
211 |
|
212 | "use strict";
|
213 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
214 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_button_vue__ = __webpack_require__(128);
|
215 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_button_vue__);
|
216 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_28a329b4_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_button_vue__ = __webpack_require__(129);
|
217 | var normalizeComponent = __webpack_require__(0)
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | var __vue_template_functional__ = false
|
224 |
|
225 | var __vue_styles__ = null
|
226 |
|
227 | var __vue_scopeId__ = null
|
228 |
|
229 | var __vue_module_identifier__ = null
|
230 | var Component = normalizeComponent(
|
231 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_button_vue___default.a,
|
232 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_28a329b4_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_button_vue__["a" ],
|
233 | __vue_template_functional__,
|
234 | __vue_styles__,
|
235 | __vue_scopeId__,
|
236 | __vue_module_identifier__
|
237 | )
|
238 |
|
239 | __webpack_exports__["default"] = (Component.exports);
|
240 |
|
241 |
|
242 | }),
|
243 |
|
244 | 128:
|
245 | (function(module, exports, __webpack_require__) {
|
246 |
|
247 | "use strict";
|
248 |
|
249 |
|
250 | exports.__esModule = true;
|
251 |
|
252 | var _emitter = __webpack_require__(1);
|
253 |
|
254 | var _emitter2 = _interopRequireDefault(_emitter);
|
255 |
|
256 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
257 |
|
258 | exports.default = {
|
259 | name: 'ElCheckboxButton',
|
260 |
|
261 | mixins: [_emitter2.default],
|
262 |
|
263 | inject: {
|
264 | elForm: {
|
265 | default: ''
|
266 | },
|
267 | elFormItem: {
|
268 | default: ''
|
269 | }
|
270 | },
|
271 |
|
272 | data: function data() {
|
273 | return {
|
274 | selfModel: false,
|
275 | focus: false,
|
276 | isLimitExceeded: false
|
277 | };
|
278 | },
|
279 |
|
280 |
|
281 | props: {
|
282 | value: {},
|
283 | label: {},
|
284 | disabled: Boolean,
|
285 | checked: Boolean,
|
286 | name: String,
|
287 | trueLabel: [String, Number],
|
288 | falseLabel: [String, Number]
|
289 | },
|
290 | computed: {
|
291 | model: {
|
292 | get: function get() {
|
293 | return this._checkboxGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
|
294 | },
|
295 | set: function set(val) {
|
296 | if (this._checkboxGroup) {
|
297 | this.isLimitExceeded = false;
|
298 | this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
|
299 |
|
300 | this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
|
301 |
|
302 | this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
|
303 | } else if (this.value !== undefined) {
|
304 | this.$emit('input', val);
|
305 | } else {
|
306 | this.selfModel = val;
|
307 | }
|
308 | }
|
309 | },
|
310 |
|
311 | isChecked: function isChecked() {
|
312 | if ({}.toString.call(this.model) === '[object Boolean]') {
|
313 | return this.model;
|
314 | } else if (Array.isArray(this.model)) {
|
315 | return this.model.indexOf(this.label) > -1;
|
316 | } else if (this.model !== null && this.model !== undefined) {
|
317 | return this.model === this.trueLabel;
|
318 | }
|
319 | },
|
320 | _checkboxGroup: function _checkboxGroup() {
|
321 | var parent = this.$parent;
|
322 | while (parent) {
|
323 | if (parent.$options.componentName !== 'ElCheckboxGroup') {
|
324 | parent = parent.$parent;
|
325 | } else {
|
326 | return parent;
|
327 | }
|
328 | }
|
329 | return false;
|
330 | },
|
331 | store: function store() {
|
332 | return this._checkboxGroup ? this._checkboxGroup.value : this.value;
|
333 | },
|
334 | activeStyle: function activeStyle() {
|
335 | return {
|
336 | backgroundColor: this._checkboxGroup.fill || '',
|
337 | borderColor: this._checkboxGroup.fill || '',
|
338 | color: this._checkboxGroup.textColor || '',
|
339 | 'box-shadow': '-1px 0 0 0 ' + this._checkboxGroup.fill
|
340 |
|
341 | };
|
342 | },
|
343 | _elFormItemSize: function _elFormItemSize() {
|
344 | return (this.elFormItem || {}).elFormItemSize;
|
345 | },
|
346 | size: function size() {
|
347 | return this._checkboxGroup.checkboxGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
348 | },
|
349 | isDisabled: function isDisabled() {
|
350 | return this._checkboxGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
|
351 | }
|
352 | },
|
353 | methods: {
|
354 | addToStore: function addToStore() {
|
355 | if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
|
356 | this.model.push(this.label);
|
357 | } else {
|
358 | this.model = this.trueLabel || true;
|
359 | }
|
360 | },
|
361 | handleChange: function handleChange(ev) {
|
362 | var _this = this;
|
363 |
|
364 | if (this.isLimitExceeded) return;
|
365 | var value = void 0;
|
366 | if (ev.target.checked) {
|
367 | value = this.trueLabel === undefined ? true : this.trueLabel;
|
368 | } else {
|
369 | value = this.falseLabel === undefined ? false : this.falseLabel;
|
370 | }
|
371 | this.$emit('change', value, ev);
|
372 | this.$nextTick(function () {
|
373 | if (_this._checkboxGroup) {
|
374 | _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
|
375 | }
|
376 | });
|
377 | }
|
378 | },
|
379 |
|
380 | created: function created() {
|
381 | this.checked && this.addToStore();
|
382 | }
|
383 | };
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 | }),
|
430 |
|
431 | 129:
|
432 | (function(module, __webpack_exports__, __webpack_require__) {
|
433 |
|
434 | "use strict";
|
435 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{staticClass:"el-checkbox-button",class:[
|
436 | _vm.size ? 'el-checkbox-button--' + _vm.size : '',
|
437 | { 'is-disabled': _vm.isDisabled },
|
438 | { 'is-checked': _vm.isChecked },
|
439 | { 'is-focus': _vm.focus } ],attrs:{"role":"checkbox","aria-checked":_vm.isChecked,"aria-disabled":_vm.isDisabled}},[(_vm.trueLabel || _vm.falseLabel)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.model),expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{"type":"checkbox","name":_vm.name,"disabled":_vm.isDisabled,"true-value":_vm.trueLabel,"false-value":_vm.falseLabel},domProps:{"checked":Array.isArray(_vm.model)?_vm._i(_vm.model,null)>-1:_vm._q(_vm.model,_vm.trueLabel)},on:{"change":[function($event){var $$a=_vm.model,$$el=$event.target,$$c=$$el.checked?(_vm.trueLabel):(_vm.falseLabel);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.model=$$a.concat([$$v]))}else{$$i>-1&&(_vm.model=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.model=$$c}},_vm.handleChange],"focus":function($event){_vm.focus = true},"blur":function($event){_vm.focus = false}}}):_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.model),expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{"type":"checkbox","name":_vm.name,"disabled":_vm.isDisabled},domProps:{"value":_vm.label,"checked":Array.isArray(_vm.model)?_vm._i(_vm.model,_vm.label)>-1:(_vm.model)},on:{"change":[function($event){var $$a=_vm.model,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=_vm.label,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.model=$$a.concat([$$v]))}else{$$i>-1&&(_vm.model=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.model=$$c}},_vm.handleChange],"focus":function($event){_vm.focus = true},"blur":function($event){_vm.focus = false}}}),(_vm.$slots.default || _vm.label)?_c('span',{staticClass:"el-checkbox-button__inner",style:(_vm.isChecked ? _vm.activeStyle : null)},[_vm._t("default",[_vm._v(_vm._s(_vm.label))])],2):_vm._e()])}
|
440 | var staticRenderFns = []
|
441 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
442 | __webpack_exports__["a"] = (esExports);
|
443 |
|
444 | })
|
445 |
|
446 | }); |
\ | No newline at end of file |