@dereekb/dbx-form 1.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/esm2020/lib/form/action/form.action.directive.mjs +34 -19
- package/esm2020/lib/form/action/form.action.module.mjs +4 -4
- package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +4 -4
- package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +9 -9
- package/esm2020/lib/form/form.mjs +11 -1
- package/esm2020/lib/form/form.module.mjs +4 -4
- package/esm2020/lib/form/io/form.changes.directive.mjs +18 -7
- package/esm2020/lib/form/io/form.input.directive.mjs +36 -18
- package/esm2020/lib/form/io/form.io.module.mjs +4 -4
- package/esm2020/lib/form/io/form.loading.directive.mjs +27 -17
- package/esm2020/lib/form.module.mjs +4 -4
- package/esm2020/lib/formly/config/validation.mjs +3 -3
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +8 -8
- package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +3 -3
- package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +13 -13
- package/esm2020/lib/formly/field/component/component.field.component.mjs +8 -21
- package/esm2020/lib/formly/field/component/component.field.mjs +3 -5
- package/esm2020/lib/formly/field/component/component.field.module.mjs +14 -14
- package/esm2020/lib/formly/field/form.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +7 -7
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +8 -6
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +2 -2
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +13 -13
- package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +28 -21
- package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +16 -16
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +7 -8
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +13 -13
- package/esm2020/lib/formly/field/selection/searchable/searchable.mjs +1 -1
- package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/selection/selection.module.mjs +4 -4
- package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +4 -5
- package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/array/array.field.component.mjs +7 -7
- package/esm2020/lib/formly/field/value/array/array.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/boolean/boolean.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/date/date.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +51 -40
- package/esm2020/lib/formly/field/value/date/datetime.field.mjs +7 -7
- package/esm2020/lib/formly/field/value/enum/enum.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/text/text.additional.field.mjs +15 -18
- package/esm2020/lib/formly/field/value/text/text.address.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/text/text.field.mjs +3 -2
- package/esm2020/lib/formly/field/value/text/text.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/value.module.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +18 -10
- package/esm2020/lib/formly/field/wrapper/index.mjs +2 -1
- package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/working.wrapper.component.mjs +45 -0
- package/esm2020/lib/formly/field/wrapper/wrapper.mjs +7 -1
- package/esm2020/lib/formly/formly.context.directive.mjs +3 -3
- package/esm2020/lib/formly/formly.context.mjs +19 -8
- package/esm2020/lib/formly/formly.directive.mjs +17 -14
- package/esm2020/lib/formly/formly.form.component.mjs +63 -22
- package/esm2020/lib/formly/formly.module.mjs +9 -6
- package/esm2020/lib/formly/index.mjs +2 -1
- package/esm2020/lib/formly/template/available.mjs +16 -0
- package/esm2020/lib/formly/template/index.mjs +3 -0
- package/esm2020/lib/formly/template/login.mjs +90 -0
- package/esm2020/lib/layout/form.layout.module.mjs +4 -4
- package/esm2020/lib/layout/form.spacer.component.mjs +3 -3
- package/esm2020/lib/validator/available.mjs +32 -0
- package/esm2020/lib/validator/field.mjs +31 -0
- package/esm2020/lib/validator/index.mjs +3 -1
- package/fesm2015/dereekb-dbx-form.mjs +818 -505
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +834 -501
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form/action/form.action.directive.d.ts +13 -16
- package/lib/form/action/transition/form.action.transition.safety.directive.d.ts +3 -3
- package/lib/form/form.d.ts +30 -3
- package/lib/form/io/form.changes.directive.d.ts +7 -3
- package/lib/form/io/form.input.directive.d.ts +19 -7
- package/lib/form/io/form.loading.directive.d.ts +8 -2
- package/lib/formly/field/checklist/checklist.item.field.component.d.ts +2 -2
- package/lib/formly/field/checklist/checklist.item.field.module.d.ts +1 -1
- package/lib/formly/field/component/component.field.component.d.ts +8 -21
- package/lib/formly/field/component/component.field.d.ts +3 -5
- package/lib/formly/field/component/component.field.module.d.ts +1 -1
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +8 -3
- package/lib/formly/field/selection/pickable/pickable.field.module.d.ts +1 -1
- package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +8 -6
- package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +2 -1
- package/lib/formly/field/selection/searchable/searchable.d.ts +3 -3
- package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +3 -3
- package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +4 -4
- package/lib/formly/field/selection/searchable/searchable.field.module.d.ts +1 -1
- package/lib/formly/field/texteditor/_texteditor.scss +0 -2
- package/lib/formly/field/value/array/array.field.component.d.ts +2 -2
- package/lib/formly/field/value/date/datetime.field.component.d.ts +8 -10
- package/lib/formly/field/value/date/datetime.field.d.ts +2 -2
- package/lib/formly/field/value/phone/_phone.scss +4 -0
- package/lib/formly/field/value/text/text.additional.field.d.ts +1 -1
- package/lib/formly/field/value/text/text.field.d.ts +2 -0
- package/lib/formly/field/wrapper/form.wrapper.module.d.ts +9 -8
- package/lib/formly/field/wrapper/index.d.ts +1 -0
- package/lib/formly/field/wrapper/style.wrapper.component.d.ts +3 -3
- package/lib/formly/field/wrapper/working.wrapper.component.d.ts +22 -0
- package/lib/formly/field/wrapper/wrapper.d.ts +3 -0
- package/lib/formly/formly.context.d.ts +9 -6
- package/lib/formly/formly.directive.d.ts +2 -0
- package/lib/formly/formly.form.component.d.ts +13 -3
- package/lib/formly/index.d.ts +1 -0
- package/lib/formly/template/available.d.ts +7 -0
- package/lib/formly/template/index.d.ts +2 -0
- package/lib/formly/template/login.d.ts +59 -0
- package/lib/validator/available.d.ts +30 -0
- package/lib/validator/field.d.ts +32 -0
- package/lib/validator/index.d.ts +2 -0
- package/package.json +17 -44
- package/lib/formly/field/fields_TODO.scss +0 -4
- package/lib/formly/form_TODO.scss +0 -153
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { LockSet } from '@dereekb/rxjs';
|
|
3
|
+
import { DbxActionContextStoreSourceInstance, DbxActionValueOnTriggerResult } from '@dereekb/dbx-core';
|
|
4
|
+
import { LockSet, IsModifiedFunction, IsValidFunction } from '@dereekb/rxjs';
|
|
6
5
|
import { DbxMutableForm } from '../../form/form';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
|
-
export
|
|
9
|
-
value?: any;
|
|
10
|
-
reject?: ReadableError;
|
|
11
|
-
}
|
|
12
|
-
export declare type DbxActionFormValidateFn<T = any> = (value: T) => Observable<boolean>;
|
|
13
|
-
export declare type DbxActionFormModifiedFn<T = any> = (value: T) => Observable<boolean>;
|
|
14
|
-
export declare const APP_ACTION_FORM_DISABLED_KEY = "actionForm";
|
|
7
|
+
export declare const APP_ACTION_FORM_DISABLED_KEY = "dbx_action_form";
|
|
15
8
|
/**
|
|
16
9
|
* Used with an action to bind a form to an action as it's value source.
|
|
17
10
|
*
|
|
@@ -21,24 +14,28 @@ export declare const APP_ACTION_FORM_DISABLED_KEY = "actionForm";
|
|
|
21
14
|
*/
|
|
22
15
|
export declare class DbxActionFormDirective<T = any> implements OnInit, OnDestroy {
|
|
23
16
|
readonly form: DbxMutableForm;
|
|
24
|
-
readonly source:
|
|
17
|
+
readonly source: DbxActionContextStoreSourceInstance<object, any>;
|
|
25
18
|
readonly lockSet: LockSet;
|
|
26
19
|
/**
|
|
27
20
|
* Optional validator that checks whether or not the value is
|
|
28
21
|
* ready to send before the context store is marked enabled.
|
|
29
22
|
*/
|
|
30
|
-
|
|
23
|
+
dbxActionFormValidator?: IsValidFunction<T>;
|
|
31
24
|
/**
|
|
32
25
|
* Optional function that checks whether or not the value has been modified.
|
|
33
26
|
*/
|
|
34
|
-
|
|
27
|
+
dbxActionFormModified?: IsModifiedFunction<T>;
|
|
28
|
+
private _formDisabledWhileWorking;
|
|
35
29
|
private _triggeredSub;
|
|
36
30
|
private _isCompleteSub;
|
|
37
|
-
|
|
31
|
+
private _isWorkingSub;
|
|
32
|
+
constructor(form: DbxMutableForm, source: DbxActionContextStoreSourceInstance<object, any>);
|
|
33
|
+
get formDisabledOnWorking(): boolean;
|
|
34
|
+
set formDisabledOnWorking(formDisabledOnWorking: boolean);
|
|
38
35
|
ngOnInit(): void;
|
|
39
36
|
ngOnDestroy(): void;
|
|
40
37
|
protected preCheckReadyValue(value: T): Observable<boolean>;
|
|
41
|
-
protected readyValue(value: T): Observable<
|
|
38
|
+
protected readyValue(value: T): Observable<DbxActionValueOnTriggerResult>;
|
|
42
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionFormDirective<any>, [{ host: true; }, null]>;
|
|
43
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionFormDirective<any>, "[dbxActionForm]", never, { "
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionFormDirective<any>, "[dbxActionForm]", never, { "dbxActionFormValidator": "dbxActionFormValidator"; "dbxActionFormModified": "dbxActionFormModified"; "formDisabledOnWorking": "formDisabledOnWorking"; }, {}, never>;
|
|
44
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { MatDialog } from '@angular/material/dialog';
|
|
3
3
|
import { HookResult, Transition, TransitionService } from '@uirouter/core';
|
|
4
|
-
import {
|
|
4
|
+
import { DbxActionContextStoreSourceInstance } from '@dereekb/dbx-core';
|
|
5
5
|
import { DbxActionTransitionSafetyType, DbxActionTransitionSafetyDirective } from '@dereekb/dbx-web';
|
|
6
6
|
import { DbxActionFormDirective } from '../form.action.directive';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
@@ -11,9 +11,9 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
* NOTE: Only works with UIRouter
|
|
12
12
|
*/
|
|
13
13
|
export declare class DbxActionFormSafetyDirective<T, O> extends DbxActionTransitionSafetyDirective<T, O> {
|
|
14
|
-
readonly
|
|
14
|
+
readonly dbxActionForm: DbxActionFormDirective<T>;
|
|
15
15
|
inputSafetyType?: DbxActionTransitionSafetyType;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(dbxActionForm: DbxActionFormDirective<T>, source: DbxActionContextStoreSourceInstance<T, O>, transitionService: TransitionService, viewContainerRef: ViewContainerRef, dialog: MatDialog);
|
|
17
17
|
protected _handleOnBeforeTransition(transition: Transition): HookResult;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionFormSafetyDirective<any, any>, [{ host: true; }, null, null, null, null]>;
|
|
19
19
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionFormSafetyDirective<any, any>, "[dbxActionFormSafety]", never, { "inputSafetyType": "dbxActionFormSafety"; }, {}, never>;
|
package/lib/form/form.d.ts
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
import { Provider, Type } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { LockSet } from '@dereekb/rxjs';
|
|
4
|
-
import { Maybe } from '@dereekb/util';
|
|
4
|
+
import { BooleanStringKeyArray, Maybe } from '@dereekb/util';
|
|
5
|
+
import { FormControlStatus } from '@angular/forms';
|
|
5
6
|
/**
|
|
6
7
|
* Current state of a DbxForm
|
|
7
8
|
*/
|
|
8
9
|
export declare enum DbxFormState {
|
|
10
|
+
/**
|
|
11
|
+
* Form is not finished initializing.
|
|
12
|
+
*/
|
|
9
13
|
INITIALIZING = -1,
|
|
14
|
+
/**
|
|
15
|
+
* Form is initialized but has not yet used.
|
|
16
|
+
*/
|
|
10
17
|
RESET = 0,
|
|
18
|
+
/**
|
|
19
|
+
* Form has been used.
|
|
20
|
+
*/
|
|
11
21
|
USED = 1
|
|
12
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Unique key for disabling/enabling.
|
|
25
|
+
*/
|
|
26
|
+
export declare type DbxFormDisabledKey = string;
|
|
27
|
+
export declare const DEFAULT_FORM_DISABLED_KEY = "dbx_form_disabled";
|
|
13
28
|
/**
|
|
14
29
|
* DbxForm stream event
|
|
15
30
|
*/
|
|
16
31
|
export interface DbxFormEvent {
|
|
17
32
|
readonly isComplete: boolean;
|
|
18
33
|
readonly state: DbxFormState;
|
|
34
|
+
readonly status: FormControlStatus;
|
|
19
35
|
readonly pristine?: boolean;
|
|
20
36
|
readonly untouched?: boolean;
|
|
21
37
|
readonly lastResetAt?: Date;
|
|
22
38
|
readonly changesCount?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Whether or not the form is disabled.
|
|
41
|
+
*/
|
|
23
42
|
readonly isDisabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Current disabled state keys.
|
|
45
|
+
*/
|
|
46
|
+
readonly disabled?: BooleanStringKeyArray;
|
|
24
47
|
}
|
|
25
48
|
/**
|
|
26
49
|
* Form that has an event stream, value, and state items.
|
|
@@ -31,6 +54,10 @@ export declare abstract class DbxForm<T = any> {
|
|
|
31
54
|
* Returns an observable that returns the current state of the form.
|
|
32
55
|
*/
|
|
33
56
|
abstract getValue(): Observable<T>;
|
|
57
|
+
/**
|
|
58
|
+
* Returns an observable that returns the current disabled keys.
|
|
59
|
+
*/
|
|
60
|
+
abstract getDisabled(): Observable<BooleanStringKeyArray>;
|
|
34
61
|
}
|
|
35
62
|
export declare abstract class DbxMutableForm<T = any> extends DbxForm<T> {
|
|
36
63
|
/**
|
|
@@ -48,11 +75,11 @@ export declare abstract class DbxMutableForm<T = any> extends DbxForm<T> {
|
|
|
48
75
|
*/
|
|
49
76
|
abstract resetForm(): void;
|
|
50
77
|
/**
|
|
51
|
-
*
|
|
78
|
+
* Disables the form
|
|
52
79
|
*
|
|
53
80
|
* @param disabled
|
|
54
81
|
*/
|
|
55
|
-
abstract setDisabled(disabled?: boolean): void;
|
|
82
|
+
abstract setDisabled(key?: DbxFormDisabledKey, disabled?: boolean): void;
|
|
56
83
|
/**
|
|
57
84
|
* Force the form to update itself as if it was changed.
|
|
58
85
|
*/
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
3
|
+
import { Maybe } from '@dereekb/util';
|
|
3
4
|
import { DbxForm } from '../form';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* Used to see form value changes.
|
|
8
|
+
*
|
|
9
|
+
* Emits undefined when the form is incomplete, and the value when the form is complete.
|
|
7
10
|
*/
|
|
8
|
-
export declare class DbxFormValueChangesDirective<T extends object = any> extends AbstractSubscriptionDirective implements OnInit {
|
|
11
|
+
export declare class DbxFormValueChangesDirective<T extends object = any> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
|
|
9
12
|
readonly form: DbxForm;
|
|
10
|
-
readonly dbxFormValueChange: EventEmitter<T
|
|
13
|
+
readonly dbxFormValueChange: EventEmitter<Maybe<T>>;
|
|
11
14
|
constructor(form: DbxForm);
|
|
12
15
|
ngOnInit(): void;
|
|
16
|
+
ngOnDestroy(): void;
|
|
13
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormValueChangesDirective<any>, [{ host: true; }]>;
|
|
14
18
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFormValueChangesDirective<any>, "[dbxFormValueChange]", never, {}, { "dbxFormValueChange": "dbxFormValueChange"; }, never>;
|
|
15
19
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
2
3
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
3
4
|
import { DbxMutableForm } from '../form';
|
|
5
|
+
import { Maybe } from '@dereekb/util';
|
|
6
|
+
import { ObservableOrValue } from '@dereekb/rxjs';
|
|
4
7
|
import * as i0 from "@angular/core";
|
|
8
|
+
export declare function dbxFormSourceObservable<T>(form: DbxMutableForm, inputObs: ObservableOrValue<T>, mode$: Observable<DbxFormSourceDirectiveMode>): Observable<T>;
|
|
9
|
+
/**
|
|
10
|
+
* DbxFormSourceDirective modes that define when to copy data from the source.
|
|
11
|
+
*
|
|
12
|
+
* - reset: only copy data when the form is reset.
|
|
13
|
+
* - always: always copy data when the data observable emits a value.
|
|
14
|
+
*/
|
|
15
|
+
export declare type DbxFormSourceDirectiveMode = 'reset' | 'always';
|
|
5
16
|
/**
|
|
6
17
|
* Used with a FormComponent to set the value based on the input value.
|
|
7
18
|
*/
|
|
8
|
-
export declare class DbxFormSourceDirective<T extends object = any> extends AbstractSubscriptionDirective {
|
|
19
|
+
export declare class DbxFormSourceDirective<T extends object = any> extends AbstractSubscriptionDirective implements OnDestroy {
|
|
9
20
|
readonly form: DbxMutableForm;
|
|
21
|
+
private _mode;
|
|
10
22
|
constructor(form: DbxMutableForm);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
get mode(): DbxFormSourceDirectiveMode;
|
|
24
|
+
set mode(mode: DbxFormSourceDirectiveMode);
|
|
25
|
+
set obs(obs: Maybe<ObservableOrValue<Maybe<Partial<T>>>>);
|
|
26
|
+
private setObs;
|
|
27
|
+
ngOnDestroy(): void;
|
|
16
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormSourceDirective<any>, [{ host: true; }]>;
|
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFormSourceDirective<any>, "[dbxFormSource]", never, { "obs": "dbxFormSource"; }, {}, never>;
|
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFormSourceDirective<any>, "[dbxFormSource]", never, { "mode": "dbxFormSourceMode"; "obs": "dbxFormSource"; }, {}, never>;
|
|
18
30
|
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
2
3
|
import { AbstractSubscriptionDirective } from '@dereekb/dbx-core';
|
|
3
4
|
import { DbxMutableForm } from '../../form/form';
|
|
4
5
|
import { LoadingState } from '@dereekb/rxjs';
|
|
6
|
+
import { DbxFormSourceDirectiveMode } from './form.input.directive';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
/**
|
|
7
9
|
* Used with a FormComponent to set the value from a LoadingState when the value is available.
|
|
8
10
|
*/
|
|
9
|
-
export declare class DbxFormLoadingSourceDirective<T extends object = any> extends AbstractSubscriptionDirective {
|
|
11
|
+
export declare class DbxFormLoadingSourceDirective<T extends object = any> extends AbstractSubscriptionDirective implements OnDestroy {
|
|
10
12
|
readonly form: DbxMutableForm;
|
|
13
|
+
private _mode;
|
|
11
14
|
constructor(form: DbxMutableForm);
|
|
15
|
+
get mode(): DbxFormSourceDirectiveMode;
|
|
16
|
+
set mode(mode: DbxFormSourceDirectiveMode);
|
|
12
17
|
/**
|
|
13
18
|
* Sets a LoadingContext that is watched for the loading state.
|
|
14
19
|
*/
|
|
15
20
|
set obs(obs: Observable<LoadingState<T>>);
|
|
16
21
|
private _setObs;
|
|
22
|
+
ngOnDestroy(): void;
|
|
17
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormLoadingSourceDirective<any>, [{ host: true; }]>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFormLoadingSourceDirective<any>, "[dbxFormLoadingSource]", never, { "obs": "dbxFormLoadingSource"; }, {}, never>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxFormLoadingSourceDirective<any>, "[dbxFormLoadingSource]", never, { "mode": "dbxFormLoadingSourceMode"; "obs": "dbxFormLoadingSource"; }, {}, never>;
|
|
19
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
3
3
|
import { OnDestroy, OnInit, Type } from '@angular/core';
|
|
4
4
|
import { ValidationErrors, FormGroup } from '@angular/forms';
|
|
5
5
|
import { FieldType, FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';
|
|
@@ -41,7 +41,7 @@ export declare class DbxChecklistItemFieldComponent<T = any> extends FieldType<C
|
|
|
41
41
|
export declare class DbxChecklistItemContentComponent<T = any> extends AbstractSubscriptionDirective {
|
|
42
42
|
readonly checklistItemFieldComponent: DbxChecklistItemFieldComponent<T>;
|
|
43
43
|
readonly cdRef: ChangeDetectorRef;
|
|
44
|
-
config?:
|
|
44
|
+
config?: DbxInjectionComponentConfig;
|
|
45
45
|
constructor(checklistItemFieldComponent: DbxChecklistItemFieldComponent<T>, cdRef: ChangeDetectorRef);
|
|
46
46
|
ngOnInit(): void;
|
|
47
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxChecklistItemContentComponent<any>, never>;
|
|
@@ -13,6 +13,6 @@ import * as i11 from "../wrapper/form.wrapper.module";
|
|
|
13
13
|
import * as i12 from "@ngx-formly/core";
|
|
14
14
|
export declare class DbxFormFormlyChecklistItemFieldModule {
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyChecklistItemFieldModule, never>;
|
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyChecklistItemFieldModule, [typeof i1.DbxChecklistItemFieldComponent, typeof i1.DbxChecklistItemContentComponent, typeof i2.DbxDefaultChecklistItemFieldDisplayComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.MatRippleModule, typeof i7.MatCheckboxModule, typeof i8.MatButtonModule, typeof i9.MatIconModule, typeof i4.
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyChecklistItemFieldModule, [typeof i1.DbxChecklistItemFieldComponent, typeof i1.DbxChecklistItemContentComponent, typeof i2.DbxDefaultChecklistItemFieldDisplayComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.MatRippleModule, typeof i7.MatCheckboxModule, typeof i8.MatButtonModule, typeof i9.MatIconModule, typeof i4.DbxRouterAnchorModule, typeof i10.DbxInjectionComponentModule, typeof i11.DbxFormFormlyWrapperModule, typeof i12.FormlyModule], [typeof i11.DbxFormFormlyWrapperModule]>;
|
|
17
17
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyChecklistItemFieldModule>;
|
|
18
18
|
}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DbxInjectedComponentConfig } from '@dereekb/dbx-core';
|
|
1
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
3
2
|
import { FieldType, FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
|
-
import { Maybe } from '@dereekb/util';
|
|
5
3
|
import * as i0 from "@angular/core";
|
|
6
|
-
export interface
|
|
7
|
-
field: FieldType<FormComponentFieldFieldConfig>;
|
|
4
|
+
export interface DbxFormComponentFieldConfig<T> extends DbxInjectionComponentConfig<T> {
|
|
8
5
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
6
|
+
export interface DbxFormComponentFormlyFieldConfig<T = any> extends FormlyFieldConfig {
|
|
7
|
+
componentField: DbxFormComponentFieldConfig<T>;
|
|
11
8
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare class FormComponentFieldComponent<T extends FormComponentFieldWrappedComponent = any> extends FieldType<FormComponentFieldFieldConfig<T>> implements OnInit {
|
|
18
|
-
private _config?;
|
|
19
|
-
get config(): Maybe<DbxInjectedComponentConfig>;
|
|
20
|
-
get componentField(): {
|
|
21
|
-
componentClass: Type<T>;
|
|
22
|
-
};
|
|
23
|
-
ngOnInit(): void;
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormComponentFieldComponent<any>, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormComponentFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
9
|
+
export declare class DbxFormComponentFieldComponent<T = any> extends FieldType<DbxFormComponentFormlyFieldConfig<T>> {
|
|
10
|
+
get config(): DbxInjectionComponentConfig<T>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormComponentFieldComponent<any>, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFormComponentFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
26
13
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface ComponentFieldConfig<T> {
|
|
4
|
-
componentClass: Type<T>;
|
|
1
|
+
import { DbxFormComponentFieldConfig, DbxFormComponentFormlyFieldConfig } from "./component.field.component";
|
|
2
|
+
export interface ComponentFieldConfig<T = any> extends DbxFormComponentFieldConfig<T> {
|
|
5
3
|
}
|
|
6
|
-
export declare function componentField<T
|
|
4
|
+
export declare function componentField<T>(config: ComponentFieldConfig<T>): DbxFormComponentFormlyFieldConfig;
|
|
@@ -5,6 +5,6 @@ import * as i3 from "@dereekb/dbx-core";
|
|
|
5
5
|
import * as i4 from "@ngx-formly/core";
|
|
6
6
|
export declare class DbxFormFormlyComponentFieldModule {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyComponentFieldModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyComponentFieldModule, [typeof i1.
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyComponentFieldModule, [typeof i1.DbxFormComponentFieldComponent], [typeof i2.CommonModule, typeof i3.DbxInjectionComponentModule, typeof i4.FormlyModule], [typeof i1.DbxFormComponentFieldComponent]>;
|
|
9
9
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyComponentFieldModule>;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DbxInjectionComponentConfig } from "@dereekb/dbx-core";
|
|
2
2
|
import { LoadingState, ListLoadingStateContextInstance } from "@dereekb/rxjs";
|
|
3
3
|
import { Maybe } from "@dereekb/util";
|
|
4
4
|
import { OnDestroy, OnInit } from "@angular/core";
|
|
@@ -74,7 +74,11 @@ export interface PickableValueFieldsFieldConfig<T> {
|
|
|
74
74
|
/**
|
|
75
75
|
* Footer Display
|
|
76
76
|
*/
|
|
77
|
-
footerConfig?:
|
|
77
|
+
footerConfig?: DbxInjectionComponentConfig;
|
|
78
|
+
/**
|
|
79
|
+
* Changes the selection mode of the list to "view" mode on disabled, hiding the selection boxes.
|
|
80
|
+
*/
|
|
81
|
+
changeSelectionModeToViewOnDisabled?: boolean;
|
|
78
82
|
}
|
|
79
83
|
export interface PickableValueFieldsFormlyFieldConfig<T> extends FormlyFieldConfig {
|
|
80
84
|
pickableField: PickableValueFieldsFieldConfig<T>;
|
|
@@ -133,6 +137,7 @@ export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<
|
|
|
133
137
|
get name(): string;
|
|
134
138
|
get label(): Maybe<string>;
|
|
135
139
|
get autocomplete(): string;
|
|
140
|
+
get changeSelectionModeToViewOnDisabled(): boolean;
|
|
136
141
|
get sortItems(): Maybe<PickableItemFieldItemSortFn<T>>;
|
|
137
142
|
get hashForValue(): PickableValueFieldHashFn<T>;
|
|
138
143
|
get displayForValue(): PickableValueFieldDisplayFn<T>;
|
|
@@ -143,7 +148,7 @@ export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<
|
|
|
143
148
|
get showTextFilter(): boolean;
|
|
144
149
|
get loadValuesFn(): PickableValueFieldLoadValuesFn<T>;
|
|
145
150
|
get values(): T[];
|
|
146
|
-
get footerConfig(): Maybe<
|
|
151
|
+
get footerConfig(): Maybe<DbxInjectionComponentConfig>;
|
|
147
152
|
loadDisplayValuesForValues(values: T[]): Observable<LoadingState<PickableValueFieldDisplayValueWithHash<T>[]>>;
|
|
148
153
|
loadDisplayValuesForFieldValues(values: PickableValueFieldValue<T>[]): Observable<LoadingState<PickableValueFieldDisplayValueWithHash<T>[]>>;
|
|
149
154
|
getDisplayValuesForFieldValues(values: PickableValueFieldValue<T>[]): Observable<PickableValueFieldDisplayValueWithHash<T>[]>;
|
|
@@ -15,6 +15,6 @@ import * as i13 from "@angular/material/icon";
|
|
|
15
15
|
import * as i14 from "@ngx-formly/core";
|
|
16
16
|
export declare class DbxFormFormlyPickableFieldModule {
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyPickableFieldModule, never>;
|
|
18
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPickableFieldModule, [typeof i1.DbxPickableChipListFieldComponent, typeof i2.DbxPickableListFieldComponent, typeof i2.DbxPickableListFieldItemListComponent, typeof i2.DbxPickableListFieldItemListViewComponent, typeof i2.DbxPickableListFieldItemListViewItemComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i4.DbxLoadingModule, typeof i4.DbxButtonModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatInputModule, typeof i8.MatFormFieldModule, typeof i5.ReactiveFormsModule, typeof i9.MatAutocompleteModule, typeof i10.MatListModule, typeof i11.DbxDatePipeModule, typeof i4.
|
|
18
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPickableFieldModule, [typeof i1.DbxPickableChipListFieldComponent, typeof i2.DbxPickableListFieldComponent, typeof i2.DbxPickableListFieldItemListComponent, typeof i2.DbxPickableListFieldItemListViewComponent, typeof i2.DbxPickableListFieldItemListViewItemComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i4.DbxLoadingModule, typeof i4.DbxButtonModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatInputModule, typeof i8.MatFormFieldModule, typeof i5.ReactiveFormsModule, typeof i9.MatAutocompleteModule, typeof i10.MatListModule, typeof i11.DbxDatePipeModule, typeof i4.DbxRouterAnchorModule, typeof i12.MatChipsModule, typeof i13.MatIconModule, typeof i11.DbxInjectionComponentModule, typeof i4.DbxListLayoutModule, typeof i14.FormlyModule], never>;
|
|
19
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyPickableFieldModule>;
|
|
20
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AbstractDbxSelectionListWrapperDirective,
|
|
1
|
+
import { DbxInjectionComponentConfig } from "@dereekb/dbx-core";
|
|
2
|
+
import { AbstractDbxSelectionListWrapperDirective, AbstractDbxSelectionListViewDirective, AbstractDbxValueListViewItemComponent, DbxListSelectionMode } from "@dereekb/dbx-web";
|
|
3
|
+
import { Maybe } from "@dereekb/util";
|
|
3
4
|
import { PickableValueFieldDisplayValue } from "./pickable";
|
|
4
5
|
import { AbstractDbxPickableItemFieldDirective, PickableItemFieldItem } from "./pickable.field.directive";
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
@@ -19,16 +20,17 @@ export declare class DbxPickableListFieldItemListComponent<T> extends AbstractDb
|
|
|
19
20
|
/**
|
|
20
21
|
* NOTE: Values input are PickableItemFieldItem<T>, but output values are PickableValueFieldDisplayValue<T>.
|
|
21
22
|
*/
|
|
22
|
-
export declare class DbxPickableListFieldItemListViewComponent<T> extends
|
|
23
|
+
export declare class DbxPickableListFieldItemListViewComponent<T> extends AbstractDbxSelectionListViewDirective<PickableItemFieldItem<T>> {
|
|
23
24
|
readonly dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>;
|
|
24
|
-
readonly config:
|
|
25
|
+
readonly config: DbxInjectionComponentConfig;
|
|
25
26
|
get multiple(): boolean;
|
|
26
|
-
|
|
27
|
+
get selectionMode(): Maybe<DbxListSelectionMode>;
|
|
28
|
+
readonly items$: import("rxjs").Observable<import("@dereekb/dbx-web").DbxValueListItemConfig<unknown, PickableItemFieldItem<T>>[]>;
|
|
27
29
|
constructor(dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>);
|
|
28
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewComponent<any>, never>;
|
|
29
31
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
30
32
|
}
|
|
31
|
-
export declare class DbxPickableListFieldItemListViewItemComponent<T> extends
|
|
33
|
+
export declare class DbxPickableListFieldItemListViewItemComponent<T> extends AbstractDbxValueListViewItemComponent<PickableValueFieldDisplayValue<T>> {
|
|
32
34
|
get label(): string;
|
|
33
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, never>;
|
|
34
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
2
3
|
import { MatChipInputEvent } from '@angular/material/chips';
|
|
3
4
|
import { AbstractDbxSearchableValueFieldDirective, SearchableValueFieldsFieldConfig, SearchableValueFieldsFormlyFieldConfig } from './searchable.field.directive';
|
|
@@ -7,7 +8,7 @@ export interface SearchableChipValueFieldsFieldConfig<T> extends SearchableValue
|
|
|
7
8
|
export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFormlyFieldConfig<T> {
|
|
8
9
|
searchableField: SearchableChipValueFieldsFieldConfig<T>;
|
|
9
10
|
}
|
|
10
|
-
export declare class DbxSearchableChipFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableChipValueFieldsFormlyFieldConfig<T>> {
|
|
11
|
+
export declare class DbxSearchableChipFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableChipValueFieldsFormlyFieldConfig<T>> implements OnDestroy {
|
|
11
12
|
private _blur;
|
|
12
13
|
private _blurSub;
|
|
13
14
|
readonly separatorKeysCodes: number[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DbxInjectionComponentConfig, ClickableAnchor } from '@dereekb/dbx-core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { SelectionDisplayValue, SelectionValue, SelectionValueHashFn } from '../selection';
|
|
4
4
|
export interface SearchableValueFieldValue<T, M = any> extends SelectionValue<T, M> {
|
|
@@ -14,10 +14,10 @@ export interface SearchableValueFieldDisplayValue<T, M = any> extends SelectionD
|
|
|
14
14
|
/**
|
|
15
15
|
* Display override configuration
|
|
16
16
|
*/
|
|
17
|
-
display?: Partial<
|
|
17
|
+
display?: Partial<DbxInjectionComponentConfig>;
|
|
18
18
|
}
|
|
19
19
|
export interface ConfiguredSearchableValueFieldDisplayValue<T, M = any> extends Omit<SearchableValueFieldDisplayValue<T, M>, 'display'> {
|
|
20
|
-
display:
|
|
20
|
+
display: DbxInjectionComponentConfig;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* SearchableValueField function for searching values.
|
package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { InjectionToken, OnDestroy } from '@angular/core';
|
|
3
3
|
import { ConfiguredSearchableValueFieldDisplayValue } from './searchable';
|
|
4
|
-
import {
|
|
4
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN: InjectionToken<unknown>;
|
|
7
7
|
export declare class DbxSearchableFieldAutocompleteItemComponent<T> implements OnDestroy {
|
|
8
8
|
private _displayValue;
|
|
9
9
|
readonly displayValue$: Observable<ConfiguredSearchableValueFieldDisplayValue<T, any>>;
|
|
10
|
-
readonly config$: Observable<
|
|
10
|
+
readonly config$: Observable<DbxInjectionComponentConfig>;
|
|
11
11
|
readonly anchor$: Observable<import("@dereekb/dbx-core").ClickableAnchor | undefined>;
|
|
12
12
|
set displayValue(displayValue: ConfiguredSearchableValueFieldDisplayValue<T>);
|
|
13
13
|
ngOnDestroy(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
|
|
2
2
|
import { SubscriptionObject, LoadingState, LoadingStateContextInstance } from '@dereekb/rxjs';
|
|
3
3
|
import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
4
4
|
import { AbstractControl, FormControl, ValidatorFn } from '@angular/forms';
|
|
@@ -42,7 +42,7 @@ export interface SearchableValueFieldsFieldConfig<T> extends StringValueFieldsFi
|
|
|
42
42
|
/**
|
|
43
43
|
* Default injected config to use for display values.
|
|
44
44
|
*/
|
|
45
|
-
display?: Partial<
|
|
45
|
+
display?: Partial<DbxInjectionComponentConfig>;
|
|
46
46
|
/**
|
|
47
47
|
* Used for building a display value given the input.
|
|
48
48
|
*/
|
|
@@ -81,7 +81,7 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
|
|
|
81
81
|
/**
|
|
82
82
|
* Optional override set by the parent class for picking a default display for this directive.
|
|
83
83
|
*/
|
|
84
|
-
defaultDisplay?:
|
|
84
|
+
defaultDisplay?: DbxInjectionComponentConfig;
|
|
85
85
|
textInput: ElementRef<HTMLInputElement>;
|
|
86
86
|
readonly inputCtrl: FormControl;
|
|
87
87
|
private _formControlObs;
|
|
@@ -107,7 +107,7 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
|
|
|
107
107
|
get displayForValue(): SearchableValueFieldDisplayFn<T>;
|
|
108
108
|
get useAnchor(): Maybe<boolean>;
|
|
109
109
|
get anchorForValue(): Maybe<SearchableValueFieldAnchorFn<T>>;
|
|
110
|
-
get display(): Maybe<Partial<
|
|
110
|
+
get display(): Maybe<Partial<DbxInjectionComponentConfig>>;
|
|
111
111
|
get search(): SearchableValueFieldStringSearchFn<T>;
|
|
112
112
|
get values(): T[];
|
|
113
113
|
get allowStringValues(): boolean;
|
|
@@ -16,6 +16,6 @@ import * as i14 from "@angular/material/icon";
|
|
|
16
16
|
import * as i15 from "@ngx-formly/core";
|
|
17
17
|
export declare class DbxFormFormlySearchableFieldModule {
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySearchableFieldModule, never>;
|
|
19
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySearchableFieldModule, [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent, typeof i3.DbxSearchableFieldAutocompleteItemComponent, typeof i3.DbxDefaultSearchableFieldDisplayComponent], [typeof i4.CommonModule, typeof i5.DbxTextModule, typeof i5.DbxLoadingModule, typeof i5.DbxButtonModule, typeof i6.FormsModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatFormFieldModule, typeof i6.ReactiveFormsModule, typeof i10.MatAutocompleteModule, typeof i11.MatListModule, typeof i12.DbxDatePipeModule, typeof i5.
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySearchableFieldModule, [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent, typeof i3.DbxSearchableFieldAutocompleteItemComponent, typeof i3.DbxDefaultSearchableFieldDisplayComponent], [typeof i4.CommonModule, typeof i5.DbxTextModule, typeof i5.DbxLoadingModule, typeof i5.DbxButtonModule, typeof i6.FormsModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatFormFieldModule, typeof i6.ReactiveFormsModule, typeof i10.MatAutocompleteModule, typeof i11.MatListModule, typeof i12.DbxDatePipeModule, typeof i5.DbxRouterAnchorModule, typeof i13.MatChipsModule, typeof i14.MatIconModule, typeof i12.DbxInjectionComponentModule, typeof i15.FormlyModule], [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent]>;
|
|
20
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySearchableFieldModule>;
|
|
21
21
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
2
|
-
import {
|
|
2
|
+
import { FactoryWithInput, Maybe } from '@dereekb/util';
|
|
3
3
|
import { FieldArrayTypeConfig, FieldArrayType, FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export interface DbxFormRepeatArrayConfig {
|
|
6
|
-
labelForField?: string |
|
|
6
|
+
labelForField?: string | FactoryWithInput<string, FormlyFieldConfig>;
|
|
7
7
|
addText?: string;
|
|
8
8
|
removeText?: string;
|
|
9
9
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LogicalDateStringCode, Maybe, ReadableTimeString } from '@dereekb/util';
|
|
2
2
|
import { DateTimeMinuteConfig } from '@dereekb/date';
|
|
3
3
|
import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
|
|
4
4
|
import { AbstractControl, FormControl } from '@angular/forms';
|
|
5
5
|
import { FieldType } from '@ngx-formly/material';
|
|
6
6
|
import { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
|
-
import { Maybe, ReadableTimeString } from '@dereekb/util';
|
|
9
8
|
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
10
9
|
import * as i0 from "@angular/core";
|
|
11
|
-
export declare enum
|
|
10
|
+
export declare enum DbxDateTimeFieldTimeMode {
|
|
12
11
|
/**
|
|
13
12
|
* Time is required.
|
|
14
13
|
*/
|
|
@@ -34,7 +33,7 @@ export interface DbxDateTimeFieldConfig {
|
|
|
34
33
|
*
|
|
35
34
|
* This is ignored if timeOnly is specified.
|
|
36
35
|
*/
|
|
37
|
-
timeMode?:
|
|
36
|
+
timeMode?: DbxDateTimeFieldTimeMode;
|
|
38
37
|
/**
|
|
39
38
|
* Other form control for enabling/disabling whether or not it is a full day.
|
|
40
39
|
*
|
|
@@ -57,7 +56,6 @@ export interface DateTimeFormlyFieldConfig extends FormlyFieldConfig {
|
|
|
57
56
|
}
|
|
58
57
|
export declare class DbxDateTimeFieldComponent extends FieldType<DateTimeFormlyFieldConfig & FieldTypeConfig> implements OnInit, OnDestroy {
|
|
59
58
|
private readonly cdRef;
|
|
60
|
-
dateInput: MatInput;
|
|
61
59
|
private _sub;
|
|
62
60
|
private _valueSub;
|
|
63
61
|
private _fullDayInputCtrl?;
|
|
@@ -73,20 +71,20 @@ export declare class DbxDateTimeFieldComponent extends FieldType<DateTimeFormlyF
|
|
|
73
71
|
*/
|
|
74
72
|
readonly displayValue$: Observable<any>;
|
|
75
73
|
readonly timeString$: Observable<ReadableTimeString>;
|
|
74
|
+
readonly dateInputCtrl: FormControl;
|
|
76
75
|
readonly timeInputCtrl: FormControl;
|
|
77
|
-
private _date;
|
|
78
76
|
private _config;
|
|
79
77
|
get dateOnly(): boolean;
|
|
80
78
|
get dateTimeField(): DbxDateTimeFieldConfig;
|
|
81
79
|
get timeOnly(): Maybe<boolean>;
|
|
82
80
|
get showDateInput(): boolean;
|
|
83
|
-
get timeMode():
|
|
81
|
+
get timeMode(): DbxDateTimeFieldTimeMode;
|
|
84
82
|
get description(): Maybe<string>;
|
|
85
83
|
readonly fullDay$: Observable<boolean>;
|
|
86
84
|
readonly showTimeInput$: Observable<boolean>;
|
|
87
85
|
readonly showAddTime$: Observable<boolean>;
|
|
88
|
-
readonly date$: Observable<
|
|
89
|
-
readonly dateValue$: Observable<Date |
|
|
86
|
+
readonly date$: Observable<any>;
|
|
87
|
+
readonly dateValue$: Observable<Date | import("@dereekb/util").MaybeNot>;
|
|
90
88
|
readonly timeInput$: Observable<ReadableTimeString>;
|
|
91
89
|
readonly config$: Observable<Maybe<DateTimePickerConfiguration>>;
|
|
92
90
|
readonly rawDateTime$: Observable<Maybe<Date>>;
|
|
@@ -94,8 +92,8 @@ export declare class DbxDateTimeFieldComponent extends FieldType<DateTimeFormlyF
|
|
|
94
92
|
constructor(cdRef: ChangeDetectorRef);
|
|
95
93
|
ngOnInit(): void;
|
|
96
94
|
ngOnDestroy(): void;
|
|
97
|
-
dateTextChanged(e: any): void;
|
|
98
95
|
datePicked(event: MatDatepickerInputEvent<Date>): void;
|
|
96
|
+
setLogicalTime(time: LogicalDateStringCode): void;
|
|
99
97
|
setTime(time: ReadableTimeString): void;
|
|
100
98
|
keydownOnInput(event: KeyboardEvent): void;
|
|
101
99
|
focusTime(): void;
|
|
@@ -10,5 +10,5 @@ export declare const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS: () => Observable<DateTi
|
|
|
10
10
|
/**
|
|
11
11
|
* Same as DateTime field but with the Date input hidden by default.
|
|
12
12
|
*/
|
|
13
|
-
export declare function timeOnlyField(config
|
|
14
|
-
export declare function dateTimeField(config
|
|
13
|
+
export declare function timeOnlyField(config?: Partial<TimeFieldConfig>): FormlyFieldConfig;
|
|
14
|
+
export declare function dateTimeField(config?: Partial<DateTimeFieldConfig>): FormlyFieldConfig;
|