@websy/websy-designs 1.5.0 → 1.5.2

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.
@@ -6304,7 +6304,7 @@ class WebsyTable3 {
6304
6304
  }
6305
6305
  // console.log('rowspan', cell.rowspan)
6306
6306
  bodyHtml += `<td
6307
- class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')}'
6307
+ class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')} ${(sizingColumns[sizeIndex].classes || []).join(' ')}'
6308
6308
  style='${style}'
6309
6309
  data-info='${cell.value}'
6310
6310
  colspan='${cell.colspan || 1}'
@@ -6401,7 +6401,7 @@ class WebsyTable3 {
6401
6401
  style += col.style
6402
6402
  }
6403
6403
  headerHtml += `<td
6404
- class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'}'
6404
+ class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(col.classes || []).join(' ')}'
6405
6405
  style='${style}'
6406
6406
  colspan='${col.colspan || 1}'
6407
6407
  rowspan='${col.rowspan || 1}'
@@ -6457,7 +6457,7 @@ class WebsyTable3 {
6457
6457
  let totalHtml = `<tr class="websy-table-row websy-table-total-row">`
6458
6458
  this.options.totals.forEach((col, colIndex) => {
6459
6459
  totalHtml += `<td
6460
- class='websy-table-cell'
6460
+ class='websy-table-cell ${(col.classes || []).join(' ')}'
6461
6461
  colspan='${col.colspan || 1}'
6462
6462
  rowspan='${col.rowspan || 1}'
6463
6463
  `
@@ -6482,6 +6482,10 @@ class WebsyTable3 {
6482
6482
  let outerEl = document.getElementById(this.elementId)
6483
6483
  let tableEl = document.getElementById(`${this.elementId}_tableContainer`)
6484
6484
  let headEl = document.getElementById(`${this.elementId}_tableHeader`)
6485
+ if (!headEl) {
6486
+ // something isn't right so exit the function
6487
+ return
6488
+ }
6485
6489
  headEl.style.width = 'auto'
6486
6490
  headEl.innerHTML = this.buildHeaderHtml()
6487
6491
  this.sizes.outer = outerEl.getBoundingClientRect()
@@ -6728,7 +6732,9 @@ class WebsyTable3 {
6728
6732
  el.classList.remove('has-error')
6729
6733
  }
6730
6734
  const tableEl = document.getElementById(`${this.elementId}_tableInner`)
6731
- tableEl.classList.remove('hidden')
6735
+ if (tableEl) {
6736
+ tableEl.classList.remove('hidden')
6737
+ }
6732
6738
  const containerEl = document.getElementById(`${this.elementId}_errorContainer`)
6733
6739
  if (containerEl) {
6734
6740
  containerEl.classList.remove('active')
@@ -6763,6 +6769,10 @@ class WebsyTable3 {
6763
6769
  this.appendRows(data)
6764
6770
  }
6765
6771
  let bodyEl = document.getElementById(`${this.elementId}_tableBody`)
6772
+ if (!bodyEl) {
6773
+ // something isn't right so exit the function
6774
+ return
6775
+ }
6766
6776
  // bodyEl.innerHTML = this.buildBodyHtml(data, true)
6767
6777
  // if (this.options.maxHeight) {
6768
6778
  // bodyEl.style.height = `${this.options.maxHeight - this.sizes.header.height - this.sizes.total.height}px`
@@ -8141,7 +8151,7 @@ areas.enter().append('path')
8141
8151
  .attr('d', d => drawArea(xAxis, yAxis, series.curveStyle)(d))
8142
8152
  .attr('class', `area_${series.key}`)
8143
8153
  .attr('id', `area_${series.key}`)
8144
- .attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data[`${xAxis}Axis`].bandWidth / 2) + ',0)')
8154
+ .attr('transform', 'translate(' + (this.options.data[xAxis].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2) + ',0)')
8145
8155
  // .style('stroke-width', series.lineWidth || this.options.lineWidth)
8146
8156
  .attr('fill', series.color)
8147
8157
  // .style('fill-opacity', 0)
@@ -6903,7 +6903,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6903
6903
  } // console.log('rowspan', cell.rowspan)
6904
6904
 
6905
6905
 
6906
- bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this40.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) {
6906
+ bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this40.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) {
6907
6907
  // bodyHtml += `
6908
6908
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
6909
6909
  // width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
@@ -6981,7 +6981,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6981
6981
  style += col.style;
6982
6982
  }
6983
6983
 
6984
- headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this41.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) {
6984
+ headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this41.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) {
6985
6985
  // headerHtml += `
6986
6986
  // style='width: ${col.width || col.actualWidth}px'
6987
6987
  // width='${col.width || col.actualWidth}'
@@ -7032,7 +7032,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7032
7032
 
7033
7033
  var totalHtml = "<tr class=\"websy-table-row websy-table-total-row\">";
7034
7034
  this.options.totals.forEach(function (col, colIndex) {
7035
- totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
7035
+ totalHtml += "<td \n class='websy-table-cell ".concat((col.classes || []).join(' '), "'\n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
7036
7036
 
7037
7037
  if (useWidths === true) {
7038
7038
  totalHtml += "\n style='width: ".concat(_this42.options.columns[_this42.options.columns.length - 1][colIndex].width || _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
@@ -7061,6 +7061,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
7061
7061
  var outerEl = document.getElementById(this.elementId);
7062
7062
  var tableEl = document.getElementById("".concat(this.elementId, "_tableContainer"));
7063
7063
  var headEl = document.getElementById("".concat(this.elementId, "_tableHeader"));
7064
+
7065
+ if (!headEl) {
7066
+ // something isn't right so exit the function
7067
+ return;
7068
+ }
7069
+
7064
7070
  headEl.style.width = 'auto';
7065
7071
  headEl.innerHTML = this.buildHeaderHtml();
7066
7072
  this.sizes.outer = outerEl.getBoundingClientRect();
@@ -7344,7 +7350,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
7344
7350
  }
7345
7351
 
7346
7352
  var tableEl = document.getElementById("".concat(this.elementId, "_tableInner"));
7347
- tableEl.classList.remove('hidden');
7353
+
7354
+ if (tableEl) {
7355
+ tableEl.classList.remove('hidden');
7356
+ }
7357
+
7348
7358
  var containerEl = document.getElementById("".concat(this.elementId, "_errorContainer"));
7349
7359
 
7350
7360
  if (containerEl) {
@@ -7392,7 +7402,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
7392
7402
  this.appendRows(data);
7393
7403
  }
7394
7404
 
7395
- var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody")); // bodyEl.innerHTML = this.buildBodyHtml(data, true)
7405
+ var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody"));
7406
+
7407
+ if (!bodyEl) {
7408
+ // something isn't right so exit the function
7409
+ return;
7410
+ } // bodyEl.innerHTML = this.buildBodyHtml(data, true)
7396
7411
  // if (this.options.maxHeight) {
7397
7412
  // bodyEl.style.height = `${this.options.maxHeight - this.sizes.header.height - this.sizes.total.height}px`
7398
7413
  // }
@@ -7400,6 +7415,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7400
7415
  // bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
7401
7416
  // }
7402
7417
 
7418
+
7403
7419
  bodyEl.style.height = "".concat(this.sizes.bodyHeight, "px");
7404
7420
 
7405
7421
  if (this.options.virtualScroll === true) {
@@ -8830,7 +8846,7 @@ var WebsyChart = /*#__PURE__*/function () {
8830
8846
 
8831
8847
  areas.enter().append('path').attr('d', function (d) {
8832
8848
  return drawArea(xAxis, yAxis, series.curveStyle)(d);
8833
- }).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)
8849
+ }).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)
8834
8850
  .attr('fill', series.color) // .style('fill-opacity', 0)
8835
8851
  .attr('stroke', 'transparent') // .transition(this.transition)
8836
8852
  .style('fill-opacity', series.opacity || 0.5);