yuang-framework-ui-pc 1.1.15 → 1.1.17

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 (52) hide show
  1. package/es/core-components.js +3 -4
  2. package/es/ele-dialog/index.d.ts +2 -2
  3. package/es/ele-dialog/index.js +15 -15
  4. package/es/ele-dialog/props.d.ts +3 -3
  5. package/es/ele-dialog/props.js +4 -4
  6. package/es/ele-dialog/util.d.ts +8 -8
  7. package/es/ele-dialog/util.js +93 -101
  8. package/es/style/plus.scss +2 -0
  9. package/es/style/themes/default.scss +26 -0
  10. package/es/yu-slider-captcha-dialog/SliderCaptcha.d.ts +67 -0
  11. package/es/yu-slider-captcha-dialog/SliderCaptcha.js +528 -0
  12. package/es/yu-slider-captcha-dialog/index.d.ts +14 -0
  13. package/es/yu-slider-captcha-dialog/index.js +75 -0
  14. package/es/yu-slider-captcha-dialog/style.css +175 -0
  15. package/lib/core-components.cjs +53 -54
  16. package/lib/ele-dialog/index.cjs +13 -13
  17. package/lib/ele-dialog/index.d.ts +2 -2
  18. package/lib/ele-dialog/props.cjs +4 -4
  19. package/lib/ele-dialog/props.d.ts +3 -3
  20. package/lib/ele-dialog/util.cjs +93 -101
  21. package/lib/ele-dialog/util.d.ts +8 -8
  22. package/lib/style/plus.scss +2 -0
  23. package/lib/style/themes/default.scss +26 -0
  24. package/lib/yu-slider-captcha-dialog/SliderCaptcha.cjs +527 -0
  25. package/lib/yu-slider-captcha-dialog/SliderCaptcha.d.ts +67 -0
  26. package/lib/yu-slider-captcha-dialog/index.cjs +74 -0
  27. package/lib/yu-slider-captcha-dialog/index.d.ts +14 -0
  28. package/lib/yu-slider-captcha-dialog/style.css +175 -0
  29. package/package.json +2 -2
  30. package/typings/global.d.ts +0 -1
  31. package/es/ele-modal/index.d.ts +0 -245
  32. package/es/ele-modal/index.js +0 -342
  33. package/es/ele-modal/props.d.ts +0 -135
  34. package/es/ele-modal/props.js +0 -71
  35. package/es/ele-modal/style/css-var.scss +0 -8
  36. package/es/ele-modal/style/index.d.ts +0 -1
  37. package/es/ele-modal/style/index.js +0 -3
  38. package/es/ele-modal/style/index.scss +0 -259
  39. package/es/ele-modal/types.d.ts +0 -43
  40. package/es/ele-modal/util.d.ts +0 -52
  41. package/es/ele-modal/util.js +0 -301
  42. package/lib/ele-modal/index.cjs +0 -341
  43. package/lib/ele-modal/index.d.ts +0 -245
  44. package/lib/ele-modal/props.cjs +0 -71
  45. package/lib/ele-modal/props.d.ts +0 -135
  46. package/lib/ele-modal/style/css-var.scss +0 -8
  47. package/lib/ele-modal/style/index.cjs +0 -4
  48. package/lib/ele-modal/style/index.d.ts +0 -1
  49. package/lib/ele-modal/style/index.scss +0 -259
  50. package/lib/ele-modal/types.d.ts +0 -43
  51. package/lib/ele-modal/util.cjs +0 -301
  52. package/lib/ele-modal/util.d.ts +0 -52
@@ -1,301 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("vue");
4
- const core = require("../utils/core");
5
- const hook = require("../utils/hook");
6
- const containerClass = "ele-dialog-container";
7
- const wrapperClass = "ele-dialog";
8
- const closedClass = "ele-dialog-closed";
9
- const fixTop = 0.65;
10
- const fixLeft = 0.65;
11
- function getModalEl(dialogRef) {
12
- var _a, _b;
13
- const el = (_b = vue.unref((_a = vue.unref(dialogRef)) == null ? void 0 : _a.dialogContentRef)) == null ? void 0 : _b.$el;
14
- return el;
15
- }
16
- function initModalStyle(modalEl) {
17
- modalEl.style.top = modalEl.offsetTop + "px";
18
- modalEl.style.left = modalEl.offsetLeft + "px";
19
- modalEl.style.right = "auto";
20
- modalEl.style.bottom = "auto";
21
- modalEl.style.position = "absolute";
22
- modalEl.style.margin = "0";
23
- }
24
- function canMoveOut(moveOut, direction) {
25
- if (direction && moveOut != null && Array.isArray(moveOut)) {
26
- return moveOut.includes(direction);
27
- }
28
- return false;
29
- }
30
- function getDialogContainer(inner, multiple, appendTo, modalsEl) {
31
- if (multiple) {
32
- const parent = (inner ? modalsEl : void 0) || document.body;
33
- const wrapper = core.queryChild(parent, containerClass);
34
- if (wrapper) {
35
- return wrapper;
36
- }
37
- const elem = document.createElement("div");
38
- elem.classList.add(containerClass);
39
- parent.appendChild(elem);
40
- return elem;
41
- }
42
- if (inner && modalsEl) {
43
- return modalsEl;
44
- }
45
- return appendTo || "body";
46
- }
47
- function useModalMove(dialogRef, props, isFullscreen) {
48
- let modalEl = null;
49
- let wrapEl = null;
50
- let downOL = null;
51
- let downOT = null;
52
- const { handleMousedown, handleTouchstart } = hook.useMoveEvent({
53
- start: () => {
54
- modalEl = getModalEl(dialogRef);
55
- wrapEl = modalEl == null ? void 0 : modalEl.parentElement;
56
- if (!modalEl || !wrapEl || !props.draggable || isFullscreen.value) {
57
- return;
58
- }
59
- modalEl.style.userSelect = "none";
60
- initModalStyle(modalEl);
61
- downOL = modalEl.offsetLeft;
62
- downOT = modalEl.offsetTop;
63
- },
64
- move: ({ distanceX, distanceY, e }) => {
65
- if (!modalEl || !wrapEl || downOL == null || downOT == null || distanceX == null || distanceY == null) {
66
- return;
67
- }
68
- e.preventDefault();
69
- let positionLeft = distanceX + downOL;
70
- let positionTop = distanceY + downOT;
71
- const limitL = wrapEl.clientWidth - modalEl.clientWidth - fixLeft;
72
- const limitT = wrapEl.clientHeight - modalEl.clientHeight - fixTop;
73
- if (!props.moveOut) {
74
- if (positionLeft < 0) {
75
- positionLeft = 0;
76
- } else if (positionLeft > limitL) {
77
- positionLeft = limitL;
78
- }
79
- if (positionTop > limitT) {
80
- positionTop = limitT;
81
- }
82
- if (positionTop < 0) {
83
- positionTop = 0;
84
- }
85
- } else {
86
- if (!canMoveOut(props.moveOut, "left") && positionLeft < 0) {
87
- positionLeft = 0;
88
- }
89
- if (!canMoveOut(props.moveOut, "right") && positionLeft > limitL) {
90
- positionLeft = limitL;
91
- }
92
- if (!canMoveOut(props.moveOut, "bottom") && positionTop > limitT) {
93
- positionTop = limitT;
94
- }
95
- if (!canMoveOut(props.moveOut, "top") && positionTop < 0) {
96
- positionTop = 0;
97
- }
98
- const minLimitL = wrapEl.clientWidth - 48;
99
- if (positionLeft > minLimitL) {
100
- positionLeft = minLimitL;
101
- }
102
- const minLimitT = wrapEl.clientHeight - 48;
103
- if (props.multiple && positionTop > minLimitT) {
104
- positionTop = minLimitT;
105
- }
106
- }
107
- modalEl.style.left = `${Math.floor(positionLeft)}px`;
108
- modalEl.style.top = `${Math.floor(positionTop)}px`;
109
- },
110
- end: () => {
111
- if (modalEl) {
112
- modalEl.style.userSelect = "";
113
- }
114
- downOL = null;
115
- downOT = null;
116
- modalEl = null;
117
- wrapEl = null;
118
- },
119
- touchmoveOptions: { passive: false }
120
- });
121
- return {
122
- handleHeaderMousedown: handleMousedown,
123
- handleHeaderTouchstart: handleTouchstart
124
- };
125
- }
126
- function useModalResize(dialogRef, props, isFullscreen) {
127
- let modalEl = null;
128
- let wrapEl = null;
129
- let downW = null;
130
- let downH = null;
131
- const { handleMousedown, handleTouchstart } = hook.useMoveEvent({
132
- start: () => {
133
- modalEl = getModalEl(dialogRef);
134
- wrapEl = modalEl == null ? void 0 : modalEl.parentElement;
135
- if (!modalEl || !wrapEl || !props.resizable || isFullscreen.value) {
136
- return;
137
- }
138
- modalEl.style.userSelect = "none";
139
- initModalStyle(modalEl);
140
- downW = modalEl.clientWidth;
141
- downH = modalEl.clientHeight;
142
- },
143
- move: ({ distanceX, distanceY, e }) => {
144
- if (!modalEl || !wrapEl || downW == null || downH == null || distanceX == null || distanceY == null) {
145
- return;
146
- }
147
- e.preventDefault();
148
- if (props.resizable !== "vertical") {
149
- const w = distanceX + downW;
150
- const maxW = wrapEl.clientWidth - modalEl.offsetLeft - fixLeft;
151
- const nw = (w < props.minWidth ? props.minWidth : !canMoveOut(props.moveOut, "right") && w > maxW ? maxW : w) + "px";
152
- modalEl.style.width = nw;
153
- modalEl.style.maxWidth = nw;
154
- modalEl.style.minWidth = nw;
155
- }
156
- if (props.resizable !== "horizontal") {
157
- const h = distanceY + downH;
158
- const maxH = wrapEl.clientHeight - modalEl.offsetTop - fixTop;
159
- const nh = (h < props.minHeight ? props.minHeight : !canMoveOut(props.moveOut, "bottom") && h > maxH ? maxH : h) + "px";
160
- modalEl.style.height = nh;
161
- modalEl.style.maxHeight = nh;
162
- modalEl.style.minHeight = nh;
163
- }
164
- },
165
- end: () => {
166
- if (modalEl) {
167
- modalEl.style.userSelect = "";
168
- }
169
- downW = null;
170
- downH = null;
171
- modalEl = null;
172
- wrapEl = null;
173
- },
174
- touchmoveOptions: { passive: false }
175
- });
176
- return {
177
- handleResizeMousedown: handleMousedown,
178
- handleResizeTouchstart: handleTouchstart
179
- };
180
- }
181
- function useModalEvent(dialogRef, props, isFullscreen) {
182
- const { handleHeaderMousedown, handleHeaderTouchstart } = useModalMove(
183
- dialogRef,
184
- props,
185
- isFullscreen
186
- );
187
- const { handleResizeMousedown, handleResizeTouchstart } = useModalResize(
188
- dialogRef,
189
- props,
190
- isFullscreen
191
- );
192
- let isInitPosition = true;
193
- const getZIndex = () => {
194
- return props.zIndex ?? 2e3;
195
- };
196
- const topModal = (el) => {
197
- var _a;
198
- const modalEl = el ?? getModalEl(dialogRef);
199
- const overlayEl = (_a = modalEl == null ? void 0 : modalEl.parentElement) == null ? void 0 : _a.parentElement;
200
- if (!overlayEl) {
201
- return;
202
- }
203
- const currentIndex = core.getCurrentStyle(overlayEl).zIndex;
204
- const containerEl = overlayEl.parentElement;
205
- const cls = `.${wrapperClass}:not(.${closedClass})`;
206
- const modals = containerEl ? containerEl.querySelectorAll(cls) : void 0;
207
- let maxIndex = 0;
208
- (modals ? Array.from(modals) : []).forEach((modalEl2) => {
209
- const zIndex = core.getCurrentStyle(modalEl2).zIndex;
210
- if (zIndex != null) {
211
- const index = Number(zIndex);
212
- if (index >= maxIndex && (!overlayEl || modalEl2 !== overlayEl)) {
213
- maxIndex = index + 1;
214
- }
215
- }
216
- });
217
- if (maxIndex > Number(currentIndex || getZIndex() || 0)) {
218
- overlayEl.style.zIndex = String(maxIndex);
219
- }
220
- };
221
- const mousedownListener = (event) => {
222
- if (props.multiple) {
223
- topModal(event.currentTarget);
224
- }
225
- };
226
- const bindAutoTopEvent = () => {
227
- const modalEl = getModalEl(dialogRef);
228
- if (modalEl) {
229
- modalEl.addEventListener("mousedown", mousedownListener);
230
- modalEl.addEventListener("touchstart", mousedownListener);
231
- }
232
- };
233
- const unbindAutoTopEvent = () => {
234
- const modalEl = getModalEl(dialogRef);
235
- if (modalEl) {
236
- modalEl.removeEventListener("mousedown", mousedownListener);
237
- modalEl.removeEventListener("touchstart", mousedownListener);
238
- }
239
- };
240
- const getPositionMargin = (position) => {
241
- if (position == null || typeof position !== "object" || position.top == null && position.right == null && position.bottom == null && position.left == null) {
242
- return;
243
- }
244
- return [position.top, position.right, position.bottom, position.left].map((p) => typeof p === "number" ? `${p}px` : p || "auto").join(" ");
245
- };
246
- const getPosition = () => {
247
- if (props.alignCenter) {
248
- return "center";
249
- }
250
- if (props.top != null && props.top !== "") {
251
- return { top: props.top };
252
- }
253
- return props.position;
254
- };
255
- const setInitPosition = () => {
256
- if (isInitPosition) {
257
- isInitPosition = false;
258
- const modalEl = getModalEl(dialogRef);
259
- const margin = getPositionMargin(getPosition());
260
- if (modalEl && margin != null) {
261
- modalEl.style.margin = margin;
262
- }
263
- }
264
- };
265
- const resetModalStyle = () => {
266
- const modalEl = getModalEl(dialogRef);
267
- if (modalEl) {
268
- const w = props.width;
269
- modalEl.style.margin = getPositionMargin(getPosition()) || "";
270
- modalEl.style.position = "";
271
- modalEl.style.top = "";
272
- modalEl.style.left = "";
273
- modalEl.style.right = "";
274
- modalEl.style.bottom = "";
275
- modalEl.style.height = "";
276
- modalEl.style.maxHeight = "";
277
- modalEl.style.minHeight = "";
278
- modalEl.style.width = typeof w === "number" ? `${w}px` : w ?? "";
279
- modalEl.style.maxWidth = "";
280
- modalEl.style.minWidth = "";
281
- }
282
- };
283
- return {
284
- handleHeaderMousedown,
285
- handleHeaderTouchstart,
286
- handleResizeMousedown,
287
- handleResizeTouchstart,
288
- bindAutoTopEvent,
289
- unbindAutoTopEvent,
290
- topModal,
291
- setInitPosition,
292
- resetModalStyle
293
- };
294
- }
295
- exports.closedClass = closedClass;
296
- exports.containerClass = containerClass;
297
- exports.getDialogContainer = getDialogContainer;
298
- exports.useModalEvent = useModalEvent;
299
- exports.useModalMove = useModalMove;
300
- exports.useModalResize = useModalResize;
301
- exports.wrapperClass = wrapperClass;
@@ -1,52 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { ElDialogInstance } from '../ele-app/el';
3
- import { ModalProps } from './props';
4
-
5
- export declare const containerClass = "ele-dialog-container";
6
- export declare const wrapperClass = "ele-dialog";
7
- export declare const closedClass = "ele-dialog-closed";
8
- /**
9
- * 获取弹窗容器
10
- * @param inner 是否限制在主体内部
11
- * @param multiple 是否支持同时打开多个
12
- * @param appendTo 自定义插入的容器
13
- * @param modalsEl 限制在主体内部时的容器
14
- */
15
- export declare function getDialogContainer(inner?: boolean, multiple?: boolean, appendTo?: string | HTMLElement, modalsEl?: HTMLElement | null): HTMLElement | string;
16
- /**
17
- * 弹窗支持移动
18
- * @param dialogRef 弹窗实例
19
- * @param props 属性
20
- * @param isFullscreen 全屏状态
21
- */
22
- export declare function useModalMove(dialogRef: Ref<ElDialogInstance>, props: ModalProps, isFullscreen: Ref<boolean>): {
23
- handleHeaderMousedown: (e: MouseEvent) => void;
24
- handleHeaderTouchstart: (e: TouchEvent) => void;
25
- };
26
- /**
27
- * 弹窗支持拉伸
28
- * @param dialogRef 弹窗实例
29
- * @param props 属性
30
- * @param isFullscreen 全屏状态
31
- */
32
- export declare function useModalResize(dialogRef: Ref<ElDialogInstance>, props: ModalProps, isFullscreen: Ref<boolean>): {
33
- handleResizeMousedown: (e: MouseEvent) => void;
34
- handleResizeTouchstart: (e: TouchEvent) => void;
35
- };
36
- /**
37
- * 弹窗事件处理
38
- * @param dialogRef 弹窗实例
39
- * @param props 属性
40
- * @param isFullscreen 全屏状态
41
- */
42
- export declare function useModalEvent(dialogRef: Ref<ElDialogInstance>, props: ModalProps, isFullscreen: Ref<boolean>): {
43
- handleHeaderMousedown: (e: MouseEvent) => void;
44
- handleHeaderTouchstart: (e: TouchEvent) => void;
45
- handleResizeMousedown: (e: MouseEvent) => void;
46
- handleResizeTouchstart: (e: TouchEvent) => void;
47
- bindAutoTopEvent: () => void;
48
- unbindAutoTopEvent: () => void;
49
- topModal: (el?: HTMLElement) => void;
50
- setInitPosition: () => void;
51
- resetModalStyle: () => void;
52
- };