angular-dumb-lib 0.0.19 → 0.0.21

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/esm2022/lib/angular-dumb-lib.component.mjs +9 -9
  2. package/esm2022/lib/angular-dumb-lib.module.mjs +1 -1
  3. package/esm2022/lib/components/atoms/button/button.component.mjs +3 -3
  4. package/esm2022/lib/components/atoms/input/input.component.mjs +3 -3
  5. package/esm2022/lib/components/atoms/loading/loading.component.mjs +5 -5
  6. package/esm2022/lib/components/atoms/menu-widget/menu-widget.component.mjs +4 -4
  7. package/esm2022/lib/components/atoms/selection/selection.component.mjs +1 -1
  8. package/esm2022/lib/components/molecules/cards/cards.component.mjs +3 -3
  9. package/esm2022/lib/components/molecules/content-design/content-design.component.mjs +3 -3
  10. package/esm2022/lib/components/molecules/form/form.component.mjs +18 -16
  11. package/esm2022/lib/components/molecules/formated-text/formated-text.component.mjs +3 -3
  12. package/esm2022/lib/components/molecules/modal/modal.component.mjs +7 -3
  13. package/esm2022/lib/components/molecules/paginator/paginator.component.mjs +5 -4
  14. package/esm2022/lib/components/molecules/table/table.component.mjs +3 -3
  15. package/esm2022/lib/components/pages/footer/footer.component.mjs +3 -3
  16. package/esm2022/lib/components/pages/login/login.component.mjs +3 -5
  17. package/esm2022/lib/components/pages/menu/menu.component.mjs +32 -7
  18. package/esm2022/lib/shared/constants/constant.mjs +1 -1
  19. package/esm2022/lib/shared/enums/enum.mjs +15 -9
  20. package/esm2022/lib/shared/interfaces/interface.mjs +1 -1
  21. package/esm2022/lib/shared/utils/common.utils.mjs +34 -1
  22. package/esm2022/public-api.mjs +1 -1
  23. package/fesm2022/angular-dumb-lib.mjs +135 -67
  24. package/fesm2022/angular-dumb-lib.mjs.map +1 -1
  25. package/lib/components/atoms/loading/loading.component.d.ts +2 -2
  26. package/lib/components/atoms/menu-widget/menu-widget.component.d.ts +2 -1
  27. package/lib/components/molecules/form/form.component.d.ts +2 -0
  28. package/lib/components/molecules/modal/modal.component.d.ts +3 -1
  29. package/lib/components/pages/menu/menu.component.d.ts +13 -4
  30. package/lib/shared/enums/enum.d.ts +6 -1
  31. package/lib/shared/interfaces/interface.d.ts +11 -2
  32. package/lib/shared/utils/common.utils.d.ts +9 -0
  33. package/package.json +1 -1
  34. package/src/lib/assets/styles.scss +12 -12
  35. package/esm2022/lib/components/atoms/formated-text/formated-text.component.mjs +0 -22
  36. package/lib/components/atoms/formated-text/formated-text.component.d.ts +0 -12
@@ -4,8 +4,9 @@ import * as i0 from "@angular/core";
4
4
  export declare class MenuWidgetComponent {
5
5
  items: IWidgetMenuItem[];
6
6
  position: {
7
- top: string;
7
+ top?: string;
8
8
  left: string;
9
+ bottom?: string;
9
10
  };
10
11
  itemSelected: EventEmitter<IWidgetMenuItem>;
11
12
  onItemClick(item: IWidgetMenuItem): void;
@@ -15,9 +15,11 @@ export declare class FormComponent {
15
15
  controlName: string;
16
16
  value: any;
17
17
  }>;
18
+ InputGroupType: typeof InputGroupType;
18
19
  onSubmit(): void;
19
20
  onValueChange(controlName: string, value: any): void;
20
21
  checkFormConfigType(inputType: InputType | undefined): InputGroupType;
22
+ trackByFn(index: number, item: IInputConfig): string;
21
23
  static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
22
24
  static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "app-form", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "inputConfigs": { "alias": "inputConfigs"; "required": false; }; "buttonConfig": { "alias": "buttonConfig"; "required": false; }; "validationMessages": { "alias": "validationMessages"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
23
25
  }
@@ -1,8 +1,10 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { IButtonConfig, IModalEvent } from '../../../shared/interfaces/interface';
3
+ import { Size } from '../../../shared/enums/enum';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class ModalComponent implements OnInit {
5
6
  modalEvent: IModalEvent;
7
+ size: Size;
6
8
  okConfig: IButtonConfig;
7
9
  cancelConfig: IButtonConfig;
8
10
  constructor();
@@ -13,5 +15,5 @@ export declare class ModalComponent implements OnInit {
13
15
  ok(): void;
14
16
  cancel(): void;
15
17
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "app-modal", never, { "modalEvent": { "alias": "modalEvent"; "required": false; }; }, {}, never, never, true, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "app-modal", never, { "modalEvent": { "alias": "modalEvent"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
17
19
  }
@@ -1,25 +1,27 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
- import { IMenuItem, IWidgetMenuItem } from '../../../shared/interfaces/interface';
2
+ import { ILoginUser, IMenuItem, IWidgetMenuItem } from '../../../shared/interfaces/interface';
3
3
  import { MenuDirection } from '../../../shared/enums/enum';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class MenuComponent implements OnInit {
6
6
  menuItems: IMenuItem[];
7
7
  logoUrl: string;
8
+ logoRouter: string;
8
9
  direction: MenuDirection;
9
10
  languageMenuItems: IWidgetMenuItem[];
11
+ loginUser?: ILoginUser;
10
12
  languageSelected: EventEmitter<IWidgetMenuItem>;
11
13
  loginSelected: EventEmitter<void>;
14
+ logoutSelected: EventEmitter<void>;
12
15
  languageMenuPosition: {
13
- top: string;
14
16
  left: string;
15
17
  };
16
18
  loginMenuPosition: {
17
- top: string;
18
19
  left: string;
19
20
  };
20
21
  isLanguageMenuVisible: boolean;
21
22
  isLoginMenuVisible: boolean;
22
23
  loginItems: IWidgetMenuItem[];
24
+ logoutItems: IWidgetMenuItem[];
23
25
  constructor();
24
26
  ngOnInit(): void;
25
27
  get isVertical(): boolean;
@@ -27,12 +29,19 @@ export declare class MenuComponent implements OnInit {
27
29
  toggleLoginMenu(event: MouseEvent): void;
28
30
  onLanguageSelected(item: IWidgetMenuItem): void;
29
31
  onLoginMenuItemSelected(item: IWidgetMenuItem): void;
32
+ onLogoutMenuItemSelected(item: IWidgetMenuItem): void;
30
33
  handleClickOutside(event: Event): void;
31
34
  calculatePosition(triggerElement: HTMLElement, offset?: number): {
32
35
  top: string;
33
36
  left: string;
37
+ bottom?: undefined;
38
+ } | {
39
+ left: string;
40
+ bottom: string;
41
+ top?: undefined;
34
42
  };
35
43
  login(): void;
44
+ logout(): void;
36
45
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "app-menu", never, { "menuItems": { "alias": "menuItems"; "required": false; }; "logoUrl": { "alias": "logoUrl"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "languageMenuItems": { "alias": "languageMenuItems"; "required": false; }; }, { "languageSelected": "languageSelected"; "loginSelected": "loginSelected"; }, never, never, true, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "app-menu", never, { "menuItems": { "alias": "menuItems"; "required": false; }; "logoUrl": { "alias": "logoUrl"; "required": false; }; "logoRouter": { "alias": "logoRouter"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "languageMenuItems": { "alias": "languageMenuItems"; "required": false; }; "loginUser": { "alias": "loginUser"; "required": false; }; }, { "languageSelected": "languageSelected"; "loginSelected": "loginSelected"; "logoutSelected": "logoutSelected"; }, never, never, true, never>;
38
47
  }
@@ -46,7 +46,7 @@ export declare enum SelectionType {
46
46
  radio = "radio",
47
47
  checkbox = "checkbox"
48
48
  }
49
- export declare enum LoadingSize {
49
+ export declare enum Size {
50
50
  Xbig = "xbig",
51
51
  Big = "big",
52
52
  Medium = "medium",
@@ -66,3 +66,8 @@ export declare enum LoadingType {
66
66
  black = "black",
67
67
  white = "white"
68
68
  }
69
+ export declare enum CRUDType {
70
+ create = "create",
71
+ update = "update",
72
+ delete = "delete"
73
+ }
@@ -10,14 +10,15 @@ export interface IButtonConfig {
10
10
  action?: string;
11
11
  }
12
12
  export interface IInputConfig {
13
- required: boolean;
14
- label?: string;
13
+ required?: boolean;
14
+ label: string;
15
15
  name: string;
16
16
  placeholder?: string;
17
17
  type?: InputType;
18
18
  direction?: InputDirection;
19
19
  isValid?: boolean;
20
20
  options?: IDropdownOption[];
21
+ validator: string;
21
22
  }
22
23
  export interface IContentDesign {
23
24
  id?: string;
@@ -41,6 +42,10 @@ export interface IMenuItem {
41
42
  value: string;
42
43
  route?: string;
43
44
  }
45
+ export interface ILoginUser {
46
+ name: string;
47
+ picture?: string;
48
+ }
44
49
  export interface IWidgetMenuItem extends IMenuItem {
45
50
  stick?: WidgetPosition;
46
51
  isToggled?: boolean;
@@ -71,3 +76,7 @@ export interface IItemList<T> {
71
76
  totalRecords: number;
72
77
  items: T[];
73
78
  }
79
+ export interface IItem<T> {
80
+ tableContent: T;
81
+ formContent: T;
82
+ }
@@ -1 +1,10 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { IDropdownOption } from "../interfaces/interface";
3
+ export declare function isDefined<T>(obj: T | null | undefined): obj is T;
4
+ export declare function isNullOrWhilespace<T extends string>(obj: T): boolean;
5
+ export declare function groupBy<T, K extends keyof any>(arr: T[], key: (i: T) => K): Record<K, T[]>;
6
+ export declare function withValuesOf<T extends object>(value: T, callback: (val: T[keyof T]) => void): void;
7
+ export declare function as<T>(obj: unknown): T;
8
+ export declare function makeDestroy<T>(): MonoTypeOperatorFunction<T>;
9
+ export declare function mapEnumToDropdownOptions(enumObj: any): IDropdownOption[];
1
10
  export declare function truncateContent(content: string, maxLength: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-dumb-lib",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.0.0",
6
6
  "@angular/core": "^16.0.0"
@@ -1,12 +1,12 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2
-
3
- /* styles.scss */
4
- :root {
5
- --main-font-family: Roboto;
6
- --main-font-size: 15px;
7
- }
8
-
9
- * {
10
- font-family: var(--main-font-family);
11
- font-size: var(--main-font-size);
12
- }
1
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2
+
3
+ /* styles.scss */
4
+ :root {
5
+ --main-font-family: Roboto;
6
+ --main-font-size: 15px;
7
+ }
8
+
9
+ * {
10
+ font-family: var(--main-font-family);
11
+ font-size: var(--main-font-size);
12
+ }
@@ -1,22 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/platform-browser";
4
- class FormatedTextComponent {
5
- set content(value) {
6
- this.safeContent = this.sanitizer.bypassSecurityTrustHtml(value);
7
- }
8
- constructor(sanitizer) {
9
- this.sanitizer = sanitizer;
10
- }
11
- ngOnInit() { }
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormatedTextComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormatedTextComponent, isStandalone: true, selector: "app-formated-text", inputs: { content: "content" }, ngImport: i0, template: "<div [innerHTML]=\"safeContent\"></div>\r\n", styles: [""] }); }
14
- }
15
- export { FormatedTextComponent };
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormatedTextComponent, decorators: [{
17
- type: Component,
18
- args: [{ selector: 'app-formated-text', standalone: true, template: "<div [innerHTML]=\"safeContent\"></div>\r\n" }]
19
- }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; }, propDecorators: { content: [{
20
- type: Input
21
- }] } });
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0ZWQt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AYW5ndWxhci9wbGF0Zm9ybS1icm93c2VyJztcclxuXHJcbkBDb21wb25lbnQoe1xyXG4gIHNlbGVjdG9yOiAnYXBwLWZvcm1hdGVkLXRleHQnLFxyXG4gIHN0YW5kYWxvbmU6IHRydWUsXHJcbiAgdGVtcGxhdGVVcmw6ICcuL2Zvcm1hdGVkLXRleHQuY29tcG9uZW50Lmh0bWwnLFxyXG4gIHN0eWxlVXJsczogWycuL2Zvcm1hdGVkLXRleHQuY29tcG9uZW50LnNjc3MnXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgRm9ybWF0ZWRUZXh0Q29tcG9uZW50IGltcGxlbWVudHMgT25Jbml0IHtcclxuICBASW5wdXQoKSBzZXQgY29udGVudCh2YWx1ZTogc3RyaW5nKSB7XHJcbiAgICB0aGlzLnNhZmVDb250ZW50ID0gdGhpcy5zYW5pdGl6ZXIuYnlwYXNzU2VjdXJpdHlUcnVzdEh0bWwodmFsdWUpO1xyXG4gIH1cclxuXHJcbiAgc2FmZUNvbnRlbnQhOiBTYWZlSHRtbDtcclxuXHJcbiAgY29uc3RydWN0b3IocHJpdmF0ZSBzYW5pdGl6ZXI6IERvbVNhbml0aXplcikge31cclxuXHJcbiAgbmdPbkluaXQoKTogdm9pZCB7fVxyXG59XHJcbiIsIjxkaXYgW2lubmVySFRNTF09XCJzYWZlQ29udGVudFwiPjwvZGl2PlxyXG4iXX0=
@@ -1,12 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
- import * as i0 from "@angular/core";
4
- export declare class FormatedTextComponent implements OnInit {
5
- private sanitizer;
6
- set content(value: string);
7
- safeContent: SafeHtml;
8
- constructor(sanitizer: DomSanitizer);
9
- ngOnInit(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<FormatedTextComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<FormatedTextComponent, "app-formated-text", never, { "content": { "alias": "content"; "required": false; }; }, {}, never, never, true, never>;
12
- }