@coolon/angular-ui-powerups 2.0.0-alpha.14 → 2.0.0-alpha.16

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.
@@ -17,7 +17,7 @@ import { MatTableModule } from '@angular/material/table';
17
17
  import { MatTooltipModule } from '@angular/material/tooltip';
18
18
  import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
19
19
  import { fas } from '@fortawesome/free-solid-svg-icons';
20
- import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Binding, Functions } from '@coolon/pectin';
20
+ import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, TransactionObserver, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Binding, Functions } from '@coolon/pectin';
21
21
  import ___default, { isEqual, isNil } from 'lodash';
22
22
  import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
23
23
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
@@ -847,13 +847,21 @@ var AutocompleteInputComponent = /** @class */ (function (_super) {
847
847
  .select(function (option) {
848
848
  return ___default.isEmpty(_this.filterValue.value) || _this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
849
849
  }, { dependsOn: lowerCaseFilterValue });
850
+ var txo = new TransactionObserver().onEvent(function (e) { return console.log(e.name, e.payload); });
851
+ txo.observe('this.valueModel', _this.valueModel);
850
852
  return _this;
851
853
  }
852
854
  AutocompleteInputComponent.prototype.ngOnInit = function () {
853
855
  };
856
+ AutocompleteInputComponent.prototype.formatOption = function (option) {
857
+ return this.optionLabelFormat(option);
858
+ };
854
859
  AutocompleteInputComponent.prototype.updateFilter = function ($event) {
855
860
  this.filterValue.value = $event;
856
861
  };
862
+ AutocompleteInputComponent.prototype.onSelect = function ($event) {
863
+ this.valueModel.value = $event.option.value;
864
+ };
857
865
  __decorate([
858
866
  Input(), TrackExternal(),
859
867
  __metadata("design:type", ListModel)
@@ -881,7 +889,7 @@ var AutocompleteInputComponent = /** @class */ (function (_super) {
881
889
  AutocompleteInputComponent = __decorate([
882
890
  Component({
883
891
  selector: 'aup-autocomplete-input',
884
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"optionLabelFormat(valueModel.value)\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{optionLabelFormat(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
892
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"valueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
885
893
  styles: [":host{display:inline-block}mat-form-field{width:100%}"]
886
894
  }),
887
895
  __metadata("design:paramtypes", [])