@coolon/angular-ui-powerups 2.0.0-alpha.19 → 2.0.0-alpha.2
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 +0 -119
- package/assets/form.scss +0 -33
- package/bundles/coolon-angular-ui-powerups.umd.js +323 -537
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +54 -55
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +52 -53
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/card-container/card-container.component.js +1 -1
- package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.js +12 -29
- 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/abstract-input.component.js +6 -26
- 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/esm2015/lib/components/forms/abstract-list-input.component.js +6 -51
- package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js +7 -46
- package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +7 -4
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js +13 -8
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +7 -4
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +8 -5
- package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +5 -8
- 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 +8 -4
- 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/esm2015/lib/components/forms/text-input/text-input.component.js +7 -4
- package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
- package/esm2015/lib/components/index.js +1 -2
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/cell-editors.js.map +1 -1
- package/esm2015/lib/components/table/{cell-portal-ref.js → cell-protal-ref.js} +3 -7
- package/esm2015/lib/components/table/cell-protal-ref.js.map +1 -0
- package/esm2015/lib/components/table/{cell-portal-ref.metadata.json → cell-protal-ref.metadata.json} +1 -1
- package/esm2015/lib/components/table/column-model.js +11 -37
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-model.js +5 -8
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +7 -2
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/place-component.js +1 -1
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-router.js +8 -2
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +3 -2
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
- package/esm5/coolon-angular-ui-powerups.js +52 -53
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/card-container/card-container.component.js +1 -1
- package/esm5/lib/components/components.module.js +12 -29
- 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/abstract-input.component.js +6 -34
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js +6 -56
- package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js +7 -51
- package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +7 -4
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js +13 -8
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +7 -4
- package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +8 -5
- package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +5 -8
- 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 +8 -4
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js +7 -4
- package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm5/lib/components/index.js +1 -2
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/cell-editors.js.map +1 -1
- package/esm5/lib/components/table/{cell-portal-ref.js → cell-protal-ref.js} +3 -7
- package/esm5/lib/components/table/cell-protal-ref.js.map +1 -0
- package/esm5/lib/components/table/column-model.js +11 -37
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-model.js +5 -8
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +7 -2
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm5/lib/place/place-component.js +1 -1
- package/esm5/lib/place/place-component.js.map +1 -1
- package/esm5/lib/place/place-router.js +8 -2
- package/esm5/lib/place/place-router.js.map +1 -1
- package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm5/lib/place/route/parameter-decorators.js +3 -2
- package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +241 -433
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +256 -469
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +3 -12
- package/lib/components/forms/abstract-list-input.component.d.ts +3 -10
- package/lib/components/forms/abstract-value-input.component.d.ts +3 -9
- package/lib/components/forms/checkbox-input/checkbox-input.component.d.ts +2 -0
- package/lib/components/forms/multiple-select-input/multiple-select-input.component.d.ts +4 -8
- package/lib/components/forms/number-input/number-input.component.d.ts +2 -0
- package/lib/components/forms/password-input/password-input.component.d.ts +2 -0
- package/lib/components/forms/select-input/select-input.component.d.ts +2 -8
- package/lib/components/forms/string-input/string-input.component.d.ts +2 -1
- package/lib/components/forms/text-input/text-input.component.d.ts +2 -0
- package/lib/components/index.d.ts +1 -2
- package/lib/components/table/cell-editors.d.ts +3 -3
- package/lib/components/table/{cell-portal-ref.d.ts → cell-protal-ref.d.ts} +4 -4
- package/lib/components/table/column-model.d.ts +7 -15
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-model.d.ts +3 -14
- package/package.json +4 -4
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +0 -70
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +0 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +0 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/table/cell-portal-ref.js.map +0 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +0 -73
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +0 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map +0 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.js.map +0 -1
- package/esm5/lib/components/table/cell-portal-ref.js.map +0 -1
- package/lib/components/forms/autocomplete-input/autocomplete-input.component.d.ts +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { ErrorStateMatcher } from '@angular/material/core';
|
|
3
|
-
import { Command,
|
|
3
|
+
import { Command, FocusManager, ListModel, ValueModel } from '@coolon/pectin';
|
|
4
4
|
import { DisposableComponent } from '../disposable-component';
|
|
5
5
|
interface InputModel<T> {
|
|
6
6
|
value: T;
|
|
@@ -9,13 +9,11 @@ interface InputModel<T> {
|
|
|
9
9
|
focusContext: FocusManager.Context;
|
|
10
10
|
}
|
|
11
11
|
export declare class AbstractInputComponent<T> extends DisposableComponent implements OnInit {
|
|
12
|
-
protected
|
|
13
|
-
protected formValueModel: InputModel<T>;
|
|
12
|
+
protected inputModel: InputModel<T>;
|
|
14
13
|
label: string;
|
|
15
|
-
|
|
14
|
+
floatLabel: 'auto' | 'always' | 'never';
|
|
16
15
|
hint: string;
|
|
17
16
|
placeholder: string;
|
|
18
|
-
dense: boolean;
|
|
19
17
|
focusCommand: Command<any>;
|
|
20
18
|
blurCommand: Command<any>;
|
|
21
19
|
enterCommand: Command<any>;
|
|
@@ -41,12 +39,5 @@ export declare class AbstractInputComponent<T> extends DisposableComponent imple
|
|
|
41
39
|
get errorList(): ListModel<string>;
|
|
42
40
|
get firstError(): string;
|
|
43
41
|
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;
|
|
51
42
|
}
|
|
52
43
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Form
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form } 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>;
|
|
6
5
|
/**
|
|
7
6
|
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
8
7
|
*
|
|
@@ -13,11 +12,5 @@ export declare class AbstractListInputComponent<T> extends AbstractInputComponen
|
|
|
13
12
|
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
14
13
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
|
-
readonly componentListModel: MutableListModel<T>;
|
|
18
|
-
private setValueIsInProgress;
|
|
19
|
-
private listHolder;
|
|
20
|
-
set value(value: T[]);
|
|
21
|
-
readonly valueChange: EventEmitter<T[]>;
|
|
22
|
-
constructor();
|
|
15
|
+
readonly inputModel: Form.DelegatingListModel<T>;
|
|
23
16
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Form
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form } 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>;
|
|
6
5
|
/**
|
|
7
6
|
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
8
7
|
*
|
|
@@ -13,11 +12,6 @@ export declare class AbstractValueInputComponent<T> extends AbstractInputCompone
|
|
|
13
12
|
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
14
13
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
|
-
protected setValueInProgress: Guard;
|
|
18
|
-
readonly componentValueModel: MutableValueModel<T>;
|
|
19
|
-
private plainValueHolder;
|
|
20
|
-
set value(value: T);
|
|
21
|
-
readonly valueChange: EventEmitter<T>;
|
|
15
|
+
readonly inputModel: Form.DelegatingValueModel<T>;
|
|
22
16
|
constructor();
|
|
23
17
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form, IMutableValueModel } from '@coolon/pectin';
|
|
2
3
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
3
4
|
export declare class CheckboxInputComponent extends AbstractValueInputComponent<boolean> implements OnInit {
|
|
5
|
+
valueModel: Form.ValueModelBase<boolean> | IMutableValueModel<boolean>;
|
|
4
6
|
color: 'primary' | 'warn' | 'accent';
|
|
5
7
|
labelPosition: 'before' | 'after';
|
|
6
8
|
constructor();
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
|
-
import { ListModel } from '@coolon/pectin';
|
|
2
|
+
import { Form, IMutableListModel, 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
|
-
*/
|
|
11
4
|
export declare class MultipleSelectInputComponent<T = any> extends AbstractListInputComponent<T> implements OnInit {
|
|
5
|
+
listModel: Form.ListModelBase<T> | IMutableListModel<T>;
|
|
12
6
|
optionsModel: ListModel<T>;
|
|
13
7
|
options: T[];
|
|
14
8
|
optionLabel: keyof T;
|
|
9
|
+
allowNil: boolean;
|
|
15
10
|
optionTemplateRef: TemplateRef<any>;
|
|
11
|
+
nilOptionTemplateRef: TemplateRef<any>;
|
|
16
12
|
optionLabelFormat: (option: T) => any;
|
|
17
13
|
constructor();
|
|
18
14
|
ngOnInit(): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form, IMutableValueModel } from '@coolon/pectin';
|
|
2
3
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
3
4
|
export declare class NumberInputComponent extends AbstractValueInputComponent<number> implements OnInit {
|
|
5
|
+
valueModel: Form.ValueModelBase<number> | IMutableValueModel<number>;
|
|
4
6
|
min: number;
|
|
5
7
|
max: number;
|
|
6
8
|
constructor();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form, IMutableValueModel } from '@coolon/pectin';
|
|
2
3
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
3
4
|
export declare class PasswordInputComponent extends AbstractValueInputComponent<string> implements OnInit {
|
|
5
|
+
valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
|
|
4
6
|
constructor();
|
|
5
7
|
ngOnInit(): void;
|
|
6
8
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
|
-
import { ListModel } from '@coolon/pectin';
|
|
2
|
+
import { IMutableValueModel, ListModel, Form } 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
|
-
*/
|
|
11
4
|
export declare class SelectInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {
|
|
5
|
+
valueModel: Form.ValueModelBase<T> | IMutableValueModel<T>;
|
|
12
6
|
optionsModel: ListModel<T>;
|
|
13
7
|
options: T[];
|
|
14
8
|
optionLabel: keyof T;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import { Command, ValueModel } from '@coolon/pectin';
|
|
2
|
+
import { Command, Form, IMutableValueModel, 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>;
|
|
5
6
|
enableClearModel: ValueModel<boolean>;
|
|
6
7
|
enableClear: boolean;
|
|
7
8
|
readonly clearCommand: Command<void>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Form, IMutableValueModel } from '@coolon/pectin';
|
|
2
3
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
3
4
|
export declare class TextInputComponent extends AbstractValueInputComponent<string> implements OnInit {
|
|
5
|
+
valueModel: Form.ValueModelBase<string> | IMutableValueModel<string>;
|
|
4
6
|
rows: number;
|
|
5
7
|
cols: number;
|
|
6
8
|
constructor();
|
|
@@ -10,7 +10,6 @@ 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";
|
|
14
13
|
export * from "./forms/checkbox-input/checkbox-input.component";
|
|
15
14
|
export * from "./forms/multiple-select-input/multiple-select-input.component";
|
|
16
15
|
export * from "./forms/number-input/number-input.component";
|
|
@@ -24,7 +23,7 @@ export * from "./scroll-container/scroll-container.component";
|
|
|
24
23
|
export * from "./section-header/section-header.component";
|
|
25
24
|
export * from "./switch-case/switch-case.component";
|
|
26
25
|
export * from "./table/cell-editors";
|
|
27
|
-
export * from "./table/cell-
|
|
26
|
+
export * from "./table/cell-protal-ref";
|
|
28
27
|
export * from "./table/cell-renderer";
|
|
29
28
|
export * from "./table/column-model";
|
|
30
29
|
export * from "./table/column-text-properties";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Form,
|
|
1
|
+
import { Form, ListModel, ValueModel } from '@coolon/pectin';
|
|
2
2
|
export interface CellEditorComponent<T> {
|
|
3
|
-
valueModel:
|
|
3
|
+
valueModel: ValueModel<T> | Form.ValueModelBase<T>;
|
|
4
4
|
requestFocus?(): any;
|
|
5
5
|
}
|
|
6
6
|
export interface CellListEditorComponent<T> {
|
|
7
|
-
listModel:
|
|
7
|
+
listModel: ListModel<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 { EditSession } from './edit-session';
|
|
5
|
-
import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
|
|
6
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
|
+
import { EditSession } from './edit-session';
|
|
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
|
|
30
|
-
constructor(componentType: ComponentType<Portal>, updateComponent: (component: Portal, rowData: RowData<Row
|
|
29
|
+
readonly updateComponent: (component: Portal, rowData: RowData<Row>) => void;
|
|
30
|
+
constructor(componentType: ComponentType<Portal>, updateComponent: (component: Portal, rowData: RowData<Row>) => 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,7 +2,7 @@ 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-
|
|
5
|
+
import { CellEditorPortalRef, CellHeaderPortalRef, CellRendererPortalRef } from './cell-protal-ref';
|
|
6
6
|
import { ColumnTextProperties } from './column-text-properties';
|
|
7
7
|
import { EditSession } from './edit-session';
|
|
8
8
|
import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
|
|
@@ -50,21 +50,13 @@ export interface CellEditorOptions<V, C> {
|
|
|
50
50
|
validators?: Validator<V>[];
|
|
51
51
|
initialiseComponent?(component: C): any;
|
|
52
52
|
}
|
|
53
|
-
export declare type OnComponentInit<C> = (component: C) => void;
|
|
54
|
-
export interface CellRendererOptions<Row, E> {
|
|
55
|
-
onComponentInit?: (component: E) => void;
|
|
56
|
-
onRowUpdate?: (component: E, row: Row) => void;
|
|
57
|
-
}
|
|
58
53
|
export declare class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<Row>> extends ColumnModel<Row> {
|
|
59
54
|
readonly property: P;
|
|
60
55
|
private _format;
|
|
61
|
-
constructor(
|
|
62
|
-
cellRenderer<
|
|
63
|
-
value: Row[P];
|
|
64
|
-
}>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this;
|
|
65
|
-
cellRenderer<E extends {
|
|
56
|
+
constructor(property: P, defaults: ColumnModel.Defaults);
|
|
57
|
+
cellRenderer(componentType: ComponentType<{
|
|
66
58
|
value: Row[P];
|
|
67
|
-
}>
|
|
59
|
+
}>): this;
|
|
68
60
|
cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validators?: Validator<Row[P]>[], initialiseComponent?: (component: E) => void): this;
|
|
69
61
|
cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, initialiseComponent?: (component: E) => void): this;
|
|
70
62
|
format(formatter: (value: Row[P]) => any): this;
|
|
@@ -73,7 +65,7 @@ export declare class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<
|
|
|
73
65
|
export declare class ListPropertyColumnModel<Row, P extends Types.ArrayPropertiesOf<Row>> extends ColumnModel<Row> {
|
|
74
66
|
readonly property: P;
|
|
75
67
|
private _format;
|
|
76
|
-
constructor(
|
|
68
|
+
constructor(property: P, defaults: ColumnModel.Defaults);
|
|
77
69
|
cellRenderer(componentType: ComponentType<{
|
|
78
70
|
value: Types.ArrayElementType<Row, P>[];
|
|
79
71
|
}>): this;
|
|
@@ -85,9 +77,9 @@ export declare class ListPropertyColumnModel<Row, P extends Types.ArrayPropertie
|
|
|
85
77
|
export declare class CustomValueColumnModel<Row, V> extends ColumnModel<Row> {
|
|
86
78
|
private getValue;
|
|
87
79
|
constructor(columnId: string, defaults: ColumnModel.Defaults, getValue: (row: Row) => V);
|
|
88
|
-
cellRenderer<
|
|
80
|
+
cellRenderer(componentType: ComponentType<{
|
|
89
81
|
value: V;
|
|
90
|
-
}>
|
|
82
|
+
}>): this;
|
|
91
83
|
selectRowOnClick(selectOnRowClick: boolean): this;
|
|
92
84
|
}
|
|
93
85
|
export declare class EditorControlColumnModel<Row> extends ColumnModel<Row> {
|
|
@@ -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-
|
|
8
|
+
import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-protal-ref';
|
|
9
9
|
export declare class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {
|
|
10
10
|
row: Row;
|
|
11
11
|
column: ColumnModel<Row>;
|
package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts
CHANGED
|
@@ -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-
|
|
4
|
+
import { HEADER_CELL_RENDERER_PORTAL } from '../cell-protal-ref';
|
|
5
5
|
export declare class TableHeaderCellRendererComponent implements OnInit {
|
|
6
6
|
column: ColumnModel<any>;
|
|
7
7
|
defaultClassNames: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
1
|
import { BooleanValueModelChain, CanIdentify, DirtyTrackingForm, ListModel, ListModelChain, SelectionModel, Types, UnaryCommand, ValueModelChain } from '@coolon/pectin';
|
|
3
|
-
import {
|
|
2
|
+
import { ColumnModel, CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, PropertyColumnModel, SelectionColumnModel } from './column-model';
|
|
4
3
|
import { ColumnTextProperties } from './column-text-properties';
|
|
5
4
|
import { EditSession } from './edit-session';
|
|
6
5
|
/**
|
|
@@ -96,21 +95,11 @@ export declare class TableModel<Row> {
|
|
|
96
95
|
get rowsBeingEdited(): ListModel<Row>;
|
|
97
96
|
getTrackByFunction(): (index: number, item: Row) => any;
|
|
98
97
|
get columns(): ListModel<ColumnModel<Row>>;
|
|
99
|
-
pluck<P extends Types.ValuePropertiesOf<Row>>(property: P,
|
|
100
|
-
|
|
101
|
-
}): PropertyColumnModel<Row, P>;
|
|
102
|
-
pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: {
|
|
103
|
-
columnId: string;
|
|
104
|
-
}): ListPropertyColumnModel<Row, P>;
|
|
98
|
+
pluck<P extends Types.ValuePropertiesOf<Row>>(property: P): PropertyColumnModel<Row, P>;
|
|
99
|
+
pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P): ListPropertyColumnModel<Row, P>;
|
|
105
100
|
addSelectionColumn(selectionModel: SelectionModel<Row>): SelectionColumnModel<Row>;
|
|
106
101
|
addEditControls(saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>): EditorControlColumnModel<Row>;
|
|
107
102
|
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>;
|
|
114
103
|
addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row>;
|
|
115
104
|
addRowClass(className: string, predicate: (row: Row) => boolean): void;
|
|
116
105
|
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.
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
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",
|
|
14
15
|
"@angular/platform-browser-dynamic": "^9.1.9",
|
|
15
16
|
"@angular/flex-layout": "^9.0.0-beta.31",
|
|
16
17
|
"@angular/router": "^9.1.9",
|
|
17
18
|
"rxjs": "~6.5.5",
|
|
18
|
-
"reflect-metadata": "^0.1.13"
|
|
19
|
-
"zone.js": "~0.10.2"
|
|
19
|
+
"reflect-metadata": "^0.1.13"
|
|
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": ">=
|
|
27
|
+
"@coolon/pectin": ">=2.9.0",
|
|
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,70 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
|
3
|
-
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal } from '@coolon/pectin';
|
|
4
|
-
import _ from 'lodash';
|
|
5
|
-
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
6
|
-
/**
|
|
7
|
-
* Using templates (not only supported for nil values:
|
|
8
|
-
* <aup-autocomplete-input [valueModel]="myModel" [options]="myOptions">
|
|
9
|
-
* <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
10
|
-
* </aup-autocomplete-input>
|
|
11
|
-
*/
|
|
12
|
-
let AutocompleteInputComponent = class AutocompleteInputComponent extends AbstractValueInputComponent {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.filterValue = new MutableValueModel();
|
|
16
|
-
this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
|
|
17
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
18
|
-
const lowerCaseFilterValue = chain(this.filterValue)
|
|
19
|
-
.map(v => _.isString(v) ? v.toLowerCase() : '');
|
|
20
|
-
this.filteredOptions = chain(this.optionsModel)
|
|
21
|
-
.select(option => {
|
|
22
|
-
return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
23
|
-
}, { dependsOn: lowerCaseFilterValue });
|
|
24
|
-
}
|
|
25
|
-
ngOnInit() {
|
|
26
|
-
}
|
|
27
|
-
formatOption(option) {
|
|
28
|
-
return this.optionLabelFormat(option);
|
|
29
|
-
}
|
|
30
|
-
updateFilter($event) {
|
|
31
|
-
this.filterValue.value = $event;
|
|
32
|
-
}
|
|
33
|
-
onSelect($event) {
|
|
34
|
-
this.valueModel.value = $event.option.value;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
__decorate([
|
|
38
|
-
Input(), TrackExternal(),
|
|
39
|
-
__metadata("design:type", ListModel)
|
|
40
|
-
], AutocompleteInputComponent.prototype, "optionsModel", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
Input(), StoreInListModel('optionsModel'),
|
|
43
|
-
__metadata("design:type", Array)
|
|
44
|
-
], AutocompleteInputComponent.prototype, "options", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
Input(),
|
|
47
|
-
__metadata("design:type", Object)
|
|
48
|
-
], AutocompleteInputComponent.prototype, "optionLabel", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Input(),
|
|
51
|
-
__metadata("design:type", Boolean)
|
|
52
|
-
], AutocompleteInputComponent.prototype, "allowNil", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
ContentChild('nilOptionTemplate'),
|
|
55
|
-
__metadata("design:type", TemplateRef)
|
|
56
|
-
], AutocompleteInputComponent.prototype, "nilOptionTemplateRef", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
Input(),
|
|
59
|
-
__metadata("design:type", Function)
|
|
60
|
-
], AutocompleteInputComponent.prototype, "optionLabelFormat", void 0);
|
|
61
|
-
AutocompleteInputComponent = __decorate([
|
|
62
|
-
Component({
|
|
63
|
-
selector: 'aup-autocomplete-input',
|
|
64
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
65
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
66
|
-
}),
|
|
67
|
-
__metadata("design:paramtypes", [])
|
|
68
|
-
], AutocompleteInputComponent);
|
|
69
|
-
export { AutocompleteInputComponent };
|
|
70
|
-
//# sourceMappingURL=autocomplete-input.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;GAKG;AAMH,IAAa,0BAA0B,GAAvC,MAAa,0BAAoC,SAAQ,2BAA8B;IAuBrF;QACE,KAAK,EAAE,CAAC;QAPF,gBAAW,GAAG,IAAI,iBAAiB,EAAU,CAAC;QAItD,sBAAiB,GAAuB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CA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EAAI;AAG3B;IADC,KAAK,EAAE,EAAE,gBAAgB,CAAC,cAAc,CAAC;;2DAC7B;AAGb;IADC,KAAK,EAAE;;+DACa;AAGrB;IADC,KAAK,EAAE;;4DACU;AAGlB;IADC,YAAY,CAAC,mBAAmB,CAAC;8BACZ,WAAW;wEAAM;AAMvC;IADC,KAAK,EAAE;;qEAC6G;AArB1G,0BAA0B;IALtC,SAAS,CAAC;QACT,QAAQ,EAAE,wBAAwB;QAClC,gnCAAkD;;KAEnD,CAAC;;GACW,0BAA0B,CAiDtC;SAjDY,0BAA0B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => _.isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
|
package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AutocompleteInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-value-input.component","name":"AbstractValueInputComponent","line":25,"character":57},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"aup-autocomplete-input","template":"<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n","styles":[":host{display:inline-block}mat-form-field{width:100%}"]}]}],"members":{"optionsModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":27,"character":12}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":30,"character":12},"arguments":["optionsModel"]}]}],"optionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"allowNil":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"nilOptionTemplateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":39,"character":3},"arguments":["nilOptionTemplate"]}]}],"optionLabelFormat":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"formatOption":[{"__symbolic":"method"}],"updateFilter":[{"__symbolic":"method"}],"onSelect":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-portal-ref.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/cell-portal-ref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGtE,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,CAAC;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,oCAAoC,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAAC;AAGlF,MAAM,OAAgB,aAAa;IACjC;IACA,CAAC;CAKF;AAED,MAAM,OAAO,mBAA4B,SAAQ,aAAuD;IACtG,YAAqB,aAA+B,EAAW,gBAAuE;QACpI,KAAK,EAAE,CAAC;QADW,kBAAa,GAAb,aAAa,CAAkB;QAAW,qBAAgB,GAAhB,gBAAgB,CAAuD;IAEtI,CAAC;IAED,cAAc,CAAC,IAAsC,EAAE,WAA6B;QAClF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,2BAA2B,CAAC,GAA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AI,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 { Trace } from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { ColumnModel, RowData } from './column-model';\nimport { EditSession } from './edit-session';\nimport { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';\nimport { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';\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 // @Trace()\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>, firstTime: boolean) => 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 // @Trace()\n onPortalAttached(host: TableCellRendererComponent<Row>, portalComponent: Portal) {\n host[PORTAL_RENDERER_COMPONENT] = portalComponent;\n this.updateComponent(portalComponent, host.getRowData(), true);\n }\n\n // @Trace()\n pushState(host: TableCellRendererComponent<Row>): void {\n if (host[PORTAL_RENDERER_COMPONENT]) {\n this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData(), false);\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 // @Trace()\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,73 +0,0 @@
|
|
|
1
|
-
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
|
-
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
|
3
|
-
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal } from '@coolon/pectin';
|
|
4
|
-
import _ from 'lodash';
|
|
5
|
-
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
6
|
-
/**
|
|
7
|
-
* Using templates (not only supported for nil values:
|
|
8
|
-
* <aup-autocomplete-input [valueModel]="myModel" [options]="myOptions">
|
|
9
|
-
* <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>
|
|
10
|
-
* </aup-autocomplete-input>
|
|
11
|
-
*/
|
|
12
|
-
var AutocompleteInputComponent = /** @class */ (function (_super) {
|
|
13
|
-
__extends(AutocompleteInputComponent, _super);
|
|
14
|
-
function AutocompleteInputComponent() {
|
|
15
|
-
var _this = _super.call(this) || this;
|
|
16
|
-
_this.filterValue = new MutableValueModel();
|
|
17
|
-
_this.optionLabelFormat = function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; };
|
|
18
|
-
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;
|
|
19
|
-
var lowerCaseFilterValue = chain(_this.filterValue)
|
|
20
|
-
.map(function (v) { return _.isString(v) ? v.toLowerCase() : ''; });
|
|
21
|
-
_this.filteredOptions = chain(_this.optionsModel)
|
|
22
|
-
.select(function (option) {
|
|
23
|
-
return _.isEmpty(_this.filterValue.value) || _this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
24
|
-
}, { dependsOn: lowerCaseFilterValue });
|
|
25
|
-
return _this;
|
|
26
|
-
}
|
|
27
|
-
AutocompleteInputComponent.prototype.ngOnInit = function () {
|
|
28
|
-
};
|
|
29
|
-
AutocompleteInputComponent.prototype.formatOption = function (option) {
|
|
30
|
-
return this.optionLabelFormat(option);
|
|
31
|
-
};
|
|
32
|
-
AutocompleteInputComponent.prototype.updateFilter = function ($event) {
|
|
33
|
-
this.filterValue.value = $event;
|
|
34
|
-
};
|
|
35
|
-
AutocompleteInputComponent.prototype.onSelect = function ($event) {
|
|
36
|
-
this.valueModel.value = $event.option.value;
|
|
37
|
-
};
|
|
38
|
-
__decorate([
|
|
39
|
-
Input(), TrackExternal(),
|
|
40
|
-
__metadata("design:type", ListModel)
|
|
41
|
-
], AutocompleteInputComponent.prototype, "optionsModel", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
Input(), StoreInListModel('optionsModel'),
|
|
44
|
-
__metadata("design:type", Array)
|
|
45
|
-
], AutocompleteInputComponent.prototype, "options", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
Input(),
|
|
48
|
-
__metadata("design:type", Object)
|
|
49
|
-
], AutocompleteInputComponent.prototype, "optionLabel", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
Input(),
|
|
52
|
-
__metadata("design:type", Boolean)
|
|
53
|
-
], AutocompleteInputComponent.prototype, "allowNil", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
ContentChild('nilOptionTemplate'),
|
|
56
|
-
__metadata("design:type", TemplateRef)
|
|
57
|
-
], AutocompleteInputComponent.prototype, "nilOptionTemplateRef", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
Input(),
|
|
60
|
-
__metadata("design:type", Function)
|
|
61
|
-
], AutocompleteInputComponent.prototype, "optionLabelFormat", void 0);
|
|
62
|
-
AutocompleteInputComponent = __decorate([
|
|
63
|
-
Component({
|
|
64
|
-
selector: 'aup-autocomplete-input',
|
|
65
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
66
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
67
|
-
}),
|
|
68
|
-
__metadata("design:paramtypes", [])
|
|
69
|
-
], AutocompleteInputComponent);
|
|
70
|
-
return AutocompleteInputComponent;
|
|
71
|
-
}(AbstractValueInputComponent));
|
|
72
|
-
export { AutocompleteInputComponent };
|
|
73
|
-
//# sourceMappingURL=autocomplete-input.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EA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AAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;;IAC5C,CAAC;IAED,6CAAQ,GAAR;IACA,CAAC;IAED,iDAAY,GAAZ,UAAa,MAAS;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,iDAAY,GAAZ,UAAa,MAAc;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC;IAClC,CAAC;IAED,6CAAQ,GAAR,UAAS,MAAoC;QAC3C,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,CAAC;IA7CD;QADC,KAAK,EAAE,EAAE,aAAa,EAAE;kCACX,SAAS;oEAAI;IAG3B;QADC,KAAK,EAAE,EAAE,gBAAgB,CAAC,cAAc,CAAC;;+DAC7B;IAGb;QADC,KAAK,EAAE;;mEACa;IAGrB;QADC,KAAK,EAAE;;gEACU;IAGlB;QADC,YAAY,CAAC,mBAAmB,CAAC;kCACZ,WAAW;4EAAM;IAMvC;QADC,KAAK,EAAE;;yEAC6G;IArB1G,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,gnCAAkD;;SAEnD,CAAC;;OACW,0BAA0B,CAiDtC;IAAD,iCAAC;CAAA,AAjDD,CAAyD,2BAA2B,GAiDnF;SAjDY,0BAA0B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => _.isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
|
package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|