suis 0.23.0 → 0.23.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. package/esm2022/lib/components/suis-button/suis-button.component.mjs +3 -3
  2. package/esm2022/lib/components/suis-button-link/suis-button-link.component.mjs +3 -3
  3. package/esm2022/lib/components/suis-button-outlined/suis-button-outlined.component.mjs +3 -3
  4. package/esm2022/lib/components/suis-pagination/suis-pagination-items.pipe.mjs +22 -0
  5. package/esm2022/lib/components/suis-pagination/suis-pagination-page.pipe.mjs +4 -6
  6. package/esm2022/lib/components/suis-pagination/suis-pagination-per-page-options.pipe.mjs +20 -0
  7. package/esm2022/lib/components/suis-pagination/suis-pagination.component.mjs +56 -8
  8. package/esm2022/lib/components/suis-select/suis-select.component.mjs +19 -9
  9. package/esm2022/lib/components/suis-select-multi/suis-select-multi.component.mjs +3 -3
  10. package/esm2022/lib/components/suis-table/suis-table.component.mjs +2 -2
  11. package/esm2022/lib/types/index.mjs +2 -1
  12. package/esm2022/lib/types/suis-sort.type.mjs +2 -0
  13. package/fesm2022/suis.mjs +236 -149
  14. package/fesm2022/suis.mjs.map +1 -1
  15. package/lib/components/suis-pagination/suis-pagination-items.pipe.d.ts +7 -0
  16. package/lib/components/suis-pagination/suis-pagination-page.pipe.d.ts +1 -1
  17. package/lib/components/suis-pagination/suis-pagination-per-page-options.pipe.d.ts +8 -0
  18. package/lib/components/suis-pagination/suis-pagination.component.d.ts +26 -6
  19. package/lib/components/suis-select/suis-select.component.d.ts +5 -1
  20. package/lib/components/suis-table/suis-table.component.d.ts +4 -3
  21. package/lib/types/index.d.ts +1 -0
  22. package/lib/types/suis-sort.type.d.ts +1 -0
  23. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SuisPaginationItemsPipe implements PipeTransform {
4
+ transform(ofLabel: string, page: number, perPage: number, totalItems: number, itemsLabel: string): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuisPaginationItemsPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<SuisPaginationItemsPipe, "suisPaginationItems", true>;
7
+ }
@@ -1,7 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class SuisPaginationPagePipe implements PipeTransform {
4
- transform(pageLabel: string, page: number, perPage: number, totalItems: number): string;
4
+ transform(ofLabel: string, page: number, perPage: number, totalItems: number): string;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<SuisPaginationPagePipe, never>;
6
6
  static ɵpipe: i0.ɵɵPipeDeclaration<SuisPaginationPagePipe, "suisPaginationPage", true>;
7
7
  }
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { SuisSelectOption } from '../suis-select-option/suis-select-option.interfaces';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SuisPaginationPerPageOptionsPipe implements PipeTransform {
5
+ transform(options: number[]): SuisSelectOption<number>[];
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuisPaginationPerPageOptionsPipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<SuisPaginationPerPageOptionsPipe, "suisPaginationPerPageOptions", true>;
8
+ }
@@ -1,9 +1,15 @@
1
- import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { SuisIconType } from '../suis-icon';
3
+ import { FormControl } from '@angular/forms';
3
4
  import * as i0 from "@angular/core";
4
- export declare class SuisPaginationComponent implements OnChanges {
5
+ export declare class SuisPaginationComponent implements OnInit, OnChanges {
6
+ private readonly destroyRef;
5
7
  /** @internal */
6
- SuisIconType: typeof SuisIconType;
8
+ private readonly PER_PAGE;
9
+ /** @internal */
10
+ readonly SuisIconType: typeof SuisIconType;
11
+ /** @internal */
12
+ perPageControl: FormControl<number>;
7
13
  /** @internal */
8
14
  /**
9
15
  * Number of the maximum page that can be reached based on totalItems and perPage values.
@@ -17,6 +23,10 @@ export declare class SuisPaginationComponent implements OnChanges {
17
23
  * Number of items presented per page. By default set to 15.
18
24
  */
19
25
  perPage: number;
26
+ /**
27
+ * Options of perPage dropdown. Be default set to [10, 15, 20, 25].
28
+ */
29
+ perPageOptions: number[];
20
30
  /**
21
31
  * Number of total items in data source. By default set to 0.
22
32
  */
@@ -26,16 +36,26 @@ export declare class SuisPaginationComponent implements OnChanges {
26
36
  */
27
37
  spacing: boolean;
28
38
  /**
29
- * Sets the page label between the buttons. By default set to 'Page'.
39
+ * Sets the of label "1 'of' 25". By default set to 'of'.
30
40
  */
31
- pageLabel: string;
41
+ ofLabel: string;
42
+ /**
43
+ * Sets the page label "1-10 'of' 25 'items'". By default set to 'Page'.
44
+ */
45
+ itemsLabel: string;
32
46
  /**
33
47
  * Emits on page value change.
34
48
  */
35
49
  pageChange: EventEmitter<number>;
50
+ /**
51
+ * Emits on perPage value change.
52
+ */
53
+ perPageChange: EventEmitter<number>;
54
+ ngOnInit(): void;
36
55
  ngOnChanges(changes: SimpleChanges): void;
37
56
  next(): void;
38
57
  previous(): void;
58
+ onPerPageChange(value: number): void;
39
59
  static ɵfac: i0.ɵɵFactoryDeclaration<SuisPaginationComponent, never>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<SuisPaginationComponent, "suis-pagination", never, { "page": { "alias": "page"; "required": false; }; "perPage": { "alias": "perPage"; "required": false; }; "totalItems": { "alias": "totalItems"; "required": false; }; "spacing": { "alias": "spacing"; "required": false; }; "pageLabel": { "alias": "pageLabel"; "required": false; }; }, { "pageChange": "pageChange"; }, never, never, true, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuisPaginationComponent, "suis-pagination", never, { "page": { "alias": "page"; "required": false; }; "perPage": { "alias": "perPage"; "required": false; }; "perPageOptions": { "alias": "perPageOptions"; "required": false; }; "totalItems": { "alias": "totalItems"; "required": false; }; "spacing": { "alias": "spacing"; "required": false; }; "ofLabel": { "alias": "ofLabel"; "required": false; }; "itemsLabel": { "alias": "itemsLabel"; "required": false; }; }, { "pageChange": "pageChange"; "perPageChange": "perPageChange"; }, never, never, true, never>;
41
61
  }
@@ -3,10 +3,14 @@ import * as i0 from "@angular/core";
3
3
  export declare class SuisSelectComponent<T> extends SuisSelectBase<T> {
4
4
  /** @internal */
5
5
  value: T | null;
6
+ /**
7
+ * Allows mechanism of clearing value. By default set to true.
8
+ */
9
+ nullable: boolean;
6
10
  writeValue(obj: T): void;
7
11
  onSelect(value: T): void;
8
12
  clearValue(): void;
9
13
  setValue(value: T | null): void;
10
14
  static ɵfac: i0.ɵɵFactoryDeclaration<SuisSelectComponent<any>, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<SuisSelectComponent<any>, "suis-select", never, {}, {}, never, never, true, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuisSelectComponent<any>, "suis-select", never, { "nullable": { "alias": "nullable"; "required": false; }; }, {}, never, never, true, never>;
12
16
  }
@@ -2,6 +2,7 @@ import { EventEmitter, QueryList } from '@angular/core';
2
2
  import { SuisTableDataItem } from './suis-table.interfaces';
3
3
  import { SuisTableColumnDirective } from './suis-table-column.directive';
4
4
  import { SuisIconType } from '../suis-icon';
5
+ import { SuisSort } from '../../types/suis-sort.type';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class SuisTableComponent {
7
8
  /** @internal */
@@ -17,9 +18,9 @@ export declare class SuisTableComponent {
17
18
  */
18
19
  orderBy: string;
19
20
  /**
20
- * Specifies sort condition. Accepted values - 'asc' and 'desc'. By default set to 'asc'.
21
+ * Specifies sort condition. Type of SuisSort - 'asc' and 'desc'. By default set to 'asc'.
21
22
  */
22
- sortBy: 'asc' | 'desc';
23
+ sortBy: SuisSort;
23
24
  /**
24
25
  * Shows loading spinner and blurs data. By default set to false.
25
26
  */
@@ -31,7 +32,7 @@ export declare class SuisTableComponent {
31
32
  /**
32
33
  * Emits value on sort condition change.
33
34
  */
34
- sortByChange: EventEmitter<string>;
35
+ sortByChange: EventEmitter<SuisSort>;
35
36
  /**
36
37
  * Emits value on order property change.
37
38
  */
@@ -1,2 +1,3 @@
1
1
  export * from './suis-color.type';
2
2
  export * from './suis-size.type';
3
+ export * from './suis-sort.type';
@@ -0,0 +1 @@
1
+ export type SuisSort = 'asc' | 'desc';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suis",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "main": "src/index.ts",
5
5
  "author": "Karol Jaskółka",
6
6
  "description": "SUIS (Standalone UI + Signals) Angular 16+ Component Library",