@das-fed/utils 1.0.1 → 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 (131) hide show
  1. package/api-services/index.d.ts +1 -0
  2. package/api-services/index.js +3 -19845
  3. package/api-services/modules/app-manage.d.ts +2 -0
  4. package/api-services/modules/app-manage.js +5 -6
  5. package/api-services/modules/authentication.d.ts +2 -0
  6. package/api-services/modules/authentication.js +5 -6
  7. package/api-services/modules/bems.d.ts +6 -0
  8. package/api-services/modules/bems.js +8 -10
  9. package/api-services/modules/contract.d.ts +2 -0
  10. package/api-services/modules/contract.js +5 -6
  11. package/api-services/modules/duty-manage.d.ts +7 -0
  12. package/api-services/modules/duty-manage.js +9 -10
  13. package/api-services/modules/enterpriseright.d.ts +2 -0
  14. package/api-services/modules/enterpriseright.js +5 -6
  15. package/api-services/modules/file.d.ts +36 -0
  16. package/api-services/modules/file.js +449 -354
  17. package/api-services/modules/gateway-edge.d.ts +2 -0
  18. package/api-services/modules/gateway-edge.js +5 -6
  19. package/api-services/modules/index.d.ts +21 -0
  20. package/api-services/modules/index.js +501 -435
  21. package/api-services/modules/iot.d.ts +15 -0
  22. package/api-services/modules/iot.js +17 -18
  23. package/api-services/modules/justauth.d.ts +3 -0
  24. package/api-services/modules/justauth.js +6 -7
  25. package/api-services/modules/knowledge.d.ts +2 -0
  26. package/api-services/modules/knowledge.js +5 -6
  27. package/api-services/modules/link.d.ts +2 -0
  28. package/api-services/modules/link.js +5 -6
  29. package/api-services/modules/permission.d.ts +2 -0
  30. package/api-services/modules/permission.js +5 -6
  31. package/api-services/modules/platformManage.d.ts +14 -0
  32. package/api-services/modules/platformManage.js +12 -13
  33. package/api-services/modules/portal.d.ts +2 -0
  34. package/api-services/modules/portal.js +5 -6
  35. package/api-services/modules/space-manage.d.ts +2 -0
  36. package/api-services/modules/space-manage.js +5 -6
  37. package/api-services/modules/super-admin.d.ts +8 -0
  38. package/api-services/modules/super-admin.js +8 -9
  39. package/api-services/modules/supplier.d.ts +6 -0
  40. package/api-services/modules/supplier.js +7 -8
  41. package/api-services/modules/supplychain-manage.d.ts +2 -0
  42. package/api-services/modules/supplychain-manage.js +5 -6
  43. package/api-services/modules/systemConfiguration.d.ts +2 -0
  44. package/api-services/modules/systemConfiguration.js +5 -6
  45. package/api-services/modules/tool.d.ts +2 -0
  46. package/api-services/modules/tool.js +5 -6
  47. package/api-services/src/create-service.d.ts +2 -0
  48. package/api-services/src/create-service.js +3119 -19726
  49. package/api-services/src/sso.d.ts +29 -0
  50. package/api-services/src/sso.js +1547 -156
  51. package/api-services/src/util.d.ts +1 -0
  52. package/api-services/src/util.js +1462 -19
  53. package/atob/index.d.ts +2 -0
  54. package/atob/index.js +9 -10
  55. package/common-info/getIframeUrl.d.ts +9 -0
  56. package/common-info/getIframeUrl.js +9 -11
  57. package/common-info/index.d.ts +42 -0
  58. package/common-info/index.js +138 -272
  59. package/common-info/setInfoFromUrl.d.ts +8 -0
  60. package/common-info/setInfoFromUrl.js +60 -128
  61. package/common-tools/arr-tools.d.ts +15 -0
  62. package/common-tools/arr-tools.js +6 -13
  63. package/common-tools/date-format.d.ts +7 -0
  64. package/common-tools/date-format.js +18 -21
  65. package/common-tools/get-url-params.d.ts +33 -0
  66. package/common-tools/get-url-params.js +48 -88
  67. package/common-tools/handle-data.d.ts +6 -0
  68. package/common-tools/handle-data.js +3 -4
  69. package/common-tools/index.d.ts +7 -0
  70. package/common-tools/index.js +7 -213
  71. package/common-tools/nest-tree-format.d.ts +30 -0
  72. package/common-tools/nest-tree-format.js +22 -49
  73. package/common-tools/obj-tools.d.ts +7 -0
  74. package/common-tools/obj-tools.js +17 -18
  75. package/common-tools/setHtmlMinWH.d.ts +5 -0
  76. package/common-tools/setHtmlMinWH.js +6 -10
  77. package/common-tools/throttled.d.ts +7 -0
  78. package/common-tools/throttled.js +7 -16
  79. package/config/index.d.ts +2 -0
  80. package/config/index.js +8 -25
  81. package/curring-http/index.d.ts +11 -0
  82. package/curring-http/index.js +5150 -17289
  83. package/directive/auth.d.ts +8 -0
  84. package/directive/auth.js +54 -104
  85. package/directive/clickOutside.d.ts +5 -0
  86. package/directive/clickOutside.js +23 -49
  87. package/directive/hoverInside.d.ts +5 -0
  88. package/directive/hoverInside.js +16 -35
  89. package/directive/index.d.ts +3 -0
  90. package/directive/index.js +7 -182
  91. package/directive/utils.d.ts +7 -0
  92. package/directive/utils.js +6 -11
  93. package/dom-check-in/index.d.ts +6 -0
  94. package/dom-check-in/index.js +7 -15
  95. package/dom-watcher/index.d.ts +25 -0
  96. package/dom-watcher/index.js +7 -8
  97. package/hooks/popup-manager/use-zindex.d.ts +5 -0
  98. package/hooks/popup-manager/use-zindex.js +17 -36
  99. package/index.d.ts +2 -0
  100. package/index.js +2 -215
  101. package/load-js/index.d.ts +3 -0
  102. package/load-js/index.js +10 -20
  103. package/oss/index.d.ts +2 -0
  104. package/oss/index.js +11 -15
  105. package/package.json +8 -13
  106. package/pinyin-first-character/index.d.ts +2 -0
  107. package/pinyin-first-character/index.js +25011 -12217
  108. package/process-engine-info/index.d.ts +10 -0
  109. package/process-engine-info/index.js +8 -10
  110. package/pure-image-src/index.d.ts +2 -0
  111. package/pure-image-src/index.js +3 -29
  112. package/set-personal-info/index.d.ts +5 -0
  113. package/set-personal-info/index.js +1460 -16
  114. package/size-watcher/index.d.ts +6 -0
  115. package/size-watcher/index.js +17 -24
  116. package/style/index.d.ts +2 -0
  117. package/style/index.js +62 -103
  118. package/style/math.d.ts +9 -0
  119. package/style/math.js +16 -31
  120. package/style/style.d.ts +30 -0
  121. package/style/style.js +49 -72
  122. package/token-tools/index.d.ts +18 -0
  123. package/token-tools/index.js +72 -149
  124. package/vue/hooks/use-model-value.d.ts +3 -0
  125. package/vue/hooks/use-model-value.js +9 -10
  126. package/vue/index.d.ts +1 -0
  127. package/vue/index.js +3 -10
  128. package/webSocket-service/index.d.ts +40 -0
  129. package/webSocket-service/index.js +62 -138
  130. package/with-install/index.d.ts +10 -0
  131. package/with-install/index.js +5 -7
@@ -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 };
@@ -1,27 +1,20 @@
1
- import { ref, onMounted } from 'vue';
2
-
3
- const SizeWatcher = (cb, dom) => {
4
- const watchDom = dom || document.documentElement;
5
- const objResizeObserver = new ResizeObserver((entries) => {
6
- const entry = entries[0];
7
- cb(entry.contentRect);
1
+ import { ref as r, onMounted as u } from "vue";
2
+ const i = (e, t) => {
3
+ const n = t || document.documentElement, o = new ResizeObserver((c) => {
4
+ const s = c[0];
5
+ e(s.contentRect);
8
6
  });
9
- if (dom !== null)
10
- objResizeObserver.observe(watchDom);
11
- return objResizeObserver;
12
- };
13
- const useSizeWatcher = () => {
14
- const el = ref(null);
15
- const rect = ref({ bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0, toJSON: () => {
7
+ return t !== null && o.observe(n), o;
8
+ }, h = () => {
9
+ const e = r(null), t = r({ bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0, toJSON: () => {
16
10
  } });
17
- onMounted(() => {
18
- SizeWatcher((val) => {
19
- rect.value = val;
20
- }, el.value);
21
- if (!el.value)
22
- return;
23
- });
24
- return { el, rect };
11
+ return u(() => {
12
+ i((n) => {
13
+ t.value = n;
14
+ }, e.value), e.value;
15
+ }), { el: e, rect: t };
16
+ };
17
+ export {
18
+ i as SizeWatcher,
19
+ h as useSizeWatcher
25
20
  };
26
-
27
- export { SizeWatcher, useSizeWatcher };
@@ -0,0 +1,2 @@
1
+ export { hasClass, addClass, removeClass, getStyle, getCSS, createStyle, updateStyle } from './style';
2
+ export { curringMath } from './math';
package/style/index.js CHANGED
@@ -3,113 +3,72 @@
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
-
7
- !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
8
- !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
9
- const cacheStringFunction = (fn) => {
10
- const cache = /* @__PURE__ */ Object.create(null);
11
- return (str) => {
12
- const hit = cache[str];
13
- return hit || (cache[str] = fn(str));
14
- };
15
- };
16
- const camelizeRE = /-(\w)/g;
17
- const camelize = cacheStringFunction((str) => {
18
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
19
- });
20
-
21
- const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
22
- const hasClass = (el, cls) => {
23
- if (!el || !cls)
24
- return false;
25
- if (cls.includes(" "))
6
+ process.env.NODE_ENV !== "production" && Object.freeze({});
7
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
8
+ const u = (t) => {
9
+ const e = /* @__PURE__ */ Object.create(null);
10
+ return (r) => e[r] || (e[r] = t(r));
11
+ }, m = /-(\w)/g, p = u((t) => t.replace(m, (e, r) => r ? r.toUpperCase() : "")), a = (t = "") => t.split(" ").filter((e) => !!e.trim()), h = (t, e) => {
12
+ if (!t || !e)
13
+ return !1;
14
+ if (e.includes(" "))
26
15
  throw new Error("className should not contain space.");
27
- return el.classList.contains(cls);
28
- };
29
- const addClass = (el, cls) => {
30
- if (!el || !cls.trim())
31
- return;
32
- el.classList.add(...classNameToArray(cls));
33
- };
34
- const removeClass = (el, cls) => {
35
- if (!el || !cls.trim())
36
- return;
37
- el.classList.remove(...classNameToArray(cls));
38
- };
39
- const getStyle = (element, styleName) => {
40
- if (!element || !styleName)
16
+ return t.classList.contains(e);
17
+ }, y = (t, e) => {
18
+ !t || !e.trim() || t.classList.add(...a(e));
19
+ }, g = (t, e) => {
20
+ !t || !e.trim() || t.classList.remove(...a(e));
21
+ }, N = (t, e) => {
22
+ if (!t || !e)
41
23
  return "";
42
- let key = camelize(styleName);
43
- if (key === "float")
44
- key = "cssFloat";
24
+ let r = p(e);
25
+ r === "float" && (r = "cssFloat");
45
26
  try {
46
- const style = element.style[key];
47
- if (style)
48
- return style;
49
- const computed = window?.getComputedStyle(element, "");
50
- return computed ? computed[key] : "";
27
+ const n = t.style[r];
28
+ if (n)
29
+ return n;
30
+ const s = window == null ? void 0 : window.getComputedStyle(t, "");
31
+ return s ? s[r] : "";
51
32
  } catch {
52
- return element.style[key];
33
+ return t.style[r];
53
34
  }
54
- };
55
- const getCSS = (styleObj = {}) => {
56
- return Object.keys(styleObj).map((key) => `${key}:${styleObj[key] !== "" ? styleObj[key] : '""'}`).join(";");
57
- };
58
- const createStyle = (id, data) => {
59
- if (document.getElementById(id))
60
- return;
61
- return new Promise((resolve, reject) => {
62
- const styleSheet = document.createElement("style");
63
- styleSheet.rel = "text/css";
64
- styleSheet.id = id;
65
- for (const item of data) {
66
- styleSheet.appendChild(document.createTextNode(`${item.className}{${getCSS(item.style)}}`));
67
- }
68
- const head = document.getElementsByTagName("head")[0];
69
- head.appendChild(styleSheet);
70
- styleSheet.onload = () => resolve("load success");
71
- styleSheet.onerror = () => reject("load error");
72
- });
73
- };
74
- const updateStyle = (id, data) => {
75
- const styleSheet = document.getElementById(id);
76
- if (styleSheet) {
77
- styleSheet.innerHTML = "";
78
- for (const item of data) {
79
- styleSheet.appendChild(document.createTextNode(`${item.className}{${getCSS(item.style)}}`));
80
- }
35
+ }, d = (t = {}) => Object.keys(t).map((e) => `${e}:${t[e] !== "" ? t[e] : '""'}`).join(";"), E = (t, e) => {
36
+ if (!document.getElementById(t))
37
+ return new Promise((r, n) => {
38
+ const s = document.createElement("style");
39
+ s.rel = "text/css", s.id = t;
40
+ for (const i of e)
41
+ s.appendChild(document.createTextNode(`${i.className}{${d(i.style)}}`));
42
+ document.getElementsByTagName("head")[0].appendChild(s), s.onload = () => r("load success"), s.onerror = () => n("load error");
43
+ });
44
+ }, S = (t, e) => {
45
+ const r = document.getElementById(t);
46
+ if (r) {
47
+ r.innerHTML = "";
48
+ for (const n of e)
49
+ r.appendChild(document.createTextNode(`${n.className}{${d(n.style)}}`));
81
50
  }
51
+ }, l = (t) => Number(t.toString().replace("px", "")), o = (t, e, r) => {
52
+ e = l(e), r = l(r);
53
+ let n;
54
+ return t === "add" && (n = e + r), t === "subtract" && (n = e - r), t === "multiply" && (n = e * r), t === "divide" && (n = e / r), e = null, r = null, n;
55
+ }, c = (t) => ({
56
+ add: (e) => c(o("add", t, e)),
57
+ subtract: (e) => c(o("subtract", t, e)),
58
+ multiply: (e) => c(o("multiply", t, e)),
59
+ divide: (e) => c(o("divide", t, e)),
60
+ res: () => {
61
+ const e = t + "px";
62
+ return t = null, e;
63
+ }
64
+ });
65
+ export {
66
+ y as addClass,
67
+ E as createStyle,
68
+ c as curringMath,
69
+ d as getCSS,
70
+ N as getStyle,
71
+ h as hasClass,
72
+ g as removeClass,
73
+ S as updateStyle
82
74
  };
83
-
84
- const px2number = (str) => Number(str.toString().replace("px", ""));
85
- const operation = (type, a, b) => {
86
- a = px2number(a);
87
- b = px2number(b);
88
- let res;
89
- if (type === "add")
90
- res = a + b;
91
- if (type === "subtract")
92
- res = a - b;
93
- if (type === "multiply")
94
- res = a * b;
95
- if (type === "divide")
96
- res = a / b;
97
- a = null;
98
- b = null;
99
- return res;
100
- };
101
- const curringMath = (a) => {
102
- return {
103
- add: (b) => curringMath(operation("add", a, b)),
104
- subtract: (b) => curringMath(operation("subtract", a, b)),
105
- multiply: (b) => curringMath(operation("multiply", a, b)),
106
- divide: (b) => curringMath(operation("divide", a, b)),
107
- res: () => {
108
- const res = a + "px";
109
- a = null;
110
- return res;
111
- }
112
- };
113
- };
114
-
115
- export { addClass, createStyle, curringMath, getCSS, getStyle, hasClass, removeClass, updateStyle };
@@ -0,0 +1,9 @@
1
+ /** css中px字符串的数学运算 */
2
+ declare const curringMath: (a: any) => {
3
+ add: (b: any) => any;
4
+ subtract: (b: any) => any;
5
+ multiply: (b: any) => any;
6
+ divide: (b: any) => any;
7
+ res: () => string;
8
+ };
9
+ export { curringMath };
package/style/math.js CHANGED
@@ -1,32 +1,17 @@
1
- const px2number = (str) => Number(str.toString().replace("px", ""));
2
- const operation = (type, a, b) => {
3
- a = px2number(a);
4
- b = px2number(b);
5
- let res;
6
- if (type === "add")
7
- res = a + b;
8
- if (type === "subtract")
9
- res = a - b;
10
- if (type === "multiply")
11
- res = a * b;
12
- if (type === "divide")
13
- res = a / b;
14
- a = null;
15
- b = null;
16
- return res;
1
+ const e = (t) => Number(t.toString().replace("px", "")), l = (t, r, i) => {
2
+ r = e(r), i = e(i);
3
+ let u;
4
+ return t === "add" && (u = r + i), t === "subtract" && (u = r - i), t === "multiply" && (u = r * i), t === "divide" && (u = r / i), r = null, i = null, u;
5
+ }, n = (t) => ({
6
+ add: (r) => n(l("add", t, r)),
7
+ subtract: (r) => n(l("subtract", t, r)),
8
+ multiply: (r) => n(l("multiply", t, r)),
9
+ divide: (r) => n(l("divide", t, r)),
10
+ res: () => {
11
+ const r = t + "px";
12
+ return t = null, r;
13
+ }
14
+ });
15
+ export {
16
+ n as curringMath
17
17
  };
18
- const curringMath = (a) => {
19
- return {
20
- add: (b) => curringMath(operation("add", a, b)),
21
- subtract: (b) => curringMath(operation("subtract", a, b)),
22
- multiply: (b) => curringMath(operation("multiply", a, b)),
23
- divide: (b) => curringMath(operation("divide", a, b)),
24
- res: () => {
25
- const res = a + "px";
26
- a = null;
27
- return res;
28
- }
29
- };
30
- };
31
-
32
- export { curringMath };
@@ -0,0 +1,30 @@
1
+ import type { CSSProperties } from 'vue';
2
+ export declare const classNameToArray: (cls?: string) => string[];
3
+ export declare const hasClass: (el: Element, cls: string) => boolean;
4
+ export declare const addClass: (el: Element, cls: string) => void;
5
+ export declare const removeClass: (el: Element, cls: string) => void;
6
+ /**
7
+ * 获取 CSS 属性的值
8
+ * @param element dom元素
9
+ * @param styleName css prop
10
+ * @returns
11
+ */
12
+ export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
13
+ /**
14
+ * 根据style对象获取style文本进行设置
15
+ * @param {CSSStyleDeclaration} styleObj -样式对象
16
+ */
17
+ export declare const getCSS: (styleObj?: {}) => string;
18
+ /**
19
+ * 创建样式表
20
+ * @param {string} id 样式表id
21
+ * @param {[{className:string, style: CSSStyleDeclaration}]} data 样式对象
22
+ */
23
+ declare const createStyle: (id: string, data: any) => Promise<unknown>;
24
+ /**
25
+ * 修改指定样式表
26
+ * @param id 样式表id
27
+ * @param data 样式对象
28
+ */
29
+ declare const updateStyle: (id: string, data: any) => void;
30
+ export { createStyle, updateStyle };
package/style/style.js CHANGED
@@ -3,82 +3,59 @@
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
-
7
- !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
8
- !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
9
- const cacheStringFunction = (fn) => {
10
- const cache = /* @__PURE__ */ Object.create(null);
11
- return (str) => {
12
- const hit = cache[str];
13
- return hit || (cache[str] = fn(str));
14
- };
15
- };
16
- const camelizeRE = /-(\w)/g;
17
- const camelize = cacheStringFunction((str) => {
18
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
19
- });
20
-
21
- const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
22
- const hasClass = (el, cls) => {
23
- if (!el || !cls)
24
- return false;
25
- if (cls.includes(" "))
6
+ process.env.NODE_ENV !== "production" && Object.freeze({});
7
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
8
+ const i = (e) => {
9
+ const t = /* @__PURE__ */ Object.create(null);
10
+ return (n) => t[n] || (t[n] = e(n));
11
+ }, d = /-(\w)/g, l = i((e) => e.replace(d, (t, n) => n ? n.toUpperCase() : "")), c = (e = "") => e.split(" ").filter((t) => !!t.trim()), m = (e, t) => {
12
+ if (!e || !t)
13
+ return !1;
14
+ if (t.includes(" "))
26
15
  throw new Error("className should not contain space.");
27
- return el.classList.contains(cls);
28
- };
29
- const addClass = (el, cls) => {
30
- if (!el || !cls.trim())
31
- return;
32
- el.classList.add(...classNameToArray(cls));
33
- };
34
- const removeClass = (el, cls) => {
35
- if (!el || !cls.trim())
36
- return;
37
- el.classList.remove(...classNameToArray(cls));
38
- };
39
- const getStyle = (element, styleName) => {
40
- if (!element || !styleName)
16
+ return e.classList.contains(t);
17
+ }, p = (e, t) => {
18
+ !e || !t.trim() || e.classList.add(...c(t));
19
+ }, f = (e, t) => {
20
+ !e || !t.trim() || e.classList.remove(...c(t));
21
+ }, h = (e, t) => {
22
+ if (!e || !t)
41
23
  return "";
42
- let key = camelize(styleName);
43
- if (key === "float")
44
- key = "cssFloat";
24
+ let n = l(t);
25
+ n === "float" && (n = "cssFloat");
45
26
  try {
46
- const style = element.style[key];
47
- if (style)
48
- return style;
49
- const computed = window?.getComputedStyle(element, "");
50
- return computed ? computed[key] : "";
27
+ const o = e.style[n];
28
+ if (o)
29
+ return o;
30
+ const r = window == null ? void 0 : window.getComputedStyle(e, "");
31
+ return r ? r[n] : "";
51
32
  } catch {
52
- return element.style[key];
33
+ return e.style[n];
53
34
  }
54
- };
55
- const getCSS = (styleObj = {}) => {
56
- return Object.keys(styleObj).map((key) => `${key}:${styleObj[key] !== "" ? styleObj[key] : '""'}`).join(";");
57
- };
58
- const createStyle = (id, data) => {
59
- if (document.getElementById(id))
60
- return;
61
- return new Promise((resolve, reject) => {
62
- const styleSheet = document.createElement("style");
63
- styleSheet.rel = "text/css";
64
- styleSheet.id = id;
65
- for (const item of data) {
66
- styleSheet.appendChild(document.createTextNode(`${item.className}{${getCSS(item.style)}}`));
67
- }
68
- const head = document.getElementsByTagName("head")[0];
69
- head.appendChild(styleSheet);
70
- styleSheet.onload = () => resolve("load success");
71
- styleSheet.onerror = () => reject("load error");
72
- });
73
- };
74
- const updateStyle = (id, data) => {
75
- const styleSheet = document.getElementById(id);
76
- if (styleSheet) {
77
- styleSheet.innerHTML = "";
78
- for (const item of data) {
79
- styleSheet.appendChild(document.createTextNode(`${item.className}{${getCSS(item.style)}}`));
80
- }
35
+ }, a = (e = {}) => Object.keys(e).map((t) => `${t}:${e[t] !== "" ? e[t] : '""'}`).join(";"), y = (e, t) => {
36
+ if (!document.getElementById(e))
37
+ return new Promise((n, o) => {
38
+ const r = document.createElement("style");
39
+ r.rel = "text/css", r.id = e;
40
+ for (const s of t)
41
+ r.appendChild(document.createTextNode(`${s.className}{${a(s.style)}}`));
42
+ document.getElementsByTagName("head")[0].appendChild(r), r.onload = () => n("load success"), r.onerror = () => o("load error");
43
+ });
44
+ }, E = (e, t) => {
45
+ const n = document.getElementById(e);
46
+ if (n) {
47
+ n.innerHTML = "";
48
+ for (const o of t)
49
+ n.appendChild(document.createTextNode(`${o.className}{${a(o.style)}}`));
81
50
  }
82
51
  };
83
-
84
- export { addClass, classNameToArray, createStyle, getCSS, getStyle, hasClass, removeClass, updateStyle };
52
+ export {
53
+ p as addClass,
54
+ c as classNameToArray,
55
+ y as createStyle,
56
+ a as getCSS,
57
+ h as getStyle,
58
+ m as hasClass,
59
+ f as removeClass,
60
+ E as updateStyle
61
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 获取token,顺便处理cookie中赋值到sessionStorage的需求
3
+ * @returns
4
+ */
5
+ export declare const getAccessToken: () => any;
6
+ /**
7
+ * 获取token详情
8
+ */
9
+ export declare const getAccessTokenInfo: () => any;
10
+ /**
11
+ * 存入cookie
12
+ * @param token
13
+ */
14
+ export declare const setAccessToken: (token: string, info?: any) => void;
15
+ /**
16
+ * 删除cookie中的token
17
+ */
18
+ export declare const removeAccessToken: () => void;