@dereekb/dbx-form 0.0.1 → 1.2.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/{src/_index.scss → _index.scss} +8 -0
- package/esm2020/lib/form/action/form.action.directive.mjs +44 -42
- package/esm2020/lib/form/action/form.action.module.mjs +6 -6
- package/esm2020/lib/form/action/index.mjs +2 -1
- package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +26 -0
- package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +40 -0
- package/esm2020/lib/form/action/transition/index.mjs +3 -0
- package/esm2020/lib/form/form.mjs +11 -4
- package/esm2020/lib/form/form.module.mjs +15 -26
- package/esm2020/lib/form/index.mjs +2 -4
- package/esm2020/lib/form/io/form.changes.directive.mjs +34 -0
- package/esm2020/lib/form/io/form.input.directive.mjs +49 -0
- package/esm2020/lib/form/io/form.io.module.mjs +36 -0
- package/esm2020/lib/form/io/form.loading.directive.mjs +52 -0
- package/esm2020/lib/form/io/index.mjs +5 -0
- package/esm2020/lib/form.module.mjs +25 -0
- package/esm2020/lib/formly/config/index.mjs +2 -0
- package/esm2020/lib/formly/config/validation.mjs +22 -0
- package/esm2020/lib/formly/field/checklist/checklist.field.mjs +105 -0
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +31 -33
- package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +4 -4
- package/esm2020/lib/formly/field/checklist/checklist.item.field.mjs +8 -112
- package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/checklist/index.mjs +2 -1
- package/esm2020/lib/formly/field/component/component.field.component.mjs +9 -9
- package/esm2020/lib/formly/field/component/component.field.mjs +4 -2
- package/esm2020/lib/formly/field/component/component.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/field.mjs +35 -2
- package/esm2020/lib/formly/field/form.field.module.mjs +44 -0
- package/esm2020/lib/formly/field/index.mjs +3 -1
- package/esm2020/lib/formly/field/selection/index.mjs +2 -1
- package/esm2020/lib/formly/field/selection/pickable/index.mjs +2 -1
- package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +14 -12
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +43 -34
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +39 -0
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +25 -16
- package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +76 -17
- package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +34 -17
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +67 -53
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +71 -55
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.mjs +30 -7
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +12 -14
- package/esm2020/lib/formly/field/selection/searchable/searchable.mjs +1 -1
- package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +37 -13
- package/esm2020/lib/formly/field/selection/searchable/text.chip.field.mjs +1 -1
- package/esm2020/lib/formly/field/selection/selection.mjs +1 -1
- package/esm2020/lib/formly/field/selection/selection.module.mjs +28 -0
- package/esm2020/lib/formly/field/texteditor/index.mjs +4 -0
- package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +90 -0
- package/esm2020/lib/formly/field/texteditor/texteditor.field.mjs +20 -0
- package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +59 -0
- package/esm2020/lib/formly/field/value/array/array.field.component.mjs +87 -51
- package/esm2020/lib/formly/field/value/array/array.field.mjs +20 -0
- package/esm2020/lib/formly/field/value/array/array.field.module.mjs +28 -10
- package/esm2020/lib/formly/field/value/array/index.mjs +2 -1
- package/esm2020/lib/formly/field/value/boolean/boolean.field.mjs +11 -20
- package/esm2020/lib/formly/field/value/boolean/boolean.field.module.mjs +4 -4
- package/esm2020/lib/formly/field/value/date/date.field.module.mjs +13 -10
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +76 -46
- package/esm2020/lib/formly/field/value/date/datetime.field.mjs +36 -0
- package/esm2020/lib/formly/field/value/date/index.mjs +2 -2
- package/esm2020/lib/formly/field/value/enum/enum.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/enum/enum.field.module.mjs +16 -0
- package/esm2020/lib/formly/field/value/enum/index.mjs +2 -1
- package/esm2020/lib/formly/field/value/hidden.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/index.mjs +2 -1
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +13 -33
- package/esm2020/lib/formly/field/value/phone/phone.field.mjs +50 -52
- package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +18 -10
- package/esm2020/lib/formly/field/value/text/index.mjs +2 -1
- package/esm2020/lib/formly/field/value/text/text.additional.field.mjs +81 -0
- package/esm2020/lib/formly/field/value/text/text.address.field.mjs +16 -23
- package/esm2020/lib/formly/field/value/text/text.field.mjs +11 -110
- package/esm2020/lib/formly/field/value/text/text.field.module.mjs +11 -6
- package/esm2020/lib/formly/field/value/value.module.mjs +44 -0
- package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +12 -56
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +58 -0
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +18 -8
- package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +47 -34
- package/esm2020/lib/formly/field/wrapper/index.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +16 -16
- package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +17 -23
- package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +43 -0
- package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +17 -23
- package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +16 -20
- package/esm2020/lib/formly/field/wrapper/wrapper.mjs +81 -0
- package/esm2020/lib/formly/formly.context.directive.mjs +38 -0
- package/esm2020/lib/formly/formly.context.mjs +45 -70
- package/esm2020/lib/formly/formly.directive.mjs +21 -18
- package/esm2020/lib/formly/formly.form.component.mjs +127 -0
- package/esm2020/lib/formly/formly.module.mjs +14 -15
- package/esm2020/lib/formly/index.mjs +4 -2
- package/esm2020/lib/index.mjs +2 -1
- package/esm2020/lib/layout/form.layout.module.mjs +4 -4
- package/esm2020/lib/layout/form.spacer.component.mjs +3 -3
- package/fesm2015/dereekb-dbx-form.mjs +1695 -990
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +1740 -970
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/{src/lib → lib}/form/_form.scss +0 -0
- package/lib/form/action/form.action.directive.d.ts +3 -3
- package/lib/form/action/form.action.module.d.ts +4 -4
- package/lib/form/action/index.d.ts +1 -0
- package/lib/form/action/transition/form.action.transition.module.d.ts +8 -0
- package/lib/form/action/transition/form.action.transition.safety.directive.d.ts +20 -0
- package/lib/form/action/transition/index.d.ts +2 -0
- package/lib/form/form.d.ts +30 -19
- package/lib/form/form.module.d.ts +4 -5
- package/lib/form/index.d.ts +1 -3
- package/lib/form/{form.changes.directive.d.ts → io/form.changes.directive.d.ts} +1 -1
- package/lib/form/{form.input.directive.d.ts → io/form.input.directive.d.ts} +3 -3
- package/lib/form/io/form.io.module.d.ts +10 -0
- package/lib/form/io/form.loading.directive.d.ts +19 -0
- package/lib/form/io/index.d.ts +4 -0
- package/lib/form.module.d.ts +9 -0
- package/{src/lib → lib}/formly/_formly.scss +0 -0
- package/lib/formly/config/index.d.ts +1 -0
- package/lib/formly/config/validation.d.ts +19 -0
- package/{src/lib → lib}/formly/field/_field.scss +0 -0
- package/lib/formly/field/checklist/_checklist.scss +76 -0
- package/lib/formly/field/checklist/checklist.field.d.ts +45 -0
- package/lib/formly/field/checklist/checklist.item.field.component.d.ts +13 -12
- package/lib/formly/field/checklist/checklist.item.field.content.default.component.d.ts +1 -1
- package/lib/formly/field/checklist/checklist.item.field.d.ts +3 -47
- package/lib/formly/field/checklist/index.d.ts +1 -0
- package/{src/lib → lib}/formly/field/component/_component.scss +0 -0
- package/lib/formly/field/component/component.field.component.d.ts +6 -2
- package/lib/formly/field/field.d.ts +17 -3
- package/{src/lib → lib}/formly/field/fields_TODO.scss +0 -0
- package/lib/formly/field/form.field.module.d.ts +13 -0
- package/lib/formly/field/index.d.ts +2 -0
- package/{src/lib → lib}/formly/field/selection/_selection.scss +0 -0
- package/lib/formly/field/selection/index.d.ts +1 -0
- package/{src/lib → lib}/formly/field/selection/pickable/_pickable.scss +10 -1
- package/lib/formly/field/selection/pickable/index.d.ts +1 -0
- package/lib/formly/field/selection/pickable/pickable.chip.field.component.d.ts +3 -3
- package/lib/formly/field/selection/pickable/pickable.field.d.ts +13 -0
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +17 -13
- 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 +27 -3
- package/lib/formly/field/selection/searchable/_searchable.scss +59 -0
- package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +7 -1
- package/lib/formly/field/selection/searchable/searchable.d.ts +6 -8
- package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +20 -14
- package/lib/formly/field/selection/searchable/searchable.field.d.ts +20 -11
- package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +33 -24
- package/lib/formly/field/selection/searchable/searchable.field.module.d.ts +1 -1
- package/lib/formly/field/selection/searchable/searchable.text.field.component.d.ts +11 -1
- package/lib/formly/field/selection/searchable/text.chip.field.d.ts +2 -2
- package/lib/formly/field/selection/selection.d.ts +1 -0
- package/lib/formly/field/selection/selection.module.d.ts +9 -0
- package/lib/formly/field/texteditor/_texteditor.scss +98 -0
- package/lib/formly/field/texteditor/index.d.ts +3 -0
- package/lib/formly/field/texteditor/texteditor.field.component.d.ts +26 -0
- package/lib/formly/field/texteditor/texteditor.field.d.ts +7 -0
- package/lib/formly/field/texteditor/texteditor.field.module.d.ts +14 -0
- package/{src/lib → lib}/formly/field/value/_value.scss +0 -0
- package/lib/formly/field/value/array/_array.scss +73 -0
- package/lib/formly/field/value/array/array.field.component.d.ts +22 -11
- package/lib/formly/field/value/array/array.field.d.ts +9 -0
- package/lib/formly/field/value/array/array.field.module.d.ts +6 -3
- package/lib/formly/field/value/array/index.d.ts +1 -0
- package/{src/lib → lib}/formly/field/value/boolean/_boolean.scss +0 -0
- package/lib/formly/field/value/boolean/boolean.field.d.ts +5 -5
- package/lib/formly/field/value/date/_date.scss +79 -0
- package/lib/formly/field/value/date/date.field.module.d.ts +2 -1
- package/lib/formly/field/value/date/datetime.field.component.d.ts +16 -13
- package/lib/formly/field/value/date/datetime.field.d.ts +14 -0
- package/lib/formly/field/value/date/index.d.ts +1 -1
- package/{src/lib → lib}/formly/field/value/enum/_enum.scss +0 -0
- package/lib/formly/field/value/enum/enum.field.d.ts +2 -2
- package/lib/formly/field/value/enum/enum.field.module.d.ts +6 -0
- package/lib/formly/field/value/enum/index.d.ts +1 -0
- package/lib/formly/field/value/hidden.field.d.ts +2 -2
- package/lib/formly/field/value/index.d.ts +1 -0
- package/lib/formly/field/value/phone/_phone.scss +55 -0
- package/lib/formly/field/value/phone/phone.field.component.d.ts +8 -14
- package/lib/formly/field/value/phone/phone.field.d.ts +20 -18
- package/lib/formly/field/value/phone/phone.field.module.d.ts +10 -8
- package/{src/lib → lib}/formly/field/value/text/_text.scss +0 -0
- package/lib/formly/field/value/text/index.d.ts +1 -0
- package/lib/formly/field/value/text/text.additional.field.d.ts +19 -0
- package/lib/formly/field/value/text/text.address.field.d.ts +8 -9
- package/lib/formly/field/value/text/text.field.d.ts +5 -33
- package/lib/formly/field/value/text/text.field.module.d.ts +3 -2
- package/lib/formly/field/value/value.module.d.ts +13 -0
- package/{src/lib → lib}/formly/field/wrapper/_wrapper.scss +15 -2
- package/lib/formly/field/wrapper/autotouch.wrapper.component.d.ts +2 -2
- package/lib/formly/field/wrapper/expandable.wrapper.component.d.ts +8 -37
- package/lib/formly/field/wrapper/expandable.wrapper.delegate.d.ts +36 -0
- package/lib/formly/field/wrapper/flex.wrapper.component.d.ts +19 -4
- package/lib/formly/field/wrapper/form.wrapper.module.d.ts +10 -8
- package/lib/formly/field/wrapper/index.d.ts +2 -2
- package/lib/formly/field/wrapper/info.wrapper.component.d.ts +9 -9
- package/lib/formly/field/wrapper/section.wrapper.component.d.ts +16 -5
- package/lib/formly/field/wrapper/style.wrapper.component.d.ts +22 -0
- package/lib/formly/field/wrapper/subsection.wrapper.component.d.ts +16 -5
- package/lib/formly/field/wrapper/toggle.wrapper.component.d.ts +6 -14
- package/lib/formly/field/wrapper/wrapper.d.ts +34 -0
- package/{src/lib → lib}/formly/form_TODO.scss +0 -0
- package/lib/formly/formly.context.d.ts +14 -22
- package/lib/formly/formly.context.directive.d.ts +17 -0
- package/lib/formly/formly.directive.d.ts +7 -3
- package/lib/formly/formly.form.component.d.ts +35 -0
- package/lib/formly/formly.module.d.ts +7 -6
- package/lib/formly/index.d.ts +3 -1
- package/lib/index.d.ts +1 -0
- package/{src/lib → lib}/layout/_layout.scss +0 -0
- package/{src/lib → lib}/style/_all-core.scss +0 -0
- package/{src/lib → lib}/style/_all-theme.scss +0 -0
- package/{src/lib → lib}/style/_all-typography.scss +0 -0
- package/{src/lib → lib}/style/_config.scss +0 -0
- package/{src/lib → lib}/style/_core.scss +0 -0
- package/{src/lib → lib}/style/_mixin.scss +0 -0
- package/{src/lib → lib}/style/_theming.scss +0 -0
- package/{src/lib → lib}/style/_variables.scss +0 -0
- package/package.json +23 -23
- package/esm2020/lib/form/form.changes.directive.mjs +0 -33
- package/esm2020/lib/form/form.input.directive.mjs +0 -49
- package/esm2020/lib/form/loading/form.loading.directive.mjs +0 -52
- package/esm2020/lib/form/loading/index.mjs +0 -2
- package/esm2020/lib/formly/field/value/date/date.field.mjs +0 -36
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.layout.mjs +0 -20
- package/esm2020/lib/formly/field/wrapper/toggle.wrapper.mjs +0 -10
- package/esm2020/lib/formly/formly.component.mjs +0 -134
- package/lib/form/loading/form.loading.directive.d.ts +0 -19
- package/lib/form/loading/index.d.ts +0 -1
- package/lib/formly/field/value/date/date.field.d.ts +0 -13
- package/lib/formly/field/wrapper/flex.wrapper.layout.d.ts +0 -10
- package/lib/formly/field/wrapper/toggle.wrapper.d.ts +0 -7
- package/lib/formly/formly.component.d.ts +0 -36
- package/src/lib/formly/field/checklist/_checklist.scss +0 -26
- package/src/lib/formly/field/checklist/checklist.item_TODO.scss +0 -57
- package/src/lib/formly/field/selection/generic_TODO.scss +0 -36
- package/src/lib/formly/field/selection/searchable/_searchable.scss +0 -26
- package/src/lib/formly/field/texteditor/_texteditor.scss +0 -26
- package/src/lib/formly/field/texteditor/texteditor_TODO.scss +0 -32
- package/src/lib/formly/field/value/array/_array.scss +0 -26
- package/src/lib/formly/field/value/date/_date.scss +0 -26
- package/src/lib/formly/field/value/date/date_TODO.scss +0 -27
- package/src/lib/formly/field/value/phone/_phone.scss +0 -26
- package/src/lib/formly/field/value/phone/phone_TODO.scss +0 -10
- package/src/lib/formly/field/wrapper/wrapper_TODO.scss +0 -34
|
File without changes
|
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// MARK: Mixin
|
|
7
|
-
@mixin core() {
|
|
7
|
+
@mixin core() {
|
|
8
|
+
.dbx-pickable-item-field-filter {
|
|
9
|
+
margin-bottom: 4px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dbx-pickable-item-field-list-content {
|
|
13
|
+
max-height: 400px;
|
|
14
|
+
overflow: auto;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
8
17
|
|
|
9
18
|
@mixin color($theme-config) {}
|
|
10
19
|
|
|
@@ -3,8 +3,8 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
/**
|
|
4
4
|
* Used for picking pre-set values using chips as the presentation.
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class DbxPickableChipListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
|
|
7
7
|
itemClicked(item: PickableItemFieldItem<T>): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableChipListFieldComponent<any>, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableChipListFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
10
10
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { Maybe } from '@dereekb/util';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { LabeledFieldConfig } from '../../field';
|
|
5
|
+
import { PickableValueFieldDisplayValue } from './pickable';
|
|
6
|
+
import { PickableItemFieldItem, PickableValueFieldsFieldConfig } from './pickable.field.directive';
|
|
7
|
+
export { PickableItemFieldItem };
|
|
8
|
+
export declare function filterPickableItemFieldValuesByLabel<T>(filterText: Maybe<string>, values: PickableValueFieldDisplayValue<T>[]): Observable<T[]>;
|
|
9
|
+
export declare function sortPickableItemsByLabel<T>(chips: PickableItemFieldItem<T>[]): PickableItemFieldItem<T>[];
|
|
10
|
+
export interface PickableItemFieldConfig<T = any> extends LabeledFieldConfig, PickableValueFieldsFieldConfig<T> {
|
|
11
|
+
}
|
|
12
|
+
export declare function pickableItemChipField<T = any>(config: PickableItemFieldConfig<T>): FormlyFieldConfig;
|
|
13
|
+
export declare function pickableItemListField<T = any>(config: PickableItemFieldConfig<T>): FormlyFieldConfig;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DbxInjectedComponentConfig } from "@dereekb/dbx-core";
|
|
2
|
-
import {
|
|
2
|
+
import { LoadingState, ListLoadingStateContextInstance } from "@dereekb/rxjs";
|
|
3
3
|
import { Maybe } from "@dereekb/util";
|
|
4
4
|
import { OnDestroy, OnInit } from "@angular/core";
|
|
5
5
|
import { FormControl, AbstractControl } from "@angular/forms";
|
|
6
6
|
import { MatInput } from "@angular/material/input";
|
|
7
|
-
import {
|
|
7
|
+
import { FieldTypeConfig, FormlyFieldConfig } from "@ngx-formly/core";
|
|
8
|
+
import { FieldType } from "@ngx-formly/material";
|
|
8
9
|
import { Observable } from "rxjs";
|
|
9
10
|
import { PickableValueFieldDisplayFn, PickableValueFieldDisplayValue, PickableValueFieldFilterFn, PickableValueFieldHashFn, PickableValueFieldLoadValuesFn, PickableValueFieldValue } from "./pickable";
|
|
11
|
+
import { DbxValueListItem } from "@dereekb/dbx-web";
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
13
|
/**
|
|
12
14
|
* Wraps the selected state with the items.
|
|
13
15
|
*/
|
|
14
|
-
export interface PickableItemFieldItem<T> {
|
|
15
|
-
display: PickableValueFieldDisplayValue<T>;
|
|
16
|
-
selected?: boolean;
|
|
16
|
+
export interface PickableItemFieldItem<T> extends DbxValueListItem<PickableValueFieldDisplayValue<T>> {
|
|
17
17
|
}
|
|
18
18
|
export declare type PickableItemFieldItemSortFn<T> = (items: PickableItemFieldItem<T>[]) => PickableItemFieldItem<T>[];
|
|
19
19
|
export interface PickableValueFieldsFieldConfig<T> {
|
|
@@ -76,7 +76,8 @@ export interface PickableValueFieldsFieldConfig<T> {
|
|
|
76
76
|
*/
|
|
77
77
|
footerConfig?: DbxInjectedComponentConfig;
|
|
78
78
|
}
|
|
79
|
-
export interface PickableValueFieldsFormlyFieldConfig<T> extends
|
|
79
|
+
export interface PickableValueFieldsFormlyFieldConfig<T> extends FormlyFieldConfig {
|
|
80
|
+
pickableField: PickableValueFieldsFieldConfig<T>;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
83
|
* Displayed value with the computed hash.
|
|
@@ -87,7 +88,7 @@ export interface PickableValueFieldDisplayValueWithHash<T, M = any> extends Pick
|
|
|
87
88
|
/**
|
|
88
89
|
* Used for picking pre-set values using items as the presentation.
|
|
89
90
|
*/
|
|
90
|
-
export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<PickableValueFieldsFormlyFieldConfig<T
|
|
91
|
+
export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<PickableValueFieldsFormlyFieldConfig<T> & FieldTypeConfig> implements OnInit, OnDestroy {
|
|
91
92
|
filterMatInput: MatInput;
|
|
92
93
|
readonly inputCtrl: FormControl;
|
|
93
94
|
private _formControlObs;
|
|
@@ -116,19 +117,22 @@ export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<
|
|
|
116
117
|
/**
|
|
117
118
|
* Context used for managing the loading of items, or when the current results change.
|
|
118
119
|
*/
|
|
119
|
-
readonly context:
|
|
120
|
+
readonly context: ListLoadingStateContextInstance<any, LoadingState<any>>;
|
|
120
121
|
readonly filterItemsLoadingState$: Observable<LoadingState>;
|
|
121
122
|
/**
|
|
122
123
|
* Context used for searching/filtering.
|
|
123
124
|
*/
|
|
124
|
-
readonly filterResultsContext:
|
|
125
|
+
readonly filterResultsContext: ListLoadingStateContextInstance<any, LoadingState<PickableValueFieldDisplayValueWithHash<T, any>[]>>;
|
|
126
|
+
readonly noItemsAvailable$: Observable<boolean>;
|
|
127
|
+
get readonly(): Maybe<boolean>;
|
|
128
|
+
get isReadonlyOrDisabled(): boolean;
|
|
129
|
+
get pickableField(): PickableValueFieldsFieldConfig<T>;
|
|
125
130
|
get multiSelect(): boolean;
|
|
126
131
|
get asArrayValue(): boolean;
|
|
127
132
|
get filterLabel(): Maybe<string>;
|
|
128
|
-
get
|
|
129
|
-
get
|
|
130
|
-
get
|
|
131
|
-
get description(): Maybe<string>;
|
|
133
|
+
get name(): string;
|
|
134
|
+
get label(): Maybe<string>;
|
|
135
|
+
get autocomplete(): string;
|
|
132
136
|
get sortItems(): Maybe<PickableItemFieldItemSortFn<T>>;
|
|
133
137
|
get hashForValue(): PickableValueFieldHashFn<T>;
|
|
134
138
|
get displayForValue(): PickableValueFieldDisplayFn<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.
|
|
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.DbxAnchorModule, typeof i12.MatChipsModule, typeof i13.MatIconModule, typeof i11.DbxInjectedComponentModule, typeof i4.DbxListLayoutModule, typeof i14.FormlyModule], never>;
|
|
19
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyPickableFieldModule>;
|
|
20
20
|
}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DbxInjectedComponentConfig } from "@dereekb/dbx-core";
|
|
2
|
+
import { AbstractDbxSelectionListWrapperDirective, AbstractSelectionValueListViewDirective, AbstractDbxSelectionValueListViewItemComponent } from "@dereekb/dbx-web";
|
|
3
|
+
import { PickableValueFieldDisplayValue } from "./pickable";
|
|
4
|
+
import { AbstractDbxPickableItemFieldDirective, PickableItemFieldItem } from "./pickable.field.directive";
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
/**
|
|
5
7
|
* Used for picking pre-set values using a selection list as the presentation.
|
|
6
8
|
*/
|
|
7
9
|
export declare class DbxPickableListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
|
|
8
|
-
|
|
10
|
+
onSelectionChange(event: unknown): void;
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldComponent<any>, never>;
|
|
10
12
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
11
13
|
}
|
|
14
|
+
export declare class DbxPickableListFieldItemListComponent<T> extends AbstractDbxSelectionListWrapperDirective<PickableItemFieldItem<T>> {
|
|
15
|
+
constructor();
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListComponent<any>, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListComponent<any>, "dbx-form-pickable-item-field-item-list", never, {}, {}, never, ["[top]", "[bottom]", "[empty]"]>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* NOTE: Values input are PickableItemFieldItem<T>, but output values are PickableValueFieldDisplayValue<T>.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DbxPickableListFieldItemListViewComponent<T> extends AbstractSelectionValueListViewDirective<PickableItemFieldItem<T>> {
|
|
23
|
+
readonly dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>;
|
|
24
|
+
readonly config: DbxInjectedComponentConfig;
|
|
25
|
+
get multiple(): boolean;
|
|
26
|
+
readonly items$: import("rxjs").Observable<import("@dereekb/dbx-web").DbxValueListItemConfig<PickableValueFieldDisplayValue<T, any>>[]>;
|
|
27
|
+
constructor(dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>);
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewComponent<any>, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
30
|
+
}
|
|
31
|
+
export declare class DbxPickableListFieldItemListViewItemComponent<T> extends AbstractDbxSelectionValueListViewItemComponent<PickableValueFieldDisplayValue<T>> {
|
|
32
|
+
get label(): string;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@use '../../../../style/theming';
|
|
2
|
+
|
|
3
|
+
// MARK: Variables
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// MARK: Mixin
|
|
7
|
+
@mixin core() {
|
|
8
|
+
|
|
9
|
+
.dbx-searchable-text-field-value {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dbx-searchable-text-field-value.mat-option,
|
|
14
|
+
.dbx-searchable-text-field-autocomplete .mat-option {
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dbx-default-searchable-field-display {
|
|
19
|
+
padding: 0 16px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dbx-searchable-text-field-has-value.dbx-searchable-text-field-show-value {
|
|
23
|
+
|
|
24
|
+
.dbx-searchable-text-field-value {
|
|
25
|
+
margin-bottom: -6px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// hide without clearing display, which will prevent the input from being clickable.
|
|
29
|
+
.dbx-searchable-text-field-input {
|
|
30
|
+
height: 0;
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mat-focused .dbx-searchable-text-field-has-value.dbx-searchable-text-field-show-value .dbx-searchable-text-field-input {
|
|
36
|
+
opacity: unset;
|
|
37
|
+
height: unset;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin color($theme-config) {}
|
|
43
|
+
|
|
44
|
+
@mixin typography($typography-config) {}
|
|
45
|
+
|
|
46
|
+
@mixin theme($theme-config) {
|
|
47
|
+
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-form-field-selection-searchable') {
|
|
48
|
+
$color: theming.get-color-config($theme-config);
|
|
49
|
+
$typography: theming.get-typography-config($theme-config);
|
|
50
|
+
|
|
51
|
+
@if $color !=null {
|
|
52
|
+
@include color($theme-config);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@if $typography !=null {
|
|
56
|
+
@include typography($typography);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -4,13 +4,19 @@ import { AbstractDbxSearchableValueFieldDirective, SearchableValueFieldsFieldCon
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export interface SearchableChipValueFieldsFieldConfig<T> extends SearchableValueFieldsFieldConfig<T> {
|
|
6
6
|
}
|
|
7
|
-
export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends
|
|
7
|
+
export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFormlyFieldConfig<T> {
|
|
8
|
+
searchableField: SearchableChipValueFieldsFieldConfig<T>;
|
|
8
9
|
}
|
|
9
10
|
export declare class DbxSearchableChipFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableChipValueFieldsFormlyFieldConfig<T>> {
|
|
11
|
+
private _blur;
|
|
12
|
+
private _blurSub;
|
|
10
13
|
readonly separatorKeysCodes: number[];
|
|
11
14
|
selected(event: MatAutocompleteSelectedEvent): void;
|
|
12
15
|
tabPressedOnInput(event: KeyboardEvent): boolean;
|
|
13
16
|
addChip(event: MatChipInputEvent): void;
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngOnDestroy(): void;
|
|
19
|
+
onBlur(): void;
|
|
14
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableChipFieldComponent<any>, never>;
|
|
15
21
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableChipFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
16
22
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { ClickableAnchor } from '@dereekb/dbx-core';
|
|
2
|
-
import { Type } from '@angular/core';
|
|
1
|
+
import { DbxInjectedComponentConfig, ClickableAnchor } from '@dereekb/dbx-core';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import { SelectionDisplayValue, SelectionValue, SelectionValueHashFn } from '../selection';
|
|
5
|
-
export interface SearchableFieldDisplayComponent<T> {
|
|
6
|
-
displayValue?: SearchableValueFieldDisplayValue<T>;
|
|
7
|
-
}
|
|
8
4
|
export interface SearchableValueFieldValue<T, M = any> extends SelectionValue<T, M> {
|
|
9
5
|
/**
|
|
10
6
|
* Optional anchor metadata on the field.
|
|
@@ -15,11 +11,13 @@ export interface SearchableValueFieldValue<T, M = any> extends SelectionValue<T,
|
|
|
15
11
|
* Displayed value.
|
|
16
12
|
*/
|
|
17
13
|
export interface SearchableValueFieldDisplayValue<T, M = any> extends SelectionDisplayValue<T, M>, SearchableValueFieldValue<T, M> {
|
|
18
|
-
sublabel?: string;
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
15
|
+
* Display override configuration
|
|
21
16
|
*/
|
|
22
|
-
|
|
17
|
+
display?: Partial<DbxInjectedComponentConfig>;
|
|
18
|
+
}
|
|
19
|
+
export interface ConfiguredSearchableValueFieldDisplayValue<T, M = any> extends Omit<SearchableValueFieldDisplayValue<T, M>, 'display'> {
|
|
20
|
+
display: DbxInjectedComponentConfig;
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* SearchableValueField function for searching values.
|
package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { InjectionToken, OnDestroy } from '@angular/core';
|
|
3
|
+
import { ConfiguredSearchableValueFieldDisplayValue } from './searchable';
|
|
4
|
+
import { DbxInjectedComponentConfig } from '@dereekb/dbx-core';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export declare const DBX_SEARCHABLE_FIELD_COMPONENT_DATA: InjectionToken<unknown>;
|
|
7
|
+
export declare class DbxSearchableFieldAutocompleteItemComponent<T> implements OnDestroy {
|
|
8
|
+
private _displayValue;
|
|
9
|
+
readonly displayValue$: Observable<ConfiguredSearchableValueFieldDisplayValue<T, any>>;
|
|
10
|
+
readonly config$: Observable<DbxInjectedComponentConfig>;
|
|
11
|
+
readonly anchor$: Observable<import("@dereekb/dbx-core").ClickableAnchor | undefined>;
|
|
12
|
+
set displayValue(displayValue: ConfiguredSearchableValueFieldDisplayValue<T>);
|
|
13
|
+
ngOnDestroy(): void;
|
|
8
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, never>;
|
|
9
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, "dbx-searchable-field-autocomplete-item", never, { "displayValue": "displayValue"; }, {}, never, never>;
|
|
10
16
|
}
|
|
11
|
-
export declare class
|
|
12
|
-
displayValue:
|
|
13
|
-
|
|
14
|
-
static
|
|
17
|
+
export declare abstract class AbstractDbxSearchableFieldDisplayDirective<T> {
|
|
18
|
+
readonly displayValue: ConfiguredSearchableValueFieldDisplayValue<T>;
|
|
19
|
+
constructor(displayValue: ConfiguredSearchableValueFieldDisplayValue<T>);
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never>;
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never, never, {}, {}, never>;
|
|
15
22
|
}
|
|
16
|
-
export declare class
|
|
17
|
-
|
|
18
|
-
static
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableAnchorFieldDisplayComponent<any>, "ng-component", never, { "displayValue": "displayValue"; }, {}, never, never>;
|
|
23
|
+
export declare class DbxDefaultSearchableFieldDisplayComponent<T> extends AbstractDbxSearchableFieldDisplayDirective<T> {
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, "dbx-default-searchable-field-display", never, {}, {}, never, never>;
|
|
20
26
|
}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
1
2
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
3
|
+
import { LabeledFieldConfig, DescriptionFieldConfig } from '../../field';
|
|
3
4
|
import { SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue } from './searchable';
|
|
4
|
-
import { SearchableChipValueFieldsFieldConfig
|
|
5
|
-
import { SearchableTextValueFieldsFieldConfig
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { SearchableChipValueFieldsFieldConfig } from './searchable.chip.field.component';
|
|
6
|
+
import { SearchableTextValueFieldsFieldConfig } from './searchable.text.field.component';
|
|
7
|
+
/**
|
|
8
|
+
* Used to create a SearchableValueFieldDisplayFn function that will retrieve the metadata for items that are missing their metadata so they can be displayed properly.
|
|
9
|
+
*
|
|
10
|
+
* @param param0
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function makeMetaFilterSearchableFieldValueDisplayFn<T = string | number, M = any>({ loadMetaForValues, makeDisplayForValues }: {
|
|
14
|
+
loadMetaForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldValue<T, M>[]>;
|
|
15
|
+
makeDisplayForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldDisplayValue<T, M>[]>;
|
|
16
|
+
}): SearchableValueFieldDisplayFn<T>;
|
|
17
|
+
export interface StringSearchableChipFieldConfig extends Omit<SearchableChipFieldConfig<string>, 'allowStringValues'> {
|
|
8
18
|
}
|
|
9
|
-
export
|
|
19
|
+
export declare function searchableStringChipField(config: StringSearchableChipFieldConfig): FormlyFieldConfig;
|
|
20
|
+
export interface SearchableChipFieldConfig<T = any> extends LabeledFieldConfig, DescriptionFieldConfig, SearchableChipValueFieldsFieldConfig<T> {
|
|
10
21
|
}
|
|
11
|
-
export declare function searchableChipField<
|
|
12
|
-
export interface SearchableTextFieldConfig<T = any> extends
|
|
22
|
+
export declare function searchableChipField<T>(config: SearchableChipFieldConfig<T>): FormlyFieldConfig;
|
|
23
|
+
export interface SearchableTextFieldConfig<T = any> extends LabeledFieldConfig, DescriptionFieldConfig, SearchableTextValueFieldsFieldConfig<T> {
|
|
13
24
|
}
|
|
14
|
-
export
|
|
15
|
-
}
|
|
16
|
-
export declare function searchableTextField<C extends SearchableTextFieldFormlyConfig<any>>(config: C): C;
|
|
25
|
+
export declare function searchableTextField<T>(config: SearchableTextFieldConfig<T>): FormlyFieldConfig;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { DbxInjectedComponentConfig } from '@dereekb/dbx-core';
|
|
1
2
|
import { SubscriptionObject, LoadingState, LoadingStateContextInstance } from '@dereekb/rxjs';
|
|
2
|
-
import { ElementRef, OnDestroy, OnInit
|
|
3
|
+
import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
3
4
|
import { AbstractControl, FormControl, ValidatorFn } from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
+
import { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';
|
|
6
|
+
import { FieldType } from '@ngx-formly/material';
|
|
5
7
|
import { Observable } from 'rxjs';
|
|
6
|
-
import { SearchableValueFieldHashFn, SearchableValueFieldStringSearchFn, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue,
|
|
8
|
+
import { SearchableValueFieldHashFn, SearchableValueFieldStringSearchFn, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue, SearchableValueFieldAnchorFn, ConfiguredSearchableValueFieldDisplayValue } from './searchable';
|
|
7
9
|
import { Maybe } from '@dereekb/util';
|
|
8
10
|
import * as i0 from "@angular/core";
|
|
9
11
|
export interface StringValueFieldsFieldConfig {
|
|
@@ -11,10 +13,6 @@ export interface StringValueFieldsFieldConfig {
|
|
|
11
13
|
* Custom input validators.
|
|
12
14
|
*/
|
|
13
15
|
textInputValidator?: ValidatorFn | ValidatorFn[];
|
|
14
|
-
/**
|
|
15
|
-
* Optional description/hint to display.
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
16
|
}
|
|
19
17
|
export interface StringValueFieldsFormlyFieldConfig extends StringValueFieldsFieldConfig, FormlyFieldConfig {
|
|
20
18
|
}
|
|
@@ -42,9 +40,9 @@ export interface SearchableValueFieldsFieldConfig<T> extends StringValueFieldsFi
|
|
|
42
40
|
*/
|
|
43
41
|
searchOnEmptyText?: boolean;
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* Default injected config to use for display values.
|
|
46
44
|
*/
|
|
47
|
-
|
|
45
|
+
display?: Partial<DbxInjectedComponentConfig>;
|
|
48
46
|
/**
|
|
49
47
|
* Used for building a display value given the input.
|
|
50
48
|
*/
|
|
@@ -61,20 +59,29 @@ export interface SearchableValueFieldsFieldConfig<T> extends StringValueFieldsFi
|
|
|
61
59
|
* Only used when useAnchor is true.
|
|
62
60
|
*/
|
|
63
61
|
anchorForValue?: SearchableValueFieldAnchorFn<T>;
|
|
62
|
+
/**
|
|
63
|
+
* Whether or not to show "Clear" in the autcomplete list.
|
|
64
|
+
*/
|
|
65
|
+
showClearValue?: boolean;
|
|
64
66
|
}
|
|
65
|
-
export interface SearchableValueFieldsFormlyFieldConfig<T> extends
|
|
67
|
+
export interface SearchableValueFieldsFormlyFieldConfig<T> extends FormlyFieldConfig {
|
|
68
|
+
searchableField: SearchableValueFieldsFieldConfig<T>;
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
68
71
|
* Abstract searchable field that provides a feature for searching for values, and for displaying values using Observables.
|
|
69
72
|
*
|
|
70
73
|
* Display values are cached for performance.
|
|
71
74
|
*/
|
|
72
|
-
export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C extends SearchableValueFieldsFormlyFieldConfig<T>> extends FieldType<C> implements OnInit, OnDestroy {
|
|
75
|
+
export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C extends SearchableValueFieldsFormlyFieldConfig<T>> extends FieldType<C & FieldTypeConfig> implements OnInit, OnDestroy {
|
|
76
|
+
readonly cdRef: ChangeDetectorRef;
|
|
73
77
|
/**
|
|
74
78
|
* Whether or not to set/get values as an array.
|
|
75
79
|
*/
|
|
76
80
|
multiSelect: boolean;
|
|
77
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Optional override set by the parent class for picking a default display for this directive.
|
|
83
|
+
*/
|
|
84
|
+
defaultDisplay?: DbxInjectedComponentConfig;
|
|
78
85
|
textInput: ElementRef<HTMLInputElement>;
|
|
79
86
|
readonly inputCtrl: FormControl;
|
|
80
87
|
private _formControlObs;
|
|
@@ -82,34 +89,34 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
|
|
|
82
89
|
private _displayHashMap;
|
|
83
90
|
readonly inputValue$: Observable<string>;
|
|
84
91
|
readonly inputValueString$: Observable<string>;
|
|
85
|
-
readonly searchResultsState$: Observable<LoadingState<any> | LoadingState<
|
|
92
|
+
readonly searchResultsState$: Observable<LoadingState<any> | LoadingState<ConfiguredSearchableValueFieldDisplayValue<T, any>[]>>;
|
|
86
93
|
readonly singleValueSyncSubscription: SubscriptionObject;
|
|
87
|
-
readonly searchContext: LoadingStateContextInstance<any, LoadingState<any> | LoadingState<
|
|
88
|
-
readonly searchResults$: Observable<
|
|
94
|
+
readonly searchContext: LoadingStateContextInstance<any, LoadingState<any> | LoadingState<ConfiguredSearchableValueFieldDisplayValue<T, any>[]>>;
|
|
95
|
+
readonly searchResults$: Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
|
|
89
96
|
readonly _formControlValue: Observable<T | T[]>;
|
|
90
97
|
readonly values$: Observable<T[]>;
|
|
91
|
-
readonly displayValuesState$: Observable<LoadingState<
|
|
92
|
-
readonly displayValues$: Observable<
|
|
98
|
+
readonly displayValuesState$: Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
|
|
99
|
+
readonly displayValues$: Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
|
|
93
100
|
get name(): string;
|
|
94
101
|
get label(): Maybe<string>;
|
|
95
102
|
get readonly(): Maybe<boolean>;
|
|
103
|
+
get searchableField(): SearchableValueFieldsFieldConfig<T>;
|
|
96
104
|
get searchOnEmptyText(): boolean;
|
|
97
|
-
get required(): Maybe<boolean>;
|
|
98
105
|
get autocomplete(): string;
|
|
99
|
-
get placeholder(): string;
|
|
100
|
-
get description(): Maybe<string>;
|
|
101
106
|
get hashForValue(): SearchableValueFieldHashFn<T>;
|
|
102
107
|
get displayForValue(): SearchableValueFieldDisplayFn<T>;
|
|
103
108
|
get useAnchor(): Maybe<boolean>;
|
|
104
109
|
get anchorForValue(): Maybe<SearchableValueFieldAnchorFn<T>>;
|
|
105
|
-
get
|
|
110
|
+
get display(): Maybe<Partial<DbxInjectedComponentConfig>>;
|
|
106
111
|
get search(): SearchableValueFieldStringSearchFn<T>;
|
|
107
112
|
get values(): T[];
|
|
108
113
|
get allowStringValues(): boolean;
|
|
109
114
|
get convertStringValue(): Maybe<(text: string) => T>;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
get showClearValue(): boolean;
|
|
116
|
+
loadDisplayValuesForValues(values: T[]): Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
|
|
117
|
+
loadDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
|
|
118
|
+
getDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
|
|
119
|
+
constructor(cdRef: ChangeDetectorRef);
|
|
113
120
|
ngOnInit(): void;
|
|
114
121
|
ngOnDestroy(): void;
|
|
115
122
|
/**
|
|
@@ -121,8 +128,10 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
|
|
|
121
128
|
protected _addWithTextValue(text: string): void;
|
|
122
129
|
addWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
|
|
123
130
|
removeWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
|
|
131
|
+
_tryAddCurrentInputValue(): boolean;
|
|
124
132
|
addValue(value: T): void;
|
|
125
133
|
removeValue(value: T): void;
|
|
134
|
+
clearValues(): void;
|
|
126
135
|
setValues(values: T[]): void;
|
|
127
136
|
protected _getValueOnFormControl(valueOnFormControl: any): T[];
|
|
128
137
|
protected _setValueOnFormControl(values: T[]): void;
|
|
@@ -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
|
|
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.DbxAnchorModule, typeof i13.MatChipsModule, typeof i14.MatIconModule, typeof i12.DbxInjectedComponentModule, typeof i15.FormlyModule], [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent]>;
|
|
20
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySearchableFieldModule>;
|
|
21
21
|
}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { AbstractDbxSearchableValueFieldDirective, SearchableValueFieldsFieldConfig, SearchableValueFieldsFormlyFieldConfig } from './searchable.field.directive';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export interface SearchableTextValueFieldsFieldConfig<T> extends SearchableValueFieldsFieldConfig<T> {
|
|
4
|
+
showSelectedValue?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export interface SearchableTextValueFieldsFormlyFieldConfig<T> extends
|
|
6
|
+
export interface SearchableTextValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFormlyFieldConfig<T> {
|
|
7
|
+
searchableField: SearchableTextValueFieldsFieldConfig<T>;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Display component for selecting a single item/value.
|
|
9
11
|
*/
|
|
10
12
|
export declare class DbxSearchableTextFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableTextValueFieldsFormlyFieldConfig<T>> {
|
|
13
|
+
readonly selectedDisplayValue$: import("rxjs").Observable<import("@dereekb/dbx-form").ConfiguredSearchableValueFieldDisplayValue<T, any>>;
|
|
14
|
+
readonly hasValue$: import("rxjs").Observable<boolean>;
|
|
15
|
+
readonly showSelectedDisplayValue$: import("rxjs").Observable<boolean>;
|
|
16
|
+
get searchableField(): SearchableTextValueFieldsFieldConfig<T>;
|
|
17
|
+
get showSelectedValue(): boolean;
|
|
11
18
|
readonly multiSelect = false;
|
|
19
|
+
private _clearInputSub;
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
12
22
|
selected(event: any): void;
|
|
13
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableTextFieldComponent<any>, never>;
|
|
14
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableTextFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormlyFieldConfig } from "@ngx-formly/core";
|
|
2
|
-
import {
|
|
2
|
+
import { LabeledFieldConfig } from "../../field";
|
|
3
3
|
import { StringValueFieldsFieldConfig, StringValueFieldsFormlyFieldConfig } from "./searchable.field.directive";
|
|
4
|
-
export interface ChipTextFieldConfig extends
|
|
4
|
+
export interface ChipTextFieldConfig extends LabeledFieldConfig, StringValueFieldsFieldConfig {
|
|
5
5
|
}
|
|
6
6
|
export interface ChipTextFieldFormlyConfig extends StringValueFieldsFormlyFieldConfig, FormlyFieldConfig {
|
|
7
7
|
caseSensitive?: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "./pickable/pickable.field.module";
|
|
4
|
+
import * as i3 from "./searchable/searchable.field.module";
|
|
5
|
+
export declare class DbxFormFormlySelectionModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySelectionModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySelectionModule, never, [typeof i1.CommonModule], [typeof i2.DbxFormFormlyPickableFieldModule, typeof i3.DbxFormFormlySearchableFieldModule]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySelectionModule>;
|
|
9
|
+
}
|