@dereekb/dbx-form 9.23.20 → 9.23.22

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.
@@ -8,6 +8,11 @@
8
8
  .mat-form-field-appearance-standard .mat-form-field-appearance-outline .mat-form-field-flex {
9
9
  padding-top: unset;
10
10
  }
11
+
12
+ .mat-form-field-appearance-standard .mat-form-field-appearance-outline .mat-form-field-prefix,
13
+ .mat-form-field-appearance-standard .mat-form-field-appearance-outline .mat-form-field-suffix {
14
+ top: unset;
15
+ }
11
16
  }
12
17
 
13
18
  @mixin color($theme-config) {
@@ -9,6 +9,8 @@ $dbx-datetime-row-width: 40px + ($dbx-datetime-button-spacing * 2); // times 2 f
9
9
  // MARK: Mixin
10
10
  @mixin core() {
11
11
  .dbx-mat-form-date-time-field-wrapper {
12
+ padding-top: 10px; // padding for label
13
+
12
14
  > formly-wrapper-mat-form-field {
13
15
  > .mat-form-field > .mat-form-field-wrapper {
14
16
  > .mat-form-field-flex {
@@ -36,6 +38,15 @@ $dbx-datetime-row-width: 40px + ($dbx-datetime-button-spacing * 2); // times 2 f
36
38
 
37
39
  .dbx-datetime-field {
38
40
  width: 100%;
41
+
42
+ .dbx-datetime-timezone {
43
+ padding: 0 6px;
44
+ pointer-events: none;
45
+ }
46
+
47
+ .dbx-datetime-timezone-button .mat-button {
48
+ font-size: 18px;
49
+ }
39
50
  }
40
51
 
41
52
  .dbx-datetime-row {
@@ -1,11 +1,12 @@
1
- import { LogicalDateStringCode, Maybe, ReadableTimeString, ArrayOrValue, ISO8601DateString, DecisionFunction } from '@dereekb/util';
2
- import { DateTimeMinuteConfig } from '@dereekb/date';
1
+ import { LogicalDateStringCode, Maybe, ReadableTimeString, ArrayOrValue, ISO8601DateString, DecisionFunction, TimezoneString } from '@dereekb/util';
2
+ import { DateTimeMinuteConfig, DateTimezoneUtcNormalInstance } from '@dereekb/date';
3
3
  import { Observable } from 'rxjs';
4
4
  import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
5
5
  import { AbstractControl, FormControl } from '@angular/forms';
6
6
  import { FieldType } from '@ngx-formly/material';
7
7
  import { FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';
8
8
  import { MatDatepickerInputEvent } from '@angular/material/datepicker';
9
+ import { ObservableOrValueGetter } from '@dereekb/rxjs';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare enum DbxDateTimeFieldTimeMode {
11
12
  /**
@@ -35,8 +36,8 @@ export declare enum DbxDateTimeValueMode {
35
36
  */
36
37
  DAY_STRING = 2
37
38
  }
38
- export declare function dbxDateTimeInputValueParseFactory(mode: DbxDateTimeValueMode): (date: Maybe<Date | string>) => Maybe<Date>;
39
- export declare function dbxDateTimeOutputValueFactory(mode: DbxDateTimeValueMode): (date: Maybe<Date>) => Maybe<Date | string>;
39
+ export declare function dbxDateTimeInputValueParseFactory(mode: DbxDateTimeValueMode, timezoneInstance: Maybe<DateTimezoneUtcNormalInstance>): (date: Maybe<Date | string>) => Maybe<Date>;
40
+ export declare function dbxDateTimeOutputValueFactory(mode: DbxDateTimeValueMode, timezoneInstance: Maybe<DateTimezoneUtcNormalInstance>): (date: Maybe<Date>) => Maybe<Date | string>;
40
41
  export declare type DateTimePickerConfiguration = Omit<DateTimeMinuteConfig, 'date'>;
41
42
  export declare type DbxDateTimeFieldSyncType = 'before' | 'after';
42
43
  export interface DbxDateTimeFieldSyncField {
@@ -101,7 +102,7 @@ export interface DbxDateTimeFieldProps extends FormlyFieldProps {
101
102
  /**
102
103
  * Whether or not ot hide the date hint info content.
103
104
  *
104
- * False by default
105
+ * False by default
105
106
  */
106
107
  hideDateHint?: boolean;
107
108
  /**
@@ -116,6 +117,16 @@ export interface DbxDateTimeFieldProps extends FormlyFieldProps {
116
117
  * Used for syncing with one or more fields with a Date value.
117
118
  */
118
119
  getSyncFieldsObs?: () => Observable<ArrayOrValue<DbxDateTimeFieldSyncField>>;
120
+ /**
121
+ * (Optional) The input timezone to default to.
122
+ *
123
+ * Ignored if fullDayInUTC is true.
124
+ */
125
+ timezone?: Maybe<ObservableOrValueGetter<Maybe<TimezoneString>>>;
126
+ /**
127
+ * Whether or not to display the timezone. True by default.
128
+ */
129
+ showTimezone?: boolean;
119
130
  }
120
131
  export interface DbxDateTimeFieldSyncParsedField extends Pick<DbxDateTimeFieldSyncField, 'syncType'> {
121
132
  control: AbstractControl<Maybe<Date | ISO8601DateString>>;
@@ -125,19 +136,23 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
125
136
  private readonly cdRef;
126
137
  private _sub;
127
138
  private _valueSub;
139
+ private _defaultTimezone;
140
+ private _customTimezone;
128
141
  private _fullDayInputCtrl?;
129
142
  private _fullDayControlObs;
130
- readonly fullDayControl$: Observable<AbstractControl<any, any>>;
143
+ readonly fullDayControl$: Observable<AbstractControl<boolean, boolean>>;
131
144
  private _offset;
132
145
  private _formControlObs;
133
- readonly formControl$: Observable<AbstractControl<any, any>>;
146
+ readonly formControl$: Observable<AbstractControl<Maybe<Date>, Maybe<Date>>>;
134
147
  private _updateTime;
135
- readonly value$: Observable<Maybe<Date>>;
148
+ readonly timezone$: Observable<Maybe<TimezoneString>>;
149
+ readonly timezoneInstance$: Observable<Maybe<DateTimezoneUtcNormalInstance>>;
150
+ readonly valueInSystemTimezone$: Observable<Maybe<Date>>;
136
151
  /**
137
152
  * Used to trigger/display visual updates (specifically on timeDistance, etc.).
138
153
  */
139
154
  readonly displayValue$: Observable<Maybe<Date>>;
140
- readonly timeString$: Observable<ReadableTimeString>;
155
+ readonly timeString$: Observable<ReadableTimeString | ''>;
141
156
  readonly dateInputCtrl: FormControl<Date | null>;
142
157
  readonly timeInputCtrl: FormControl<string | null>;
143
158
  private _config;
@@ -155,11 +170,15 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
155
170
  get description(): Maybe<string>;
156
171
  get hideDateHint(): boolean;
157
172
  get hideDatePicker(): boolean;
173
+ get timezone(): Maybe<ObservableOrValueGetter<Maybe<string>>>;
174
+ get showTimezone(): boolean;
175
+ get allowChangeTimezone(): boolean;
158
176
  readonly fullDay$: Observable<boolean>;
159
177
  readonly showTimeInput$: Observable<boolean>;
160
178
  readonly showAddTime$: Observable<boolean>;
161
179
  readonly date$: Observable<Date>;
162
- readonly dateValue$: Observable<Date | null>;
180
+ readonly timezoneAbbreviation$: Observable<string>;
181
+ readonly dateValue$: Observable<Maybe<Date>>;
163
182
  readonly timeInput$: Observable<ReadableTimeString>;
164
183
  readonly syncConfigObs$: Observable<Maybe<DbxDateTimeFieldSyncField | DbxDateTimeFieldSyncField[]>>;
165
184
  readonly parsedSyncConfigs$: Observable<DbxDateTimeFieldSyncParsedField[]>;
@@ -178,6 +197,7 @@ export declare class DbxDateTimeFieldComponent extends FieldType<FieldTypeConfig
178
197
  datePicked(event: MatDatepickerInputEvent<Date>): void;
179
198
  setLogicalTime(time: LogicalDateStringCode): void;
180
199
  setDateInputValue(date: Date): void;
200
+ setTimeFromDate(timeDate: Date): void;
181
201
  setTime(time: ReadableTimeString): void;
182
202
  keydownOnDateInput(event: KeyboardEvent): void;
183
203
  keydownOnTimeInput(event: KeyboardEvent): void;
@@ -11,15 +11,15 @@ export declare const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS: () => Observable<DateTi
11
11
  */
12
12
  export declare function timeOnlyField(config?: Partial<TimeFieldConfig>): FormlyFieldConfig;
13
13
  export declare function dateTimeField(config?: Partial<DateTimeFieldConfig>): import("../../wrapper/wrapper").WrapperFormlyFieldConfig<import("../../wrapper/style.wrapper.component").DbxFormStyleWrapperConfig, FormlyFieldConfig<DbxDateTimeFieldProps>>;
14
- export declare type DateDateRangeFieldDateConfig = Omit<DateTimeFieldConfig, 'dateLabel' | 'timeOnly' | 'timeMode' | 'getSyncFieldsObs'>;
15
- export interface DateDateRangeFieldConfig {
14
+ export declare type DateDateRangeFieldDateConfig = Omit<DateTimeFieldConfig, 'dateLabel' | 'timeOnly' | 'timeMode' | 'getSyncFieldsObs' | 'timezone' | 'showTimezone'>;
15
+ export interface DateDateRangeFieldConfig extends Pick<DateTimeFieldConfig, 'timezone' | 'showTimezone'> {
16
16
  required?: boolean;
17
17
  start?: Partial<DateDateRangeFieldDateConfig>;
18
18
  end?: Partial<DateDateRangeFieldDateConfig>;
19
19
  }
20
20
  export declare function dateRangeField(config?: DateDateRangeFieldConfig): FormlyFieldConfig;
21
- export declare type DateTimeRangeFieldTimeConfig = Omit<DateDateRangeFieldDateConfig, 'allDayLabel' | 'fullDayFieldName' | 'fullDayInUTC'>;
22
- export interface DateDateTimeRangeFieldConfig {
21
+ export declare type DateTimeRangeFieldTimeConfig = Omit<DateDateRangeFieldDateConfig, 'allDayLabel' | 'fullDayFieldName' | 'fullDayInUTC' | 'timezone' | 'showTimezone'>;
22
+ export interface DateDateTimeRangeFieldConfig extends Pick<DateTimeFieldConfig, 'timezone' | 'showTimezone'> {
23
23
  required?: boolean;
24
24
  start?: Partial<DateTimeRangeFieldTimeConfig>;
25
25
  end?: Partial<DateTimeRangeFieldTimeConfig>;
@@ -12,7 +12,7 @@ export declare const DISPLAY_FOR_TIMEZONE_STRING_VALUE: SearchableValueFieldDisp
12
12
  export interface TimezoneStringFieldConfig extends Omit<SearchableTextFieldConfig<TimezoneString, TimezoneInfo>, 'inputType' | 'searchOnEmptyText' | 'search' | 'displayForValue' | 'key'>, Partial<Pick<SearchableTextFieldConfig<TimezoneString, TimezoneInfo>, 'key' | 'materialFormField'>> {
13
13
  }
14
14
  /**
15
- * Template for login field that takes in a username and password.
15
+ * Template for a searchable text field for a timezone.
16
16
  *
17
17
  * @param param0
18
18
  * @returns
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form/mapbox",
3
- "version": "9.23.20",
3
+ "version": "9.23.22",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.1.0",
6
6
  "@angular/core": "^14.1.0",
7
7
  "@angular/forms": "^14.2.0",
8
- "@dereekb/dbx-web": "9.23.20",
8
+ "@dereekb/dbx-web": "9.23.22",
9
9
  "@ngx-formly/core": "^6.0.0",
10
10
  "@ngx-formly/material": "^6.0.0",
11
11
  "@ng-web-apis/geolocation": "^2.0.0",
12
12
  "mapbox-gl": "^2.9.2",
13
- "@dereekb/dbx-web/mapbox": "9.23.20",
14
- "@dereekb/dbx-form": "9.23.20"
13
+ "@dereekb/dbx-web/mapbox": "9.23.22",
14
+ "@dereekb/dbx-form": "9.23.22"
15
15
  },
16
16
  "dependencies": {
17
17
  "tslib": "^2.3.0"
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form",
3
- "version": "9.23.20",
3
+ "version": "9.23.22",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
7
7
  "lodash.clonedeep": "^4.5.0",
8
- "@dereekb/dbx-core": "9.23.20",
8
+ "@dereekb/dbx-core": "9.23.22",
9
9
  "@angular/material": "^14.2.0",
10
- "@dereekb/dbx-web": "9.23.20",
10
+ "@dereekb/dbx-web": "9.23.22",
11
11
  "@angular/forms": "^14.2.0",
12
12
  "@ngx-formly/core": "^6.0.0",
13
13
  "@ngx-formly/material": "^6.0.0",
14
14
  "ngx-editor": "^15.0.0",
15
15
  "ngx-mat-intl-tel-input": "^5.0.0",
16
- "@dereekb/model": "9.23.20"
16
+ "@dereekb/model": "9.23.22"
17
17
  },
18
18
  "dependencies": {
19
19
  "tslib": "^2.3.0"