@dereekb/dbx-form 4.0.1 → 5.0.1
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/LICENSE +21 -0
- package/_index.scss +4 -5
- package/esm2020/lib/form/action/form.action.directive.mjs +20 -21
- package/esm2020/lib/form/action/form.action.module.mjs +6 -17
- package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +5 -13
- package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +2 -2
- package/esm2020/lib/form/form.mjs +4 -7
- package/esm2020/lib/form/form.module.mjs +4 -12
- package/esm2020/lib/form/io/form.changes.directive.mjs +4 -2
- package/esm2020/lib/form/io/form.input.directive.mjs +3 -6
- package/esm2020/lib/form/io/form.io.module.mjs +6 -22
- package/esm2020/lib/form/io/form.loading.directive.mjs +1 -1
- package/esm2020/lib/form.module.mjs +4 -12
- package/esm2020/lib/formly/config/index.mjs +1 -1
- package/esm2020/lib/formly/config/validation.mjs +1 -1
- package/esm2020/lib/formly/field/checklist/checklist.field.mjs +6 -9
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +14 -12
- package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +1 -1
- package/esm2020/lib/formly/field/checklist/checklist.item.field.mjs +1 -1
- package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +6 -18
- package/esm2020/lib/formly/field/checklist/checklist.item.mjs +1 -1
- package/esm2020/lib/formly/field/component/component.field.component.mjs +1 -1
- package/esm2020/lib/formly/field/component/component.field.mjs +1 -1
- package/esm2020/lib/formly/field/component/component.field.module.mjs +5 -13
- package/esm2020/lib/formly/field/field.mjs +4 -2
- package/esm2020/lib/formly/field/form.field.module.mjs +5 -26
- package/esm2020/lib/formly/field/selection/pickable/index.mjs +1 -1
- package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +5 -5
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +43 -43
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +3 -3
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +5 -15
- package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +17 -12
- package/esm2020/lib/formly/field/selection/pickable/pickable.mjs +1 -1
- package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +15 -13
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +24 -26
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.mjs +6 -5
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +7 -19
- package/esm2020/lib/formly/field/selection/searchable/searchable.mjs +1 -1
- package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +7 -8
- package/esm2020/lib/formly/field/selection/searchable/text.chip.field.mjs +5 -5
- package/esm2020/lib/formly/field/selection/selection.mjs +1 -1
- package/esm2020/lib/formly/field/selection/selection.module.mjs +5 -14
- package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +5 -3
- package/esm2020/lib/formly/field/texteditor/texteditor.field.mjs +1 -1
- package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +4 -10
- package/esm2020/lib/formly/field/value/array/array.field.component.mjs +31 -25
- package/esm2020/lib/formly/field/value/array/array.field.mjs +3 -3
- package/esm2020/lib/formly/field/value/array/array.field.module.mjs +4 -10
- package/esm2020/lib/formly/field/value/boolean/boolean.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/boolean/boolean.field.module.mjs +1 -1
- package/esm2020/lib/formly/field/value/date/date.field.module.mjs +5 -13
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +24 -33
- package/esm2020/lib/formly/field/value/date/datetime.field.mjs +3 -3
- package/esm2020/lib/formly/field/value/enum/enum.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/enum/enum.field.module.mjs +1 -1
- package/esm2020/lib/formly/field/value/enum/enum.mjs +1 -1
- package/esm2020/lib/formly/field/value/hidden.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/value/phone/phone.field.mjs +2 -4
- package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +4 -10
- package/esm2020/lib/formly/field/value/text/text.additional.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/text/text.address.field.mjs +12 -6
- package/esm2020/lib/formly/field/value/text/text.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/text/text.field.module.mjs +4 -10
- package/esm2020/lib/formly/field/value/value.module.mjs +5 -26
- package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +8 -4
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +15 -15
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +1 -1
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +1 -1
- package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +3 -21
- package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +3 -5
- package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +1 -1
- package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +2 -2
- package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +7 -7
- package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +16 -16
- package/esm2020/lib/formly/field/wrapper/working.wrapper.component.mjs +2 -2
- package/esm2020/lib/formly/field/wrapper/wrapper.mjs +6 -4
- package/esm2020/lib/formly/formly.context.directive.mjs +4 -4
- package/esm2020/lib/formly/formly.context.mjs +9 -7
- package/esm2020/lib/formly/formly.directive.mjs +1 -1
- package/esm2020/lib/formly/formly.form.component.mjs +7 -7
- package/esm2020/lib/formly/formly.module.mjs +5 -25
- package/esm2020/lib/formly/template/available.mjs +6 -4
- package/esm2020/lib/formly/template/login.mjs +8 -11
- package/esm2020/lib/layout/form.layout.module.mjs +5 -13
- package/esm2020/lib/layout/form.spacer.component.mjs +7 -3
- package/esm2020/lib/validator/available.mjs +2 -3
- package/esm2020/lib/validator/boolean.mjs +2 -2
- package/esm2020/lib/validator/email.mjs +2 -2
- package/esm2020/lib/validator/field.mjs +3 -3
- package/esm2020/lib/validator/number.mjs +20 -16
- package/fesm2015/dereekb-dbx-form.mjs +420 -624
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +423 -624
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form/_form.scss +6 -4
- package/lib/form/action/form.action.directive.d.ts +4 -4
- package/lib/form/form.d.ts +4 -4
- package/lib/form/io/form.changes.directive.d.ts +3 -3
- package/lib/form/io/form.input.directive.d.ts +3 -3
- package/lib/form/io/form.loading.directive.d.ts +3 -3
- package/lib/formly/_formly.scss +6 -4
- package/lib/formly/config/validation.d.ts +4 -4
- package/lib/formly/field/checklist/_checklist.scss +6 -10
- package/lib/formly/field/checklist/checklist.field.d.ts +3 -3
- package/lib/formly/field/checklist/checklist.item.d.ts +8 -8
- package/lib/formly/field/checklist/checklist.item.field.component.d.ts +7 -9
- package/lib/formly/field/checklist/checklist.item.field.content.default.component.d.ts +4 -4
- package/lib/formly/field/checklist/checklist.item.field.d.ts +3 -3
- package/lib/formly/field/component/_component.scss +6 -4
- package/lib/formly/field/component/component.field.component.d.ts +3 -4
- package/lib/formly/field/component/component.field.d.ts +3 -4
- package/lib/formly/field/field.d.ts +3 -3
- package/lib/formly/field/selection/pickable/_pickable.scss +4 -3
- package/lib/formly/field/selection/pickable/pickable.chip.field.component.d.ts +1 -1
- package/lib/formly/field/selection/pickable/pickable.d.ts +9 -11
- package/lib/formly/field/selection/pickable/pickable.field.d.ts +3 -3
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +49 -50
- package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +7 -7
- package/lib/formly/field/selection/searchable/_searchable.scss +4 -6
- package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +8 -8
- package/lib/formly/field/selection/searchable/searchable.d.ts +9 -8
- package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +1 -1
- package/lib/formly/field/selection/searchable/searchable.field.d.ts +9 -9
- package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +25 -25
- package/lib/formly/field/selection/searchable/searchable.text.field.component.d.ts +12 -9
- package/lib/formly/field/selection/searchable/text.chip.field.d.ts +3 -3
- package/lib/formly/field/selection/selection.d.ts +6 -6
- package/lib/formly/field/texteditor/_texteditor.scss +3 -8
- package/lib/formly/field/texteditor/texteditor.field.component.d.ts +1 -2
- package/lib/formly/field/value/array/_array.scss +2 -6
- package/lib/formly/field/value/array/array.field.component.d.ts +1 -1
- package/lib/formly/field/value/array/array.field.d.ts +1 -1
- package/lib/formly/field/value/boolean/_boolean.scss +6 -4
- package/lib/formly/field/value/date/_date.scss +7 -9
- package/lib/formly/field/value/date/datetime.field.component.d.ts +2 -3
- package/lib/formly/field/value/date/datetime.field.d.ts +1 -2
- package/lib/formly/field/value/enum/_enum.scss +6 -4
- package/lib/formly/field/value/enum/enum.field.d.ts +1 -1
- package/lib/formly/field/value/hidden.field.d.ts +1 -2
- package/lib/formly/field/value/phone/_phone.scss +2 -4
- package/lib/formly/field/value/text/_text.scss +6 -4
- package/lib/formly/field/value/text/text.additional.field.d.ts +3 -3
- package/lib/formly/field/value/text/text.address.field.d.ts +1 -2
- package/lib/formly/field/wrapper/_wrapper.scss +4 -4
- package/lib/formly/field/wrapper/expandable.wrapper.component.d.ts +4 -4
- package/lib/formly/field/wrapper/expandable.wrapper.delegate.d.ts +11 -11
- package/lib/formly/field/wrapper/toggle.wrapper.component.d.ts +4 -4
- package/lib/formly/field/wrapper/working.wrapper.component.d.ts +4 -2
- package/lib/formly/field/wrapper/wrapper.d.ts +2 -2
- package/lib/formly/formly.context.d.ts +4 -5
- package/lib/formly/formly.context.directive.d.ts +1 -1
- package/lib/formly/formly.directive.d.ts +1 -1
- package/lib/formly/formly.form.component.d.ts +2 -2
- package/lib/formly/template/login.d.ts +2 -3
- package/lib/layout/_layout.scss +6 -4
- package/lib/style/_config.scss +8 -6
- package/lib/style/_core.scss +1 -1
- package/lib/style/_mixin.scss +1 -1
- package/lib/style/_theming.scss +2 -12
- package/lib/style/_variables.scss +1 -1
- package/lib/validator/available.d.ts +1 -1
- package/lib/validator/boolean.d.ts +1 -1
- package/lib/validator/email.d.ts +1 -1
- package/lib/validator/field.d.ts +6 -6
- package/lib/validator/number.d.ts +8 -1
- package/package.json +5 -4
|
@@ -8,11 +8,10 @@ import * as i3 from '@uirouter/core';
|
|
|
8
8
|
import * as i2 from '@dereekb/dbx-core';
|
|
9
9
|
import { AbstractSubscriptionDirective, safeDetectChanges, DbxInjectionComponentModule, DbxDatePipeModule, mergeDbxInjectionComponentConfigs, tapDetectChanges } from '@dereekb/dbx-core';
|
|
10
10
|
import * as i1$1 from '@dereekb/dbx-web';
|
|
11
|
-
import { DbxActionTransitionSafetyDirective, DbxTextModule, DbxLoadingModule, DbxFlexLayoutModule, DbxSectionLayoutModule, DbxRouterAnchorModule, AbstractDbxSelectionListWrapperDirective, DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE, AbstractDbxSelectionListViewDirective, addConfigToValueListItems,
|
|
11
|
+
import { DbxActionTransitionSafetyDirective, DbxTextModule, DbxLoadingModule, DbxFlexLayoutModule, DbxSectionLayoutModule, DbxRouterAnchorModule, AbstractDbxSelectionListWrapperDirective, DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE, AbstractDbxSelectionListViewDirective, addConfigToValueListItems, provideDbxListView, AbstractDbxValueListViewItemComponent, DbxButtonModule, DbxListLayoutModule, mapCompactModeObs, DbxBarLayoutModule } from '@dereekb/dbx-web';
|
|
12
12
|
import { isPast, addSeconds, isSameMinute, startOfDay, isSameDay, addMinutes } from 'date-fns';
|
|
13
|
-
import { BehaviorSubject, switchMap, first, exhaustMap, of, catchError, delay, filter, combineLatest, map, distinctUntilChanged, mergeMap, shareReplay
|
|
14
|
-
import { LockSet, SubscriptionObject, asObservable, loadingStateHasFinishedLoading, switchMapMaybeObs, filterMaybe, switchMapMaybeDefault, SimpleLoadingContext,
|
|
15
|
-
import { distinctUntilChanged as distinctUntilChanged$1, shareReplay, map as map$1, delay as delay$1, debounceTime as debounceTime$1, filter as filter$1, switchMap as switchMap$1, startWith as startWith$1, tap, throttleTime, first as first$1 } from 'rxjs/operators';
|
|
13
|
+
import { BehaviorSubject, switchMap, first, exhaustMap, of, catchError, delay, filter, combineLatest, map, distinctUntilChanged, mergeMap, shareReplay, startWith, debounceTime, Subject, skipWhile, interval, tap, merge, throttleTime, scan } from 'rxjs';
|
|
14
|
+
import { LockSet, SubscriptionObject, asObservable, loadingStateHasFinishedLoading, switchMapMaybeObs, filterMaybe, switchMapMaybeDefault, SimpleLoadingContext, startWithBeginLoading, mapLoadingStateResults, successResult, ListLoadingStateContextInstance, isListLoadingStateEmpty, LoadingStateContextInstance, skipFirstMaybe, asyncPusherCache, scanCount } from '@dereekb/rxjs';
|
|
16
15
|
import * as i1$4 from '@ngx-formly/core';
|
|
17
16
|
import { FieldType, FieldWrapper, FormlyModule, FieldArrayType } from '@ngx-formly/core';
|
|
18
17
|
import * as i1 from '@angular/material/checkbox';
|
|
@@ -86,14 +85,11 @@ class DbxForm {
|
|
|
86
85
|
}
|
|
87
86
|
class DbxMutableForm extends DbxForm {
|
|
88
87
|
}
|
|
89
|
-
function
|
|
88
|
+
function provideDbxForm(sourceType) {
|
|
90
89
|
return [{ provide: DbxForm, useExisting: forwardRef(() => sourceType) }];
|
|
91
90
|
}
|
|
92
|
-
function
|
|
93
|
-
return [
|
|
94
|
-
...ProvideDbxForm(sourceType),
|
|
95
|
-
{ provide: DbxMutableForm, useExisting: forwardRef(() => sourceType) }
|
|
96
|
-
];
|
|
91
|
+
function provideDbxMutableForm(sourceType) {
|
|
92
|
+
return [...provideDbxForm(sourceType), { provide: DbxMutableForm, useExisting: forwardRef(() => sourceType) }];
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
const APP_ACTION_FORM_DISABLED_KEY = 'dbx_action_form';
|
|
@@ -126,7 +122,8 @@ class DbxActionFormDirective {
|
|
|
126
122
|
}
|
|
127
123
|
ngOnInit() {
|
|
128
124
|
// Pass data from the form to the source when triggered.
|
|
129
|
-
this._triggeredSub.subscription = this.source.triggered
|
|
125
|
+
this._triggeredSub.subscription = this.source.triggered$
|
|
126
|
+
.pipe(switchMap(() => this.form.stream$.pipe(first(), exhaustMap((stream) => {
|
|
130
127
|
const { isComplete } = stream;
|
|
131
128
|
const doNothing = {}; // nothing, form not complete
|
|
132
129
|
let obs;
|
|
@@ -144,7 +141,8 @@ class DbxActionFormDirective {
|
|
|
144
141
|
obs = of(doNothing);
|
|
145
142
|
}
|
|
146
143
|
return obs;
|
|
147
|
-
}))))
|
|
144
|
+
}))))
|
|
145
|
+
.subscribe((result) => {
|
|
148
146
|
if (result.reject) {
|
|
149
147
|
this.source.reject(result.reject);
|
|
150
148
|
}
|
|
@@ -156,35 +154,33 @@ class DbxActionFormDirective {
|
|
|
156
154
|
}
|
|
157
155
|
});
|
|
158
156
|
// Update the enabled/disabled state
|
|
159
|
-
this._isCompleteSub.subscription = this.form.stream
|
|
157
|
+
this._isCompleteSub.subscription = this.form.stream$
|
|
158
|
+
.pipe(delay(0), filter((x) => x.state !== DbxFormState.INITIALIZING), switchMap((event) => {
|
|
160
159
|
return this.form.getValue().pipe(first(), exhaustMap((value) => {
|
|
161
160
|
// Use both changes count and whether or not something was in the past to guage whether or not the item has been touched.
|
|
162
161
|
// Angular Form's untouched is whether or not focus has been lost but we can still recieve value updates.
|
|
163
162
|
// More than a certain amount of updates implies that it is being typed into.
|
|
164
|
-
const isProbablyTouched = !event.untouched ||
|
|
165
|
-
((event.changesCount ?? 0) > 3 && isPast(addSeconds(event.lastResetAt ?? new Date(), 2)));
|
|
163
|
+
const isProbablyTouched = !event.untouched || ((event.changesCount ?? 0) > 3 && isPast(addSeconds(event.lastResetAt ?? new Date(), 2)));
|
|
166
164
|
let validatorObs;
|
|
167
165
|
const initialIsValidCheck = event.isComplete;
|
|
168
166
|
if (initialIsValidCheck) {
|
|
169
|
-
validatorObs =
|
|
167
|
+
validatorObs = this.dbxActionFormValidator ? this.dbxActionFormValidator(value) : of(true);
|
|
170
168
|
}
|
|
171
169
|
else {
|
|
172
170
|
validatorObs = of(false);
|
|
173
171
|
}
|
|
174
172
|
let modifiedObs;
|
|
175
|
-
const isConsideredModified =
|
|
173
|
+
const isConsideredModified = event.pristine === false && isProbablyTouched;
|
|
176
174
|
if (isConsideredModified) {
|
|
177
|
-
modifiedObs =
|
|
175
|
+
modifiedObs = this.dbxActionFormModified ? this.dbxActionFormModified(value) : of(true);
|
|
178
176
|
}
|
|
179
177
|
else {
|
|
180
178
|
modifiedObs = of(false);
|
|
181
179
|
}
|
|
182
|
-
return combineLatest([
|
|
183
|
-
validatorObs,
|
|
184
|
-
modifiedObs
|
|
185
|
-
]).pipe(first(), map(([valid, modified]) => ({ valid, modified, value, event })));
|
|
180
|
+
return combineLatest([validatorObs, modifiedObs]).pipe(first(), map(([valid, modified]) => ({ valid, modified, value, event })));
|
|
186
181
|
}));
|
|
187
|
-
}))
|
|
182
|
+
}))
|
|
183
|
+
.subscribe(({ valid, modified /*, value, event */ }) => {
|
|
188
184
|
// console.log('x: ', value, event, valid, modified);
|
|
189
185
|
// Update Modified State
|
|
190
186
|
this.source.setIsModified(modified);
|
|
@@ -192,7 +188,9 @@ class DbxActionFormDirective {
|
|
|
192
188
|
this.source.enable(APP_ACTION_FORM_DISABLED_KEY, valid);
|
|
193
189
|
});
|
|
194
190
|
// Watch the working state and disable form while working
|
|
195
|
-
this._isWorkingSub.subscription = combineLatest([this.source.isWorking$, this._formDisabledWhileWorking])
|
|
191
|
+
this._isWorkingSub.subscription = combineLatest([this.source.isWorking$, this._formDisabledWhileWorking])
|
|
192
|
+
.pipe(map(([isWorking, lockOnWorking]) => lockOnWorking && isWorking), distinctUntilChanged())
|
|
193
|
+
.subscribe((disable) => {
|
|
196
194
|
this.form.setDisabled(APP_ACTION_FORM_DISABLED_KEY, disable);
|
|
197
195
|
});
|
|
198
196
|
}
|
|
@@ -207,12 +205,9 @@ class DbxActionFormDirective {
|
|
|
207
205
|
});
|
|
208
206
|
}
|
|
209
207
|
preCheckReadyValue(value) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return combineLatest([
|
|
213
|
-
validatorObs,
|
|
214
|
-
modifiedObs
|
|
215
|
-
]).pipe(first(), map(([valid, modified]) => valid && modified));
|
|
208
|
+
const validatorObs = this.dbxActionFormValidator ? this.dbxActionFormValidator(value) : of(true);
|
|
209
|
+
const modifiedObs = this.dbxActionFormModified ? this.dbxActionFormModified(value) : of(true);
|
|
210
|
+
return combineLatest([validatorObs, modifiedObs]).pipe(first(), map(([valid, modified]) => valid && modified));
|
|
216
211
|
}
|
|
217
212
|
readyValue(value) {
|
|
218
213
|
return of({ value });
|
|
@@ -255,7 +250,7 @@ DbxActionFormSafetyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12
|
|
|
255
250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFormSafetyDirective, decorators: [{
|
|
256
251
|
type: Directive,
|
|
257
252
|
args: [{
|
|
258
|
-
selector: '[dbxActionFormSafety]'
|
|
253
|
+
selector: '[dbxActionFormSafety]'
|
|
259
254
|
}]
|
|
260
255
|
}], ctorParameters: function () { return [{ type: DbxActionFormDirective, decorators: [{
|
|
261
256
|
type: Host
|
|
@@ -268,59 +263,37 @@ class DbxFormActionTransitionModule {
|
|
|
268
263
|
}
|
|
269
264
|
DbxFormActionTransitionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
270
265
|
DbxFormActionTransitionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, declarations: [DbxActionFormSafetyDirective], imports: [CommonModule], exports: [DbxActionFormSafetyDirective] });
|
|
271
|
-
DbxFormActionTransitionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, imports: [[
|
|
272
|
-
CommonModule
|
|
273
|
-
]] });
|
|
266
|
+
DbxFormActionTransitionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, imports: [[CommonModule]] });
|
|
274
267
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, decorators: [{
|
|
275
268
|
type: NgModule,
|
|
276
269
|
args: [{
|
|
277
|
-
imports: [
|
|
278
|
-
|
|
279
|
-
]
|
|
280
|
-
declarations: [
|
|
281
|
-
DbxActionFormSafetyDirective
|
|
282
|
-
],
|
|
283
|
-
exports: [
|
|
284
|
-
DbxActionFormSafetyDirective
|
|
285
|
-
]
|
|
270
|
+
imports: [CommonModule],
|
|
271
|
+
declarations: [DbxActionFormSafetyDirective],
|
|
272
|
+
exports: [DbxActionFormSafetyDirective]
|
|
286
273
|
}]
|
|
287
274
|
}] });
|
|
288
275
|
|
|
289
276
|
class DbxFormActionModule {
|
|
290
277
|
}
|
|
291
278
|
DbxFormActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
292
|
-
DbxFormActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, declarations: [DbxActionFormDirective], imports: [CommonModule,
|
|
293
|
-
|
|
294
|
-
DbxFormActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, imports: [[
|
|
295
|
-
CommonModule,
|
|
296
|
-
MatDialogModule
|
|
297
|
-
]] });
|
|
279
|
+
DbxFormActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, declarations: [DbxActionFormDirective], imports: [CommonModule, MatDialogModule], exports: [DbxActionFormDirective] });
|
|
280
|
+
DbxFormActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, imports: [[CommonModule, MatDialogModule]] });
|
|
298
281
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, decorators: [{
|
|
299
282
|
type: NgModule,
|
|
300
283
|
args: [{
|
|
301
|
-
imports: [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
],
|
|
305
|
-
declarations: [
|
|
306
|
-
DbxActionFormDirective
|
|
307
|
-
],
|
|
308
|
-
exports: [
|
|
309
|
-
DbxActionFormDirective
|
|
310
|
-
]
|
|
284
|
+
imports: [CommonModule, MatDialogModule],
|
|
285
|
+
declarations: [DbxActionFormDirective],
|
|
286
|
+
exports: [DbxActionFormDirective]
|
|
311
287
|
}]
|
|
312
288
|
}] });
|
|
313
289
|
|
|
314
290
|
function dbxFormSourceObservable(form, inputObs, mode$) {
|
|
315
291
|
const observable = asObservable(inputObs);
|
|
316
|
-
return combineLatest([
|
|
317
|
-
observable.pipe(distinctUntilChanged()),
|
|
318
|
-
mode$.pipe(distinctUntilChanged())
|
|
319
|
-
]).pipe(switchMap(([value, mode]) => form.stream$.pipe(
|
|
292
|
+
return combineLatest([observable.pipe(distinctUntilChanged()), mode$.pipe(distinctUntilChanged())]).pipe(switchMap(([value, mode]) => form.stream$.pipe(
|
|
320
293
|
// wait for the form to finish initializing.
|
|
321
294
|
filter((x) => x.state !== DbxFormState.INITIALIZING),
|
|
322
295
|
// if mode is reset, then filter out changes until the form is reset again.
|
|
323
|
-
filter((x) => (
|
|
296
|
+
filter((x) => (mode === 'reset' ? x.state === DbxFormState.RESET : true)), first(), map(() => value))));
|
|
324
297
|
}
|
|
325
298
|
/**
|
|
326
299
|
* Used with a FormComponent to set the value based on the input value.
|
|
@@ -437,7 +410,9 @@ class DbxFormValueChangesDirective extends AbstractSubscriptionDirective {
|
|
|
437
410
|
this.dbxFormValueChange = new EventEmitter();
|
|
438
411
|
}
|
|
439
412
|
ngOnInit() {
|
|
440
|
-
this.sub = this.form.stream
|
|
413
|
+
this.sub = this.form.stream$
|
|
414
|
+
.pipe(mergeMap((x) => this.form.getValue().pipe(first(), map((value) => ({ isComplete: x.isComplete, value })))), delay(0))
|
|
415
|
+
.subscribe(({ isComplete, value }) => {
|
|
441
416
|
if (isComplete) {
|
|
442
417
|
this.dbxFormValueChange.next(value);
|
|
443
418
|
}
|
|
@@ -467,50 +442,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
467
442
|
class DbxFormIoModule {
|
|
468
443
|
}
|
|
469
444
|
DbxFormIoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
470
|
-
DbxFormIoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, declarations: [DbxFormSourceDirective,
|
|
471
|
-
|
|
472
|
-
DbxFormLoadingSourceDirective], imports: [CommonModule], exports: [DbxFormSourceDirective,
|
|
473
|
-
DbxFormValueChangesDirective,
|
|
474
|
-
DbxFormLoadingSourceDirective] });
|
|
475
|
-
DbxFormIoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, imports: [[
|
|
476
|
-
CommonModule
|
|
477
|
-
]] });
|
|
445
|
+
DbxFormIoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, declarations: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective], imports: [CommonModule], exports: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective] });
|
|
446
|
+
DbxFormIoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, imports: [[CommonModule]] });
|
|
478
447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, decorators: [{
|
|
479
448
|
type: NgModule,
|
|
480
449
|
args: [{
|
|
481
|
-
imports: [
|
|
482
|
-
|
|
483
|
-
]
|
|
484
|
-
declarations: [
|
|
485
|
-
DbxFormSourceDirective,
|
|
486
|
-
DbxFormValueChangesDirective,
|
|
487
|
-
DbxFormLoadingSourceDirective
|
|
488
|
-
],
|
|
489
|
-
exports: [
|
|
490
|
-
DbxFormSourceDirective,
|
|
491
|
-
DbxFormValueChangesDirective,
|
|
492
|
-
DbxFormLoadingSourceDirective
|
|
493
|
-
]
|
|
450
|
+
imports: [CommonModule],
|
|
451
|
+
declarations: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective],
|
|
452
|
+
exports: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective]
|
|
494
453
|
}]
|
|
495
454
|
}] });
|
|
496
455
|
|
|
497
456
|
class DbxFormModule {
|
|
498
457
|
}
|
|
499
458
|
DbxFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
500
|
-
DbxFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, exports: [DbxFormActionTransitionModule,
|
|
501
|
-
|
|
502
|
-
DbxFormIoModule] });
|
|
503
|
-
DbxFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, imports: [DbxFormActionTransitionModule,
|
|
504
|
-
DbxFormActionModule,
|
|
505
|
-
DbxFormIoModule] });
|
|
459
|
+
DbxFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, exports: [DbxFormActionTransitionModule, DbxFormActionModule, DbxFormIoModule] });
|
|
460
|
+
DbxFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, imports: [DbxFormActionTransitionModule, DbxFormActionModule, DbxFormIoModule] });
|
|
506
461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, decorators: [{
|
|
507
462
|
type: NgModule,
|
|
508
463
|
args: [{
|
|
509
|
-
exports: [
|
|
510
|
-
DbxFormActionTransitionModule,
|
|
511
|
-
DbxFormActionModule,
|
|
512
|
-
DbxFormIoModule
|
|
513
|
-
]
|
|
464
|
+
exports: [DbxFormActionTransitionModule, DbxFormActionModule, DbxFormIoModule]
|
|
514
465
|
}]
|
|
515
466
|
}] });
|
|
516
467
|
|
|
@@ -575,9 +526,9 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
575
526
|
constructor() {
|
|
576
527
|
super(...arguments);
|
|
577
528
|
this._displayContent = new BehaviorSubject(undefined);
|
|
578
|
-
this.displayContent$ = this._displayContent.pipe(switchMapMaybeObs(), distinctUntilChanged
|
|
579
|
-
this.anchor$ = this.displayContent$.pipe(map
|
|
580
|
-
this.rippleDisabled$ = this.displayContent$.pipe(map
|
|
529
|
+
this.displayContent$ = this._displayContent.pipe(switchMapMaybeObs(), distinctUntilChanged(), shareReplay(1));
|
|
530
|
+
this.anchor$ = this.displayContent$.pipe(map((x) => x.anchor), shareReplay(1));
|
|
531
|
+
this.rippleDisabled$ = this.displayContent$.pipe(map((x) => x.ripple === false || (x.ripple !== true && !x.anchor)), distinctUntilChanged(), shareReplay(1));
|
|
581
532
|
}
|
|
582
533
|
get formGroup() {
|
|
583
534
|
return this.form;
|
|
@@ -611,10 +562,10 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
611
562
|
}
|
|
612
563
|
}
|
|
613
564
|
DbxChecklistItemFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxChecklistItemFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
614
|
-
DbxChecklistItemFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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=\"
|
|
565
|
+
DbxChecklistItemFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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) !== true\">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; }) } });
|
|
615
566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxChecklistItemFieldComponent, decorators: [{
|
|
616
567
|
type: Component,
|
|
617
|
-
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=\"
|
|
568
|
+
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) !== true\">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" }]
|
|
618
569
|
}] });
|
|
619
570
|
class DbxChecklistItemContentComponent extends AbstractSubscriptionDirective {
|
|
620
571
|
constructor(checklistItemFieldComponent, cdRef) {
|
|
@@ -635,12 +586,16 @@ class DbxChecklistItemContentComponent extends AbstractSubscriptionDirective {
|
|
|
635
586
|
}
|
|
636
587
|
}
|
|
637
588
|
DbxChecklistItemContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxChecklistItemContentComponent, deps: [{ token: DbxChecklistItemFieldComponent }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
638
|
-
DbxChecklistItemContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxChecklistItemContentComponent, selector: "dbx-checklist-item-content-component", usesInheritance: true, ngImport: i0, template:
|
|
589
|
+
DbxChecklistItemContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxChecklistItemContentComponent, selector: "dbx-checklist-item-content-component", usesInheritance: true, ngImport: i0, template: `
|
|
590
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
591
|
+
`, isInline: true, components: [{ type: i2.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
|
|
639
592
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxChecklistItemContentComponent, decorators: [{
|
|
640
593
|
type: Component,
|
|
641
594
|
args: [{
|
|
642
595
|
selector: 'dbx-checklist-item-content-component',
|
|
643
|
-
template:
|
|
596
|
+
template: `
|
|
597
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
598
|
+
`
|
|
644
599
|
}]
|
|
645
600
|
}], ctorParameters: function () { return [{ type: DbxChecklistItemFieldComponent }, { type: i0.ChangeDetectorRef }]; } });
|
|
646
601
|
|
|
@@ -659,8 +614,7 @@ DbxFormInfoWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
659
614
|
<ng-container #fieldComponent></ng-container>
|
|
660
615
|
</div>
|
|
661
616
|
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
662
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
663
|
-
(click)="onInfoClick()">
|
|
617
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')" (click)="onInfoClick()">
|
|
664
618
|
<mat-icon>info</mat-icon>
|
|
665
619
|
</button>
|
|
666
620
|
</div>
|
|
@@ -675,8 +629,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
675
629
|
<ng-container #fieldComponent></ng-container>
|
|
676
630
|
</div>
|
|
677
631
|
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
678
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
679
|
-
(click)="onInfoClick()">
|
|
632
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')" (click)="onInfoClick()">
|
|
680
633
|
<mat-icon>info</mat-icon>
|
|
681
634
|
</button>
|
|
682
635
|
</div>
|
|
@@ -748,17 +701,17 @@ class DbxFormSubsectionWrapperComponent extends FieldWrapper {
|
|
|
748
701
|
}
|
|
749
702
|
DbxFormSubsectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSubsectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
750
703
|
DbxFormSubsectionWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormSubsectionWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
704
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
705
|
+
<ng-container #fieldComponent></ng-container>
|
|
706
|
+
</dbx-subsection>
|
|
754
707
|
`, isInline: true, components: [{ type: i1$1.DbxSubSectionComponent, selector: "dbx-subsection" }] });
|
|
755
708
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSubsectionWrapperComponent, decorators: [{
|
|
756
709
|
type: Component,
|
|
757
710
|
args: [{
|
|
758
711
|
template: `
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
712
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
713
|
+
<ng-container #fieldComponent></ng-container>
|
|
714
|
+
</dbx-subsection>
|
|
762
715
|
`
|
|
763
716
|
}]
|
|
764
717
|
}] });
|
|
@@ -777,10 +730,10 @@ class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
|
777
730
|
else {
|
|
778
731
|
return this.hasValue$;
|
|
779
732
|
}
|
|
780
|
-
}), shareReplay
|
|
733
|
+
}), shareReplay(1));
|
|
781
734
|
this.hasValue$ = this.formControl$.pipe(switchMap((x) => x.valueChanges.pipe(startWith(x.value), map((value) => {
|
|
782
735
|
return this.hasValueFn(value);
|
|
783
|
-
}), shareReplay
|
|
736
|
+
}), shareReplay(1))));
|
|
784
737
|
}
|
|
785
738
|
get expandableSection() {
|
|
786
739
|
return this.to.expandWrapper;
|
|
@@ -825,27 +778,27 @@ class DbxFormExpandWrapperComponent extends AbstractFormExpandableSectionWrapper
|
|
|
825
778
|
}
|
|
826
779
|
DbxFormExpandWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExpandWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
827
780
|
DbxFormExpandWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormExpandWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
781
|
+
<ng-container [ngSwitch]="show$ | async">
|
|
782
|
+
<ng-container *ngSwitchCase="true">
|
|
783
|
+
<ng-container #fieldComponent></ng-container>
|
|
784
|
+
</ng-container>
|
|
785
|
+
<ng-container *ngSwitchCase="false">
|
|
786
|
+
<span class="dbx-form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
787
|
+
</ng-container>
|
|
834
788
|
</ng-container>
|
|
835
|
-
</ng-container>
|
|
836
789
|
`, isInline: true, directives: [{ type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i5.AsyncPipe } });
|
|
837
790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExpandWrapperComponent, decorators: [{
|
|
838
791
|
type: Component,
|
|
839
792
|
args: [{
|
|
840
793
|
template: `
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
794
|
+
<ng-container [ngSwitch]="show$ | async">
|
|
795
|
+
<ng-container *ngSwitchCase="true">
|
|
796
|
+
<ng-container #fieldComponent></ng-container>
|
|
797
|
+
</ng-container>
|
|
798
|
+
<ng-container *ngSwitchCase="false">
|
|
799
|
+
<span class="dbx-form-expandable-section-button" (click)="open()">{{ expandLabel }}</span>
|
|
800
|
+
</ng-container>
|
|
847
801
|
</ng-container>
|
|
848
|
-
</ng-container>
|
|
849
802
|
`
|
|
850
803
|
}]
|
|
851
804
|
}] });
|
|
@@ -855,7 +808,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
855
808
|
*/
|
|
856
809
|
class AutoTouchFieldWrapperComponent extends FieldWrapper {
|
|
857
810
|
ngOnInit() {
|
|
858
|
-
this.formControl.valueChanges.pipe(delay
|
|
811
|
+
this.formControl.valueChanges.pipe(delay(200)).subscribe(() => {
|
|
859
812
|
if (!this.formControl.pristine && this.formControl.untouched) {
|
|
860
813
|
this.formControl.markAsTouched();
|
|
861
814
|
this.formControl.updateValueAndValidity();
|
|
@@ -864,11 +817,15 @@ class AutoTouchFieldWrapperComponent extends FieldWrapper {
|
|
|
864
817
|
}
|
|
865
818
|
}
|
|
866
819
|
AutoTouchFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AutoTouchFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
867
|
-
AutoTouchFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: AutoTouchFieldWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template:
|
|
820
|
+
AutoTouchFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: AutoTouchFieldWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
821
|
+
<ng-container #fieldComponent></ng-container>
|
|
822
|
+
`, isInline: true });
|
|
868
823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AutoTouchFieldWrapperComponent, decorators: [{
|
|
869
824
|
type: Component,
|
|
870
825
|
args: [{
|
|
871
|
-
template:
|
|
826
|
+
template: `
|
|
827
|
+
<ng-container #fieldComponent></ng-container>
|
|
828
|
+
`
|
|
872
829
|
}]
|
|
873
830
|
}] });
|
|
874
831
|
|
|
@@ -878,14 +835,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
878
835
|
class DbxFormToggleWrapperComponent extends AbstractFormExpandableSectionWrapperDirective {
|
|
879
836
|
constructor() {
|
|
880
837
|
super(...arguments);
|
|
881
|
-
this.slideLabel$ = this._toggleOpen.pipe(switchMap(x => {
|
|
838
|
+
this.slideLabel$ = this._toggleOpen.pipe(switchMap((x) => {
|
|
882
839
|
if (this.expandableSection?.toggleLabelObs) {
|
|
883
840
|
return this.expandableSection?.toggleLabelObs(x);
|
|
884
841
|
}
|
|
885
842
|
else {
|
|
886
843
|
return of(this.expandLabel);
|
|
887
844
|
}
|
|
888
|
-
}), shareReplay
|
|
845
|
+
}), shareReplay(1));
|
|
889
846
|
}
|
|
890
847
|
onToggleChange() {
|
|
891
848
|
this.show$.pipe(first()).subscribe((show) => {
|
|
@@ -895,27 +852,27 @@ class DbxFormToggleWrapperComponent extends AbstractFormExpandableSectionWrapper
|
|
|
895
852
|
}
|
|
896
853
|
DbxFormToggleWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormToggleWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
897
854
|
DbxFormToggleWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormToggleWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
855
|
+
<div class="dbx-form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
856
|
+
<div class="dbx-form-toggle-wrapper-toggle">
|
|
857
|
+
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ slideLabel$ | async }}</mat-slide-toggle>
|
|
858
|
+
</div>
|
|
859
|
+
<ng-container *ngSwitchCase="true">
|
|
860
|
+
<ng-container #fieldComponent></ng-container>
|
|
861
|
+
</ng-container>
|
|
901
862
|
</div>
|
|
902
|
-
<ng-container *ngSwitchCase="true">
|
|
903
|
-
<ng-container #fieldComponent></ng-container>
|
|
904
|
-
</ng-container>
|
|
905
|
-
</div>
|
|
906
863
|
`, 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 } });
|
|
907
864
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormToggleWrapperComponent, decorators: [{
|
|
908
865
|
type: Component,
|
|
909
866
|
args: [{
|
|
910
867
|
template: `
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
868
|
+
<div class="dbx-form-toggle-wrapper" [ngSwitch]="show$ | async">
|
|
869
|
+
<div class="dbx-form-toggle-wrapper-toggle">
|
|
870
|
+
<mat-slide-toggle [checked]="show$ | async" (toggleChange)="onToggleChange()">{{ slideLabel$ | async }}</mat-slide-toggle>
|
|
871
|
+
</div>
|
|
872
|
+
<ng-container *ngSwitchCase="true">
|
|
873
|
+
<ng-container #fieldComponent></ng-container>
|
|
874
|
+
</ng-container>
|
|
914
875
|
</div>
|
|
915
|
-
<ng-container *ngSwitchCase="true">
|
|
916
|
-
<ng-container #fieldComponent></ng-container>
|
|
917
|
-
</ng-container>
|
|
918
|
-
</div>
|
|
919
876
|
`
|
|
920
877
|
}]
|
|
921
878
|
}] });
|
|
@@ -924,7 +881,7 @@ class DbxFormStyleWrapperComponent extends FieldWrapper {
|
|
|
924
881
|
constructor() {
|
|
925
882
|
super(...arguments);
|
|
926
883
|
this._style = new BehaviorSubject(undefined);
|
|
927
|
-
this.style$ = this._style.pipe(switchMapMaybeDefault(''), shareReplay
|
|
884
|
+
this.style$ = this._style.pipe(switchMapMaybeDefault(''), shareReplay(1));
|
|
928
885
|
}
|
|
929
886
|
get styleWrapper() {
|
|
930
887
|
return this.field.styleWrapper;
|
|
@@ -999,15 +956,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
999
956
|
class DbxFormFormlyWrapperModule {
|
|
1000
957
|
}
|
|
1001
958
|
DbxFormFormlyWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1002
|
-
DbxFormFormlyWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, declarations: [AutoTouchFieldWrapperComponent,
|
|
1003
|
-
DbxFormSectionWrapperComponent,
|
|
1004
|
-
DbxFormSubsectionWrapperComponent,
|
|
1005
|
-
DbxFormInfoWrapperComponent,
|
|
1006
|
-
DbxFormExpandWrapperComponent,
|
|
1007
|
-
DbxFormToggleWrapperComponent,
|
|
1008
|
-
DbxFormFlexWrapperComponent,
|
|
1009
|
-
DbxFormStyleWrapperComponent,
|
|
1010
|
-
DbxFormWorkingWrapperComponent], imports: [CommonModule,
|
|
959
|
+
DbxFormFormlyWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, declarations: [AutoTouchFieldWrapperComponent, DbxFormSectionWrapperComponent, DbxFormSubsectionWrapperComponent, DbxFormInfoWrapperComponent, DbxFormExpandWrapperComponent, DbxFormToggleWrapperComponent, DbxFormFlexWrapperComponent, DbxFormStyleWrapperComponent, DbxFormWorkingWrapperComponent], imports: [CommonModule,
|
|
1011
960
|
DbxTextModule,
|
|
1012
961
|
DbxLoadingModule,
|
|
1013
962
|
DbxFlexLayoutModule,
|
|
@@ -1067,17 +1016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1067
1016
|
]
|
|
1068
1017
|
})
|
|
1069
1018
|
],
|
|
1070
|
-
declarations: [
|
|
1071
|
-
AutoTouchFieldWrapperComponent,
|
|
1072
|
-
DbxFormSectionWrapperComponent,
|
|
1073
|
-
DbxFormSubsectionWrapperComponent,
|
|
1074
|
-
DbxFormInfoWrapperComponent,
|
|
1075
|
-
DbxFormExpandWrapperComponent,
|
|
1076
|
-
DbxFormToggleWrapperComponent,
|
|
1077
|
-
DbxFormFlexWrapperComponent,
|
|
1078
|
-
DbxFormStyleWrapperComponent,
|
|
1079
|
-
DbxFormWorkingWrapperComponent
|
|
1080
|
-
],
|
|
1019
|
+
declarations: [AutoTouchFieldWrapperComponent, DbxFormSectionWrapperComponent, DbxFormSubsectionWrapperComponent, DbxFormInfoWrapperComponent, DbxFormExpandWrapperComponent, DbxFormToggleWrapperComponent, DbxFormFlexWrapperComponent, DbxFormStyleWrapperComponent, DbxFormWorkingWrapperComponent],
|
|
1081
1020
|
exports: []
|
|
1082
1021
|
}]
|
|
1083
1022
|
}] });
|
|
@@ -1085,9 +1024,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1085
1024
|
class DbxFormFormlyChecklistItemFieldModule {
|
|
1086
1025
|
}
|
|
1087
1026
|
DbxFormFormlyChecklistItemFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1088
|
-
DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, declarations: [DbxChecklistItemFieldComponent,
|
|
1089
|
-
DbxChecklistItemContentComponent,
|
|
1090
|
-
DbxDefaultChecklistItemFieldDisplayComponent], imports: [CommonModule,
|
|
1027
|
+
DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, declarations: [DbxChecklistItemFieldComponent, DbxChecklistItemContentComponent, DbxDefaultChecklistItemFieldDisplayComponent], imports: [CommonModule,
|
|
1091
1028
|
DbxTextModule,
|
|
1092
1029
|
FormsModule,
|
|
1093
1030
|
ReactiveFormsModule,
|
|
@@ -1111,9 +1048,7 @@ DbxFormFormlyChecklistItemFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVers
|
|
|
1111
1048
|
DbxInjectionComponentModule,
|
|
1112
1049
|
DbxFormFormlyWrapperModule,
|
|
1113
1050
|
FormlyModule.forChild({
|
|
1114
|
-
types: [
|
|
1115
|
-
{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }
|
|
1116
|
-
]
|
|
1051
|
+
types: [{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }]
|
|
1117
1052
|
})
|
|
1118
1053
|
], DbxFormFormlyWrapperModule] });
|
|
1119
1054
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, decorators: [{
|
|
@@ -1132,19 +1067,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1132
1067
|
DbxInjectionComponentModule,
|
|
1133
1068
|
DbxFormFormlyWrapperModule,
|
|
1134
1069
|
FormlyModule.forChild({
|
|
1135
|
-
types: [
|
|
1136
|
-
{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }
|
|
1137
|
-
]
|
|
1070
|
+
types: [{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }]
|
|
1138
1071
|
})
|
|
1139
1072
|
],
|
|
1140
|
-
declarations: [
|
|
1141
|
-
|
|
1142
|
-
DbxChecklistItemContentComponent,
|
|
1143
|
-
DbxDefaultChecklistItemFieldDisplayComponent
|
|
1144
|
-
],
|
|
1145
|
-
exports: [
|
|
1146
|
-
DbxFormFormlyWrapperModule
|
|
1147
|
-
]
|
|
1073
|
+
declarations: [DbxChecklistItemFieldComponent, DbxChecklistItemContentComponent, DbxDefaultChecklistItemFieldDisplayComponent],
|
|
1074
|
+
exports: [DbxFormFormlyWrapperModule]
|
|
1148
1075
|
}]
|
|
1149
1076
|
}] });
|
|
1150
1077
|
|
|
@@ -1165,7 +1092,9 @@ function templateOptionsForFieldConfig(fieldConfig, override) {
|
|
|
1165
1092
|
};
|
|
1166
1093
|
}
|
|
1167
1094
|
function templateOptionsValueForFieldConfig(fieldConfig, override) {
|
|
1168
|
-
const { label, placeholder, required, readonly, description, autocomplete } = mergeObjects([fieldConfig, override], {
|
|
1095
|
+
const { label, placeholder, required, readonly, description, autocomplete } = mergeObjects([fieldConfig, override], {
|
|
1096
|
+
keysFilter: ['label', 'placeholder', 'required', 'readonly', 'description', 'autocomplete']
|
|
1097
|
+
});
|
|
1169
1098
|
const attributes = mergeObjects([fieldConfig.attributes, override?.attributes]);
|
|
1170
1099
|
const result = filterFromPOJO({
|
|
1171
1100
|
...override,
|
|
@@ -1237,10 +1166,7 @@ class ChecklistItemFieldDataSetBuilder {
|
|
|
1237
1166
|
key
|
|
1238
1167
|
};
|
|
1239
1168
|
if (currentField.displayContentObs && config.displayContentObs) {
|
|
1240
|
-
mergedConfig.displayContentObs = combineLatest([
|
|
1241
|
-
currentField.displayContentObs,
|
|
1242
|
-
config.displayContentObs
|
|
1243
|
-
]).pipe(map$1(([a, b]) => {
|
|
1169
|
+
mergedConfig.displayContentObs = combineLatest([currentField.displayContentObs, config.displayContentObs]).pipe(map(([a, b]) => {
|
|
1244
1170
|
const result = {
|
|
1245
1171
|
...a,
|
|
1246
1172
|
...b
|
|
@@ -1283,10 +1209,11 @@ class ChecklistItemFieldDataSetBuilder {
|
|
|
1283
1209
|
}
|
|
1284
1210
|
field(config) {
|
|
1285
1211
|
const key = config.key;
|
|
1286
|
-
|
|
1212
|
+
const field = {
|
|
1287
1213
|
key,
|
|
1288
1214
|
field: config
|
|
1289
|
-
}
|
|
1215
|
+
};
|
|
1216
|
+
this._fields.set(key, field);
|
|
1290
1217
|
}
|
|
1291
1218
|
// MARK: Build/Finish
|
|
1292
1219
|
build() {
|
|
@@ -1296,7 +1223,7 @@ class ChecklistItemFieldDataSetBuilder {
|
|
|
1296
1223
|
}
|
|
1297
1224
|
// MARK: Utility
|
|
1298
1225
|
customContentFromData(mapFn) {
|
|
1299
|
-
return this.dataObs$.pipe(map
|
|
1226
|
+
return this.dataObs$.pipe(map(mapFn));
|
|
1300
1227
|
}
|
|
1301
1228
|
contentWithValueFromData(key, contentFn) {
|
|
1302
1229
|
return this.customContentFromData((data) => {
|
|
@@ -1343,9 +1270,7 @@ DbxFormFormlyComponentFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion:
|
|
|
1343
1270
|
CommonModule,
|
|
1344
1271
|
DbxInjectionComponentModule,
|
|
1345
1272
|
FormlyModule.forChild({
|
|
1346
|
-
types: [
|
|
1347
|
-
{ name: 'component', component: DbxFormComponentFieldComponent }
|
|
1348
|
-
]
|
|
1273
|
+
types: [{ name: 'component', component: DbxFormComponentFieldComponent }]
|
|
1349
1274
|
})
|
|
1350
1275
|
]] });
|
|
1351
1276
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyComponentFieldModule, decorators: [{
|
|
@@ -1355,17 +1280,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1355
1280
|
CommonModule,
|
|
1356
1281
|
DbxInjectionComponentModule,
|
|
1357
1282
|
FormlyModule.forChild({
|
|
1358
|
-
types: [
|
|
1359
|
-
{ name: 'component', component: DbxFormComponentFieldComponent }
|
|
1360
|
-
]
|
|
1283
|
+
types: [{ name: 'component', component: DbxFormComponentFieldComponent }]
|
|
1361
1284
|
})
|
|
1362
1285
|
],
|
|
1363
|
-
declarations: [
|
|
1364
|
-
|
|
1365
|
-
],
|
|
1366
|
-
exports: [
|
|
1367
|
-
DbxFormComponentFieldComponent
|
|
1368
|
-
]
|
|
1286
|
+
declarations: [DbxFormComponentFieldComponent],
|
|
1287
|
+
exports: [DbxFormComponentFieldComponent]
|
|
1369
1288
|
}]
|
|
1370
1289
|
}] });
|
|
1371
1290
|
|
|
@@ -1387,14 +1306,14 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1387
1306
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
1388
1307
|
this._displayHashMap = new BehaviorSubject(new Map());
|
|
1389
1308
|
this.filterInputValue$ = this.inputCtrl.valueChanges.pipe(startWith(undefined));
|
|
1390
|
-
this.filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged(), shareReplay
|
|
1391
|
-
this.loadResultsDisplayValuesState$ = this.formControl$.pipe(first(), switchMap(() => this.loadValuesFn().pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)),
|
|
1392
|
-
this._formControlValue = this.formControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value), shareReplay
|
|
1393
|
-
this.loadResultsDisplayValues$ = this.loadResultsDisplayValuesState$.pipe(map(x => x?.value ?? []));
|
|
1309
|
+
this.filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged(), shareReplay(1));
|
|
1310
|
+
this.loadResultsDisplayValuesState$ = this.formControl$.pipe(first(), switchMap(() => this.loadValuesFn().pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)), startWithBeginLoading())), shareReplay(1));
|
|
1311
|
+
this._formControlValue = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value), shareReplay(1))));
|
|
1312
|
+
this.loadResultsDisplayValues$ = this.loadResultsDisplayValuesState$.pipe(map((x) => x?.value ?? []));
|
|
1394
1313
|
/**
|
|
1395
1314
|
* Current values in the form control.
|
|
1396
1315
|
*/
|
|
1397
|
-
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay
|
|
1316
|
+
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay(1));
|
|
1398
1317
|
/**
|
|
1399
1318
|
* Current values with their display value.
|
|
1400
1319
|
*/
|
|
@@ -1403,16 +1322,16 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1403
1322
|
const valuesNotInDisplayMap = [];
|
|
1404
1323
|
currentValues.forEach((x) => {
|
|
1405
1324
|
const key = this.hashForValue(x);
|
|
1406
|
-
|
|
1325
|
+
const displayValue = displayValuesMap.get(key)?.[0];
|
|
1407
1326
|
if (!displayValue) {
|
|
1408
1327
|
valuesNotInDisplayMap.push(x);
|
|
1409
1328
|
}
|
|
1410
1329
|
});
|
|
1411
1330
|
if (valuesNotInDisplayMap.length) {
|
|
1412
|
-
return this.loadDisplayValuesForValues(valuesNotInDisplayMap).pipe(map(x => mapLoadingStateResults(x, {
|
|
1331
|
+
return this.loadDisplayValuesForValues(valuesNotInDisplayMap).pipe(map((x) => mapLoadingStateResults(x, {
|
|
1413
1332
|
mapValue: (loadedValues) => {
|
|
1414
|
-
loadedValues.forEach(x => x.isUnknown = x.isUnknown ?? true); // Assign unknown flag.
|
|
1415
|
-
return
|
|
1333
|
+
loadedValues.forEach((x) => (x.isUnknown = x.isUnknown ?? true)); // Assign unknown flag.
|
|
1334
|
+
return [...displayValues, ...loadedValues];
|
|
1416
1335
|
}
|
|
1417
1336
|
})));
|
|
1418
1337
|
}
|
|
@@ -1423,27 +1342,27 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1423
1342
|
/**
|
|
1424
1343
|
* Results to be displayed if filtered.
|
|
1425
1344
|
*/
|
|
1426
|
-
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, {
|
|
1345
|
+
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, {
|
|
1427
1346
|
mapValue: (displayValues) => {
|
|
1428
|
-
const valueHashSet = new Set(values.map(x => this.hashForValue(x)));
|
|
1429
|
-
return displayValues.filter(x => !x.isUnknown && valueHashSet.has(x._hash));
|
|
1347
|
+
const valueHashSet = new Set(values.map((x) => this.hashForValue(x)));
|
|
1348
|
+
return displayValues.filter((x) => !x.isUnknown && valueHashSet.has(x._hash));
|
|
1430
1349
|
}
|
|
1431
|
-
})),
|
|
1432
|
-
this.filteredSearchResults$ = this.filteredSearchResultsState$.pipe(map(x => x?.value), filterMaybe(), shareReplay
|
|
1350
|
+
})), startWithBeginLoading())))), shareReplay(1));
|
|
1351
|
+
this.filteredSearchResults$ = this.filteredSearchResultsState$.pipe(map((x) => x?.value), filterMaybe(), shareReplay(1));
|
|
1433
1352
|
this.items$ = combineLatest([this.filteredSearchResults$, this.values$]).pipe(map(([displayValues, values]) => {
|
|
1434
|
-
const selectedHashValuesSet = new Set(values.map(x => this.hashForValue(x)));
|
|
1353
|
+
const selectedHashValuesSet = new Set(values.map((x) => this.hashForValue(x)));
|
|
1435
1354
|
let items = displayValues.map((x) => ({ itemValue: x, selected: selectedHashValuesSet.has(x._hash) }));
|
|
1436
1355
|
if (this.sortItems) {
|
|
1437
1356
|
items = this.sortItems(items);
|
|
1438
1357
|
}
|
|
1439
1358
|
return items;
|
|
1440
|
-
}), shareReplay
|
|
1441
|
-
this.itemsLoadingState$ = this.loadResultsDisplayValues$.pipe(switchMap(
|
|
1359
|
+
}), shareReplay(1));
|
|
1360
|
+
this.itemsLoadingState$ = this.loadResultsDisplayValues$.pipe(switchMap(() => this.items$.pipe(first(), map((x) => successResult(x)), startWithBeginLoading(), shareReplay(1))));
|
|
1442
1361
|
/**
|
|
1443
1362
|
* Context used for managing the loading of items, or when the current results change.
|
|
1444
1363
|
*/
|
|
1445
1364
|
this.context = new ListLoadingStateContextInstance({ obs: this.itemsLoadingState$, showLoadingOnNoValue: false });
|
|
1446
|
-
this.filterItemsLoadingState$ = this.items$.pipe(map(x => successResult(x)),
|
|
1365
|
+
this.filterItemsLoadingState$ = this.items$.pipe(map((x) => successResult(x)), startWithBeginLoading(), shareReplay(1));
|
|
1447
1366
|
/**
|
|
1448
1367
|
* Context used for searching/filtering.
|
|
1449
1368
|
*/
|
|
@@ -1469,13 +1388,13 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1469
1388
|
return this.pickableField.filterLabel;
|
|
1470
1389
|
}
|
|
1471
1390
|
get name() {
|
|
1472
|
-
return this.field.name ??
|
|
1391
|
+
return this.field.name ?? camelCase(this.label ?? this.key);
|
|
1473
1392
|
}
|
|
1474
1393
|
get label() {
|
|
1475
1394
|
return this.field.templateOptions?.label;
|
|
1476
1395
|
}
|
|
1477
1396
|
get autocomplete() {
|
|
1478
|
-
return this.field.templateOptions?.attributes?.['autocomplete'] ?? this.key;
|
|
1397
|
+
return (this.field.templateOptions?.attributes?.['autocomplete'] ?? this.key);
|
|
1479
1398
|
}
|
|
1480
1399
|
get changeSelectionModeToViewOnDisabled() {
|
|
1481
1400
|
return this.pickableField.changeSelectionModeToViewOnDisabled ?? false;
|
|
@@ -1493,7 +1412,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1493
1412
|
return Boolean(this.pickableField.filterValues);
|
|
1494
1413
|
}
|
|
1495
1414
|
get filterValuesFn() {
|
|
1496
|
-
return this.pickableField.filterValues ?? ((_, x) => of(x.map(y => y.value)));
|
|
1415
|
+
return this.pickableField.filterValues ?? ((_, x) => of(x.map((y) => y.value)));
|
|
1497
1416
|
}
|
|
1498
1417
|
get skipFilterFnOnEmpty() {
|
|
1499
1418
|
return this.pickableField.skipFilterFnOnEmpty ?? true;
|
|
@@ -1507,7 +1426,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1507
1426
|
result = this.filterValuesFn(filterText, values);
|
|
1508
1427
|
}
|
|
1509
1428
|
else {
|
|
1510
|
-
result = of(values.map(x => x.value));
|
|
1429
|
+
result = of(values.map((x) => x.value));
|
|
1511
1430
|
}
|
|
1512
1431
|
return result;
|
|
1513
1432
|
};
|
|
@@ -1533,44 +1452,44 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1533
1452
|
return this.loadDisplayValuesForFieldValues(values.map((value) => ({ value })));
|
|
1534
1453
|
}
|
|
1535
1454
|
loadDisplayValuesForFieldValues(values) {
|
|
1536
|
-
return this.getDisplayValuesForFieldValues(values).pipe(map((displayValues) => successResult(displayValues)),
|
|
1455
|
+
return this.getDisplayValuesForFieldValues(values).pipe(map((displayValues) => successResult(displayValues)), startWithBeginLoading(), shareReplay(1));
|
|
1537
1456
|
}
|
|
1538
1457
|
getDisplayValuesForFieldValues(values) {
|
|
1539
1458
|
return this._displayHashMap.pipe(mergeMap((displayMap) => {
|
|
1540
|
-
const mappingResult = values
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
const hasDisplay = mappingResult.filter(x => Boolean(x[3]));
|
|
1544
|
-
const needsDisplay = mappingResult.filter(x => !x[3]);
|
|
1459
|
+
const mappingResult = values.map((x) => [x, this.hashForValue(x.value)]).map(([x, hash], i) => [i, hash, x, displayMap.get(hash)]);
|
|
1460
|
+
const hasDisplay = mappingResult.filter((x) => Boolean(x[3]));
|
|
1461
|
+
const needsDisplay = mappingResult.filter((x) => !x[3]);
|
|
1545
1462
|
if (needsDisplay.length > 0) {
|
|
1546
1463
|
// Go get the display value.
|
|
1547
|
-
const displayValuesObs = this.displayForValue(needsDisplay.map(x => x[2]));
|
|
1464
|
+
const displayValuesObs = this.displayForValue(needsDisplay.map((x) => x[2]));
|
|
1548
1465
|
return displayValuesObs.pipe(first(), map((displayResults) => {
|
|
1549
1466
|
const displayResultsWithHash = displayResults.map((x) => {
|
|
1550
1467
|
x._hash = this.hashForValue(x.value);
|
|
1551
1468
|
return x;
|
|
1552
1469
|
});
|
|
1553
1470
|
// Create a map to re-join values later.
|
|
1554
|
-
const displayResultsMapping = displayResultsWithHash.map(x => [x, x._hash]);
|
|
1471
|
+
const displayResultsMapping = displayResultsWithHash.map((x) => [x, x._hash]);
|
|
1555
1472
|
const valueIndexHashMap = new Map(displayResultsMapping.map(([x, hash]) => [hash, x]));
|
|
1556
1473
|
// Update displayMap. No need to push an update notification.
|
|
1557
1474
|
displayResultsMapping.forEach(([x, hash]) => displayMap.set(hash, x));
|
|
1558
1475
|
// Zip values back together.
|
|
1559
|
-
const newDisplayValues = mappingResult.map(x => x[3] ?? valueIndexHashMap.get(x[1]));
|
|
1476
|
+
const newDisplayValues = mappingResult.map((x) => x[3] ?? valueIndexHashMap.get(x[1]));
|
|
1560
1477
|
// Return display values.
|
|
1561
1478
|
return newDisplayValues;
|
|
1562
1479
|
}));
|
|
1563
1480
|
}
|
|
1564
1481
|
else {
|
|
1565
1482
|
// If all display values are hashed return that.
|
|
1566
|
-
return of(hasDisplay.map(x => x[3]));
|
|
1483
|
+
return of(hasDisplay.map((x) => x[3]));
|
|
1567
1484
|
}
|
|
1568
1485
|
}));
|
|
1569
1486
|
}
|
|
1570
1487
|
ngOnInit() {
|
|
1571
1488
|
this._formControlObs.next(this.formControl);
|
|
1572
1489
|
// Focus after finished loading for the first time.
|
|
1573
|
-
this.context.loading
|
|
1490
|
+
this.context.loading$
|
|
1491
|
+
.pipe(delay(10), filter((x) => x), first())
|
|
1492
|
+
.subscribe(() => {
|
|
1574
1493
|
this.filterMatInput?.focus();
|
|
1575
1494
|
});
|
|
1576
1495
|
}
|
|
@@ -1581,7 +1500,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1581
1500
|
this.filterResultsContext.destroy();
|
|
1582
1501
|
}
|
|
1583
1502
|
_getValueOnFormControl(valueOnFormControl) {
|
|
1584
|
-
const value =
|
|
1503
|
+
const value = valueOnFormControl != null ? [].concat(valueOnFormControl) : []; // Always return an array.
|
|
1585
1504
|
return value;
|
|
1586
1505
|
}
|
|
1587
1506
|
addValue(value) {
|
|
@@ -1589,7 +1508,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1589
1508
|
}
|
|
1590
1509
|
removeValue(value) {
|
|
1591
1510
|
const hashToFilter = this.hashForValue(value);
|
|
1592
|
-
const values = this.values.filter(x => this.hashForValue(x) !== hashToFilter);
|
|
1511
|
+
const values = this.values.filter((x) => this.hashForValue(x) !== hashToFilter);
|
|
1593
1512
|
this.setValues(values);
|
|
1594
1513
|
}
|
|
1595
1514
|
setValues(values) {
|
|
@@ -1598,7 +1517,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1598
1517
|
values = findUnique(values, this.hashForValue);
|
|
1599
1518
|
}
|
|
1600
1519
|
if (!this.multiSelect) {
|
|
1601
|
-
values = [values[0]].filter(x => x != null);
|
|
1520
|
+
values = [values[0]].filter((x) => x != null);
|
|
1602
1521
|
}
|
|
1603
1522
|
this._setValueOnFormControl(values);
|
|
1604
1523
|
}
|
|
@@ -1606,7 +1525,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1606
1525
|
_setValueOnFormControl(values) {
|
|
1607
1526
|
let newValue = values;
|
|
1608
1527
|
if (!this.asArrayValue) {
|
|
1609
|
-
newValue = [values[0]].filter(x => x != null)[0];
|
|
1528
|
+
newValue = [values[0]].filter((x) => x != null)[0];
|
|
1610
1529
|
}
|
|
1611
1530
|
this.formControl.setValue(newValue);
|
|
1612
1531
|
this.formControl.markAsTouched();
|
|
@@ -1638,10 +1557,10 @@ class DbxPickableChipListFieldComponent extends AbstractDbxPickableItemFieldDire
|
|
|
1638
1557
|
}
|
|
1639
1558
|
}
|
|
1640
1559
|
DbxPickableChipListFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableChipListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1641
|
-
DbxPickableChipListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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\"
|
|
1560
|
+
DbxPickableChipListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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\" [disabled]=\"isReadonlyOrDisabled || item.disabled\">\n <span class=\"dbx-chip-label\">{{ item.itemValue.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"item.itemValue.sublabel\">{{ item.itemValue.sublabel }}</span>\n </mat-chip>\n </mat-chip-list>\n <dbx-injection [config]=\"footerConfig\"></dbx-injection>\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 [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.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", 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 } });
|
|
1642
1561
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableChipListFieldComponent, decorators: [{
|
|
1643
1562
|
type: Component,
|
|
1644
|
-
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\"
|
|
1563
|
+
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\" [disabled]=\"isReadonlyOrDisabled || item.disabled\">\n <span class=\"dbx-chip-label\">{{ item.itemValue.label }}</span>\n <span class=\"dbx-chip-sublabel\" *ngIf=\"item.itemValue.sublabel\">{{ item.itemValue.sublabel }}</span>\n </mat-chip>\n </mat-chip-list>\n <dbx-injection [config]=\"footerConfig\"></dbx-injection>\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 [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" }]
|
|
1645
1564
|
}] });
|
|
1646
1565
|
|
|
1647
1566
|
/**
|
|
@@ -1650,15 +1569,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1650
1569
|
class DbxPickableListFieldComponent extends AbstractDbxPickableItemFieldDirective {
|
|
1651
1570
|
onSelectionChange(event) {
|
|
1652
1571
|
const items = event.items;
|
|
1653
|
-
const values = items.map(x => x.itemValue.value);
|
|
1572
|
+
const values = items.map((x) => x.itemValue.value);
|
|
1654
1573
|
this.setValues(values);
|
|
1655
1574
|
}
|
|
1656
1575
|
}
|
|
1657
1576
|
DbxPickableListFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableListFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1658
|
-
DbxPickableListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$\"
|
|
1577
|
+
DbxPickableListFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$\" (selectionChange)=\"onSelectionChange($event)\"></dbx-form-pickable-item-field-item-list>\n </div>\n <dbx-injection [config]=\"footerConfig\"></dbx-injection>\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 [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.DbxInjectionComponent; }), selector: "dbx-injection, [dbxInjection], [dbx-injection]", 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; }) } });
|
|
1659
1578
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableListFieldComponent, decorators: [{
|
|
1660
1579
|
type: Component,
|
|
1661
|
-
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$\"
|
|
1580
|
+
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$\" (selectionChange)=\"onSelectionChange($event)\"></dbx-form-pickable-item-field-item-list>\n </div>\n <dbx-injection [config]=\"footerConfig\"></dbx-injection>\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 [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" }]
|
|
1662
1581
|
}] });
|
|
1663
1582
|
// MARK: Selection List
|
|
1664
1583
|
class DbxPickableListFieldItemListComponent extends AbstractDbxSelectionListWrapperDirective {
|
|
@@ -1684,12 +1603,13 @@ class DbxPickableListFieldItemListViewComponent extends AbstractDbxSelectionList
|
|
|
1684
1603
|
constructor(dbxPickableListFieldComponent) {
|
|
1685
1604
|
super();
|
|
1686
1605
|
this.dbxPickableListFieldComponent = dbxPickableListFieldComponent;
|
|
1606
|
+
// TODO: any belongs here for now, but item list typings need to be updated.
|
|
1687
1607
|
this.config = {
|
|
1688
1608
|
componentClass: DbxPickableListFieldItemListViewItemComponent
|
|
1689
1609
|
};
|
|
1690
1610
|
this.items$ = this.values$.pipe(
|
|
1691
1611
|
// NOTE: This causes the "value" to be a PickableValueFieldDisplayValue<T>, which means we emit PickableValueFieldDisplayValue<T> to DbxPickableListFieldComponent.
|
|
1692
|
-
map(x => addConfigToValueListItems(this.config, x)), shareReplay
|
|
1612
|
+
map((x) => addConfigToValueListItems(this.config, x)), shareReplay(1));
|
|
1693
1613
|
}
|
|
1694
1614
|
get multiple() {
|
|
1695
1615
|
return this.dbxPickableListFieldComponent.multiSelect;
|
|
@@ -1703,12 +1623,16 @@ class DbxPickableListFieldItemListViewComponent extends AbstractDbxSelectionList
|
|
|
1703
1623
|
}
|
|
1704
1624
|
}
|
|
1705
1625
|
DbxPickableListFieldItemListViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableListFieldItemListViewComponent, deps: [{ token: DbxPickableListFieldComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1706
|
-
DbxPickableListFieldItemListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxPickableListFieldItemListViewComponent, selector: "ng-component", providers:
|
|
1626
|
+
DbxPickableListFieldItemListViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxPickableListFieldItemListViewComponent, selector: "ng-component", providers: provideDbxListView(DbxPickableListFieldItemListViewComponent), usesInheritance: true, ngImport: i0, template: `
|
|
1627
|
+
<dbx-selection-list-view-content [multiple]="multiple" [selectionMode]="selectionMode" [items]="items$ | async"></dbx-selection-list-view-content>
|
|
1628
|
+
`, isInline: true, components: [{ type: i1$1.DbxSelectionValueListItemViewComponent, selector: "dbx-selection-list-view-content", inputs: ["multiple", "selectionMode"] }], pipes: { "async": i5.AsyncPipe } });
|
|
1707
1629
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPickableListFieldItemListViewComponent, decorators: [{
|
|
1708
1630
|
type: Component,
|
|
1709
1631
|
args: [{
|
|
1710
|
-
template:
|
|
1711
|
-
|
|
1632
|
+
template: `
|
|
1633
|
+
<dbx-selection-list-view-content [multiple]="multiple" [selectionMode]="selectionMode" [items]="items$ | async"></dbx-selection-list-view-content>
|
|
1634
|
+
`,
|
|
1635
|
+
providers: provideDbxListView(DbxPickableListFieldItemListViewComponent)
|
|
1712
1636
|
}]
|
|
1713
1637
|
}], ctorParameters: function () { return [{ type: DbxPickableListFieldComponent }]; } });
|
|
1714
1638
|
class DbxPickableListFieldItemListViewItemComponent extends AbstractDbxValueListViewItemComponent {
|
|
@@ -1732,11 +1656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1732
1656
|
class DbxFormFormlyPickableFieldModule {
|
|
1733
1657
|
}
|
|
1734
1658
|
DbxFormFormlyPickableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyPickableFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1735
|
-
DbxFormFormlyPickableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyPickableFieldModule, declarations: [DbxPickableChipListFieldComponent,
|
|
1736
|
-
DbxPickableListFieldComponent,
|
|
1737
|
-
DbxPickableListFieldItemListComponent,
|
|
1738
|
-
DbxPickableListFieldItemListViewComponent,
|
|
1739
|
-
DbxPickableListFieldItemListViewItemComponent], imports: [CommonModule,
|
|
1659
|
+
DbxFormFormlyPickableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyPickableFieldModule, declarations: [DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent], imports: [CommonModule,
|
|
1740
1660
|
DbxTextModule,
|
|
1741
1661
|
DbxLoadingModule,
|
|
1742
1662
|
DbxButtonModule,
|
|
@@ -1774,7 +1694,7 @@ DbxFormFormlyPickableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion:
|
|
|
1774
1694
|
FormlyModule.forChild({
|
|
1775
1695
|
types: [
|
|
1776
1696
|
{ name: 'pickablechipfield', component: DbxPickableChipListFieldComponent, wrappers: ['form-field'] },
|
|
1777
|
-
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] }
|
|
1697
|
+
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] }
|
|
1778
1698
|
]
|
|
1779
1699
|
})
|
|
1780
1700
|
]] });
|
|
@@ -1802,17 +1722,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1802
1722
|
FormlyModule.forChild({
|
|
1803
1723
|
types: [
|
|
1804
1724
|
{ name: 'pickablechipfield', component: DbxPickableChipListFieldComponent, wrappers: ['form-field'] },
|
|
1805
|
-
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] }
|
|
1725
|
+
{ name: 'pickablelistfield', component: DbxPickableListFieldComponent, wrappers: ['form-field'] }
|
|
1806
1726
|
]
|
|
1807
1727
|
})
|
|
1808
1728
|
],
|
|
1809
|
-
declarations: [
|
|
1810
|
-
DbxPickableChipListFieldComponent,
|
|
1811
|
-
DbxPickableListFieldComponent,
|
|
1812
|
-
DbxPickableListFieldItemListComponent,
|
|
1813
|
-
DbxPickableListFieldItemListViewComponent,
|
|
1814
|
-
DbxPickableListFieldItemListViewItemComponent
|
|
1815
|
-
],
|
|
1729
|
+
declarations: [DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent],
|
|
1816
1730
|
exports: []
|
|
1817
1731
|
}]
|
|
1818
1732
|
}] });
|
|
@@ -1821,12 +1735,12 @@ function filterPickableItemFieldValuesByLabel(filterText, values) {
|
|
|
1821
1735
|
let filteredValues;
|
|
1822
1736
|
if (filterText) {
|
|
1823
1737
|
const searchString = filterText.toLocaleLowerCase();
|
|
1824
|
-
filteredValues = values.filter(x => x.label.toLocaleLowerCase().indexOf(searchString) !== -1);
|
|
1738
|
+
filteredValues = values.filter((x) => x.label.toLocaleLowerCase().indexOf(searchString) !== -1);
|
|
1825
1739
|
}
|
|
1826
1740
|
else {
|
|
1827
1741
|
filteredValues = values;
|
|
1828
1742
|
}
|
|
1829
|
-
return of(filteredValues.map(x => x.value));
|
|
1743
|
+
return of(filteredValues.map((x) => x.value));
|
|
1830
1744
|
}
|
|
1831
1745
|
function sortPickableItemsByLabel(chips) {
|
|
1832
1746
|
return chips.sort((a, b) => a.itemValue.label.localeCompare(b.itemValue.label));
|
|
@@ -1858,18 +1772,20 @@ const DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN = new InjectionToken('DbxSearcha
|
|
|
1858
1772
|
class DbxSearchableFieldAutocompleteItemComponent {
|
|
1859
1773
|
constructor() {
|
|
1860
1774
|
this._displayValue = new BehaviorSubject(undefined);
|
|
1861
|
-
this.displayValue$ = this._displayValue.pipe(filterMaybe(), shareReplay
|
|
1862
|
-
this.config$ = this.displayValue$.pipe(map(x => {
|
|
1775
|
+
this.displayValue$ = this._displayValue.pipe(filterMaybe(), shareReplay(1));
|
|
1776
|
+
this.config$ = this.displayValue$.pipe(map((x) => {
|
|
1863
1777
|
const config = {
|
|
1864
1778
|
...x.display,
|
|
1865
|
-
providers: mergeIntoArray([
|
|
1779
|
+
providers: mergeIntoArray([
|
|
1780
|
+
{
|
|
1866
1781
|
provide: DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN,
|
|
1867
1782
|
useValue: x
|
|
1868
|
-
}
|
|
1783
|
+
}
|
|
1784
|
+
], x.display.providers)
|
|
1869
1785
|
};
|
|
1870
1786
|
return config;
|
|
1871
1787
|
}));
|
|
1872
|
-
this.anchor$ = this.displayValue$.pipe(map(x => x.anchor));
|
|
1788
|
+
this.anchor$ = this.displayValue$.pipe(map((x) => x.anchor));
|
|
1873
1789
|
}
|
|
1874
1790
|
set displayValue(displayValue) {
|
|
1875
1791
|
this._displayValue.next(displayValue);
|
|
@@ -1915,20 +1831,20 @@ class DbxDefaultSearchableFieldDisplayComponent extends AbstractDbxSearchableFie
|
|
|
1915
1831
|
}
|
|
1916
1832
|
DbxDefaultSearchableFieldDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDefaultSearchableFieldDisplayComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1917
1833
|
DbxDefaultSearchableFieldDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxDefaultSearchableFieldDisplayComponent, selector: "dbx-default-searchable-field-display", usesInheritance: true, ngImport: i0, template: `
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1834
|
+
<div class="dbx-default-searchable-field-display">
|
|
1835
|
+
<span class="dbx-chip-label">{{ displayValue.label }}</span>
|
|
1836
|
+
<span class="dbx-chip-sublabel" *ngIf="displayValue.sublabel">({{ displayValue.sublabel }})</span>
|
|
1837
|
+
</div>
|
|
1922
1838
|
`, isInline: true, directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1923
1839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDefaultSearchableFieldDisplayComponent, decorators: [{
|
|
1924
1840
|
type: Component,
|
|
1925
1841
|
args: [{
|
|
1926
1842
|
selector: 'dbx-default-searchable-field-display',
|
|
1927
1843
|
template: `
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1844
|
+
<div class="dbx-default-searchable-field-display">
|
|
1845
|
+
<span class="dbx-chip-label">{{ displayValue.label }}</span>
|
|
1846
|
+
<span class="dbx-chip-sublabel" *ngIf="displayValue.sublabel">({{ displayValue.sublabel }})</span>
|
|
1847
|
+
</div>
|
|
1932
1848
|
`
|
|
1933
1849
|
}]
|
|
1934
1850
|
}] });
|
|
@@ -1952,19 +1868,19 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
1952
1868
|
this._displayHashMap = new BehaviorSubject(new Map());
|
|
1953
1869
|
this.inputValue$ = this.inputCtrl.valueChanges.pipe(startWith(this.inputCtrl.value));
|
|
1954
1870
|
this.inputValueString$ = this.inputValue$.pipe(debounceTime(200), distinctUntilChanged());
|
|
1955
|
-
this.searchResultsState$ = this.inputValueString$.pipe(switchMap((text) => (
|
|
1871
|
+
this.searchResultsState$ = this.inputValueString$.pipe(switchMap((text) => (text || this.searchOnEmptyText ? this.search(text ?? '') : of([])).pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)),
|
|
1956
1872
|
// Return begin loading to setup the loading state.
|
|
1957
|
-
|
|
1873
|
+
startWithBeginLoading())), shareReplay(1));
|
|
1958
1874
|
this.singleValueSyncSubscription = new SubscriptionObject();
|
|
1959
1875
|
this.searchContext = new LoadingStateContextInstance({ obs: this.searchResultsState$, showLoadingOnNoValue: false });
|
|
1960
|
-
this.searchResults$ = this.searchResultsState$.pipe(map(x => x?.value ?? []));
|
|
1961
|
-
this._formControlValue = this.formControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value), shareReplay
|
|
1962
|
-
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay
|
|
1963
|
-
this.displayValuesState$ = this.values$.pipe(distinctUntilChanged(), switchMap((values) => this.loadDisplayValuesForValues(values)), shareReplay
|
|
1964
|
-
this.displayValues$ = this.displayValuesState$.pipe(map(x => x?.value ?? []));
|
|
1876
|
+
this.searchResults$ = this.searchResultsState$.pipe(map((x) => x?.value ?? []));
|
|
1877
|
+
this._formControlValue = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value), shareReplay(1))));
|
|
1878
|
+
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay(1));
|
|
1879
|
+
this.displayValuesState$ = this.values$.pipe(distinctUntilChanged(), switchMap((values) => this.loadDisplayValuesForValues(values)), shareReplay(1));
|
|
1880
|
+
this.displayValues$ = this.displayValuesState$.pipe(map((x) => x?.value ?? []));
|
|
1965
1881
|
}
|
|
1966
1882
|
get name() {
|
|
1967
|
-
return this.field.name ??
|
|
1883
|
+
return this.field.name ?? camelCase(this.label ?? this.key);
|
|
1968
1884
|
}
|
|
1969
1885
|
get label() {
|
|
1970
1886
|
return this.field.templateOptions?.label;
|
|
@@ -1979,7 +1895,7 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
1979
1895
|
return this.searchableField.searchOnEmptyText ?? false;
|
|
1980
1896
|
}
|
|
1981
1897
|
get autocomplete() {
|
|
1982
|
-
return this.field.templateOptions?.attributes?.['autocomplete'] ?? this.key;
|
|
1898
|
+
return (this.field.templateOptions?.attributes?.['autocomplete'] ?? this.key);
|
|
1983
1899
|
}
|
|
1984
1900
|
get hashForValue() {
|
|
1985
1901
|
return this.searchableField.hashForValue ?? ((x) => x);
|
|
@@ -2015,24 +1931,22 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
2015
1931
|
return this.loadDisplayValuesForFieldValues(values.map((value) => ({ value })));
|
|
2016
1932
|
}
|
|
2017
1933
|
loadDisplayValuesForFieldValues(values) {
|
|
2018
|
-
return this.getDisplayValuesForFieldValues(values).pipe(map((displayValues) => successResult(displayValues)),
|
|
1934
|
+
return this.getDisplayValuesForFieldValues(values).pipe(map((displayValues) => successResult(displayValues)), startWithBeginLoading(), shareReplay(1));
|
|
2019
1935
|
}
|
|
2020
1936
|
getDisplayValuesForFieldValues(values) {
|
|
2021
1937
|
return this._displayHashMap.pipe(mergeMap((displayMap) => {
|
|
2022
|
-
const mappingResult = values
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
const hasDisplay = mappingResult.filter(x => Boolean(x[3]));
|
|
2026
|
-
const needsDisplay = mappingResult.filter(x => !x[3]);
|
|
1938
|
+
const mappingResult = values.map((x) => [x, this.hashForValue(x.value)]).map(([x, hash], i) => [i, hash, x, displayMap.get(hash)]);
|
|
1939
|
+
const hasDisplay = mappingResult.filter((x) => Boolean(x[3]));
|
|
1940
|
+
const needsDisplay = mappingResult.filter((x) => !x[3]);
|
|
2027
1941
|
let obs;
|
|
2028
1942
|
if (needsDisplay.length > 0) {
|
|
2029
1943
|
// Go get the display value.
|
|
2030
|
-
const displayValuesObs = this.displayForValue(needsDisplay.map(x => x[2]));
|
|
1944
|
+
const displayValuesObs = this.displayForValue(needsDisplay.map((x) => x[2]));
|
|
2031
1945
|
const defaultDisplay = mergeDbxInjectionComponentConfigs([this.defaultDisplay, this.display]);
|
|
2032
1946
|
const anchorForValue = this.useAnchor && this.anchorForValue;
|
|
2033
1947
|
obs = displayValuesObs.pipe(first(), map((displayResults) => {
|
|
2034
1948
|
// Assign the default component classes to complete configuration.
|
|
2035
|
-
displayResults.forEach(x => {
|
|
1949
|
+
displayResults.forEach((x) => {
|
|
2036
1950
|
if (!x.display) {
|
|
2037
1951
|
x.display = defaultDisplay;
|
|
2038
1952
|
}
|
|
@@ -2044,19 +1958,19 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
2044
1958
|
}
|
|
2045
1959
|
});
|
|
2046
1960
|
// Create a map to re-join values later.
|
|
2047
|
-
const displayResultsMapping = displayResults.map(x => [x, this.hashForValue(x.value)]);
|
|
1961
|
+
const displayResultsMapping = displayResults.map((x) => [x, this.hashForValue(x.value)]);
|
|
2048
1962
|
const valueIndexHashMap = new Map(displayResultsMapping.map(([x, hash]) => [hash, x]));
|
|
2049
1963
|
// Update displayMap. No need to push an update notification.
|
|
2050
1964
|
displayResultsMapping.forEach(([x, hash]) => displayMap.set(hash, x));
|
|
2051
1965
|
// Zip values back together.
|
|
2052
|
-
const newDisplayValues = mappingResult.map(x => x[3] ?? valueIndexHashMap.get(x[1]));
|
|
1966
|
+
const newDisplayValues = mappingResult.map((x) => x[3] ?? valueIndexHashMap.get(x[1]));
|
|
2053
1967
|
// Return display values.
|
|
2054
1968
|
return newDisplayValues;
|
|
2055
1969
|
}));
|
|
2056
1970
|
}
|
|
2057
1971
|
else {
|
|
2058
1972
|
// If all display values are hashed return that.
|
|
2059
|
-
obs = of(hasDisplay.map(x => x[3]));
|
|
1973
|
+
obs = of(hasDisplay.map((x) => x[3]));
|
|
2060
1974
|
}
|
|
2061
1975
|
return obs;
|
|
2062
1976
|
}));
|
|
@@ -2107,7 +2021,7 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
2107
2021
|
return;
|
|
2108
2022
|
}
|
|
2109
2023
|
if (text) {
|
|
2110
|
-
const value =
|
|
2024
|
+
const value = this.convertStringValue ? this.convertStringValue(text) : text;
|
|
2111
2025
|
this.addValue(value);
|
|
2112
2026
|
}
|
|
2113
2027
|
}
|
|
@@ -2137,10 +2051,10 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
2137
2051
|
let values;
|
|
2138
2052
|
if (this.hashForValue) {
|
|
2139
2053
|
const hashToFilter = this.hashForValue(value);
|
|
2140
|
-
values = this.values.filter(x => this.hashForValue(x) !== hashToFilter);
|
|
2054
|
+
values = this.values.filter((x) => this.hashForValue(x) !== hashToFilter);
|
|
2141
2055
|
}
|
|
2142
2056
|
else {
|
|
2143
|
-
values = this.values.filter(x => x !== value);
|
|
2057
|
+
values = this.values.filter((x) => x !== value);
|
|
2144
2058
|
}
|
|
2145
2059
|
this.setValues(values);
|
|
2146
2060
|
}
|
|
@@ -2156,11 +2070,11 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
2156
2070
|
}
|
|
2157
2071
|
// MARK: Internal
|
|
2158
2072
|
_getValueOnFormControl(valueOnFormControl) {
|
|
2159
|
-
const value =
|
|
2073
|
+
const value = valueOnFormControl != null ? [].concat(valueOnFormControl) : []; // Always return an array.
|
|
2160
2074
|
return value;
|
|
2161
2075
|
}
|
|
2162
2076
|
_setValueOnFormControl(values) {
|
|
2163
|
-
const value =
|
|
2077
|
+
const value = this.multiSelect ? values : lastValue(values); // pick last value, as the last value added is the newest value.
|
|
2164
2078
|
this.formControl.setValue(value);
|
|
2165
2079
|
this.formControl.markAsDirty();
|
|
2166
2080
|
this.formControl.markAsTouched();
|
|
@@ -2216,10 +2130,10 @@ class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
2216
2130
|
}
|
|
2217
2131
|
}
|
|
2218
2132
|
DbxSearchableChipFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableChipFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2219
|
-
DbxSearchableChipFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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\"
|
|
2133
|
+
DbxSearchableChipFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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\" (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\" autocomplete=\"{{ autocomplete }}\" [matAutocompleteDisabled]=\"readonly\" [matChipInputFor]=\"chipList\" (keydown)=\"tabPressedOnInput($event)\" [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\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of searchResults$ | async\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\"></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 } });
|
|
2220
2134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableChipFieldComponent, decorators: [{
|
|
2221
2135
|
type: Component,
|
|
2222
|
-
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\"
|
|
2136
|
+
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\" (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\" autocomplete=\"{{ autocomplete }}\" [matAutocompleteDisabled]=\"readonly\" [matChipInputFor]=\"chipList\" (keydown)=\"tabPressedOnInput($event)\" [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\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let displayValue of searchResults$ | async\" [value]=\"displayValue\">\n <dbx-searchable-field-autocomplete-item [displayValue]=\"displayValue\"></dbx-searchable-field-autocomplete-item>\n </mat-option>\n</mat-autocomplete>\n" }]
|
|
2223
2137
|
}] });
|
|
2224
2138
|
|
|
2225
2139
|
/**
|
|
@@ -2234,9 +2148,10 @@ function makeMetaFilterSearchableFieldValueDisplayFn({ loadMetaForValues, makeDi
|
|
|
2234
2148
|
let allValues;
|
|
2235
2149
|
if (needLoading.length > 0) {
|
|
2236
2150
|
const loadingResult = loadMetaForValues(needLoading);
|
|
2237
|
-
allValues = loadingResult.pipe(map
|
|
2151
|
+
allValues = loadingResult.pipe(map((result) => {
|
|
2238
2152
|
const resultMap = arrayToMap(result, (x) => x.value);
|
|
2239
|
-
const mergedWithLoad = needLoading
|
|
2153
|
+
const mergedWithLoad = needLoading
|
|
2154
|
+
.map((x) => {
|
|
2240
2155
|
const id = x.value;
|
|
2241
2156
|
const loadedItem = resultMap.get(id);
|
|
2242
2157
|
const anchor = x.anchor ?? loadedItem?.anchor;
|
|
@@ -2246,9 +2161,10 @@ function makeMetaFilterSearchableFieldValueDisplayFn({ loadMetaForValues, makeDi
|
|
|
2246
2161
|
anchor,
|
|
2247
2162
|
meta
|
|
2248
2163
|
};
|
|
2249
|
-
})
|
|
2164
|
+
})
|
|
2165
|
+
.filter((x) => !x.meta);
|
|
2250
2166
|
return mergedWithLoad;
|
|
2251
|
-
}), map
|
|
2167
|
+
}), map((result) => [...loaded, ...result]));
|
|
2252
2168
|
}
|
|
2253
2169
|
else {
|
|
2254
2170
|
allValues = of(loaded);
|
|
@@ -2292,9 +2208,9 @@ function searchableTextField(config) {
|
|
|
2292
2208
|
class DbxSearchableTextFieldComponent extends AbstractDbxSearchableValueFieldDirective {
|
|
2293
2209
|
constructor() {
|
|
2294
2210
|
super(...arguments);
|
|
2295
|
-
this.selectedDisplayValue$ = this.displayValues$.pipe(map(x => x[0]), shareReplay
|
|
2296
|
-
this.hasValue$ = this.selectedDisplayValue$.pipe(map(x => Boolean(x)));
|
|
2297
|
-
this.showSelectedDisplayValue$ = this.selectedDisplayValue$.pipe(map(x => this.showSelectedValue && Boolean(x)), distinctUntilChanged(), shareReplay
|
|
2211
|
+
this.selectedDisplayValue$ = this.displayValues$.pipe(map((x) => x[0]), shareReplay(1), tapDetectChanges(this.cdRef));
|
|
2212
|
+
this.hasValue$ = this.selectedDisplayValue$.pipe(map((x) => Boolean(x)));
|
|
2213
|
+
this.showSelectedDisplayValue$ = this.selectedDisplayValue$.pipe(map((x) => this.showSelectedValue && Boolean(x)), distinctUntilChanged(), shareReplay(1), tapDetectChanges(this.cdRef));
|
|
2298
2214
|
this.multiSelect = false;
|
|
2299
2215
|
this._clearInputSub = new SubscriptionObject();
|
|
2300
2216
|
}
|
|
@@ -2317,24 +2233,20 @@ class DbxSearchableTextFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
2317
2233
|
this._clearInputSub.destroy();
|
|
2318
2234
|
}
|
|
2319
2235
|
selected(event) {
|
|
2320
|
-
|
|
2321
|
-
this.addWithDisplayValue(e.option.value);
|
|
2236
|
+
this.addWithDisplayValue(event.option.value);
|
|
2322
2237
|
}
|
|
2323
2238
|
}
|
|
2324
2239
|
DbxSearchableTextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableTextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2325
|
-
DbxSearchableTextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxSearchableTextFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-searchable-text-field\"
|
|
2240
|
+
DbxSearchableTextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxSearchableTextFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-searchable-text-field\" [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)!\"></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\" [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\"></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 } });
|
|
2326
2241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableTextFieldComponent, decorators: [{
|
|
2327
2242
|
type: Component,
|
|
2328
|
-
args: [{ template: "<div class=\"dbx-searchable-text-field\"
|
|
2243
|
+
args: [{ template: "<div class=\"dbx-searchable-text-field\" [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)!\"></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\" [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\"></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" }]
|
|
2329
2244
|
}] });
|
|
2330
2245
|
|
|
2331
2246
|
class DbxFormFormlySearchableFieldModule {
|
|
2332
2247
|
}
|
|
2333
2248
|
DbxFormFormlySearchableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2334
|
-
DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, declarations: [DbxSearchableChipFieldComponent,
|
|
2335
|
-
DbxSearchableTextFieldComponent,
|
|
2336
|
-
DbxSearchableFieldAutocompleteItemComponent,
|
|
2337
|
-
DbxDefaultSearchableFieldDisplayComponent], imports: [CommonModule,
|
|
2249
|
+
DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, declarations: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxDefaultSearchableFieldDisplayComponent], imports: [CommonModule,
|
|
2338
2250
|
DbxTextModule,
|
|
2339
2251
|
DbxLoadingModule,
|
|
2340
2252
|
DbxButtonModule,
|
|
@@ -2349,8 +2261,7 @@ DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion
|
|
|
2349
2261
|
DbxRouterAnchorModule,
|
|
2350
2262
|
MatChipsModule,
|
|
2351
2263
|
MatIconModule,
|
|
2352
|
-
DbxInjectionComponentModule, i1$4.FormlyModule], exports: [DbxSearchableChipFieldComponent,
|
|
2353
|
-
DbxSearchableTextFieldComponent] });
|
|
2264
|
+
DbxInjectionComponentModule, i1$4.FormlyModule], exports: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent] });
|
|
2354
2265
|
DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, imports: [[
|
|
2355
2266
|
CommonModule,
|
|
2356
2267
|
DbxTextModule,
|
|
@@ -2371,7 +2282,7 @@ DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion
|
|
|
2371
2282
|
FormlyModule.forChild({
|
|
2372
2283
|
types: [
|
|
2373
2284
|
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2374
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2285
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2375
2286
|
]
|
|
2376
2287
|
})
|
|
2377
2288
|
]] });
|
|
@@ -2398,32 +2309,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2398
2309
|
FormlyModule.forChild({
|
|
2399
2310
|
types: [
|
|
2400
2311
|
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2401
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2312
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2402
2313
|
]
|
|
2403
2314
|
})
|
|
2404
2315
|
],
|
|
2405
|
-
declarations: [
|
|
2406
|
-
|
|
2407
|
-
DbxSearchableTextFieldComponent,
|
|
2408
|
-
DbxSearchableFieldAutocompleteItemComponent,
|
|
2409
|
-
DbxDefaultSearchableFieldDisplayComponent
|
|
2410
|
-
],
|
|
2411
|
-
exports: [
|
|
2412
|
-
DbxSearchableChipFieldComponent,
|
|
2413
|
-
DbxSearchableTextFieldComponent
|
|
2414
|
-
]
|
|
2316
|
+
declarations: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxDefaultSearchableFieldDisplayComponent],
|
|
2317
|
+
exports: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent]
|
|
2415
2318
|
}]
|
|
2416
2319
|
}] });
|
|
2417
2320
|
|
|
2418
2321
|
function chipTextField(config) {
|
|
2419
|
-
const convertStringValue =
|
|
2322
|
+
const convertStringValue = config.caseSensitive ? (x) => x : (x) => x?.toLowerCase();
|
|
2420
2323
|
return formlyField({
|
|
2421
2324
|
type: 'searchablechipfield',
|
|
2422
2325
|
allowStringValues: true,
|
|
2423
2326
|
convertStringValue,
|
|
2424
2327
|
...config,
|
|
2425
2328
|
displayForValue: (values) => {
|
|
2426
|
-
return of(values.map(x => ({ ...x, label: x.value })));
|
|
2329
|
+
return of(values.map((x) => ({ ...x, label: x.value })));
|
|
2427
2330
|
}
|
|
2428
2331
|
});
|
|
2429
2332
|
}
|
|
@@ -2431,23 +2334,14 @@ function chipTextField(config) {
|
|
|
2431
2334
|
class DbxFormFormlySelectionModule {
|
|
2432
2335
|
}
|
|
2433
2336
|
DbxFormFormlySelectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2434
|
-
DbxFormFormlySelectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [CommonModule], exports: [DbxFormFormlyPickableFieldModule,
|
|
2435
|
-
|
|
2436
|
-
DbxFormFormlySelectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [[
|
|
2437
|
-
CommonModule
|
|
2438
|
-
], DbxFormFormlyPickableFieldModule,
|
|
2439
|
-
DbxFormFormlySearchableFieldModule] });
|
|
2337
|
+
DbxFormFormlySelectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [CommonModule], exports: [DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule] });
|
|
2338
|
+
DbxFormFormlySelectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [[CommonModule], DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule] });
|
|
2440
2339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, decorators: [{
|
|
2441
2340
|
type: NgModule,
|
|
2442
2341
|
args: [{
|
|
2443
|
-
imports: [
|
|
2444
|
-
CommonModule
|
|
2445
|
-
],
|
|
2342
|
+
imports: [CommonModule],
|
|
2446
2343
|
declarations: [],
|
|
2447
|
-
exports: [
|
|
2448
|
-
DbxFormFormlyPickableFieldModule,
|
|
2449
|
-
DbxFormFormlySearchableFieldModule
|
|
2450
|
-
]
|
|
2344
|
+
exports: [DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule]
|
|
2451
2345
|
}]
|
|
2452
2346
|
}] });
|
|
2453
2347
|
|
|
@@ -2478,7 +2372,9 @@ class DbxTextEditorFieldComponent extends FieldType$1 {
|
|
|
2478
2372
|
ngOnInit() {
|
|
2479
2373
|
this._editor = new Editor({});
|
|
2480
2374
|
// Watch for value changes every second and update the pristine level.
|
|
2481
|
-
this._sub.subscription = this.editor.valueChanges
|
|
2375
|
+
this._sub.subscription = this.editor.valueChanges
|
|
2376
|
+
.pipe(debounceTime(100), filter(() => this.editor.view.hasFocus()))
|
|
2377
|
+
.subscribe(() => {
|
|
2482
2378
|
this.formControl.updateValueAndValidity();
|
|
2483
2379
|
this.formControl.markAsDirty();
|
|
2484
2380
|
});
|
|
@@ -2548,9 +2444,7 @@ DbxFormFormlyTextEditorFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion
|
|
|
2548
2444
|
MatFormFieldModule,
|
|
2549
2445
|
MatInputModule,
|
|
2550
2446
|
FormlyModule.forChild({
|
|
2551
|
-
types: [
|
|
2552
|
-
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2553
|
-
]
|
|
2447
|
+
types: [{ name: 'texteditor', component: DbxTextEditorFieldComponent }]
|
|
2554
2448
|
})
|
|
2555
2449
|
]] });
|
|
2556
2450
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, decorators: [{
|
|
@@ -2565,14 +2459,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2565
2459
|
MatFormFieldModule,
|
|
2566
2460
|
MatInputModule,
|
|
2567
2461
|
FormlyModule.forChild({
|
|
2568
|
-
types: [
|
|
2569
|
-
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2570
|
-
]
|
|
2462
|
+
types: [{ name: 'texteditor', component: DbxTextEditorFieldComponent }]
|
|
2571
2463
|
})
|
|
2572
2464
|
],
|
|
2573
|
-
declarations: [
|
|
2574
|
-
DbxTextEditorFieldComponent
|
|
2575
|
-
],
|
|
2465
|
+
declarations: [DbxTextEditorFieldComponent],
|
|
2576
2466
|
exports: []
|
|
2577
2467
|
}]
|
|
2578
2468
|
}] });
|
|
@@ -2621,7 +2511,7 @@ class DbxFormRepeatArrayTypeComponent extends FieldArrayType {
|
|
|
2621
2511
|
return true;
|
|
2622
2512
|
}
|
|
2623
2513
|
else {
|
|
2624
|
-
return
|
|
2514
|
+
return this.count < max;
|
|
2625
2515
|
}
|
|
2626
2516
|
}
|
|
2627
2517
|
/**
|
|
@@ -2660,17 +2550,20 @@ DbxFormRepeatArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
|
|
|
2660
2550
|
<dbx-subsection [header]="label">
|
|
2661
2551
|
<!-- Fields -->
|
|
2662
2552
|
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
<span class="
|
|
2670
|
-
<
|
|
2671
|
-
</
|
|
2672
|
-
<
|
|
2673
|
-
|
|
2553
|
+
<div class="dbx-form-repeat-array-field" cdkDrag cdkDragLockAxis="y" *ngFor="let field of field.fieldGroup; let i = index; let last = last">
|
|
2554
|
+
<div class="example-custom-placeholder" *cdkDragPlaceholder></div>
|
|
2555
|
+
<dbx-bar>
|
|
2556
|
+
<button cdkDragHandle mat-flat-button><mat-icon>drag_handle</mat-icon></button>
|
|
2557
|
+
<dbx-button-spacer></dbx-button-spacer>
|
|
2558
|
+
<h4>
|
|
2559
|
+
<span class="repeat-array-number">{{ i + 1 }}</span>
|
|
2560
|
+
<span>{{ labelForItem(field) }}</span>
|
|
2561
|
+
</h4>
|
|
2562
|
+
<span class="dbx-spacer"></span>
|
|
2563
|
+
<button mat-flat-button color="warn" (click)="remove(i)">{{ removeText }}</button>
|
|
2564
|
+
</dbx-bar>
|
|
2565
|
+
<formly-field class="dbx-form-repeat-array-field-content" [field]="field"></formly-field>
|
|
2566
|
+
</div>
|
|
2674
2567
|
</div>
|
|
2675
2568
|
<!-- Add Button -->
|
|
2676
2569
|
<div class="dbx-form-repeat-array-footer">
|
|
@@ -2678,7 +2571,7 @@ DbxFormRepeatArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
|
|
|
2678
2571
|
</div>
|
|
2679
2572
|
</dbx-subsection>
|
|
2680
2573
|
</div>
|
|
2681
|
-
`, 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$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: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,dbxButtonSpacer" }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2574
|
+
`, 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$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,[dbxBar]", inputs: ["color"] }, { type: i5$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2682
2575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormRepeatArrayTypeComponent, decorators: [{
|
|
2683
2576
|
type: Component,
|
|
2684
2577
|
args: [{
|
|
@@ -2687,17 +2580,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2687
2580
|
<dbx-subsection [header]="label">
|
|
2688
2581
|
<!-- Fields -->
|
|
2689
2582
|
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
<span class="
|
|
2697
|
-
<
|
|
2698
|
-
</
|
|
2699
|
-
<
|
|
2700
|
-
|
|
2583
|
+
<div class="dbx-form-repeat-array-field" cdkDrag cdkDragLockAxis="y" *ngFor="let field of field.fieldGroup; let i = index; let last = last">
|
|
2584
|
+
<div class="example-custom-placeholder" *cdkDragPlaceholder></div>
|
|
2585
|
+
<dbx-bar>
|
|
2586
|
+
<button cdkDragHandle mat-flat-button><mat-icon>drag_handle</mat-icon></button>
|
|
2587
|
+
<dbx-button-spacer></dbx-button-spacer>
|
|
2588
|
+
<h4>
|
|
2589
|
+
<span class="repeat-array-number">{{ i + 1 }}</span>
|
|
2590
|
+
<span>{{ labelForItem(field) }}</span>
|
|
2591
|
+
</h4>
|
|
2592
|
+
<span class="dbx-spacer"></span>
|
|
2593
|
+
<button mat-flat-button color="warn" (click)="remove(i)">{{ removeText }}</button>
|
|
2594
|
+
</dbx-bar>
|
|
2595
|
+
<formly-field class="dbx-form-repeat-array-field-content" [field]="field"></formly-field>
|
|
2596
|
+
</div>
|
|
2701
2597
|
</div>
|
|
2702
2598
|
<!-- Add Button -->
|
|
2703
2599
|
<div class="dbx-form-repeat-array-footer">
|
|
@@ -2734,9 +2630,7 @@ DbxFormFormlyArrayFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12
|
|
|
2734
2630
|
DbxBarLayoutModule,
|
|
2735
2631
|
DbxButtonModule,
|
|
2736
2632
|
FormlyModule.forChild({
|
|
2737
|
-
types: [
|
|
2738
|
-
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2739
|
-
]
|
|
2633
|
+
types: [{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }]
|
|
2740
2634
|
})
|
|
2741
2635
|
]] });
|
|
2742
2636
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyArrayFieldModule, decorators: [{
|
|
@@ -2754,14 +2648,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2754
2648
|
DbxBarLayoutModule,
|
|
2755
2649
|
DbxButtonModule,
|
|
2756
2650
|
FormlyModule.forChild({
|
|
2757
|
-
types: [
|
|
2758
|
-
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2759
|
-
]
|
|
2651
|
+
types: [{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }]
|
|
2760
2652
|
})
|
|
2761
2653
|
],
|
|
2762
|
-
declarations: [
|
|
2763
|
-
DbxFormRepeatArrayTypeComponent
|
|
2764
|
-
],
|
|
2654
|
+
declarations: [DbxFormRepeatArrayTypeComponent],
|
|
2765
2655
|
exports: []
|
|
2766
2656
|
}]
|
|
2767
2657
|
}] });
|
|
@@ -2774,7 +2664,7 @@ function repeatArrayField(config) {
|
|
|
2774
2664
|
repeatArrayField: {
|
|
2775
2665
|
labelForField,
|
|
2776
2666
|
addText,
|
|
2777
|
-
removeText
|
|
2667
|
+
removeText
|
|
2778
2668
|
},
|
|
2779
2669
|
...templateOptionsForFieldConfig(config, {
|
|
2780
2670
|
maxLength
|
|
@@ -2866,12 +2756,12 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2866
2756
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
2867
2757
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
2868
2758
|
this._updateTime = new Subject();
|
|
2869
|
-
this.value$ = this.formControl$.pipe(switchMap
|
|
2759
|
+
this.value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), distinctUntilChanged((a, b) => isSameMinute(a, b)), shareReplay(1));
|
|
2870
2760
|
/**
|
|
2871
2761
|
* Used to trigger/display visual updates (specifically on timeDistance, etc.).
|
|
2872
2762
|
*/
|
|
2873
|
-
this.displayValue$ = interval(10 * 1000).pipe(startWith
|
|
2874
|
-
this.timeString$ = this.value$.pipe(filterMaybe(), map
|
|
2763
|
+
this.displayValue$ = interval(10 * 1000).pipe(startWith(0), map(() => new Date().getMinutes()), distinctUntilChanged(), tap(() => this.cdRef.markForCheck()), switchMap(() => this.value$), shareReplay(1));
|
|
2764
|
+
this.timeString$ = this.value$.pipe(filterMaybe(), map((x) => {
|
|
2875
2765
|
const timezone = guessCurrentTimezone();
|
|
2876
2766
|
const timeString = toReadableTimeString(x, timezone);
|
|
2877
2767
|
return timeString;
|
|
@@ -2880,23 +2770,17 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2880
2770
|
validators: []
|
|
2881
2771
|
});
|
|
2882
2772
|
this.timeInputCtrl = new FormControl('', {
|
|
2883
|
-
validators: [
|
|
2884
|
-
Validators.pattern(/^(now)$|^([0-9]|(0[0-9])|(1[0-9])|(2[0-3]))(:)?([0-5][0-9])?(\s)?([apAP][Mm])?(\\s)*$/)
|
|
2885
|
-
]
|
|
2773
|
+
validators: [Validators.pattern(/^(now)$|^([0-9]|(0[0-9])|(1[0-9])|(2[0-3]))(:)?([0-5][0-9])?(\s)?([apAP][Mm])?(\\s)*$/)]
|
|
2886
2774
|
});
|
|
2887
2775
|
this._config = new BehaviorSubject(undefined);
|
|
2888
|
-
this.fullDay$ = this.fullDayControl$.pipe(switchMap
|
|
2889
|
-
this.showTimeInput$ = this.fullDay$.pipe(map
|
|
2890
|
-
this.showAddTime$ = this.showTimeInput$.pipe(map
|
|
2891
|
-
this.date$ = this.dateInputCtrl.valueChanges.pipe(startWith
|
|
2892
|
-
this.dateValue$ = merge(this.date$, this.value$.pipe(skipFirstMaybe())).pipe(map
|
|
2893
|
-
this.timeInput$ = this._updateTime.pipe(debounceTime
|
|
2776
|
+
this.fullDay$ = this.fullDayControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))));
|
|
2777
|
+
this.showTimeInput$ = this.fullDay$.pipe(map((x) => !x && this.timeMode !== DbxDateTimeFieldTimeMode.NONE));
|
|
2778
|
+
this.showAddTime$ = this.showTimeInput$.pipe(map((x) => !x && this.timeMode === DbxDateTimeFieldTimeMode.OPTIONAL), shareReplay(1));
|
|
2779
|
+
this.date$ = this.dateInputCtrl.valueChanges.pipe(startWith(this.dateInputCtrl.value), filterMaybe(), shareReplay(1));
|
|
2780
|
+
this.dateValue$ = merge(this.date$, this.value$.pipe(skipFirstMaybe())).pipe(map((x) => (x ? startOfDay(x) : x)), distinctUntilChanged((a, b) => a != null && b != null && isSameDay(a, b)), shareReplay(1));
|
|
2781
|
+
this.timeInput$ = this._updateTime.pipe(debounceTime(5), map(() => this.timeInputCtrl.value), distinctUntilChanged());
|
|
2894
2782
|
this.config$ = this._config.pipe(switchMapMaybeDefault(), shareReplay(1));
|
|
2895
|
-
this.rawDateTime$ = combineLatest([
|
|
2896
|
-
this.dateValue$,
|
|
2897
|
-
this.timeInput$.pipe(startWith$1(null)),
|
|
2898
|
-
this.fullDay$
|
|
2899
|
-
]).pipe(map$1(([date, timeString, fullDay]) => {
|
|
2783
|
+
this.rawDateTime$ = combineLatest([this.dateValue$, this.timeInput$.pipe(startWith(null)), this.fullDay$]).pipe(map(([date, timeString, fullDay]) => {
|
|
2900
2784
|
let result;
|
|
2901
2785
|
if (date) {
|
|
2902
2786
|
if (fullDay) {
|
|
@@ -2908,22 +2792,19 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2908
2792
|
}
|
|
2909
2793
|
}
|
|
2910
2794
|
else if (timeString) {
|
|
2911
|
-
result =
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2795
|
+
result =
|
|
2796
|
+
readableTimeStringToDate(timeString, {
|
|
2797
|
+
date,
|
|
2798
|
+
useSystemTimezone: true
|
|
2799
|
+
}) ?? date;
|
|
2915
2800
|
}
|
|
2916
2801
|
else {
|
|
2917
2802
|
result = date;
|
|
2918
2803
|
}
|
|
2919
2804
|
}
|
|
2920
2805
|
return result;
|
|
2921
|
-
}), distinctUntilChanged
|
|
2922
|
-
this.timeOutput$ = combineLatest([
|
|
2923
|
-
this.rawDateTime$,
|
|
2924
|
-
this._offset,
|
|
2925
|
-
this.config$.pipe(distinctUntilChanged$1()),
|
|
2926
|
-
]).pipe(throttleTime(40, undefined, { leading: false, trailing: true }), distinctUntilChanged$1((current, next) => current[0] === next[0] && next[1] === 0), tap(([_, stepsOffset]) => (stepsOffset) ? this._offset.next(0) : 0), map$1(([date, stepsOffset, config]) => {
|
|
2806
|
+
}), distinctUntilChanged((a, b) => a != null && b != null && isSameMinute(a, b)), shareReplay(1));
|
|
2807
|
+
this.timeOutput$ = combineLatest([this.rawDateTime$, this._offset, this.config$.pipe(distinctUntilChanged())]).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]) => {
|
|
2927
2808
|
if (date != null) {
|
|
2928
2809
|
const instance = new DateTimeMinuteInstance({
|
|
2929
2810
|
date,
|
|
@@ -2935,7 +2816,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2935
2816
|
date = addMinutes(date, minutes);
|
|
2936
2817
|
}
|
|
2937
2818
|
return date;
|
|
2938
|
-
}), distinctUntilChanged
|
|
2819
|
+
}), distinctUntilChanged((a, b) => a != null && b != null && isSameMinute(a, b)), shareReplay(1));
|
|
2939
2820
|
}
|
|
2940
2821
|
get dateOnly() {
|
|
2941
2822
|
return this.timeMode === DbxDateTimeFieldTimeMode.NONE;
|
|
@@ -2950,7 +2831,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2950
2831
|
return !this.timeOnly;
|
|
2951
2832
|
}
|
|
2952
2833
|
get timeMode() {
|
|
2953
|
-
return
|
|
2834
|
+
return this.timeOnly ? DbxDateTimeFieldTimeMode.REQUIRED : this.dateTimeField.timeMode ?? DbxDateTimeFieldTimeMode.REQUIRED;
|
|
2954
2835
|
}
|
|
2955
2836
|
get description() {
|
|
2956
2837
|
return this.field.templateOptions?.description;
|
|
@@ -3056,11 +2937,12 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3056
2937
|
offset = 5;
|
|
3057
2938
|
}
|
|
3058
2939
|
if (direction !== 0) {
|
|
3059
|
-
this._offset.next(this._offset.value +
|
|
2940
|
+
this._offset.next(this._offset.value + offset * direction);
|
|
3060
2941
|
this._updateTime.next();
|
|
3061
2942
|
}
|
|
3062
2943
|
}
|
|
3063
2944
|
focusTime() {
|
|
2945
|
+
// do nothing
|
|
3064
2946
|
}
|
|
3065
2947
|
focusOutTime() {
|
|
3066
2948
|
this._updateTime.next();
|
|
@@ -3072,16 +2954,16 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3072
2954
|
this.setFullDay(true);
|
|
3073
2955
|
}
|
|
3074
2956
|
setFullDay(fullDay) {
|
|
3075
|
-
this.fullDayControl$.pipe(first
|
|
2957
|
+
this.fullDayControl$.pipe(first()).subscribe((x) => {
|
|
3076
2958
|
x.setValue(fullDay);
|
|
3077
2959
|
});
|
|
3078
2960
|
}
|
|
3079
2961
|
}
|
|
3080
2962
|
DbxDateTimeFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDateTimeFieldComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3081
|
-
DbxDateTimeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxDateTimeFieldComponent, selector: "ng-component", 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
|
|
2963
|
+
DbxDateTimeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxDateTimeFieldComponent, selector: "ng-component", 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>\n 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\">\n <b class=\"dbx-ok\">All Day</b>\n {{ dateValue$ | async | date: 'fullDate' }} ({{ dateValue$ | async | dateDistance }})\n </small>\n <small *ngSwitchCase=\"false\">\n <ng-container *ngIf=\"value$ | async\">\n <b class=\"dbx-ok\">At</b>\n {{ displayValue$ | async | date: 'medium' }} ({{ displayValue$ | async | timeDistance }})\n </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()\" [disabled]=\"disabled\">\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 [formControl]=\"dateInputCtrl\" [matDatepicker]=\"picker\" (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\" [disabled]=\"disabled\">\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)=\"setLogicalTime('now')\">\n <span>Now</span>\n </button>\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()\" (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$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$4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i5$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], pipes: { "async": i5.AsyncPipe, "date": i5.DatePipe, "dateDistance": i2.DateDistancePipe, "timeDistance": i2.TimeDistancePipe } });
|
|
3082
2964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDateTimeFieldComponent, decorators: [{
|
|
3083
2965
|
type: Component,
|
|
3084
|
-
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
|
|
2966
|
+
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>\n 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\">\n <b class=\"dbx-ok\">All Day</b>\n {{ dateValue$ | async | date: 'fullDate' }} ({{ dateValue$ | async | dateDistance }})\n </small>\n <small *ngSwitchCase=\"false\">\n <ng-container *ngIf=\"value$ | async\">\n <b class=\"dbx-ok\">At</b>\n {{ displayValue$ | async | date: 'medium' }} ({{ displayValue$ | async | timeDistance }})\n </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()\" [disabled]=\"disabled\">\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 [formControl]=\"dateInputCtrl\" [matDatepicker]=\"picker\" (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\" [disabled]=\"disabled\">\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)=\"setLogicalTime('now')\">\n <span>Now</span>\n </button>\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()\" (keydown)=\"keydownOnInput($event)\" />\n </mat-form-field>\n</ng-template>\n" }]
|
|
3085
2967
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3086
2968
|
|
|
3087
2969
|
class DbxFormFormlyDateFieldModule {
|
|
@@ -3117,9 +2999,7 @@ DbxFormFormlyDateFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.
|
|
|
3117
2999
|
MatIconModule,
|
|
3118
3000
|
FlexLayoutModule,
|
|
3119
3001
|
FormlyModule.forChild({
|
|
3120
|
-
types: [
|
|
3121
|
-
{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }
|
|
3122
|
-
]
|
|
3002
|
+
types: [{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
3123
3003
|
})
|
|
3124
3004
|
], DbxFormFormlyWrapperModule] });
|
|
3125
3005
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyDateFieldModule, decorators: [{
|
|
@@ -3141,17 +3021,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3141
3021
|
MatIconModule,
|
|
3142
3022
|
FlexLayoutModule,
|
|
3143
3023
|
FormlyModule.forChild({
|
|
3144
|
-
types: [
|
|
3145
|
-
{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }
|
|
3146
|
-
]
|
|
3024
|
+
types: [{ name: 'datetime', component: DbxDateTimeFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
3147
3025
|
})
|
|
3148
3026
|
],
|
|
3149
|
-
declarations: [
|
|
3150
|
-
|
|
3151
|
-
],
|
|
3152
|
-
exports: [
|
|
3153
|
-
DbxFormFormlyWrapperModule
|
|
3154
|
-
]
|
|
3027
|
+
declarations: [DbxDateTimeFieldComponent],
|
|
3028
|
+
exports: [DbxFormFormlyWrapperModule]
|
|
3155
3029
|
}]
|
|
3156
3030
|
}] });
|
|
3157
3031
|
|
|
@@ -3175,10 +3049,10 @@ function dateTimeField(config = {}) {
|
|
|
3175
3049
|
key,
|
|
3176
3050
|
type: 'datetime',
|
|
3177
3051
|
dateTimeField: {
|
|
3178
|
-
timeMode:
|
|
3052
|
+
timeMode: timeOnly ? DbxDateTimeFieldTimeMode.REQUIRED : timeMode,
|
|
3179
3053
|
fullDayFieldName,
|
|
3180
3054
|
getConfigObs,
|
|
3181
|
-
timeOnly
|
|
3055
|
+
timeOnly
|
|
3182
3056
|
},
|
|
3183
3057
|
...templateOptionsForFieldConfig(config),
|
|
3184
3058
|
styleWrapper: {
|
|
@@ -3200,7 +3074,7 @@ function staticEnumField({ key, label = '', placeholder = '', description, multi
|
|
|
3200
3074
|
multiple,
|
|
3201
3075
|
selectAllOption: 'Select All',
|
|
3202
3076
|
options
|
|
3203
|
-
}
|
|
3077
|
+
}
|
|
3204
3078
|
});
|
|
3205
3079
|
return fieldConfig;
|
|
3206
3080
|
}
|
|
@@ -3234,10 +3108,10 @@ class DbxPhoneFieldComponent extends FieldType$1 {
|
|
|
3234
3108
|
}
|
|
3235
3109
|
}
|
|
3236
3110
|
DbxPhoneFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPhoneFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3237
|
-
DbxPhoneFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxPhoneFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\"
|
|
3111
|
+
DbxPhoneFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxPhoneFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"formControl\"></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"] }] });
|
|
3238
3112
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPhoneFieldComponent, decorators: [{
|
|
3239
3113
|
type: Component,
|
|
3240
|
-
args: [{ template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\"
|
|
3114
|
+
args: [{ template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"formControl\"></ngx-mat-intl-tel-input>\n" }]
|
|
3241
3115
|
}] });
|
|
3242
3116
|
|
|
3243
3117
|
class DbxFormFormlyPhoneFieldModule {
|
|
@@ -3267,9 +3141,7 @@ DbxFormFormlyPhoneFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12
|
|
|
3267
3141
|
FlexLayoutModule,
|
|
3268
3142
|
FormlyMatFormFieldModule,
|
|
3269
3143
|
FormlyModule.forChild({
|
|
3270
|
-
types: [
|
|
3271
|
-
{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }
|
|
3272
|
-
]
|
|
3144
|
+
types: [{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }]
|
|
3273
3145
|
})
|
|
3274
3146
|
]] });
|
|
3275
3147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyPhoneFieldModule, decorators: [{
|
|
@@ -3288,14 +3160,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3288
3160
|
FlexLayoutModule,
|
|
3289
3161
|
FormlyMatFormFieldModule,
|
|
3290
3162
|
FormlyModule.forChild({
|
|
3291
|
-
types: [
|
|
3292
|
-
{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }
|
|
3293
|
-
]
|
|
3163
|
+
types: [{ name: 'intphone', component: DbxPhoneFieldComponent, wrappers: ['form-field'] }]
|
|
3294
3164
|
})
|
|
3295
3165
|
],
|
|
3296
|
-
declarations: [
|
|
3297
|
-
DbxPhoneFieldComponent
|
|
3298
|
-
],
|
|
3166
|
+
declarations: [DbxPhoneFieldComponent],
|
|
3299
3167
|
exports: []
|
|
3300
3168
|
}]
|
|
3301
3169
|
}] });
|
|
@@ -3374,9 +3242,11 @@ function flexLayoutWrapper(fieldConfigs, { relative, breakpoint, size: defaultSi
|
|
|
3374
3242
|
}
|
|
3375
3243
|
},
|
|
3376
3244
|
fieldGroup: fieldConfigs.map((inputConfig) => {
|
|
3377
|
-
const fieldConfig = checkIsFieldFlexLayoutGroupFieldConfig(inputConfig)
|
|
3378
|
-
|
|
3379
|
-
|
|
3245
|
+
const fieldConfig = checkIsFieldFlexLayoutGroupFieldConfig(inputConfig)
|
|
3246
|
+
? inputConfig
|
|
3247
|
+
: {
|
|
3248
|
+
field: inputConfig
|
|
3249
|
+
};
|
|
3380
3250
|
const { field, size = defaultSize } = fieldConfig;
|
|
3381
3251
|
const className = `dbx-flex-${size}`;
|
|
3382
3252
|
return {
|
|
@@ -3408,7 +3278,7 @@ function textAreaField(config) {
|
|
|
3408
3278
|
...templateOptionsForFieldConfig(config, {
|
|
3409
3279
|
rows,
|
|
3410
3280
|
minLength,
|
|
3411
|
-
maxLength
|
|
3281
|
+
maxLength
|
|
3412
3282
|
})
|
|
3413
3283
|
});
|
|
3414
3284
|
}
|
|
@@ -3468,7 +3338,6 @@ function phoneListField(repeatConfig = {}) {
|
|
|
3468
3338
|
repeatFieldGroup: repeatFieldGroup ?? [wrappedPhoneAndLabelField(phoneAndLabel)]
|
|
3469
3339
|
});
|
|
3470
3340
|
}
|
|
3471
|
-
;
|
|
3472
3341
|
|
|
3473
3342
|
const PHONE_LABEL_MAX_LENGTH = 100;
|
|
3474
3343
|
const ADDRESS_COUNTRY_MAX_LENGTH = 80;
|
|
@@ -3565,15 +3434,20 @@ function addressFormlyFields() {
|
|
|
3565
3434
|
autocomplete: 'address-line2',
|
|
3566
3435
|
maxLength: ADDRESS_LINE_MAX_LENGTH
|
|
3567
3436
|
}),
|
|
3568
|
-
flexLayoutWrapper([
|
|
3437
|
+
flexLayoutWrapper([
|
|
3438
|
+
{
|
|
3569
3439
|
field: cityField({})
|
|
3570
|
-
},
|
|
3440
|
+
},
|
|
3441
|
+
{
|
|
3571
3442
|
field: stateField({})
|
|
3572
|
-
},
|
|
3443
|
+
},
|
|
3444
|
+
{
|
|
3573
3445
|
field: zipCodeField({})
|
|
3574
|
-
},
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3575
3448
|
field: countryField({})
|
|
3576
|
-
}
|
|
3449
|
+
}
|
|
3450
|
+
], { size: 1, relative: true })
|
|
3577
3451
|
];
|
|
3578
3452
|
}
|
|
3579
3453
|
function addressField({ key = 'address', required = false } = {}) {
|
|
@@ -3591,6 +3465,7 @@ function addressField({ key = 'address', required = false } = {}) {
|
|
|
3591
3465
|
function addressListField({ key = 'addresses', required = false, maxAddresses = 6 } = {}) {
|
|
3592
3466
|
return repeatArrayField({
|
|
3593
3467
|
key,
|
|
3468
|
+
required,
|
|
3594
3469
|
label: 'Addresses',
|
|
3595
3470
|
labelForField: 'Address',
|
|
3596
3471
|
addText: 'Add Address',
|
|
@@ -3604,19 +3479,13 @@ class DbxFormFormlyTextFieldModule {
|
|
|
3604
3479
|
}
|
|
3605
3480
|
DbxFormFormlyTextFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3606
3481
|
DbxFormFormlyTextFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [FormlyMaterialModule], exports: [DbxFormFormlyWrapperModule] });
|
|
3607
|
-
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [[
|
|
3608
|
-
FormlyMaterialModule
|
|
3609
|
-
], DbxFormFormlyWrapperModule] });
|
|
3482
|
+
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [[FormlyMaterialModule], DbxFormFormlyWrapperModule] });
|
|
3610
3483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, decorators: [{
|
|
3611
3484
|
type: NgModule,
|
|
3612
3485
|
args: [{
|
|
3613
|
-
imports: [
|
|
3614
|
-
FormlyMaterialModule
|
|
3615
|
-
],
|
|
3486
|
+
imports: [FormlyMaterialModule],
|
|
3616
3487
|
declarations: [],
|
|
3617
|
-
exports: [
|
|
3618
|
-
DbxFormFormlyWrapperModule
|
|
3619
|
-
]
|
|
3488
|
+
exports: [DbxFormFormlyWrapperModule]
|
|
3620
3489
|
}]
|
|
3621
3490
|
}] });
|
|
3622
3491
|
|
|
@@ -3630,70 +3499,28 @@ function hiddenField({ key, required = false }) {
|
|
|
3630
3499
|
class DbxFormFormlyValueModule {
|
|
3631
3500
|
}
|
|
3632
3501
|
DbxFormFormlyValueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3633
|
-
DbxFormFormlyValueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [CommonModule], exports: [DbxFormFormlyArrayFieldModule,
|
|
3634
|
-
|
|
3635
|
-
DbxFormFormlyDateFieldModule,
|
|
3636
|
-
DbxFormFormlyEnumFieldModule,
|
|
3637
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3638
|
-
DbxFormFormlyTextFieldModule] });
|
|
3639
|
-
DbxFormFormlyValueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [[
|
|
3640
|
-
CommonModule
|
|
3641
|
-
], DbxFormFormlyArrayFieldModule,
|
|
3642
|
-
DbxFormFormlyBooleanFieldModule,
|
|
3643
|
-
DbxFormFormlyDateFieldModule,
|
|
3644
|
-
DbxFormFormlyEnumFieldModule,
|
|
3645
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3646
|
-
DbxFormFormlyTextFieldModule] });
|
|
3502
|
+
DbxFormFormlyValueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [CommonModule], exports: [DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyTextFieldModule] });
|
|
3503
|
+
DbxFormFormlyValueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [[CommonModule], DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyTextFieldModule] });
|
|
3647
3504
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, decorators: [{
|
|
3648
3505
|
type: NgModule,
|
|
3649
3506
|
args: [{
|
|
3650
|
-
imports: [
|
|
3651
|
-
CommonModule
|
|
3652
|
-
],
|
|
3507
|
+
imports: [CommonModule],
|
|
3653
3508
|
declarations: [],
|
|
3654
|
-
exports: [
|
|
3655
|
-
DbxFormFormlyArrayFieldModule,
|
|
3656
|
-
DbxFormFormlyBooleanFieldModule,
|
|
3657
|
-
DbxFormFormlyDateFieldModule,
|
|
3658
|
-
DbxFormFormlyEnumFieldModule,
|
|
3659
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3660
|
-
DbxFormFormlyTextFieldModule
|
|
3661
|
-
]
|
|
3509
|
+
exports: [DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyTextFieldModule]
|
|
3662
3510
|
}]
|
|
3663
3511
|
}] });
|
|
3664
3512
|
|
|
3665
3513
|
class DbxFormFormlyFieldModule {
|
|
3666
3514
|
}
|
|
3667
3515
|
DbxFormFormlyFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3668
|
-
DbxFormFormlyFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [CommonModule], exports: [DbxFormFormlyChecklistItemFieldModule,
|
|
3669
|
-
|
|
3670
|
-
DbxFormFormlySelectionModule,
|
|
3671
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3672
|
-
DbxFormFormlyValueModule,
|
|
3673
|
-
DbxFormFormlyWrapperModule] });
|
|
3674
|
-
DbxFormFormlyFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [[
|
|
3675
|
-
CommonModule
|
|
3676
|
-
], DbxFormFormlyChecklistItemFieldModule,
|
|
3677
|
-
DbxFormFormlyComponentFieldModule,
|
|
3678
|
-
DbxFormFormlySelectionModule,
|
|
3679
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3680
|
-
DbxFormFormlyValueModule,
|
|
3681
|
-
DbxFormFormlyWrapperModule] });
|
|
3516
|
+
DbxFormFormlyFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [CommonModule], exports: [DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule] });
|
|
3517
|
+
DbxFormFormlyFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [[CommonModule], DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule] });
|
|
3682
3518
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, decorators: [{
|
|
3683
3519
|
type: NgModule,
|
|
3684
3520
|
args: [{
|
|
3685
|
-
imports: [
|
|
3686
|
-
CommonModule
|
|
3687
|
-
],
|
|
3521
|
+
imports: [CommonModule],
|
|
3688
3522
|
declarations: [],
|
|
3689
|
-
exports: [
|
|
3690
|
-
DbxFormFormlyChecklistItemFieldModule,
|
|
3691
|
-
DbxFormFormlyComponentFieldModule,
|
|
3692
|
-
DbxFormFormlySelectionModule,
|
|
3693
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3694
|
-
DbxFormFormlyValueModule,
|
|
3695
|
-
DbxFormFormlyWrapperModule
|
|
3696
|
-
]
|
|
3523
|
+
exports: [DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule]
|
|
3697
3524
|
}]
|
|
3698
3525
|
}] });
|
|
3699
3526
|
|
|
@@ -3707,7 +3534,7 @@ const FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY = 'fieldValuesAreEqual';
|
|
|
3707
3534
|
* @returns
|
|
3708
3535
|
*/
|
|
3709
3536
|
function fieldValuesAreEqualValidator(config = {}) {
|
|
3710
|
-
const { keysFilter, valuesFilter: inputValuesFilter, isEqual = (
|
|
3537
|
+
const { keysFilter, valuesFilter: inputValuesFilter, isEqual = (a, b) => a === b, message = 'Field values are not equal.' } = config;
|
|
3711
3538
|
const valuesFilter = inputValuesFilter ?? {
|
|
3712
3539
|
valueFilter: KeyValueTypleValueFilter.NONE,
|
|
3713
3540
|
keysFilter
|
|
@@ -3727,7 +3554,6 @@ function fieldValuesAreEqualValidator(config = {}) {
|
|
|
3727
3554
|
};
|
|
3728
3555
|
}
|
|
3729
3556
|
|
|
3730
|
-
;
|
|
3731
3557
|
/**
|
|
3732
3558
|
* Configured simple text password field.
|
|
3733
3559
|
*
|
|
@@ -3762,14 +3588,16 @@ function textPasswordWithVerifyFieldGroup(config) {
|
|
|
3762
3588
|
const verifyPasswordField = textVerifyPasswordField({
|
|
3763
3589
|
...config.password,
|
|
3764
3590
|
...config.verifyPassword,
|
|
3765
|
-
label:
|
|
3591
|
+
label: config.verifyPassword?.label ?? `Verify ${passwordFieldConfig.templateOptions?.label}`,
|
|
3766
3592
|
key: verifyPasswordFieldKey
|
|
3767
3593
|
});
|
|
3768
3594
|
const validators = {
|
|
3769
|
-
validation: [
|
|
3595
|
+
validation: [
|
|
3596
|
+
{
|
|
3770
3597
|
errorPath: verifyPasswordFieldKey,
|
|
3771
3598
|
expression: fieldValuesAreEqualValidator({ keysFilter: [passwordFieldConfig.key, verifyPasswordField.key], message: 'The passwords do not match.' })
|
|
3772
|
-
}
|
|
3599
|
+
}
|
|
3600
|
+
]
|
|
3773
3601
|
};
|
|
3774
3602
|
const groupFieldConfig = {
|
|
3775
3603
|
validators,
|
|
@@ -3777,7 +3605,6 @@ function textPasswordWithVerifyFieldGroup(config) {
|
|
|
3777
3605
|
};
|
|
3778
3606
|
return groupFieldConfig;
|
|
3779
3607
|
}
|
|
3780
|
-
;
|
|
3781
3608
|
/**
|
|
3782
3609
|
* Template for login field that takes in a username and password.
|
|
3783
3610
|
*
|
|
@@ -3806,11 +3633,8 @@ function usernamePasswordLoginFields({ username, password, verifyPassword }) {
|
|
|
3806
3633
|
else {
|
|
3807
3634
|
usernameField = textField({ ...usernameFieldConfig.username, ...defaultUsernameFieldConfig });
|
|
3808
3635
|
}
|
|
3809
|
-
const passwordField =
|
|
3810
|
-
return [
|
|
3811
|
-
usernameField,
|
|
3812
|
-
passwordField
|
|
3813
|
-
];
|
|
3636
|
+
const passwordField = verifyPassword ? textPasswordWithVerifyFieldGroup({ password, verifyPassword: verifyPassword === true ? undefined : verifyPassword }) : textPasswordField(password);
|
|
3637
|
+
return [usernameField, passwordField];
|
|
3814
3638
|
}
|
|
3815
3639
|
|
|
3816
3640
|
const FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY = 'fieldValueIsAvailable';
|
|
@@ -3828,7 +3652,7 @@ function fieldValueIsAvailableValidator(config) {
|
|
|
3828
3652
|
const pusher = asyncPusherCache({
|
|
3829
3653
|
throttle
|
|
3830
3654
|
});
|
|
3831
|
-
return (control) => pusher(control.valueChanges)(control.value).pipe(switchMap
|
|
3655
|
+
return (control) => pusher(control.valueChanges)(control.value).pipe(switchMap((x) => checkValueIsAvailable(x)), map((isAvailable) => {
|
|
3832
3656
|
if (isAvailable) {
|
|
3833
3657
|
return null;
|
|
3834
3658
|
}
|
|
@@ -3839,18 +3663,20 @@ function fieldValueIsAvailableValidator(config) {
|
|
|
3839
3663
|
}
|
|
3840
3664
|
}), catchError(() => of({
|
|
3841
3665
|
[FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY]: { message: 'An error occured.' }
|
|
3842
|
-
})), first
|
|
3666
|
+
})), first());
|
|
3843
3667
|
}
|
|
3844
3668
|
|
|
3845
3669
|
function textIsAvailableField(config) {
|
|
3846
3670
|
const field = textField(config);
|
|
3847
3671
|
field.asyncValidators = {
|
|
3848
|
-
validation: [
|
|
3672
|
+
validation: [
|
|
3673
|
+
{
|
|
3849
3674
|
expression: fieldValueIsAvailableValidator({
|
|
3850
3675
|
...config,
|
|
3851
3676
|
message: config?.isNotAvailableErrorMessage
|
|
3852
|
-
})
|
|
3853
|
-
}
|
|
3677
|
+
})
|
|
3678
|
+
}
|
|
3679
|
+
]
|
|
3854
3680
|
};
|
|
3855
3681
|
return workingWrapper(field, {});
|
|
3856
3682
|
}
|
|
@@ -3858,12 +3684,14 @@ function textIsAvailableField(config) {
|
|
|
3858
3684
|
/**
|
|
3859
3685
|
* Allows a directive to provide a formly context and form.
|
|
3860
3686
|
*/
|
|
3861
|
-
function
|
|
3862
|
-
return [
|
|
3687
|
+
function provideFormlyContext() {
|
|
3688
|
+
return [
|
|
3689
|
+
{
|
|
3863
3690
|
provide: DbxFormlyContext,
|
|
3864
3691
|
useClass: DbxFormlyContext
|
|
3865
3692
|
},
|
|
3866
|
-
...
|
|
3693
|
+
...provideDbxMutableForm(DbxFormlyContext)
|
|
3694
|
+
];
|
|
3867
3695
|
}
|
|
3868
3696
|
/**
|
|
3869
3697
|
* DbxForm Instance that registers a delegate and manages the state of that form/delegate.
|
|
@@ -3877,7 +3705,7 @@ class DbxFormlyContext {
|
|
|
3877
3705
|
this._delegate = new BehaviorSubject(undefined);
|
|
3878
3706
|
this.fields$ = this._fields.pipe(filterMaybe());
|
|
3879
3707
|
this.disabled$ = this._disabled.pipe(filterMaybe());
|
|
3880
|
-
this.stream$ = this._delegate.pipe(distinctUntilChanged(), switchMap(x => (x
|
|
3708
|
+
this.stream$ = this._delegate.pipe(distinctUntilChanged(), switchMap((x) => (x ? x.stream$ : of(DbxFormlyContext.INITIAL_STATE))), shareReplay(1));
|
|
3881
3709
|
}
|
|
3882
3710
|
destroy() {
|
|
3883
3711
|
this.lockSet.destroyOnNextUnlock(() => {
|
|
@@ -3912,7 +3740,7 @@ class DbxFormlyContext {
|
|
|
3912
3740
|
}
|
|
3913
3741
|
// MARK: FormComponent
|
|
3914
3742
|
getValue() {
|
|
3915
|
-
return this._delegate.pipe(filterMaybe(), switchMap(x => x.getValue()), shareReplay
|
|
3743
|
+
return this._delegate.pipe(filterMaybe(), switchMap((x) => x.getValue()), shareReplay(1));
|
|
3916
3744
|
}
|
|
3917
3745
|
setValue(value) {
|
|
3918
3746
|
this._initialValue.next(value);
|
|
@@ -4028,7 +3856,7 @@ class AbstractConfigAsyncFormlyFormDirective extends AbstractAsyncFormlyFormDire
|
|
|
4028
3856
|
constructor() {
|
|
4029
3857
|
super(...arguments);
|
|
4030
3858
|
this._config = new BehaviorSubject(undefined);
|
|
4031
|
-
this.config$ = this._config.pipe(filterMaybe(), shareReplay
|
|
3859
|
+
this.config$ = this._config.pipe(filterMaybe(), shareReplay(1));
|
|
4032
3860
|
}
|
|
4033
3861
|
get config() {
|
|
4034
3862
|
return this._config.value;
|
|
@@ -4070,12 +3898,12 @@ class DbxFormlyFieldsContextDirective extends AbstractAsyncFormlyFormDirective {
|
|
|
4070
3898
|
}
|
|
4071
3899
|
}
|
|
4072
3900
|
DbxFormlyFieldsContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyFieldsContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4073
|
-
DbxFormlyFieldsContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormlyFieldsContextDirective, selector: "[dbxFormlyFields]", inputs: { fields: ["dbxFormlyFields", "fields"] }, providers:
|
|
3901
|
+
DbxFormlyFieldsContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormlyFieldsContextDirective, selector: "[dbxFormlyFields]", inputs: { fields: ["dbxFormlyFields", "fields"] }, providers: provideFormlyContext(), usesInheritance: true, ngImport: i0 });
|
|
4074
3902
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyFieldsContextDirective, decorators: [{
|
|
4075
3903
|
type: Directive,
|
|
4076
3904
|
args: [{
|
|
4077
3905
|
selector: '[dbxFormlyFields]',
|
|
4078
|
-
providers:
|
|
3906
|
+
providers: provideFormlyContext()
|
|
4079
3907
|
}]
|
|
4080
3908
|
}], propDecorators: { fields: [{
|
|
4081
3909
|
type: Input,
|
|
@@ -4098,10 +3926,10 @@ class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
|
4098
3926
|
this.form = new FormGroup({});
|
|
4099
3927
|
this.model = {};
|
|
4100
3928
|
this.options = {};
|
|
4101
|
-
this.fields$ = this._fields.pipe(switchMapMaybeObs(), distinctUntilChanged(), shareReplay
|
|
4102
|
-
this.stream$ = this._reset.pipe(switchMap((lastResetAt) => this.form.valueChanges.pipe(startWith(0), distinctUntilChanged(), throttleTime
|
|
3929
|
+
this.fields$ = this._fields.pipe(switchMapMaybeObs(), distinctUntilChanged(), shareReplay(1));
|
|
3930
|
+
this.stream$ = this._reset.pipe(switchMap((lastResetAt) => this.form.valueChanges.pipe(startWith(0), distinctUntilChanged(), throttleTime(50, undefined, { leading: true, trailing: true }), scanCount(-1),
|
|
4103
3931
|
// update on validation changes too. Does not count towards changes since last reset.
|
|
4104
|
-
switchMap(changesSinceLastReset => this.form.statusChanges.pipe(startWith(this.form.status), distinctUntilChanged()).pipe(map(
|
|
3932
|
+
switchMap((changesSinceLastReset) => this.form.statusChanges.pipe(startWith(this.form.status), distinctUntilChanged()).pipe(map(() => changesSinceLastReset))), map((changesSinceLastResetCount) => ({
|
|
4105
3933
|
changesSinceLastResetCount,
|
|
4106
3934
|
isFormValid: this.form.status !== 'PENDING' && this.form.valid,
|
|
4107
3935
|
isFormDisabled: this.form.disabled
|
|
@@ -4123,7 +3951,7 @@ class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
|
4123
3951
|
const complete = isFormValid;
|
|
4124
3952
|
const nextState = {
|
|
4125
3953
|
isComplete: complete,
|
|
4126
|
-
state:
|
|
3954
|
+
state: isReset ? DbxFormState.RESET : DbxFormState.USED,
|
|
4127
3955
|
status: this.form.status,
|
|
4128
3956
|
untouched: this.form.untouched,
|
|
4129
3957
|
pristine: this.form.pristine,
|
|
@@ -4134,7 +3962,7 @@ class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
|
4134
3962
|
};
|
|
4135
3963
|
// console.log('Change: ', nextState);
|
|
4136
3964
|
return nextState;
|
|
4137
|
-
}))), shareReplay
|
|
3965
|
+
}))), shareReplay(1));
|
|
4138
3966
|
}
|
|
4139
3967
|
ngOnInit() {
|
|
4140
3968
|
this.context.setDelegate(this);
|
|
@@ -4214,7 +4042,7 @@ class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
|
4214
4042
|
}
|
|
4215
4043
|
}
|
|
4216
4044
|
DbxFormlyFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyFormComponent, deps: [{ token: DbxFormlyContext }], target: i0.ɵɵFactoryTarget.Component });
|
|
4217
|
-
DbxFormlyFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormlyFormComponent, selector: "dbx-formly", host: { classAttribute: "dbx-formly" }, providers:
|
|
4045
|
+
DbxFormlyFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormlyFormComponent, selector: "dbx-formly", host: { classAttribute: "dbx-formly" }, providers: provideDbxMutableForm(DbxFormlyFormComponent), exportAs: ["formly"], usesInheritance: true, ngImport: i0, template: `
|
|
4218
4046
|
<form [formGroup]="form" class="dbx-formly">
|
|
4219
4047
|
<formly-form [form]="form" [fields]="(fields$ | async) ?? []" [model]="model"></formly-form>
|
|
4220
4048
|
</form>
|
|
@@ -4229,9 +4057,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4229
4057
|
<formly-form [form]="form" [fields]="(fields$ | async) ?? []" [model]="model"></formly-form>
|
|
4230
4058
|
</form>
|
|
4231
4059
|
`,
|
|
4232
|
-
providers:
|
|
4060
|
+
providers: provideDbxMutableForm(DbxFormlyFormComponent),
|
|
4233
4061
|
host: {
|
|
4234
|
-
|
|
4062
|
+
class: 'dbx-formly'
|
|
4235
4063
|
}
|
|
4236
4064
|
}]
|
|
4237
4065
|
}], ctorParameters: function () { return [{ type: DbxFormlyContext }]; } });
|
|
@@ -4239,12 +4067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4239
4067
|
class DbxFormlyModule {
|
|
4240
4068
|
}
|
|
4241
4069
|
DbxFormlyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4242
|
-
DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, declarations: [DbxFormlyFormComponent,
|
|
4243
|
-
DbxFormlyFieldsContextDirective], imports: [CommonModule,
|
|
4244
|
-
FormsModule,
|
|
4245
|
-
ReactiveFormsModule,
|
|
4246
|
-
FormlyModule,
|
|
4247
|
-
FormlyMatToggleModule], exports: [
|
|
4070
|
+
DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, declarations: [DbxFormlyFormComponent, DbxFormlyFieldsContextDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, FormlyModule, FormlyMatToggleModule], exports: [
|
|
4248
4071
|
// Modules (?)
|
|
4249
4072
|
FormsModule,
|
|
4250
4073
|
ReactiveFormsModule,
|
|
@@ -4253,30 +4076,15 @@ DbxFormlyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
4253
4076
|
DbxFormlyFieldsContextDirective
|
|
4254
4077
|
// Helper Modules
|
|
4255
4078
|
] });
|
|
4256
|
-
DbxFormlyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, imports: [[
|
|
4257
|
-
CommonModule,
|
|
4258
|
-
FormsModule,
|
|
4259
|
-
ReactiveFormsModule,
|
|
4260
|
-
FormlyModule,
|
|
4261
|
-
FormlyMatToggleModule
|
|
4262
|
-
],
|
|
4079
|
+
DbxFormlyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, imports: [[CommonModule, FormsModule, ReactiveFormsModule, FormlyModule, FormlyMatToggleModule],
|
|
4263
4080
|
// Modules (?)
|
|
4264
4081
|
FormsModule,
|
|
4265
4082
|
ReactiveFormsModule] });
|
|
4266
4083
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormlyModule, decorators: [{
|
|
4267
4084
|
type: NgModule,
|
|
4268
4085
|
args: [{
|
|
4269
|
-
imports: [
|
|
4270
|
-
|
|
4271
|
-
FormsModule,
|
|
4272
|
-
ReactiveFormsModule,
|
|
4273
|
-
FormlyModule,
|
|
4274
|
-
FormlyMatToggleModule
|
|
4275
|
-
],
|
|
4276
|
-
declarations: [
|
|
4277
|
-
DbxFormlyFormComponent,
|
|
4278
|
-
DbxFormlyFieldsContextDirective
|
|
4279
|
-
],
|
|
4086
|
+
imports: [CommonModule, FormsModule, ReactiveFormsModule, FormlyModule, FormlyMatToggleModule],
|
|
4087
|
+
declarations: [DbxFormlyFormComponent, DbxFormlyFieldsContextDirective],
|
|
4280
4088
|
exports: [
|
|
4281
4089
|
// Modules (?)
|
|
4282
4090
|
FormsModule,
|
|
@@ -4295,12 +4103,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4295
4103
|
class DbxFormSpacerComponent {
|
|
4296
4104
|
}
|
|
4297
4105
|
DbxFormSpacerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4298
|
-
DbxFormSpacerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormSpacerComponent, selector: "dbx-form-spacer", ngImport: i0, template:
|
|
4106
|
+
DbxFormSpacerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormSpacerComponent, selector: "dbx-form-spacer", ngImport: i0, template: `
|
|
4107
|
+
<div class="dbx-form-spacer"></div>
|
|
4108
|
+
`, isInline: true });
|
|
4299
4109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSpacerComponent, decorators: [{
|
|
4300
4110
|
type: Component,
|
|
4301
4111
|
args: [{
|
|
4302
4112
|
selector: 'dbx-form-spacer',
|
|
4303
|
-
template:
|
|
4113
|
+
template: `
|
|
4114
|
+
<div class="dbx-form-spacer"></div>
|
|
4115
|
+
`
|
|
4304
4116
|
}]
|
|
4305
4117
|
}] });
|
|
4306
4118
|
|
|
@@ -4308,25 +4120,17 @@ class DbxFormLayoutModule {
|
|
|
4308
4120
|
}
|
|
4309
4121
|
DbxFormLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4310
4122
|
DbxFormLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormLayoutModule, declarations: [DbxFormSpacerComponent], imports: [CommonModule], exports: [DbxFormSpacerComponent] });
|
|
4311
|
-
DbxFormLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormLayoutModule, imports: [[
|
|
4312
|
-
CommonModule
|
|
4313
|
-
]] });
|
|
4123
|
+
DbxFormLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormLayoutModule, imports: [[CommonModule]] });
|
|
4314
4124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormLayoutModule, decorators: [{
|
|
4315
4125
|
type: NgModule,
|
|
4316
4126
|
args: [{
|
|
4317
|
-
imports: [
|
|
4318
|
-
|
|
4319
|
-
]
|
|
4320
|
-
declarations: [
|
|
4321
|
-
DbxFormSpacerComponent
|
|
4322
|
-
],
|
|
4323
|
-
exports: [
|
|
4324
|
-
DbxFormSpacerComponent
|
|
4325
|
-
]
|
|
4127
|
+
imports: [CommonModule],
|
|
4128
|
+
declarations: [DbxFormSpacerComponent],
|
|
4129
|
+
exports: [DbxFormSpacerComponent]
|
|
4326
4130
|
}]
|
|
4327
4131
|
}] });
|
|
4328
4132
|
|
|
4329
|
-
function
|
|
4133
|
+
function isTruthy() {
|
|
4330
4134
|
return (control) => {
|
|
4331
4135
|
const value = control.value;
|
|
4332
4136
|
if (!value) {
|
|
@@ -4339,26 +4143,29 @@ function IsTruthy() {
|
|
|
4339
4143
|
}
|
|
4340
4144
|
|
|
4341
4145
|
const DOMAIN_NAME_REGEX = /(.+)\.(.+)/;
|
|
4342
|
-
function
|
|
4146
|
+
function isDomain() {
|
|
4343
4147
|
return Validators.pattern(DOMAIN_NAME_REGEX);
|
|
4344
4148
|
}
|
|
4345
4149
|
|
|
4346
|
-
|
|
4150
|
+
/**
|
|
4151
|
+
* Merges the use of the min and max validator.
|
|
4152
|
+
*
|
|
4153
|
+
* @param min
|
|
4154
|
+
* @param max
|
|
4155
|
+
* @returns
|
|
4156
|
+
*/
|
|
4157
|
+
function isInRange(min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
4158
|
+
const minFn = Validators.min(min);
|
|
4159
|
+
const maxFn = Validators.max(max);
|
|
4347
4160
|
return (control) => {
|
|
4348
|
-
const
|
|
4349
|
-
const
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
errors.min = value;
|
|
4357
|
-
}
|
|
4358
|
-
if (!smallEnough) {
|
|
4359
|
-
errors.max = value;
|
|
4360
|
-
}
|
|
4361
|
-
}
|
|
4161
|
+
const minError = minFn(control);
|
|
4162
|
+
const maxError = maxFn(control);
|
|
4163
|
+
let errors = null;
|
|
4164
|
+
if (minError || maxError) {
|
|
4165
|
+
errors = {
|
|
4166
|
+
...minError,
|
|
4167
|
+
...maxError
|
|
4168
|
+
};
|
|
4362
4169
|
}
|
|
4363
4170
|
return errors;
|
|
4364
4171
|
};
|
|
@@ -4367,20 +4174,12 @@ function IsInRange(min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER)
|
|
|
4367
4174
|
class DbxFormExtensionModule {
|
|
4368
4175
|
}
|
|
4369
4176
|
DbxFormExtensionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4370
|
-
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule,
|
|
4371
|
-
|
|
4372
|
-
DbxFormFormlyFieldModule] });
|
|
4373
|
-
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule,
|
|
4374
|
-
DbxFormlyModule,
|
|
4375
|
-
DbxFormFormlyFieldModule] });
|
|
4177
|
+
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule] });
|
|
4178
|
+
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule] });
|
|
4376
4179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, decorators: [{
|
|
4377
4180
|
type: NgModule,
|
|
4378
4181
|
args: [{
|
|
4379
|
-
exports: [
|
|
4380
|
-
DbxFormModule,
|
|
4381
|
-
DbxFormlyModule,
|
|
4382
|
-
DbxFormFormlyFieldModule
|
|
4383
|
-
]
|
|
4182
|
+
exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule]
|
|
4384
4183
|
}]
|
|
4385
4184
|
}] });
|
|
4386
4185
|
|
|
@@ -4388,5 +4187,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4388
4187
|
* Generated bundle index. Do not edit.
|
|
4389
4188
|
*/
|
|
4390
4189
|
|
|
4391
|
-
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, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_FORM_DISABLED_KEY, DEFAULT_HAS_VALUE_FN, DEFAULT_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, 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, DbxFormWorkingWrapperComponent, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY, FLEX_WRAPPER_KEY, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE,
|
|
4190
|
+
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, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_FORM_DISABLED_KEY, DEFAULT_HAS_VALUE_FN, DEFAULT_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, 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, DbxFormWorkingWrapperComponent, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY, FLEX_WRAPPER_KEY, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE, LABEL_STRING_MAX_LENGTH, MAX_LENGTH_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, PHONE_LABEL_MAX_LENGTH, 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, WORKING_WRAPPER_KEY, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressListField, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateTimeField, dbxFormSourceObservable, defaultValidationMessages, disableFormlyFieldAutofillAttributes, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPickableItemFieldValuesByLabel, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDomain, isInRange, isTruthy, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, minLengthValidationMessage, minValidationMessage, nameField, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, staticEnumField, styleWrapper, subsectionWrapper, templateOptionsForFieldConfig, templateOptionsValueForFieldConfig, textAreaField, textEditorField, textField, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, toggleField, toggleWrapper, usernamePasswordLoginFields, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
4392
4191
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|