@websy/websy-designs 1.5.0 → 1.5.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.
@@ -5892,7 +5892,7 @@ class WebsyTable3 {
5892
5892
  }
5893
5893
  // console.log('rowspan', cell.rowspan)
5894
5894
  bodyHtml += `<td
5895
- class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')}'
5895
+ class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')} ${(sizingColumns[sizeIndex].classes || []).join(' ')}'
5896
5896
  style='${style}'
5897
5897
  data-info='${cell.value}'
5898
5898
  colspan='${cell.colspan || 1}'
@@ -5989,7 +5989,7 @@ class WebsyTable3 {
5989
5989
  style += col.style
5990
5990
  }
5991
5991
  headerHtml += `<td
5992
- class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'}'
5992
+ class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(col.classes || []).join(' ')}'
5993
5993
  style='${style}'
5994
5994
  colspan='${col.colspan || 1}'
5995
5995
  rowspan='${col.rowspan || 1}'
@@ -6045,7 +6045,7 @@ class WebsyTable3 {
6045
6045
  let totalHtml = `<tr class="websy-table-row websy-table-total-row">`
6046
6046
  this.options.totals.forEach((col, colIndex) => {
6047
6047
  totalHtml += `<td
6048
- class='websy-table-cell'
6048
+ class='websy-table-cell ${(col.classes || []).join(' ')}'
6049
6049
  colspan='${col.colspan || 1}'
6050
6050
  rowspan='${col.rowspan || 1}'
6051
6051
  `
@@ -6070,6 +6070,10 @@ class WebsyTable3 {
6070
6070
  let outerEl = document.getElementById(this.elementId)
6071
6071
  let tableEl = document.getElementById(`${this.elementId}_tableContainer`)
6072
6072
  let headEl = document.getElementById(`${this.elementId}_tableHeader`)
6073
+ if (!headEl) {
6074
+ // something isn't right so exit the function
6075
+ return
6076
+ }
6073
6077
  headEl.style.width = 'auto'
6074
6078
  headEl.innerHTML = this.buildHeaderHtml()
6075
6079
  this.sizes.outer = outerEl.getBoundingClientRect()
@@ -6316,7 +6320,9 @@ class WebsyTable3 {
6316
6320
  el.classList.remove('has-error')
6317
6321
  }
6318
6322
  const tableEl = document.getElementById(`${this.elementId}_tableInner`)
6319
- tableEl.classList.remove('hidden')
6323
+ if (tableEl) {
6324
+ tableEl.classList.remove('hidden')
6325
+ }
6320
6326
  const containerEl = document.getElementById(`${this.elementId}_errorContainer`)
6321
6327
  if (containerEl) {
6322
6328
  containerEl.classList.remove('active')
@@ -6351,6 +6357,10 @@ class WebsyTable3 {
6351
6357
  this.appendRows(data)
6352
6358
  }
6353
6359
  let bodyEl = document.getElementById(`${this.elementId}_tableBody`)
6360
+ if (!bodyEl) {
6361
+ // something isn't right so exit the function
6362
+ return
6363
+ }
6354
6364
  // bodyEl.innerHTML = this.buildBodyHtml(data, true)
6355
6365
  // if (this.options.maxHeight) {
6356
6366
  // bodyEl.style.height = `${this.options.maxHeight - this.sizes.header.height - this.sizes.total.height}px`
@@ -7729,7 +7739,7 @@ areas.enter().append('path')
7729
7739
  .attr('d', d => drawArea(xAxis, yAxis, series.curveStyle)(d))
7730
7740
  .attr('class', `area_${series.key}`)
7731
7741
  .attr('id', `area_${series.key}`)
7732
- .attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data[`${xAxis}Axis`].bandWidth / 2) + ',0)')
7742
+ .attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2) + ',0)')
7733
7743
  // .style('stroke-width', series.lineWidth || this.options.lineWidth)
7734
7744
  .attr('fill', series.color)
7735
7745
  // .style('fill-opacity', 0)
@@ -6427,7 +6427,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6427
6427
  } // console.log('rowspan', cell.rowspan)
6428
6428
 
6429
6429
 
6430
- bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this37.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(sizeIndex, "'\n "); // if (useWidths === true) {
6430
+ bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this37.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(sizeIndex, "'\n "); // if (useWidths === true) {
6431
6431
  // bodyHtml += `
6432
6432
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
6433
6433
  // width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
@@ -6505,7 +6505,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6505
6505
  style += col.style;
6506
6506
  }
6507
6507
 
6508
- headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this38.pinnedColumns ? 'pinned' : 'unpinned', "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n "); // if (useWidths === true && rowIndex === this.options.columns.length - 1) {
6508
+ headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this38.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((col.classes || []).join(' '), "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n "); // if (useWidths === true && rowIndex === this.options.columns.length - 1) {
6509
6509
  // headerHtml += `
6510
6510
  // style='width: ${col.width || col.actualWidth}px'
6511
6511
  // width='${col.width || col.actualWidth}'
@@ -6556,7 +6556,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6556
6556
 
6557
6557
  var totalHtml = "<tr class=\"websy-table-row websy-table-total-row\">";
6558
6558
  this.options.totals.forEach(function (col, colIndex) {
6559
- totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6559
+ totalHtml += "<td \n class='websy-table-cell ".concat((col.classes || []).join(' '), "'\n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6560
6560
 
6561
6561
  if (useWidths === true) {
6562
6562
  totalHtml += "\n style='width: ".concat(_this39.options.columns[_this39.options.columns.length - 1][colIndex].width || _this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
@@ -6585,6 +6585,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
6585
6585
  var outerEl = document.getElementById(this.elementId);
6586
6586
  var tableEl = document.getElementById("".concat(this.elementId, "_tableContainer"));
6587
6587
  var headEl = document.getElementById("".concat(this.elementId, "_tableHeader"));
6588
+
6589
+ if (!headEl) {
6590
+ // something isn't right so exit the function
6591
+ return;
6592
+ }
6593
+
6588
6594
  headEl.style.width = 'auto';
6589
6595
  headEl.innerHTML = this.buildHeaderHtml();
6590
6596
  this.sizes.outer = outerEl.getBoundingClientRect();
@@ -6868,7 +6874,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6868
6874
  }
6869
6875
 
6870
6876
  var tableEl = document.getElementById("".concat(this.elementId, "_tableInner"));
6871
- tableEl.classList.remove('hidden');
6877
+
6878
+ if (tableEl) {
6879
+ tableEl.classList.remove('hidden');
6880
+ }
6881
+
6872
6882
  var containerEl = document.getElementById("".concat(this.elementId, "_errorContainer"));
6873
6883
 
6874
6884
  if (containerEl) {
@@ -6916,7 +6926,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
6916
6926
  this.appendRows(data);
6917
6927
  }
6918
6928
 
6919
- var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody")); // bodyEl.innerHTML = this.buildBodyHtml(data, true)
6929
+ var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody"));
6930
+
6931
+ if (!bodyEl) {
6932
+ // something isn't right so exit the function
6933
+ return;
6934
+ } // bodyEl.innerHTML = this.buildBodyHtml(data, true)
6920
6935
  // if (this.options.maxHeight) {
6921
6936
  // bodyEl.style.height = `${this.options.maxHeight - this.sizes.header.height - this.sizes.total.height}px`
6922
6937
  // }
@@ -6924,6 +6939,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6924
6939
  // bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
6925
6940
  // }
6926
6941
 
6942
+
6927
6943
  bodyEl.style.height = "".concat(this.sizes.bodyHeight, "px");
6928
6944
 
6929
6945
  if (this.options.virtualScroll === true) {
@@ -8354,7 +8370,7 @@ var WebsyChart = /*#__PURE__*/function () {
8354
8370
 
8355
8371
  areas.enter().append('path').attr('d', function (d) {
8356
8372
  return drawArea(xAxis, yAxis, series.curveStyle)(d);
8357
- }).attr('class', "area_".concat(series.key)).attr('id', "area_".concat(series.key)).attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data["".concat(xAxis, "Axis")].bandWidth / 2) + ',0)') // .style('stroke-width', series.lineWidth || this.options.lineWidth)
8373
+ }).attr('class', "area_".concat(series.key)).attr('id', "area_".concat(series.key)).attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2) + ',0)') // .style('stroke-width', series.lineWidth || this.options.lineWidth)
8358
8374
  .attr('fill', series.color) // .style('fill-opacity', 0)
8359
8375
  .attr('stroke', 'transparent') // .transition(this.transition)
8360
8376
  .style('fill-opacity', series.opacity || 0.5);