@coolon/angular-ui-powerups 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +14 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +59 -44
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.js +12 -4
- package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.js +20 -14
- package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js +20 -17
- package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +2 -4
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.js +3 -3
- package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/abstract-input.component.js +12 -4
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js +20 -14
- package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js +20 -17
- package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +2 -4
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js +1 -1
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/string-input/string-input.component.js +3 -3
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +60 -45
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +60 -45
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +8 -2
- package/lib/components/forms/abstract-list-input.component.d.ts +3 -3
- package/lib/components/forms/abstract-value-input.component.d.ts +3 -3
- package/package.json +4 -3
|
@@ -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,
|
|
20
|
+
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, EventListenerList, Form, MutableListModel, Guard, Binding, DebugContext, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, 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';
|
|
@@ -522,6 +522,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
522
522
|
__extends(AbstractInputComponent, _super);
|
|
523
523
|
function AbstractInputComponent() {
|
|
524
524
|
var _this = _super.call(this) || this;
|
|
525
|
+
_this.onValueEditedListeners = new EventListenerList();
|
|
525
526
|
_this.dense = false;
|
|
526
527
|
// TODO: fix this.
|
|
527
528
|
// tslint:disable-next-line:no-output-native
|
|
@@ -572,7 +573,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
572
573
|
};
|
|
573
574
|
Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
|
|
574
575
|
get: function () {
|
|
575
|
-
return this.
|
|
576
|
+
return this.formValueModel.enabled;
|
|
576
577
|
},
|
|
577
578
|
enumerable: true,
|
|
578
579
|
configurable: true
|
|
@@ -582,7 +583,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
582
583
|
};
|
|
583
584
|
Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
|
|
584
585
|
get: function () {
|
|
585
|
-
return this.
|
|
586
|
+
return this.formValueModel.errorList;
|
|
586
587
|
},
|
|
587
588
|
enumerable: true,
|
|
588
589
|
configurable: true
|
|
@@ -596,7 +597,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
596
597
|
});
|
|
597
598
|
Object.defineProperty(AbstractInputComponent.prototype, "focusContext", {
|
|
598
599
|
get: function () {
|
|
599
|
-
return this.
|
|
600
|
+
return this.formValueModel.focusContext;
|
|
600
601
|
},
|
|
601
602
|
enumerable: true,
|
|
602
603
|
configurable: true
|
|
@@ -615,6 +616,13 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
615
616
|
enumerable: true,
|
|
616
617
|
configurable: true
|
|
617
618
|
});
|
|
619
|
+
/**
|
|
620
|
+
* Invokes the callback when this components value is changed by a user edit.
|
|
621
|
+
* @param callback
|
|
622
|
+
*/
|
|
623
|
+
AbstractInputComponent.prototype.onValueEdited = function (callback) {
|
|
624
|
+
return this.onValueEditedListeners.add(callback);
|
|
625
|
+
};
|
|
618
626
|
__decorate([
|
|
619
627
|
Input(),
|
|
620
628
|
__metadata("design:type", String)
|
|
@@ -716,35 +724,41 @@ var AbstractListInputComponent = /** @class */ (function (_super) {
|
|
|
716
724
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
717
725
|
*/
|
|
718
726
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
719
|
-
_this.
|
|
727
|
+
_this.formValueModel = _this.registerDisposable(new Form.DelegatingListModel());
|
|
728
|
+
_this.componentListModel = new MutableListModel();
|
|
720
729
|
_this.setValueIsInProgress = new Guard();
|
|
721
730
|
_this.valueChange = new EventEmitter();
|
|
722
|
-
var
|
|
723
|
-
|
|
731
|
+
var _a = Dsl.disposeWith(_this), when = _a.when, valueOf = _a.valueOf, chain = _a.chain;
|
|
732
|
+
var binding = new Binding.Identity(_this.formValueModel, _this.componentListModel);
|
|
733
|
+
var inExternalChange = valueOf.any(_this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
|
|
734
|
+
when(_this.componentListModel).changes(function (is, was) {
|
|
735
|
+
_this.valueChange.emit(is);
|
|
736
|
+
_this.onValueEditedListeners.fire(function (l) { return l(is, was); });
|
|
737
|
+
}, {
|
|
724
738
|
initialValue: 'ignore',
|
|
725
|
-
|
|
739
|
+
// we never fire events during an external changes to the value. This allows
|
|
740
|
+
// the component to behave when used in the conventional angular
|
|
741
|
+
// fashion, i.e. [(value)]="..."
|
|
742
|
+
unless: inExternalChange
|
|
726
743
|
});
|
|
727
|
-
DebugContext.tag(_this.
|
|
744
|
+
DebugContext.tag(_this.formValueModel, _this.constructor.name + ".formValueModel");
|
|
728
745
|
return _this;
|
|
729
746
|
}
|
|
730
747
|
Object.defineProperty(AbstractListInputComponent.prototype, "value", {
|
|
748
|
+
// We add support for simple direct display of values by allowing components to be used
|
|
749
|
+
// by `component.value = ...` This use of the component without a value model in tables
|
|
750
|
+
// and the like.
|
|
731
751
|
set: function (value) {
|
|
732
752
|
var _this = this;
|
|
733
753
|
this.setValueIsInProgress.whileTrue(function () {
|
|
734
|
-
|
|
735
|
-
_this.listHolder = new MutableListModel(value);
|
|
736
|
-
_this.listModel = _this.listHolder;
|
|
737
|
-
}
|
|
738
|
-
else {
|
|
739
|
-
_this.listHolder.value = value;
|
|
740
|
-
}
|
|
754
|
+
_this.componentListModel.value = value;
|
|
741
755
|
});
|
|
742
756
|
},
|
|
743
757
|
enumerable: true,
|
|
744
758
|
configurable: true
|
|
745
759
|
});
|
|
746
760
|
__decorate([
|
|
747
|
-
Input(), TrackExternal({ delegateTo: '
|
|
761
|
+
Input(), TrackExternal({ delegateTo: 'formValueModel' }),
|
|
748
762
|
__metadata("design:type", Object)
|
|
749
763
|
], AbstractListInputComponent.prototype, "listModel", void 0);
|
|
750
764
|
__decorate([
|
|
@@ -778,38 +792,41 @@ var AbstractValueInputComponent = /** @class */ (function (_super) {
|
|
|
778
792
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
779
793
|
*/
|
|
780
794
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
781
|
-
_this.
|
|
795
|
+
_this.formValueModel = _this.registerDisposable(new Form.DelegatingValueModel());
|
|
782
796
|
_this.setValueInProgress = new Guard();
|
|
797
|
+
_this.componentValueModel = new MutableValueModel();
|
|
783
798
|
_this.valueChange = new EventEmitter();
|
|
784
|
-
var
|
|
785
|
-
|
|
799
|
+
var _a = Dsl.disposeWith(_this), when = _a.when, chain = _a.chain, valueOf = _a.valueOf;
|
|
800
|
+
var binding = new Binding.Identity(_this.formValueModel, _this.componentValueModel);
|
|
801
|
+
var inExternalChange = valueOf.any(_this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
|
|
802
|
+
when(_this.componentValueModel).changes(function (is, was) {
|
|
803
|
+
_this.valueChange.emit(is);
|
|
804
|
+
_this.onValueEditedListeners.fire(function (l) { return l(is, was); });
|
|
805
|
+
}, {
|
|
786
806
|
initialValue: 'ignore',
|
|
787
|
-
|
|
807
|
+
// we never fire events during an external set value operation. This allows
|
|
808
|
+
// the component to behave when used in the conventional angular
|
|
809
|
+
// fashion, i.e. [(value)]="..."
|
|
810
|
+
unless: inExternalChange
|
|
788
811
|
});
|
|
789
|
-
DebugContext.tag(_this.
|
|
812
|
+
DebugContext.tag(_this.formValueModel, _this.constructor.name + ".formValueModel");
|
|
790
813
|
return _this;
|
|
791
814
|
}
|
|
792
815
|
Object.defineProperty(AbstractValueInputComponent.prototype, "value", {
|
|
816
|
+
// We add support for simple direct display of values by allowing components to be used
|
|
817
|
+
// by `component.value = ...` This use of the component without a value model in tables
|
|
818
|
+
// and the like.
|
|
793
819
|
set: function (value) {
|
|
794
820
|
var _this = this;
|
|
795
|
-
// we never fire events during an external set value operation. This allows
|
|
796
|
-
// the component to behave when used in the conventional angular
|
|
797
|
-
// fashion, i.e. [(value)]="..."
|
|
798
821
|
this.setValueInProgress.whileTrue(function () {
|
|
799
|
-
|
|
800
|
-
_this.valueHolder = new MutableValueModel(value);
|
|
801
|
-
_this.valueModel = _this.valueHolder;
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
_this.valueHolder.value = value;
|
|
805
|
-
}
|
|
822
|
+
_this.componentValueModel.value = value;
|
|
806
823
|
});
|
|
807
824
|
},
|
|
808
825
|
enumerable: true,
|
|
809
826
|
configurable: true
|
|
810
827
|
});
|
|
811
828
|
__decorate([
|
|
812
|
-
Input(), TrackExternal({ delegateTo: '
|
|
829
|
+
Input(), TrackExternal({ delegateTo: 'formValueModel' }),
|
|
813
830
|
__metadata("design:type", Object)
|
|
814
831
|
], AbstractValueInputComponent.prototype, "valueModel", void 0);
|
|
815
832
|
__decorate([
|
|
@@ -847,8 +864,6 @@ var AutocompleteInputComponent = /** @class */ (function (_super) {
|
|
|
847
864
|
.select(function (option) {
|
|
848
865
|
return ___default.isEmpty(_this.filterValue.value) || _this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
849
866
|
}, { dependsOn: lowerCaseFilterValue });
|
|
850
|
-
var txo = new TransactionObserver().onEvent(function (e) { return console.log(e.name, e.payload); });
|
|
851
|
-
txo.observe('this.valueModel', _this.valueModel);
|
|
852
867
|
return _this;
|
|
853
868
|
}
|
|
854
869
|
AutocompleteInputComponent.prototype.ngOnInit = function () {
|
|
@@ -889,7 +904,7 @@ var AutocompleteInputComponent = /** @class */ (function (_super) {
|
|
|
889
904
|
AutocompleteInputComponent = __decorate([
|
|
890
905
|
Component({
|
|
891
906
|
selector: 'aup-autocomplete-input',
|
|
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]=\"
|
|
907
|
+
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]=\"componentValueModel.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",
|
|
893
908
|
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
894
909
|
}),
|
|
895
910
|
__metadata("design:paramtypes", [])
|
|
@@ -920,7 +935,7 @@ var CheckboxInputComponent = /** @class */ (function (_super) {
|
|
|
920
935
|
CheckboxInputComponent = __decorate([
|
|
921
936
|
Component({
|
|
922
937
|
selector: 'aup-checkbox-input',
|
|
923
|
-
template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"
|
|
938
|
+
template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"componentValueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
|
|
924
939
|
styles: [":host{display:inline-flex;flex-direction:column;padding:24px 0 16px}:host.dense{padding:6px 0 2px}mat-error,mat-hint{margin-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}"]
|
|
925
940
|
}),
|
|
926
941
|
__metadata("design:paramtypes", [])
|
|
@@ -967,7 +982,7 @@ var MultipleSelectInputComponent = /** @class */ (function (_super) {
|
|
|
967
982
|
MultipleSelectInputComponent = __decorate([
|
|
968
983
|
Component({
|
|
969
984
|
selector: 'aup-multiple-select-input',
|
|
970
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"
|
|
985
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n multiple\n [(ngModel)]=\"componentListModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
971
986
|
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
972
987
|
}),
|
|
973
988
|
__metadata("design:paramtypes", [])
|
|
@@ -998,7 +1013,7 @@ var NumberInputComponent = /** @class */ (function (_super) {
|
|
|
998
1013
|
NumberInputComponent = __decorate([
|
|
999
1014
|
Component({
|
|
1000
1015
|
selector: 'aup-number-input',
|
|
1001
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
1016
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint && !dense\" >{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
1002
1017
|
styles: [""]
|
|
1003
1018
|
}),
|
|
1004
1019
|
__metadata("design:paramtypes", [])
|
|
@@ -1018,7 +1033,7 @@ var PasswordInputComponent = /** @class */ (function (_super) {
|
|
|
1018
1033
|
PasswordInputComponent = __decorate([
|
|
1019
1034
|
Component({
|
|
1020
1035
|
selector: 'aup-password-input',
|
|
1021
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
1036
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
1022
1037
|
styles: [""]
|
|
1023
1038
|
}),
|
|
1024
1039
|
__metadata("design:paramtypes", [])
|
|
@@ -1073,7 +1088,7 @@ var SelectInputComponent = /** @class */ (function (_super) {
|
|
|
1073
1088
|
SelectInputComponent = __decorate([
|
|
1074
1089
|
Component({
|
|
1075
1090
|
selector: 'aup-select-input',
|
|
1076
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
1091
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
1077
1092
|
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
1078
1093
|
}),
|
|
1079
1094
|
__metadata("design:paramtypes", [])
|
|
@@ -1087,9 +1102,9 @@ var StringInputComponent = /** @class */ (function (_super) {
|
|
|
1087
1102
|
var _this = _super.call(this) || this;
|
|
1088
1103
|
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1089
1104
|
_this.clearCommand = Command.create(function () {
|
|
1090
|
-
_this.
|
|
1105
|
+
_this.componentValueModel.value = null;
|
|
1091
1106
|
});
|
|
1092
|
-
_this.clearCommand.disableWhile(chain.stringValue(_this.
|
|
1107
|
+
_this.clearCommand.disableWhile(chain.stringValue(_this.componentValueModel).isBlank());
|
|
1093
1108
|
return _this;
|
|
1094
1109
|
}
|
|
1095
1110
|
StringInputComponent.prototype.ngOnInit = function () {
|
|
@@ -1105,7 +1120,7 @@ var StringInputComponent = /** @class */ (function (_super) {
|
|
|
1105
1120
|
StringInputComponent = __decorate([
|
|
1106
1121
|
Component({
|
|
1107
1122
|
selector: 'aup-string-input',
|
|
1108
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
1123
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n</mat-form-field>\n\n",
|
|
1109
1124
|
styles: ["button[disabled]{visibility:hidden}"]
|
|
1110
1125
|
}),
|
|
1111
1126
|
__metadata("design:paramtypes", [])
|
|
@@ -1136,7 +1151,7 @@ var TextInputComponent = /** @class */ (function (_super) {
|
|
|
1136
1151
|
TextInputComponent = __decorate([
|
|
1137
1152
|
Component({
|
|
1138
1153
|
selector: 'aup-text-input',
|
|
1139
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"
|
|
1154
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
1140
1155
|
styles: ["button[disabled]{visibility:hidden}textarea{overflow:auto}"]
|
|
1141
1156
|
}),
|
|
1142
1157
|
__metadata("design:paramtypes", [])
|