@carbon/charts 0.50.9 → 0.50.10
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/CHANGELOG.md +11 -0
- package/build/demo/data/circle-pack.d.ts +0 -6
- package/build/src/components/axes/toolbar.d.ts +1 -0
- package/build/src/components/essentials/legend.d.ts +1 -1
- package/build/src/services/essentials/dom-utils.d.ts +3 -0
- package/build/src/services/scales-cartesian.d.ts +1 -1
- package/bundle.js +1 -1
- package/components/axes/toolbar.d.ts +1 -0
- package/components/axes/toolbar.js +74 -48
- package/components/axes/toolbar.js.map +1 -1
- package/components/axes/zoom-bar.js +12 -3
- package/components/axes/zoom-bar.js.map +1 -1
- package/components/component.js +2 -6
- package/components/component.js.map +1 -1
- package/components/essentials/legend.d.ts +1 -1
- package/components/essentials/legend.js +20 -8
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/modal.js +3 -3
- package/components/essentials/modal.js.map +1 -1
- package/components/essentials/title.js +2 -2
- package/components/essentials/title.js.map +1 -1
- package/components/essentials/tooltip.js +2 -2
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/alluvial.js +29 -12
- package/components/graphs/alluvial.js.map +1 -1
- package/components/graphs/area-stacked.js +1 -0
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/area.js +2 -4
- package/components/graphs/area.js.map +1 -1
- package/components/graphs/boxplot.js +1 -0
- package/components/graphs/boxplot.js.map +1 -1
- package/components/graphs/bubble.js +4 -0
- package/components/graphs/bubble.js.map +1 -1
- package/components/graphs/gauge.js +2 -4
- package/components/graphs/gauge.js.map +1 -1
- package/components/graphs/histogram.js +3 -1
- package/components/graphs/histogram.js.map +1 -1
- package/components/graphs/pie.js +1 -1
- package/components/graphs/pie.js.map +1 -1
- package/components/graphs/radar.js +8 -7
- package/components/graphs/radar.js.map +1 -1
- package/components/graphs/skeleton-lines.js +8 -3
- package/components/graphs/skeleton-lines.js.map +1 -1
- package/components/graphs/skeleton.js +18 -5
- package/components/graphs/skeleton.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/circle-pack.d.ts +0 -6
- package/demo/data/circle-pack.js +0 -6
- package/demo/data/circle-pack.js.map +1 -1
- package/demo/styles.css +45 -93
- package/demo/styles.css.map +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/styles.min.css.map +1 -1
- package/demo/tsconfig.tsbuildinfo +3 -3
- package/demo/utils.js +2 -2
- package/demo/utils.js.map +1 -1
- package/package.json +1 -1
- package/services/essentials/dom-utils.d.ts +3 -0
- package/services/essentials/dom-utils.js +9 -1
- package/services/essentials/dom-utils.js.map +1 -1
- package/styles/components/_skeleton-lines.scss +1 -2
- package/styles/components/_skeleton.scss +2 -7
- package/styles/components/_toolbar.scss +1 -1
- package/styles/components/_tooltip.scss +4 -2
- package/styles/components/_zoom-bar.scss +0 -12
- package/styles-g10.css +11 -23
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +11 -23
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +11 -23
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +11 -23
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tsconfig.tsbuildinfo +22 -22
|
@@ -41,51 +41,64 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
Toolbar.prototype.render = function (animate) {
|
|
44
|
+
var _this = this;
|
|
44
45
|
if (animate === void 0) { animate = true; }
|
|
45
|
-
var container = this.getComponentContainer();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.attr('class', 'bx--overflow-menu-options bx--overflow-menu--flip')
|
|
50
|
-
.attr('tabindex', -1)
|
|
51
|
-
.attr('role', 'menu')
|
|
52
|
-
.html("<ul></ul>");
|
|
46
|
+
var container = this.getComponentContainer().attr('role', 'toolbar');
|
|
47
|
+
var isDataLoading = Tools.getProperty(this.getOptions(), 'data', 'loading');
|
|
48
|
+
if (isDataLoading) {
|
|
49
|
+
container.html('');
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
51
|
+
else {
|
|
52
|
+
if (!this.overflowMenu) {
|
|
53
|
+
this.overflowMenu = container
|
|
54
|
+
.append('div')
|
|
55
|
+
.attr('class', 'bx--overflow-menu-options bx--overflow-menu--flip')
|
|
56
|
+
.attr('tabindex', -1)
|
|
57
|
+
.attr('role', 'menu')
|
|
58
|
+
.html("<ul></ul>");
|
|
59
|
+
}
|
|
60
|
+
// get the toolbar buttons
|
|
61
|
+
var _a = this.getControlConfigs(), buttonList = _a.buttonList, overflowMenuItemList = _a.overflowMenuItemList;
|
|
62
|
+
// overflow button is required only if overflow menu item list is valid
|
|
63
|
+
if (!!overflowMenuItemList) {
|
|
64
|
+
buttonList.push(this.getOverflowButtonConfig());
|
|
65
|
+
}
|
|
66
|
+
var toolbarControls = container
|
|
67
|
+
.selectAll('div.toolbar-control')
|
|
68
|
+
.data(buttonList, function (button) { return button.id; });
|
|
69
|
+
toolbarControls.exit().remove();
|
|
70
|
+
var enteringToolbarControls = toolbarControls
|
|
71
|
+
.enter()
|
|
72
|
+
.append('div')
|
|
73
|
+
.attr('class', 'toolbar-control bx--overflow-menu')
|
|
74
|
+
.attr('role', 'button');
|
|
75
|
+
var allToolbarControls = enteringToolbarControls
|
|
76
|
+
.merge(toolbarControls)
|
|
77
|
+
.classed('disabled', function (d) {
|
|
78
|
+
return d.shouldBeDisabled ? d.shouldBeDisabled() : false;
|
|
79
|
+
})
|
|
80
|
+
.attr('aria-disabled', function (d) {
|
|
81
|
+
return d.shouldBeDisabled ? d.shouldBeDisabled() : false;
|
|
82
|
+
})
|
|
83
|
+
.attr('aria-label', function (d) { return d.title; })
|
|
84
|
+
.html(function (d) { return "\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"" + _this.services.domUtils.generateElementIDString("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: " + (d.iconWidth !== undefined ? d.iconWidth : '20px') + "; height: " + (d.iconWidth !== undefined ? d.iconHeight : '20px') + "\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t" + d.iconSVGContent + "\n\t\t\t\t</svg>\n\t\t\t</button>"; })
|
|
85
|
+
.each(function (d) {
|
|
86
|
+
select(this)
|
|
87
|
+
.select('button')
|
|
88
|
+
.on('click', !d.shouldBeDisabled() ? d.clickFunction : null)
|
|
89
|
+
.on('keyup', function (event) {
|
|
90
|
+
if ((event.key && event.key === 'Enter') ||
|
|
91
|
+
event.key === ' ') {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
d.clickFunction();
|
|
94
|
+
}
|
|
95
|
+
});
|
|
84
96
|
});
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
this.overflowButton = this.getComponentContainer().select("button.bx--overflow-menu__trigger#" + this.services.domUtils.generateElementIDString('control-toolbar-overflow-menu'));
|
|
98
|
+
}
|
|
87
99
|
};
|
|
88
100
|
Toolbar.prototype.renderOverflowMenu = function () {
|
|
101
|
+
var _this = this;
|
|
89
102
|
var overflowMenuItemList = this.getControlConfigs().overflowMenuItemList;
|
|
90
103
|
var overflowMenuControls = this.overflowMenu
|
|
91
104
|
.select('ul')
|
|
@@ -97,12 +110,14 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
97
110
|
var enteringOverflowMenuControls = overflowMenuControls
|
|
98
111
|
.enter()
|
|
99
112
|
.append('li')
|
|
100
|
-
.attr('id', function (d) {
|
|
101
|
-
.
|
|
113
|
+
.attr('id', function (d) {
|
|
114
|
+
return _this.services.domUtils.generateElementIDString("control-" + d.id);
|
|
115
|
+
})
|
|
116
|
+
.attr('class', 'bx--overflow-menu-options__option')
|
|
117
|
+
.attr('role', 'menuitem');
|
|
102
118
|
enteringOverflowMenuControls
|
|
103
119
|
.append('button')
|
|
104
|
-
.attr('class', 'bx--overflow-menu-options__btn')
|
|
105
|
-
.attr('role', 'menuitem');
|
|
120
|
+
.attr('class', 'bx--overflow-menu-options__btn');
|
|
106
121
|
enteringOverflowMenuControls
|
|
107
122
|
.merge(overflowMenuControls)
|
|
108
123
|
.classed('bx--overflow-menu-options__option--disabled', function (d) {
|
|
@@ -142,7 +157,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
142
157
|
}
|
|
143
158
|
// only if previous enabled menu item found
|
|
144
159
|
if (previousItemIndex < overflowMenuItems.length) {
|
|
145
|
-
var previousItemNode = select("#" + overflowMenuItems[previousItemIndex].id + " button").node();
|
|
160
|
+
var previousItemNode = select("#" + this.services.domUtils.generateElementIDString("control-" + overflowMenuItems[previousItemIndex].id) + " button").node();
|
|
146
161
|
if ('focus' in previousItemNode) {
|
|
147
162
|
previousItemNode.focus();
|
|
148
163
|
}
|
|
@@ -160,13 +175,14 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
160
175
|
}
|
|
161
176
|
// only if next enabled menu item found
|
|
162
177
|
if (nextItemIndex > -1) {
|
|
163
|
-
var nextItemNode = select("#" + overflowMenuItems[nextItemIndex].id + " button").node();
|
|
178
|
+
var nextItemNode = select("#" + this.services.domUtils.generateElementIDString("control-" + overflowMenuItems[nextItemIndex].id) + " button").node();
|
|
164
179
|
if ('focus' in nextItemNode) {
|
|
165
180
|
nextItemNode.focus();
|
|
166
181
|
}
|
|
167
182
|
}
|
|
168
183
|
};
|
|
169
184
|
Toolbar.prototype.toggleOverflowMenu = function (event) {
|
|
185
|
+
var _this = this;
|
|
170
186
|
if (this.isOverflowMenuOpen()) {
|
|
171
187
|
// hide overflow menu
|
|
172
188
|
this.updateOverflowMenu(false);
|
|
@@ -178,7 +194,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
178
194
|
var self_1 = this;
|
|
179
195
|
var overflowMenuItems = this.getOverflowMenuItems();
|
|
180
196
|
overflowMenuItems.forEach(function (menuItem, index) {
|
|
181
|
-
var element = select("#" + menuItem.id);
|
|
197
|
+
var element = select("#" + _this.services.domUtils.generateElementIDString("control-" + menuItem.id));
|
|
182
198
|
if (element !== null) {
|
|
183
199
|
element.on('click', function () {
|
|
184
200
|
// call the specified function
|
|
@@ -253,6 +269,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
253
269
|
var _this = this;
|
|
254
270
|
return {
|
|
255
271
|
id: 'toolbar-overflow-menu',
|
|
272
|
+
title: 'More options',
|
|
256
273
|
shouldBeDisabled: function () { return false; },
|
|
257
274
|
iconSVGContent: "<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"24\" r=\"2\"></circle>",
|
|
258
275
|
clickFunction: function (event) { return _this.toggleOverflowMenu(event); },
|
|
@@ -263,12 +280,14 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
263
280
|
var isZoomBarEnabled = this.services.zoom &&
|
|
264
281
|
this.services.zoom.isZoomBarEnabled() &&
|
|
265
282
|
!this.services.zoom.isEmptyState();
|
|
283
|
+
var displayData = this.model.getDisplayData();
|
|
266
284
|
var controlConfig;
|
|
267
285
|
switch (controlType) {
|
|
268
286
|
case ToolbarControlTypes.ZOOM_IN:
|
|
269
287
|
if (isZoomBarEnabled) {
|
|
270
288
|
controlConfig = {
|
|
271
289
|
id: 'toolbar-zoomIn',
|
|
290
|
+
title: 'Zoom in',
|
|
272
291
|
shouldBeDisabled: function () {
|
|
273
292
|
return _this.services.zoom.isMinZoomDomain();
|
|
274
293
|
},
|
|
@@ -281,6 +300,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
281
300
|
if (isZoomBarEnabled) {
|
|
282
301
|
controlConfig = {
|
|
283
302
|
id: 'toolbar-zoomOut',
|
|
303
|
+
title: 'Zoom out',
|
|
284
304
|
shouldBeDisabled: function () {
|
|
285
305
|
return _this.services.zoom.isMaxZoomDomain();
|
|
286
306
|
},
|
|
@@ -293,6 +313,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
293
313
|
if (isZoomBarEnabled) {
|
|
294
314
|
controlConfig = {
|
|
295
315
|
id: 'toolbar-resetZoom',
|
|
316
|
+
title: 'Reset zoom',
|
|
296
317
|
shouldBeDisabled: function () {
|
|
297
318
|
return _this.services.zoom.isMaxZoomDomain();
|
|
298
319
|
},
|
|
@@ -306,6 +327,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
306
327
|
case ToolbarControlTypes.MAKE_FULLSCREEN:
|
|
307
328
|
controlConfig = {
|
|
308
329
|
id: 'toolbar-makefullscreen',
|
|
330
|
+
title: 'Make fullscreen',
|
|
309
331
|
iconSVGContent: this.getControlIconByType(controlType),
|
|
310
332
|
iconWidth: '15px',
|
|
311
333
|
iconHight: '15px',
|
|
@@ -318,8 +340,9 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
318
340
|
case ToolbarControlTypes.SHOW_AS_DATATABLE:
|
|
319
341
|
controlConfig = {
|
|
320
342
|
id: 'toolbar-showasdatatable',
|
|
343
|
+
title: 'Show as table',
|
|
321
344
|
iconSVGContent: this.getControlIconByType(controlType),
|
|
322
|
-
shouldBeDisabled:
|
|
345
|
+
shouldBeDisabled: function () { return displayData.length === 0; },
|
|
323
346
|
clickFunction: function () {
|
|
324
347
|
return _this.services.events.dispatchEvent(Events.Modal.SHOW);
|
|
325
348
|
},
|
|
@@ -328,6 +351,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
328
351
|
case ToolbarControlTypes.EXPORT_CSV:
|
|
329
352
|
controlConfig = {
|
|
330
353
|
id: 'toolbar-export-CSV',
|
|
354
|
+
title: 'Export as CSV',
|
|
331
355
|
shouldBeDisabled: function () { return false; },
|
|
332
356
|
iconSVGContent: this.getControlIconByType(controlType),
|
|
333
357
|
clickFunction: function () { return _this.model.exportToCSV(); },
|
|
@@ -336,6 +360,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
336
360
|
case ToolbarControlTypes.EXPORT_PNG:
|
|
337
361
|
controlConfig = {
|
|
338
362
|
id: 'toolbar-export-PNG',
|
|
363
|
+
title: 'Export as PNG',
|
|
339
364
|
shouldBeDisabled: function () { return false; },
|
|
340
365
|
iconSVGContent: this.getControlIconByType(controlType),
|
|
341
366
|
clickFunction: function () { return _this.services.domUtils.exportToPNG(); },
|
|
@@ -344,6 +369,7 @@ var Toolbar = /** @class */ (function (_super) {
|
|
|
344
369
|
case ToolbarControlTypes.EXPORT_JPG:
|
|
345
370
|
controlConfig = {
|
|
346
371
|
id: 'toolbar-export-JPG',
|
|
372
|
+
title: 'Export as JPG',
|
|
347
373
|
shouldBeDisabled: function () { return false; },
|
|
348
374
|
iconSVGContent: this.getControlIconByType(controlType),
|
|
349
375
|
clickFunction: function () { return _this.services.domUtils.exportToJPG(); },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EA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AApB,UAAqB,WAAgC;QACpD,QAAQ,WAAW,EAAE;YACpB,KAAK,mBAAmB,CAAC,OAAO;gBAC/B,OAAO,iQAC4I,CAAC;YACrJ,KAAK,mBAAmB,CAAC,QAAQ;gBAChC,OAAO,oNAC4I,CAAC;YACrJ,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,eAAe;gBACvC,OAAO,oLAAgL,CAAC;YACzL,KAAK,mBAAmB,CAAC,iBAAiB;gBACzC,OAAO,gZAAgV,CAAC;YACzV,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC;YACxN,KAAK,mBAAmB,CAAC,UAAU;gBAClC,OAAO,iNAA+M,CAAC,CAAC,sBAAsB;YAC/O,sCAAsC;YAEtC;gBACC,MAAM,KAAK,CACV,sCAAsC,GAAG,WAAW,CACpD,CAAC;SACH;IACF,CAAC;IACF,cAAC;AAAD,CAAC,AAhcD,CAA6B,SAAS,GAgcrC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { Events, RenderTypes, ToolbarControlTypes } from '../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { select } from 'd3-selection';\n\nexport class Toolbar extends Component {\n\ttype = 'toolbar';\n\trenderType = RenderTypes.HTML;\n\n\t// overflow menu button to control background color\n\toverflowButton: any;\n\n\t// div options list element\n\toverflowMenu: any;\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false);\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\tthis.renderOverflowMenu();\n\n\t\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer();\n\n\t\tif (!this.overflowMenu) {\n\t\t\tthis.overflowMenu = container\n\t\t\t\t.append('div')\n\t\t\t\t.attr(\n\t\t\t\t\t'class',\n\t\t\t\t\t'bx--overflow-menu-options bx--overflow-menu--flip'\n\t\t\t\t)\n\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t.attr('role', 'menu')\n\t\t\t\t.html(`<ul></ul>`);\n\t\t}\n\n\t\t// get the toolbar buttons\n\t\tconst { buttonList, overflowMenuItemList } = this.getControlConfigs();\n\n\t\t// overflow button is required only if overflow menu item list is valid\n\t\tif (!!overflowMenuItemList) {\n\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t}\n\n\t\tconst toolbarControls = container\n\t\t\t.selectAll('div.toolbar-control')\n\t\t\t.data(buttonList, (button) => button.id);\n\n\t\ttoolbarControls.exit().remove();\n\n\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t.enter()\n\t\t\t.append('div')\n\t\t\t.attr('class', 'toolbar-control bx--overflow-menu');\n\n\t\tconst allToolbarControls = enteringToolbarControls\n\t\t\t.merge(toolbarControls)\n\t\t\t.classed('disabled', (d) =>\n\t\t\t\td.shouldBeDisabled ? d.shouldBeDisabled() : false\n\t\t\t)\n\t\t\t.html(\n\t\t\t\t(d) => `\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"${d.id}\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: ${\n\t\t\t\t\td.iconWidth !== undefined ? d.iconWidth : '20px'\n\t\t\t\t}; height: ${\n\t\t\t\t\td.iconWidth !== undefined ? d.iconHeight : '20px'\n\t\t\t\t}\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t${d.iconSVGContent}\n\t\t\t\t</svg>\n\t\t\t</button>`\n\t\t\t)\n\t\t\t.each(function (d) {\n\t\t\t\tselect(this)\n\t\t\t\t\t.select('button')\n\t\t\t\t\t.on('click', d.clickFunction)\n\t\t\t\t\t.on('keyup', (event: KeyboardEvent) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(event.key && event.key === 'Enter') ||\n\t\t\t\t\t\t\tevent.key === ' '\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\td.clickFunction();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t});\n\n\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t'button.bx--overflow-menu__trigger#toolbar-overflow-menu'\n\t\t);\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.bx--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button) =>\n\t\t\t\tTools.getProperty(button, 'id')\n\t\t\t);\n\n\t\toverflowMenuControls.exit().remove();\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d) => d.id)\n\t\t\t.attr('class', 'bx--overflow-menu-options__option');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'bx--overflow-menu-options__btn')\n\t\t\t.attr('role', 'menuitem');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('bx--overflow-menu-options__option--disabled', (d) =>\n\t\t\t\td.shouldBeDisabled()\n\t\t\t)\n\t\t\t.attr('aria-disabled', (d) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d) => d.text);\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open');\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tthis.overflowMenu.classed('is-open', show);\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show);\n\t\t\tselect(this.overflowButton.node().parentNode).classed(\n\t\t\t\t'bx--overflow-menu--open',\n\t\t\t\tshow\n\t\t\t);\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU\n\t\t\t);\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU\n\t\t\t);\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet previousItemIndex = overflowMenuItems.length;\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${overflowMenuItems[previousItemIndex].id} button`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet nextItemIndex = -1;\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${overflowMenuItems[nextItemIndex].id} button`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false);\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true);\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this;\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\t\toverflowMenuItems.forEach((menuItem, index) => {\n\t\t\t\tconst element = select(`#${menuItem.id}`);\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\tmenuItem.clickFunction();\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t});\n\n\t\t\t\t\telement.on('keyup', () => {\n\t\t\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\t\tmenuItem.clickFunction();\n\t\t\t\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1);\n\t\t}\n\t\tevent.stopImmediatePropagation();\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'numberOfIcons'\n\t\t);\n\t\tconst controls = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'controls'\n\t\t);\n\n\t\tconst controlList = [];\n\t\tconst overflowSpecificControls = [];\n\t\tcontrols.forEach((control) => {\n\t\t\tconst controlConfig = this.getControlConfigByType(control.type);\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type;\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig);\n\t\t\t\t} else {\n\t\t\t\t\tcontrolList.push(controlConfig);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (\n\t\t\tcontrolList.length <= numberOfIcons &&\n\t\t\toverflowSpecificControls.length === 0\n\t\t) {\n\t\t\treturn {\n\t\t\t\tbuttonList: controlList,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t// leave one button for overflow button\n\t\t\tbuttonList: controlList.splice(0, numberOfIcons - 1),\n\t\t\toverflowMenuItemList: controlList.concat(overflowSpecificControls),\n\t\t};\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVGContent: `<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"24\" r=\"2\"></circle>`,\n\t\t\tclickFunction: (event) => this.toggleOverflowMenu(event),\n\t\t};\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState();\n\n\t\tlet controlConfig;\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\t\tthis.services.zoom.resetZoomDomain(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\ticonWidth: '15px',\n\t\t\t\t\ticonHight: '15px',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tshouldBeDisabled: false,\n\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\tthis.services.events.dispatchEvent(Events.Modal.SHOW),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t\treturn controlConfig;\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn `<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn `<polygon points=\"21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2\"/><polygon points=\"15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42\"/>`;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn `<rect x=\"4\" y=\"6\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"12\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"18\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"24\" width=\"18\" height=\"2\"/><rect x=\"26\" y=\"6\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"12\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"18\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"24\" width=\"2\" height=\"2\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`; // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;QAAA,qEAifC;QAhfA,UAAI,GAAG,SAAS,CAAC;QACjB,gBAAU,GAAG,WAAW,CAAC,IAAI,CAAC;;IA+e/B,CAAC;IAveA,sBAAI,GAAJ;QAAA,iBAsBC;QArBA,IAAM,kBAAkB,GAAG,cAAM,OAAA,KAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAA9B,CAA8B,CAAC;QAEhE,2BAA2B;QAC3B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CACpC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EACjC;YACC,KAAI,CAAC,kBAAkB,EAAE,CAAC;YAE1B,6DAA6D;YAC7D,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAC7D,CAAC,CACD,CAAC;QAEF,+DAA+D;QAC/D,IAAI,CAAC,QAAQ,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,KAAK,CACV,sCAAsC,GAAG,WAAW,CACpD,CAAC;SACH;IACF,CAAC;IACF,cAAC;AAAD,CAAC,AAjfD,CAA6B,SAAS,GAifrC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { Events, RenderTypes, ToolbarControlTypes } from '../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { select } from 'd3-selection';\n\nexport class Toolbar extends Component {\n\ttype = 'toolbar';\n\trenderType = RenderTypes.HTML;\n\n\t// overflow menu button to control background color\n\toverflowButton: any;\n\n\t// div options list element\n\toverflowMenu: any;\n\n\tinit() {\n\t\tconst bodyOnClickHandler = () => this.updateOverflowMenu(false);\n\n\t\t// Grab the tooltip element\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\tthis.renderOverflowMenu();\n\n\t\t\t\t// hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.addEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\n\t\t// listen to hide overflow menu event to hide the overflow menu\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU,\n\t\t\t() => {\n\t\t\t\t// // hide overflow menu if user clicks on somewhere in web page\n\t\t\t\tdocument.body.removeEventListener('click', bodyOnClickHandler);\n\t\t\t}\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst container = this.getComponentContainer().attr('role', 'toolbar');\n\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'data',\n\t\t\t'loading'\n\t\t);\n\n\t\tif (isDataLoading) {\n\t\t\tcontainer.html('');\n\t\t} else {\n\t\t\tif (!this.overflowMenu) {\n\t\t\t\tthis.overflowMenu = container\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'class',\n\t\t\t\t\t\t'bx--overflow-menu-options bx--overflow-menu--flip'\n\t\t\t\t\t)\n\t\t\t\t\t.attr('tabindex', -1)\n\t\t\t\t\t.attr('role', 'menu')\n\t\t\t\t\t.html(`<ul></ul>`);\n\t\t\t}\n\n\t\t\t// get the toolbar buttons\n\t\t\tconst {\n\t\t\t\tbuttonList,\n\t\t\t\toverflowMenuItemList,\n\t\t\t} = this.getControlConfigs();\n\n\t\t\t// overflow button is required only if overflow menu item list is valid\n\t\t\tif (!!overflowMenuItemList) {\n\t\t\t\tbuttonList.push(this.getOverflowButtonConfig());\n\t\t\t}\n\n\t\t\tconst toolbarControls = container\n\t\t\t\t.selectAll('div.toolbar-control')\n\t\t\t\t.data(buttonList, (button) => button.id);\n\n\t\t\ttoolbarControls.exit().remove();\n\n\t\t\tconst enteringToolbarControls = toolbarControls\n\t\t\t\t.enter()\n\t\t\t\t.append('div')\n\t\t\t\t.attr('class', 'toolbar-control bx--overflow-menu')\n\t\t\t\t.attr('role', 'button');\n\n\t\t\tconst allToolbarControls = enteringToolbarControls\n\t\t\t\t.merge(toolbarControls)\n\t\t\t\t.classed('disabled', (d) =>\n\t\t\t\t\td.shouldBeDisabled ? d.shouldBeDisabled() : false\n\t\t\t\t)\n\t\t\t\t.attr('aria-disabled', (d) =>\n\t\t\t\t\td.shouldBeDisabled ? d.shouldBeDisabled() : false\n\t\t\t\t)\n\t\t\t\t.attr('aria-label', (d) => d.title)\n\t\t\t\t.html(\n\t\t\t\t\t(d) => `\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)}\" aria-label=\"${d.title}\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: ${\n\t\t\t\t\td.iconWidth !== undefined ? d.iconWidth : '20px'\n\t\t\t\t}; height: ${\n\t\t\t\t\t\td.iconWidth !== undefined ? d.iconHeight : '20px'\n\t\t\t\t\t}\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t${d.iconSVGContent}\n\t\t\t\t</svg>\n\t\t\t</button>`\n\t\t\t\t)\n\t\t\t\t.each(function (d) {\n\t\t\t\t\tselect(this)\n\t\t\t\t\t\t.select('button')\n\t\t\t\t\t\t.on('click', !d.shouldBeDisabled() ? d.clickFunction : null)\n\t\t\t\t\t\t.on('keyup', (event: KeyboardEvent) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(event.key && event.key === 'Enter') ||\n\t\t\t\t\t\t\t\tevent.key === ' '\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\td.clickFunction();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\tthis.overflowButton = this.getComponentContainer().select(\n\t\t\t\t`button.bx--overflow-menu__trigger#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t'control-toolbar-overflow-menu'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t}\n\n\trenderOverflowMenu() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\n\t\tconst overflowMenuControls = this.overflowMenu\n\t\t\t.select('ul')\n\t\t\t.selectAll('li.bx--overflow-menu-options__option')\n\t\t\t.data(overflowMenuItemList, (button) =>\n\t\t\t\tTools.getProperty(button, 'id')\n\t\t\t);\n\n\t\toverflowMenuControls.exit().remove();\n\n\t\tconst enteringOverflowMenuControls = overflowMenuControls\n\t\t\t.enter()\n\t\t\t.append('li')\n\t\t\t.attr('id', (d) =>\n\t\t\t\tthis.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${d.id}`\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('class', 'bx--overflow-menu-options__option')\n\t\t\t.attr('role', 'menuitem');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.append('button')\n\t\t\t.attr('class', 'bx--overflow-menu-options__btn');\n\n\t\tenteringOverflowMenuControls\n\t\t\t.merge(overflowMenuControls)\n\t\t\t.classed('bx--overflow-menu-options__option--disabled', (d) =>\n\t\t\t\td.shouldBeDisabled()\n\t\t\t)\n\t\t\t.attr('aria-disabled', (d) => d.shouldBeDisabled())\n\t\t\t.selectAll('button')\n\t\t\t.text((d) => d.text);\n\t}\n\n\tisOverflowMenuOpen() {\n\t\treturn this.overflowMenu.classed('is-open');\n\t}\n\n\t// show/hide overflow menu\n\tupdateOverflowMenu(show: boolean) {\n\t\tthis.overflowMenu.classed('is-open', show);\n\n\t\t// update overflow button background\n\t\tif (this.overflowButton) {\n\t\t\tthis.overflowButton.attr('aria-expanded', show);\n\t\t\tselect(this.overflowButton.node().parentNode).classed(\n\t\t\t\t'bx--overflow-menu--open',\n\t\t\t\tshow\n\t\t\t);\n\t\t}\n\n\t\tif (show) {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.SHOW_OVERFLOW_MENU\n\t\t\t);\n\t\t} else {\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tEvents.Toolbar.HIDE_OVERFLOW_MENU\n\t\t\t);\n\t\t}\n\t}\n\n\tfocusOnPreviousEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet previousItemIndex = overflowMenuItems.length;\n\n\t\tfor (let i = currentItemIndex - 1; i >= 0; i--) {\n\t\t\tconst previousOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!previousOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tpreviousItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if previous enabled menu item found\n\t\tif (previousItemIndex < overflowMenuItems.length) {\n\t\t\tconst previousItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[previousItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\t\t\tif ('focus' in previousItemNode) {\n\t\t\t\tpreviousItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusOnNextEnabledMenuItem(currentItemIndex) {\n\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\tlet nextItemIndex = -1;\n\n\t\tfor (let i = currentItemIndex + 1; i < overflowMenuItems.length; i++) {\n\t\t\tconst nextOverflowMenuItem = overflowMenuItems[i];\n\t\t\tif (!nextOverflowMenuItem.shouldBeDisabled()) {\n\t\t\t\tnextItemIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// only if next enabled menu item found\n\t\tif (nextItemIndex > -1) {\n\t\t\tconst nextItemNode = select(\n\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t`control-${overflowMenuItems[nextItemIndex].id}`\n\t\t\t\t)} button`\n\t\t\t).node();\n\n\t\t\tif ('focus' in nextItemNode) {\n\t\t\t\tnextItemNode.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\ttoggleOverflowMenu(event) {\n\t\tif (this.isOverflowMenuOpen()) {\n\t\t\t// hide overflow menu\n\t\t\tthis.updateOverflowMenu(false);\n\t\t} else {\n\t\t\t// show overflow menu\n\t\t\tthis.updateOverflowMenu(true);\n\n\t\t\t// setup overflow menu item event listener\n\t\t\tconst self = this;\n\t\t\tconst overflowMenuItems = this.getOverflowMenuItems();\n\t\t\toverflowMenuItems.forEach((menuItem, index) => {\n\t\t\t\tconst element = select(\n\t\t\t\t\t`#${this.services.domUtils.generateElementIDString(\n\t\t\t\t\t\t`control-${menuItem.id}`\n\t\t\t\t\t)}`\n\t\t\t\t);\n\t\t\t\tif (element !== null) {\n\t\t\t\t\telement.on('click', () => {\n\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\tmenuItem.clickFunction();\n\n\t\t\t\t\t\t// hide overflow menu\n\t\t\t\t\t\tself.updateOverflowMenu(false);\n\t\t\t\t\t});\n\n\t\t\t\t\telement.on('keyup', () => {\n\t\t\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\t\t\t// call the specified function\n\t\t\t\t\t\t\tmenuItem.clickFunction();\n\t\t\t\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\t\t\t\t// focus on previous menu item\n\t\t\t\t\t\t\tself.focusOnPreviousEnabledMenuItem(index);\n\t\t\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\t\t\t// focus on next menu item\n\t\t\t\t\t\t\tself.focusOnNextEnabledMenuItem(index);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Not hide overflow menu by keyboard arrow up/down event\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// default to focus on the first enabled menu item\n\t\t\tself.focusOnNextEnabledMenuItem(-1);\n\t\t}\n\t\tevent.stopImmediatePropagation();\n\t}\n\n\tgetControlConfigs() {\n\t\tconst numberOfIcons = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'numberOfIcons'\n\t\t);\n\t\tconst controls = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'toolbar',\n\t\t\t'controls'\n\t\t);\n\n\t\tconst controlList = [];\n\t\tconst overflowSpecificControls = [];\n\t\tcontrols.forEach((control) => {\n\t\t\tconst controlConfig = this.getControlConfigByType(control.type);\n\n\t\t\t// add to list if config is valid\n\t\t\tif (controlConfig) {\n\t\t\t\tcontrolConfig.text = control.text ? control.text : control.type;\n\n\t\t\t\tif (controlConfig.id.indexOf('toolbar-export') !== -1) {\n\t\t\t\t\toverflowSpecificControls.push(controlConfig);\n\t\t\t\t} else {\n\t\t\t\t\tcontrolList.push(controlConfig);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (\n\t\t\tcontrolList.length <= numberOfIcons &&\n\t\t\toverflowSpecificControls.length === 0\n\t\t) {\n\t\t\treturn {\n\t\t\t\tbuttonList: controlList,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t// leave one button for overflow button\n\t\t\tbuttonList: controlList.splice(0, numberOfIcons - 1),\n\t\t\toverflowMenuItemList: controlList.concat(overflowSpecificControls),\n\t\t};\n\t}\n\n\tgetOverflowMenuItems() {\n\t\tconst { overflowMenuItemList } = this.getControlConfigs();\n\t\tif (!!overflowMenuItemList) {\n\t\t\treturn overflowMenuItemList;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// special button config for overflow button\n\tgetOverflowButtonConfig() {\n\t\treturn {\n\t\t\tid: 'toolbar-overflow-menu',\n\t\t\ttitle: 'More options',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\ticonSVGContent: `<circle cx=\"16\" cy=\"8\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"16\" r=\"2\"></circle>\n\t\t\t\t\t\t\t <circle cx=\"16\" cy=\"24\" r=\"2\"></circle>`,\n\t\t\tclickFunction: (event) => this.toggleOverflowMenu(event),\n\t\t};\n\t}\n\n\tgetControlConfigByType(controlType: ToolbarControlTypes) {\n\t\tconst isZoomBarEnabled =\n\t\t\tthis.services.zoom &&\n\t\t\tthis.services.zoom.isZoomBarEnabled() &&\n\t\t\t!this.services.zoom.isEmptyState();\n\n\t\tconst displayData = this.model.getDisplayData();\n\n\t\tlet controlConfig;\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomIn',\n\t\t\t\t\t\ttitle: 'Zoom in',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMinZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomIn(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-zoomOut',\n\t\t\t\t\t\ttitle: 'Zoom out',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () => this.services.zoom.zoomOut(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\tif (isZoomBarEnabled) {\n\t\t\t\t\tcontrolConfig = {\n\t\t\t\t\t\tid: 'toolbar-resetZoom',\n\t\t\t\t\t\ttitle: 'Reset zoom',\n\t\t\t\t\t\tshouldBeDisabled: () =>\n\t\t\t\t\t\t\tthis.services.zoom.isMaxZoomDomain(),\n\t\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\t\tthis.services.zoom.resetZoomDomain(),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-makefullscreen',\n\t\t\t\t\ttitle: 'Make fullscreen',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\ticonWidth: '15px',\n\t\t\t\t\ticonHight: '15px',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\tclickFunction: () => {\n\t\t\t\t\t\tthis.services.domUtils.toggleFullscreen();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-showasdatatable',\n\t\t\t\t\ttitle: 'Show as table',\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tshouldBeDisabled: () => displayData.length === 0,\n\t\t\t\t\tclickFunction: () =>\n\t\t\t\t\t\tthis.services.events.dispatchEvent(Events.Modal.SHOW),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-CSV',\n\t\t\t\t\ttitle: 'Export as CSV',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.model.exportToCSV(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-PNG',\n\t\t\t\t\ttitle: 'Export as PNG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToPNG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\tcontrolConfig = {\n\t\t\t\t\tid: 'toolbar-export-JPG',\n\t\t\t\t\ttitle: 'Export as JPG',\n\t\t\t\t\tshouldBeDisabled: () => false,\n\t\t\t\t\ticonSVGContent: this.getControlIconByType(controlType),\n\t\t\t\t\tclickFunction: () => this.services.domUtils.exportToJPG(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t// add more toolbar control configuration here\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t\treturn controlConfig;\n\t}\n\n\tgetControlIconByType(controlType: ToolbarControlTypes) {\n\t\tswitch (controlType) {\n\t\t\tcase ToolbarControlTypes.ZOOM_IN:\n\t\t\t\treturn `<polygon points=\"19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.ZOOM_OUT:\n\t\t\t\treturn `<rect x=\"9\" y=\"13\" width=\"10\" height=\"2\"/>\n\t\t\t\t\t\t<path d=\"M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z\"/>`;\n\t\t\tcase ToolbarControlTypes.RESET_ZOOM:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.MAKE_FULLSCREEN:\n\t\t\t\treturn `<polygon points=\"21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2\"/><polygon points=\"15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42\"/>`;\n\t\t\tcase ToolbarControlTypes.SHOW_AS_DATATABLE:\n\t\t\t\treturn `<rect x=\"4\" y=\"6\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"12\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"18\" width=\"18\" height=\"2\"/><rect x=\"4\" y=\"24\" width=\"18\" height=\"2\"/><rect x=\"26\" y=\"6\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"12\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"18\" width=\"2\" height=\"2\"/><rect x=\"26\" y=\"24\" width=\"2\" height=\"2\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_CSV:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_JPG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`;\n\t\t\tcase ToolbarControlTypes.EXPORT_PNG:\n\t\t\t\treturn `<path d=\"M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z\"/>`; // add more icons here\n\t\t\t// svg icon must be with 32x32 viewBox\n\n\t\t\tdefault:\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Not supported toolbar control type: ' + controlType\n\t\t\t\t);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -88,7 +88,10 @@ var ZoomBar = /** @class */ (function (_super) {
|
|
|
88
88
|
.attr('y', 0)
|
|
89
89
|
.attr('width', width - axesLeftMargin)
|
|
90
90
|
.attr('height', '100%')
|
|
91
|
-
.classed('zoom-bg-skeleton', isTopZoomBarLoading)
|
|
91
|
+
.classed('zoom-bg-skeleton', isTopZoomBarLoading)
|
|
92
|
+
.style('stroke', isTopZoomBarLoading
|
|
93
|
+
? "url(#" + this.services.domUtils.generateElementIDString("shimmer-lines") + ")"
|
|
94
|
+
: null);
|
|
92
95
|
}
|
|
93
96
|
else if (zoombarType === ZoomBarTypes.SLIDER_VIEW) {
|
|
94
97
|
// Draw zoombar background line
|
|
@@ -97,7 +100,10 @@ var ZoomBar = /** @class */ (function (_super) {
|
|
|
97
100
|
.attr('y', zoombarHeight / 2 - 1)
|
|
98
101
|
.attr('width', width - axesLeftMargin)
|
|
99
102
|
.attr('height', 2)
|
|
100
|
-
.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading)
|
|
103
|
+
.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading)
|
|
104
|
+
.style('stroke', isTopZoomBarLoading
|
|
105
|
+
? "url(#" + this.services.domUtils.generateElementIDString("shimmer-lines") + ")"
|
|
106
|
+
: null);
|
|
101
107
|
}
|
|
102
108
|
if (isTopZoomBarLoading) {
|
|
103
109
|
this.renderSkeleton(container, axesLeftMargin, width);
|
|
@@ -455,7 +461,10 @@ var ZoomBar = /** @class */ (function (_super) {
|
|
|
455
461
|
]);
|
|
456
462
|
DOMUtils.appendOrSelect(container, 'path.zoom-bg-baseline')
|
|
457
463
|
.attr('d', baselineGenerator)
|
|
458
|
-
.classed('zoom-bg-baseline-skeleton', skeletonClass)
|
|
464
|
+
.classed('zoom-bg-baseline-skeleton', skeletonClass)
|
|
465
|
+
.style('stroke', skeletonClass
|
|
466
|
+
? "url(#" + this.services.domUtils.generateElementIDString("shimmer-lines") + ")"
|
|
467
|
+
: null);
|
|
459
468
|
};
|
|
460
469
|
ZoomBar.prototype.renderSkeleton = function (container, startX, endX) {
|
|
461
470
|
// need to clear current zoom bar area
|