@ecodev/natural 47.2.0 → 47.3.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.
@@ -11,28 +11,40 @@ import * as i0 from "@angular/core";
11
11
  type V<TService> = string | ExtractTallOne<TService>;
12
12
  /**
13
13
  * Default usage:
14
- * <natural-select [service]="amazingServiceInstance" [(model)]="amazingModel" (modelChange)=amazingChangeFn($event)></natural-select>
14
+ * ```html
15
+ * <natural-select [service]="myServiceInstance" [(model)]="myModel" (modelChange)=myChangeFn($event)></natural-select>
16
+ * ```
15
17
  *
16
18
  * Custom template usage :
19
+ * ```html
17
20
  * <natural-select [service]="svc" [(ngModel)]="model">
18
21
  * <ng-template let-item="item">
19
22
  * <span>{{ item.xxx }}</span>
20
23
  * </ng-template>
21
24
  * </natural-select>
25
+ * ```
22
26
  *
23
- * [(ngModel)] and (ngModelChange) are optional
27
+ * `[(ngModel)]` and `(ngModelChange)` are optional.
24
28
  *
25
29
  * Placeholder :
26
- * <natural-select placeholder="amazing placeholder">
30
+ * ```html
31
+ * <natural-select placeholder="my placeholder"></natural-select>
32
+ * ```
27
33
  *
28
34
  * Never float placeholder :
29
- * <natural-select placeholder="amazing placeholder" floatPlaceholder="never">
35
+ * ```html
36
+ * <natural-select placeholder="my placeholder" floatPlaceholder="never"></natural-select>
37
+ * ```
30
38
  *
31
- * Search with like %xxx% on specified attribute name instead of custom filter on whole object
32
- * <natural-select [searchField]="string">
39
+ * Search with like %xxx% on specified field `name` instead of custom filter on whole object
40
+ * ```html
41
+ * <natural-select searchField="name"></natural-select>
42
+ * ```
33
43
  *
34
44
  * Allows to input free string without selecting an option from autocomplete suggestions
35
- * <natural-select [optionRequired]="false">
45
+ * ```html
46
+ * <natural-select [optionRequired]="false"></natural-select>
47
+ * ```
36
48
  */
37
49
  export declare class NaturalSelectComponent<TService extends NaturalAbstractModelService<any, any, PaginatedData<Literal>, QueryVariables, any, any, any, any, any, any>> extends AbstractSelect<V<TService>, V<TService>> implements OnInit, OnDestroy, ControlValueAccessor, AfterViewInit {
38
50
  autoTrigger: MatAutocompleteTrigger;
@@ -46,9 +58,13 @@ export declare class NaturalSelectComponent<TService extends NaturalAbstractMode
46
58
  */
47
59
  optionRequired: boolean;
48
60
  /**
49
- * The filter attribute to bind when searching for a term
61
+ * The field on which to search for, default to 'custom'.
50
62
  */
51
63
  searchField: 'custom' | string;
64
+ /**
65
+ * The operator with which to search for, default to 'search' if `searchField` is 'custom', else 'like'.
66
+ */
67
+ searchOperator: 'search' | string | null;
52
68
  /**
53
69
  * Additional filter for query
54
70
  */
@@ -93,6 +109,6 @@ export declare class NaturalSelectComponent<TService extends NaturalAbstractMode
93
109
  showClearButton(): boolean;
94
110
  private getSearchFilter;
95
111
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalSelectComponent<any>, never>;
96
- static ɵcmp: i0.ɵɵComponentDeclaration<NaturalSelectComponent<any>, "natural-select", never, { "service": "service"; "optionRequired": "optionRequired"; "searchField": "searchField"; "filter": "filter"; "disabled": "disabled"; }, {}, ["itemTemplate"], never, false, never>;
112
+ static ɵcmp: i0.ɵɵComponentDeclaration<NaturalSelectComponent<any>, "natural-select", never, { "service": "service"; "optionRequired": "optionRequired"; "searchField": "searchField"; "searchOperator": "searchOperator"; "filter": "filter"; "disabled": "disabled"; }, {}, ["itemTemplate"], never, false, never>;
97
113
  }
98
114
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "47.2.0",
3
+ "version": "47.3.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,