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, { enumerable: true, get: getter });
|
41 | }
|
42 | };
|
43 |
|
44 |
|
45 | __webpack_require__.r = function(exports) {
|
46 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
48 | }
|
49 | Object.defineProperty(exports, '__esModule', { value: true });
|
50 | };
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | __webpack_require__.t = function(value, mode) {
|
58 | if(mode & 1) value = __webpack_require__(value);
|
59 | if(mode & 8) return value;
|
60 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
61 | var ns = Object.create(null);
|
62 | __webpack_require__.r(ns);
|
63 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
64 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
65 | return ns;
|
66 | };
|
67 |
|
68 |
|
69 | __webpack_require__.n = function(module) {
|
70 | var getter = module && module.__esModule ?
|
71 | function getDefault() { return module['default']; } :
|
72 | function getModuleExports() { return module; };
|
73 | __webpack_require__.d(getter, 'a', getter);
|
74 | return getter;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
|
80 |
|
81 | __webpack_require__.p = "/dist/";
|
82 |
|
83 |
|
84 |
|
85 | return __webpack_require__(__webpack_require__.s = 63);
|
86 | })
|
87 |
|
88 | ({
|
89 |
|
90 | 0:
|
91 | (function(module, __webpack_exports__, __webpack_require__) {
|
92 |
|
93 | "use strict";
|
94 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | function normalizeComponent (
|
102 | scriptExports,
|
103 | render,
|
104 | staticRenderFns,
|
105 | functionalTemplate,
|
106 | injectStyles,
|
107 | scopeId,
|
108 | moduleIdentifier, /* server only */
|
109 | shadowMode /* vue-cli only */
|
110 | ) {
|
111 |
|
112 | var options = typeof scriptExports === 'function'
|
113 | ? scriptExports.options
|
114 | : scriptExports
|
115 |
|
116 |
|
117 | if (render) {
|
118 | options.render = render
|
119 | options.staticRenderFns = staticRenderFns
|
120 | options._compiled = true
|
121 | }
|
122 |
|
123 |
|
124 | if (functionalTemplate) {
|
125 | options.functional = true
|
126 | }
|
127 |
|
128 |
|
129 | if (scopeId) {
|
130 | options._scopeId = 'data-v-' + scopeId
|
131 | }
|
132 |
|
133 | var hook
|
134 | if (moduleIdentifier) {
|
135 | hook = function (context) {
|
136 |
|
137 | context =
|
138 | context ||
|
139 | (this.$vnode && this.$vnode.ssrContext) ||
|
140 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
141 |
|
142 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
143 | context = __VUE_SSR_CONTEXT__
|
144 | }
|
145 |
|
146 | if (injectStyles) {
|
147 | injectStyles.call(this, context)
|
148 | }
|
149 |
|
150 | if (context && context._registeredComponents) {
|
151 | context._registeredComponents.add(moduleIdentifier)
|
152 | }
|
153 | }
|
154 |
|
155 |
|
156 | options._ssrRegister = hook
|
157 | } else if (injectStyles) {
|
158 | hook = shadowMode
|
159 | ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
160 | : injectStyles
|
161 | }
|
162 |
|
163 | if (hook) {
|
164 | if (options.functional) {
|
165 |
|
166 |
|
167 | options._injectStyles = hook
|
168 |
|
169 | var originalRender = options.render
|
170 | options.render = function renderWithStyleInjection (h, context) {
|
171 | hook.call(context)
|
172 | return originalRender(h, context)
|
173 | }
|
174 | } else {
|
175 |
|
176 | var existing = options.beforeCreate
|
177 | options.beforeCreate = existing
|
178 | ? [].concat(existing, hook)
|
179 | : [hook]
|
180 | }
|
181 | }
|
182 |
|
183 | return {
|
184 | exports: scriptExports,
|
185 | options: options
|
186 | }
|
187 | }
|
188 |
|
189 |
|
190 | }),
|
191 |
|
192 | 10:
|
193 | (function(module, exports) {
|
194 |
|
195 | module.exports = require("element-ui/lib/input");
|
196 |
|
197 | }),
|
198 |
|
199 | 11:
|
200 | (function(module, exports) {
|
201 |
|
202 | module.exports = require("element-ui/lib/mixins/migrating");
|
203 |
|
204 | }),
|
205 |
|
206 | 13:
|
207 | (function(module, exports) {
|
208 |
|
209 | module.exports = require("element-ui/lib/button");
|
210 |
|
211 | }),
|
212 |
|
213 | 18:
|
214 | (function(module, exports) {
|
215 |
|
216 | module.exports = require("element-ui/lib/checkbox");
|
217 |
|
218 | }),
|
219 |
|
220 | 39:
|
221 | (function(module, exports) {
|
222 |
|
223 | module.exports = require("element-ui/lib/checkbox-group");
|
224 |
|
225 | }),
|
226 |
|
227 | 4:
|
228 | (function(module, exports) {
|
229 |
|
230 | module.exports = require("element-ui/lib/mixins/emitter");
|
231 |
|
232 | }),
|
233 |
|
234 | 6:
|
235 | (function(module, exports) {
|
236 |
|
237 | module.exports = require("element-ui/lib/mixins/locale");
|
238 |
|
239 | }),
|
240 |
|
241 | 63:
|
242 | (function(module, __webpack_exports__, __webpack_require__) {
|
243 |
|
244 | "use strict";
|
245 | __webpack_require__.r(__webpack_exports__);
|
246 |
|
247 |
|
248 | var render = function() {
|
249 | var _vm = this
|
250 | var _h = _vm.$createElement
|
251 | var _c = _vm._self._c || _h
|
252 | return _c(
|
253 | "div",
|
254 | { staticClass: "el-transfer" },
|
255 | [
|
256 | _c(
|
257 | "transfer-panel",
|
258 | _vm._b(
|
259 | {
|
260 | ref: "leftPanel",
|
261 | attrs: {
|
262 | data: _vm.sourceData,
|
263 | title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
|
264 | "default-checked": _vm.leftDefaultChecked,
|
265 | placeholder:
|
266 | _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
|
267 | },
|
268 | on: { "checked-change": _vm.onSourceCheckedChange }
|
269 | },
|
270 | "transfer-panel",
|
271 | _vm.$props,
|
272 | false
|
273 | ),
|
274 | [_vm._t("left-footer")],
|
275 | 2
|
276 | ),
|
277 | _c(
|
278 | "div",
|
279 | { staticClass: "el-transfer__buttons" },
|
280 | [
|
281 | _c(
|
282 | "el-button",
|
283 | {
|
284 | class: [
|
285 | "el-transfer__button",
|
286 | _vm.hasButtonTexts ? "is-with-texts" : ""
|
287 | ],
|
288 | attrs: {
|
289 | type: "primary",
|
290 | disabled: _vm.rightChecked.length === 0
|
291 | },
|
292 | nativeOn: {
|
293 | click: function($event) {
|
294 | return _vm.addToLeft($event)
|
295 | }
|
296 | }
|
297 | },
|
298 | [
|
299 | _c("i", { staticClass: "el-icon-arrow-left" }),
|
300 | _vm.buttonTexts[0] !== undefined
|
301 | ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
|
302 | : _vm._e()
|
303 | ]
|
304 | ),
|
305 | _c(
|
306 | "el-button",
|
307 | {
|
308 | class: [
|
309 | "el-transfer__button",
|
310 | _vm.hasButtonTexts ? "is-with-texts" : ""
|
311 | ],
|
312 | attrs: {
|
313 | type: "primary",
|
314 | disabled: _vm.leftChecked.length === 0
|
315 | },
|
316 | nativeOn: {
|
317 | click: function($event) {
|
318 | return _vm.addToRight($event)
|
319 | }
|
320 | }
|
321 | },
|
322 | [
|
323 | _vm.buttonTexts[1] !== undefined
|
324 | ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
|
325 | : _vm._e(),
|
326 | _c("i", { staticClass: "el-icon-arrow-right" })
|
327 | ]
|
328 | )
|
329 | ],
|
330 | 1
|
331 | ),
|
332 | _c(
|
333 | "transfer-panel",
|
334 | _vm._b(
|
335 | {
|
336 | ref: "rightPanel",
|
337 | attrs: {
|
338 | data: _vm.targetData,
|
339 | title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
|
340 | "default-checked": _vm.rightDefaultChecked,
|
341 | placeholder:
|
342 | _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
|
343 | },
|
344 | on: { "checked-change": _vm.onTargetCheckedChange }
|
345 | },
|
346 | "transfer-panel",
|
347 | _vm.$props,
|
348 | false
|
349 | ),
|
350 | [_vm._t("right-footer")],
|
351 | 2
|
352 | )
|
353 | ],
|
354 | 1
|
355 | )
|
356 | }
|
357 | var staticRenderFns = []
|
358 | render._withStripped = true
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 | var button_ = __webpack_require__(13);
|
365 | var button_default = __webpack_require__.n(button_);
|
366 |
|
367 |
|
368 | var emitter_ = __webpack_require__(4);
|
369 | var emitter_default = __webpack_require__.n(emitter_);
|
370 |
|
371 |
|
372 | var locale_ = __webpack_require__(6);
|
373 | var locale_default = __webpack_require__.n(locale_);
|
374 |
|
375 |
|
376 | var transfer_panelvue_type_template_id_2ddab8bd_render = function() {
|
377 | var _vm = this
|
378 | var _h = _vm.$createElement
|
379 | var _c = _vm._self._c || _h
|
380 | return _c("div", { staticClass: "el-transfer-panel" }, [
|
381 | _c(
|
382 | "p",
|
383 | { staticClass: "el-transfer-panel__header" },
|
384 | [
|
385 | _c(
|
386 | "el-checkbox",
|
387 | {
|
388 | attrs: { indeterminate: _vm.isIndeterminate },
|
389 | on: { change: _vm.handleAllCheckedChange },
|
390 | model: {
|
391 | value: _vm.allChecked,
|
392 | callback: function($$v) {
|
393 | _vm.allChecked = $$v
|
394 | },
|
395 | expression: "allChecked"
|
396 | }
|
397 | },
|
398 | [
|
399 | _vm._v("\n " + _vm._s(_vm.title) + "\n "),
|
400 | _c("span", [_vm._v(_vm._s(_vm.checkedSummary))])
|
401 | ]
|
402 | )
|
403 | ],
|
404 | 1
|
405 | ),
|
406 | _c(
|
407 | "div",
|
408 | {
|
409 | class: [
|
410 | "el-transfer-panel__body",
|
411 | _vm.hasFooter ? "is-with-footer" : ""
|
412 | ]
|
413 | },
|
414 | [
|
415 | _vm.filterable
|
416 | ? _c(
|
417 | "el-input",
|
418 | {
|
419 | staticClass: "el-transfer-panel__filter",
|
420 | attrs: { size: "small", placeholder: _vm.placeholder },
|
421 | nativeOn: {
|
422 | mouseenter: function($event) {
|
423 | _vm.inputHover = true
|
424 | },
|
425 | mouseleave: function($event) {
|
426 | _vm.inputHover = false
|
427 | }
|
428 | },
|
429 | model: {
|
430 | value: _vm.query,
|
431 | callback: function($$v) {
|
432 | _vm.query = $$v
|
433 | },
|
434 | expression: "query"
|
435 | }
|
436 | },
|
437 | [
|
438 | _c("i", {
|
439 | class: ["el-input__icon", "el-icon-" + _vm.inputIcon],
|
440 | attrs: { slot: "prefix" },
|
441 | on: { click: _vm.clearQuery },
|
442 | slot: "prefix"
|
443 | })
|
444 | ]
|
445 | )
|
446 | : _vm._e(),
|
447 | _c(
|
448 | "el-checkbox-group",
|
449 | {
|
450 | directives: [
|
451 | {
|
452 | name: "show",
|
453 | rawName: "v-show",
|
454 | value: !_vm.hasNoMatch && _vm.data.length > 0,
|
455 | expression: "!hasNoMatch && data.length > 0"
|
456 | }
|
457 | ],
|
458 | staticClass: "el-transfer-panel__list",
|
459 | class: { "is-filterable": _vm.filterable },
|
460 | model: {
|
461 | value: _vm.checked,
|
462 | callback: function($$v) {
|
463 | _vm.checked = $$v
|
464 | },
|
465 | expression: "checked"
|
466 | }
|
467 | },
|
468 | _vm._l(_vm.filteredData, function(item) {
|
469 | return _c(
|
470 | "el-checkbox",
|
471 | {
|
472 | key: item[_vm.keyProp],
|
473 | staticClass: "el-transfer-panel__item",
|
474 | attrs: {
|
475 | label: item[_vm.keyProp],
|
476 | disabled: item[_vm.disabledProp]
|
477 | }
|
478 | },
|
479 | [_c("option-content", { attrs: { option: item } })],
|
480 | 1
|
481 | )
|
482 | }),
|
483 | 1
|
484 | ),
|
485 | _c(
|
486 | "p",
|
487 | {
|
488 | directives: [
|
489 | {
|
490 | name: "show",
|
491 | rawName: "v-show",
|
492 | value: _vm.hasNoMatch,
|
493 | expression: "hasNoMatch"
|
494 | }
|
495 | ],
|
496 | staticClass: "el-transfer-panel__empty"
|
497 | },
|
498 | [_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
|
499 | ),
|
500 | _c(
|
501 | "p",
|
502 | {
|
503 | directives: [
|
504 | {
|
505 | name: "show",
|
506 | rawName: "v-show",
|
507 | value: _vm.data.length === 0 && !_vm.hasNoMatch,
|
508 | expression: "data.length === 0 && !hasNoMatch"
|
509 | }
|
510 | ],
|
511 | staticClass: "el-transfer-panel__empty"
|
512 | },
|
513 | [_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
|
514 | )
|
515 | ],
|
516 | 1
|
517 | ),
|
518 | _vm.hasFooter
|
519 | ? _c(
|
520 | "p",
|
521 | { staticClass: "el-transfer-panel__footer" },
|
522 | [_vm._t("default")],
|
523 | 2
|
524 | )
|
525 | : _vm._e()
|
526 | ])
|
527 | }
|
528 | var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
|
529 | transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 | var checkbox_group_ = __webpack_require__(39);
|
536 | var checkbox_group_default = __webpack_require__.n(checkbox_group_);
|
537 |
|
538 |
|
539 | var checkbox_ = __webpack_require__(18);
|
540 | var checkbox_default = __webpack_require__.n(checkbox_);
|
541 |
|
542 |
|
543 | var input_ = __webpack_require__(10);
|
544 | var input_default = __webpack_require__.n(input_);
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 | var transfer_panelvue_type_script_lang_js_ = ({
|
607 | mixins: [locale_default.a],
|
608 |
|
609 | name: 'ElTransferPanel',
|
610 |
|
611 | componentName: 'ElTransferPanel',
|
612 |
|
613 | components: {
|
614 | ElCheckboxGroup: checkbox_group_default.a,
|
615 | ElCheckbox: checkbox_default.a,
|
616 | ElInput: input_default.a,
|
617 | OptionContent: {
|
618 | props: {
|
619 | option: Object
|
620 | },
|
621 | render: function render(h) {
|
622 | var getParent = function getParent(vm) {
|
623 | if (vm.$options.componentName === 'ElTransferPanel') {
|
624 | return vm;
|
625 | } else if (vm.$parent) {
|
626 | return getParent(vm.$parent);
|
627 | } else {
|
628 | return vm;
|
629 | }
|
630 | };
|
631 | var panel = getParent(this);
|
632 | var transfer = panel.$parent || panel;
|
633 | return panel.renderContent ? panel.renderContent(h, this.option) : transfer.$scopedSlots.default ? transfer.$scopedSlots.default({ option: this.option }) : h('span', [this.option[panel.labelProp] || this.option[panel.keyProp]]);
|
634 | }
|
635 | }
|
636 | },
|
637 |
|
638 | props: {
|
639 | data: {
|
640 | type: Array,
|
641 | default: function _default() {
|
642 | return [];
|
643 | }
|
644 | },
|
645 | renderContent: Function,
|
646 | placeholder: String,
|
647 | title: String,
|
648 | filterable: Boolean,
|
649 | format: Object,
|
650 | filterMethod: Function,
|
651 | defaultChecked: Array,
|
652 | props: Object
|
653 | },
|
654 |
|
655 | data: function data() {
|
656 | return {
|
657 | checked: [],
|
658 | allChecked: false,
|
659 | query: '',
|
660 | inputHover: false,
|
661 | checkChangeByUser: true
|
662 | };
|
663 | },
|
664 |
|
665 |
|
666 | watch: {
|
667 | checked: function checked(val, oldVal) {
|
668 | this.updateAllChecked();
|
669 | if (this.checkChangeByUser) {
|
670 | var movedKeys = val.concat(oldVal).filter(function (v) {
|
671 | return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
|
672 | });
|
673 | this.$emit('checked-change', val, movedKeys);
|
674 | } else {
|
675 | this.$emit('checked-change', val);
|
676 | this.checkChangeByUser = true;
|
677 | }
|
678 | },
|
679 | data: function data() {
|
680 | var _this = this;
|
681 |
|
682 | var checked = [];
|
683 | var filteredDataKeys = this.filteredData.map(function (item) {
|
684 | return item[_this.keyProp];
|
685 | });
|
686 | this.checked.forEach(function (item) {
|
687 | if (filteredDataKeys.indexOf(item) > -1) {
|
688 | checked.push(item);
|
689 | }
|
690 | });
|
691 | this.checkChangeByUser = false;
|
692 | this.checked = checked;
|
693 | },
|
694 | checkableData: function checkableData() {
|
695 | this.updateAllChecked();
|
696 | },
|
697 |
|
698 |
|
699 | defaultChecked: {
|
700 | immediate: true,
|
701 | handler: function handler(val, oldVal) {
|
702 | var _this2 = this;
|
703 |
|
704 | if (oldVal && val.length === oldVal.length && val.every(function (item) {
|
705 | return oldVal.indexOf(item) > -1;
|
706 | })) return;
|
707 | var checked = [];
|
708 | var checkableDataKeys = this.checkableData.map(function (item) {
|
709 | return item[_this2.keyProp];
|
710 | });
|
711 | val.forEach(function (item) {
|
712 | if (checkableDataKeys.indexOf(item) > -1) {
|
713 | checked.push(item);
|
714 | }
|
715 | });
|
716 | this.checkChangeByUser = false;
|
717 | this.checked = checked;
|
718 | }
|
719 | }
|
720 | },
|
721 |
|
722 | computed: {
|
723 | filteredData: function filteredData() {
|
724 | var _this3 = this;
|
725 |
|
726 | return this.data.filter(function (item) {
|
727 | if (typeof _this3.filterMethod === 'function') {
|
728 | return _this3.filterMethod(_this3.query, item);
|
729 | } else {
|
730 | var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
|
731 | return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
|
732 | }
|
733 | });
|
734 | },
|
735 | checkableData: function checkableData() {
|
736 | var _this4 = this;
|
737 |
|
738 | return this.filteredData.filter(function (item) {
|
739 | return !item[_this4.disabledProp];
|
740 | });
|
741 | },
|
742 | checkedSummary: function checkedSummary() {
|
743 | var checkedLength = this.checked.length;
|
744 | var dataLength = this.data.length;
|
745 | var _format = this.format,
|
746 | noChecked = _format.noChecked,
|
747 | hasChecked = _format.hasChecked;
|
748 |
|
749 | if (noChecked && hasChecked) {
|
750 | return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
|
751 | } else {
|
752 | return checkedLength + '/' + dataLength;
|
753 | }
|
754 | },
|
755 | isIndeterminate: function isIndeterminate() {
|
756 | var checkedLength = this.checked.length;
|
757 | return checkedLength > 0 && checkedLength < this.checkableData.length;
|
758 | },
|
759 | hasNoMatch: function hasNoMatch() {
|
760 | return this.query.length > 0 && this.filteredData.length === 0;
|
761 | },
|
762 | inputIcon: function inputIcon() {
|
763 | return this.query.length > 0 && this.inputHover ? 'circle-close' : 'search';
|
764 | },
|
765 | labelProp: function labelProp() {
|
766 | return this.props.label || 'label';
|
767 | },
|
768 | keyProp: function keyProp() {
|
769 | return this.props.key || 'key';
|
770 | },
|
771 | disabledProp: function disabledProp() {
|
772 | return this.props.disabled || 'disabled';
|
773 | },
|
774 | hasFooter: function hasFooter() {
|
775 | return !!this.$slots.default;
|
776 | }
|
777 | },
|
778 |
|
779 | methods: {
|
780 | updateAllChecked: function updateAllChecked() {
|
781 | var _this5 = this;
|
782 |
|
783 | var checkableDataKeys = this.checkableData.map(function (item) {
|
784 | return item[_this5.keyProp];
|
785 | });
|
786 | this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
|
787 | return _this5.checked.indexOf(item) > -1;
|
788 | });
|
789 | },
|
790 | handleAllCheckedChange: function handleAllCheckedChange(value) {
|
791 | var _this6 = this;
|
792 |
|
793 | this.checked = value ? this.checkableData.map(function (item) {
|
794 | return item[_this6.keyProp];
|
795 | }) : [];
|
796 | },
|
797 | clearQuery: function clearQuery() {
|
798 | if (this.inputIcon === 'circle-close') {
|
799 | this.query = '';
|
800 | }
|
801 | }
|
802 | }
|
803 | });
|
804 |
|
805 | var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
|
806 |
|
807 | var componentNormalizer = __webpack_require__(0);
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 | var component = Object(componentNormalizer["a" ])(
|
818 | src_transfer_panelvue_type_script_lang_js_,
|
819 | transfer_panelvue_type_template_id_2ddab8bd_render,
|
820 | transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
|
821 | false,
|
822 | null,
|
823 | null,
|
824 | null
|
825 |
|
826 | )
|
827 |
|
828 |
|
829 | if (false) { var api; }
|
830 | component.options.__file = "packages/transfer/src/transfer-panel.vue"
|
831 | var transfer_panel = (component.exports);
|
832 |
|
833 | var migrating_ = __webpack_require__(11);
|
834 | var migrating_default = __webpack_require__.n(migrating_);
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 | var mainvue_type_script_lang_js_ = ({
|
888 | name: 'ElTransfer',
|
889 |
|
890 | mixins: [emitter_default.a, locale_default.a, migrating_default.a],
|
891 |
|
892 | components: {
|
893 | TransferPanel: transfer_panel,
|
894 | ElButton: button_default.a
|
895 | },
|
896 |
|
897 | props: {
|
898 | data: {
|
899 | type: Array,
|
900 | default: function _default() {
|
901 | return [];
|
902 | }
|
903 | },
|
904 | titles: {
|
905 | type: Array,
|
906 | default: function _default() {
|
907 | return [];
|
908 | }
|
909 | },
|
910 | buttonTexts: {
|
911 | type: Array,
|
912 | default: function _default() {
|
913 | return [];
|
914 | }
|
915 | },
|
916 | filterPlaceholder: {
|
917 | type: String,
|
918 | default: ''
|
919 | },
|
920 | filterMethod: Function,
|
921 | leftDefaultChecked: {
|
922 | type: Array,
|
923 | default: function _default() {
|
924 | return [];
|
925 | }
|
926 | },
|
927 | rightDefaultChecked: {
|
928 | type: Array,
|
929 | default: function _default() {
|
930 | return [];
|
931 | }
|
932 | },
|
933 | renderContent: Function,
|
934 | value: {
|
935 | type: Array,
|
936 | default: function _default() {
|
937 | return [];
|
938 | }
|
939 | },
|
940 | format: {
|
941 | type: Object,
|
942 | default: function _default() {
|
943 | return {};
|
944 | }
|
945 | },
|
946 | filterable: Boolean,
|
947 | props: {
|
948 | type: Object,
|
949 | default: function _default() {
|
950 | return {
|
951 | label: 'label',
|
952 | key: 'key',
|
953 | disabled: 'disabled'
|
954 | };
|
955 | }
|
956 | },
|
957 | targetOrder: {
|
958 | type: String,
|
959 | default: 'original'
|
960 | }
|
961 | },
|
962 |
|
963 | data: function data() {
|
964 | return {
|
965 | leftChecked: [],
|
966 | rightChecked: []
|
967 | };
|
968 | },
|
969 |
|
970 |
|
971 | computed: {
|
972 | dataObj: function dataObj() {
|
973 | var key = this.props.key;
|
974 | return this.data.reduce(function (o, cur) {
|
975 | return (o[cur[key]] = cur) && o;
|
976 | }, {});
|
977 | },
|
978 | sourceData: function sourceData() {
|
979 | var _this = this;
|
980 |
|
981 | return this.data.filter(function (item) {
|
982 | return _this.value.indexOf(item[_this.props.key]) === -1;
|
983 | });
|
984 | },
|
985 | targetData: function targetData() {
|
986 | var _this2 = this;
|
987 |
|
988 | if (this.targetOrder === 'original') {
|
989 | return this.data.filter(function (item) {
|
990 | return _this2.value.indexOf(item[_this2.props.key]) > -1;
|
991 | });
|
992 | } else {
|
993 | return this.value.reduce(function (arr, cur) {
|
994 | var val = _this2.dataObj[cur];
|
995 | if (val) {
|
996 | arr.push(val);
|
997 | }
|
998 | return arr;
|
999 | }, []);
|
1000 | }
|
1001 | },
|
1002 | hasButtonTexts: function hasButtonTexts() {
|
1003 | return this.buttonTexts.length === 2;
|
1004 | }
|
1005 | },
|
1006 |
|
1007 | watch: {
|
1008 | value: function value(val) {
|
1009 | this.dispatch('ElFormItem', 'el.form.change', val);
|
1010 | }
|
1011 | },
|
1012 |
|
1013 | methods: {
|
1014 | getMigratingConfig: function getMigratingConfig() {
|
1015 | return {
|
1016 | props: {
|
1017 | 'footer-format': 'footer-format is renamed to format.'
|
1018 | }
|
1019 | };
|
1020 | },
|
1021 | onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
|
1022 | this.leftChecked = val;
|
1023 | if (movedKeys === undefined) return;
|
1024 | this.$emit('left-check-change', val, movedKeys);
|
1025 | },
|
1026 | onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
|
1027 | this.rightChecked = val;
|
1028 | if (movedKeys === undefined) return;
|
1029 | this.$emit('right-check-change', val, movedKeys);
|
1030 | },
|
1031 | addToLeft: function addToLeft() {
|
1032 | var currentValue = this.value.slice();
|
1033 | this.rightChecked.forEach(function (item) {
|
1034 | var index = currentValue.indexOf(item);
|
1035 | if (index > -1) {
|
1036 | currentValue.splice(index, 1);
|
1037 | }
|
1038 | });
|
1039 | this.$emit('input', currentValue);
|
1040 | this.$emit('change', currentValue, 'left', this.rightChecked);
|
1041 | },
|
1042 | addToRight: function addToRight() {
|
1043 | var _this3 = this;
|
1044 |
|
1045 | var currentValue = this.value.slice();
|
1046 | var itemsToBeMoved = [];
|
1047 | var key = this.props.key;
|
1048 | this.data.forEach(function (item) {
|
1049 | var itemKey = item[key];
|
1050 | if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
|
1051 | itemsToBeMoved.push(itemKey);
|
1052 | }
|
1053 | });
|
1054 | currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
|
1055 | this.$emit('input', currentValue);
|
1056 | this.$emit('change', currentValue, 'right', this.leftChecked);
|
1057 | },
|
1058 | clearQuery: function clearQuery(which) {
|
1059 | if (which === 'left') {
|
1060 | this.$refs.leftPanel.query = '';
|
1061 | } else if (which === 'right') {
|
1062 | this.$refs.rightPanel.query = '';
|
1063 | }
|
1064 | }
|
1065 | }
|
1066 | });
|
1067 |
|
1068 | var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 |
|
1077 | var main_component = Object(componentNormalizer["a" ])(
|
1078 | src_mainvue_type_script_lang_js_,
|
1079 | render,
|
1080 | staticRenderFns,
|
1081 | false,
|
1082 | null,
|
1083 | null,
|
1084 | null
|
1085 |
|
1086 | )
|
1087 |
|
1088 |
|
1089 | if (false) { var main_api; }
|
1090 | main_component.options.__file = "packages/transfer/src/main.vue"
|
1091 | var main = (main_component.exports);
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 | main.install = function (Vue) {
|
1097 | Vue.component(main.name, main);
|
1098 | };
|
1099 |
|
1100 | var transfer = __webpack_exports__["default"] = (main);
|
1101 |
|
1102 | })
|
1103 |
|
1104 | }); |
\ | No newline at end of file |