@king-one/antdv 1.0.61 → 1.0.63
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/CHANGELOG.md +12 -0
- package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +39 -34
- package/dist/lib/components/pro-modal/src/ProModal.vue2.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/components/pro-modal/index.d.ts +12 -4
- package/dist/types/components/pro-modal/src/Modal.d.ts +6 -2
- package/dist/types/components/pro-modal/src/ProModal.vue.d.ts +6 -2
- package/dist/types/components/pro-modal/src/types.d.ts +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as X, mergeModels as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { useNamespace as
|
|
4
|
-
import { useDraggable as
|
|
5
|
-
import { ProModalProps as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as X, mergeModels as y, ref as e, useModel as Y, computed as M, watch as R, watchEffect as E, openBlock as b, createBlock as w, unref as N, mergeProps as q, createSlots as z, withCtx as r, createElementVNode as k, toDisplayString as O, normalizeStyle as U, resolveDynamicComponent as _, renderSlot as P } from "vue";
|
|
2
|
+
import { Modal as j } from "ant-design-vue";
|
|
3
|
+
import { useNamespace as A } from "../../../hooks/use-namespace/index.mjs";
|
|
4
|
+
import { useDraggable as F } from "@vueuse/core";
|
|
5
|
+
import { ProModalProps as G } from "./types.mjs";
|
|
6
|
+
const Q = /* @__PURE__ */ X({
|
|
7
7
|
name: "ProModal",
|
|
8
8
|
__name: "ProModal",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ y(G, {
|
|
10
10
|
modelValue: { required: !0, type: Boolean },
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
|
-
emits: /* @__PURE__ */
|
|
13
|
+
emits: /* @__PURE__ */ y(["onConfirm", "onCancel"], ["update:modelValue"]),
|
|
14
14
|
setup(B, { emit: D }) {
|
|
15
|
-
const
|
|
15
|
+
const c = D, l = e(null), f = Y(B, "modelValue"), { b: S } = A("pro-modal"), $ = M(() => S());
|
|
16
16
|
function T() {
|
|
17
|
-
|
|
17
|
+
c("onConfirm");
|
|
18
18
|
}
|
|
19
19
|
function V() {
|
|
20
|
-
|
|
20
|
+
c("onCancel");
|
|
21
21
|
}
|
|
22
|
-
const { x:
|
|
23
|
-
R([
|
|
22
|
+
const { x: s, y: u, isDragging: v } = F(l), p = e(0), g = e(0), n = e(!1), m = e(0), i = e(0), h = e(0), C = e(0), o = e({ left: 0, right: 0, top: 0, bottom: 0 });
|
|
23
|
+
R([s, u], () => {
|
|
24
24
|
if (!n.value && l.value) {
|
|
25
|
-
p.value =
|
|
25
|
+
p.value = s.value, g.value = u.value;
|
|
26
26
|
const t = document.body.getBoundingClientRect(), a = l.value.getBoundingClientRect();
|
|
27
27
|
o.value.right = t.width - a.width, o.value.bottom = t.height - a.height, h.value = m.value, C.value = i.value;
|
|
28
28
|
}
|
|
@@ -30,56 +30,61 @@ const L = /* @__PURE__ */ X({
|
|
|
30
30
|
}), R(v, () => {
|
|
31
31
|
v || (n.value = !1);
|
|
32
32
|
}), E(() => {
|
|
33
|
-
n.value && (m.value = h.value + Math.min(Math.max(o.value.left,
|
|
33
|
+
n.value && (m.value = h.value + Math.min(Math.max(o.value.left, s.value), o.value.right) - p.value, i.value = C.value + Math.min(Math.max(o.value.top, u.value), o.value.bottom) - g.value);
|
|
34
34
|
});
|
|
35
|
-
const
|
|
35
|
+
const x = M(() => ({
|
|
36
36
|
transform: `translate(${m.value}px, ${i.value}px)`
|
|
37
37
|
}));
|
|
38
|
-
return (t, a) => (b(), w(N(
|
|
38
|
+
return (t, a) => (b(), w(N(j), q({
|
|
39
39
|
open: f.value,
|
|
40
|
-
"onUpdate:open": a[0] || (a[0] = (
|
|
40
|
+
"onUpdate:open": a[0] || (a[0] = (d) => f.value = d)
|
|
41
41
|
}, t.modalProps, {
|
|
42
|
-
"wrap-class-name":
|
|
42
|
+
"wrap-class-name": $.value,
|
|
43
43
|
onOk: T,
|
|
44
44
|
onCancel: V
|
|
45
|
-
}), {
|
|
45
|
+
}), z({
|
|
46
46
|
title: r(() => [
|
|
47
|
-
|
|
47
|
+
k(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
50
|
ref_key: "modalTitleRef",
|
|
51
51
|
ref: l,
|
|
52
52
|
class: "pro-modal-title"
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
O(t.title),
|
|
55
55
|
513
|
|
56
56
|
/* TEXT, NEED_PATCH */
|
|
57
57
|
)
|
|
58
58
|
]),
|
|
59
|
-
modalRender: r(({ originVNode:
|
|
60
|
-
|
|
59
|
+
modalRender: r(({ originVNode: d }) => [
|
|
60
|
+
k(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
style:
|
|
63
|
+
style: U(x.value)
|
|
64
64
|
},
|
|
65
65
|
[
|
|
66
|
-
(b(), w(
|
|
66
|
+
(b(), w(_(d)))
|
|
67
67
|
],
|
|
68
68
|
4
|
|
69
69
|
/* STYLE */
|
|
70
70
|
)
|
|
71
71
|
]),
|
|
72
|
-
footer: r(() => [
|
|
73
|
-
k(t.$slots, "footer")
|
|
74
|
-
]),
|
|
75
72
|
default: r(() => [
|
|
76
|
-
|
|
73
|
+
P(t.$slots, "default")
|
|
77
74
|
]),
|
|
78
|
-
_:
|
|
79
|
-
/*
|
|
80
|
-
},
|
|
75
|
+
_: 2
|
|
76
|
+
/* DYNAMIC */
|
|
77
|
+
}, [
|
|
78
|
+
t.$slots.footer ? {
|
|
79
|
+
name: "footer",
|
|
80
|
+
fn: r(() => [
|
|
81
|
+
P(t.$slots, "footer")
|
|
82
|
+
]),
|
|
83
|
+
key: "0"
|
|
84
|
+
} : void 0
|
|
85
|
+
]), 1040, ["open", "wrap-class-name"]));
|
|
81
86
|
}
|
|
82
87
|
});
|
|
83
88
|
export {
|
|
84
|
-
|
|
89
|
+
Q as default
|
|
85
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),S=require("ant-design-vue"),B=require("../../../hooks/use-namespace/index.js"),P=require("@vueuse/core"),q=require("./types.js"),x=e.defineComponent({name:"ProModal",__name:"ProModal",props:e.mergeModels(q.ProModalProps,{modelValue:{required:!0,type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["onConfirm","onCancel"],["update:modelValue"]),setup(C,{emit:M}){const d=M,l=e.ref(null),m=e.useModel(C,"modelValue"),{b:y}=B.useNamespace("pro-modal"),w=e.computed(()=>y());function b(){d("onConfirm")}function k(){d("onCancel")}const{x:n,y:u,isDragging:f}=P.useDraggable(l),v=e.ref(0),p=e.ref(0),r=e.ref(!1),s=e.ref(0),i=e.ref(0),g=e.ref(0),h=e.ref(0),o=e.ref({left:0,right:0,top:0,bottom:0});e.watch([n,u],()=>{if(!r.value&&l.value){v.value=n.value,p.value=u.value;const t=document.body.getBoundingClientRect(),a=l.value.getBoundingClientRect();o.value.right=t.width-a.width,o.value.bottom=t.height-a.height,g.value=s.value,h.value=i.value}r.value=!0}),e.watch(f,()=>{f||(r.value=!1)}),e.watchEffect(()=>{r.value&&(s.value=g.value+Math.min(Math.max(o.value.left,n.value),o.value.right)-v.value,i.value=h.value+Math.min(Math.max(o.value.top,u.value),o.value.bottom)-p.value)});const R=e.computed(()=>({transform:`translate(${s.value}px, ${i.value}px)`}));return(t,a)=>(e.openBlock(),e.createBlock(e.unref(S.Modal),e.mergeProps({open:m.value,"onUpdate:open":a[0]||(a[0]=c=>m.value=c)},t.modalProps,{"wrap-class-name":w.value,onOk:b,onCancel:k}),e.createSlots({title:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"modalTitleRef",ref:l,class:"pro-modal-title"},e.toDisplayString(t.title),513)]),modalRender:e.withCtx(({originVNode:c})=>[e.createElementVNode("div",{style:e.normalizeStyle(R.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c)))],4)]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:2},[t.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"footer")]),key:"0"}:void 0]),1040,["open","wrap-class-name"]))}});exports.default=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=56889) format("woff2"),url(fonts/iconfont.woff?t=63860) format("woff"),url(fonts/iconfont.ttf?t=38137) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=95418) format("woff2"),url(fonts/iconfont.woff?t=24592) format("woff"),url(fonts/iconfont.ttf?t=71403) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
|
|
@@ -6,7 +6,9 @@ export * from './hooks/useProModal';
|
|
|
6
6
|
export declare const KProModal: SFCWithInstall<{
|
|
7
7
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
8
8
|
modalProps: {
|
|
9
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
9
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
10
|
+
confirmLoading?: boolean;
|
|
11
|
+
}, "open" | "title">>;
|
|
10
12
|
};
|
|
11
13
|
modelValue: {
|
|
12
14
|
readonly type: BooleanConstructor;
|
|
@@ -26,7 +28,9 @@ export declare const KProModal: SFCWithInstall<{
|
|
|
26
28
|
"update:modelValue": (modelValue: boolean) => void;
|
|
27
29
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
28
30
|
modalProps: {
|
|
29
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
31
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
32
|
+
confirmLoading?: boolean;
|
|
33
|
+
}, "open" | "title">>;
|
|
30
34
|
};
|
|
31
35
|
modelValue: {
|
|
32
36
|
readonly type: BooleanConstructor;
|
|
@@ -49,7 +53,9 @@ export declare const KProModal: SFCWithInstall<{
|
|
|
49
53
|
Defaults: {};
|
|
50
54
|
}, Readonly< ExtractPropTypes<{
|
|
51
55
|
modalProps: {
|
|
52
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
56
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
57
|
+
confirmLoading?: boolean;
|
|
58
|
+
}, "open" | "title">>;
|
|
53
59
|
};
|
|
54
60
|
modelValue: {
|
|
55
61
|
readonly type: BooleanConstructor;
|
|
@@ -69,7 +75,9 @@ export declare const KProModal: SFCWithInstall<{
|
|
|
69
75
|
__isSuspense?: never;
|
|
70
76
|
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
71
77
|
modalProps: {
|
|
72
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
78
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
79
|
+
confirmLoading?: boolean;
|
|
80
|
+
}, "open" | "title">>;
|
|
73
81
|
};
|
|
74
82
|
modelValue: {
|
|
75
83
|
readonly type: BooleanConstructor;
|
|
@@ -2,7 +2,9 @@ import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractP
|
|
|
2
2
|
import { ModalFuncProps } from 'ant-design-vue';
|
|
3
3
|
declare const _default: DefineComponent<{
|
|
4
4
|
readonly modalProps: {
|
|
5
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
5
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
6
|
+
confirmLoading?: boolean;
|
|
7
|
+
}, "open" | "title">>;
|
|
6
8
|
};
|
|
7
9
|
readonly modelValue: {
|
|
8
10
|
readonly type: BooleanConstructor;
|
|
@@ -14,7 +16,9 @@ declare const _default: DefineComponent<{
|
|
|
14
16
|
};
|
|
15
17
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("onCancel" | "onConfirm" | "update:modelValue")[], "onCancel" | "onConfirm" | "update:modelValue", PublicProps, Readonly< ExtractPropTypes<{
|
|
16
18
|
readonly modalProps: {
|
|
17
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
19
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
20
|
+
confirmLoading?: boolean;
|
|
21
|
+
}, "open" | "title">>;
|
|
18
22
|
};
|
|
19
23
|
readonly modelValue: {
|
|
20
24
|
readonly type: BooleanConstructor;
|
|
@@ -11,7 +11,9 @@ declare function __VLS_template(): {
|
|
|
11
11
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
12
|
declare const __VLS_component: DefineComponent<{
|
|
13
13
|
modalProps: {
|
|
14
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
14
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
15
|
+
confirmLoading?: boolean;
|
|
16
|
+
}, "open" | "title">>;
|
|
15
17
|
};
|
|
16
18
|
modelValue: {
|
|
17
19
|
readonly type: BooleanConstructor;
|
|
@@ -27,7 +29,9 @@ declare const __VLS_component: DefineComponent<{
|
|
|
27
29
|
"update:modelValue": (modelValue: boolean) => void;
|
|
28
30
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
29
31
|
modalProps: {
|
|
30
|
-
readonly type: PropType<Omit< ModalFuncProps
|
|
32
|
+
readonly type: PropType<Omit< ModalFuncProps & {
|
|
33
|
+
confirmLoading?: boolean;
|
|
34
|
+
}, "open" | "title">>;
|
|
31
35
|
};
|
|
32
36
|
modelValue: {
|
|
33
37
|
readonly type: BooleanConstructor;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ModalFuncProps } from 'ant-design-vue';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
|
-
type ModalType = ModalFuncProps
|
|
3
|
+
type ModalType = ModalFuncProps & {
|
|
4
|
+
confirmLoading?: boolean;
|
|
5
|
+
};
|
|
4
6
|
export declare const ProModalProps: {
|
|
5
7
|
readonly modalProps: {
|
|
6
8
|
readonly type: PropType<Omit<ModalType, "open" | "title">>;
|
|
@@ -19,5 +21,13 @@ export interface ProModalSlots {
|
|
|
19
21
|
* 自定义标题
|
|
20
22
|
*/
|
|
21
23
|
title?: () => any;
|
|
24
|
+
/**
|
|
25
|
+
* 自定义页脚
|
|
26
|
+
*/
|
|
27
|
+
footer?: () => any;
|
|
28
|
+
/**
|
|
29
|
+
* 默认插槽
|
|
30
|
+
*/
|
|
31
|
+
default?: () => any;
|
|
22
32
|
}
|
|
23
33
|
export {};
|