@colijnit/corecomponents_v12 12.0.46 → 12.0.49

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 (36) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +421 -13
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.d.ts +2 -0
  4. package/colijnit-corecomponents_v12.metadata.json +1 -1
  5. package/esm2015/colijnit-corecomponents_v12.js +3 -1
  6. package/esm2015/lib/components/base/base-input.component.js +2 -2
  7. package/esm2015/lib/components/drop-down-list/drop-down-list.component.js +8 -1
  8. package/esm2015/lib/components/input-date-range-picker/input-date-range-picker.component.js +2 -1
  9. package/esm2015/lib/components/input-search/input-search.component.js +15 -7
  10. package/esm2015/lib/components/input-text/input-text.component.js +2 -2
  11. package/esm2015/lib/components/pagination/paginate.pipe.js +106 -0
  12. package/esm2015/lib/components/pagination/pagination-instance.js +2 -0
  13. package/esm2015/lib/components/pagination/pagination.component.js +194 -0
  14. package/esm2015/lib/components/pagination/pagination.module.js +26 -0
  15. package/esm2015/lib/components/pagination/pagination.service.js +88 -0
  16. package/esm2015/lib/components/simple-grid/simple-grid-cell.component.js +1 -4
  17. package/esm2015/lib/core/interface/filter-item-viewmodel.js +1 -1
  18. package/esm2015/public-api.js +3 -1
  19. package/fesm2015/colijnit-corecomponents_v12.js +426 -13
  20. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  21. package/lib/components/drop-down-list/drop-down-list.component.d.ts +3 -0
  22. package/lib/components/input-search/input-search.component.d.ts +2 -2
  23. package/lib/components/input-text/style/_layout.scss +5 -2
  24. package/lib/components/pagination/paginate.pipe.d.ts +18 -0
  25. package/lib/components/pagination/pagination-instance.d.ts +14 -0
  26. package/lib/components/pagination/pagination.component.d.ts +46 -0
  27. package/lib/components/pagination/pagination.module.d.ts +2 -0
  28. package/lib/components/pagination/pagination.service.d.ts +24 -0
  29. package/lib/components/pagination/style/_layout.scss +87 -0
  30. package/lib/components/pagination/style/_material-definition.scss +6 -0
  31. package/lib/components/pagination/style/_theme.scss +5 -0
  32. package/lib/components/pagination/style/material.scss +5 -0
  33. package/lib/components/simple-grid/simple-grid-cell.component.d.ts +2 -3
  34. package/lib/core/interface/filter-item-viewmodel.d.ts +1 -0
  35. package/package.json +1 -1
  36. package/public-api.d.ts +2 -0
@@ -17,6 +17,9 @@ export declare class DropDownListComponent extends BaseInputComponent<any> {
17
17
  */
18
18
  fields: Object;
19
19
  placeholder: string;
20
+ allowFiltering: boolean;
21
+ filterBarPlaceholder: string;
22
+ filterType: string;
20
23
  itemTemplate: TemplateRef<any>;
21
24
  headerTemplate: TemplateRef<any>;
22
25
  valueTemplate: TemplateRef<any>;
@@ -4,9 +4,9 @@ import { BaseInputComponent } from '../base/base-input.component';
4
4
  export declare class InputSearchComponent extends BaseInputComponent<string> implements OnDestroy {
5
5
  readonly searchIcon: CoreComponentsIcon;
6
6
  placeholder: string;
7
- iconRight: boolean;
8
- noIcon: boolean;
9
7
  search: EventEmitter<string>;
8
+ useLeftIcon: boolean;
9
+ useRightIcon: boolean;
10
10
  showClass(): boolean;
11
11
  handleKeyDown(event: KeyboardEvent): void;
12
12
  }
@@ -23,18 +23,21 @@
23
23
  width: calc(100% - #{$cc-item-size});
24
24
  }
25
25
  }
26
+
26
27
  &.has-right-icon {
27
28
  .input-text-right-icon {
28
29
  position: absolute;
30
+ right: 0;
29
31
  height: $cc-item-size;
30
32
  width: $cc-item-size;
31
- top: 0;
32
- right: 0;
33
33
  }
34
34
  input, label {
35
+ margin-right: $cc-item-size;
35
36
  width: calc(100% - #{$cc-item-size});
36
37
  }
37
38
  }
39
+
40
+
38
41
  &.hideArrows {
39
42
  input::-webkit-outer-spin-button,
40
43
  input::-webkit-inner-spin-button {
@@ -0,0 +1,18 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import { PaginationService } from "./pagination.service";
3
+ export declare class PaginatePipe implements PipeTransform {
4
+ private paginateService;
5
+ private state;
6
+ constructor(paginateService: PaginationService);
7
+ transform(collection: any[], args: any): any;
8
+ private _createInstance;
9
+ private _checkConfig;
10
+ /**
11
+ * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
12
+ * array for a given id. This means that the next time the pipe is run on this collection & id, we just
13
+ * need to check that the collection, start and end points are all identical, and if so, return the
14
+ * last sliced array.
15
+ */
16
+ private _saveState;
17
+ private _stateIsIdentical;
18
+ }
@@ -0,0 +1,14 @@
1
+ export interface IPaginationInstance {
2
+ id?: string;
3
+ itemsPerPage: number;
4
+ currentPage: number;
5
+ /**
6
+ * The total number of items in the collection. Only useful when
7
+ * doing server-side paging, where the collection size is limited
8
+ * to a single page returned by the server API.
9
+ *
10
+ * For in-memory paging, this property should not be set, as it
11
+ * will be automatically set to the value of collection.length.
12
+ */
13
+ totalItems?: number;
14
+ }
@@ -0,0 +1,46 @@
1
+ import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit } from '@angular/core';
2
+ import { PaginationService } from './pagination.service';
3
+ export interface IPage {
4
+ label: string;
5
+ value: any;
6
+ }
7
+ export declare class PaginationComponent implements OnInit, OnChanges, OnDestroy {
8
+ private _paginationService;
9
+ readonly template: ElementRef;
10
+ id: string;
11
+ maxSize: number;
12
+ directionLinks: boolean;
13
+ previousLabel: string;
14
+ nextLabel: string;
15
+ autoHide: boolean;
16
+ readonly pageChange: EventEmitter<number>;
17
+ showClass: boolean;
18
+ pages: IPage[];
19
+ private changeSub;
20
+ constructor(_paginationService: PaginationService);
21
+ ngOnInit(): void;
22
+ ngOnChanges(): void;
23
+ ngOnDestroy(): void;
24
+ goToFirstPage(): void;
25
+ goToPreviousPage(): void;
26
+ goToNextPage(): void;
27
+ setCurrentPage(page: number): void;
28
+ isOnFirstPage(): boolean;
29
+ isOnLastPage(): boolean;
30
+ shouldBeHidden(): boolean;
31
+ /**
32
+ * Updates the page links and checks that the current page is valid. Should run whenever the
33
+ * PaginationService.change stream emits a value matching the current ID, or when any of the
34
+ * input values changes.
35
+ */
36
+ private _updatePageLinks;
37
+ getCurrentPage(): number;
38
+ private getLastPage;
39
+ /**
40
+ * Checks that the instance.currentPage property is within bounds for the current page range.
41
+ * If not, return a correct value for currentPage, or the current value if OK.
42
+ */
43
+ private outOfBoundCorrection;
44
+ private createPageArray;
45
+ private calculatePageNumber;
46
+ }
@@ -0,0 +1,2 @@
1
+ export declare class PaginationModule {
2
+ }
@@ -0,0 +1,24 @@
1
+ import { Subject } from "rxjs";
2
+ import { IPaginationInstance } from "./pagination-instance";
3
+ export declare class PaginationService {
4
+ private static readonly DEFAULT_ID;
5
+ change: Subject<string>;
6
+ get DEFAULT_ID(): string;
7
+ private readonly instances;
8
+ constructor();
9
+ register(instance: IPaginationInstance): void;
10
+ getCurrentPage(id: string): number;
11
+ setCurrentPage(id: string, page: number): void;
12
+ setTotalItems(id: string, totalItems: number): void;
13
+ setItemsPerPage(id: string, itemsPerPage: number): void;
14
+ /**
15
+ * Returns a clone of the pagination instance object matching the id. If no
16
+ * id specified, returns the instance corresponding to the default id.
17
+ */
18
+ getInstance(id?: string): IPaginationInstance;
19
+ /**
20
+ * Check each property of the instance and update any that have changed. Return
21
+ * true if any changes were made, else return false.
22
+ */
23
+ private updateInstance;
24
+ }
@@ -0,0 +1,87 @@
1
+ @include export-module('cc-pagination-layout') {
2
+ .co-pagination {
3
+ display: block;
4
+ height: $cc-co-pagination-height;
5
+ font-family: $cc-co-pagination-font-family;
6
+ font-size: $cc-co-pagination-font-size;
7
+
8
+ .pagination-component-main-wrapper {
9
+ background: none;
10
+ display: flex;
11
+ align-items: center;
12
+ padding: 0 20px;
13
+ height: 100%;
14
+
15
+ ul.pagination {
16
+ display: flex;
17
+ justify-content: flex-end;
18
+ flex-wrap: wrap;
19
+ width: 100%;
20
+ list-style-type: none;
21
+ }
22
+
23
+ li {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ flex-grow: 0;
28
+ flex-shrink: 0;
29
+ width: 40px;
30
+ height: 40px;
31
+ cursor: default;
32
+ color: #2b60a7;
33
+ border: 1px solid $cc-co-pagination-border-color;
34
+ border-radius: 5px;
35
+ background-color: transparent;
36
+ font-size: $cc-co-pagination-font-size;
37
+ -webkit-user-select: none;
38
+ -moz-user-select: none;
39
+ -ms-user-select: none;
40
+ user-select: none;
41
+
42
+ &:not(:last-child) {
43
+ margin-right: 4px;
44
+ }
45
+ }
46
+
47
+ li.pagination-next, li.pagination-previous {
48
+ font-size: $cc-co-pagination-font-size-small;
49
+ cursor: pointer;
50
+ flex-grow: 0;
51
+ width: auto;
52
+ text-align: center;
53
+ padding: 0 15px;
54
+ }
55
+
56
+ li.pagination-next a:after {
57
+ content: '';
58
+ border: solid #2b60a7;
59
+ border-width: 0 3px 3px 0;
60
+ display: inline-block;
61
+ padding: 3px;
62
+ transform: rotate(-45deg);
63
+ -webkit-transform: rotate(-45deg);
64
+ margin-left: 5px;
65
+ }
66
+
67
+ li.pagination-previous a:before {
68
+ content: '';
69
+ border: solid #2b60a7;
70
+ border-width: 0 3px 3px 0;
71
+ display: inline-block;
72
+ padding: 3px;
73
+ transform: rotate(135deg);
74
+ -webkit-transform: rotate(135deg);
75
+ margin-right: 5px;
76
+ }
77
+
78
+ li.current {
79
+ border: 1px solid $cc-co-pagination-active-color;
80
+ font-weight: bold;
81
+ opacity: 1;
82
+ cursor: default;
83
+ }
84
+ }
85
+ }
86
+ }
87
+
@@ -0,0 +1,6 @@
1
+ $cc-co-pagination-font-family: $cc-font-family !default;
2
+ $cc-co-pagination-font-size: $cc-font-size-default !default;
3
+ $cc-co-pagination-font-size-small: $cc-font-size-small !default;
4
+ $cc-co-pagination-height: 60px !default;
5
+ $cc-co-pagination-active-color: $cc-color-action;
6
+ $cc-co-pagination-border-color: $cc-color-border;
@@ -0,0 +1,5 @@
1
+ @include export-module('cc-pagination-theme') {
2
+ .co-pagination {
3
+ }
4
+ }
5
+
@@ -0,0 +1,5 @@
1
+ @import "../../../style/mixin";
2
+ @import "../../../style/input.mixins";
3
+ @import "./material-definition";
4
+ @import "./layout";
5
+ @import "./theme";
@@ -1,6 +1,6 @@
1
- import { ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
2
  import { ColumnAlign, SimpleGridColumnDirective } from "./simple-grid-column.directive";
3
- export declare class SimpleGridCellComponent implements OnChanges {
3
+ export declare class SimpleGridCellComponent {
4
4
  private _changeDetector;
5
5
  readonly defaultTextAlign: ColumnAlign;
6
6
  set editTemplateContent(template: any);
@@ -20,7 +20,6 @@ export declare class SimpleGridCellComponent implements OnChanges {
20
20
  private _template;
21
21
  private _inputTemplate;
22
22
  constructor(_changeDetector: ChangeDetectorRef);
23
- ngOnChanges(changes: SimpleChanges): void;
24
23
  private _setFocusComponent;
25
24
  private _getFirstFormInput;
26
25
  private _createNewEvent;
@@ -3,4 +3,5 @@ export interface FilterItemViewmodel {
3
3
  code: string | number;
4
4
  description: string;
5
5
  count?: number;
6
+ valueName?: string;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/corecomponents_v12",
3
- "version": "12.0.46",
3
+ "version": "12.0.49",
4
4
  "description": "Colijn IT core components for Angular 12",
5
5
  "private": false,
6
6
  "peerDependencies": {
package/public-api.d.ts CHANGED
@@ -90,3 +90,5 @@ export * from './lib/components/filter-item/filter-item.component';
90
90
  export * from './lib/components/filter-item/filter-item.module';
91
91
  export * from './lib/directives/clickoutside/clickoutside.module';
92
92
  export * from './lib/directives/observe-visibility/observe-visibility.module';
93
+ export * from './lib/components/pagination/pagination.component';
94
+ export * from './lib/components/pagination/pagination.module';