@nstudio/nativescript-checkbox 2.0.2 → 2.0.5

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 (34) hide show
  1. package/README.md +12 -57
  2. package/angular/esm2020/index.mjs +81 -0
  3. package/angular/esm2020/nstudio-nativescript-checkbox-angular.mjs +5 -0
  4. package/angular/fesm2015/nstudio-nativescript-checkbox-angular.mjs +90 -0
  5. package/angular/fesm2015/nstudio-nativescript-checkbox-angular.mjs.map +1 -0
  6. package/angular/fesm2020/nstudio-nativescript-checkbox-angular.mjs +88 -0
  7. package/angular/fesm2020/nstudio-nativescript-checkbox-angular.mjs.map +1 -0
  8. package/angular/index.d.ts +16 -0
  9. package/angular/{dist/nativescript-checkbox-angular.d.ts → nstudio-nativescript-checkbox-angular.d.ts} +1 -0
  10. package/angular/package.json +22 -20
  11. package/common.d.ts +4 -0
  12. package/{checkbox-common.js → common.js} +1 -1
  13. package/common.js.map +1 -0
  14. package/index.android.d.ts +45 -0
  15. package/{checkbox.android.js → index.android.js} +33 -41
  16. package/index.android.js.map +1 -0
  17. package/index.ios.d.ts +41 -0
  18. package/{checkbox.ios.js → index.ios.js} +17 -12
  19. package/index.ios.js.map +1 -0
  20. package/package.json +15 -66
  21. package/LICENSE +0 -21
  22. package/angular/dist/bundles/nativescript-checkbox-angular.umd.js +0 -393
  23. package/angular/dist/bundles/nativescript-checkbox-angular.umd.min.js +0 -16
  24. package/angular/dist/esm2015/index.js +0 -72
  25. package/angular/dist/esm2015/nativescript-checkbox-angular.js +0 -5
  26. package/angular/dist/fesm2015/nativescript-checkbox-angular.js +0 -79
  27. package/angular/dist/index.d.ts +0 -24
  28. package/angular/dist/nativescript-checkbox-angular.metadata.json +0 -1
  29. package/angular/dist/package.json +0 -19
  30. package/angular/index.js +0 -70
  31. package/angular/index.metadata.json +0 -1
  32. package/references.d.ts +0 -2
  33. package/tsconfig.aot.json +0 -29
  34. package/typings/BEMCheckBox.d.ts +0 -191
@@ -1,393 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@nativescript/angular')) :
3
- typeof define === 'function' && define.amd ? define('nativescript-checkbox-angular', ['exports', '@angular/core', '@angular/forms', '@nativescript/angular'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['nativescript-checkbox-angular'] = {}, global.ng.core, global.ng.forms, global['ns-angular']));
5
- }(this, (function (exports, core, forms, angular) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- }
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try {
80
- step(generator.next(value));
81
- }
82
- catch (e) {
83
- reject(e);
84
- } }
85
- function rejected(value) { try {
86
- step(generator["throw"](value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
- step((generator = generator.apply(thisArg, _arguments || [])).next());
93
- });
94
- }
95
- function __generator(thisArg, body) {
96
- var _ = { label: 0, sent: function () { if (t[0] & 1)
97
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
- function verb(n) { return function (v) { return step([n, v]); }; }
100
- function step(op) {
101
- if (f)
102
- throw new TypeError("Generator is already executing.");
103
- while (_)
104
- try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
- return t;
107
- if (y = 0, t)
108
- op = [op[0] & 2, t.value];
109
- switch (op[0]) {
110
- case 0:
111
- case 1:
112
- t = op;
113
- break;
114
- case 4:
115
- _.label++;
116
- return { value: op[1], done: false };
117
- case 5:
118
- _.label++;
119
- y = op[1];
120
- op = [0];
121
- continue;
122
- case 7:
123
- op = _.ops.pop();
124
- _.trys.pop();
125
- continue;
126
- default:
127
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
- _ = 0;
129
- continue;
130
- }
131
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
- _.label = op[1];
133
- break;
134
- }
135
- if (op[0] === 6 && _.label < t[1]) {
136
- _.label = t[1];
137
- t = op;
138
- break;
139
- }
140
- if (t && _.label < t[2]) {
141
- _.label = t[2];
142
- _.ops.push(op);
143
- break;
144
- }
145
- if (t[2])
146
- _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- }
150
- op = body.call(thisArg, _);
151
- }
152
- catch (e) {
153
- op = [6, e];
154
- y = 0;
155
- }
156
- finally {
157
- f = t = 0;
158
- }
159
- if (op[0] & 5)
160
- throw op[1];
161
- return { value: op[0] ? op[1] : void 0, done: true };
162
- }
163
- }
164
- var __createBinding = Object.create ? (function (o, m, k, k2) {
165
- if (k2 === undefined)
166
- k2 = k;
167
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
- }) : (function (o, m, k, k2) {
169
- if (k2 === undefined)
170
- k2 = k;
171
- o[k2] = m[k];
172
- });
173
- function __exportStar(m, o) {
174
- for (var p in m)
175
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
176
- __createBinding(o, m, p);
177
- }
178
- function __values(o) {
179
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
- if (m)
181
- return m.call(o);
182
- if (o && typeof o.length === "number")
183
- return {
184
- next: function () {
185
- if (o && i >= o.length)
186
- o = void 0;
187
- return { value: o && o[i++], done: !o };
188
- }
189
- };
190
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
- }
192
- function __read(o, n) {
193
- var m = typeof Symbol === "function" && o[Symbol.iterator];
194
- if (!m)
195
- return o;
196
- var i = m.call(o), r, ar = [], e;
197
- try {
198
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
- ar.push(r.value);
200
- }
201
- catch (error) {
202
- e = { error: error };
203
- }
204
- finally {
205
- try {
206
- if (r && !r.done && (m = i["return"]))
207
- m.call(i);
208
- }
209
- finally {
210
- if (e)
211
- throw e.error;
212
- }
213
- }
214
- return ar;
215
- }
216
- function __spread() {
217
- for (var ar = [], i = 0; i < arguments.length; i++)
218
- ar = ar.concat(__read(arguments[i]));
219
- return ar;
220
- }
221
- function __spreadArrays() {
222
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
- s += arguments[i].length;
224
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
- r[k] = a[j];
227
- return r;
228
- }
229
- ;
230
- function __await(v) {
231
- return this instanceof __await ? (this.v = v, this) : new __await(v);
232
- }
233
- function __asyncGenerator(thisArg, _arguments, generator) {
234
- if (!Symbol.asyncIterator)
235
- throw new TypeError("Symbol.asyncIterator is not defined.");
236
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
- function verb(n) { if (g[n])
239
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
- function resume(n, v) { try {
241
- step(g[n](v));
242
- }
243
- catch (e) {
244
- settle(q[0][3], e);
245
- } }
246
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
- function fulfill(value) { resume("next", value); }
248
- function reject(value) { resume("throw", value); }
249
- function settle(f, v) { if (f(v), q.shift(), q.length)
250
- resume(q[0][0], q[0][1]); }
251
- }
252
- function __asyncDelegator(o) {
253
- var i, p;
254
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
256
- }
257
- function __asyncValues(o) {
258
- if (!Symbol.asyncIterator)
259
- throw new TypeError("Symbol.asyncIterator is not defined.");
260
- var m = o[Symbol.asyncIterator], i;
261
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
262
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
263
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
- }
265
- function __makeTemplateObject(cooked, raw) {
266
- if (Object.defineProperty) {
267
- Object.defineProperty(cooked, "raw", { value: raw });
268
- }
269
- else {
270
- cooked.raw = raw;
271
- }
272
- return cooked;
273
- }
274
- ;
275
- var __setModuleDefault = Object.create ? (function (o, v) {
276
- Object.defineProperty(o, "default", { enumerable: true, value: v });
277
- }) : function (o, v) {
278
- o["default"] = v;
279
- };
280
- function __importStar(mod) {
281
- if (mod && mod.__esModule)
282
- return mod;
283
- var result = {};
284
- if (mod != null)
285
- for (var k in mod)
286
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
287
- __createBinding(result, mod, k);
288
- __setModuleDefault(result, mod);
289
- return result;
290
- }
291
- function __importDefault(mod) {
292
- return (mod && mod.__esModule) ? mod : { default: mod };
293
- }
294
- function __classPrivateFieldGet(receiver, privateMap) {
295
- if (!privateMap.has(receiver)) {
296
- throw new TypeError("attempted to get private field on non-instance");
297
- }
298
- return privateMap.get(receiver);
299
- }
300
- function __classPrivateFieldSet(receiver, privateMap, value) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to set private field on non-instance");
303
- }
304
- privateMap.set(receiver, value);
305
- return value;
306
- }
307
-
308
- function convertToInt(value) {
309
- var normalizedValue;
310
- if (value === undefined || value === null) {
311
- normalizedValue = 0;
312
- }
313
- else {
314
- if (typeof value === 'number') {
315
- normalizedValue = value;
316
- }
317
- else {
318
- var parsedValue = parseInt(value.toString(), 10);
319
- normalizedValue = isNaN(parsedValue) ? 0 : parsedValue;
320
- }
321
- }
322
- return Math.round(normalizedValue);
323
- }
324
- angular.registerElement('CheckBox', function () { return require('../checkbox').CheckBox; });
325
- var CHECKED_VALUE_ACCESSOR = {
326
- provide: forms.NG_VALUE_ACCESSOR,
327
- useExisting: core.forwardRef(function () { return CheckedValueAccessor; }),
328
- multi: true
329
- };
330
- /**
331
- * The accessor for setting checked property and listening to changes that is used by the
332
- * {@link NgModel} directives.
333
- *
334
- * ### Example
335
- * ```
336
- * <CheckBox [(ngModel)]="model.test">
337
- * ```
338
- */
339
- var CheckedValueAccessor = /** @class */ (function (_super) {
340
- __extends(CheckedValueAccessor, _super);
341
- function CheckedValueAccessor(elementRef) {
342
- var _this = _super.call(this, elementRef.nativeElement) || this;
343
- _this.onTouched = function () { };
344
- return _this;
345
- }
346
- CheckedValueAccessor.prototype.checkedChangeListener = function (event) {
347
- this.onChange(event.value);
348
- };
349
- CheckedValueAccessor.prototype.writeValue = function (value) {
350
- this.view.checked = value;
351
- };
352
- CheckedValueAccessor.prototype.registerOnTouched = function (fn) {
353
- this.onTouched = fn;
354
- };
355
- return CheckedValueAccessor;
356
- }(angular.BaseValueAccessor));
357
- CheckedValueAccessor.decorators = [
358
- { type: core.Directive, args: [{
359
- selector: 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',
360
- providers: [CHECKED_VALUE_ACCESSOR]
361
- },] }
362
- ];
363
- CheckedValueAccessor.ctorParameters = function () { return [
364
- { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
365
- ]; };
366
- CheckedValueAccessor.propDecorators = {
367
- checkedChangeListener: [{ type: core.HostListener, args: ['checkedChange', ['$event'],] }]
368
- };
369
- var TNSCheckBoxModule = /** @class */ (function () {
370
- function TNSCheckBoxModule() {
371
- }
372
- return TNSCheckBoxModule;
373
- }());
374
- TNSCheckBoxModule.decorators = [
375
- { type: core.NgModule, args: [{
376
- declarations: [CheckedValueAccessor],
377
- providers: [],
378
- imports: [forms.FormsModule],
379
- exports: [forms.FormsModule, CheckedValueAccessor]
380
- },] }
381
- ];
382
-
383
- /**
384
- * Generated bundle index. Do not edit.
385
- */
386
-
387
- exports.CheckedValueAccessor = CheckedValueAccessor;
388
- exports.TNSCheckBoxModule = TNSCheckBoxModule;
389
-
390
- Object.defineProperty(exports, '__esModule', { value: true });
391
-
392
- })));
393
- //# sourceMappingURL=nativescript-checkbox-angular.umd.js.map
@@ -1,16 +0,0 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/forms"),require("@nativescript/angular")):"function"==typeof define&&define.amd?define("nativescript-checkbox-angular",["exports","@angular/core","@angular/forms","@nativescript/angular"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["nativescript-checkbox-angular"]={},e.ng.core,e.ng.forms,e["ns-angular"])}(this,(function(e,o,r,t){"use strict";
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var n=function(e,o){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])})(e,o)};Object.create;Object.create;t.registerElement("CheckBox",(function(){return require("../checkbox").CheckBox}));var c={provide:r.NG_VALUE_ACCESSOR,useExisting:o.forwardRef((function(){return i})),multi:!0},i=function(e){function o(o){var r=e.call(this,o.nativeElement)||this;return r.onTouched=function(){},r}return function(e,o){function r(){this.constructor=e}n(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}(o,e),o.prototype.checkedChangeListener=function(e){this.onChange(e.value)},o.prototype.writeValue=function(e){this.view.checked=e},o.prototype.registerOnTouched=function(e){this.onTouched=e},o}(t.BaseValueAccessor);i.decorators=[{type:o.Directive,args:[{selector:"CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]",providers:[c]}]}],i.ctorParameters=function(){return[{type:o.ElementRef,decorators:[{type:o.Inject,args:[o.ElementRef]}]}]},i.propDecorators={checkedChangeListener:[{type:o.HostListener,args:["checkedChange",["$event"]]}]};var a=function(){};a.decorators=[{type:o.NgModule,args:[{declarations:[i],providers:[],imports:[r.FormsModule],exports:[r.FormsModule,i]}]}],e.CheckedValueAccessor=i,e.TNSCheckBoxModule=a,Object.defineProperty(e,"__esModule",{value:!0})}));
16
- //# sourceMappingURL=nativescript-checkbox-angular.umd.min.js.map
@@ -1,72 +0,0 @@
1
- import { Directive, ElementRef, forwardRef, HostListener, Inject, NgModule } from '@angular/core';
2
- import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { registerElement, BaseValueAccessor } from '@nativescript/angular';
4
- function convertToInt(value) {
5
- let normalizedValue;
6
- if (value === undefined || value === null) {
7
- normalizedValue = 0;
8
- }
9
- else {
10
- if (typeof value === 'number') {
11
- normalizedValue = value;
12
- }
13
- else {
14
- const parsedValue = parseInt(value.toString(), 10);
15
- normalizedValue = isNaN(parsedValue) ? 0 : parsedValue;
16
- }
17
- }
18
- return Math.round(normalizedValue);
19
- }
20
- registerElement('CheckBox', () => require('../checkbox').CheckBox);
21
- const CHECKED_VALUE_ACCESSOR = {
22
- provide: NG_VALUE_ACCESSOR,
23
- useExisting: forwardRef(() => CheckedValueAccessor),
24
- multi: true
25
- };
26
- /**
27
- * The accessor for setting checked property and listening to changes that is used by the
28
- * {@link NgModel} directives.
29
- *
30
- * ### Example
31
- * ```
32
- * <CheckBox [(ngModel)]="model.test">
33
- * ```
34
- */
35
- export class CheckedValueAccessor extends BaseValueAccessor {
36
- constructor(elementRef) {
37
- super(elementRef.nativeElement);
38
- this.onTouched = () => { };
39
- }
40
- checkedChangeListener(event) {
41
- this.onChange(event.value);
42
- }
43
- writeValue(value) {
44
- this.view.checked = value;
45
- }
46
- registerOnTouched(fn) {
47
- this.onTouched = fn;
48
- }
49
- }
50
- CheckedValueAccessor.decorators = [
51
- { type: Directive, args: [{
52
- selector: 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',
53
- providers: [CHECKED_VALUE_ACCESSOR]
54
- },] }
55
- ];
56
- CheckedValueAccessor.ctorParameters = () => [
57
- { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
58
- ];
59
- CheckedValueAccessor.propDecorators = {
60
- checkedChangeListener: [{ type: HostListener, args: ['checkedChange', ['$event'],] }]
61
- };
62
- export class TNSCheckBoxModule {
63
- }
64
- TNSCheckBoxModule.decorators = [
65
- { type: NgModule, args: [{
66
- declarations: [CheckedValueAccessor],
67
- providers: [],
68
- imports: [FormsModule],
69
- exports: [FormsModule, CheckedValueAccessor]
70
- },] }
71
- ];
72
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULFVBQVUsRUFDVixVQUFVLEVBQ1YsWUFBWSxFQUNaLE1BQU0sRUFDTixRQUFRLEVBQ1QsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFdBQVcsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxlQUFlLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUczRSxTQUFTLFlBQVksQ0FBQyxLQUFLO0lBQ3pCLElBQUksZUFBZSxDQU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HB1YmxpYyB3cml0ZVZhbHVlKHZhbHVlOiBhbnkpOiB2b2lkIHtcbiAgICB0aGlzLnZpZXcuY2hlY2tlZCA9IHZhbHVlO1xuICB9XG5cbiAgcHVibGljIHJlZ2lzdGVyT25Ub3VjaGVkKGZuOiAoKSA9PiB2b2lkKTogdm9pZCB7XG4gICAgdGhpcy5vblRvdWNoZWQgPSBmbjtcbiAgfVxufVxuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtDaGVja2VkVmFsdWVBY2Nlc3Nvcl0sXG4gIHByb3ZpZGVyczogW10sXG4gIGltcG9ydHM6IFtGb3Jtc01vZHVsZV0sXG4gIGV4cG9ydHM6IFtGb3Jtc01vZHVsZSwgQ2hlY2tlZFZhbHVlQWNjZXNzb3JdXG59KVxuZXhwb3J0IGNsYXNzIFROU0NoZWNrQm94TW9kdWxlIHt9XG4iXX0=
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlc2NyaXB0LWNoZWNrYm94LWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9uYXRpdmVzY3JpcHQtY2hlY2tib3gtYW5ndWxhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -1,79 +0,0 @@
1
- import { forwardRef, Directive, ElementRef, Inject, HostListener, NgModule } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
3
- import { registerElement, BaseValueAccessor } from '@nativescript/angular';
4
-
5
- function convertToInt(value) {
6
- let normalizedValue;
7
- if (value === undefined || value === null) {
8
- normalizedValue = 0;
9
- }
10
- else {
11
- if (typeof value === 'number') {
12
- normalizedValue = value;
13
- }
14
- else {
15
- const parsedValue = parseInt(value.toString(), 10);
16
- normalizedValue = isNaN(parsedValue) ? 0 : parsedValue;
17
- }
18
- }
19
- return Math.round(normalizedValue);
20
- }
21
- registerElement('CheckBox', () => require('../checkbox').CheckBox);
22
- const CHECKED_VALUE_ACCESSOR = {
23
- provide: NG_VALUE_ACCESSOR,
24
- useExisting: forwardRef(() => CheckedValueAccessor),
25
- multi: true
26
- };
27
- /**
28
- * The accessor for setting checked property and listening to changes that is used by the
29
- * {@link NgModel} directives.
30
- *
31
- * ### Example
32
- * ```
33
- * <CheckBox [(ngModel)]="model.test">
34
- * ```
35
- */
36
- class CheckedValueAccessor extends BaseValueAccessor {
37
- constructor(elementRef) {
38
- super(elementRef.nativeElement);
39
- this.onTouched = () => { };
40
- }
41
- checkedChangeListener(event) {
42
- this.onChange(event.value);
43
- }
44
- writeValue(value) {
45
- this.view.checked = value;
46
- }
47
- registerOnTouched(fn) {
48
- this.onTouched = fn;
49
- }
50
- }
51
- CheckedValueAccessor.decorators = [
52
- { type: Directive, args: [{
53
- selector: 'CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]',
54
- providers: [CHECKED_VALUE_ACCESSOR]
55
- },] }
56
- ];
57
- CheckedValueAccessor.ctorParameters = () => [
58
- { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
59
- ];
60
- CheckedValueAccessor.propDecorators = {
61
- checkedChangeListener: [{ type: HostListener, args: ['checkedChange', ['$event'],] }]
62
- };
63
- class TNSCheckBoxModule {
64
- }
65
- TNSCheckBoxModule.decorators = [
66
- { type: NgModule, args: [{
67
- declarations: [CheckedValueAccessor],
68
- providers: [],
69
- imports: [FormsModule],
70
- exports: [FormsModule, CheckedValueAccessor]
71
- },] }
72
- ];
73
-
74
- /**
75
- * Generated bundle index. Do not edit.
76
- */
77
-
78
- export { CheckedValueAccessor, TNSCheckBoxModule };
79
- //# sourceMappingURL=nativescript-checkbox-angular.js.map
@@ -1,24 +0,0 @@
1
- import { ElementRef } from '@angular/core';
2
- import { BaseValueAccessor } from '@nativescript/angular';
3
- import { View } from '@nativescript/core';
4
- export declare type CheckableView = {
5
- checked: boolean;
6
- } & View;
7
- /**
8
- * The accessor for setting checked property and listening to changes that is used by the
9
- * {@link NgModel} directives.
10
- *
11
- * ### Example
12
- * ```
13
- * <CheckBox [(ngModel)]="model.test">
14
- * ```
15
- */
16
- export declare class CheckedValueAccessor extends BaseValueAccessor<CheckableView> {
17
- constructor(elementRef: ElementRef);
18
- checkedChangeListener(event: any): void;
19
- onTouched: () => void;
20
- writeValue(value: any): void;
21
- registerOnTouched(fn: () => void): void;
22
- }
23
- export declare class TNSCheckBoxModule {
24
- }
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"metadata":{"CheckableView":{"__symbolic":"interface"},"CheckedValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@nativescript/angular","name":"BaseValueAccessor","line":51,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":46,"character":1},"arguments":[{"selector":"CheckBox[ngModel], CheckBox[formControlName], CheckBox[formControl], checkBox[ngModel], checkBox[formControlName], checkBox[formControl], check-box[ngModel], check-box[formControlName], check-box[formControl]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":30,"character":11},"useExisting":{"__symbolic":"reference","name":"CheckedValueAccessor"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":52,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":52,"character":22}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":52,"character":46}]}],"checkedChangeListener":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":56,"character":3},"arguments":["checkedChange",["$event"]]}]}],"writeValue":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}]}},"TNSCheckBoxModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":72,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CheckedValueAccessor"}],"providers":[],"imports":[{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":75,"character":12}],"exports":[{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":76,"character":12},{"__symbolic":"reference","name":"CheckedValueAccessor"}]}]}],"members":{}}},"origins":{"CheckableView":"./index","CheckedValueAccessor":"./index","TNSCheckBoxModule":"./index"},"importAs":"nativescript-checkbox-angular"}
@@ -1,19 +0,0 @@
1
- {
2
- "name": "nativescript-checkbox-angular",
3
- "main_ivy_ngcc": "../__ivy_ngcc__/angular/index.js",
4
- "__processed_by_ivy_ngcc__": {
5
- "main": "10.0.0",
6
- "typings": "10.0.0"
7
- },
8
- "main": "bundles/nativescript-checkbox-angular.umd.js",
9
- "module": "fesm2015/nativescript-checkbox-angular.js",
10
- "es2015": "fesm2015/nativescript-checkbox-angular.js",
11
- "esm2015": "esm2015/nativescript-checkbox-angular.js",
12
- "fesm2015": "fesm2015/nativescript-checkbox-angular.js",
13
- "typings": "nativescript-checkbox-angular.d.ts",
14
- "metadata": "nativescript-checkbox-angular.metadata.json",
15
- "sideEffects": false,
16
- "dependencies": {
17
- "tslib": "^2.0.0"
18
- }
19
- }