@nativescript-community/ui-checkbox 2.0.6
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/BEMCheckBox.d.ts +191 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +273 -0
- package/angular/esm2020/index.mjs +60 -0
- package/angular/esm2020/nativescript-community-ui-checkbox-angular.mjs +2 -0
- package/angular/fesm2015/nativescript-community-ui-checkbox-angular.mjs +70 -0
- package/angular/fesm2015/nativescript-community-ui-checkbox-angular.mjs.map +1 -0
- package/angular/fesm2020/nativescript-community-ui-checkbox-angular.mjs +63 -0
- package/angular/fesm2020/nativescript-community-ui-checkbox-angular.mjs.map +1 -0
- package/angular/index.d.ts +22 -0
- package/angular/nativescript-community-ui-checkbox-angular.d.ts +2 -0
- package/angular/package.json +30 -0
- package/blueprint.md +158 -0
- package/common.d.ts +4 -0
- package/common.js +6 -0
- package/common.js.map +1 -0
- package/index.android.d.ts +41 -0
- package/index.android.js +200 -0
- package/index.android.js.map +1 -0
- package/index.d.ts +32 -0
- package/index.ios.d.ts +42 -0
- package/index.ios.js +244 -0
- package/index.ios.js.map +1 -0
- package/package.json +60 -0
- package/platforms/android/native-api-usage.json +5 -0
- package/platforms/ios/Podfile +1 -0
- package/references.d.ts +1 -0
- package/tsconfig.json +9 -0
- package/typings/BEMCheckBox.d.ts +191 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.js +11 -0
- package/vue/index.js.map +1 -0
package/index.ios.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { Button, Color, CssProperty, Property, Style, booleanConverter } from '@nativescript/core';
|
|
2
|
+
import { BoxType } from './common';
|
|
3
|
+
const checkBoxBackgroundColorProperty = new CssProperty({
|
|
4
|
+
name: 'checkBoxBackgroundColor',
|
|
5
|
+
cssName: 'checkbox-background-color',
|
|
6
|
+
valueConverter: (v) => String(v)
|
|
7
|
+
});
|
|
8
|
+
const onCheckColorProperty = new CssProperty({
|
|
9
|
+
name: 'onCheckColor',
|
|
10
|
+
cssName: 'on-check-color',
|
|
11
|
+
defaultValue: '#ffffff',
|
|
12
|
+
valueConverter: (v) => String(v)
|
|
13
|
+
});
|
|
14
|
+
const tintColorProperty = new CssProperty({
|
|
15
|
+
name: 'tintColor',
|
|
16
|
+
cssName: 'tint-color',
|
|
17
|
+
valueConverter: (v) => String(v)
|
|
18
|
+
});
|
|
19
|
+
const onTintColorProperty = new CssProperty({
|
|
20
|
+
name: 'onTintColor',
|
|
21
|
+
cssName: 'on-tint-color',
|
|
22
|
+
valueConverter: (v) => String(v)
|
|
23
|
+
});
|
|
24
|
+
const fillColorProperty = new CssProperty({
|
|
25
|
+
name: 'fillColor',
|
|
26
|
+
cssName: 'fill-color',
|
|
27
|
+
valueConverter: (v) => String(v)
|
|
28
|
+
});
|
|
29
|
+
const checkedProperty = new Property({
|
|
30
|
+
name: 'checked',
|
|
31
|
+
defaultValue: false,
|
|
32
|
+
valueConverter: booleanConverter,
|
|
33
|
+
valueChanged: onCheckedPropertyChanged
|
|
34
|
+
});
|
|
35
|
+
const boxTypeProperty = new Property({
|
|
36
|
+
name: 'boxType',
|
|
37
|
+
valueConverter: (v) => (BoxType[v] === BoxType.circle ? 0 : 1)
|
|
38
|
+
});
|
|
39
|
+
export class CheckBox extends Button {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this._lineWidth = 1;
|
|
43
|
+
}
|
|
44
|
+
createNativeView() {
|
|
45
|
+
const view = super.createNativeView();
|
|
46
|
+
this._iosCheckbox = BEMCheckBox.alloc().initWithFrame(CGRectMake(0, 0, 80, 80));
|
|
47
|
+
view.addSubview(this._iosCheckbox);
|
|
48
|
+
return view;
|
|
49
|
+
}
|
|
50
|
+
set fillColor(color) {
|
|
51
|
+
this._fillColor = color;
|
|
52
|
+
this._iosCheckbox.onFillColor = new Color(color).ios;
|
|
53
|
+
}
|
|
54
|
+
set onFillColor(color) {
|
|
55
|
+
this._onFillColor = color;
|
|
56
|
+
this._iosCheckbox.onFillColor = new Color(color).ios;
|
|
57
|
+
}
|
|
58
|
+
set tintColor(color) {
|
|
59
|
+
this._tintColor = color;
|
|
60
|
+
this._iosCheckbox.tintColor = new Color(color).ios;
|
|
61
|
+
}
|
|
62
|
+
set onTintColor(color) {
|
|
63
|
+
this._onTintColor = color;
|
|
64
|
+
this._iosCheckbox.onTintColor = new Color(color).ios;
|
|
65
|
+
}
|
|
66
|
+
set checkBoxBackgroundColor(color) {
|
|
67
|
+
this._checkBoxBackgroundColor = color;
|
|
68
|
+
this._iosCheckbox.offFillColor = new Color(color).ios;
|
|
69
|
+
}
|
|
70
|
+
set onCheckColor(color) {
|
|
71
|
+
this._onCheckColor = color;
|
|
72
|
+
this._iosCheckbox.onCheckColor = new Color(color).ios;
|
|
73
|
+
}
|
|
74
|
+
[boxTypeProperty.setNative](value) {
|
|
75
|
+
if (this.nativeViewProtected) {
|
|
76
|
+
this._iosCheckbox.boxType = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
[checkedProperty.getDefault]() {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
[checkedProperty.setNative](value) {
|
|
83
|
+
this._iosCheckbox.setOnAnimated(value, true);
|
|
84
|
+
}
|
|
85
|
+
set checkedAnimated(value) {
|
|
86
|
+
this._iosCheckbox.setOnAnimated(value, true);
|
|
87
|
+
}
|
|
88
|
+
set lineWidth(value) {
|
|
89
|
+
this._iosCheckbox.lineWidth = value;
|
|
90
|
+
this._lineWidth = value;
|
|
91
|
+
}
|
|
92
|
+
set hideBox(value) {
|
|
93
|
+
this._iosCheckbox.hideBox = value;
|
|
94
|
+
this._hideBox = value;
|
|
95
|
+
}
|
|
96
|
+
set animationDuration(value) {
|
|
97
|
+
this._iosCheckbox.animationDuration = value;
|
|
98
|
+
this._animationDuration = value;
|
|
99
|
+
}
|
|
100
|
+
set onAnimationType(value) {
|
|
101
|
+
if (this._iosCheckbox) {
|
|
102
|
+
this._iosCheckbox.onAnimationType = this._getAnimationType(value);
|
|
103
|
+
}
|
|
104
|
+
else
|
|
105
|
+
this._onAnimationType = value;
|
|
106
|
+
}
|
|
107
|
+
set offAnimationType(value) {
|
|
108
|
+
this._iosCheckbox.offAnimationType = this._getAnimationType(value);
|
|
109
|
+
this._offAnimationType = value;
|
|
110
|
+
}
|
|
111
|
+
get nativeiOSCheckBox() {
|
|
112
|
+
return this._iosCheckbox;
|
|
113
|
+
}
|
|
114
|
+
reload(value) {
|
|
115
|
+
this._iosCheckbox.reload();
|
|
116
|
+
}
|
|
117
|
+
initNativeView() {
|
|
118
|
+
this.addEventListener('tap', (args) => {
|
|
119
|
+
this.tapTimeout = setTimeout(() => {
|
|
120
|
+
this.tapTimeout = null;
|
|
121
|
+
const checkbox = args.object;
|
|
122
|
+
checkbox.checked = !checkbox.checked;
|
|
123
|
+
}, 10);
|
|
124
|
+
});
|
|
125
|
+
this._onAnimationType = 2;
|
|
126
|
+
this._offAnimationType = 2;
|
|
127
|
+
this._delegate = BEMCheckBoxDelegateImpl.initWithOwner(new WeakRef(this));
|
|
128
|
+
let fontSize;
|
|
129
|
+
if (!this.style.fontSize) {
|
|
130
|
+
fontSize = 15;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
fontSize = this.style.fontSize;
|
|
134
|
+
}
|
|
135
|
+
this._iosCheckbox.delegate = this._delegate;
|
|
136
|
+
this._iosCheckbox.frame = CGRectMake(0, 0, fontSize, fontSize);
|
|
137
|
+
this._iosCheckbox.center = CGPointMake(this._iosCheckbox.center.x, fontSize / 2 + 3);
|
|
138
|
+
this.style.paddingLeft = fontSize + (fontSize > 20 ? 10 : 5);
|
|
139
|
+
this.style.textAlignment = 'left';
|
|
140
|
+
if (this._onCheckColor) {
|
|
141
|
+
this._iosCheckbox.onCheckColor = new Color(this._onCheckColor).ios;
|
|
142
|
+
}
|
|
143
|
+
if (this._onFillColor) {
|
|
144
|
+
this._iosCheckbox.onFillColor = new Color(this._onFillColor).ios;
|
|
145
|
+
}
|
|
146
|
+
if (this._onTintColor) {
|
|
147
|
+
this._iosCheckbox.onTintColor = new Color(this._onTintColor).ios;
|
|
148
|
+
}
|
|
149
|
+
if (this._fillColor) {
|
|
150
|
+
this._iosCheckbox.onFillColor = new Color(this._fillColor).ios;
|
|
151
|
+
}
|
|
152
|
+
if (this._tintColor) {
|
|
153
|
+
this._iosCheckbox.tintColor = new Color(this._tintColor).ios;
|
|
154
|
+
}
|
|
155
|
+
if (typeof this._lineWidth !== 'undefined') {
|
|
156
|
+
this.lineWidth = this._lineWidth;
|
|
157
|
+
}
|
|
158
|
+
if (typeof this._hideBox !== 'undefined') {
|
|
159
|
+
this.hideBox = this._hideBox;
|
|
160
|
+
}
|
|
161
|
+
this.boxType = this.boxType === 0 ? 0 : 1;
|
|
162
|
+
if (typeof this._animationDuration !== 'undefined') {
|
|
163
|
+
this.animationDuration = this._animationDuration;
|
|
164
|
+
}
|
|
165
|
+
if (typeof this._onAnimationType !== 'undefined') {
|
|
166
|
+
this.onAnimationType = this._onAnimationType;
|
|
167
|
+
}
|
|
168
|
+
if (typeof this._offAnimationType !== 'undefined') {
|
|
169
|
+
this.offAnimationType = this._offAnimationType;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
disposeNativeView() {
|
|
173
|
+
this._iosCheckbox.delegate = null;
|
|
174
|
+
this._iosCheckbox = null;
|
|
175
|
+
this.removeEventListener('tap');
|
|
176
|
+
}
|
|
177
|
+
toggle() {
|
|
178
|
+
this.checked = !this.checked;
|
|
179
|
+
}
|
|
180
|
+
_getAnimationType(value) {
|
|
181
|
+
switch (value) {
|
|
182
|
+
case 1:
|
|
183
|
+
return 0;
|
|
184
|
+
case 2:
|
|
185
|
+
return 1;
|
|
186
|
+
case 3:
|
|
187
|
+
return 2;
|
|
188
|
+
case 4:
|
|
189
|
+
return 3;
|
|
190
|
+
case 5:
|
|
191
|
+
return 0;
|
|
192
|
+
case 6:
|
|
193
|
+
return 5;
|
|
194
|
+
default:
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
_onCheckedPropertyChanged(checkbox, oldValue, newValue) {
|
|
199
|
+
if (!this._iosCheckbox) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
checkedProperty.nativeValueChange(this, newValue);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var BEMCheckBoxDelegateImpl = /** @class */ (function (_super) {
|
|
206
|
+
__extends(BEMCheckBoxDelegateImpl, _super);
|
|
207
|
+
function BEMCheckBoxDelegateImpl() {
|
|
208
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
209
|
+
}
|
|
210
|
+
/* static ObjCExposedMethods = {
|
|
211
|
+
"didTapCheckBox": { returns: interop.types.void, params: [NSObject] }
|
|
212
|
+
};*/
|
|
213
|
+
BEMCheckBoxDelegateImpl.initWithOwner = function (owner) {
|
|
214
|
+
var delegate = BEMCheckBoxDelegateImpl.new();
|
|
215
|
+
delegate._owner = owner;
|
|
216
|
+
return delegate;
|
|
217
|
+
};
|
|
218
|
+
BEMCheckBoxDelegateImpl.prototype.animationDidStopForCheckBox = function (checkBox) {
|
|
219
|
+
// TODO: Maybe trigger event later?
|
|
220
|
+
};
|
|
221
|
+
BEMCheckBoxDelegateImpl.prototype.didTapCheckBox = function (checkBox) {
|
|
222
|
+
var owner = this._owner.get();
|
|
223
|
+
if (owner) {
|
|
224
|
+
if (owner.tapTimeout) {
|
|
225
|
+
clearTimeout(owner.tapTimeout);
|
|
226
|
+
owner.tapTimeout = null;
|
|
227
|
+
}
|
|
228
|
+
checkedProperty.nativeValueChange(owner, checkBox.on);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
BEMCheckBoxDelegateImpl.ObjCProtocols = [BEMCheckBoxDelegate];
|
|
232
|
+
return BEMCheckBoxDelegateImpl;
|
|
233
|
+
}(NSObject));
|
|
234
|
+
function onCheckedPropertyChanged(checkbox, oldValue, newValue) {
|
|
235
|
+
checkbox._onCheckedPropertyChanged(checkbox, oldValue, newValue);
|
|
236
|
+
}
|
|
237
|
+
boxTypeProperty.register(CheckBox);
|
|
238
|
+
checkedProperty.register(CheckBox);
|
|
239
|
+
fillColorProperty.register(Style);
|
|
240
|
+
onTintColorProperty.register(Style);
|
|
241
|
+
onCheckColorProperty.register(Style);
|
|
242
|
+
checkBoxBackgroundColorProperty.register(Style);
|
|
243
|
+
tintColorProperty.register(Style);
|
|
244
|
+
//# sourceMappingURL=index.ios.js.map
|
package/index.ios.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"../src/","sources":["index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,MAAM,+BAA+B,GAAG,IAAI,WAAW,CAAgB;IACnE,IAAI,EAAE,yBAAyB;IAC/B,OAAO,EAAE,2BAA2B;IACpC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,IAAI,WAAW,CAAgB;IACxD,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAI,WAAW,CAAgB;IACrD,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,YAAY;IAErB,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,IAAI,WAAW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,CAAC;AACpC,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrC,+BAA+B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChD,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nativescript-community/ui-checkbox",
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"description": "NativeScript plugin for checkbox.",
|
|
5
|
+
"main": "./index",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "npm run tsc && npm run readme",
|
|
10
|
+
"build.all": "npm run build && npm run build.angular",
|
|
11
|
+
"build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/checkbox/angular/ng-package.json -c ../../src/checkbox/angular/tsconfig.json",
|
|
12
|
+
"readme": "../../node_modules/.bin/readme generate -c ../../tools/readme/blueprint.json",
|
|
13
|
+
"tsc": "../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/checkbox' --parents --cwd=../../src/checkbox && ../../node_modules/.bin/tsc -skipLibCheck -d",
|
|
14
|
+
"clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
|
|
15
|
+
},
|
|
16
|
+
"nativescript": {
|
|
17
|
+
"platforms": {
|
|
18
|
+
"android": "6.0.0",
|
|
19
|
+
"ios": "6.0.0"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"NativeScript",
|
|
24
|
+
"JavaScript",
|
|
25
|
+
"Android",
|
|
26
|
+
"iOS",
|
|
27
|
+
"RadListView",
|
|
28
|
+
"checkbox",
|
|
29
|
+
"collection view",
|
|
30
|
+
"grid view",
|
|
31
|
+
"grid list view",
|
|
32
|
+
"super grid",
|
|
33
|
+
"NativeScript UI",
|
|
34
|
+
"nativescript community",
|
|
35
|
+
"Angular",
|
|
36
|
+
"Vue.js",
|
|
37
|
+
"Vue.js Native",
|
|
38
|
+
"Vue Native",
|
|
39
|
+
"Svelte",
|
|
40
|
+
"Svelte Native",
|
|
41
|
+
"React",
|
|
42
|
+
"React NativeScript",
|
|
43
|
+
"preview|https://raw.githubusercontent.com/nativescript-community/ui-checkbox/master/images/demo-ios.gif|iOS Demo",
|
|
44
|
+
"preview|https://raw.githubusercontent.com/nativescript-community/ui-checkbox/master/images/demo-android.gif|Android Demo"
|
|
45
|
+
],
|
|
46
|
+
"author": {
|
|
47
|
+
"name": "Brad Martin",
|
|
48
|
+
"email": "bradwaynemartin@gmail.com"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/nativescript-community/ui-checkbox/issues"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/nativescript-community/ui-checkbox"
|
|
56
|
+
},
|
|
57
|
+
"license": "ISC",
|
|
58
|
+
"readmeFilename": "README.md",
|
|
59
|
+
"gitHead": "afaa050c8c548fdcab012734c8d7caa81894d6f1"
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pod 'BEMCheckBox', '~> 1.4.1'
|
package/references.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="./typings/BEMCheckBox.d.ts" />
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "../../src/checkbox",
|
|
5
|
+
"outDir": "./"
|
|
6
|
+
},
|
|
7
|
+
"include": ["../../src/checkbox/**/*", "../../tools/references.d.ts", "../../src/references.d.ts"],
|
|
8
|
+
"exclude": ["../../src/checkbox/angular/**"]
|
|
9
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
declare class BEMAnimationManager extends NSObject {
|
|
3
|
+
|
|
4
|
+
static alloc(): BEMAnimationManager; // inherited from NSObject
|
|
5
|
+
|
|
6
|
+
static new(): BEMAnimationManager; // inherited from NSObject
|
|
7
|
+
|
|
8
|
+
animationDuration: number;
|
|
9
|
+
|
|
10
|
+
constructor(o: { animationDuration: number; });
|
|
11
|
+
|
|
12
|
+
fillAnimationWithBouncesAmplitudeReverse(bounces: number, amplitude: number, reverse: boolean): CAKeyframeAnimation;
|
|
13
|
+
|
|
14
|
+
initWithAnimationDuration(animationDuration: number): this;
|
|
15
|
+
|
|
16
|
+
morphAnimationFromPathToPath(fromPath: UIBezierPath, toPath: UIBezierPath): CABasicAnimation;
|
|
17
|
+
|
|
18
|
+
opacityAnimationReverse(reverse: boolean): CABasicAnimation;
|
|
19
|
+
|
|
20
|
+
strokeAnimationReverse(reverse: boolean): CABasicAnimation;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare const enum BEMAnimationType {
|
|
24
|
+
|
|
25
|
+
Stroke = 0,
|
|
26
|
+
|
|
27
|
+
Fill = 1,
|
|
28
|
+
|
|
29
|
+
Bounce = 2,
|
|
30
|
+
|
|
31
|
+
Flat = 3,
|
|
32
|
+
|
|
33
|
+
OneStroke = 4,
|
|
34
|
+
|
|
35
|
+
Fade = 5
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const enum BEMBoxType {
|
|
39
|
+
|
|
40
|
+
Circle = 0,
|
|
41
|
+
|
|
42
|
+
Square = 1
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class BEMCheckBox extends UIControl implements CAAnimationDelegate {
|
|
46
|
+
|
|
47
|
+
static alloc(): BEMCheckBox; // inherited from NSObject
|
|
48
|
+
|
|
49
|
+
static appearance(): BEMCheckBox; // inherited from UIAppearance
|
|
50
|
+
|
|
51
|
+
static appearanceForTraitCollection(trait: UITraitCollection): BEMCheckBox; // inherited from UIAppearance
|
|
52
|
+
|
|
53
|
+
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
|
|
54
|
+
|
|
55
|
+
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): BEMCheckBox; // inherited from UIAppearance
|
|
56
|
+
|
|
57
|
+
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): BEMCheckBox; // inherited from UIAppearance
|
|
58
|
+
|
|
59
|
+
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): BEMCheckBox; // inherited from UIAppearance
|
|
60
|
+
|
|
61
|
+
static new(): BEMCheckBox; // inherited from NSObject
|
|
62
|
+
|
|
63
|
+
animationDuration: number;
|
|
64
|
+
|
|
65
|
+
boxType: BEMBoxType;
|
|
66
|
+
|
|
67
|
+
cornerRadius: number;
|
|
68
|
+
|
|
69
|
+
delegate: BEMCheckBoxDelegate;
|
|
70
|
+
|
|
71
|
+
readonly group: BEMCheckBoxGroup;
|
|
72
|
+
|
|
73
|
+
hideBox: boolean;
|
|
74
|
+
|
|
75
|
+
lineWidth: number;
|
|
76
|
+
|
|
77
|
+
minimumTouchSize: CGSize;
|
|
78
|
+
|
|
79
|
+
offAnimationType: BEMAnimationType;
|
|
80
|
+
|
|
81
|
+
offFillColor: UIColor;
|
|
82
|
+
|
|
83
|
+
on: boolean;
|
|
84
|
+
|
|
85
|
+
onAnimationType: BEMAnimationType;
|
|
86
|
+
|
|
87
|
+
onCheckColor: UIColor;
|
|
88
|
+
|
|
89
|
+
onFillColor: UIColor;
|
|
90
|
+
|
|
91
|
+
onTintColor: UIColor;
|
|
92
|
+
|
|
93
|
+
readonly debugDescription: string; // inherited from NSObjectProtocol
|
|
94
|
+
|
|
95
|
+
readonly description: string; // inherited from NSObjectProtocol
|
|
96
|
+
|
|
97
|
+
readonly hash: number; // inherited from NSObjectProtocol
|
|
98
|
+
|
|
99
|
+
readonly isProxy: boolean; // inherited from NSObjectProtocol
|
|
100
|
+
|
|
101
|
+
readonly superclass: typeof NSObject; // inherited from NSObjectProtocol
|
|
102
|
+
|
|
103
|
+
readonly // inherited from NSObjectProtocol
|
|
104
|
+
|
|
105
|
+
animationDidStart(anim: CAAnimation): void;
|
|
106
|
+
|
|
107
|
+
animationDidStopFinished(anim: CAAnimation, flag: boolean): void;
|
|
108
|
+
|
|
109
|
+
class(): typeof NSObject;
|
|
110
|
+
|
|
111
|
+
conformsToProtocol(aProtocol: any /* Protocol */): boolean;
|
|
112
|
+
|
|
113
|
+
isEqual(object: any): boolean;
|
|
114
|
+
|
|
115
|
+
isKindOfClass(aClass: typeof NSObject): boolean;
|
|
116
|
+
|
|
117
|
+
isMemberOfClass(aClass: typeof NSObject): boolean;
|
|
118
|
+
|
|
119
|
+
performSelector(aSelector: string): any;
|
|
120
|
+
|
|
121
|
+
performSelectorWithObject(aSelector: string, object: any): any;
|
|
122
|
+
|
|
123
|
+
performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any;
|
|
124
|
+
|
|
125
|
+
reload(): void;
|
|
126
|
+
|
|
127
|
+
respondsToSelector(aSelector: string): boolean;
|
|
128
|
+
|
|
129
|
+
retainCount(): number;
|
|
130
|
+
|
|
131
|
+
self(): this;
|
|
132
|
+
|
|
133
|
+
setOnAnimated(on: boolean, animated: boolean): void;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface BEMCheckBoxDelegate extends NSObjectProtocol {
|
|
137
|
+
|
|
138
|
+
animationDidStopForCheckBox?(checkBox: BEMCheckBox): void;
|
|
139
|
+
|
|
140
|
+
didTapCheckBox?(checkBox: BEMCheckBox): void;
|
|
141
|
+
}
|
|
142
|
+
declare var BEMCheckBoxDelegate: {
|
|
143
|
+
|
|
144
|
+
prototype: BEMCheckBoxDelegate;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
declare class BEMCheckBoxGroup extends NSObject {
|
|
148
|
+
|
|
149
|
+
static alloc(): BEMCheckBoxGroup; // inherited from NSObject
|
|
150
|
+
|
|
151
|
+
static groupWithCheckBoxes(checkBoxes: NSArray<BEMCheckBox> | BEMCheckBox[]): BEMCheckBoxGroup;
|
|
152
|
+
|
|
153
|
+
static new(): BEMCheckBoxGroup; // inherited from NSObject
|
|
154
|
+
|
|
155
|
+
readonly checkBoxes: NSHashTable<any>;
|
|
156
|
+
|
|
157
|
+
mustHaveSelection: boolean;
|
|
158
|
+
|
|
159
|
+
selectedCheckBox: BEMCheckBox;
|
|
160
|
+
|
|
161
|
+
addCheckBoxToGroup(checkBox: BEMCheckBox): void;
|
|
162
|
+
|
|
163
|
+
removeCheckBoxFromGroup(checkBox: BEMCheckBox): void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare var BEMCheckBoxVersionNumber: number;
|
|
167
|
+
|
|
168
|
+
declare var BEMCheckBoxVersionString: interop.Reference<number>;
|
|
169
|
+
|
|
170
|
+
declare class BEMPathManager extends NSObject {
|
|
171
|
+
|
|
172
|
+
static alloc(): BEMPathManager; // inherited from NSObject
|
|
173
|
+
|
|
174
|
+
static new(): BEMPathManager; // inherited from NSObject
|
|
175
|
+
|
|
176
|
+
boxType: BEMBoxType;
|
|
177
|
+
|
|
178
|
+
cornerRadius: number;
|
|
179
|
+
|
|
180
|
+
lineWidth: number;
|
|
181
|
+
|
|
182
|
+
size: number;
|
|
183
|
+
|
|
184
|
+
pathForBox(): UIBezierPath;
|
|
185
|
+
|
|
186
|
+
pathForCheckMark(): UIBezierPath;
|
|
187
|
+
|
|
188
|
+
pathForFlatCheckMark(): UIBezierPath;
|
|
189
|
+
|
|
190
|
+
pathForLongCheckMark(): UIBezierPath;
|
|
191
|
+
}
|
package/vue/index.d.ts
ADDED
package/vue/index.js
ADDED
package/vue/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,eAAe;IACX,OAAO,CAAC,GAAG;QACP,IAAI,CAAC,SAAS,EAAE;YACZ,SAAS,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACvD;IACL,CAAC;CACJ,CAAC"}
|