import { DataFormGridLayout, DataFormStackLayout, EmailValidator, EntityProperty, IsTrueValidator, MaximumLengthValidator, MinimumLengthValidator, NonEmptyValidator, PhoneValidator, PropertyEditor, PropertyEditorParams, PropertyEditorStyle, PropertyGroup, RadDataForm, RangeValidator, RegExValidator } from '..';
import DataFormComp from './component';
const RadDataFormPlugin = {
    install(Vue, options) {
        Vue.registerElement('RadDataForm', () => RadDataForm, {
            component: DataFormComp,
        });
        Vue.registerElement('TKDataFormStackLayout', () => DataFormStackLayout);
        Vue.registerElement('TKDataFormGridLayout', () => DataFormGridLayout);
        Vue.registerElement('TKEntityProperty', () => EntityProperty);
        Vue.registerElement('TKPropertyEditor', () => PropertyEditor);
        Vue.registerElement('TKPropertyEditorParams', () => PropertyEditorParams);
        Vue.registerElement('TKPropertyEditorStyle', () => PropertyEditorStyle);
        Vue.registerElement('TKPropertyGroup', () => PropertyGroup);
        Vue.registerElement('TKEmailValidator', () => EmailValidator);
        Vue.registerElement('TKIsTrueValidator', () => IsTrueValidator);
        Vue.registerElement('TKNonEmptyValidator', () => NonEmptyValidator);
        Vue.registerElement('TKMaximumLengthValidator', () => MaximumLengthValidator);
        Vue.registerElement('TKMinimumLengthValidator', () => MinimumLengthValidator);
        Vue.registerElement('TKPhoneValidator', () => PhoneValidator);
        Vue.registerElement('TKRangeValidator', () => RangeValidator);
        Vue.registerElement('TKRegExValidator', () => RegExValidator);
        let setDataFormProperty = {
            inserted: function (el) {
                let dataForm = el.parentNode.nativeView;
                let property = el.nativeView;
                if (dataForm.properties) {
                    dataForm.properties.push(property);
                }
                else {
                    dataForm.properties = new Array(property);
                }
            }
        };
        Vue.directive('tkDataFormProperty', setDataFormProperty);
        let setEntityPropertyEditor = {
            inserted: function (el) {
                let entityProperty = el.parentNode.nativeView;
                let editor = el.nativeView;
                entityProperty.editor = editor;
            }
        };
        Vue.directive('tkEntityPropertyEditor', setEntityPropertyEditor);
        let setEditorParams = {
            inserted: function (el) {
                let propertyEditor = el.parentNode.nativeView;
                let editorParams = el.nativeView;
                propertyEditor.params = editorParams;
            }
        };
        Vue.directive('tkEditorParams', setEditorParams);
        let setPropertyEditorStyle = {
            inserted: function (el) {
                let propertyEditor = el.parentNode.nativeView;
                let style = el.nativeView;
                propertyEditor.propertyEditorStyle = style;
            }
        };
        Vue.directive('tkPropertyEditorStyle', setPropertyEditorStyle);
        let setFormGroups = {
            inserted: function (el) {
                let dataForm = el.parentNode.nativeView;
                let property = el.nativeView;
                if (dataForm.groups) {
                    dataForm.groups.push(property);
                }
                else {
                    dataForm.groups = new Array(property);
                }
            }
        };
        Vue.directive('tkDataFormGroups', setFormGroups);
        let setPropertyGroupProperties = {
            inserted: function (el) {
                let propertyGroup = el.parentNode.nativeView;
                let property = el.nativeView;
                if (propertyGroup.properties) {
                    propertyGroup.properties.push(property);
                }
                else {
                    propertyGroup.properties = new Array(property);
                }
            }
        };
        Vue.directive('tkPropertyGroupProperties', setPropertyGroupProperties);
        let setPropertyValidators = {
            inserted: function (el) {
                let entityProperty = el.parentNode.nativeView;
                let validator = el.nativeView;
                if (entityProperty.validators) {
                    entityProperty.validators.push(validator);
                }
                else {
                    entityProperty.validators = new Array(validator);
                }
            }
        };
        Vue.directive('tkEntityPropertyValidators', setPropertyValidators);
        let setPropertyGroupLayout = {
            inserted: function (el) {
                let propertyGroup = el.parentNode.nativeView;
                let layout = el.nativeView;
                propertyGroup.layout = layout;
            }
        };
        Vue.directive('tkPropertyGroupLayout', setPropertyGroupLayout);
    }
};
export default RadDataFormPlugin;
//# sourceMappingURL=index.js.map