@liuzengwei/element-ui 2.15.5-xn.51 → 2.15.5-xn.53

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 (76) hide show
  1. package/lib/alert.js +2 -2
  2. package/lib/area-picker.js +2 -2
  3. package/lib/aside.js +2 -2
  4. package/lib/backtop.js +2 -2
  5. package/lib/badge.js +2 -2
  6. package/lib/breadcrumb-item.js +2 -2
  7. package/lib/breadcrumb.js +2 -2
  8. package/lib/button-group.js +2 -2
  9. package/lib/button.js +2 -2
  10. package/lib/calendar.js +2 -2
  11. package/lib/card.js +2 -2
  12. package/lib/carousel-item.js +2 -2
  13. package/lib/carousel.js +2 -2
  14. package/lib/cascader-panel.js +2 -2
  15. package/lib/cascader.js +4 -4
  16. package/lib/checkbox-button.js +2 -2
  17. package/lib/checkbox-group.js +2 -2
  18. package/lib/checkbox.js +2 -2
  19. package/lib/collapse-item.js +2 -2
  20. package/lib/collapse.js +2 -2
  21. package/lib/color-picker.js +4 -4
  22. package/lib/container.js +2 -2
  23. package/lib/date-picker.js +5 -5
  24. package/lib/dialog.js +2 -2
  25. package/lib/divider.js +2 -2
  26. package/lib/drawer.js +573 -25
  27. package/lib/dropdown-item.js +2 -2
  28. package/lib/dropdown-menu.js +2 -2
  29. package/lib/element-ui.common.js +547 -20
  30. package/lib/footer.js +2 -2
  31. package/lib/form.js +2 -2
  32. package/lib/header.js +2 -2
  33. package/lib/icon.js +2 -2
  34. package/lib/image.js +2 -2
  35. package/lib/index.js +1 -1
  36. package/lib/input-number.js +2 -2
  37. package/lib/link.js +2 -2
  38. package/lib/loading.js +2 -2
  39. package/lib/main.js +2 -2
  40. package/lib/menu-item-group.js +2 -2
  41. package/lib/menu-item.js +2 -2
  42. package/lib/message-box.js +4 -4
  43. package/lib/message.js +2 -2
  44. package/lib/notification.js +2 -2
  45. package/lib/option-group.js +2 -2
  46. package/lib/page-header.js +2 -2
  47. package/lib/pagination.js +2 -2
  48. package/lib/popover.js +2 -2
  49. package/lib/progress.js +2 -2
  50. package/lib/radio-button.js +2 -2
  51. package/lib/radio-group.js +2 -2
  52. package/lib/radio.js +9 -9
  53. package/lib/rate.js +2 -2
  54. package/lib/select.js +2 -2
  55. package/lib/spinner.js +2 -2
  56. package/lib/step.js +2 -2
  57. package/lib/steps.js +2 -2
  58. package/lib/switch.js +2 -2
  59. package/lib/tab-pane.js +2 -2
  60. package/lib/table.js +4 -4
  61. package/lib/theme-chalk/drawer.css +1 -1
  62. package/lib/theme-chalk/index.css +1 -1
  63. package/lib/time-picker.js +5 -5
  64. package/lib/time-select.js +2 -2
  65. package/lib/timeline-item.js +2 -2
  66. package/lib/tooltip.js +2 -2
  67. package/lib/transfer.js +2 -2
  68. package/lib/trigger.js +5 -5
  69. package/lib/upload.js +8 -8
  70. package/package.json +1 -1
  71. package/packages/drawer/src/main.vue +321 -9
  72. package/packages/theme-chalk/lib/drawer.css +1 -1
  73. package/packages/theme-chalk/lib/index.css +1 -1
  74. package/packages/theme-chalk/src/drawer.scss +31 -0
  75. package/src/index.js +1 -1
  76. package/types/drawer.d.ts +16 -0
@@ -113,19 +113,19 @@ module.exports = require("@liuzengwei/element-ui/lib/mixins/emitter");
113
113
  /* 4 */
114
114
  /***/ (function(module, exports) {
115
115
 
116
- module.exports = require("@liuzengwei/element-ui/lib/utils/vue-popper");
116
+ module.exports = require("vue");
117
117
 
118
118
  /***/ }),
119
119
  /* 5 */
120
120
  /***/ (function(module, exports) {
121
121
 
122
- module.exports = require("@liuzengwei/element-ui/lib/mixins/locale");
122
+ module.exports = require("@liuzengwei/element-ui/lib/utils/vue-popper");
123
123
 
124
124
  /***/ }),
125
125
  /* 6 */
126
126
  /***/ (function(module, exports) {
127
127
 
128
- module.exports = require("vue");
128
+ module.exports = require("@liuzengwei/element-ui/lib/mixins/locale");
129
129
 
130
130
  /***/ }),
131
131
  /* 7 */
@@ -810,7 +810,7 @@ var input_ = __webpack_require__(8);
810
810
  var input_default = /*#__PURE__*/__webpack_require__.n(input_);
811
811
 
812
812
  // EXTERNAL MODULE: external "@liuzengwei/element-ui/lib/mixins/locale"
813
- var locale_ = __webpack_require__(5);
813
+ var locale_ = __webpack_require__(6);
814
814
  var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
815
815
 
816
816
  // EXTERNAL MODULE: external "@liuzengwei/element-ui/lib/utils/util"
@@ -1850,7 +1850,7 @@ autocomplete_suggestionsvue_type_template_id_cd10dcf0_render._withStripped = tru
1850
1850
  // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0&
1851
1851
 
1852
1852
  // EXTERNAL MODULE: external "@liuzengwei/element-ui/lib/utils/vue-popper"
1853
- var vue_popper_ = __webpack_require__(4);
1853
+ var vue_popper_ = __webpack_require__(5);
1854
1854
  var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
1855
1855
 
1856
1856
  // EXTERNAL MODULE: external "@liuzengwei/element-ui/lib/scrollbar"
@@ -10428,7 +10428,7 @@ var mousewheel_mousewheel = function mousewheel(element, callback) {
10428
10428
  }
10429
10429
  });
10430
10430
  // EXTERNAL MODULE: external "vue"
10431
- var external_vue_ = __webpack_require__(6);
10431
+ var external_vue_ = __webpack_require__(4);
10432
10432
  var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
10433
10433
 
10434
10434
  // CONCATENATED MODULE: ./packages/table/src/util.js
@@ -41937,7 +41937,10 @@ var mainvue_type_template_id_a4885264_render = function() {
41937
41937
  expression: "visible"
41938
41938
  }
41939
41939
  ],
41940
- staticClass: "el-drawer__wrapper",
41940
+ class: _vm.referenceMode
41941
+ ? "el-drawer__wrapper-reference"
41942
+ : "el-drawer__wrapper",
41943
+ style: _vm.wrapperStyle,
41941
41944
  attrs: { tabindex: "-1" }
41942
41945
  },
41943
41946
  [
@@ -41945,7 +41948,10 @@ var mainvue_type_template_id_a4885264_render = function() {
41945
41948
  "div",
41946
41949
  {
41947
41950
  staticClass: "el-drawer__container",
41948
- class: _vm.visible && "el-drawer__open",
41951
+ class: [
41952
+ _vm.visible && "el-drawer__open",
41953
+ _vm.referenceMode && "el-drawer__reference-mode"
41954
+ ],
41949
41955
  attrs: { role: "document", tabindex: "-1" },
41950
41956
  on: {
41951
41957
  click: function($event) {
@@ -41962,10 +41968,12 @@ var mainvue_type_template_id_a4885264_render = function() {
41962
41968
  {
41963
41969
  ref: "drawer",
41964
41970
  staticClass: "el-drawer",
41965
- class: [_vm.direction, _vm.customClass],
41966
- style: _vm.isHorizontal
41967
- ? "width: " + _vm.drawerSize
41968
- : "height: " + _vm.drawerSize,
41971
+ class: [
41972
+ _vm.effectiveDirection,
41973
+ _vm.customClass,
41974
+ _vm.referenceMode && "is-reference"
41975
+ ],
41976
+ style: _vm.drawerStyle,
41969
41977
  attrs: {
41970
41978
  "aria-modal": "true",
41971
41979
  "aria-labelledby": "el-drawer__title",
@@ -42037,7 +42045,207 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42037
42045
 
42038
42046
  // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=template&id=a4885264&
42039
42047
 
42048
+ // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
42049
+
42050
+
42051
+
42052
+ var hasModal = false;
42053
+ var hasInitZIndex = false;
42054
+ var popup_manager_zIndex = void 0;
42055
+
42056
+ var popup_manager_getModal = function getModal() {
42057
+ if (external_vue_default.a.prototype.$isServer) return;
42058
+ var modalDom = popup_manager_PopupManager.modalDom;
42059
+ if (modalDom) {
42060
+ hasModal = true;
42061
+ } else {
42062
+ hasModal = false;
42063
+ modalDom = document.createElement('div');
42064
+ popup_manager_PopupManager.modalDom = modalDom;
42065
+
42066
+ modalDom.addEventListener('touchmove', function (event) {
42067
+ event.preventDefault();
42068
+ event.stopPropagation();
42069
+ });
42070
+
42071
+ modalDom.addEventListener('click', function () {
42072
+ popup_manager_PopupManager.doOnModalClick && popup_manager_PopupManager.doOnModalClick();
42073
+ });
42074
+ }
42075
+
42076
+ return modalDom;
42077
+ };
42078
+
42079
+ var popup_manager_instances = {};
42080
+
42081
+ var popup_manager_PopupManager = {
42082
+ modalFade: true,
42083
+
42084
+ getInstance: function getInstance(id) {
42085
+ return popup_manager_instances[id];
42086
+ },
42087
+
42088
+ register: function register(id, instance) {
42089
+ if (id && instance) {
42090
+ popup_manager_instances[id] = instance;
42091
+ }
42092
+ },
42093
+
42094
+ deregister: function deregister(id) {
42095
+ if (id) {
42096
+ popup_manager_instances[id] = null;
42097
+ delete popup_manager_instances[id];
42098
+ }
42099
+ },
42100
+
42101
+ nextZIndex: function nextZIndex() {
42102
+ return popup_manager_PopupManager.zIndex++;
42103
+ },
42104
+
42105
+ modalStack: [],
42106
+
42107
+ doOnModalClick: function doOnModalClick() {
42108
+ var topItem = popup_manager_PopupManager.modalStack[popup_manager_PopupManager.modalStack.length - 1];
42109
+ if (!topItem) return;
42110
+
42111
+ var instance = popup_manager_PopupManager.getInstance(topItem.id);
42112
+ if (instance && instance.closeOnClickModal) {
42113
+ instance.close();
42114
+ }
42115
+ },
42116
+
42117
+ openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
42118
+ if (external_vue_default.a.prototype.$isServer) return;
42119
+ if (!id || zIndex === undefined) return;
42120
+ this.modalFade = modalFade;
42121
+
42122
+ var modalStack = this.modalStack;
42123
+
42124
+ for (var i = 0, j = modalStack.length; i < j; i++) {
42125
+ var item = modalStack[i];
42126
+ if (item.id === id) {
42127
+ return;
42128
+ }
42129
+ }
42130
+
42131
+ var modalDom = popup_manager_getModal();
42132
+
42133
+ Object(dom_["addClass"])(modalDom, 'v-modal');
42134
+ if (this.modalFade && !hasModal) {
42135
+ Object(dom_["addClass"])(modalDom, 'v-modal-enter');
42136
+ }
42137
+ if (modalClass) {
42138
+ var classArr = modalClass.trim().split(/\s+/);
42139
+ classArr.forEach(function (item) {
42140
+ return Object(dom_["addClass"])(modalDom, item);
42141
+ });
42142
+ }
42143
+ setTimeout(function () {
42144
+ Object(dom_["removeClass"])(modalDom, 'v-modal-enter');
42145
+ }, 200);
42146
+
42147
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
42148
+ dom.parentNode.appendChild(modalDom);
42149
+ } else {
42150
+ document.body.appendChild(modalDom);
42151
+ }
42152
+
42153
+ if (zIndex) {
42154
+ modalDom.style.zIndex = zIndex;
42155
+ }
42156
+ modalDom.tabIndex = 0;
42157
+ modalDom.style.display = '';
42158
+
42159
+ this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
42160
+ },
42161
+
42162
+ closeModal: function closeModal(id) {
42163
+ var modalStack = this.modalStack;
42164
+ var modalDom = popup_manager_getModal();
42165
+
42166
+ if (modalStack.length > 0) {
42167
+ var topItem = modalStack[modalStack.length - 1];
42168
+ if (topItem.id === id) {
42169
+ if (topItem.modalClass) {
42170
+ var classArr = topItem.modalClass.trim().split(/\s+/);
42171
+ classArr.forEach(function (item) {
42172
+ return Object(dom_["removeClass"])(modalDom, item);
42173
+ });
42174
+ }
42175
+
42176
+ modalStack.pop();
42177
+ if (modalStack.length > 0) {
42178
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
42179
+ }
42180
+ } else {
42181
+ for (var i = modalStack.length - 1; i >= 0; i--) {
42182
+ if (modalStack[i].id === id) {
42183
+ modalStack.splice(i, 1);
42184
+ break;
42185
+ }
42186
+ }
42187
+ }
42188
+ }
42189
+
42190
+ if (modalStack.length === 0) {
42191
+ if (this.modalFade) {
42192
+ Object(dom_["addClass"])(modalDom, 'v-modal-leave');
42193
+ }
42194
+ setTimeout(function () {
42195
+ if (modalStack.length === 0) {
42196
+ if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
42197
+ modalDom.style.display = 'none';
42198
+ popup_manager_PopupManager.modalDom = undefined;
42199
+ }
42200
+ Object(dom_["removeClass"])(modalDom, 'v-modal-leave');
42201
+ }, 200);
42202
+ }
42203
+ }
42204
+ };
42205
+
42206
+ Object.defineProperty(popup_manager_PopupManager, 'zIndex', {
42207
+ configurable: true,
42208
+ get: function get() {
42209
+ if (!hasInitZIndex) {
42210
+ popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$ELEMENT || {}).zIndex || 2000;
42211
+ hasInitZIndex = true;
42212
+ }
42213
+ return popup_manager_zIndex;
42214
+ },
42215
+ set: function set(value) {
42216
+ popup_manager_zIndex = value;
42217
+ }
42218
+ });
42219
+
42220
+ var popup_manager_getTopPopup = function getTopPopup() {
42221
+ if (external_vue_default.a.prototype.$isServer) return;
42222
+ if (popup_manager_PopupManager.modalStack.length > 0) {
42223
+ var topPopup = popup_manager_PopupManager.modalStack[popup_manager_PopupManager.modalStack.length - 1];
42224
+ if (!topPopup) return;
42225
+ var instance = popup_manager_PopupManager.getInstance(topPopup.id);
42226
+
42227
+ return instance;
42228
+ }
42229
+ };
42230
+
42231
+ if (!external_vue_default.a.prototype.$isServer) {
42232
+ // handle `esc` key when the popup is shown
42233
+ window.addEventListener('keydown', function (event) {
42234
+ if (event.keyCode === 27) {
42235
+ var topPopup = popup_manager_getTopPopup();
42236
+
42237
+ if (topPopup && topPopup.closeOnPressEscape) {
42238
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
42239
+ }
42240
+ }
42241
+ });
42242
+ }
42243
+
42244
+ /* harmony default export */ var popup_manager = (popup_manager_PopupManager);
42040
42245
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=script&lang=js&
42246
+ var mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
42247
+
42248
+ //
42041
42249
  //
42042
42250
  //
42043
42251
  //
@@ -42090,6 +42298,8 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42090
42298
 
42091
42299
 
42092
42300
 
42301
+
42302
+
42093
42303
  /* harmony default export */ var drawer_src_mainvue_type_script_lang_js_ = ({
42094
42304
  name: 'ElDrawer',
42095
42305
  mixins: [popup_default.a, emitter_default.a],
@@ -42150,6 +42360,21 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42150
42360
  withHeader: {
42151
42361
  type: Boolean,
42152
42362
  default: true
42363
+ },
42364
+ reference: {
42365
+ type: [String, Object, typeof window !== 'undefined' ? window.HTMLElement : Object],
42366
+ default: null
42367
+ },
42368
+ placement: {
42369
+ type: String,
42370
+ default: 'right',
42371
+ validator: function validator(val) {
42372
+ return ['top', 'bottom', 'left', 'right'].indexOf(val) !== -1;
42373
+ }
42374
+ },
42375
+ offset: {
42376
+ type: Number,
42377
+ default: 0
42153
42378
  }
42154
42379
  },
42155
42380
  computed: {
@@ -42158,12 +42383,51 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42158
42383
  },
42159
42384
  drawerSize: function drawerSize() {
42160
42385
  return typeof this.size === 'number' ? this.size + 'px' : this.size;
42386
+ },
42387
+ referenceMode: function referenceMode() {
42388
+ return !!this.reference;
42389
+ },
42390
+ effectiveDirection: function effectiveDirection() {
42391
+ // 在 reference 模式下,根据 placement 映射到对应的 direction
42392
+ if (this.referenceMode) {
42393
+ var placementToDirection = {
42394
+ 'top': 'btt',
42395
+ 'bottom': 'ttb',
42396
+ 'left': 'ltr',
42397
+ 'right': 'rtl'
42398
+ };
42399
+ return placementToDirection[this.placement] || 'rtl';
42400
+ }
42401
+ return this.direction;
42402
+ },
42403
+ wrapperStyle: function wrapperStyle() {
42404
+ // 在 reference 模式下,将 z-index 设置在 wrapper 上,与全局模式保持一致
42405
+ if (this.referenceMode && this.drawerZIndex) {
42406
+ return { zIndex: this.drawerZIndex };
42407
+ }
42408
+ return null;
42409
+ },
42410
+ drawerStyle: function drawerStyle() {
42411
+ if (this.referenceMode) {
42412
+ var style = mainvue_type_script_lang_js_extends({}, this.position);
42413
+ if (this.placement === 'left' || this.placement === 'right') {
42414
+ style.width = this.drawerSize;
42415
+ } else {
42416
+ style.height = this.drawerSize;
42417
+ }
42418
+ return style;
42419
+ } else {
42420
+ return this.isHorizontal ? 'width: ' + this.drawerSize : 'height: ' + this.drawerSize;
42421
+ }
42161
42422
  }
42162
42423
  },
42163
42424
  data: function data() {
42164
42425
  return {
42165
42426
  closed: false,
42166
- prevActiveElement: null
42427
+ prevActiveElement: null,
42428
+ position: {},
42429
+ drawerZIndex: null,
42430
+ modalZIndex: null
42167
42431
  };
42168
42432
  },
42169
42433
 
@@ -42174,7 +42438,34 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42174
42438
  if (val) {
42175
42439
  this.closed = false;
42176
42440
  this.$emit('open');
42177
- if (this.appendToBody) {
42441
+ if (this.referenceMode) {
42442
+ // z-index 已经通过 drawerStyle computed 属性设置
42443
+ var referenceEl = this.getReferenceElement();
42444
+ if (referenceEl) {
42445
+ referenceEl.appendChild(this.$el);
42446
+ }
42447
+ // 在 drawer 挂载后创建 modal
42448
+ this.$nextTick(function () {
42449
+ // drawer 的 z-index 已经在 appendChild 前设置
42450
+
42451
+ // 创建/显示 modal(使用预分配的较低值)
42452
+ if (_this.modal) {
42453
+ _this.createReferenceModal({
42454
+ modalClass: _this.modalClass,
42455
+ modalFade: _this.modalFade
42456
+ });
42457
+ }
42458
+
42459
+ // 更新位置
42460
+ _this.updatePosition();
42461
+
42462
+ // 清理可能被 PopupManager 创建的全局 modal
42463
+ // 延迟执行,确保全局 modal 已经被创建后再移除
42464
+ setTimeout(function () {
42465
+ _this.removeGlobalModal();
42466
+ }, 300);
42467
+ });
42468
+ } else if (this.appendToBody) {
42178
42469
  document.body.appendChild(this.$el);
42179
42470
  }
42180
42471
  this.prevActiveElement = document.activeElement;
@@ -42185,6 +42476,10 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42185
42476
  this.rendered = false;
42186
42477
  }
42187
42478
  }
42479
+ // 关闭 reference 模式的 modal
42480
+ if (this.referenceMode) {
42481
+ this.closeReferenceModal();
42482
+ }
42188
42483
  this.$nextTick(function () {
42189
42484
  if (_this.prevActiveElement) {
42190
42485
  _this.prevActiveElement.focus();
@@ -42194,6 +42489,122 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42194
42489
  }
42195
42490
  },
42196
42491
  methods: {
42492
+ doOpen: function doOpen(props) {
42493
+ // 在 reference 模式下,需要让遮罩层挂载到参考元素而不是 body
42494
+ if (this.referenceMode) {
42495
+ // 手动实现 doOpen 的逻辑,但将 modal 挂载到 reference 元素
42496
+ if (this.$isServer) return;
42497
+ if (this.willOpen && !this.willOpen()) return;
42498
+ if (this.opened) return;
42499
+
42500
+ this._opening = true;
42501
+
42502
+ var dom = this.$el;
42503
+ var zIndex = props.zIndex;
42504
+
42505
+ if (zIndex) {
42506
+ popup_manager.zIndex = zIndex;
42507
+ }
42508
+
42509
+ // modal 的创建已经移到 watch visible 中,在 drawer 挂载后执行
42510
+ // 这里预先分配 z-index,确保 modal 和 drawer 的层级关系正确
42511
+ // 每次打开都重新分配,避免复用时的 z-index 错乱
42512
+ this.modalZIndex = popup_manager.nextZIndex();
42513
+ this.drawerZIndex = popup_manager.nextZIndex();
42514
+
42515
+ if (Object(dom_["getStyle"])(dom, 'position') === 'static') {
42516
+ dom.style.position = 'absolute';
42517
+ }
42518
+
42519
+ // z-index 的设置已经移到 watch visible 中,在 modal 创建后设置
42520
+ this.opened = true;
42521
+
42522
+ this.onOpen && this.onOpen();
42523
+
42524
+ this.doAfterOpen();
42525
+ } else {
42526
+ // 非 reference 模式,使用原始的 doOpen
42527
+ this.$options.mixins[0].methods.doOpen.call(this, props);
42528
+ }
42529
+ },
42530
+ createReferenceModal: function createReferenceModal(props) {
42531
+ var _this2 = this;
42532
+
42533
+ // 创建并挂载 modal 到 reference 元素
42534
+ var referenceEl = this.getReferenceElement();
42535
+ if (!referenceEl) return;
42536
+
42537
+ // 创建或复用 modal DOM
42538
+ var modalDom = this._referenceModalDom;
42539
+ if (!modalDom) {
42540
+ modalDom = document.createElement('div');
42541
+ modalDom.className = 'v-modal';
42542
+ modalDom.tabIndex = 0;
42543
+
42544
+ // 使用预先分配的 modal z-index,确保 drawer 已经有更高的 z-index
42545
+ var modalZIndex = this.modalZIndex || popup_manager.nextZIndex();
42546
+ modalDom.style.zIndex = modalZIndex;
42547
+
42548
+ // 关键:在 reference 模式下使用 absolute 定位,而不是 fixed
42549
+ modalDom.style.position = 'absolute';
42550
+ modalDom.style.left = '0';
42551
+ modalDom.style.top = '0';
42552
+ modalDom.style.width = '100%';
42553
+ modalDom.style.height = '100%';
42554
+
42555
+ if (props.modalClass) {
42556
+ var classArr = props.modalClass.trim().split(/\s+/);
42557
+ classArr.forEach(function (cls) {
42558
+ return modalDom.classList.add(cls);
42559
+ });
42560
+ }
42561
+
42562
+ // 添加淡入动画
42563
+ if (props.modalFade) {
42564
+ modalDom.classList.add('v-modal-enter');
42565
+ setTimeout(function () {
42566
+ modalDom.classList.remove('v-modal-enter');
42567
+ }, 200);
42568
+ }
42569
+
42570
+ // 直接挂载到 reference 元素内部
42571
+ referenceEl.appendChild(modalDom);
42572
+
42573
+ // 点击 modal 时的处理
42574
+ modalDom.addEventListener('click', function () {
42575
+ if (_this2.closeOnClickModal) {
42576
+ _this2.closeDrawer();
42577
+ }
42578
+ });
42579
+
42580
+ // 保存引用以便后续清理
42581
+ this._referenceModalDom = modalDom;
42582
+ } else {
42583
+ // 复用 modal 时,使用预分配的 z-index
42584
+ modalDom.style.display = '';
42585
+ modalDom.style.zIndex = this.modalZIndex || popup_manager.nextZIndex();
42586
+ }
42587
+ },
42588
+ closeReferenceModal: function closeReferenceModal() {
42589
+ // 关闭 reference 模式的 modal
42590
+ if (this._referenceModalDom) {
42591
+ this._referenceModalDom.style.display = 'none';
42592
+ }
42593
+ },
42594
+ removeGlobalModal: function removeGlobalModal() {
42595
+ // 移除 PopupManager 可能创建的全局 modal(在 body 下的)
42596
+ // 只在 reference 模式下调用此方法
42597
+ if (this.referenceMode) {
42598
+ // 查找并移除 body 下与此 drawer 关联的 modal
42599
+ var globalModals = document.body.querySelectorAll('.v-modal');
42600
+ globalModals.forEach(function (modal) {
42601
+ // 移除 body 下的所有 modal(它们不应该存在)
42602
+ if (modal.parentNode === document.body) {
42603
+ document.body.removeChild(modal);
42604
+ }
42605
+ });
42606
+ }
42607
+ },
42197
42608
  afterEnter: function afterEnter() {
42198
42609
  this.$emit('opened');
42199
42610
  },
@@ -42227,22 +42638,138 @@ mainvue_type_template_id_a4885264_render._withStripped = true
42227
42638
  // pressing `ESC` will call this method, and also close the drawer.
42228
42639
  // This method also calls `beforeClose` if there was one.
42229
42640
  this.closeDrawer();
42641
+ },
42642
+ getReferenceElement: function getReferenceElement() {
42643
+ if (typeof this.reference === 'string') {
42644
+ return document.querySelector(this.reference);
42645
+ } else if (this.reference && this.reference.$el) {
42646
+ return this.reference.$el;
42647
+ } else {
42648
+ return this.reference;
42649
+ }
42650
+ },
42651
+ updatePosition: function updatePosition() {
42652
+ if (!this.referenceMode) return;
42653
+
42654
+ var referenceEl = this.getReferenceElement();
42655
+ if (!referenceEl) {
42656
+ console.warn('[ElDrawer] Reference element not found');
42657
+ return;
42658
+ }
42659
+
42660
+ // 确保参考元素有 position 样式
42661
+ var computedStyle = window.getComputedStyle(referenceEl);
42662
+ if (computedStyle.position === 'static') {
42663
+ referenceEl.style.position = 'relative';
42664
+ }
42665
+
42666
+ var placement = this.placement,
42667
+ offset = this.offset;
42668
+
42669
+ var position = {};
42670
+
42671
+ switch (placement) {
42672
+ case 'top':
42673
+ position.left = '0';
42674
+ position.bottom = offset + 'px';
42675
+ position.top = 'auto';
42676
+ position.right = '0';
42677
+ break;
42678
+ case 'bottom':
42679
+ position.left = '0';
42680
+ position.top = offset + 'px';
42681
+ position.bottom = 'auto';
42682
+ position.right = '0';
42683
+ break;
42684
+ case 'left':
42685
+ position.top = '0';
42686
+ position.right = 'auto';
42687
+ position.left = offset + 'px';
42688
+ position.bottom = '0';
42689
+ break;
42690
+ case 'right':
42691
+ position.top = '0';
42692
+ position.left = 'auto';
42693
+ position.right = offset + 'px';
42694
+ position.bottom = '0';
42695
+ break;
42696
+ }
42697
+
42698
+ this.position = position;
42699
+ },
42700
+ handleScroll: function handleScroll() {
42701
+ if (this.referenceMode && this.visible) {
42702
+ this.updatePosition();
42703
+ }
42704
+ },
42705
+ handleResize: function handleResize() {
42706
+ if (this.referenceMode && this.visible) {
42707
+ this.updatePosition();
42708
+ }
42709
+ }
42710
+ },
42711
+ beforeMount: function beforeMount() {
42712
+ // 在 reference 模式下,我们不使用 PopupManager 的 modal
42713
+ // 设置一个内部标志来阻止 PopupManager 创建 modal
42714
+ if (this.referenceMode) {
42715
+ // 保存原始的 modal 属性
42716
+ this._originalModal = this.modal;
42717
+ // 临时将 modal 设为 false,这样 Popup mixin 的逻辑不会调用 PopupManager.openModal
42718
+ // 注意:这个技巧可能不work,因为 modal 是 prop
42230
42719
  }
42231
42720
  },
42232
42721
  mounted: function mounted() {
42233
42722
  if (this.visible) {
42234
42723
  this.rendered = true;
42235
42724
  this.open();
42236
- if (this.appendToBody) {
42725
+ if (this.referenceMode) {
42726
+ var referenceEl = this.getReferenceElement();
42727
+ if (referenceEl) {
42728
+ referenceEl.appendChild(this.$el);
42729
+ }
42730
+ } else if (this.appendToBody) {
42237
42731
  document.body.appendChild(this.$el);
42238
42732
  }
42239
42733
  }
42734
+ if (this.referenceMode) {
42735
+ window.addEventListener('scroll', this.handleScroll, true);
42736
+ window.addEventListener('resize', this.handleResize);
42737
+ }
42738
+ },
42739
+ beforeDestroy: function beforeDestroy() {
42740
+ // 在 reference 模式下,不使用 PopupManager 管理 modal
42741
+ // 所以需要阻止 Popup mixin 的 beforeDestroy 调用 PopupManager.closeModal
42742
+ if (!this.referenceMode) {
42743
+ // 非 reference 模式,调用 mixin 的 beforeDestroy
42744
+ if (this.$options.mixins && this.$options.mixins[0].beforeDestroy) {
42745
+ this.$options.mixins[0].beforeDestroy.call(this);
42746
+ }
42747
+ } else {
42748
+ // reference 模式,只执行必要的清理
42749
+ if (this._popupId) {
42750
+ popup_manager.deregister(this._popupId);
42751
+ // 不调用 PopupManager.closeModal,因为我们用的是自定义 modal
42752
+ }
42753
+ this.restoreBodyStyle();
42754
+ }
42240
42755
  },
42241
42756
  destroyed: function destroyed() {
42242
42757
  // if appendToBody is true, remove DOM node after destroy
42243
42758
  if (this.appendToBody && this.$el && this.$el.parentNode) {
42244
42759
  this.$el.parentNode.removeChild(this.$el);
42245
42760
  }
42761
+ if (this.referenceMode && this.$el && this.$el.parentNode) {
42762
+ this.$el.parentNode.removeChild(this.$el);
42763
+ }
42764
+ // 清理 reference modal
42765
+ if (this.referenceMode && this._referenceModalDom && this._referenceModalDom.parentNode) {
42766
+ this._referenceModalDom.parentNode.removeChild(this._referenceModalDom);
42767
+ this._referenceModalDom = null;
42768
+ }
42769
+ if (this.referenceMode) {
42770
+ window.removeEventListener('scroll', this.handleScroll, true);
42771
+ window.removeEventListener('resize', this.handleResize);
42772
+ }
42246
42773
  }
42247
42774
  });
42248
42775
  // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=script&lang=js&
@@ -49380,7 +49907,7 @@ function useCascaderAreaData() {
49380
49907
  });
49381
49908
  }
49382
49909
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/area-picker/src/main.vue?vue&type=script&lang=js&
49383
- var mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
49910
+ var src_mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
49384
49911
 
49385
49912
  //
49386
49913
  //
@@ -49457,7 +49984,7 @@ var mainvue_type_script_lang_js_extends = Object.assign || function (target) { f
49457
49984
  cascaderProps: function cascaderProps() {
49458
49985
  // 获取外部传入的props配置
49459
49986
  var externalProps = this.props || {};
49460
- var res = mainvue_type_script_lang_js_extends({
49987
+ var res = src_mainvue_type_script_lang_js_extends({
49461
49988
  // 从组件属性中获取checkStrictly和multiple
49462
49989
  emitPath: false,
49463
49990
  expandTrigger: 'hover',
@@ -49906,7 +50433,7 @@ mainvue_type_template_id_3cb4623f_render._withStripped = true
49906
50433
  // CONCATENATED MODULE: ./packages/trigger/src/main.vue?vue&type=template&id=3cb4623f&
49907
50434
 
49908
50435
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/trigger/src/main.vue?vue&type=script&lang=js&
49909
- var src_mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
50436
+ var trigger_src_mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
49910
50437
 
49911
50438
  //
49912
50439
  //
@@ -50154,7 +50681,7 @@ var stop = function stop(e) {
50154
50681
 
50155
50682
  computed: {
50156
50683
  popupStyleComputed: function popupStyleComputed() {
50157
- var style = src_mainvue_type_script_lang_js_extends({}, this.popupStyle);
50684
+ var style = trigger_src_mainvue_type_script_lang_js_extends({}, this.popupStyle);
50158
50685
 
50159
50686
  if (this.autoFitPopupWidth && this.referenceElm) {
50160
50687
  style.width = this.referenceElm.offsetWidth + 'px';
@@ -51804,7 +52331,7 @@ if (typeof window !== 'undefined' && window.Vue) {
51804
52331
  }
51805
52332
 
51806
52333
  /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
51807
- version: '2.15.5-xn.51',
52334
+ version: '2.15.5-xn.53',
51808
52335
  locale: lib_locale_default.a.use,
51809
52336
  i18n: lib_locale_default.a.i18n,
51810
52337
  install: src_install,