dom-render 1.0.93 → 1.0.94

Sign up to get free protection for your applications and to get access to all the features.
package/DomRenderProxy.js CHANGED
@@ -266,29 +266,31 @@ var DomRenderProxy = /** @class */ (function () {
266
266
  // array같은경우도 키값으로 접근하기때문에 특정 인덱스를 찾아서 그부분만 바꿔줄수 있다.
267
267
  var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('').slice(1);
268
268
  if (lastDoneExecute) {
269
- var iterable = this._rawSets.get(fullPathStr_1);
270
- // console.log('----->', iterable);
269
+ var iterable_1 = this._rawSets.get(fullPathStr_1);
271
270
  // array check
272
- var front = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
273
- var last = strings[strings.length - 1];
274
- var data = ScriptUtils_1.ScriptUtils.evalReturn('this' + front, this._domRender_proxy);
275
- if (last === 'length' && Array.isArray(data)) {
276
- var aIterable = this._rawSets.get(front.slice(1));
277
- if (aIterable) {
278
- this.render(Array.from(aIterable));
271
+ var front_1 = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
272
+ var last_1 = strings[strings.length - 1];
273
+ var data_1 = ScriptUtils_1.ScriptUtils.evalReturn('this' + front_1, this._domRender_proxy);
274
+ new Promise(function (resolve) {
275
+ if (last_1 === 'length' && Array.isArray(data_1)) {
276
+ var aIterable = _this._rawSets.get(front_1.slice(1));
277
+ if (aIterable) {
278
+ return _this.render(Array.from(aIterable));
279
+ }
279
280
  }
280
- }
281
- else if (iterable) {
282
- this.render(Array.from(iterable), fullPathStr_1);
283
- }
284
- this._targets.forEach(function (it) {
285
- // console.log('target------->,', it)
286
- // return;
287
- if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
288
- var targets = EventManager_1.eventManager.findAttrElements(it, _this.config);
289
- // console.log('------>', targets);
290
- EventManager_1.eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
281
+ else if (iterable_1) {
282
+ return _this.render(Array.from(iterable_1), fullPathStr_1);
291
283
  }
284
+ }).then(function (it) {
285
+ _this._targets.forEach(function (it) {
286
+ // console.log('target------->,', it)
287
+ // return;
288
+ if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
289
+ var targets = EventManager_1.eventManager.findAttrElements(it, _this.config);
290
+ // console.log('------>', targets);
291
+ EventManager_1.eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
292
+ }
293
+ });
292
294
  });
293
295
  }
294
296
  fullPaths.push(fullPathStr_1);
package/dist/bundle.js CHANGED
@@ -736,6 +736,7 @@ var EventManager = /** @class */ (function () {
736
736
  EventManager.prototype.changeVar = function (obj, elements, varName, config) {
737
737
  var _this = this;
738
738
  // console.log('-changeVar-->', obj, elements, varName);
739
+ // forEach elements
739
740
  // value-link event
740
741
  this.procAttr(elements, EventManager.valueLinkAttrName, function (it, attribute) {
741
742
  var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
@@ -3157,29 +3158,31 @@ var DomRenderProxy = /** @class */ (function () {
3157
3158
  // array같은경우도 키값으로 접근하기때문에 특정 인덱스를 찾아서 그부분만 바꿔줄수 있다.
3158
3159
  var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('').slice(1);
3159
3160
  if (lastDoneExecute) {
3160
- var iterable = this._rawSets.get(fullPathStr_1);
3161
- // console.log('----->', iterable);
3161
+ var iterable_1 = this._rawSets.get(fullPathStr_1);
3162
3162
  // array check
3163
- var front = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
3164
- var last = strings[strings.length - 1];
3165
- var data = ScriptUtils.evalReturn('this' + front, this._domRender_proxy);
3166
- if (last === 'length' && Array.isArray(data)) {
3167
- var aIterable = this._rawSets.get(front.slice(1));
3168
- if (aIterable) {
3169
- this.render(Array.from(aIterable));
3163
+ var front_1 = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
3164
+ var last_1 = strings[strings.length - 1];
3165
+ var data_1 = ScriptUtils.evalReturn('this' + front_1, this._domRender_proxy);
3166
+ new Promise(function (resolve) {
3167
+ if (last_1 === 'length' && Array.isArray(data_1)) {
3168
+ var aIterable = _this._rawSets.get(front_1.slice(1));
3169
+ if (aIterable) {
3170
+ return _this.render(Array.from(aIterable));
3171
+ }
3170
3172
  }
3171
- }
3172
- else if (iterable) {
3173
- this.render(Array.from(iterable), fullPathStr_1);
3174
- }
3175
- this._targets.forEach(function (it) {
3176
- // console.log('target------->,', it)
3177
- // return;
3178
- if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
3179
- var targets = eventManager.findAttrElements(it, _this.config);
3180
- // console.log('------>', targets);
3181
- eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
3173
+ else if (iterable_1) {
3174
+ return _this.render(Array.from(iterable_1), fullPathStr_1);
3182
3175
  }
3176
+ }).then(function (it) {
3177
+ _this._targets.forEach(function (it) {
3178
+ // console.log('target------->,', it)
3179
+ // return;
3180
+ if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
3181
+ var targets = eventManager.findAttrElements(it, _this.config);
3182
+ // console.log('------>', targets);
3183
+ eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
3184
+ }
3185
+ });
3183
3186
  });
3184
3187
  }
3185
3188
  fullPaths.push(fullPathStr_1);
@@ -3830,21 +3833,6 @@ var DomRender = /** @class */ (function () {
3830
3833
  return DomRender;
3831
3834
  }());
3832
3835
 
3833
- var RenderManager = /** @class */ (function () {
3834
- function RenderManager() {
3835
- }
3836
- RenderManager.render = function (obj, target) {
3837
- if (target === void 0) { target = Object.keys(obj); }
3838
- var domRenderProxy = obj._DomRender_proxy;
3839
- if (domRenderProxy) {
3840
- target.forEach(function (it) {
3841
- domRenderProxy.root([it], obj[it]);
3842
- });
3843
- }
3844
- };
3845
- return RenderManager;
3846
- }());
3847
-
3848
3836
  var Appender = /** @class */ (function () {
3849
3837
  function Appender(defaultDatas) {
3850
3838
  this.length = 0;
@@ -3898,6 +3886,34 @@ var Appender = /** @class */ (function () {
3898
3886
  return Appender;
3899
3887
  }());
3900
3888
 
3889
+ var RenderManager = /** @class */ (function () {
3890
+ function RenderManager() {
3891
+ }
3892
+ RenderManager.render = function (obj, target) {
3893
+ if (target === void 0) { target = Object.keys(obj); }
3894
+ var domRenderProxy = obj._DomRender_proxy;
3895
+ if (domRenderProxy) {
3896
+ target.forEach(function (it) {
3897
+ domRenderProxy.root([it], obj[it]);
3898
+ });
3899
+ }
3900
+ };
3901
+ return RenderManager;
3902
+ }());
3903
+
3904
+ var AllCheckedValidatorArray = /** @class */ (function (_super) {
3905
+ __extends(AllCheckedValidatorArray, _super);
3906
+ function AllCheckedValidatorArray(value, target, event, autoValid) {
3907
+ if (autoValid === void 0) { autoValid = true; }
3908
+ return _super.call(this, value, target, event, autoValid) || this;
3909
+ }
3910
+ AllCheckedValidatorArray.prototype.valid = function () {
3911
+ var _a;
3912
+ return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
3913
+ };
3914
+ return AllCheckedValidatorArray;
3915
+ }(ValidatorArray));
3916
+
3901
3917
  var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
3902
3918
  __extends(AllUnCheckedValidatorArray, _super);
3903
3919
  function AllUnCheckedValidatorArray(value, target, event, autoValid) {
@@ -3939,34 +3955,6 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
3939
3955
  return CountEqualsCheckedValidatorArray;
3940
3956
  }(ValidatorArray));
3941
3957
 
3942
- var AllCheckedValidatorArray = /** @class */ (function (_super) {
3943
- __extends(AllCheckedValidatorArray, _super);
3944
- function AllCheckedValidatorArray(value, target, event, autoValid) {
3945
- if (autoValid === void 0) { autoValid = true; }
3946
- return _super.call(this, value, target, event, autoValid) || this;
3947
- }
3948
- AllCheckedValidatorArray.prototype.valid = function () {
3949
- var _a;
3950
- return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
3951
- };
3952
- return AllCheckedValidatorArray;
3953
- }(ValidatorArray));
3954
-
3955
- var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
3956
- __extends(CountEqualsUnCheckedValidatorArray, _super);
3957
- function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
3958
- if (autoValid === void 0) { autoValid = true; }
3959
- var _this = _super.call(this, value, target, event, autoValid) || this;
3960
- _this.count = count;
3961
- return _this;
3962
- }
3963
- CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
3964
- var _a;
3965
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
3966
- };
3967
- return CountEqualsUnCheckedValidatorArray;
3968
- }(ValidatorArray));
3969
-
3970
3958
  var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
3971
3959
  __extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
3972
3960
  function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
@@ -4012,21 +4000,6 @@ var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4012
4000
  return CountGreaterThanUnCheckedValidatorArray;
4013
4001
  }(ValidatorArray));
4014
4002
 
4015
- var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
4016
- __extends(CountGreaterThanCheckedValidatorArray, _super);
4017
- function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
4018
- if (autoValid === void 0) { autoValid = true; }
4019
- var _this = _super.call(this, value, target, event, autoValid) || this;
4020
- _this.count = count;
4021
- return _this;
4022
- }
4023
- CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
4024
- var _a;
4025
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
4026
- };
4027
- return CountGreaterThanCheckedValidatorArray;
4028
- }(ValidatorArray));
4029
-
4030
4003
  var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
4031
4004
  __extends(CountLessThanCheckedValidatorArray, _super);
4032
4005
  function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
@@ -4042,49 +4015,49 @@ var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
4042
4015
  return CountLessThanCheckedValidatorArray;
4043
4016
  }(ValidatorArray));
4044
4017
 
4045
- var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4046
- __extends(CountLessThanUnCheckedValidatorArray, _super);
4047
- function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
4018
+ var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4019
+ __extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
4020
+ function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4048
4021
  if (autoValid === void 0) { autoValid = true; }
4049
4022
  var _this = _super.call(this, value, target, event, autoValid) || this;
4050
4023
  _this.count = count;
4051
4024
  return _this;
4052
4025
  }
4053
- CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
4026
+ CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
4054
4027
  var _a;
4055
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
4028
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
4056
4029
  };
4057
- return CountLessThanUnCheckedValidatorArray;
4030
+ return CountLessThanEqualsUnCheckedValidatorArray;
4058
4031
  }(ValidatorArray));
4059
4032
 
4060
- var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4061
- __extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
4062
- function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4033
+ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
4034
+ __extends(CountUnCheckedValidatorArray, _super);
4035
+ function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
4063
4036
  if (autoValid === void 0) { autoValid = true; }
4064
4037
  var _this = _super.call(this, value, target, event, autoValid) || this;
4065
4038
  _this.count = count;
4066
4039
  return _this;
4067
4040
  }
4068
- CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
4041
+ CountUnCheckedValidatorArray.prototype.valid = function () {
4069
4042
  var _a;
4070
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
4043
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
4071
4044
  };
4072
- return CountLessThanEqualsUnCheckedValidatorArray;
4045
+ return CountUnCheckedValidatorArray;
4073
4046
  }(ValidatorArray));
4074
4047
 
4075
- var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4076
- __extends(CountLessThanEqualsCheckedValidatorArray, _super);
4077
- function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4048
+ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
4049
+ __extends(CountGreaterThanCheckedValidatorArray, _super);
4050
+ function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
4078
4051
  if (autoValid === void 0) { autoValid = true; }
4079
4052
  var _this = _super.call(this, value, target, event, autoValid) || this;
4080
4053
  _this.count = count;
4081
4054
  return _this;
4082
4055
  }
4083
- CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
4056
+ CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
4084
4057
  var _a;
4085
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
4058
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
4086
4059
  };
4087
- return CountLessThanEqualsCheckedValidatorArray;
4060
+ return CountGreaterThanCheckedValidatorArray;
4088
4061
  }(ValidatorArray));
4089
4062
 
4090
4063
  var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
@@ -4109,21 +4082,6 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
4109
4082
  return ExcludeCheckedValidatorArray;
4110
4083
  }(ValidatorArray));
4111
4084
 
4112
- var NotEmptyValidator = /** @class */ (function (_super) {
4113
- __extends(NotEmptyValidator, _super);
4114
- function NotEmptyValidator(value, target, event, autoValid) {
4115
- if (autoValid === void 0) { autoValid = true; }
4116
- return _super.call(this, value, target, event, autoValid) || this;
4117
- }
4118
- NotEmptyValidator.prototype.valid = function () {
4119
- var _a;
4120
- var value = this.value;
4121
- // console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
4122
- return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
4123
- };
4124
- return NotEmptyValidator;
4125
- }(Validator));
4126
-
4127
4085
  var EmptyValidator = /** @class */ (function (_super) {
4128
4086
  __extends(EmptyValidator, _super);
4129
4087
  function EmptyValidator(value, target, event, autoValid) {
@@ -4138,20 +4096,23 @@ var EmptyValidator = /** @class */ (function (_super) {
4138
4096
  return EmptyValidator;
4139
4097
  }(Validator));
4140
4098
 
4141
- var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
4142
- __extends(CountUnCheckedValidatorArray, _super);
4143
- function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
4099
+ var FormValidator = /** @class */ (function (_super) {
4100
+ __extends(FormValidator, _super);
4101
+ function FormValidator(target, event, autoValid) {
4144
4102
  if (autoValid === void 0) { autoValid = true; }
4145
- var _this = _super.call(this, value, target, event, autoValid) || this;
4146
- _this.count = count;
4147
- return _this;
4103
+ return _super.call(this, undefined, target, event, autoValid) || this;
4148
4104
  }
4149
- CountUnCheckedValidatorArray.prototype.valid = function () {
4150
- var _a;
4151
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
4105
+ FormValidator.prototype.validAction = function () {
4106
+ return _super.prototype.childValidAction.call(this);
4152
4107
  };
4153
- return CountUnCheckedValidatorArray;
4154
- }(ValidatorArray));
4108
+ FormValidator.prototype.valid = function () {
4109
+ return this.childValid();
4110
+ };
4111
+ FormValidator.prototype.reset = function () {
4112
+ this.targetReset();
4113
+ };
4114
+ return FormValidator;
4115
+ }(Validator));
4155
4116
 
4156
4117
  var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
4157
4118
  __extends(IncludeCheckedValidatorArray, _super);
@@ -4175,17 +4136,20 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
4175
4136
  return IncludeCheckedValidatorArray;
4176
4137
  }(ValidatorArray));
4177
4138
 
4178
- var PassValidator = /** @class */ (function (_super) {
4179
- __extends(PassValidator, _super);
4180
- function PassValidator(value, target, event, autoValid) {
4139
+ var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4140
+ __extends(CountEqualsUnCheckedValidatorArray, _super);
4141
+ function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4181
4142
  if (autoValid === void 0) { autoValid = true; }
4182
- return _super.call(this, value, target, event, autoValid) || this;
4143
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4144
+ _this.count = count;
4145
+ return _this;
4183
4146
  }
4184
- PassValidator.prototype.valid = function () {
4185
- return true;
4147
+ CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
4148
+ var _a;
4149
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
4186
4150
  };
4187
- return PassValidator;
4188
- }(Validator));
4151
+ return CountEqualsUnCheckedValidatorArray;
4152
+ }(ValidatorArray));
4189
4153
 
4190
4154
  var NotRegExpTestValidator = /** @class */ (function (_super) {
4191
4155
  __extends(NotRegExpTestValidator, _super);
@@ -4209,6 +4173,21 @@ var NotRegExpTestValidator = /** @class */ (function (_super) {
4209
4173
  return NotRegExpTestValidator;
4210
4174
  }(Validator));
4211
4175
 
4176
+ var NotEmptyValidator = /** @class */ (function (_super) {
4177
+ __extends(NotEmptyValidator, _super);
4178
+ function NotEmptyValidator(value, target, event, autoValid) {
4179
+ if (autoValid === void 0) { autoValid = true; }
4180
+ return _super.call(this, value, target, event, autoValid) || this;
4181
+ }
4182
+ NotEmptyValidator.prototype.valid = function () {
4183
+ var _a;
4184
+ var value = this.value;
4185
+ // console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
4186
+ return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
4187
+ };
4188
+ return NotEmptyValidator;
4189
+ }(Validator));
4190
+
4212
4191
  var RegExpTestValidator = /** @class */ (function (_super) {
4213
4192
  __extends(RegExpTestValidator, _super);
4214
4193
  function RegExpTestValidator(regexp, value, target, event, autoValid) {
@@ -4232,24 +4211,6 @@ var RegExpTestValidator = /** @class */ (function (_super) {
4232
4211
  return RegExpTestValidator;
4233
4212
  }(Validator));
4234
4213
 
4235
- var FormValidator = /** @class */ (function (_super) {
4236
- __extends(FormValidator, _super);
4237
- function FormValidator(target, event, autoValid) {
4238
- if (autoValid === void 0) { autoValid = true; }
4239
- return _super.call(this, undefined, target, event, autoValid) || this;
4240
- }
4241
- FormValidator.prototype.validAction = function () {
4242
- return _super.prototype.childValidAction.call(this);
4243
- };
4244
- FormValidator.prototype.valid = function () {
4245
- return this.childValid();
4246
- };
4247
- FormValidator.prototype.reset = function () {
4248
- this.targetReset();
4249
- };
4250
- return FormValidator;
4251
- }(Validator));
4252
-
4253
4214
  var UnCheckedValidator = /** @class */ (function (_super) {
4254
4215
  __extends(UnCheckedValidator, _super);
4255
4216
  function UnCheckedValidator(value, target, event, autoValid) {
@@ -4263,6 +4224,21 @@ var UnCheckedValidator = /** @class */ (function (_super) {
4263
4224
  return UnCheckedValidator;
4264
4225
  }(Validator));
4265
4226
 
4227
+ var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4228
+ __extends(CountLessThanEqualsCheckedValidatorArray, _super);
4229
+ function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4230
+ if (autoValid === void 0) { autoValid = true; }
4231
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4232
+ _this.count = count;
4233
+ return _this;
4234
+ }
4235
+ CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
4236
+ var _a;
4237
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
4238
+ };
4239
+ return CountLessThanEqualsCheckedValidatorArray;
4240
+ }(ValidatorArray));
4241
+
4266
4242
  var MultipleValidator = /** @class */ (function (_super) {
4267
4243
  __extends(MultipleValidator, _super);
4268
4244
  function MultipleValidator(validators, value, target, event, autoValid) {
@@ -4292,19 +4268,20 @@ var MultipleValidator = /** @class */ (function (_super) {
4292
4268
  return MultipleValidator;
4293
4269
  }(Validator));
4294
4270
 
4295
- var ValidValidatorArray = /** @class */ (function (_super) {
4296
- __extends(ValidValidatorArray, _super);
4297
- function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
4271
+ var ValidMultipleValidator = /** @class */ (function (_super) {
4272
+ __extends(ValidMultipleValidator, _super);
4273
+ function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
4298
4274
  if (autoValid === void 0) { autoValid = true; }
4299
- var _this = _super.call(this, value, target, event, autoValid) || this;
4300
- _this.validCallBack = validCallBack;
4275
+ var _this = _super.call(this, validators, value, target, event, autoValid) || this;
4276
+ _this.validMultipleCallback = validMultipleCallback;
4277
+ _this.validators = validators;
4301
4278
  return _this;
4302
4279
  }
4303
- ValidValidatorArray.prototype.valid = function () {
4304
- return this.validCallBack(this.value, this.getTarget(), this.getEvent());
4280
+ ValidMultipleValidator.prototype.valid = function () {
4281
+ return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
4305
4282
  };
4306
- return ValidValidatorArray;
4307
- }(ValidatorArray));
4283
+ return ValidMultipleValidator;
4284
+ }(MultipleValidator));
4308
4285
 
4309
4286
  var ValidValidator = /** @class */ (function (_super) {
4310
4287
  __extends(ValidValidator, _super);
@@ -4320,34 +4297,33 @@ var ValidValidator = /** @class */ (function (_super) {
4320
4297
  return ValidValidator;
4321
4298
  }(Validator));
4322
4299
 
4323
- var RequiredValidator = /** @class */ (function (_super) {
4324
- __extends(RequiredValidator, _super);
4325
- function RequiredValidator(value, target, event, autoValid) {
4300
+ var ValidValidatorArray = /** @class */ (function (_super) {
4301
+ __extends(ValidValidatorArray, _super);
4302
+ function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
4326
4303
  if (autoValid === void 0) { autoValid = true; }
4327
- return _super.call(this, value, target, event, autoValid) || this;
4304
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4305
+ _this.validCallBack = validCallBack;
4306
+ return _this;
4328
4307
  }
4329
- RequiredValidator.prototype.valid = function () {
4330
- var value = this.value;
4331
- // console.log('required', value, value !== undefined && value !== null)
4332
- return value !== undefined && value !== null;
4308
+ ValidValidatorArray.prototype.valid = function () {
4309
+ return this.validCallBack(this.value, this.getTarget(), this.getEvent());
4333
4310
  };
4334
- return RequiredValidator;
4335
- }(Validator));
4311
+ return ValidValidatorArray;
4312
+ }(ValidatorArray));
4336
4313
 
4337
- var ValidMultipleValidator = /** @class */ (function (_super) {
4338
- __extends(ValidMultipleValidator, _super);
4339
- function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
4314
+ var ValueNotEqualsValidator = /** @class */ (function (_super) {
4315
+ __extends(ValueNotEqualsValidator, _super);
4316
+ function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
4340
4317
  if (autoValid === void 0) { autoValid = true; }
4341
- var _this = _super.call(this, validators, value, target, event, autoValid) || this;
4342
- _this.validMultipleCallback = validMultipleCallback;
4343
- _this.validators = validators;
4318
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4319
+ _this.equalsValue = equalsValue;
4344
4320
  return _this;
4345
4321
  }
4346
- ValidMultipleValidator.prototype.valid = function () {
4347
- return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
4322
+ ValueNotEqualsValidator.prototype.valid = function () {
4323
+ return this.value !== this.equalsValue;
4348
4324
  };
4349
- return ValidMultipleValidator;
4350
- }(MultipleValidator));
4325
+ return ValueNotEqualsValidator;
4326
+ }(Validator));
4351
4327
 
4352
4328
  var ValueEqualsValidator = /** @class */ (function (_super) {
4353
4329
  __extends(ValueEqualsValidator, _super);
@@ -4363,41 +4339,46 @@ var ValueEqualsValidator = /** @class */ (function (_super) {
4363
4339
  return ValueEqualsValidator;
4364
4340
  }(Validator));
4365
4341
 
4366
- var ValueNotEqualsValidator = /** @class */ (function (_super) {
4367
- __extends(ValueNotEqualsValidator, _super);
4368
- function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
4342
+ var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4343
+ __extends(CountLessThanUnCheckedValidatorArray, _super);
4344
+ function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
4369
4345
  if (autoValid === void 0) { autoValid = true; }
4370
4346
  var _this = _super.call(this, value, target, event, autoValid) || this;
4371
- _this.equalsValue = equalsValue;
4347
+ _this.count = count;
4372
4348
  return _this;
4373
4349
  }
4374
- ValueNotEqualsValidator.prototype.valid = function () {
4375
- return this.value !== this.equalsValue;
4350
+ CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
4351
+ var _a;
4352
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
4376
4353
  };
4377
- return ValueNotEqualsValidator;
4378
- }(Validator));
4354
+ return CountLessThanUnCheckedValidatorArray;
4355
+ }(ValidatorArray));
4379
4356
 
4380
- var ClipBoardUtils = /** @class */ (function () {
4381
- function ClipBoardUtils() {
4357
+ var RequiredValidator = /** @class */ (function (_super) {
4358
+ __extends(RequiredValidator, _super);
4359
+ function RequiredValidator(value, target, event, autoValid) {
4360
+ if (autoValid === void 0) { autoValid = true; }
4361
+ return _super.call(this, value, target, event, autoValid) || this;
4382
4362
  }
4383
- ClipBoardUtils.readText = function (clipboard) {
4384
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4385
- return clipboard.readText();
4386
- };
4387
- ClipBoardUtils.read = function (clipboard) {
4388
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4389
- return clipboard.read();
4390
- };
4391
- ClipBoardUtils.writeText = function (data, clipboard) {
4392
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4393
- return clipboard.writeText(data);
4363
+ RequiredValidator.prototype.valid = function () {
4364
+ var value = this.value;
4365
+ // console.log('required', value, value !== undefined && value !== null)
4366
+ return value !== undefined && value !== null;
4394
4367
  };
4395
- ClipBoardUtils.write = function (data, clipboard) {
4396
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4397
- return clipboard.write(data);
4368
+ return RequiredValidator;
4369
+ }(Validator));
4370
+
4371
+ var PassValidator = /** @class */ (function (_super) {
4372
+ __extends(PassValidator, _super);
4373
+ function PassValidator(value, target, event, autoValid) {
4374
+ if (autoValid === void 0) { autoValid = true; }
4375
+ return _super.call(this, value, target, event, autoValid) || this;
4376
+ }
4377
+ PassValidator.prototype.valid = function () {
4378
+ return true;
4398
4379
  };
4399
- return ClipBoardUtils;
4400
- }());
4380
+ return PassValidator;
4381
+ }(Validator));
4401
4382
 
4402
4383
  var NodeUtils = /** @class */ (function () {
4403
4384
  function NodeUtils() {
@@ -4468,6 +4449,28 @@ var StorageUtils = /** @class */ (function () {
4468
4449
  return StorageUtils;
4469
4450
  }());
4470
4451
 
4452
+ var ClipBoardUtils = /** @class */ (function () {
4453
+ function ClipBoardUtils() {
4454
+ }
4455
+ ClipBoardUtils.readText = function (clipboard) {
4456
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
4457
+ return clipboard.readText();
4458
+ };
4459
+ ClipBoardUtils.read = function (clipboard) {
4460
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
4461
+ return clipboard.read();
4462
+ };
4463
+ ClipBoardUtils.writeText = function (data, clipboard) {
4464
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
4465
+ return clipboard.writeText(data);
4466
+ };
4467
+ ClipBoardUtils.write = function (data, clipboard) {
4468
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
4469
+ return clipboard.write(data);
4470
+ };
4471
+ return ClipBoardUtils;
4472
+ }());
4473
+
4471
4474
  exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
4472
4475
  exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
4473
4476
  exports.Appender = Appender;
@@ -203,6 +203,7 @@ var EventManager = /** @class */ (function () {
203
203
  EventManager.prototype.changeVar = function (obj, elements, varName, config) {
204
204
  var _this = this;
205
205
  // console.log('-changeVar-->', obj, elements, varName);
206
+ // forEach elements
206
207
  // value-link event
207
208
  this.procAttr(elements, EventManager.valueLinkAttrName, function (it, attribute) {
208
209
  var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dom-render",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "main": "DomRender.js",
5
5
  "license": "MIT",
6
6
  "description": "html view template engine",