vue-devui 1.0.0-beta.4 → 1.0.0-beta.8
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.
- package/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +186 -139
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +1 -1
- package/alert/index.umd.js +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +4 -4
- package/button/index.umd.js +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +3 -3
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +57 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +167 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +15 -15
- package/date-picker/index.umd.js +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +33 -9
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +61 -61
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +53 -26
- package/editable-select/index.umd.js +9 -9
- package/form/index.d.ts +7 -0
- package/form/index.es.js +175 -80
- package/form/index.umd.js +1 -1
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +1 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +2 -2
- package/grid/index.umd.js +1 -1
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +4 -4
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +23 -2
- package/image-preview/index.umd.js +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +12 -12
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +331 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +3 -3
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +58 -57
- package/modal/index.umd.js +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +56 -55
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -31
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +2 -2
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +61 -24
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +118 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +14 -14
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +3 -3
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +24 -25
- package/splitter/index.umd.js +1 -1
- package/status/index.d.ts +7 -0
- package/status/index.es.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +97 -74
- package/steps-guide/index.umd.js +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1492 -157
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +1 -0
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +94 -12
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +1 -1
- package/textarea/index.umd.js +1 -1
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +240 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +12 -7
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +4 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +301 -62
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +160 -31
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +435 -110
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +4 -4
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +14014 -11820
- package/vue-devui.umd.js +19 -19
package/modal/index.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive,
|
|
36
|
+
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, toRef, isRef, h, render, readonly, mergeProps } from "vue";
|
|
37
37
|
const modalProps = {
|
|
38
38
|
width: {
|
|
39
39
|
type: String,
|
|
@@ -129,7 +129,7 @@ const overlayProps = {
|
|
|
129
129
|
backgroundStyle: {
|
|
130
130
|
type: [String, Object]
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
onBackdropClick: {
|
|
133
133
|
type: Function
|
|
134
134
|
},
|
|
135
135
|
backdropClose: {
|
|
@@ -141,6 +141,7 @@ const overlayProps = {
|
|
|
141
141
|
default: true
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
+
const overlayEmits = ["onUpdate:visible", "backdropClick"];
|
|
144
145
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
145
146
|
overlayStyle: {
|
|
146
147
|
type: [String, Object],
|
|
@@ -176,7 +177,7 @@ function useOverlayLogic(props) {
|
|
|
176
177
|
const handleBackdropClick = (event) => {
|
|
177
178
|
var _a, _b;
|
|
178
179
|
event.preventDefault();
|
|
179
|
-
(_a = props.
|
|
180
|
+
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
180
181
|
if (props.backdropClose) {
|
|
181
182
|
(_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
|
|
182
183
|
}
|
|
@@ -215,6 +216,7 @@ function useOverlayLogic(props) {
|
|
|
215
216
|
const FixedOverlay = defineComponent({
|
|
216
217
|
name: "DFixedOverlay",
|
|
217
218
|
props: fixedOverlayProps,
|
|
219
|
+
emits: overlayEmits,
|
|
218
220
|
setup(props, ctx) {
|
|
219
221
|
const {
|
|
220
222
|
backgroundClass,
|
|
@@ -250,61 +252,46 @@ function getElement(element) {
|
|
|
250
252
|
const FlexibleOverlay = defineComponent({
|
|
251
253
|
name: "DFlexibleOverlay",
|
|
252
254
|
props: flexibleOverlayProps,
|
|
253
|
-
emits:
|
|
255
|
+
emits: overlayEmits,
|
|
254
256
|
setup(props, ctx) {
|
|
255
257
|
const overlayRef = ref(null);
|
|
256
258
|
const positionedStyle = reactive({
|
|
257
259
|
position: "absolute"
|
|
258
260
|
});
|
|
259
|
-
const instance = getCurrentInstance();
|
|
260
261
|
onMounted(async () => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
if (!overlay2) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const origin = getOrigin(props.origin);
|
|
267
|
-
if (!origin) {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
const handleRectChange = (rect) => {
|
|
271
|
-
const point = calculatePosition(props.position, rect, origin);
|
|
262
|
+
const handleRectChange = (position, rect, origin) => {
|
|
263
|
+
const point = calculatePosition(position, rect, origin);
|
|
272
264
|
positionedStyle.left = `${point.x}px`;
|
|
273
265
|
positionedStyle.top = `${point.y}px`;
|
|
274
266
|
};
|
|
275
|
-
const
|
|
267
|
+
const locationElements = computed(() => {
|
|
268
|
+
const overlay2 = overlayRef.value;
|
|
269
|
+
const origin = getOrigin(props.origin);
|
|
270
|
+
if (!overlay2 || !origin) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
return {
|
|
274
|
+
origin,
|
|
275
|
+
overlay: overlay2
|
|
276
|
+
};
|
|
277
|
+
});
|
|
276
278
|
const visibleRef = toRef(props, "visible");
|
|
277
279
|
const positionRef = toRef(props, "position");
|
|
278
|
-
watch(visibleRef, (visible, ov, onInvalidate) => {
|
|
279
|
-
if (visible) {
|
|
280
|
-
|
|
281
|
-
} else {
|
|
282
|
-
unsbscribeLayoutEvent(handleChange);
|
|
280
|
+
watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
|
|
281
|
+
if (!visible || !locationElements2) {
|
|
282
|
+
return;
|
|
283
283
|
}
|
|
284
|
+
const {
|
|
285
|
+
origin,
|
|
286
|
+
overlay: overlay2
|
|
287
|
+
} = locationElements2;
|
|
288
|
+
handleRectChange(position, overlay2.getBoundingClientRect(), origin);
|
|
289
|
+
const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
|
|
284
290
|
onInvalidate(() => {
|
|
285
|
-
|
|
291
|
+
unsubscriptions.forEach((fn) => fn());
|
|
286
292
|
});
|
|
287
293
|
});
|
|
288
|
-
|
|
289
|
-
handleChange();
|
|
290
|
-
});
|
|
291
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
292
|
-
handleRectChange(entries[0].contentRect);
|
|
293
|
-
});
|
|
294
|
-
resizeObserver.observe(overlay2);
|
|
295
|
-
onBeforeUnmount(() => {
|
|
296
|
-
resizeObserver.disconnect();
|
|
297
|
-
}, instance);
|
|
298
|
-
if (origin instanceof Element) {
|
|
299
|
-
const observer = new MutationObserver(handleChange);
|
|
300
|
-
observer.observe(origin, {
|
|
301
|
-
attributeFilter: ["style"]
|
|
302
|
-
});
|
|
303
|
-
onBeforeUnmount(() => {
|
|
304
|
-
observer.disconnect();
|
|
305
|
-
}, instance);
|
|
306
|
-
}
|
|
307
|
-
}, instance);
|
|
294
|
+
});
|
|
308
295
|
const {
|
|
309
296
|
backgroundClass,
|
|
310
297
|
overlayClass,
|
|
@@ -337,15 +324,9 @@ function getOrigin(origin) {
|
|
|
337
324
|
}
|
|
338
325
|
return origin;
|
|
339
326
|
}
|
|
340
|
-
function calculatePosition(position,
|
|
327
|
+
function calculatePosition(position, rect, origin) {
|
|
341
328
|
const originRect = getOriginRect(origin);
|
|
342
329
|
const originPoint = getOriginRelativePoint(originRect, position);
|
|
343
|
-
let rect;
|
|
344
|
-
if (panelOrRect instanceof HTMLElement) {
|
|
345
|
-
rect = panelOrRect.getBoundingClientRect();
|
|
346
|
-
} else {
|
|
347
|
-
rect = panelOrRect;
|
|
348
|
-
}
|
|
349
330
|
return getOverlayPoint(originPoint, rect, position);
|
|
350
331
|
}
|
|
351
332
|
function getOriginRect(origin) {
|
|
@@ -409,11 +390,31 @@ function subscribeLayoutEvent(event) {
|
|
|
409
390
|
window.addEventListener("scroll", event, true);
|
|
410
391
|
window.addEventListener("resize", event);
|
|
411
392
|
window.addEventListener("orientationchange", event);
|
|
393
|
+
return () => {
|
|
394
|
+
window.removeEventListener("scroll", event, true);
|
|
395
|
+
window.removeEventListener("resize", event);
|
|
396
|
+
window.removeEventListener("orientationchange", event);
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function subscribeOverlayResize(overlay2, callback) {
|
|
400
|
+
if (overlay2 instanceof Element) {
|
|
401
|
+
const resizeObserver = new ResizeObserver(callback);
|
|
402
|
+
resizeObserver.observe(overlay2);
|
|
403
|
+
return () => resizeObserver.disconnect();
|
|
404
|
+
}
|
|
405
|
+
return () => {
|
|
406
|
+
};
|
|
412
407
|
}
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
408
|
+
function subscribeOriginResize(origin, callback) {
|
|
409
|
+
if (origin instanceof Element) {
|
|
410
|
+
const observer = new MutationObserver(callback);
|
|
411
|
+
observer.observe(origin, {
|
|
412
|
+
attributeFilter: ["style"]
|
|
413
|
+
});
|
|
414
|
+
return () => observer.disconnect();
|
|
415
|
+
}
|
|
416
|
+
return () => {
|
|
417
|
+
};
|
|
417
418
|
}
|
|
418
419
|
const inBrowser = typeof window !== "undefined";
|
|
419
420
|
FlexibleOverlay.install = function(app) {
|
|
@@ -707,7 +708,7 @@ var Icon = defineComponent({
|
|
|
707
708
|
color,
|
|
708
709
|
classPrefix
|
|
709
710
|
} = this;
|
|
710
|
-
return
|
|
711
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
711
712
|
"src": name,
|
|
712
713
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
713
714
|
"style": {
|
|
@@ -719,7 +720,7 @@ var Icon = defineComponent({
|
|
|
719
720
|
fontSize: size,
|
|
720
721
|
color
|
|
721
722
|
}
|
|
722
|
-
}, null)
|
|
723
|
+
}, null);
|
|
723
724
|
}
|
|
724
725
|
});
|
|
725
726
|
Icon.install = function(app) {
|
|
@@ -1009,7 +1010,7 @@ Modal.install = function(app) {
|
|
|
1009
1010
|
var index = {
|
|
1010
1011
|
title: "Modal \u5F39\u7A97",
|
|
1011
1012
|
category: "\u53CD\u9988",
|
|
1012
|
-
status: "
|
|
1013
|
+
status: "100%",
|
|
1013
1014
|
install(app) {
|
|
1014
1015
|
app.use(Modal);
|
|
1015
1016
|
if (!inBrowser) {
|
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var be=Object.defineProperty,he=Object.defineProperties;var ge=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var I=(d,t,h)=>t in d?be(d,t,{enumerable:!0,configurable:!0,writable:!0,value:h}):d[t]=h,v=(d,t)=>{for(var h in t||(t={}))K.call(t,h)&&I(d,h,t[h]);if(R)for(var h of R(t))W.call(t,h)&&I(d,h,t[h]);return d},N=(d,t)=>he(d,ge(t));var L=(d,t)=>{var h={};for(var k in d)K.call(d,k)&&t.indexOf(k)<0&&(h[k]=d[k]);if(d!=null&&R)for(var k of R(d))t.indexOf(k)<0&&W.call(d,k)&&(h[k]=d[k]);return h};var D=(d,t,h)=>(I(d,typeof t!="symbol"?t+"":t,h),h);(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue))})(this,function(d,t){"use strict";const h={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Object,Function]},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}};var k="";function G(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const F=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},G(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),H={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},backdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},J=N(v({},H),{overlayStyle:{type:[String,Object],default:void 0}}),Q=v({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},H);function U(e){const n=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),o=t.computed(()=>"devui-overlay"),i=l=>{var s,r;l.preventDefault(),(s=e.backdropClick)==null||s.call(e),e.backdropClose&&((r=e["onUpdate:visible"])==null||r.call(e,!1))},a=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,s=l.style.overflow,r=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([f,m])=>{if(m){const c=l.getBoundingClientRect().y;f?(l.style.overflowY="scroll",l.style.position=f?"fixed":"",l.style.top=`${c}px`):(l.style.overflowY=s,l.style.position=r,l.style.top="",window.scrollTo(0,-c))}}),t.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:o,handleBackdropClick:i,handleOverlayBubbleCancel:a}}const M=t.defineComponent({name:"DFixedOverlay",props:J,setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:l}=U(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:l},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function ee(e){return!!(e==null?void 0:e.$el)}function z(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}const X=t.defineComponent({name:"DFlexibleOverlay",props:Q,emits:["onUpdate:visible"],setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"}),a=t.getCurrentInstance();t.onMounted(async()=>{await t.nextTick();const m=o.value;if(!m)return;const c=te(e.origin);if(!c)return;const u=p=>{const S=ne(e.position,p,c);i.left=`${S.x}px`,i.top=`${S.y}px`},b=()=>u(m.getBoundingClientRect()),y=t.toRef(e,"visible"),g=t.toRef(e,"position");t.watch(y,(p,S,V)=>{p?ie(b):T(b),V(()=>{T(b)})}),t.watch([y,g],()=>{b()});const w=new ResizeObserver(p=>{u(p[0].contentRect)});if(w.observe(m),t.onBeforeUnmount(()=>{w.disconnect()},a),c instanceof Element){const p=new MutationObserver(b);p.observe(c,{attributeFilter:["style"]}),t.onBeforeUnmount(()=>{p.disconnect()},a)}},a);const{backgroundClass:l,overlayClass:s,handleBackdropClick:r,handleOverlayBubbleCancel:f}=U(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:l.value,onClick:r},[t.createVNode("div",{ref:o,class:s.value,style:i,onClick:f},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function te(e){return e instanceof Element?e:t.isRef(e)?z(e.value):ee(e)?z(e):e}function ne(e,n,o){const i=oe(o),a=ae(i,e);let l;return n instanceof HTMLElement?l=n.getBoundingClientRect():l=n,le(a,l,e)}function oe(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function le(e,n,o){let i;const{width:a,height:l}=n;o.overlayX=="center"?i=e.x-a/2:i=o.overlayX=="left"?e.x:e.x-a;let s;return o.overlayY=="center"?s=e.y-l/2:s=o.overlayY=="top"?e.y:e.y-l,{x:i,y:s}}function ae(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const a=e.left,l=e.right;o=n.originX=="left"?a:l}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function ie(e){window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}function T(e){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}const re=typeof window!="undefined";X.install=function(e){e.component(X.name,X)},M.install=function(e){e.component(M.name,M)};var pe="",B=t.defineComponent({name:"DModal",props:h,emits:["onUpdate:modelValue"],setup(e,n){const o=t.computed(()=>e.showAnimation?e.modelValue:!0),i=a=>{var s;const l=e["onUpdate:modelValue"];if(a)l==null||l(a);else{const r=e.beforeHidden,f=c=>{var u;c&&(l==null||l(!1),(u=e.onClose)==null||u.call(e))},m=(s=typeof r=="function"?r():r)!=null?s:!0;m instanceof Promise?m.then(f):f(m)}};return n.expose({onVisibleChange:i}),()=>t.createVNode(M,{visible:e.modelValue,"onUpdate:visible":i,backgroundClass:"devui-modal-wrapper",backgroundBlock:!e.bodyScrollable,backdropClose:e.backdropCloseable},{default:()=>[t.createVNode(t.Transition,{name:"devui-modal-wipe"},{default:()=>{var a,l;return[o.value?(l=(a=n.slots).default)==null?void 0:l.call(a):null]}})]})}});class P{constructor(n){this.anchorContainer=n}renderModal(n,o,i){const a=t.h(this.component(),o,i);return t.render(a,n),a}renderNull(n){setTimeout(()=>{t.render(null,n)},500)}}class Y extends P{component(){return B}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const f=n,{content:i}=f,a=L(f,["content"]),l=m=>{m||r()},s=(m,c=l)=>this.renderModal(o,N(v({},m),{modelValue:!0,"onUpdate:modelValue":c}),{default:i}),r=()=>{var c,u;(u=(c=s(a,b=>{b?s(a):(this.renderModal(o,N(v({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).onVisibleChange)==null||u.call(c,!1)};return this.renderModal(o,{modelValue:!1}),s(a),{hide:r}}}D(Y,"token","MODAL_SERVICE_TOKEN");const de={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},title:{type:String},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Promise,Function]},buttons:{type:Array,default:[]},dialogType:{type:String,default:"standard"},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}},se=(e=!0)=>{const n=t.ref(0),o=t.ref(0),i=()=>{n.value=0,o.value=0},a=t.ref(),l=t.ref(),s=t.isRef(e)?e:t.ref(e);return t.watch([l,a],([r,f],m,c)=>{if(!(f instanceof HTMLElement&&r instanceof HTMLElement))return;f.style.cursor="all-scroll";let u=0,b=0,y=0,g=0,w=r.getBoundingClientRect(),p=document.body.getBoundingClientRect(),S=!1;const V=C=>{if(C.preventDefault(),!s.value)return;u=C.clientX,b=C.clientY;const x=f.getBoundingClientRect();(f===C.target||f.contains(C.target))&&x.x<u&&x.y<b&&x.width+x.x>=u&&x.height+x.y>=b&&(S=!0,y=n.value,g=o.value,p=document.body.getBoundingClientRect(),w=r.getBoundingClientRect())},_=C=>{if(C.preventDefault(),!S)return;const x=y+C.clientX-u,me=g+C.clientY-b,Z=w.x-y,q=w.y-g;n.value=j(x,-Z,p.width-w.width-Z),o.value=j(me,-q,p.height-w.height-q)},A=C=>{C.preventDefault(),!!S&&(S=!1)};window.addEventListener("mousedown",V),window.addEventListener("mousemove",_),window.addEventListener("mouseup",A),c(()=>{window.removeEventListener("mousedown",V),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",A)})}),{movingX:t.readonly(n),movingY:t.readonly(o),handleRef:a,moveElRef:l,reset:i}},j=(e,n,o)=>e<n?n:e>o?o:e;var O=t.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(e){return v({},e)},render(){const{name:e,size:n,color:o,classPrefix:i}=this;return t.createVNode(t.Fragment,null,[/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:n}},null):t.createVNode("i",{class:`${i} ${i}-${e}`,style:{fontSize:n,color:o}},null)])}});O.install=function(e){e.component(O.name,O)};const ce={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var we="",E=t.defineComponent({name:"DButton",props:ce,setup(e,n){const o=t.ref(null),i=r=>{var f;e.showLoading||(f=e.onClick)==null||f.call(e,r)},a=t.computed(()=>n.slots.default),l=t.computed(()=>{const{btnStyle:r,size:f,position:m,bordered:c,icon:u}=e,b=`devui-btn devui-btn-${r} devui-btn-${f} devui-btn-${m}`,y=c?"bordered":"",g=!!u&&!a.value&&r!=="primary"?"d-btn-icon":"";return`${b} ${y} ${g} ${u?"d-btn-icon-wrap":""}`}),s=t.computed(()=>{if(!e.icon)return;const r="devui-icon-fix icon";return a.value?`${r} clear-right-5`:r});return()=>{var b,y;const{icon:r,type:f,disabled:m,showLoading:c,width:u}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},n.attrs),[t.createVNode("button",{class:l.value,type:f,disabled:m,style:{width:u},onClick:i},[r?t.createVNode(O,{name:e.icon,class:s.value},null):null,t.createVNode("span",{class:"button-content",ref:o},[(y=(b=n.slots).default)==null?void 0:y.call(b)])])])}}});E.install=function(e){e.component(E.name,E)};function ue(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var fe=t.defineComponent({name:"DModal",inheritAttrs:!1,props:de,emits:["onUpdate:modelValue"],setup(e,n){const{movingX:o,movingY:i,handleRef:a,moveElRef:l,reset:s}=se();t.watch(()=>e.modelValue,y=>{y&&s()});const r=t.computed(()=>({position:"relative",left:`${o.value}px`,top:`${i.value}px`})),f=t.computed(()=>({width:e.width,maxHeight:e.maxHeight,transform:`translate(${e.offsetX}, ${e.offsetY})`,zIndex:e.zIndex})),m=t.computed(()=>{switch(e.dialogType){case"standard":return"";case"info":return"icon-info-o";case"success":return"icon-right-o";case"warning":return"icon-warning-o";case"failed":return"icon-error-o";default:return""}}),c=t.computed(()=>e.buttons.map((y,g)=>{const{btnStyle:w,disabled:p,handler:S,text:V}=y;return t.createVNode(E,{key:g,style:{display:"inline-block",margin:"0 5px"},btnStyle:w,disabled:p,onClick:S},ue(V)?V:{default:()=>[V]})})),u=t.ref(),b=()=>{var y,g;(g=(y=u.value)==null?void 0:y.onVisibleChange)==null||g.call(y,!1)};return n.expose({closeModal:b}),()=>t.createVNode(B,{ref:u,width:e.width,maxHeight:e.maxHeight,offsetX:e.offsetX,offsetY:e.offsetY,zIndex:e.zIndex,backdropZIndex:e.backdropZIndex,backdropCloseable:e.backdropCloseable,bodyScrollable:e.bodyScrollable,placement:e.placement,onClose:e.onClose,beforeHidden:e.beforeHidden,modelValue:e.modelValue,"onUpdate:modelValue":e["onUpdate:modelValue"]},{default:()=>{var y,g;return[t.createVNode("div",{class:"devui-modal-content",style:[f.value,r.value],ref:l},[t.createVNode("div",{class:"devui-modal-header",ref:a},[m.value?t.createVNode(O,{name:m.value,size:"24px",class:"header-alert-icon"},null):null,t.createVNode("span",null,[e.title]),t.createVNode(E,{class:"btn-close",icon:"close",btnStyle:"text-dark",onClick:b},null)]),t.createVNode("div",{class:"devui-modal-body"},[(g=(y=n.slots).default)==null?void 0:g.call(y)]),t.createVNode("div",{class:"devui-modal-footer"},[c.value])])]}})}});class $ extends P{component(){return fe}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const m=n,{content:i}=m,a=L(m,["content"]),l=c=>{c||r()},s=(c,u=l)=>this.renderModal(o,N(v({},c),{modelValue:!0,"onUpdate:modelValue":u}),{default:i}),r=()=>{var u,b;(b=(u=s(a,y=>{y?s(a):(this.renderModal(o,N(v({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).closeModal)==null||b.call(u)},f=c=>{const g=a,{buttons:u}=g,b=L(g,["buttons"]),y=u.map((w,p)=>v(v({},w),c[p]));s(N(v({},b),{buttons:y}))};return this.renderModal(o,{modelValue:!1}),s(a),{hide:r,updateButtonOptions:f}}}D($,"token","DIALOG_SERVICE_TOKEN"),B.install=function(e){e.component(B.name,B)};var ye={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"\u5DF2\u5B8C\u6210",install(e){if(e.use(B),!re)return;let n=document.getElementById("d-modal-anchors-container");n||(n=document.createElement("div"),n.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(n)),e.provide(Y.token,new Y(n)),e.provide($.token,new $(n))}};d.Modal=B,d.default=ye,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
|
1
|
+
var pe=Object.defineProperty,ge=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var D=(s,t,p)=>t in s?pe(s,t,{enumerable:!0,configurable:!0,writable:!0,value:p}):s[t]=p,k=(s,t)=>{for(var p in t||(t={}))K.call(t,p)&&D(s,p,t[p]);if(Y)for(var p of Y(t))W.call(t,p)&&D(s,p,t[p]);return s},O=(s,t)=>ge(s,ve(t));var $=(s,t)=>{var p={};for(var S in s)K.call(s,S)&&t.indexOf(S)<0&&(p[S]=s[S]);if(s!=null&&Y)for(var S of Y(s))t.indexOf(S)<0&&W.call(s,S)&&(p[S]=s[S]);return p};var H=(s,t,p)=>(D(s,typeof t!="symbol"?t+"":t,p),p);(function(s,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(s=typeof globalThis!="undefined"?globalThis:s||self,t(s.index={},s.Vue))})(this,function(s,t){"use strict";const p={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Object,Function]},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}};var S="";function G(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const F=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},G(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),P={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},U=["onUpdate:visible","backdropClick"],J=O(k({},P),{overlayStyle:{type:[String,Object],default:void 0}}),Q=k({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},P);function j(e){const n=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),o=t.computed(()=>"devui-overlay"),i=l=>{var u,r;l.preventDefault(),(u=e.onBackdropClick)==null||u.call(e),e.backdropClose&&((r=e["onUpdate:visible"])==null||r.call(e,!1))},a=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,u=l.style.overflow,r=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([c,b])=>{if(b){const m=l.getBoundingClientRect().y;c?(l.style.overflowY="scroll",l.style.position=c?"fixed":"",l.style.top=`${m}px`):(l.style.overflowY=u,l.style.position=r,l.style.top="",window.scrollTo(0,-m))}}),t.onUnmounted(()=>{document.body.style.overflow=u})}),{backgroundClass:n,overlayClass:o,handleBackdropClick:i,handleOverlayBubbleCancel:a}}const R=t.defineComponent({name:"DFixedOverlay",props:J,emits:U,setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:l}=j(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:l},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function ee(e){return!!(e==null?void 0:e.$el)}function T(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}const L=t.defineComponent({name:"DFlexibleOverlay",props:Q,emits:U,setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"});t.onMounted(async()=>{const c=(y,d,h)=>{const g=ne(y,d,h);i.left=`${g.x}px`,i.top=`${g.y}px`},b=t.computed(()=>{const y=o.value,d=te(e.origin);if(!(!y||!d))return{origin:d,overlay:y}}),m=t.toRef(e,"visible"),f=t.toRef(e,"position");t.watch([b,m,f],async([y,d,h],g,V)=>{if(!d||!y)return;const{origin:v,overlay:C}=y;c(h,C.getBoundingClientRect(),v);const X=[ie(()=>c(h,C.getBoundingClientRect(),v)),re(C,N=>c(h,N[0].contentRect,v)),de(v,()=>c(h,C.getBoundingClientRect(),v))];V(()=>{X.forEach(N=>N())})})});const{backgroundClass:a,overlayClass:l,handleBackdropClick:u,handleOverlayBubbleCancel:r}=j(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:a.value,onClick:u},[t.createVNode("div",{ref:o,class:l.value,style:i,onClick:r},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function te(e){return e instanceof Element?e:t.isRef(e)?T(e.value):ee(e)?T(e):e}function ne(e,n,o){const i=oe(o),a=ae(i,e);return le(a,n,e)}function oe(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function le(e,n,o){let i;const{width:a,height:l}=n;o.overlayX=="center"?i=e.x-a/2:i=o.overlayX=="left"?e.x:e.x-a;let u;return o.overlayY=="center"?u=e.y-l/2:u=o.overlayY=="top"?e.y:e.y-l,{x:i,y:u}}function ae(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const a=e.left,l=e.right;o=n.originX=="left"?a:l}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function ie(e){return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}}function re(e,n){if(e instanceof Element){const o=new ResizeObserver(n);return o.observe(e),()=>o.disconnect()}return()=>{}}function de(e,n){if(e instanceof Element){const o=new MutationObserver(n);return o.observe(e,{attributeFilter:["style"]}),()=>o.disconnect()}return()=>{}}const ce=typeof window!="undefined";L.install=function(e){e.component(L.name,L)},R.install=function(e){e.component(R.name,R)};var Ce="",B=t.defineComponent({name:"DModal",props:p,emits:["onUpdate:modelValue"],setup(e,n){const o=t.computed(()=>e.showAnimation?e.modelValue:!0),i=a=>{var u;const l=e["onUpdate:modelValue"];if(a)l==null||l(a);else{const r=e.beforeHidden,c=m=>{var f;m&&(l==null||l(!1),(f=e.onClose)==null||f.call(e))},b=(u=typeof r=="function"?r():r)!=null?u:!0;b instanceof Promise?b.then(c):c(b)}};return n.expose({onVisibleChange:i}),()=>t.createVNode(R,{visible:e.modelValue,"onUpdate:visible":i,backgroundClass:"devui-modal-wrapper",backgroundBlock:!e.bodyScrollable,backdropClose:e.backdropCloseable},{default:()=>[t.createVNode(t.Transition,{name:"devui-modal-wipe"},{default:()=>{var a,l;return[o.value?(l=(a=n.slots).default)==null?void 0:l.call(a):null]}})]})}});class _{constructor(n){this.anchorContainer=n}renderModal(n,o,i){const a=t.h(this.component(),o,i);return t.render(a,n),a}renderNull(n){setTimeout(()=>{t.render(null,n)},500)}}class I extends _{component(){return B}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const c=n,{content:i}=c,a=$(c,["content"]),l=b=>{b||r()},u=(b,m=l)=>this.renderModal(o,O(k({},b),{modelValue:!0,"onUpdate:modelValue":m}),{default:i}),r=()=>{var m,f;(f=(m=u(a,y=>{y?u(a):(this.renderModal(o,O(k({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).onVisibleChange)==null||f.call(m,!1)};return this.renderModal(o,{modelValue:!1}),u(a),{hide:r}}}H(I,"token","MODAL_SERVICE_TOKEN");const se={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},title:{type:String},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Promise,Function]},buttons:{type:Array,default:[]},dialogType:{type:String,default:"standard"},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}},ue=(e=!0)=>{const n=t.ref(0),o=t.ref(0),i=()=>{n.value=0,o.value=0},a=t.ref(),l=t.ref(),u=t.isRef(e)?e:t.ref(e);return t.watch([l,a],([r,c],b,m)=>{if(!(c instanceof HTMLElement&&r instanceof HTMLElement))return;c.style.cursor="all-scroll";let f=0,y=0,d=0,h=0,g=r.getBoundingClientRect(),V=document.body.getBoundingClientRect(),v=!1;const C=w=>{if(w.preventDefault(),!u.value)return;f=w.clientX,y=w.clientY;const x=c.getBoundingClientRect();(c===w.target||c.contains(w.target))&&x.x<f&&x.y<y&&x.width+x.x>=f&&x.height+x.y>=y&&(v=!0,d=n.value,h=o.value,V=document.body.getBoundingClientRect(),g=r.getBoundingClientRect())},X=w=>{if(w.preventDefault(),!v)return;const x=d+w.clientX-f,he=h+w.clientY-y,Z=g.x-d,q=g.y-h;n.value=A(x,-Z,V.width-g.width-Z),o.value=A(he,-q,V.height-g.height-q)},N=w=>{w.preventDefault(),!!v&&(v=!1)};window.addEventListener("mousedown",C),window.addEventListener("mousemove",X),window.addEventListener("mouseup",N),m(()=>{window.removeEventListener("mousedown",C),window.removeEventListener("mousemove",X),window.removeEventListener("mouseup",N)})}),{movingX:t.readonly(n),movingY:t.readonly(o),handleRef:a,moveElRef:l,reset:i}},A=(e,n,o)=>e<n?n:e>o?o:e;var E=t.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(e){return k({},e)},render(){const{name:e,size:n,color:o,classPrefix:i}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:n}},null):t.createVNode("i",{class:`${i} ${i}-${e}`,style:{fontSize:n,color:o}},null)}});E.install=function(e){e.component(E.name,E)};const fe={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var we="",M=t.defineComponent({name:"DButton",props:fe,setup(e,n){const o=t.ref(null),i=r=>{var c;e.showLoading||(c=e.onClick)==null||c.call(e,r)},a=t.computed(()=>n.slots.default),l=t.computed(()=>{const{btnStyle:r,size:c,position:b,bordered:m,icon:f}=e,y=`devui-btn devui-btn-${r} devui-btn-${c} devui-btn-${b}`,d=m?"bordered":"",h=!!f&&!a.value&&r!=="primary"?"d-btn-icon":"";return`${y} ${d} ${h} ${f?"d-btn-icon-wrap":""}`}),u=t.computed(()=>{if(!e.icon)return;const r="devui-icon-fix icon";return a.value?`${r} clear-right-5`:r});return()=>{var y,d;const{icon:r,type:c,disabled:b,showLoading:m,width:f}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},n.attrs),[t.createVNode("button",{class:l.value,type:c,disabled:b,style:{width:f},onClick:i},[r?t.createVNode(E,{name:e.icon,class:u.value},null):null,t.createVNode("span",{class:"button-content",ref:o},[(d=(y=n.slots).default)==null?void 0:d.call(y)])])])}}});M.install=function(e){e.component(M.name,M)};function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var me=t.defineComponent({name:"DModal",inheritAttrs:!1,props:se,emits:["onUpdate:modelValue"],setup(e,n){const{movingX:o,movingY:i,handleRef:a,moveElRef:l,reset:u}=ue();t.watch(()=>e.modelValue,d=>{d&&u()});const r=t.computed(()=>({position:"relative",left:`${o.value}px`,top:`${i.value}px`})),c=t.computed(()=>({width:e.width,maxHeight:e.maxHeight,transform:`translate(${e.offsetX}, ${e.offsetY})`,zIndex:e.zIndex})),b=t.computed(()=>{switch(e.dialogType){case"standard":return"";case"info":return"icon-info-o";case"success":return"icon-right-o";case"warning":return"icon-warning-o";case"failed":return"icon-error-o";default:return""}}),m=t.computed(()=>e.buttons.map((d,h)=>{const{btnStyle:g,disabled:V,handler:v,text:C}=d;return t.createVNode(M,{key:h,style:{display:"inline-block",margin:"0 5px"},btnStyle:g,disabled:V,onClick:v},ye(C)?C:{default:()=>[C]})})),f=t.ref(),y=()=>{var d,h;(h=(d=f.value)==null?void 0:d.onVisibleChange)==null||h.call(d,!1)};return n.expose({closeModal:y}),()=>t.createVNode(B,{ref:f,width:e.width,maxHeight:e.maxHeight,offsetX:e.offsetX,offsetY:e.offsetY,zIndex:e.zIndex,backdropZIndex:e.backdropZIndex,backdropCloseable:e.backdropCloseable,bodyScrollable:e.bodyScrollable,placement:e.placement,onClose:e.onClose,beforeHidden:e.beforeHidden,modelValue:e.modelValue,"onUpdate:modelValue":e["onUpdate:modelValue"]},{default:()=>{var d,h;return[t.createVNode("div",{class:"devui-modal-content",style:[c.value,r.value],ref:l},[t.createVNode("div",{class:"devui-modal-header",ref:a},[b.value?t.createVNode(E,{name:b.value,size:"24px",class:"header-alert-icon"},null):null,t.createVNode("span",null,[e.title]),t.createVNode(M,{class:"btn-close",icon:"close",btnStyle:"text-dark",onClick:y},null)]),t.createVNode("div",{class:"devui-modal-body"},[(h=(d=n.slots).default)==null?void 0:h.call(d)]),t.createVNode("div",{class:"devui-modal-footer"},[m.value])])]}})}});class z extends _{component(){return me}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const b=n,{content:i}=b,a=$(b,["content"]),l=m=>{m||r()},u=(m,f=l)=>this.renderModal(o,O(k({},m),{modelValue:!0,"onUpdate:modelValue":f}),{default:i}),r=()=>{var f,y;(y=(f=u(a,d=>{d?u(a):(this.renderModal(o,O(k({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).closeModal)==null||y.call(f)},c=m=>{const h=a,{buttons:f}=h,y=$(h,["buttons"]),d=f.map((g,V)=>k(k({},g),m[V]));u(O(k({},y),{buttons:d}))};return this.renderModal(o,{modelValue:!1}),u(a),{hide:r,updateButtonOptions:c}}}H(z,"token","DIALOG_SERVICE_TOKEN"),B.install=function(e){e.component(B.name,B)};var be={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(e){if(e.use(B),!ce)return;let n=document.getElementById("d-modal-anchors-container");n||(n=document.createElement("div"),n.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(n)),e.provide(I.token,new I(n)),e.provide(z.token,new z(n))}};s.Modal=B,s.default=be,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/overlay/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive,
|
|
20
|
+
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, withDirectives, vShow, ref, reactive, toRef, isRef } from "vue";
|
|
21
21
|
var overlay = "";
|
|
22
22
|
function _isSlot(s) {
|
|
23
23
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
@@ -56,7 +56,7 @@ const overlayProps = {
|
|
|
56
56
|
backgroundStyle: {
|
|
57
57
|
type: [String, Object]
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
onBackdropClick: {
|
|
60
60
|
type: Function
|
|
61
61
|
},
|
|
62
62
|
backdropClose: {
|
|
@@ -68,6 +68,7 @@ const overlayProps = {
|
|
|
68
68
|
default: true
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
+
const overlayEmits = ["onUpdate:visible", "backdropClick"];
|
|
71
72
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
72
73
|
overlayStyle: {
|
|
73
74
|
type: [String, Object],
|
|
@@ -103,7 +104,7 @@ function useOverlayLogic(props) {
|
|
|
103
104
|
const handleBackdropClick = (event) => {
|
|
104
105
|
var _a, _b;
|
|
105
106
|
event.preventDefault();
|
|
106
|
-
(_a = props.
|
|
107
|
+
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
107
108
|
if (props.backdropClose) {
|
|
108
109
|
(_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
|
|
109
110
|
}
|
|
@@ -142,6 +143,7 @@ function useOverlayLogic(props) {
|
|
|
142
143
|
const FixedOverlay = defineComponent({
|
|
143
144
|
name: "DFixedOverlay",
|
|
144
145
|
props: fixedOverlayProps,
|
|
146
|
+
emits: overlayEmits,
|
|
145
147
|
setup(props, ctx) {
|
|
146
148
|
const {
|
|
147
149
|
backgroundClass,
|
|
@@ -177,61 +179,46 @@ function getElement(element) {
|
|
|
177
179
|
const FlexibleOverlay = defineComponent({
|
|
178
180
|
name: "DFlexibleOverlay",
|
|
179
181
|
props: flexibleOverlayProps,
|
|
180
|
-
emits:
|
|
182
|
+
emits: overlayEmits,
|
|
181
183
|
setup(props, ctx) {
|
|
182
184
|
const overlayRef = ref(null);
|
|
183
185
|
const positionedStyle = reactive({
|
|
184
186
|
position: "absolute"
|
|
185
187
|
});
|
|
186
|
-
const instance = getCurrentInstance();
|
|
187
188
|
onMounted(async () => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (!overlay2) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const origin = getOrigin(props.origin);
|
|
194
|
-
if (!origin) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const handleRectChange = (rect) => {
|
|
198
|
-
const point = calculatePosition(props.position, rect, origin);
|
|
189
|
+
const handleRectChange = (position, rect, origin) => {
|
|
190
|
+
const point = calculatePosition(position, rect, origin);
|
|
199
191
|
positionedStyle.left = `${point.x}px`;
|
|
200
192
|
positionedStyle.top = `${point.y}px`;
|
|
201
193
|
};
|
|
202
|
-
const
|
|
194
|
+
const locationElements = computed(() => {
|
|
195
|
+
const overlay2 = overlayRef.value;
|
|
196
|
+
const origin = getOrigin(props.origin);
|
|
197
|
+
if (!overlay2 || !origin) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
origin,
|
|
202
|
+
overlay: overlay2
|
|
203
|
+
};
|
|
204
|
+
});
|
|
203
205
|
const visibleRef = toRef(props, "visible");
|
|
204
206
|
const positionRef = toRef(props, "position");
|
|
205
|
-
watch(visibleRef, (visible, ov, onInvalidate) => {
|
|
206
|
-
if (visible) {
|
|
207
|
-
|
|
208
|
-
} else {
|
|
209
|
-
unsbscribeLayoutEvent(handleChange);
|
|
207
|
+
watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
|
|
208
|
+
if (!visible || !locationElements2) {
|
|
209
|
+
return;
|
|
210
210
|
}
|
|
211
|
+
const {
|
|
212
|
+
origin,
|
|
213
|
+
overlay: overlay2
|
|
214
|
+
} = locationElements2;
|
|
215
|
+
handleRectChange(position, overlay2.getBoundingClientRect(), origin);
|
|
216
|
+
const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
|
|
211
217
|
onInvalidate(() => {
|
|
212
|
-
|
|
218
|
+
unsubscriptions.forEach((fn) => fn());
|
|
213
219
|
});
|
|
214
220
|
});
|
|
215
|
-
|
|
216
|
-
handleChange();
|
|
217
|
-
});
|
|
218
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
219
|
-
handleRectChange(entries[0].contentRect);
|
|
220
|
-
});
|
|
221
|
-
resizeObserver.observe(overlay2);
|
|
222
|
-
onBeforeUnmount(() => {
|
|
223
|
-
resizeObserver.disconnect();
|
|
224
|
-
}, instance);
|
|
225
|
-
if (origin instanceof Element) {
|
|
226
|
-
const observer = new MutationObserver(handleChange);
|
|
227
|
-
observer.observe(origin, {
|
|
228
|
-
attributeFilter: ["style"]
|
|
229
|
-
});
|
|
230
|
-
onBeforeUnmount(() => {
|
|
231
|
-
observer.disconnect();
|
|
232
|
-
}, instance);
|
|
233
|
-
}
|
|
234
|
-
}, instance);
|
|
221
|
+
});
|
|
235
222
|
const {
|
|
236
223
|
backgroundClass,
|
|
237
224
|
overlayClass,
|
|
@@ -264,15 +251,9 @@ function getOrigin(origin) {
|
|
|
264
251
|
}
|
|
265
252
|
return origin;
|
|
266
253
|
}
|
|
267
|
-
function calculatePosition(position,
|
|
254
|
+
function calculatePosition(position, rect, origin) {
|
|
268
255
|
const originRect = getOriginRect(origin);
|
|
269
256
|
const originPoint = getOriginRelativePoint(originRect, position);
|
|
270
|
-
let rect;
|
|
271
|
-
if (panelOrRect instanceof HTMLElement) {
|
|
272
|
-
rect = panelOrRect.getBoundingClientRect();
|
|
273
|
-
} else {
|
|
274
|
-
rect = panelOrRect;
|
|
275
|
-
}
|
|
276
257
|
return getOverlayPoint(originPoint, rect, position);
|
|
277
258
|
}
|
|
278
259
|
function getOriginRect(origin) {
|
|
@@ -336,11 +317,31 @@ function subscribeLayoutEvent(event) {
|
|
|
336
317
|
window.addEventListener("scroll", event, true);
|
|
337
318
|
window.addEventListener("resize", event);
|
|
338
319
|
window.addEventListener("orientationchange", event);
|
|
320
|
+
return () => {
|
|
321
|
+
window.removeEventListener("scroll", event, true);
|
|
322
|
+
window.removeEventListener("resize", event);
|
|
323
|
+
window.removeEventListener("orientationchange", event);
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function subscribeOverlayResize(overlay2, callback) {
|
|
327
|
+
if (overlay2 instanceof Element) {
|
|
328
|
+
const resizeObserver = new ResizeObserver(callback);
|
|
329
|
+
resizeObserver.observe(overlay2);
|
|
330
|
+
return () => resizeObserver.disconnect();
|
|
331
|
+
}
|
|
332
|
+
return () => {
|
|
333
|
+
};
|
|
339
334
|
}
|
|
340
|
-
function
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
335
|
+
function subscribeOriginResize(origin, callback) {
|
|
336
|
+
if (origin instanceof Element) {
|
|
337
|
+
const observer = new MutationObserver(callback);
|
|
338
|
+
observer.observe(origin, {
|
|
339
|
+
attributeFilter: ["style"]
|
|
340
|
+
});
|
|
341
|
+
return () => observer.disconnect();
|
|
342
|
+
}
|
|
343
|
+
return () => {
|
|
344
|
+
};
|
|
344
345
|
}
|
|
345
346
|
const inBrowser = typeof window !== "undefined";
|
|
346
347
|
FlexibleOverlay.install = function(app) {
|
|
@@ -352,7 +353,7 @@ FixedOverlay.install = function(app) {
|
|
|
352
353
|
var index = {
|
|
353
354
|
title: "Overlay \u906E\u7F69\u5C42",
|
|
354
355
|
category: "\u901A\u7528",
|
|
355
|
-
status: "
|
|
356
|
+
status: "100%",
|
|
356
357
|
install(app) {
|
|
357
358
|
app.use(FixedOverlay);
|
|
358
359
|
app.use(FlexibleOverlay);
|
package/overlay/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var F=(r,t,a)=>t in r?J(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a,p=(r,t)=>{for(var a in t||(t={}))W.call(t,a)&&F(r,a,t[a]);if(j)for(var a of j(t))Z.call(t,a)&&F(r,a,t[a]);return r},V=(r,t)=>K(r,Q(t));(function(r,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(r=typeof globalThis!="undefined"?globalThis:r||self,t(r.index={},r.Vue))})(this,function(r,t){"use strict";var a="";function N(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const B=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},N(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),x={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},E=["onUpdate:visible","backdropClick"],L=V(p({},x),{overlayStyle:{type:[String,Object],default:void 0}}),X=p({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},x);function S(e){const n=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),o=t.computed(()=>"devui-overlay"),i=l=>{var s,f;l.preventDefault(),(s=e.onBackdropClick)==null||s.call(e),e.backdropClose&&((f=e["onUpdate:visible"])==null||f.call(e,!1))},c=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,s=l.style.overflow,f=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([d,w])=>{if(w){const C=l.getBoundingClientRect().y;d?(l.style.overflowY="scroll",l.style.position=d?"fixed":"",l.style.top=`${C}px`):(l.style.overflowY=s,l.style.position=f,l.style.top="",window.scrollTo(0,-C))}}),t.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:o,handleBackdropClick:i,handleOverlayBubbleCancel:c}}const v=t.defineComponent({name:"DFixedOverlay",props:L,emits:E,setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:l}=S(e);return()=>t.createVNode(B,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:c},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:l},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function Y(e){return!!(e==null?void 0:e.$el)}function R(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}const h=t.defineComponent({name:"DFlexibleOverlay",props:X,emits:E,setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"});t.onMounted(async()=>{const d=(u,y,b)=>{const g=z(u,y,b);i.left=`${g.x}px`,i.top=`${g.y}px`},w=t.computed(()=>{const u=o.value,y=_(e.origin);if(!(!u||!y))return{origin:y,overlay:u}}),C=t.toRef(e,"visible"),I=t.toRef(e,"position");t.watch([w,C,I],async([u,y,b],g,G)=>{if(!y||!u)return;const{origin:m,overlay:k}=u;d(b,k.getBoundingClientRect(),m);const H=[M(()=>d(b,k.getBoundingClientRect(),m)),P(k,O=>d(b,O[0].contentRect,m)),U(m,()=>d(b,k.getBoundingClientRect(),m))];G(()=>{H.forEach(O=>O())})})});const{backgroundClass:c,overlayClass:l,handleBackdropClick:s,handleOverlayBubbleCancel:f}=S(e);return()=>t.createVNode(B,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:c.value,onClick:s},[t.createVNode("div",{ref:o,class:l.value,style:i,onClick:f},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function _(e){return e instanceof Element?e:t.isRef(e)?R(e.value):Y(e)?R(e):e}function z(e,n,o){const i=T(o),c=D(i,e);return $(c,n,e)}function T(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function $(e,n,o){let i;const{width:c,height:l}=n;o.overlayX=="center"?i=e.x-c/2:i=o.overlayX=="left"?e.x:e.x-c;let s;return o.overlayY=="center"?s=e.y-l/2:s=o.overlayY=="top"?e.y:e.y-l,{x:i,y:s}}function D(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const c=e.left,l=e.right;o=n.originX=="left"?c:l}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function M(e){return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}}function P(e,n){if(e instanceof Element){const o=new ResizeObserver(n);return o.observe(e),()=>o.disconnect()}return()=>{}}function U(e,n){if(e instanceof Element){const o=new MutationObserver(n);return o.observe(e,{attributeFilter:["style"]}),()=>o.disconnect()}return()=>{}}const A=typeof window!="undefined";h.install=function(e){e.component(h.name,h)},v.install=function(e){e.component(v.name,v)};var q={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.use(v),e.use(h),A&&!document.getElementById("d-overlay-anchor")){const n=document.createElement("div");n.setAttribute("id","d-overlay-anchor"),n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.zIndex="1000",document.body.appendChild(n)}}};r.FixedOverlay=v,r.FlexibleOverlay=h,r.default=q,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-devui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "DevUI components based on Vite and Vue3",
|
|
6
6
|
"keywords": [
|
|
@@ -18,29 +18,6 @@
|
|
|
18
18
|
"main": "vue-devui.umd.js",
|
|
19
19
|
"module": "vue-devui.es.js",
|
|
20
20
|
"style": "style.css",
|
|
21
|
-
"bin": {
|
|
22
|
-
"devui-cli": "./devui-cli/index.js"
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "yarn generate:theme && vitepress dev docs",
|
|
26
|
-
"build": "yarn generate:theme && vitepress build docs && cp public/* docs/.vitepress/dist/assets",
|
|
27
|
-
"serve": "vitepress serve docs",
|
|
28
|
-
"app:dev": "vite",
|
|
29
|
-
"app:build": "vite build",
|
|
30
|
-
"build:lib": "yarn predev && yarn build:components && yarn generate:theme && yarn copy",
|
|
31
|
-
"test": "jest --config jest.config.js",
|
|
32
|
-
"ls-lint": "ls-lint",
|
|
33
|
-
"lint": "eslint \"{src,devui}/**/*.{vue,js,ts,jsx,tsx}\"",
|
|
34
|
-
"lint:fix": "eslint --fix \"{src,devui}/**/*.{vue,js,ts,jsx,tsx}\"",
|
|
35
|
-
"stylelint": "stylelint --fix \"{devui,src}/**/*.{scss,css}\"",
|
|
36
|
-
"build:components": "node ./devui-cli/index.js build",
|
|
37
|
-
"generate:theme": "node ./devui-cli/index.js generate:theme",
|
|
38
|
-
"copy": "cp package.json build && cp README.md build && cp devui/theme/theme.scss build/theme",
|
|
39
|
-
"clean:cli": "npm uninstall -g devui-cli & npm uninstall -g vue-devui",
|
|
40
|
-
"cli:create": "node ./devui-cli/index.js create -t component",
|
|
41
|
-
"predev": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error",
|
|
42
|
-
"prebuild": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error"
|
|
43
|
-
},
|
|
44
21
|
"dependencies": {
|
|
45
22
|
"@devui-design/icons": "^1.3.0",
|
|
46
23
|
"@types/lodash-es": "^4.17.4",
|
|
@@ -78,7 +55,7 @@
|
|
|
78
55
|
"eslint": "^7.28.0",
|
|
79
56
|
"eslint-plugin-import": "^2.24.2",
|
|
80
57
|
"eslint-plugin-vue": "^7.11.1",
|
|
81
|
-
"husky": "^
|
|
58
|
+
"husky": "^7.0.4",
|
|
82
59
|
"inquirer": "^8.1.2",
|
|
83
60
|
"jest": "^27.0.4",
|
|
84
61
|
"lint-staged": "^11.0.0",
|
|
@@ -99,12 +76,6 @@
|
|
|
99
76
|
"vue-tsc": "^0.2.2",
|
|
100
77
|
"yarn": "^1.22.11"
|
|
101
78
|
},
|
|
102
|
-
"husky": {
|
|
103
|
-
"hooks": {
|
|
104
|
-
"pre-commit": "ls-lint && lint-staged",
|
|
105
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
79
|
"lint-staged": {
|
|
109
80
|
"{src,devui}/**/*.{js,ts,jsx,tsx,vue}": "eslint --fix",
|
|
110
81
|
"{src,devui}/**/*.{scss,css}": "stylelint --fix"
|
package/pagination/index.es.js
CHANGED
|
@@ -323,8 +323,8 @@ var JumpPage = defineComponent({
|
|
|
323
323
|
createVNode(resolveComponent("d-input"), {
|
|
324
324
|
"class": ["devui-pagination-input", size ? "devui-pagination-input-" + size : ""],
|
|
325
325
|
"size": size,
|
|
326
|
-
"
|
|
327
|
-
"onUpdate:
|
|
326
|
+
"modelValue": String(inputNum),
|
|
327
|
+
"onUpdate:modelValue": jumpPageChange,
|
|
328
328
|
"onKeydown": jump
|
|
329
329
|
}, null),
|
|
330
330
|
goToText === "\u8DF3\u81F3" && "\u9875",
|
|
@@ -634,7 +634,7 @@ Pagination.install = (app) => {
|
|
|
634
634
|
var index = {
|
|
635
635
|
title: "Pagination \u5206\u9875",
|
|
636
636
|
category: "\u5BFC\u822A",
|
|
637
|
-
status: "
|
|
637
|
+
status: "100%",
|
|
638
638
|
install(app) {
|
|
639
639
|
app.use(Pagination);
|
|
640
640
|
}
|