@king-one/antdv 1.0.60 → 1.0.62

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.62
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:增加 modal 组件的 slot 插槽
8
+
9
+ ## 1.0.61
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:增加 footer 的插槽
14
+
3
15
  ## 1.0.60
4
16
 
5
17
  ### Patch Changes
@@ -1,82 +1,90 @@
1
- import { defineComponent as X, mergeModels as M, ref as e, useModel as Y, computed as y, watch as R, watchEffect as _, openBlock as b, createBlock as w, unref as $, mergeProps as E, withCtx as c, createElementVNode as P, toDisplayString as N, normalizeStyle as q, resolveDynamicComponent as z, renderSlot as O } from "vue";
2
- import { Modal as U } from "ant-design-vue";
3
- import { useNamespace as j } from "../../../hooks/use-namespace/index.mjs";
4
- import { useDraggable as A } from "@vueuse/core";
5
- import { ProModalProps as F } from "./types.mjs";
6
- const L = /* @__PURE__ */ X({
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__ */ M(F, {
9
+ props: /* @__PURE__ */ y(G, {
10
10
  modelValue: { required: !0, type: Boolean },
11
11
  modelModifiers: {}
12
12
  }),
13
- emits: /* @__PURE__ */ M(["onConfirm", "onCancel"], ["update:modelValue"]),
14
- setup(k, { emit: x }) {
15
- const d = x, l = e(null), v = Y(k, "modelValue"), { b: B } = j("pro-modal"), D = y(() => B());
16
- function S() {
17
- d("onConfirm");
18
- }
13
+ emits: /* @__PURE__ */ y(["onConfirm", "onCancel"], ["update:modelValue"]),
14
+ setup(B, { emit: D }) {
15
+ const c = D, l = e(null), f = Y(B, "modelValue"), { b: S } = A("pro-modal"), $ = M(() => S());
19
16
  function T() {
20
- d("onCancel");
17
+ c("onConfirm");
18
+ }
19
+ function V() {
20
+ c("onCancel");
21
21
  }
22
- const { x: r, y: u, isDragging: f } = A(l), p = e(0), g = e(0), n = e(!1), s = e(0), m = e(0), h = e(0), C = e(0), t = e({ left: 0, right: 0, top: 0, bottom: 0 });
23
- R([r, u], () => {
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 = r.value, g.value = u.value;
26
- const o = document.body.getBoundingClientRect(), a = l.value.getBoundingClientRect();
27
- t.value.right = o.width - a.width, t.value.bottom = o.height - a.height, h.value = s.value, C.value = m.value;
25
+ p.value = s.value, g.value = u.value;
26
+ const t = document.body.getBoundingClientRect(), a = l.value.getBoundingClientRect();
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
  }
29
29
  n.value = !0;
30
- }), R(f, () => {
31
- f || (n.value = !1);
32
- }), _(() => {
33
- n.value && (s.value = h.value + Math.min(Math.max(t.value.left, r.value), t.value.right) - p.value, m.value = C.value + Math.min(Math.max(t.value.top, u.value), t.value.bottom) - g.value);
30
+ }), R(v, () => {
31
+ v || (n.value = !1);
32
+ }), E(() => {
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 V = y(() => ({
36
- transform: `translate(${s.value}px, ${m.value}px)`
35
+ const x = M(() => ({
36
+ transform: `translate(${m.value}px, ${i.value}px)`
37
37
  }));
38
- return (o, a) => (b(), w($(U), E({
39
- open: v.value,
40
- "onUpdate:open": a[0] || (a[0] = (i) => v.value = i)
41
- }, o.modalProps, {
42
- "wrap-class-name": D.value,
43
- onOk: S,
44
- onCancel: T
45
- }), {
46
- title: c(() => [
47
- P(
38
+ return (t, a) => (b(), w(N(j), q({
39
+ open: f.value,
40
+ "onUpdate:open": a[0] || (a[0] = (d) => f.value = d)
41
+ }, t.modalProps, {
42
+ "wrap-class-name": $.value,
43
+ onOk: T,
44
+ onCancel: V
45
+ }), z({
46
+ title: r(() => [
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
- N(o.title),
54
+ O(t.title),
55
55
  513
56
56
  /* TEXT, NEED_PATCH */
57
57
  )
58
58
  ]),
59
- modalRender: c(({ originVNode: i }) => [
60
- P(
59
+ modalRender: r(({ originVNode: d }) => [
60
+ k(
61
61
  "div",
62
62
  {
63
- style: q(V.value)
63
+ style: U(x.value)
64
64
  },
65
65
  [
66
- (b(), w(z(i)))
66
+ (b(), w(_(d)))
67
67
  ],
68
68
  4
69
69
  /* STYLE */
70
70
  )
71
71
  ]),
72
- default: c(() => [
73
- O(o.$slots, "default")
72
+ default: r(() => [
73
+ P(t.$slots, "default")
74
74
  ]),
75
- _: 3
76
- /* FORWARDED */
77
- }, 16, ["open", "wrap-class-name"]));
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"]));
78
86
  }
79
87
  });
80
88
  export {
81
- L as default
89
+ Q as default
82
90
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("ant-design-vue"),B=require("../../../hooks/use-namespace/index.js"),P=require("@vueuse/core"),q=require("./types.js"),D=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 R(){d("onCancel")}const{x:r,y:u,isDragging:f}=P.useDraggable(l),v=e.ref(0),p=e.ref(0),n=e.ref(!1),s=e.ref(0),i=e.ref(0),g=e.ref(0),h=e.ref(0),t=e.ref({left:0,right:0,top:0,bottom:0});e.watch([r,u],()=>{if(!n.value&&l.value){v.value=r.value,p.value=u.value;const o=document.body.getBoundingClientRect(),a=l.value.getBoundingClientRect();t.value.right=o.width-a.width,t.value.bottom=o.height-a.height,g.value=s.value,h.value=i.value}n.value=!0}),e.watch(f,()=>{f||(n.value=!1)}),e.watchEffect(()=>{n.value&&(s.value=g.value+Math.min(Math.max(t.value.left,r.value),t.value.right)-v.value,i.value=h.value+Math.min(Math.max(t.value.top,u.value),t.value.bottom)-p.value)});const k=e.computed(()=>({transform:`translate(${s.value}px, ${i.value}px)`}));return(o,a)=>(e.openBlock(),e.createBlock(e.unref(x.Modal),e.mergeProps({open:m.value,"onUpdate:open":a[0]||(a[0]=c=>m.value=c)},o.modalProps,{"wrap-class-name":w.value,onOk:b,onCancel:R}),{title:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"modalTitleRef",ref:l,class:"pro-modal-title"},e.toDisplayString(o.title),513)]),modalRender:e.withCtx(({originVNode:c})=>[e.createElementVNode("div",{style:e.normalizeStyle(k.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c)))],4)]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["open","wrap-class-name"]))}});exports.default=D;
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=42261) format("woff2"),url(fonts/iconfont.woff?t=4700) format("woff"),url(fonts/iconfont.ttf?t=36186) 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
+ @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=43461) format("woff2"),url(fonts/iconfont.woff?t=45574) format("woff"),url(fonts/iconfont.ttf?t=39650) 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=32287) format("woff2"),url(fonts/iconfont.woff?t=37042) format("woff"),url(fonts/iconfont.ttf?t=86645) 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
+ :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=47676) format("woff2"),url(fonts/iconfont.woff?t=74872) format("woff"),url(fonts/iconfont.ttf?t=67547) 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,6 +1,7 @@
1
1
  import { SFCWithInstall } from '../utils/install';
2
2
  import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
3
3
  import { ModalFuncProps } from 'ant-design-vue';
4
+ import { ProModalSlots } from './src/types';
4
5
  export * from './hooks/useProModal';
5
6
  export declare const KProModal: SFCWithInstall<{
6
7
  new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
@@ -87,8 +88,6 @@ export declare const KProModal: SFCWithInstall<{
87
88
  onConfirm: (...args: any[]) => void;
88
89
  "update:modelValue": (modelValue: boolean) => void;
89
90
  }, string, {}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
90
- $slots: {
91
- default?(_: {}): any;
92
- };
91
+ $slots: Readonly< ProModalSlots> & ProModalSlots;
93
92
  })>;
94
93
  export default KProModal;
@@ -1,9 +1,8 @@
1
+ import { ProModalSlots } from './types';
1
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
3
  import { ModalFuncProps } from 'ant-design-vue';
3
4
  declare function __VLS_template(): {
4
- slots: {
5
- default?(_: {}): any;
6
- };
5
+ slots: Readonly<ProModalSlots> & ProModalSlots;
7
6
  refs: {
8
7
  modalTitleRef: HTMLDivElement;
9
8
  };
@@ -14,4 +14,18 @@ export declare const ProModalProps: {
14
14
  readonly required: true;
15
15
  };
16
16
  };
17
+ export interface ProModalSlots {
18
+ /**
19
+ * 自定义标题
20
+ */
21
+ title?: () => any;
22
+ /**
23
+ * 自定义页脚
24
+ */
25
+ footer?: () => any;
26
+ /**
27
+ * 默认插槽
28
+ */
29
+ default?: () => any;
30
+ }
17
31
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.60",
4
+ "version": "1.0.62",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",