@websy/websy-designs 1.11.2 → 1.11.4

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.
@@ -191,7 +191,7 @@ ${
191
191
  </style>
192
192
  </head>
193
193
  <body>
194
- <div id='app' class='pdf-print'>
194
+ <div id="app" class="pdf-print">
195
195
  ${header}
196
196
  ${data.html}
197
197
  ${footer}
@@ -201,7 +201,8 @@ ${
201
201
  `
202
202
  lastHTML = html
203
203
  convertHTMLToPDF(html, data.name || utils.createIdentity(), (err, pdf) => {
204
- console.log('info', `HTML converted to PDF`)
204
+ console.log('info', `HTML converted to PDF`)
205
+ console.log(html.split(0, 5000))
205
206
  // setTimeout(() => {
206
207
  // try {
207
208
  // // fs.unlinkSync(`${process.env.APP_ROOT}/pdf/${pdfId}.pdf`)
@@ -1922,9 +1922,16 @@ class WebsyDropdown {
1922
1922
  }
1923
1923
  else if (this.options.style === 'plain' && headerPos.width === 0 && headerPos.height === 0) {
1924
1924
  const targetPos = WebsyUtils.getElementPos(event.target)
1925
- contentEl.style.left = 'unset'
1926
- contentEl.style.right = `calc(100vw - ${targetPos.right}px)`
1927
- contentEl.style.width = `${Math.max(this.options.minWidth, targetPos.width)}px`
1925
+ if (Math.max(this.options.minWidth, targetPos.width) > targetPos.right) {
1926
+ contentEl.style.left = `${targetPos.left}px`
1927
+ contentEl.style.right = 'unset'
1928
+ contentEl.style.width = `${Math.max(this.options.minWidth, targetPos.width)}px`
1929
+ }
1930
+ else {
1931
+ contentEl.style.left = 'unset'
1932
+ contentEl.style.right = `calc(100vw - ${targetPos.right}px)`
1933
+ contentEl.style.width = `${Math.max(this.options.minWidth, targetPos.width)}px`
1934
+ }
1928
1935
  }
1929
1936
  if (this.options.disableSearch !== true) {
1930
1937
  const searchEl = document.getElementById(`${this.elementId}_search`)
@@ -2507,8 +2514,9 @@ class WebsyForm {
2507
2514
  data-user-type="${f.type}"
2508
2515
  data-index="${i}"
2509
2516
  name="${f.field}"
2517
+ ${f.disabled || f.readOnly || this.options.readOnly ? 'disabled' : ''}
2510
2518
  ${(f.attributes || []).join(' ')}
2511
- class="websy-input websy-textarea"
2519
+ class="websy-input websy-textarea ${f.readOnly || this.options.readOnly ? 'websy-input-readonly' : ''}"
2512
2520
  >${f.value || ''}</textarea>
2513
2521
  <span id='${this.elementId}_${f.field}_error' class='websy-form-validation-error'></span>
2514
2522
  </div><!--
@@ -3349,13 +3357,14 @@ class WebsyNavigationMenu {
3349
3357
  let selected = '' // items[i].default === true ? 'selected' : ''
3350
3358
  let active = items[i].default === true ? 'active' : ''
3351
3359
  let currentBlock = this.normaliseString(items[i].text)
3360
+ let isLast = items[i].items && items[i].items.length > 0 ? '' : 'websy-menu-last-level'
3352
3361
  let blockId = items[i].id // || `${this.elementId}_${currentBlock}_label`
3353
3362
  if (Array.isArray(items[i].classes)) {
3354
3363
  items[i].classes = items[i].classes.join(' ')
3355
3364
  }
3356
3365
  html += `
3357
3366
  <li class='websy-${this.options.orientation}-list-item ${items[i].alwaysOpen === true ? 'always-open' : ''}'>
3358
- <div class='websy-menu-header websy-menu-level-${level} ${items[i].classes || ''} ${selected} ${active}'
3367
+ <div class='websy-menu-header ${isLast} websy-menu-level-${level} ${items[i].classes || ''} ${selected} ${active}'
3359
3368
  id='${blockId}'
3360
3369
  data-id='${currentBlock}'
3361
3370
  data-path='${items[i].path}'
@@ -1893,9 +1893,15 @@ var WebsyDropdown = /*#__PURE__*/function () {
1893
1893
  }
1894
1894
  } else if (this.options.style === 'plain' && headerPos.width === 0 && headerPos.height === 0) {
1895
1895
  var targetPos = WebsyUtils.getElementPos(event.target);
1896
- contentEl.style.left = 'unset';
1897
- contentEl.style.right = "calc(100vw - ".concat(targetPos.right, "px)");
1898
- contentEl.style.width = "".concat(Math.max(this.options.minWidth, targetPos.width), "px");
1896
+ if (Math.max(this.options.minWidth, targetPos.width) > targetPos.right) {
1897
+ contentEl.style.left = "".concat(targetPos.left, "px");
1898
+ contentEl.style.right = 'unset';
1899
+ contentEl.style.width = "".concat(Math.max(this.options.minWidth, targetPos.width), "px");
1900
+ } else {
1901
+ contentEl.style.left = 'unset';
1902
+ contentEl.style.right = "calc(100vw - ".concat(targetPos.right, "px)");
1903
+ contentEl.style.width = "".concat(Math.max(this.options.minWidth, targetPos.width), "px");
1904
+ }
1899
1905
  }
1900
1906
  if (this.options.disableSearch !== true) {
1901
1907
  var searchEl = document.getElementById("".concat(this.elementId, "_search"));
@@ -2521,7 +2527,7 @@ var WebsyForm = /*#__PURE__*/function () {
2521
2527
  componentsToProcess.push(f);
2522
2528
  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 ");
2523
2529
  } else if (f.type === 'longtext') {
2524
- 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.attributes || []).join(' '), "\n class=\"websy-input websy-textarea\"\n >").concat(f.value || '', "</textarea>\n <span id='").concat(_this18.elementId, "_").concat(f.field, "_error' class='websy-form-validation-error'></span>\n </div><!--\n ");
2530
+ 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 ");
2525
2531
  } else {
2526
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 ");
2527
2533
  }
@@ -3199,11 +3205,12 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3199
3205
  var selected = ''; // items[i].default === true ? 'selected' : ''
3200
3206
  var active = items[i]["default"] === true ? 'active' : '';
3201
3207
  var currentBlock = this.normaliseString(items[i].text);
3208
+ var isLast = items[i].items && items[i].items.length > 0 ? '' : 'websy-menu-last-level';
3202
3209
  var blockId = items[i].id; // || `${this.elementId}_${currentBlock}_label`
3203
3210
  if (Array.isArray(items[i].classes)) {
3204
3211
  items[i].classes = items[i].classes.join(' ');
3205
3212
  }
3206
- html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='").concat(this.options.indent, "-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
3213
+ html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header ").concat(isLast, " websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='").concat(this.options.indent, "-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
3207
3214
  if (this.options.orientation === 'horizontal') {
3208
3215
  html += items[i].text;
3209
3216
  }