@das-fed/upf-utils 6.4.0-hot.12 → 6.4.0-hot.14

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 (242) hide show
  1. package/api-services/es5.d.ts +2 -0
  2. package/api-services/es5.js +1501 -1348
  3. package/api-services/i18n/es5.d.ts +63 -0
  4. package/api-services/index.js +1146 -1032
  5. package/api-services/index.js.gz +0 -0
  6. package/api-services/modules/app-manage/es5.d.ts +2 -0
  7. package/api-services/modules/app-manage/es5.js +2142 -1979
  8. package/api-services/modules/app-manage/index.js +1871 -1742
  9. package/api-services/modules/app-manage/index.js.gz +0 -0
  10. package/api-services/modules/authentication/es5.d.ts +2 -0
  11. package/api-services/modules/authentication/es5.js +2135 -1969
  12. package/api-services/modules/authentication/index.js +1866 -1733
  13. package/api-services/modules/authentication/index.js.gz +0 -0
  14. package/api-services/modules/bems/es5.d.ts +6 -0
  15. package/api-services/modules/bems/es5.js +1944 -1790
  16. package/api-services/modules/bems/index.js +1666 -1551
  17. package/api-services/modules/bems/index.js.gz +0 -0
  18. package/api-services/modules/contract/es5.d.ts +2 -0
  19. package/api-services/modules/contract/es5.js +1978 -1824
  20. package/api-services/modules/contract/index.js +1710 -1595
  21. package/api-services/modules/contract/index.js.gz +0 -0
  22. package/api-services/modules/duty-manage/es5.d.ts +7 -0
  23. package/api-services/modules/duty-manage/es5.js +1987 -1833
  24. package/api-services/modules/duty-manage/index.js +1714 -1599
  25. package/api-services/modules/duty-manage/index.js.gz +0 -0
  26. package/api-services/modules/enterpriseright/es5.d.ts +2 -0
  27. package/api-services/modules/enterpriseright/es5.js +1978 -1824
  28. package/api-services/modules/enterpriseright/index.js +1710 -1595
  29. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  30. package/api-services/modules/es5.d.ts +21 -0
  31. package/api-services/modules/es5.js +1466 -1313
  32. package/api-services/modules/file/es5.d.ts +37 -0
  33. package/api-services/modules/file/es5.js +1799 -1658
  34. package/api-services/modules/file/index.js +1476 -1380
  35. package/api-services/modules/file/index.js.gz +0 -0
  36. package/api-services/modules/gateway-edge/es5.d.ts +2 -0
  37. package/api-services/modules/gateway-edge/es5.js +2135 -1969
  38. package/api-services/modules/gateway-edge/index.js +1866 -1733
  39. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  40. package/api-services/modules/index.js +1122 -1008
  41. package/api-services/modules/index.js.gz +0 -0
  42. package/api-services/modules/iot/es5.d.ts +16 -0
  43. package/api-services/modules/iot/es5.js +1820 -1666
  44. package/api-services/modules/iot/index.js +1546 -1431
  45. package/api-services/modules/iot/index.js.gz +0 -0
  46. package/api-services/modules/justauth/es5.d.ts +3 -0
  47. package/api-services/modules/justauth/es5.js +2095 -1953
  48. package/api-services/modules/justauth/index.js +1837 -1740
  49. package/api-services/modules/justauth/index.js.gz +0 -0
  50. package/api-services/modules/knowledge/es5.d.ts +2 -0
  51. package/api-services/modules/knowledge/es5.js +1978 -1824
  52. package/api-services/modules/knowledge/index.js +1710 -1595
  53. package/api-services/modules/knowledge/index.js.gz +0 -0
  54. package/api-services/modules/link/es5.d.ts +2 -0
  55. package/api-services/modules/link/es5.js +2135 -1969
  56. package/api-services/modules/link/index.js +1866 -1733
  57. package/api-services/modules/link/index.js.gz +0 -0
  58. package/api-services/modules/permission/es5.d.ts +2 -0
  59. package/api-services/modules/permission/es5.js +1978 -1824
  60. package/api-services/modules/permission/index.js +1710 -1595
  61. package/api-services/modules/permission/index.js.gz +0 -0
  62. package/api-services/modules/platformManage/es5.d.ts +14 -0
  63. package/api-services/modules/platformManage/es5.js +2125 -1983
  64. package/api-services/modules/platformManage/index.js +1858 -1761
  65. package/api-services/modules/platformManage/index.js.gz +0 -0
  66. package/api-services/modules/portal/es5.d.ts +2 -0
  67. package/api-services/modules/portal/es5.js +2135 -1969
  68. package/api-services/modules/portal/index.js +1866 -1733
  69. package/api-services/modules/portal/index.js.gz +0 -0
  70. package/api-services/modules/space-manage/es5.d.ts +2 -0
  71. package/api-services/modules/space-manage/es5.js +1978 -1824
  72. package/api-services/modules/space-manage/index.js +1710 -1595
  73. package/api-services/modules/space-manage/index.js.gz +0 -0
  74. package/api-services/modules/super-admin/es5.d.ts +8 -0
  75. package/api-services/modules/super-admin/es5.js +2107 -1965
  76. package/api-services/modules/super-admin/index.js +1845 -1748
  77. package/api-services/modules/super-admin/index.js.gz +0 -0
  78. package/api-services/modules/supplier/es5.d.ts +6 -0
  79. package/api-services/modules/supplier/es5.js +1983 -1829
  80. package/api-services/modules/supplier/index.js +1712 -1597
  81. package/api-services/modules/supplier/index.js.gz +0 -0
  82. package/api-services/modules/supplychain-manage/es5.d.ts +2 -0
  83. package/api-services/modules/supplychain-manage/es5.js +1978 -1824
  84. package/api-services/modules/supplychain-manage/index.js +1710 -1595
  85. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  86. package/api-services/modules/systemConfiguration/es5.d.ts +2 -0
  87. package/api-services/modules/systemConfiguration/es5.js +1978 -1824
  88. package/api-services/modules/systemConfiguration/index.js +1710 -1595
  89. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  90. package/api-services/modules/tool/es5.d.ts +2 -0
  91. package/api-services/modules/tool/es5.js +1978 -1824
  92. package/api-services/modules/tool/index.js +1710 -1595
  93. package/api-services/modules/tool/index.js.gz +0 -0
  94. package/api-services/src/create-service/es5.d.ts +1 -0
  95. package/api-services/src/create-service/es5.js +1976 -1822
  96. package/api-services/src/create-service/index.js +1708 -1593
  97. package/api-services/src/create-service/index.js.gz +0 -0
  98. package/atob/es5.d.ts +2 -0
  99. package/common-info/es5.d.ts +73 -0
  100. package/common-info/es5.js +2819 -2636
  101. package/common-info/getIframeUrl/es5.d.ts +9 -0
  102. package/common-info/getInfoFromUrl/es5.d.ts +8 -0
  103. package/common-info/getPermissionMethod/es5.d.ts +77 -0
  104. package/common-info/getPermissionMethod/es5.js +2116 -1936
  105. package/common-info/getPermissionMethod/index.d.ts +57 -6
  106. package/common-info/getPermissionMethod/index.js +1828 -1706
  107. package/common-info/getPermissionMethod/index.js.gz +0 -0
  108. package/common-info/index.d.ts +5 -8
  109. package/common-info/index.js +2443 -2318
  110. package/common-info/index.js.gz +0 -0
  111. package/common-info/set-personal-info/es5.d.ts +5 -0
  112. package/common-info/type.d.ts +2 -2
  113. package/common-tools/arr-tools/es5.d.ts +15 -0
  114. package/common-tools/calc-text-width/es5.d.ts +1 -0
  115. package/common-tools/date-format/es5.d.ts +7 -0
  116. package/common-tools/es5.d.ts +15 -0
  117. package/common-tools/es5.js +9 -0
  118. package/common-tools/extract-file-name/es5.d.ts +1 -0
  119. package/common-tools/get-file-extension/es5.d.ts +6 -0
  120. package/common-tools/get-url-params/es5.d.ts +46 -0
  121. package/common-tools/handle-data/es5.d.ts +34 -0
  122. package/common-tools/handle-data/es5.js +44 -6
  123. package/common-tools/handle-data/index.d.ts +16 -1
  124. package/common-tools/handle-data/index.js +1 -1
  125. package/common-tools/handle-data/index.js.gz +0 -0
  126. package/common-tools/index.d.ts +1 -0
  127. package/common-tools/index.js +1 -0
  128. package/common-tools/nest-tree-format/es5.d.ts +30 -0
  129. package/common-tools/obj-tools/es5.d.ts +7 -0
  130. package/common-tools/platform-tools/es5.d.ts +19 -0
  131. package/common-tools/queue-promise/es5.d.ts +6 -0
  132. package/common-tools/setHtmlMinWH/es5.d.ts +5 -0
  133. package/common-tools/timezone-format/es5.d.ts +186 -0
  134. package/common-tools/timezone-format/es5.js +1088 -0
  135. package/common-tools/timezone-format/get-iana-data/dayjs-timezone-iana-plugin.d.ts +72 -0
  136. package/common-tools/timezone-format/get-iana-data/iana-api-fetch.d.ts +21 -0
  137. package/common-tools/timezone-format/get-iana-data/moment-iana-loader.d.ts +29 -0
  138. package/common-tools/timezone-format/index.d.ts +186 -0
  139. package/common-tools/timezone-format/index.js +655 -0
  140. package/common-tools/timezone-format/index.js.gz +0 -0
  141. package/common-tools/update-browser-title/es5.d.ts +1 -0
  142. package/common-tools/update-fav-icon/es5.d.ts +11 -0
  143. package/config/es5.d.ts +2 -0
  144. package/create-api-service/access-token-auto-refresh/es5.d.ts +20 -0
  145. package/create-api-service/access-token-auto-refresh/es5.js +27 -26
  146. package/create-api-service/access-token-auto-refresh/index.js +27 -26
  147. package/create-api-service/access-token-auto-refresh/index.js.gz +0 -0
  148. package/create-api-service/check-token/es5.d.ts +12 -0
  149. package/create-api-service/es5.d.ts +8 -0
  150. package/create-api-service/es5.js +1977 -1823
  151. package/create-api-service/i18n/es5.d.ts +39 -0
  152. package/create-api-service/index.js +1709 -1594
  153. package/create-api-service/index.js.gz +0 -0
  154. package/create-api-service/proxy-sso/es5.d.ts +3 -0
  155. package/create-api-service/sso/es5.d.ts +21 -0
  156. package/create-api-service/token-refresh-shared/es5.d.ts +30 -0
  157. package/curring-http/es5.d.ts +12 -0
  158. package/dimple-canvas/es5.d.ts +3 -0
  159. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +29 -0
  160. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +19826 -0
  161. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js.gz +0 -0
  162. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +55 -0
  163. package/dimple-canvas/use-dimple-canvas/core/konva/index.js +116 -0
  164. package/dimple-canvas/use-dimple-canvas/core/konva/index.js.gz +0 -0
  165. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +104 -0
  166. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +17 -0
  167. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +8 -0
  168. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +51 -0
  169. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js.gz +0 -0
  170. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +5 -0
  171. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +14 -0
  172. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +7 -0
  173. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +5 -0
  174. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +5 -0
  175. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +180 -0
  176. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js.gz +0 -0
  177. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +4 -0
  178. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +7535 -0
  179. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js.gz +0 -0
  180. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +6 -0
  181. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +13 -0
  182. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +6 -0
  183. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +7 -0
  184. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +8 -0
  185. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +193 -0
  186. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js.gz +0 -0
  187. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +11 -0
  188. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +20 -0
  189. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +5 -0
  190. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +52 -0
  191. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js.gz +0 -0
  192. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +4 -0
  193. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +14 -0
  194. package/dimple-canvas/use-dimple-canvas/es5.d.ts +9 -0
  195. package/dimple-canvas/use-dimple-canvas/es5.js +20 -0
  196. package/dimple-canvas/use-dimple-canvas/index.d.ts +9 -0
  197. package/dimple-canvas/use-dimple-canvas/index.js +10 -0
  198. package/directive/auth/es5.d.ts +8 -0
  199. package/directive/auth/es5.js +50 -42
  200. package/directive/auth/index.d.ts +1 -1
  201. package/directive/auth/index.js +42 -34
  202. package/directive/auth/index.js.gz +0 -0
  203. package/directive/clickOutside/es5.d.ts +6 -0
  204. package/directive/es5.d.ts +3 -0
  205. package/directive/hoverInside/es5.d.ts +6 -0
  206. package/directive/utils/es5.d.ts +7 -0
  207. package/dom-check-in/es5.d.ts +6 -0
  208. package/dom-watcher/es5.d.ts +25 -0
  209. package/esm-map.json +96 -3
  210. package/hooks/popup-manager/use-zindex/es5.d.ts +3 -0
  211. package/hooks/use-get-auth/apis.d.ts +4 -0
  212. package/hooks/use-get-auth/es5.d.ts +8 -0
  213. package/hooks/use-get-auth/es5.js +325 -57
  214. package/hooks/use-get-auth/index.d.ts +8 -4
  215. package/hooks/use-get-auth/index.js +71 -16
  216. package/hooks/use-get-auth/index.js.gz +0 -0
  217. package/i18n-bridge/es5.d.ts +10 -0
  218. package/index.d.ts +2 -0
  219. package/index.js +2 -0
  220. package/load-js/es5.d.ts +3 -0
  221. package/nextTiken/es5.d.ts +12 -0
  222. package/oss/es5.d.ts +2 -0
  223. package/package.json +4 -3
  224. package/pinyin-first-character/es5.d.ts +2 -0
  225. package/process-engine-info/es5.d.ts +13 -0
  226. package/pure-image-src/es5.d.ts +2 -0
  227. package/size-watcher/es5.d.ts +6 -0
  228. package/style/es5.d.ts +2 -0
  229. package/theme/bridge.d.ts +42 -0
  230. package/theme/color.d.ts +7 -0
  231. package/theme/es5.d.ts +94 -0
  232. package/theme/es5.js +2145 -0
  233. package/theme/index.d.ts +94 -0
  234. package/theme/index.js +1370 -0
  235. package/theme/index.js.gz +0 -0
  236. package/theme/source-variables.d.ts +35 -0
  237. package/token-tools/es5.d.ts +21 -0
  238. package/use-low-code/es5.d.ts +1 -0
  239. package/vue/es5.d.ts +1 -0
  240. package/vue/hooks/use-model-value/es5.d.ts +9 -0
  241. package/webSocket-service/es5.d.ts +41 -0
  242. package/with-install/es5.d.ts +11 -0
@@ -1,19 +1,74 @@
1
- import { flatTree as o } from "@das-fed/upf-utils/common-tools";
2
- import { projectNextTick as s } from "@das-fed/upf-utils/nextTiken";
3
- const l = () => ({
4
- getApplication: async (t) => {
5
- await s();
6
- const i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter((e) => e.type === "application");
7
- return t ? i.find((e) => e.appId === t) : i;
8
- },
9
- getMenu: async (t, n) => {
10
- await s();
11
- const i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = o(i).filter((r) => r.type === "menu");
12
- if (!t && !n) return e;
13
- let a;
14
- return t ? a = e.find((r) => r.routeCode === t || r.originalCode === t) : n && (a = e.find((r) => r.routeUrl === n)), a;
1
+ import { flatTree as b } from "@das-fed/upf-utils/common-tools";
2
+ import { projectNextTick as y } from "@das-fed/upf-utils/nextTiken";
3
+ import { vAuth as j } from "@das-fed/upf-utils/directive/auth";
4
+ import { portal as $, superadminPortal as N, enterpriseright as q } from "@das-fed/upf-utils/api-services/modules";
5
+ const x = $.get("/appcategory"), F = N.get("/appcategory"), J = q.get("/permissionset/user-portal-menu"), L = N.get("/user-menu"), T = () => {
6
+ try {
7
+ const t = JSON.parse(sessionStorage.getItem("menuList") || "[]");
8
+ return Array.isArray(t) ? t : [];
9
+ } catch {
10
+ return [];
15
11
  }
16
- });
12
+ }, a = (t) => String(t ?? "").trim(), B = (t) => t === "superadmin" || t === "enterpriseadmin", P = (t) => a(t).startsWith("/"), M = (t) => {
13
+ const r = t == null ? void 0 : t.children;
14
+ return Array.isArray(r) ? r.filter((o) => o && typeof o == "object") : [];
15
+ }, I = () => T().filter((t) => (t == null ? void 0 : t.type) === "application" || (t == null ? void 0 : t.appId) || M(t).length), f = (t, r) => {
16
+ const o = a(t), e = a(r);
17
+ return !!o && o === e;
18
+ }, A = (t, r) => f(t == null ? void 0 : t.appId, r) || f(t == null ? void 0 : t.code, r) || f(t == null ? void 0 : t.routeCode, r) || f(t == null ? void 0 : t.originalCode, r), O = (t, r) => f(t == null ? void 0 : t.routeCode, r) || f(t == null ? void 0 : t.code, r) || f(t == null ? void 0 : t.originalCode, r), Q = (t) => {
19
+ if (!t || typeof t != "object") return [];
20
+ const r = t.rightFuncCodes || t.authCodes || t.permissionCodes || [];
21
+ return Array.isArray(r) ? r.map((o) => a(o)).filter(Boolean) : [];
22
+ }, S = (t) => b(t).filter((r) => (r == null ? void 0 : r.type) === "menu" || (r == null ? void 0 : r.routeUrl) || (r == null ? void 0 : r.code) || (r == null ? void 0 : r.routeCode)), C = (t, r, o) => {
23
+ const e = a(r), c = a(o), n = S(t);
24
+ return !e && !c ? n : n.find((s) => e && O(s, e) ? !0 : !!c && a(s.routeUrl) === c);
25
+ }, U = async (t) => {
26
+ const r = t === "enterpriseadmin" ? { userType: 1 } : {}, o = t === "superadmin" ? F().run : x().run, [e, c] = await o(r);
27
+ return e || !Array.isArray(c) ? [] : c.map((n) => (n == null ? void 0 : n.apps) || []).flat();
28
+ }, W = async (t, r) => {
29
+ const o = { code: t, showBtn: !0 }, e = r === "superadmin" ? L().run : J().run;
30
+ r === "enterpriseadmin" && (o.userType = 1);
31
+ const [c, n] = await e(o);
32
+ return c || !Array.isArray(n) ? [] : n;
33
+ }, k = (t, r, o, e) => {
34
+ let c = e || "enterpriseadmin", n = a(t), s = a(r), i = a(o);
35
+ return B(o) && (c = o, i = ""), B(r) && (c = r, s = ""), P(s) && (i = s, s = ""), P(n) && (i = n, n = ""), { appCode: n, targetMenuCode: s, targetPath: i, systemAppName: c };
36
+ }, z = (t, r, o) => !t || !o ? !1 : t === o || t.endsWith(`.${o}`) ? !0 : (r && t.includes(`${r}.`) ? t.replace(`${r}.`, "") : t).replace(/\./g, "-") === o, E = () => {
37
+ const t = async (e, c = "enterpriseadmin") => {
38
+ await y();
39
+ const n = a(e), s = I();
40
+ if (s.length) {
41
+ if (!n) return s;
42
+ const l = s.find((d) => A(d, n));
43
+ if (l) return l;
44
+ }
45
+ const i = await U(c);
46
+ return n ? i.find((l) => A(l, n)) : i;
47
+ }, r = async (e, c, n, s) => {
48
+ await y();
49
+ const { appCode: i, targetMenuCode: l, targetPath: d, systemAppName: g } = k(e, c, n, s), p = I().find((h) => A(h, i));
50
+ if (p) return C(M(p), l, d);
51
+ if (i) {
52
+ const h = await W(i, g);
53
+ if (h.length) return C(h, l, d);
54
+ }
55
+ const u = S(T());
56
+ return !i && !l && !d ? u : C(u, l || i, d);
57
+ };
58
+ return { getApplication: t, getMenu: r, getAuth: async (e, c = "enterpriseadmin") => {
59
+ await y();
60
+ const n = a(e == null ? void 0 : e.applicationCode), s = a(e == null ? void 0 : e.menuCode), i = a(e == null ? void 0 : e.code);
61
+ if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) return !!j(null, { applicationCode: n, menuCode: s, code: i });
62
+ const d = n ? await t(n, c) : null;
63
+ if (n && !d) return !1;
64
+ if (!s) return !!(d || !n);
65
+ const g = await r(n, s, "", c);
66
+ if (!g) return !1;
67
+ if (!i) return !0;
68
+ const w = Q(g), p = S(M(g)).map((u) => a((u == null ? void 0 : u.originalCode) || (u == null ? void 0 : u.code) || (u == null ? void 0 : u.routeCode))).filter(Boolean);
69
+ return [...w, ...p].some((u) => z(u, s, i));
70
+ } };
71
+ };
17
72
  export {
18
- l as useGetAuth
73
+ E as useGetAuth
19
74
  };
Binary file
@@ -0,0 +1,10 @@
1
+ export type I18nBridgeLangRef = {
2
+ value: string;
3
+ };
4
+ export type I18nBridgeT = (key: string, ...args: any[]) => string;
5
+ export type I18nBridgeState = {
6
+ t: I18nBridgeT;
7
+ currentLang: I18nBridgeLangRef;
8
+ };
9
+ export declare const setI18nBridge: (next: Partial<I18nBridgeState>) => void;
10
+ export declare const getI18nBridge: () => I18nBridgeState;
package/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from '@das-fed/upf-utils/directive';
2
2
  export * from '@das-fed/upf-utils/with-install';
3
+ export * from '@das-fed/upf-utils/theme';
4
+ export * from '@das-fed/upf-utils/common-tools/timezone-format';
package/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from "@das-fed/upf-utils/directive";
2
2
  export * from "@das-fed/upf-utils/with-install";
3
+ export * from "@das-fed/upf-utils/theme";
4
+ export * from "@das-fed/upf-utils/common-tools/timezone-format";
@@ -0,0 +1,3 @@
1
+ /** 使用promise加载js的工具 */
2
+ declare const loadJs: (src: string) => any;
3
+ export { loadJs };
@@ -0,0 +1,12 @@
1
+ import { PersonalInfo, TenantInfo } from '@das-fed/upf-utils/common-info/type';
2
+
3
+ /** 等待获取到token */
4
+ export declare const tokenNextTick_1: () => Promise<string>;
5
+ /** 等待获取到projectId */
6
+ export declare const projectNextTick: () => Promise<string | number>;
7
+ /** 等待获取到token和projectId */
8
+ export declare const tokenNextTick: () => Promise<boolean>;
9
+ /** 等待获取到userInfo */
10
+ export declare const userInfoNextTick: () => Promise<PersonalInfo>;
11
+ /** 等待获取到租户信息 */
12
+ export declare const tenantInfoNextTick: () => Promise<TenantInfo>;
package/oss/es5.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const oss: (urlName: any) => any;
2
+ export { oss };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/upf-utils",
3
- "version": "6.4.0-hot.12",
3
+ "version": "6.4.0-hot.14",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -9,6 +9,7 @@
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
+ "@das-fed/mframe": "0.0.47",
12
13
  "@vue/shared": "^3.4.21",
13
14
  "@vueuse/core": "^9.6.0",
14
15
  "axios": "^1.6.7",
@@ -21,8 +22,8 @@
21
22
  },
22
23
  "devDependencies": {
23
24
  "@babel/preset-env": "7.26.0",
24
- "@das-fed/upf-cli": "6.4.0-hot.12",
25
- "@das-fed/upf-web": "6.4.0-hot.12",
25
+ "@das-fed/upf-cli": "6.4.0-hot.14",
26
+ "@das-fed/upf-web": "6.4.0-hot.14",
26
27
  "@rollup/plugin-babel": "6.0.4",
27
28
  "@types/js-cookie": "^3.0.6",
28
29
  "@types/lodash-es": "^4.17.12",
@@ -0,0 +1,2 @@
1
+ /** 获取输入内容中的中文拼音首字符,如:汉字 --> hz; test汉字拼音test --> hzpy */
2
+ export declare const getPinyinFirstCharacter: (value: string) => any;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 子应用存储流程引擎需要的token信息
3
+ * @param data token信息
4
+ */
5
+ export declare const setProcessEngineToken: (data: Record<any, any>) => void;
6
+ /** 移除流程引擎token */
7
+ export declare const removeProcessEngineToken: () => void;
8
+ /**
9
+ * 子应用存储流程引擎需要的项目信息
10
+ * @param projectId 项目id
11
+ */
12
+ export declare const setProcessEngineProject: (projectId: string) => void;
13
+ export declare const removeProcessEngineProject: () => void;
@@ -0,0 +1,2 @@
1
+ declare const pureImageSrc: (url: string) => any;
2
+ export { pureImageSrc };
@@ -0,0 +1,6 @@
1
+ declare const SizeWatcher: (cb: (e: DOMRectReadOnly) => any, dom?: HTMLElement | null) => ResizeObserver;
2
+ declare const useSizeWatcher: () => {
3
+ el: any;
4
+ rect: any;
5
+ };
6
+ export { SizeWatcher, useSizeWatcher };
package/style/es5.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { hasClass, addClass, removeClass, getStyle, getCSS, createStyle, updateStyle } from './style';
2
+ export { curringMath } from './math';
@@ -0,0 +1,42 @@
1
+ import { mixHexColor, toRgbaColor } from './color';
2
+ import { ThemeVariables } from './source-variables';
3
+
4
+ export type { ThemeVariables } from './source-variables';
5
+ export interface ThemeBridgeVariableResolveOptions {
6
+ themeName?: string;
7
+ basePresetName?: string;
8
+ }
9
+ export interface ThemeBridgeResolveContext<TVariables extends object = ThemeVariables> {
10
+ variables: TVariables;
11
+ result: Record<string, string>;
12
+ themeName?: string;
13
+ basePresetName?: string;
14
+ }
15
+ export interface ThemeBridgeVariableItem<TVariables extends object = ThemeVariables> {
16
+ target: string | readonly string[];
17
+ from?: keyof TVariables | string;
18
+ value?: string;
19
+ resolve?: (context: ThemeBridgeResolveContext<TVariables> & {
20
+ mixHexColor: typeof mixHexColor;
21
+ toRgbaColor: typeof toRgbaColor;
22
+ }) => string;
23
+ }
24
+ export interface RuntimeThemeVariableBuildOptions {
25
+ /** 是否写入 Element Plus 与 das-ui/das 历史兼容变量;默认 true。 */
26
+ includeElementAndDasUiBridges?: boolean;
27
+ /** 当前主题名,用于按预设差异化桥接局部组件 token。 */
28
+ themeName?: string;
29
+ /** 当前主题基础预设名,自定义主题可通过该字段继承预设差异。 */
30
+ basePresetName?: string;
31
+ }
32
+ export declare const normalizeRuntimeThemeSourceVariables: (variables: object) => any;
33
+ export declare const resolveThemeBridgeVariables: <TVariables extends object = ThemeVariables>(variables: TVariables, items: readonly ThemeBridgeVariableItem<TVariables>[], options?: ThemeBridgeVariableResolveOptions) => any;
34
+ export declare const LEGACY_THEME_BRIDGE_ITEMS: ThemeBridgeVariableItem[];
35
+ export declare const ELEMENT_THEME_BRIDGE_ITEMS: ThemeBridgeVariableItem[];
36
+ export declare const DAS_UI_THEME_BRIDGE_ITEMS: ThemeBridgeVariableItem[];
37
+ export declare const UPF_COMPONENT_THEME_BRIDGE_ITEMS: ThemeBridgeVariableItem[];
38
+ export declare const toLegacyThemeVariables: (variables: object, options?: ThemeBridgeVariableResolveOptions) => any;
39
+ export declare const toElementThemeVariables: (variables: object, options?: ThemeBridgeVariableResolveOptions) => any;
40
+ export declare const toDasUiColorOverrides: (variables: object, options?: ThemeBridgeVariableResolveOptions) => any;
41
+ export declare const toUpfComponentThemeVariables: (variables: object, options?: ThemeBridgeVariableResolveOptions) => any;
42
+ export declare const buildRuntimeThemeVariables: (variables: object, options?: RuntimeThemeVariableBuildOptions) => Record<string, string>;
@@ -0,0 +1,7 @@
1
+ declare const WHITE_COLOR = "#ffffff";
2
+ declare const BLACK_COLOR = "#000000";
3
+ export declare const normalizeHexColor: (color: string) => any;
4
+ export declare const mixHexColor: (foreground: string, background: string, foregroundWeight: number, fallback: string) => string;
5
+ export declare const toRgbaColor: (color: string, alpha: number, fallback: string) => string;
6
+ export declare const resolvePrimaryBgColor: (primaryColor: string, backgroundColor?: string) => string;
7
+ export { BLACK_COLOR, WHITE_COLOR };
package/theme/es5.d.ts ADDED
@@ -0,0 +1,94 @@
1
+ import { BUILTIN_PRESET_THEME_NAMES, PRESET_THEMES, BuiltinPresetThemeConfig, BuiltinPresetThemeName } from './presets';
2
+ import { RuntimeThemeVariableBuildOptions } from './bridge';
3
+ import { ThemeVariables } from './source-variables';
4
+
5
+ export { mixHexColor, normalizeHexColor, resolvePrimaryBgColor, toRgbaColor } from './color';
6
+ export { DAS_UI_THEME_BRIDGE_ITEMS, ELEMENT_THEME_BRIDGE_ITEMS, LEGACY_THEME_BRIDGE_ITEMS, UPF_COMPONENT_THEME_BRIDGE_ITEMS, buildRuntimeThemeVariables, resolveThemeBridgeVariables, toDasUiColorOverrides, toElementThemeVariables, toLegacyThemeVariables, toUpfComponentThemeVariables, } from './bridge';
7
+ export { PRESET_THEME_VARIABLES, THEME_SOURCE_VARIABLE_CATEGORIES, THEME_SOURCE_VARIABLE_HINTS, THEME_SOURCE_VARIABLE_LABELS, THEME_SOURCE_VARIABLE_META, THEME_SOURCE_VARIABLE_NAMES, THEME_SOURCE_VARIABLE_RELATIONS, getThemeSourceVariableCategories, getThemeSourceVariableHints, getThemeSourceVariableLabels, getThemeSourceVariableNames, getThemeSourceVariableRelations, normalizeThemeSourceVariables, } from './source-variables';
8
+ export type { RuntimeThemeVariableBuildOptions, ThemeBridgeResolveContext, ThemeBridgeVariableItem, ThemeBridgeVariableResolveOptions, } from './bridge';
9
+ export type { BuiltinPresetThemeName, PartialThemeVariables, ThemeMode, ThemeSourceVariableMeta, ThemeSourceVariableName, ThemeVariableCategory, ThemeVariableCategoryGroupKey, ThemeVariables, } from './source-variables';
10
+ type ThemeVariableSource = Record<string, string | undefined>;
11
+ export interface ThemeConfig {
12
+ name?: string;
13
+ basePresetName?: string;
14
+ variables?: ThemeVariableSource;
15
+ [key: string]: unknown;
16
+ }
17
+ export interface ThemeChangeEvent<TThemeName extends string = string, TVariables extends object = ThemeVariables> {
18
+ themeName: TThemeName;
19
+ config?: ThemeConfig | null;
20
+ variables: TVariables;
21
+ source?: 'change' | 'mountSync' | 'preview' | 'restore';
22
+ timestamp: number;
23
+ }
24
+ export interface ThemeBridgeAPI<TThemeName extends string = string, TVariables extends object = ThemeVariables> {
25
+ getCurrentTheme: () => ThemeChangeEvent<TThemeName, TVariables> | null;
26
+ getVariables?: () => TVariables | null;
27
+ changeTheme?: (themeName: TThemeName) => void;
28
+ onThemeChange?: (callback: (event: ThemeChangeEvent<TThemeName, TVariables>) => void) => () => void;
29
+ }
30
+ export interface DefaultThemeStyleOptions extends ApplyThemeVariablesOptions {
31
+ /** 默认注入的预设主题名称。 */
32
+ presetName?: BuiltinPresetThemeName | string;
33
+ /** 未显式指定 presetName 时,是否读取本地主题缓存;默认 false。 */
34
+ useStoredTheme?: boolean;
35
+ /** 本地主题缓存 key;用于独立运行兜底时对齐主应用已保存主题。 */
36
+ storageKey?: string;
37
+ /** 默认主题 style 标签 id;用于手动注入时避免重复插入。 */
38
+ styleId?: string;
39
+ /** 已存在运行时主题变量时是否强制覆盖;默认 false。 */
40
+ force?: boolean;
41
+ /** 是否写入 data-theme/data-skin;默认 true,mframe 自动兜底可关闭避免误标记。 */
42
+ setThemeAttributes?: boolean;
43
+ }
44
+ export interface ApplyThemeVariablesOptions {
45
+ /** 写入目标节点;默认当前文档 html。 */
46
+ root?: HTMLElement | null;
47
+ /** 是否生成运行时桥接变量;false 时仅写入源变量。 */
48
+ includeBridges?: boolean;
49
+ /** 是否写入 Element Plus 与 das-ui/das 历史兼容变量;默认 true。 */
50
+ includeElementAndDasUiBridges?: boolean;
51
+ /** 写入 data-theme 的主题名。 */
52
+ themeName?: string;
53
+ /** 当前主题基础预设名,用于自定义主题继承预设差异化 token。 */
54
+ basePresetName?: string;
55
+ /** 写入 data-skin 的皮肤名;传 null 时移除。 */
56
+ skinName?: string | null;
57
+ }
58
+ export interface ThemePullOptions extends ApplyThemeVariablesOptions {
59
+ /** 是否输出主题同步警告日志。 */
60
+ debug?: boolean;
61
+ }
62
+ export interface SubAppThemeSyncOptions extends ThemePullOptions {
63
+ /** 初始化时是否立即从宿主拉取当前主题。 */
64
+ syncOnInit?: boolean;
65
+ /** 是否优先使用 window.__THEME_API__ 订阅。 */
66
+ preferWindowSubscription?: boolean;
67
+ /** 后续真实主题切换后的回调,不包含 mountSync。 */
68
+ onThemeChange?: (event: ThemeChangeEvent) => void;
69
+ }
70
+ export type HostThemeRootSyncOptions = SubAppThemeSyncOptions;
71
+ export { BUILTIN_PRESET_THEME_NAMES, PRESET_THEMES };
72
+ export declare const getPresetTheme: (themeName: string) => any;
73
+ export declare const getAllPresetThemes: () => any;
74
+ export declare const getDefaultPresetTheme: () => BuiltinPresetThemeConfig;
75
+ export declare const getDefaultThemeVariables: () => any;
76
+ export declare const buildPresetThemeCssText: (presetName?: string, options?: RuntimeThemeVariableBuildOptions) => string;
77
+ export declare const buildDefaultThemeCssText: (options?: RuntimeThemeVariableBuildOptions) => string;
78
+ export declare const ensureDefaultThemeStyle: (options?: DefaultThemeStyleOptions) => any;
79
+ export declare const getHostThemeSnapshotFromWindowName: (debug?: boolean) => ThemeChangeEvent | null;
80
+ export declare const applyThemeVariablesToDocument: (variables: object, options?: ApplyThemeVariablesOptions) => any;
81
+ export declare const applyThemeEventToDocument: (event: ThemeChangeEvent, options?: ApplyThemeVariablesOptions) => any;
82
+ export declare const getThemeAPI: (debug?: boolean) => ThemeBridgeAPI | null;
83
+ export declare const getCurrentTheme: (options?: ThemePullOptions) => ThemeChangeEvent<string, Record<import('./source-variables').ThemeSourceVariableName, string>>;
84
+ export declare const getThemeVariables: (options?: ThemePullOptions) => any;
85
+ export declare const changeTheme: (themeName: string, debug?: boolean) => boolean;
86
+ export declare const syncThemeFromHost: (options?: ThemePullOptions) => ThemeChangeEvent<string, Record<import('./source-variables').ThemeSourceVariableName, string>>;
87
+ export declare const syncHostThemeRoot: (options?: ThemePullOptions) => ThemeChangeEvent | null;
88
+ export declare const initSubAppThemeSync: (options?: SubAppThemeSyncOptions) => () => void;
89
+ export declare const initHostThemeRootSync: (options?: HostThemeRootSyncOptions) => () => void;
90
+ export declare const getThemeVariable: (varName: string, root?: HTMLElement | null) => any;
91
+ export declare const getVar: (key?: string) => string;
92
+ export declare const getVarValue: (key?: string, root?: HTMLElement | null) => {
93
+ value: any;
94
+ };