aeb-ui-kit 4.0.1-preview.694 → 4.0.1-preview.709

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 (26) hide show
  1. package/esm2020/lib/file-attach/components/attach-button/attach-button.component.mjs +62 -0
  2. package/esm2020/lib/file-attach/components/default-body/default-body.component.mjs +29 -0
  3. package/esm2020/lib/file-attach/components/salary-portal-body/salary-portal-body.component.mjs +23 -0
  4. package/esm2020/lib/file-attach/directives/drag-and-drop.directive.mjs +12 -11
  5. package/esm2020/lib/file-attach/file-attach.component.mjs +106 -42
  6. package/esm2020/lib/file-attach/file-attach.module.mjs +17 -7
  7. package/esm2020/lib/file-attach/file-attach.namespace.mjs +2 -0
  8. package/esm2020/lib/form-field/form-field.component.mjs +3 -3
  9. package/esm2020/lib/modal/modal.component.mjs +37 -21
  10. package/esm2020/lib/modal/modal.module.mjs +5 -4
  11. package/esm2020/public-api.mjs +2 -1
  12. package/fesm2015/aeb-ui-kit.mjs +264 -77
  13. package/fesm2015/aeb-ui-kit.mjs.map +1 -1
  14. package/fesm2020/aeb-ui-kit.mjs +264 -77
  15. package/fesm2020/aeb-ui-kit.mjs.map +1 -1
  16. package/lib/file-attach/components/attach-button/attach-button.component.d.ts +22 -0
  17. package/lib/file-attach/components/default-body/default-body.component.d.ts +10 -0
  18. package/lib/file-attach/components/salary-portal-body/salary-portal-body.component.d.ts +7 -0
  19. package/lib/file-attach/directives/drag-and-drop.directive.d.ts +3 -3
  20. package/lib/file-attach/file-attach.component.d.ts +28 -41
  21. package/lib/file-attach/file-attach.module.d.ts +6 -4
  22. package/lib/file-attach/file-attach.namespace.d.ts +38 -0
  23. package/lib/modal/modal.component.d.ts +21 -8
  24. package/lib/modal/modal.module.d.ts +2 -1
  25. package/package.json +1 -1
  26. package/public-api.d.ts +1 -0
@@ -0,0 +1,22 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { ButtonIconSource } from 'src/lib/button/button.component';
4
+ import { FileAttach } from '../../file-attach.namespace';
5
+ import * as i0 from "@angular/core";
6
+ export declare class AttachButtonComponent {
7
+ attachButtonText: string;
8
+ attachButtonIcon: ButtonIconSource;
9
+ multi: boolean;
10
+ filesAmount: number;
11
+ showErrorMessage: boolean;
12
+ showErrorMessageText: Subject<string>;
13
+ requirement: FileAttach.Requirement;
14
+ fileChoosen: EventEmitter<FileList>;
15
+ fileListCleared: EventEmitter<FileList>;
16
+ private get hostClasses();
17
+ chooseFile(event: Event): void;
18
+ clearFileList(): void;
19
+ getCaseByNumber(word: string[]): string;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AttachButtonComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<AttachButtonComponent, "aeb-attach-button", never, { "attachButtonText": "attachButtonText"; "attachButtonIcon": "attachButtonIcon"; "multi": "multi"; "filesAmount": "filesAmount"; "showErrorMessage": "showErrorMessage"; "showErrorMessageText": "showErrorMessageText"; "requirement": "requirement"; }, { "fileChoosen": "fileChoosen"; "fileListCleared": "fileListCleared"; }, never, never, false, never>;
22
+ }
@@ -0,0 +1,10 @@
1
+ import { FileAttach } from '../../file-attach.namespace';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DefaultBodyComponent {
4
+ title: string;
5
+ attachmentDescription: FileAttach.DetailedDescription;
6
+ documentListText: string;
7
+ private get hostClasses();
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultBodyComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultBodyComponent, "aeb-default-body", never, { "title": "title"; "attachmentDescription": "attachmentDescription"; "documentListText": "documentListText"; }, {}, never, ["*"], false, never>;
10
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class SalaryPortalBodyComponent {
3
+ title: string;
4
+ private get hostClasses();
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<SalaryPortalBodyComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<SalaryPortalBodyComponent, "aeb-salary-portal-body", never, { "title": "title"; }, {}, never, ["*"], false, never>;
7
+ }
@@ -1,12 +1,12 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class DragAndDropDirective {
4
- fileChooseEvent$: EventEmitter<File>;
5
- fileInFocusEvent$: EventEmitter<boolean>;
4
+ filesChoosen: EventEmitter<FileList>;
5
+ filesInFocus: EventEmitter<boolean>;
6
6
  constructor();
7
7
  onDragOver(event: Event): void;
8
8
  onDragLeave(event: Event): void;
9
9
  onDrop(event: DragEvent): void;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<DragAndDropDirective, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<DragAndDropDirective, "[aebDragAndDrop]", never, {}, { "fileChooseEvent$": "fileChooseEvent$"; "fileInFocusEvent$": "fileInFocusEvent$"; }, never, never, false, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DragAndDropDirective, "[aebDragAndDrop]", never, {}, { "filesChoosen": "filesChoosen"; "filesInFocus": "filesInFocus"; }, never, never, true, never>;
12
12
  }
@@ -1,52 +1,39 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { ButtonIconSource } from '../button/button.component';
4
+ import { FileAttach } from './file-attach.namespace';
2
5
  import * as i0 from "@angular/core";
3
- export declare namespace FileAttach {
4
- type LayoutMode = 'default' | 'salaryPortal' | 'simple';
5
- }
6
- declare type AttachmentDescription = {
7
- iconURL: string;
8
- text: string;
9
- };
10
- export declare type DetailedDescription = {
11
- left: AttachmentDescription;
12
- right?: AttachmentDescription;
13
- }[];
14
- export declare type Requirement = {
15
- text: string;
16
- check: (files: File[]) => boolean;
17
- };
18
- export declare class FileAttachComponent {
6
+ import * as i1 from "./directives/drag-and-drop.directive";
7
+ export declare class FileAttachComponent implements OnDestroy, OnInit {
19
8
  title: string;
20
9
  /**
21
- * a string that describes which files should be attached
22
- */
23
- documentList: string;
24
- /**
25
- * should the documentList line be displayed?
26
- */
27
- showDocumentList: boolean;
28
- /**
29
- * message for file type
10
+ * A string that describes which files should be attached, e.g.
11
+ * `"Справка 2НДФЛ, справка о размере пенсии и иные документы, подтверждающие доход"`
30
12
  */
13
+ documentListText: string;
14
+ attachButtonText: string;
15
+ attachButtonIcon: ButtonIconSource;
16
+ multi: boolean;
31
17
  layoutMod: FileAttach.LayoutMode;
32
- attachmentDescription: DetailedDescription;
33
- /**
34
- * object that has two fields:
35
- * - `text`: text displayed near to button
36
- * - `check`: callback receiving array of files and checks are they meet the requirement, then returns bool
37
- */
38
- requirement: Requirement;
18
+ attachmentDescription: FileAttach.DetailedDescription;
19
+ requirement: FileAttach.Requirement;
20
+ showErrorMessage: boolean;
39
21
  changeListEvent: EventEmitter<File[]>;
40
- requirementViolatedError: EventEmitter<void>;
22
+ requirementViolatedError: EventEmitter<FileAttach.RequirementConfirmationError>;
41
23
  files: File[];
42
- isFileInFocus: boolean;
24
+ showErrorMessageText: Subject<string>;
25
+ private isFileInFocus;
26
+ private defaultRequirementViolatedError;
27
+ private subscriptions;
28
+ private get hostClasses();
29
+ private dropFile;
30
+ private checkFileInFocus;
31
+ ngOnInit(): void;
32
+ ngOnDestroy(): void;
43
33
  clearFileList(): void;
44
- getCaseByNumber(word: string[]): string;
45
- dropFile(file: File): void;
46
- chooseFile(event: Event): void;
47
- checkFileInFocus(isInFocus: boolean): void;
34
+ chooseFile(files: FileList): void;
48
35
  private addFile;
36
+ private fileListToArray;
49
37
  static ɵfac: i0.ɵɵFactoryDeclaration<FileAttachComponent, never>;
50
- static ɵcmp: i0.ɵɵComponentDeclaration<FileAttachComponent, "aeb-file-attach", never, { "title": "title"; "documentList": "documentList"; "showDocumentList": "showDocumentList"; "layoutMod": "layoutMod"; "attachmentDescription": "attachmentDescription"; "requirement": "requirement"; }, { "changeListEvent": "changeListEvent"; "requirementViolatedError": "requirementViolatedError"; }, never, never, false, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileAttachComponent, "aeb-file-attach", never, { "title": "title"; "documentListText": "documentListText"; "attachButtonText": "attachButtonText"; "attachButtonIcon": "attachButtonIcon"; "multi": "multi"; "layoutMod": "layoutMod"; "attachmentDescription": "attachmentDescription"; "requirement": "requirement"; "showErrorMessage": "showErrorMessage"; }, { "changeListEvent": "changeListEvent"; "requirementViolatedError": "requirementViolatedError"; }, never, never, false, [{ directive: typeof i1.DragAndDropDirective; inputs: {}; outputs: { "filesChoosen": "filesChoosen"; "filesInFocus": "filesInFocus"; }; }]>;
51
39
  }
52
- export {};
@@ -1,10 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./file-attach.component";
3
- import * as i2 from "./directives/drag-and-drop.directive";
4
- import * as i3 from "@angular/common";
5
- import * as i4 from "../old-button/old-button.module";
3
+ import * as i2 from "./components/default-body/default-body.component";
4
+ import * as i3 from "./components/salary-portal-body/salary-portal-body.component";
5
+ import * as i4 from "./components/attach-button/attach-button.component";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "../button/button.module";
6
8
  export declare class FileAttachModule {
7
9
  static ɵfac: i0.ɵɵFactoryDeclaration<FileAttachModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<FileAttachModule, [typeof i1.FileAttachComponent, typeof i2.DragAndDropDirective], [typeof i3.CommonModule, typeof i4.OldButtonModule], [typeof i1.FileAttachComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FileAttachModule, [typeof i1.FileAttachComponent, typeof i2.DefaultBodyComponent, typeof i3.SalaryPortalBodyComponent, typeof i4.AttachButtonComponent], [typeof i5.CommonModule, typeof i6.ButtonModule], [typeof i1.FileAttachComponent]>;
9
11
  static ɵinj: i0.ɵɵInjectorDeclaration<FileAttachModule>;
10
12
  }
@@ -0,0 +1,38 @@
1
+ export declare namespace FileAttach {
2
+ type LayoutMode = 'default' | 'simple' | 'salaryPortal';
3
+ /**
4
+ * Shorthand for error, e.g. `'FILE_TOO_LARGE'`
5
+ */
6
+ type ErrorType = string | symbol;
7
+ /**
8
+ * Detailed error description, e.g. `'Размер файла превышает 10Мб'`
9
+ */
10
+ type ErrorMessage = string;
11
+ type RequirementConfirmationError = {
12
+ type: ErrorType;
13
+ message: ErrorMessage;
14
+ };
15
+ type RequirementConfirmationResult = {
16
+ status: boolean;
17
+ error?: RequirementConfirmationError;
18
+ };
19
+ type Requirement = {
20
+ /**
21
+ * Текст требования, например, `".pdf до 10Мб"`
22
+ */
23
+ text: string;
24
+ /**
25
+ * Колбэк для проверки того, выполнены ли требования
26
+ *
27
+ * @param newFiles Копия массива файлов которые были добавлены сейчас
28
+ * @param currentFiles Копия массива уже добавленных ранее файлов
29
+ * @returns Объект с полями `status` и `errorMessage`
30
+ */
31
+ isRequirementCompleted: (newFiles: File[] | FileList, currentFiles: File[] | FileList) => FileAttach.RequirementConfirmationResult;
32
+ };
33
+ type AttachmentDescription = {
34
+ iconURL: string;
35
+ text: string;
36
+ };
37
+ type DetailedDescription = AttachmentDescription[];
38
+ }
@@ -1,20 +1,33 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
+ import { ButtonVariant } from '../button/button.component';
2
3
  import * as i0 from "@angular/core";
4
+ export interface ControlsConfigurationModel {
5
+ text?: string;
6
+ variant?: ButtonVariant;
7
+ warning?: boolean;
8
+ hidden?: boolean;
9
+ disabled?: boolean;
10
+ }
3
11
  export declare class ModalComponent implements OnInit {
4
12
  isOpen: boolean;
5
- showButtons: boolean;
6
- cancelText: string;
7
- submitText: string;
8
- closeClick: EventEmitter<boolean>;
9
- cancelClick: EventEmitter<any>;
10
- submitClick: EventEmitter<any>;
13
+ size: 'S' | 'M' | 'L';
14
+ controlsConfig: {
15
+ leftBtn?: ControlsConfigurationModel;
16
+ rightBtn?: ControlsConfigurationModel;
17
+ closeBtn?: {
18
+ hidden: ControlsConfigurationModel['hidden'];
19
+ };
20
+ };
21
+ leftBtnClick: EventEmitter<any>;
22
+ rightBtnClick: EventEmitter<any>;
23
+ closeBtnClick: EventEmitter<any>;
11
24
  constructor();
12
25
  open(): void;
13
26
  close(): void;
14
- onCloseClick(): void;
15
27
  onCancelClick(): void;
16
28
  onSubmitClick(): void;
29
+ onCloseClick(): void;
17
30
  ngOnInit(): void;
18
31
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "aeb-modal", never, { "isOpen": "isOpen"; "showButtons": "showButtons"; "cancelText": "cancelText"; "submitText": "submitText"; }, { "closeClick": "closeClick"; "cancelClick": "cancelClick"; "submitClick": "submitClick"; }, never, ["*"], false, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "aeb-modal", never, { "isOpen": "isOpen"; "size": "size"; "controlsConfig": "controlsConfig"; }, { "leftBtnClick": "leftBtnClick"; "rightBtnClick": "rightBtnClick"; "closeBtnClick": "closeBtnClick"; }, never, ["*"], false, never>;
20
33
  }
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./modal.component";
3
3
  import * as i2 from "@angular/common";
4
+ import * as i3 from "../button/button.module";
4
5
  export declare class ModalModule {
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<ModalModule, [typeof i1.ModalComponent], [typeof i2.CommonModule], [typeof i1.ModalComponent]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ModalModule, [typeof i1.ModalComponent], [typeof i2.CommonModule, typeof i3.ButtonModule], [typeof i1.ModalComponent]>;
7
8
  static ɵinj: i0.ɵɵInjectorDeclaration<ModalModule>;
8
9
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "aeb-ui-kit", "version": "4.0.1-preview.694", "exports": { "./styles.css": { "default": "./styles.css" }, "./package.json": { "default": "./package.json" }, ".": { "types": "./index.d.ts", "esm2020": "./esm2020/aeb-ui-kit.mjs", "es2020": "./fesm2020/aeb-ui-kit.mjs", "es2015": "./fesm2015/aeb-ui-kit.mjs", "node": "./fesm2015/aeb-ui-kit.mjs", "default": "./fesm2020/aeb-ui-kit.mjs" } }, "peerDependencies": { "@angular/animations": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/compiler": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/forms": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/platform-browser": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/platform-browser-dynamic": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0", "date-fns": "2.28.0", "ngx-mask": "^15.2.1", "rxjs": "^7.0.0", "sass": "^1.53.0", "zone.js": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0" }, "module": "fesm2015/aeb-ui-kit.mjs", "es2020": "fesm2020/aeb-ui-kit.mjs", "esm2020": "esm2020/aeb-ui-kit.mjs", "fesm2020": "fesm2020/aeb-ui-kit.mjs", "fesm2015": "fesm2015/aeb-ui-kit.mjs", "typings": "index.d.ts", "sideEffects": false, "dependencies": { "tslib": "^2.4.0" } }
1
+ { "name": "aeb-ui-kit", "version": "4.0.1-preview.709", "exports": { "./styles.css": { "default": "./styles.css" }, "./package.json": { "default": "./package.json" }, ".": { "types": "./index.d.ts", "esm2020": "./esm2020/aeb-ui-kit.mjs", "es2020": "./fesm2020/aeb-ui-kit.mjs", "es2015": "./fesm2015/aeb-ui-kit.mjs", "node": "./fesm2015/aeb-ui-kit.mjs", "default": "./fesm2020/aeb-ui-kit.mjs" } }, "peerDependencies": { "@angular/animations": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/compiler": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/forms": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/platform-browser": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/platform-browser-dynamic": "^15.0.0 || ^16.0.0 || ^17.0.0", "@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0", "date-fns": "2.28.0", "ngx-mask": "^15.2.1", "rxjs": "^7.0.0", "sass": "^1.53.0", "zone.js": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0" }, "module": "fesm2015/aeb-ui-kit.mjs", "es2020": "fesm2020/aeb-ui-kit.mjs", "esm2020": "esm2020/aeb-ui-kit.mjs", "fesm2020": "fesm2020/aeb-ui-kit.mjs", "fesm2015": "fesm2015/aeb-ui-kit.mjs", "typings": "index.d.ts", "sideEffects": false, "dependencies": { "tslib": "^2.4.0" } }
package/public-api.d.ts CHANGED
@@ -39,6 +39,7 @@ export * from './lib/select/select.component';
39
39
  export * from './lib/select/option.component';
40
40
  export * from './lib/file-attach/file-attach.module';
41
41
  export * from './lib/file-attach/file-attach.component';
42
+ export * from './lib/file-attach/file-attach.namespace';
42
43
  export * from './lib/file-attach/directives/drag-and-drop.directive';
43
44
  export * from './lib/credit-item-card/credit-item-card.module';
44
45
  export * from './lib/credit-item-card/credit-item-card.component';