vxe-pc-ui 3.0.4 → 3.0.6

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 (63) hide show
  1. package/es/drawer/style.css +0 -20
  2. package/es/drawer/style.min.css +1 -1
  3. package/es/icon/style.css +1 -1
  4. package/es/modal/style.css +0 -20
  5. package/es/modal/style.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/tabs/src/tabs.js +83 -16
  9. package/es/tabs/style.css +6 -1
  10. package/es/tabs/style.min.css +1 -1
  11. package/es/ui/index.js +3 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-drawer/style.css +0 -20
  14. package/es/vxe-drawer/style.min.css +1 -1
  15. package/es/vxe-modal/style.css +0 -20
  16. package/es/vxe-modal/style.min.css +1 -1
  17. package/es/vxe-tabs/style.css +6 -1
  18. package/es/vxe-tabs/style.min.css +1 -1
  19. package/lib/drawer/style/style.css +0 -20
  20. package/lib/drawer/style/style.min.css +1 -1
  21. package/lib/icon/style/style.css +1 -1
  22. package/lib/icon/style/style.min.css +1 -1
  23. package/lib/index.umd.js +158 -50
  24. package/lib/index.umd.min.js +1 -1
  25. package/lib/modal/style/style.css +0 -20
  26. package/lib/modal/style/style.min.css +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/tabs/src/tabs.js +96 -15
  30. package/lib/tabs/src/tabs.min.js +1 -1
  31. package/lib/tabs/style/style.css +6 -1
  32. package/lib/tabs/style/style.min.css +1 -1
  33. package/lib/ui/index.js +3 -1
  34. package/lib/ui/index.min.js +1 -1
  35. package/lib/ui/src/log.js +1 -1
  36. package/lib/ui/src/log.min.js +1 -1
  37. package/lib/vxe-drawer/style/style.css +0 -20
  38. package/lib/vxe-drawer/style/style.min.css +1 -1
  39. package/lib/vxe-modal/style/style.css +0 -20
  40. package/lib/vxe-modal/style/style.min.css +1 -1
  41. package/lib/vxe-tabs/style/style.css +6 -1
  42. package/lib/vxe-tabs/style/style.min.css +1 -1
  43. package/package.json +2 -2
  44. package/packages/tabs/src/tabs.ts +90 -16
  45. package/packages/ui/index.ts +2 -0
  46. package/styles/components/drawer.scss +0 -18
  47. package/styles/components/modal.scss +0 -18
  48. package/styles/components/tabs.scss +5 -1
  49. package/types/components/table.d.ts +4 -1
  50. package/types/components/tabs.d.ts +76 -2
  51. package/types/ui/global-icon.d.ts +2 -0
  52. /package/es/icon/style/{iconfont.1725973675342.ttf → iconfont.1726028460484.ttf} +0 -0
  53. /package/es/icon/style/{iconfont.1725973675342.woff → iconfont.1726028460484.woff} +0 -0
  54. /package/es/icon/style/{iconfont.1725973675342.woff2 → iconfont.1726028460484.woff2} +0 -0
  55. /package/es/{iconfont.1725973675342.ttf → iconfont.1726028460484.ttf} +0 -0
  56. /package/es/{iconfont.1725973675342.woff → iconfont.1726028460484.woff} +0 -0
  57. /package/es/{iconfont.1725973675342.woff2 → iconfont.1726028460484.woff2} +0 -0
  58. /package/lib/icon/style/{iconfont.1725973675342.ttf → iconfont.1726028460484.ttf} +0 -0
  59. /package/lib/icon/style/{iconfont.1725973675342.woff → iconfont.1726028460484.woff} +0 -0
  60. /package/lib/icon/style/{iconfont.1725973675342.woff2 → iconfont.1726028460484.woff2} +0 -0
  61. /package/lib/{iconfont.1725973675342.ttf → iconfont.1726028460484.ttf} +0 -0
  62. /package/lib/{iconfont.1725973675342.woff → iconfont.1726028460484.woff} +0 -0
  63. /package/lib/{iconfont.1725973675342.woff2 → iconfont.1726028460484.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -10576,6 +10576,8 @@ var es_regexp_test = __webpack_require__(906);
10576
10576
 
10577
10577
 
10578
10578
 
10579
+ var winDom = null;
10580
+ var bodyEl = null;
10579
10581
  var storeEl = null;
10580
10582
  var storeId = 'z-index-manage';
10581
10583
  var styleEl = null;
@@ -10586,19 +10588,34 @@ var storeData = {
10586
10588
  m: 1000,
10587
10589
  s: 1000
10588
10590
  };
10589
- function isDocument() {
10590
- return typeof document !== 'undefined';
10591
+ function getDocument() {
10592
+ if (!winDom) {
10593
+ if (typeof document !== 'undefined') {
10594
+ winDom = document;
10595
+ }
10596
+ }
10597
+ return winDom;
10598
+ }
10599
+ function getBody() {
10600
+ if (winDom && !bodyEl) {
10601
+ bodyEl = winDom.body || winDom.getElementsByTagName('body')[0];
10602
+ }
10603
+ return bodyEl;
10591
10604
  }
10592
10605
  function getDomMaxZIndex() {
10593
10606
  var max = 0;
10594
- if (isDocument()) {
10595
- var allElem = document.body.getElementsByTagName('*');
10596
- for (var i = 0; i < allElem.length; i++) {
10597
- var elem = allElem[i];
10598
- if (elem && elem.style && elem.nodeType === 1) {
10599
- var zIndex = elem.style.zIndex;
10600
- if (zIndex && /^\d+$/.test(zIndex)) {
10601
- max = Math.max(max, Number(zIndex));
10607
+ var dom = getDocument();
10608
+ if (dom) {
10609
+ var body = getBody();
10610
+ if (body) {
10611
+ var allElem = body.getElementsByTagName('*');
10612
+ for (var i = 0; i < allElem.length; i++) {
10613
+ var elem = allElem[i];
10614
+ if (elem && elem.style && elem.nodeType === 1) {
10615
+ var zIndex = elem.style.zIndex;
10616
+ if (zIndex && /^\d+$/.test(zIndex)) {
10617
+ max = Math.max(max, Number(zIndex));
10618
+ }
10602
10619
  }
10603
10620
  }
10604
10621
  }
@@ -10607,12 +10624,13 @@ function getDomMaxZIndex() {
10607
10624
  }
10608
10625
  function getStyle() {
10609
10626
  if (!styleEl) {
10610
- if (isDocument()) {
10611
- styleEl = document.getElementById(styleId);
10627
+ var dom = getDocument();
10628
+ if (dom) {
10629
+ styleEl = dom.getElementById(styleId);
10612
10630
  if (!styleEl) {
10613
- styleEl = document.createElement('style');
10631
+ styleEl = dom.createElement('style');
10614
10632
  styleEl.id = styleId;
10615
- document.getElementsByTagName('head')[0].appendChild(styleEl);
10633
+ dom.getElementsByTagName('head')[0].appendChild(styleEl);
10616
10634
  }
10617
10635
  }
10618
10636
  }
@@ -10626,17 +10644,21 @@ function updateVar() {
10626
10644
  styEl.innerHTML = ':root{' + prefixes + 'main' + propKey + ':' + getCurrent() + ';' + prefixes + 'sub' + propKey + ':' + getSubCurrent() + '}';
10627
10645
  }
10628
10646
  }
10629
- function getDom() {
10647
+ function getStoreDom() {
10630
10648
  if (!storeEl) {
10631
- if (isDocument()) {
10632
- storeEl = document.getElementById(storeId);
10649
+ var dom = getDocument();
10650
+ if (dom) {
10651
+ storeEl = dom.getElementById(storeId);
10633
10652
  if (!storeEl) {
10634
- storeEl = document.createElement('div');
10635
- storeEl.id = storeId;
10636
- storeEl.style.display = 'none';
10637
- document.body.appendChild(storeEl);
10638
- setCurrent(storeData.m);
10639
- setSubCurrent(storeData.s);
10653
+ var body = getBody();
10654
+ if (body) {
10655
+ storeEl = dom.createElement('div');
10656
+ storeEl.id = storeId;
10657
+ storeEl.style.display = 'none';
10658
+ body.appendChild(storeEl);
10659
+ setCurrent(storeData.m);
10660
+ setSubCurrent(storeData.s);
10661
+ }
10640
10662
  }
10641
10663
  }
10642
10664
  }
@@ -10647,12 +10669,12 @@ function createSetHandle(key) {
10647
10669
  if (value) {
10648
10670
  value = Number(value);
10649
10671
  storeData[key] = value;
10650
- var doc = getDom();
10651
- if (doc) {
10652
- if (doc.dataset) {
10653
- doc.dataset[key] = value + '';
10672
+ var el = getStoreDom();
10673
+ if (el) {
10674
+ if (el.dataset) {
10675
+ el.dataset[key] = value + '';
10654
10676
  } else {
10655
- doc.setAttribute('data-' + key, value + '');
10677
+ el.setAttribute('data-' + key, value + '');
10656
10678
  }
10657
10679
  }
10658
10680
  }
@@ -10664,9 +10686,9 @@ var setCurrent = createSetHandle(storeMainKey);
10664
10686
  function createGetHandle(key, nextMethod) {
10665
10687
  return function getCurrent(currZindex) {
10666
10688
  var zIndex;
10667
- var doc = getDom();
10668
- if (doc) {
10669
- var domVal = doc.dataset ? doc.dataset[key] : doc.getAttribute('data-' + key);
10689
+ var el = getStoreDom();
10690
+ if (el) {
10691
+ var domVal = el.dataset ? el.dataset[key] : el.getAttribute('data-' + key);
10670
10692
  if (domVal) {
10671
10693
  zIndex = Number(domVal);
10672
10694
  }
@@ -11077,7 +11099,7 @@ function createLog(type, name) {
11077
11099
  return msg;
11078
11100
  };
11079
11101
  }
11080
- var version = "3.0.3";
11102
+ var version = "3.0.4";
11081
11103
  var log = {
11082
11104
  create: createLog,
11083
11105
  warn: createLog('warn', "v".concat(version)),
@@ -11694,7 +11716,7 @@ function setIcon(options) {
11694
11716
  function getIcon(key) {
11695
11717
  return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(iconConfigStore, key) : iconConfigStore;
11696
11718
  }
11697
- var coreVersion = "3.0.3";
11719
+ var coreVersion = "3.0.4";
11698
11720
  var installedPlugins = [];
11699
11721
  function use(Plugin, options) {
11700
11722
  if (Plugin && Plugin.install) {
@@ -12551,7 +12573,7 @@ function handleBooleanDefaultValue(value) {
12551
12573
  }
12552
12574
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
12553
12575
 
12554
- var log_version = "ui v".concat("3.0.4");
12576
+ var log_version = "ui v".concat("3.0.6");
12555
12577
  var warnLog = log.create('warn', log_version);
12556
12578
  var errLog = log.create('error', log_version);
12557
12579
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
@@ -12559,7 +12581,7 @@ var errLog = log.create('error', log_version);
12559
12581
 
12560
12582
 
12561
12583
 
12562
- var ui_version = "3.0.4";
12584
+ var ui_version = "3.0.6";
12563
12585
  core_VxeUI.version = ui_version;
12564
12586
  core_VxeUI.uiVersion = ui_version;
12565
12587
  core_VxeUI.tableVersion = '';
@@ -12954,6 +12976,8 @@ setIcon({
12954
12976
  TABS_TAB_BUTTON_LEFT: iconPrefix + 'arrow-left',
12955
12977
  TABS_TAB_BUTTON_RIGHT: iconPrefix + 'arrow-right',
12956
12978
  TABS_TAB_CLOSE: iconPrefix + 'close',
12979
+ TABS_TAB_REFRESH: iconPrefix + 'refresh',
12980
+ TABS_TAB_REFRESH_LOADING: iconPrefix + 'refresh roll',
12957
12981
  // text
12958
12982
  TEXT_COPY: iconPrefix + 'copy',
12959
12983
  TEXT_LOADING: iconPrefix + 'spinner roll',
@@ -37516,6 +37540,10 @@ var TabPane = VxeTabPane;
37516
37540
 
37517
37541
 
37518
37542
 
37543
+
37544
+
37545
+
37546
+
37519
37547
 
37520
37548
 
37521
37549
  /* harmony default export */ var tabs = (defineVxeComponent({
@@ -37537,6 +37565,9 @@ var TabPane = VxeTabPane;
37537
37565
  },
37538
37566
  trigger: String,
37539
37567
  beforeChangeMethod: Function,
37568
+ closeConfig: Object,
37569
+ refreshConfig: Object,
37570
+ // 已废弃
37540
37571
  beforeCloseMethod: Function
37541
37572
  },
37542
37573
  inject: {
@@ -37560,7 +37591,8 @@ var TabPane = VxeTabPane;
37560
37591
  lintLeft: 0,
37561
37592
  lintWidth: 0,
37562
37593
  isTabOver: false,
37563
- resizeFlag: 1
37594
+ resizeFlag: 1,
37595
+ cacheTabMaps: {}
37564
37596
  };
37565
37597
  var internalData = {
37566
37598
  slTimeout: undefined
@@ -37577,6 +37609,16 @@ var TabPane = VxeTabPane;
37577
37609
  var $xeParentTabs = $xeTabs.$xeParentTabs;
37578
37610
  return $xeParentTabs ? $xeParentTabs.reactData.resizeFlag : null;
37579
37611
  },
37612
+ computeCloseOpts: function computeCloseOpts() {
37613
+ var $xeTabs = this;
37614
+ var props = $xeTabs;
37615
+ return Object.assign({}, getConfig().tabs.closeConfig, props.closeConfig);
37616
+ },
37617
+ computeRefreshOpts: function computeRefreshOpts() {
37618
+ var $xeTabs = this;
37619
+ var props = $xeTabs;
37620
+ return Object.assign({}, getConfig().tabs.refreshConfig, props.refreshConfig);
37621
+ },
37580
37622
  computeTabOptions: function computeTabOptions() {
37581
37623
  var $xeTabs = this;
37582
37624
  var props = $xeTabs;
@@ -37714,15 +37756,24 @@ var TabPane = VxeTabPane;
37714
37756
  var props = $xeTabs;
37715
37757
  var reactData = $xeTabs.reactData;
37716
37758
  var activeName = null;
37759
+ var nameMaps = {};
37717
37760
  if (list && list.length) {
37718
37761
  var validVal = false;
37719
37762
  activeName = props.value;
37720
37763
  list.forEach(function (item) {
37721
- if (activeName === item.name) {
37722
- validVal = true;
37723
- }
37724
- if (item && item.preload) {
37725
- $xeTabs.addInitName(item.name, null);
37764
+ var _ref = item || {},
37765
+ name = _ref.name,
37766
+ preload = _ref.preload;
37767
+ if (name) {
37768
+ nameMaps[name] = {
37769
+ loading: false
37770
+ };
37771
+ if (activeName === name) {
37772
+ validVal = true;
37773
+ }
37774
+ if (preload) {
37775
+ $xeTabs.addInitName(name, null);
37776
+ }
37726
37777
  }
37727
37778
  });
37728
37779
  if (!validVal) {
@@ -37732,6 +37783,7 @@ var TabPane = VxeTabPane;
37732
37783
  }
37733
37784
  }
37734
37785
  reactData.activeName = activeName;
37786
+ reactData.cacheTabMaps = nameMaps;
37735
37787
  },
37736
37788
  clickEvent: function clickEvent(evnt, item) {
37737
37789
  var $xeTabs = this;
@@ -37759,31 +37811,61 @@ var TabPane = VxeTabPane;
37759
37811
  $tabs: $xeTabs,
37760
37812
  name: name,
37761
37813
  oldName: activeName,
37762
- newName: name
37814
+ newName: name,
37815
+ option: item
37763
37816
  })) {
37764
37817
  $xeTabs.dispatchEvent('change', {
37765
37818
  value: value,
37766
37819
  name: name,
37767
37820
  oldName: activeName,
37768
- newName: name
37821
+ newName: name,
37822
+ option: item
37769
37823
  }, evnt);
37770
37824
  } else {
37771
37825
  $xeTabs.dispatchEvent('tab-change-fail', {
37772
37826
  value: value,
37773
37827
  name: name,
37774
37828
  oldName: activeName,
37775
- newName: name
37829
+ newName: name,
37830
+ option: item
37776
37831
  }, evnt);
37777
37832
  }
37778
37833
  }
37779
37834
  },
37835
+ handleRefreshTabEvent: function handleRefreshTabEvent(evnt, item) {
37836
+ var $xeTabs = this;
37837
+ var reactData = $xeTabs.reactData;
37838
+ evnt.stopPropagation();
37839
+ var activeName = reactData.activeName,
37840
+ cacheTabMaps = reactData.cacheTabMaps;
37841
+ var name = item.name;
37842
+ var refreshOpts = $xeTabs.computeRefreshOpts;
37843
+ var queryMethod = refreshOpts.queryMethod;
37844
+ var cacheItem = name ? cacheTabMaps[name] : null;
37845
+ if (cacheItem) {
37846
+ if (queryMethod) {
37847
+ cacheItem.loading = true;
37848
+ Promise.resolve(queryMethod({
37849
+ $tabs: $xeTabs,
37850
+ value: activeName,
37851
+ name: name,
37852
+ option: item
37853
+ })).finally(function () {
37854
+ cacheItem.loading = false;
37855
+ });
37856
+ } else {
37857
+ errLog('vxe.error.notFunc', ['refresh-config.queryMethod']);
37858
+ }
37859
+ }
37860
+ },
37780
37861
  handleCloseTabEvent: function handleCloseTabEvent(evnt, item, index, list) {
37781
37862
  var $xeTabs = this;
37782
37863
  var props = $xeTabs;
37783
37864
  var reactData = $xeTabs.reactData;
37784
37865
  evnt.stopPropagation();
37785
37866
  var activeName = reactData.activeName;
37786
- var beforeMethod = props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
37867
+ var closeOpts = $xeTabs.computeCloseOpts;
37868
+ var beforeMethod = closeOpts.beforeMethod || props.beforeCloseMethod || getConfig().tabs.beforeCloseMethod;
37787
37869
  var name = item.name;
37788
37870
  var value = activeName;
37789
37871
  var nextName = value;
@@ -37795,7 +37877,8 @@ var TabPane = VxeTabPane;
37795
37877
  $tabs: $xeTabs,
37796
37878
  value: value,
37797
37879
  name: name,
37798
- nextName: nextName
37880
+ nextName: nextName,
37881
+ option: item
37799
37882
  })) {
37800
37883
  $xeTabs.dispatchEvent('tab-close', {
37801
37884
  value: value,
@@ -37940,12 +38023,19 @@ var TabPane = VxeTabPane;
37940
38023
  var type = props.type,
37941
38024
  allTitleWidth = props.titleWidth,
37942
38025
  allTitleAlign = props.titleAlign,
37943
- showClose = props.showClose;
38026
+ showClose = props.showClose,
38027
+ closeConfig = props.closeConfig,
38028
+ refreshConfig = props.refreshConfig;
37944
38029
  var activeName = reactData.activeName,
37945
38030
  lintLeft = reactData.lintLeft,
37946
38031
  lintWidth = reactData.lintWidth,
37947
- isTabOver = reactData.isTabOver;
38032
+ isTabOver = reactData.isTabOver,
38033
+ cacheTabMaps = reactData.cacheTabMaps;
37948
38034
  var extraSlot = slots.extra;
38035
+ var closeOpts = $xeTabs.computeCloseOpts;
38036
+ var closeVisibleMethod = closeOpts.visibleMethod;
38037
+ var refreshOpts = $xeTabs.computeRefreshOpts;
38038
+ var refreshVisibleMethod = refreshOpts.visibleMethod;
37949
38039
  return h('div', {
37950
38040
  class: 'vxe-tabs-header'
37951
38041
  }, [isTabOver ? h('div', {
@@ -37970,10 +38060,19 @@ var TabPane = VxeTabPane;
37970
38060
  var tabSlot = slots ? slots.tab : null;
37971
38061
  var itemWidth = titleWidth || allTitleWidth;
37972
38062
  var itemAlign = titleAlign || allTitleAlign;
38063
+ var params = {
38064
+ $tabs: $xeTabs,
38065
+ value: activeName,
38066
+ name: name,
38067
+ option: item
38068
+ };
38069
+ var isActive = activeName === name;
38070
+ var cacheItem = name ? cacheTabMaps[name] : null;
38071
+ var isLoading = cacheItem ? cacheItem.loading : false;
37973
38072
  return h('div', {
37974
38073
  key: "".concat(name),
37975
38074
  class: ['vxe-tabs-header--item', itemAlign ? "align--".concat(itemAlign) : '', {
37976
- 'is--active': activeName === name
38075
+ 'is--active': isActive
37977
38076
  }],
37978
38077
  style: itemWidth ? {
37979
38078
  width: toCssUnit(itemWidth)
@@ -37996,7 +38095,16 @@ var TabPane = VxeTabPane;
37996
38095
  }, tabSlot ? $xeTabs.callSlot(tabSlot, {
37997
38096
  name: name,
37998
38097
  title: title
37999
- }) : "".concat(title))]), showClose ? h('div', {
38098
+ }) : "".concat(title))]), (isEnableConf(refreshConfig) || refreshOpts.enabled) && (refreshVisibleMethod ? refreshVisibleMethod(params) : isActive) ? h('div', {
38099
+ class: 'vxe-tabs-header--refresh-btn',
38100
+ on: {
38101
+ click: function click(evnt) {
38102
+ $xeTabs.handleRefreshTabEvent(evnt, item);
38103
+ }
38104
+ }
38105
+ }, [h('i', {
38106
+ class: isLoading ? getIcon().TABS_TAB_REFRESH_LOADING : getIcon().TABS_TAB_REFRESH
38107
+ })]) : renderEmptyElement($xeTabs), (showClose || isEnableConf(closeConfig) || closeOpts.enabled) && (!closeVisibleMethod || closeVisibleMethod(params)) ? h('div', {
38000
38108
  class: 'vxe-tabs-header--close-btn',
38001
38109
  on: {
38002
38110
  click: function click(evnt) {