@das-fed/utils 6.3.0-beta.0 → 6.3.0-beta.10

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 (168) hide show
  1. package/__VLS_types.d.ts +124 -0
  2. package/api-services/modules/{file.d.ts → file/index.d.ts} +4 -4
  3. package/api-services/modules/{file.js → file/index.js} +18 -36
  4. package/api-services/modules/file/index.js.gz +0 -0
  5. package/api-services/modules/index.js.gz +0 -0
  6. package/atob/index.d.ts +2 -2
  7. package/common-info/{getIframeUrl.js → getIframeUrl/index.js} +1 -2
  8. package/common-info/getInfoFromUrl/index.js +84 -0
  9. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  10. package/common-info/index.d.ts +1 -1
  11. package/common-info/index.js +2 -4
  12. package/common-info/index.js.gz +0 -0
  13. package/common-info/{set-personal-info.d.ts → set-personal-info/index.d.ts} +1 -1
  14. package/common-info/{set-personal-info.js → set-personal-info/index.js} +10 -24
  15. package/common-info/set-personal-info/index.js.gz +0 -0
  16. package/common-info/type.d.ts +104 -0
  17. package/common-tools/{arr-tools.d.ts → arr-tools/index.d.ts} +1 -1
  18. package/common-tools/{date-format.js → date-format/index.js} +1 -2
  19. package/common-tools/{get-url-params.d.ts → get-url-params/index.d.ts} +1 -1
  20. package/common-tools/{get-url-params.js → get-url-params/index.js} +2 -4
  21. package/common-tools/get-url-params/index.js.gz +0 -0
  22. package/common-tools/{nest-tree-format.d.ts → nest-tree-format/index.d.ts} +1 -1
  23. package/common-tools/{nest-tree-format.js → nest-tree-format/index.js} +2 -4
  24. package/common-tools/obj-tools/index.js +14 -0
  25. package/common-tools/{platform-tools.js → platform-tools/index.js} +1 -2
  26. package/common-tools/{queue-promise.d.ts → queue-promise/index.d.ts} +1 -1
  27. package/common-tools/setHtmlMinWH/index.d.ts +5 -0
  28. package/common-tools/update-fav-icon/index.d.ts +11 -0
  29. package/common-tools/update-fav-icon/index.js +21 -0
  30. package/create-api-service/index.js +255 -295
  31. package/create-api-service/index.js.gz +0 -0
  32. package/create-api-service/{sso.d.ts → sso/index.d.ts} +5 -5
  33. package/create-api-service/{sso.js → sso/index.js} +421 -444
  34. package/create-api-service/sso/index.js.gz +0 -0
  35. package/curring-http/index.js +1626 -4809
  36. package/curring-http/index.js.gz +0 -0
  37. package/curring-http/type.d.ts +89 -0
  38. package/directive/{auth.js → auth/index.js} +2 -4
  39. package/directive/auth/index.js.gz +0 -0
  40. package/dom-check-in/index.js +5 -5
  41. package/dom-watcher/index.d.ts +1 -1
  42. package/esm-map.json +8 -0
  43. package/hooks/use-get-auth/index.d.ts +3 -3
  44. package/hooks/use-get-auth/index.js +4 -8
  45. package/hooks/use-get-auth/index.js.gz +0 -0
  46. package/load-js/index.d.ts +1 -1
  47. package/load-js/index.js +1 -2
  48. package/nextTiken/index.js +5 -10
  49. package/nextTiken/index.js.gz +0 -0
  50. package/oss/index.d.ts +1 -1
  51. package/oss/index.js +1 -2
  52. package/package.json +10 -3
  53. package/pinyin-first-character/index.js +45 -50
  54. package/pinyin-first-character/index.js.gz +0 -0
  55. package/style/index.js +5 -9
  56. package/style/index.js.gz +0 -0
  57. package/style/style.d.ts +3 -3
  58. package/token-tools/index.d.ts +1 -1
  59. package/token-tools/index.js.gz +0 -0
  60. package/use-low-code/index.js +1 -2
  61. package/use-low-code/index.js.gz +0 -0
  62. package/vue/hooks/{use-model-value.d.ts → use-model-value/index.d.ts} +2 -0
  63. package/webSocket-service/index.js +41 -52
  64. package/webSocket-service/index.js.gz +0 -0
  65. package/webSocket-service/type.d.ts +28 -0
  66. package/with-install/index.d.ts +1 -1
  67. package/common-info/getInfoFromUrl.js +0 -85
  68. package/common-tools/obj-tools.js +0 -20
  69. package/common-tools/setHtmlMinWH.d.ts +0 -5
  70. package/common-tools/update-fav-icon.d.ts +0 -10
  71. package/common-tools/update-fav-icon.js +0 -22
  72. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +0 -29
  73. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +0 -19925
  74. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +0 -54
  75. package/dimple-canvas/use-dimple-canvas/core/konva/index.js +0 -119
  76. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +0 -101
  77. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +0 -17
  78. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +0 -8
  79. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +0 -55
  80. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +0 -5
  81. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +0 -14
  82. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +0 -5
  83. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +0 -5
  84. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +0 -5
  85. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +0 -181
  86. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +0 -4
  87. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +0 -7402
  88. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +0 -6
  89. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +0 -13
  90. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +0 -4
  91. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +0 -7
  92. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +0 -8
  93. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +0 -193
  94. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +0 -11
  95. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +0 -20
  96. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +0 -5
  97. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +0 -52
  98. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +0 -2
  99. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +0 -14
  100. package/dimple-canvas/use-dimple-canvas/index.d.ts +0 -9
  101. package/dimple-canvas/use-dimple-canvas/index.js +0 -10
  102. package/hooks/use-get-auth/apis.js +0 -8
  103. package/style/math.js +0 -17
  104. package/style/style.js +0 -61
  105. /package/api-services/modules/{app-manage.d.ts → app-manage/index.d.ts} +0 -0
  106. /package/api-services/modules/{app-manage.js → app-manage/index.js} +0 -0
  107. /package/api-services/modules/{authentication.d.ts → authentication/index.d.ts} +0 -0
  108. /package/api-services/modules/{authentication.js → authentication/index.js} +0 -0
  109. /package/api-services/modules/{bems.d.ts → bems/index.d.ts} +0 -0
  110. /package/api-services/modules/{bems.js → bems/index.js} +0 -0
  111. /package/api-services/modules/{contract.d.ts → contract/index.d.ts} +0 -0
  112. /package/api-services/modules/{contract.js → contract/index.js} +0 -0
  113. /package/api-services/modules/{duty-manage.d.ts → duty-manage/index.d.ts} +0 -0
  114. /package/api-services/modules/{duty-manage.js → duty-manage/index.js} +0 -0
  115. /package/api-services/modules/{enterpriseright.d.ts → enterpriseright/index.d.ts} +0 -0
  116. /package/api-services/modules/{enterpriseright.js → enterpriseright/index.js} +0 -0
  117. /package/api-services/modules/{gateway-edge.d.ts → gateway-edge/index.d.ts} +0 -0
  118. /package/api-services/modules/{gateway-edge.js → gateway-edge/index.js} +0 -0
  119. /package/api-services/modules/{iot.d.ts → iot/index.d.ts} +0 -0
  120. /package/api-services/modules/{iot.js → iot/index.js} +0 -0
  121. /package/api-services/modules/{justauth.d.ts → justauth/index.d.ts} +0 -0
  122. /package/api-services/modules/{justauth.js → justauth/index.js} +0 -0
  123. /package/api-services/modules/{knowledge.d.ts → knowledge/index.d.ts} +0 -0
  124. /package/api-services/modules/{knowledge.js → knowledge/index.js} +0 -0
  125. /package/api-services/modules/{link.d.ts → link/index.d.ts} +0 -0
  126. /package/api-services/modules/{link.js → link/index.js} +0 -0
  127. /package/api-services/modules/{permission.d.ts → permission/index.d.ts} +0 -0
  128. /package/api-services/modules/{permission.js → permission/index.js} +0 -0
  129. /package/api-services/modules/{platformManage.d.ts → platformManage/index.d.ts} +0 -0
  130. /package/api-services/modules/{platformManage.js → platformManage/index.js} +0 -0
  131. /package/api-services/modules/{portal.d.ts → portal/index.d.ts} +0 -0
  132. /package/api-services/modules/{portal.js → portal/index.js} +0 -0
  133. /package/api-services/modules/{space-manage.d.ts → space-manage/index.d.ts} +0 -0
  134. /package/api-services/modules/{space-manage.js → space-manage/index.js} +0 -0
  135. /package/api-services/modules/{super-admin.d.ts → super-admin/index.d.ts} +0 -0
  136. /package/api-services/modules/{super-admin.js → super-admin/index.js} +0 -0
  137. /package/api-services/modules/{supplier.d.ts → supplier/index.d.ts} +0 -0
  138. /package/api-services/modules/{supplier.js → supplier/index.js} +0 -0
  139. /package/api-services/modules/{supplychain-manage.d.ts → supplychain-manage/index.d.ts} +0 -0
  140. /package/api-services/modules/{supplychain-manage.js → supplychain-manage/index.js} +0 -0
  141. /package/api-services/modules/{systemConfiguration.d.ts → systemConfiguration/index.d.ts} +0 -0
  142. /package/api-services/modules/{systemConfiguration.js → systemConfiguration/index.js} +0 -0
  143. /package/api-services/modules/{tool.d.ts → tool/index.d.ts} +0 -0
  144. /package/api-services/modules/{tool.js → tool/index.js} +0 -0
  145. /package/api-services/src/{create-service.d.ts → create-service/index.d.ts} +0 -0
  146. /package/api-services/src/{create-service.js → create-service/index.js} +0 -0
  147. /package/common-info/{getIframeUrl.d.ts → getIframeUrl/index.d.ts} +0 -0
  148. /package/common-info/{getInfoFromUrl.d.ts → getInfoFromUrl/index.d.ts} +0 -0
  149. /package/common-tools/{arr-tools.js → arr-tools/index.js} +0 -0
  150. /package/common-tools/{date-format.d.ts → date-format/index.d.ts} +0 -0
  151. /package/common-tools/{handle-data.d.ts → handle-data/index.d.ts} +0 -0
  152. /package/common-tools/{handle-data.js → handle-data/index.js} +0 -0
  153. /package/common-tools/{obj-tools.d.ts → obj-tools/index.d.ts} +0 -0
  154. /package/common-tools/{platform-tools.d.ts → platform-tools/index.d.ts} +0 -0
  155. /package/common-tools/{queue-promise.js → queue-promise/index.js} +0 -0
  156. /package/common-tools/{setHtmlMinWH.js → setHtmlMinWH/index.js} +0 -0
  157. /package/create-api-service/{proxy-sso.d.ts → proxy-sso/index.d.ts} +0 -0
  158. /package/create-api-service/{proxy-sso.js → proxy-sso/index.js} +0 -0
  159. /package/directive/{auth.d.ts → auth/index.d.ts} +0 -0
  160. /package/directive/{clickOutside.d.ts → clickOutside/index.d.ts} +0 -0
  161. /package/directive/{clickOutside.js → clickOutside/index.js} +0 -0
  162. /package/directive/{hoverInside.d.ts → hoverInside/index.d.ts} +0 -0
  163. /package/directive/{hoverInside.js → hoverInside/index.js} +0 -0
  164. /package/directive/{utils.d.ts → utils/index.d.ts} +0 -0
  165. /package/directive/{utils.js → utils/index.js} +0 -0
  166. /package/hooks/popup-manager/{use-zindex.d.ts → use-zindex/index.d.ts} +0 -0
  167. /package/hooks/popup-manager/{use-zindex.js → use-zindex/index.js} +0 -0
  168. /package/vue/hooks/{use-model-value.js → use-model-value/index.js} +0 -0
@@ -1,54 +0,0 @@
1
- import { Konva } from '@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib';
2
- import { ObjectType, ObjectConfig } from '../type';
3
-
4
- declare const useKonva: () => {
5
- canvasContainerEl: any;
6
- canvas: any;
7
- layer: any;
8
- onCanvasMounted: (cb: Function) => number;
9
- createCanvas: (container?: HTMLDivElement | null) => void;
10
- addObject: (type: ObjectType, config?: ObjectConfig) => any;
11
- findOne: (key: string) => any;
12
- findObject: (type: ObjectType) => any;
13
- removeObject: (key: string) => void;
14
- addEventListener: (eventName: EventName, cb: (e: {
15
- currentTarget: any;
16
- evt: Event;
17
- pointerId: any;
18
- target: any;
19
- type: string;
20
- data: {
21
- setHoverImage?: (src?: string) => void;
22
- setActiveImage?: (src?: string) => void;
23
- setDisabledImage?: (src?: string) => void;
24
- [key: string]: any;
25
- };
26
- }) => void) => void;
27
- changeImageSrc: (imageKey: string, payload: string | {
28
- src?: string;
29
- hoverSrc?: string;
30
- activeSrc?: string;
31
- disabledSrc?: string;
32
- }) => void;
33
- zoom: (type?: 'in' | 'out', radio?: number) => void;
34
- toJSON: (config?: any) => any;
35
- loadJSON: (json?: any, config?: any) => void;
36
- remove: () => void;
37
- transformAxis: (coordinate: {
38
- x: number;
39
- y: number;
40
- [key: string]: any;
41
- }) => any;
42
- setDisabled: () => void;
43
- showRule: (options?: {
44
- /** 刻度间隔 */
45
- precision?: number;
46
- /** 刻度文字颜色 */
47
- textColor?: string;
48
- /** 刻度线颜色 */
49
- lineColor?: string;
50
- }) => any;
51
- removeRule: () => void;
52
- tr: any;
53
- };
54
- export { useKonva, Konva };
@@ -1,119 +0,0 @@
1
- import { ref as p, shallowRef as m, watch as j } from "vue";
2
- import { createCanvas as G } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas";
3
- import { addObject as M } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object";
4
- import { findOne as S, findObject as U } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/find";
5
- import { removeObject as W } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object";
6
- import { initTransformer as X, removeTransformer as w } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer";
7
- import { initGuideline as $ } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline";
8
- import { loadJSON as q } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json";
9
- import { transformAxis as P } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis";
10
- import { initRule as Q } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/rule";
11
- import { addEventListener as Y } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener";
12
- import { Konva as H } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
13
- import { Konva as me } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
14
- const ie = () => {
15
- const n = p(null), r = m(), c = m(), i = m(), g = m();
16
- let b = [];
17
- const k = (e) => b.push(e), f = p(!1), d = (e) => {
18
- n.value || (n.value = e);
19
- const o = G(e);
20
- r.value = o.canvas, c.value = o.layer, h(), f.value = !0;
21
- }, h = () => {
22
- var e;
23
- g.value = X(r.value, c.value), $(r.value, c.value), b.map((o) => o()), (e = r.value) == null || e.on("mouseleave", () => {
24
- w();
25
- });
26
- }, y = (e, o) => M(e, {
27
- canvas: r.value,
28
- layer: c.value,
29
- config: o
30
- }), F = (e) => {
31
- W(r.value, e), w();
32
- }, x = (e) => S(r.value, `${e}`), C = (e) => U(r.value, e), L = (e, o) => {
33
- Y(r, e, o);
34
- }, R = (e, o) => {
35
- const t = S(r.value, e);
36
- if (!t || !t.image)
37
- return;
38
- let a = {};
39
- typeof o == "string" ? a = { src: o } : a = o;
40
- const { src: s, hoverSrc: l, activeSrc: u, disabledSrc: O } = a;
41
- if (s) {
42
- t.attrs.src = s;
43
- const v = new Image();
44
- v.src = s;
45
- const B = t.width(), z = t.height();
46
- v.onload = () => {
47
- t.image(v), t.width(B), t.height(z);
48
- }, t.attrs.setDefaultImage = () => t.image(v);
49
- }
50
- l && (t.attrs.hoverSrc = l), u && (t.attrs.activeSrc = u), O && (t.attrs.disabledSrc = O);
51
- }, J = (e, o) => {
52
- var s, l;
53
- const t = ((s = r.value) == null ? void 0 : s.scaleX()) || 1;
54
- o === void 0 && (o = 0.1);
55
- let a = 1;
56
- e === "in" && (a = t - o), e === "out" && (a = t + o), (l = r.value) == null || l.scale({ x: a, y: a });
57
- }, N = () => {
58
- var o;
59
- const e = (o = n.value) == null ? void 0 : o.children[0];
60
- e == null || e.remove(), d(n.value);
61
- }, T = (e) => {
62
- var t;
63
- return r.value ? (t = r.value) == null ? void 0 : t.toJSON() : {};
64
- }, I = (e, o) => {
65
- const t = () => {
66
- if (!n.value)
67
- return;
68
- const a = q(n.value, e);
69
- r.value = a.canvas, c.value = a.layer, i.value = a.ruleLayer, h();
70
- };
71
- if (f.value)
72
- return t();
73
- j(
74
- () => f.value,
75
- () => t()
76
- );
77
- }, A = (e) => n.value ? P(n.value, r.value, e) : { x: 0, y: 0 }, D = () => {
78
- var s, l, u;
79
- const { width: e = 0, height: o = 0 } = ((s = n.value) == null ? void 0 : s.getBoundingClientRect()) || {}, t = new H.Layer({ width: e, height: o }), a = new H.Rect({ width: e, height: o, fill: "rgba(0,0,0,0)", draggable: !1, name: "disabled" });
80
- t.name("disabled"), (l = r.value) == null || l.add(t), console.log(t), t.add(a), t.moveToTop(), (u = r.value) == null || u.setDraggable(!1);
81
- }, E = (e) => {
82
- var o;
83
- return i.value = Q(r.value, e), i.value.moveToBottom(), (o = r.value) == null || o.add(i.value), i;
84
- }, K = () => {
85
- var e;
86
- (e = i.value) == null || e.remove();
87
- };
88
- return j(
89
- () => n.value,
90
- (e, o) => {
91
- e && o === null && d(e);
92
- }
93
- ), {
94
- canvasContainerEl: n,
95
- canvas: r,
96
- layer: c,
97
- onCanvasMounted: k,
98
- createCanvas: d,
99
- addObject: y,
100
- findOne: x,
101
- findObject: C,
102
- removeObject: F,
103
- addEventListener: L,
104
- changeImageSrc: R,
105
- zoom: J,
106
- toJSON: T,
107
- loadJSON: I,
108
- remove: N,
109
- transformAxis: A,
110
- setDisabled: D,
111
- showRule: E,
112
- removeRule: K,
113
- tr: g
114
- };
115
- };
116
- export {
117
- me as Konva,
118
- ie as useKonva
119
- };
@@ -1,101 +0,0 @@
1
- interface GlobalEventHandlersEventMap {
2
- abort: UIEvent;
3
- animationcancel: AnimationEvent;
4
- animationend: AnimationEvent;
5
- animationiteration: AnimationEvent;
6
- animationstart: AnimationEvent;
7
- auxclick: MouseEvent;
8
- beforeinput: InputEvent;
9
- blur: FocusEvent;
10
- cancel: Event;
11
- canplay: Event;
12
- canplaythrough: Event;
13
- change: Event;
14
- click: MouseEvent;
15
- close: Event;
16
- compositionend: CompositionEvent;
17
- compositionstart: CompositionEvent;
18
- compositionupdate: CompositionEvent;
19
- contextmenu: MouseEvent;
20
- cuechange: Event;
21
- dblclick: MouseEvent;
22
- drag: DragEvent;
23
- dragend: DragEvent;
24
- dragenter: DragEvent;
25
- dragleave: DragEvent;
26
- dragover: DragEvent;
27
- dragstart: DragEvent;
28
- drop: DragEvent;
29
- durationchange: Event;
30
- emptied: Event;
31
- ended: Event;
32
- error: ErrorEvent;
33
- focus: FocusEvent;
34
- focusin: FocusEvent;
35
- focusout: FocusEvent;
36
- formdata: FormDataEvent;
37
- gotpointercapture: PointerEvent;
38
- input: Event;
39
- invalid: Event;
40
- keydown: KeyboardEvent;
41
- keypress: KeyboardEvent;
42
- keyup: KeyboardEvent;
43
- load: Event;
44
- loadeddata: Event;
45
- loadedmetadata: Event;
46
- loadstart: Event;
47
- lostpointercapture: PointerEvent;
48
- mousedown: MouseEvent;
49
- mouseenter: MouseEvent;
50
- mouseleave: MouseEvent;
51
- mousemove: MouseEvent;
52
- mouseout: MouseEvent;
53
- mouseover: MouseEvent;
54
- mouseup: MouseEvent;
55
- pause: Event;
56
- play: Event;
57
- playing: Event;
58
- pointercancel: PointerEvent;
59
- pointerdown: PointerEvent;
60
- pointerenter: PointerEvent;
61
- pointerleave: PointerEvent;
62
- pointermove: PointerEvent;
63
- pointerout: PointerEvent;
64
- pointerover: PointerEvent;
65
- pointerup: PointerEvent;
66
- progress: ProgressEvent;
67
- ratechange: Event;
68
- reset: Event;
69
- resize: UIEvent;
70
- scroll: Event;
71
- securitypolicyviolation: SecurityPolicyViolationEvent;
72
- seeked: Event;
73
- seeking: Event;
74
- select: Event;
75
- selectionchange: Event;
76
- selectstart: Event;
77
- slotchange: Event;
78
- stalled: Event;
79
- submit: SubmitEvent;
80
- suspend: Event;
81
- timeupdate: Event;
82
- toggle: Event;
83
- touchcancel: TouchEvent;
84
- touchend: TouchEvent;
85
- touchmove: TouchEvent;
86
- touchstart: TouchEvent;
87
- transitioncancel: TransitionEvent;
88
- transitionend: TransitionEvent;
89
- transitionrun: TransitionEvent;
90
- transitionstart: TransitionEvent;
91
- volumechange: Event;
92
- waiting: Event;
93
- webkitanimationend: Event;
94
- webkitanimationiteration: Event;
95
- webkitanimationstart: Event;
96
- webkittransitionend: Event;
97
- wheel: WheelEvent;
98
- }
99
- export type EventName = keyof GlobalEventHandlersEventMap;
100
- declare const addEventListener: (canvas: Ref<any>, eventName: EventName, cb: any) => void;
101
- export { addEventListener };
@@ -1,17 +0,0 @@
1
- import { watch as d } from "vue";
2
- const p = (t, r, e) => {
3
- var o;
4
- t.value && ((o = t.value) == null || o.on(r, e)), t.value || d(
5
- () => t.value,
6
- (a, l) => {
7
- var u;
8
- l || (u = t.value) == null || u.on(r, (i) => {
9
- const f = i.target.attrs;
10
- e({ ...i, data: f });
11
- });
12
- }
13
- );
14
- };
15
- export {
16
- p as addEventListener
17
- };
@@ -1,8 +0,0 @@
1
- import { Canvas, Layer, ObjectConfig } from '@das-fed/utils/dimple-canvas/use-dimple-canvas/core/type';
2
-
3
- declare const addObject: (type: ObjectType, options: {
4
- canvas?: Canvas | null;
5
- layer?: Layer | null;
6
- config?: ObjectConfig;
7
- }) => Promise<any>;
8
- export { addObject };
@@ -1,55 +0,0 @@
1
- import { Konva as d } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
2
- const f = async (r, n) => {
3
- const { config: t = {}, canvas: s, layer: a } = n;
4
- if (!s || !a)
5
- return;
6
- let e = null;
7
- t.type = r, t.draggable = t.draggable ?? !0;
8
- const c = +/* @__PURE__ */ new Date();
9
- return t.id = t.id ?? c.toString(), r === "Rect" && (e = new d.Rect(t)), r === "Circle" && (e = new d.Circle(t)), r === "Image" && (e = await l(t)), r === "BackgroundImage" && I(s, t), e && a.add(e), e;
10
- }, l = (r) => {
11
- const { src: n = "" } = r || {};
12
- return new Promise((t, s) => {
13
- if (!n)
14
- return t(null);
15
- const a = new Image();
16
- a.src = r.src || "", a.onload = () => {
17
- const e = new d.Image({ image: a });
18
- r.setDefaultImage = () => e.image(a), e.setAttrs(r);
19
- const c = [
20
- { getter: "hoverSrc", setter: "setHoverImage" },
21
- { getter: "activeSrc", setter: "setActiveImage" },
22
- { getter: "disabledSrc", setter: "setDisabledImage" }
23
- ];
24
- for (const g of c)
25
- r[g.setter] = (u) => {
26
- const i = u || e.attrs[g.getter];
27
- if (!i)
28
- return;
29
- const o = new Image();
30
- o.src = i, o.onload = () => {
31
- var m;
32
- return (m = e.image) == null ? void 0 : m.call(e, o);
33
- };
34
- };
35
- e.setAttrs(r), t(e);
36
- };
37
- });
38
- }, I = (r, n) => {
39
- const { src: t = "", scaleWidth: s = 30 } = n || {};
40
- if (!t)
41
- return;
42
- const a = new d.Layer();
43
- return r.add(a), a.moveToBottom(), l({
44
- // listening: false,
45
- src: t,
46
- width: a.width() - s,
47
- height: a.height() - s,
48
- type: "BackgroundImage",
49
- ...n,
50
- draggable: !1
51
- }).then((e) => (e && a.add(e), e));
52
- };
53
- export {
54
- f as addObject
55
- };
@@ -1,5 +0,0 @@
1
- declare const createCanvas: (container?: HTMLDivElement | null, config?: any) => {
2
- canvas: any;
3
- layer: any;
4
- };
5
- export { createCanvas };
@@ -1,14 +0,0 @@
1
- import { Konva as n } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
2
- const r = (e, c) => {
3
- e || (e = document.createElement("div"), document.body.append(e));
4
- const { width: d, height: o } = e.getBoundingClientRect(), a = new n.Stage({
5
- container: e,
6
- width: d,
7
- height: o,
8
- draggable: !0
9
- }), t = new n.Layer();
10
- return t.name("base"), a.add(t), { canvas: a, layer: t };
11
- };
12
- export {
13
- r as createCanvas
14
- };
@@ -1,5 +0,0 @@
1
- import { Canvas } from '@das-fed/utils/dimple-canvas/use-dimple-canvas/core/type';
2
-
3
- declare const findOne: (canvas: Canvas | null | undefined, key: string) => any;
4
- declare const findObject: (canvas: Canvas | null | undefined, type: ObjectType) => any;
5
- export { findOne, findObject };
@@ -1,5 +0,0 @@
1
- const r = (e, t) => e == null ? void 0 : e.findOne(`${t}`), d = (e, t) => e == null ? void 0 : e.find(t);
2
- export {
3
- d as findObject,
4
- r as findOne
5
- };
@@ -1,5 +0,0 @@
1
- import { Canvas, Layer } from '@das-fed/utils/dimple-canvas/use-dimple-canvas/core/type';
2
-
3
- declare const initGuideline: (canvas?: Canvas | null, layer?: Layer | null) => void;
4
- declare const removeGuideline: (layer?: Layer | null) => void;
5
- export { initGuideline, removeGuideline };
@@ -1,181 +0,0 @@
1
- import { Konva as p } from "@das-fed/utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
2
- const w = (r, s) => {
3
- if (!r || !s)
4
- return;
5
- var c = 5;
6
- function b(o) {
7
- var t = [0, r.width() / 2, r.width()], n = [0, r.height() / 2, r.height()];
8
- return r.find(".object").forEach((f) => {
9
- if (f !== o) {
10
- var i = f.getClientRect();
11
- t.push([i.x, i.x + i.width, i.x + i.width / 2]), n.push([i.y, i.y + i.height, i.y + i.height / 2]);
12
- }
13
- }), {
14
- vertical: t.flat(),
15
- horizontal: n.flat()
16
- };
17
- }
18
- function v(o) {
19
- var t = o.getClientRect(), n = o.absolutePosition();
20
- return {
21
- vertical: [
22
- {
23
- guide: Math.round(t.x),
24
- offset: Math.round(n.x - t.x),
25
- snap: "start"
26
- },
27
- {
28
- guide: Math.round(t.x + t.width / 2),
29
- offset: Math.round(n.x - t.x - t.width / 2),
30
- snap: "center"
31
- },
32
- {
33
- guide: Math.round(t.x + t.width),
34
- offset: Math.round(n.x - t.x - t.width),
35
- snap: "end"
36
- }
37
- ],
38
- horizontal: [
39
- {
40
- guide: Math.round(t.y),
41
- offset: Math.round(n.y - t.y),
42
- snap: "start"
43
- },
44
- {
45
- guide: Math.round(t.y + t.height / 2),
46
- offset: Math.round(n.y - t.y - t.height / 2),
47
- snap: "center"
48
- },
49
- {
50
- guide: Math.round(t.y + t.height),
51
- offset: Math.round(n.y - t.y - t.height),
52
- snap: "end"
53
- }
54
- ]
55
- };
56
- }
57
- function g(o, t) {
58
- var n = [], f = [];
59
- o.vertical.forEach((d) => {
60
- t.vertical.forEach((a) => {
61
- var h = Math.abs(d - a.guide);
62
- h < c && n.push({
63
- lineGuide: d,
64
- diff: h,
65
- snap: a.snap,
66
- offset: a.offset
67
- });
68
- });
69
- }), o.horizontal.forEach((d) => {
70
- t.horizontal.forEach((a) => {
71
- var h = Math.abs(d - a.guide);
72
- h < c && f.push({
73
- lineGuide: d,
74
- diff: h,
75
- snap: a.snap,
76
- offset: a.offset
77
- });
78
- });
79
- });
80
- var i = [], e = n.sort((d, a) => d.diff - a.diff)[0], u = f.sort((d, a) => d.diff - a.diff)[0];
81
- return e && i.push({
82
- lineGuide: e.lineGuide,
83
- offset: e.offset,
84
- orientation: "V",
85
- snap: e.snap
86
- }), u && i.push({
87
- lineGuide: u.lineGuide,
88
- offset: u.offset,
89
- orientation: "H",
90
- snap: u.snap
91
- }), i;
92
- }
93
- function x(o) {
94
- o.forEach((t) => {
95
- if (t.orientation === "H") {
96
- var n = new p.Line({
97
- points: [-6e3, 0, 6e3, 0],
98
- stroke: "rgb(0, 161, 255)",
99
- strokeWidth: 1,
100
- name: "guid-line",
101
- dash: [4, 6]
102
- });
103
- s.add(n), n.absolutePosition({
104
- x: 0,
105
- y: t.lineGuide
106
- });
107
- } else if (t.orientation === "V") {
108
- var n = new p.Line({
109
- points: [0, -6e3, 0, 6e3],
110
- stroke: "rgb(0, 161, 255)",
111
- strokeWidth: 1,
112
- name: "guid-line",
113
- dash: [4, 6]
114
- });
115
- s.add(n), n.absolutePosition({
116
- x: t.lineGuide,
117
- y: 0
118
- });
119
- }
120
- });
121
- }
122
- s.on("dragmove", function(o) {
123
- s.find(".guid-line").forEach((e) => e.destroy());
124
- var t = b(o.target), n = v(o.target), f = g(t, n);
125
- if (f.length) {
126
- x(f);
127
- var i = o.target.absolutePosition();
128
- f.forEach((e) => {
129
- switch (e.snap) {
130
- case "start": {
131
- switch (e.orientation) {
132
- case "V": {
133
- i.x = e.lineGuide + e.offset;
134
- break;
135
- }
136
- case "H": {
137
- i.y = e.lineGuide + e.offset;
138
- break;
139
- }
140
- }
141
- break;
142
- }
143
- case "center": {
144
- switch (e.orientation) {
145
- case "V": {
146
- i.x = e.lineGuide + e.offset;
147
- break;
148
- }
149
- case "H": {
150
- i.y = e.lineGuide + e.offset;
151
- break;
152
- }
153
- }
154
- break;
155
- }
156
- case "end": {
157
- switch (e.orientation) {
158
- case "V": {
159
- i.x = e.lineGuide + e.offset;
160
- break;
161
- }
162
- case "H": {
163
- i.y = e.lineGuide + e.offset;
164
- break;
165
- }
166
- }
167
- break;
168
- }
169
- }
170
- }), o.target.absolutePosition(i);
171
- }
172
- }), s.on("dragend", function(o) {
173
- s.find(".guid-line").forEach((t) => t.destroy());
174
- });
175
- }, E = (r) => {
176
- r == null || r.find(".guid-line").forEach((s) => s.destroy());
177
- };
178
- export {
179
- w as initGuideline,
180
- E as removeGuideline
181
- };
@@ -1,4 +0,0 @@
1
- import { default as Konva } from 'konva';
2
-
3
- /** 由于该库需要全局唯一命名空间,只能import一次 */
4
- export { Konva };