myrta-ui 1.1.23 → 1.1.25
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/formula-editor.component.mjs +5 -3
- package/esm2020/lib/services/mrx-form-validator/models/validations-options.model.mjs +1 -1
- package/esm2020/lib/services/mrx-form-validator/mrx-form-validator.mjs +13 -33
- package/fesm2015/myrta-ui.mjs +15 -33
- package/fesm2015/myrta-ui.mjs.map +1 -1
- package/fesm2020/myrta-ui.mjs +15 -33
- package/fesm2020/myrta-ui.mjs.map +1 -1
- package/lib/services/mrx-form-validator/models/validations-options.model.d.ts +3 -0
- package/lib/services/mrx-form-validator/mrx-form-validator.d.ts +4 -3
- package/package.json +1 -1
package/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -4426,9 +4426,6 @@ class MrxFormValidator {
|
|
|
4426
4426
|
if (!validateEmptyValue && (value.length === 0)) {
|
|
4427
4427
|
return;
|
|
4428
4428
|
}
|
|
4429
|
-
if (!this._isValid) {
|
|
4430
|
-
return;
|
|
4431
|
-
}
|
|
4432
4429
|
for (let key in validations) {
|
|
4433
4430
|
switch (key) {
|
|
4434
4431
|
case ValidationTypesEnum.Required:
|
|
@@ -4437,9 +4434,6 @@ class MrxFormValidator {
|
|
|
4437
4434
|
if (!silent && !this._errors[name]) {
|
|
4438
4435
|
this._errors[name] = requiredRes.message;
|
|
4439
4436
|
}
|
|
4440
|
-
if (!this._isValid) {
|
|
4441
|
-
return;
|
|
4442
|
-
}
|
|
4443
4437
|
break;
|
|
4444
4438
|
case ValidationTypesEnum.Email:
|
|
4445
4439
|
const emailRes = emailValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4447,9 +4441,6 @@ class MrxFormValidator {
|
|
|
4447
4441
|
if (!silent && !this._errors[name]) {
|
|
4448
4442
|
this._errors[name] = emailRes.message;
|
|
4449
4443
|
}
|
|
4450
|
-
if (!this._isValid) {
|
|
4451
|
-
return;
|
|
4452
|
-
}
|
|
4453
4444
|
break;
|
|
4454
4445
|
case ValidationTypesEnum.Pattern:
|
|
4455
4446
|
const patternRes = patternValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4457,9 +4448,6 @@ class MrxFormValidator {
|
|
|
4457
4448
|
if (!silent && !this._errors[name]) {
|
|
4458
4449
|
this._errors[name] = patternRes.message;
|
|
4459
4450
|
}
|
|
4460
|
-
if (!this._isValid) {
|
|
4461
|
-
return;
|
|
4462
|
-
}
|
|
4463
4451
|
break;
|
|
4464
4452
|
case ValidationTypesEnum.MinLength:
|
|
4465
4453
|
const minLengthRes = minLengthValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4467,9 +4455,6 @@ class MrxFormValidator {
|
|
|
4467
4455
|
if (!silent && !this._errors[name]) {
|
|
4468
4456
|
this._errors[name] = minLengthRes.message;
|
|
4469
4457
|
}
|
|
4470
|
-
if (!this._isValid) {
|
|
4471
|
-
return;
|
|
4472
|
-
}
|
|
4473
4458
|
break;
|
|
4474
4459
|
case ValidationTypesEnum.MaxLength:
|
|
4475
4460
|
const maxLengthRes = maxLengthValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4477,9 +4462,6 @@ class MrxFormValidator {
|
|
|
4477
4462
|
if (!silent && !this._errors[name]) {
|
|
4478
4463
|
this._errors[name] = maxLengthRes.message;
|
|
4479
4464
|
}
|
|
4480
|
-
if (!this._isValid) {
|
|
4481
|
-
return;
|
|
4482
|
-
}
|
|
4483
4465
|
break;
|
|
4484
4466
|
case ValidationTypesEnum.MinValue:
|
|
4485
4467
|
const minValueRes = minValueValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4487,9 +4469,6 @@ class MrxFormValidator {
|
|
|
4487
4469
|
if (!silent && !this._errors[name]) {
|
|
4488
4470
|
this._errors[name] = minValueRes.message;
|
|
4489
4471
|
}
|
|
4490
|
-
if (!this._isValid) {
|
|
4491
|
-
return;
|
|
4492
|
-
}
|
|
4493
4472
|
break;
|
|
4494
4473
|
case ValidationTypesEnum.MaxValue:
|
|
4495
4474
|
const maxValueRes = maxValueValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4497,9 +4476,6 @@ class MrxFormValidator {
|
|
|
4497
4476
|
if (!silent && !this._errors[name]) {
|
|
4498
4477
|
this._errors[name] = maxValueRes.message;
|
|
4499
4478
|
}
|
|
4500
|
-
if (!this._isValid) {
|
|
4501
|
-
return;
|
|
4502
|
-
}
|
|
4503
4479
|
break;
|
|
4504
4480
|
case ValidationTypesEnum.Callback:
|
|
4505
4481
|
const callbackRes = callbackValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4507,13 +4483,20 @@ class MrxFormValidator {
|
|
|
4507
4483
|
if (!silent && !this._errors[name]) {
|
|
4508
4484
|
this._errors[name] = callbackRes.message;
|
|
4509
4485
|
}
|
|
4510
|
-
if (!this._isValid) {
|
|
4511
|
-
return;
|
|
4512
|
-
}
|
|
4513
4486
|
break;
|
|
4514
4487
|
}
|
|
4515
4488
|
}
|
|
4516
4489
|
}
|
|
4490
|
+
_checkErrors(errors) {
|
|
4491
|
+
let isValid = true;
|
|
4492
|
+
for (let error in errors) {
|
|
4493
|
+
if (!!errors[error]) {
|
|
4494
|
+
isValid = !errors[error];
|
|
4495
|
+
break;
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
return isValid;
|
|
4499
|
+
}
|
|
4517
4500
|
initFields(fields, validations) {
|
|
4518
4501
|
this.fields = cloneDeep(fields);
|
|
4519
4502
|
this._validations = validations;
|
|
@@ -4549,13 +4532,10 @@ class MrxFormValidator {
|
|
|
4549
4532
|
}
|
|
4550
4533
|
isValid() {
|
|
4551
4534
|
for (let key in this._validations) {
|
|
4552
|
-
if (!this._isValid) {
|
|
4553
|
-
return this._isValid;
|
|
4554
|
-
}
|
|
4555
4535
|
this.errors[key] = null;
|
|
4556
4536
|
this.validateField(this._fields[key], key, this._validations[key], true);
|
|
4557
4537
|
}
|
|
4558
|
-
return this.
|
|
4538
|
+
return this._checkErrors(this.errors);
|
|
4559
4539
|
}
|
|
4560
4540
|
// TODO Вырезать в будущем
|
|
4561
4541
|
initModelChangedFromField(field, fieldName) {
|
|
@@ -17495,6 +17475,7 @@ class FormulaEditorComponent {
|
|
|
17495
17475
|
if (outsideValue !== null) {
|
|
17496
17476
|
this.value = outsideValue;
|
|
17497
17477
|
this.visibleValue = this._transformValue(this._modifiedValue(outsideValue)).visibleValue;
|
|
17478
|
+
this._detector.detectChanges();
|
|
17498
17479
|
}
|
|
17499
17480
|
}
|
|
17500
17481
|
onInput(event) {
|
|
@@ -17525,6 +17506,7 @@ class FormulaEditorComponent {
|
|
|
17525
17506
|
updateVisibleValue(insideValue) {
|
|
17526
17507
|
this.visibleValue = insideValue;
|
|
17527
17508
|
this._storeCursorPosition();
|
|
17509
|
+
this._detector.detectChanges();
|
|
17528
17510
|
}
|
|
17529
17511
|
updateValue(insideValue) {
|
|
17530
17512
|
this.value = insideValue;
|
|
@@ -17673,14 +17655,14 @@ FormulaEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
17673
17655
|
provide: NG_VALUE_ACCESSOR,
|
|
17674
17656
|
useExisting: forwardRef(() => FormulaEditorComponent),
|
|
17675
17657
|
multi: true
|
|
17676
|
-
}], 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-radius:var(--border-radius-1);background:var(--neutral-bg-island-default, #F8F9FA);box-shadow:0 1px 4px #3a3a3a4d;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 });
|
|
17658
|
+
}], 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;z-index:99;width:100%;border-radius:var(--border-radius-1);background:var(--neutral-bg-island-default, #F8F9FA);box-shadow:0 1px 4px #3a3a3a4d;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 });
|
|
17677
17659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FormulaEditorComponent, decorators: [{
|
|
17678
17660
|
type: Component,
|
|
17679
17661
|
args: [{ selector: 'mrx-formula-editor', changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
|
|
17680
17662
|
provide: NG_VALUE_ACCESSOR,
|
|
17681
17663
|
useExisting: forwardRef(() => FormulaEditorComponent),
|
|
17682
17664
|
multi: true
|
|
17683
|
-
}], 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-radius:var(--border-radius-1);background:var(--neutral-bg-island-default, #F8F9FA);box-shadow:0 1px 4px #3a3a3a4d;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"] }]
|
|
17665
|
+
}], 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;z-index:99;width:100%;border-radius:var(--border-radius-1);background:var(--neutral-bg-island-default, #F8F9FA);box-shadow:0 1px 4px #3a3a3a4d;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"] }]
|
|
17684
17666
|
}], ctorParameters: function () { return [{ type: Document, decorators: [{
|
|
17685
17667
|
type: Inject,
|
|
17686
17668
|
args: [DOCUMENT]
|