vxe-pc-ui 4.17.26 → 4.17.27

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 (49) hide show
  1. package/dist/all.esm.js +66 -17
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/icon/style.css +1 -1
  5. package/es/modal/src/modal.js +56 -14
  6. package/es/modal/style.css +22 -5
  7. package/es/modal/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/dom.js +9 -2
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-modal/style.css +22 -5
  14. package/es/vxe-modal/style.min.css +1 -1
  15. package/lib/icon/style/style.css +1 -1
  16. package/lib/icon/style/style.min.css +1 -1
  17. package/lib/index.umd.js +76 -25
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/modal/src/modal.js +65 -21
  20. package/lib/modal/src/modal.min.js +1 -1
  21. package/lib/modal/style/style.css +22 -5
  22. package/lib/modal/style/style.min.css +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/dom.js +10 -2
  28. package/lib/ui/src/dom.min.js +1 -1
  29. package/lib/ui/src/log.js +1 -1
  30. package/lib/ui/src/log.min.js +1 -1
  31. package/lib/vxe-modal/style/style.css +22 -5
  32. package/lib/vxe-modal/style/style.min.css +1 -1
  33. package/package.json +1 -1
  34. package/packages/modal/src/modal.ts +56 -14
  35. package/packages/ui/src/dom.ts +10 -2
  36. package/styles/components/modal.scss +36 -5
  37. package/types/components/modal.d.ts +5 -0
  38. /package/es/icon/{iconfont.1788319620112.ttf → iconfont.1788342346304.ttf} +0 -0
  39. /package/es/icon/{iconfont.1788319620112.woff → iconfont.1788342346304.woff} +0 -0
  40. /package/es/icon/{iconfont.1788319620112.woff2 → iconfont.1788342346304.woff2} +0 -0
  41. /package/es/{iconfont.1788319620112.ttf → iconfont.1788342346304.ttf} +0 -0
  42. /package/es/{iconfont.1788319620112.woff → iconfont.1788342346304.woff} +0 -0
  43. /package/es/{iconfont.1788319620112.woff2 → iconfont.1788342346304.woff2} +0 -0
  44. /package/lib/icon/style/{iconfont.1788319620112.ttf → iconfont.1788342346304.ttf} +0 -0
  45. /package/lib/icon/style/{iconfont.1788319620112.woff → iconfont.1788342346304.woff} +0 -0
  46. /package/lib/icon/style/{iconfont.1788319620112.woff2 → iconfont.1788342346304.woff2} +0 -0
  47. /package/lib/{iconfont.1788319620112.ttf → iconfont.1788342346304.ttf} +0 -0
  48. /package/lib/{iconfont.1788319620112.woff → iconfont.1788342346304.woff} +0 -0
  49. /package/lib/{iconfont.1788319620112.woff2 → iconfont.1788342346304.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -101,7 +101,7 @@ function checkDynamic() {
101
101
  }
102
102
 
103
103
  const { log } = VxeUI;
104
- const uiVersion = `ui v${"4.17.26"}`;
104
+ const uiVersion = `ui v${"4.17.27"}`;
105
105
  function createComponentLog(name) {
106
106
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
107
107
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -115,7 +115,7 @@ function createComponentLog(name) {
115
115
  const warnLog$i = log.create('warn', uiVersion);
116
116
  log.create('error', uiVersion);
117
117
 
118
- const version = "4.17.26";
118
+ const version = "4.17.27";
119
119
  VxeUI.uiVersion = version;
120
120
  VxeUI.dynamicApp = dynamicApp;
121
121
  function config(options) {
@@ -2014,8 +2014,7 @@ function updatePanelPlacement(targetElem, panelElem, options) {
2014
2014
  const stys = {};
2015
2015
  if (panelElem && targetElem) {
2016
2016
  const bodyEl = document.body;
2017
- const parentEl = panelElem.parentElement;
2018
- const parentWrapperEl = parentEl === bodyEl ? document.documentElement : parentEl;
2017
+ const parentWrapperEl = getPopupWrapperElement(panelElem);
2019
2018
  if (parentWrapperEl) {
2020
2019
  const targetWidth = targetElem.offsetWidth;
2021
2020
  const targetHeight = targetElem.offsetHeight;
@@ -2139,6 +2138,14 @@ function updatePanelPlacement(targetElem, panelElem, options) {
2139
2138
  placement: panelPlacement
2140
2139
  };
2141
2140
  }
2141
+ function getPopupWrapperElement(panelElem) {
2142
+ if (!panelElem) {
2143
+ return null;
2144
+ }
2145
+ const bodyEl = document.body;
2146
+ const parentEl = panelElem.parentElement;
2147
+ return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
2148
+ }
2142
2149
  function getPopupContainer(appendTo) {
2143
2150
  const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo;
2144
2151
  return selectElem || 'body';
@@ -29916,6 +29923,10 @@ var VxeModalComponent = defineVxeComponent({
29916
29923
  type: [String, Function],
29917
29924
  default: () => getConfig$3().modal.appendTo
29918
29925
  },
29926
+ isWithinAppendTo: {
29927
+ type: Boolean,
29928
+ default: () => getConfig$3().modal.isWithinAppendTo
29929
+ },
29919
29930
  storage: {
29920
29931
  type: Boolean,
29921
29932
  default: () => getConfig$3().modal.storage
@@ -30070,14 +30081,20 @@ var VxeModalComponent = defineVxeComponent({
30070
30081
  };
30071
30082
  const updatePosition = () => {
30072
30083
  return nextTick().then(() => {
30073
- const { position } = props;
30074
- const marginSize = XEUtils.toNumber(props.marginSize);
30084
+ const { position, isWithinAppendTo } = props;
30085
+ const btnTransfer = computeBtnTransfer.value;
30086
+ const el = refElem.value;
30075
30087
  const boxElem = getBox();
30076
30088
  if (!boxElem) {
30077
30089
  return;
30078
30090
  }
30079
- const clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
30080
- const clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
30091
+ const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo && btnTransfer ? el : document.body);
30092
+ if (!parentWrapperEl) {
30093
+ return;
30094
+ }
30095
+ const clientVisibleWidth = parentWrapperEl.clientWidth;
30096
+ const clientVisibleHeight = parentWrapperEl.clientHeight;
30097
+ const marginSize = XEUtils.toNumber(props.marginSize);
30081
30098
  const isPosCenter = position === 'center';
30082
30099
  const { top, left } = XEUtils.isString(position) ? { top: position, left: position } : Object.assign({}, position);
30083
30100
  const topCenter = isPosCenter || top === 'center';
@@ -30256,6 +30273,8 @@ var VxeModalComponent = defineVxeComponent({
30256
30273
  }
30257
30274
  };
30258
30275
  const handleMinimize = () => {
30276
+ const { isWithinAppendTo } = props;
30277
+ const btnTransfer = computeBtnTransfer.value;
30259
30278
  const zoomOpts = computeZoomOpts.value;
30260
30279
  const { minimizeLayout, minimizeMaxSize, minimizeHorizontalOffset, minimizeVerticalOffset, minimizeOffsetMethod } = zoomOpts;
30261
30280
  const isHorizontalLayout = minimizeLayout === 'horizontal';
@@ -30289,6 +30308,7 @@ var VxeModalComponent = defineVxeComponent({
30289
30308
  reactData.prevZoomStatus = prevZoomStatus;
30290
30309
  reactData.zoomStatus = 'minimize';
30291
30310
  return nextTick().then(() => {
30311
+ const el = refElem.value;
30292
30312
  const boxElem = getBox();
30293
30313
  if (!boxElem) {
30294
30314
  return {
@@ -30301,7 +30321,13 @@ var VxeModalComponent = defineVxeComponent({
30301
30321
  status: false
30302
30322
  };
30303
30323
  }
30304
- const { visibleHeight } = getDomNode();
30324
+ const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo && btnTransfer ? el : document.body);
30325
+ if (!parentWrapperEl) {
30326
+ return {
30327
+ status: false
30328
+ };
30329
+ }
30330
+ const visibleHeight = parentWrapperEl.clientHeight;
30305
30331
  // 如果当前处于复原状态
30306
30332
  if (!prevZoomStatus) {
30307
30333
  reactData.revertLocat = {
@@ -30357,6 +30383,8 @@ var VxeModalComponent = defineVxeComponent({
30357
30383
  });
30358
30384
  };
30359
30385
  const handleMaximize = () => {
30386
+ const { isWithinAppendTo } = props;
30387
+ const btnTransfer = computeBtnTransfer.value;
30360
30388
  const prevZoomStatus = reactData.zoomStatus;
30361
30389
  reactData.prevZoomStatus = prevZoomStatus;
30362
30390
  reactData.zoomStatus = 'maximize';
@@ -30365,9 +30393,16 @@ var VxeModalComponent = defineVxeComponent({
30365
30393
  if (boxElem) {
30366
30394
  // 如果当前处于复原状态
30367
30395
  if (!prevZoomStatus) {
30396
+ const el = refElem.value;
30397
+ const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo && btnTransfer ? el : document.body);
30398
+ if (!parentWrapperEl) {
30399
+ return {
30400
+ status: false
30401
+ };
30402
+ }
30403
+ const clientVisibleWidth = parentWrapperEl.clientWidth;
30404
+ const clientVisibleHeight = parentWrapperEl.clientHeight;
30368
30405
  const marginSize = XEUtils.toNumber(props.marginSize);
30369
- const clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
30370
- const clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
30371
30406
  reactData.revertLocat = {
30372
30407
  top: Math.max(marginSize, clientVisibleHeight / 2 - boxElem.offsetHeight / 2),
30373
30408
  left: Math.max(marginSize, clientVisibleWidth / 2 - boxElem.offsetWidth / 2),
@@ -30640,8 +30675,9 @@ var VxeModalComponent = defineVxeComponent({
30640
30675
  }
30641
30676
  };
30642
30677
  const mousedownEvent = (evnt) => {
30643
- const { storage } = props;
30678
+ const { resize, storage, isWithinAppendTo } = props;
30644
30679
  const { zoomStatus } = reactData;
30680
+ const btnTransfer = computeBtnTransfer.value;
30645
30681
  const marginSize = XEUtils.toNumber(props.marginSize);
30646
30682
  const boxElem = getBox();
30647
30683
  if (!boxElem) {
@@ -30649,9 +30685,15 @@ var VxeModalComponent = defineVxeComponent({
30649
30685
  }
30650
30686
  if (zoomStatus !== 'maximize' && evnt.button === 0 && !getEventTargetNode(evnt, boxElem, 'trigger--btn').flag) {
30651
30687
  evnt.preventDefault();
30688
+ const el = refElem.value;
30689
+ const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo && btnTransfer ? el : document.body);
30690
+ if (!parentWrapperEl) {
30691
+ return;
30692
+ }
30693
+ const visibleWidth = parentWrapperEl.clientWidth - (resize && isWithinAppendTo ? 8 : 0);
30694
+ const visibleHeight = parentWrapperEl.clientHeight - (resize && isWithinAppendTo ? 8 : 0);
30652
30695
  const disX = evnt.clientX - boxElem.offsetLeft;
30653
30696
  const disY = evnt.clientY - boxElem.offsetTop;
30654
- const { visibleHeight, visibleWidth } = getDomNode();
30655
30697
  document.onmousemove = evnt => {
30656
30698
  evnt.preventDefault();
30657
30699
  const offsetWidth = boxElem.offsetWidth;
@@ -30697,8 +30739,15 @@ var VxeModalComponent = defineVxeComponent({
30697
30739
  };
30698
30740
  const dragEvent = (evnt) => {
30699
30741
  evnt.preventDefault();
30700
- const { storage } = props;
30701
- const { visibleHeight, visibleWidth } = getDomNode();
30742
+ const { resize, storage, isWithinAppendTo } = props;
30743
+ const btnTransfer = computeBtnTransfer.value;
30744
+ const el = refElem.value;
30745
+ const parentWrapperEl = getPopupWrapperElement(isWithinAppendTo && btnTransfer ? el : document.body);
30746
+ if (!parentWrapperEl) {
30747
+ return;
30748
+ }
30749
+ const visibleWidth = parentWrapperEl.clientWidth - (resize && isWithinAppendTo ? 8 : 0);
30750
+ const visibleHeight = parentWrapperEl.clientHeight - (resize && isWithinAppendTo ? 8 : 0);
30702
30751
  const marginSize = XEUtils.toNumber(props.marginSize);
30703
30752
  const targetElem = evnt.target;
30704
30753
  const type = targetElem.getAttribute('data-type');
@@ -31063,7 +31112,7 @@ var VxeModalComponent = defineVxeComponent({
31063
31112
  return renderEmptyElement($xeModal);
31064
31113
  };
31065
31114
  const renderVN = () => {
31066
- const { slots: propSlots = {}, className, type, animat, draggable, iconStatus, position, loading, destroyOnClose, status, lockScroll, padding, lockView, mask, resize, appendTo } = props;
31115
+ const { slots: propSlots = {}, className, type, animat, draggable, iconStatus, position, loading, destroyOnClose, status, lockScroll, padding, lockView, mask, resize, appendTo, isWithinAppendTo } = props;
31067
31116
  const { initialized, modalTop, contentVisible, visible, zoomStatus } = reactData;
31068
31117
  const asideSlot = slots.aside || propSlots.aside;
31069
31118
  const vSize = computeSize.value;
@@ -31079,7 +31128,7 @@ var VxeModalComponent = defineVxeComponent({
31079
31128
  to: getPopupContainer(appendTo),
31080
31129
  disabled: btnTransfer ? !initialized : true
31081
31130
  }, [
31082
- h('div', Object.assign({ ref: refElem, class: ['vxe-modal--wrapper', `type--${type}`, `zoom--${zoomStatus || 'revert'}`, className || '', position ? `pos--${position}` : '', {
31131
+ h('div', Object.assign({ ref: refElem, class: ['vxe-modal--wrapper', `type--${type}`, `zoom--${zoomStatus || 'revert'}`, className || '', position ? `pos--${position}` : '', isWithinAppendTo ? 'ctx--within' : 'ctx--free', {
31083
31132
  [`size--${vSize}`]: vSize,
31084
31133
  [`status--${status}`]: status,
31085
31134
  'is--padding': padding,