@ionic/angular 7.3.4-dev.11696436834.1e83c799 → 7.3.4-dev.11699470772.1dad7e66

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 (64) hide show
  1. package/common/index.d.ts +0 -2
  2. package/directives/control-value-accessors/boolean-value-accessor.d.ts +1 -1
  3. package/directives/control-value-accessors/numeric-value-accessor.d.ts +1 -1
  4. package/directives/control-value-accessors/radio-value-accessor.d.ts +1 -1
  5. package/directives/control-value-accessors/select-value-accessor.d.ts +1 -1
  6. package/directives/control-value-accessors/text-value-accessor.d.ts +1 -1
  7. package/{common/directives → directives}/control-value-accessors/value-accessor.d.ts +2 -2
  8. package/esm2020/app-initialize.mjs +2 -2
  9. package/esm2020/common/index.mjs +1 -3
  10. package/esm2020/directives/control-value-accessors/boolean-value-accessor.mjs +4 -4
  11. package/esm2020/directives/control-value-accessors/numeric-value-accessor.mjs +2 -2
  12. package/esm2020/directives/control-value-accessors/radio-value-accessor.mjs +3 -6
  13. package/esm2020/directives/control-value-accessors/select-value-accessor.mjs +2 -2
  14. package/esm2020/directives/control-value-accessors/text-value-accessor.mjs +2 -2
  15. package/esm2020/directives/control-value-accessors/value-accessor.mjs +141 -0
  16. package/esm2020/standalone/directives/proxies.mjs +693 -1
  17. package/esm2020/standalone/index.mjs +2 -2
  18. package/esm2020/standalone/navigation/router-link-delegate.mjs +12 -10
  19. package/esm2020/util/util.mjs +10 -0
  20. package/fesm2015/ionic-angular-common.mjs +1 -149
  21. package/fesm2015/ionic-angular-common.mjs.map +1 -1
  22. package/fesm2015/ionic-angular-standalone.mjs +793 -888
  23. package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
  24. package/fesm2015/ionic-angular.mjs +152 -8
  25. package/fesm2015/ionic-angular.mjs.map +1 -1
  26. package/fesm2020/ionic-angular-common.mjs +1 -149
  27. package/fesm2020/ionic-angular-common.mjs.map +1 -1
  28. package/fesm2020/ionic-angular-standalone.mjs +793 -888
  29. package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
  30. package/fesm2020/ionic-angular.mjs +152 -8
  31. package/fesm2020/ionic-angular.mjs.map +1 -1
  32. package/package.json +2 -2
  33. package/standalone/directives/proxies.d.ts +314 -0
  34. package/standalone/index.d.ts +1 -1
  35. package/standalone/navigation/router-link-delegate.d.ts +2 -2
  36. package/common/directives/control-value-accessors/index.d.ts +0 -1
  37. package/esm2020/common/directives/control-value-accessors/index.mjs +0 -2
  38. package/esm2020/common/directives/control-value-accessors/value-accessor.mjs +0 -141
  39. package/esm2020/common/utils/util.mjs +0 -10
  40. package/esm2020/standalone/directives/checkbox.mjs +0 -73
  41. package/esm2020/standalone/directives/datetime.mjs +0 -90
  42. package/esm2020/standalone/directives/index.mjs +0 -13
  43. package/esm2020/standalone/directives/input.mjs +0 -112
  44. package/esm2020/standalone/directives/radio-group.mjs +0 -58
  45. package/esm2020/standalone/directives/radio.mjs +0 -62
  46. package/esm2020/standalone/directives/range.mjs +0 -77
  47. package/esm2020/standalone/directives/searchbar.mjs +0 -80
  48. package/esm2020/standalone/directives/segment.mjs +0 -58
  49. package/esm2020/standalone/directives/select.mjs +0 -81
  50. package/esm2020/standalone/directives/textarea.mjs +0 -90
  51. package/esm2020/standalone/directives/toggle.mjs +0 -73
  52. package/standalone/directives/checkbox.d.ts +0 -30
  53. package/standalone/directives/datetime.d.ts +0 -30
  54. package/standalone/directives/index.d.ts +0 -12
  55. package/standalone/directives/input.d.ts +0 -47
  56. package/standalone/directives/radio-group.d.ts +0 -18
  57. package/standalone/directives/radio.d.ts +0 -22
  58. package/standalone/directives/range.d.ts +0 -47
  59. package/standalone/directives/searchbar.d.ts +0 -45
  60. package/standalone/directives/segment.d.ts +0 -19
  61. package/standalone/directives/select.d.ts +0 -34
  62. package/standalone/directives/textarea.d.ts +0 -37
  63. package/standalone/directives/toggle.d.ts +0 -28
  64. /package/{common/utils → util}/util.d.ts +0 -0
@@ -8,7 +8,6 @@ import { DOCUMENT } from '@angular/common';
8
8
  import { Subject, fromEvent, BehaviorSubject, combineLatest, of } from 'rxjs';
9
9
  import { __decorate } from 'tslib';
10
10
  import { filter, switchMap, distinctUntilChanged } from 'rxjs/operators';
11
- import { NgControl } from '@angular/forms';
12
11
 
13
12
  // TODO(FW-2827): types
14
13
  class OverlayBaseController {
@@ -2399,153 +2398,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
2399
2398
  args: ['ionTabButtonClick', ['$event']]
2400
2399
  }] } });
2401
2400
 
2402
- const raf = (h) => {
2403
- if (typeof __zone_symbol__requestAnimationFrame === 'function') {
2404
- return __zone_symbol__requestAnimationFrame(h);
2405
- }
2406
- if (typeof requestAnimationFrame === 'function') {
2407
- return requestAnimationFrame(h);
2408
- }
2409
- return setTimeout(h);
2410
- };
2411
-
2412
- // TODO(FW-2827): types
2413
- class ValueAccessor {
2414
- constructor(injector, elementRef) {
2415
- this.injector = injector;
2416
- this.elementRef = elementRef;
2417
- this.onChange = () => {
2418
- /**/
2419
- };
2420
- this.onTouched = () => {
2421
- /**/
2422
- };
2423
- }
2424
- writeValue(value) {
2425
- this.elementRef.nativeElement.value = this.lastValue = value;
2426
- setIonicClasses(this.elementRef);
2427
- }
2428
- /**
2429
- * Notifies the ControlValueAccessor of a change in the value of the control.
2430
- *
2431
- * This is called by each of the ValueAccessor directives when we want to update
2432
- * the status and validity of the form control. For example with text components this
2433
- * is called when the ionInput event is fired. For select components this is called
2434
- * when the ionChange event is fired.
2435
- *
2436
- * This also updates the Ionic form status classes on the element.
2437
- *
2438
- * @param el The component element.
2439
- * @param value The new value of the control.
2440
- */
2441
- handleValueChange(el, value) {
2442
- if (el === this.elementRef.nativeElement) {
2443
- if (value !== this.lastValue) {
2444
- this.lastValue = value;
2445
- this.onChange(value);
2446
- }
2447
- setIonicClasses(this.elementRef);
2448
- }
2449
- }
2450
- _handleBlurEvent(el) {
2451
- if (el === this.elementRef.nativeElement) {
2452
- this.onTouched();
2453
- setIonicClasses(this.elementRef);
2454
- }
2455
- }
2456
- registerOnChange(fn) {
2457
- this.onChange = fn;
2458
- }
2459
- registerOnTouched(fn) {
2460
- this.onTouched = fn;
2461
- }
2462
- setDisabledState(isDisabled) {
2463
- this.elementRef.nativeElement.disabled = isDisabled;
2464
- }
2465
- ngOnDestroy() {
2466
- if (this.statusChanges) {
2467
- this.statusChanges.unsubscribe();
2468
- }
2469
- }
2470
- ngAfterViewInit() {
2471
- let ngControl;
2472
- try {
2473
- ngControl = this.injector.get(NgControl);
2474
- }
2475
- catch {
2476
- /* No FormControl or ngModel binding */
2477
- }
2478
- if (!ngControl) {
2479
- return;
2480
- }
2481
- // Listen for changes in validity, disabled, or pending states
2482
- if (ngControl.statusChanges) {
2483
- this.statusChanges = ngControl.statusChanges.subscribe(() => setIonicClasses(this.elementRef));
2484
- }
2485
- /**
2486
- * TODO FW-2787: Remove this in favor of https://github.com/angular/angular/issues/10887
2487
- * whenever it is implemented.
2488
- */
2489
- const formControl = ngControl.control;
2490
- if (formControl) {
2491
- const methodsToPatch = ['markAsTouched', 'markAllAsTouched', 'markAsUntouched', 'markAsDirty', 'markAsPristine'];
2492
- methodsToPatch.forEach((method) => {
2493
- if (typeof formControl[method] !== 'undefined') {
2494
- const oldFn = formControl[method].bind(formControl);
2495
- formControl[method] = (...params) => {
2496
- oldFn(...params);
2497
- setIonicClasses(this.elementRef);
2498
- };
2499
- }
2500
- });
2501
- }
2502
- }
2503
- }
2504
- /** @nocollapse */ ValueAccessor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValueAccessor, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2505
- /** @nocollapse */ ValueAccessor.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ValueAccessor, host: { listeners: { "ionBlur": "_handleBlurEvent($event.target)" } }, ngImport: i0 });
2506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ValueAccessor, decorators: [{
2507
- type: Directive
2508
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { _handleBlurEvent: [{
2509
- type: HostListener,
2510
- args: ['ionBlur', ['$event.target']]
2511
- }] } });
2512
- const setIonicClasses = (element) => {
2513
- raf(() => {
2514
- const input = element.nativeElement;
2515
- const hasValue = input.value != null && input.value.toString().length > 0;
2516
- const classes = getClasses(input);
2517
- setClasses(input, classes);
2518
- const item = input.closest('ion-item');
2519
- if (item) {
2520
- if (hasValue) {
2521
- setClasses(item, [...classes, 'item-has-value']);
2522
- }
2523
- else {
2524
- setClasses(item, classes);
2525
- }
2526
- }
2527
- });
2528
- };
2529
- const getClasses = (element) => {
2530
- const classList = element.classList;
2531
- const classes = [];
2532
- for (let i = 0; i < classList.length; i++) {
2533
- const item = classList.item(i);
2534
- if (item !== null && startsWith(item, 'ng-')) {
2535
- classes.push(`ion-${item.substring(3)}`);
2536
- }
2537
- }
2538
- return classes;
2539
- };
2540
- const setClasses = (element, classes) => {
2541
- const classList = element.classList;
2542
- classList.remove('ion-valid', 'ion-invalid', 'ion-touched', 'ion-untouched', 'ion-dirty', 'ion-pristine');
2543
- classList.add(...classes);
2544
- };
2545
- const startsWith = (input, search) => {
2546
- return input.substring(0, search.length) === search;
2547
- };
2548
-
2549
2401
  /**
2550
2402
  * Provides a way to customize when activated routes get reused.
2551
2403
  */
@@ -2605,5 +2457,5 @@ class IonicRouteStrategy {
2605
2457
  * Generated bundle index. Do not edit.
2606
2458
  */
2607
2459
 
2608
- export { ActionSheetController, AlertController, AngularDelegate, AnimationController, Config, ConfigToken, DomController, GestureController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, LoadingController, MenuController, ModalController, NavController, NavParams, PickerController, Platform, PopoverController, ProxyCmp, RouterLinkDelegateDirective, RouterLinkWithHrefDelegateDirective, ToastController, ValueAccessor, bindLifecycleEvents, provideComponentInputBinding, raf, setIonicClasses };
2460
+ export { ActionSheetController, AlertController, AngularDelegate, AnimationController, Config, ConfigToken, DomController, GestureController, IonBackButton, IonModal, IonNav, IonPopover, IonRouterOutlet, IonTabs, IonicRouteStrategy, LoadingController, MenuController, ModalController, NavController, NavParams, PickerController, Platform, PopoverController, ProxyCmp, RouterLinkDelegateDirective, RouterLinkWithHrefDelegateDirective, ToastController, bindLifecycleEvents, provideComponentInputBinding };
2609
2461
  //# sourceMappingURL=ionic-angular-common.mjs.map