@nuka9510/simple-validation 1.3.0 → 1.4.0

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.
@@ -57,38 +57,46 @@ __webpack_require__.r(__webpack_exports__);
57
57
  * Validation Check를 위한 객체
58
58
  */
59
59
  class Validation {
60
- /** 결과 값 객체 */
61
60
  result;
62
- /** validation check할 Element를 담는 객체 */
63
- #el;
64
- /** validation check할 radio Element를 담는 객체 */
61
+ #input;
62
+ #date;
63
+ #checkbox;
65
64
  #radio;
66
- /** validation check에 사용할 정규식을 담은 객체 */
67
65
  #regex;
68
66
  /**
69
67
  * Validation Check를 위한 객체
70
68
  *
71
69
  * ```
72
70
  * <form name="form">
73
- * <input type="text" name="text" data-sv-pattern="password" data-sv-input-name="비밀번호" minlength="0" maxlength="10">
74
- * <input type="text" name="text" data-sv-pattern="password" minlength="0" maxlength="10" required="비밀번호">
75
- * <input type="date" name="sdate1" data-sv-date="date1" data-sv-date-state="S" data-sv-input-name="검색일1">
76
- * <input type="date" name="edate1" data-sv-date="date1" data-sv-date-state="E" data-sv-input-name="검색일1">
77
- * <input type="date" name="sdate2" data-sv-date="date2" data-sv-date-state="S" required="검색일2">
78
- * <input type="date" name="edate2" data-sv-date="date2" data-sv-date-state="E" required="검색일2">
71
+ * <input type="text" name="text" minlength="0" maxlength="10" data-sv-pattern="password" data-sv-input="비밀번호">
72
+ * <input type="text" name="text" minlength="0" maxlength="10" data-sv-pattern="password" required="비밀번호">
73
+ *
74
+ * <input type="date" name="sdate1" data-sv-name="date1" data-sv-state="S" data-sv-date="검색일1">
75
+ * <input type="date" name="edate1" data-sv-name="date1" data-sv-state="E" data-sv-date="검색일1">
76
+ * <input type="date" name="sdate2" data-sv-name="date2" data-sv-state="S" required="검색일2">
77
+ * <input type="date" name="edate2" data-sv-name="date2" data-sv-state="E" required="검색일2">
78
+ *
79
+ * <input type="checkbox" data-sv-name="checkbox1" required="옵션">
80
+ * <input type="checkbox" data-sv-name="checkbox1" required="옵션">
81
+ * <input type="checkbox" name="checkbox2" required="옵션">
82
+ * <input type="checkbox" name="checkbox2" required="옵션">
83
+ *
84
+ * <input type="radio" data-sv-name="radio1" required="옵션">
85
+ * <input type="radio" data-sv-name="radio1" required="옵션">
86
+ * <input type="radio" name="radio2" required="옵션">
87
+ * <input type="radio" name="radio2" required="옵션">
79
88
  * </form>
80
89
  * <script type="importmap">
81
90
  * {
82
91
  * "imports": {
83
- * "@nuka9510/js-util": "https://cdn.jsdelivr.net/npm/@nuka9510/js-util/dist/index.js",
84
- * "@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation/dist/index.js"
92
+ * "@nuka9510/simple-validation": "https://cdn.jsdelivr.net/npm/@nuka9510/simple-validation/dist/esm/index.min.mjs"
85
93
  * }
86
94
  * }
87
95
  * </script>
88
96
  * <script type="module">
89
- * import { SValidation } from "@nuka9510/simple-validation";
97
+ * import { Validation } from "@nuka9510/simple-validation";
90
98
  *
91
- * const validation = new SValidation({regex: {password: /^[\S!?@#$%^&*():;+-=~{}<>\_\[\]\|\\\"\'\,\.\/\`]{6,10}$/}});
99
+ * const validation = new Validation({regex: {password: /^[\S!?@#$%^&*():;+-=~{}<>\_\[\]\|\\\"\'\,\.\/\`]{6,10}$/}});
92
100
  *
93
101
  * validation.run(form);
94
102
  *
@@ -101,16 +109,16 @@ class Validation {
101
109
  * </script>
102
110
  * ```
103
111
  */
104
- constructor(config) { this.init(config); }
105
- /** 객체 초기화 */
106
- init(
107
- /** validation 초기화를 위한 객체 */ config = null) {
112
+ constructor(
113
+ /** validation 초기화를 위한 객체 */ config) { this.#init(config); }
114
+ #init(config = null) {
108
115
  this.#resultInit();
109
- this.#elInit();
116
+ this.#inputInit();
117
+ this.#dateInit();
118
+ this.#checkboxInit();
110
119
  this.#radioInit();
111
120
  this.#regexInit(config?.regex);
112
121
  }
113
- /** 결과 값 초기화 */
114
122
  #resultInit() {
115
123
  this.result = {
116
124
  flag: true,
@@ -119,235 +127,272 @@ class Validation {
119
127
  phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].INIT
120
128
  };
121
129
  }
122
- /** validation check할 Element를 담는 객체 초기화 */
123
- #elInit() { this.#el = {}; }
124
- /** validation check할 radio Element를 담는 객체 초기화 */
130
+ #inputInit() { this.#input = []; }
131
+ #dateInit() { this.#date = {}; }
132
+ #checkboxInit() { this.#checkbox = {}; }
125
133
  #radioInit() { this.#radio = {}; }
126
- /** validation check에 사용할 정규식을 담은 객체 초기화 */
127
134
  #regexInit(regex = null) {
128
135
  this.#regex = (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(regex) &&
129
136
  _nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.isObject(regex))
130
137
  ? {
131
- ...this.#regex,
138
+ ...(this.#regex ?? {}),
132
139
  ...regex
133
140
  }
134
- : { ...this.#regex };
141
+ : { ...(this.#regex ?? {}) };
135
142
  }
136
- /** el 있는 Element들을 required check한다. */
137
- #required(el) {
138
- const required = el.getAttribute('required');
139
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(required)) {
140
- if (el.type == 'radio') {
143
+ #setEl(el) {
144
+ const type = el.getAttribute('type');
145
+ switch (type) {
146
+ case 'date':
147
+ case 'time':
148
+ case 'datetime-local':
149
+ case 'month':
150
+ case 'week':
151
+ this.#setDate(el);
152
+ break;
153
+ case 'checkbox':
154
+ this.#setCheckbox(el);
155
+ break;
156
+ case 'radio':
141
157
  this.#setRadio(el);
142
- }
143
- else if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(el.value)) {
144
- this.result.flag = false;
145
- this.result.alertMsg = `'${required}'을/를 입력해 주세요.`;
146
- this.result.el = el;
147
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED;
148
- }
149
- }
150
- }
151
- /** radio에 있는 Element들을 required check한다. */
152
- #requiredRadio() {
153
- for (const i in this.#radio) {
154
- const el = this.#radio[i][0], flag = this.#radio[i].some((...arg) => arg[0].checked);
155
- if (!flag) {
156
- this.result.flag = false;
157
- this.result.alertMsg = `'${i}'을/를 선택해주세요.`;
158
- this.result.el = el;
159
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED;
160
158
  break;
161
- }
159
+ default:
160
+ this.#setInput(el);
161
+ break;
162
162
  }
163
163
  }
164
- /** el Element를 담는다. */
165
- #setEl(el) {
166
- const pattern = el.dataset['svPattern'], date = el.dataset['svDate'];
167
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(pattern)) {
168
- if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#el.el)) {
169
- this.#el.el = [];
170
- }
171
- this.#el.el?.push(el);
172
- }
173
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(date)) {
174
- const state = el.dataset['svDateState'];
164
+ #setInput(el) { this.#input.push(el); }
165
+ #setDate(el) {
166
+ const name = el.getAttribute('data-sv-name');
167
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(name)) {
168
+ const state = el.getAttribute('data-sv-state');
175
169
  switch (state) {
176
170
  case 'S':
177
171
  case 'E':
178
- if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#el.date)) {
179
- this.#el.date = {};
180
- }
181
- if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#el.date[date])) {
182
- this.#el.date[date] = {};
172
+ if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#date[name])) {
173
+ this.#date[name] = {};
183
174
  }
184
- this.#el.date[date][state] = el;
175
+ this.#date[name][state] = el;
185
176
  break;
177
+ default:
178
+ this.#input.push(el);
179
+ break;
180
+ }
181
+ }
182
+ else {
183
+ this.#input.push(el);
184
+ }
185
+ }
186
+ #setCheckbox(el) {
187
+ const name = el.getAttribute('name') || el.getAttribute('data-sv-name');
188
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(name)) {
189
+ if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#checkbox[name])) {
190
+ this.#checkbox[name] = [];
186
191
  }
192
+ this.#checkbox[name].push(el);
187
193
  }
188
194
  }
189
- /** `#radio`에 type이 'radio'인 Element를 담는다. */
190
195
  #setRadio(el) {
191
- const required = el.getAttribute('required');
192
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(required)) {
193
- if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#radio[required])) {
194
- this.#radio[required] = [el];
196
+ const name = el.getAttribute('name') || el.getAttribute('data-sv-name');
197
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(name)) {
198
+ if (_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(this.#radio[name])) {
199
+ this.#radio[name] = [];
195
200
  }
196
- else {
197
- this.#radio[required].push(el);
201
+ this.#radio[name].push(el);
202
+ }
203
+ }
204
+ #requiredEl() {
205
+ if (this.result.flag) {
206
+ this.#requiredInput();
207
+ }
208
+ if (this.result.flag) {
209
+ this.#requiredDate();
210
+ }
211
+ if (this.result.flag) {
212
+ this.#requiredCheckbox();
213
+ }
214
+ if (this.result.flag) {
215
+ this.#requiredRadio();
216
+ }
217
+ }
218
+ #requiredInput() {
219
+ for (const input of this.#input) {
220
+ const required = input.getAttribute('required');
221
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(required) &&
222
+ _nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(input.value)) {
223
+ this.result = {
224
+ flag: false,
225
+ alertMsg: `'${required}'을/를 입력해 주세요.`,
226
+ el: input,
227
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED
228
+ };
229
+ break;
198
230
  }
199
231
  }
200
232
  }
201
- /**
202
- * Element들을 validation check 한다.
203
- * ```
204
- * -----------------------
205
- * date : isDate
206
- * -----------------------
207
- * el : isPattern
208
- * ```
209
- */
210
- #match() {
211
- for (const i in this.#el) {
212
- if (this.result.flag) {
213
- switch (i) {
214
- case 'date':
215
- this.#isDate(this.#el[i]);
216
- break;
217
- case 'el':
218
- this.#isPattern(this.#el[i]);
219
- break;
233
+ #requiredDate() {
234
+ for (const name in this.#date) {
235
+ for (const state in this.#date[name]) {
236
+ const date = this.#date[name][state], required = date.getAttribute('required');
237
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(required) &&
238
+ _nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(date.value)) {
239
+ this.result = {
240
+ flag: false,
241
+ alertMsg: `'${required}'을/를 입력해 주세요.`,
242
+ el: date,
243
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED
244
+ };
245
+ break;
220
246
  }
221
247
  }
222
- else {
248
+ }
249
+ }
250
+ #requiredCheckbox() {
251
+ for (const name in this.#checkbox) {
252
+ const checkboxList = this.#checkbox[name].filter((...arg) => !_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(arg[0].getAttribute('required')));
253
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(checkboxList) &&
254
+ checkboxList.some((...arg) => !arg[0].checked)) {
255
+ const checkbox = checkboxList.find((...arg) => !arg[0].checked), required = checkbox.getAttribute('required');
256
+ this.result = {
257
+ flag: false,
258
+ alertMsg: `'${required}'을/를 선택해주세요.`,
259
+ el: checkbox,
260
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED
261
+ };
223
262
  break;
224
263
  }
225
264
  }
226
265
  }
227
- /** date check */
228
- #isDate(el) {
229
- for (const i in el) {
230
- if (this.result.flag) {
231
- const sdate = el[i].S.value, edate = el[i].E.value;
232
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(sdate) &&
233
- !_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(edate)) {
234
- const inputName = el[i].S.dataset['svInputName'] ||
235
- el[i].E.dataset['svInputName'], required = el[i].S.getAttribute('required') ||
236
- el[i].E.getAttribute('required');
237
- if ((new Date(sdate)).getTime() > (new Date(edate)).getTime()) {
238
- this.result.flag = false;
239
- this.result.alertMsg = `'${inputName || required}'의 시작일이 종료일 보다 늦습니다.`;
240
- this.result.el = el[i].S;
241
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].MATCH;
242
- }
243
- }
244
- }
245
- else {
266
+ #requiredRadio() {
267
+ for (const name in this.#radio) {
268
+ const radioList = this.#radio[name].filter((...arg) => !_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(arg[0].getAttribute('required')));
269
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(radioList) &&
270
+ radioList.every((...arg) => !arg[0].checked)) {
271
+ const radio = radioList.find((...arg) => !arg[0].checked), required = radio.getAttribute('required');
272
+ this.result = {
273
+ flag: false,
274
+ alertMsg: `'${required}'을/를 선택해주세요.`,
275
+ el: radio,
276
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].REQUIRED
277
+ };
246
278
  break;
247
279
  }
248
280
  }
249
281
  }
250
- /** regex check */
251
- #isPattern(el) {
252
- if (Array.isArray(el)) {
253
- for (const i of el) {
254
- const pattern = i.dataset['svPattern'], inputName = i.dataset['svInputName'], required = i.getAttribute('required'), val = i.value;
255
- if (Object.keys(this.#regex).includes(pattern)) {
256
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(val) &&
257
- !this.#regex[pattern].test(val)) {
258
- this.result.flag = false;
259
- this.result.alertMsg = `'${inputName || required}'의 형식이 올바르지 않습니다.`;
260
- this.result.el = i;
261
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].MATCH;
282
+ #length() {
283
+ for (const input of this.#input) {
284
+ const input_ = input.getAttribute('data-sv-input') || input.getAttribute('required'), length = input.value.length;
285
+ if (!(input instanceof HTMLSelectElement)) {
286
+ if (input.minLength >= 0 &&
287
+ input.maxLength >= 0) {
288
+ if (length < input.minLength ||
289
+ length > input.maxLength) {
290
+ this.result = {
291
+ flag: false,
292
+ alertMsg: `'${input_}'은/는 ${input.minLength}~${input.maxLength}자 이내로 입력해주세요.`,
293
+ el: input,
294
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH
295
+ };
296
+ break;
297
+ }
298
+ }
299
+ else if (input.minLength >= 0 &&
300
+ input.maxLength < 0) {
301
+ if (length < input.minLength) {
302
+ this.result = {
303
+ flag: false,
304
+ alertMsg: `'${input_}'은/는 ${input.minLength}자 이상으로 입력해주세요.`,
305
+ el: input,
306
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH
307
+ };
308
+ break;
309
+ }
310
+ }
311
+ else if (input.minLength < 0 &&
312
+ input.maxLength >= 0) {
313
+ if (length > input.maxLength) {
314
+ this.result = {
315
+ flag: false,
316
+ alertMsg: `'${input_}'은/는 ${input.maxLength}자 이하로 입력해주세요.`,
317
+ el: input,
318
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH
319
+ };
262
320
  break;
263
321
  }
264
322
  }
265
323
  }
266
324
  }
267
- else {
268
- const pattern = el.dataset['svPattern'], inputName = el.dataset['svInputName'], required = el.getAttribute('required'), val = el.value;
269
- if (Object.keys(this.#regex).includes(pattern)) {
270
- if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(val) &&
271
- !this.#regex[pattern].test(val)) {
272
- this.result.flag = false;
273
- this.result.alertMsg = `'${inputName || required}'의 형식이 올바르지 않습니다.`;
274
- this.result.el = el;
275
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].MATCH;
325
+ }
326
+ #match(regex) {
327
+ if (this.result.flag) {
328
+ this.#isPattern(regex);
329
+ }
330
+ if (this.result.flag) {
331
+ this.#isDate();
332
+ }
333
+ }
334
+ #isPattern(regex = null) {
335
+ const regex_ = {
336
+ ...this.#regex,
337
+ ...(regex ?? {})
338
+ };
339
+ for (const input of this.#input) {
340
+ const pattern = input.getAttribute('data-sv-pattern');
341
+ if (Object.keys(regex_).includes(pattern)) {
342
+ const input_ = input.getAttribute('data-sv-input') || input.getAttribute('required'), value = input.value;
343
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(value) &&
344
+ !regex_[pattern].test(value)) {
345
+ this.result = {
346
+ flag: false,
347
+ alertMsg: `'${input_}'의 형식이 올바르지 않습니다.`,
348
+ el: input,
349
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].MATCH
350
+ };
351
+ break;
276
352
  }
277
353
  }
278
354
  }
279
355
  }
280
- /** Element value의 length를 check 한다. */
281
- #length() {
282
- for (const i in this.#el) {
283
- if (i == 'el' &&
284
- this.result.flag) {
285
- for (const j of this.#el[i]) {
286
- const inputName = j.dataset['svInputName'], required = j.getAttribute('required'), val = j.value.length;
287
- if (!(j instanceof HTMLSelectElement)) {
288
- if (j.minLength >= 0 &&
289
- j.maxLength >= 0) {
290
- if (val < j.minLength ||
291
- val > j.maxLength) {
292
- this.result.flag = false;
293
- this.result.alertMsg = `'${inputName || required}'은/는 ${j.minLength}~${j.maxLength}자 이내로 입력해주세요.`;
294
- this.result.el = j;
295
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH;
296
- break;
297
- }
298
- }
299
- else if (j.minLength >= 0 &&
300
- j.maxLength < 0) {
301
- if (val < j.minLength) {
302
- this.result.flag = false;
303
- this.result.alertMsg = `'${inputName || required}'은/는 ${j.minLength}자 이상으로 입력해주세요.`;
304
- this.result.el = j;
305
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH;
306
- break;
307
- }
308
- }
309
- else if (j.minLength < 0 &&
310
- j.maxLength >= 0) {
311
- if (val > j.maxLength) {
312
- this.result.flag = false;
313
- this.result.alertMsg = `'${inputName || required}'은/는 ${j.maxLength}자 이하로 입력해주세요.`;
314
- this.result.el = j;
315
- this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].LENGTH;
316
- break;
317
- }
318
- }
319
- }
356
+ #isDate() {
357
+ for (const name in this.#date) {
358
+ const date = this.#date[name], sdate = date.S, edate = date.E;
359
+ if (!_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(sdate) &&
360
+ !_nuka9510_js_util__WEBPACK_IMPORTED_MODULE_0__.Util.empty(edate)) {
361
+ const input_ = sdate.getAttribute('data-sv-date') ||
362
+ edate.getAttribute('data-sv-date') ||
363
+ sdate.getAttribute('required') ||
364
+ edate.getAttribute('required');
365
+ if (sdate.valueAsNumber > edate.valueAsNumber) {
366
+ this.result = {
367
+ flag: false,
368
+ alertMsg: `'${input_}'의 시작일이 종료일 보다 늦습니다.`,
369
+ el: sdate,
370
+ phase: _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].MATCH
371
+ };
372
+ break;
320
373
  }
321
374
  }
322
- else if (!this.result.flag) {
323
- break;
324
- }
325
375
  }
326
376
  }
327
377
  /** validation을 실행한다. */
328
- run(form) {
329
- this.init();
378
+ run(form,
379
+ /** validation 추가 설정*/ config) {
380
+ this.#init();
330
381
  for (const el of form.elements) {
331
- if (this.result.flag) {
332
- if (['INPUT', 'SELECT', 'TEXTAREA'].includes(el.tagName)) {
333
- if (!el.disabled) {
334
- this.#required(el);
335
- this.#setEl(el);
336
- }
382
+ if (['INPUT', 'SELECT', 'TEXTAREA'].includes(el.tagName)) {
383
+ if (!el.disabled) {
384
+ this.#setEl(el);
337
385
  }
338
386
  }
339
- else {
340
- break;
341
- }
342
387
  }
343
388
  if (this.result.flag) {
344
- this.#requiredRadio();
389
+ this.#requiredEl();
345
390
  }
346
391
  if (this.result.flag) {
347
- this.#match();
392
+ this.#length();
348
393
  }
349
394
  if (this.result.flag) {
350
- this.#length();
395
+ this.#match(config?.regex);
351
396
  }
352
397
  if (this.result.flag) {
353
398
  this.result.phase = _enums_phase_js__WEBPACK_IMPORTED_MODULE_1__["default"].DONE;