@dereekb/dbx-form 10.1.1 → 10.1.3

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.
@@ -11,9 +11,10 @@ export declare function dbxFormSourceObservableFromStream<T>(stream$: Observable
11
11
  * DbxFormSourceDirective modes that define when to copy data from the source.
12
12
  *
13
13
  * - reset: only copy data when the form is reset.
14
- * - always: always copy data when the data observable emits a value.
14
+ * - always: always copy data when the data observable emits a value. Has a throttle of 20ms to prevent too many emissions. If emissions occur in a manner that appears to be a loop (more than 30 emissions in 1 second), then an error is thrown and warning printed to the console.
15
+ * - every: equal to always, but has no throttle or error message warning.
15
16
  */
16
- export type DbxFormSourceDirectiveMode = 'reset' | 'always';
17
+ export type DbxFormSourceDirectiveMode = 'reset' | 'always' | 'every';
17
18
  /**
18
19
  * Used with a FormComponent to set the value based on the input value.
19
20
  */
@@ -1,4 +1,4 @@
1
- import { type Maybe, type ReadableTimeString, type ArrayOrValue, type ISO8601DateString, type DecisionFunction, type TimezoneString, type LogicalDate, type DateOrDayString, type MapFunction } from '@dereekb/util';
1
+ import { type Maybe, type ReadableTimeString, type ArrayOrValue, type ISO8601DateString, type DecisionFunction, type Milliseconds, type TimezoneString, type LogicalDate, type DateOrDayString, type MapFunction } from '@dereekb/util';
2
2
  import { DateTimeMinuteConfig, DateTimezoneUtcNormalInstance } from '@dereekb/date';
3
3
  import { Observable } from 'rxjs';
4
4
  import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
@@ -32,11 +32,11 @@ export interface DbxDateTimeFieldSyncField {
32
32
  /**
33
33
  * Field key/path to sync with/against.
34
34
  */
35
- syncWith: string;
35
+ readonly syncWith: string;
36
36
  /**
37
37
  * How to sync against the other field.
38
38
  */
39
- syncType: DbxDateTimeFieldSyncType;
39
+ readonly syncType: DbxDateTimeFieldSyncType;
40
40
  }
41
41
  /**
42
42
  * Configuration for the time date field that has a reference and optional map function to map the value.
@@ -52,37 +52,37 @@ export interface DbxDateTimeFieldProps extends FormlyFieldProps {
52
52
  *
53
53
  * Defaults to Date
54
54
  */
55
- dateLabel?: string;
55
+ readonly dateLabel?: string;
56
56
  /**
57
57
  * Custom time label.
58
58
  *
59
59
  * Defaults to Time
60
60
  */
61
- timeLabel?: string;
61
+ readonly timeLabel?: string;
62
62
  /**
63
63
  * Label to use for the date hint for "All Day". Defaults to "All Day".
64
64
  */
65
- allDayLabel?: string;
65
+ readonly allDayLabel?: string;
66
66
  /**
67
67
  * Label to use for the date hint for "At". Defaults to "At".
68
68
  */
69
- atTimeLabel?: string;
69
+ readonly atTimeLabel?: string;
70
70
  /**
71
71
  * Value mode.
72
72
  *
73
73
  * Defaults to DATE
74
74
  */
75
- valueMode?: DbxDateTimeValueMode;
75
+ readonly valueMode?: DbxDateTimeValueMode;
76
76
  /**
77
77
  * Whether or not the date is hidden, and automatically uses today/input date.
78
78
  */
79
- timeOnly?: boolean;
79
+ readonly timeOnly?: boolean;
80
80
  /**
81
81
  * Whether or not the time can be added/removed optionally.
82
82
  *
83
83
  * This is ignored if timeOnly is specified.
84
84
  */
85
- timeMode?: DbxDateTimeFieldTimeMode;
85
+ readonly timeMode?: DbxDateTimeFieldTimeMode;
86
86
  /**
87
87
  * Other form control for enabling/disabling whether or not it is a full day.
88
88
  *
@@ -90,49 +90,53 @@ export interface DbxDateTimeFieldProps extends FormlyFieldProps {
90
90
  *
91
91
  * When time is off, the field is set to true.
92
92
  */
93
- fullDayFieldName?: string;
93
+ readonly fullDayFieldName?: string;
94
94
  /**
95
95
  * Whether or not to pass the date value as a UTC date, or a date in the current timezone.
96
96
  */
97
- fullDayInUTC?: boolean;
97
+ readonly fullDayInUTC?: boolean;
98
98
  /**
99
99
  * Whether or not ot hide the date hint info content.
100
100
  *
101
101
  * False by default
102
102
  */
103
- hideDateHint?: boolean;
103
+ readonly hideDateHint?: boolean;
104
104
  /**
105
105
  * Whether or not to hide the date/calendar picker.
106
106
  */
107
- hideDatePicker?: boolean;
107
+ readonly hideDatePicker?: boolean;
108
108
  /**
109
109
  * Custom picker configuration
110
110
  */
111
- pickerConfig?: ObservableOrValueGetter<DbxDateTimePickerConfiguration>;
111
+ readonly pickerConfig?: ObservableOrValueGetter<DbxDateTimePickerConfiguration>;
112
112
  /**
113
113
  * Used for syncing with one or more fields with a Date value.
114
114
  */
115
- getSyncFieldsObs?: () => Observable<ArrayOrValue<DbxDateTimeFieldSyncField>>;
115
+ readonly getSyncFieldsObs?: () => Observable<ArrayOrValue<DbxDateTimeFieldSyncField>>;
116
116
  /**
117
117
  * (Optional) The input timezone to default to.
118
118
  *
119
119
  * Ignored if fullDayInUTC is true.
120
120
  */
121
- timezone?: Maybe<ObservableOrValueGetter<Maybe<TimezoneString>>>;
121
+ readonly timezone?: Maybe<ObservableOrValueGetter<Maybe<TimezoneString>>>;
122
122
  /**
123
123
  * (Optional) The date to apply the time to.
124
124
  *
125
125
  * The timezone abbrviation will also use this date when using the time-only mode.
126
126
  */
127
- timeDate?: Maybe<ObservableOrValueGetter<Maybe<DbxDateTimeFieldTimeDateConfig | FormControlPath | DateOrDayString>>>;
127
+ readonly timeDate?: Maybe<ObservableOrValueGetter<Maybe<DbxDateTimeFieldTimeDateConfig | FormControlPath | DateOrDayString>>>;
128
128
  /**
129
129
  * Whether or not to display the timezone. True by default.
130
130
  */
131
- showTimezone?: boolean;
131
+ readonly showTimezone?: boolean;
132
132
  /**
133
133
  * Custom presets to show in the dropdown.
134
134
  */
135
- presets?: ObservableOrValueGetter<DateTimePresetConfiguration[]>;
135
+ readonly presets?: ObservableOrValueGetter<DateTimePresetConfiguration[]>;
136
+ /**
137
+ * The time in ms to prevent output from going out when the input value changes.
138
+ */
139
+ readonly inputOutputDebounceTime?: Milliseconds;
136
140
  }
137
141
  export interface DbxDateTimeFieldSyncParsedField extends Pick<DbxDateTimeFieldSyncField, 'syncType'> {
138
142
  control: AbstractControl<Maybe<Date | ISO8601DateString>>;
@@ -159,6 +163,7 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
159
163
  readonly timezoneInstance$: Observable<Maybe<DateTimezoneUtcNormalInstance>>;
160
164
  readonly timeDate$: Observable<Maybe<Date>>;
161
165
  readonly valueInSystemTimezone$: Observable<Maybe<Date>>;
166
+ readonly refreshInteral$: Observable<number>;
162
167
  /**
163
168
  * Used to trigger/display visual updates (specifically on timeDistance, etc.).
164
169
  */
@@ -194,10 +199,10 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
194
199
  readonly parsedSyncConfigs$: Observable<DbxDateTimeFieldSyncParsedField[]>;
195
200
  readonly syncConfigBeforeValue$: Observable<Date | null>;
196
201
  readonly syncConfigAfterValue$: Observable<Date | null>;
202
+ readonly rawDateTime$: Observable<Maybe<Date>>;
203
+ readonly config$: Observable<DbxDateTimePickerConfiguration>;
197
204
  readonly dateInputMin$: Observable<Date | null>;
198
205
  readonly dateInputMax$: Observable<Date | null>;
199
- readonly rawDateTime$: Observable<Maybe<Date>>;
200
- readonly config$: Observable<Maybe<DbxDateTimePickerConfiguration>>;
201
206
  readonly pickerFilter$: Observable<DecisionFunction<Date | null>>;
202
207
  readonly defaultPickerFilter: DecisionFunction<Date | null>;
203
208
  readonly timeOutput$: Observable<Maybe<Date>>;
@@ -5,7 +5,7 @@ import { DbxDateTimeFieldProps, DbxDateTimePickerConfiguration } from './datetim
5
5
  import { DbxFixedDateRangeFieldProps } from './fixeddaterange.field.component';
6
6
  export interface DateTimeFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, DbxDateTimeFieldProps, MaterialFormFieldConfig {
7
7
  }
8
- export type TimeFieldConfig = Omit<DateTimeFieldConfig, 'showDate'>;
8
+ export type TimeFieldConfig = Omit<DateTimeFieldConfig, 'showDate' | 'timeOnly'>;
9
9
  export declare const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS: () => Observable<DbxDateTimePickerConfiguration>;
10
10
  /**
11
11
  * Same as DateTime field but with the Date input hidden by default.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form/mapbox",
3
- "version": "10.1.1",
3
+ "version": "10.1.3",
4
4
  "module": "fesm2022/dereekb-dbx-form-mapbox.mjs",
5
5
  "typings": "index.d.ts",
6
6
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form",
3
- "version": "10.1.1",
3
+ "version": "10.1.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.2.12",
6
6
  "@angular/core": "^16.2.12",