@dereekb/dbx-form 0.0.1 → 1.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 (239) hide show
  1. package/{src/_index.scss → _index.scss} +8 -0
  2. package/esm2020/lib/form/action/form.action.directive.mjs +42 -40
  3. package/esm2020/lib/form/action/form.action.module.mjs +6 -6
  4. package/esm2020/lib/form/action/index.mjs +2 -1
  5. package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +26 -0
  6. package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +40 -0
  7. package/esm2020/lib/form/action/transition/index.mjs +3 -0
  8. package/esm2020/lib/form/form.mjs +11 -4
  9. package/esm2020/lib/form/form.module.mjs +13 -24
  10. package/esm2020/lib/form/index.mjs +2 -4
  11. package/esm2020/lib/form/io/form.changes.directive.mjs +34 -0
  12. package/esm2020/lib/form/io/form.input.directive.mjs +49 -0
  13. package/esm2020/lib/form/io/form.io.module.mjs +36 -0
  14. package/esm2020/lib/form/io/form.loading.directive.mjs +52 -0
  15. package/esm2020/lib/form/io/index.mjs +5 -0
  16. package/esm2020/lib/form.module.mjs +25 -0
  17. package/esm2020/lib/formly/config/index.mjs +2 -0
  18. package/esm2020/lib/formly/config/validation.mjs +22 -0
  19. package/esm2020/lib/formly/field/checklist/checklist.field.mjs +105 -0
  20. package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +28 -30
  21. package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +1 -1
  22. package/esm2020/lib/formly/field/checklist/checklist.item.field.mjs +8 -112
  23. package/esm2020/lib/formly/field/checklist/index.mjs +2 -1
  24. package/esm2020/lib/formly/field/component/component.field.component.mjs +7 -7
  25. package/esm2020/lib/formly/field/component/component.field.mjs +4 -2
  26. package/esm2020/lib/formly/field/field.mjs +35 -2
  27. package/esm2020/lib/formly/field/form.field.module.mjs +44 -0
  28. package/esm2020/lib/formly/field/index.mjs +3 -1
  29. package/esm2020/lib/formly/field/selection/index.mjs +2 -1
  30. package/esm2020/lib/formly/field/selection/pickable/index.mjs +2 -1
  31. package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +14 -12
  32. package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +40 -31
  33. package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +39 -0
  34. package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +22 -13
  35. package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +75 -16
  36. package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +32 -15
  37. package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +64 -50
  38. package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +69 -53
  39. package/esm2020/lib/formly/field/selection/searchable/searchable.field.mjs +30 -7
  40. package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +8 -10
  41. package/esm2020/lib/formly/field/selection/searchable/searchable.mjs +1 -1
  42. package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +35 -11
  43. package/esm2020/lib/formly/field/selection/searchable/text.chip.field.mjs +1 -1
  44. package/esm2020/lib/formly/field/selection/selection.mjs +1 -1
  45. package/esm2020/lib/formly/field/selection/selection.module.mjs +28 -0
  46. package/esm2020/lib/formly/field/texteditor/index.mjs +4 -0
  47. package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +90 -0
  48. package/esm2020/lib/formly/field/texteditor/texteditor.field.mjs +20 -0
  49. package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +59 -0
  50. package/esm2020/lib/formly/field/value/array/array.field.component.mjs +87 -51
  51. package/esm2020/lib/formly/field/value/array/array.field.mjs +20 -0
  52. package/esm2020/lib/formly/field/value/array/array.field.module.mjs +25 -7
  53. package/esm2020/lib/formly/field/value/array/index.mjs +2 -1
  54. package/esm2020/lib/formly/field/value/boolean/boolean.field.mjs +11 -20
  55. package/esm2020/lib/formly/field/value/date/date.field.module.mjs +9 -6
  56. package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +74 -44
  57. package/esm2020/lib/formly/field/value/date/datetime.field.mjs +36 -0
  58. package/esm2020/lib/formly/field/value/date/index.mjs +2 -2
  59. package/esm2020/lib/formly/field/value/enum/enum.field.mjs +1 -1
  60. package/esm2020/lib/formly/field/value/enum/enum.field.module.mjs +16 -0
  61. package/esm2020/lib/formly/field/value/enum/index.mjs +2 -1
  62. package/esm2020/lib/formly/field/value/hidden.field.mjs +1 -1
  63. package/esm2020/lib/formly/field/value/index.mjs +2 -1
  64. package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +13 -33
  65. package/esm2020/lib/formly/field/value/phone/phone.field.mjs +50 -52
  66. package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +15 -7
  67. package/esm2020/lib/formly/field/value/text/index.mjs +2 -1
  68. package/esm2020/lib/formly/field/value/text/text.additional.field.mjs +81 -0
  69. package/esm2020/lib/formly/field/value/text/text.address.field.mjs +16 -23
  70. package/esm2020/lib/formly/field/value/text/text.field.mjs +11 -110
  71. package/esm2020/lib/formly/field/value/text/text.field.module.mjs +9 -4
  72. package/esm2020/lib/formly/field/value/value.module.mjs +44 -0
  73. package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +1 -1
  74. package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +12 -56
  75. package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +58 -0
  76. package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +18 -8
  77. package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +43 -30
  78. package/esm2020/lib/formly/field/wrapper/index.mjs +3 -3
  79. package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +16 -16
  80. package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +17 -23
  81. package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +43 -0
  82. package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +17 -23
  83. package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +16 -20
  84. package/esm2020/lib/formly/field/wrapper/wrapper.mjs +81 -0
  85. package/esm2020/lib/formly/formly.context.directive.mjs +38 -0
  86. package/esm2020/lib/formly/formly.context.mjs +45 -70
  87. package/esm2020/lib/formly/formly.directive.mjs +9 -6
  88. package/esm2020/lib/formly/formly.form.component.mjs +127 -0
  89. package/esm2020/lib/formly/formly.module.mjs +11 -12
  90. package/esm2020/lib/formly/index.mjs +4 -2
  91. package/esm2020/lib/index.mjs +2 -1
  92. package/fesm2015/dereekb-dbx-form.mjs +1603 -898
  93. package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
  94. package/fesm2020/dereekb-dbx-form.mjs +1650 -880
  95. package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
  96. package/{src/lib → lib}/form/_form.scss +0 -0
  97. package/lib/form/action/form.action.directive.d.ts +3 -3
  98. package/lib/form/action/form.action.module.d.ts +4 -4
  99. package/lib/form/action/index.d.ts +1 -0
  100. package/lib/form/action/transition/form.action.transition.module.d.ts +8 -0
  101. package/lib/form/action/transition/form.action.transition.safety.directive.d.ts +20 -0
  102. package/lib/form/action/transition/index.d.ts +2 -0
  103. package/lib/form/form.d.ts +30 -19
  104. package/lib/form/form.module.d.ts +4 -5
  105. package/lib/form/index.d.ts +1 -3
  106. package/lib/form/{form.changes.directive.d.ts → io/form.changes.directive.d.ts} +1 -1
  107. package/lib/form/{form.input.directive.d.ts → io/form.input.directive.d.ts} +3 -3
  108. package/lib/form/io/form.io.module.d.ts +10 -0
  109. package/lib/form/io/form.loading.directive.d.ts +19 -0
  110. package/lib/form/io/index.d.ts +4 -0
  111. package/lib/form.module.d.ts +9 -0
  112. package/{src/lib → lib}/formly/_formly.scss +0 -0
  113. package/lib/formly/config/index.d.ts +1 -0
  114. package/lib/formly/config/validation.d.ts +19 -0
  115. package/{src/lib → lib}/formly/field/_field.scss +0 -0
  116. package/lib/formly/field/checklist/_checklist.scss +76 -0
  117. package/lib/formly/field/checklist/checklist.field.d.ts +45 -0
  118. package/lib/formly/field/checklist/checklist.item.field.component.d.ts +13 -12
  119. package/lib/formly/field/checklist/checklist.item.field.content.default.component.d.ts +1 -1
  120. package/lib/formly/field/checklist/checklist.item.field.d.ts +3 -47
  121. package/lib/formly/field/checklist/index.d.ts +1 -0
  122. package/{src/lib → lib}/formly/field/component/_component.scss +0 -0
  123. package/lib/formly/field/component/component.field.component.d.ts +6 -2
  124. package/lib/formly/field/field.d.ts +17 -3
  125. package/{src/lib → lib}/formly/field/fields_TODO.scss +0 -0
  126. package/lib/formly/field/form.field.module.d.ts +13 -0
  127. package/lib/formly/field/index.d.ts +2 -0
  128. package/{src/lib → lib}/formly/field/selection/_selection.scss +0 -0
  129. package/lib/formly/field/selection/index.d.ts +1 -0
  130. package/{src/lib → lib}/formly/field/selection/pickable/_pickable.scss +10 -1
  131. package/lib/formly/field/selection/pickable/index.d.ts +1 -0
  132. package/lib/formly/field/selection/pickable/pickable.chip.field.component.d.ts +3 -3
  133. package/lib/formly/field/selection/pickable/pickable.field.d.ts +13 -0
  134. package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +17 -13
  135. package/lib/formly/field/selection/pickable/pickable.field.module.d.ts +1 -1
  136. package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +27 -3
  137. package/lib/formly/field/selection/searchable/_searchable.scss +59 -0
  138. package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +7 -1
  139. package/lib/formly/field/selection/searchable/searchable.d.ts +6 -8
  140. package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +20 -14
  141. package/lib/formly/field/selection/searchable/searchable.field.d.ts +20 -11
  142. package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +33 -24
  143. package/lib/formly/field/selection/searchable/searchable.field.module.d.ts +1 -1
  144. package/lib/formly/field/selection/searchable/searchable.text.field.component.d.ts +11 -1
  145. package/lib/formly/field/selection/searchable/text.chip.field.d.ts +2 -2
  146. package/lib/formly/field/selection/selection.d.ts +1 -0
  147. package/lib/formly/field/selection/selection.module.d.ts +9 -0
  148. package/lib/formly/field/texteditor/_texteditor.scss +98 -0
  149. package/lib/formly/field/texteditor/index.d.ts +3 -0
  150. package/lib/formly/field/texteditor/texteditor.field.component.d.ts +26 -0
  151. package/lib/formly/field/texteditor/texteditor.field.d.ts +7 -0
  152. package/lib/formly/field/texteditor/texteditor.field.module.d.ts +14 -0
  153. package/{src/lib → lib}/formly/field/value/_value.scss +0 -0
  154. package/lib/formly/field/value/array/_array.scss +73 -0
  155. package/lib/formly/field/value/array/array.field.component.d.ts +22 -11
  156. package/lib/formly/field/value/array/array.field.d.ts +9 -0
  157. package/lib/formly/field/value/array/array.field.module.d.ts +6 -3
  158. package/lib/formly/field/value/array/index.d.ts +1 -0
  159. package/{src/lib → lib}/formly/field/value/boolean/_boolean.scss +0 -0
  160. package/lib/formly/field/value/boolean/boolean.field.d.ts +5 -5
  161. package/lib/formly/field/value/date/_date.scss +79 -0
  162. package/lib/formly/field/value/date/date.field.module.d.ts +2 -1
  163. package/lib/formly/field/value/date/datetime.field.component.d.ts +16 -13
  164. package/lib/formly/field/value/date/datetime.field.d.ts +14 -0
  165. package/lib/formly/field/value/date/index.d.ts +1 -1
  166. package/{src/lib → lib}/formly/field/value/enum/_enum.scss +0 -0
  167. package/lib/formly/field/value/enum/enum.field.d.ts +2 -2
  168. package/lib/formly/field/value/enum/enum.field.module.d.ts +6 -0
  169. package/lib/formly/field/value/enum/index.d.ts +1 -0
  170. package/lib/formly/field/value/hidden.field.d.ts +2 -2
  171. package/lib/formly/field/value/index.d.ts +1 -0
  172. package/lib/formly/field/value/phone/_phone.scss +55 -0
  173. package/lib/formly/field/value/phone/phone.field.component.d.ts +8 -14
  174. package/lib/formly/field/value/phone/phone.field.d.ts +20 -18
  175. package/lib/formly/field/value/phone/phone.field.module.d.ts +10 -8
  176. package/{src/lib → lib}/formly/field/value/text/_text.scss +0 -0
  177. package/lib/formly/field/value/text/index.d.ts +1 -0
  178. package/lib/formly/field/value/text/text.additional.field.d.ts +19 -0
  179. package/lib/formly/field/value/text/text.address.field.d.ts +8 -9
  180. package/lib/formly/field/value/text/text.field.d.ts +5 -33
  181. package/lib/formly/field/value/text/text.field.module.d.ts +3 -2
  182. package/lib/formly/field/value/value.module.d.ts +13 -0
  183. package/{src/lib → lib}/formly/field/wrapper/_wrapper.scss +15 -2
  184. package/lib/formly/field/wrapper/autotouch.wrapper.component.d.ts +2 -2
  185. package/lib/formly/field/wrapper/expandable.wrapper.component.d.ts +8 -37
  186. package/lib/formly/field/wrapper/expandable.wrapper.delegate.d.ts +36 -0
  187. package/lib/formly/field/wrapper/flex.wrapper.component.d.ts +19 -4
  188. package/lib/formly/field/wrapper/form.wrapper.module.d.ts +10 -8
  189. package/lib/formly/field/wrapper/index.d.ts +2 -2
  190. package/lib/formly/field/wrapper/info.wrapper.component.d.ts +9 -9
  191. package/lib/formly/field/wrapper/section.wrapper.component.d.ts +16 -5
  192. package/lib/formly/field/wrapper/style.wrapper.component.d.ts +22 -0
  193. package/lib/formly/field/wrapper/subsection.wrapper.component.d.ts +16 -5
  194. package/lib/formly/field/wrapper/toggle.wrapper.component.d.ts +6 -14
  195. package/lib/formly/field/wrapper/wrapper.d.ts +34 -0
  196. package/{src/lib → lib}/formly/form_TODO.scss +0 -0
  197. package/lib/formly/formly.context.d.ts +14 -22
  198. package/lib/formly/formly.context.directive.d.ts +17 -0
  199. package/lib/formly/formly.directive.d.ts +7 -3
  200. package/lib/formly/formly.form.component.d.ts +35 -0
  201. package/lib/formly/formly.module.d.ts +7 -6
  202. package/lib/formly/index.d.ts +3 -1
  203. package/lib/index.d.ts +1 -0
  204. package/{src/lib → lib}/layout/_layout.scss +0 -0
  205. package/{src/lib → lib}/style/_all-core.scss +0 -0
  206. package/{src/lib → lib}/style/_all-theme.scss +0 -0
  207. package/{src/lib → lib}/style/_all-typography.scss +0 -0
  208. package/{src/lib → lib}/style/_config.scss +0 -0
  209. package/{src/lib → lib}/style/_core.scss +0 -0
  210. package/{src/lib → lib}/style/_mixin.scss +0 -0
  211. package/{src/lib → lib}/style/_theming.scss +0 -0
  212. package/{src/lib → lib}/style/_variables.scss +0 -0
  213. package/package.json +14 -14
  214. package/esm2020/lib/form/form.changes.directive.mjs +0 -33
  215. package/esm2020/lib/form/form.input.directive.mjs +0 -49
  216. package/esm2020/lib/form/loading/form.loading.directive.mjs +0 -52
  217. package/esm2020/lib/form/loading/index.mjs +0 -2
  218. package/esm2020/lib/formly/field/value/date/date.field.mjs +0 -36
  219. package/esm2020/lib/formly/field/wrapper/flex.wrapper.layout.mjs +0 -20
  220. package/esm2020/lib/formly/field/wrapper/toggle.wrapper.mjs +0 -10
  221. package/esm2020/lib/formly/formly.component.mjs +0 -134
  222. package/lib/form/loading/form.loading.directive.d.ts +0 -19
  223. package/lib/form/loading/index.d.ts +0 -1
  224. package/lib/formly/field/value/date/date.field.d.ts +0 -13
  225. package/lib/formly/field/wrapper/flex.wrapper.layout.d.ts +0 -10
  226. package/lib/formly/field/wrapper/toggle.wrapper.d.ts +0 -7
  227. package/lib/formly/formly.component.d.ts +0 -36
  228. package/src/lib/formly/field/checklist/_checklist.scss +0 -26
  229. package/src/lib/formly/field/checklist/checklist.item_TODO.scss +0 -57
  230. package/src/lib/formly/field/selection/generic_TODO.scss +0 -36
  231. package/src/lib/formly/field/selection/searchable/_searchable.scss +0 -26
  232. package/src/lib/formly/field/texteditor/_texteditor.scss +0 -26
  233. package/src/lib/formly/field/texteditor/texteditor_TODO.scss +0 -32
  234. package/src/lib/formly/field/value/array/_array.scss +0 -26
  235. package/src/lib/formly/field/value/date/_date.scss +0 -26
  236. package/src/lib/formly/field/value/date/date_TODO.scss +0 -27
  237. package/src/lib/formly/field/value/phone/_phone.scss +0 -26
  238. package/src/lib/formly/field/value/phone/phone_TODO.scss +0 -10
  239. package/src/lib/formly/field/wrapper/wrapper_TODO.scss +0 -34
@@ -1,3 +1,4 @@
1
1
  export * from './pickable';
2
2
  export * from './searchable';
3
3
  export * from './selection';
4
+ export * from './selection.module';
@@ -4,7 +4,16 @@
4
4
 
5
5
 
6
6
  // MARK: Mixin
7
- @mixin core() {}
7
+ @mixin core() {
8
+ .dbx-pickable-item-field-filter {
9
+ margin-bottom: 4px;
10
+ }
11
+
12
+ .dbx-pickable-item-field-list-content {
13
+ max-height: 400px;
14
+ overflow: auto;
15
+ }
16
+ }
8
17
 
9
18
  @mixin color($theme-config) {}
10
19
 
@@ -2,4 +2,5 @@ export * from './pickable.chip.field.component';
2
2
  export * from './pickable.field.directive';
3
3
  export * from './pickable.field.module';
4
4
  export * from './pickable.list.field.component';
5
+ export * from './pickable.field';
5
6
  export * from './pickable';
@@ -3,8 +3,8 @@ import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Used for picking pre-set values using chips as the presentation.
5
5
  */
6
- export declare class DbxPickableChipFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
6
+ export declare class DbxPickableChipListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
7
7
  itemClicked(item: PickableItemFieldItem<T>): void;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableChipFieldComponent<any>, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableChipFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableChipListFieldComponent<any>, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableChipListFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
10
10
  }
@@ -0,0 +1,13 @@
1
+ import { FormlyFieldConfig } from '@ngx-formly/core';
2
+ import { Maybe } from '@dereekb/util';
3
+ import { Observable } from 'rxjs';
4
+ import { LabeledFieldConfig } from '../../field';
5
+ import { PickableValueFieldDisplayValue } from './pickable';
6
+ import { PickableItemFieldItem, PickableValueFieldsFieldConfig } from './pickable.field.directive';
7
+ export { PickableItemFieldItem };
8
+ export declare function filterPickableItemFieldValuesByLabel<T>(filterText: Maybe<string>, values: PickableValueFieldDisplayValue<T>[]): Observable<T[]>;
9
+ export declare function sortPickableItemsByLabel<T>(chips: PickableItemFieldItem<T>[]): PickableItemFieldItem<T>[];
10
+ export interface PickableItemFieldConfig<T = any> extends LabeledFieldConfig, PickableValueFieldsFieldConfig<T> {
11
+ }
12
+ export declare function pickableItemChipField<T = any>(config: PickableItemFieldConfig<T>): FormlyFieldConfig;
13
+ export declare function pickableItemListField<T = any>(config: PickableItemFieldConfig<T>): FormlyFieldConfig;
@@ -1,19 +1,19 @@
1
1
  import { DbxInjectedComponentConfig } from "@dereekb/dbx-core";
2
- import { LoadingStateContextInstance, LoadingState } from "@dereekb/rxjs";
2
+ import { LoadingState, ListLoadingStateContextInstance } from "@dereekb/rxjs";
3
3
  import { Maybe } from "@dereekb/util";
4
4
  import { OnDestroy, OnInit } from "@angular/core";
5
5
  import { FormControl, AbstractControl } from "@angular/forms";
6
6
  import { MatInput } from "@angular/material/input";
7
- import { FieldType, FormlyFieldConfig } from "@ngx-formly/core";
7
+ import { FieldTypeConfig, FormlyFieldConfig } from "@ngx-formly/core";
8
+ import { FieldType } from "@ngx-formly/material";
8
9
  import { Observable } from "rxjs";
9
10
  import { PickableValueFieldDisplayFn, PickableValueFieldDisplayValue, PickableValueFieldFilterFn, PickableValueFieldHashFn, PickableValueFieldLoadValuesFn, PickableValueFieldValue } from "./pickable";
11
+ import { DbxValueListItem } from "@dereekb/dbx-web";
10
12
  import * as i0 from "@angular/core";
11
13
  /**
12
14
  * Wraps the selected state with the items.
13
15
  */
14
- export interface PickableItemFieldItem<T> {
15
- display: PickableValueFieldDisplayValue<T>;
16
- selected?: boolean;
16
+ export interface PickableItemFieldItem<T> extends DbxValueListItem<PickableValueFieldDisplayValue<T>> {
17
17
  }
18
18
  export declare type PickableItemFieldItemSortFn<T> = (items: PickableItemFieldItem<T>[]) => PickableItemFieldItem<T>[];
19
19
  export interface PickableValueFieldsFieldConfig<T> {
@@ -76,7 +76,8 @@ export interface PickableValueFieldsFieldConfig<T> {
76
76
  */
77
77
  footerConfig?: DbxInjectedComponentConfig;
78
78
  }
79
- export interface PickableValueFieldsFormlyFieldConfig<T> extends PickableValueFieldsFieldConfig<T>, FormlyFieldConfig {
79
+ export interface PickableValueFieldsFormlyFieldConfig<T> extends FormlyFieldConfig {
80
+ pickableField: PickableValueFieldsFieldConfig<T>;
80
81
  }
81
82
  /**
82
83
  * Displayed value with the computed hash.
@@ -87,7 +88,7 @@ export interface PickableValueFieldDisplayValueWithHash<T, M = any> extends Pick
87
88
  /**
88
89
  * Used for picking pre-set values using items as the presentation.
89
90
  */
90
- export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<PickableValueFieldsFormlyFieldConfig<T>> implements OnInit, OnDestroy {
91
+ export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<PickableValueFieldsFormlyFieldConfig<T> & FieldTypeConfig> implements OnInit, OnDestroy {
91
92
  filterMatInput: MatInput;
92
93
  readonly inputCtrl: FormControl;
93
94
  private _formControlObs;
@@ -116,19 +117,22 @@ export declare class AbstractDbxPickableItemFieldDirective<T> extends FieldType<
116
117
  /**
117
118
  * Context used for managing the loading of items, or when the current results change.
118
119
  */
119
- readonly context: LoadingStateContextInstance<any, LoadingState<any>>;
120
+ readonly context: ListLoadingStateContextInstance<any, LoadingState<any>>;
120
121
  readonly filterItemsLoadingState$: Observable<LoadingState>;
121
122
  /**
122
123
  * Context used for searching/filtering.
123
124
  */
124
- readonly filterResultsContext: LoadingStateContextInstance<any, LoadingState<PickableValueFieldDisplayValueWithHash<T, any>[]>>;
125
+ readonly filterResultsContext: ListLoadingStateContextInstance<any, LoadingState<PickableValueFieldDisplayValueWithHash<T, any>[]>>;
126
+ readonly noItemsAvailable$: Observable<boolean>;
127
+ get readonly(): Maybe<boolean>;
128
+ get isReadonlyOrDisabled(): boolean;
129
+ get pickableField(): PickableValueFieldsFieldConfig<T>;
125
130
  get multiSelect(): boolean;
126
131
  get asArrayValue(): boolean;
127
132
  get filterLabel(): Maybe<string>;
128
- get readonly(): Maybe<boolean>;
129
- get required(): Maybe<boolean>;
130
- get placeholder(): string;
131
- get description(): Maybe<string>;
133
+ get name(): string;
134
+ get label(): Maybe<string>;
135
+ get autocomplete(): string;
132
136
  get sortItems(): Maybe<PickableItemFieldItemSortFn<T>>;
133
137
  get hashForValue(): PickableValueFieldHashFn<T>;
134
138
  get displayForValue(): PickableValueFieldDisplayFn<T>;
@@ -15,6 +15,6 @@ import * as i13 from "@angular/material/icon";
15
15
  import * as i14 from "@ngx-formly/core";
16
16
  export declare class DbxFormFormlyPickableFieldModule {
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyPickableFieldModule, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPickableFieldModule, [typeof i1.DbxPickableChipFieldComponent, typeof i2.DbxPickableListFieldComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i4.DbxLoadingModule, typeof i4.DbxButtonModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatInputModule, typeof i8.MatFormFieldModule, typeof i5.ReactiveFormsModule, typeof i9.MatAutocompleteModule, typeof i10.MatListModule, typeof i11.DbxDatePipeModule, typeof i4.DbxAnchorModule, typeof i12.MatChipsModule, typeof i13.MatIconModule, typeof i11.DbxInjectedComponentModule, typeof i14.FormlyModule], never>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyPickableFieldModule, [typeof i1.DbxPickableChipListFieldComponent, typeof i2.DbxPickableListFieldComponent, typeof i2.DbxPickableListFieldItemListComponent, typeof i2.DbxPickableListFieldItemListViewComponent, typeof i2.DbxPickableListFieldItemListViewItemComponent], [typeof i3.CommonModule, typeof i4.DbxTextModule, typeof i4.DbxLoadingModule, typeof i4.DbxButtonModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatInputModule, typeof i8.MatFormFieldModule, typeof i5.ReactiveFormsModule, typeof i9.MatAutocompleteModule, typeof i10.MatListModule, typeof i11.DbxDatePipeModule, typeof i4.DbxAnchorModule, typeof i12.MatChipsModule, typeof i13.MatIconModule, typeof i11.DbxInjectedComponentModule, typeof i4.DbxListLayoutModule, typeof i14.FormlyModule], never>;
19
19
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyPickableFieldModule>;
20
20
  }
@@ -1,11 +1,35 @@
1
- import { MatSelectionListChange } from "@angular/material/list";
2
- import { AbstractDbxPickableItemFieldDirective } from "./pickable.field.directive";
1
+ import { DbxInjectedComponentConfig } from "@dereekb/dbx-core";
2
+ import { AbstractDbxSelectionListWrapperDirective, AbstractSelectionValueListViewDirective, AbstractDbxSelectionValueListViewItemComponent } from "@dereekb/dbx-web";
3
+ import { PickableValueFieldDisplayValue } from "./pickable";
4
+ import { AbstractDbxPickableItemFieldDirective, PickableItemFieldItem } from "./pickable.field.directive";
3
5
  import * as i0 from "@angular/core";
4
6
  /**
5
7
  * Used for picking pre-set values using a selection list as the presentation.
6
8
  */
7
9
  export declare class DbxPickableListFieldComponent<T> extends AbstractDbxPickableItemFieldDirective<T> {
8
- matSelectionChanged(selection: MatSelectionListChange): void;
10
+ onSelectionChange(event: unknown): void;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldComponent<any>, never>;
10
12
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
11
13
  }
14
+ export declare class DbxPickableListFieldItemListComponent<T> extends AbstractDbxSelectionListWrapperDirective<PickableItemFieldItem<T>> {
15
+ constructor();
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListComponent<any>, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListComponent<any>, "dbx-form-pickable-item-field-item-list", never, {}, {}, never, ["[top]", "[bottom]", "[empty]"]>;
18
+ }
19
+ /**
20
+ * NOTE: Values input are PickableItemFieldItem<T>, but output values are PickableValueFieldDisplayValue<T>.
21
+ */
22
+ export declare class DbxPickableListFieldItemListViewComponent<T> extends AbstractSelectionValueListViewDirective<PickableItemFieldItem<T>> {
23
+ readonly dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>;
24
+ readonly config: DbxInjectedComponentConfig;
25
+ get multiple(): boolean;
26
+ readonly items$: import("rxjs").Observable<import("@dereekb/dbx-web").DbxValueListItemConfig<PickableValueFieldDisplayValue<T, any>>[]>;
27
+ constructor(dbxPickableListFieldComponent: DbxPickableListFieldComponent<T>);
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewComponent<any>, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewComponent<any>, "ng-component", never, {}, {}, never, never>;
30
+ }
31
+ export declare class DbxPickableListFieldItemListViewItemComponent<T> extends AbstractDbxSelectionValueListViewItemComponent<PickableValueFieldDisplayValue<T>> {
32
+ get label(): string;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxPickableListFieldItemListViewItemComponent<any>, "ng-component", never, {}, {}, never, never>;
35
+ }
@@ -0,0 +1,59 @@
1
+ @use '../../../../style/theming';
2
+
3
+ // MARK: Variables
4
+
5
+
6
+ // MARK: Mixin
7
+ @mixin core() {
8
+
9
+ .dbx-searchable-text-field-value {
10
+ width: 100%;
11
+ }
12
+
13
+ .dbx-searchable-text-field-value.mat-option,
14
+ .dbx-searchable-text-field-autocomplete .mat-option {
15
+ padding: 0;
16
+ }
17
+
18
+ .dbx-default-searchable-field-display {
19
+ padding: 0 16px;
20
+ }
21
+
22
+ .dbx-searchable-text-field-has-value.dbx-searchable-text-field-show-value {
23
+
24
+ .dbx-searchable-text-field-value {
25
+ margin-bottom: -6px;
26
+ }
27
+
28
+ // hide without clearing display, which will prevent the input from being clickable.
29
+ .dbx-searchable-text-field-input {
30
+ height: 0;
31
+ opacity: 0;
32
+ }
33
+ }
34
+
35
+ .mat-focused .dbx-searchable-text-field-has-value.dbx-searchable-text-field-show-value .dbx-searchable-text-field-input {
36
+ opacity: unset;
37
+ height: unset;
38
+ }
39
+
40
+ }
41
+
42
+ @mixin color($theme-config) {}
43
+
44
+ @mixin typography($typography-config) {}
45
+
46
+ @mixin theme($theme-config) {
47
+ @include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-form-field-selection-searchable') {
48
+ $color: theming.get-color-config($theme-config);
49
+ $typography: theming.get-typography-config($theme-config);
50
+
51
+ @if $color !=null {
52
+ @include color($theme-config);
53
+ }
54
+
55
+ @if $typography !=null {
56
+ @include typography($typography);
57
+ }
58
+ }
59
+ }
@@ -4,13 +4,19 @@ import { AbstractDbxSearchableValueFieldDirective, SearchableValueFieldsFieldCon
4
4
  import * as i0 from "@angular/core";
5
5
  export interface SearchableChipValueFieldsFieldConfig<T> extends SearchableValueFieldsFieldConfig<T> {
6
6
  }
7
- export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends SearchableChipValueFieldsFieldConfig<T>, SearchableValueFieldsFormlyFieldConfig<T> {
7
+ export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFormlyFieldConfig<T> {
8
+ searchableField: SearchableChipValueFieldsFieldConfig<T>;
8
9
  }
9
10
  export declare class DbxSearchableChipFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableChipValueFieldsFormlyFieldConfig<T>> {
11
+ private _blur;
12
+ private _blurSub;
10
13
  readonly separatorKeysCodes: number[];
11
14
  selected(event: MatAutocompleteSelectedEvent): void;
12
15
  tabPressedOnInput(event: KeyboardEvent): boolean;
13
16
  addChip(event: MatChipInputEvent): void;
17
+ ngOnInit(): void;
18
+ ngOnDestroy(): void;
19
+ onBlur(): void;
14
20
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableChipFieldComponent<any>, never>;
15
21
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableChipFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
16
22
  }
@@ -1,10 +1,6 @@
1
- import { ClickableAnchor } from '@dereekb/dbx-core';
2
- import { Type } from '@angular/core';
1
+ import { DbxInjectedComponentConfig, ClickableAnchor } from '@dereekb/dbx-core';
3
2
  import { Observable } from 'rxjs';
4
3
  import { SelectionDisplayValue, SelectionValue, SelectionValueHashFn } from '../selection';
5
- export interface SearchableFieldDisplayComponent<T> {
6
- displayValue?: SearchableValueFieldDisplayValue<T>;
7
- }
8
4
  export interface SearchableValueFieldValue<T, M = any> extends SelectionValue<T, M> {
9
5
  /**
10
6
  * Optional anchor metadata on the field.
@@ -15,11 +11,13 @@ export interface SearchableValueFieldValue<T, M = any> extends SelectionValue<T,
15
11
  * Displayed value.
16
12
  */
17
13
  export interface SearchableValueFieldDisplayValue<T, M = any> extends SelectionDisplayValue<T, M>, SearchableValueFieldValue<T, M> {
18
- sublabel?: string;
19
14
  /**
20
- * Custom component class to use.
15
+ * Display override configuration
21
16
  */
22
- componentClass?: Type<SearchableFieldDisplayComponent<T>>;
17
+ display?: Partial<DbxInjectedComponentConfig>;
18
+ }
19
+ export interface ConfiguredSearchableValueFieldDisplayValue<T, M = any> extends Omit<SearchableValueFieldDisplayValue<T, M>, 'display'> {
20
+ display: DbxInjectedComponentConfig;
23
21
  }
24
22
  /**
25
23
  * SearchableValueField function for searching values.
@@ -1,20 +1,26 @@
1
- import { OnInit, ViewContainerRef } from '@angular/core';
2
- import { SearchableFieldDisplayComponent, SearchableValueFieldDisplayValue } from './searchable';
1
+ import { Observable } from 'rxjs';
2
+ import { InjectionToken, OnDestroy } from '@angular/core';
3
+ import { ConfiguredSearchableValueFieldDisplayValue } from './searchable';
4
+ import { DbxInjectedComponentConfig } from '@dereekb/dbx-core';
3
5
  import * as i0 from "@angular/core";
4
- export declare class DbxSearchableFieldAutocompleteItemComponent<T> implements OnInit {
5
- content: ViewContainerRef;
6
- displayValue?: SearchableValueFieldDisplayValue<T>;
7
- ngOnInit(): void;
6
+ export declare const DBX_SEARCHABLE_FIELD_COMPONENT_DATA: InjectionToken<unknown>;
7
+ export declare class DbxSearchableFieldAutocompleteItemComponent<T> implements OnDestroy {
8
+ private _displayValue;
9
+ readonly displayValue$: Observable<ConfiguredSearchableValueFieldDisplayValue<T, any>>;
10
+ readonly config$: Observable<DbxInjectedComponentConfig>;
11
+ readonly anchor$: Observable<import("@dereekb/dbx-core").ClickableAnchor | undefined>;
12
+ set displayValue(displayValue: ConfiguredSearchableValueFieldDisplayValue<T>);
13
+ ngOnDestroy(): void;
8
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, never>;
9
15
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableFieldAutocompleteItemComponent<any>, "dbx-searchable-field-autocomplete-item", never, { "displayValue": "displayValue"; }, {}, never, never>;
10
16
  }
11
- export declare class DbxDefaultSearchableFieldDisplayComponent<T> implements SearchableFieldDisplayComponent<T> {
12
- displayValue: SearchableValueFieldDisplayValue<T>;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, "dbx-default-searchable-field-display", never, { "displayValue": "displayValue"; }, {}, never, never>;
17
+ export declare abstract class AbstractDbxSearchableFieldDisplayDirective<T> {
18
+ readonly displayValue: ConfiguredSearchableValueFieldDisplayValue<T>;
19
+ constructor(displayValue: ConfiguredSearchableValueFieldDisplayValue<T>);
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxSearchableFieldDisplayDirective<any>, never, never, {}, {}, never>;
15
22
  }
16
- export declare class DbxDefaultSearchableAnchorFieldDisplayComponent<T> implements SearchableFieldDisplayComponent<T> {
17
- displayValue: SearchableValueFieldDisplayValue<T>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxDefaultSearchableAnchorFieldDisplayComponent<any>, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableAnchorFieldDisplayComponent<any>, "ng-component", never, { "displayValue": "displayValue"; }, {}, never, never>;
23
+ export declare class DbxDefaultSearchableFieldDisplayComponent<T> extends AbstractDbxSearchableFieldDisplayDirective<T> {
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<DbxDefaultSearchableFieldDisplayComponent<any>, "dbx-default-searchable-field-display", never, {}, {}, never, never>;
20
26
  }
@@ -1,16 +1,25 @@
1
+ import { FormlyFieldConfig } from '@ngx-formly/core';
1
2
  import { Observable } from 'rxjs';
2
- import { FieldConfig } from '../../field';
3
+ import { LabeledFieldConfig, DescriptionFieldConfig } from '../../field';
3
4
  import { SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue } from './searchable';
4
- import { SearchableChipValueFieldsFieldConfig, SearchableChipValueFieldsFormlyFieldConfig } from './searchable.chip.field.component';
5
- import { SearchableTextValueFieldsFieldConfig, SearchableTextValueFieldsFormlyFieldConfig } from './searchable.text.field.component';
6
- export declare function makeMetaFilterSearchableFieldValueDisplayFn<T = string | number>(loadMetaForValues: (values: SearchableValueFieldValue<T>[]) => Observable<SearchableValueFieldValue<T>[]>, makeDisplayForValues: (values: SearchableValueFieldValue<T>[]) => SearchableValueFieldDisplayValue<T>[]): SearchableValueFieldDisplayFn<T>;
7
- export interface SearchableChipFieldConfig<T = any> extends FieldConfig, SearchableChipValueFieldsFieldConfig<T> {
5
+ import { SearchableChipValueFieldsFieldConfig } from './searchable.chip.field.component';
6
+ import { SearchableTextValueFieldsFieldConfig } from './searchable.text.field.component';
7
+ /**
8
+ * Used to create a SearchableValueFieldDisplayFn function that will retrieve the metadata for items that are missing their metadata so they can be displayed properly.
9
+ *
10
+ * @param param0
11
+ * @returns
12
+ */
13
+ export declare function makeMetaFilterSearchableFieldValueDisplayFn<T = string | number, M = any>({ loadMetaForValues, makeDisplayForValues }: {
14
+ loadMetaForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldValue<T, M>[]>;
15
+ makeDisplayForValues: (values: SearchableValueFieldValue<T, M>[]) => Observable<SearchableValueFieldDisplayValue<T, M>[]>;
16
+ }): SearchableValueFieldDisplayFn<T>;
17
+ export interface StringSearchableChipFieldConfig extends Omit<SearchableChipFieldConfig<string>, 'allowStringValues'> {
8
18
  }
9
- export interface SearchableChipFieldFormlyConfig<T = any> extends Omit<SearchableChipValueFieldsFormlyFieldConfig<T>, 'type'> {
19
+ export declare function searchableStringChipField(config: StringSearchableChipFieldConfig): FormlyFieldConfig;
20
+ export interface SearchableChipFieldConfig<T = any> extends LabeledFieldConfig, DescriptionFieldConfig, SearchableChipValueFieldsFieldConfig<T> {
10
21
  }
11
- export declare function searchableChipField<C extends SearchableChipFieldFormlyConfig<any>>(config: C): C;
12
- export interface SearchableTextFieldConfig<T = any> extends FieldConfig, SearchableTextValueFieldsFieldConfig<T> {
22
+ export declare function searchableChipField<T>(config: SearchableChipFieldConfig<T>): FormlyFieldConfig;
23
+ export interface SearchableTextFieldConfig<T = any> extends LabeledFieldConfig, DescriptionFieldConfig, SearchableTextValueFieldsFieldConfig<T> {
13
24
  }
14
- export interface SearchableTextFieldFormlyConfig<T = any> extends Omit<SearchableTextValueFieldsFormlyFieldConfig<T>, 'type'> {
15
- }
16
- export declare function searchableTextField<C extends SearchableTextFieldFormlyConfig<any>>(config: C): C;
25
+ export declare function searchableTextField<T>(config: SearchableTextFieldConfig<T>): FormlyFieldConfig;
@@ -1,9 +1,11 @@
1
+ import { DbxInjectedComponentConfig } from '@dereekb/dbx-core';
1
2
  import { SubscriptionObject, LoadingState, LoadingStateContextInstance } from '@dereekb/rxjs';
2
- import { ElementRef, OnDestroy, OnInit, Type } from '@angular/core';
3
+ import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
3
4
  import { AbstractControl, FormControl, ValidatorFn } from '@angular/forms';
4
- import { FieldType, FormlyFieldConfig } from '@ngx-formly/core';
5
+ import { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';
6
+ import { FieldType } from '@ngx-formly/material';
5
7
  import { Observable } from 'rxjs';
6
- import { SearchableValueFieldHashFn, SearchableValueFieldStringSearchFn, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue, SearchableFieldDisplayComponent, SearchableValueFieldAnchorFn } from './searchable';
8
+ import { SearchableValueFieldHashFn, SearchableValueFieldStringSearchFn, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue, SearchableValueFieldAnchorFn, ConfiguredSearchableValueFieldDisplayValue } from './searchable';
7
9
  import { Maybe } from '@dereekb/util';
8
10
  import * as i0 from "@angular/core";
9
11
  export interface StringValueFieldsFieldConfig {
@@ -11,10 +13,6 @@ export interface StringValueFieldsFieldConfig {
11
13
  * Custom input validators.
12
14
  */
13
15
  textInputValidator?: ValidatorFn | ValidatorFn[];
14
- /**
15
- * Optional description/hint to display.
16
- */
17
- description?: string;
18
16
  }
19
17
  export interface StringValueFieldsFormlyFieldConfig extends StringValueFieldsFieldConfig, FormlyFieldConfig {
20
18
  }
@@ -42,9 +40,9 @@ export interface SearchableValueFieldsFieldConfig<T> extends StringValueFieldsFi
42
40
  */
43
41
  searchOnEmptyText?: boolean;
44
42
  /**
45
- * Custom component class to use by default.
43
+ * Default injected config to use for display values.
46
44
  */
47
- componentClass?: Type<SearchableFieldDisplayComponent<T>>;
45
+ display?: Partial<DbxInjectedComponentConfig>;
48
46
  /**
49
47
  * Used for building a display value given the input.
50
48
  */
@@ -61,20 +59,29 @@ export interface SearchableValueFieldsFieldConfig<T> extends StringValueFieldsFi
61
59
  * Only used when useAnchor is true.
62
60
  */
63
61
  anchorForValue?: SearchableValueFieldAnchorFn<T>;
62
+ /**
63
+ * Whether or not to show "Clear" in the autcomplete list.
64
+ */
65
+ showClearValue?: boolean;
64
66
  }
65
- export interface SearchableValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFieldConfig<T>, FormlyFieldConfig {
67
+ export interface SearchableValueFieldsFormlyFieldConfig<T> extends FormlyFieldConfig {
68
+ searchableField: SearchableValueFieldsFieldConfig<T>;
66
69
  }
67
70
  /**
68
71
  * Abstract searchable field that provides a feature for searching for values, and for displaying values using Observables.
69
72
  *
70
73
  * Display values are cached for performance.
71
74
  */
72
- export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C extends SearchableValueFieldsFormlyFieldConfig<T>> extends FieldType<C> implements OnInit, OnDestroy {
75
+ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C extends SearchableValueFieldsFormlyFieldConfig<T>> extends FieldType<C & FieldTypeConfig> implements OnInit, OnDestroy {
76
+ readonly cdRef: ChangeDetectorRef;
73
77
  /**
74
78
  * Whether or not to set/get values as an array.
75
79
  */
76
80
  multiSelect: boolean;
77
- defaultComponentClass?: Type<SearchableFieldDisplayComponent<T>>;
81
+ /**
82
+ * Optional override set by the parent class for picking a default display for this directive.
83
+ */
84
+ defaultDisplay?: DbxInjectedComponentConfig;
78
85
  textInput: ElementRef<HTMLInputElement>;
79
86
  readonly inputCtrl: FormControl;
80
87
  private _formControlObs;
@@ -82,34 +89,34 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
82
89
  private _displayHashMap;
83
90
  readonly inputValue$: Observable<string>;
84
91
  readonly inputValueString$: Observable<string>;
85
- readonly searchResultsState$: Observable<LoadingState<any> | LoadingState<SearchableValueFieldDisplayValue<T, any>[]>>;
92
+ readonly searchResultsState$: Observable<LoadingState<any> | LoadingState<ConfiguredSearchableValueFieldDisplayValue<T, any>[]>>;
86
93
  readonly singleValueSyncSubscription: SubscriptionObject;
87
- readonly searchContext: LoadingStateContextInstance<any, LoadingState<any> | LoadingState<SearchableValueFieldDisplayValue<T, any>[]>>;
88
- readonly searchResults$: Observable<SearchableValueFieldDisplayValue<T>[]>;
94
+ readonly searchContext: LoadingStateContextInstance<any, LoadingState<any> | LoadingState<ConfiguredSearchableValueFieldDisplayValue<T, any>[]>>;
95
+ readonly searchResults$: Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
89
96
  readonly _formControlValue: Observable<T | T[]>;
90
97
  readonly values$: Observable<T[]>;
91
- readonly displayValuesState$: Observable<LoadingState<SearchableValueFieldDisplayValue<T>[]>>;
92
- readonly displayValues$: Observable<SearchableValueFieldDisplayValue<T>[]>;
98
+ readonly displayValuesState$: Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
99
+ readonly displayValues$: Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
93
100
  get name(): string;
94
101
  get label(): Maybe<string>;
95
102
  get readonly(): Maybe<boolean>;
103
+ get searchableField(): SearchableValueFieldsFieldConfig<T>;
96
104
  get searchOnEmptyText(): boolean;
97
- get required(): Maybe<boolean>;
98
105
  get autocomplete(): string;
99
- get placeholder(): string;
100
- get description(): Maybe<string>;
101
106
  get hashForValue(): SearchableValueFieldHashFn<T>;
102
107
  get displayForValue(): SearchableValueFieldDisplayFn<T>;
103
108
  get useAnchor(): Maybe<boolean>;
104
109
  get anchorForValue(): Maybe<SearchableValueFieldAnchorFn<T>>;
105
- get componentClass(): Maybe<Type<SearchableFieldDisplayComponent<T>>>;
110
+ get display(): Maybe<Partial<DbxInjectedComponentConfig>>;
106
111
  get search(): SearchableValueFieldStringSearchFn<T>;
107
112
  get values(): T[];
108
113
  get allowStringValues(): boolean;
109
114
  get convertStringValue(): Maybe<(text: string) => T>;
110
- loadDisplayValuesForValues(values: T[]): Observable<LoadingState<SearchableValueFieldDisplayValue<T>[]>>;
111
- loadDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<LoadingState<SearchableValueFieldDisplayValue<T>[]>>;
112
- getDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<SearchableValueFieldDisplayValue<T>[]>;
115
+ get showClearValue(): boolean;
116
+ loadDisplayValuesForValues(values: T[]): Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
117
+ loadDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<LoadingState<ConfiguredSearchableValueFieldDisplayValue<T>[]>>;
118
+ getDisplayValuesForFieldValues(values: SearchableValueFieldValue<T>[]): Observable<ConfiguredSearchableValueFieldDisplayValue<T>[]>;
119
+ constructor(cdRef: ChangeDetectorRef);
113
120
  ngOnInit(): void;
114
121
  ngOnDestroy(): void;
115
122
  /**
@@ -121,8 +128,10 @@ export declare abstract class AbstractDbxSearchableValueFieldDirective<T, C exte
121
128
  protected _addWithTextValue(text: string): void;
122
129
  addWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
123
130
  removeWithDisplayValue(displayValue: SearchableValueFieldDisplayValue<T>): void;
131
+ _tryAddCurrentInputValue(): boolean;
124
132
  addValue(value: T): void;
125
133
  removeValue(value: T): void;
134
+ clearValues(): void;
126
135
  setValues(values: T[]): void;
127
136
  protected _getValueOnFormControl(valueOnFormControl: any): T[];
128
137
  protected _setValueOnFormControl(values: T[]): void;
@@ -16,6 +16,6 @@ import * as i14 from "@angular/material/icon";
16
16
  import * as i15 from "@ngx-formly/core";
17
17
  export declare class DbxFormFormlySearchableFieldModule {
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySearchableFieldModule, never>;
19
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySearchableFieldModule, [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent, typeof i3.DbxSearchableFieldAutocompleteItemComponent, typeof i3.DbxDefaultSearchableFieldDisplayComponent, typeof i3.DbxDefaultSearchableAnchorFieldDisplayComponent], [typeof i4.CommonModule, typeof i5.DbxTextModule, typeof i5.DbxLoadingModule, typeof i5.DbxButtonModule, typeof i6.FormsModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatFormFieldModule, typeof i6.ReactiveFormsModule, typeof i10.MatAutocompleteModule, typeof i11.MatListModule, typeof i12.DbxDatePipeModule, typeof i5.DbxAnchorModule, typeof i13.MatChipsModule, typeof i14.MatIconModule, typeof i12.DbxInjectedComponentModule, typeof i15.FormlyModule], [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent]>;
19
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySearchableFieldModule, [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent, typeof i3.DbxSearchableFieldAutocompleteItemComponent, typeof i3.DbxDefaultSearchableFieldDisplayComponent], [typeof i4.CommonModule, typeof i5.DbxTextModule, typeof i5.DbxLoadingModule, typeof i5.DbxButtonModule, typeof i6.FormsModule, typeof i7.MatButtonModule, typeof i8.MatInputModule, typeof i9.MatFormFieldModule, typeof i6.ReactiveFormsModule, typeof i10.MatAutocompleteModule, typeof i11.MatListModule, typeof i12.DbxDatePipeModule, typeof i5.DbxAnchorModule, typeof i13.MatChipsModule, typeof i14.MatIconModule, typeof i12.DbxInjectedComponentModule, typeof i15.FormlyModule], [typeof i1.DbxSearchableChipFieldComponent, typeof i2.DbxSearchableTextFieldComponent]>;
20
20
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySearchableFieldModule>;
21
21
  }
@@ -1,14 +1,24 @@
1
1
  import { AbstractDbxSearchableValueFieldDirective, SearchableValueFieldsFieldConfig, SearchableValueFieldsFormlyFieldConfig } from './searchable.field.directive';
2
2
  import * as i0 from "@angular/core";
3
3
  export interface SearchableTextValueFieldsFieldConfig<T> extends SearchableValueFieldsFieldConfig<T> {
4
+ showSelectedValue?: boolean;
4
5
  }
5
- export interface SearchableTextValueFieldsFormlyFieldConfig<T> extends SearchableTextValueFieldsFieldConfig<T>, SearchableValueFieldsFormlyFieldConfig<T> {
6
+ export interface SearchableTextValueFieldsFormlyFieldConfig<T> extends SearchableValueFieldsFormlyFieldConfig<T> {
7
+ searchableField: SearchableTextValueFieldsFieldConfig<T>;
6
8
  }
7
9
  /**
8
10
  * Display component for selecting a single item/value.
9
11
  */
10
12
  export declare class DbxSearchableTextFieldComponent<T> extends AbstractDbxSearchableValueFieldDirective<T, SearchableTextValueFieldsFormlyFieldConfig<T>> {
13
+ readonly selectedDisplayValue$: import("rxjs").Observable<import("@dereekb/dbx-form").ConfiguredSearchableValueFieldDisplayValue<T, any>>;
14
+ readonly hasValue$: import("rxjs").Observable<boolean>;
15
+ readonly showSelectedDisplayValue$: import("rxjs").Observable<boolean>;
16
+ get searchableField(): SearchableTextValueFieldsFieldConfig<T>;
17
+ get showSelectedValue(): boolean;
11
18
  readonly multiSelect = false;
19
+ private _clearInputSub;
20
+ ngOnInit(): void;
21
+ ngOnDestroy(): void;
12
22
  selected(event: any): void;
13
23
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxSearchableTextFieldComponent<any>, never>;
14
24
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxSearchableTextFieldComponent<any>, "ng-component", never, {}, {}, never, never>;
@@ -1,7 +1,7 @@
1
1
  import { FormlyFieldConfig } from "@ngx-formly/core";
2
- import { FieldConfig } from "../../field";
2
+ import { LabeledFieldConfig } from "../../field";
3
3
  import { StringValueFieldsFieldConfig, StringValueFieldsFormlyFieldConfig } from "./searchable.field.directive";
4
- export interface ChipTextFieldConfig extends FieldConfig, StringValueFieldsFieldConfig {
4
+ export interface ChipTextFieldConfig extends LabeledFieldConfig, StringValueFieldsFieldConfig {
5
5
  }
6
6
  export interface ChipTextFieldFormlyConfig extends StringValueFieldsFormlyFieldConfig, FormlyFieldConfig {
7
7
  caseSensitive?: boolean;
@@ -14,6 +14,7 @@ export interface SelectionValue<T, M = any> {
14
14
  */
15
15
  export interface SelectionDisplayValue<T, M = any> extends SelectionValue<T, M> {
16
16
  label: string;
17
+ sublabel?: string;
17
18
  /**
18
19
  * Whether or not the value is known.
19
20
  */
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./pickable/pickable.field.module";
4
+ import * as i3 from "./searchable/searchable.field.module";
5
+ export declare class DbxFormFormlySelectionModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlySelectionModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlySelectionModule, never, [typeof i1.CommonModule], [typeof i2.DbxFormFormlyPickableFieldModule, typeof i3.DbxFormFormlySearchableFieldModule]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlySelectionModule>;
9
+ }