myrta-ui 17.0.0-beta.2 → 17.0.0-beta.20

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 (109) hide show
  1. package/esm2022/lib/components/badges/components/badge/badge.component.mjs +2 -2
  2. package/esm2022/lib/components/form/editor/editor.component.mjs +13 -6
  3. package/esm2022/lib/components/form/editor/editor.enum.mjs +2 -0
  4. package/esm2022/lib/components/form/input-date-time/input-date-time.component.mjs +2 -2
  5. package/esm2022/lib/components/form/input-datepicker/input-datepicker.component.mjs +2 -2
  6. package/esm2022/lib/components/form/input-file/input-file.component.mjs +42 -46
  7. package/esm2022/lib/components/form/input-file-image/components/file-image-edit-modal/file-image-edit-modal.component.mjs +8 -8
  8. package/esm2022/lib/components/form/input-file-image/input-file-image.component.mjs +196 -210
  9. package/esm2022/lib/components/form/input-file-image/input-file-image.enum.mjs +3 -3
  10. package/esm2022/lib/components/form/input-file-image/input-file-image.module.mjs +6 -4
  11. package/esm2022/lib/components/form/input-number/input-number.component.mjs +2 -2
  12. package/esm2022/lib/components/form/input-password/input-password.component.mjs +2 -2
  13. package/esm2022/lib/components/form/input-phone/input-phone.component.mjs +2 -2
  14. package/esm2022/lib/components/form/input-search/input-search.component.mjs +2 -2
  15. package/esm2022/lib/components/form/input-select/input-select.component.mjs +3 -3
  16. package/esm2022/lib/components/form/input-tel/input-tel.component.mjs +2 -2
  17. package/esm2022/lib/components/form/input-text/input-text.component.mjs +2 -2
  18. package/esm2022/lib/components/form/switch/switch.component.mjs +2 -2
  19. package/esm2022/lib/components/gallery/components/gallery-confirm-modal/gallery-confirm-modal.component.mjs +3 -5
  20. package/esm2022/lib/components/icon-button/icon-button.component.mjs +9 -3
  21. package/esm2022/lib/components/icon-button/icon-button.enum.mjs +2 -1
  22. package/esm2022/lib/components/label/label.component.mjs +2 -2
  23. package/esm2022/lib/components/link/link.component.mjs +22 -10
  24. package/esm2022/lib/components/link/link.module.mjs +5 -4
  25. package/esm2022/lib/components/pdf-viewer/pdf-viewer.component.mjs +269 -0
  26. package/esm2022/lib/components/pdf-viewer/pdf-viewer.module.mjs +59 -0
  27. package/esm2022/lib/components/progress/progress.component.mjs +2 -2
  28. package/esm2022/lib/components/table/table.component.mjs +3 -3
  29. package/esm2022/lib/components/tabs/tabs-group/tabs-group.component.mjs +2 -2
  30. package/esm2022/lib/components/tooltip/tooltip-trigger/tooltip-trigger.component.mjs +2 -2
  31. package/esm2022/lib/components/truncate-text/truncate-text.component.mjs +1 -1
  32. package/esm2022/lib/models/input-file/input-file.model.mjs +1 -1
  33. package/esm2022/lib/services/file-upload/file-upload.service.mjs +5 -5
  34. package/esm2022/lib/services/index.mjs +9 -1
  35. package/esm2022/lib/services/modal-service/components/alert-modal/alert-modal.component.mjs +3 -5
  36. package/esm2022/lib/services/modal-service/components/confirm-modal/confirm-modal.component.mjs +3 -5
  37. package/esm2022/lib/services/modal-service/helpers/index.mjs +5 -0
  38. package/esm2022/lib/services/modal-service/helpers/modal.component.mjs +2 -3
  39. package/esm2022/lib/services/modal-service/modal-service.module.mjs +25 -0
  40. package/esm2022/lib/services/modal-service/modal-service.service.mjs +1 -1
  41. package/esm2022/lib/services/mrx-form-validator/constants/invalid-messages.mjs +10 -0
  42. package/esm2022/lib/services/mrx-form-validator/helpers/get-error-message.helper.mjs +10 -0
  43. package/esm2022/lib/services/mrx-form-validator/helpers/get-sorting-validations.helper.mjs +29 -0
  44. package/esm2022/lib/services/mrx-form-validator/models/index.mjs +4 -0
  45. package/esm2022/lib/services/mrx-form-validator/models/validations-options.model.mjs +2 -0
  46. package/esm2022/lib/services/mrx-form-validator/models/validations-settings.model.mjs +2 -0
  47. package/esm2022/lib/services/mrx-form-validator/models/validations-types.model.mjs +22 -0
  48. package/esm2022/lib/services/mrx-form-validator/mrx-form-validator.mjs +97 -183
  49. package/esm2022/lib/services/mrx-form-validator/validations/callback.validation.mjs +15 -0
  50. package/esm2022/lib/services/mrx-form-validator/validations/email.validation.mjs +11 -0
  51. package/esm2022/lib/services/mrx-form-validator/validations/max-length.validation.mjs +14 -0
  52. package/esm2022/lib/services/mrx-form-validator/validations/max-value.validation.mjs +10 -0
  53. package/esm2022/lib/services/mrx-form-validator/validations/min-length.validation.mjs +15 -0
  54. package/esm2022/lib/services/mrx-form-validator/validations/min-value.validation.mjs +10 -0
  55. package/esm2022/lib/services/mrx-form-validator/validations/pattern.validation.mjs +11 -0
  56. package/esm2022/lib/services/mrx-form-validator/validations/required.validation.mjs +22 -0
  57. package/esm2022/lib/services/toaster-service/components/toaster/toaster.component.mjs +27 -0
  58. package/esm2022/lib/services/toaster-service/models/toaster.model.mjs +15 -0
  59. package/esm2022/lib/services/toaster-service/toaster-service.module.mjs +52 -0
  60. package/esm2022/lib/services/toaster-service/toaster-service.service.mjs +48 -0
  61. package/esm2022/public-api.mjs +3 -1
  62. package/fesm2022/myrta-ui.mjs +1183 -656
  63. package/fesm2022/myrta-ui.mjs.map +1 -1
  64. package/lib/components/form/editor/editor.component.d.ts +4 -2
  65. package/lib/components/form/editor/editor.enum.d.ts +5 -0
  66. package/lib/components/form/input-file/input-file.component.d.ts +6 -4
  67. package/lib/components/form/input-file-image/components/file-image-edit-modal/file-image-edit-modal.component.d.ts +5 -4
  68. package/lib/components/form/input-file-image/input-file-image.component.d.ts +21 -26
  69. package/lib/components/form/input-file-image/input-file-image.enum.d.ts +2 -2
  70. package/lib/components/form/input-file-image/input-file-image.module.d.ts +1 -1
  71. package/lib/components/form/input-select/input-select.component.d.ts +16 -5
  72. package/lib/components/gallery/components/gallery-confirm-modal/gallery-confirm-modal.component.d.ts +2 -3
  73. package/lib/components/icon-button/icon-button.component.d.ts +4 -1
  74. package/lib/components/icon-button/icon-button.enum.d.ts +2 -1
  75. package/lib/components/link/link.component.d.ts +10 -3
  76. package/lib/components/link/link.module.d.ts +2 -1
  77. package/lib/components/pdf-viewer/pdf-viewer.component.d.ts +70 -0
  78. package/lib/components/pdf-viewer/pdf-viewer.module.d.ts +16 -0
  79. package/lib/models/input-file/input-file.model.d.ts +5 -4
  80. package/lib/services/file-upload/file-upload.service.d.ts +2 -2
  81. package/lib/services/index.d.ts +8 -0
  82. package/lib/services/modal-service/components/alert-modal/alert-modal.component.d.ts +2 -3
  83. package/lib/services/modal-service/components/confirm-modal/confirm-modal.component.d.ts +2 -3
  84. package/lib/services/modal-service/helpers/index.d.ts +4 -0
  85. package/lib/services/modal-service/helpers/modal.component.d.ts +1 -2
  86. package/lib/services/modal-service/modal-service.module.d.ts +9 -0
  87. package/lib/services/modal-service/modal-service.service.d.ts +4 -4
  88. package/lib/services/mrx-form-validator/constants/invalid-messages.d.ts +9 -0
  89. package/lib/services/mrx-form-validator/helpers/get-error-message.helper.d.ts +3 -0
  90. package/lib/services/mrx-form-validator/helpers/get-sorting-validations.helper.d.ts +2 -0
  91. package/lib/services/mrx-form-validator/models/index.d.ts +3 -0
  92. package/lib/services/mrx-form-validator/models/validations-options.model.d.ts +31 -0
  93. package/lib/services/mrx-form-validator/models/validations-settings.model.d.ts +7 -0
  94. package/lib/services/mrx-form-validator/models/validations-types.model.d.ts +19 -0
  95. package/lib/services/mrx-form-validator/mrx-form-validator.d.ts +6 -33
  96. package/lib/services/mrx-form-validator/validations/callback.validation.d.ts +5 -0
  97. package/lib/services/mrx-form-validator/validations/email.validation.d.ts +5 -0
  98. package/lib/services/mrx-form-validator/validations/max-length.validation.d.ts +5 -0
  99. package/lib/services/mrx-form-validator/validations/max-value.validation.d.ts +5 -0
  100. package/lib/services/mrx-form-validator/validations/min-length.validation.d.ts +5 -0
  101. package/lib/services/mrx-form-validator/validations/min-value.validation.d.ts +5 -0
  102. package/lib/services/mrx-form-validator/validations/pattern.validation.d.ts +5 -0
  103. package/lib/services/mrx-form-validator/validations/required.validation.d.ts +5 -0
  104. package/lib/services/toaster-service/components/toaster/toaster.component.d.ts +10 -0
  105. package/lib/services/toaster-service/models/toaster.model.d.ts +12 -0
  106. package/lib/services/toaster-service/toaster-service.module.d.ts +10 -0
  107. package/lib/services/toaster-service/toaster-service.service.d.ts +15 -0
  108. package/package.json +5 -1
  109. package/public-api.d.ts +2 -0
@@ -0,0 +1,31 @@
1
+ export interface IMessages {
2
+ [name: string]: string | ((param?: any) => string);
3
+ }
4
+ export interface IFields {
5
+ [name: string]: any;
6
+ }
7
+ export interface IFieldsError {
8
+ [name: string]: any;
9
+ }
10
+ export type ValidationsType = {
11
+ required?: boolean;
12
+ type?: 'multi' | 'single';
13
+ maxLength?: number;
14
+ minLength?: number;
15
+ maxValue?: number;
16
+ minValue?: number;
17
+ email?: boolean;
18
+ pattern?: RegExp;
19
+ messages?: IMessages;
20
+ /**
21
+ * @param value Any <br/>
22
+ * callback принимает value поля модели <br/>
23
+ * Вернув null | false - ошибка отсутствует <br/>
24
+ * Вернув true | string - ошибка появляется <br/>
25
+ * string при этом становится тектом ошибки
26
+ */
27
+ callback?: (value: any) => any;
28
+ };
29
+ export interface IValidations {
30
+ [name: string]: ValidationsType;
31
+ }
@@ -0,0 +1,7 @@
1
+ export type OptionMethodType = 'submit' | 'input';
2
+ export type OptionClearType = 'all' | 'selected';
3
+ export interface FormValidatorOptions {
4
+ method?: OptionMethodType;
5
+ clear?: OptionClearType;
6
+ messages?: any;
7
+ }
@@ -0,0 +1,19 @@
1
+ export declare enum ValidationTypesEnum {
2
+ Required = "required",
3
+ MaxLength = "maxLength",
4
+ MinLength = "minLength",
5
+ Email = "email",
6
+ Pattern = "pattern",
7
+ MaxValue = "maxValue",
8
+ MinValue = "minValue",
9
+ Callback = "callback"
10
+ }
11
+ export declare enum ValidationOptionsEnum {
12
+ Type = "type",
13
+ Messages = "messages"
14
+ }
15
+ export type ValidationsTypes = ValidationTypesEnum | ValidationOptionsEnum;
16
+ export declare enum ValidationMethodsEnum {
17
+ Submit = "submit",
18
+ Input = "input"
19
+ }
@@ -1,32 +1,5 @@
1
- export type OptionMethodType = 'submit' | 'input';
2
- export type OptionClearType = 'all' | 'selected';
3
- export type ValidationsTypes = 'required' | 'maxLength' | 'minLength' | 'email' | 'pattern' | 'messages' | 'maxValue' | 'minValue';
4
- export type ValidationsType = {
5
- required?: boolean;
6
- type?: 'multi' | 'single';
7
- maxLength?: number;
8
- minLength?: number;
9
- maxValue?: number;
10
- minValue?: number;
11
- email?: boolean;
12
- pattern?: RegExp;
13
- messages?: IMessages;
14
- };
15
- export interface FormValidatorOptions {
16
- method?: OptionMethodType;
17
- clear?: OptionClearType;
18
- messages?: any;
19
- }
20
- export interface IMessages {
21
- [name: string]: string;
22
- }
23
- export interface IValidations {
24
- [name: string]: ValidationsType;
25
- }
26
- export interface IFields {
27
- [name: string]: any;
28
- }
29
- export declare const emailRegExp: RegExp;
1
+ import { IFields, IFieldsError, IValidations } from './models';
2
+ import { FormValidatorOptions } from './models';
30
3
  export declare class MrxFormValidator {
31
4
  private _fields;
32
5
  private _validations;
@@ -37,15 +10,15 @@ export declare class MrxFormValidator {
37
10
  private _method;
38
11
  private _invalidMessages;
39
12
  constructor(options?: FormValidatorOptions);
40
- private sortValidators;
41
- get errors(): any;
13
+ get errors(): IFieldsError;
42
14
  private set fields(value);
43
15
  private getNamesUpdatedProperties;
44
16
  private validateField;
45
- private hiddenValidateField;
17
+ private _checkErrors;
46
18
  initFields(fields: IFields, validations: IValidations): void;
47
19
  initModelChanged(fields: IFields): void;
48
- initModelChangedFromField(field: any, fieldName: string): void;
20
+ initFieldChanged(fields: IFields, fieldName: string): void;
49
21
  isValid(): boolean;
22
+ initModelChangedFromField(field: any, fieldName: string): void;
50
23
  isHiddenValid(): boolean;
51
24
  }
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const callbackValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const emailValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const maxLengthValidation: (value: string | string[], validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const maxValueValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const minLengthValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const minValueValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const patternValidation: (value: string, validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { IMessages, ValidationsType, ValidationTypesEnum } from '../models';
2
+ export declare const requiredValidation: (value: string | string[], validations: ValidationsType, key: ValidationTypesEnum, invalidMessages: IMessages) => {
3
+ isValid: boolean;
4
+ message: string | null;
5
+ };
@@ -0,0 +1,10 @@
1
+ import { Toast, ToastPackage, ToastrService } from 'ngx-toastr';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ToasterComponent extends Toast {
4
+ protected toastrService: ToastrService;
5
+ toastPackage: ToastPackage;
6
+ constructor(toastrService: ToastrService, toastPackage: ToastPackage);
7
+ action(event: Event): boolean;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToasterComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToasterComponent, "mrx-toaster", never, {}, {}, never, never, false, never>;
10
+ }
@@ -0,0 +1,12 @@
1
+ export declare enum ToasterType {
2
+ Info = "info",
3
+ Positive = "positive",
4
+ Negative = "negative",
5
+ Attention = "attention"
6
+ }
7
+ export declare enum ToasterPosition {
8
+ TopRight = "toast-top-right",
9
+ BottomRight = "toast-bottom-right",
10
+ TopLeft = "toast-top-left",
11
+ BottomLeft = "toast-bottom-left"
12
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./components/toaster/toaster.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "ngx-toastr";
5
+ import * as i4 from "../../pipes/safe/safe.module";
6
+ export declare class ToasterServiceModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToasterServiceModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ToasterServiceModule, [typeof i1.ToasterComponent], [typeof i2.CommonModule, typeof i3.ToastrModule, typeof i4.SafeModule], never>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<ToasterServiceModule>;
10
+ }
@@ -0,0 +1,15 @@
1
+ import { ToastrService } from 'ngx-toastr';
2
+ import { ToasterType } from './models/toaster.model';
3
+ import { IndividualConfig } from 'ngx-toastr/toastr/toastr-config';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ToasterService {
6
+ private _toasterService;
7
+ constructor(_toasterService: ToastrService);
8
+ show(data: {
9
+ title?: string;
10
+ message?: string;
11
+ type?: ToasterType;
12
+ }, customConfig?: Partial<IndividualConfig>): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToasterService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<ToasterService>;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrta-ui",
3
- "version": "17.0.0-beta.2",
3
+ "version": "17.0.0-beta.20",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
@@ -10,6 +10,8 @@
10
10
  "ngx-image-cropper": "^8.0.0",
11
11
  "ngx-file-drop": "^16.0.0",
12
12
  "ngx-jodit": "^3.1.2",
13
+ "ngx-toastr": "^19.0.0",
14
+ "ngx-extended-pdf-viewer": "18.1.14",
13
15
  "dayjs": "^1.11.11",
14
16
  "air-datepicker": "^3.5.3",
15
17
  "libphonenumber-js": "^1.10.30",
@@ -27,6 +29,8 @@
27
29
  "ngx-image-cropper": "^8.0.0",
28
30
  "ngx-file-drop": "^16.0.0",
29
31
  "ngx-jodit": "^3.1.2",
32
+ "ngx-toastr": "^19.0.0",
33
+ "ngx-extended-pdf-viewer": "18.1.14",
30
34
  "dayjs": "^1.11.11",
31
35
  "air-datepicker": "^3.5.3",
32
36
  "libphonenumber-js": "^1.10.30",
package/public-api.d.ts CHANGED
@@ -160,3 +160,5 @@ export * from './lib/helpers/index';
160
160
  export * from './lib/models/index';
161
161
  export * from './lib/components/form/input-tel/input-tel.module';
162
162
  export * from './lib/components/form/input-tel/input-tel.component';
163
+ export * from './lib/components/pdf-viewer/pdf-viewer.component';
164
+ export * from './lib/components/pdf-viewer/pdf-viewer.module';