@das-fed/utils 1.0.4 → 1.0.6

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 (44) hide show
  1. package/api-services/src/create-service.js +669 -667
  2. package/common-info/index.js +63 -62
  3. package/common-tools/get-url-params.js +0 -1
  4. package/dimple-canvas/index.d.ts +2 -0
  5. package/dimple-canvas/index.js +5 -0
  6. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +28 -0
  7. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +19946 -0
  8. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +53 -0
  9. package/dimple-canvas/use-dimple-canvas/core/konva/index.js +119 -0
  10. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +101 -0
  11. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +17 -0
  12. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +7 -0
  13. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +55 -0
  14. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +5 -0
  15. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +14 -0
  16. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +4 -0
  17. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +5 -0
  18. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +4 -0
  19. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +181 -0
  20. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +3 -0
  21. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +7374 -0
  22. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +6 -0
  23. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +13 -0
  24. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +3 -0
  25. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +7 -0
  26. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +8 -0
  27. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +193 -0
  28. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +10 -0
  29. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +20 -0
  30. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +4 -0
  31. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +52 -0
  32. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +2 -0
  33. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +14 -0
  34. package/dimple-canvas/use-dimple-canvas/index.d.ts +8 -0
  35. package/dimple-canvas/use-dimple-canvas/index.js +10 -0
  36. package/micro-app/globalData.d.ts +3 -0
  37. package/micro-app/globalData.js +11 -0
  38. package/micro-app/index.d.ts +5 -0
  39. package/micro-app/index.js +3699 -0
  40. package/nextTiken/index.d.ts +13 -0
  41. package/nextTiken/index.js +62 -0
  42. package/package.json +5 -6
  43. package/panel/index.d.ts +31 -0
  44. package/panel/index.js +37 -0
@@ -5,9 +5,9 @@ import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/c
5
5
  /*! js-cookie v3.0.5 | MIT */
6
6
  function g(e) {
7
7
  for (var n = 1; n < arguments.length; n++) {
8
- var t = arguments[n];
9
- for (var s in t)
10
- e[s] = t[s];
8
+ var r = arguments[n];
9
+ for (var s in r)
10
+ e[s] = r[s];
11
11
  }
12
12
  return e;
13
13
  }
@@ -23,35 +23,35 @@ var b = {
23
23
  }
24
24
  };
25
25
  function I(e, n) {
26
- function t(o, a, r) {
26
+ function r(o, a, t) {
27
27
  if (!(typeof document > "u")) {
28
- r = g({}, n, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
28
+ t = g({}, n, t), typeof t.expires == "number" && (t.expires = new Date(Date.now() + t.expires * 864e5)), t.expires && (t.expires = t.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
29
29
  var i = "";
30
- for (var c in r)
31
- r[c] && (i += "; " + c, r[c] !== !0 && (i += "=" + r[c].split(";")[0]));
30
+ for (var c in t)
31
+ t[c] && (i += "; " + c, t[c] !== !0 && (i += "=" + t[c].split(";")[0]));
32
32
  return document.cookie = o + "=" + e.write(a, o) + i;
33
33
  }
34
34
  }
35
35
  function s(o) {
36
36
  if (!(typeof document > "u" || arguments.length && !o)) {
37
- for (var a = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < a.length; i++) {
37
+ for (var a = document.cookie ? document.cookie.split("; ") : [], t = {}, i = 0; i < a.length; i++) {
38
38
  var c = a[i].split("="), p = c.slice(1).join("=");
39
39
  try {
40
40
  var u = decodeURIComponent(c[0]);
41
- if (r[u] = e.read(p, u), o === u)
41
+ if (t[u] = e.read(p, u), o === u)
42
42
  break;
43
43
  } catch {
44
44
  }
45
45
  }
46
- return o ? r[o] : r;
46
+ return o ? t[o] : t;
47
47
  }
48
48
  }
49
49
  return Object.create(
50
50
  {
51
- set: t,
51
+ set: r,
52
52
  get: s,
53
53
  remove: function(o, a) {
54
- t(
54
+ r(
55
55
  o,
56
56
  "",
57
57
  g({}, a, {
@@ -73,27 +73,28 @@ function I(e, n) {
73
73
  );
74
74
  }
75
75
  var A = I(b, { path: "/" });
76
- const h = () => A.get("accessToken") ?? "", j = () => {
77
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
78
- let t = l().getData().info;
79
- return n || e.userInfo && (t = e.userInfo), {
80
- id: t.sub ?? "",
81
- name: t.name ?? "",
82
- flag: t.flag,
83
- tenantId: (t == null ? void 0 : t.tenant) ?? (t == null ? void 0 : t.tenantId) ?? ""
76
+ const h = () => A.get("accessToken") ?? "", w = () => {
77
+ var s;
78
+ let e = (s = l().getData()) == null ? void 0 : s.info;
79
+ const n = f();
80
+ return JSON.stringify(e) === "{}" && n.userInfo && (e = n.userInfo), {
81
+ id: e.sub ?? "",
82
+ name: e.name ?? "",
83
+ flag: e.flag,
84
+ tenantId: (e == null ? void 0 : e.tenant) ?? (e == null ? void 0 : e.tenantId) ?? ""
84
85
  };
85
- }, y = () => {
86
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
87
- let t = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
- return n || e.personalInfo && (t = e.personalInfo), {
89
- id: t.id ?? "",
90
- name: t.name ?? "",
91
- phone: t.phone ?? "",
92
- userName: t.userName ?? "",
93
- email: t.email ?? "",
94
- headPicture: t.headPicture ?? ""
86
+ }, J = () => {
87
+ let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
+ const n = f();
89
+ return JSON.stringify(e) === "{}" && n.personalInfo && (e = n.personalInfo), {
90
+ id: e.id ?? "",
91
+ name: e.name ?? "",
92
+ phone: e.phone ?? "",
93
+ userName: e.userName ?? "",
94
+ email: e.email ?? "",
95
+ headPicture: e.headPicture ?? ""
95
96
  };
96
- }, R = () => {
97
+ }, j = () => {
97
98
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
98
99
  return {
99
100
  userId: e.id ?? "",
@@ -104,25 +105,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
104
105
  flag: e.flag ?? null,
105
106
  tenant: e.tenant ?? {}
106
107
  };
107
- }, U = () => {
108
- const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
109
- let t = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
- return n || e.projectInfo && (t = e.projectInfo), {
111
- id: (t == null ? void 0 : t.id) ?? "",
112
- parentId: (t == null ? void 0 : t.parentId) ?? "",
113
- name: (t == null ? void 0 : t.name) ?? "",
114
- tenantId: (t == null ? void 0 : t.tenant) ?? ""
108
+ }, R = () => {
109
+ let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
+ const n = f();
111
+ return JSON.stringify(e) === "{}" && n.projectInfo && (e = n.projectInfo), {
112
+ id: (e == null ? void 0 : e.id) ?? "",
113
+ parentId: (e == null ? void 0 : e.parentId) ?? "",
114
+ name: (e == null ? void 0 : e.name) ?? "",
115
+ tenantId: (e == null ? void 0 : e.tenant) ?? ""
115
116
  };
116
117
  }, _ = (e, n) => {
117
- const t = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", r = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
118
- if (!r)
118
+ const r = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", t = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
119
+ if (!t)
119
120
  return;
120
- const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(t) || "{}");
121
+ const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(r) || "{}");
121
122
  if (!p || JSON.stringify(p) === "{}")
122
123
  return;
123
- const u = p[r][c];
124
- return u && u.length ? u : p[r]["origin-auth"] ? p[r]["origin-auth"][c] ?? [] : [];
125
- }, M = (e, n) => _(e, n) ?? [], v = () => {
124
+ const u = p[t][c];
125
+ return u && u.length ? u : p[t]["origin-auth"] ? p[t]["origin-auth"][c] ?? [] : [];
126
+ }, U = (e, n) => _(e, n) ?? [], v = () => {
126
127
  var s;
127
128
  if (!window.__IN_MICRO_APP__)
128
129
  return {};
@@ -134,25 +135,25 @@ const h = () => A.get("accessToken") ?? "", j = () => {
134
135
  flatSubAppList: n,
135
136
  subAppList: e.subAppList ?? []
136
137
  };
137
- }, T = (e) => {
138
+ }, M = (e) => {
138
139
  const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
139
140
  return e ? n[e] ?? [] : n;
140
- }, J = () => {
141
+ }, T = () => {
141
142
  const e = f();
142
143
  let n = {};
143
144
  if (window.__IN_MICRO_APP__) {
144
- const t = JSON.parse(sessionStorage.getItem("tabs") || "{}");
145
+ const r = JSON.parse(sessionStorage.getItem("tabs") || "{}");
145
146
  n = {
146
- activeKey: t.activeKey ?? "",
147
- currentTab: t.currentTab ?? {},
148
- tabMap: t.tabMap ?? {}
147
+ activeKey: r.activeKey ?? "",
148
+ currentTab: r.currentTab ?? {},
149
+ tabMap: r.tabMap ?? {}
149
150
  };
150
151
  } else {
151
- const t = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
152
+ const r = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
152
153
  n = {
153
- activeKey: t.activeKey ?? "",
154
- currentTab: t.currentTab ?? {},
155
- tabList: t.tabList ?? []
154
+ activeKey: r.activeKey ?? "",
155
+ currentTab: r.currentTab ?? {},
156
+ tabList: r.tabList ?? []
156
157
  };
157
158
  }
158
159
  return n;
@@ -163,15 +164,15 @@ const h = () => A.get("accessToken") ?? "", j = () => {
163
164
  h() || m();
164
165
  S();
165
166
  export {
166
- T as getMenus,
167
+ M as getMenus,
167
168
  k as getMinioAddress,
168
169
  _ as getPageAuth,
169
- M as getPageAuthBtn,
170
- y as getPersonalInfo,
171
- U as getProjectInfo,
170
+ U as getPageAuthBtn,
171
+ J as getPersonalInfo,
172
+ R as getProjectInfo,
172
173
  v as getSubApps,
173
- J as getTabInfo,
174
- R as getTenantInfo,
174
+ T as getTabInfo,
175
+ j as getTenantInfo,
175
176
  h as getToken,
176
- j as getUserInfo
177
+ w as getUserInfo
177
178
  };
@@ -20,7 +20,6 @@ const a = (r, n) => {
20
20
  i === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
21
21
  }), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
22
22
  }, u = (r, n) => {
23
- debugger;
24
23
  const e = n || location.href, t = a(e), s = Object.keys(t) || [];
25
24
  if (!s || !s.length)
26
25
  return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
@@ -0,0 +1,2 @@
1
+ import { useDimpleCanvas, Konva } from '@das-fed/utils/dimple-canvas/use-dimple-canvas';
2
+ export { useDimpleCanvas, Konva };
@@ -0,0 +1,5 @@
1
+ import { Konva as o, useDimpleCanvas as m } from "@das-fed/utils/dimple-canvas/use-dimple-canvas";
2
+ export {
3
+ o as Konva,
4
+ m as useDimpleCanvas
5
+ };
@@ -0,0 +1,28 @@
1
+ import { Graph, Shape, Node } from '@antv/x6';
2
+ type ObjectTypeMap = {
3
+ Rect: typeof Shape.Rect;
4
+ Circle: typeof Shape.Circle;
5
+ Ellipse: typeof Shape.Ellipse;
6
+ Polygon: typeof Shape.Polygon;
7
+ Polyline: typeof Shape.Polyline;
8
+ Path: typeof Shape.Path;
9
+ Image: typeof Shape.Image;
10
+ HTML: typeof Shape.HTML;
11
+ BackgroundImage: null;
12
+ };
13
+ declare const useAntvX6: (initOptions?: Graph.Options) => {
14
+ canvasContainerEl: any;
15
+ init: (container: HTMLDivElement) => void;
16
+ waitInit: () => Promise<void>;
17
+ canvas: any;
18
+ onCanvasMounted: (cb: Function) => number;
19
+ addObject: <T extends keyof ObjectTypeMap>(type: T, metadata?: Node.Metadata & {
20
+ src?: string;
21
+ }, options?: Model.AddOptions) => Promise<typeof Node>;
22
+ removeObject: (key: string) => Promise<void>;
23
+ zoom: (type?: 'in' | 'out', radio?: number) => Promise<void>;
24
+ toJSON: () => Promise<any>;
25
+ loadJSON: (data: any) => Promise<any>;
26
+ remove: () => Promise<any>;
27
+ };
28
+ export { useAntvX6, Graph };