@xaypay/tui 0.0.74 → 0.0.75
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 +213 -107
- package/dist/index.js +213 -107
- package/package.json +1 -1
- package/src/components/icon/CloseSlide.js +19 -0
- package/src/components/icon/Next.js +21 -0
- package/src/components/icon/Prev.js +21 -0
- package/src/components/modal/index.js +173 -111
- package/src/components/modal/modal.module.css +14 -65
- package/src/components/modal/modal.stories.js +6 -2
- package/src/stories/configuration.stories.mdx +16 -0
- package/src/stories/static/modal-usage.png +0 -0
- package/src/stories/usage.stories.mdx +5 -1
- package/tui.config.js +13 -0
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$e = ".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$c = {"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$e);
|
|
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$c['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$c['file-form-wrap']} file-form-wrap-rem`, image ? styles$c['active'] : '')
|
|
169
169
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
170
|
-
className: `${styles$
|
|
170
|
+
className: `${styles$c['file-form']} file-form-rem ${error || errorMessage ? styles$c['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$c['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$c['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$c['upload-info']} upload-info-rem`
|
|
190
190
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
191
|
-
className: `${styles$
|
|
191
|
+
className: `${styles$c['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$c['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$c['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,13 +219,13 @@ File.defaultProps = {
|
|
|
219
219
|
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
var css_248z$
|
|
223
|
-
var styles$
|
|
224
|
-
styleInject(css_248z$
|
|
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
225
|
|
|
226
|
-
var css_248z$
|
|
227
|
-
var styles$
|
|
228
|
-
styleInject(css_248z$
|
|
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
229
|
|
|
230
230
|
const Checkbox = ({
|
|
231
231
|
disabled,
|
|
@@ -240,7 +240,7 @@ const Checkbox = ({
|
|
|
240
240
|
onClick,
|
|
241
241
|
...props
|
|
242
242
|
}) => {
|
|
243
|
-
const classProps = classnames__default["default"](styles$
|
|
243
|
+
const classProps = classnames__default["default"](styles$a.checkbox, className, 'checkbox-input-rem');
|
|
244
244
|
const parseData = jsonData.length !== 0 ? JSON.parse(jsonData) : [];
|
|
245
245
|
const [data, setData] = React.useState(parseData);
|
|
246
246
|
React.useEffect(() => {
|
|
@@ -273,7 +273,7 @@ const Checkbox = ({
|
|
|
273
273
|
} : '';
|
|
274
274
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, data.map(element => {
|
|
275
275
|
return /*#__PURE__*/React__default["default"].createElement("label", {
|
|
276
|
-
className: `${styles$
|
|
276
|
+
className: `${styles$a["checkbox-wrap"]} checkbox-wrap-rem`,
|
|
277
277
|
key: element.value
|
|
278
278
|
}, /*#__PURE__*/React__default["default"].createElement("input", _extends({
|
|
279
279
|
type: "checkbox",
|
|
@@ -287,9 +287,9 @@ const Checkbox = ({
|
|
|
287
287
|
onClick: onClick ? onClick : () => {},
|
|
288
288
|
defaultChecked: element.checked
|
|
289
289
|
}, props)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
290
|
-
className: `${styles$
|
|
290
|
+
className: `${styles$a["checkmark"]} checkmark-rem`
|
|
291
291
|
}), element[keyNames.label] ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
292
|
-
className: styles$
|
|
292
|
+
className: styles$a.labelCheckbox,
|
|
293
293
|
for: element[keyNames.id]
|
|
294
294
|
}, element[keyNames.label]) : "");
|
|
295
295
|
}));
|
|
@@ -331,23 +331,23 @@ const Table = ({
|
|
|
331
331
|
return true;
|
|
332
332
|
} : "";
|
|
333
333
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
334
|
-
className: `${styles$
|
|
334
|
+
className: `${styles$b["table-wrap"]} table-wrap-rem`
|
|
335
335
|
}, config.isHeader && hearderData.map((header, key) => {
|
|
336
336
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
337
|
-
className: `${styles$
|
|
337
|
+
className: `${styles$b["table-top"]} table-top-rem`,
|
|
338
338
|
key: key
|
|
339
339
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
340
|
-
className: `${styles$
|
|
340
|
+
className: `${styles$b["table-items"]} table-items-rem`
|
|
341
341
|
}, header));
|
|
342
342
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
343
|
-
className: `${styles$
|
|
343
|
+
className: `${styles$b["table-bottom"]} table-bottom-rem`
|
|
344
344
|
}, tbodyData.map((item, key) => {
|
|
345
345
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
346
|
-
className: `${styles$
|
|
346
|
+
className: `${styles$b["table-bottom-inner"]} table-bottom-inner-rem`,
|
|
347
347
|
key: key
|
|
348
348
|
}, keyNames.map((keyName, keyNameKey) => {
|
|
349
349
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
350
|
-
className: `${styles$
|
|
350
|
+
className: `${styles$b["table-items"]} table-items-rem`,
|
|
351
351
|
key: keyNameKey
|
|
352
352
|
}, config.isCheckbox && config.isCheckbox.showCheckbox && config.isCheckbox.showCheckbox(item) && keyNameKey == 0 && /*#__PURE__*/React__default["default"].createElement(Checkbox, {
|
|
353
353
|
onClick: e => {
|
|
@@ -363,7 +363,7 @@ const Table = ({
|
|
|
363
363
|
className: keyName.icon
|
|
364
364
|
}), item[keyName.name]));
|
|
365
365
|
}), actions && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
366
|
-
className: `${styles$
|
|
366
|
+
className: `${styles$b["table-items"]} table-items-rem`
|
|
367
367
|
}, actions.filter(a => a.show && a.show(item) || a.show === undefined).map((action, key) => {
|
|
368
368
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
369
369
|
key: key
|
|
@@ -399,6 +399,73 @@ Table.defaultProps = {
|
|
|
399
399
|
hearderData: []
|
|
400
400
|
};
|
|
401
401
|
|
|
402
|
+
const _ = require('lodash');
|
|
403
|
+
const compereConfigs = () => {
|
|
404
|
+
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
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
projectConfig = require('../../../../tui.config.js');
|
|
417
|
+
} catch (error) {
|
|
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
|
+
|
|
422
|
+
return _.merge(packageConfig, projectConfig);
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
var css_248z$b = ".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)}}";
|
|
426
|
+
var styles$9 = {"animation__modal":"modal-module_animation__modal__3mt48","show-popup":"modal-module_show-popup__WrH7a"};
|
|
427
|
+
styleInject(css_248z$b);
|
|
428
|
+
|
|
429
|
+
const SvgNext = ({
|
|
430
|
+
title,
|
|
431
|
+
titleId,
|
|
432
|
+
...props
|
|
433
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
434
|
+
width: "24",
|
|
435
|
+
height: "24",
|
|
436
|
+
viewBox: "0 0 24 24",
|
|
437
|
+
fill: "none",
|
|
438
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
439
|
+
"aria-labelledby": titleId
|
|
440
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
441
|
+
id: titleId
|
|
442
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
443
|
+
fillRule: "evenodd",
|
|
444
|
+
clipRule: "evenodd",
|
|
445
|
+
d: "M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12Zm3.4-11.443a.854.854 0 0 0 .198-.548.855.855 0 0 0-.146-.539l-4.137-5.134a.857.857 0 0 0-1.251-.12.856.856 0 0 0-.129 1.207l3.701 4.586-3.838 4.587a.856.856 0 0 0 .739 1.4.858.858 0 0 0 .58-.305l4.284-5.134Z",
|
|
446
|
+
fill: "#fff"
|
|
447
|
+
}));
|
|
448
|
+
|
|
449
|
+
const SvgPrev = ({
|
|
450
|
+
title,
|
|
451
|
+
titleId,
|
|
452
|
+
...props
|
|
453
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
454
|
+
width: "24",
|
|
455
|
+
height: "24",
|
|
456
|
+
viewBox: "0 0 24 24",
|
|
457
|
+
fill: "none",
|
|
458
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
459
|
+
"aria-labelledby": titleId
|
|
460
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
461
|
+
id: titleId
|
|
462
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
463
|
+
fillRule: "evenodd",
|
|
464
|
+
clipRule: "evenodd",
|
|
465
|
+
d: "M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0ZM8.6 11.443a.855.855 0 0 0-.198.548c-.013.19.038.38.146.539l4.137 5.133a.857.857 0 0 0 1.251.12.856.856 0 0 0 .129-1.206l-3.701-4.586 3.838-4.587a.856.856 0 0 0-.739-1.4.858.858 0 0 0-.58.305l-4.284 5.134Z",
|
|
466
|
+
fill: "#fff"
|
|
467
|
+
}));
|
|
468
|
+
|
|
402
469
|
const SvgCloseIcon = ({
|
|
403
470
|
title,
|
|
404
471
|
titleId,
|
|
@@ -417,36 +484,49 @@ const SvgCloseIcon = ({
|
|
|
417
484
|
fill: "#3C393E"
|
|
418
485
|
}));
|
|
419
486
|
|
|
420
|
-
const
|
|
487
|
+
const SvgCloseSlide = ({
|
|
421
488
|
title,
|
|
422
489
|
titleId,
|
|
423
490
|
...props
|
|
424
491
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
425
|
-
width: "
|
|
426
|
-
height: "
|
|
427
|
-
viewBox: "0 0
|
|
492
|
+
width: "18",
|
|
493
|
+
height: "18",
|
|
494
|
+
viewBox: "0 0 18 18",
|
|
428
495
|
fill: "none",
|
|
429
496
|
xmlns: "http://www.w3.org/2000/svg",
|
|
430
497
|
"aria-labelledby": titleId
|
|
431
498
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
432
499
|
id: titleId
|
|
433
500
|
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
434
|
-
d: "
|
|
435
|
-
fill: "#
|
|
501
|
+
d: "m10.47 8.95 7.29-7.29A1 1 0 0 0 16.35.25L9.06 7.54 1.77.24A1 1 0 0 0 .36 1.65l7.29 7.3-7.3 7.29a.999.999 0 1 0 1.41 1.41l7.3-7.29 7.29 7.29a1 1 0 0 0 1.41-1.41l-7.29-7.29Z",
|
|
502
|
+
fill: "#fff"
|
|
436
503
|
}));
|
|
437
504
|
|
|
438
505
|
const Modal = ({
|
|
439
506
|
type,
|
|
440
507
|
data,
|
|
508
|
+
radius,
|
|
509
|
+
padding,
|
|
441
510
|
setShow,
|
|
442
511
|
selected,
|
|
443
512
|
children,
|
|
513
|
+
minWidth,
|
|
514
|
+
minHeight,
|
|
444
515
|
className,
|
|
445
|
-
headerText
|
|
516
|
+
headerText,
|
|
517
|
+
imageWidth,
|
|
518
|
+
headerSize,
|
|
519
|
+
imageHeight,
|
|
520
|
+
headerColor,
|
|
521
|
+
headerWeight,
|
|
522
|
+
headerHeight,
|
|
523
|
+
backgroundColor,
|
|
524
|
+
layerBackgroundColor
|
|
446
525
|
}) => {
|
|
447
|
-
const classProps = classnames__default["default"](className);
|
|
448
526
|
const [select, setSelect] = React.useState(0);
|
|
449
527
|
const [innerData, setInnerData] = React.useState([]);
|
|
528
|
+
const configStyles = compereConfigs();
|
|
529
|
+
const classProps = classnames__default["default"](className);
|
|
450
530
|
const handleCloseModal = () => {
|
|
451
531
|
setShow(false);
|
|
452
532
|
};
|
|
@@ -502,13 +582,13 @@ const Modal = ({
|
|
|
502
582
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
503
583
|
onClick: handleCloseModal,
|
|
504
584
|
style: {
|
|
505
|
-
position: 'fixed',
|
|
506
585
|
top: '0px',
|
|
507
586
|
left: '0px',
|
|
508
587
|
zIndex: 999,
|
|
509
588
|
width: '100%',
|
|
510
589
|
height: '100vh',
|
|
511
|
-
|
|
590
|
+
position: 'fixed',
|
|
591
|
+
backgroundColor: layerBackgroundColor ? layerBackgroundColor : configStyles.MODAL.layerBackgroundColor
|
|
512
592
|
}
|
|
513
593
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
514
594
|
style: {
|
|
@@ -517,10 +597,9 @@ const Modal = ({
|
|
|
517
597
|
height: '100vh'
|
|
518
598
|
}
|
|
519
599
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
520
|
-
className: classProps
|
|
600
|
+
className: `${classProps} ${styles$9['animation__modal']}`,
|
|
521
601
|
onClick: handleStopClosing,
|
|
522
602
|
style: {
|
|
523
|
-
position: 'absolute',
|
|
524
603
|
top: '0px',
|
|
525
604
|
left: '0px',
|
|
526
605
|
right: '0px',
|
|
@@ -529,33 +608,40 @@ const Modal = ({
|
|
|
529
608
|
maxWidth: '95%',
|
|
530
609
|
overflow: 'auto',
|
|
531
610
|
maxHeight: '95vh',
|
|
611
|
+
position: 'absolute',
|
|
532
612
|
width: 'fit-content',
|
|
533
|
-
borderRadius: '14px',
|
|
534
613
|
height: 'fit-content',
|
|
535
614
|
boxSizing: 'border-box',
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
615
|
+
borderRadius: radius ? radius : configStyles.MODAL.radius,
|
|
616
|
+
minWidth: type === 'content' ? minWidth ? minWidth : '' : '',
|
|
617
|
+
minHeight: type === 'content' ? minHeight ? minHeight : '' : '',
|
|
618
|
+
padding: type === 'content' ? padding ? padding : configStyles.MODAL.padding : '10px',
|
|
619
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.MODAL.backgroundColor
|
|
539
620
|
}
|
|
540
621
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
541
622
|
style: {
|
|
542
|
-
|
|
623
|
+
position: 'relative',
|
|
543
624
|
width: '100%',
|
|
544
|
-
height: '
|
|
625
|
+
height: '100%'
|
|
626
|
+
}
|
|
627
|
+
}, type === 'content' ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
628
|
+
style: {
|
|
629
|
+
width: '100%',
|
|
630
|
+
display: 'flex',
|
|
545
631
|
alignItems: 'center',
|
|
546
|
-
|
|
632
|
+
height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
|
|
547
633
|
justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end'
|
|
548
634
|
}
|
|
549
635
|
}, headerText && type === 'content' && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
550
636
|
style: {
|
|
551
|
-
color: '#00236a',
|
|
552
|
-
fontSize: '20px',
|
|
553
|
-
fontWeight: '600',
|
|
554
637
|
overflow: 'hidden',
|
|
555
638
|
whiteSpace: 'nowrap',
|
|
556
639
|
textOverflow: 'ellipsis',
|
|
557
640
|
margin: '0px 16px 0px 0px',
|
|
558
|
-
maxWidth: 'calc(100% - 30px)'
|
|
641
|
+
maxWidth: 'calc(100% - 30px)',
|
|
642
|
+
fontSize: headerSize ? headerSize : configStyles.MODAL.headerSize,
|
|
643
|
+
color: headerColor ? headerColor : configStyles.MODAL.headerColor,
|
|
644
|
+
fontWeight: headerWeight ? headerWeight : configStyles.MODAL.headerWeight
|
|
559
645
|
}
|
|
560
646
|
}, headerText), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
561
647
|
onClick: handleCloseModal,
|
|
@@ -564,17 +650,32 @@ const Modal = ({
|
|
|
564
650
|
height: '14px',
|
|
565
651
|
cursor: 'pointer'
|
|
566
652
|
}
|
|
567
|
-
}, /*#__PURE__*/React__default["default"].createElement(SvgCloseIcon, null)))
|
|
653
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgCloseIcon, null))) : /*#__PURE__*/React__default["default"].createElement("button", {
|
|
654
|
+
onClick: handleCloseModal,
|
|
655
|
+
style: {
|
|
656
|
+
position: 'absolute',
|
|
657
|
+
top: '23px',
|
|
658
|
+
width: '18px',
|
|
659
|
+
right: '23px',
|
|
660
|
+
height: '18px',
|
|
661
|
+
border: 'none',
|
|
662
|
+
outline: 'none',
|
|
663
|
+
cursor: 'pointer',
|
|
664
|
+
backgroundColor: 'transparent'
|
|
665
|
+
}
|
|
666
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgCloseSlide, null)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
568
667
|
style: {
|
|
569
668
|
display: 'flex',
|
|
570
|
-
paddingTop: '10px',
|
|
571
669
|
alignItems: 'center',
|
|
572
670
|
boxSizing: 'border-box',
|
|
573
|
-
justifyContent: 'center'
|
|
671
|
+
justifyContent: 'center',
|
|
672
|
+
paddingTop: type === 'content' ? '10px' : '0px'
|
|
574
673
|
}
|
|
575
674
|
}, type === 'content' ? children ? children : '' : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
576
675
|
style: {
|
|
577
|
-
width: '100%'
|
|
676
|
+
width: '100%',
|
|
677
|
+
display: 'flex',
|
|
678
|
+
alignItems: 'center'
|
|
578
679
|
}
|
|
579
680
|
}, innerData && innerData.length > 0 && innerData.map((item, index) => {
|
|
580
681
|
if (select === index) {
|
|
@@ -583,86 +684,73 @@ const Modal = ({
|
|
|
583
684
|
} else {
|
|
584
685
|
return /*#__PURE__*/React__default["default"].createElement("img", {
|
|
585
686
|
style: {
|
|
586
|
-
width: '600px',
|
|
587
|
-
height: '300px',
|
|
588
687
|
objectFit: 'cover',
|
|
589
|
-
objectPosition: 'center'
|
|
688
|
+
objectPosition: 'center',
|
|
689
|
+
borderRadius: radius ? radius : configStyles.MODAL.radius,
|
|
690
|
+
width: imageWidth ? imageWidth : configStyles.MODAL.imageWidth,
|
|
691
|
+
height: imageHeight ? imageHeight : configStyles.MODAL.imageHeight
|
|
590
692
|
},
|
|
591
|
-
src: item.url
|
|
693
|
+
src: item.url,
|
|
694
|
+
key: item.id ? item.id : index
|
|
592
695
|
});
|
|
593
696
|
}
|
|
594
697
|
}
|
|
595
|
-
}), /*#__PURE__*/React__default["default"].createElement("
|
|
596
|
-
style: {
|
|
597
|
-
marginTop: '10px'
|
|
598
|
-
}
|
|
599
|
-
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
698
|
+
}), innerData && innerData.length > 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
600
699
|
onClick: handleGoTo,
|
|
601
700
|
"data-go": "prev",
|
|
602
701
|
style: {
|
|
603
|
-
|
|
702
|
+
position: 'absolute',
|
|
703
|
+
left: '14px',
|
|
704
|
+
width: '24px',
|
|
705
|
+
height: '24px',
|
|
706
|
+
padding: '0px',
|
|
707
|
+
border: 'none',
|
|
604
708
|
outline: 'none',
|
|
605
709
|
cursor: 'pointer',
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
alignItems: 'center',
|
|
609
|
-
display: 'inline-flex',
|
|
610
|
-
justifyContent: 'center',
|
|
611
|
-
backgroundColor: 'white',
|
|
612
|
-
transform: 'rotate(180deg)',
|
|
613
|
-
border: '1px solid #979090'
|
|
710
|
+
top: 'calc(50% - 12px)',
|
|
711
|
+
backgroundColor: 'transparent'
|
|
614
712
|
}
|
|
615
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
713
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgPrev, null)), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
616
714
|
onClick: handleGoTo,
|
|
617
715
|
"data-go": "next",
|
|
618
716
|
style: {
|
|
619
|
-
|
|
717
|
+
position: 'absolute',
|
|
718
|
+
width: '24px',
|
|
719
|
+
right: '14px',
|
|
720
|
+
height: '24px',
|
|
721
|
+
border: 'none',
|
|
722
|
+
padding: '0px',
|
|
620
723
|
outline: 'none',
|
|
621
724
|
cursor: 'pointer',
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
display: 'inline-flex',
|
|
625
|
-
justifyContent: 'center',
|
|
626
|
-
backgroundColor: 'white',
|
|
627
|
-
border: '1px solid #979090'
|
|
725
|
+
top: 'calc(50% - 12px)',
|
|
726
|
+
backgroundColor: 'transparent'
|
|
628
727
|
}
|
|
629
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
728
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNext, null)))))))));
|
|
630
729
|
};
|
|
631
730
|
Modal.propTypes = {
|
|
632
731
|
data: PropTypes__default["default"].array,
|
|
633
732
|
type: PropTypes__default["default"].string,
|
|
634
733
|
setShow: PropTypes__default["default"].func,
|
|
734
|
+
radius: PropTypes__default["default"].string,
|
|
735
|
+
padding: PropTypes__default["default"].string,
|
|
635
736
|
selected: PropTypes__default["default"].number,
|
|
737
|
+
minWidth: PropTypes__default["default"].string,
|
|
738
|
+
minHeight: PropTypes__default["default"].string,
|
|
636
739
|
className: PropTypes__default["default"].string,
|
|
637
|
-
headerText: PropTypes__default["default"].string
|
|
740
|
+
headerText: PropTypes__default["default"].string,
|
|
741
|
+
imageWidth: PropTypes__default["default"].string,
|
|
742
|
+
headerSize: PropTypes__default["default"].string,
|
|
743
|
+
headerColor: PropTypes__default["default"].string,
|
|
744
|
+
imageHeight: PropTypes__default["default"].string,
|
|
745
|
+
headerWeight: PropTypes__default["default"].string,
|
|
746
|
+
headerHeight: PropTypes__default["default"].string,
|
|
747
|
+
backgroundColor: PropTypes__default["default"].string,
|
|
748
|
+
layerBackgroundColor: PropTypes__default["default"].string
|
|
638
749
|
};
|
|
639
750
|
Modal.defaultProps = {
|
|
640
751
|
type: 'content'
|
|
641
752
|
};
|
|
642
753
|
|
|
643
|
-
const _ = require('lodash');
|
|
644
|
-
const compereConfigs = () => {
|
|
645
|
-
let projectConfig = {};
|
|
646
|
-
let packageConfig = {};
|
|
647
|
-
try {
|
|
648
|
-
packageConfig = require('../tui.config.js');
|
|
649
|
-
} catch (e) {
|
|
650
|
-
try {
|
|
651
|
-
packageConfig = require('../../tui.config.js');
|
|
652
|
-
} catch (err) {
|
|
653
|
-
packageConfig = {};
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
try {
|
|
657
|
-
projectConfig = require('../../../../tui.config.js');
|
|
658
|
-
} catch (error) {
|
|
659
|
-
projectConfig = {};
|
|
660
|
-
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
return _.merge(packageConfig, projectConfig);
|
|
664
|
-
};
|
|
665
|
-
|
|
666
754
|
var css_248z$a = ".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)}}";
|
|
667
755
|
var styles$8 = {"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"};
|
|
668
756
|
styleInject(css_248z$a);
|
|
@@ -3323,6 +3411,24 @@ const SvgDots = ({
|
|
|
3323
3411
|
fill: "#3C393E"
|
|
3324
3412
|
}));
|
|
3325
3413
|
|
|
3414
|
+
const SvgNextarrow = ({
|
|
3415
|
+
title,
|
|
3416
|
+
titleId,
|
|
3417
|
+
...props
|
|
3418
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
3419
|
+
width: "6",
|
|
3420
|
+
height: "12",
|
|
3421
|
+
viewBox: "0 0 6 12",
|
|
3422
|
+
fill: "none",
|
|
3423
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3424
|
+
"aria-labelledby": titleId
|
|
3425
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
3426
|
+
id: titleId
|
|
3427
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
3428
|
+
d: "M.851 11.998a.847.847 0 0 1-.847-.776.86.86 0 0 1 .193-.626l3.808-4.584L.333 1.419A.857.857 0 0 1 .46.213a.849.849 0 0 1 1.241.128l4.106 5.132a.859.859 0 0 1 0 1.086l-4.25 5.132a.85.85 0 0 1-.706.307Z",
|
|
3429
|
+
fill: "#3C393E"
|
|
3430
|
+
}));
|
|
3431
|
+
|
|
3326
3432
|
const Pagination = ({
|
|
3327
3433
|
goTo,
|
|
3328
3434
|
onChange,
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCloseSlide = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="18"
|
|
5
|
+
height="18"
|
|
6
|
+
viewBox="0 0 18 18"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="m10.47 8.95 7.29-7.29A1 1 0 0 0 16.35.25L9.06 7.54 1.77.24A1 1 0 0 0 .36 1.65l7.29 7.3-7.3 7.29a.999.999 0 1 0 1.41 1.41l7.3-7.29 7.29 7.29a1 1 0 0 0 1.41-1.41l-7.29-7.29Z"
|
|
15
|
+
fill="#fff"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgCloseSlide;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgNext = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12Zm3.4-11.443a.854.854 0 0 0 .198-.548.855.855 0 0 0-.146-.539l-4.137-5.134a.857.857 0 0 0-1.251-.12.856.856 0 0 0-.129 1.207l3.701 4.586-3.838 4.587a.856.856 0 0 0 .739 1.4.858.858 0 0 0 .58-.305l4.284-5.134Z"
|
|
17
|
+
fill="#fff"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
export default SvgNext;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgPrev = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
fillRule="evenodd"
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0ZM8.6 11.443a.855.855 0 0 0-.198.548c-.013.19.038.38.146.539l4.137 5.133a.857.857 0 0 0 1.251.12.856.856 0 0 0 .129-1.206l-3.701-4.586 3.838-4.587a.856.856 0 0 0-.739-1.4.858.858 0 0 0-.58.305l-4.284 5.134Z"
|
|
17
|
+
fill="#fff"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
export default SvgPrev;
|