@coolon/angular-ui-powerups 0.0.130 → 0.0.134

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 (23) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +39 -8
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/components/components.module.js +5 -1
  7. package/esm2015/lib/components/components.module.js.map +1 -1
  8. package/esm2015/lib/components/components.module.metadata.json +1 -1
  9. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  10. package/esm2015/lib/components/forms/string-input/string-input.component.js +33 -3
  11. package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
  12. package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
  13. package/esm5/lib/components/components.module.js +5 -1
  14. package/esm5/lib/components/components.module.js.map +1 -1
  15. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  16. package/esm5/lib/components/forms/string-input/string-input.component.js +34 -4
  17. package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
  18. package/fesm2015/coolon-angular-ui-powerups.js +38 -7
  19. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  20. package/fesm5/coolon-angular-ui-powerups.js +40 -8
  21. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  22. package/lib/components/forms/string-input/string-input.component.d.ts +4 -0
  23. package/package.json +1 -1
@@ -1,16 +1,17 @@
1
1
  import { DOCUMENT, CommonModule, Location } from '@angular/common';
2
2
  import { Directive, ElementRef, Inject, Input, HostListener, NgZone, NgModule, EventEmitter, Output, Component, ContentChild, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, Optional, SkipSelf, HostBinding } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
- import { MatInputModule, MatFormFieldModule, MatSelectModule, MatButtonModule, MatDialogModule, MatTabsModule as MatTabsModule$1, MatProgressSpinnerModule, MatDialog } from '@angular/material';
4
+ import { MatInputModule, MatFormFieldModule, MatSelectModule, MatButtonModule as MatButtonModule$1, MatDialogModule, MatTabsModule as MatTabsModule$1, MatProgressSpinnerModule, MatDialog } from '@angular/material';
5
5
  import { MatTabsModule } from '@angular/material/tabs';
6
6
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, Deferred, Trace, MutableListModel, MutableValueModel, Guard, DebugContext, Binding, StoreInValueModel, Command, ValueHolder } from '@coolon/pectin';
7
+ import { MatButtonModule } from '@angular/material/button';
8
+ import { MatIconModule } from '@angular/material/icon';
9
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, Command, StoreInValueModel, Deferred, Trace, MutableListModel, MutableValueModel, Guard, DebugContext, Binding, ValueHolder } from '@coolon/pectin';
8
10
  import { __decorate, __metadata, __awaiter } from 'tslib';
9
11
  import { PortalModule } from '@angular/cdk/portal';
10
12
  import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel } from '@angular/router';
11
13
  import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
12
14
  import ___default, { isEqual, isNil } from 'lodash';
13
- import { MatIconModule } from '@angular/material/icon';
14
15
  import { MatListModule } from '@angular/material/list';
15
16
  import { MatTooltipModule } from '@angular/material/tooltip';
16
17
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
@@ -691,6 +692,14 @@ if (false) {
691
692
  class StringInputComponent extends AbstractInputComponent {
692
693
  constructor() {
693
694
  super();
695
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
696
+ this.clearCommand = Command.create((/**
697
+ * @return {?}
698
+ */
699
+ () => {
700
+ this.valueModel.value = null;
701
+ }));
702
+ this.clearCommand.disableWhile(chain.stringValue(this.valueModel).isBlank());
694
703
  }
695
704
  /**
696
705
  * @return {?}
@@ -701,12 +710,32 @@ class StringInputComponent extends AbstractInputComponent {
701
710
  StringInputComponent.decorators = [
702
711
  { type: Component, args: [{
703
712
  selector: 'aup-string-input',
704
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
705
- styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
713
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <mat-icon>close</mat-icon>\n </button>\n</mat-form-field>\n\n",
714
+ styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}button[disabled]{visibility:hidden}"]
706
715
  }] }
707
716
  ];
708
717
  /** @nocollapse */
709
718
  StringInputComponent.ctorParameters = () => [];
719
+ StringInputComponent.propDecorators = {
720
+ enableClearModel: [{ type: Input }],
721
+ enableClear: [{ type: Input }]
722
+ };
723
+ __decorate([
724
+ UseDelegate({ defaultValue: false }),
725
+ __metadata("design:type", ValueModel)
726
+ ], StringInputComponent.prototype, "enableClearModel", void 0);
727
+ __decorate([
728
+ StoreInValueModel('enableClearModel'),
729
+ __metadata("design:type", Boolean)
730
+ ], StringInputComponent.prototype, "enableClear", void 0);
731
+ if (false) {
732
+ /** @type {?} */
733
+ StringInputComponent.prototype.enableClearModel;
734
+ /** @type {?} */
735
+ StringInputComponent.prototype.enableClear;
736
+ /** @type {?} */
737
+ StringInputComponent.prototype.clearCommand;
738
+ }
710
739
 
711
740
  /**
712
741
  * @fileoverview added by tsickle
@@ -749,7 +778,9 @@ ComponentsModule.decorators = [
749
778
  MatFormFieldModule,
750
779
  MatSelectModule,
751
780
  MatTabsModule,
752
- DirectivesModule
781
+ DirectivesModule,
782
+ MatIconModule,
783
+ MatButtonModule
753
784
  ],
754
785
  exports: [
755
786
  NumberInputComponent,
@@ -2207,7 +2238,7 @@ InteractionModule.decorators = [
2207
2238
  { type: NgModule, args: [{
2208
2239
  imports: [
2209
2240
  CommonModule,
2210
- MatButtonModule,
2241
+ MatButtonModule$1,
2211
2242
  MatDialogModule,
2212
2243
  MatTabsModule$1,
2213
2244
  PortalModule,