@cloudbase/cals 0.4.4 → 0.4.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA0ID,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAA2B,EACxC,OAAO,GAAE;IACP,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACoD,GACrE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAmN7B;AASD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO;;CAAwB,GAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B"}
|
|
@@ -44,6 +44,8 @@ function setStyleValue(object, key, value) {
|
|
|
44
44
|
}
|
|
45
45
|
function _handleStyleNumValue(styleVal, addPXUnit) {
|
|
46
46
|
if (addPXUnit) {
|
|
47
|
+
// 该分支实际没有使用?
|
|
48
|
+
// styleValue = '0.2' 时处理有问题
|
|
47
49
|
const value = `${styleVal}`;
|
|
48
50
|
if (value.search(/^\d+$/) >= 0) {
|
|
49
51
|
return `${value}px`;
|
|
@@ -52,20 +54,21 @@ function _handleStyleNumValue(styleVal, addPXUnit) {
|
|
|
52
54
|
return styleVal;
|
|
53
55
|
}
|
|
54
56
|
function setDistanceStyle(style, distance, attr, addPXUnit) {
|
|
57
|
+
const attributeKey = (0, common_1.camelcase)(`${attr}`);
|
|
55
58
|
if (Object.keys(distance).length === 4) {
|
|
56
59
|
if ((0, lodash_1.uniq)((0, lodash_1.map)(distance, (val) => val)).length === 1) {
|
|
57
60
|
// 4个值全相等的情况
|
|
58
|
-
setStyleValue(style,
|
|
61
|
+
setStyleValue(style, attributeKey, _handleStyleNumValue(distance.top, addPXUnit));
|
|
59
62
|
}
|
|
60
63
|
else if (distance.top === distance.bottom && distance.left === distance.right) {
|
|
61
64
|
// 俩俩相等的情况
|
|
62
|
-
setStyleValue(style,
|
|
65
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)}`);
|
|
63
66
|
}
|
|
64
67
|
else if (distance.left === distance.right) {
|
|
65
|
-
setStyleValue(style,
|
|
68
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)}`);
|
|
66
69
|
}
|
|
67
70
|
else {
|
|
68
|
-
setStyleValue(style,
|
|
71
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)} ${_handleStyleNumValue(distance.left, addPXUnit)}`);
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
else {
|
|
@@ -40,7 +40,10 @@ export declare const isUnitlessNumber: {
|
|
|
40
40
|
gridColumnStart: boolean;
|
|
41
41
|
fontWeight: boolean;
|
|
42
42
|
lineClamp: boolean;
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* TODO:
|
|
45
|
+
* 历史原因,存量大量的是当做默认补充 px 单位来做的,导致没法一下子兼容,需要刷新设计态数据
|
|
46
|
+
*/
|
|
44
47
|
opacity: boolean;
|
|
45
48
|
order: boolean;
|
|
46
49
|
orphans: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSSProperty.d.ts","sourceRoot":"","sources":["../../src/utils/CSSProperty.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH;;GAEG;AAEH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"CSSProperty.d.ts","sourceRoot":"","sources":["../../src/utils/CSSProperty.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH;;GAEG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6B3B;;;OAGG;;;;;;;;;;;;;;;;CAmBJ,CAAC"}
|
package/lib/utils/CSSProperty.js
CHANGED
|
@@ -43,7 +43,11 @@ exports.isUnitlessNumber = {
|
|
|
43
43
|
gridColumnStart: true,
|
|
44
44
|
fontWeight: true,
|
|
45
45
|
lineClamp: true,
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* TODO:
|
|
48
|
+
* 历史原因,存量大量的是当做默认补充 px 单位来做的,导致没法一下子兼容,需要刷新设计态数据
|
|
49
|
+
*/
|
|
50
|
+
// lineHeight: true,
|
|
47
51
|
opacity: true,
|
|
48
52
|
order: true,
|
|
49
53
|
orphans: true,
|