@webilix/ngx-table-m3 0.0.8 → 0.0.10

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.
@@ -18,6 +18,10 @@ export declare class FilterComponent implements OnInit {
18
18
  readonly methods: import("./filter.interface").FilterMethods<any, any>;
19
19
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
20
20
  };
21
+ NUMBER: {
22
+ readonly methods: import("./filter.interface").FilterMethods<any, any>;
23
+ readonly component: import("@angular/cdk/portal").ComponentType<any>;
24
+ };
21
25
  SEARCH: {
22
26
  readonly methods: import("./filter.interface").FilterMethods<any, any>;
23
27
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
@@ -1,7 +1,7 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { IViewConfig } from '../views';
3
- import { IFilterDate, IFilterMultiSelect, IFilterSearch, IFilterSelect } from '.';
4
- export type Filter = IFilterDate | IFilterMultiSelect | IFilterSearch | IFilterSelect;
3
+ import { IFilterDate, IFilterMultiSelect, IFilterNumber, IFilterSearch, IFilterSelect } from '.';
4
+ export type Filter = IFilterDate | IFilterMultiSelect | IFilterNumber | IFilterSearch | IFilterSelect;
5
5
  export interface IFilter {
6
6
  readonly filter: Filter;
7
7
  readonly title: string;
@@ -2,6 +2,8 @@ export * from './date/filter-date.component';
2
2
  export * from './date/filter-date.interface';
3
3
  export * from './multi-select/filter-multi-select.component';
4
4
  export * from './multi-select/filter-multi-select.interface';
5
+ export * from './number/filter-number.component';
6
+ export * from './number/filter-number.interface';
5
7
  export * from './search/filter-search.component';
6
8
  export * from './search/filter-search.interface';
7
9
  export * from './select/filter-select.component';
@@ -0,0 +1,34 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import { IViewConfig } from '../../views';
3
+ import { IFilterNumber, IFilterNumberValue } from './filter-number.interface';
4
+ import * as i0 from "@angular/core";
5
+ type Mode = IFilterNumberValue['mode'];
6
+ export declare class FilterNumberComponent implements AfterViewInit {
7
+ private className;
8
+ private fromInput?;
9
+ private numberInput?;
10
+ data: {
11
+ filter: IFilterNumber;
12
+ viewConfig: IViewConfig;
13
+ };
14
+ value?: IFilterNumberValue;
15
+ onChange: (value?: IFilterNumberValue) => void;
16
+ modes: {
17
+ type: Mode;
18
+ title: string;
19
+ }[];
20
+ mode?: Mode;
21
+ query?: string;
22
+ fromQuery?: string;
23
+ toQuery?: string;
24
+ numberQuery?: string;
25
+ inputTransformFn: (value: any) => string;
26
+ ngAfterViewInit(): void;
27
+ setMode(mode: Mode): void;
28
+ isNumeric(value: string): boolean;
29
+ setQuery(fromQuery: string, toQuery: string): void;
30
+ updateQuery(): void;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilterNumberComponent, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<FilterNumberComponent, "ng-component", never, {}, {}, never, never, true, never>;
33
+ }
34
+ export {};
@@ -0,0 +1,21 @@
1
+ import { FilterMethods } from '../filter.interface';
2
+ type Mode = 'EQUAL' | 'GREATER' | 'LOWER' | 'BETWEEN';
3
+ export interface IFilterNumberValue {
4
+ readonly query: string;
5
+ readonly mode: Mode;
6
+ }
7
+ export interface IFilterNumber {
8
+ readonly type: 'NUMBER';
9
+ readonly mode?: Mode;
10
+ readonly toParam?: (value: IFilterNumberValue) => string;
11
+ }
12
+ export declare class FilterNumberMethods<T> extends FilterMethods<IFilterNumber, IFilterNumberValue> {
13
+ toParam(value: IFilterNumberValue): string;
14
+ value(value: string, filter: IFilterNumber): IFilterNumberValue | undefined;
15
+ query(value: IFilterNumberValue): string;
16
+ active(value: IFilterNumberValue, filter: IFilterNumber): {
17
+ value: string;
18
+ english: boolean;
19
+ };
20
+ }
21
+ export {};
@@ -2,6 +2,7 @@ import { AfterViewInit } from '@angular/core';
2
2
  import { IViewConfig } from '../../views';
3
3
  import { IFilterSearch, IFilterSearchValue } from './filter-search.interface';
4
4
  import * as i0 from "@angular/core";
5
+ type Mode = IFilterSearchValue['mode'];
5
6
  export declare class FilterSearchComponent implements AfterViewInit {
6
7
  private className;
7
8
  private searchInput?;
@@ -12,10 +13,11 @@ export declare class FilterSearchComponent implements AfterViewInit {
12
13
  value?: IFilterSearchValue;
13
14
  onChange: (value?: IFilterSearchValue) => void;
14
15
  query?: string;
15
- mode?: 'PHRASE' | 'ALL' | 'EACH';
16
+ mode: Mode;
16
17
  ngAfterViewInit(): void;
17
18
  updateQuery(query: string): void;
18
- updateMode(mode: 'PHRASE' | 'ALL' | 'EACH'): void;
19
+ updateMode(mode: Mode): void;
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterSearchComponent, never>;
20
21
  static ɵcmp: i0.ɵɵComponentDeclaration<FilterSearchComponent, "ng-component", never, {}, {}, never, never, true, never>;
21
22
  }
23
+ export {};
@@ -1,11 +1,12 @@
1
1
  import { FilterMethods } from '../filter.interface';
2
+ type Mode = 'PHRASE' | 'ALL' | 'EACH';
2
3
  export interface IFilterSearchValue {
3
4
  readonly query: string;
4
- readonly mode: 'PHRASE' | 'ALL' | 'EACH';
5
+ readonly mode: Mode;
5
6
  }
6
7
  export interface IFilterSearch {
7
8
  readonly type: 'SEARCH';
8
- readonly mode?: 'PHRASE' | 'ALL' | 'EACH';
9
+ readonly mode?: Mode;
9
10
  readonly english?: boolean;
10
11
  readonly toParam?: (value: IFilterSearchValue) => string;
11
12
  }
@@ -18,3 +19,4 @@ export declare class FilterSearchMethods<T> extends FilterMethods<IFilterSearch,
18
19
  english: boolean;
19
20
  };
20
21
  }
22
+ export {};
@@ -19,19 +19,19 @@ export declare class ViewValueComponent<T> implements OnChanges {
19
19
  readonly methods: import("../../columns").ColumnMethods<any, any>;
20
20
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
21
21
  };
22
- DURATION: {
22
+ NUMBER: {
23
23
  readonly methods: import("../../columns").ColumnMethods<any, any>;
24
24
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
25
25
  };
26
- "FILE-SIZE": {
26
+ DURATION: {
27
27
  readonly methods: import("../../columns").ColumnMethods<any, any>;
28
28
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
29
29
  };
30
- MOBILE: {
30
+ "FILE-SIZE": {
31
31
  readonly methods: import("../../columns").ColumnMethods<any, any>;
32
32
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
33
33
  };
34
- NUMBER: {
34
+ MOBILE: {
35
35
  readonly methods: import("../../columns").ColumnMethods<any, any>;
36
36
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
37
37
  };
package/ngx-table-m3.css CHANGED
@@ -58,6 +58,42 @@
58
58
  direction: rtl;
59
59
  }
60
60
 
61
+ .filter-number {
62
+ padding-top: 1rem;
63
+
64
+ .modes {
65
+ display: flex;
66
+ align-items: center;
67
+ column-gap: 1rem;
68
+ padding: 0 1rem 1rem 1rem;
69
+
70
+ .mode {
71
+ flex-grow: 1;
72
+
73
+ cursor: pointer;
74
+ font-size: 90%;
75
+ padding: 0.5rem 0;
76
+ text-align: center;
77
+ border-radius: 8px;
78
+ border: 1px solid var(--outline-variant);
79
+ }
80
+
81
+ .mode.selected {
82
+ color: var(--secondary);
83
+ border-color: var(--secondary);
84
+ }
85
+ }
86
+
87
+ .inputs {
88
+ display: flex;
89
+ align-items: center;
90
+ column-gap: 1rem;
91
+
92
+ padding: 0 1rem 1rem 1rem;
93
+ box-sizing: border-box;
94
+ }
95
+ }
96
+
61
97
  .filter-search {
62
98
  margin: 1rem 1rem 0 1rem;
63
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webilix/ngx-table-m3",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "author": "Ali Amirnezhad",
5
5
  "description": "Responsive table view component for Angular and Material 3",
6
6
  "repository": {
@@ -26,8 +26,9 @@
26
26
  "@angular/material": ">=19.0.4",
27
27
  "@webilix/helper-library": ">=6.0.2",
28
28
  "@webilix/jalali-date-time": ">=2.0.5",
29
- "@webilix/ngx-calendar-m3": ">=0.0.9",
30
- "@webilix/ngx-helper-m3": ">=0.0.16"
29
+ "@webilix/ngx-calendar-m3": ">=0.0.10",
30
+ "@webilix/ngx-helper-m3": ">=0.0.20",
31
+ "ngx-mask": ">=19.0.6"
31
32
  },
32
33
  "dependencies": {
33
34
  "tslib": "^2.3.0"