@coolon/angular-ui-powerups 14.34.0 → 14.35.0
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/esm2020/lib/components/forms/abstract-input.component.mjs +22 -10
- package/esm2020/lib/components/forms/abstract-list-input.component.mjs +2 -14
- package/esm2020/lib/components/forms/abstract-value-input.component.mjs +2 -14
- package/fesm2015/coolon-angular-ui-powerups.mjs +23 -33
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +21 -33
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +18 -6
- package/lib/components/forms/abstract-list-input.component.d.ts +0 -11
- package/lib/components/forms/abstract-value-input.component.d.ts +0 -11
- package/package.json +2 -2
|
@@ -1641,12 +1641,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1641
1641
|
}] } });
|
|
1642
1642
|
|
|
1643
1643
|
/* tslint:disable:no-input-rename */
|
|
1644
|
+
const INPUT_TOKEN_HACK = new InjectionToken("INPUT_TOKEN_HACK");
|
|
1644
1645
|
class AbstractInputComponent extends DisposableComponent {
|
|
1645
|
-
constructor() {
|
|
1646
|
+
constructor(formValue$) {
|
|
1646
1647
|
super();
|
|
1647
1648
|
this.onValueEditedListeners = new EventListenerList();
|
|
1648
1649
|
this.userFloatLabel = 'always'; // TODO: make this an injectable default
|
|
1649
1650
|
this.dense = false;
|
|
1651
|
+
this._enabled$ = this.registerDisposable(new DelegatingValueModel());
|
|
1650
1652
|
// TODO: fix this.
|
|
1651
1653
|
// tslint:disable-next-line:no-output-native
|
|
1652
1654
|
this.focus = new EventEmitter();
|
|
@@ -1658,12 +1660,20 @@ class AbstractInputComponent extends DisposableComponent {
|
|
|
1658
1660
|
this.escapeKey = new EventEmitter();
|
|
1659
1661
|
this.baseClassName = 'aup-input-component';
|
|
1660
1662
|
const self = this;
|
|
1663
|
+
this.formValue$ = this.registerDisposable(formValue$);
|
|
1664
|
+
this._enabled$.setDefault(formValue$.enabled);
|
|
1661
1665
|
this.errorStateMatcher = {
|
|
1662
1666
|
isErrorState(control, form) {
|
|
1663
1667
|
return self.hasErrors();
|
|
1664
1668
|
}
|
|
1665
1669
|
};
|
|
1666
1670
|
}
|
|
1671
|
+
set enabled$(condition$) {
|
|
1672
|
+
this._enabled$.setDelegate(condition$);
|
|
1673
|
+
}
|
|
1674
|
+
get enabled$() {
|
|
1675
|
+
return this._enabled$.readonly;
|
|
1676
|
+
}
|
|
1667
1677
|
notifyClick() {
|
|
1668
1678
|
this.safelyInvoke(this.clickCommand);
|
|
1669
1679
|
}
|
|
@@ -1693,9 +1703,6 @@ class AbstractInputComponent extends DisposableComponent {
|
|
|
1693
1703
|
isEnabled() {
|
|
1694
1704
|
return this.enabled$.value;
|
|
1695
1705
|
}
|
|
1696
|
-
get enabled$() {
|
|
1697
|
-
return this.formValue$.enabled;
|
|
1698
|
-
}
|
|
1699
1706
|
hasErrors() {
|
|
1700
1707
|
return !this.errorList$.query().isEmpty();
|
|
1701
1708
|
}
|
|
@@ -1722,12 +1729,15 @@ class AbstractInputComponent extends DisposableComponent {
|
|
|
1722
1729
|
return this.onValueEditedListeners.add(callback);
|
|
1723
1730
|
}
|
|
1724
1731
|
}
|
|
1725
|
-
AbstractInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1726
|
-
AbstractInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: AbstractInputComponent, selector: "ng-component", inputs: { label: "label", userFloatLabel: ["floatLabel", "userFloatLabel"], hint: "hint", placeholder: "placeholder", dense: "dense", focusCommand: ["command.focus", "focusCommand"], blurCommand: ["command.blur", "blurCommand"], enterCommand: ["command.enter", "enterCommand"], escapeCommand: ["command.escape", "escapeCommand"], clickCommand: ["command.click", "clickCommand"] }, outputs: { focus: "focus", blur: "blur", enterKey: "enterKey", escapeKey: "escapeKey" }, host: { listeners: { "click": "notifyClick()", "focusin": "notifyFocusIn()", "focusout": "notifyFocusOut()" }, properties: { "class.dense": "this.dense", "class": "this.baseClassName" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
1732
|
+
AbstractInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractInputComponent, deps: [{ token: INPUT_TOKEN_HACK }], target: i0.ɵɵFactoryTarget.Component });
|
|
1733
|
+
AbstractInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: AbstractInputComponent, selector: "ng-component", inputs: { label: "label", userFloatLabel: ["floatLabel", "userFloatLabel"], hint: "hint", placeholder: "placeholder", dense: "dense", enabled$: "enabled$", focusCommand: ["command.focus", "focusCommand"], blurCommand: ["command.blur", "blurCommand"], enterCommand: ["command.enter", "enterCommand"], escapeCommand: ["command.escape", "escapeCommand"], clickCommand: ["command.click", "clickCommand"] }, outputs: { focus: "focus", blur: "blur", enterKey: "enterKey", escapeKey: "escapeKey" }, host: { listeners: { "click": "notifyClick()", "focusin": "notifyFocusIn()", "focusout": "notifyFocusOut()" }, properties: { "class.dense": "this.dense", "class": "this.baseClassName" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
1727
1734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractInputComponent, decorators: [{
|
|
1728
1735
|
type: Component,
|
|
1729
1736
|
args: [{ template: '' }]
|
|
1730
|
-
}], ctorParameters: function () { return [
|
|
1737
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1738
|
+
type: Inject,
|
|
1739
|
+
args: [INPUT_TOKEN_HACK]
|
|
1740
|
+
}] }]; }, propDecorators: { label: [{
|
|
1731
1741
|
type: Input
|
|
1732
1742
|
}], userFloatLabel: [{
|
|
1733
1743
|
type: Input,
|
|
@@ -1741,6 +1751,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1741
1751
|
args: ['class.dense']
|
|
1742
1752
|
}, {
|
|
1743
1753
|
type: Input
|
|
1754
|
+
}], enabled$: [{
|
|
1755
|
+
type: Input
|
|
1744
1756
|
}], focusCommand: [{
|
|
1745
1757
|
type: Input,
|
|
1746
1758
|
args: ['command.focus']
|
|
@@ -1780,19 +1792,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1780
1792
|
|
|
1781
1793
|
class AbstractListInputComponent extends AbstractInputComponent {
|
|
1782
1794
|
constructor() {
|
|
1783
|
-
super();
|
|
1784
|
-
/**
|
|
1785
|
-
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
1786
|
-
*
|
|
1787
|
-
* @Input() @TrackExternal({useExisting: "inputModel"})
|
|
1788
|
-
* valueModel: Form.ListModelBase<string> | MutableListModel<string>;
|
|
1789
|
-
*
|
|
1790
|
-
* This approach allows the input to accept plain or form models but all backed by a form
|
|
1791
|
-
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
1792
|
-
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
1793
|
-
*/
|
|
1794
|
-
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
1795
|
-
this.formValue$ = this.registerDisposable(new Form.DelegatingFormListModel());
|
|
1795
|
+
super(new Form.DelegatingFormListModel());
|
|
1796
1796
|
this.componentList$ = new MutableListModel();
|
|
1797
1797
|
this.setValueIsInProgress$ = new Guard();
|
|
1798
1798
|
this.valueChange = new EventEmitter();
|
|
@@ -1851,19 +1851,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1851
1851
|
|
|
1852
1852
|
class AbstractValueInputComponent extends AbstractInputComponent {
|
|
1853
1853
|
constructor() {
|
|
1854
|
-
super();
|
|
1855
|
-
/**
|
|
1856
|
-
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
1857
|
-
*
|
|
1858
|
-
* @Input() @TrackExternal({useExisting: "inputModel"})
|
|
1859
|
-
* value$: DirtyTrackingForm.ValueModel<string> | MutableValueModel<string>;
|
|
1860
|
-
*
|
|
1861
|
-
* This approach allows the input to accept plain or form models but all backed by a form
|
|
1862
|
-
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
1863
|
-
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
1864
|
-
*/
|
|
1865
|
-
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
1866
|
-
this.formValue$ = this.registerDisposable(new Form.DelegatingFormValueModel());
|
|
1854
|
+
super(new Form.DelegatingFormValueModel());
|
|
1867
1855
|
this.setValueInProgress$ = new Guard();
|
|
1868
1856
|
this.componentValue$ = new MutableValueModel();
|
|
1869
1857
|
this.valueChange = new EventEmitter();
|