formeo 5.1.1 → 5.1.2
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/README.md +3 -3
- package/dist/demo/assets/css/demo.min.css +1 -1
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +1 -1
- package/dist/demo/assets/js/demo.min.js +55 -55
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/form.min.js +1 -1
- package/dist/demo/assets/js/formeo.cjs.js +88 -36
- package/dist/demo/assets/js/formeo.es.js +88 -36
- package/dist/demo/assets/js/formeo.min.cjs.js +2 -2
- package/dist/demo/assets/js/formeo.min.es.js +2 -2
- package/dist/demo/assets/js/formeo.min.js +88 -36
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +88 -36
- package/dist/demo/assets/js/html.min.js +1 -1
- package/dist/demo/assets/js/layout.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js.gz +0 -0
- package/dist/demo/assets/js/theme-github_light_default.min.js +1 -1
- package/dist/demo/index.html +1 -1
- package/dist/formeo.cjs.js +88 -36
- package/dist/formeo.css +1 -1
- package/dist/formeo.es.js +88 -36
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +1 -1
- package/dist/formeo.min.es.js +2 -2
- package/dist/formeo.min.js +88 -36
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +88 -36
- package/package.json +1 -1
- package/dist/demo/assets/lang/af-ZA.json +0 -1
- package/dist/demo/assets/lang/af-ZA.lang +0 -238
- package/dist/demo/assets/lang/ar-TN.json +0 -1
- package/dist/demo/assets/lang/ar-TN.lang +0 -238
- package/dist/demo/assets/lang/cs-CZ.json +0 -1
- package/dist/demo/assets/lang/cs-CZ.lang +0 -238
- package/dist/demo/assets/lang/de-DE.json +0 -1
- package/dist/demo/assets/lang/de-DE.lang +0 -238
- package/dist/demo/assets/lang/en-US.json +0 -1
- package/dist/demo/assets/lang/en-US.lang +0 -234
- package/dist/demo/assets/lang/es-ES.json +0 -1
- package/dist/demo/assets/lang/es-ES.lang +0 -238
- package/dist/demo/assets/lang/fa-IR.json +0 -1
- package/dist/demo/assets/lang/fa-IR.lang +0 -238
- package/dist/demo/assets/lang/fi-FI.json +0 -1
- package/dist/demo/assets/lang/fi-FI.lang +0 -238
- package/dist/demo/assets/lang/fr-FR.json +0 -1
- package/dist/demo/assets/lang/fr-FR.lang +0 -238
- package/dist/demo/assets/lang/he-IL.json +0 -1
- package/dist/demo/assets/lang/he-IL.lang +0 -238
- package/dist/demo/assets/lang/hi-IN.json +0 -1
- package/dist/demo/assets/lang/hi-IN.lang +0 -238
- package/dist/demo/assets/lang/hu-HU.json +0 -1
- package/dist/demo/assets/lang/hu-HU.lang +0 -238
- package/dist/demo/assets/lang/it-IT.json +0 -1
- package/dist/demo/assets/lang/it-IT.lang +0 -238
- package/dist/demo/assets/lang/ja-JP.json +0 -1
- package/dist/demo/assets/lang/ja-JP.lang +0 -238
- package/dist/demo/assets/lang/nb-NO.json +0 -1
- package/dist/demo/assets/lang/nb-NO.lang +0 -238
- package/dist/demo/assets/lang/pl-PL.json +0 -1
- package/dist/demo/assets/lang/pl-PL.lang +0 -238
- package/dist/demo/assets/lang/pt-BR.json +0 -1
- package/dist/demo/assets/lang/pt-BR.lang +0 -238
- package/dist/demo/assets/lang/pt-PT.json +0 -1
- package/dist/demo/assets/lang/pt-PT.lang +0 -238
- package/dist/demo/assets/lang/ro-RO.json +0 -1
- package/dist/demo/assets/lang/ro-RO.lang +0 -238
- package/dist/demo/assets/lang/ru-RU.json +0 -1
- package/dist/demo/assets/lang/ru-RU.lang +0 -238
- package/dist/demo/assets/lang/th-TH.json +0 -1
- package/dist/demo/assets/lang/th-TH.lang +0 -238
- package/dist/demo/assets/lang/tr-TR.json +0 -1
- package/dist/demo/assets/lang/tr-TR.lang +0 -238
- package/dist/demo/assets/lang/zh-CN.json +0 -1
- package/dist/demo/assets/lang/zh-CN.lang +0 -238
- package/dist/demo/assets/lang/zh-HK.json +0 -1
- package/dist/demo/assets/lang/zh-HK.lang +0 -238
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 5.1.
|
|
4
|
+
Version: 5.1.1
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -74,7 +74,7 @@ Author: Draggable https://draggable.io
|
|
|
74
74
|
allowSelect: "Laat Kies toe",
|
|
75
75
|
and: "en",
|
|
76
76
|
attribute: "kenmerk",
|
|
77
|
-
attributeNotPermitted:
|
|
77
|
+
attributeNotPermitted: "Attribuut \"{attribuut}\" is nie toegelaat nie, kies asseblief 'n ander.",
|
|
78
78
|
attributes: "eienskappe",
|
|
79
79
|
"attrs.class": "klas",
|
|
80
80
|
"attrs.className": "klas",
|
|
@@ -2127,7 +2127,7 @@ Author: Draggable https://draggable.io
|
|
|
2127
2127
|
"row.makeInputGroup": "Définir cette ligne comme groupe de saisie.",
|
|
2128
2128
|
"row.makeInputGroupDesc": "Les groupes de saisie permettent aux usagers de rajouter de multiples champs à la fois.",
|
|
2129
2129
|
"row.settings.fieldsetWrap": "Entourer le champ d'un élément <fieldset>",
|
|
2130
|
-
"row.settings.fieldsetWrap.aria":
|
|
2130
|
+
"row.settings.fieldsetWrap.aria": "Entourer le champ d'un \"Fieldset\"",
|
|
2131
2131
|
save: "Sauvegarder",
|
|
2132
2132
|
secondary: "Secondaire",
|
|
2133
2133
|
select: "Sélection",
|
|
@@ -2902,7 +2902,7 @@ Author: Draggable https://draggable.io
|
|
|
2902
2902
|
allowSelect: "Consenti selezione",
|
|
2903
2903
|
and: "e",
|
|
2904
2904
|
attribute: "Attributo",
|
|
2905
|
-
attributeNotPermitted:
|
|
2905
|
+
attributeNotPermitted: "L'attributo \"{attribute}\" non è permesso, per favore sceglierne un altro.",
|
|
2906
2906
|
attributes: "attributi",
|
|
2907
2907
|
"attrs.class": "Classe",
|
|
2908
2908
|
"attrs.className": "Classe",
|
|
@@ -5711,10 +5711,10 @@ Author: Draggable https://draggable.io
|
|
|
5711
5711
|
//#region node_modules/@draggable/formeo-languages/dist/formeo-languages.es.js
|
|
5712
5712
|
/**
|
|
5713
5713
|
@draggable/formeo-languages - https://github.com/Draggable/formeo-languages#readme
|
|
5714
|
-
Version: 3.
|
|
5714
|
+
Version: 3.5.0
|
|
5715
5715
|
Author: Kevin Chappell <kevin.b.chappell@gmail.com> (https://kevin-chappell.com)
|
|
5716
5716
|
*/
|
|
5717
|
-
var
|
|
5717
|
+
var s$1 = e$1["en-US"];
|
|
5718
5718
|
e$1["es-ES"];
|
|
5719
5719
|
e$1["fa-IR"];
|
|
5720
5720
|
e$1["fi-FI"];
|
|
@@ -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.1.
|
|
6067
|
+
version$2 = "5.1.1";
|
|
6068
6068
|
type = "module";
|
|
6069
6069
|
main = "dist/formeo.cjs.js";
|
|
6070
6070
|
module$1 = "dist/formeo.es.js";
|
|
@@ -10070,7 +10070,7 @@ Author: Draggable https://draggable.io
|
|
|
10070
10070
|
}, _typeof(o);
|
|
10071
10071
|
}
|
|
10072
10072
|
function userAgent(pattern) {
|
|
10073
|
-
if (typeof window !== "undefined" && window.navigator) return
|
|
10073
|
+
if (typeof window !== "undefined" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern);
|
|
10074
10074
|
}
|
|
10075
10075
|
function on(el, event, fn) {
|
|
10076
10076
|
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
|
@@ -17900,7 +17900,7 @@ Author: Draggable https://draggable.io
|
|
|
17900
17900
|
fetchIcons(this.opts.svgSprite),
|
|
17901
17901
|
fetchFormeoStyle(this.opts.style),
|
|
17902
17902
|
s.init({
|
|
17903
|
-
preloaded: { "en-US":
|
|
17903
|
+
preloaded: { "en-US": s$1 },
|
|
17904
17904
|
...this.opts.i18n,
|
|
17905
17905
|
locale: globalThis.sessionStorage?.getItem(SESSION_LOCALE_KEY)
|
|
17906
17906
|
})
|
|
@@ -18076,20 +18076,56 @@ Author: Draggable https://draggable.io
|
|
|
18076
18076
|
};
|
|
18077
18077
|
var isVisible = (elem) => {
|
|
18078
18078
|
if (!elem) return false;
|
|
18079
|
-
if (elem.hasAttribute("hidden") || elem.parentElement
|
|
18079
|
+
if (elem.hasAttribute("hidden") || elem.parentElement?.hasAttribute("hidden")) return false;
|
|
18080
18080
|
const computedStyle = window.getComputedStyle(elem);
|
|
18081
18081
|
return !(computedStyle.display === "none" || computedStyle.visibility === "hidden" || computedStyle.opacity === "0");
|
|
18082
18082
|
};
|
|
18083
|
+
var CHECKABLE_INPUT_SELECTOR = "input[type=\"checkbox\"], input[type=\"radio\"]";
|
|
18084
|
+
var CHECKABLE_TYPES = new Set(["checkbox", "radio"]);
|
|
18085
|
+
var tagName$1 = (elem) => elem?.tagName?.toLowerCase();
|
|
18086
|
+
var isCheckableInput = (elem) => tagName$1(elem) === "input" && CHECKABLE_TYPES.has(elem.type);
|
|
18087
|
+
/**
|
|
18088
|
+
* Radio and checkbox fields render as a wrapper holding one input per option, so a
|
|
18089
|
+
* field address resolves to the wrapper rather than to anything carrying a value.
|
|
18090
|
+
* @param {Element} elem
|
|
18091
|
+
* @return {Array<Element>|null} option inputs, or null when elem is not a group
|
|
18092
|
+
*/
|
|
18093
|
+
var checkableGroupInputs = (elem) => {
|
|
18094
|
+
if (!elem || isCheckableInput(elem) || typeof elem.querySelectorAll !== "function") return null;
|
|
18095
|
+
const inputs = elem.querySelectorAll(CHECKABLE_INPUT_SELECTOR);
|
|
18096
|
+
return inputs.length ? Array.from(inputs) : null;
|
|
18097
|
+
};
|
|
18098
|
+
var isCheckableGroup = (elem) => Boolean(checkableGroupInputs(elem));
|
|
18099
|
+
/**
|
|
18100
|
+
* Value a condition compares against. Controls that can hold several values at once
|
|
18101
|
+
* yield an array so that a single selection still matches an `equals` comparison.
|
|
18102
|
+
* @param {Element} elem
|
|
18103
|
+
* @return {String|Array<String>|undefined}
|
|
18104
|
+
*/
|
|
18105
|
+
var elementValue = (elem) => {
|
|
18106
|
+
if (!elem) return;
|
|
18107
|
+
const groupInputs = checkableGroupInputs(elem);
|
|
18108
|
+
if (groupInputs) {
|
|
18109
|
+
const checkedValues = groupInputs.filter((input) => input.checked).map((input) => input.value);
|
|
18110
|
+
return groupInputs.every((input) => input.type === "radio") ? checkedValues[0] ?? "" : checkedValues;
|
|
18111
|
+
}
|
|
18112
|
+
if (tagName$1(elem) === "select" && elem.multiple) return Array.from(elem.selectedOptions, (option) => option.value);
|
|
18113
|
+
if (isCheckableInput(elem)) return elem.checked ? elem.value : "";
|
|
18114
|
+
return elem.value;
|
|
18115
|
+
};
|
|
18116
|
+
var isChecked = (elem) => {
|
|
18117
|
+
const groupInputs = checkableGroupInputs(elem);
|
|
18118
|
+
return groupInputs ? groupInputs.some((input) => input.checked) : Boolean(elem?.checked);
|
|
18119
|
+
};
|
|
18083
18120
|
var propertyMap = {
|
|
18084
18121
|
isChecked: (elem) => {
|
|
18085
|
-
return elem
|
|
18122
|
+
return isChecked(elem);
|
|
18086
18123
|
},
|
|
18087
18124
|
isNotChecked: (elem) => {
|
|
18088
|
-
return !elem
|
|
18089
|
-
},
|
|
18090
|
-
value: (elem) => {
|
|
18091
|
-
return elem.value;
|
|
18125
|
+
return !isChecked(elem);
|
|
18092
18126
|
},
|
|
18127
|
+
value: elementValue,
|
|
18128
|
+
checked: elementValue,
|
|
18093
18129
|
isVisible: (elem) => {
|
|
18094
18130
|
return isVisible(elem);
|
|
18095
18131
|
},
|
|
@@ -18106,11 +18142,16 @@ Author: Draggable https://draggable.io
|
|
|
18106
18142
|
click: ({ target }) => target.parentElement.remove()
|
|
18107
18143
|
}
|
|
18108
18144
|
});
|
|
18145
|
+
var equals = (source, target) => Array.isArray(source) ? source.some((value) => (0, import_isEqual.default)(value, target)) : (0, import_isEqual.default)(source, target);
|
|
18146
|
+
var contains = (source, target) => {
|
|
18147
|
+
if (source == null) return false;
|
|
18148
|
+
return Array.isArray(source) ? source.includes(target) : String(source).includes(target);
|
|
18149
|
+
};
|
|
18109
18150
|
var comparisonHandlers = {
|
|
18110
|
-
equals
|
|
18111
|
-
notEquals: (source, target) => !(
|
|
18112
|
-
contains
|
|
18113
|
-
notContains: (source, target) => !source
|
|
18151
|
+
equals,
|
|
18152
|
+
notEquals: (source, target) => !equals(source, target),
|
|
18153
|
+
contains,
|
|
18154
|
+
notContains: (source, target) => !contains(source, target)
|
|
18114
18155
|
};
|
|
18115
18156
|
var comparisonMap = Object.entries(COMPARISON_OPERATORS).reduce((acc, [key, value]) => {
|
|
18116
18157
|
acc[value] = comparisonHandlers[key];
|
|
@@ -18378,7 +18419,8 @@ Author: Draggable https://draggable.io
|
|
|
18378
18419
|
* @return {Array} flattened array of conditions
|
|
18379
18420
|
*/
|
|
18380
18421
|
handleComponentCondition = (component, ifRest, thenConditions) => {
|
|
18381
|
-
if (component
|
|
18422
|
+
if (!component) return;
|
|
18423
|
+
if (isNodeCollection(component)) {
|
|
18382
18424
|
for (const elem of component) this.handleComponentCondition(elem, ifRest, thenConditions);
|
|
18383
18425
|
return;
|
|
18384
18426
|
}
|
|
@@ -18390,23 +18432,25 @@ Author: Draggable https://draggable.io
|
|
|
18390
18432
|
if (this.evaluateCondition(ifRest, fakeEvt)) for (const thenCondition of thenConditions) this.execResult(thenCondition, fakeEvt);
|
|
18391
18433
|
};
|
|
18392
18434
|
applyConditions = () => {
|
|
18393
|
-
for (const { conditions } of Object.values(this.components))
|
|
18394
|
-
|
|
18395
|
-
for (const
|
|
18396
|
-
const {
|
|
18397
|
-
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
|
|
18401
|
-
}
|
|
18402
|
-
if (isAddress(target)) {
|
|
18403
|
-
const { component, options } = this.getComponent(target);
|
|
18404
|
-
const targetComponent = options || component;
|
|
18405
|
-
this.handleComponentCondition(targetComponent, ifCondition, thenConditions);
|
|
18435
|
+
for (const { conditions } of Object.values(this.components)) {
|
|
18436
|
+
if (!conditions) continue;
|
|
18437
|
+
for (const condition of conditions) {
|
|
18438
|
+
const { if: ifConditions = [], then: thenConditions = [] } = condition;
|
|
18439
|
+
for (const ifCondition of ifConditions) try {
|
|
18440
|
+
this.applyCondition(ifCondition, thenConditions);
|
|
18441
|
+
} catch (err) {
|
|
18442
|
+
console.error("formeo: condition skipped", ifCondition, err);
|
|
18406
18443
|
}
|
|
18407
18444
|
}
|
|
18408
18445
|
}
|
|
18409
18446
|
};
|
|
18447
|
+
applyCondition = (ifCondition, thenConditions) => {
|
|
18448
|
+
for (const address of [ifCondition.source, ifCondition.target]) {
|
|
18449
|
+
if (!isAddress(address)) continue;
|
|
18450
|
+
const { component, options } = this.getComponent(address);
|
|
18451
|
+
this.handleComponentCondition(options || component, ifCondition, thenConditions);
|
|
18452
|
+
}
|
|
18453
|
+
};
|
|
18410
18454
|
/**
|
|
18411
18455
|
* Evaulate conditions
|
|
18412
18456
|
*/
|
|
@@ -18428,9 +18472,10 @@ Author: Draggable https://draggable.io
|
|
|
18428
18472
|
}
|
|
18429
18473
|
};
|
|
18430
18474
|
getComponentProperty = (address, propertyName) => {
|
|
18431
|
-
const { component, option } = this.getComponent(address);
|
|
18475
|
+
const { component, option } = this.getComponent(address) || {};
|
|
18432
18476
|
const elem = option || component;
|
|
18433
|
-
|
|
18477
|
+
if (!elem) return;
|
|
18478
|
+
return propertyMap[propertyName] ? propertyMap[propertyName](elem) : elem[propertyName];
|
|
18434
18479
|
};
|
|
18435
18480
|
getComponent = (address) => {
|
|
18436
18481
|
const result = { component: null };
|
|
@@ -18455,7 +18500,14 @@ Author: Draggable https://draggable.io
|
|
|
18455
18500
|
return components;
|
|
18456
18501
|
};
|
|
18457
18502
|
};
|
|
18458
|
-
var
|
|
18503
|
+
var isDomNode = (value) => Boolean(value) && typeof value.nodeType === "number";
|
|
18504
|
+
var isNodeCollection = (value) => Boolean(value) && !isDomNode(value) && typeof value.length === "number";
|
|
18505
|
+
var tagName = (component) => component.tagName?.toLowerCase();
|
|
18506
|
+
var listenTypeMap = [
|
|
18507
|
+
["change", (component) => isCheckableGroup(component)],
|
|
18508
|
+
["change", (component) => tagName(component) === "select" || ["checkbox", "radio"].includes(component.type)],
|
|
18509
|
+
["input", (component) => ["input", "textarea"].includes(tagName(component))]
|
|
18510
|
+
];
|
|
18459
18511
|
var LISTEN_TYPE_MAP = (component) => {
|
|
18460
18512
|
const [listenerEvent] = listenTypeMap.find((typeMap) => typeMap[1](component)) || [false];
|
|
18461
18513
|
return listenerEvent;
|