@lambo-design/shared 1.0.0-beta.280 → 1.0.0-beta.283
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.
- package/package.json +1 -1
- package/utils/platform.js +6 -2
- package/utils/style.js +24 -24
- package/utils/transfer-queue.js +7 -7
package/package.json
CHANGED
package/utils/platform.js
CHANGED
|
@@ -864,8 +864,12 @@ export const isCenterApp = (app) => {
|
|
|
864
864
|
export const buildNavListByMenu = (permissionList,appInfo,appType,defaultHideName = '') => {
|
|
865
865
|
let navList = []
|
|
866
866
|
if (permissionList && appInfo && appInfo.appId) {
|
|
867
|
+
let hideNames = [];
|
|
868
|
+
if (defaultHideName && typeof defaultHideName === 'string') {
|
|
869
|
+
hideNames = defaultHideName.split(',').map(name => name.trim());
|
|
870
|
+
}
|
|
867
871
|
let permissions = permissionList.filter(item => item.hasOwnProperty('pid')
|
|
868
|
-
&& item.pid == '0' && item.appId == appInfo.appId && item.name
|
|
872
|
+
&& item.pid == '0' && item.appId == appInfo.appId && !hideNames.includes(item.name))
|
|
869
873
|
for (let per of permissions) {
|
|
870
874
|
if (appType && appType == 'sc') {
|
|
871
875
|
let nav = {
|
|
@@ -1174,7 +1178,7 @@ export const buildParams = (href, key, value) =>{
|
|
|
1174
1178
|
href += '?' + key + '=' + value
|
|
1175
1179
|
}
|
|
1176
1180
|
} else {
|
|
1177
|
-
href =
|
|
1181
|
+
href = replaceUrlParam(href,key,value)
|
|
1178
1182
|
}
|
|
1179
1183
|
return href;
|
|
1180
1184
|
}
|
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
|
+
}
|
package/utils/transfer-queue.js
CHANGED
|
@@ -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 }
|