yxuse 3.0.90 → 3.0.92

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 (90) hide show
  1. package/lib/api.cjs.js +1 -1
  2. package/lib/api.es.js +2 -2
  3. package/lib/components.cjs.js +1 -1
  4. package/lib/components.es.js +11 -9
  5. package/lib/hooks.cjs.js +1 -1
  6. package/lib/hooks.es.js +6 -6
  7. package/lib/index.cjs.js +1 -1
  8. package/lib/index.cjs11.js +1 -1
  9. package/lib/index.cjs12.js +1 -1
  10. package/lib/index.cjs13.js +1 -1
  11. package/lib/index.cjs14.js +1 -1
  12. package/lib/index.cjs2.js +1 -1
  13. package/lib/index.cjs3.js +1 -1
  14. package/lib/index.cjs4.js +1 -1
  15. package/lib/index.cjs5.js +1 -1
  16. package/lib/index.cjs5.js.gz +0 -0
  17. package/lib/index.cjs6.js +1 -1
  18. package/lib/index.cjs7.js +1 -1
  19. package/lib/index.cjs8.js +1 -1
  20. package/lib/index.cjs9.js +1 -1
  21. package/lib/index.es.js +8 -9
  22. package/lib/index.es11.js +454 -15
  23. package/lib/index.es11.js.gz +0 -0
  24. package/lib/index.es12.js +226 -405
  25. package/lib/index.es13.js +29 -202
  26. package/lib/index.es14.js +19 -34
  27. package/lib/index.es2.js +4 -3
  28. package/lib/index.es3.js +2 -2
  29. package/lib/index.es4.js +3 -3
  30. package/lib/index.es5.js +1751 -34
  31. package/lib/index.es5.js.gz +0 -0
  32. package/lib/index.es6.js +35 -841
  33. package/lib/index.es6.js.gz +0 -0
  34. package/lib/index.es7.js +1 -1
  35. package/lib/index.es8.js +1 -1
  36. package/lib/index.es9.js +4 -125
  37. package/lib/theme.cjs.js +1 -1
  38. package/lib/theme.es.js +12 -13
  39. package/lib/translate.cjs.js +1 -1
  40. package/lib/translate.es.js +9 -10
  41. package/lib/utils.cjs.js +1 -1
  42. package/lib/utils.es.js +5 -4
  43. package/lib/yxIcon.cjs.js +1 -1
  44. package/lib/yxIcon.es.js +2 -2
  45. package/lib/yxi18n.cjs.js +1 -1
  46. package/lib/yxi18n.es.js +1 -1
  47. package/lib/yxuse.css +1 -1
  48. package/lib/yxuse.css.gz +0 -0
  49. package/package.json +1 -1
  50. package/types/components/CommonPage/index.d.ts +3 -0
  51. package/types/components/CommonPage/page.d.ts +64 -0
  52. package/types/components/CommonPage/pagination.d.ts +9 -0
  53. package/types/components/CommonPage/props.d.ts +36 -0
  54. package/types/components/CommonPage/search.d.ts +4 -0
  55. package/types/components/CommonPage/table.d.ts +3 -0
  56. package/types/components/CommonPage/type.d.ts +1 -0
  57. package/types/components/YxForm/index.vue.d.ts +1 -1
  58. package/types/components/YxForm/type.d.ts +14 -1
  59. package/types/components/YxNormalPage/config.d.ts +12 -0
  60. package/types/components/YxNormalPage/form.d.ts +7 -0
  61. package/types/components/YxNormalPage/index.d.ts +3 -0
  62. package/types/components/YxNormalPage/page.d.ts +83 -0
  63. package/types/components/YxNormalPage/pagination.d.ts +9 -0
  64. package/types/components/YxNormalPage/props.d.ts +40 -0
  65. package/types/components/YxNormalPage/search.d.ts +9 -0
  66. package/types/components/YxNormalPage/table.d.ts +5 -0
  67. package/types/components/YxNormalPage/type.d.ts +69 -0
  68. package/types/components/YxTable/index.vue.d.ts +4 -4
  69. package/types/components/YxTableBar/bar.d.ts +47 -0
  70. package/types/components/YxTableBar/config.d.ts +18 -0
  71. package/types/components/YxTableBar/index.d.ts +11 -0
  72. package/types/components/YxTableBar/props.d.ts +23 -0
  73. package/types/components/YxTableBar/type.d.ts +11 -0
  74. package/types/components/YxTablePro/index.d.ts +14 -14
  75. package/types/components/YxUpload/index.vue.d.ts +3 -3
  76. package/types/components/Yxbutton/index.vue.d.ts +6 -6
  77. package/types/components/index.d.ts +2 -0
  78. package/types/hooks/useConfirm/index.d.ts +1 -1
  79. package/types/hooks/useDialog/type.d.ts +1 -1
  80. package/types/theme/config.d.ts +1 -1
  81. package/types/theme/index.d.ts +1 -1
  82. package/types/utils/common/index.d.ts +7 -1
  83. package/types/utils/common/util.d.ts +1 -1
  84. package/types/utils/excel/index.d.ts +8 -8
  85. package/types/utils/http/index.d.ts +8 -0
  86. package/types/utils/subscribe/index.d.ts +1 -1
  87. package/lib/index.cjs15.js +0 -1
  88. package/lib/index.cjs6.js.gz +0 -0
  89. package/lib/index.es12.js.gz +0 -0
  90. package/lib/index.es15.js +0 -22
package/lib/index.es13.js CHANGED
@@ -1,210 +1,37 @@
1
- import { ElMessage, ElMessageBox } from "element-plus";
2
- import "element-plus/es/components/message/style/index";
3
- import "element-plus/es/components/message-box/style/index";
4
- import { d as dayjs } from "./vendor-dayjs.es.js";
5
- const notifyMessageToSystems = (message) => {
6
- const themeBc = new BroadcastChannel("YXUSE_BC");
7
- themeBc.postMessage(message);
8
- };
9
- const receiveMessage = (callback) => {
10
- const themeBc = new BroadcastChannel("YXUSE_BC");
11
- themeBc.onmessage = () => {
12
- callback();
13
- };
14
- };
15
- const getSelectOptions = (arr, labelKey, valueKey, isValueToNumber) => {
16
- if (!Array.isArray(arr)) return [];
17
- return arr.map((item) => {
18
- return {
19
- label: item == null ? void 0 : item[labelKey],
20
- value: isValueToNumber ? +item[valueKey] : item[valueKey]
21
- };
22
- });
23
- };
24
- const enumToArray = (enumObject) => {
25
- const result = [];
26
- for (const key in enumObject) {
27
- if (isNaN(Number(key))) {
28
- result.push({ label: key, value: enumObject[key] });
29
- }
30
- }
31
- return result;
32
- };
33
- const isDarkColor = (color) => {
34
- const parseColor = (color2) => {
35
- let r2 = 0, g2 = 0, b2 = 0, a = 1;
36
- if (color2.startsWith("#")) {
37
- color2 = color2.slice(1);
38
- if (color2.length === 3) {
39
- r2 = parseInt(color2[0] + color2[0], 16);
40
- g2 = parseInt(color2[1] + color2[1], 16);
41
- b2 = parseInt(color2[2] + color2[2], 16);
42
- } else if (color2.length === 6) {
43
- r2 = parseInt(color2.slice(0, 2), 16);
44
- g2 = parseInt(color2.slice(2, 4), 16);
45
- b2 = parseInt(color2.slice(4, 6), 16);
46
- } else {
47
- return null;
48
- }
49
- } else if (color2.startsWith("rgb")) {
50
- const rgbaMatch = color2.match(/(\d+(\.\d+)?)/g);
51
- if (rgbaMatch) {
52
- r2 = parseFloat(rgbaMatch[0]);
53
- g2 = parseFloat(rgbaMatch[1]);
54
- b2 = parseFloat(rgbaMatch[2]);
55
- if (rgbaMatch.length > 3) {
56
- a = parseFloat(rgbaMatch[3]);
57
- }
58
- } else {
59
- return null;
60
- }
61
- } else {
62
- return null;
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ class YxSubscribe {
5
+ constructor() {
6
+ __publicField(this, "subscribers");
7
+ this.subscribers = {};
8
+ }
9
+ subscribe(sub, fn) {
10
+ if (!this.subscribers[sub]) {
11
+ this.subscribers[sub] = [];
63
12
  }
64
- return [r2, g2, b2, a];
65
- };
66
- const colorComponents = parseColor(color);
67
- if (!colorComponents) {
68
- return null;
69
- }
70
- const [r, g, b, _] = colorComponents;
71
- const normalizedR = r / 255;
72
- const normalizedG = g / 255;
73
- const normalizedB = b / 255;
74
- const max = Math.max(normalizedR, normalizedG, normalizedB);
75
- const min = Math.min(normalizedR, normalizedG, normalizedB);
76
- let l = (max + min) / 2;
77
- return l < 0.5;
78
- };
79
- const areColorsSimilar = (color1, color2, threshold = 100) => {
80
- const getColorComponents = (color) => {
81
- let r, g, b, a = 1;
82
- if (color.startsWith("#")) {
83
- color = color.slice(1);
84
- if (color.length === 3) {
85
- r = parseInt(color[0] + color[0], 16);
86
- g = parseInt(color[1] + color[1], 16);
87
- b = parseInt(color[2] + color[2], 16);
88
- } else if (color.length === 6) {
89
- r = parseInt(color.slice(0, 2), 16);
90
- g = parseInt(color.slice(2, 4), 16);
91
- b = parseInt(color.slice(4, 6), 16);
92
- } else {
93
- return null;
94
- }
95
- } else if (color.startsWith("rgb")) {
96
- const rgbaMatch = color.match(/(\d+(\.\d+)?)/g);
97
- r = parseFloat(rgbaMatch[0]);
98
- g = parseFloat(rgbaMatch[1]);
99
- b = parseFloat(rgbaMatch[2]);
100
- if (rgbaMatch.length > 3) {
101
- a = parseFloat(rgbaMatch[3]);
13
+ this.subscribers[sub].push(fn);
14
+ }
15
+ unsubscribe(sub, fn) {
16
+ const subscribers = this.subscribers[sub];
17
+ if (!fn) return this.subscribers[sub] = [];
18
+ if (subscribers) {
19
+ const index = subscribers.indexOf(fn);
20
+ if (index !== -1) {
21
+ subscribers.splice(index, 1);
102
22
  }
103
- } else {
104
- return null;
105
23
  }
106
- return [r, g, b, a];
107
- };
108
- const color1Components = getColorComponents(color1);
109
- const color2Components = getColorComponents(color2);
110
- if (!color1Components || !color2Components) {
111
- return false;
112
24
  }
113
- const euclideanDistance = Math.sqrt(
114
- Math.pow(color1Components[0] - color2Components[0], 2) + Math.pow(color1Components[1] - color2Components[1], 2) + Math.pow(color1Components[2] - color2Components[2], 2) + Math.pow(color1Components[3] - color2Components[3], 2)
115
- );
116
- return euclideanDistance <= threshold;
117
- };
118
- const isColorEqual = (color1, color2) => {
119
- function toRGBA(color) {
120
- if (color.toLowerCase().startsWith("rgba")) {
121
- return color.toLowerCase();
122
- } else if (color.toLowerCase().startsWith("rgb")) {
123
- return color.replace("rgb", "rgba").replace(")", ", 1)");
124
- } else if (color.length === 7) {
125
- const r = parseInt(color.substring(1, 3), 16);
126
- const g = parseInt(color.substring(3, 5), 16);
127
- const b = parseInt(color.substring(5, 7), 16);
128
- return `rgba(${r}, ${g}, ${b}, 1)`;
129
- } else if (color.length === 9 && color.toLowerCase().startsWith("rrggbbaa")) {
130
- const r = parseInt(color.substring(1, 3), 16);
131
- const g = parseInt(color.substring(3, 5), 16);
132
- const b = parseInt(color.substring(5, 7), 16);
133
- const a = Math.round(parseInt(color.substring(7, 9), 16) / 255 * 100) / 100;
134
- return `rgba(${r}, ${g}, ${b}, ${a})`;
135
- } else {
136
- return null;
25
+ publish(message) {
26
+ const subscribers = this.subscribers[message.type];
27
+ if (subscribers) {
28
+ subscribers.forEach((fn) => {
29
+ fn(message.data);
30
+ });
137
31
  }
138
32
  }
139
- const rgbaColor1 = toRGBA(convertShortHexToLongHex(color1));
140
- const rgbaColor2 = toRGBA(convertShortHexToLongHex(color2));
141
- if (!rgbaColor1 || !rgbaColor2) {
142
- return false;
143
- }
144
- return rgbaColor1 === rgbaColor2;
145
- };
146
- const convertShortHexToLongHex = (shortHex) => {
147
- if (shortHex.length === 4 && shortHex[0] === "#") {
148
- const r = shortHex[1];
149
- const g = shortHex[2];
150
- const b = shortHex[3];
151
- const longHex = `#${r}${r}${g}${g}${b}${b}`;
152
- return longHex;
153
- } else {
154
- return shortHex;
155
- }
156
- };
157
- const yxMessage = (data, callback, isShowError = false) => {
158
- if (data.isSuccess) {
159
- ElMessage.success(data.resultMsg || "操作成功");
160
- callback && callback();
161
- } else {
162
- if (isShowError) {
163
- ElMessage.error(data.resultMsg || "操作失败");
164
- }
165
- }
166
- };
167
- const copyText = (text) => {
168
- const textField = document.createElement("textarea");
169
- textField.innerText = text;
170
- document.body.appendChild(textField);
171
- textField.select();
172
- document.execCommand("copy");
173
- textField.remove();
174
- ElMessage.success("已成功复制到剪贴板");
175
- };
176
- const getCownDownTime = (time) => {
177
- const diffTimeSecond = dayjs(time).diff(dayjs(), "second");
178
- let formattedTime = "00:00:00";
179
- if (diffTimeSecond > 0) {
180
- const hours = Math.floor(diffTimeSecond / 3600);
181
- const minutes = Math.floor(diffTimeSecond % 3600 / 60);
182
- const seconds = diffTimeSecond % 60;
183
- formattedTime = `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
184
- }
185
- return formattedTime;
186
- };
187
- const useConfirm = (content, confrmCallback, options = {}) => {
188
- ElMessageBox.confirm(content, (options == null ? void 0 : options.title) || "提示", {
189
- confirmButtonText: "确定",
190
- cancelButtonText: "取消",
191
- type: "warning",
192
- ...options
193
- }).then(() => {
194
- confrmCallback();
195
- }).catch(() => {
196
- });
197
- };
33
+ }
34
+ const yxSubscribe = new YxSubscribe();
198
35
  export {
199
- areColorsSimilar as a,
200
- getSelectOptions as b,
201
- copyText as c,
202
- isDarkColor as d,
203
- enumToArray as e,
204
- getCownDownTime as g,
205
- isColorEqual as i,
206
- notifyMessageToSystems as n,
207
- receiveMessage as r,
208
- useConfirm as u,
209
- yxMessage as y
36
+ yxSubscribe as y
210
37
  };
package/lib/index.es14.js CHANGED
@@ -1,37 +1,22 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- class YxSubscribe {
5
- constructor() {
6
- __publicField(this, "subscribers");
7
- this.subscribers = {};
1
+ import { a as http, U as URL } from "./index.es11.js";
2
+ const uploadResourceApi = (params, config) => http.post(`${URL["ttc"].INTEGRATED_BASE_URL}/file/upload`, params, config);
3
+ const getGroupListApi = () => http.get(
4
+ `${URL["ttc"].INTEGRATED_BASE_URL}/resource/group/list`,
5
+ {},
6
+ {
7
+ headers: { noLoading: true }
8
8
  }
9
- subscribe(sub, fn) {
10
- if (!this.subscribers[sub]) {
11
- this.subscribers[sub] = [];
12
- }
13
- this.subscribers[sub].push(fn);
14
- }
15
- unsubscribe(sub, fn) {
16
- const subscribers = this.subscribers[sub];
17
- if (!fn) return this.subscribers[sub] = [];
18
- if (subscribers) {
19
- const index = subscribers.indexOf(fn);
20
- if (index !== -1) {
21
- subscribers.splice(index, 1);
22
- }
23
- }
24
- }
25
- publish(message) {
26
- const subscribers = this.subscribers[message.type];
27
- if (subscribers) {
28
- subscribers.forEach((fn) => {
29
- fn(message.data);
30
- });
31
- }
32
- }
33
- }
34
- const yxSubscribe = new YxSubscribe();
9
+ );
10
+ const getResourceListApi = (groupUuid, sign) => http.get(`${URL["ttc"].INTEGRATED_BASE_URL}/resource/file/list/${sign}/${groupUuid}`, {}, { headers: { noLoading: true } });
11
+ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12
+ __proto__: null,
13
+ getGroupListApi,
14
+ getResourceListApi,
15
+ uploadResourceApi
16
+ }, Symbol.toStringTag, { value: "Module" }));
35
17
  export {
36
- yxSubscribe as y
18
+ getResourceListApi as a,
19
+ getGroupListApi as g,
20
+ index as i,
21
+ uploadResourceApi as u
37
22
  };
package/lib/index.es2.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { g as getToken, s as showFullScreenLoading, h as hideFullScreenLoading, c as checkStatus, a as http } from "./index.es12.js";
5
- import { a as areColorsSimilar, c as copyText, e as enumToArray, g as getCownDownTime, b as getSelectOptions, i as isColorEqual, d as isDarkColor, n as notifyMessageToSystems, r as receiveMessage, u as useConfirm, y as yxMessage } from "./index.es13.js";
6
- import { y as yxSubscribe } from "./index.es14.js";
4
+ import { g as getToken, s as showFullScreenLoading, h as hideFullScreenLoading, c as checkStatus, a as http } from "./index.es11.js";
5
+ import { a as areColorsSimilar, c as copyText, d as deepClone, e as enumToArray, g as getCownDownTime, b as getSelectOptions, i as isColorEqual, f as isDarkColor, n as notifyMessageToSystems, r as receiveMessage, u as useConfirm, y as yxMessage } from "./index.es12.js";
6
+ import { y as yxSubscribe } from "./index.es13.js";
7
7
  import "element-plus";
8
8
  import "element-plus/es/components/message/style/index";
9
9
  import "element-plus/es/components/message-box/style/index";
@@ -296,6 +296,7 @@ const utils2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
296
296
  WS: Ws,
297
297
  areColorsSimilar,
298
298
  copyText,
299
+ deepClone,
299
300
  enumToArray,
300
301
  getCownDownTime,
301
302
  getSelectOptions,
package/lib/index.es3.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./index.es12.js";
1
+ import "./index.es11.js";
2
2
  import "element-plus";
3
3
  import "element-plus/es/components/message/style/index";
4
4
  import "element-plus/es/components/message-box/style/index";
@@ -7,7 +7,7 @@ import "element-plus/es/components/loading/style/index";
7
7
  import "element-plus/es/components/message/style/css";
8
8
  import "element-plus/es/components/loading/style/css";
9
9
  import "./vendor-mqtt.es.js";
10
- import { g as getGroupListApi, a as getResourceListApi } from "./index.es15.js";
10
+ import { g as getGroupListApi, a as getResourceListApi } from "./index.es14.js";
11
11
  const ICON_GROUP_NAME = "yxIcon";
12
12
  const initYxIcon = () => {
13
13
  getYxIconGroupUuid();
package/lib/index.es4.js CHANGED
@@ -1,10 +1,10 @@
1
- import { a as http, U as URL, l as index$2 } from "./index.es12.js";
2
- import { i as index$1 } from "./index.es15.js";
1
+ import { a as http, U as URL, l as index$2 } from "./index.es11.js";
2
+ import { i as index$1 } from "./index.es14.js";
3
3
  import "element-plus";
4
4
  import "element-plus/es/components/message/style/index";
5
5
  import "element-plus/es/components/message-box/style/index";
6
6
  import "./vendor-dayjs.es.js";
7
- import { y as yxSubscribe } from "./index.es14.js";
7
+ import { y as yxSubscribe } from "./index.es13.js";
8
8
  import "element-plus/es/components/loading/style/index";
9
9
  import "element-plus/es/components/message/style/css";
10
10
  import "element-plus/es/components/loading/style/css";