@kirbydesign/designsystem 5.0.14 → 5.0.15

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.
@@ -4110,16 +4110,6 @@
4110
4110
  },
4111
4111
  },
4112
4112
  },
4113
- // A failed attempt to get local typings working.
4114
- // The chartjs-plugin-marker is rewritten to not
4115
- // having to rely on own plugin settings, but using
4116
- // x-axis type time instead.
4117
- // @todo candidate for refactor once solved.
4118
- // marker: {
4119
- // line: {
4120
- // color: getThemeColorHexString('black-base'),
4121
- // }
4122
- // },
4123
4113
  datalabels: {
4124
4114
  backgroundColor: function (context) { return context.dataset.borderColor; },
4125
4115
  color: getThemeColorHexString$1('white'),
@@ -4170,7 +4160,11 @@
4170
4160
  { type: i0.Injectable }
4171
4161
  ];
4172
4162
 
4173
- // The marker pluin was heavily inspired by https://chartjs-plugin-crosshair.netlify.app
4163
+ /*
4164
+ The marker plugin is heavily inspired by https://chartjs-plugin-crosshair.netlify.app
4165
+ The project appears stale and only the vertical line feature is needed
4166
+ part of the plugin that was actually needed is implemented here.
4167
+ */
4174
4168
  var defaultOptions = {
4175
4169
  line: {
4176
4170
  color: 'black',
@@ -4182,14 +4176,10 @@
4182
4176
  },
4183
4177
  };
4184
4178
  var hasMarkerConfiguration = function (chart) {
4185
- var _a, _b, _c;
4186
- // using another plugins options is not ideal, so the issue with marker plugin
4187
- // should be resolved. As of right now the only chart that uses
4188
- // tooltip is stock charts.
4189
- return chart.config.options.scales.x && ((_c = (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.tooltip) === null || _c === void 0 ? void 0 : _c.enabled);
4190
- // @todo when resolving the typings issue with the markerplugin,
4191
- // this is a better conditional.
4192
- // return chart.config.options.scales.x && chart.config.options.plugins.marker
4179
+ /*
4180
+ Hacky solution. Should be fixed in this issue: https://github.com/kirbydesign/designsystem/issues/1967
4181
+ */
4182
+ return chart.data.datasets.some(function (dataset) { var _a; return !!((_a = dataset === null || dataset === void 0 ? void 0 : dataset.kirbyOptions) === null || _a === void 0 ? void 0 : _a.isStockChart); });
4193
4183
  };
4194
4184
  var ɵ0$7 = hasMarkerConfiguration;
4195
4185
  var MarkerPlugin = {
@@ -4685,6 +4675,15 @@
4685
4675
  var datasets = isNumberArray(data) ? [{ data: data }] : data;
4686
4676
  if (this.highlightedElements)
4687
4677
  this.addHighlightedElementsToDatasets(this.highlightedElements, datasets);
4678
+ /*
4679
+ Hacky solution. Should be fixed in this issue:
4680
+ https://github.com/kirbydesign/designsystem/issues/1967
4681
+ */
4682
+ if (this.chartType === 'stock') {
4683
+ datasets.forEach(function (dataset) {
4684
+ dataset.kirbyOptions = Object.assign(Object.assign({}, dataset.kirbyOptions), { isStockChart: true });
4685
+ });
4686
+ }
4688
4687
  return datasets;
4689
4688
  };
4690
4689
  /**