@aks-dev/easyui 1.0.182 → 1.0.184

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.

Potentially problematic release.


This version of @aks-dev/easyui might be problematic. Click here for more details.

Files changed (36) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +15 -19
  2. package/dist/components/Badge/Badge.js +13 -18
  3. package/dist/components/DottedLine/DottedLine.js +7 -10
  4. package/dist/components/Echarts/EchartsView.js +14 -18
  5. package/dist/components/Echarts/helper.js +2 -7
  6. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +56 -61
  7. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +42 -47
  8. package/dist/components/Hud/AlertView/AlertView.js +55 -60
  9. package/dist/components/Hud/Hud.js +17 -31
  10. package/dist/components/Hud/Loading/Loading.js +21 -27
  11. package/dist/components/Hud/PopoverView/PopoverView.js +16 -22
  12. package/dist/components/Hud/Scanner/Scanner.js +108 -114
  13. package/dist/components/Hud/Toast/Toast.js +22 -27
  14. package/dist/components/MenuView/MenuView.js +31 -34
  15. package/dist/components/Modal/Modal.js +1 -6
  16. package/dist/components/MutiPictureView/MutiPictureView.js +35 -38
  17. package/dist/components/PictureViewer/PictureViewer.js +12 -17
  18. package/dist/components/RefreshList/RefreshList.js +47 -51
  19. package/dist/components/RichText/RichText.js +17 -20
  20. package/dist/components/StickHeaderView/StickHeaderView.js +7 -10
  21. package/dist/components/TableCell/TableCell.js +29 -32
  22. package/dist/components/TextInputArea/TextInputArea.js +25 -28
  23. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +20 -24
  24. package/dist/index.js +19 -51
  25. package/dist/jsbridge/RNEasyui.js +11 -18
  26. package/dist/jsbridge/UpgradeModule.js +8 -14
  27. package/dist/jsbridge/index.js +2 -5
  28. package/dist/screen/index.js +2 -5
  29. package/dist/screen/px2dp.js +14 -18
  30. package/dist/screen/px2sp.js +5 -9
  31. package/dist/screen/text-fit.js +7 -10
  32. package/dist/utils/index.js +2 -5
  33. package/dist/utils/lazy.js +25 -50
  34. package/dist/utils/mode.js +8 -13
  35. package/package.json +3 -3
  36. package/readme.md +1 -1
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * @Author: shiguo
4
3
  * @Date: 2022-04-15 14:15:07
@@ -9,14 +8,12 @@
9
8
  /**
10
9
  * 全局配置Text
11
10
  */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- const tslib_1 = require("tslib");
14
- const react_1 = tslib_1.__importDefault(require("react"));
15
- const react_native_1 = require("react-native");
16
- const Text = react_native_1.Text;
17
- const TextInput = react_native_1.TextInput;
11
+ import React from 'react';
12
+ import { Platform, Text as Text_spaceName, TextInput as TextInput_spaceName } from 'react-native';
13
+ const Text = Text_spaceName;
14
+ const TextInput = TextInput_spaceName;
18
15
  const textDefaultStyle = {
19
- ...react_native_1.Platform.select({
16
+ ...Platform.select({
20
17
  android: { fontFamily: 'DroidSansFallback' }
21
18
  }),
22
19
  allowFontScaling: false,
@@ -26,7 +23,7 @@ const textDefaultStyle = {
26
23
  const textRender = Text.render;
27
24
  Text.render = function (...args) {
28
25
  const origin = textRender.call(this, ...args);
29
- return react_1.default.cloneElement(origin, {
26
+ return React.cloneElement(origin, {
30
27
  style: [textDefaultStyle, origin.props.style]
31
28
  });
32
29
  };
@@ -40,7 +37,7 @@ const textInputDefaultStyle = {
40
37
  const textInputRender = TextInput.render;
41
38
  TextInput.render = function (...args) {
42
39
  const origin = textInputRender.call(this, ...args);
43
- return react_1.default.cloneElement(origin, {
40
+ return React.cloneElement(origin, {
44
41
  style: [textInputDefaultStyle, origin.props.style]
45
42
  });
46
43
  };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
1
  /*
5
2
  * @Author: shiguo
6
3
  * @Date: 2022-04-19 10:25:43
@@ -8,5 +5,5 @@ const tslib_1 = require("tslib");
8
5
  * @LastEditTime: 2023-03-23 15:08:21
9
6
  * @FilePath: /@aks-dev/easyui/utils/index.ts
10
7
  */
11
- tslib_1.__exportStar(require("../utils/mode"), exports);
12
- tslib_1.__exportStar(require("../utils/lazy"), exports);
8
+ export * from '../utils/mode';
9
+ export * from '../utils/lazy';
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * @Author: shiguo
4
3
  * @Date: 2022-04-27 18:17:54
@@ -6,35 +5,30 @@
6
5
  * @LastEditTime: 2023-03-23 15:07:44
7
6
  * @FilePath: /@aks-dev/easyui/utils/lazy.ts
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getUuid = exports.isHaveEmojiCharact = exports.isHaveChinese = exports.isHaveNumberCount = exports.isHaveChartCount = exports.isChainChar = exports.toDateFriendly = exports.isPhoneNumber = exports.deepEqual = exports.isObjectValueEqual = exports.isUndefined = exports.isNullObject = exports.isNull = exports.isNumber = exports.isString = exports.isArray = exports.isObject = exports.encryptMobilePhoneNumber = exports.syncLoop = exports.randomcolor = exports.sleep = void 0;
11
- exports.deepClone = deepClone;
12
8
  /**
13
9
  * @description: 睡眠时间
14
10
  * @param {*}毫秒值
15
11
  * @return {*}
16
12
  */
17
- const sleep = (msec) => {
13
+ export const sleep = (msec) => {
18
14
  return new Promise((resolve) => {
19
15
  setTimeout(resolve, msec || 350);
20
16
  });
21
17
  };
22
- exports.sleep = sleep;
23
18
  /**
24
19
  * @description: 获取随机色
25
20
  * @param {*}
26
21
  * @return {*}
27
22
  */
28
- const randomcolor = () => {
23
+ export const randomcolor = () => {
29
24
  return `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${1})`;
30
25
  };
31
- exports.randomcolor = randomcolor;
32
26
  /**
33
27
  * @description: 同步循环
34
28
  * @param {*} dataList:数据源
35
29
  * @return {*}
36
30
  */
37
- const syncLoop = async (dataList, callback) => {
31
+ export const syncLoop = async (dataList, callback) => {
38
32
  const length = dataList.length;
39
33
  const O = Object(dataList);
40
34
  let k = 0;
@@ -47,12 +41,11 @@ const syncLoop = async (dataList, callback) => {
47
41
  }
48
42
  return Promise.resolve("SyncForeach loop over");
49
43
  };
50
- exports.syncLoop = syncLoop;
51
44
  /**
52
45
  * @description: 对11位手机号码加*
53
46
  * @return {*}
54
47
  */
55
- const encryptMobilePhoneNumber = (text) => {
48
+ export const encryptMobilePhoneNumber = (text) => {
56
49
  if (text && text.length == 11) {
57
50
  let y1 = text.slice(0, 3);
58
51
  let y2 = text.slice(7);
@@ -60,38 +53,32 @@ const encryptMobilePhoneNumber = (text) => {
60
53
  }
61
54
  return text;
62
55
  };
63
- exports.encryptMobilePhoneNumber = encryptMobilePhoneNumber;
64
56
  /**
65
57
  * @description: 判断对象
66
58
  * @return {*}
67
59
  */
68
60
  //判断是否为对象(仅为对象,不是数组也不是null)
69
- const isObject = (exp) => {
61
+ export const isObject = (exp) => {
70
62
  return Object.prototype.toString.call(exp) == "[object Object]";
71
63
  };
72
- exports.isObject = isObject;
73
64
  //判断是否为数组(仅为数组,不是对象也不是null)
74
- const isArray = (exp) => {
65
+ export const isArray = (exp) => {
75
66
  return Object.prototype.toString.call(exp) == "[object Array]";
76
67
  };
77
- exports.isArray = isArray;
78
68
  //判断是否为字符串
79
- const isString = (exp) => {
69
+ export const isString = (exp) => {
80
70
  return Object.prototype.toString.call(exp) == "[object String]";
81
71
  };
82
- exports.isString = isString;
83
72
  //判断是否为数字(包括整数和实数)
84
- const isNumber = (exp) => {
73
+ export const isNumber = (exp) => {
85
74
  return Object.prototype.toString.call(exp) == "[object Number]";
86
75
  };
87
- exports.isNumber = isNumber;
88
76
  //判断是否为null
89
- const isNull = (exp) => {
77
+ export const isNull = (exp) => {
90
78
  return Object.prototype.toString.call(exp) == "[object Null]";
91
79
  };
92
- exports.isNull = isNull;
93
80
  //判断是否为空对象
94
- const isNullObject = (obj) => {
81
+ export const isNullObject = (obj) => {
95
82
  if (obj == null || obj == undefined)
96
83
  return true;
97
84
  if (Object.keys(obj).length > 0) {
@@ -99,14 +86,12 @@ const isNullObject = (obj) => {
99
86
  }
100
87
  return true;
101
88
  };
102
- exports.isNullObject = isNullObject;
103
89
  //判断是否为undefined
104
- const isUndefined = (exp) => {
90
+ export const isUndefined = (exp) => {
105
91
  return Object.prototype.toString.call(exp) == "[object Undefined]";
106
92
  };
107
- exports.isUndefined = isUndefined;
108
93
  /**判断两个对象是否相同 */
109
- const isObjectValueEqual = (a, b) => {
94
+ export const isObjectValueEqual = (a, b) => {
110
95
  // Object.getOwnPropertyNames()方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组
111
96
  // 换句话来说 Object.getOwnPropertyNames()方法返回的是对象所有 key 组成的数组 list
112
97
  let aProps = Object.getOwnPropertyNames(a);
@@ -117,7 +102,7 @@ const isObjectValueEqual = (a, b) => {
117
102
  for (let i = 0; i < aProps.length; i++) {
118
103
  let propName = aProps[i];
119
104
  if (typeof a[propName] === "object") {
120
- let judge = (0, exports.isObjectValueEqual)(a[propName], b[propName]);
105
+ let judge = isObjectValueEqual(a[propName], b[propName]);
121
106
  if (!judge) {
122
107
  return false;
123
108
  }
@@ -128,8 +113,7 @@ const isObjectValueEqual = (a, b) => {
128
113
  }
129
114
  return true;
130
115
  };
131
- exports.isObjectValueEqual = isObjectValueEqual;
132
- const deepEqual = (x, y) => {
116
+ export const deepEqual = (x, y) => {
133
117
  let prototype_x = Object.prototype.toString.call(x);
134
118
  let prototype_y = Object.prototype.toString.call(y);
135
119
  if (prototype_x == "[object Undefined]") {
@@ -147,7 +131,7 @@ const deepEqual = (x, y) => {
147
131
  return false;
148
132
  }
149
133
  for (var key in x) {
150
- if (!(0, exports.deepEqual)(x[key], y[key])) {
134
+ if (!deepEqual(x[key], y[key])) {
151
135
  return false;
152
136
  }
153
137
  }
@@ -157,7 +141,7 @@ const deepEqual = (x, y) => {
157
141
  return false;
158
142
  }
159
143
  for (let index = 0; index < x.length; index++) {
160
- if (!(0, exports.deepEqual)(x[index], y[index])) {
144
+ if (!deepEqual(x[index], y[index])) {
161
145
  return false;
162
146
  }
163
147
  }
@@ -172,9 +156,8 @@ const deepEqual = (x, y) => {
172
156
  }
173
157
  return true;
174
158
  };
175
- exports.deepEqual = deepEqual;
176
159
  // 定义一个深拷贝函数 接收目标target参数
177
- function deepClone(target) {
160
+ export function deepClone(target) {
178
161
  // 定义一个变量
179
162
  let result;
180
163
  // 如果当前需要深拷贝的是一个对象的话
@@ -210,20 +193,19 @@ function deepClone(target) {
210
193
  // 返回最终结果
211
194
  return result;
212
195
  }
213
- const isPhoneNumber = (str) => {
196
+ export const isPhoneNumber = (str) => {
214
197
  var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
215
198
  if (!myreg.test(str)) {
216
199
  return false;
217
200
  }
218
201
  return true;
219
202
  };
220
- exports.isPhoneNumber = isPhoneNumber;
221
203
  /**
222
204
  *
223
205
  * @param dateStr yyyy-MM-dd HH:mm:ss
224
206
  * @returns {string}
225
207
  */
226
- const toDateFriendly = (dateStr) => {
208
+ export const toDateFriendly = (dateStr) => {
227
209
  //af-测试可用
228
210
  if (!dateStr) {
229
211
  return "";
@@ -264,29 +246,25 @@ const toDateFriendly = (dateStr) => {
264
246
  result = "刚刚";
265
247
  return result;
266
248
  };
267
- exports.toDateFriendly = toDateFriendly;
268
- const isChainChar = (str) => {
249
+ export const isChainChar = (str) => {
269
250
  var index = escape(str).indexOf("%u");
270
251
  if (index < 0)
271
252
  return false;
272
253
  return true;
273
254
  };
274
- exports.isChainChar = isChainChar;
275
- const isHaveChartCount = (str) => {
255
+ export const isHaveChartCount = (str) => {
276
256
  if (/[a-z]/i.test(str)) {
277
257
  return str.match(/[a-z]/gi)?.length;
278
258
  }
279
259
  return 0;
280
260
  };
281
- exports.isHaveChartCount = isHaveChartCount;
282
- const isHaveNumberCount = (str) => {
261
+ export const isHaveNumberCount = (str) => {
283
262
  if (/[0-9]/i.test(str)) {
284
263
  return str.match(/[0-9]/gi)?.length;
285
264
  }
286
265
  return 0;
287
266
  };
288
- exports.isHaveNumberCount = isHaveNumberCount;
289
- const isHaveChinese = (text) => {
267
+ export const isHaveChinese = (text) => {
290
268
  var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g");
291
269
  if (reg.test(text)) {
292
270
  return true;
@@ -295,8 +273,7 @@ const isHaveChinese = (text) => {
295
273
  return false;
296
274
  }
297
275
  };
298
- exports.isHaveChinese = isHaveChinese;
299
- const isHaveEmojiCharact = (substring) => {
276
+ export const isHaveEmojiCharact = (substring) => {
300
277
  for (var i = 0; i < substring.length; i++) {
301
278
  var hs = substring.charCodeAt(i);
302
279
  if (0xd800 <= hs && hs <= 0xdbff) {
@@ -341,12 +318,11 @@ const isHaveEmojiCharact = (substring) => {
341
318
  }
342
319
  return false;
343
320
  };
344
- exports.isHaveEmojiCharact = isHaveEmojiCharact;
345
321
  /**
346
322
  * @description: 获得32位随机字符
347
323
  * @return {*}
348
324
  */
349
- const getUuid = () => {
325
+ export const getUuid = () => {
350
326
  let s = [];
351
327
  let hexDigits = "0123456789abcdef";
352
328
  for (var i = 0; i < 36; i++) {
@@ -359,4 +335,3 @@ const getUuid = () => {
359
335
  var uuid = s.join("");
360
336
  return uuid;
361
337
  };
362
- exports.getUuid = getUuid;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * @Author: shiguo
4
3
  * @Date: 2022-04-18 18:40:07
@@ -6,24 +5,22 @@
6
5
  * @LastEditTime: 2023-03-23 15:07:57
7
6
  * @FilePath: /@aks-dev/easyui/utils/mode.ts
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.callTelephone = exports.panHandlersCallback = exports.keyboardDismissHandlers = void 0;
11
- const react_native_1 = require("react-native");
8
+ import { PanResponder, Keyboard, Linking } from "react-native";
12
9
  /**
13
10
  * @description: 通过手势关闭键盘
14
11
  * @return {*}
15
12
  */
16
- exports.keyboardDismissHandlers = react_native_1.PanResponder.create({
13
+ export const keyboardDismissHandlers = PanResponder.create({
17
14
  onStartShouldSetPanResponder: () => true,
18
- onPanResponderGrant: react_native_1.Keyboard.dismiss,
15
+ onPanResponderGrant: Keyboard.dismiss,
19
16
  }).panHandlers;
20
17
  /**
21
18
  * @description: 手势动作回调
22
19
  * @param {*}
23
20
  * @return {*}
24
21
  */
25
- const panHandlersCallback = (props) => {
26
- return react_native_1.PanResponder.create({
22
+ export const panHandlersCallback = (props) => {
23
+ return PanResponder.create({
27
24
  onStartShouldSetPanResponder: () => true,
28
25
  onMoveShouldSetPanResponder: () => true,
29
26
  onPanResponderGrant: props.GrantCallback,
@@ -31,18 +28,17 @@ const panHandlersCallback = (props) => {
31
28
  onPanResponderRelease: props.ReleaseCallback,
32
29
  }).panHandlers;
33
30
  };
34
- exports.panHandlersCallback = panHandlersCallback;
35
31
  /**
36
32
  * @description: 拨打电话
37
33
  * @param {number} phone
38
34
  * @return {*}
39
35
  */
40
- const callTelephone = (phone) => {
36
+ export const callTelephone = (phone) => {
41
37
  let tel = "tel:" + phone;
42
- react_native_1.Linking.canOpenURL(tel)
38
+ Linking.canOpenURL(tel)
43
39
  .then((supported) => {
44
40
  if (supported) {
45
- react_native_1.Linking.openURL(tel);
41
+ Linking.openURL(tel);
46
42
  }
47
43
  else {
48
44
  console.warn("[sg:callTelephone 不支持]", { supported, tel });
@@ -52,4 +48,3 @@ const callTelephone = (phone) => {
52
48
  console.warn("[sg:callTelephone catch]", { error, tel });
53
49
  });
54
50
  };
55
- exports.callTelephone = callTelephone;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.182",
3
+ "version": "1.0.184",
4
4
  "description": "工具箱",
5
- "main": "dist/index.ts",
5
+ "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "yarn run lint",
@@ -49,7 +49,7 @@
49
49
  "react-native-webview": "*"
50
50
  },
51
51
  "dependencies": {
52
- "echarts": "^5.3.2",
52
+ "echarts": "^6.0.0",
53
53
  "react-native-image-zoom-viewer": "^3.0.1",
54
54
  "react-native-modal": "^13.0.1",
55
55
  "react-native-smart-refresh": "^1.1.6",
package/readme.md CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-04-25 17:57:29
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-18 16:28:37
5
+ * @LastEditTime: 2022-07-18 16:28:371
6
6
  * @FilePath: /@aks-dev/easyui/README.md
7
7
  -->
8
8