@aks-dev/easyui 1.0.163 → 1.1.5

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 (176) hide show
  1. package/dist/components/AnimationModal/AnimationModal.d.ts +27 -0
  2. package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -0
  3. package/dist/components/AnimationModal/AnimationModal.js +151 -0
  4. package/dist/components/Badge/Badge.d.ts +8 -0
  5. package/dist/components/Badge/Badge.d.ts.map +1 -0
  6. package/dist/components/Badge/Badge.js +35 -0
  7. package/dist/components/DottedLine/DottedLine.d.ts +10 -0
  8. package/dist/components/DottedLine/DottedLine.d.ts.map +1 -0
  9. package/dist/components/DottedLine/DottedLine.js +50 -0
  10. package/dist/components/EchartsView/EchartsView.d.ts +10 -0
  11. package/dist/components/EchartsView/EchartsView.d.ts.map +1 -0
  12. package/{lib/Echarts/EchartsView.tsx → dist/components/EchartsView/EchartsView.js} +74 -113
  13. package/dist/components/EchartsView/helper.d.ts +10 -0
  14. package/dist/components/EchartsView/helper.d.ts.map +1 -0
  15. package/{lib/Echarts/helper.tsx → dist/components/EchartsView/helper.js} +17 -24
  16. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts +25 -0
  17. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -0
  18. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +174 -0
  19. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts +19 -0
  20. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -0
  21. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +117 -0
  22. package/dist/components/Hud/AlertView/AlertView.d.ts +25 -0
  23. package/dist/components/Hud/AlertView/AlertView.d.ts.map +1 -0
  24. package/dist/components/Hud/AlertView/AlertView.js +184 -0
  25. package/dist/components/Hud/Hud.d.ts +11 -0
  26. package/dist/components/Hud/Hud.d.ts.map +1 -0
  27. package/dist/components/Hud/Hud.js +29 -0
  28. package/dist/components/Hud/Loading/Loading.d.ts +11 -0
  29. package/dist/components/Hud/Loading/Loading.d.ts.map +1 -0
  30. package/dist/components/Hud/Loading/Loading.js +66 -0
  31. package/dist/components/Hud/PopoverView/PopoverView.d.ts +17 -0
  32. package/dist/components/Hud/PopoverView/PopoverView.d.ts.map +1 -0
  33. package/dist/components/Hud/PopoverView/PopoverView.js +47 -0
  34. package/dist/components/Hud/Scanner/Scanner.d.ts +12 -0
  35. package/dist/components/Hud/Scanner/Scanner.d.ts.map +1 -0
  36. package/dist/components/Hud/Scanner/Scanner.js +301 -0
  37. package/dist/components/Hud/Toast/Toast.d.ts +9 -0
  38. package/dist/components/Hud/Toast/Toast.d.ts.map +1 -0
  39. package/dist/components/Hud/Toast/Toast.js +71 -0
  40. package/dist/components/MenuView/MenuView.d.ts +21 -0
  41. package/dist/components/MenuView/MenuView.d.ts.map +1 -0
  42. package/dist/components/MenuView/MenuView.js +184 -0
  43. package/dist/components/Modal/Modal.d.ts +2 -0
  44. package/dist/components/Modal/Modal.d.ts.map +1 -0
  45. package/{lib/Modal/Modal.tsx → dist/components/Modal/Modal.js} +1 -4
  46. package/{lib/MutiPictureView/index.ts → dist/components/MutiPictureView/MutiPictureView.d.ts} +18 -31
  47. package/dist/components/MutiPictureView/MutiPictureView.d.ts.map +1 -0
  48. package/dist/components/MutiPictureView/MutiPictureView.js +243 -0
  49. package/dist/components/PictureViewer/PictureViewer.d.ts +17 -0
  50. package/dist/components/PictureViewer/PictureViewer.d.ts.map +1 -0
  51. package/dist/components/PictureViewer/PictureViewer.js +54 -0
  52. package/dist/components/RefreshList/RefreshList.d.ts +45 -0
  53. package/dist/components/RefreshList/RefreshList.d.ts.map +1 -0
  54. package/dist/components/RefreshList/RefreshList.js +155 -0
  55. package/dist/components/RichText/RichText.d.ts +12 -0
  56. package/dist/components/RichText/RichText.d.ts.map +1 -0
  57. package/dist/components/RichText/RichText.js +56 -0
  58. package/dist/components/StickHeaderView/StickHeaderView.d.ts +15 -0
  59. package/dist/components/StickHeaderView/StickHeaderView.d.ts.map +1 -0
  60. package/dist/components/StickHeaderView/StickHeaderView.js +37 -0
  61. package/{lib/TableCell/index.ts → dist/components/TableCell/TableCell.d.ts} +8 -30
  62. package/dist/components/TableCell/TableCell.d.ts.map +1 -0
  63. package/dist/components/TableCell/TableCell.js +97 -0
  64. package/dist/components/TextInputArea/TextInputArea.d.ts +17 -0
  65. package/dist/components/TextInputArea/TextInputArea.d.ts.map +1 -0
  66. package/dist/components/TextInputArea/TextInputArea.js +65 -0
  67. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts +23 -0
  68. package/dist/components/WithLoadingContainer/WithLoadingContainer.d.ts.map +1 -0
  69. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +77 -0
  70. package/dist/index.d.ts +23 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +32 -0
  73. package/dist/jsbridge/RNEasyui.d.ts +23 -0
  74. package/dist/jsbridge/RNEasyui.d.ts.map +1 -0
  75. package/dist/jsbridge/RNEasyui.js +46 -0
  76. package/dist/jsbridge/UpgradeModule.d.ts +26 -0
  77. package/dist/jsbridge/UpgradeModule.d.ts.map +1 -0
  78. package/{jsbridge/UpgradeModule.ts → dist/jsbridge/UpgradeModule.js} +25 -23
  79. package/dist/jsbridge/index.d.ts +3 -0
  80. package/dist/jsbridge/index.d.ts.map +1 -0
  81. package/{jsbridge/index.ts → dist/jsbridge/index.js} +2 -2
  82. package/dist/screen/index.d.ts +3 -0
  83. package/dist/screen/index.d.ts.map +1 -0
  84. package/{screen/index.ts → dist/screen/index.js} +2 -2
  85. package/{screen/index.d.ts → dist/screen/px2dp.d.ts} +6 -12
  86. package/dist/screen/px2dp.d.ts.map +1 -0
  87. package/dist/screen/px2dp.js +45 -0
  88. package/dist/screen/px2sp.d.ts +2 -0
  89. package/dist/screen/px2sp.d.ts.map +1 -0
  90. package/{screen/px2sp.ts → dist/screen/px2sp.js} +13 -20
  91. package/dist/screen/text-fit.d.ts +5 -0
  92. package/dist/screen/text-fit.d.ts.map +1 -0
  93. package/{screen/text-fit.ts → dist/screen/text-fit.js} +10 -20
  94. package/dist/utils/index.d.ts +3 -0
  95. package/dist/utils/index.d.ts.map +1 -0
  96. package/{utils/index.ts → dist/utils/index.js} +2 -2
  97. package/{utils/index.d.ts → dist/utils/lazy.d.ts} +15 -53
  98. package/dist/utils/lazy.d.ts.map +1 -0
  99. package/{utils/lazy.ts → dist/utils/lazy.js} +164 -165
  100. package/dist/utils/mode.d.ts +24 -0
  101. package/dist/utils/mode.d.ts.map +1 -0
  102. package/dist/utils/mode.js +50 -0
  103. package/package.json +32 -22
  104. package/readme.md +3 -3
  105. package/android/.DS_Store +0 -0
  106. package/android/src/.DS_Store +0 -0
  107. package/android/src/main/.DS_Store +0 -0
  108. package/android/src/main/java/.DS_Store +0 -0
  109. package/android/src/main/java/com/.DS_Store +0 -0
  110. package/android/src/main/java/com/easyui/.DS_Store +0 -0
  111. package/i.sh +0 -23
  112. package/ios/.DS_Store +0 -0
  113. package/ios/assets/.DS_Store +0 -0
  114. package/ios/views/.DS_Store +0 -0
  115. package/jsbridge/RNEasyui.ts +0 -42
  116. package/jsbridge/index.d.ts +0 -67
  117. package/lib/.DS_Store +0 -0
  118. package/lib/AnimationModal/AnimationModal.tsx +0 -201
  119. package/lib/AnimationModal/index.d.ts +0 -41
  120. package/lib/Badge/Badge.tsx +0 -40
  121. package/lib/Badge/index.ts +0 -21
  122. package/lib/DottedLine/DottedLine.tsx +0 -66
  123. package/lib/DottedLine/index.ts +0 -18
  124. package/lib/Echarts/demo.tsx +0 -235
  125. package/lib/Echarts/index.ts +0 -29
  126. package/lib/Hud/.DS_Store +0 -0
  127. package/lib/Hud/AlertBottomView/AlertBottomView.tsx +0 -228
  128. package/lib/Hud/AlertBottomView/index.d.ts +0 -42
  129. package/lib/Hud/AlertSheetView/AlertSheetView.tsx +0 -179
  130. package/lib/Hud/AlertSheetView/index.d.ts +0 -35
  131. package/lib/Hud/AlertView/AlertView.tsx +0 -234
  132. package/lib/Hud/AlertView/index.d.ts +0 -46
  133. package/lib/Hud/Hud.tsx +0 -67
  134. package/lib/Hud/Loading/Loading.tsx +0 -87
  135. package/lib/Hud/Loading/index.d.ts +0 -38
  136. package/lib/Hud/PopoverView/PopoverView.tsx +0 -66
  137. package/lib/Hud/PopoverView/index.d.ts +0 -39
  138. package/lib/Hud/Scanner/Scanner.tsx +0 -250
  139. package/lib/Hud/Scanner/index.d.ts +0 -42
  140. package/lib/Hud/Toast/Toast.tsx +0 -86
  141. package/lib/Hud/Toast/index.d.ts +0 -22
  142. package/lib/Hud/index.ts +0 -20
  143. package/lib/MenuView/MenuView.tsx +0 -252
  144. package/lib/MenuView/index.ts +0 -31
  145. package/lib/Modal/index.ts +0 -10
  146. package/lib/MutiPictureView/MutiPictureView.tsx +0 -259
  147. package/lib/PictureViewer/PictureViewer.tsx +0 -80
  148. package/lib/PictureViewer/index.ts +0 -26
  149. package/lib/RefreshList/RefreshList.tsx +0 -235
  150. package/lib/RefreshList/demo.tsx +0 -30
  151. package/lib/RefreshList/demo1.tsx +0 -60
  152. package/lib/RefreshList/demo2.tsx +0 -46
  153. package/lib/RefreshList/index.ts +0 -84
  154. package/lib/RichText/RichText.tsx +0 -82
  155. package/lib/RichText/index.ts +0 -21
  156. package/lib/StickHeaderView/StickHeaderView.tsx +0 -65
  157. package/lib/StickHeaderView/demo.tsx +0 -104
  158. package/lib/StickHeaderView/index.ts +0 -26
  159. package/lib/TableCell/TableCell.tsx +0 -118
  160. package/lib/TextInputArea/TextInputArea.tsx +0 -89
  161. package/lib/TextInputArea/index.d.ts +0 -33
  162. package/lib/WithLoadingContainer/WithLoadingContainer.tsx +0 -93
  163. package/lib/WithLoadingContainer/index.ts +0 -36
  164. package/screen/px2dp.ts +0 -51
  165. package/src/index.d.ts +0 -42
  166. package/src/index.ts +0 -54
  167. package/utils/mode.ts +0 -48
  168. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-blue.png +0 -0
  169. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/flashlight-white.png +0 -0
  170. /package/{lib/Hud/Scanner → dist/components/Hud/Scanner/assets}/icon_back_white.png +0 -0
  171. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_add_image.png +0 -0
  172. /package/{lib/MutiPictureView → dist/components/MutiPictureView/assets}/icon_del_image.png +0 -0
  173. /package/{lib/TableCell → dist/components/TableCell/assets}/back.png +0 -0
  174. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading.gif +0 -0
  175. /package/{lib/WithLoadingContainer → dist/components/WithLoadingContainer/assets}/loading3.gif +0 -0
  176. /package/{lib → dist/components}/index.md +0 -0
@@ -5,26 +5,30 @@
5
5
  * @LastEditTime: 2023-03-23 15:07:44
6
6
  * @FilePath: /@aks-dev/easyui/utils/lazy.ts
7
7
  */
8
- import type { SyncLoopCallBack } from './index.d'
9
-
10
- export const sleep = (msec?: number) => {
11
- return new Promise(resolve => {
8
+ /**
9
+ * @description: 睡眠时间
10
+ * @param {*}毫秒值
11
+ * @return {*}
12
+ */
13
+ export const sleep = (msec) => {
14
+ return new Promise((resolve) => {
12
15
  setTimeout(resolve, msec || 350);
13
16
  });
14
- }
15
-
16
-
17
-
18
-
17
+ };
18
+ /**
19
+ * @description: 获取随机色
20
+ * @param {*}
21
+ * @return {*}
22
+ */
19
23
  export const randomcolor = () => {
20
- return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${1})`
21
- }
22
-
23
-
24
-
25
-
26
-
27
- export const syncLoop = async (dataList: any[], callback: SyncLoopCallBack) => {
24
+ return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${1})`;
25
+ };
26
+ /**
27
+ * @description: 同步循环
28
+ * @param {*} dataList:数据源
29
+ * @return {*}
30
+ */
31
+ export const syncLoop = async (dataList, callback) => {
28
32
  const length = dataList.length;
29
33
  const O = Object(dataList);
30
34
  let k = 0;
@@ -35,154 +39,146 @@ export const syncLoop = async (dataList: any[], callback: SyncLoopCallBack) => {
35
39
  }
36
40
  k++;
37
41
  }
38
-
39
- return Promise.resolve('SyncForeach loop over')
42
+ return Promise.resolve("SyncForeach loop over");
40
43
  };
41
-
42
-
43
-
44
- export const encryptMobilePhoneNumber = (text: string) => {
44
+ /**
45
+ * @description: 对11位手机号码加*
46
+ * @return {*}
47
+ */
48
+ export const encryptMobilePhoneNumber = (text) => {
45
49
  if (text && text.length == 11) {
46
50
  let y1 = text.slice(0, 3);
47
51
  let y2 = text.slice(7);
48
- return y1 + '****' + y2
52
+ return y1 + "****" + y2;
49
53
  }
50
54
  return text;
51
- }
52
-
55
+ };
56
+ /**
57
+ * @description: 判断对象
58
+ * @return {*}
59
+ */
53
60
  //判断是否为对象(仅为对象,不是数组也不是null)
54
- export const isObject = (exp: any) => {
55
- return Object.prototype.toString.call(exp) == '[object Object]'
56
- }
57
-
61
+ export const isObject = (exp) => {
62
+ return Object.prototype.toString.call(exp) == "[object Object]";
63
+ };
58
64
  //判断是否为数组(仅为数组,不是对象也不是null)
59
- export const isArray = (exp: any) => {
60
- return Object.prototype.toString.call(exp) == '[object Array]'
61
- }
62
-
65
+ export const isArray = (exp) => {
66
+ return Object.prototype.toString.call(exp) == "[object Array]";
67
+ };
63
68
  //判断是否为字符串
64
- export const isString = (exp: any) => {
65
- return Object.prototype.toString.call(exp) == '[object String]'
66
- }
67
-
69
+ export const isString = (exp) => {
70
+ return Object.prototype.toString.call(exp) == "[object String]";
71
+ };
68
72
  //判断是否为数字(包括整数和实数)
69
- export const isNumber = (exp: any) => {
70
- return Object.prototype.toString.call(exp) == '[object Number]'
71
- }
72
-
73
+ export const isNumber = (exp) => {
74
+ return Object.prototype.toString.call(exp) == "[object Number]";
75
+ };
73
76
  //判断是否为null
74
- export const isNull = (exp: any) => {
75
- return Object.prototype.toString.call(exp) == '[object Null]'
76
- }
77
-
77
+ export const isNull = (exp) => {
78
+ return Object.prototype.toString.call(exp) == "[object Null]";
79
+ };
78
80
  //判断是否为空对象
79
- export const isNullObject = (obj: any) => {
81
+ export const isNullObject = (obj) => {
80
82
  if (obj == null || obj == undefined)
81
83
  return true;
82
-
83
84
  if (Object.keys(obj).length > 0) {
84
85
  return false;
85
86
  }
86
87
  return true;
87
-
88
- }
89
-
88
+ };
90
89
  //判断是否为undefined
91
- export const isUndefined = (exp: any) => {
92
- return Object.prototype.toString.call(exp) == '[object Undefined]'
93
- }
90
+ export const isUndefined = (exp) => {
91
+ return Object.prototype.toString.call(exp) == "[object Undefined]";
92
+ };
94
93
  /**判断两个对象是否相同 */
95
- export const isObjectValueEqual = (a: any, b: any) => {
94
+ export const isObjectValueEqual = (a, b) => {
96
95
  // Object.getOwnPropertyNames()方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组
97
96
  // 换句话来说 Object.getOwnPropertyNames()方法返回的是对象所有 key 组成的数组 list
98
- let aProps = Object.getOwnPropertyNames(a)
99
- let bProps = Object.getOwnPropertyNames(b)
97
+ let aProps = Object.getOwnPropertyNames(a);
98
+ let bProps = Object.getOwnPropertyNames(b);
100
99
  if (aProps.length != bProps.length) {
101
- return false
100
+ return false;
102
101
  }
103
-
104
102
  for (let i = 0; i < aProps.length; i++) {
105
- let propName = aProps[i]
106
- if (typeof a[propName] === 'object') {
107
- let judge = isObjectValueEqual(a[propName], b[propName])
103
+ let propName = aProps[i];
104
+ if (typeof a[propName] === "object") {
105
+ let judge = isObjectValueEqual(a[propName], b[propName]);
108
106
  if (!judge) {
109
- return false
107
+ return false;
110
108
  }
111
- } else if (a[propName] !== b[propName]) {
112
- return false
109
+ }
110
+ else if (a[propName] !== b[propName]) {
111
+ return false;
113
112
  }
114
113
  }
115
- return true
116
- }
117
-
118
- export const deepEqual = (x: any, y: any) => {
119
- let prototype_x = Object.prototype.toString.call(x)
120
- let prototype_y = Object.prototype.toString.call(y)
121
-
122
- if (prototype_x == '[object Undefined]') {
123
- prototype_x = '[object Null]'
114
+ return true;
115
+ };
116
+ export const deepEqual = (x, y) => {
117
+ let prototype_x = Object.prototype.toString.call(x);
118
+ let prototype_y = Object.prototype.toString.call(y);
119
+ if (prototype_x == "[object Undefined]") {
120
+ prototype_x = "[object Null]";
124
121
  }
125
- if (prototype_y == '[object Undefined]') {
126
- prototype_y = '[object Null]'
122
+ if (prototype_y == "[object Undefined]") {
123
+ prototype_y = "[object Null]";
127
124
  }
128
-
129
125
  if (prototype_x != prototype_y) {
130
- return false
126
+ return false;
131
127
  }
132
-
133
128
  /**以下类型相同比较 */
134
- if (prototype_x == '[object Object]') {
129
+ if (prototype_x == "[object Object]") {
135
130
  if (Object.keys(x).length != Object.keys(y).length) {
136
131
  return false;
137
132
  }
138
-
139
133
  for (var key in x) {
140
134
  if (!deepEqual(x[key], y[key])) {
141
- return false
135
+ return false;
142
136
  }
143
137
  }
144
- } else if (prototype_x == '[object Array]') {
138
+ }
139
+ else if (prototype_x == "[object Array]") {
145
140
  if (x.length != y.length) {
146
- return false
141
+ return false;
147
142
  }
148
143
  for (let index = 0; index < x.length; index++) {
149
144
  if (!deepEqual(x[index], y[index])) {
150
- return false
145
+ return false;
151
146
  }
152
-
153
147
  }
154
148
  }
155
- /**过滤对函数的深比较 */
156
- else if (prototype_x == '[object Function]') {
157
- return true
158
- } else {
149
+ else if (prototype_x == "[object Function]") {
150
+ /**过滤对函数的深比较 */
151
+ return true;
152
+ }
153
+ else {
159
154
  /**其它类型值比较 */
160
- return x == y
155
+ return x == y;
161
156
  }
162
-
163
- return true
164
- }
165
-
157
+ return true;
158
+ };
166
159
  // 定义一个深拷贝函数 接收目标target参数
167
- export function deepClone(target: any): any {
160
+ export function deepClone(target) {
168
161
  // 定义一个变量
169
- let result: any;
162
+ let result;
170
163
  // 如果当前需要深拷贝的是一个对象的话
171
- if (typeof target === 'object') {
164
+ if (typeof target === "object") {
172
165
  // 如果是一个数组的话
173
166
  if (Array.isArray(target)) {
174
167
  result = []; // 将result赋值为一个数组,并且执行遍历
175
168
  for (let i in target) {
176
169
  // 递归克隆数组中的每一项
177
- result.push(deepClone(target[i]))
170
+ result.push(deepClone(target[i]));
178
171
  }
179
172
  // 判断如果当前的值是null的话;直接赋值为null
180
- } else if (target === null) {
173
+ }
174
+ else if (target === null) {
181
175
  result = null;
182
176
  // 判断如果当前的值是一个RegExp对象的话,直接赋值
183
- } else if (target.constructor === RegExp) {
177
+ }
178
+ else if (target.constructor === RegExp) {
184
179
  result = target;
185
- } else {
180
+ }
181
+ else {
186
182
  // 否则是普通对象,直接for in循环,递归赋值对象的所有值
187
183
  result = {};
188
184
  for (let i in target) {
@@ -190,34 +186,30 @@ export function deepClone(target: any): any {
190
186
  }
191
187
  }
192
188
  // 如果不是对象的话,就是基本数据类型,那么直接赋值
193
- } else {
189
+ }
190
+ else {
194
191
  result = target;
195
192
  }
196
193
  // 返回最终结果
197
194
  return result;
198
195
  }
199
-
200
- export const isPhoneNumber = (str: string) => {
196
+ export const isPhoneNumber = (str) => {
201
197
  var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
202
198
  if (!myreg.test(str)) {
203
199
  return false;
204
200
  }
205
201
  return true;
206
- }
207
-
208
-
209
-
202
+ };
210
203
  /**
211
- *
212
- * @param dateStr yyyy-MM-dd HH:mm:ss
213
- * @returns {string}
214
- */
215
- export const toDateFriendly = (dateStr: string) => {
204
+ *
205
+ * @param dateStr yyyy-MM-dd HH:mm:ss
206
+ * @returns {string}
207
+ */
208
+ export const toDateFriendly = (dateStr) => {
216
209
  //af-测试可用
217
210
  if (!dateStr) {
218
- return ''
211
+ return "";
219
212
  }
220
-
221
213
  let dateTimeStamp = Date.parse(dateStr.replace(/-/gi, "/"));
222
214
  let minute = 1000 * 60;
223
215
  let hour = minute * 60;
@@ -227,102 +219,111 @@ export const toDateFriendly = (dateStr: string) => {
227
219
  let now = new Date().getTime();
228
220
  let diffValue = now - dateTimeStamp;
229
221
  if (diffValue < 0) {
230
- return '';
222
+ return "";
231
223
  }
232
224
  let monthC = diffValue / month;
233
225
  let weekC = diffValue / (7 * day);
234
226
  let dayC = diffValue / day;
235
227
  let hourC = diffValue / hour;
236
228
  let minC = diffValue / minute;
237
- let result = '';
229
+ let result = "";
238
230
  if (monthC >= 1) {
239
231
  result = "" + parseInt(monthC.toString()) + "月前";
240
- } else if (weekC >= 1) {
232
+ }
233
+ else if (weekC >= 1) {
241
234
  result = "" + parseInt(weekC.toString()) + "周前";
242
- } else if (dayC >= 1) {
235
+ }
236
+ else if (dayC >= 1) {
243
237
  result = "" + parseInt(dayC.toString()) + "天前";
244
- } else if (hourC >= 1) {
238
+ }
239
+ else if (hourC >= 1) {
245
240
  result = "" + parseInt(hourC.toString()) + "小时前";
246
- } else if (minC >= 1) {
241
+ }
242
+ else if (minC >= 1) {
247
243
  result = "" + parseInt(minC.toString()) + "分钟前";
248
- } else
244
+ }
245
+ else
249
246
  result = "刚刚";
250
247
  return result;
251
- }
252
-
253
- export const isChainChar = (str: string) => {
248
+ };
249
+ export const isChainChar = (str) => {
254
250
  var index = escape(str).indexOf("%u");
255
251
  if (index < 0)
256
252
  return false;
257
-
258
253
  return true;
259
- }
260
-
261
- export const isHaveChartCount = (str: string) => {
254
+ };
255
+ export const isHaveChartCount = (str) => {
262
256
  if (/[a-z]/i.test(str)) {
263
- return str.match(/[a-z]/ig)?.length;
257
+ return str.match(/[a-z]/gi)?.length;
264
258
  }
265
259
  return 0;
266
- }
267
-
268
- export const isHaveNumberCount = (str: string) => {
260
+ };
261
+ export const isHaveNumberCount = (str) => {
269
262
  if (/[0-9]/i.test(str)) {
270
- return str.match(/[0-9]/ig)?.length;
263
+ return str.match(/[0-9]/gi)?.length;
271
264
  }
272
265
  return 0;
273
- }
274
-
275
-
276
-
277
- export const isHaveChinese = (text: string) => {
266
+ };
267
+ export const isHaveChinese = (text) => {
278
268
  var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g");
279
269
  if (reg.test(text)) {
280
270
  return true;
281
- } else {
271
+ }
272
+ else {
282
273
  return false;
283
274
  }
284
- }
285
- export const isHaveEmojiCharact = (substring: string) => {
275
+ };
276
+ export const isHaveEmojiCharact = (substring) => {
286
277
  for (var i = 0; i < substring.length; i++) {
287
278
  var hs = substring.charCodeAt(i);
288
279
  if (0xd800 <= hs && hs <= 0xdbff) {
289
280
  if (substring.length > 1) {
290
281
  var ls = substring.charCodeAt(i + 1);
291
- var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
282
+ var uc = (hs - 0xd800) * 0x400 + (ls - 0xdc00) + 0x10000;
292
283
  if (0x1d000 <= uc && uc <= 0x1f77f) {
293
284
  return true;
294
285
  }
295
286
  }
296
-
297
- } else if (substring.length > 1) {
287
+ }
288
+ else if (substring.length > 1) {
298
289
  var ls = substring.charCodeAt(i + 1);
299
290
  if (ls == 0x20e3) {
300
291
  return true;
301
292
  }
302
- } else {
293
+ }
294
+ else {
303
295
  if (0x2100 <= hs && hs <= 0x27ff) {
304
296
  return true;
305
- } else if (0x2B05 <= hs && hs <= 0x2b07) {
297
+ }
298
+ else if (0x2b05 <= hs && hs <= 0x2b07) {
306
299
  return true;
307
- } else if (0x2934 <= hs && hs <= 0x2935) {
300
+ }
301
+ else if (0x2934 <= hs && hs <= 0x2935) {
308
302
  return true;
309
- } else if (0x3297 <= hs && hs <= 0x3299) {
303
+ }
304
+ else if (0x3297 <= hs && hs <= 0x3299) {
310
305
  return true;
311
- } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030
312
- || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b
313
- || hs == 0x2b50) {
306
+ }
307
+ else if (hs == 0xa9 ||
308
+ hs == 0xae ||
309
+ hs == 0x303d ||
310
+ hs == 0x3030 ||
311
+ hs == 0x2b55 ||
312
+ hs == 0x2b1c ||
313
+ hs == 0x2b1b ||
314
+ hs == 0x2b50) {
314
315
  return true;
315
316
  }
316
317
  }
317
318
  }
318
-
319
- return false
320
- }
321
-
322
-
323
-
319
+ return false;
320
+ };
321
+ /**
322
+ * @description: 获得32位随机字符
323
+ * @return {*}
324
+ */
324
325
  export const getUuid = () => {
325
- let s: any[] = [];
326
+ let s = [];
326
327
  let hexDigits = "0123456789abcdef";
327
328
  for (var i = 0; i < 36; i++) {
328
329
  s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
@@ -330,9 +331,7 @@ export const getUuid = () => {
330
331
  s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
331
332
  s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
332
333
  s[8] = s[13] = s[18] = s[23] = "-";
333
- ` ][poi]`
334
+ ` ][poi]`;
334
335
  var uuid = s.join("");
335
- return uuid
336
- }
337
-
338
-
336
+ return uuid;
337
+ };
@@ -0,0 +1,24 @@
1
+ type CallBack = (...args: any[]) => void;
2
+ /**
3
+ * @description: 通过手势关闭键盘
4
+ * @return {*}
5
+ */
6
+ export declare const keyboardDismissHandlers: import("react-native").GestureResponderHandlers;
7
+ /**
8
+ * @description: 手势动作回调
9
+ * @param {*}
10
+ * @return {*}
11
+ */
12
+ export declare const panHandlersCallback: (props: {
13
+ GrantCallback: CallBack;
14
+ MoveCallback: CallBack;
15
+ ReleaseCallback: CallBack;
16
+ }) => import("react-native").GestureResponderHandlers;
17
+ /**
18
+ * @description: 拨打电话
19
+ * @param {number} phone
20
+ * @return {*}
21
+ */
22
+ export declare const callTelephone: (phone: number | string) => void;
23
+ export {};
24
+ //# sourceMappingURL=mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/utils/mode.ts"],"names":[],"mappings":"AASA,KAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AACzC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iDAGtB,CAAC;AACf;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO;IACzC,aAAa,EAAE,QAAQ,CAAC;IACxB,YAAY,EAAE,QAAQ,CAAC;IACvB,eAAe,EAAE,QAAQ,CAAC;CAC3B,oDAQA,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,MAAM,SAanD,CAAC"}
@@ -0,0 +1,50 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-18 18:40:07
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2023-03-23 15:07:57
6
+ * @FilePath: /@aks-dev/easyui/utils/mode.ts
7
+ */
8
+ import { PanResponder, Keyboard, Linking } from "react-native";
9
+ /**
10
+ * @description: 通过手势关闭键盘
11
+ * @return {*}
12
+ */
13
+ export const keyboardDismissHandlers = PanResponder.create({
14
+ onStartShouldSetPanResponder: () => true,
15
+ onPanResponderGrant: Keyboard.dismiss,
16
+ }).panHandlers;
17
+ /**
18
+ * @description: 手势动作回调
19
+ * @param {*}
20
+ * @return {*}
21
+ */
22
+ export const panHandlersCallback = (props) => {
23
+ return PanResponder.create({
24
+ onStartShouldSetPanResponder: () => true,
25
+ onMoveShouldSetPanResponder: () => true,
26
+ onPanResponderGrant: props.GrantCallback,
27
+ onPanResponderMove: props.MoveCallback,
28
+ onPanResponderRelease: props.ReleaseCallback,
29
+ }).panHandlers;
30
+ };
31
+ /**
32
+ * @description: 拨打电话
33
+ * @param {number} phone
34
+ * @return {*}
35
+ */
36
+ export const callTelephone = (phone) => {
37
+ let tel = "tel:" + phone;
38
+ Linking.canOpenURL(tel)
39
+ .then((supported) => {
40
+ if (supported) {
41
+ Linking.openURL(tel);
42
+ }
43
+ else {
44
+ console.warn("[sg:callTelephone 不支持]", { supported, tel });
45
+ }
46
+ })
47
+ .catch((error) => {
48
+ console.warn("[sg:callTelephone catch]", { error, tel });
49
+ });
50
+ };
package/package.json CHANGED
@@ -1,11 +1,22 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.163",
3
+ "version": "1.1.5",
4
4
  "description": "工具箱",
5
- "main": "./src/index.ts",
6
- "typings": "./src/index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.js",
8
+ "types": "./dist/index.d.ts"
9
+ }
10
+ },
7
11
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
12
+ "test": "yarn run lint",
13
+ "release": "yarn semantic-release",
14
+ "cp": "cp -r -v src/assets dist/assets",
15
+ "rsync": "rsync -av --include='*/' --exclude='*.tsx' --exclude='demo.tsx' --exclude='*.ts' src/ dist/",
16
+ "build": "tsc && rsync -rv --include='*/' --exclude='*.tsx' --exclude='demo.tsx' --exclude='*.ts' src/ dist/",
17
+ "types": "tsc --emitDeclarationOnly --declaration --declarationMap --declarationDir ./types",
18
+ "dev": "tsc --watch",
19
+ "test:ts": "tsc --noEmit"
9
20
  },
10
21
  "keywords": [
11
22
  "react",
@@ -17,16 +28,15 @@
17
28
  "!/android/build",
18
29
  "/ios",
19
30
  "/*.podspec",
20
- "/src",
21
- "/lib",
22
- "/screen",
23
- "/jsbridge",
24
- "/utils",
31
+ "/dist",
32
+ "/types",
25
33
  "/**/*.png",
26
34
  "/**/*.bundle",
27
35
  "!/tsconfig.json",
28
36
  "!/tsconfig.md",
29
- "/i.sh"
37
+ "!/i.sh",
38
+ "!/src/**/assets/*",
39
+ "!/docs"
30
40
  ],
31
41
  "homepage": "https://gitee.com/the_period_of_the_ten_kingdoms",
32
42
  "repository": {
@@ -36,31 +46,31 @@
36
46
  "author": "shiguo",
37
47
  "license": "MIT",
38
48
  "peerDependencies": {
39
- "@aks-dev/react-native-syan-image-picker": "*",
40
49
  "react": "*",
41
50
  "react-native": "*",
42
- "react-native-camera": "*",
43
51
  "react-native-permissions": "*",
52
+ "react-native-vision-camera": "*",
44
53
  "react-native-webview": "*"
45
54
  },
46
55
  "dependencies": {
47
- "echarts": "^5.3.2",
56
+ "echarts": "^6.0.0",
48
57
  "react-native-image-zoom-viewer": "^3.0.1",
49
- "react-native-modal": "^13.0.1",
58
+ "react-native-modal": "^14.0.0-rc.1",
50
59
  "react-native-smart-refresh": "^1.1.6",
51
60
  "react-native-swipe-list-view": "^3.2.9"
52
61
  },
53
62
  "devDependencies": {
54
- "@aks-dev/react-native-syan-image-picker": "^0.5.58",
55
- "@types/react": "^17.0.39",
56
- "@types/react-native": "^0.67.4",
57
- "react-native-camera": "^4.2.1",
58
- "react-native-permissions": "^3.8.0",
59
- "react-native-webview": "^11.18.2",
60
- "tslib": "^2.4.0",
61
- "typescript": "^4.6.3"
63
+ "@tsconfig/node22": "^22.0.5",
64
+ "@types/react": "^19.2.14",
65
+ "react-native": "^0.84.1",
66
+ "react-native-permissions": "^5.5.1",
67
+ "react-native-vision-camera": "^4.7.3",
68
+ "react-native-webview": "^13.16.1"
62
69
  },
63
70
  "resolutions": {
64
71
  "@types/react": "*"
72
+ },
73
+ "publishConfig": {
74
+ "registry": "https://registry.npmjs.org/"
65
75
  }
66
76
  }