@dereekb/dbx-form 9.24.16 → 9.24.18

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.
Files changed (39) hide show
  1. package/calendar/lib/calendar.module.d.ts +1 -1
  2. package/calendar/lib/calendar.schedule.selection.dialog.button.component.d.ts +2 -1
  3. package/calendar/lib/calendar.schedule.selection.range.component.d.ts +6 -1
  4. package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +23 -0
  5. package/calendar/lib/field/schedule/calendar.schedule.module.d.ts +10 -9
  6. package/esm2020/calendar/lib/calendar.module.mjs +8 -2
  7. package/esm2020/calendar/lib/calendar.schedule.selection.component.mjs +24 -8
  8. package/esm2020/calendar/lib/calendar.schedule.selection.dialog.button.component.mjs +8 -6
  9. package/esm2020/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +17 -12
  10. package/esm2020/calendar/lib/calendar.schedule.selection.range.component.mjs +45 -5
  11. package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +23 -9
  12. package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +5 -3
  13. package/esm2020/calendar/lib/field/schedule/calendar.schedule.module.mjs +7 -3
  14. package/esm2020/lib/formly/config/validation.mjs +3 -2
  15. package/esm2020/lib/formly/field/value/number/number.field.mjs +34 -1
  16. package/esm2020/lib/formly/field/value/number/number.field.module.mjs +5 -4
  17. package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +84 -5
  18. package/esm2020/lib/formly/field/value/phone/phone.field.mjs +9 -3
  19. package/esm2020/lib/validator/index.mjs +2 -1
  20. package/esm2020/lib/validator/phone.mjs +61 -0
  21. package/fesm2015/dereekb-dbx-form-calendar.mjs +123 -39
  22. package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
  23. package/fesm2015/dereekb-dbx-form.mjs +171 -11
  24. package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
  25. package/fesm2020/dereekb-dbx-form-calendar.mjs +124 -41
  26. package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
  27. package/fesm2020/dereekb-dbx-form.mjs +182 -10
  28. package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
  29. package/lib/extension/calendar/_calendar.scss +13 -0
  30. package/lib/formly/config/validation.d.ts +4 -0
  31. package/lib/formly/field/value/date/_date.scss +4 -0
  32. package/lib/formly/field/value/number/number.field.d.ts +27 -0
  33. package/lib/formly/field/value/number/number.field.module.d.ts +3 -2
  34. package/lib/formly/field/value/phone/_phone.scss +22 -13
  35. package/lib/formly/field/value/phone/phone.field.component.d.ts +19 -0
  36. package/lib/validator/index.d.ts +1 -0
  37. package/lib/validator/phone.d.ts +16 -0
  38. package/mapbox/package.json +4 -4
  39. package/package.json +4 -4
@@ -52,6 +52,8 @@
52
52
  }
53
53
 
54
54
  .dbx-schedule-selection-calendar-date-range-field {
55
+ width: 100%;
56
+
55
57
  &.mat-form-field-type-mat-date-range-input .mat-form-field-infix {
56
58
  display: flex;
57
59
 
@@ -74,6 +76,10 @@
74
76
  }
75
77
  }
76
78
 
79
+ .dbx-schedule-selection-calendar-date-range-field-content {
80
+ width: 100%;
81
+ }
82
+
77
83
  .dbx-schedule-selection-calendar-cell {
78
84
  display: flex;
79
85
  min-height: 56px;
@@ -103,6 +109,13 @@
103
109
  }
104
110
 
105
111
  @mixin color($theme-config) {
112
+ $color-config: theming.get-color-config($theme-config);
113
+ $background: map.get($color-config, 'background');
114
+ $background-color: theming.get-color-from-palette($background, 'hover');
115
+
116
+ .dbx-schedule-selection-calendar-date-range-field .mat-datepicker-toggle .mat-icon-button {
117
+ background-color: rgba($background-color, 0.08);
118
+ }
106
119
  }
107
120
 
108
121
  @mixin typography($typography-config) {
@@ -16,4 +16,8 @@ export declare const INVALID_PHONE_NUMBER_MESSAGE: {
16
16
  name: string;
17
17
  message: string;
18
18
  };
19
+ export declare const INVALID_PHONE_NUMBER_EXTENSION_MESSAGE: {
20
+ name: string;
21
+ message: string;
22
+ };
19
23
  export declare function defaultValidationMessages(): ValidationMessageOption[];
@@ -113,6 +113,10 @@ $dbx-datetime-row-width: 40px + ($dbx-datetime-button-spacing * 2); // times 2 f
113
113
  }
114
114
 
115
115
  .dbx-form-fixed-date-range-field-wrapper .mat-form-field-appearance-outline .mat-form-field-infix {
116
+ padding: 4px 0;
117
+ }
118
+
119
+ .dbx-form-fixed-date-range-field-wrapper .mat-form-field-appearance-outline > .mat-form-field-wrapper > .mat-form-field-flex > .mat-form-field-infix {
116
120
  padding: 0;
117
121
  }
118
122
  }
@@ -13,6 +13,33 @@ export interface NumberFieldConfig extends LabeledFieldConfig, DescriptionFieldC
13
13
  }
14
14
  export declare function numberFieldTransformParser(config: Partial<FieldConfigParsersRef> & Partial<TransformNumberFunctionConfigRef>): FormlyValueParser<any, any>[] | undefined;
15
15
  export declare function numberField(config: NumberFieldConfig): FormlyFieldConfig;
16
+ export interface NumberSliderFieldConfig extends NumberFieldConfig {
17
+ /**
18
+ * Max value. Required for the slider.
19
+ */
20
+ max: number;
21
+ /**
22
+ * Whether or not to show the thumb label while sliding. Defaults to true.
23
+ */
24
+ thumbLabel?: boolean;
25
+ /**
26
+ * Whether or not to invert the selection line.
27
+ */
28
+ invertSelectionColoring?: boolean;
29
+ /**
30
+ * Tick interval. If not provided defaults to the step value, if provided. If false, the ticks are disabled.
31
+ *
32
+ * The tick interval is the number of "steps" to show between ticks.
33
+ *
34
+ * For example, a tick interval of 5 show a tick every 5 steps. If steps are 10, it will show a tick at every number divisible by 50 (5 * 10).
35
+ */
36
+ tickInterval?: false | number;
37
+ /**
38
+ * Custom display with function for the thumbLabel.
39
+ */
40
+ displayWith?: (value: number) => string;
41
+ }
42
+ export declare function numberSliderField(config: NumberSliderFieldConfig): FormlyFieldConfig;
16
43
  export declare type DollarAmountFieldConfig = Omit<NumberFieldConfig, 'roundToStep' | 'precision'>;
17
44
  export declare function dollarAmountField(config: DollarAmountFieldConfig): FormlyFieldConfig<import("@ngx-formly/core").FormlyFieldProps & {
18
45
  [additionalProperties: string]: any;
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "@ngx-formly/material";
3
- import * as i2 from "../../wrapper/form.wrapper.module";
3
+ import * as i2 from "@ngx-formly/material/slider";
4
+ import * as i3 from "../../wrapper/form.wrapper.module";
4
5
  export declare class DbxFormFormlyNumberFieldModule {
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyNumberFieldModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyNumberFieldModule, never, [typeof i1.FormlyMaterialModule], [typeof i2.DbxFormFormlyWrapperModule]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyNumberFieldModule, never, [typeof i1.FormlyMaterialModule, typeof i2.FormlyMatSliderModule], [typeof i3.DbxFormFormlyWrapperModule]>;
7
8
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyNumberFieldModule>;
8
9
  }
@@ -7,22 +7,22 @@
7
7
 
8
8
  // MARK: Mixin
9
9
  @mixin core() {
10
- .dbx-form-phone-field,
11
- .mat-form-field {
10
+ .dbx-form-phone-field {
12
11
  width: 100%;
12
+ display: flex;
13
13
  }
14
14
 
15
- .mat-form-field {
16
- margin-top: 1px;
17
-
18
- button.country-selector {
19
- opacity: 100;
20
- width: 105px;
21
- }
15
+ .dbx-form-phone-field-phone-content button.country-selector {
16
+ opacity: 100;
17
+ width: 105px;
22
18
  }
23
19
 
24
20
  .dbx-form-phone-field .ngx-mat-tel-input-container input:not(.country-search) {
25
- padding: 0 6px 0 110px;
21
+ padding: 2px 6px 0 110px;
22
+ }
23
+
24
+ .dbx-form-phone-field-extension-input {
25
+ border: 0;
26
26
  }
27
27
  }
28
28
 
@@ -31,10 +31,19 @@
31
31
  $background: map.get($color-config, 'background');
32
32
  $foreground: map.get($color-config, 'foreground');
33
33
  $text-color: theming.get-color-from-palette($foreground, 'text');
34
+ $border-color: theming.get-color-from-palette($foreground, 'divider');
35
+
36
+ .dbx-form-phone-field {
37
+ .country-selector.mat-button,
38
+ .country-list-button.mat-menu-item {
39
+ color: $text-color;
40
+ }
41
+ }
34
42
 
35
- .country-selector.mat-button,
36
- .country-list-button.mat-menu-item {
37
- color: $text-color;
43
+ .dbx-form-phone-field-extension-input {
44
+ border: 0;
45
+ border-bottom: 1px solid $border-color;
46
+ background: none;
38
47
  }
39
48
  }
40
49
 
@@ -1,15 +1,34 @@
1
1
  import { FieldType } from '@ngx-formly/material';
2
2
  import { FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';
3
3
  import { Maybe } from '@dereekb/util';
4
+ import { FormControl, FormGroup } from '@angular/forms';
5
+ import { SubscriptionObject } from '@dereekb/rxjs';
4
6
  import * as i0 from "@angular/core";
5
7
  export interface InternationalPhoneFormlyFieldProps extends FormlyFieldProps {
6
8
  preferredCountries?: Maybe<string[]>;
7
9
  onlyCountries?: Maybe<string[]>;
10
+ /**
11
+ * Whether or not to allow adding an extension. False by default.
12
+ */
13
+ allowExtension?: boolean;
8
14
  }
9
15
  export declare const DEFAULT_PREFERRED_COUNTRIES: string[];
10
16
  export declare class DbxPhoneFieldComponent extends FieldType<FieldTypeConfig<InternationalPhoneFormlyFieldProps>> {
17
+ readonly inputSync: SubscriptionObject;
18
+ readonly outputSync: SubscriptionObject;
19
+ readonly extensionErrorSync: SubscriptionObject;
20
+ readonly phoneErrorSync: SubscriptionObject;
21
+ readonly phoneCtrl: FormControl<string | null>;
22
+ readonly extensionCtrl: FormControl<string | null>;
23
+ readonly inputFormGroup: FormGroup<{
24
+ phone: FormControl<string | null>;
25
+ extension: FormControl<string | null>;
26
+ }>;
11
27
  get preferredCountries(): string[];
12
28
  get onlyCountries(): string[];
29
+ get allowExtension(): boolean;
30
+ ngOnInit(): void;
31
+ ngOnDestroy(): void;
13
32
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxPhoneFieldComponent, never>;
14
33
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxPhoneFieldComponent, "ng-component", never, {}, {}, never, never, false>;
15
34
  }
@@ -3,3 +3,4 @@ export * from './email';
3
3
  export * from './field';
4
4
  export * from './number';
5
5
  export * from './available';
6
+ export * from './phone';
@@ -0,0 +1,16 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ /**
3
+ * Angular Form ValidationFn for checking isE164PhoneNumber the input divisor.
4
+ *
5
+ * @param divisor
6
+ * @returns
7
+ */
8
+ export declare function isE164PhoneNumber(allowExtension: boolean): ValidatorFn;
9
+ /**
10
+ * Angular Form ValidationFn for checking the input is a valid phone extension. Empty values return true.
11
+ *
12
+ * @param divisor
13
+ * @returns
14
+ */
15
+ export declare function isPhoneExtension(): ValidatorFn;
16
+ export declare function isE164PhoneNumberWithValidExtension(): ValidatorFn;
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form/mapbox",
3
- "version": "9.24.16",
3
+ "version": "9.24.18",
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.24.16",
8
+ "@dereekb/dbx-web": "9.24.18",
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.24.16",
14
- "@dereekb/dbx-form": "9.24.16"
13
+ "@dereekb/dbx-web/mapbox": "9.24.18",
14
+ "@dereekb/dbx-form": "9.24.18"
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.24.16",
3
+ "version": "9.24.18",
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.24.16",
8
+ "@dereekb/dbx-core": "9.24.18",
9
9
  "@angular/material": "^14.2.0",
10
- "@dereekb/dbx-web": "9.24.16",
10
+ "@dereekb/dbx-web": "9.24.18",
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.24.16"
16
+ "@dereekb/model": "9.24.18"
17
17
  },
18
18
  "dependencies": {
19
19
  "tslib": "^2.3.0"