@triniwiz/nativescript-masonkit 1.0.0-alpha.2 → 1.0.0-alpha.22

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.
Files changed (58) hide show
  1. package/index.d.ts +167 -17
  2. package/package.json +4 -4
  3. package/platforms/android/include.gradle +22 -1
  4. package/platforms/android/masonkit-release.aar +0 -0
  5. package/platforms/ios/Mason.xcframework/Info.plist +9 -5
  6. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +495 -313
  7. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason.h +11 -0
  8. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +215 -818
  9. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  10. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  11. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  12. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +30167 -19469
  13. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +660 -310
  14. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  15. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +660 -310
  16. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/module.modulemap +1 -1
  17. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  18. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +2421 -0
  19. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +1053 -689
  20. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason.h +11 -0
  21. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +215 -818
  22. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  23. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  24. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +30167 -19469
  27. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +660 -310
  28. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +660 -310
  30. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +30167 -19469
  31. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +660 -310
  32. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +660 -310
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/module.modulemap +1 -1
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +33 -97
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +2421 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +2357 -0
  39. package/common.d.ts +0 -75
  40. package/common.js +0 -1556
  41. package/common.js.map +0 -1
  42. package/helpers.d.ts +0 -233
  43. package/helpers.js +0 -3382
  44. package/helpers.js.map +0 -1
  45. package/index.android.d.ts +0 -26
  46. package/index.android.js +0 -95
  47. package/index.android.js.map +0 -1
  48. package/index.ios.d.ts +0 -27
  49. package/index.ios.js +0 -136
  50. package/index.ios.js.map +0 -1
  51. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/PrivateHeaders/mason_native.h +0 -676
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/PrivateHeaders/mason_native.h +0 -676
  53. package/platforms/ios/Podfile +0 -1
  54. package/platforms/ios/build.xcconfig +0 -2
  55. package/platforms/ios/src/JSIModule.h +0 -217
  56. package/platforms/ios/src/JSIModule.mm +0 -2788
  57. package/platforms/ios/src/include/mason_native.h +0 -945
  58. package/platforms/ios/src/module.modulemap +0 -4
package/common.js DELETED
@@ -1,1556 +0,0 @@
1
- import { CssProperty, Style, Length as NSLength, ShorthandProperty, CSSType, borderBottomWidthProperty, borderLeftWidthProperty, borderRightWidthProperty, borderTopWidthProperty, marginBottomProperty, marginLeftProperty, marginRightProperty, marginTopProperty, paddingBottomProperty, paddingLeftProperty, paddingRightProperty, paddingTopProperty, CustomLayoutView, heightProperty, minHeightProperty, minWidthProperty, widthProperty, View, getViewById } from '@nativescript/core';
2
- import { _forceStyleUpdate, _getAlignContent, _getAlignItems, _getAlignSelf, _getAspectRatio, _getColumnGap, _getDisplay, _getFlexBasis, _getFlexDirection, _getFlexGrow, _getFlexShrink, _getFlexWrap, _getHeight, _getJustifyContent, _getJustifyItems, _getJustifySelf, _getPosition, _getRowGap, _getWidth, _parseGridTemplates, _setAlignContent, _setAlignItems, _setAlignSelf, _setAspectRatio, _setBorderBottom, _setBorderLeft, _setBorderRight, _setBorderTop, _setBottom, _setColumnGap, _setDisplay, _setFlexBasis, _setFlexDirection, _setFlexGrow, _setFlexShrink, _setFlexWrap, _setGridAutoColumns, _setGridAutoRows, _setGridColumnEnd, _setGridColumnStart, _setGridRowEnd, _setGridRowStart, _setGridTemplateColumns, _setGridTemplateRows, _setHeight, _setJustifyContent, _setJustifyItems, _setJustifySelf, _setLeft, _setMarginBottom, _setMarginLeft, _setMarginRight, _setMarginTop, _setMaxHeight, _setMaxWidth, _setMinHeight, _setMinWidth, _setPaddingBottom, _setPaddingLeft, _setPaddingRight, _setPaddingTop, _setPosition, _setRight, _setRowGap, _setTop, _setWidth, } from './helpers';
3
- // let widgetMasonView: typeof org.nativescript.mason.masonkit.View;
4
- // function ensureNativeTypes() {
5
- // if (!widgetMasonView) {
6
- // widgetMasonView = org.nativescript.mason.masonkit.View;
7
- // }
8
- // }
9
- // function makeNativeSetter<T>(setter: (lp: org.nativescript.widgets.FlexboxLayout.LayoutParams, value: T) => void) {
10
- // return function (this: View, value: T) {
11
- // ensureNativeTypes();
12
- // const nativeView: android.view.View = this.nativeViewProtected;
13
- // const lp = nativeView.getLayoutParams() || new widgetLayoutParams();
14
- // if (lp instanceof widgetLayoutParams) {
15
- // setter(lp, value);
16
- // nativeView.setLayoutParams(lp);
17
- // }
18
- // };
19
- // }
20
- export function applyMixins(derivedCtor, baseCtors, options) {
21
- const omits = options && options.omit ? options.omit : [];
22
- baseCtors.forEach((baseCtor) => {
23
- Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
24
- if (omits.indexOf(name) !== -1) {
25
- return;
26
- }
27
- const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
28
- if (name === 'constructor')
29
- return;
30
- if (descriptor && (descriptor.get || descriptor.set)) {
31
- Object.defineProperty(derivedCtor.prototype, name, descriptor);
32
- }
33
- else {
34
- const oldImpl = derivedCtor.prototype[name];
35
- if (!oldImpl) {
36
- derivedCtor.prototype[name] = baseCtor.prototype[name];
37
- }
38
- else {
39
- derivedCtor.prototype[name] = function (...args) {
40
- if (options) {
41
- if (options.override) {
42
- return baseCtor.prototype[name].apply(this, args);
43
- }
44
- else if (options.after) {
45
- return baseCtor.prototype[name].apply(this, args);
46
- }
47
- else if (options.overrideIfExists) {
48
- if (this[options.overrideIfExists]) {
49
- return baseCtor.prototype[name].apply(this, args);
50
- }
51
- return oldImpl.apply(this, args);
52
- }
53
- else {
54
- baseCtor.prototype[name].apply(this, args);
55
- return oldImpl.apply(this, args);
56
- }
57
- }
58
- else {
59
- baseCtor.prototype[name].apply(this, args);
60
- return oldImpl.apply(this, args);
61
- }
62
- };
63
- }
64
- }
65
- });
66
- Object.getOwnPropertySymbols(baseCtor.prototype).forEach((symbol) => {
67
- if (omits.indexOf(symbol) !== -1) {
68
- return;
69
- }
70
- const oldImpl = derivedCtor.prototype[symbol];
71
- if (!oldImpl) {
72
- derivedCtor.prototype[symbol] = baseCtor.prototype[symbol];
73
- }
74
- else {
75
- derivedCtor.prototype[symbol] = function (...args) {
76
- if (options) {
77
- if (options.override) {
78
- return baseCtor.prototype[symbol].apply(this, args);
79
- }
80
- if (options.overrideIfExists) {
81
- if (this[options.overrideIfExists]) {
82
- return baseCtor.prototype[symbol].apply(this, args);
83
- }
84
- return oldImpl.apply(this, args);
85
- }
86
- else if (options.after) {
87
- oldImpl.apply(this, args);
88
- return baseCtor.prototype[symbol].apply(this, args);
89
- }
90
- else {
91
- baseCtor.prototype[symbol].apply(this, args);
92
- return oldImpl.apply(this, args);
93
- }
94
- }
95
- else {
96
- baseCtor.prototype[symbol].apply(this, args);
97
- return oldImpl.apply(this, args);
98
- }
99
- };
100
- }
101
- });
102
- });
103
- }
104
- let mixinInstalled = false;
105
- export function overrideViewBase() {
106
- const NSView = require('@nativescript/core').View;
107
- class ViewOverride extends View {
108
- constructor() {
109
- super(...arguments);
110
- this._isMasonView = false;
111
- this._isMasonChild = false;
112
- }
113
- get _isMasonViewOrChild() {
114
- return this._isMasonView || this._isMasonChild;
115
- }
116
- /* Short Props */
117
- set gridRowGap(value) {
118
- this.style.gridRowGap = value;
119
- }
120
- get gridRowGap() {
121
- return this.style.gridRowGap;
122
- }
123
- set gridGap(value) {
124
- this.style.gridGap = value;
125
- }
126
- get gridGap() {
127
- return this.style.gridGap;
128
- }
129
- set gap(value) {
130
- this.style.gap = value;
131
- }
132
- get gap() {
133
- return this.style.gap;
134
- }
135
- set gridArea(value) {
136
- this.style.gridArea = value;
137
- }
138
- get gridArea() {
139
- return this.style.gridArea;
140
- }
141
- set gridColumn(value) {
142
- this.style.gridColumn = value;
143
- }
144
- get gridColumn() {
145
- return this.style.gridColumn;
146
- }
147
- set gridRow(value) {
148
- this.style.gridRow = value;
149
- }
150
- get gridRow() {
151
- return this.style.gridColumn;
152
- }
153
- /* Short Props */
154
- get display() {
155
- return _getDisplay(this);
156
- }
157
- set display(value) {
158
- this.style.display = value;
159
- }
160
- [displayProperty.setNative](value) {
161
- _setDisplay(value, this);
162
- }
163
- set position(value) {
164
- this.style.position = value;
165
- }
166
- get position() {
167
- return _getPosition(this);
168
- }
169
- [positionProperty.setNative](value) {
170
- _setPosition(value, this);
171
- }
172
- set flexDirection(value) {
173
- this.style.flexDirection = value;
174
- }
175
- get flexDirection() {
176
- return _getFlexDirection(this);
177
- }
178
- [flexDirectionProperty.setNative](value) {
179
- _setFlexDirection(value, this);
180
- }
181
- set flexWrap(value) {
182
- this.style.flexWrap = value;
183
- }
184
- [flexWrapProperty.setNative](value) {
185
- _setFlexWrap(value, this);
186
- }
187
- get flexWrap() {
188
- return _getFlexWrap(this);
189
- }
190
- set alignItems(value) {
191
- this.style.alignItems = value;
192
- }
193
- get alignItems() {
194
- return _getAlignItems(this);
195
- }
196
- [alignItemsProperty.setNative](value) {
197
- _setAlignItems(value, this);
198
- }
199
- //@ts-ignore
200
- set alignSelf(value) {
201
- this.style.alignSelf = value;
202
- }
203
- //@ts-ignore
204
- get alignSelf() {
205
- return _getAlignSelf(this);
206
- }
207
- [alignSelfProperty.setNative](value) {
208
- _setAlignSelf(value, this);
209
- }
210
- set alignContent(value) {
211
- this.style.alignContent = value;
212
- }
213
- [alignContentProperty.setNative](value) {
214
- _setAlignContent(value, this);
215
- }
216
- get alignContent() {
217
- return _getAlignContent(this);
218
- }
219
- set justifyItems(value) {
220
- this.style.justifyItems = value;
221
- }
222
- [justifyItemsProperty.setNative](value) {
223
- _setJustifyItems(value, this);
224
- }
225
- get justifyItems() {
226
- return _getJustifyItems(this);
227
- }
228
- set justifySelf(value) {
229
- this.style.justifySelf = value;
230
- }
231
- [justifySelfProperty.setNative](value) {
232
- _setJustifySelf(value, this);
233
- }
234
- get justifySelf() {
235
- return _getJustifySelf(this);
236
- }
237
- set justifyContent(value) {
238
- this.style.justifyContent = value;
239
- }
240
- [justifyContentProperty.setNative](value) {
241
- _setJustifyContent(value, this);
242
- }
243
- get justifyContent() {
244
- return _getJustifyContent(this);
245
- }
246
- //@ts-ignore
247
- set left(value) {
248
- this.style.left = value;
249
- }
250
- get left() {
251
- return this.style.left;
252
- }
253
- [leftProperty.setNative](value) {
254
- _setLeft(value, this);
255
- }
256
- //@ts-ignore
257
- set right(value) {
258
- this.style.right = value;
259
- }
260
- get right() {
261
- return this.style.right;
262
- }
263
- [rightProperty.setNative](value) {
264
- _setRight(value, this);
265
- }
266
- //@ts-ignore
267
- set top(value) {
268
- this.style.top = value;
269
- }
270
- get top() {
271
- return this.style.top;
272
- }
273
- [topProperty.setNative](value) {
274
- _setTop(value, this);
275
- }
276
- //@ts-ignore
277
- set bottom(value) {
278
- this.style.bottom = value;
279
- }
280
- get bottom() {
281
- return this.style.bottom;
282
- }
283
- [bottomProperty.setNative](value) {
284
- _setBottom(value, this);
285
- }
286
- [marginLeftProperty.setNative](value) {
287
- _setMarginLeft(value, this);
288
- }
289
- [marginRightProperty.setNative](value) {
290
- _setMarginRight(value, this);
291
- }
292
- [marginTopProperty.setNative](value) {
293
- _setMarginTop(value, this);
294
- }
295
- [marginBottomProperty.setNative](value) {
296
- _setMarginBottom(value, this);
297
- }
298
- [borderLeftWidthProperty.setNative](value) {
299
- _setBorderLeft(value, this);
300
- }
301
- [borderRightWidthProperty.setNative](value) {
302
- _setBorderRight(value, this);
303
- }
304
- [borderTopWidthProperty.setNative](value) {
305
- _setBorderTop(value, this);
306
- }
307
- [borderBottomWidthProperty.setNative](value) {
308
- _setBorderBottom(value, this);
309
- }
310
- //@ts-ignore
311
- get flexGrow() {
312
- return _getFlexGrow(this);
313
- }
314
- set flexGrow(value) {
315
- this.style.flexGrow = value;
316
- }
317
- [flexGrowProperty.setNative](value) {
318
- _setFlexGrow(value, this);
319
- }
320
- //@ts-ignore
321
- get flexShrink() {
322
- return _getFlexShrink(this);
323
- }
324
- set flexShrink(value) {
325
- this.style.flexShrink = value;
326
- }
327
- [flexShrinkProperty.setNative](value) {
328
- _setFlexShrink(value, this);
329
- }
330
- //@ts-ignore
331
- get flexBasis() {
332
- return _getFlexBasis(this);
333
- }
334
- [flexBasisProperty.setNative](value) {
335
- _setFlexBasis(value, this);
336
- }
337
- /* faster setter/getter
338
- //@ts-ignore
339
- get gap() {
340
- return _getGap(this as any);
341
- }
342
-
343
- set gap(value) {
344
- this.style.gap = value;
345
- _setGap(value, this as any);
346
- }
347
-
348
- */
349
- set rowGap(value) {
350
- this.style.rowGap = value;
351
- }
352
- get rowGap() {
353
- return _getRowGap(this);
354
- }
355
- [rowGapProperty.setNative](value) {
356
- _setRowGap(value, this);
357
- }
358
- set columnGap(value) {
359
- this.style.columnGap = value;
360
- }
361
- get columnGap() {
362
- return _getColumnGap(this);
363
- }
364
- [columnGapProperty.setNative](value) {
365
- _setColumnGap(value, this);
366
- }
367
- get aspectRatio() {
368
- return _getAspectRatio(this);
369
- }
370
- [aspectRatioProperty.setNative](value) {
371
- _setAspectRatio(value, this);
372
- }
373
- [paddingLeftProperty.setNative](value) {
374
- _setPaddingLeft(value, this);
375
- }
376
- [paddingTopProperty.setNative](value) {
377
- _setPaddingTop(value, this);
378
- }
379
- [paddingRightProperty.setNative](value) {
380
- _setPaddingRight(value, this);
381
- }
382
- [paddingBottomProperty.setNative](value) {
383
- _setPaddingBottom(value, this);
384
- }
385
- //@ts-ignore
386
- set minWidth(value) {
387
- this.style.minWidth = value;
388
- }
389
- [minWidthProperty.setNative](value) {
390
- _setMinWidth(value, this);
391
- }
392
- //@ts-ignore
393
- set minHeight(value) {
394
- this.style.minHeight = value;
395
- }
396
- [minHeightProperty.setNative](value) {
397
- _setMinHeight(value, this);
398
- }
399
- //@ts-ignore
400
- set width(value) {
401
- this.style.width = value;
402
- }
403
- [widthProperty.setNative](value) {
404
- _setWidth(value, this);
405
- }
406
- get width() {
407
- return _getWidth(this);
408
- }
409
- //@ts-ignore
410
- set height(value) {
411
- this.style.height = value;
412
- }
413
- [heightProperty.setNative](value) {
414
- _setHeight(value, this);
415
- }
416
- //@ts-ignore
417
- get height() {
418
- return _getHeight(this);
419
- }
420
- set maxWidth(value) {
421
- this.style.maxWidth = value;
422
- }
423
- [maxWidthProperty.setNative](value) {
424
- _setMaxWidth(value, this);
425
- }
426
- //@ts-ignore
427
- set maxHeight(value) {
428
- this.style.maxHeight = value;
429
- }
430
- [maxHeightProperty.setNative](value) {
431
- _setMaxHeight(value, this);
432
- }
433
- //@ts-ignore
434
- set gridAutoRows(value) {
435
- this.style.gridAutoRows = value;
436
- }
437
- [gridAutoRowsProperty.setNative](value) {
438
- _setGridAutoRows(value, this);
439
- }
440
- //@ts-ignore
441
- get gridAutoRows() {
442
- return this.style.gridAutoRows;
443
- }
444
- //@ts-ignore
445
- set gridAutoColumns(value) {
446
- this.style.gridAutoColumns = value;
447
- }
448
- [gridAutoColumnsProperty.setNative](value) {
449
- _setGridAutoColumns(value, this);
450
- }
451
- get gridAutoColumns() {
452
- return this.style.gridAutoColumns;
453
- }
454
- set gridAutoFlow(value) {
455
- this.style.gridAutoFlow = value;
456
- }
457
- [gridAutoFlowProperty.setNative](value) { }
458
- get gridAutoFlow() {
459
- return this.style.gridAutoFlow;
460
- }
461
- set gridColumnStart(value) {
462
- this.style.gridColumnStart = value;
463
- }
464
- [gridColumnStartProperty.setNative](value) {
465
- _setGridColumnStart(value, this);
466
- }
467
- get gridColumnStart() {
468
- return this.style.gridColumnStart;
469
- }
470
- set gridColumnEnd(value) {
471
- this.style.gridColumnEnd = value;
472
- }
473
- [gridColumnEndProperty.setNative](value) {
474
- _setGridColumnEnd(value, this);
475
- }
476
- get gridColumnEnd() {
477
- return this.style.gridColumnEnd;
478
- }
479
- set gridRowStart(value) {
480
- this.style.gridRowStart = value;
481
- }
482
- [gridRowStartProperty.setNative](value) {
483
- _setGridRowStart(value, this);
484
- }
485
- get gridRowStart() {
486
- return this.style.gridRowStart;
487
- }
488
- set gridRowEnd(value) {
489
- this.style.gridRowEnd = value;
490
- }
491
- [gridRowEndProperty.setNative](value) {
492
- _setGridRowEnd(value, this);
493
- }
494
- get gridRowEnd() {
495
- return this.style.gridRowEnd;
496
- }
497
- set gridTemplateRows(value) {
498
- this.style.gridTemplateRows = value;
499
- }
500
- [gridTemplateRowsProperty.setNative](value) {
501
- const templates = _parseGridTemplates(value);
502
- if (templates) {
503
- _setGridTemplateRows(templates, this);
504
- }
505
- }
506
- set gridTemplateColumns(value) {
507
- this.style.gridTemplateColumns = value;
508
- }
509
- [gridTemplateColumnsProperty.setNative](value) {
510
- const templates = _parseGridTemplates(value);
511
- if (templates) {
512
- _setGridTemplateColumns(templates, this);
513
- }
514
- }
515
- }
516
- applyMixins(NSView, [ViewOverride], { overrideIfExists: '_isMasonViewOrChild' });
517
- }
518
- export function installMixins() {
519
- if (!mixinInstalled) {
520
- mixinInstalled = true;
521
- overrideViewBase();
522
- }
523
- }
524
- const emptyArray = new Array();
525
- export const flexGrowProperty = new CssProperty({
526
- name: 'flexGrow',
527
- cssName: 'flex-grow',
528
- defaultValue: 0,
529
- valueConverter: parseFloat,
530
- });
531
- export const flexShrinkProperty = new CssProperty({
532
- name: 'flexShrink',
533
- cssName: 'flex-shrink',
534
- defaultValue: 1,
535
- valueConverter: parseFloat,
536
- });
537
- export const displayProperty = new CssProperty({
538
- name: 'display',
539
- cssName: 'display',
540
- defaultValue: 'flex',
541
- valueConverter(value) {
542
- if (typeof value === 'number') {
543
- switch (value) {
544
- case 0:
545
- return 'none';
546
- case 1:
547
- return 'flex';
548
- case 2:
549
- return 'grid';
550
- }
551
- }
552
- switch (value) {
553
- case 'none':
554
- case 'flex':
555
- case 'grid':
556
- return value;
557
- default:
558
- // todo throw???
559
- return 'flex';
560
- }
561
- },
562
- });
563
- export const maxWidthProperty = new CssProperty({
564
- name: 'maxWidth',
565
- cssName: 'max-width',
566
- defaultValue: 'auto',
567
- equalityComparer: NSLength.equals,
568
- });
569
- export const maxHeightProperty = new CssProperty({
570
- name: 'maxHeight',
571
- cssName: 'max-height',
572
- defaultValue: 'auto',
573
- equalityComparer: NSLength.equals,
574
- });
575
- export const positionProperty = new CssProperty({
576
- name: 'position',
577
- cssName: 'position',
578
- defaultValue: 'relative',
579
- });
580
- export const flexDirectionProperty = new CssProperty({
581
- name: 'flexDirection',
582
- cssName: 'flex-direction',
583
- });
584
- export const flexWrapProperty = new CssProperty({
585
- name: 'flexWrap',
586
- cssName: 'flex-wrap',
587
- defaultValue: 'no-wrap',
588
- });
589
- export const leftProperty = new CssProperty({
590
- name: 'left',
591
- cssName: 'left',
592
- defaultValue: 'auto',
593
- equalityComparer: NSLength.equals,
594
- });
595
- export const rightProperty = new CssProperty({
596
- name: 'right',
597
- cssName: 'right',
598
- defaultValue: 'auto',
599
- equalityComparer: NSLength.equals,
600
- });
601
- export const topProperty = new CssProperty({
602
- name: 'top',
603
- cssName: 'top',
604
- defaultValue: 'auto',
605
- equalityComparer: NSLength.equals,
606
- });
607
- export const bottomProperty = new CssProperty({
608
- name: 'bottom',
609
- cssName: 'bottom',
610
- defaultValue: 'auto',
611
- equalityComparer: NSLength.equals,
612
- });
613
- export const flexBasisProperty = new CssProperty({
614
- name: 'flexBasis',
615
- cssName: 'flex-basis',
616
- defaultValue: 'auto',
617
- });
618
- export const gridRowGapProperty = new ShorthandProperty({
619
- name: 'gridRowGap',
620
- cssName: 'grid-row-gap',
621
- getter: function () {
622
- return this.rowGap;
623
- },
624
- converter(value) {
625
- return [[rowGapProperty, value]];
626
- },
627
- });
628
- export const gridColumnGapProperty = new ShorthandProperty({
629
- name: 'gridColumnGap',
630
- cssName: 'grid-column-gap',
631
- getter: function () {
632
- return this.columnGap;
633
- },
634
- converter(value) {
635
- return [[columnGapProperty, value]];
636
- },
637
- });
638
- export const rowGapProperty = new CssProperty({
639
- name: 'rowGap',
640
- cssName: 'row-gap',
641
- defaultValue: 0,
642
- });
643
- export const columnGapProperty = new CssProperty({
644
- name: 'columnGap',
645
- cssName: 'column-gap',
646
- defaultValue: 0,
647
- });
648
- export const gridGapProperty = new ShorthandProperty({
649
- name: 'gridGap',
650
- cssName: 'grid-gap',
651
- getter: function () {
652
- if (this.rowGap === this.columnGap) {
653
- return this.rowGap;
654
- }
655
- return `${this.rowGap} ${this.columnGap}`;
656
- },
657
- converter(value) {
658
- if (typeof value === 'string') {
659
- const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
660
- const length = values.length;
661
- if (length === 0) {
662
- return emptyArray;
663
- }
664
- if (length === 1) {
665
- const row = values[0];
666
- return [
667
- [rowGapProperty, row],
668
- [columnGapProperty, row],
669
- ];
670
- }
671
- if (length > 1) {
672
- const row = values[0];
673
- const column = values[1];
674
- return [
675
- [rowGapProperty, row],
676
- [columnGapProperty, column],
677
- ];
678
- }
679
- }
680
- return emptyArray;
681
- },
682
- });
683
- export const gapProperty = new ShorthandProperty({
684
- name: 'gap',
685
- cssName: 'gap',
686
- getter: function () {
687
- if (this.rowGap === this.columnGap) {
688
- return this.rowGap;
689
- }
690
- return `${this.rowGap} ${this.columnGap}`;
691
- },
692
- converter(value) {
693
- if (typeof value === 'string') {
694
- const values = value.split(/\s+/).filter((item) => item.trim().length !== 0);
695
- const length = values.length;
696
- if (length === 0) {
697
- return emptyArray;
698
- }
699
- if (length === 1) {
700
- const row = values[0];
701
- return [
702
- [rowGapProperty, row],
703
- [columnGapProperty, row],
704
- ];
705
- }
706
- if (length > 1) {
707
- const row = values[0];
708
- const column = values[1];
709
- return [
710
- [rowGapProperty, row],
711
- [columnGapProperty, column],
712
- ];
713
- }
714
- }
715
- return emptyArray;
716
- },
717
- });
718
- export const aspectRatioProperty = new CssProperty({
719
- name: 'aspectRatio',
720
- cssName: 'aspect-ratio',
721
- defaultValue: Number.NaN,
722
- });
723
- export const alignItemsProperty = new CssProperty({
724
- name: 'alignItems',
725
- cssName: 'align-items',
726
- defaultValue: 'normal',
727
- });
728
- export const alignSelfProperty = new CssProperty({
729
- name: 'alignSelf',
730
- cssName: 'align-self',
731
- defaultValue: 'normal',
732
- });
733
- export const alignContentProperty = new CssProperty({
734
- name: 'alignContent',
735
- cssName: 'align-content',
736
- defaultValue: 'normal',
737
- });
738
- export const justifyItemsProperty = new CssProperty({
739
- name: 'justifyItems',
740
- cssName: 'justify-items',
741
- defaultValue: 'normal',
742
- });
743
- export const justifySelfProperty = new CssProperty({
744
- name: 'justifySelf',
745
- cssName: 'justify-self',
746
- defaultValue: 'normal',
747
- });
748
- export const justifyContentProperty = new CssProperty({
749
- name: 'justifyContent',
750
- cssName: 'justify-content',
751
- defaultValue: 'normal',
752
- });
753
- export const gridAutoRowsProperty = new CssProperty({
754
- name: 'gridAutoRows',
755
- cssName: 'grid-auto-rows',
756
- defaultValue: '',
757
- });
758
- export const gridAutoColumnsProperty = new CssProperty({
759
- name: 'gridAutoColumns',
760
- cssName: 'grid-auto-columns',
761
- defaultValue: '',
762
- });
763
- export const gridAutoFlowProperty = new CssProperty({
764
- name: 'gridAutoFlow',
765
- cssName: 'grid-auto-flow',
766
- defaultValue: 'row',
767
- });
768
- function parseGridColumnOrRow(value) {
769
- if (value.trim() === 'auto') {
770
- return 'auto';
771
- }
772
- else {
773
- const split = value.split(/\s+/).filter((item) => item.trim().length !== 0);
774
- const length = split.length;
775
- if (length === 0) {
776
- return undefined;
777
- }
778
- const first = split[0];
779
- if (length === 1) {
780
- const parsedValue = Number(first);
781
- if (Number.isNaN(parsedValue)) {
782
- return undefined;
783
- }
784
- return first;
785
- }
786
- if (length === 2) {
787
- if (first === 'span') {
788
- const second = split[1];
789
- const parsedValue = Number(second);
790
- if (Number.isNaN(parsedValue)) {
791
- return undefined;
792
- }
793
- return `${first} ${second}`;
794
- }
795
- }
796
- //custom-ident unsupport atm
797
- return undefined;
798
- }
799
- }
800
- export const gridAreaProperty = new ShorthandProperty({
801
- name: 'gridArea',
802
- cssName: 'grid-area',
803
- getter: function () {
804
- return `${this.gridRowStart} / ${this.gridColumnStart} / ${this.gridRowEnd} / ${this.gridColumnEnd}`;
805
- },
806
- converter(value) {
807
- if (typeof value === 'string') {
808
- const values = value.split('/').filter((item) => item.trim().length !== 0);
809
- // grid-row-start / grid-column-start / grid-row-end / grid-column-end
810
- const length = values.length;
811
- if (length === 0) {
812
- return emptyArray;
813
- }
814
- if (length === 1) {
815
- const parsed = parseGridColumnOrRow(values[0]);
816
- return [
817
- [gridRowStartProperty, parsed],
818
- [gridRowEndProperty, parsed],
819
- [gridColumnStartProperty, parsed],
820
- [gridColumnEndProperty, parsed],
821
- ];
822
- }
823
- if (length === 2) {
824
- const row = parseGridColumnOrRow(values[0]);
825
- const column = parseGridColumnOrRow(values[1]);
826
- return [
827
- [gridRowStartProperty, row],
828
- [gridRowEndProperty, row],
829
- [gridColumnStartProperty, column],
830
- [gridColumnEndProperty, column],
831
- ];
832
- }
833
- if (length === 3) {
834
- const rowStart = parseGridColumnOrRow(values[0]);
835
- const rowEnd = parseGridColumnOrRow(values[2]);
836
- const columnStart = parseGridColumnOrRow(values[1]);
837
- return [
838
- [gridRowStartProperty, rowStart],
839
- [gridRowEndProperty, rowEnd],
840
- [gridColumnStartProperty, columnStart],
841
- [gridColumnEndProperty, columnStart],
842
- ];
843
- }
844
- if (length >= 4) {
845
- const rowStart = parseGridColumnOrRow(values[0]);
846
- const rowEnd = parseGridColumnOrRow(values[2]);
847
- const columnStart = parseGridColumnOrRow(values[1]);
848
- const columnEnd = parseGridColumnOrRow(values[3]);
849
- return [
850
- [gridRowStartProperty, rowStart],
851
- [gridRowEndProperty, rowEnd],
852
- [gridColumnStartProperty, columnStart],
853
- [gridColumnEndProperty, columnEnd],
854
- ];
855
- }
856
- }
857
- return emptyArray;
858
- },
859
- });
860
- export const gridColumnStartProperty = new CssProperty({
861
- name: 'gridColumnStart',
862
- cssName: 'grid-column-start',
863
- defaultValue: 'auto',
864
- });
865
- export const gridColumnEndProperty = new CssProperty({
866
- name: 'gridColumnEnd',
867
- cssName: 'grid-column-end',
868
- defaultValue: 'auto',
869
- });
870
- export const gridColumnProperty = new ShorthandProperty({
871
- name: 'gridColumn',
872
- cssName: 'grid-column',
873
- getter: function () {
874
- if (this.gridColumnStart === this.gridColumnEnd) {
875
- return this.gridColumnStart;
876
- }
877
- return `${this.gridColumnStart} / ${this.gridColumnStart}`;
878
- },
879
- converter(value) {
880
- if (typeof value === 'string') {
881
- const values = value.split('/').filter((item) => item.trim().length !== 0);
882
- const length = values.length;
883
- if (length === 0) {
884
- return emptyArray;
885
- }
886
- if (length === 1) {
887
- const parsed = parseGridColumnOrRow(values[0]);
888
- return [
889
- [gridColumnStartProperty, parsed],
890
- [gridColumnEndProperty, parsed],
891
- ];
892
- }
893
- if (length > 1) {
894
- const start = values[0];
895
- const end = values[1];
896
- const parsedStart = parseGridColumnOrRow(start);
897
- const parsedEnd = parseGridColumnOrRow(end);
898
- return [
899
- [gridColumnStartProperty, parsedStart],
900
- [gridColumnEndProperty, parsedEnd],
901
- ];
902
- }
903
- }
904
- return emptyArray;
905
- },
906
- });
907
- export const gridRowStartProperty = new CssProperty({
908
- name: 'gridRowStart',
909
- cssName: 'grid-row-start',
910
- defaultValue: 'auto',
911
- });
912
- export const gridRowEndProperty = new CssProperty({
913
- name: 'gridRowEnd',
914
- cssName: 'grid-row-end',
915
- defaultValue: 'auto',
916
- });
917
- export const gridRowProperty = new ShorthandProperty({
918
- name: 'gridRow',
919
- cssName: 'grid-row',
920
- getter: function () {
921
- if (this.gridRowStart === this.gridRowEnd) {
922
- return this.gridRowStart;
923
- }
924
- return `${this.gridRowStart} / ${this.gridRowStart}`;
925
- },
926
- converter(value) {
927
- if (typeof value === 'string') {
928
- const values = value.split('/').filter((item) => item.trim().length !== 0);
929
- const length = values.length;
930
- if (length === 0) {
931
- return emptyArray;
932
- }
933
- if (length === 1) {
934
- const parsed = parseGridColumnOrRow(values[0]);
935
- return [
936
- [gridRowStartProperty, parsed],
937
- [gridRowEndProperty, parsed],
938
- ];
939
- }
940
- if (length > 1) {
941
- const start = values[0];
942
- const end = values[1];
943
- const parsedStart = parseGridColumnOrRow(start);
944
- const parsedEnd = parseGridColumnOrRow(end);
945
- return [
946
- [gridRowStartProperty, parsedStart],
947
- [gridRowEndProperty, parsedEnd],
948
- ];
949
- }
950
- }
951
- return emptyArray;
952
- },
953
- });
954
- export const gridTemplateRowsProperty = new CssProperty({
955
- name: 'gridTemplateRows',
956
- cssName: 'grid-template-rows',
957
- defaultValue: '',
958
- });
959
- export const gridTemplateColumnsProperty = new CssProperty({
960
- name: 'gridTemplateColumns',
961
- cssName: 'grid-template-columns',
962
- defaultValue: '',
963
- });
964
- let TSCViewBase = class TSCViewBase extends CustomLayoutView {
965
- constructor() {
966
- super();
967
- this._children = [];
968
- this._isMasonView = false;
969
- this._isMasonChild = false;
970
- this._isMasonView = true;
971
- }
972
- forceStyleUpdate() {
973
- _forceStyleUpdate(this);
974
- }
975
- /*
976
- markDirty() {
977
- _markDirty(this as any);
978
- }
979
-
980
- isDirty() {
981
- return _isDirty(this as any);
982
- }
983
-
984
- get display(): Display {
985
- return _getDisplay(this as any);
986
- }
987
-
988
- set display(value) {
989
- this.style.display = value as any;
990
- }
991
-
992
- [displayProperty.setNative](value) {
993
- console.log('displayProperty', 'view');
994
- _setDisplay(value, this as any);
995
- }
996
-
997
- set position(value) {
998
- this.style.position = value;
999
- }
1000
-
1001
- get position(): Position {
1002
- return _getPosition(this as any);
1003
- }
1004
-
1005
- [positionProperty.setNative](value) {
1006
- _setPosition(value, this as any);
1007
- }
1008
-
1009
- set flexDirection(value) {
1010
- this.style.flexDirection = value;
1011
- }
1012
-
1013
- get flexDirection() {
1014
- return _getFlexDirection(this as any);
1015
- }
1016
-
1017
- [flexDirectionProperty.setNative](value) {
1018
- _setFlexDirection(value, this as any);
1019
- }
1020
-
1021
- set flexWrap(value) {
1022
- this.style.flexWrap = value as any;
1023
- }
1024
-
1025
- [flexWrapProperty.setNative](value) {
1026
- _setFlexWrap(value, this as any);
1027
- }
1028
-
1029
- get flexWrap() {
1030
- return _getFlexWrap(this as any);
1031
- }
1032
-
1033
- set alignItems(value) {
1034
- this.style.alignItems = value as any;
1035
- }
1036
-
1037
- get alignItems() {
1038
- return _getAlignItems(this as any);
1039
- }
1040
-
1041
- [alignItemsProperty.setNative](value) {
1042
- _setAlignItems(value, this as any);
1043
- }
1044
-
1045
- //@ts-ignore
1046
- set alignSelf(value: AlignSelf) {
1047
- this.style.alignSelf = value as any;
1048
- }
1049
-
1050
- //@ts-ignore
1051
- get alignSelf() {
1052
- return _getAlignSelf(this as any);
1053
- }
1054
-
1055
- [alignSelfProperty.setNative](value) {
1056
- _setAlignSelf(value, this as any);
1057
- }
1058
-
1059
- set alignContent(value) {
1060
- this.style.alignContent = value as any;
1061
- }
1062
-
1063
- [alignContentProperty.setNative](value) {
1064
- _setAlignContent(value, this as any);
1065
- }
1066
-
1067
- get alignContent() {
1068
- return _getAlignContent(this as any);
1069
- }
1070
-
1071
- set justifyItems(value) {
1072
- this.style.justifyItems = value as any;
1073
- }
1074
-
1075
- [justifyItemsProperty.setNative](value) {
1076
- _setJustifyItems(value, this as any);
1077
- }
1078
-
1079
- get justifyItems() {
1080
- return _getJustifyItems(this as any);
1081
- }
1082
-
1083
- set justifySelf(value) {
1084
- this.style.justifySelf = value as any;
1085
- }
1086
-
1087
- [justifySelfProperty.setNative](value) {
1088
- _setJustifySelf(value, this as any);
1089
- }
1090
-
1091
- get justifySelf() {
1092
- return _getJustifySelf(this as any);
1093
- }
1094
-
1095
- set justifyContent(value) {
1096
- this.style.justifyContent = value as any;
1097
- }
1098
-
1099
- [justifyContentProperty.setNative](value) {
1100
- _setJustifyContent(value, this as any);
1101
- }
1102
-
1103
- get justifyContent() {
1104
- return _getJustifyContent(this as any);
1105
- }
1106
-
1107
- //@ts-ignore
1108
- set left(value) {
1109
- this.style.left = value;
1110
- }
1111
-
1112
- get left() {
1113
- return this.style.left;
1114
- }
1115
-
1116
- [leftProperty.setNative](value) {
1117
- _setLeft(value, this as any);
1118
- }
1119
-
1120
- //@ts-ignore
1121
- set right(value) {
1122
- this.style.right = value;
1123
- }
1124
-
1125
- get right() {
1126
- return this.style.right;
1127
- }
1128
-
1129
- [rightProperty.setNative](value) {
1130
- _setRight(value, this as any);
1131
- }
1132
-
1133
- //@ts-ignore
1134
- set top(value) {
1135
- this.style.top = value;
1136
- }
1137
-
1138
- get top() {
1139
- return this.style.top;
1140
- }
1141
-
1142
- [topProperty.setNative](value) {
1143
- _setTop(value, this as any);
1144
- }
1145
-
1146
- //@ts-ignore
1147
- set bottom(value) {
1148
- this.style.bottom = value;
1149
- }
1150
-
1151
- get bottom() {
1152
- return this.style.bottom;
1153
- }
1154
-
1155
- [bottomProperty.setNative](value) {
1156
- _setBottom(value, this as any);
1157
- }
1158
-
1159
- [marginLeftProperty.setNative](value) {
1160
- _setMarginLeft(value, this as any);
1161
- }
1162
-
1163
- [marginRightProperty.setNative](value) {
1164
- _setMarginRight(value, this as any);
1165
- }
1166
-
1167
- [marginTopProperty.setNative](value) {
1168
- _setMarginTop(value, this as any);
1169
- }
1170
-
1171
- [marginBottomProperty.setNative](value) {
1172
- _setMarginBottom(value, this as any);
1173
- }
1174
-
1175
- [borderLeftWidthProperty.setNative](value) {
1176
- _setBorderLeft(value, this as any);
1177
- }
1178
-
1179
- [borderRightWidthProperty.setNative](value) {
1180
- _setBorderRight(value, this as any);
1181
- }
1182
-
1183
- [borderTopWidthProperty.setNative](value) {
1184
- _setBorderTop(value, this as any);
1185
- }
1186
-
1187
- [borderBottomWidthProperty.setNative](value) {
1188
- _setBorderBottom(value, this as any);
1189
- }
1190
-
1191
- //@ts-ignore
1192
- get flexGrow() {
1193
- return _getFlexGrow(this as any);
1194
- }
1195
-
1196
- set flexGrow(value) {
1197
- this.style.flexGrow = value;
1198
- }
1199
-
1200
- [flexGrowProperty.setNative](value) {
1201
- _setFlexGrow(value, this as any);
1202
- }
1203
-
1204
- //@ts-ignore
1205
- get flexShrink() {
1206
- return _getFlexShrink(this as any);
1207
- }
1208
-
1209
- set flexShrink(value) {
1210
- this.style.flexShrink = value;
1211
- }
1212
-
1213
- [flexShrinkProperty.setNative](value) {
1214
- _setFlexShrink(value, this as any);
1215
- }
1216
-
1217
- //@ts-ignore
1218
- get flexBasis() {
1219
- return _getFlexBasis(this as any);
1220
- }
1221
-
1222
- [flexBasisProperty.setNative](value) {
1223
- _setFlexBasis(value, this as any);
1224
- }
1225
-
1226
- // faster setter/getter
1227
- //@ts-ignore
1228
- get gap() {
1229
- return _getGap(this as any);
1230
- }
1231
-
1232
- set gap(value) {
1233
- this.style.gap = value;
1234
- _setGap(value, this as any);
1235
- }
1236
-
1237
-
1238
-
1239
- set rowGap(value) {
1240
- this.style.rowGap = value;
1241
- }
1242
-
1243
- [rowGapProperty.setNative](value) {
1244
- _setRowGap(value, this as any);
1245
- }
1246
-
1247
- set columnGap(value) {
1248
- this.style.columnGap = value;
1249
- }
1250
-
1251
- [columnGapProperty.setNative](value) {
1252
- _setColumnGap(value, this as any);
1253
- }
1254
-
1255
- get aspectRatio() {
1256
- return _getAspectRatio(this as any);
1257
- }
1258
-
1259
- [aspectRatioProperty.setNative](value) {
1260
- _setAspectRatio(value, this as any);
1261
- }
1262
-
1263
- [paddingLeftProperty.setNative](value) {
1264
- _setPaddingLeft(value, this as any);
1265
- }
1266
-
1267
- [paddingTopProperty.setNative](value) {
1268
- _setPaddingTop(value, this as any);
1269
- }
1270
-
1271
- [paddingRightProperty.setNative](value) {
1272
- _setPaddingRight(value, this as any);
1273
- }
1274
-
1275
- [paddingBottomProperty.setNative](value) {
1276
- _setPaddingBottom(value, this as any);
1277
- }
1278
-
1279
- //@ts-ignore
1280
- set minWidth(value) {
1281
- this.style.minWidth = value;
1282
- }
1283
-
1284
- [minWidthProperty.setNative](value) {
1285
- _setMinWidth(value, this as any);
1286
- }
1287
-
1288
- //@ts-ignore
1289
- set minHeight(value) {
1290
- this.style.minHeight = value;
1291
- }
1292
-
1293
- [minHeightProperty.setNative](value) {
1294
- _setMinHeight(value, this as any);
1295
- }
1296
-
1297
- //@ts-ignore
1298
- set width(value) {
1299
- this.style.width = value;
1300
- }
1301
-
1302
- [widthProperty.setNative](value) {
1303
- _setWidth(value, this as any);
1304
- }
1305
-
1306
- get width() {
1307
- return _getWidth(this as any);
1308
- }
1309
-
1310
- //@ts-ignore
1311
- set height(value) {
1312
- this.style.height = value;
1313
- }
1314
-
1315
- [heightProperty.setNative](value) {
1316
- _setHeight(value, this as any);
1317
- }
1318
-
1319
- //@ts-ignore
1320
- get height() {
1321
- return _getHeight(this as any);
1322
- }
1323
-
1324
- set maxWidth(value) {
1325
- this.style.maxWidth = value;
1326
- }
1327
-
1328
- [maxWidthProperty.setNative](value) {
1329
- _setMaxWidth(value, this as any);
1330
- }
1331
-
1332
- //@ts-ignore
1333
- set maxHeight(value) {
1334
- this.style.maxHeight = value;
1335
- }
1336
-
1337
- [maxHeightProperty.setNative](value) {
1338
- _setMaxHeight(value, this as any);
1339
- }
1340
-
1341
- //@ts-ignore
1342
- set gridAutoRows(value) {
1343
- this.style.gridAutoRows = value;
1344
- }
1345
-
1346
- [gridAutoRowsProperty.setNative](value) {
1347
- _setGridAutoRows(value, this as any);
1348
- }
1349
-
1350
- //@ts-ignore
1351
- get gridAutoRows() {
1352
- return this.style.gridAutoRows;
1353
- }
1354
-
1355
- //@ts-ignore
1356
- set gridAutoColumns(value) {
1357
- this.style.gridAutoColumns = value;
1358
- }
1359
-
1360
- [gridAutoColumnsProperty.setNative](value) {
1361
- _setGridAutoColumns(value, this as any);
1362
- }
1363
-
1364
- get gridAutoColumns() {
1365
- return this.style.gridAutoColumns;
1366
- }
1367
-
1368
- set gridAutoFlow(value) {
1369
- this.style.gridAutoFlow = value;
1370
- }
1371
-
1372
- [gridAutoFlowProperty.setNative](value) {}
1373
-
1374
- get gridAutoFlow() {
1375
- return this.style.gridAutoFlow;
1376
- }
1377
-
1378
- set gridColumnStart(value) {
1379
- this.style.gridColumnStart = value;
1380
- }
1381
-
1382
- [gridColumnStartProperty.setNative](value) {
1383
- _setGridColumnStart(value, this as any);
1384
- }
1385
-
1386
- get gridColumnStart() {
1387
- return this.style.gridColumnStart;
1388
- }
1389
-
1390
- set gridColumnEnd(value) {
1391
- this.style.gridColumnEnd = value;
1392
- }
1393
-
1394
- [gridColumnEndProperty.setNative](value) {
1395
- _setGridColumnEnd(value, this as any);
1396
- }
1397
-
1398
- get gridColumnEnd() {
1399
- return this.style.gridColumnEnd;
1400
- }
1401
-
1402
- set gridRowStart(value) {
1403
- this.style.gridRowStart = value;
1404
- }
1405
-
1406
- [gridRowStartProperty.setNative](value) {
1407
- _setGridRowStart(value, this as any);
1408
- }
1409
-
1410
- get gridRowStart() {
1411
- return this.style.gridRowStart;
1412
- }
1413
-
1414
- set gridRowEnd(value) {
1415
- this.style.gridRowEnd = value;
1416
- }
1417
-
1418
- [gridRowEndProperty.setNative](value) {
1419
- _setGridRowEnd(value, this as any);
1420
- }
1421
-
1422
- get gridRowEnd() {
1423
- return this.style.gridRowEnd;
1424
- }
1425
-
1426
- set gridTemplateRows(value) {
1427
- this.style.gridTemplateRows = value;
1428
- }
1429
-
1430
- [gridTemplateRowsProperty.setNative](value) {
1431
- const templates = _parseGridTemplates(value);
1432
- if (templates) {
1433
- _setGridTemplateRows(templates, this as any);
1434
- }
1435
- }
1436
-
1437
- set gridTemplateColumns(value) {
1438
- this.style.gridTemplateColumns = value;
1439
- }
1440
-
1441
- [gridTemplateColumnsProperty.setNative](value) {
1442
- const templates = _parseGridTemplates(value);
1443
- if (templates) {
1444
- _setGridTemplateColumns(templates, this as any);
1445
- }
1446
- }
1447
- */
1448
- eachLayoutChild(callback) {
1449
- let lastChild = null;
1450
- this.eachChildView((cv) => {
1451
- cv._eachLayoutView((lv) => {
1452
- if (lastChild && !lastChild.isCollapsed) {
1453
- callback(lastChild, false);
1454
- }
1455
- lastChild = lv;
1456
- });
1457
- return true;
1458
- });
1459
- if (lastChild && !lastChild.isCollapsed) {
1460
- callback(lastChild, true);
1461
- }
1462
- }
1463
- eachChild(callback) {
1464
- this._children.forEach((child) => {
1465
- callback(child);
1466
- });
1467
- }
1468
- eachChildView(callback) {
1469
- this._children.forEach((view, key) => {
1470
- callback(view);
1471
- });
1472
- }
1473
- _addChildFromBuilder(name, value) {
1474
- this._children.push(value);
1475
- value._isMasonChild = true;
1476
- this._addView(value);
1477
- }
1478
- getChildrenCount() {
1479
- return this._children.length;
1480
- }
1481
- get _childrenCount() {
1482
- return this._children.length;
1483
- }
1484
- getChildAt(index) {
1485
- return this._children[index];
1486
- }
1487
- getChildIndex(child) {
1488
- return this._children.indexOf(child);
1489
- }
1490
- getChildById(id) {
1491
- return getViewById(this, id);
1492
- }
1493
- addChild(child) {
1494
- this._children.push(child);
1495
- this._addView(child);
1496
- }
1497
- insertChild(child, atIndex) {
1498
- this._children.splice(atIndex, 0, child);
1499
- this._addView(child, atIndex);
1500
- }
1501
- removeChild(child) {
1502
- const index = this._children.indexOf(child);
1503
- this._children.splice(index, 1);
1504
- this._removeView(child);
1505
- }
1506
- removeChildren() {
1507
- while (this.getChildrenCount() !== 0) {
1508
- this.removeChild(this._children[this.getChildrenCount() - 1]);
1509
- }
1510
- }
1511
- };
1512
- TSCViewBase = __decorate([
1513
- CSSType('TSCView'),
1514
- __metadata("design:paramtypes", [])
1515
- ], TSCViewBase);
1516
- export { TSCViewBase };
1517
- displayProperty.register(Style);
1518
- maxWidthProperty.register(Style);
1519
- maxHeightProperty.register(Style);
1520
- positionProperty.register(Style);
1521
- flexDirectionProperty.register(Style);
1522
- flexWrapProperty.register(Style);
1523
- leftProperty.register(Style);
1524
- rightProperty.register(Style);
1525
- topProperty.register(Style);
1526
- bottomProperty.register(Style);
1527
- flexBasisProperty.register(Style);
1528
- flexGrowProperty.register(Style);
1529
- flexShrinkProperty.register(Style);
1530
- rowGapProperty.register(Style);
1531
- columnGapProperty.register(Style);
1532
- gridRowGapProperty.register(Style);
1533
- gridColumnGapProperty.register(Style);
1534
- gapProperty.register(Style);
1535
- gridGapProperty.register(Style);
1536
- aspectRatioProperty.register(Style);
1537
- alignItemsProperty.register(Style);
1538
- alignSelfProperty.register(Style);
1539
- alignContentProperty.register(Style);
1540
- justifyItemsProperty.register(Style);
1541
- justifySelfProperty.register(Style);
1542
- justifyContentProperty.register(Style);
1543
- gridAutoRowsProperty.register(Style);
1544
- gridAutoColumnsProperty.register(Style);
1545
- gridAutoFlowProperty.register(Style);
1546
- gridAreaProperty.register(Style);
1547
- gridColumnProperty.register(Style);
1548
- gridColumnStartProperty.register(Style);
1549
- gridColumnEndProperty.register(Style);
1550
- gridRowProperty.register(Style);
1551
- gridRowStartProperty.register(Style);
1552
- gridRowEndProperty.register(Style);
1553
- gridTemplateRowsProperty.register(Style);
1554
- gridTemplateColumnsProperty.register(Style);
1555
- installMixins();
1556
- //# sourceMappingURL=common.js.map