@coolon/angular-ui-powerups 2.0.0-alpha.2 → 2.0.0-alpha.21

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.
Files changed (173) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/assets/form.scss +33 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.js +571 -330
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
  6. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  7. package/coolon-angular-ui-powerups.d.ts +55 -54
  8. package/coolon-angular-ui-powerups.metadata.json +1 -1
  9. package/esm2015/coolon-angular-ui-powerups.js +53 -52
  10. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  11. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  12. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  13. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  14. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  15. package/esm2015/lib/components/components.module.js +29 -12
  16. package/esm2015/lib/components/components.module.js.map +1 -1
  17. package/esm2015/lib/components/components.module.metadata.json +1 -1
  18. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  19. package/esm2015/lib/components/forms/abstract-input.component.js +26 -6
  20. package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
  21. package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
  22. package/esm2015/lib/components/forms/abstract-list-input.component.js +51 -6
  23. package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
  24. package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
  25. package/esm2015/lib/components/forms/abstract-value-input.component.js +46 -7
  26. package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
  27. package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
  28. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +70 -0
  29. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -0
  30. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +1 -0
  31. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +1 -0
  32. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +1 -0
  33. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +4 -7
  34. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  35. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
  36. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js +8 -13
  37. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
  38. package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.metadata.json +1 -1
  39. package/esm2015/lib/components/forms/number-input/number-input.component.js +4 -7
  40. package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
  41. package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
  42. package/esm2015/lib/components/forms/password-input/password-input.component.js +5 -8
  43. package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
  44. package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
  45. package/esm2015/lib/components/forms/select-input/select-input.component.js +8 -5
  46. package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
  47. package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
  48. package/esm2015/lib/components/forms/string-input/string-input.component.js +4 -8
  49. package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
  50. package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
  51. package/esm2015/lib/components/forms/text-input/text-input.component.js +4 -7
  52. package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
  53. package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
  54. package/esm2015/lib/components/index.js +2 -1
  55. package/esm2015/lib/components/index.js.map +1 -1
  56. package/esm2015/lib/components/index.metadata.json +1 -1
  57. package/esm2015/lib/components/table/cell-editors.js.map +1 -1
  58. package/esm2015/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
  59. package/esm2015/lib/components/table/cell-portal-ref.js.map +1 -0
  60. package/esm2015/lib/components/table/{cell-protal-ref.metadata.json → cell-portal-ref.metadata.json} +1 -1
  61. package/esm2015/lib/components/table/column-model.js +66 -11
  62. package/esm2015/lib/components/table/column-model.js.map +1 -1
  63. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  64. package/esm2015/lib/components/table/mutable-cell-renderer.js +1 -0
  65. package/esm2015/lib/components/table/mutable-cell-renderer.js.map +1 -0
  66. package/esm2015/lib/components/table/mutable-cell-renderer.metadata.json +1 -0
  67. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
  68. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  69. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
  70. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
  71. package/esm2015/lib/components/table/table-model.js +11 -10
  72. package/esm2015/lib/components/table/table-model.js.map +1 -1
  73. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  74. package/esm2015/lib/components/table/table.component.js +1 -1
  75. package/esm2015/lib/components/table/table.component.js.map +1 -1
  76. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  77. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -7
  78. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  79. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  80. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  81. package/esm2015/lib/place/place-component.js +1 -1
  82. package/esm2015/lib/place/place-component.js.map +1 -1
  83. package/esm2015/lib/place/place-router.js +2 -8
  84. package/esm2015/lib/place/place-router.js.map +1 -1
  85. package/esm2015/lib/place/place-router.metadata.json +1 -1
  86. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  87. package/esm2015/lib/place/route/parameter-decorators.js +2 -3
  88. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  89. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  90. package/esm5/coolon-angular-ui-powerups.js +53 -52
  91. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  92. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  93. package/esm5/lib/components/card-container/card-container.component.js +1 -1
  94. package/esm5/lib/components/components.module.js +29 -12
  95. package/esm5/lib/components/components.module.js.map +1 -1
  96. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  97. package/esm5/lib/components/forms/abstract-input.component.js +34 -6
  98. package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
  99. package/esm5/lib/components/forms/abstract-list-input.component.js +56 -6
  100. package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
  101. package/esm5/lib/components/forms/abstract-value-input.component.js +51 -7
  102. package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
  103. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +73 -0
  104. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -0
  105. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +1 -0
  106. package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +1 -0
  107. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +4 -7
  108. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  109. package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js +8 -13
  110. package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
  111. package/esm5/lib/components/forms/number-input/number-input.component.js +4 -7
  112. package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
  113. package/esm5/lib/components/forms/password-input/password-input.component.js +5 -8
  114. package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
  115. package/esm5/lib/components/forms/select-input/select-input.component.js +8 -5
  116. package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
  117. package/esm5/lib/components/forms/string-input/string-input.component.js +4 -8
  118. package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
  119. package/esm5/lib/components/forms/text-input/text-input.component.js +4 -7
  120. package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
  121. package/esm5/lib/components/index.js +2 -1
  122. package/esm5/lib/components/index.js.map +1 -1
  123. package/esm5/lib/components/table/cell-editors.js.map +1 -1
  124. package/esm5/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
  125. package/esm5/lib/components/table/cell-portal-ref.js.map +1 -0
  126. package/esm5/lib/components/table/column-model.js +67 -11
  127. package/esm5/lib/components/table/column-model.js.map +1 -1
  128. package/esm5/lib/components/table/mutable-cell-renderer.js +1 -0
  129. package/esm5/lib/components/table/mutable-cell-renderer.js.map +1 -0
  130. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
  131. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  132. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
  133. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
  134. package/esm5/lib/components/table/table-model.js +11 -11
  135. package/esm5/lib/components/table/table-model.js.map +1 -1
  136. package/esm5/lib/components/table/table.component.js +1 -1
  137. package/esm5/lib/components/table/table.component.js.map +1 -1
  138. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -7
  139. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  140. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  141. package/esm5/lib/place/place-component.js +1 -1
  142. package/esm5/lib/place/place-component.js.map +1 -1
  143. package/esm5/lib/place/place-router.js +2 -8
  144. package/esm5/lib/place/place-router.js.map +1 -1
  145. package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
  146. package/esm5/lib/place/route/parameter-decorators.js +2 -3
  147. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  148. package/fesm2015/coolon-angular-ui-powerups.js +466 -247
  149. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  150. package/fesm5/coolon-angular-ui-powerups.js +503 -263
  151. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  152. package/lib/components/forms/abstract-input.component.d.ts +12 -3
  153. package/lib/components/forms/abstract-list-input.component.d.ts +10 -3
  154. package/lib/components/forms/abstract-value-input.component.d.ts +9 -3
  155. package/lib/components/forms/autocomplete-input/autocomplete-input.component.d.ts +25 -0
  156. package/lib/components/forms/checkbox-input/checkbox-input.component.d.ts +0 -2
  157. package/lib/components/forms/multiple-select-input/multiple-select-input.component.d.ts +8 -4
  158. package/lib/components/forms/number-input/number-input.component.d.ts +0 -2
  159. package/lib/components/forms/password-input/password-input.component.d.ts +0 -2
  160. package/lib/components/forms/select-input/select-input.component.d.ts +8 -2
  161. package/lib/components/forms/string-input/string-input.component.d.ts +1 -2
  162. package/lib/components/forms/text-input/text-input.component.d.ts +0 -2
  163. package/lib/components/index.d.ts +3 -1
  164. package/lib/components/table/cell-editors.d.ts +3 -3
  165. package/lib/components/table/{cell-protal-ref.d.ts → cell-portal-ref.d.ts} +4 -4
  166. package/lib/components/table/column-model.d.ts +18 -12
  167. package/lib/components/table/mutable-cell-renderer.d.ts +6 -0
  168. package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
  169. package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +1 -1
  170. package/lib/components/table/table-model.d.ts +15 -4
  171. package/package.json +4 -4
  172. package/esm2015/lib/components/table/cell-protal-ref.js.map +0 -1
  173. package/esm5/lib/components/table/cell-protal-ref.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { ErrorStateMatcher } from '@angular/material/core';
3
- import { Command, FocusManager, ListModel, ValueModel } from '@coolon/pectin';
3
+ import { Command, Disposable, EventListenerList, FocusManager, ListModel, ValueModel } from '@coolon/pectin';
4
4
  import { DisposableComponent } from '../disposable-component';
5
5
  interface InputModel<T> {
6
6
  value: T;
@@ -9,11 +9,13 @@ interface InputModel<T> {
9
9
  focusContext: FocusManager.Context;
10
10
  }
11
11
  export declare class AbstractInputComponent<T> extends DisposableComponent implements OnInit {
12
- protected inputModel: InputModel<T>;
12
+ protected onValueEditedListeners: EventListenerList<(is: T, was: T) => void>;
13
+ protected formValueModel: InputModel<T>;
13
14
  label: string;
14
- floatLabel: 'auto' | 'always' | 'never';
15
+ userFloatLabel: 'auto' | 'always' | 'never';
15
16
  hint: string;
16
17
  placeholder: string;
18
+ dense: boolean;
17
19
  focusCommand: Command<any>;
18
20
  blurCommand: Command<any>;
19
21
  enterCommand: Command<any>;
@@ -39,5 +41,12 @@ export declare class AbstractInputComponent<T> extends DisposableComponent imple
39
41
  get errorList(): ListModel<string>;
40
42
  get firstError(): string;
41
43
  get focusContext(): FocusManager.Context;
44
+ get floatLabel(): 'auto' | 'always' | 'never';
45
+ get showHint(): boolean;
46
+ /**
47
+ * Invokes the callback when this components value is changed by a user edit.
48
+ * @param callback
49
+ */
50
+ onValueEdited(callback: (is: T, was: T) => void): Disposable;
42
51
  }
43
52
  export {};
@@ -1,7 +1,8 @@
1
- import { OnInit } from '@angular/core';
2
- import { Form } from '@coolon/pectin';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { Form, IMutableListModel, MutableListModel } from '@coolon/pectin';
3
3
  import { AbstractInputComponent } from './abstract-input.component';
4
4
  export declare class AbstractListInputComponent<T> extends AbstractInputComponent<T[]> implements OnInit {
5
+ listModel: Form.ListModelBase<T> | IMutableListModel<T>;
5
6
  /**
6
7
  * A backing model for all our @Input() valueModel properties which should be defined as follows.
7
8
  *
@@ -12,5 +13,11 @@ export declare class AbstractListInputComponent<T> extends AbstractInputComponen
12
13
  * friendly delegate. We have to use an existing delegate for union types as pectin just
13
14
  * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
14
15
  */
15
- readonly inputModel: Form.DelegatingListModel<T>;
16
+ protected readonly formValueModel: Form.DelegatingListModel<T>;
17
+ readonly componentListModel: MutableListModel<T>;
18
+ private setValueIsInProgress;
19
+ private listHolder;
20
+ set value(value: T[]);
21
+ readonly valueChange: EventEmitter<T[]>;
22
+ constructor();
16
23
  }
@@ -1,7 +1,8 @@
1
- import { OnInit } from '@angular/core';
2
- import { Form } from '@coolon/pectin';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { Form, Guard, IMutableValueModel, MutableValueModel } from '@coolon/pectin';
3
3
  import { AbstractInputComponent } from './abstract-input.component';
4
4
  export declare class AbstractValueInputComponent<T> extends AbstractInputComponent<T> implements OnInit {
5
+ valueModel: Form.ValueModelBase<T> | IMutableValueModel<T>;
5
6
  /**
6
7
  * A backing model for all our @Input() valueModel properties which should be defined as follows.
7
8
  *
@@ -12,6 +13,11 @@ export declare class AbstractValueInputComponent<T> extends AbstractInputCompone
12
13
  * friendly delegate. We have to use an existing delegate for union types as pectin just
13
14
  * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
14
15
  */
15
- readonly inputModel: Form.DelegatingValueModel<T>;
16
+ protected readonly formValueModel: Form.DelegatingValueModel<T>;
17
+ protected setValueInProgress: Guard;
18
+ readonly componentValueModel: MutableValueModel<T>;
19
+ private plainValueHolder;
20
+ set value(value: T);
21
+ readonly valueChange: EventEmitter<T>;
16
22
  constructor();
17
23
  }
@@ -0,0 +1,25 @@
1
+ import { OnInit, TemplateRef } from '@angular/core';
2
+ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
3
+ import { ListModel, ListModelChain } from '@coolon/pectin';
4
+ import { AbstractValueInputComponent } from '../abstract-value-input.component';
5
+ /**
6
+ * Using templates (not only supported for nil values:
7
+ * <aup-autocomplete-input [valueModel]="myModel" [options]="myOptions">
8
+ * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
9
+ * </aup-autocomplete-input>
10
+ */
11
+ export declare class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {
12
+ optionsModel: ListModel<T>;
13
+ options: T[];
14
+ optionLabel: keyof T;
15
+ allowNil: boolean;
16
+ nilOptionTemplateRef: TemplateRef<any>;
17
+ private filterValue;
18
+ readonly filteredOptions: ListModelChain<T>;
19
+ optionLabelFormat: (option: T) => any;
20
+ constructor();
21
+ ngOnInit(): void;
22
+ formatOption(option: T): any;
23
+ updateFilter($event: string): void;
24
+ onSelect($event: MatAutocompleteSelectedEvent): void;
25
+ }
@@ -1,8 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Form, IMutableValueModel } from '@coolon/pectin';
3
2
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
3
  export declare class CheckboxInputComponent extends AbstractValueInputComponent<boolean> implements OnInit {
5
- valueModel: Form.ValueModelBase<boolean> | IMutableValueModel<boolean>;
6
4
  color: 'primary' | 'warn' | 'accent';
7
5
  labelPosition: 'before' | 'after';
8
6
  constructor();
@@ -1,14 +1,18 @@
1
1
  import { OnInit, TemplateRef } from '@angular/core';
2
- import { Form, IMutableListModel, ListModel } from '@coolon/pectin';
2
+ import { ListModel } from '@coolon/pectin';
3
3
  import { AbstractListInputComponent } from '../abstract-list-input.component';
4
+ /**
5
+ * Using templates:
6
+ * <aup-multiple-select-input [valueModel]="myModel" [options]="myOptions">
7
+ * <ng-template #optionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
8
+ * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
9
+ * </aup-multiple-select_input>
10
+ */
4
11
  export declare class MultipleSelectInputComponent<T = any> extends AbstractListInputComponent<T> implements OnInit {
5
- listModel: Form.ListModelBase<T> | IMutableListModel<T>;
6
12
  optionsModel: ListModel<T>;
7
13
  options: T[];
8
14
  optionLabel: keyof T;
9
- allowNil: boolean;
10
15
  optionTemplateRef: TemplateRef<any>;
11
- nilOptionTemplateRef: TemplateRef<any>;
12
16
  optionLabelFormat: (option: T) => any;
13
17
  constructor();
14
18
  ngOnInit(): void;
@@ -1,8 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Form, IMutableValueModel } from '@coolon/pectin';
3
2
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
3
  export declare class NumberInputComponent extends AbstractValueInputComponent<number> implements OnInit {
5
- valueModel: Form.ValueModelBase<number> | IMutableValueModel<number>;
6
4
  min: number;
7
5
  max: number;
8
6
  constructor();
@@ -1,8 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Form, IMutableValueModel } from '@coolon/pectin';
3
2
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
3
  export declare class PasswordInputComponent extends AbstractValueInputComponent<string> implements OnInit {
5
- valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
6
4
  constructor();
7
5
  ngOnInit(): void;
8
6
  }
@@ -1,8 +1,14 @@
1
1
  import { OnInit, TemplateRef } from '@angular/core';
2
- import { IMutableValueModel, ListModel, Form } from '@coolon/pectin';
2
+ import { ListModel } from '@coolon/pectin';
3
3
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
+ /**
5
+ * Using templates:
6
+ * <aup-select-input [valueModel]="myModel" [options]="myOptions">
7
+ * <ng-template #optionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
8
+ * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
9
+ * </aup-select_input>
10
+ */
4
11
  export declare class SelectInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {
5
- valueModel: Form.ValueModelBase<T> | IMutableValueModel<T>;
6
12
  optionsModel: ListModel<T>;
7
13
  options: T[];
8
14
  optionLabel: keyof T;
@@ -1,8 +1,7 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Command, Form, IMutableValueModel, ValueModel } from '@coolon/pectin';
2
+ import { Command, ValueModel } from '@coolon/pectin';
3
3
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
4
  export declare class StringInputComponent extends AbstractValueInputComponent<string> implements OnInit {
5
- valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
6
5
  enableClearModel: ValueModel<boolean>;
7
6
  enableClear: boolean;
8
7
  readonly clearCommand: Command<void>;
@@ -1,8 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Form, IMutableValueModel } from '@coolon/pectin';
3
2
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
4
3
  export declare class TextInputComponent extends AbstractValueInputComponent<string> implements OnInit {
5
- valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
6
4
  rows: number;
7
5
  cols: number;
8
6
  constructor();
@@ -10,6 +10,7 @@ export * from "./focus-container/focus-container.component";
10
10
  export * from "./forms/abstract-input.component";
11
11
  export * from "./forms/abstract-list-input.component";
12
12
  export * from "./forms/abstract-value-input.component";
13
+ export * from "./forms/autocomplete-input/autocomplete-input.component";
13
14
  export * from "./forms/checkbox-input/checkbox-input.component";
14
15
  export * from "./forms/multiple-select-input/multiple-select-input.component";
15
16
  export * from "./forms/number-input/number-input.component";
@@ -23,11 +24,12 @@ export * from "./scroll-container/scroll-container.component";
23
24
  export * from "./section-header/section-header.component";
24
25
  export * from "./switch-case/switch-case.component";
25
26
  export * from "./table/cell-editors";
26
- export * from "./table/cell-protal-ref";
27
+ export * from "./table/cell-portal-ref";
27
28
  export * from "./table/cell-renderer";
28
29
  export * from "./table/column-model";
29
30
  export * from "./table/column-text-properties";
30
31
  export * from "./table/edit-session";
32
+ export * from "./table/mutable-cell-renderer";
31
33
  export * from "./table/table-def";
32
34
  export * from "./table/table-model";
33
35
  export * from "./table/table.component";
@@ -1,9 +1,9 @@
1
- import { Form, ListModel, ValueModel } from '@coolon/pectin';
1
+ import { Form, IMutableListModel, IMutableValueModel } from '@coolon/pectin';
2
2
  export interface CellEditorComponent<T> {
3
- valueModel: ValueModel<T> | Form.ValueModelBase<T>;
3
+ valueModel: IMutableValueModel<T> | Form.ValueModelBase<T>;
4
4
  requestFocus?(): any;
5
5
  }
6
6
  export interface CellListEditorComponent<T> {
7
- listModel: ListModel<T> | Form.ListModelBase<T>;
7
+ listModel: IMutableListModel<T> | Form.ListModelBase<T>;
8
8
  requestFocus?(): any;
9
9
  }
@@ -1,9 +1,9 @@
1
1
  import { ComponentType } from '@angular/cdk/overlay';
2
2
  import { TemplateRef, ViewContainerRef } from '@angular/core';
3
3
  import { ColumnModel, RowData } from './column-model';
4
- import { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';
5
- import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
6
4
  import { EditSession } from './edit-session';
5
+ import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
6
+ import { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';
7
7
  export declare const HEADER_CELL_RENDERER_PORTAL: unique symbol;
8
8
  export declare const CELL_RENDERER_PORTAL: unique symbol;
9
9
  export declare const CELL_EDITOR_PORTAL: unique symbol;
@@ -26,8 +26,8 @@ export declare abstract class CellRendererPortalRef<Row, Portal> extends CellPor
26
26
  }
27
27
  export declare class ComponentCellRendererPortalRef<Row, Portal> extends CellRendererPortalRef<Row, Portal> {
28
28
  readonly componentType: ComponentType<Portal>;
29
- readonly updateComponent: (component: Portal, rowData: RowData<Row>) => void;
30
- constructor(componentType: ComponentType<Portal>, updateComponent: (component: Portal, rowData: RowData<Row>) => void);
29
+ readonly updateComponent: (component: Portal, rowData: RowData<Row>, firstTime: boolean) => void;
30
+ constructor(componentType: ComponentType<Portal>, updateComponent: (component: Portal, rowData: RowData<Row>, firstTime: boolean) => void);
31
31
  initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>): void;
32
32
  onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal): void;
33
33
  pushState(host: TableCellRendererComponent<Row>): void;
@@ -2,9 +2,11 @@ import { ComponentType } from '@angular/cdk/overlay';
2
2
  import { TemplateRef, ViewContainerRef } from '@angular/core';
3
3
  import { Command, DirtyTrackingForm, SelectionModel, Types, UnaryCommand, Validator } from '@coolon/pectin';
4
4
  import { CellEditorComponent, CellListEditorComponent } from './cell-editors';
5
- import { CellEditorPortalRef, CellHeaderPortalRef, CellRendererPortalRef } from './cell-protal-ref';
5
+ import { CellEditorPortalRef, CellHeaderPortalRef, CellRendererPortalRef } from './cell-portal-ref';
6
+ import { CellRenderer } from './cell-renderer';
6
7
  import { ColumnTextProperties } from './column-text-properties';
7
8
  import { EditSession } from './edit-session';
9
+ import { MutableCellRenderer } from './mutable-cell-renderer';
8
10
  import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
9
11
  import { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';
10
12
  export interface RowData<Row> {
@@ -12,6 +14,14 @@ export interface RowData<Row> {
12
14
  editSession?: EditSession<Row>;
13
15
  editRowCommand: Command<void>;
14
16
  }
17
+ export declare type OnComponentInit<C> = (component: C) => void;
18
+ export interface CellRendererOptions<Row, E> {
19
+ onComponentInit?: (component: E) => void;
20
+ onRowUpdate?: (component: E, row: Row) => void;
21
+ }
22
+ export interface MutableCellRendererOptions<Row, E, P extends keyof Row> extends CellRendererOptions<Row, E> {
23
+ onValueEdit: (row: Row, is: Row[P], was: Row[P]) => void;
24
+ }
15
25
  export declare class ColumnModel<Row> {
16
26
  readonly columnId: string;
17
27
  private defaults;
@@ -46,17 +56,13 @@ export declare namespace ColumnModel {
46
56
  getColumnTextProperties(columnModel: ColumnModel<any>): ColumnTextProperties;
47
57
  }
48
58
  }
49
- export interface CellEditorOptions<V, C> {
50
- validators?: Validator<V>[];
51
- initialiseComponent?(component: C): any;
52
- }
53
59
  export declare class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<Row>> extends ColumnModel<Row> {
54
60
  readonly property: P;
55
61
  private _format;
56
- constructor(property: P, defaults: ColumnModel.Defaults);
57
- cellRenderer(componentType: ComponentType<{
58
- value: Row[P];
59
- }>): this;
62
+ constructor(id: string, property: P, defaults: ColumnModel.Defaults);
63
+ cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this;
64
+ cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this;
65
+ mutableCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this;
60
66
  cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validators?: Validator<Row[P]>[], initialiseComponent?: (component: E) => void): this;
61
67
  cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, initialiseComponent?: (component: E) => void): this;
62
68
  format(formatter: (value: Row[P]) => any): this;
@@ -65,7 +71,7 @@ export declare class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<
65
71
  export declare class ListPropertyColumnModel<Row, P extends Types.ArrayPropertiesOf<Row>> extends ColumnModel<Row> {
66
72
  readonly property: P;
67
73
  private _format;
68
- constructor(property: P, defaults: ColumnModel.Defaults);
74
+ constructor(id: string, property: P, defaults: ColumnModel.Defaults);
69
75
  cellRenderer(componentType: ComponentType<{
70
76
  value: Types.ArrayElementType<Row, P>[];
71
77
  }>): this;
@@ -77,9 +83,9 @@ export declare class ListPropertyColumnModel<Row, P extends Types.ArrayPropertie
77
83
  export declare class CustomValueColumnModel<Row, V> extends ColumnModel<Row> {
78
84
  private getValue;
79
85
  constructor(columnId: string, defaults: ColumnModel.Defaults, getValue: (row: Row) => V);
80
- cellRenderer(componentType: ComponentType<{
86
+ cellRenderer<C extends {
81
87
  value: V;
82
- }>): this;
88
+ }>(componentType: ComponentType<C>, onComponentInitOrOptions?: CellRendererOptions<Row, C> | OnComponentInit<C>): this;
83
89
  selectRowOnClick(selectOnRowClick: boolean): this;
84
90
  }
85
91
  export declare class EditorControlColumnModel<Row> extends ColumnModel<Row> {
@@ -0,0 +1,6 @@
1
+ import { CellRenderer } from './cell-renderer';
2
+ import { Disposable } from '@coolon/pectin';
3
+ export interface MutableCellRenderer<T> extends CellRenderer<T> {
4
+ value: T;
5
+ onValueEdited(callback: (is: T, was: T) => void): Disposable;
6
+ }
@@ -5,7 +5,7 @@ import { CellEditorComponent, CellListEditorComponent } from '../cell-editors';
5
5
  import { ColumnModel, RowData } from '../column-model';
6
6
  import { EditSession } from '../edit-session';
7
7
  import { TableModel } from '../table-model';
8
- import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-protal-ref';
8
+ import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';
9
9
  export declare class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {
10
10
  row: Row;
11
11
  column: ColumnModel<Row>;
@@ -1,7 +1,7 @@
1
1
  import { Portal } from '@angular/cdk/portal';
2
2
  import { OnInit } from '@angular/core';
3
3
  import { ColumnModel } from '../column-model';
4
- import { HEADER_CELL_RENDERER_PORTAL } from '../cell-protal-ref';
4
+ import { HEADER_CELL_RENDERER_PORTAL } from '../cell-portal-ref';
5
5
  export declare class TableHeaderCellRendererComponent implements OnInit {
6
6
  column: ColumnModel<any>;
7
7
  defaultClassNames: string;
@@ -1,5 +1,6 @@
1
+ import { ComponentType } from '@angular/cdk/overlay';
1
2
  import { BooleanValueModelChain, CanIdentify, DirtyTrackingForm, ListModel, ListModelChain, SelectionModel, Types, UnaryCommand, ValueModelChain } from '@coolon/pectin';
2
- import { ColumnModel, CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, PropertyColumnModel, SelectionColumnModel } from './column-model';
3
+ import { CellRendererOptions, ColumnModel, CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, OnComponentInit, PropertyColumnModel, SelectionColumnModel } from './column-model';
3
4
  import { ColumnTextProperties } from './column-text-properties';
4
5
  import { EditSession } from './edit-session';
5
6
  /**
@@ -93,13 +94,23 @@ export declare class TableModel<Row> {
93
94
  private _createForm;
94
95
  protected constructor(sourceOfTruth: ListModel<Row>);
95
96
  get rowsBeingEdited(): ListModel<Row>;
96
- getTrackByFunction(): (index: number, item: Row) => any;
97
+ readonly trackBy: (index: number, item: Row) => any;
97
98
  get columns(): ListModel<ColumnModel<Row>>;
98
- pluck<P extends Types.ValuePropertiesOf<Row>>(property: P): PropertyColumnModel<Row, P>;
99
- pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P): ListPropertyColumnModel<Row, P>;
99
+ pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: {
100
+ columnId: string;
101
+ }): PropertyColumnModel<Row, P>;
102
+ pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: {
103
+ columnId: string;
104
+ }): ListPropertyColumnModel<Row, P>;
100
105
  addSelectionColumn(selectionModel: SelectionModel<Row>): SelectionColumnModel<Row>;
101
106
  addEditControls(saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>): EditorControlColumnModel<Row>;
102
107
  addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V>;
108
+ addComponentColumn<C extends {
109
+ value: Row;
110
+ }>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>;
111
+ addComponentColumn<C extends {
112
+ value: Row;
113
+ }>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>;
103
114
  addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row>;
104
115
  addRowClass(className: string, predicate: (row: Row) => boolean): void;
105
116
  getRowClasses(row: Row): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.21",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "dependencies": {
6
6
  "@coolon/typescript-utilities": "^2.0.0",
@@ -11,12 +11,12 @@
11
11
  "@angular/platform-browser": "^9.1.9",
12
12
  "factory.ts": "^0.5.1",
13
13
  "faker": "^4.1.0",
14
- "immer": "^6.0.5",
15
14
  "@angular/platform-browser-dynamic": "^9.1.9",
16
15
  "@angular/flex-layout": "^9.0.0-beta.31",
17
16
  "@angular/router": "^9.1.9",
18
17
  "rxjs": "~6.5.5",
19
- "reflect-metadata": "^0.1.13"
18
+ "reflect-metadata": "^0.1.13",
19
+ "zone.js": "~0.10.2"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@angular/common": "^9.1.9",
@@ -24,7 +24,7 @@
24
24
  "@angular/material": "^9.2.4",
25
25
  "@angular/animations": "^9.1.9",
26
26
  "@angular/cdk": "^9.2.4",
27
- "@coolon/pectin": ">=2.9.0",
27
+ "@coolon/pectin": ">=3.0.0-alpha.27",
28
28
  "resize-observer-polyfill": "^1.5.1",
29
29
  "@fortawesome/angular-fontawesome": "^0.6.1",
30
30
  "@fortawesome/fontawesome-svg-core": "^1.2.28",
@@ -1 +0,0 @@
1
- {"version":3,"file":"cell-protal-ref.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/cell-protal-ref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMtD,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,wCAAwC,CAAC,CAAC;AAC5F,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,iCAAiC,CAAC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AQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,WAAW;IACX,gBAAgB,CAAC,IAAqC,EAAE,eAA0B;QAChF,cAAc;IAChB,CAAC;IAED,SAAS,CAAC,IAAqC;QAC7C,IAAI,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChC,CAAC;IAEO,YAAY,CAAC,IAAkB;QACrC,OAAO,IAAI,cAAc,CAAM,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,kCAAO,CAAC,IAAI,CAAC,KAAE,SAAS,EAAE,IAAI,CAAC,GAAG,IAAG,CAAC;IAC3G,CAAC;CACF","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport { assert } from '@coolon/typescript-utilities';\nimport { ColumnModel, RowData } from './column-model';\nimport { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';\nimport { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';\nimport { EditSession } from './edit-session';\n\nexport const HEADER_CELL_RENDERER_PORTAL = Symbol('aup-cell-header-renderer-component-ref');\nexport const CELL_RENDERER_PORTAL = Symbol('aup-cell-renderer-component-ref');\nexport const CELL_EDITOR_PORTAL = Symbol('aup-cell-editor-component-ref');\nexport const PORTAL_RENDERER_COMPONENT = Symbol('aup-cell-renderer-portal-component');\nexport const PORTAL_EDITOR_COMPONENT = Symbol('aup-cell-editor-portal-component');\n\n\nexport abstract class CellPortalRef<Row, Host, Portal> {\n constructor() {\n }\n\n abstract initialiseHost(host: Host, columnModel: ColumnModel<Row>)\n\n abstract onPortalAttached(host: Host, portalComponent: Portal);\n}\n\nexport class CellHeaderPortalRef<Row, C> extends CellPortalRef<Row, TableHeaderCellRendererComponent, C> {\n constructor(readonly componentType: ComponentType<C>, readonly initialiseHeader: (component: C, columnModel: ColumnModel<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableHeaderCellRendererComponent, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n onPortalAttached(host: TableHeaderCellRendererComponent, portalComponent: C) {\n this.initialiseHeader(portalComponent, host.column);\n }\n\n}\n\nexport abstract class CellRendererPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellRendererComponent<Row>, Portal> {\n abstract pushState(host: TableCellRendererComponent<Row>): void;\n}\n\nexport class ComponentCellRendererPortalRef<Row, Portal> extends CellRendererPortalRef<Row, Portal> {\n\n\n constructor(readonly componentType: ComponentType<Portal>, readonly updateComponent: (component: Portal, rowData: RowData<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n host[CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal) {\n host[PORTAL_RENDERER_COMPONENT] = portalComponent;\n this.updateComponent(portalComponent, host.getRowData());\n }\n\n pushState(host: TableCellRendererComponent<Row>): void {\n if (host[PORTAL_RENDERER_COMPONENT]) {\n this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData());\n }\n }\n\n}\n\nexport class CellEditorPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellRendererComponent<Row>, Portal> {\n\n constructor(readonly componentType: ComponentType<Portal>, readonly initialiseEditorSession: (component: Portal, editSession: EditSession<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n host[CELL_EDITOR_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n // @Trace()\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal) {\n host[PORTAL_EDITOR_COMPONENT] = portalComponent;\n this.initialiseEditorSession(portalComponent, host.editSession);\n }\n\n}\n\nexport class TemplateCellRendererPortalRef<Row> extends CellRendererPortalRef<Row, undefined> {\n\n private templateRef: TemplateRef<any>;\n private viewContainer: ViewContainerRef;\n private fillCell: boolean;\n private padChild: boolean;\n\n constructor() {\n super();\n }\n\n public registerPortal(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n this.templateRef = templateRef;\n this.viewContainer = viewContainer;\n this.fillCell = fillCell;\n this.padChild = padChild;\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n }\n\n // @Trace()\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: undefined) {\n // don't care\n }\n\n pushState(host: TableCellRendererComponent<Row>): void {\n host[CELL_RENDERER_PORTAL] = this.createPortal(host.getRowData());\n host.fillCell = this.fillCell;\n host.padChild = this.padChild;\n }\n\n private createPortal(data: RowData<Row>) {\n return new TemplatePortal<any>(this.templateRef, this.viewContainer, { ...(data), $implicit: data.row });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cell-protal-ref.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/cell-protal-ref.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMtD,MAAM,CAAC,IAAM,2BAA2B,GAAG,MAAM,CAAC,wCAAwC,CAAC,CAAC;AAC5F,MAAM,CAAC,IAAM,oBAAoB,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAC9E,MAAM,CAAC,IAAM,kBAAkB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC1E,MAAM,CAAC,IAAM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AAG,QAAQ,CAAC;IAC3B,CAAC;IAED,sDAAc,GAAd,UAAe,IAAqC,EAAE,WAA6B;QACjF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,WAAW;IACX,wDAAgB,GAAhB,UAAiB,IAAqC,EAAE,eAA0B;QAChF,cAAc;IAChB,CAAC;IAED,iDAAS,GAAT,UAAU,IAAqC;QAC7C,IAAI,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChC,CAAC;IAEO,oDAAY,GAApB,UAAqB,IAAkB;QACrC,OAAO,IAAI,cAAc,CAAM,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,wBAAO,CAAC,IAAI,CAAC,KAAE,SAAS,EAAE,IAAI,CAAC,GAAG,IAAG,CAAC;IAC3G,CAAC;IACH,oCAAC;AAAD,CAAC,AApCD,CAAwD,qBAAqB,GAoC5E","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport { assert } from '@coolon/typescript-utilities';\nimport { ColumnModel, RowData } from './column-model';\nimport { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';\nimport { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';\nimport { EditSession } from './edit-session';\n\nexport const HEADER_CELL_RENDERER_PORTAL = Symbol('aup-cell-header-renderer-component-ref');\nexport const CELL_RENDERER_PORTAL = Symbol('aup-cell-renderer-component-ref');\nexport const CELL_EDITOR_PORTAL = Symbol('aup-cell-editor-component-ref');\nexport const PORTAL_RENDERER_COMPONENT = Symbol('aup-cell-renderer-portal-component');\nexport const PORTAL_EDITOR_COMPONENT = Symbol('aup-cell-editor-portal-component');\n\n\nexport abstract class CellPortalRef<Row, Host, Portal> {\n constructor() {\n }\n\n abstract initialiseHost(host: Host, columnModel: ColumnModel<Row>)\n\n abstract onPortalAttached(host: Host, portalComponent: Portal);\n}\n\nexport class CellHeaderPortalRef<Row, C> extends CellPortalRef<Row, TableHeaderCellRendererComponent, C> {\n constructor(readonly componentType: ComponentType<C>, readonly initialiseHeader: (component: C, columnModel: ColumnModel<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableHeaderCellRendererComponent, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n onPortalAttached(host: TableHeaderCellRendererComponent, portalComponent: C) {\n this.initialiseHeader(portalComponent, host.column);\n }\n\n}\n\nexport abstract class CellRendererPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellRendererComponent<Row>, Portal> {\n abstract pushState(host: TableCellRendererComponent<Row>): void;\n}\n\nexport class ComponentCellRendererPortalRef<Row, Portal> extends CellRendererPortalRef<Row, Portal> {\n\n\n constructor(readonly componentType: ComponentType<Portal>, readonly updateComponent: (component: Portal, rowData: RowData<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n host[CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal) {\n host[PORTAL_RENDERER_COMPONENT] = portalComponent;\n this.updateComponent(portalComponent, host.getRowData());\n }\n\n pushState(host: TableCellRendererComponent<Row>): void {\n if (host[PORTAL_RENDERER_COMPONENT]) {\n this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData());\n }\n }\n\n}\n\nexport class CellEditorPortalRef<Row, Portal> extends CellPortalRef<Row, TableCellRendererComponent<Row>, Portal> {\n\n constructor(readonly componentType: ComponentType<Portal>, readonly initialiseEditorSession: (component: Portal, editSession: EditSession<Row>) => void) {\n super();\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n host[CELL_EDITOR_PORTAL] = new ComponentPortal(this.componentType);\n }\n\n // @Trace()\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal) {\n host[PORTAL_EDITOR_COMPONENT] = portalComponent;\n this.initialiseEditorSession(portalComponent, host.editSession);\n }\n\n}\n\nexport class TemplateCellRendererPortalRef<Row> extends CellRendererPortalRef<Row, undefined> {\n\n private templateRef: TemplateRef<any>;\n private viewContainer: ViewContainerRef;\n private fillCell: boolean;\n private padChild: boolean;\n\n constructor() {\n super();\n }\n\n public registerPortal(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n this.templateRef = templateRef;\n this.viewContainer = viewContainer;\n this.fillCell = fillCell;\n this.padChild = padChild;\n }\n\n initialiseHost(host: TableCellRendererComponent<Row>, columnModel: ColumnModel<Row>) {\n assert.isTruthy(host);\n }\n\n // @Trace()\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: undefined) {\n // don't care\n }\n\n pushState(host: TableCellRendererComponent<Row>): void {\n host[CELL_RENDERER_PORTAL] = this.createPortal(host.getRowData());\n host.fillCell = this.fillCell;\n host.padChild = this.padChild;\n }\n\n private createPortal(data: RowData<Row>) {\n return new TemplatePortal<any>(this.templateRef, this.viewContainer, { ...(data), $implicit: data.row });\n }\n}\n"]}