ibexa/admin-ui
Back-office UI package for the Ibexa DXP admin panel, providing interface components, styling, and assets to manage content and users. Extends the admin experience with ready-to-use views, widgets, and integrations for Ibexa installations.
Field Type Validator is a base class to validate inputs in a Field Type.
class Validator extends window.ibexa.BaseFieldValidator {
validateInput(event) {
// validation
return {
isError: {Boolean},
errorMessage: {String},
};
}
};
const validator = new Validator({
classInvalid: {String},
fieldSelector: {String},
eventsMap: [
{
selector: {String},
eventName: {String},
callback: {String},
invalidStateSelectors: {Array},
errorNodeSelectors: {Array},
},
],
});
validator.init();
The BaseFieldValidator class has a few required properties. All of them are listed below.
classInvalid {String} - CSS class name to be added when field is invalid, example: 'is-invalid'.
fieldSelector {String} - CSS selector of the field, example: '.ez-field-edit-ibexa_string',
eventsMap {Array} - events config:
init - a method for adding event listeners reinit - a method for removing event listeners and adding new ones (useful when DOM has changed)
findValidationStateNodes - method to find nodes to add invalid class (useful when DOM is complex), this method should return an array of nodes. params:
findErrorContainers method to find container for the error message (useful when DOM is complex), this method should return an array of nodes. params:
findExistingErrorNodes method to find existing error nodes (useful when DOM is complex), his method should return an array of nodes. params:
How can I help you explore Laravel packages today?