vxe-pc-ui 4.11.34 → 4.11.36

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 (56) hide show
  1. package/es/context-menu/index.js +2 -2
  2. package/es/context-menu/src/context-menu.js +96 -38
  3. package/es/context-menu/style.css +1 -7
  4. package/es/context-menu/style.min.css +1 -1
  5. package/es/date-panel/src/util.js +14 -9
  6. package/es/dynamics/index.js +1 -1
  7. package/es/icon/style.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +4 -2
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-context-menu/style.css +1 -7
  13. package/es/vxe-context-menu/style.min.css +1 -1
  14. package/lib/context-menu/index.js +2 -2
  15. package/lib/context-menu/index.min.js +1 -1
  16. package/lib/context-menu/src/context-menu.js +103 -34
  17. package/lib/context-menu/src/context-menu.min.js +1 -1
  18. package/lib/context-menu/style/style.css +1 -7
  19. package/lib/context-menu/style/style.min.css +1 -1
  20. package/lib/date-panel/src/util.js +15 -10
  21. package/lib/date-panel/src/util.min.js +1 -1
  22. package/lib/dynamics/index.js +2 -0
  23. package/lib/dynamics/index.min.js +1 -1
  24. package/lib/icon/style/style.css +1 -1
  25. package/lib/icon/style/style.min.css +1 -1
  26. package/lib/index.umd.js +128 -50
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/ui/index.js +4 -2
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-context-menu/style/style.css +1 -7
  35. package/lib/vxe-context-menu/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/context-menu/index.ts +2 -2
  38. package/packages/context-menu/src/context-menu.ts +97 -34
  39. package/packages/date-panel/src/util.ts +15 -9
  40. package/packages/dynamics/index.ts +1 -1
  41. package/packages/ui/index.ts +3 -1
  42. package/styles/components/context-menu.scss +1 -11
  43. package/types/components/context-menu.d.ts +3 -1
  44. package/types/components/table-module/filter.d.ts +4 -0
  45. /package/es/icon/{iconfont.1767662202838.ttf → iconfont.1767850984359.ttf} +0 -0
  46. /package/es/icon/{iconfont.1767662202838.woff → iconfont.1767850984359.woff} +0 -0
  47. /package/es/icon/{iconfont.1767662202838.woff2 → iconfont.1767850984359.woff2} +0 -0
  48. /package/es/{iconfont.1767662202838.ttf → iconfont.1767850984359.ttf} +0 -0
  49. /package/es/{iconfont.1767662202838.woff → iconfont.1767850984359.woff} +0 -0
  50. /package/es/{iconfont.1767662202838.woff2 → iconfont.1767850984359.woff2} +0 -0
  51. /package/lib/icon/style/{iconfont.1767662202838.ttf → iconfont.1767850984359.ttf} +0 -0
  52. /package/lib/icon/style/{iconfont.1767662202838.woff → iconfont.1767850984359.woff} +0 -0
  53. /package/lib/icon/style/{iconfont.1767662202838.woff2 → iconfont.1767850984359.woff2} +0 -0
  54. /package/lib/{iconfont.1767662202838.ttf → iconfont.1767850984359.ttf} +0 -0
  55. /package/lib/{iconfont.1767662202838.woff → iconfont.1767850984359.woff} +0 -0
  56. /package/lib/{iconfont.1767662202838.woff2 → iconfont.1767850984359.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2390,7 +2390,7 @@ if (typeof window !== 'undefined') {
2390
2390
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
2391
2391
  var es_array_push = __webpack_require__(4114);
2392
2392
  ;// CONCATENATED MODULE: ./node_modules/@vxe-ui/core/es/src/core.js
2393
- const coreVersion = "4.2.19";
2393
+ const coreVersion = "4.2.20";
2394
2394
  const VxeCore = {
2395
2395
  coreVersion,
2396
2396
  uiVersion: '',
@@ -2990,7 +2990,7 @@ function createLog(type, name) {
2990
2990
  return msg;
2991
2991
  };
2992
2992
  }
2993
- const version = "4.2.19";
2993
+ const version = "4.2.20";
2994
2994
  const log = {
2995
2995
  create: createLog,
2996
2996
  warn: createLog('warn', `v${version}`),
@@ -3636,6 +3636,8 @@ const VxeDynamics = defineVxeComponent({
3636
3636
  optionClick(params);
3637
3637
  }
3638
3638
  }
3639
+ }, {
3640
+ events: undefined
3639
3641
  });
3640
3642
  }
3641
3643
  return [modals.length ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -3659,14 +3661,14 @@ function checkDynamic() {
3659
3661
  }
3660
3662
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
3661
3663
 
3662
- const log_version = `ui v${"4.11.34"}`;
3664
+ const log_version = `ui v${"4.11.36"}`;
3663
3665
  const warnLog = log.create('warn', log_version);
3664
3666
  const errLog = log.create('error', log_version);
3665
3667
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
3666
3668
 
3667
3669
 
3668
3670
 
3669
- const ui_version = "4.11.34";
3671
+ const ui_version = "4.11.36";
3670
3672
  index_esm_VxeUI.uiVersion = ui_version;
3671
3673
  index_esm_VxeUI.dynamicApp = dynamicApp;
3672
3674
  function config(options) {
@@ -3736,7 +3738,9 @@ setConfig({
3736
3738
  }
3737
3739
  },
3738
3740
  collapsePane: {},
3739
- contextMenu: {},
3741
+ contextMenu: {
3742
+ autoLocate: true
3743
+ },
3740
3744
  countdown: {},
3741
3745
  colorPicker: {
3742
3746
  type: 'rgb',
@@ -8265,16 +8269,15 @@ function parseDateObj(val, type, options) {
8265
8269
  // '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
8266
8270
  // '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
8267
8271
  if (labelFormat && type === 'week') {
8268
- const weekNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(dValue, firstDay);
8269
- const weekDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(dValue, 0, weekNum === 1 ? (6 + firstDay) % 7 : firstDay, firstDay);
8270
- const weekFullYear = weekDate.getFullYear();
8271
- if (weekFullYear !== dValue.getFullYear()) {
8272
- const yyIndex = labelFormat.indexOf('yyyy');
8272
+ const oldYyyy = dValue.getFullYear();
8273
+ const M = dValue.getMonth() + 1;
8274
+ const W = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(dValue, firstDay);
8275
+ if (checkWeekOfsetYear(W, M)) {
8276
+ const formatY = 'yyyy';
8277
+ const newYyyy = oldYyyy + 1;
8278
+ const yyIndex = labelFormat.indexOf(formatY);
8273
8279
  if (yyIndex > -1) {
8274
- const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
8275
- if (yyNum && !isNaN(yyNum)) {
8276
- dLabel = dLabel.replace(`${yyNum}`, `${weekFullYear}`);
8277
- }
8280
+ dLabel = dLabel.substring(0, yyIndex) + newYyyy + dLabel.substring(yyIndex + formatY.length);
8278
8281
  }
8279
8282
  }
8280
8283
  }
@@ -8392,6 +8395,12 @@ function getRangeDateByCode(code, val, type, options) {
8392
8395
  endValue
8393
8396
  };
8394
8397
  }
8398
+ /**
8399
+ * 判断周的年份是否跨年
8400
+ */
8401
+ const checkWeekOfsetYear = (W, M) => {
8402
+ return `${W}` === '1' && `${M}` === '12';
8403
+ };
8395
8404
  ;// CONCATENATED MODULE: ./packages/calendar/src/calendar.ts
8396
8405
 
8397
8406
 
@@ -17450,7 +17459,7 @@ function context_menu_createReactData() {
17450
17459
  left: '',
17451
17460
  zIndex: 0
17452
17461
  },
17453
- childPos: ''
17462
+ childOffsetX: 0
17454
17463
  };
17455
17464
  }
17456
17465
  /* harmony default export */ var context_menu = (defineVxeComponent({
@@ -17465,6 +17474,10 @@ function context_menu_createReactData() {
17465
17474
  options: Array,
17466
17475
  x: [Number, String],
17467
17476
  y: [Number, String],
17477
+ autoLocate: {
17478
+ type: Boolean,
17479
+ default: () => getConfig().contextMenu.autoLocate
17480
+ },
17468
17481
  zIndex: [Number, String],
17469
17482
  position: {
17470
17483
  type: String,
@@ -17547,7 +17560,7 @@ function context_menu_createReactData() {
17547
17560
  } = reactData;
17548
17561
  const value = true;
17549
17562
  reactData.visible = value;
17550
- updateLocate();
17563
+ handleLocate();
17551
17564
  updateZindex();
17552
17565
  if (modelValue !== value) {
17553
17566
  emitModel(value);
@@ -17560,7 +17573,9 @@ function context_menu_createReactData() {
17560
17573
  visible: value
17561
17574
  }, null);
17562
17575
  }
17563
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
17576
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
17577
+ updateLocate();
17578
+ });
17564
17579
  };
17565
17580
  const close = () => {
17566
17581
  const {
@@ -17584,7 +17599,7 @@ function context_menu_createReactData() {
17584
17599
  }
17585
17600
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
17586
17601
  };
17587
- const updateLocate = () => {
17602
+ const handleLocate = () => {
17588
17603
  const {
17589
17604
  x,
17590
17605
  y
@@ -17594,6 +17609,7 @@ function context_menu_createReactData() {
17594
17609
  } = reactData;
17595
17610
  popupStyle.left = toCssUnit(x || 0);
17596
17611
  popupStyle.top = toCssUnit(y || 0);
17612
+ updateLocate();
17597
17613
  };
17598
17614
  const updateZindex = () => {
17599
17615
  const {
@@ -17612,6 +17628,67 @@ function context_menu_createReactData() {
17612
17628
  }
17613
17629
  }
17614
17630
  };
17631
+ const updateLocate = () => {
17632
+ const {
17633
+ autoLocate,
17634
+ position
17635
+ } = props;
17636
+ const {
17637
+ popupStyle
17638
+ } = reactData;
17639
+ if (autoLocate) {
17640
+ const wrapperEl = refElem.value;
17641
+ if (wrapperEl) {
17642
+ const {
17643
+ visibleWidth,
17644
+ visibleHeight
17645
+ } = getDomNode();
17646
+ const wrapperStyle = getComputedStyle(wrapperEl);
17647
+ const offsetTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(wrapperStyle.top);
17648
+ const offsetLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(wrapperStyle.left);
17649
+ const wrapperWidth = wrapperEl.offsetWidth;
17650
+ const wrapperHeight = wrapperEl.offsetHeight;
17651
+ if (position === 'absolute') {
17652
+ //
17653
+ } else {
17654
+ if (offsetTop + wrapperHeight > visibleHeight) {
17655
+ popupStyle.top = `${Math.max(0, offsetTop - wrapperHeight)}px`;
17656
+ }
17657
+ if (offsetLeft + wrapperWidth > visibleWidth) {
17658
+ popupStyle.left = `${Math.max(0, offsetLeft - wrapperWidth)}px`;
17659
+ }
17660
+ }
17661
+ }
17662
+ }
17663
+ updateChildLocate();
17664
+ };
17665
+ const updateChildLocate = () => {
17666
+ const wrapperEl = refElem.value;
17667
+ if (wrapperEl) {
17668
+ const {
17669
+ visibleWidth
17670
+ } = getDomNode();
17671
+ const owSize = 2;
17672
+ const handleStyle = () => {
17673
+ const wrapperStyle = getComputedStyle(wrapperEl);
17674
+ const offsetLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(wrapperStyle.left);
17675
+ const wrapperWidth = wrapperEl.offsetWidth;
17676
+ const childEl = wrapperEl.querySelector('.vxe-context-menu--children-wrapper');
17677
+ const childWidth = childEl ? childEl.offsetWidth : wrapperWidth;
17678
+ if (offsetLeft + wrapperWidth > visibleWidth - childWidth) {
17679
+ // 往左
17680
+ reactData.childOffsetX = -childWidth + owSize;
17681
+ } else {
17682
+ // 往右
17683
+ reactData.childOffsetX = wrapperWidth - owSize;
17684
+ }
17685
+ };
17686
+ handleStyle();
17687
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
17688
+ handleStyle();
17689
+ });
17690
+ }
17691
+ };
17615
17692
  const handleVisible = () => {
17616
17693
  const {
17617
17694
  modelValue
@@ -17650,6 +17727,9 @@ function context_menu_createReactData() {
17650
17727
  reactData.activeOption = item;
17651
17728
  if (hasChildMenu(item)) {
17652
17729
  reactData.activeChildOption = findFirstChildItem(item);
17730
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
17731
+ updateChildLocate();
17732
+ });
17653
17733
  } else {
17654
17734
  reactData.activeChildOption = null;
17655
17735
  }
@@ -17764,17 +17844,21 @@ function context_menu_createReactData() {
17764
17844
  const handleGlobalKeydownEvent = evnt => {
17765
17845
  const {
17766
17846
  visible,
17767
- childPos,
17768
17847
  activeOption,
17769
17848
  activeChildOption
17770
17849
  } = reactData;
17771
17850
  const allFirstMenuList = computeAllFirstMenuList.value;
17772
17851
  if (visible) {
17773
- const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
17774
17852
  const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
17775
- const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
17776
17853
  const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
17854
+ const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
17855
+ const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
17777
17856
  const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
17857
+ const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
17858
+ if (isEsc) {
17859
+ close();
17860
+ return;
17861
+ }
17778
17862
  // 回车选中
17779
17863
  if (isEnter) {
17780
17864
  if (activeOption || activeChildOption) {
@@ -17782,6 +17866,7 @@ function context_menu_createReactData() {
17782
17866
  evnt.stopPropagation();
17783
17867
  if (!activeChildOption && hasChildMenu(activeOption)) {
17784
17868
  reactData.activeChildOption = findFirstChildItem(activeOption);
17869
+ updateChildLocate();
17785
17870
  return;
17786
17871
  }
17787
17872
  handleItemClickEvent(evnt, activeChildOption || activeOption);
@@ -17793,23 +17878,14 @@ function context_menu_createReactData() {
17793
17878
  if (isUpArrow) {
17794
17879
  evnt.preventDefault();
17795
17880
  reactData.activeChildOption = findPrevChildItem(activeOption, activeChildOption);
17881
+ updateChildLocate();
17796
17882
  } else if (isDwArrow) {
17797
17883
  evnt.preventDefault();
17798
17884
  reactData.activeChildOption = findNextChildItem(activeOption, activeChildOption);
17885
+ updateChildLocate();
17799
17886
  } else if (isLeftArrow) {
17800
17887
  evnt.preventDefault();
17801
- if (childPos === 'left') {
17802
- // 无操作
17803
- } else {
17804
- reactData.activeChildOption = null;
17805
- }
17806
- } else if (isRightArrow) {
17807
- evnt.preventDefault();
17808
- if (childPos === 'left') {
17809
- reactData.activeChildOption = null;
17810
- } else {
17811
- // 无操作
17812
- }
17888
+ reactData.activeChildOption = null;
17813
17889
  }
17814
17890
  } else if (activeOption) {
17815
17891
  evnt.preventDefault();
@@ -17819,14 +17895,9 @@ function context_menu_createReactData() {
17819
17895
  reactData.activeOption = findNextFirstItem(allFirstMenuList, activeOption);
17820
17896
  } else {
17821
17897
  if (hasChildMenu(activeOption)) {
17822
- if (childPos === 'left') {
17823
- if (isLeftArrow) {
17824
- reactData.activeChildOption = findFirstChildItem(activeOption);
17825
- }
17826
- } else {
17827
- if (isRightArrow) {
17828
- reactData.activeChildOption = findFirstChildItem(activeOption);
17829
- }
17898
+ if (isRightArrow) {
17899
+ reactData.activeChildOption = findFirstChildItem(activeOption);
17900
+ updateChildLocate();
17830
17901
  }
17831
17902
  }
17832
17903
  }
@@ -17918,7 +17989,8 @@ function context_menu_createReactData() {
17918
17989
  const renderMenus = () => {
17919
17990
  const {
17920
17991
  activeOption,
17921
- activeChildOption
17992
+ activeChildOption,
17993
+ childOffsetX
17922
17994
  } = reactData;
17923
17995
  const menuGroups = computeMenuGroups.value;
17924
17996
  const mgVNs = [];
@@ -17930,14 +18002,18 @@ function context_menu_createReactData() {
17930
18002
  } = firstItem;
17931
18003
  const hasChildMenus = children && children.some(child => child.visible !== false);
17932
18004
  const isActiveFirst = activeOption === firstItem;
18005
+ const showChild = isActiveFirst && !!activeChildOption;
17933
18006
  moVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17934
18007
  key: `${gIndex}_${i}`,
17935
18008
  class: ['vxe-context-menu--item-wrapper vxe-context-menu--first-item', firstItem.className || '', {
17936
18009
  'is--active': isActiveFirst,
17937
18010
  'is--subactive': isActiveFirst && !!activeChildOption
17938
18011
  }]
17939
- }, [hasChildMenus ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17940
- class: 'vxe-context-menu--children-wrapper'
18012
+ }, [hasChildMenus && showChild ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
18013
+ class: 'vxe-context-menu--children-wrapper',
18014
+ style: {
18015
+ transform: `translate(${childOffsetX}px, -5px)`
18016
+ }
17941
18017
  }, children.map(twoItem => {
17942
18018
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17943
18019
  class: ['vxe-context-menu--item-wrapper vxe-context-menu--child-item', twoItem.className || '', {
@@ -17961,13 +18037,12 @@ function context_menu_createReactData() {
17961
18037
  } = props;
17962
18038
  const {
17963
18039
  visible,
17964
- popupStyle,
17965
- childPos
18040
+ popupStyle
17966
18041
  } = reactData;
17967
18042
  const vSize = computeSize.value;
17968
18043
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17969
18044
  ref: refElem,
17970
- class: ['vxe-context-menu vxe-context-menu--wrapper', position === 'absolute' ? 'is--' + position : 'is--fixed', `cp--${childPos === 'left' ? childPos : 'right'}`, className || '', {
18045
+ class: ['vxe-context-menu vxe-context-menu--wrapper', position === 'absolute' ? 'is--' + position : 'is--fixed', className || '', {
17971
18046
  [`size--${vSize}`]: vSize,
17972
18047
  'is--visible': visible
17973
18048
  }],
@@ -17975,7 +18050,10 @@ function context_menu_createReactData() {
17975
18050
  }, (destroyOnClose ? visible : true) ? renderMenus() : []);
17976
18051
  };
17977
18052
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTopAndLeft, () => {
17978
- updateLocate();
18053
+ handleLocate();
18054
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
18055
+ updateLocate();
18056
+ });
17979
18057
  });
17980
18058
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
17981
18059
  handleVisible();
@@ -18039,8 +18117,8 @@ const ContextMenuController = {
18039
18117
  evnt.preventDefault();
18040
18118
  evnt.stopPropagation();
18041
18119
  const opts = Object.assign({}, options);
18042
- const x = evnt.clientX;
18043
- const y = evnt.clientY;
18120
+ const x = evnt.clientX + 1;
18121
+ const y = evnt.clientY + 1;
18044
18122
  openMenu(opts, x, y);
18045
18123
  },
18046
18124
  close() {