@nativescript-community/ui-checkbox 2.0.7 → 2.0.9
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/CHANGELOG.md +19 -0
- package/README.md +72 -12
- package/angular/esm2020/index.mjs +13 -4
- package/angular/esm2020/nativescript-community-ui-checkbox-angular.mjs +4 -1
- package/angular/fesm2015/nativescript-community-ui-checkbox-angular.mjs +16 -3
- package/angular/fesm2015/nativescript-community-ui-checkbox-angular.mjs.map +1 -1
- package/angular/fesm2020/nativescript-community-ui-checkbox-angular.mjs +16 -3
- package/angular/fesm2020/nativescript-community-ui-checkbox-angular.mjs.map +1 -1
- package/angular/index.d.ts +10 -1
- package/angular/package.json +2 -2
- package/common.d.ts +14 -0
- package/common.js +50 -0
- package/common.js.map +1 -1
- package/index.android.d.ts +9 -35
- package/index.android.js +21 -134
- package/index.android.js.map +1 -1
- package/index.ios.d.ts +8 -19
- package/index.ios.js +63 -71
- package/index.ios.js.map +1 -1
- package/package.json +2 -2
- package/platforms/android/native-api-usage.json +2 -1
- package/BEMCheckBox.d.ts +0 -191
- package/angular/nativescript-community-ui-checkbox-angular.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.9](https://github.com/nativescript-community/ui-checkbox/compare/v2.0.8...v2.0.9) (2023-05-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @nativescript-community/ui-checkbox
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.8](https://github.com/nativescript-community/ui-checkbox/compare/v2.0.7...v2.0.8) (2022-05-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **android:** native-api-usage ([de9c2b5](https://github.com/nativescript-community/ui-checkbox/commit/de9c2b51a47940127480c9a303f43290e50b5d5c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.7](https://github.com/nativescript-community/ui-checkbox/compare/v2.0.6...v2.0.7) (2022-04-26)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @nativescript-community/ui-checkbox
|
package/README.md
CHANGED
|
@@ -53,9 +53,15 @@
|
|
|
53
53
|
* [NativeScript-Vue Usage Sample](#nativescript-vue-usage-sample)
|
|
54
54
|
* [Demos](#demos)
|
|
55
55
|
* [Demos and Development](#demos-and-development)
|
|
56
|
-
* [Setup](#setup)
|
|
56
|
+
* [Repo Setup](#repo-setup)
|
|
57
57
|
* [Build](#build)
|
|
58
58
|
* [Demos](#demos-1)
|
|
59
|
+
* [Contributing](#contributing)
|
|
60
|
+
* [Update repo ](#update-repo-)
|
|
61
|
+
* [Update readme ](#update-readme-)
|
|
62
|
+
* [Update doc ](#update-doc-)
|
|
63
|
+
* [Publish](#publish)
|
|
64
|
+
* [modifying submodules](#modifying-submodules)
|
|
59
65
|
* [Questions](#questions)
|
|
60
66
|
|
|
61
67
|
|
|
@@ -233,18 +239,18 @@ $ ns run ios|android
|
|
|
233
239
|
## Demos and Development
|
|
234
240
|
|
|
235
241
|
|
|
236
|
-
### Setup
|
|
237
|
-
|
|
238
|
-
To run the demos, you must clone this repo **recursively**.
|
|
242
|
+
### Repo Setup
|
|
239
243
|
|
|
244
|
+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
|
|
240
245
|
```
|
|
241
|
-
git
|
|
246
|
+
git submodule update --init
|
|
242
247
|
```
|
|
243
248
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
|
|
250
|
+
|
|
251
|
+
To develop and test:
|
|
252
|
+
if you use `yarn` then run `yarn`
|
|
253
|
+
if you use `pnpm` then run `pnpm i`
|
|
248
254
|
|
|
249
255
|
**Interactive Menu:**
|
|
250
256
|
|
|
@@ -253,10 +259,9 @@ To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`)
|
|
|
253
259
|
### Build
|
|
254
260
|
|
|
255
261
|
```bash
|
|
256
|
-
npm run build
|
|
257
|
-
|
|
258
|
-
npm run build.angular # or for Angular
|
|
262
|
+
npm run build.all
|
|
259
263
|
```
|
|
264
|
+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
|
|
260
265
|
|
|
261
266
|
### Demos
|
|
262
267
|
|
|
@@ -265,6 +270,61 @@ npm run demo.[ng|react|svelte|vue].[ios|android]
|
|
|
265
270
|
|
|
266
271
|
npm run demo.svelte.ios # Example
|
|
267
272
|
```
|
|
273
|
+
|
|
274
|
+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
|
|
275
|
+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
|
|
276
|
+
You can start from the `install.ts` of each flavor to see how to register new demos
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
[](#contributing)
|
|
280
|
+
|
|
281
|
+
## Contributing
|
|
282
|
+
|
|
283
|
+
### Update repo
|
|
284
|
+
|
|
285
|
+
You can update the repo files quite easily
|
|
286
|
+
|
|
287
|
+
First update the submodules
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
npm run update
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Then commit the changes
|
|
294
|
+
Then update common files
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
npm run sync
|
|
298
|
+
```
|
|
299
|
+
Then you can run `yarn|pnpm`, commit changed files if any
|
|
300
|
+
|
|
301
|
+
### Update readme
|
|
302
|
+
```bash
|
|
303
|
+
npm run readme
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Update doc
|
|
307
|
+
```bash
|
|
308
|
+
npm run doc
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Publish
|
|
312
|
+
|
|
313
|
+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
|
|
314
|
+
Simply run
|
|
315
|
+
```shell
|
|
316
|
+
npm run publish
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### modifying submodules
|
|
320
|
+
|
|
321
|
+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
|
|
322
|
+
One easy solution is t modify `~/.gitconfig` and add
|
|
323
|
+
```
|
|
324
|
+
[url "ssh://git@github.com/"]
|
|
325
|
+
pushInsteadOf = https://github.com/
|
|
326
|
+
```
|
|
327
|
+
|
|
268
328
|
|
|
269
329
|
[](#questions)
|
|
270
330
|
|
|
@@ -10,6 +10,15 @@ const CHECKED_VALUE_ACCESSOR = {
|
|
|
10
10
|
useExisting: forwardRef(() => CheckedValueAccessor),
|
|
11
11
|
multi: true
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* The accessor for setting checked property and listening to changes that is used by the
|
|
15
|
+
* {@link NgModel} directives.
|
|
16
|
+
*
|
|
17
|
+
* ### Example
|
|
18
|
+
* ```
|
|
19
|
+
* <CheckBox [(ngModel)]="model.test">
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
13
22
|
export class CheckedValueAccessor extends BaseValueAccessor {
|
|
14
23
|
constructor(elementRef) {
|
|
15
24
|
super(elementRef.nativeElement);
|
|
@@ -26,7 +35,7 @@ export class CheckedValueAccessor extends BaseValueAccessor {
|
|
|
26
35
|
}
|
|
27
36
|
}
|
|
28
37
|
CheckedValueAccessor.ɵfac = function CheckedValueAccessor_Factory(t) { return new (t || CheckedValueAccessor)(i0.ɵɵdirectiveInject(ElementRef)); };
|
|
29
|
-
CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
38
|
+
CheckedValueAccessor.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
30
39
|
i0.ɵɵlistener("checkedChange", function CheckedValueAccessor_checkedChange_HostBindingHandler($event) { return ctx.checkedChangeListener($event); });
|
|
31
40
|
} }, features: [i0.ɵɵProvidersFeature([CHECKED_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
32
41
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckedValueAccessor, [{
|
|
@@ -45,8 +54,8 @@ CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor
|
|
|
45
54
|
export class CheckBoxModule {
|
|
46
55
|
}
|
|
47
56
|
CheckBoxModule.ɵfac = function CheckBoxModule_Factory(t) { return new (t || CheckBoxModule)(); };
|
|
48
|
-
CheckBoxModule.ɵmod = i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
49
|
-
CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({
|
|
57
|
+
CheckBoxModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
58
|
+
CheckBoxModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [FormsModule, FormsModule] });
|
|
50
59
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckBoxModule, [{
|
|
51
60
|
type: NgModule,
|
|
52
61
|
args: [{
|
|
@@ -57,4 +66,4 @@ CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({ providers: [], imports: [[FormsMo
|
|
|
57
66
|
}]
|
|
58
67
|
}], null, null); })();
|
|
59
68
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CheckBoxModule, { declarations: [CheckedValueAccessor], imports: [FormsModule], exports: [FormsModule, CheckedValueAccessor] }); })();
|
|
60
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2hlY2tib3gvYW5ndWxhci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbEcsT0FBTyxFQUFFLFdBQVcsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxlQUFlLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUMzRSxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDMUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHFDQUFxQyxDQUFDOztBQUUvRCxlQUFlLENBQUMsVUFBVSxFQUFFLEdBQUcsRUFBRSxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRTVDLE1BQU0sc0JBQXNCLEdBQUc7SUFDM0IsT0FBTyxFQUFFLGlCQUF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hbmdlJywgWyckZXZlbnQnXSlcbiAgICBwdWJsaWMgY2hlY2tlZENoYW5nZUxpc3RlbmVyKGV2ZW50OiBhbnkpIHtcbiAgICAgICAgdGhpcy5vbkNoYW5nZShldmVudC52YWx1ZSk7XG4gICAgfVxuXG4gICAgcHVibGljIG9uVG91Y2hlZCA9ICgpID0+IHt9O1xuXG4gICAgcHVibGljIHdyaXRlVmFsdWUodmFsdWU6IGFueSk6IHZvaWQge1xuICAgICAgICB0aGlzLnZpZXcuY2hlY2tlZCA9IHZhbHVlO1xuICAgIH1cblxuICAgIHB1YmxpYyByZWdpc3Rlck9uVG91Y2hlZChmbjogKCkgPT4gdm9pZCk6IHZvaWQge1xuICAgICAgICB0aGlzLm9uVG91Y2hlZCA9IGZuO1xuICAgIH1cbn1cblxuQE5nTW9kdWxlKHtcbiAgICBkZWNsYXJhdGlvbnM6IFtDaGVja2VkVmFsdWVBY2Nlc3Nvcl0sXG4gICAgcHJvdmlkZXJzOiBbXSxcbiAgICBpbXBvcnRzOiBbRm9ybXNNb2R1bGVdLFxuICAgIGV4cG9ydHM6IFtGb3Jtc01vZHVsZSwgQ2hlY2tlZFZhbHVlQWNjZXNzb3JdXG59KVxuZXhwb3J0IGNsYXNzIENoZWNrQm94TW9kdWxlIHt9XG4iXX0=
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
1
4
|
export * from './index';
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlc2NyaXB0LWNvbW11bml0eS11aS1jaGVja2JveC1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NoZWNrYm94L2FuZ3VsYXIvbmF0aXZlc2NyaXB0LWNvbW11bml0eS11aS1jaGVja2JveC1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
|
@@ -10,6 +10,15 @@ const CHECKED_VALUE_ACCESSOR = {
|
|
|
10
10
|
useExisting: forwardRef(() => CheckedValueAccessor),
|
|
11
11
|
multi: true
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* The accessor for setting checked property and listening to changes that is used by the
|
|
15
|
+
* {@link NgModel} directives.
|
|
16
|
+
*
|
|
17
|
+
* ### Example
|
|
18
|
+
* ```
|
|
19
|
+
* <CheckBox [(ngModel)]="model.test">
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
13
22
|
class CheckedValueAccessor extends BaseValueAccessor {
|
|
14
23
|
constructor(elementRef) {
|
|
15
24
|
super(elementRef.nativeElement);
|
|
@@ -26,7 +35,7 @@ class CheckedValueAccessor extends BaseValueAccessor {
|
|
|
26
35
|
}
|
|
27
36
|
}
|
|
28
37
|
CheckedValueAccessor.ɵfac = function CheckedValueAccessor_Factory(t) { return new (t || CheckedValueAccessor)(i0.ɵɵdirectiveInject(ElementRef)); };
|
|
29
|
-
CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) {
|
|
38
|
+
CheckedValueAccessor.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) {
|
|
30
39
|
if (rf & 1) {
|
|
31
40
|
i0.ɵɵlistener("checkedChange", function CheckedValueAccessor_checkedChange_HostBindingHandler($event) { return ctx.checkedChangeListener($event); });
|
|
32
41
|
}
|
|
@@ -51,8 +60,8 @@ CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor
|
|
|
51
60
|
class CheckBoxModule {
|
|
52
61
|
}
|
|
53
62
|
CheckBoxModule.ɵfac = function CheckBoxModule_Factory(t) { return new (t || CheckBoxModule)(); };
|
|
54
|
-
CheckBoxModule.ɵmod = i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
55
|
-
CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({
|
|
63
|
+
CheckBoxModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
64
|
+
CheckBoxModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [FormsModule, FormsModule] });
|
|
56
65
|
(function () {
|
|
57
66
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckBoxModule, [{
|
|
58
67
|
type: NgModule,
|
|
@@ -66,5 +75,9 @@ CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({ providers: [], imports: [[FormsMo
|
|
|
66
75
|
})();
|
|
67
76
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CheckBoxModule, { declarations: [CheckedValueAccessor], imports: [FormsModule], exports: [FormsModule, CheckedValueAccessor] }); })();
|
|
68
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Generated bundle index. Do not edit.
|
|
80
|
+
*/
|
|
81
|
+
|
|
69
82
|
export { CheckBoxModule, CheckedValueAccessor };
|
|
70
83
|
//# sourceMappingURL=nativescript-community-ui-checkbox-angular.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativescript-community-ui-checkbox-angular.mjs","sources":["../../../../src/checkbox/angular/index.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Inject, NgModule, forwardRef } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseValueAccessor, registerElement } from '@nativescript/angular';\nimport { View } from '@nativescript/core';\nimport { CheckBox } from '@nativescript-community/ui-checkbox';\n\nregisterElement('CheckBox', () => CheckBox);\n\nconst CHECKED_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckedValueAccessor),\n multi: true\n};\n\nexport type CheckableView = { checked: boolean } & View;\n\n/**\n * The accessor for setting checked property and listening to changes that is used by the\n * {@link NgModel} directives.\n *\n * ### Example\n * ```\n * <CheckBox [(ngModel)]=\"model.test\">\n * ```\n */\n@Directive({\n selector:\n 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',\n providers: [CHECKED_VALUE_ACCESSOR]\n})\nexport class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {\n constructor(@Inject(ElementRef) elementRef: ElementRef) {\n super(elementRef.nativeElement);\n }\n\n @HostListener('checkedChange', ['$event'])\n public checkedChangeListener(event: any) {\n this.onChange(event.value);\n }\n\n public onTouched = () => {};\n\n public writeValue(value: any): void {\n this.view.checked = value;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n}\n\n@NgModule({\n declarations: [CheckedValueAccessor],\n providers: [],\n imports: [FormsModule],\n exports: [FormsModule, CheckedValueAccessor]\n})\nexport class CheckBoxModule {}\n"],"names":[],"mappings":";;;;;;AAMA,eAAe,CAAC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE5C,MAAM,sBAAsB,GAAG;AAC3B,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,IAAA,KAAK,EAAE,IAAI;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"nativescript-community-ui-checkbox-angular.mjs","sources":["../../../../src/checkbox/angular/index.ts","../../../../src/checkbox/angular/nativescript-community-ui-checkbox-angular.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Inject, NgModule, forwardRef } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseValueAccessor, registerElement } from '@nativescript/angular';\nimport { View } from '@nativescript/core';\nimport { CheckBox } from '@nativescript-community/ui-checkbox';\n\nregisterElement('CheckBox', () => CheckBox);\n\nconst CHECKED_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckedValueAccessor),\n multi: true\n};\n\nexport type CheckableView = { checked: boolean } & View;\n\n/**\n * The accessor for setting checked property and listening to changes that is used by the\n * {@link NgModel} directives.\n *\n * ### Example\n * ```\n * <CheckBox [(ngModel)]=\"model.test\">\n * ```\n */\n@Directive({\n selector:\n 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',\n providers: [CHECKED_VALUE_ACCESSOR]\n})\nexport class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {\n constructor(@Inject(ElementRef) elementRef: ElementRef) {\n super(elementRef.nativeElement);\n }\n\n @HostListener('checkedChange', ['$event'])\n public checkedChangeListener(event: any) {\n this.onChange(event.value);\n }\n\n public onTouched = () => {};\n\n public writeValue(value: any): void {\n this.view.checked = value;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n}\n\n@NgModule({\n declarations: [CheckedValueAccessor],\n providers: [],\n imports: [FormsModule],\n exports: [FormsModule, CheckedValueAccessor]\n})\nexport class CheckBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA,eAAe,CAAC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE5C,MAAM,sBAAsB,GAAG;AAC3B,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,IAAA,KAAK,EAAE,IAAI;CACd,CAAC;AAIF;;;;;;;;AAQG;AAMG,MAAO,oBAAqB,SAAQ,iBAAgC,CAAA;AACtE,IAAA,WAAA,CAAgC,UAAsB,EAAA;AAClD,QAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAQ7B,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG,CAAC;KAP3B;AAGM,IAAA,qBAAqB,CAAC,KAAU,EAAA;AACnC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9B;AAIM,IAAA,UAAU,CAAC,KAAU,EAAA;AACxB,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;KAC7B;AAEM,IAAA,iBAAiB,CAAC,EAAc,EAAA;AACnC,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;;AAlBQ,oBAAA,CAAA,IAAA,GAAA,SAAA,4BAAA,CAAA,CAAA,EAAA,EAAA,OAAA,KAAA,CAAA,IAAA,oBAAoB,uBACT,UAAU,CAAA,CAAA,CAAA,EAAA,CAAA;uEADrB,oBAAoB,EAAA,SAAA,EAAA,CAAA,CAAA,UAAA,EAAA,SAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,iBAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,aAAA,EAAA,EAAA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AACpC,oBAAA,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,CAAC,WAAW,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,WAAW,EAAE,oBAAoB,CAAC;iBAC/C,CAAA;;;AACY,CAAA,cAAA,CAAA,OAAA,SAAA,KAAA,WAAA,IAAA,SAAA,KAAA,EAAA,CAAA,kBAAA,CAAA,cAAc,mBA3Bd,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAwBnB,WAAW,CACX,EAAA,OAAA,EAAA,CAAA,WAAW,EAzBZ,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA;;AC9BjC;;AAEG;;;;"}
|
|
@@ -11,6 +11,15 @@ const CHECKED_VALUE_ACCESSOR = {
|
|
|
11
11
|
useExisting: forwardRef(() => CheckedValueAccessor),
|
|
12
12
|
multi: true
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* The accessor for setting checked property and listening to changes that is used by the
|
|
16
|
+
* {@link NgModel} directives.
|
|
17
|
+
*
|
|
18
|
+
* ### Example
|
|
19
|
+
* ```
|
|
20
|
+
* <CheckBox [(ngModel)]="model.test">
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
14
23
|
class CheckedValueAccessor extends BaseValueAccessor {
|
|
15
24
|
constructor(elementRef) {
|
|
16
25
|
super(elementRef.nativeElement);
|
|
@@ -27,7 +36,7 @@ class CheckedValueAccessor extends BaseValueAccessor {
|
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
CheckedValueAccessor.ɵfac = function CheckedValueAccessor_Factory(t) { return new (t || CheckedValueAccessor)(i0.ɵɵdirectiveInject(ElementRef)); };
|
|
30
|
-
CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
39
|
+
CheckedValueAccessor.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CheckedValueAccessor, selectors: [["CheckBox", "ngModel", ""], ["CheckBox", "formControlName", ""], ["CheckBox", "formControl", ""], ["checkBox", "ngModel", ""], ["checkBox", "formControlName", ""], ["checkBox", "formControl", ""], ["check-box", "ngModel", ""], ["check-box", "formControlName", ""], ["check-box", "formControl", ""]], hostBindings: function CheckedValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
31
40
|
i0.ɵɵlistener("checkedChange", function CheckedValueAccessor_checkedChange_HostBindingHandler($event) { return ctx.checkedChangeListener($event); });
|
|
32
41
|
} }, features: [i0.ɵɵProvidersFeature([CHECKED_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
33
42
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckedValueAccessor, [{
|
|
@@ -46,8 +55,8 @@ CheckedValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: CheckedValueAccessor
|
|
|
46
55
|
class CheckBoxModule {
|
|
47
56
|
}
|
|
48
57
|
CheckBoxModule.ɵfac = function CheckBoxModule_Factory(t) { return new (t || CheckBoxModule)(); };
|
|
49
|
-
CheckBoxModule.ɵmod = i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
50
|
-
CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({
|
|
58
|
+
CheckBoxModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CheckBoxModule });
|
|
59
|
+
CheckBoxModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [FormsModule, FormsModule] });
|
|
51
60
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckBoxModule, [{
|
|
52
61
|
type: NgModule,
|
|
53
62
|
args: [{
|
|
@@ -59,5 +68,9 @@ CheckBoxModule.ɵinj = i0.ɵɵdefineInjector({ providers: [], imports: [[FormsMo
|
|
|
59
68
|
}], null, null); })();
|
|
60
69
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CheckBoxModule, { declarations: [CheckedValueAccessor], imports: [FormsModule], exports: [FormsModule, CheckedValueAccessor] }); })();
|
|
61
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Generated bundle index. Do not edit.
|
|
73
|
+
*/
|
|
74
|
+
|
|
62
75
|
export { CheckBoxModule, CheckedValueAccessor };
|
|
63
76
|
//# sourceMappingURL=nativescript-community-ui-checkbox-angular.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativescript-community-ui-checkbox-angular.mjs","sources":["../../../../src/checkbox/angular/index.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Inject, NgModule, forwardRef } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseValueAccessor, registerElement } from '@nativescript/angular';\nimport { View } from '@nativescript/core';\nimport { CheckBox } from '@nativescript-community/ui-checkbox';\n\nregisterElement('CheckBox', () => CheckBox);\n\nconst CHECKED_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckedValueAccessor),\n multi: true\n};\n\nexport type CheckableView = { checked: boolean } & View;\n\n/**\n * The accessor for setting checked property and listening to changes that is used by the\n * {@link NgModel} directives.\n *\n * ### Example\n * ```\n * <CheckBox [(ngModel)]=\"model.test\">\n * ```\n */\n@Directive({\n selector:\n 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',\n providers: [CHECKED_VALUE_ACCESSOR]\n})\nexport class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {\n constructor(@Inject(ElementRef) elementRef: ElementRef) {\n super(elementRef.nativeElement);\n }\n\n @HostListener('checkedChange', ['$event'])\n public checkedChangeListener(event: any) {\n this.onChange(event.value);\n }\n\n public onTouched = () => {};\n\n public writeValue(value: any): void {\n this.view.checked = value;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n}\n\n@NgModule({\n declarations: [CheckedValueAccessor],\n providers: [],\n imports: [FormsModule],\n exports: [FormsModule, CheckedValueAccessor]\n})\nexport class CheckBoxModule {}\n"],"names":[],"mappings":";;;;;;;AAMA,eAAe,CAAC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE5C,MAAM,sBAAsB,GAAG;AAC3B,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,IAAA,KAAK,EAAE,IAAI;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"nativescript-community-ui-checkbox-angular.mjs","sources":["../../../../src/checkbox/angular/index.ts","../../../../src/checkbox/angular/nativescript-community-ui-checkbox-angular.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, Inject, NgModule, forwardRef } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseValueAccessor, registerElement } from '@nativescript/angular';\nimport { View } from '@nativescript/core';\nimport { CheckBox } from '@nativescript-community/ui-checkbox';\n\nregisterElement('CheckBox', () => CheckBox);\n\nconst CHECKED_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckedValueAccessor),\n multi: true\n};\n\nexport type CheckableView = { checked: boolean } & View;\n\n/**\n * The accessor for setting checked property and listening to changes that is used by the\n * {@link NgModel} directives.\n *\n * ### Example\n * ```\n * <CheckBox [(ngModel)]=\"model.test\">\n * ```\n */\n@Directive({\n selector:\n 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',\n providers: [CHECKED_VALUE_ACCESSOR]\n})\nexport class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {\n constructor(@Inject(ElementRef) elementRef: ElementRef) {\n super(elementRef.nativeElement);\n }\n\n @HostListener('checkedChange', ['$event'])\n public checkedChangeListener(event: any) {\n this.onChange(event.value);\n }\n\n public onTouched = () => {};\n\n public writeValue(value: any): void {\n this.view.checked = value;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n}\n\n@NgModule({\n declarations: [CheckedValueAccessor],\n providers: [],\n imports: [FormsModule],\n exports: [FormsModule, CheckedValueAccessor]\n})\nexport class CheckBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,eAAe,CAAC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE5C,MAAM,sBAAsB,GAAG;AAC3B,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,IAAA,KAAK,EAAE,IAAI;CACd,CAAC;AAIF;;;;;;;;AAQG;AAMG,MAAO,oBAAqB,SAAQ,iBAAgC,CAAA;AACtE,IAAA,WAAA,CAAgC,UAAsB,EAAA;AAClD,QAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAQ7B,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG,CAAC;KAP3B;AAGM,IAAA,qBAAqB,CAAC,KAAU,EAAA;AACnC,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9B;AAIM,IAAA,UAAU,CAAC,KAAU,EAAA;AACxB,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;KAC7B;AAEM,IAAA,iBAAiB,CAAC,EAAc,EAAA;AACnC,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB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AAc,CAAA;;4EAAd,cAAc,GAAA,CAAA,EAAA,CAAA;gEAAd,cAAc,EAAA,CAAA,CAAA;AAHb,cAAA,CAAA,IAAA,iBAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,WAAW,EACX,WAAW,CAAA,EAAA,CAAA,CAAA;uFAEZ,cAAc,EAAA,CAAA;cAN1B,QAAQ;AAAC,QAAA,IAAA,EAAA,CAAA;gBACN,YAAY,EAAE,CAAC,oBAAoB,CAAC;AACpC,gBAAA,SAAS,EAAE,EAAE;gBACb,OAAO,EAAE,CAAC,WAAW,CAAC;AACtB,gBAAA,OAAO,EAAE,CAAC,WAAW,EAAE,oBAAoB,CAAC;AAC/C,aAAA,CAAA;;AACY,CAAA,YAAA,EAAA,CAAA,OAAA,SAAA,KAAA,WAAA,IAAA,SAAA,KAAA,EAAA,CAAA,kBAAA,CAAA,cAAc,mBA3Bd,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAwBnB,WAAW,CACX,EAAA,OAAA,EAAA,CAAA,WAAW,EAzBZ,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA;;AC9BjC;;AAEG;;;;"}
|
package/angular/index.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ import * as i1 from "@angular/forms";
|
|
|
6
6
|
export declare type CheckableView = {
|
|
7
7
|
checked: boolean;
|
|
8
8
|
} & View;
|
|
9
|
+
/**
|
|
10
|
+
* The accessor for setting checked property and listening to changes that is used by the
|
|
11
|
+
* {@link NgModel} directives.
|
|
12
|
+
*
|
|
13
|
+
* ### Example
|
|
14
|
+
* ```
|
|
15
|
+
* <CheckBox [(ngModel)]="model.test">
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
9
18
|
export declare class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {
|
|
10
19
|
constructor(elementRef: ElementRef);
|
|
11
20
|
checkedChangeListener(event: any): void;
|
|
@@ -13,7 +22,7 @@ export declare class CheckedValueAccessor extends BaseValueAccessor<CheckableVie
|
|
|
13
22
|
writeValue(value: any): void;
|
|
14
23
|
registerOnTouched(fn: () => void): void;
|
|
15
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckedValueAccessor, never>;
|
|
16
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckedValueAccessor, "CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]", never, {}, {}, never>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckedValueAccessor, "CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]", never, {}, {}, never, never, false, never>;
|
|
17
26
|
}
|
|
18
27
|
export declare class CheckBoxModule {
|
|
19
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckBoxModule, never>;
|
package/angular/package.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"esm2020": "esm2020/nativescript-community-ui-checkbox-angular.mjs",
|
|
7
7
|
"fesm2020": "fesm2020/nativescript-community-ui-checkbox-angular.mjs",
|
|
8
8
|
"fesm2015": "fesm2015/nativescript-community-ui-checkbox-angular.mjs",
|
|
9
|
-
"typings": "
|
|
9
|
+
"typings": "index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
"./package.json": {
|
|
12
12
|
"default": "./package.json"
|
|
13
13
|
},
|
|
14
14
|
".": {
|
|
15
|
-
"types": "./
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
16
|
"esm2020": "./esm2020/nativescript-community-ui-checkbox-angular.mjs",
|
|
17
17
|
"es2020": "./fesm2020/nativescript-community-ui-checkbox-angular.mjs",
|
|
18
18
|
"es2015": "./fesm2015/nativescript-community-ui-checkbox-angular.mjs",
|
package/common.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
import { Button, Color, CssProperty, Property, Style } from '@nativescript/core';
|
|
2
|
+
import { CheckBoxInterface } from '.';
|
|
1
3
|
export declare enum BoxType {
|
|
2
4
|
circle = "circle",
|
|
3
5
|
square = "square"
|
|
4
6
|
}
|
|
7
|
+
export declare const cssProperty: (target: Object, key: string | symbol) => void;
|
|
8
|
+
export declare const tintColorProperty: CssProperty<Style, string>;
|
|
9
|
+
export declare const fillColorProperty: CssProperty<Style, string>;
|
|
10
|
+
export declare const checkedProperty: Property<CheckBoxBase, boolean>;
|
|
11
|
+
export declare abstract class CheckBoxBase extends Button implements CheckBoxInterface {
|
|
12
|
+
checked: boolean;
|
|
13
|
+
boxType: any;
|
|
14
|
+
fillColor: string | Color;
|
|
15
|
+
tintColor: string | Color;
|
|
16
|
+
abstract toggle(): void;
|
|
17
|
+
_onCheckedPropertyChanged(checkbox: CheckBoxBase, oldValue: any, newValue: any): void;
|
|
18
|
+
}
|
package/common.js
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
|
+
import { Button, Color, CSSType, CssProperty, Property, Style, booleanConverter } from '@nativescript/core';
|
|
1
2
|
export var BoxType;
|
|
2
3
|
(function (BoxType) {
|
|
3
4
|
BoxType["circle"] = "circle";
|
|
4
5
|
BoxType["square"] = "square";
|
|
5
6
|
})(BoxType || (BoxType = {}));
|
|
7
|
+
export const cssProperty = (target, key) => {
|
|
8
|
+
Object.defineProperty(target, key, {
|
|
9
|
+
get() {
|
|
10
|
+
return this.style[key];
|
|
11
|
+
},
|
|
12
|
+
set(newVal) {
|
|
13
|
+
this.style[key] = newVal;
|
|
14
|
+
},
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export const tintColorProperty = new CssProperty({
|
|
20
|
+
name: 'tintColor',
|
|
21
|
+
cssName: 'tint-color',
|
|
22
|
+
valueConverter: (v) => String(v)
|
|
23
|
+
});
|
|
24
|
+
export const fillColorProperty = new CssProperty({
|
|
25
|
+
name: 'fillColor',
|
|
26
|
+
cssName: 'fill-color',
|
|
27
|
+
valueConverter: (v) => String(v)
|
|
28
|
+
});
|
|
29
|
+
export const checkedProperty = new Property({
|
|
30
|
+
name: 'checked',
|
|
31
|
+
defaultValue: false,
|
|
32
|
+
valueConverter: booleanConverter
|
|
33
|
+
// valueChanged: onCheckedPropertyChanged
|
|
34
|
+
});
|
|
35
|
+
let CheckBoxBase = class CheckBoxBase extends Button {
|
|
36
|
+
_onCheckedPropertyChanged(checkbox, oldValue, newValue) {
|
|
37
|
+
if (!this.nativeViewProtected) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
checkedProperty.nativeValueChange(this, newValue);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
cssProperty
|
|
45
|
+
], CheckBoxBase.prototype, "fillColor", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
cssProperty
|
|
48
|
+
], CheckBoxBase.prototype, "tintColor", void 0);
|
|
49
|
+
CheckBoxBase = __decorate([
|
|
50
|
+
CSSType('CheckBox')
|
|
51
|
+
], CheckBoxBase);
|
|
52
|
+
export { CheckBoxBase };
|
|
53
|
+
checkedProperty.register(CheckBoxBase);
|
|
54
|
+
fillColorProperty.register(Style);
|
|
55
|
+
tintColorProperty.register(Style);
|
|
6
56
|
//# sourceMappingURL=common.js.map
|
package/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"../src/","sources":["common.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,4BAAiB,CAAA;IACjB,4BAAiB,CAAA;AACrB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB"}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"../src/","sources":["common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE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E,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC3B,OAAO;SACV;QACD,eAAe,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;CACJ,CAAA;AAVgB;IAAZ,WAAW;+CAA2B;AAC1B;IAAZ,WAAW;+CAA2B;AAJrB,YAAY;IADjC,OAAO,CAAC,UAAU,CAAC;GACE,YAAY,CAajC;SAbqB,YAAY;AAclC,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACvC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC"}
|
package/index.android.d.ts
CHANGED
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const textProperty: Property<CheckBox, string>;
|
|
4
|
-
export declare const fillColorProperty: CssProperty<Style, string>;
|
|
5
|
-
export declare const tintColorProperty: CssProperty<Style, string>;
|
|
6
|
-
export declare class CheckBox extends View {
|
|
7
|
-
checked: boolean;
|
|
8
|
-
fillColor: Color | string;
|
|
9
|
-
tintColor: Color | string;
|
|
1
|
+
import { CheckBoxBase } from './common';
|
|
2
|
+
export declare class CheckBox extends CheckBoxBase {
|
|
10
3
|
nativeViewProtected: androidx.appcompat.widget.AppCompatCheckBox;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
constructor();
|
|
19
|
-
set boxType(value: string);
|
|
20
|
-
get boxType(): string;
|
|
21
|
-
get checkStyle(): string;
|
|
22
|
-
set checkStyle(style: string);
|
|
23
|
-
set checkPadding(padding: string);
|
|
24
|
-
get checkPadding(): string;
|
|
25
|
-
set checkPaddingLeft(padding: string);
|
|
26
|
-
get checkPaddingLeft(): string;
|
|
27
|
-
set checkPaddingTop(padding: string);
|
|
28
|
-
get checkPaddingTop(): string;
|
|
29
|
-
set checkPaddingRight(padding: string);
|
|
30
|
-
get checkPaddingRight(): string;
|
|
31
|
-
set checkPaddingBottom(padding: string);
|
|
32
|
-
get checkPaddingBottom(): string;
|
|
33
|
-
get fontSize(): number;
|
|
34
|
-
set fontSize(size: number);
|
|
4
|
+
checkStyle: string;
|
|
5
|
+
checkPadding: string;
|
|
6
|
+
checkPaddingLeft: string;
|
|
7
|
+
checkPaddingTop: string;
|
|
8
|
+
checkPaddingRight: string;
|
|
9
|
+
checkPaddingBottom: string;
|
|
10
|
+
ignoreChange: boolean;
|
|
35
11
|
createNativeView(): androidx.appcompat.widget.AppCompatCheckBox | androidx.appcompat.widget.AppCompatRadioButton;
|
|
36
12
|
initNativeView(): void;
|
|
37
13
|
disposeNativeView(): void;
|
|
38
14
|
toggle(): void;
|
|
39
|
-
_onCheckedPropertyChanged(checkbox: CheckBox, oldValue: any, newValue: any): void;
|
|
40
|
-
_onTextPropertyChanged(checkbox: CheckBox, oldValue: any, newValue: any): void;
|
|
41
15
|
}
|