ngx-sfc-common 0.0.2 → 0.0.3

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 (94) hide show
  1. package/README.md +191 -7
  2. package/_ngx-sfc-common.styles.scss +53 -14
  3. package/esm2020/lib/components/button/button.component.mjs +4 -4
  4. package/esm2020/lib/components/checkmark/checkmark.component.mjs +4 -4
  5. package/esm2020/lib/components/close/close.component.mjs +11 -0
  6. package/esm2020/lib/components/delimeter/delimeter.component.mjs +4 -4
  7. package/esm2020/lib/components/dots/dots.component.mjs +4 -4
  8. package/esm2020/lib/components/hamburger/hamburger.component.mjs +3 -3
  9. package/esm2020/lib/components/index.mjs +7 -1
  10. package/esm2020/lib/components/loader/bounce/bounce-loader.component.mjs +3 -3
  11. package/esm2020/lib/components/loader/circle/circle-loader.component.mjs +3 -3
  12. package/esm2020/lib/components/loader/loader-base.component.mjs +3 -3
  13. package/esm2020/lib/components/loader/service/loader.service.mjs +3 -3
  14. package/esm2020/lib/components/modal/directive/modal-open-on-click.directive.mjs +3 -3
  15. package/esm2020/lib/components/modal/footer/default/default-modal-footer.component.mjs +3 -3
  16. package/esm2020/lib/components/modal/header/default/default-modal-header.component.mjs +7 -6
  17. package/esm2020/lib/components/modal/modal.component.mjs +8 -21
  18. package/esm2020/lib/components/modal/service/modal.service.mjs +3 -3
  19. package/esm2020/lib/components/pagination/models/pagination-view.model.mjs +2 -0
  20. package/esm2020/lib/components/pagination/pagination.component.mjs +100 -0
  21. package/esm2020/lib/components/pagination/pagination.constants.mjs +6 -0
  22. package/esm2020/lib/components/pagination/service/pagination.event.mjs +2 -0
  23. package/esm2020/lib/components/pagination/service/pagination.service.mjs +47 -0
  24. package/esm2020/lib/components/sorting/service/sorting.event.mjs +2 -0
  25. package/esm2020/lib/components/sorting/service/sorting.service.mjs +21 -0
  26. package/esm2020/lib/components/sorting/sorting.component.mjs +70 -0
  27. package/esm2020/lib/components/sorting/sorting.constants.mjs +5 -0
  28. package/esm2020/lib/components/sorting/sorting.model.mjs +2 -0
  29. package/esm2020/lib/components/template-content/template-content.component.mjs +31 -0
  30. package/esm2020/lib/components/toggle-switcher/toggle-switcher.component.mjs +4 -4
  31. package/esm2020/lib/components/tooltip/tooltip.component.mjs +4 -4
  32. package/esm2020/lib/constants/common.constants.mjs +2 -1
  33. package/esm2020/lib/constants/ui.constants.mjs +6 -3
  34. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  35. package/esm2020/lib/directives/component-size/component-size.directive.mjs +3 -3
  36. package/esm2020/lib/directives/destroy-parent/destroy-parent.directive.mjs +27 -0
  37. package/esm2020/lib/directives/index.mjs +2 -1
  38. package/esm2020/lib/directives/mouse-down/mouse-down.directive.mjs +3 -3
  39. package/esm2020/lib/directives/show-hide-element/show-hide-element.directive.mjs +3 -3
  40. package/esm2020/lib/directives/template-reference/template-reference.directive.mjs +3 -3
  41. package/esm2020/lib/directives/throw-element-on-hover/throw-element-on-hover.directive.mjs +3 -3
  42. package/esm2020/lib/enums/direction.enum.mjs +9 -0
  43. package/esm2020/lib/enums/index.mjs +8 -2
  44. package/esm2020/lib/enums/media.enum.mjs +10 -0
  45. package/esm2020/lib/enums/position.enum.mjs +12 -0
  46. package/esm2020/lib/enums/size.enum.mjs +11 -0
  47. package/esm2020/lib/enums/sorting-direction.enum.mjs +9 -0
  48. package/esm2020/lib/enums/theme.enum.mjs +9 -0
  49. package/esm2020/lib/enums/ui.enum.mjs +27 -0
  50. package/esm2020/lib/ngx-sfc-common.module.mjs +47 -39
  51. package/esm2020/lib/services/document-ref.service.mjs +6 -5
  52. package/esm2020/lib/services/resize.service.mjs +3 -3
  53. package/esm2020/lib/services/window-ref.service.mjs +3 -3
  54. package/esm2020/lib/utils/collections.utils.mjs +2 -2
  55. package/esm2020/lib/utils/common.utils.mjs +10 -2
  56. package/esm2020/lib/utils/index.mjs +3 -3
  57. package/esm2020/lib/utils/ui.utils.mjs +35 -1
  58. package/fesm2015/ngx-sfc-common.mjs +551 -206
  59. package/fesm2015/ngx-sfc-common.mjs.map +1 -1
  60. package/fesm2020/ngx-sfc-common.mjs +550 -205
  61. package/fesm2020/ngx-sfc-common.mjs.map +1 -1
  62. package/lib/components/close/close.component.d.ts +5 -0
  63. package/lib/components/index.d.ts +9 -0
  64. package/lib/components/modal/modal.component.d.ts +3 -4
  65. package/lib/components/pagination/models/pagination-view.model.d.ts +12 -0
  66. package/lib/components/pagination/pagination.component.d.ts +29 -0
  67. package/lib/components/pagination/pagination.constants.d.ts +5 -0
  68. package/lib/components/pagination/service/pagination.event.d.ts +6 -0
  69. package/lib/components/pagination/service/pagination.service.d.ts +25 -0
  70. package/lib/components/sorting/service/sorting.event.d.ts +5 -0
  71. package/lib/components/sorting/service/sorting.service.d.ts +9 -0
  72. package/lib/components/sorting/sorting.component.d.ts +21 -0
  73. package/lib/components/sorting/sorting.constants.d.ts +4 -0
  74. package/lib/components/sorting/sorting.model.d.ts +11 -0
  75. package/lib/components/template-content/template-content.component.d.ts +14 -0
  76. package/lib/constants/common.constants.d.ts +1 -0
  77. package/lib/constants/ui.constants.d.ts +5 -2
  78. package/lib/directives/destroy-parent/destroy-parent.directive.d.ts +10 -0
  79. package/lib/directives/index.d.ts +1 -0
  80. package/lib/enums/direction.enum.d.ts +7 -0
  81. package/lib/enums/index.d.ts +7 -1
  82. package/lib/enums/media.enum.d.ts +8 -0
  83. package/lib/enums/position.enum.d.ts +10 -0
  84. package/lib/enums/size.enum.d.ts +9 -0
  85. package/lib/enums/sorting-direction.enum.d.ts +7 -0
  86. package/lib/enums/theme.enum.d.ts +7 -0
  87. package/lib/enums/ui.enum.d.ts +24 -0
  88. package/lib/ngx-sfc-common.module.d.ts +21 -16
  89. package/lib/utils/common.utils.d.ts +6 -0
  90. package/lib/utils/index.d.ts +2 -2
  91. package/lib/utils/ui.utils.d.ts +21 -0
  92. package/package.json +14 -17
  93. package/esm2020/lib/enums/common.enums.mjs +0 -69
  94. package/lib/enums/common.enums.d.ts +0 -61
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CloseComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<CloseComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<CloseComponent, "sfc-close", never, {}, {}, never, never>;
5
+ }
@@ -19,3 +19,12 @@ export { DotsComponent } from './dots/dots.component';
19
19
  export { ToggleSwitcherComponent } from './toggle-switcher/toggle-switcher.component';
20
20
  export { IToggleSwitcherModel } from './toggle-switcher/toggle-switcher.model';
21
21
  export { CheckmarkComponent } from './checkmark/checkmark.component';
22
+ export { TemplateContentComponent } from './template-content/template-content.component';
23
+ export { CloseComponent } from './close/close.component';
24
+ export { PaginationComponent } from './pagination/pagination.component';
25
+ export { PaginationService } from './pagination/service/pagination.service';
26
+ export { IPaginationEvent } from './pagination/service/pagination.event';
27
+ export { SortingComponent } from './sorting/sorting.component';
28
+ export { SortingService } from './sorting/service/sorting.service';
29
+ export { ISortingModel } from './sorting/sorting.model';
30
+ export { ISortingEvent } from './sorting/service/sorting.event';
@@ -1,4 +1,5 @@
1
- import { TemplateRef } from '@angular/core';
1
+ import { QueryList, TemplateRef } from '@angular/core';
2
+ import { TemplateReferenceDirective } from '../../directives';
2
3
  import { IDefaultModalFooterModel } from './footer/default/default-modal-footer.model';
3
4
  import { IDefaultModalHeaderModel } from './header/default/default-modal-header.model';
4
5
  import { ModalTemplate } from './modal-template.enum';
@@ -15,10 +16,8 @@ export declare class ModalComponent {
15
16
  hideOnEsc: boolean;
16
17
  hideOnClickOutside: boolean;
17
18
  onEscapeKeyDownHandler(): void;
18
- private templates;
19
+ templates: QueryList<TemplateReferenceDirective> | undefined;
19
20
  constructor(modalService: ModalService);
20
- getTemplate(template: ModalTemplate): TemplateRef<any> | null;
21
- isShowDefault(template: ModalTemplate): boolean;
22
21
  close(): void;
23
22
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
24
23
  static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "sfc-modal", never, { "body": "body"; "header": "header"; "footer": "footer"; "defaultHeaderModel": "defaultHeaderModel"; "defaultFooterModel": "defaultFooterModel"; "hideOnEsc": "hideOnEsc"; "hideOnClickOutside": "hideOnClickOutside"; }, {}, ["templates"], never>;
@@ -0,0 +1,12 @@
1
+ export interface IPaginationViewModel {
2
+ range: number[];
3
+ page: number;
4
+ next: number;
5
+ previous: number;
6
+ total: number;
7
+ any: boolean;
8
+ firstPage: boolean;
9
+ lastPage: boolean;
10
+ previousPage: boolean;
11
+ nextPage: boolean;
12
+ }
@@ -0,0 +1,29 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { IPaginationViewModel } from './models/pagination-view.model';
4
+ import { PaginationService } from './service/pagination.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class PaginationComponent implements OnInit {
7
+ private service;
8
+ count: number;
9
+ /**
10
+ * show full range of data
11
+ */
12
+ full: boolean;
13
+ /**
14
+ * show first and last page's btn
15
+ */
16
+ limits: boolean;
17
+ data$: Observable<any[]>;
18
+ vm$: Observable<IPaginationViewModel>;
19
+ constructor(service: PaginationService);
20
+ ngOnInit(): void;
21
+ onPageClick(page: number): void;
22
+ private get showLimitPages();
23
+ private showStartLimit;
24
+ private showEndLimit;
25
+ private initRange;
26
+ private range;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "sfc-pagination", never, { "count": "count"; "full": "full"; "limits": "limits"; "data$": "data$"; }, {}, never, never>;
29
+ }
@@ -0,0 +1,5 @@
1
+ export declare class PaginationConstants {
2
+ static DEFAULT_SIZE: number;
3
+ static DEFAULT_PAGE: number;
4
+ static DEFAULT_COUNT: number;
5
+ }
@@ -0,0 +1,6 @@
1
+ export interface IPaginationEvent {
2
+ page: number;
3
+ next: number;
4
+ previous: number;
5
+ total: number;
6
+ }
@@ -0,0 +1,25 @@
1
+ import { Observable } from 'rxjs';
2
+ import { IPaginationEvent } from './pagination.event';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PaginationService {
5
+ /**
6
+ * Handle page changing
7
+ */
8
+ private pageSubject;
9
+ private page$;
10
+ /** Total items */
11
+ total$: Observable<number>;
12
+ /** Total pages */
13
+ totalPages$: Observable<number>;
14
+ /** Pagination event data */
15
+ pagination$: Observable<IPaginationEvent>;
16
+ /** Need for init pagination observables */
17
+ init(data$: Observable<any[]>, page?: number, pageSize?: number): void;
18
+ /**
19
+ * Move to page
20
+ */
21
+ page(page: number): void;
22
+ private initObservables;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
25
+ }
@@ -0,0 +1,5 @@
1
+ import { SortingDirection } from "../../../enums";
2
+ export interface ISortingEvent {
3
+ id: string;
4
+ direction: SortingDirection;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { ISortingEvent } from './sorting.event';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SortingService {
4
+ private sortingSubject;
5
+ sorting$: import("rxjs").Observable<ISortingEvent>;
6
+ sort(event: ISortingEvent): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortingService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<SortingService>;
9
+ }
@@ -0,0 +1,21 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { SortingDirection } from '../../enums';
3
+ import { SortingService } from './service/sorting.service';
4
+ import { ISortingModel } from './sorting.model';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SortingComponent implements OnInit, OnDestroy {
7
+ private service;
8
+ SortingDirection: typeof SortingDirection;
9
+ id: string;
10
+ model: ISortingModel;
11
+ get enabled(): boolean;
12
+ get active(): boolean;
13
+ sort(): void;
14
+ get icon(): string;
15
+ private _subscription;
16
+ constructor(service: SortingService);
17
+ ngOnInit(): void;
18
+ ngOnDestroy(): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortingComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<SortingComponent, "sfc-sorting", never, { "id": "id"; "model": "model"; }, {}, never, ["*"]>;
21
+ }
@@ -0,0 +1,4 @@
1
+ export declare class SortingConstants {
2
+ static DEFAULT_ASCENDING_ICON: string;
3
+ static DEFAULT_DESCENDING_ICON: string;
4
+ }
@@ -0,0 +1,11 @@
1
+ import { SortingDirection } from "../../enums";
2
+ export interface ISortingModel {
3
+ enabled: boolean;
4
+ active?: boolean;
5
+ direction: SortingDirection;
6
+ icons?: ISortingIcon[];
7
+ }
8
+ export interface ISortingIcon {
9
+ direction: SortingDirection;
10
+ icon: string;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { QueryList, TemplateRef } from '@angular/core';
2
+ import { TemplateReferenceDirective } from '../../directives';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TemplateContentComponent {
5
+ contextData?: any;
6
+ referenceContent?: TemplateRef<any>;
7
+ templateType?: string;
8
+ templatesContent: QueryList<TemplateReferenceDirective> | undefined;
9
+ defaultContent?: TemplateRef<any>;
10
+ get showDefault(): boolean;
11
+ get templateContent(): TemplateRef<any> | null;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<TemplateContentComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<TemplateContentComponent, "sfc-template-content", never, { "contextData": "contextData"; "referenceContent": "referenceContent"; "templateType": "templateType"; "templatesContent": "templatesContent"; "defaultContent": "defaultContent"; }, {}, never, never>;
14
+ }
@@ -2,4 +2,5 @@ export declare class CommonConstants {
2
2
  static NOT_FOUND_INDEX: number;
3
3
  static EMPTY_STRING: string;
4
4
  static MOUSE_BUTTON_LEFT: number;
5
+ static FULL_PERCENTAGE: number;
5
6
  }
@@ -5,11 +5,14 @@ export declare class UIConstants {
5
5
  static CSS_EM: string;
6
6
  static CSS_VISIBILITY_VISIBLE: string;
7
7
  static CSS_VISIBILITY_HIDDEN: string;
8
- static DEFAULT_THEME: string;
9
- static DARK_THEME: string;
10
8
  static CSS_WIDTH: string;
11
9
  static CSS_LEFT: string;
10
+ static CSS_RIGHT: string;
11
+ static CSS_START: string;
12
+ static CSS_END: string;
13
+ static CSS_CENTER: string;
12
14
  static CSS_CLASS_FIXED: string;
13
15
  static CSS_CLASS_BACKGROUND: string;
14
16
  static CSS_CLASS_TOP: string;
17
+ static RGB_OPACITY_PLACEHOLDER: string;
15
18
  }
@@ -0,0 +1,10 @@
1
+ import { ElementRef } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class DestroyParentDirective {
4
+ private el;
5
+ set destroyParent(value: boolean);
6
+ delay: number;
7
+ constructor(el: ElementRef);
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DestroyParentDirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DestroyParentDirective, "[sfcDestroyParent]", never, { "destroyParent": "sfcDestroyParent"; "delay": "delay"; }, {}, never>;
10
+ }
@@ -5,3 +5,4 @@ export { ThrowElementOnHoverDirective } from './throw-element-on-hover/throw-ele
5
5
  export { TemplateReferenceDirective } from './template-reference/template-reference.directive';
6
6
  export { MouseDownDirective } from './mouse-down/mouse-down.directive';
7
7
  export { ComponentSizeDirective } from './component-size/component-size.directive';
8
+ export { DestroyParentDirective } from './destroy-parent/destroy-parent.directive';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Direction types
3
+ */
4
+ export declare enum Direction {
5
+ Horizontal = "horizontal",
6
+ Vertical = "vertical"
7
+ }
@@ -1 +1,7 @@
1
- export { SortingDirection, UIClass, ComponentSize, Position, MediaLimits, Direction } from './common.enums';
1
+ export { ComponentSize } from './size.enum';
2
+ export { Direction } from './direction.enum';
3
+ export { MediaLimits } from './media.enum';
4
+ export { Position } from './position.enum';
5
+ export { SortingDirection } from './sorting-direction.enum';
6
+ export { Theme } from './theme.enum';
7
+ export { UIClass } from './ui.enum';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CSS Media limits
3
+ */
4
+ export declare enum MediaLimits {
5
+ Laptop = 1200,
6
+ Tablet = 767,
7
+ Phone = 430
8
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Position directions
3
+ */
4
+ export declare enum Position {
5
+ Top = "top",
6
+ Bottom = "bottom",
7
+ Left = "left",
8
+ Right = "right",
9
+ Center = "center"
10
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Component sizes
3
+ */
4
+ export declare enum ComponentSize {
5
+ Small = "small",
6
+ Medium = "medium",
7
+ Large = "large",
8
+ Custom = "custom"
9
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type of sorting
3
+ */
4
+ export declare enum SortingDirection {
5
+ Ascending = "ascending",
6
+ Descending = "descending"
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Theme types
3
+ */
4
+ export declare enum Theme {
5
+ Default = "sfc-default-theme",
6
+ Dark = "sfc-dark-theme"
7
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * UI classes
3
+ */
4
+ export declare enum UIClass {
5
+ Active = "active",
6
+ Valid = "valid",
7
+ Invalid = "invalid",
8
+ Enabled = "enabled",
9
+ Disabled = "disabled",
10
+ Selected = "selected",
11
+ Empty = "empty",
12
+ Focus = "focus",
13
+ Open = "open",
14
+ Loading = "loading",
15
+ Removed = "removed",
16
+ Visible = "visible",
17
+ Hidden = "hidden",
18
+ Animated = "animated",
19
+ Expanded = "expanded",
20
+ Fixed = "fixed",
21
+ Bordered = "bordered",
22
+ Even = "even",
23
+ Pointer = "pointer"
24
+ }
@@ -5,23 +5,28 @@ import * as i3 from "./directives/throw-element-on-hover/throw-element-on-hover.
5
5
  import * as i4 from "./directives/template-reference/template-reference.directive";
6
6
  import * as i5 from "./directives/mouse-down/mouse-down.directive";
7
7
  import * as i6 from "./directives/component-size/component-size.directive";
8
- import * as i7 from "./components/button/button.component";
9
- import * as i8 from "./components/tooltip/tooltip.component";
10
- import * as i9 from "./components/delimeter/delimeter.component";
11
- import * as i10 from "./components/loader/bounce/bounce-loader.component";
12
- import * as i11 from "./components/loader/circle/circle-loader.component";
13
- import * as i12 from "./components/modal/modal.component";
14
- import * as i13 from "./components/modal/directive/modal-open-on-click.directive";
15
- import * as i14 from "./components/modal/header/default/default-modal-header.component";
16
- import * as i15 from "./components/modal/footer/default/default-modal-footer.component";
17
- import * as i16 from "./components/hamburger/hamburger.component";
18
- import * as i17 from "./components/dots/dots.component";
19
- import * as i18 from "./components/toggle-switcher/toggle-switcher.component";
20
- import * as i19 from "./components/checkmark/checkmark.component";
21
- import * as i20 from "@angular/common";
22
- import * as i21 from "@angular/platform-browser/animations";
8
+ import * as i7 from "./directives/destroy-parent/destroy-parent.directive";
9
+ import * as i8 from "./components/button/button.component";
10
+ import * as i9 from "./components/tooltip/tooltip.component";
11
+ import * as i10 from "./components/delimeter/delimeter.component";
12
+ import * as i11 from "./components/toggle-switcher/toggle-switcher.component";
13
+ import * as i12 from "./components/checkmark/checkmark.component";
14
+ import * as i13 from "./components/template-content/template-content.component";
15
+ import * as i14 from "./components/close/close.component";
16
+ import * as i15 from "./components/hamburger/hamburger.component";
17
+ import * as i16 from "./components/dots/dots.component";
18
+ import * as i17 from "./components/pagination/pagination.component";
19
+ import * as i18 from "./components/sorting/sorting.component";
20
+ import * as i19 from "./components/loader/bounce/bounce-loader.component";
21
+ import * as i20 from "./components/loader/circle/circle-loader.component";
22
+ import * as i21 from "./components/modal/modal.component";
23
+ import * as i22 from "./components/modal/directive/modal-open-on-click.directive";
24
+ import * as i23 from "./components/modal/header/default/default-modal-header.component";
25
+ import * as i24 from "./components/modal/footer/default/default-modal-footer.component";
26
+ import * as i25 from "@angular/common";
27
+ import * as i26 from "@angular/platform-browser/animations";
23
28
  export declare class NgxSfcCommonModule {
24
29
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSfcCommonModule, never>;
25
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSfcCommonModule, [typeof i1.ClickOutsideDirective, typeof i2.ShowHideElementDirective, typeof i3.ThrowElementOnHoverDirective, typeof i4.TemplateReferenceDirective, typeof i5.MouseDownDirective, typeof i6.ComponentSizeDirective, typeof i7.ButtonComponent, typeof i8.TooltipComponent, typeof i9.DelimeterComponent, typeof i10.BounceLoaderComponent, typeof i11.CircleLoaderComponent, typeof i12.ModalComponent, typeof i13.ModalOpenOnClickDirective, typeof i14.DefaultModalHeaderComponent, typeof i15.DefaultModalFooterComponent, typeof i16.HamburgerComponent, typeof i17.DotsComponent, typeof i18.ToggleSwitcherComponent, typeof i19.CheckmarkComponent], [typeof i20.CommonModule, typeof i21.BrowserAnimationsModule], [typeof i1.ClickOutsideDirective, typeof i2.ShowHideElementDirective, typeof i3.ThrowElementOnHoverDirective, typeof i4.TemplateReferenceDirective, typeof i5.MouseDownDirective, typeof i6.ComponentSizeDirective, typeof i7.ButtonComponent, typeof i8.TooltipComponent, typeof i9.DelimeterComponent, typeof i10.BounceLoaderComponent, typeof i11.CircleLoaderComponent, typeof i12.ModalComponent, typeof i13.ModalOpenOnClickDirective, typeof i14.DefaultModalHeaderComponent, typeof i15.DefaultModalFooterComponent, typeof i16.HamburgerComponent, typeof i17.DotsComponent, typeof i18.ToggleSwitcherComponent, typeof i19.CheckmarkComponent]>;
30
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSfcCommonModule, [typeof i1.ClickOutsideDirective, typeof i2.ShowHideElementDirective, typeof i3.ThrowElementOnHoverDirective, typeof i4.TemplateReferenceDirective, typeof i5.MouseDownDirective, typeof i6.ComponentSizeDirective, typeof i7.DestroyParentDirective, typeof i8.ButtonComponent, typeof i9.TooltipComponent, typeof i10.DelimeterComponent, typeof i11.ToggleSwitcherComponent, typeof i12.CheckmarkComponent, typeof i13.TemplateContentComponent, typeof i14.CloseComponent, typeof i15.HamburgerComponent, typeof i16.DotsComponent, typeof i17.PaginationComponent, typeof i18.SortingComponent, typeof i19.BounceLoaderComponent, typeof i20.CircleLoaderComponent, typeof i21.ModalComponent, typeof i22.ModalOpenOnClickDirective, typeof i23.DefaultModalHeaderComponent, typeof i24.DefaultModalFooterComponent], [typeof i25.CommonModule, typeof i26.BrowserAnimationsModule], [typeof i1.ClickOutsideDirective, typeof i2.ShowHideElementDirective, typeof i3.ThrowElementOnHoverDirective, typeof i4.TemplateReferenceDirective, typeof i5.MouseDownDirective, typeof i6.ComponentSizeDirective, typeof i7.DestroyParentDirective, typeof i8.ButtonComponent, typeof i9.TooltipComponent, typeof i10.DelimeterComponent, typeof i14.CloseComponent, typeof i12.CheckmarkComponent, typeof i13.TemplateContentComponent, typeof i11.ToggleSwitcherComponent, typeof i16.DotsComponent, typeof i15.HamburgerComponent, typeof i17.PaginationComponent, typeof i18.SortingComponent, typeof i19.BounceLoaderComponent, typeof i20.CircleLoaderComponent, typeof i21.ModalComponent, typeof i22.ModalOpenOnClickDirective, typeof i23.DefaultModalHeaderComponent, typeof i24.DefaultModalFooterComponent]>;
26
31
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxSfcCommonModule>;
27
32
  }
@@ -48,3 +48,9 @@ export declare function mergeDeep(target: any, ...sources: any[]): any;
48
48
  * @returns Type's property name
49
49
  */
50
50
  export declare const nameof: <T>(name: keyof T) => keyof T;
51
+ /**
52
+ * Determines if the input is a Number or something that can be coerced to a Number
53
+ * @param - The input to be tested
54
+ * @returns - An indication if the input is a Number or can be coerced to a Number
55
+ */
56
+ export declare function isNumeric(number: any): boolean;
@@ -1,6 +1,6 @@
1
- export { isDefined, isObject, isAsyncData, addPropertyToObject, removePropertyFromObject, mergeDeep, nameof } from './common.utils';
1
+ export { isDefined, isObject, isAsyncData, addPropertyToObject, removePropertyFromObject, mergeDeep, nameof, isNumeric } from './common.utils';
2
2
  export { isNullOrEmptyString, contains, trim } from './string.utils';
3
3
  export { setMinutes, setHours, setDay, setYear, getNextMonth, getPreviousMonth, getNextYear, getPreviousYear, getFirstDayOfMonth, getLastDayOfMonth, getFirstDayOfYear, getLastDayOfYear, getFirstDayOfMonthByYearAndMonth, getLastDayOfMonthByYearAndMonth, getWeeksNumberInMonth, isEqualDates, isDateGreat, isDateGreatOrEqual, isDateTimeGreat, isDateTimeGreatOrEqual } from './date-time.utils';
4
4
  export { parseFileSize, getFileExtension, readAsDataURL, isImage } from './file.utils';
5
- export { getCssLikeValue, getValueFromCssLikeValue, getCalcValue, addClasses, removeClasses } from './ui.utils';
5
+ export { getCssLikeValue, getValueFromCssLikeValue, getCalcValue, addClasses, removeClasses, rgbToHex, hexToRgb, replaceRgbOpacity } from './ui.utils';
6
6
  export { any, hasItem, hasItemBy, hasObjectItem, firstOrDefault, firstItem, lastItem, all, where, skip, sortBy, sortByPath, distinct, sum, max, remove, addItem, removeItem, updateItem, getCollectionOrEmpty } from './collections.utils';
@@ -29,3 +29,24 @@ export declare function addClasses(element: HTMLElement, ...classNames: Array<st
29
29
  * @param classNames Array of CSS classes
30
30
  */
31
31
  export declare function removeClasses(element: HTMLElement, ...classNames: Array<string>): void;
32
+ /**
33
+ * Convert RGB color to HEX
34
+ * @param r Red
35
+ * @param g Green
36
+ * @param b Blue
37
+ * @returns HEX value
38
+ */
39
+ export declare function rgbToHex(r: number, g: number, b: number): string;
40
+ /**
41
+ * Convert HEX to RGB value
42
+ * @param hex HEX value
43
+ * @returns RGB value
44
+ */
45
+ export declare function hexToRgb(hex: string): string | null;
46
+ /**
47
+ * Set opacity for RGB value
48
+ * @param rgb Rgb value with {opacity} placeholder
49
+ * @param opacity Opacity value
50
+ * @returns RGB value with relevant opacity
51
+ */
52
+ export declare function replaceRgbOpacity(rgb: string, opacity: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-sfc-common",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Angular common(shared) library for SFC project",
5
5
  "keywords": [
6
6
  "Street Football Club",
@@ -23,22 +23,6 @@
23
23
  "url": "https://github.com/1kriva1/ngx-sfc/issues"
24
24
  },
25
25
  "license": "MIT",
26
- "exports": {
27
- "./styles/variables": {
28
- "sass": "./src/lib/components/shared/styles/_variables.scss"
29
- },
30
- "./package.json": {
31
- "default": "./package.json"
32
- },
33
- ".": {
34
- "types": "./ngx-sfc-common.d.ts",
35
- "esm2020": "./esm2020/ngx-sfc-common.mjs",
36
- "es2020": "./fesm2020/ngx-sfc-common.mjs",
37
- "es2015": "./fesm2015/ngx-sfc-common.mjs",
38
- "node": "./fesm2015/ngx-sfc-common.mjs",
39
- "default": "./fesm2020/ngx-sfc-common.mjs"
40
- }
41
- },
42
26
  "peerDependencies": {
43
27
  "@angular/common": "^13.2.0",
44
28
  "@angular/core": "^13.2.0"
@@ -52,5 +36,18 @@
52
36
  "fesm2020": "fesm2020/ngx-sfc-common.mjs",
53
37
  "fesm2015": "fesm2015/ngx-sfc-common.mjs",
54
38
  "typings": "ngx-sfc-common.d.ts",
39
+ "exports": {
40
+ "./package.json": {
41
+ "default": "./package.json"
42
+ },
43
+ ".": {
44
+ "types": "./ngx-sfc-common.d.ts",
45
+ "esm2020": "./esm2020/ngx-sfc-common.mjs",
46
+ "es2020": "./fesm2020/ngx-sfc-common.mjs",
47
+ "es2015": "./fesm2015/ngx-sfc-common.mjs",
48
+ "node": "./fesm2015/ngx-sfc-common.mjs",
49
+ "default": "./fesm2020/ngx-sfc-common.mjs"
50
+ }
51
+ },
55
52
  "sideEffects": false
56
53
  }
@@ -1,69 +0,0 @@
1
- /**
2
- * Component sizes
3
- */
4
- export var ComponentSize;
5
- (function (ComponentSize) {
6
- ComponentSize["Small"] = "small";
7
- ComponentSize["Medium"] = "medium";
8
- ComponentSize["Large"] = "large";
9
- ComponentSize["Custom"] = "custom";
10
- })(ComponentSize || (ComponentSize = {}));
11
- /**
12
- * Type of sorting
13
- */
14
- export var SortingDirection;
15
- (function (SortingDirection) {
16
- SortingDirection["Ascending"] = "ascending";
17
- SortingDirection["Descending"] = "descending";
18
- })(SortingDirection || (SortingDirection = {}));
19
- /**
20
- * UI classes
21
- */
22
- export var UIClass;
23
- (function (UIClass) {
24
- UIClass["Active"] = "active";
25
- UIClass["Valid"] = "valid";
26
- UIClass["Invalid"] = "invalid";
27
- UIClass["Enabled"] = "enabled";
28
- UIClass["Disabled"] = "disabled";
29
- UIClass["Selected"] = "selected";
30
- UIClass["Empty"] = "empty";
31
- UIClass["Focus"] = "focus";
32
- UIClass["Open"] = "open";
33
- UIClass["Loading"] = "loading";
34
- UIClass["Removed"] = "removed";
35
- UIClass["Visible"] = "visible";
36
- UIClass["Hidden"] = "hidden";
37
- UIClass["Animated"] = "animated";
38
- UIClass["Expanded"] = "expanded";
39
- UIClass["Fixed"] = "fixed";
40
- })(UIClass || (UIClass = {}));
41
- ;
42
- /**
43
- * Position directions
44
- */
45
- export var Position;
46
- (function (Position) {
47
- Position["Top"] = "top";
48
- Position["Bottom"] = "bottom";
49
- Position["Left"] = "left";
50
- Position["Right"] = "right";
51
- })(Position || (Position = {}));
52
- /**
53
- * CSS Media limits
54
- */
55
- export var MediaLimits;
56
- (function (MediaLimits) {
57
- MediaLimits[MediaLimits["Laptop"] = 1200] = "Laptop";
58
- MediaLimits[MediaLimits["Tablet"] = 767] = "Tablet";
59
- MediaLimits[MediaLimits["Phone"] = 430] = "Phone";
60
- })(MediaLimits || (MediaLimits = {}));
61
- /**
62
- * Direction types
63
- */
64
- export var Direction;
65
- (function (Direction) {
66
- Direction["Horizontal"] = "horizontal";
67
- Direction["Vertical"] = "vertical";
68
- })(Direction || (Direction = {}));
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLmVudW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNmYy1jb21tb24vc3JjL2xpYi9lbnVtcy9jb21tb24uZW51bXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0E7O0dBRUc7QUFDSCxNQUFNLENBQU4sSUFBWSxhQUtYO0FBTEQsV0FBWSxhQUFhO0lBQ3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gICAgRW1wdHkgPSAnZW1wdHknLFxyXG4gICAgRm9jdXMgPSAnZm9jdXMnLFxyXG4gICAgT3BlbiA9ICdvcGVuJyxcclxuICAgIExvYWRpbmcgPSAnbG9hZGluZycsXHJcbiAgICBSZW1vdmVkID0gJ3JlbW92ZWQnLFxyXG4gICAgVmlzaWJsZSA9ICd2aXNpYmxlJyxcclxuICAgIEhpZGRlbiA9ICdoaWRkZW4nLFxyXG4gICAgQW5pbWF0ZWQgPSAnYW5pbWF0ZWQnLFxyXG4gICAgRXhwYW5kZWQgPSAnZXhwYW5kZWQnLFxyXG4gICAgRml4ZWQgPSAnZml4ZWQnXHJcbn07XHJcblxyXG4vKipcclxuICogUG9zaXRpb24gZGlyZWN0aW9uc1xyXG4gKi9cclxuZXhwb3J0IGVudW0gUG9zaXRpb24ge1xyXG4gICAgVG9wID0gJ3RvcCcsXHJcbiAgICBCb3R0b20gPSAnYm90dG9tJyxcclxuICAgIExlZnQgPSAnbGVmdCcsXHJcbiAgICBSaWdodCA9ICdyaWdodCdcclxufVxyXG5cclxuLyoqXHJcbiAqIENTUyBNZWRpYSBsaW1pdHNcclxuICovXHJcbmV4cG9ydCBlbnVtIE1lZGlhTGltaXRzIHtcclxuICAgIExhcHRvcCA9IDEyMDAsXHJcbiAgICBUYWJsZXQgPSA3NjcsXHJcbiAgICBQaG9uZSA9IDQzMFxyXG59XHJcblxyXG4vKipcclxuICogRGlyZWN0aW9uIHR5cGVzXHJcbiAqL1xyXG5leHBvcnQgZW51bSBEaXJlY3Rpb24ge1xyXG4gICAgSG9yaXpvbnRhbCA9ICdob3Jpem9udGFsJyxcclxuICAgIFZlcnRpY2FsID0gJ3ZlcnRpY2FsJ1xyXG59Il19
@@ -1,61 +0,0 @@
1
- /**
2
- * Component sizes
3
- */
4
- export declare enum ComponentSize {
5
- Small = "small",
6
- Medium = "medium",
7
- Large = "large",
8
- Custom = "custom"
9
- }
10
- /**
11
- * Type of sorting
12
- */
13
- export declare enum SortingDirection {
14
- Ascending = "ascending",
15
- Descending = "descending"
16
- }
17
- /**
18
- * UI classes
19
- */
20
- export declare enum UIClass {
21
- Active = "active",
22
- Valid = "valid",
23
- Invalid = "invalid",
24
- Enabled = "enabled",
25
- Disabled = "disabled",
26
- Selected = "selected",
27
- Empty = "empty",
28
- Focus = "focus",
29
- Open = "open",
30
- Loading = "loading",
31
- Removed = "removed",
32
- Visible = "visible",
33
- Hidden = "hidden",
34
- Animated = "animated",
35
- Expanded = "expanded",
36
- Fixed = "fixed"
37
- }
38
- /**
39
- * Position directions
40
- */
41
- export declare enum Position {
42
- Top = "top",
43
- Bottom = "bottom",
44
- Left = "left",
45
- Right = "right"
46
- }
47
- /**
48
- * CSS Media limits
49
- */
50
- export declare enum MediaLimits {
51
- Laptop = 1200,
52
- Tablet = 767,
53
- Phone = 430
54
- }
55
- /**
56
- * Direction types
57
- */
58
- export declare enum Direction {
59
- Horizontal = "horizontal",
60
- Vertical = "vertical"
61
- }