@witlink/components 0.0.4 → 1.0.0

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.
package/dist/utils.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=Object.prototype.toString;function i(e,n){return M.call(e)===`[object ${n}]`}function d(e){return i(e,"Function")}const U=e=>typeof e<"u",O=e=>!U(e),b=e=>e!==null&&i(e,"Object");function L(e){return i(e,"Date")}function v(e){return i(e,"Number")}function F(e){return i(e,"AsyncFunction")}function K(e){return i(e,"Promise")&&d(e.then)&&d(e.catch)}function k(e){return i(e,"String")}function J(e){return i(e,"Boolean")}function B(e){return e&&Array.isArray(e)}const R=()=>typeof window<"u",D=e=>typeof window<"u"&&i(e,"Window"),W=e=>b(e)&&!!e.tagName,_=typeof window>"u";function Y(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function N(e){return e===null}function x(e){return O(e)||N(e)}function $(e,n){if(e&&typeof e=="object"){const r=window.URL.createObjectURL(new Blob([e])),t=document.createElement("a");t.style.display="none",t.href=r,t.setAttribute("download",n),document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(r)}}function w(e,n){e.forEach(r=>{n(r),Array.isArray(r.children)&&w(r.children,n)})}function G(e,n){n=Object.assign({id:"id",parentId:"parentId",children:"children",root:""},n);const{id:r,parentId:t,children:s,root:c}=n,p=JSON.parse(JSON.stringify(e));return p.filter(m=>{const y=p.filter(j=>m[r]===j[t]);return m[s]=y.length>0?y:null,m[t]===c})||e}const E="Witlink-Usercenter-QureyParams";function u(){const e=localStorage.getItem(E)||"{}",{token:n,lang:r,usercenterUrl:t}=JSON.parse(e);return{token:n,lang:r,usercenterUrl:t}}function q(e){const n=u();localStorage.setItem(E,JSON.stringify({...n,...e}))}function z(){const e=window.location.href,n={},r=e.split("?")[1];return r&&r.split("&").forEach(t=>{const[s,c]=t.split("=");s&&c&&(n[s]=decodeURIComponent(c))}),n}const C="Witlink-Usercenter";function Q(){const{usercenterUrl:e}=u();window.location.href=e}function X(){window.open(u().usercenterUrl,C),window.close()}const H="",l="ACCESS_TOKEN",f="locale",h="userInfo",I="menuInfo";function V(e){const n=new URL(e);return n.hash&&n.hash.startsWith("#/")?`/${n.hash.substring(2).split("?")[0]}`.replace(/\/+/g,"/"):n.pathname}function P(e,n={}){const r=Array.isArray(e)?e:[e];for(const t of r){if(t.path&&t.name!==void 0){const s=t.path.startsWith("/")?t.path:`/${t.path}`;n[s]=t.name.toString()}t.children&&t.children.length>0&&P(t.children,n)}return n}function o(e){return H+e}function Z(e){localStorage.setItem(o(l),e)}function ee(){return localStorage.getItem(o(l))}function ne(){localStorage.removeItem(o(l))}function te(e){localStorage.setItem(o(f),e)}function re(){return localStorage.getItem(o(f))}function oe(){localStorage.removeItem(o(f))}function se(e={}){e={...S()||{},...e},localStorage.setItem(o(h),JSON.stringify(e))}function S(e){const n=localStorage.getItem(o(h));if(e){if(typeof e=="string")return(n?JSON.parse(n):{})[e]||null;if(Array.isArray(e)){const r=n?JSON.parse(n):{},t={};return e.forEach(s=>{t[s]=r[s]||null}),t}}return n?JSON.parse(n):null}function ie(e){localStorage.setItem(o(I),JSON.stringify(e))}function A(){const e=localStorage.getItem(o(I));return e?JSON.parse(e):null}const g={},a={};function ce(){if(Object.keys(g).length===0){const e=A()||[];P(e,g)}return g}function T(){return Object.keys(a).length===0&&((S()||{}).role.permissions||[]).forEach(r=>{var t;if(r.actionEntitySet!=null&&((t=r.actionEntitySet)==null?void 0:t.length)>0){const s=r.actionEntitySet.map(c=>c.action);a[r.permissionId]=s}}),a}function ae(e){const n=T(),r=V(window.location.href),s=ce()[r]||"";return(n[s]||[]).includes(e)}function ue(){localStorage.removeItem(o(h)),localStorage.removeItem(o(I)),localStorage.removeItem(o(l)),localStorage.removeItem(o(f))}exports.UserCenterKey=C;exports.buildTree=G;exports.exportFile=$;exports.forEachTree=w;exports.getButtonPermissions=T;exports.getLocale=re;exports.getMenuInfo=A;exports.getToken=ee;exports.getUserCenterParams=u;exports.getUserCenterParamsByUrl=z;exports.getUserInfo=S;exports.hasPermission=ae;exports.is=i;exports.isArray=B;exports.isAsyncFunction=F;exports.isBoolean=J;exports.isClient=R;exports.isDate=L;exports.isDef=U;exports.isElement=W;exports.isFunction=d;exports.isImageDom=Y;exports.isNull=N;exports.isNullOrUndef=x;exports.isNumber=v;exports.isObject=b;exports.isPromise=K;exports.isServer=_;exports.isString=k;exports.isUndef=O;exports.isWindow=D;exports.logoutToUserCenter=X;exports.removeAll=ue;exports.removeLocale=oe;exports.removeToken=ne;exports.setLocale=te;exports.setMenuInfo=ie;exports.setToken=Z;exports.setUserCenterParams=q;exports.setUserInfo=se;exports.toUserCenterConsole=Q;
package/dist/utils.d.ts CHANGED
@@ -1,130 +1,141 @@
1
1
  /**
2
- * 下载文件
3
- */
4
- export declare function exportFile(options: {
5
- fileData: any;
6
- name: string;
7
- }): void;
2
+ * 构造树型结构数据
3
+ * @param arr 数据源
4
+ * @param options { id: "id", parentId: "parentId", children: "children", root: "" }
5
+ */
6
+ export declare function buildTree(arr: any, options?: any): any;
8
7
 
9
- export declare function getButtonPermissions(): any;
8
+ /**
9
+ * 下载文件
10
+ */
11
+ export declare function exportFile(fileData: any, fileName: string): void;
10
12
 
11
- export declare function getLocale(): string | null;
13
+ /**
14
+ * 遍历树结构数据
15
+ * @param treeData 树型数据
16
+ * @param fn 回调方法
17
+ */
18
+ export declare function forEachTree<T>(treeData: Array<T>, fn: (item: T) => void): void;
12
19
 
13
- export declare function getMenuInfo(): any;
20
+ export declare function getButtonPermissions(): any;
14
21
 
15
- export declare function getToken(): string | null;
22
+ export declare function getLocale(): string | null;
16
23
 
17
- export declare function getUserCenterParams(): UserCenterParams;
24
+ export declare function getMenuInfo(): any;
18
25
 
19
- export declare function getUserCenterParamsByUrl(): Record<string, string>;
26
+ export declare function getToken(): string | null;
20
27
 
21
- export declare function getUserInfo(key?: string | Array<string> | null): any;
28
+ export declare function getUserCenterParams(): UserCenterParams;
22
29
 
23
- export declare function hasPermission(id: string): boolean;
30
+ export declare function getUserCenterParamsByUrl(): Record<string, string>;
24
31
 
25
- /**
26
- * @description: 判断值是否未某个类型
27
- */
28
- export declare function is(val: unknown, type: string): boolean;
32
+ export declare function getUserInfo(key?: string | Array<string> | null): any;
29
33
 
30
- /**
31
- * @description: 是否为数组
32
- */
33
- export declare function isArray(val: any): val is Array<any>;
34
+ export declare function hasPermission(id: string): boolean;
34
35
 
35
- /**
36
- * @description: 是否为AsyncFunction
37
- */
38
- export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
36
+ /**
37
+ * @description: 判断值是否未某个类型
38
+ */
39
+ export declare function is(val: unknown, type: string): boolean;
39
40
 
40
- /**
41
- * @description: 是否为boolean类型
42
- */
43
- export declare function isBoolean(val: unknown): val is boolean;
41
+ /**
42
+ * @description: 是否为数组
43
+ */
44
+ export declare function isArray(val: any): val is Array<any>;
44
45
 
45
- /**
46
- * @description: 是否客户端
47
- */
48
- export declare const isClient: () => boolean;
46
+ /**
47
+ * @description: 是否为AsyncFunction
48
+ */
49
+ export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
49
50
 
50
- /**
51
- * @description: 是否为时间
52
- */
53
- export declare function isDate(val: unknown): val is Date;
51
+ /**
52
+ * @description: 是否为boolean类型
53
+ */
54
+ export declare function isBoolean(val: unknown): val is boolean;
54
55
 
55
- /**
56
- * @description: 是否已定义
57
- */
58
- export declare const isDef: <T = unknown>(val?: T) => val is T;
56
+ /**
57
+ * @description: 是否客户端
58
+ */
59
+ export declare const isClient: () => boolean;
59
60
 
60
- export declare const isElement: (val: unknown) => val is Element;
61
+ /**
62
+ * @description: 是否为时间
63
+ */
64
+ export declare function isDate(val: unknown): val is Date;
61
65
 
62
- /**
63
- * @description: 是否为函数
64
- */
65
- export declare function isFunction<T = Function>(val: unknown): val is T;
66
+ /**
67
+ * @description: 是否已定义
68
+ */
69
+ export declare const isDef: <T = unknown>(val?: T) => val is T;
66
70
 
67
- export declare function isImageDom(o: Element): boolean;
71
+ export declare const isElement: (val: unknown) => val is Element;
68
72
 
69
- export declare function isNull(val: unknown): val is null;
73
+ /**
74
+ * @description: 是否为函数
75
+ */
76
+ export declare function isFunction<T = Function>(val: unknown): val is T;
70
77
 
71
- export declare function isNullOrUndef(val: unknown): val is null | undefined;
78
+ export declare function isImageDom(o: Element): boolean;
72
79
 
73
- /**
74
- * @description: 是否为数值
75
- */
76
- export declare function isNumber(val: unknown): val is number;
80
+ export declare function isNull(val: unknown): val is null;
77
81
 
78
- /**
79
- * @description: 是否为对象
80
- */
81
- export declare const isObject: (val: any) => val is Record<any, any>;
82
+ export declare function isNullOrUndef(val: unknown): val is null | undefined;
82
83
 
83
- /**
84
- * @description: 是否为promise
85
- */
86
- export declare function isPromise<T = any>(val: any): val is Promise<T>;
84
+ /**
85
+ * @description: 是否为数值
86
+ */
87
+ export declare function isNumber(val: unknown): val is number;
87
88
 
88
- export declare const isServer: boolean;
89
+ /**
90
+ * @description: 是否为对象
91
+ */
92
+ export declare const isObject: (val: any) => val is Record<any, any>;
89
93
 
90
- /**
91
- * @description: 是否为字符串
92
- */
93
- export declare function isString(val: unknown): val is string;
94
+ /**
95
+ * @description: 是否为promise
96
+ */
97
+ export declare function isPromise<T = any>(val: any): val is Promise<T>;
94
98
 
95
- export declare const isUndef: <T = unknown>(val?: T) => val is T;
99
+ export declare const isServer: boolean;
96
100
 
97
- /**
98
- * @description: 是否为浏览器
99
- */
100
- export declare const isWindow: (val: any) => val is Window;
101
+ /**
102
+ * @description: 是否为字符串
103
+ */
104
+ export declare function isString(val: unknown): val is string;
105
+
106
+ export declare const isUndef: <T = unknown>(val?: T) => val is T;
107
+
108
+ /**
109
+ * @description: 是否为浏览器
110
+ */
111
+ export declare const isWindow: (val: any) => val is Window;
101
112
 
102
- export declare function logoutToUserCenter(): void;
113
+ export declare function logoutToUserCenter(): void;
103
114
 
104
- export declare function removeAll(): void;
115
+ export declare function removeAll(): void;
105
116
 
106
- export declare function removeLocale(): void;
117
+ export declare function removeLocale(): void;
107
118
 
108
- export declare function removeToken(): void;
119
+ export declare function removeToken(): void;
109
120
 
110
- export declare function setLocale(locale: string): void;
121
+ export declare function setLocale(locale: string): void;
111
122
 
112
- export declare function setMenuInfo(menuInfo: any): void;
123
+ export declare function setMenuInfo(menuInfo: any): void;
113
124
 
114
- export declare function setToken(token: string): void;
125
+ export declare function setToken(token: string): void;
115
126
 
116
- export declare function setUserCenterParams(params: UserCenterParams): void;
127
+ export declare function setUserCenterParams(params: UserCenterParams): void;
117
128
 
118
- export declare function setUserInfo(userInfo?: any): void;
129
+ export declare function setUserInfo(userInfo?: any): void;
119
130
 
120
- export declare function toUserCenterConsole(): void;
131
+ export declare function toUserCenterConsole(): void;
121
132
 
122
- export declare const UserCenterKey = "Witlink-Usercenter";
133
+ export declare const UserCenterKey = "Witlink-Usercenter";
123
134
 
124
- export declare type UserCenterParams = {
125
- token?: string;
126
- lang?: string;
127
- usercenterUrl?: string;
128
- };
135
+ export declare type UserCenterParams = {
136
+ token?: string;
137
+ lang?: string;
138
+ usercenterUrl?: string;
139
+ };
129
140
 
130
- export { }
141
+ export { }
package/dist/utils.js CHANGED
@@ -1,199 +1,216 @@
1
- const y = Object.prototype.toString;
1
+ const N = Object.prototype.toString;
2
2
  function i(n, t) {
3
- return y.call(n) === `[object ${t}]`;
3
+ return N.call(n) === `[object ${t}]`;
4
4
  }
5
- function h(n) {
5
+ function S(n) {
6
6
  return i(n, "Function");
7
7
  }
8
- const U = (n) => typeof n < "u", w = (n) => !U(n), O = (n) => n !== null && i(n, "Object");
9
- function M(n) {
8
+ const b = (n) => typeof n < "u", E = (n) => !b(n), A = (n) => n !== null && i(n, "Object");
9
+ function v(n) {
10
10
  return i(n, "Date");
11
11
  }
12
- function L(n) {
12
+ function F(n) {
13
13
  return i(n, "Number");
14
14
  }
15
- function K(n) {
15
+ function k(n) {
16
16
  return i(n, "AsyncFunction");
17
17
  }
18
- function R(n) {
19
- return i(n, "Promise") && h(n.then) && h(n.catch);
18
+ function _(n) {
19
+ return i(n, "Promise") && S(n.then) && S(n.catch);
20
20
  }
21
- function v(n) {
21
+ function B(n) {
22
22
  return i(n, "String");
23
23
  }
24
- function F(n) {
24
+ function W(n) {
25
25
  return i(n, "Boolean");
26
26
  }
27
- function J(n) {
27
+ function D(n) {
28
28
  return n && Array.isArray(n);
29
29
  }
30
- const T = () => typeof window < "u", k = (n) => typeof window < "u" && i(n, "Window"), _ = (n) => O(n) && !!n.tagName, B = typeof window > "u";
31
- function W(n) {
30
+ const Y = () => typeof window < "u", x = (n) => typeof window < "u" && i(n, "Window"), $ = (n) => A(n) && !!n.tagName, G = typeof window > "u";
31
+ function q(n) {
32
32
  return n && ["IMAGE", "IMG"].includes(n.tagName);
33
33
  }
34
- function N(n) {
34
+ function P(n) {
35
35
  return n === null;
36
36
  }
37
- function D(n) {
38
- return w(n) || N(n);
37
+ function z(n) {
38
+ return E(n) || P(n);
39
39
  }
40
- function Y(n) {
41
- const { fileData: t = null, name: o = "" } = n || {};
42
- if (t && typeof t == "object") {
43
- const e = window.URL.createObjectURL(new Blob([t])), r = document.createElement("a");
44
- r.style.display = "none", r.href = e, r.setAttribute("download", o), document.body.appendChild(r), r.click(), document.body.removeChild(r), window.URL.revokeObjectURL(e);
40
+ function Q(n, t) {
41
+ if (n && typeof n == "object") {
42
+ const o = window.URL.createObjectURL(new Blob([n])), e = document.createElement("a");
43
+ e.style.display = "none", e.href = o, e.setAttribute("download", t), document.body.appendChild(e), e.click(), document.body.removeChild(e), window.URL.revokeObjectURL(o);
45
44
  }
46
45
  }
47
- const p = "Witlink-Usercenter-QureyParams";
48
- function m() {
49
- const n = localStorage.getItem(p) || "{}", { token: t, lang: o, usercenterUrl: e } = JSON.parse(n);
46
+ function C(n, t) {
47
+ n.forEach((o) => {
48
+ t(o), Array.isArray(o.children) && C(o.children, t);
49
+ });
50
+ }
51
+ function X(n, t) {
52
+ t = Object.assign(
53
+ { id: "id", parentId: "parentId", children: "children", root: "" },
54
+ t
55
+ );
56
+ const { id: o, parentId: e, children: s, root: c } = t, p = JSON.parse(JSON.stringify(n));
57
+ return p.filter((f) => {
58
+ const I = p.filter((w) => f[o] === w[e]);
59
+ return f[s] = I.length > 0 ? I : null, f[e] === c;
60
+ }) || n;
61
+ }
62
+ const y = "Witlink-Usercenter-QureyParams";
63
+ function d() {
64
+ const n = localStorage.getItem(y) || "{}", { token: t, lang: o, usercenterUrl: e } = JSON.parse(n);
50
65
  return { token: t, lang: o, usercenterUrl: e };
51
66
  }
52
- function x(n) {
53
- const t = m();
67
+ function H(n) {
68
+ const t = d();
54
69
  localStorage.setItem(
55
- p,
70
+ y,
56
71
  JSON.stringify({ ...t, ...n })
57
72
  );
58
73
  }
59
- function $() {
74
+ function V() {
60
75
  const n = window.location.href, t = {}, o = n.split("?")[1];
61
76
  return o && o.split("&").forEach((e) => {
62
- const [r, c] = e.split("=");
63
- r && c && (t[r] = decodeURIComponent(c));
77
+ const [s, c] = e.split("=");
78
+ s && c && (t[s] = decodeURIComponent(c));
64
79
  }), t;
65
80
  }
66
- const E = "Witlink-Usercenter";
67
- function G() {
68
- const { usercenterUrl: n } = m();
81
+ const j = "Witlink-Usercenter";
82
+ function Z() {
83
+ const { usercenterUrl: n } = d();
69
84
  window.location.href = n;
70
85
  }
71
- function q() {
72
- window.open(m().usercenterUrl, E), window.close();
86
+ function nn() {
87
+ window.open(d().usercenterUrl, j), window.close();
73
88
  }
74
- const b = "", a = "ACCESS_TOKEN", l = "locale", g = "userInfo", d = "menuInfo";
75
- function P(n) {
89
+ const M = "", a = "ACCESS_TOKEN", l = "locale", g = "userInfo", h = "menuInfo";
90
+ function L(n) {
76
91
  const t = new URL(n);
77
92
  return t.hash && t.hash.startsWith("#/") ? `/${t.hash.substring(2).split("?")[0]}`.replace(/\/+/g, "/") : t.pathname;
78
93
  }
79
- function I(n, t = {}) {
94
+ function O(n, t = {}) {
80
95
  const o = Array.isArray(n) ? n : [n];
81
96
  for (const e of o) {
82
97
  if (e.path && e.name !== void 0) {
83
- const r = e.path.startsWith("/") ? e.path : `/${e.path}`;
84
- t[r] = e.name.toString();
98
+ const s = e.path.startsWith("/") ? e.path : `/${e.path}`;
99
+ t[s] = e.name.toString();
85
100
  }
86
- e.children && e.children.length > 0 && I(e.children, t);
101
+ e.children && e.children.length > 0 && O(e.children, t);
87
102
  }
88
103
  return t;
89
104
  }
90
- function s(n) {
91
- return b + n;
105
+ function r(n) {
106
+ return M + n;
92
107
  }
93
- function z(n) {
94
- localStorage.setItem(s(a), n);
108
+ function tn(n) {
109
+ localStorage.setItem(r(a), n);
95
110
  }
96
- function Q() {
97
- return localStorage.getItem(s(a));
111
+ function en() {
112
+ return localStorage.getItem(r(a));
98
113
  }
99
- function X() {
100
- localStorage.removeItem(s(a));
114
+ function on() {
115
+ localStorage.removeItem(r(a));
101
116
  }
102
- function H(n) {
103
- localStorage.setItem(s(l), n);
117
+ function rn(n) {
118
+ localStorage.setItem(r(l), n);
104
119
  }
105
- function V() {
106
- return localStorage.getItem(s(l));
120
+ function sn() {
121
+ return localStorage.getItem(r(l));
107
122
  }
108
- function Z() {
109
- localStorage.removeItem(s(l));
123
+ function cn() {
124
+ localStorage.removeItem(r(l));
110
125
  }
111
- function nn(n = {}) {
112
- n = { ...S() || {}, ...n }, localStorage.setItem(s(g), JSON.stringify(n));
126
+ function un(n = {}) {
127
+ n = { ...U() || {}, ...n }, localStorage.setItem(r(g), JSON.stringify(n));
113
128
  }
114
- function S(n) {
115
- const t = localStorage.getItem(s(g));
129
+ function U(n) {
130
+ const t = localStorage.getItem(r(g));
116
131
  if (n) {
117
132
  if (typeof n == "string")
118
133
  return (t ? JSON.parse(t) : {})[n] || null;
119
134
  if (Array.isArray(n)) {
120
135
  const o = t ? JSON.parse(t) : {}, e = {};
121
- return n.forEach((r) => {
122
- e[r] = o[r] || null;
136
+ return n.forEach((s) => {
137
+ e[s] = o[s] || null;
123
138
  }), e;
124
139
  }
125
140
  }
126
141
  return t ? JSON.parse(t) : null;
127
142
  }
128
- function tn(n) {
129
- localStorage.setItem(s(d), JSON.stringify(n));
143
+ function an(n) {
144
+ localStorage.setItem(r(h), JSON.stringify(n));
130
145
  }
131
- function C() {
132
- const n = localStorage.getItem(s(d));
146
+ function J() {
147
+ const n = localStorage.getItem(r(h));
133
148
  return n ? JSON.parse(n) : null;
134
149
  }
135
- const f = {}, u = {};
136
- function A() {
137
- if (Object.keys(f).length === 0) {
138
- const n = C() || [];
139
- I(n, f);
150
+ const m = {}, u = {};
151
+ function K() {
152
+ if (Object.keys(m).length === 0) {
153
+ const n = J() || [];
154
+ O(n, m);
140
155
  }
141
- return f;
156
+ return m;
142
157
  }
143
- function j() {
144
- return Object.keys(u).length === 0 && ((S() || {}).role.permissions || []).forEach((o) => {
158
+ function T() {
159
+ return Object.keys(u).length === 0 && ((U() || {}).role.permissions || []).forEach((o) => {
145
160
  var e;
146
161
  if (o.actionEntitySet != null && ((e = o.actionEntitySet) == null ? void 0 : e.length) > 0) {
147
- const r = o.actionEntitySet.map((c) => c.action);
148
- u[o.permissionId] = r;
162
+ const s = o.actionEntitySet.map((c) => c.action);
163
+ u[o.permissionId] = s;
149
164
  }
150
165
  }), u;
151
166
  }
152
- function en(n) {
153
- const t = j(), o = P(window.location.href), r = A()[o] || "";
154
- return (t[r] || []).includes(n);
167
+ function ln(n) {
168
+ const t = T(), o = L(window.location.href), s = K()[o] || "";
169
+ return (t[s] || []).includes(n);
155
170
  }
156
- function on() {
157
- localStorage.removeItem(s(g)), localStorage.removeItem(s(d)), localStorage.removeItem(s(a)), localStorage.removeItem(s(l));
171
+ function fn() {
172
+ localStorage.removeItem(r(g)), localStorage.removeItem(r(h)), localStorage.removeItem(r(a)), localStorage.removeItem(r(l));
158
173
  }
159
174
  export {
160
- E as UserCenterKey,
161
- Y as exportFile,
162
- j as getButtonPermissions,
163
- V as getLocale,
164
- C as getMenuInfo,
165
- Q as getToken,
166
- m as getUserCenterParams,
167
- $ as getUserCenterParamsByUrl,
168
- S as getUserInfo,
169
- en as hasPermission,
175
+ j as UserCenterKey,
176
+ X as buildTree,
177
+ Q as exportFile,
178
+ C as forEachTree,
179
+ T as getButtonPermissions,
180
+ sn as getLocale,
181
+ J as getMenuInfo,
182
+ en as getToken,
183
+ d as getUserCenterParams,
184
+ V as getUserCenterParamsByUrl,
185
+ U as getUserInfo,
186
+ ln as hasPermission,
170
187
  i as is,
171
- J as isArray,
172
- K as isAsyncFunction,
173
- F as isBoolean,
174
- T as isClient,
175
- M as isDate,
176
- U as isDef,
177
- _ as isElement,
178
- h as isFunction,
179
- W as isImageDom,
180
- N as isNull,
181
- D as isNullOrUndef,
182
- L as isNumber,
183
- O as isObject,
184
- R as isPromise,
185
- B as isServer,
186
- v as isString,
187
- w as isUndef,
188
- k as isWindow,
189
- q as logoutToUserCenter,
190
- on as removeAll,
191
- Z as removeLocale,
192
- X as removeToken,
193
- H as setLocale,
194
- tn as setMenuInfo,
195
- z as setToken,
196
- x as setUserCenterParams,
197
- nn as setUserInfo,
198
- G as toUserCenterConsole
188
+ D as isArray,
189
+ k as isAsyncFunction,
190
+ W as isBoolean,
191
+ Y as isClient,
192
+ v as isDate,
193
+ b as isDef,
194
+ $ as isElement,
195
+ S as isFunction,
196
+ q as isImageDom,
197
+ P as isNull,
198
+ z as isNullOrUndef,
199
+ F as isNumber,
200
+ A as isObject,
201
+ _ as isPromise,
202
+ G as isServer,
203
+ B as isString,
204
+ E as isUndef,
205
+ x as isWindow,
206
+ nn as logoutToUserCenter,
207
+ fn as removeAll,
208
+ cn as removeLocale,
209
+ on as removeToken,
210
+ rn as setLocale,
211
+ an as setMenuInfo,
212
+ tn as setToken,
213
+ H as setUserCenterParams,
214
+ un as setUserInfo,
215
+ Z as toUserCenterConsole
199
216
  };
package/package.json CHANGED
@@ -1,32 +1,37 @@
1
1
  {
2
2
  "name": "@witlink/components",
3
3
  "private": false,
4
- "version": "0.0.4",
4
+ "version": "1.0.0",
5
5
  "description": "witlink公共组件库",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "main": "./dist/index.umd.cjs",
11
+ "main": "./dist/index.cjs",
12
12
  "module": "./dist/index.js",
13
13
  "types": "./dist/index.d.ts",
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./dist/index.js"
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs"
17
18
  },
18
19
  "./utils": {
19
- "import": "./dist/utils.js"
20
+ "import": "./dist/utils.js",
21
+ "require": "./dist/utils.cjs"
20
22
  },
21
23
  "./style.css": "./dist/index.css"
22
24
  },
23
25
  "scripts": {
24
26
  "dev": "vite",
25
27
  "build": "vue-tsc -b && vite build",
26
- "preview": "vite preview"
28
+ "preview": "vite preview",
29
+ "docs:dev": "vitepress dev docs",
30
+ "docs:build": "vitepress build docs",
31
+ "docs:preview": "vitepress preview docs"
27
32
  },
28
33
  "peerDependencies": {
29
- "ant-design-vue": "^4.2.5",
34
+ "ant-design-vue": "^4.2.6",
30
35
  "element-plus": "^2.8.7",
31
36
  "vue": "^3.5.13"
32
37
  },
@@ -45,7 +50,8 @@
45
50
  "unplugin-vue-components": "^28.4.1",
46
51
  "vite": "^6.2.0",
47
52
  "vite-plugin-dts": "^4.5.3",
48
- "vue-tsc": "^2.2.4",
49
- "vue-router": "^4.5.0"
53
+ "vitepress": "^2.0.0-alpha.5",
54
+ "vue-router": "^4.5.0",
55
+ "vue-tsc": "^2.2.4"
50
56
  }
51
57
  }