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.
Binary file
@@ -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
 
@@ -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);
@@ -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);