myrta-ui 1.1.20 → 1.1.22
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.
- package/esm2020/lib/components/form/formula-editor/enums/error-messages.enum.mjs +16 -0
- package/esm2020/lib/components/form/formula-editor/formula-editor.component.mjs +301 -0
- package/esm2020/lib/components/form/formula-editor/formula-editor.module.mjs +50 -0
- package/esm2020/lib/components/form/formula-editor/helpers/check-errors.helper.mjs +73 -0
- package/esm2020/lib/components/form/formula-editor/helpers/create-tags.helper.mjs +17 -0
- package/esm2020/lib/components/form/formula-editor/models/check-error-result.model.mjs +2 -0
- package/esm2020/lib/components/form/formula-editor/models/formula-editor.model.mjs +2 -0
- package/esm2020/lib/components/form/formula-editor/models/index.mjs +4 -0
- package/esm2020/lib/components/form/formula-editor/models/white-list-item.model.mjs +2 -0
- package/esm2020/lib/helpers/is-number.helper.mjs +7 -0
- package/esm2020/lib/services/mrx-form-validator/mrx-form-validator.mjs +7 -2
- package/esm2020/lib/services/mrx-form-validator/validations/callback.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/email.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/max-length.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/max-value.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/min-length.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/min-value.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/pattern.validation.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/required.validation.mjs +2 -2
- package/esm2020/public-api.mjs +4 -1
- package/fesm2015/myrta-ui.mjs +464 -17
- package/fesm2015/myrta-ui.mjs.map +1 -1
- package/fesm2020/myrta-ui.mjs +462 -17
- package/fesm2020/myrta-ui.mjs.map +1 -1
- package/lib/components/form/formula-editor/enums/error-messages.enum.d.ts +8 -0
- package/lib/components/form/formula-editor/formula-editor.component.d.ts +67 -0
- package/lib/components/form/formula-editor/formula-editor.module.d.ts +14 -0
- package/lib/components/form/formula-editor/helpers/check-errors.helper.d.ts +6 -0
- package/lib/components/form/formula-editor/helpers/create-tags.helper.d.ts +5 -0
- package/lib/components/form/formula-editor/models/check-error-result.model.d.ts +5 -0
- package/lib/components/form/formula-editor/models/formula-editor.model.d.ts +5 -0
- package/lib/components/form/formula-editor/models/index.d.ts +3 -0
- package/lib/components/form/formula-editor/models/white-list-item.model.d.ts +4 -0
- package/lib/helpers/is-number.helper.d.ts +1 -0
- package/lib/services/mrx-form-validator/validations/callback.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/email.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/max-length.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/max-value.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/min-length.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/min-value.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/pattern.validation.d.ts +1 -1
- package/lib/services/mrx-form-validator/validations/required.validation.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
package/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Input, Pipe, EventEmitter, ChangeDetectionStrategy, Output, NgModule, CUSTOM_ELEMENTS_SCHEMA, Injectable, forwardRef, InjectionToken, TemplateRef, Inject, Injector, Directive, HostListener, ContentChild, ViewChild, QueryList, Optional, ViewChildren, ElementRef, ViewEncapsulation, ContentChildren, HostBinding, LOCALE_ID } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
|
-
import { CommonModule, registerLocaleData, DatePipe } from '@angular/common';
|
|
4
|
+
import { CommonModule, registerLocaleData, DatePipe, DOCUMENT } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/platform-browser';
|
|
6
6
|
import * as i1$4 from '@angular/animations';
|
|
7
7
|
import { trigger, state, style, transition, animate, group, keyframes } from '@angular/animations';
|
|
@@ -4255,7 +4255,7 @@ const getErrorMessageHelper = (key, invalidMessages, messages, params) => {
|
|
|
4255
4255
|
};
|
|
4256
4256
|
|
|
4257
4257
|
const requiredValidation = (value, validations, key, invalidMessages) => {
|
|
4258
|
-
const result = { isValid: true, message:
|
|
4258
|
+
const result = { isValid: true, message: null };
|
|
4259
4259
|
if (Array.isArray(value) && validations.type !== 'single') {
|
|
4260
4260
|
value.forEach((field, idx) => {
|
|
4261
4261
|
if ((field === '' || field === null || field === undefined)) {
|
|
@@ -4277,7 +4277,7 @@ const requiredValidation = (value, validations, key, invalidMessages) => {
|
|
|
4277
4277
|
|
|
4278
4278
|
const emailValidation = (value, validations, key, invalidMessages) => {
|
|
4279
4279
|
const emailRegExp = /^[a-zA-Z0-9._а-яА-Я-]+@[a-zA-Zа-яА-Я0-9.-]+\.[a-zA-Zа-яА-Я]{2,10}$/;
|
|
4280
|
-
const result = { isValid: true, message:
|
|
4280
|
+
const result = { isValid: true, message: null };
|
|
4281
4281
|
if (!emailRegExp.test(value)) {
|
|
4282
4282
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages);
|
|
4283
4283
|
result.isValid = false;
|
|
@@ -4287,7 +4287,7 @@ const emailValidation = (value, validations, key, invalidMessages) => {
|
|
|
4287
4287
|
|
|
4288
4288
|
const patternValidation = (value, validations, key, invalidMessages) => {
|
|
4289
4289
|
const validation = validations[key];
|
|
4290
|
-
const result = { isValid: true, message:
|
|
4290
|
+
const result = { isValid: true, message: null };
|
|
4291
4291
|
if (!validation.test(value)) {
|
|
4292
4292
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages);
|
|
4293
4293
|
result.isValid = false;
|
|
@@ -4296,7 +4296,7 @@ const patternValidation = (value, validations, key, invalidMessages) => {
|
|
|
4296
4296
|
};
|
|
4297
4297
|
|
|
4298
4298
|
const maxLengthValidation = (value, validations, key, invalidMessages) => {
|
|
4299
|
-
const result = { isValid: true, message:
|
|
4299
|
+
const result = { isValid: true, message: null };
|
|
4300
4300
|
if (String(value).length > Number(validations[key])) {
|
|
4301
4301
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4302
4302
|
result.isValid = false;
|
|
@@ -4305,7 +4305,7 @@ const maxLengthValidation = (value, validations, key, invalidMessages) => {
|
|
|
4305
4305
|
};
|
|
4306
4306
|
|
|
4307
4307
|
const minLengthValidation = (value, validations, key, invalidMessages) => {
|
|
4308
|
-
const result = { isValid: true, message:
|
|
4308
|
+
const result = { isValid: true, message: null };
|
|
4309
4309
|
if (String(value).length < Number(validations[key]) && !!validations[ValidationTypesEnum.Required]) {
|
|
4310
4310
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4311
4311
|
result.isValid = false;
|
|
@@ -4314,7 +4314,7 @@ const minLengthValidation = (value, validations, key, invalidMessages) => {
|
|
|
4314
4314
|
};
|
|
4315
4315
|
|
|
4316
4316
|
const minValueValidation = (value, validations, key, invalidMessages) => {
|
|
4317
|
-
const result = { isValid: true, message:
|
|
4317
|
+
const result = { isValid: true, message: null };
|
|
4318
4318
|
if (parseInt(value) > Number(validations[key])) {
|
|
4319
4319
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4320
4320
|
result.isValid = false;
|
|
@@ -4323,7 +4323,7 @@ const minValueValidation = (value, validations, key, invalidMessages) => {
|
|
|
4323
4323
|
};
|
|
4324
4324
|
|
|
4325
4325
|
const maxValueValidation = (value, validations, key, invalidMessages) => {
|
|
4326
|
-
const result = { isValid: true, message:
|
|
4326
|
+
const result = { isValid: true, message: null };
|
|
4327
4327
|
if (parseInt(value) < Number(validations[key])) {
|
|
4328
4328
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4329
4329
|
result.isValid = false;
|
|
@@ -4332,7 +4332,7 @@ const maxValueValidation = (value, validations, key, invalidMessages) => {
|
|
|
4332
4332
|
};
|
|
4333
4333
|
|
|
4334
4334
|
const callbackValidation = (value, validations, key, invalidMessages) => {
|
|
4335
|
-
const result = { isValid: true, message:
|
|
4335
|
+
const result = { isValid: true, message: null };
|
|
4336
4336
|
if (validations[ValidationTypesEnum.Callback] && typeof validations[ValidationTypesEnum.Callback] === 'function') {
|
|
4337
4337
|
const validation = validations[ValidationTypesEnum.Callback];
|
|
4338
4338
|
const callbackResult = validation(value);
|
|
@@ -4426,6 +4426,9 @@ class MrxFormValidator {
|
|
|
4426
4426
|
if (!validateEmptyValue && (value.length === 0)) {
|
|
4427
4427
|
return;
|
|
4428
4428
|
}
|
|
4429
|
+
if (!this._isValid) {
|
|
4430
|
+
return;
|
|
4431
|
+
}
|
|
4429
4432
|
for (let key in validations) {
|
|
4430
4433
|
switch (key) {
|
|
4431
4434
|
case ValidationTypesEnum.Required:
|
|
@@ -4546,10 +4549,12 @@ class MrxFormValidator {
|
|
|
4546
4549
|
}
|
|
4547
4550
|
isValid() {
|
|
4548
4551
|
for (let key in this._validations) {
|
|
4552
|
+
if (!this._isValid) {
|
|
4553
|
+
return this._isValid;
|
|
4554
|
+
}
|
|
4549
4555
|
this.errors[key] = null;
|
|
4550
4556
|
this.validateField(this._fields[key], key, this._validations[key], true);
|
|
4551
4557
|
}
|
|
4552
|
-
console.log(1, this._isValid);
|
|
4553
4558
|
return this._isValid;
|
|
4554
4559
|
}
|
|
4555
4560
|
// TODO Вырезать в будущем
|
|
@@ -11205,13 +11210,13 @@ async function getBase64FromUrl(url) {
|
|
|
11205
11210
|
});
|
|
11206
11211
|
}
|
|
11207
11212
|
|
|
11208
|
-
var ErrorMessagesEnum;
|
|
11213
|
+
var ErrorMessagesEnum$1;
|
|
11209
11214
|
(function (ErrorMessagesEnum) {
|
|
11210
11215
|
ErrorMessagesEnum["TooManyFiles"] = "\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u043D\u043E\u0433\u043E \u0444\u0430\u0439\u043B\u043E\u0432";
|
|
11211
11216
|
ErrorMessagesEnum["FileTooBig"] = "\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439 \u0444\u0430\u0439\u043B";
|
|
11212
11217
|
ErrorMessagesEnum["EmptyFile"] = "\u041F\u0443\u0441\u0442\u043E\u0439 \u0444\u0430\u0439\u043B";
|
|
11213
11218
|
ErrorMessagesEnum["InvalidFileFormat"] = "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430";
|
|
11214
|
-
})(ErrorMessagesEnum || (ErrorMessagesEnum = {}));
|
|
11219
|
+
})(ErrorMessagesEnum$1 || (ErrorMessagesEnum$1 = {}));
|
|
11215
11220
|
|
|
11216
11221
|
var InputFileTargetTypesEnum;
|
|
11217
11222
|
(function (InputFileTargetTypesEnum) {
|
|
@@ -11249,10 +11254,10 @@ class InputFileComponent {
|
|
|
11249
11254
|
this.invalidMessage = '';
|
|
11250
11255
|
this.checkInvalid = null;
|
|
11251
11256
|
// ERROR MESSAGES
|
|
11252
|
-
this.messageTooManyFiles = ErrorMessagesEnum.TooManyFiles;
|
|
11253
|
-
this.messageFileTooBig = ErrorMessagesEnum.FileTooBig;
|
|
11254
|
-
this.messageEmptyFile = ErrorMessagesEnum.EmptyFile;
|
|
11255
|
-
this.messageInvalidFileFormat = ErrorMessagesEnum.InvalidFileFormat;
|
|
11257
|
+
this.messageTooManyFiles = ErrorMessagesEnum$1.TooManyFiles;
|
|
11258
|
+
this.messageFileTooBig = ErrorMessagesEnum$1.FileTooBig;
|
|
11259
|
+
this.messageEmptyFile = ErrorMessagesEnum$1.EmptyFile;
|
|
11260
|
+
this.messageInvalidFileFormat = ErrorMessagesEnum$1.InvalidFileFormat;
|
|
11256
11261
|
// PLACEHOLDERS
|
|
11257
11262
|
this.placeholder = 'Перенесите файл с устройства или нажмите на данное поле для добавления файла';
|
|
11258
11263
|
this.placeholderFileMaxSize = 'Размер файла: не больше';
|
|
@@ -17310,11 +17315,451 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
17310
17315
|
}]
|
|
17311
17316
|
}] });
|
|
17312
17317
|
|
|
17318
|
+
var ErrorTypeEnum;
|
|
17319
|
+
(function (ErrorTypeEnum) {
|
|
17320
|
+
ErrorTypeEnum["Default"] = "default";
|
|
17321
|
+
ErrorTypeEnum["Interpretation"] = "interpretation";
|
|
17322
|
+
ErrorTypeEnum["Sequence"] = "sequence";
|
|
17323
|
+
ErrorTypeEnum["Divider"] = "divider";
|
|
17324
|
+
ErrorTypeEnum["Bracket"] = "bracket";
|
|
17325
|
+
})(ErrorTypeEnum || (ErrorTypeEnum = {}));
|
|
17326
|
+
const ErrorMessagesEnum = {
|
|
17327
|
+
[ErrorTypeEnum.Default]: '',
|
|
17328
|
+
[ErrorTypeEnum.Interpretation]: 'Не удалось интерпретировать введенное значение',
|
|
17329
|
+
[ErrorTypeEnum.Sequence]: 'Некорректная последовательность элементов',
|
|
17330
|
+
[ErrorTypeEnum.Divider]: 'Некорректный разделитель',
|
|
17331
|
+
[ErrorTypeEnum.Bracket]: 'Не все скобки закрыты'
|
|
17332
|
+
};
|
|
17333
|
+
|
|
17334
|
+
//
|
|
17335
|
+
const createTag = (content) => {
|
|
17336
|
+
return `<div class="tag" contenteditable="false" tabindex="-1">${content}</div> `;
|
|
17337
|
+
};
|
|
17338
|
+
const createOperator = (content) => {
|
|
17339
|
+
return `<div class="operator" contenteditable="false" tabindex="-1">${content}</div> `;
|
|
17340
|
+
};
|
|
17341
|
+
const createNumber = (content) => {
|
|
17342
|
+
return `<div class="number" contenteditable="false" tabindex="-1">${content}</div> `;
|
|
17343
|
+
};
|
|
17344
|
+
const createBracket = (content) => {
|
|
17345
|
+
return `<div class="bracket" contenteditable="false" tabindex="-1">${content}</div> `;
|
|
17346
|
+
};
|
|
17347
|
+
const createTagOutside = (content) => {
|
|
17348
|
+
return `{${content}}`;
|
|
17349
|
+
};
|
|
17350
|
+
|
|
17351
|
+
const isAn = (value) => {
|
|
17352
|
+
if (value instanceof Number) {
|
|
17353
|
+
value = value.valueOf();
|
|
17354
|
+
}
|
|
17355
|
+
return !isNaN(parseFloat(value)) && isFinite(value);
|
|
17356
|
+
};
|
|
17357
|
+
|
|
17358
|
+
const checkInterpretationErrors = (error) => {
|
|
17359
|
+
return {
|
|
17360
|
+
isError: error,
|
|
17361
|
+
errorType: ErrorTypeEnum.Interpretation
|
|
17362
|
+
};
|
|
17363
|
+
};
|
|
17364
|
+
const checkBracketErrors = (array) => {
|
|
17365
|
+
const findOpenedBrackets = array.filter(i => i === '(');
|
|
17366
|
+
const findClosedBrackets = array.filter(i => i === ')');
|
|
17367
|
+
const isError = !(findOpenedBrackets.length === findClosedBrackets.length);
|
|
17368
|
+
return {
|
|
17369
|
+
isError: isError,
|
|
17370
|
+
errorType: ErrorTypeEnum.Bracket
|
|
17371
|
+
};
|
|
17372
|
+
};
|
|
17373
|
+
const checkSequenceErrors = (array, operatorList, bracketList) => {
|
|
17374
|
+
let isError = false;
|
|
17375
|
+
array.forEach((item, idx) => {
|
|
17376
|
+
if (idx === 0) {
|
|
17377
|
+
isError = isError || !!operatorList.find(i => i === item);
|
|
17378
|
+
}
|
|
17379
|
+
else if (idx > 0 && idx < array.length - 1) {
|
|
17380
|
+
if (!operatorList.find(i => i === item)) {
|
|
17381
|
+
if (bracketList.find(i => i === item)) {
|
|
17382
|
+
if (item === '(') {
|
|
17383
|
+
isError = isError || !operatorList.find(i => i === array[idx - 1]);
|
|
17384
|
+
}
|
|
17385
|
+
else if (item === ')') {
|
|
17386
|
+
isError = isError || !operatorList.find(i => i === array[idx + 1]);
|
|
17387
|
+
}
|
|
17388
|
+
}
|
|
17389
|
+
else {
|
|
17390
|
+
if (!bracketList.find(i => i === array[idx - 1])) {
|
|
17391
|
+
isError = isError || !operatorList.find(i => i === array[idx - 1]);
|
|
17392
|
+
}
|
|
17393
|
+
}
|
|
17394
|
+
}
|
|
17395
|
+
}
|
|
17396
|
+
else if (idx === array.length - 1) {
|
|
17397
|
+
if (!operatorList.find(i => i === item)) {
|
|
17398
|
+
if (!bracketList.find(i => i === item)) {
|
|
17399
|
+
isError = isError || !operatorList.find(i => i === array[idx - 1]);
|
|
17400
|
+
}
|
|
17401
|
+
else {
|
|
17402
|
+
isError = isError || !!operatorList.find(i => i === array[idx - 1]);
|
|
17403
|
+
}
|
|
17404
|
+
}
|
|
17405
|
+
else {
|
|
17406
|
+
isError = isError || true;
|
|
17407
|
+
}
|
|
17408
|
+
}
|
|
17409
|
+
});
|
|
17410
|
+
return {
|
|
17411
|
+
isError: isError,
|
|
17412
|
+
errorType: ErrorTypeEnum.Sequence
|
|
17413
|
+
};
|
|
17414
|
+
};
|
|
17415
|
+
const checkDividerErrors = (array, list) => {
|
|
17416
|
+
const regExp = /^[0-9]*[,/][0-9]+$/;
|
|
17417
|
+
let isError = false;
|
|
17418
|
+
array.some((item) => {
|
|
17419
|
+
if (regExp.test(item)) {
|
|
17420
|
+
isError = true;
|
|
17421
|
+
return;
|
|
17422
|
+
}
|
|
17423
|
+
});
|
|
17424
|
+
return {
|
|
17425
|
+
isError: isError,
|
|
17426
|
+
errorType: ErrorTypeEnum.Divider
|
|
17427
|
+
};
|
|
17428
|
+
};
|
|
17429
|
+
|
|
17430
|
+
class FormulaEditorComponent {
|
|
17431
|
+
constructor(document, _detector, eRef) {
|
|
17432
|
+
this.document = document;
|
|
17433
|
+
this._detector = _detector;
|
|
17434
|
+
this.eRef = eRef;
|
|
17435
|
+
this._selection = null;
|
|
17436
|
+
this._cursorPosition = {
|
|
17437
|
+
startContainer: null,
|
|
17438
|
+
endContainer: null,
|
|
17439
|
+
startOffset: 0,
|
|
17440
|
+
endOffset: 0
|
|
17441
|
+
};
|
|
17442
|
+
this.searchText = '';
|
|
17443
|
+
this.operatorList = ['+', '-', '*', '/'];
|
|
17444
|
+
this.bracketList = ['(', ')'];
|
|
17445
|
+
this.value = '';
|
|
17446
|
+
this.visibleValue = '';
|
|
17447
|
+
this.isFocused = false;
|
|
17448
|
+
this.errorModel = {
|
|
17449
|
+
isError: false,
|
|
17450
|
+
errorType: ErrorTypeEnum.Default
|
|
17451
|
+
};
|
|
17452
|
+
// SAVE STATE
|
|
17453
|
+
this.uuid = v4();
|
|
17454
|
+
this.fields = [];
|
|
17455
|
+
this.whiteList = [];
|
|
17456
|
+
this.disabled = false;
|
|
17457
|
+
this.readonly = false;
|
|
17458
|
+
this.placeholder = '';
|
|
17459
|
+
this.customClasses = '';
|
|
17460
|
+
// VALIDATE
|
|
17461
|
+
this.invalid = false;
|
|
17462
|
+
this.invalidMessage = '';
|
|
17463
|
+
this.checkInvalid = null;
|
|
17464
|
+
this.changed = new EventEmitter();
|
|
17465
|
+
this.blurred = new EventEmitter();
|
|
17466
|
+
this.modelChange = new EventEmitter();
|
|
17467
|
+
this.onChange = (value) => {
|
|
17468
|
+
};
|
|
17469
|
+
this.onTouched = () => {
|
|
17470
|
+
};
|
|
17471
|
+
}
|
|
17472
|
+
get getErrorMessage() {
|
|
17473
|
+
return this.invalidMessage || ErrorMessagesEnum[this.errorModel.errorType];
|
|
17474
|
+
}
|
|
17475
|
+
get filteredList() {
|
|
17476
|
+
return this.whiteList.filter(item => item.label.includes(this.searchText));
|
|
17477
|
+
}
|
|
17478
|
+
get getInvalid() {
|
|
17479
|
+
return this.errorModel.isError || this.invalid;
|
|
17480
|
+
}
|
|
17481
|
+
get readonlyClass() {
|
|
17482
|
+
return this.readonly ? 'mrx-input__readonly' : '';
|
|
17483
|
+
}
|
|
17484
|
+
get checkValidClasses() {
|
|
17485
|
+
return this.checkInvalid === false ? 'mrx-input-checked-success' : this.checkInvalid === true ? 'mrx-input-checked-error' : '';
|
|
17486
|
+
}
|
|
17487
|
+
get getClasses() {
|
|
17488
|
+
return `${this.customClasses} ${this.readonlyClass} ${this.checkValidClasses}`;
|
|
17489
|
+
}
|
|
17490
|
+
get _inputValue() {
|
|
17491
|
+
return this.inputElement.nativeElement.textContent || '';
|
|
17492
|
+
}
|
|
17493
|
+
writeValue(outsideValue) {
|
|
17494
|
+
if (outsideValue !== null) {
|
|
17495
|
+
this.value = outsideValue;
|
|
17496
|
+
this.visibleValue = this._transformValue(this._modifiedValue(outsideValue)).visibleValue;
|
|
17497
|
+
}
|
|
17498
|
+
}
|
|
17499
|
+
onInput(event) {
|
|
17500
|
+
const { value, searchText } = this._transformValue(this._inputValue, false);
|
|
17501
|
+
this.updateValue(value);
|
|
17502
|
+
this.searchText = searchText;
|
|
17503
|
+
this._storeCursorPosition();
|
|
17504
|
+
}
|
|
17505
|
+
onBlur(event) {
|
|
17506
|
+
this._storeCursorPosition();
|
|
17507
|
+
this.blurred.emit({ value: this.value, id: this.uuid });
|
|
17508
|
+
}
|
|
17509
|
+
onFocus(event) {
|
|
17510
|
+
this.isFocused = true;
|
|
17511
|
+
this._detector.markForCheck();
|
|
17512
|
+
}
|
|
17513
|
+
insertTag(whiteListItem) {
|
|
17514
|
+
this._restoreCursorPosition(this.inputElement.nativeElement);
|
|
17515
|
+
this._insertPositionText(whiteListItem.label);
|
|
17516
|
+
setTimeout(() => {
|
|
17517
|
+
const { value, visibleValue } = this._transformValue(this._inputValue, false);
|
|
17518
|
+
this.updateValue(value);
|
|
17519
|
+
this.updateVisibleValue(visibleValue);
|
|
17520
|
+
});
|
|
17521
|
+
this._placeCaretAtEnd();
|
|
17522
|
+
this.searchText = '';
|
|
17523
|
+
}
|
|
17524
|
+
updateVisibleValue(insideValue) {
|
|
17525
|
+
this.visibleValue = insideValue;
|
|
17526
|
+
this._storeCursorPosition();
|
|
17527
|
+
}
|
|
17528
|
+
updateValue(insideValue) {
|
|
17529
|
+
this.value = insideValue;
|
|
17530
|
+
this.changed.emit(insideValue);
|
|
17531
|
+
this.modelChange.emit({ value: insideValue, id: this.uuid });
|
|
17532
|
+
this.onChange(insideValue);
|
|
17533
|
+
this.onTouched();
|
|
17534
|
+
}
|
|
17535
|
+
_modifiedValue(value) {
|
|
17536
|
+
const clearedValue = value.trim().split(' ').filter(e => e !== '');
|
|
17537
|
+
return clearedValue.map(v => {
|
|
17538
|
+
const findItem = this.whiteList.find(w => `{${w.sysName}}` === v);
|
|
17539
|
+
return findItem ? findItem.label : v;
|
|
17540
|
+
}).join(' ');
|
|
17541
|
+
}
|
|
17542
|
+
_transformValue(content, analise = false) {
|
|
17543
|
+
const valueArray = content.split(/[\s\u00A0]+/).filter(e => e !== '');
|
|
17544
|
+
const visibleValueArray = [];
|
|
17545
|
+
const originalValueArray = [];
|
|
17546
|
+
let isInterpretationError = false;
|
|
17547
|
+
let searchText = '';
|
|
17548
|
+
valueArray.forEach((item, index, array) => {
|
|
17549
|
+
const clearedItem = item.trim();
|
|
17550
|
+
const findItem = this.whiteList.find(v => clearedItem.includes(v.label));
|
|
17551
|
+
if (findItem) {
|
|
17552
|
+
visibleValueArray.push(createTag(findItem.label));
|
|
17553
|
+
originalValueArray.push(createTagOutside(findItem.sysName));
|
|
17554
|
+
}
|
|
17555
|
+
else if (this.bracketList.find(v => v === clearedItem)) {
|
|
17556
|
+
visibleValueArray.push(createBracket(clearedItem));
|
|
17557
|
+
originalValueArray.push(clearedItem);
|
|
17558
|
+
}
|
|
17559
|
+
else if (this.operatorList.find(v => v === clearedItem)) {
|
|
17560
|
+
visibleValueArray.push(createOperator(clearedItem));
|
|
17561
|
+
originalValueArray.push(clearedItem);
|
|
17562
|
+
}
|
|
17563
|
+
else if (isAn(clearedItem)) {
|
|
17564
|
+
visibleValueArray.push(createNumber(clearedItem));
|
|
17565
|
+
originalValueArray.push(clearedItem);
|
|
17566
|
+
}
|
|
17567
|
+
else {
|
|
17568
|
+
visibleValueArray.push(clearedItem);
|
|
17569
|
+
originalValueArray.push(clearedItem);
|
|
17570
|
+
searchText = clearedItem;
|
|
17571
|
+
isInterpretationError = true;
|
|
17572
|
+
}
|
|
17573
|
+
});
|
|
17574
|
+
if (analise) {
|
|
17575
|
+
this._checkErrors(originalValueArray, isInterpretationError);
|
|
17576
|
+
}
|
|
17577
|
+
return {
|
|
17578
|
+
value: originalValueArray.join(' '),
|
|
17579
|
+
visibleValue: visibleValueArray.join(' '),
|
|
17580
|
+
searchText: searchText
|
|
17581
|
+
};
|
|
17582
|
+
}
|
|
17583
|
+
_checkErrors(valueArray, isInterpretationError) {
|
|
17584
|
+
this._disableError();
|
|
17585
|
+
this._toggleError(checkBracketErrors(valueArray));
|
|
17586
|
+
this._toggleError(checkDividerErrors(valueArray, this.whiteList));
|
|
17587
|
+
this._toggleError(checkSequenceErrors(valueArray, this.operatorList, this.bracketList));
|
|
17588
|
+
this._toggleError(checkInterpretationErrors(isInterpretationError));
|
|
17589
|
+
}
|
|
17590
|
+
_toggleError(errorModel) {
|
|
17591
|
+
if (!this.errorModel.isError) {
|
|
17592
|
+
this.errorModel = errorModel;
|
|
17593
|
+
}
|
|
17594
|
+
this._detector.detectChanges();
|
|
17595
|
+
}
|
|
17596
|
+
_disableError() {
|
|
17597
|
+
this.errorModel = {
|
|
17598
|
+
isError: false,
|
|
17599
|
+
errorType: ErrorTypeEnum.Default
|
|
17600
|
+
};
|
|
17601
|
+
this._detector.detectChanges();
|
|
17602
|
+
}
|
|
17603
|
+
_insertPositionText(content) {
|
|
17604
|
+
const node = document.createTextNode(content);
|
|
17605
|
+
try {
|
|
17606
|
+
if (this._range) {
|
|
17607
|
+
this._range.deleteContents();
|
|
17608
|
+
this._range.insertNode(node);
|
|
17609
|
+
this._range = this._range.cloneRange();
|
|
17610
|
+
this._range.selectNodeContents(node);
|
|
17611
|
+
this._range.collapse(false);
|
|
17612
|
+
}
|
|
17613
|
+
}
|
|
17614
|
+
catch (e) {
|
|
17615
|
+
}
|
|
17616
|
+
}
|
|
17617
|
+
_storeCursorPosition() {
|
|
17618
|
+
this._selection = window.getSelection();
|
|
17619
|
+
if (this._selection && this._selection.rangeCount > 0) {
|
|
17620
|
+
this._range = this._selection.getRangeAt(0);
|
|
17621
|
+
this._cursorPosition.startContainer = this._range.startContainer;
|
|
17622
|
+
this._cursorPosition.endContainer = this._range.endContainer;
|
|
17623
|
+
this._cursorPosition.startOffset = this._range.startOffset;
|
|
17624
|
+
this._cursorPosition.endOffset = this._range.endOffset;
|
|
17625
|
+
}
|
|
17626
|
+
this._detector.detectChanges();
|
|
17627
|
+
}
|
|
17628
|
+
_restoreCursorPosition(element) {
|
|
17629
|
+
this._range = document.createRange();
|
|
17630
|
+
if (this._cursorPosition.startContainer && this._cursorPosition.endContainer) {
|
|
17631
|
+
this._range.setStart(this._cursorPosition.startContainer, this._cursorPosition.startOffset);
|
|
17632
|
+
this._range.setEnd(this._cursorPosition.endContainer, this._cursorPosition.endOffset);
|
|
17633
|
+
}
|
|
17634
|
+
this._selection = document.getSelection();
|
|
17635
|
+
if (this._selection) {
|
|
17636
|
+
this._selection.removeAllRanges();
|
|
17637
|
+
this._selection.addRange(this._range);
|
|
17638
|
+
element.focus();
|
|
17639
|
+
}
|
|
17640
|
+
}
|
|
17641
|
+
_placeCaretAtEnd() {
|
|
17642
|
+
setTimeout(() => {
|
|
17643
|
+
this._range = document.createRange();
|
|
17644
|
+
this._selection = document.getSelection();
|
|
17645
|
+
if (this._selection) {
|
|
17646
|
+
this._range.selectNodeContents(this.inputElement.nativeElement);
|
|
17647
|
+
this._range.collapse(false);
|
|
17648
|
+
this._selection.removeAllRanges();
|
|
17649
|
+
this._selection.addRange(this._range);
|
|
17650
|
+
this.inputElement.nativeElement.focus();
|
|
17651
|
+
}
|
|
17652
|
+
});
|
|
17653
|
+
}
|
|
17654
|
+
clickOut(event) {
|
|
17655
|
+
if (!this.eRef.nativeElement.contains(event.target)) {
|
|
17656
|
+
const { value, visibleValue } = this._transformValue(this._inputValue, true);
|
|
17657
|
+
this.updateValue(value);
|
|
17658
|
+
this.updateVisibleValue(visibleValue);
|
|
17659
|
+
this.isFocused = false;
|
|
17660
|
+
this._detector.detectChanges();
|
|
17661
|
+
}
|
|
17662
|
+
}
|
|
17663
|
+
registerOnChange(fn) {
|
|
17664
|
+
this.onChange = fn;
|
|
17665
|
+
}
|
|
17666
|
+
registerOnTouched(fn) {
|
|
17667
|
+
this.onTouched = fn;
|
|
17668
|
+
}
|
|
17669
|
+
}
|
|
17670
|
+
FormulaEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorComponent, deps: [{ token: DOCUMENT }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
17671
|
+
FormulaEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: FormulaEditorComponent, selector: "mrx-formula-editor", inputs: { fields: "fields", whiteList: "whiteList", disabled: "disabled", readonly: "readonly", placeholder: "placeholder", customClasses: "customClasses", invalid: "invalid", invalidMessage: "invalidMessage", checkInvalid: "checkInvalid" }, outputs: { changed: "changed", blurred: "blurred", modelChange: "modelChange" }, host: { listeners: { "document:click": "clickOut($event)" } }, providers: [{
|
|
17672
|
+
provide: NG_VALUE_ACCESSOR,
|
|
17673
|
+
useExisting: forwardRef(() => FormulaEditorComponent),
|
|
17674
|
+
multi: true
|
|
17675
|
+
}], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], ngImport: i0, template: "<div\r\n class=\"mrx-formula-editor\"\r\n [class.mrx-input-error]=\"getInvalid\"\r\n [class.-disabled]=\"disabled\"\r\n [class.-readonly]=\"readonly\"\r\n [class]=\"getClasses\"\r\n>\r\n <div class=\"mrx-formula-editor__wrapper\">\r\n <div\r\n [innerHTML]=\"visibleValue.trim() | safe\"\r\n #inputElement\r\n class=\"mrx-formula-editor__box\"\r\n contenteditable=\"true\"\r\n [attr.data-ph]=\"placeholder\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (focus)=\"onFocus($event)\"\r\n ></div>\r\n\r\n <div class=\"mrx-formula-editor__popup\" *ngIf=\"isFocused\">\r\n <ng-container *ngIf=\"errorModel.isError && isFocused\">\r\n <div class=\"mrx-formula-editor__popup--error\">\r\n {{ getErrorMessage }}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"filteredList.length; else emptyList\">\r\n <div\r\n class=\"mrx-formula-editor__popup--row\"\r\n *ngFor=\"let item of filteredList\"\r\n (click)=\"insertTag(item); $event.stopPropagation()\"\r\n >\r\n {{ item.label }}\r\n </div>\r\n </ng-container>\r\n <ng-template #emptyList>\r\n <div class=\"mrx-formula-editor__popup--row\">\r\n \u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432\r\n </div>\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <mrx-error-message\r\n *ngIf=\"getInvalid && getErrorMessage && !isFocused\"\r\n [invalidMessage]=\"getErrorMessage\"\r\n ></mrx-error-message>\r\n\r\n <mrx-save-state [id]=\"uuid\" [fields]=\"fields\"></mrx-save-state>\r\n</div>\r\n", styles: [".mrx-formula-editor{position:relative}.mrx-formula-editor__box{font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:36px;padding:5px var(--spacing-3, 12px) 5px var(--spacing-2, 8px);border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1, 4px);outline:none;color:var(--neutral-text-primary, #262626);transition:outline-width .2s,border .2s;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space}.mrx-formula-editor__box:focus,.mrx-formula-editor__box:active{outline:var(--neutral-bg-island-default) solid var(--border-width-focused)}.mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--neutral-bg-stroke-hover)}.mrx-formula-editor__wrapper{position:relative}.mrx-formula-editor__box ::ng-deep .tag{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);border-radius:var(--border-radius-1, 4px);background:var(--brand-bg-secondary-default, #EDF5FF);padding:6px 12px;margin:0 2px;cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .bracket{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);color:var(--neutral-text-tertiary, #71767E);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .operator{display:inline-flex;font-family:var(--body-lg-font-family, \"PT Sans\");font-size:var(--body-lg-font-size, 16px);font-weight:var(--body-lg-font-weight, 400);line-height:var(--body-lg-line-height, 24px);color:var(--system-text-attention, #AC5C06);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .number{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);color:var(--system-text-negative, #8E2100);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__popup{position:absolute;width:100%;border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1);background-color:#fff;max-height:240px;overflow-x:hidden;overflow-y:auto;margin-top:4px}.mrx-formula-editor__popup--error{padding:var(--spacing-2) var(--spacing-4);font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);color:var(--system-text-negative, #8E2100)}.mrx-formula-editor__popup--row{font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);padding:calc(var(--spacing-2) + var(--spacing-half)) var(--spacing-4);white-space:normal;transition:background-color .2s}.mrx-formula-editor__popup--row:hover{cursor:pointer;background-color:var(--Bg2)!important}.mrx-formula-editor__box:empty:not(:focus):before{content:attr(data-ph);color:var(--neutral-text-tertiary, #71767E);font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);padding-left:8px}.mrx-formula-editor.-disabled .mrx-formula-editor__box{background-color:var(--neutral-bg-disabled, #EEF0F4);color:var(--neutral-text-tertiary, #71767E);pointer-events:none}.mrx-formula-editor.-readonly .mrx-formula-editor__box{background-color:var(--neutral-bg-disabled, #EEF0F4);color:var(--neutral-text-primary, #262626);pointer-events:none}.mrx-formula-editor.mrx-input-error .mrx-formula-editor__box{border-color:var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-error .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-checked-error .mrx-formula-editor__box{border-color:var(--system-bg-controls-negative-default);background-color:var(--system-bg-negative-secondary)}.mrx-formula-editor.mrx-input-checked-error .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-checked-success .mrx-formula-editor__box{background-color:var(--system-bg-positive-secondary);border-color:var(--system-bg-controls-positive-default)}.mrx-formula-editor.mrx-input-checked-success .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-positive-default)}\n"], components: [{ type: ErrorMessageComponent, selector: "mrx-error-message", inputs: ["invalid", "invalidMessage", "customClasses"] }, { type: SaveStateComponent, selector: "mrx-save-state", inputs: ["type", "fields", "id"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "safe": SafePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
17676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorComponent, decorators: [{
|
|
17677
|
+
type: Component,
|
|
17678
|
+
args: [{ selector: 'mrx-formula-editor', changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
|
|
17679
|
+
provide: NG_VALUE_ACCESSOR,
|
|
17680
|
+
useExisting: forwardRef(() => FormulaEditorComponent),
|
|
17681
|
+
multi: true
|
|
17682
|
+
}], template: "<div\r\n class=\"mrx-formula-editor\"\r\n [class.mrx-input-error]=\"getInvalid\"\r\n [class.-disabled]=\"disabled\"\r\n [class.-readonly]=\"readonly\"\r\n [class]=\"getClasses\"\r\n>\r\n <div class=\"mrx-formula-editor__wrapper\">\r\n <div\r\n [innerHTML]=\"visibleValue.trim() | safe\"\r\n #inputElement\r\n class=\"mrx-formula-editor__box\"\r\n contenteditable=\"true\"\r\n [attr.data-ph]=\"placeholder\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (focus)=\"onFocus($event)\"\r\n ></div>\r\n\r\n <div class=\"mrx-formula-editor__popup\" *ngIf=\"isFocused\">\r\n <ng-container *ngIf=\"errorModel.isError && isFocused\">\r\n <div class=\"mrx-formula-editor__popup--error\">\r\n {{ getErrorMessage }}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"filteredList.length; else emptyList\">\r\n <div\r\n class=\"mrx-formula-editor__popup--row\"\r\n *ngFor=\"let item of filteredList\"\r\n (click)=\"insertTag(item); $event.stopPropagation()\"\r\n >\r\n {{ item.label }}\r\n </div>\r\n </ng-container>\r\n <ng-template #emptyList>\r\n <div class=\"mrx-formula-editor__popup--row\">\r\n \u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432\r\n </div>\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <mrx-error-message\r\n *ngIf=\"getInvalid && getErrorMessage && !isFocused\"\r\n [invalidMessage]=\"getErrorMessage\"\r\n ></mrx-error-message>\r\n\r\n <mrx-save-state [id]=\"uuid\" [fields]=\"fields\"></mrx-save-state>\r\n</div>\r\n", styles: [".mrx-formula-editor{position:relative}.mrx-formula-editor__box{font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:36px;padding:5px var(--spacing-3, 12px) 5px var(--spacing-2, 8px);border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1, 4px);outline:none;color:var(--neutral-text-primary, #262626);transition:outline-width .2s,border .2s;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space}.mrx-formula-editor__box:focus,.mrx-formula-editor__box:active{outline:var(--neutral-bg-island-default) solid var(--border-width-focused)}.mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--neutral-bg-stroke-hover)}.mrx-formula-editor__wrapper{position:relative}.mrx-formula-editor__box ::ng-deep .tag{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);border-radius:var(--border-radius-1, 4px);background:var(--brand-bg-secondary-default, #EDF5FF);padding:6px 12px;margin:0 2px;cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .bracket{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);color:var(--neutral-text-tertiary, #71767E);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .operator{display:inline-flex;font-family:var(--body-lg-font-family, \"PT Sans\");font-size:var(--body-lg-font-size, 16px);font-weight:var(--body-lg-font-weight, 400);line-height:var(--body-lg-line-height, 24px);color:var(--system-text-attention, #AC5C06);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__box ::ng-deep .number{display:inline-flex;font-family:var(--body-md-font-family, \"PT Sans\");font-size:var(--body-md-font-size, 14px);font-weight:var(--body-md-font-weight, 400);line-height:var(--body-md-line-height, 20px);color:var(--system-text-negative, #8E2100);cursor:default;-webkit-user-modify:read-only}.mrx-formula-editor__popup{position:absolute;width:100%;border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1);background-color:#fff;max-height:240px;overflow-x:hidden;overflow-y:auto;margin-top:4px}.mrx-formula-editor__popup--error{padding:var(--spacing-2) var(--spacing-4);font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);color:var(--system-text-negative, #8E2100)}.mrx-formula-editor__popup--row{font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);padding:calc(var(--spacing-2) + var(--spacing-half)) var(--spacing-4);white-space:normal;transition:background-color .2s}.mrx-formula-editor__popup--row:hover{cursor:pointer;background-color:var(--Bg2)!important}.mrx-formula-editor__box:empty:not(:focus):before{content:attr(data-ph);color:var(--neutral-text-tertiary, #71767E);font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);padding-left:8px}.mrx-formula-editor.-disabled .mrx-formula-editor__box{background-color:var(--neutral-bg-disabled, #EEF0F4);color:var(--neutral-text-tertiary, #71767E);pointer-events:none}.mrx-formula-editor.-readonly .mrx-formula-editor__box{background-color:var(--neutral-bg-disabled, #EEF0F4);color:var(--neutral-text-primary, #262626);pointer-events:none}.mrx-formula-editor.mrx-input-error .mrx-formula-editor__box{border-color:var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-error .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-checked-error .mrx-formula-editor__box{border-color:var(--system-bg-controls-negative-default);background-color:var(--system-bg-negative-secondary)}.mrx-formula-editor.mrx-input-checked-error .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-negative-default)}.mrx-formula-editor.mrx-input-checked-success .mrx-formula-editor__box{background-color:var(--system-bg-positive-secondary);border-color:var(--system-bg-controls-positive-default)}.mrx-formula-editor.mrx-input-checked-success .mrx-formula-editor__box:hover{border:var(--border-width-default) solid var(--system-bg-controls-positive-default)}\n"] }]
|
|
17683
|
+
}], ctorParameters: function () { return [{ type: Document, decorators: [{
|
|
17684
|
+
type: Inject,
|
|
17685
|
+
args: [DOCUMENT]
|
|
17686
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { fields: [{
|
|
17687
|
+
type: Input
|
|
17688
|
+
}], whiteList: [{
|
|
17689
|
+
type: Input
|
|
17690
|
+
}], disabled: [{
|
|
17691
|
+
type: Input
|
|
17692
|
+
}], readonly: [{
|
|
17693
|
+
type: Input
|
|
17694
|
+
}], placeholder: [{
|
|
17695
|
+
type: Input
|
|
17696
|
+
}], customClasses: [{
|
|
17697
|
+
type: Input
|
|
17698
|
+
}], invalid: [{
|
|
17699
|
+
type: Input
|
|
17700
|
+
}], invalidMessage: [{
|
|
17701
|
+
type: Input
|
|
17702
|
+
}], checkInvalid: [{
|
|
17703
|
+
type: Input
|
|
17704
|
+
}], inputElement: [{
|
|
17705
|
+
type: ViewChild,
|
|
17706
|
+
args: ['inputElement', { static: true }]
|
|
17707
|
+
}], changed: [{
|
|
17708
|
+
type: Output
|
|
17709
|
+
}], blurred: [{
|
|
17710
|
+
type: Output
|
|
17711
|
+
}], modelChange: [{
|
|
17712
|
+
type: Output
|
|
17713
|
+
}], clickOut: [{
|
|
17714
|
+
type: HostListener,
|
|
17715
|
+
args: ['document:click', ['$event']]
|
|
17716
|
+
}] } });
|
|
17717
|
+
|
|
17718
|
+
class FormulaEditorModule {
|
|
17719
|
+
}
|
|
17720
|
+
FormulaEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
17721
|
+
FormulaEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorModule, declarations: [FormulaEditorComponent], imports: [CommonModule,
|
|
17722
|
+
CharsLeftModule,
|
|
17723
|
+
ErrorMessageModule,
|
|
17724
|
+
FormsModule,
|
|
17725
|
+
NgxMaskModule,
|
|
17726
|
+
SaveStateModule,
|
|
17727
|
+
SafeModule], exports: [FormulaEditorComponent] });
|
|
17728
|
+
FormulaEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorModule, imports: [[
|
|
17729
|
+
CommonModule,
|
|
17730
|
+
CharsLeftModule,
|
|
17731
|
+
ErrorMessageModule,
|
|
17732
|
+
FormsModule,
|
|
17733
|
+
NgxMaskModule,
|
|
17734
|
+
SaveStateModule,
|
|
17735
|
+
SafeModule
|
|
17736
|
+
]] });
|
|
17737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorModule, decorators: [{
|
|
17738
|
+
type: NgModule,
|
|
17739
|
+
args: [{
|
|
17740
|
+
declarations: [
|
|
17741
|
+
FormulaEditorComponent
|
|
17742
|
+
],
|
|
17743
|
+
imports: [
|
|
17744
|
+
CommonModule,
|
|
17745
|
+
CharsLeftModule,
|
|
17746
|
+
ErrorMessageModule,
|
|
17747
|
+
FormsModule,
|
|
17748
|
+
NgxMaskModule,
|
|
17749
|
+
SaveStateModule,
|
|
17750
|
+
SafeModule
|
|
17751
|
+
],
|
|
17752
|
+
exports: [
|
|
17753
|
+
FormulaEditorComponent
|
|
17754
|
+
]
|
|
17755
|
+
}]
|
|
17756
|
+
}] });
|
|
17757
|
+
|
|
17313
17758
|
// COMPONENTS
|
|
17314
17759
|
|
|
17315
17760
|
/**
|
|
17316
17761
|
* Generated bundle index. Do not edit.
|
|
17317
17762
|
*/
|
|
17318
17763
|
|
|
17319
|
-
export { AlertColorClasses, AlertComponent, AlertIconClasses, AlertModule, BadgeColorClassesEnum, BadgeComponent, BadgeGroupComponent, BadgeSizeEnum, BadgeTagTypeClassesEnum, BadgeTargetTypesEnum, BadgeTypeEnum, BadgesModule, BreadcrumbsComponent, BreadcrumbsModule, BreadcrumbsTypeEnum, ButtonColorsEnum, ButtonComponent, ButtonIconPositionEnum, ButtonModule, ButtonSizesEnum, ButtonTypesEnum, CdkTooltipDirective, CdkTooltipModule, CharsLeftComponent, CharsLeftModule, CheckboxComponent, CheckboxGroupComponent, CheckboxGroupModule, CheckboxModule, ColumnComponent, ContentWrapperComponent, ContentWrapperModule, ContentWrapperTypeEnum, ContextMenuAttachDirective, ContextMenuComponent, ContextMenuContentComponent, ContextMenuFixedService, ContextMenuItemDirective, ContextMenuModule, ContextMenuService, ControlsItemComponent, ControlsVisibilityEnum, ControlsWrapperComponent, ControlsWrapperModule, CountriesISO, CountriesRusLabel, CountryISO, CurrencyModule, CurrencyPipe, DateFormatModule, DateFormatPipe, DateTimeFormatPipe, DefaultPagerSettings, DocumentEditorComponent, DocumentEditorModule, DropdownComponent, DropdownModule, EditorComponent, EditorModule, ErrorMessageComponent, ErrorMessageModule, FileUploadService, GalleryComponent, GalleryModule, HideAfterClickDirective, HintErrorMessageComponent, HintErrorMessageModule, IconButtonComponent, IconButtonModule, IconButtonSizeEnum, IconButtonStateEnum, IconButtonTypeEnum, InputDateSizesEnum$2 as InputDateSizesEnum, InputDateTimeComponent, InputDateTimeModule, InputDatepickerComponent, InputDatepickerModule, InputFileComponent, InputFileImageComponent, InputFileImageModule, InputFileImageTypeEnum, InputFileModule, InputNumberComponent, InputNumberModule, InputNumberSizesEnum, InputOptComponent, InputOptModule, InputPasswordComponent, InputPasswordModule, InputPasswordSizesEnum, InputPhoneComponent, InputPhoneModule, InputSearchComponent, InputSearchModule, InputSearchSizesEnum, InputSelectComponent, InputSelectModule, InputSelectSizeEnum, InputTelComponent, InputTelModule, InputTelSizesEnum, InputTextComponent, InputTextIconColorEnum, InputTextModule, InputTextSizesEnum, InputTextareaComponent, InputTextareaModule, InputTextareaSizesEnum, InputTimepickerComponent, InputTimepickerModule, LabelComponent, LabelModule, LinkComponent, LinkModule, LinkSizesEnum, LinkTargetTypesEnum, LinkTypesEnum, LoaderColorEnum, LoaderComponent, LoaderModule, LoaderSizesEnum, ModalAlignButtonsEnum, ModalColorEnum, ModalComponent, ModalModule, ModalSizesEnum, MrxAutoSaveActionsEnum, MrxAutosaveService, MrxFormValidator, NgxOtpBehavior, PagesNavComponent, PagesNavEnum, PagesNavModule, PaginatorComponent, PaginatorModule, PaginatorPositionCss, PhoneFormatModule, PhoneFormatPipe, PreviewEnum, ProgressClasses, ProgressComponent, ProgressModule, RadioComponent, RadioGroupComponent, RadioGroupModule, RadioModule, RadioTypesEnum, RatingComponent, RatingModule, RatingSizesEnum, RatingValueSizesEnum, RatingWrapperSizesEnum, SafeModule, SafePipe, SaveStateComponent, SaveStateModule, SaveStoreModule, StepperClasses, StepperComponent, StepperModule, SwitchComponent, SwitchModule, SwitchSizeEnum, SwitchTypeEnum, TabComponent, TableComponent, TableModule, TableTypeEnum, TabsClasses, TabsGroupComponent, TabsModule, TabsTypesClasses, Timezone$1 as Timezone, Tooltip, TooltipComponent, TooltipModule, TooltipService, TooltipTextPositionEnum, TooltipTriggerComponent, TooltipTriggerEnum, TruncateDirective, TruncateDirectiveModule, TruncateModule, TruncatePipe, TruncateTextComponent, TruncateTextModule, ValidationMethodsEnum, ValidationOptionsEnum, ValidationTypesEnum, WarningMessageComponent, WarningMessageModule, WidgetWrapperComponent, WidgetWrapperModule, autosaveAddId, autosaveError, autosaveErrorFor, autosaveStart, autosaveStartFor, autosaveStop, autosaveStopFor, autosaveSuccess, autosaveSuccessFor, convertBase64ToFile, countryData, dateTimeFormat, formatBytes, formattingDateRange, formattingIsoToString, getBase64FromUrl, getHashCode, sHashCode, selectFields, selectMrxAutoSaveState, sliceDate, toBytes, toDate, toNumberFormat, wordForm };
|
|
17764
|
+
export { AlertColorClasses, AlertComponent, AlertIconClasses, AlertModule, BadgeColorClassesEnum, BadgeComponent, BadgeGroupComponent, BadgeSizeEnum, BadgeTagTypeClassesEnum, BadgeTargetTypesEnum, BadgeTypeEnum, BadgesModule, BreadcrumbsComponent, BreadcrumbsModule, BreadcrumbsTypeEnum, ButtonColorsEnum, ButtonComponent, ButtonIconPositionEnum, ButtonModule, ButtonSizesEnum, ButtonTypesEnum, CdkTooltipDirective, CdkTooltipModule, CharsLeftComponent, CharsLeftModule, CheckboxComponent, CheckboxGroupComponent, CheckboxGroupModule, CheckboxModule, ColumnComponent, ContentWrapperComponent, ContentWrapperModule, ContentWrapperTypeEnum, ContextMenuAttachDirective, ContextMenuComponent, ContextMenuContentComponent, ContextMenuFixedService, ContextMenuItemDirective, ContextMenuModule, ContextMenuService, ControlsItemComponent, ControlsVisibilityEnum, ControlsWrapperComponent, ControlsWrapperModule, CountriesISO, CountriesRusLabel, CountryISO, CurrencyModule, CurrencyPipe, DateFormatModule, DateFormatPipe, DateTimeFormatPipe, DefaultPagerSettings, DocumentEditorComponent, DocumentEditorModule, DropdownComponent, DropdownModule, EditorComponent, EditorModule, ErrorMessageComponent, ErrorMessageModule, FileUploadService, FormulaEditorComponent, FormulaEditorModule, GalleryComponent, GalleryModule, HideAfterClickDirective, HintErrorMessageComponent, HintErrorMessageModule, IconButtonComponent, IconButtonModule, IconButtonSizeEnum, IconButtonStateEnum, IconButtonTypeEnum, InputDateSizesEnum$2 as InputDateSizesEnum, InputDateTimeComponent, InputDateTimeModule, InputDatepickerComponent, InputDatepickerModule, InputFileComponent, InputFileImageComponent, InputFileImageModule, InputFileImageTypeEnum, InputFileModule, InputNumberComponent, InputNumberModule, InputNumberSizesEnum, InputOptComponent, InputOptModule, InputPasswordComponent, InputPasswordModule, InputPasswordSizesEnum, InputPhoneComponent, InputPhoneModule, InputSearchComponent, InputSearchModule, InputSearchSizesEnum, InputSelectComponent, InputSelectModule, InputSelectSizeEnum, InputTelComponent, InputTelModule, InputTelSizesEnum, InputTextComponent, InputTextIconColorEnum, InputTextModule, InputTextSizesEnum, InputTextareaComponent, InputTextareaModule, InputTextareaSizesEnum, InputTimepickerComponent, InputTimepickerModule, LabelComponent, LabelModule, LinkComponent, LinkModule, LinkSizesEnum, LinkTargetTypesEnum, LinkTypesEnum, LoaderColorEnum, LoaderComponent, LoaderModule, LoaderSizesEnum, ModalAlignButtonsEnum, ModalColorEnum, ModalComponent, ModalModule, ModalSizesEnum, MrxAutoSaveActionsEnum, MrxAutosaveService, MrxFormValidator, NgxOtpBehavior, PagesNavComponent, PagesNavEnum, PagesNavModule, PaginatorComponent, PaginatorModule, PaginatorPositionCss, PhoneFormatModule, PhoneFormatPipe, PreviewEnum, ProgressClasses, ProgressComponent, ProgressModule, RadioComponent, RadioGroupComponent, RadioGroupModule, RadioModule, RadioTypesEnum, RatingComponent, RatingModule, RatingSizesEnum, RatingValueSizesEnum, RatingWrapperSizesEnum, SafeModule, SafePipe, SaveStateComponent, SaveStateModule, SaveStoreModule, StepperClasses, StepperComponent, StepperModule, SwitchComponent, SwitchModule, SwitchSizeEnum, SwitchTypeEnum, TabComponent, TableComponent, TableModule, TableTypeEnum, TabsClasses, TabsGroupComponent, TabsModule, TabsTypesClasses, Timezone$1 as Timezone, Tooltip, TooltipComponent, TooltipModule, TooltipService, TooltipTextPositionEnum, TooltipTriggerComponent, TooltipTriggerEnum, TruncateDirective, TruncateDirectiveModule, TruncateModule, TruncatePipe, TruncateTextComponent, TruncateTextModule, ValidationMethodsEnum, ValidationOptionsEnum, ValidationTypesEnum, WarningMessageComponent, WarningMessageModule, WidgetWrapperComponent, WidgetWrapperModule, autosaveAddId, autosaveError, autosaveErrorFor, autosaveStart, autosaveStartFor, autosaveStop, autosaveStopFor, autosaveSuccess, autosaveSuccessFor, convertBase64ToFile, countryData, dateTimeFormat, formatBytes, formattingDateRange, formattingIsoToString, getBase64FromUrl, getHashCode, sHashCode, selectFields, selectMrxAutoSaveState, sliceDate, toBytes, toDate, toNumberFormat, wordForm };
|
|
17320
17765
|
//# sourceMappingURL=myrta-ui.mjs.map
|