@lambo-design/shared 1.0.0-beta.222 → 1.0.0-beta.224

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 (56) hide show
  1. package/config/themes/atrovirens/atrovirens.css +2 -1
  2. package/config/themes/atrovirens/atrovirens.less +2 -1
  3. package/config/themes/atrovirens/var.less +2 -1
  4. package/config/themes/blue/blue.css +2 -1
  5. package/config/themes/blue/blue.less +2 -1
  6. package/config/themes/blue/var.less +2 -0
  7. package/config/themes/blue-white/blue-white.css +2 -1
  8. package/config/themes/blue-white/blue-white.less +2 -1
  9. package/config/themes/blue-white/var.less +2 -0
  10. package/config/themes/blue-white-tight/blue-white-tight.css +2 -1
  11. package/config/themes/blue-white-tight/blue-white-tight.less +2 -0
  12. package/config/themes/blue-white-tight/var.less +2 -0
  13. package/config/themes/danqing/danqing.css +2 -1
  14. package/config/themes/danqing/danqing.less +3 -1
  15. package/config/themes/danqing/var.less +3 -1
  16. package/config/themes/deep/deep.css +2 -1
  17. package/config/themes/deep/deep.less +2 -0
  18. package/config/themes/deep/var.less +2 -0
  19. package/config/themes/default/default.css +2 -1
  20. package/config/themes/default/default.less +2 -0
  21. package/config/themes/default/var.less +2 -0
  22. package/config/themes/eap/eap.css +2 -1
  23. package/config/themes/eap/eap.less +2 -0
  24. package/config/themes/eap/var.less +2 -0
  25. package/config/themes/gold/gold.css +2 -1
  26. package/config/themes/gold/gold.less +2 -0
  27. package/config/themes/gold/var.less +2 -0
  28. package/config/themes/lime/lime.css +2 -1
  29. package/config/themes/lime/lime.less +2 -0
  30. package/config/themes/lime/var.less +2 -0
  31. package/config/themes/orange/orange.css +2 -1
  32. package/config/themes/orange/orange.less +2 -0
  33. package/config/themes/orange/var.less +2 -0
  34. package/config/themes/red/red.css +2 -1
  35. package/config/themes/red/red.less +2 -0
  36. package/config/themes/red/var.less +2 -0
  37. package/config/themes/theme-atrovirens.js +2 -0
  38. package/config/themes/theme-blue.js +2 -0
  39. package/config/themes/theme-bw.js +2 -0
  40. package/config/themes/theme-bwt.js +2 -0
  41. package/config/themes/theme-danqing.js +2 -0
  42. package/config/themes/theme-deep.js +2 -0
  43. package/config/themes/theme-default.js +2 -0
  44. package/config/themes/theme-eap.js +2 -0
  45. package/config/themes/theme-gold.js +2 -0
  46. package/config/themes/theme-lime.js +2 -0
  47. package/config/themes/theme-orange.js +2 -0
  48. package/config/themes/theme-red.js +2 -0
  49. package/package.json +1 -1
  50. package/utils/dict/index.js +22 -14
  51. package/utils/storage.js +198 -198
  52. package/utils/style.js +24 -24
  53. package/utils/transfer-queue.js +7 -7
  54. package/utils/type.js +102 -102
  55. package/utils/crypto/aes.js +0 -23
  56. package/utils/crypto/rsa.js +0 -16
package/utils/style.js CHANGED
@@ -1,24 +1,24 @@
1
- const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g
2
- const MOZ_HACK_REGEXP = /^moz([A-Z])/
3
-
4
- function camelCase(name) {
5
- return name
6
- .replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
7
- return offset ? letter.toUpperCase() : letter
8
- })
9
- .replace(MOZ_HACK_REGEXP, 'Moz$1')
10
- }
11
- // getStyle
12
- export function getStyle(element, styleName) {
13
- if (!element || !styleName) return null
14
- styleName = camelCase(styleName)
15
- if (styleName === 'float') {
16
- styleName = 'cssFloat'
17
- }
18
- try {
19
- const computed = document.defaultView.getComputedStyle(element, '')
20
- return element.style[styleName] || computed ? computed[styleName] : null
21
- } catch (e) {
22
- return element.style[styleName]
23
- }
24
- }
1
+ const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g
2
+ const MOZ_HACK_REGEXP = /^moz([A-Z])/
3
+
4
+ function camelCase(name) {
5
+ return name
6
+ .replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
7
+ return offset ? letter.toUpperCase() : letter
8
+ })
9
+ .replace(MOZ_HACK_REGEXP, 'Moz$1')
10
+ }
11
+ // getStyle
12
+ export function getStyle(element, styleName) {
13
+ if (!element || !styleName) return null
14
+ styleName = camelCase(styleName)
15
+ if (styleName === 'float') {
16
+ styleName = 'cssFloat'
17
+ }
18
+ try {
19
+ const computed = document.defaultView.getComputedStyle(element, '')
20
+ return element.style[styleName] || computed ? computed[styleName] : null
21
+ } catch (e) {
22
+ return element.style[styleName]
23
+ }
24
+ }
@@ -1,7 +1,7 @@
1
- let transferIndex = 1000
2
-
3
- function transferIncrease() {
4
- transferIndex++
5
- }
6
-
7
- export { transferIndex, transferIncrease }
1
+ let transferIndex = 1000
2
+
3
+ function transferIncrease() {
4
+ transferIndex++
5
+ }
6
+
7
+ export { transferIndex, transferIncrease }
package/utils/type.js CHANGED
@@ -1,102 +1,102 @@
1
- /*
2
- * Copyright 2019 WeBank
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- const objectToString = Object.prototype.toString;
19
- const OBJECT_STRING = '[object Object]';
20
-
21
- /**
22
- * 是否是普通对象
23
- * @param {any} obj
24
- * @return {Boolean}
25
- */
26
- export function isPlainObject(obj) {
27
- return objectToString.call(obj) === OBJECT_STRING;
28
- }
29
-
30
- /**
31
- * 是否是数字
32
- * @param {any} value
33
- * @return {Boolean}
34
- */
35
- export function isNumber(value) {
36
- return typeof value === 'number';
37
- }
38
-
39
- /**
40
- * 是否是日期
41
- * @param {any} value
42
- * @return {Boolean}
43
- */
44
- export function isDate(value) {
45
- return objectToString.call(value) === '[object Date]';
46
- }
47
-
48
- /**
49
- * 是否是函数
50
- * @param {any} value
51
- * @return {Boolean}
52
- */
53
- export function isFunction(value) {
54
- return typeof value === 'function';
55
- }
56
-
57
- /**
58
- * 是否是函数
59
- * @param {any} value
60
- * @return {Boolean}
61
- */
62
- export function isObject(value) {
63
- let type = typeof value;
64
- return !!value && (type == 'object' || type == 'function');
65
- }
66
-
67
- /**
68
- * 是否是数组
69
- * @param {any} value
70
- * @return {Boolean}
71
- */
72
- export function isArray(value) {
73
- return Array.isArray(value);
74
- }
75
-
76
- /**
77
- * 是否像对象
78
- * @param {any} value
79
- * @return {Boolean}
80
- */
81
- export function isObjectLike(value) {
82
- return !!value && typeof value == 'object';
83
- }
84
-
85
- /**
86
- * 是否是字符串
87
- * @param {any} value
88
- * @return {Boolean}
89
- */
90
- export function isString(value) {
91
- return typeof value == 'string' ||
92
- (!isArray(value) && isObjectLike(value) && objectToString.call(value) == '[object String]');
93
- }
94
-
95
- /**
96
- * 是否是空的
97
- * @param {any} value
98
- * @return {Boolean}
99
- */
100
- export function isNull(value) {
101
- return value === undefined || value === null || value === '';
102
- }
1
+ /*
2
+ * Copyright 2019 WeBank
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ const objectToString = Object.prototype.toString;
19
+ const OBJECT_STRING = '[object Object]';
20
+
21
+ /**
22
+ * 是否是普通对象
23
+ * @param {any} obj
24
+ * @return {Boolean}
25
+ */
26
+ export function isPlainObject(obj) {
27
+ return objectToString.call(obj) === OBJECT_STRING;
28
+ }
29
+
30
+ /**
31
+ * 是否是数字
32
+ * @param {any} value
33
+ * @return {Boolean}
34
+ */
35
+ export function isNumber(value) {
36
+ return typeof value === 'number';
37
+ }
38
+
39
+ /**
40
+ * 是否是日期
41
+ * @param {any} value
42
+ * @return {Boolean}
43
+ */
44
+ export function isDate(value) {
45
+ return objectToString.call(value) === '[object Date]';
46
+ }
47
+
48
+ /**
49
+ * 是否是函数
50
+ * @param {any} value
51
+ * @return {Boolean}
52
+ */
53
+ export function isFunction(value) {
54
+ return typeof value === 'function';
55
+ }
56
+
57
+ /**
58
+ * 是否是函数
59
+ * @param {any} value
60
+ * @return {Boolean}
61
+ */
62
+ export function isObject(value) {
63
+ let type = typeof value;
64
+ return !!value && (type == 'object' || type == 'function');
65
+ }
66
+
67
+ /**
68
+ * 是否是数组
69
+ * @param {any} value
70
+ * @return {Boolean}
71
+ */
72
+ export function isArray(value) {
73
+ return Array.isArray(value);
74
+ }
75
+
76
+ /**
77
+ * 是否像对象
78
+ * @param {any} value
79
+ * @return {Boolean}
80
+ */
81
+ export function isObjectLike(value) {
82
+ return !!value && typeof value == 'object';
83
+ }
84
+
85
+ /**
86
+ * 是否是字符串
87
+ * @param {any} value
88
+ * @return {Boolean}
89
+ */
90
+ export function isString(value) {
91
+ return typeof value == 'string' ||
92
+ (!isArray(value) && isObjectLike(value) && objectToString.call(value) == '[object String]');
93
+ }
94
+
95
+ /**
96
+ * 是否是空的
97
+ * @param {any} value
98
+ * @return {Boolean}
99
+ */
100
+ export function isNull(value) {
101
+ return value === undefined || value === null || value === '';
102
+ }
@@ -1,23 +0,0 @@
1
- import * as CryptoJS from 'crypto-js';
2
-
3
- const AES_KEY = 'gYj2iqBV5AzxC8H0';
4
- const AES_IV = 'z5c8fSuHX1PxWtIg';
5
-
6
- crypto.aes = {
7
- encrypt(message) {
8
- return CryptoJS.AES.encrypt(message, AES_KEY, {
9
- mode: CryptoJS.mode.CBC,
10
- padding: CryptoJS.pad.Pkcs7,
11
- iv: AES_IV
12
- })
13
- },
14
- decrypt(ciphertext) {
15
- return CryptoJS.AES.decrypt(ciphertext, AES_KEY, {
16
- mode: CryptoJS.mode.CBC,
17
- padding: CryptoJS.pad.Pkcs7,
18
- iv: AES_IV
19
- }).toString(CryptoJS.enc.Utf8)
20
- }
21
- }
22
-
23
- export default crypto.aes;
@@ -1,16 +0,0 @@
1
- import NodeRSA from "node-rsa";
2
-
3
- const publicKey = `-----BEGIN PUBLIC KEY-----
4
- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCyhhlApSAjPWRjzg+wSIfALbrC
5
- Ti4GVBYYBjfMYKU0O9z6EGQAXSLPW+S4VYm4LKtKXuKoeF441KU2HvnGM63cTIYt
6
- T4lGbTGeYfsbeWNs1u9G9J+DrfKK8HsVB1IZIqhbMf0x7KGMeoQ2SN4KtbaPIwhl
7
- IPfXzuLZiCW90l+a/wIDAQAB
8
- -----END PUBLIC KEY-----`;
9
-
10
- // 创建NodeRSA实例并指定公钥格式
11
- const key = new NodeRSA(publicKey, "pkcs8-public");
12
-
13
- // 加密函数
14
- function rsa(data) {
15
- return key.encrypt(data, "base64");
16
- }