Skip to content

Commit

Permalink
Validator, ValidationMessage, ValidationSummary, ValidationEngine, Va…
Browse files Browse the repository at this point in the history
…lidationGroup: ignore errors after move to TS
  • Loading branch information
EugeniyKiyashko committed Jun 13, 2024
1 parent dd07614 commit 68a6b86
Show file tree
Hide file tree
Showing 18 changed files with 1,670 additions and 1,608 deletions.
1,535 changes: 779 additions & 756 deletions packages/devextreme/js/__internal/ui/m_validation_engine.ts

Large diffs are not rendered by default.

106 changes: 47 additions & 59 deletions packages/devextreme/js/__internal/ui/m_validation_group.ts
Original file line number Diff line number Diff line change
@@ -1,74 +1,62 @@
import $ from '../core/renderer';
import registerComponent from '../core/component_registrator';
import DOMComponent from '../core/dom_component';
import ValidationSummary from './validation_summary';
import ValidationEngine from './validation_engine';
import Validator from './validator';
import registerComponent from '@js/core/component_registrator';
import DOMComponent from '@js/core/dom_component';
import $ from '@js/core/renderer';

import ValidationEngine from './m_validation_engine';
import ValidationSummary from './m_validation_summary';
import Validator from './m_validator';

const VALIDATION_ENGINE_CLASS = 'dx-validationgroup';
const VALIDATOR_CLASS = 'dx-validator';
const VALIDATION_SUMMARY_CLASS = 'dx-validationsummary';

class ValidationGroup extends DOMComponent {
_getDefaultOptions() {
return super._getDefaultOptions();

/**
* @name dxValidationGroupOptions.rtlEnabled
* @hidden
*/

/**
* @name dxValidationGroup.beginUpdate
* @publicName beginUpdate()
* @hidden
*/
/**
* @name dxValidationGroup.defaultOptions
* @publicName defaultOptions(rule)
* @hidden
*/
/**
* @name dxValidationGroup.endUpdate
* @publicName endUpdate()
* @hidden
*/
}
_getDefaultOptions() {
// @ts-expect-error
return super._getDefaultOptions();
}

_init() {
super._init();
ValidationEngine.addGroup(this);
}
_init() {
// @ts-expect-error
super._init();
ValidationEngine.addGroup(this);
}

_initMarkup() {
const $element = this.$element();
$element.addClass(VALIDATION_ENGINE_CLASS);
$element.find(`.${VALIDATOR_CLASS}`).each(function(_, validatorContainer) {
Validator.getInstance($(validatorContainer))._initGroupRegistration();
});
$element.find(`.${VALIDATION_SUMMARY_CLASS}`).each(function(_, summaryContainer) {
ValidationSummary.getInstance($(summaryContainer)).refreshValidationGroup();
});
super._initMarkup();
}
_initMarkup() {
const $element = this.$element();
// @ts-expect-error
$element.addClass(VALIDATION_ENGINE_CLASS);
// @ts-expect-error
$element.find(`.${VALIDATOR_CLASS}`).each((_, validatorContainer) => {
Validator.getInstance($(validatorContainer))._initGroupRegistration();
});
// @ts-expect-error
$element.find(`.${VALIDATION_SUMMARY_CLASS}`).each((_, summaryContainer) => {
ValidationSummary.getInstance($(summaryContainer)).refreshValidationGroup();
});
// @ts-expect-error
super._initMarkup();
}

validate() {
return ValidationEngine.validateGroup(this);
}
validate() {
return ValidationEngine.validateGroup(this);
}

reset() {
return ValidationEngine.resetGroup(this);
}
reset() {
return ValidationEngine.resetGroup(this);
}

_dispose() {
ValidationEngine.removeGroup(this);
this.$element().removeClass(VALIDATION_ENGINE_CLASS);
super._dispose();
}
_dispose() {
ValidationEngine.removeGroup(this);
// @ts-expect-error
this.$element().removeClass(VALIDATION_ENGINE_CLASS);
// @ts-expect-error
super._dispose();
}

_useTemplates() {
return false;
}
_useTemplates() {
return false;
}
}

registerComponent('dxValidationGroup', ValidationGroup);
Expand Down
Loading

0 comments on commit 68a6b86

Please sign in to comment.