@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
|
@@ -1,54 +1,62 @@
|
|
|
1
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { forwardRef, Directive, Host, Input, NgModule, EventEmitter, Output, Component,
|
|
2
|
+
import { forwardRef, Directive, Host, Input, NgModule, EventEmitter, Output, Component, ViewChild, InjectionToken, Inject, Optional } from '@angular/core';
|
|
4
3
|
import * as i5 from '@angular/common';
|
|
5
4
|
import { CommonModule } from '@angular/common';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import * as i1$1 from '@dereekb/dbx-web';
|
|
6
|
+
import { DbxActionTransitionSafetyDirective, DbxTextModule, DbxFlexLayoutModule, DbxSectionLayoutModule, DbxAnchorModule, AbstractDbxSelectionListWrapperDirective, DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE, AbstractSelectionValueListViewDirective, mapItemValuesToValueListItemConfig, ProvideDbxListView, AbstractDbxSelectionValueListViewItemComponent, DbxLoadingModule, DbxButtonModule, DbxListLayoutModule, mapCompactModeObs, DbxBarLayoutModule } from '@dereekb/dbx-web';
|
|
7
|
+
import { isPast, addSeconds, isSameMinute, startOfDay, isSameDay, addMinutes } from 'date-fns';
|
|
8
|
+
import { exhaustMap, of, combineLatest, filter as filter$1, mergeMap, first as first$1, delay, BehaviorSubject, switchMap as switchMap$1, shareReplay as shareReplay$1, startWith, map as map$1, debounceTime, distinctUntilChanged as distinctUntilChanged$1, Subject, skipWhile, interval, merge, throttleTime as throttleTime$1 } from 'rxjs';
|
|
9
|
+
import { switchMap, first, catchError, filter, map, distinctUntilChanged, shareReplay, delay as delay$1, debounceTime as debounceTime$1, startWith as startWith$1, tap, throttleTime } from 'rxjs/operators';
|
|
10
|
+
import { LockSet, SubscriptionObject, switchMapMaybeObs, filterMaybe, switchMapMaybeDefault, asObservable, beginLoading, mapLoadingStateResults, successResult, ListLoadingStateContextInstance, isListLoadingStateEmpty, LoadingStateContextInstance, skipFirstMaybe, scanCount } from '@dereekb/rxjs';
|
|
10
11
|
import * as i2 from '@dereekb/dbx-core';
|
|
11
|
-
import { AbstractSubscriptionDirective, DbxInjectedComponentModule, DbxDatePipeModule } from '@dereekb/dbx-core';
|
|
12
|
+
import { AbstractSubscriptionDirective, safeDetectChanges, DbxInjectedComponentModule, DbxDatePipeModule, mergeDbxInjectedComponentConfigs, tapDetectChanges } from '@dereekb/dbx-core';
|
|
13
|
+
import * as i3 from '@uirouter/core';
|
|
14
|
+
import * as i4 from '@angular/material/dialog';
|
|
15
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
12
16
|
import * as i1$4 from '@ngx-formly/core';
|
|
13
17
|
import { FieldType, FieldWrapper, FormlyModule, FieldArrayType } from '@ngx-formly/core';
|
|
14
18
|
import * as i1 from '@angular/material/checkbox';
|
|
15
19
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
16
|
-
import * as i1$1 from '@dereekb/dbx-web';
|
|
17
|
-
import { DbxTextModule, DbxAnchorModule, DbxLoadingModule, DbxButtonModule } from '@dereekb/dbx-web';
|
|
18
20
|
import * as i2$1 from '@angular/material/icon';
|
|
19
21
|
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
-
import * as
|
|
22
|
+
import * as i4$1 from '@angular/forms';
|
|
21
23
|
import { FormsModule, ReactiveFormsModule, FormControl, Validators, FormGroup } from '@angular/forms';
|
|
22
|
-
import * as
|
|
24
|
+
import * as i6 from '@angular/material/core';
|
|
23
25
|
import { MatRippleModule, MatNativeDateModule } from '@angular/material/core';
|
|
24
26
|
import * as i1$2 from '@angular/material/button';
|
|
25
27
|
import { MatButtonModule } from '@angular/material/button';
|
|
26
28
|
import * as i3$1 from '@angular/flex-layout/flex';
|
|
27
29
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
28
|
-
import {
|
|
30
|
+
import { objectIsEmpty, mergeObjects, filterFromPOJO, addPlusPrefixToNumber, convertMaybeToArray, makeValuesGroupMap, findUnique, mergeIntoArray, lastValue, separateValues, arrayToMap, getValueFromObjectOrGetter } from '@dereekb/util';
|
|
29
31
|
import * as i1$3 from '@angular/material/slide-toggle';
|
|
30
32
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
31
|
-
import * as
|
|
33
|
+
import * as i2$2 from '@angular/flex-layout/extended';
|
|
34
|
+
import { FieldType as FieldType$1, FormlyMaterialModule } from '@ngx-formly/material';
|
|
35
|
+
import { camelCase } from 'change-case';
|
|
36
|
+
import * as i1$5 from '@angular/material/chips';
|
|
32
37
|
import { MatChipsModule } from '@angular/material/chips';
|
|
33
|
-
import * as i4 from '@angular/material/
|
|
34
|
-
import {
|
|
35
|
-
import * as i6 from '@angular/material/input';
|
|
36
|
-
import { MatInputModule } from '@angular/material/input';
|
|
37
|
-
import * as
|
|
38
|
+
import * as i4$2 from '@angular/material/divider';
|
|
39
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
40
|
+
import * as i6$1 from '@angular/material/input';
|
|
41
|
+
import { MatInputModule, MatInput } from '@angular/material/input';
|
|
42
|
+
import * as i4$3 from '@angular/material/autocomplete';
|
|
38
43
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
39
|
-
import * as i2$3 from '@angular/material/list';
|
|
40
44
|
import { MatListModule } from '@angular/material/list';
|
|
41
|
-
import
|
|
45
|
+
import * as i3$2 from '@angular/material/form-field';
|
|
46
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
42
47
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import {
|
|
46
|
-
import * as
|
|
48
|
+
import { skipUntilTimeElapsedAfterLastEmission, guessCurrentTimezone, toReadableTimeString, utcDayForDate, readableTimeStringToDate, DateTimeMinuteInstance } from '@dereekb/date';
|
|
49
|
+
import * as i2$3 from 'ngx-editor';
|
|
50
|
+
import { Editor, NgxEditorModule } from 'ngx-editor';
|
|
51
|
+
import * as i5$1 from '@angular/cdk/drag-drop';
|
|
52
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
53
|
+
import * as i4$4 from '@angular/material/datepicker';
|
|
47
54
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
48
55
|
import * as i5$2 from '@angular/material/menu';
|
|
49
56
|
import { MatMenuModule } from '@angular/material/menu';
|
|
50
|
-
import * as
|
|
57
|
+
import * as i1$6 from 'ngx-mat-intl-tel-input';
|
|
51
58
|
import { NgxMatIntlTelInputModule } from 'ngx-mat-intl-tel-input';
|
|
59
|
+
import { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
52
60
|
import { cloneDeep } from 'lodash';
|
|
53
61
|
import { FormlyMatToggleModule } from '@ngx-formly/material/toggle';
|
|
54
62
|
|
|
@@ -58,18 +66,25 @@ import { FormlyMatToggleModule } from '@ngx-formly/material/toggle';
|
|
|
58
66
|
var DbxFormState;
|
|
59
67
|
(function (DbxFormState) {
|
|
60
68
|
DbxFormState[DbxFormState["INITIALIZING"] = -1] = "INITIALIZING";
|
|
61
|
-
DbxFormState[DbxFormState["
|
|
62
|
-
DbxFormState[DbxFormState["
|
|
63
|
-
DbxFormState[DbxFormState["RESET"] = 2] = "RESET";
|
|
69
|
+
DbxFormState[DbxFormState["RESET"] = 0] = "RESET";
|
|
70
|
+
DbxFormState[DbxFormState["USED"] = 1] = "USED";
|
|
64
71
|
})(DbxFormState || (DbxFormState = {}));
|
|
65
72
|
/**
|
|
66
73
|
* Form that has an event stream, value, and state items.
|
|
67
74
|
*/
|
|
68
75
|
class DbxForm {
|
|
69
76
|
}
|
|
77
|
+
class DbxMutableForm extends DbxForm {
|
|
78
|
+
}
|
|
70
79
|
function ProvideDbxForm(sourceType) {
|
|
71
80
|
return [{ provide: DbxForm, useExisting: forwardRef(() => sourceType) }];
|
|
72
81
|
}
|
|
82
|
+
function ProvideDbxMutableForm(sourceType) {
|
|
83
|
+
return [
|
|
84
|
+
...ProvideDbxForm(sourceType),
|
|
85
|
+
{ provide: DbxMutableForm, useExisting: forwardRef(() => sourceType) }
|
|
86
|
+
];
|
|
87
|
+
}
|
|
73
88
|
|
|
74
89
|
const APP_ACTION_FORM_DISABLED_KEY = 'actionForm';
|
|
75
90
|
/**
|
|
@@ -93,23 +108,24 @@ class DbxActionFormDirective {
|
|
|
93
108
|
}
|
|
94
109
|
ngOnInit() {
|
|
95
110
|
// Pass data from the form to the source when triggered.
|
|
96
|
-
this._triggeredSub.subscription = this.source.triggered$.pipe(switchMap(() => {
|
|
111
|
+
this._triggeredSub.subscription = this.source.triggered$.pipe(switchMap(() => this.form.stream$.pipe(first(), exhaustMap(({ isComplete }) => {
|
|
97
112
|
const doNothing = {}; // nothing, form not complete
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
let obs;
|
|
114
|
+
if (isComplete) {
|
|
115
|
+
obs = this.form.getValue().pipe(first(), exhaustMap((value) => this.preCheckReadyValue(value).pipe(first(), switchMap((canContinue) => {
|
|
101
116
|
if (canContinue) {
|
|
102
117
|
return this.readyValue(value).pipe(first());
|
|
103
118
|
}
|
|
104
119
|
else {
|
|
105
120
|
return of(doNothing);
|
|
106
121
|
}
|
|
107
|
-
}), catchError((error) => of({ error })));
|
|
122
|
+
}), catchError((error) => of({ error })))));
|
|
108
123
|
}
|
|
109
124
|
else {
|
|
110
|
-
|
|
125
|
+
obs = of(doNothing);
|
|
111
126
|
}
|
|
112
|
-
|
|
127
|
+
return obs;
|
|
128
|
+
})))).subscribe((result) => {
|
|
113
129
|
if (result.reject) {
|
|
114
130
|
this.source.reject(result.reject);
|
|
115
131
|
}
|
|
@@ -122,35 +138,36 @@ class DbxActionFormDirective {
|
|
|
122
138
|
});
|
|
123
139
|
// Update the enabled/disabled state
|
|
124
140
|
this._isCompleteSub.subscription = this.form.stream$.pipe(filter((x) => x.state !== DbxFormState.INITIALIZING), switchMap((event) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
})).subscribe(({ valid, modified, event }) => {
|
|
141
|
+
return this.form.getValue().pipe(first(), exhaustMap((value) => {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
// Use both changes count and whether or not something was in the past to guage whether or not the item has been touched.
|
|
144
|
+
// Angular Form's untouched is whether or not focus has been lost but we can still recieve value updates.
|
|
145
|
+
// More than a certain amount of updates implies that it is being typed into.
|
|
146
|
+
const isProbablyTouched = !event.untouched ||
|
|
147
|
+
(((_a = event.changesCount) !== null && _a !== void 0 ? _a : 0) > 3 && isPast(addSeconds((_b = event.lastResetAt) !== null && _b !== void 0 ? _b : new Date(), 2)));
|
|
148
|
+
let validatorObs;
|
|
149
|
+
const initialIsValidCheck = event.isComplete;
|
|
150
|
+
if (initialIsValidCheck) {
|
|
151
|
+
validatorObs = (this.appActionFormValidator) ? this.appActionFormValidator(value) : of(true);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
validatorObs = of(false);
|
|
155
|
+
}
|
|
156
|
+
let modifiedObs;
|
|
157
|
+
const isConsideredModified = (event.pristine === false && isProbablyTouched);
|
|
158
|
+
if (isConsideredModified) {
|
|
159
|
+
modifiedObs = (this.appActionFormModified) ? this.appActionFormModified(value) : of(true);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
modifiedObs = of(false);
|
|
163
|
+
}
|
|
164
|
+
return combineLatest([
|
|
165
|
+
validatorObs,
|
|
166
|
+
modifiedObs
|
|
167
|
+
]).pipe(first(), map(([valid, modified]) => ({ valid, modified, value, event })));
|
|
168
|
+
}));
|
|
169
|
+
})).subscribe(({ valid, modified, value, event }) => {
|
|
170
|
+
// console.log('x: ', value, event, valid, modified);
|
|
154
171
|
// Update Modified State
|
|
155
172
|
this.source.setIsModified(modified);
|
|
156
173
|
// Disable if the form is not yet complete/valid.
|
|
@@ -178,15 +195,15 @@ class DbxActionFormDirective {
|
|
|
178
195
|
return of({ value });
|
|
179
196
|
}
|
|
180
197
|
}
|
|
181
|
-
DbxActionFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
182
|
-
DbxActionFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
198
|
+
DbxActionFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFormDirective, deps: [{ token: DbxMutableForm, host: true }, { token: i2.ActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
|
|
199
|
+
DbxActionFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionFormDirective, selector: "[dbxActionForm]", inputs: { appActionFormValidator: "appActionFormValidator", appActionFormModified: "appActionFormModified" }, ngImport: i0 });
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFormDirective, decorators: [{
|
|
184
201
|
type: Directive,
|
|
185
202
|
args: [{
|
|
186
203
|
selector: '[dbxActionForm]'
|
|
187
204
|
}]
|
|
188
205
|
}], ctorParameters: function () {
|
|
189
|
-
return [{ type:
|
|
206
|
+
return [{ type: DbxMutableForm, decorators: [{
|
|
190
207
|
type: Host
|
|
191
208
|
}] }, { type: i2.ActionContextStoreSourceInstance }];
|
|
192
209
|
}, propDecorators: { appActionFormValidator: [{
|
|
@@ -195,16 +212,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
195
212
|
type: Input
|
|
196
213
|
}] } });
|
|
197
214
|
|
|
198
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Extension of DbxActionTransitionSafetyDirective that forces the form to update first.
|
|
217
|
+
*
|
|
218
|
+
* NOTE: Only works with UIRouter
|
|
219
|
+
*/
|
|
220
|
+
class DbxActionFormSafetyDirective extends DbxActionTransitionSafetyDirective {
|
|
221
|
+
constructor(appActionForm, source, transitionService, viewContainerRef, dialog) {
|
|
222
|
+
super(source, transitionService, viewContainerRef, dialog);
|
|
223
|
+
this.appActionForm = appActionForm;
|
|
224
|
+
}
|
|
225
|
+
_handleOnBeforeTransition(transition) {
|
|
226
|
+
this.appActionForm.form.forceFormUpdate();
|
|
227
|
+
return super._handleOnBeforeTransition(transition);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
DbxActionFormSafetyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFormSafetyDirective, deps: [{ token: DbxActionFormDirective, host: true }, { token: i2.ActionContextStoreSourceInstance }, { token: i3.TransitionService }, { token: i0.ViewContainerRef }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Directive });
|
|
231
|
+
DbxActionFormSafetyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionFormSafetyDirective, selector: "[dbxActionFormSafety]", inputs: { inputSafetyType: ["dbxActionFormSafety", "inputSafetyType"] }, usesInheritance: true, ngImport: i0 });
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFormSafetyDirective, decorators: [{
|
|
233
|
+
type: Directive,
|
|
234
|
+
args: [{
|
|
235
|
+
selector: '[dbxActionFormSafety]',
|
|
236
|
+
}]
|
|
237
|
+
}], ctorParameters: function () {
|
|
238
|
+
return [{ type: DbxActionFormDirective, decorators: [{
|
|
239
|
+
type: Host
|
|
240
|
+
}] }, { type: i2.ActionContextStoreSourceInstance }, { type: i3.TransitionService }, { type: i0.ViewContainerRef }, { type: i4.MatDialog }];
|
|
241
|
+
}, propDecorators: { inputSafetyType: [{
|
|
242
|
+
type: Input,
|
|
243
|
+
args: ['dbxActionFormSafety']
|
|
244
|
+
}] } });
|
|
245
|
+
|
|
246
|
+
class DbxFormActionTransitionModule {
|
|
247
|
+
}
|
|
248
|
+
DbxFormActionTransitionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionTransitionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
249
|
+
DbxFormActionTransitionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionTransitionModule, declarations: [DbxActionFormSafetyDirective], imports: [CommonModule], exports: [DbxActionFormSafetyDirective] });
|
|
250
|
+
DbxFormActionTransitionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionTransitionModule, imports: [[
|
|
251
|
+
CommonModule
|
|
252
|
+
]] });
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionTransitionModule, decorators: [{
|
|
254
|
+
type: NgModule,
|
|
255
|
+
args: [{
|
|
256
|
+
imports: [
|
|
257
|
+
CommonModule
|
|
258
|
+
],
|
|
259
|
+
declarations: [
|
|
260
|
+
DbxActionFormSafetyDirective
|
|
261
|
+
],
|
|
262
|
+
exports: [
|
|
263
|
+
DbxActionFormSafetyDirective
|
|
264
|
+
]
|
|
265
|
+
}]
|
|
266
|
+
}] });
|
|
267
|
+
|
|
268
|
+
class DbxFormActionModule {
|
|
199
269
|
}
|
|
200
|
-
|
|
201
|
-
|
|
270
|
+
DbxFormActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
271
|
+
DbxFormActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionModule, declarations: [DbxActionFormDirective], imports: [CommonModule,
|
|
202
272
|
MatDialogModule], exports: [DbxActionFormDirective] });
|
|
203
|
-
|
|
273
|
+
DbxFormActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionModule, imports: [[
|
|
204
274
|
CommonModule,
|
|
205
275
|
MatDialogModule
|
|
206
276
|
]] });
|
|
207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormActionModule, decorators: [{
|
|
208
278
|
type: NgModule,
|
|
209
279
|
args: [{
|
|
210
280
|
imports: [
|
|
@@ -223,7 +293,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
223
293
|
/**
|
|
224
294
|
* Used with a FormComponent to set the value from a LoadingState when the value is available.
|
|
225
295
|
*/
|
|
226
|
-
class
|
|
296
|
+
class DbxFormLoadingSourceDirective extends AbstractSubscriptionDirective {
|
|
227
297
|
constructor(form) {
|
|
228
298
|
super();
|
|
229
299
|
this.form = form;
|
|
@@ -251,20 +321,20 @@ class DbxFormLoadingPairSourceDirective extends AbstractSubscriptionDirective {
|
|
|
251
321
|
this.sub = subscription;
|
|
252
322
|
}
|
|
253
323
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
324
|
+
DbxFormLoadingSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLoadingSourceDirective, deps: [{ token: DbxMutableForm, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
325
|
+
DbxFormLoadingSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormLoadingSourceDirective, selector: "[dbxFormLoadingSource]", inputs: { obs: ["dbxFormLoadingSource", "obs"] }, usesInheritance: true, ngImport: i0 });
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLoadingSourceDirective, decorators: [{
|
|
257
327
|
type: Directive,
|
|
258
328
|
args: [{
|
|
259
|
-
selector: '[
|
|
329
|
+
selector: '[dbxFormLoadingSource]'
|
|
260
330
|
}]
|
|
261
331
|
}], ctorParameters: function () {
|
|
262
|
-
return [{ type:
|
|
332
|
+
return [{ type: DbxMutableForm, decorators: [{
|
|
263
333
|
type: Host
|
|
264
334
|
}] }];
|
|
265
335
|
}, propDecorators: { obs: [{
|
|
266
336
|
type: Input,
|
|
267
|
-
args: ['
|
|
337
|
+
args: ['dbxFormLoadingSource']
|
|
268
338
|
}] } });
|
|
269
339
|
|
|
270
340
|
/**
|
|
@@ -277,14 +347,14 @@ class DbxFormValueChangesDirective extends AbstractSubscriptionDirective {
|
|
|
277
347
|
this.dbxFormValueChange = new EventEmitter();
|
|
278
348
|
}
|
|
279
349
|
ngOnInit() {
|
|
280
|
-
this.sub = this.form.stream$.
|
|
281
|
-
this.dbxFormValueChange.next(
|
|
350
|
+
this.sub = this.form.stream$.pipe(filter$1(x => x.isComplete), mergeMap(() => this.form.getValue().pipe(first$1())), delay(0)).subscribe((value) => {
|
|
351
|
+
this.dbxFormValueChange.next(value);
|
|
282
352
|
});
|
|
283
353
|
}
|
|
284
354
|
}
|
|
285
|
-
DbxFormValueChangesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
286
|
-
DbxFormValueChangesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
355
|
+
DbxFormValueChangesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormValueChangesDirective, deps: [{ token: DbxForm, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
356
|
+
DbxFormValueChangesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormValueChangesDirective, selector: "[dbxFormValueChange]", outputs: { dbxFormValueChange: "dbxFormValueChange" }, usesInheritance: true, ngImport: i0 });
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormValueChangesDirective, decorators: [{
|
|
288
358
|
type: Directive,
|
|
289
359
|
args: [{
|
|
290
360
|
selector: '[dbxFormValueChange]'
|
|
@@ -325,15 +395,15 @@ class DbxFormSourceDirective extends AbstractSubscriptionDirective {
|
|
|
325
395
|
this.sub = subscription;
|
|
326
396
|
}
|
|
327
397
|
}
|
|
328
|
-
DbxFormSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
329
|
-
DbxFormSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
398
|
+
DbxFormSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSourceDirective, deps: [{ token: DbxMutableForm, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
399
|
+
DbxFormSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: { obs: ["dbxFormSource", "obs"] }, usesInheritance: true, ngImport: i0 });
|
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSourceDirective, decorators: [{
|
|
331
401
|
type: Directive,
|
|
332
402
|
args: [{
|
|
333
403
|
selector: '[dbxFormSource]'
|
|
334
404
|
}]
|
|
335
405
|
}], ctorParameters: function () {
|
|
336
|
-
return [{ type:
|
|
406
|
+
return [{ type: DbxMutableForm, decorators: [{
|
|
337
407
|
type: Host
|
|
338
408
|
}] }];
|
|
339
409
|
}, propDecorators: { obs: [{
|
|
@@ -341,18 +411,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
341
411
|
args: ['dbxFormSource']
|
|
342
412
|
}] } });
|
|
343
413
|
|
|
344
|
-
class
|
|
414
|
+
class DbxFormIoModule {
|
|
345
415
|
}
|
|
346
|
-
|
|
347
|
-
|
|
416
|
+
DbxFormIoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormIoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
417
|
+
DbxFormIoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormIoModule, declarations: [DbxFormSourceDirective,
|
|
348
418
|
DbxFormValueChangesDirective,
|
|
349
|
-
|
|
419
|
+
DbxFormLoadingSourceDirective], imports: [CommonModule], exports: [DbxFormSourceDirective,
|
|
350
420
|
DbxFormValueChangesDirective,
|
|
351
|
-
|
|
352
|
-
|
|
421
|
+
DbxFormLoadingSourceDirective] });
|
|
422
|
+
DbxFormIoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormIoModule, imports: [[
|
|
353
423
|
CommonModule
|
|
354
424
|
]] });
|
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormIoModule, decorators: [{
|
|
356
426
|
type: NgModule,
|
|
357
427
|
args: [{
|
|
358
428
|
imports: [
|
|
@@ -361,16 +431,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
361
431
|
declarations: [
|
|
362
432
|
DbxFormSourceDirective,
|
|
363
433
|
DbxFormValueChangesDirective,
|
|
364
|
-
|
|
434
|
+
DbxFormLoadingSourceDirective
|
|
365
435
|
],
|
|
366
436
|
exports: [
|
|
367
437
|
DbxFormSourceDirective,
|
|
368
438
|
DbxFormValueChangesDirective,
|
|
369
|
-
|
|
439
|
+
DbxFormLoadingSourceDirective
|
|
440
|
+
]
|
|
441
|
+
}]
|
|
442
|
+
}] });
|
|
443
|
+
|
|
444
|
+
class DbxFormModule {
|
|
445
|
+
}
|
|
446
|
+
DbxFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
447
|
+
DbxFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormModule, exports: [DbxFormActionTransitionModule,
|
|
448
|
+
DbxFormActionModule,
|
|
449
|
+
DbxFormIoModule] });
|
|
450
|
+
DbxFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormModule, imports: [DbxFormActionTransitionModule,
|
|
451
|
+
DbxFormActionModule,
|
|
452
|
+
DbxFormIoModule] });
|
|
453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormModule, decorators: [{
|
|
454
|
+
type: NgModule,
|
|
455
|
+
args: [{
|
|
456
|
+
exports: [
|
|
457
|
+
DbxFormActionTransitionModule,
|
|
458
|
+
DbxFormActionModule,
|
|
459
|
+
DbxFormIoModule
|
|
370
460
|
]
|
|
371
461
|
}]
|
|
372
462
|
}] });
|
|
373
463
|
|
|
464
|
+
function minLengthValidationMessage(err, field) {
|
|
465
|
+
return `Should have atleast ${field.templateOptions.minLength} characters`;
|
|
466
|
+
}
|
|
467
|
+
function maxLengthValidationMessage(err, field) {
|
|
468
|
+
return `This value should be less than ${field.templateOptions.maxLength} characters`;
|
|
469
|
+
}
|
|
470
|
+
function minValidationMessage(err, field) {
|
|
471
|
+
return `This value should be more than ${field.templateOptions.min}`;
|
|
472
|
+
}
|
|
473
|
+
function maxValidationMessage(err, field) {
|
|
474
|
+
return `This value should be less than ${field.templateOptions.max}`;
|
|
475
|
+
}
|
|
476
|
+
const REQUIRED_VALIDATION_MESSAGE = { name: 'required', message: 'This field is required' };
|
|
477
|
+
const MIN_LENGTH_VALIDATION_MESSAGE = { name: 'minlength', message: minLengthValidationMessage };
|
|
478
|
+
const MAX_LENGTH_VALIDATION_MESSAGE = { name: 'maxlength', message: maxLengthValidationMessage };
|
|
479
|
+
const MIN_VALIDATION_MESSAGE = { name: 'min', message: minValidationMessage };
|
|
480
|
+
const MAX_VALIDATION_MESSAGE = { name: 'max', message: maxValidationMessage };
|
|
481
|
+
const INVALID_PHONE_NUMBER_MESSAGE = { name: 'validatePhoneNumber', message: 'This is not a valid phone number.' };
|
|
482
|
+
function defaultValidationMessages() {
|
|
483
|
+
return [REQUIRED_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MAX_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, INVALID_PHONE_NUMBER_MESSAGE];
|
|
484
|
+
}
|
|
485
|
+
|
|
374
486
|
// MARK: Default
|
|
375
487
|
class DbxDefaultChecklistItemFieldDisplayComponent {
|
|
376
488
|
get label() {
|
|
@@ -386,15 +498,15 @@ class DbxDefaultChecklistItemFieldDisplayComponent {
|
|
|
386
498
|
return (_a = this.displayContent) === null || _a === void 0 ? void 0 : _a.description;
|
|
387
499
|
}
|
|
388
500
|
}
|
|
389
|
-
DbxDefaultChecklistItemFieldDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
390
|
-
DbxDefaultChecklistItemFieldDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
501
|
+
DbxDefaultChecklistItemFieldDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDefaultChecklistItemFieldDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
502
|
+
DbxDefaultChecklistItemFieldDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxDefaultChecklistItemFieldDisplayComponent, selector: "ng-component", inputs: { displayContent: "displayContent" }, ngImport: i0, template: `
|
|
391
503
|
<div *ngIf="displayContent" class="dbx-default-checklist-item-field">
|
|
392
504
|
<div *ngIf="label" class="item-label">{{ label }}</div>
|
|
393
505
|
<div *ngIf="sublabel" class="item-sublabel">{{ sublabel }}</div>
|
|
394
506
|
<div *ngIf="description" class="dbx-hint item-description">{{ description }}</div>
|
|
395
507
|
</div>
|
|
396
508
|
`, isInline: true, directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
397
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDefaultChecklistItemFieldDisplayComponent, decorators: [{
|
|
398
510
|
type: Component,
|
|
399
511
|
args: [{
|
|
400
512
|
template: `
|
|
@@ -420,7 +532,7 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
420
532
|
get formGroup() {
|
|
421
533
|
return this.form;
|
|
422
534
|
}
|
|
423
|
-
get
|
|
535
|
+
get formControlName() {
|
|
424
536
|
return this.key;
|
|
425
537
|
}
|
|
426
538
|
get label() {
|
|
@@ -435,94 +547,90 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
435
547
|
var _a;
|
|
436
548
|
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.required;
|
|
437
549
|
}
|
|
550
|
+
get checklistField() {
|
|
551
|
+
return this.field.checklistField;
|
|
552
|
+
}
|
|
438
553
|
get errors() {
|
|
439
554
|
var _a;
|
|
440
555
|
return (_a = this.field.formControl) === null || _a === void 0 ? void 0 : _a.errors;
|
|
441
556
|
}
|
|
442
557
|
get componentClass() {
|
|
443
558
|
var _a;
|
|
444
|
-
return (_a = this.
|
|
559
|
+
return (_a = this.checklistField.componentClass) !== null && _a !== void 0 ? _a : DbxDefaultChecklistItemFieldDisplayComponent;
|
|
445
560
|
}
|
|
446
561
|
ngOnInit() {
|
|
447
|
-
this._displayContent.next(this.
|
|
562
|
+
this._displayContent.next(this.checklistField.displayContentObs);
|
|
448
563
|
}
|
|
449
564
|
ngOnDestroy() {
|
|
450
565
|
this._displayContent.complete();
|
|
451
566
|
}
|
|
452
567
|
}
|
|
453
|
-
DbxChecklistItemFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
454
|
-
DbxChecklistItemFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
455
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
568
|
+
DbxChecklistItemFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxChecklistItemFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
569
|
+
DbxChecklistItemFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxChecklistItemFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-checklist-item-wrapper\" [formGroup]=\"formGroup\">\n <div *ngIf=\"label\" class=\"dbx-checklist-item-label\">{{ label }}</div>\n <div class=\"dbx-checklist-item\">\n <div class=\"dbx-checklist-item-check\">\n <mat-checkbox [formControlName]=\"formControlName\"></mat-checkbox>\n </div>\n <div class=\"dbx-checklist-item-content-wrapper\">\n <dbx-anchor [block]=\"true\" [anchor]=\"anchor$ | async\">\n <div class=\"dbx-checklist-item-content\" matRipple [matRippleDisabled]=\"(rippleDisabled$ | async) ?? false\">\n <dbx-checklist-item-content-component></dbx-checklist-item-content-component>\n <span class=\"spacer\"></span>\n <mat-icon *ngIf=\"!(rippleDisabled$ | async)\">navigate_next</mat-icon>\n </div>\n </dbx-anchor>\n </div>\n </div>\n <div *ngIf=\"description\" class=\"dbx-hint\">{{ description }}</div>\n</div>\n", components: [{ type: i0.forwardRef(function () { return i1.MatCheckbox; }), selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i0.forwardRef(function () { return i1$1.DbxAnchorComponent; }), selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { type: i0.forwardRef(function () { return DbxChecklistItemContentComponent; }), selector: "dbx-checklist-item-content-component" }, { type: i0.forwardRef(function () { return i2$1.MatIcon; }), selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i0.forwardRef(function () { return i4$1.NgControlStatusGroup; }), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i0.forwardRef(function () { return i4$1.FormGroupDirective; }), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i0.forwardRef(function () { return i5.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i4$1.NgControlStatus; }), selector: "[formControlName],[ngModel],[formControl]" }, { type: i0.forwardRef(function () { return i4$1.FormControlName; }), selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i0.forwardRef(function () { return i6.MatRipple; }), selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], pipes: { "async": i0.forwardRef(function () { return i5.AsyncPipe; }) } });
|
|
570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxChecklistItemFieldComponent, decorators: [{
|
|
456
571
|
type: Component,
|
|
457
|
-
args: [{ template: "<div class=\"dbx-checklist-item-wrapper\" [formGroup]=\"formGroup\">\n <div *ngIf=\"label\" class=\"dbx-checklist-item-label\">{{ label }}</div>\n <div class=\"dbx-checklist-item\">\n <div class=\"dbx-checklist-item-check\">\n <mat-checkbox [formControlName]=\"
|
|
572
|
+
args: [{ template: "<div class=\"dbx-checklist-item-wrapper\" [formGroup]=\"formGroup\">\n <div *ngIf=\"label\" class=\"dbx-checklist-item-label\">{{ label }}</div>\n <div class=\"dbx-checklist-item\">\n <div class=\"dbx-checklist-item-check\">\n <mat-checkbox [formControlName]=\"formControlName\"></mat-checkbox>\n </div>\n <div class=\"dbx-checklist-item-content-wrapper\">\n <dbx-anchor [block]=\"true\" [anchor]=\"anchor$ | async\">\n <div class=\"dbx-checklist-item-content\" matRipple [matRippleDisabled]=\"(rippleDisabled$ | async) ?? false\">\n <dbx-checklist-item-content-component></dbx-checklist-item-content-component>\n <span class=\"spacer\"></span>\n <mat-icon *ngIf=\"!(rippleDisabled$ | async)\">navigate_next</mat-icon>\n </div>\n </dbx-anchor>\n </div>\n </div>\n <div *ngIf=\"description\" class=\"dbx-hint\">{{ description }}</div>\n</div>\n" }]
|
|
458
573
|
}] });
|
|
459
574
|
class DbxChecklistItemContentComponent extends AbstractSubscriptionDirective {
|
|
460
|
-
constructor(checklistItemFieldComponent,
|
|
575
|
+
constructor(checklistItemFieldComponent, cdRef) {
|
|
461
576
|
super();
|
|
462
577
|
this.checklistItemFieldComponent = checklistItemFieldComponent;
|
|
463
|
-
this.
|
|
464
|
-
this.ngZone = ngZone;
|
|
465
|
-
this.displayContent$ = this.checklistItemFieldComponent.displayContent$;
|
|
466
|
-
this.isLoading$ = this.checklistItemFieldComponent.displayContent$;
|
|
578
|
+
this.cdRef = cdRef;
|
|
467
579
|
}
|
|
468
580
|
ngOnInit() {
|
|
469
|
-
this.
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
581
|
+
this.config = {
|
|
582
|
+
componentClass: this.checklistItemFieldComponent.componentClass,
|
|
583
|
+
init: (instance) => {
|
|
584
|
+
this.checklistItemFieldComponent.displayContent$.subscribe((x) => {
|
|
585
|
+
instance.displayContent = x;
|
|
586
|
+
safeDetectChanges(this.cdRef);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
};
|
|
475
590
|
}
|
|
476
591
|
}
|
|
477
|
-
DbxChecklistItemContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
478
|
-
DbxChecklistItemContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
479
|
-
|
|
480
|
-
`, isInline: true });
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: DbxChecklistItemContentComponent, decorators: [{
|
|
592
|
+
DbxChecklistItemContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxChecklistItemContentComponent, deps: [{ token: DbxChecklistItemFieldComponent }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
593
|
+
DbxChecklistItemContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxChecklistItemContentComponent, selector: "dbx-checklist-item-content-component", usesInheritance: true, ngImport: i0, template: `<dbx-injected-content [config]="config"></dbx-injected-content>`, isInline: true, components: [{ type: i2.DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: ["config", "template"] }] });
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxChecklistItemContentComponent, decorators: [{
|
|
482
595
|
type: Component,
|
|
483
596
|
args: [{
|
|
484
597
|
selector: 'dbx-checklist-item-content-component',
|
|
485
|
-
template:
|
|
486
|
-
<ng-template #content></ng-template>
|
|
487
|
-
`
|
|
598
|
+
template: `<dbx-injected-content [config]="config"></dbx-injected-content>`
|
|
488
599
|
}]
|
|
489
|
-
}], ctorParameters: function () { return [{ type: DbxChecklistItemFieldComponent }, { type: i0.
|
|
490
|
-
type: ViewChild,
|
|
491
|
-
args: ['content', { static: true, read: ViewContainerRef }]
|
|
492
|
-
}] } });
|
|
600
|
+
}], ctorParameters: function () { return [{ type: DbxChecklistItemFieldComponent }, { type: i0.ChangeDetectorRef }]; } });
|
|
493
601
|
|
|
494
|
-
class
|
|
495
|
-
get
|
|
496
|
-
return this.to.
|
|
602
|
+
class DbxFormInfoWrapperComponent extends FieldWrapper {
|
|
603
|
+
get infoWrapper() {
|
|
604
|
+
return this.to.infoWrapper;
|
|
497
605
|
}
|
|
498
606
|
onInfoClick() {
|
|
499
|
-
this.
|
|
607
|
+
this.infoWrapper.onInfoClick();
|
|
500
608
|
}
|
|
501
609
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
<div class="form-info-
|
|
505
|
-
<div class="form-info-
|
|
610
|
+
DbxFormInfoWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormInfoWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
611
|
+
DbxFormInfoWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormInfoWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
612
|
+
<div class="dbx-form-info-wrapper" fxLayout="row">
|
|
613
|
+
<div class="dbx-form-info-wrapper-content" fxFlex="grow">
|
|
506
614
|
<ng-container #fieldComponent></ng-container>
|
|
507
615
|
</div>
|
|
508
|
-
<div class="form-info-
|
|
509
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + to.label || 'section'"
|
|
616
|
+
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
617
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
510
618
|
(click)="onInfoClick()">
|
|
511
619
|
<mat-icon>info</mat-icon>
|
|
512
620
|
</button>
|
|
513
621
|
</div>
|
|
514
622
|
</div>
|
|
515
623
|
`, isInline: true, components: [{ type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
|
|
516
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormInfoWrapperComponent, decorators: [{
|
|
517
625
|
type: Component,
|
|
518
626
|
args: [{
|
|
519
627
|
template: `
|
|
520
|
-
<div class="form-info-
|
|
521
|
-
<div class="form-info-
|
|
628
|
+
<div class="dbx-form-info-wrapper" fxLayout="row">
|
|
629
|
+
<div class="dbx-form-info-wrapper-content" fxFlex="grow">
|
|
522
630
|
<ng-container #fieldComponent></ng-container>
|
|
523
631
|
</div>
|
|
524
|
-
<div class="form-info-
|
|
525
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + to.label || 'section'"
|
|
632
|
+
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
633
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
526
634
|
(click)="onInfoClick()">
|
|
527
635
|
<mat-icon>info</mat-icon>
|
|
528
636
|
</button>
|
|
@@ -532,93 +640,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
532
640
|
}]
|
|
533
641
|
}] });
|
|
534
642
|
|
|
535
|
-
class
|
|
536
|
-
get
|
|
537
|
-
|
|
643
|
+
class DbxFormSectionWrapperComponent extends FieldWrapper {
|
|
644
|
+
get header() {
|
|
645
|
+
var _a;
|
|
646
|
+
return (_a = this.to.sectionWrapper) === null || _a === void 0 ? void 0 : _a.header;
|
|
647
|
+
}
|
|
648
|
+
get hint() {
|
|
649
|
+
var _a;
|
|
650
|
+
return (_a = this.to.sectionWrapper) === null || _a === void 0 ? void 0 : _a.hint;
|
|
538
651
|
}
|
|
539
652
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
<
|
|
543
|
-
<
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
<dbx-hint *ngIf="description">{{ description }}</dbx-hint>
|
|
548
|
-
</div>
|
|
549
|
-
`, isInline: true, components: [{ type: i1$1.DbxHintComponent, selector: "dbx-hint" }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: FormSectionWrapperComponent, decorators: [{
|
|
653
|
+
DbxFormSectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
654
|
+
DbxFormSectionWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormSectionWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
655
|
+
<dbx-section [header]="header" [hint]="hint">
|
|
656
|
+
<ng-container #fieldComponent></ng-container>
|
|
657
|
+
</dbx-section>
|
|
658
|
+
`, isInline: true, components: [{ type: i1$1.DbxSectionComponent, selector: "dbx-section", inputs: ["elevated"] }] });
|
|
659
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSectionWrapperComponent, decorators: [{
|
|
551
660
|
type: Component,
|
|
552
661
|
args: [{
|
|
553
662
|
template: `
|
|
554
|
-
<
|
|
555
|
-
<
|
|
556
|
-
|
|
557
|
-
<ng-container #fieldComponent></ng-container>
|
|
558
|
-
</div>
|
|
559
|
-
<dbx-hint *ngIf="description">{{ description }}</dbx-hint>
|
|
560
|
-
</div>
|
|
663
|
+
<dbx-section [header]="header" [hint]="hint">
|
|
664
|
+
<ng-container #fieldComponent></ng-container>
|
|
665
|
+
</dbx-section>
|
|
561
666
|
`
|
|
562
667
|
}]
|
|
563
668
|
}] });
|
|
564
669
|
|
|
565
|
-
class
|
|
670
|
+
class DbxFormFlexWrapperComponent extends FieldWrapper {
|
|
671
|
+
get flexWrapper() {
|
|
672
|
+
return this.to.flexWrapper;
|
|
673
|
+
}
|
|
674
|
+
get breakpoint() {
|
|
675
|
+
var _a;
|
|
676
|
+
return (_a = this.flexWrapper) === null || _a === void 0 ? void 0 : _a.breakpoint;
|
|
677
|
+
}
|
|
678
|
+
get relative() {
|
|
679
|
+
var _a, _b;
|
|
680
|
+
return (_b = (_a = this.flexWrapper) === null || _a === void 0 ? void 0 : _a.relative) !== null && _b !== void 0 ? _b : false;
|
|
681
|
+
}
|
|
566
682
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
<div class="form-flex-section">
|
|
683
|
+
DbxFormFlexWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFlexWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
684
|
+
DbxFormFlexWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormFlexWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
685
|
+
<div class="dbx-form-flex-section" dbxFlexGroup [content]="false" [relative]="relative" [breakpoint]="breakpoint">
|
|
570
686
|
<ng-container #fieldComponent></ng-container>
|
|
571
687
|
</div>
|
|
572
|
-
`, isInline: true });
|
|
573
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
688
|
+
`, isInline: true, directives: [{ type: i1$1.DbxFlexGroupDirective, selector: "[dbxFlexGroup]", inputs: ["content", "relative", "breakpoint"] }] });
|
|
689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFlexWrapperComponent, decorators: [{
|
|
574
690
|
type: Component,
|
|
575
691
|
args: [{
|
|
576
692
|
template: `
|
|
577
|
-
<div class="form-flex-section">
|
|
693
|
+
<div class="dbx-form-flex-section" dbxFlexGroup [content]="false" [relative]="relative" [breakpoint]="breakpoint">
|
|
578
694
|
<ng-container #fieldComponent></ng-container>
|
|
579
695
|
</div>
|
|
580
696
|
`
|
|
581
697
|
}]
|
|
582
698
|
}] });
|
|
583
699
|
|
|
584
|
-
class
|
|
585
|
-
get
|
|
586
|
-
|
|
700
|
+
class DbxFormSubsectionWrapperComponent extends FieldWrapper {
|
|
701
|
+
get header() {
|
|
702
|
+
var _a;
|
|
703
|
+
return (_a = this.to.subsectionWrapper) === null || _a === void 0 ? void 0 : _a.header;
|
|
704
|
+
}
|
|
705
|
+
get hint() {
|
|
706
|
+
var _a;
|
|
707
|
+
return (_a = this.to.subsectionWrapper) === null || _a === void 0 ? void 0 : _a.hint;
|
|
587
708
|
}
|
|
588
709
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
<dbx-hint *ngIf="description"><small>{{ description }}</small></dbx-hint>
|
|
597
|
-
</div>
|
|
598
|
-
`, isInline: true, components: [{ type: i1$1.DbxHintComponent, selector: "dbx-hint" }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: FormSubsectionWrapperComponent, decorators: [{
|
|
710
|
+
DbxFormSubsectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSubsectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
711
|
+
DbxFormSubsectionWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormSubsectionWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
712
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
713
|
+
<ng-container #fieldComponent></ng-container>
|
|
714
|
+
</dbx-subsection>
|
|
715
|
+
`, isInline: true, components: [{ type: i1$1.DbxSubSectionComponent, selector: "dbx-subsection" }] });
|
|
716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSubsectionWrapperComponent, decorators: [{
|
|
600
717
|
type: Component,
|
|
601
718
|
args: [{
|
|
602
719
|
template: `
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
<ng-container #fieldComponent></ng-container>
|
|
607
|
-
</div>
|
|
608
|
-
<dbx-hint *ngIf="description"><small>{{ description }}</small></dbx-hint>
|
|
609
|
-
</div>
|
|
720
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
721
|
+
<ng-container #fieldComponent></ng-container>
|
|
722
|
+
</dbx-subsection>
|
|
610
723
|
`
|
|
611
724
|
}]
|
|
612
725
|
}] });
|
|
613
726
|
|
|
614
|
-
const DEFAULT_HAS_VALUE_FN =
|
|
727
|
+
const DEFAULT_HAS_VALUE_FN = (x) => !objectIsEmpty(x);
|
|
615
728
|
class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
616
729
|
constructor() {
|
|
617
730
|
super(...arguments);
|
|
618
731
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
619
732
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
620
733
|
this._toggleOpen = new BehaviorSubject(undefined);
|
|
621
|
-
this.show$ = this._toggleOpen.pipe(
|
|
734
|
+
this.show$ = this._toggleOpen.pipe(switchMap$1((toggleOpen) => {
|
|
622
735
|
if (toggleOpen != null) {
|
|
623
736
|
return of(toggleOpen);
|
|
624
737
|
}
|
|
@@ -631,15 +744,22 @@ class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
|
631
744
|
}), shareReplay$1(1))));
|
|
632
745
|
}
|
|
633
746
|
get expandableSection() {
|
|
634
|
-
return this.to.
|
|
747
|
+
return this.to.expandWrapper;
|
|
635
748
|
}
|
|
636
749
|
get hasValueFn() {
|
|
637
750
|
var _a, _b;
|
|
638
751
|
return (_b = (_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.hasValueFn) !== null && _b !== void 0 ? _b : DEFAULT_HAS_VALUE_FN;
|
|
639
752
|
}
|
|
640
753
|
get expandLabel() {
|
|
641
|
-
var _a, _b, _c, _d, _e, _f;
|
|
642
|
-
|
|
754
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
755
|
+
let label = (_b = (_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.expandLabel) !== null && _b !== void 0 ? _b : (_d = (_c = this.field) === null || _c === void 0 ? void 0 : _c.templateOptions) === null || _d === void 0 ? void 0 : _d.label;
|
|
756
|
+
if (label == null) {
|
|
757
|
+
const firstFieldGroup = (_e = this.field.fieldGroup) === null || _e === void 0 ? void 0 : _e[0];
|
|
758
|
+
if (firstFieldGroup) {
|
|
759
|
+
label = (_g = (_f = firstFieldGroup.templateOptions) === null || _f === void 0 ? void 0 : _f.label) !== null && _g !== void 0 ? _g : firstFieldGroup.key;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
return label;
|
|
643
763
|
}
|
|
644
764
|
open() {
|
|
645
765
|
this._toggleOpen.next(true);
|
|
@@ -652,28 +772,33 @@ class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
|
652
772
|
this._formControlObs.complete();
|
|
653
773
|
}
|
|
654
774
|
}
|
|
655
|
-
AbstractFormExpandableSectionWrapperDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
656
|
-
AbstractFormExpandableSectionWrapperDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
775
|
+
AbstractFormExpandableSectionWrapperDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFormExpandableSectionWrapperDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
776
|
+
AbstractFormExpandableSectionWrapperDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFormExpandableSectionWrapperDirective, usesInheritance: true, ngImport: i0 });
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFormExpandableSectionWrapperDirective, decorators: [{
|
|
658
778
|
type: Directive
|
|
659
779
|
}] });
|
|
780
|
+
|
|
660
781
|
/**
|
|
661
782
|
* Section that is expandable by a button until a value is set, or the button is pressed.
|
|
662
783
|
*/
|
|
663
|
-
class
|
|
784
|
+
class DbxFormExpandWrapperComponent extends AbstractFormExpandableSectionWrapperDirective {
|
|
785
|
+
get buttonType() {
|
|
786
|
+
var _a, _b;
|
|
787
|
+
return (_b = (_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.buttonType) !== null && _b !== void 0 ? _b : 'button';
|
|
788
|
+
}
|
|
664
789
|
}
|
|
665
|
-
|
|
666
|
-
|
|
790
|
+
DbxFormExpandWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExpandWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
791
|
+
DbxFormExpandWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormExpandWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
667
792
|
<ng-container [ngSwitch]="show$ | async">
|
|
668
793
|
<ng-container *ngSwitchCase="true">
|
|
669
794
|
<ng-container #fieldComponent></ng-container>
|
|
670
795
|
</ng-container>
|
|
671
796
|
<ng-container *ngSwitchCase="false">
|
|
672
|
-
<span class="form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
797
|
+
<span class="dbx-form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
673
798
|
</ng-container>
|
|
674
799
|
</ng-container>
|
|
675
800
|
`, isInline: true, directives: [{ type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i5.AsyncPipe } });
|
|
676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExpandWrapperComponent, decorators: [{
|
|
677
802
|
type: Component,
|
|
678
803
|
args: [{
|
|
679
804
|
template: `
|
|
@@ -682,7 +807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
682
807
|
<ng-container #fieldComponent></ng-container>
|
|
683
808
|
</ng-container>
|
|
684
809
|
<ng-container *ngSwitchCase="false">
|
|
685
|
-
<span class="form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
810
|
+
<span class="dbx-form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
686
811
|
</ng-container>
|
|
687
812
|
</ng-container>
|
|
688
813
|
`
|
|
@@ -694,7 +819,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
694
819
|
*/
|
|
695
820
|
class AutoTouchFieldWrapperComponent extends FieldWrapper {
|
|
696
821
|
ngOnInit() {
|
|
697
|
-
this.formControl.valueChanges.pipe(delay(200)).subscribe(() => {
|
|
822
|
+
this.formControl.valueChanges.pipe(delay$1(200)).subscribe(() => {
|
|
698
823
|
if (!this.formControl.pristine && this.formControl.untouched) {
|
|
699
824
|
this.formControl.markAsTouched();
|
|
700
825
|
this.formControl.updateValueAndValidity();
|
|
@@ -702,9 +827,9 @@ class AutoTouchFieldWrapperComponent extends FieldWrapper {
|
|
|
702
827
|
});
|
|
703
828
|
}
|
|
704
829
|
}
|
|
705
|
-
AutoTouchFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
706
|
-
AutoTouchFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
707
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
830
|
+
AutoTouchFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AutoTouchFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
831
|
+
AutoTouchFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: AutoTouchFieldWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<ng-container #fieldComponent></ng-container>`, isInline: true });
|
|
832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AutoTouchFieldWrapperComponent, decorators: [{
|
|
708
833
|
type: Component,
|
|
709
834
|
args: [{
|
|
710
835
|
template: `<ng-container #fieldComponent></ng-container>`
|
|
@@ -714,46 +839,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
714
839
|
/**
|
|
715
840
|
* Section that is expandable by a button until a value is set, or the button is pressed.
|
|
716
841
|
*/
|
|
717
|
-
class
|
|
842
|
+
class DbxFormToggleWrapperComponent extends AbstractFormExpandableSectionWrapperDirective {
|
|
718
843
|
constructor() {
|
|
719
844
|
super(...arguments);
|
|
720
|
-
this
|
|
845
|
+
this.slideLabel$ = this._toggleOpen.pipe(switchMap$1(x => {
|
|
721
846
|
var _a, _b;
|
|
722
|
-
if ((_a = this.
|
|
723
|
-
return (_b = this.
|
|
847
|
+
if ((_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.toggleLabelObs) {
|
|
848
|
+
return (_b = this.expandableSection) === null || _b === void 0 ? void 0 : _b.toggleLabelObs(x);
|
|
724
849
|
}
|
|
725
850
|
else {
|
|
726
851
|
return of(this.expandLabel);
|
|
727
852
|
}
|
|
728
|
-
}), shareReplay(1));
|
|
729
|
-
}
|
|
730
|
-
get toggleSection() {
|
|
731
|
-
return this.to.toggleSection;
|
|
853
|
+
}), shareReplay$1(1));
|
|
732
854
|
}
|
|
733
855
|
onToggleChange() {
|
|
734
|
-
this.show$.pipe(first()).subscribe((show) => {
|
|
856
|
+
this.show$.pipe(first$1()).subscribe((show) => {
|
|
735
857
|
this._toggleOpen.next(!show);
|
|
736
858
|
});
|
|
737
859
|
}
|
|
738
860
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
<div class="form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
742
|
-
<div class="form-toggle-wrapper-toggle">
|
|
743
|
-
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ $
|
|
861
|
+
DbxFormToggleWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormToggleWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
862
|
+
DbxFormToggleWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormToggleWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
863
|
+
<div class="dbx-form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
864
|
+
<div class="dbx-form-toggle-wrapper-toggle">
|
|
865
|
+
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ slideLabel$ | async }}</mat-slide-toggle>
|
|
744
866
|
</div>
|
|
745
867
|
<ng-container *ngSwitchCase="true">
|
|
746
868
|
<ng-container #fieldComponent></ng-container>
|
|
747
869
|
</ng-container>
|
|
748
870
|
</div>
|
|
749
871
|
`, isInline: true, components: [{ type: i1$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i5.AsyncPipe } });
|
|
750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormToggleWrapperComponent, decorators: [{
|
|
751
873
|
type: Component,
|
|
752
874
|
args: [{
|
|
753
875
|
template: `
|
|
754
|
-
<div class="form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
755
|
-
<div class="form-toggle-wrapper-toggle">
|
|
756
|
-
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ $
|
|
876
|
+
<div class="dbx-form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
877
|
+
<div class="dbx-form-toggle-wrapper-toggle">
|
|
878
|
+
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ slideLabel$ | async }}</mat-slide-toggle>
|
|
757
879
|
</div>
|
|
758
880
|
<ng-container *ngSwitchCase="true">
|
|
759
881
|
<ng-container #fieldComponent></ng-container>
|
|
@@ -763,23 +885,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
763
885
|
}]
|
|
764
886
|
}] });
|
|
765
887
|
|
|
888
|
+
class DbxFormStyleWrapperComponent extends FieldWrapper {
|
|
889
|
+
constructor() {
|
|
890
|
+
super(...arguments);
|
|
891
|
+
this._style = new BehaviorSubject(undefined);
|
|
892
|
+
this.style$ = this._style.pipe(switchMapMaybeDefault(''), shareReplay$1(1));
|
|
893
|
+
}
|
|
894
|
+
get styleWrapper() {
|
|
895
|
+
return this.field.styleWrapper;
|
|
896
|
+
}
|
|
897
|
+
get styleGetter() {
|
|
898
|
+
return this.styleWrapper.style;
|
|
899
|
+
}
|
|
900
|
+
ngOnInit() {
|
|
901
|
+
this._style.next(asObservable(this.styleGetter));
|
|
902
|
+
}
|
|
903
|
+
ngOnDestroy() {
|
|
904
|
+
this._style.complete();
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
DbxFormStyleWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormStyleWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
908
|
+
DbxFormStyleWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormStyleWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
909
|
+
<div [ngClass]="(style$ | async) ?? ''">
|
|
910
|
+
<ng-container #fieldComponent></ng-container>
|
|
911
|
+
</div>
|
|
912
|
+
`, isInline: true, directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], pipes: { "async": i5.AsyncPipe } });
|
|
913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormStyleWrapperComponent, decorators: [{
|
|
914
|
+
type: Component,
|
|
915
|
+
args: [{
|
|
916
|
+
template: `
|
|
917
|
+
<div [ngClass]="(style$ | async) ?? ''">
|
|
918
|
+
<ng-container #fieldComponent></ng-container>
|
|
919
|
+
</div>
|
|
920
|
+
`
|
|
921
|
+
}]
|
|
922
|
+
}] });
|
|
923
|
+
|
|
766
924
|
class DbxFormFormlyWrapperModule {
|
|
767
925
|
}
|
|
768
|
-
DbxFormFormlyWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
769
|
-
DbxFormFormlyWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
926
|
+
DbxFormFormlyWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyWrapperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
927
|
+
DbxFormFormlyWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyWrapperModule, declarations: [AutoTouchFieldWrapperComponent,
|
|
928
|
+
DbxFormSectionWrapperComponent,
|
|
929
|
+
DbxFormSubsectionWrapperComponent,
|
|
930
|
+
DbxFormInfoWrapperComponent,
|
|
931
|
+
DbxFormExpandWrapperComponent,
|
|
932
|
+
DbxFormToggleWrapperComponent,
|
|
933
|
+
DbxFormFlexWrapperComponent,
|
|
934
|
+
DbxFormStyleWrapperComponent], imports: [CommonModule,
|
|
775
935
|
DbxTextModule,
|
|
936
|
+
DbxFlexLayoutModule,
|
|
937
|
+
DbxSectionLayoutModule,
|
|
776
938
|
MatButtonModule,
|
|
777
939
|
MatSlideToggleModule,
|
|
778
940
|
MatIconModule,
|
|
779
941
|
FlexLayoutModule, i1$4.FormlyModule] });
|
|
780
|
-
DbxFormFormlyWrapperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
942
|
+
DbxFormFormlyWrapperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyWrapperModule, imports: [[
|
|
781
943
|
CommonModule,
|
|
782
944
|
DbxTextModule,
|
|
945
|
+
DbxFlexLayoutModule,
|
|
946
|
+
DbxSectionLayoutModule,
|
|
783
947
|
MatButtonModule,
|
|
784
948
|
MatSlideToggleModule,
|
|
785
949
|
MatIconModule,
|
|
@@ -787,21 +951,24 @@ DbxFormFormlyWrapperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
787
951
|
FormlyModule.forChild({
|
|
788
952
|
wrappers: [
|
|
789
953
|
{ name: 'autotouch', component: AutoTouchFieldWrapperComponent },
|
|
790
|
-
{ name: 'expandable', component:
|
|
791
|
-
{ name: 'toggle', component:
|
|
792
|
-
{ name: 'section', component:
|
|
793
|
-
{ name: 'subsection', component:
|
|
794
|
-
{ name: 'info', component:
|
|
795
|
-
{ name: 'flex', component:
|
|
954
|
+
{ name: 'expandable', component: DbxFormExpandWrapperComponent },
|
|
955
|
+
{ name: 'toggle', component: DbxFormToggleWrapperComponent },
|
|
956
|
+
{ name: 'section', component: DbxFormSectionWrapperComponent },
|
|
957
|
+
{ name: 'subsection', component: DbxFormSubsectionWrapperComponent },
|
|
958
|
+
{ name: 'info', component: DbxFormInfoWrapperComponent },
|
|
959
|
+
{ name: 'flex', component: DbxFormFlexWrapperComponent },
|
|
960
|
+
{ name: 'style', component: DbxFormStyleWrapperComponent }
|
|
796
961
|
]
|
|
797
962
|
})
|
|
798
963
|
]] });
|
|
799
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyWrapperModule, decorators: [{
|
|
800
965
|
type: NgModule,
|
|
801
966
|
args: [{
|
|
802
967
|
imports: [
|
|
803
968
|
CommonModule,
|
|
804
969
|
DbxTextModule,
|
|
970
|
+
DbxFlexLayoutModule,
|
|
971
|
+
DbxSectionLayoutModule,
|
|
805
972
|
MatButtonModule,
|
|
806
973
|
MatSlideToggleModule,
|
|
807
974
|
MatIconModule,
|
|
@@ -809,22 +976,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
809
976
|
FormlyModule.forChild({
|
|
810
977
|
wrappers: [
|
|
811
978
|
{ name: 'autotouch', component: AutoTouchFieldWrapperComponent },
|
|
812
|
-
{ name: 'expandable', component:
|
|
813
|
-
{ name: 'toggle', component:
|
|
814
|
-
{ name: 'section', component:
|
|
815
|
-
{ name: 'subsection', component:
|
|
816
|
-
{ name: 'info', component:
|
|
817
|
-
{ name: 'flex', component:
|
|
979
|
+
{ name: 'expandable', component: DbxFormExpandWrapperComponent },
|
|
980
|
+
{ name: 'toggle', component: DbxFormToggleWrapperComponent },
|
|
981
|
+
{ name: 'section', component: DbxFormSectionWrapperComponent },
|
|
982
|
+
{ name: 'subsection', component: DbxFormSubsectionWrapperComponent },
|
|
983
|
+
{ name: 'info', component: DbxFormInfoWrapperComponent },
|
|
984
|
+
{ name: 'flex', component: DbxFormFlexWrapperComponent },
|
|
985
|
+
{ name: 'style', component: DbxFormStyleWrapperComponent }
|
|
818
986
|
]
|
|
819
987
|
})
|
|
820
988
|
],
|
|
821
989
|
declarations: [
|
|
822
990
|
AutoTouchFieldWrapperComponent,
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
991
|
+
DbxFormSectionWrapperComponent,
|
|
992
|
+
DbxFormSubsectionWrapperComponent,
|
|
993
|
+
DbxFormInfoWrapperComponent,
|
|
994
|
+
DbxFormExpandWrapperComponent,
|
|
995
|
+
DbxFormToggleWrapperComponent,
|
|
996
|
+
DbxFormFlexWrapperComponent,
|
|
997
|
+
DbxFormStyleWrapperComponent
|
|
828
998
|
],
|
|
829
999
|
exports: []
|
|
830
1000
|
}]
|
|
@@ -832,8 +1002,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
832
1002
|
|
|
833
1003
|
class DbxFormFormlyChecklistItemFieldModule {
|
|
834
1004
|
}
|
|
835
|
-
DbxFormFormlyChecklistItemFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
836
|
-
DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
1005
|
+
DbxFormFormlyChecklistItemFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1006
|
+
DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, declarations: [DbxChecklistItemFieldComponent,
|
|
837
1007
|
DbxChecklistItemContentComponent,
|
|
838
1008
|
DbxDefaultChecklistItemFieldDisplayComponent], imports: [CommonModule,
|
|
839
1009
|
DbxTextModule,
|
|
@@ -846,7 +1016,7 @@ DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVers
|
|
|
846
1016
|
DbxAnchorModule,
|
|
847
1017
|
DbxInjectedComponentModule,
|
|
848
1018
|
DbxFormFormlyWrapperModule, i1$4.FormlyModule], exports: [DbxFormFormlyWrapperModule] });
|
|
849
|
-
DbxFormFormlyChecklistItemFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
1019
|
+
DbxFormFormlyChecklistItemFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, imports: [[
|
|
850
1020
|
CommonModule,
|
|
851
1021
|
DbxTextModule,
|
|
852
1022
|
FormsModule,
|
|
@@ -864,7 +1034,7 @@ DbxFormFormlyChecklistItemFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVers
|
|
|
864
1034
|
]
|
|
865
1035
|
})
|
|
866
1036
|
], DbxFormFormlyWrapperModule] });
|
|
867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1037
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, decorators: [{
|
|
868
1038
|
type: NgModule,
|
|
869
1039
|
args: [{
|
|
870
1040
|
imports: [
|
|
@@ -906,10 +1076,36 @@ function formlyField(fieldConfig) {
|
|
|
906
1076
|
}
|
|
907
1077
|
return fieldConfig;
|
|
908
1078
|
}
|
|
1079
|
+
function templateOptionsForFieldConfig(fieldConfig, override) {
|
|
1080
|
+
const templateOptions = templateOptionsValueForFieldConfig(fieldConfig, override);
|
|
1081
|
+
return {
|
|
1082
|
+
templateOptions
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
function templateOptionsValueForFieldConfig(fieldConfig, override) {
|
|
1086
|
+
const { label, placeholder, required, readonly, description, autocomplete } = mergeObjects([fieldConfig, override], { keysFilter: ['label', 'placeholder', 'required', 'readonly', 'description', 'autocomplete'] });
|
|
1087
|
+
const attributes = mergeObjects([fieldConfig.attributes, override === null || override === void 0 ? void 0 : override.attributes]);
|
|
1088
|
+
const result = filterFromPOJO(Object.assign(Object.assign({}, override), { label,
|
|
1089
|
+
placeholder,
|
|
1090
|
+
required,
|
|
1091
|
+
readonly,
|
|
1092
|
+
description,
|
|
1093
|
+
attributes }));
|
|
1094
|
+
// Apply autocomplete
|
|
1095
|
+
if (autocomplete != null) {
|
|
1096
|
+
if (autocomplete === false) {
|
|
1097
|
+
result.attributes = Object.assign(Object.assign({}, result.attributes), disableFormlyFieldAutofillAttributes());
|
|
1098
|
+
}
|
|
1099
|
+
else {
|
|
1100
|
+
result.attributes['autocomplete'] = autocomplete;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
return result;
|
|
1104
|
+
}
|
|
909
1105
|
/**
|
|
910
1106
|
* Returns configuration for a formlyField that will disable autofill/autocomplete for a field.
|
|
911
1107
|
*/
|
|
912
|
-
function
|
|
1108
|
+
function disableFormlyFieldAutofillAttributes() {
|
|
913
1109
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
914
1110
|
return {
|
|
915
1111
|
name: 'password',
|
|
@@ -917,20 +1113,15 @@ function disableFormlyFieldAutofill() {
|
|
|
917
1113
|
};
|
|
918
1114
|
}
|
|
919
1115
|
|
|
920
|
-
function checklistItemField(
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
placeholder,
|
|
927
|
-
required
|
|
928
|
-
},
|
|
929
|
-
displayContentObs,
|
|
930
|
-
componentClass
|
|
931
|
-
});
|
|
1116
|
+
function checklistItemField(config) {
|
|
1117
|
+
const { key, displayContentObs, componentClass } = config;
|
|
1118
|
+
const fieldConfig = formlyField(Object.assign({ key, type: 'checklistitem', checklistField: {
|
|
1119
|
+
displayContentObs,
|
|
1120
|
+
componentClass
|
|
1121
|
+
} }, templateOptionsForFieldConfig(config)));
|
|
932
1122
|
return fieldConfig;
|
|
933
1123
|
}
|
|
1124
|
+
|
|
934
1125
|
/**
|
|
935
1126
|
* Used for building a set of configurations for a data-type object that has as second object that is used as a checklist.
|
|
936
1127
|
*/
|
|
@@ -1013,40 +1204,40 @@ class ChecklistItemFieldDataSetBuilder {
|
|
|
1013
1204
|
class AbstractFormComponentFieldWrappedComponent {
|
|
1014
1205
|
}
|
|
1015
1206
|
class FormComponentFieldComponent extends FieldType {
|
|
1016
|
-
constructor() {
|
|
1017
|
-
super();
|
|
1018
|
-
}
|
|
1019
1207
|
get config() {
|
|
1020
1208
|
return this._config;
|
|
1021
1209
|
}
|
|
1210
|
+
get componentField() {
|
|
1211
|
+
return this.field.componentField;
|
|
1212
|
+
}
|
|
1022
1213
|
ngOnInit() {
|
|
1023
1214
|
this._config = {
|
|
1024
|
-
componentClass: this.
|
|
1215
|
+
componentClass: this.componentField.componentClass,
|
|
1025
1216
|
init: (instance) => {
|
|
1026
1217
|
instance.field = this;
|
|
1027
1218
|
}
|
|
1028
1219
|
};
|
|
1029
1220
|
}
|
|
1030
1221
|
}
|
|
1031
|
-
FormComponentFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1032
|
-
FormComponentFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
1222
|
+
FormComponentFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: FormComponentFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1223
|
+
FormComponentFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: FormComponentFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1033
1224
|
<div class="form-wrapped-component" dbx-injected-content [config]="config"></div>
|
|
1034
1225
|
`, isInline: true, components: [{ type: i2.DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: ["config", "template"] }] });
|
|
1035
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: FormComponentFieldComponent, decorators: [{
|
|
1036
1227
|
type: Component,
|
|
1037
1228
|
args: [{
|
|
1038
1229
|
template: `
|
|
1039
1230
|
<div class="form-wrapped-component" dbx-injected-content [config]="config"></div>
|
|
1040
1231
|
`
|
|
1041
1232
|
}]
|
|
1042
|
-
}]
|
|
1233
|
+
}] });
|
|
1043
1234
|
|
|
1044
1235
|
class DbxFormFormlyComponentFieldModule {
|
|
1045
1236
|
}
|
|
1046
|
-
DbxFormFormlyComponentFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1047
|
-
DbxFormFormlyComponentFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
1237
|
+
DbxFormFormlyComponentFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyComponentFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1238
|
+
DbxFormFormlyComponentFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyComponentFieldModule, declarations: [FormComponentFieldComponent], imports: [CommonModule,
|
|
1048
1239
|
DbxInjectedComponentModule, i1$4.FormlyModule], exports: [FormComponentFieldComponent] });
|
|
1049
|
-
DbxFormFormlyComponentFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
1240
|
+
DbxFormFormlyComponentFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyComponentFieldModule, imports: [[
|
|
1050
1241
|
CommonModule,
|
|
1051
1242
|
DbxInjectedComponentModule,
|
|
1052
1243
|
FormlyModule.forChild({
|
|
@@ -1055,7 +1246,7 @@ DbxFormFormlyComponentFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion:
|
|
|
1055
1246
|
]
|
|
1056
1247
|
})
|
|
1057
1248
|
]] });
|
|
1058
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyComponentFieldModule, decorators: [{
|
|
1059
1250
|
type: NgModule,
|
|
1060
1251
|
args: [{
|
|
1061
1252
|
imports: [
|
|
@@ -1079,33 +1270,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1079
1270
|
function componentField({ componentClass }) {
|
|
1080
1271
|
return {
|
|
1081
1272
|
type: 'component',
|
|
1082
|
-
|
|
1273
|
+
componentField: {
|
|
1274
|
+
componentClass
|
|
1275
|
+
}
|
|
1083
1276
|
};
|
|
1084
1277
|
}
|
|
1085
1278
|
|
|
1086
1279
|
/**
|
|
1087
1280
|
* Used for picking pre-set values using items as the presentation.
|
|
1088
1281
|
*/
|
|
1089
|
-
class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
1282
|
+
class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
1090
1283
|
constructor() {
|
|
1091
1284
|
super(...arguments);
|
|
1092
1285
|
this.inputCtrl = new FormControl('');
|
|
1093
1286
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
1094
1287
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
1095
1288
|
this._displayHashMap = new BehaviorSubject(new Map());
|
|
1096
|
-
this.filterInputValue$ = this.inputCtrl.valueChanges.pipe(startWith
|
|
1097
|
-
this.filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged(), shareReplay(1));
|
|
1098
|
-
this.loadResultsDisplayValuesState$ = this.formControl$.pipe(first(), switchMap(() => this.loadValuesFn().pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)), startWith
|
|
1099
|
-
this._formControlValue = this.formControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith
|
|
1100
|
-
this.loadResultsDisplayValues$ = this.loadResultsDisplayValuesState$.pipe(map(x => { var _a; return (_a = x === null || x === void 0 ? void 0 : x.value) !== null && _a !== void 0 ? _a : []; }));
|
|
1289
|
+
this.filterInputValue$ = this.inputCtrl.valueChanges.pipe(startWith(undefined));
|
|
1290
|
+
this.filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged$1(), shareReplay$1(1));
|
|
1291
|
+
this.loadResultsDisplayValuesState$ = this.formControl$.pipe(first$1(), switchMap$1(() => this.loadValuesFn().pipe(switchMap$1((x) => this.loadDisplayValuesForFieldValues(x)), startWith(beginLoading()))), shareReplay$1(1));
|
|
1292
|
+
this._formControlValue = this.formControl$.pipe(switchMap$1(control => control.valueChanges.pipe(startWith(control.value), shareReplay$1(1))));
|
|
1293
|
+
this.loadResultsDisplayValues$ = this.loadResultsDisplayValuesState$.pipe(map$1(x => { var _a; return (_a = x === null || x === void 0 ? void 0 : x.value) !== null && _a !== void 0 ? _a : []; }));
|
|
1101
1294
|
/**
|
|
1102
1295
|
* Current values in the form control.
|
|
1103
1296
|
*/
|
|
1104
|
-
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay(1));
|
|
1297
|
+
this.values$ = this._formControlValue.pipe(map$1(convertMaybeToArray), shareReplay$1(1));
|
|
1105
1298
|
/**
|
|
1106
1299
|
* Current values with their display value.
|
|
1107
1300
|
*/
|
|
1108
|
-
this.displayValuesState$ = combineLatest([this.loadResultsDisplayValues$, this.values$]).pipe(switchMap(([displayValues, currentValues]) => {
|
|
1301
|
+
this.displayValuesState$ = combineLatest([this.loadResultsDisplayValues$, this.values$]).pipe(switchMap$1(([displayValues, currentValues]) => {
|
|
1109
1302
|
const displayValuesMap = makeValuesGroupMap(displayValues, (x) => this.hashForValue(x.value));
|
|
1110
1303
|
const valuesNotInDisplayMap = [];
|
|
1111
1304
|
currentValues.forEach((x) => {
|
|
@@ -1117,7 +1310,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1117
1310
|
}
|
|
1118
1311
|
});
|
|
1119
1312
|
if (valuesNotInDisplayMap.length) {
|
|
1120
|
-
return this.loadDisplayValuesForValues(valuesNotInDisplayMap).pipe(map(x => mapLoadingStateResults(x, {
|
|
1313
|
+
return this.loadDisplayValuesForValues(valuesNotInDisplayMap).pipe(map$1(x => mapLoadingStateResults(x, {
|
|
1121
1314
|
mapValue: (loadedValues) => {
|
|
1122
1315
|
loadedValues.forEach(x => { var _a; return x.isUnknown = (_a = x.isUnknown) !== null && _a !== void 0 ? _a : true; }); // Assign unknown flag.
|
|
1123
1316
|
return ([...displayValues, ...loadedValues]);
|
|
@@ -1131,79 +1324,86 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1131
1324
|
/**
|
|
1132
1325
|
* Results to be displayed if filtered.
|
|
1133
1326
|
*/
|
|
1134
|
-
this.filteredSearchResultsState$ = this.loadResultsDisplayValues$.pipe(switchMap((values) => this.filterInputValueString$.pipe(switchMap(text => combineLatest([this._filterValues(text, values), this.displayValuesState$]).pipe(map(([values, displayState]) => mapLoadingStateResults(displayState, {
|
|
1327
|
+
this.filteredSearchResultsState$ = this.loadResultsDisplayValues$.pipe(switchMap$1((values) => this.filterInputValueString$.pipe(switchMap$1(text => combineLatest([this._filterValues(text, values), this.displayValuesState$]).pipe(map$1(([values, displayState]) => mapLoadingStateResults(displayState, {
|
|
1135
1328
|
mapValue: (displayValues) => {
|
|
1136
1329
|
const valueHashSet = new Set(values.map(x => this.hashForValue(x)));
|
|
1137
1330
|
return displayValues.filter(x => !x.isUnknown && valueHashSet.has(x._hash));
|
|
1138
1331
|
}
|
|
1139
|
-
})))))), shareReplay(1));
|
|
1140
|
-
this.filteredSearchResults$ = this.filteredSearchResultsState$.pipe(map(x => x === null || x === void 0 ? void 0 : x.value), filterMaybe(), shareReplay(1));
|
|
1141
|
-
this.items$ = combineLatest([this.filteredSearchResults$, this.values$]).pipe(map(([displayValues, values]) => {
|
|
1332
|
+
})), startWith(beginLoading()))))), shareReplay$1(1));
|
|
1333
|
+
this.filteredSearchResults$ = this.filteredSearchResultsState$.pipe(map$1(x => x === null || x === void 0 ? void 0 : x.value), filterMaybe(), shareReplay$1(1));
|
|
1334
|
+
this.items$ = combineLatest([this.filteredSearchResults$, this.values$]).pipe(map$1(([displayValues, values]) => {
|
|
1142
1335
|
const selectedHashValuesSet = new Set(values.map(x => this.hashForValue(x)));
|
|
1143
|
-
let items = displayValues.map((x) => ({
|
|
1336
|
+
let items = displayValues.map((x) => ({ value: x, selected: selectedHashValuesSet.has(x._hash) }));
|
|
1144
1337
|
if (this.sortItems) {
|
|
1145
1338
|
items = this.sortItems(items);
|
|
1146
1339
|
}
|
|
1147
1340
|
return items;
|
|
1148
|
-
}), shareReplay(1));
|
|
1149
|
-
this.itemsLoadingState$ = this.loadResultsDisplayValues$.pipe(switchMap(x => this.items$.pipe(first(), map(x => successResult(x)), startWith
|
|
1341
|
+
}), shareReplay$1(1));
|
|
1342
|
+
this.itemsLoadingState$ = this.loadResultsDisplayValues$.pipe(switchMap$1(x => this.items$.pipe(first$1(), map$1(x => successResult(x)), startWith(beginLoading()), shareReplay$1(1))));
|
|
1150
1343
|
/**
|
|
1151
1344
|
* Context used for managing the loading of items, or when the current results change.
|
|
1152
1345
|
*/
|
|
1153
|
-
this.context = new
|
|
1154
|
-
this.filterItemsLoadingState$ = this.items$.pipe(map(x => successResult(x)), startWith
|
|
1346
|
+
this.context = new ListLoadingStateContextInstance({ obs: this.itemsLoadingState$, showLoadingOnNoValue: false });
|
|
1347
|
+
this.filterItemsLoadingState$ = this.items$.pipe(map$1(x => successResult(x)), startWith(beginLoading()), shareReplay$1(1));
|
|
1155
1348
|
/**
|
|
1156
1349
|
* Context used for searching/filtering.
|
|
1157
1350
|
*/
|
|
1158
|
-
this.filterResultsContext = new
|
|
1351
|
+
this.filterResultsContext = new ListLoadingStateContextInstance({ obs: this.filteredSearchResultsState$, showLoadingOnNoValue: true });
|
|
1352
|
+
this.noItemsAvailable$ = this.filterItemsLoadingState$.pipe(isListLoadingStateEmpty(), distinctUntilChanged$1());
|
|
1159
1353
|
}
|
|
1160
|
-
get
|
|
1354
|
+
get readonly() {
|
|
1161
1355
|
var _a;
|
|
1162
|
-
return (_a = this.field.
|
|
1356
|
+
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.readonly;
|
|
1163
1357
|
}
|
|
1164
|
-
get
|
|
1165
|
-
|
|
1166
|
-
return (_a = this.field.asArrayValue) !== null && _a !== void 0 ? _a : true;
|
|
1358
|
+
get isReadonlyOrDisabled() {
|
|
1359
|
+
return this.readonly || this.disabled;
|
|
1167
1360
|
}
|
|
1168
|
-
get
|
|
1169
|
-
return this.field.
|
|
1361
|
+
get pickableField() {
|
|
1362
|
+
return this.field.pickableField;
|
|
1170
1363
|
}
|
|
1171
|
-
get
|
|
1364
|
+
get multiSelect() {
|
|
1172
1365
|
var _a;
|
|
1173
|
-
return (_a = this.
|
|
1366
|
+
return (_a = this.pickableField.multiSelect) !== null && _a !== void 0 ? _a : true;
|
|
1174
1367
|
}
|
|
1175
|
-
get
|
|
1368
|
+
get asArrayValue() {
|
|
1176
1369
|
var _a;
|
|
1177
|
-
return (_a = this.
|
|
1370
|
+
return (_a = this.pickableField.asArrayValue) !== null && _a !== void 0 ? _a : true;
|
|
1371
|
+
}
|
|
1372
|
+
get filterLabel() {
|
|
1373
|
+
return this.pickableField.filterLabel;
|
|
1178
1374
|
}
|
|
1179
|
-
get
|
|
1375
|
+
get name() {
|
|
1180
1376
|
var _a, _b;
|
|
1181
|
-
return (
|
|
1377
|
+
return (_a = this.field.name) !== null && _a !== void 0 ? _a : (camelCase((_b = this.label) !== null && _b !== void 0 ? _b : this.key));
|
|
1182
1378
|
}
|
|
1183
|
-
get
|
|
1379
|
+
get label() {
|
|
1184
1380
|
var _a;
|
|
1185
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.
|
|
1381
|
+
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.label;
|
|
1382
|
+
}
|
|
1383
|
+
get autocomplete() {
|
|
1384
|
+
var _a, _b, _c;
|
|
1385
|
+
return (_c = (_b = (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b['autocomplete']) !== null && _c !== void 0 ? _c : this.key;
|
|
1186
1386
|
}
|
|
1187
1387
|
get sortItems() {
|
|
1188
|
-
return this.
|
|
1388
|
+
return this.pickableField.sortItems;
|
|
1189
1389
|
}
|
|
1190
1390
|
get hashForValue() {
|
|
1191
1391
|
var _a;
|
|
1192
|
-
return (_a = this.
|
|
1392
|
+
return (_a = this.pickableField.hashForValue) !== null && _a !== void 0 ? _a : ((x) => x);
|
|
1193
1393
|
}
|
|
1194
1394
|
get displayForValue() {
|
|
1195
|
-
return this.
|
|
1395
|
+
return this.pickableField.displayForValue;
|
|
1196
1396
|
}
|
|
1197
1397
|
get showFilterInput() {
|
|
1198
|
-
return Boolean(this.
|
|
1398
|
+
return Boolean(this.pickableField.filterValues);
|
|
1199
1399
|
}
|
|
1200
1400
|
get filterValuesFn() {
|
|
1201
1401
|
var _a;
|
|
1202
|
-
return (_a = this.
|
|
1402
|
+
return (_a = this.pickableField.filterValues) !== null && _a !== void 0 ? _a : ((_, x) => of(x.map(y => y.value)));
|
|
1203
1403
|
}
|
|
1204
1404
|
get skipFilterFnOnEmpty() {
|
|
1205
1405
|
var _a;
|
|
1206
|
-
return (_a = this.
|
|
1406
|
+
return (_a = this.pickableField.skipFilterFnOnEmpty) !== null && _a !== void 0 ? _a : true;
|
|
1207
1407
|
}
|
|
1208
1408
|
get _filterValues() {
|
|
1209
1409
|
let fn;
|
|
@@ -1226,26 +1426,26 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1226
1426
|
}
|
|
1227
1427
|
get showTextFilter() {
|
|
1228
1428
|
var _a;
|
|
1229
|
-
return (_a = this.
|
|
1429
|
+
return (_a = this.pickableField.showTextFilter) !== null && _a !== void 0 ? _a : Boolean(this.pickableField.filterValues);
|
|
1230
1430
|
}
|
|
1231
1431
|
get loadValuesFn() {
|
|
1232
|
-
return this.
|
|
1432
|
+
return this.pickableField.loadValues;
|
|
1233
1433
|
}
|
|
1234
1434
|
get values() {
|
|
1235
1435
|
var _a;
|
|
1236
1436
|
return (_a = this._getValueOnFormControl(this.formControl.value)) !== null && _a !== void 0 ? _a : [];
|
|
1237
1437
|
}
|
|
1238
1438
|
get footerConfig() {
|
|
1239
|
-
return this.
|
|
1439
|
+
return this.pickableField.footerConfig;
|
|
1240
1440
|
}
|
|
1241
1441
|
loadDisplayValuesForValues(values) {
|
|
1242
1442
|
return this.loadDisplayValuesForFieldValues(values.map((value) => ({ value })));
|
|
1243
1443
|
}
|
|
1244
1444
|
loadDisplayValuesForFieldValues(values) {
|
|
1245
|
-
return this.getDisplayValuesForFieldValues(values).pipe(map((displayValues) => (
|
|
1445
|
+
return this.getDisplayValuesForFieldValues(values).pipe(map$1((displayValues) => successResult(displayValues)), startWith(beginLoading()), shareReplay$1(1));
|
|
1246
1446
|
}
|
|
1247
1447
|
getDisplayValuesForFieldValues(values) {
|
|
1248
|
-
return this._displayHashMap.pipe(mergeMap
|
|
1448
|
+
return this._displayHashMap.pipe(mergeMap((displayMap) => {
|
|
1249
1449
|
const mappingResult = values
|
|
1250
1450
|
.map(x => [x, this.hashForValue(x.value)])
|
|
1251
1451
|
.map(([x, hash], i) => [i, hash, x, displayMap.get(hash)]);
|
|
@@ -1254,7 +1454,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1254
1454
|
if (needsDisplay.length > 0) {
|
|
1255
1455
|
// Go get the display value.
|
|
1256
1456
|
const displayValuesObs = this.displayForValue(needsDisplay.map(x => x[2]));
|
|
1257
|
-
return displayValuesObs.pipe(first(), map((displayResults) => {
|
|
1457
|
+
return displayValuesObs.pipe(first$1(), map$1((displayResults) => {
|
|
1258
1458
|
const displayResultsWithHash = displayResults.map((x) => {
|
|
1259
1459
|
x._hash = this.hashForValue(x.value);
|
|
1260
1460
|
return x;
|
|
@@ -1277,14 +1477,16 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1277
1477
|
}));
|
|
1278
1478
|
}
|
|
1279
1479
|
ngOnInit() {
|
|
1480
|
+
super.ngOnInit();
|
|
1280
1481
|
this._formControlObs.next(this.formControl);
|
|
1281
1482
|
// Focus after finished loading for the first time.
|
|
1282
|
-
this.context.loading$.pipe(delay(10), filter(x => x), first()).subscribe(() => {
|
|
1483
|
+
this.context.loading$.pipe(delay(10), filter$1(x => x), first$1()).subscribe(() => {
|
|
1283
1484
|
var _a;
|
|
1284
1485
|
(_a = this.filterMatInput) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1285
1486
|
});
|
|
1286
1487
|
}
|
|
1287
1488
|
ngOnDestroy() {
|
|
1489
|
+
super.ngOnDestroy();
|
|
1288
1490
|
this._displayHashMap.complete();
|
|
1289
1491
|
this._formControlObs.complete();
|
|
1290
1492
|
this.filterResultsContext.destroy();
|
|
@@ -1322,9 +1524,9 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
1322
1524
|
this.formControl.markAsDirty();
|
|
1323
1525
|
}
|
|
1324
1526
|
}
|
|
1325
|
-
AbstractDbxPickableItemFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1326
|
-
AbstractDbxPickableItemFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
1327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1527
|
+
AbstractDbxPickableItemFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxPickableItemFieldDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1528
|
+
AbstractDbxPickableItemFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxPickableItemFieldDirective, viewQueries: [{ propertyName: "filterMatInput", first: true, predicate: ["filterMatInput"], descendants: true, static: true }], usesInheritance: true, ngImport: i0 });
|
|
1529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxPickableItemFieldDirective, decorators: [{
|
|
1328
1530
|
type: Directive
|
|
1329
1531
|
}], propDecorators: { filterMatInput: [{
|
|
1330
1532
|
type: ViewChild,
|
|
@@ -1334,48 +1536,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1334
1536
|
/**
|
|
1335
1537
|
* Used for picking pre-set values using chips as the presentation.
|
|
1336
1538
|
*/
|
|
1337
|
-
class
|
|
1539
|
+
class DbxPickableChipListFieldComponent extends AbstractDbxPickableItemFieldDirective {
|
|
1338
1540
|
itemClicked(item) {
|
|
1339
|
-
if (item.
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1541
|
+
if (!item.disabled && !this.isReadonlyOrDisabled) {
|
|
1542
|
+
if (item.selected) {
|
|
1543
|
+
this.removeValue(item.value.value);
|
|
1544
|
+
}
|
|
1545
|
+
else {
|
|
1546
|
+
this.addValue(item.value.value);
|
|
1547
|
+
}
|
|
1344
1548
|
}
|
|
1345
1549
|
}
|
|
1346
1550
|
}
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1551
|
+
DbxPickableChipListFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableChipListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1552
|
+
DbxPickableChipListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPickableChipListFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-pickable-item-field\">\n <dbx-loading [context]=\"context\" [linear]=\"true\">\n <ng-container *ngIf=\"showFilterInput\">\n <ng-container *ngTemplateOutlet=\"filterTemplate\"></ng-container>\n </ng-container>\n <!-- Content -->\n <div class=\"dbx-pickable-item-field-chips\">\n <mat-chip-list [required]=\"required\" [selectable]=\"!isReadonlyOrDisabled\" #chipList>\n <mat-chip *ngFor=\"let item of items$ | async\" (click)=\"itemClicked(item)\" [selected]=\"item.selected\"\n [disabled]=\"isReadonlyOrDisabled || item.disabled\">\n <span class=\"dbx-chip-label\">{{ item.value.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"item.value.sublabel\">{{ item.value.sublabel }}</span>\n </mat-chip>\n </mat-chip-list>\n <dbx-injected-content [config]=\"footerConfig\"></dbx-injected-content>\n </div>\n </dbx-loading>\n</div>\n\n<!-- Filter Input -->\n<ng-template #filterTemplate>\n <div class=\"dbx-pickable-item-field-filter\">\n <div class=\"dbx-label\">{{ filterLabel }}</div>\n <input [name]=\"name\" autocomplete=\"{{ autocomplete }}\" #filterMatInput=\"matInput\" matInput\n [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\">\n <mat-divider></mat-divider>\n <dbx-loading [linear]=\"true\" [context]=\"filterResultsContext\"></dbx-loading>\n <!-- No items found. -->\n <p *ngIf=\"noItemsAvailable$ | async\" class=\"dbx-label\">No items match this filter.</p>\n </div>\n</ng-template>\n", components: [{ type: i1$1.DbxLoadingComponent, selector: "dbx-loading", inputs: ["show", "text", "mode", "color", "diameter", "linear", "context", "loading", "error"] }, { type: i1$5.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2.DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: ["config", "template"] }, { type: i4$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$5.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i6$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i5.AsyncPipe } });
|
|
1553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableChipListFieldComponent, decorators: [{
|
|
1350
1554
|
type: Component,
|
|
1351
|
-
args: [{ template: "<div class=\"dbx-pickable-item-field\">\n <dbx-loading [context]=\"context\">\n <ng-container *ngIf=\"showFilterInput\">\n <ng-container *ngTemplateOutlet=\"filterTemplate\"></ng-container>\n </ng-container>\n <div class=\"dbx-pickable-item-field-chips\">\n
|
|
1555
|
+
args: [{ template: "<div class=\"dbx-pickable-item-field\">\n <dbx-loading [context]=\"context\" [linear]=\"true\">\n <ng-container *ngIf=\"showFilterInput\">\n <ng-container *ngTemplateOutlet=\"filterTemplate\"></ng-container>\n </ng-container>\n <!-- Content -->\n <div class=\"dbx-pickable-item-field-chips\">\n <mat-chip-list [required]=\"required\" [selectable]=\"!isReadonlyOrDisabled\" #chipList>\n <mat-chip *ngFor=\"let item of items$ | async\" (click)=\"itemClicked(item)\" [selected]=\"item.selected\"\n [disabled]=\"isReadonlyOrDisabled || item.disabled\">\n <span class=\"dbx-chip-label\">{{ item.value.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"item.value.sublabel\">{{ item.value.sublabel }}</span>\n </mat-chip>\n </mat-chip-list>\n <dbx-injected-content [config]=\"footerConfig\"></dbx-injected-content>\n </div>\n </dbx-loading>\n</div>\n\n<!-- Filter Input -->\n<ng-template #filterTemplate>\n <div class=\"dbx-pickable-item-field-filter\">\n <div class=\"dbx-label\">{{ filterLabel }}</div>\n <input [name]=\"name\" autocomplete=\"{{ autocomplete }}\" #filterMatInput=\"matInput\" matInput\n [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\">\n <mat-divider></mat-divider>\n <dbx-loading [linear]=\"true\" [context]=\"filterResultsContext\"></dbx-loading>\n <!-- No items found. -->\n <p *ngIf=\"noItemsAvailable$ | async\" class=\"dbx-label\">No items match this filter.</p>\n </div>\n</ng-template>\n" }]
|
|
1352
1556
|
}] });
|
|
1353
1557
|
|
|
1354
1558
|
/**
|
|
1355
1559
|
* Used for picking pre-set values using a selection list as the presentation.
|
|
1356
1560
|
*/
|
|
1357
1561
|
class DbxPickableListFieldComponent extends AbstractDbxPickableItemFieldDirective {
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
|
|
1562
|
+
onSelectionChange(event) {
|
|
1563
|
+
const items = event.items;
|
|
1564
|
+
const values = items.map(x => x.value.value);
|
|
1565
|
+
this.setValues(values);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
DbxPickableListFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1569
|
+
DbxPickableListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPickableListFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-pickable-item-field\">\n <dbx-loading [context]=\"context\">\n <ng-container *ngIf=\"showFilterInput\">\n <ng-container *ngTemplateOutlet=\"filterTemplate\"></ng-container>\n </ng-container>\n <!-- Content -->\n <div class=\"dbx-pickable-item-field-list\">\n <div class=\"dbx-pickable-item-field-list-content\">\n <dbx-form-pickable-item-field-item-list [disabled]=\"isReadonlyOrDisabled\" [state$]=\"filterItemsLoadingState$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </dbx-form-pickable-item-field-item-list>\n </div>\n <dbx-injected-content [config]=\"footerConfig\"></dbx-injected-content>\n </div>\n </dbx-loading>\n</div>\n\n<!-- Filter Input -->\n<ng-template #filterTemplate>\n <div class=\"dbx-pickable-item-field-filter\">\n <div class=\"dbx-label\">{{ filterLabel }}</div>\n <input [name]=\"name\" autocomplete=\"{{ autocomplete }}\" #filterMatInput=\"matInput\" matInput\n [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\">\n <mat-divider></mat-divider>\n <dbx-loading [linear]=\"true\" [context]=\"filterResultsContext\"></dbx-loading>\n <!-- No items found. -->\n <p *ngIf=\"noItemsAvailable$ | async\" class=\"dbx-label\">No items match this filter.</p>\n </div>\n</ng-template>\n", components: [{ type: i0.forwardRef(function () { return i1$1.DbxLoadingComponent; }), selector: "dbx-loading", inputs: ["show", "text", "mode", "color", "diameter", "linear", "context", "loading", "error"] }, { type: i0.forwardRef(function () { return DbxPickableListFieldItemListComponent; }), selector: "dbx-form-pickable-item-field-item-list" }, { type: i0.forwardRef(function () { return i2.DbxInjectedComponent; }), selector: "dbx-injected-content, [dbx-injected-content]", inputs: ["config", "template"] }, { type: i0.forwardRef(function () { return i4$2.MatDivider; }), selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i0.forwardRef(function () { return i5.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i5.NgTemplateOutlet; }), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i0.forwardRef(function () { return i6$1.MatInput; }), selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i0.forwardRef(function () { return i4$1.DefaultValueAccessor; }), selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i0.forwardRef(function () { return i4$1.NgControlStatus; }), selector: "[formControlName],[ngModel],[formControl]" }, { type: i0.forwardRef(function () { return i4$1.FormControlDirective; }), selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i0.forwardRef(function () { return i5.AsyncPipe; }) } });
|
|
1570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldComponent, decorators: [{
|
|
1571
|
+
type: Component,
|
|
1572
|
+
args: [{ template: "<div class=\"dbx-pickable-item-field\">\n <dbx-loading [context]=\"context\">\n <ng-container *ngIf=\"showFilterInput\">\n <ng-container *ngTemplateOutlet=\"filterTemplate\"></ng-container>\n </ng-container>\n <!-- Content -->\n <div class=\"dbx-pickable-item-field-list\">\n <div class=\"dbx-pickable-item-field-list-content\">\n <dbx-form-pickable-item-field-item-list [disabled]=\"isReadonlyOrDisabled\" [state$]=\"filterItemsLoadingState$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </dbx-form-pickable-item-field-item-list>\n </div>\n <dbx-injected-content [config]=\"footerConfig\"></dbx-injected-content>\n </div>\n </dbx-loading>\n</div>\n\n<!-- Filter Input -->\n<ng-template #filterTemplate>\n <div class=\"dbx-pickable-item-field-filter\">\n <div class=\"dbx-label\">{{ filterLabel }}</div>\n <input [name]=\"name\" autocomplete=\"{{ autocomplete }}\" #filterMatInput=\"matInput\" matInput\n [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\">\n <mat-divider></mat-divider>\n <dbx-loading [linear]=\"true\" [context]=\"filterResultsContext\"></dbx-loading>\n <!-- No items found. -->\n <p *ngIf=\"noItemsAvailable$ | async\" class=\"dbx-label\">No items match this filter.</p>\n </div>\n</ng-template>\n" }]
|
|
1573
|
+
}] });
|
|
1574
|
+
// MARK: Selection List
|
|
1575
|
+
class DbxPickableListFieldItemListComponent extends AbstractDbxSelectionListWrapperDirective {
|
|
1576
|
+
constructor() {
|
|
1577
|
+
super({
|
|
1578
|
+
componentClass: DbxPickableListFieldItemListViewComponent
|
|
1363
1579
|
});
|
|
1364
|
-
this.setValues(items.map(x => x.item.display.value));
|
|
1365
1580
|
}
|
|
1366
1581
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1582
|
+
DbxPickableListFieldItemListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1583
|
+
DbxPickableListFieldItemListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPickableListFieldItemListComponent, selector: "dbx-form-pickable-item-field-item-list", usesInheritance: true, ngImport: i0, template: "\n<dbx-list [state$]=\"state$\" [config]=\"config$ | async\" [disabled]=\"disabled\">\n <ng-content top select=\"[top]\"></ng-content>\n <ng-content bottom select=\"[bottom]\"></ng-content>\n <ng-content empty select=\"[empty]\"></ng-content>\n</dbx-list>\n", isInline: true, components: [{ type: i1$1.DbxListComponent, selector: "dbx-list", inputs: ["padded", "state$", "config", "disabled"], outputs: ["contentScrolled"] }], pipes: { "async": i5.AsyncPipe } });
|
|
1584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListComponent, decorators: [{
|
|
1585
|
+
type: Component,
|
|
1586
|
+
args: [{
|
|
1587
|
+
selector: 'dbx-form-pickable-item-field-item-list',
|
|
1588
|
+
template: DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE
|
|
1589
|
+
}]
|
|
1590
|
+
}], ctorParameters: function () { return []; } });
|
|
1591
|
+
/**
|
|
1592
|
+
* NOTE: Values input are PickableItemFieldItem<T>, but output values are PickableValueFieldDisplayValue<T>.
|
|
1593
|
+
*/
|
|
1594
|
+
class DbxPickableListFieldItemListViewComponent extends AbstractSelectionValueListViewDirective {
|
|
1595
|
+
constructor(dbxPickableListFieldComponent) {
|
|
1596
|
+
super();
|
|
1597
|
+
this.dbxPickableListFieldComponent = dbxPickableListFieldComponent;
|
|
1598
|
+
this.config = {
|
|
1599
|
+
componentClass: DbxPickableListFieldItemListViewItemComponent
|
|
1600
|
+
};
|
|
1601
|
+
this.items$ = this.values$.pipe(
|
|
1602
|
+
// NOTE: This causes the "value" to be a PickableValueFieldDisplayValue<T>, which means we emit PickableValueFieldDisplayValue<T> to DbxPickableListFieldComponent.
|
|
1603
|
+
map$1(x => mapItemValuesToValueListItemConfig(this.config, x)), shareReplay$1(1));
|
|
1604
|
+
}
|
|
1605
|
+
get multiple() {
|
|
1606
|
+
return this.dbxPickableListFieldComponent.multiSelect;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
DbxPickableListFieldItemListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListViewComponent, deps: [{ token: DbxPickableListFieldComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1610
|
+
DbxPickableListFieldItemListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPickableListFieldItemListViewComponent, selector: "ng-component", providers: ProvideDbxListView(DbxPickableListFieldItemListViewComponent), usesInheritance: true, ngImport: i0, template: `<dbx-selection-list-view-content [multiple]="multiple" [items]="items$ | async"></dbx-selection-list-view-content>`, isInline: true, components: [{ type: i1$1.DbxSelectionValueListItemViewComponent, selector: "dbx-selection-list-view-content", inputs: ["multiple", "items"] }], pipes: { "async": i5.AsyncPipe } });
|
|
1611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListViewComponent, decorators: [{
|
|
1612
|
+
type: Component,
|
|
1613
|
+
args: [{
|
|
1614
|
+
template: `<dbx-selection-list-view-content [multiple]="multiple" [items]="items$ | async"></dbx-selection-list-view-content>`,
|
|
1615
|
+
providers: ProvideDbxListView(DbxPickableListFieldItemListViewComponent)
|
|
1616
|
+
}]
|
|
1617
|
+
}], ctorParameters: function () { return [{ type: DbxPickableListFieldComponent }]; } });
|
|
1618
|
+
class DbxPickableListFieldItemListViewItemComponent extends AbstractDbxSelectionValueListViewItemComponent {
|
|
1619
|
+
get label() {
|
|
1620
|
+
return this.value.label;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
DbxPickableListFieldItemListViewItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListViewItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1624
|
+
DbxPickableListFieldItemListViewItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPickableListFieldItemListViewItemComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1625
|
+
<p>{{ label }}</p>
|
|
1626
|
+
`, isInline: true });
|
|
1627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPickableListFieldItemListViewItemComponent, decorators: [{
|
|
1370
1628
|
type: Component,
|
|
1371
|
-
args: [{
|
|
1629
|
+
args: [{
|
|
1630
|
+
template: `
|
|
1631
|
+
<p>{{ label }}</p>
|
|
1632
|
+
`
|
|
1633
|
+
}]
|
|
1372
1634
|
}] });
|
|
1373
1635
|
|
|
1374
1636
|
class DbxFormFormlyPickableFieldModule {
|
|
1375
1637
|
}
|
|
1376
|
-
DbxFormFormlyPickableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1377
|
-
DbxFormFormlyPickableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
1378
|
-
DbxPickableListFieldComponent
|
|
1638
|
+
DbxFormFormlyPickableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPickableFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1639
|
+
DbxFormFormlyPickableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPickableFieldModule, declarations: [DbxPickableChipListFieldComponent,
|
|
1640
|
+
DbxPickableListFieldComponent,
|
|
1641
|
+
DbxPickableListFieldItemListComponent,
|
|
1642
|
+
DbxPickableListFieldItemListViewComponent,
|
|
1643
|
+
DbxPickableListFieldItemListViewItemComponent], imports: [CommonModule,
|
|
1379
1644
|
DbxTextModule,
|
|
1380
1645
|
DbxLoadingModule,
|
|
1381
1646
|
DbxButtonModule,
|
|
@@ -1390,8 +1655,9 @@ DbxFormFormlyPickableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion:
|
|
|
1390
1655
|
DbxAnchorModule,
|
|
1391
1656
|
MatChipsModule,
|
|
1392
1657
|
MatIconModule,
|
|
1393
|
-
DbxInjectedComponentModule,
|
|
1394
|
-
|
|
1658
|
+
DbxInjectedComponentModule,
|
|
1659
|
+
DbxListLayoutModule, i1$4.FormlyModule] });
|
|
1660
|
+
DbxFormFormlyPickableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPickableFieldModule, imports: [[
|
|
1395
1661
|
CommonModule,
|
|
1396
1662
|
DbxTextModule,
|
|
1397
1663
|
DbxLoadingModule,
|
|
@@ -1408,14 +1674,15 @@ DbxFormFormlyPickableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion:
|
|
|
1408
1674
|
MatChipsModule,
|
|
1409
1675
|
MatIconModule,
|
|
1410
1676
|
DbxInjectedComponentModule,
|
|
1677
|
+
DbxListLayoutModule,
|
|
1411
1678
|
FormlyModule.forChild({
|
|
1412
1679
|
types: [
|
|
1413
|
-
{ name: 'pickablechipfield', component:
|
|
1414
|
-
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent },
|
|
1680
|
+
{ name: 'pickablechipfield', component: DbxPickableChipListFieldComponent, wrappers: ['form-field'] },
|
|
1681
|
+
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] },
|
|
1415
1682
|
]
|
|
1416
1683
|
})
|
|
1417
1684
|
]] });
|
|
1418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPickableFieldModule, decorators: [{
|
|
1419
1686
|
type: NgModule,
|
|
1420
1687
|
args: [{
|
|
1421
1688
|
imports: [
|
|
@@ -1435,99 +1702,139 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1435
1702
|
MatChipsModule,
|
|
1436
1703
|
MatIconModule,
|
|
1437
1704
|
DbxInjectedComponentModule,
|
|
1705
|
+
DbxListLayoutModule,
|
|
1438
1706
|
FormlyModule.forChild({
|
|
1439
1707
|
types: [
|
|
1440
|
-
{ name: 'pickablechipfield', component:
|
|
1441
|
-
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent },
|
|
1708
|
+
{ name: 'pickablechipfield', component: DbxPickableChipListFieldComponent, wrappers: ['form-field'] },
|
|
1709
|
+
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] },
|
|
1442
1710
|
]
|
|
1443
1711
|
})
|
|
1444
1712
|
],
|
|
1445
1713
|
declarations: [
|
|
1446
|
-
|
|
1447
|
-
DbxPickableListFieldComponent
|
|
1714
|
+
DbxPickableChipListFieldComponent,
|
|
1715
|
+
DbxPickableListFieldComponent,
|
|
1716
|
+
DbxPickableListFieldItemListComponent,
|
|
1717
|
+
DbxPickableListFieldItemListViewComponent,
|
|
1718
|
+
DbxPickableListFieldItemListViewItemComponent
|
|
1448
1719
|
],
|
|
1449
1720
|
exports: []
|
|
1450
1721
|
}]
|
|
1451
1722
|
}] });
|
|
1452
1723
|
|
|
1724
|
+
function filterPickableItemFieldValuesByLabel(filterText, values) {
|
|
1725
|
+
let filteredValues;
|
|
1726
|
+
if (filterText) {
|
|
1727
|
+
const searchString = filterText.toLocaleLowerCase();
|
|
1728
|
+
filteredValues = values.filter(x => x.label.toLocaleLowerCase().indexOf(searchString) !== -1);
|
|
1729
|
+
}
|
|
1730
|
+
else {
|
|
1731
|
+
filteredValues = values;
|
|
1732
|
+
}
|
|
1733
|
+
return of(filteredValues.map(x => x.value));
|
|
1734
|
+
}
|
|
1735
|
+
function sortPickableItemsByLabel(chips) {
|
|
1736
|
+
return chips.sort((a, b) => a.value.label.localeCompare(b.value.label));
|
|
1737
|
+
}
|
|
1738
|
+
function pickableItemChipField(config) {
|
|
1739
|
+
const { key } = config;
|
|
1740
|
+
return formlyField(Object.assign(Object.assign({ key, type: 'pickablechipfield' }, templateOptionsForFieldConfig(config, {
|
|
1741
|
+
autocomplete: false
|
|
1742
|
+
})), { pickableField: config }));
|
|
1743
|
+
}
|
|
1744
|
+
function pickableItemListField(config) {
|
|
1745
|
+
const { key } = config;
|
|
1746
|
+
return formlyField(Object.assign(Object.assign({ key, type: 'pickablelistfield' }, templateOptionsForFieldConfig(config, {
|
|
1747
|
+
autocomplete: false
|
|
1748
|
+
})), { pickableField: config }));
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
const DBX_SEARCHABLE_FIELD_COMPONENT_DATA = new InjectionToken('DbxSearchableField');
|
|
1453
1752
|
class DbxSearchableFieldAutocompleteItemComponent {
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
this.
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1753
|
+
constructor() {
|
|
1754
|
+
this._displayValue = new BehaviorSubject(undefined);
|
|
1755
|
+
this.displayValue$ = this._displayValue.pipe(filterMaybe(), shareReplay$1(1));
|
|
1756
|
+
this.config$ = this.displayValue$.pipe(map$1(x => {
|
|
1757
|
+
const config = Object.assign(Object.assign({}, x.display), { providers: mergeIntoArray([{
|
|
1758
|
+
provide: DBX_SEARCHABLE_FIELD_COMPONENT_DATA,
|
|
1759
|
+
useValue: x
|
|
1760
|
+
}], x.display.providers) });
|
|
1761
|
+
return config;
|
|
1762
|
+
}));
|
|
1763
|
+
this.anchor$ = this.displayValue$.pipe(map$1(x => x.anchor));
|
|
1764
|
+
}
|
|
1765
|
+
set displayValue(displayValue) {
|
|
1766
|
+
this._displayValue.next(displayValue);
|
|
1767
|
+
}
|
|
1768
|
+
ngOnDestroy() {
|
|
1769
|
+
this._displayValue.complete();
|
|
1462
1770
|
}
|
|
1463
1771
|
}
|
|
1464
|
-
DbxSearchableFieldAutocompleteItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1465
|
-
DbxSearchableFieldAutocompleteItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
1466
|
-
<
|
|
1467
|
-
|
|
1468
|
-
|
|
1772
|
+
DbxSearchableFieldAutocompleteItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableFieldAutocompleteItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1773
|
+
DbxSearchableFieldAutocompleteItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxSearchableFieldAutocompleteItemComponent, selector: "dbx-searchable-field-autocomplete-item", inputs: { displayValue: "displayValue" }, ngImport: i0, template: `
|
|
1774
|
+
<dbx-anchor [block]="true" [anchor]="anchor$ | async">
|
|
1775
|
+
<dbx-injected-content [config]="config$ | async"></dbx-injected-content>
|
|
1776
|
+
</dbx-anchor>
|
|
1777
|
+
`, isInline: true, components: [{ type: i1$1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { type: i2.DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: ["config", "template"] }], pipes: { "async": i5.AsyncPipe } });
|
|
1778
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableFieldAutocompleteItemComponent, decorators: [{
|
|
1469
1779
|
type: Component,
|
|
1470
1780
|
args: [{
|
|
1471
1781
|
selector: 'dbx-searchable-field-autocomplete-item',
|
|
1472
1782
|
template: `
|
|
1473
|
-
<
|
|
1783
|
+
<dbx-anchor [block]="true" [anchor]="anchor$ | async">
|
|
1784
|
+
<dbx-injected-content [config]="config$ | async"></dbx-injected-content>
|
|
1785
|
+
</dbx-anchor>
|
|
1474
1786
|
`
|
|
1475
1787
|
}]
|
|
1476
|
-
}], propDecorators: {
|
|
1477
|
-
type: ViewChild,
|
|
1478
|
-
args: ['content', { static: true, read: ViewContainerRef }]
|
|
1479
|
-
}], displayValue: [{
|
|
1788
|
+
}], propDecorators: { displayValue: [{
|
|
1480
1789
|
type: Input
|
|
1481
1790
|
}] } });
|
|
1482
1791
|
// MARK: Default
|
|
1483
|
-
class
|
|
1792
|
+
class AbstractDbxSearchableFieldDisplayDirective {
|
|
1793
|
+
constructor(displayValue) {
|
|
1794
|
+
this.displayValue = displayValue;
|
|
1795
|
+
}
|
|
1484
1796
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1797
|
+
AbstractDbxSearchableFieldDisplayDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxSearchableFieldDisplayDirective, deps: [{ token: DBX_SEARCHABLE_FIELD_COMPONENT_DATA }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1798
|
+
AbstractDbxSearchableFieldDisplayDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxSearchableFieldDisplayDirective, ngImport: i0 });
|
|
1799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxSearchableFieldDisplayDirective, decorators: [{
|
|
1800
|
+
type: Directive
|
|
1801
|
+
}], ctorParameters: function () {
|
|
1802
|
+
return [{ type: undefined, decorators: [{
|
|
1803
|
+
type: Inject,
|
|
1804
|
+
args: [DBX_SEARCHABLE_FIELD_COMPONENT_DATA]
|
|
1805
|
+
}] }];
|
|
1806
|
+
} });
|
|
1807
|
+
class DbxDefaultSearchableFieldDisplayComponent extends AbstractDbxSearchableFieldDisplayDirective {
|
|
1808
|
+
}
|
|
1809
|
+
DbxDefaultSearchableFieldDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDefaultSearchableFieldDisplayComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1810
|
+
DbxDefaultSearchableFieldDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxDefaultSearchableFieldDisplayComponent, selector: "dbx-default-searchable-field-display", usesInheritance: true, ngImport: i0, template: `
|
|
1811
|
+
<div class="dbx-default-searchable-field-display">
|
|
1812
|
+
<span class="dbx-chip-label">{{ displayValue.label }}</span>
|
|
1813
|
+
<span class="dbx-chip-sublabel" *ngIf="displayValue.sublabel">({{ displayValue.sublabel }})</span>
|
|
1814
|
+
</div>
|
|
1489
1815
|
`, isInline: true, directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
1816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDefaultSearchableFieldDisplayComponent, decorators: [{
|
|
1491
1817
|
type: Component,
|
|
1492
1818
|
args: [{
|
|
1493
1819
|
selector: 'dbx-default-searchable-field-display',
|
|
1494
1820
|
template: `
|
|
1495
|
-
|
|
1496
|
-
<span class="
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}], propDecorators: { displayValue: [{
|
|
1500
|
-
type: Input
|
|
1501
|
-
}] } });
|
|
1502
|
-
class DbxDefaultSearchableAnchorFieldDisplayComponent {
|
|
1503
|
-
}
|
|
1504
|
-
DbxDefaultSearchableAnchorFieldDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: DbxDefaultSearchableAnchorFieldDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1505
|
-
DbxDefaultSearchableAnchorFieldDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: DbxDefaultSearchableAnchorFieldDisplayComponent, selector: "ng-component", inputs: { displayValue: "displayValue" }, ngImport: i0, template: `
|
|
1506
|
-
<dbx-anchor [block]="true" [anchor]="displayValue?.anchor">
|
|
1507
|
-
<dbx-default-searchable-field-display [displayValue]="displayValue"></dbx-default-searchable-field-display>
|
|
1508
|
-
</dbx-anchor>
|
|
1509
|
-
`, isInline: true, components: [{ type: i1$1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { type: DbxDefaultSearchableFieldDisplayComponent, selector: "dbx-default-searchable-field-display", inputs: ["displayValue"] }] });
|
|
1510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: DbxDefaultSearchableAnchorFieldDisplayComponent, decorators: [{
|
|
1511
|
-
type: Component,
|
|
1512
|
-
args: [{
|
|
1513
|
-
template: `
|
|
1514
|
-
<dbx-anchor [block]="true" [anchor]="displayValue?.anchor">
|
|
1515
|
-
<dbx-default-searchable-field-display [displayValue]="displayValue"></dbx-default-searchable-field-display>
|
|
1516
|
-
</dbx-anchor>
|
|
1821
|
+
<div class="dbx-default-searchable-field-display">
|
|
1822
|
+
<span class="dbx-chip-label">{{ displayValue.label }}</span>
|
|
1823
|
+
<span class="dbx-chip-sublabel" *ngIf="displayValue.sublabel">({{ displayValue.sublabel }})</span>
|
|
1824
|
+
</div>
|
|
1517
1825
|
`
|
|
1518
1826
|
}]
|
|
1519
|
-
}]
|
|
1520
|
-
type: Input
|
|
1521
|
-
}] } });
|
|
1827
|
+
}] });
|
|
1522
1828
|
|
|
1523
1829
|
/**
|
|
1524
1830
|
* Abstract searchable field that provides a feature for searching for values, and for displaying values using Observables.
|
|
1525
1831
|
*
|
|
1526
1832
|
* Display values are cached for performance.
|
|
1527
1833
|
*/
|
|
1528
|
-
class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
1529
|
-
constructor() {
|
|
1530
|
-
super(
|
|
1834
|
+
class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
1835
|
+
constructor(cdRef) {
|
|
1836
|
+
super();
|
|
1837
|
+
this.cdRef = cdRef;
|
|
1531
1838
|
/**
|
|
1532
1839
|
* Whether or not to set/get values as an array.
|
|
1533
1840
|
*/
|
|
@@ -1536,15 +1843,13 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1536
1843
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
1537
1844
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
1538
1845
|
this._displayHashMap = new BehaviorSubject(new Map());
|
|
1539
|
-
this.inputValue$ = this.inputCtrl.valueChanges.pipe();
|
|
1540
|
-
this.inputValueString$ = this.inputValue$.pipe(debounceTime
|
|
1541
|
-
this.searchResultsState$ = this.inputValueString$.pipe(
|
|
1542
|
-
// TODO: Consider caching search text/results.
|
|
1543
|
-
switchMap$1((text) => this.search(text).pipe(switchMap$1((x) => this.loadDisplayValuesForFieldValues(x)),
|
|
1846
|
+
this.inputValue$ = this.inputCtrl.valueChanges.pipe(startWith(this.inputCtrl.value));
|
|
1847
|
+
this.inputValueString$ = this.inputValue$.pipe(debounceTime(200), distinctUntilChanged$1());
|
|
1848
|
+
this.searchResultsState$ = this.inputValueString$.pipe(switchMap$1((text) => ((text || this.searchOnEmptyText) ? this.search(text !== null && text !== void 0 ? text : '') : of([])).pipe(switchMap$1((x) => this.loadDisplayValuesForFieldValues(x)),
|
|
1544
1849
|
// Return begin loading to setup the loading state.
|
|
1545
1850
|
startWith(beginLoading()))), shareReplay$1(1));
|
|
1546
1851
|
this.singleValueSyncSubscription = new SubscriptionObject();
|
|
1547
|
-
this.searchContext = new LoadingStateContextInstance({ obs: this.searchResultsState$, showLoadingOnNoValue:
|
|
1852
|
+
this.searchContext = new LoadingStateContextInstance({ obs: this.searchResultsState$, showLoadingOnNoValue: false });
|
|
1548
1853
|
this.searchResults$ = this.searchResultsState$.pipe(map$1(x => { var _a; return (_a = x === null || x === void 0 ? void 0 : x.value) !== null && _a !== void 0 ? _a : []; }));
|
|
1549
1854
|
this._formControlValue = this.formControl$.pipe(switchMap$1(control => control.valueChanges.pipe(startWith(control.value), shareReplay$1(1))));
|
|
1550
1855
|
this.values$ = this._formControlValue.pipe(map$1(convertMaybeToArray), shareReplay$1(1));
|
|
@@ -1563,44 +1868,35 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1563
1868
|
var _a;
|
|
1564
1869
|
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.readonly;
|
|
1565
1870
|
}
|
|
1566
|
-
get
|
|
1567
|
-
|
|
1568
|
-
return (_a = this.field.searchOnEmptyText) !== null && _a !== void 0 ? _a : false;
|
|
1871
|
+
get searchableField() {
|
|
1872
|
+
return this.field.searchableField;
|
|
1569
1873
|
}
|
|
1570
|
-
get
|
|
1874
|
+
get searchOnEmptyText() {
|
|
1571
1875
|
var _a;
|
|
1572
|
-
return (_a = this.
|
|
1876
|
+
return (_a = this.searchableField.searchOnEmptyText) !== null && _a !== void 0 ? _a : false;
|
|
1573
1877
|
}
|
|
1574
1878
|
get autocomplete() {
|
|
1575
1879
|
var _a, _b, _c;
|
|
1576
1880
|
return (_c = (_b = (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b['autocomplete']) !== null && _c !== void 0 ? _c : this.key;
|
|
1577
1881
|
}
|
|
1578
|
-
get placeholder() {
|
|
1579
|
-
var _a, _b;
|
|
1580
|
-
return (_b = (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.placeholder) !== null && _b !== void 0 ? _b : '';
|
|
1581
|
-
}
|
|
1582
|
-
get description() {
|
|
1583
|
-
var _a, _b;
|
|
1584
|
-
return (_a = this.field.description) !== null && _a !== void 0 ? _a : (_b = this.field.templateOptions) === null || _b === void 0 ? void 0 : _b.description;
|
|
1585
|
-
}
|
|
1586
1882
|
get hashForValue() {
|
|
1587
1883
|
var _a;
|
|
1588
|
-
return (_a = this.
|
|
1884
|
+
return (_a = this.searchableField.hashForValue) !== null && _a !== void 0 ? _a : ((x) => x);
|
|
1589
1885
|
}
|
|
1590
1886
|
get displayForValue() {
|
|
1591
|
-
return this.
|
|
1887
|
+
return this.searchableField.displayForValue;
|
|
1592
1888
|
}
|
|
1593
1889
|
get useAnchor() {
|
|
1594
|
-
return this.
|
|
1890
|
+
return this.searchableField.useAnchor;
|
|
1595
1891
|
}
|
|
1596
1892
|
get anchorForValue() {
|
|
1597
|
-
return this.
|
|
1893
|
+
return this.searchableField.anchorForValue;
|
|
1598
1894
|
}
|
|
1599
|
-
get
|
|
1600
|
-
return this.
|
|
1895
|
+
get display() {
|
|
1896
|
+
return this.searchableField.display;
|
|
1601
1897
|
}
|
|
1602
1898
|
get search() {
|
|
1603
|
-
return this.
|
|
1899
|
+
return this.searchableField.search;
|
|
1604
1900
|
}
|
|
1605
1901
|
get values() {
|
|
1606
1902
|
var _a;
|
|
@@ -1608,35 +1904,42 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1608
1904
|
}
|
|
1609
1905
|
get allowStringValues() {
|
|
1610
1906
|
var _a;
|
|
1611
|
-
return (_a = this.allowStringValues) !== null && _a !== void 0 ? _a : Boolean(this.convertStringValue);
|
|
1907
|
+
return (_a = this.searchableField.allowStringValues) !== null && _a !== void 0 ? _a : Boolean(this.convertStringValue);
|
|
1612
1908
|
}
|
|
1613
1909
|
get convertStringValue() {
|
|
1614
|
-
return this.
|
|
1910
|
+
return this.searchableField.convertStringValue;
|
|
1911
|
+
}
|
|
1912
|
+
get showClearValue() {
|
|
1913
|
+
var _a;
|
|
1914
|
+
return (_a = this.searchableField.showClearValue) !== null && _a !== void 0 ? _a : true;
|
|
1615
1915
|
}
|
|
1616
1916
|
loadDisplayValuesForValues(values) {
|
|
1617
1917
|
return this.loadDisplayValuesForFieldValues(values.map((value) => ({ value })));
|
|
1618
1918
|
}
|
|
1619
1919
|
loadDisplayValuesForFieldValues(values) {
|
|
1620
|
-
return this.getDisplayValuesForFieldValues(values).pipe(map$1((displayValues) => (
|
|
1920
|
+
return this.getDisplayValuesForFieldValues(values).pipe(map$1((displayValues) => successResult(displayValues)), startWith(beginLoading()), shareReplay$1(1));
|
|
1621
1921
|
}
|
|
1622
1922
|
getDisplayValuesForFieldValues(values) {
|
|
1623
1923
|
return this._displayHashMap.pipe(mergeMap((displayMap) => {
|
|
1624
|
-
var _a;
|
|
1625
1924
|
const mappingResult = values
|
|
1626
1925
|
.map(x => [x, this.hashForValue(x.value)])
|
|
1627
1926
|
.map(([x, hash], i) => [i, hash, x, displayMap.get(hash)]);
|
|
1628
1927
|
const hasDisplay = mappingResult.filter(x => Boolean(x[3]));
|
|
1629
1928
|
const needsDisplay = mappingResult.filter(x => !x[3]);
|
|
1929
|
+
let obs;
|
|
1630
1930
|
if (needsDisplay.length > 0) {
|
|
1631
1931
|
// Go get the display value.
|
|
1632
1932
|
const displayValuesObs = this.displayForValue(needsDisplay.map(x => x[2]));
|
|
1633
|
-
const
|
|
1933
|
+
const defaultDisplay = mergeDbxInjectedComponentConfigs([this.defaultDisplay, this.display]);
|
|
1634
1934
|
const anchorForValue = this.useAnchor && this.anchorForValue;
|
|
1635
|
-
|
|
1636
|
-
// Assign the default component classes.
|
|
1935
|
+
obs = displayValuesObs.pipe(first$1(), map$1((displayResults) => {
|
|
1936
|
+
// Assign the default component classes to complete configuration.
|
|
1637
1937
|
displayResults.forEach(x => {
|
|
1638
|
-
if (!x.
|
|
1639
|
-
x.
|
|
1938
|
+
if (!x.display) {
|
|
1939
|
+
x.display = defaultDisplay;
|
|
1940
|
+
}
|
|
1941
|
+
else {
|
|
1942
|
+
x.display = mergeDbxInjectedComponentConfigs([defaultDisplay, x.display]);
|
|
1640
1943
|
}
|
|
1641
1944
|
if (!x.anchor && anchorForValue) {
|
|
1642
1945
|
x.anchor = anchorForValue(x);
|
|
@@ -1655,22 +1958,20 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1655
1958
|
}
|
|
1656
1959
|
else {
|
|
1657
1960
|
// If all display values are hashed return that.
|
|
1658
|
-
|
|
1961
|
+
obs = of(hasDisplay.map(x => x[3]));
|
|
1659
1962
|
}
|
|
1963
|
+
return obs;
|
|
1660
1964
|
}));
|
|
1661
1965
|
}
|
|
1662
1966
|
ngOnInit() {
|
|
1967
|
+
var _a;
|
|
1968
|
+
super.ngOnInit();
|
|
1663
1969
|
this._formControlObs.next(this.formControl);
|
|
1664
|
-
if (this.
|
|
1665
|
-
this.inputCtrl.setValidators(this.
|
|
1970
|
+
if (this.searchableField.textInputValidator) {
|
|
1971
|
+
this.inputCtrl.setValidators(this.searchableField.textInputValidator);
|
|
1666
1972
|
}
|
|
1667
|
-
if (!this.
|
|
1668
|
-
|
|
1669
|
-
this.defaultComponentClass = DbxDefaultSearchableAnchorFieldDisplayComponent;
|
|
1670
|
-
}
|
|
1671
|
-
else {
|
|
1672
|
-
this.defaultComponentClass = DbxDefaultSearchableFieldDisplayComponent;
|
|
1673
|
-
}
|
|
1973
|
+
if (!((_a = this.defaultDisplay) === null || _a === void 0 ? void 0 : _a.componentClass)) {
|
|
1974
|
+
this.defaultDisplay = Object.assign(Object.assign({}, this.defaultDisplay), { componentClass: DbxDefaultSearchableFieldDisplayComponent });
|
|
1674
1975
|
}
|
|
1675
1976
|
if (this.multiSelect === false) {
|
|
1676
1977
|
this.singleValueSyncSubscription.subscription = this.displayValues$.subscribe((x) => {
|
|
@@ -1681,6 +1982,7 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1681
1982
|
}
|
|
1682
1983
|
}
|
|
1683
1984
|
ngOnDestroy() {
|
|
1985
|
+
super.ngOnDestroy();
|
|
1684
1986
|
this._displayHashMap.complete();
|
|
1685
1987
|
this._formControlObs.complete();
|
|
1686
1988
|
this.searchContext.destroy();
|
|
@@ -1694,7 +1996,7 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1694
1996
|
this.inputCtrl.setValue(value.label);
|
|
1695
1997
|
}
|
|
1696
1998
|
_addWithTextValue(text) {
|
|
1697
|
-
if (!this.
|
|
1999
|
+
if (!this.searchableField.allowStringValues) {
|
|
1698
2000
|
return;
|
|
1699
2001
|
}
|
|
1700
2002
|
if (text) {
|
|
@@ -1716,6 +2018,17 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1716
2018
|
removeWithDisplayValue(displayValue) {
|
|
1717
2019
|
this.removeValue(displayValue.value);
|
|
1718
2020
|
}
|
|
2021
|
+
_tryAddCurrentInputValue() {
|
|
2022
|
+
let addedValue = false;
|
|
2023
|
+
if (this.allowStringValues) {
|
|
2024
|
+
const value = this.inputCtrl.value;
|
|
2025
|
+
if ((value || '').trim()) {
|
|
2026
|
+
this._addWithTextValue(value);
|
|
2027
|
+
addedValue = true;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
return addedValue;
|
|
2031
|
+
}
|
|
1719
2032
|
addValue(value) {
|
|
1720
2033
|
this.textInput.nativeElement.value = '';
|
|
1721
2034
|
this.inputCtrl.setValue(null);
|
|
@@ -1732,6 +2045,9 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1732
2045
|
}
|
|
1733
2046
|
this.setValues(values);
|
|
1734
2047
|
}
|
|
2048
|
+
clearValues() {
|
|
2049
|
+
this.setValues([]);
|
|
2050
|
+
}
|
|
1735
2051
|
setValues(values) {
|
|
1736
2052
|
// Use to filter non-unique values.
|
|
1737
2053
|
if (this.hashForValue) {
|
|
@@ -1745,17 +2061,17 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
1745
2061
|
return value;
|
|
1746
2062
|
}
|
|
1747
2063
|
_setValueOnFormControl(values) {
|
|
1748
|
-
const value = (this.multiSelect) ? values : values
|
|
2064
|
+
const value = (this.multiSelect) ? values : lastValue(values); // pick last value, as the last value added is the newest value.
|
|
1749
2065
|
this.formControl.setValue(value);
|
|
1750
2066
|
this.formControl.markAsDirty();
|
|
1751
2067
|
this.formControl.markAsTouched();
|
|
1752
2068
|
}
|
|
1753
2069
|
}
|
|
1754
|
-
AbstractDbxSearchableValueFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1755
|
-
AbstractDbxSearchableValueFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
1756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2070
|
+
AbstractDbxSearchableValueFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxSearchableValueFieldDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2071
|
+
AbstractDbxSearchableValueFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxSearchableValueFieldDirective, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }], usesInheritance: true, ngImport: i0 });
|
|
2072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxSearchableValueFieldDirective, decorators: [{
|
|
1757
2073
|
type: Directive
|
|
1758
|
-
}], propDecorators: { textInput: [{
|
|
2074
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { textInput: [{
|
|
1759
2075
|
type: ViewChild,
|
|
1760
2076
|
args: ['textInput']
|
|
1761
2077
|
}] } });
|
|
@@ -1763,6 +2079,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1763
2079
|
class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDirective {
|
|
1764
2080
|
constructor() {
|
|
1765
2081
|
super(...arguments);
|
|
2082
|
+
this._blur = new Subject();
|
|
2083
|
+
this._blurSub = new SubscriptionObject();
|
|
1766
2084
|
this.separatorKeysCodes = [ENTER, COMMA];
|
|
1767
2085
|
}
|
|
1768
2086
|
selected(event) {
|
|
@@ -1771,9 +2089,7 @@ class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
1771
2089
|
tabPressedOnInput(event) {
|
|
1772
2090
|
var _a;
|
|
1773
2091
|
if (((_a = event === null || event === void 0 ? void 0 : event.key) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'tab') {
|
|
1774
|
-
|
|
1775
|
-
if ((value || '').trim()) {
|
|
1776
|
-
this._addWithTextValue(value);
|
|
2092
|
+
if (this._tryAddCurrentInputValue()) {
|
|
1777
2093
|
event.preventDefault();
|
|
1778
2094
|
event.stopImmediatePropagation();
|
|
1779
2095
|
return false;
|
|
@@ -1786,15 +2102,36 @@ class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
1786
2102
|
const text = (_a = event.value) !== null && _a !== void 0 ? _a : this.inputCtrl.value;
|
|
1787
2103
|
return this._addWithTextValue(text);
|
|
1788
2104
|
}
|
|
2105
|
+
ngOnInit() {
|
|
2106
|
+
super.ngOnInit();
|
|
2107
|
+
// Only try and add the text item as a value if a value wasn't just added (for example, clicking a value).
|
|
2108
|
+
this._blurSub.subscription = this._blur.pipe(skipUntilTimeElapsedAfterLastEmission(this.values$, 100)).subscribe(() => {
|
|
2109
|
+
this._tryAddCurrentInputValue();
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
ngOnDestroy() {
|
|
2113
|
+
super.ngOnDestroy();
|
|
2114
|
+
this._blur.complete();
|
|
2115
|
+
this._blurSub.destroy();
|
|
2116
|
+
}
|
|
2117
|
+
onBlur() {
|
|
2118
|
+
this._blur.next();
|
|
2119
|
+
}
|
|
1789
2120
|
}
|
|
1790
|
-
DbxSearchableChipFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1791
|
-
DbxSearchableChipFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
1792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2121
|
+
DbxSearchableChipFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableChipFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2122
|
+
DbxSearchableChipFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxSearchableChipFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-searchable-field\">\n <!-- View -->\n <mat-chip-list [selectable]=\"!readonly\" [required]=\"required\" [disabled]=\"readonly\" #chipList>\n <mat-chip *ngFor=\"let displayValue of displayValues$ | async\" [removable]=\"true\"\n (removed)=\"removeWithDisplayValue(displayValue)\">\n <span class=\"dbx-chip-label\">{{ displayValue.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"displayValue.sublabel\">{{ displayValue.sublabel }}</span>\n <mat-icon *ngIf=\"!readonly\" matChipRemove>cancel</mat-icon>\n </mat-chip>\n <input #textInput [name]=\"name\" [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\" [matAutocomplete]=\"auto\"\n autocomplete=\"{{ autocomplete }}\" [matAutocompleteDisabled]=\"readonly\" [matChipInputFor]=\"chipList\" (keydown)=\"tabPressedOnInput($event)\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"addChip($event)\" (blur)=\"onBlur()\">\n </mat-chip-list>\n <div class=\"searchable-field-form-loading\">\n <dbx-loading [linear]=\"true\" [context]=\"searchContext\"></dbx-loading>\n </div>\n</div>\n\n<!-- Autocomplete -->\n<mat-autocomplete class=\"dbx-searchable-text-field-autocomplete\" #auto=\"matAutocomplete\"\n (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of (searchResults$ | async)\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\">\n </dbx-searchable-field-autocomplete-item>\n </mat-option>\n</mat-autocomplete>\n", components: [{ type: i1$5.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$1.DbxLoadingComponent, selector: "dbx-loading", inputs: ["show", "text", "mode", "color", "diameter", "linear", "context", "loading", "error"] }, { type: i4$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: DbxSearchableFieldAutocompleteItemComponent, selector: "dbx-searchable-field-autocomplete-item", inputs: ["displayValue"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$5.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$5.MatChipRemove, selector: "[matChipRemove]" }, { type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i1$5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i5.AsyncPipe } });
|
|
2123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableChipFieldComponent, decorators: [{
|
|
1793
2124
|
type: Component,
|
|
1794
|
-
args: [{ template: "<div class=\"dbx-searchable-field\">\n <!--
|
|
2125
|
+
args: [{ template: "<div class=\"dbx-searchable-field\">\n <!-- View -->\n <mat-chip-list [selectable]=\"!readonly\" [required]=\"required\" [disabled]=\"readonly\" #chipList>\n <mat-chip *ngFor=\"let displayValue of displayValues$ | async\" [removable]=\"true\"\n (removed)=\"removeWithDisplayValue(displayValue)\">\n <span class=\"dbx-chip-label\">{{ displayValue.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"displayValue.sublabel\">{{ displayValue.sublabel }}</span>\n <mat-icon *ngIf=\"!readonly\" matChipRemove>cancel</mat-icon>\n </mat-chip>\n <input #textInput [name]=\"name\" [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\" [matAutocomplete]=\"auto\"\n autocomplete=\"{{ autocomplete }}\" [matAutocompleteDisabled]=\"readonly\" [matChipInputFor]=\"chipList\" (keydown)=\"tabPressedOnInput($event)\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" (matChipInputTokenEnd)=\"addChip($event)\" (blur)=\"onBlur()\">\n </mat-chip-list>\n <div class=\"searchable-field-form-loading\">\n <dbx-loading [linear]=\"true\" [context]=\"searchContext\"></dbx-loading>\n </div>\n</div>\n\n<!-- Autocomplete -->\n<mat-autocomplete class=\"dbx-searchable-text-field-autocomplete\" #auto=\"matAutocomplete\"\n (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of (searchResults$ | async)\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\">\n </dbx-searchable-field-autocomplete-item>\n </mat-option>\n</mat-autocomplete>\n" }]
|
|
1795
2126
|
}] });
|
|
1796
2127
|
|
|
1797
|
-
|
|
2128
|
+
/**
|
|
2129
|
+
* Used to create a SearchableValueFieldDisplayFn function that will retrieve the metadata for items that are missing their metadata so they can be displayed properly.
|
|
2130
|
+
*
|
|
2131
|
+
* @param param0
|
|
2132
|
+
* @returns
|
|
2133
|
+
*/
|
|
2134
|
+
function makeMetaFilterSearchableFieldValueDisplayFn({ loadMetaForValues, makeDisplayForValues }) {
|
|
1798
2135
|
return (values) => {
|
|
1799
2136
|
const { included: loaded, excluded: needLoading } = separateValues(values, (x) => Boolean(x.meta));
|
|
1800
2137
|
let allValues;
|
|
@@ -1817,14 +2154,24 @@ function makeMetaFilterSearchableFieldValueDisplayFn(loadMetaForValues, makeDisp
|
|
|
1817
2154
|
else {
|
|
1818
2155
|
allValues = of(loaded);
|
|
1819
2156
|
}
|
|
1820
|
-
return allValues.pipe(
|
|
2157
|
+
return allValues.pipe(switchMap$1((x) => makeDisplayForValues(x)));
|
|
1821
2158
|
};
|
|
1822
2159
|
}
|
|
2160
|
+
function searchableStringChipField(config) {
|
|
2161
|
+
return searchableChipField(Object.assign(Object.assign({}, config), { allowStringValues: true }));
|
|
2162
|
+
}
|
|
1823
2163
|
function searchableChipField(config) {
|
|
1824
|
-
|
|
2164
|
+
const { key, placeholder } = config;
|
|
2165
|
+
return formlyField(Object.assign(Object.assign({ key, type: 'searchablechipfield' }, templateOptionsForFieldConfig(config, {
|
|
2166
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Add...',
|
|
2167
|
+
autocomplete: false
|
|
2168
|
+
})), { searchableField: config }));
|
|
1825
2169
|
}
|
|
1826
2170
|
function searchableTextField(config) {
|
|
1827
|
-
|
|
2171
|
+
const { key } = config;
|
|
2172
|
+
return formlyField(Object.assign(Object.assign({ key, type: 'searchabletextfield' }, templateOptionsForFieldConfig(config, {
|
|
2173
|
+
autocomplete: false
|
|
2174
|
+
})), { searchableField: config }));
|
|
1828
2175
|
}
|
|
1829
2176
|
|
|
1830
2177
|
/**
|
|
@@ -1833,28 +2180,50 @@ function searchableTextField(config) {
|
|
|
1833
2180
|
class DbxSearchableTextFieldComponent extends AbstractDbxSearchableValueFieldDirective {
|
|
1834
2181
|
constructor() {
|
|
1835
2182
|
super(...arguments);
|
|
2183
|
+
this.selectedDisplayValue$ = this.displayValues$.pipe(map$1(x => x[0]), shareReplay$1(1), tapDetectChanges(this.cdRef));
|
|
2184
|
+
this.hasValue$ = this.selectedDisplayValue$.pipe(map$1(x => Boolean(x)));
|
|
2185
|
+
this.showSelectedDisplayValue$ = this.selectedDisplayValue$.pipe(map$1(x => this.showSelectedValue && Boolean(x)), distinctUntilChanged$1(), shareReplay$1(1), tapDetectChanges(this.cdRef));
|
|
1836
2186
|
this.multiSelect = false;
|
|
2187
|
+
this._clearInputSub = new SubscriptionObject();
|
|
2188
|
+
}
|
|
2189
|
+
get searchableField() {
|
|
2190
|
+
return this.field.searchableField;
|
|
2191
|
+
}
|
|
2192
|
+
get showSelectedValue() {
|
|
2193
|
+
var _a;
|
|
2194
|
+
return (_a = this.searchableField.showSelectedValue) !== null && _a !== void 0 ? _a : !this.allowStringValues; // Show the selected value only if string values are allowed.
|
|
2195
|
+
}
|
|
2196
|
+
ngOnInit() {
|
|
2197
|
+
super.ngOnInit();
|
|
2198
|
+
this._clearInputSub.subscription = this.inputValue$.pipe(skipWhile((x) => !x)).subscribe((x) => {
|
|
2199
|
+
if (!x) {
|
|
2200
|
+
// this.clearValues();
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
ngOnDestroy() {
|
|
2205
|
+
super.ngOnDestroy();
|
|
2206
|
+
this._clearInputSub.destroy();
|
|
1837
2207
|
}
|
|
1838
2208
|
selected(event) {
|
|
1839
2209
|
const e = event;
|
|
1840
2210
|
this.addWithDisplayValue(e.option.value);
|
|
1841
2211
|
}
|
|
1842
2212
|
}
|
|
1843
|
-
DbxSearchableTextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1844
|
-
DbxSearchableTextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
1845
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2213
|
+
DbxSearchableTextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableTextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2214
|
+
DbxSearchableTextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxSearchableTextFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-searchable-text-field\"\n [ngClass]=\"{ 'dbx-searchable-text-field-has-value': (hasValue$ | async), 'dbx-searchable-text-field-show-value': showSelectedValue }\">\n <!-- Result View -->\n <div class=\"dbx-searchable-text-field-value mat-option mat-option-text\" *ngIf=\"showSelectedDisplayValue$ | async\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"(selectedDisplayValue$ | async)!\">\n </dbx-searchable-field-autocomplete-item>\n </div>\n <div class=\"dbx-searchable-text-field-input\">\n <div class=\"dbx-label\">Search</div>\n <!-- View -->\n <input type=\"search\" [name]=\"name\" matInput #textInput [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\"\n [matAutocomplete]=\"auto\" [matAutocompleteDisabled]=\"readonly\" autocomplete=\"{{ autocomplete }}\">\n <div class=\"searchable-field-form-loading\">\n <dbx-loading [linear]=\"true\" [context]=\"searchContext\"></dbx-loading>\n </div>\n </div>\n</div>\n\n<!-- Autocomplete -->\n<mat-autocomplete class=\"dbx-searchable-text-field-autocomplete\" #auto (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of (searchResults$ | async)\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\">\n </dbx-searchable-field-autocomplete-item>\n </mat-option>\n <!-- Add/Pick String Value -->\n <mat-option *ngIf=\"allowStringValues && (inputValue$ | async)\" [value]=\"{ value: (inputValue$ | async) }\">\n <p class=\"dbx-clear-hint text-center\">\"{{ inputValue$ | async }}\"</p>\n </mat-option>\n <!-- Show clear value -->\n <mat-option *ngIf=\"showClearValue && (hasValue$ | async)\" value=\"\">\n <p class=\"dbx-clear-hint text-center\">Clear</p>\n </mat-option>\n</mat-autocomplete>\n", components: [{ type: DbxSearchableFieldAutocompleteItemComponent, selector: "dbx-searchable-field-autocomplete-item", inputs: ["displayValue"] }, { type: i1$1.DbxLoadingComponent, selector: "dbx-loading", inputs: ["show", "text", "mode", "color", "diameter", "linear", "context", "loading", "error"] }, { type: i4$3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i5.AsyncPipe } });
|
|
2215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxSearchableTextFieldComponent, decorators: [{
|
|
1846
2216
|
type: Component,
|
|
1847
|
-
args: [{ template: "<div class=\"dbx-searchable-text-field\">\n <!--
|
|
2217
|
+
args: [{ template: "<div class=\"dbx-searchable-text-field\"\n [ngClass]=\"{ 'dbx-searchable-text-field-has-value': (hasValue$ | async), 'dbx-searchable-text-field-show-value': showSelectedValue }\">\n <!-- Result View -->\n <div class=\"dbx-searchable-text-field-value mat-option mat-option-text\" *ngIf=\"showSelectedDisplayValue$ | async\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"(selectedDisplayValue$ | async)!\">\n </dbx-searchable-field-autocomplete-item>\n </div>\n <div class=\"dbx-searchable-text-field-input\">\n <div class=\"dbx-label\">Search</div>\n <!-- View -->\n <input type=\"search\" [name]=\"name\" matInput #textInput [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\"\n [matAutocomplete]=\"auto\" [matAutocompleteDisabled]=\"readonly\" autocomplete=\"{{ autocomplete }}\">\n <div class=\"searchable-field-form-loading\">\n <dbx-loading [linear]=\"true\" [context]=\"searchContext\"></dbx-loading>\n </div>\n </div>\n</div>\n\n<!-- Autocomplete -->\n<mat-autocomplete class=\"dbx-searchable-text-field-autocomplete\" #auto (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of (searchResults$ | async)\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\">\n </dbx-searchable-field-autocomplete-item>\n </mat-option>\n <!-- Add/Pick String Value -->\n <mat-option *ngIf=\"allowStringValues && (inputValue$ | async)\" [value]=\"{ value: (inputValue$ | async) }\">\n <p class=\"dbx-clear-hint text-center\">\"{{ inputValue$ | async }}\"</p>\n </mat-option>\n <!-- Show clear value -->\n <mat-option *ngIf=\"showClearValue && (hasValue$ | async)\" value=\"\">\n <p class=\"dbx-clear-hint text-center\">Clear</p>\n </mat-option>\n</mat-autocomplete>\n" }]
|
|
1848
2218
|
}] });
|
|
1849
2219
|
|
|
1850
2220
|
class DbxFormFormlySearchableFieldModule {
|
|
1851
2221
|
}
|
|
1852
|
-
DbxFormFormlySearchableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
1853
|
-
DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
2222
|
+
DbxFormFormlySearchableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySearchableFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2223
|
+
DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySearchableFieldModule, declarations: [DbxSearchableChipFieldComponent,
|
|
1854
2224
|
DbxSearchableTextFieldComponent,
|
|
1855
2225
|
DbxSearchableFieldAutocompleteItemComponent,
|
|
1856
|
-
DbxDefaultSearchableFieldDisplayComponent,
|
|
1857
|
-
DbxDefaultSearchableAnchorFieldDisplayComponent], imports: [CommonModule,
|
|
2226
|
+
DbxDefaultSearchableFieldDisplayComponent], imports: [CommonModule,
|
|
1858
2227
|
DbxTextModule,
|
|
1859
2228
|
DbxLoadingModule,
|
|
1860
2229
|
DbxButtonModule,
|
|
@@ -1871,7 +2240,7 @@ DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion
|
|
|
1871
2240
|
MatIconModule,
|
|
1872
2241
|
DbxInjectedComponentModule, i1$4.FormlyModule], exports: [DbxSearchableChipFieldComponent,
|
|
1873
2242
|
DbxSearchableTextFieldComponent] });
|
|
1874
|
-
DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
2243
|
+
DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySearchableFieldModule, imports: [[
|
|
1875
2244
|
CommonModule,
|
|
1876
2245
|
DbxTextModule,
|
|
1877
2246
|
DbxLoadingModule,
|
|
@@ -1890,12 +2259,12 @@ DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion
|
|
|
1890
2259
|
DbxInjectedComponentModule,
|
|
1891
2260
|
FormlyModule.forChild({
|
|
1892
2261
|
types: [
|
|
1893
|
-
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent },
|
|
1894
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent }
|
|
2262
|
+
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2263
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] },
|
|
1895
2264
|
]
|
|
1896
2265
|
})
|
|
1897
2266
|
]] });
|
|
1898
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySearchableFieldModule, decorators: [{
|
|
1899
2268
|
type: NgModule,
|
|
1900
2269
|
args: [{
|
|
1901
2270
|
imports: [
|
|
@@ -1917,8 +2286,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1917
2286
|
DbxInjectedComponentModule,
|
|
1918
2287
|
FormlyModule.forChild({
|
|
1919
2288
|
types: [
|
|
1920
|
-
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent },
|
|
1921
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent }
|
|
2289
|
+
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2290
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] },
|
|
1922
2291
|
]
|
|
1923
2292
|
})
|
|
1924
2293
|
],
|
|
@@ -1926,8 +2295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
1926
2295
|
DbxSearchableChipFieldComponent,
|
|
1927
2296
|
DbxSearchableTextFieldComponent,
|
|
1928
2297
|
DbxSearchableFieldAutocompleteItemComponent,
|
|
1929
|
-
DbxDefaultSearchableFieldDisplayComponent
|
|
1930
|
-
DbxDefaultSearchableAnchorFieldDisplayComponent
|
|
2298
|
+
DbxDefaultSearchableFieldDisplayComponent
|
|
1931
2299
|
],
|
|
1932
2300
|
exports: [
|
|
1933
2301
|
DbxSearchableChipFieldComponent,
|
|
@@ -1943,22 +2311,188 @@ function chipTextField(config) {
|
|
|
1943
2311
|
} }));
|
|
1944
2312
|
}
|
|
1945
2313
|
|
|
1946
|
-
class
|
|
1947
|
-
|
|
2314
|
+
class DbxFormFormlySelectionModule {
|
|
2315
|
+
}
|
|
2316
|
+
DbxFormFormlySelectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySelectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2317
|
+
DbxFormFormlySelectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [CommonModule], exports: [DbxFormFormlyPickableFieldModule,
|
|
2318
|
+
DbxFormFormlySearchableFieldModule] });
|
|
2319
|
+
DbxFormFormlySelectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [[
|
|
2320
|
+
CommonModule
|
|
2321
|
+
], DbxFormFormlyPickableFieldModule,
|
|
2322
|
+
DbxFormFormlySearchableFieldModule] });
|
|
2323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlySelectionModule, decorators: [{
|
|
2324
|
+
type: NgModule,
|
|
2325
|
+
args: [{
|
|
2326
|
+
imports: [
|
|
2327
|
+
CommonModule
|
|
2328
|
+
],
|
|
2329
|
+
declarations: [],
|
|
2330
|
+
exports: [
|
|
2331
|
+
DbxFormFormlyPickableFieldModule,
|
|
2332
|
+
DbxFormFormlySearchableFieldModule
|
|
2333
|
+
]
|
|
2334
|
+
}]
|
|
2335
|
+
}] });
|
|
2336
|
+
|
|
2337
|
+
class DbxTextEditorFieldComponent extends FieldType$1 {
|
|
2338
|
+
constructor(compact) {
|
|
1948
2339
|
var _a;
|
|
1949
|
-
|
|
2340
|
+
super();
|
|
2341
|
+
this.compact = compact;
|
|
2342
|
+
this._sub = new SubscriptionObject();
|
|
2343
|
+
this.compactClass$ = mapCompactModeObs((_a = this.compact) === null || _a === void 0 ? void 0 : _a.mode$, {
|
|
2344
|
+
compact: 'dbx-texteditor-field-compact'
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
get formGroupName() {
|
|
2348
|
+
return this.field.key;
|
|
2349
|
+
}
|
|
2350
|
+
get formGroup() {
|
|
2351
|
+
return this.form;
|
|
1950
2352
|
}
|
|
1951
|
-
get
|
|
2353
|
+
get editor() {
|
|
2354
|
+
return this._editor;
|
|
2355
|
+
}
|
|
2356
|
+
get label() {
|
|
1952
2357
|
var _a;
|
|
1953
|
-
return (_a = this.
|
|
2358
|
+
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.label;
|
|
2359
|
+
}
|
|
2360
|
+
get description() {
|
|
2361
|
+
return this.to.description;
|
|
2362
|
+
}
|
|
2363
|
+
ngOnInit() {
|
|
2364
|
+
super.ngOnInit();
|
|
2365
|
+
this._editor = new Editor({});
|
|
2366
|
+
// Watch for value changes every second and update the pristine level.
|
|
2367
|
+
this._sub.subscription = this.editor.valueChanges.pipe(debounceTime$1(100), filter(_ => this.editor.view.hasFocus())).subscribe(() => {
|
|
2368
|
+
this.formControl.updateValueAndValidity();
|
|
2369
|
+
this.formControl.markAsDirty();
|
|
2370
|
+
});
|
|
2371
|
+
}
|
|
2372
|
+
ngOnDestroy() {
|
|
2373
|
+
super.ngOnDestroy();
|
|
2374
|
+
if (this.editor) {
|
|
2375
|
+
this.editor.destroy();
|
|
2376
|
+
delete this._editor;
|
|
2377
|
+
}
|
|
2378
|
+
this._sub.destroy();
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
DbxTextEditorFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxTextEditorFieldComponent, deps: [{ token: i1$1.CompactContextStore, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2382
|
+
DbxTextEditorFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxTextEditorFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
2383
|
+
<div class="dbx-texteditor-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
2384
|
+
<dbx-label *ngIf="label">{{ label }}</dbx-label>
|
|
2385
|
+
<div class="dbx-texteditor-field-input">
|
|
2386
|
+
<ngx-editor [editor]="editor" outputFormat="html" [placeholder]="placeholder" [formControlName]="formGroupName"></ngx-editor>
|
|
2387
|
+
</div>
|
|
2388
|
+
<div class="dbx-texteditor-field-menu">
|
|
2389
|
+
<ngx-editor-menu [editor]="editor"></ngx-editor-menu>
|
|
2390
|
+
</div>
|
|
2391
|
+
<div>
|
|
2392
|
+
<dbx-hint *ngIf="description">{{ description }}</dbx-hint>
|
|
2393
|
+
</div>
|
|
2394
|
+
</div>
|
|
2395
|
+
`, isInline: true, components: [{ type: i1$1.DbxLabelComponent, selector: "dbx-label" }, { type: i2$3.NgxEditorComponent, selector: "ngx-editor", inputs: ["editor", "outputFormat", "placeholder"], outputs: ["focusOut", "focusIn"] }, { type: i2$3.MenuComponent, selector: "ngx-editor-menu", inputs: ["toolbar", "colorPresets", "disabled", "editor", "customMenuRef", "dropdownPlacement"] }, { type: i1$1.DbxHintComponent, selector: "dbx-hint" }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "async": i5.AsyncPipe } });
|
|
2396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxTextEditorFieldComponent, decorators: [{
|
|
2397
|
+
type: Component,
|
|
2398
|
+
args: [{
|
|
2399
|
+
template: `
|
|
2400
|
+
<div class="dbx-texteditor-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
2401
|
+
<dbx-label *ngIf="label">{{ label }}</dbx-label>
|
|
2402
|
+
<div class="dbx-texteditor-field-input">
|
|
2403
|
+
<ngx-editor [editor]="editor" outputFormat="html" [placeholder]="placeholder" [formControlName]="formGroupName"></ngx-editor>
|
|
2404
|
+
</div>
|
|
2405
|
+
<div class="dbx-texteditor-field-menu">
|
|
2406
|
+
<ngx-editor-menu [editor]="editor"></ngx-editor-menu>
|
|
2407
|
+
</div>
|
|
2408
|
+
<div>
|
|
2409
|
+
<dbx-hint *ngIf="description">{{ description }}</dbx-hint>
|
|
2410
|
+
</div>
|
|
2411
|
+
</div>
|
|
2412
|
+
`
|
|
2413
|
+
}]
|
|
2414
|
+
}], ctorParameters: function () {
|
|
2415
|
+
return [{ type: i1$1.CompactContextStore, decorators: [{
|
|
2416
|
+
type: Optional
|
|
2417
|
+
}] }];
|
|
2418
|
+
} });
|
|
2419
|
+
|
|
2420
|
+
class DbxFormFormlyTextEditorFieldModule {
|
|
2421
|
+
}
|
|
2422
|
+
DbxFormFormlyTextEditorFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2423
|
+
DbxFormFormlyTextEditorFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, declarations: [DbxTextEditorFieldComponent], imports: [CommonModule,
|
|
2424
|
+
DbxTextModule,
|
|
2425
|
+
FormsModule,
|
|
2426
|
+
ReactiveFormsModule,
|
|
2427
|
+
NgxEditorModule,
|
|
2428
|
+
MatFormFieldModule,
|
|
2429
|
+
MatInputModule, i1$4.FormlyModule] });
|
|
2430
|
+
DbxFormFormlyTextEditorFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, imports: [[
|
|
2431
|
+
CommonModule,
|
|
2432
|
+
DbxTextModule,
|
|
2433
|
+
FormsModule,
|
|
2434
|
+
ReactiveFormsModule,
|
|
2435
|
+
NgxEditorModule,
|
|
2436
|
+
MatFormFieldModule,
|
|
2437
|
+
MatInputModule,
|
|
2438
|
+
FormlyModule.forChild({
|
|
2439
|
+
types: [
|
|
2440
|
+
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2441
|
+
]
|
|
2442
|
+
})
|
|
2443
|
+
]] });
|
|
2444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, decorators: [{
|
|
2445
|
+
type: NgModule,
|
|
2446
|
+
args: [{
|
|
2447
|
+
imports: [
|
|
2448
|
+
CommonModule,
|
|
2449
|
+
DbxTextModule,
|
|
2450
|
+
FormsModule,
|
|
2451
|
+
ReactiveFormsModule,
|
|
2452
|
+
NgxEditorModule,
|
|
2453
|
+
MatFormFieldModule,
|
|
2454
|
+
MatInputModule,
|
|
2455
|
+
FormlyModule.forChild({
|
|
2456
|
+
types: [
|
|
2457
|
+
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2458
|
+
]
|
|
2459
|
+
})
|
|
2460
|
+
],
|
|
2461
|
+
declarations: [
|
|
2462
|
+
DbxTextEditorFieldComponent
|
|
2463
|
+
],
|
|
2464
|
+
exports: []
|
|
2465
|
+
}]
|
|
2466
|
+
}] });
|
|
2467
|
+
|
|
2468
|
+
function textEditorField(config) {
|
|
2469
|
+
const { key, minLength, maxLength } = config;
|
|
2470
|
+
const fieldConfig = formlyField(Object.assign({ key, type: 'texteditor', defaultValue: '', modelOptions: {
|
|
2471
|
+
// https://formly.dev/examples/validation/async-validation-update-on
|
|
2472
|
+
// Set to trigger value update on blurs with the form. However, the value is set internally too.
|
|
2473
|
+
updateOn: 'blur'
|
|
2474
|
+
} }, templateOptionsForFieldConfig(config, {
|
|
2475
|
+
minLength,
|
|
2476
|
+
maxLength
|
|
2477
|
+
})));
|
|
2478
|
+
return fieldConfig;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
class DbxFormRepeatArrayTypeComponent extends FieldArrayType {
|
|
2482
|
+
get repeatArrayField() {
|
|
2483
|
+
return this.field.repeatArrayField;
|
|
2484
|
+
}
|
|
2485
|
+
get label() {
|
|
2486
|
+
var _a;
|
|
2487
|
+
return (_a = this.field.templateOptions.label) !== null && _a !== void 0 ? _a : this.field.key;
|
|
1954
2488
|
}
|
|
1955
2489
|
get addText() {
|
|
1956
2490
|
var _a;
|
|
1957
|
-
return (_a = this.
|
|
2491
|
+
return (_a = this.repeatArrayField.addText) !== null && _a !== void 0 ? _a : 'Add';
|
|
1958
2492
|
}
|
|
1959
2493
|
get removeText() {
|
|
1960
2494
|
var _a;
|
|
1961
|
-
return (_a = this.
|
|
2495
|
+
return (_a = this.repeatArrayField.removeText) !== null && _a !== void 0 ? _a : 'Remove';
|
|
1962
2496
|
}
|
|
1963
2497
|
get max() {
|
|
1964
2498
|
var _a;
|
|
@@ -1977,53 +2511,87 @@ class DbxFormRepeatTypeComponent extends FieldArrayType {
|
|
|
1977
2511
|
return (this.count < max);
|
|
1978
2512
|
}
|
|
1979
2513
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2514
|
+
/**
|
|
2515
|
+
* Moves the target index up one value.
|
|
2516
|
+
*
|
|
2517
|
+
* @param index
|
|
2518
|
+
*/
|
|
2519
|
+
moveUp(index) {
|
|
2520
|
+
if (index === 0) {
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
this.swapIndexes(index, index - 1);
|
|
2524
|
+
}
|
|
2525
|
+
moveDown(index) {
|
|
2526
|
+
this.swapIndexes(index, index + 1);
|
|
2527
|
+
}
|
|
2528
|
+
swapIndexes(currentIndex, targetIndex) {
|
|
2529
|
+
const array = this.model;
|
|
2530
|
+
const targetValue = array[currentIndex];
|
|
2531
|
+
if (!targetValue) {
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
this.remove(currentIndex);
|
|
2535
|
+
this.add(targetIndex, targetValue);
|
|
2536
|
+
}
|
|
2537
|
+
drop(event) {
|
|
2538
|
+
this.swapIndexes(event.previousIndex, event.currentIndex);
|
|
2539
|
+
}
|
|
2540
|
+
labelForItem(field) {
|
|
2541
|
+
var _a;
|
|
2542
|
+
return getValueFromObjectOrGetter((_a = this.repeatArrayField.labelForField) !== null && _a !== void 0 ? _a : '', field);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
DbxFormRepeatArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormRepeatArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2546
|
+
DbxFormRepeatArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormRepeatArrayTypeComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
2547
|
+
<div class="dbx-form-repeat-array">
|
|
2548
|
+
<dbx-subsection [header]="label">
|
|
2549
|
+
<!-- Fields -->
|
|
2550
|
+
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2551
|
+
<div class="dbx-form-repeat-array-field" cdkDrag cdkDragLockAxis="y" *ngFor="let field of field.fieldGroup; let i = index; let last = last;">
|
|
2552
|
+
<div class="example-custom-placeholder" *cdkDragPlaceholder></div>
|
|
2553
|
+
<dbx-bar>
|
|
2554
|
+
<button cdkDragHandle mat-flat-button><mat-icon>drag_handle</mat-icon></button>
|
|
2555
|
+
<dbx-button-spacer></dbx-button-spacer>
|
|
2556
|
+
<h4><span class="repeat-array-number">{{ i + 1 }}</span><span>{{ labelForItem(field) }}</span></h4>
|
|
2557
|
+
<span class="dbx-spacer"></span>
|
|
2558
|
+
<button mat-flat-button color="warn" (click)="remove(i)">{{ removeText }}</button>
|
|
2559
|
+
</dbx-bar>
|
|
2560
|
+
<formly-field class="dbx-form-repeat-array-field-content" [field]="field"></formly-field>
|
|
1992
2561
|
</div>
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
<div class="form-repeat-section-footer">
|
|
2000
|
-
<button *ngIf="canAdd" mat-button (click)="add()">{{ addText }}</button>
|
|
2001
|
-
</div>
|
|
2562
|
+
</div>
|
|
2563
|
+
<!-- Add Button -->
|
|
2564
|
+
<div class="dbx-form-repeat-array-footer">
|
|
2565
|
+
<button *ngIf="canAdd" mat-raised-button (click)="add()">{{ addText }}</button>
|
|
2566
|
+
</div>
|
|
2567
|
+
</dbx-subsection>
|
|
2002
2568
|
</div>
|
|
2003
|
-
`, isInline: true, components: [{ type: i1$1.DbxButtonSpacerComponent, selector: "dbx-button-spacer" }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }, { type:
|
|
2004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2569
|
+
`, isInline: true, components: [{ type: i1$1.DbxSubSectionComponent, selector: "dbx-subsection" }, { type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$1.DbxButtonSpacerComponent, selector: "dbx-button-spacer" }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i5$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i5$1.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { type: i1$1.DbxBarDirective, selector: "dbx-bar", inputs: ["color"] }, { type: i5$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormRepeatArrayTypeComponent, decorators: [{
|
|
2005
2571
|
type: Component,
|
|
2006
2572
|
args: [{
|
|
2007
2573
|
template: `
|
|
2008
|
-
<div class="form-repeat-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
<
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
<
|
|
2015
|
-
|
|
2016
|
-
|
|
2574
|
+
<div class="dbx-form-repeat-array">
|
|
2575
|
+
<dbx-subsection [header]="label">
|
|
2576
|
+
<!-- Fields -->
|
|
2577
|
+
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2578
|
+
<div class="dbx-form-repeat-array-field" cdkDrag cdkDragLockAxis="y" *ngFor="let field of field.fieldGroup; let i = index; let last = last;">
|
|
2579
|
+
<div class="example-custom-placeholder" *cdkDragPlaceholder></div>
|
|
2580
|
+
<dbx-bar>
|
|
2581
|
+
<button cdkDragHandle mat-flat-button><mat-icon>drag_handle</mat-icon></button>
|
|
2582
|
+
<dbx-button-spacer></dbx-button-spacer>
|
|
2583
|
+
<h4><span class="repeat-array-number">{{ i + 1 }}</span><span>{{ labelForItem(field) }}</span></h4>
|
|
2584
|
+
<span class="dbx-spacer"></span>
|
|
2585
|
+
<button mat-flat-button color="warn" (click)="remove(i)">{{ removeText }}</button>
|
|
2586
|
+
</dbx-bar>
|
|
2587
|
+
<formly-field class="dbx-form-repeat-array-field-content" [field]="field"></formly-field>
|
|
2017
2588
|
</div>
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
<div class="form-repeat-section-footer">
|
|
2025
|
-
<button *ngIf="canAdd" mat-button (click)="add()">{{ addText }}</button>
|
|
2026
|
-
</div>
|
|
2589
|
+
</div>
|
|
2590
|
+
<!-- Add Button -->
|
|
2591
|
+
<div class="dbx-form-repeat-array-footer">
|
|
2592
|
+
<button *ngIf="canAdd" mat-raised-button (click)="add()">{{ addText }}</button>
|
|
2593
|
+
</div>
|
|
2594
|
+
</dbx-subsection>
|
|
2027
2595
|
</div>
|
|
2028
2596
|
`
|
|
2029
2597
|
}]
|
|
@@ -2031,25 +2599,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
2031
2599
|
|
|
2032
2600
|
class DbxFormFormlyArrayFieldModule {
|
|
2033
2601
|
}
|
|
2034
|
-
DbxFormFormlyArrayFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2035
|
-
DbxFormFormlyArrayFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
2602
|
+
DbxFormFormlyArrayFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyArrayFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2603
|
+
DbxFormFormlyArrayFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyArrayFieldModule, declarations: [DbxFormRepeatArrayTypeComponent], imports: [CommonModule,
|
|
2036
2604
|
MatFormFieldModule,
|
|
2037
2605
|
ReactiveFormsModule,
|
|
2038
2606
|
MatDividerModule,
|
|
2607
|
+
MatButtonModule,
|
|
2608
|
+
MatIconModule,
|
|
2609
|
+
DragDropModule,
|
|
2610
|
+
DbxSectionLayoutModule,
|
|
2611
|
+
DbxBarLayoutModule,
|
|
2039
2612
|
DbxButtonModule, i1$4.FormlyModule] });
|
|
2040
|
-
DbxFormFormlyArrayFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
2613
|
+
DbxFormFormlyArrayFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyArrayFieldModule, imports: [[
|
|
2041
2614
|
CommonModule,
|
|
2042
2615
|
MatFormFieldModule,
|
|
2043
2616
|
ReactiveFormsModule,
|
|
2044
2617
|
MatDividerModule,
|
|
2618
|
+
MatButtonModule,
|
|
2619
|
+
MatIconModule,
|
|
2620
|
+
DragDropModule,
|
|
2621
|
+
DbxSectionLayoutModule,
|
|
2622
|
+
DbxBarLayoutModule,
|
|
2045
2623
|
DbxButtonModule,
|
|
2046
2624
|
FormlyModule.forChild({
|
|
2047
2625
|
types: [
|
|
2048
|
-
{ name: '
|
|
2626
|
+
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2049
2627
|
]
|
|
2050
2628
|
})
|
|
2051
2629
|
]] });
|
|
2052
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyArrayFieldModule, decorators: [{
|
|
2053
2631
|
type: NgModule,
|
|
2054
2632
|
args: [{
|
|
2055
2633
|
imports: [
|
|
@@ -2057,26 +2635,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
2057
2635
|
MatFormFieldModule,
|
|
2058
2636
|
ReactiveFormsModule,
|
|
2059
2637
|
MatDividerModule,
|
|
2638
|
+
MatButtonModule,
|
|
2639
|
+
MatIconModule,
|
|
2640
|
+
DragDropModule,
|
|
2641
|
+
DbxSectionLayoutModule,
|
|
2642
|
+
DbxBarLayoutModule,
|
|
2060
2643
|
DbxButtonModule,
|
|
2061
2644
|
FormlyModule.forChild({
|
|
2062
2645
|
types: [
|
|
2063
|
-
{ name: '
|
|
2646
|
+
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2064
2647
|
]
|
|
2065
2648
|
})
|
|
2066
2649
|
],
|
|
2067
2650
|
declarations: [
|
|
2068
|
-
|
|
2651
|
+
DbxFormRepeatArrayTypeComponent
|
|
2069
2652
|
],
|
|
2070
2653
|
exports: []
|
|
2071
2654
|
}]
|
|
2072
2655
|
}] });
|
|
2073
2656
|
|
|
2657
|
+
function repeatArrayField(config) {
|
|
2658
|
+
const { key, repeatFieldGroup, maxLength, addText, removeText, labelForField } = config;
|
|
2659
|
+
return formlyField(Object.assign(Object.assign({ key, type: 'repeatarray', repeatArrayField: {
|
|
2660
|
+
labelForField,
|
|
2661
|
+
addText,
|
|
2662
|
+
removeText,
|
|
2663
|
+
} }, templateOptionsForFieldConfig(config, {
|
|
2664
|
+
maxLength
|
|
2665
|
+
})), { fieldArray: {
|
|
2666
|
+
fieldGroup: repeatFieldGroup
|
|
2667
|
+
} }));
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2074
2670
|
class DbxFormFormlyBooleanFieldModule {
|
|
2075
2671
|
}
|
|
2076
|
-
DbxFormFormlyBooleanFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2077
|
-
DbxFormFormlyBooleanFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
2078
|
-
DbxFormFormlyBooleanFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
2079
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2672
|
+
DbxFormFormlyBooleanFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyBooleanFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2673
|
+
DbxFormFormlyBooleanFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyBooleanFieldModule });
|
|
2674
|
+
DbxFormFormlyBooleanFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyBooleanFieldModule, imports: [[]] });
|
|
2675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyBooleanFieldModule, decorators: [{
|
|
2080
2676
|
type: NgModule,
|
|
2081
2677
|
args: [{
|
|
2082
2678
|
imports: [],
|
|
@@ -2085,33 +2681,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
2085
2681
|
}]
|
|
2086
2682
|
}] });
|
|
2087
2683
|
|
|
2088
|
-
function toggleField(
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
type: 'toggle',
|
|
2092
|
-
wrappers: ['autotouch', 'form-field'],
|
|
2093
|
-
defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false,
|
|
2094
|
-
templateOptions: {
|
|
2095
|
-
label,
|
|
2096
|
-
description,
|
|
2097
|
-
required,
|
|
2098
|
-
readonly
|
|
2099
|
-
}
|
|
2100
|
-
});
|
|
2684
|
+
function toggleField(config) {
|
|
2685
|
+
const { key, defaultValue } = config;
|
|
2686
|
+
return formlyField(Object.assign({ key, type: 'toggle', wrappers: ['autotouch', 'form-field'], defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false }, templateOptionsForFieldConfig(config)));
|
|
2101
2687
|
}
|
|
2102
|
-
function checkboxField(
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
type: 'checkbox',
|
|
2106
|
-
defaultValue,
|
|
2107
|
-
templateOptions: {
|
|
2108
|
-
label,
|
|
2109
|
-
placeholder,
|
|
2110
|
-
required,
|
|
2111
|
-
readonly,
|
|
2112
|
-
autocomplete
|
|
2113
|
-
},
|
|
2114
|
-
};
|
|
2688
|
+
function checkboxField(config) {
|
|
2689
|
+
const { key, defaultValue } = config;
|
|
2690
|
+
return formlyField(Object.assign({ key, type: 'checkbox', defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false }, templateOptionsForFieldConfig(config)));
|
|
2115
2691
|
}
|
|
2116
2692
|
/*
|
|
2117
2693
|
export function acceptTermsField({ key = 'accept', label = 'Accept Terms', description = 'In order to proceed, please accept terms', required = true }
|
|
@@ -2149,7 +2725,7 @@ var DateTimeFieldTimeMode;
|
|
|
2149
2725
|
*/
|
|
2150
2726
|
DateTimeFieldTimeMode["NONE"] = "none";
|
|
2151
2727
|
})(DateTimeFieldTimeMode || (DateTimeFieldTimeMode = {}));
|
|
2152
|
-
class DbxDateTimeFieldComponent extends FieldType {
|
|
2728
|
+
class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
2153
2729
|
constructor(cdRef) {
|
|
2154
2730
|
super();
|
|
2155
2731
|
this.cdRef = cdRef;
|
|
@@ -2166,7 +2742,7 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2166
2742
|
* Used to trigger/display visual updates (specifically on timeDistance, etc.).
|
|
2167
2743
|
*/
|
|
2168
2744
|
this.displayValue$ = interval(10 * 1000).pipe(startWith$1(0), map(_ => new Date().getMinutes()), distinctUntilChanged(), tap((_) => this.cdRef.markForCheck()), switchMap(_ => this.value$), shareReplay(1));
|
|
2169
|
-
this.timeString$ = this.value$.pipe(
|
|
2745
|
+
this.timeString$ = this.value$.pipe(filterMaybe(), map((x) => {
|
|
2170
2746
|
const timezone = guessCurrentTimezone();
|
|
2171
2747
|
const timeString = toReadableTimeString(x, timezone);
|
|
2172
2748
|
return timeString;
|
|
@@ -2181,53 +2757,67 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2181
2757
|
this.fullDay$ = this.fullDayControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith$1(control.value))));
|
|
2182
2758
|
this.showTimeInput$ = this.fullDay$.pipe(map(x => !x && this.timeMode !== DateTimeFieldTimeMode.NONE));
|
|
2183
2759
|
this.showAddTime$ = this.showTimeInput$.pipe(map(x => !x && this.timeMode === DateTimeFieldTimeMode.OPTIONAL), shareReplay(1));
|
|
2184
|
-
this.date$ = this._date.
|
|
2185
|
-
this.dateValue$ = merge(this.value$.pipe(startWith$1(undefined)), this.date$).pipe(
|
|
2186
|
-
this.timeInput$ = this._updateTime.pipe(debounceTime(5), map(
|
|
2187
|
-
this.config$ = this._config.pipe(
|
|
2760
|
+
this.date$ = this._date.asObservable();
|
|
2761
|
+
this.dateValue$ = merge(this.value$.pipe(startWith$1(undefined)), this.date$).pipe(map((x) => (x) ? startOfDay(x) : x), distinctUntilChanged((a, b) => Boolean(a && b) && isSameDay(a, b)), shareReplay(1));
|
|
2762
|
+
this.timeInput$ = this._updateTime.pipe(debounceTime$1(5), map(_ => this.timeInputCtrl.value), distinctUntilChanged());
|
|
2763
|
+
this.config$ = this._config.pipe(switchMapMaybeDefault(), shareReplay(1));
|
|
2188
2764
|
this.rawDateTime$ = combineLatest([
|
|
2189
|
-
this.dateValue
|
|
2765
|
+
this.dateValue$,
|
|
2190
2766
|
this.timeInput$.pipe(startWith$1(null)),
|
|
2191
2767
|
this.fullDay$
|
|
2192
2768
|
]).pipe(map(([date, timeString, fullDay]) => {
|
|
2769
|
+
var _a;
|
|
2193
2770
|
let result;
|
|
2194
|
-
if (
|
|
2195
|
-
if (
|
|
2196
|
-
|
|
2771
|
+
if (date) {
|
|
2772
|
+
if (fullDay) {
|
|
2773
|
+
if (this.dateTimeField.fullDayInUTC) {
|
|
2774
|
+
result = utcDayForDate(date);
|
|
2775
|
+
}
|
|
2776
|
+
else {
|
|
2777
|
+
result = startOfDay(date);
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
else if (timeString) {
|
|
2781
|
+
result = (_a = readableTimeStringToDate(timeString, {
|
|
2782
|
+
date,
|
|
2783
|
+
useSystemTimezone: true
|
|
2784
|
+
})) !== null && _a !== void 0 ? _a : date;
|
|
2197
2785
|
}
|
|
2198
2786
|
else {
|
|
2199
|
-
result =
|
|
2787
|
+
result = date;
|
|
2200
2788
|
}
|
|
2201
2789
|
}
|
|
2202
|
-
else if (timeString) {
|
|
2203
|
-
result = readableTimeStringToDate(timeString, {
|
|
2204
|
-
date,
|
|
2205
|
-
useSystemTimezone: true
|
|
2206
|
-
});
|
|
2207
|
-
}
|
|
2208
2790
|
return result;
|
|
2209
|
-
}),
|
|
2791
|
+
}), distinctUntilChanged((a, b) => Boolean(a && b) && isSameMinute(a, b)), shareReplay(1));
|
|
2210
2792
|
this.timeOutput$ = combineLatest([
|
|
2211
2793
|
this.rawDateTime$,
|
|
2212
2794
|
this._offset,
|
|
2213
2795
|
this.config$.pipe(distinctUntilChanged()),
|
|
2214
|
-
]).pipe(throttleTime(
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2796
|
+
]).pipe(throttleTime(40, undefined, { leading: false, trailing: true }), distinctUntilChanged((current, next) => current[0] === next[0] && next[1] === 0), tap(([_, stepsOffset]) => (stepsOffset) ? this._offset.next(0) : 0), map(([date, stepsOffset, config]) => {
|
|
2797
|
+
if (date != null) {
|
|
2798
|
+
const instance = new DateTimeMinuteInstance(Object.assign(Object.assign({ date }, config), { roundDownToMinute: true }));
|
|
2799
|
+
date = instance.limit(date);
|
|
2800
|
+
const minutes = stepsOffset * 5;
|
|
2801
|
+
date = addMinutes(date, minutes);
|
|
2802
|
+
}
|
|
2219
2803
|
return date;
|
|
2220
|
-
}), distinctUntilChanged((a, b) => a && b && isSameMinute(a, b)));
|
|
2804
|
+
}), distinctUntilChanged((a, b) => Boolean(a && b) && isSameMinute(a, b)), shareReplay(1));
|
|
2805
|
+
}
|
|
2806
|
+
get dateOnly() {
|
|
2807
|
+
return this.timeMode === DateTimeFieldTimeMode.NONE;
|
|
2808
|
+
}
|
|
2809
|
+
get dateTimeField() {
|
|
2810
|
+
return this.field.dateTimeField;
|
|
2221
2811
|
}
|
|
2222
2812
|
get timeOnly() {
|
|
2223
|
-
return this.
|
|
2813
|
+
return this.dateTimeField.timeOnly;
|
|
2224
2814
|
}
|
|
2225
2815
|
get showDateInput() {
|
|
2226
2816
|
return !this.timeOnly;
|
|
2227
2817
|
}
|
|
2228
2818
|
get timeMode() {
|
|
2229
2819
|
var _a;
|
|
2230
|
-
return (this.timeOnly) ? DateTimeFieldTimeMode.REQUIRED : ((_a = this.
|
|
2820
|
+
return (this.timeOnly) ? DateTimeFieldTimeMode.REQUIRED : ((_a = this.dateTimeField.timeMode) !== null && _a !== void 0 ? _a : DateTimeFieldTimeMode.REQUIRED);
|
|
2231
2821
|
}
|
|
2232
2822
|
get description() {
|
|
2233
2823
|
var _a;
|
|
@@ -2235,17 +2825,22 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2235
2825
|
}
|
|
2236
2826
|
ngOnInit() {
|
|
2237
2827
|
var _a, _b;
|
|
2828
|
+
super.ngOnInit();
|
|
2238
2829
|
this._formControlObs.next(this.formControl);
|
|
2239
|
-
this._config.next((_b = (_a = this.
|
|
2240
|
-
this._sub.subscription = this.timeOutput$.subscribe((value) => {
|
|
2830
|
+
this._config.next((_b = (_a = this.dateTimeField).getConfigObs) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
2831
|
+
this._sub.subscription = this.timeOutput$.pipe(skipFirstMaybe()).subscribe((value) => {
|
|
2241
2832
|
this.formControl.setValue(value);
|
|
2242
2833
|
this.formControl.markAsDirty();
|
|
2243
2834
|
this.formControl.markAsTouched();
|
|
2244
2835
|
});
|
|
2245
2836
|
this._valueSub.subscription = this.timeString$.subscribe((x) => {
|
|
2837
|
+
// Skip events where the timeInput value is cleared.
|
|
2838
|
+
if (!this.timeInputCtrl.value && x === '12:00AM') {
|
|
2839
|
+
return;
|
|
2840
|
+
}
|
|
2246
2841
|
this.timeInputCtrl.setValue(x);
|
|
2247
2842
|
});
|
|
2248
|
-
const isFullDayField = this.
|
|
2843
|
+
const isFullDayField = this.dateTimeField.fullDayFieldName;
|
|
2249
2844
|
let fullDayFieldCtrl;
|
|
2250
2845
|
if (isFullDayField) {
|
|
2251
2846
|
fullDayFieldCtrl = this.form.get(isFullDayField);
|
|
@@ -2259,7 +2854,7 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2259
2854
|
fullDayFieldCtrl = this._fullDayInputCtrl;
|
|
2260
2855
|
}
|
|
2261
2856
|
this._fullDayControlObs.next(fullDayFieldCtrl);
|
|
2262
|
-
switch (this.
|
|
2857
|
+
switch (this.dateTimeField.timeMode) {
|
|
2263
2858
|
case DateTimeFieldTimeMode.OPTIONAL:
|
|
2264
2859
|
break;
|
|
2265
2860
|
case DateTimeFieldTimeMode.NONE:
|
|
@@ -2271,6 +2866,7 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2271
2866
|
}
|
|
2272
2867
|
}
|
|
2273
2868
|
ngOnDestroy() {
|
|
2869
|
+
super.ngOnDestroy();
|
|
2274
2870
|
this._formControlObs.complete();
|
|
2275
2871
|
this._date.complete();
|
|
2276
2872
|
this._updateTime.complete();
|
|
@@ -2278,6 +2874,12 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2278
2874
|
this._sub.destroy();
|
|
2279
2875
|
this._valueSub.destroy();
|
|
2280
2876
|
}
|
|
2877
|
+
dateTextChanged(e) {
|
|
2878
|
+
const value = this.dateInput.value;
|
|
2879
|
+
if (value == null) {
|
|
2880
|
+
this._date.next(undefined);
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2281
2883
|
datePicked(event) {
|
|
2282
2884
|
const date = event.value;
|
|
2283
2885
|
if (date) {
|
|
@@ -2333,17 +2935,20 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
2333
2935
|
});
|
|
2334
2936
|
}
|
|
2335
2937
|
}
|
|
2336
|
-
DbxDateTimeFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2337
|
-
DbxDateTimeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
2338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2938
|
+
DbxDateTimeFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDateTimeFieldComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2939
|
+
DbxDateTimeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxDateTimeFieldComponent, selector: "ng-component", viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true, read: MatInput }], usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-datetime-field\" fxLayout=\"row wrap\" fxLayout.xs=\"column wrap\" fxLayoutAlign=\"space-evenly stretch\">\n <!-- Date -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" [fxFlex]=\"dateOnly ? '100' : '50'\" *ngIf=\"showDateInput\">\n <ng-container *ngTemplateOutlet=\"dateInputTemplate\"></ng-container>\n </div>\n <!-- Time -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" [fxFlex]=\"showDateInput ? '50' : '100'\">\n <ng-container *ngIf=\"showTimeInput$ | async\">\n <ng-container *ngTemplateOutlet=\"timeMenuAndInputTemplate\"></ng-container>\n </ng-container>\n <div class=\"add-time-button-wrapper\" *ngIf=\"showAddTime$ | async\">\n <button mat-button class=\"add-time-button\" ngClass.lt-sm=\"add-time-button-full\" (click)=\"addTime()\">\n <mat-icon>timer</mat-icon> Add Time\n </button>\n </div>\n </div>\n <div class=\"dbx-datetime-row dbx-datetime-hint-row\" fxFlex=\"100\">\n <div class=\"dbx-hint\" [ngSwitch]=\"fullDay$ | async\">\n <small *ngSwitchCase=\"true\"><b class=\"dbx-ok\">All Day</b> {{ dateValue$ | async | date:'fullDate' }}\n ({{ dateValue$ | async | dateDistance }})</small>\n <small *ngSwitchCase=\"false\">\n <ng-container *ngIf=\"value$ | async\"><b class=\"dbx-ok\">At</b> {{ displayValue$ | async | date:'medium' }}\n ({{ displayValue$ | async | timeDistance }})</ng-container>\n </small>\n </div>\n </div>\n</div>\n\n<!-- Date Input Template -->\n<ng-template #dateInputTemplate>\n <button mat-icon-button (click)=\"picker.open()\">\n <mat-icon>calendar_today</mat-icon>\n </button>\n <mat-form-field class=\"dbx-datetime-row-field\">\n <mat-label>Date</mat-label>\n <input #dateInput matInput [matDatepicker]=\"picker\" (change)=\"dateTextChanged($event)\"\n (dateChange)=\"datePicked($event)\" [value]=\"dateValue$ | async\">\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n</ng-template>\n\n<!-- Time Menu/Input Template -->\n<ng-template #timeMenuAndInputTemplate>\n <button mat-icon-button [matMenuTriggerFor]=\"timemenu\" aria-label=\"opens the time menu\">\n <mat-icon>timer</mat-icon>\n </button>\n <mat-menu #timemenu=\"matMenu\">\n <ng-container *ngIf=\"timeMode === 'optional'\">\n <button mat-menu-item (click)=\"removeTime()\">\n <span>Remove Time</span>\n </button>\n <mat-divider></mat-divider>\n </ng-container>\n <button mat-menu-item (click)=\"setTime('12:00AM')\">\n <span>Midnight</span>\n </button>\n <button mat-menu-item (click)=\"setTime('6:00AM')\">\n <span>6:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('8:00AM')\">\n <span>8:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('10:00AM')\">\n <span>10:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('12:00PM')\">\n <span>Noon</span>\n </button>\n <button mat-menu-item (click)=\"setTime('2:00PM')\">\n <span>2:00PM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('5:00PM')\">\n <span>5:00PM</span>\n </button>\n </mat-menu>\n <mat-form-field class=\"dbx-datetime-row-field\">\n <mat-label>Time</mat-label>\n <input #timeInput matInput [formControl]=\"timeInputCtrl\" (focus)=\"focusTime()\" (focusout)=\"focusOutTime()\"\n (keydown)=\"keydownOnInput($event)\">\n </mat-form-field>\n</ng-template>\n", components: [{ type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4$4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { type: i5$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i4$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i3$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$2.MatLabel, selector: "mat-label" }, { type: i6$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i4$4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i5$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i5.AsyncPipe, "date": i5.DatePipe, "dateDistance": i2.DateDistancePipe, "timeDistance": i2.TimeDistancePipe } });
|
|
2940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDateTimeFieldComponent, decorators: [{
|
|
2339
2941
|
type: Component,
|
|
2340
|
-
args: [{ template: "<div class=\"dbx-datetime-field\" fxLayout=\"row wrap\" fxLayout.xs=\"column wrap\" fxLayoutAlign=\"space-evenly stretch\">\n <!-- Date -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" fxFlex=\"50\" *ngIf=\"showDateInput\">\n <ng-container *ngTemplateOutlet=\"dateInputTemplate\"></ng-container>\n </div>\n <!-- Time -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" [fxFlex]=\"showDateInput ? 50 : 100\">\n <ng-container *ngIf=\"showTimeInput$ | async\">\n <ng-container *ngTemplateOutlet=\"timeMenuAndInputTemplate\"></ng-container>\n </ng-container>\n <div class=\"add-time-button-wrapper\" *ngIf=\"showAddTime$ | async\">\n <button mat-button class=\"add-time-button\" (click)=\"addTime()\">\n <mat-icon>timer</mat-icon> Add Time\n </button>\n </div>\n </div>\n <div class=\"dbx-datetime-row dbx-datetime-hint-row\" fxFlex=\"100\">\n <div class=\"dbx-hint\" [ngSwitch]=\"fullDay$ | async\">\n <small *ngSwitchCase=\"true\"><b class=\"dbx-ok\">All Day</b> {{ dateValue$ | async | date:'fullDate' }}\n ({{ dateValue$ | async | dateDistance }})</small>\n <small *ngSwitchCase=\"false\">\n <ng-container *ngIf=\"value$ | async\"><b class=\"dbx-ok\">At</b> {{ displayValue$ | async | date:'medium' }}\n ({{ displayValue$ | async | timeDistance }})</ng-container>\n </small>\n </div>\n
|
|
2341
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }
|
|
2942
|
+
args: [{ template: "<div class=\"dbx-datetime-field\" fxLayout=\"row wrap\" fxLayout.xs=\"column wrap\" fxLayoutAlign=\"space-evenly stretch\">\n <!-- Date -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" [fxFlex]=\"dateOnly ? '100' : '50'\" *ngIf=\"showDateInput\">\n <ng-container *ngTemplateOutlet=\"dateInputTemplate\"></ng-container>\n </div>\n <!-- Time -->\n <div class=\"dbx-datetime-row\" fxFlex.lt-sm=\"100\" [fxFlex]=\"showDateInput ? '50' : '100'\">\n <ng-container *ngIf=\"showTimeInput$ | async\">\n <ng-container *ngTemplateOutlet=\"timeMenuAndInputTemplate\"></ng-container>\n </ng-container>\n <div class=\"add-time-button-wrapper\" *ngIf=\"showAddTime$ | async\">\n <button mat-button class=\"add-time-button\" ngClass.lt-sm=\"add-time-button-full\" (click)=\"addTime()\">\n <mat-icon>timer</mat-icon> Add Time\n </button>\n </div>\n </div>\n <div class=\"dbx-datetime-row dbx-datetime-hint-row\" fxFlex=\"100\">\n <div class=\"dbx-hint\" [ngSwitch]=\"fullDay$ | async\">\n <small *ngSwitchCase=\"true\"><b class=\"dbx-ok\">All Day</b> {{ dateValue$ | async | date:'fullDate' }}\n ({{ dateValue$ | async | dateDistance }})</small>\n <small *ngSwitchCase=\"false\">\n <ng-container *ngIf=\"value$ | async\"><b class=\"dbx-ok\">At</b> {{ displayValue$ | async | date:'medium' }}\n ({{ displayValue$ | async | timeDistance }})</ng-container>\n </small>\n </div>\n </div>\n</div>\n\n<!-- Date Input Template -->\n<ng-template #dateInputTemplate>\n <button mat-icon-button (click)=\"picker.open()\">\n <mat-icon>calendar_today</mat-icon>\n </button>\n <mat-form-field class=\"dbx-datetime-row-field\">\n <mat-label>Date</mat-label>\n <input #dateInput matInput [matDatepicker]=\"picker\" (change)=\"dateTextChanged($event)\"\n (dateChange)=\"datePicked($event)\" [value]=\"dateValue$ | async\">\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n</ng-template>\n\n<!-- Time Menu/Input Template -->\n<ng-template #timeMenuAndInputTemplate>\n <button mat-icon-button [matMenuTriggerFor]=\"timemenu\" aria-label=\"opens the time menu\">\n <mat-icon>timer</mat-icon>\n </button>\n <mat-menu #timemenu=\"matMenu\">\n <ng-container *ngIf=\"timeMode === 'optional'\">\n <button mat-menu-item (click)=\"removeTime()\">\n <span>Remove Time</span>\n </button>\n <mat-divider></mat-divider>\n </ng-container>\n <button mat-menu-item (click)=\"setTime('12:00AM')\">\n <span>Midnight</span>\n </button>\n <button mat-menu-item (click)=\"setTime('6:00AM')\">\n <span>6:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('8:00AM')\">\n <span>8:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('10:00AM')\">\n <span>10:00AM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('12:00PM')\">\n <span>Noon</span>\n </button>\n <button mat-menu-item (click)=\"setTime('2:00PM')\">\n <span>2:00PM</span>\n </button>\n <button mat-menu-item (click)=\"setTime('5:00PM')\">\n <span>5:00PM</span>\n </button>\n </mat-menu>\n <mat-form-field class=\"dbx-datetime-row-field\">\n <mat-label>Time</mat-label>\n <input #timeInput matInput [formControl]=\"timeInputCtrl\" (focus)=\"focusTime()\" (focusout)=\"focusOutTime()\"\n (keydown)=\"keydownOnInput($event)\">\n </mat-form-field>\n</ng-template>\n" }]
|
|
2943
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { dateInput: [{
|
|
2944
|
+
type: ViewChild,
|
|
2945
|
+
args: ['dateInput', { read: MatInput }]
|
|
2946
|
+
}] } });
|
|
2342
2947
|
|
|
2343
2948
|
class DbxFormFormlyDateFieldModule {
|
|
2344
2949
|
}
|
|
2345
|
-
DbxFormFormlyDateFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2346
|
-
DbxFormFormlyDateFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
2950
|
+
DbxFormFormlyDateFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyDateFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2951
|
+
DbxFormFormlyDateFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyDateFieldModule, declarations: [DbxDateTimeFieldComponent], imports: [CommonModule,
|
|
2347
2952
|
FormsModule,
|
|
2348
2953
|
MatInputModule,
|
|
2349
2954
|
MatDividerModule,
|
|
@@ -2356,8 +2961,8 @@ DbxFormFormlyDateFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.
|
|
|
2356
2961
|
DbxDatePipeModule,
|
|
2357
2962
|
MatChipsModule,
|
|
2358
2963
|
MatIconModule,
|
|
2359
|
-
FlexLayoutModule, i1$4.FormlyModule] });
|
|
2360
|
-
DbxFormFormlyDateFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
2964
|
+
FlexLayoutModule, i1$4.FormlyModule], exports: [DbxFormFormlyWrapperModule] });
|
|
2965
|
+
DbxFormFormlyDateFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyDateFieldModule, imports: [[
|
|
2361
2966
|
CommonModule,
|
|
2362
2967
|
FormsModule,
|
|
2363
2968
|
MatInputModule,
|
|
@@ -2374,11 +2979,11 @@ DbxFormFormlyDateFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.
|
|
|
2374
2979
|
FlexLayoutModule,
|
|
2375
2980
|
FormlyModule.forChild({
|
|
2376
2981
|
types: [
|
|
2377
|
-
{ name: 'datetime', component: DbxDateTimeFieldComponent }
|
|
2982
|
+
{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }
|
|
2378
2983
|
]
|
|
2379
2984
|
})
|
|
2380
|
-
]] });
|
|
2381
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
2985
|
+
], DbxFormFormlyWrapperModule] });
|
|
2986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyDateFieldModule, decorators: [{
|
|
2382
2987
|
type: NgModule,
|
|
2383
2988
|
args: [{
|
|
2384
2989
|
imports: [
|
|
@@ -2398,14 +3003,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
2398
3003
|
FlexLayoutModule,
|
|
2399
3004
|
FormlyModule.forChild({
|
|
2400
3005
|
types: [
|
|
2401
|
-
{ name: 'datetime', component: DbxDateTimeFieldComponent }
|
|
3006
|
+
{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }
|
|
2402
3007
|
]
|
|
2403
3008
|
})
|
|
2404
3009
|
],
|
|
2405
3010
|
declarations: [
|
|
2406
3011
|
DbxDateTimeFieldComponent
|
|
2407
3012
|
],
|
|
2408
|
-
exports: [
|
|
3013
|
+
exports: [
|
|
3014
|
+
DbxFormFormlyWrapperModule
|
|
3015
|
+
]
|
|
2409
3016
|
}]
|
|
2410
3017
|
}] });
|
|
2411
3018
|
|
|
@@ -2419,22 +3026,16 @@ const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS = () => of({
|
|
|
2419
3026
|
function timeOnlyField(config) {
|
|
2420
3027
|
return dateTimeField(Object.assign(Object.assign({}, config), { timeMode: DateTimeFieldTimeMode.REQUIRED, timeOnly: true }));
|
|
2421
3028
|
}
|
|
2422
|
-
function dateTimeField(
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
placeholder,
|
|
2433
|
-
required,
|
|
2434
|
-
description
|
|
2435
|
-
},
|
|
2436
|
-
});
|
|
2437
|
-
// TODO: Add configuration...
|
|
3029
|
+
function dateTimeField(config) {
|
|
3030
|
+
const { key = 'date', timeMode = DateTimeFieldTimeMode.REQUIRED, fullDayFieldName, getConfigObs, timeOnly = false } = config;
|
|
3031
|
+
const fieldConfig = formlyField(Object.assign(Object.assign({ key, type: 'datetime', dateTimeField: {
|
|
3032
|
+
timeMode: (timeOnly) ? DateTimeFieldTimeMode.REQUIRED : timeMode,
|
|
3033
|
+
fullDayFieldName,
|
|
3034
|
+
getConfigObs,
|
|
3035
|
+
timeOnly,
|
|
3036
|
+
} }, templateOptionsForFieldConfig(config)), { styleWrapper: {
|
|
3037
|
+
style: 'dbx-datetime-parent-form-field'
|
|
3038
|
+
} }));
|
|
2438
3039
|
return fieldConfig;
|
|
2439
3040
|
}
|
|
2440
3041
|
|
|
@@ -2455,64 +3056,61 @@ function staticEnumField({ key, label = '', placeholder = '', description, multi
|
|
|
2455
3056
|
return fieldConfig;
|
|
2456
3057
|
}
|
|
2457
3058
|
|
|
3059
|
+
class DbxFormFormlyEnumFieldModule {
|
|
3060
|
+
}
|
|
3061
|
+
DbxFormFormlyEnumFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyEnumFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3062
|
+
DbxFormFormlyEnumFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyEnumFieldModule });
|
|
3063
|
+
DbxFormFormlyEnumFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyEnumFieldModule, imports: [[]] });
|
|
3064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyEnumFieldModule, decorators: [{
|
|
3065
|
+
type: NgModule,
|
|
3066
|
+
args: [{
|
|
3067
|
+
imports: [],
|
|
3068
|
+
declarations: [],
|
|
3069
|
+
exports: []
|
|
3070
|
+
}]
|
|
3071
|
+
}] });
|
|
3072
|
+
|
|
2458
3073
|
// TODO: Finish dynamic.enum before adding in
|
|
2459
3074
|
|
|
2460
3075
|
const DEFAULT_PREFERRED_COUNTRIES = ['us'];
|
|
2461
|
-
class
|
|
2462
|
-
get
|
|
2463
|
-
return this.
|
|
2464
|
-
}
|
|
2465
|
-
get fieldFormGroup() {
|
|
2466
|
-
return this.form;
|
|
2467
|
-
}
|
|
2468
|
-
get label() {
|
|
2469
|
-
return this.field.templateOptions.label;
|
|
2470
|
-
}
|
|
2471
|
-
get placeholder() {
|
|
2472
|
-
return this.field.templateOptions.placeholder;
|
|
2473
|
-
}
|
|
2474
|
-
get description() {
|
|
2475
|
-
return this.field.templateOptions.description;
|
|
3076
|
+
class DbxPhoneFieldComponent extends FieldType$1 {
|
|
3077
|
+
get phoneField() {
|
|
3078
|
+
return this.field.phoneField;
|
|
2476
3079
|
}
|
|
2477
3080
|
get preferredCountries() {
|
|
2478
3081
|
var _a;
|
|
2479
|
-
return (_a = this.
|
|
3082
|
+
return (_a = this.phoneField.preferredCountries) !== null && _a !== void 0 ? _a : DEFAULT_PREFERRED_COUNTRIES;
|
|
2480
3083
|
}
|
|
2481
3084
|
get onlyCountries() {
|
|
2482
3085
|
var _a;
|
|
2483
|
-
return (_a = this.
|
|
2484
|
-
}
|
|
2485
|
-
get required() {
|
|
2486
|
-
var _a;
|
|
2487
|
-
return (_a = this.field.templateOptions.required) !== null && _a !== void 0 ? _a : false;
|
|
2488
|
-
}
|
|
2489
|
-
get errors() {
|
|
2490
|
-
var _a;
|
|
2491
|
-
return (_a = this.field.formControl) === null || _a === void 0 ? void 0 : _a.errors;
|
|
3086
|
+
return (_a = this.phoneField.onlyCountries) !== null && _a !== void 0 ? _a : [];
|
|
2492
3087
|
}
|
|
2493
3088
|
}
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3089
|
+
DbxPhoneFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPhoneFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3090
|
+
DbxPhoneFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxPhoneFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\"\n [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"formControl\">\n</ngx-mat-intl-tel-input>\n", components: [{ type: i1$6.NgxMatIntlTelInputComponent, selector: "ngx-mat-intl-tel-input", inputs: ["preferredCountries", "enablePlaceholder", "inputPlaceholder", "cssClass", "name", "onlyCountries", "errorStateMatcher", "enableSearch", "searchPlaceholder", "describedBy", "format", "placeholder", "required", "disabled"], outputs: ["countryChanged"] }], directives: [{ type: i4$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
3091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxPhoneFieldComponent, decorators: [{
|
|
2497
3092
|
type: Component,
|
|
2498
|
-
args: [{ template: "<
|
|
3093
|
+
args: [{ template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\"\n [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"formControl\">\n</ngx-mat-intl-tel-input>\n" }]
|
|
2499
3094
|
}] });
|
|
2500
3095
|
|
|
2501
3096
|
class DbxFormFormlyPhoneFieldModule {
|
|
2502
3097
|
}
|
|
2503
|
-
DbxFormFormlyPhoneFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2504
|
-
DbxFormFormlyPhoneFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
3098
|
+
DbxFormFormlyPhoneFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPhoneFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3099
|
+
DbxFormFormlyPhoneFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPhoneFieldModule, declarations: [DbxPhoneFieldComponent], imports: [CommonModule,
|
|
2505
3100
|
MatInputModule,
|
|
3101
|
+
MatFormFieldModule,
|
|
2506
3102
|
FormsModule,
|
|
2507
3103
|
NgxMatIntlTelInputModule,
|
|
2508
3104
|
ReactiveFormsModule,
|
|
2509
3105
|
MatAutocompleteModule,
|
|
2510
3106
|
MatChipsModule,
|
|
2511
3107
|
MatIconModule,
|
|
2512
|
-
FlexLayoutModule,
|
|
2513
|
-
|
|
3108
|
+
FlexLayoutModule,
|
|
3109
|
+
FormlyMatFormFieldModule, i1$4.FormlyModule] });
|
|
3110
|
+
DbxFormFormlyPhoneFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPhoneFieldModule, imports: [[
|
|
2514
3111
|
CommonModule,
|
|
2515
3112
|
MatInputModule,
|
|
3113
|
+
MatFormFieldModule,
|
|
2516
3114
|
FormsModule,
|
|
2517
3115
|
NgxMatIntlTelInputModule,
|
|
2518
3116
|
ReactiveFormsModule,
|
|
@@ -2520,18 +3118,20 @@ DbxFormFormlyPhoneFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12
|
|
|
2520
3118
|
MatChipsModule,
|
|
2521
3119
|
MatIconModule,
|
|
2522
3120
|
FlexLayoutModule,
|
|
3121
|
+
FormlyMatFormFieldModule,
|
|
2523
3122
|
FormlyModule.forChild({
|
|
2524
3123
|
types: [
|
|
2525
|
-
{ name: 'intphone', component:
|
|
3124
|
+
{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }
|
|
2526
3125
|
]
|
|
2527
3126
|
})
|
|
2528
3127
|
]] });
|
|
2529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyPhoneFieldModule, decorators: [{
|
|
2530
3129
|
type: NgModule,
|
|
2531
3130
|
args: [{
|
|
2532
3131
|
imports: [
|
|
2533
3132
|
CommonModule,
|
|
2534
3133
|
MatInputModule,
|
|
3134
|
+
MatFormFieldModule,
|
|
2535
3135
|
FormsModule,
|
|
2536
3136
|
NgxMatIntlTelInputModule,
|
|
2537
3137
|
ReactiveFormsModule,
|
|
@@ -2539,19 +3139,155 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
2539
3139
|
MatChipsModule,
|
|
2540
3140
|
MatIconModule,
|
|
2541
3141
|
FlexLayoutModule,
|
|
3142
|
+
FormlyMatFormFieldModule,
|
|
2542
3143
|
FormlyModule.forChild({
|
|
2543
3144
|
types: [
|
|
2544
|
-
{ name: 'intphone', component:
|
|
3145
|
+
{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }
|
|
2545
3146
|
]
|
|
2546
3147
|
})
|
|
2547
3148
|
],
|
|
2548
3149
|
declarations: [
|
|
2549
|
-
|
|
3150
|
+
DbxPhoneFieldComponent
|
|
2550
3151
|
],
|
|
2551
3152
|
exports: []
|
|
2552
3153
|
}]
|
|
2553
3154
|
}] });
|
|
2554
3155
|
|
|
3156
|
+
const EXPANDABLE_WRAPPER_KEY = 'expandable';
|
|
3157
|
+
const TOGGLE_WRAPPER_KEY = 'toggle';
|
|
3158
|
+
const SECTION_WRAPPER_KEY = 'section';
|
|
3159
|
+
const SUBSECTION_WRAPPER_KEY = 'subsection';
|
|
3160
|
+
const INFO_WRAPPER_KEY = 'info';
|
|
3161
|
+
const FLEX_WRAPPER_KEY = 'flex';
|
|
3162
|
+
const STYLE_WRAPPER_KEY = 'style';
|
|
3163
|
+
function addWrapperToFormlyFieldConfig(fieldConfig, wrapperKey, wrapperTemplateOptionsConfig) {
|
|
3164
|
+
fieldConfig.templateOptions = Object.assign(Object.assign({}, fieldConfig.templateOptions), wrapperTemplateOptionsConfig);
|
|
3165
|
+
return {
|
|
3166
|
+
wrappers: [wrapperKey],
|
|
3167
|
+
templateOptions: wrapperTemplateOptionsConfig,
|
|
3168
|
+
fieldGroup: [fieldConfig]
|
|
3169
|
+
};
|
|
3170
|
+
}
|
|
3171
|
+
function expandWrapper(fieldConfig, expandWrapper) {
|
|
3172
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, EXPANDABLE_WRAPPER_KEY, {
|
|
3173
|
+
expandWrapper
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
3176
|
+
function toggleWrapper(fieldConfig, expandWrapper) {
|
|
3177
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, TOGGLE_WRAPPER_KEY, {
|
|
3178
|
+
expandWrapper
|
|
3179
|
+
});
|
|
3180
|
+
}
|
|
3181
|
+
function sectionWrapper(fieldConfig, sectionWrapper) {
|
|
3182
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, SECTION_WRAPPER_KEY, {
|
|
3183
|
+
sectionWrapper
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
function subsectionWrapper(fieldConfig, subsectionWrapper) {
|
|
3187
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, SUBSECTION_WRAPPER_KEY, {
|
|
3188
|
+
subsectionWrapper
|
|
3189
|
+
});
|
|
3190
|
+
}
|
|
3191
|
+
function infoWrapper(fieldConfig, infoWrapper) {
|
|
3192
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, INFO_WRAPPER_KEY, {
|
|
3193
|
+
infoWrapper
|
|
3194
|
+
});
|
|
3195
|
+
}
|
|
3196
|
+
function styleWrapper(fieldConfig, styleWrapper) {
|
|
3197
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, STYLE_WRAPPER_KEY, {
|
|
3198
|
+
styleWrapper
|
|
3199
|
+
});
|
|
3200
|
+
}
|
|
3201
|
+
function checkIsFieldFlexLayoutGroupFieldConfig(input) {
|
|
3202
|
+
if (input.field != null) {
|
|
3203
|
+
return true;
|
|
3204
|
+
}
|
|
3205
|
+
else {
|
|
3206
|
+
return false;
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
function flexLayoutWrapper(fieldConfigs, { relative, breakpoint, size: defaultSize = 2 } = {}) {
|
|
3210
|
+
return {
|
|
3211
|
+
wrappers: ['flex'],
|
|
3212
|
+
fieldGroupClassName: 'dbx-flex-group',
|
|
3213
|
+
// fieldGroupClassName: 'field-layout-group',
|
|
3214
|
+
templateOptions: {
|
|
3215
|
+
flexWrapper: {
|
|
3216
|
+
breakpoint,
|
|
3217
|
+
relative
|
|
3218
|
+
}
|
|
3219
|
+
},
|
|
3220
|
+
fieldGroup: fieldConfigs.map((inputConfig) => {
|
|
3221
|
+
const fieldConfig = checkIsFieldFlexLayoutGroupFieldConfig(inputConfig) ? inputConfig : {
|
|
3222
|
+
field: inputConfig
|
|
3223
|
+
};
|
|
3224
|
+
const { field, size = defaultSize } = fieldConfig;
|
|
3225
|
+
const className = `dbx-flex-${size}`;
|
|
3226
|
+
return Object.assign(Object.assign({}, field), { className });
|
|
3227
|
+
})
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
function textField(config) {
|
|
3232
|
+
const { key, pattern, minLength, maxLength = 1000 } = config;
|
|
3233
|
+
return formlyField(Object.assign({ key, type: 'input' }, templateOptionsForFieldConfig(config, {
|
|
3234
|
+
minLength,
|
|
3235
|
+
maxLength,
|
|
3236
|
+
pattern
|
|
3237
|
+
})));
|
|
3238
|
+
}
|
|
3239
|
+
function textAreaField(config) {
|
|
3240
|
+
const { key, rows = 3, minLength, maxLength = 1000 } = config;
|
|
3241
|
+
return formlyField(Object.assign({ key, type: 'textarea' }, templateOptionsForFieldConfig(config, {
|
|
3242
|
+
rows,
|
|
3243
|
+
minLength,
|
|
3244
|
+
maxLength,
|
|
3245
|
+
})));
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
function phoneField(config = {}) {
|
|
3249
|
+
const { key = 'phone', preferredCountries, onlyCountries } = config;
|
|
3250
|
+
const fieldConfig = formlyField(Object.assign({ key, type: 'intphone', phoneField: {
|
|
3251
|
+
preferredCountries,
|
|
3252
|
+
onlyCountries
|
|
3253
|
+
} }, templateOptionsForFieldConfig(config)));
|
|
3254
|
+
return fieldConfig;
|
|
3255
|
+
}
|
|
3256
|
+
/**
|
|
3257
|
+
* Puts a phone and
|
|
3258
|
+
* @param param0
|
|
3259
|
+
* @returns
|
|
3260
|
+
*/
|
|
3261
|
+
function wrappedPhoneAndLabelField({ phoneField: phone, labelField: label } = {}) {
|
|
3262
|
+
return flexLayoutWrapper([
|
|
3263
|
+
{
|
|
3264
|
+
field: phoneField(phone),
|
|
3265
|
+
size: 2
|
|
3266
|
+
},
|
|
3267
|
+
{
|
|
3268
|
+
field: textField(Object.assign({ key: 'label', label: 'Label', autocomplete: 'phone-label' }, label)),
|
|
3269
|
+
size: 4
|
|
3270
|
+
}
|
|
3271
|
+
], { relative: true });
|
|
3272
|
+
}
|
|
3273
|
+
function phoneAndLabelSectionField({ key, header = 'Phone Number', hint, phoneField, labelField } = {}) {
|
|
3274
|
+
return sectionWrapper({
|
|
3275
|
+
key,
|
|
3276
|
+
fieldGroup: [wrappedPhoneAndLabelField({ phoneField, labelField })]
|
|
3277
|
+
}, {
|
|
3278
|
+
header,
|
|
3279
|
+
hint
|
|
3280
|
+
});
|
|
3281
|
+
}
|
|
3282
|
+
function phoneListField(repeatConfig = {}) {
|
|
3283
|
+
const { key = 'phones', label = 'Phone Numbers', addText = 'Add Phone Number', removeText = 'Remove Phone Number', repeatFieldGroup, phoneAndLabel } = repeatConfig;
|
|
3284
|
+
return repeatArrayField(Object.assign(Object.assign({}, repeatConfig), { key,
|
|
3285
|
+
label,
|
|
3286
|
+
addText,
|
|
3287
|
+
removeText, repeatFieldGroup: repeatFieldGroup !== null && repeatFieldGroup !== void 0 ? repeatFieldGroup : [wrappedPhoneAndLabelField(phoneAndLabel)] }));
|
|
3288
|
+
}
|
|
3289
|
+
;
|
|
3290
|
+
|
|
2555
3291
|
const PHONE_LABEL_MAX_LENGTH = 100;
|
|
2556
3292
|
const ADDRESS_COUNTRY_MAX_LENGTH = 80;
|
|
2557
3293
|
const ADDRESS_CITY_MAX_LENGTH = 80;
|
|
@@ -2559,37 +3295,6 @@ const ADDRESS_STATE_MAX_LENGTH = 80;
|
|
|
2559
3295
|
const ADDRESS_ZIP_MAX_LENGTH = 20;
|
|
2560
3296
|
const LABEL_STRING_MAX_LENGTH = 100;
|
|
2561
3297
|
const SEARCH_STRING_MAX_LENGTH = 100;
|
|
2562
|
-
function textField({ key, label = '', placeholder = '', required = false, attributes, readonly, autocomplete, minLength, maxLength, pattern }) {
|
|
2563
|
-
return formlyField({
|
|
2564
|
-
key,
|
|
2565
|
-
type: 'input',
|
|
2566
|
-
templateOptions: {
|
|
2567
|
-
label,
|
|
2568
|
-
placeholder,
|
|
2569
|
-
required,
|
|
2570
|
-
minLength,
|
|
2571
|
-
maxLength,
|
|
2572
|
-
pattern,
|
|
2573
|
-
readonly,
|
|
2574
|
-
attributes: Object.assign(Object.assign({}, attributes), (autocomplete) ? { autocomplete } : undefined)
|
|
2575
|
-
}
|
|
2576
|
-
});
|
|
2577
|
-
}
|
|
2578
|
-
function textAreaField({ key, label = '', placeholder = '', rows = 3, required = false, minLength, maxLength = 1000, attributes }) {
|
|
2579
|
-
return formlyField({
|
|
2580
|
-
key,
|
|
2581
|
-
type: 'textarea',
|
|
2582
|
-
templateOptions: {
|
|
2583
|
-
label,
|
|
2584
|
-
placeholder,
|
|
2585
|
-
required,
|
|
2586
|
-
rows,
|
|
2587
|
-
minLength,
|
|
2588
|
-
maxLength,
|
|
2589
|
-
attributes
|
|
2590
|
-
}
|
|
2591
|
-
});
|
|
2592
|
-
}
|
|
2593
3298
|
function nameField({ key = 'name', label = 'Name', placeholder = 'John Doe', required = false, minLength, maxLength, attributes } = {}) {
|
|
2594
3299
|
return textField({
|
|
2595
3300
|
key,
|
|
@@ -2601,7 +3306,7 @@ function nameField({ key = 'name', label = 'Name', placeholder = 'John Doe', req
|
|
|
2601
3306
|
attributes
|
|
2602
3307
|
});
|
|
2603
3308
|
}
|
|
2604
|
-
function emailField({ key = 'email', label = 'Email Address', placeholder = 'person@email.com', description = '', required = false, readonly = false }) {
|
|
3309
|
+
function emailField({ key = 'email', label = 'Email Address', placeholder = 'person@email.com', description = '', required = false, readonly = false } = {}) {
|
|
2605
3310
|
return formlyField({
|
|
2606
3311
|
key,
|
|
2607
3312
|
type: 'input',
|
|
@@ -2612,11 +3317,6 @@ function emailField({ key = 'email', label = 'Email Address', placeholder = 'per
|
|
|
2612
3317
|
required,
|
|
2613
3318
|
readonly
|
|
2614
3319
|
},
|
|
2615
|
-
validation: {
|
|
2616
|
-
messages: {
|
|
2617
|
-
required: `Email is required.`
|
|
2618
|
-
}
|
|
2619
|
-
},
|
|
2620
3320
|
validators: {
|
|
2621
3321
|
email: {
|
|
2622
3322
|
expression: (c) => !Validators.email(c),
|
|
@@ -2625,7 +3325,7 @@ function emailField({ key = 'email', label = 'Email Address', placeholder = 'per
|
|
|
2625
3325
|
},
|
|
2626
3326
|
});
|
|
2627
3327
|
}
|
|
2628
|
-
function cityField({ key = 'city', required = false }) {
|
|
3328
|
+
function cityField({ key = 'city', required = false } = {}) {
|
|
2629
3329
|
return textField({
|
|
2630
3330
|
key,
|
|
2631
3331
|
label: 'City',
|
|
@@ -2635,116 +3335,37 @@ function cityField({ key = 'city', required = false }) {
|
|
|
2635
3335
|
maxLength: ADDRESS_CITY_MAX_LENGTH
|
|
2636
3336
|
});
|
|
2637
3337
|
}
|
|
2638
|
-
function stateField({ key = 'state', required = false }) {
|
|
3338
|
+
function stateField({ key = 'state', required = false } = {}) {
|
|
2639
3339
|
return textField({
|
|
2640
3340
|
key,
|
|
2641
3341
|
label: 'State',
|
|
2642
3342
|
placeholder: '',
|
|
2643
3343
|
required,
|
|
2644
|
-
|
|
2645
|
-
autocomplete: 'state'
|
|
2646
|
-
},
|
|
3344
|
+
autocomplete: 'state',
|
|
2647
3345
|
maxLength: ADDRESS_STATE_MAX_LENGTH
|
|
2648
3346
|
});
|
|
2649
3347
|
}
|
|
2650
|
-
function countryField({ key = 'country', required = false }) {
|
|
3348
|
+
function countryField({ key = 'country', required = false } = {}) {
|
|
2651
3349
|
return textField({
|
|
2652
3350
|
key,
|
|
2653
3351
|
label: 'Country',
|
|
2654
3352
|
placeholder: '',
|
|
2655
3353
|
required,
|
|
2656
|
-
|
|
2657
|
-
autocomplete: 'country'
|
|
2658
|
-
},
|
|
3354
|
+
autocomplete: 'country',
|
|
2659
3355
|
maxLength: ADDRESS_COUNTRY_MAX_LENGTH
|
|
2660
3356
|
});
|
|
2661
3357
|
}
|
|
2662
|
-
function zipCodeField({ key = 'zip', required = false }) {
|
|
3358
|
+
function zipCodeField({ key = 'zip', required = false } = {}) {
|
|
2663
3359
|
return textField({
|
|
2664
3360
|
key,
|
|
2665
3361
|
label: 'Zip Code',
|
|
2666
3362
|
placeholder: '',
|
|
2667
3363
|
required,
|
|
2668
|
-
|
|
2669
|
-
autocomplete: 'postal-code'
|
|
2670
|
-
},
|
|
3364
|
+
autocomplete: 'postal-code',
|
|
2671
3365
|
maxLength: ADDRESS_ZIP_MAX_LENGTH
|
|
2672
3366
|
});
|
|
2673
3367
|
}
|
|
2674
3368
|
|
|
2675
|
-
function flexLayoutWrapper(fieldConfigs, { size: defaultSize = 2, retainSizeOnSmallScreen } = {}) {
|
|
2676
|
-
const defaultRetainSizeOnSmallScreen = retainSizeOnSmallScreen;
|
|
2677
|
-
return {
|
|
2678
|
-
wrappers: ['flex'],
|
|
2679
|
-
fieldGroupClassName: 'form-flex-section-group',
|
|
2680
|
-
// fieldGroupClassName: 'field-layout-group',
|
|
2681
|
-
fieldGroup: fieldConfigs.map((config) => {
|
|
2682
|
-
const { field, size = defaultSize, retainSizeOnSmallScreen = defaultRetainSizeOnSmallScreen } = config;
|
|
2683
|
-
let className = `form-flex-${size}`;
|
|
2684
|
-
if (retainSizeOnSmallScreen != false) {
|
|
2685
|
-
className = className + ' form-flex-responsive';
|
|
2686
|
-
}
|
|
2687
|
-
return Object.assign(Object.assign({}, field), { className });
|
|
2688
|
-
})
|
|
2689
|
-
};
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
function internationalPhoneField({ key, label = '', placeholder = '', required = false }) {
|
|
2693
|
-
const fieldConfig = formlyField({
|
|
2694
|
-
key,
|
|
2695
|
-
type: 'intphone',
|
|
2696
|
-
templateOptions: {
|
|
2697
|
-
label,
|
|
2698
|
-
placeholder,
|
|
2699
|
-
required
|
|
2700
|
-
}
|
|
2701
|
-
});
|
|
2702
|
-
// TODO: Add configuration...
|
|
2703
|
-
return fieldConfig;
|
|
2704
|
-
}
|
|
2705
|
-
function phoneAndLabelFields({ phoneField: phone, labelField: label }) {
|
|
2706
|
-
return [
|
|
2707
|
-
flexLayoutWrapper([
|
|
2708
|
-
{
|
|
2709
|
-
field: internationalPhoneField(Object.assign({ key: 'phone' }, phone))
|
|
2710
|
-
},
|
|
2711
|
-
{
|
|
2712
|
-
field: textField(Object.assign({ key: 'label', label: 'Label', autocomplete: 'phone-label' }, label))
|
|
2713
|
-
}
|
|
2714
|
-
])
|
|
2715
|
-
];
|
|
2716
|
-
}
|
|
2717
|
-
function phoneAndLabelFieldGroup({ key = 'phone', label = 'Phone Number', required, phoneField, labelField }) {
|
|
2718
|
-
return {
|
|
2719
|
-
key,
|
|
2720
|
-
wrappers: ['section'],
|
|
2721
|
-
templateOptions: {
|
|
2722
|
-
label,
|
|
2723
|
-
required
|
|
2724
|
-
},
|
|
2725
|
-
fieldGroup: phoneAndLabelFields({ phoneField, labelField })
|
|
2726
|
-
};
|
|
2727
|
-
}
|
|
2728
|
-
function phoneListField({ key = 'phones', label = 'Phone Numbers', repeatSection, required = false, maxPhones = 6, phoneField, labelField }) {
|
|
2729
|
-
return {
|
|
2730
|
-
key,
|
|
2731
|
-
type: 'repeat',
|
|
2732
|
-
wrappers: ['section'],
|
|
2733
|
-
templateOptions: {
|
|
2734
|
-
label,
|
|
2735
|
-
required,
|
|
2736
|
-
repeatSection: repeatSection !== null && repeatSection !== void 0 ? repeatSection : {
|
|
2737
|
-
addText: 'Add Phone Number',
|
|
2738
|
-
removeText: 'Remove Phone Number'
|
|
2739
|
-
},
|
|
2740
|
-
maxLength: maxPhones
|
|
2741
|
-
},
|
|
2742
|
-
fieldArray: {
|
|
2743
|
-
fieldGroup: phoneAndLabelFields({ phoneField, labelField })
|
|
2744
|
-
}
|
|
2745
|
-
};
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
3369
|
const ADDRESS_LINE_MAX_LENGTH = 100;
|
|
2749
3370
|
function addressFormlyFields() {
|
|
2750
3371
|
return [
|
|
@@ -2772,10 +3393,10 @@ function addressFormlyFields() {
|
|
|
2772
3393
|
field: zipCodeField({})
|
|
2773
3394
|
}, {
|
|
2774
3395
|
field: countryField({})
|
|
2775
|
-
}])
|
|
3396
|
+
}], { size: 1, relative: true })
|
|
2776
3397
|
];
|
|
2777
3398
|
}
|
|
2778
|
-
function addressField({ key = 'address', required = false }) {
|
|
3399
|
+
function addressField({ key = 'address', required = false } = {}) {
|
|
2779
3400
|
return {
|
|
2780
3401
|
key,
|
|
2781
3402
|
wrappers: ['section'],
|
|
@@ -2787,36 +3408,31 @@ function addressField({ key = 'address', required = false }) {
|
|
|
2787
3408
|
fieldGroup: addressFormlyFields()
|
|
2788
3409
|
};
|
|
2789
3410
|
}
|
|
2790
|
-
function addressListField({ key = 'addresses', required = false, maxAddresses = 6 }) {
|
|
2791
|
-
return {
|
|
3411
|
+
function addressListField({ key = 'addresses', required = false, maxAddresses = 6 } = {}) {
|
|
3412
|
+
return repeatArrayField({
|
|
2792
3413
|
key,
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
addText: 'Add Address',
|
|
2801
|
-
removeText: 'Remove Address'
|
|
2802
|
-
},
|
|
2803
|
-
maxLength: maxAddresses
|
|
2804
|
-
},
|
|
2805
|
-
fieldArray: {
|
|
2806
|
-
fieldGroup: addressFormlyFields()
|
|
2807
|
-
}
|
|
2808
|
-
};
|
|
3414
|
+
label: 'Addresses',
|
|
3415
|
+
labelForField: 'Address',
|
|
3416
|
+
addText: 'Add Address',
|
|
3417
|
+
removeText: 'Remove Address',
|
|
3418
|
+
maxLength: maxAddresses,
|
|
3419
|
+
repeatFieldGroup: addressFormlyFields()
|
|
3420
|
+
});
|
|
2809
3421
|
}
|
|
2810
3422
|
|
|
2811
3423
|
class DbxFormFormlyTextFieldModule {
|
|
2812
3424
|
}
|
|
2813
|
-
DbxFormFormlyTextFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2814
|
-
DbxFormFormlyTextFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
2815
|
-
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
2816
|
-
|
|
3425
|
+
DbxFormFormlyTextFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3426
|
+
DbxFormFormlyTextFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [FormlyMaterialModule], exports: [DbxFormFormlyWrapperModule] });
|
|
3427
|
+
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [[
|
|
3428
|
+
FormlyMaterialModule
|
|
3429
|
+
], DbxFormFormlyWrapperModule] });
|
|
3430
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyTextFieldModule, decorators: [{
|
|
2817
3431
|
type: NgModule,
|
|
2818
3432
|
args: [{
|
|
2819
|
-
imports: [
|
|
3433
|
+
imports: [
|
|
3434
|
+
FormlyMaterialModule
|
|
3435
|
+
],
|
|
2820
3436
|
declarations: [],
|
|
2821
3437
|
exports: [
|
|
2822
3438
|
DbxFormFormlyWrapperModule
|
|
@@ -2831,11 +3447,75 @@ function hiddenField({ key, required = false }) {
|
|
|
2831
3447
|
});
|
|
2832
3448
|
}
|
|
2833
3449
|
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
3450
|
+
class DbxFormFormlyValueModule {
|
|
3451
|
+
}
|
|
3452
|
+
DbxFormFormlyValueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyValueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3453
|
+
DbxFormFormlyValueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyValueModule, imports: [CommonModule], exports: [DbxFormFormlyArrayFieldModule,
|
|
3454
|
+
DbxFormFormlyBooleanFieldModule,
|
|
3455
|
+
DbxFormFormlyDateFieldModule,
|
|
3456
|
+
DbxFormFormlyEnumFieldModule,
|
|
3457
|
+
DbxFormFormlyPhoneFieldModule,
|
|
3458
|
+
DbxFormFormlyTextFieldModule] });
|
|
3459
|
+
DbxFormFormlyValueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyValueModule, imports: [[
|
|
3460
|
+
CommonModule
|
|
3461
|
+
], DbxFormFormlyArrayFieldModule,
|
|
3462
|
+
DbxFormFormlyBooleanFieldModule,
|
|
3463
|
+
DbxFormFormlyDateFieldModule,
|
|
3464
|
+
DbxFormFormlyEnumFieldModule,
|
|
3465
|
+
DbxFormFormlyPhoneFieldModule,
|
|
3466
|
+
DbxFormFormlyTextFieldModule] });
|
|
3467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyValueModule, decorators: [{
|
|
3468
|
+
type: NgModule,
|
|
3469
|
+
args: [{
|
|
3470
|
+
imports: [
|
|
3471
|
+
CommonModule
|
|
3472
|
+
],
|
|
3473
|
+
declarations: [],
|
|
3474
|
+
exports: [
|
|
3475
|
+
DbxFormFormlyArrayFieldModule,
|
|
3476
|
+
DbxFormFormlyBooleanFieldModule,
|
|
3477
|
+
DbxFormFormlyDateFieldModule,
|
|
3478
|
+
DbxFormFormlyEnumFieldModule,
|
|
3479
|
+
DbxFormFormlyPhoneFieldModule,
|
|
3480
|
+
DbxFormFormlyTextFieldModule
|
|
3481
|
+
]
|
|
3482
|
+
}]
|
|
3483
|
+
}] });
|
|
3484
|
+
|
|
3485
|
+
class DbxFormFormlyFieldModule {
|
|
3486
|
+
}
|
|
3487
|
+
DbxFormFormlyFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3488
|
+
DbxFormFormlyFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [CommonModule], exports: [DbxFormFormlyChecklistItemFieldModule,
|
|
3489
|
+
DbxFormFormlyComponentFieldModule,
|
|
3490
|
+
DbxFormFormlySelectionModule,
|
|
3491
|
+
DbxFormFormlyTextEditorFieldModule,
|
|
3492
|
+
DbxFormFormlyValueModule,
|
|
3493
|
+
DbxFormFormlyWrapperModule] });
|
|
3494
|
+
DbxFormFormlyFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [[
|
|
3495
|
+
CommonModule
|
|
3496
|
+
], DbxFormFormlyChecklistItemFieldModule,
|
|
3497
|
+
DbxFormFormlyComponentFieldModule,
|
|
3498
|
+
DbxFormFormlySelectionModule,
|
|
3499
|
+
DbxFormFormlyTextEditorFieldModule,
|
|
3500
|
+
DbxFormFormlyValueModule,
|
|
3501
|
+
DbxFormFormlyWrapperModule] });
|
|
3502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormFormlyFieldModule, decorators: [{
|
|
3503
|
+
type: NgModule,
|
|
3504
|
+
args: [{
|
|
3505
|
+
imports: [
|
|
3506
|
+
CommonModule
|
|
3507
|
+
],
|
|
3508
|
+
declarations: [],
|
|
3509
|
+
exports: [
|
|
3510
|
+
DbxFormFormlyChecklistItemFieldModule,
|
|
3511
|
+
DbxFormFormlyComponentFieldModule,
|
|
3512
|
+
DbxFormFormlySelectionModule,
|
|
3513
|
+
DbxFormFormlyTextEditorFieldModule,
|
|
3514
|
+
DbxFormFormlyValueModule,
|
|
3515
|
+
DbxFormFormlyWrapperModule
|
|
3516
|
+
]
|
|
3517
|
+
}]
|
|
3518
|
+
}] });
|
|
2839
3519
|
|
|
2840
3520
|
/**
|
|
2841
3521
|
* Allows a directive to provide a formly context and form.
|
|
@@ -2844,10 +3524,8 @@ function ProvideFormlyContext() {
|
|
|
2844
3524
|
return [{
|
|
2845
3525
|
provide: DbxFormlyContext,
|
|
2846
3526
|
useClass: DbxFormlyContext
|
|
2847
|
-
},
|
|
2848
|
-
|
|
2849
|
-
useExisting: DbxFormlyContext
|
|
2850
|
-
}];
|
|
3527
|
+
},
|
|
3528
|
+
...ProvideDbxMutableForm(DbxFormlyContext)];
|
|
2851
3529
|
}
|
|
2852
3530
|
/**
|
|
2853
3531
|
* DbxForm Instance that registers a delegate and manages the state of that form/delegate.
|
|
@@ -2855,94 +3533,72 @@ function ProvideFormlyContext() {
|
|
|
2855
3533
|
class DbxFormlyContext {
|
|
2856
3534
|
constructor() {
|
|
2857
3535
|
this.lockSet = new LockSet();
|
|
2858
|
-
this.
|
|
2859
|
-
this.
|
|
2860
|
-
this.
|
|
2861
|
-
this.
|
|
3536
|
+
this._fields = new BehaviorSubject(undefined);
|
|
3537
|
+
this._initialValue = new BehaviorSubject(undefined);
|
|
3538
|
+
this._disabled = new BehaviorSubject(false);
|
|
3539
|
+
this._delegate = new BehaviorSubject(undefined);
|
|
3540
|
+
this.fields$ = this._fields.pipe(filterMaybe());
|
|
3541
|
+
this.stream$ = this._delegate.pipe(distinctUntilChanged$1(), switchMap$1(x => (x) ? x.stream$ : of(DbxFormlyContext.INITIAL_STATE)), shareReplay$1(1));
|
|
2862
3542
|
}
|
|
2863
3543
|
destroy() {
|
|
2864
|
-
this.
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
3544
|
+
this.lockSet.destroyOnNextUnlock(() => {
|
|
3545
|
+
this._fields.complete();
|
|
3546
|
+
this._initialValue.complete();
|
|
3547
|
+
this._disabled.complete();
|
|
3548
|
+
this._delegate.complete();
|
|
3549
|
+
});
|
|
2868
3550
|
}
|
|
2869
3551
|
setDelegate(delegate) {
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
3552
|
+
if (delegate !== this._delegate.value) {
|
|
3553
|
+
if (delegate != null) {
|
|
3554
|
+
delegate.init({
|
|
3555
|
+
fields: this.fields$,
|
|
3556
|
+
initialValue: this._initialValue.value,
|
|
3557
|
+
initialDisabled: this._disabled.value
|
|
3558
|
+
});
|
|
3559
|
+
}
|
|
3560
|
+
this._delegate.next(delegate);
|
|
3561
|
+
}
|
|
2875
3562
|
}
|
|
2876
3563
|
clearDelegate(delegate) {
|
|
2877
|
-
if (
|
|
3564
|
+
if (delegate === this._delegate.value) {
|
|
2878
3565
|
this.setDelegate(undefined);
|
|
2879
3566
|
}
|
|
2880
3567
|
}
|
|
2881
3568
|
get fields() {
|
|
2882
|
-
return this._fields;
|
|
3569
|
+
return this._fields.value;
|
|
2883
3570
|
}
|
|
2884
3571
|
set fields(fields) {
|
|
2885
|
-
this._fields
|
|
2886
|
-
this._delegate.setFields(this._fields);
|
|
3572
|
+
this._fields.next(fields);
|
|
2887
3573
|
}
|
|
2888
3574
|
// MARK: FormComponent
|
|
2889
|
-
|
|
2890
|
-
return this._delegate.
|
|
2891
|
-
}
|
|
2892
|
-
get state() {
|
|
2893
|
-
return this._delegate.state;
|
|
2894
|
-
}
|
|
2895
|
-
get stream$() {
|
|
2896
|
-
return this._stream$;
|
|
2897
|
-
}
|
|
2898
|
-
get value() {
|
|
2899
|
-
return this._delegate.getValue();
|
|
3575
|
+
getValue() {
|
|
3576
|
+
return this._delegate.pipe(filterMaybe(), switchMap$1(x => x.getValue()), shareReplay$1(1));
|
|
2900
3577
|
}
|
|
2901
3578
|
setValue(value) {
|
|
2902
|
-
this._initialValue
|
|
2903
|
-
this._delegate.
|
|
3579
|
+
this._initialValue.next(value);
|
|
3580
|
+
if (this._delegate.value) {
|
|
3581
|
+
this._delegate.value.setValue(value);
|
|
3582
|
+
}
|
|
2904
3583
|
}
|
|
2905
3584
|
isDisabled() {
|
|
2906
|
-
return this.
|
|
3585
|
+
return this._disabled.value;
|
|
2907
3586
|
}
|
|
2908
3587
|
setDisabled(disabled = true) {
|
|
2909
|
-
this._disabled
|
|
2910
|
-
this._delegate.setDisabled(disabled);
|
|
3588
|
+
this._disabled.next(disabled);
|
|
2911
3589
|
}
|
|
2912
3590
|
resetForm() {
|
|
2913
|
-
this._delegate.
|
|
3591
|
+
if (this._delegate.value) {
|
|
3592
|
+
this._delegate.value.resetForm();
|
|
3593
|
+
}
|
|
2914
3594
|
}
|
|
2915
3595
|
forceFormUpdate() {
|
|
2916
|
-
this._delegate.
|
|
3596
|
+
if (this._delegate.value) {
|
|
3597
|
+
this._delegate.value.forceFormUpdate();
|
|
3598
|
+
}
|
|
2917
3599
|
}
|
|
2918
3600
|
}
|
|
2919
3601
|
DbxFormlyContext.INITIAL_STATE = { isComplete: false, state: DbxFormState.INITIALIZING };
|
|
2920
|
-
DbxFormlyContext.EMPTY_DELEGATE = {
|
|
2921
|
-
isComplete: false,
|
|
2922
|
-
state: DbxFormState.INITIALIZING,
|
|
2923
|
-
stream$: of(DbxFormlyContext.INITIAL_STATE),
|
|
2924
|
-
setFields(fields) {
|
|
2925
|
-
// Do nothing.
|
|
2926
|
-
},
|
|
2927
|
-
getValue() {
|
|
2928
|
-
return undefined;
|
|
2929
|
-
},
|
|
2930
|
-
setValue(value) {
|
|
2931
|
-
// Do nothing.
|
|
2932
|
-
},
|
|
2933
|
-
resetForm() {
|
|
2934
|
-
// Do nothing.
|
|
2935
|
-
},
|
|
2936
|
-
forceFormUpdate() {
|
|
2937
|
-
// Do nothing.
|
|
2938
|
-
},
|
|
2939
|
-
isDisabled() {
|
|
2940
|
-
return false;
|
|
2941
|
-
},
|
|
2942
|
-
setDisabled(disabled) {
|
|
2943
|
-
// Do nothing.
|
|
2944
|
-
}
|
|
2945
|
-
};
|
|
2946
3602
|
|
|
2947
3603
|
/**
|
|
2948
3604
|
* Abstract component for wrapping a form.
|
|
@@ -2962,18 +3618,21 @@ class AbstractFormlyFormDirective {
|
|
|
2962
3618
|
}
|
|
2963
3619
|
// Utility Functions
|
|
2964
3620
|
getValue() {
|
|
2965
|
-
return this.context.
|
|
3621
|
+
return this.context.getValue();
|
|
2966
3622
|
}
|
|
2967
3623
|
setValue(value) {
|
|
2968
3624
|
this.context.setValue(value);
|
|
2969
3625
|
}
|
|
3626
|
+
resetForm() {
|
|
3627
|
+
this.context.resetForm();
|
|
3628
|
+
}
|
|
2970
3629
|
clearValue() {
|
|
2971
3630
|
this.setValue({});
|
|
2972
3631
|
}
|
|
2973
3632
|
}
|
|
2974
|
-
AbstractFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2975
|
-
AbstractFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
2976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3633
|
+
AbstractFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFormlyFormDirective, deps: [{ token: DbxFormlyContext }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3634
|
+
AbstractFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFormlyFormDirective, inputs: { disabled: "disabled" }, ngImport: i0 });
|
|
3635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFormlyFormDirective, decorators: [{
|
|
2977
3636
|
type: Directive
|
|
2978
3637
|
}], ctorParameters: function () { return [{ type: DbxFormlyContext }]; }, propDecorators: { disabled: [{
|
|
2979
3638
|
type: Input
|
|
@@ -2986,9 +3645,9 @@ class AbstractSyncFormlyFormDirective extends AbstractFormlyFormDirective {
|
|
|
2986
3645
|
this.context.fields = this.fields;
|
|
2987
3646
|
}
|
|
2988
3647
|
}
|
|
2989
|
-
AbstractSyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
2990
|
-
AbstractSyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
2991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3648
|
+
AbstractSyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSyncFormlyFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3649
|
+
AbstractSyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractSyncFormlyFormDirective, usesInheritance: true, ngImport: i0 });
|
|
3650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSyncFormlyFormDirective, decorators: [{
|
|
2992
3651
|
type: Directive
|
|
2993
3652
|
}] });
|
|
2994
3653
|
/**
|
|
@@ -3000,7 +3659,7 @@ class AbstractAsyncFormlyFormDirective extends AbstractFormlyFormDirective {
|
|
|
3000
3659
|
this._fieldsSub = new SubscriptionObject();
|
|
3001
3660
|
}
|
|
3002
3661
|
ngOnInit() {
|
|
3003
|
-
this._fieldsSub.subscription = this.fields$.subscribe((fields) => {
|
|
3662
|
+
this._fieldsSub.subscription = this.fields$.pipe(distinctUntilChanged$1()).subscribe((fields) => {
|
|
3004
3663
|
this.context.fields = fields;
|
|
3005
3664
|
});
|
|
3006
3665
|
}
|
|
@@ -3009,16 +3668,16 @@ class AbstractAsyncFormlyFormDirective extends AbstractFormlyFormDirective {
|
|
|
3009
3668
|
this._fieldsSub.destroy();
|
|
3010
3669
|
}
|
|
3011
3670
|
}
|
|
3012
|
-
AbstractAsyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
3013
|
-
AbstractAsyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
3014
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3671
|
+
AbstractAsyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractAsyncFormlyFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3672
|
+
AbstractAsyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractAsyncFormlyFormDirective, usesInheritance: true, ngImport: i0 });
|
|
3673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractAsyncFormlyFormDirective, decorators: [{
|
|
3015
3674
|
type: Directive
|
|
3016
3675
|
}] });
|
|
3017
3676
|
class AbstractConfigAsyncFormlyFormDirective extends AbstractAsyncFormlyFormDirective {
|
|
3018
3677
|
constructor() {
|
|
3019
3678
|
super(...arguments);
|
|
3020
3679
|
this._config = new BehaviorSubject(undefined);
|
|
3021
|
-
this.config$ = this._config.
|
|
3680
|
+
this.config$ = this._config.pipe(filterMaybe(), shareReplay$1(1));
|
|
3022
3681
|
}
|
|
3023
3682
|
get config() {
|
|
3024
3683
|
return this._config.value;
|
|
@@ -3031,63 +3690,100 @@ class AbstractConfigAsyncFormlyFormDirective extends AbstractAsyncFormlyFormDire
|
|
|
3031
3690
|
this._config.complete();
|
|
3032
3691
|
}
|
|
3033
3692
|
}
|
|
3034
|
-
AbstractConfigAsyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
3035
|
-
AbstractConfigAsyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.
|
|
3036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3693
|
+
AbstractConfigAsyncFormlyFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractConfigAsyncFormlyFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3694
|
+
AbstractConfigAsyncFormlyFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractConfigAsyncFormlyFormDirective, inputs: { config: "config" }, usesInheritance: true, ngImport: i0 });
|
|
3695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractConfigAsyncFormlyFormDirective, decorators: [{
|
|
3037
3696
|
type: Directive
|
|
3038
3697
|
}], propDecorators: { config: [{
|
|
3039
3698
|
type: Input
|
|
3040
3699
|
}] } });
|
|
3041
3700
|
|
|
3042
|
-
|
|
3043
|
-
|
|
3701
|
+
/**
|
|
3702
|
+
* Provides an DbxFormlyContext and has an input for fields.
|
|
3703
|
+
*/
|
|
3704
|
+
class DbxFormlyFieldsContextDirective extends AbstractAsyncFormlyFormDirective {
|
|
3705
|
+
constructor() {
|
|
3706
|
+
super(...arguments);
|
|
3707
|
+
this._fields = new BehaviorSubject(undefined);
|
|
3708
|
+
this.fields$ = this._fields.asObservable();
|
|
3709
|
+
}
|
|
3710
|
+
get fields() {
|
|
3711
|
+
return this._fields.value;
|
|
3712
|
+
}
|
|
3713
|
+
set fields(fields) {
|
|
3714
|
+
this._fields.next(fields);
|
|
3715
|
+
}
|
|
3716
|
+
ngOnDestroy() {
|
|
3717
|
+
super.ngOnDestroy();
|
|
3718
|
+
this._fields.complete();
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
DbxFormlyFieldsContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyFieldsContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3722
|
+
DbxFormlyFieldsContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormlyFieldsContextDirective, selector: "[dbxFormlyFields]", inputs: { fields: ["dbxFormlyFields", "fields"] }, providers: ProvideFormlyContext(), usesInheritance: true, ngImport: i0 });
|
|
3723
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyFieldsContextDirective, decorators: [{
|
|
3724
|
+
type: Directive,
|
|
3725
|
+
args: [{
|
|
3726
|
+
selector: '[dbxFormlyFields]',
|
|
3727
|
+
providers: ProvideFormlyContext()
|
|
3728
|
+
}]
|
|
3729
|
+
}], propDecorators: { fields: [{
|
|
3730
|
+
type: Input,
|
|
3731
|
+
args: ['dbxFormlyFields']
|
|
3732
|
+
}] } });
|
|
3733
|
+
|
|
3734
|
+
/**
|
|
3735
|
+
* Used for rending a form from a DbxFormlyContext.
|
|
3736
|
+
*/
|
|
3737
|
+
class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
3738
|
+
constructor(context) {
|
|
3044
3739
|
super();
|
|
3045
3740
|
this.context = context;
|
|
3046
|
-
this.
|
|
3047
|
-
this._changesCount = 0;
|
|
3048
|
-
this._fields = [];
|
|
3741
|
+
this._fields = new BehaviorSubject(undefined);
|
|
3049
3742
|
this._events = new BehaviorSubject({ isComplete: false, state: DbxFormState.INITIALIZING });
|
|
3743
|
+
this._reset = new BehaviorSubject(new Date());
|
|
3744
|
+
this._forceUpdate = new Subject();
|
|
3050
3745
|
this.form = new FormGroup({});
|
|
3051
3746
|
this.model = {};
|
|
3052
3747
|
this.options = {};
|
|
3748
|
+
this.fields$ = this._fields.pipe(switchMapMaybeObs(), distinctUntilChanged$1(), shareReplay$1(1));
|
|
3749
|
+
this.stream$ = this._reset.pipe(switchMap$1((lastResetAt) => this.form.valueChanges.pipe(startWith(0), distinctUntilChanged$1(), throttleTime$1(50, undefined, { leading: true, trailing: true }), scanCount(), map$1((changesSinceLastResetCount) => {
|
|
3750
|
+
const isReset = changesSinceLastResetCount === 1;
|
|
3751
|
+
const complete = this.form.valid;
|
|
3752
|
+
const nextState = {
|
|
3753
|
+
isComplete: complete,
|
|
3754
|
+
state: (isReset) ? DbxFormState.RESET : DbxFormState.USED,
|
|
3755
|
+
untouched: this.form.untouched,
|
|
3756
|
+
pristine: this.form.pristine,
|
|
3757
|
+
changesCount: changesSinceLastResetCount,
|
|
3758
|
+
lastResetAt,
|
|
3759
|
+
isDisabled: this.disabled
|
|
3760
|
+
};
|
|
3761
|
+
return nextState;
|
|
3762
|
+
}))), shareReplay$1(1));
|
|
3053
3763
|
}
|
|
3054
3764
|
ngOnInit() {
|
|
3055
3765
|
this.context.setDelegate(this);
|
|
3056
|
-
this.sub = this.form.valueChanges.pipe(startWith$1(this.form.value), distinctUntilChanged(), debounceTime(50)).subscribe((_) => this._updateForChange());
|
|
3057
3766
|
}
|
|
3058
3767
|
ngOnDestroy() {
|
|
3059
3768
|
this.context.lockSet.onNextUnlock(() => {
|
|
3060
3769
|
super.ngOnDestroy();
|
|
3061
3770
|
this.context.clearDelegate(this);
|
|
3062
3771
|
this._events.complete();
|
|
3772
|
+
this._fields.complete();
|
|
3773
|
+
this._reset.complete();
|
|
3774
|
+
this._forceUpdate.complete();
|
|
3063
3775
|
});
|
|
3064
3776
|
}
|
|
3065
|
-
get fields() {
|
|
3066
|
-
return this._fields;
|
|
3067
|
-
}
|
|
3068
3777
|
// MARK: Delegate
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
}
|
|
3072
|
-
get state() {
|
|
3073
|
-
return this._events.value.state;
|
|
3074
|
-
}
|
|
3075
|
-
get stream$() {
|
|
3076
|
-
return this._events.asObservable();
|
|
3077
|
-
}
|
|
3078
|
-
setFields(fields) {
|
|
3079
|
-
this._fields = fields;
|
|
3778
|
+
init(initialize) {
|
|
3779
|
+
this._fields.next(initialize.fields);
|
|
3080
3780
|
}
|
|
3081
3781
|
getValue() {
|
|
3082
|
-
return this.form.value;
|
|
3782
|
+
return of(this.form.value);
|
|
3083
3783
|
}
|
|
3084
3784
|
setValue(value) {
|
|
3085
3785
|
var _a, _b;
|
|
3086
|
-
|
|
3087
|
-
if (value === this.model) {
|
|
3088
|
-
return; // Ignore the same value being set.
|
|
3089
|
-
}
|
|
3090
|
-
*/
|
|
3786
|
+
// console.log('set value: ', value);
|
|
3091
3787
|
this.model = cloneDeep(value);
|
|
3092
3788
|
if (this.options.updateInitialValue) {
|
|
3093
3789
|
this.options.updateInitialValue();
|
|
@@ -3096,8 +3792,6 @@ class DbxFormlyComponent extends AbstractSubscriptionDirective {
|
|
|
3096
3792
|
// Re-mark as untouched and pristine.
|
|
3097
3793
|
this.form.markAsUntouched();
|
|
3098
3794
|
this.form.markAsPristine();
|
|
3099
|
-
this._lastResetAt = new Date();
|
|
3100
|
-
this._changesCount = 0;
|
|
3101
3795
|
// After updating the value, if the form is still untouched mark it as pristine again.
|
|
3102
3796
|
// Sometimes the values get marked as changed and break pristine before a user has time to interact.
|
|
3103
3797
|
setTimeout(() => {
|
|
@@ -3111,60 +3805,52 @@ class DbxFormlyComponent extends AbstractSubscriptionDirective {
|
|
|
3111
3805
|
this.options.resetModel();
|
|
3112
3806
|
}
|
|
3113
3807
|
}
|
|
3114
|
-
|
|
3808
|
+
get disabled() {
|
|
3115
3809
|
return this.form.disabled;
|
|
3116
3810
|
}
|
|
3117
3811
|
setDisabled(disabled = true) {
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3812
|
+
if (disabled !== this.disabled) {
|
|
3813
|
+
if (disabled) {
|
|
3814
|
+
this.form.disable({ emitEvent: true });
|
|
3815
|
+
}
|
|
3816
|
+
else {
|
|
3817
|
+
this.form.enable({ emitEvent: true });
|
|
3818
|
+
}
|
|
3124
3819
|
}
|
|
3125
3820
|
}
|
|
3126
3821
|
// MARK: Update
|
|
3127
3822
|
forceFormUpdate() {
|
|
3128
|
-
this.
|
|
3129
|
-
}
|
|
3130
|
-
_updateForChange() {
|
|
3131
|
-
const complete = this.form.valid;
|
|
3132
|
-
this._changesCount += 1;
|
|
3133
|
-
const nextState = {
|
|
3134
|
-
isComplete: complete,
|
|
3135
|
-
state: (complete) ? DbxFormState.COMPLETE : DbxFormState.INCOMPLETE,
|
|
3136
|
-
untouched: this.form.untouched,
|
|
3137
|
-
pristine: this.form.pristine,
|
|
3138
|
-
changesCount: this._changesCount,
|
|
3139
|
-
lastResetAt: this._lastResetAt
|
|
3140
|
-
};
|
|
3141
|
-
this._events.next(nextState);
|
|
3823
|
+
this._forceUpdate.next();
|
|
3142
3824
|
}
|
|
3143
3825
|
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3826
|
+
DbxFormlyFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyFormComponent, deps: [{ token: DbxFormlyContext }], target: i0.ɵɵFactoryTarget.Component });
|
|
3827
|
+
DbxFormlyFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormlyFormComponent, selector: "dbx-formly", host: { classAttribute: "dbx-formly" }, providers: ProvideDbxMutableForm(DbxFormlyFormComponent), exportAs: ["formly"], usesInheritance: true, ngImport: i0, template: `
|
|
3146
3828
|
<form [formGroup]="form" class="dbx-formly">
|
|
3147
|
-
<formly-form [form]="form" [fields]="fields" [model]="model"></formly-form>
|
|
3829
|
+
<formly-form [form]="form" [fields]="(fields$ | async) ?? []" [model]="model"></formly-form>
|
|
3148
3830
|
</form>
|
|
3149
|
-
`, isInline: true, components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }], directives: [{ type:
|
|
3150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3831
|
+
`, isInline: true, components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }], directives: [{ type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "async": i5.AsyncPipe } });
|
|
3832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyFormComponent, decorators: [{
|
|
3151
3833
|
type: Component,
|
|
3152
3834
|
args: [{
|
|
3153
3835
|
selector: 'dbx-formly',
|
|
3154
3836
|
exportAs: 'formly',
|
|
3155
3837
|
template: `
|
|
3156
3838
|
<form [formGroup]="form" class="dbx-formly">
|
|
3157
|
-
<formly-form [form]="form" [fields]="fields" [model]="model"></formly-form>
|
|
3839
|
+
<formly-form [form]="form" [fields]="(fields$ | async) ?? []" [model]="model"></formly-form>
|
|
3158
3840
|
</form>
|
|
3159
3841
|
`,
|
|
3160
|
-
|
|
3842
|
+
providers: ProvideDbxMutableForm(DbxFormlyFormComponent),
|
|
3843
|
+
host: {
|
|
3844
|
+
'class': 'dbx-formly'
|
|
3845
|
+
}
|
|
3161
3846
|
}]
|
|
3162
|
-
}], ctorParameters: function () { return [{ type: DbxFormlyContext }
|
|
3847
|
+
}], ctorParameters: function () { return [{ type: DbxFormlyContext }]; } });
|
|
3163
3848
|
|
|
3164
3849
|
class DbxFormlyModule {
|
|
3165
3850
|
}
|
|
3166
|
-
DbxFormlyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
3167
|
-
DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
3851
|
+
DbxFormlyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3852
|
+
DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyModule, declarations: [DbxFormlyFormComponent,
|
|
3853
|
+
DbxFormlyFieldsContextDirective], imports: [CommonModule,
|
|
3168
3854
|
FormsModule,
|
|
3169
3855
|
ReactiveFormsModule,
|
|
3170
3856
|
FormlyModule,
|
|
@@ -3172,11 +3858,11 @@ DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
3172
3858
|
// Modules (?)
|
|
3173
3859
|
FormsModule,
|
|
3174
3860
|
ReactiveFormsModule,
|
|
3175
|
-
// DbxFormWrapperModule, // todo!
|
|
3176
3861
|
// Directives
|
|
3177
|
-
|
|
3862
|
+
DbxFormlyFormComponent,
|
|
3863
|
+
DbxFormlyFieldsContextDirective
|
|
3178
3864
|
] });
|
|
3179
|
-
DbxFormlyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
3865
|
+
DbxFormlyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyModule, imports: [[
|
|
3180
3866
|
CommonModule,
|
|
3181
3867
|
FormsModule,
|
|
3182
3868
|
ReactiveFormsModule,
|
|
@@ -3186,7 +3872,7 @@ DbxFormlyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
3186
3872
|
// Modules (?)
|
|
3187
3873
|
FormsModule,
|
|
3188
3874
|
ReactiveFormsModule] });
|
|
3189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormlyModule, decorators: [{
|
|
3190
3876
|
type: NgModule,
|
|
3191
3877
|
args: [{
|
|
3192
3878
|
imports: [
|
|
@@ -3197,17 +3883,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
3197
3883
|
FormlyMatToggleModule
|
|
3198
3884
|
],
|
|
3199
3885
|
declarations: [
|
|
3200
|
-
|
|
3201
|
-
|
|
3886
|
+
DbxFormlyFormComponent,
|
|
3887
|
+
DbxFormlyFieldsContextDirective
|
|
3202
3888
|
],
|
|
3203
3889
|
exports: [
|
|
3204
3890
|
// Modules (?)
|
|
3205
3891
|
FormsModule,
|
|
3206
3892
|
ReactiveFormsModule,
|
|
3207
|
-
// DbxFormWrapperModule, // todo!
|
|
3208
3893
|
// Directives
|
|
3209
|
-
|
|
3210
|
-
|
|
3894
|
+
DbxFormlyFormComponent,
|
|
3895
|
+
DbxFormlyFieldsContextDirective
|
|
3211
3896
|
]
|
|
3212
3897
|
}]
|
|
3213
3898
|
}] });
|
|
@@ -3217,9 +3902,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
3217
3902
|
*/
|
|
3218
3903
|
class DbxFormSpacerComponent {
|
|
3219
3904
|
}
|
|
3220
|
-
DbxFormSpacerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
3221
|
-
DbxFormSpacerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.
|
|
3222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3905
|
+
DbxFormSpacerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3906
|
+
DbxFormSpacerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxFormSpacerComponent, selector: "dbx-form-spacer", ngImport: i0, template: `<div class="dbx-form-spacer"></div>`, isInline: true });
|
|
3907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormSpacerComponent, decorators: [{
|
|
3223
3908
|
type: Component,
|
|
3224
3909
|
args: [{
|
|
3225
3910
|
selector: 'dbx-form-spacer',
|
|
@@ -3229,12 +3914,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
3229
3914
|
|
|
3230
3915
|
class DbxFormLayoutModule {
|
|
3231
3916
|
}
|
|
3232
|
-
DbxFormLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
3233
|
-
DbxFormLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.
|
|
3234
|
-
DbxFormLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.
|
|
3917
|
+
DbxFormLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3918
|
+
DbxFormLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLayoutModule, declarations: [DbxFormSpacerComponent], imports: [CommonModule], exports: [DbxFormSpacerComponent] });
|
|
3919
|
+
DbxFormLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLayoutModule, imports: [[
|
|
3235
3920
|
CommonModule
|
|
3236
3921
|
]] });
|
|
3237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
3922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormLayoutModule, decorators: [{
|
|
3238
3923
|
type: NgModule,
|
|
3239
3924
|
args: [{
|
|
3240
3925
|
imports: [
|
|
@@ -3287,9 +3972,29 @@ function IsInRange(min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER)
|
|
|
3287
3972
|
};
|
|
3288
3973
|
}
|
|
3289
3974
|
|
|
3975
|
+
class DbxFormExtensionModule {
|
|
3976
|
+
}
|
|
3977
|
+
DbxFormExtensionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3978
|
+
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule,
|
|
3979
|
+
DbxFormlyModule,
|
|
3980
|
+
DbxFormFormlyFieldModule] });
|
|
3981
|
+
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule,
|
|
3982
|
+
DbxFormlyModule,
|
|
3983
|
+
DbxFormFormlyFieldModule] });
|
|
3984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFormExtensionModule, decorators: [{
|
|
3985
|
+
type: NgModule,
|
|
3986
|
+
args: [{
|
|
3987
|
+
exports: [
|
|
3988
|
+
DbxFormModule,
|
|
3989
|
+
DbxFormlyModule,
|
|
3990
|
+
DbxFormFormlyFieldModule
|
|
3991
|
+
]
|
|
3992
|
+
}]
|
|
3993
|
+
}] });
|
|
3994
|
+
|
|
3290
3995
|
/**
|
|
3291
3996
|
* Generated bundle index. Do not edit.
|
|
3292
3997
|
*/
|
|
3293
3998
|
|
|
3294
|
-
export { ADDRESS_CITY_MAX_LENGTH, ADDRESS_COUNTRY_MAX_LENGTH, ADDRESS_LINE_MAX_LENGTH, ADDRESS_STATE_MAX_LENGTH, ADDRESS_ZIP_MAX_LENGTH, APP_ACTION_FORM_DISABLED_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormComponentFieldWrappedComponent, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DEFAULT_HAS_VALUE_FN, DEFAULT_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DateTimeFieldTimeMode, DbxActionFormDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDefaultChecklistItemFieldDisplayComponent,
|
|
3999
|
+
export { ADDRESS_CITY_MAX_LENGTH, ADDRESS_COUNTRY_MAX_LENGTH, ADDRESS_LINE_MAX_LENGTH, ADDRESS_STATE_MAX_LENGTH, ADDRESS_ZIP_MAX_LENGTH, APP_ACTION_FORM_DISABLED_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableFieldDisplayDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormComponentFieldWrappedComponent, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_SEARCHABLE_FIELD_COMPONENT_DATA, DEFAULT_HAS_VALUE_FN, DEFAULT_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DateTimeFieldTimeMode, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyTextFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule, DbxFormInfoWrapperComponent, DbxFormIoModule, DbxFormLayoutModule, DbxFormLoadingSourceDirective, DbxFormModule, DbxFormRepeatArrayTypeComponent, DbxFormSectionWrapperComponent, DbxFormSourceDirective, DbxFormSpacerComponent, DbxFormState, DbxFormSubsectionWrapperComponent, DbxFormToggleWrapperComponent, DbxFormValueChangesDirective, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FLEX_WRAPPER_KEY, FormComponentFieldComponent, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE, IsDomain, IsInRange, IsTruthy, LABEL_STRING_MAX_LENGTH, MAX_LENGTH_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, PHONE_LABEL_MAX_LENGTH, ProvideDbxForm, ProvideDbxMutableForm, ProvideFormlyContext, REQUIRED_VALIDATION_MESSAGE, SEARCH_STRING_MAX_LENGTH, SECTION_WRAPPER_KEY, STYLE_WRAPPER_KEY, SUBSECTION_WRAPPER_KEY, TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS, TOGGLE_WRAPPER_KEY, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressListField, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateTimeField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, emailField, expandWrapper, filterPickableItemFieldValuesByLabel, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, minLengthValidationMessage, minValidationMessage, nameField, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, staticEnumField, styleWrapper, subsectionWrapper, templateOptionsForFieldConfig, templateOptionsValueForFieldConfig, textAreaField, textEditorField, textField, timeOnlyField, toggleField, toggleWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
3295
4000
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|