@eclipse-scout/chart 25.2.20 → 26.1.0-beta.1
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/README.md +2 -2
- package/dist/cyclonedx/bom.json +9 -9
- package/dist/cyclonedx/bom.xml +9 -9
- package/dist/d.ts/src/chart/AbstractSvgChartRenderer.d.ts +0 -1
- package/dist/d.ts/src/chart/AbstractSvgChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/src/chart/ChartJsRenderer.d.ts +1 -1
- package/dist/d.ts/src/chart/ChartJsRenderer.d.ts.map +1 -1
- package/dist/d.ts/src/chart/VennChartRenderer.d.ts +0 -1
- package/dist/d.ts/src/chart/VennChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/src/chart/chartJsDateAdapter.d.ts.map +1 -1
- package/dist/d.ts/src/index.d.ts +1 -0
- package/dist/d.ts/src/index.d.ts.map +1 -1
- package/dist/d.ts/src/table/controls/ChartTableControl.d.ts +15 -7
- package/dist/d.ts/src/table/controls/ChartTableControl.d.ts.map +1 -1
- package/dist/d.ts/src/table/controls/FocusFirstChartTypeKeyStroke.d.ts +12 -0
- package/dist/d.ts/src/table/controls/FocusFirstChartTypeKeyStroke.d.ts.map +1 -0
- package/dist/eclipse-scout-chart-a0ba2d4527b56d5f365b.min.js +3 -0
- package/dist/eclipse-scout-chart-a0ba2d4527b56d5f365b.min.js.map +1 -0
- package/dist/{eclipse-scout-chart-theme-dark-378a537154001198a741.min.css → eclipse-scout-chart-theme-dark-b66633525a81fd799cce.min.css} +1 -1
- package/dist/eclipse-scout-chart-theme-dark.css +20 -24
- package/dist/eclipse-scout-chart-theme-dark.css.map +1 -1
- package/dist/{eclipse-scout-chart-theme-03e8dfdce2c2cd602f40.min.css → eclipse-scout-chart-theme-f814f69e9d7fea0e5af7.min.css} +1 -1
- package/dist/eclipse-scout-chart-theme.css +20 -24
- package/dist/eclipse-scout-chart-theme.css.map +1 -1
- package/dist/eclipse-scout-chart.esm-93dfff2828c44625222f.min.js +3 -0
- package/dist/eclipse-scout-chart.esm-93dfff2828c44625222f.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm.js +341 -209
- package/dist/eclipse-scout-chart.esm.js.map +1 -1
- package/dist/eclipse-scout-chart.js +311 -179
- package/dist/eclipse-scout-chart.js.map +1 -1
- package/dist/file-list +6 -6
- package/dist/texts.json +28 -12
- package/package.json +11 -11
- package/src/chart/ChartJsRenderer.ts +13 -2
- package/src/chart/SalesfunnelChartRenderer.ts +7 -7
- package/src/chart/chartJsDateAdapter.ts +2 -2
- package/src/index.ts +1 -0
- package/src/table/controls/ChartTableControl.less +15 -28
- package/src/table/controls/ChartTableControl.ts +114 -57
- package/src/table/controls/FocusFirstChartTypeKeyStroke.ts +37 -0
- package/dist/eclipse-scout-chart-bbeb0621046a40fee663.min.js +0 -3
- package/dist/eclipse-scout-chart-bbeb0621046a40fee663.min.js.map +0 -1
- package/dist/eclipse-scout-chart.esm-4768ef7787c7b4db4fea.min.js +0 -3
- package/dist/eclipse-scout-chart.esm-4768ef7787c7b4db4fea.min.js.map +0 -1
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
*/
|
|
10
10
|
import {
|
|
11
|
-
arrays, Column, DateColumn, Event, EventListener,
|
|
12
|
-
TableMatrixNumberGroup, TableMatrixResult, tooltips
|
|
11
|
+
Action, arrays, Column, DateColumn, Event, EventListener, IconDesc, icons, InitModelOf, keys, KeyStrokeContext, NumberColumn, objects, scout, scrollbars, strings, styles, TabbableCoordinator, TabbableItem, Table, TableControl,
|
|
12
|
+
TableMatrix, TableMatrixDateGroup, TableMatrixKeyAxis, TableMatrixNumberGroup, TableMatrixResult, tooltips
|
|
13
13
|
} from '@eclipse-scout/core';
|
|
14
|
-
import {Chart, ChartTableControlEventMap, ChartTableControlLayout, ChartTableControlModel, ChartTableUserFilter} from '../../index';
|
|
14
|
+
import {Chart, ChartTableControlEventMap, ChartTableControlLayout, ChartTableControlModel, ChartTableUserFilter, FocusFirstChartTypeKeyStroke} from '../../index';
|
|
15
15
|
import $ from 'jquery';
|
|
16
16
|
import {BubbleDataPoint, ChartData, ChartType as ChartJsType} from 'chart.js';
|
|
17
17
|
import {ChartConfig, ClickObject} from '../../chart/Chart';
|
|
@@ -37,10 +37,14 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
37
37
|
$xAxisSelect: JQuery;
|
|
38
38
|
$yAxisSelect: JQuery;
|
|
39
39
|
$dataSelect: JQuery;
|
|
40
|
-
protected _chartTypeMap: Record<TableControlChartType,
|
|
40
|
+
protected _chartTypeMap: Record<TableControlChartType, Action>;
|
|
41
|
+
protected _chartTypeTabbableCoordinator: TabbableCoordinator;
|
|
41
42
|
protected _aggregationMap: Record<string, JQuery>;
|
|
43
|
+
protected _aggregationTabbableCoordinator: TabbableCoordinator;
|
|
42
44
|
protected _chartGroup1Map: Record<string, JQuery>;
|
|
45
|
+
protected _chartGroup1TabbableCoordinator: TabbableCoordinator;
|
|
43
46
|
protected _chartGroup2Map: Record<string, JQuery>;
|
|
47
|
+
protected _chartGroup2TabbableCoordinator: TabbableCoordinator;
|
|
44
48
|
protected _tableUpdatedHandler: (e: Event<Table>) => void;
|
|
45
49
|
protected _tableColumnStructureChangedHandler: () => void;
|
|
46
50
|
protected _chartValueClickedHandler: () => void;
|
|
@@ -70,6 +74,10 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
70
74
|
|
|
71
75
|
this.dateGroup = null;
|
|
72
76
|
|
|
77
|
+
this._chartTypeTabbableCoordinator = scout.create(TabbableCoordinator, {parent: this, autoRegisterKeyStrokes: false, orientation: 'vertical'});
|
|
78
|
+
this._chartGroup1TabbableCoordinator = scout.create(TabbableCoordinator, {parent: this, autoRegisterKeyStrokes: false, orientation: 'vertical'});
|
|
79
|
+
this._chartGroup2TabbableCoordinator = scout.create(TabbableCoordinator, {parent: this, autoRegisterKeyStrokes: false, orientation: 'vertical'});
|
|
80
|
+
this._aggregationTabbableCoordinator = scout.create(TabbableCoordinator, {parent: this, autoRegisterKeyStrokes: false, orientation: 'vertical'});
|
|
73
81
|
this._tableUpdatedHandler = this._onTableUpdated.bind(this);
|
|
74
82
|
this._tableColumnStructureChangedHandler = this._onTableColumnStructureChanged.bind(this);
|
|
75
83
|
this._chartValueClickedHandler = this._onChartValueClick.bind(this);
|
|
@@ -92,6 +100,11 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
92
100
|
super._destroy();
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
protected override _initKeyStrokeContext() {
|
|
104
|
+
super._initKeyStrokeContext();
|
|
105
|
+
this.tableControlKeyStrokeContext.registerKeyStroke(new FocusFirstChartTypeKeyStroke(this));
|
|
106
|
+
}
|
|
107
|
+
|
|
95
108
|
protected override _computeEnabled(inheritAccessibility: boolean, parentEnabled: boolean): boolean {
|
|
96
109
|
if (!this._hasColumns() && !this.selected) {
|
|
97
110
|
return false;
|
|
@@ -120,6 +133,9 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
120
133
|
this.$yAxisSelect.data('scroll-shadow').setVisible(true);
|
|
121
134
|
this.$yAxisSelect.removeClass('animated');
|
|
122
135
|
});
|
|
136
|
+
this._chartGroup2TabbableCoordinator.setItems(this.$yAxisSelect.hasClass('hide')
|
|
137
|
+
? []
|
|
138
|
+
: this.$yAxisSelect.children('.select-axis').map((i, item) => new TabbableItem($(item))).get());
|
|
123
139
|
|
|
124
140
|
if (this.contentRendered) {
|
|
125
141
|
this.chart.$container.animateAVCSD('opacity', 0, () => {
|
|
@@ -130,10 +146,10 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
130
146
|
}
|
|
131
147
|
|
|
132
148
|
protected _selectChartType() {
|
|
133
|
-
objects.values(this._chartTypeMap).forEach(
|
|
134
|
-
|
|
149
|
+
objects.values(this._chartTypeMap).forEach(action => {
|
|
150
|
+
action.setSelected(false);
|
|
135
151
|
});
|
|
136
|
-
this._chartTypeMap[this.chartType].
|
|
152
|
+
this._chartTypeMap[this.chartType].setSelected(true);
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
protected _renderChartGroup1() {
|
|
@@ -153,8 +169,10 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
153
169
|
let chartGroup = this[groupName];
|
|
154
170
|
if (chartGroup) {
|
|
155
171
|
let $element = this[map][chartGroup.id];
|
|
156
|
-
$element.siblings('.select-axis')
|
|
157
|
-
|
|
172
|
+
$element.siblings('.select-axis')
|
|
173
|
+
.setSelected(false)
|
|
174
|
+
.animateAVCSD('height', 30);
|
|
175
|
+
$element.setSelected(true);
|
|
158
176
|
|
|
159
177
|
if (chartGroup.modifier > 0) {
|
|
160
178
|
let dateGroupIndex = chartGroup.modifier ^ ChartTableControl.DATE_GROUP_FLAG;
|
|
@@ -170,8 +188,9 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
170
188
|
protected _renderChartAggregation() {
|
|
171
189
|
let $element = this._aggregationMap[this.chartAggregation.id || 'all'];
|
|
172
190
|
if ($element) {
|
|
173
|
-
$element.
|
|
191
|
+
$element.siblings('.select-data').setSelected(false);
|
|
174
192
|
$element
|
|
193
|
+
.setSelected(true)
|
|
175
194
|
.removeClass('data-sum')
|
|
176
195
|
.removeClass('data-avg');
|
|
177
196
|
$element.addClass(this._getAggregationCssClass());
|
|
@@ -194,24 +213,20 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
194
213
|
}
|
|
195
214
|
}
|
|
196
215
|
|
|
197
|
-
protected _renderChartSelect(cssClass: string, chartType: TableControlChartType, iconId: string) {
|
|
198
|
-
let
|
|
216
|
+
protected _renderChartSelect(cssClass: string, chartType: TableControlChartType, iconId: string, tooltipText: string) {
|
|
217
|
+
let action = scout.create(Action, {
|
|
199
218
|
parent: this,
|
|
200
|
-
|
|
201
|
-
cssClass
|
|
219
|
+
iconId,
|
|
220
|
+
cssClass,
|
|
221
|
+
tooltipText
|
|
202
222
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.data('chartType', chartType);
|
|
223
|
+
action.render(this.$chartSelect);
|
|
224
|
+
action.$container.addClass('chart-type menu-item').data('chartType', chartType);
|
|
225
|
+
action.on('action', this._onChartTypeAction.bind(this));
|
|
226
|
+
action.setEnabled(this._hasColumns());
|
|
227
|
+
this.$contentContainer.one('remove', () => action.destroy());
|
|
209
228
|
|
|
210
|
-
|
|
211
|
-
$iconContainer.on('click', this._onClickChartType.bind(this));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
this._chartTypeMap[chartType] = $iconContainer;
|
|
229
|
+
this._chartTypeMap[chartType] = action;
|
|
215
230
|
}
|
|
216
231
|
|
|
217
232
|
/**
|
|
@@ -222,25 +237,29 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
222
237
|
this.$chartSelect = this.$contentContainer.appendDiv('chart-select');
|
|
223
238
|
|
|
224
239
|
// create chart types for selection
|
|
225
|
-
this._chartTypeMap = {} as Record<TableControlChartType,
|
|
240
|
+
this._chartTypeMap = {} as Record<TableControlChartType, Action>;
|
|
226
241
|
|
|
227
242
|
let supportedChartTypes = this._getSupportedChartTypes();
|
|
228
243
|
|
|
229
244
|
if (scout.isOneOf(Chart.Type.BAR, supportedChartTypes)) {
|
|
230
|
-
this._renderChartSelect('chart-bar', Chart.Type.BAR, icons.DIAGRAM_BARS_VERTICAL);
|
|
245
|
+
this._renderChartSelect('chart-bar', Chart.Type.BAR, icons.DIAGRAM_BARS_VERTICAL, this.session.text('ui.ChartTypeBar'));
|
|
231
246
|
}
|
|
232
247
|
if (scout.isOneOf(Chart.Type.BAR_HORIZONTAL, supportedChartTypes)) {
|
|
233
|
-
this._renderChartSelect('chart-stacked', Chart.Type.BAR_HORIZONTAL, icons.DIAGRAM_BARS_HORIZONTAL);
|
|
248
|
+
this._renderChartSelect('chart-stacked', Chart.Type.BAR_HORIZONTAL, icons.DIAGRAM_BARS_HORIZONTAL, this.session.text('ui.ChartTypeBarHorizontal'));
|
|
234
249
|
}
|
|
235
250
|
if (scout.isOneOf(Chart.Type.LINE, supportedChartTypes)) {
|
|
236
|
-
this._renderChartSelect('chart-line', Chart.Type.LINE, icons.DIAGRAM_LINE);
|
|
251
|
+
this._renderChartSelect('chart-line', Chart.Type.LINE, icons.DIAGRAM_LINE, this.session.text('ui.ChartTypeLine'));
|
|
237
252
|
}
|
|
238
253
|
if (scout.isOneOf(Chart.Type.PIE, supportedChartTypes)) {
|
|
239
|
-
this._renderChartSelect('chart-pie', Chart.Type.PIE, icons.DIAGRAM_PIE);
|
|
254
|
+
this._renderChartSelect('chart-pie', Chart.Type.PIE, icons.DIAGRAM_PIE, this.session.text('ui.ChartTypePie'));
|
|
240
255
|
}
|
|
241
256
|
if (scout.isOneOf(Chart.Type.BUBBLE, supportedChartTypes)) {
|
|
242
|
-
this._renderChartSelect('chart-bubble', Chart.Type.BUBBLE, icons.DIAGRAM_SCATTER);
|
|
257
|
+
this._renderChartSelect('chart-bubble', Chart.Type.BUBBLE, icons.DIAGRAM_SCATTER, this.session.text('ui.ChartTypeBubble'));
|
|
243
258
|
}
|
|
259
|
+
let keyStrokeContext = new KeyStrokeContext({$bindTarget: this.$chartSelect, $scopeTarget: this.$chartSelect});
|
|
260
|
+
this.session.keyStrokeManager.installKeyStrokeContext(keyStrokeContext);
|
|
261
|
+
this._chartTypeTabbableCoordinator.registerKeyStrokes(this, keyStrokeContext);
|
|
262
|
+
this._chartTypeTabbableCoordinator.setItems(Object.values(this._chartTypeMap));
|
|
244
263
|
}
|
|
245
264
|
|
|
246
265
|
protected _getSupportedChartTypes(): TableControlChartType[] {
|
|
@@ -253,17 +272,27 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
253
272
|
];
|
|
254
273
|
}
|
|
255
274
|
|
|
256
|
-
protected
|
|
257
|
-
|
|
258
|
-
chartType = $target.data('chartType');
|
|
275
|
+
protected _onChartTypeAction(event: Event<Action>) {
|
|
276
|
+
const chartType = event.source.$container.data('chartType');
|
|
259
277
|
this.setChartType(chartType);
|
|
260
278
|
}
|
|
261
279
|
|
|
262
|
-
protected
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
280
|
+
protected _onChartGroupKeyDown(event: JQuery.KeyDownEvent) {
|
|
281
|
+
if (scout.isOneOf(event.which, keys.ENTER, keys.SPACE)) {
|
|
282
|
+
this._doChartGroupAction($(event.currentTarget));
|
|
283
|
+
event.stopPropagation();
|
|
284
|
+
event.preventDefault(); // Don't scroll when pressing space
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
protected _onChartGroupClick(event: JQuery.ClickEvent) {
|
|
289
|
+
this._doChartGroupAction($(event.currentTarget));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
protected _doChartGroupAction($target: JQuery) {
|
|
293
|
+
let groupId = $target.parent().data('groupId');
|
|
294
|
+
let column = $target.data('column');
|
|
295
|
+
let origModifier = $target.data('modifier');
|
|
267
296
|
|
|
268
297
|
// do nothing when item is disabled
|
|
269
298
|
if (!$target.isEnabled()) {
|
|
@@ -281,8 +310,18 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
281
310
|
this._setChartGroup(groupId, config);
|
|
282
311
|
}
|
|
283
312
|
|
|
284
|
-
protected
|
|
285
|
-
|
|
313
|
+
protected _onAggregationKeyDown(event: JQuery.KeyDownEvent) {
|
|
314
|
+
if (scout.isOneOf(event.which, keys.ENTER, keys.SPACE)) {
|
|
315
|
+
this._doAggregationAction($(event.currentTarget));
|
|
316
|
+
event.stopPropagation();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
protected _onAggregationClick(event: JQuery.ClickEvent) {
|
|
321
|
+
this._doAggregationAction($(event.currentTarget));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
protected _doAggregationAction($target: JQuery) {
|
|
286
325
|
// update modifier
|
|
287
326
|
let origModifier = $target.data('modifier');
|
|
288
327
|
let modifier = $target.isSelected() ? this._nextModifier(origModifier) : origModifier;
|
|
@@ -401,7 +440,9 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
401
440
|
}
|
|
402
441
|
|
|
403
442
|
protected override _renderContent($parent: JQuery) {
|
|
404
|
-
this.$contentContainer = $parent.appendDiv('chart-container')
|
|
443
|
+
this.$contentContainer = $parent.appendDiv('chart-container')
|
|
444
|
+
.attr('tabindex', '-1');
|
|
445
|
+
this.$contentContainer[0].focus(); // Pressing tab should select first chart type action
|
|
405
446
|
|
|
406
447
|
// scrollbars
|
|
407
448
|
this._installScrollbars();
|
|
@@ -482,14 +523,12 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
482
523
|
return Math.abs(a[1] as number - 8) - Math.abs(b[1] as number - 8);
|
|
483
524
|
});
|
|
484
525
|
|
|
485
|
-
let axisCount, enabled
|
|
486
|
-
|
|
487
|
-
columns = matrix.columns(false); // filterNumberColumns false: number columns will be filtered below
|
|
526
|
+
let axisCount, enabled;
|
|
527
|
+
let columns = matrix.columns(false); // filterNumberColumns false: number columns will be filtered below
|
|
488
528
|
|
|
489
529
|
// all x/y-axis for selection
|
|
490
530
|
for (let c1 = 0; c1 < columns.length; c1++) {
|
|
491
|
-
let
|
|
492
|
-
column1 = columns[c1];
|
|
531
|
+
let column1 = columns[c1];
|
|
493
532
|
|
|
494
533
|
// Check if data-spread is too large. This is a problem in large tables where a column has unique values.
|
|
495
534
|
// We cannot create DOM elements for each unique value because this causes all browser to stop script
|
|
@@ -506,11 +545,12 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
506
545
|
enabled = (axisCount <= ChartTableControl.MAX_AXIS_COUNT);
|
|
507
546
|
}
|
|
508
547
|
|
|
509
|
-
content = this._axisContentForColumn(column1);
|
|
548
|
+
let content = this._axisContentForColumn(column1);
|
|
510
549
|
|
|
511
|
-
$div = this.$contentContainer
|
|
512
|
-
.makeDiv('select-axis', this._plainAxisText(column1, content.text))
|
|
550
|
+
let $div = this.$contentContainer
|
|
551
|
+
.makeDiv('select-axis prevent-initial-focus', this._plainAxisText(column1, content.text))
|
|
513
552
|
.data('column', column1)
|
|
553
|
+
.unfocusable()
|
|
514
554
|
.setEnabled(enabled);
|
|
515
555
|
|
|
516
556
|
if (!enabled) {
|
|
@@ -530,12 +570,13 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
530
570
|
if (column1 instanceof DateColumn) {
|
|
531
571
|
$div
|
|
532
572
|
.data('modifier', TableMatrix.DateGroup.YEAR)
|
|
533
|
-
.appendDiv('select-axis-group', this.dateGroup[0][1]);
|
|
573
|
+
.appendDiv('select-axis-group', String(this.dateGroup[0][1]));
|
|
534
574
|
}
|
|
535
575
|
|
|
536
576
|
// install click handler or tooltip
|
|
537
577
|
if (enabled) {
|
|
538
|
-
$div.on('click', this.
|
|
578
|
+
$div.on('click', this._onChartGroupClick.bind(this));
|
|
579
|
+
$div.on('keydown', this._onChartGroupKeyDown.bind(this));
|
|
539
580
|
tooltips.installForEllipsis($div, {
|
|
540
581
|
parent: this
|
|
541
582
|
});
|
|
@@ -546,13 +587,21 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
546
587
|
});
|
|
547
588
|
}
|
|
548
589
|
|
|
549
|
-
|
|
550
|
-
$yDiv = $div.clone(true);
|
|
590
|
+
let $yDiv = $div.clone(true);
|
|
551
591
|
this._chartGroup1Map[column1.id] = $div;
|
|
552
592
|
this._chartGroup2Map[column1.id] = $yDiv;
|
|
553
593
|
this.$xAxisSelect.append($div);
|
|
554
594
|
this.$yAxisSelect.append($yDiv);
|
|
555
595
|
}
|
|
596
|
+
let chartGroup1KeyStrokeContext = new KeyStrokeContext({$bindTarget: this.$xAxisSelect, $scopeTarget: this.$xAxisSelect});
|
|
597
|
+
this.session.keyStrokeManager.installKeyStrokeContext(chartGroup1KeyStrokeContext);
|
|
598
|
+
this._chartGroup1TabbableCoordinator.registerKeyStrokes(this, chartGroup1KeyStrokeContext);
|
|
599
|
+
this._chartGroup1TabbableCoordinator.setItems(this.$xAxisSelect.children('.select-axis').map((i, item) => new TabbableItem($(item))).get());
|
|
600
|
+
|
|
601
|
+
let chartGroup2KeyStrokeContext = new KeyStrokeContext({$bindTarget: this.$yAxisSelect, $scopeTarget: this.$yAxisSelect});
|
|
602
|
+
this.session.keyStrokeManager.installKeyStrokeContext(chartGroup2KeyStrokeContext);
|
|
603
|
+
this._chartGroup2TabbableCoordinator.registerKeyStrokes(this, chartGroup2KeyStrokeContext);
|
|
604
|
+
// Items will be set in _renderChartType
|
|
556
605
|
|
|
557
606
|
// map for selection (column id, $element)
|
|
558
607
|
this._aggregationMap = {};
|
|
@@ -569,7 +618,8 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
569
618
|
// add data-count for no column restriction (all columns)
|
|
570
619
|
let countDesc = this.session.text('ui.Count');
|
|
571
620
|
this._aggregationMap.all = this.$dataSelect
|
|
572
|
-
.appendDiv('select-data data-count', countDesc)
|
|
621
|
+
.appendDiv('select-data data-count prevent-initial-focus', countDesc)
|
|
622
|
+
.unfocusable()
|
|
573
623
|
.data('column', null)
|
|
574
624
|
.data('modifier', TableMatrix.NumberGroup.COUNT);
|
|
575
625
|
|
|
@@ -589,7 +639,8 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
589
639
|
}
|
|
590
640
|
|
|
591
641
|
this._aggregationMap[column2.id] = this.$dataSelect
|
|
592
|
-
.appendDiv('select-data data-sum', columnText)
|
|
642
|
+
.appendDiv('select-data data-sum prevent-initial-focus', columnText)
|
|
643
|
+
.unfocusable()
|
|
593
644
|
.data('column', column2)
|
|
594
645
|
.data('modifier', TableMatrix.NumberGroup.SUM);
|
|
595
646
|
}
|
|
@@ -597,7 +648,13 @@ export class ChartTableControl extends TableControl implements ChartTableControl
|
|
|
597
648
|
|
|
598
649
|
// click handling for data
|
|
599
650
|
$('.select-data', this.$contentContainer)
|
|
600
|
-
.on('click', this.
|
|
651
|
+
.on('click', this._onAggregationClick.bind(this))
|
|
652
|
+
.on('keydown', this._onAggregationKeyDown.bind(this));
|
|
653
|
+
|
|
654
|
+
let keyStrokeContext = new KeyStrokeContext({$bindTarget: this.$dataSelect, $scopeTarget: this.$dataSelect});
|
|
655
|
+
this.session.keyStrokeManager.installKeyStrokeContext(keyStrokeContext);
|
|
656
|
+
this._aggregationTabbableCoordinator.registerKeyStrokes(this, keyStrokeContext);
|
|
657
|
+
this._aggregationTabbableCoordinator.setItems(this.$dataSelect.children('.select-data').map((i, item) => new TabbableItem($(item))).get());
|
|
601
658
|
}
|
|
602
659
|
|
|
603
660
|
return columnCount;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
import {focusUtils, keys, KeyStroke, ScoutKeyboardEvent} from '@eclipse-scout/core';
|
|
11
|
+
import {ChartTableControl} from './ChartTableControl';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Focuses the first chart type if the focus is on the content container of the chart table control (which is the case when the table control opens).
|
|
15
|
+
*/
|
|
16
|
+
export class FocusFirstChartTypeKeyStroke extends KeyStroke {
|
|
17
|
+
declare field: ChartTableControl;
|
|
18
|
+
|
|
19
|
+
constructor(action: ChartTableControl) {
|
|
20
|
+
super();
|
|
21
|
+
this.field = action;
|
|
22
|
+
this.which = [keys.DOWN];
|
|
23
|
+
|
|
24
|
+
this.stopPropagation = true;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
protected override _accept(event: ScoutKeyboardEvent): boolean {
|
|
28
|
+
if (!super._accept(event)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return focusUtils.isActiveElement(this.field.$contentContainer);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override handle(event: JQuery.KeyboardEventBase) {
|
|
35
|
+
this.field.$chartSelect.children('.chart-type').first()[0]?.focus();
|
|
36
|
+
}
|
|
37
|
+
}
|