eoss-mobiles 0.2.45 → 0.2.47

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/lib/grid.js CHANGED
@@ -206,7 +206,7 @@ module.exports = require("vuedraggable");
206
206
  // ESM COMPAT FLAG
207
207
  __webpack_require__.r(__webpack_exports__);
208
208
 
209
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/grid/src/main.vue?vue&type=template&id=3fb10550&
209
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/grid/src/main.vue?vue&type=template&id=16677764&
210
210
  var render = function () {
211
211
  var _vm = this
212
212
  var _h = _vm.$createElement
@@ -226,7 +226,7 @@ var render = function () {
226
226
  "van-grid",
227
227
  _vm._g(
228
228
  _vm._b(
229
- { attrs: { "column-num": _vm.columnNum } },
229
+ { attrs: { border: _vm.border, "column-num": _vm.columnNum } },
230
230
  "van-grid",
231
231
  _vm.$attrs,
232
232
  false
@@ -255,7 +255,7 @@ var render = function () {
255
255
  staticClass: "menu-list-draggable-item",
256
256
  staticStyle: { width: "100%" },
257
257
  },
258
- _vm._l(_vm.newData, function (item, index) {
258
+ _vm._l(_vm.newData, function (item) {
259
259
  return _c(
260
260
  "div",
261
261
  {
@@ -266,9 +266,13 @@ var render = function () {
266
266
  100 / _vm.columnNum +
267
267
  "%",
268
268
  on: {
269
- click: function ($event) {
269
+ mousedown: function ($event) {
270
+ $event.stopPropagation()
271
+ _vm.onMouseDown(item)
272
+ },
273
+ mouseup: function ($event) {
270
274
  $event.stopPropagation()
271
- _vm.goView($event, item)
275
+ _vm.onMouseUp($event, item)
272
276
  },
273
277
  },
274
278
  },
@@ -296,14 +300,6 @@ var render = function () {
296
300
  _vm.$attrs["icon-size"]
297
301
  : "",
298
302
  },
299
- on: {
300
- touchstart: function ($event) {
301
- _vm.touchstart(item, index)
302
- },
303
- touchend: function ($event) {
304
- _vm.touchend(item, index)
305
- },
306
- },
307
303
  },
308
304
  [
309
305
  item.icon.startsWith("http") ||
@@ -357,7 +353,7 @@ var render = function () {
357
353
  },
358
354
  [
359
355
  _vm._v(
360
- "\n " +
356
+ "\n " +
361
357
  _vm._s(
362
358
  _vm.maxBadge &&
363
359
  !isNaN(item.badge) &&
@@ -366,12 +362,27 @@ var render = function () {
366
362
  ? _vm.maxBadge + "+"
367
363
  : item.badge
368
364
  ) +
369
- "\n "
365
+ "\n "
370
366
  ),
371
367
  ]
372
368
  ),
373
369
  ]
374
370
  ),
371
+ _c("em-popover", {
372
+ attrs: {
373
+ placement: _vm.placement,
374
+ theme: _vm.popoverTheme,
375
+ actions: _vm.popoverActions,
376
+ },
377
+ on: { select: _vm.popoverSelect },
378
+ model: {
379
+ value: item.showPopover,
380
+ callback: function ($$v) {
381
+ _vm.$set(item, "showPopover", $$v)
382
+ },
383
+ expression: "item.showPopover",
384
+ },
385
+ }),
375
386
  _c(
376
387
  "span",
377
388
  { staticClass: "van-grid-item__text" },
@@ -417,151 +428,169 @@ var render = function () {
417
428
  1
418
429
  )
419
430
  : _vm._e(),
420
- _vm._l(_vm.newData, function (item, index) {
431
+ _vm._l(_vm.newData, function (item) {
421
432
  return _c(
422
- "van-grid-item",
423
- _vm._b(
424
- {
425
- directives: [
426
- {
427
- name: "show",
428
- rawName: "v-show",
429
- value:
430
- _vm.newData && _vm.newData.length > 0 && !_vm.draggable,
431
- expression: "newData && newData.length > 0 && !draggable",
432
- },
433
- ],
434
- key: index,
435
- class: { "em-grid-ellipsis": _vm.textEllipsis },
436
- style: "width:" + 100 / _vm.columnNum + "%;",
437
- on: {
438
- click: function ($event) {
439
- $event.stopPropagation()
440
- _vm.goView($event, item)
441
- },
433
+ "div",
434
+ {
435
+ directives: [
436
+ {
437
+ name: "show",
438
+ rawName: "v-show",
439
+ value:
440
+ _vm.newData && _vm.newData.length > 0 && !_vm.draggable,
441
+ expression: "newData && newData.length > 0 && !draggable",
442
+ },
443
+ ],
444
+ key: item.id,
445
+ staticClass: "van-grid-item",
446
+ class: { "border-none": !_vm.border },
447
+ style:
448
+ "display: inline-block;width:" + 100 / _vm.columnNum + "%",
449
+ on: {
450
+ click: function ($event) {
451
+ $event.stopPropagation()
452
+ _vm.goView($event, item)
442
453
  },
443
454
  },
444
- "van-grid-item",
445
- item,
446
- false
447
- ),
455
+ },
448
456
  [
449
457
  _c(
450
- "i",
458
+ "div",
451
459
  {
452
- staticClass: "van-icon van-grid-item__icon",
453
- class:
454
- item.icon.startsWith("http") &&
455
- item.icon.indexOf("/") != -1
456
- ? ""
457
- : "van-icon-" + item.icon,
458
- style: {
459
- fontSize:
460
- item.iconSize || _vm.$attrs["icon-size"]
461
- ? item.iconSize || _vm.$attrs["icon-size"]
462
- : "",
463
- },
464
- on: {
465
- touchstart: function ($event) {
466
- _vm.touchstart(item, index)
467
- },
468
- touchend: function ($event) {
469
- _vm.touchend(item, index)
470
- },
471
- },
460
+ staticClass:
461
+ "van-grid-item__content van-grid-item__content--center van-hairline",
472
462
  },
473
463
  [
474
- item.icon.startsWith("http") || item.icon.indexOf("/") != -1
475
- ? _c("img", {
476
- staticClass: "van-icon__image",
477
- style: {
478
- width:
479
- item.iconSize || _vm.$attrs["icon-size"]
480
- ? item.iconSize || _vm.$attrs["icon-size"]
481
- : "",
482
- height:
483
- item.iconSize || _vm.$attrs["icon-size"]
484
- ? item.iconSize || _vm.$attrs["icon-size"]
485
- : "",
486
- },
487
- attrs: { src: item.icon },
488
- })
489
- : _vm._e(),
490
- _c("div", {
491
- directives: [
492
- {
493
- name: "show",
494
- rawName: "v-show",
495
- value: item.dot,
496
- expression: "item.dot",
497
- },
498
- ],
499
- staticClass: "van-info van-info--dot",
500
- style: { background: item.dotColor || "" },
501
- }),
502
464
  _c(
503
- "div",
465
+ "i",
504
466
  {
505
- directives: [
506
- {
507
- name: "show",
508
- rawName: "v-show",
509
- value: item.badge,
510
- expression: "item.badge",
511
- },
512
- ],
513
- staticClass: "van-info",
514
- style: { background: _vm.badgeColor || "" },
467
+ staticClass: "van-icon van-grid-item__icon",
468
+ class:
469
+ item.icon.startsWith("http") &&
470
+ item.icon.indexOf("/") != -1
471
+ ? ""
472
+ : "van-icon-" + item.icon,
473
+ style: {
474
+ fontSize:
475
+ item.iconSize || _vm.$attrs["icon-size"]
476
+ ? item.iconSize || _vm.$attrs["icon-size"]
477
+ : "",
478
+ },
515
479
  },
516
480
  [
517
- _vm._v(
518
- "\n " +
519
- _vm._s(
520
- _vm.maxBadge &&
521
- !isNaN(item.badge) &&
522
- Number(_vm.maxBadge) < Number(item.badge)
523
- ? _vm.maxBadge + "+"
524
- : item.badge
525
- ) +
526
- "\n "
481
+ item.icon.startsWith("http") ||
482
+ item.icon.indexOf("/") != -1
483
+ ? _c("img", {
484
+ staticClass: "van-icon__image",
485
+ style: {
486
+ width:
487
+ item.iconSize || _vm.$attrs["icon-size"]
488
+ ? item.iconSize || _vm.$attrs["icon-size"]
489
+ : "",
490
+ height:
491
+ item.iconSize || _vm.$attrs["icon-size"]
492
+ ? item.iconSize || _vm.$attrs["icon-size"]
493
+ : "",
494
+ },
495
+ attrs: { src: item.icon },
496
+ })
497
+ : _vm._e(),
498
+ _c("div", {
499
+ directives: [
500
+ {
501
+ name: "show",
502
+ rawName: "v-show",
503
+ value: item.dot,
504
+ expression: "item.dot",
505
+ },
506
+ ],
507
+ staticClass: "van-info van-info--dot",
508
+ style: { background: item.dotColor || "" },
509
+ }),
510
+ _c(
511
+ "div",
512
+ {
513
+ directives: [
514
+ {
515
+ name: "show",
516
+ rawName: "v-show",
517
+ value: item.badge,
518
+ expression: "item.badge",
519
+ },
520
+ ],
521
+ staticClass: "van-info",
522
+ style: { background: _vm.badgeColor || "" },
523
+ },
524
+ [
525
+ _vm._v(
526
+ "\n " +
527
+ _vm._s(
528
+ _vm.maxBadge &&
529
+ !isNaN(item.badge) &&
530
+ Number(_vm.maxBadge) < Number(item.badge)
531
+ ? _vm.maxBadge + "+"
532
+ : item.badge
533
+ ) +
534
+ "\n "
535
+ ),
536
+ ]
527
537
  ),
528
538
  ]
529
539
  ),
530
- ]
531
- ),
532
- _c("span", { staticClass: "van-grid-item__text" }, [
533
- _vm._v(_vm._s(item.text)),
534
- ]),
535
- _vm.showHide && item.menuType != "add"
536
- ? _c("van-icon", {
537
- staticClass: "em-grid-del",
538
- attrs: { name: "clear", size: "20px" },
540
+ _c("em-popover", {
541
+ attrs: {
542
+ placement: _vm.placement,
543
+ theme: _vm.popoverTheme,
544
+ actions: _vm.popoverActions,
545
+ },
539
546
  on: {
540
- click: function ($event) {
541
- $event.stopPropagation()
542
- _vm.handleHide(item)
547
+ select: function ($event) {
548
+ _vm.popoverSelect($event, item)
543
549
  },
544
550
  },
545
- })
546
- : _vm._e(),
547
- item.showMenu
548
- ? _c(
549
- "div",
550
- { staticClass: "em-grid-select-box" },
551
- [
552
- _c("van-icon", {
553
- attrs: {
554
- size: "30px",
555
- color: "#fff",
556
- name: "success",
551
+ model: {
552
+ value: item.showPopover,
553
+ callback: function ($$v) {
554
+ _vm.$set(item, "showPopover", $$v)
555
+ },
556
+ expression: "item.showPopover",
557
+ },
558
+ }),
559
+ _c("span", { staticClass: "van-grid-item__text" }, [
560
+ _vm._v(_vm._s(item.text)),
561
+ ]),
562
+ _vm.showHide && item.menuType != "add"
563
+ ? _c("van-icon", {
564
+ staticClass: "em-grid-del",
565
+ attrs: { name: "clear", size: "20px" },
566
+ on: {
567
+ click: function ($event) {
568
+ $event.stopPropagation()
569
+ _vm.handleHide(item)
570
+ },
557
571
  },
558
- }),
559
- ],
560
- 1
561
- )
562
- : _vm._e(),
563
- ],
564
- 1
572
+ })
573
+ : _vm._e(),
574
+ item.showMenu
575
+ ? _c(
576
+ "div",
577
+ { staticClass: "em-grid-select-box" },
578
+ [
579
+ _c("van-icon", {
580
+ attrs: {
581
+ size: "30px",
582
+ color: "#fff",
583
+ name: "success",
584
+ },
585
+ }),
586
+ ],
587
+ 1
588
+ )
589
+ : _vm._e(),
590
+ ],
591
+ 1
592
+ ),
593
+ ]
565
594
  )
566
595
  }),
567
596
  _vm._t("default"),
@@ -649,7 +678,7 @@ var staticRenderFns = []
649
678
  render._withStripped = true
650
679
 
651
680
 
652
- // CONCATENATED MODULE: ./packages/grid/src/main.vue?vue&type=template&id=3fb10550&
681
+ // CONCATENATED MODULE: ./packages/grid/src/main.vue?vue&type=template&id=16677764&
653
682
 
654
683
  // EXTERNAL MODULE: external "vuedraggable"
655
684
  var external_vuedraggable_ = __webpack_require__(10);
@@ -810,6 +839,70 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
810
839
  //
811
840
  //
812
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
+ //
888
+ //
889
+ //
890
+ //
891
+ //
892
+ //
893
+ //
894
+ //
895
+ //
896
+ //
897
+ //
898
+ //
899
+ //
900
+ //
901
+ //
902
+ //
903
+ //
904
+ //
905
+ //
813
906
 
814
907
 
815
908
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
@@ -868,15 +961,38 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
868
961
  draggable: {
869
962
  type: Boolean,
870
963
  default: false
964
+ },
965
+ popoverActions: {
966
+ type: Array,
967
+ default: function _default() {
968
+ return [{ text: '隐藏菜单', type: 'hideMenu' }];
969
+ }
970
+ },
971
+ isTouch: {
972
+ type: Boolean,
973
+ default: false
974
+ },
975
+ placement: {
976
+ type: String,
977
+ default: 'top'
978
+ },
979
+ popoverTheme: {
980
+ type: String,
981
+ default: 'dark'
982
+ },
983
+ border: {
984
+ type: Boolean,
985
+ default: true
871
986
  }
872
987
  },
873
988
  data: function data() {
874
989
  return {
875
- lastTapTime: 0,
876
990
  timer: null,
877
991
  showHide: false,
992
+ isLongPress: false,
878
993
  newData: [],
879
994
  show: false,
995
+ showPopover: false,
880
996
  selectMenuArr: [],
881
997
  hideMenuList: []
882
998
  };
@@ -902,31 +1018,56 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
902
1018
  }
903
1019
  },
904
1020
  methods: {
905
- touchstart: function touchstart(val, inexd) {
906
- console.log('点击了了');
1021
+ popoverSelect: function popoverSelect(val, item) {
1022
+ if (val.type == 'hideMenu') {
1023
+ this.handleHide(item);
1024
+ } else {
1025
+ this.$emit('touchSelect', { action: val, data: item });
1026
+ }
907
1027
  },
908
- touchend: function touchend(val, a) {
909
- console.log('松开了');
1028
+ onMouseDown: function onMouseDown(item) {
1029
+ var _this = this;
1030
+
1031
+ // this.showPopover = true
1032
+ if (this.draggable || !this.isTouch) return;
1033
+ this.isLongPress = false;
1034
+ this.timer = setTimeout(function () {
1035
+ if (_this.isLongPress === false) {
1036
+ _this.isLongPress = true;
1037
+ _this.lastTapTime = new Date().getTime();
1038
+ _this.$set(item, 'showPopover', true);
1039
+ }
1040
+ }, 500);
1041
+ },
1042
+ onMouseUp: function onMouseUp($event, item) {
1043
+ if (this.isLongPress === false) {
1044
+ this.lastTapTime = new Date().getTime();
1045
+ this.$set(item, 'showPopover', false);
1046
+ this.goView($event, item);
1047
+ // 执行相应的操作
1048
+ }
1049
+ this.isLongPress = false;
1050
+ clearTimeout(this.timer);
910
1051
  },
911
1052
  hideDelIcon: function hideDelIcon() {
912
1053
  this.showHide = false;
913
1054
  },
914
1055
  handleShowMenu: function handleShowMenu() {
915
- var _this = this;
1056
+ var _this2 = this;
916
1057
 
917
1058
  var str = this.selectMenuArr;
918
1059
  // let str = this.selectMenuArr.join(',');
919
1060
  if (Array.isArray(this.hideMenu)) {
920
1061
  var hideArr = this.hideMenuList.filter(function (x) {
921
- return str.indexOf(x[_this.hideMenuKey]) == -1;
1062
+ return str.indexOf(x[_this2.hideMenuKey]) == -1;
922
1063
  });
923
1064
  this.$emit('hide', hideArr);
924
1065
  } else {
925
1066
  var hide = this.hideMenuList.filter(function (x) {
926
- return str.indexOf(x[_this.hideMenuKey]) == -1;
1067
+ return str.indexOf(x[_this2.hideMenuKey]) == -1;
927
1068
  });
928
1069
  hide = hide.map(function (x) {
929
- return x[_this.hideMenuKey];
1070
+ return x[_this2.hideMenuKey];
930
1071
  });
931
1072
  this.$emit('hide', hide.join(','));
932
1073
  }
@@ -934,11 +1075,11 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
934
1075
  this.show = false;
935
1076
  },
936
1077
  selectMenu: function selectMenu(val) {
937
- var _this2 = this;
1078
+ var _this3 = this;
938
1079
 
939
1080
  if (val.showMenu) {
940
1081
  this.selectMenuArr = this.selectMenuArr.filter(function (x) {
941
- return x != val[_this2.hideMenuKey];
1082
+ return x != val[_this3.hideMenuKey];
942
1083
  });
943
1084
  } else {
944
1085
  this.selectMenuArr.push(val[this.hideMenuKey]);
@@ -946,7 +1087,7 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
946
1087
  this.$set(val, 'showMenu', !val.showMenu);
947
1088
  },
948
1089
  defaultHide: function defaultHide(val) {
949
- var _this3 = this;
1090
+ var _this4 = this;
950
1091
 
951
1092
  if (this.isHideMenu && val != undefined) {
952
1093
  if (Array.isArray(val)) {
@@ -955,18 +1096,18 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
955
1096
  });
956
1097
  // let menuKey = val.map(x => x.id).join(',');
957
1098
  this.newData = this.data.filter(function (x) {
958
- return menuKey.indexOf(x[_this3.hideMenuKey]) == -1;
1099
+ return menuKey.indexOf(x[_this4.hideMenuKey]) == -1;
959
1100
  });
960
1101
  this.hideMenuList = this.data.filter(function (x) {
961
- return menuKey.indexOf(x[_this3.hideMenuKey]) != -1;
1102
+ return menuKey.indexOf(x[_this4.hideMenuKey]) != -1;
962
1103
  });
963
1104
  } else {
964
1105
  val = val + '';
965
1106
  this.newData = this.data.filter(function (x) {
966
- return val.indexOf(x[_this3.hideMenuKey]) == -1;
1107
+ return val.indexOf(x[_this4.hideMenuKey]) == -1;
967
1108
  });
968
1109
  this.hideMenuList = this.data.filter(function (x) {
969
- return val.indexOf(x[_this3.hideMenuKey]) != -1;
1110
+ return val.indexOf(x[_this4.hideMenuKey]) != -1;
970
1111
  });
971
1112
  }
972
1113
  }
@@ -979,22 +1120,22 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
979
1120
  }
980
1121
  },
981
1122
  handleHide: function handleHide(item) {
982
- var _this4 = this;
1123
+ var _this5 = this;
983
1124
 
984
1125
  this.$dialog.confirm({
985
1126
  message: '\u786E\u5B9A\u8981\u9690\u85CF<span style="color:red;font-weight:bold;margin:0px 5px">' + item.text + '</span>\u83DC\u5355\u5417\uFF1F'
986
1127
  }).then(function () {
987
- if (Array.isArray(_this4.hideMenu)) {
988
- var hideArr = [].concat(_this4.hideMenu, [item]);
989
- _this4.$emit('hide', hideArr);
1128
+ if (Array.isArray(_this5.hideMenu)) {
1129
+ var hideArr = [].concat(_this5.hideMenu, [item]);
1130
+ _this5.$emit('hide', hideArr);
990
1131
  } else {
991
- var hideStr = _this4.hideMenu ? _this4.hideMenu + ',' + item[_this4.hideMenuKey] : item[_this4.hideMenuKey];
992
- _this4.$emit('hide', hideStr);
1132
+ var hideStr = _this5.hideMenu ? _this5.hideMenu + ',' + item[_this5.hideMenuKey] : item[_this5.hideMenuKey];
1133
+ _this5.$emit('hide', hideStr);
993
1134
  }
994
1135
  });
995
1136
  },
996
1137
  goView: function goView(event, val) {
997
- var _this5 = this;
1138
+ var _this6 = this;
998
1139
 
999
1140
  if (val.menuType === 'add') {
1000
1141
  this.show = true;
@@ -1003,6 +1144,9 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
1003
1144
  var currentTime = new Date().getTime();
1004
1145
  var tapLength = currentTime - this.lastTapTime;
1005
1146
  this.lastTapTime = currentTime;
1147
+ // if (tapLength > 300) {
1148
+ // return;
1149
+ // }
1006
1150
  if (this.isHideMenu) {
1007
1151
  if (tapLength < 300) {
1008
1152
  this.handleDoubleClick(val);
@@ -1014,8 +1158,8 @@ var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_
1014
1158
  return;
1015
1159
  }
1016
1160
  this.timer = setTimeout(function () {
1017
- _this5.$emit('click', val, event);
1018
- _this5.targetStop && event.stopPropagation();
1161
+ _this6.$emit('click', val, event);
1162
+ _this6.targetStop && event.stopPropagation();
1019
1163
  }, 300);
1020
1164
  } else {
1021
1165
  this.$emit('click', val, event);