@coolon/angular-ui-powerups 1.13.0 → 1.13.1
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 +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +0 -7
- 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/forms/abstract-input.component.js +0 -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/esm5/lib/components/forms/abstract-input.component.js +0 -8
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +0 -3
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +0 -7
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
/* tslint:disable:no-input-rename */
|
|
3
3
|
import { Component, EventEmitter, HostBinding, HostListener, Input, Output } from '@angular/core';
|
|
4
4
|
import { Command } from '@coolon/pectin';
|
|
5
|
-
import { lang } from '@coolon/typescript-utilities';
|
|
6
5
|
import { DisposableComponent } from '../disposable-component';
|
|
7
6
|
let AbstractInputComponent = class AbstractInputComponent extends DisposableComponent {
|
|
8
7
|
constructor() {
|
|
@@ -24,9 +23,6 @@ let AbstractInputComponent = class AbstractInputComponent extends DisposableComp
|
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
get inputModel() {
|
|
28
|
-
return lang.abstractMethod(this.constructor, "inputModel");
|
|
29
|
-
}
|
|
30
26
|
notifyClick() {
|
|
31
27
|
this.safelyInvoke(this.clickCommand);
|
|
32
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1G,OAAO,EAAE,OAAO,EAAuC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1G,OAAO,EAAE,OAAO,EAAuC,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAU9D,IAAc,sBAAsB,GAApC,MAAc,sBAA0B,SAAQ,mBAAmB;IAgEjE;QACE,KAAK,EAAE,CAAC;QAjDV,kBAAkB;QAClB,4CAA4C;QAClC,UAAK,GAAG,IAAI,YAAY,EAAE,CAAC;QACrC,4CAA4C;QAClC,SAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QACpC,4CAA4C;QAClC,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,4CAA4C;QAClC,cAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QAKzC,kBAAa,GAAG,qBAAqB,CAAC;QAqCpC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,iBAAiB,GAAG;YACvB,YAAY,CAAC,OAA2B,EAAE,IAAwC;gBAChF,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;YAC1B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,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;IACtC,CAAC;CAEF,CAAA;AAjGU;IAAR,KAAK,EAAE;;qDAAe;AACd;IAAR,KAAK,EAAE;;0DAAyC;AACxC;IAAR,KAAK,EAAE;;oDAAc;AACb;IAAR,KAAK,EAAE;;2DAAqB;AAGL;IAAvB,KAAK,CAAC,eAAe,CAAC;8BAAe,OAAO;4DAAM;AAC5B;IAAtB,KAAK,CAAC,cAAc,CAAC;8BAAc,OAAO;2DAAM;AACzB;IAAvB,KAAK,CAAC,eAAe,CAAC;8BAAe,OAAO;4DAAM;AAC1B;IAAxB,KAAK,CAAC,gBAAgB,CAAC;8BAAgB,OAAO;6DAAM;AAC7B;IAAvB,KAAK,CAAC,eAAe,CAAC;8BAAe,OAAO;4DAAM;AAIzC;IAAT,MAAM,EAAE;;qDAA4B;AAE3B;IAAT,MAAM,EAAE;;oDAA2B;AAE1B;IAAT,MAAM,EAAE;;wDAA+B;AAE9B;IAAT,MAAM,EAAE;;yDAAgC;AAKzC;IADC,WAAW,CAAC,OAAO,CAAC;;6DACiB;AAGtC;IADC,YAAY,CAAC,OAAO,CAAC;;;;yDAGrB;AAGD;IADC,YAAY,CAAC,SAAS,CAAC;;;;2DAIvB;AAGD;IADC,YAAY,CAAC,UAAU,CAAC;;;;4DAIxB;AA9CW,sBAAsB;IADnC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;GACd,sBAAsB,CAqGnC;SArGa,sBAAsB","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, HostBinding, HostListener, Input, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroupDirective, NgForm } from '@angular/forms';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { Command, FocusManager, ListModel, ValueModel } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { DisposableComponent } from '../disposable-component';\n\ninterface InputModel<T> {\n value: T;\n enabled: ValueModel<boolean>;\n errorList: ListModel<string>;\n focusContext: FocusManager.Context;\n}\n\n@Component({ template: '' })\nexport class AbstractInputComponent<T> extends DisposableComponent implements OnInit {\n\n protected inputModel: InputModel<T>;\n\n @Input() label: string;\n @Input() floatLabel: 'auto' | 'always' | 'never';\n @Input() hint: string;\n @Input() placeholder: string;\n\n // Note: I don't need to use delegates here as I never subscribe to the commands models\n @Input('command.focus') focusCommand: Command<any>;\n @Input('command.blur') blurCommand: Command<any>;\n @Input('command.enter') enterCommand: Command<any>;\n @Input('command.escape') escapeCommand: Command<any>;\n @Input('command.click') clickCommand: Command<any>;\n\n // TODO: fix this.\n // tslint:disable-next-line:no-output-native\n @Output() focus = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() blur = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() enterKey = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() escapeKey = new EventEmitter();\n\n readonly errorStateMatcher: ErrorStateMatcher;\n\n @HostBinding('class')\n baseClassName = 'aup-input-component';\n\n @HostListener('click')\n notifyClick() {\n this.safelyInvoke(this.clickCommand);\n }\n\n @HostListener('focusin')\n notifyFocusIn() {\n this.safelyInvoke(this.focusCommand);\n this.focus.emit();\n }\n\n @HostListener('focusout')\n notifyFocusOut() {\n this.safelyInvoke(this.blurCommand);\n this.blur.emit();\n }\n\n notifyEnterKey() {\n this.safelyInvoke(this.enterCommand);\n this.enterKey.emit();\n }\n\n notifyEscapeKey() {\n this.safelyInvoke(this.escapeCommand);\n this.escapeKey.emit();\n }\n\n protected safelyInvoke(command: Command<any>) {\n if (command && command.enabled.value) {\n command.execute();\n }\n }\n\n constructor() {\n super();\n const self = this;\n this.errorStateMatcher = {\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\n return self.hasErrors();\n }\n };\n }\n\n ngOnInit(): void {\n }\n\n isEnabled(): boolean {\n return this.enabled.value;\n }\n\n get enabled(): ValueModel<boolean> {\n return this.inputModel.enabled;\n }\n\n hasErrors(): boolean {\n return !this.errorList.query().isEmpty();\n }\n\n get errorList(): ListModel<string> {\n return this.inputModel.errorList;\n }\n\n get firstError() {\n return this.hasErrors() ? this.errorList.value[0] : null;\n }\n\n get focusContext() {\n return this.inputModel.focusContext;\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":16,"character":48},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"template":""}]}],"members":{"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":16,"character":48},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"template":""}]}],"members":{"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"floatLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"hint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"focusCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3},"arguments":["command.focus"]}]}],"blurCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3},"arguments":["command.blur"]}]}],"enterCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3},"arguments":["command.enter"]}]}],"escapeCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3},"arguments":["command.escape"]}]}],"clickCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3},"arguments":["command.click"]}]}],"focus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":34,"character":3}}]}],"blur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":36,"character":3}}]}],"enterKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":38,"character":3}}]}],"escapeKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":40,"character":3}}]}],"baseClassName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":44,"character":3},"arguments":["class"]}]}],"notifyClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":47,"character":3},"arguments":["click"]}]}],"notifyFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":52,"character":3},"arguments":["focusin"]}]}],"notifyFocusOut":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":58,"character":3},"arguments":["focusout"]}]}],"notifyEnterKey":[{"__symbolic":"method"}],"notifyEscapeKey":[{"__symbolic":"method"}],"safelyInvoke":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isEnabled":[{"__symbolic":"method"}],"hasErrors":[{"__symbolic":"method"}]}}}}]
|
|
@@ -2,7 +2,6 @@ import { __decorate, __extends, __metadata } from "tslib";
|
|
|
2
2
|
/* tslint:disable:no-input-rename */
|
|
3
3
|
import { Component, EventEmitter, HostBinding, HostListener, Input, Output } from '@angular/core';
|
|
4
4
|
import { Command } from '@coolon/pectin';
|
|
5
|
-
import { lang } from '@coolon/typescript-utilities';
|
|
6
5
|
import { DisposableComponent } from '../disposable-component';
|
|
7
6
|
var AbstractInputComponent = /** @class */ (function (_super) {
|
|
8
7
|
__extends(AbstractInputComponent, _super);
|
|
@@ -26,13 +25,6 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
26
25
|
};
|
|
27
26
|
return _this;
|
|
28
27
|
}
|
|
29
|
-
Object.defineProperty(AbstractInputComponent.prototype, "inputModel", {
|
|
30
|
-
get: function () {
|
|
31
|
-
return lang.abstractMethod(this.constructor, "inputModel");
|
|
32
|
-
},
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true
|
|
35
|
-
});
|
|
36
28
|
AbstractInputComponent.prototype.notifyClick = function () {
|
|
37
29
|
this.safelyInvoke(this.clickCommand);
|
|
38
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1G,OAAO,EAAE,OAAO,EAAuC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1G,OAAO,EAAE,OAAO,EAAuC,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAU9D;IAAgD,0CAAmB;IAgEjE;QAAA,YACE,iBAAO,SAOR;QAxDD,kBAAkB;QAClB,4CAA4C;QAClC,WAAK,GAAG,IAAI,YAAY,EAAE,CAAC;QACrC,4CAA4C;QAClC,UAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QACpC,4CAA4C;QAClC,cAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,4CAA4C;QAClC,eAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QAKzC,mBAAa,GAAG,qBAAqB,CAAC;QAqCpC,IAAM,IAAI,GAAG,KAAI,CAAC;QAClB,KAAI,CAAC,iBAAiB,GAAG;YACvB,YAAY,EAAZ,UAAa,OAA2B,EAAE,IAAwC;gBAChF,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;YAC1B,CAAC;SACF,CAAC;;IACJ,CAAC;IAxCD,4CAAW,GAAX;QACE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAGD,8CAAa,GAAb;QACE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAGD,+CAAc,GAAd;QACE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACn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DAAqB;IAGL;QAAvB,KAAK,CAAC,eAAe,CAAC;kCAAe,OAAO;gEAAM;IAC5B;QAAtB,KAAK,CAAC,cAAc,CAAC;kCAAc,OAAO;+DAAM;IACzB;QAAvB,KAAK,CAAC,eAAe,CAAC;kCAAe,OAAO;gEAAM;IAC1B;QAAxB,KAAK,CAAC,gBAAgB,CAAC;kCAAgB,OAAO;iEAAM;IAC7B;QAAvB,KAAK,CAAC,eAAe,CAAC;kCAAe,OAAO;gEAAM;IAIzC;QAAT,MAAM,EAAE;;yDAA4B;IAE3B;QAAT,MAAM,EAAE;;wDAA2B;IAE1B;QAAT,MAAM,EAAE;;4DAA+B;IAE9B;QAAT,MAAM,EAAE;;6DAAgC;IAKzC;QADC,WAAW,CAAC,OAAO,CAAC;;iEACiB;IAGtC;QADC,YAAY,CAAC,OAAO,CAAC;;;;6DAGrB;IAGD;QADC,YAAY,CAAC,SAAS,CAAC;;;;+DAIvB;IAGD;QADC,YAAY,CAAC,UAAU,CAAC;;;;gEAIxB;IA9CW,sBAAsB;QADnC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;OACd,sBAAsB,CAqGnC;IAAD,6BAAC;CAAA,AArGD,CAAgD,mBAAmB,GAqGlE;SArGa,sBAAsB","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, HostBinding, HostListener, Input, OnInit, Output } from '@angular/core';\nimport { FormControl, FormGroupDirective, NgForm } from '@angular/forms';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { Command, FocusManager, ListModel, ValueModel } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { DisposableComponent } from '../disposable-component';\n\ninterface InputModel<T> {\n value: T;\n enabled: ValueModel<boolean>;\n errorList: ListModel<string>;\n focusContext: FocusManager.Context;\n}\n\n@Component({ template: '' })\nexport class AbstractInputComponent<T> extends DisposableComponent implements OnInit {\n\n protected inputModel: InputModel<T>;\n\n @Input() label: string;\n @Input() floatLabel: 'auto' | 'always' | 'never';\n @Input() hint: string;\n @Input() placeholder: string;\n\n // Note: I don't need to use delegates here as I never subscribe to the commands models\n @Input('command.focus') focusCommand: Command<any>;\n @Input('command.blur') blurCommand: Command<any>;\n @Input('command.enter') enterCommand: Command<any>;\n @Input('command.escape') escapeCommand: Command<any>;\n @Input('command.click') clickCommand: Command<any>;\n\n // TODO: fix this.\n // tslint:disable-next-line:no-output-native\n @Output() focus = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() blur = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() enterKey = new EventEmitter();\n // tslint:disable-next-line:no-output-native\n @Output() escapeKey = new EventEmitter();\n\n readonly errorStateMatcher: ErrorStateMatcher;\n\n @HostBinding('class')\n baseClassName = 'aup-input-component';\n\n @HostListener('click')\n notifyClick() {\n this.safelyInvoke(this.clickCommand);\n }\n\n @HostListener('focusin')\n notifyFocusIn() {\n this.safelyInvoke(this.focusCommand);\n this.focus.emit();\n }\n\n @HostListener('focusout')\n notifyFocusOut() {\n this.safelyInvoke(this.blurCommand);\n this.blur.emit();\n }\n\n notifyEnterKey() {\n this.safelyInvoke(this.enterCommand);\n this.enterKey.emit();\n }\n\n notifyEscapeKey() {\n this.safelyInvoke(this.escapeCommand);\n this.escapeKey.emit();\n }\n\n protected safelyInvoke(command: Command<any>) {\n if (command && command.enabled.value) {\n command.execute();\n }\n }\n\n constructor() {\n super();\n const self = this;\n this.errorStateMatcher = {\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\n return self.hasErrors();\n }\n };\n }\n\n ngOnInit(): void {\n }\n\n isEnabled(): boolean {\n return this.enabled.value;\n }\n\n get enabled(): ValueModel<boolean> {\n return this.inputModel.enabled;\n }\n\n hasErrors(): boolean {\n return !this.errorList.query().isEmpty();\n }\n\n get errorList(): ListModel<string> {\n return this.inputModel.errorList;\n }\n\n get firstError() {\n return this.hasErrors() ? this.errorList.value[0] : null;\n }\n\n get focusContext() {\n return this.inputModel.focusContext;\n }\n\n}\n"]}
|
|
@@ -1625,9 +1625,6 @@ let AbstractInputComponent = class AbstractInputComponent extends DisposableComp
|
|
|
1625
1625
|
}
|
|
1626
1626
|
};
|
|
1627
1627
|
}
|
|
1628
|
-
get inputModel() {
|
|
1629
|
-
return lang$1.abstractMethod(this.constructor, "inputModel");
|
|
1630
|
-
}
|
|
1631
1628
|
notifyClick() {
|
|
1632
1629
|
this.safelyInvoke(this.clickCommand);
|
|
1633
1630
|
}
|