@dereekb/dbx-form 10.1.18 → 10.1.20
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/esm2022/lib/form/form.mjs +9 -1
- package/esm2022/lib/formly/field/value/date/datetime.field.component.mjs +53 -20
- package/esm2022/lib/formly/field/value/date/datetime.field.mjs +4 -2
- package/esm2022/lib/formly/formly.form.component.mjs +12 -13
- package/fesm2022/dereekb-dbx-form.mjs +74 -32
- package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form/form.d.ts +2 -1
- package/lib/formly/field/value/date/_date.scss +1 -0
- package/lib/formly/field/value/date/datetime.field.component.d.ts +23 -0
- package/mapbox/package.json +1 -1
- package/package.json +1 -1
package/lib/form/form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Provider, Type } from '@angular/core';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { LockSet } from '@dereekb/rxjs';
|
|
4
4
|
import { BooleanStringKeyArray, Maybe } from '@dereekb/util';
|
|
5
|
-
import { FormControlStatus } from '@angular/forms';
|
|
5
|
+
import { AbstractControl, FormControlStatus } from '@angular/forms';
|
|
6
6
|
/**
|
|
7
7
|
* Current state of a DbxForm
|
|
8
8
|
*/
|
|
@@ -89,3 +89,4 @@ export declare abstract class DbxMutableForm<T = unknown> extends DbxForm<T> {
|
|
|
89
89
|
}
|
|
90
90
|
export declare function provideDbxForm<S extends DbxForm>(sourceType: Type<S>): Provider[];
|
|
91
91
|
export declare function provideDbxMutableForm<S extends DbxMutableForm>(sourceType: Type<S>): Provider[];
|
|
92
|
+
export declare function toggleDisableFormControl(form: AbstractControl<any>, isDisabled: boolean, config?: Parameters<AbstractControl['disable']>[0]): void;
|
|
@@ -56,6 +56,7 @@ $dbx-datetime-row-width: 40px + ($dbx-datetime-button-spacing * 2); // times 2 f
|
|
|
56
56
|
display: flex;
|
|
57
57
|
justify-content: center;
|
|
58
58
|
align-items: center;
|
|
59
|
+
min-width: 220px;
|
|
59
60
|
|
|
60
61
|
.mat-mdc-form-field-subscript-wrapper {
|
|
61
62
|
// hide the subscript wrapper since it is not used here
|
|
@@ -77,6 +77,20 @@ export interface DbxDateTimeFieldProps extends FormlyFieldProps {
|
|
|
77
77
|
* Whether or not the date is hidden, and automatically uses today/input date.
|
|
78
78
|
*/
|
|
79
79
|
readonly timeOnly?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Only applicable when timeOnly is false.
|
|
82
|
+
*
|
|
83
|
+
* Whether or not to always show the date input even when there is only a single date that can be selected.
|
|
84
|
+
*
|
|
85
|
+
* Defaults to true.
|
|
86
|
+
*/
|
|
87
|
+
readonly alwaysShowDateInput?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether or not to autofill the date when time is picked.
|
|
90
|
+
*
|
|
91
|
+
* Defaults to false.
|
|
92
|
+
*/
|
|
93
|
+
readonly autofillDateWhenTimeIsPicked?: boolean;
|
|
80
94
|
/**
|
|
81
95
|
* Whether or not the time can be added/removed optionally.
|
|
82
96
|
*
|
|
@@ -155,6 +169,7 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
|
|
|
155
169
|
private readonly dbxDateTimeFieldConfigService;
|
|
156
170
|
private _sub;
|
|
157
171
|
private _valueSub;
|
|
172
|
+
private _autoFillDateSync;
|
|
158
173
|
private _config;
|
|
159
174
|
readonly latestConfig$: Observable<Maybe<DbxDateTimePickerConfiguration>>;
|
|
160
175
|
private _syncConfigObs;
|
|
@@ -169,6 +184,9 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
|
|
|
169
184
|
readonly formControl$: Observable<AbstractControl<Maybe<Date>, Maybe<Date>>>;
|
|
170
185
|
private _cleared;
|
|
171
186
|
private _updateTime;
|
|
187
|
+
private _resyncTimeInputSub;
|
|
188
|
+
private _resyncTimeInput;
|
|
189
|
+
readonly resyncTimeInput$: Observable<void>;
|
|
172
190
|
private _configUpdateTimeSync;
|
|
173
191
|
readonly timezone$: Observable<Maybe<TimezoneString>>;
|
|
174
192
|
readonly timezoneInstance$: Observable<Maybe<DateTimezoneUtcNormalInstance>>;
|
|
@@ -189,6 +207,8 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
|
|
|
189
207
|
get dateOnly(): boolean;
|
|
190
208
|
get dateTimeField(): DbxDateTimeFieldProps;
|
|
191
209
|
get timeOnly(): Maybe<boolean>;
|
|
210
|
+
get alwaysShowDateInput(): boolean;
|
|
211
|
+
get autofillDateWhenTimeIsPicked(): boolean;
|
|
192
212
|
get showDateInput(): boolean;
|
|
193
213
|
get valueMode(): DbxDateTimeValueMode;
|
|
194
214
|
get timeMode(): DbxDateTimeFieldTimeMode;
|
|
@@ -220,12 +240,15 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
|
|
|
220
240
|
readonly dateTimePickerConfig$: Observable<Maybe<DbxDateTimePickerConfiguration>>;
|
|
221
241
|
readonly dateInputMin$: Observable<Date | null>;
|
|
222
242
|
readonly dateInputMax$: Observable<Date | null>;
|
|
243
|
+
readonly dateMinAndMaxIsSameDay$: Observable<boolean>;
|
|
223
244
|
readonly pickerFilter$: Observable<DecisionFunction<Date | null>>;
|
|
224
245
|
readonly defaultPickerFilter: DecisionFunction<Date | null>;
|
|
225
246
|
readonly timeOutput$: Observable<Maybe<Date>>;
|
|
226
247
|
readonly hasEmptyDisplayValue$: Observable<boolean>;
|
|
227
248
|
readonly presets$: Observable<DateTimePreset[]>;
|
|
228
249
|
readonly showClearButton$: Observable<boolean>;
|
|
250
|
+
readonly canAutofillDateWithOnlyAvailableDate$: Observable<boolean>;
|
|
251
|
+
readonly showDateInput$: Observable<boolean>;
|
|
229
252
|
constructor(cdRef: ChangeDetectorRef, dbxDateTimeFieldConfigService: DbxDateTimeFieldMenuPresetsService);
|
|
230
253
|
ngOnInit(): void;
|
|
231
254
|
ngOnDestroy(): void;
|
package/mapbox/package.json
CHANGED