@das-fed/utils 1.0.2 → 1.0.3

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 (107) hide show
  1. package/api-services/index.d.ts +1 -0
  2. package/api-services/index.js +2 -6964
  3. package/api-services/modules/app-manage.d.ts +2 -0
  4. package/api-services/modules/app-manage.js +3 -6964
  5. package/api-services/modules/authentication.d.ts +2 -0
  6. package/api-services/modules/authentication.js +3 -6964
  7. package/api-services/modules/bems.d.ts +6 -0
  8. package/api-services/modules/bems.js +6 -6967
  9. package/api-services/modules/contract.d.ts +2 -0
  10. package/api-services/modules/contract.js +3 -6964
  11. package/api-services/modules/duty-manage.d.ts +7 -0
  12. package/api-services/modules/duty-manage.js +7 -6968
  13. package/api-services/modules/enterpriseright.d.ts +2 -0
  14. package/api-services/modules/enterpriseright.js +3 -6964
  15. package/api-services/modules/file.d.ts +36 -0
  16. package/api-services/modules/file.js +380 -7040
  17. package/api-services/modules/gateway-edge.d.ts +2 -0
  18. package/api-services/modules/gateway-edge.js +3 -6964
  19. package/api-services/modules/index.d.ts +21 -0
  20. package/api-services/modules/index.js +445 -7105
  21. package/api-services/modules/iot.d.ts +15 -0
  22. package/api-services/modules/iot.js +16 -6977
  23. package/api-services/modules/justauth.d.ts +3 -0
  24. package/api-services/modules/justauth.js +4 -6965
  25. package/api-services/modules/knowledge.d.ts +2 -0
  26. package/api-services/modules/knowledge.js +3 -6964
  27. package/api-services/modules/link.d.ts +2 -0
  28. package/api-services/modules/link.js +3 -6964
  29. package/api-services/modules/permission.d.ts +2 -0
  30. package/api-services/modules/permission.js +3 -6964
  31. package/api-services/modules/platformManage.d.ts +14 -0
  32. package/api-services/modules/platformManage.js +10 -6971
  33. package/api-services/modules/portal.d.ts +2 -0
  34. package/api-services/modules/portal.js +3 -6964
  35. package/api-services/modules/space-manage.d.ts +2 -0
  36. package/api-services/modules/space-manage.js +3 -6964
  37. package/api-services/modules/super-admin.d.ts +8 -0
  38. package/api-services/modules/super-admin.js +6 -6967
  39. package/api-services/modules/supplier.d.ts +6 -0
  40. package/api-services/modules/supplier.js +5 -6966
  41. package/api-services/modules/supplychain-manage.d.ts +2 -0
  42. package/api-services/modules/supplychain-manage.js +3 -6964
  43. package/api-services/modules/systemConfiguration.d.ts +2 -0
  44. package/api-services/modules/systemConfiguration.js +3 -6964
  45. package/api-services/modules/tool.d.ts +2 -0
  46. package/api-services/modules/tool.js +3 -6964
  47. package/api-services/src/create-service.d.ts +2 -0
  48. package/api-services/src/create-service.js +2286 -6013
  49. package/api-services/src/sso.d.ts +29 -0
  50. package/api-services/src/sso.js +506 -669
  51. package/api-services/src/util.d.ts +1 -0
  52. package/api-services/src/util.js +243 -247
  53. package/atob/index.d.ts +2 -0
  54. package/common-info/getIframeUrl.d.ts +9 -0
  55. package/common-info/getIframeUrl.js +6 -11
  56. package/common-info/index.d.ts +42 -0
  57. package/common-info/index.js +104 -163
  58. package/common-info/setInfoFromUrl.d.ts +8 -0
  59. package/common-tools/arr-tools.d.ts +15 -0
  60. package/common-tools/date-format.d.ts +7 -0
  61. package/common-tools/get-url-params.d.ts +33 -0
  62. package/common-tools/get-url-params.js +1 -0
  63. package/common-tools/handle-data.d.ts +6 -0
  64. package/common-tools/index.d.ts +7 -0
  65. package/common-tools/index.js +7 -117
  66. package/common-tools/nest-tree-format.d.ts +30 -0
  67. package/common-tools/obj-tools.d.ts +7 -0
  68. package/common-tools/setHtmlMinWH.d.ts +5 -0
  69. package/common-tools/throttled.d.ts +7 -0
  70. package/config/index.d.ts +2 -0
  71. package/curring-http/index.d.ts +11 -0
  72. package/directive/auth.d.ts +8 -0
  73. package/directive/auth.js +32 -190
  74. package/directive/clickOutside.d.ts +5 -0
  75. package/directive/clickOutside.js +19 -21
  76. package/directive/hoverInside.d.ts +5 -0
  77. package/directive/hoverInside.js +13 -15
  78. package/directive/index.d.ts +3 -0
  79. package/directive/index.js +6 -260
  80. package/directive/utils.d.ts +7 -0
  81. package/dom-check-in/index.d.ts +6 -0
  82. package/dom-watcher/index.d.ts +25 -0
  83. package/hooks/popup-manager/use-zindex.d.ts +5 -0
  84. package/index.d.ts +2 -0
  85. package/index.js +2 -266
  86. package/load-js/index.d.ts +3 -0
  87. package/load-js/index.js +8 -12
  88. package/oss/index.d.ts +2 -0
  89. package/oss/index.js +8 -12
  90. package/package.json +5 -6
  91. package/pinyin-first-character/index.d.ts +2 -0
  92. package/process-engine-info/index.d.ts +10 -0
  93. package/pure-image-src/index.d.ts +2 -0
  94. package/set-personal-info/index.d.ts +5 -0
  95. package/set-personal-info/index.js +516 -622
  96. package/size-watcher/index.d.ts +6 -0
  97. package/style/index.d.ts +2 -0
  98. package/style/math.d.ts +9 -0
  99. package/style/style.d.ts +30 -0
  100. package/token-tools/index.d.ts +18 -0
  101. package/token-tools/index.js +60 -1579
  102. package/vue/hooks/use-model-value.d.ts +3 -0
  103. package/vue/index.d.ts +1 -0
  104. package/vue/index.js +2 -8
  105. package/webSocket-service/index.d.ts +40 -0
  106. package/webSocket-service/index.js +35 -138
  107. package/with-install/index.d.ts +10 -0
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 过滤掉叶子节点,返回嵌套数组
3
+ * @param arr 要过滤的树
4
+ * @param children 子节点指定字段名,默认‘children’
5
+ * @returns 返回过滤掉叶子节点的嵌套数组
6
+ */
7
+ export declare const findNonEmptyChildrenItems: (arr: any[], children?: string) => any[];
8
+ /**
9
+ * 树形数组转扁平数组
10
+ * @param list 要拍平的树
11
+ * @param child 子节点指定字段名,默认‘children’
12
+ * @param deleteChild 是否删除children字段,默认为true
13
+ * @returns
14
+ */
15
+ export declare const flatTree: (list: any[], child?: string, deleteChild?: boolean) => any[];
16
+ /**
17
+ * 根据条件过滤节点
18
+ * @param tree 要过滤的树
19
+ * @param predicate 过滤条件,符合条件的节点保留
20
+ * @param children 子节点指定字段名,默认‘children’
21
+ * @returns
22
+ */
23
+ export declare const filterTreeArray: (tree: any[], predicate: (node: any) => boolean, children?: string) => any[];
24
+ /**
25
+ * 树结构查找节点,深度优先
26
+ * @param tree 要过滤的树
27
+ * @param func 过滤条件,符合条件的节点保留(参数为函数,返回值为布尔值)
28
+ * @returns 查找到的节点
29
+ */
30
+ export declare const treeFind: (tree: any[], func: (node: any) => boolean) => any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 判断两个对象内容值是否相等
3
+ * @param a 对象一
4
+ * @param b 对象二
5
+ * @returns 相等返回true,不相等返回false
6
+ */
7
+ export declare const objEqual: (a: Record<string, any>, b: Record<string, any>) => boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 自定义html最小宽高
3
+ * @param layout minWidth、minHeight为空则为重置
4
+ */
5
+ export declare const setHtmlMinWH: (layout?: Record<'minWidth' | 'minHeight', string>) => void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 节流: n 秒内只运行一次,若在 n 秒内重复触发,只有一次生效
3
+ * @param fn 需执行的方法
4
+ * @param delay 延迟时长,默认300ms
5
+ * @returns
6
+ */
7
+ export declare function throttled(fn: Function, delay?: number): (this: any) => void;
@@ -0,0 +1,2 @@
1
+ declare const getConfig: () => any;
2
+ export { getConfig };
@@ -0,0 +1,11 @@
1
+ import type { Ref, ComputedRef } from 'vue';
2
+ import type { CurringConfigFun, CurringConfig, CurringRes } from './type';
3
+ /** 第一层(接入层):接收封装后的axios实例,第二个参数是全局请求配置,配置项参考AxiosRequestConfig */
4
+ declare const curringHttp: (axiosInstance: any, globalConfig?: CurringConfigFun) => {
5
+ get: (url: string | Ref | ComputedRef, urlConfig?: CurringConfigFun) => (payload?: any, payloadConfig?: CurringConfig) => CurringRes;
6
+ post: (url: string | Ref | ComputedRef, urlConfig?: CurringConfigFun) => (payload?: any, payloadConfig?: CurringConfig) => CurringRes;
7
+ put: (url: string | Ref | ComputedRef, urlConfig?: CurringConfigFun) => (payload?: any, payloadConfig?: CurringConfig) => CurringRes;
8
+ patch: (url: string | Ref | ComputedRef, urlConfig?: CurringConfigFun) => (payload?: any, payloadConfig?: CurringConfig) => CurringRes;
9
+ delete: (url: string | Ref | ComputedRef, urlConfig?: CurringConfigFun) => (payload?: any, payloadConfig?: CurringConfig) => CurringRes;
10
+ };
11
+ export { curringHttp };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 权限控制工具
3
+ * @param el 绑定的dom
4
+ * @param binding 使用指令时对应binding,使用函数时对应options
5
+ * @param vnode
6
+ * @returns 是否有权限
7
+ */
8
+ export declare const vAuth: (el: any, binding: any) => boolean;
package/directive/auth.js CHANGED
@@ -1,165 +1,7 @@
1
- import { ref as S } from "vue";
2
- const p = (e, t) => {
3
- let r = window.location.search || "";
4
- if (e && e !== location.href) {
5
- const n = e.indexOf("?");
6
- n !== -1 ? r = e.slice(n) : r = "";
7
- }
8
- const s = new URLSearchParams(r);
9
- if (t)
10
- return s.get(t);
11
- {
12
- let n = {};
13
- for (let [c, o] of s.entries())
14
- n[c] = o;
15
- return n;
16
- }
17
- }, C = (e, t = "children", r = !0) => Array.isArray(e) && e.length ? e.reduce((s, n) => {
18
- let c = n[t], o = { ...n };
19
- return r && delete o[t], c && c.length ? s.concat(o, C(c, t, r)) : s.concat(o);
20
- }, []) : [];
21
- /*! js-cookie v3.0.5 | MIT */
22
- function d(e) {
23
- for (var t = 1; t < arguments.length; t++) {
24
- var r = arguments[t];
25
- for (var s in r)
26
- e[s] = r[s];
27
- }
28
- return e;
29
- }
30
- var w = {
31
- read: function(e) {
32
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
33
- },
34
- write: function(e) {
35
- return encodeURIComponent(e).replace(
36
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
37
- decodeURIComponent
38
- );
39
- }
40
- };
41
- function g(e, t) {
42
- function r(n, c, o) {
43
- if (!(typeof document > "u")) {
44
- o = d({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
45
- var a = "";
46
- for (var i in o)
47
- o[i] && (a += "; " + i, o[i] !== !0 && (a += "=" + o[i].split(";")[0]));
48
- return document.cookie = n + "=" + e.write(c, n) + a;
49
- }
50
- }
51
- function s(n) {
52
- if (!(typeof document > "u" || arguments.length && !n)) {
53
- for (var c = document.cookie ? document.cookie.split("; ") : [], o = {}, a = 0; a < c.length; a++) {
54
- var i = c[a].split("="), u = i.slice(1).join("=");
55
- try {
56
- var f = decodeURIComponent(i[0]);
57
- if (o[f] = e.read(u, f), n === f)
58
- break;
59
- } catch {
60
- }
61
- }
62
- return n ? o[n] : o;
63
- }
64
- }
65
- return Object.create(
66
- {
67
- set: r,
68
- get: s,
69
- remove: function(n, c) {
70
- r(
71
- n,
72
- "",
73
- d({}, c, {
74
- expires: -1
75
- })
76
- );
77
- },
78
- withAttributes: function(n) {
79
- return g(this.converter, d({}, this.attributes, n));
80
- },
81
- withConverter: function(n) {
82
- return g(d({}, this.converter, n), this.attributes);
83
- }
84
- },
85
- {
86
- attributes: { value: Object.freeze(t) },
87
- converter: { value: Object.freeze(e) }
88
- }
89
- );
90
- }
91
- var h = g(w, { path: "/" });
92
- const y = (e) => {
93
- var t = encodeURIComponent(e);
94
- return t = btoa(t), t;
95
- }, I = () => {
96
- let t = { ...(window == null ? void 0 : window.config) || {} };
97
- t.rootContainer || (t.rootContainer = "#app"), t.baseURL || (t.baseURL = location.origin), t.ossBaseURL || (t.ossBaseURL = "/oss"), t.ossBaseURL.startsWith("/") && (t.ossBaseURL = `${t.baseURL}/oss`), t.ssoBaseURL || (t.ssoBaseURL = t.baseURL);
98
- let { microAppName: r, publicPath: s, mainAppName: n } = t;
99
- return r && !0 && !s && (s = `/${r}/`.replace(/\/\//g, "/")), s || (s = "/"), t.publicPath = s, t.autoOssBucket || (t.autoOssBucket = n || r), t;
100
- };
101
- S(!1);
102
- I();
103
- y("das123"), +/* @__PURE__ */ new Date();
104
- const P = () => {
105
- const e = new URL(location.href).searchParams, t = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
106
- if (t) {
107
- const r = JSON.stringify({ access_token: t });
108
- sessionStorage.setItem("accessToken", t), sessionStorage.setItem("tokenInfo", r), h.set("accessToken", t), h.set("accessTokenInfo", r);
109
- }
110
- }, R = () => {
111
- const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), t = new URL(location.href).searchParams, r = t.get("project") || t.get("projectId") || "";
112
- if (!r)
113
- return;
114
- const s = t.get("projectParent") || t.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", n = t.get("projectName") || (e == null ? void 0 : e.name) || "";
115
- sessionStorage.setItem("project", r), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: r, name: n, parentId: s }));
116
- }, U = () => h.get("accessToken") ?? "", m = (e, t) => {
117
- const r = "permission-btn", s = I(), n = v(), c = p(location.href, "app") || "", o = t || c || (window.__IN_MICRO_APP__ ? n.currentSubAppCode : s.title);
118
- if (!o)
119
- return;
120
- const a = p(location.href, "menu") || "", i = e || a || (window.__IN_MICRO_APP__ ? n.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), u = JSON.parse(sessionStorage.getItem(r) || "{}");
121
- if (!u || JSON.stringify(u) === "{}")
122
- return;
123
- const f = u[o][i];
124
- return f && f.length ? f : u[o]["origin-auth"] ? u[o]["origin-auth"][i] ?? [] : [];
125
- }, v = () => {
126
- var s;
127
- if (!window.__IN_MICRO_APP__)
128
- return {};
129
- const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), t = ((s = e.appcategorys) == null ? void 0 : s.map((n) => n.apps).flat()) ?? [];
130
- return {
131
- appcategorys: e.appcategorys ?? [],
132
- currentSubApp: e.currentSubApp ?? {},
133
- currentSubAppCode: e.currentSubAppCode ?? "",
134
- flatSubAppList: t,
135
- subAppList: e.subAppList ?? []
136
- };
137
- }, L = () => {
138
- const e = I();
139
- let t = {};
140
- if (window.__IN_MICRO_APP__) {
141
- const r = JSON.parse(sessionStorage.getItem("tabs") || "{}");
142
- t = {
143
- activeKey: r.activeKey ?? "",
144
- currentTab: r.currentTab ?? {},
145
- tabMap: r.tabMap ?? {}
146
- };
147
- } else {
148
- const r = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
149
- t = {
150
- activeKey: r.activeKey ?? "",
151
- currentTab: r.currentTab ?? {},
152
- tabList: r.tabList ?? []
153
- };
154
- }
155
- return t;
156
- };
157
- U() || P();
158
- R();
159
- const b = async (e, t) => {
160
- let r = e;
161
- return t != null && t.target && (typeof t.target == "string" && (r = t.target), typeof t.target == "function" && (r = await t.target(e))), r;
162
- }, k = (e, t) => {
1
+ import { getUrlParams as g, flatTree as P } from "@das-fed/utils/common-tools";
2
+ import { getSubApps as v, getPageAuth as i } from "@das-fed/utils/common-info";
3
+ import { getEl as o } from "@das-fed/utils/directive/utils";
4
+ const A = (e, t) => {
163
5
  if (!e || !t)
164
6
  return !1;
165
7
  if (typeof t == "string")
@@ -167,56 +9,56 @@ const b = async (e, t) => {
167
9
  {
168
10
  let r = !1;
169
11
  for (let s of t)
170
- if (e.find((c) => c.code === s)) {
12
+ if (e.find((a) => a.code === s)) {
171
13
  r = !0;
172
14
  break;
173
15
  }
174
16
  return r;
175
17
  }
176
- }, A = (e) => {
177
- var o, a;
18
+ }, h = (e) => {
19
+ var d;
178
20
  const t = (e == null ? void 0 : e.code) ?? "", r = (e == null ? void 0 : e.path) ?? location.pathname, s = (e == null ? void 0 : e.applicationCode) ?? "";
179
- let n = "";
180
- if (window.__IN_MICRO_APP__ ? n = e != null && e.menuCode ? e.menuCode : p(location.href, "menu") : n = e != null && e.menuCode ? e.menuCode : (o = L().currentTab) == null ? void 0 : o.code, !n) {
181
- const i = ((a = v().currentSubApp) == null ? void 0 : a.menus) ?? [];
182
- if (i && i.length) {
183
- const u = C(i).filter((f) => f == null ? void 0 : f.routeUrl);
184
- if (u && u.length) {
185
- const f = u.find((l) => l != null && l.applicationPath ? r == null ? void 0 : r.includes("/" + l.applicationPath + l.routeUrl) : r == null ? void 0 : r.includes(l.routeUrl));
186
- f && (n = (f == null ? void 0 : f.code) ?? "");
21
+ let l = "";
22
+ if (l = e != null && e.menuCode ? e.menuCode : g(location.href, "menu"), !l) {
23
+ const c = ((d = v().currentSubApp) == null ? void 0 : d.menus) ?? [];
24
+ if (c && c.length) {
25
+ const n = P(c).filter((f) => f == null ? void 0 : f.routeUrl);
26
+ if (n && n.length) {
27
+ const f = n.find((u) => u != null && u.applicationPath ? r == null ? void 0 : r.includes("/" + u.applicationPath + u.routeUrl) : r == null ? void 0 : r.includes(u.routeUrl));
28
+ f && (l = (f == null ? void 0 : f.code) ?? "");
187
29
  }
188
30
  }
189
31
  }
190
- let c = !1;
32
+ let a = !1;
191
33
  if (t) {
192
- const i = m(n, s) ?? [];
193
- c = k(i, t);
34
+ const c = i(l, s) ?? [];
35
+ a = A(c, t);
194
36
  } else
195
- c = !!m(n, s);
196
- return c;
197
- }, _ = (e, t) => {
37
+ a = !!i(l, s);
38
+ return a;
39
+ }, m = (e, t) => {
198
40
  t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
199
- }, O = (e, t) => {
41
+ }, b = (e, t) => {
200
42
  t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
201
- }, N = (e, t) => {
43
+ }, U = (e, t) => {
202
44
  let r = (e ? t.value : t) || {};
203
45
  typeof r == "string" && (r = { code: r });
204
- const s = (r == null ? void 0 : r.type) ?? "hide", n = A(r);
46
+ const s = (r == null ? void 0 : r.type) ?? "hide", l = h(r);
205
47
  if (e)
206
48
  if (!t.oldValue)
207
- n || b(e, r).then((c) => {
208
- _(c, s);
49
+ l || o(e, r).then((a) => {
50
+ m(a, s);
209
51
  });
210
52
  else {
211
- const c = A(t.oldValue), o = n;
212
- if (c === o)
53
+ const a = h(t.oldValue), d = l;
54
+ if (a === d)
213
55
  return;
214
- b(e, r).then((a) => {
215
- o ? O(a, s) : _(a, s);
56
+ o(e, r).then((c) => {
57
+ d ? b(c, s) : m(c, s);
216
58
  });
217
59
  }
218
- return n;
60
+ return l;
219
61
  };
220
62
  export {
221
- N as vAuth
63
+ U as vAuth
222
64
  };
@@ -0,0 +1,5 @@
1
+ import type { Directive } from 'vue';
2
+ /**
3
+ * 指令:点击当前区域或者指定区域之外的位置
4
+ */
5
+ export declare const vClickOutside: Directive<HTMLElement>;
@@ -1,29 +1,27 @@
1
- const l = async (r, t) => {
2
- let e = r;
3
- return t != null && t.target && (typeof t.target == "string" && (e = t.target), typeof t.target == "function" && (e = await t.target(r))), e;
4
- }, n = {
5
- mounted: async (r, t) => {
6
- const e = t.value, c = await l(r, e);
7
- function a(_) {
8
- let i = !0;
9
- if (Array.isArray(c))
10
- for (let f of c)
11
- f.__click_outside__ = a, f.contains(_.target) && (i = !1);
1
+ import { getEl as r } from "@das-fed/utils/directive/utils";
2
+ const f = {
3
+ mounted: async (i, _) => {
4
+ const e = _.value, t = await r(i, e);
5
+ function c(n) {
6
+ let l = !0;
7
+ if (Array.isArray(t))
8
+ for (let o of t)
9
+ o.__click_outside__ = c, o.contains(n.target) && (l = !1);
12
10
  else
13
- c.contains(_.target) && (i = !1), c.__click_outside__ = a;
14
- i && e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(_));
11
+ t.contains(n.target) && (l = !1), t.__click_outside__ = c;
12
+ l && e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(n));
15
13
  }
16
- document.addEventListener("click", a);
14
+ document.addEventListener("click", c);
17
15
  },
18
- beforeUnmount: async (r, t) => {
19
- const e = t.value, c = await l(r, e);
20
- if (Array.isArray(c))
21
- for (let a of c)
22
- document.removeEventListener("click", a.__click_outside__), delete a.__click_outside__;
16
+ beforeUnmount: async (i, _) => {
17
+ const e = _.value, t = await r(i, e);
18
+ if (Array.isArray(t))
19
+ for (let c of t)
20
+ document.removeEventListener("click", c.__click_outside__), delete c.__click_outside__;
23
21
  else
24
- document.removeEventListener("click", c.__click_outside__), delete c.__click_outside__;
22
+ document.removeEventListener("click", t.__click_outside__), delete t.__click_outside__;
25
23
  }
26
24
  };
27
25
  export {
28
- n as vClickOutside
26
+ f as vClickOutside
29
27
  };
@@ -0,0 +1,5 @@
1
+ import type { Directive } from 'vue';
2
+ /**
3
+ * 指令:鼠标移入移除dom事件
4
+ */
5
+ export declare const vHoverInside: Directive<HTMLElement>;
@@ -1,23 +1,21 @@
1
- const v = async (a, t) => {
2
- let e = a;
3
- return t != null && t.target && (typeof t.target == "string" && (e = t.target), typeof t.target == "function" && (e = await t.target(a))), e;
4
- }, i = {
5
- mounted: async (a, t) => {
6
- const e = t.value, n = await v(a, e);
7
- function f(r, d) {
8
- n._inside_event = f, typeof e == "function" ? e(r, d) : e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(r, d));
1
+ import { getEl as r } from "@das-fed/utils/directive/utils";
2
+ const o = {
3
+ mounted: async (s, a) => {
4
+ const e = a.value, n = await r(s, e);
5
+ function i(t, d) {
6
+ n._inside_event = i, typeof e == "function" ? e(t, d) : e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(t, d));
9
7
  }
10
- n.addEventListener("mouseenter", (r) => {
11
- f(!0, r);
12
- }), n.addEventListener("mouseleave", (r) => {
13
- f(!1, r);
8
+ n.addEventListener("mouseenter", (t) => {
9
+ i(!0, t);
10
+ }), n.addEventListener("mouseleave", (t) => {
11
+ i(!1, t);
14
12
  });
15
13
  },
16
- beforeUnmount: async (a, t) => {
17
- const e = t.value, n = await v(a, e);
14
+ beforeUnmount: async (s, a) => {
15
+ const e = a.value, n = await r(s, e);
18
16
  n.addEventListener("mouseenter", n._inside_event), n.addEventListener("mouseleave", n._inside_event), delete n._inside_event;
19
17
  }
20
18
  };
21
19
  export {
22
- i as vHoverInside
20
+ o as vHoverInside
23
21
  };
@@ -0,0 +1,3 @@
1
+ export { vAuth } from '@das-fed/utils/directive/auth';
2
+ export { vClickOutside } from '@das-fed/utils/directive/clickOutside';
3
+ export { vHoverInside } from '@das-fed/utils/directive/hoverInside';