fit-ui 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Fit.UI.js CHANGED
@@ -682,7 +682,7 @@ Fit._internal =
682
682
  {
683
683
  Core:
684
684
  {
685
- VersionInfo: { Major: 3, Minor: 5, Patch: 0 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
685
+ VersionInfo: { Major: 3, Minor: 5, Patch: 1 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
686
686
  }
687
687
  };
688
688
 
@@ -3339,6 +3339,7 @@ Fit.Controls.ControlBase = function(controlId)
3339
3339
  var validationHandlerFunc = null; // Obsolete - used by SetValidationHandler
3340
3340
  var validationHandlerError = null; // Obsolete - used by SetValidationHandler
3341
3341
  var validationRules = [];
3342
+ var validationRulesPersistent = [];
3342
3343
  var validationRuleError = null;
3343
3344
  var lazyValidation = false;
3344
3345
  var lazyValidationDisabled = false;
@@ -3478,7 +3479,7 @@ Fit.Controls.ControlBase = function(controlId)
3478
3479
  this.Dispose = Fit.Core.CreateOverride(this.Dispose, function()
3479
3480
  {
3480
3481
  Fit.Internationalization.RemoveOnLocaleChanged(localize);
3481
- me = container = width = height = scope = required = validationExpr = validationError = validationErrorType = validationCallbackFunc = validationCallbackError = validationHandlerFunc = validationHandlerError = validationRules = validationRuleError = lazyValidation = lazyValidationDisabled = hideValidationErrorOnChanging = hasValidated = blockAutoPostBack = onChangeHandlers = onFocusHandlers = onBlurHandlers = hasFocus = onBlurTimeout = ensureFocusFires = waitingForFocus = focusStateLocked = txtValue = txtDirty = txtValid = txtEnabled = baseControlDisabled = ie8DisabledLayer = null;
3482
+ me = container = width = height = scope = required = validationExpr = validationError = validationErrorType = validationCallbackFunc = validationCallbackError = validationHandlerFunc = validationHandlerError = validationRules = validationRulesPersistent = validationRuleError = lazyValidation = lazyValidationDisabled = hideValidationErrorOnChanging = hasValidated = blockAutoPostBack = onChangeHandlers = onFocusHandlers = onBlurHandlers = hasFocus = onBlurTimeout = ensureFocusFires = waitingForFocus = focusStateLocked = txtValue = txtDirty = txtValid = txtEnabled = baseControlDisabled = ie8DisabledLayer = null;
3482
3483
  base();
3483
3484
  });
3484
3485
 
@@ -3956,7 +3957,7 @@ Fit.Controls.ControlBase = function(controlId)
3956
3957
  validationHandlerError = null;
3957
3958
  validationRuleError = null;
3958
3959
 
3959
- if (validationExpr === null && validationCallbackFunc === null && validationHandlerFunc === null && required === false && validationRules.length === 0)
3960
+ if (validationExpr === null && validationCallbackFunc === null && validationHandlerFunc === null && required === false && validationRules.length === 0 && validationRulesPersistent.length === 0)
3960
3961
  return true;
3961
3962
 
3962
3963
  var obj = me.Value();
@@ -3991,9 +3992,9 @@ Fit.Controls.ControlBase = function(controlId)
3991
3992
  return false;
3992
3993
  }
3993
3994
 
3994
- if (validationRules.length > 0)
3995
+ if (validationRules.length > 0 || validationRulesPersistent.length > 0)
3995
3996
  {
3996
- Fit.Array.ForEach(validationRules, function(rule)
3997
+ Fit.Array.ForEach(Fit.Array.Merge(validationRules, validationRulesPersistent), function(rule)
3997
3998
  {
3998
3999
  if (rule.Type === "Callback")
3999
4000
  {
@@ -4519,6 +4520,12 @@ Fit.Controls.ControlBase = function(controlId)
4519
4520
  Fit.Dom.Remove(elm);
4520
4521
  }
4521
4522
 
4523
+ this._internal.AddPersistentValidationRule = function(validator)
4524
+ {
4525
+ Fit.Validation.ExpectFunction(validator);
4526
+ validationRulesPersistent.push( { Type: "Callback", Validator: validator, ErrorMessage: null } );
4527
+ }
4528
+
4522
4529
  this._internal.Validate = function(force)
4523
4530
  {
4524
4531
  Fit.Validation.ExpectBoolean(force, true);
@@ -24382,7 +24389,7 @@ Fit.Controls.Input = function(ctlId)
24382
24389
 
24383
24390
  // MaxLength support
24384
24391
 
24385
- me.AddValidationRule(function(sender)
24392
+ me._internal.AddPersistentValidationRule(function(sender)
24386
24393
  {
24387
24394
  if (maxLength > 0 && getInputLength() > maxLength)
24388
24395
  {