@coolon/angular-ui-powerups 0.0.129 → 0.0.133
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/bundles/coolon-angular-ui-powerups.umd.js +48 -8
- 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.js +5 -1
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +11 -2
- 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 +32 -2
- 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/esm5/lib/components/components.module.js +5 -1
- package/esm5/lib/components/components.module.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +11 -2
- 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 +33 -3
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +48 -8
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +50 -9
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/select-input/select-input.component.d.ts +4 -1
- package/lib/components/forms/string-input/string-input.component.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
4
|
*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component } from '@angular/core';
|
|
6
|
+
import { Component, Input } from '@angular/core';
|
|
7
|
+
import { Command, Dsl, StoreInValueModel, UseDelegate, ValueModel } from '@coolon/pectin';
|
|
7
8
|
import { AbstractInputComponent } from '../abstract-input.component';
|
|
8
9
|
var StringInputComponent = /** @class */ (function (_super) {
|
|
9
10
|
tslib_1.__extends(StringInputComponent, _super);
|
|
10
11
|
function StringInputComponent() {
|
|
11
|
-
|
|
12
|
+
var _this = _super.call(this) || this;
|
|
13
|
+
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;
|
|
14
|
+
_this.clearCommand = Command.create((/**
|
|
15
|
+
* @return {?}
|
|
16
|
+
*/
|
|
17
|
+
function () {
|
|
18
|
+
_this.valueModel.value = null;
|
|
19
|
+
}));
|
|
20
|
+
_this.clearCommand.disableWhile(chain(_this.valueModel).isNil());
|
|
21
|
+
return _this;
|
|
12
22
|
}
|
|
13
23
|
/**
|
|
14
24
|
* @return {?}
|
|
@@ -21,13 +31,33 @@ var StringInputComponent = /** @class */ (function (_super) {
|
|
|
21
31
|
StringInputComponent.decorators = [
|
|
22
32
|
{ type: Component, args: [{
|
|
23
33
|
selector: 'aup-string-input',
|
|
24
|
-
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",
|
|
34
|
+
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=\"allowClear && clearCommand.enabled.value\" [pectinCommand]=\"clearCommand\">\n <mat-icon>close</mat-icon>\n </button>\n</mat-form-field>\n\n",
|
|
25
35
|
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
26
36
|
}] }
|
|
27
37
|
];
|
|
28
38
|
/** @nocollapse */
|
|
29
39
|
StringInputComponent.ctorParameters = function () { return []; };
|
|
40
|
+
StringInputComponent.propDecorators = {
|
|
41
|
+
allowClearModel: [{ type: Input }],
|
|
42
|
+
allowClear: [{ type: Input }]
|
|
43
|
+
};
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
UseDelegate({ defaultValue: false }),
|
|
46
|
+
tslib_1.__metadata("design:type", ValueModel)
|
|
47
|
+
], StringInputComponent.prototype, "allowClearModel", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
StoreInValueModel('allowClearModel'),
|
|
50
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
51
|
+
], StringInputComponent.prototype, "allowClear", void 0);
|
|
30
52
|
return StringInputComponent;
|
|
31
53
|
}(AbstractInputComponent));
|
|
32
54
|
export { StringInputComponent };
|
|
55
|
+
if (false) {
|
|
56
|
+
/** @type {?} */
|
|
57
|
+
StringInputComponent.prototype.allowClearModel;
|
|
58
|
+
/** @type {?} */
|
|
59
|
+
StringInputComponent.prototype.allowClear;
|
|
60
|
+
/** @type {?} */
|
|
61
|
+
StringInputComponent.prototype.clearCommand;
|
|
62
|
+
}
|
|
33
63
|
//# sourceMappingURL=string-input.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/string-input/string-input.component.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"string-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/string-input/string-input.component.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;IAK0C,gDAA8B;IAUtE;QAAA,YACE,iBAAO,SAMR;QALO,IAAA,2BAAkF,EAAhF,gBAAK,EAAE,oBAAO,EAAE,kBAAM,EAAE,cAAI,EAAE,gBAAK,EAAE,oBAAO,EAAE,sBAAkC;QACxF,KAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM;;;QAAC;YACjC,KAAI,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC;QAC/B,CAAC,EAAC,CAAC;QACH,KAAI,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,KAAI,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;;IACjE,CAAC;;;;IAED,uCAAQ;;;IAAR;IACA,CAAC;;gBAzBF,SAAS,SAAC;oBACT,QAAQ,EAAE,kBAAkB;oBAC5B,ixBAA4C;;iBAE7C;;;;;kCAGE,KAAK;6BAGL,KAAK;;IAFN;QADU,WAAW,CAAC,EAAC,YAAY,EAAE,KAAK,EAAC,CAAC;0CAC3B,UAAU;iEAAU;IAGrC;QADU,iBAAiB,CAAC,iBAAiB,CAAC;;4DAC1B;IAgBtB,2BAAC;CAAA,AA3BD,CAK0C,sBAAsB,GAsB/D;SAtBY,oBAAoB;;;IAE/B,+CACqC;;IAErC,0CACoB;;IAEpB,4CAAqC","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { Command, Dsl, StoreInValueModel, UseDelegate, ValueModel } from '@coolon/pectin';\nimport { AbstractInputComponent } from '../abstract-input.component';\n\n@Component({\n selector: 'aup-string-input',\n templateUrl: './string-input.component.html',\n styleUrls: ['./string-input.component.scss']\n})\nexport class StringInputComponent extends AbstractInputComponent<string> implements OnInit {\n\n @Input() @UseDelegate({defaultValue: false})\n allowClearModel: ValueModel<boolean>;\n\n @Input() @StoreInValueModel('allowClearModel')\n allowClear: boolean;\n\n readonly clearCommand: Command<void>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.clearCommand = Command.create(() => {\n this.valueModel.value = null;\n });\n this.clearCommand.disableWhile(chain(this.valueModel).isNil());\n }\n\n ngOnInit() {\n }\n\n}\n"]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { DOCUMENT, CommonModule, Location } from '@angular/common';
|
|
2
|
-
import { Directive, ElementRef, Inject, Input, HostListener, NgZone, NgModule, EventEmitter, Output, Component, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Injectable, ɵɵdefineInjectable, ɵɵinject, Optional, SkipSelf, HostBinding } from '@angular/core';
|
|
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 {
|
|
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';
|
|
@@ -644,7 +645,7 @@ class SelectInputComponent extends AbstractInputComponent {
|
|
|
644
645
|
SelectInputComponent.decorators = [
|
|
645
646
|
{ type: Component, args: [{
|
|
646
647
|
selector: 'aup-select-input',
|
|
647
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select 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-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
648
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select 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-option *ngIf=\"allowNil\">{{placeholder}}</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=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
648
649
|
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
649
650
|
}] }
|
|
650
651
|
];
|
|
@@ -654,6 +655,9 @@ SelectInputComponent.propDecorators = {
|
|
|
654
655
|
optionsModel: [{ type: Input }],
|
|
655
656
|
options: [{ type: Input }],
|
|
656
657
|
optionLabel: [{ type: Input }],
|
|
658
|
+
allowNil: [{ type: Input }],
|
|
659
|
+
optionTemplateRef: [{ type: ContentChild, args: ["optionTemplate", { static: false },] }],
|
|
660
|
+
nilOptionTemplateRef: [{ type: ContentChild, args: ["nilOptionTemplate", { static: false },] }],
|
|
657
661
|
optionLabelFormat: [{ type: Input }]
|
|
658
662
|
};
|
|
659
663
|
__decorate([
|
|
@@ -672,6 +676,12 @@ if (false) {
|
|
|
672
676
|
/** @type {?} */
|
|
673
677
|
SelectInputComponent.prototype.optionLabel;
|
|
674
678
|
/** @type {?} */
|
|
679
|
+
SelectInputComponent.prototype.allowNil;
|
|
680
|
+
/** @type {?} */
|
|
681
|
+
SelectInputComponent.prototype.optionTemplateRef;
|
|
682
|
+
/** @type {?} */
|
|
683
|
+
SelectInputComponent.prototype.nilOptionTemplateRef;
|
|
684
|
+
/** @type {?} */
|
|
675
685
|
SelectInputComponent.prototype.optionLabelFormat;
|
|
676
686
|
}
|
|
677
687
|
|
|
@@ -682,6 +692,14 @@ if (false) {
|
|
|
682
692
|
class StringInputComponent extends AbstractInputComponent {
|
|
683
693
|
constructor() {
|
|
684
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(this.valueModel).isNil());
|
|
685
703
|
}
|
|
686
704
|
/**
|
|
687
705
|
* @return {?}
|
|
@@ -692,12 +710,32 @@ class StringInputComponent extends AbstractInputComponent {
|
|
|
692
710
|
StringInputComponent.decorators = [
|
|
693
711
|
{ type: Component, args: [{
|
|
694
712
|
selector: 'aup-string-input',
|
|
695
|
-
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",
|
|
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=\"allowClear && clearCommand.enabled.value\" [pectinCommand]=\"clearCommand\">\n <mat-icon>close</mat-icon>\n </button>\n</mat-form-field>\n\n",
|
|
696
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}"]
|
|
697
715
|
}] }
|
|
698
716
|
];
|
|
699
717
|
/** @nocollapse */
|
|
700
718
|
StringInputComponent.ctorParameters = () => [];
|
|
719
|
+
StringInputComponent.propDecorators = {
|
|
720
|
+
allowClearModel: [{ type: Input }],
|
|
721
|
+
allowClear: [{ type: Input }]
|
|
722
|
+
};
|
|
723
|
+
__decorate([
|
|
724
|
+
UseDelegate({ defaultValue: false }),
|
|
725
|
+
__metadata("design:type", ValueModel)
|
|
726
|
+
], StringInputComponent.prototype, "allowClearModel", void 0);
|
|
727
|
+
__decorate([
|
|
728
|
+
StoreInValueModel('allowClearModel'),
|
|
729
|
+
__metadata("design:type", Boolean)
|
|
730
|
+
], StringInputComponent.prototype, "allowClear", void 0);
|
|
731
|
+
if (false) {
|
|
732
|
+
/** @type {?} */
|
|
733
|
+
StringInputComponent.prototype.allowClearModel;
|
|
734
|
+
/** @type {?} */
|
|
735
|
+
StringInputComponent.prototype.allowClear;
|
|
736
|
+
/** @type {?} */
|
|
737
|
+
StringInputComponent.prototype.clearCommand;
|
|
738
|
+
}
|
|
701
739
|
|
|
702
740
|
/**
|
|
703
741
|
* @fileoverview added by tsickle
|
|
@@ -740,7 +778,9 @@ ComponentsModule.decorators = [
|
|
|
740
778
|
MatFormFieldModule,
|
|
741
779
|
MatSelectModule,
|
|
742
780
|
MatTabsModule,
|
|
743
|
-
DirectivesModule
|
|
781
|
+
DirectivesModule,
|
|
782
|
+
MatIconModule,
|
|
783
|
+
MatButtonModule
|
|
744
784
|
],
|
|
745
785
|
exports: [
|
|
746
786
|
NumberInputComponent,
|
|
@@ -2198,7 +2238,7 @@ InteractionModule.decorators = [
|
|
|
2198
2238
|
{ type: NgModule, args: [{
|
|
2199
2239
|
imports: [
|
|
2200
2240
|
CommonModule,
|
|
2201
|
-
MatButtonModule,
|
|
2241
|
+
MatButtonModule$1,
|
|
2202
2242
|
MatDialogModule,
|
|
2203
2243
|
MatTabsModule$1,
|
|
2204
2244
|
PortalModule,
|