@triniwiz/nativescript-masonkit 1.0.0-beta.23 → 1.0.0-beta.25

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 (47) hide show
  1. package/index.android.d.ts +1 -0
  2. package/index.android.js +1 -0
  3. package/index.android.js.map +1 -1
  4. package/index.d.ts +4 -0
  5. package/index.ios.d.ts +1 -0
  6. package/index.ios.js +1 -0
  7. package/index.ios.js.map +1 -1
  8. package/input/common.d.ts +7 -0
  9. package/input/common.js +15 -0
  10. package/input/common.js.map +1 -0
  11. package/input/index.android.d.ts +13 -0
  12. package/input/index.android.js +75 -0
  13. package/input/index.android.js.map +1 -0
  14. package/input/index.ios.d.ts +16 -0
  15. package/input/index.ios.js +115 -0
  16. package/input/index.ios.js.map +1 -0
  17. package/package.json +1 -1
  18. package/platforms/android/masonkit-release.aar +0 -0
  19. package/platforms/ios/Mason.xcframework/Info.plist +5 -5
  20. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +28 -0
  21. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  22. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +26322 -19499
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +235 -188
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +235 -188
  26. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  27. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4393 -4326
  28. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +56 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  30. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +26322 -19499
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +235 -188
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +235 -188
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +26322 -19499
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +235 -188
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +235 -188
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +22 -22
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4388 -4321
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +4262 -4195
  42. package/tree/index.android.d.ts +3 -1
  43. package/tree/index.android.js +33 -0
  44. package/tree/index.android.js.map +1 -1
  45. package/tree/index.ios.d.ts +3 -1
  46. package/tree/index.ios.js +33 -0
  47. package/tree/index.ios.js.map +1 -1
@@ -3,4 +3,5 @@ export { Img } from './img';
3
3
  export { Text, Br } from './text';
4
4
  export { Scroll } from './scroll';
5
5
  export { Button } from './button';
6
+ export { Input } from './input';
6
7
  export * from './web';
package/index.android.js CHANGED
@@ -3,5 +3,6 @@ export { Img } from './img';
3
3
  export { Text, Br } from './text';
4
4
  export { Scroll } from './scroll';
5
5
  export { Button } from './button';
6
+ export { Input } from './input';
6
7
  export * from './web';
7
8
  //# sourceMappingURL=index.android.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../packages/nativescript-masonkit/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../packages/nativescript-masonkit/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,cAAc,OAAO,CAAC"}
package/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { CoreTypes } from '@nativescript/core';
3
3
  import { TextBase, ViewBase } from './common';
4
4
  import { LengthPercentage } from '@nativescript/core/css/parser';
5
5
 
6
+ export type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local' | 'month' | 'week' | 'color' | 'checkbox' | 'radio' | 'button' | 'submit' | 'reset' | 'file';
7
+
6
8
  export type Length = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit | `${number}px` | `${number}%` | `${number}dip`;
7
9
 
8
10
  export type LengthAuto = CoreTypes.dip | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit | 'auto' | `${number}px` | `${number}%` | `${number}dip`;
@@ -214,3 +216,5 @@ export class Scroll extends VBase {}
214
216
  export class Button extends TextBase {}
215
217
 
216
218
  export class Br extends TextBase {}
219
+
220
+ export class Input extends VBase {}
package/index.ios.d.ts CHANGED
@@ -3,4 +3,5 @@ export { Img } from './img';
3
3
  export { Text, Br } from './text';
4
4
  export { Scroll } from './scroll';
5
5
  export { Button } from './button';
6
+ export { Input } from './input';
6
7
  export * from './web';
package/index.ios.js CHANGED
@@ -3,5 +3,6 @@ export { Img } from './img';
3
3
  export { Text, Br } from './text';
4
4
  export { Scroll } from './scroll';
5
5
  export { Button } from './button';
6
+ export { Input } from './input';
6
7
  export * from './web';
7
8
  //# sourceMappingURL=index.ios.js.map
package/index.ios.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../packages/nativescript-masonkit/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../packages/nativescript-masonkit/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,cAAc,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Property } from '@nativescript/core';
2
+ import { ViewBase } from '../common';
3
+ import { InputType } from '..';
4
+ export declare class InputBase extends ViewBase {
5
+ }
6
+ export declare const typeProperty: Property<InputBase, InputType>;
7
+ export declare const placeholderProperty: Property<InputBase, string>;
@@ -0,0 +1,15 @@
1
+ import { Property } from '@nativescript/core';
2
+ import { ViewBase } from '../common';
3
+ export class InputBase extends ViewBase {
4
+ }
5
+ export const typeProperty = new Property({
6
+ name: 'type',
7
+ defaultValue: 'text',
8
+ });
9
+ typeProperty.register(InputBase);
10
+ export const placeholderProperty = new Property({
11
+ name: 'placeholder',
12
+ defaultValue: '',
13
+ });
14
+ placeholderProperty.register(InputBase);
15
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/input/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,OAAO,SAAU,SAAQ,QAAQ;CAAG;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAuB;IAC7D,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,MAAM;CACrB,CAAC,CAAC;AAEH,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,QAAQ,CAAoB;IACjE,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,EAAE;CACjB,CAAC,CAAC;AAEH,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { InputBase } from './common';
2
+ import { style_ } from '../symbols';
3
+ export declare class Input extends InputBase {
4
+ [style_]: any;
5
+ _inBatch: boolean;
6
+ constructor();
7
+ private _type;
8
+ private getType;
9
+ get _view(): org.nativescript.mason.masonkit.Input;
10
+ get _styleHelper(): any;
11
+ createNativeView(): org.nativescript.mason.masonkit.Input;
12
+ get android(): org.nativescript.mason.masonkit.Input;
13
+ }
@@ -0,0 +1,75 @@
1
+ import { CSSType, Utils } from '@nativescript/core';
2
+ import { InputBase } from './common';
3
+ import { Tree } from '../tree';
4
+ import { Style } from '../style';
5
+ import { style_, isMasonView_, native_ } from '../symbols';
6
+ import { placeholderProperty, typeProperty } from './common';
7
+ let Input = class Input extends InputBase {
8
+ constructor() {
9
+ super();
10
+ this._inBatch = false;
11
+ this._type = 'text';
12
+ this[isMasonView_] = true;
13
+ }
14
+ getType() {
15
+ switch (this._type) {
16
+ case 'text':
17
+ return org.nativescript.mason.masonkit.Input.Type.Text;
18
+ case 'button':
19
+ return org.nativescript.mason.masonkit.Input.Type.Button;
20
+ case 'checkbox':
21
+ return org.nativescript.mason.masonkit.Input.Type.Checkbox;
22
+ case 'email':
23
+ return org.nativescript.mason.masonkit.Input.Type.Email;
24
+ case 'password':
25
+ return org.nativescript.mason.masonkit.Input.Type.Password;
26
+ case 'date':
27
+ return org.nativescript.mason.masonkit.Input.Type.Date;
28
+ case 'radio':
29
+ return org.nativescript.mason.masonkit.Input.Type.Radio;
30
+ case 'number':
31
+ return org.nativescript.mason.masonkit.Input.Type.Number;
32
+ }
33
+ return org.nativescript.mason.masonkit.Input.Type.Text;
34
+ }
35
+ [typeProperty.setNative](value) {
36
+ this._type = value;
37
+ if (this._view) {
38
+ this._view.setType(this.getType());
39
+ }
40
+ }
41
+ [placeholderProperty.setNative](value) {
42
+ if (this._view) {
43
+ this._view.setPlaceholder(value);
44
+ }
45
+ }
46
+ get _view() {
47
+ if (!this[native_]) {
48
+ const context = Utils.android.getCurrentActivity() || Utils.android.getApplicationContext();
49
+ const view = Tree.instance.createInputView(context, this._type);
50
+ this[native_] = view;
51
+ return view;
52
+ }
53
+ return this[native_];
54
+ }
55
+ get _styleHelper() {
56
+ if (this[style_] === undefined) {
57
+ this[style_] = Style.fromView(this, this._view);
58
+ }
59
+ return this[style_];
60
+ }
61
+ createNativeView() {
62
+ return this._view;
63
+ }
64
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
65
+ // @ts-ignore
66
+ get android() {
67
+ return this._view;
68
+ }
69
+ };
70
+ Input = __decorate([
71
+ CSSType('input'),
72
+ __metadata("design:paramtypes", [])
73
+ ], Input);
74
+ export { Input };
75
+ //# sourceMappingURL=index.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/input/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,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AE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,6DAA6D;IAC7D,aAAa;IACb,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAA8C,CAAC;IAC7D,CAAC;CACF,CAAA;AAvEY,KAAK;IADjB,OAAO,CAAC,OAAO,CAAC;;GACJ,KAAK,CAuEjB"}
@@ -0,0 +1,16 @@
1
+ import { InputBase } from './common';
2
+ import { style_ } from '../symbols';
3
+ import { Style } from '../style';
4
+ export declare class Input extends InputBase {
5
+ [style_]: any;
6
+ private _type;
7
+ private getType;
8
+ constructor();
9
+ get _view(): MasonInput;
10
+ get _styleHelper(): Style;
11
+ _inBatch: boolean;
12
+ createNativeView(): MasonInput;
13
+ get ios(): MasonInput;
14
+ onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
15
+ _setNativeViewFrame(nativeView: any, frame: CGRect): void;
16
+ }
@@ -0,0 +1,115 @@
1
+ import { CSSType, Utils } from '@nativescript/core';
2
+ import { InputBase } from './common';
3
+ import { style_, isMasonView_, native_ } from '../symbols';
4
+ import { Tree } from '../tree';
5
+ import { placeholderProperty, typeProperty } from './common';
6
+ import { Style } from '../style';
7
+ let Input = class Input extends InputBase {
8
+ getType() {
9
+ switch (this._type) {
10
+ case 'text':
11
+ return 0 /* MasonInputType.Text */;
12
+ case 'button':
13
+ return 1 /* MasonInputType.Button */;
14
+ case 'checkbox':
15
+ return 2 /* MasonInputType.Checkbox */;
16
+ case 'email':
17
+ return 3 /* MasonInputType.Email */;
18
+ case 'password':
19
+ return 4 /* MasonInputType.Password */;
20
+ case 'date':
21
+ return 5 /* MasonInputType.Date */;
22
+ case 'radio':
23
+ return 6 /* MasonInputType.Radio */;
24
+ case 'number':
25
+ return 7 /* MasonInputType.Number */;
26
+ }
27
+ return 0 /* MasonInputType.Text */;
28
+ }
29
+ constructor() {
30
+ super();
31
+ this._type = 'text';
32
+ this._inBatch = false;
33
+ this[isMasonView_] = true;
34
+ }
35
+ [typeProperty.setNative](value) {
36
+ this._type = value;
37
+ if (this._view) {
38
+ this._view.type = this.getType();
39
+ }
40
+ }
41
+ [placeholderProperty.setNative](value) {
42
+ if (this._view) {
43
+ this._view.placeholder = value;
44
+ }
45
+ }
46
+ get _view() {
47
+ if (!this[native_]) {
48
+ const view = Tree.instance.createInputView(null, this._type);
49
+ this[native_] = view;
50
+ return view;
51
+ }
52
+ return this[native_];
53
+ }
54
+ get _styleHelper() {
55
+ if (this[style_] === undefined) {
56
+ this[style_] = Style.fromView(this, this._view);
57
+ }
58
+ return this[style_];
59
+ }
60
+ createNativeView() {
61
+ return this._view;
62
+ }
63
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
64
+ // @ts-ignore
65
+ get ios() {
66
+ return this._view;
67
+ }
68
+ onMeasure(widthMeasureSpec, heightMeasureSpec) {
69
+ const nativeView = this._view;
70
+ if (nativeView) {
71
+ const specWidth = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
72
+ const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
73
+ const specHeight = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
74
+ const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
75
+ if (!this[isMasonView_]) {
76
+ // only call compute on the parent
77
+ if (this.width === 'auto' && this.height === 'auto') {
78
+ // @ts-ignore
79
+ this.ios.mason_computeWithSize(specWidth, specHeight);
80
+ // @ts-ignore
81
+ const layout = this.ios.mason_layout();
82
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
83
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
84
+ this.setMeasuredDimension(w, h);
85
+ return;
86
+ }
87
+ else {
88
+ // @ts-ignore
89
+ this.ios.mason_computeWithMaxContent();
90
+ // @ts-ignore
91
+ const layout = this.ios.node.computedLayout;
92
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
93
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
94
+ this.setMeasuredDimension(w, h);
95
+ }
96
+ }
97
+ else {
98
+ // @ts-ignore
99
+ const layout = this.ios.node.computedLayout;
100
+ const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
101
+ const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
102
+ this.setMeasuredDimension(w, h);
103
+ }
104
+ }
105
+ }
106
+ _setNativeViewFrame(nativeView, frame) {
107
+ nativeView.frame = frame;
108
+ }
109
+ };
110
+ Input = __decorate([
111
+ CSSType('input'),
112
+ __metadata("design:paramtypes", [])
113
+ ], Input);
114
+ export { Input };
115
+ //# sourceMappingURL=index.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/input/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAG1B,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,SAAS;IAK1B,OAAO;QACb,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,MAAM;gBACT,mCAA2B;YAC7B,KAAK,QAAQ;gBACX,qCAA6B;YAC/B,KAAK,UAAU;gBACb,uCAA+B;YACjC,KAAK,OAAO;gBACV,oCAA4B;YAC9B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ANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triniwiz/nativescript-masonkit",
3
- "version": "1.0.0-beta.23",
3
+ "version": "1.0.0-beta.25",
4
4
  "description": "Web Inspired Layout",
5
5
  "main": "index",
6
6
  "typings": "index.d.ts",
@@ -10,15 +10,18 @@
10
10
  <key>DebugSymbolsPath</key>
11
11
  <string>dSYMs</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64</string>
13
+ <string>ios-arm64_x86_64-simulator</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>Mason.framework</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
+ <string>x86_64</string>
19
20
  </array>
20
21
  <key>SupportedPlatform</key>
21
22
  <string>ios</string>
23
+ <key>SupportedPlatformVariant</key>
24
+ <string>simulator</string>
22
25
  </dict>
23
26
  <dict>
24
27
  <key>BinaryPath</key>
@@ -26,18 +29,15 @@
26
29
  <key>DebugSymbolsPath</key>
27
30
  <string>dSYMs</string>
28
31
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_x86_64-simulator</string>
32
+ <string>ios-arm64</string>
30
33
  <key>LibraryPath</key>
31
34
  <string>Mason.framework</string>
32
35
  <key>SupportedArchitectures</key>
33
36
  <array>
34
37
  <string>arm64</string>
35
- <string>x86_64</string>
36
38
  </array>
37
39
  <key>SupportedPlatform</key>
38
40
  <string>ios</string>
39
- <key>SupportedPlatformVariant</key>
40
- <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
@@ -726,6 +726,33 @@ SWIFT_CLASS("_TtC5Mason15MasonImageLayer")
726
726
  - (void)drawInContext:(CGContextRef _Nonnull)context;
727
727
  @end
728
728
 
729
+ enum MasonInputType : NSInteger;
730
+ SWIFT_CLASS_NAMED("MasonInput")
731
+ @interface MasonInput : UIView
732
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
733
+ @property (nonatomic, readonly, strong) MasonNode * _Nonnull node;
734
+ @property (nonatomic, readonly, strong) NSCMason * _Nonnull mason;
735
+ @property (nonatomic, readonly, strong) UIView * _Nonnull uiView;
736
+ @property (nonatomic) enum MasonInputType type;
737
+ @property (nonatomic) int32_t size;
738
+ @property (nonatomic, copy) NSString * _Nonnull value;
739
+ @property (nonatomic, copy) NSString * _Nonnull placeholder;
740
+ - (void)drawRect:(CGRect)rect;
741
+ - (void)layoutSubviews;
742
+ - (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE;
743
+ @end
744
+
745
+ typedef SWIFT_ENUM_NAMED(NSInteger, MasonInputType, "MasonInputType", open) {
746
+ MasonInputTypeText = 0,
747
+ MasonInputTypeButton = 1,
748
+ MasonInputTypeCheckbox = 2,
749
+ MasonInputTypeEmail = 3,
750
+ MasonInputTypePassword = 4,
751
+ MasonInputTypeDate = 5,
752
+ MasonInputTypeRadio = 6,
753
+ MasonInputTypeNumber = 7,
754
+ };
755
+
729
756
  SWIFT_CLASS_NAMED("MasonLayout")
730
757
  @interface MasonLayout : NSObject
731
758
  @property (nonatomic, readonly) NSInteger order;
@@ -1399,6 +1426,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) NSCMason * _Nonnull sh
1399
1426
  - (MasonButton * _Nonnull)createButton SWIFT_WARN_UNUSED_RESULT;
1400
1427
  - (MasonNode * _Nonnull)createNode SWIFT_WARN_UNUSED_RESULT;
1401
1428
  - (MasonBr * _Nonnull)createBr SWIFT_WARN_UNUSED_RESULT;
1429
+ - (MasonInput * _Nonnull)createInput:(enum MasonInputType)type SWIFT_WARN_UNUSED_RESULT;
1402
1430
  - (void)printTree:(MasonNode * _Nonnull)node;
1403
1431
  - (MasonNode * _Nonnull)createTextNode SWIFT_WARN_UNUSED_RESULT;
1404
1432
  - (MasonNode * _Nonnull)createImageNode SWIFT_WARN_UNUSED_RESULT;