@dereekb/dbx-form 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_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 +2 -5
- 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/field/checklist/checklist.field.mjs +2 -5
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +9 -5
- 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 +39 -39
- 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 +16 -11
- 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 +19 -21
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.mjs +5 -3
- 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 +6 -6
- 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 +4 -2
- 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 +30 -24
- 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 +18 -27
- 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 +1 -2
- 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 +11 -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 +7 -3
- 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 +1 -1
- 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 +1 -1
- package/esm2020/lib/formly/field/wrapper/wrapper.mjs +6 -4
- package/esm2020/lib/formly/formly.context.directive.mjs +1 -1
- package/esm2020/lib/formly/formly.context.mjs +7 -5
- package/esm2020/lib/formly/formly.directive.mjs +1 -1
- package/esm2020/lib/formly/formly.form.component.mjs +4 -4
- 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 -10
- 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 +1 -1
- package/esm2020/lib/validator/field.mjs +3 -3
- package/esm2020/lib/validator/number.mjs +1 -1
- package/fesm2015/dereekb-dbx-form.mjs +347 -551
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +347 -551
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form/_form.scss +6 -4
- package/lib/formly/_formly.scss +6 -4
- package/lib/formly/field/checklist/_checklist.scss +6 -10
- package/lib/formly/field/checklist/checklist.item.d.ts +5 -5
- package/lib/formly/field/component/_component.scss +6 -4
- package/lib/formly/field/component/component.field.d.ts +1 -1
- 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 +3 -3
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +11 -11
- package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +5 -5
- package/lib/formly/field/selection/searchable/_searchable.scss +4 -6
- package/lib/formly/field/selection/searchable/text.chip.field.d.ts +3 -3
- package/lib/formly/field/selection/selection.d.ts +3 -3
- package/lib/formly/field/texteditor/_texteditor.scss +3 -8
- package/lib/formly/field/value/array/_array.scss +2 -6
- 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/enum/_enum.scss +6 -4
- 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/wrapper/_wrapper.scss +4 -4
- package/lib/formly/template/login.d.ts +1 -1
- 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/field.d.ts +2 -2
- package/package.json +3 -3
|
@@ -89,10 +89,7 @@ function provideDbxForm(sourceType) {
|
|
|
89
89
|
return [{ provide: DbxForm, useExisting: forwardRef(() => sourceType) }];
|
|
90
90
|
}
|
|
91
91
|
function provideDbxMutableForm(sourceType) {
|
|
92
|
-
return [
|
|
93
|
-
...provideDbxForm(sourceType),
|
|
94
|
-
{ provide: DbxMutableForm, useExisting: forwardRef(() => sourceType) }
|
|
95
|
-
];
|
|
92
|
+
return [...provideDbxForm(sourceType), { provide: DbxMutableForm, useExisting: forwardRef(() => sourceType) }];
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
const APP_ACTION_FORM_DISABLED_KEY = 'dbx_action_form';
|
|
@@ -125,7 +122,8 @@ class DbxActionFormDirective {
|
|
|
125
122
|
}
|
|
126
123
|
ngOnInit() {
|
|
127
124
|
// Pass data from the form to the source when triggered.
|
|
128
|
-
this._triggeredSub.subscription = this.source.triggered
|
|
125
|
+
this._triggeredSub.subscription = this.source.triggered$
|
|
126
|
+
.pipe(switchMap(() => this.form.stream$.pipe(first(), exhaustMap((stream) => {
|
|
129
127
|
const { isComplete } = stream;
|
|
130
128
|
const doNothing = {}; // nothing, form not complete
|
|
131
129
|
let obs;
|
|
@@ -143,7 +141,8 @@ class DbxActionFormDirective {
|
|
|
143
141
|
obs = of(doNothing);
|
|
144
142
|
}
|
|
145
143
|
return obs;
|
|
146
|
-
}))))
|
|
144
|
+
}))))
|
|
145
|
+
.subscribe((result) => {
|
|
147
146
|
if (result.reject) {
|
|
148
147
|
this.source.reject(result.reject);
|
|
149
148
|
}
|
|
@@ -155,35 +154,33 @@ class DbxActionFormDirective {
|
|
|
155
154
|
}
|
|
156
155
|
});
|
|
157
156
|
// Update the enabled/disabled state
|
|
158
|
-
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) => {
|
|
159
159
|
return this.form.getValue().pipe(first(), exhaustMap((value) => {
|
|
160
160
|
// Use both changes count and whether or not something was in the past to guage whether or not the item has been touched.
|
|
161
161
|
// Angular Form's untouched is whether or not focus has been lost but we can still recieve value updates.
|
|
162
162
|
// More than a certain amount of updates implies that it is being typed into.
|
|
163
|
-
const isProbablyTouched = !event.untouched ||
|
|
164
|
-
((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)));
|
|
165
164
|
let validatorObs;
|
|
166
165
|
const initialIsValidCheck = event.isComplete;
|
|
167
166
|
if (initialIsValidCheck) {
|
|
168
|
-
validatorObs =
|
|
167
|
+
validatorObs = this.dbxActionFormValidator ? this.dbxActionFormValidator(value) : of(true);
|
|
169
168
|
}
|
|
170
169
|
else {
|
|
171
170
|
validatorObs = of(false);
|
|
172
171
|
}
|
|
173
172
|
let modifiedObs;
|
|
174
|
-
const isConsideredModified =
|
|
173
|
+
const isConsideredModified = event.pristine === false && isProbablyTouched;
|
|
175
174
|
if (isConsideredModified) {
|
|
176
|
-
modifiedObs =
|
|
175
|
+
modifiedObs = this.dbxActionFormModified ? this.dbxActionFormModified(value) : of(true);
|
|
177
176
|
}
|
|
178
177
|
else {
|
|
179
178
|
modifiedObs = of(false);
|
|
180
179
|
}
|
|
181
|
-
return combineLatest([
|
|
182
|
-
validatorObs,
|
|
183
|
-
modifiedObs
|
|
184
|
-
]).pipe(first(), map(([valid, modified]) => ({ valid, modified, value, event })));
|
|
180
|
+
return combineLatest([validatorObs, modifiedObs]).pipe(first(), map(([valid, modified]) => ({ valid, modified, value, event })));
|
|
185
181
|
}));
|
|
186
|
-
}))
|
|
182
|
+
}))
|
|
183
|
+
.subscribe(({ valid, modified /*, value, event */ }) => {
|
|
187
184
|
// console.log('x: ', value, event, valid, modified);
|
|
188
185
|
// Update Modified State
|
|
189
186
|
this.source.setIsModified(modified);
|
|
@@ -191,7 +188,9 @@ class DbxActionFormDirective {
|
|
|
191
188
|
this.source.enable(APP_ACTION_FORM_DISABLED_KEY, valid);
|
|
192
189
|
});
|
|
193
190
|
// Watch the working state and disable form while working
|
|
194
|
-
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) => {
|
|
195
194
|
this.form.setDisabled(APP_ACTION_FORM_DISABLED_KEY, disable);
|
|
196
195
|
});
|
|
197
196
|
}
|
|
@@ -206,12 +205,9 @@ class DbxActionFormDirective {
|
|
|
206
205
|
});
|
|
207
206
|
}
|
|
208
207
|
preCheckReadyValue(value) {
|
|
209
|
-
const validatorObs =
|
|
210
|
-
const modifiedObs =
|
|
211
|
-
return combineLatest([
|
|
212
|
-
validatorObs,
|
|
213
|
-
modifiedObs
|
|
214
|
-
]).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));
|
|
215
211
|
}
|
|
216
212
|
readyValue(value) {
|
|
217
213
|
return of({ value });
|
|
@@ -254,7 +250,7 @@ DbxActionFormSafetyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12
|
|
|
254
250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFormSafetyDirective, decorators: [{
|
|
255
251
|
type: Directive,
|
|
256
252
|
args: [{
|
|
257
|
-
selector: '[dbxActionFormSafety]'
|
|
253
|
+
selector: '[dbxActionFormSafety]'
|
|
258
254
|
}]
|
|
259
255
|
}], ctorParameters: function () { return [{ type: DbxActionFormDirective, decorators: [{
|
|
260
256
|
type: Host
|
|
@@ -267,59 +263,37 @@ class DbxFormActionTransitionModule {
|
|
|
267
263
|
}
|
|
268
264
|
DbxFormActionTransitionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
269
265
|
DbxFormActionTransitionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, declarations: [DbxActionFormSafetyDirective], imports: [CommonModule], exports: [DbxActionFormSafetyDirective] });
|
|
270
|
-
DbxFormActionTransitionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, imports: [[
|
|
271
|
-
CommonModule
|
|
272
|
-
]] });
|
|
266
|
+
DbxFormActionTransitionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, imports: [[CommonModule]] });
|
|
273
267
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionTransitionModule, decorators: [{
|
|
274
268
|
type: NgModule,
|
|
275
269
|
args: [{
|
|
276
|
-
imports: [
|
|
277
|
-
|
|
278
|
-
]
|
|
279
|
-
declarations: [
|
|
280
|
-
DbxActionFormSafetyDirective
|
|
281
|
-
],
|
|
282
|
-
exports: [
|
|
283
|
-
DbxActionFormSafetyDirective
|
|
284
|
-
]
|
|
270
|
+
imports: [CommonModule],
|
|
271
|
+
declarations: [DbxActionFormSafetyDirective],
|
|
272
|
+
exports: [DbxActionFormSafetyDirective]
|
|
285
273
|
}]
|
|
286
274
|
}] });
|
|
287
275
|
|
|
288
276
|
class DbxFormActionModule {
|
|
289
277
|
}
|
|
290
278
|
DbxFormActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
291
|
-
DbxFormActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, declarations: [DbxActionFormDirective], imports: [CommonModule,
|
|
292
|
-
|
|
293
|
-
DbxFormActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, imports: [[
|
|
294
|
-
CommonModule,
|
|
295
|
-
MatDialogModule
|
|
296
|
-
]] });
|
|
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]] });
|
|
297
281
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormActionModule, decorators: [{
|
|
298
282
|
type: NgModule,
|
|
299
283
|
args: [{
|
|
300
|
-
imports: [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
declarations: [
|
|
305
|
-
DbxActionFormDirective
|
|
306
|
-
],
|
|
307
|
-
exports: [
|
|
308
|
-
DbxActionFormDirective
|
|
309
|
-
]
|
|
284
|
+
imports: [CommonModule, MatDialogModule],
|
|
285
|
+
declarations: [DbxActionFormDirective],
|
|
286
|
+
exports: [DbxActionFormDirective]
|
|
310
287
|
}]
|
|
311
288
|
}] });
|
|
312
289
|
|
|
313
290
|
function dbxFormSourceObservable(form, inputObs, mode$) {
|
|
314
291
|
const observable = asObservable(inputObs);
|
|
315
|
-
return combineLatest([
|
|
316
|
-
observable.pipe(distinctUntilChanged()),
|
|
317
|
-
mode$.pipe(distinctUntilChanged())
|
|
318
|
-
]).pipe(switchMap(([value, mode]) => form.stream$.pipe(
|
|
292
|
+
return combineLatest([observable.pipe(distinctUntilChanged()), mode$.pipe(distinctUntilChanged())]).pipe(switchMap(([value, mode]) => form.stream$.pipe(
|
|
319
293
|
// wait for the form to finish initializing.
|
|
320
294
|
filter((x) => x.state !== DbxFormState.INITIALIZING),
|
|
321
295
|
// if mode is reset, then filter out changes until the form is reset again.
|
|
322
|
-
filter((x) => (
|
|
296
|
+
filter((x) => (mode === 'reset' ? x.state === DbxFormState.RESET : true)), first(), map(() => value))));
|
|
323
297
|
}
|
|
324
298
|
/**
|
|
325
299
|
* Used with a FormComponent to set the value based on the input value.
|
|
@@ -436,7 +410,9 @@ class DbxFormValueChangesDirective extends AbstractSubscriptionDirective {
|
|
|
436
410
|
this.dbxFormValueChange = new EventEmitter();
|
|
437
411
|
}
|
|
438
412
|
ngOnInit() {
|
|
439
|
-
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 }) => {
|
|
440
416
|
if (isComplete) {
|
|
441
417
|
this.dbxFormValueChange.next(value);
|
|
442
418
|
}
|
|
@@ -466,50 +442,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
466
442
|
class DbxFormIoModule {
|
|
467
443
|
}
|
|
468
444
|
DbxFormIoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
469
|
-
DbxFormIoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, declarations: [DbxFormSourceDirective,
|
|
470
|
-
|
|
471
|
-
DbxFormLoadingSourceDirective], imports: [CommonModule], exports: [DbxFormSourceDirective,
|
|
472
|
-
DbxFormValueChangesDirective,
|
|
473
|
-
DbxFormLoadingSourceDirective] });
|
|
474
|
-
DbxFormIoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, imports: [[
|
|
475
|
-
CommonModule
|
|
476
|
-
]] });
|
|
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]] });
|
|
477
447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormIoModule, decorators: [{
|
|
478
448
|
type: NgModule,
|
|
479
449
|
args: [{
|
|
480
|
-
imports: [
|
|
481
|
-
|
|
482
|
-
]
|
|
483
|
-
declarations: [
|
|
484
|
-
DbxFormSourceDirective,
|
|
485
|
-
DbxFormValueChangesDirective,
|
|
486
|
-
DbxFormLoadingSourceDirective
|
|
487
|
-
],
|
|
488
|
-
exports: [
|
|
489
|
-
DbxFormSourceDirective,
|
|
490
|
-
DbxFormValueChangesDirective,
|
|
491
|
-
DbxFormLoadingSourceDirective
|
|
492
|
-
]
|
|
450
|
+
imports: [CommonModule],
|
|
451
|
+
declarations: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective],
|
|
452
|
+
exports: [DbxFormSourceDirective, DbxFormValueChangesDirective, DbxFormLoadingSourceDirective]
|
|
493
453
|
}]
|
|
494
454
|
}] });
|
|
495
455
|
|
|
496
456
|
class DbxFormModule {
|
|
497
457
|
}
|
|
498
458
|
DbxFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
499
|
-
DbxFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, exports: [DbxFormActionTransitionModule,
|
|
500
|
-
|
|
501
|
-
DbxFormIoModule] });
|
|
502
|
-
DbxFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, imports: [DbxFormActionTransitionModule,
|
|
503
|
-
DbxFormActionModule,
|
|
504
|
-
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] });
|
|
505
461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormModule, decorators: [{
|
|
506
462
|
type: NgModule,
|
|
507
463
|
args: [{
|
|
508
|
-
exports: [
|
|
509
|
-
DbxFormActionTransitionModule,
|
|
510
|
-
DbxFormActionModule,
|
|
511
|
-
DbxFormIoModule
|
|
512
|
-
]
|
|
464
|
+
exports: [DbxFormActionTransitionModule, DbxFormActionModule, DbxFormIoModule]
|
|
513
465
|
}]
|
|
514
466
|
}] });
|
|
515
467
|
|
|
@@ -575,8 +527,8 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
575
527
|
super(...arguments);
|
|
576
528
|
this._displayContent = new BehaviorSubject(undefined);
|
|
577
529
|
this.displayContent$ = this._displayContent.pipe(switchMapMaybeObs(), distinctUntilChanged(), shareReplay(1));
|
|
578
|
-
this.anchor$ = this.displayContent$.pipe(map(x => x.anchor), shareReplay(1));
|
|
579
|
-
this.rippleDisabled$ = this.displayContent$.pipe(map(x => x.ripple === false || (x.ripple !== true && !x.anchor)), 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));
|
|
580
532
|
}
|
|
581
533
|
get formGroup() {
|
|
582
534
|
return this.form;
|
|
@@ -634,12 +586,16 @@ class DbxChecklistItemContentComponent extends AbstractSubscriptionDirective {
|
|
|
634
586
|
}
|
|
635
587
|
}
|
|
636
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 });
|
|
637
|
-
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"] }] });
|
|
638
592
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxChecklistItemContentComponent, decorators: [{
|
|
639
593
|
type: Component,
|
|
640
594
|
args: [{
|
|
641
595
|
selector: 'dbx-checklist-item-content-component',
|
|
642
|
-
template:
|
|
596
|
+
template: `
|
|
597
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
598
|
+
`
|
|
643
599
|
}]
|
|
644
600
|
}], ctorParameters: function () { return [{ type: DbxChecklistItemFieldComponent }, { type: i0.ChangeDetectorRef }]; } });
|
|
645
601
|
|
|
@@ -658,8 +614,7 @@ DbxFormInfoWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
658
614
|
<ng-container #fieldComponent></ng-container>
|
|
659
615
|
</div>
|
|
660
616
|
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
661
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
662
|
-
(click)="onInfoClick()">
|
|
617
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')" (click)="onInfoClick()">
|
|
663
618
|
<mat-icon>info</mat-icon>
|
|
664
619
|
</button>
|
|
665
620
|
</div>
|
|
@@ -674,8 +629,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
674
629
|
<ng-container #fieldComponent></ng-container>
|
|
675
630
|
</div>
|
|
676
631
|
<div class="dbx-form-info-wrapper-info" fxFlex="noshrink" fxLayout="column" fxLayoutAlign="center center">
|
|
677
|
-
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')"
|
|
678
|
-
(click)="onInfoClick()">
|
|
632
|
+
<button mat-icon-button [attr.aria-label]="'show info button for ' + (to.label || 'section')" (click)="onInfoClick()">
|
|
679
633
|
<mat-icon>info</mat-icon>
|
|
680
634
|
</button>
|
|
681
635
|
</div>
|
|
@@ -747,17 +701,17 @@ class DbxFormSubsectionWrapperComponent extends FieldWrapper {
|
|
|
747
701
|
}
|
|
748
702
|
DbxFormSubsectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSubsectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
749
703
|
DbxFormSubsectionWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormSubsectionWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
704
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
705
|
+
<ng-container #fieldComponent></ng-container>
|
|
706
|
+
</dbx-subsection>
|
|
753
707
|
`, isInline: true, components: [{ type: i1$1.DbxSubSectionComponent, selector: "dbx-subsection" }] });
|
|
754
708
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSubsectionWrapperComponent, decorators: [{
|
|
755
709
|
type: Component,
|
|
756
710
|
args: [{
|
|
757
711
|
template: `
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
712
|
+
<dbx-subsection [header]="header" [hint]="hint">
|
|
713
|
+
<ng-container #fieldComponent></ng-container>
|
|
714
|
+
</dbx-subsection>
|
|
761
715
|
`
|
|
762
716
|
}]
|
|
763
717
|
}] });
|
|
@@ -824,27 +778,27 @@ class DbxFormExpandWrapperComponent extends AbstractFormExpandableSectionWrapper
|
|
|
824
778
|
}
|
|
825
779
|
DbxFormExpandWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExpandWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
826
780
|
DbxFormExpandWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormExpandWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
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>
|
|
833
788
|
</ng-container>
|
|
834
|
-
</ng-container>
|
|
835
789
|
`, isInline: true, directives: [{ type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "async": i5.AsyncPipe } });
|
|
836
790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExpandWrapperComponent, decorators: [{
|
|
837
791
|
type: Component,
|
|
838
792
|
args: [{
|
|
839
793
|
template: `
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
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>
|
|
846
801
|
</ng-container>
|
|
847
|
-
</ng-container>
|
|
848
802
|
`
|
|
849
803
|
}]
|
|
850
804
|
}] });
|
|
@@ -863,11 +817,15 @@ class AutoTouchFieldWrapperComponent extends FieldWrapper {
|
|
|
863
817
|
}
|
|
864
818
|
}
|
|
865
819
|
AutoTouchFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AutoTouchFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
866
|
-
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 });
|
|
867
823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AutoTouchFieldWrapperComponent, decorators: [{
|
|
868
824
|
type: Component,
|
|
869
825
|
args: [{
|
|
870
|
-
template:
|
|
826
|
+
template: `
|
|
827
|
+
<ng-container #fieldComponent></ng-container>
|
|
828
|
+
`
|
|
871
829
|
}]
|
|
872
830
|
}] });
|
|
873
831
|
|
|
@@ -877,7 +835,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
877
835
|
class DbxFormToggleWrapperComponent extends AbstractFormExpandableSectionWrapperDirective {
|
|
878
836
|
constructor() {
|
|
879
837
|
super(...arguments);
|
|
880
|
-
this.slideLabel$ = this._toggleOpen.pipe(switchMap(x => {
|
|
838
|
+
this.slideLabel$ = this._toggleOpen.pipe(switchMap((x) => {
|
|
881
839
|
if (this.expandableSection?.toggleLabelObs) {
|
|
882
840
|
return this.expandableSection?.toggleLabelObs(x);
|
|
883
841
|
}
|
|
@@ -894,27 +852,27 @@ class DbxFormToggleWrapperComponent extends AbstractFormExpandableSectionWrapper
|
|
|
894
852
|
}
|
|
895
853
|
DbxFormToggleWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormToggleWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
896
854
|
DbxFormToggleWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFormToggleWrapperComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
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>
|
|
900
862
|
</div>
|
|
901
|
-
<ng-container *ngSwitchCase="true">
|
|
902
|
-
<ng-container #fieldComponent></ng-container>
|
|
903
|
-
</ng-container>
|
|
904
|
-
</div>
|
|
905
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 } });
|
|
906
864
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormToggleWrapperComponent, decorators: [{
|
|
907
865
|
type: Component,
|
|
908
866
|
args: [{
|
|
909
867
|
template: `
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
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>
|
|
913
875
|
</div>
|
|
914
|
-
<ng-container *ngSwitchCase="true">
|
|
915
|
-
<ng-container #fieldComponent></ng-container>
|
|
916
|
-
</ng-container>
|
|
917
|
-
</div>
|
|
918
876
|
`
|
|
919
877
|
}]
|
|
920
878
|
}] });
|
|
@@ -998,15 +956,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
998
956
|
class DbxFormFormlyWrapperModule {
|
|
999
957
|
}
|
|
1000
958
|
DbxFormFormlyWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1001
|
-
DbxFormFormlyWrapperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, declarations: [AutoTouchFieldWrapperComponent,
|
|
1002
|
-
DbxFormSectionWrapperComponent,
|
|
1003
|
-
DbxFormSubsectionWrapperComponent,
|
|
1004
|
-
DbxFormInfoWrapperComponent,
|
|
1005
|
-
DbxFormExpandWrapperComponent,
|
|
1006
|
-
DbxFormToggleWrapperComponent,
|
|
1007
|
-
DbxFormFlexWrapperComponent,
|
|
1008
|
-
DbxFormStyleWrapperComponent,
|
|
1009
|
-
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,
|
|
1010
960
|
DbxTextModule,
|
|
1011
961
|
DbxLoadingModule,
|
|
1012
962
|
DbxFlexLayoutModule,
|
|
@@ -1066,17 +1016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1066
1016
|
]
|
|
1067
1017
|
})
|
|
1068
1018
|
],
|
|
1069
|
-
declarations: [
|
|
1070
|
-
AutoTouchFieldWrapperComponent,
|
|
1071
|
-
DbxFormSectionWrapperComponent,
|
|
1072
|
-
DbxFormSubsectionWrapperComponent,
|
|
1073
|
-
DbxFormInfoWrapperComponent,
|
|
1074
|
-
DbxFormExpandWrapperComponent,
|
|
1075
|
-
DbxFormToggleWrapperComponent,
|
|
1076
|
-
DbxFormFlexWrapperComponent,
|
|
1077
|
-
DbxFormStyleWrapperComponent,
|
|
1078
|
-
DbxFormWorkingWrapperComponent
|
|
1079
|
-
],
|
|
1019
|
+
declarations: [AutoTouchFieldWrapperComponent, DbxFormSectionWrapperComponent, DbxFormSubsectionWrapperComponent, DbxFormInfoWrapperComponent, DbxFormExpandWrapperComponent, DbxFormToggleWrapperComponent, DbxFormFlexWrapperComponent, DbxFormStyleWrapperComponent, DbxFormWorkingWrapperComponent],
|
|
1080
1020
|
exports: []
|
|
1081
1021
|
}]
|
|
1082
1022
|
}] });
|
|
@@ -1084,9 +1024,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1084
1024
|
class DbxFormFormlyChecklistItemFieldModule {
|
|
1085
1025
|
}
|
|
1086
1026
|
DbxFormFormlyChecklistItemFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1087
|
-
DbxFormFormlyChecklistItemFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, declarations: [DbxChecklistItemFieldComponent,
|
|
1088
|
-
DbxChecklistItemContentComponent,
|
|
1089
|
-
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,
|
|
1090
1028
|
DbxTextModule,
|
|
1091
1029
|
FormsModule,
|
|
1092
1030
|
ReactiveFormsModule,
|
|
@@ -1110,9 +1048,7 @@ DbxFormFormlyChecklistItemFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVers
|
|
|
1110
1048
|
DbxInjectionComponentModule,
|
|
1111
1049
|
DbxFormFormlyWrapperModule,
|
|
1112
1050
|
FormlyModule.forChild({
|
|
1113
|
-
types: [
|
|
1114
|
-
{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }
|
|
1115
|
-
]
|
|
1051
|
+
types: [{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }]
|
|
1116
1052
|
})
|
|
1117
1053
|
], DbxFormFormlyWrapperModule] });
|
|
1118
1054
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyChecklistItemFieldModule, decorators: [{
|
|
@@ -1131,19 +1067,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1131
1067
|
DbxInjectionComponentModule,
|
|
1132
1068
|
DbxFormFormlyWrapperModule,
|
|
1133
1069
|
FormlyModule.forChild({
|
|
1134
|
-
types: [
|
|
1135
|
-
{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }
|
|
1136
|
-
]
|
|
1070
|
+
types: [{ name: 'checklistitem', component: DbxChecklistItemFieldComponent }]
|
|
1137
1071
|
})
|
|
1138
1072
|
],
|
|
1139
|
-
declarations: [
|
|
1140
|
-
|
|
1141
|
-
DbxChecklistItemContentComponent,
|
|
1142
|
-
DbxDefaultChecklistItemFieldDisplayComponent
|
|
1143
|
-
],
|
|
1144
|
-
exports: [
|
|
1145
|
-
DbxFormFormlyWrapperModule
|
|
1146
|
-
]
|
|
1073
|
+
declarations: [DbxChecklistItemFieldComponent, DbxChecklistItemContentComponent, DbxDefaultChecklistItemFieldDisplayComponent],
|
|
1074
|
+
exports: [DbxFormFormlyWrapperModule]
|
|
1147
1075
|
}]
|
|
1148
1076
|
}] });
|
|
1149
1077
|
|
|
@@ -1164,7 +1092,9 @@ function templateOptionsForFieldConfig(fieldConfig, override) {
|
|
|
1164
1092
|
};
|
|
1165
1093
|
}
|
|
1166
1094
|
function templateOptionsValueForFieldConfig(fieldConfig, override) {
|
|
1167
|
-
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
|
+
});
|
|
1168
1098
|
const attributes = mergeObjects([fieldConfig.attributes, override?.attributes]);
|
|
1169
1099
|
const result = filterFromPOJO({
|
|
1170
1100
|
...override,
|
|
@@ -1236,10 +1166,7 @@ class ChecklistItemFieldDataSetBuilder {
|
|
|
1236
1166
|
key
|
|
1237
1167
|
};
|
|
1238
1168
|
if (currentField.displayContentObs && config.displayContentObs) {
|
|
1239
|
-
mergedConfig.displayContentObs = combineLatest([
|
|
1240
|
-
currentField.displayContentObs,
|
|
1241
|
-
config.displayContentObs
|
|
1242
|
-
]).pipe(map(([a, b]) => {
|
|
1169
|
+
mergedConfig.displayContentObs = combineLatest([currentField.displayContentObs, config.displayContentObs]).pipe(map(([a, b]) => {
|
|
1243
1170
|
const result = {
|
|
1244
1171
|
...a,
|
|
1245
1172
|
...b
|
|
@@ -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
|
|
|
@@ -1389,8 +1308,8 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1389
1308
|
this.filterInputValue$ = this.inputCtrl.valueChanges.pipe(startWith(undefined));
|
|
1390
1309
|
this.filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged(), shareReplay(1));
|
|
1391
1310
|
this.loadResultsDisplayValuesState$ = this.formControl$.pipe(first(), switchMap(() => this.loadValuesFn().pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)), startWithBeginLoading())), shareReplay(1));
|
|
1392
|
-
this._formControlValue = this.formControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value), shareReplay(1))));
|
|
1393
|
-
this.loadResultsDisplayValues$ = this.loadResultsDisplayValuesState$.pipe(map(x => x?.value ?? []));
|
|
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
|
*/
|
|
@@ -1409,10 +1328,10 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
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
1350
|
})), startWithBeginLoading())))), shareReplay(1));
|
|
1432
|
-
this.filteredSearchResults$ = this.filteredSearchResultsState$.pipe(map(x => x?.value), filterMaybe(), 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
1359
|
}), shareReplay(1));
|
|
1441
|
-
this.itemsLoadingState$ = this.loadResultsDisplayValues$.pipe(switchMap(() => this.items$.pipe(first(), map(x => successResult(x)), startWithBeginLoading(), 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)), startWithBeginLoading(), shareReplay(1));
|
|
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 (
|
|
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
|
};
|
|
@@ -1537,40 +1456,40 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$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(1));
|
|
1612
|
+
map((x) => addConfigToValueListItems(this.config, x)), shareReplay(1));
|
|
1693
1613
|
}
|
|
1694
1614
|
get multiple() {
|
|
1695
1615
|
return this.dbxPickableListFieldComponent.multiSelect;
|
|
@@ -1703,11 +1623,15 @@ 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: provideDbxListView(DbxPickableListFieldItemListViewComponent), usesInheritance: true, ngImport: i0, template:
|
|
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:
|
|
1632
|
+
template: `
|
|
1633
|
+
<dbx-selection-list-view-content [multiple]="multiple" [selectionMode]="selectionMode" [items]="items$ | async"></dbx-selection-list-view-content>
|
|
1634
|
+
`,
|
|
1711
1635
|
providers: provideDbxListView(DbxPickableListFieldItemListViewComponent)
|
|
1712
1636
|
}]
|
|
1713
1637
|
}], ctorParameters: function () { return [{ type: DbxPickableListFieldComponent }]; } });
|
|
@@ -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));
|
|
@@ -1859,17 +1773,19 @@ class DbxSearchableFieldAutocompleteItemComponent {
|
|
|
1859
1773
|
constructor() {
|
|
1860
1774
|
this._displayValue = new BehaviorSubject(undefined);
|
|
1861
1775
|
this.displayValue$ = this._displayValue.pipe(filterMaybe(), shareReplay(1));
|
|
1862
|
-
this.config$ = this.displayValue$.pipe(map(x => {
|
|
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(1))));
|
|
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))));
|
|
1962
1878
|
this.values$ = this._formControlValue.pipe(map(convertMaybeToArray), shareReplay(1));
|
|
1963
1879
|
this.displayValuesState$ = this.values$.pipe(distinctUntilChanged(), switchMap((values) => this.loadDisplayValuesForValues(values)), shareReplay(1));
|
|
1964
|
-
this.displayValues$ = this.displayValuesState$.pipe(map(x => x?.value ?? []));
|
|
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;
|
|
@@ -2019,20 +1935,18 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$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
|
/**
|
|
@@ -2236,7 +2150,8 @@ function makeMetaFilterSearchableFieldValueDisplayFn({ loadMetaForValues, makeDi
|
|
|
2236
2150
|
const loadingResult = loadMetaForValues(needLoading);
|
|
2237
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,7 +2161,8 @@ function makeMetaFilterSearchableFieldValueDisplayFn({ loadMetaForValues, makeDi
|
|
|
2246
2161
|
anchor,
|
|
2247
2162
|
meta
|
|
2248
2163
|
};
|
|
2249
|
-
})
|
|
2164
|
+
})
|
|
2165
|
+
.filter((x) => !x.meta);
|
|
2250
2166
|
return mergedWithLoad;
|
|
2251
2167
|
}), map((result) => [...loaded, ...result]));
|
|
2252
2168
|
}
|
|
@@ -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(1), tapDetectChanges(this.cdRef));
|
|
2296
|
-
this.hasValue$ = this.selectedDisplayValue$.pipe(map(x => Boolean(x)));
|
|
2297
|
-
this.showSelectedDisplayValue$ = this.selectedDisplayValue$.pipe(map(x => this.showSelectedValue && Boolean(x)), distinctUntilChanged(), shareReplay(1), tapDetectChanges(this.cdRef));
|
|
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
|
}
|
|
@@ -2321,19 +2237,16 @@ class DbxSearchableTextFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
2321
2237
|
}
|
|
2322
2238
|
}
|
|
2323
2239
|
DbxSearchableTextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableTextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2324
|
-
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 } });
|
|
2325
2241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxSearchableTextFieldComponent, decorators: [{
|
|
2326
2242
|
type: Component,
|
|
2327
|
-
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" }]
|
|
2328
2244
|
}] });
|
|
2329
2245
|
|
|
2330
2246
|
class DbxFormFormlySearchableFieldModule {
|
|
2331
2247
|
}
|
|
2332
2248
|
DbxFormFormlySearchableFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2333
|
-
DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, declarations: [DbxSearchableChipFieldComponent,
|
|
2334
|
-
DbxSearchableTextFieldComponent,
|
|
2335
|
-
DbxSearchableFieldAutocompleteItemComponent,
|
|
2336
|
-
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,
|
|
2337
2250
|
DbxTextModule,
|
|
2338
2251
|
DbxLoadingModule,
|
|
2339
2252
|
DbxButtonModule,
|
|
@@ -2348,8 +2261,7 @@ DbxFormFormlySearchableFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion
|
|
|
2348
2261
|
DbxRouterAnchorModule,
|
|
2349
2262
|
MatChipsModule,
|
|
2350
2263
|
MatIconModule,
|
|
2351
|
-
DbxInjectionComponentModule, i1$4.FormlyModule], exports: [DbxSearchableChipFieldComponent,
|
|
2352
|
-
DbxSearchableTextFieldComponent] });
|
|
2264
|
+
DbxInjectionComponentModule, i1$4.FormlyModule], exports: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent] });
|
|
2353
2265
|
DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySearchableFieldModule, imports: [[
|
|
2354
2266
|
CommonModule,
|
|
2355
2267
|
DbxTextModule,
|
|
@@ -2370,7 +2282,7 @@ DbxFormFormlySearchableFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion
|
|
|
2370
2282
|
FormlyModule.forChild({
|
|
2371
2283
|
types: [
|
|
2372
2284
|
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2373
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2285
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2374
2286
|
]
|
|
2375
2287
|
})
|
|
2376
2288
|
]] });
|
|
@@ -2397,32 +2309,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2397
2309
|
FormlyModule.forChild({
|
|
2398
2310
|
types: [
|
|
2399
2311
|
{ name: 'searchablechipfield', component: DbxSearchableChipFieldComponent, wrappers: ['form-field'] },
|
|
2400
|
-
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2312
|
+
{ name: 'searchabletextfield', component: DbxSearchableTextFieldComponent, wrappers: ['form-field'] }
|
|
2401
2313
|
]
|
|
2402
2314
|
})
|
|
2403
2315
|
],
|
|
2404
|
-
declarations: [
|
|
2405
|
-
|
|
2406
|
-
DbxSearchableTextFieldComponent,
|
|
2407
|
-
DbxSearchableFieldAutocompleteItemComponent,
|
|
2408
|
-
DbxDefaultSearchableFieldDisplayComponent
|
|
2409
|
-
],
|
|
2410
|
-
exports: [
|
|
2411
|
-
DbxSearchableChipFieldComponent,
|
|
2412
|
-
DbxSearchableTextFieldComponent
|
|
2413
|
-
]
|
|
2316
|
+
declarations: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxDefaultSearchableFieldDisplayComponent],
|
|
2317
|
+
exports: [DbxSearchableChipFieldComponent, DbxSearchableTextFieldComponent]
|
|
2414
2318
|
}]
|
|
2415
2319
|
}] });
|
|
2416
2320
|
|
|
2417
2321
|
function chipTextField(config) {
|
|
2418
|
-
const convertStringValue =
|
|
2322
|
+
const convertStringValue = config.caseSensitive ? (x) => x : (x) => x?.toLowerCase();
|
|
2419
2323
|
return formlyField({
|
|
2420
2324
|
type: 'searchablechipfield',
|
|
2421
2325
|
allowStringValues: true,
|
|
2422
2326
|
convertStringValue,
|
|
2423
2327
|
...config,
|
|
2424
2328
|
displayForValue: (values) => {
|
|
2425
|
-
return of(values.map(x => ({ ...x, label: x.value })));
|
|
2329
|
+
return of(values.map((x) => ({ ...x, label: x.value })));
|
|
2426
2330
|
}
|
|
2427
2331
|
});
|
|
2428
2332
|
}
|
|
@@ -2430,23 +2334,14 @@ function chipTextField(config) {
|
|
|
2430
2334
|
class DbxFormFormlySelectionModule {
|
|
2431
2335
|
}
|
|
2432
2336
|
DbxFormFormlySelectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2433
|
-
DbxFormFormlySelectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [CommonModule], exports: [DbxFormFormlyPickableFieldModule,
|
|
2434
|
-
|
|
2435
|
-
DbxFormFormlySelectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, imports: [[
|
|
2436
|
-
CommonModule
|
|
2437
|
-
], DbxFormFormlyPickableFieldModule,
|
|
2438
|
-
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] });
|
|
2439
2339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlySelectionModule, decorators: [{
|
|
2440
2340
|
type: NgModule,
|
|
2441
2341
|
args: [{
|
|
2442
|
-
imports: [
|
|
2443
|
-
CommonModule
|
|
2444
|
-
],
|
|
2342
|
+
imports: [CommonModule],
|
|
2445
2343
|
declarations: [],
|
|
2446
|
-
exports: [
|
|
2447
|
-
DbxFormFormlyPickableFieldModule,
|
|
2448
|
-
DbxFormFormlySearchableFieldModule
|
|
2449
|
-
]
|
|
2344
|
+
exports: [DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule]
|
|
2450
2345
|
}]
|
|
2451
2346
|
}] });
|
|
2452
2347
|
|
|
@@ -2477,7 +2372,9 @@ class DbxTextEditorFieldComponent extends FieldType$1 {
|
|
|
2477
2372
|
ngOnInit() {
|
|
2478
2373
|
this._editor = new Editor({});
|
|
2479
2374
|
// Watch for value changes every second and update the pristine level.
|
|
2480
|
-
this._sub.subscription = this.editor.valueChanges
|
|
2375
|
+
this._sub.subscription = this.editor.valueChanges
|
|
2376
|
+
.pipe(debounceTime(100), filter(() => this.editor.view.hasFocus()))
|
|
2377
|
+
.subscribe(() => {
|
|
2481
2378
|
this.formControl.updateValueAndValidity();
|
|
2482
2379
|
this.formControl.markAsDirty();
|
|
2483
2380
|
});
|
|
@@ -2547,9 +2444,7 @@ DbxFormFormlyTextEditorFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion
|
|
|
2547
2444
|
MatFormFieldModule,
|
|
2548
2445
|
MatInputModule,
|
|
2549
2446
|
FormlyModule.forChild({
|
|
2550
|
-
types: [
|
|
2551
|
-
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2552
|
-
]
|
|
2447
|
+
types: [{ name: 'texteditor', component: DbxTextEditorFieldComponent }]
|
|
2553
2448
|
})
|
|
2554
2449
|
]] });
|
|
2555
2450
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextEditorFieldModule, decorators: [{
|
|
@@ -2564,14 +2459,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2564
2459
|
MatFormFieldModule,
|
|
2565
2460
|
MatInputModule,
|
|
2566
2461
|
FormlyModule.forChild({
|
|
2567
|
-
types: [
|
|
2568
|
-
{ name: 'texteditor', component: DbxTextEditorFieldComponent }
|
|
2569
|
-
]
|
|
2462
|
+
types: [{ name: 'texteditor', component: DbxTextEditorFieldComponent }]
|
|
2570
2463
|
})
|
|
2571
2464
|
],
|
|
2572
|
-
declarations: [
|
|
2573
|
-
DbxTextEditorFieldComponent
|
|
2574
|
-
],
|
|
2465
|
+
declarations: [DbxTextEditorFieldComponent],
|
|
2575
2466
|
exports: []
|
|
2576
2467
|
}]
|
|
2577
2468
|
}] });
|
|
@@ -2620,7 +2511,7 @@ class DbxFormRepeatArrayTypeComponent extends FieldArrayType {
|
|
|
2620
2511
|
return true;
|
|
2621
2512
|
}
|
|
2622
2513
|
else {
|
|
2623
|
-
return
|
|
2514
|
+
return this.count < max;
|
|
2624
2515
|
}
|
|
2625
2516
|
}
|
|
2626
2517
|
/**
|
|
@@ -2659,17 +2550,20 @@ DbxFormRepeatArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
|
|
|
2659
2550
|
<dbx-subsection [header]="label">
|
|
2660
2551
|
<!-- Fields -->
|
|
2661
2552
|
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
<span class="
|
|
2669
|
-
<
|
|
2670
|
-
</
|
|
2671
|
-
<
|
|
2672
|
-
|
|
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>
|
|
2673
2567
|
</div>
|
|
2674
2568
|
<!-- Add Button -->
|
|
2675
2569
|
<div class="dbx-form-repeat-array-footer">
|
|
@@ -2686,17 +2580,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2686
2580
|
<dbx-subsection [header]="label">
|
|
2687
2581
|
<!-- Fields -->
|
|
2688
2582
|
<div class="dbx-form-repeat-array-fields" cdkDropList (cdkDropListDropped)="drop($event)">
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
<span class="
|
|
2696
|
-
<
|
|
2697
|
-
</
|
|
2698
|
-
<
|
|
2699
|
-
|
|
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>
|
|
2700
2597
|
</div>
|
|
2701
2598
|
<!-- Add Button -->
|
|
2702
2599
|
<div class="dbx-form-repeat-array-footer">
|
|
@@ -2733,9 +2630,7 @@ DbxFormFormlyArrayFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12
|
|
|
2733
2630
|
DbxBarLayoutModule,
|
|
2734
2631
|
DbxButtonModule,
|
|
2735
2632
|
FormlyModule.forChild({
|
|
2736
|
-
types: [
|
|
2737
|
-
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2738
|
-
]
|
|
2633
|
+
types: [{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }]
|
|
2739
2634
|
})
|
|
2740
2635
|
]] });
|
|
2741
2636
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyArrayFieldModule, decorators: [{
|
|
@@ -2753,14 +2648,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2753
2648
|
DbxBarLayoutModule,
|
|
2754
2649
|
DbxButtonModule,
|
|
2755
2650
|
FormlyModule.forChild({
|
|
2756
|
-
types: [
|
|
2757
|
-
{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }
|
|
2758
|
-
]
|
|
2651
|
+
types: [{ name: 'repeatarray', component: DbxFormRepeatArrayTypeComponent }]
|
|
2759
2652
|
})
|
|
2760
2653
|
],
|
|
2761
|
-
declarations: [
|
|
2762
|
-
DbxFormRepeatArrayTypeComponent
|
|
2763
|
-
],
|
|
2654
|
+
declarations: [DbxFormRepeatArrayTypeComponent],
|
|
2764
2655
|
exports: []
|
|
2765
2656
|
}]
|
|
2766
2657
|
}] });
|
|
@@ -2773,7 +2664,7 @@ function repeatArrayField(config) {
|
|
|
2773
2664
|
repeatArrayField: {
|
|
2774
2665
|
labelForField,
|
|
2775
2666
|
addText,
|
|
2776
|
-
removeText
|
|
2667
|
+
removeText
|
|
2777
2668
|
},
|
|
2778
2669
|
...templateOptionsForFieldConfig(config, {
|
|
2779
2670
|
maxLength
|
|
@@ -2865,7 +2756,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2865
2756
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
2866
2757
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
2867
2758
|
this._updateTime = new Subject();
|
|
2868
|
-
this.value$ = this.formControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value))), distinctUntilChanged((a, b) => isSameMinute(a, b)), shareReplay(1));
|
|
2759
|
+
this.value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), distinctUntilChanged((a, b) => isSameMinute(a, b)), shareReplay(1));
|
|
2869
2760
|
/**
|
|
2870
2761
|
* Used to trigger/display visual updates (specifically on timeDistance, etc.).
|
|
2871
2762
|
*/
|
|
@@ -2879,23 +2770,17 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2879
2770
|
validators: []
|
|
2880
2771
|
});
|
|
2881
2772
|
this.timeInputCtrl = new FormControl('', {
|
|
2882
|
-
validators: [
|
|
2883
|
-
Validators.pattern(/^(now)$|^([0-9]|(0[0-9])|(1[0-9])|(2[0-3]))(:)?([0-5][0-9])?(\s)?([apAP][Mm])?(\\s)*$/)
|
|
2884
|
-
]
|
|
2773
|
+
validators: [Validators.pattern(/^(now)$|^([0-9]|(0[0-9])|(1[0-9])|(2[0-3]))(:)?([0-5][0-9])?(\s)?([apAP][Mm])?(\\s)*$/)]
|
|
2885
2774
|
});
|
|
2886
2775
|
this._config = new BehaviorSubject(undefined);
|
|
2887
|
-
this.fullDay$ = this.fullDayControl$.pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value))));
|
|
2888
|
-
this.showTimeInput$ = this.fullDay$.pipe(map(x => !x && this.timeMode !== DbxDateTimeFieldTimeMode.NONE));
|
|
2889
|
-
this.showAddTime$ = this.showTimeInput$.pipe(map(x => !x && this.timeMode === DbxDateTimeFieldTimeMode.OPTIONAL), shareReplay(1));
|
|
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));
|
|
2890
2779
|
this.date$ = this.dateInputCtrl.valueChanges.pipe(startWith(this.dateInputCtrl.value), filterMaybe(), shareReplay(1));
|
|
2891
|
-
this.dateValue$ = merge(this.date$, this.value$.pipe(skipFirstMaybe())).pipe(map((x) => (x
|
|
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));
|
|
2892
2781
|
this.timeInput$ = this._updateTime.pipe(debounceTime(5), map(() => this.timeInputCtrl.value), distinctUntilChanged());
|
|
2893
2782
|
this.config$ = this._config.pipe(switchMapMaybeDefault(), shareReplay(1));
|
|
2894
|
-
this.rawDateTime$ = combineLatest([
|
|
2895
|
-
this.dateValue$,
|
|
2896
|
-
this.timeInput$.pipe(startWith(null)),
|
|
2897
|
-
this.fullDay$
|
|
2898
|
-
]).pipe(map(([date, timeString, fullDay]) => {
|
|
2783
|
+
this.rawDateTime$ = combineLatest([this.dateValue$, this.timeInput$.pipe(startWith(null)), this.fullDay$]).pipe(map(([date, timeString, fullDay]) => {
|
|
2899
2784
|
let result;
|
|
2900
2785
|
if (date) {
|
|
2901
2786
|
if (fullDay) {
|
|
@@ -2907,10 +2792,11 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2907
2792
|
}
|
|
2908
2793
|
}
|
|
2909
2794
|
else if (timeString) {
|
|
2910
|
-
result =
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2795
|
+
result =
|
|
2796
|
+
readableTimeStringToDate(timeString, {
|
|
2797
|
+
date,
|
|
2798
|
+
useSystemTimezone: true
|
|
2799
|
+
}) ?? date;
|
|
2914
2800
|
}
|
|
2915
2801
|
else {
|
|
2916
2802
|
result = date;
|
|
@@ -2918,11 +2804,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2918
2804
|
}
|
|
2919
2805
|
return result;
|
|
2920
2806
|
}), distinctUntilChanged((a, b) => a != null && b != null && isSameMinute(a, b)), shareReplay(1));
|
|
2921
|
-
this.timeOutput$ = combineLatest([
|
|
2922
|
-
this.rawDateTime$,
|
|
2923
|
-
this._offset,
|
|
2924
|
-
this.config$.pipe(distinctUntilChanged()),
|
|
2925
|
-
]).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]) => {
|
|
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]) => {
|
|
2926
2808
|
if (date != null) {
|
|
2927
2809
|
const instance = new DateTimeMinuteInstance({
|
|
2928
2810
|
date,
|
|
@@ -2949,7 +2831,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2949
2831
|
return !this.timeOnly;
|
|
2950
2832
|
}
|
|
2951
2833
|
get timeMode() {
|
|
2952
|
-
return
|
|
2834
|
+
return this.timeOnly ? DbxDateTimeFieldTimeMode.REQUIRED : this.dateTimeField.timeMode ?? DbxDateTimeFieldTimeMode.REQUIRED;
|
|
2953
2835
|
}
|
|
2954
2836
|
get description() {
|
|
2955
2837
|
return this.field.templateOptions?.description;
|
|
@@ -3055,7 +2937,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3055
2937
|
offset = 5;
|
|
3056
2938
|
}
|
|
3057
2939
|
if (direction !== 0) {
|
|
3058
|
-
this._offset.next(this._offset.value +
|
|
2940
|
+
this._offset.next(this._offset.value + offset * direction);
|
|
3059
2941
|
this._updateTime.next();
|
|
3060
2942
|
}
|
|
3061
2943
|
}
|
|
@@ -3078,10 +2960,10 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
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 } = {}) {
|
|
@@ -3605,19 +3479,13 @@ class DbxFormFormlyTextFieldModule {
|
|
|
3605
3479
|
}
|
|
3606
3480
|
DbxFormFormlyTextFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3607
3481
|
DbxFormFormlyTextFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [FormlyMaterialModule], exports: [DbxFormFormlyWrapperModule] });
|
|
3608
|
-
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [[
|
|
3609
|
-
FormlyMaterialModule
|
|
3610
|
-
], DbxFormFormlyWrapperModule] });
|
|
3482
|
+
DbxFormFormlyTextFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, imports: [[FormlyMaterialModule], DbxFormFormlyWrapperModule] });
|
|
3611
3483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyTextFieldModule, decorators: [{
|
|
3612
3484
|
type: NgModule,
|
|
3613
3485
|
args: [{
|
|
3614
|
-
imports: [
|
|
3615
|
-
FormlyMaterialModule
|
|
3616
|
-
],
|
|
3486
|
+
imports: [FormlyMaterialModule],
|
|
3617
3487
|
declarations: [],
|
|
3618
|
-
exports: [
|
|
3619
|
-
DbxFormFormlyWrapperModule
|
|
3620
|
-
]
|
|
3488
|
+
exports: [DbxFormFormlyWrapperModule]
|
|
3621
3489
|
}]
|
|
3622
3490
|
}] });
|
|
3623
3491
|
|
|
@@ -3631,70 +3499,28 @@ function hiddenField({ key, required = false }) {
|
|
|
3631
3499
|
class DbxFormFormlyValueModule {
|
|
3632
3500
|
}
|
|
3633
3501
|
DbxFormFormlyValueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3634
|
-
DbxFormFormlyValueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [CommonModule], exports: [DbxFormFormlyArrayFieldModule,
|
|
3635
|
-
|
|
3636
|
-
DbxFormFormlyDateFieldModule,
|
|
3637
|
-
DbxFormFormlyEnumFieldModule,
|
|
3638
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3639
|
-
DbxFormFormlyTextFieldModule] });
|
|
3640
|
-
DbxFormFormlyValueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, imports: [[
|
|
3641
|
-
CommonModule
|
|
3642
|
-
], DbxFormFormlyArrayFieldModule,
|
|
3643
|
-
DbxFormFormlyBooleanFieldModule,
|
|
3644
|
-
DbxFormFormlyDateFieldModule,
|
|
3645
|
-
DbxFormFormlyEnumFieldModule,
|
|
3646
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3647
|
-
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] });
|
|
3648
3504
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyValueModule, decorators: [{
|
|
3649
3505
|
type: NgModule,
|
|
3650
3506
|
args: [{
|
|
3651
|
-
imports: [
|
|
3652
|
-
CommonModule
|
|
3653
|
-
],
|
|
3507
|
+
imports: [CommonModule],
|
|
3654
3508
|
declarations: [],
|
|
3655
|
-
exports: [
|
|
3656
|
-
DbxFormFormlyArrayFieldModule,
|
|
3657
|
-
DbxFormFormlyBooleanFieldModule,
|
|
3658
|
-
DbxFormFormlyDateFieldModule,
|
|
3659
|
-
DbxFormFormlyEnumFieldModule,
|
|
3660
|
-
DbxFormFormlyPhoneFieldModule,
|
|
3661
|
-
DbxFormFormlyTextFieldModule
|
|
3662
|
-
]
|
|
3509
|
+
exports: [DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyTextFieldModule]
|
|
3663
3510
|
}]
|
|
3664
3511
|
}] });
|
|
3665
3512
|
|
|
3666
3513
|
class DbxFormFormlyFieldModule {
|
|
3667
3514
|
}
|
|
3668
3515
|
DbxFormFormlyFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3669
|
-
DbxFormFormlyFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [CommonModule], exports: [DbxFormFormlyChecklistItemFieldModule,
|
|
3670
|
-
|
|
3671
|
-
DbxFormFormlySelectionModule,
|
|
3672
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3673
|
-
DbxFormFormlyValueModule,
|
|
3674
|
-
DbxFormFormlyWrapperModule] });
|
|
3675
|
-
DbxFormFormlyFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, imports: [[
|
|
3676
|
-
CommonModule
|
|
3677
|
-
], DbxFormFormlyChecklistItemFieldModule,
|
|
3678
|
-
DbxFormFormlyComponentFieldModule,
|
|
3679
|
-
DbxFormFormlySelectionModule,
|
|
3680
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3681
|
-
DbxFormFormlyValueModule,
|
|
3682
|
-
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] });
|
|
3683
3518
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyFieldModule, decorators: [{
|
|
3684
3519
|
type: NgModule,
|
|
3685
3520
|
args: [{
|
|
3686
|
-
imports: [
|
|
3687
|
-
CommonModule
|
|
3688
|
-
],
|
|
3521
|
+
imports: [CommonModule],
|
|
3689
3522
|
declarations: [],
|
|
3690
|
-
exports: [
|
|
3691
|
-
DbxFormFormlyChecklistItemFieldModule,
|
|
3692
|
-
DbxFormFormlyComponentFieldModule,
|
|
3693
|
-
DbxFormFormlySelectionModule,
|
|
3694
|
-
DbxFormFormlyTextEditorFieldModule,
|
|
3695
|
-
DbxFormFormlyValueModule,
|
|
3696
|
-
DbxFormFormlyWrapperModule
|
|
3697
|
-
]
|
|
3523
|
+
exports: [DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule]
|
|
3698
3524
|
}]
|
|
3699
3525
|
}] });
|
|
3700
3526
|
|
|
@@ -3708,7 +3534,7 @@ const FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY = 'fieldValuesAreEqual';
|
|
|
3708
3534
|
* @returns
|
|
3709
3535
|
*/
|
|
3710
3536
|
function fieldValuesAreEqualValidator(config = {}) {
|
|
3711
|
-
const { keysFilter, valuesFilter: inputValuesFilter, isEqual = (
|
|
3537
|
+
const { keysFilter, valuesFilter: inputValuesFilter, isEqual = (a, b) => a === b, message = 'Field values are not equal.' } = config;
|
|
3712
3538
|
const valuesFilter = inputValuesFilter ?? {
|
|
3713
3539
|
valueFilter: KeyValueTypleValueFilter.NONE,
|
|
3714
3540
|
keysFilter
|
|
@@ -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';
|
|
@@ -3845,12 +3669,14 @@ function fieldValueIsAvailableValidator(config) {
|
|
|
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
|
}
|
|
@@ -3859,11 +3685,13 @@ function textIsAvailableField(config) {
|
|
|
3859
3685
|
* Allows a directive to provide a formly context and form.
|
|
3860
3686
|
*/
|
|
3861
3687
|
function provideFormlyContext() {
|
|
3862
|
-
return [
|
|
3688
|
+
return [
|
|
3689
|
+
{
|
|
3863
3690
|
provide: DbxFormlyContext,
|
|
3864
3691
|
useClass: DbxFormlyContext
|
|
3865
3692
|
},
|
|
3866
|
-
...provideDbxMutableForm(DbxFormlyContext)
|
|
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(1));
|
|
3743
|
+
return this._delegate.pipe(filterMaybe(), switchMap((x) => x.getValue()), shareReplay(1));
|
|
3916
3744
|
}
|
|
3917
3745
|
setValue(value) {
|
|
3918
3746
|
this._initialValue.next(value);
|
|
@@ -4101,7 +3929,7 @@ class DbxFormlyFormComponent extends AbstractSubscriptionDirective {
|
|
|
4101
3929
|
this.fields$ = this._fields.pipe(switchMapMaybeObs(), distinctUntilChanged(), shareReplay(1));
|
|
4102
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(() => changesSinceLastReset))), map((changesSinceLastResetCount) => ({
|
|
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,
|
|
@@ -4231,7 +4059,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4231
4059
|
`,
|
|
4232
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,21 +4120,13 @@ 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
|
|
|
@@ -4370,20 +4174,12 @@ function isInRange(min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER)
|
|
|
4370
4174
|
class DbxFormExtensionModule {
|
|
4371
4175
|
}
|
|
4372
4176
|
DbxFormExtensionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4373
|
-
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule,
|
|
4374
|
-
|
|
4375
|
-
DbxFormFormlyFieldModule] });
|
|
4376
|
-
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule,
|
|
4377
|
-
DbxFormlyModule,
|
|
4378
|
-
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] });
|
|
4379
4179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormExtensionModule, decorators: [{
|
|
4380
4180
|
type: NgModule,
|
|
4381
4181
|
args: [{
|
|
4382
|
-
exports: [
|
|
4383
|
-
DbxFormModule,
|
|
4384
|
-
DbxFormlyModule,
|
|
4385
|
-
DbxFormFormlyFieldModule
|
|
4386
|
-
]
|
|
4182
|
+
exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule]
|
|
4387
4183
|
}]
|
|
4388
4184
|
}] });
|
|
4389
4185
|
|