@websy/websy-designs 1.1.10 → 1.1.11

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.
@@ -925,9 +925,11 @@ class WebsyDropdown {
925
925
  close () {
926
926
  const maskEl = document.getElementById(`${this.elementId}_mask`)
927
927
  const contentEl = document.getElementById(`${this.elementId}_content`)
928
+ const scrollEl = document.getElementById(`${this.elementId}_itemsContainer`)
929
+ scrollEl.scrollTop = 0
928
930
  maskEl.classList.remove('active')
929
931
  contentEl.classList.remove('active')
930
- contentEl.classList.remove('on-top')
932
+ contentEl.classList.remove('on-top')
931
933
  const searchEl = document.getElementById(`${this.elementId}_search`)
932
934
  if (searchEl) {
933
935
  if (searchEl.value.length > 0 && this.options.onCancelSearch) {
@@ -1050,6 +1052,9 @@ class WebsyDropdown {
1050
1052
  searchEl.focus()
1051
1053
  }
1052
1054
  }
1055
+ if (this.options.onOpen) {
1056
+ this.options.onOpen(this.elementId)
1057
+ }
1053
1058
  }
1054
1059
  render () {
1055
1060
  if (!this.elementId) {
@@ -4924,7 +4929,7 @@ if (this.options.orientation === 'horizontal') {
4924
4929
  yAxis = 'bottomAxis'
4925
4930
  }
4926
4931
  let barWidth = this[xAxis].bandwidth()
4927
- if (this.options.data.series.length > 1 && this.options.grouping !== 'stacked') {
4932
+ if (this.options.data.series.length > 1 && this.options.grouping === 'grouped') {
4928
4933
  barWidth = barWidth / this.options.data.series.length - 4
4929
4934
  }
4930
4935
  function getBarHeight (d, i) {
@@ -4955,7 +4960,7 @@ function getBarX (d, i) {
4955
4960
  }
4956
4961
  }
4957
4962
  else {
4958
- if (this.options.grouping !== 'stacked') {
4963
+ if (this.options.grouping !== 'grouped') {
4959
4964
  return this[xAxis](this.parseX(d.x.value))
4960
4965
  }
4961
4966
  else {
@@ -4965,7 +4970,7 @@ function getBarX (d, i) {
4965
4970
  }
4966
4971
  function getBarY (d, i) {
4967
4972
  if (this.options.orientation === 'horizontal') {
4968
- if (this.options.grouping === 'stacked') {
4973
+ if (this.options.grouping !== 'grouped') {
4969
4974
  return this[xAxis](this.parseX(d.x.value))
4970
4975
  }
4971
4976
  else {
@@ -1059,6 +1059,8 @@ var WebsyDropdown = /*#__PURE__*/function () {
1059
1059
  value: function close() {
1060
1060
  var maskEl = document.getElementById("".concat(this.elementId, "_mask"));
1061
1061
  var contentEl = document.getElementById("".concat(this.elementId, "_content"));
1062
+ var scrollEl = document.getElementById("".concat(this.elementId, "_itemsContainer"));
1063
+ scrollEl.scrollTop = 0;
1062
1064
  maskEl.classList.remove('active');
1063
1065
  contentEl.classList.remove('active');
1064
1066
  contentEl.classList.remove('on-top');
@@ -1203,6 +1205,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
1203
1205
  searchEl.focus();
1204
1206
  }
1205
1207
  }
1208
+
1209
+ if (this.options.onOpen) {
1210
+ this.options.onOpen(this.elementId);
1211
+ }
1206
1212
  }
1207
1213
  }, {
1208
1214
  key: "render",
@@ -5539,7 +5545,7 @@ var WebsyChart = /*#__PURE__*/function () {
5539
5545
 
5540
5546
  var barWidth = this[xAxis].bandwidth();
5541
5547
 
5542
- if (this.options.data.series.length > 1 && this.options.grouping !== 'stacked') {
5548
+ if (this.options.data.series.length > 1 && this.options.grouping === 'grouped') {
5543
5549
  barWidth = barWidth / this.options.data.series.length - 4;
5544
5550
  }
5545
5551
 
@@ -5569,7 +5575,7 @@ var WebsyChart = /*#__PURE__*/function () {
5569
5575
  return 0;
5570
5576
  }
5571
5577
  } else {
5572
- if (this.options.grouping !== 'stacked') {
5578
+ if (this.options.grouping !== 'grouped') {
5573
5579
  return this[xAxis](this.parseX(d.x.value));
5574
5580
  } else {
5575
5581
  return this[xAxis](this.parseX(d.x.value)) + i * barWidth;
@@ -5579,7 +5585,7 @@ var WebsyChart = /*#__PURE__*/function () {
5579
5585
 
5580
5586
  function getBarY(d, i) {
5581
5587
  if (this.options.orientation === 'horizontal') {
5582
- if (this.options.grouping === 'stacked') {
5588
+ if (this.options.grouping !== 'grouped') {
5583
5589
  return this[xAxis](this.parseX(d.x.value));
5584
5590
  } else {
5585
5591
  return this[xAxis](this.parseX(d.x.value)) + (d.y.index || i) * barWidth;