snail.view 1.0.14 → 1.0.15

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.
@@ -54,7 +54,7 @@ type CSSDescriptor = {
54
54
  * - 高度、宽度、对齐、边框、内边距等合集
55
55
  * - 对齐方式、、、
56
56
  */
57
- type AllStyle = BaseStyle & FlexBoxStyle & WidthStyle & HeightStyle & MarginStyle & BorderStyle & PaddingStyle & TransitionStyle;
57
+ type AllStyle = BaseStyle & FlexBoxStyle & WidthStyle & HeightStyle & MarginStyle & BorderStyle & PaddingStyle & PositionStyle & TransitionStyle;
58
58
  /**
59
59
  * 基础样式:对齐方式、颜色属性
60
60
  */
@@ -241,6 +241,27 @@ type PaddingStyle = {
241
241
  */
242
242
  paddingLeft?: string;
243
243
  };
244
+ /**
245
+ * 位置样式
246
+ */
247
+ type PositionStyle = {
248
+ /**
249
+ * x轴 左侧 值
250
+ */
251
+ left?: string;
252
+ /**
253
+ * x轴 右侧 值
254
+ */
255
+ right?: string;
256
+ /**
257
+ * y轴 顶部 值
258
+ */
259
+ top?: string;
260
+ /**
261
+ * y轴 底部 值
262
+ */
263
+ bottom?: string;
264
+ };
244
265
  /**
245
266
  * 过渡效果 样式
246
267
  */
@@ -499,4 +520,4 @@ type ElementSize = {
499
520
  declare function useObserver(): IObserver & IScope;
500
521
 
501
522
  export { configLink, css, link, linkMap, useAnimation, useLink, useObserver };
502
- export type { AllStyle, BaseStyle, BorderStyle, CSS, CSSDescriptor, ElementSize, FlexBoxStyle, HeightStyle, IAnimationManager, ICSSManager, ILinkManager, IObserver, LinkElement, LinkFile, LinkOptions, MarginStyle, PaddingStyle, TransitionEffect, TransitionStyle, WidthStyle };
523
+ export type { AllStyle, BaseStyle, BorderStyle, CSS, CSSDescriptor, ElementSize, FlexBoxStyle, HeightStyle, IAnimationManager, ICSSManager, ILinkManager, IObserver, LinkElement, LinkFile, LinkOptions, MarginStyle, PaddingStyle, PositionStyle, TransitionEffect, TransitionStyle, WidthStyle };
@@ -37,49 +37,53 @@ function useCSS() {
37
37
  return style;
38
38
  }
39
39
  {
40
- options.color && (style.color = options.color);
41
- options.backgroundColor && (style.backgroundColor = options.backgroundColor);
42
- options.textAlign && (style.textAlign = options.textAlign);
43
- options.verticalAlign && (style.verticalAlign = options.verticalAlign);
44
- options.justifyContent && (style.justifyContent = options.justifyContent);
45
- options.alignItems && (style.alignItems = options.alignItems);
46
- options.flex && (style.flex = options.flex);
47
- options.flexBasis && (style.flexBasis = options.flexBasis);
48
- options.flexGrow > 0 && (style.flexGrow = String(options.flexGrow));
49
- options.flexShrink > 0 && (style.flexShrink = String(options.flexShrink));
50
- options.order > 0 && (style.order = String(options.order));
51
- options.alignSelf && (style.alignSelf = options.alignSelf);
40
+ options.color != void 0 && (style.color = options.color);
41
+ options.backgroundColor != void 0 && (style.backgroundColor = options.backgroundColor);
42
+ options.textAlign != void 0 && (style.textAlign = options.textAlign);
43
+ options.verticalAlign != void 0 && (style.verticalAlign = options.verticalAlign);
44
+ options.justifyContent != void 0 && (style.justifyContent = options.justifyContent);
45
+ options.alignItems != void 0 && (style.alignItems = options.alignItems);
46
+ options.flex != void 0 && (style.flex = options.flex);
47
+ options.flexBasis != void 0 && (style.flexBasis = options.flexBasis);
48
+ options.flexGrow > 0 != void 0 && (style.flexGrow = String(options.flexGrow));
49
+ options.flexShrink > 0 != void 0 && (style.flexShrink = String(options.flexShrink));
50
+ options.order > 0 != void 0 && (style.order = String(options.order));
51
+ options.alignSelf != void 0 && (style.alignSelf = options.alignSelf);
52
52
  }
53
53
  {
54
- options.width && (style.width = options.width);
55
- options.minWidth && (style.minWidth = options.minWidth);
56
- options.maxWidth && (style.maxWidth = options.maxWidth);
57
- options.height && (style.height = options.height);
58
- options.minHeight && (style.minHeight = options.minHeight);
59
- options.maxHeight && (style.maxHeight = options.maxHeight);
60
- options.margin && (style.margin = options.margin);
61
- options.marginTop && (style.marginTop = options.marginTop);
62
- options.marginRight && (style.marginRight = options.marginRight);
63
- options.marginBottom && (style.marginBottom = options.marginBottom);
64
- options.marginLeft && (style.marginLeft = options.marginLeft);
65
- options.borderRadius && (style.borderRadius = options.borderRadius);
66
- options.border && (style.border = options.border);
67
- options.borderTop && (style.borderTop = options.borderTop);
68
- options.borderRight && (style.borderRight = options.borderRight);
69
- options.borderBottom && (style.borderBottom = options.borderBottom);
70
- options.borderLeft && (style.borderLeft = options.borderLeft);
71
- options.padding && (style.padding = options.padding);
72
- options.paddingTop && (style.paddingTop = options.paddingTop);
73
- options.paddingRight && (style.paddingRight = options.paddingRight);
74
- options.paddingBottom && (style.paddingBottom = options.paddingBottom);
75
- options.paddingLeft && (style.paddingLeft = options.paddingLeft);
54
+ options.width != void 0 && (style.width = options.width);
55
+ options.minWidth != void 0 && (style.minWidth = options.minWidth);
56
+ options.maxWidth != void 0 && (style.maxWidth = options.maxWidth);
57
+ options.height != void 0 && (style.height = options.height);
58
+ options.minHeight != void 0 && (style.minHeight = options.minHeight);
59
+ options.maxHeight != void 0 && (style.maxHeight = options.maxHeight);
60
+ options.margin != void 0 && (style.margin = options.margin);
61
+ options.marginTop != void 0 && (style.marginTop = options.marginTop);
62
+ options.marginRight != void 0 && (style.marginRight = options.marginRight);
63
+ options.marginBottom != void 0 && (style.marginBottom = options.marginBottom);
64
+ options.marginLeft != void 0 && (style.marginLeft = options.marginLeft);
65
+ options.borderRadius != void 0 && (style.borderRadius = options.borderRadius);
66
+ options.border != void 0 && (style.border = options.border);
67
+ options.borderTop != void 0 && (style.borderTop = options.borderTop);
68
+ options.borderRight != void 0 && (style.borderRight = options.borderRight);
69
+ options.borderBottom != void 0 && (style.borderBottom = options.borderBottom);
70
+ options.borderLeft != void 0 && (style.borderLeft = options.borderLeft);
71
+ options.padding != void 0 && (style.padding = options.padding);
72
+ options.paddingTop != void 0 && (style.paddingTop = options.paddingTop);
73
+ options.paddingRight != void 0 && (style.paddingRight = options.paddingRight);
74
+ options.paddingBottom != void 0 && (style.paddingBottom = options.paddingBottom);
75
+ options.paddingLeft != void 0 && (style.paddingLeft = options.paddingLeft);
76
+ options.left != void 0 && (style.left = options.left);
77
+ options.right != void 0 && (style.right = options.right);
78
+ options.top != void 0 && (style.top = options.top);
79
+ options.bottom != void 0 && (style.bottom = options.bottom);
76
80
  }
77
81
  {
78
- options.transition && (style.transition = options.transition);
79
- options.transitionProperty && (style.transitionProperty = options.transitionProperty);
80
- options.transitionDuration && (style.transitionDuration = options.transitionDuration);
81
- options.transitionDelay && (style.transitionDelay = options.transitionDelay);
82
- options.transitionTimingFunction && (style.transitionTimingFunction = options.transitionTimingFunction);
82
+ options.transition != void 0 && (style.transition = options.transition);
83
+ options.transitionProperty != void 0 && (style.transitionProperty = options.transitionProperty);
84
+ options.transitionDuration != void 0 && (style.transitionDuration = options.transitionDuration);
85
+ options.transitionDelay != void 0 && (style.transitionDelay = options.transitionDelay);
86
+ options.transitionTimingFunction != void 0 && (style.transitionTimingFunction = options.transitionTimingFunction);
83
87
  }
84
88
  return style;
85
89
  }
@@ -41,49 +41,53 @@
41
41
  return style;
42
42
  }
43
43
  {
44
- options.color && (style.color = options.color);
45
- options.backgroundColor && (style.backgroundColor = options.backgroundColor);
46
- options.textAlign && (style.textAlign = options.textAlign);
47
- options.verticalAlign && (style.verticalAlign = options.verticalAlign);
48
- options.justifyContent && (style.justifyContent = options.justifyContent);
49
- options.alignItems && (style.alignItems = options.alignItems);
50
- options.flex && (style.flex = options.flex);
51
- options.flexBasis && (style.flexBasis = options.flexBasis);
52
- options.flexGrow > 0 && (style.flexGrow = String(options.flexGrow));
53
- options.flexShrink > 0 && (style.flexShrink = String(options.flexShrink));
54
- options.order > 0 && (style.order = String(options.order));
55
- options.alignSelf && (style.alignSelf = options.alignSelf);
44
+ options.color != void 0 && (style.color = options.color);
45
+ options.backgroundColor != void 0 && (style.backgroundColor = options.backgroundColor);
46
+ options.textAlign != void 0 && (style.textAlign = options.textAlign);
47
+ options.verticalAlign != void 0 && (style.verticalAlign = options.verticalAlign);
48
+ options.justifyContent != void 0 && (style.justifyContent = options.justifyContent);
49
+ options.alignItems != void 0 && (style.alignItems = options.alignItems);
50
+ options.flex != void 0 && (style.flex = options.flex);
51
+ options.flexBasis != void 0 && (style.flexBasis = options.flexBasis);
52
+ options.flexGrow > 0 != void 0 && (style.flexGrow = String(options.flexGrow));
53
+ options.flexShrink > 0 != void 0 && (style.flexShrink = String(options.flexShrink));
54
+ options.order > 0 != void 0 && (style.order = String(options.order));
55
+ options.alignSelf != void 0 && (style.alignSelf = options.alignSelf);
56
56
  }
57
57
  {
58
- options.width && (style.width = options.width);
59
- options.minWidth && (style.minWidth = options.minWidth);
60
- options.maxWidth && (style.maxWidth = options.maxWidth);
61
- options.height && (style.height = options.height);
62
- options.minHeight && (style.minHeight = options.minHeight);
63
- options.maxHeight && (style.maxHeight = options.maxHeight);
64
- options.margin && (style.margin = options.margin);
65
- options.marginTop && (style.marginTop = options.marginTop);
66
- options.marginRight && (style.marginRight = options.marginRight);
67
- options.marginBottom && (style.marginBottom = options.marginBottom);
68
- options.marginLeft && (style.marginLeft = options.marginLeft);
69
- options.borderRadius && (style.borderRadius = options.borderRadius);
70
- options.border && (style.border = options.border);
71
- options.borderTop && (style.borderTop = options.borderTop);
72
- options.borderRight && (style.borderRight = options.borderRight);
73
- options.borderBottom && (style.borderBottom = options.borderBottom);
74
- options.borderLeft && (style.borderLeft = options.borderLeft);
75
- options.padding && (style.padding = options.padding);
76
- options.paddingTop && (style.paddingTop = options.paddingTop);
77
- options.paddingRight && (style.paddingRight = options.paddingRight);
78
- options.paddingBottom && (style.paddingBottom = options.paddingBottom);
79
- options.paddingLeft && (style.paddingLeft = options.paddingLeft);
58
+ options.width != void 0 && (style.width = options.width);
59
+ options.minWidth != void 0 && (style.minWidth = options.minWidth);
60
+ options.maxWidth != void 0 && (style.maxWidth = options.maxWidth);
61
+ options.height != void 0 && (style.height = options.height);
62
+ options.minHeight != void 0 && (style.minHeight = options.minHeight);
63
+ options.maxHeight != void 0 && (style.maxHeight = options.maxHeight);
64
+ options.margin != void 0 && (style.margin = options.margin);
65
+ options.marginTop != void 0 && (style.marginTop = options.marginTop);
66
+ options.marginRight != void 0 && (style.marginRight = options.marginRight);
67
+ options.marginBottom != void 0 && (style.marginBottom = options.marginBottom);
68
+ options.marginLeft != void 0 && (style.marginLeft = options.marginLeft);
69
+ options.borderRadius != void 0 && (style.borderRadius = options.borderRadius);
70
+ options.border != void 0 && (style.border = options.border);
71
+ options.borderTop != void 0 && (style.borderTop = options.borderTop);
72
+ options.borderRight != void 0 && (style.borderRight = options.borderRight);
73
+ options.borderBottom != void 0 && (style.borderBottom = options.borderBottom);
74
+ options.borderLeft != void 0 && (style.borderLeft = options.borderLeft);
75
+ options.padding != void 0 && (style.padding = options.padding);
76
+ options.paddingTop != void 0 && (style.paddingTop = options.paddingTop);
77
+ options.paddingRight != void 0 && (style.paddingRight = options.paddingRight);
78
+ options.paddingBottom != void 0 && (style.paddingBottom = options.paddingBottom);
79
+ options.paddingLeft != void 0 && (style.paddingLeft = options.paddingLeft);
80
+ options.left != void 0 && (style.left = options.left);
81
+ options.right != void 0 && (style.right = options.right);
82
+ options.top != void 0 && (style.top = options.top);
83
+ options.bottom != void 0 && (style.bottom = options.bottom);
80
84
  }
81
85
  {
82
- options.transition && (style.transition = options.transition);
83
- options.transitionProperty && (style.transitionProperty = options.transitionProperty);
84
- options.transitionDuration && (style.transitionDuration = options.transitionDuration);
85
- options.transitionDelay && (style.transitionDelay = options.transitionDelay);
86
- options.transitionTimingFunction && (style.transitionTimingFunction = options.transitionTimingFunction);
86
+ options.transition != void 0 && (style.transition = options.transition);
87
+ options.transitionProperty != void 0 && (style.transitionProperty = options.transitionProperty);
88
+ options.transitionDuration != void 0 && (style.transitionDuration = options.transitionDuration);
89
+ options.transitionDelay != void 0 && (style.transitionDelay = options.transitionDelay);
90
+ options.transitionTimingFunction != void 0 && (style.transitionTimingFunction = options.transitionTimingFunction);
87
91
  }
88
92
  return style;
89
93
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "对视图界面做的一些封装。如样式计算助手方法,常用样式less混入、变量等;dom相关助手类",
4
4
  "author": "snail_dev@163.com",
5
5
  "license": "MIT",
6
- "version": "1.0.14",
6
+ "version": "1.0.15",
7
7
  "type": "module",
8
8
  "main": "dist/snail.view.js",
9
9
  "module": "dist/snail.view.js",
@@ -14,7 +14,7 @@
14
14
  "types": "tsc -p ./tsconfig.dts.json --declarationDir ./dist/_types"
15
15
  },
16
16
  "dependencies": {
17
- "snail.core": ">=2.0.10"
17
+ "snail.core": ">=2.0.11"
18
18
  },
19
19
  "devDependencies": {
20
20
  "rollup": ">=4.39.0",