@xaypay/tui 0.0.94 → 0.0.95

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 CHANGED
@@ -66,9 +66,9 @@ function styleInject(css, ref) {
66
66
  }
67
67
  }
68
68
 
69
- var css_248z$f = ".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)}";
69
+ var css_248z$g = ".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)}";
70
70
  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"};
71
- styleInject(css_248z$f);
71
+ styleInject(css_248z$g);
72
72
 
73
73
  const File = ({
74
74
  name,
@@ -190,6 +190,63 @@ File.defaultProps = {
190
190
  fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
191
191
  };
192
192
 
193
+ const _ = require('lodash');
194
+ const compereConfigs = () => {
195
+ let projectConfig = {};
196
+ let packageConfig = {};
197
+ try {
198
+ packageConfig = require('../tui.config.js');
199
+ } catch (e) {
200
+ try {
201
+ packageConfig = require('../../tui.config.js');
202
+ } catch (err) {
203
+ packageConfig = {};
204
+ }
205
+ }
206
+ try {
207
+ projectConfig = require('../../../../tui.config.js');
208
+ } catch (error) {
209
+ projectConfig = {};
210
+ // console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
211
+ }
212
+
213
+ return _.merge(packageConfig, projectConfig);
214
+ };
215
+
216
+ var css_248z$f = "";
217
+ styleInject(css_248z$f);
218
+
219
+ const Chart = ({
220
+ width,
221
+ height
222
+ }) => {
223
+ compereConfigs();
224
+ useEffect(() => {
225
+ const canvas = document.getElementById('myChart');
226
+ // const canvas = canvasRef.current;
227
+ const ctx = canvas.getContext('2d');
228
+ const data = [10, 20, 30, 15, 25];
229
+ const barWidth = 40;
230
+ const chartHeight = 200;
231
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
232
+ data.forEach((value, index) => {
233
+ const x = index * (barWidth + 10);
234
+ const y = chartHeight - value;
235
+ ctx.fillStyle = 'blue';
236
+ ctx.fillRect(x, y, barWidth, value);
237
+ });
238
+ }, []);
239
+ return /*#__PURE__*/React__default.createElement("canvas", {
240
+ id: "myChart",
241
+ width: width,
242
+ height: height
243
+ });
244
+ };
245
+ Chart.propTypes = {
246
+ width: PropTypes.number,
247
+ height: PropTypes.number
248
+ };
249
+
193
250
  const SvgCheckboxUnchecked = ({
194
251
  title,
195
252
  titleId,
@@ -271,29 +328,6 @@ SingleCheckbox.propTypes = {
271
328
  var css_248z$e = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{cursor:pointer;display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}";
272
329
  styleInject(css_248z$e);
273
330
 
274
- const _ = require('lodash');
275
- const compereConfigs = () => {
276
- let projectConfig = {};
277
- let packageConfig = {};
278
- try {
279
- packageConfig = require('../tui.config.js');
280
- } catch (e) {
281
- try {
282
- packageConfig = require('../../tui.config.js');
283
- } catch (err) {
284
- packageConfig = {};
285
- }
286
- }
287
- try {
288
- projectConfig = require('../../../../tui.config.js');
289
- } catch (error) {
290
- projectConfig = {};
291
- // console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
292
- }
293
-
294
- return _.merge(packageConfig, projectConfig);
295
- };
296
-
297
331
  ({
298
332
  dataBody: PropTypes.array,
299
333
  dataHeader: PropTypes.array,
@@ -426,7 +460,8 @@ const Modal = ({
426
460
  headerHeight,
427
461
  justifyContent,
428
462
  backgroundColor,
429
- layerBackgroundColor
463
+ layerBackgroundColor,
464
+ borderWidth
430
465
  }) => {
431
466
  const [select, setSelect] = useState(0);
432
467
  const [innerData, setInnerData] = useState([]);
@@ -507,39 +542,38 @@ const Modal = ({
507
542
  className: `${classProps} ${styles$b['animation__modal']}`,
508
543
  onClick: handleStopClosing,
509
544
  style: {
510
- overflow: 'auto',
511
- boxSizing: 'border-box',
512
545
  width: width ? width : configStyles.MODAL.width,
513
546
  height: height ? height : configStyles.MODAL.height,
547
+ position: 'relative',
548
+ display: 'grid',
549
+ overflow: 'auto',
550
+ boxSizing: 'border-box',
551
+ gridTemplateRows: 'auto 10fr',
514
552
  borderRadius: radius ? radius : configStyles.MODAL.radius,
515
553
  maxWidth: mMaxWidth ? mMaxWidth : configStyles.MODAL.mMaxWidth,
516
554
  maxHeight: mMaxHeight ? mMaxHeight : configStyles.MODAL.mMaxHeight,
517
555
  minWidth: type === 'content' ? minWidth ? minWidth : configStyles.MODAL.minWidth : '',
518
- padding: type === 'content' ? padding ? padding : configStyles.MODAL.padding : '10px',
519
556
  backgroundColor: backgroundColor ? backgroundColor : configStyles.MODAL.backgroundColor,
520
557
  minHeight: type === 'content' ? minHeight ? minHeight : configStyles.MODAL.minHeight : ''
521
558
  }
522
- }, /*#__PURE__*/React__default.createElement("div", {
523
- style: {
524
- position: 'relative',
525
- width: '100%',
526
- height: '100%'
527
- }
528
559
  }, type === 'content' ? /*#__PURE__*/React__default.createElement("div", {
529
560
  style: {
530
561
  width: '100%',
531
562
  display: 'flex',
532
563
  alignItems: 'center',
564
+ backgroundColor: '#FBFBFB',
565
+ boxSizing: 'border-box',
566
+ justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end',
533
567
  height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
534
- justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end'
568
+ padding: padding ? padding : configStyles.MODAL.padding
535
569
  }
536
570
  }, headerText && type === 'content' && /*#__PURE__*/React__default.createElement("p", {
537
571
  style: {
572
+ flex: '1',
538
573
  overflow: 'hidden',
539
574
  whiteSpace: 'nowrap',
540
575
  textOverflow: 'ellipsis',
541
576
  margin: '0px 16px 0px 0px',
542
- maxWidth: 'calc(100% - 30px)',
543
577
  fontSize: headerSize ? headerSize : configStyles.MODAL.headerSize,
544
578
  color: headerColor ? headerColor : configStyles.MODAL.headerColor,
545
579
  fontWeight: headerWeight ? headerWeight : configStyles.MODAL.headerWeight
@@ -562,15 +596,19 @@ const Modal = ({
562
596
  border: 'none',
563
597
  outline: 'none',
564
598
  cursor: 'pointer',
599
+ zIndex: '1',
565
600
  backgroundColor: 'transparent'
566
601
  }
567
602
  }, /*#__PURE__*/React__default.createElement(SvgCloseSlide, null)), /*#__PURE__*/React__default.createElement("div", {
568
603
  style: {
569
604
  display: 'flex',
605
+ position: 'relative',
606
+ width: '100%',
607
+ height: '100%',
570
608
  alignItems: 'center',
571
609
  boxSizing: 'border-box',
572
610
  justifyContent: 'center',
573
- paddingTop: type === 'content' ? '10px' : '0px'
611
+ borderWidth: borderWidth ? borderWidth : configStyles.MODAL.borderWidth
574
612
  }
575
613
  }, type === 'content' ? children ? children : '' : /*#__PURE__*/React__default.createElement("div", {
576
614
  style: {
@@ -624,7 +662,7 @@ const Modal = ({
624
662
  top: 'calc(50% - 12px)',
625
663
  backgroundColor: 'transparent'
626
664
  }
627
- }, /*#__PURE__*/React__default.createElement(SvgNext, null)))))))));
665
+ }, /*#__PURE__*/React__default.createElement(SvgNext, null))))))));
628
666
  };
629
667
  Modal.propTypes = {
630
668
  data: PropTypes.array,
@@ -807,6 +845,15 @@ const Input = ({
807
845
  change(`${int}.${float.substr(0, floatToFix)}`);
808
846
  }
809
847
  }
848
+ } else if (floatToFix === 0) {
849
+ const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
850
+ const int = floatNumParts[0];
851
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
852
+ setInnerValue(`${int}`);
853
+ if (change) {
854
+ change(`${int}`);
855
+ }
856
+ }
810
857
  }
811
858
  if (currentValue === '') {
812
859
  setInnerValue('');
@@ -4204,4 +4251,4 @@ NewAutocomplete.defaultProps = {
4204
4251
  disabled: false
4205
4252
  };
4206
4253
 
4207
- export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, NewFile, Pagination, Radio, Select, SingleCheckbox, Stepper, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
4254
+ export { Autocomplate, Button, Captcha, Chart, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, NewFile, Pagination, Radio, Select, SingleCheckbox, Stepper, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
package/dist/index.js CHANGED
@@ -96,9 +96,9 @@ function styleInject(css, ref) {
96
96
  }
97
97
  }
98
98
 
99
- var css_248z$f = ".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 css_248z$g = ".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)}";
100
100
  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"};
101
- styleInject(css_248z$f);
101
+ styleInject(css_248z$g);
102
102
 
103
103
  const File = ({
104
104
  name,
@@ -220,6 +220,63 @@ File.defaultProps = {
220
220
  fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
221
221
  };
222
222
 
223
+ const _ = require('lodash');
224
+ const compereConfigs = () => {
225
+ let projectConfig = {};
226
+ let packageConfig = {};
227
+ try {
228
+ packageConfig = require('../tui.config.js');
229
+ } catch (e) {
230
+ try {
231
+ packageConfig = require('../../tui.config.js');
232
+ } catch (err) {
233
+ packageConfig = {};
234
+ }
235
+ }
236
+ try {
237
+ projectConfig = require('../../../../tui.config.js');
238
+ } catch (error) {
239
+ projectConfig = {};
240
+ // console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
241
+ }
242
+
243
+ return _.merge(packageConfig, projectConfig);
244
+ };
245
+
246
+ var css_248z$f = "";
247
+ styleInject(css_248z$f);
248
+
249
+ const Chart = ({
250
+ width,
251
+ height
252
+ }) => {
253
+ compereConfigs();
254
+ React.useEffect(() => {
255
+ const canvas = document.getElementById('myChart');
256
+ // const canvas = canvasRef.current;
257
+ const ctx = canvas.getContext('2d');
258
+ const data = [10, 20, 30, 15, 25];
259
+ const barWidth = 40;
260
+ const chartHeight = 200;
261
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
262
+ data.forEach((value, index) => {
263
+ const x = index * (barWidth + 10);
264
+ const y = chartHeight - value;
265
+ ctx.fillStyle = 'blue';
266
+ ctx.fillRect(x, y, barWidth, value);
267
+ });
268
+ }, []);
269
+ return /*#__PURE__*/React__default["default"].createElement("canvas", {
270
+ id: "myChart",
271
+ width: width,
272
+ height: height
273
+ });
274
+ };
275
+ Chart.propTypes = {
276
+ width: PropTypes__default["default"].number,
277
+ height: PropTypes__default["default"].number
278
+ };
279
+
223
280
  const SvgCheckboxUnchecked = ({
224
281
  title,
225
282
  titleId,
@@ -301,29 +358,6 @@ SingleCheckbox.propTypes = {
301
358
  var css_248z$e = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{cursor:pointer;display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}";
302
359
  styleInject(css_248z$e);
303
360
 
304
- const _ = require('lodash');
305
- const compereConfigs = () => {
306
- let projectConfig = {};
307
- let packageConfig = {};
308
- try {
309
- packageConfig = require('../tui.config.js');
310
- } catch (e) {
311
- try {
312
- packageConfig = require('../../tui.config.js');
313
- } catch (err) {
314
- packageConfig = {};
315
- }
316
- }
317
- try {
318
- projectConfig = require('../../../../tui.config.js');
319
- } catch (error) {
320
- projectConfig = {};
321
- // console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
322
- }
323
-
324
- return _.merge(packageConfig, projectConfig);
325
- };
326
-
327
361
  ({
328
362
  dataBody: PropTypes__default["default"].array,
329
363
  dataHeader: PropTypes__default["default"].array,
@@ -456,7 +490,8 @@ const Modal = ({
456
490
  headerHeight,
457
491
  justifyContent,
458
492
  backgroundColor,
459
- layerBackgroundColor
493
+ layerBackgroundColor,
494
+ borderWidth
460
495
  }) => {
461
496
  const [select, setSelect] = React.useState(0);
462
497
  const [innerData, setInnerData] = React.useState([]);
@@ -537,39 +572,38 @@ const Modal = ({
537
572
  className: `${classProps} ${styles$b['animation__modal']}`,
538
573
  onClick: handleStopClosing,
539
574
  style: {
540
- overflow: 'auto',
541
- boxSizing: 'border-box',
542
575
  width: width ? width : configStyles.MODAL.width,
543
576
  height: height ? height : configStyles.MODAL.height,
577
+ position: 'relative',
578
+ display: 'grid',
579
+ overflow: 'auto',
580
+ boxSizing: 'border-box',
581
+ gridTemplateRows: 'auto 10fr',
544
582
  borderRadius: radius ? radius : configStyles.MODAL.radius,
545
583
  maxWidth: mMaxWidth ? mMaxWidth : configStyles.MODAL.mMaxWidth,
546
584
  maxHeight: mMaxHeight ? mMaxHeight : configStyles.MODAL.mMaxHeight,
547
585
  minWidth: type === 'content' ? minWidth ? minWidth : configStyles.MODAL.minWidth : '',
548
- padding: type === 'content' ? padding ? padding : configStyles.MODAL.padding : '10px',
549
586
  backgroundColor: backgroundColor ? backgroundColor : configStyles.MODAL.backgroundColor,
550
587
  minHeight: type === 'content' ? minHeight ? minHeight : configStyles.MODAL.minHeight : ''
551
588
  }
552
- }, /*#__PURE__*/React__default["default"].createElement("div", {
553
- style: {
554
- position: 'relative',
555
- width: '100%',
556
- height: '100%'
557
- }
558
589
  }, type === 'content' ? /*#__PURE__*/React__default["default"].createElement("div", {
559
590
  style: {
560
591
  width: '100%',
561
592
  display: 'flex',
562
593
  alignItems: 'center',
594
+ backgroundColor: '#FBFBFB',
595
+ boxSizing: 'border-box',
596
+ justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end',
563
597
  height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
564
- justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end'
598
+ padding: padding ? padding : configStyles.MODAL.padding
565
599
  }
566
600
  }, headerText && type === 'content' && /*#__PURE__*/React__default["default"].createElement("p", {
567
601
  style: {
602
+ flex: '1',
568
603
  overflow: 'hidden',
569
604
  whiteSpace: 'nowrap',
570
605
  textOverflow: 'ellipsis',
571
606
  margin: '0px 16px 0px 0px',
572
- maxWidth: 'calc(100% - 30px)',
573
607
  fontSize: headerSize ? headerSize : configStyles.MODAL.headerSize,
574
608
  color: headerColor ? headerColor : configStyles.MODAL.headerColor,
575
609
  fontWeight: headerWeight ? headerWeight : configStyles.MODAL.headerWeight
@@ -592,15 +626,19 @@ const Modal = ({
592
626
  border: 'none',
593
627
  outline: 'none',
594
628
  cursor: 'pointer',
629
+ zIndex: '1',
595
630
  backgroundColor: 'transparent'
596
631
  }
597
632
  }, /*#__PURE__*/React__default["default"].createElement(SvgCloseSlide, null)), /*#__PURE__*/React__default["default"].createElement("div", {
598
633
  style: {
599
634
  display: 'flex',
635
+ position: 'relative',
636
+ width: '100%',
637
+ height: '100%',
600
638
  alignItems: 'center',
601
639
  boxSizing: 'border-box',
602
640
  justifyContent: 'center',
603
- paddingTop: type === 'content' ? '10px' : '0px'
641
+ borderWidth: borderWidth ? borderWidth : configStyles.MODAL.borderWidth
604
642
  }
605
643
  }, type === 'content' ? children ? children : '' : /*#__PURE__*/React__default["default"].createElement("div", {
606
644
  style: {
@@ -654,7 +692,7 @@ const Modal = ({
654
692
  top: 'calc(50% - 12px)',
655
693
  backgroundColor: 'transparent'
656
694
  }
657
- }, /*#__PURE__*/React__default["default"].createElement(SvgNext, null)))))))));
695
+ }, /*#__PURE__*/React__default["default"].createElement(SvgNext, null))))))));
658
696
  };
659
697
  Modal.propTypes = {
660
698
  data: PropTypes__default["default"].array,
@@ -837,6 +875,15 @@ const Input = ({
837
875
  change(`${int}.${float.substr(0, floatToFix)}`);
838
876
  }
839
877
  }
878
+ } else if (floatToFix === 0) {
879
+ const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
880
+ const int = floatNumParts[0];
881
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
882
+ setInnerValue(`${int}`);
883
+ if (change) {
884
+ change(`${int}`);
885
+ }
886
+ }
840
887
  }
841
888
  if (currentValue === '') {
842
889
  setInnerValue('');
@@ -4237,6 +4284,7 @@ NewAutocomplete.defaultProps = {
4237
4284
  exports.Autocomplate = Autocomplate;
4238
4285
  exports.Button = Button;
4239
4286
  exports.Captcha = Captcha;
4287
+ exports.Chart = Chart;
4240
4288
  exports.Checkbox = Checkbox;
4241
4289
  exports.File = File;
4242
4290
  exports.Input = Input;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.94",
3
+ "version": "0.0.95",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
File without changes
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { Chart } from './index';
3
+
4
+ export default {
5
+ component: Chart,
6
+ title: "Components/Chart",
7
+ };
8
+
9
+ const Template = (args) => {
10
+ return <Chart width={500} height={200} {...args} />;
11
+ };
12
+
13
+ export const Default = Template.bind({});
14
+ Default.args = {
15
+
16
+ };
@@ -0,0 +1,42 @@
1
+ import React, { useEffect } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { compereConfigs } from './../../utils';
4
+
5
+ import styles from "./chart.module.css";
6
+
7
+ export const Chart = ({
8
+ width,
9
+ height
10
+ }) => {
11
+ const configStyles = compereConfigs();
12
+ useEffect(() => {
13
+ const canvas = document.getElementById('myChart');
14
+ // const canvas = canvasRef.current;
15
+ const ctx = canvas.getContext('2d');
16
+
17
+ const data = [10, 20, 30, 15, 25];
18
+ const barWidth = 40;
19
+ const chartHeight = 200;
20
+
21
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
22
+
23
+ data.forEach((value, index) => {
24
+ const x = index * (barWidth + 10);
25
+ const y = chartHeight - value;
26
+
27
+ ctx.fillStyle = 'blue';
28
+ ctx.fillRect(x, y, barWidth, value);
29
+ });
30
+
31
+ }, []);
32
+
33
+
34
+ return (
35
+ <canvas id='myChart' width={width} height={height}></canvas>
36
+ );
37
+ };
38
+
39
+ Chart.propTypes = {
40
+ width: PropTypes.number,
41
+ height: PropTypes.number,
42
+ };
@@ -165,8 +165,18 @@ export const Input = ({
165
165
  if (change) {
166
166
  change(`${int}.${float.substr(0, floatToFix)}`);
167
167
  }
168
- }
168
+ }
169
+ } else if (floatToFix === 0) {
170
+ const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
171
+ const int = floatNumParts[0];
172
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
173
+ setInnerValue(`${int}`);
174
+ if (change) {
175
+ change(`${int}`);
176
+ }
177
+ }
169
178
  }
179
+
170
180
  if (currentValue === '') {
171
181
  setInnerValue('');
172
182
  if (change) {
@@ -37,6 +37,7 @@ export const Modal = ({
37
37
  justifyContent,
38
38
  backgroundColor,
39
39
  layerBackgroundColor,
40
+ borderWidth,
40
41
  }) => {
41
42
  const [select, setSelect] = useState(0);
42
43
  const [innerData, setInnerData] = useState([]);
@@ -128,26 +129,21 @@ export const Modal = ({
128
129
  className={`${classProps} ${styles['animation__modal']}`}
129
130
  onClick={handleStopClosing}
130
131
  style={{
131
- overflow: 'auto',
132
- boxSizing: 'border-box',
133
132
  width: width ? width : configStyles.MODAL.width,
134
133
  height: height ? height : configStyles.MODAL.height,
134
+ position: 'relative',
135
+ display: 'grid',
136
+ overflow: 'auto',
137
+ boxSizing: 'border-box',
138
+ gridTemplateRows: 'auto 10fr',
135
139
  borderRadius: radius ? radius : configStyles.MODAL.radius,
136
140
  maxWidth: mMaxWidth ? mMaxWidth : configStyles.MODAL.mMaxWidth,
137
141
  maxHeight: mMaxHeight ? mMaxHeight : configStyles.MODAL.mMaxHeight,
138
142
  minWidth: type === 'content' ? minWidth ? minWidth : configStyles.MODAL.minWidth : '',
139
- padding: type === 'content' ? padding ? padding : configStyles.MODAL.padding : '10px',
140
143
  backgroundColor: backgroundColor ? backgroundColor : configStyles.MODAL.backgroundColor,
141
144
  minHeight: type === 'content' ? minHeight ? minHeight : configStyles.MODAL.minHeight : '',
142
145
  }}
143
146
  >
144
- <div
145
- style={{
146
- position: 'relative',
147
- width: '100%',
148
- height: '100%'
149
- }}
150
- >
151
147
  {
152
148
  type === 'content'
153
149
  ?
@@ -156,18 +152,21 @@ export const Modal = ({
156
152
  width: '100%',
157
153
  display: 'flex',
158
154
  alignItems: 'center',
159
- height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
155
+ backgroundColor: '#FBFBFB',
156
+ boxSizing: 'border-box',
160
157
  justifyContent: headerText && type === 'content' ? 'space-between' : 'flex-end',
158
+ height: headerHeight ? headerHeight : configStyles.MODAL.headerHeight,
159
+ padding: padding ? padding : configStyles.MODAL.padding
161
160
  }}
162
161
  >
163
162
  {
164
163
  headerText && type === 'content' && <p
165
164
  style={{
165
+ flex: '1',
166
166
  overflow: 'hidden',
167
167
  whiteSpace: 'nowrap',
168
168
  textOverflow: 'ellipsis',
169
169
  margin: '0px 16px 0px 0px',
170
- maxWidth: 'calc(100% - 30px)',
171
170
  fontSize: headerSize ? headerSize : configStyles.MODAL.headerSize,
172
171
  color: headerColor ? headerColor : configStyles.MODAL.headerColor,
173
172
  fontWeight: headerWeight ? headerWeight : configStyles.MODAL.headerWeight
@@ -197,6 +196,7 @@ export const Modal = ({
197
196
  border: 'none',
198
197
  outline: 'none',
199
198
  cursor: 'pointer',
199
+ zIndex: '1',
200
200
  backgroundColor: 'transparent'
201
201
  }}
202
202
  >
@@ -207,10 +207,13 @@ export const Modal = ({
207
207
  <div
208
208
  style={{
209
209
  display: 'flex',
210
+ position: 'relative',
211
+ width: '100%',
212
+ height: '100%',
210
213
  alignItems: 'center',
211
214
  boxSizing: 'border-box',
212
215
  justifyContent: 'center',
213
- paddingTop: type === 'content' ? '10px' : '0px'
216
+ borderWidth: borderWidth ? borderWidth : configStyles.MODAL.borderWidth
214
217
  }}
215
218
  >
216
219
  {
@@ -290,7 +293,7 @@ export const Modal = ({
290
293
  </div>
291
294
  }
292
295
  </div>
293
- </div>
296
+ {/* </div> */}
294
297
  </div>
295
298
  </div>
296
299
  </div>
package/src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './components/file';
2
+ export * from './components/chart';
2
3
  export * from './components/table';
3
4
  export * from './components/modal';
4
5
  export * from './components/input';
package/tui.config.js CHANGED
@@ -388,13 +388,14 @@ module.exports = {
388
388
  imageWidth: '600px', // for modal image width on images mode
389
389
  headerWeight: '600', // for modal header font weight
390
390
  imageHeight: '300px', // for modal image height on images mode
391
- headerHeight: '27px', // for modal header height
391
+ headerHeight: '30px', // for modal header height
392
392
  width: 'fit-content', // for modal width
393
393
  height: 'fit-content', // for modal width
394
394
  headerColor: '#00236a', // for modal header color
395
395
  backgroundColor: 'white', // for modal background color
396
- padding: '10px 20px 20px', // for modal padding
396
+ padding: '20px 20px 20px', // for modal padding
397
397
  layerBackgroundColor: 'rgba(0,0,0,0.4)', // for modal parent layer background color
398
+ borderWidth: '20px solid transparent', // for modal padding from border transparent
398
399
  },
399
400
  // default properties for <Table /> component
400
401
  TABLE: {