@cloudbase/cals 0.4.11-beta.2 → 0.4.11-beta.3

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;AAMrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA0ID,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,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,CAuU7B;AASD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO;;CAAwB,GAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B"}
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;AAMrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA0ID,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,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,CAgU7B;AASD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO;;CAAwB,GAC9B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B"}
@@ -230,6 +230,21 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
230
230
  if (radiusInfo && !(0, common_1.isEmptyObj)(radiusInfo)) {
231
231
  let { topLeft, topRight, bottomRight, bottomLeft } = radiusInfo;
232
232
  if (Object.keys(radiusInfo).length === 4) {
233
+ // 包含不为空的属性,将部分为空属性处理成 0
234
+ if (Object.values(radiusInfo).some((corner) => !!corner)) {
235
+ if (!topLeft) {
236
+ topLeft = '0';
237
+ }
238
+ if (!topRight) {
239
+ topRight = '0';
240
+ }
241
+ if (!bottomRight) {
242
+ bottomRight = '0';
243
+ }
244
+ if (!bottomLeft) {
245
+ bottomLeft = '0';
246
+ }
247
+ }
233
248
  if ((0, lodash_1.uniq)((0, lodash_1.map)(radiusInfo, (val) => val)).length === 1) {
234
249
  // 4个值全相等的情况
235
250
  setStyleValue(style, 'borderRadius', _handleStyleNumValue(topLeft, !!options.addPXUnit));
@@ -242,21 +257,6 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
242
257
  setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(topRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomRight, !!options.addPXUnit)}`);
243
258
  }
244
259
  else {
245
- // 包含不为空的属性,将部分为空属性处理成 0
246
- if (Object.values(radiusInfo).some((corner) => !!corner)) {
247
- if (!topLeft) {
248
- topLeft = '0';
249
- }
250
- if (!topRight) {
251
- topRight = '0';
252
- }
253
- if (!bottomRight) {
254
- bottomRight = '0';
255
- }
256
- if (!bottomLeft) {
257
- bottomLeft = '0';
258
- }
259
- }
260
260
  setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(topRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomLeft, !!options.addPXUnit)}`);
261
261
  }
262
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cals",
3
- "version": "0.4.11-beta.2",
3
+ "version": "0.4.11-beta.3",
4
4
  "description": "Common application specifications",
5
5
  "main": "lib/utils/index.js",
6
6
  "source": "src/utils/index.ts",