@triniwiz/nativescript-masonkit 1.0.0-alpha.34 → 1.0.0-alpha.36
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/common.d.ts +141 -0
- package/common.js +1800 -0
- package/common.js.map +1 -0
- package/img/index.android.d.ts +10 -0
- package/img/index.android.js +40 -0
- package/img/index.android.js.map +1 -0
- package/img/index.ios.d.ts +13 -0
- package/img/index.ios.js +102 -0
- package/img/index.ios.js.map +1 -0
- package/index.android.d.ts +5 -0
- package/index.android.js +6 -0
- package/index.android.js.map +1 -0
- package/index.ios.d.ts +5 -0
- package/index.ios.js +6 -0
- package/index.ios.js.map +1 -0
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +103 -50
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +50 -76
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +44690 -33943
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4116 -3259
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +206 -100
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +50 -76
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +44690 -33943
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +44690 -33943
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +283 -129
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4111 -3259
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +3984 -3181
- package/scroll/index.android.d.ts +12 -0
- package/scroll/index.android.js +50 -0
- package/scroll/index.android.js.map +1 -0
- package/scroll/index.ios.d.ts +14 -0
- package/scroll/index.ios.js +120 -0
- package/scroll/index.ios.js.map +1 -0
- package/style.d.ts +223 -0
- package/style.js +2725 -0
- package/style.js.map +1 -0
- package/text/index.android.d.ts +30 -0
- package/text/index.android.js +124 -0
- package/text/index.android.js.map +1 -0
- package/text/index.ios.d.ts +38 -0
- package/text/index.ios.js +252 -0
- package/text/index.ios.js.map +1 -0
- package/tree/index.android.d.ts +27 -0
- package/tree/index.android.js +74 -0
- package/tree/index.android.js.map +1 -0
- package/tree/index.ios.d.ts +28 -0
- package/tree/index.ios.js +73 -0
- package/tree/index.ios.js.map +1 -0
- package/utils/index.android.d.ts +187 -0
- package/utils/index.android.js +514 -0
- package/utils/index.android.js.map +1 -0
- package/utils/index.ios.d.ts +198 -0
- package/utils/index.ios.js +710 -0
- package/utils/index.ios.js.map +1 -0
- package/view/index.android.d.ts +12 -0
- package/view/index.android.js +50 -0
- package/view/index.android.js.map +1 -0
- package/view/index.ios.d.ts +16 -0
- package/view/index.ios.js +123 -0
- package/view/index.ios.js.map +1 -0
- package/web.d.ts +55 -0
- package/web.js +189 -0
- package/web.js.map +1 -0
package/style.js
ADDED
|
@@ -0,0 +1,2725 @@
|
|
|
1
|
+
import { layout } from '@nativescript/core/utils';
|
|
2
|
+
import { Length as CoreLength } from '@nativescript/core';
|
|
3
|
+
var StyleKeys;
|
|
4
|
+
(function (StyleKeys) {
|
|
5
|
+
StyleKeys[StyleKeys["DISPLAY"] = 0] = "DISPLAY";
|
|
6
|
+
StyleKeys[StyleKeys["POSITION"] = 4] = "POSITION";
|
|
7
|
+
StyleKeys[StyleKeys["DIRECTION"] = 8] = "DIRECTION";
|
|
8
|
+
StyleKeys[StyleKeys["FLEX_DIRECTION"] = 12] = "FLEX_DIRECTION";
|
|
9
|
+
StyleKeys[StyleKeys["FLEX_WRAP"] = 16] = "FLEX_WRAP";
|
|
10
|
+
StyleKeys[StyleKeys["OVERFLOW_X"] = 20] = "OVERFLOW_X";
|
|
11
|
+
StyleKeys[StyleKeys["OVERFLOW_Y"] = 24] = "OVERFLOW_Y";
|
|
12
|
+
StyleKeys[StyleKeys["ALIGN_ITEMS"] = 28] = "ALIGN_ITEMS";
|
|
13
|
+
StyleKeys[StyleKeys["ALIGN_SELF"] = 32] = "ALIGN_SELF";
|
|
14
|
+
StyleKeys[StyleKeys["ALIGN_CONTENT"] = 36] = "ALIGN_CONTENT";
|
|
15
|
+
StyleKeys[StyleKeys["JUSTIFY_ITEMS"] = 40] = "JUSTIFY_ITEMS";
|
|
16
|
+
StyleKeys[StyleKeys["JUSTIFY_SELF"] = 44] = "JUSTIFY_SELF";
|
|
17
|
+
StyleKeys[StyleKeys["JUSTIFY_CONTENT"] = 48] = "JUSTIFY_CONTENT";
|
|
18
|
+
StyleKeys[StyleKeys["INSET_LEFT_TYPE"] = 52] = "INSET_LEFT_TYPE";
|
|
19
|
+
StyleKeys[StyleKeys["INSET_LEFT_VALUE"] = 56] = "INSET_LEFT_VALUE";
|
|
20
|
+
StyleKeys[StyleKeys["INSET_RIGHT_TYPE"] = 60] = "INSET_RIGHT_TYPE";
|
|
21
|
+
StyleKeys[StyleKeys["INSET_RIGHT_VALUE"] = 64] = "INSET_RIGHT_VALUE";
|
|
22
|
+
StyleKeys[StyleKeys["INSET_TOP_TYPE"] = 68] = "INSET_TOP_TYPE";
|
|
23
|
+
StyleKeys[StyleKeys["INSET_TOP_VALUE"] = 72] = "INSET_TOP_VALUE";
|
|
24
|
+
StyleKeys[StyleKeys["INSET_BOTTOM_TYPE"] = 76] = "INSET_BOTTOM_TYPE";
|
|
25
|
+
StyleKeys[StyleKeys["INSET_BOTTOM_VALUE"] = 80] = "INSET_BOTTOM_VALUE";
|
|
26
|
+
StyleKeys[StyleKeys["MARGIN_LEFT_TYPE"] = 84] = "MARGIN_LEFT_TYPE";
|
|
27
|
+
StyleKeys[StyleKeys["MARGIN_LEFT_VALUE"] = 88] = "MARGIN_LEFT_VALUE";
|
|
28
|
+
StyleKeys[StyleKeys["MARGIN_RIGHT_TYPE"] = 92] = "MARGIN_RIGHT_TYPE";
|
|
29
|
+
StyleKeys[StyleKeys["MARGIN_RIGHT_VALUE"] = 96] = "MARGIN_RIGHT_VALUE";
|
|
30
|
+
StyleKeys[StyleKeys["MARGIN_TOP_TYPE"] = 100] = "MARGIN_TOP_TYPE";
|
|
31
|
+
StyleKeys[StyleKeys["MARGIN_TOP_VALUE"] = 104] = "MARGIN_TOP_VALUE";
|
|
32
|
+
StyleKeys[StyleKeys["MARGIN_BOTTOM_TYPE"] = 108] = "MARGIN_BOTTOM_TYPE";
|
|
33
|
+
StyleKeys[StyleKeys["MARGIN_BOTTOM_VALUE"] = 112] = "MARGIN_BOTTOM_VALUE";
|
|
34
|
+
StyleKeys[StyleKeys["PADDING_LEFT_TYPE"] = 116] = "PADDING_LEFT_TYPE";
|
|
35
|
+
StyleKeys[StyleKeys["PADDING_LEFT_VALUE"] = 120] = "PADDING_LEFT_VALUE";
|
|
36
|
+
StyleKeys[StyleKeys["PADDING_RIGHT_TYPE"] = 124] = "PADDING_RIGHT_TYPE";
|
|
37
|
+
StyleKeys[StyleKeys["PADDING_RIGHT_VALUE"] = 128] = "PADDING_RIGHT_VALUE";
|
|
38
|
+
StyleKeys[StyleKeys["PADDING_TOP_TYPE"] = 132] = "PADDING_TOP_TYPE";
|
|
39
|
+
StyleKeys[StyleKeys["PADDING_TOP_VALUE"] = 136] = "PADDING_TOP_VALUE";
|
|
40
|
+
StyleKeys[StyleKeys["PADDING_BOTTOM_TYPE"] = 140] = "PADDING_BOTTOM_TYPE";
|
|
41
|
+
StyleKeys[StyleKeys["PADDING_BOTTOM_VALUE"] = 144] = "PADDING_BOTTOM_VALUE";
|
|
42
|
+
StyleKeys[StyleKeys["BORDER_LEFT_TYPE"] = 148] = "BORDER_LEFT_TYPE";
|
|
43
|
+
StyleKeys[StyleKeys["BORDER_LEFT_VALUE"] = 152] = "BORDER_LEFT_VALUE";
|
|
44
|
+
StyleKeys[StyleKeys["BORDER_RIGHT_TYPE"] = 156] = "BORDER_RIGHT_TYPE";
|
|
45
|
+
StyleKeys[StyleKeys["BORDER_RIGHT_VALUE"] = 160] = "BORDER_RIGHT_VALUE";
|
|
46
|
+
StyleKeys[StyleKeys["BORDER_TOP_TYPE"] = 164] = "BORDER_TOP_TYPE";
|
|
47
|
+
StyleKeys[StyleKeys["BORDER_TOP_VALUE"] = 168] = "BORDER_TOP_VALUE";
|
|
48
|
+
StyleKeys[StyleKeys["BORDER_BOTTOM_TYPE"] = 172] = "BORDER_BOTTOM_TYPE";
|
|
49
|
+
StyleKeys[StyleKeys["BORDER_BOTTOM_VALUE"] = 176] = "BORDER_BOTTOM_VALUE";
|
|
50
|
+
StyleKeys[StyleKeys["FLEX_GROW"] = 180] = "FLEX_GROW";
|
|
51
|
+
StyleKeys[StyleKeys["FLEX_SHRINK"] = 184] = "FLEX_SHRINK";
|
|
52
|
+
StyleKeys[StyleKeys["FLEX_BASIS_TYPE"] = 188] = "FLEX_BASIS_TYPE";
|
|
53
|
+
StyleKeys[StyleKeys["FLEX_BASIS_VALUE"] = 192] = "FLEX_BASIS_VALUE";
|
|
54
|
+
StyleKeys[StyleKeys["WIDTH_TYPE"] = 196] = "WIDTH_TYPE";
|
|
55
|
+
StyleKeys[StyleKeys["WIDTH_VALUE"] = 200] = "WIDTH_VALUE";
|
|
56
|
+
StyleKeys[StyleKeys["HEIGHT_TYPE"] = 204] = "HEIGHT_TYPE";
|
|
57
|
+
StyleKeys[StyleKeys["HEIGHT_VALUE"] = 208] = "HEIGHT_VALUE";
|
|
58
|
+
StyleKeys[StyleKeys["MIN_WIDTH_TYPE"] = 212] = "MIN_WIDTH_TYPE";
|
|
59
|
+
StyleKeys[StyleKeys["MIN_WIDTH_VALUE"] = 216] = "MIN_WIDTH_VALUE";
|
|
60
|
+
StyleKeys[StyleKeys["MIN_HEIGHT_TYPE"] = 220] = "MIN_HEIGHT_TYPE";
|
|
61
|
+
StyleKeys[StyleKeys["MIN_HEIGHT_VALUE"] = 224] = "MIN_HEIGHT_VALUE";
|
|
62
|
+
StyleKeys[StyleKeys["MAX_WIDTH_TYPE"] = 228] = "MAX_WIDTH_TYPE";
|
|
63
|
+
StyleKeys[StyleKeys["MAX_WIDTH_VALUE"] = 232] = "MAX_WIDTH_VALUE";
|
|
64
|
+
StyleKeys[StyleKeys["MAX_HEIGHT_TYPE"] = 236] = "MAX_HEIGHT_TYPE";
|
|
65
|
+
StyleKeys[StyleKeys["MAX_HEIGHT_VALUE"] = 240] = "MAX_HEIGHT_VALUE";
|
|
66
|
+
StyleKeys[StyleKeys["GAP_ROW_TYPE"] = 244] = "GAP_ROW_TYPE";
|
|
67
|
+
StyleKeys[StyleKeys["GAP_ROW_VALUE"] = 248] = "GAP_ROW_VALUE";
|
|
68
|
+
StyleKeys[StyleKeys["GAP_COLUMN_TYPE"] = 252] = "GAP_COLUMN_TYPE";
|
|
69
|
+
StyleKeys[StyleKeys["GAP_COLUMN_VALUE"] = 256] = "GAP_COLUMN_VALUE";
|
|
70
|
+
StyleKeys[StyleKeys["ASPECT_RATIO"] = 260] = "ASPECT_RATIO";
|
|
71
|
+
StyleKeys[StyleKeys["GRID_AUTO_FLOW"] = 264] = "GRID_AUTO_FLOW";
|
|
72
|
+
StyleKeys[StyleKeys["GRID_COLUMN_START_TYPE"] = 268] = "GRID_COLUMN_START_TYPE";
|
|
73
|
+
StyleKeys[StyleKeys["GRID_COLUMN_START_VALUE"] = 272] = "GRID_COLUMN_START_VALUE";
|
|
74
|
+
StyleKeys[StyleKeys["GRID_COLUMN_END_TYPE"] = 276] = "GRID_COLUMN_END_TYPE";
|
|
75
|
+
StyleKeys[StyleKeys["GRID_COLUMN_END_VALUE"] = 280] = "GRID_COLUMN_END_VALUE";
|
|
76
|
+
StyleKeys[StyleKeys["GRID_ROW_START_TYPE"] = 284] = "GRID_ROW_START_TYPE";
|
|
77
|
+
StyleKeys[StyleKeys["GRID_ROW_START_VALUE"] = 288] = "GRID_ROW_START_VALUE";
|
|
78
|
+
StyleKeys[StyleKeys["GRID_ROW_END_TYPE"] = 292] = "GRID_ROW_END_TYPE";
|
|
79
|
+
StyleKeys[StyleKeys["GRID_ROW_END_VALUE"] = 296] = "GRID_ROW_END_VALUE";
|
|
80
|
+
StyleKeys[StyleKeys["SCROLLBAR_WIDTH"] = 300] = "SCROLLBAR_WIDTH";
|
|
81
|
+
StyleKeys[StyleKeys["TEXT_ALIGN"] = 304] = "TEXT_ALIGN";
|
|
82
|
+
StyleKeys[StyleKeys["BOX_SIZING"] = 308] = "BOX_SIZING";
|
|
83
|
+
StyleKeys[StyleKeys["OVERFLOW"] = 312] = "OVERFLOW";
|
|
84
|
+
StyleKeys[StyleKeys["ITEM_IS_TABLE"] = 316] = "ITEM_IS_TABLE";
|
|
85
|
+
StyleKeys[StyleKeys["ITEM_IS_REPLACED"] = 320] = "ITEM_IS_REPLACED";
|
|
86
|
+
StyleKeys[StyleKeys["DISPLAY_MODE"] = 324] = "DISPLAY_MODE";
|
|
87
|
+
StyleKeys[StyleKeys["FORCE_INLINE"] = 328] = "FORCE_INLINE";
|
|
88
|
+
StyleKeys[StyleKeys["MIN_CONTENT_WIDTH"] = 332] = "MIN_CONTENT_WIDTH";
|
|
89
|
+
StyleKeys[StyleKeys["MIN_CONTENT_HEIGHT"] = 336] = "MIN_CONTENT_HEIGHT";
|
|
90
|
+
StyleKeys[StyleKeys["MAX_CONTENT_WIDTH"] = 340] = "MAX_CONTENT_WIDTH";
|
|
91
|
+
StyleKeys[StyleKeys["MAX_CONTENT_HEIGHT"] = 344] = "MAX_CONTENT_HEIGHT";
|
|
92
|
+
// ----------------------------
|
|
93
|
+
// Border Style (per side)
|
|
94
|
+
// ----------------------------
|
|
95
|
+
StyleKeys[StyleKeys["BORDER_LEFT_STYLE"] = 348] = "BORDER_LEFT_STYLE";
|
|
96
|
+
StyleKeys[StyleKeys["BORDER_RIGHT_STYLE"] = 352] = "BORDER_RIGHT_STYLE";
|
|
97
|
+
StyleKeys[StyleKeys["BORDER_TOP_STYLE"] = 356] = "BORDER_TOP_STYLE";
|
|
98
|
+
StyleKeys[StyleKeys["BORDER_BOTTOM_STYLE"] = 360] = "BORDER_BOTTOM_STYLE";
|
|
99
|
+
// ----------------------------
|
|
100
|
+
// Border Color (per side)
|
|
101
|
+
// ----------------------------
|
|
102
|
+
StyleKeys[StyleKeys["BORDER_LEFT_COLOR"] = 364] = "BORDER_LEFT_COLOR";
|
|
103
|
+
StyleKeys[StyleKeys["BORDER_RIGHT_COLOR"] = 368] = "BORDER_RIGHT_COLOR";
|
|
104
|
+
StyleKeys[StyleKeys["BORDER_TOP_COLOR"] = 372] = "BORDER_TOP_COLOR";
|
|
105
|
+
StyleKeys[StyleKeys["BORDER_BOTTOM_COLOR"] = 376] = "BORDER_BOTTOM_COLOR";
|
|
106
|
+
// ============================================================
|
|
107
|
+
// Border Radius (elliptical + squircle exponent)
|
|
108
|
+
// Each corner = 20 bytes:
|
|
109
|
+
// x_type (4), x_value (4), y_type (4), y_value (4), exponent (4)
|
|
110
|
+
// ============================================================
|
|
111
|
+
// ----------------------------
|
|
112
|
+
// Top-left corner (20 bytes)
|
|
113
|
+
// ----------------------------
|
|
114
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_LEFT_X_TYPE"] = 380] = "BORDER_RADIUS_TOP_LEFT_X_TYPE";
|
|
115
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_LEFT_X_VALUE"] = 384] = "BORDER_RADIUS_TOP_LEFT_X_VALUE";
|
|
116
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_LEFT_Y_TYPE"] = 388] = "BORDER_RADIUS_TOP_LEFT_Y_TYPE";
|
|
117
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_LEFT_Y_VALUE"] = 392] = "BORDER_RADIUS_TOP_LEFT_Y_VALUE";
|
|
118
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_LEFT_EXPONENT"] = 396] = "BORDER_RADIUS_TOP_LEFT_EXPONENT";
|
|
119
|
+
// ----------------------------
|
|
120
|
+
// Top-right corner
|
|
121
|
+
// ----------------------------
|
|
122
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_RIGHT_X_TYPE"] = 400] = "BORDER_RADIUS_TOP_RIGHT_X_TYPE";
|
|
123
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_RIGHT_X_VALUE"] = 404] = "BORDER_RADIUS_TOP_RIGHT_X_VALUE";
|
|
124
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_RIGHT_Y_TYPE"] = 408] = "BORDER_RADIUS_TOP_RIGHT_Y_TYPE";
|
|
125
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_RIGHT_Y_VALUE"] = 412] = "BORDER_RADIUS_TOP_RIGHT_Y_VALUE";
|
|
126
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_TOP_RIGHT_EXPONENT"] = 416] = "BORDER_RADIUS_TOP_RIGHT_EXPONENT";
|
|
127
|
+
// ----------------------------
|
|
128
|
+
// Bottom-right corner
|
|
129
|
+
// ----------------------------
|
|
130
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_RIGHT_X_TYPE"] = 420] = "BORDER_RADIUS_BOTTOM_RIGHT_X_TYPE";
|
|
131
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_RIGHT_X_VALUE"] = 424] = "BORDER_RADIUS_BOTTOM_RIGHT_X_VALUE";
|
|
132
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_RIGHT_Y_TYPE"] = 428] = "BORDER_RADIUS_BOTTOM_RIGHT_Y_TYPE";
|
|
133
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_RIGHT_Y_VALUE"] = 432] = "BORDER_RADIUS_BOTTOM_RIGHT_Y_VALUE";
|
|
134
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_RIGHT_EXPONENT"] = 436] = "BORDER_RADIUS_BOTTOM_RIGHT_EXPONENT";
|
|
135
|
+
// ----------------------------
|
|
136
|
+
// Bottom-left corner
|
|
137
|
+
// ----------------------------
|
|
138
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_LEFT_X_TYPE"] = 440] = "BORDER_RADIUS_BOTTOM_LEFT_X_TYPE";
|
|
139
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_LEFT_X_VALUE"] = 444] = "BORDER_RADIUS_BOTTOM_LEFT_X_VALUE";
|
|
140
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_LEFT_Y_TYPE"] = 448] = "BORDER_RADIUS_BOTTOM_LEFT_Y_TYPE";
|
|
141
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_LEFT_Y_VALUE"] = 452] = "BORDER_RADIUS_BOTTOM_LEFT_Y_VALUE";
|
|
142
|
+
StyleKeys[StyleKeys["BORDER_RADIUS_BOTTOM_LEFT_EXPONENT"] = 456] = "BORDER_RADIUS_BOTTOM_LEFT_EXPONENT";
|
|
143
|
+
})(StyleKeys || (StyleKeys = {}));
|
|
144
|
+
var TextStyleKeys;
|
|
145
|
+
(function (TextStyleKeys) {
|
|
146
|
+
TextStyleKeys[TextStyleKeys["COLOR"] = 0] = "COLOR";
|
|
147
|
+
TextStyleKeys[TextStyleKeys["COLOR_STATE"] = 4] = "COLOR_STATE";
|
|
148
|
+
TextStyleKeys[TextStyleKeys["SIZE"] = 8] = "SIZE";
|
|
149
|
+
TextStyleKeys[TextStyleKeys["SIZE_TYPE"] = 12] = "SIZE_TYPE";
|
|
150
|
+
TextStyleKeys[TextStyleKeys["SIZE_STATE"] = 13] = "SIZE_STATE";
|
|
151
|
+
TextStyleKeys[TextStyleKeys["FONT_WEIGHT"] = 16] = "FONT_WEIGHT";
|
|
152
|
+
TextStyleKeys[TextStyleKeys["FONT_WEIGHT_STATE"] = 20] = "FONT_WEIGHT_STATE";
|
|
153
|
+
TextStyleKeys[TextStyleKeys["FONT_STYLE_SLANT"] = 24] = "FONT_STYLE_SLANT";
|
|
154
|
+
TextStyleKeys[TextStyleKeys["FONT_STYLE_TYPE"] = 28] = "FONT_STYLE_TYPE";
|
|
155
|
+
TextStyleKeys[TextStyleKeys["FONT_STYLE_STATE"] = 29] = "FONT_STYLE_STATE";
|
|
156
|
+
TextStyleKeys[TextStyleKeys["FONT_FAMILY_STATE"] = 30] = "FONT_FAMILY_STATE";
|
|
157
|
+
TextStyleKeys[TextStyleKeys["FONT_RESOLVED_DIRTY"] = 31] = "FONT_RESOLVED_DIRTY";
|
|
158
|
+
TextStyleKeys[TextStyleKeys["BACKGROUND_COLOR"] = 32] = "BACKGROUND_COLOR";
|
|
159
|
+
TextStyleKeys[TextStyleKeys["BACKGROUND_COLOR_STATE"] = 36] = "BACKGROUND_COLOR_STATE";
|
|
160
|
+
TextStyleKeys[TextStyleKeys["DECORATION_LINE"] = 40] = "DECORATION_LINE";
|
|
161
|
+
TextStyleKeys[TextStyleKeys["DECORATION_LINE_STATE"] = 44] = "DECORATION_LINE_STATE";
|
|
162
|
+
TextStyleKeys[TextStyleKeys["DECORATION_COLOR"] = 48] = "DECORATION_COLOR";
|
|
163
|
+
TextStyleKeys[TextStyleKeys["DECORATION_COLOR_STATE"] = 52] = "DECORATION_COLOR_STATE";
|
|
164
|
+
TextStyleKeys[TextStyleKeys["DECORATION_STYLE"] = 56] = "DECORATION_STYLE";
|
|
165
|
+
TextStyleKeys[TextStyleKeys["DECORATION_STYLE_STATE"] = 60] = "DECORATION_STYLE_STATE";
|
|
166
|
+
TextStyleKeys[TextStyleKeys["LETTER_SPACING"] = 64] = "LETTER_SPACING";
|
|
167
|
+
TextStyleKeys[TextStyleKeys["LETTER_SPACING_STATE"] = 68] = "LETTER_SPACING_STATE";
|
|
168
|
+
TextStyleKeys[TextStyleKeys["TEXT_WRAP"] = 72] = "TEXT_WRAP";
|
|
169
|
+
TextStyleKeys[TextStyleKeys["TEXT_WRAP_STATE"] = 76] = "TEXT_WRAP_STATE";
|
|
170
|
+
TextStyleKeys[TextStyleKeys["WHITE_SPACE"] = 80] = "WHITE_SPACE";
|
|
171
|
+
TextStyleKeys[TextStyleKeys["WHITE_SPACE_STATE"] = 84] = "WHITE_SPACE_STATE";
|
|
172
|
+
TextStyleKeys[TextStyleKeys["TRANSFORM"] = 88] = "TRANSFORM";
|
|
173
|
+
TextStyleKeys[TextStyleKeys["TRANSFORM_STATE"] = 92] = "TRANSFORM_STATE";
|
|
174
|
+
TextStyleKeys[TextStyleKeys["TEXT_ALIGN"] = 96] = "TEXT_ALIGN";
|
|
175
|
+
TextStyleKeys[TextStyleKeys["TEXT_ALIGN_STATE"] = 100] = "TEXT_ALIGN_STATE";
|
|
176
|
+
TextStyleKeys[TextStyleKeys["TEXT_JUSTIFY"] = 104] = "TEXT_JUSTIFY";
|
|
177
|
+
TextStyleKeys[TextStyleKeys["TEXT_JUSTIFY_STATE"] = 108] = "TEXT_JUSTIFY_STATE";
|
|
178
|
+
TextStyleKeys[TextStyleKeys["TEXT_INDENT"] = 112] = "TEXT_INDENT";
|
|
179
|
+
TextStyleKeys[TextStyleKeys["TEXT_INDENT_STATE"] = 116] = "TEXT_INDENT_STATE";
|
|
180
|
+
TextStyleKeys[TextStyleKeys["TEXT_OVERFLOW"] = 120] = "TEXT_OVERFLOW";
|
|
181
|
+
TextStyleKeys[TextStyleKeys["TEXT_OVERFLOW_STATE"] = 124] = "TEXT_OVERFLOW_STATE";
|
|
182
|
+
TextStyleKeys[TextStyleKeys["LINE_HEIGHT"] = 128] = "LINE_HEIGHT";
|
|
183
|
+
TextStyleKeys[TextStyleKeys["LINE_HEIGHT_TYPE"] = 132] = "LINE_HEIGHT_TYPE";
|
|
184
|
+
TextStyleKeys[TextStyleKeys["LINE_HEIGHT_STATE"] = 133] = "LINE_HEIGHT_STATE";
|
|
185
|
+
})(TextStyleKeys || (TextStyleKeys = {}));
|
|
186
|
+
function parseLengthPercentageAuto(type, value) {
|
|
187
|
+
switch (type) {
|
|
188
|
+
case 0:
|
|
189
|
+
return 'auto';
|
|
190
|
+
case 1:
|
|
191
|
+
return { value, unit: 'px' };
|
|
192
|
+
case 2:
|
|
193
|
+
return { value, unit: '%' };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function parseLengthPercentage(type, value) {
|
|
197
|
+
switch (type) {
|
|
198
|
+
case 0:
|
|
199
|
+
return { value, unit: 'px' };
|
|
200
|
+
case 1:
|
|
201
|
+
return { value, unit: '%' };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
class StateKeys {
|
|
205
|
+
constructor(bits) {
|
|
206
|
+
this.bits = bits;
|
|
207
|
+
}
|
|
208
|
+
or(other) {
|
|
209
|
+
return new StateKeys(this.bits | other.bits);
|
|
210
|
+
}
|
|
211
|
+
and(other) {
|
|
212
|
+
return new StateKeys(this.bits & other.bits);
|
|
213
|
+
}
|
|
214
|
+
hasFlag(flag) {
|
|
215
|
+
return (this.bits & flag.bits) !== 0n;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
StateKeys.DISPLAY = new StateKeys(1n << 0n);
|
|
219
|
+
StateKeys.POSITION = new StateKeys(1n << 1n);
|
|
220
|
+
StateKeys.DIRECTION = new StateKeys(1n << 2n);
|
|
221
|
+
StateKeys.FLEX_DIRECTION = new StateKeys(1n << 3n);
|
|
222
|
+
StateKeys.FLEX_WRAP = new StateKeys(1n << 4n);
|
|
223
|
+
StateKeys.OVERFLOW_X = new StateKeys(1n << 5n);
|
|
224
|
+
StateKeys.OVERFLOW_Y = new StateKeys(1n << 6n);
|
|
225
|
+
StateKeys.ALIGN_ITEMS = new StateKeys(1n << 7n);
|
|
226
|
+
StateKeys.ALIGN_SELF = new StateKeys(1n << 8n);
|
|
227
|
+
StateKeys.ALIGN_CONTENT = new StateKeys(1n << 9n);
|
|
228
|
+
StateKeys.JUSTIFY_ITEMS = new StateKeys(1n << 10n);
|
|
229
|
+
StateKeys.JUSTIFY_SELF = new StateKeys(1n << 11n);
|
|
230
|
+
StateKeys.JUSTIFY_CONTENT = new StateKeys(1n << 12n);
|
|
231
|
+
StateKeys.INSET = new StateKeys(1n << 13n);
|
|
232
|
+
StateKeys.MARGIN = new StateKeys(1n << 14n);
|
|
233
|
+
StateKeys.PADDING = new StateKeys(1n << 15n);
|
|
234
|
+
StateKeys.BORDER = new StateKeys(1n << 16n);
|
|
235
|
+
StateKeys.FLEX_GROW = new StateKeys(1n << 17n);
|
|
236
|
+
StateKeys.FLEX_SHRINK = new StateKeys(1n << 18n);
|
|
237
|
+
StateKeys.FLEX_BASIS = new StateKeys(1n << 19n);
|
|
238
|
+
StateKeys.SIZE = new StateKeys(1n << 20n);
|
|
239
|
+
StateKeys.MIN_SIZE = new StateKeys(1n << 21n);
|
|
240
|
+
StateKeys.MAX_SIZE = new StateKeys(1n << 22n);
|
|
241
|
+
StateKeys.GAP = new StateKeys(1n << 23n);
|
|
242
|
+
StateKeys.ASPECT_RATIO = new StateKeys(1n << 24n);
|
|
243
|
+
StateKeys.GRID_AUTO_FLOW = new StateKeys(1n << 25n);
|
|
244
|
+
StateKeys.GRID_COLUMN = new StateKeys(1n << 26n);
|
|
245
|
+
StateKeys.GRID_ROW = new StateKeys(1n << 27n);
|
|
246
|
+
StateKeys.SCROLLBAR_WIDTH = new StateKeys(1n << 28n);
|
|
247
|
+
StateKeys.TEXT_ALIGN = new StateKeys(1n << 29n);
|
|
248
|
+
StateKeys.BOX_SIZING = new StateKeys(1n << 30n);
|
|
249
|
+
StateKeys.OVERFLOW = new StateKeys(1n << 31n);
|
|
250
|
+
StateKeys.ITEM_IS_TABLE = new StateKeys(1n << 32n);
|
|
251
|
+
StateKeys.ITEM_IS_REPLACED = new StateKeys(1n << 33n);
|
|
252
|
+
StateKeys.DISPLAY_MODE = new StateKeys(1n << 34n);
|
|
253
|
+
StateKeys.FORCE_INLINE = new StateKeys(1n << 35n);
|
|
254
|
+
StateKeys.MIN_CONTENT_WIDTH = new StateKeys(1n << 36n);
|
|
255
|
+
StateKeys.MIN_CONTENT_HEIGHT = new StateKeys(1n << 37n);
|
|
256
|
+
StateKeys.MAX_CONTENT_WIDTH = new StateKeys(1n << 38n);
|
|
257
|
+
StateKeys.MAX_CONTENT_HEIGHT = new StateKeys(1n << 39n);
|
|
258
|
+
StateKeys.BORDER_STYLE = new StateKeys(1n << 40n);
|
|
259
|
+
StateKeys.BORDER_RADIUS = new StateKeys(1n << 41n);
|
|
260
|
+
StateKeys.BORDER_COLOR = new StateKeys(1n << 42n);
|
|
261
|
+
class TextStateKeys {
|
|
262
|
+
constructor(bits) {
|
|
263
|
+
this.bits = bits;
|
|
264
|
+
}
|
|
265
|
+
or(other) {
|
|
266
|
+
return new TextStateKeys(this.bits | other.bits);
|
|
267
|
+
}
|
|
268
|
+
and(other) {
|
|
269
|
+
return new TextStateKeys(this.bits & other.bits);
|
|
270
|
+
}
|
|
271
|
+
hasFlag(flag) {
|
|
272
|
+
return (this.bits & flag.bits) !== 0n;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
TextStateKeys.ALL = new TextStateKeys(-1n);
|
|
276
|
+
TextStateKeys.NONE = new TextStateKeys(0n);
|
|
277
|
+
TextStateKeys.COLOR = new TextStateKeys(1n << 0n);
|
|
278
|
+
TextStateKeys.SIZE = new TextStateKeys(1n << 1n);
|
|
279
|
+
TextStateKeys.FONT_WEIGHT = new TextStateKeys(1n << 2n);
|
|
280
|
+
TextStateKeys.FONT_STYLE = new TextStateKeys(1n << 3n);
|
|
281
|
+
TextStateKeys.FONT_FAMILY = new TextStateKeys(1n << 4n);
|
|
282
|
+
TextStateKeys.LETTER_SPACING = new TextStateKeys(1n << 5n);
|
|
283
|
+
TextStateKeys.DECORATION_LINE = new TextStateKeys(1n << 6n);
|
|
284
|
+
TextStateKeys.DECORATION_COLOR = new TextStateKeys(1n << 7n);
|
|
285
|
+
TextStateKeys.DECORATION_STYLE = new TextStateKeys(1n << 8n);
|
|
286
|
+
TextStateKeys.BACKGROUND_COLOR = new TextStateKeys(1n << 9n);
|
|
287
|
+
TextStateKeys.TEXT_WRAP = new TextStateKeys(1n << 10n);
|
|
288
|
+
TextStateKeys.WHITE_SPACE = new TextStateKeys(1n << 11n);
|
|
289
|
+
TextStateKeys.TRANSFORM = new TextStateKeys(1n << 12n);
|
|
290
|
+
TextStateKeys.TEXT_JUSTIFY = new TextStateKeys(1n << 13n);
|
|
291
|
+
TextStateKeys.TEXT_OVERFLOW = new TextStateKeys(1n << 14n);
|
|
292
|
+
TextStateKeys.LINE_HEIGHT = new TextStateKeys(1n << 15n);
|
|
293
|
+
TextStateKeys.TEXT_ALIGN = new TextStateKeys(1n << 16n);
|
|
294
|
+
const getInt8 = (view, offset) => {
|
|
295
|
+
return view.getInt8(offset);
|
|
296
|
+
};
|
|
297
|
+
const setInt8 = (view, offset, value) => {
|
|
298
|
+
view.setInt8(offset, value);
|
|
299
|
+
};
|
|
300
|
+
const getUint8 = (view, offset) => {
|
|
301
|
+
return view.getUint8(offset);
|
|
302
|
+
};
|
|
303
|
+
const setUint8 = (view, offset, value) => {
|
|
304
|
+
view.setUint8(offset, value);
|
|
305
|
+
};
|
|
306
|
+
const getInt16 = (view, offset) => {
|
|
307
|
+
return view.getInt16(offset, true);
|
|
308
|
+
};
|
|
309
|
+
const setInt16 = (view, offset, value) => {
|
|
310
|
+
view.setInt16(offset, value, true);
|
|
311
|
+
};
|
|
312
|
+
const getUint32 = (view, offset) => {
|
|
313
|
+
return view.getUint32(offset, true);
|
|
314
|
+
};
|
|
315
|
+
const setUint32 = (view, offset, value) => {
|
|
316
|
+
view.setUint32(offset, value, true);
|
|
317
|
+
};
|
|
318
|
+
const getInt32 = (view, offset) => {
|
|
319
|
+
return view.getInt32(offset, true);
|
|
320
|
+
};
|
|
321
|
+
const setInt32 = (view, offset, value) => {
|
|
322
|
+
view.setInt32(offset, value, true);
|
|
323
|
+
};
|
|
324
|
+
const getFloat32 = (view, offset) => {
|
|
325
|
+
return view.getFloat32(offset, true);
|
|
326
|
+
};
|
|
327
|
+
const setFloat32 = (view, offset, value) => {
|
|
328
|
+
view.setFloat32(offset, value, true);
|
|
329
|
+
};
|
|
330
|
+
export class Style {
|
|
331
|
+
constructor() {
|
|
332
|
+
this.isDirty = -1n;
|
|
333
|
+
this.isTextDirty = -1n;
|
|
334
|
+
this.inBatch = false;
|
|
335
|
+
}
|
|
336
|
+
static fromView(view, nativeView) {
|
|
337
|
+
//console.time('fromView');
|
|
338
|
+
const ret = new Style();
|
|
339
|
+
ret.view_ = view;
|
|
340
|
+
ret.nativeView = nativeView;
|
|
341
|
+
if (__ANDROID__) {
|
|
342
|
+
let style = nativeView?.getStyle?.();
|
|
343
|
+
if (!style) {
|
|
344
|
+
// if a non mason view is passed
|
|
345
|
+
style = org.nativescript.mason.masonkit.Mason.getShared().styleForView(nativeView);
|
|
346
|
+
}
|
|
347
|
+
const styleBuffer = style.getValues();
|
|
348
|
+
const buffer = ArrayBuffer.from(styleBuffer);
|
|
349
|
+
ret.style_view = new DataView(buffer);
|
|
350
|
+
const textStyleBuffer = style.getTextValues();
|
|
351
|
+
const textBuffer = ArrayBuffer.from(textStyleBuffer);
|
|
352
|
+
ret.text_style_view = new DataView(textBuffer);
|
|
353
|
+
}
|
|
354
|
+
else if (__APPLE__) {
|
|
355
|
+
let style = nativeView?.style;
|
|
356
|
+
if (!style) {
|
|
357
|
+
style = NSCMason.shared.styleForView(nativeView);
|
|
358
|
+
}
|
|
359
|
+
const styleBuffer = style.values;
|
|
360
|
+
const buffer = interop.bufferFromData(styleBuffer);
|
|
361
|
+
ret.style_view = new DataView(buffer);
|
|
362
|
+
//@ts-ignore
|
|
363
|
+
const textStyleBuffer = style.textValues;
|
|
364
|
+
const textBuffer = interop.bufferFromData(textStyleBuffer);
|
|
365
|
+
ret.text_style_view = new DataView(textBuffer);
|
|
366
|
+
}
|
|
367
|
+
//console.timeEnd('fromView');
|
|
368
|
+
return ret;
|
|
369
|
+
}
|
|
370
|
+
resetState() {
|
|
371
|
+
this.isDirty = -1n;
|
|
372
|
+
this.isTextDirty = -1n;
|
|
373
|
+
}
|
|
374
|
+
syncStyle() {
|
|
375
|
+
if (__ANDROID__) {
|
|
376
|
+
const view = this.view.android;
|
|
377
|
+
view.syncStyle(this.isDirty.toString(), this.isTextDirty.toString());
|
|
378
|
+
}
|
|
379
|
+
else if (__APPLE__) {
|
|
380
|
+
const view = this.view.ios;
|
|
381
|
+
// @ts-ignore
|
|
382
|
+
view.mason_syncStyle(this.isDirty.toString(), this.isTextDirty.toString());
|
|
383
|
+
}
|
|
384
|
+
this.resetState();
|
|
385
|
+
}
|
|
386
|
+
setOrAppendState(value) {
|
|
387
|
+
if (this.isDirty == -1n) {
|
|
388
|
+
this.isDirty = value.bits;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
this.isDirty = this.isDirty | value.bits;
|
|
392
|
+
}
|
|
393
|
+
if (!this.inBatch) {
|
|
394
|
+
this.syncStyle();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
setOrAppendTextState(value) {
|
|
398
|
+
if (this.isTextDirty == -1n) {
|
|
399
|
+
this.isTextDirty = value.bits;
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
this.isTextDirty = this.isTextDirty | value.bits;
|
|
403
|
+
}
|
|
404
|
+
if (!this.inBatch) {
|
|
405
|
+
this.syncStyle();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
batch(fn) {
|
|
409
|
+
this.inBatch = true;
|
|
410
|
+
fn(this);
|
|
411
|
+
this.inBatch = false;
|
|
412
|
+
this.syncStyle();
|
|
413
|
+
}
|
|
414
|
+
get view() {
|
|
415
|
+
return this.view_;
|
|
416
|
+
}
|
|
417
|
+
get boxSizing() {
|
|
418
|
+
switch (getUint32(this.style_view, StyleKeys.BOX_SIZING)) {
|
|
419
|
+
case 0:
|
|
420
|
+
return 'border-box';
|
|
421
|
+
case 1:
|
|
422
|
+
return 'content-box';
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
set boxSizing(value) {
|
|
426
|
+
let boxSizing = -1;
|
|
427
|
+
switch (value) {
|
|
428
|
+
case 'border-box':
|
|
429
|
+
boxSizing = 0;
|
|
430
|
+
break;
|
|
431
|
+
case 'content-box':
|
|
432
|
+
boxSizing = 1;
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
if (boxSizing !== -1) {
|
|
436
|
+
setUint32(this.style_view, StyleKeys.BOX_SIZING, boxSizing);
|
|
437
|
+
this.setOrAppendState(StateKeys.BOX_SIZING);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
get fontSize() {
|
|
441
|
+
if (!this.text_style_view) {
|
|
442
|
+
// BLACK ?
|
|
443
|
+
return 16;
|
|
444
|
+
}
|
|
445
|
+
const type = getUint8(this.text_style_view, TextStyleKeys.SIZE_TYPE);
|
|
446
|
+
const value = getInt32(this.text_style_view, TextStyleKeys.SIZE);
|
|
447
|
+
if (type === 1) {
|
|
448
|
+
return `${value / 100}%`;
|
|
449
|
+
}
|
|
450
|
+
return value;
|
|
451
|
+
}
|
|
452
|
+
set fontSize(value) {
|
|
453
|
+
if (!this.text_style_view) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
switch (typeof value) {
|
|
457
|
+
case 'number':
|
|
458
|
+
setInt32(this.text_style_view, TextStyleKeys.SIZE, value);
|
|
459
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_STATE, 1);
|
|
460
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_TYPE, 0);
|
|
461
|
+
this.setOrAppendTextState(TextStateKeys.SIZE);
|
|
462
|
+
break;
|
|
463
|
+
case 'object':
|
|
464
|
+
switch (value.unit) {
|
|
465
|
+
case 'dip':
|
|
466
|
+
setInt32(this.text_style_view, TextStyleKeys.SIZE, value.value);
|
|
467
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_STATE, 1);
|
|
468
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_TYPE, 0);
|
|
469
|
+
this.setOrAppendTextState(TextStateKeys.SIZE);
|
|
470
|
+
break;
|
|
471
|
+
case 'px':
|
|
472
|
+
setInt32(this.text_style_view, TextStyleKeys.SIZE, layout.toDeviceIndependentPixels(value.value));
|
|
473
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_STATE, 1);
|
|
474
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_TYPE, 0);
|
|
475
|
+
this.setOrAppendTextState(TextStateKeys.SIZE);
|
|
476
|
+
break;
|
|
477
|
+
case '%':
|
|
478
|
+
setInt32(this.text_style_view, TextStyleKeys.SIZE, value.value * 100);
|
|
479
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_STATE, 1);
|
|
480
|
+
setInt8(this.text_style_view, TextStyleKeys.SIZE_TYPE, 1);
|
|
481
|
+
this.setOrAppendTextState(TextStateKeys.SIZE);
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
if (value && typeof value === 'object') {
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
get fontStyle() {
|
|
492
|
+
if (!this.text_style_view) {
|
|
493
|
+
// normal ?
|
|
494
|
+
return 'normal';
|
|
495
|
+
}
|
|
496
|
+
switch (getInt32(this.text_style_view, TextStyleKeys.FONT_STYLE_TYPE)) {
|
|
497
|
+
case 0:
|
|
498
|
+
return 'normal';
|
|
499
|
+
case 1:
|
|
500
|
+
return 'italic';
|
|
501
|
+
case 2:
|
|
502
|
+
return 'oblique';
|
|
503
|
+
default:
|
|
504
|
+
return 'normal';
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
set fontStyle(value) {
|
|
508
|
+
if (!this.text_style_view) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
let style = -1;
|
|
512
|
+
switch (value) {
|
|
513
|
+
case 'normal':
|
|
514
|
+
style = 0;
|
|
515
|
+
break;
|
|
516
|
+
case 'italic':
|
|
517
|
+
style = 1;
|
|
518
|
+
break;
|
|
519
|
+
case 'oblique':
|
|
520
|
+
style = 2;
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
if (style !== -1) {
|
|
524
|
+
setInt32(this.text_style_view, TextStyleKeys.FONT_STYLE_TYPE, style);
|
|
525
|
+
setInt8(this.text_style_view, TextStyleKeys.FONT_STYLE_STATE, 1);
|
|
526
|
+
this.setOrAppendTextState(TextStateKeys.FONT_STYLE);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
get fontWeight() {
|
|
530
|
+
if (!this.text_style_view) {
|
|
531
|
+
// BLACK ?
|
|
532
|
+
return 400;
|
|
533
|
+
}
|
|
534
|
+
return getInt32(this.text_style_view, TextStyleKeys.FONT_WEIGHT);
|
|
535
|
+
}
|
|
536
|
+
set fontWeight(value) {
|
|
537
|
+
if (!this.text_style_view) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
let weight = -1;
|
|
541
|
+
switch (value) {
|
|
542
|
+
case '100':
|
|
543
|
+
weight = 100;
|
|
544
|
+
break;
|
|
545
|
+
case '200':
|
|
546
|
+
weight = 200;
|
|
547
|
+
break;
|
|
548
|
+
case '300':
|
|
549
|
+
weight = 300;
|
|
550
|
+
break;
|
|
551
|
+
case 'normal':
|
|
552
|
+
case '400':
|
|
553
|
+
weight = 400;
|
|
554
|
+
break;
|
|
555
|
+
case '500':
|
|
556
|
+
weight = 500;
|
|
557
|
+
break;
|
|
558
|
+
case '600':
|
|
559
|
+
weight = 600;
|
|
560
|
+
break;
|
|
561
|
+
case '700':
|
|
562
|
+
case 'bold':
|
|
563
|
+
weight = 700;
|
|
564
|
+
break;
|
|
565
|
+
case '800':
|
|
566
|
+
weight = 800;
|
|
567
|
+
break;
|
|
568
|
+
case '900':
|
|
569
|
+
weight = 900;
|
|
570
|
+
break;
|
|
571
|
+
default:
|
|
572
|
+
if (typeof value === 'number' && value >= 100 && value <= 1000) {
|
|
573
|
+
weight = value;
|
|
574
|
+
}
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
if (weight !== -1) {
|
|
578
|
+
setInt32(this.text_style_view, TextStyleKeys.FONT_WEIGHT, weight);
|
|
579
|
+
setInt8(this.text_style_view, TextStyleKeys.FONT_WEIGHT_STATE, 1);
|
|
580
|
+
this.setOrAppendTextState(TextStateKeys.FONT_WEIGHT);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
get color() {
|
|
584
|
+
if (!this.text_style_view) {
|
|
585
|
+
// BLACK ?
|
|
586
|
+
return 0;
|
|
587
|
+
}
|
|
588
|
+
return getUint32(this.text_style_view, TextStyleKeys.COLOR);
|
|
589
|
+
}
|
|
590
|
+
set color(value) {
|
|
591
|
+
if (!this.text_style_view) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
setUint32(this.text_style_view, TextStyleKeys.COLOR, value);
|
|
595
|
+
setInt8(this.text_style_view, TextStyleKeys.COLOR_STATE, 1);
|
|
596
|
+
this.setOrAppendTextState(TextStateKeys.COLOR);
|
|
597
|
+
}
|
|
598
|
+
get backgroundColor() {
|
|
599
|
+
if (!this.text_style_view) {
|
|
600
|
+
// BLACK ?
|
|
601
|
+
return 0;
|
|
602
|
+
}
|
|
603
|
+
return getUint32(this.text_style_view, TextStyleKeys.BACKGROUND_COLOR);
|
|
604
|
+
}
|
|
605
|
+
set backgroundColor(value) {
|
|
606
|
+
if (!this.text_style_view) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
setUint32(this.text_style_view, TextStyleKeys.BACKGROUND_COLOR, value);
|
|
610
|
+
setInt8(this.text_style_view, TextStyleKeys.BACKGROUND_COLOR_STATE, 1);
|
|
611
|
+
this.setOrAppendTextState(TextStateKeys.BACKGROUND_COLOR);
|
|
612
|
+
}
|
|
613
|
+
get textWrap() {
|
|
614
|
+
if (!this.text_style_view) {
|
|
615
|
+
// BLACK ?
|
|
616
|
+
return 0;
|
|
617
|
+
}
|
|
618
|
+
return getInt32(this.text_style_view, TextStyleKeys.TEXT_WRAP);
|
|
619
|
+
}
|
|
620
|
+
set textWrap(value) {
|
|
621
|
+
if (!this.text_style_view) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
let wrap = -1;
|
|
625
|
+
switch (value) {
|
|
626
|
+
case 'nowrap':
|
|
627
|
+
wrap = 0;
|
|
628
|
+
break;
|
|
629
|
+
case 'wrap':
|
|
630
|
+
wrap = 1;
|
|
631
|
+
break;
|
|
632
|
+
case 'balance':
|
|
633
|
+
wrap = 2;
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
if (typeof value === 'number' && value >= 0 && value < 3) {
|
|
637
|
+
wrap = value;
|
|
638
|
+
}
|
|
639
|
+
if (wrap !== -1) {
|
|
640
|
+
setInt32(this.text_style_view, TextStyleKeys.TEXT_WRAP, wrap);
|
|
641
|
+
setInt8(this.text_style_view, TextStyleKeys.TEXT_WRAP_STATE, 1);
|
|
642
|
+
this.setOrAppendTextState(TextStateKeys.TEXT_WRAP);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
get styleView() {
|
|
646
|
+
return this.style_view;
|
|
647
|
+
}
|
|
648
|
+
get display() {
|
|
649
|
+
switch (getInt32(this.style_view, StyleKeys.DISPLAY)) {
|
|
650
|
+
case 0:
|
|
651
|
+
return 'none';
|
|
652
|
+
case 1:
|
|
653
|
+
return 'flex';
|
|
654
|
+
case 2:
|
|
655
|
+
return 'grid';
|
|
656
|
+
case 3:
|
|
657
|
+
return 'block';
|
|
658
|
+
case 4:
|
|
659
|
+
return 'inline';
|
|
660
|
+
case 5:
|
|
661
|
+
return 'inline-block';
|
|
662
|
+
case 6:
|
|
663
|
+
return 'inline-flex';
|
|
664
|
+
case 7:
|
|
665
|
+
return 'inline-grid';
|
|
666
|
+
default:
|
|
667
|
+
return 'none';
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
set display(value) {
|
|
671
|
+
let display = -1;
|
|
672
|
+
switch (value) {
|
|
673
|
+
case 'none':
|
|
674
|
+
display = 0;
|
|
675
|
+
break;
|
|
676
|
+
case 'flex':
|
|
677
|
+
display = 1;
|
|
678
|
+
break;
|
|
679
|
+
case 'grid':
|
|
680
|
+
display = 2;
|
|
681
|
+
break;
|
|
682
|
+
case 'block':
|
|
683
|
+
display = 3;
|
|
684
|
+
break;
|
|
685
|
+
case 'inline':
|
|
686
|
+
display = 4;
|
|
687
|
+
break;
|
|
688
|
+
case 'inline-block':
|
|
689
|
+
display = 5;
|
|
690
|
+
break;
|
|
691
|
+
case 'inline-flex':
|
|
692
|
+
display = 6;
|
|
693
|
+
break;
|
|
694
|
+
case 'inline-grid':
|
|
695
|
+
display = 7;
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
if (display != -1) {
|
|
699
|
+
setInt32(this.style_view, StyleKeys.DISPLAY, display);
|
|
700
|
+
this.setOrAppendState(StateKeys.DISPLAY);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
get position() {
|
|
704
|
+
switch (getInt32(this.style_view, StyleKeys.POSITION)) {
|
|
705
|
+
case 0:
|
|
706
|
+
return 'relative';
|
|
707
|
+
case 1:
|
|
708
|
+
return 'absolute';
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
set position(value) {
|
|
712
|
+
let position = -1;
|
|
713
|
+
switch (value) {
|
|
714
|
+
case 'relative':
|
|
715
|
+
position = 0;
|
|
716
|
+
break;
|
|
717
|
+
case 'absolute':
|
|
718
|
+
position = 1;
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
if (position != -1) {
|
|
722
|
+
setInt32(this.style_view, StyleKeys.POSITION, position);
|
|
723
|
+
this.setOrAppendState(StateKeys.POSITION);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
get flexDirection() {
|
|
727
|
+
switch (getInt32(this.style_view, StyleKeys.FLEX_DIRECTION)) {
|
|
728
|
+
case 0:
|
|
729
|
+
return 'column';
|
|
730
|
+
case 1:
|
|
731
|
+
return 'row';
|
|
732
|
+
case 2:
|
|
733
|
+
return 'row-reverse';
|
|
734
|
+
case 3:
|
|
735
|
+
return 'column-reverse';
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
set flexDirection(value) {
|
|
739
|
+
let flex = -1;
|
|
740
|
+
switch (value) {
|
|
741
|
+
case 'column':
|
|
742
|
+
flex = 0;
|
|
743
|
+
break;
|
|
744
|
+
case 'row':
|
|
745
|
+
flex = 1;
|
|
746
|
+
break;
|
|
747
|
+
case 'row-reverse':
|
|
748
|
+
flex = 2;
|
|
749
|
+
break;
|
|
750
|
+
case 'column-reverse':
|
|
751
|
+
flex = 3;
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
if (flex != -1) {
|
|
755
|
+
setInt32(this.style_view, StyleKeys.FLEX_DIRECTION, flex);
|
|
756
|
+
this.setOrAppendState(StateKeys.FLEX_DIRECTION);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
get flexWrap() {
|
|
760
|
+
switch (getInt32(this.style_view, StyleKeys.FLEX_WRAP)) {
|
|
761
|
+
case 0:
|
|
762
|
+
return 'no-wrap';
|
|
763
|
+
case 1:
|
|
764
|
+
return 'wrap';
|
|
765
|
+
case 2:
|
|
766
|
+
return 'wrap-reverse';
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
set flexWrap(value) {
|
|
770
|
+
let wrap = -1;
|
|
771
|
+
switch (value) {
|
|
772
|
+
case 'no-wrap':
|
|
773
|
+
wrap = 0;
|
|
774
|
+
break;
|
|
775
|
+
case 'wrap':
|
|
776
|
+
wrap = 1;
|
|
777
|
+
break;
|
|
778
|
+
case 'wrap-reverse':
|
|
779
|
+
wrap = 2;
|
|
780
|
+
break;
|
|
781
|
+
}
|
|
782
|
+
if (wrap != -1) {
|
|
783
|
+
setInt32(this.style_view, StyleKeys.FLEX_WRAP, wrap);
|
|
784
|
+
this.setOrAppendState(StateKeys.FLEX_WRAP);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
// get flex(): string | 'auto' | 'none' | number | 'initial' {
|
|
788
|
+
// return this.style[StyleKeys.FLEX];
|
|
789
|
+
// }
|
|
790
|
+
// get flexFlow(): string
|
|
791
|
+
get minWidth() {
|
|
792
|
+
const type = getInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE);
|
|
793
|
+
const value = getFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE);
|
|
794
|
+
return parseLengthPercentageAuto(type, value);
|
|
795
|
+
}
|
|
796
|
+
set minWidth(value) {
|
|
797
|
+
switch (typeof value) {
|
|
798
|
+
case 'string':
|
|
799
|
+
setInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 0);
|
|
800
|
+
break;
|
|
801
|
+
case 'number':
|
|
802
|
+
setInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 1);
|
|
803
|
+
setFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE, layout.toDevicePixels(value));
|
|
804
|
+
break;
|
|
805
|
+
case 'object':
|
|
806
|
+
switch (value.unit) {
|
|
807
|
+
case 'dip':
|
|
808
|
+
setInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 1);
|
|
809
|
+
setFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE, layout.toDevicePixels(value.value));
|
|
810
|
+
break;
|
|
811
|
+
case 'px':
|
|
812
|
+
setInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 1);
|
|
813
|
+
setFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE, value.value);
|
|
814
|
+
break;
|
|
815
|
+
case '%':
|
|
816
|
+
setInt32(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 2);
|
|
817
|
+
setFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE, value.value);
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
break;
|
|
821
|
+
}
|
|
822
|
+
this.setOrAppendState(StateKeys.MIN_SIZE);
|
|
823
|
+
}
|
|
824
|
+
get minHeight() {
|
|
825
|
+
const type = getInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE);
|
|
826
|
+
const value = getFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE);
|
|
827
|
+
return parseLengthPercentageAuto(type, value);
|
|
828
|
+
}
|
|
829
|
+
set minHeight(value) {
|
|
830
|
+
switch (typeof value) {
|
|
831
|
+
case 'string':
|
|
832
|
+
setInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 0);
|
|
833
|
+
break;
|
|
834
|
+
case 'number':
|
|
835
|
+
setInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 1);
|
|
836
|
+
setFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE, layout.toDevicePixels(value));
|
|
837
|
+
break;
|
|
838
|
+
case 'object':
|
|
839
|
+
switch (value.unit) {
|
|
840
|
+
case 'dip':
|
|
841
|
+
setInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 1);
|
|
842
|
+
setFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
843
|
+
break;
|
|
844
|
+
case 'px':
|
|
845
|
+
setInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 1);
|
|
846
|
+
setFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE, value.value);
|
|
847
|
+
break;
|
|
848
|
+
case '%':
|
|
849
|
+
setInt32(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 2);
|
|
850
|
+
setFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE, value.value);
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
this.setOrAppendState(StateKeys.MIN_SIZE);
|
|
856
|
+
}
|
|
857
|
+
get width() {
|
|
858
|
+
const type = getInt32(this.style_view, StyleKeys.WIDTH_TYPE);
|
|
859
|
+
const value = getFloat32(this.style_view, StyleKeys.WIDTH_VALUE);
|
|
860
|
+
return parseLengthPercentageAuto(type, value);
|
|
861
|
+
}
|
|
862
|
+
set width(value) {
|
|
863
|
+
switch (typeof value) {
|
|
864
|
+
case 'string':
|
|
865
|
+
setInt32(this.style_view, StyleKeys.WIDTH_TYPE, 0);
|
|
866
|
+
break;
|
|
867
|
+
case 'number':
|
|
868
|
+
setInt32(this.style_view, StyleKeys.WIDTH_TYPE, 1);
|
|
869
|
+
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, layout.toDevicePixels(value));
|
|
870
|
+
break;
|
|
871
|
+
case 'object':
|
|
872
|
+
switch (value.unit) {
|
|
873
|
+
case 'dip':
|
|
874
|
+
setInt32(this.style_view, StyleKeys.WIDTH_TYPE, 1);
|
|
875
|
+
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, layout.toDevicePixels(value.value));
|
|
876
|
+
break;
|
|
877
|
+
case 'px':
|
|
878
|
+
setInt32(this.style_view, StyleKeys.WIDTH_TYPE, 1);
|
|
879
|
+
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, value.value);
|
|
880
|
+
break;
|
|
881
|
+
case '%':
|
|
882
|
+
setInt32(this.style_view, StyleKeys.WIDTH_TYPE, 2);
|
|
883
|
+
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, value.value);
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
this.setOrAppendState(StateKeys.SIZE);
|
|
889
|
+
}
|
|
890
|
+
get height() {
|
|
891
|
+
const type = getInt32(this.style_view, StyleKeys.HEIGHT_TYPE);
|
|
892
|
+
const value = getFloat32(this.style_view, StyleKeys.HEIGHT_VALUE);
|
|
893
|
+
return parseLengthPercentageAuto(type, value);
|
|
894
|
+
}
|
|
895
|
+
set height(value) {
|
|
896
|
+
switch (typeof value) {
|
|
897
|
+
case 'string':
|
|
898
|
+
setInt32(this.style_view, StyleKeys.HEIGHT_TYPE, 0);
|
|
899
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, 0);
|
|
900
|
+
break;
|
|
901
|
+
case 'number':
|
|
902
|
+
setInt32(this.style_view, StyleKeys.HEIGHT_TYPE, 1);
|
|
903
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, layout.toDevicePixels(value));
|
|
904
|
+
break;
|
|
905
|
+
case 'object':
|
|
906
|
+
switch (value.unit) {
|
|
907
|
+
case 'dip':
|
|
908
|
+
setInt32(this.style_view, StyleKeys.HEIGHT_TYPE, 1);
|
|
909
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
910
|
+
break;
|
|
911
|
+
case 'px':
|
|
912
|
+
setInt32(this.style_view, StyleKeys.HEIGHT_TYPE, 1);
|
|
913
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, value.value);
|
|
914
|
+
break;
|
|
915
|
+
case '%':
|
|
916
|
+
setInt32(this.style_view, StyleKeys.HEIGHT_TYPE, 2);
|
|
917
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, value.value);
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
this.setOrAppendState(StateKeys.SIZE);
|
|
923
|
+
}
|
|
924
|
+
get maxWidth() {
|
|
925
|
+
const type = getInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE);
|
|
926
|
+
const value = getFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE);
|
|
927
|
+
return parseLengthPercentageAuto(type, value);
|
|
928
|
+
}
|
|
929
|
+
set maxWidth(value) {
|
|
930
|
+
switch (typeof value) {
|
|
931
|
+
case 'string':
|
|
932
|
+
setInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 0);
|
|
933
|
+
break;
|
|
934
|
+
case 'number':
|
|
935
|
+
setInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 1);
|
|
936
|
+
setFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE, layout.toDevicePixels(value));
|
|
937
|
+
break;
|
|
938
|
+
case 'object':
|
|
939
|
+
switch (value.unit) {
|
|
940
|
+
case 'dip':
|
|
941
|
+
setInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 1);
|
|
942
|
+
setFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE, layout.toDevicePixels(value.value));
|
|
943
|
+
break;
|
|
944
|
+
case 'px':
|
|
945
|
+
setInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 1);
|
|
946
|
+
setFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE, value.value);
|
|
947
|
+
break;
|
|
948
|
+
case '%':
|
|
949
|
+
setInt32(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 2);
|
|
950
|
+
setFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE, value.value);
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
this.setOrAppendState(StateKeys.MAX_SIZE);
|
|
956
|
+
}
|
|
957
|
+
get maxHeight() {
|
|
958
|
+
const type = getInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE);
|
|
959
|
+
const value = getFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE);
|
|
960
|
+
return parseLengthPercentageAuto(type, value);
|
|
961
|
+
}
|
|
962
|
+
set maxHeight(value) {
|
|
963
|
+
switch (typeof value) {
|
|
964
|
+
case 'string':
|
|
965
|
+
setInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 0);
|
|
966
|
+
break;
|
|
967
|
+
case 'number':
|
|
968
|
+
setInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 1);
|
|
969
|
+
setFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE, layout.toDevicePixels(value));
|
|
970
|
+
break;
|
|
971
|
+
case 'object':
|
|
972
|
+
switch (value.unit) {
|
|
973
|
+
case 'dip':
|
|
974
|
+
setInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 1);
|
|
975
|
+
setFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
976
|
+
break;
|
|
977
|
+
case 'px':
|
|
978
|
+
setInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 1);
|
|
979
|
+
setFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE, value.value);
|
|
980
|
+
break;
|
|
981
|
+
case '%':
|
|
982
|
+
setInt32(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 2);
|
|
983
|
+
setFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE, value.value);
|
|
984
|
+
break;
|
|
985
|
+
}
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
this.setOrAppendState(StateKeys.MAX_SIZE);
|
|
989
|
+
}
|
|
990
|
+
get borderLeftWidth() {
|
|
991
|
+
const type = getInt32(this.style_view, StyleKeys.BORDER_LEFT_TYPE);
|
|
992
|
+
const value = getFloat32(this.style_view, StyleKeys.BORDER_LEFT_VALUE);
|
|
993
|
+
return parseLengthPercentage(type, value);
|
|
994
|
+
}
|
|
995
|
+
set borderLeftWidth(value) {
|
|
996
|
+
switch (typeof value) {
|
|
997
|
+
case 'number':
|
|
998
|
+
setInt32(this.style_view, StyleKeys.BORDER_LEFT_TYPE, 0);
|
|
999
|
+
setFloat32(this.style_view, StyleKeys.BORDER_LEFT_VALUE, layout.toDevicePixels(value));
|
|
1000
|
+
break;
|
|
1001
|
+
case 'object':
|
|
1002
|
+
switch (value.unit) {
|
|
1003
|
+
case 'dip':
|
|
1004
|
+
setInt32(this.style_view, StyleKeys.BORDER_LEFT_TYPE, 0);
|
|
1005
|
+
setFloat32(this.style_view, StyleKeys.BORDER_LEFT_VALUE, layout.toDevicePixels(value.value));
|
|
1006
|
+
break;
|
|
1007
|
+
case 'px':
|
|
1008
|
+
setInt32(this.style_view, StyleKeys.BORDER_LEFT_TYPE, 0);
|
|
1009
|
+
setFloat32(this.style_view, StyleKeys.BORDER_LEFT_VALUE, value.value);
|
|
1010
|
+
break;
|
|
1011
|
+
case '%':
|
|
1012
|
+
setInt32(this.style_view, StyleKeys.BORDER_LEFT_TYPE, 1);
|
|
1013
|
+
setFloat32(this.style_view, StyleKeys.BORDER_LEFT_VALUE, value.value);
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
this.setOrAppendState(StateKeys.BORDER);
|
|
1019
|
+
}
|
|
1020
|
+
get borderRightWidth() {
|
|
1021
|
+
const type = getInt32(this.style_view, StyleKeys.BORDER_RIGHT_TYPE);
|
|
1022
|
+
const value = getFloat32(this.style_view, StyleKeys.BORDER_RIGHT_VALUE);
|
|
1023
|
+
return parseLengthPercentage(type, value);
|
|
1024
|
+
}
|
|
1025
|
+
set borderRightWidth(value) {
|
|
1026
|
+
switch (typeof value) {
|
|
1027
|
+
case 'number':
|
|
1028
|
+
setInt32(this.style_view, StyleKeys.BORDER_RIGHT_TYPE, 0);
|
|
1029
|
+
setFloat32(this.style_view, StyleKeys.BORDER_RIGHT_VALUE, layout.toDevicePixels(value));
|
|
1030
|
+
break;
|
|
1031
|
+
case 'object':
|
|
1032
|
+
switch (value.unit) {
|
|
1033
|
+
case 'dip':
|
|
1034
|
+
setInt32(this.style_view, StyleKeys.BORDER_RIGHT_TYPE, 0);
|
|
1035
|
+
setFloat32(this.style_view, StyleKeys.BORDER_RIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
1036
|
+
break;
|
|
1037
|
+
case 'px':
|
|
1038
|
+
setInt32(this.style_view, StyleKeys.BORDER_RIGHT_TYPE, 0);
|
|
1039
|
+
setFloat32(this.style_view, StyleKeys.BORDER_RIGHT_VALUE, value.value);
|
|
1040
|
+
break;
|
|
1041
|
+
case '%':
|
|
1042
|
+
setInt32(this.style_view, StyleKeys.BORDER_RIGHT_TYPE, 1);
|
|
1043
|
+
setFloat32(this.style_view, StyleKeys.BORDER_RIGHT_VALUE, value.value);
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
break;
|
|
1047
|
+
}
|
|
1048
|
+
this.setOrAppendState(StateKeys.BORDER);
|
|
1049
|
+
}
|
|
1050
|
+
get borderTopWidth() {
|
|
1051
|
+
const type = getInt32(this.style_view, StyleKeys.BORDER_TOP_TYPE);
|
|
1052
|
+
const value = getFloat32(this.style_view, StyleKeys.BORDER_TOP_VALUE);
|
|
1053
|
+
return parseLengthPercentage(type, value);
|
|
1054
|
+
}
|
|
1055
|
+
set borderTopWidth(value) {
|
|
1056
|
+
switch (typeof value) {
|
|
1057
|
+
case 'number':
|
|
1058
|
+
setInt32(this.style_view, StyleKeys.BORDER_TOP_TYPE, 0);
|
|
1059
|
+
setFloat32(this.style_view, StyleKeys.BORDER_TOP_VALUE, layout.toDevicePixels(value));
|
|
1060
|
+
break;
|
|
1061
|
+
case 'object':
|
|
1062
|
+
switch (value.unit) {
|
|
1063
|
+
case 'dip':
|
|
1064
|
+
setInt32(this.style_view, StyleKeys.BORDER_TOP_TYPE, 0);
|
|
1065
|
+
setFloat32(this.style_view, StyleKeys.BORDER_TOP_VALUE, layout.toDevicePixels(value.value));
|
|
1066
|
+
break;
|
|
1067
|
+
case 'px':
|
|
1068
|
+
setInt32(this.style_view, StyleKeys.BORDER_TOP_TYPE, 0);
|
|
1069
|
+
setFloat32(this.style_view, StyleKeys.BORDER_TOP_VALUE, value.value);
|
|
1070
|
+
break;
|
|
1071
|
+
case '%':
|
|
1072
|
+
setInt32(this.style_view, StyleKeys.BORDER_TOP_TYPE, 1);
|
|
1073
|
+
setFloat32(this.style_view, StyleKeys.BORDER_TOP_VALUE, value.value);
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
this.setOrAppendState(StateKeys.BORDER);
|
|
1079
|
+
}
|
|
1080
|
+
get borderBottomWidth() {
|
|
1081
|
+
const type = getInt32(this.style_view, StyleKeys.BORDER_BOTTOM_TYPE);
|
|
1082
|
+
const value = getFloat32(this.style_view, StyleKeys.BORDER_BOTTOM_VALUE);
|
|
1083
|
+
return parseLengthPercentage(type, value);
|
|
1084
|
+
}
|
|
1085
|
+
set borderBottomWidth(value) {
|
|
1086
|
+
switch (typeof value) {
|
|
1087
|
+
case 'number':
|
|
1088
|
+
setInt32(this.style_view, StyleKeys.BORDER_BOTTOM_TYPE, 0);
|
|
1089
|
+
setFloat32(this.style_view, StyleKeys.BORDER_BOTTOM_VALUE, layout.toDevicePixels(value));
|
|
1090
|
+
break;
|
|
1091
|
+
case 'object':
|
|
1092
|
+
switch (value.unit) {
|
|
1093
|
+
case 'dip':
|
|
1094
|
+
setInt32(this.style_view, StyleKeys.BORDER_BOTTOM_TYPE, 0);
|
|
1095
|
+
setFloat32(this.style_view, StyleKeys.BORDER_BOTTOM_VALUE, layout.toDevicePixels(value.value));
|
|
1096
|
+
break;
|
|
1097
|
+
case 'px':
|
|
1098
|
+
setInt32(this.style_view, StyleKeys.BORDER_BOTTOM_TYPE, 0);
|
|
1099
|
+
setFloat32(this.style_view, StyleKeys.BORDER_BOTTOM_VALUE, value.value);
|
|
1100
|
+
break;
|
|
1101
|
+
case '%':
|
|
1102
|
+
setInt32(this.style_view, StyleKeys.BORDER_BOTTOM_TYPE, 1);
|
|
1103
|
+
setFloat32(this.style_view, StyleKeys.BORDER_BOTTOM_VALUE, value.value);
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
break;
|
|
1107
|
+
}
|
|
1108
|
+
this.setOrAppendState(StateKeys.BORDER);
|
|
1109
|
+
}
|
|
1110
|
+
get left() {
|
|
1111
|
+
const type = getInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE);
|
|
1112
|
+
const value = getFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE);
|
|
1113
|
+
return parseLengthPercentageAuto(type, value);
|
|
1114
|
+
}
|
|
1115
|
+
set left(value) {
|
|
1116
|
+
if (value === 'auto') {
|
|
1117
|
+
setInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE, 0);
|
|
1118
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, 0);
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
switch (typeof value) {
|
|
1122
|
+
case 'number':
|
|
1123
|
+
setInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE, 1);
|
|
1124
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, layout.toDevicePixels(value));
|
|
1125
|
+
break;
|
|
1126
|
+
case 'object':
|
|
1127
|
+
switch (value.unit) {
|
|
1128
|
+
case 'dip':
|
|
1129
|
+
setInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE, 1);
|
|
1130
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, layout.toDevicePixels(value.value));
|
|
1131
|
+
break;
|
|
1132
|
+
case 'px':
|
|
1133
|
+
setInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE, 1);
|
|
1134
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, value.value);
|
|
1135
|
+
break;
|
|
1136
|
+
case '%':
|
|
1137
|
+
setInt32(this.style_view, StyleKeys.INSET_LEFT_TYPE, 2);
|
|
1138
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, value.value);
|
|
1139
|
+
break;
|
|
1140
|
+
}
|
|
1141
|
+
break;
|
|
1142
|
+
}
|
|
1143
|
+
this.setOrAppendState(StateKeys.INSET);
|
|
1144
|
+
}
|
|
1145
|
+
get right() {
|
|
1146
|
+
const type = getInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE);
|
|
1147
|
+
const value = getFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE);
|
|
1148
|
+
return parseLengthPercentageAuto(type, value);
|
|
1149
|
+
}
|
|
1150
|
+
set right(value) {
|
|
1151
|
+
if (value === 'auto') {
|
|
1152
|
+
setInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 0);
|
|
1153
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, 0);
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
switch (typeof value) {
|
|
1157
|
+
case 'number':
|
|
1158
|
+
setInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 1);
|
|
1159
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, layout.toDevicePixels(value));
|
|
1160
|
+
break;
|
|
1161
|
+
case 'object':
|
|
1162
|
+
switch (value.unit) {
|
|
1163
|
+
case 'dip':
|
|
1164
|
+
setInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 1);
|
|
1165
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
1166
|
+
break;
|
|
1167
|
+
case 'px':
|
|
1168
|
+
setInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 1);
|
|
1169
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, value.value);
|
|
1170
|
+
break;
|
|
1171
|
+
case '%':
|
|
1172
|
+
setInt32(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 2);
|
|
1173
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, value.value);
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
break;
|
|
1177
|
+
}
|
|
1178
|
+
this.setOrAppendState(StateKeys.INSET);
|
|
1179
|
+
}
|
|
1180
|
+
get top() {
|
|
1181
|
+
const type = getInt32(this.style_view, StyleKeys.INSET_TOP_TYPE);
|
|
1182
|
+
const value = getFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE);
|
|
1183
|
+
return parseLengthPercentageAuto(type, value);
|
|
1184
|
+
}
|
|
1185
|
+
set top(value) {
|
|
1186
|
+
if (value === 'auto') {
|
|
1187
|
+
setInt32(this.style_view, StyleKeys.INSET_TOP_TYPE, 0);
|
|
1188
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, 0);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
switch (typeof value) {
|
|
1192
|
+
case 'number':
|
|
1193
|
+
setInt32(this.style_view, StyleKeys.INSET_TOP_TYPE, 1);
|
|
1194
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, layout.toDevicePixels(value));
|
|
1195
|
+
break;
|
|
1196
|
+
case 'object':
|
|
1197
|
+
switch (value.unit) {
|
|
1198
|
+
case 'dip':
|
|
1199
|
+
setInt32(this.style_view, StyleKeys.INSET_TOP_TYPE, 1);
|
|
1200
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, layout.toDevicePixels(value.value));
|
|
1201
|
+
break;
|
|
1202
|
+
case 'px':
|
|
1203
|
+
setInt32(this.style_view, StyleKeys.INSET_TOP_TYPE, 1);
|
|
1204
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, value.value);
|
|
1205
|
+
break;
|
|
1206
|
+
case '%':
|
|
1207
|
+
setInt32(this.style_view, StyleKeys.INSET_TOP_TYPE, 2);
|
|
1208
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, value.value);
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
this.setOrAppendState(StateKeys.INSET);
|
|
1214
|
+
}
|
|
1215
|
+
get bottom() {
|
|
1216
|
+
const type = getInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE);
|
|
1217
|
+
const value = getFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE);
|
|
1218
|
+
return parseLengthPercentageAuto(type, value);
|
|
1219
|
+
}
|
|
1220
|
+
set bottom(value) {
|
|
1221
|
+
if (value === 'auto') {
|
|
1222
|
+
setInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 0);
|
|
1223
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, 0);
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
switch (typeof value) {
|
|
1227
|
+
case 'number':
|
|
1228
|
+
setInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 1);
|
|
1229
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, layout.toDevicePixels(value));
|
|
1230
|
+
break;
|
|
1231
|
+
case 'object':
|
|
1232
|
+
switch (value.unit) {
|
|
1233
|
+
case 'dip':
|
|
1234
|
+
setInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 1);
|
|
1235
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, layout.toDevicePixels(value.value));
|
|
1236
|
+
break;
|
|
1237
|
+
case 'px':
|
|
1238
|
+
setInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 1);
|
|
1239
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, value.value);
|
|
1240
|
+
break;
|
|
1241
|
+
case '%':
|
|
1242
|
+
setInt32(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 2);
|
|
1243
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, value.value);
|
|
1244
|
+
break;
|
|
1245
|
+
}
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
1248
|
+
this.setOrAppendState(StateKeys.INSET);
|
|
1249
|
+
}
|
|
1250
|
+
get marginLeft() {
|
|
1251
|
+
const type = getInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE);
|
|
1252
|
+
const value = getFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE);
|
|
1253
|
+
return parseLengthPercentageAuto(type, value);
|
|
1254
|
+
}
|
|
1255
|
+
set marginLeft(value) {
|
|
1256
|
+
switch (typeof value) {
|
|
1257
|
+
case 'string':
|
|
1258
|
+
setInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 0);
|
|
1259
|
+
break;
|
|
1260
|
+
case 'number':
|
|
1261
|
+
setInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 1);
|
|
1262
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE, layout.toDevicePixels(value));
|
|
1263
|
+
break;
|
|
1264
|
+
case 'object':
|
|
1265
|
+
switch (value.unit) {
|
|
1266
|
+
case 'dip':
|
|
1267
|
+
setInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 1);
|
|
1268
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE, layout.toDevicePixels(value.value));
|
|
1269
|
+
break;
|
|
1270
|
+
case 'px':
|
|
1271
|
+
setInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 1);
|
|
1272
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE, value.value);
|
|
1273
|
+
break;
|
|
1274
|
+
case '%':
|
|
1275
|
+
setInt32(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 2);
|
|
1276
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE, value.value);
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
break;
|
|
1280
|
+
}
|
|
1281
|
+
this.setOrAppendState(StateKeys.MARGIN);
|
|
1282
|
+
}
|
|
1283
|
+
get marginRight() {
|
|
1284
|
+
const type = getInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE);
|
|
1285
|
+
const value = getFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE);
|
|
1286
|
+
return parseLengthPercentageAuto(type, value);
|
|
1287
|
+
}
|
|
1288
|
+
set marginRight(value) {
|
|
1289
|
+
switch (typeof value) {
|
|
1290
|
+
case 'string':
|
|
1291
|
+
setInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 0);
|
|
1292
|
+
break;
|
|
1293
|
+
case 'number':
|
|
1294
|
+
setInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 1);
|
|
1295
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE, layout.toDevicePixels(value));
|
|
1296
|
+
break;
|
|
1297
|
+
case 'object':
|
|
1298
|
+
switch (value.unit) {
|
|
1299
|
+
case 'dip':
|
|
1300
|
+
setInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 1);
|
|
1301
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
1302
|
+
break;
|
|
1303
|
+
case 'px':
|
|
1304
|
+
setInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 1);
|
|
1305
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE, value.value);
|
|
1306
|
+
break;
|
|
1307
|
+
case '%':
|
|
1308
|
+
setInt32(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 2);
|
|
1309
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE, value.value);
|
|
1310
|
+
break;
|
|
1311
|
+
}
|
|
1312
|
+
break;
|
|
1313
|
+
}
|
|
1314
|
+
this.setOrAppendState(StateKeys.MARGIN);
|
|
1315
|
+
}
|
|
1316
|
+
get marginTop() {
|
|
1317
|
+
const type = getInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE);
|
|
1318
|
+
const value = getFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE);
|
|
1319
|
+
return parseLengthPercentageAuto(type, value);
|
|
1320
|
+
}
|
|
1321
|
+
set marginTop(value) {
|
|
1322
|
+
switch (typeof value) {
|
|
1323
|
+
case 'string':
|
|
1324
|
+
setInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 0);
|
|
1325
|
+
break;
|
|
1326
|
+
case 'number':
|
|
1327
|
+
setInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 1);
|
|
1328
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE, layout.toDevicePixels(value));
|
|
1329
|
+
break;
|
|
1330
|
+
case 'object':
|
|
1331
|
+
switch (value.unit) {
|
|
1332
|
+
case 'dip':
|
|
1333
|
+
setInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 1);
|
|
1334
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE, layout.toDevicePixels(value.value));
|
|
1335
|
+
break;
|
|
1336
|
+
case 'px':
|
|
1337
|
+
setInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 1);
|
|
1338
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE, value.value);
|
|
1339
|
+
break;
|
|
1340
|
+
case '%':
|
|
1341
|
+
setInt32(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 2);
|
|
1342
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE, value.value);
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
break;
|
|
1346
|
+
}
|
|
1347
|
+
this.setOrAppendState(StateKeys.MARGIN);
|
|
1348
|
+
}
|
|
1349
|
+
get marginBottom() {
|
|
1350
|
+
const type = getInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE);
|
|
1351
|
+
const value = getFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE);
|
|
1352
|
+
return parseLengthPercentageAuto(type, value);
|
|
1353
|
+
}
|
|
1354
|
+
set marginBottom(value) {
|
|
1355
|
+
switch (typeof value) {
|
|
1356
|
+
case 'string':
|
|
1357
|
+
setInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 0);
|
|
1358
|
+
break;
|
|
1359
|
+
case 'number':
|
|
1360
|
+
setInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 1);
|
|
1361
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE, layout.toDevicePixels(value));
|
|
1362
|
+
break;
|
|
1363
|
+
case 'object':
|
|
1364
|
+
switch (value.unit) {
|
|
1365
|
+
case 'dip':
|
|
1366
|
+
setInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 1);
|
|
1367
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE, layout.toDevicePixels(value.value));
|
|
1368
|
+
break;
|
|
1369
|
+
case 'px':
|
|
1370
|
+
setInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 1);
|
|
1371
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE, value.value);
|
|
1372
|
+
break;
|
|
1373
|
+
case '%':
|
|
1374
|
+
setInt32(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 2);
|
|
1375
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE, value.value);
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
break;
|
|
1379
|
+
}
|
|
1380
|
+
this.setOrAppendState(StateKeys.MARGIN);
|
|
1381
|
+
}
|
|
1382
|
+
set padding(value) {
|
|
1383
|
+
this.inBatch = true;
|
|
1384
|
+
this.paddingBottom = this.paddingLeft = this.paddingRight = this.paddingTop = value;
|
|
1385
|
+
this.inBatch = false;
|
|
1386
|
+
this.setOrAppendState(StateKeys.PADDING);
|
|
1387
|
+
}
|
|
1388
|
+
get paddingLeft() {
|
|
1389
|
+
const type = getInt32(this.style_view, StyleKeys.PADDING_LEFT_TYPE);
|
|
1390
|
+
const value = getFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE);
|
|
1391
|
+
return parseLengthPercentage(type, value);
|
|
1392
|
+
}
|
|
1393
|
+
set paddingLeft(value) {
|
|
1394
|
+
switch (typeof value) {
|
|
1395
|
+
case 'number':
|
|
1396
|
+
setInt32(this.style_view, StyleKeys.PADDING_LEFT_TYPE, 0);
|
|
1397
|
+
setFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE, layout.toDevicePixels(value));
|
|
1398
|
+
break;
|
|
1399
|
+
case 'object':
|
|
1400
|
+
switch (value.unit) {
|
|
1401
|
+
case 'dip':
|
|
1402
|
+
setInt32(this.style_view, StyleKeys.PADDING_LEFT_TYPE, 0);
|
|
1403
|
+
setFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE, layout.toDevicePixels(value.value));
|
|
1404
|
+
break;
|
|
1405
|
+
case 'px':
|
|
1406
|
+
setInt32(this.style_view, StyleKeys.PADDING_LEFT_TYPE, 0);
|
|
1407
|
+
setFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE, value.value);
|
|
1408
|
+
break;
|
|
1409
|
+
case '%':
|
|
1410
|
+
setInt32(this.style_view, StyleKeys.PADDING_LEFT_TYPE, 1);
|
|
1411
|
+
setFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE, value.value);
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
break;
|
|
1415
|
+
}
|
|
1416
|
+
this.setOrAppendState(StateKeys.PADDING);
|
|
1417
|
+
}
|
|
1418
|
+
get paddingRight() {
|
|
1419
|
+
const type = getInt32(this.style_view, StyleKeys.PADDING_RIGHT_TYPE);
|
|
1420
|
+
const value = getFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE);
|
|
1421
|
+
return parseLengthPercentage(type, value);
|
|
1422
|
+
}
|
|
1423
|
+
set paddingRight(value) {
|
|
1424
|
+
switch (typeof value) {
|
|
1425
|
+
case 'number':
|
|
1426
|
+
setInt32(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, 0);
|
|
1427
|
+
setFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE, layout.toDevicePixels(value));
|
|
1428
|
+
break;
|
|
1429
|
+
case 'object':
|
|
1430
|
+
switch (value.unit) {
|
|
1431
|
+
case 'dip':
|
|
1432
|
+
setInt32(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, 0);
|
|
1433
|
+
setFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE, layout.toDevicePixels(value.value));
|
|
1434
|
+
break;
|
|
1435
|
+
case 'px':
|
|
1436
|
+
setInt32(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, 0);
|
|
1437
|
+
setFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE, value.value);
|
|
1438
|
+
break;
|
|
1439
|
+
case '%':
|
|
1440
|
+
setInt32(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, 1);
|
|
1441
|
+
setFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE, value.value);
|
|
1442
|
+
break;
|
|
1443
|
+
}
|
|
1444
|
+
break;
|
|
1445
|
+
}
|
|
1446
|
+
this.setOrAppendState(StateKeys.PADDING);
|
|
1447
|
+
}
|
|
1448
|
+
get paddingTop() {
|
|
1449
|
+
const type = getInt32(this.style_view, StyleKeys.PADDING_TOP_TYPE);
|
|
1450
|
+
const value = getFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE);
|
|
1451
|
+
return parseLengthPercentage(type, value);
|
|
1452
|
+
}
|
|
1453
|
+
set paddingTop(value) {
|
|
1454
|
+
switch (typeof value) {
|
|
1455
|
+
case 'number':
|
|
1456
|
+
setInt32(this.style_view, StyleKeys.PADDING_TOP_TYPE, 0);
|
|
1457
|
+
setFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE, layout.toDevicePixels(value));
|
|
1458
|
+
break;
|
|
1459
|
+
case 'object':
|
|
1460
|
+
switch (value.unit) {
|
|
1461
|
+
case 'dip':
|
|
1462
|
+
setInt32(this.style_view, StyleKeys.PADDING_TOP_TYPE, 0);
|
|
1463
|
+
setFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE, layout.toDevicePixels(value.value));
|
|
1464
|
+
break;
|
|
1465
|
+
case 'px':
|
|
1466
|
+
setInt32(this.style_view, StyleKeys.PADDING_TOP_TYPE, 0);
|
|
1467
|
+
setFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE, value.value);
|
|
1468
|
+
break;
|
|
1469
|
+
case '%':
|
|
1470
|
+
setInt32(this.style_view, StyleKeys.PADDING_TOP_TYPE, 1);
|
|
1471
|
+
setFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE, value.value);
|
|
1472
|
+
break;
|
|
1473
|
+
}
|
|
1474
|
+
break;
|
|
1475
|
+
}
|
|
1476
|
+
this.setOrAppendState(StateKeys.PADDING);
|
|
1477
|
+
}
|
|
1478
|
+
get paddingBottom() {
|
|
1479
|
+
const type = getInt32(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE);
|
|
1480
|
+
const value = getFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE);
|
|
1481
|
+
return parseLengthPercentage(type, value);
|
|
1482
|
+
}
|
|
1483
|
+
set paddingBottom(value) {
|
|
1484
|
+
switch (typeof value) {
|
|
1485
|
+
case 'number':
|
|
1486
|
+
setInt32(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, 0);
|
|
1487
|
+
setFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE, layout.toDevicePixels(value));
|
|
1488
|
+
break;
|
|
1489
|
+
case 'object':
|
|
1490
|
+
switch (value.unit) {
|
|
1491
|
+
case 'dip':
|
|
1492
|
+
setInt32(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, 0);
|
|
1493
|
+
setFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE, layout.toDevicePixels(value.value));
|
|
1494
|
+
break;
|
|
1495
|
+
case 'px':
|
|
1496
|
+
setInt32(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, 0);
|
|
1497
|
+
setFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE, value.value);
|
|
1498
|
+
break;
|
|
1499
|
+
case '%':
|
|
1500
|
+
setInt32(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, 1);
|
|
1501
|
+
setFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE, value.value);
|
|
1502
|
+
break;
|
|
1503
|
+
}
|
|
1504
|
+
break;
|
|
1505
|
+
}
|
|
1506
|
+
this.setOrAppendState(StateKeys.PADDING);
|
|
1507
|
+
}
|
|
1508
|
+
get gridGap() {
|
|
1509
|
+
return this.gap;
|
|
1510
|
+
}
|
|
1511
|
+
set gridGap(value) {
|
|
1512
|
+
this.gap = value;
|
|
1513
|
+
}
|
|
1514
|
+
get gap() {
|
|
1515
|
+
if (CoreLength.equals(this.rowGap, this.columnGap)) {
|
|
1516
|
+
return `${CoreLength.convertToString(this.rowGap)}`;
|
|
1517
|
+
}
|
|
1518
|
+
return `${CoreLength.convertToString(this.rowGap)} ${CoreLength.convertToString(this.columnGap)}`;
|
|
1519
|
+
}
|
|
1520
|
+
set gap(value) {
|
|
1521
|
+
if (typeof value === 'string') {
|
|
1522
|
+
const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
|
|
1523
|
+
const length = values.length;
|
|
1524
|
+
if (length === 0) {
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
if (length === 1) {
|
|
1528
|
+
const row = values[0];
|
|
1529
|
+
this.rowGap = CoreLength.parse(row);
|
|
1530
|
+
this.columnGap = CoreLength.parse(row);
|
|
1531
|
+
}
|
|
1532
|
+
if (length > 1) {
|
|
1533
|
+
const row = values[0];
|
|
1534
|
+
const column = values[1];
|
|
1535
|
+
this.rowGap = CoreLength.parse(row);
|
|
1536
|
+
this.columnGap = CoreLength.parse(column);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
get rowGap() {
|
|
1541
|
+
const type = getInt32(this.style_view, StyleKeys.GAP_ROW_TYPE);
|
|
1542
|
+
const value = getFloat32(this.style_view, StyleKeys.GAP_ROW_VALUE);
|
|
1543
|
+
return parseLengthPercentage(type, value);
|
|
1544
|
+
}
|
|
1545
|
+
set rowGap(value) {
|
|
1546
|
+
switch (typeof value) {
|
|
1547
|
+
case 'number':
|
|
1548
|
+
setInt32(this.style_view, StyleKeys.GAP_ROW_TYPE, 0);
|
|
1549
|
+
setFloat32(this.style_view, StyleKeys.GAP_ROW_VALUE, layout.toDevicePixels(value));
|
|
1550
|
+
break;
|
|
1551
|
+
case 'object':
|
|
1552
|
+
switch (value.unit) {
|
|
1553
|
+
case 'dip':
|
|
1554
|
+
setInt32(this.style_view, StyleKeys.GAP_ROW_TYPE, 0);
|
|
1555
|
+
setFloat32(this.style_view, StyleKeys.GAP_ROW_VALUE, layout.toDevicePixels(value.value));
|
|
1556
|
+
break;
|
|
1557
|
+
case 'px':
|
|
1558
|
+
setInt32(this.style_view, StyleKeys.GAP_ROW_TYPE, 0);
|
|
1559
|
+
setFloat32(this.style_view, StyleKeys.GAP_ROW_VALUE, value.value);
|
|
1560
|
+
break;
|
|
1561
|
+
case '%':
|
|
1562
|
+
setInt32(this.style_view, StyleKeys.GAP_ROW_TYPE, 1);
|
|
1563
|
+
setFloat32(this.style_view, StyleKeys.GAP_ROW_VALUE, value.value);
|
|
1564
|
+
break;
|
|
1565
|
+
}
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
this.setOrAppendState(StateKeys.GAP);
|
|
1569
|
+
}
|
|
1570
|
+
get columnGap() {
|
|
1571
|
+
const type = getInt32(this.style_view, StyleKeys.GAP_COLUMN_TYPE);
|
|
1572
|
+
const value = getFloat32(this.style_view, StyleKeys.GAP_COLUMN_VALUE);
|
|
1573
|
+
return parseLengthPercentage(type, value);
|
|
1574
|
+
}
|
|
1575
|
+
set columnGap(value) {
|
|
1576
|
+
switch (typeof value) {
|
|
1577
|
+
case 'number':
|
|
1578
|
+
setInt32(this.style_view, StyleKeys.GAP_COLUMN_TYPE, 0);
|
|
1579
|
+
setFloat32(this.style_view, StyleKeys.GAP_COLUMN_VALUE, layout.toDevicePixels(value));
|
|
1580
|
+
break;
|
|
1581
|
+
case 'object':
|
|
1582
|
+
switch (value.unit) {
|
|
1583
|
+
case 'dip':
|
|
1584
|
+
setInt32(this.style_view, StyleKeys.GAP_COLUMN_TYPE, 0);
|
|
1585
|
+
setFloat32(this.style_view, StyleKeys.GAP_COLUMN_VALUE, layout.toDevicePixels(value.value));
|
|
1586
|
+
break;
|
|
1587
|
+
case 'px':
|
|
1588
|
+
setInt32(this.style_view, StyleKeys.GAP_COLUMN_TYPE, 0);
|
|
1589
|
+
setFloat32(this.style_view, StyleKeys.GAP_COLUMN_VALUE, value.value);
|
|
1590
|
+
break;
|
|
1591
|
+
case '%':
|
|
1592
|
+
setInt32(this.style_view, StyleKeys.GAP_COLUMN_TYPE, 1);
|
|
1593
|
+
setFloat32(this.style_view, StyleKeys.GAP_COLUMN_VALUE, value.value);
|
|
1594
|
+
break;
|
|
1595
|
+
}
|
|
1596
|
+
break;
|
|
1597
|
+
}
|
|
1598
|
+
this.setOrAppendState(StateKeys.GAP);
|
|
1599
|
+
}
|
|
1600
|
+
get aspectRatio() {
|
|
1601
|
+
return getFloat32(this.style_view, StyleKeys.ASPECT_RATIO);
|
|
1602
|
+
}
|
|
1603
|
+
set aspectRatio(value) {
|
|
1604
|
+
setFloat32(this.style_view, StyleKeys.ASPECT_RATIO, value);
|
|
1605
|
+
this.setOrAppendState(StateKeys.ASPECT_RATIO);
|
|
1606
|
+
}
|
|
1607
|
+
get flexBasis() {
|
|
1608
|
+
const type = getInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE);
|
|
1609
|
+
const value = getFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE);
|
|
1610
|
+
return parseLengthPercentageAuto(type, value);
|
|
1611
|
+
}
|
|
1612
|
+
set flexBasis(value) {
|
|
1613
|
+
switch (typeof value) {
|
|
1614
|
+
case 'string':
|
|
1615
|
+
setInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 0);
|
|
1616
|
+
break;
|
|
1617
|
+
case 'number':
|
|
1618
|
+
setInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 1);
|
|
1619
|
+
setFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE, layout.toDevicePixels(value));
|
|
1620
|
+
break;
|
|
1621
|
+
case 'object':
|
|
1622
|
+
switch (value.unit) {
|
|
1623
|
+
case 'dip':
|
|
1624
|
+
setInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 1);
|
|
1625
|
+
setFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE, layout.toDevicePixels(value.value));
|
|
1626
|
+
break;
|
|
1627
|
+
case 'px':
|
|
1628
|
+
setInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 1);
|
|
1629
|
+
setFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE, value.value);
|
|
1630
|
+
break;
|
|
1631
|
+
case '%':
|
|
1632
|
+
setInt32(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 2);
|
|
1633
|
+
setFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE, value.value);
|
|
1634
|
+
break;
|
|
1635
|
+
}
|
|
1636
|
+
break;
|
|
1637
|
+
}
|
|
1638
|
+
this.setOrAppendState(StateKeys.FLEX_BASIS);
|
|
1639
|
+
}
|
|
1640
|
+
get alignItems() {
|
|
1641
|
+
switch (getInt32(this.style_view, StyleKeys.ALIGN_ITEMS)) {
|
|
1642
|
+
case -1 /* AlignItems.Normal */:
|
|
1643
|
+
return 'normal';
|
|
1644
|
+
case 0 /* AlignItems.Start */:
|
|
1645
|
+
return 'start';
|
|
1646
|
+
case 1 /* AlignItems.End */:
|
|
1647
|
+
return 'end';
|
|
1648
|
+
case 5 /* AlignItems.FlexStart */:
|
|
1649
|
+
return 'flex-start';
|
|
1650
|
+
case 6 /* AlignItems.FlexEnd */:
|
|
1651
|
+
return 'flex-end';
|
|
1652
|
+
case 2 /* AlignItems.Center */:
|
|
1653
|
+
return 'center';
|
|
1654
|
+
case 3 /* AlignItems.Baseline */:
|
|
1655
|
+
return 'baseline';
|
|
1656
|
+
case 4 /* AlignItems.Stretch */:
|
|
1657
|
+
return 'stretch';
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
set alignItems(value) {
|
|
1661
|
+
switch (value) {
|
|
1662
|
+
case 'normal':
|
|
1663
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, -1 /* AlignItems.Normal */);
|
|
1664
|
+
break;
|
|
1665
|
+
case 'start':
|
|
1666
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 0 /* AlignItems.Start */);
|
|
1667
|
+
break;
|
|
1668
|
+
case 'end':
|
|
1669
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 1 /* AlignItems.End */);
|
|
1670
|
+
break;
|
|
1671
|
+
case 'flex-start':
|
|
1672
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 5 /* AlignItems.FlexStart */);
|
|
1673
|
+
break;
|
|
1674
|
+
case 'flex-end':
|
|
1675
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 6 /* AlignItems.FlexEnd */);
|
|
1676
|
+
break;
|
|
1677
|
+
case 'center':
|
|
1678
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 2 /* AlignItems.Center */);
|
|
1679
|
+
break;
|
|
1680
|
+
case 'baseline':
|
|
1681
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 3 /* AlignItems.Baseline */);
|
|
1682
|
+
break;
|
|
1683
|
+
case 'stretch':
|
|
1684
|
+
setInt32(this.style_view, StyleKeys.ALIGN_ITEMS, 4 /* AlignItems.Stretch */);
|
|
1685
|
+
break;
|
|
1686
|
+
}
|
|
1687
|
+
this.setOrAppendState(StateKeys.ALIGN_ITEMS);
|
|
1688
|
+
}
|
|
1689
|
+
get alignSelf() {
|
|
1690
|
+
switch (getInt32(this.style_view, StyleKeys.ALIGN_SELF)) {
|
|
1691
|
+
case -1 /* AlignSelf.Normal */:
|
|
1692
|
+
return 'normal';
|
|
1693
|
+
case 0 /* AlignSelf.Start */:
|
|
1694
|
+
return 'start';
|
|
1695
|
+
case 1 /* AlignSelf.End */:
|
|
1696
|
+
return 'end';
|
|
1697
|
+
case 2 /* AlignSelf.Center */:
|
|
1698
|
+
return 'center';
|
|
1699
|
+
case 3 /* AlignSelf.Baseline */:
|
|
1700
|
+
return 'baseline';
|
|
1701
|
+
case 4 /* AlignSelf.Stretch */:
|
|
1702
|
+
return 'stretch';
|
|
1703
|
+
case 5 /* AlignSelf.FlexStart */:
|
|
1704
|
+
return 'flex-start';
|
|
1705
|
+
case 6 /* AlignSelf.FlexEnd */:
|
|
1706
|
+
return 'flex-end';
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
set alignSelf(value) {
|
|
1710
|
+
let align = -2;
|
|
1711
|
+
switch (value) {
|
|
1712
|
+
case 'normal':
|
|
1713
|
+
align = -1 /* AlignSelf.Normal */;
|
|
1714
|
+
break;
|
|
1715
|
+
case 'start':
|
|
1716
|
+
align = 0 /* AlignSelf.Start */;
|
|
1717
|
+
break;
|
|
1718
|
+
case 'end':
|
|
1719
|
+
align = 1 /* AlignSelf.End */;
|
|
1720
|
+
break;
|
|
1721
|
+
case 'center':
|
|
1722
|
+
align = 2 /* AlignSelf.Center */;
|
|
1723
|
+
break;
|
|
1724
|
+
case 'baseline':
|
|
1725
|
+
align = 3 /* AlignSelf.Baseline */;
|
|
1726
|
+
break;
|
|
1727
|
+
case 'stretch':
|
|
1728
|
+
align = 4 /* AlignSelf.Stretch */;
|
|
1729
|
+
break;
|
|
1730
|
+
case 'flex-start':
|
|
1731
|
+
align = 5 /* AlignSelf.FlexStart */;
|
|
1732
|
+
break;
|
|
1733
|
+
case 'flex-end':
|
|
1734
|
+
align = 6 /* AlignSelf.FlexEnd */;
|
|
1735
|
+
break;
|
|
1736
|
+
}
|
|
1737
|
+
if (align === -2) {
|
|
1738
|
+
setInt32(this.style_view, StyleKeys.ALIGN_SELF, align);
|
|
1739
|
+
this.setOrAppendState(StateKeys.ALIGN_SELF);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
get alignContent() {
|
|
1743
|
+
switch (getInt32(this.style_view, StyleKeys.ALIGN_CONTENT)) {
|
|
1744
|
+
case -1 /* AlignContent.Normal */:
|
|
1745
|
+
return 'normal';
|
|
1746
|
+
case 5 /* AlignContent.SpaceAround */:
|
|
1747
|
+
return 'space-around';
|
|
1748
|
+
case 4 /* AlignContent.SpaceBetween */:
|
|
1749
|
+
return 'space-between';
|
|
1750
|
+
case 6 /* AlignContent.SpaceEvenly */:
|
|
1751
|
+
return 'space-evenly';
|
|
1752
|
+
case 2 /* AlignContent.Center */:
|
|
1753
|
+
return 'center';
|
|
1754
|
+
case 1 /* AlignContent.End */:
|
|
1755
|
+
return 'end';
|
|
1756
|
+
case 0 /* AlignContent.Start */:
|
|
1757
|
+
return 'start';
|
|
1758
|
+
case 3 /* AlignContent.Stretch */:
|
|
1759
|
+
return 'stretch';
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
set alignContent(value) {
|
|
1763
|
+
switch (value) {
|
|
1764
|
+
case 'normal':
|
|
1765
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, -1 /* AlignContent.Normal */);
|
|
1766
|
+
break;
|
|
1767
|
+
case 'space-around':
|
|
1768
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 5 /* AlignContent.SpaceAround */);
|
|
1769
|
+
break;
|
|
1770
|
+
case 'space-between':
|
|
1771
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 4 /* AlignContent.SpaceBetween */);
|
|
1772
|
+
break;
|
|
1773
|
+
case 'space-evenly':
|
|
1774
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 6 /* AlignContent.SpaceEvenly */);
|
|
1775
|
+
break;
|
|
1776
|
+
case 'center':
|
|
1777
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 2 /* AlignContent.Center */);
|
|
1778
|
+
break;
|
|
1779
|
+
case 'end':
|
|
1780
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 1 /* AlignContent.End */);
|
|
1781
|
+
break;
|
|
1782
|
+
case 'start':
|
|
1783
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 0 /* AlignContent.Start */);
|
|
1784
|
+
break;
|
|
1785
|
+
case 'stretch':
|
|
1786
|
+
setInt32(this.style_view, StyleKeys.ALIGN_CONTENT, 3 /* AlignContent.Stretch */);
|
|
1787
|
+
break;
|
|
1788
|
+
}
|
|
1789
|
+
this.setOrAppendState(StateKeys.ALIGN_CONTENT);
|
|
1790
|
+
}
|
|
1791
|
+
get justifyItems() {
|
|
1792
|
+
switch (getInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS)) {
|
|
1793
|
+
case -1 /* JustifyItems.Normal */:
|
|
1794
|
+
return 'normal';
|
|
1795
|
+
case 0 /* JustifyItems.Start */:
|
|
1796
|
+
return 'start';
|
|
1797
|
+
case 1 /* JustifyItems.End */:
|
|
1798
|
+
return 'end';
|
|
1799
|
+
case 2 /* JustifyItems.Center */:
|
|
1800
|
+
return 'center';
|
|
1801
|
+
case 3 /* JustifyItems.Baseline */:
|
|
1802
|
+
return 'baseline';
|
|
1803
|
+
case 4 /* JustifyItems.Stretch */:
|
|
1804
|
+
return 'stretch';
|
|
1805
|
+
case 5 /* JustifyItems.FlexStart */:
|
|
1806
|
+
return 'flex-start';
|
|
1807
|
+
case 6 /* JustifyItems.FlexEnd */:
|
|
1808
|
+
return 'flex-end';
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
set justifyItems(value) {
|
|
1812
|
+
switch (value) {
|
|
1813
|
+
case 'normal':
|
|
1814
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, -1 /* JustifyItems.Normal */);
|
|
1815
|
+
break;
|
|
1816
|
+
case 'start':
|
|
1817
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 0 /* JustifyItems.Start */);
|
|
1818
|
+
break;
|
|
1819
|
+
case 'end':
|
|
1820
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 1 /* JustifyItems.End */);
|
|
1821
|
+
break;
|
|
1822
|
+
case 'center':
|
|
1823
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 2 /* JustifyItems.Center */);
|
|
1824
|
+
break;
|
|
1825
|
+
case 'baseline':
|
|
1826
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 3 /* JustifyItems.Baseline */);
|
|
1827
|
+
break;
|
|
1828
|
+
case 'stretch':
|
|
1829
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 4 /* JustifyItems.Stretch */);
|
|
1830
|
+
break;
|
|
1831
|
+
case 'flex-start':
|
|
1832
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 5 /* JustifyItems.FlexStart */);
|
|
1833
|
+
break;
|
|
1834
|
+
case 'flex-end':
|
|
1835
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_ITEMS, 6 /* JustifyItems.FlexEnd */);
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
this.setOrAppendState(StateKeys.JUSTIFY_ITEMS);
|
|
1839
|
+
}
|
|
1840
|
+
get justifySelf() {
|
|
1841
|
+
switch (getInt32(this.style_view, StyleKeys.JUSTIFY_SELF)) {
|
|
1842
|
+
case -1 /* JustifySelf.Normal */:
|
|
1843
|
+
return 'normal';
|
|
1844
|
+
case 0 /* JustifySelf.Start */:
|
|
1845
|
+
return 'start';
|
|
1846
|
+
case 1 /* JustifySelf.End */:
|
|
1847
|
+
return 'end';
|
|
1848
|
+
case 2 /* JustifySelf.Center */:
|
|
1849
|
+
return 'center';
|
|
1850
|
+
case 3 /* JustifySelf.Baseline */:
|
|
1851
|
+
return 'baseline';
|
|
1852
|
+
case 4 /* JustifySelf.Stretch */:
|
|
1853
|
+
return 'stretch';
|
|
1854
|
+
case 5 /* JustifySelf.FlexStart */:
|
|
1855
|
+
return 'flex-start';
|
|
1856
|
+
case 6 /* JustifySelf.FlexEnd */:
|
|
1857
|
+
return 'flex-end';
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
set justifySelf(value) {
|
|
1861
|
+
switch (value) {
|
|
1862
|
+
case 'normal':
|
|
1863
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, -1 /* JustifySelf.Normal */);
|
|
1864
|
+
break;
|
|
1865
|
+
case 'start':
|
|
1866
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 0 /* JustifySelf.Start */);
|
|
1867
|
+
break;
|
|
1868
|
+
case 'end':
|
|
1869
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 1 /* JustifySelf.End */);
|
|
1870
|
+
break;
|
|
1871
|
+
case 'center':
|
|
1872
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 2 /* JustifySelf.Center */);
|
|
1873
|
+
break;
|
|
1874
|
+
case 'baseline':
|
|
1875
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 3 /* JustifySelf.Baseline */);
|
|
1876
|
+
break;
|
|
1877
|
+
case 'stretch':
|
|
1878
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 4 /* JustifySelf.Stretch */);
|
|
1879
|
+
break;
|
|
1880
|
+
case 'flex-start':
|
|
1881
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 5 /* JustifySelf.FlexStart */);
|
|
1882
|
+
break;
|
|
1883
|
+
case 'flex-end':
|
|
1884
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_SELF, 6 /* JustifySelf.FlexEnd */);
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
this.setOrAppendState(StateKeys.JUSTIFY_SELF);
|
|
1888
|
+
}
|
|
1889
|
+
get justifyContent() {
|
|
1890
|
+
switch (getInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT)) {
|
|
1891
|
+
case -1 /* JustifyContent.Normal */:
|
|
1892
|
+
return 'normal';
|
|
1893
|
+
case 0 /* JustifyContent.Start */:
|
|
1894
|
+
return 'start';
|
|
1895
|
+
case 1 /* JustifyContent.End */:
|
|
1896
|
+
return 'end';
|
|
1897
|
+
case 2 /* JustifyContent.Center */:
|
|
1898
|
+
return 'center';
|
|
1899
|
+
case 3 /* JustifyContent.Stretch */:
|
|
1900
|
+
return 'stretch';
|
|
1901
|
+
case 4 /* JustifyContent.SpaceBetween */:
|
|
1902
|
+
return 'space-between';
|
|
1903
|
+
case 5 /* JustifyContent.SpaceAround */:
|
|
1904
|
+
return 'space-around';
|
|
1905
|
+
case 6 /* JustifyContent.SpaceEvenly */:
|
|
1906
|
+
return 'space-evenly';
|
|
1907
|
+
case 7 /* JustifyContent.FlexStart */:
|
|
1908
|
+
return 'flex-start';
|
|
1909
|
+
case 8 /* JustifyContent.FlexEnd */:
|
|
1910
|
+
return 'flex-end';
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
set justifyContent(value) {
|
|
1914
|
+
switch (value) {
|
|
1915
|
+
case 'normal':
|
|
1916
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, -1 /* JustifyContent.Normal */);
|
|
1917
|
+
break;
|
|
1918
|
+
case 'space-around':
|
|
1919
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 5 /* JustifyContent.SpaceAround */);
|
|
1920
|
+
break;
|
|
1921
|
+
case 'space-between':
|
|
1922
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 4 /* JustifyContent.SpaceBetween */);
|
|
1923
|
+
break;
|
|
1924
|
+
case 'space-evenly':
|
|
1925
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 6 /* JustifyContent.SpaceEvenly */);
|
|
1926
|
+
break;
|
|
1927
|
+
case 'center':
|
|
1928
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 2 /* JustifyContent.Center */);
|
|
1929
|
+
break;
|
|
1930
|
+
case 'end':
|
|
1931
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 1 /* JustifyContent.End */);
|
|
1932
|
+
break;
|
|
1933
|
+
case 'start':
|
|
1934
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 0 /* JustifyContent.Start */);
|
|
1935
|
+
break;
|
|
1936
|
+
case 'stretch':
|
|
1937
|
+
setInt32(this.style_view, StyleKeys.JUSTIFY_CONTENT, 3 /* JustifyContent.Stretch */);
|
|
1938
|
+
break;
|
|
1939
|
+
}
|
|
1940
|
+
this.setOrAppendState(StateKeys.JUSTIFY_CONTENT);
|
|
1941
|
+
}
|
|
1942
|
+
get gridAutoRows() {
|
|
1943
|
+
if (!this.nativeView) {
|
|
1944
|
+
return '';
|
|
1945
|
+
}
|
|
1946
|
+
if (__ANDROID__) {
|
|
1947
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridAutoRows(this.nativeView);
|
|
1948
|
+
}
|
|
1949
|
+
if (__APPLE__) {
|
|
1950
|
+
return this.nativeView.style.gridAutoRows;
|
|
1951
|
+
}
|
|
1952
|
+
return '';
|
|
1953
|
+
}
|
|
1954
|
+
set gridAutoRows(value) {
|
|
1955
|
+
if (!this.nativeView) {
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
if (__ANDROID__) {
|
|
1959
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridAutoRows(this.nativeView, value);
|
|
1960
|
+
}
|
|
1961
|
+
if (__APPLE__) {
|
|
1962
|
+
this.nativeView.style.gridAutoRows = value;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
get gridAutoColumns() {
|
|
1966
|
+
if (!this.nativeView) {
|
|
1967
|
+
return '';
|
|
1968
|
+
}
|
|
1969
|
+
if (__ANDROID__) {
|
|
1970
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridAutoColumns(this.nativeView);
|
|
1971
|
+
}
|
|
1972
|
+
if (__APPLE__) {
|
|
1973
|
+
return this.nativeView.style.gridAutoColumns;
|
|
1974
|
+
}
|
|
1975
|
+
return '';
|
|
1976
|
+
}
|
|
1977
|
+
set gridAutoColumns(value) {
|
|
1978
|
+
if (!this.nativeView) {
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
if (__ANDROID__) {
|
|
1982
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridAutoColumns(this.nativeView, value);
|
|
1983
|
+
}
|
|
1984
|
+
if (__APPLE__) {
|
|
1985
|
+
this.nativeView.style.gridAutoColumns = value;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
get gridAutoFlow() {
|
|
1989
|
+
switch (getInt32(this.style_view, StyleKeys.GRID_AUTO_FLOW)) {
|
|
1990
|
+
case 0:
|
|
1991
|
+
return 'row';
|
|
1992
|
+
case 1:
|
|
1993
|
+
return 'column';
|
|
1994
|
+
case 2:
|
|
1995
|
+
return 'row dense';
|
|
1996
|
+
case 3:
|
|
1997
|
+
return 'column dense';
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
set gridAutoFlow(value) {
|
|
2001
|
+
switch (value) {
|
|
2002
|
+
case 'row':
|
|
2003
|
+
setInt32(this.style_view, StyleKeys.GRID_AUTO_FLOW, 0);
|
|
2004
|
+
break;
|
|
2005
|
+
case 'column':
|
|
2006
|
+
setInt32(this.style_view, StyleKeys.GRID_AUTO_FLOW, 1);
|
|
2007
|
+
break;
|
|
2008
|
+
case 'row dense':
|
|
2009
|
+
setInt32(this.style_view, StyleKeys.GRID_AUTO_FLOW, 2);
|
|
2010
|
+
break;
|
|
2011
|
+
case 'column dense':
|
|
2012
|
+
setInt32(this.style_view, StyleKeys.GRID_AUTO_FLOW, 3);
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
this.setOrAppendState(StateKeys.GRID_AUTO_FLOW);
|
|
2016
|
+
}
|
|
2017
|
+
get gridRowGap() {
|
|
2018
|
+
return this.rowGap;
|
|
2019
|
+
}
|
|
2020
|
+
set gridRowGap(value) {
|
|
2021
|
+
this.rowGap = value;
|
|
2022
|
+
}
|
|
2023
|
+
get gridColumnGap() {
|
|
2024
|
+
return this.columnGap;
|
|
2025
|
+
}
|
|
2026
|
+
set gridColumnGap(value) {
|
|
2027
|
+
this.columnGap = value;
|
|
2028
|
+
}
|
|
2029
|
+
set gridColumn(value) {
|
|
2030
|
+
if (!this.nativeView) {
|
|
2031
|
+
return;
|
|
2032
|
+
}
|
|
2033
|
+
if (__ANDROID__) {
|
|
2034
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumn(this.nativeView, value);
|
|
2035
|
+
}
|
|
2036
|
+
if (__APPLE__) {
|
|
2037
|
+
this.nativeView.style.gridColumn = value;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
get gridColumn() {
|
|
2041
|
+
if (!this.nativeView) {
|
|
2042
|
+
return '';
|
|
2043
|
+
}
|
|
2044
|
+
if (__ANDROID__) {
|
|
2045
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridColumn(this.nativeView);
|
|
2046
|
+
}
|
|
2047
|
+
if (__APPLE__) {
|
|
2048
|
+
return this.nativeView.style.gridColumn;
|
|
2049
|
+
}
|
|
2050
|
+
return '';
|
|
2051
|
+
}
|
|
2052
|
+
get gridColumnStart() {
|
|
2053
|
+
if (!this.nativeView) {
|
|
2054
|
+
return '';
|
|
2055
|
+
}
|
|
2056
|
+
if (__ANDROID__) {
|
|
2057
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridColumnStart(this.nativeView);
|
|
2058
|
+
}
|
|
2059
|
+
if (__APPLE__) {
|
|
2060
|
+
return this.nativeView.style.gridColumnStart;
|
|
2061
|
+
}
|
|
2062
|
+
return '';
|
|
2063
|
+
}
|
|
2064
|
+
set gridColumnStart(value) {
|
|
2065
|
+
if (!this.nativeView) {
|
|
2066
|
+
return;
|
|
2067
|
+
}
|
|
2068
|
+
if (__ANDROID__) {
|
|
2069
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumnStart(this.nativeView, value);
|
|
2070
|
+
}
|
|
2071
|
+
if (__APPLE__) {
|
|
2072
|
+
this.nativeView.style.gridColumnStart = value;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
get gridColumnEnd() {
|
|
2076
|
+
if (!this.nativeView) {
|
|
2077
|
+
return '';
|
|
2078
|
+
}
|
|
2079
|
+
if (__ANDROID__) {
|
|
2080
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridColumnEnd(this.nativeView);
|
|
2081
|
+
}
|
|
2082
|
+
if (__APPLE__) {
|
|
2083
|
+
return this.nativeView.style.gridColumnEnd;
|
|
2084
|
+
}
|
|
2085
|
+
return '';
|
|
2086
|
+
}
|
|
2087
|
+
set gridColumnEnd(value) {
|
|
2088
|
+
if (!this.nativeView) {
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
if (__ANDROID__) {
|
|
2092
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumnEnd(this.nativeView, value);
|
|
2093
|
+
}
|
|
2094
|
+
if (__APPLE__) {
|
|
2095
|
+
this.nativeView.style.gridColumnEnd = value;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
set gridRow(value) {
|
|
2099
|
+
if (!this.nativeView) {
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
if (__ANDROID__) {
|
|
2103
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRow(this.nativeView, value);
|
|
2104
|
+
}
|
|
2105
|
+
if (__APPLE__) {
|
|
2106
|
+
this.nativeView.style.gridRow = value;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
get gridRow() {
|
|
2110
|
+
if (!this.nativeView) {
|
|
2111
|
+
return '';
|
|
2112
|
+
}
|
|
2113
|
+
if (__ANDROID__) {
|
|
2114
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridRow(this.nativeView);
|
|
2115
|
+
}
|
|
2116
|
+
if (__APPLE__) {
|
|
2117
|
+
return this.nativeView.style.gridRow;
|
|
2118
|
+
}
|
|
2119
|
+
return '';
|
|
2120
|
+
}
|
|
2121
|
+
get gridRowStart() {
|
|
2122
|
+
if (!this.nativeView) {
|
|
2123
|
+
return '';
|
|
2124
|
+
}
|
|
2125
|
+
if (__ANDROID__) {
|
|
2126
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridRowStart(this.nativeView);
|
|
2127
|
+
}
|
|
2128
|
+
if (__APPLE__) {
|
|
2129
|
+
return this.nativeView.style.gridRowStart;
|
|
2130
|
+
}
|
|
2131
|
+
return '';
|
|
2132
|
+
}
|
|
2133
|
+
set gridRowStart(value) {
|
|
2134
|
+
if (!this.nativeView) {
|
|
2135
|
+
return;
|
|
2136
|
+
}
|
|
2137
|
+
if (__ANDROID__) {
|
|
2138
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRowStart(this.nativeView, value);
|
|
2139
|
+
}
|
|
2140
|
+
if (__APPLE__) {
|
|
2141
|
+
this.nativeView.style.gridRowStart = value;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
get gridRowEnd() {
|
|
2145
|
+
if (!this.nativeView) {
|
|
2146
|
+
return '';
|
|
2147
|
+
}
|
|
2148
|
+
if (__ANDROID__) {
|
|
2149
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridRowEnd(this.nativeView);
|
|
2150
|
+
}
|
|
2151
|
+
if (__APPLE__) {
|
|
2152
|
+
return this.nativeView.style.gridRowEnd;
|
|
2153
|
+
}
|
|
2154
|
+
return '';
|
|
2155
|
+
}
|
|
2156
|
+
set gridRowEnd(value) {
|
|
2157
|
+
if (!this.nativeView) {
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
if (__ANDROID__) {
|
|
2161
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRowEnd(this.nativeView, value);
|
|
2162
|
+
}
|
|
2163
|
+
if (__APPLE__) {
|
|
2164
|
+
this.nativeView.style.gridRowEnd = value;
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
set gridArea(value) {
|
|
2168
|
+
if (!this.nativeView) {
|
|
2169
|
+
return;
|
|
2170
|
+
}
|
|
2171
|
+
if (__ANDROID__) {
|
|
2172
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridArea(this.nativeView, value);
|
|
2173
|
+
}
|
|
2174
|
+
if (__APPLE__) {
|
|
2175
|
+
this.nativeView.style.gridArea = value;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
get gridArea() {
|
|
2179
|
+
if (!this.nativeView) {
|
|
2180
|
+
return '';
|
|
2181
|
+
}
|
|
2182
|
+
if (__ANDROID__) {
|
|
2183
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridArea(this.nativeView);
|
|
2184
|
+
}
|
|
2185
|
+
if (__APPLE__) {
|
|
2186
|
+
return this.nativeView.style.gridArea;
|
|
2187
|
+
}
|
|
2188
|
+
return '';
|
|
2189
|
+
}
|
|
2190
|
+
set gridTemplateRows(value) {
|
|
2191
|
+
if (!this.nativeView) {
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
if (__ANDROID__) {
|
|
2195
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateRows(this.nativeView, value);
|
|
2196
|
+
}
|
|
2197
|
+
if (__APPLE__) {
|
|
2198
|
+
this.nativeView.style.gridTemplateRows = value;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
get gridTemplateRows() {
|
|
2202
|
+
if (!this.nativeView) {
|
|
2203
|
+
return '';
|
|
2204
|
+
}
|
|
2205
|
+
if (__ANDROID__) {
|
|
2206
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridTemplateRows(this.nativeView);
|
|
2207
|
+
}
|
|
2208
|
+
if (__APPLE__) {
|
|
2209
|
+
return this.nativeView.style.gridTemplateRows;
|
|
2210
|
+
}
|
|
2211
|
+
return '';
|
|
2212
|
+
}
|
|
2213
|
+
get gridTemplateColumns() {
|
|
2214
|
+
if (!this.nativeView) {
|
|
2215
|
+
return '';
|
|
2216
|
+
}
|
|
2217
|
+
if (__ANDROID__) {
|
|
2218
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridTemplateColumns(this.nativeView);
|
|
2219
|
+
}
|
|
2220
|
+
if (__APPLE__) {
|
|
2221
|
+
return this.nativeView.style.gridTemplateColumns;
|
|
2222
|
+
}
|
|
2223
|
+
return '';
|
|
2224
|
+
}
|
|
2225
|
+
set gridTemplateColumns(value) {
|
|
2226
|
+
if (!this.nativeView) {
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
if (__ANDROID__) {
|
|
2230
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateColumns(this.nativeView, value);
|
|
2231
|
+
}
|
|
2232
|
+
if (__APPLE__) {
|
|
2233
|
+
this.nativeView.style.gridTemplateColumns = value;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
get gridTemplateAreas() {
|
|
2237
|
+
if (!this.nativeView) {
|
|
2238
|
+
return '';
|
|
2239
|
+
}
|
|
2240
|
+
if (__ANDROID__) {
|
|
2241
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getGridTemplateAreas(this.nativeView);
|
|
2242
|
+
}
|
|
2243
|
+
if (__APPLE__) {
|
|
2244
|
+
return this.nativeView.style.gridTemplateAreas;
|
|
2245
|
+
}
|
|
2246
|
+
return '';
|
|
2247
|
+
}
|
|
2248
|
+
set gridTemplateAreas(value) {
|
|
2249
|
+
if (!this.nativeView) {
|
|
2250
|
+
return;
|
|
2251
|
+
}
|
|
2252
|
+
if (__ANDROID__) {
|
|
2253
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateAreas(this.nativeView, value);
|
|
2254
|
+
}
|
|
2255
|
+
if (__APPLE__) {
|
|
2256
|
+
this.nativeView.style.gridTemplateAreas = value;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
get overflow() {
|
|
2260
|
+
const x = this.overflowX;
|
|
2261
|
+
const y = this.overflowY;
|
|
2262
|
+
if (x === y) {
|
|
2263
|
+
return x;
|
|
2264
|
+
}
|
|
2265
|
+
return `${x} ${y}`;
|
|
2266
|
+
}
|
|
2267
|
+
set overflow(value) {
|
|
2268
|
+
switch (value) {
|
|
2269
|
+
case 'visible':
|
|
2270
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 0);
|
|
2271
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 0);
|
|
2272
|
+
break;
|
|
2273
|
+
case 'hidden':
|
|
2274
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 1);
|
|
2275
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 1);
|
|
2276
|
+
break;
|
|
2277
|
+
case 'scroll':
|
|
2278
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 2);
|
|
2279
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 2);
|
|
2280
|
+
break;
|
|
2281
|
+
default:
|
|
2282
|
+
{
|
|
2283
|
+
const values = value.split(' ');
|
|
2284
|
+
switch (values[0]) {
|
|
2285
|
+
case 'visible':
|
|
2286
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 0);
|
|
2287
|
+
break;
|
|
2288
|
+
case 'hidden':
|
|
2289
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 1);
|
|
2290
|
+
break;
|
|
2291
|
+
case 'scroll':
|
|
2292
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 2);
|
|
2293
|
+
break;
|
|
2294
|
+
case 'clip':
|
|
2295
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 3);
|
|
2296
|
+
break;
|
|
2297
|
+
case 'auto':
|
|
2298
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 4);
|
|
2299
|
+
break;
|
|
2300
|
+
}
|
|
2301
|
+
switch (values[1]) {
|
|
2302
|
+
case 'visible':
|
|
2303
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 0);
|
|
2304
|
+
break;
|
|
2305
|
+
case 'hidden':
|
|
2306
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 1);
|
|
2307
|
+
break;
|
|
2308
|
+
case 'scroll':
|
|
2309
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 2);
|
|
2310
|
+
break;
|
|
2311
|
+
case 'clip':
|
|
2312
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 3);
|
|
2313
|
+
break;
|
|
2314
|
+
case 'auto':
|
|
2315
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 4);
|
|
2316
|
+
break;
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
break;
|
|
2320
|
+
}
|
|
2321
|
+
this.setOrAppendState(StateKeys.OVERFLOW);
|
|
2322
|
+
}
|
|
2323
|
+
get overflowX() {
|
|
2324
|
+
switch (getInt32(this.style_view, StyleKeys.OVERFLOW_X)) {
|
|
2325
|
+
case 0:
|
|
2326
|
+
return 'visible';
|
|
2327
|
+
case 1:
|
|
2328
|
+
return 'hidden';
|
|
2329
|
+
case 2:
|
|
2330
|
+
return 'scroll';
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
set overflowX(value) {
|
|
2334
|
+
let dirty = false;
|
|
2335
|
+
switch (value) {
|
|
2336
|
+
case 'visible':
|
|
2337
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 0);
|
|
2338
|
+
dirty = true;
|
|
2339
|
+
break;
|
|
2340
|
+
case 'hidden':
|
|
2341
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 1);
|
|
2342
|
+
dirty = true;
|
|
2343
|
+
break;
|
|
2344
|
+
case 'scroll':
|
|
2345
|
+
dirty = true;
|
|
2346
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 2);
|
|
2347
|
+
break;
|
|
2348
|
+
case 'clip':
|
|
2349
|
+
dirty = true;
|
|
2350
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 3);
|
|
2351
|
+
break;
|
|
2352
|
+
case 'auto':
|
|
2353
|
+
dirty = true;
|
|
2354
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_X, 4);
|
|
2355
|
+
break;
|
|
2356
|
+
}
|
|
2357
|
+
if (dirty) {
|
|
2358
|
+
this.setOrAppendState(StateKeys.OVERFLOW_X);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
get overflowY() {
|
|
2362
|
+
switch (getInt32(this.style_view, StyleKeys.OVERFLOW_Y)) {
|
|
2363
|
+
case 0:
|
|
2364
|
+
return 'visible';
|
|
2365
|
+
case 1:
|
|
2366
|
+
return 'hidden';
|
|
2367
|
+
case 2:
|
|
2368
|
+
return 'scroll';
|
|
2369
|
+
case 3:
|
|
2370
|
+
return 'clip';
|
|
2371
|
+
case 4:
|
|
2372
|
+
return 'auto';
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
set overflowY(value) {
|
|
2376
|
+
let dirty = false;
|
|
2377
|
+
switch (value) {
|
|
2378
|
+
case 'visible':
|
|
2379
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 0);
|
|
2380
|
+
dirty = true;
|
|
2381
|
+
break;
|
|
2382
|
+
case 'hidden':
|
|
2383
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 1);
|
|
2384
|
+
dirty = true;
|
|
2385
|
+
break;
|
|
2386
|
+
case 'scroll':
|
|
2387
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 2);
|
|
2388
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setOverflowX(this.nativeView, org.nativescript.mason.masonkit.enums.Overflow.Scroll);
|
|
2389
|
+
dirty = true;
|
|
2390
|
+
break;
|
|
2391
|
+
case 'clip':
|
|
2392
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 3);
|
|
2393
|
+
dirty = true;
|
|
2394
|
+
break;
|
|
2395
|
+
case 'auto':
|
|
2396
|
+
setInt32(this.style_view, StyleKeys.OVERFLOW_Y, 4);
|
|
2397
|
+
dirty = true;
|
|
2398
|
+
break;
|
|
2399
|
+
}
|
|
2400
|
+
if (dirty) {
|
|
2401
|
+
this.setOrAppendState(StateKeys.OVERFLOW_Y);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
get flexGrow() {
|
|
2405
|
+
return getFloat32(this.style_view, StyleKeys.FLEX_GROW);
|
|
2406
|
+
}
|
|
2407
|
+
set flexGrow(value) {
|
|
2408
|
+
setFloat32(this.style_view, StyleKeys.FLEX_GROW, value);
|
|
2409
|
+
this.setOrAppendState(StateKeys.FLEX_GROW);
|
|
2410
|
+
}
|
|
2411
|
+
get flexShrink() {
|
|
2412
|
+
return getFloat32(this.style_view, StyleKeys.FLEX_SHRINK);
|
|
2413
|
+
}
|
|
2414
|
+
set flexShrink(value) {
|
|
2415
|
+
setFloat32(this.style_view, StyleKeys.FLEX_SHRINK, value);
|
|
2416
|
+
this.setOrAppendState(StateKeys.FLEX_SHRINK);
|
|
2417
|
+
}
|
|
2418
|
+
get scrollBarWidth() {
|
|
2419
|
+
return getFloat32(this.style_view, StyleKeys.SCROLLBAR_WIDTH);
|
|
2420
|
+
}
|
|
2421
|
+
set scrollBarWidth(value) {
|
|
2422
|
+
if (typeof value === 'number') {
|
|
2423
|
+
setFloat32(this.style_view, StyleKeys.SCROLLBAR_WIDTH, value);
|
|
2424
|
+
this.setOrAppendState(StateKeys.SCROLLBAR_WIDTH);
|
|
2425
|
+
}
|
|
2426
|
+
else if (typeof value === 'object') {
|
|
2427
|
+
switch (value.unit) {
|
|
2428
|
+
case 'dip':
|
|
2429
|
+
setFloat32(this.style_view, StyleKeys.SCROLLBAR_WIDTH, layout.toDevicePixels(value.value));
|
|
2430
|
+
this.setOrAppendState(StateKeys.SCROLLBAR_WIDTH);
|
|
2431
|
+
break;
|
|
2432
|
+
case 'px':
|
|
2433
|
+
setFloat32(this.style_view, StyleKeys.SCROLLBAR_WIDTH, value.value);
|
|
2434
|
+
this.setOrAppendState(StateKeys.SCROLLBAR_WIDTH);
|
|
2435
|
+
break;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
get letterSpacing() {
|
|
2440
|
+
return getFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING);
|
|
2441
|
+
}
|
|
2442
|
+
set letterSpacing(value) {
|
|
2443
|
+
if (typeof value === 'number') {
|
|
2444
|
+
setFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING, value);
|
|
2445
|
+
setUint8(this.text_style_view, TextStyleKeys.LETTER_SPACING_STATE, 1);
|
|
2446
|
+
this.setOrAppendTextState(TextStateKeys.LETTER_SPACING);
|
|
2447
|
+
}
|
|
2448
|
+
else if (typeof value === 'object') {
|
|
2449
|
+
switch (value.unit) {
|
|
2450
|
+
case 'dip':
|
|
2451
|
+
setFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING, layout.toDevicePixels(value.value));
|
|
2452
|
+
setUint8(this.text_style_view, TextStyleKeys.LETTER_SPACING_STATE, 1);
|
|
2453
|
+
this.setOrAppendTextState(TextStateKeys.LETTER_SPACING);
|
|
2454
|
+
break;
|
|
2455
|
+
case 'px':
|
|
2456
|
+
setFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING, value.value);
|
|
2457
|
+
setUint8(this.text_style_view, TextStyleKeys.LETTER_SPACING_STATE, 1);
|
|
2458
|
+
this.setOrAppendTextState(TextStateKeys.LETTER_SPACING);
|
|
2459
|
+
break;
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
get lineHeight() {
|
|
2464
|
+
return getFloat32(this.text_style_view, TextStyleKeys.LINE_HEIGHT);
|
|
2465
|
+
}
|
|
2466
|
+
set lineHeight(value) {
|
|
2467
|
+
if (typeof value === 'number') {
|
|
2468
|
+
setFloat32(this.text_style_view, TextStyleKeys.LINE_HEIGHT, value);
|
|
2469
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2470
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_TYPE, 0);
|
|
2471
|
+
this.setOrAppendTextState(TextStateKeys.LINE_HEIGHT);
|
|
2472
|
+
}
|
|
2473
|
+
else if (typeof value === 'object') {
|
|
2474
|
+
switch (value.unit) {
|
|
2475
|
+
case 'dip':
|
|
2476
|
+
setFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING, layout.toDevicePixels(value.value));
|
|
2477
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2478
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_TYPE, 1);
|
|
2479
|
+
this.setOrAppendTextState(TextStateKeys.LETTER_SPACING);
|
|
2480
|
+
break;
|
|
2481
|
+
case 'px':
|
|
2482
|
+
setFloat32(this.text_style_view, TextStyleKeys.LETTER_SPACING, value.value);
|
|
2483
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2484
|
+
setUint8(this.text_style_view, TextStyleKeys.LINE_HEIGHT_TYPE, 1);
|
|
2485
|
+
this.setOrAppendTextState(TextStateKeys.LETTER_SPACING);
|
|
2486
|
+
break;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
get textOverflow() {
|
|
2491
|
+
if (!this.text_style_view) {
|
|
2492
|
+
// clip ?
|
|
2493
|
+
return 'clip';
|
|
2494
|
+
}
|
|
2495
|
+
const type = getInt32(this.text_style_view, TextStyleKeys.TEXT_OVERFLOW);
|
|
2496
|
+
switch (type) {
|
|
2497
|
+
case 0:
|
|
2498
|
+
return 'clip';
|
|
2499
|
+
case 1:
|
|
2500
|
+
return 'ellipsis';
|
|
2501
|
+
default:
|
|
2502
|
+
}
|
|
2503
|
+
if (__ANDROID__) {
|
|
2504
|
+
// @ts-ignore
|
|
2505
|
+
const overflow = this.view_._view.getTextOverflow();
|
|
2506
|
+
}
|
|
2507
|
+
if (__APPLE__) {
|
|
2508
|
+
// @ts-ignore
|
|
2509
|
+
const overflow = this.view_._view.textOverflow;
|
|
2510
|
+
}
|
|
2511
|
+
return 'clip';
|
|
2512
|
+
}
|
|
2513
|
+
set textOverflow(value) {
|
|
2514
|
+
if (!this.text_style_view) {
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
let flow = -1;
|
|
2518
|
+
switch (value) {
|
|
2519
|
+
case 'clip':
|
|
2520
|
+
flow = 0;
|
|
2521
|
+
break;
|
|
2522
|
+
case 'ellipsis':
|
|
2523
|
+
flow = 1;
|
|
2524
|
+
break;
|
|
2525
|
+
default:
|
|
2526
|
+
{
|
|
2527
|
+
if (__ANDROID__) {
|
|
2528
|
+
// @ts-ignore
|
|
2529
|
+
const overflow = this.view_._view.getTextOverflow();
|
|
2530
|
+
}
|
|
2531
|
+
if (__APPLE__) {
|
|
2532
|
+
// @ts-ignore
|
|
2533
|
+
const overflow = this.view_._view.textOverflow;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
break;
|
|
2537
|
+
}
|
|
2538
|
+
if (flow !== -1) {
|
|
2539
|
+
setInt32(this.text_style_view, TextStyleKeys.TEXT_OVERFLOW, flow);
|
|
2540
|
+
setInt8(this.text_style_view, TextStyleKeys.TEXT_OVERFLOW_STATE, 1);
|
|
2541
|
+
this.setOrAppendTextState(TextStateKeys.TEXT_OVERFLOW);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
get textAlignment() {
|
|
2545
|
+
if (!this.text_style_view) {
|
|
2546
|
+
// clip ?
|
|
2547
|
+
return 'start';
|
|
2548
|
+
}
|
|
2549
|
+
const type = getInt32(this.text_style_view, TextStyleKeys.TEXT_ALIGN);
|
|
2550
|
+
switch (type) {
|
|
2551
|
+
case 0:
|
|
2552
|
+
// auto
|
|
2553
|
+
return 'start';
|
|
2554
|
+
case 1:
|
|
2555
|
+
return 'left';
|
|
2556
|
+
case 2:
|
|
2557
|
+
return 'right';
|
|
2558
|
+
case 3:
|
|
2559
|
+
return 'center';
|
|
2560
|
+
case 4:
|
|
2561
|
+
return 'justify';
|
|
2562
|
+
case 5:
|
|
2563
|
+
return 'start';
|
|
2564
|
+
case 6:
|
|
2565
|
+
return 'end';
|
|
2566
|
+
default:
|
|
2567
|
+
return 'start';
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
set textAlignment(value) {
|
|
2571
|
+
if (!this.text_style_view) {
|
|
2572
|
+
return;
|
|
2573
|
+
}
|
|
2574
|
+
let align = -1;
|
|
2575
|
+
switch (value) {
|
|
2576
|
+
case 'left':
|
|
2577
|
+
align = 1;
|
|
2578
|
+
break;
|
|
2579
|
+
case 'right':
|
|
2580
|
+
align = 2;
|
|
2581
|
+
break;
|
|
2582
|
+
case 'center':
|
|
2583
|
+
align = 3;
|
|
2584
|
+
break;
|
|
2585
|
+
case 'justify':
|
|
2586
|
+
align = 4;
|
|
2587
|
+
break;
|
|
2588
|
+
case 'start':
|
|
2589
|
+
align = 5;
|
|
2590
|
+
break;
|
|
2591
|
+
case 'end':
|
|
2592
|
+
align = 6;
|
|
2593
|
+
break;
|
|
2594
|
+
default:
|
|
2595
|
+
break;
|
|
2596
|
+
}
|
|
2597
|
+
if (align !== -1) {
|
|
2598
|
+
setInt32(this.text_style_view, TextStyleKeys.TEXT_ALIGN, align);
|
|
2599
|
+
setInt8(this.text_style_view, TextStyleKeys.TEXT_ALIGN_STATE, 1);
|
|
2600
|
+
this.setOrAppendTextState(TextStateKeys.TEXT_ALIGN);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
get background() {
|
|
2604
|
+
if (!this.nativeView) {
|
|
2605
|
+
return '';
|
|
2606
|
+
}
|
|
2607
|
+
if (__ANDROID__) {
|
|
2608
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBackground(this.nativeView);
|
|
2609
|
+
}
|
|
2610
|
+
if (__APPLE__) {
|
|
2611
|
+
return this.nativeView.style.background;
|
|
2612
|
+
}
|
|
2613
|
+
return '';
|
|
2614
|
+
}
|
|
2615
|
+
set background(value) {
|
|
2616
|
+
if (!this.nativeView) {
|
|
2617
|
+
return;
|
|
2618
|
+
}
|
|
2619
|
+
if (__ANDROID__) {
|
|
2620
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBackground(this.nativeView, value);
|
|
2621
|
+
}
|
|
2622
|
+
if (__APPLE__) {
|
|
2623
|
+
this.nativeView.style.background = value;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
get border() {
|
|
2627
|
+
if (!this.nativeView) {
|
|
2628
|
+
return '';
|
|
2629
|
+
}
|
|
2630
|
+
if (__ANDROID__) {
|
|
2631
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBorder(this.nativeView);
|
|
2632
|
+
}
|
|
2633
|
+
if (__APPLE__) {
|
|
2634
|
+
return this.nativeView.style.border;
|
|
2635
|
+
}
|
|
2636
|
+
return '';
|
|
2637
|
+
}
|
|
2638
|
+
set border(value) {
|
|
2639
|
+
if (!this.nativeView) {
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
if (__ANDROID__) {
|
|
2643
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBorder(this.nativeView, value);
|
|
2644
|
+
}
|
|
2645
|
+
if (__APPLE__) {
|
|
2646
|
+
this.nativeView.style.border = value;
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
get filter() {
|
|
2650
|
+
if (!this.nativeView) {
|
|
2651
|
+
return '';
|
|
2652
|
+
}
|
|
2653
|
+
if (__ANDROID__) {
|
|
2654
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getFilter(this.nativeView);
|
|
2655
|
+
}
|
|
2656
|
+
if (__APPLE__) {
|
|
2657
|
+
return this.nativeView.style.filter;
|
|
2658
|
+
}
|
|
2659
|
+
return '';
|
|
2660
|
+
}
|
|
2661
|
+
set filter(value) {
|
|
2662
|
+
if (!this.nativeView) {
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
if (__ANDROID__) {
|
|
2666
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setFilter(this.nativeView, value);
|
|
2667
|
+
}
|
|
2668
|
+
if (__APPLE__) {
|
|
2669
|
+
this.nativeView.style.filter = value;
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
toJSON() {
|
|
2673
|
+
return {
|
|
2674
|
+
display: this.display,
|
|
2675
|
+
position: this.position,
|
|
2676
|
+
flexDirection: this.flexDirection,
|
|
2677
|
+
flexWrap: this.flexWrap,
|
|
2678
|
+
justifyContent: this.justifyContent,
|
|
2679
|
+
alignItems: this.alignItems,
|
|
2680
|
+
alignContent: this.alignContent,
|
|
2681
|
+
alignSelf: this.alignSelf,
|
|
2682
|
+
flexGrow: this.flexGrow,
|
|
2683
|
+
minWidth: this.minWidth,
|
|
2684
|
+
minHeight: this.minHeight,
|
|
2685
|
+
maxWidth: this.maxWidth,
|
|
2686
|
+
maxHeight: this.maxHeight,
|
|
2687
|
+
width: this.width,
|
|
2688
|
+
height: this.height,
|
|
2689
|
+
inset: {
|
|
2690
|
+
left: this.left,
|
|
2691
|
+
right: this.right,
|
|
2692
|
+
top: this.top,
|
|
2693
|
+
bottom: this.bottom,
|
|
2694
|
+
},
|
|
2695
|
+
margin: {
|
|
2696
|
+
left: this.marginLeft,
|
|
2697
|
+
right: this.marginRight,
|
|
2698
|
+
top: this.marginTop,
|
|
2699
|
+
bottom: this.marginBottom,
|
|
2700
|
+
},
|
|
2701
|
+
padding: {
|
|
2702
|
+
left: this.paddingLeft,
|
|
2703
|
+
right: this.paddingRight,
|
|
2704
|
+
top: this.paddingTop,
|
|
2705
|
+
bottom: this.paddingBottom,
|
|
2706
|
+
},
|
|
2707
|
+
aspectRatio: this.aspectRatio,
|
|
2708
|
+
flexBasis: this.flexBasis,
|
|
2709
|
+
overflow: this.overflow,
|
|
2710
|
+
flexShrink: this.flexShrink,
|
|
2711
|
+
scrollBarWidth: this.scrollBarWidth,
|
|
2712
|
+
gap: this.gap,
|
|
2713
|
+
gridArea: this.gridArea,
|
|
2714
|
+
gridAutoFlow: this.gridAutoFlow,
|
|
2715
|
+
gridAutoColumns: this.gridAutoColumns,
|
|
2716
|
+
gridAutoRows: this.gridAutoRows,
|
|
2717
|
+
gridColumn: this.gridColumn,
|
|
2718
|
+
gridRow: this.gridRow,
|
|
2719
|
+
gridTemplateRows: this.gridTemplateRows,
|
|
2720
|
+
gridTemplateColumns: this.gridTemplateColumns,
|
|
2721
|
+
filter: this.filter
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
//# sourceMappingURL=style.js.map
|