@websy/websy-designs 1.4.3 → 1.4.5

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.
@@ -162,7 +162,9 @@ class ButtonGroup {
162
162
  const DEFAULTS = {
163
163
  style: 'button',
164
164
  subscribers: {},
165
- activeItem: 0
165
+ activeItem: -1,
166
+ tag: 'div',
167
+ allowNone: false
166
168
  }
167
169
  this.options = Object.assign({}, DEFAULTS, options)
168
170
  const el = document.getElementById(this.elementId)
@@ -175,7 +177,7 @@ class ButtonGroup {
175
177
  if (event.target.classList.contains('websy-button-group-item')) {
176
178
  const index = +event.target.getAttribute('data-index')
177
179
  if (this.options.activeItem !== index) {
178
- if (this.options.onDeactivate) {
180
+ if (this.options.onDeactivate && this.options.activeItem !== -1) {
179
181
  this.options.onDeactivate(this.options.items[this.options.activeItem], this.options.activeItem)
180
182
  }
181
183
  this.options.activeItem = index
@@ -191,7 +193,14 @@ class ButtonGroup {
191
193
  })
192
194
  event.target.classList.remove('inactive')
193
195
  event.target.classList.add('active')
194
- }
196
+ }
197
+ else if (this.options.activeItem === index && this.options.allowNone === true) {
198
+ if (this.options.onDeactivate) {
199
+ this.options.onDeactivate(this.options.items[this.options.activeItem], this.options.activeItem)
200
+ }
201
+ this.options.activeItem = -1
202
+ event.target.classList.remove('active')
203
+ }
195
204
  }
196
205
  }
197
206
  on (event, fn) {
@@ -214,7 +223,7 @@ class ButtonGroup {
214
223
  activeClass = i === this.options.activeItem ? 'active' : 'inactive'
215
224
  }
216
225
  return `
217
- <div ${(t.attributes || []).join(' ')} data-id="${t.id || t.label}" data-index="${i}" class="websy-button-group-item ${(t.classes || []).join(' ')} ${this.options.style}-style ${activeClass}">${t.label}</div>
226
+ <${this.options.tag} ${(t.attributes || []).join(' ')} data-id="${t.id || t.label}" data-index="${i}" class="websy-button-group-item ${(t.classes || []).join(' ')} ${this.options.style}-style ${activeClass}">${t.label}</${this.options.tag}>
218
227
  `
219
228
  }).join('')
220
229
  }
@@ -1526,7 +1535,9 @@ class WebsyDropdown {
1526
1535
  if (el) {
1527
1536
  el.style.zIndex = ''
1528
1537
  }
1529
- scrollEl.scrollTop = 0
1538
+ if (scrollEl) {
1539
+ scrollEl.scrollTo(0, 0)
1540
+ }
1530
1541
  maskEl.classList.remove('active')
1531
1542
  contentEl.classList.remove('active')
1532
1543
  contentEl.classList.remove('on-top')
@@ -3945,6 +3956,26 @@ class WebsyRouter {
3945
3956
  this.navigate(`${inputPath}?${path}`, 'main', null, noHistory)
3946
3957
  }
3947
3958
  }
3959
+ removeAllUrlParams (reloadView = false, noHistory = true) {
3960
+ // const output = {
3961
+ // path: '',
3962
+ // items: {}
3963
+ // }
3964
+ // this.currentParams = output
3965
+ let inputPath = this.currentView
3966
+ if (this.options.urlPrefix) {
3967
+ inputPath = `/${this.options.urlPrefix}/${inputPath}`
3968
+ }
3969
+ if (reloadView === true) {
3970
+ this.navigate(`${inputPath}`, 'main', null, noHistory)
3971
+ }
3972
+ else {
3973
+ this.currentParams = {
3974
+ path: '',
3975
+ items: {}
3976
+ }
3977
+ }
3978
+ }
3948
3979
  buildUrlPath (params) {
3949
3980
  let path = []
3950
3981
  for (let key in params) {
@@ -3965,6 +3996,9 @@ class WebsyRouter {
3965
3996
  if (!this.groups[g]) {
3966
3997
  this.addGroup(g)
3967
3998
  }
3999
+ if (els[i].classList.contains(this.options.activeClass)) {
4000
+ this.groups[g].activeView = v
4001
+ }
3968
4002
  if (this.groups[g].views.indexOf(v) === -1) {
3969
4003
  this.groups[g].views.push(v)
3970
4004
  }
@@ -4008,9 +4042,9 @@ class WebsyRouter {
4008
4042
  if (this.groups[g].activeView) {
4009
4043
  views.push({view: this.groups[g].activeView, group: g})
4010
4044
  }
4011
- else {
4012
- views.push({view: this.groups[g].views[0], group: g})
4013
- }
4045
+ // else {
4046
+ // views.push({view: this.groups[g].views[0], group: g})
4047
+ // }
4014
4048
  }
4015
4049
  }
4016
4050
  return views
@@ -4183,12 +4217,12 @@ class WebsyRouter {
4183
4217
  <article id='${elementId}_content' class='websy-content-article'></article>
4184
4218
  <div id='${elementId}_loading' class='websy-loading-container'><div class='websy-ripple'><div></div><div></div></div></div>
4185
4219
  `
4186
- if (options.help && options.help !== '') {
4220
+ if (options && options.help && options.help !== '') {
4187
4221
  html += `
4188
4222
  <Help not yet supported>
4189
4223
  `
4190
4224
  }
4191
- if (options.tooltip && options.tooltip.value && options.tooltip.value !== '') {
4225
+ if (options && options.tooltip && options.tooltip.value && options.tooltip.value !== '') {
4192
4226
  html += `
4193
4227
  <div class="websy-info ${this.options.tooltip.classes.join(' ') || ''}" data-info="${this.options.tooltip.value}">
4194
4228
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512"><title>ionicons-v5-e</title><path d="M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z"/></svg>
@@ -4294,7 +4328,7 @@ class WebsyRouter {
4294
4328
  this.addGroup(group)
4295
4329
  }
4296
4330
  if (toggle === true && this.groups[group].activeView !== '') {
4297
- newPath = ''
4331
+ newPath = inputPath === this.groups[group].activeView ? '' : inputPath
4298
4332
  }
4299
4333
  this.previousView = this.currentView
4300
4334
  this.previousPath = this.currentPath
@@ -4449,6 +4483,7 @@ class WebsySearch {
4449
4483
  const DEFAULTS = {
4450
4484
  searchIcon: `<svg class='search' width="20" height="20" viewBox="0 0 512 512"><path d="M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`,
4451
4485
  clearIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512"><title>ionicons-v5-l</title><line x1="368" y1="368" x2="144" y2="144" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="368" y1="144" x2="144" y2="368" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`,
4486
+ clearAlwaysOn: false,
4452
4487
  placeholder: 'Search',
4453
4488
  searchTimeout: 500,
4454
4489
  minLength: 2
@@ -4465,7 +4500,7 @@ class WebsySearch {
4465
4500
  <div class='websy-search-input-container'>
4466
4501
  ${this.options.searchIcon}
4467
4502
  <input id='${this.elementId}_search' class='websy-search-input' placeholder='${this.options.placeholder || 'Search'}'>
4468
- <div class='clear websy-hidden' id='${this.elementId}_clear'>
4503
+ <div class='clear ${this.options.clearAlwaysOn === true ? '' : 'websy-hidden'}' id='${this.elementId}_clear'>
4469
4504
  ${this.options.clearIcon}
4470
4505
  </div>
4471
4506
  </div>
@@ -4501,12 +4536,14 @@ class WebsySearch {
4501
4536
  clearTimeout(this.searchTimeoutFn)
4502
4537
  }
4503
4538
  const clearEl = document.getElementById(`${this.elementId}_clear`)
4504
- if (event.target.value.length > 0) {
4505
- clearEl.classList.remove('websy-hidden')
4506
- }
4507
- else {
4508
- clearEl.classList.add('websy-hidden')
4509
- }
4539
+ if (this.options.clearAlwaysOn === false) {
4540
+ if (event.target.value.length > 0) {
4541
+ clearEl.classList.remove('websy-hidden')
4542
+ }
4543
+ else {
4544
+ clearEl.classList.add('websy-hidden')
4545
+ }
4546
+ }
4510
4547
  if (event.target.value.length >= this.options.minLength) {
4511
4548
  this.searchTimeoutFn = setTimeout(() => {
4512
4549
  if (this.options.onSearch) {
@@ -4516,8 +4553,8 @@ class WebsySearch {
4516
4553
  }
4517
4554
  else {
4518
4555
  if (this.options.onSearch && (event.key === 'Delete' || event.key === 'Backspace')) {
4519
- if (this.options.onClear) {
4520
- this.options.onClear()
4556
+ if (this.options.onSearch) {
4557
+ this.options.onSearch('')
4521
4558
  }
4522
4559
  }
4523
4560
  }
@@ -6075,12 +6112,16 @@ class WebsyTable3 {
6075
6112
  if (typeof sizingColumns[sizeIndex] === 'undefined') {
6076
6113
  return // need to revisit this logic
6077
6114
  }
6078
- let style = `width: ${sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth}px!important; `
6079
- let divStyle = style
6115
+ let style = ''
6116
+ let divStyle = ''
6117
+ if (useWidths === true && (+cell.colspan === 1 || !cell.colspan)) {
6118
+ style = `width: ${sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth}px!important; `
6119
+ divStyle = style
6120
+ }
6080
6121
  if (cell.style) {
6081
6122
  style += cell.style
6082
6123
  }
6083
- if (useWidths === true) {
6124
+ if (useWidths === true && (+cell.colspan === 1 || !cell.colspan)) {
6084
6125
  style += `max-width: ${sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth}px!important;`
6085
6126
  divStyle += `max-width: ${sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth}px!important;`
6086
6127
  }
@@ -6125,6 +6166,25 @@ class WebsyTable3 {
6125
6166
  class='websy-table-cell-collapse'
6126
6167
  >${WebsyDesigns.Icons.MinusFilled}</i>`
6127
6168
  }
6169
+ if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
6170
+ cell.value = `
6171
+ <a href='${cell.value}' target='${sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self'}'>${cell.displayText || sizingColumns[sizeIndex].linkText || cell.value}</a>
6172
+ `
6173
+ }
6174
+ if (sizingColumns[sizeIndex].showAsRouterLink === true && cell.value.trim() !== '') {
6175
+ cell.value = `
6176
+ <a data-view='${(cell.link || cell.value).replace(/'/g, '\'')}' class='websy-trigger'>${cell.value}</a>
6177
+ `
6178
+ }
6179
+ if (sizingColumns[sizeIndex].showAsImage === true) {
6180
+ cell.value = `
6181
+ <img
6182
+ style="width: ${sizingColumns[sizeIndex].imgWidth ? sizingColumns[sizeIndex].imgWidth : 'auto'}; height: ${sizingColumns[sizeIndex].imgHeight ? sizingColumns[sizeIndex].imgHeight : 'auto'};"
6183
+ src='${cell.value}'
6184
+ ${sizingColumns[sizeIndex].errorImage ? 'onerror="this.src=\'' + sizingColumns[sizeIndex].errorImage + '\'"' : ''}
6185
+ />
6186
+ `
6187
+ }
6128
6188
  bodyHtml += `
6129
6189
  ${cell.value}
6130
6190
  </div></td>`
@@ -6433,14 +6493,16 @@ class WebsyTable3 {
6433
6493
  this.mouseXStart = null
6434
6494
  }
6435
6495
  handleScrollWheel (event) {
6436
- event.preventDefault()
6437
- // console.log('scrollwheel', event)
6438
- if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
6439
- this.scrollX(Math.max(-5, Math.min(5, event.deltaX)))
6440
- }
6441
- else {
6442
- this.scrollY(Math.max(-5, Math.min(5, event.deltaY)))
6443
- }
6496
+ if (this.options.virtualScroll === true) {
6497
+ event.preventDefault()
6498
+ // console.log('scrollwheel', event)
6499
+ if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
6500
+ this.scrollX(Math.max(-5, Math.min(5, event.deltaX)))
6501
+ }
6502
+ else {
6503
+ this.scrollY(Math.max(-5, Math.min(5, event.deltaY)))
6504
+ }
6505
+ }
6444
6506
  }
6445
6507
  hideError () {
6446
6508
  const el = document.getElementById(`${this.elementId}_tableContainer`)
@@ -232,7 +232,9 @@ var ButtonGroup = /*#__PURE__*/function () {
232
232
  var DEFAULTS = {
233
233
  style: 'button',
234
234
  subscribers: {},
235
- activeItem: 0
235
+ activeItem: -1,
236
+ tag: 'div',
237
+ allowNone: false
236
238
  };
237
239
  this.options = _extends({}, DEFAULTS, options);
238
240
  var el = document.getElementById(this.elementId);
@@ -250,7 +252,7 @@ var ButtonGroup = /*#__PURE__*/function () {
250
252
  var index = +event.target.getAttribute('data-index');
251
253
 
252
254
  if (this.options.activeItem !== index) {
253
- if (this.options.onDeactivate) {
255
+ if (this.options.onDeactivate && this.options.activeItem !== -1) {
254
256
  this.options.onDeactivate(this.options.items[this.options.activeItem], this.options.activeItem);
255
257
  }
256
258
 
@@ -269,6 +271,13 @@ var ButtonGroup = /*#__PURE__*/function () {
269
271
  });
270
272
  event.target.classList.remove('inactive');
271
273
  event.target.classList.add('active');
274
+ } else if (this.options.activeItem === index && this.options.allowNone === true) {
275
+ if (this.options.onDeactivate) {
276
+ this.options.onDeactivate(this.options.items[this.options.activeItem], this.options.activeItem);
277
+ }
278
+
279
+ this.options.activeItem = -1;
280
+ event.target.classList.remove('active');
272
281
  }
273
282
  }
274
283
  }
@@ -303,7 +312,7 @@ var ButtonGroup = /*#__PURE__*/function () {
303
312
  activeClass = i === _this.options.activeItem ? 'active' : 'inactive';
304
313
  }
305
314
 
306
- return "\n <div ".concat((t.attributes || []).join(' '), " data-id=\"").concat(t.id || t.label, "\" data-index=\"").concat(i, "\" class=\"websy-button-group-item ").concat((t.classes || []).join(' '), " ").concat(_this.options.style, "-style ").concat(activeClass, "\">").concat(t.label, "</div>\n ");
315
+ return "\n <".concat(_this.options.tag, " ").concat((t.attributes || []).join(' '), " data-id=\"").concat(t.id || t.label, "\" data-index=\"").concat(i, "\" class=\"websy-button-group-item ").concat((t.classes || []).join(' '), " ").concat(_this.options.style, "-style ").concat(activeClass, "\">").concat(t.label, "</").concat(_this.options.tag, ">\n ");
307
316
  }).join('');
308
317
  }
309
318
  }
@@ -1653,7 +1662,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
1653
1662
  el.style.zIndex = '';
1654
1663
  }
1655
1664
 
1656
- scrollEl.scrollTop = 0;
1665
+ if (scrollEl) {
1666
+ scrollEl.scrollTo(0, 0);
1667
+ }
1668
+
1657
1669
  maskEl.classList.remove('active');
1658
1670
  contentEl.classList.remove('active');
1659
1671
  contentEl.classList.remove('on-top');
@@ -4284,6 +4296,31 @@ var WebsyRouter = /*#__PURE__*/function () {
4284
4296
  this.navigate("".concat(inputPath, "?").concat(path), 'main', null, noHistory);
4285
4297
  }
4286
4298
  }
4299
+ }, {
4300
+ key: "removeAllUrlParams",
4301
+ value: function removeAllUrlParams() {
4302
+ var reloadView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
4303
+ var noHistory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
4304
+ // const output = {
4305
+ // path: '',
4306
+ // items: {}
4307
+ // }
4308
+ // this.currentParams = output
4309
+ var inputPath = this.currentView;
4310
+
4311
+ if (this.options.urlPrefix) {
4312
+ inputPath = "/".concat(this.options.urlPrefix, "/").concat(inputPath);
4313
+ }
4314
+
4315
+ if (reloadView === true) {
4316
+ this.navigate("".concat(inputPath), 'main', null, noHistory);
4317
+ } else {
4318
+ this.currentParams = {
4319
+ path: '',
4320
+ items: {}
4321
+ };
4322
+ }
4323
+ }
4287
4324
  }, {
4288
4325
  key: "buildUrlPath",
4289
4326
  value: function buildUrlPath(params) {
@@ -4315,6 +4352,10 @@ var WebsyRouter = /*#__PURE__*/function () {
4315
4352
  this.addGroup(g);
4316
4353
  }
4317
4354
 
4355
+ if (els[i].classList.contains(this.options.activeClass)) {
4356
+ this.groups[g].activeView = v;
4357
+ }
4358
+
4318
4359
  if (this.groups[g].views.indexOf(v) === -1) {
4319
4360
  this.groups[g].views.push(v);
4320
4361
  }
@@ -4374,12 +4415,10 @@ var WebsyRouter = /*#__PURE__*/function () {
4374
4415
  view: this.groups[g].activeView,
4375
4416
  group: g
4376
4417
  });
4377
- } else {
4378
- views.push({
4379
- view: this.groups[g].views[0],
4380
- group: g
4381
- });
4382
- }
4418
+ } // else {
4419
+ // views.push({view: this.groups[g].views[0], group: g})
4420
+ // }
4421
+
4383
4422
  }
4384
4423
  }
4385
4424
 
@@ -4588,11 +4627,11 @@ var WebsyRouter = /*#__PURE__*/function () {
4588
4627
 
4589
4628
  var html = "\n <article id='".concat(elementId, "_content' class='websy-content-article'></article>\n <div id='").concat(elementId, "_loading' class='websy-loading-container'><div class='websy-ripple'><div></div><div></div></div></div>\n ");
4590
4629
 
4591
- if (options.help && options.help !== '') {
4630
+ if (options && options.help && options.help !== '') {
4592
4631
  html += "\n <Help not yet supported>\n ";
4593
4632
  }
4594
4633
 
4595
- if (options.tooltip && options.tooltip.value && options.tooltip.value !== '') {
4634
+ if (options && options.tooltip && options.tooltip.value && options.tooltip.value !== '') {
4596
4635
  html += "\n <div class=\"websy-info ".concat(this.options.tooltip.classes.join(' ') || '', "\" data-info=\"").concat(this.options.tooltip.value, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-e</title><path d=\"M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z\"/></svg>\n </div> \n ");
4597
4636
  }
4598
4637
 
@@ -4719,7 +4758,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4719
4758
  }
4720
4759
 
4721
4760
  if (toggle === true && this.groups[group].activeView !== '') {
4722
- newPath = '';
4761
+ newPath = inputPath === this.groups[group].activeView ? '' : inputPath;
4723
4762
  }
4724
4763
 
4725
4764
  this.previousView = this.currentView;
@@ -4918,6 +4957,7 @@ var WebsySearch = /*#__PURE__*/function () {
4918
4957
  var DEFAULTS = {
4919
4958
  searchIcon: "<svg class='search' width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
4920
4959
  clearIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 512 512\"><title>ionicons-v5-l</title><line x1=\"368\" y1=\"368\" x2=\"144\" y2=\"144\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/><line x1=\"368\" y1=\"144\" x2=\"144\" y2=\"368\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/></svg>",
4960
+ clearAlwaysOn: false,
4921
4961
  placeholder: 'Search',
4922
4962
  searchTimeout: 500,
4923
4963
  minLength: 2
@@ -4931,7 +4971,7 @@ var WebsySearch = /*#__PURE__*/function () {
4931
4971
  el.addEventListener('click', this.handleClick.bind(this));
4932
4972
  el.addEventListener('keyup', this.handleKeyUp.bind(this));
4933
4973
  el.addEventListener('keyup', this.handleKeyDown.bind(this));
4934
- el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "'>\n <div class='clear websy-hidden' id='").concat(this.elementId, "_clear'>\n ").concat(this.options.clearIcon, "\n </div>\n </div>\n ");
4974
+ el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "'>\n <div class='clear ").concat(this.options.clearAlwaysOn === true ? '' : 'websy-hidden', "' id='").concat(this.elementId, "_clear'>\n ").concat(this.options.clearIcon, "\n </div>\n </div>\n ");
4935
4975
  } else {
4936
4976
  console.log('No element found with Id', elementId);
4937
4977
  }
@@ -4973,10 +5013,12 @@ var WebsySearch = /*#__PURE__*/function () {
4973
5013
 
4974
5014
  var clearEl = document.getElementById("".concat(this.elementId, "_clear"));
4975
5015
 
4976
- if (event.target.value.length > 0) {
4977
- clearEl.classList.remove('websy-hidden');
4978
- } else {
4979
- clearEl.classList.add('websy-hidden');
5016
+ if (this.options.clearAlwaysOn === false) {
5017
+ if (event.target.value.length > 0) {
5018
+ clearEl.classList.remove('websy-hidden');
5019
+ } else {
5020
+ clearEl.classList.add('websy-hidden');
5021
+ }
4980
5022
  }
4981
5023
 
4982
5024
  if (event.target.value.length >= this.options.minLength) {
@@ -4987,8 +5029,8 @@ var WebsySearch = /*#__PURE__*/function () {
4987
5029
  }, this.options.searchTimeout);
4988
5030
  } else {
4989
5031
  if (this.options.onSearch && (event.key === 'Delete' || event.key === 'Backspace')) {
4990
- if (this.options.onClear) {
4991
- this.options.onClear();
5032
+ if (this.options.onSearch) {
5033
+ this.options.onSearch('');
4992
5034
  }
4993
5035
  }
4994
5036
  }
@@ -6633,14 +6675,19 @@ var WebsyTable3 = /*#__PURE__*/function () {
6633
6675
  return; // need to revisit this logic
6634
6676
  }
6635
6677
 
6636
- var style = "width: ".concat(sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth, "px!important; ");
6637
- var divStyle = style;
6678
+ var style = '';
6679
+ var divStyle = '';
6680
+
6681
+ if (useWidths === true && (+cell.colspan === 1 || !cell.colspan)) {
6682
+ style = "width: ".concat(sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth, "px!important; ");
6683
+ divStyle = style;
6684
+ }
6638
6685
 
6639
6686
  if (cell.style) {
6640
6687
  style += cell.style;
6641
6688
  }
6642
6689
 
6643
- if (useWidths === true) {
6690
+ if (useWidths === true && (+cell.colspan === 1 || !cell.colspan)) {
6644
6691
  style += "max-width: ".concat(sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth, "px!important;");
6645
6692
  divStyle += "max-width: ".concat(sizingColumns[sizeIndex].width || sizingColumns[sizeIndex].actualWidth, "px!important;");
6646
6693
  }
@@ -6675,6 +6722,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
6675
6722
  bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(WebsyDesigns.Icons.MinusFilled, "</i>");
6676
6723
  }
6677
6724
 
6725
+ if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
6726
+ cell.value = "\n <a href='".concat(cell.value, "' target='").concat(sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self', "'>").concat(cell.displayText || sizingColumns[sizeIndex].linkText || cell.value, "</a>\n ");
6727
+ }
6728
+
6729
+ if (sizingColumns[sizeIndex].showAsRouterLink === true && cell.value.trim() !== '') {
6730
+ cell.value = "\n <a data-view='".concat((cell.link || cell.value).replace(/'/g, '\''), "' class='websy-trigger'>").concat(cell.value, "</a>\n ");
6731
+ }
6732
+
6733
+ if (sizingColumns[sizeIndex].showAsImage === true) {
6734
+ cell.value = "\n <img \n style=\"width: ".concat(sizingColumns[sizeIndex].imgWidth ? sizingColumns[sizeIndex].imgWidth : 'auto', "; height: ").concat(sizingColumns[sizeIndex].imgHeight ? sizingColumns[sizeIndex].imgHeight : 'auto', ";\" \n src='").concat(cell.value, "'\n ").concat(sizingColumns[sizeIndex].errorImage ? 'onerror="this.src=\'' + sizingColumns[sizeIndex].errorImage + '\'"' : '', "\n />\n ");
6735
+ }
6736
+
6678
6737
  bodyHtml += "\n ".concat(cell.value, "\n </div></td>");
6679
6738
  });
6680
6739
  bodyHtml += "</tr>";
@@ -7032,12 +7091,14 @@ var WebsyTable3 = /*#__PURE__*/function () {
7032
7091
  }, {
7033
7092
  key: "handleScrollWheel",
7034
7093
  value: function handleScrollWheel(event) {
7035
- event.preventDefault(); // console.log('scrollwheel', event)
7094
+ if (this.options.virtualScroll === true) {
7095
+ event.preventDefault(); // console.log('scrollwheel', event)
7036
7096
 
7037
- if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
7038
- this.scrollX(Math.max(-5, Math.min(5, event.deltaX)));
7039
- } else {
7040
- this.scrollY(Math.max(-5, Math.min(5, event.deltaY)));
7097
+ if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
7098
+ this.scrollX(Math.max(-5, Math.min(5, event.deltaX)));
7099
+ } else {
7100
+ this.scrollY(Math.max(-5, Math.min(5, event.deltaY)));
7101
+ }
7041
7102
  }
7042
7103
  }
7043
7104
  }, {