@coolon/angular-ui-powerups 14.33.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.
@@ -1,9 +1,9 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { ErrorStateMatcher } from '@angular/material/core';
3
- import { Command, Disposable, EventListenerList, FocusManager, ListModel, ValueModel } from '@coolon/pectin';
3
+ import { Command, Disposable, EventListenerList, FocusManager, IMutableHasValue, ListModel, ValueModel } from '@coolon/pectin';
4
4
  import { DisposableComponent } from '../disposable-component';
5
5
  import * as i0 from "@angular/core";
6
- interface InputModel<T> {
6
+ interface InputModel<T> extends IMutableHasValue<T>, Disposable {
7
7
  value: T;
8
8
  enabled: ValueModel<boolean>;
9
9
  errorList: ListModel<string>;
@@ -11,12 +11,25 @@ interface InputModel<T> {
11
11
  }
12
12
  export declare class AbstractInputComponent<T> extends DisposableComponent implements OnInit {
13
13
  protected onValueEditedListeners: EventListenerList<(is: T, was: T) => void>;
14
- protected formValue$: InputModel<T>;
14
+ /**
15
+ * A backing model for all our @Input() valueModel properties which should be defined as follows.
16
+ *
17
+ * @Input() @TrackExternal({useExisting: "inputModel"})
18
+ * value$: DirtyTrackingForm.ValueModel<string> | MutableValueModel<string>;
19
+ *
20
+ * This approach allows the input to accept plain or form models but all backed by a form
21
+ * friendly delegate. We have to use an existing delegate for union types as pectin just
22
+ * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
23
+ */
24
+ protected readonly formValue$: InputModel<T>;
15
25
  label: string;
16
26
  userFloatLabel: 'auto' | 'always' | 'never';
17
27
  hint: string;
18
28
  placeholder: string;
19
29
  dense: boolean;
30
+ private readonly _enabled$;
31
+ set enabled$(condition$: ValueModel<boolean>);
32
+ get enabled$(): ValueModel<boolean>;
20
33
  focusCommand: Command<any>;
21
34
  blurCommand: Command<any>;
22
35
  enterCommand: Command<any>;
@@ -34,10 +47,9 @@ export declare class AbstractInputComponent<T> extends DisposableComponent imple
34
47
  notifyEnterKey(): void;
35
48
  notifyEscapeKey(): void;
36
49
  protected safelyInvoke(command: Command<any>): void;
37
- constructor();
50
+ constructor(formValue$: InputModel<T>);
38
51
  ngOnInit(): void;
39
52
  isEnabled(): boolean;
40
- get enabled$(): ValueModel<boolean>;
41
53
  hasErrors(): boolean;
42
54
  get errorList$(): ListModel<string>;
43
55
  get firstError(): string;
@@ -50,6 +62,6 @@ export declare class AbstractInputComponent<T> extends DisposableComponent imple
50
62
  */
51
63
  onValueEdited(callback: (is: T, was: T) => void): Disposable;
52
64
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractInputComponent<any>, never>;
53
- static ɵcmp: i0.ɵɵComponentDeclaration<AbstractInputComponent<any>, "ng-component", never, { "label": "label"; "userFloatLabel": "floatLabel"; "hint": "hint"; "placeholder": "placeholder"; "dense": "dense"; "focusCommand": "command.focus"; "blurCommand": "command.blur"; "enterCommand": "command.enter"; "escapeCommand": "command.escape"; "clickCommand": "command.click"; }, { "focus": "focus"; "blur": "blur"; "enterKey": "enterKey"; "escapeKey": "escapeKey"; }, never, never, false>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractInputComponent<any>, "ng-component", never, { "label": "label"; "userFloatLabel": "floatLabel"; "hint": "hint"; "placeholder": "placeholder"; "dense": "dense"; "enabled$": "enabled$"; "focusCommand": "command.focus"; "blurCommand": "command.blur"; "enterCommand": "command.enter"; "escapeCommand": "command.escape"; "clickCommand": "command.click"; }, { "focus": "focus"; "blur": "blur"; "enterKey": "enterKey"; "escapeKey": "escapeKey"; }, never, never, false>;
54
66
  }
55
67
  export {};
@@ -8,17 +8,6 @@ export declare class AbstractListInputComponent<T> extends AbstractInputComponen
8
8
  * @deprecated use #list$ instead
9
9
  */
10
10
  listModel: Form.ListModelBase<T> | ConvertedFormListModel<T, any> | MutableListModel<T>;
11
- /**
12
- * A backing model for all our @Input() valueModel properties which should be defined as follows.
13
- *
14
- * @Input() @TrackExternal({useExisting: "inputModel"})
15
- * valueModel: Form.ListModelBase<string> | MutableListModel<string>;
16
- *
17
- * This approach allows the input to accept plain or form models but all backed by a form
18
- * friendly delegate. We have to use an existing delegate for union types as pectin just
19
- * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
20
- */
21
- protected readonly formValue$: Form.DelegatingFormListModel<T>;
22
11
  readonly componentList$: MutableListModel<T>;
23
12
  private setValueIsInProgress$;
24
13
  private listHolder$;
@@ -8,17 +8,6 @@ export declare class AbstractValueInputComponent<T> extends AbstractInputCompone
8
8
  * @deprecated use #value$ instead.
9
9
  */
10
10
  valueModel: Form.ValueModelBase<T> | ConvertedFormValueModel<T, any> | MutableValueModel<T>;
11
- /**
12
- * A backing model for all our @Input() valueModel properties which should be defined as follows.
13
- *
14
- * @Input() @TrackExternal({useExisting: "inputModel"})
15
- * value$: DirtyTrackingForm.ValueModel<string> | MutableValueModel<string>;
16
- *
17
- * This approach allows the input to accept plain or form models but all backed by a form
18
- * friendly delegate. We have to use an existing delegate for union types as pectin just
19
- * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
20
- */
21
- protected readonly formValue$: Form.DelegatingFormValueModel<T>;
22
11
  protected setValueInProgress$: Guard;
23
12
  readonly componentValue$: MutableValueModel<T>;
24
13
  private plainValueHolder$;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "14.33.0",
3
+ "version": "14.35.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "^14.2.12",
@@ -11,7 +11,7 @@
11
11
  "@angular/material": "^14.2.7",
12
12
  "@angular/platform-browser": "^14.2.12",
13
13
  "@angular/router": "^14.2.12",
14
- "@coolon/pectin": "^3.39.0",
14
+ "@coolon/pectin": "^3.40.0",
15
15
  "@typescript-plus/fast-memoize-decorator": "^0.2.1",
16
16
  "lodash-es": "^4.17.21",
17
17
  "marked": "4.0.2",