@deppon/deppon-template 2.4.23 → 2.4.24
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.
|
@@ -1432,3 +1432,99 @@ body .el-overlay-dialog {
|
|
|
1432
1432
|
fill: var(--el-color-primary, #409eff) !important;
|
|
1433
1433
|
fill-opacity: 1 !important;
|
|
1434
1434
|
}
|
|
1435
|
+
/* 边框拖拽缩放 */
|
|
1436
|
+
.pro-dialog-root--resizable.el-dialog,
|
|
1437
|
+
.el-dialog.pro-dialog-root--resizable {
|
|
1438
|
+
display: flex !important;
|
|
1439
|
+
flex-direction: column !important;
|
|
1440
|
+
overflow: hidden !important;
|
|
1441
|
+
}
|
|
1442
|
+
.pro-dialog-panel--resizable {
|
|
1443
|
+
position: relative;
|
|
1444
|
+
}
|
|
1445
|
+
.pro-dialog-resize-handles {
|
|
1446
|
+
position: absolute;
|
|
1447
|
+
inset: 0;
|
|
1448
|
+
pointer-events: none;
|
|
1449
|
+
z-index: 20;
|
|
1450
|
+
}
|
|
1451
|
+
.pro-dialog-resize-handle {
|
|
1452
|
+
position: absolute;
|
|
1453
|
+
pointer-events: auto;
|
|
1454
|
+
background: transparent;
|
|
1455
|
+
touch-action: none;
|
|
1456
|
+
}
|
|
1457
|
+
.pro-dialog-resize-handle--n {
|
|
1458
|
+
top: 0;
|
|
1459
|
+
left: 0;
|
|
1460
|
+
width: 100%;
|
|
1461
|
+
height: 8px;
|
|
1462
|
+
}
|
|
1463
|
+
.pro-dialog-resize-handle--s {
|
|
1464
|
+
left: 0;
|
|
1465
|
+
bottom: 0;
|
|
1466
|
+
width: 100%;
|
|
1467
|
+
height: 8px;
|
|
1468
|
+
}
|
|
1469
|
+
.pro-dialog-resize-handle--e {
|
|
1470
|
+
top: 0;
|
|
1471
|
+
right: 0;
|
|
1472
|
+
width: 8px;
|
|
1473
|
+
height: 100%;
|
|
1474
|
+
}
|
|
1475
|
+
.pro-dialog-resize-handle--w {
|
|
1476
|
+
top: 0;
|
|
1477
|
+
left: 0;
|
|
1478
|
+
width: 8px;
|
|
1479
|
+
height: 100%;
|
|
1480
|
+
}
|
|
1481
|
+
.pro-dialog-resize-handle--nw {
|
|
1482
|
+
top: 0;
|
|
1483
|
+
left: 0;
|
|
1484
|
+
width: 14px;
|
|
1485
|
+
height: 14px;
|
|
1486
|
+
}
|
|
1487
|
+
.pro-dialog-resize-handle--ne {
|
|
1488
|
+
top: 0;
|
|
1489
|
+
right: 0;
|
|
1490
|
+
width: 14px;
|
|
1491
|
+
height: 14px;
|
|
1492
|
+
}
|
|
1493
|
+
.pro-dialog-resize-handle--sw {
|
|
1494
|
+
left: 0;
|
|
1495
|
+
bottom: 0;
|
|
1496
|
+
width: 14px;
|
|
1497
|
+
height: 14px;
|
|
1498
|
+
}
|
|
1499
|
+
.pro-dialog-resize-handle--se {
|
|
1500
|
+
right: 0;
|
|
1501
|
+
bottom: 0;
|
|
1502
|
+
width: 14px;
|
|
1503
|
+
height: 14px;
|
|
1504
|
+
}
|
|
1505
|
+
.pro-dialog-resize-handle:hover {
|
|
1506
|
+
background: color-mix(in srgb, var(--el-color-primary, #409eff) 18%, transparent);
|
|
1507
|
+
}
|
|
1508
|
+
.pro-dialog-root--resizable .el-dialog__body {
|
|
1509
|
+
flex: 1;
|
|
1510
|
+
min-height: 0;
|
|
1511
|
+
}
|
|
1512
|
+
.pro-dialog-root--resizable .pro-dialog-content-wrapper,
|
|
1513
|
+
.pro-dialog-root--resizable .pro-dialog-default-content {
|
|
1514
|
+
flex: 1;
|
|
1515
|
+
min-height: 0;
|
|
1516
|
+
overflow: auto;
|
|
1517
|
+
}
|
|
1518
|
+
.pro-dialog-body-content--fill {
|
|
1519
|
+
flex: 1;
|
|
1520
|
+
min-height: 0;
|
|
1521
|
+
display: flex;
|
|
1522
|
+
flex-direction: column;
|
|
1523
|
+
}
|
|
1524
|
+
.pro-dialog-body-content--fill .el-scrollbar {
|
|
1525
|
+
flex: 1;
|
|
1526
|
+
min-height: 0;
|
|
1527
|
+
}
|
|
1528
|
+
.pro-dialog-body-content--fill .el-scrollbar__wrap {
|
|
1529
|
+
max-height: 100%;
|
|
1530
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import '../_virtual/_rollup-plugin-inject-process-env.js';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
4
|
import { markRaw, useSlots, ref, computed, useAttrs, onMounted, onUnmounted, openBlock, createBlock, unref, mergeProps, createSlots, withCtx, createElementVNode, normalizeClass, renderSlot, toDisplayString, createVNode, createCommentVNode, createElementBlock, normalizeStyle, Fragment, renderList, normalizeProps, guardReactiveProps, nextTick } from 'vue';
|
|
4
5
|
import { ElDialog, ElIcon, ElScrollbar } from '@deppon/deppon-ui';
|
|
5
6
|
import { Close } from '@deppon/deppon-ui/icons-vue';
|
|
6
7
|
|
|
7
|
-
var _excluded = ["modelValue"];
|
|
8
|
+
var _excluded = ["modelValue", "resizable", "resizeMinWidth", "resizeMinHeight", "resizeMaxWidth", "resizeMaxHeight", "resize-min-width", "resize-min-height", "resize-max-width", "resize-max-height", "class", "style", "width"];
|
|
8
9
|
var _hoisted_1 = {
|
|
9
10
|
"class": "my-header"
|
|
10
11
|
};
|
|
@@ -35,8 +36,14 @@ var script = {
|
|
|
35
36
|
var slots = useSlots();
|
|
36
37
|
|
|
37
38
|
// refs
|
|
39
|
+
var dialogComponentRef = ref(null);
|
|
38
40
|
var bodyScrollbarRef = ref(null);
|
|
39
41
|
var bodyContentInnerRef = ref(null);
|
|
42
|
+
var dialogInstanceId = "pro-dialog-".concat(Math.random().toString(36).slice(2, 9));
|
|
43
|
+
var dialogPixelWidth = ref(null);
|
|
44
|
+
var dialogPixelHeight = ref(null);
|
|
45
|
+
var resizeHandlesEl = null;
|
|
46
|
+
var resizePanelEl = null;
|
|
40
47
|
|
|
41
48
|
// 检查是否有 title slot
|
|
42
49
|
computed(function () {
|
|
@@ -86,10 +93,334 @@ var script = {
|
|
|
86
93
|
var bodyContentHeight = computed(function () {
|
|
87
94
|
return attrs.bodyContentHeight || attrs['body-content-height'] || '50vh';
|
|
88
95
|
});
|
|
96
|
+
var resizable = computed(function () {
|
|
97
|
+
return attrs.resizable === true || attrs.resizable === '';
|
|
98
|
+
});
|
|
99
|
+
var resizeMinWidth = computed(function () {
|
|
100
|
+
var _attrs$resizeMinWidth;
|
|
101
|
+
return parseSizeToPx((_attrs$resizeMinWidth = attrs.resizeMinWidth) !== null && _attrs$resizeMinWidth !== void 0 ? _attrs$resizeMinWidth : attrs['resize-min-width'], 360);
|
|
102
|
+
});
|
|
103
|
+
var resizeMinHeight = computed(function () {
|
|
104
|
+
var _attrs$resizeMinHeigh;
|
|
105
|
+
return parseSizeToPx((_attrs$resizeMinHeigh = attrs.resizeMinHeight) !== null && _attrs$resizeMinHeigh !== void 0 ? _attrs$resizeMinHeigh : attrs['resize-min-height'], 240);
|
|
106
|
+
});
|
|
107
|
+
var resizeMaxWidth = computed(function () {
|
|
108
|
+
var _attrs$resizeMaxWidth;
|
|
109
|
+
var v = (_attrs$resizeMaxWidth = attrs.resizeMaxWidth) !== null && _attrs$resizeMaxWidth !== void 0 ? _attrs$resizeMaxWidth : attrs['resize-max-width'];
|
|
110
|
+
if (v == null || v === '') {
|
|
111
|
+
return typeof window !== 'undefined' ? Math.floor(window.innerWidth * 0.96) : 1920;
|
|
112
|
+
}
|
|
113
|
+
return parseSizeToPx(v, 1920);
|
|
114
|
+
});
|
|
115
|
+
var resizeMaxHeight = computed(function () {
|
|
116
|
+
var _attrs$resizeMaxHeigh;
|
|
117
|
+
var v = (_attrs$resizeMaxHeigh = attrs.resizeMaxHeight) !== null && _attrs$resizeMaxHeigh !== void 0 ? _attrs$resizeMaxHeigh : attrs['resize-max-height'];
|
|
118
|
+
if (v == null || v === '') {
|
|
119
|
+
return typeof window !== 'undefined' ? Math.floor(window.innerHeight * 0.92) : 1080;
|
|
120
|
+
}
|
|
121
|
+
return parseSizeToPx(v, 1080);
|
|
122
|
+
});
|
|
123
|
+
var dialogRootClass = computed(function () {
|
|
124
|
+
var list = ['pro-dialog-root', "pro-dialog-root--".concat(dialogInstanceId)];
|
|
125
|
+
if (resizable.value) {
|
|
126
|
+
list.push('pro-dialog-root--resizable');
|
|
127
|
+
}
|
|
128
|
+
var extra = attrs["class"];
|
|
129
|
+
if (typeof extra === 'string' && extra) {
|
|
130
|
+
list.push(extra);
|
|
131
|
+
} else if (Array.isArray(extra)) {
|
|
132
|
+
list.push.apply(list, _toConsumableArray(extra.filter(Boolean)));
|
|
133
|
+
}
|
|
134
|
+
return list;
|
|
135
|
+
});
|
|
136
|
+
var dialogWidthProp = computed(function () {
|
|
137
|
+
if (resizable.value && dialogPixelWidth.value != null) {
|
|
138
|
+
return "".concat(dialogPixelWidth.value, "px");
|
|
139
|
+
}
|
|
140
|
+
return attrs.width;
|
|
141
|
+
});
|
|
142
|
+
var dialogRootStyle = computed(function () {
|
|
143
|
+
if (!resizable.value || dialogPixelHeight.value == null) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
height: "".concat(dialogPixelHeight.value, "px"),
|
|
148
|
+
maxHeight: "".concat(dialogPixelHeight.value, "px"),
|
|
149
|
+
display: 'flex',
|
|
150
|
+
flexDirection: 'column'
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
var bodyScrollbarStyle = computed(function () {
|
|
154
|
+
if (resizable.value) {
|
|
155
|
+
return {
|
|
156
|
+
height: '100%',
|
|
157
|
+
flex: '1',
|
|
158
|
+
minHeight: '0'
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
height: bodyContentHeight.value
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
function parseSizeToPx(value, fallback) {
|
|
166
|
+
if (value == null || value === '') {
|
|
167
|
+
return fallback;
|
|
168
|
+
}
|
|
169
|
+
if (typeof value === 'number' && !Number.isNaN(value)) {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
var str = String(value).trim();
|
|
173
|
+
if (str.endsWith('px')) {
|
|
174
|
+
var _n = parseFloat(str);
|
|
175
|
+
return Number.isNaN(_n) ? fallback : _n;
|
|
176
|
+
}
|
|
177
|
+
if (str.endsWith('%') && typeof window !== 'undefined') {
|
|
178
|
+
var _n2 = parseFloat(str);
|
|
179
|
+
return Number.isNaN(_n2) ? fallback : Math.floor(window.innerWidth * _n2 / 100);
|
|
180
|
+
}
|
|
181
|
+
var n = parseFloat(str);
|
|
182
|
+
return Number.isNaN(n) ? fallback : n;
|
|
183
|
+
}
|
|
184
|
+
function parseWidthAttrToPx(widthAttr) {
|
|
185
|
+
if (widthAttr == null || widthAttr === '') {
|
|
186
|
+
return 600;
|
|
187
|
+
}
|
|
188
|
+
return parseSizeToPx(widthAttr, 600);
|
|
189
|
+
}
|
|
190
|
+
function clampSize(value, min, max) {
|
|
191
|
+
return Math.min(max, Math.max(min, value));
|
|
192
|
+
}
|
|
193
|
+
function getDialogPanelEl() {
|
|
194
|
+
var _comp$$el$querySelect, _comp$$el, _comp$$el$querySelect2;
|
|
195
|
+
var byClass = document.querySelector(".pro-dialog-root--".concat(dialogInstanceId, ".el-dialog"));
|
|
196
|
+
if (byClass) {
|
|
197
|
+
return byClass;
|
|
198
|
+
}
|
|
199
|
+
var comp = dialogComponentRef.value;
|
|
200
|
+
if (!comp) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
var exposed = comp.dialogRef;
|
|
204
|
+
if (exposed) {
|
|
205
|
+
var _exposed$value;
|
|
206
|
+
return (_exposed$value = exposed.value) !== null && _exposed$value !== void 0 ? _exposed$value : exposed;
|
|
207
|
+
}
|
|
208
|
+
return (_comp$$el$querySelect = (_comp$$el = comp.$el) === null || _comp$$el === void 0 || (_comp$$el$querySelect2 = _comp$$el.querySelector) === null || _comp$$el$querySelect2 === void 0 ? void 0 : _comp$$el$querySelect2.call(_comp$$el, '.el-dialog')) !== null && _comp$$el$querySelect !== void 0 ? _comp$$el$querySelect : null;
|
|
209
|
+
}
|
|
210
|
+
function applyDialogPixelSize(panel, width, height, position) {
|
|
211
|
+
if (!panel) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
panel.style.width = "".concat(width, "px");
|
|
215
|
+
panel.style.maxWidth = "".concat(width, "px");
|
|
216
|
+
panel.style.height = "".concat(height, "px");
|
|
217
|
+
panel.style.maxHeight = "".concat(height, "px");
|
|
218
|
+
dialogPixelWidth.value = width;
|
|
219
|
+
dialogPixelHeight.value = height;
|
|
220
|
+
if (position) {
|
|
221
|
+
panel.style.marginLeft = "".concat(position.left, "px");
|
|
222
|
+
panel.style.marginTop = "".concat(position.top, "px");
|
|
223
|
+
panel.style.marginRight = 'auto';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function pinDialogVisualPosition(panel) {
|
|
227
|
+
var rect = panel.getBoundingClientRect();
|
|
228
|
+
panel.style.transform = 'none';
|
|
229
|
+
panel.style.marginLeft = "".concat(rect.left, "px");
|
|
230
|
+
panel.style.marginTop = "".concat(rect.top, "px");
|
|
231
|
+
panel.style.marginRight = 'auto';
|
|
232
|
+
panel.dataset.proDialogPositionPinned = '1';
|
|
233
|
+
}
|
|
234
|
+
function resetDialogPosition(panel) {
|
|
235
|
+
if (!panel) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
panel.style.removeProperty('margin-left');
|
|
239
|
+
panel.style.removeProperty('margin-top');
|
|
240
|
+
panel.style.removeProperty('margin-right');
|
|
241
|
+
panel.style.removeProperty('transform');
|
|
242
|
+
delete panel.dataset.proDialogPositionPinned;
|
|
243
|
+
}
|
|
244
|
+
function initDialogSizeFromPanel(panel) {
|
|
245
|
+
var _attrs$width;
|
|
246
|
+
var widthAttr = (_attrs$width = attrs.width) !== null && _attrs$width !== void 0 ? _attrs$width : attrs['width'];
|
|
247
|
+
var initialW = clampSize(parseWidthAttrToPx(widthAttr), resizeMinWidth.value, resizeMaxWidth.value);
|
|
248
|
+
var rectH = panel.getBoundingClientRect().height;
|
|
249
|
+
var initialH = clampSize(rectH > 0 ? Math.ceil(rectH) : resizeMinHeight.value, resizeMinHeight.value, resizeMaxHeight.value);
|
|
250
|
+
applyDialogPixelSize(panel, initialW, initialH);
|
|
251
|
+
}
|
|
252
|
+
function removeResizeHandles() {
|
|
253
|
+
var _resizeHandlesEl;
|
|
254
|
+
if ((_resizeHandlesEl = resizeHandlesEl) !== null && _resizeHandlesEl !== void 0 && _resizeHandlesEl.parentNode) {
|
|
255
|
+
resizeHandlesEl.parentNode.removeChild(resizeHandlesEl);
|
|
256
|
+
}
|
|
257
|
+
resizeHandlesEl = null;
|
|
258
|
+
resizePanelEl = null;
|
|
259
|
+
}
|
|
260
|
+
var RESIZE_EDGE_CONFIG = [{
|
|
261
|
+
dir: 'n',
|
|
262
|
+
className: 'pro-dialog-resize-handle--n',
|
|
263
|
+
cursor: 'ns-resize'
|
|
264
|
+
}, {
|
|
265
|
+
dir: 's',
|
|
266
|
+
className: 'pro-dialog-resize-handle--s',
|
|
267
|
+
cursor: 'ns-resize'
|
|
268
|
+
}, {
|
|
269
|
+
dir: 'e',
|
|
270
|
+
className: 'pro-dialog-resize-handle--e',
|
|
271
|
+
cursor: 'ew-resize'
|
|
272
|
+
}, {
|
|
273
|
+
dir: 'w',
|
|
274
|
+
className: 'pro-dialog-resize-handle--w',
|
|
275
|
+
cursor: 'ew-resize'
|
|
276
|
+
}, {
|
|
277
|
+
dir: 'nw',
|
|
278
|
+
className: 'pro-dialog-resize-handle--nw',
|
|
279
|
+
cursor: 'nwse-resize'
|
|
280
|
+
}, {
|
|
281
|
+
dir: 'ne',
|
|
282
|
+
className: 'pro-dialog-resize-handle--ne',
|
|
283
|
+
cursor: 'nesw-resize'
|
|
284
|
+
}, {
|
|
285
|
+
dir: 'sw',
|
|
286
|
+
className: 'pro-dialog-resize-handle--sw',
|
|
287
|
+
cursor: 'nesw-resize'
|
|
288
|
+
}, {
|
|
289
|
+
dir: 'se',
|
|
290
|
+
className: 'pro-dialog-resize-handle--se',
|
|
291
|
+
cursor: 'nwse-resize'
|
|
292
|
+
}];
|
|
293
|
+
function startResizePointer(e, direction) {
|
|
294
|
+
var _RESIZE_EDGE_CONFIG$f;
|
|
295
|
+
if (!resizePanelEl) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
e.stopPropagation();
|
|
300
|
+
var panel = resizePanelEl;
|
|
301
|
+
var startX = e.clientX;
|
|
302
|
+
var startY = e.clientY;
|
|
303
|
+
var startRect = panel.getBoundingClientRect();
|
|
304
|
+
var startW = startRect.width;
|
|
305
|
+
var startH = startRect.height;
|
|
306
|
+
var startLeft = startRect.left;
|
|
307
|
+
var startTop = startRect.top;
|
|
308
|
+
var affectsPosition = /[nw]/.test(direction);
|
|
309
|
+
if (affectsPosition) {
|
|
310
|
+
pinDialogVisualPosition(panel);
|
|
311
|
+
}
|
|
312
|
+
var onMove = function onMove(ev) {
|
|
313
|
+
var deltaX = ev.clientX - startX;
|
|
314
|
+
var deltaY = ev.clientY - startY;
|
|
315
|
+
var nextW = startW;
|
|
316
|
+
var nextH = startH;
|
|
317
|
+
var nextLeft = startLeft;
|
|
318
|
+
var nextTop = startTop;
|
|
319
|
+
if (direction.includes('e')) {
|
|
320
|
+
nextW = startW + deltaX;
|
|
321
|
+
}
|
|
322
|
+
if (direction.includes('w')) {
|
|
323
|
+
nextW = startW - deltaX;
|
|
324
|
+
nextLeft = startLeft + deltaX;
|
|
325
|
+
}
|
|
326
|
+
if (direction.includes('s')) {
|
|
327
|
+
nextH = startH + deltaY;
|
|
328
|
+
}
|
|
329
|
+
if (direction.includes('n')) {
|
|
330
|
+
nextH = startH - deltaY;
|
|
331
|
+
nextTop = startTop + deltaY;
|
|
332
|
+
}
|
|
333
|
+
if (direction.includes('w')) {
|
|
334
|
+
var clampedW = clampSize(nextW, resizeMinWidth.value, resizeMaxWidth.value);
|
|
335
|
+
nextLeft += nextW - clampedW;
|
|
336
|
+
nextW = clampedW;
|
|
337
|
+
} else if (direction.includes('e')) {
|
|
338
|
+
nextW = clampSize(nextW, resizeMinWidth.value, resizeMaxWidth.value);
|
|
339
|
+
}
|
|
340
|
+
if (direction.includes('n')) {
|
|
341
|
+
var clampedH = clampSize(nextH, resizeMinHeight.value, resizeMaxHeight.value);
|
|
342
|
+
nextTop += nextH - clampedH;
|
|
343
|
+
nextH = clampedH;
|
|
344
|
+
} else if (direction.includes('s')) {
|
|
345
|
+
nextH = clampSize(nextH, resizeMinHeight.value, resizeMaxHeight.value);
|
|
346
|
+
}
|
|
347
|
+
var position = affectsPosition ? {
|
|
348
|
+
left: nextLeft,
|
|
349
|
+
top: nextTop
|
|
350
|
+
} : undefined;
|
|
351
|
+
applyDialogPixelSize(panel, nextW, nextH, position);
|
|
352
|
+
};
|
|
353
|
+
var _onUp = function onUp() {
|
|
354
|
+
document.removeEventListener('pointermove', onMove);
|
|
355
|
+
document.removeEventListener('pointerup', _onUp);
|
|
356
|
+
document.body.style.removeProperty('user-select');
|
|
357
|
+
document.body.style.removeProperty('cursor');
|
|
358
|
+
};
|
|
359
|
+
document.addEventListener('pointermove', onMove);
|
|
360
|
+
document.addEventListener('pointerup', _onUp);
|
|
361
|
+
document.body.style.userSelect = 'none';
|
|
362
|
+
document.body.style.cursor = ((_RESIZE_EDGE_CONFIG$f = RESIZE_EDGE_CONFIG.find(function (item) {
|
|
363
|
+
return item.dir === direction;
|
|
364
|
+
})) === null || _RESIZE_EDGE_CONFIG$f === void 0 ? void 0 : _RESIZE_EDGE_CONFIG$f.cursor) || 'default';
|
|
365
|
+
}
|
|
366
|
+
function mountResizeHandles(panel) {
|
|
367
|
+
removeResizeHandles();
|
|
368
|
+
resizePanelEl = panel;
|
|
369
|
+
panel.classList.add('pro-dialog-panel--resizable');
|
|
370
|
+
var wrapper = document.createElement('div');
|
|
371
|
+
wrapper.className = 'pro-dialog-resize-handles';
|
|
372
|
+
RESIZE_EDGE_CONFIG.forEach(function (_ref2) {
|
|
373
|
+
var dir = _ref2.dir,
|
|
374
|
+
className = _ref2.className,
|
|
375
|
+
cursor = _ref2.cursor;
|
|
376
|
+
var handle = document.createElement('div');
|
|
377
|
+
handle.className = "pro-dialog-resize-handle ".concat(className);
|
|
378
|
+
handle.setAttribute('data-resize-dir', dir);
|
|
379
|
+
handle.style.cursor = cursor;
|
|
380
|
+
handle.addEventListener('pointerdown', function (ev) {
|
|
381
|
+
return startResizePointer(ev, dir);
|
|
382
|
+
});
|
|
383
|
+
wrapper.appendChild(handle);
|
|
384
|
+
});
|
|
385
|
+
panel.appendChild(wrapper);
|
|
386
|
+
resizeHandlesEl = wrapper;
|
|
387
|
+
}
|
|
388
|
+
function handleDialogOpened() {
|
|
389
|
+
if (!resizable.value) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
nextTick(function () {
|
|
393
|
+
var panel = getDialogPanelEl();
|
|
394
|
+
if (!panel) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
initDialogSizeFromPanel(panel);
|
|
398
|
+
mountResizeHandles(panel);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
function handleDialogClosed() {
|
|
402
|
+
var panel = getDialogPanelEl();
|
|
403
|
+
resetDialogPosition(panel);
|
|
404
|
+
removeResizeHandles();
|
|
405
|
+
dialogPixelWidth.value = null;
|
|
406
|
+
dialogPixelHeight.value = null;
|
|
407
|
+
}
|
|
89
408
|
|
|
90
409
|
// 获取 el-dialog 的原生属性,过滤掉我们自定义的属性
|
|
91
410
|
var getDialogProps = computed(function () {
|
|
92
411
|
attrs.modelValue;
|
|
412
|
+
attrs.resizable;
|
|
413
|
+
attrs.resizeMinWidth;
|
|
414
|
+
attrs.resizeMinHeight;
|
|
415
|
+
attrs.resizeMaxWidth;
|
|
416
|
+
attrs.resizeMaxHeight;
|
|
417
|
+
attrs['resize-min-width'];
|
|
418
|
+
attrs['resize-min-height'];
|
|
419
|
+
attrs['resize-max-width'];
|
|
420
|
+
attrs['resize-max-height'];
|
|
421
|
+
attrs["class"];
|
|
422
|
+
attrs.style;
|
|
423
|
+
attrs.width;
|
|
93
424
|
var dialogAttrs = _objectWithoutProperties(attrs, _excluded);
|
|
94
425
|
return dialogAttrs;
|
|
95
426
|
});
|
|
@@ -257,14 +588,22 @@ var script = {
|
|
|
257
588
|
document.removeEventListener('pro-table-group-added', handleTableGroupAdded, true);
|
|
258
589
|
});
|
|
259
590
|
return function (_ctx, _cache) {
|
|
260
|
-
return openBlock(), createBlock(unref(ElDialog), mergeProps(
|
|
591
|
+
return openBlock(), createBlock(unref(ElDialog), mergeProps({
|
|
592
|
+
ref_key: "dialogComponentRef",
|
|
593
|
+
ref: dialogComponentRef
|
|
594
|
+
}, getDialogProps.value, {
|
|
595
|
+
"class": dialogRootClass.value,
|
|
261
596
|
"model-value": __props.modelValue,
|
|
262
|
-
|
|
597
|
+
width: dialogWidthProp.value,
|
|
598
|
+
style: dialogRootStyle.value,
|
|
599
|
+
"onUpdate:modelValue": handleUpdateModelValue,
|
|
600
|
+
onOpened: handleDialogOpened,
|
|
601
|
+
onClosed: handleDialogClosed
|
|
263
602
|
}), createSlots({
|
|
264
|
-
header: withCtx(function (
|
|
265
|
-
var close =
|
|
266
|
-
titleId =
|
|
267
|
-
titleClass =
|
|
603
|
+
header: withCtx(function (_ref3) {
|
|
604
|
+
var close = _ref3.close,
|
|
605
|
+
titleId = _ref3.titleId,
|
|
606
|
+
titleClass = _ref3.titleClass;
|
|
268
607
|
return [createElementVNode("div", _hoisted_1, [createElementVNode("div", {
|
|
269
608
|
id: titleId,
|
|
270
609
|
"class": normalizeClass(titleClass)
|
|
@@ -293,10 +632,10 @@ var script = {
|
|
|
293
632
|
}, [renderSlot(_ctx.$slots, "header-content")], 2 /* CLASS */)) : createCommentVNode("v-if", true), createCommentVNode(" 下部分 slot:可滚动 "), hasBodyContentSlot.value ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(ElScrollbar), {
|
|
294
633
|
ref_key: "bodyScrollbarRef",
|
|
295
634
|
ref: bodyScrollbarRef,
|
|
296
|
-
"class": "pro-dialog-body-content",
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
635
|
+
"class": normalizeClass(["pro-dialog-body-content", {
|
|
636
|
+
'pro-dialog-body-content--fill': resizable.value
|
|
637
|
+
}]),
|
|
638
|
+
style: normalizeStyle(bodyScrollbarStyle.value),
|
|
300
639
|
onProTableRowAdded: handleTableRowAdded,
|
|
301
640
|
onProTableGroupAdded: handleTableGroupAdded
|
|
302
641
|
}, {
|
|
@@ -308,7 +647,7 @@ var script = {
|
|
|
308
647
|
}, [renderSlot(_ctx.$slots, "body-content")], 512 /* NEED_PATCH */)];
|
|
309
648
|
}),
|
|
310
649
|
_: 3 /* FORWARDED */
|
|
311
|
-
}, 8 /* PROPS */, ["style"])])) : createCommentVNode("v-if", true)])) : (openBlock(), createElementBlock(Fragment, {
|
|
650
|
+
}, 8 /* PROPS */, ["class", "style"])])) : createCommentVNode("v-if", true)])) : (openBlock(), createElementBlock(Fragment, {
|
|
312
651
|
key: 1
|
|
313
652
|
}, [createCommentVNode(" 默认内容 slot "), createElementVNode("div", _hoisted_5, [renderSlot(_ctx.$slots, "default")])], 64 /* STABLE_FRAGMENT */))];
|
|
314
653
|
}),
|
|
@@ -320,7 +659,7 @@ var script = {
|
|
|
320
659
|
return [renderSlot(_ctx.$slots, slotName, normalizeProps(guardReactiveProps(slotProps)))];
|
|
321
660
|
})
|
|
322
661
|
};
|
|
323
|
-
})]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["model-value"]);
|
|
662
|
+
})]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["class", "model-value", "width", "style"]);
|
|
324
663
|
};
|
|
325
664
|
}
|
|
326
665
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deppon/deppon-template",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.24",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"less": "^4.2.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@deppon/deppon-assets": "2.4.
|
|
47
|
-
"@deppon/deppon-request": "2.4.
|
|
48
|
-
"@deppon/deppon-router": "2.4.
|
|
49
|
-
"@deppon/deppon-ui": "2.4.
|
|
50
|
-
"@deppon/deppon-utils": "2.4.
|
|
46
|
+
"@deppon/deppon-assets": "2.4.24",
|
|
47
|
+
"@deppon/deppon-request": "2.4.24",
|
|
48
|
+
"@deppon/deppon-router": "2.4.24",
|
|
49
|
+
"@deppon/deppon-ui": "2.4.24",
|
|
50
|
+
"@deppon/deppon-utils": "2.4.24",
|
|
51
51
|
"dayjs": "^1.11.10",
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
53
53
|
"mitt": "^3.0.1"
|