1
1
/*!
2
- * Vueform v1.12.10 (https://github.com/vueform/vueform)
2
+ * Vueform v1.12.11 (https://github.com/vueform/vueform)
3
3
* Copyright (c) 2025 Adam Berecz <adam@vueform.com>
4
4
* Licensed under the MIT License
5
5
*/
@@ -9383,6 +9383,14 @@ function trim(string, chars, guard) {
9383
9383
9384
9384
var trim_1 = trim;
9385
9385
9386
+ function localize(object, $config, form$) {
9387
+ var locale = form$.locale$ || $config.i18n.locale;
9388
+ if (!locale) {
9389
+ return object;
9390
+ }
9391
+ return object && typeof object === 'object' ? (object === null || object === void 0 ? void 0 : object[locale]) || (object === null || object === void 0 ? void 0 : object[locale.toUpperCase()]) || (object === null || object === void 0 ? void 0 : object[$config.i18n.fallbackLocale]) || (object === null || object === void 0 ? void 0 : object[$config.i18n.fallbackLocale.toUpperCase()]) || (object === null || object === void 0 ? void 0 : object[Object.keys(object)[0]]) || '' : object;
9392
+ }
9393
+
9386
9394
var Validator = class {
9387
9395
constructor(rule, props) {
9388
9396
var _props$element$;
@@ -9392,6 +9400,7 @@ var Validator = class {
9392
9400
this.dependents = rule.dependents || [];
9393
9401
this.element$ = props.element$;
9394
9402
this.form$ = ((_props$element$ = props.element$) === null || _props$element$ === void 0 ? void 0 : _props$element$.form$) || {};
9403
+ this.config$ = props.config$;
9395
9404
this.numeric = props.numeric || false;
9396
9405
this.elementMessages = props.element$.messages;
9397
9406
this.invalid = false;
@@ -9448,9 +9457,9 @@ var Validator = class {
9448
9457
if (this.msg) {
9449
9458
message = this.msg;
9450
9459
} else if (this.elementMessages[this.name]) {
9451
- message = this.elementMessages[this.name];
9460
+ message =localize( this.elementMessages[this.name], this.config$.value, this.form$) ;
9452
9461
} else if (this.form$.options.messages[this.name]) {
9453
- message = this.form$.options.messages[this.name];
9462
+ message =localize( this.form$.options.messages[this.name], this.config$.value, this.form$) ;
9454
9463
} else if (this.name !== '_class' && ((_this$form$$translati = this.form$.translations.validation) === null || _this$form$$translati === void 0 ? void 0 : _this$form$$translati[this.name]) !== undefined) {
9455
9464
message = this.form$.translations.validation[this.name];
9456
9465
if (isPlainObject_1(message)) {
@@ -9625,8 +9634,15 @@ var Validator = class {
9625
9634
});
9626
9635
});
9627
9636
}
9628
- size(value) {
9629
- if (this.isNumeric) {
9637
+ isOtherNumeric(other$) {
9638
+ return some_1(other$.Validators, {
9639
+ name: 'numeric'
9640
+ }) || some_1(other$.Validators, {
9641
+ name: 'integer'
9642
+ });
9643
+ }
9644
+ size(value, other$) {
9645
+ if (other$ && this.isOtherNumeric(other$) || !other$ && this.isNumeric) {
9630
9646
if (!isNaN(value)) {
9631
9647
var num = parseFloat(value);
9632
9648
if (Number.isInteger(num)) {
@@ -10146,7 +10162,7 @@ function shouldApplyPlugin (name, plugin) {
10146
10162
}
10147
10163
10148
10164
var name = "@vueform/vueform";
10149
- var version$1 = "1.12.10 ";
10165
+ var version$1 = "1.12.11 ";
10150
10166
var description = "Open-Source Form Framework for Vue";
10151
10167
var homepage = "https://vueform.com";
10152
10168
var license = "MIT";
@@ -10847,9 +10863,10 @@ function compare (actual, operator, expected, el$, form$) {
10847
10863
}
10848
10864
10849
10865
var Factory = class {
10850
- constructor(path, form$) {
10866
+ constructor(path, form$, config$ ) {
10851
10867
this.form$ = form$;
10852
10868
this.element$ = form$.el$(path);
10869
+ this.config$ = config$;
10853
10870
}
10854
10871
get rules() {
10855
10872
var rules = Object.assign({}, this.form$.$vueform.services.validation.rules, this.form$.$vueform.rules);
@@ -10876,7 +10893,8 @@ var Factory = class {
10876
10893
name: "custom_rule_".concat(Math.floor(Math.random() * 9000000) + 1000000),
10877
10894
attributes: Array.isArray(rule) && rule[1] ? rule[1] : []
10878
10895
}, {
10879
- element$: this.element$
10896
+ element$: this.element$,
10897
+ config$: this.config$
10880
10898
});
10881
10899
}
10882
10900
parseRules(rules) {
@@ -12895,9 +12913,13 @@ class filled extends Validator {
12895
12913
12896
12914
class gt extends Validator {
12897
12915
get messageParams() {
12916
+ var value = this.other$.value != null ? this.size(this.other$.value, this.other$) : 0;
12917
+ if (isNaN(value) || value < 0) {
12918
+ value = 0;
12919
+ }
12898
12920
return {
12899
12921
attribute: this.attributeName,
12900
- value: this.other$.value != null ? this.size(this.other$.value) : 0
12922
+ value
12901
12923
};
12902
12924
}
12903
12925
get otherPath() {
@@ -12914,14 +12936,14 @@ class gt extends Validator {
12914
12936
return this.compare(value, otherValue);
12915
12937
}
12916
12938
compare(value, otherValue) {
12917
- var otherSize = this.size(otherValue);
12939
+ var otherSize = this.size(otherValue, this.other$ );
12918
12940
return otherSize == 0 || this.size(value) > otherSize;
12919
12941
}
12920
12942
}
12921
12943
12922
12944
class gte extends gt {
12923
12945
compare(value, otherValue) {
12924
- var otherSize = this.size(otherValue);
12946
+ var otherSize = this.size(otherValue, this.other$ );
12925
12947
return otherSize == 0 || this.size(value) >= otherSize;
12926
12948
}
12927
12949
}
@@ -13025,15 +13047,15 @@ class json extends Validator {
13025
13047
class lt extends gt {
13026
13048
compare(value, otherValue) {
13027
13049
var size = this.size(value);
13028
- var otherSize = this.size(otherValue);
13050
+ var otherSize = this.size(otherValue, this.other$ );
13029
13051
return otherSize == 0 && size == 0 || this.size(value) < otherSize;
13030
13052
}
13031
13053
}
13032
13054
13033
13055
class lte extends gt {
13034
13056
compare(value, otherValue) {
13035
13057
var size = this.size(value);
13036
- var otherSize = this.size(otherValue);
13058
+ var otherSize = this.size(otherValue, this.other$ );
13037
13059
return otherSize == 0 && size == 0 || this.size(value) <= otherSize;
13038
13060
}
13039
13061
}
@@ -13921,7 +13943,7 @@ class Columns {
13921
13943
}
13922
13944
}
13923
13945
13924
- /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4 /LICENSE */
13946
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6 /LICENSE */
13925
13947
13926
13948
const {
13927
13949
entries,
@@ -13981,6 +14003,9 @@ const typeErrorCreate = unconstruct(TypeError);
13981
14003
*/
13982
14004
function unapply(func) {
13983
14005
return function (thisArg) {
14006
+ if (thisArg instanceof RegExp) {
14007
+ thisArg.lastIndex = 0;
14008
+ }
13984
14009
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13985
14010
args[_key - 1] = arguments[_key];
13986
14011
}
@@ -14122,7 +14147,7 @@ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
14122
14147
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
14123
14148
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
14124
14149
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
14125
- const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
14150
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix ):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
14126
14151
);
14127
14152
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
14128
14153
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
@@ -14219,7 +14244,7 @@ const _createHooksMap = function _createHooksMap() {
14219
14244
function createDOMPurify() {
14220
14245
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
14221
14246
const DOMPurify = root => createDOMPurify(root);
14222
- DOMPurify.version = '3.2.4 ';
14247
+ DOMPurify.version = '3.2.6 ';
14223
14248
DOMPurify.removed = [];
14224
14249
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
14225
14250
// Not running in a browser, provide a factory function
@@ -14458,8 +14483,8 @@ function createDOMPurify() {
14458
14483
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone$2(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
14459
14484
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone$2(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
14460
14485
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
14461
- FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) :{} ;
14462
- FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) :{} ;
14486
+ FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) :clone$2({}) ;
14487
+ FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) :clone$2({}) ;
14463
14488
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
14464
14489
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
14465
14490
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
@@ -14824,7 +14849,7 @@ function createDOMPurify() {
14824
14849
allowedTags: ALLOWED_TAGS
14825
14850
});
14826
14851
/* Detect mXSS attempts abusing namespace confusion */
14827
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
14852
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w! ]/g, currentNode.innerHTML) && regExpTest(/<[/\w! ]/g, currentNode.textContent)) {
14828
14853
_forceRemove(currentNode);
14829
14854
return true;
14830
14855
}
@@ -14976,7 +15001,8 @@ function createDOMPurify() {
14976
15001
value: attrValue
14977
15002
} = attr;
14978
15003
const lcName = transformCaseFunc(name);
14979
- let value = name === 'value' ? attrValue : stringTrim(attrValue);
15004
+ const initValue = attrValue;
15005
+ let value = name === 'value' ? initValue : stringTrim(initValue);
14980
15006
/* Execute a hook if present */
14981
15007
hookEvent.attrName = lcName;
14982
15008
hookEvent.attrValue = value;
@@ -15002,10 +15028,9 @@ function createDOMPurify() {
15002
15028
if (hookEvent.forceKeepAttr) {
15003
15029
continue;
15004
15030
}
15005
- /* Remove attribute */
15006
- _removeAttribute(name, currentNode);
15007
15031
/* Did the hooks approve of the attribute? */
15008
15032
if (!hookEvent.keepAttr) {
15033
+ _removeAttribute(name, currentNode);
15009
15034
continue;
15010
15035
}
15011
15036
/* Work around a security issue in jQuery 3.0 */
@@ -15022,6 +15047,7 @@ function createDOMPurify() {
15022
15047
/* Is `value` valid for this attribute? */
15023
15048
const lcTag = transformCaseFunc(currentNode.nodeName);
15024
15049
if (!_isValidAttribute(lcTag, lcName, value)) {
15050
+ _removeAttribute(name, currentNode);
15025
15051
continue;
15026
15052
}
15027
15053
/* Handle attributes that require Trusted Types */
@@ -15042,19 +15068,23 @@ function createDOMPurify() {
15042
15068
}
15043
15069
}
15044
15070
/* Handle invalid data-* attribute set by try-catching it */
15045
- try {
15046
- if (namespaceURI) {
15047
- currentNode.setAttributeNS(namespaceURI, name, value);
15048
- } else {
15049
- /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
15050
- currentNode.setAttribute(name, value);
15051
- }
15052
- if (_isClobbered(currentNode)) {
15053
- _forceRemove(currentNode);
15054
- } else {
15055
- arrayPop(DOMPurify.removed);
15071
+ if (value !== initValue) {
15072
+ try {
15073
+ if (namespaceURI) {
15074
+ currentNode.setAttributeNS(namespaceURI, name, value);
15075
+ } else {
15076
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
15077
+ currentNode.setAttribute(name, value);
15078
+ }
15079
+ if (_isClobbered(currentNode)) {
15080
+ _forceRemove(currentNode);
15081
+ } else {
15082
+ arrayPop(DOMPurify.removed);
15083
+ }
15084
+ } catch (_) {
15085
+ _removeAttribute(name, currentNode);
15056
15086
}
15057
- } catch (_) {}
15087
+ }
15058
15088
}
15059
15089
/* Execute a hook if present */
15060
15090
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
@@ -16971,14 +17001,6 @@ function isVueComponent(value) {
16971
17001
return isPlainObject_1(value) && (isNonEmptyString(value.template) || isFunction(value.render) || isNonEmptyString(value.el) || isElement(value.el) || isVueComponent(value.extends) || isNonEmptyArray(value.mixins) && value.mixins.some(val => isVueComponent(val))) || typeof value === 'function' && value.prototype && value.prototype.constructor.name === 'VueComponent';
16972
17002
}
16973
17003
16974
- function localize(object, $config, form$) {
16975
- var locale = form$.locale$ || $config.i18n.locale;
16976
- if (!locale) {
16977
- return object;
16978
- }
16979
- return object && typeof object === 'object' ? (object === null || object === void 0 ? void 0 : object[locale]) || (object === null || object === void 0 ? void 0 : object[locale.toUpperCase()]) || (object === null || object === void 0 ? void 0 : object[$config.i18n.fallbackLocale]) || (object === null || object === void 0 ? void 0 : object[$config.i18n.fallbackLocale.toUpperCase()]) || (object === null || object === void 0 ? void 0 : object[Object.keys(object)[0]]) || '' : object;
16980
- }
16981
-
16982
17004
var base$19 = function base(props, context, dependencies) {
16983
17005
// ============ DEPENDENCIES ============
16984
17006
@@ -27385,6 +27407,7 @@ var base$I = function base(props, context, dependencies) {
27385
27407
var {
27386
27408
rules
27387
27409
} = toRefs(props);
27410
+ var config$ = inject('config$');
27388
27411
27389
27412
// ============ DEPENDENCIES ============
27390
27413
@@ -27694,7 +27717,7 @@ var base$I = function base(props, context, dependencies) {
27694
27717
// If the element has rules it does not
27695
27718
// qualify as validated by default
27696
27719
state.value.validated = false;
27697
- validatorFactory.value = new form$.value.$vueform.services.validation.factory(path.value, form$.value);
27720
+ validatorFactory.value = new form$.value.$vueform.services.validation.factory(path.value, form$.value, config$.value );
27698
27721
Validators.value = [];
27699
27722
each(validatorFactory.value.makeAll(validationRules.value), Validator => {
27700
27723
Validators.value.push(Validator);
@@ -28191,6 +28214,7 @@ var multilingual$3 = function multilingual(props, context, dependencies) {
28191
28214
var {
28192
28215
rules
28193
28216
} = toRefs(props);
28217
+ var config$ = inject('config$');
28194
28218
28195
28219
// ============ DEPENDENCIES ============
28196
28220
@@ -28482,7 +28506,7 @@ var multilingual$3 = function multilingual(props, context, dependencies) {
28482
28506
each(validationRules.value, (r, lang) => {
28483
28507
state.value.validated[lang] = r !== null && r.length > 0 ? false : true;
28484
28508
});
28485
- var factory = new form$.value.$vueform.services.validation.factory(path.value, form$.value);
28509
+ var factory = new form$.value.$vueform.services.validation.factory(path.value, form$.value, config$.value );
28486
28510
Validators.value = {};
28487
28511
each(validationRules.value, (languageRules, lang) => {
28488
28512
if (languageRules === null) {