@king-one/antdv 1.0.55 → 1.0.57

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.57
4
+
5
+ ### Patch Changes
6
+
7
+ - fix:修复 tsx 组件构建错误
8
+
9
+ ## 1.0.56
10
+
11
+ ### Patch Changes
12
+
13
+ - feat:使用 tsx 重构 pro-modal 组件
14
+
3
15
  ## 1.0.55
4
16
 
5
17
  ### Patch Changes
@@ -1,18 +1,44 @@
1
- import { defineComponent as p } from "vue";
2
- import { Modal as t } from "ant-design-vue";
3
- import { ProModalProps as a } from "./types.mjs";
4
- const l = p({
5
- props: a,
6
- setup(r, { slots: e }) {
7
- const d = defineModel({ required: !0, type: Boolean });
8
- return () => /* @__PURE__ */ React.createElement(t, { "v-model:open": d.value, "v-bind": r.modalProps }, {
9
- default: () => {
10
- var o;
11
- return (o = e.default) == null ? void 0 : o.call(e);
1
+ import { defineComponent as c, computed as p, createVNode as u, mergeProps as s } from "vue";
2
+ import { Modal as f } from "ant-design-vue";
3
+ import { useNamespace as C } from "../../../hooks/use-namespace/index.mjs";
4
+ import { ProModalProps as i } from "./types.mjs";
5
+ const M = /* @__PURE__ */ c({
6
+ props: i,
7
+ emits: ["update:modelValue", "onCancel", "onConfirm"],
8
+ setup(a, {
9
+ slots: o,
10
+ emit: n
11
+ }) {
12
+ const {
13
+ b: l
14
+ } = C("pro-modal"), t = p(() => l()), r = p({
15
+ get() {
16
+ return a.modelValue;
17
+ },
18
+ set(e) {
19
+ n("update:modelValue", e);
12
20
  }
13
- });
21
+ }), d = () => {
22
+ n("onConfirm");
23
+ }, m = () => {
24
+ n("onCancel");
25
+ };
26
+ return () => u(f, s({
27
+ open: r.value,
28
+ "onUpdate:open": (e) => r.value = e
29
+ }, a.modalProps, {
30
+ onOk: d,
31
+ onCancel: m,
32
+ "wrap-class-name": t.value
33
+ }), {
34
+ default: () => {
35
+ var e;
36
+ return (e = o.default) == null ? void 0 : e.call(o);
37
+ },
38
+ _: 1
39
+ }, 16, ["open", "onUpdate:open", "onOk", "onCancel", "wrap-class-name"]);
14
40
  }
15
41
  });
16
42
  export {
17
- l as default
43
+ M as default
18
44
  };
@@ -1,11 +1,12 @@
1
- const o = {
1
+ const e = {
2
2
  modalProps: {
3
3
  type: Object
4
4
  },
5
- aProps: {
6
- type: Object
5
+ modelValue: {
6
+ type: Boolean,
7
+ required: !0
7
8
  }
8
9
  };
9
10
  export {
10
- o as ProModalProps
11
+ e as ProModalProps
11
12
  };
@@ -1,169 +1,257 @@
1
- import { defineComponent as ae, onMounted as ce, ref as a, computed as c } from "vue";
2
- import { VResizeObserver as j } from "vueuc";
3
- import { off as g, on as z } from "evtd";
4
- import { defaultNamespace as u } from "../../../hooks/use-namespace/index.mjs";
5
- import { scrollbarProps as ie } from "./types.mjs";
6
- const ve = ae({
1
+ import { isVNode as ie, defineComponent as ce, onMounted as se, ref as a, computed as i, createVNode as u, mergeProps as ue } from "vue";
2
+ import { VResizeObserver as k } from "vueuc";
3
+ import { off as y, on as M } from "evtd";
4
+ import { defaultNamespace as f } from "../../../hooks/use-namespace/index.mjs";
5
+ import { scrollbarProps as fe } from "./types.mjs";
6
+ function de(o) {
7
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !ie(o);
8
+ }
9
+ const we = /* @__PURE__ */ ce({
7
10
  name: "KScrollbar",
8
- props: ie,
11
+ props: fe,
9
12
  inheritAttrs: !1,
10
- setup(l) {
11
- ce(() => {
12
- l.container || d();
13
+ setup(o) {
14
+ se(() => {
15
+ o.container || R();
13
16
  });
14
- const y = () => {
15
- d();
16
- }, M = () => {
17
- d();
18
- }, w = a(null), h = a(null), T = a(null), v = a(null), s = a(null), R = a(null), f = a(null), m = a(null), P = a(null), b = a(null), k = c(() => {
17
+ const d = () => {
18
+ R();
19
+ }, b = () => {
20
+ R();
21
+ }, p = a(null), x = a(null), m = a(null), P = a(null), s = a(null), h = a(null), v = a(null), S = a(null), T = a(null), X = a(null), q = i(() => {
19
22
  var e;
20
- return ((e = l.content) == null ? void 0 : e.call(l)) || w.value;
21
- }), x = c(() => {
23
+ return ((e = o.content) == null ? void 0 : e.call(o)) || p.value;
24
+ }), B = i(() => {
22
25
  var e;
23
- return ((e = l.container) == null ? void 0 : e.call(l)) || h.value;
24
- }), X = a(0), Y = a(0), q = c(() => {
25
- const { value: e } = f, { value: t } = s;
26
- return e !== null && t !== null && t > e;
27
- }), C = c(() => {
28
- const { value: e } = f, { value: t } = s, { value: n } = P;
29
- return e === null || t === null || n === null ? 0 : Math.min(e, n * e / t + 5 * 1.5);
30
- }), F = c(() => `${C.value}px`), G = c(() => {
31
- const { value: e } = f, { value: t } = X, { value: n } = s, { value: r } = P;
32
- if (e === null || n === null || r === null)
26
+ return ((e = o.container) == null ? void 0 : e.call(o)) || x.value;
27
+ }), Y = a(0), C = a(0), F = i(() => {
28
+ const {
29
+ value: e
30
+ } = v, {
31
+ value: n
32
+ } = s;
33
+ return e !== null && n !== null && n > e;
34
+ }), H = i(() => {
35
+ const {
36
+ value: e
37
+ } = v, {
38
+ value: n
39
+ } = s, {
40
+ value: t
41
+ } = T;
42
+ return e === null || n === null || t === null ? 0 : Math.min(e, t * e / n + 5 * 1.5);
43
+ }), G = i(() => `${H.value}px`), J = i(() => {
44
+ const {
45
+ value: e
46
+ } = v, {
47
+ value: n
48
+ } = Y, {
49
+ value: t
50
+ } = s, {
51
+ value: r
52
+ } = T;
53
+ if (e === null || t === null || r === null)
33
54
  return 0;
34
55
  {
35
- const o = n - e;
36
- return o ? t / o * (r - C.value) : 0;
56
+ const l = t - e;
57
+ return l ? n / l * (r - H.value) : 0;
37
58
  }
38
- }), J = c(() => `${G.value}px`);
39
- let E = !1, D = 0, U = 0, B, p;
40
- const _ = (e) => {
41
- if (!E)
42
- return;
43
- p !== void 0 && window.clearTimeout(p), B !== void 0 && window.clearTimeout(B);
44
- const { value: t } = f, { value: n } = s, { value: r } = C;
45
- if (t === null || n === null)
46
- return;
47
- const W = (e.clientY - U) * (n - t) / (t - r), $ = n - t;
48
- let i = D + W;
49
- i = Math.min($, i), i = Math.max(i, 0);
50
- const { value: S } = x;
51
- S && (S.scrollTop = i);
52
- }, N = (e) => {
53
- e.preventDefault(), e.stopPropagation(), g("mousemove", window, _, !0), g("mouseup", window, N, !0), E = !1, d();
54
- }, Q = (e) => {
55
- e.preventDefault(), e.stopPropagation(), z("mousemove", window, _, !0), z("mouseup", window, N, !0), D = X.value, U = e.clientY, E = !0;
59
+ }), Q = i(() => `${J.value}px`);
60
+ let L = !1, N = 0, V = 0, g, z;
61
+ const U = (e) => {
62
+ if (!L) return;
63
+ z !== void 0 && window.clearTimeout(z), g !== void 0 && window.clearTimeout(g);
64
+ const {
65
+ value: n
66
+ } = v, {
67
+ value: t
68
+ } = s, {
69
+ value: r
70
+ } = H;
71
+ if (n === null || t === null) return;
72
+ const D = (e.clientY - V) * (t - n) / (n - r), _ = t - n;
73
+ let c = N + D;
74
+ c = Math.min(_, c), c = Math.max(c, 0);
75
+ const {
76
+ value: w
77
+ } = B;
78
+ w && (w.scrollTop = c);
79
+ }, j = (e) => {
80
+ e.preventDefault(), e.stopPropagation(), y("mousemove", window, U, !0), y("mouseup", window, j, !0), L = !1, R();
81
+ }, Z = (e) => {
82
+ e.preventDefault(), e.stopPropagation(), M("mousemove", window, U, !0), M("mouseup", window, j, !0), N = Y.value, V = e.clientY, L = !0;
56
83
  };
57
- function Z(e) {
58
- const { onScroll: t } = l;
59
- t && t(e), O();
84
+ function ee(e) {
85
+ const {
86
+ onScroll: n
87
+ } = o;
88
+ n && n(e), K();
60
89
  }
61
- const ee = c(() => {
62
- const { value: e } = m, { value: t } = R;
63
- return e !== null && t !== null && t > e;
64
- }), H = c(() => {
65
- const { value: e } = m, { value: t } = R, { value: n } = b;
66
- return e === null || t === null || n === null ? 0 : n * e / t + 5 * 1.5;
67
- }), te = c(() => `${H.value}px`), ne = c(() => {
68
- const { value: e } = m, { value: t } = Y, { value: n } = R, { value: r } = b;
69
- if (e === null || n === null || r === null)
90
+ const ne = i(() => {
91
+ const {
92
+ value: e
93
+ } = S, {
94
+ value: n
95
+ } = h;
96
+ return e !== null && n !== null && n > e;
97
+ }), W = i(() => {
98
+ const {
99
+ value: e
100
+ } = S, {
101
+ value: n
102
+ } = h, {
103
+ value: t
104
+ } = X;
105
+ return e === null || n === null || t === null ? 0 : t * e / n + 5 * 1.5;
106
+ }), te = i(() => `${W.value}px`), oe = i(() => {
107
+ const {
108
+ value: e
109
+ } = S, {
110
+ value: n
111
+ } = C, {
112
+ value: t
113
+ } = h, {
114
+ value: r
115
+ } = X;
116
+ if (e === null || t === null || r === null)
70
117
  return 0;
71
118
  {
72
- const o = n - e;
73
- return o ? t / o * (r - H.value) : 0;
119
+ const l = t - e;
120
+ return l ? n / l * (r - W.value) : 0;
74
121
  }
75
- }), le = c(() => `${ne.value}px`);
76
- let L = !1, V = 0, I = 0;
77
- const A = (e) => {
78
- if (!L)
79
- return;
80
- p !== void 0 && window.clearTimeout(p), B !== void 0 && window.clearTimeout(B);
81
- const { value: t } = m, { value: n } = R, { value: r } = H;
82
- if (t === null || n === null)
83
- return;
84
- const W = (e.clientX - I) * (n - t) / (t - r), $ = n - t;
85
- let i = V + W;
86
- i = Math.min($, i), i = Math.max(i, 0);
87
- const { value: S } = x;
88
- S && (S.scrollLeft = i);
89
- }, K = (e) => {
90
- e.preventDefault(), e.stopPropagation(), g("mousemove", window, A, !0), g("mouseup", window, K, !0), L = !1, d();
122
+ }), le = i(() => `${oe.value}px`);
123
+ let $ = !1, O = 0, E = 0;
124
+ const I = (e) => {
125
+ if (!$) return;
126
+ z !== void 0 && window.clearTimeout(z), g !== void 0 && window.clearTimeout(g);
127
+ const {
128
+ value: n
129
+ } = S, {
130
+ value: t
131
+ } = h, {
132
+ value: r
133
+ } = W;
134
+ if (n === null || t === null) return;
135
+ const D = (e.clientX - E) * (t - n) / (n - r), _ = t - n;
136
+ let c = O + D;
137
+ c = Math.min(_, c), c = Math.max(c, 0);
138
+ const {
139
+ value: w
140
+ } = B;
141
+ w && (w.scrollLeft = c);
142
+ }, A = (e) => {
143
+ e.preventDefault(), e.stopPropagation(), y("mousemove", window, I, !0), y("mouseup", window, A, !0), $ = !1, R();
91
144
  };
92
- function oe(e) {
93
- e.preventDefault(), e.stopPropagation(), L = !0, z("mousemove", window, A, !0), z("mouseup", window, K, !0), V = Y.value, I = e.clientX;
145
+ function re(e) {
146
+ e.preventDefault(), e.stopPropagation(), $ = !0, M("mousemove", window, I, !0), M("mouseup", window, A, !0), O = C.value, E = e.clientX;
94
147
  }
95
- function O() {
96
- const { value: e } = x;
97
- e && (X.value = e.scrollTop, Y.value = e.scrollLeft);
148
+ function K() {
149
+ const {
150
+ value: e
151
+ } = B;
152
+ e && (Y.value = e.scrollTop, C.value = e.scrollLeft);
98
153
  }
99
- const re = () => {
100
- const { value: e } = k;
154
+ const ae = () => {
155
+ const {
156
+ value: e
157
+ } = q;
101
158
  if (e) {
102
- const o = e.getBoundingClientRect();
103
- s.value = o.height, R.value = o.width;
159
+ const l = e.getBoundingClientRect();
160
+ s.value = l.height, h.value = l.width;
104
161
  }
105
- const { value: t } = x;
106
- if (t) {
107
- const o = t.getBoundingClientRect();
108
- f.value = o.height, m.value = o.width;
162
+ const {
163
+ value: n
164
+ } = B;
165
+ if (n) {
166
+ const l = n.getBoundingClientRect();
167
+ v.value = l.height, S.value = l.width;
109
168
  }
110
- const { value: n } = T;
111
- n && (P.value = n.offsetHeight);
112
- const { value: r } = v;
113
- r && (b.value = r.offsetWidth);
169
+ const {
170
+ value: t
171
+ } = m;
172
+ t && (T.value = t.offsetHeight);
173
+ const {
174
+ value: r
175
+ } = P;
176
+ r && (X.value = r.offsetWidth);
114
177
  };
115
- function d() {
116
- re(), O();
178
+ function R() {
179
+ ae(), K();
117
180
  }
118
181
  return {
119
- sync: d,
120
- handleContentResize: y,
121
- handleContainerResize: M,
122
- contentRef: w,
123
- yRailRef: T,
124
- xRailRef: v,
125
- containerRef: h,
182
+ sync: R,
183
+ handleContentResize: d,
184
+ handleContainerResize: b,
185
+ contentRef: p,
186
+ yRailRef: m,
187
+ xRailRef: P,
188
+ containerRef: x,
126
189
  contentHeightRef: s,
127
- containerHeightRef: f,
128
- needYBarRef: q,
129
- needXBarRef: ee,
130
- yBarSizePxRef: F,
131
- handleYScrollMouseDown: Q,
132
- handleXScrollMouseDown: oe,
133
- yBarTopPxRef: J,
134
- handleScroll: Z,
190
+ containerHeightRef: v,
191
+ needYBarRef: F,
192
+ needXBarRef: ne,
193
+ yBarSizePxRef: G,
194
+ handleYScrollMouseDown: Z,
195
+ handleXScrollMouseDown: re,
196
+ yBarTopPxRef: Q,
197
+ handleScroll: ee,
135
198
  xBarSizePxRef: te,
136
199
  xBarLeftPxRef: le
137
200
  };
138
201
  },
139
202
  render() {
140
- const { $slots: l, xScrollable: y } = this, M = () => /* @__PURE__ */ React.createElement("div", { class: `${u}-scrollbar-rail ${u}-scrollbar-rail--horizontal`, ref: "xRailRef" }, this.needXBarRef && /* @__PURE__ */ React.createElement(
141
- "div",
142
- {
143
- class: `${u}-scrollbar-rail__scrollbar--horizontal`,
144
- style: {
145
- width: this.xBarSizePxRef,
146
- left: this.xBarLeftPxRef
147
- },
148
- onMousedown: this.handleXScrollMouseDown
149
- }
150
- )), w = () => /* @__PURE__ */ React.createElement("div", { class: `${u}-scrollbar-rail ${u}-scrollbar-rail--vertical`, ref: "yRailRef" }, this.needYBarRef && /* @__PURE__ */ React.createElement(
151
- "div",
152
- {
153
- class: `${u}-scrollbar-rail__scrollbar--vertical`,
154
- style: {
155
- height: this.yBarSizePxRef,
156
- top: this.yBarTopPxRef
157
- },
158
- onMousedown: this.handleYScrollMouseDown
159
- }
160
- )), h = () => {
161
- var v, s;
162
- return /* @__PURE__ */ React.createElement("div", { class: `${u}-scrollbar`, ...this.$attrs }, this.container ? (v = l.default) == null ? void 0 : v.call(l) : /* @__PURE__ */ React.createElement("div", { class: `${u}-scrollbar-container`, onScroll: this.handleScroll, ref: "containerRef" }, /* @__PURE__ */ React.createElement(j, { onResize: this.handleContentResize }, /* @__PURE__ */ React.createElement("div", { ref: "contentRef", class: `${u}-scrollbar-content` }, (s = l.default) == null ? void 0 : s.call(l)))), w(), y && M());
203
+ let o;
204
+ const {
205
+ $slots: d,
206
+ xScrollable: b
207
+ } = this, p = () => u("div", {
208
+ class: `${f}-scrollbar-rail ${f}-scrollbar-rail--horizontal`,
209
+ ref: "xRailRef"
210
+ }, [this.needXBarRef && u("div", {
211
+ class: `${f}-scrollbar-rail__scrollbar--horizontal`,
212
+ style: {
213
+ width: this.xBarSizePxRef,
214
+ left: this.xBarLeftPxRef
215
+ },
216
+ onMousedown: this.handleXScrollMouseDown
217
+ }, null, 44, ["onMousedown"])], 512), x = () => u("div", {
218
+ class: `${f}-scrollbar-rail ${f}-scrollbar-rail--vertical`,
219
+ ref: "yRailRef"
220
+ }, [this.needYBarRef && u("div", {
221
+ class: `${f}-scrollbar-rail__scrollbar--vertical`,
222
+ style: {
223
+ height: this.yBarSizePxRef,
224
+ top: this.yBarTopPxRef
225
+ },
226
+ onMousedown: this.handleYScrollMouseDown
227
+ }, null, 44, ["onMousedown"])], 512), m = () => {
228
+ var s;
229
+ return u("div", ue({
230
+ class: `${f}-scrollbar`
231
+ }, this.$attrs), [this.container ? (s = d.default) == null ? void 0 : s.call(d) : u("div", {
232
+ class: `${f}-scrollbar-container`,
233
+ onScroll: this.handleScroll,
234
+ ref: "containerRef"
235
+ }, [u(k, {
236
+ onResize: this.handleContentResize
237
+ }, {
238
+ default: () => {
239
+ var h;
240
+ return [u("div", {
241
+ ref: "contentRef",
242
+ class: `${f}-scrollbar-content`
243
+ }, [(h = d.default) == null ? void 0 : h.call(d)], 512)];
244
+ }
245
+ }, 8, ["onResize"])], 40, ["onScroll"]), x(), b && p()], 16);
163
246
  };
164
- return this.container ? h() : /* @__PURE__ */ React.createElement(j, { onResize: this.handleContainerResize }, h());
247
+ return this.container ? m() : u(k, {
248
+ onResize: this.handleContainerResize
249
+ }, de(o = m()) ? o : {
250
+ default: () => [o],
251
+ _: 1
252
+ }, 8, ["onResize"]);
165
253
  }
166
254
  });
167
255
  export {
168
- ve as default
256
+ we as default
169
257
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),u=require("ant-design-vue"),d=require("./types.js"),a=n.defineComponent({props:d.ProModalProps,setup(r,{slots:e}){const t=defineModel({required:!0,type:Boolean});return()=>React.createElement(u.Modal,{"v-model:open":t.value,"v-bind":r.modalProps},{default:()=>{var o;return(o=e.default)==null?void 0:o.call(e)}})}});exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),p=require("ant-design-vue"),s=require("../../../hooks/use-namespace/index.js"),m=require("./types.js"),i=n.defineComponent({props:m.ProModalProps,emits:["update:modelValue","onCancel","onConfirm"],setup(r,{slots:o,emit:a}){const{b:u}=s.useNamespace("pro-modal"),l=n.computed(()=>u()),t=n.computed({get(){return r.modelValue},set(e){a("update:modelValue",e)}}),c=()=>{a("onConfirm")},d=()=>{a("onCancel")};return()=>n.createVNode(p.Modal,n.mergeProps({open:t.value,"onUpdate:open":e=>t.value=e},r.modalProps,{onOk:c,onCancel:d,"wrap-class-name":l.value}),{default:()=>{var e;return(e=o.default)==null?void 0:e.call(o)},_:1},16,["open","onUpdate:open","onOk","onCancel","wrap-class-name"])}});exports.default=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={modalProps:{type:Object},aProps:{type:Object}};exports.ProModalProps=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={modalProps:{type:Object},modelValue:{type:Boolean,required:!0}};exports.ProModalProps=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),I=require("vueuc"),s=require("evtd"),u=require("../../../hooks/use-namespace/index.js"),oe=require("./types.js"),ae=n.defineComponent({name:"KScrollbar",props:oe.scrollbarProps,inheritAttrs:!1,setup(o){n.onMounted(()=>{o.container||d()});const g=()=>{d()},z=()=>{d()},S=n.ref(null),v=n.ref(null),y=n.ref(null),h=n.ref(null),i=n.ref(null),m=n.ref(null),f=n.ref(null),R=n.ref(null),M=n.ref(null),b=n.ref(null),j=n.computed(()=>{var e;return((e=o.content)==null?void 0:e.call(o))||S.value}),w=n.computed(()=>{var e;return((e=o.container)==null?void 0:e.call(o))||v.value}),T=n.ref(0),P=n.ref(0),A=n.computed(()=>{const{value:e}=f,{value:t}=i;return e!==null&&t!==null&&t>e}),X=n.computed(()=>{const{value:e}=f,{value:t}=i,{value:l}=M;return e===null||t===null||l===null?0:Math.min(e,l*e/t+5*1.5)}),K=n.computed(()=>`${X.value}px`),k=n.computed(()=>{const{value:e}=f,{value:t}=T,{value:l}=i,{value:r}=M;if(e===null||l===null||r===null)return 0;{const a=l-e;return a?t/a*(r-X.value):0}}),F=n.computed(()=>`${k.value}px`);let Y=!1,N=0,W=0,x,B;const $=e=>{if(!Y)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:t}=f,{value:l}=i,{value:r}=X;if(t===null||l===null)return;const H=(e.clientY-W)*(l-t)/(t-r),L=l-t;let c=N+H;c=Math.min(L,c),c=Math.max(c,0);const{value:p}=w;p&&(p.scrollTop=c)},D=e=>{e.preventDefault(),e.stopPropagation(),s.off("mousemove",window,$,!0),s.off("mouseup",window,D,!0),Y=!1,d()},G=e=>{e.preventDefault(),e.stopPropagation(),s.on("mousemove",window,$,!0),s.on("mouseup",window,D,!0),N=T.value,W=e.clientY,Y=!0};function J(e){const{onScroll:t}=o;t&&t(e),O()}const Q=n.computed(()=>{const{value:e}=R,{value:t}=m;return e!==null&&t!==null&&t>e}),C=n.computed(()=>{const{value:e}=R,{value:t}=m,{value:l}=b;return e===null||t===null||l===null?0:l*e/t+5*1.5}),Z=n.computed(()=>`${C.value}px`),ee=n.computed(()=>{const{value:e}=R,{value:t}=P,{value:l}=m,{value:r}=b;if(e===null||l===null||r===null)return 0;{const a=l-e;return a?t/a*(r-C.value):0}}),te=n.computed(()=>`${ee.value}px`);let E=!1,_=0,q=0;const U=e=>{if(!E)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:t}=R,{value:l}=m,{value:r}=C;if(t===null||l===null)return;const H=(e.clientX-q)*(l-t)/(t-r),L=l-t;let c=_+H;c=Math.min(L,c),c=Math.max(c,0);const{value:p}=w;p&&(p.scrollLeft=c)},V=e=>{e.preventDefault(),e.stopPropagation(),s.off("mousemove",window,U,!0),s.off("mouseup",window,V,!0),E=!1,d()};function ne(e){e.preventDefault(),e.stopPropagation(),E=!0,s.on("mousemove",window,U,!0),s.on("mouseup",window,V,!0),_=P.value,q=e.clientX}function O(){const{value:e}=w;e&&(T.value=e.scrollTop,P.value=e.scrollLeft)}const le=()=>{const{value:e}=j;if(e){const a=e.getBoundingClientRect();i.value=a.height,m.value=a.width}const{value:t}=w;if(t){const a=t.getBoundingClientRect();f.value=a.height,R.value=a.width}const{value:l}=y;l&&(M.value=l.offsetHeight);const{value:r}=h;r&&(b.value=r.offsetWidth)};function d(){le(),O()}return{sync:d,handleContentResize:g,handleContainerResize:z,contentRef:S,yRailRef:y,xRailRef:h,containerRef:v,contentHeightRef:i,containerHeightRef:f,needYBarRef:A,needXBarRef:Q,yBarSizePxRef:K,handleYScrollMouseDown:G,handleXScrollMouseDown:ne,yBarTopPxRef:F,handleScroll:J,xBarSizePxRef:Z,xBarLeftPxRef:te}},render(){const{$slots:o,xScrollable:g}=this,z=()=>React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--horizontal`,ref:"xRailRef"},this.needXBarRef&&React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,style:{width:this.xBarSizePxRef,left:this.xBarLeftPxRef},onMousedown:this.handleXScrollMouseDown})),S=()=>React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--vertical`,ref:"yRailRef"},this.needYBarRef&&React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--vertical`,style:{height:this.yBarSizePxRef,top:this.yBarTopPxRef},onMousedown:this.handleYScrollMouseDown})),v=()=>{var h,i;return React.createElement("div",{class:`${u.defaultNamespace}-scrollbar`,...this.$attrs},this.container?(h=o.default)==null?void 0:h.call(o):React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-container`,onScroll:this.handleScroll,ref:"containerRef"},React.createElement(I.VResizeObserver,{onResize:this.handleContentResize},React.createElement("div",{ref:"contentRef",class:`${u.defaultNamespace}-scrollbar-content`},(i=o.default)==null?void 0:i.call(o)))),S(),g&&z())};return this.container?v():React.createElement(I.VResizeObserver,{onResize:this.handleContainerResize},v())}});exports.default=ae;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),E=require("vueuc"),d=require("evtd"),u=require("../../../hooks/use-namespace/index.js"),le=require("./types.js");function re(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!t.isVNode(l)}const ae=t.defineComponent({name:"KScrollbar",props:le.scrollbarProps,inheritAttrs:!1,setup(l){t.onMounted(()=>{l.container||h()});const s=()=>{h()},z=()=>{h()},S=t.ref(null),w=t.ref(null),m=t.ref(null),y=t.ref(null),i=t.ref(null),f=t.ref(null),v=t.ref(null),R=t.ref(null),M=t.ref(null),b=t.ref(null),I=t.computed(()=>{var e;return((e=l.content)==null?void 0:e.call(l))||S.value}),x=t.computed(()=>{var e;return((e=l.container)==null?void 0:e.call(l))||w.value}),N=t.ref(0),P=t.ref(0),A=t.computed(()=>{const{value:e}=v,{value:n}=i;return e!==null&&n!==null&&n>e}),T=t.computed(()=>{const{value:e}=v,{value:n}=i,{value:o}=M;return e===null||n===null||o===null?0:Math.min(e,o*e/n+5*1.5)}),K=t.computed(()=>`${T.value}px`),k=t.computed(()=>{const{value:e}=v,{value:n}=N,{value:o}=i,{value:a}=M;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-T.value):0}}),F=t.computed(()=>`${k.value}px`);let V=!1,L=0,W=0,B,g;const $=e=>{if(!V)return;g!==void 0&&window.clearTimeout(g),B!==void 0&&window.clearTimeout(B);const{value:n}=v,{value:o}=i,{value:a}=T;if(n===null||o===null)return;const C=(e.clientY-W)*(o-n)/(n-a),H=o-n;let c=L+C;c=Math.min(H,c),c=Math.max(c,0);const{value:p}=x;p&&(p.scrollTop=c)},D=e=>{e.preventDefault(),e.stopPropagation(),d.off("mousemove",window,$,!0),d.off("mouseup",window,D,!0),V=!1,h()},G=e=>{e.preventDefault(),e.stopPropagation(),d.on("mousemove",window,$,!0),d.on("mouseup",window,D,!0),L=N.value,W=e.clientY,V=!0};function J(e){const{onScroll:n}=l;n&&n(e),U()}const Q=t.computed(()=>{const{value:e}=R,{value:n}=f;return e!==null&&n!==null&&n>e}),X=t.computed(()=>{const{value:e}=R,{value:n}=f,{value:o}=b;return e===null||n===null||o===null?0:o*e/n+5*1.5}),Z=t.computed(()=>`${X.value}px`),ee=t.computed(()=>{const{value:e}=R,{value:n}=P,{value:o}=f,{value:a}=b;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-X.value):0}}),te=t.computed(()=>`${ee.value}px`);let Y=!1,_=0,q=0;const O=e=>{if(!Y)return;g!==void 0&&window.clearTimeout(g),B!==void 0&&window.clearTimeout(B);const{value:n}=R,{value:o}=f,{value:a}=X;if(n===null||o===null)return;const C=(e.clientX-q)*(o-n)/(n-a),H=o-n;let c=_+C;c=Math.min(H,c),c=Math.max(c,0);const{value:p}=x;p&&(p.scrollLeft=c)},j=e=>{e.preventDefault(),e.stopPropagation(),d.off("mousemove",window,O,!0),d.off("mouseup",window,j,!0),Y=!1,h()};function ne(e){e.preventDefault(),e.stopPropagation(),Y=!0,d.on("mousemove",window,O,!0),d.on("mouseup",window,j,!0),_=P.value,q=e.clientX}function U(){const{value:e}=x;e&&(N.value=e.scrollTop,P.value=e.scrollLeft)}const oe=()=>{const{value:e}=I;if(e){const r=e.getBoundingClientRect();i.value=r.height,f.value=r.width}const{value:n}=x;if(n){const r=n.getBoundingClientRect();v.value=r.height,R.value=r.width}const{value:o}=m;o&&(M.value=o.offsetHeight);const{value:a}=y;a&&(b.value=a.offsetWidth)};function h(){oe(),U()}return{sync:h,handleContentResize:s,handleContainerResize:z,contentRef:S,yRailRef:m,xRailRef:y,containerRef:w,contentHeightRef:i,containerHeightRef:v,needYBarRef:A,needXBarRef:Q,yBarSizePxRef:K,handleYScrollMouseDown:G,handleXScrollMouseDown:ne,yBarTopPxRef:F,handleScroll:J,xBarSizePxRef:Z,xBarLeftPxRef:te}},render(){let l;const{$slots:s,xScrollable:z}=this,S=()=>t.createVNode("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--horizontal`,ref:"xRailRef"},[this.needXBarRef&&t.createVNode("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,style:{width:this.xBarSizePxRef,left:this.xBarLeftPxRef},onMousedown:this.handleXScrollMouseDown},null,44,["onMousedown"])],512),w=()=>t.createVNode("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--vertical`,ref:"yRailRef"},[this.needYBarRef&&t.createVNode("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--vertical`,style:{height:this.yBarSizePxRef,top:this.yBarTopPxRef},onMousedown:this.handleYScrollMouseDown},null,44,["onMousedown"])],512),m=()=>{var i;return t.createVNode("div",t.mergeProps({class:`${u.defaultNamespace}-scrollbar`},this.$attrs),[this.container?(i=s.default)==null?void 0:i.call(s):t.createVNode("div",{class:`${u.defaultNamespace}-scrollbar-container`,onScroll:this.handleScroll,ref:"containerRef"},[t.createVNode(E.VResizeObserver,{onResize:this.handleContentResize},{default:()=>{var f;return[t.createVNode("div",{ref:"contentRef",class:`${u.defaultNamespace}-scrollbar-content`},[(f=s.default)==null?void 0:f.call(s)],512)]}},8,["onResize"])],40,["onScroll"]),w(),z&&S()],16)};return this.container?m():t.createVNode(E.VResizeObserver,{onResize:this.handleContainerResize},re(l=m())?l:{default:()=>[l],_:1},8,["onResize"])}});exports.default=ae;
@@ -1 +1 @@
1
- @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=51204) format("woff2"),url(fonts/iconfont.woff?t=36957) format("woff"),url(fonts/iconfont.ttf?t=94638) 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=96456) format("woff2"),url(fonts/iconfont.woff?t=88136) format("woff"),url(fonts/iconfont.ttf?t=9101) 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-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}.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-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=78082) format("woff2"),url(fonts/iconfont.woff?t=90226) format("woff"),url(fonts/iconfont.ttf?t=24346) 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-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}.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-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=45736) format("woff2"),url(fonts/iconfont.woff?t=57995) format("woff"),url(fonts/iconfont.ttf?t=91719) 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,19 +6,21 @@ export declare const KProModal: SFCWithInstall<DefineComponent<{
6
6
  readonly modalProps: {
7
7
  readonly type: PropType<Omit< ModalFuncProps, "open">>;
8
8
  };
9
- readonly aProps: {
10
- readonly type: PropType<{
11
- name: string;
12
- }>;
9
+ readonly modelValue: {
10
+ readonly type: BooleanConstructor;
11
+ readonly required: true;
13
12
  };
14
- }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
13
+ }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("onCancel" | "update:modelValue" | "onConfirm")[], "onCancel" | "update:modelValue" | "onConfirm", PublicProps, Readonly< ExtractPropTypes<{
15
14
  readonly modalProps: {
16
15
  readonly type: PropType<Omit< ModalFuncProps, "open">>;
17
16
  };
18
- readonly aProps: {
19
- readonly type: PropType<{
20
- name: string;
21
- }>;
17
+ readonly modelValue: {
18
+ readonly type: BooleanConstructor;
19
+ readonly required: true;
22
20
  };
23
- }>>, {}, {}>>;
21
+ }>> & {
22
+ onOnCancel?: ((...args: any[]) => any) | undefined;
23
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
24
+ onOnConfirm?: ((...args: any[]) => any) | undefined;
25
+ }, {}, {}>>;
24
26
  export default KProModal;
@@ -4,19 +4,21 @@ declare const _default: DefineComponent<{
4
4
  readonly modalProps: {
5
5
  readonly type: PropType<Omit< ModalFuncProps, "open">>;
6
6
  };
7
- readonly aProps: {
8
- readonly type: PropType<{
9
- name: string;
10
- }>;
7
+ readonly modelValue: {
8
+ readonly type: BooleanConstructor;
9
+ readonly required: true;
11
10
  };
12
- }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
11
+ }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("onCancel" | "update:modelValue" | "onConfirm")[], "onCancel" | "update:modelValue" | "onConfirm", PublicProps, Readonly< ExtractPropTypes<{
13
12
  readonly modalProps: {
14
13
  readonly type: PropType<Omit< ModalFuncProps, "open">>;
15
14
  };
16
- readonly aProps: {
17
- readonly type: PropType<{
18
- name: string;
19
- }>;
15
+ readonly modelValue: {
16
+ readonly type: BooleanConstructor;
17
+ readonly required: true;
20
18
  };
21
- }>>, {}, {}>;
19
+ }>> & {
20
+ onOnCancel?: ((...args: any[]) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
22
+ onOnConfirm?: ((...args: any[]) => any) | undefined;
23
+ }, {}, {}>;
22
24
  export default _default;
@@ -5,10 +5,9 @@ export declare const ProModalProps: {
5
5
  readonly modalProps: {
6
6
  readonly type: PropType<Omit<ModalType, "open">>;
7
7
  };
8
- readonly aProps: {
9
- readonly type: PropType<{
10
- name: string;
11
- }>;
8
+ readonly modelValue: {
9
+ readonly type: BooleanConstructor;
10
+ readonly required: true;
12
11
  };
13
12
  };
14
13
  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.55",
4
+ "version": "1.0.57",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",