ru.coon 2.8.65 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +319 -6
  2. package/package.json +1 -1
  3. package/src/Function.js +1 -1
  4. package/src/VisualLinker.js +610 -0
  5. package/src/VisualLinker.scss +219 -0
  6. package/src/app/Application.js +1 -0
  7. package/src/app/ApplicationSettings.js +49 -0
  8. package/src/app/Config.js +60 -0
  9. package/src/app/Router.js +37 -21
  10. package/src/app/viewPort/CVWrapperPanel.js +53 -0
  11. package/src/app/viewPort/CenterView.js +153 -46
  12. package/src/app/viewPort/CenterView.scss +151 -0
  13. package/src/app/viewPort/ComponentContextManager.js +24 -0
  14. package/src/app/viewPort/Main.js +4 -1
  15. package/src/app/viewPort/Routing.d2 +23 -0
  16. package/src/app/viewPort/TabHistory.js +81 -0
  17. package/src/common/ComponentFactory.js +167 -0
  18. package/src/common/button/DropdownContentButton.js +146 -0
  19. package/src/common/button/DropdownContentButton.scss +92 -0
  20. package/src/common/button/DropdownContentButtonController.js +60 -0
  21. package/src/common/component/editor/EditorFactory.js +3 -1
  22. package/src/common/component/formeditor/UiCustomFilterForm.scss +0 -1
  23. package/src/common/component/settings/modules/settingClosePageConfirmation.js +1 -3
  24. package/src/common/component/settings/modules/settingFavoritePanelShow.js +21 -0
  25. package/src/common/component/settings/modules/settingReportCalculator.js +22 -0
  26. package/src/common/component/settings/modules/settingShowNeedReloadMessage.js +1 -3
  27. package/src/common/component/settings/modules/settingwindowHolder.js +2 -3
  28. package/src/common/panel/WindowWrap.js +19 -11
  29. package/src/common/tree/BaseContextMenu.js +4 -3
  30. package/src/log.js +4 -5
  31. package/src/nav/AppNavCalcButton.js +23 -0
  32. package/src/nav/AppNavCalcButton.scss +6 -0
  33. package/src/nav/AppNavigationBar.js +1 -1
  34. package/src/nav/AppNavigationMenuController.js +2 -2
  35. package/src/nav/AppNavigationMenuMinimized.js +61 -0
  36. package/src/nav/AppNavigationPanel.js +115 -0
  37. package/src/nav/AppNavigationPanel.scss +178 -0
  38. package/src/nav/AppNavigationPanelController.js +386 -0
  39. package/src/nav/FavoriteCfg.js +18 -0
  40. package/src/nav/MenuEntity.js +23 -15
  41. package/src/nav/MenuFavoritesBar.js +100 -0
  42. package/src/nav/MenuFavoritesBar.scss +92 -0
  43. package/src/nav/editor/NavigateElementEditorView.js +2 -2
  44. package/src/nav/editor/workspace/NavWorkspaceListView.js +1 -4
  45. package/src/nav/menu/WorkspaceMenuViewMinimized.js +22 -0
  46. package/src/overrides/panel/TabPanel.js +36 -0
  47. package/src/overrides/panel/TabPanel.scss +65 -0
  48. package/src/report/component/ClearFiltersButton.js +4 -1
  49. package/src/report/component/CopyCellValueMenuItem.js +18 -0
  50. package/src/report/component/ReportFieldMap.js +274 -0
  51. package/src/report/component/ReportPanel.js +73 -44
  52. package/src/report/component/ReportPanel.scss +2 -2
  53. package/src/report/component/ReportTagLookup.js +59 -2
  54. package/src/report/component/calculator/ReportCalculatorController.js +266 -0
  55. package/src/report/component/calculator/ReportCalculatorField.js +47 -0
  56. package/src/report/component/calculator/ReportCalculatorHistoryPlugin.js +128 -0
  57. package/src/report/component/calculator/ReportCalculatorHistoryPlugin.scss +33 -0
  58. package/src/report/component/calculator/ReportCalculatorMenuItem.js +101 -0
  59. package/src/report/component/calculator/ReportCalculatorMenuItem.scss +41 -0
  60. package/src/report/component/calculator/ReportCalculatorPanel.js +363 -0
  61. package/src/report/component/calculator/ReportCalculatorPanel.scss +86 -0
  62. package/src/report/component/reportpanel/CopyReportPanelController.js +1 -1
  63. package/src/report/component/reportpanel/FilterPanel.js +13 -15
  64. package/src/report/component/reportpanel/FilterPanel.scss +5 -1
  65. package/src/report/component/reportpanel/FormFieldFocusPlugin.js +157 -0
  66. package/src/report/component/reportpanel/FormFieldFocusPlugin.scss +14 -0
  67. package/src/report/component/reportpanel/NorthPanel.js +16 -17
  68. package/src/report/component/reportpanel/NorthPanel.scss +1 -1
  69. package/src/report/component/reportpanel/ReportContextMenu.js +219 -0
  70. package/src/report/component/reportpanel/ReportGrid.js +1 -0
  71. package/src/report/component/reportpanel/ReportGrid.scss +4 -0
  72. package/src/report/component/settings/field/ReportFormFieldsGrid.js +2 -2
  73. package/src/report/component/settings/field/ReportFormFieldsGridController.js +2 -2
  74. package/src/report/component/settings/property/ReportPropertiesPanelController.js +1 -1
  75. package/src/report/component/settings/property/ReportPropertyDictionary.js +7 -0
  76. package/src/report/plugin/configPanel/AddFilterConditionPluginConfigPanel.js +34 -11
  77. package/src/report/plugin/configPanel/GridFiltersPluginConfigPanelFiltersGrid.js +3 -2
  78. package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.js +274 -255
  79. package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.scss +17 -0
  80. package/src/report/plugin/grid/AddFilterConditionPlugin.js +530 -87
  81. package/src/report/plugin/grid/CalculatorPlugin.js +90 -0
  82. package/src/report/plugin/grid/GridContextMenu.js +12 -10
  83. package/src/report/plugin/grid/GridRowCountPlugin.js +0 -1
  84. package/src/report/plugin/grid/GridToolbarButtonPlugin.js +11 -2
  85. package/src/report/plugin/grid/OpenCustomPanelButtonPlugin.js +126 -89
  86. package/src/report/plugin/grid/ReportCharacteristicBindPlugin.js +6 -4
  87. package/src/report/plugin/grid/ReportColumnStatePlugin.js +15 -3
  88. package/src/report/plugin/grid/SetSingleParameterPlugin.js +1 -1
  89. package/src/report/plugin/grid/ToolbarButtonPlugin.js +1 -1
  90. package/src/report/plugin/grid/addFilterConditionPlugin/AdvancedSearchPanel.js +55 -0
  91. package/src/report/plugin/grid/addFilterConditionPlugin/AdvancedSearchPanelController.js +226 -0
  92. package/src/report/plugin/grid/addFilterConditionPlugin/FilterConfigMixin.js +138 -0
  93. package/src/report/plugin/grid/addFilterConditionPlugin/FilterFieldFactory.js +223 -0
  94. package/src/report/plugin/grid/addFilterConditionPlugin/FilterItem.js +164 -0
  95. package/src/report/plugin/grid/addFilterConditionPlugin/FilterItem.scss +21 -0
  96. package/src/report/plugin/grid/addFilterConditionPlugin/FilterMenu.js +29 -0
  97. package/src/report/plugin/grid/addFilterConditionPlugin/FilterWrapPanel.js +53 -0
  98. package/src/report/plugin/grid/addFilterConditionPlugin/FilterWrapPanelController.js +57 -0
  99. package/src/report/plugin/grid/addFilterConditionPlugin/InfoMenuItem.js +111 -0
  100. package/src/report/plugin/grid/addFilterConditionPlugin/InfoMenuItem.scss +83 -0
  101. package/src/report/plugin/grid/addFilterConditionPlugin/SelectColumnPanel.js +102 -0
  102. package/src/report/selectionModels/MixedRowSelectionModel.js +36 -45
  103. package/src/report/toolbar/dropdown/ToolbarOverflowButton.js +16 -5
  104. package/src/report/toolbar/dropdown/ToolbarOverflowPanel.scss +26 -14
  105. package/src/report/toolbar/layout/ReportToolbarOverflow.js +5 -2
  106. package/src/ringBuffer.js +7 -3
  107. package/src/uielement/command/GetUIElementCommand.js +0 -1
  108. package/src/uielement/component/UiCPWrapper.js +26 -36
  109. package/src/uielement/component/UiCustomController.js +7 -0
  110. package/src/uielement/component/UiCustomPanel.js +46 -2
  111. package/src/uielement/component/settings/UiCustomPanelEditorController.js +35 -29
  112. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.js +146 -33
  113. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.scss +28 -0
  114. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGridController.js +366 -22
  115. package/src/uielement/component/settings/plugin/UiCustomPanelPluginModel.js +1 -0
  116. package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanel.js +10 -4
  117. package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanelController.js +28 -30
  118. package/src/uielement/plugin/UnifiedButtonToolbarPlugin.js +203 -22
  119. package/src/uielement/plugin/configPanel/ExecuteFunctionPluginConfigPanelFormEditor.js +4 -36
  120. package/src/uielement/plugin/configPanel/FireEventPluginConfigPanelFormEditor.js +5 -36
  121. package/src/uielement/plugin/configPanel/MethodChainPluginConfigPanelFormEditor.js +4 -36
  122. package/src/uielement/plugin/configPanel/OpenPanelPluginConfigPanelFormEditor.js +2 -38
  123. package/src/uielement/plugin/configPanel/PrintPdfPluginConfigPanelFormEditor.js +2 -35
  124. package/src/uielement/plugin/configPanel/UiCPPluginFormPanel.js +54 -0
  125. package/src/uielement/plugin/configPanel/UnifiedButtonToolbarPluginConfigPanelFormEditor.js +28 -18
  126. package/src/userSettings.js +1 -0
  127. package/src/util/ContextManager.js +109 -0
  128. package/src/util.js +96 -15
  129. package/src/version.js +1 -1
  130. package/src/app/viewPort/CenterViewController.js +0 -158
@@ -1,3 +1,11 @@
1
+ /**
2
+ * selection model для ReportGrid работающая в двух режимах:
3
+ *
4
+ * Режим выбора одной строки - можно выбрать с помощью клика по строке (чекбоксы не выбраны).
5
+ * Режим множественного выбора - активируется если хотя бы один чекбокс установлен/выбран. В этом режиме в таблице остается визуальный фокус
6
+ * при клике мышью на любой строке, но не происходит выбора строки.
7
+ * Пометка выбранных записей происходит только с помощью чекбоксов.
8
+ */
1
9
  Ext.define('Ext.selection.MixedRowSelectionModel', {
2
10
  extend: 'Ext.selection.RowModel',
3
11
  alias: 'selection.mixedRowModel',
@@ -42,7 +50,7 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
42
50
  const shift = e.shiftKey;
43
51
  switch (me.selectionMode) {
44
52
  case 'MULTI':
45
- this.customSelectWithEventMulti(record, e, isSelected); // Кастомное выделение
53
+ this.customSelectWithEventMulti(record, isSelected); // Кастомное выделение
46
54
  break;
47
55
 
48
56
  case 'SIMPLE':
@@ -64,13 +72,10 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
64
72
  }
65
73
  }
66
74
  },
67
- customSelectWithEventMulti: function(record, e, isSelected) {
68
- const me = this;
69
- const shift = false;
70
- const ctrl = false;
71
- const start = shift ? (me.getSelectionStart()) : null;
72
- const selected = me.getSelection();
75
+ customSelectWithEventMulti: function(record, isSelected) {
76
+ const selected = this.getSelection();
73
77
  const len = selected.length;
78
+
74
79
  let toDeselect;
75
80
  let i;
76
81
  let item;
@@ -89,16 +94,8 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
89
94
  isSelected = view.getRow(recordIndex).hasAttribute('aria-selected');
90
95
  }
91
96
  }
92
- if (shift && start) {
93
- me.selectRange(start, record, ctrl);
94
- } else if (ctrl && isSelected) {
95
- if (me.allowDeselect) {
96
- me.doDeselect(record, false);
97
- }
98
- } else if (ctrl) {
99
- me.doSelect(record, true, false);
100
- } else if (isSelected && !shift && !ctrl && len > 1) {
101
- if (me.allowDeselect) {
97
+ if (isSelected && len > 1) {
98
+ if (this.allowDeselect) {
102
99
  toDeselect = [];
103
100
 
104
101
  for (i = 0; i < len; ++i) {
@@ -108,15 +105,15 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
108
105
  toDeselect.push(item);
109
106
  }
110
107
  }
111
- me.doDeselect(toDeselect);
108
+ this.doDeselect(toDeselect);
112
109
  }
113
110
  } else if (!isSelected) {
114
111
  if (record.get('checked')) {
115
- me.doSelect(record, true);
112
+ this.doSelect(record, true);
116
113
  } else {
117
114
  for (const view of views) {
118
115
  const recordIndex = view.indexOf(record);
119
- if (recordIndex!== -1) {
116
+ if (recordIndex !== -1) {
120
117
  view.addItemCls(recordIndex, view.selectedItemCls);
121
118
  const rowNode = view.getRow(recordIndex);
122
119
  if (rowNode) {
@@ -126,37 +123,40 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
126
123
  }
127
124
  }
128
125
  }
129
- this.fireEvent('mixedrowselectionchange');
130
126
  },
131
127
  refreshView() {
132
128
  const views = this.views || [this.view];
133
129
  for (const view of views) {
134
- view.refresh();
130
+ if (view.bufferedRenderer) {
131
+ view.bufferedRenderer.refreshView();
132
+ } else {
133
+ view.refresh();
134
+ }
135
135
  }
136
136
  },
137
137
  clearCheckedRecords() {
138
138
  for (const record of this.checkedRecords) {
139
- record.set('checked', false);
139
+ record.set('checked', false, {dirty: false});
140
140
  }
141
141
  this.updateCheckedRecords();
142
142
  },
143
143
  beforeViewRender: function(view) {
144
- const me = this;
145
144
  const northPanel = view.up('ReportPanel').down('NorthPanel');
146
- northPanel.searchButton.on('click', () => {
147
- this.clearCheckedRecords();
148
- }, this);
149
- northPanel.clearButton.on('click', () => {
150
- this.clearCheckedRecords();
145
+ northPanel.searchButton.on('click', this.clearCheckedRecords, this);
146
+ northPanel.clearButton.on('click', this.clearCheckedRecords, this);
147
+ view.grid.on('datachanged', this.updateCheckedRecords, this);
148
+ view.grid.on('cellcontextmenu', function(view, td, cellIndex, record) {
149
+ this.customSelectWithEventMulti(record);
151
150
  }, this);
152
- view.grid.on('datachanged', () => {
153
- this.updateCheckedRecords();
154
- }, this);
155
- me.callParent(arguments);
156
- me.addCheckbox(view);
151
+ this.callParent(arguments);
152
+ this.addCheckbox(view);
157
153
  },
158
154
  addCheckbox: function(view) {
159
155
  const me = this;
156
+ if (view.getStore().isBufferedStore) {
157
+ me.showHeaderCheckbox = false;
158
+ }
159
+ Ext.suspendLayouts();
160
160
  view.headerCt.add(0, {
161
161
  xtype: 'checkcolumn',
162
162
  dataIndex: 'checked',
@@ -189,17 +189,7 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
189
189
  cls: Ext.baseCSSPrefix + 'selmodel-column',
190
190
  listeners: {
191
191
  checkchange: (col, rowIndex, checked, record) => {
192
- if (checked) {
193
- me.customSelectWithEventMulti(record, {
194
- shiftKey: false,
195
- ctrlKey: false,
196
- }, false);
197
- } else {
198
- me.customSelectWithEventMulti(record, {
199
- shiftKey: false,
200
- ctrlKey: false,
201
- }, true);
202
- }
192
+ me.customSelectWithEventMulti(record, !checked);
203
193
  },
204
194
  headercheckchange: (col, checked) => {
205
195
  if (checked) {
@@ -212,5 +202,6 @@ Ext.define('Ext.selection.MixedRowSelectionModel', {
212
202
  },
213
203
  },
214
204
  });
205
+ Ext.resumeLayouts();
215
206
  },
216
207
  });
@@ -39,7 +39,8 @@ Ext.define('Coon.report.toolbar.dropdown.ToolbarOverflowButton', {
39
39
  },
40
40
 
41
41
  onHidePanel: function() {
42
- this.setHidden(false);
42
+ Coon.util.VisualLinker.unlink(this, this.dropDownMenu);
43
+ // this.setHidden(false);
43
44
  if (this.dropDownMenu.shadowElem) {
44
45
  document.body.removeChild(this.dropDownMenu.shadowElem);
45
46
  }
@@ -81,13 +82,23 @@ Ext.define('Coon.report.toolbar.dropdown.ToolbarOverflowButton', {
81
82
  div.style.zIndex = style.zIndex + 1;
82
83
  div.style.top = (xy[1] - 36) + 'px';
83
84
  div.style.left = (xy[0] + Number(style.width.replace('px', '')) - 40) + 'px';
84
- this.dropDownMenu.shadowElem = document.body.appendChild(div);
85
- this.setHidden(true);
85
+ // this.dropDownMenu.shadowElem = document.body.appendChild(div);
86
+ // this.setHidden(true);
87
+
88
+ Coon.util.VisualLinker.createLinkedPair(
89
+ this,
90
+ this.dropDownMenu,
91
+ {
92
+ alignment: 'br',
93
+ bgColor: 'white',
94
+ }
95
+ );
96
+ Coon.util.VisualLinker.link(this, this.dropDownMenu);
86
97
  },
87
98
  listeners: {
88
99
  render: function() {
89
- if (this.reportToolbar.up('WindowWrap')) {
90
- this.reportToolbar.up('WindowWrap').on({
100
+ if (this.reportToolbar) {
101
+ this.reportToolbar.on({
91
102
  beforeclose: () => this.dropDownMenu.hide(),
92
103
  beforecollapse: () => this.dropDownMenu.hide(),
93
104
  beforehide: () => this.dropDownMenu.hide(),
@@ -1,19 +1,19 @@
1
1
  .ToolbarOverflowPanel {
2
2
 
3
- border: 1px solid #9DB2BF;
4
- border-top: none;
3
+ border: 1px solid #3d6780;
4
+ // border-top: none;
5
5
  .x-btn-button > .fix-btn-width {
6
6
  width: 30px;
7
7
  }
8
- .white-space{
9
- background-color: transparent;
10
- border-top: 1px solid #9DB2BF;
11
- width: 100%;
12
- height: 1px;
13
- position: absolute;
14
- top: 0;
15
- right: 32px;
16
- }
8
+ // .white-space{
9
+ // background-color: transparent;
10
+ // border-top: 1px solid #3d6780;
11
+ // width: 100%;
12
+ // height: 1px;
13
+ // position: absolute;
14
+ // top: 0;
15
+ // right: 32px;
16
+ // }
17
17
 
18
18
  .panel-body-buttons > .x-panel-bodyWrap > .x-panel-body{
19
19
  border-bottom: 1px solid #9DB2BF !important;
@@ -26,12 +26,24 @@
26
26
  }
27
27
 
28
28
 
29
+ }
30
+ .shadow-elem-main{
31
+ background-color: #ffffff;
32
+ position: absolute;
33
+ cursor: pointer;
34
+ width: 40px;
35
+ height: 37px;
29
36
  }
30
37
  .shadow-elem{
38
+ /*mask-repeat: no-repeat;
39
+ mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzggMzUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzM0NjNfNzU3NikiPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQgMEMxMC42ODYzIDAgOCAyLjY4NjI5IDggNlYyNkM4IDI3LjA1MDYgNy43OTMwNyAyOC4wOTA5IDcuMzkxMDQgMjkuMDYxNUM2Ljk4OSAzMC4wMzIxIDYuMzk5NzIgMzAuOTE0IDUuNjU2ODUgMzEuNjU2OUM0LjkxMzk5IDMyLjM5OTcgNC4wMzIwNyAzMi45ODkgMy4wNjE0NyAzMy4zOTFDMi4wOTA4NiAzMy43OTMxIDEuMDUwNTggMzQgMCAzNFYzNUg4SDlIMzhWNkMzOCAyLjY4NjI5IDM1LjMxMzcgMCAzMiAwSDE0WiIgZmlsbD0id2hpdGUiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI5LjUzMDMgMTguNTMwM0MyOS4yMzc0IDE4LjgyMzIgMjguNzYyNiAxOC44MjMyIDI4LjQ2O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2IDMyLjM2NEM2LjQ2ODQzIDMyLjI1OTUgNi41NzAxOSAzMi4xNTI2IDYuNjY5MTkgMzIuMDQzM0M3LjM2MjEzIDMxLjI3ODYgNy45MTkxNiAzMC4zOTk2IDguMzE0OTIgMjkuNDQ0MkM4Ljc2NzIxIDI4LjM1MjIgOSAyNy4xODE5IDkgMjZWNloiIGZpbGw9IiMzRDY3ODAiIGZpbGwtb3BhY2l0eT0iMC41Ii8+PC9nPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDBfMzQ2M183NTc2Ij48cmVjdCB3aWR0aD0iMzgiIGhlaWdodD0iMzUiIGZpbGw9IndoaXRlIi8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+");
44
+ width: 100%;
45
+ height: 100%;
46
+ mask-size: 100%;
33
47
  position: absolute;
34
48
  cursor: pointer;
35
- width: 40px;
36
- height: 40px;
37
49
  }
@@ -138,11 +138,14 @@ Ext.define('Coon.report.toolbar.layout.ReportToolbarOverflow', {
138
138
  me.systemContainer = Ext.create({
139
139
  xtype: 'container',
140
140
  itemId: 'systemContainer',
141
- layout: 'hbox',
141
+ layout: {
142
+ type: 'hbox',
143
+ pack: 'end',
144
+ },
142
145
  minWidth: 3,
143
146
  defaults: {
144
147
  style: {
145
- marginLeft: '10px',
148
+ marginLeft: '8px',
146
149
  },
147
150
  },
148
151
  style: {
package/src/ringBuffer.js CHANGED
@@ -6,11 +6,15 @@ Ext.define('Coon.ringBuffer', {
6
6
  constructor(cfg) {
7
7
  const buffer = [];
8
8
  let cursor = 0;
9
- this.getLength = () => (cfg.length || this.self.maxLength) - 1;
9
+ this.getLength = () => (cfg && cfg.length ? cfg.length : this.self.maxLength);
10
10
  this.getBuffer = () => buffer;
11
11
  this.getCursor = () => cursor;
12
+ this.reset = () => {
13
+ buffer.splice(0);
14
+ cursor = 0;
15
+ };
12
16
  this.advanceCursor = () => {
13
- if (cursor < this.getLength()) {
17
+ if (cursor < this.getLength() - 1) {
14
18
  cursor += 1;
15
19
  } else {
16
20
  cursor = 0;
@@ -27,7 +31,7 @@ Ext.define('Coon.ringBuffer', {
27
31
  },
28
32
 
29
33
  get() {
30
- return this.getBuffer().sort((a, b) => a.idx - b.idx);
34
+ return [...this.getBuffer()].sort((a, b) => a.idx - b.idx);
31
35
  },
32
36
 
33
37
  getElements() {
@@ -24,7 +24,6 @@ Ext.define('Coon.uielement.command.GetUIElementCommand', {
24
24
  }
25
25
  props.uiElementCd = this.uiElementCd;
26
26
  props.accessDecision = data.accessDecision;
27
- Coon.log.debug('GetUIElementCommand.props', props);
28
27
  data.propertyData = JSON5.stringify(props);
29
28
  } catch (ex) {
30
29
  Coon.log.error('GetUIElementCommand.UiCustomPanel: invalid propertyData JSON5');
@@ -1,3 +1,4 @@
1
+
1
2
  /**
2
3
  * Компонент для встраивания UiPanel внутри других компонентов и панелей
3
4
  * Пример:
@@ -30,17 +31,19 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
30
31
  autoLoad: true,
31
32
  initConfig: {},
32
33
  doInitParams: {},
33
- isDynamic: false,
34
- bubbleEvents: [],
35
34
  },
36
35
  defaults: {
37
36
  layout: 'fit',
38
37
  },
39
38
 
40
39
  initComponent: function() {
40
+ const parentCustomPanel = this.findParentByType('UiCustomPanel');
41
+ if (parentCustomPanel) {
42
+ parentCustomPanel.isParentCP = true;
43
+ }
41
44
  this.getUiElementCd() ?
42
45
  this.getUiPanel(this.getUiElementCd(), this.renderPanel.bind(this)) :
43
- !this.isDynamic && this.showError();
46
+ this.showError();
44
47
 
45
48
  this.callParent();
46
49
  },
@@ -56,7 +59,6 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
56
59
  }, this);
57
60
 
58
61
  command.on('failure', function() {
59
- this.loadMask && this.loadMask.hide();
60
62
  this.showError();
61
63
  }, this);
62
64
 
@@ -70,18 +72,9 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
70
72
  const parentViewModel = this.findParentByType('UiCustomPanel').getViewModel();
71
73
  config.viewModel = parentViewModel;
72
74
  }
75
+ config.isChildCP = true;
73
76
  const panel = Ext.create('widget.UiCustomPanel', config);
74
77
  this.uiPanel = panel;
75
- const relayEvents = Array.isArray(this.bubbleEvents) ? this.bubbleEvents : [];
76
- const initialListeners = this.getInitialConfig()?.listeners;
77
- if (typeof initialListeners === 'object') {
78
- Object.keys(initialListeners).forEach((event) => {
79
- if (event.startsWith('panel:')) {
80
- relayEvents.push(event);
81
- }
82
- });
83
- }
84
- relayEvents.length && this.relayEvents(panel, relayEvents);
85
78
  panel.on('afterrender', function() {
86
79
  this.autoLoad && this.panelDoInit(this.doInitParams);
87
80
  const doInitPanel = panel.getController() && panel.getController().doInit;
@@ -90,7 +83,25 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
90
83
  }
91
84
  }, this);
92
85
  this.add(panel);
93
- this.loadMask && this.loadMask.hide();
86
+ if (Array.isArray(this.customBubbleEvents) && this.customBubbleEvents.length) {
87
+ this.setCustomBubbleEvents(panel);
88
+ }
89
+ this.on('activate', () => {
90
+ panel.fireEvent('activate');
91
+ });
92
+ this.on('deactivate', () => {
93
+ panel.fireEvent('deactivate');
94
+ });
95
+ panel.on('dirtychange', (component, state) => {
96
+ this.fireEvent('dirtychange', this, state);
97
+ });
98
+ },
99
+
100
+ setCustomBubbleEvents(srcComponent) {
101
+ const parent = this.up(this.parentComponent || 'UiCustomPanel');
102
+ if (typeof parent.__processCustomBubbleEvents === 'function') {
103
+ parent.__processCustomBubbleEvents.call(parent, srcComponent, this.customBubbleEvents);
104
+ }
94
105
  },
95
106
 
96
107
  setDoInitParams: function(doInitParams) {
@@ -112,25 +123,4 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
112
123
  <span class="x-fa fa-exclamation-circle"/> Неверно сконфигурирован UICPWrapper
113
124
  </div>`);
114
125
  },
115
- /**
116
- * Вызывается автоматически перед вызовом setUiElementCd.
117
- * @param {String} uiElementCd
118
- * @returns {String} uiElementCd
119
- */
120
- applyUiElementCd(uiElementCd) {
121
- if (this.isDynamic && uiElementCd && this.uiElementCd !== uiElementCd) {
122
- if (this.uiPanel && this.uiPanel.isComponent) {
123
- this.remove(this.uiPanel);
124
- }
125
- if (!this.loadMask) {
126
- this.loadMask = new Ext.LoadMask({
127
- target: this,
128
- msg: 'Загрузка...',
129
- });
130
- }
131
- this.loadMask.show();
132
- this.getUiPanel(uiElementCd, this.renderPanel.bind(this));
133
- }
134
- return uiElementCd;
135
- },
136
126
  });
@@ -125,4 +125,11 @@ Ext.define('Coon.uielement.component.UiCustomController', {
125
125
  );
126
126
  },
127
127
 
128
+ setCustomPanelTitle(title) {
129
+ if (!['string', 'integer'].includes(typeof title)) {
130
+ return;
131
+ }
132
+ this.getView().fireEvent('titlechange', this.getView(), title);
133
+ },
134
+
128
135
  });
@@ -8,8 +8,7 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
8
8
  'Coon.uielement.plugin.CustomPanelPlugin',
9
9
  'Coon.uielement.component.UiCustomPanelTraceWindow'
10
10
  ],
11
- controller: {type: 'UiCustomController'},
12
- // viewModel: {type: 'UiCustomPanelViewModel'},
11
+ controller: 'UiCustomController',
13
12
 
14
13
  keyMap: {
15
14
  'Ctrl+Shift+Alt+F8': {
@@ -84,4 +83,49 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
84
83
  return data;
85
84
  },
86
85
 
86
+ /*
87
+ customBubbleEvent: [
88
+ {
89
+ sourceEventName - string
90
+ targetEventName - string
91
+ targetComponent // 'reference' || '[itemId=item1]' || view - string || object
92
+ targetHandlerName - string
93
+ }
94
+ ]
95
+ */
96
+ __processCustomBubbleEvents(srcComponent, bubbleEvents) {
97
+ if (!srcComponent) {
98
+ return;
99
+ }
100
+ if (Array.isArray(bubbleEvents) && bubbleEvents.length) {
101
+ bubbleEvents.forEach((el) => {
102
+ if (!Ext.isObject(el)) {
103
+ return;
104
+ }
105
+ let {sourceEventName, targetEventName, targetComponent = this, targetHandlerName} = el;
106
+ if (typeof sourceEventName !== 'string' || !sourceEventName) {
107
+ return;
108
+ }
109
+ srcComponent.on(sourceEventName, function(...args) {
110
+ if (typeof targetComponent === 'string') {
111
+ if (targetComponent[0] === '[') {
112
+ targetComponent = this.down(targetComponent);
113
+ } else {
114
+ targetComponent = this.down(`[reference=${targetComponent}]`);
115
+ }
116
+ }
117
+ const eventName = targetEventName || sourceEventName;
118
+ targetComponent.fireEvent(eventName, ...args);
119
+ const controller = targetComponent.getController();
120
+ if (targetHandlerName) {
121
+ if (typeof controller[targetHandlerName] === 'function') {
122
+ controller[targetHandlerName].call(controller, ...args);
123
+ } else if (typeof targetComponent[targetHandlerName] === 'function') {
124
+ targetComponent[targetHandlerName].call(targetComponent, ...args);
125
+ }
126
+ }
127
+ }, this);
128
+ });
129
+ }
130
+ },
87
131
  });