@xaypay/tui 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +239 -298
- package/dist/index.js +238 -298
- package/package.json +3 -3
- package/src/assets/table-settings-icon.svg +3 -0
- package/src/components/button/button.stories.js +4 -2
- package/src/components/button/index.js +9 -4
- package/src/components/captcha/index.js +2 -0
- package/src/components/input/index.js +35 -4
- package/src/components/input/input.stories.js +1 -1
- package/src/components/newAutocomplete/index.js +11 -12
- package/src/components/newFile/index.js +10 -10
- package/src/components/select/index.js +7 -6
- package/src/components/select/select.module.css +1 -1
- package/src/components/table/index.js +172 -113
- package/src/components/table/table.stories.js +198 -29
- package/src/stories/static/button-usage-icon.png +0 -0
- package/src/stories/usage.stories.mdx +4 -0
- package/src/utils/index.js +3 -16
- package/tui.config.js +29 -6
- package/src/components/table/table.module.css +0 -80
package/dist/index.js
CHANGED
|
@@ -95,9 +95,9 @@ function styleInject(css, ref) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
var css_248z$
|
|
99
|
-
var styles$
|
|
100
|
-
styleInject(css_248z$
|
|
98
|
+
var css_248z$d = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{display:block;height:auto;max-height:95%;object-fit:contain;width:27.8rem}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
|
|
99
|
+
var styles$b = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
|
|
100
|
+
styleInject(css_248z$d);
|
|
101
101
|
|
|
102
102
|
const File = ({
|
|
103
103
|
name,
|
|
@@ -159,15 +159,15 @@ const File = ({
|
|
|
159
159
|
document.querySelector(`.${name}`).value = "";
|
|
160
160
|
};
|
|
161
161
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
162
|
-
className: `${styles$
|
|
162
|
+
className: `${styles$b['file-form-title']} ile-form-title-rem`
|
|
163
163
|
}, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
|
|
164
164
|
style: {
|
|
165
165
|
color: "#ee0000"
|
|
166
166
|
}
|
|
167
167
|
}, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
168
|
-
className: classnames__default["default"](`${styles$
|
|
168
|
+
className: classnames__default["default"](`${styles$b['file-form-wrap']} file-form-wrap-rem`, image ? styles$b['active'] : '')
|
|
169
169
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
170
|
-
className: `${styles$
|
|
170
|
+
className: `${styles$b['file-form']} file-form-rem ${error || errorMessage ? styles$b['error'] : ''}`,
|
|
171
171
|
onClick: () => document.querySelector(`.${name}`).click()
|
|
172
172
|
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
173
173
|
hidden: true,
|
|
@@ -176,23 +176,23 @@ const File = ({
|
|
|
176
176
|
disabled: disabled,
|
|
177
177
|
onChange: e => handleCheckFile(e)
|
|
178
178
|
}), image ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
179
|
-
className: `${styles$
|
|
179
|
+
className: `${styles$b['upload-file-content']} upload-file-content-rem`
|
|
180
180
|
}, image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
181
181
|
src: image,
|
|
182
182
|
alt: fileName
|
|
183
183
|
})) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
184
|
-
className: `${styles$
|
|
184
|
+
className: `${styles$b['file-form-inner-upload']} ile-form-inner-upload-rem`
|
|
185
185
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
186
186
|
src: "../../assets/upload.svg",
|
|
187
187
|
alt: ""
|
|
188
188
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
189
|
-
className: `${styles$
|
|
189
|
+
className: `${styles$b['upload-info']} upload-info-rem`
|
|
190
190
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
191
|
-
className: `${styles$
|
|
191
|
+
className: `${styles$b['upload-info-txt']} upload-info-txt-rem`
|
|
192
192
|
}, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
193
|
-
className: `${styles$
|
|
193
|
+
className: `${styles$b['upload-info-size']} upload-info-size-rem`
|
|
194
194
|
}, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), !disabled && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
195
|
-
className: `${styles$
|
|
195
|
+
className: `${styles$b['delete-upload-icon']} delete-upload-icon-rem`,
|
|
196
196
|
onClick: handleRemoveFile
|
|
197
197
|
}, /*#__PURE__*/React__default["default"].createElement("i", {
|
|
198
198
|
className: "icon-delete"
|
|
@@ -219,212 +219,38 @@ File.defaultProps = {
|
|
|
219
219
|
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
var css_248z$d = ".table-module_table-wrap__KKAnM{background:#fff;border-radius:14px 14px 0 0;box-shadow:0 10px 30px rgba(0,35,106,.06);overflow:hidden;width:100%}.table-module_table-wrap__KKAnM:not(:first-child){margin-top:30px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:first-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:first-child{flex:0 0 auto;width:60px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(2),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(2){flex:0 0 auto;width:120px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(3),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(3){flex:0 0 auto;width:170px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(4),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(4){flex:0 0 auto;width:126px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(5),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(6),.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:nth-child(8),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(5),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(6),.table-module_table-top__tfEKM .table-module_table-items__UpFg2:nth-child(8){flex:0 0 auto;width:100px}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:last-child,.table-module_table-top__tfEKM .table-module_table-items__UpFg2:last-child{flex:0 0 auto;width:104px}.table-module_table-top__tfEKM{background:#00236a;height:44px;width:100%}.table-module_table-top__tfEKM .table-module_table-items__UpFg2{align-items:center;color:#fff;display:flex;flex:1 1;font-size:15px;justify-content:center;line-height:17px;text-align:center}.table-module_table-bottom-inner__0Pus0{background:#fff;min-height:40px;width:100%}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2{align-items:center;border-bottom:1px solid #eee;display:flex;flex:1 1;font-size:14px;justify-content:center;line-height:16px;padding:4px;text-align:center}.table-module_table-bottom-inner__0Pus0 .table-module_table-items__UpFg2:not(:last-child){border-right:1px solid #eee}";
|
|
223
|
-
var styles$b = {"table-wrap":"table-module_table-wrap__KKAnM","table-bottom-inner":"table-module_table-bottom-inner__0Pus0","table-items":"table-module_table-items__UpFg2","table-top":"table-module_table-top__tfEKM"};
|
|
224
|
-
styleInject(css_248z$d);
|
|
225
|
-
|
|
226
|
-
var css_248z$c = ".checkbox-module_checkbox-wrap__Xrg-m{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.checkbox-module_checkbox-wrap__Xrg-m>input{height:0;opacity:0;position:absolute;width:0}.checkbox-module_checkbox-wrap__Xrg-m .checkbox-module_checkmark__M8DY6{border:1px solid #d9d9d9;border-radius:3px;bottom:0;display:inline-block;height:14px;left:0;margin:auto 4px auto auto;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.checkbox-module_checkbox-wrap__Xrg-m>.checkbox-module_checkmark__M8DY6:after{border:solid #1890ff;border-width:0 2px 2px 0;content:\"\";display:block;height:8px;left:4px;opacity:0;position:absolute;top:1px;transform:rotate(45deg);transition:opacity .24s;width:4px}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6:after{opacity:1}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6,.checkbox-module_checkbox-wrap__Xrg-m:hover input~.checkbox-module_checkmark__M8DY6{border-color:#1890ff}";
|
|
227
|
-
var styles$a = {"checkbox-wrap":"checkbox-module_checkbox-wrap__Xrg-m","checkmark":"checkbox-module_checkmark__M8DY6"};
|
|
228
|
-
styleInject(css_248z$c);
|
|
229
|
-
|
|
230
|
-
const Checkbox = ({
|
|
231
|
-
disabled,
|
|
232
|
-
required,
|
|
233
|
-
className,
|
|
234
|
-
name,
|
|
235
|
-
value,
|
|
236
|
-
jsonData,
|
|
237
|
-
onChange,
|
|
238
|
-
label,
|
|
239
|
-
keyNames,
|
|
240
|
-
onClick,
|
|
241
|
-
...props
|
|
242
|
-
}) => {
|
|
243
|
-
const classProps = classnames__default["default"](styles$a.checkbox, className, 'checkbox-input-rem');
|
|
244
|
-
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
245
|
-
const [data, setData] = React.useState(parseData);
|
|
246
|
-
React.useEffect(() => {
|
|
247
|
-
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
248
|
-
setData(parseData);
|
|
249
|
-
}, [jsonData]);
|
|
250
|
-
React.useEffect(() => {
|
|
251
|
-
onChange ? onChange(data.filter(d => d.checked)) : '';
|
|
252
|
-
}, [data]);
|
|
253
|
-
const handleChange = e => {
|
|
254
|
-
let id;
|
|
255
|
-
data.forEach((value, key) => {
|
|
256
|
-
if (value[keyNames.value] === e.target.value) {
|
|
257
|
-
id = key;
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
let items = [...data];
|
|
261
|
-
let item = {
|
|
262
|
-
...items[id]
|
|
263
|
-
};
|
|
264
|
-
item.checked = !item.checked;
|
|
265
|
-
items[id] = item;
|
|
266
|
-
setData(items);
|
|
267
|
-
};
|
|
268
|
-
!keyNames ? keyNames = {
|
|
269
|
-
id: 'id',
|
|
270
|
-
name: 'name',
|
|
271
|
-
value: 'value',
|
|
272
|
-
label: 'label'
|
|
273
|
-
} : '';
|
|
274
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, data.map(element => {
|
|
275
|
-
return /*#__PURE__*/React__default["default"].createElement("label", {
|
|
276
|
-
className: `${styles$a["checkbox-wrap"]} checkbox-wrap-rem`,
|
|
277
|
-
key: element.value
|
|
278
|
-
}, /*#__PURE__*/React__default["default"].createElement("input", _extends({
|
|
279
|
-
type: "checkbox",
|
|
280
|
-
className: classProps,
|
|
281
|
-
disabled: disabled,
|
|
282
|
-
required: required,
|
|
283
|
-
value: keyNames.value ? element[keyNames.value] : '',
|
|
284
|
-
name: keyNames.name ? element[keyNames.name] : '',
|
|
285
|
-
id: keyNames.id ? element[keyNames.id] : '',
|
|
286
|
-
onChange: handleChange,
|
|
287
|
-
onClick: onClick ? onClick : () => {},
|
|
288
|
-
defaultChecked: element.checked
|
|
289
|
-
}, props)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
290
|
-
className: `${styles$a["checkmark"]} checkmark-rem`
|
|
291
|
-
}), element[keyNames.label] ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
292
|
-
className: styles$a.labelCheckbox,
|
|
293
|
-
for: element[keyNames.id]
|
|
294
|
-
}, element[keyNames.label]) : "");
|
|
295
|
-
}));
|
|
296
|
-
};
|
|
297
|
-
Checkbox.propTypes = {
|
|
298
|
-
className: PropTypes__default["default"].string,
|
|
299
|
-
onChange: PropTypes__default["default"].func,
|
|
300
|
-
onClick: PropTypes__default["default"].func,
|
|
301
|
-
required: PropTypes__default["default"].bool,
|
|
302
|
-
disabled: PropTypes__default["default"].bool,
|
|
303
|
-
name: PropTypes__default["default"].string,
|
|
304
|
-
value: PropTypes__default["default"].string,
|
|
305
|
-
jsonData: PropTypes__default["default"].string,
|
|
306
|
-
label: PropTypes__default["default"].string,
|
|
307
|
-
keyNames: PropTypes__default["default"].object
|
|
308
|
-
};
|
|
309
|
-
Checkbox.defaultProps = {
|
|
310
|
-
onChange: undefined,
|
|
311
|
-
jsonData: '[{"value":"email", "name":"contact1", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact2", "label":"Phone", "id":"contactChoice2"}]'
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
const Table = ({
|
|
315
|
-
className,
|
|
316
|
-
onChange,
|
|
317
|
-
config,
|
|
318
|
-
jsonData,
|
|
319
|
-
hearderData,
|
|
320
|
-
keyNames,
|
|
321
|
-
actions,
|
|
322
|
-
...props
|
|
323
|
-
}) => {
|
|
324
|
-
classnames__default["default"](className);
|
|
325
|
-
let tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
|
|
326
|
-
React.useEffect(() => {
|
|
327
|
-
tbodyData = jsonData.length ? JSON.parse(jsonData) : [];
|
|
328
|
-
}, [jsonData]);
|
|
329
|
-
const [checked, setChecked] = React.useState(config.isCheckbox && config.isCheckbox.checked ? config.isCheckbox.checked : []);
|
|
330
|
-
config.isCheckbox && config.isCheckbox.showCheckbox == undefined ? config.isCheckbox.showCheckbox = () => {
|
|
331
|
-
return true;
|
|
332
|
-
} : "";
|
|
333
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
334
|
-
className: `${styles$b["table-wrap"]} table-wrap-rem`
|
|
335
|
-
}, config.isHeader && hearderData.map((header, key) => {
|
|
336
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
337
|
-
className: `${styles$b["table-top"]} table-top-rem`,
|
|
338
|
-
key: key
|
|
339
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
340
|
-
className: `${styles$b["table-items"]} table-items-rem`
|
|
341
|
-
}, header));
|
|
342
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
343
|
-
className: `${styles$b["table-bottom"]} table-bottom-rem`
|
|
344
|
-
}, tbodyData.map((item, key) => {
|
|
345
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
346
|
-
className: `${styles$b["table-bottom-inner"]} table-bottom-inner-rem`,
|
|
347
|
-
key: key
|
|
348
|
-
}, keyNames.map((keyName, keyNameKey) => {
|
|
349
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
350
|
-
className: `${styles$b["table-items"]} table-items-rem`,
|
|
351
|
-
key: keyNameKey
|
|
352
|
-
}, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/React__default["default"].createElement(Checkbox, {
|
|
353
|
-
onClick: e => {
|
|
354
|
-
const id = e.target.id;
|
|
355
|
-
const checkedValue = e.target.checked;
|
|
356
|
-
let ch = [...checked];
|
|
357
|
-
checkedValue ? ch.push(Number(id)) : ch.splice(ch.indexOf(id), 1);
|
|
358
|
-
setChecked(ch);
|
|
359
|
-
config.isCheckbox.onChange(ch);
|
|
360
|
-
},
|
|
361
|
-
jsonData: `[{"value":"", "name":"", "label":"", "id":${item.id}, "checked":${checked.indexOf(item.id) > -1 ? true : false}}]`
|
|
362
|
-
}), typeof keyName === "string" ? item[keyName] : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("i", {
|
|
363
|
-
className: keyName.icon
|
|
364
|
-
}), item[keyName.name]));
|
|
365
|
-
}), actions && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
366
|
-
className: `${styles$b["table-items"]} table-items-rem`
|
|
367
|
-
}, actions.filter(a => a.show && a.show(item) || a.show === undefined).map((action, key) => {
|
|
368
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
369
|
-
key: key
|
|
370
|
-
}, /*#__PURE__*/React__default["default"].createElement("i", {
|
|
371
|
-
className: action.icon,
|
|
372
|
-
onClick: action.click ? action.click : () => {}
|
|
373
|
-
}, action.icon));
|
|
374
|
-
})));
|
|
375
|
-
})));
|
|
376
|
-
};
|
|
377
|
-
Table.propTypes = {
|
|
378
|
-
className: PropTypes__default["default"].string,
|
|
379
|
-
onChange: PropTypes__default["default"].func,
|
|
380
|
-
config: PropTypes__default["default"].object,
|
|
381
|
-
actions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
382
|
-
jsonData: PropTypes__default["default"].string,
|
|
383
|
-
keyNames: PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOf([PropTypes__default["default"].string, PropTypes__default["default"].object])),
|
|
384
|
-
hearderData: PropTypes__default["default"].array
|
|
385
|
-
};
|
|
386
|
-
Table.defaultProps = {
|
|
387
|
-
className: "",
|
|
388
|
-
onChange: undefined,
|
|
389
|
-
errorMessage: "",
|
|
390
|
-
config: {
|
|
391
|
-
isHeader: true,
|
|
392
|
-
isCheckbox: {
|
|
393
|
-
checked: []
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
actions: [],
|
|
397
|
-
jsonData: "",
|
|
398
|
-
keyNames: [],
|
|
399
|
-
hearderData: []
|
|
400
|
-
};
|
|
401
|
-
|
|
402
222
|
const _ = require('lodash');
|
|
403
223
|
const compereConfigs = () => {
|
|
404
224
|
let projectConfig = {};
|
|
405
|
-
let packageConfig =
|
|
406
|
-
try {
|
|
407
|
-
packageConfig = require('../tui.config.js');
|
|
408
|
-
} catch (e) {
|
|
409
|
-
try {
|
|
410
|
-
packageConfig = require('../../tui.config.js');
|
|
411
|
-
} catch (err) {
|
|
412
|
-
packageConfig = {};
|
|
413
|
-
}
|
|
414
|
-
}
|
|
225
|
+
let packageConfig = require(process.env.STORYBOOK_PATH);
|
|
415
226
|
try {
|
|
416
|
-
projectConfig = require(
|
|
417
|
-
} catch (
|
|
418
|
-
projectConfig = {};
|
|
419
|
-
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
420
|
-
}
|
|
421
|
-
|
|
227
|
+
projectConfig = require(`${process.env.STORYBOOK_CONFIG_PATH}`);
|
|
228
|
+
} catch (e) {}
|
|
422
229
|
return _.merge(packageConfig, projectConfig);
|
|
423
230
|
};
|
|
424
231
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
232
|
+
({
|
|
233
|
+
tableHeadItems: PropTypes__default["default"].array,
|
|
234
|
+
tableBodyItems: PropTypes__default["default"].array,
|
|
235
|
+
tHeadColor: PropTypes__default["default"].string,
|
|
236
|
+
tHeadFamily: PropTypes__default["default"].string,
|
|
237
|
+
tHeadPadding: PropTypes__default["default"].string,
|
|
238
|
+
tHeadFontWeight: PropTypes__default["default"].number,
|
|
239
|
+
tHeadBorderRadius: PropTypes__default["default"].string,
|
|
240
|
+
tHeadBackgroundColor: PropTypes__default["default"].string,
|
|
241
|
+
tBodyColor: PropTypes__default["default"].string,
|
|
242
|
+
tBodyPadding: PropTypes__default["default"].string,
|
|
243
|
+
tBodyFontSize: PropTypes__default["default"].string,
|
|
244
|
+
tBodyTextAlign: PropTypes__default["default"].string,
|
|
245
|
+
tBodyFontWeight: PropTypes__default["default"].string,
|
|
246
|
+
tBodyFontFamily: PropTypes__default["default"].string,
|
|
247
|
+
tBodyRowBorder: PropTypes__default["default"].string,
|
|
248
|
+
tBodyMarginTop: PropTypes__default["default"].string
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
var css_248z$c = ".modal-module_animation__modal__3mt48{animation:modal-module_show-popup__WrH7a .15s;-webkit-animation:modal-module_show-popup__WrH7a .15s}@keyframes modal-module_show-popup__WrH7a{0%{transform:translate3d(0,-50%,0);-webkit-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);-o-transform:translate3d(0,-50%,0)}to{opacity:1;transform:translateZ(0);-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0)}}";
|
|
252
|
+
var styles$a = {"animation__modal":"modal-module_animation__modal__3mt48","show-popup":"modal-module_show-popup__WrH7a"};
|
|
253
|
+
styleInject(css_248z$c);
|
|
428
254
|
|
|
429
255
|
const SvgNext = ({
|
|
430
256
|
title,
|
|
@@ -597,7 +423,7 @@ const Modal = ({
|
|
|
597
423
|
height: '100vh'
|
|
598
424
|
}
|
|
599
425
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
600
|
-
className: `${classProps} ${styles$
|
|
426
|
+
className: `${classProps} ${styles$a['animation__modal']}`,
|
|
601
427
|
onClick: handleStopClosing,
|
|
602
428
|
style: {
|
|
603
429
|
top: '0px',
|
|
@@ -751,9 +577,9 @@ Modal.defaultProps = {
|
|
|
751
577
|
type: 'content'
|
|
752
578
|
};
|
|
753
579
|
|
|
754
|
-
var css_248z$
|
|
755
|
-
var styles$
|
|
756
|
-
styleInject(css_248z$
|
|
580
|
+
var css_248z$b = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
581
|
+
var styles$9 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","error-message-show":"input-module_error-message-show__OrVSo","error-show":"input-module_error-show__9MP6k"};
|
|
582
|
+
styleInject(css_248z$b);
|
|
757
583
|
|
|
758
584
|
const InputTypes = {
|
|
759
585
|
TEL: 'tel',
|
|
@@ -792,6 +618,7 @@ const Input = ({
|
|
|
792
618
|
maxLength,
|
|
793
619
|
labelColor,
|
|
794
620
|
errorColor,
|
|
621
|
+
borderRight,
|
|
795
622
|
placeholder,
|
|
796
623
|
errorZindex,
|
|
797
624
|
errorBottom,
|
|
@@ -809,9 +636,11 @@ const Input = ({
|
|
|
809
636
|
labelLineHeight,
|
|
810
637
|
backgroundColor,
|
|
811
638
|
telErrorMessage,
|
|
639
|
+
borderRightColor,
|
|
812
640
|
labelMarginBottom,
|
|
813
641
|
regexpErrorMessage,
|
|
814
642
|
phoneJustifyContent,
|
|
643
|
+
borderRightColorHover,
|
|
815
644
|
errorAnimationDuration,
|
|
816
645
|
...props
|
|
817
646
|
}) => {
|
|
@@ -838,14 +667,26 @@ const Input = ({
|
|
|
838
667
|
`;
|
|
839
668
|
const handleChange = event => {
|
|
840
669
|
const currentValue = event.target.value;
|
|
670
|
+
let prevValue = innerValue;
|
|
841
671
|
setInnerValue(currentValue);
|
|
842
672
|
if (change) {
|
|
843
673
|
change(currentValue);
|
|
844
674
|
}
|
|
845
675
|
if (type === 'tel') {
|
|
846
676
|
if (!phoneNumberRegex.test(currentValue)) {
|
|
847
|
-
|
|
848
|
-
|
|
677
|
+
if (currentValue === '') {
|
|
678
|
+
setInnerErrorMessage('');
|
|
679
|
+
setInnerValue('');
|
|
680
|
+
if (change) {
|
|
681
|
+
change('');
|
|
682
|
+
}
|
|
683
|
+
} else {
|
|
684
|
+
telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
|
|
685
|
+
setInnerValue(prevValue);
|
|
686
|
+
if (change) {
|
|
687
|
+
change(prevValue);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
849
690
|
} else {
|
|
850
691
|
setInnerErrorMessage('');
|
|
851
692
|
if (currentValue.length > 8) {
|
|
@@ -893,7 +734,11 @@ const Input = ({
|
|
|
893
734
|
setInnerValue(value);
|
|
894
735
|
if (type === 'tel') {
|
|
895
736
|
if (!phoneNumberRegex.test(value)) {
|
|
896
|
-
|
|
737
|
+
if (value === '') {
|
|
738
|
+
setInnerErrorMessage('');
|
|
739
|
+
} else {
|
|
740
|
+
telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
|
|
741
|
+
}
|
|
897
742
|
setInnerValue('');
|
|
898
743
|
} else {
|
|
899
744
|
setInnerErrorMessage('');
|
|
@@ -912,11 +757,11 @@ const Input = ({
|
|
|
912
757
|
}
|
|
913
758
|
}
|
|
914
759
|
}
|
|
915
|
-
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage]);
|
|
760
|
+
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
916
761
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
917
|
-
className: `${styles$
|
|
762
|
+
className: `${styles$9["input-wrap"]}`
|
|
918
763
|
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
919
|
-
className: `${styles$
|
|
764
|
+
className: `${styles$9["input-title"]}`,
|
|
920
765
|
style: {
|
|
921
766
|
color: labelColor ? labelColor : configStyles.INPUT.labelColor,
|
|
922
767
|
fontSize: labelSize ? labelSize : configStyles.INPUT.labelSize,
|
|
@@ -930,7 +775,7 @@ const Input = ({
|
|
|
930
775
|
color: errorColor ? errorColor : "#ee0000"
|
|
931
776
|
}
|
|
932
777
|
}, "*")) : '', /*#__PURE__*/React__default["default"].createElement("div", {
|
|
933
|
-
className: `${styles$
|
|
778
|
+
className: `${styles$9["input-content"]}`,
|
|
934
779
|
style: {
|
|
935
780
|
width: width ? width : configStyles.INPUT.width,
|
|
936
781
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
@@ -962,7 +807,9 @@ const Input = ({
|
|
|
962
807
|
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
963
808
|
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
964
809
|
display: phoneDisplay ? phoneDisplay : configStyles.INPUT.phoneDisplay,
|
|
810
|
+
borderRight: borderRight ? borderRight : configStyles.INPUT.borderRight,
|
|
965
811
|
alignItems: phoneAlignItems ? phoneAlignItems : configStyles.INPUT.phoneAlignItems,
|
|
812
|
+
borderColor: innerErrorMessage ? errorColor ? errorColor : configStyles.INPUT.errorColor : isHover ? borderRightColorHover ? borderRightColorHover : configStyles.INPUT.borderRightColorHover : borderRightColor ? borderRightColor : configStyles.INPUT.borderRightColor,
|
|
966
813
|
color: innerErrorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color,
|
|
967
814
|
justifyContent: phoneJustifyContent ? phoneJustifyContent : configStyles.INPUT.phoneJustifyContent,
|
|
968
815
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
@@ -1044,6 +891,7 @@ Input.propTypes = {
|
|
|
1044
891
|
maxLength: PropTypes__default["default"].number,
|
|
1045
892
|
errorColor: PropTypes__default["default"].string,
|
|
1046
893
|
labelColor: PropTypes__default["default"].string,
|
|
894
|
+
borderRight: PropTypes__default["default"].string,
|
|
1047
895
|
placeholder: PropTypes__default["default"].string,
|
|
1048
896
|
errorZindex: PropTypes__default["default"].string,
|
|
1049
897
|
errorBottom: PropTypes__default["default"].string,
|
|
@@ -1061,10 +909,12 @@ Input.propTypes = {
|
|
|
1061
909
|
phoneAlignItems: PropTypes__default["default"].string,
|
|
1062
910
|
errorLineHeight: PropTypes__default["default"].string,
|
|
1063
911
|
labelLineHeight: PropTypes__default["default"].string,
|
|
912
|
+
borderRightColor: PropTypes__default["default"].string,
|
|
1064
913
|
labelMarginBottom: PropTypes__default["default"].string,
|
|
1065
914
|
regexpErrorMessage: PropTypes__default["default"].string,
|
|
1066
915
|
regexp: PropTypes__default["default"].instanceOf(RegExp),
|
|
1067
916
|
phoneJustifyContent: PropTypes__default["default"].string,
|
|
917
|
+
borderRightColorHover: PropTypes__default["default"].string,
|
|
1068
918
|
errorAnimationDuration: PropTypes__default["default"].string,
|
|
1069
919
|
leftIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
|
|
1070
920
|
rightIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
|
|
@@ -1075,9 +925,9 @@ Input.defaultProps = {
|
|
|
1075
925
|
type: "text"
|
|
1076
926
|
};
|
|
1077
927
|
|
|
1078
|
-
var css_248z$
|
|
1079
|
-
var styles$
|
|
1080
|
-
styleInject(css_248z$
|
|
928
|
+
var css_248z$a = ".radio-module_radio-wrap__-lO7V{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.radio-module_radio-wrap__-lO7V>input{height:0;opacity:0;position:absolute;width:0}.radio-module_radio-wrap__-lO7V .radio-module_radio-checkmark__Kvol0{border:1px solid #d9d9d9;border-radius:50%;display:inline-block;height:14px;left:0;margin-right:4px;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.radio-module_radio-wrap__-lO7V>.radio-module_radio-checkmark__Kvol0:after{background-color:#d9d9d9;border-radius:50%;bottom:0;content:\"\";height:8px;left:0;margin:auto;opacity:0;position:absolute;right:0;top:0;transition:opacity .24s,background-color .24s;width:8px}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0:after{background-color:#1890ff;opacity:1}.radio-module_radio-wrap__-lO7V:hover input~.radio-module_radio-checkmark__Kvol0:after{opacity:1}.radio-module_radio-wrap__-lO7V input:checked~.radio-module_radio-checkmark__Kvol0{border-color:#1890ff}";
|
|
929
|
+
var styles$8 = {"radio-wrap":"radio-module_radio-wrap__-lO7V","radio-checkmark":"radio-module_radio-checkmark__Kvol0"};
|
|
930
|
+
styleInject(css_248z$a);
|
|
1081
931
|
|
|
1082
932
|
const Radio = ({
|
|
1083
933
|
disabled,
|
|
@@ -1091,11 +941,11 @@ const Radio = ({
|
|
|
1091
941
|
keyNames,
|
|
1092
942
|
...props
|
|
1093
943
|
}) => {
|
|
1094
|
-
const classProps = classnames__default["default"](styles$
|
|
944
|
+
const classProps = classnames__default["default"](styles$8.checkbox, className);
|
|
1095
945
|
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
1096
946
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, parseData.map((element, id) => {
|
|
1097
947
|
return /*#__PURE__*/React__default["default"].createElement("label", {
|
|
1098
|
-
className: `${styles$
|
|
948
|
+
className: `${styles$8["radio-wrap"]} radio-wrap-rem`,
|
|
1099
949
|
key: element.value
|
|
1100
950
|
}, /*#__PURE__*/React__default["default"].createElement("input", _extends({
|
|
1101
951
|
type: "radio",
|
|
@@ -1106,9 +956,9 @@ const Radio = ({
|
|
|
1106
956
|
value: value ? value : element.value,
|
|
1107
957
|
name: name ? name : element.name
|
|
1108
958
|
}, props)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1109
|
-
className: `${styles$
|
|
959
|
+
className: `${styles$8["radio-checkmark"]} radio-checkmark-rem`
|
|
1110
960
|
}), element.label ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1111
|
-
className: styles$
|
|
961
|
+
className: styles$8.labelRadio
|
|
1112
962
|
}, label ? label : element.label) : "");
|
|
1113
963
|
}));
|
|
1114
964
|
};
|
|
@@ -1130,6 +980,7 @@ Radio.defaultProps = {
|
|
|
1130
980
|
};
|
|
1131
981
|
|
|
1132
982
|
const Button = ({
|
|
983
|
+
icon,
|
|
1133
984
|
size,
|
|
1134
985
|
type,
|
|
1135
986
|
font,
|
|
@@ -1158,8 +1009,8 @@ const Button = ({
|
|
|
1158
1009
|
}) => {
|
|
1159
1010
|
const [isHover, setIsHover] = React.useState(false);
|
|
1160
1011
|
React.useEffect(() => {
|
|
1161
|
-
if (!label) {
|
|
1162
|
-
alert('
|
|
1012
|
+
if (!label && !icon) {
|
|
1013
|
+
alert('Add icon or label props on Button component');
|
|
1163
1014
|
}
|
|
1164
1015
|
}, []);
|
|
1165
1016
|
const configStyles = compereConfigs();
|
|
@@ -1172,11 +1023,14 @@ const Button = ({
|
|
|
1172
1023
|
};
|
|
1173
1024
|
return /*#__PURE__*/React__default["default"].createElement("button", _extends({
|
|
1174
1025
|
style: {
|
|
1026
|
+
display: 'flex',
|
|
1027
|
+
alignItems: 'center',
|
|
1175
1028
|
fontSize: size ? size : configStyles.BUTTON.size,
|
|
1176
1029
|
fontFamily: font ? font : configStyles.BUTTON.font,
|
|
1177
1030
|
height: height ? height : configStyles.BUTTON.height,
|
|
1178
1031
|
fontWeight: weight ? weight : configStyles.BUTTON.weight,
|
|
1179
1032
|
padding: padding ? padding : configStyles.BUTTON.padding,
|
|
1033
|
+
justifyContent: icon && label ? 'space-between' : 'center',
|
|
1180
1034
|
borderRadius: radius ? radius : configStyles.BUTTON.radius,
|
|
1181
1035
|
boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
|
|
1182
1036
|
transition: transition ? transition : configStyles.BUTTON.transition,
|
|
@@ -1194,16 +1048,18 @@ const Button = ({
|
|
|
1194
1048
|
onMouseEnter: handleMouseEnter,
|
|
1195
1049
|
onMouseLeave: handleMouseLeave,
|
|
1196
1050
|
className: classProps
|
|
1197
|
-
}, props), label);
|
|
1051
|
+
}, props), icon && icon, " ", label && label, " ", !icon && !label && 'Add icon or label prop on Button component');
|
|
1198
1052
|
};
|
|
1199
1053
|
Button.propTypes = {
|
|
1200
1054
|
type: PropTypes__default["default"].string,
|
|
1201
1055
|
size: PropTypes__default["default"].string,
|
|
1202
1056
|
font: PropTypes__default["default"].string,
|
|
1057
|
+
icon: PropTypes__default["default"].element,
|
|
1203
1058
|
color: PropTypes__default["default"].string,
|
|
1204
1059
|
width: PropTypes__default["default"].string,
|
|
1205
1060
|
outline: PropTypes__default["default"].bool,
|
|
1206
1061
|
onClick: PropTypes__default["default"].func,
|
|
1062
|
+
label: PropTypes__default["default"].string,
|
|
1207
1063
|
weight: PropTypes__default["default"].string,
|
|
1208
1064
|
height: PropTypes__default["default"].string,
|
|
1209
1065
|
cursor: PropTypes__default["default"].string,
|
|
@@ -1218,7 +1074,6 @@ Button.propTypes = {
|
|
|
1218
1074
|
textTransform: PropTypes__default["default"].string,
|
|
1219
1075
|
disabledColor: PropTypes__default["default"].string,
|
|
1220
1076
|
backgroundColor: PropTypes__default["default"].string,
|
|
1221
|
-
label: PropTypes__default["default"].string.isRequired,
|
|
1222
1077
|
disabledLineColor: PropTypes__default["default"].string,
|
|
1223
1078
|
disabledBackgroundColor: PropTypes__default["default"].string
|
|
1224
1079
|
};
|
|
@@ -1294,9 +1149,9 @@ const SvgArrow = ({
|
|
|
1294
1149
|
fill: "#3C393E"
|
|
1295
1150
|
}));
|
|
1296
1151
|
|
|
1297
|
-
var css_248z$
|
|
1298
|
-
var styles$
|
|
1299
|
-
styleInject(css_248z$
|
|
1152
|
+
var css_248z$9 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;width:100%;z-index:9}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
|
|
1153
|
+
var styles$7 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
|
|
1154
|
+
styleInject(css_248z$9);
|
|
1300
1155
|
|
|
1301
1156
|
const Select = ({
|
|
1302
1157
|
options,
|
|
@@ -1326,7 +1181,6 @@ const Select = ({
|
|
|
1326
1181
|
selectedColor,
|
|
1327
1182
|
selectedRadius,
|
|
1328
1183
|
selectedMinHeight,
|
|
1329
|
-
selectedBorder,
|
|
1330
1184
|
selectedPadding,
|
|
1331
1185
|
selectedFontSize,
|
|
1332
1186
|
selectedBoxSizing,
|
|
@@ -1334,7 +1188,6 @@ const Select = ({
|
|
|
1334
1188
|
selectedLineHeight,
|
|
1335
1189
|
selectedHoverColor,
|
|
1336
1190
|
selectedTransition,
|
|
1337
|
-
selectedBorderColor,
|
|
1338
1191
|
optionsBoxShadow,
|
|
1339
1192
|
optionsBorderRadius,
|
|
1340
1193
|
optionsBackgroundColor,
|
|
@@ -1349,7 +1202,9 @@ const Select = ({
|
|
|
1349
1202
|
optionItemColorHover,
|
|
1350
1203
|
optionItemMarginBottom,
|
|
1351
1204
|
optionItemBackgroudColor,
|
|
1352
|
-
optionItemBackgroudColorHover
|
|
1205
|
+
optionItemBackgroudColorHover,
|
|
1206
|
+
boxShadow,
|
|
1207
|
+
boxShadowHover
|
|
1353
1208
|
}) => {
|
|
1354
1209
|
const ref = React.useRef();
|
|
1355
1210
|
const [opened, setOpened] = React.useState(false);
|
|
@@ -1476,12 +1331,11 @@ const Select = ({
|
|
|
1476
1331
|
}, "*")) : "", /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1477
1332
|
ref: ref
|
|
1478
1333
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1479
|
-
className: styles$
|
|
1334
|
+
className: styles$7['select-content']
|
|
1480
1335
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1481
1336
|
style: {
|
|
1482
1337
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
|
|
1483
1338
|
minHeight: selectedMinHeight ? selectedMinHeight : configStyles.SELECT.selectedMinHeight,
|
|
1484
|
-
border: selectedBorder ? selectedBorder : configStyles.SELECT.selectedBorder,
|
|
1485
1339
|
padding: selectedPadding ? selectedPadding : configStyles.SELECT.selectedPadding,
|
|
1486
1340
|
borderRadius: selectedRadius ? selectedRadius : configStyles.SELECT.selectedRadius,
|
|
1487
1341
|
fontSize: selectedFontSize ? selectedFontSize : configStyles.SELECT.selectedFontSize,
|
|
@@ -1489,14 +1343,14 @@ const Select = ({
|
|
|
1489
1343
|
fontWeight: selectedFontWeight ? selectedFontWeight : configStyles.SELECT.selectedFontWeight,
|
|
1490
1344
|
lineHeight: selectedLineHeight ? selectedLineHeight : configStyles.SELECT.selectedLineHeight,
|
|
1491
1345
|
transition: selectedTransition ? selectedTransition : configStyles.SELECT.selectedTransition,
|
|
1492
|
-
|
|
1346
|
+
boxShadow: errorMessage ? errorColor ? `0 0 0 2px ${errorColor}` : `0 0 0 2px ${configStyles.SELECT.errorColor}` : isHover ? boxShadowHover ? boxShadowHover : configStyles.SELECT.boxShadowHover : boxShadow ? boxShadow : configStyles.SELECT.boxShadow
|
|
1493
1347
|
},
|
|
1494
1348
|
onClick: disabled ? _ => _ : _ => handleOpenClose(),
|
|
1495
1349
|
onMouseEnter: disabled ? _ => _ : _ => handleMouseEnter(),
|
|
1496
1350
|
onMouseLeave: disabled ? _ => _ : _ => handleMouseLeave(),
|
|
1497
|
-
className: `${styles$
|
|
1351
|
+
className: `${styles$7['select-content-top']}`
|
|
1498
1352
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1499
|
-
className: `${styles$
|
|
1353
|
+
className: `${styles$7['select-content-top-text']}`,
|
|
1500
1354
|
style: {
|
|
1501
1355
|
color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor
|
|
1502
1356
|
}
|
|
@@ -1509,9 +1363,9 @@ const Select = ({
|
|
|
1509
1363
|
}
|
|
1510
1364
|
}
|
|
1511
1365
|
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1512
|
-
className: `${styles$
|
|
1366
|
+
className: `${styles$7['select-content-top-icon']}`
|
|
1513
1367
|
}, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1514
|
-
className: `${styles$
|
|
1368
|
+
className: `${styles$7['close-icon']}`,
|
|
1515
1369
|
onClick: disabled ? _ => _ : handleClearSelect,
|
|
1516
1370
|
style: {
|
|
1517
1371
|
marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'
|
|
@@ -1520,7 +1374,7 @@ const Select = ({
|
|
|
1520
1374
|
style: {
|
|
1521
1375
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)'
|
|
1522
1376
|
},
|
|
1523
|
-
className: `${styles$
|
|
1377
|
+
className: `${styles$7['arrow-icon']}`
|
|
1524
1378
|
}, arrowIcon ? arrowIcon : /*#__PURE__*/React__default["default"].createElement(SvgArrow, null)) : '')), opened && !disabled ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1525
1379
|
style: {
|
|
1526
1380
|
boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
|
|
@@ -1528,9 +1382,9 @@ const Select = ({
|
|
|
1528
1382
|
backgroundColor: optionsBackgroundColor ? optionsBackgroundColor : configStyles.SELECT.optionsBackgroundColor,
|
|
1529
1383
|
top: selectedMinHeight ? selectedMinHeight.includes('rem') ? parseFloat(selectedMinHeight.substr(0, selectedMinHeight.length - 3)) + 0.6 + 'rem' : parseFloat(selectedMinHeight.substr(0, selectedMinHeight.length - 2)) + 6 + 'px' : configStyles.SELECT.selectedMinHeight.includes('rem') ? parseFloat(configStyles.SELECT.selectedMinHeight.substr(0, configStyles.SELECT.selectedMinHeight.length - 3)) + 0.6 + 'rem' : parseFloat(configStyles.SELECT.selectedMinHeight.substr(0, configStyles.SELECT.selectedMinHeight.length - 2)) + 6 + 'px'
|
|
1530
1384
|
},
|
|
1531
|
-
className: `${styles$
|
|
1385
|
+
className: `${styles$7['select-content-bottom']}`
|
|
1532
1386
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1533
|
-
className: `${styles$
|
|
1387
|
+
className: `${styles$7['select-content-bottom-inner']}`
|
|
1534
1388
|
}, existOptions && existOptions.length > 0 && existOptions.map((option, i) => {
|
|
1535
1389
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1536
1390
|
key: i,
|
|
@@ -1539,7 +1393,7 @@ const Select = ({
|
|
|
1539
1393
|
onClick: disabled ? _ => _ : _ => handleSelectItem(option),
|
|
1540
1394
|
onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
|
|
1541
1395
|
onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
|
|
1542
|
-
className: `${styles$
|
|
1396
|
+
className: `${styles$7['select-content-bottom-row']}`,
|
|
1543
1397
|
style: {
|
|
1544
1398
|
color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
|
|
1545
1399
|
cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
|
|
@@ -1588,7 +1442,6 @@ Select.propTypes = {
|
|
|
1588
1442
|
errorSize: PropTypes__default["default"].string,
|
|
1589
1443
|
errorColor: PropTypes__default["default"].string,
|
|
1590
1444
|
selectedColor: PropTypes__default["default"].string,
|
|
1591
|
-
selectedBorder: PropTypes__default["default"].string,
|
|
1592
1445
|
selectedRadius: PropTypes__default["default"].string,
|
|
1593
1446
|
selectedMinHeight: PropTypes__default["default"].string,
|
|
1594
1447
|
selectedPadding: PropTypes__default["default"].string,
|
|
@@ -1598,7 +1451,6 @@ Select.propTypes = {
|
|
|
1598
1451
|
selectedFontWeight: PropTypes__default["default"].string,
|
|
1599
1452
|
selectedLineHeight: PropTypes__default["default"].string,
|
|
1600
1453
|
selectedTransition: PropTypes__default["default"].string,
|
|
1601
|
-
selectedBorderColor: PropTypes__default["default"].string,
|
|
1602
1454
|
optionsBoxShadow: PropTypes__default["default"].string,
|
|
1603
1455
|
optionsBorderRadius: PropTypes__default["default"].string,
|
|
1604
1456
|
optionsBackgroundColor: PropTypes__default["default"].string,
|
|
@@ -1613,7 +1465,9 @@ Select.propTypes = {
|
|
|
1613
1465
|
optionItemLineHeight: PropTypes__default["default"].string,
|
|
1614
1466
|
optionItemMarginBottom: PropTypes__default["default"].string,
|
|
1615
1467
|
optionItemBackgroudColor: PropTypes__default["default"].string,
|
|
1616
|
-
optionItemBackgroudColorHover: PropTypes__default["default"].string
|
|
1468
|
+
optionItemBackgroudColorHover: PropTypes__default["default"].string,
|
|
1469
|
+
boxShadow: PropTypes__default["default"].string,
|
|
1470
|
+
boxShadowHover: PropTypes__default["default"].string
|
|
1617
1471
|
};
|
|
1618
1472
|
|
|
1619
1473
|
const SvgToasterInfo = ({
|
|
@@ -1706,9 +1560,9 @@ const SvgToasterSuccess = ({
|
|
|
1706
1560
|
fill: "#0DA574"
|
|
1707
1561
|
}));
|
|
1708
1562
|
|
|
1709
|
-
var css_248z$
|
|
1710
|
-
var styles$
|
|
1711
|
-
styleInject(css_248z$
|
|
1563
|
+
var css_248z$8 = "#toaster-module_top-left__q0LcN{left:0;top:1em}#toaster-module_top-right__f-AFL{right:0;top:1em}#toaster-module_top-center__eVRbc{left:50%;top:1em;transform:translateX(-50%);-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%)}#toaster-module_bottom-left__b-YHI{bottom:1em;left:0}#toaster-module_bottom-right__g9ACP{bottom:1em;right:0}#toaster-module_bottom-center__4KcFe{bottom:1em;left:50%;transform:translateX(-50%);-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%)}.toaster-module_top-left__q0LcN{left:0;top:1em}.toaster-module_top-right__f-AFL{right:0;top:1em}.toaster-module_top-center__eVRbc{left:50%;top:1em;transform:translateX(-50%);-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%)}.toaster-module_bottom-left__b-YHI{bottom:1em;left:0}.toaster-module_bottom-right__g9ACP{bottom:1em;right:0}.toaster-module_bottom-center__4KcFe{bottom:1em;left:50%;transform:translateX(-50%);-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-o-transform:translateX(-50%)}.toaster-module_notify-block__pRnEB{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.toaster-module_bounce-in-right__shR2D{-webkit-animation-name:toaster-module_bounceInRight__rSk5p;animation-name:toaster-module_bounceInRight__rSk5p}.toaster-module_bounce-out-right__48pyA{-webkit-animation-name:toaster-module_bounceOutRight__bmFGS;animation-name:toaster-module_bounceOutRight__bmFGS}@keyframes toaster-module_bounceInRight__rSk5p{0%{opacity:0;right:-100%}60%{opacity:1;right:40px}75%{right:0}90%{right:30px}to{right:20px}}@keyframes toaster-module_bounceOutRight__bmFGS{0%{opacity:1;right:20px}60%{opacity:1;right:60px}to{opacity:0;right:-100%}}.toaster-module_bounce-in-left__xoF-M{-webkit-animation-name:toaster-module_bounceInLeft__to59v;animation-name:toaster-module_bounceInLeft__to59v}.toaster-module_bounce-out-left__fDOZw{-webkit-animation-name:toaster-module_bounceOutLeft__k5QgO;animation-name:toaster-module_bounceOutLeft__k5QgO}@keyframes toaster-module_bounceInLeft__to59v{0%{left:-100%;opacity:0}60%{left:40px;opacity:1}75%{left:0}90%{left:30px}to{left:20px}}@keyframes toaster-module_bounceOutLeft__k5QgO{0%{left:20px;opacity:1}60%{left:60px;opacity:1}to{left:-100%;opacity:0}}";
|
|
1564
|
+
var styles$6 = {"top-left":"toaster-module_top-left__q0LcN","top-right":"toaster-module_top-right__f-AFL","top-center":"toaster-module_top-center__eVRbc","bottom-left":"toaster-module_bottom-left__b-YHI","bottom-right":"toaster-module_bottom-right__g9ACP","bottom-center":"toaster-module_bottom-center__4KcFe","notify-block":"toaster-module_notify-block__pRnEB","bounce-in-right":"toaster-module_bounce-in-right__shR2D","bounceInRight":"toaster-module_bounceInRight__rSk5p","bounce-out-right":"toaster-module_bounce-out-right__48pyA","bounceOutRight":"toaster-module_bounceOutRight__bmFGS","bounce-in-left":"toaster-module_bounce-in-left__xoF-M","bounceInLeft":"toaster-module_bounceInLeft__to59v","bounce-out-left":"toaster-module_bounce-out-left__fDOZw","bounceOutLeft":"toaster-module_bounceOutLeft__k5QgO"};
|
|
1565
|
+
styleInject(css_248z$8);
|
|
1712
1566
|
|
|
1713
1567
|
const ToasterType = {
|
|
1714
1568
|
info: 'info',
|
|
@@ -1773,8 +1627,8 @@ const Toast = ({
|
|
|
1773
1627
|
justifyContent: 'space-between'
|
|
1774
1628
|
},
|
|
1775
1629
|
className: `
|
|
1776
|
-
${styles$
|
|
1777
|
-
${position === 'top-left' ? showToaster ? styles$
|
|
1630
|
+
${styles$6['notify-block']}
|
|
1631
|
+
${position === 'top-left' ? showToaster ? styles$6['bounce-in-left'] : styles$6['bounce-out-left'] : position === 'top-right' ? showToaster ? styles$6['bounce-in-right'] : styles$6['bounce-out-right'] : position === 'top-center' ? showToaster ? styles$6['bounce-in-left'] : styles$6['bounce-out-left'] : position === 'bottom-left' ? showToaster ? styles$6['bounce-in-left'] : styles$6['bounce-out-left'] : position === 'bottom-right' ? showToaster ? styles$6['bounce-in-right'] : styles$6['bounce-out-right'] : position === 'bottom-center' ? showToaster ? styles$6['bounce-in-left'] : styles$6['bounce-out-left'] : ''}
|
|
1778
1632
|
`
|
|
1779
1633
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1780
1634
|
style: {
|
|
@@ -1870,17 +1724,17 @@ const createToast = ({
|
|
|
1870
1724
|
description
|
|
1871
1725
|
});
|
|
1872
1726
|
ReactDOM__default["default"].render(newElem, toastBlock);
|
|
1873
|
-
if (!document.getElementById(styles$
|
|
1727
|
+
if (!document.getElementById(styles$6[position]) || document.getElementById(styles$6[position]) == null) {
|
|
1874
1728
|
toastParentBlock = document.createElement('div');
|
|
1875
1729
|
toastParentBlock.style.position = 'fixed';
|
|
1876
1730
|
toastParentBlock.style.display = 'flex';
|
|
1877
1731
|
toastParentBlock.style.zIndex = 99999;
|
|
1878
1732
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
1879
|
-
toastParentBlock.setAttribute('id', styles$
|
|
1733
|
+
toastParentBlock.setAttribute('id', styles$6[position]);
|
|
1880
1734
|
toastParentBlock.appendChild(toastBlock);
|
|
1881
1735
|
toastify.appendChild(toastParentBlock);
|
|
1882
1736
|
} else {
|
|
1883
|
-
document.getElementById(styles$
|
|
1737
|
+
document.getElementById(styles$6[position]).appendChild(toastBlock);
|
|
1884
1738
|
}
|
|
1885
1739
|
};
|
|
1886
1740
|
const toast = {
|
|
@@ -1980,9 +1834,9 @@ const SvgTooltip = ({
|
|
|
1980
1834
|
fill: "#D1D1D1"
|
|
1981
1835
|
}));
|
|
1982
1836
|
|
|
1983
|
-
var css_248z$
|
|
1984
|
-
var styles$
|
|
1985
|
-
styleInject(css_248z$
|
|
1837
|
+
var css_248z$7 = ".tooltip-module_tooltip-block__v8U9u{align-items:center;display:flex;justify-content:center;position:relative}.tooltip-module_tooltip__emM6A{padding:10px;position:absolute;z-index:1}.tooltip-module_tooltip-rel__to9gq{align-items:center;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;display:flex;height:auto;justify-content:center;min-height:10px;min-width:30px;position:relative;width:auto}.tooltip-module_tooltip-decor__qvt7t{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;height:10px;position:absolute;transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);width:10px;z-index:-1}";
|
|
1838
|
+
var styles$5 = {"tooltip-block":"tooltip-module_tooltip-block__v8U9u","tooltip":"tooltip-module_tooltip__emM6A","tooltip-rel":"tooltip-module_tooltip-rel__to9gq","tooltip-decor":"tooltip-module_tooltip-decor__qvt7t"};
|
|
1839
|
+
styleInject(css_248z$7);
|
|
1986
1840
|
|
|
1987
1841
|
const Tooltip = ({
|
|
1988
1842
|
type,
|
|
@@ -2005,7 +1859,7 @@ const Tooltip = ({
|
|
|
2005
1859
|
const [checkTooltipHeight, setCheckTooltipHeight] = React.useState(0);
|
|
2006
1860
|
const [showTooltip, setShowTooltip] = React.useState(false);
|
|
2007
1861
|
const configStyles = compereConfigs();
|
|
2008
|
-
const classProps = classnames__default["default"](styles$
|
|
1862
|
+
const classProps = classnames__default["default"](styles$5['tooltip'], className);
|
|
2009
1863
|
const handleShow = () => {
|
|
2010
1864
|
setShowTooltip(!showTooltip);
|
|
2011
1865
|
};
|
|
@@ -2017,7 +1871,7 @@ const Tooltip = ({
|
|
|
2017
1871
|
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setCheckTooltipHeight(tooltipRef.current.clientHeight);
|
|
2018
1872
|
}, [text, tooltipRef, checkTooltipWidth, checkTooltipHeight]);
|
|
2019
1873
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2020
|
-
className: `${styles$
|
|
1874
|
+
className: `${styles$5['tooltip-block']}`,
|
|
2021
1875
|
style: {
|
|
2022
1876
|
width: width ? width : configStyles.TOOLTIP.width,
|
|
2023
1877
|
height: height ? height : configStyles.TOOLTIP.height,
|
|
@@ -2035,9 +1889,9 @@ const Tooltip = ({
|
|
|
2035
1889
|
left: type === 'top' || type === 'bottom' ? `calc(50% - ${checkTooltipWidth / 2}px)` : type === 'left' ? `-${checkTooltipWidth + 7}px` : type === 'right' ? 'calc(100% + 7px)' : '0px'
|
|
2036
1890
|
}
|
|
2037
1891
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2038
|
-
className: `${styles$
|
|
1892
|
+
className: `${styles$5['tooltip-rel']}`
|
|
2039
1893
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2040
|
-
className: `${styles$
|
|
1894
|
+
className: `${styles$5['tooltip-decor']}`,
|
|
2041
1895
|
style: {
|
|
2042
1896
|
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
2043
1897
|
left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
|
|
@@ -2112,9 +1966,9 @@ const SvgCaptchaArrowDown = ({
|
|
|
2112
1966
|
fill: "#00236A"
|
|
2113
1967
|
}));
|
|
2114
1968
|
|
|
2115
|
-
var css_248z$
|
|
2116
|
-
var styles$
|
|
2117
|
-
styleInject(css_248z$
|
|
1969
|
+
var css_248z$6 = ".captcha-module_start-point__LkOqy:after{background-color:#d1d1d1;border:2px solid #fff;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;content:\"\";height:10px;left:0;position:absolute;top:7.5px;width:10px;z-index:-1}.captcha-module_range__k24I2{-webkit-appearance:none;margin:0}.captcha-module_range__k24I2::-webkit-slider-runnable-track{-webkit-appearance:none;width:100%}.captcha-module_range-default__-O0QD::-webkit-slider-thumb{background-image:url(../../assets/range-arrow-default.svg)}.captcha-module_range-default__-O0QD::-webkit-slider-thumb,.captcha-module_range-error__FKMfG::-webkit-slider-thumb{-webkit-appearance:none;background-position:-5px;background-repeat:no-repeat;background-size:46px 46px;border-radius:17px;-webkit-border-radius:17px;-moz-border-radius:17px;-ms-border-radius:17px;-o-border-radius:17px;cursor:ew-resize;height:34px;width:34px}.captcha-module_range-error__FKMfG::-webkit-slider-thumb{background-image:url(../../assets/range-arrow-error.svg)}.captcha-module_range-success__VzLPq::-webkit-slider-thumb{-webkit-appearance:none;background-image:url(../../assets/range-arrow-success.svg);background-position:-5px;background-repeat:no-repeat;background-size:46px 46px;border-radius:17px;-webkit-border-radius:17px;-moz-border-radius:17px;-ms-border-radius:17px;-o-border-radius:17px;cursor:ew-resize;height:34px;width:34px}";
|
|
1970
|
+
var styles$4 = {"start-point":"captcha-module_start-point__LkOqy","range":"captcha-module_range__k24I2","range-default":"captcha-module_range-default__-O0QD","range-error":"captcha-module_range-error__FKMfG","range-success":"captcha-module_range-success__VzLPq"};
|
|
1971
|
+
styleInject(css_248z$6);
|
|
2118
1972
|
|
|
2119
1973
|
const Captcha = ({
|
|
2120
1974
|
size,
|
|
@@ -2177,7 +2031,7 @@ const Captcha = ({
|
|
|
2177
2031
|
alignItems: 'center',
|
|
2178
2032
|
zIndex: 1
|
|
2179
2033
|
},
|
|
2180
|
-
className: styles$
|
|
2034
|
+
className: styles$4['start-point']
|
|
2181
2035
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2182
2036
|
style: {
|
|
2183
2037
|
position: 'absolute',
|
|
@@ -2204,8 +2058,8 @@ const Captcha = ({
|
|
|
2204
2058
|
backgroundColor: 'transparent'
|
|
2205
2059
|
},
|
|
2206
2060
|
className: `
|
|
2207
|
-
${styles$
|
|
2208
|
-
${+rangeProgress === rangeNumber ? styles$
|
|
2061
|
+
${styles$4['range']}
|
|
2062
|
+
${+rangeProgress === rangeNumber ? styles$4['range-success'] : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? styles$4['range-error'] : styles$4['range-default']}
|
|
2209
2063
|
`,
|
|
2210
2064
|
onInput: handleRange
|
|
2211
2065
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2236,9 +2090,9 @@ Captcha.propTypes = {
|
|
|
2236
2090
|
getRange: PropTypes__default["default"].func.isRequired
|
|
2237
2091
|
};
|
|
2238
2092
|
|
|
2239
|
-
var css_248z$
|
|
2240
|
-
var styles$
|
|
2241
|
-
styleInject(css_248z$
|
|
2093
|
+
var css_248z$5 = ".stepper-module_stepper-container__-OVGy>div:last-child:before{display:none}.stepper-module_activeRing__Lzvh1,.stepper-module_bigRing__5GBm0{border-radius:50%;cursor:pointer;height:36px;margin-bottom:36px;position:relative;width:36px}.stepper-module_bigRing__5GBm0{box-shadow:0 0 0 2px #d1d1d1}.stepper-module_bigRing__5GBm0:before{background:#d1d1d1}.stepper-module_activeRing__Lzvh1{box-shadow:0 0 0 2px #00236a}.stepper-module_activeRing__Lzvh1:before{background:#00236a}.stepper-module_activeRing__Lzvh1:before,.stepper-module_bigRing__5GBm0:before{border-radius:20px;bottom:-32px;content:\"\";height:28px;left:0;margin:auto;overflow:hidden;position:absolute;right:0;width:2px}.stepper-module_smallActiveRing__im-XG,.stepper-module_smallRing__u-5a8{border-radius:50%;bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.stepper-module_smallRing__u-5a8{background-color:#d1d1d1;height:14px;width:14px}.stepper-module_smallActiveRing__im-XG{align-items:center;background-color:#00236a;color:#fff;display:flex;height:28px;justify-content:center;width:28px}";
|
|
2094
|
+
var styles$3 = {"stepper-container":"stepper-module_stepper-container__-OVGy","bigRing":"stepper-module_bigRing__5GBm0","activeRing":"stepper-module_activeRing__Lzvh1","smallRing":"stepper-module_smallRing__u-5a8","smallActiveRing":"stepper-module_smallActiveRing__im-XG"};
|
|
2095
|
+
styleInject(css_248z$5);
|
|
2242
2096
|
|
|
2243
2097
|
const Stepper = ({
|
|
2244
2098
|
className,
|
|
@@ -2248,15 +2102,15 @@ const Stepper = ({
|
|
|
2248
2102
|
}) => {
|
|
2249
2103
|
classnames__default["default"](className, 'stepper-inner-rem');
|
|
2250
2104
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2251
|
-
className: `${styles$
|
|
2105
|
+
className: `${styles$3['stepper-container']} stepper-container-rem`
|
|
2252
2106
|
}, (() => {
|
|
2253
2107
|
let steppers = [];
|
|
2254
2108
|
for (let step = 1; step <= stepLength; step++) {
|
|
2255
2109
|
steppers.push( /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2256
|
-
className: classnames__default["default"](`${step <= activeSteps ? styles$
|
|
2110
|
+
className: classnames__default["default"](`${step <= activeSteps ? styles$3.activeRing : styles$3.bigRing}`),
|
|
2257
2111
|
key: step
|
|
2258
2112
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2259
|
-
className: classnames__default["default"](`${step <= activeSteps ? styles$
|
|
2113
|
+
className: classnames__default["default"](`${step <= activeSteps ? styles$3.smallActiveRing : styles$3.smallRing}`)
|
|
2260
2114
|
}, step <= activeSteps ? step : "")));
|
|
2261
2115
|
}
|
|
2262
2116
|
return steppers;
|
|
@@ -2735,7 +2589,7 @@ const NewFile = ({
|
|
|
2735
2589
|
};
|
|
2736
2590
|
const handleRemoveFile = () => {
|
|
2737
2591
|
setImage(null);
|
|
2738
|
-
removeFile(singleFile);
|
|
2592
|
+
removeFile && removeFile(singleFile);
|
|
2739
2593
|
};
|
|
2740
2594
|
const handleChange = e => {
|
|
2741
2595
|
const file = e.target.files;
|
|
@@ -2843,7 +2697,10 @@ const NewFile = ({
|
|
|
2843
2697
|
if (multiple) {
|
|
2844
2698
|
setSingleFile(null);
|
|
2845
2699
|
}
|
|
2846
|
-
|
|
2700
|
+
if (multiple && !removeFile) {
|
|
2701
|
+
alert('Please add removeFile prop on NewFile component, it is a require in multiple mode');
|
|
2702
|
+
}
|
|
2703
|
+
}, [multiple, removeFile, filesArray && filesArray.length, defaultData]);
|
|
2847
2704
|
React.useEffect(() => {
|
|
2848
2705
|
if (errorMessage) {
|
|
2849
2706
|
setError(errorMessage);
|
|
@@ -2855,10 +2712,7 @@ const NewFile = ({
|
|
|
2855
2712
|
if (!change) {
|
|
2856
2713
|
alert('Please add change prop on File component');
|
|
2857
2714
|
}
|
|
2858
|
-
|
|
2859
|
-
alert('Please add removeFile prop on File component');
|
|
2860
|
-
}
|
|
2861
|
-
}, [change, removeFile]);
|
|
2715
|
+
}, [change]);
|
|
2862
2716
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2863
2717
|
ref: ref,
|
|
2864
2718
|
style: {
|
|
@@ -2991,7 +2845,7 @@ const NewFile = ({
|
|
|
2991
2845
|
status: item.status,
|
|
2992
2846
|
size: item.file.size,
|
|
2993
2847
|
name: item.file.name,
|
|
2994
|
-
removeFile: removeFile,
|
|
2848
|
+
removeFile: removeFile ? removeFile : _ => _,
|
|
2995
2849
|
radius: radius ? radius : configStyles.File.radius,
|
|
2996
2850
|
fileFormat: item.file.type.split('/')[1].toLowerCase(),
|
|
2997
2851
|
progressColor: progressColor ? progressColor : configStyles.File.progressColor,
|
|
@@ -3023,6 +2877,7 @@ NewFile.propTypes = {
|
|
|
3023
2877
|
upload: PropTypes__default["default"].string,
|
|
3024
2878
|
weight: PropTypes__default["default"].number,
|
|
3025
2879
|
maxSize: PropTypes__default["default"].number,
|
|
2880
|
+
removeFile: PropTypes__default["default"].func,
|
|
3026
2881
|
errorSize: PropTypes__default["default"].string,
|
|
3027
2882
|
labelSize: PropTypes__default["default"].string,
|
|
3028
2883
|
labelColor: PropTypes__default["default"].string,
|
|
@@ -3049,7 +2904,6 @@ NewFile.propTypes = {
|
|
|
3049
2904
|
progressTrackColor: PropTypes__default["default"].string,
|
|
3050
2905
|
fileAreaImageWidth: PropTypes__default["default"].string,
|
|
3051
2906
|
listItemErrorColor: PropTypes__default["default"].string,
|
|
3052
|
-
removeFile: PropTypes__default["default"].func.isRequired,
|
|
3053
2907
|
fileAreaImageHeight: PropTypes__default["default"].string,
|
|
3054
2908
|
progressFailedColor: PropTypes__default["default"].string,
|
|
3055
2909
|
progressSuccessColor: PropTypes__default["default"].string,
|
|
@@ -3062,10 +2916,98 @@ NewFile.propTypes = {
|
|
|
3062
2916
|
fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
|
3063
2917
|
};
|
|
3064
2918
|
NewFile.defaultProps = {
|
|
3065
|
-
maxSize:
|
|
2919
|
+
maxSize: 10,
|
|
3066
2920
|
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
3067
2921
|
};
|
|
3068
2922
|
|
|
2923
|
+
var css_248z$4 = ".checkbox-module_checkbox-wrap__Xrg-m{align-items:center;cursor:pointer;display:inline-flex;flex-direction:row;flex-wrap:nowrap;margin:0 6px;padding-left:24px;position:relative}.checkbox-module_checkbox-wrap__Xrg-m>input{height:0;opacity:0;position:absolute;width:0}.checkbox-module_checkbox-wrap__Xrg-m .checkbox-module_checkmark__M8DY6{border:1px solid #d9d9d9;border-radius:3px;bottom:0;display:inline-block;height:14px;left:0;margin:auto 4px auto auto;position:absolute;top:0;transition:border-color .24s;vertical-align:top;width:14px}.checkbox-module_checkbox-wrap__Xrg-m>.checkbox-module_checkmark__M8DY6:after{border:solid #1890ff;border-width:0 2px 2px 0;content:\"\";display:block;height:8px;left:4px;opacity:0;position:absolute;top:1px;transform:rotate(45deg);transition:opacity .24s;width:4px}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6:after{opacity:1}.checkbox-module_checkbox-wrap__Xrg-m input:checked~.checkbox-module_checkmark__M8DY6,.checkbox-module_checkbox-wrap__Xrg-m:hover input~.checkbox-module_checkmark__M8DY6{border-color:#1890ff}";
|
|
2924
|
+
var styles$2 = {"checkbox-wrap":"checkbox-module_checkbox-wrap__Xrg-m","checkmark":"checkbox-module_checkmark__M8DY6"};
|
|
2925
|
+
styleInject(css_248z$4);
|
|
2926
|
+
|
|
2927
|
+
const Checkbox = ({
|
|
2928
|
+
disabled,
|
|
2929
|
+
required,
|
|
2930
|
+
className,
|
|
2931
|
+
name,
|
|
2932
|
+
value,
|
|
2933
|
+
jsonData,
|
|
2934
|
+
onChange,
|
|
2935
|
+
label,
|
|
2936
|
+
keyNames,
|
|
2937
|
+
onClick,
|
|
2938
|
+
...props
|
|
2939
|
+
}) => {
|
|
2940
|
+
const classProps = classnames__default["default"](styles$2.checkbox, className, 'checkbox-input-rem');
|
|
2941
|
+
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
2942
|
+
const [data, setData] = React.useState(parseData);
|
|
2943
|
+
React.useEffect(() => {
|
|
2944
|
+
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
2945
|
+
setData(parseData);
|
|
2946
|
+
}, [jsonData]);
|
|
2947
|
+
React.useEffect(() => {
|
|
2948
|
+
onChange ? onChange(data.filter(d => d.checked)) : '';
|
|
2949
|
+
}, [data]);
|
|
2950
|
+
const handleChange = e => {
|
|
2951
|
+
let id;
|
|
2952
|
+
data.forEach((value, key) => {
|
|
2953
|
+
if (value[keyNames.value] === e.target.value) {
|
|
2954
|
+
id = key;
|
|
2955
|
+
}
|
|
2956
|
+
});
|
|
2957
|
+
let items = [...data];
|
|
2958
|
+
let item = {
|
|
2959
|
+
...items[id]
|
|
2960
|
+
};
|
|
2961
|
+
item.checked = !item.checked;
|
|
2962
|
+
items[id] = item;
|
|
2963
|
+
setData(items);
|
|
2964
|
+
};
|
|
2965
|
+
!keyNames ? keyNames = {
|
|
2966
|
+
id: 'id',
|
|
2967
|
+
name: 'name',
|
|
2968
|
+
value: 'value',
|
|
2969
|
+
label: 'label'
|
|
2970
|
+
} : '';
|
|
2971
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, data.map(element => {
|
|
2972
|
+
return /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2973
|
+
className: `${styles$2["checkbox-wrap"]} checkbox-wrap-rem`,
|
|
2974
|
+
key: element.value
|
|
2975
|
+
}, /*#__PURE__*/React__default["default"].createElement("input", _extends({
|
|
2976
|
+
type: "checkbox",
|
|
2977
|
+
className: classProps,
|
|
2978
|
+
disabled: disabled,
|
|
2979
|
+
required: required,
|
|
2980
|
+
value: keyNames.value ? element[keyNames.value] : '',
|
|
2981
|
+
name: keyNames.name ? element[keyNames.name] : '',
|
|
2982
|
+
id: keyNames.id ? element[keyNames.id] : '',
|
|
2983
|
+
onChange: handleChange,
|
|
2984
|
+
onClick: onClick ? onClick : () => {},
|
|
2985
|
+
defaultChecked: element.checked
|
|
2986
|
+
}, props)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2987
|
+
className: `${styles$2["checkmark"]} checkmark-rem`
|
|
2988
|
+
}), element[keyNames.label] ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2989
|
+
className: styles$2.labelCheckbox,
|
|
2990
|
+
for: element[keyNames.id]
|
|
2991
|
+
}, element[keyNames.label]) : "");
|
|
2992
|
+
}));
|
|
2993
|
+
};
|
|
2994
|
+
Checkbox.propTypes = {
|
|
2995
|
+
className: PropTypes__default["default"].string,
|
|
2996
|
+
onChange: PropTypes__default["default"].func,
|
|
2997
|
+
onClick: PropTypes__default["default"].func,
|
|
2998
|
+
required: PropTypes__default["default"].bool,
|
|
2999
|
+
disabled: PropTypes__default["default"].bool,
|
|
3000
|
+
name: PropTypes__default["default"].string,
|
|
3001
|
+
value: PropTypes__default["default"].string,
|
|
3002
|
+
jsonData: PropTypes__default["default"].string,
|
|
3003
|
+
label: PropTypes__default["default"].string,
|
|
3004
|
+
keyNames: PropTypes__default["default"].object
|
|
3005
|
+
};
|
|
3006
|
+
Checkbox.defaultProps = {
|
|
3007
|
+
onChange: undefined,
|
|
3008
|
+
jsonData: '[{"value":"email", "name":"contact1", "label":"Email", "id":"contactChoice1"}, {"value":"phone", "name":"contact2", "label":"Phone", "id":"contactChoice2"}]'
|
|
3009
|
+
};
|
|
3010
|
+
|
|
3069
3011
|
var css_248z$3 = "textarea::-webkit-scrollbar{width:6px}textarea::-webkit-scrollbar-track{background:#eee}textarea::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-track{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px}textarea::-webkit-scrollbar-thumb{background:#d1d1d1}";
|
|
3070
3012
|
styleInject(css_248z$3);
|
|
3071
3013
|
|
|
@@ -3776,7 +3718,6 @@ const NewAutocomplete = ({
|
|
|
3776
3718
|
contentTopDirection,
|
|
3777
3719
|
contentTopBoxSizing,
|
|
3778
3720
|
contentTopLineHeight,
|
|
3779
|
-
contentTopBorderColor,
|
|
3780
3721
|
contentBottomMaxWidth,
|
|
3781
3722
|
contentBottomOverflow,
|
|
3782
3723
|
contentBottomPosition,
|
|
@@ -3795,8 +3736,8 @@ const NewAutocomplete = ({
|
|
|
3795
3736
|
contentBottomRowAlignItems,
|
|
3796
3737
|
contentBottomRowTransition,
|
|
3797
3738
|
contentBottomRowHoverColor,
|
|
3798
|
-
|
|
3799
|
-
|
|
3739
|
+
contentTopBorderHover,
|
|
3740
|
+
contentTopBorderActive,
|
|
3800
3741
|
contentBottomInnerOverflowY,
|
|
3801
3742
|
contentBottomInnerOverflowX,
|
|
3802
3743
|
contentBottomInnerMaxHeight,
|
|
@@ -3973,13 +3914,14 @@ const NewAutocomplete = ({
|
|
|
3973
3914
|
placeholder: placeHolder ? placeHolder : '',
|
|
3974
3915
|
autoComplete: autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete,
|
|
3975
3916
|
style: {
|
|
3917
|
+
border: 'none',
|
|
3918
|
+
outline: 'none',
|
|
3976
3919
|
maxWidth: '100%',
|
|
3977
3920
|
transition: 'all 240ms',
|
|
3978
3921
|
cursor: disabled ? 'not-allowed' : 'auto',
|
|
3979
3922
|
color: contentTopColor ? contentTopColor : configStyles.NEWAUTOCOMPLETE.contentTopColor,
|
|
3980
3923
|
fontSize: contentTopSize ? contentTopSize : configStyles.NEWAUTOCOMPLETE.contentTopSize,
|
|
3981
3924
|
height: contentTopHeight ? contentTopHeight : configStyles.NEWAUTOCOMPLETE.contentTopHeight,
|
|
3982
|
-
border: contentTopBorder ? contentTopBorder : configStyles.NEWAUTOCOMPLETE.contentTopBorder,
|
|
3983
3925
|
padding: contentTopPadding ? contentTopPadding : configStyles.NEWAUTOCOMPLETE.contentTopPadding,
|
|
3984
3926
|
display: contentTopDisplay ? contentTopDisplay : configStyles.NEWAUTOCOMPLETE.contentTopDisplay,
|
|
3985
3927
|
fontWeight: contentTopWeight ? contentTopWeight : configStyles.NEWAUTOCOMPLETE.contentTopWeight,
|
|
@@ -3987,7 +3929,7 @@ const NewAutocomplete = ({
|
|
|
3987
3929
|
boxSizing: contentTopBoxSizing ? contentTopBoxSizing : configStyles.NEWAUTOCOMPLETE.contentTopBoxSizing,
|
|
3988
3930
|
lineHeight: contentTopLineHeight ? contentTopLineHeight : configStyles.NEWAUTOCOMPLETE.contentTopLineHeight,
|
|
3989
3931
|
flexDirection: contentTopDirection ? contentTopDirection : configStyles.NEWAUTOCOMPLETE.contentTopDirection,
|
|
3990
|
-
|
|
3932
|
+
boxShadow: errorMessage ? errorColor ? `0 0 0 2px ${errorColor}` : `0 0 0 2px ${configStyles.NEWAUTOCOMPLETE.errorColor}` : isFocus ? contentTopBorderActive ? contentTopBorderActive : configStyles.NEWAUTOCOMPLETE.contentTopBorderActive : isHover ? contentTopBorderHover ? contentTopBorderHover : configStyles.NEWAUTOCOMPLETE.contentTopBorderHover : contentTopBorder ? contentTopBorder : configStyles.NEWAUTOCOMPLETE.contentTopBorder
|
|
3991
3933
|
}
|
|
3992
3934
|
}, props)), errorMessage ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3993
3935
|
style: {
|
|
@@ -4041,7 +3983,7 @@ NewAutocomplete.propTypes = {
|
|
|
4041
3983
|
contentBottomZindex: PropTypes__default["default"].number,
|
|
4042
3984
|
contentBottomRadius: PropTypes__default["default"].string,
|
|
4043
3985
|
contentTopLineHeight: PropTypes__default["default"].string,
|
|
4044
|
-
|
|
3986
|
+
contentTopBorderHover: PropTypes__default["default"].string,
|
|
4045
3987
|
contentBottomRowColor: PropTypes__default["default"].string,
|
|
4046
3988
|
contentBottomMaxWidth: PropTypes__default["default"].string,
|
|
4047
3989
|
contentBottomOverflow: PropTypes__default["default"].string,
|
|
@@ -4050,6 +3992,7 @@ NewAutocomplete.propTypes = {
|
|
|
4050
3992
|
contentBottomBoxShadow: PropTypes__default["default"].string,
|
|
4051
3993
|
contentBottomRowHeight: PropTypes__default["default"].string,
|
|
4052
3994
|
contentBottomRowCursor: PropTypes__default["default"].string,
|
|
3995
|
+
contentTopBorderActive: PropTypes__default["default"].string,
|
|
4053
3996
|
contentBottomRowDisplay: PropTypes__default["default"].string,
|
|
4054
3997
|
contentBottomRowPadding: PropTypes__default["default"].string,
|
|
4055
3998
|
contentBottomRowFontSize: PropTypes__default["default"].string,
|
|
@@ -4060,8 +4003,6 @@ NewAutocomplete.propTypes = {
|
|
|
4060
4003
|
contentBottomRowAlignItems: PropTypes__default["default"].string,
|
|
4061
4004
|
contentBottomRowTransition: PropTypes__default["default"].string,
|
|
4062
4005
|
contentBottomRowHoverColor: PropTypes__default["default"].string,
|
|
4063
|
-
contentTopBorderHoverColor: PropTypes__default["default"].string,
|
|
4064
|
-
contentTopBorderActiveColor: PropTypes__default["default"].string,
|
|
4065
4006
|
contentBottomInnerOverflowY: PropTypes__default["default"].string,
|
|
4066
4007
|
contentBottomInnerOverflowX: PropTypes__default["default"].string,
|
|
4067
4008
|
contentBottomInnerMaxHeight: PropTypes__default["default"].string,
|
|
@@ -4091,7 +4032,6 @@ exports.Radio = Radio;
|
|
|
4091
4032
|
exports.Select = Select;
|
|
4092
4033
|
exports.SingleCheckbox = SingleCheckbox;
|
|
4093
4034
|
exports.Stepper = Stepper;
|
|
4094
|
-
exports.Table = Table;
|
|
4095
4035
|
exports.Textarea = Textarea;
|
|
4096
4036
|
exports.Toaster = Toaster;
|
|
4097
4037
|
exports.Tooltip = Tooltip;
|