@myrtex-org/form 1.1.37 → 1.1.39

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.
@@ -22,7 +22,6 @@ import * as i2$2 from '@angular/forms';
22
22
  import { FormsModule } from '@angular/forms';
23
23
  import { provideNgxMask } from 'ngx-mask';
24
24
  import { v4 } from 'uuid';
25
- import CustomStore from 'devextreme/data/custom_store';
26
25
  import * as i2$3 from 'devextreme-angular';
27
26
  import { DxDataGridModule } from 'devextreme-angular';
28
27
  import * as i3 from 'devextreme-angular/ui/nested';
@@ -1452,7 +1451,6 @@ class BaseFieldComponent {
1452
1451
  _initModel() {
1453
1452
  if (this.valueMode === 'manual') {
1454
1453
  this.model = cloneDeep(getValueModel(this.settings, this.manualValues)) || defaultValueModel(this.settings);
1455
- this._customInit();
1456
1454
  }
1457
1455
  else {
1458
1456
  this.model = defaultValueModel(this.settings);
@@ -1817,10 +1815,6 @@ class InputDateComponent extends BaseFieldComponent {
1817
1815
  }
1818
1816
  _customInit() {
1819
1817
  if (this.settings.options.range) {
1820
- console.log('Модели в _customInit:', {
1821
- start: this.modelStart?.value,
1822
- end: this.modelEnd?.value
1823
- });
1824
1818
  if (!this.modelStart) {
1825
1819
  this.modelStart = defaultValueModel(this.settings);
1826
1820
  }
@@ -1845,36 +1839,9 @@ class InputDateComponent extends BaseFieldComponent {
1845
1839
  else {
1846
1840
  this.dateModel = this.model.value;
1847
1841
  }
1848
- console.log('Финальный DateModel для календаря:', this.dateModel);
1849
1842
  this._isInit = true;
1850
1843
  this._detector.markForCheck();
1851
1844
  }
1852
- _initModel() {
1853
- console.log('Доступные системные имена в строке:', this.manualValues.map(x => x.sysName));
1854
- console.log('Системное имя текущего компонента:', this.settings.sysName);
1855
- // 1. Сначала выполняем стандартную инициализацию (для одиночной даты)
1856
- super._initModel();
1857
- // 2. Если это диапазон и мы работаем в модалке (редактирование строки таблицы)
1858
- if (this.valueMode === 'manual' && this.settings.options.range) {
1859
- // Ищем в массиве данных строки значения с нужными суффиксами
1860
- const startData = this.manualValues.find(x => x.sysName === `${this.settings.sysName}_start`);
1861
- const endData = this.manualValues.find(x => x.sysName === `${this.settings.sysName}_end`);
1862
- // Инициализируем локальные модели для старта и конца диапазона
1863
- // Если данных нет, создаем дефолтные модели
1864
- this.modelStart = startData
1865
- ? structuredClone(startData)
1866
- : defaultValueModel(this.settings);
1867
- this.modelEnd = endData
1868
- ? structuredClone(endData)
1869
- : defaultValueModel(this.settings);
1870
- // Подменяем sysName у моделей, чтобы при сохранении они вернулись в те же колонки
1871
- this.modelStart.sysName = `${this.settings.sysName}_start`;
1872
- this.modelEnd.sysName = `${this.settings.sysName}_end`;
1873
- // 3. Вызываем _customInit, чтобы склеить эти модели в dateModel для UI
1874
- this._customInit();
1875
- }
1876
- console.log('DateModel:', this.dateModel);
1877
- }
1878
1845
  _getDaysDifference(startDate, endDate) {
1879
1846
  const start = new Date(startDate);
1880
1847
  const end = new Date(endDate);
@@ -2371,8 +2338,6 @@ const getRowModel = (model) => {
2371
2338
  class InputTableComponent {
2372
2339
  constructor() {
2373
2340
  this.type = ComponentType.InputTable;
2374
- this._referenceService = inject(ReferenceService);
2375
- this._lookupsCache = new Map();
2376
2341
  this._store = inject(Store);
2377
2342
  this._detector = inject(ChangeDetectorRef);
2378
2343
  this._modalService = inject(ModalService);
@@ -2462,7 +2427,6 @@ class InputTableComponent {
2462
2427
  }
2463
2428
  editRow(event) {
2464
2429
  const findRow = this.model.data.find(item => item.id === event.row.data.id);
2465
- console.log(this.settings, 'this.settings');
2466
2430
  if (findRow) {
2467
2431
  this._modalService.open(InputTableModalComponent, {
2468
2432
  title: 'Редактирование строки',
@@ -2581,29 +2545,6 @@ class InputTableComponent {
2581
2545
  displayExpr: 'displayValue'
2582
2546
  };
2583
2547
  }
2584
- if (component.type === ComponentType.InputSelect) {
2585
- const selectModel = component;
2586
- if (selectModel.options.manual) {
2587
- column.lookup = {
2588
- dataSource: selectModel.options.items,
2589
- valueExpr: 'value',
2590
- displayExpr: 'text'
2591
- };
2592
- }
2593
- else if (selectModel.options.directory?.[0]) {
2594
- const directoryName = selectModel.options.directory[0];
2595
- column.lookup = {
2596
- // Оборачиваем в CustomStore для соответствия типам DevExtreme
2597
- dataSource: new CustomStore({
2598
- key: 'value',
2599
- load: () => this.getLookupData(directoryName),
2600
- byKey: (key) => this.getLookupData(directoryName).then(items => items.find(i => i.value === key))
2601
- }),
2602
- valueExpr: 'value',
2603
- displayExpr: 'text'
2604
- };
2605
- }
2606
- }
2607
2548
  if (this.settings.options.groups.length) {
2608
2549
  const findIdx = this.settings.options.groups.findIndex(x => x === component.sysName);
2609
2550
  if (findIdx !== -1) {
@@ -2612,27 +2553,6 @@ class InputTableComponent {
2612
2553
  }
2613
2554
  return column;
2614
2555
  }
2615
- getLookupData(directoryName) {
2616
- // Проверяем кэш
2617
- if (this._lookupsCache.has(directoryName)) {
2618
- return Promise.resolve(this._lookupsCache.get(directoryName));
2619
- }
2620
- // Запрашиваем данные (используем тот же objectId, что и в модалке)
2621
- // Убедитесь, что objectId доступен в этом компоненте
2622
- return new Promise((resolve) => {
2623
- this._referenceService.getReferences(directoryName, this.objectId).subscribe({
2624
- next: (result) => {
2625
- const items = (result?.rows || []).map((row) => ({
2626
- value: row.a,
2627
- text: row.b
2628
- }));
2629
- this._lookupsCache.set(directoryName, items);
2630
- resolve(items);
2631
- },
2632
- error: () => resolve([])
2633
- });
2634
- });
2635
- }
2636
2556
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InputTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2637
2557
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: InputTableComponent, selector: "app-input-table", inputs: { values: "values", data: "data" }, outputs: { changed: "changed" }, viewQueries: [{ propertyName: "dataGrid", first: true, predicate: ["dataGrid"], descendants: true }, { propertyName: "editTemplate", first: true, predicate: ["editTemplate"], descendants: true }], ngImport: i0, template: "@if (settings) {\r\n <div class=\"input-table-content w-100\">\r\n @if (settings.options.label) {\r\n <mrx-label\r\n [required]=\"settings.options.required\"\r\n [tooltip]=\"settings.options.tooltip || ''\"\r\n >\r\n {{ settings.options.label }}\r\n </mrx-label>\r\n }\r\n\r\n <dx-data-grid\r\n #dataGrid\r\n [dataSource]=\"dataSource\"\r\n [columns]=\"columns\"\r\n [disabled]=\"disabled\"\r\n noDataText=\"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445\"\r\n style=\"width: 100%\"\r\n [wordWrapEnabled]=\"true\"\r\n [columnAutoWidth]=\"true\"\r\n [class.noData]=\"isRedNoData\"\r\n >\r\n <dxo-toolbar>\r\n <dxi-item location=\"after\">\r\n <div *dxTemplate class=\"add-row\">\r\n <mrx-button\r\n [size]=\"'medium'\"\r\n [type]=\"'secondary'\"\r\n [customClasses]=\"'mb-3'\"\r\n (mrxClick)=\"createRow()\"\r\n >{{settings.options.addBtnTitle}}\r\n </mrx-button>\r\n </div>\r\n </dxi-item>\r\n </dxo-toolbar>\r\n\r\n <div *dxTemplate=\"let buttonData of 'editButtonTemplate'\">\r\n <span class=\"mrx-icon icon-edit icon-font-16 cursor-pointer\" (click)=\"editRow(buttonData)\"></span>\r\n </div>\r\n\r\n <div *dxTemplate=\"let buttonData of 'deleteButtonTemplate'\">\r\n <span class=\"mrx-icon icon-delete icon-font-16 cursor-pointer\" (click)=\"deleteRow(buttonData)\"></span>\r\n </div>\r\n\r\n @if (dataSource.length) {\r\n <dxo-summary>\r\n @for (component of settings.components; track component.id; let first = $first) {\r\n @if (!first) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n\r\n <dxi-total-item \r\n [column]=\"component.sysName\" \r\n displayFormat=\"{0}\"\r\n summaryType=\"sum\"\r\n ></dxi-total-item>\r\n }\r\n\r\n @for (component of component.components; track component.id) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n }\r\n\r\n @for (component of component.components; track component.id) {\r\n @if (showTotal(component)) {\r\n <dxi-group-item\r\n [column]=\"component.sysName\"\r\n summaryType=\"sum\"\r\n displayFormat=\"\u0418\u0442\u043E\u0433\u043E: {0}\"\r\n [showInGroupFooter]=\"true\"\r\n [alignByColumn]=\"true\">\r\n </dxi-group-item>\r\n }\r\n }\r\n }\r\n } @else {\r\n @if (hasAnyTotal) { \r\n <dxi-total-item\r\n [column]=\"component.sysName\"\r\n [cssClass]=\"'text-bold'\"\r\n [displayFormat]=\"showTotal(component) ? '{0}' : '\u0418\u0422\u041E\u0413\u041E'\"\r\n [summaryType]=\"showTotal(component) ? 'sum' : undefined\"\r\n ></dxi-total-item>\r\n }\r\n }\r\n }\r\n </dxo-summary>\r\n }\r\n </dx-data-grid>\r\n\r\n @if(!!settings.options.maxRows) {\r\n <mrx-hint-error-message\r\n message=\"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u0442\u0440\u043E\u043A: {{ settings.options.maxRows }}\"\r\n [maxValue]=\"settings.options.maxRows\"\r\n [value]=\"rowsCount\"\r\n ></mrx-hint-error-message>\r\n }\r\n\r\n <ng-template #editTemplate let-cellInfo=\"cellInfo\">\r\n <div class=\"d-flex align-items-center justify-content-center\" style=\"gap: 4px\">\r\n <span class=\"mrx-icon icon-edit icon-font-16 cursor-pointer\" (click)=\"editRow(cellInfo)\"></span>\r\n <span class=\"mrx-icon icon-delete icon-font-16 cursor-pointer\" (click)=\"deleteRow(cellInfo)\"></span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n}\r\n\r\n\r\n", styles: [":host::ng-deep .input-table-content .noData .dx-datagrid-nodata{color:var(--system-text-negative, #8E2100)}:host::ng-deep .input-table-content .dx-datagrid{padding:0}:host::ng-deep .input-table-content .dx-datagrid-header-panel{display:flex;align-items:center;min-height:40px;padding:0}:host::ng-deep .input-table-content .dx-datagrid-rowsview{border-bottom:none}:host::ng-deep .input-table-content .dx-datagrid-rowsview.dx-empty{border-bottom:1px solid #ddd;height:48px}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer{border-top:none;border-left:none;border-right:none}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content{padding:0}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content table,:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content th,:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content td{border:1px solid #ddd;border-top:none;border-collapse:collapse}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content table{border-top:none}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer .dx-datagrid-content .dx-datagrid-summary-item{font-weight:400}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-headers{position:relative;top:0;border-top:1px solid var(--neutral-bg-divider)}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-headers td.dx-command-expand.dx-datagrid-group-space{border-right:none!important;border-right-color:transparent}:host::ng-deep .input-table-content .dx-datagrid .dx-datagrid-total-footer td.dx-command-expand.dx-datagrid-group-space{border-right-color:transparent}:host::ng-deep .input-table-content .dx-datagrid .dx-row>td,:host::ng-deep .input-table-content .dx-datagrid .page-wrapper .dx-treelist-container .dx-row>td{color:var(--neutral-text-secondary, #4D5157);font-family:var(--body-md-bold-font-family, \"PT Sans\");font-size:var(--body-md-bold-font-size, 14px);font-weight:var(--body-md-bold-font-weight, 700);line-height:var(--body-md-bold-line-height, 16px)}:host::ng-deep .input-table-content .dx-datagrid .dx-row.dx-data-row.dx-column-lines>td{color:var(--neutral-text-tertiary, #71767E);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)}:host::ng-deep .custom-cell-controls .dx-template-wrapper{display:inline-flex}\n"], dependencies: [{ kind: "component", type: i1$2.LabelComponent, selector: "mrx-label", inputs: ["requiredHidden", "required", "boldLabel", "disabled", "placeholder", "label", "customClasses", "triggerTextPosition", "isPublicInfo", "publicInfoTooltip", "isSwitch", "switchLabel", "switchValue", "switchSize", "isCheckbox", "checkboxLabel", "checkboxValue", "counter", "linkText", "linkPrevent", "linkType", "linkMonochrome", "href", "triggerType", "tooltip", "tooltipInitialVisible", "isSaveToStorage"], outputs: ["changeSwitchValue", "changeCheckboxValue", "clickedLink"] }, { kind: "component", type: i1$2.ButtonComponent, selector: "mrx-button", inputs: ["size", "type", "color", "iconPosition", "active", "disabled", "isLoading", "iconOnly", "customClasses", "label", "icon", "iconClass", "buttonType", "href", "target", "routerLink", "queryParams"], outputs: ["mrxClick"] }, { kind: "component", type: i2$3.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i3.DxiItemComponent, selector: "dxi-item", inputs: ["disabled", "html", "icon", "template", "text", "title", "titleTemplate", "visible", "onClick", "stylingMode", "type", "baseSize", "box", "ratio", "shrink", "elementAttr", "hint", "beginGroup", "closeMenuOnClick", "items", "selectable", "selected", "colSpan", "cssClass", "dataField", "editorOptions", "editorType", "helpText", "isRequired", "itemType", "label", "name", "validationRules", "visibleIndex", "alignItemLabels", "caption", "colCount", "colCountByScreen", "tabPanelOptions", "tabs", "badge", "tabTemplate", "buttonOptions", "horizontalAlignment", "verticalAlignment", "locateInMenu", "location", "menuItemTemplate", "options", "showText", "widget", "height", "width", "imageAlt", "imageSrc", "acceptedValues", "formatName", "formatValues", "key", "showChevron", "linkAttr", "url", "heightRatio", "widthRatio", "expanded", "hasItems", "id", "parentId"] }, { kind: "component", type: i3.DxoSummaryComponent, selector: "dxo-summary", inputs: ["calculateCustomSummary", "groupItems", "recalculateWhileEditing", "skipEmptyValues", "texts", "totalItems"] }, { kind: "component", type: i3.DxiGroupItemComponent, selector: "dxi-group-item", inputs: ["alignByColumn", "column", "customizeText", "displayFormat", "name", "showInColumn", "showInGroupFooter", "skipEmptyValues", "summaryType", "valueFormat"] }, { kind: "component", type: i3.DxiTotalItemComponent, selector: "dxi-total-item", inputs: ["alignment", "column", "cssClass", "customizeText", "displayFormat", "name", "showInColumn", "skipEmptyValues", "summaryType", "valueFormat"] }, { kind: "component", type: i3.DxoToolbarComponent, selector: "dxo-toolbar", inputs: ["disabled", "items", "visible", "fileSelectionItems", "container", "multiline"] }, { kind: "directive", type: i4.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i1$2.HintErrorMessageComponent, selector: "mrx-hint-error-message", inputs: ["message", "value", "maxValue", "minValue", "minLength", "maxLength", "checkInvalid"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2638
2558
  }