@king-one/antdv 1.0.57 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/es/components/form/component/form-item.vue.mjs +4 -0
  3. package/dist/es/components/form/component/form-item.vue2.mjs +56 -0
  4. package/dist/es/components/form/component/form.mjs +8 -6
  5. package/dist/es/components/form/component/form.vue2.mjs +16 -14
  6. package/dist/es/components/form/content/form-content.mjs +13 -0
  7. package/dist/es/components/form/index.mjs +10 -6
  8. package/dist/es/components/index.mjs +16 -13
  9. package/dist/es/components/pro-modal/index.mjs +8 -7
  10. package/dist/es/components/pro-modal/src/ProModal.vue.mjs +4 -0
  11. package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +82 -0
  12. package/dist/es/components/pro-modal/src/types.mjs +4 -0
  13. package/dist/es/components/pro-signature/index.mjs +10 -0
  14. package/dist/es/components/pro-signature/src/ProSignature.vue.mjs +4 -0
  15. package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +145 -0
  16. package/dist/es/components/pro-signature/src/types.mjs +40 -0
  17. package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +32 -26
  18. package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +35 -35
  19. package/dist/es/components/scroll-bar/index.mjs +6 -5
  20. package/dist/es/components/scroll-bar/src/scroll-bar.mjs +163 -156
  21. package/dist/es/components/scroll-bar/src/types.mjs +4 -3
  22. package/dist/es/components/scroll-bar/style/index.mjs +2 -0
  23. package/dist/es/components/utils/install.mjs +4 -2
  24. package/dist/es/index.mjs +48 -42
  25. package/dist/lib/components/form/component/form-item.vue.js +1 -0
  26. package/dist/lib/components/form/component/form-item.vue2.js +1 -0
  27. package/dist/lib/components/form/component/form.js +1 -1
  28. package/dist/lib/components/form/component/form.vue2.js +1 -1
  29. package/dist/lib/components/form/content/form-content.js +1 -0
  30. package/dist/lib/components/form/index.js +1 -1
  31. package/dist/lib/components/index.js +1 -1
  32. package/dist/lib/components/pro-modal/index.js +1 -1
  33. package/dist/lib/components/pro-modal/src/ProModal.vue.js +1 -0
  34. package/dist/lib/components/pro-modal/src/ProModal.vue2.js +1 -0
  35. package/dist/lib/components/pro-modal/src/types.js +1 -1
  36. package/dist/lib/components/pro-signature/index.js +1 -0
  37. package/dist/lib/components/pro-signature/src/ProSignature.vue.js +1 -0
  38. package/dist/lib/components/pro-signature/src/ProSignature.vue2.js +1 -0
  39. package/dist/lib/components/pro-signature/src/types.js +1 -0
  40. package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -1
  41. package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +1 -1
  42. package/dist/lib/components/scroll-bar/index.js +1 -1
  43. package/dist/lib/components/scroll-bar/src/scroll-bar.js +1 -1
  44. package/dist/lib/components/scroll-bar/src/types.js +1 -1
  45. package/dist/lib/components/scroll-bar/style/index.js +1 -0
  46. package/dist/lib/components/utils/install.js +1 -1
  47. package/dist/lib/index.js +1 -1
  48. package/dist/theme-chalk/icon.css +1 -1
  49. package/dist/theme-chalk/index.css +1 -1
  50. package/dist/theme-chalk/pro-modal.css +1 -1
  51. package/dist/theme-chalk/scale-virtual-list.css +1 -1
  52. package/dist/types/components/form/component/form-item.vue.d.ts +30 -0
  53. package/dist/types/components/form/component/form.d.ts +11 -6
  54. package/dist/types/components/form/component/form.vue.d.ts +2 -17
  55. package/dist/types/components/form/content/form-content.d.ts +8 -0
  56. package/dist/types/components/form/index.d.ts +31 -18
  57. package/dist/types/components/index.d.ts +1 -0
  58. package/dist/types/components/pro-modal/index.d.ts +81 -13
  59. package/dist/types/components/pro-modal/src/Modal.d.ts +12 -4
  60. package/dist/types/components/pro-modal/src/ProModal.vue.d.ts +52 -0
  61. package/dist/types/components/pro-modal/src/types.d.ts +5 -1
  62. package/dist/types/components/pro-signature/index.d.ts +95 -0
  63. package/dist/types/components/pro-signature/src/ProSignature.vue.d.ts +95 -0
  64. package/dist/types/components/pro-signature/src/types.d.ts +37 -0
  65. package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +3 -1
  66. package/dist/types/components/scale-virtual-list/hooks/useVirtualList.d.ts +1 -1
  67. package/dist/types/components/scroll-bar/index.d.ts +7 -3
  68. package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +7 -3
  69. package/dist/types/components/scroll-bar/src/types.d.ts +1 -0
  70. package/dist/types/components/utils/install.d.ts +2 -1
  71. package/global.d.ts +1 -0
  72. package/package.json +1 -3
  73. package/dist/es/components/pro-modal/src/Modal.mjs +0 -44
  74. package/dist/lib/components/pro-modal/src/Modal.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.60
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:增加手写签名组件
8
+
9
+ ## 1.0.59
10
+
11
+ ### Patch Changes
12
+
13
+ - a4fcf1a: feat:增加 form-item 组件
14
+
15
+ ## 1.0.58
16
+
17
+ ### Patch Changes
18
+
19
+ - feat:modal 增加拖拽功能
20
+
3
21
  ## 1.0.57
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ import f from "./form-item.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as p, computed as f, ref as d, toRaw as u, openBlock as v, createElementBlock as g, normalizeClass as e, createElementVNode as r, unref as s, renderSlot as _, toDisplayString as b } from "vue";
2
+ import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
3
+ import { useProvideFormItem as k } from "../content/form-content.mjs";
4
+ import { formItemProps as y } from "./form.mjs";
5
+ const P = /* @__PURE__ */ p({
6
+ name: "KFormItem",
7
+ __name: "form-item",
8
+ props: y,
9
+ setup(a) {
10
+ const l = a, { b: m, e: o } = I("form-item"), n = f(() => [m()]), c = async (t) => {
11
+ console.log("trigger", t);
12
+ }, i = d("请输入姓名");
13
+ return k({ ...u(l), validate: c }), (t, B) => (v(), g(
14
+ "div",
15
+ {
16
+ class: e(n.value)
17
+ },
18
+ [
19
+ r(
20
+ "label",
21
+ {
22
+ class: e(s(o)("lable"))
23
+ },
24
+ null,
25
+ 2
26
+ /* CLASS */
27
+ ),
28
+ r(
29
+ "div",
30
+ {
31
+ class: e(s(o)("content"))
32
+ },
33
+ [
34
+ _(t.$slots, "default"),
35
+ r(
36
+ "div",
37
+ {
38
+ class: e(s(o)("error"))
39
+ },
40
+ b(i.value),
41
+ 3
42
+ /* TEXT, CLASS */
43
+ )
44
+ ],
45
+ 2
46
+ /* CLASS */
47
+ )
48
+ ],
49
+ 2
50
+ /* CLASS */
51
+ ));
52
+ }
53
+ });
54
+ export {
55
+ P as default
56
+ };
@@ -1,11 +1,13 @@
1
- const e = {
2
- model: {
3
- type: Object
4
- },
1
+ const e = (r) => r, t = {
2
+ label: String,
3
+ prop: String,
5
4
  rules: {
6
- type: Object
5
+ // type: [Object, Array] as Arrayable<FormItemRule> // 优化前语法,即使类型不正确,也会被强行断言成正确的
6
+ type: e([Object, Array])
7
+ // 优化后语法 根据返回类型,确保正确性
7
8
  }
8
9
  };
9
10
  export {
10
- e as formType
11
+ e as definePropType,
12
+ t as formItemProps
11
13
  };
@@ -1,19 +1,21 @@
1
- import { createElementVNode as o, defineComponent as t, openBlock as r, createElementBlock as n, renderSlot as s } from "vue";
2
- import { formType as m } from "./form.mjs";
3
- const c = { class: "king-form" }, l = /* @__PURE__ */ o(
4
- "div",
5
- null,
6
- "伟大的好歌",
7
- -1
8
- /* HOISTED */
9
- ), d = /* @__PURE__ */ t({
1
+ import { defineComponent as t, computed as m, openBlock as n, createElementBlock as s, normalizeClass as a, renderSlot as c } from "vue";
2
+ import { useNamespace as l } from "../../../hooks/use-namespace/index.mjs";
3
+ const d = /* @__PURE__ */ t({
4
+ name: "KForm",
10
5
  __name: "form",
11
- props: m,
12
6
  setup(p) {
13
- return (e, _) => (r(), n("form", c, [
14
- l,
15
- s(e.$slots, "default")
16
- ]));
7
+ const { b: e } = l("form"), o = m(() => [e()]);
8
+ return (r, f) => (n(), s(
9
+ "form",
10
+ {
11
+ class: a(o.value)
12
+ },
13
+ [
14
+ c(r.$slots, "default")
15
+ ],
16
+ 2
17
+ /* CLASS */
18
+ ));
17
19
  }
18
20
  });
19
21
  export {
@@ -0,0 +1,13 @@
1
+ import { provide as o, inject as r } from "vue";
2
+ const e = Symbol("formItemContextKey");
3
+ function n(t) {
4
+ return o(e, t);
5
+ }
6
+ function i() {
7
+ return r(e);
8
+ }
9
+ export {
10
+ e as formItemContextKey,
11
+ i as useInjectFormItem,
12
+ n as useProvideFormItem
13
+ };
@@ -1,10 +1,14 @@
1
1
  import { withInstall as o } from "../utils/install.mjs";
2
2
  import "./component/form.vue.mjs";
3
- import { formType as e } from "./component/form.mjs";
4
- import r from "./component/form.vue2.mjs";
5
- const p = o(r);
3
+ import "./component/form-item.vue.mjs";
4
+ import { definePropType as _, formItemProps as l } from "./component/form.mjs";
5
+ import m from "./component/form.vue2.mjs";
6
+ import r from "./component/form-item.vue2.mjs";
7
+ const s = o(m), n = o(r);
6
8
  export {
7
- p as KForm,
8
- p as default,
9
- e as formType
9
+ s as KForm,
10
+ n as KFormItem,
11
+ s as default,
12
+ _ as definePropType,
13
+ l as formItemProps
10
14
  };
@@ -1,22 +1,25 @@
1
- import { KForm as e } from "./form/index.mjs";
2
- import { KCollapseTranstion as m } from "./collapse-transtion/index.mjs";
1
+ import { KForm as e, KFormItem as t } from "./form/index.mjs";
2
+ import { KCollapseTranstion as p } from "./collapse-transtion/index.mjs";
3
3
  import { KProModal as f } from "./pro-modal/index.mjs";
4
- import { KProTitle as K } from "./pro-title/index.mjs";
5
- import { KScrollBar as l } from "./scroll-bar/index.mjs";
6
- import { KScaleVirtualList as i } from "./scale-virtual-list/index.mjs";
7
- import { KProTag as n } from "./pro-tag/index.mjs";
4
+ import { KProTitle as a } from "./pro-title/index.mjs";
5
+ import { KScrollBar as P } from "./scroll-bar/index.mjs";
6
+ import { KScaleVirtualList as c } from "./scale-virtual-list/index.mjs";
7
+ import { KProTag as s } from "./pro-tag/index.mjs";
8
8
  import { KProPicker as T } from "./pro-picker/index.mjs";
9
- import { KProArea as d } from "./pro-area/index.mjs";
9
+ import { KProArea as u } from "./pro-area/index.mjs";
10
+ import { KProSignature as I } from "./pro-signature/index.mjs";
10
11
  import { KIcon as k } from "./icon/index.mjs";
11
12
  export {
12
- m as KCollapseTranstion,
13
+ p as KCollapseTranstion,
13
14
  e as KForm,
15
+ t as KFormItem,
14
16
  k as KIcon,
15
- d as KProArea,
17
+ u as KProArea,
16
18
  f as KProModal,
17
19
  T as KProPicker,
18
- n as KProTag,
19
- K as KProTitle,
20
- i as KScaleVirtualList,
21
- l as KScrollBar
20
+ I as KProSignature,
21
+ s as KProTag,
22
+ a as KProTitle,
23
+ c as KScaleVirtualList,
24
+ P as KScrollBar
22
25
  };
@@ -1,11 +1,12 @@
1
1
  import { withInstall as o } from "../utils/install.mjs";
2
- import r from "./src/Modal.mjs";
2
+ import "./src/ProModal.vue.mjs";
3
3
  import "./style/index.mjs";
4
- import { useProModal as i, useProModalInit as p } from "./hooks/useProModal.mjs";
5
- const m = o(r);
4
+ import { useProModal as e, useProModalInit as f } from "./hooks/useProModal.mjs";
5
+ import r from "./src/ProModal.vue2.mjs";
6
+ const l = o(r);
6
7
  export {
7
- m as KProModal,
8
- m as default,
9
- i as useProModal,
10
- p as useProModalInit
8
+ l as KProModal,
9
+ l as default,
10
+ e as useProModal,
11
+ f as useProModalInit
11
12
  };
@@ -0,0 +1,4 @@
1
+ import f from "./ProModal.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,82 @@
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({
7
+ name: "ProModal",
8
+ __name: "ProModal",
9
+ props: /* @__PURE__ */ M(F, {
10
+ modelValue: { required: !0, type: Boolean },
11
+ modelModifiers: {}
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
+ }
19
+ function T() {
20
+ d("onCancel");
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], () => {
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;
28
+ }
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);
34
+ });
35
+ const V = y(() => ({
36
+ transform: `translate(${s.value}px, ${m.value}px)`
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(
48
+ "div",
49
+ {
50
+ ref_key: "modalTitleRef",
51
+ ref: l,
52
+ class: "pro-modal-title"
53
+ },
54
+ N(o.title),
55
+ 513
56
+ /* TEXT, NEED_PATCH */
57
+ )
58
+ ]),
59
+ modalRender: c(({ originVNode: i }) => [
60
+ P(
61
+ "div",
62
+ {
63
+ style: q(V.value)
64
+ },
65
+ [
66
+ (b(), w(z(i)))
67
+ ],
68
+ 4
69
+ /* STYLE */
70
+ )
71
+ ]),
72
+ default: c(() => [
73
+ O(o.$slots, "default")
74
+ ]),
75
+ _: 3
76
+ /* FORWARDED */
77
+ }, 16, ["open", "wrap-class-name"]));
78
+ }
79
+ });
80
+ export {
81
+ L as default
82
+ };
@@ -5,6 +5,10 @@ const e = {
5
5
  modelValue: {
6
6
  type: Boolean,
7
7
  required: !0
8
+ },
9
+ title: {
10
+ type: String,
11
+ required: !0
8
12
  }
9
13
  };
10
14
  export {
@@ -0,0 +1,10 @@
1
+ import { withInstall as r } from "../utils/install.mjs";
2
+ import "./src/ProSignature.vue.mjs";
3
+ import { ProSignatureProps as f } from "./src/types.mjs";
4
+ import o from "./src/ProSignature.vue2.mjs";
5
+ const a = r(o);
6
+ export {
7
+ a as KProSignature,
8
+ f as ProSignatureProps,
9
+ a as default
10
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ProSignature.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,145 @@
1
+ import { defineComponent as A, ref as o, computed as k, watch as F, onMounted as N, onBeforeUnmount as $, reactive as H, openBlock as Q, createElementBlock as G, normalizeStyle as K, withModifiers as V } from "vue";
2
+ import { ProSignatureProps as Z } from "./types.mjs";
3
+ const te = /* @__PURE__ */ A({
4
+ __name: "ProSignature",
5
+ props: Z,
6
+ emits: ["update:bgColor"],
7
+ setup(R, { expose: X, emit: Y }) {
8
+ const u = R, b = Y, a = o(null), t = o(null), p = o(!1), C = o(""), h = o([]), f = o(0), d = o(0), w = o(!1), T = o(1), D = k(() => u.height / u.width), y = k(() => u.bgColor ? u.bgColor : "rgba(255, 255, 255, 0)");
9
+ function x() {
10
+ if (!a.value || !t.value)
11
+ return;
12
+ const e = window.devicePixelRatio || 1;
13
+ a.value.style.width = `${u.width}px`;
14
+ const l = Number.parseFloat(window.getComputedStyle(a.value).width);
15
+ a.value.style.height = `${D.value * l}px`, a.value.width = l * e, a.value.height = D.value * l * e, t.value.scale(e, e), T.value = l / u.width;
16
+ }
17
+ function P(e) {
18
+ t.value && (f.value = e.x, d.value = e.y, t.value.beginPath(), t.value.moveTo(f.value, d.value), t.value.lineTo(e.x, e.y), t.value.lineCap = "round", t.value.lineJoin = "round", t.value.lineWidth = u.lineWidth * T.value, t.value.stroke(), t.value.closePath(), h.value.push(e));
19
+ }
20
+ function M(e) {
21
+ t.value && (t.value.beginPath(), t.value.moveTo(f.value, d.value), t.value.lineTo(e.x, e.y), t.value.strokeStyle = u.lineColor, t.value.lineWidth = u.lineWidth * T.value, t.value.lineCap = "round", t.value.lineJoin = "round", t.value.stroke(), t.value.closePath(), d.value = e.y, f.value = e.x, h.value.push(e));
22
+ }
23
+ function S(e) {
24
+ t.value && (t.value.beginPath(), t.value.moveTo(f.value, d.value), t.value.lineTo(e.x, e.y), t.value.lineCap = "round", t.value.lineJoin = "round", t.value.stroke(), t.value.closePath(), h.value.push(e), h.value.push({ x: -1, y: -1 }));
25
+ }
26
+ function B(e) {
27
+ e.preventDefault(), w.value = !0, p.value = !0, P({
28
+ x: e.offsetX,
29
+ y: e.offsetY
30
+ });
31
+ }
32
+ function I(e) {
33
+ e.preventDefault(), w.value && M({
34
+ x: e.offsetX,
35
+ y: e.offsetY
36
+ });
37
+ }
38
+ function E(e) {
39
+ e.preventDefault(), S({
40
+ x: e.offsetX,
41
+ y: e.offsetY
42
+ }), w.value = !1;
43
+ }
44
+ function _(e) {
45
+ if (p.value = !0, e.touches.length === 1 && a.value) {
46
+ const l = a.value.getBoundingClientRect();
47
+ P({
48
+ x: e.targetTouches[0].clientX - l.left,
49
+ y: e.targetTouches[0].clientY - l.top
50
+ });
51
+ }
52
+ }
53
+ function L(e) {
54
+ if (e.preventDefault(), e.touches.length === 1 && a.value) {
55
+ const l = a.value.getBoundingClientRect();
56
+ M({
57
+ x: e.targetTouches[0].clientX - l.left,
58
+ y: e.targetTouches[0].clientY - l.top
59
+ });
60
+ }
61
+ }
62
+ function W(e) {
63
+ if (e.preventDefault(), e.touches.length === 1 && a.value) {
64
+ const l = a.value.getBoundingClientRect();
65
+ S({
66
+ x: e.targetTouches[0].clientX - l.left,
67
+ y: e.targetTouches[0].clientY - l.top
68
+ });
69
+ }
70
+ }
71
+ function z(e) {
72
+ if (!a.value)
73
+ return [0, 0, 0, 0];
74
+ let l = a.value.width, g = 0, r = a.value.height, s = 0;
75
+ for (let i = 0; i < a.value.width; i++)
76
+ for (let v = 0; v < a.value.height; v++) {
77
+ const n = (i + a.value.width * v) * 4;
78
+ (e[n] > 0 || e[n + 1] > 0 || e[n + 2] || e[n + 3] > 0) && (s = Math.max(v, s), g = Math.max(i, g), r = Math.min(v, r), l = Math.min(i, l));
79
+ }
80
+ return [l + 1, r + 1, g + 1, s + 1];
81
+ }
82
+ function U(e) {
83
+ return new Promise((l, g) => {
84
+ if (!p.value || !a.value || !t.value) {
85
+ g("Warning: Not Signned!");
86
+ return;
87
+ }
88
+ const r = (e == null ? void 0 : e.format) || u.format, s = (e == null ? void 0 : e.quality) || u.quality, i = t.value.getImageData(0, 0, a.value.width, a.value.height);
89
+ t.value.globalCompositeOperation = "destination-over", t.value.fillStyle = y.value, t.value.fillRect(0, 0, a.value.width, a.value.height), C.value = a.value.toDataURL(r, s);
90
+ let v = C.value;
91
+ if (t.value.clearRect(0, 0, a.value.width, a.value.height), t.value.putImageData(i, 0, 0), t.value.globalCompositeOperation = "source-over", u.isCrop) {
92
+ const n = z(i.data), c = document.createElement("canvas"), m = c.getContext("2d");
93
+ if (m) {
94
+ c.width = n[2] - n[0], c.height = n[3] - n[1];
95
+ const q = t.value.getImageData(n[0], n[1], n[2] - n[0], n[3] - n[1]);
96
+ m.globalCompositeOperation = "destination-over", m.putImageData(q, 0, 0), m.fillStyle = y.value, m.fillRect(0, 0, c.width, c.height), v = c.toDataURL(r, s);
97
+ }
98
+ }
99
+ l(v);
100
+ });
101
+ }
102
+ function J() {
103
+ !a.value || !t.value || (t.value.clearRect(0, 0, a.value.width, a.value.height), u.isClearBgColor && (b("update:bgColor", ""), a.value.style.background = "rgba(255, 255, 255, 0)"), h.value = [], p.value = !1, C.value = "");
104
+ }
105
+ F(
106
+ () => [u.width, u.height],
107
+ ([e, l]) => {
108
+ !a.value || !t.value || (a.value.width = e, a.value.height = l, a.value.style.background = y.value, x());
109
+ }
110
+ ), N(() => {
111
+ a.value && (a.value.height = u.height, a.value.width = u.width, a.value.style.background = y.value, t.value = a.value.getContext("2d"), x(), window.addEventListener("resize", x), document.addEventListener("mouseup", () => {
112
+ w.value = !1;
113
+ }));
114
+ }), $(() => {
115
+ window.removeEventListener("resize", x);
116
+ });
117
+ const O = H({
118
+ width: "100%",
119
+ height: "100%"
120
+ });
121
+ return X({
122
+ generate: U,
123
+ reset: J
124
+ }), (e, l) => (Q(), G(
125
+ "canvas",
126
+ {
127
+ ref_key: "canvas",
128
+ ref: a,
129
+ style: K(O),
130
+ onMousedown: B,
131
+ onMousemove: I,
132
+ onMouseup: E,
133
+ onTouchstartPassive: _,
134
+ onTouchmovePassive: L,
135
+ onTouchend: V(W, ["prevent"])
136
+ },
137
+ null,
138
+ 36
139
+ /* STYLE, NEED_HYDRATION */
140
+ ));
141
+ }
142
+ });
143
+ export {
144
+ te as default
145
+ };
@@ -0,0 +1,40 @@
1
+ import { definePropType as e } from "../../utils/install.mjs";
2
+ const r = {
3
+ width: {
4
+ type: e(Number),
5
+ default: 800
6
+ },
7
+ height: {
8
+ type: Number,
9
+ default: 300
10
+ },
11
+ lineWidth: {
12
+ type: Number,
13
+ default: 4
14
+ },
15
+ bgColor: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ lineColor: {
20
+ type: String,
21
+ default: "#000000"
22
+ },
23
+ isCrop: {
24
+ type: Boolean
25
+ },
26
+ isClearBgColor: {
27
+ type: Boolean
28
+ },
29
+ format: {
30
+ type: String,
31
+ default: "image/png"
32
+ },
33
+ quality: {
34
+ type: Number,
35
+ default: 1
36
+ }
37
+ };
38
+ export {
39
+ r as ProSignatureProps
40
+ };
@@ -1,7 +1,8 @@
1
- import { defineComponent as P, toRefs as g, openBlock as r, createElementBlock as l, mergeProps as i, unref as e, createElementVNode as n, normalizeClass as c, Fragment as w, renderList as B, renderSlot as E } from "vue";
1
+ import { defineComponent as h, ref as B, computed as E, toRefs as P, openBlock as a, createElementBlock as l, mergeProps as i, unref as e, createElementVNode as p, normalizeClass as c, normalizeStyle as R, Fragment as S, renderList as z, renderSlot as L } from "vue";
2
2
  import { defaultNamespace as s } from "../../../hooks/use-namespace/index.mjs";
3
- import { useVirtualList as L } from "../hooks/useVirtualList.mjs";
4
- const z = /* @__PURE__ */ P({
3
+ import { useElementBounding as T } from "@vueuse/core";
4
+ import { useVirtualList as V } from "../hooks/useVirtualList.mjs";
5
+ const q = /* @__PURE__ */ h({
5
6
  __name: "scale-virtual-list",
6
7
  props: {
7
8
  list: {},
@@ -9,43 +10,48 @@ const z = /* @__PURE__ */ P({
9
10
  itemClassName: { default: `${s}-scale-virtual-item` }
10
11
  },
11
12
  emits: ["update:state"],
12
- setup(p, { expose: m, emit: u }) {
13
- const o = p, d = u, { list: f } = g(o), { list: v, containerProps: $, wrapperProps: x, scrollTo: C, scaleTo: N, state: _, onUpdate: k } = L(f, o.option);
14
- return m({
15
- scrollTo: C,
16
- scaleTo: N,
17
- state: _
18
- }), k((t) => d("update:state", t)), (t, T) => (r(), l(
13
+ setup(m, { expose: u, emit: d }) {
14
+ const o = m, f = d, n = B(null), { width: v } = T(n), w = E(() => ({
15
+ width: `${v.value}px`
16
+ })), { list: $ } = P(o), { list: x, containerProps: y, wrapperProps: _, scrollTo: k, scaleTo: C, state: N, onUpdate: g } = V($, o.option);
17
+ return u({
18
+ scrollTo: k,
19
+ scaleTo: C,
20
+ state: N
21
+ }), g((t) => f("update:state", t)), (t, F) => (a(), l(
19
22
  "div",
20
23
  i({
21
24
  class: `${e(s)}-scale-virtual-list`
22
- }, e($)),
25
+ }, e(y)),
23
26
  [
24
- n(
27
+ p(
25
28
  "div",
26
29
  {
27
- class: c(`${e(s)}-scale-virtual-list-container`)
30
+ class: c(`${e(s)}-scale-virtual-list-container`),
31
+ style: R(w.value)
28
32
  },
29
33
  [
30
- n(
34
+ p(
31
35
  "div",
32
- i({
36
+ i(e(_), {
37
+ ref_key: "wrapperRef",
38
+ ref: n,
33
39
  class: `${e(s)}-scale-vittual-wrapper`
34
- }, e(x)),
40
+ }),
35
41
  [
36
- (r(!0), l(
37
- w,
42
+ (a(!0), l(
43
+ S,
38
44
  null,
39
- B(e(v), (a) => (r(), l(
45
+ z(e(x), (r) => (a(), l(
40
46
  "div",
41
47
  {
42
- key: a.index,
48
+ key: r.index,
43
49
  class: c(t.itemClassName)
44
50
  },
45
51
  [
46
- E(t.$slots, "default", {
47
- item: a,
48
- index: a.index
52
+ L(t.$slots, "default", {
53
+ item: r,
54
+ index: r.index
49
55
  })
50
56
  ],
51
57
  2
@@ -59,8 +65,8 @@ const z = /* @__PURE__ */ P({
59
65
  /* FULL_PROPS */
60
66
  )
61
67
  ],
62
- 2
63
- /* CLASS */
68
+ 6
69
+ /* CLASS, STYLE */
64
70
  )
65
71
  ],
66
72
  16
@@ -69,5 +75,5 @@ const z = /* @__PURE__ */ P({
69
75
  }
70
76
  });
71
77
  export {
72
- z as default
78
+ q as default
73
79
  };