devextreme-vue
Version:
DevExtreme Vue UI and Visualization Components
366 lines (364 loc) • 12 kB
JavaScript
/*!
* devextreme-vue
* Version: 25.1.6
* Build date: Mon Oct 13 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-vue
*/
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DxValidationRule = exports.DxStringLengthRule = exports.DxRequiredRule = exports.DxRangeRule = exports.DxPatternRule = exports.DxNumericRule = exports.DxEmailRule = exports.DxCustomRule = exports.DxCompareRule = exports.DxAsyncRule = exports.DxAdapter = exports.DxValidator = void 0;
const vue_1 = require("vue");
const index_1 = require("./core/index");
const validator_1 = __importDefault(require("devextreme/ui/validator"));
const index_2 = require("./core/index");
const componentConfig = {
props: {
adapter: Object,
elementAttr: Object,
height: [Number, String],
name: String,
onDisposing: Function,
onInitialized: Function,
onOptionChanged: Function,
onValidated: Function,
validationGroup: String,
validationRules: Array,
width: [Number, String]
},
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:adapter": null,
"update:elementAttr": null,
"update:height": null,
"update:name": null,
"update:onDisposing": null,
"update:onInitialized": null,
"update:onOptionChanged": null,
"update:onValidated": null,
"update:validationGroup": null,
"update:validationRules": null,
"update:width": null,
},
computed: {
instance() {
return this.$_instance;
}
},
beforeCreate() {
this.$_WidgetClass = validator_1.default;
this.$_hasAsyncTemplate = true;
this.$_expectedChildren = {
adapter: { isCollectionItem: false, optionName: "adapter" },
AsyncRule: { isCollectionItem: true, optionName: "validationRules" },
CompareRule: { isCollectionItem: true, optionName: "validationRules" },
CustomRule: { isCollectionItem: true, optionName: "validationRules" },
EmailRule: { isCollectionItem: true, optionName: "validationRules" },
NumericRule: { isCollectionItem: true, optionName: "validationRules" },
PatternRule: { isCollectionItem: true, optionName: "validationRules" },
RangeRule: { isCollectionItem: true, optionName: "validationRules" },
RequiredRule: { isCollectionItem: true, optionName: "validationRules" },
StringLengthRule: { isCollectionItem: true, optionName: "validationRules" },
validationRule: { isCollectionItem: true, optionName: "validationRules" }
};
}
};
(0, index_1.prepareExtensionComponentConfig)(componentConfig);
const DxValidator = (0, vue_1.defineComponent)(componentConfig);
exports.DxValidator = DxValidator;
const DxAdapterConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:applyValidationResults": null,
"update:bypass": null,
"update:focus": null,
"update:getValue": null,
"update:reset": null,
"update:validationRequestsCallbacks": null,
},
props: {
applyValidationResults: Function,
bypass: Function,
focus: Function,
getValue: Function,
reset: Function,
validationRequestsCallbacks: Array
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxAdapterConfig);
const DxAdapter = (0, vue_1.defineComponent)(DxAdapterConfig);
exports.DxAdapter = DxAdapter;
DxAdapter.$_optionName = "adapter";
const DxAsyncRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:reevaluate": null,
"update:type": null,
"update:validationCallback": null,
},
props: {
ignoreEmptyValue: Boolean,
message: String,
reevaluate: Boolean,
type: String,
validationCallback: Function
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxAsyncRuleConfig);
const DxAsyncRule = (0, vue_1.defineComponent)(DxAsyncRuleConfig);
exports.DxAsyncRule = DxAsyncRule;
DxAsyncRule.$_optionName = "validationRules";
DxAsyncRule.$_isCollectionItem = true;
DxAsyncRule.$_predefinedProps = {
type: "async"
};
const DxCompareRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:comparisonTarget": null,
"update:comparisonType": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:type": null,
},
props: {
comparisonTarget: Function,
comparisonType: String,
ignoreEmptyValue: Boolean,
message: String,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxCompareRuleConfig);
const DxCompareRule = (0, vue_1.defineComponent)(DxCompareRuleConfig);
exports.DxCompareRule = DxCompareRule;
DxCompareRule.$_optionName = "validationRules";
DxCompareRule.$_isCollectionItem = true;
DxCompareRule.$_predefinedProps = {
type: "compare"
};
const DxCustomRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:reevaluate": null,
"update:type": null,
"update:validationCallback": null,
},
props: {
ignoreEmptyValue: Boolean,
message: String,
reevaluate: Boolean,
type: String,
validationCallback: Function
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxCustomRuleConfig);
const DxCustomRule = (0, vue_1.defineComponent)(DxCustomRuleConfig);
exports.DxCustomRule = DxCustomRule;
DxCustomRule.$_optionName = "validationRules";
DxCustomRule.$_isCollectionItem = true;
DxCustomRule.$_predefinedProps = {
type: "custom"
};
const DxEmailRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:type": null,
},
props: {
ignoreEmptyValue: Boolean,
message: String,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxEmailRuleConfig);
const DxEmailRule = (0, vue_1.defineComponent)(DxEmailRuleConfig);
exports.DxEmailRule = DxEmailRule;
DxEmailRule.$_optionName = "validationRules";
DxEmailRule.$_isCollectionItem = true;
DxEmailRule.$_predefinedProps = {
type: "email"
};
const DxNumericRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:type": null,
},
props: {
ignoreEmptyValue: Boolean,
message: String,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxNumericRuleConfig);
const DxNumericRule = (0, vue_1.defineComponent)(DxNumericRuleConfig);
exports.DxNumericRule = DxNumericRule;
DxNumericRule.$_optionName = "validationRules";
DxNumericRule.$_isCollectionItem = true;
DxNumericRule.$_predefinedProps = {
type: "numeric"
};
const DxPatternRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:message": null,
"update:pattern": null,
"update:type": null,
},
props: {
ignoreEmptyValue: Boolean,
message: String,
pattern: [RegExp, String],
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxPatternRuleConfig);
const DxPatternRule = (0, vue_1.defineComponent)(DxPatternRuleConfig);
exports.DxPatternRule = DxPatternRule;
DxPatternRule.$_optionName = "validationRules";
DxPatternRule.$_isCollectionItem = true;
DxPatternRule.$_predefinedProps = {
type: "pattern"
};
const DxRangeRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:max": null,
"update:message": null,
"update:min": null,
"update:reevaluate": null,
"update:type": null,
},
props: {
ignoreEmptyValue: Boolean,
max: [Date, Number, String],
message: String,
min: [Date, Number, String],
reevaluate: Boolean,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxRangeRuleConfig);
const DxRangeRule = (0, vue_1.defineComponent)(DxRangeRuleConfig);
exports.DxRangeRule = DxRangeRule;
DxRangeRule.$_optionName = "validationRules";
DxRangeRule.$_isCollectionItem = true;
DxRangeRule.$_predefinedProps = {
type: "range"
};
const DxRequiredRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:message": null,
"update:trim": null,
"update:type": null,
},
props: {
message: String,
trim: Boolean,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxRequiredRuleConfig);
const DxRequiredRule = (0, vue_1.defineComponent)(DxRequiredRuleConfig);
exports.DxRequiredRule = DxRequiredRule;
DxRequiredRule.$_optionName = "validationRules";
DxRequiredRule.$_isCollectionItem = true;
DxRequiredRule.$_predefinedProps = {
type: "required"
};
const DxStringLengthRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:ignoreEmptyValue": null,
"update:max": null,
"update:message": null,
"update:min": null,
"update:trim": null,
"update:type": null,
},
props: {
ignoreEmptyValue: Boolean,
max: Number,
message: String,
min: Number,
trim: Boolean,
type: String
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxStringLengthRuleConfig);
const DxStringLengthRule = (0, vue_1.defineComponent)(DxStringLengthRuleConfig);
exports.DxStringLengthRule = DxStringLengthRule;
DxStringLengthRule.$_optionName = "validationRules";
DxStringLengthRule.$_isCollectionItem = true;
DxStringLengthRule.$_predefinedProps = {
type: "stringLength"
};
const DxValidationRuleConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
"update:comparisonTarget": null,
"update:comparisonType": null,
"update:ignoreEmptyValue": null,
"update:max": null,
"update:message": null,
"update:min": null,
"update:pattern": null,
"update:reevaluate": null,
"update:trim": null,
"update:type": null,
"update:validationCallback": null,
},
props: {
comparisonTarget: Function,
comparisonType: String,
ignoreEmptyValue: Boolean,
max: [Date, Number, String],
message: String,
min: [Date, Number, String],
pattern: [RegExp, String],
reevaluate: Boolean,
trim: Boolean,
type: String,
validationCallback: Function
}
};
(0, index_2.prepareConfigurationComponentConfig)(DxValidationRuleConfig);
const DxValidationRule = (0, vue_1.defineComponent)(DxValidationRuleConfig);
exports.DxValidationRule = DxValidationRule;
DxValidationRule.$_optionName = "validationRules";
DxValidationRule.$_isCollectionItem = true;
DxValidationRule.$_predefinedProps = {
type: "required"
};
exports.default = DxValidator;