formeo 5.0.3 → 5.1.0

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.
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -6064,7 +6064,7 @@ Author: Draggable https://draggable.io
6064
6064
  var name$1, version$2, type, main, module$1, unpkg, exports$1, files, homepage, repository, author, contributors, bugs, description, keywords, ignore, config, scripts, devDependencies, dependencies, release, commitlint, package_default;
6065
6065
  var init_package = __esmMin((() => {
6066
6066
  name$1 = "formeo";
6067
- version$2 = "5.0.2";
6067
+ version$2 = "5.0.3";
6068
6068
  type = "module";
6069
6069
  main = "dist/formeo.cjs.js";
6070
6070
  module$1 = "dist/formeo.es.js";
@@ -12782,6 +12782,9 @@ Author: Draggable https://draggable.io
12782
12782
  isDOMElement(variable) {
12783
12783
  return variable instanceof window.Element || variable instanceof window.HTMLElement || !!(variable && typeof variable === "object" && variable.nodeType === 1 && typeof variable.nodeName === "string");
12784
12784
  }
12785
+ resolveContainer(container) {
12786
+ return typeof container === "string" ? document.querySelector(container) : container;
12787
+ }
12785
12788
  };
12786
12789
  dom = new DOM();
12787
12790
  }));
@@ -16251,7 +16254,7 @@ Author: Draggable https://draggable.io
16251
16254
  };
16252
16255
  applyOptions = async (controlOptions = {}) => {
16253
16256
  const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions);
16254
- this.container = container;
16257
+ this.container = dom.resolveContainer(container);
16255
16258
  this.groupOrder = unique(groupOrder.concat([
16256
16259
  "common",
16257
16260
  "html",
@@ -17796,7 +17799,7 @@ Author: Draggable https://draggable.io
17796
17799
  config: {},
17797
17800
  events: {},
17798
17801
  actions: {},
17799
- controls: {},
17802
+ controls: { container: null },
17800
17803
  i18n: { location: "https://draggable.github.io/formeo/assets/lang/" },
17801
17804
  onLoad: () => {}
17802
17805
  };
@@ -17837,7 +17840,7 @@ Author: Draggable https://draggable.io
17837
17840
  */
17838
17841
  constructor({ formData, ...options }, userFormData) {
17839
17842
  const { actions: actions$1, events: events$1, debug, config, editorContainer, ...opts } = merge(defaults.editor, options);
17840
- if (editorContainer) this.editorContainer = typeof editorContainer === "string" ? document.querySelector(editorContainer) : editorContainer;
17843
+ if (editorContainer) this.editorContainer = dom.resolveContainer(editorContainer) || null;
17841
17844
  this.opts = opts;
17842
17845
  dom.setOptions = opts;
17843
17846
  components.config = config;
@@ -18034,7 +18037,11 @@ Author: Draggable https://draggable.io
18034
18037
  dom.dir = s.current.dir;
18035
18038
  }
18036
18039
  this.editor = dom.create(elemConfig);
18037
- (this.controls.container || this.editor).appendChild(this.controls.dom);
18040
+ const controlsContainer = this.controls.container || this.editor;
18041
+ if (controlsContainer) {
18042
+ if (controlsContainer !== this.editor) dom.empty(controlsContainer);
18043
+ controlsContainer.appendChild(this.controls.dom);
18044
+ }
18038
18045
  if (this.editorContainer) {
18039
18046
  dom.empty(this.editorContainer);
18040
18047
  this.editorContainer.appendChild(this.editor);
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -1 +1 @@
1
- <!doctype html><html lang="en" xml:lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name="description" content="Vanilla Javascript form building module"><meta name="theme-color" content="#232323"><title>Formeo | Drag &amp; Drop Form Creation</title><script type="module" crossorigin src="/formeo/assets/js/demo.min.js"></script><link rel="stylesheet" crossorigin href="/formeo/assets/css/demo.min.css"></head><body><div class="site-wrap"><header id="demo-header"><div class="header-inner"><img id="formeo-logo" src="/formeo/assets/img/formeo-logo.svg" alt="Formeo Logo" width="100"><nav aria-label="Framework navigation"><ul><li><label for="framework-select">Framework:</label> <select name="framework-select" id="framework-select" class="form-control"><option value="vanilla">Vanilla JavaScript</option><option value="angular">Angular</option><option value="react">React</option></select></li><li><label for="locale">Language</label> <select name="locale" id="locale" class="form-control"><option value="af-ZA" dir="ltr">Afrikaans (Suid-Afrika)</option><option value="ar-TN" dir="rtl">العربية (تونس)</option><option value="cs-CZ" dir="ltr">čeština (Česko)</option><option value="de-DE" dir="ltr">Deutsch (Deutschland)</option><option value="en-US" dir="ltr">English</option><option value="es-ES" dir="ltr">español de España</option><option value="fa-IR" dir="rtl">فارسی (ایران)</option><option value="fi-FI" dir="ltr">suomi (Suomi)</option><option value="fr-FR" dir="ltr">français (France)</option><option value="he-IL" dir="rtl">עברית (ישראל)</option><option value="hi-IN" dir="ltr">हिन्दी (भारत)</option><option value="hu-HU" dir="ltr">magyar (Magyarország)</option><option value="it-IT" dir="ltr">italiano (Italia)</option><option value="ja-JP" dir="ltr">日本語 (日本)</option><option value="nb-NO" dir="ltr">norsk bokmål (Norge)</option><option value="pl-PL" dir="ltr">polski (Polska)</option><option value="pt-BR" dir="ltr">português (Brasil)</option><option value="pt-PT" dir="ltr">português europeu</option><option value="ro-RO" dir="ltr">română (România)</option><option value="ru-RU" dir="ltr">русский (Россия)</option><option value="th-TH" dir="ltr">ไทย (ไทย)</option><option value="tr-TR" dir="ltr">Türkçe (Türkiye)</option><option value="zh-CN" dir="ltr">中文(中国)</option><option value="zh-HK" dir="ltr">中文(中國香港特別行政區)</option></select></li><li><label for="control-filter">Control Filter:</label> <input id="control-filter" placeholder="ex. text" class="form-control"></li><li style="float:right">v5.0.2</li></ul></nav></div></header><section id="main_content" class="inner"><div id="framework-container"></div></section><div class="container render-btn-wrap" id="editor-action-buttons"></div><div id="formData-popover" popover><div class="popover-header"><h3>Test formData</h3><div><button type="button" id="format-json">Format</button> <button type="button" id="collapse-json">Collapse</button> <button type="button" id="copy-json">Copy to Clipboard</button></div></div><pre id="formData-editor"></pre><div class="formData-actions"><button popovertarget="formData-popover" popovertargetaction="hide" type="button">Cancel</button> <button id="submit-formData" type="button">Submit</button></div></div><footer id="demo-footer"><nav aria-label="Footer navigation"><ul><li><a href="https://github.com/Draggable/formeo" target="_blank" title="View project on GitHub"><img src="/formeo/assets/img/github.png" width="77" alt="GitHub"></a></li></ul></nav></footer></div></body></html>
1
+ <!doctype html><html lang="en" xml:lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name="description" content="Vanilla Javascript form building module"><meta name="theme-color" content="#232323"><title>Formeo | Drag &amp; Drop Form Creation</title><script type="module" crossorigin src="/formeo/assets/js/demo.min.js"></script><link rel="stylesheet" crossorigin href="/formeo/assets/css/demo.min.css"></head><body><div class="site-wrap"><header id="demo-header"><div class="header-inner"><img id="formeo-logo" src="/formeo/assets/img/formeo-logo.svg" alt="Formeo Logo" width="100"><nav aria-label="Framework navigation"><ul><li><label for="framework-select">Framework:</label> <select name="framework-select" id="framework-select" class="form-control"><option value="vanilla">Vanilla JavaScript</option><option value="angular">Angular</option><option value="react">React</option></select></li><li><label for="locale">Language</label> <select name="locale" id="locale" class="form-control"><option value="af-ZA" dir="ltr">Afrikaans (Suid-Afrika)</option><option value="ar-TN" dir="rtl">العربية (تونس)</option><option value="cs-CZ" dir="ltr">čeština (Česko)</option><option value="de-DE" dir="ltr">Deutsch (Deutschland)</option><option value="en-US" dir="ltr">English</option><option value="es-ES" dir="ltr">español de España</option><option value="fa-IR" dir="rtl">فارسی (ایران)</option><option value="fi-FI" dir="ltr">suomi (Suomi)</option><option value="fr-FR" dir="ltr">français (France)</option><option value="he-IL" dir="rtl">עברית (ישראל)</option><option value="hi-IN" dir="ltr">हिन्दी (भारत)</option><option value="hu-HU" dir="ltr">magyar (Magyarország)</option><option value="it-IT" dir="ltr">italiano (Italia)</option><option value="ja-JP" dir="ltr">日本語 (日本)</option><option value="nb-NO" dir="ltr">norsk bokmål (Norge)</option><option value="pl-PL" dir="ltr">polski (Polska)</option><option value="pt-BR" dir="ltr">português (Brasil)</option><option value="pt-PT" dir="ltr">português europeu</option><option value="ro-RO" dir="ltr">română (România)</option><option value="ru-RU" dir="ltr">русский (Россия)</option><option value="th-TH" dir="ltr">ไทย (ไทย)</option><option value="tr-TR" dir="ltr">Türkçe (Türkiye)</option><option value="zh-CN" dir="ltr">中文(中国)</option><option value="zh-HK" dir="ltr">中文(中國香港特別行政區)</option></select></li><li><label for="control-filter">Control Filter:</label> <input id="control-filter" placeholder="ex. text" class="form-control"></li><li style="float:right">v5.0.3</li></ul></nav></div></header><section id="main_content" class="inner"><div id="framework-container"></div></section><div class="container render-btn-wrap" id="editor-action-buttons"></div><div id="formData-popover" popover><div class="popover-header"><h3>Test formData</h3><div><button type="button" id="format-json">Format</button> <button type="button" id="collapse-json">Collapse</button> <button type="button" id="copy-json">Copy to Clipboard</button></div></div><pre id="formData-editor"></pre><div class="formData-actions"><button popovertarget="formData-popover" popovertargetaction="hide" type="button">Cancel</button> <button id="submit-formData" type="button">Submit</button></div></div><footer id="demo-footer"><nav aria-label="Footer navigation"><ul><li><a href="https://github.com/Draggable/formeo" target="_blank" title="View project on GitHub"><img src="/formeo/assets/img/github.png" width="77" alt="GitHub"></a></li></ul></nav></footer></div></body></html>
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -6061,7 +6061,7 @@ if (globalThis !== void 0) globalThis.SmartTooltip = SmartTooltip;
6061
6061
  var name$1, version$2, type, main, module$1, unpkg, exports$1, files, homepage, repository, author, contributors, bugs, description, keywords, ignore, config, scripts, devDependencies, dependencies, release, commitlint, package_default;
6062
6062
  var init_package = __esmMin((() => {
6063
6063
  name$1 = "formeo";
6064
- version$2 = "5.0.2";
6064
+ version$2 = "5.0.3";
6065
6065
  type = "module";
6066
6066
  main = "dist/formeo.cjs.js";
6067
6067
  module$1 = "dist/formeo.es.js";
@@ -12779,6 +12779,9 @@ var init_dom = __esmMin((() => {
12779
12779
  isDOMElement(variable) {
12780
12780
  return variable instanceof window.Element || variable instanceof window.HTMLElement || !!(variable && typeof variable === "object" && variable.nodeType === 1 && typeof variable.nodeName === "string");
12781
12781
  }
12782
+ resolveContainer(container) {
12783
+ return typeof container === "string" ? document.querySelector(container) : container;
12784
+ }
12782
12785
  };
12783
12786
  dom = new DOM();
12784
12787
  }));
@@ -16248,7 +16251,7 @@ var init_controls = __esmMin((() => {
16248
16251
  };
16249
16252
  applyOptions = async (controlOptions = {}) => {
16250
16253
  const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions);
16251
- this.container = container;
16254
+ this.container = dom.resolveContainer(container);
16252
16255
  this.groupOrder = unique(groupOrder.concat([
16253
16256
  "common",
16254
16257
  "html",
@@ -17793,7 +17796,7 @@ var defaults = { get editor() {
17793
17796
  config: {},
17794
17797
  events: {},
17795
17798
  actions: {},
17796
- controls: {},
17799
+ controls: { container: null },
17797
17800
  i18n: { location: "https://draggable.github.io/formeo/assets/lang/" },
17798
17801
  onLoad: () => {}
17799
17802
  };
@@ -17834,7 +17837,7 @@ var FormeoEditor$1 = class {
17834
17837
  */
17835
17838
  constructor({ formData, ...options }, userFormData) {
17836
17839
  const { actions: actions$1, events: events$1, debug, config, editorContainer, ...opts } = merge(defaults.editor, options);
17837
- if (editorContainer) this.editorContainer = typeof editorContainer === "string" ? document.querySelector(editorContainer) : editorContainer;
17840
+ if (editorContainer) this.editorContainer = dom.resolveContainer(editorContainer) || null;
17838
17841
  this.opts = opts;
17839
17842
  dom.setOptions = opts;
17840
17843
  components.config = config;
@@ -18031,7 +18034,11 @@ var FormeoEditor$1 = class {
18031
18034
  dom.dir = s.current.dir;
18032
18035
  }
18033
18036
  this.editor = dom.create(elemConfig);
18034
- (this.controls.container || this.editor).appendChild(this.controls.dom);
18037
+ const controlsContainer = this.controls.container || this.editor;
18038
+ if (controlsContainer) {
18039
+ if (controlsContainer !== this.editor) dom.empty(controlsContainer);
18040
+ controlsContainer.appendChild(this.controls.dom);
18041
+ }
18035
18042
  if (this.editorContainer) {
18036
18043
  dom.empty(this.editorContainer);
18037
18044
  this.editorContainer.appendChild(this.editor);
package/dist/formeo.css CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
package/dist/formeo.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.2
4
+ Version: 5.0.3
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -6060,7 +6060,7 @@ if (globalThis !== void 0) globalThis.SmartTooltip = SmartTooltip;
6060
6060
  var name$1, version$2, type, main, module$1, unpkg, exports$1, files, homepage, repository, author, contributors, bugs, description, keywords, ignore, config, scripts, devDependencies, dependencies, release, commitlint, package_default;
6061
6061
  var init_package = __esmMin((() => {
6062
6062
  name$1 = "formeo";
6063
- version$2 = "5.0.2";
6063
+ version$2 = "5.0.3";
6064
6064
  type = "module";
6065
6065
  main = "dist/formeo.cjs.js";
6066
6066
  module$1 = "dist/formeo.es.js";
@@ -12778,6 +12778,9 @@ var init_dom = __esmMin((() => {
12778
12778
  isDOMElement(variable) {
12779
12779
  return variable instanceof window.Element || variable instanceof window.HTMLElement || !!(variable && typeof variable === "object" && variable.nodeType === 1 && typeof variable.nodeName === "string");
12780
12780
  }
12781
+ resolveContainer(container) {
12782
+ return typeof container === "string" ? document.querySelector(container) : container;
12783
+ }
12781
12784
  };
12782
12785
  dom = new DOM();
12783
12786
  }));
@@ -16247,7 +16250,7 @@ var init_controls = __esmMin((() => {
16247
16250
  };
16248
16251
  applyOptions = async (controlOptions = {}) => {
16249
16252
  const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions);
16250
- this.container = container;
16253
+ this.container = dom.resolveContainer(container);
16251
16254
  this.groupOrder = unique(groupOrder.concat([
16252
16255
  "common",
16253
16256
  "html",
@@ -17792,7 +17795,7 @@ var defaults = { get editor() {
17792
17795
  config: {},
17793
17796
  events: {},
17794
17797
  actions: {},
17795
- controls: {},
17798
+ controls: { container: null },
17796
17799
  i18n: { location: "https://draggable.github.io/formeo/assets/lang/" },
17797
17800
  onLoad: () => {}
17798
17801
  };
@@ -17833,7 +17836,7 @@ var FormeoEditor$1 = class {
17833
17836
  */
17834
17837
  constructor({ formData, ...options }, userFormData) {
17835
17838
  const { actions: actions$1, events: events$1, debug, config, editorContainer, ...opts } = merge(defaults.editor, options);
17836
- if (editorContainer) this.editorContainer = typeof editorContainer === "string" ? document.querySelector(editorContainer) : editorContainer;
17839
+ if (editorContainer) this.editorContainer = dom.resolveContainer(editorContainer) || null;
17837
17840
  this.opts = opts;
17838
17841
  dom.setOptions = opts;
17839
17842
  components.config = config;
@@ -18030,7 +18033,11 @@ var FormeoEditor$1 = class {
18030
18033
  dom.dir = s.current.dir;
18031
18034
  }
18032
18035
  this.editor = dom.create(elemConfig);
18033
- (this.controls.container || this.editor).appendChild(this.controls.dom);
18036
+ const controlsContainer = this.controls.container || this.editor;
18037
+ if (controlsContainer) {
18038
+ if (controlsContainer !== this.editor) dom.empty(controlsContainer);
18039
+ controlsContainer.appendChild(this.controls.dom);
18040
+ }
18034
18041
  if (this.editorContainer) {
18035
18042
  dom.empty(this.editorContainer);
18036
18043
  this.editorContainer.appendChild(this.editor);