@websy/websy-designs 1.11.6 → 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.
- package/dist/websy-designs-es6.debug.js +97 -50
- package/dist/websy-designs-es6.js +76 -36
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +97 -50
- package/dist/websy-designs.js +76 -36
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -1481,13 +1481,14 @@ class WebsyDropdown {
|
|
|
1481
1481
|
items: [],
|
|
1482
1482
|
label: '',
|
|
1483
1483
|
disabled: false,
|
|
1484
|
+
classes: [],
|
|
1484
1485
|
minSearchCharacters: 2,
|
|
1485
1486
|
showCompleteSelectedList: false,
|
|
1486
1487
|
closeAfterSelection: true,
|
|
1487
1488
|
customActions: [],
|
|
1488
1489
|
customButtons: [],
|
|
1489
1490
|
minWidth: 220,
|
|
1490
|
-
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
|
|
1491
|
+
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>`,
|
|
1491
1492
|
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>`,
|
|
1492
1493
|
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>`,
|
|
1493
1494
|
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>`
|
|
@@ -1517,7 +1518,7 @@ class WebsyDropdown {
|
|
|
1517
1518
|
const headerLabel = this.selectedItems.map(s => this.options.items[s].label || this.options.items[s].value).join(this.options.multiValueDelimiter)
|
|
1518
1519
|
const headerValue = this.selectedItems.map(s => this.options.items[s].value || this.options.items[s].label).join(this.options.multiValueDelimiter)
|
|
1519
1520
|
let html = `
|
|
1520
|
-
<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' : ''}'>
|
|
1521
|
+
<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' : ''}'>
|
|
1521
1522
|
<div id='${this.elementId}_header' class='websy-dropdown-header ${this.selectedItems.length === 1 ? 'one-selected' : ''} ${this.options.allowClear === true ? 'allow-clear' : ''}'>
|
|
1522
1523
|
`
|
|
1523
1524
|
if (this.options.disableSearch !== true) {
|
|
@@ -2698,6 +2699,25 @@ class WebsyForm {
|
|
|
2698
2699
|
this.options.fields.forEach((f, i) => {
|
|
2699
2700
|
this.fieldMap[f.field] = f
|
|
2700
2701
|
f.owningElement = this.elementId
|
|
2702
|
+
if (f.disabled || f.readOnly || this.options.readOnly) {
|
|
2703
|
+
if (!f.options) {
|
|
2704
|
+
f.options = {}
|
|
2705
|
+
}
|
|
2706
|
+
f.disabled = true
|
|
2707
|
+
f.options.disabled = true
|
|
2708
|
+
if (!f.classes) {
|
|
2709
|
+
f.classes = []
|
|
2710
|
+
}
|
|
2711
|
+
if (!f.options.classes) {
|
|
2712
|
+
f.options.classes = []
|
|
2713
|
+
}
|
|
2714
|
+
f.classes.push('disabled')
|
|
2715
|
+
f.options.classes.push('disabled')
|
|
2716
|
+
if (f.readOnly || this.options.readOnly) {
|
|
2717
|
+
f.classes.push('websy-input-readonly')
|
|
2718
|
+
f.options.classes.push('websy-input-readonly')
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2701
2721
|
if (f.component) {
|
|
2702
2722
|
componentsToProcess.push(f)
|
|
2703
2723
|
html += `
|
|
@@ -2737,12 +2757,13 @@ class WebsyForm {
|
|
|
2737
2757
|
type="${(f.type === 'expiry' ? 'text' : f.type === 'cvv' ? 'number' : f.type) || 'text'}"
|
|
2738
2758
|
data-user-type="${f.type}"
|
|
2739
2759
|
data-index="${i}"
|
|
2740
|
-
class="websy-input"
|
|
2760
|
+
class="websy-input ${f.readOnly || this.options.readOnly ? 'websy-input-readonly' : ''}"
|
|
2741
2761
|
${(f.attributes || []).join(' ')}
|
|
2742
2762
|
name="${f.field}"
|
|
2743
2763
|
placeholder="${f.placeholder || ''}"
|
|
2744
2764
|
value="${f.type === 'date' ? '' : f.value || ''}"
|
|
2745
2765
|
valueAsDate="${f.type === 'date' ? f.value : ''}"
|
|
2766
|
+
${f.disabled || f.readOnly || this.options.readOnly ? 'disabled' : ''}
|
|
2746
2767
|
oninvalidx="this.setCustomValidity('${f.invalidMessage || 'Please fill in this field.'}')"
|
|
2747
2768
|
/>
|
|
2748
2769
|
<span id='${this.elementId}_${f.field}_error' class='websy-form-validation-error'></span>
|
|
@@ -2756,9 +2777,14 @@ class WebsyForm {
|
|
|
2756
2777
|
<div id='${this.elementId}_recaptchaError' class='websy-alert websy-alert-error websy-hidden'>Invalid recaptcha response</div><!--
|
|
2757
2778
|
`
|
|
2758
2779
|
}
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2780
|
+
if (!this.options.readOnly) {
|
|
2781
|
+
html += `
|
|
2782
|
+
--><button class="websy-btn submit ${this.options.submit.classes ? this.options.submit.classes.join(' ') : ''}">${this.options.submit.text || 'Save'}</button>${this.options.cancel ? '<!--' : ''}
|
|
2783
|
+
`
|
|
2784
|
+
}
|
|
2785
|
+
else {
|
|
2786
|
+
html += `-->`
|
|
2787
|
+
}
|
|
2762
2788
|
if (this.options.cancel) {
|
|
2763
2789
|
html += `
|
|
2764
2790
|
--><button class="websy-btn cancel ${this.options.cancel.classes ? this.options.cancel.classes.join(' ') : ''}">${this.options.cancel.text || 'Cancel'}</button>
|
|
@@ -2941,7 +2967,8 @@ class MultiForm {
|
|
|
2941
2967
|
allowAdd: true,
|
|
2942
2968
|
allowDelete: true,
|
|
2943
2969
|
addLabel: '',
|
|
2944
|
-
deleteLabel: ''
|
|
2970
|
+
deleteLabel: '',
|
|
2971
|
+
emptyMessage: 'No items to display'
|
|
2945
2972
|
}
|
|
2946
2973
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
2947
2974
|
this.formData = []
|
|
@@ -2951,7 +2978,7 @@ class MultiForm {
|
|
|
2951
2978
|
if (el) {
|
|
2952
2979
|
el.addEventListener('click', this.handleClick.bind(this))
|
|
2953
2980
|
el.innerHTML = `
|
|
2954
|
-
<div id='${elementId}_container' class='websy-multi-form-container'></div>
|
|
2981
|
+
<div id='${elementId}_container' class='websy-multi-form-container' data-empty='${this.options.emptyMessage}'></div>
|
|
2955
2982
|
<button id='${this.elementId}_addButton' class='websy-multi-form-add'>
|
|
2956
2983
|
${this.options.addIcon}${this.options.addLabel}
|
|
2957
2984
|
</button>
|
|
@@ -3053,7 +3080,7 @@ class MultiForm {
|
|
|
3053
3080
|
<div id='${this.elementId}_${d.formId}_form' class='websy-multi-form-form'>
|
|
3054
3081
|
</div>
|
|
3055
3082
|
`
|
|
3056
|
-
if (this.options.allowDelete === true) {
|
|
3083
|
+
if (this.options.allowDelete === true && !this.options.readOnly) {
|
|
3057
3084
|
html += `
|
|
3058
3085
|
<button id='${this.elementId}_${d.formId}_deleteButton' data-formid='${d.formId}' data-rowid='${d.id}' class='websy-multi-form-delete'>
|
|
3059
3086
|
${this.options.deleteIcon}${this.options.deleteLabel}
|
|
@@ -3075,7 +3102,7 @@ class MultiForm {
|
|
|
3075
3102
|
})
|
|
3076
3103
|
const addEl = document.getElementById(`${this.elementId}_addButton`)
|
|
3077
3104
|
if (addEl) {
|
|
3078
|
-
if (this.options.allowAdd === true) {
|
|
3105
|
+
if (this.options.allowAdd === true && !this.options.readOnly) {
|
|
3079
3106
|
addEl.style.display = (typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows) ? 'flex' : 'none'
|
|
3080
3107
|
}
|
|
3081
3108
|
else {
|
|
@@ -4165,11 +4192,15 @@ class WebsyPopupDialog {
|
|
|
4165
4192
|
this.closeOnOutsideClick = true
|
|
4166
4193
|
const el = document.getElementById(elementId)
|
|
4167
4194
|
this.elementId = elementId
|
|
4168
|
-
|
|
4195
|
+
if (el) {
|
|
4196
|
+
el.addEventListener('click', this.handleClick.bind(this))
|
|
4197
|
+
}
|
|
4169
4198
|
}
|
|
4170
4199
|
hide () {
|
|
4171
4200
|
const el = document.getElementById(this.elementId)
|
|
4172
|
-
el
|
|
4201
|
+
if (el) {
|
|
4202
|
+
el.innerHTML = ''
|
|
4203
|
+
}
|
|
4173
4204
|
}
|
|
4174
4205
|
handleClick (event) {
|
|
4175
4206
|
if (event.target.classList.contains('websy-btn')) {
|
|
@@ -4201,47 +4232,49 @@ class WebsyPopupDialog {
|
|
|
4201
4232
|
return
|
|
4202
4233
|
}
|
|
4203
4234
|
const el = document.getElementById(this.elementId)
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
<div class='websy-popup-dialog-container'>
|
|
4210
|
-
<div class='websy-popup-dialog ${this.options.classes.join(' ')}' style='${this.options.style}'>
|
|
4211
|
-
`
|
|
4212
|
-
if (this.options.title) {
|
|
4213
|
-
html += `<h1>${this.options.title}</h1>`
|
|
4214
|
-
}
|
|
4215
|
-
if (this.options.message) {
|
|
4216
|
-
html += `<p>${this.options.message}</p>`
|
|
4217
|
-
}
|
|
4218
|
-
if (typeof this.options.collectData !== 'undefined') {
|
|
4235
|
+
if (el) {
|
|
4236
|
+
let html = ''
|
|
4237
|
+
if (this.options.mask === true) {
|
|
4238
|
+
html += `<div class='websy-mask'></div>`
|
|
4239
|
+
}
|
|
4219
4240
|
html += `
|
|
4220
|
-
<div>
|
|
4221
|
-
<
|
|
4222
|
-
</div>
|
|
4241
|
+
<div class='websy-popup-dialog-container'>
|
|
4242
|
+
<div class='websy-popup-dialog ${this.options.classes.join(' ')}' style='${this.options.style}'>
|
|
4223
4243
|
`
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
if (this.options.
|
|
4228
|
-
this.
|
|
4229
|
-
}
|
|
4230
|
-
|
|
4231
|
-
for (let i = 0; i < this.options.buttons.length; i++) {
|
|
4244
|
+
if (this.options.title) {
|
|
4245
|
+
html += `<h1>${this.options.title}</h1>`
|
|
4246
|
+
}
|
|
4247
|
+
if (this.options.message) {
|
|
4248
|
+
html += `<p>${this.options.message}</p>`
|
|
4249
|
+
}
|
|
4250
|
+
if (typeof this.options.collectData !== 'undefined') {
|
|
4232
4251
|
html += `
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4252
|
+
<div>
|
|
4253
|
+
<input id="${this.elementId}_collect" class="websy-input" value="${typeof this.options.collectData === 'boolean' ? '' : this.options.collectData}" placeholder="${this.options.collectPlaceholder || ''}">
|
|
4254
|
+
</div>
|
|
4255
|
+
`
|
|
4237
4256
|
}
|
|
4238
|
-
|
|
4257
|
+
this.closeOnOutsideClick = true
|
|
4258
|
+
if (this.options.buttons) {
|
|
4259
|
+
if (this.options.allowCloseOnOutsideClick !== true) {
|
|
4260
|
+
this.closeOnOutsideClick = false
|
|
4261
|
+
}
|
|
4262
|
+
html += `<div class='websy-popup-button-panel'>`
|
|
4263
|
+
for (let i = 0; i < this.options.buttons.length; i++) {
|
|
4264
|
+
html += `
|
|
4265
|
+
<button class='websy-btn ${(this.options.buttons[i].classes || []).join(' ')}' data-index='${i}'>
|
|
4266
|
+
${this.options.buttons[i].label}
|
|
4267
|
+
</button>
|
|
4268
|
+
`
|
|
4269
|
+
}
|
|
4270
|
+
html += `</div>`
|
|
4271
|
+
}
|
|
4272
|
+
html += `
|
|
4273
|
+
</div>
|
|
4274
|
+
</div>
|
|
4275
|
+
`
|
|
4276
|
+
el.innerHTML = html
|
|
4239
4277
|
}
|
|
4240
|
-
html += `
|
|
4241
|
-
</div>
|
|
4242
|
-
</div>
|
|
4243
|
-
`
|
|
4244
|
-
el.innerHTML = html
|
|
4245
4278
|
}
|
|
4246
4279
|
show (options) {
|
|
4247
4280
|
if (options) {
|
|
@@ -6596,8 +6629,15 @@ class WebsyTable {
|
|
|
6596
6629
|
<img src='${c.value}'>
|
|
6597
6630
|
`
|
|
6598
6631
|
}
|
|
6599
|
-
|
|
6632
|
+
let html = `
|
|
6600
6633
|
<td
|
|
6634
|
+
`
|
|
6635
|
+
if (!this.options.columns[i].showAsImage && c.value.indexOf('<svg') === -1 && c.value.indexOf('<img') === -1) {
|
|
6636
|
+
html += `
|
|
6637
|
+
data-info='${info}'
|
|
6638
|
+
`
|
|
6639
|
+
}
|
|
6640
|
+
html += `
|
|
6601
6641
|
data-info='${info}'
|
|
6602
6642
|
data-row-index='${this.rowCount + rowIndex}'
|
|
6603
6643
|
data-col-index='${i}'
|
|
@@ -6607,6 +6647,7 @@ class WebsyTable {
|
|
|
6607
6647
|
rowspan='${c.rowspan || 1}'
|
|
6608
6648
|
>${c.value}</td>
|
|
6609
6649
|
`
|
|
6650
|
+
return html
|
|
6610
6651
|
}
|
|
6611
6652
|
}
|
|
6612
6653
|
}).join('') + '</tr>'
|
|
@@ -7653,7 +7694,13 @@ class WebsyTable3 {
|
|
|
7653
7694
|
bodyHtml += `<td
|
|
7654
7695
|
class='websy-table-cell ${sizeIndex < this.pinnedColumns ? 'pinned' : 'unpinned'} ${(cell.classes || []).join(' ')} ${(sizingColumns[sizeIndex].classes || []).join(' ')}'
|
|
7655
7696
|
style='${style}'
|
|
7656
|
-
|
|
7697
|
+
`
|
|
7698
|
+
if (!sizingColumns[sizeIndex].showAsImage && cell.value.indexOf('<svg') === -1 && cell.value.indexOf('<img') === -1) {
|
|
7699
|
+
bodyHtml += `
|
|
7700
|
+
data-info='${cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value}'
|
|
7701
|
+
`
|
|
7702
|
+
}
|
|
7703
|
+
bodyHtml += `
|
|
7657
7704
|
colspan='${cell.colspan || 1}'
|
|
7658
7705
|
rowspan='${cell.rowspan || 1}'
|
|
7659
7706
|
data-row-index='${rowIndex}'
|
package/dist/websy-designs.js
CHANGED
|
@@ -1455,13 +1455,14 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1455
1455
|
items: [],
|
|
1456
1456
|
label: '',
|
|
1457
1457
|
disabled: false,
|
|
1458
|
+
classes: [],
|
|
1458
1459
|
minSearchCharacters: 2,
|
|
1459
1460
|
showCompleteSelectedList: false,
|
|
1460
1461
|
closeAfterSelection: true,
|
|
1461
1462
|
customActions: [],
|
|
1462
1463
|
customButtons: [],
|
|
1463
1464
|
minWidth: 220,
|
|
1464
|
-
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
|
|
1465
|
+
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>",
|
|
1465
1466
|
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>",
|
|
1466
1467
|
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>",
|
|
1467
1468
|
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>"
|
|
@@ -1494,7 +1495,7 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1494
1495
|
var headerValue = this.selectedItems.map(function (s) {
|
|
1495
1496
|
return _this10.options.items[s].value || _this10.options.items[s].label;
|
|
1496
1497
|
}).join(this.options.multiValueDelimiter);
|
|
1497
|
-
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 ");
|
|
1498
|
+
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 ");
|
|
1498
1499
|
if (this.options.disableSearch !== true) {
|
|
1499
1500
|
html += "<div class='search'>".concat(this.options.searchIcon, "</div>");
|
|
1500
1501
|
}
|
|
@@ -2702,19 +2703,42 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2702
2703
|
this.options.fields.forEach(function (f, i) {
|
|
2703
2704
|
_this20.fieldMap[f.field] = f;
|
|
2704
2705
|
f.owningElement = _this20.elementId;
|
|
2706
|
+
if (f.disabled || f.readOnly || _this20.options.readOnly) {
|
|
2707
|
+
if (!f.options) {
|
|
2708
|
+
f.options = {};
|
|
2709
|
+
}
|
|
2710
|
+
f.disabled = true;
|
|
2711
|
+
f.options.disabled = true;
|
|
2712
|
+
if (!f.classes) {
|
|
2713
|
+
f.classes = [];
|
|
2714
|
+
}
|
|
2715
|
+
if (!f.options.classes) {
|
|
2716
|
+
f.options.classes = [];
|
|
2717
|
+
}
|
|
2718
|
+
f.classes.push('disabled');
|
|
2719
|
+
f.options.classes.push('disabled');
|
|
2720
|
+
if (f.readOnly || _this20.options.readOnly) {
|
|
2721
|
+
f.classes.push('websy-input-readonly');
|
|
2722
|
+
f.options.classes.push('websy-input-readonly');
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2705
2725
|
if (f.component) {
|
|
2706
2726
|
componentsToProcess.push(f);
|
|
2707
2727
|
html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this20.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(_this20.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n <span id='").concat(_this20.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
|
|
2708
2728
|
} else if (f.type === 'longtext') {
|
|
2709
2729
|
html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this20.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(_this20.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 || _this20.options.readOnly ? 'disabled' : '', "\n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea ").concat(f.readOnly || _this20.options.readOnly ? 'websy-input-readonly' : '', "\"\n >").concat(f.value || '', "</textarea>\n <span id='").concat(_this20.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
|
|
2710
2730
|
} else {
|
|
2711
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this20.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(_this20.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(_this20.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
|
|
2731
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div id='").concat(_this20.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(_this20.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 || _this20.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 || _this20.options.readOnly ? 'disabled' : '', "\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n <span id='").concat(_this20.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
|
|
2712
2732
|
}
|
|
2713
2733
|
});
|
|
2714
2734
|
if (this.options.useRecaptcha === true) {
|
|
2715
2735
|
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 ");
|
|
2716
2736
|
}
|
|
2717
|
-
|
|
2737
|
+
if (!this.options.readOnly) {
|
|
2738
|
+
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 ");
|
|
2739
|
+
} else {
|
|
2740
|
+
html += "-->";
|
|
2741
|
+
}
|
|
2718
2742
|
if (this.options.cancel) {
|
|
2719
2743
|
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 ");
|
|
2720
2744
|
}
|
|
@@ -2898,7 +2922,8 @@ var MultiForm = /*#__PURE__*/function () {
|
|
|
2898
2922
|
allowAdd: true,
|
|
2899
2923
|
allowDelete: true,
|
|
2900
2924
|
addLabel: '',
|
|
2901
|
-
deleteLabel: ''
|
|
2925
|
+
deleteLabel: '',
|
|
2926
|
+
emptyMessage: 'No items to display'
|
|
2902
2927
|
};
|
|
2903
2928
|
this.options = _extends({}, DEFAULTS, options);
|
|
2904
2929
|
this.formData = [];
|
|
@@ -2907,7 +2932,7 @@ var MultiForm = /*#__PURE__*/function () {
|
|
|
2907
2932
|
var el = document.getElementById(elementId);
|
|
2908
2933
|
if (el) {
|
|
2909
2934
|
el.addEventListener('click', this.handleClick.bind(this));
|
|
2910
|
-
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 ");
|
|
2935
|
+
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 ");
|
|
2911
2936
|
}
|
|
2912
2937
|
this.render();
|
|
2913
2938
|
}
|
|
@@ -3019,7 +3044,7 @@ var MultiForm = /*#__PURE__*/function () {
|
|
|
3019
3044
|
this.formData.forEach(function (d) {
|
|
3020
3045
|
d.formId = WebsyDesigns.Utils.createIdentity();
|
|
3021
3046
|
html += "\n <div id='".concat(_this23.elementId, "_").concat(d.formId, "_formContainer' class='websy-multi-form-form-container'>\n <div id='").concat(_this23.elementId, "_").concat(d.formId, "_form' class='websy-multi-form-form'>\n </div>\n ");
|
|
3022
|
-
if (_this23.options.allowDelete === true) {
|
|
3047
|
+
if (_this23.options.allowDelete === true && !_this23.options.readOnly) {
|
|
3023
3048
|
html += "\n <button id='".concat(_this23.elementId, "_").concat(d.formId, "_deleteButton' data-formid='").concat(d.formId, "' data-rowid='").concat(d.id, "' class='websy-multi-form-delete'>\n ").concat(_this23.options.deleteIcon).concat(_this23.options.deleteLabel, "\n </button>\n ");
|
|
3024
3049
|
}
|
|
3025
3050
|
html += "\n </div>\n ";
|
|
@@ -3039,7 +3064,7 @@ var MultiForm = /*#__PURE__*/function () {
|
|
|
3039
3064
|
});
|
|
3040
3065
|
var addEl = document.getElementById("".concat(this.elementId, "_addButton"));
|
|
3041
3066
|
if (addEl) {
|
|
3042
|
-
if (this.options.allowAdd === true) {
|
|
3067
|
+
if (this.options.allowAdd === true && !this.options.readOnly) {
|
|
3043
3068
|
addEl.style.display = typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows ? 'flex' : 'none';
|
|
3044
3069
|
} else {
|
|
3045
3070
|
addEl.style.display = 'none';
|
|
@@ -3955,13 +3980,17 @@ var WebsyPopupDialog = /*#__PURE__*/function () {
|
|
|
3955
3980
|
this.closeOnOutsideClick = true;
|
|
3956
3981
|
var el = document.getElementById(elementId);
|
|
3957
3982
|
this.elementId = elementId;
|
|
3958
|
-
|
|
3983
|
+
if (el) {
|
|
3984
|
+
el.addEventListener('click', this.handleClick.bind(this));
|
|
3985
|
+
}
|
|
3959
3986
|
}
|
|
3960
3987
|
_createClass(WebsyPopupDialog, [{
|
|
3961
3988
|
key: "hide",
|
|
3962
3989
|
value: function hide() {
|
|
3963
3990
|
var el = document.getElementById(this.elementId);
|
|
3964
|
-
el
|
|
3991
|
+
if (el) {
|
|
3992
|
+
el.innerHTML = '';
|
|
3993
|
+
}
|
|
3965
3994
|
}
|
|
3966
3995
|
}, {
|
|
3967
3996
|
key: "handleClick",
|
|
@@ -3995,33 +4024,35 @@ var WebsyPopupDialog = /*#__PURE__*/function () {
|
|
|
3995
4024
|
return;
|
|
3996
4025
|
}
|
|
3997
4026
|
var el = document.getElementById(this.elementId);
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
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");
|
|
4003
|
-
if (this.options.title) {
|
|
4004
|
-
html += "<h1>".concat(this.options.title, "</h1>");
|
|
4005
|
-
}
|
|
4006
|
-
if (this.options.message) {
|
|
4007
|
-
html += "<p>".concat(this.options.message, "</p>");
|
|
4008
|
-
}
|
|
4009
|
-
if (typeof this.options.collectData !== 'undefined') {
|
|
4010
|
-
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 ");
|
|
4011
|
-
}
|
|
4012
|
-
this.closeOnOutsideClick = true;
|
|
4013
|
-
if (this.options.buttons) {
|
|
4014
|
-
if (this.options.allowCloseOnOutsideClick !== true) {
|
|
4015
|
-
this.closeOnOutsideClick = false;
|
|
4027
|
+
if (el) {
|
|
4028
|
+
var html = '';
|
|
4029
|
+
if (this.options.mask === true) {
|
|
4030
|
+
html += "<div class='websy-mask'></div>";
|
|
4016
4031
|
}
|
|
4017
|
-
html += "<div class='websy-popup-
|
|
4018
|
-
|
|
4019
|
-
html += "
|
|
4032
|
+
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 ");
|
|
4033
|
+
if (this.options.title) {
|
|
4034
|
+
html += "<h1>".concat(this.options.title, "</h1>");
|
|
4020
4035
|
}
|
|
4021
|
-
|
|
4036
|
+
if (this.options.message) {
|
|
4037
|
+
html += "<p>".concat(this.options.message, "</p>");
|
|
4038
|
+
}
|
|
4039
|
+
if (typeof this.options.collectData !== 'undefined') {
|
|
4040
|
+
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 ");
|
|
4041
|
+
}
|
|
4042
|
+
this.closeOnOutsideClick = true;
|
|
4043
|
+
if (this.options.buttons) {
|
|
4044
|
+
if (this.options.allowCloseOnOutsideClick !== true) {
|
|
4045
|
+
this.closeOnOutsideClick = false;
|
|
4046
|
+
}
|
|
4047
|
+
html += "<div class='websy-popup-button-panel'>";
|
|
4048
|
+
for (var i = 0; i < this.options.buttons.length; i++) {
|
|
4049
|
+
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 ");
|
|
4050
|
+
}
|
|
4051
|
+
html += "</div>";
|
|
4052
|
+
}
|
|
4053
|
+
html += "\n </div>\n </div>\n ";
|
|
4054
|
+
el.innerHTML = html;
|
|
4022
4055
|
}
|
|
4023
|
-
html += "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t";
|
|
4024
|
-
el.innerHTML = html;
|
|
4025
4056
|
}
|
|
4026
4057
|
}, {
|
|
4027
4058
|
key: "show",
|
|
@@ -6425,7 +6456,12 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
6425
6456
|
if (_this46.options.columns[i].showAsImage === true) {
|
|
6426
6457
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
6427
6458
|
}
|
|
6428
|
-
|
|
6459
|
+
var html = "\n <td \n ";
|
|
6460
|
+
if (!_this46.options.columns[i].showAsImage && c.value.indexOf('<svg') === -1 && c.value.indexOf('<img') === -1) {
|
|
6461
|
+
html += "\n data-info='".concat(info, "'\n ");
|
|
6462
|
+
}
|
|
6463
|
+
html += "\n data-info='".concat(info, "' \n data-row-index='").concat(_this46.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this46.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 ");
|
|
6464
|
+
return html;
|
|
6429
6465
|
}
|
|
6430
6466
|
}
|
|
6431
6467
|
}).join('') + '</tr>';
|
|
@@ -7373,7 +7409,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7373
7409
|
style += "color: ".concat(cell.color, "; ");
|
|
7374
7410
|
}
|
|
7375
7411
|
// console.log('rowspan', cell.rowspan)
|
|
7376
|
-
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this52.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n
|
|
7412
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this52.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n ");
|
|
7413
|
+
if (!sizingColumns[sizeIndex].showAsImage && cell.value.indexOf('<svg') === -1 && cell.value.indexOf('<img') === -1) {
|
|
7414
|
+
bodyHtml += "\n data-info='".concat(cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value, "'\n ");
|
|
7415
|
+
}
|
|
7416
|
+
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 ");
|
|
7377
7417
|
// if (useWidths === true) {
|
|
7378
7418
|
// bodyHtml += `
|
|
7379
7419
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|