@websy/websy-designs 1.11.7 → 1.11.8

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.
@@ -1554,13 +1554,14 @@ class WebsyDropdown {
1554
1554
  items: [],
1555
1555
  label: '',
1556
1556
  disabled: false,
1557
+ classes: [],
1557
1558
  minSearchCharacters: 2,
1558
1559
  showCompleteSelectedList: false,
1559
1560
  closeAfterSelection: true,
1560
1561
  customActions: [],
1561
1562
  customButtons: [],
1562
1563
  minWidth: 220,
1563
- searchIcon: `<svg 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>`,
1564
+ searchIcon: `<svg 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-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`,
1564
1565
  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>`,
1565
1566
  arrowIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z"/></svg>`,
1566
1567
  actionsIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 512 512">><circle cx="256" cy="256" r="32" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><circle cx="416" cy="256" r="32" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><circle cx="96" cy="256" r="32" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/></svg>`
@@ -1590,7 +1591,7 @@ class WebsyDropdown {
1590
1591
  const headerLabel = this.selectedItems.map(s => this.options.items[s].label || this.options.items[s].value).join(this.options.multiValueDelimiter)
1591
1592
  const headerValue = this.selectedItems.map(s => this.options.items[s].value || this.options.items[s].label).join(this.options.multiValueDelimiter)
1592
1593
  let html = `
1593
- <div id='${this.elementId}_container' class='websy-dropdown-container ${this.options.disabled ? 'disabled' : ''} ${this.options.disableSearch !== true ? 'with-search' : ''} ${this.options.style} ${this.options.customActions.length > 0 ? 'with-actions' : ''}'>
1594
+ <div id='${this.elementId}_container' class='websy-dropdown-container ${this.options.classes.join(' ')} ${this.options.disabled ? 'disabled' : ''} ${this.options.disableSearch !== true ? 'with-search' : ''} ${this.options.style} ${this.options.customActions.length > 0 ? 'with-actions' : ''}'>
1594
1595
  <div id='${this.elementId}_header' class='websy-dropdown-header ${this.selectedItems.length === 1 ? 'one-selected' : ''} ${this.options.allowClear === true ? 'allow-clear' : ''}'>
1595
1596
  `
1596
1597
  if (this.options.disableSearch !== true) {
@@ -2493,6 +2494,25 @@ class WebsyForm {
2493
2494
  this.options.fields.forEach((f, i) => {
2494
2495
  this.fieldMap[f.field] = f
2495
2496
  f.owningElement = this.elementId
2497
+ if (f.disabled || f.readOnly || this.options.readOnly) {
2498
+ if (!f.options) {
2499
+ f.options = {}
2500
+ }
2501
+ f.disabled = true
2502
+ f.options.disabled = true
2503
+ if (!f.classes) {
2504
+ f.classes = []
2505
+ }
2506
+ if (!f.options.classes) {
2507
+ f.options.classes = []
2508
+ }
2509
+ f.classes.push('disabled')
2510
+ f.options.classes.push('disabled')
2511
+ if (f.readOnly || this.options.readOnly) {
2512
+ f.classes.push('websy-input-readonly')
2513
+ f.options.classes.push('websy-input-readonly')
2514
+ }
2515
+ }
2496
2516
  if (f.component) {
2497
2517
  componentsToProcess.push(f)
2498
2518
  html += `
@@ -2532,12 +2552,13 @@ class WebsyForm {
2532
2552
  type="${(f.type === 'expiry' ? 'text' : f.type === 'cvv' ? 'number' : f.type) || 'text'}"
2533
2553
  data-user-type="${f.type}"
2534
2554
  data-index="${i}"
2535
- class="websy-input"
2555
+ class="websy-input ${f.readOnly || this.options.readOnly ? 'websy-input-readonly' : ''}"
2536
2556
  ${(f.attributes || []).join(' ')}
2537
2557
  name="${f.field}"
2538
2558
  placeholder="${f.placeholder || ''}"
2539
2559
  value="${f.type === 'date' ? '' : f.value || ''}"
2540
2560
  valueAsDate="${f.type === 'date' ? f.value : ''}"
2561
+ ${f.disabled || f.readOnly || this.options.readOnly ? 'disabled' : ''}
2541
2562
  oninvalidx="this.setCustomValidity('${f.invalidMessage || 'Please fill in this field.'}')"
2542
2563
  />
2543
2564
  <span id='${this.elementId}_${f.field}_error' class='websy-form-validation-error'></span>
@@ -2551,9 +2572,14 @@ class WebsyForm {
2551
2572
  <div id='${this.elementId}_recaptchaError' class='websy-alert websy-alert-error websy-hidden'>Invalid recaptcha response</div><!--
2552
2573
  `
2553
2574
  }
2554
- html += `
2555
- --><button class="websy-btn submit ${this.options.submit.classes ? this.options.submit.classes.join(' ') : ''}">${this.options.submit.text || 'Save'}</button>${this.options.cancel ? '<!--' : ''}
2556
- `
2575
+ if (!this.options.readOnly) {
2576
+ html += `
2577
+ --><button class="websy-btn submit ${this.options.submit.classes ? this.options.submit.classes.join(' ') : ''}">${this.options.submit.text || 'Save'}</button>${this.options.cancel ? '<!--' : ''}
2578
+ `
2579
+ }
2580
+ else {
2581
+ html += `-->`
2582
+ }
2557
2583
  if (this.options.cancel) {
2558
2584
  html += `
2559
2585
  --><button class="websy-btn cancel ${this.options.cancel.classes ? this.options.cancel.classes.join(' ') : ''}">${this.options.cancel.text || 'Cancel'}</button>
@@ -2736,7 +2762,8 @@ class MultiForm {
2736
2762
  allowAdd: true,
2737
2763
  allowDelete: true,
2738
2764
  addLabel: '',
2739
- deleteLabel: ''
2765
+ deleteLabel: '',
2766
+ emptyMessage: 'No items to display'
2740
2767
  }
2741
2768
  this.options = Object.assign({}, DEFAULTS, options)
2742
2769
  this.formData = []
@@ -2746,7 +2773,7 @@ class MultiForm {
2746
2773
  if (el) {
2747
2774
  el.addEventListener('click', this.handleClick.bind(this))
2748
2775
  el.innerHTML = `
2749
- <div id='${elementId}_container' class='websy-multi-form-container'></div>
2776
+ <div id='${elementId}_container' class='websy-multi-form-container' data-empty='${this.options.emptyMessage}'></div>
2750
2777
  <button id='${this.elementId}_addButton' class='websy-multi-form-add'>
2751
2778
  ${this.options.addIcon}${this.options.addLabel}
2752
2779
  </button>
@@ -2848,7 +2875,7 @@ class MultiForm {
2848
2875
  <div id='${this.elementId}_${d.formId}_form' class='websy-multi-form-form'>
2849
2876
  </div>
2850
2877
  `
2851
- if (this.options.allowDelete === true) {
2878
+ if (this.options.allowDelete === true && !this.options.readOnly) {
2852
2879
  html += `
2853
2880
  <button id='${this.elementId}_${d.formId}_deleteButton' data-formid='${d.formId}' data-rowid='${d.id}' class='websy-multi-form-delete'>
2854
2881
  ${this.options.deleteIcon}${this.options.deleteLabel}
@@ -2870,7 +2897,7 @@ class MultiForm {
2870
2897
  })
2871
2898
  const addEl = document.getElementById(`${this.elementId}_addButton`)
2872
2899
  if (addEl) {
2873
- if (this.options.allowAdd === true) {
2900
+ if (this.options.allowAdd === true && !this.options.readOnly) {
2874
2901
  addEl.style.display = (typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows) ? 'flex' : 'none'
2875
2902
  }
2876
2903
  else {
@@ -3721,11 +3748,15 @@ class WebsyPopupDialog {
3721
3748
  this.closeOnOutsideClick = true
3722
3749
  const el = document.getElementById(elementId)
3723
3750
  this.elementId = elementId
3724
- el.addEventListener('click', this.handleClick.bind(this))
3751
+ if (el) {
3752
+ el.addEventListener('click', this.handleClick.bind(this))
3753
+ }
3725
3754
  }
3726
3755
  hide () {
3727
3756
  const el = document.getElementById(this.elementId)
3728
- el.innerHTML = ''
3757
+ if (el) {
3758
+ el.innerHTML = ''
3759
+ }
3729
3760
  }
3730
3761
  handleClick (event) {
3731
3762
  if (event.target.classList.contains('websy-btn')) {
@@ -3757,47 +3788,49 @@ class WebsyPopupDialog {
3757
3788
  return
3758
3789
  }
3759
3790
  const el = document.getElementById(this.elementId)
3760
- let html = ''
3761
- if (this.options.mask === true) {
3762
- html += `<div class='websy-mask'></div>`
3763
- }
3764
- html += `
3765
- <div class='websy-popup-dialog-container'>
3766
- <div class='websy-popup-dialog ${this.options.classes.join(' ')}' style='${this.options.style}'>
3767
- `
3768
- if (this.options.title) {
3769
- html += `<h1>${this.options.title}</h1>`
3770
- }
3771
- if (this.options.message) {
3772
- html += `<p>${this.options.message}</p>`
3773
- }
3774
- if (typeof this.options.collectData !== 'undefined') {
3791
+ if (el) {
3792
+ let html = ''
3793
+ if (this.options.mask === true) {
3794
+ html += `<div class='websy-mask'></div>`
3795
+ }
3775
3796
  html += `
3776
- <div>
3777
- <input id="${this.elementId}_collect" class="websy-input" value="${typeof this.options.collectData === 'boolean' ? '' : this.options.collectData}" placeholder="${this.options.collectPlaceholder || ''}">
3778
- </div>
3797
+ <div class='websy-popup-dialog-container'>
3798
+ <div class='websy-popup-dialog ${this.options.classes.join(' ')}' style='${this.options.style}'>
3779
3799
  `
3780
- }
3781
- this.closeOnOutsideClick = true
3782
- if (this.options.buttons) {
3783
- if (this.options.allowCloseOnOutsideClick !== true) {
3784
- this.closeOnOutsideClick = false
3785
- }
3786
- html += `<div class='websy-popup-button-panel'>`
3787
- for (let i = 0; i < this.options.buttons.length; i++) {
3800
+ if (this.options.title) {
3801
+ html += `<h1>${this.options.title}</h1>`
3802
+ }
3803
+ if (this.options.message) {
3804
+ html += `<p>${this.options.message}</p>`
3805
+ }
3806
+ if (typeof this.options.collectData !== 'undefined') {
3788
3807
  html += `
3789
- <button class='websy-btn ${(this.options.buttons[i].classes || []).join(' ')}' data-index='${i}'>
3790
- ${this.options.buttons[i].label}
3791
- </button>
3792
- `
3808
+ <div>
3809
+ <input id="${this.elementId}_collect" class="websy-input" value="${typeof this.options.collectData === 'boolean' ? '' : this.options.collectData}" placeholder="${this.options.collectPlaceholder || ''}">
3810
+ </div>
3811
+ `
3793
3812
  }
3794
- html += `</div>`
3813
+ this.closeOnOutsideClick = true
3814
+ if (this.options.buttons) {
3815
+ if (this.options.allowCloseOnOutsideClick !== true) {
3816
+ this.closeOnOutsideClick = false
3817
+ }
3818
+ html += `<div class='websy-popup-button-panel'>`
3819
+ for (let i = 0; i < this.options.buttons.length; i++) {
3820
+ html += `
3821
+ <button class='websy-btn ${(this.options.buttons[i].classes || []).join(' ')}' data-index='${i}'>
3822
+ ${this.options.buttons[i].label}
3823
+ </button>
3824
+ `
3825
+ }
3826
+ html += `</div>`
3827
+ }
3828
+ html += `
3829
+ </div>
3830
+ </div>
3831
+ `
3832
+ el.innerHTML = html
3795
3833
  }
3796
- html += `
3797
- </div>
3798
- </div>
3799
- `
3800
- el.innerHTML = html
3801
3834
  }
3802
3835
  show (options) {
3803
3836
  if (options) {
@@ -5706,8 +5739,15 @@ class WebsyTable {
5706
5739
  <img src='${c.value}'>
5707
5740
  `
5708
5741
  }
5709
- return `
5742
+ let html = `
5710
5743
  <td
5744
+ `
5745
+ if (!this.options.columns[i].showAsImage && c.value.indexOf('<svg') === -1 && c.value.indexOf('<img') === -1) {
5746
+ html += `
5747
+ data-info='${info}'
5748
+ `
5749
+ }
5750
+ html += `
5711
5751
  data-info='${info}'
5712
5752
  data-row-index='${this.rowCount + rowIndex}'
5713
5753
  data-col-index='${i}'
@@ -5717,6 +5757,7 @@ class WebsyTable {
5717
5757
  rowspan='${c.rowspan || 1}'
5718
5758
  >${c.value}</td>
5719
5759
  `
5760
+ return html
5720
5761
  }
5721
5762
  }
5722
5763
  }).join('') + '</tr>'
@@ -6763,7 +6804,13 @@ class WebsyTable3 {
6763
6804
  bodyHtml += `<td
6764
6805
  class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')} ${(sizingColumns[sizeIndex].classes || []).join(' ')}'
6765
6806
  style='${style}'
6766
- data-info='${cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value}'
6807
+ `
6808
+ if (!sizingColumns[sizeIndex].showAsImage && cell.value.indexOf('<svg') === -1 && cell.value.indexOf('<img') === -1) {
6809
+ bodyHtml += `
6810
+ data-info='${cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value}'
6811
+ `
6812
+ }
6813
+ bodyHtml += `
6767
6814
  colspan='${cell.colspan || 1}'
6768
6815
  rowspan='${cell.rowspan || 1}'
6769
6816
  data-row-index='${rowIndex}'
@@ -1560,13 +1560,14 @@ var WebsyDropdown = /*#__PURE__*/function () {
1560
1560
  items: [],
1561
1561
  label: '',
1562
1562
  disabled: false,
1563
+ classes: [],
1563
1564
  minSearchCharacters: 2,
1564
1565
  showCompleteSelectedList: false,
1565
1566
  closeAfterSelection: true,
1566
1567
  customActions: [],
1567
1568
  customButtons: [],
1568
1569
  minWidth: 220,
1569
- searchIcon: "<svg 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>",
1570
+ searchIcon: "<svg 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-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
1570
1571
  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>",
1571
1572
  arrowIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z\"/></svg>",
1572
1573
  actionsIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"0 0 512 512\">><circle cx=\"256\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><circle cx=\"416\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><circle cx=\"96\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/></svg>"
@@ -1599,7 +1600,7 @@ var WebsyDropdown = /*#__PURE__*/function () {
1599
1600
  var headerValue = this.selectedItems.map(function (s) {
1600
1601
  return _this9.options.items[s].value || _this9.options.items[s].label;
1601
1602
  }).join(this.options.multiValueDelimiter);
1602
- var html = "\n <div id='".concat(this.elementId, "_container' class='websy-dropdown-container ").concat(this.options.disabled ? 'disabled' : '', " ").concat(this.options.disableSearch !== true ? 'with-search' : '', " ").concat(this.options.style, " ").concat(this.options.customActions.length > 0 ? 'with-actions' : '', "'>\n <div id='").concat(this.elementId, "_header' class='websy-dropdown-header ").concat(this.selectedItems.length === 1 ? 'one-selected' : '', " ").concat(this.options.allowClear === true ? 'allow-clear' : '', "'>\n ");
1603
+ var html = "\n <div id='".concat(this.elementId, "_container' class='websy-dropdown-container ").concat(this.options.classes.join(' '), " ").concat(this.options.disabled ? 'disabled' : '', " ").concat(this.options.disableSearch !== true ? 'with-search' : '', " ").concat(this.options.style, " ").concat(this.options.customActions.length > 0 ? 'with-actions' : '', "'>\n <div id='").concat(this.elementId, "_header' class='websy-dropdown-header ").concat(this.selectedItems.length === 1 ? 'one-selected' : '', " ").concat(this.options.allowClear === true ? 'allow-clear' : '', "'>\n ");
1603
1604
  if (this.options.disableSearch !== true) {
1604
1605
  html += "<div class='search'>".concat(this.options.searchIcon, "</div>");
1605
1606
  }
@@ -2523,19 +2524,42 @@ var WebsyForm = /*#__PURE__*/function () {
2523
2524
  this.options.fields.forEach(function (f, i) {
2524
2525
  _this18.fieldMap[f.field] = f;
2525
2526
  f.owningElement = _this18.elementId;
2527
+ if (f.disabled || f.readOnly || _this18.options.readOnly) {
2528
+ if (!f.options) {
2529
+ f.options = {};
2530
+ }
2531
+ f.disabled = true;
2532
+ f.options.disabled = true;
2533
+ if (!f.classes) {
2534
+ f.classes = [];
2535
+ }
2536
+ if (!f.options.classes) {
2537
+ f.options.classes = [];
2538
+ }
2539
+ f.classes.push('disabled');
2540
+ f.options.classes.push('disabled');
2541
+ if (f.readOnly || _this18.options.readOnly) {
2542
+ f.classes.push('websy-input-readonly');
2543
+ f.options.classes.push('websy-input-readonly');
2544
+ }
2545
+ }
2526
2546
  if (f.component) {
2527
2547
  componentsToProcess.push(f);
2528
2548
  html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this18.elementId, "_").concat(f.field, "_inputContainer' style='").concat(f.style || '', "' class='websy-input-container ").concat(f.classes ? f.classes.join(' ') : '', " ").concat(f.component === 'MediaUpload' ? 'media-upload' : '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '').concat(f.required === true ? '<span class="websy-form-required-value">*</span>' : '', "\n <div id='").concat(_this18.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n <span id='").concat(_this18.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
2529
2549
  } else if (f.type === 'longtext') {
2530
2550
  html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this18.elementId, "_").concat(f.field, "_inputContainer' style='").concat(f.style || '', "' class='websy-input-container ").concat(f.classes ? f.classes.join(' ') : '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '').concat(f.required === true ? '<span class="websy-form-required-value">*</span>' : '', "\n <textarea\n id=\"").concat(_this18.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n placeholder=\"").concat(f.placeholder || '', "\"\n data-user-type=\"").concat(f.type, "\"\n data-index=\"").concat(i, "\"\n name=\"").concat(f.field, "\" \n ").concat(f.disabled || f.readOnly || _this18.options.readOnly ? 'disabled' : '', "\n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea ").concat(f.readOnly || _this18.options.readOnly ? 'websy-input-readonly' : '', "\"\n >").concat(f.value || '', "</textarea>\n <span id='").concat(_this18.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
2531
2551
  } else {
2532
- html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this18.elementId, "_").concat(f.field, "_inputContainer' style='").concat(f.style || '', "' class='websy-input-container ").concat(f.classes ? f.classes.join(' ') : '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '').concat(f.required === true ? '<span class="websy-form-required-value">*</span>' : '', "\n <input \n id=\"").concat(_this18.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat((f.type === 'expiry' ? 'text' : f.type === 'cvv' ? 'number' : f.type) || 'text', "\" \n data-user-type=\"").concat(f.type, "\"\n data-index=\"").concat(i, "\"\n class=\"websy-input\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.type === 'date' ? '' : f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n <span id='").concat(_this18.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
2552
+ html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this18.elementId, "_").concat(f.field, "_inputContainer' style='").concat(f.style || '', "' class='websy-input-container ").concat(f.classes ? f.classes.join(' ') : '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '').concat(f.required === true ? '<span class="websy-form-required-value">*</span>' : '', "\n <input \n id=\"").concat(_this18.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat((f.type === 'expiry' ? 'text' : f.type === 'cvv' ? 'number' : f.type) || 'text', "\" \n data-user-type=\"").concat(f.type, "\"\n data-index=\"").concat(i, "\"\n class=\"websy-input ").concat(f.readOnly || _this18.options.readOnly ? 'websy-input-readonly' : '', "\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.type === 'date' ? '' : f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n ").concat(f.disabled || f.readOnly || _this18.options.readOnly ? 'disabled' : '', "\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n <span id='").concat(_this18.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
2533
2553
  }
2534
2554
  });
2535
2555
  if (this.options.useRecaptcha === true) {
2536
2556
  html += "\n --><div id='".concat(this.elementId, "_recaptcha' data-sitekey='").concat(ENVIRONMENT.RECAPTCHA_KEY, "' class='websy-form-recaptcha'></div>\n <div id='").concat(this.elementId, "_recaptchaError' class='websy-alert websy-alert-error websy-hidden'>Invalid recaptcha response</div><!--\n ");
2537
2557
  }
2538
- html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes ? this.options.submit.classes.join(' ') : '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
2558
+ if (!this.options.readOnly) {
2559
+ html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes ? this.options.submit.classes.join(' ') : '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
2560
+ } else {
2561
+ html += "-->";
2562
+ }
2539
2563
  if (this.options.cancel) {
2540
2564
  html += "\n --><button class=\"websy-btn cancel ".concat(this.options.cancel.classes ? this.options.cancel.classes.join(' ') : '', "\">").concat(this.options.cancel.text || 'Cancel', "</button>\n ");
2541
2565
  }
@@ -2719,7 +2743,8 @@ var MultiForm = /*#__PURE__*/function () {
2719
2743
  allowAdd: true,
2720
2744
  allowDelete: true,
2721
2745
  addLabel: '',
2722
- deleteLabel: ''
2746
+ deleteLabel: '',
2747
+ emptyMessage: 'No items to display'
2723
2748
  };
2724
2749
  this.options = _extends({}, DEFAULTS, options);
2725
2750
  this.formData = [];
@@ -2728,7 +2753,7 @@ var MultiForm = /*#__PURE__*/function () {
2728
2753
  var el = document.getElementById(elementId);
2729
2754
  if (el) {
2730
2755
  el.addEventListener('click', this.handleClick.bind(this));
2731
- el.innerHTML = "\n <div id='".concat(elementId, "_container' class='websy-multi-form-container'></div>\n <button id='").concat(this.elementId, "_addButton' class='websy-multi-form-add'>\n ").concat(this.options.addIcon).concat(this.options.addLabel, "\n </button> \n ");
2756
+ el.innerHTML = "\n <div id='".concat(elementId, "_container' class='websy-multi-form-container' data-empty='").concat(this.options.emptyMessage, "'></div>\n <button id='").concat(this.elementId, "_addButton' class='websy-multi-form-add'>\n ").concat(this.options.addIcon).concat(this.options.addLabel, "\n </button> \n ");
2732
2757
  }
2733
2758
  this.render();
2734
2759
  }
@@ -2840,7 +2865,7 @@ var MultiForm = /*#__PURE__*/function () {
2840
2865
  this.formData.forEach(function (d) {
2841
2866
  d.formId = WebsyDesigns.Utils.createIdentity();
2842
2867
  html += "\n <div id='".concat(_this21.elementId, "_").concat(d.formId, "_formContainer' class='websy-multi-form-form-container'>\n <div id='").concat(_this21.elementId, "_").concat(d.formId, "_form' class='websy-multi-form-form'>\n </div>\n ");
2843
- if (_this21.options.allowDelete === true) {
2868
+ if (_this21.options.allowDelete === true && !_this21.options.readOnly) {
2844
2869
  html += "\n <button id='".concat(_this21.elementId, "_").concat(d.formId, "_deleteButton' data-formid='").concat(d.formId, "' data-rowid='").concat(d.id, "' class='websy-multi-form-delete'>\n ").concat(_this21.options.deleteIcon).concat(_this21.options.deleteLabel, "\n </button>\n ");
2845
2870
  }
2846
2871
  html += "\n </div>\n ";
@@ -2860,7 +2885,7 @@ var MultiForm = /*#__PURE__*/function () {
2860
2885
  });
2861
2886
  var addEl = document.getElementById("".concat(this.elementId, "_addButton"));
2862
2887
  if (addEl) {
2863
- if (this.options.allowAdd === true) {
2888
+ if (this.options.allowAdd === true && !this.options.readOnly) {
2864
2889
  addEl.style.display = typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows ? 'flex' : 'none';
2865
2890
  } else {
2866
2891
  addEl.style.display = 'none';
@@ -3533,13 +3558,17 @@ var WebsyPopupDialog = /*#__PURE__*/function () {
3533
3558
  this.closeOnOutsideClick = true;
3534
3559
  var el = document.getElementById(elementId);
3535
3560
  this.elementId = elementId;
3536
- el.addEventListener('click', this.handleClick.bind(this));
3561
+ if (el) {
3562
+ el.addEventListener('click', this.handleClick.bind(this));
3563
+ }
3537
3564
  }
3538
3565
  _createClass(WebsyPopupDialog, [{
3539
3566
  key: "hide",
3540
3567
  value: function hide() {
3541
3568
  var el = document.getElementById(this.elementId);
3542
- el.innerHTML = '';
3569
+ if (el) {
3570
+ el.innerHTML = '';
3571
+ }
3543
3572
  }
3544
3573
  }, {
3545
3574
  key: "handleClick",
@@ -3573,33 +3602,35 @@ var WebsyPopupDialog = /*#__PURE__*/function () {
3573
3602
  return;
3574
3603
  }
3575
3604
  var el = document.getElementById(this.elementId);
3576
- var html = '';
3577
- if (this.options.mask === true) {
3578
- html += "<div class='websy-mask'></div>";
3579
- }
3580
- html += "\n\t\t\t<div class='websy-popup-dialog-container'>\n\t\t\t\t<div class='websy-popup-dialog ".concat(this.options.classes.join(' '), "' style='").concat(this.options.style, "'>\n\t\t");
3581
- if (this.options.title) {
3582
- html += "<h1>".concat(this.options.title, "</h1>");
3583
- }
3584
- if (this.options.message) {
3585
- html += "<p>".concat(this.options.message, "</p>");
3586
- }
3587
- if (typeof this.options.collectData !== 'undefined') {
3588
- html += "\n <div>\n <input id=\"".concat(this.elementId, "_collect\" class=\"websy-input\" value=\"").concat(typeof this.options.collectData === 'boolean' ? '' : this.options.collectData, "\" placeholder=\"").concat(this.options.collectPlaceholder || '', "\">\n </div>\n ");
3589
- }
3590
- this.closeOnOutsideClick = true;
3591
- if (this.options.buttons) {
3592
- if (this.options.allowCloseOnOutsideClick !== true) {
3593
- this.closeOnOutsideClick = false;
3605
+ if (el) {
3606
+ var html = '';
3607
+ if (this.options.mask === true) {
3608
+ html += "<div class='websy-mask'></div>";
3594
3609
  }
3595
- html += "<div class='websy-popup-button-panel'>";
3596
- for (var i = 0; i < this.options.buttons.length; i++) {
3597
- html += "\n\t\t\t\t\t<button class='websy-btn ".concat((this.options.buttons[i].classes || []).join(' '), "' data-index='").concat(i, "'>\n\t\t\t\t\t\t").concat(this.options.buttons[i].label, "\n\t\t\t\t\t</button>\n\t\t\t\t");
3610
+ html += "\n <div class='websy-popup-dialog-container'>\n <div class='websy-popup-dialog ".concat(this.options.classes.join(' '), "' style='").concat(this.options.style, "'>\n ");
3611
+ if (this.options.title) {
3612
+ html += "<h1>".concat(this.options.title, "</h1>");
3598
3613
  }
3599
- html += "</div>";
3614
+ if (this.options.message) {
3615
+ html += "<p>".concat(this.options.message, "</p>");
3616
+ }
3617
+ if (typeof this.options.collectData !== 'undefined') {
3618
+ html += "\n <div>\n <input id=\"".concat(this.elementId, "_collect\" class=\"websy-input\" value=\"").concat(typeof this.options.collectData === 'boolean' ? '' : this.options.collectData, "\" placeholder=\"").concat(this.options.collectPlaceholder || '', "\">\n </div>\n ");
3619
+ }
3620
+ this.closeOnOutsideClick = true;
3621
+ if (this.options.buttons) {
3622
+ if (this.options.allowCloseOnOutsideClick !== true) {
3623
+ this.closeOnOutsideClick = false;
3624
+ }
3625
+ html += "<div class='websy-popup-button-panel'>";
3626
+ for (var i = 0; i < this.options.buttons.length; i++) {
3627
+ html += "\n <button class='websy-btn ".concat((this.options.buttons[i].classes || []).join(' '), "' data-index='").concat(i, "'>\n ").concat(this.options.buttons[i].label, "\n </button>\n ");
3628
+ }
3629
+ html += "</div>";
3630
+ }
3631
+ html += "\n </div>\n </div>\n ";
3632
+ el.innerHTML = html;
3600
3633
  }
3601
- html += "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t";
3602
- el.innerHTML = html;
3603
3634
  }
3604
3635
  }, {
3605
3636
  key: "show",
@@ -5547,7 +5578,12 @@ var WebsyTable = /*#__PURE__*/function () {
5547
5578
  if (_this38.options.columns[i].showAsImage === true) {
5548
5579
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5549
5580
  }
5550
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this38.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this38.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
5581
+ var html = "\n <td \n ";
5582
+ if (!_this38.options.columns[i].showAsImage && c.value.indexOf('<svg') === -1 && c.value.indexOf('<img') === -1) {
5583
+ html += "\n data-info='".concat(info, "'\n ");
5584
+ }
5585
+ html += "\n data-info='".concat(info, "' \n data-row-index='").concat(_this38.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this38.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
5586
+ return html;
5551
5587
  }
5552
5588
  }
5553
5589
  }).join('') + '</tr>';
@@ -6495,7 +6531,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6495
6531
  style += "color: ".concat(cell.color, "; ");
6496
6532
  }
6497
6533
  // console.log('rowspan', cell.rowspan)
6498
- bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this44.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value.replace ? cell.value.replace(/'/g, '`') : 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(colIndex, "'\n ");
6534
+ bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this44.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n ");
6535
+ if (!sizingColumns[sizeIndex].showAsImage && cell.value.indexOf('<svg') === -1 && cell.value.indexOf('<img') === -1) {
6536
+ bodyHtml += "\n data-info='".concat(cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value, "'\n ");
6537
+ }
6538
+ bodyHtml += "\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(colIndex, "'\n ");
6499
6539
  // if (useWidths === true) {
6500
6540
  // bodyHtml += `
6501
6541
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'