@dereekb/dbx-form 2.1.0 → 3.0.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.
Files changed (113) hide show
  1. package/esm2020/lib/form/action/form.action.directive.mjs +8 -8
  2. package/esm2020/lib/form/action/form.action.module.mjs +4 -4
  3. package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +4 -4
  4. package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +3 -3
  5. package/esm2020/lib/form/form.mjs +10 -1
  6. package/esm2020/lib/form/form.module.mjs +4 -4
  7. package/esm2020/lib/form/io/form.changes.directive.mjs +18 -7
  8. package/esm2020/lib/form/io/form.input.directive.mjs +36 -18
  9. package/esm2020/lib/form/io/form.io.module.mjs +4 -4
  10. package/esm2020/lib/form/io/form.loading.directive.mjs +27 -17
  11. package/esm2020/lib/form.module.mjs +4 -4
  12. package/esm2020/lib/formly/config/validation.mjs +3 -3
  13. package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +8 -8
  14. package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +3 -3
  15. package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +13 -13
  16. package/esm2020/lib/formly/field/component/component.field.component.mjs +7 -7
  17. package/esm2020/lib/formly/field/component/component.field.module.mjs +9 -9
  18. package/esm2020/lib/formly/field/form.field.module.mjs +4 -4
  19. package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +7 -7
  20. package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +8 -6
  21. package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +2 -2
  22. package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +13 -13
  23. package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +28 -21
  24. package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +4 -4
  25. package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +13 -13
  26. package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +7 -8
  27. package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +13 -13
  28. package/esm2020/lib/formly/field/selection/searchable/searchable.mjs +1 -1
  29. package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +3 -3
  30. package/esm2020/lib/formly/field/selection/selection.module.mjs +4 -4
  31. package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +4 -5
  32. package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +4 -4
  33. package/esm2020/lib/formly/field/value/array/array.field.component.mjs +6 -6
  34. package/esm2020/lib/formly/field/value/array/array.field.module.mjs +4 -4
  35. package/esm2020/lib/formly/field/value/boolean/boolean.field.module.mjs +4 -4
  36. package/esm2020/lib/formly/field/value/date/date.field.module.mjs +4 -4
  37. package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +7 -6
  38. package/esm2020/lib/formly/field/value/enum/enum.field.module.mjs +4 -4
  39. package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +3 -3
  40. package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +4 -4
  41. package/esm2020/lib/formly/field/value/text/text.additional.field.mjs +15 -18
  42. package/esm2020/lib/formly/field/value/text/text.address.field.mjs +2 -2
  43. package/esm2020/lib/formly/field/value/text/text.field.mjs +3 -2
  44. package/esm2020/lib/formly/field/value/text/text.field.module.mjs +4 -4
  45. package/esm2020/lib/formly/field/value/value.module.mjs +4 -4
  46. package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +3 -3
  47. package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +3 -3
  48. package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +3 -3
  49. package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +3 -3
  50. package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +18 -10
  51. package/esm2020/lib/formly/field/wrapper/index.mjs +2 -1
  52. package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +3 -3
  53. package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +3 -3
  54. package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +4 -4
  55. package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +3 -3
  56. package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +3 -3
  57. package/esm2020/lib/formly/field/wrapper/working.wrapper.component.mjs +45 -0
  58. package/esm2020/lib/formly/field/wrapper/wrapper.mjs +7 -1
  59. package/esm2020/lib/formly/formly.context.directive.mjs +3 -3
  60. package/esm2020/lib/formly/formly.context.mjs +2 -2
  61. package/esm2020/lib/formly/formly.directive.mjs +12 -12
  62. package/esm2020/lib/formly/formly.form.component.mjs +15 -8
  63. package/esm2020/lib/formly/formly.module.mjs +9 -6
  64. package/esm2020/lib/formly/index.mjs +2 -1
  65. package/esm2020/lib/formly/template/available.mjs +16 -0
  66. package/esm2020/lib/formly/template/index.mjs +3 -0
  67. package/esm2020/lib/formly/template/login.mjs +90 -0
  68. package/esm2020/lib/layout/form.layout.module.mjs +4 -4
  69. package/esm2020/lib/layout/form.spacer.component.mjs +3 -3
  70. package/esm2020/lib/validator/available.mjs +32 -0
  71. package/esm2020/lib/validator/field.mjs +31 -0
  72. package/esm2020/lib/validator/index.mjs +3 -1
  73. package/fesm2015/dereekb-dbx-form.mjs +607 -352
  74. package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
  75. package/fesm2020/dereekb-dbx-form.mjs +624 -349
  76. package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
  77. package/lib/form/action/form.action.directive.d.ts +3 -3
  78. package/lib/form/form.d.ts +11 -0
  79. package/lib/form/io/form.changes.directive.d.ts +7 -3
  80. package/lib/form/io/form.input.directive.d.ts +18 -7
  81. package/lib/form/io/form.loading.directive.d.ts +8 -2
  82. package/lib/formly/field/checklist/checklist.item.field.component.d.ts +2 -2
  83. package/lib/formly/field/checklist/checklist.item.field.module.d.ts +1 -1
  84. package/lib/formly/field/component/component.field.component.d.ts +3 -3
  85. package/lib/formly/field/component/component.field.module.d.ts +1 -1
  86. package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +8 -3
  87. package/lib/formly/field/selection/pickable/pickable.field.module.d.ts +1 -1
  88. package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +8 -6
  89. package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +2 -1
  90. package/lib/formly/field/selection/searchable/searchable.d.ts +3 -3
  91. package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +2 -2
  92. package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +4 -4
  93. package/lib/formly/field/selection/searchable/searchable.field.module.d.ts +1 -1
  94. package/lib/formly/field/value/array/array.field.component.d.ts +2 -2
  95. package/lib/formly/field/value/date/datetime.field.component.d.ts +1 -1
  96. package/lib/formly/field/value/text/text.additional.field.d.ts +1 -1
  97. package/lib/formly/field/value/text/text.field.d.ts +2 -0
  98. package/lib/formly/field/wrapper/form.wrapper.module.d.ts +9 -8
  99. package/lib/formly/field/wrapper/index.d.ts +1 -0
  100. package/lib/formly/field/wrapper/style.wrapper.component.d.ts +3 -3
  101. package/lib/formly/field/wrapper/working.wrapper.component.d.ts +22 -0
  102. package/lib/formly/field/wrapper/wrapper.d.ts +3 -0
  103. package/lib/formly/formly.context.d.ts +1 -1
  104. package/lib/formly/index.d.ts +1 -0
  105. package/lib/formly/template/available.d.ts +7 -0
  106. package/lib/formly/template/index.d.ts +2 -0
  107. package/lib/formly/template/login.d.ts +59 -0
  108. package/lib/validator/available.d.ts +30 -0
  109. package/lib/validator/field.d.ts +32 -0
  110. package/lib/validator/index.d.ts +2 -0
  111. package/package.json +5 -31
  112. package/lib/formly/field/fields_TODO.scss +0 -4
  113. package/lib/formly/form_TODO.scss +0 -153
@@ -0,0 +1,30 @@
1
+ import { Observable } from 'rxjs';
2
+ import { AsyncValidatorFn } from "@angular/forms";
3
+ export declare const FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY = "fieldValueIsAvailable";
4
+ export declare const FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY = "fieldValueIsAvailableError";
5
+ export declare type FieldValueIsAvailableValidatorFunction<T> = (value: T) => Observable<boolean>;
6
+ export interface FieldValueIsAvailableValidatorConfig<T> {
7
+ /**
8
+ * How long to wait in between value changes.
9
+ */
10
+ throttle?: number;
11
+ /**
12
+ * Returns an observable that checks whether or not the value is currently available.
13
+ *
14
+ * @param value
15
+ */
16
+ readonly checkValueIsAvailable: FieldValueIsAvailableValidatorFunction<T>;
17
+ /**
18
+ * Custom message for this validator.
19
+ */
20
+ message?: string;
21
+ }
22
+ /**
23
+ * Validator for validating all values within an object.
24
+ *
25
+ * This is useful for validating a control group where two or more values are expected to be the same, such as a password and a password verification field.
26
+ *
27
+ * @param config
28
+ * @returns
29
+ */
30
+ export declare function fieldValueIsAvailableValidator<T>(config: FieldValueIsAvailableValidatorConfig<T>): AsyncValidatorFn;
@@ -0,0 +1,32 @@
1
+ import { ValidatorFn } from "@angular/forms";
2
+ import { KeyValueTupleFilter, IsEqualFunction } from "@dereekb/util";
3
+ export declare const FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY = "fieldValuesAreEqual";
4
+ export interface FieldValuesAreEqualValidatorConfig<T extends object = any> {
5
+ /**
6
+ * Keys of the value to match on.
7
+ *
8
+ * If none are defined, then all fields from the control are matched.
9
+ */
10
+ keysFilter?: string[];
11
+ /**
12
+ * Full filter to use, if defined.
13
+ */
14
+ valuesFilter?: KeyValueTupleFilter<T, any>;
15
+ /**
16
+ * Optional equivalence comparator.
17
+ */
18
+ isEqual?: IsEqualFunction<T>;
19
+ /**
20
+ * Custom message for this validator.
21
+ */
22
+ message?: string;
23
+ }
24
+ /**
25
+ * Validator for validating all values within an object.
26
+ *
27
+ * This is useful for validating a control group where two or more values are expected to be the same, such as a password and a password verification field.
28
+ *
29
+ * @param config
30
+ * @returns
31
+ */
32
+ export declare function fieldValuesAreEqualValidator<T extends object = any>(config?: FieldValuesAreEqualValidatorConfig<T>): ValidatorFn;
@@ -1,3 +1,5 @@
1
1
  export * from './boolean';
2
2
  export * from './email';
3
+ export * from './field';
3
4
  export * from './number';
5
+ export * from './available';
package/package.json CHANGED
@@ -1,41 +1,15 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-form",
3
- "version": "2.1.0",
3
+ "version": "3.0.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.0.0",
6
6
  "@angular/core": "^13.0.0",
7
- "@dereekb/dbx-core": "2.1.0",
8
- "rxjs": "^7.0.0",
9
- "@dereekb/util": "2.1.0",
10
- "extra-set": "^2.2.11",
11
- "make-error": "^1.3.0",
12
- "@dereekb/rxjs": "2.1.0",
13
- "ms": "^3.0.0-canary.1",
14
- "@ngrx/component-store": "^13.0.2",
15
- "@angular/platform-browser": "^13.0.0",
16
- "date-fns": "^2.28.0",
17
- "@dereekb/date": "2.1.0",
18
- "class-transformer": "^0.5.1",
19
- "class-validator": "^0.13.2",
20
- "date-fns-tz": "^1.2.2",
21
- "rrule": "git+https://git@github.com/dereekb/rrule.git#17adf5708d6567b4d01a3a8afd106261421ea492",
22
- "@angular/router": "^13.0.0",
23
- "@uirouter/core": "^6.0.8",
24
- "@uirouter/angular": "^9.1.0",
7
+ "@dereekb/dbx-core": "3.0.0",
25
8
  "@angular/material": "^13.0.0",
26
- "@dereekb/dbx-web": "2.1.0",
27
- "mat-progress-buttons": "git+https://git@github.com/dereekb/mat-progress-buttons.git#60b0374a45644e8756f20b8d761738151ca3df64",
28
- "@ngrx/store": "^13.0.2",
29
- "@angular/flex-layout": "^13.0.0-beta.38",
30
- "ng-overlay-container": "^13.0.0",
31
- "@angular/cdk": "^13.0.0",
32
- "angular-resize-event": "^3.1.1",
33
- "ngx-infinite-scroll": "^10.0.1",
34
- "linkify-string": "4.0.0-beta.3",
35
- "@ngx-formly/core": "6.0.0-next.8",
9
+ "@dereekb/dbx-web": "3.0.0",
36
10
  "@angular/forms": "^13.0.0",
37
- "@ngx-formly/material": "6.0.0-next.8",
38
- "change-case": "^4.1.2",
11
+ "@ngx-formly/core": "6.0.0-next.9",
12
+ "@ngx-formly/material": "6.0.0-next.9",
39
13
  "ngx-editor": "^12.1.1",
40
14
  "ngx-mat-intl-tel-input": "^4.1.0"
41
15
  },
@@ -1,4 +0,0 @@
1
-
2
- .form-wrapped-component {
3
- margin: 12px 0;
4
- }
@@ -1,153 +0,0 @@
1
- $dbx-form-container-margin: 10px;
2
-
3
- .dbx-formly {
4
- margin: $dbx-form-container-margin 0;
5
- }
6
-
7
- .dbx-form-spacer {
8
- margin-top: 24px;
9
- }
10
-
11
- // OLD. Remove
12
- $form-submit-view-margin: 8px;
13
- $material-form-margin: 16px;
14
-
15
- // MARK: Form Container
16
- .dbx-form-container {
17
- margin: $dbx-form-container-margin 0;
18
- }
19
-
20
- // .dbx-form-container-form-view {}
21
-
22
- // MARK: Form View
23
- .dbx-form-view-padded {
24
- padding: 0 $material-form-margin;
25
- }
26
-
27
- .required-text {
28
- content: "*";
29
- color: red;
30
- // color: mat-color($tallynote-dbx-warn);
31
- }
32
-
33
- .dbx-form-view {
34
- // margin-bottom: $material-form-margin;
35
-
36
- }
37
-
38
- .dbx-form-view-tools {
39
- text-align: right;
40
- }
41
-
42
- .dbx-form-view-control {
43
- width: 100%;
44
- }
45
-
46
- // .dbx-form-view-sub-form {}
47
-
48
- .mat-input-element {
49
- margin: 0; // Safari Fix
50
- }
51
-
52
- .mat-form-field {
53
- margin: 8px 0px 16px;
54
- }
55
-
56
- .mat-input-placeholder {
57
- text-transform: capitalize;
58
- }
59
-
60
- .required {
61
-
62
- .mat-checkbox-label::after,
63
- .mat-input-placeholder::after {
64
- @extend .required-text;
65
- }
66
- }
67
-
68
- .capitalized-field {
69
- .mat-input-element {
70
- text-transform: capitalize;
71
- }
72
- }
73
-
74
- .dbx-form-view-checkbox-control {
75
- margin: 12px 0;
76
- padding-left: 15px;
77
-
78
- .mat-checkbox-label {
79
- text-transform: capitalize;
80
- }
81
- }
82
-
83
- .form-select-align {
84
- padding-top: 24px;
85
- }
86
-
87
- .form-anti-padding {
88
- margin-top: -20px;
89
- }
90
-
91
- .warning {
92
- color: red;
93
- // color: mat-color($tallynote-dbx-warn);
94
- }
95
-
96
- .dbx-form-view-help {
97
- font-size: 75%;
98
- color: grey;
99
- }
100
-
101
- .dbx-form-view-hint {
102
- font-size: 75%;
103
- margin-top: 3px;
104
- }
105
-
106
- // MARK: Tabs
107
- .mat-tab-header {
108
- margin-bottom: $material-form-margin;
109
- }
110
-
111
- .dbx-form-view-tab-page {
112
- padding: 12px 0;
113
- }
114
-
115
- // MARK: Input
116
- .mat-form-field {
117
-
118
- .form-suffix-button {
119
- width: 1.8em;
120
- height: 1.8em;
121
- margin-top: -0.6em;
122
- }
123
-
124
- }
125
-
126
- // MARK: Controls
127
- .select-form-control {
128
- width: 100%;
129
- }
130
-
131
- .form-suffix-button {
132
- .mat-icon-button {
133
- width: 2em;
134
- height: 2em;
135
-
136
- .mat-icon {
137
- width: 1.8em;
138
- height: 1.8em;
139
- }
140
- }
141
- }
142
-
143
- .date-form-control {
144
-
145
- .mat-datepicker-toggle {
146
-
147
- .mat-icon-button {
148
- height: 2em;
149
- width: 2em;
150
- }
151
-
152
- }
153
- }