vxe-pc-ui 3.0.5 → 3.0.7

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 (81) hide show
  1. package/es/drawer/src/drawer.js +5 -2
  2. package/es/drawer/style.css +0 -20
  3. package/es/drawer/style.min.css +1 -1
  4. package/es/icon/style.css +1 -1
  5. package/es/link/src/link.js +10 -0
  6. package/es/modal/src/modal.js +5 -2
  7. package/es/modal/style.css +0 -20
  8. package/es/modal/style.min.css +1 -1
  9. package/es/style.css +1 -1
  10. package/es/style.min.css +1 -1
  11. package/es/tabs/src/tabs.js +83 -16
  12. package/es/tabs/style.css +6 -1
  13. package/es/tabs/style.min.css +1 -1
  14. package/es/tag/src/tag.js +7 -0
  15. package/es/ui/index.js +3 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-drawer/style.css +0 -20
  18. package/es/vxe-drawer/style.min.css +1 -1
  19. package/es/vxe-modal/style.css +0 -20
  20. package/es/vxe-modal/style.min.css +1 -1
  21. package/es/vxe-tabs/style.css +6 -1
  22. package/es/vxe-tabs/style.min.css +1 -1
  23. package/helper/vetur/attributes.json +1 -1
  24. package/helper/vetur/tags.json +1 -1
  25. package/lib/drawer/src/drawer.js +8 -2
  26. package/lib/drawer/src/drawer.min.js +1 -1
  27. package/lib/drawer/style/style.css +0 -20
  28. package/lib/drawer/style/style.min.css +1 -1
  29. package/lib/icon/style/style.css +1 -1
  30. package/lib/icon/style/style.min.css +1 -1
  31. package/lib/index.umd.js +136 -21
  32. package/lib/index.umd.min.js +1 -1
  33. package/lib/link/src/link.js +10 -0
  34. package/lib/link/src/link.min.js +1 -1
  35. package/lib/modal/src/modal.js +8 -2
  36. package/lib/modal/src/modal.min.js +1 -1
  37. package/lib/modal/style/style.css +0 -20
  38. package/lib/modal/style/style.min.css +1 -1
  39. package/lib/style.css +1 -1
  40. package/lib/style.min.css +1 -1
  41. package/lib/tabs/src/tabs.js +96 -15
  42. package/lib/tabs/src/tabs.min.js +1 -1
  43. package/lib/tabs/style/style.css +6 -1
  44. package/lib/tabs/style/style.min.css +1 -1
  45. package/lib/tag/src/tag.js +7 -0
  46. package/lib/tag/src/tag.min.js +1 -1
  47. package/lib/ui/index.js +3 -1
  48. package/lib/ui/index.min.js +1 -1
  49. package/lib/ui/src/log.js +1 -1
  50. package/lib/ui/src/log.min.js +1 -1
  51. package/lib/vxe-drawer/style/style.css +0 -20
  52. package/lib/vxe-drawer/style/style.min.css +1 -1
  53. package/lib/vxe-modal/style/style.css +0 -20
  54. package/lib/vxe-modal/style/style.min.css +1 -1
  55. package/lib/vxe-tabs/style/style.css +6 -1
  56. package/lib/vxe-tabs/style/style.min.css +1 -1
  57. package/package.json +1 -1
  58. package/packages/drawer/src/drawer.ts +5 -2
  59. package/packages/link/src/link.ts +12 -0
  60. package/packages/modal/src/modal.ts +5 -2
  61. package/packages/tabs/src/tabs.ts +90 -16
  62. package/packages/tag/src/tag.ts +9 -0
  63. package/packages/ui/index.ts +2 -0
  64. package/styles/components/drawer.scss +0 -18
  65. package/styles/components/modal.scss +0 -18
  66. package/styles/components/tabs.scss +5 -1
  67. package/types/components/tabs.d.ts +76 -2
  68. package/types/ui/global-icon.d.ts +2 -0
  69. package/types/ui/renderer.d.ts +1 -14
  70. /package/es/icon/style/{iconfont.1725977151258.ttf → iconfont.1726043455850.ttf} +0 -0
  71. /package/es/icon/style/{iconfont.1725977151258.woff → iconfont.1726043455850.woff} +0 -0
  72. /package/es/icon/style/{iconfont.1725977151258.woff2 → iconfont.1726043455850.woff2} +0 -0
  73. /package/es/{iconfont.1725977151258.ttf → iconfont.1726043455850.ttf} +0 -0
  74. /package/es/{iconfont.1725977151258.woff → iconfont.1726043455850.woff} +0 -0
  75. /package/es/{iconfont.1725977151258.woff2 → iconfont.1726043455850.woff2} +0 -0
  76. /package/lib/icon/style/{iconfont.1725977151258.ttf → iconfont.1726043455850.ttf} +0 -0
  77. /package/lib/icon/style/{iconfont.1725977151258.woff → iconfont.1726043455850.woff} +0 -0
  78. /package/lib/icon/style/{iconfont.1725977151258.woff2 → iconfont.1726043455850.woff2} +0 -0
  79. /package/lib/{iconfont.1725977151258.ttf → iconfont.1726043455850.ttf} +0 -0
  80. /package/lib/{iconfont.1725977151258.woff → iconfont.1726043455850.woff} +0 -0
  81. /package/lib/{iconfont.1725977151258.woff2 → iconfont.1726043455850.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -12573,7 +12573,7 @@ function handleBooleanDefaultValue(value) {
12573
12573
  }
12574
12574
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
12575
12575
 
12576
- var log_version = "ui v".concat("3.0.5");
12576
+ var log_version = "ui v".concat("3.0.7");
12577
12577
  var warnLog = log.create('warn', log_version);
12578
12578
  var errLog = log.create('error', log_version);
12579
12579
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
@@ -12581,7 +12581,7 @@ var errLog = log.create('error', log_version);
12581
12581
 
12582
12582
 
12583
12583
 
12584
- var ui_version = "3.0.5";
12584
+ var ui_version = "3.0.7";
12585
12585
  core_VxeUI.version = ui_version;
12586
12586
  core_VxeUI.uiVersion = ui_version;
12587
12587
  core_VxeUI.tableVersion = '';
@@ -12976,6 +12976,8 @@ setIcon({
12976
12976
  TABS_TAB_BUTTON_LEFT: iconPrefix + 'arrow-left',
12977
12977
  TABS_TAB_BUTTON_RIGHT: iconPrefix + 'arrow-right',
12978
12978
  TABS_TAB_CLOSE: iconPrefix + 'close',
12979
+ TABS_TAB_REFRESH: iconPrefix + 'refresh',
12980
+ TABS_TAB_REFRESH_LOADING: iconPrefix + 'refresh roll',
12979
12981
  // text
12980
12982
  TEXT_COPY: iconPrefix + 'copy',
12981
12983
  TEXT_LOADING: iconPrefix + 'spinner roll',
@@ -20986,7 +20988,11 @@ var allActiveDrawers = [];
20986
20988
  if (lastDrawer) {
20987
20989
  setTimeout(function () {
20988
20990
  if (lastDrawer === $xeDrawer && lastDrawer.escClosable) {
20989
- $xeDrawer.closeDrawer('exit');
20991
+ var type = 'exit';
20992
+ $xeDrawer.dispatchEvent('close', {
20993
+ type: type
20994
+ }, evnt);
20995
+ $xeDrawer.closeDrawer(type);
20990
20996
  }
20991
20997
  }, 10);
20992
20998
  }
@@ -21096,7 +21102,8 @@ var allActiveDrawers = [];
21096
21102
  var _props$slots4 = props.slots,
21097
21103
  propSlots = _props$slots4 === void 0 ? {} : _props$slots4,
21098
21104
  showCancelButton = props.showCancelButton,
21099
- showConfirmButton = props.showConfirmButton;
21105
+ showConfirmButton = props.showConfirmButton,
21106
+ loading = props.loading;
21100
21107
  var lfSlot = slots.leftfoot || propSlots.leftfoot;
21101
21108
  var rfSlot = slots.rightfoot || propSlots.rightfoot;
21102
21109
  var btnVNs = [];
@@ -21118,6 +21125,7 @@ var allActiveDrawers = [];
21118
21125
  ref: 'refConfirmBtn',
21119
21126
  props: {
21120
21127
  status: 'primary',
21128
+ loading: loading,
21121
21129
  content: props.confirmButtonText || getI18n('vxe.button.confirm')
21122
21130
  },
21123
21131
  on: {
@@ -29256,6 +29264,10 @@ var es_string_link = __webpack_require__(778);
29256
29264
  $link: $xeLink
29257
29265
  }, params));
29258
29266
  },
29267
+ clickEvent: function clickEvent(evnt) {
29268
+ var $xeLink = this;
29269
+ $xeLink.dispatchEvent('click', {}, evnt);
29270
+ },
29259
29271
  //
29260
29272
  // Render
29261
29273
  //
@@ -29297,6 +29309,9 @@ var es_string_link = __webpack_require__(778);
29297
29309
  title: title,
29298
29310
  target: target,
29299
29311
  to: routerLink
29312
+ },
29313
+ on: {
29314
+ click: $xeLink.clickEvent
29300
29315
  }
29301
29316
  }, $xeLink.renderContent(h));
29302
29317
  }
@@ -29307,6 +29322,9 @@ var es_string_link = __webpack_require__(778);
29307
29322
  href: href,
29308
29323
  target: target,
29309
29324
  title: title
29325
+ },
29326
+ on: {
29327
+ click: $xeLink.clickEvent
29310
29328
  }
29311
29329
  }, $xeLink.renderContent(h));
29312
29330
  }
@@ -31042,7 +31060,11 @@ var lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
31042
31060
  if (lastModal) {
31043
31061
  setTimeout(function () {
31044
31062
  if (lastModal === $xeModal && lastModal.escClosable) {
31045
- $xeModal.closeModal('exit');
31063
+ var type = 'exit';
31064
+ $xeModal.dispatchEvent('close', {
31065
+ type: type
31066
+ }, evnt);
31067
+ $xeModal.closeModal(type);
31046
31068
  }
31047
31069
  }, 10);
31048
31070
  }
@@ -31495,7 +31517,8 @@ var lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
31495
31517
  propSlots = _props$slots4 === void 0 ? {} : _props$slots4,
31496
31518
  showCancelButton = props.showCancelButton,
31497
31519
  showConfirmButton = props.showConfirmButton,
31498
- type = props.type;
31520
+ type = props.type,
31521
+ loading = props.loading;
31499
31522
  var lfSlot = slots.leftfoot || propSlots.leftfoot;
31500
31523
  var rfSlot = slots.rightfoot || propSlots.rightfoot;
31501
31524
  var btnVNs = [];
@@ -31517,6 +31540,7 @@ var lockScrollCssWidthKey = '--vxe-ui-modal-lock-scroll-view-width';
31517
31540
  ref: 'refConfirmBtn',
31518
31541
  props: {
31519
31542
  status: 'primary',
31543
+ loading: loading,
31520
31544
  content: props.confirmButtonText || getI18n('vxe.button.confirm')
31521
31545
  },
31522
31546
  on: {
@@ -37538,6 +37562,10 @@ var TabPane = VxeTabPane;
37538
37562
 
37539
37563
 
37540
37564
 
37565
+
37566
+
37567
+
37568
+
37541
37569
 
37542
37570
 
37543
37571
  /* harmony default export */ var tabs = (defineVxeComponent({
@@ -37559,6 +37587,9 @@ var TabPane = VxeTabPane;
37559
37587
  },
37560
37588
  trigger: String,
37561
37589
  beforeChangeMethod: Function,
37590
+ closeConfig: Object,
37591
+ refreshConfig: Object,
37592
+ // 已废弃
37562
37593
  beforeCloseMethod: Function
37563
37594
  },
37564
37595
  inject: {
@@ -37582,7 +37613,8 @@ var TabPane = VxeTabPane;
37582
37613
  lintLeft: 0,
37583
37614
  lintWidth: 0,
37584
37615
  isTabOver: false,
37585
- resizeFlag: 1
37616
+ resizeFlag: 1,
37617
+ cacheTabMaps: {}
37586
37618
  };
37587
37619
  var internalData = {
37588
37620
  slTimeout: undefined
@@ -37599,6 +37631,16 @@ var TabPane = VxeTabPane;
37599
37631
  var $xeParentTabs = $xeTabs.$xeParentTabs;
37600
37632
  return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null;
37601
37633
  },
37634
+ computeCloseOpts: function computeCloseOpts() {
37635
+ var $xeTabs = this;
37636
+ var props = $xeTabs;
37637
+ return Object.assign({}, getConfig().tabs.closeConfig, props.closeConfig);
37638
+ },
37639
+ computeRefreshOpts: function computeRefreshOpts() {
37640
+ var $xeTabs = this;
37641
+ var props = $xeTabs;
37642
+ return Object.assign({}, getConfig().tabs.refreshConfig, props.refreshConfig);
37643
+ },
37602
37644
  computeTabOptions: function computeTabOptions() {
37603
37645
  var $xeTabs = this;
37604
37646
  var props = $xeTabs;
@@ -37736,15 +37778,24 @@ var TabPane = VxeTabPane;
37736
37778
  var props = $xeTabs;
37737
37779
  var reactData = $xeTabs.reactData;
37738
37780
  var activeName = null;
37781
+ var nameMaps = {};
37739
37782
  if (list && list.length) {
37740
37783
  var validVal = false;
37741
37784
  activeName = props.value;
37742
37785
  list.forEach(function (item) {
37743
- if (activeName === item.name) {
37744
- validVal = true;
37745
- }
37746
- if (item && item.preload) {
37747
- $xeTabs.addInitName(item.name, null);
37786
+ var _ref = item || {},
37787
+ name = _ref.name,
37788
+ preload = _ref.preload;
37789
+ if (name) {
37790
+ nameMaps[name] = {
37791
+ loading: false
37792
+ };
37793
+ if (activeName === name) {
37794
+ validVal = true;
37795
+ }
37796
+ if (preload) {
37797
+ $xeTabs.addInitName(name, null);
37798
+ }
37748
37799
  }
37749
37800
  });
37750
37801
  if (!validVal) {
@@ -37754,6 +37805,7 @@ var TabPane = VxeTabPane;
37754
37805
  }
37755
37806
  }
37756
37807
  reactData.activeName = activeName;
37808
+ reactData.cacheTabMaps = nameMaps;
37757
37809
  },
37758
37810
  clickEvent: function clickEvent(evnt, item) {
37759
37811
  var $xeTabs = this;
@@ -37781,31 +37833,61 @@ var TabPane = VxeTabPane;
37781
37833
  $tabs: $xeTabs,
37782
37834
  name: name,
37783
37835
  oldName: activeName,
37784
- newName: name
37836
+ newName: name,
37837
+ option: item
37785
37838
  })) {
37786
37839
  $xeTabs.dispatchEvent('change', {
37787
37840
  value: value,
37788
37841
  name: name,
37789
37842
  oldName: activeName,
37790
- newName: name
37843
+ newName: name,
37844
+ option: item
37791
37845
  }, evnt);
37792
37846
  } else {
37793
37847
  $xeTabs.dispatchEvent('tab-change-fail', {
37794
37848
  value: value,
37795
37849
  name: name,
37796
37850
  oldName: activeName,
37797
- newName: name
37851
+ newName: name,
37852
+ option: item
37798
37853
  }, evnt);
37799
37854
  }
37800
37855
  }
37801
37856
  },
37857
+ handleRefreshTabEvent: function handleRefreshTabEvent(evnt, item) {
37858
+ var $xeTabs = this;
37859
+ var reactData = $xeTabs.reactData;
37860
+ evnt.stopPropagation();
37861
+ var activeName = reactData.activeName,
37862
+ cacheTabMaps = reactData.cacheTabMaps;
37863
+ var name = item.name;
37864
+ var refreshOpts = $xeTabs.computeRefreshOpts;
37865
+ var queryMethod = refreshOpts.queryMethod;
37866
+ var cacheItem = name ? cacheTabMaps[name] : null;
37867
+ if (cacheItem) {
37868
+ if (queryMethod) {
37869
+ cacheItem.loading = true;
37870
+ Promise.resolve(queryMethod({
37871
+ $tabs: $xeTabs,
37872
+ value: activeName,
37873
+ name: name,
37874
+ option: item
37875
+ })).finally(function () {
37876
+ cacheItem.loading = false;
37877
+ });
37878
+ } else {
37879
+ errLog('vxe.error.notFunc', ['refresh-config.queryMethod']);
37880
+ }
37881
+ }
37882
+ },
37802
37883
  handleCloseTabEvent: function handleCloseTabEvent(evnt, item, index, list) {
37803
37884
  var $xeTabs = this;
37804
37885
  var props = $xeTabs;
37805
37886
  var reactData = $xeTabs.reactData;
37806
37887
  evnt.stopPropagation();
37807
37888
  var activeName = reactData.activeName;
37808
- var beforeMethod = props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
37889
+ var closeOpts = $xeTabs.computeCloseOpts;
37890
+ var beforeMethod = closeOpts.beforeMethod || props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
37809
37891
  var name = item.name;
37810
37892
  var value = activeName;
37811
37893
  var nextName = value;
@@ -37817,7 +37899,8 @@ var TabPane = VxeTabPane;
37817
37899
  $tabs: $xeTabs,
37818
37900
  value: value,
37819
37901
  name: name,
37820
- nextName: nextName
37902
+ nextName: nextName,
37903
+ option: item
37821
37904
  })) {
37822
37905
  $xeTabs.dispatchEvent('tab-close', {
37823
37906
  value: value,
@@ -37962,12 +38045,19 @@ var TabPane = VxeTabPane;
37962
38045
  var type = props.type,
37963
38046
  allTitleWidth = props.titleWidth,
37964
38047
  allTitleAlign = props.titleAlign,
37965
- showClose = props.showClose;
38048
+ showClose = props.showClose,
38049
+ closeConfig = props.closeConfig,
38050
+ refreshConfig = props.refreshConfig;
37966
38051
  var activeName = reactData.activeName,
37967
38052
  lintLeft = reactData.lintLeft,
37968
38053
  lintWidth = reactData.lintWidth,
37969
- isTabOver = reactData.isTabOver;
38054
+ isTabOver = reactData.isTabOver,
38055
+ cacheTabMaps = reactData.cacheTabMaps;
37970
38056
  var extraSlot = slots.extra;
38057
+ var closeOpts = $xeTabs.computeCloseOpts;
38058
+ var closeVisibleMethod = closeOpts.visibleMethod;
38059
+ var refreshOpts = $xeTabs.computeRefreshOpts;
38060
+ var refreshVisibleMethod = refreshOpts.visibleMethod;
37971
38061
  return h('div', {
37972
38062
  class: 'vxe-tabs-header'
37973
38063
  }, [isTabOver ? h('div', {
@@ -37992,10 +38082,19 @@ var TabPane = VxeTabPane;
37992
38082
  var tabSlot = slots ? slots.tab : null;
37993
38083
  var itemWidth = titleWidth || allTitleWidth;
37994
38084
  var itemAlign = titleAlign || allTitleAlign;
38085
+ var params = {
38086
+ $tabs: $xeTabs,
38087
+ value: activeName,
38088
+ name: name,
38089
+ option: item
38090
+ };
38091
+ var isActive = activeName === name;
38092
+ var cacheItem = name ? cacheTabMaps[name] : null;
38093
+ var isLoading = cacheItem ? cacheItem.loading : false;
37995
38094
  return h('div', {
37996
38095
  key: "".concat(name),
37997
38096
  class: ['vxe-tabs-header--item', itemAlign ? "align--".concat(itemAlign) : '', {
37998
- 'is--active': activeName === name
38097
+ 'is--active': isActive
37999
38098
  }],
38000
38099
  style: itemWidth ? {
38001
38100
  width: toCssUnit(itemWidth)
@@ -38018,7 +38117,16 @@ var TabPane = VxeTabPane;
38018
38117
  }, tabSlot ? $xeTabs.callSlot(tabSlot, {
38019
38118
  name: name,
38020
38119
  title: title
38021
- }) : "".concat(title))]), showClose ? h('div', {
38120
+ }) : "".concat(title))]), (isEnableConf(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) : isActive) ? h('div', {
38121
+ class: 'vxe-tabs-header--refresh-btn',
38122
+ on: {
38123
+ click: function click(evnt) {
38124
+ $xeTabs.handleRefreshTabEvent(evnt, item);
38125
+ }
38126
+ }
38127
+ }, [h('i', {
38128
+ class: isLoading ? getIcon().TABS_TAB_REFRESH_LOADING : getIcon().TABS_TAB_REFRESH
38129
+ })]) : renderEmptyElement($xeTabs), (showClose || isEnableConf(closeConfig) || closeOpts.enabled) && (!closeVisibleMethod || closeVisibleMethod(params)) ? h('div', {
38022
38130
  class: 'vxe-tabs-header--close-btn',
38023
38131
  on: {
38024
38132
  click: function click(evnt) {
@@ -38218,6 +38326,10 @@ var Tabs = VxeTabs;
38218
38326
  $tag: $xeTag
38219
38327
  }, params));
38220
38328
  },
38329
+ clickEvent: function clickEvent(evnt) {
38330
+ var $xeTag = this;
38331
+ $xeTag.dispatchEvent('click', {}, evnt);
38332
+ },
38221
38333
  //
38222
38334
  // Render
38223
38335
  //
@@ -38248,6 +38360,9 @@ var Tabs = VxeTabs;
38248
38360
  class: ['vxe-tag', _defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), "theme--".concat(status), status)],
38249
38361
  attrs: {
38250
38362
  title: title
38363
+ },
38364
+ on: {
38365
+ click: $xeTag.clickEvent
38251
38366
  }
38252
38367
  }, $xeTag.renderContent(h));
38253
38368
  }