ru.coon 3.0.81 → 3.0.85

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/AGENTS.md ADDED
@@ -0,0 +1,26 @@
1
+ # Project Name
2
+
3
+ core of ExtJS 7 extensive expandable components
4
+
5
+ ## Code Style
6
+
7
+ - Follow ESLint configuration
8
+ - Use 2 spaces for indentation
9
+ - one file for one class
10
+
11
+ ## Architecture
12
+
13
+ - Follow DRY pattern
14
+ - Keep components under 200 lines
15
+ - Use dependency injection
16
+
17
+ ## Testing
18
+
19
+ - Write unit tests for all business logic
20
+ - Maintain >80% code coverage
21
+ - Use Jest for testing
22
+
23
+ ## Security
24
+
25
+ - Never commit API keys or secrets
26
+ - Validate all user inputs
package/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # Version 3.0.85, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d03e2cb1d340c80862f949a561196d650d1b720a)
2
+ * ## Fixes
3
+ * <span style='color:red'>fix</span> ([0c1ddd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0c1dddad599b412a7c363398f70bcecdb295ca32))
4
+
5
+ * update: CHANGELOG.md ([fc05a1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fc05a1851af51392f08e490b29524ca96249ec89))
6
+
7
+ # Version 3.0.84, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c37ea9fb9f014a9538fc9a30e6a6f95cc4a6d0cb)
8
+ * ## Fixes
9
+ * <span style='color:red'> OpenPanelPlugin, validation config on init</span> ([dcec0c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dcec0c0a8187b11ea4c107d8603e752273e72d4d))
10
+
11
+ * update: CHANGELOG.md ([f777dc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f777dc170d5c6302b14bfaf8cc5a1cfd72936b8e))
12
+
13
+ # Version 3.0.83, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2f24fb9935153a7d88b28312138c323de92e4492)
14
+ * HT-15051: доработка контекстного меню с summary row ([dc7342], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dc7342770b2c36940bdd6f53b631a10c1a1c3f8f))
15
+ * update: CHANGELOG.md ([8ca3ab], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8ca3abf029b3e618fc92ac2dd56d2211520bf465))
16
+
17
+ # Version 3.0.82, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4e900a01df1de39f5871323bf9520f2869ec9478)
18
+ * ## Fixes
19
+ * <span style='color:red'> HT-15028 TreeNestingToolbarButtonPlugin setDisabled not rendered nestingButton</span> ([7e3c76], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7e3c764edf97d7a3183c1cb6c1b92fe8c27257b2))
20
+ * <span style='color:red'> HT-15332 CopyRowsFromGrid fix addColumnNumbers in xls</span> ([2fd6e1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2fd6e1d02e82a9212a9f62e72ce5aee1f5a0fb57))
21
+
22
+ * HT-15082: исправление рендеринга значений в редактируемых ячейках ([79db43], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/79db43dd9dc5291ffd104deb35e0204aa4a84690))
23
+ * ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update file CopyRowsFromGrid.js6f8f4740848eec981e22d09d45305a4b9d910841))
24
+ * update: CHANGELOG.md ([c66da3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c66da3fb7fd0d6d11ee61eb0fe3b8a2b65df9020))
25
+
1
26
  # Version 3.0.81, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bd688d381953e5cc5d8011296b21dcd891bf1d7b)
2
27
  * ## Fixes
3
28
  * <span style='color:red'>fix</span> ([d82071], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d82071dc2c72b15caf116564cd84ec5b5900bfc6))
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "3.0.81",
7
+ "version": "3.0.85",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -600,17 +600,20 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
600
600
  numbersRow.cells.push(
601
601
  {
602
602
  value: ++index,
603
+ text: index,
603
604
  index,
604
605
  }
605
606
  );
606
607
  });
607
608
  header.push(numbersRow);
608
609
  }
609
- return type === 'xls' ? header : header.map((row) => {
610
- row.cells.forEach((cell) => {
611
- this.assignStyle(cell, this.tableHeaderStyle);
612
- });
613
- return row.cells;
610
+ return header.map((row) => {
611
+ if (type === 'xlsx') {
612
+ row.cells.forEach((cell) => {
613
+ this.assignStyle(cell, this.tableHeaderStyle);
614
+ });
615
+ }
616
+ return row.cells || row;
614
617
  });
615
618
  },
616
619
  getTitle() {
@@ -5,11 +5,14 @@ Ext.define('Coon.report.plugin.grid.GridContextMenu', {
5
5
  requires: [],
6
6
  alternateClassName: 'Sigma.common.grid.plugin.GridContextMenu',
7
7
  componentType: 'grid',
8
+
8
9
  constructor: function(config) {
9
10
  Ext.apply(this, config);
10
11
  this.callParent(arguments);
11
12
  },
13
+
12
14
  items: [],
15
+
13
16
  init: function(component) {
14
17
  if (!(component instanceof Ext.grid.Panel || component instanceof Ext.tree.Panel)) {
15
18
  return;
@@ -34,6 +37,85 @@ Ext.define('Coon.report.plugin.grid.GridContextMenu', {
34
37
  this.grid.contextMenu.on('hide', this.restoreCellQtip, this);
35
38
  this.grid.getSelectionModel().on('selectionchange', this.updateContext, this);
36
39
  this.grid.getStore().on('load', this.updateContext, this);
40
+
41
+ this.grid.on('afterrender', () => {
42
+ this.groupingFeature = this.grid.features.find((feature) => feature.$className === 'Ext.grid.feature.Grouping');
43
+ this.summaryFeature = this.grid.features.find((feature) => feature.$className === 'Ext.grid.feature.Summary');
44
+ this.grid.ariaEl?.on('contextmenu', this.onGridPanelContextMenu, this);
45
+ });
46
+ },
47
+
48
+ onGridPanelContextMenu(event, target) {
49
+ event.preventDefault();
50
+ if (this.grid.contextMenu.isVisible() || !this.isInteractiveTarget(target)) {
51
+ return;
52
+ }
53
+
54
+ if (event.record && this.groupingFeature) {
55
+ this.showContextMenu(this.getDataFromGroupingFeature(event, target, this.groupingFeature));
56
+ } else if (this.summaryFeature) {
57
+ this.showContextMenu(this.getDataFromSummaryFeature(event, target, this.summaryFeature));
58
+ }
59
+ },
60
+
61
+ isInteractiveTarget(target) {
62
+ if (
63
+ !target.classList.contains('x-grid-cell-inner') ||
64
+ Ext.isEmpty(target.innerHTML) ||
65
+ target.innerHTML.includes('&nbsp;')
66
+ ) {
67
+ return false;
68
+ }
69
+ return true;
70
+ },
71
+
72
+ getDataFromGroupingFeature(event, target, groupingFeature) {
73
+ const groupField = groupingFeature.groupRenderInfo.groupField;
74
+ const groupFieldValue = event.record.get(groupField);
75
+ const summaryData = groupingFeature.generateSummaryData();
76
+ const recordData = summaryData[groupFieldValue || ''].getData();
77
+ for (const [key, value] of Object.entries(recordData)) {
78
+ if (value instanceof Decimal) {
79
+ recordData[key] = Number(value);
80
+ }
81
+ }
82
+ const record = Ext.create('Ext.data.Model', recordData);
83
+ const cellIndex = event.position.colIdx;
84
+ return {
85
+ cellIndex: cellIndex,
86
+ rowIndex: event.position.rowIdx,
87
+ record: record,
88
+ view: this.grid.view,
89
+ td: target,
90
+ tr: event.rowElement,
91
+ event: event,
92
+ hasContext: true,
93
+ };
94
+ },
95
+
96
+ getDataFromSummaryFeature(event, target, summaryFeature) {
97
+ const cellContent = target.getHTML().replaceAll(/[ ]/g, '').replaceAll(',', '.');
98
+ let dataIndex;
99
+ const recordData = summaryFeature.summaryRecord.getData();
100
+ for (const [key, value] of Object.entries(recordData)) {
101
+ if (value instanceof Decimal) {
102
+ recordData[key] = Number(value);
103
+ }
104
+ if (cellContent === ('' + recordData[key])) {
105
+ dataIndex = key;
106
+ }
107
+ }
108
+ const record = Ext.create('Ext.data.Model', recordData);
109
+ const column = this.grid.columns.find((col) => col.dataIndex === dataIndex);
110
+ const cellIndex = column.getIndex();
111
+ return {
112
+ cellIndex: cellIndex,
113
+ record: record,
114
+ view: this.grid.view,
115
+ td: target,
116
+ event: event,
117
+ hasContext: true,
118
+ };
37
119
  },
38
120
 
39
121
  /**
@@ -53,11 +135,6 @@ Ext.define('Coon.report.plugin.grid.GridContextMenu', {
53
135
  this.qtipSpan = cell.querySelector('[data-qtip]');
54
136
  this.qtipSpan && this.qtipSpan.removeAttribute('data-qtip');
55
137
  }
56
-
57
- // contextMenu.alignTo(cell, 'tl-bl');
58
-
59
- // const y = contextMenu.getY();
60
- // contextMenu.setY(y - 7);
61
138
  },
62
139
 
63
140
  restoreCellQtip: function() {
@@ -79,6 +79,7 @@ Ext.define('Coon.report.plugin.grid.GridEditorsPlugin', {
79
79
 
80
80
  return !!value;
81
81
  };
82
+ const originRenderer = column.renderer;
82
83
  column.renderer = (value, metaData, record) => {
83
84
  let editable = true;
84
85
  if (editorConfig.dependsOnField && editorConfig.dependsOnFieldName) {
@@ -109,7 +110,7 @@ Ext.define('Coon.report.plugin.grid.GridEditorsPlugin', {
109
110
  if (Ext.isDate(value)) {
110
111
  return Ext.Date.format(value, editorConfig.mask.format || columnFormat);
111
112
  } else {
112
- return value;
113
+ return originRenderer ? originRenderer.call(editor, value, metaData) : value;
113
114
  }
114
115
  };
115
116
  hasEditor.on('beforeedit', function(editor, context) {
@@ -1,5 +1,5 @@
1
1
  Ext.define('Coon.report.plugin.grid.TreeNestingToolbarButtonPlugin', {
2
- extend: 'Coon.report.plugin.grid.GridToolbarButtonPlugin',
2
+ extend: 'Coon.report.plugin.grid.ToolbarItemPlugin',
3
3
  alias: 'plugin.TreeNestingToolbarButtonPlugin',
4
4
  uses: [],
5
5
 
@@ -34,18 +34,22 @@ Ext.define('Coon.report.plugin.grid.TreeNestingToolbarButtonPlugin', {
34
34
  }
35
35
 
36
36
  reportTree.getStore().on('load', function() {
37
- const records = reportTree.getStore().getRange();
38
- if (!records.length) {
39
- this.setDisabledButton(true, this.iconDisabled, null);
40
- return;
37
+ if (reportTree.rendered) {
38
+ this.setDisabledNestingButton();
39
+ } else {
40
+ reportTree.on('buttonIsAdded', this.setDisabledNestingButton, this);
41
41
  }
42
-
43
- const menu = this.getMenu(reportTree);
44
- this.setDisabledButton(false, this.iconEnabled, menu);
45
42
  }, this);
46
43
  },
47
44
 
48
- setDisabledButton: function(isDisabled, icon, menu) {
45
+ setDisabledNestingButton: function() {
46
+ if (!this.nestingButton) {
47
+ return;
48
+ }
49
+ const records = this.component.getStore().getRange();
50
+ const isDisabled = !records.length;
51
+ const icon = isDisabled ? this.iconDisabled : this.iconEnabled;
52
+ const menu = !isDisabled && this.getMenu(this.component);
49
53
  this.nestingButton.setDisabled(isDisabled);
50
54
  this.nestingButton.setIconCls(icon);
51
55
  this.nestingButton.setMenu(menu, false);
@@ -33,6 +33,10 @@ Ext.define('Coon.uielement.plugin.OpenPanelPlugin', {
33
33
  Coon.log.error('OpenPanelPlugin.init: uiElementCd is required');
34
34
  return;
35
35
  }
36
+ if (!this.config.panelXType) {
37
+ Coon.log.error('OpenPanelPlugin.init: panelXType is required');
38
+ return;
39
+ }
36
40
  this.initialized = true;
37
41
  this.cmpController = view.getController();
38
42
  if (this.cmpController) {
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '3.0.81',
3
+ number: '3.0.85',
4
4
  });