szld-libs 0.4.46 → 0.4.49

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 (110) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/szld-components.es.js +51950 -28754
  3. package/dist/szld-components.umd.js +396 -77
  4. package/es/components/AuthButton/index.d.ts +2 -1
  5. package/es/components/BackHeader/index.d.ts +1 -1
  6. package/es/components/CoralButton/index.d.ts +2 -1
  7. package/es/components/CreateForm/index.d.ts +1 -1
  8. package/es/components/CustomPagination/index.d.ts +2 -1
  9. package/es/components/DynamicForm/func.js +4 -0
  10. package/es/components/DynamicForm/index.d.ts +3 -0
  11. package/es/components/DynamicForm/myCascader/index.d.ts +1 -1
  12. package/es/components/DynamicForm/myCheckbox/index.d.ts +2 -1
  13. package/es/components/DynamicForm/myRadio/index.d.ts +2 -1
  14. package/es/components/DynamicForm/myRichText/index.d.ts +10 -0
  15. package/es/components/DynamicForm/myRichText/index.js +280 -0
  16. package/es/components/DynamicForm/myRichText/vite.svg +1 -0
  17. package/es/components/DynamicForm/mySelect/index.d.ts +2 -1
  18. package/es/components/DynamicForm/mySelect/index.js +51 -15
  19. package/es/components/DynamicForm/myUpload/index.d.ts +2 -1
  20. package/es/components/DynamicForm/radioCard/index.d.ts +1 -1
  21. package/es/components/DynamicForm/selectModel/index.d.ts +1 -1
  22. package/es/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
  23. package/es/components/DynamicForm/useDynamicForm.d.ts +1 -1
  24. package/es/components/DynamicForm/useDynamicForm.js +23 -3
  25. package/es/components/DynamicFormMobile/index.js +2 -0
  26. package/es/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
  27. package/es/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
  28. package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
  29. package/es/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
  30. package/es/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
  31. package/es/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
  32. package/es/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
  33. package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  34. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  35. package/es/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
  36. package/es/components/DynamicFormMobile/useDynamicForm.js +2 -0
  37. package/es/components/EditTable/index.d.ts +2 -1
  38. package/es/components/LoopSlide/index.js +1 -0
  39. package/es/components/SearchTable/index.d.ts +2 -1
  40. package/es/components/Upload/index.d.ts +1 -1
  41. package/es/components/VirtualTable/index.d.ts +2 -1
  42. package/es/components/WorkFlowNode/index.d.ts +1 -1
  43. package/es/components/common/403.d.ts +2 -1
  44. package/es/components/common/404.d.ts +2 -1
  45. package/es/hooks/useCaptcha.d.ts +2 -1
  46. package/es/hooks/useChangePwd.js +1 -0
  47. package/es/hooks/useDetailRender.d.ts +3 -2
  48. package/es/hooks/useUniversalTable.js +7 -0
  49. package/es/index.js +6 -9
  50. package/es/mock/index.d.ts +1 -14
  51. package/es/mock/index.js +9 -1404
  52. package/es/utils/formRules.js +6 -0
  53. package/es/utils/hmacSM3.js +40 -4
  54. package/es/utils/method.js +25 -5
  55. package/es/utils/szxkFunc.js +1 -0
  56. package/es/utils/verify-code.js +13 -0
  57. package/lib/components/AuthButton/index.d.ts +2 -1
  58. package/lib/components/BackHeader/index.d.ts +1 -1
  59. package/lib/components/CoralButton/index.d.ts +2 -1
  60. package/lib/components/CreateForm/index.d.ts +1 -1
  61. package/lib/components/CustomPagination/index.d.ts +2 -1
  62. package/lib/components/DynamicForm/func.js +4 -0
  63. package/lib/components/DynamicForm/index.d.ts +3 -0
  64. package/lib/components/DynamicForm/myCascader/index.d.ts +1 -1
  65. package/lib/components/DynamicForm/myCheckbox/index.d.ts +2 -1
  66. package/lib/components/DynamicForm/myRadio/index.d.ts +2 -1
  67. package/lib/components/DynamicForm/myRichText/index.d.ts +10 -0
  68. package/lib/components/DynamicForm/myRichText/index.js +279 -0
  69. package/lib/components/DynamicForm/myRichText/vite.svg +1 -0
  70. package/lib/components/DynamicForm/mySelect/index.d.ts +2 -1
  71. package/lib/components/DynamicForm/mySelect/index.js +49 -13
  72. package/lib/components/DynamicForm/myUpload/index.d.ts +2 -1
  73. package/lib/components/DynamicForm/radioCard/index.d.ts +1 -1
  74. package/lib/components/DynamicForm/selectModel/index.d.ts +1 -1
  75. package/lib/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
  76. package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -1
  77. package/lib/components/DynamicForm/useDynamicForm.js +23 -3
  78. package/lib/components/DynamicFormMobile/index.js +2 -0
  79. package/lib/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
  80. package/lib/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
  81. package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
  82. package/lib/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
  83. package/lib/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
  84. package/lib/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
  85. package/lib/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
  86. package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  87. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  88. package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
  89. package/lib/components/DynamicFormMobile/useDynamicForm.js +2 -0
  90. package/lib/components/EditTable/index.d.ts +2 -1
  91. package/lib/components/LoopSlide/index.js +1 -0
  92. package/lib/components/SearchTable/index.d.ts +2 -1
  93. package/lib/components/Upload/index.d.ts +1 -1
  94. package/lib/components/VirtualTable/index.d.ts +2 -1
  95. package/lib/components/WorkFlowNode/index.d.ts +1 -1
  96. package/lib/components/common/403.d.ts +2 -1
  97. package/lib/components/common/404.d.ts +2 -1
  98. package/lib/hooks/useCaptcha.d.ts +2 -1
  99. package/lib/hooks/useChangePwd.js +1 -0
  100. package/lib/hooks/useDetailRender.d.ts +3 -2
  101. package/lib/hooks/useUniversalTable.js +7 -0
  102. package/lib/index.js +6 -9
  103. package/lib/mock/index.d.ts +1 -14
  104. package/lib/mock/index.js +9 -1404
  105. package/lib/utils/formRules.js +6 -0
  106. package/lib/utils/hmacSM3.js +40 -4
  107. package/lib/utils/method.js +25 -5
  108. package/lib/utils/szxkFunc.js +1 -0
  109. package/lib/utils/verify-code.js +13 -0
  110. package/package.json +10 -1
@@ -6,6 +6,7 @@ const formRules = {
6
6
  },
7
7
  telephone: {
8
8
  pattern: /^[\d -]+$/,
9
+ // 只允许输入数字和 - ,11位或12位
9
10
  message: "请输入正确的电话号码"
10
11
  },
11
12
  email: {
@@ -25,18 +26,22 @@ const formRules = {
25
26
  message: "可输入字母、汉字、数字或()"
26
27
  },
27
28
  inputTextarea: {
29
+ // 审核原因输入限制
28
30
  pattern: /^[\w\u4E00-\u9FA5\uF900-\uFA2D-\u3002-\uff1f-\uff01-\uff0c-\u3001-\uff1b-\uff1a]*$/,
29
31
  message: "请输入字母、汉字或数字和中文常用字符:?!,、;。"
30
32
  },
31
33
  backendRestrict: {
34
+ // 后端不能接收这些类型的字符串
32
35
  pattern: /^[^'"/\\]*$/,
33
36
  message: `不能输入特殊字符\\'/"`
34
37
  },
35
38
  onetoNinetyNine: {
39
+ // 请输入1-99的整数
36
40
  pattern: /^[1-9][0-9]{0,1}$/,
37
41
  message: `请输入1-99的整数`
38
42
  },
39
43
  passwordRule: {
44
+ // 密码
40
45
  pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z0-9]{8,12}$/,
41
46
  message: `密码应为字母大小写+数字8-12位组合`
42
47
  },
@@ -49,6 +54,7 @@ const formRules = {
49
54
  message: `请输入整数类型`
50
55
  },
51
56
  onlyBlankRule: {
57
+ // 不能只有空格
52
58
  pattern: /\S/,
53
59
  message: "输入内容不能只有空格"
54
60
  }
@@ -5,10 +5,16 @@ var __publicField = (obj, key, value) => {
5
5
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
6
  return value;
7
7
  };
8
- const _SM3 = class {
8
+ const _SM3 = class _SM3 {
9
+ /**
10
+ * 循环左移
11
+ */
9
12
  static rotateLeft(x, n) {
10
13
  return x << n | x >>> 32 - n;
11
14
  }
15
+ /**
16
+ * 布尔函数 FFj
17
+ */
12
18
  static FFj(X, Y, Z, j) {
13
19
  if (j >= 0 && j <= 15) {
14
20
  return X ^ Y ^ Z;
@@ -16,6 +22,9 @@ const _SM3 = class {
16
22
  return X & Y | X & Z | Y & Z;
17
23
  }
18
24
  }
25
+ /**
26
+ * 布尔函数 GGj
27
+ */
19
28
  static GGj(X, Y, Z, j) {
20
29
  if (j >= 0 && j <= 15) {
21
30
  return X ^ Y ^ Z;
@@ -23,12 +32,21 @@ const _SM3 = class {
23
32
  return X & Y | ~X & Z;
24
33
  }
25
34
  }
35
+ /**
36
+ * 置换函数 P0
37
+ */
26
38
  static P0(X) {
27
39
  return X ^ _SM3.rotateLeft(X, 9) ^ _SM3.rotateLeft(X, 17);
28
40
  }
41
+ /**
42
+ * 置换函数 P1
43
+ */
29
44
  static P1(X) {
30
45
  return X ^ _SM3.rotateLeft(X, 15) ^ _SM3.rotateLeft(X, 23);
31
46
  }
47
+ /**
48
+ * 消息填充
49
+ */
32
50
  static pad(message) {
33
51
  const bitLength = message.length * 8;
34
52
  const paddingLength = (448 - (bitLength + 1) % 512 + 512) % 512;
@@ -42,6 +60,9 @@ const _SM3 = class {
42
60
  padded.set(lengthBytes, totalLength - 8);
43
61
  return padded;
44
62
  }
63
+ /**
64
+ * 处理一个512位块
65
+ */
45
66
  static processBlock(block, state) {
46
67
  const W = new Uint32Array(68);
47
68
  const W1 = new Uint32Array(64);
@@ -86,6 +107,9 @@ const _SM3 = class {
86
107
  state[6] ^= G;
87
108
  state[7] ^= H;
88
109
  }
110
+ /**
111
+ * 计算SM3哈希值
112
+ */
89
113
  static hash(message) {
90
114
  const padded = _SM3.pad(message);
91
115
  const state = new Uint32Array(_SM3.IV);
@@ -100,14 +124,16 @@ const _SM3 = class {
100
124
  }
101
125
  return result;
102
126
  }
127
+ /**
128
+ * 计算SM3哈希值并返回十六进制字符串
129
+ */
103
130
  static hashHex(message) {
104
131
  const msgArray = typeof message === "string" ? new TextEncoder().encode(message) : message;
105
132
  const hashBytes = _SM3.hash(msgArray);
106
133
  return Array.from(hashBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
107
134
  }
108
135
  };
109
- let SM3 = _SM3;
110
- __publicField(SM3, "IV", new Uint32Array([
136
+ __publicField(_SM3, "IV", new Uint32Array([
111
137
  1937774191,
112
138
  1226093241,
113
139
  388252375,
@@ -117,7 +143,7 @@ __publicField(SM3, "IV", new Uint32Array([
117
143
  3817729613,
118
144
  2969243214
119
145
  ]));
120
- __publicField(SM3, "T", new Uint32Array(64));
146
+ __publicField(_SM3, "T", new Uint32Array(64));
121
147
  (() => {
122
148
  for (let j = 0; j < 16; j++) {
123
149
  _SM3.T[j] = 2043430169;
@@ -126,11 +152,15 @@ __publicField(SM3, "T", new Uint32Array(64));
126
152
  _SM3.T[j] = 2055708042;
127
153
  }
128
154
  })();
155
+ let SM3 = _SM3;
129
156
  class HmacSM3 {
130
157
  constructor(key) {
131
158
  __publicField(this, "key");
132
159
  this.key = typeof key === "string" ? new TextEncoder().encode(key) : key;
133
160
  }
161
+ /**
162
+ * 计算HMAC-SM3值
163
+ */
134
164
  digest(message) {
135
165
  const msgArray = typeof message === "string" ? new TextEncoder().encode(message) : message;
136
166
  const blockSize = 64;
@@ -160,10 +190,16 @@ class HmacSM3 {
160
190
  const finalHash = SM3.hash(outerData);
161
191
  return finalHash;
162
192
  }
193
+ /**
194
+ * 计算HMAC-SM3值并返回十六进制字符串
195
+ */
163
196
  digestHex(message) {
164
197
  const hashBytes = this.digest(message);
165
198
  return Array.from(hashBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
166
199
  }
200
+ /**
201
+ * 静态方法:快速计算HMAC-SM3
202
+ */
167
203
  static hmac(key, message) {
168
204
  const hmac = new HmacSM3(key);
169
205
  return hmac.digestHex(message);
@@ -14,12 +14,28 @@ function base64ToString(base64Str) {
14
14
  if (!isBase64(base64Str)) {
15
15
  return base64Str;
16
16
  }
17
- const binaryStr = atob(base64Str);
18
- const bytes = new Uint8Array(binaryStr.length);
19
- for (let i = 0; i < binaryStr.length; i++) {
20
- bytes[i] = binaryStr.charCodeAt(i);
17
+ try {
18
+ const decoded = atob(base64Str);
19
+ try {
20
+ const uriDecoded = decodeURIComponent(decoded);
21
+ if (uriDecoded.includes("%")) {
22
+ return decoded;
23
+ }
24
+ return uriDecoded;
25
+ } catch (uriError) {
26
+ try {
27
+ const bytes = new Uint8Array(decoded.length);
28
+ for (let i = 0; i < decoded.length; i++) {
29
+ bytes[i] = decoded.charCodeAt(i);
30
+ }
31
+ return new TextDecoder().decode(bytes);
32
+ } catch {
33
+ return decoded;
34
+ }
35
+ }
36
+ } catch (error) {
37
+ return base64Str;
21
38
  }
22
- return new TextDecoder().decode(bytes);
23
39
  }
24
40
  function isBase64(str) {
25
41
  if (!str)
@@ -149,6 +165,9 @@ const handleSubmitForm = (originalData, allValues) => {
149
165
  attrItem.attrvalue = "";
150
166
  }
151
167
  break;
168
+ case "rich-text":
169
+ attrItem.attrvalue = btoa(encodeURIComponent(formValue));
170
+ break;
152
171
  default:
153
172
  if (!((_d = attrItem == null ? void 0 : attrItem.json) == null ? void 0 : _d["properties-multiple"])) {
154
173
  attrItem.attrvalue = formValue;
@@ -460,6 +479,7 @@ const handleAttrListToObjDetail = async ({
460
479
  currentItem.children = await handleAttrListToObjDetail({
461
480
  attrList: v.children,
462
481
  params: childParams,
482
+ // 传递子层级参数
463
483
  extra,
464
484
  commonRequest
465
485
  });
@@ -63,6 +63,7 @@ const handleObjDetailToSignleAttrList = (attrList, detail) => {
63
63
  };
64
64
  const handleSetTableRowColor = (record, index, ngColor) => ({
65
65
  style: {
66
+ // 隔行变色
66
67
  backgroundColor: index !== void 0 && index % 2 === 1 ? (ngColor == null ? void 0 : ngColor[0]) || "rgba(0, 77, 50, 0.16)" : (ngColor == null ? void 0 : ngColor[1]) || "rgba(0, 77, 50, 0.24)"
67
68
  }
68
69
  });
@@ -8,12 +8,19 @@ var __publicField = (obj, key, value) => {
8
8
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
9
9
  class getGVerify {
10
10
  constructor(options) {
11
+ //创建图形验证码
11
12
  __publicField(this, "options", {
13
+ //默认值
12
14
  id: "",
15
+ //容器Id
13
16
  canvasId: "verifyCanvas",
17
+ //canvas的ID
14
18
  width: 100,
19
+ //默认canvas宽度
15
20
  height: 30,
21
+ //默认canvas高度
16
22
  type: "blend",
23
+ //图形验证码默认类型blend:数字字母混合类型、number:纯数字、letter:纯字母
17
24
  code: ""
18
25
  });
19
26
  this.options = options;
@@ -24,6 +31,7 @@ class getGVerify {
24
31
  this._init();
25
32
  this.refresh();
26
33
  }
34
+ /**初始化方法**/
27
35
  _init() {
28
36
  const con = document.getElementById(this.options.id);
29
37
  const canvas = document.createElement("canvas");
@@ -39,6 +47,7 @@ class getGVerify {
39
47
  this.refresh();
40
48
  };
41
49
  }
50
+ /**生成验证码**/
42
51
  refresh() {
43
52
  this.options.code = "";
44
53
  const canvas = document.getElementById(this.options.canvasId);
@@ -89,6 +98,7 @@ class getGVerify {
89
98
  ctx.fill();
90
99
  }
91
100
  }
101
+ /**验证验证码**/
92
102
  validate(code) {
93
103
  const verifyCode = code.toLowerCase();
94
104
  const v_code = this.options.code.toLowerCase();
@@ -98,13 +108,16 @@ class getGVerify {
98
108
  return false;
99
109
  }
100
110
  }
111
+ /**生成字母数组**/
101
112
  getAllLetter() {
102
113
  const letterStr = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
103
114
  return letterStr.split(",");
104
115
  }
116
+ /**生成一个随机数**/
105
117
  randomNum(min, max) {
106
118
  return Math.floor(Math.random() * (max - min) + min);
107
119
  }
120
+ /**生成一个随机色**/
108
121
  randomColor(min, max) {
109
122
  const r = this.randomNum(min, max);
110
123
  const g = this.randomNum(min, max);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.46",
4
+ "version": "0.4.49",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -9,6 +9,15 @@
9
9
  "build": "npm run clean && vite build"
10
10
  },
11
11
  "dependencies": {
12
+ "@tiptap/extension-color": "^3.27.1",
13
+ "@tiptap/extension-font-size": "^3.0.0-next.3",
14
+ "@tiptap/extension-highlight": "^3.27.1",
15
+ "@tiptap/extension-link": "^3.27.1",
16
+ "@tiptap/extension-text-align": "^3.27.1",
17
+ "@tiptap/extension-text-style": "^3.27.1",
18
+ "@tiptap/extension-underline": "^3.27.1",
19
+ "@tiptap/react": "^3.27.1",
20
+ "@tiptap/starter-kit": "^3.27.1",
12
21
  "ahooks": "^3.7.4",
13
22
  "antd": "^5.27.4",
14
23
  "axios": "^1.13.2",