formeo 4.2.0 → 4.2.1

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: 4.1.4
4
+ Version: 4.2.0
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -51,8 +51,8 @@ class I18N {
51
51
  this.config = { location: parsedLocation, ...restOptions };
52
52
  const { override, preloaded = {} } = this.config;
53
53
  const allLangs = Object.entries(this.langs).concat(Object.entries(override || preloaded));
54
- this.langs = allLangs.reduce((acc, [locale, lang]) => {
55
- acc[locale] = this.applyLanguage(locale, lang);
54
+ this.langs = allLangs.reduce((acc, [locale2, lang]) => {
55
+ acc[locale2] = this.applyLanguage(locale2, lang);
56
56
  return acc;
57
57
  }, {});
58
58
  this.locale = this.config.locale || this.config.langs[0];
@@ -71,9 +71,9 @@ class I18N {
71
71
  * @param {String} locale
72
72
  * @param {String|Object} lang
73
73
  */
74
- addLanguage(locale, lang = {}) {
74
+ addLanguage(locale2, lang = {}) {
75
75
  lang = typeof lang === "string" ? I18N.processFile(lang) : lang;
76
- this.applyLanguage(locale, lang);
76
+ this.applyLanguage(locale2, lang);
77
77
  this.config.langs.push("locale");
78
78
  }
79
79
  /**
@@ -82,9 +82,9 @@ class I18N {
82
82
  * @param {String} locale - locale to check for value
83
83
  * @return {String} language string or undefined
84
84
  */
85
- getValue(key, locale = this.locale) {
85
+ getValue(key, locale2 = this.locale) {
86
86
  var _a;
87
- const value = (_a = this.langs[locale]) == null ? void 0 : _a[key];
87
+ const value = (_a = this.langs[locale2]) == null ? void 0 : _a[key];
88
88
  return value || this.getFallbackValue(key);
89
89
  }
90
90
  /**
@@ -161,9 +161,9 @@ class I18N {
161
161
  static fromFile(rawText) {
162
162
  const lines = rawText.split("\n");
163
163
  const lang = {};
164
- for (let matches2, i = 0; i < lines.length; i++) {
164
+ for (let matches2, i2 = 0; i2 < lines.length; i2++) {
165
165
  const regex = /^(.+?) *?= *?([^\n]+)/;
166
- matches2 = regex.exec(lines[i]);
166
+ matches2 = regex.exec(lines[i2]);
167
167
  if (matches2) {
168
168
  lang[matches2[1]] = matches2[2].replace(/(^\s+|\s+$)/g, "");
169
169
  }
@@ -176,22 +176,22 @@ class I18N {
176
176
  * @param {Boolean} useCache
177
177
  * @return {Promise} resolves response
178
178
  */
179
- loadLang(locale, useCache = true) {
179
+ loadLang(locale2, useCache = true) {
180
180
  const _this = this;
181
181
  return new Promise(function(resolve, reject) {
182
- if (_this.loaded.indexOf(locale) !== -1 && useCache) {
183
- _this.applyLanguage(_this.langs[locale]);
184
- return resolve(_this.langs[locale]);
182
+ if (_this.loaded.indexOf(locale2) !== -1 && useCache) {
183
+ _this.applyLanguage(_this.langs[locale2]);
184
+ return resolve(_this.langs[locale2]);
185
185
  } else {
186
- const langFile = [_this.config.location, locale, _this.config.extension].join("");
186
+ const langFile = [_this.config.location, locale2, _this.config.extension].join("");
187
187
  return fetchData(langFile).then((lang) => {
188
188
  const processedFile = I18N.processFile(lang);
189
- _this.applyLanguage(locale, processedFile);
190
- _this.loaded.push(locale);
191
- return resolve(_this.langs[locale]);
189
+ _this.applyLanguage(locale2, processedFile);
190
+ _this.loaded.push(locale2);
191
+ return resolve(_this.langs[locale2]);
192
192
  }).catch((err) => {
193
193
  console.error(err);
194
- const lang = _this.applyLanguage(locale);
194
+ const lang = _this.applyLanguage(locale2);
195
195
  resolve(lang);
196
196
  });
197
197
  }
@@ -203,11 +203,11 @@ class I18N {
203
203
  * @param {Object} lang
204
204
  * @return {Object} overriden language
205
205
  */
206
- applyLanguage(locale, lang = {}) {
207
- const override = this.config.override[locale] || {};
208
- const existingLang = this.langs[locale] || {};
209
- this.langs[locale] = { ...existingLang, ...lang, ...override };
210
- return this.langs[locale];
206
+ applyLanguage(locale2, lang = {}) {
207
+ const override = this.config.override[locale2] || {};
208
+ const existingLang = this.langs[locale2] || {};
209
+ this.langs[locale2] = { ...existingLang, ...lang, ...override };
210
+ return this.langs[locale2];
211
211
  }
212
212
  /**
213
213
  * return currently available languages
@@ -221,10 +221,10 @@ class I18N {
221
221
  * @param {String} locale
222
222
  * @return {Promise} language
223
223
  */
224
- async setCurrent(locale = "en-US") {
225
- await this.loadLang(locale);
226
- this.locale = locale;
227
- this.current = this.langs[locale];
224
+ async setCurrent(locale2 = "en-US") {
225
+ await this.loadLang(locale2);
226
+ this.locale = locale2;
227
+ this.current = this.langs[locale2];
228
228
  return this.current;
229
229
  }
230
230
  }
@@ -257,9 +257,9 @@ class SmartTooltip {
257
257
  __publicField(this, "tooltip");
258
258
  __publicField(this, "activeTriggerType", null);
259
259
  __publicField(this, "spacing", 12);
260
- __publicField(this, "handleClick", (e) => {
260
+ __publicField(this, "handleClick", (e2) => {
261
261
  const triggerName = this.triggerName;
262
- const trigger = e.target.closest(`[${triggerName}][${triggerName}-type="click"]`);
262
+ const trigger = e2.target.closest(`[${triggerName}][${triggerName}-type="click"]`);
263
263
  if (trigger) {
264
264
  if (this.isVisible()) {
265
265
  this.hide();
@@ -272,9 +272,9 @@ class SmartTooltip {
272
272
  this.hide();
273
273
  }
274
274
  });
275
- __publicField(this, "handleMouseOver", (e) => {
275
+ __publicField(this, "handleMouseOver", (e2) => {
276
276
  const triggerName = this.triggerName;
277
- const trigger = e.target.closest(`[${triggerName}]`);
277
+ const trigger = e2.target.closest(`[${triggerName}]`);
278
278
  if (this.activeTriggerType !== "click" && (trigger == null ? void 0 : trigger.getAttribute(`${triggerName}-type`)) !== "click") {
279
279
  const content = trigger == null ? void 0 : trigger.getAttribute(`${triggerName}`);
280
280
  if (content) {
@@ -283,9 +283,9 @@ class SmartTooltip {
283
283
  }
284
284
  }
285
285
  });
286
- __publicField(this, "handleMouseOut", (e) => {
286
+ __publicField(this, "handleMouseOut", (e2) => {
287
287
  const triggerName = this.triggerName;
288
- const trigger = e.target.closest(`[${triggerName}]`);
288
+ const trigger = e2.target.closest(`[${triggerName}]`);
289
289
  if (this.activeTriggerType !== "click" && (trigger == null ? void 0 : trigger.getAttribute(`${triggerName}-type`)) !== "click") {
290
290
  this.hide();
291
291
  }
@@ -433,7 +433,7 @@ if (window !== void 0) {
433
433
  window.SmartTooltip = SmartTooltip;
434
434
  }
435
435
  const name$1 = "formeo";
436
- const version$2 = "4.1.4";
436
+ const version$2 = "4.2.0";
437
437
  const pkg = {
438
438
  name: name$1,
439
439
  version: version$2
@@ -667,7 +667,7 @@ function require_getRawTag() {
667
667
  try {
668
668
  value[symToStringTag] = void 0;
669
669
  var unmasked = true;
670
- } catch (e) {
670
+ } catch (e2) {
671
671
  }
672
672
  var result = nativeObjectToString.call(value);
673
673
  if (unmasked) {
@@ -778,11 +778,11 @@ function require_toSource() {
778
778
  if (func != null) {
779
779
  try {
780
780
  return funcToString.call(func);
781
- } catch (e) {
781
+ } catch (e2) {
782
782
  }
783
783
  try {
784
784
  return func + "";
785
- } catch (e) {
785
+ } catch (e2) {
786
786
  }
787
787
  }
788
788
  return "";
@@ -1128,7 +1128,7 @@ function require_defineProperty() {
1128
1128
  var func = getNative(Object, "defineProperty");
1129
1129
  func({}, "", {});
1130
1130
  return func;
1131
- } catch (e) {
1131
+ } catch (e2) {
1132
1132
  }
1133
1133
  })();
1134
1134
  _defineProperty$1 = defineProperty;
@@ -1539,7 +1539,7 @@ function require_nodeUtil() {
1539
1539
  return types;
1540
1540
  }
1541
1541
  return freeProcess && freeProcess.binding && freeProcess.binding("util");
1542
- } catch (e) {
1542
+ } catch (e2) {
1543
1543
  }
1544
1544
  })();
1545
1545
  module2.exports = nodeUtil;
@@ -2072,8 +2072,8 @@ const clone$1 = (obj) => {
2072
2072
  }
2073
2073
  if (Array.isArray(obj)) {
2074
2074
  copy = [];
2075
- for (let i = 0, len = obj.length; i < len; i++) {
2076
- copy[i] = clone$1(obj[i]);
2075
+ for (let i2 = 0, len = obj.length; i2 < len; i2++) {
2076
+ copy[i2] = clone$1(obj[i2]);
2077
2077
  }
2078
2078
  return copy;
2079
2079
  }
@@ -2145,8 +2145,8 @@ function parseData(data = /* @__PURE__ */ Object.create(null)) {
2145
2145
  if (typeof data === "string") {
2146
2146
  try {
2147
2147
  return JSON.parse(data);
2148
- } catch (e) {
2149
- console.error("Invalid JSON string provided:", e);
2148
+ } catch (e2) {
2149
+ console.error("Invalid JSON string provided:", e2);
2150
2150
  return /* @__PURE__ */ Object.create(null);
2151
2151
  }
2152
2152
  }
@@ -2168,20 +2168,17 @@ function buildFlatDataStructure(data, componentId, componentType2, result = {})
2168
2168
  }
2169
2169
  return result;
2170
2170
  }
2171
+ let BUNDLED_SVG_SPRITE = null;
2172
+ try {
2173
+ BUNDLED_SVG_SPRITE = require("../../lib/icons/formeo-sprite.svg?raw");
2174
+ } catch (e2) {
2175
+ }
2171
2176
  const name = pkg.name;
2172
2177
  const version$1 = pkg.version;
2173
2178
  const PACKAGE_NAME = name;
2174
2179
  const formeoSpriteId = "formeo-sprite";
2175
- const POLYFILLS = [
2176
- { name: "cssPreload", src: "//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js" },
2177
- { name: "mutationObserver", src: "//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js" },
2178
- { name: "fetch", src: "https://unpkg.com/unfetch/polyfill" }
2179
- ];
2180
- const relativeSpritePath = `../../lib/icons/${formeoSpriteId}.svg`;
2181
- const localSpriteUrl = false ? (void 0)(relativeSpritePath) : relativeSpritePath;
2182
- const isDev = typeof process !== "undefined" && process.env?.NODE_ENV === "development" || false;
2183
- const SVG_SPRITE_URL = isDev ? localSpriteUrl : `https://cdn.jsdelivr.net/npm/formeo@${version$1}/dist/${formeoSpriteId}.svg`;
2184
- const FALLBACK_SVG_SPRITE_URL = `https://draggable.github.io/formeo/assets/img/${formeoSpriteId}.svg`;
2180
+ const SVG_SPRITE_URL = null;
2181
+ const FALLBACK_SVG_SPRITE_URL = `https://cdn.jsdelivr.net/npm/formeo@${version$1}/dist/${formeoSpriteId}.svg`;
2185
2182
  const CSS_URL = `https://cdn.jsdelivr.net/npm/formeo@${version$1}/dist/formeo.min.css`;
2186
2183
  const FALLBACK_CSS_URL = "https://draggable.github.io/formeo/assets/css/formeo.min.css";
2187
2184
  const PANEL_CLASSNAME = "f-panel";
@@ -3464,9 +3461,9 @@ function ownKeys(object, enumerableOnly) {
3464
3461
  return keys;
3465
3462
  }
3466
3463
  function _objectSpread2(target) {
3467
- for (var i = 1; i < arguments.length; i++) {
3468
- var source = arguments[i] != null ? arguments[i] : {};
3469
- if (i % 2) {
3464
+ for (var i2 = 1; i2 < arguments.length; i2++) {
3465
+ var source = arguments[i2] != null ? arguments[i2] : {};
3466
+ if (i2 % 2) {
3470
3467
  ownKeys(Object(source), true).forEach(function(key) {
3471
3468
  _defineProperty(target, key, source[key]);
3472
3469
  });
@@ -3508,8 +3505,8 @@ function _defineProperty(obj, key, value) {
3508
3505
  }
3509
3506
  function _extends() {
3510
3507
  _extends = Object.assign || function(target) {
3511
- for (var i = 1; i < arguments.length; i++) {
3512
- var source = arguments[i];
3508
+ for (var i2 = 1; i2 < arguments.length; i2++) {
3509
+ var source = arguments[i2];
3513
3510
  for (var key in source) {
3514
3511
  if (Object.prototype.hasOwnProperty.call(source, key)) {
3515
3512
  target[key] = source[key];
@@ -3524,9 +3521,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
3524
3521
  if (source == null) return {};
3525
3522
  var target = {};
3526
3523
  var sourceKeys = Object.keys(source);
3527
- var key, i;
3528
- for (i = 0; i < sourceKeys.length; i++) {
3529
- key = sourceKeys[i];
3524
+ var key, i2;
3525
+ for (i2 = 0; i2 < sourceKeys.length; i2++) {
3526
+ key = sourceKeys[i2];
3530
3527
  if (excluded.indexOf(key) >= 0) continue;
3531
3528
  target[key] = source[key];
3532
3529
  }
@@ -3535,11 +3532,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
3535
3532
  function _objectWithoutProperties(source, excluded) {
3536
3533
  if (source == null) return {};
3537
3534
  var target = _objectWithoutPropertiesLoose(source, excluded);
3538
- var key, i;
3535
+ var key, i2;
3539
3536
  if (Object.getOwnPropertySymbols) {
3540
3537
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
3541
- for (i = 0; i < sourceSymbolKeys.length; i++) {
3542
- key = sourceSymbolKeys[i];
3538
+ for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
3539
+ key = sourceSymbolKeys[i2];
3543
3540
  if (excluded.indexOf(key) >= 0) continue;
3544
3541
  if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
3545
3542
  target[key] = source[key];
@@ -3648,10 +3645,10 @@ function matrix(el, selfOnly) {
3648
3645
  }
3649
3646
  function find(ctx, tagName, iterator) {
3650
3647
  if (ctx) {
3651
- var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
3648
+ var list = ctx.getElementsByTagName(tagName), i2 = 0, n = list.length;
3652
3649
  if (iterator) {
3653
- for (; i < n; i++) {
3654
- iterator(list[i], i);
3650
+ for (; i2 < n; i2++) {
3651
+ iterator(list[i2], i2);
3655
3652
  }
3656
3653
  }
3657
3654
  return list;
@@ -3734,15 +3731,15 @@ function isScrolledPast(el, elSide, parentSide) {
3734
3731
  return false;
3735
3732
  }
3736
3733
  function getChild(el, childNum, options, includeDragEl) {
3737
- var currentChild = 0, i = 0, children = el.children;
3738
- while (i < children.length) {
3739
- if (children[i].style.display !== "none" && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
3734
+ var currentChild = 0, i2 = 0, children = el.children;
3735
+ while (i2 < children.length) {
3736
+ if (children[i2].style.display !== "none" && children[i2] !== Sortable.ghost && (includeDragEl || children[i2] !== Sortable.dragged) && closest(children[i2], options.draggable, el, false)) {
3740
3737
  if (currentChild === childNum) {
3741
- return children[i];
3738
+ return children[i2];
3742
3739
  }
3743
3740
  currentChild++;
3744
3741
  }
3745
- i++;
3742
+ i2++;
3746
3743
  }
3747
3744
  return null;
3748
3745
  }
@@ -3777,10 +3774,10 @@ function getRelativeScrollOffset(el) {
3777
3774
  return [offsetLeft, offsetTop];
3778
3775
  }
3779
3776
  function indexOfObject(arr, obj) {
3780
- for (var i in arr) {
3781
- if (!arr.hasOwnProperty(i)) continue;
3777
+ for (var i2 in arr) {
3778
+ if (!arr.hasOwnProperty(i2)) continue;
3782
3779
  for (var key in obj) {
3783
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
3780
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i2][key]) return Number(i2);
3784
3781
  }
3785
3782
  }
3786
3783
  return -1;
@@ -4233,9 +4230,9 @@ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent2(evt)
4233
4230
  var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
4234
4231
  if (nearest) {
4235
4232
  var event = {};
4236
- for (var i in evt) {
4237
- if (evt.hasOwnProperty(i)) {
4238
- event[i] = evt[i];
4233
+ for (var i2 in evt) {
4234
+ if (evt.hasOwnProperty(i2)) {
4235
+ event[i2] = evt[i2];
4239
4236
  }
4240
4237
  }
4241
4238
  event.target = event.rootEl = nearest;
@@ -4484,8 +4481,8 @@ Sortable.prototype = /** @lends Sortable.prototype */
4484
4481
  }
4485
4482
  }
4486
4483
  },
4487
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e) {
4488
- var touch = e.touches ? e.touches[0] : e;
4484
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e2) {
4485
+ var touch = e2.touches ? e2.touches[0] : e2;
4489
4486
  if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
4490
4487
  this._disableDelayedDrag();
4491
4488
  }
@@ -5086,9 +5083,9 @@ Sortable.prototype = /** @lends Sortable.prototype */
5086
5083
  * @returns {String[]}
5087
5084
  */
5088
5085
  toArray: function toArray() {
5089
- var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
5090
- for (; i < n; i++) {
5091
- el = children[i];
5086
+ var order = [], el, children = this.el.children, i2 = 0, n = children.length, options = this.options;
5087
+ for (; i2 < n; i2++) {
5088
+ el = children[i2];
5092
5089
  if (closest(el, options.draggable, this.el, false)) {
5093
5090
  order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
5094
5091
  }
@@ -5101,8 +5098,8 @@ Sortable.prototype = /** @lends Sortable.prototype */
5101
5098
  */
5102
5099
  sort: function sort(order, useAnimation) {
5103
5100
  var items = {}, rootEl2 = this.el;
5104
- this.toArray().forEach(function(id, i) {
5105
- var el = rootEl2.children[i];
5101
+ this.toArray().forEach(function(id, i2) {
5102
+ var el = rootEl2.children[i2];
5106
5103
  if (closest(el, this.options.draggable, rootEl2, false)) {
5107
5104
  items[id] = el;
5108
5105
  }
@@ -5295,9 +5292,9 @@ function _getInsertDirection(target) {
5295
5292
  }
5296
5293
  }
5297
5294
  function _generateId(el) {
5298
- var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;
5299
- while (i--) {
5300
- sum += str.charCodeAt(i);
5295
+ var str = el.tagName + el.className + el.src + el.href + el.textContent, i2 = str.length, sum = 0;
5296
+ while (i2--) {
5297
+ sum += str.charCodeAt(i2);
5301
5298
  }
5302
5299
  return sum.toString(36);
5303
5300
  }
@@ -5489,9 +5486,9 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
5489
5486
  var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
5490
5487
  var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
5491
5488
  if (!autoScrolls[layersOut]) {
5492
- for (var i = 0; i <= layersOut; i++) {
5493
- if (!autoScrolls[i]) {
5494
- autoScrolls[i] = {};
5489
+ for (var i2 = 0; i2 <= layersOut; i2++) {
5490
+ if (!autoScrolls[i2]) {
5491
+ autoScrolls[i2] = {};
5495
5492
  }
5496
5493
  }
5497
5494
  }
@@ -5691,13 +5688,13 @@ const orderObjectsBy = (elements, order, path) => {
5691
5688
  return unique(orderedElements);
5692
5689
  };
5693
5690
  const forEach = (arr, cb, scope) => {
5694
- for (let i = 0; i < arr.length; i++) {
5695
- cb.call(scope, arr[i], i);
5691
+ for (let i2 = 0; i2 < arr.length; i2++) {
5692
+ cb.call(scope, arr[i2], i2);
5696
5693
  }
5697
5694
  };
5698
5695
  const map = (arr, cb) => {
5699
5696
  const newArray = [];
5700
- forEach(arr, (elem, i) => newArray.push(cb(elem, i)));
5697
+ forEach(arr, (elem, i2) => newArray.push(cb(elem, i2)));
5701
5698
  return newArray;
5702
5699
  };
5703
5700
  const sanitizedAttributeNames = {};
@@ -5716,7 +5713,6 @@ const safeAttrName = (name2) => {
5716
5713
  const capitalize = (str) => str.replace(/\b\w/g, (m) => m.toUpperCase());
5717
5714
  const copyObj = (obj) => window.JSON.parse(window.JSON.stringify(obj));
5718
5715
  const subtract = (arr, from) => from.filter((a) => !~arr.indexOf(a));
5719
- const isIE = () => window.navigator.userAgent.indexOf("MSIE ") !== -1;
5720
5716
  const helpers = {
5721
5717
  capitalize,
5722
5718
  safeAttrName,
@@ -5728,8 +5724,119 @@ const helpers = {
5728
5724
  indexOfNode,
5729
5725
  isInt,
5730
5726
  get,
5731
- orderObjectsBy,
5732
- isIE
5727
+ orderObjectsBy
5728
+ };
5729
+ const loaded = {
5730
+ js: /* @__PURE__ */ new Set(),
5731
+ css: /* @__PURE__ */ new Set(),
5732
+ formeoSprite: null
5733
+ };
5734
+ const ajax = (fileUrl, callback, onError = noop) => {
5735
+ return new Promise((resolve) => {
5736
+ return fetch(fileUrl).then((data) => {
5737
+ if (!data.ok) {
5738
+ return resolve(onError(data));
5739
+ }
5740
+ resolve(callback ? callback(data) : data);
5741
+ }).catch((err) => onError(err));
5742
+ });
5743
+ };
5744
+ const onLoadStylesheet = (elem, cb) => {
5745
+ elem.removeEventListener("load", onLoadStylesheet);
5746
+ cb(elem.src);
5747
+ };
5748
+ const onLoadJavascript = (elem, cb) => {
5749
+ elem.removeEventListener("load", onLoadJavascript);
5750
+ cb(elem.src);
5751
+ };
5752
+ const insertScript = (src) => {
5753
+ return new Promise((resolve, reject) => {
5754
+ if (loaded.js.has(src)) {
5755
+ return resolve(src);
5756
+ }
5757
+ loaded.js.add(src);
5758
+ const script = dom.create({
5759
+ tag: "script",
5760
+ attrs: {
5761
+ type: "text/javascript",
5762
+ async: true,
5763
+ src
5764
+ },
5765
+ action: {
5766
+ load: () => onLoadJavascript(script, resolve),
5767
+ error: () => reject(new Error(`${src} failed to load.`))
5768
+ }
5769
+ });
5770
+ document.head.appendChild(script);
5771
+ });
5772
+ };
5773
+ const insertStyle = (srcs) => {
5774
+ srcs = Array.isArray(srcs) ? srcs : [srcs];
5775
+ const promises = srcs.map(
5776
+ (src) => new Promise((resolve, reject) => {
5777
+ if (loaded.css.has(src)) {
5778
+ return resolve(src);
5779
+ }
5780
+ loaded.css.add(src);
5781
+ const styleLink = dom.create({
5782
+ tag: "link",
5783
+ attrs: {
5784
+ rel: "stylesheet",
5785
+ href: src
5786
+ },
5787
+ action: {
5788
+ load: () => onLoadStylesheet(styleLink, resolve),
5789
+ error: () => reject(new Error(`${(void 0).src} failed to load.`))
5790
+ }
5791
+ });
5792
+ document.head.appendChild(styleLink);
5793
+ })
5794
+ );
5795
+ return Promise.all(promises);
5796
+ };
5797
+ const insertScripts = (srcs) => {
5798
+ srcs = Array.isArray(srcs) ? srcs : [srcs];
5799
+ const promises = srcs.map((src) => insertScript(src));
5800
+ return Promise.all(promises);
5801
+ };
5802
+ const insertStyles = (srcs) => {
5803
+ srcs = Array.isArray(srcs) ? srcs : [srcs];
5804
+ const promises = srcs.map((src) => insertStyle(src));
5805
+ return Promise.all(promises);
5806
+ };
5807
+ const insertIcons = (iconSvgStr) => {
5808
+ const parser = new DOMParser();
5809
+ const svgDoc = parser.parseFromString(iconSvgStr, "image/svg+xml");
5810
+ loaded.formeoSprite = svgDoc.documentElement;
5811
+ return loaded.formeoSprite;
5812
+ };
5813
+ const fetchIcons = async (iconSpriteUrl = SVG_SPRITE_URL) => {
5814
+ if (loaded.formeoSprite) {
5815
+ return loaded.formeoSprite;
5816
+ }
5817
+ if (!iconSpriteUrl) {
5818
+ return insertIcons(BUNDLED_SVG_SPRITE);
5819
+ }
5820
+ const parseResp = async (resp) => insertIcons(await resp.text());
5821
+ return ajax(iconSpriteUrl, parseResp, () => ajax(FALLBACK_SVG_SPRITE_URL, parseResp));
5822
+ };
5823
+ const LOADER_MAP = {
5824
+ js: insertScripts,
5825
+ css: insertStyles
5826
+ };
5827
+ const fetchDependencies = (dependencies) => {
5828
+ const promises = Object.entries(dependencies).map(([type, src]) => {
5829
+ return LOADER_MAP[type](src);
5830
+ });
5831
+ return Promise.all(promises);
5832
+ };
5833
+ const fetchFormeoStyle = async (cssUrl) => {
5834
+ if (!loaded.css.has(cssUrl)) {
5835
+ await insertStyle(cssUrl);
5836
+ if (!loaded.css.has(FALLBACK_CSS_URL)) {
5837
+ return await insertStyle(FALLBACK_CSS_URL);
5838
+ }
5839
+ }
5733
5840
  };
5734
5841
  const iconFontTemplates = {
5735
5842
  glyphicons: (icon) => `<span class="glyphicon glyphicon-${icon}" aria-hidden="true"></span>`,
@@ -5824,7 +5931,7 @@ class DOM {
5824
5931
  processed.push("tag");
5825
5932
  let childType;
5826
5933
  const { tag } = elem;
5827
- let i;
5934
+ let i2;
5828
5935
  const wrap = {
5829
5936
  attrs: {},
5830
5937
  className: [helpers.get(elem, "config.inputWrap")],
@@ -5918,8 +6025,8 @@ class DOM {
5918
6025
  processed.push("action");
5919
6026
  }
5920
6027
  const remaining = helpers.subtract(processed, Object.keys(elem));
5921
- for (i = remaining.length - 1; i >= 0; i--) {
5922
- element[remaining[i]] = elem[remaining[i]];
6028
+ for (i2 = remaining.length - 1; i2 >= 0; i2--) {
6029
+ element[remaining[i2]] = elem[remaining[i2]];
5923
6030
  }
5924
6031
  if (wrap.children.length) {
5925
6032
  element = this.create(wrap);
@@ -5959,25 +6066,26 @@ class DOM {
5959
6066
  if (this.iconSymbols) {
5960
6067
  return this.iconSymbols;
5961
6068
  }
5962
- const iconSymbolNodes = document.querySelectorAll(`#${formeoSpriteId} svg symbol`);
5963
- const createSvgIconConfig = (symbolId) => ({
5964
- tag: "svg",
5965
- attrs: {
5966
- className: ["svg-icon", symbolId]
5967
- },
5968
- children: [
5969
- {
5970
- tag: "use",
5971
- attrs: {
5972
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
5973
- "xlink:href": `#${symbolId}`
5974
- }
5975
- }
5976
- ]
5977
- });
6069
+ const iconSymbolNodes = loaded.formeoSprite.querySelectorAll("svg symbol");
6070
+ const createSvgIconConfig = (symbol) => {
6071
+ const viewBox = symbol.getAttribute("viewBox") || "0 0 24 24";
6072
+ const children = Array.from(symbol.children).map((child) => {
6073
+ const clonedNode = child.cloneNode(true);
6074
+ return clonedNode.outerHTML;
6075
+ }).join("");
6076
+ return {
6077
+ tag: "svg",
6078
+ attrs: {
6079
+ className: ["svg-icon", symbol.id],
6080
+ viewBox,
6081
+ xmlns: "http://www.w3.org/2000/svg"
6082
+ },
6083
+ children
6084
+ };
6085
+ };
5978
6086
  this.iconSymbols = Array.from(iconSymbolNodes).reduce((acc, symbol) => {
5979
6087
  const name2 = symbol.id.replace(iconPrefix, "");
5980
- acc[name2] = createSvgIconConfig(symbol.id);
6088
+ acc[name2] = createSvgIconConfig(symbol);
5981
6089
  return acc;
5982
6090
  }, {});
5983
6091
  this.cachedIcons = {};
@@ -6085,19 +6193,19 @@ class DOM {
6085
6193
  });
6086
6194
  return elementsContainingText;
6087
6195
  };
6088
- generateOption = ({ type = "option", label, value, i = 0, selected }) => {
6196
+ generateOption = ({ type = "option", label, value, i: i2 = 0, selected }) => {
6089
6197
  const isOption = type === "option";
6090
6198
  return {
6091
6199
  tag: isOption ? "option" : "input",
6092
6200
  attrs: {
6093
6201
  type,
6094
- value: value || `${type}-${i}`,
6095
- [type === "option" ? "selected" : "checked"]: selected || !i
6202
+ value: value || `${type}-${i2}`,
6203
+ [type === "option" ? "selected" : "checked"]: selected || !i2
6096
6204
  },
6097
6205
  config: {
6098
6206
  label: label || mi18n.get("labelCount", {
6099
6207
  label: mi18n.get("option"),
6100
- count: i
6208
+ count: i2
6101
6209
  })
6102
6210
  }
6103
6211
  };
@@ -6113,7 +6221,7 @@ class DOM {
6113
6221
  const { action, attrs = {} } = elem;
6114
6222
  const fieldType = attrs.type || elem.tag;
6115
6223
  const id = attrs.id || elem.id;
6116
- const optionMap = (option2, i) => {
6224
+ const optionMap = (option2, i2) => {
6117
6225
  const { label, value, ...rest } = option2;
6118
6226
  const defaultInput = () => {
6119
6227
  const input = {
@@ -6122,7 +6230,7 @@ class DOM {
6122
6230
  name: id,
6123
6231
  type: fieldType,
6124
6232
  value: value || "",
6125
- id: `${id}-${i}`,
6233
+ id: `${id}-${i2}`,
6126
6234
  ...rest
6127
6235
  },
6128
6236
  action
@@ -6130,7 +6238,7 @@ class DOM {
6130
6238
  const optionLabel = {
6131
6239
  tag: "label",
6132
6240
  attrs: {
6133
- for: `${id}-${i}`
6241
+ for: `${id}-${i2}`
6134
6242
  },
6135
6243
  children: label
6136
6244
  };
@@ -6663,7 +6771,7 @@ class Autocomplete {
6663
6771
  * @return {Object} DOM Element to be injected into the form.
6664
6772
  */
6665
6773
  build() {
6666
- const keyboardNav = (e) => {
6774
+ const keyboardNav = (e2) => {
6667
6775
  const list = this.list;
6668
6776
  const activeOption = this.getActiveOption();
6669
6777
  const keyCodeMap = /* @__PURE__ */ new Map([
@@ -6700,7 +6808,7 @@ class Autocomplete {
6700
6808
  this.hideList();
6701
6809
  }
6702
6810
  }
6703
- e.preventDefault();
6811
+ e2.preventDefault();
6704
6812
  }
6705
6813
  ],
6706
6814
  [
@@ -6711,7 +6819,7 @@ class Autocomplete {
6711
6819
  }
6712
6820
  ]
6713
6821
  ]);
6714
- let direction = keyCodeMap.get(e.keyCode);
6822
+ let direction = keyCodeMap.get(e2.keyCode);
6715
6823
  if (!direction) {
6716
6824
  direction = () => false;
6717
6825
  }
@@ -7900,7 +8008,7 @@ class Panels {
7900
8008
  placement: "top"
7901
8009
  },
7902
8010
  action: {
7903
- click: (e) => this.nav.nextGroup(e)
8011
+ click: (e2) => this.nav.nextGroup(e2)
7904
8012
  },
7905
8013
  content: dom.icon("triangle-right")
7906
8014
  };
@@ -7916,7 +8024,7 @@ class Panels {
7916
8024
  placement: "top"
7917
8025
  },
7918
8026
  action: {
7919
- click: (e) => this.nav.prevGroup(e)
8027
+ click: (e2) => this.nav.prevGroup(e2)
7920
8028
  },
7921
8029
  content: dom.icon("triangle-left")
7922
8030
  };
@@ -8253,12 +8361,7 @@ class Component extends Data {
8253
8361
  return dom.create({
8254
8362
  tag: "span",
8255
8363
  className: ["component-tag", `${this.name}-tag`],
8256
- children: [
8257
- (this.isColumn || this.isField) && dom.icon("component-corner", { className: "bottom-left" }),
8258
- dom.icon(`handle-${this.name}`),
8259
- toTitleCase(this.name),
8260
- (this.isColumn || this.isRow) && dom.icon("component-corner", { className: "bottom-right" })
8261
- ].filter(Boolean)
8364
+ children: [dom.icon(`handle-${this.name}`), toTitleCase(this.name)].filter(Boolean)
8262
8365
  });
8263
8366
  };
8264
8367
  /**
@@ -9322,8 +9425,8 @@ class Row extends Component {
9322
9425
  if (typeof widths === "string") {
9323
9426
  widths = widths.split(",");
9324
9427
  }
9325
- this.children.forEach((column, i) => {
9326
- column.setWidth(`${widths[i]}%`);
9428
+ this.children.forEach((column, i2) => {
9429
+ column.setWidth(`${widths[i2]}%`);
9327
9430
  column.refreshFieldPanels();
9328
9431
  });
9329
9432
  };
@@ -9524,133 +9627,6 @@ let Stages$1 = class Stages extends ComponentData {
9524
9627
  }
9525
9628
  };
9526
9629
  const stages = new Stages$1();
9527
- const loaded = {
9528
- js: /* @__PURE__ */ new Set(),
9529
- css: /* @__PURE__ */ new Set()
9530
- };
9531
- const ajax = (fileUrl, callback, onError = noop) => {
9532
- return new Promise((resolve) => {
9533
- return fetch(fileUrl).then((data) => {
9534
- if (!data.ok) {
9535
- return resolve(onError(data));
9536
- }
9537
- resolve(callback ? callback(data) : data);
9538
- }).catch((err) => onError(err));
9539
- });
9540
- };
9541
- const onLoadStylesheet = (elem, cb) => {
9542
- elem.removeEventListener("load", onLoadStylesheet);
9543
- cb(elem.src);
9544
- };
9545
- const onLoadJavascript = (elem, cb) => {
9546
- elem.removeEventListener("load", onLoadJavascript);
9547
- cb(elem.src);
9548
- };
9549
- const insertScript = (src) => {
9550
- return new Promise((resolve, reject) => {
9551
- if (loaded.js.has(src)) {
9552
- return resolve(src);
9553
- }
9554
- loaded.js.add(src);
9555
- const script = dom.create({
9556
- tag: "script",
9557
- attrs: {
9558
- type: "text/javascript",
9559
- async: true,
9560
- src
9561
- },
9562
- action: {
9563
- load: () => onLoadJavascript(script, resolve),
9564
- error: () => reject(new Error(`${src} failed to load.`))
9565
- }
9566
- });
9567
- document.head.appendChild(script);
9568
- });
9569
- };
9570
- const insertStyle = (srcs) => {
9571
- srcs = Array.isArray(srcs) ? srcs : [srcs];
9572
- const promises = srcs.map(
9573
- (src) => new Promise((resolve, reject) => {
9574
- if (loaded.css.has(src)) {
9575
- return resolve(src);
9576
- }
9577
- loaded.css.add(src);
9578
- const styleLink = dom.create({
9579
- tag: "link",
9580
- attrs: {
9581
- rel: "stylesheet",
9582
- href: src
9583
- },
9584
- action: {
9585
- load: () => onLoadStylesheet(styleLink, resolve),
9586
- error: () => reject(new Error(`${(void 0).src} failed to load.`))
9587
- }
9588
- });
9589
- document.head.appendChild(styleLink);
9590
- })
9591
- );
9592
- return Promise.all(promises);
9593
- };
9594
- const insertScripts = (srcs) => {
9595
- srcs = Array.isArray(srcs) ? srcs : [srcs];
9596
- const promises = srcs.map((src) => insertScript(src));
9597
- return Promise.all(promises);
9598
- };
9599
- const insertStyles = (srcs) => {
9600
- srcs = Array.isArray(srcs) ? srcs : [srcs];
9601
- const promises = srcs.map((src) => insertStyle(src));
9602
- return Promise.all(promises);
9603
- };
9604
- const insertIcons = (iconSvgStr) => {
9605
- let iconSpriteWrap = document.getElementById(formeoSpriteId);
9606
- if (!iconSpriteWrap) {
9607
- iconSpriteWrap = dom.create({
9608
- id: formeoSpriteId,
9609
- children: iconSvgStr,
9610
- attrs: {
9611
- hidden: true,
9612
- style: "display: none;"
9613
- }
9614
- });
9615
- document.body.insertBefore(iconSpriteWrap, document.body.childNodes[0]);
9616
- }
9617
- return iconSpriteWrap;
9618
- };
9619
- const fetchIcons = async (iconSpriteUrl = SVG_SPRITE_URL) => {
9620
- const formeoSprite = document.getElementById(formeoSpriteId);
9621
- if (formeoSprite) {
9622
- return;
9623
- }
9624
- const parseResp = async (resp) => insertIcons(await resp.text());
9625
- return ajax(iconSpriteUrl, parseResp, () => ajax(FALLBACK_SVG_SPRITE_URL, parseResp));
9626
- };
9627
- const loadPolyfills = (polyfillConfig) => {
9628
- const polyfills = Array.isArray(polyfillConfig) ? POLYFILLS.filter(({ name: name2 }) => polyfillConfig.indexOf(name2) !== -1) : POLYFILLS;
9629
- return Promise.all(polyfills.map(({ src }) => insertScript(src)));
9630
- };
9631
- const LOADER_MAP = {
9632
- js: insertScripts,
9633
- css: insertStyles
9634
- };
9635
- const fetchDependencies = (dependencies) => {
9636
- const promises = Object.entries(dependencies).map(([type, src]) => {
9637
- return LOADER_MAP[type](src);
9638
- });
9639
- return Promise.all(promises);
9640
- };
9641
- const isCssLoaded = () => {
9642
- const formeoSprite = document.getElementById(formeoSpriteId);
9643
- const computedStyle = window.getComputedStyle(formeoSprite);
9644
- return computedStyle.visibility === "hidden";
9645
- };
9646
- const fetchFormeoStyle = async (cssUrl) => {
9647
- if (!isCssLoaded()) {
9648
- await insertStyle(cssUrl);
9649
- if (!isCssLoaded()) {
9650
- return await insertStyle(FALLBACK_CSS_URL);
9651
- }
9652
- }
9653
- };
9654
9630
  class Control {
9655
9631
  controlCache = /* @__PURE__ */ new Set();
9656
9632
  /**
@@ -9719,9 +9695,9 @@ class Control {
9719
9695
  * @return {String} the translated label
9720
9696
  */
9721
9697
  i18n(lookup, args) {
9722
- const locale = mi18n.locale;
9698
+ const locale2 = mi18n.locale;
9723
9699
  const controlTranslations = this.definition?.i18n;
9724
- const localeTranslations = controlTranslations?.[locale] || {};
9700
+ const localeTranslations = controlTranslations?.[locale2] || {};
9725
9701
  return (localeTranslations[lookup]?.() ?? localeTranslations[lookup]) || mi18n.get(lookup, args);
9726
9702
  }
9727
9703
  }
@@ -9972,12 +9948,12 @@ let Controls$1 = class Controls {
9972
9948
  // @todo finish the addGroup method
9973
9949
  addGroup: (group) => console.log(group)
9974
9950
  };
9975
- for (let i = groups.length - 1; i >= 0; i--) {
9976
- const storeID = `formeo-controls-${groups[i]}`;
9951
+ for (let i2 = groups.length - 1; i2 >= 0; i2--) {
9952
+ const storeID = `formeo-controls-${groups[i2]}`;
9977
9953
  if (!this.options.sortable) {
9978
9954
  window.localStorage.removeItem(storeID);
9979
9955
  }
9980
- Sortable.create(groups[i], {
9956
+ Sortable.create(groups[i2], {
9981
9957
  animation: 150,
9982
9958
  forceFallback: true,
9983
9959
  fallbackClass: "control-moving",
@@ -10698,8 +10674,10 @@ const actions = {
10698
10674
  }
10699
10675
  }
10700
10676
  };
10701
- const enUS = void 0;
10702
- mi18n.addLanguage("en-US", enUS);
10677
+ const e = { "en-US": { "en-US": "English", dir: "ltr", "af-ZA": "Afrikaans (South Africa)", "ar-TN": "Arabic (Tunisia)", "cs-CZ": "Czech (Czechia)", "de-DE": "German (Germany)", "es-ES": "European Spanish", "fa-IR": "Persian (Iran)", "fi-FI": "Finnish (Finland)", "fr-FR": "French (France)", "hu-HU": "Hungarian (Hungary)", "it-IT": "Italian (Italy)", "ja-JP": "Japanese (Japan)", "nb-NO": "Norwegian Bokmål (Norway)", "pl-PL": "Polish (Poland)", "pt-BR": "Brazilian Portuguese", "pt-PT": "European Portuguese", "ro-RO": "Romanian (Romania)", "ru-RU": "Russian (Russia)", "th-TH": "Thai (Thailand)", "tr-TR": "Turkish (Türkiye)", "zh-CN": "Chinese (China)", "zh-HK": "Chinese (Hong Kong SAR China)", "action.add.attrs.attr": "What attribute would you like to add?", "action.add.attrs.value": "Default Value", addOption: "Add Option", allFieldsRemoved: "All fields were removed.", allowSelect: "Allow Select", and: "and", attribute: "Attribute", attributeNotPermitted: 'Attribute "{attribute}" is not permitted, please choose another.', attributes: "Attributes", "attrs.class": "Class", "attrs.className": "Class", "attrs.dir": "Direction", "attrs.id": "Id", "attrs.required": "Required", "attrs.style": "Style", "attrs.title": "Title", "attrs.type": "Type", "attrs.value": "Value", autocomplete: "Autocomplete", button: "Button", cannotBeEmpty: "This field cannot be empty", cannotClearFields: "There are no fields to clear", checkbox: "Checkbox", checkboxes: "Checkboxes", class: "Class", clear: "Clear", clearAllMessage: "Are you sure you want to clear all fields?", close: "Close", column: "Column", "condition.target.placeholder": "target", "condition.type.and": "And", "condition.type.if": "If", "condition.type.or": "Or", "condition.type.then": "Then", "condition.value.placeholder": "value", confirmClearAll: "Are you sure you want to remove all fields?", content: "Content", control: "Control", "controlGroups.nextGroup": "Next Group", "controlGroups.prevGroup": "Previous Group", "controls.filteringTerm": 'Filtering "{term}"', "controls.form.button": "Button", "controls.form.checkbox-group": "Checkbox Group", "controls.form.input.date": "Date", "controls.form.input.email": "Email", "controls.form.input.file": "File Upload", "controls.form.input.hidden": "Hidden Input", "controls.form.input.number": "Number", "controls.form.input.text": "Text Input", "controls.form.radio-group": "Radio Group", "controls.form.select": "Select", "controls.form.textarea": "TextArea", "controls.groups.form": "Form Fields", "controls.groups.html": "HTML Elements", "controls.groups.layout": "Layout", "controls.html.divider": "Divider", "controls.html.header": "Header", "controls.html.paragraph": "Paragraph", "controls.layout.column": "Column", "controls.layout.row": "Row", copy: "Copy To Clipboard", danger: "Danger", defineColumnLayout: "Define a column layout", defineColumnWidths: "Define column widths", description: "Help Text", descriptionField: "Description", "editing.row": "Editing Row", editorTitle: "Form Elements", field: "Field", "field.property.invalid": "not valid", "field.property.isChecked": "is checked", "field.property.isNotVisible": "is not visible", "field.property.isVisible": "is visible", "field.property.label": "label", "field.property.valid": "valid", "field.property.value": "value", fieldNonEditable: "This field cannot be edited.", fieldRemoveWarning: "Are you sure you want to remove this field?", fileUpload: "File Upload", formUpdated: "Form Updated", getStarted: "Drag a field from the right to get started.", group: "Group", grouped: "Grouped", hidden: "Hidden Input", hide: "Edit", htmlElements: "HTML Elements", if: "If", "if.condition.source.placeholder": "source", "if.condition.target.placeholder": "target / value", info: "Info", "input.date": "Date", "input.text": "Text", label: "Label", labelCount: "{label} {count}", labelEmpty: "Field Label cannot be empty", "lang.af": "Afrikaans", "lang.ar": "Arabic", "lang.cs": "Czech", "lang.de": "German", "lang.en": "English", "lang.es": "Spanish", "lang.fa": "Persian", "lang.fi": "Finnish", "lang.fr": "French", "lang.hu": "Hungarian", "lang.it": "Italian", "lang.ja": "Japanese", "lang.nb": "Norwegian Bokmål", "lang.pl": "Polish", "lang.pt": "Portuguese", "lang.ro": "Romanian", "lang.ru": "Russian", "lang.th": "Thai", "lang.tr": "Turkish", "lang.zh": "Chinese", layout: "Layout", limitRole: "Limit access to one or more of the following roles:", mandatory: "Mandatory", maxlength: "Max Length", "meta.group": "Group", "meta.icon": "Ico", "meta.label": "Label", minOptionMessage: "This field requires a minimum of 2 options", name: "Name", newOptionLabel: "New {type}", no: "No", number: "Number", off: "Off", on: "On", "operator.contains": "contains", "operator.equals": "equals", "operator.notContains": "not contains", "operator.notEquals": "not equal", "operator.notVisible": "not visible", "operator.visible": "visible", option: "Option", optional: "optional", optionEmpty: "Option value required", optionLabel: "Option {count}", options: "Options", or: "or", order: "Order", "panel.label.attrs": "Attributes", "panel.label.conditions": "Conditions", "panel.label.config": "Configuration", "panel.label.meta": "Meta", "panel.label.options": "Options", "panelEditButtons.attrs": "+ Attribute", "panelEditButtons.conditions": "+ Condition", "panelEditButtons.options": "+ Option", placeholder: "Placeholder", "placeholder.className": "space separated classes", "placeholder.email": "Enter you email", "placeholder.label": "Label", "placeholder.password": "Enter your password", "placeholder.placeholder": "Placeholder", "placeholder.text": "Enter some Text", "placeholder.textarea": "Enter a lot of text", "placeholder.value": "Value", preview: "Preview", primary: "Primary", remove: "Remove", removeMessage: "Remove Element", removeType: "Remove {type}", required: "Required", reset: "Reset", richText: "Rich Text Editor", roles: "Access", row: "Row", "row.makeInputGroup": "Make this row an input group.", "row.makeInputGroupDesc": "Input Groups enable users to add sets of inputs at a time.", "row.settings.fieldsetWrap": "Wrap row in a &lt;fieldset&gt; tag", "row.settings.fieldsetWrap.aria": "Wrap Row in Fieldset", save: "Save", secondary: "Secondary", select: "Select", selectColor: "Select Color", selectionsMessage: "Allow Multiple Selections", selectOptions: "Options", separator: "Separator", settings: "Settings", size: "Size", sizes: "Sizes", "sizes.lg": "Large", "sizes.m": "Default", "sizes.sm": "Small", "sizes.xs": "Extra Small", style: "Style", styles: "Styles", "styles.btn": "Button Style", "styles.btn.danger": "Danger", "styles.btn.default": "Default", "styles.btn.info": "Info", "styles.btn.primary": "Primary", "styles.btn.success": "Success", "styles.btn.warning": "Warning", subtype: "Type", success: "Success", text: "Text Field", then: "Then", "then.condition.target.placeholder": "target", toggle: "Toggle", ungrouped: "Un-Grouped", warning: "Warning", yes: "Yes" } }, i = e["en-US"];
10678
+ const locale = "en-US";
10679
+ mi18n.addLanguage(locale, i);
10680
+ mi18n.setCurrent(locale);
10703
10681
  const defaults = {
10704
10682
  get editor() {
10705
10683
  return {
@@ -10710,8 +10688,8 @@ const defaults = {
10710
10688
  sessionStorage: false,
10711
10689
  editorContainer: null,
10712
10690
  // element or selector to attach editor to
10713
- svgSprite: SVG_SPRITE_URL,
10714
- // change to null
10691
+ svgSprite: null,
10692
+ // null = use bundled sprite, or provide custom URL
10715
10693
  style: CSS_URL,
10716
10694
  // change to null
10717
10695
  iconFont: null,
@@ -10721,8 +10699,6 @@ const defaults = {
10721
10699
  events: {},
10722
10700
  actions: {},
10723
10701
  controls: {},
10724
- polyfills: isIE(),
10725
- // loads csspreloadrel
10726
10702
  i18n: {
10727
10703
  location: "https://draggable.github.io/formeo/assets/lang/"
10728
10704
  },
@@ -10731,6 +10707,7 @@ const defaults = {
10731
10707
  };
10732
10708
  }
10733
10709
  };
10710
+ new SmartTooltip();
10734
10711
  let FormeoEditor$1 = class FormeoEditor {
10735
10712
  /**
10736
10713
  * @param {Object} options formeo options
@@ -10751,7 +10728,6 @@ let FormeoEditor$1 = class FormeoEditor {
10751
10728
  this.dom = dom;
10752
10729
  events.init({ debug, ...events$1 });
10753
10730
  actions.init({ debug, sessionStorage: opts.sessionStorage, ...actions$1 });
10754
- this.tooltip = new SmartTooltip();
10755
10731
  if (document.readyState === "loading") {
10756
10732
  document.addEventListener("DOMContentLoaded", this.loadResources.bind(this));
10757
10733
  } else {
@@ -10787,17 +10763,15 @@ let FormeoEditor$1 = class FormeoEditor {
10787
10763
  async loadResources() {
10788
10764
  document.removeEventListener("DOMContentLoaded", this.loadResources);
10789
10765
  const promises = [];
10790
- if (this.opts.polyfills) {
10791
- loadPolyfills(this.opts.polyfills);
10792
- }
10793
- await fetchIcons(this.opts.svgSprite);
10794
- promises.push(fetchFormeoStyle(this.opts.style));
10795
- promises.push(mi18n.init({ ...this.opts.i18n, locale: window.sessionStorage?.getItem(SESSION_LOCALE_KEY) }));
10796
- const resolvedPromises = await Promise.all(promises);
10766
+ promises.push(
10767
+ fetchIcons(this.opts.svgSprite),
10768
+ fetchFormeoStyle(this.opts.style),
10769
+ mi18n.init({ ...this.opts.i18n, locale: globalThis.sessionStorage?.getItem(SESSION_LOCALE_KEY) })
10770
+ );
10771
+ await Promise.all(promises);
10797
10772
  if (this.opts.allowEdit) {
10798
10773
  this.init();
10799
10774
  }
10800
- return resolvedPromises;
10801
10775
  }
10802
10776
  /**
10803
10777
  * Formeo initializer
@@ -10857,7 +10831,7 @@ let FormeoEditor$1 = class FormeoEditor {
10857
10831
  dom.empty(this.editorContainer);
10858
10832
  this.editorContainer.appendChild(this.editor);
10859
10833
  }
10860
- events.formeoLoaded = new window.CustomEvent("formeoLoaded", {
10834
+ events.formeoLoaded = new globalThis.CustomEvent("formeoLoaded", {
10861
10835
  detail: {
10862
10836
  formeo: this
10863
10837
  }
@@ -11113,8 +11087,8 @@ let FormeoRenderer$1 = class FormeoRenderer {
11113
11087
  },
11114
11088
  children: "Add +",
11115
11089
  action: {
11116
- click: (e) => {
11117
- const fInputGroup = e.target.parentElement;
11090
+ click: (e2) => {
11091
+ const fInputGroup = e2.target.parentElement;
11118
11092
  const elem = dom.create(this.cloneComponentData(id));
11119
11093
  fInputGroup.insertBefore(elem, fInputGroup.lastChild);
11120
11094
  const removeButton = dom.create(createRemoveButton());
@@ -11347,15 +11321,15 @@ class ButtonControl extends Control {
11347
11321
  super(mergedConfig);
11348
11322
  }
11349
11323
  }
11350
- const generateOptionConfig = ({ type, isMultiple = false, count = 3 }) => Array.from({ length: count }, (_v, k) => k + 1).map((i) => {
11324
+ const generateOptionConfig = ({ type, isMultiple = false, count = 3 }) => Array.from({ length: count }, (_v, k) => k + 1).map((i2) => {
11351
11325
  const selectedKey = type === "checkbox" || isMultiple ? "checked" : "selected";
11352
11326
  return {
11353
11327
  label: mi18n.get("labelCount", {
11354
11328
  label: toTitleCase(type),
11355
- count: i
11329
+ count: i2
11356
11330
  }),
11357
- value: `${type}-${i}`,
11358
- [selectedKey]: !i
11331
+ value: `${type}-${i2}`,
11332
+ [selectedKey]: !i2
11359
11333
  };
11360
11334
  });
11361
11335
  class CheckboxGroupControl extends Control {