@enigmatry/entry-components 15.0.0-preview.1 → 15.0.0-preview.2

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 (57) hide show
  1. package/button/README.md +5 -6
  2. package/button/entry-button-config.d.ts +7 -3
  3. package/button/public-api.d.ts +1 -1
  4. package/common/index.d.ts +5 -0
  5. package/common/public-api.d.ts +1 -0
  6. package/common/utils/index.d.ts +1 -0
  7. package/common/utils/provide-config.d.ts +3 -0
  8. package/dialog/README.md +9 -10
  9. package/dialog/entry-dialog-config.model.d.ts +6 -3
  10. package/dialog/public-api.d.ts +1 -1
  11. package/esm2020/button/entry-button-config.mjs +10 -7
  12. package/esm2020/button/public-api.mjs +2 -2
  13. package/esm2020/common/enigmatry-entry-components-common.mjs +5 -0
  14. package/esm2020/common/public-api.mjs +2 -0
  15. package/esm2020/common/utils/index.mjs +2 -0
  16. package/esm2020/common/utils/provide-config.mjs +14 -0
  17. package/esm2020/dialog/entry-dialog-config.model.mjs +9 -7
  18. package/esm2020/dialog/public-api.mjs +2 -2
  19. package/esm2020/modules/entry-components.module.mjs +59 -0
  20. package/esm2020/public-api.mjs +6 -4
  21. package/esm2020/search-filter/public-api.mjs +2 -2
  22. package/esm2020/search-filter/search-filter-config.model.mjs +10 -7
  23. package/esm2020/validation/entry-validation-config.model.mjs +9 -6
  24. package/esm2020/validation/public-api.mjs +2 -2
  25. package/fesm2015/enigmatry-entry-components-button.mjs +11 -7
  26. package/fesm2015/enigmatry-entry-components-button.mjs.map +1 -1
  27. package/fesm2015/enigmatry-entry-components-common.mjs +21 -0
  28. package/fesm2015/enigmatry-entry-components-common.mjs.map +1 -0
  29. package/fesm2015/enigmatry-entry-components-dialog.mjs +10 -7
  30. package/fesm2015/enigmatry-entry-components-dialog.mjs.map +1 -1
  31. package/fesm2015/enigmatry-entry-components-search-filter.mjs +11 -7
  32. package/fesm2015/enigmatry-entry-components-search-filter.mjs.map +1 -1
  33. package/fesm2015/enigmatry-entry-components-validation.mjs +10 -6
  34. package/fesm2015/enigmatry-entry-components-validation.mjs.map +1 -1
  35. package/fesm2015/enigmatry-entry-components.mjs +65 -3
  36. package/fesm2015/enigmatry-entry-components.mjs.map +1 -1
  37. package/fesm2020/enigmatry-entry-components-button.mjs +11 -7
  38. package/fesm2020/enigmatry-entry-components-button.mjs.map +1 -1
  39. package/fesm2020/enigmatry-entry-components-common.mjs +21 -0
  40. package/fesm2020/enigmatry-entry-components-common.mjs.map +1 -0
  41. package/fesm2020/enigmatry-entry-components-dialog.mjs +10 -7
  42. package/fesm2020/enigmatry-entry-components-dialog.mjs.map +1 -1
  43. package/fesm2020/enigmatry-entry-components-search-filter.mjs +11 -7
  44. package/fesm2020/enigmatry-entry-components-search-filter.mjs.map +1 -1
  45. package/fesm2020/enigmatry-entry-components-validation.mjs +10 -6
  46. package/fesm2020/enigmatry-entry-components-validation.mjs.map +1 -1
  47. package/fesm2020/enigmatry-entry-components.mjs +65 -3
  48. package/fesm2020/enigmatry-entry-components.mjs.map +1 -1
  49. package/modules/entry-components.module.d.ts +26 -0
  50. package/package.json +9 -1
  51. package/public-api.d.ts +5 -3
  52. package/search-filter/README.md +5 -13
  53. package/search-filter/public-api.d.ts +1 -1
  54. package/search-filter/search-filter-config.model.d.ts +7 -3
  55. package/validation/README.md +7 -10
  56. package/validation/entry-validation-config.model.d.ts +6 -2
  57. package/validation/public-api.d.ts +1 -1
@@ -43,11 +43,7 @@ Where `APP_THEME` represents application theming configuration, while `APP_TYPOG
43
43
  `ENTRY_SEARCH_FILTER_CONFIG`: `InjectionToken<EntrySearchFilterConfig>` - Optional configuration used to override defaults.
44
44
 
45
45
  ```ts
46
- import {
47
- EntrySearchFilterModule,
48
- ENTRY_SEARCH_FILTER_CONFIG,
49
- EntrySearchFilterConfig
50
- } from '@enigmatry/entry-components/search-filter';
46
+ import { EntrySearchFilterModule, provideEntrySearchFilterConfig } from '@enigmatry/entry-components/search-filter';
51
47
  // ...
52
48
 
53
49
  @NgModule({
@@ -55,14 +51,10 @@ import {
55
51
  EntrySearchFilterModule
56
52
  ],
57
53
  providers: [
58
- {
59
- provide: ENTRY_SEARCH_FILTER_CONFIG,
60
- useFactory: () => new EntrySearchFilterConfig({
61
- applyButtonText: 'Filter',
62
- noneSelectedOptionText: 'None'
63
- })
64
- }
54
+ provideEntrySearchFilterConfig({
55
+ applyButtonText: 'Filter'
56
+ })
65
57
  ]
66
58
  })
67
- export class AppModule { }
59
+ export class SharedModule { }
68
60
  ```
@@ -5,4 +5,4 @@ export { TextSearchFilter } from './search-filter-input/inputs/text-search-filte
5
5
  export { SelectSearchFilter } from './search-filter-input/inputs/select-search-filter.model';
6
6
  export { SelectFilterOption } from './search-filter-input/inputs/select-filter-option.model';
7
7
  export { EntrySearchFilterModule } from './entry-search-filter.module';
8
- export { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig } from './search-filter-config.model';
8
+ export { ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterConfig, provideEntrySearchFilterConfig } from './search-filter-config.model';
@@ -1,6 +1,6 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { Provider } from '@angular/core';
2
2
  /**
3
- * Used to provide default configurations on module level.
3
+ * Used to provide entry search filter configuration on module level.
4
4
  */
5
5
  export declare class EntrySearchFilterConfig {
6
6
  /** Apply search filters button label (default 'Apply') */
@@ -9,4 +9,8 @@ export declare class EntrySearchFilterConfig {
9
9
  noneSelectedOptionText: string;
10
10
  constructor(config?: Partial<EntrySearchFilterConfig>);
11
11
  }
12
- export declare const ENTRY_SEARCH_FILTER_CONFIG: InjectionToken<EntrySearchFilterConfig>;
12
+ export declare const ENTRY_SEARCH_FILTER_CONFIG: import("@angular/core").InjectionToken<EntrySearchFilterConfig>;
13
+ /**
14
+ * Can be used to provide entry search filter configuration.
15
+ */
16
+ export declare function provideEntrySearchFilterConfig(config: Partial<EntrySearchFilterConfig>): Provider;
@@ -68,7 +68,7 @@ Optionally, when using Reactive form, client side validation messages can be con
68
68
  ```ts
69
69
  // ...
70
70
  import { AbstractControl } from '@angular/forms';
71
- import { ENTRY_VALIDATION_CONFIG, EntryValidationConfig, EntryValidationModule } from '@enigmatry/entry-components/validation';
71
+ import { EntryValidationModule, provideEntryValidationConfig } from '@enigmatry/entry-components/validation';
72
72
 
73
73
  @NgModule({
74
74
  imports: [
@@ -76,15 +76,12 @@ import { ENTRY_VALIDATION_CONFIG, EntryValidationConfig, EntryValidationModule }
76
76
  EntryValidationModule
77
77
  ]
78
78
  providers: [
79
- {
80
- provide: ENTRY_VALIDATION_CONFIG,
81
- useFactory: () => new EntryValidationConfig({
82
- validationMessages: [
83
- { name: 'required', message: 'This field is mandatory!' },
84
- { name: 'minlength', message: (control: AbstractControl) => `Minimal length is ${control.errors.minlength.requiredLength}!`}
85
- ]
86
- })
87
- }
79
+ provideEntryValidationConfig({
80
+ validationMessages: [
81
+ { name: 'required', message: 'This field is mandatory!' },
82
+ { name: 'minlength', message: (control: AbstractControl) => `Minimal length is ${control.errors.minlength.requiredLength}!` }
83
+ ]
84
+ })
88
85
  ]
89
86
  })
90
87
  export class AppModule { }
@@ -1,4 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { Provider } from '@angular/core';
2
2
  import { AbstractControl } from '@angular/forms';
3
3
  /** Used to configure mapping between validation keys and messages */
4
4
  export interface IEntryValidationMessage {
@@ -41,4 +41,8 @@ export declare class EntryValidationConfig {
41
41
  * Defaults:
42
42
  * - validationMessages: []
43
43
  */
44
- export declare const ENTRY_VALIDATION_CONFIG: InjectionToken<EntryValidationConfig>;
44
+ export declare const ENTRY_VALIDATION_CONFIG: import("@angular/core").InjectionToken<EntryValidationConfig>;
45
+ /**
46
+ * Can be used to provide entry validation configuration.
47
+ */
48
+ export declare function provideEntryValidationConfig(config: Partial<EntryValidationConfig>): Provider;
@@ -3,4 +3,4 @@ export { EntryDisplayControlValidationDirective } from './entry-display-control-
3
3
  export { EntryValidationModule } from './entry-validation.module';
4
4
  export { IValidationProblemDetails } from './validation-problem-details.interface';
5
5
  export * from './entry-validation';
6
- export { ENTRY_VALIDATION_CONFIG, EntryValidationConfig, IEntryValidationMessage } from './entry-validation-config.model';
6
+ export * from './entry-validation-config.model';