myrta-ui 17.0.74 → 17.0.76

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 (28) hide show
  1. package/esm2022/lib/components/alert/alert.component.mjs +2 -2
  2. package/esm2022/lib/components/form/formula-editor/enums/error-messages.enum.mjs +16 -0
  3. package/esm2022/lib/components/form/formula-editor/enums/formula-editor-size.enum.mjs +7 -0
  4. package/esm2022/lib/components/form/formula-editor/formula-editor.component.mjs +342 -0
  5. package/esm2022/lib/components/form/formula-editor/formula-editor.module.mjs +44 -0
  6. package/esm2022/lib/components/form/formula-editor/helpers/check-errors.helper.mjs +73 -0
  7. package/esm2022/lib/components/form/formula-editor/helpers/create-tags.helper.mjs +17 -0
  8. package/esm2022/lib/components/form/formula-editor/models/check-error-result.model.mjs +2 -0
  9. package/esm2022/lib/components/form/formula-editor/models/formula-editor.model.mjs +2 -0
  10. package/esm2022/lib/components/form/formula-editor/models/index.mjs +4 -0
  11. package/esm2022/lib/components/form/formula-editor/models/white-list-item.model.mjs +2 -0
  12. package/esm2022/lib/helpers/is-number.helper.mjs +7 -0
  13. package/esm2022/public-api.mjs +4 -1
  14. package/fesm2022/myrta-ui.mjs +492 -10
  15. package/fesm2022/myrta-ui.mjs.map +1 -1
  16. package/lib/components/form/formula-editor/enums/error-messages.enum.d.ts +8 -0
  17. package/lib/components/form/formula-editor/enums/formula-editor-size.enum.d.ts +6 -0
  18. package/lib/components/form/formula-editor/formula-editor.component.d.ts +74 -0
  19. package/lib/components/form/formula-editor/formula-editor.module.d.ts +13 -0
  20. package/lib/components/form/formula-editor/helpers/check-errors.helper.d.ts +6 -0
  21. package/lib/components/form/formula-editor/helpers/create-tags.helper.d.ts +5 -0
  22. package/lib/components/form/formula-editor/models/check-error-result.model.d.ts +5 -0
  23. package/lib/components/form/formula-editor/models/formula-editor.model.d.ts +5 -0
  24. package/lib/components/form/formula-editor/models/index.d.ts +3 -0
  25. package/lib/components/form/formula-editor/models/white-list-item.model.d.ts +5 -0
  26. package/lib/helpers/is-number.helper.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/public-api.d.ts +3 -0
@@ -0,0 +1,8 @@
1
+ export declare enum ErrorTypeEnum {
2
+ Default = "default",
3
+ Interpretation = "interpretation",
4
+ Sequence = "sequence",
5
+ Divider = "divider",
6
+ Bracket = "bracket"
7
+ }
8
+ export declare const ErrorMessagesEnum: Record<ErrorTypeEnum, string>;
@@ -0,0 +1,6 @@
1
+ export declare enum FormulaEditorSizesEnum {
2
+ 'small' = "mrx-formula-editor-sm",
3
+ 'medium' = "mrx-formula-editor-md",
4
+ 'large' = "mrx-formula-editor-lg"
5
+ }
6
+ export type FormulaEditorSizesTypes = 'small' | 'medium' | 'large';
@@ -0,0 +1,74 @@
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { Field } from '../../../services';
4
+ import { WhiteListItemModel, CheckErrorResultModel } from './models';
5
+ import { FormulaEditorValueTypes, FormulaEditorValueWithId } from './models';
6
+ import { FormulaEditorSizesTypes } from './enums/formula-editor-size.enum';
7
+ import * as i0 from "@angular/core";
8
+ export declare class FormulaEditorComponent implements ControlValueAccessor {
9
+ private document;
10
+ private _detector;
11
+ private eRef;
12
+ private _range;
13
+ private _selection;
14
+ private _cursorPosition;
15
+ private searchText;
16
+ private _operatorList;
17
+ private _bracketList;
18
+ private _itemList;
19
+ private _modifiedItemList;
20
+ value: string;
21
+ visibleValue: string;
22
+ isFocused: boolean;
23
+ errorModel: CheckErrorResultModel;
24
+ uuid: string;
25
+ fields: Field[];
26
+ disabled: boolean;
27
+ readonly: boolean;
28
+ placeholder: string;
29
+ customClasses: string;
30
+ size: FormulaEditorSizesTypes;
31
+ invalid: boolean;
32
+ invalidMessage: string | string[];
33
+ checkInvalid: true | false | null;
34
+ set items(items: WhiteListItemModel[]);
35
+ inputElement: ElementRef<HTMLInputElement>;
36
+ changed: EventEmitter<FormulaEditorValueTypes>;
37
+ blurred: EventEmitter<FormulaEditorValueWithId>;
38
+ modelChange: EventEmitter<FormulaEditorValueWithId>;
39
+ constructor(document: Document, _detector: ChangeDetectorRef, eRef: ElementRef);
40
+ get getErrorMessage(): string | string[];
41
+ get filteredList(): WhiteListItemModel[];
42
+ get getInvalid(): boolean;
43
+ get readonlyClass(): string;
44
+ get checkValidClasses(): string;
45
+ get getClasses(): string;
46
+ get getIconClass(): string;
47
+ get canClean(): boolean;
48
+ private get _inputValue();
49
+ writeValue(outsideValue: FormulaEditorValueTypes): void;
50
+ onInput(event: Event): void;
51
+ onFocus(event: Event): void;
52
+ onClear(): void;
53
+ onBlur(event: Event): void;
54
+ onKeyup(event: any): void;
55
+ insertTag(whiteListItem: WhiteListItemModel): void;
56
+ updateVisibleValue(insideValue: string): void;
57
+ updateValue(insideValue: string): void;
58
+ private _modifiedValue;
59
+ private _transformValue;
60
+ private _checkErrors;
61
+ private _toggleError;
62
+ private _disableError;
63
+ private _insertPositionText;
64
+ private _storeCursorPosition;
65
+ private _restoreCursorPosition;
66
+ private _placeCaretAtEnd;
67
+ clickOut(event: Event): void;
68
+ registerOnChange(fn: any): void;
69
+ registerOnTouched(fn: () => {}): void;
70
+ private onChange;
71
+ private onTouched;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormulaEditorComponent, never>;
73
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormulaEditorComponent, "mrx-formula-editor", never, { "fields": { "alias": "fields"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "customClasses": { "alias": "customClasses"; "required": false; }; "size": { "alias": "size"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "invalidMessage": { "alias": "invalidMessage"; "required": false; }; "checkInvalid": { "alias": "checkInvalid"; "required": false; }; "items": { "alias": "items"; "required": false; }; }, { "changed": "changed"; "blurred": "blurred"; "modelChange": "modelChange"; }, never, never, false, never>;
74
+ }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./formula-editor.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "../../chars-left/chars-left.module";
5
+ import * as i4 from "../../error-message/error-message.module";
6
+ import * as i5 from "@angular/forms";
7
+ import * as i6 from "../../save-state/save-state.module";
8
+ import * as i7 from "../../../pipes/safe/safe.module";
9
+ export declare class FormulaEditorModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormulaEditorModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FormulaEditorModule, [typeof i1.FormulaEditorComponent], [typeof i2.CommonModule, typeof i3.CharsLeftModule, typeof i4.ErrorMessageModule, typeof i5.FormsModule, typeof i6.SaveStateModule, typeof i7.SafeModule], [typeof i1.FormulaEditorComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<FormulaEditorModule>;
13
+ }
@@ -0,0 +1,6 @@
1
+ import { CheckErrorResultModel } from '../models/check-error-result.model';
2
+ import { WhiteListItemModel } from '../models/white-list-item.model';
3
+ export declare const checkInterpretationErrors: (error: boolean) => CheckErrorResultModel;
4
+ export declare const checkBracketErrors: (array: string[]) => CheckErrorResultModel;
5
+ export declare const checkSequenceErrors: (array: string[], operatorList: string[], bracketList: string[]) => CheckErrorResultModel;
6
+ export declare const checkDividerErrors: (array: string[], list: WhiteListItemModel[]) => CheckErrorResultModel;
@@ -0,0 +1,5 @@
1
+ export declare const createTag: (content: string) => string;
2
+ export declare const createOperator: (content: string) => string;
3
+ export declare const createNumber: (content: string) => string;
4
+ export declare const createBracket: (content: string) => string;
5
+ export declare const createTagOutside: (content: string) => string;
@@ -0,0 +1,5 @@
1
+ import { ErrorTypeEnum } from '../enums/error-messages.enum';
2
+ export interface CheckErrorResultModel {
3
+ isError: boolean;
4
+ errorType: ErrorTypeEnum;
5
+ }
@@ -0,0 +1,5 @@
1
+ export type FormulaEditorValueTypes = string;
2
+ export interface FormulaEditorValueWithId {
3
+ value: FormulaEditorValueTypes;
4
+ id: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ export * from './formula-editor.model';
2
+ export * from './check-error-result.model';
3
+ export * from './white-list-item.model';
@@ -0,0 +1,5 @@
1
+ export interface WhiteListItemModel {
2
+ sysName: string;
3
+ label: string;
4
+ dropLabel?: string;
5
+ }
@@ -0,0 +1 @@
1
+ export declare const isAn: (value: any) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrta-ui",
3
- "version": "17.0.74",
3
+ "version": "17.0.76",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
package/public-api.d.ts CHANGED
@@ -149,6 +149,9 @@ export * from './lib/components/form/radio-group/models/radio-group.model';
149
149
  export * from './lib/components/form/switch/switch.module';
150
150
  export * from './lib/components/form/switch/switch.component';
151
151
  export * from './lib/components/form/switch/switch.enum';
152
+ export * from './lib/components/form/formula-editor/formula-editor.module';
153
+ export * from './lib/components/form/formula-editor/formula-editor.component';
154
+ export * from './lib/components/form/formula-editor/models';
152
155
  export * from './lib/components/wrappers/widget-wrapper/widget-wrapper.module';
153
156
  export * from './lib/components/wrappers/widget-wrapper/widget-wrapper.component';
154
157
  export * from './lib/components/wrappers/content-wrapper/content-wrapper.module';