@pdg/react-form 1.0.90 → 1.0.92
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/README.md +1 -1
- package/dist/@util/index.d.ts +0 -4
- package/dist/index.esm.js +448 -579
- package/dist/index.js +555 -686
- package/package.json +4 -3
- package/dist/@util/compare.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var React=require('react'),classNames=require('classnames'),material=require('@mui/material'),dayjs=require('dayjs'),reactHook=require('@pdg/react-hook'),reactResizeDetector=require('react-resize-detector'),reactNumberFormat=require('react-number-format'),iconsMaterial=require('@mui/icons-material'),tinymceReact=require('@tinymce/tinymce-react'),CircularProgress=require('@mui/material/CircularProgress'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),xDatePickers=require('@mui/x-date-pickers'),reactComponent=require('@pdg/react-component'),SimpleBar=require('simplebar-react');require('dayjs/locale/ko');/******************************************************************************
|
|
1
|
+
'use strict';var React=require('react'),classNames=require('classnames'),material=require('@mui/material'),util=require('@pdg/util'),dayjs=require('dayjs'),reactHook=require('@pdg/react-hook'),reactResizeDetector=require('react-resize-detector'),reactNumberFormat=require('react-number-format'),iconsMaterial=require('@mui/icons-material'),tinymceReact=require('@tinymce/tinymce-react'),CircularProgress=require('@mui/material/CircularProgress'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),xDatePickers=require('@mui/x-date-pickers'),reactComponent=require('@pdg/react-component'),SimpleBar=require('simplebar-react');require('dayjs/locale/ko');/******************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -55,355 +55,6 @@ function __makeTemplateObject(cooked, raw) {
|
|
|
55
55
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
56
56
|
var e = new Error(message);
|
|
57
57
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
58
|
-
};var empty = function (v) {
|
|
59
|
-
var result = false;
|
|
60
|
-
if (v == null) {
|
|
61
|
-
result = true;
|
|
62
|
-
}
|
|
63
|
-
else if (typeof v === 'string') {
|
|
64
|
-
result = v === '';
|
|
65
|
-
}
|
|
66
|
-
else if (typeof v === 'object') {
|
|
67
|
-
if (Array.isArray(v)) {
|
|
68
|
-
result = v.length === 0;
|
|
69
|
-
}
|
|
70
|
-
else if (!(v instanceof Date)) {
|
|
71
|
-
result = Object.entries(v).length === 0;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
};
|
|
76
|
-
var notEmpty = function (v) {
|
|
77
|
-
return !empty(v);
|
|
78
|
-
};
|
|
79
|
-
var isSame = function (v1, v2) {
|
|
80
|
-
if (v1 === v2)
|
|
81
|
-
return true;
|
|
82
|
-
if (typeof v1 !== typeof v2)
|
|
83
|
-
return false;
|
|
84
|
-
if (v1 == null || v2 == null)
|
|
85
|
-
return false;
|
|
86
|
-
if (Array.isArray(v1) && Array.isArray(v2)) {
|
|
87
|
-
if (v1.length !== v2.length)
|
|
88
|
-
return false;
|
|
89
|
-
for (var i = 0; i < v1.length; i += 1) {
|
|
90
|
-
if (v1[i] !== v2[i])
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return v1 === v2;
|
|
96
|
-
}
|
|
97
|
-
return true;
|
|
98
|
-
};function getDateValidationErrorText(error) {
|
|
99
|
-
switch (error) {
|
|
100
|
-
case 'invalidDate':
|
|
101
|
-
return '형식이 일치하지 않습니다.';
|
|
102
|
-
case 'shouldDisableDate':
|
|
103
|
-
case 'shouldDisableMonth':
|
|
104
|
-
case 'shouldDisableYear':
|
|
105
|
-
case 'disableFuture':
|
|
106
|
-
case 'disablePast':
|
|
107
|
-
case 'minDate':
|
|
108
|
-
case 'maxDate':
|
|
109
|
-
return '선택할 수 없는 날짜입니다.';
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
//--------------------------------------------------------------------------------------------------------------------
|
|
113
|
-
var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
114
|
-
var DEFAULT_DATE_FORM_VALUE_FORMAT = 'YYYY-MM-DD';
|
|
115
|
-
var DEFAULT_DATE_TIME_HOUR_FORMAT = 'YYYY-MM-DD HH시';
|
|
116
|
-
var DEFAULT_DATE_TIME_HOUR_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:00:00';
|
|
117
|
-
var DEFAULT_DATE_TIME_MINUTE_FORMAT = 'YYYY-MM-DD HH:mm';
|
|
118
|
-
var DEFAULT_DATE_TIME_MINUTE_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:mm:00';
|
|
119
|
-
var DEFAULT_DATE_TIME_SECOND_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
120
|
-
var DEFAULT_DATE_TIME_SECOND_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
121
|
-
var DEFAULT_TIME_HOUR_FORMAT = 'HH시';
|
|
122
|
-
var DEFAULT_TIME_HOUR_FORM_VALUE_FORMAT = 'HH:00:00';
|
|
123
|
-
var DEFAULT_TIME_MINUTE_FORMAT = 'HH:mm';
|
|
124
|
-
var DEFAULT_TIME_MINUTE_FORM_VALUE_FORMAT = 'HH:mm:00';
|
|
125
|
-
var DEFAULT_TIME_SECOND_FORMAT = 'HH:mm:ss';
|
|
126
|
-
var DEFAULT_TIME_SECOND_FORM_VALUE_FORMAT = 'HH:mm:ss';
|
|
127
|
-
function getDateTimeFormat(type, time) {
|
|
128
|
-
switch (type) {
|
|
129
|
-
case 'date':
|
|
130
|
-
return DEFAULT_DATE_FORMAT;
|
|
131
|
-
case 'date_time':
|
|
132
|
-
if (time) {
|
|
133
|
-
switch (time) {
|
|
134
|
-
case 'hour':
|
|
135
|
-
return DEFAULT_DATE_TIME_HOUR_FORMAT;
|
|
136
|
-
case 'minute':
|
|
137
|
-
return DEFAULT_DATE_TIME_MINUTE_FORMAT;
|
|
138
|
-
case 'second':
|
|
139
|
-
return DEFAULT_DATE_TIME_SECOND_FORMAT;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
throw new Error("util::date_time::getDateTimeFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
144
|
-
}
|
|
145
|
-
break;
|
|
146
|
-
case 'time':
|
|
147
|
-
if (time) {
|
|
148
|
-
switch (time) {
|
|
149
|
-
case 'hour':
|
|
150
|
-
return DEFAULT_TIME_HOUR_FORMAT;
|
|
151
|
-
case 'minute':
|
|
152
|
-
return DEFAULT_TIME_MINUTE_FORMAT;
|
|
153
|
-
case 'second':
|
|
154
|
-
return DEFAULT_TIME_SECOND_FORMAT;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
throw new Error("util::date_time::getDateTimeFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
159
|
-
}
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function getDateTimeFormValueFormat(type, time) {
|
|
164
|
-
switch (type) {
|
|
165
|
-
case 'date':
|
|
166
|
-
return DEFAULT_DATE_FORM_VALUE_FORMAT;
|
|
167
|
-
case 'date_time':
|
|
168
|
-
if (time) {
|
|
169
|
-
switch (time) {
|
|
170
|
-
case 'hour':
|
|
171
|
-
return DEFAULT_DATE_TIME_HOUR_FORM_VALUE_FORMAT;
|
|
172
|
-
case 'minute':
|
|
173
|
-
return DEFAULT_DATE_TIME_MINUTE_FORM_VALUE_FORMAT;
|
|
174
|
-
case 'second':
|
|
175
|
-
return DEFAULT_DATE_TIME_SECOND_FORM_VALUE_FORMAT;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
throw new Error("util::date_time::getDateTimeFormValueFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
180
|
-
}
|
|
181
|
-
break;
|
|
182
|
-
case 'time':
|
|
183
|
-
if (time) {
|
|
184
|
-
switch (time) {
|
|
185
|
-
case 'hour':
|
|
186
|
-
return DEFAULT_TIME_HOUR_FORM_VALUE_FORMAT;
|
|
187
|
-
case 'minute':
|
|
188
|
-
return DEFAULT_TIME_MINUTE_FORM_VALUE_FORMAT;
|
|
189
|
-
case 'second':
|
|
190
|
-
return DEFAULT_TIME_SECOND_FORM_VALUE_FORMAT;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
throw new Error("util::date_time::getDateTimeFormValueFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
195
|
-
}
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function getAvailableDateValFormat(type, time) {
|
|
200
|
-
var availableDateType;
|
|
201
|
-
if (time) {
|
|
202
|
-
availableDateType = getAvailableDateType(type, time);
|
|
203
|
-
}
|
|
204
|
-
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
205
|
-
availableDateType = getAvailableDateType(type, time);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
availableDateType = type;
|
|
209
|
-
}
|
|
210
|
-
switch (availableDateType) {
|
|
211
|
-
case 'year':
|
|
212
|
-
return 'YYYY';
|
|
213
|
-
case 'month':
|
|
214
|
-
return 'YYYYMM';
|
|
215
|
-
case 'day':
|
|
216
|
-
return 'YYYYMMDD';
|
|
217
|
-
case 'hour':
|
|
218
|
-
return 'YYYYMMDDHH';
|
|
219
|
-
case 'minute':
|
|
220
|
-
return 'YYYYMMDDHHmm';
|
|
221
|
-
case 'second':
|
|
222
|
-
return 'YYYYMMDDHHmmss';
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
/********************************************************************************************************************
|
|
226
|
-
* getAvailableDateType
|
|
227
|
-
* ******************************************************************************************************************/
|
|
228
|
-
function getAvailableDateType(type, time) {
|
|
229
|
-
switch (type) {
|
|
230
|
-
case 'date':
|
|
231
|
-
return 'day';
|
|
232
|
-
case 'date_time':
|
|
233
|
-
if (time) {
|
|
234
|
-
switch (time) {
|
|
235
|
-
case 'hour':
|
|
236
|
-
return 'hour';
|
|
237
|
-
case 'minute':
|
|
238
|
-
return 'minute';
|
|
239
|
-
case 'second':
|
|
240
|
-
return 'second';
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
throw new Error("util::date_time::getAvailableDateType - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
case 'time':
|
|
248
|
-
throw new Error("util::date_time::getAvailableDateType - '".concat(type, "' type \uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."));
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/********************************************************************************************************************
|
|
252
|
-
* makeAvailableDate
|
|
253
|
-
* ******************************************************************************************************************/
|
|
254
|
-
function makeAvailableDate(minDate, maxDate, disablePast, disableFuture) {
|
|
255
|
-
var now = dayjs();
|
|
256
|
-
var min = null;
|
|
257
|
-
var max = null;
|
|
258
|
-
if (disablePast) {
|
|
259
|
-
min = now;
|
|
260
|
-
}
|
|
261
|
-
if (minDate) {
|
|
262
|
-
if (min) {
|
|
263
|
-
if (minDate.isAfter(min, 'date')) {
|
|
264
|
-
min = minDate;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
min = minDate;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
if (disableFuture) {
|
|
272
|
-
max = now;
|
|
273
|
-
}
|
|
274
|
-
if (maxDate) {
|
|
275
|
-
if (max) {
|
|
276
|
-
if (maxDate.isBefore(max, 'date')) {
|
|
277
|
-
max = maxDate;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
max = maxDate;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
var minItem = min
|
|
285
|
-
? {
|
|
286
|
-
date: min,
|
|
287
|
-
year: Number(min.format(getAvailableDateValFormat('year'))),
|
|
288
|
-
month: Number(min.format(getAvailableDateValFormat('month'))),
|
|
289
|
-
day: Number(min.format(getAvailableDateValFormat('day'))),
|
|
290
|
-
hour: Number(min.format(getAvailableDateValFormat('hour'))),
|
|
291
|
-
minute: Number(min.format(getAvailableDateValFormat('minute'))),
|
|
292
|
-
second: Number(min.format(getAvailableDateValFormat('second'))),
|
|
293
|
-
}
|
|
294
|
-
: null;
|
|
295
|
-
var maxItem = max
|
|
296
|
-
? {
|
|
297
|
-
date: max,
|
|
298
|
-
year: Number(max.format(getAvailableDateValFormat('year'))),
|
|
299
|
-
month: Number(max.format(getAvailableDateValFormat('month'))),
|
|
300
|
-
day: Number(max.format(getAvailableDateValFormat('day'))),
|
|
301
|
-
hour: Number(max.format(getAvailableDateValFormat('hour'))),
|
|
302
|
-
minute: Number(max.format(getAvailableDateValFormat('minute'))),
|
|
303
|
-
second: Number(max.format(getAvailableDateValFormat('second'))),
|
|
304
|
-
}
|
|
305
|
-
: null;
|
|
306
|
-
return [minItem, maxItem];
|
|
307
|
-
}
|
|
308
|
-
function getAvailableDate(availableDate, type, time) {
|
|
309
|
-
var availableDateType;
|
|
310
|
-
if (time) {
|
|
311
|
-
availableDateType = getAvailableDateType(type, time);
|
|
312
|
-
}
|
|
313
|
-
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
314
|
-
availableDateType = getAvailableDateType(type, time);
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
availableDateType = type;
|
|
318
|
-
}
|
|
319
|
-
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
320
|
-
var availableDateValFormat = getAvailableDateValFormat(availableDateType);
|
|
321
|
-
return [
|
|
322
|
-
availableDateVal[0] ? dayjs(availableDateVal[0].toString(), availableDateValFormat) : null,
|
|
323
|
-
availableDateVal[1] ? dayjs(availableDateVal[1].toString(), availableDateValFormat) : null,
|
|
324
|
-
];
|
|
325
|
-
}
|
|
326
|
-
function getAvailableDateVal(availableDate, type, time) {
|
|
327
|
-
var availableDateType;
|
|
328
|
-
if (time) {
|
|
329
|
-
availableDateType = getAvailableDateType(type, time);
|
|
330
|
-
}
|
|
331
|
-
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
332
|
-
availableDateType = getAvailableDateType(type, time);
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
availableDateType = type;
|
|
336
|
-
}
|
|
337
|
-
return [
|
|
338
|
-
availableDate[0] ? availableDate[0][availableDateType] : null,
|
|
339
|
-
availableDate[1] ? availableDate[1][availableDateType] : null,
|
|
340
|
-
];
|
|
341
|
-
}
|
|
342
|
-
/********************************************************************************************************************
|
|
343
|
-
* getDateVal
|
|
344
|
-
* ******************************************************************************************************************/
|
|
345
|
-
function getDateValForAvailableDate(date, type, time) {
|
|
346
|
-
var format = getAvailableDateValFormat(type, time);
|
|
347
|
-
return Number(date.format(format));
|
|
348
|
-
}
|
|
349
|
-
function isDateAvailable(date, availableDate, type, time) {
|
|
350
|
-
var availableDateType;
|
|
351
|
-
if (time) {
|
|
352
|
-
availableDateType = getAvailableDateType(type, time);
|
|
353
|
-
}
|
|
354
|
-
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
355
|
-
availableDateType = getAvailableDateType(type, time);
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
availableDateType = type;
|
|
359
|
-
}
|
|
360
|
-
var dateVal = Number(date.format(getAvailableDateValFormat(availableDateType)));
|
|
361
|
-
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
362
|
-
return !((availableDateVal[0] && dateVal < availableDateVal[0]) ||
|
|
363
|
-
(availableDateVal[1] && dateVal > availableDateVal[1]));
|
|
364
|
-
}
|
|
365
|
-
function checkDateAvailable(date, availableDate, type, time) {
|
|
366
|
-
var availableDateType;
|
|
367
|
-
if (time) {
|
|
368
|
-
availableDateType = getAvailableDateType(type, time);
|
|
369
|
-
}
|
|
370
|
-
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
371
|
-
availableDateType = getAvailableDateType(type, time);
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
availableDateType = type;
|
|
375
|
-
}
|
|
376
|
-
var dateVal = Number(date.format(getAvailableDateValFormat(availableDateType)));
|
|
377
|
-
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
378
|
-
if (availableDateVal[0] && dateVal < availableDateVal[0])
|
|
379
|
-
return 'min';
|
|
380
|
-
if (availableDateVal[1] && dateVal > availableDateVal[1])
|
|
381
|
-
return 'max';
|
|
382
|
-
return 'available';
|
|
383
|
-
}function getFileSizeText(bytes, dp) {
|
|
384
|
-
if (dp === void 0) { dp = 1; }
|
|
385
|
-
var thresh = 1024;
|
|
386
|
-
if (Math.abs(bytes) < thresh) {
|
|
387
|
-
return "".concat(bytes, " Byte");
|
|
388
|
-
}
|
|
389
|
-
var units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
390
|
-
var u = -1;
|
|
391
|
-
var r = Math.pow(10, dp);
|
|
392
|
-
do {
|
|
393
|
-
bytes /= thresh;
|
|
394
|
-
u += 1;
|
|
395
|
-
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
396
|
-
return "".concat(bytes.toFixed(dp), " ").concat(units[u]);
|
|
397
|
-
}function ToForwardRefExoticComponent(component, ext) {
|
|
398
|
-
var fComponent = component;
|
|
399
|
-
fComponent.displayName = ext === null || ext === void 0 ? void 0 : ext.displayName;
|
|
400
|
-
fComponent.defaultProps = ext === null || ext === void 0 ? void 0 : ext.defaultProps;
|
|
401
|
-
return component;
|
|
402
|
-
}
|
|
403
|
-
function AutoTypeForwardRef(render) {
|
|
404
|
-
return React.forwardRef(render);
|
|
405
|
-
}var nextTick = function (callback) {
|
|
406
|
-
setTimeout(callback, 1);
|
|
407
58
|
};var FormDefaultProps = {
|
|
408
59
|
variant: 'outlined',
|
|
409
60
|
size: 'medium',
|
|
@@ -526,7 +177,7 @@ function AutoTypeForwardRef(render) {
|
|
|
526
177
|
}
|
|
527
178
|
break;
|
|
528
179
|
default:
|
|
529
|
-
if (empty(value)) {
|
|
180
|
+
if (util.empty(value)) {
|
|
530
181
|
value = '';
|
|
531
182
|
}
|
|
532
183
|
else if (Array.isArray(value)) {
|
|
@@ -638,7 +289,7 @@ function AutoTypeForwardRef(render) {
|
|
|
638
289
|
}
|
|
639
290
|
else {
|
|
640
291
|
onInvalid && onInvalid(invalidItems);
|
|
641
|
-
nextTick(function () {
|
|
292
|
+
util.nextTick(function () {
|
|
642
293
|
var _a;
|
|
643
294
|
(_a = valueItems[firstInvalidItemId]) === null || _a === void 0 ? void 0 : _a.focusValidate();
|
|
644
295
|
});
|
|
@@ -680,7 +331,7 @@ function AutoTypeForwardRef(render) {
|
|
|
680
331
|
case 'FormYearRangePicker': {
|
|
681
332
|
var commands_1 = valueItem;
|
|
682
333
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
683
|
-
if (notEmpty(subKey)) {
|
|
334
|
+
if (util.notEmpty(subKey)) {
|
|
684
335
|
if (subKey === commands_1.getFormValueFromNameSuffix()) {
|
|
685
336
|
return value[0];
|
|
686
337
|
}
|
|
@@ -698,7 +349,7 @@ function AutoTypeForwardRef(render) {
|
|
|
698
349
|
case 'FormMonthPicker': {
|
|
699
350
|
var commands_2 = valueItem;
|
|
700
351
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
701
|
-
if (notEmpty(subKey)) {
|
|
352
|
+
if (util.notEmpty(subKey)) {
|
|
702
353
|
if (subKey === commands_2.getFormValueYearNameSuffix()) {
|
|
703
354
|
return value.year;
|
|
704
355
|
}
|
|
@@ -716,7 +367,7 @@ function AutoTypeForwardRef(render) {
|
|
|
716
367
|
case 'FormMonthRangePicker': {
|
|
717
368
|
var commands_3 = valueItem;
|
|
718
369
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
719
|
-
if (notEmpty(subKey)) {
|
|
370
|
+
if (util.notEmpty(subKey)) {
|
|
720
371
|
if (subKey === commands_3.getFormValueFromYearNameSuffix()) {
|
|
721
372
|
return value[0].year;
|
|
722
373
|
}
|
|
@@ -1485,7 +1136,7 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
1485
1136
|
* ******************************************************************************************************************/
|
|
1486
1137
|
var _k = reactHook.useAutoUpdateState(initValue, getFinalValue), value = _k[0], setValue = _k[1];
|
|
1487
1138
|
React.useEffect(function () {
|
|
1488
|
-
setShowClear(clear ? notEmpty(value) : false);
|
|
1139
|
+
setShowClear(clear ? util.notEmpty(value) : false);
|
|
1489
1140
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1490
1141
|
}, [value]);
|
|
1491
1142
|
reactHook.useFirstSkipEffect(function () {
|
|
@@ -1520,17 +1171,17 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
1520
1171
|
* Function - validate
|
|
1521
1172
|
* ******************************************************************************************************************/
|
|
1522
1173
|
var validate = React.useCallback(function (value) {
|
|
1523
|
-
if (required && empty(value)) {
|
|
1174
|
+
if (required && util.empty(value)) {
|
|
1524
1175
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
1525
1176
|
return false;
|
|
1526
1177
|
}
|
|
1527
|
-
if (notEmpty(value) && validPattern) {
|
|
1178
|
+
if (util.notEmpty(value) && validPattern) {
|
|
1528
1179
|
if (!new RegExp(validPattern).test(value)) {
|
|
1529
1180
|
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
1530
1181
|
return false;
|
|
1531
1182
|
}
|
|
1532
1183
|
}
|
|
1533
|
-
if (notEmpty(value) && invalidPattern) {
|
|
1184
|
+
if (util.notEmpty(value) && invalidPattern) {
|
|
1534
1185
|
if (new RegExp(invalidPattern).test(value)) {
|
|
1535
1186
|
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
1536
1187
|
return false;
|
|
@@ -1566,7 +1217,7 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
1566
1217
|
setValue(finalValue);
|
|
1567
1218
|
focus();
|
|
1568
1219
|
if (!noFormValueItem) {
|
|
1569
|
-
nextTick(function () {
|
|
1220
|
+
util.nextTick(function () {
|
|
1570
1221
|
onValueChangeByUser(name, finalValue);
|
|
1571
1222
|
onRequestSearchSubmit(name, finalValue);
|
|
1572
1223
|
});
|
|
@@ -1702,7 +1353,7 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
1702
1353
|
var finalValue = getFinalValue(e.target.value);
|
|
1703
1354
|
setValue(finalValue);
|
|
1704
1355
|
if (!noFormValueItem) {
|
|
1705
|
-
nextTick(function () {
|
|
1356
|
+
util.nextTick(function () {
|
|
1706
1357
|
onValueChangeByUser(name, finalValue);
|
|
1707
1358
|
if (select) {
|
|
1708
1359
|
onRequestSearchSubmit(name, finalValue);
|
|
@@ -1797,7 +1448,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1797
1448
|
* Effect
|
|
1798
1449
|
* ******************************************************************************************************************/
|
|
1799
1450
|
React.useEffect(function () {
|
|
1800
|
-
if (!
|
|
1451
|
+
if (!util.equal(value, initValue)) {
|
|
1801
1452
|
if (onChange)
|
|
1802
1453
|
onChange(value);
|
|
1803
1454
|
onValueChange(name, value);
|
|
@@ -1815,7 +1466,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1815
1466
|
* Function - validate
|
|
1816
1467
|
* ******************************************************************************************************************/
|
|
1817
1468
|
var validate = React.useCallback(function (value) {
|
|
1818
|
-
if (required && empty(value)) {
|
|
1469
|
+
if (required && util.empty(value)) {
|
|
1819
1470
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
1820
1471
|
return false;
|
|
1821
1472
|
}
|
|
@@ -1848,7 +1499,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1848
1499
|
setValue(lastValue);
|
|
1849
1500
|
}, getValue: function () { return lastValue; }, setValue: function (newValue) {
|
|
1850
1501
|
var finalValue = getFinalValue(newValue);
|
|
1851
|
-
if (!
|
|
1502
|
+
if (!util.equal(lastValue, finalValue)) {
|
|
1852
1503
|
lastValue = finalValue;
|
|
1853
1504
|
setValueSet(new Set(lastValue));
|
|
1854
1505
|
setValue(lastValue);
|
|
@@ -1867,7 +1518,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1867
1518
|
Array.from(valueSet);
|
|
1868
1519
|
var finalValue_1 = getFinalValue(valueSet);
|
|
1869
1520
|
setValue(finalValue_1);
|
|
1870
|
-
nextTick(function () {
|
|
1521
|
+
util.nextTick(function () {
|
|
1871
1522
|
setInputValue('');
|
|
1872
1523
|
onValueChangeByUser(name, finalValue_1);
|
|
1873
1524
|
onRequestSearchSubmit(name, finalValue_1);
|
|
@@ -1879,7 +1530,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1879
1530
|
valueSet.delete(tag);
|
|
1880
1531
|
var finalValue_2 = getFinalValue(valueSet);
|
|
1881
1532
|
setValue(finalValue_2);
|
|
1882
|
-
nextTick(function () {
|
|
1533
|
+
util.nextTick(function () {
|
|
1883
1534
|
onValueChangeByUser(name, finalValue_2);
|
|
1884
1535
|
onRequestSearchSubmit(name, finalValue_2);
|
|
1885
1536
|
});
|
|
@@ -1906,7 +1557,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1906
1557
|
if ([' ', ',', 'Enter'].includes(e.key)) {
|
|
1907
1558
|
e.preventDefault();
|
|
1908
1559
|
e.stopPropagation();
|
|
1909
|
-
if (notEmpty(inputValue)) {
|
|
1560
|
+
if (util.notEmpty(inputValue)) {
|
|
1910
1561
|
appendTag(inputValue);
|
|
1911
1562
|
}
|
|
1912
1563
|
}
|
|
@@ -1920,7 +1571,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1920
1571
|
setInputValue(value);
|
|
1921
1572
|
}, []);
|
|
1922
1573
|
var handleBlur = React.useCallback(function (e) {
|
|
1923
|
-
if (notEmpty(inputValue)) {
|
|
1574
|
+
if (util.notEmpty(inputValue)) {
|
|
1924
1575
|
appendTag(inputValue);
|
|
1925
1576
|
}
|
|
1926
1577
|
if (onBlur)
|
|
@@ -1944,7 +1595,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1944
1595
|
var renderProps = __assign({}, props);
|
|
1945
1596
|
renderProps.InputLabelProps = __assign(__assign({}, renderProps.InputLabelProps), { htmlFor: params.InputLabelProps.htmlFor, id: params.InputLabelProps.id });
|
|
1946
1597
|
renderProps.InputProps = __assign(__assign({}, renderProps.InputProps), { className: classNames((_a = renderProps.InputProps) === null || _a === void 0 ? void 0 : _a.className, params.InputProps.className), ref: params.InputProps.ref });
|
|
1947
|
-
if (notEmpty(params.InputProps.startAdornment)) {
|
|
1598
|
+
if (util.notEmpty(params.InputProps.startAdornment)) {
|
|
1948
1599
|
renderProps.InputProps.startAdornment = (React.createElement(React.Fragment, null,
|
|
1949
1600
|
renderProps.InputProps.startAdornment,
|
|
1950
1601
|
params.InputProps.startAdornment));
|
|
@@ -1964,257 +1615,499 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
1964
1615
|
return (React.createElement(FormText, __assign({}, renderProps, { ref: handleRef, name: name, className: classNames(className, 'FormValueItem', 'FormTag'), error: error, disabled: disabled, fullWidth: fullWidth, required: required, value: inputValue, exceptValue: exceptValue, helperText: error ? errorHelperText : helperText, onKeyDown: handleInputKeyDown, onChange: handleInputChange, onBlur: handleBlur })));
|
|
1965
1616
|
} })));
|
|
1966
1617
|
});
|
|
1967
|
-
FormTag.displayName = 'FormTag';
|
|
1968
|
-
FormTag.defaultProps = FormTagDefaultProps;var FormEmailDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/g });var FormEmail = React.forwardRef(function (_a, ref) {
|
|
1969
|
-
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
1970
|
-
var handleValue = React.useCallback(function (value) {
|
|
1971
|
-
var newValue = value.replace(/ /gi, '');
|
|
1972
|
-
return onValue ? onValue(newValue) : newValue;
|
|
1973
|
-
}, [onValue]);
|
|
1618
|
+
FormTag.displayName = 'FormTag';
|
|
1619
|
+
FormTag.defaultProps = FormTagDefaultProps;var FormEmailDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/g });var FormEmail = React.forwardRef(function (_a, ref) {
|
|
1620
|
+
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
1621
|
+
var handleValue = React.useCallback(function (value) {
|
|
1622
|
+
var newValue = value.replace(/ /gi, '');
|
|
1623
|
+
return onValue ? onValue(newValue) : newValue;
|
|
1624
|
+
}, [onValue]);
|
|
1625
|
+
/********************************************************************************************************************
|
|
1626
|
+
* Render
|
|
1627
|
+
* ******************************************************************************************************************/
|
|
1628
|
+
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormEmail'), type: 'email', onValue: handleValue }, props)));
|
|
1629
|
+
});
|
|
1630
|
+
FormEmail.displayName = 'FormEmail';
|
|
1631
|
+
FormEmail.defaultProps = FormEmailDefaultProps;var FormPasswordDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { clear: false, eye: true });var css_248z$i = ".FormPassword .eye-icon-button-wrap {\n visibility: hidden;\n}\n.FormPassword.variant-filled .eye-icon-button-wrap {\n margin-top: 9px;\n margin-bottom: -9px;\n}\n.FormPassword:hover .eye-icon-button-wrap.show,\n.FormPassword .MuiInputBase-root.Mui-focused .eye-icon-button-wrap.show {\n visibility: visible;\n}";
|
|
1632
|
+
styleInject(css_248z$i);var StyledEyeInputAdornment = material.styled(material.InputAdornment)(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n visibility: hidden;\n"], ["\n visibility: hidden;\n"])));
|
|
1633
|
+
var FormPassword = React.forwardRef(function (_a, ref) {
|
|
1634
|
+
/********************************************************************************************************************
|
|
1635
|
+
* State
|
|
1636
|
+
* ******************************************************************************************************************/
|
|
1637
|
+
var className = _a.className, initMuiInputProps = _a.InputProps, eye = _a.eye, onChange = _a.onChange, props = __rest(_a, ["className", "InputProps", "eye", "onChange"]);
|
|
1638
|
+
var _b = React.useState('password'), type = _b[0], setType = _b[1];
|
|
1639
|
+
var _c = React.useState(util.notEmpty(props.value)), showEye = _c[0], setShowEye = _c[1];
|
|
1640
|
+
/********************************************************************************************************************
|
|
1641
|
+
* Memo
|
|
1642
|
+
* ******************************************************************************************************************/
|
|
1643
|
+
var muiInputProps = React.useMemo(function () {
|
|
1644
|
+
if (eye) {
|
|
1645
|
+
var newProps = __assign({}, initMuiInputProps);
|
|
1646
|
+
newProps.endAdornment = (React.createElement(React.Fragment, null,
|
|
1647
|
+
React.createElement(StyledEyeInputAdornment, { position: 'end', className: classNames('eye-icon-button-wrap', showEye && 'show') },
|
|
1648
|
+
React.createElement(material.IconButton, { size: 'small', tabIndex: -1, onClick: function () {
|
|
1649
|
+
setType(type === 'password' ? 'text' : 'password');
|
|
1650
|
+
} },
|
|
1651
|
+
React.createElement(material.Icon, { fontSize: 'inherit' }, type === 'password' ? 'visibility' : 'visibility_off'))),
|
|
1652
|
+
newProps.endAdornment));
|
|
1653
|
+
return newProps;
|
|
1654
|
+
}
|
|
1655
|
+
else {
|
|
1656
|
+
return initMuiInputProps;
|
|
1657
|
+
}
|
|
1658
|
+
}, [eye, initMuiInputProps, showEye, type]);
|
|
1659
|
+
/********************************************************************************************************************
|
|
1660
|
+
* Event Handler
|
|
1661
|
+
* ******************************************************************************************************************/
|
|
1662
|
+
var handleChange = React.useCallback(function (value) {
|
|
1663
|
+
setShowEye(util.notEmpty(value));
|
|
1664
|
+
onChange && onChange(value);
|
|
1665
|
+
}, [onChange]);
|
|
1666
|
+
/********************************************************************************************************************
|
|
1667
|
+
* Render
|
|
1668
|
+
* ******************************************************************************************************************/
|
|
1669
|
+
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormPassword'), onChange: handleChange, type: type, InputProps: muiInputProps }, props)));
|
|
1670
|
+
});
|
|
1671
|
+
FormPassword.displayName = 'FormPassword';
|
|
1672
|
+
FormPassword.defaultProps = FormPasswordDefaultProps;
|
|
1673
|
+
var templateObject_1$b;var FormTelDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /(^([0-9]{2,3})([0-9]{3,4})([0-9]{4})$)|(^([0-9]{2,3})-([0-9]{3,4})-([0-9]{4})$)|(^([0-9]{4})-([0-9]{4})$)|(^\+(?:[-]?[0-9]){8,}$)/ });var FormTel = React.forwardRef(function (_a, ref) {
|
|
1674
|
+
/********************************************************************************************************************
|
|
1675
|
+
* Event Handler
|
|
1676
|
+
* ******************************************************************************************************************/
|
|
1677
|
+
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
1678
|
+
var handleValue = React.useCallback(function (value) {
|
|
1679
|
+
var newValue = util.telNoAutoDash(value.replace(/[^0-9]/gi, ''));
|
|
1680
|
+
return onValue ? onValue(newValue) : newValue;
|
|
1681
|
+
}, [onValue]);
|
|
1682
|
+
/********************************************************************************************************************
|
|
1683
|
+
* Render
|
|
1684
|
+
* ******************************************************************************************************************/
|
|
1685
|
+
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormTel'), onValue: handleValue, maxLength: 13 }, props)));
|
|
1686
|
+
});
|
|
1687
|
+
FormTel.displayName = 'FormTel';
|
|
1688
|
+
FormTel.defaultProps = FormTelDefaultProps;var FormMobileDefaultProps = __assign(__assign({}, FormTelDefaultProps), { validPattern: /(^(01(?:0|1|[6-9]))([0-9]{3,4})([0-9]{4,4})$)|(^(01(?:0|1|[6-9]))-([0-9]{3,4})-([0-9]{4,4})$)|(^\+(?:[-]?[0-9]){8,}$)/ });var FormMobile = React.forwardRef(function (_a, ref) {
|
|
1689
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
1690
|
+
return React.createElement(FormTel, __assign({ ref: ref, className: classNames(className, 'FormMobile') }, props));
|
|
1691
|
+
});
|
|
1692
|
+
FormMobile.displayName = 'FormMobile';
|
|
1693
|
+
FormMobile.defaultProps = FormMobileDefaultProps;var NumberFormatCustom = React.forwardRef(function (_a, ref) {
|
|
1694
|
+
var onChange = _a.onChange, props = __rest(_a, ["onChange"]);
|
|
1695
|
+
return (React.createElement(reactNumberFormat.NumericFormat, __assign({}, props, { getInputRef: ref, onValueChange: function (values) {
|
|
1696
|
+
if (onChange)
|
|
1697
|
+
onChange({ target: { value: values.value } });
|
|
1698
|
+
} })));
|
|
1699
|
+
});
|
|
1700
|
+
NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { clear: true });var FormNumber = React.forwardRef(function (_a, ref) {
|
|
1974
1701
|
/********************************************************************************************************************
|
|
1975
|
-
*
|
|
1702
|
+
* State
|
|
1976
1703
|
* ******************************************************************************************************************/
|
|
1977
|
-
|
|
1978
|
-
});
|
|
1979
|
-
FormEmail.displayName = 'FormEmail';
|
|
1980
|
-
FormEmail.defaultProps = FormEmailDefaultProps;var FormPasswordDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { clear: false, eye: true });var css_248z$i = ".FormPassword .eye-icon-button-wrap {\n visibility: hidden;\n}\n.FormPassword.variant-filled .eye-icon-button-wrap {\n margin-top: 9px;\n margin-bottom: -9px;\n}\n.FormPassword:hover .eye-icon-button-wrap.show,\n.FormPassword .MuiInputBase-root.Mui-focused .eye-icon-button-wrap.show {\n visibility: visible;\n}";
|
|
1981
|
-
styleInject(css_248z$i);var StyledEyeInputAdornment = material.styled(material.InputAdornment)(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n visibility: hidden;\n"], ["\n visibility: hidden;\n"])));
|
|
1982
|
-
var FormPassword = React.forwardRef(function (_a, ref) {
|
|
1704
|
+
var className = _a.className, allowNegative = _a.allowNegative, thousandSeparator = _a.thousandSeparator, allowDecimal = _a.allowDecimal, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, readOnly = _a.readOnly, tabIndex = _a.tabIndex, labelShrink = _a.labelShrink, initMuiInputProps = _a.InputProps, initInputProps = _a.inputProps, initValue = _a.value, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "labelShrink", "InputProps", "inputProps", "value", "onChange", "onValue", "onValidate"]);
|
|
1705
|
+
var _b = React.useState(function () { return (util.empty(initValue) ? '' : "".concat(initValue)); }), strValue = _b[0], setStrValue = _b[1];
|
|
1983
1706
|
/********************************************************************************************************************
|
|
1984
|
-
*
|
|
1707
|
+
* Effect
|
|
1985
1708
|
* ******************************************************************************************************************/
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1709
|
+
React.useEffect(function () {
|
|
1710
|
+
setStrValue(util.empty(initValue) ? '' : "".concat(initValue));
|
|
1711
|
+
}, [initValue]);
|
|
1989
1712
|
/********************************************************************************************************************
|
|
1990
1713
|
* Memo
|
|
1991
1714
|
* ******************************************************************************************************************/
|
|
1992
1715
|
var muiInputProps = React.useMemo(function () {
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1716
|
+
var inputProps = {
|
|
1717
|
+
className: readOnly ? 'Mui-disabled' : undefined,
|
|
1718
|
+
allowNegative: !!allowNegative,
|
|
1719
|
+
thousandSeparator: thousandSeparator,
|
|
1720
|
+
prefix: prefix,
|
|
1721
|
+
suffix: suffix,
|
|
1722
|
+
readOnly: !!readOnly,
|
|
1723
|
+
tabIndex: readOnly ? -1 : tabIndex,
|
|
1724
|
+
};
|
|
1725
|
+
if (allowDecimal) {
|
|
1726
|
+
if (decimalScale) {
|
|
1727
|
+
inputProps.decimalScale = decimalScale;
|
|
1728
|
+
}
|
|
2003
1729
|
}
|
|
2004
1730
|
else {
|
|
2005
|
-
|
|
1731
|
+
inputProps.decimalScale = 0;
|
|
2006
1732
|
}
|
|
2007
|
-
|
|
1733
|
+
return __assign(__assign({}, initMuiInputProps), { inputComponent: NumberFormatCustom, inputProps: __assign(__assign({}, initInputProps), inputProps) });
|
|
1734
|
+
}, [
|
|
1735
|
+
readOnly,
|
|
1736
|
+
allowNegative,
|
|
1737
|
+
thousandSeparator,
|
|
1738
|
+
prefix,
|
|
1739
|
+
suffix,
|
|
1740
|
+
tabIndex,
|
|
1741
|
+
allowDecimal,
|
|
1742
|
+
initMuiInputProps,
|
|
1743
|
+
initInputProps,
|
|
1744
|
+
decimalScale,
|
|
1745
|
+
]);
|
|
2008
1746
|
/********************************************************************************************************************
|
|
2009
1747
|
* Event Handler
|
|
2010
1748
|
* ******************************************************************************************************************/
|
|
2011
1749
|
var handleChange = React.useCallback(function (value) {
|
|
2012
|
-
|
|
2013
|
-
onChange && onChange(
|
|
1750
|
+
var newValue = util.empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
1751
|
+
onChange && onChange(newValue);
|
|
1752
|
+
setStrValue(value);
|
|
2014
1753
|
}, [onChange]);
|
|
1754
|
+
var handleValue = React.useCallback(function (value) {
|
|
1755
|
+
var finalValue = util.empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
1756
|
+
if (onValue) {
|
|
1757
|
+
finalValue = onValue(finalValue);
|
|
1758
|
+
}
|
|
1759
|
+
return finalValue !== undefined ? finalValue.toString() : undefined;
|
|
1760
|
+
}, [onValue]);
|
|
1761
|
+
var handleValidate = React.useCallback(function (value) {
|
|
1762
|
+
if (onValidate) {
|
|
1763
|
+
var finalValue = util.empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
1764
|
+
return onValidate(finalValue);
|
|
1765
|
+
}
|
|
1766
|
+
else {
|
|
1767
|
+
return true;
|
|
1768
|
+
}
|
|
1769
|
+
}, [onValidate]);
|
|
2015
1770
|
/********************************************************************************************************************
|
|
2016
1771
|
* Render
|
|
2017
1772
|
* ******************************************************************************************************************/
|
|
2018
|
-
return (React.createElement(
|
|
1773
|
+
return (React.createElement(FormTextField, __assign({ ref: ref, className: classNames(className, 'FormNumber'), disableReturnKey: true, labelShrink: strValue === '' || strValue === undefined ? labelShrink : true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
2019
1774
|
});
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
1775
|
+
FormNumber.displayName = 'FormNumber';
|
|
1776
|
+
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign({}, FormTextDefaultProps);var css_248z$h = ".FormSearch input[type=search]::-webkit-search-decoration,\n.FormSearch input[type=search]::-webkit-search-cancel-button,\n.FormSearch input[type=search]::-webkit-search-results-button,\n.FormSearch input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n}";
|
|
1777
|
+
styleInject(css_248z$h);var FormSearch = React.forwardRef(function (_a, ref) {
|
|
1778
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
1779
|
+
return React.createElement(FormText, __assign({ className: classNames(className, 'FormSearch'), ref: ref, type: 'search' }, props));
|
|
1780
|
+
});
|
|
1781
|
+
FormSearch.displayName = 'FormSearch';
|
|
1782
|
+
FormSearch.defaultProps = FormSearchDefaultProps;var FormTextareaDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { clear: false, rows: 3, value: '' });var css_248z$g = ".FormTextarea .MuiInputBase-root .MuiInputBase-input {\n overflow-y: scroll;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar {\n width: 8px;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n}";
|
|
1783
|
+
styleInject(css_248z$g);var FormTextarea = React.forwardRef(function (_a, ref) {
|
|
1784
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
1785
|
+
return (React.createElement(FormTextField, __assign({ ref: ref, className: classNames(className, 'FormTextarea') }, props, { multiline: true })));
|
|
1786
|
+
});
|
|
1787
|
+
FormTextarea.displayName = 'FormTextarea';
|
|
1788
|
+
FormTextarea.defaultProps = FormTextareaDefaultProps;var FormUrlDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'%()*+,;=.]+$/gim });var FormUrl = React.forwardRef(function (_a, ref) {
|
|
2023
1789
|
/********************************************************************************************************************
|
|
2024
1790
|
* Event Handler
|
|
2025
1791
|
* ******************************************************************************************************************/
|
|
2026
1792
|
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
2027
1793
|
var handleValue = React.useCallback(function (value) {
|
|
2028
|
-
var newValue =
|
|
1794
|
+
var newValue = value.replace(/ /gi, '');
|
|
2029
1795
|
return onValue ? onValue(newValue) : newValue;
|
|
2030
1796
|
}, [onValue]);
|
|
2031
1797
|
/********************************************************************************************************************
|
|
2032
1798
|
* Render
|
|
2033
1799
|
* ******************************************************************************************************************/
|
|
2034
|
-
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, '
|
|
1800
|
+
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormUrl'), type: 'url', onValue: handleValue }, props)));
|
|
2035
1801
|
});
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
1802
|
+
FormUrl.displayName = 'FormUrl';
|
|
1803
|
+
FormUrl.defaultProps = FormUrlDefaultProps;function getDateValidationErrorText(error) {
|
|
1804
|
+
switch (error) {
|
|
1805
|
+
case 'invalidDate':
|
|
1806
|
+
return '형식이 일치하지 않습니다.';
|
|
1807
|
+
case 'shouldDisableDate':
|
|
1808
|
+
case 'shouldDisableMonth':
|
|
1809
|
+
case 'shouldDisableYear':
|
|
1810
|
+
case 'disableFuture':
|
|
1811
|
+
case 'disablePast':
|
|
1812
|
+
case 'minDate':
|
|
1813
|
+
case 'maxDate':
|
|
1814
|
+
return '선택할 수 없는 날짜입니다.';
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
//--------------------------------------------------------------------------------------------------------------------
|
|
1818
|
+
var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
1819
|
+
var DEFAULT_DATE_FORM_VALUE_FORMAT = 'YYYY-MM-DD';
|
|
1820
|
+
var DEFAULT_DATE_TIME_HOUR_FORMAT = 'YYYY-MM-DD HH시';
|
|
1821
|
+
var DEFAULT_DATE_TIME_HOUR_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:00:00';
|
|
1822
|
+
var DEFAULT_DATE_TIME_MINUTE_FORMAT = 'YYYY-MM-DD HH:mm';
|
|
1823
|
+
var DEFAULT_DATE_TIME_MINUTE_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:mm:00';
|
|
1824
|
+
var DEFAULT_DATE_TIME_SECOND_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
1825
|
+
var DEFAULT_DATE_TIME_SECOND_FORM_VALUE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
1826
|
+
var DEFAULT_TIME_HOUR_FORMAT = 'HH시';
|
|
1827
|
+
var DEFAULT_TIME_HOUR_FORM_VALUE_FORMAT = 'HH:00:00';
|
|
1828
|
+
var DEFAULT_TIME_MINUTE_FORMAT = 'HH:mm';
|
|
1829
|
+
var DEFAULT_TIME_MINUTE_FORM_VALUE_FORMAT = 'HH:mm:00';
|
|
1830
|
+
var DEFAULT_TIME_SECOND_FORMAT = 'HH:mm:ss';
|
|
1831
|
+
var DEFAULT_TIME_SECOND_FORM_VALUE_FORMAT = 'HH:mm:ss';
|
|
1832
|
+
function getDateTimeFormat(type, time) {
|
|
1833
|
+
switch (type) {
|
|
1834
|
+
case 'date':
|
|
1835
|
+
return DEFAULT_DATE_FORMAT;
|
|
1836
|
+
case 'date_time':
|
|
1837
|
+
if (time) {
|
|
1838
|
+
switch (time) {
|
|
1839
|
+
case 'hour':
|
|
1840
|
+
return DEFAULT_DATE_TIME_HOUR_FORMAT;
|
|
1841
|
+
case 'minute':
|
|
1842
|
+
return DEFAULT_DATE_TIME_MINUTE_FORMAT;
|
|
1843
|
+
case 'second':
|
|
1844
|
+
return DEFAULT_DATE_TIME_SECOND_FORMAT;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
else {
|
|
1848
|
+
throw new Error("util::date_time::getDateTimeFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
1849
|
+
}
|
|
1850
|
+
break;
|
|
1851
|
+
case 'time':
|
|
1852
|
+
if (time) {
|
|
1853
|
+
switch (time) {
|
|
1854
|
+
case 'hour':
|
|
1855
|
+
return DEFAULT_TIME_HOUR_FORMAT;
|
|
1856
|
+
case 'minute':
|
|
1857
|
+
return DEFAULT_TIME_MINUTE_FORMAT;
|
|
1858
|
+
case 'second':
|
|
1859
|
+
return DEFAULT_TIME_SECOND_FORMAT;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
else {
|
|
1863
|
+
throw new Error("util::date_time::getDateTimeFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
1864
|
+
}
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
function getDateTimeFormValueFormat(type, time) {
|
|
1869
|
+
switch (type) {
|
|
1870
|
+
case 'date':
|
|
1871
|
+
return DEFAULT_DATE_FORM_VALUE_FORMAT;
|
|
1872
|
+
case 'date_time':
|
|
1873
|
+
if (time) {
|
|
1874
|
+
switch (time) {
|
|
1875
|
+
case 'hour':
|
|
1876
|
+
return DEFAULT_DATE_TIME_HOUR_FORM_VALUE_FORMAT;
|
|
1877
|
+
case 'minute':
|
|
1878
|
+
return DEFAULT_DATE_TIME_MINUTE_FORM_VALUE_FORMAT;
|
|
1879
|
+
case 'second':
|
|
1880
|
+
return DEFAULT_DATE_TIME_SECOND_FORM_VALUE_FORMAT;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
else {
|
|
1884
|
+
throw new Error("util::date_time::getDateTimeFormValueFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
1885
|
+
}
|
|
1886
|
+
break;
|
|
1887
|
+
case 'time':
|
|
1888
|
+
if (time) {
|
|
1889
|
+
switch (time) {
|
|
1890
|
+
case 'hour':
|
|
1891
|
+
return DEFAULT_TIME_HOUR_FORM_VALUE_FORMAT;
|
|
1892
|
+
case 'minute':
|
|
1893
|
+
return DEFAULT_TIME_MINUTE_FORM_VALUE_FORMAT;
|
|
1894
|
+
case 'second':
|
|
1895
|
+
return DEFAULT_TIME_SECOND_FORM_VALUE_FORMAT;
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
else {
|
|
1899
|
+
throw new Error("util::date_time::getDateTimeFormValueFormat - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
1900
|
+
}
|
|
1901
|
+
break;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
function getAvailableDateValFormat(type, time) {
|
|
1905
|
+
var availableDateType;
|
|
1906
|
+
if (time) {
|
|
1907
|
+
availableDateType = getAvailableDateType(type, time);
|
|
1908
|
+
}
|
|
1909
|
+
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
1910
|
+
availableDateType = getAvailableDateType(type, time);
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
availableDateType = type;
|
|
1914
|
+
}
|
|
1915
|
+
switch (availableDateType) {
|
|
1916
|
+
case 'year':
|
|
1917
|
+
return 'YYYY';
|
|
1918
|
+
case 'month':
|
|
1919
|
+
return 'YYYYMM';
|
|
1920
|
+
case 'day':
|
|
1921
|
+
return 'YYYYMMDD';
|
|
1922
|
+
case 'hour':
|
|
1923
|
+
return 'YYYYMMDDHH';
|
|
1924
|
+
case 'minute':
|
|
1925
|
+
return 'YYYYMMDDHHmm';
|
|
1926
|
+
case 'second':
|
|
1927
|
+
return 'YYYYMMDDHHmmss';
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
/********************************************************************************************************************
|
|
1931
|
+
* getAvailableDateType
|
|
1932
|
+
* ******************************************************************************************************************/
|
|
1933
|
+
function getAvailableDateType(type, time) {
|
|
1934
|
+
switch (type) {
|
|
1935
|
+
case 'date':
|
|
1936
|
+
return 'day';
|
|
1937
|
+
case 'date_time':
|
|
1938
|
+
if (time) {
|
|
1939
|
+
switch (time) {
|
|
1940
|
+
case 'hour':
|
|
1941
|
+
return 'hour';
|
|
1942
|
+
case 'minute':
|
|
1943
|
+
return 'minute';
|
|
1944
|
+
case 'second':
|
|
1945
|
+
return 'second';
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
else {
|
|
1949
|
+
throw new Error("util::date_time::getAvailableDateType - type \uC774 '".concat(type, "' \uC77C \uACBD\uC6B0 time \uAC12\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."));
|
|
1950
|
+
}
|
|
1951
|
+
break;
|
|
1952
|
+
case 'time':
|
|
1953
|
+
throw new Error("util::date_time::getAvailableDateType - '".concat(type, "' type \uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."));
|
|
2043
1954
|
}
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
break;
|
|
2055
|
-
default:
|
|
2056
|
-
preLen = 3;
|
|
1955
|
+
}
|
|
1956
|
+
/********************************************************************************************************************
|
|
1957
|
+
* makeAvailableDate
|
|
1958
|
+
* ******************************************************************************************************************/
|
|
1959
|
+
function makeAvailableDate(minDate, maxDate, disablePast, disableFuture) {
|
|
1960
|
+
var now = dayjs();
|
|
1961
|
+
var min = null;
|
|
1962
|
+
var max = null;
|
|
1963
|
+
if (disablePast) {
|
|
1964
|
+
min = now;
|
|
2057
1965
|
}
|
|
2058
|
-
if (
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
1966
|
+
if (minDate) {
|
|
1967
|
+
if (min) {
|
|
1968
|
+
if (minDate.isAfter(min, 'date')) {
|
|
1969
|
+
min = minDate;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
else {
|
|
1973
|
+
min = minDate;
|
|
2061
1974
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
1975
|
+
}
|
|
1976
|
+
if (disableFuture) {
|
|
1977
|
+
max = now;
|
|
1978
|
+
}
|
|
1979
|
+
if (maxDate) {
|
|
1980
|
+
if (max) {
|
|
1981
|
+
if (maxDate.isBefore(max, 'date')) {
|
|
1982
|
+
max = maxDate;
|
|
1983
|
+
}
|
|
2066
1984
|
}
|
|
2067
1985
|
else {
|
|
2068
|
-
|
|
1986
|
+
max = maxDate;
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
var minItem = min
|
|
1990
|
+
? {
|
|
1991
|
+
date: min,
|
|
1992
|
+
year: Number(min.format(getAvailableDateValFormat('year'))),
|
|
1993
|
+
month: Number(min.format(getAvailableDateValFormat('month'))),
|
|
1994
|
+
day: Number(min.format(getAvailableDateValFormat('day'))),
|
|
1995
|
+
hour: Number(min.format(getAvailableDateValFormat('hour'))),
|
|
1996
|
+
minute: Number(min.format(getAvailableDateValFormat('minute'))),
|
|
1997
|
+
second: Number(min.format(getAvailableDateValFormat('second'))),
|
|
1998
|
+
}
|
|
1999
|
+
: null;
|
|
2000
|
+
var maxItem = max
|
|
2001
|
+
? {
|
|
2002
|
+
date: max,
|
|
2003
|
+
year: Number(max.format(getAvailableDateValFormat('year'))),
|
|
2004
|
+
month: Number(max.format(getAvailableDateValFormat('month'))),
|
|
2005
|
+
day: Number(max.format(getAvailableDateValFormat('day'))),
|
|
2006
|
+
hour: Number(max.format(getAvailableDateValFormat('hour'))),
|
|
2007
|
+
minute: Number(max.format(getAvailableDateValFormat('minute'))),
|
|
2008
|
+
second: Number(max.format(getAvailableDateValFormat('second'))),
|
|
2069
2009
|
}
|
|
2010
|
+
: null;
|
|
2011
|
+
return [minItem, maxItem];
|
|
2012
|
+
}
|
|
2013
|
+
function getAvailableDate(availableDate, type, time) {
|
|
2014
|
+
var availableDateType;
|
|
2015
|
+
if (time) {
|
|
2016
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2070
2017
|
}
|
|
2071
|
-
else if (
|
|
2072
|
-
|
|
2018
|
+
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
2019
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2073
2020
|
}
|
|
2074
|
-
else
|
|
2075
|
-
|
|
2076
|
-
tmp += '-';
|
|
2077
|
-
tmp += str.substring(preLen);
|
|
2021
|
+
else {
|
|
2022
|
+
availableDateType = type;
|
|
2078
2023
|
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2024
|
+
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
2025
|
+
var availableDateValFormat = getAvailableDateValFormat(availableDateType);
|
|
2026
|
+
return [
|
|
2027
|
+
availableDateVal[0] ? dayjs(availableDateVal[0].toString(), availableDateValFormat) : null,
|
|
2028
|
+
availableDateVal[1] ? dayjs(availableDateVal[1].toString(), availableDateValFormat) : null,
|
|
2029
|
+
];
|
|
2030
|
+
}
|
|
2031
|
+
function getAvailableDateVal(availableDate, type, time) {
|
|
2032
|
+
var availableDateType;
|
|
2033
|
+
if (time) {
|
|
2034
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2085
2035
|
}
|
|
2086
|
-
else if (
|
|
2087
|
-
|
|
2088
|
-
tmp += '-';
|
|
2089
|
-
tmp += str.substring(preLen, preLen + 4);
|
|
2090
|
-
tmp += '-';
|
|
2091
|
-
tmp += str.substring(preLen + 4);
|
|
2036
|
+
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
2037
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2092
2038
|
}
|
|
2093
2039
|
else {
|
|
2094
|
-
|
|
2040
|
+
availableDateType = type;
|
|
2095
2041
|
}
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2042
|
+
return [
|
|
2043
|
+
availableDate[0] ? availableDate[0][availableDateType] : null,
|
|
2044
|
+
availableDate[1] ? availableDate[1][availableDateType] : null,
|
|
2045
|
+
];
|
|
2046
|
+
}
|
|
2047
|
+
/********************************************************************************************************************
|
|
2048
|
+
* getDateVal
|
|
2049
|
+
* ******************************************************************************************************************/
|
|
2050
|
+
function getDateValForAvailableDate(date, type, time) {
|
|
2051
|
+
var format = getAvailableDateValFormat(type, time);
|
|
2052
|
+
return Number(date.format(format));
|
|
2053
|
+
}
|
|
2054
|
+
function isDateAvailable(date, availableDate, type, time) {
|
|
2055
|
+
var availableDateType;
|
|
2056
|
+
if (time) {
|
|
2057
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2100
2058
|
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
var
|
|
2109
|
-
return (
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
suffix,
|
|
2154
|
-
tabIndex,
|
|
2155
|
-
allowDecimal,
|
|
2156
|
-
initMuiInputProps,
|
|
2157
|
-
initInputProps,
|
|
2158
|
-
decimalScale,
|
|
2159
|
-
]);
|
|
2160
|
-
/********************************************************************************************************************
|
|
2161
|
-
* Event Handler
|
|
2162
|
-
* ******************************************************************************************************************/
|
|
2163
|
-
var handleChange = React.useCallback(function (value) {
|
|
2164
|
-
var newValue = empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
2165
|
-
onChange && onChange(newValue);
|
|
2166
|
-
setStrValue(value);
|
|
2167
|
-
}, [onChange]);
|
|
2168
|
-
var handleValue = React.useCallback(function (value) {
|
|
2169
|
-
var finalValue = empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
2170
|
-
if (onValue) {
|
|
2171
|
-
finalValue = onValue(finalValue);
|
|
2172
|
-
}
|
|
2173
|
-
return finalValue !== undefined ? finalValue.toString() : undefined;
|
|
2174
|
-
}, [onValue]);
|
|
2175
|
-
var handleValidate = React.useCallback(function (value) {
|
|
2176
|
-
if (onValidate) {
|
|
2177
|
-
var finalValue = empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
2178
|
-
return onValidate(finalValue);
|
|
2179
|
-
}
|
|
2180
|
-
else {
|
|
2181
|
-
return true;
|
|
2182
|
-
}
|
|
2183
|
-
}, [onValidate]);
|
|
2184
|
-
/********************************************************************************************************************
|
|
2185
|
-
* Render
|
|
2186
|
-
* ******************************************************************************************************************/
|
|
2187
|
-
return (React.createElement(FormTextField, __assign({ ref: ref, className: classNames(className, 'FormNumber'), disableReturnKey: true, labelShrink: strValue === '' || strValue === undefined ? labelShrink : true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
2188
|
-
});
|
|
2189
|
-
FormNumber.displayName = 'FormNumber';
|
|
2190
|
-
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign({}, FormTextDefaultProps);var css_248z$h = ".FormSearch input[type=search]::-webkit-search-decoration,\n.FormSearch input[type=search]::-webkit-search-cancel-button,\n.FormSearch input[type=search]::-webkit-search-results-button,\n.FormSearch input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n}";
|
|
2191
|
-
styleInject(css_248z$h);var FormSearch = React.forwardRef(function (_a, ref) {
|
|
2192
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
2193
|
-
return React.createElement(FormText, __assign({ className: classNames(className, 'FormSearch'), ref: ref, type: 'search' }, props));
|
|
2194
|
-
});
|
|
2195
|
-
FormSearch.displayName = 'FormSearch';
|
|
2196
|
-
FormSearch.defaultProps = FormSearchDefaultProps;var FormTextareaDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { clear: false, rows: 3, value: '' });var css_248z$g = ".FormTextarea .MuiInputBase-root .MuiInputBase-input {\n overflow-y: scroll;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar {\n width: 8px;\n}\n.FormTextarea .MuiInputBase-root .MuiInputBase-input::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n}";
|
|
2197
|
-
styleInject(css_248z$g);var FormTextarea = React.forwardRef(function (_a, ref) {
|
|
2198
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
2199
|
-
return (React.createElement(FormTextField, __assign({ ref: ref, className: classNames(className, 'FormTextarea') }, props, { multiline: true })));
|
|
2200
|
-
});
|
|
2201
|
-
FormTextarea.displayName = 'FormTextarea';
|
|
2202
|
-
FormTextarea.defaultProps = FormTextareaDefaultProps;var FormUrlDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'%()*+,;=.]+$/gim });var FormUrl = React.forwardRef(function (_a, ref) {
|
|
2203
|
-
/********************************************************************************************************************
|
|
2204
|
-
* Event Handler
|
|
2205
|
-
* ******************************************************************************************************************/
|
|
2206
|
-
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
2207
|
-
var handleValue = React.useCallback(function (value) {
|
|
2208
|
-
var newValue = value.replace(/ /gi, '');
|
|
2209
|
-
return onValue ? onValue(newValue) : newValue;
|
|
2210
|
-
}, [onValue]);
|
|
2211
|
-
/********************************************************************************************************************
|
|
2212
|
-
* Render
|
|
2213
|
-
* ******************************************************************************************************************/
|
|
2214
|
-
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormUrl'), type: 'url', onValue: handleValue }, props)));
|
|
2215
|
-
});
|
|
2216
|
-
FormUrl.displayName = 'FormUrl';
|
|
2217
|
-
FormUrl.defaultProps = FormUrlDefaultProps;var FormSelectDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { formValueSeparator: ',', minWidth: 120 });var css_248z$f = ".FormSelect.is-selected-placeholder .MuiSelect-select {\n opacity: 0.38;\n}\n.FormSelect .MuiInputBase-root.MuiInputBase-adornedEnd {\n padding-right: 25px;\n}\n.FormSelect .MuiSelect-select.MuiSelect-multiple .selected-list:not(:empty) {\n margin-top: -3px;\n margin-bottom: -3px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar {\n width: 12px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n border-right: 4px transparent solid;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:start:decrement, .FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:end:increment {\n display: block;\n height: 4px;\n background-color: transparent;\n}";
|
|
2059
|
+
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
2060
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2061
|
+
}
|
|
2062
|
+
else {
|
|
2063
|
+
availableDateType = type;
|
|
2064
|
+
}
|
|
2065
|
+
var dateVal = Number(date.format(getAvailableDateValFormat(availableDateType)));
|
|
2066
|
+
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
2067
|
+
return !((availableDateVal[0] && dateVal < availableDateVal[0]) ||
|
|
2068
|
+
(availableDateVal[1] && dateVal > availableDateVal[1]));
|
|
2069
|
+
}
|
|
2070
|
+
function checkDateAvailable(date, availableDate, type, time) {
|
|
2071
|
+
var availableDateType;
|
|
2072
|
+
if (time) {
|
|
2073
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2074
|
+
}
|
|
2075
|
+
else if (['date', 'date_time', 'time'].includes(type)) {
|
|
2076
|
+
availableDateType = getAvailableDateType(type, time);
|
|
2077
|
+
}
|
|
2078
|
+
else {
|
|
2079
|
+
availableDateType = type;
|
|
2080
|
+
}
|
|
2081
|
+
var dateVal = Number(date.format(getAvailableDateValFormat(availableDateType)));
|
|
2082
|
+
var availableDateVal = getAvailableDateVal(availableDate, availableDateType);
|
|
2083
|
+
if (availableDateVal[0] && dateVal < availableDateVal[0])
|
|
2084
|
+
return 'min';
|
|
2085
|
+
if (availableDateVal[1] && dateVal > availableDateVal[1])
|
|
2086
|
+
return 'max';
|
|
2087
|
+
return 'available';
|
|
2088
|
+
}function getFileSizeText(bytes, dp) {
|
|
2089
|
+
if (dp === void 0) { dp = 1; }
|
|
2090
|
+
var thresh = 1024;
|
|
2091
|
+
if (Math.abs(bytes) < thresh) {
|
|
2092
|
+
return "".concat(bytes, " Byte");
|
|
2093
|
+
}
|
|
2094
|
+
var units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
2095
|
+
var u = -1;
|
|
2096
|
+
var r = Math.pow(10, dp);
|
|
2097
|
+
do {
|
|
2098
|
+
bytes /= thresh;
|
|
2099
|
+
u += 1;
|
|
2100
|
+
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
2101
|
+
return "".concat(bytes.toFixed(dp), " ").concat(units[u]);
|
|
2102
|
+
}function ToForwardRefExoticComponent(component, ext) {
|
|
2103
|
+
var fComponent = component;
|
|
2104
|
+
fComponent.displayName = ext === null || ext === void 0 ? void 0 : ext.displayName;
|
|
2105
|
+
fComponent.defaultProps = ext === null || ext === void 0 ? void 0 : ext.defaultProps;
|
|
2106
|
+
return component;
|
|
2107
|
+
}
|
|
2108
|
+
function AutoTypeForwardRef(render) {
|
|
2109
|
+
return React.forwardRef(render);
|
|
2110
|
+
}var FormSelectDefaultProps = __assign(__assign({}, FormTextFieldDefaultProps), { formValueSeparator: ',', minWidth: 120 });var css_248z$f = ".FormSelect.is-selected-placeholder .MuiSelect-select {\n opacity: 0.38;\n}\n.FormSelect .MuiInputBase-root.MuiInputBase-adornedEnd {\n padding-right: 25px;\n}\n.FormSelect .MuiSelect-select.MuiSelect-multiple .selected-list:not(:empty) {\n margin-top: -3px;\n margin-bottom: -3px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar {\n width: 12px;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.1882352941);\n background-clip: padding-box;\n border-left: 4px transparent solid;\n border-right: 4px transparent solid;\n}\n.FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:start:decrement, .FormSelect-Menu-Popover > .MuiPaper-root::-webkit-scrollbar-button:end:increment {\n display: block;\n height: 4px;\n background-color: transparent;\n}";
|
|
2218
2111
|
styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a, ref) {
|
|
2219
2112
|
/********************************************************************************************************************
|
|
2220
2113
|
* type
|
|
@@ -2302,7 +2195,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
|
|
|
2302
2195
|
var finalValue = value == null ? '' : value;
|
|
2303
2196
|
if (multiple) {
|
|
2304
2197
|
if (!Array.isArray(finalValue)) {
|
|
2305
|
-
if (empty(finalValue)) {
|
|
2198
|
+
if (util.empty(finalValue)) {
|
|
2306
2199
|
finalValue = [];
|
|
2307
2200
|
}
|
|
2308
2201
|
else {
|
|
@@ -2317,16 +2210,16 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
|
|
|
2317
2210
|
}
|
|
2318
2211
|
else {
|
|
2319
2212
|
if (Array.isArray(finalValue)) {
|
|
2320
|
-
finalValue = empty(finalValue) ? '' : finalValue[0];
|
|
2213
|
+
finalValue = util.empty(finalValue) ? '' : finalValue[0];
|
|
2321
2214
|
}
|
|
2322
2215
|
else {
|
|
2323
|
-
if (empty(finalValue)) {
|
|
2216
|
+
if (util.empty(finalValue)) {
|
|
2324
2217
|
finalValue = '';
|
|
2325
2218
|
}
|
|
2326
2219
|
}
|
|
2327
2220
|
}
|
|
2328
|
-
if (notEmpty(itemsValues)) {
|
|
2329
|
-
if (finalValue != null && notEmpty(finalValue)) {
|
|
2221
|
+
if (util.notEmpty(itemsValues)) {
|
|
2222
|
+
if (finalValue != null && util.notEmpty(finalValue)) {
|
|
2330
2223
|
if (multiple) {
|
|
2331
2224
|
if (Array.isArray(finalValue)) {
|
|
2332
2225
|
finalValue = finalValue.map(function (v) {
|
|
@@ -2358,13 +2251,13 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
|
|
|
2358
2251
|
* State - isSelectedPlaceholder
|
|
2359
2252
|
* ******************************************************************************************************************/
|
|
2360
2253
|
var isSelectedPlaceholder = reactHook.useAutoUpdateState(React.useCallback(function () {
|
|
2361
|
-
return notEmpty(items) && empty(value) && !!placeholder && !hasEmptyValue;
|
|
2254
|
+
return util.notEmpty(items) && util.empty(value) && !!placeholder && !hasEmptyValue;
|
|
2362
2255
|
}, [items, value, placeholder, hasEmptyValue]))[0];
|
|
2363
2256
|
/********************************************************************************************************************
|
|
2364
2257
|
* Effect
|
|
2365
2258
|
* ******************************************************************************************************************/
|
|
2366
2259
|
React.useEffect(function () {
|
|
2367
|
-
if (!
|
|
2260
|
+
if (!util.equal(value, initValue)) {
|
|
2368
2261
|
if (onChange)
|
|
2369
2262
|
onChange(value);
|
|
2370
2263
|
onValueChange(name, value);
|
|
@@ -2473,7 +2366,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
|
|
|
2473
2366
|
* Render
|
|
2474
2367
|
* ******************************************************************************************************************/
|
|
2475
2368
|
var finalValue;
|
|
2476
|
-
if (notEmpty(items)) {
|
|
2369
|
+
if (util.notEmpty(items)) {
|
|
2477
2370
|
finalValue = value;
|
|
2478
2371
|
}
|
|
2479
2372
|
else {
|
|
@@ -2482,11 +2375,11 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
|
|
|
2482
2375
|
return (React.createElement(FormContextProvider, { value: __assign({ fullWidth: formFullWidth, onAddValueItem: handleAddValueItem,
|
|
2483
2376
|
// eslint-disable-next-line
|
|
2484
2377
|
onValueChange: function () { } }, otherFormState) },
|
|
2485
|
-
React.createElement(FormTextField, __assign({ select: true, ref: handleRef, name: name, className: classNames(className, 'FormSelect', isSelectedPlaceholder && 'is-selected-placeholder'), fullWidth: fullWidth }, props, { startAdornment: startAdornment, value: finalValue, clear: false, readOnly: readOnly || empty(items), InputLabelProps: inputLabelProps, SelectProps: selectProps, onChange: handleChange, onValue: handleValue }),
|
|
2378
|
+
React.createElement(FormTextField, __assign({ select: true, ref: handleRef, name: name, className: classNames(className, 'FormSelect', isSelectedPlaceholder && 'is-selected-placeholder'), fullWidth: fullWidth }, props, { startAdornment: startAdornment, value: finalValue, clear: false, readOnly: readOnly || util.empty(items), InputLabelProps: inputLabelProps, SelectProps: selectProps, onChange: handleChange, onValue: handleValue }),
|
|
2486
2379
|
isSelectedPlaceholder && (React.createElement(material.MenuItem, { key: '$$$EmptyValuePlaceholder$$$', value: '', disabled: true, sx: { display: 'none' } }, placeholder)),
|
|
2487
|
-
items && notEmpty(items) ? (items.map(function (_a) {
|
|
2380
|
+
items && util.notEmpty(items) ? (items.map(function (_a) {
|
|
2488
2381
|
var itemLabel = _a.label, itemValue = _a.value, disabled = _a.disabled;
|
|
2489
|
-
return (React.createElement(material.MenuItem, { key: empty(itemValue) ? '$$$EmptyValue$$$' : "".concat(itemValue), value: typeof itemValue === 'boolean' ? "".concat(itemValue) : itemValue, disabled: disabled },
|
|
2382
|
+
return (React.createElement(material.MenuItem, { key: util.empty(itemValue) ? '$$$EmptyValue$$$' : "".concat(itemValue), value: typeof itemValue === 'boolean' ? "".concat(itemValue) : itemValue, disabled: disabled },
|
|
2490
2383
|
multiple && checkbox && Array.isArray(value) && React.createElement(material.Checkbox, { checked: value.includes(itemValue) }),
|
|
2491
2384
|
itemLabel));
|
|
2492
2385
|
})) : (React.createElement(material.MenuItem, { value: '' })))));
|
|
@@ -2498,7 +2391,7 @@ FormSelect.defaultProps = FormSelectDefaultProps;var FormCompanyNoDefaultProps =
|
|
|
2498
2391
|
* ******************************************************************************************************************/
|
|
2499
2392
|
var className = _a.className, onValue = _a.onValue, props = __rest(_a, ["className", "onValue"]);
|
|
2500
2393
|
var handleValue = React.useCallback(function (value) {
|
|
2501
|
-
var newValue =
|
|
2394
|
+
var newValue = util.companyNoAutoDash(value.replace(/[^0-9]/gi, ''));
|
|
2502
2395
|
return onValue ? onValue(newValue) : newValue;
|
|
2503
2396
|
}, [onValue]);
|
|
2504
2397
|
/********************************************************************************************************************
|
|
@@ -2507,28 +2400,17 @@ FormSelect.defaultProps = FormSelectDefaultProps;var FormCompanyNoDefaultProps =
|
|
|
2507
2400
|
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormCompanyNo'), maxLength: 12, onValue: handleValue }, props)));
|
|
2508
2401
|
});
|
|
2509
2402
|
FormCompanyNo.displayName = 'FormCompanyNo';
|
|
2510
|
-
FormCompanyNo.defaultProps = FormCompanyNoDefaultProps;
|
|
2511
|
-
function autoDash$1(companyNo) {
|
|
2512
|
-
var str = companyNo.replace(/[^0-9]/g, '');
|
|
2513
|
-
var tmp = '';
|
|
2514
|
-
for (var i = 0; i < str.length; i += 1) {
|
|
2515
|
-
if (i === 3 || i === 5) {
|
|
2516
|
-
tmp += '-';
|
|
2517
|
-
}
|
|
2518
|
-
tmp += str[i];
|
|
2519
|
-
}
|
|
2520
|
-
return tmp;
|
|
2521
|
-
}var FormPersonalNoDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /(([0-9]{6})([0-9]{7}))|(([0-9]{6})-([0-9]{7}))/ });var FormPersonalNo = React.forwardRef(function (_a, ref) {
|
|
2403
|
+
FormCompanyNo.defaultProps = FormCompanyNoDefaultProps;var FormPersonalNoDefaultProps = __assign(__assign({}, FormTextDefaultProps), { validPattern: /(([0-9]{6})([0-9]{7}))|(([0-9]{6})-([0-9]{7}))/ });var FormPersonalNo = React.forwardRef(function (_a, ref) {
|
|
2522
2404
|
/********************************************************************************************************************
|
|
2523
2405
|
* Event Handler
|
|
2524
2406
|
* ******************************************************************************************************************/
|
|
2525
2407
|
var className = _a.className, skipPersonalNumberValidateCheck = _a.skipPersonalNumberValidateCheck, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest(_a, ["className", "skipPersonalNumberValidateCheck", "onValue", "onValidate"]);
|
|
2526
2408
|
var handleValue = React.useCallback(function (value) {
|
|
2527
|
-
var newValue =
|
|
2409
|
+
var newValue = util.personalNoAutoDash(value.replace(/[^0-9]/gi, ''));
|
|
2528
2410
|
return onValue ? onValue(newValue) : newValue;
|
|
2529
2411
|
}, [onValue]);
|
|
2530
2412
|
var handleValidate = React.useCallback(function (value) {
|
|
2531
|
-
if (notEmpty(value) && !skipPersonalNumberValidateCheck) {
|
|
2413
|
+
if (util.notEmpty(value) && !skipPersonalNumberValidateCheck) {
|
|
2532
2414
|
if (value.length === 14 && value.includes('-')) {
|
|
2533
2415
|
var jumin = value
|
|
2534
2416
|
.replace(/-/g, '')
|
|
@@ -2567,18 +2449,7 @@ function autoDash$1(companyNo) {
|
|
|
2567
2449
|
return (React.createElement(FormText, __assign({ ref: ref, className: classNames(className, 'FormPersonalNo'), maxLength: 14, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
2568
2450
|
});
|
|
2569
2451
|
FormPersonalNo.displayName = 'FormPersonalNo';
|
|
2570
|
-
FormPersonalNo.defaultProps = FormPersonalNoDefaultProps;
|
|
2571
|
-
function autoDash(personalNo) {
|
|
2572
|
-
var str = personalNo.replace(/[^0-9]/g, '');
|
|
2573
|
-
var tmp = '';
|
|
2574
|
-
for (var i = 0; i < str.length; i += 1) {
|
|
2575
|
-
if (i === 6) {
|
|
2576
|
-
tmp += '-';
|
|
2577
|
-
}
|
|
2578
|
-
tmp += str[i];
|
|
2579
|
-
}
|
|
2580
|
-
return tmp;
|
|
2581
|
-
}var FormCheckboxDefaultProps = {
|
|
2452
|
+
FormPersonalNo.defaultProps = FormPersonalNoDefaultProps;var FormCheckboxDefaultProps = {
|
|
2582
2453
|
checked: false,
|
|
2583
2454
|
value: 1,
|
|
2584
2455
|
uncheckedValue: 0,
|
|
@@ -2928,7 +2799,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
2928
2799
|
}
|
|
2929
2800
|
else {
|
|
2930
2801
|
setChecked(checked);
|
|
2931
|
-
nextTick(function () {
|
|
2802
|
+
util.nextTick(function () {
|
|
2932
2803
|
onValueChangeByUser(name, checked);
|
|
2933
2804
|
onRequestSearchSubmit(name, checked);
|
|
2934
2805
|
});
|
|
@@ -3118,7 +2989,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
3118
2989
|
* Function - validate
|
|
3119
2990
|
* ******************************************************************************************************************/
|
|
3120
2991
|
var validate = React.useCallback(function (value) {
|
|
3121
|
-
if (required && empty(value)) {
|
|
2992
|
+
if (required && util.empty(value)) {
|
|
3122
2993
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
3123
2994
|
return false;
|
|
3124
2995
|
}
|
|
@@ -3264,7 +3135,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
3264
3135
|
finalValue_1 = getFinalValue(finalValue_1);
|
|
3265
3136
|
if (value !== finalValue_1) {
|
|
3266
3137
|
setValue(finalValue_1);
|
|
3267
|
-
nextTick(function () {
|
|
3138
|
+
util.nextTick(function () {
|
|
3268
3139
|
onValueChangeByUser(name, finalValue_1);
|
|
3269
3140
|
onRequestSearchSubmit(name, finalValue_1);
|
|
3270
3141
|
});
|
|
@@ -3435,7 +3306,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3435
3306
|
var finalValue = value;
|
|
3436
3307
|
if (multiple) {
|
|
3437
3308
|
if (!Array.isArray(finalValue)) {
|
|
3438
|
-
if (finalValue != null && notEmpty(finalValue)) {
|
|
3309
|
+
if (finalValue != null && util.notEmpty(finalValue)) {
|
|
3439
3310
|
if (typeof finalValue === 'string') {
|
|
3440
3311
|
finalValue = Array.from(new Set(finalValue.split(formValueSeparator || ',')));
|
|
3441
3312
|
}
|
|
@@ -3450,7 +3321,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3450
3321
|
}
|
|
3451
3322
|
else {
|
|
3452
3323
|
if (Array.isArray(finalValue)) {
|
|
3453
|
-
if (notEmpty(finalValue)) {
|
|
3324
|
+
if (util.notEmpty(finalValue)) {
|
|
3454
3325
|
finalValue = finalValue[0];
|
|
3455
3326
|
}
|
|
3456
3327
|
else {
|
|
@@ -3458,8 +3329,8 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3458
3329
|
}
|
|
3459
3330
|
}
|
|
3460
3331
|
}
|
|
3461
|
-
if (notEmpty(itemsValues)) {
|
|
3462
|
-
if (finalValue != null && notEmpty(finalValue)) {
|
|
3332
|
+
if (util.notEmpty(itemsValues)) {
|
|
3333
|
+
if (finalValue != null && util.notEmpty(finalValue)) {
|
|
3463
3334
|
if (multiple) {
|
|
3464
3335
|
if (Array.isArray(finalValue)) {
|
|
3465
3336
|
finalValue = finalValue.map(function (v) {
|
|
@@ -3509,10 +3380,10 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3509
3380
|
}, [value]);
|
|
3510
3381
|
React.useEffect(function () {
|
|
3511
3382
|
if (notAllowEmptyValue) {
|
|
3512
|
-
if (items && notEmpty(items)) {
|
|
3383
|
+
if (items && util.notEmpty(items)) {
|
|
3513
3384
|
var setFirstItem = false;
|
|
3514
3385
|
if (Array.isArray(value)) {
|
|
3515
|
-
if (empty(value)) {
|
|
3386
|
+
if (util.empty(value)) {
|
|
3516
3387
|
setFirstItem = true;
|
|
3517
3388
|
}
|
|
3518
3389
|
}
|
|
@@ -3546,7 +3417,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3546
3417
|
* Function - validate
|
|
3547
3418
|
* ******************************************************************************************************************/
|
|
3548
3419
|
var validate = React.useCallback(function (value) {
|
|
3549
|
-
if (required && empty(value)) {
|
|
3420
|
+
if (required && util.empty(value)) {
|
|
3550
3421
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
3551
3422
|
return false;
|
|
3552
3423
|
}
|
|
@@ -3682,7 +3553,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3682
3553
|
var finalValue_1 = newValue;
|
|
3683
3554
|
if (notAllowEmptyValue) {
|
|
3684
3555
|
if (multiple) {
|
|
3685
|
-
if (empty(finalValue_1)) {
|
|
3556
|
+
if (util.empty(finalValue_1)) {
|
|
3686
3557
|
if (Array.isArray(value) && value.length > 0) {
|
|
3687
3558
|
finalValue_1 = [value[0]];
|
|
3688
3559
|
}
|
|
@@ -3695,9 +3566,9 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3695
3566
|
}
|
|
3696
3567
|
}
|
|
3697
3568
|
finalValue_1 = getFinalValue(finalValue_1);
|
|
3698
|
-
if (!
|
|
3569
|
+
if (!util.equal(value, finalValue_1)) {
|
|
3699
3570
|
setValue(finalValue_1);
|
|
3700
|
-
nextTick(function () {
|
|
3571
|
+
util.nextTick(function () {
|
|
3701
3572
|
onValueChangeByUser(name, finalValue_1);
|
|
3702
3573
|
onRequestSearchSubmit(name, finalValue_1);
|
|
3703
3574
|
});
|
|
@@ -3774,7 +3645,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
3774
3645
|
? formColWidth
|
|
3775
3646
|
: undefined,
|
|
3776
3647
|
flexWrap: type === 'checkbox' || type === 'radio' ? 'wrap' : 'nowrap',
|
|
3777
|
-
}, "aria-labelledby": notEmpty(label) ? labelId : undefined }, isOnGetItemLoading || loading || !items || empty(items) ? (React.createElement(material.ToggleButton, { ref: refForButtonResizeHeightDetect, size: size, className: 'ToggleButton', disabled: disabled || readOnly, value: '', style: { visibility: 'hidden' } })) : (buttons)))) })));
|
|
3648
|
+
}, "aria-labelledby": util.notEmpty(label) ? labelId : undefined }, isOnGetItemLoading || loading || !items || util.empty(items) ? (React.createElement(material.ToggleButton, { ref: refForButtonResizeHeightDetect, size: size, className: 'ToggleButton', disabled: disabled || readOnly, value: '', style: { visibility: 'hidden' } })) : (buttons)))) })));
|
|
3778
3649
|
}));
|
|
3779
3650
|
FormToggleButtonGroup.displayName = 'FormToggleButtonGroup';
|
|
3780
3651
|
FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormRatingDefaultProps = {
|
|
@@ -3878,7 +3749,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
3878
3749
|
setErrorHelperText(errorHelperText);
|
|
3879
3750
|
}, [setError]);
|
|
3880
3751
|
var validate = React.useCallback(function (value) {
|
|
3881
|
-
if (required && (empty(value) || value === 0)) {
|
|
3752
|
+
if (required && (util.empty(value) || value === 0)) {
|
|
3882
3753
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
3883
3754
|
return false;
|
|
3884
3755
|
}
|
|
@@ -3987,7 +3858,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
3987
3858
|
else {
|
|
3988
3859
|
var finalValue_1 = getFinalValue(value || 0);
|
|
3989
3860
|
setValue(finalValue_1);
|
|
3990
|
-
nextTick(function () {
|
|
3861
|
+
util.nextTick(function () {
|
|
3991
3862
|
onValueChangeByUser(name, finalValue_1);
|
|
3992
3863
|
onRequestSearchSubmit(name, finalValue_1);
|
|
3993
3864
|
});
|
|
@@ -4076,7 +3947,7 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
4076
3947
|
* ******************************************************************************************************************/
|
|
4077
3948
|
var validate = React.useCallback(function (value) {
|
|
4078
3949
|
var _a;
|
|
4079
|
-
if (required && empty((_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.getContent())) {
|
|
3950
|
+
if (required && util.empty((_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.getContent())) {
|
|
4080
3951
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
4081
3952
|
return false;
|
|
4082
3953
|
}
|
|
@@ -4180,7 +4051,7 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
4180
4051
|
var handleEditorChange = React.useCallback(function (value) {
|
|
4181
4052
|
setValue(value);
|
|
4182
4053
|
if (new Date().getTime() - keyDownTime.current < 300) {
|
|
4183
|
-
nextTick(function () {
|
|
4054
|
+
util.nextTick(function () {
|
|
4184
4055
|
if (onValueChangeByUser)
|
|
4185
4056
|
onValueChangeByUser(name, value);
|
|
4186
4057
|
});
|
|
@@ -4323,7 +4194,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4323
4194
|
var finalValue = value;
|
|
4324
4195
|
if (multiple) {
|
|
4325
4196
|
if (!Array.isArray(finalValue)) {
|
|
4326
|
-
if (finalValue != null && notEmpty(finalValue)) {
|
|
4197
|
+
if (finalValue != null && util.notEmpty(finalValue)) {
|
|
4327
4198
|
if (typeof finalValue === 'string') {
|
|
4328
4199
|
finalValue = Array.from(new Set(finalValue.split(formValueSeparator || ',')));
|
|
4329
4200
|
}
|
|
@@ -4338,7 +4209,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4338
4209
|
}
|
|
4339
4210
|
else {
|
|
4340
4211
|
if (Array.isArray(finalValue)) {
|
|
4341
|
-
if (notEmpty(finalValue)) {
|
|
4212
|
+
if (util.notEmpty(finalValue)) {
|
|
4342
4213
|
finalValue = finalValue[0];
|
|
4343
4214
|
}
|
|
4344
4215
|
else {
|
|
@@ -4346,8 +4217,8 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4346
4217
|
}
|
|
4347
4218
|
}
|
|
4348
4219
|
}
|
|
4349
|
-
if (notEmpty(itemsValues)) {
|
|
4350
|
-
if (finalValue != null && notEmpty(finalValue)) {
|
|
4220
|
+
if (util.notEmpty(itemsValues)) {
|
|
4221
|
+
if (finalValue != null && util.notEmpty(finalValue)) {
|
|
4351
4222
|
if (multiple) {
|
|
4352
4223
|
if (Array.isArray(finalValue)) {
|
|
4353
4224
|
finalValue = finalValue.map(function (v) {
|
|
@@ -4389,7 +4260,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4389
4260
|
finalValue = (multiple ? [] : undefined);
|
|
4390
4261
|
}
|
|
4391
4262
|
var newComponentValue = (multiple ? [] : null);
|
|
4392
|
-
if (notEmpty(finalValue)) {
|
|
4263
|
+
if (util.notEmpty(finalValue)) {
|
|
4393
4264
|
if (items) {
|
|
4394
4265
|
if (Array.isArray(finalValue)) {
|
|
4395
4266
|
newComponentValue = items.filter(function (info) { return Array.isArray(finalValue) && finalValue.includes(info.value); });
|
|
@@ -4399,7 +4270,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4399
4270
|
(multiple ? [] : null));
|
|
4400
4271
|
}
|
|
4401
4272
|
}
|
|
4402
|
-
if (empty(newComponentValue) && valueItem) {
|
|
4273
|
+
if (util.empty(newComponentValue) && valueItem) {
|
|
4403
4274
|
if (Array.isArray(finalValue)) {
|
|
4404
4275
|
if (Array.isArray(valueItem)) {
|
|
4405
4276
|
newComponentValue = valueItem.filter(function (info) { return Array.isArray(finalValue) && finalValue.includes(info.value); });
|
|
@@ -4412,9 +4283,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4412
4283
|
}
|
|
4413
4284
|
}
|
|
4414
4285
|
}
|
|
4415
|
-
if (oldComponentValueRef.current &&
|
|
4416
|
-
newComponentValue &&
|
|
4417
|
-
isSame(oldComponentValueRef.current, newComponentValue)) {
|
|
4286
|
+
if (oldComponentValueRef.current && newComponentValue && util.equal(oldComponentValueRef.current, newComponentValue)) {
|
|
4418
4287
|
return oldComponentValueRef.current;
|
|
4419
4288
|
}
|
|
4420
4289
|
else {
|
|
@@ -4551,7 +4420,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4551
4420
|
* Function - validate
|
|
4552
4421
|
* ******************************************************************************************************************/
|
|
4553
4422
|
var validate = React.useCallback(function (value) {
|
|
4554
|
-
if (required && empty(value)) {
|
|
4423
|
+
if (required && util.empty(value)) {
|
|
4555
4424
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
4556
4425
|
return false;
|
|
4557
4426
|
}
|
|
@@ -4693,10 +4562,10 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
4693
4562
|
}
|
|
4694
4563
|
}
|
|
4695
4564
|
var finalValue = getFinalValue(newValue);
|
|
4696
|
-
if (!
|
|
4565
|
+
if (!util.equal(value, finalValue)) {
|
|
4697
4566
|
setValue(finalValue);
|
|
4698
4567
|
setValueItem(componentValue);
|
|
4699
|
-
nextTick(function () {
|
|
4568
|
+
util.nextTick(function () {
|
|
4700
4569
|
onValueChangeByUser(name, finalValue);
|
|
4701
4570
|
onRequestSearchSubmit(name, finalValue);
|
|
4702
4571
|
});
|
|
@@ -5327,7 +5196,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
5327
5196
|
* ******************************************************************************************************************/
|
|
5328
5197
|
var label = React.useMemo(function () {
|
|
5329
5198
|
if (labelIcon) {
|
|
5330
|
-
return React.createElement(reactComponent.
|
|
5199
|
+
return React.createElement(reactComponent.PdgIconText, { icon: labelIcon }, initLabel);
|
|
5331
5200
|
}
|
|
5332
5201
|
else {
|
|
5333
5202
|
return initLabel;
|
|
@@ -5459,7 +5328,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
5459
5328
|
* Function - validate
|
|
5460
5329
|
* ******************************************************************************************************************/
|
|
5461
5330
|
var validate = React.useCallback(function (value) {
|
|
5462
|
-
if (required && empty(value)) {
|
|
5331
|
+
if (required && util.empty(value)) {
|
|
5463
5332
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
5464
5333
|
return false;
|
|
5465
5334
|
}
|
|
@@ -5581,7 +5450,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
5581
5450
|
* ******************************************************************************************************************/
|
|
5582
5451
|
var handleChange = React.useCallback(function (unit, newValue, keyboardInputValue) {
|
|
5583
5452
|
var updateValue = true;
|
|
5584
|
-
if (notEmpty(keyboardInputValue)) {
|
|
5453
|
+
if (util.notEmpty(keyboardInputValue)) {
|
|
5585
5454
|
if (newValue) {
|
|
5586
5455
|
if (!newValue.isValid()) {
|
|
5587
5456
|
updateValue = false;
|
|
@@ -5605,7 +5474,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
5605
5474
|
}
|
|
5606
5475
|
}
|
|
5607
5476
|
var runOnRequestSearchSubmit_1 = false;
|
|
5608
|
-
if (notEmpty(keyboardInputValue)) {
|
|
5477
|
+
if (util.notEmpty(keyboardInputValue)) {
|
|
5609
5478
|
if (!time || unit !== 'action_date') {
|
|
5610
5479
|
runOnRequestSearchSubmit_1 = !open; // 팝업창 열리지 않은 상태에서 날짜 키보드로 변경
|
|
5611
5480
|
setOpen(false);
|
|
@@ -5616,7 +5485,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
5616
5485
|
setOpen(false);
|
|
5617
5486
|
}
|
|
5618
5487
|
setValue(finalValue);
|
|
5619
|
-
nextTick(function () {
|
|
5488
|
+
util.nextTick(function () {
|
|
5620
5489
|
onValueChangeByUser(name, finalValue);
|
|
5621
5490
|
if (runOnRequestSearchSubmit_1) {
|
|
5622
5491
|
onRequestSearchSubmit(name, finalValue);
|
|
@@ -6095,7 +5964,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
6095
5964
|
* ******************************************************************************************************************/
|
|
6096
5965
|
var label = React.useMemo(function () {
|
|
6097
5966
|
if (labelIcon) {
|
|
6098
|
-
return React.createElement(reactComponent.
|
|
5967
|
+
return React.createElement(reactComponent.PdgIconText, { icon: labelIcon }, initLabel);
|
|
6099
5968
|
}
|
|
6100
5969
|
else {
|
|
6101
5970
|
return initLabel;
|
|
@@ -6227,7 +6096,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
6227
6096
|
* Function - validate
|
|
6228
6097
|
* ******************************************************************************************************************/
|
|
6229
6098
|
var validate = React.useCallback(function (value) {
|
|
6230
|
-
if (required && empty(value)) {
|
|
6099
|
+
if (required && util.empty(value)) {
|
|
6231
6100
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
6232
6101
|
return false;
|
|
6233
6102
|
}
|
|
@@ -6350,7 +6219,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
6350
6219
|
var handleChange = React.useCallback(function (unit, newValue, keyboardInputValue) {
|
|
6351
6220
|
var _a, _b, _c;
|
|
6352
6221
|
var updateValue = true;
|
|
6353
|
-
if (notEmpty(keyboardInputValue)) {
|
|
6222
|
+
if (util.notEmpty(keyboardInputValue)) {
|
|
6354
6223
|
if (newValue) {
|
|
6355
6224
|
if (!newValue.isValid()) {
|
|
6356
6225
|
updateValue = false;
|
|
@@ -6374,7 +6243,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
6374
6243
|
}
|
|
6375
6244
|
}
|
|
6376
6245
|
var runOnRequestSearchSubmit_1 = false;
|
|
6377
|
-
if (notEmpty(keyboardInputValue)) {
|
|
6246
|
+
if (util.notEmpty(keyboardInputValue)) {
|
|
6378
6247
|
if (!time || unit !== 'action_date') {
|
|
6379
6248
|
runOnRequestSearchSubmit_1 = !open; // 팝업창 열리지 않은 상태에서 날짜 키보드로 변경
|
|
6380
6249
|
setOpen(false);
|
|
@@ -6385,7 +6254,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
6385
6254
|
setOpen(false);
|
|
6386
6255
|
}
|
|
6387
6256
|
setValue(finalValue);
|
|
6388
|
-
nextTick(function () {
|
|
6257
|
+
util.nextTick(function () {
|
|
6389
6258
|
onValueChangeByUser(name, finalValue);
|
|
6390
6259
|
if (runOnRequestSearchSubmit_1) {
|
|
6391
6260
|
onRequestSearchSubmit(name, finalValue);
|
|
@@ -7871,7 +7740,7 @@ var FormDateRangePickerTooltipPickerContainer = React.forwardRef(function (_a, r
|
|
|
7871
7740
|
* ******************************************************************************************************************/
|
|
7872
7741
|
React.useEffect(function () {
|
|
7873
7742
|
if (yearSelectOpen) {
|
|
7874
|
-
nextTick(function () {
|
|
7743
|
+
util.nextTick(function () {
|
|
7875
7744
|
var _a, _b, _c;
|
|
7876
7745
|
var wrapRect = (_a = yearSelectRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
7877
7746
|
var activeRect = (_b = activeYearBtnRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
@@ -7917,7 +7786,7 @@ var FormDateRangePickerTooltipPickerContainer = React.forwardRef(function (_a, r
|
|
|
7917
7786
|
if (yearSelectOpen) {
|
|
7918
7787
|
setYearSelectOpen(false);
|
|
7919
7788
|
if (index !== yearMonthSelectIndex) {
|
|
7920
|
-
nextTick(function () {
|
|
7789
|
+
util.nextTick(function () {
|
|
7921
7790
|
setYearMonthSelectIndex(index);
|
|
7922
7791
|
setYearSelectOpen(true);
|
|
7923
7792
|
setMonthSelectOpen(false);
|
|
@@ -8244,11 +8113,11 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
8244
8113
|
}
|
|
8245
8114
|
var startInputValue = ((_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
8246
8115
|
var endInputValue = ((_b = endDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.value) || '';
|
|
8247
|
-
if (notEmpty(startInputValue) && !dayjs(startInputValue, format).isValid()) {
|
|
8116
|
+
if (util.notEmpty(startInputValue) && !dayjs(startInputValue, format).isValid()) {
|
|
8248
8117
|
setFromErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
8249
8118
|
return false;
|
|
8250
8119
|
}
|
|
8251
|
-
if (notEmpty(endInputValue) && !dayjs(endInputValue, format).isValid()) {
|
|
8120
|
+
if (util.notEmpty(endInputValue) && !dayjs(endInputValue, format).isValid()) {
|
|
8252
8121
|
setToErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
8253
8122
|
return false;
|
|
8254
8123
|
}
|
|
@@ -8411,7 +8280,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
8411
8280
|
if ((_a = value[1]) === null || _a === void 0 ? void 0 : _a.isBefore(newValue)) {
|
|
8412
8281
|
finalValue = [newValue, null];
|
|
8413
8282
|
if (!fromInput) {
|
|
8414
|
-
nextTick(function () {
|
|
8283
|
+
util.nextTick(function () {
|
|
8415
8284
|
var _a;
|
|
8416
8285
|
(_a = endDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
8417
8286
|
});
|
|
@@ -8424,7 +8293,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
8424
8293
|
setOpen(false);
|
|
8425
8294
|
}
|
|
8426
8295
|
else {
|
|
8427
|
-
nextTick(function () {
|
|
8296
|
+
util.nextTick(function () {
|
|
8428
8297
|
var _a;
|
|
8429
8298
|
(_a = endDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
8430
8299
|
});
|
|
@@ -8452,13 +8321,13 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
8452
8321
|
if (value[0]) {
|
|
8453
8322
|
setOpen(false);
|
|
8454
8323
|
if (fromInput && !open) {
|
|
8455
|
-
nextTick(function () {
|
|
8324
|
+
util.nextTick(function () {
|
|
8456
8325
|
onRequestSearchSubmit(name, finalValue);
|
|
8457
8326
|
});
|
|
8458
8327
|
}
|
|
8459
8328
|
}
|
|
8460
8329
|
else {
|
|
8461
|
-
nextTick(function () {
|
|
8330
|
+
util.nextTick(function () {
|
|
8462
8331
|
var _a;
|
|
8463
8332
|
(_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
8464
8333
|
});
|
|
@@ -8468,7 +8337,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
8468
8337
|
break;
|
|
8469
8338
|
}
|
|
8470
8339
|
setValue(finalValue);
|
|
8471
|
-
nextTick(function () {
|
|
8340
|
+
util.nextTick(function () {
|
|
8472
8341
|
onValueChangeByUser(name, finalValue);
|
|
8473
8342
|
});
|
|
8474
8343
|
}, [
|
|
@@ -8762,7 +8631,7 @@ FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileD
|
|
|
8762
8631
|
* ******************************************************************************************************************/
|
|
8763
8632
|
return (React.createElement(material.Dialog, { className: 'color-primary', open: !!open, maxWidth: 'sm', fullWidth: true, onClose: function (e, reason) {
|
|
8764
8633
|
if (reason === 'backdropClick') {
|
|
8765
|
-
if (empty(value)) {
|
|
8634
|
+
if (util.empty(value)) {
|
|
8766
8635
|
onClose && onClose();
|
|
8767
8636
|
}
|
|
8768
8637
|
}
|
|
@@ -8877,9 +8746,9 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
8877
8746
|
var d = document.createElement('div');
|
|
8878
8747
|
d.innerHTML = value;
|
|
8879
8748
|
var text = d.textContent || d.innerText;
|
|
8880
|
-
isEmptyValue = empty(text.trim());
|
|
8749
|
+
isEmptyValue = util.empty(text.trim());
|
|
8881
8750
|
}
|
|
8882
|
-
if (required && (isEmptyValue || empty(value))) {
|
|
8751
|
+
if (required && (isEmptyValue || util.empty(value))) {
|
|
8883
8752
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
8884
8753
|
return false;
|
|
8885
8754
|
}
|
|
@@ -9024,7 +8893,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9024
8893
|
fileSizeCheck(file_1).then(function () {
|
|
9025
8894
|
onFile(file_1).then(function (url) {
|
|
9026
8895
|
setValue(url);
|
|
9027
|
-
nextTick(function () {
|
|
8896
|
+
util.nextTick(function () {
|
|
9028
8897
|
if (onValueChangeByUser)
|
|
9029
8898
|
onValueChangeByUser(name, url);
|
|
9030
8899
|
});
|
|
@@ -9037,7 +8906,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9037
8906
|
}, []);
|
|
9038
8907
|
var handleRemoveClick = React.useCallback(function () {
|
|
9039
8908
|
setValue('');
|
|
9040
|
-
nextTick(function () {
|
|
8909
|
+
util.nextTick(function () {
|
|
9041
8910
|
if (onValueChangeByUser)
|
|
9042
8911
|
onValueChangeByUser(name, '');
|
|
9043
8912
|
});
|
|
@@ -9046,7 +8915,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9046
8915
|
if (onLink) {
|
|
9047
8916
|
onLink(url).then(function (finalUrl) {
|
|
9048
8917
|
setValue(finalUrl);
|
|
9049
|
-
nextTick(function () {
|
|
8918
|
+
util.nextTick(function () {
|
|
9050
8919
|
if (onValueChangeByUser)
|
|
9051
8920
|
onValueChangeByUser(name, finalUrl);
|
|
9052
8921
|
});
|
|
@@ -9054,7 +8923,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9054
8923
|
}
|
|
9055
8924
|
else {
|
|
9056
8925
|
setValue(url);
|
|
9057
|
-
nextTick(function () {
|
|
8926
|
+
util.nextTick(function () {
|
|
9058
8927
|
if (onValueChangeByUser)
|
|
9059
8928
|
onValueChangeByUser(name, url);
|
|
9060
8929
|
});
|
|
@@ -9063,7 +8932,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9063
8932
|
/********************************************************************************************************************
|
|
9064
8933
|
* Render
|
|
9065
8934
|
* ******************************************************************************************************************/
|
|
9066
|
-
return (React.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames(className, 'FormValueItem', 'FormFile', "variant-".concat(variant), "size-".concat(size), !!initLabel && 'with-label', !!fullWidth && 'full-width', !!hideUrl && 'hide-file-name', !!hideLink && 'hide-link', !!hideUpload && 'hide-upload', !!hideRemove && 'hide-remove', notEmpty(value) && 'with-value'), labelIcon: hideUrl ? labelIcon : undefined, label: hideUrl ? initLabel : undefined, error: error, required: required, fullWidth: fullWidth, hidden: hidden, helperText: React.createElement("div", null,
|
|
8935
|
+
return (React.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames(className, 'FormValueItem', 'FormFile', "variant-".concat(variant), "size-".concat(size), !!initLabel && 'with-label', !!fullWidth && 'full-width', !!hideUrl && 'hide-file-name', !!hideLink && 'hide-link', !!hideUpload && 'hide-upload', !!hideRemove && 'hide-remove', util.notEmpty(value) && 'with-value'), labelIcon: hideUrl ? labelIcon : undefined, label: hideUrl ? initLabel : undefined, error: error, required: required, fullWidth: fullWidth, hidden: hidden, helperText: React.createElement("div", null,
|
|
9067
8936
|
preview,
|
|
9068
8937
|
React.createElement("div", null, error ? errorHelperText : helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
9069
8938
|
style: {
|
|
@@ -9085,7 +8954,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9085
8954
|
React.createElement("label", null,
|
|
9086
8955
|
React.createElement(FormIcon, null, "link"),
|
|
9087
8956
|
!hideLinkLabel && (linkLabel || '링크')))),
|
|
9088
|
-
!hideRemove && notEmpty(value) && (React.createElement(material.Button, { variant: 'text', tabIndex: removeTabIndex == null ? -1 : removeTabIndex, className: classNames('remove-btn form-file-btn', !!hideRemoveLabel && 'hidden-label'), color: error ? 'error' : color, disabled: readOnly || disabled, onClick: handleRemoveClick },
|
|
8957
|
+
!hideRemove && util.notEmpty(value) && (React.createElement(material.Button, { variant: 'text', tabIndex: removeTabIndex == null ? -1 : removeTabIndex, className: classNames('remove-btn form-file-btn', !!hideRemoveLabel && 'hidden-label'), color: error ? 'error' : color, disabled: readOnly || disabled, onClick: handleRemoveClick },
|
|
9089
8958
|
React.createElement("label", null,
|
|
9090
8959
|
React.createElement(FormIcon, null, "Close"),
|
|
9091
8960
|
!hideRemoveLabel && (removeLabel || '삭제'))))))),
|
|
@@ -9101,7 +8970,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
9101
8970
|
React.createElement("label", null,
|
|
9102
8971
|
React.createElement(FormIcon, null, "link"),
|
|
9103
8972
|
!hideLinkLabel && (linkLabel || '링크')))),
|
|
9104
|
-
!hideRemove && notEmpty(value) && (React.createElement(material.Button, { variant: 'outlined', tabIndex: removeTabIndex, className: classNames('remove-btn form-file-btn', !!hideRemoveLabel && 'hidden-label'), color: error ? 'error' : color, disabled: disabled, onClick: handleRemoveClick },
|
|
8973
|
+
!hideRemove && util.notEmpty(value) && (React.createElement(material.Button, { variant: 'outlined', tabIndex: removeTabIndex, className: classNames('remove-btn form-file-btn', !!hideRemoveLabel && 'hidden-label'), color: error ? 'error' : color, disabled: disabled, onClick: handleRemoveClick },
|
|
9105
8974
|
React.createElement("label", null,
|
|
9106
8975
|
React.createElement(FormIcon, null, "Close"),
|
|
9107
8976
|
!hideRemoveLabel && (removeLabel || '삭제')))))),
|
|
@@ -9419,7 +9288,7 @@ var FormMonthPicker = React.forwardRef(function (_a, ref) {
|
|
|
9419
9288
|
setErrorHelperText(errorHelperText);
|
|
9420
9289
|
}, [setError]);
|
|
9421
9290
|
var validate = React.useCallback(function (value) {
|
|
9422
|
-
if (required && empty(value)) {
|
|
9291
|
+
if (required && util.empty(value)) {
|
|
9423
9292
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
9424
9293
|
return false;
|
|
9425
9294
|
}
|
|
@@ -9586,7 +9455,7 @@ var FormMonthPicker = React.forwardRef(function (_a, ref) {
|
|
|
9586
9455
|
setValue(newValue);
|
|
9587
9456
|
if (isMonthSelect)
|
|
9588
9457
|
setOpen(false);
|
|
9589
|
-
nextTick(function () {
|
|
9458
|
+
util.nextTick(function () {
|
|
9590
9459
|
onValueChangeByUser(name, newValue);
|
|
9591
9460
|
});
|
|
9592
9461
|
}, [name, onValueChangeByUser, setValue]);
|
|
@@ -10029,7 +9898,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10029
9898
|
var handleContainerChange = React.useCallback(function (newValue, selectType, isMonthSelect) {
|
|
10030
9899
|
setValue(newValue);
|
|
10031
9900
|
if (selectType === 'start' && isMonthSelect) {
|
|
10032
|
-
nextTick(function () {
|
|
9901
|
+
util.nextTick(function () {
|
|
10033
9902
|
var _a;
|
|
10034
9903
|
(_a = endInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
10035
9904
|
});
|
|
@@ -10037,7 +9906,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10037
9906
|
else if (selectType === 'end' && isMonthSelect) {
|
|
10038
9907
|
setOpen(false);
|
|
10039
9908
|
}
|
|
10040
|
-
nextTick(function () {
|
|
9909
|
+
util.nextTick(function () {
|
|
10041
9910
|
onValueChangeByUser(name, newValue);
|
|
10042
9911
|
});
|
|
10043
9912
|
}, [name, onValueChangeByUser, setValue]);
|
|
@@ -10056,7 +9925,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10056
9925
|
if (fromError) {
|
|
10057
9926
|
validate(newValue);
|
|
10058
9927
|
}
|
|
10059
|
-
nextTick(function () {
|
|
9928
|
+
util.nextTick(function () {
|
|
10060
9929
|
onValueChangeByUser(name, newValue);
|
|
10061
9930
|
});
|
|
10062
9931
|
return newValue;
|
|
@@ -10075,7 +9944,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10075
9944
|
if (toError) {
|
|
10076
9945
|
validate(newValue);
|
|
10077
9946
|
}
|
|
10078
|
-
nextTick(function () {
|
|
9947
|
+
util.nextTick(function () {
|
|
10079
9948
|
onValueChangeByUser(name, newValue);
|
|
10080
9949
|
});
|
|
10081
9950
|
return newValue;
|
|
@@ -10294,7 +10163,7 @@ var FormYearPicker = React.forwardRef(function (_a, ref) {
|
|
|
10294
10163
|
setErrorHelperText(errorHelperText);
|
|
10295
10164
|
}, [setError]);
|
|
10296
10165
|
var validate = React.useCallback(function (value) {
|
|
10297
|
-
if (required && empty(value)) {
|
|
10166
|
+
if (required && util.empty(value)) {
|
|
10298
10167
|
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
10299
10168
|
return false;
|
|
10300
10169
|
}
|
|
@@ -10429,14 +10298,14 @@ var FormYearPicker = React.forwardRef(function (_a, ref) {
|
|
|
10429
10298
|
setValue(newValue);
|
|
10430
10299
|
if (isClick)
|
|
10431
10300
|
setOpen(false);
|
|
10432
|
-
nextTick(function () {
|
|
10301
|
+
util.nextTick(function () {
|
|
10433
10302
|
onValueChangeByUser(name, newValue);
|
|
10434
10303
|
});
|
|
10435
10304
|
}, [name, onValueChangeByUser, setValue]);
|
|
10436
10305
|
var handleInputDatePickerChange = React.useCallback(function (v) {
|
|
10437
10306
|
var newValue = v ? dateToValue(v) : v;
|
|
10438
10307
|
setValue(newValue);
|
|
10439
|
-
nextTick(function () {
|
|
10308
|
+
util.nextTick(function () {
|
|
10440
10309
|
onValueChangeByUser(name, newValue);
|
|
10441
10310
|
});
|
|
10442
10311
|
}, [dateToValue, name, onValueChangeByUser, setValue]);
|
|
@@ -10784,7 +10653,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10784
10653
|
var handleContainerChange = React.useCallback(function (newValue, selectType) {
|
|
10785
10654
|
setValue(newValue);
|
|
10786
10655
|
if (selectType === 'start') {
|
|
10787
|
-
nextTick(function () {
|
|
10656
|
+
util.nextTick(function () {
|
|
10788
10657
|
var _a;
|
|
10789
10658
|
setSelectType('end');
|
|
10790
10659
|
(_a = endInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -10793,7 +10662,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10793
10662
|
else if (selectType === 'end') {
|
|
10794
10663
|
setOpen(false);
|
|
10795
10664
|
}
|
|
10796
|
-
nextTick(function () {
|
|
10665
|
+
util.nextTick(function () {
|
|
10797
10666
|
onValueChangeByUser(name, newValue);
|
|
10798
10667
|
});
|
|
10799
10668
|
}, [name, onValueChangeByUser, setValue]);
|
|
@@ -10810,7 +10679,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10810
10679
|
if (fromError) {
|
|
10811
10680
|
validate(newValue);
|
|
10812
10681
|
}
|
|
10813
|
-
nextTick(function () {
|
|
10682
|
+
util.nextTick(function () {
|
|
10814
10683
|
onValueChangeByUser(name, newValue);
|
|
10815
10684
|
});
|
|
10816
10685
|
return newValue;
|
|
@@ -10827,7 +10696,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
10827
10696
|
if (toError) {
|
|
10828
10697
|
validate(newValue);
|
|
10829
10698
|
}
|
|
10830
|
-
nextTick(function () {
|
|
10699
|
+
util.nextTick(function () {
|
|
10831
10700
|
onValueChangeByUser(name, newValue);
|
|
10832
10701
|
});
|
|
10833
10702
|
return newValue;
|
|
@@ -11089,7 +10958,7 @@ FormYearRangePicker.defaultProps = FormYearRangePickerDefaultProps;var FormSwitc
|
|
|
11089
10958
|
else {
|
|
11090
10959
|
var finalValue_1 = getFinalValue(checked);
|
|
11091
10960
|
setValue(finalValue_1);
|
|
11092
|
-
nextTick(function () {
|
|
10961
|
+
util.nextTick(function () {
|
|
11093
10962
|
onValueChangeByUser(name, finalValue_1);
|
|
11094
10963
|
onRequestSearchSubmit(name, finalValue_1);
|
|
11095
10964
|
});
|