@cloudbase/cals 0.4.2 → 0.4.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.
- package/README.md +1 -1
- package/lib/utils/CSSProperty.d.ts +60 -0
- package/lib/utils/CSSProperty.d.ts.map +1 -0
- package/lib/utils/CSSProperty.js +84 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +3 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ CALS 规范主要分为三部分 :
|
|
|
18
18
|
|
|
19
19
|
## 应用
|
|
20
20
|
|
|
21
|
-
CALS 扩展自[通用组件语言规范](https://cls.pages.woa.com/)
|
|
21
|
+
CALS 扩展自[通用组件语言规范](https://cls.pages.woa.com/),目前主要应用于微搭低代码平台,目前定义了 basic 和 platform 两套规范(platform 继承自 basic):
|
|
22
22
|
|
|
23
23
|
| 类型 | 层级 | 定义 |
|
|
24
24
|
| -------------- | ---- | ------------------------------------------ |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 来源:packages/react-dom/src/shared/CSSProperty.js
|
|
9
|
+
* react-dom 内部实现用于判断是否补齐 number 类型数据的 px 单位
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* CSS properties which accept numbers but are not in units of "px".
|
|
13
|
+
*/
|
|
14
|
+
export declare const isUnitlessNumber: {
|
|
15
|
+
animationIterationCount: boolean;
|
|
16
|
+
aspectRatio: boolean;
|
|
17
|
+
borderImage: boolean;
|
|
18
|
+
borderImageOutset: boolean;
|
|
19
|
+
borderImageSlice: boolean;
|
|
20
|
+
borderImageWidth: boolean;
|
|
21
|
+
boxFlex: boolean;
|
|
22
|
+
boxFlexGroup: boolean;
|
|
23
|
+
boxOrdinalGroup: boolean;
|
|
24
|
+
columnCount: boolean;
|
|
25
|
+
columns: boolean;
|
|
26
|
+
flex: boolean;
|
|
27
|
+
flexGrow: boolean;
|
|
28
|
+
flexPositive: boolean;
|
|
29
|
+
flexShrink: boolean;
|
|
30
|
+
flexNegative: boolean;
|
|
31
|
+
flexOrder: boolean;
|
|
32
|
+
gridArea: boolean;
|
|
33
|
+
gridRow: boolean;
|
|
34
|
+
gridRowEnd: boolean;
|
|
35
|
+
gridRowSpan: boolean;
|
|
36
|
+
gridRowStart: boolean;
|
|
37
|
+
gridColumn: boolean;
|
|
38
|
+
gridColumnEnd: boolean;
|
|
39
|
+
gridColumnSpan: boolean;
|
|
40
|
+
gridColumnStart: boolean;
|
|
41
|
+
fontWeight: boolean;
|
|
42
|
+
lineClamp: boolean;
|
|
43
|
+
lineHeight: boolean;
|
|
44
|
+
opacity: boolean;
|
|
45
|
+
order: boolean;
|
|
46
|
+
orphans: boolean;
|
|
47
|
+
tabSize: boolean;
|
|
48
|
+
widows: boolean;
|
|
49
|
+
zIndex: boolean;
|
|
50
|
+
zoom: boolean;
|
|
51
|
+
fillOpacity: boolean;
|
|
52
|
+
floodOpacity: boolean;
|
|
53
|
+
stopOpacity: boolean;
|
|
54
|
+
strokeDasharray: boolean;
|
|
55
|
+
strokeDashoffset: boolean;
|
|
56
|
+
strokeMiterlimit: boolean;
|
|
57
|
+
strokeOpacity: boolean;
|
|
58
|
+
strokeWidth: boolean;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=CSSProperty.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isUnitlessNumber = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* 来源:packages/react-dom/src/shared/CSSProperty.js
|
|
12
|
+
* react-dom 内部实现用于判断是否补齐 number 类型数据的 px 单位
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* CSS properties which accept numbers but are not in units of "px".
|
|
16
|
+
*/
|
|
17
|
+
exports.isUnitlessNumber = {
|
|
18
|
+
animationIterationCount: true,
|
|
19
|
+
aspectRatio: true,
|
|
20
|
+
borderImage: true,
|
|
21
|
+
borderImageOutset: true,
|
|
22
|
+
borderImageSlice: true,
|
|
23
|
+
borderImageWidth: true,
|
|
24
|
+
boxFlex: true,
|
|
25
|
+
boxFlexGroup: true,
|
|
26
|
+
boxOrdinalGroup: true,
|
|
27
|
+
columnCount: true,
|
|
28
|
+
columns: true,
|
|
29
|
+
flex: true,
|
|
30
|
+
flexGrow: true,
|
|
31
|
+
flexPositive: true,
|
|
32
|
+
flexShrink: true,
|
|
33
|
+
flexNegative: true,
|
|
34
|
+
flexOrder: true,
|
|
35
|
+
gridArea: true,
|
|
36
|
+
gridRow: true,
|
|
37
|
+
gridRowEnd: true,
|
|
38
|
+
gridRowSpan: true,
|
|
39
|
+
gridRowStart: true,
|
|
40
|
+
gridColumn: true,
|
|
41
|
+
gridColumnEnd: true,
|
|
42
|
+
gridColumnSpan: true,
|
|
43
|
+
gridColumnStart: true,
|
|
44
|
+
fontWeight: true,
|
|
45
|
+
lineClamp: true,
|
|
46
|
+
lineHeight: true,
|
|
47
|
+
opacity: true,
|
|
48
|
+
order: true,
|
|
49
|
+
orphans: true,
|
|
50
|
+
tabSize: true,
|
|
51
|
+
widows: true,
|
|
52
|
+
zIndex: true,
|
|
53
|
+
zoom: true,
|
|
54
|
+
// SVG-related properties
|
|
55
|
+
fillOpacity: true,
|
|
56
|
+
floodOpacity: true,
|
|
57
|
+
stopOpacity: true,
|
|
58
|
+
strokeDasharray: true,
|
|
59
|
+
strokeDashoffset: true,
|
|
60
|
+
strokeMiterlimit: true,
|
|
61
|
+
strokeOpacity: true,
|
|
62
|
+
strokeWidth: true,
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @param {string} prefix vendor-specific prefix, eg: Webkit
|
|
66
|
+
* @param {string} key style name, eg: transitionDuration
|
|
67
|
+
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
|
68
|
+
* WebkitTransitionDuration
|
|
69
|
+
*/
|
|
70
|
+
function prefixKey(prefix, key) {
|
|
71
|
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Support style names that may come passed in prefixed by adding permutations
|
|
75
|
+
* of vendor prefixes.
|
|
76
|
+
*/
|
|
77
|
+
const prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
|
78
|
+
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
|
|
79
|
+
// infinite loop, because it iterates over the newly added props too.
|
|
80
|
+
Object.keys(exports.isUnitlessNumber).forEach(function (prop) {
|
|
81
|
+
prefixes.forEach(function (prefix) {
|
|
82
|
+
exports.isUnitlessNumber[prefixKey(prefix, prop)] = exports.isUnitlessNumber[prop];
|
|
83
|
+
});
|
|
84
|
+
});
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/lib/utils/index.js
CHANGED
|
@@ -14,6 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isUnitlessNumber = void 0;
|
|
17
18
|
__exportStar(require("../parser"), exports);
|
|
18
19
|
__exportStar(require("../types/index"), exports);
|
|
19
20
|
__exportStar(require("./constant"), exports);
|
|
21
|
+
var CSSProperty_1 = require("./CSSProperty");
|
|
22
|
+
Object.defineProperty(exports, "isUnitlessNumber", { enumerable: true, get: function () { return CSSProperty_1.isUnitlessNumber; } });
|
package/package.json
CHANGED