ai.touchui-vue 1.33.3 → 1.34.1

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.
Files changed (85) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +904 -917
  3. package/lib/align.js +2 -2
  4. package/lib/animation.js +2 -2
  5. package/lib/article.js +2 -2
  6. package/lib/box.js +2 -2
  7. package/lib/button.js +2 -2
  8. package/lib/calendar.js +2 -2
  9. package/lib/card-item.js +19 -19
  10. package/lib/card.js +178 -178
  11. package/lib/cascader.js +2 -2
  12. package/lib/center-scroll.js +2 -2
  13. package/lib/chat.js +4 -4
  14. package/lib/checkbox.js +11 -5
  15. package/lib/checkboxes.js +27 -5
  16. package/lib/collapse.js +768 -768
  17. package/lib/color.js +2 -2
  18. package/lib/countdown.js +2 -2
  19. package/lib/date-picker.js +1486 -1486
  20. package/lib/date-range.js +2 -2
  21. package/lib/dialog.js +27 -23
  22. package/lib/dis.js +2 -2
  23. package/lib/ellipsis.js +2 -2
  24. package/lib/emote.js +2 -2
  25. package/lib/export.js +10 -10
  26. package/lib/filter.js +2 -2
  27. package/lib/fix.js +2 -2
  28. package/lib/float.js +2 -2
  29. package/lib/flow.js +4 -4
  30. package/lib/form.js +2 -2
  31. package/lib/grid.js +2 -2
  32. package/lib/guider.js +2 -2
  33. package/lib/header.js +2 -2
  34. package/lib/hide.js +2 -2
  35. package/lib/icon.js +2 -2
  36. package/lib/import.js +12 -12
  37. package/lib/index.js +1 -1
  38. package/lib/input.js +5 -5
  39. package/lib/ip.js +2 -2
  40. package/lib/line.js +2 -2
  41. package/lib/loading.js +11 -11
  42. package/lib/longtap.js +2 -2
  43. package/lib/menu-icon.js +670 -673
  44. package/lib/message.js +2 -2
  45. package/lib/msg.js +19 -19
  46. package/lib/org.js +706 -706
  47. package/lib/padding.js +2 -2
  48. package/lib/page.js +4 -438
  49. package/lib/param.js +2 -2
  50. package/lib/pic.js +4 -4
  51. package/lib/popup.js +2 -2
  52. package/lib/progress.js +2 -2
  53. package/lib/range.js +1074 -1074
  54. package/lib/rate.js +2 -2
  55. package/lib/reverser.js +2 -2
  56. package/lib/scroll.js +2 -2
  57. package/lib/segment.js +2 -2
  58. package/lib/select.js +2 -2
  59. package/lib/size.js +2 -2
  60. package/lib/skeleton.js +2 -2
  61. package/lib/slide.js +2 -2
  62. package/lib/space.js +2 -2
  63. package/lib/step.js +2 -2
  64. package/lib/submit.js +2 -2
  65. package/lib/switch.js +2 -2
  66. package/lib/tab.js +2 -2
  67. package/lib/table.js +2 -2
  68. package/lib/tag.js +2 -2
  69. package/lib/theme/css/theme/workbench-gz.css +1 -0
  70. package/lib/timeline.js +2 -2
  71. package/lib/tip.js +2 -2
  72. package/lib/tooltip.js +2 -2
  73. package/lib/transfer.js +2 -2
  74. package/lib/tree.js +2 -2
  75. package/lib/upload.js +14 -14
  76. package/package.json +1 -1
  77. package/packages/checkbox/src/checkbox.vue +8 -2
  78. package/packages/checkboxes/src/checkboxes.vue +17 -1
  79. package/packages/dialog/src/dialog.vue +21 -18
  80. package/packages/input/src/input.vue +1 -1
  81. package/packages/page/src/page.vue +0 -22
  82. package/packages/tab/.DS_Store +0 -0
  83. package/packages/theme/lib/css/theme/workbench-gz.css +1 -0
  84. package/packages/theme/src/less/theme/workbench-gz.less +159 -0
  85. package/src/index.js +1 -1
package/lib/org.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 344);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 341);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -193,665 +193,197 @@ function normalizeComponent(
193
193
  /***/ }),
194
194
 
195
195
  /***/ 100:
196
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
-
198
- "use strict";
199
- /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
200
- /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
201
- /* unused harmony reexport * */
202
-
203
-
204
- /***/ }),
205
-
206
- /***/ 101:
207
196
  /***/ (function(module, exports, __webpack_require__) {
208
197
 
209
- exports = module.exports = __webpack_require__(7)(false);
198
+ exports = module.exports = __webpack_require__(11)(false);
210
199
  // Module
211
200
  exports.push([module.i, "\n.chosen { border:1px solid #f60;}\n.ghost { opacity:0.2;}\n", ""]);
212
201
 
213
202
 
214
203
  /***/ }),
215
204
 
216
- /***/ 21:
205
+ /***/ 11:
217
206
  /***/ (function(module, exports, __webpack_require__) {
218
207
 
219
- var content = __webpack_require__(101);
208
+ "use strict";
220
209
 
221
- if (typeof content === 'string') {
222
- content = [[module.i, content, '']];
223
- }
224
210
 
225
- var options = {}
211
+ /*
212
+ MIT License http://www.opensource.org/licenses/mit-license.php
213
+ Author Tobias Koppers @sokra
214
+ */
215
+ // css base code, injected by the css-loader
216
+ // eslint-disable-next-line func-names
217
+ module.exports = function (useSourceMap) {
218
+ var list = []; // return the list of modules as css string
226
219
 
227
- options.insert = "head";
228
- options.singleton = false;
220
+ list.toString = function toString() {
221
+ return this.map(function (item) {
222
+ var content = cssWithMappingToString(item, useSourceMap);
229
223
 
230
- var update = __webpack_require__(8)(content, options);
224
+ if (item[2]) {
225
+ return "@media ".concat(item[2], "{").concat(content, "}");
226
+ }
231
227
 
232
- if (content.locals) {
233
- module.exports = content.locals;
234
- }
228
+ return content;
229
+ }).join('');
230
+ }; // import a list of modules into the list
231
+ // eslint-disable-next-line func-names
235
232
 
236
233
 
237
- /***/ }),
234
+ list.i = function (modules, mediaQuery) {
235
+ if (typeof modules === 'string') {
236
+ // eslint-disable-next-line no-param-reassign
237
+ modules = [[null, modules, '']];
238
+ }
238
239
 
239
- /***/ 344:
240
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
240
+ var alreadyImportedModules = {};
241
241
 
242
- "use strict";
243
- // ESM COMPAT FLAG
244
- __webpack_require__.r(__webpack_exports__);
242
+ for (var i = 0; i < this.length; i++) {
243
+ // eslint-disable-next-line prefer-destructuring
244
+ var id = this[i][0];
245
245
 
246
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/org.vue?vue&type=template&id=05fbba22
247
- var render = function () {
248
- var _vm = this
249
- var _h = _vm.$createElement
250
- var _c = _vm._self._c || _h
251
- return _c("div", { staticClass: "to-org", class: _vm.setClass }, [
252
- _c(
253
- "ul",
254
- { staticClass: "to-orgList" },
255
- [
256
- _c("to-org-item", {
257
- attrs: {
258
- data: _vm.iData,
259
- "children-text": _vm.childrenText,
260
- "label-text": _vm.labelText,
261
- "value-text": _vm.valueText,
262
- },
263
- scopedSlots: _vm._u(
264
- [
265
- {
266
- key: "default",
267
- fn: function (scope) {
268
- return [
269
- _vm._t("default", null, {
270
- item: scope.item,
271
- index: scope.index,
272
- org: scope.org,
273
- }),
274
- ]
275
- },
276
- },
277
- ],
278
- null,
279
- true
280
- ),
281
- }),
282
- ],
283
- 1
284
- ),
285
- ])
286
- }
287
- var staticRenderFns = []
288
- render._withStripped = true
246
+ if (id != null) {
247
+ alreadyImportedModules[id] = true;
248
+ }
249
+ }
289
250
 
251
+ for (var _i = 0; _i < modules.length; _i++) {
252
+ var item = modules[_i]; // skip already imported module
253
+ // this implementation is not 100% perfect for weird media query combinations
254
+ // when a module is imported multiple times with different media queries.
255
+ // I hope this will never occur (Hey this way we have smaller bundles)
290
256
 
291
- // CONCATENATED MODULE: ./packages/org/src/org.vue?vue&type=template&id=05fbba22
257
+ if (item[0] == null || !alreadyImportedModules[item[0]]) {
258
+ if (mediaQuery && !item[2]) {
259
+ item[2] = mediaQuery;
260
+ } else if (mediaQuery) {
261
+ item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
262
+ }
292
263
 
293
- // EXTERNAL MODULE: external "vue"
294
- var external_vue_ = __webpack_require__(4);
295
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
264
+ list.push(item);
265
+ }
266
+ }
267
+ };
296
268
 
297
- // CONCATENATED MODULE: ./src/utils/uuid.js
298
- /* harmony default export */ var uuid = (function () {
299
- var s = [];
300
- var hexDigits = '0123456789abcdef';
301
- for (var i = 0; i < 36; i++) {
302
- s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
303
- }
304
- s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
305
- s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
306
- s[8] = s[13] = s[18] = s[23] = '-';
307
- var uuid = s.join('');
308
- return uuid;
309
- });
310
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/orgItem.vue?vue&type=template&id=3547cd49
311
- var orgItemvue_type_template_id_3547cd49_render = function () {
312
- var _vm = this
313
- var _h = _vm.$createElement
314
- var _c = _vm._self._c || _h
315
- return _c(
316
- "li",
317
- {
318
- staticClass: "to-orgItem",
319
- attrs: {
320
- id: _vm.org.id + "_" + _vm.data.value,
321
- "data-value": _vm.data.value,
322
- },
323
- },
324
- [
325
- _c(
326
- "div",
327
- { staticClass: "to-orgNode" },
328
- [
329
- _vm._t("default", [_vm._v(_vm._s(_vm.data[_vm.labelText]))], {
330
- item: _vm.data,
331
- index: _vm.index,
332
- org: _vm.org,
333
- }),
334
- ],
335
- 2
336
- ),
337
- _vm.data[_vm.childrenText] && _vm.data[_vm.childrenText].length > 0
338
- ? _c("div", {
339
- staticClass: "to-orgLine",
340
- class: {
341
- "to-orgLastLevelLine": _vm.data.level + 1 === _vm.org.deep,
342
- },
343
- })
344
- : _vm._e(),
345
- _c(
346
- "ul",
347
- {
348
- staticClass: "to-orgList",
349
- class: {
350
- "to-orgLastLevel": _vm.data.level + 1 === _vm.org.deep,
351
- "to-orgEmpty":
352
- _vm.data[_vm.childrenText] &&
353
- _vm.data[_vm.childrenText].length === 0,
354
- },
355
- },
356
- [
357
- _c(
358
- "draggable",
359
- {
360
- attrs: {
361
- "data-value": _vm.data.value,
362
- group: "group",
363
- "chosen-class": "to-orgDrag-chosen",
364
- "ghost-class": "to-orgDrag-ghost",
365
- disabled: !_vm.org.dragable,
366
- },
367
- on: { add: _vm.org.dragAdd, start: _vm.org.dragStart },
368
- model: {
369
- value: _vm.data[_vm.childrenText],
370
- callback: function ($$v) {
371
- _vm.$set(_vm.data, _vm.childrenText, $$v)
372
- },
373
- expression: "data[childrenText]",
374
- },
375
- },
376
- _vm._l(_vm.data[_vm.childrenText], function (item, dataIndex) {
377
- return _c("to-org-item", {
378
- key: dataIndex,
379
- attrs: {
380
- "children-text": _vm.childrenText,
381
- "label-text": _vm.labelText,
382
- "value-text": _vm.valueText,
383
- data: item,
384
- index: dataIndex,
385
- },
386
- scopedSlots: _vm._u(
387
- [
388
- {
389
- key: "default",
390
- fn: function (scope) {
391
- return [
392
- _vm._t("default", null, {
393
- item: scope.item,
394
- index: scope.index,
395
- org: scope.org,
396
- }),
397
- ]
398
- },
399
- },
400
- ],
401
- null,
402
- true
403
- ),
404
- })
405
- }),
406
- 1
407
- ),
408
- ],
409
- 1
410
- ),
411
- ]
412
- )
413
- }
414
- var orgItemvue_type_template_id_3547cd49_staticRenderFns = []
415
- orgItemvue_type_template_id_3547cd49_render._withStripped = true
269
+ return list;
270
+ };
416
271
 
272
+ function cssWithMappingToString(item, useSourceMap) {
273
+ var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
417
274
 
418
- // CONCATENATED MODULE: ./packages/org/src/orgItem.vue?vue&type=template&id=3547cd49
275
+ var cssMapping = item[3];
419
276
 
420
- // EXTERNAL MODULE: external "vuedraggable"
421
- var external_vuedraggable_ = __webpack_require__(93);
422
- var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_vuedraggable_);
423
-
424
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/orgItem.vue?vue&type=script&lang=js
425
- //
426
- //
427
- //
428
- //
429
- //
430
- //
431
- //
432
- //
433
- //
434
- //
435
- //
436
- //
437
- //
438
- //
439
- //
440
- //
441
- //
442
- //
443
- //
444
- //
445
- //
446
- //
447
- //
448
- //
449
- //
450
- //
277
+ if (!cssMapping) {
278
+ return content;
279
+ }
451
280
 
281
+ if (useSourceMap && typeof btoa === 'function') {
282
+ var sourceMapping = toComment(cssMapping);
283
+ var sourceURLs = cssMapping.sources.map(function (source) {
284
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
285
+ });
286
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
287
+ }
452
288
 
453
- /* harmony default export */ var orgItemvue_type_script_lang_js = ({
454
- name: 'ToOrgItem',
455
- components: {
456
- draggable: external_vuedraggable_default.a
457
- },
458
- componentName: 'ToOrgItem',
459
- inject: ['org'],
460
- props: {
461
- valueText: {
462
- type: String,
463
- default: 'value'
464
- },
465
- labelText: {
466
- type: String,
467
- default: 'label'
468
- },
469
- childrenText: {
470
- type: String,
471
- default: 'children'
472
- },
473
- data: {
474
- type: Object,
475
- default: function _default() {}
476
- },
477
- index: {
478
- type: Number,
479
- default: 0
480
- }
481
- }
482
- });
483
- // CONCATENATED MODULE: ./packages/org/src/orgItem.vue?vue&type=script&lang=js
484
- /* harmony default export */ var src_orgItemvue_type_script_lang_js = (orgItemvue_type_script_lang_js);
485
- // EXTERNAL MODULE: ./packages/org/src/orgItem.vue?vue&type=style&index=0&id=3547cd49&prod&lang=css
486
- var orgItemvue_type_style_index_0_id_3547cd49_prod_lang_css = __webpack_require__(100);
289
+ return [content].join('\n');
290
+ } // Adapted from convert-source-map (MIT)
487
291
 
488
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
489
- var componentNormalizer = __webpack_require__(0);
490
292
 
491
- // CONCATENATED MODULE: ./packages/org/src/orgItem.vue
293
+ function toComment(sourceMap) {
294
+ // eslint-disable-next-line no-undef
295
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
296
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
297
+ return "/*# ".concat(data, " */");
298
+ }
492
299
 
300
+ /***/ }),
493
301
 
302
+ /***/ 12:
303
+ /***/ (function(module, exports, __webpack_require__) {
494
304
 
305
+ "use strict";
495
306
 
496
307
 
308
+ var stylesInDom = {};
497
309
 
498
- /* normalize component */
310
+ var isOldIE = function isOldIE() {
311
+ var memo;
312
+ return function memorize() {
313
+ if (typeof memo === 'undefined') {
314
+ // Test for IE <= 9 as proposed by Browserhacks
315
+ // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
316
+ // Tests for existence of standard globals is to allow style-loader
317
+ // to operate correctly into non-standard environments
318
+ // @see https://github.com/webpack-contrib/style-loader/issues/177
319
+ memo = Boolean(window && document && document.all && !window.atob);
320
+ }
499
321
 
500
- var component = Object(componentNormalizer["a" /* default */])(
501
- src_orgItemvue_type_script_lang_js,
502
- orgItemvue_type_template_id_3547cd49_render,
503
- orgItemvue_type_template_id_3547cd49_staticRenderFns,
504
- false,
505
- null,
506
- null,
507
- null
508
-
509
- )
322
+ return memo;
323
+ };
324
+ }();
510
325
 
511
- /* harmony default export */ var orgItem = (component.exports);
512
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/org.vue?vue&type=script&lang=js
513
- //
514
- //
515
- //
516
- //
517
- //
518
- //
519
- //
520
- //
521
- //
522
- //
523
- //
326
+ var getTarget = function getTarget() {
327
+ var memo = {};
328
+ return function memorize(target) {
329
+ if (typeof memo[target] === 'undefined') {
330
+ var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
524
331
 
332
+ if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
333
+ try {
334
+ // This will throw an exception if access to iframe is blocked
335
+ // due to cross-origin restrictions
336
+ styleTarget = styleTarget.contentDocument.head;
337
+ } catch (e) {
338
+ // istanbul ignore next
339
+ styleTarget = null;
340
+ }
341
+ }
525
342
 
343
+ memo[target] = styleTarget;
344
+ }
526
345
 
346
+ return memo[target];
347
+ };
348
+ }();
527
349
 
528
- external_vue_default.a.component('ToOrgItem', orgItem);
529
- /* harmony default export */ var orgvue_type_script_lang_js = ({
530
- name: 'ToOrg',
531
- componentName: 'ToOrg',
532
- provide: function provide() {
533
- return {
534
- org: this
535
- };
536
- },
350
+ function listToStyles(list, options) {
351
+ var styles = [];
352
+ var newStyles = {};
537
353
 
538
- props: {
539
- dragable: Boolean,
540
- valueText: {
541
- type: String,
542
- default: 'value'
543
- },
544
- labelText: {
545
- type: String,
546
- default: 'label'
547
- },
548
- childrenText: {
549
- type: String,
550
- default: 'children'
551
- },
552
- leafMode: {
553
- type: String,
554
- default: ''
555
- },
556
- data: {
557
- type: Object,
558
- default: function _default() {}
559
- }
560
- },
561
- data: function data() {
562
- return {
563
- from: '',
564
- id: 'org_' + uuid(),
565
- iData: {},
566
- deeps: [],
567
- deep: 0
568
- };
569
- },
354
+ for (var i = 0; i < list.length; i++) {
355
+ var item = list[i];
356
+ var id = options.base ? item[0] + options.base : item[0];
357
+ var css = item[1];
358
+ var media = item[2];
359
+ var sourceMap = item[3];
360
+ var part = {
361
+ css: css,
362
+ media: media,
363
+ sourceMap: sourceMap
364
+ };
570
365
 
571
- computed: {
572
- setClass: function setClass() {
573
- var arr = [];
574
- if (this.leafMode) {
575
- arr.push('to-org-leaf-mode-' + this.leafMode);
576
- }
577
- if (this.dragable) {
578
- arr.push('to-org-dragable');
579
- }
580
- return arr;
581
- }
582
- },
583
- watch: {
584
- data: {
585
- handler: function handler() {
586
- this.initData(this.data);
587
- },
366
+ if (!newStyles[id]) {
367
+ styles.push(newStyles[id] = {
368
+ id: id,
369
+ parts: [part]
370
+ });
371
+ } else {
372
+ newStyles[id].parts.push(part);
373
+ }
374
+ }
588
375
 
589
- immediate: true,
590
- deep: true
591
- }
592
- },
593
- methods: {
594
- initData: function initData(data) {
595
- var self = this;
596
- this.iData = JSON.parse(JSON.stringify(data));
597
- this.iData.level = 0;
598
- function set(arr) {
599
- var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
376
+ return styles;
377
+ }
600
378
 
601
- arr.map(function (item) {
602
- item.level = i;
603
- if (item[self.childrenText] && item[self.childrenText].length > 0) {
604
- self.deeps.push(i + 1);
605
- set(item[self.childrenText], i + 1);
606
- } else {
607
- item[self.childrenText] = [];
608
- }
609
- });
610
- }
611
- if (this.iData[self.childrenText]) {
612
- set(this.iData[self.childrenText]);
613
- }
614
- this.deep = this.deeps.sort()[this.deeps.length - 1];
615
- },
616
- dragStart: function dragStart(e) {
617
- this.from = document.getElementById(e.clone.id).parentNode.dataset.value;
618
- },
619
- dragAdd: function dragAdd(e) {
620
- var _this = this;
379
+ function addStylesToDom(styles, options) {
380
+ for (var i = 0; i < styles.length; i++) {
381
+ var item = styles[i];
382
+ var domStyle = stylesInDom[item.id];
383
+ var j = 0;
621
384
 
622
- this.initData(this.iData);
623
-
624
- // vuedraggable bug:
625
- // 从左往右拖动到同级节点之下,因为 DOM 发生变化导致判断错误,form/to 的值都不正确了,因此通过获取当前节点 id,向上寻找 parentNode 的方式来获取 from/to
626
- this.$nextTick(function () {
627
- _this.$emit('drag', _this.from, document.getElementById(e.clone.id).parentNode.dataset.value, e.clone.dataset.value);
628
- });
629
- }
630
- }
631
- });
632
- // CONCATENATED MODULE: ./packages/org/src/org.vue?vue&type=script&lang=js
633
- /* harmony default export */ var src_orgvue_type_script_lang_js = (orgvue_type_script_lang_js);
634
- // CONCATENATED MODULE: ./packages/org/src/org.vue
635
-
636
-
637
-
638
-
639
-
640
- /* normalize component */
641
-
642
- var org_component = Object(componentNormalizer["a" /* default */])(
643
- src_orgvue_type_script_lang_js,
644
- render,
645
- staticRenderFns,
646
- false,
647
- null,
648
- null,
649
- null
650
-
651
- )
652
-
653
- /* harmony default export */ var org = (org_component.exports);
654
- // CONCATENATED MODULE: ./packages/org/index.js
655
-
656
-
657
- /* istanbul ignore next */
658
- org.install = function (Vue) {
659
- Vue.component(org.name, org);
660
- };
661
-
662
- /* harmony default export */ var packages_org = __webpack_exports__["default"] = (org);
663
-
664
- /***/ }),
665
-
666
- /***/ 4:
667
- /***/ (function(module, exports) {
668
-
669
- module.exports = require("vue");
670
-
671
- /***/ }),
672
-
673
- /***/ 7:
674
- /***/ (function(module, exports, __webpack_require__) {
675
-
676
- "use strict";
677
-
678
-
679
- /*
680
- MIT License http://www.opensource.org/licenses/mit-license.php
681
- Author Tobias Koppers @sokra
682
- */
683
- // css base code, injected by the css-loader
684
- // eslint-disable-next-line func-names
685
- module.exports = function (useSourceMap) {
686
- var list = []; // return the list of modules as css string
687
-
688
- list.toString = function toString() {
689
- return this.map(function (item) {
690
- var content = cssWithMappingToString(item, useSourceMap);
691
-
692
- if (item[2]) {
693
- return "@media ".concat(item[2], "{").concat(content, "}");
694
- }
695
-
696
- return content;
697
- }).join('');
698
- }; // import a list of modules into the list
699
- // eslint-disable-next-line func-names
700
-
701
-
702
- list.i = function (modules, mediaQuery) {
703
- if (typeof modules === 'string') {
704
- // eslint-disable-next-line no-param-reassign
705
- modules = [[null, modules, '']];
706
- }
707
-
708
- var alreadyImportedModules = {};
709
-
710
- for (var i = 0; i < this.length; i++) {
711
- // eslint-disable-next-line prefer-destructuring
712
- var id = this[i][0];
713
-
714
- if (id != null) {
715
- alreadyImportedModules[id] = true;
716
- }
717
- }
718
-
719
- for (var _i = 0; _i < modules.length; _i++) {
720
- var item = modules[_i]; // skip already imported module
721
- // this implementation is not 100% perfect for weird media query combinations
722
- // when a module is imported multiple times with different media queries.
723
- // I hope this will never occur (Hey this way we have smaller bundles)
724
-
725
- if (item[0] == null || !alreadyImportedModules[item[0]]) {
726
- if (mediaQuery && !item[2]) {
727
- item[2] = mediaQuery;
728
- } else if (mediaQuery) {
729
- item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
730
- }
731
-
732
- list.push(item);
733
- }
734
- }
735
- };
736
-
737
- return list;
738
- };
739
-
740
- function cssWithMappingToString(item, useSourceMap) {
741
- var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
742
-
743
- var cssMapping = item[3];
744
-
745
- if (!cssMapping) {
746
- return content;
747
- }
748
-
749
- if (useSourceMap && typeof btoa === 'function') {
750
- var sourceMapping = toComment(cssMapping);
751
- var sourceURLs = cssMapping.sources.map(function (source) {
752
- return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
753
- });
754
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
755
- }
756
-
757
- return [content].join('\n');
758
- } // Adapted from convert-source-map (MIT)
759
-
760
-
761
- function toComment(sourceMap) {
762
- // eslint-disable-next-line no-undef
763
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
764
- var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
765
- return "/*# ".concat(data, " */");
766
- }
767
-
768
- /***/ }),
769
-
770
- /***/ 8:
771
- /***/ (function(module, exports, __webpack_require__) {
772
-
773
- "use strict";
774
-
775
-
776
- var stylesInDom = {};
777
-
778
- var isOldIE = function isOldIE() {
779
- var memo;
780
- return function memorize() {
781
- if (typeof memo === 'undefined') {
782
- // Test for IE <= 9 as proposed by Browserhacks
783
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
784
- // Tests for existence of standard globals is to allow style-loader
785
- // to operate correctly into non-standard environments
786
- // @see https://github.com/webpack-contrib/style-loader/issues/177
787
- memo = Boolean(window && document && document.all && !window.atob);
788
- }
789
-
790
- return memo;
791
- };
792
- }();
793
-
794
- var getTarget = function getTarget() {
795
- var memo = {};
796
- return function memorize(target) {
797
- if (typeof memo[target] === 'undefined') {
798
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
799
-
800
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
801
- try {
802
- // This will throw an exception if access to iframe is blocked
803
- // due to cross-origin restrictions
804
- styleTarget = styleTarget.contentDocument.head;
805
- } catch (e) {
806
- // istanbul ignore next
807
- styleTarget = null;
808
- }
809
- }
810
-
811
- memo[target] = styleTarget;
812
- }
813
-
814
- return memo[target];
815
- };
816
- }();
817
-
818
- function listToStyles(list, options) {
819
- var styles = [];
820
- var newStyles = {};
821
-
822
- for (var i = 0; i < list.length; i++) {
823
- var item = list[i];
824
- var id = options.base ? item[0] + options.base : item[0];
825
- var css = item[1];
826
- var media = item[2];
827
- var sourceMap = item[3];
828
- var part = {
829
- css: css,
830
- media: media,
831
- sourceMap: sourceMap
832
- };
833
-
834
- if (!newStyles[id]) {
835
- styles.push(newStyles[id] = {
836
- id: id,
837
- parts: [part]
838
- });
839
- } else {
840
- newStyles[id].parts.push(part);
841
- }
842
- }
843
-
844
- return styles;
845
- }
846
-
847
- function addStylesToDom(styles, options) {
848
- for (var i = 0; i < styles.length; i++) {
849
- var item = styles[i];
850
- var domStyle = stylesInDom[item.id];
851
- var j = 0;
852
-
853
- if (domStyle) {
854
- domStyle.refs++;
385
+ if (domStyle) {
386
+ domStyle.refs++;
855
387
 
856
388
  for (; j < domStyle.parts.length; j++) {
857
389
  domStyle.parts[j](item.parts[j]);
@@ -936,131 +468,599 @@ function applyToSingletonTag(style, index, remove, obj) {
936
468
  var cssNode = document.createTextNode(css);
937
469
  var childNodes = style.childNodes;
938
470
 
939
- if (childNodes[index]) {
940
- style.removeChild(childNodes[index]);
941
- }
471
+ if (childNodes[index]) {
472
+ style.removeChild(childNodes[index]);
473
+ }
474
+
475
+ if (childNodes.length) {
476
+ style.insertBefore(cssNode, childNodes[index]);
477
+ } else {
478
+ style.appendChild(cssNode);
479
+ }
480
+ }
481
+ }
482
+
483
+ function applyToTag(style, options, obj) {
484
+ var css = obj.css;
485
+ var media = obj.media;
486
+ var sourceMap = obj.sourceMap;
487
+
488
+ if (media) {
489
+ style.setAttribute('media', media);
490
+ }
491
+
492
+ if (sourceMap && btoa) {
493
+ css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
494
+ } // For old IE
495
+
496
+ /* istanbul ignore if */
497
+
498
+
499
+ if (style.styleSheet) {
500
+ style.styleSheet.cssText = css;
501
+ } else {
502
+ while (style.firstChild) {
503
+ style.removeChild(style.firstChild);
504
+ }
505
+
506
+ style.appendChild(document.createTextNode(css));
507
+ }
508
+ }
509
+
510
+ var singleton = null;
511
+ var singletonCounter = 0;
512
+
513
+ function addStyle(obj, options) {
514
+ var style;
515
+ var update;
516
+ var remove;
517
+
518
+ if (options.singleton) {
519
+ var styleIndex = singletonCounter++;
520
+ style = singleton || (singleton = insertStyleElement(options));
521
+ update = applyToSingletonTag.bind(null, style, styleIndex, false);
522
+ remove = applyToSingletonTag.bind(null, style, styleIndex, true);
523
+ } else {
524
+ style = insertStyleElement(options);
525
+ update = applyToTag.bind(null, style, options);
526
+
527
+ remove = function remove() {
528
+ removeStyleElement(style);
529
+ };
530
+ }
531
+
532
+ update(obj);
533
+ return function updateStyle(newObj) {
534
+ if (newObj) {
535
+ if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
536
+ return;
537
+ }
538
+
539
+ update(obj = newObj);
540
+ } else {
541
+ remove();
542
+ }
543
+ };
544
+ }
545
+
546
+ module.exports = function (list, options) {
547
+ options = options || {};
548
+ options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
549
+ // tags it will allow on a page
550
+
551
+ if (!options.singleton && typeof options.singleton !== 'boolean') {
552
+ options.singleton = isOldIE();
553
+ }
554
+
555
+ var styles = listToStyles(list, options);
556
+ addStylesToDom(styles, options);
557
+ return function update(newList) {
558
+ var mayRemove = [];
559
+
560
+ for (var i = 0; i < styles.length; i++) {
561
+ var item = styles[i];
562
+ var domStyle = stylesInDom[item.id];
563
+
564
+ if (domStyle) {
565
+ domStyle.refs--;
566
+ mayRemove.push(domStyle);
567
+ }
568
+ }
569
+
570
+ if (newList) {
571
+ var newStyles = listToStyles(newList, options);
572
+ addStylesToDom(newStyles, options);
573
+ }
574
+
575
+ for (var _i = 0; _i < mayRemove.length; _i++) {
576
+ var _domStyle = mayRemove[_i];
577
+
578
+ if (_domStyle.refs === 0) {
579
+ for (var j = 0; j < _domStyle.parts.length; j++) {
580
+ _domStyle.parts[j]();
581
+ }
582
+
583
+ delete stylesInDom[_domStyle.id];
584
+ }
585
+ }
586
+ };
587
+ };
588
+
589
+ /***/ }),
590
+
591
+ /***/ 21:
592
+ /***/ (function(module, exports, __webpack_require__) {
593
+
594
+ var content = __webpack_require__(100);
595
+
596
+ if (typeof content === 'string') {
597
+ content = [[module.i, content, '']];
598
+ }
599
+
600
+ var options = {}
601
+
602
+ options.insert = "head";
603
+ options.singleton = false;
604
+
605
+ var update = __webpack_require__(12)(content, options);
606
+
607
+ if (content.locals) {
608
+ module.exports = content.locals;
609
+ }
610
+
611
+
612
+ /***/ }),
613
+
614
+ /***/ 341:
615
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
616
+
617
+ "use strict";
618
+ // ESM COMPAT FLAG
619
+ __webpack_require__.r(__webpack_exports__);
620
+
621
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/org.vue?vue&type=template&id=05fbba22
622
+ var render = function () {
623
+ var _vm = this
624
+ var _h = _vm.$createElement
625
+ var _c = _vm._self._c || _h
626
+ return _c("div", { staticClass: "to-org", class: _vm.setClass }, [
627
+ _c(
628
+ "ul",
629
+ { staticClass: "to-orgList" },
630
+ [
631
+ _c("to-org-item", {
632
+ attrs: {
633
+ data: _vm.iData,
634
+ "children-text": _vm.childrenText,
635
+ "label-text": _vm.labelText,
636
+ "value-text": _vm.valueText,
637
+ },
638
+ scopedSlots: _vm._u(
639
+ [
640
+ {
641
+ key: "default",
642
+ fn: function (scope) {
643
+ return [
644
+ _vm._t("default", null, {
645
+ item: scope.item,
646
+ index: scope.index,
647
+ org: scope.org,
648
+ }),
649
+ ]
650
+ },
651
+ },
652
+ ],
653
+ null,
654
+ true
655
+ ),
656
+ }),
657
+ ],
658
+ 1
659
+ ),
660
+ ])
661
+ }
662
+ var staticRenderFns = []
663
+ render._withStripped = true
664
+
665
+
666
+ // CONCATENATED MODULE: ./packages/org/src/org.vue?vue&type=template&id=05fbba22
667
+
668
+ // EXTERNAL MODULE: external "vue"
669
+ var external_vue_ = __webpack_require__(4);
670
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
671
+
672
+ // CONCATENATED MODULE: ./src/utils/uuid.js
673
+ /* harmony default export */ var uuid = (function () {
674
+ var s = [];
675
+ var hexDigits = '0123456789abcdef';
676
+ for (var i = 0; i < 36; i++) {
677
+ s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
678
+ }
679
+ s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
680
+ s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
681
+ s[8] = s[13] = s[18] = s[23] = '-';
682
+ var uuid = s.join('');
683
+ return uuid;
684
+ });
685
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/orgItem.vue?vue&type=template&id=3547cd49
686
+ var orgItemvue_type_template_id_3547cd49_render = function () {
687
+ var _vm = this
688
+ var _h = _vm.$createElement
689
+ var _c = _vm._self._c || _h
690
+ return _c(
691
+ "li",
692
+ {
693
+ staticClass: "to-orgItem",
694
+ attrs: {
695
+ id: _vm.org.id + "_" + _vm.data.value,
696
+ "data-value": _vm.data.value,
697
+ },
698
+ },
699
+ [
700
+ _c(
701
+ "div",
702
+ { staticClass: "to-orgNode" },
703
+ [
704
+ _vm._t("default", [_vm._v(_vm._s(_vm.data[_vm.labelText]))], {
705
+ item: _vm.data,
706
+ index: _vm.index,
707
+ org: _vm.org,
708
+ }),
709
+ ],
710
+ 2
711
+ ),
712
+ _vm.data[_vm.childrenText] && _vm.data[_vm.childrenText].length > 0
713
+ ? _c("div", {
714
+ staticClass: "to-orgLine",
715
+ class: {
716
+ "to-orgLastLevelLine": _vm.data.level + 1 === _vm.org.deep,
717
+ },
718
+ })
719
+ : _vm._e(),
720
+ _c(
721
+ "ul",
722
+ {
723
+ staticClass: "to-orgList",
724
+ class: {
725
+ "to-orgLastLevel": _vm.data.level + 1 === _vm.org.deep,
726
+ "to-orgEmpty":
727
+ _vm.data[_vm.childrenText] &&
728
+ _vm.data[_vm.childrenText].length === 0,
729
+ },
730
+ },
731
+ [
732
+ _c(
733
+ "draggable",
734
+ {
735
+ attrs: {
736
+ "data-value": _vm.data.value,
737
+ group: "group",
738
+ "chosen-class": "to-orgDrag-chosen",
739
+ "ghost-class": "to-orgDrag-ghost",
740
+ disabled: !_vm.org.dragable,
741
+ },
742
+ on: { add: _vm.org.dragAdd, start: _vm.org.dragStart },
743
+ model: {
744
+ value: _vm.data[_vm.childrenText],
745
+ callback: function ($$v) {
746
+ _vm.$set(_vm.data, _vm.childrenText, $$v)
747
+ },
748
+ expression: "data[childrenText]",
749
+ },
750
+ },
751
+ _vm._l(_vm.data[_vm.childrenText], function (item, dataIndex) {
752
+ return _c("to-org-item", {
753
+ key: dataIndex,
754
+ attrs: {
755
+ "children-text": _vm.childrenText,
756
+ "label-text": _vm.labelText,
757
+ "value-text": _vm.valueText,
758
+ data: item,
759
+ index: dataIndex,
760
+ },
761
+ scopedSlots: _vm._u(
762
+ [
763
+ {
764
+ key: "default",
765
+ fn: function (scope) {
766
+ return [
767
+ _vm._t("default", null, {
768
+ item: scope.item,
769
+ index: scope.index,
770
+ org: scope.org,
771
+ }),
772
+ ]
773
+ },
774
+ },
775
+ ],
776
+ null,
777
+ true
778
+ ),
779
+ })
780
+ }),
781
+ 1
782
+ ),
783
+ ],
784
+ 1
785
+ ),
786
+ ]
787
+ )
788
+ }
789
+ var orgItemvue_type_template_id_3547cd49_staticRenderFns = []
790
+ orgItemvue_type_template_id_3547cd49_render._withStripped = true
791
+
792
+
793
+ // CONCATENATED MODULE: ./packages/org/src/orgItem.vue?vue&type=template&id=3547cd49
794
+
795
+ // EXTERNAL MODULE: external "vuedraggable"
796
+ var external_vuedraggable_ = __webpack_require__(92);
797
+ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_vuedraggable_);
798
+
799
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/orgItem.vue?vue&type=script&lang=js
800
+ //
801
+ //
802
+ //
803
+ //
804
+ //
805
+ //
806
+ //
807
+ //
808
+ //
809
+ //
810
+ //
811
+ //
812
+ //
813
+ //
814
+ //
815
+ //
816
+ //
817
+ //
818
+ //
819
+ //
820
+ //
821
+ //
822
+ //
823
+ //
824
+ //
825
+ //
826
+
827
+
828
+ /* harmony default export */ var orgItemvue_type_script_lang_js = ({
829
+ name: 'ToOrgItem',
830
+ components: {
831
+ draggable: external_vuedraggable_default.a
832
+ },
833
+ componentName: 'ToOrgItem',
834
+ inject: ['org'],
835
+ props: {
836
+ valueText: {
837
+ type: String,
838
+ default: 'value'
839
+ },
840
+ labelText: {
841
+ type: String,
842
+ default: 'label'
843
+ },
844
+ childrenText: {
845
+ type: String,
846
+ default: 'children'
847
+ },
848
+ data: {
849
+ type: Object,
850
+ default: function _default() {}
851
+ },
852
+ index: {
853
+ type: Number,
854
+ default: 0
855
+ }
856
+ }
857
+ });
858
+ // CONCATENATED MODULE: ./packages/org/src/orgItem.vue?vue&type=script&lang=js
859
+ /* harmony default export */ var src_orgItemvue_type_script_lang_js = (orgItemvue_type_script_lang_js);
860
+ // EXTERNAL MODULE: ./packages/org/src/orgItem.vue?vue&type=style&index=0&id=3547cd49&prod&lang=css
861
+ var orgItemvue_type_style_index_0_id_3547cd49_prod_lang_css = __webpack_require__(99);
862
+
863
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
864
+ var componentNormalizer = __webpack_require__(0);
865
+
866
+ // CONCATENATED MODULE: ./packages/org/src/orgItem.vue
867
+
942
868
 
943
- if (childNodes.length) {
944
- style.insertBefore(cssNode, childNodes[index]);
945
- } else {
946
- style.appendChild(cssNode);
947
- }
948
- }
949
- }
950
869
 
951
- function applyToTag(style, options, obj) {
952
- var css = obj.css;
953
- var media = obj.media;
954
- var sourceMap = obj.sourceMap;
955
870
 
956
- if (media) {
957
- style.setAttribute('media', media);
958
- }
959
871
 
960
- if (sourceMap && btoa) {
961
- css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
962
- } // For old IE
963
872
 
964
- /* istanbul ignore if */
873
+ /* normalize component */
965
874
 
875
+ var component = Object(componentNormalizer["a" /* default */])(
876
+ src_orgItemvue_type_script_lang_js,
877
+ orgItemvue_type_template_id_3547cd49_render,
878
+ orgItemvue_type_template_id_3547cd49_staticRenderFns,
879
+ false,
880
+ null,
881
+ null,
882
+ null
883
+
884
+ )
966
885
 
967
- if (style.styleSheet) {
968
- style.styleSheet.cssText = css;
969
- } else {
970
- while (style.firstChild) {
971
- style.removeChild(style.firstChild);
972
- }
886
+ /* harmony default export */ var orgItem = (component.exports);
887
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/org/src/org.vue?vue&type=script&lang=js
888
+ //
889
+ //
890
+ //
891
+ //
892
+ //
893
+ //
894
+ //
895
+ //
896
+ //
897
+ //
898
+ //
973
899
 
974
- style.appendChild(document.createTextNode(css));
975
- }
976
- }
977
900
 
978
- var singleton = null;
979
- var singletonCounter = 0;
980
901
 
981
- function addStyle(obj, options) {
982
- var style;
983
- var update;
984
- var remove;
985
902
 
986
- if (options.singleton) {
987
- var styleIndex = singletonCounter++;
988
- style = singleton || (singleton = insertStyleElement(options));
989
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
990
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
991
- } else {
992
- style = insertStyleElement(options);
993
- update = applyToTag.bind(null, style, options);
903
+ external_vue_default.a.component('ToOrgItem', orgItem);
904
+ /* harmony default export */ var orgvue_type_script_lang_js = ({
905
+ name: 'ToOrg',
906
+ componentName: 'ToOrg',
907
+ provide: function provide() {
908
+ return {
909
+ org: this
910
+ };
911
+ },
994
912
 
995
- remove = function remove() {
996
- removeStyleElement(style);
997
- };
998
- }
913
+ props: {
914
+ dragable: Boolean,
915
+ valueText: {
916
+ type: String,
917
+ default: 'value'
918
+ },
919
+ labelText: {
920
+ type: String,
921
+ default: 'label'
922
+ },
923
+ childrenText: {
924
+ type: String,
925
+ default: 'children'
926
+ },
927
+ leafMode: {
928
+ type: String,
929
+ default: ''
930
+ },
931
+ data: {
932
+ type: Object,
933
+ default: function _default() {}
934
+ }
935
+ },
936
+ data: function data() {
937
+ return {
938
+ from: '',
939
+ id: 'org_' + uuid(),
940
+ iData: {},
941
+ deeps: [],
942
+ deep: 0
943
+ };
944
+ },
999
945
 
1000
- update(obj);
1001
- return function updateStyle(newObj) {
1002
- if (newObj) {
1003
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
1004
- return;
1005
- }
946
+ computed: {
947
+ setClass: function setClass() {
948
+ var arr = [];
949
+ if (this.leafMode) {
950
+ arr.push('to-org-leaf-mode-' + this.leafMode);
951
+ }
952
+ if (this.dragable) {
953
+ arr.push('to-org-dragable');
954
+ }
955
+ return arr;
956
+ }
957
+ },
958
+ watch: {
959
+ data: {
960
+ handler: function handler() {
961
+ this.initData(this.data);
962
+ },
1006
963
 
1007
- update(obj = newObj);
1008
- } else {
1009
- remove();
1010
- }
1011
- };
1012
- }
964
+ immediate: true,
965
+ deep: true
966
+ }
967
+ },
968
+ methods: {
969
+ initData: function initData(data) {
970
+ var self = this;
971
+ this.iData = JSON.parse(JSON.stringify(data));
972
+ this.iData.level = 0;
973
+ function set(arr) {
974
+ var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1013
975
 
1014
- module.exports = function (list, options) {
1015
- options = options || {};
1016
- options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
1017
- // tags it will allow on a page
976
+ arr.map(function (item) {
977
+ item.level = i;
978
+ if (item[self.childrenText] && item[self.childrenText].length > 0) {
979
+ self.deeps.push(i + 1);
980
+ set(item[self.childrenText], i + 1);
981
+ } else {
982
+ item[self.childrenText] = [];
983
+ }
984
+ });
985
+ }
986
+ if (this.iData[self.childrenText]) {
987
+ set(this.iData[self.childrenText]);
988
+ }
989
+ this.deep = this.deeps.sort()[this.deeps.length - 1];
990
+ },
991
+ dragStart: function dragStart(e) {
992
+ this.from = document.getElementById(e.clone.id).parentNode.dataset.value;
993
+ },
994
+ dragAdd: function dragAdd(e) {
995
+ var _this = this;
1018
996
 
1019
- if (!options.singleton && typeof options.singleton !== 'boolean') {
1020
- options.singleton = isOldIE();
1021
- }
997
+ this.initData(this.iData);
1022
998
 
1023
- var styles = listToStyles(list, options);
1024
- addStylesToDom(styles, options);
1025
- return function update(newList) {
1026
- var mayRemove = [];
999
+ // vuedraggable bug:
1000
+ // 从左往右拖动到同级节点之下,因为 DOM 发生变化导致判断错误,form/to 的值都不正确了,因此通过获取当前节点 id,向上寻找 parentNode 的方式来获取 from/to
1001
+ this.$nextTick(function () {
1002
+ _this.$emit('drag', _this.from, document.getElementById(e.clone.id).parentNode.dataset.value, e.clone.dataset.value);
1003
+ });
1004
+ }
1005
+ }
1006
+ });
1007
+ // CONCATENATED MODULE: ./packages/org/src/org.vue?vue&type=script&lang=js
1008
+ /* harmony default export */ var src_orgvue_type_script_lang_js = (orgvue_type_script_lang_js);
1009
+ // CONCATENATED MODULE: ./packages/org/src/org.vue
1027
1010
 
1028
- for (var i = 0; i < styles.length; i++) {
1029
- var item = styles[i];
1030
- var domStyle = stylesInDom[item.id];
1031
1011
 
1032
- if (domStyle) {
1033
- domStyle.refs--;
1034
- mayRemove.push(domStyle);
1035
- }
1036
- }
1037
1012
 
1038
- if (newList) {
1039
- var newStyles = listToStyles(newList, options);
1040
- addStylesToDom(newStyles, options);
1041
- }
1042
1013
 
1043
- for (var _i = 0; _i < mayRemove.length; _i++) {
1044
- var _domStyle = mayRemove[_i];
1045
1014
 
1046
- if (_domStyle.refs === 0) {
1047
- for (var j = 0; j < _domStyle.parts.length; j++) {
1048
- _domStyle.parts[j]();
1049
- }
1015
+ /* normalize component */
1050
1016
 
1051
- delete stylesInDom[_domStyle.id];
1052
- }
1053
- }
1054
- };
1017
+ var org_component = Object(componentNormalizer["a" /* default */])(
1018
+ src_orgvue_type_script_lang_js,
1019
+ render,
1020
+ staticRenderFns,
1021
+ false,
1022
+ null,
1023
+ null,
1024
+ null
1025
+
1026
+ )
1027
+
1028
+ /* harmony default export */ var org = (org_component.exports);
1029
+ // CONCATENATED MODULE: ./packages/org/index.js
1030
+
1031
+
1032
+ /* istanbul ignore next */
1033
+ org.install = function (Vue) {
1034
+ Vue.component(org.name, org);
1055
1035
  };
1056
1036
 
1037
+ /* harmony default export */ var packages_org = __webpack_exports__["default"] = (org);
1038
+
1039
+ /***/ }),
1040
+
1041
+ /***/ 4:
1042
+ /***/ (function(module, exports) {
1043
+
1044
+ module.exports = require("vue");
1045
+
1057
1046
  /***/ }),
1058
1047
 
1059
- /***/ 93:
1048
+ /***/ 92:
1060
1049
  /***/ (function(module, exports) {
1061
1050
 
1062
1051
  module.exports = require("vuedraggable");
1063
1052
 
1053
+ /***/ }),
1054
+
1055
+ /***/ 99:
1056
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1057
+
1058
+ "use strict";
1059
+ /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
1060
+ /* harmony import */ var _node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_orgItem_vue_vue_type_style_index_0_id_3547cd49_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
1061
+ /* unused harmony reexport * */
1062
+
1063
+
1064
1064
  /***/ })
1065
1065
 
1066
1066
  /******/ });