@xaypay/tui 0.1.3 → 0.1.4

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
@@ -38,7 +38,7 @@ for (let i = 0; i < 256; ++i) {
38
38
  function unsafeStringify(arr, offset = 0) {
39
39
  // Note: Be careful editing this code! It's been tuned for performance
40
40
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
41
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
41
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
42
42
  }
43
43
 
44
44
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -958,7 +958,7 @@ const File = ({
958
958
  setSingleFile(null);
959
959
  }
960
960
  if (multiple && !removeFile) {
961
- alert('Please add removeFile prop on NewFile component, it is a require in multiple mode');
961
+ alert('Please add removeFile prop on File component, it is a require in multiple mode');
962
962
  }
963
963
  if (maxCHoosenLength) {
964
964
  if (typeof maxCHoosenLength !== 'number') {
@@ -974,7 +974,7 @@ const File = ({
974
974
  }, [multiple, removeFile, filesArray && filesArray.length, defaultData, maxCHoosenLength]);
975
975
  useEffect(() => {
976
976
  if (deleteComponent && !removeComponent) {
977
- alert('Please add removeComponent prop on NewFile component it is require when deleteComponent prop is true');
977
+ alert('Please add removeComponent prop on File component it is require when deleteComponent prop is true');
978
978
  }
979
979
  }, [deleteComponent]);
980
980
  useEffect(() => {
@@ -3010,11 +3010,11 @@ const TelInput = ({
3010
3010
  type,
3011
3011
  value,
3012
3012
  radius,
3013
- inputChange,
3014
3013
  isHover,
3015
3014
  disabled,
3016
3015
  inpStyles,
3017
3016
  errorColor,
3017
+ inputChange,
3018
3018
  phoneDisplay,
3019
3019
  inpAttributes,
3020
3020
  phoneAlignItems,
@@ -3093,7 +3093,7 @@ const TextInput = ({
3093
3093
  }
3094
3094
  };
3095
3095
  useEffect(() => {
3096
- let newValue = value;
3096
+ let newValue = '';
3097
3097
  if (value !== undefined && value !== null) {
3098
3098
  newValue = value;
3099
3099
  if (maxLength && value.length > maxLength) {
@@ -3174,12 +3174,12 @@ const NumberInput = ({
3174
3174
  value,
3175
3175
  float,
3176
3176
  radius,
3177
- inputChange,
3178
3177
  maxLength,
3179
3178
  inpStyles,
3180
- inpAttributes,
3181
3179
  minNumSize,
3182
- maxNumSize
3180
+ maxNumSize,
3181
+ inputChange,
3182
+ inpAttributes
3183
3183
  }) => {
3184
3184
  const [innerValue, setInnerValue] = useState('');
3185
3185
  const [innerMinNumSize, setInnerMinNumSize] = useState(0);
@@ -3244,7 +3244,7 @@ const InputTypes = {
3244
3244
  PASSWORD: 'password'
3245
3245
  };
3246
3246
  const P = styled.span`
3247
- animation: ${props => props.errorAnimation ? props.errorAnimation : 'none'};
3247
+ animation: ${true};
3248
3248
  `;
3249
3249
  const Input = ({
3250
3250
  type,
@@ -3266,7 +3266,6 @@ const Input = ({
3266
3266
  leftIcon,
3267
3267
  required,
3268
3268
  disabled,
3269
- transform,
3270
3269
  iconWidth,
3271
3270
  rightIcon,
3272
3271
  className,
@@ -3296,7 +3295,6 @@ const Input = ({
3296
3295
  errorMarginTop,
3297
3296
  boxShadowHover,
3298
3297
  errorClassName,
3299
- errorAnimation,
3300
3298
  labelFontFamily,
3301
3299
  phoneAlignItems,
3302
3300
  errorLineHeight,
@@ -3309,7 +3307,6 @@ const Input = ({
3309
3307
  telBorderRightStyle,
3310
3308
  telBorderRightColor,
3311
3309
  backgroundDisableColor,
3312
- errorAnimationDuration,
3313
3310
  telBorderRightColorHover
3314
3311
  }) => {
3315
3312
  const [show, setShow] = useState(false);
@@ -3328,12 +3325,12 @@ const Input = ({
3328
3325
  color: innerErrorMessage && errorColor ? errorColor : color ? color : merge.INPUT.color,
3329
3326
  backgroundColor: disabled ? backgroundDisableColor ? backgroundDisableColor : merge.INPUT.colors.backgroundDisable : backgroundColor ? backgroundColor : merge.INPUT.colors.background
3330
3327
  };
3328
+ const uuid = v4();
3331
3329
  const inpAttributes = {
3332
3330
  placeholder: placeholder ?? '',
3333
- iName: name ? name : `tui_${random}_tui`,
3331
+ iName: name ? name : `tui_${uuid}_tui`,
3334
3332
  autoComplete: autoComplete ?? merge.INPUT.autoComplete
3335
3333
  };
3336
- const random = Math.floor(Math.random() * 1000 + 1);
3337
3334
  const classProps = classnames(className ?? merge.INPUT.className, type === 'number' ? styles$7['inp-num'] : '', styles$7['input-wrap']);
3338
3335
  const errorShow = keyframes`
3339
3336
  100% {
@@ -3346,7 +3343,7 @@ const Input = ({
3346
3343
  }
3347
3344
  `;
3348
3345
  const animation = () => css`
3349
- ${errorShow} ${errorAnimationDuration ? errorAnimationDuration : merge.INPUT.error.animationDuration} forwards
3346
+ ${errorShow} 240ms forwards
3350
3347
  `;
3351
3348
  const handleMouseEnter = () => {
3352
3349
  setIsHover(true);
@@ -3435,9 +3432,10 @@ const Input = ({
3435
3432
  show: show,
3436
3433
  type: type,
3437
3434
  value: value,
3438
- inputChange: change,
3439
3435
  isHover: isHover,
3440
3436
  disabled: disabled,
3437
+ inputChange: change,
3438
+ maxLength: maxLength,
3441
3439
  inpStyles: inpStyles,
3442
3440
  inpAttributes: inpAttributes,
3443
3441
  radius: radius ?? merge.INPUT.radius
@@ -3445,6 +3443,7 @@ const Input = ({
3445
3443
  value: value,
3446
3444
  inputChange: change,
3447
3445
  inpStyles: inpStyles,
3446
+ maxLength: maxLength,
3448
3447
  inpAttributes: inpAttributes,
3449
3448
  radius: radius ?? merge.INPUT.radius
3450
3449
  }), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
@@ -3463,7 +3462,6 @@ const Input = ({
3463
3462
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : merge.INPUT.colors.background
3464
3463
  }
3465
3464
  }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', innerErrorMessage ? /*#__PURE__*/React__default.createElement(P, {
3466
- errorAnimation: errorAnimation ?? merge.INPUT.error.animation,
3467
3465
  animation: animation,
3468
3466
  style: {
3469
3467
  margin: '0px',
@@ -3478,7 +3476,7 @@ const Input = ({
3478
3476
  zIndex: errorZindex ?? merge.INPUT.error.zIndex,
3479
3477
  lineHeight: errorLineHeight ?? merge.INPUT.error.lineHeight,
3480
3478
  top: errorMarginTop ? `calc(100% + ${errorMarginTop})` : `calc(100% + ${merge.INPUT.error.marginTop})`,
3481
- transform: !errorAnimation && !merge.INPUT.error.animation ? 'scale3d(1,1,1)' : transform ? transform : merge.INPUT.error.transform
3479
+ transform: 'scale3d(1,1,1)'
3482
3480
  },
3483
3481
  className: errorClassName ?? merge.INPUT.error.className
3484
3482
  }, innerErrorMessage) : '');
@@ -3500,7 +3498,6 @@ Input.propTypes = {
3500
3498
  padding: PropTypes.string,
3501
3499
  tooltip: PropTypes.element,
3502
3500
  withoutDot: PropTypes.bool,
3503
- transform: PropTypes.string,
3504
3501
  className: PropTypes.string,
3505
3502
  iconWidth: PropTypes.string,
3506
3503
  boxSizing: PropTypes.string,
@@ -3525,7 +3522,6 @@ Input.propTypes = {
3525
3522
  errorMessage: PropTypes.string,
3526
3523
  phoneDisplay: PropTypes.string,
3527
3524
  autoComplete: PropTypes.string,
3528
- errorAnimation: PropTypes.bool,
3529
3525
  labelDisplay: PropTypes.string,
3530
3526
  errorPosition: PropTypes.string,
3531
3527
  errorMarginTop: PropTypes.string,
@@ -3544,7 +3540,6 @@ Input.propTypes = {
3544
3540
  telBorderRightColor: PropTypes.string,
3545
3541
  phoneJustifyContent: PropTypes.string,
3546
3542
  backgroundDisableColor: PropTypes.string,
3547
- errorAnimationDuration: PropTypes.string,
3548
3543
  telBorderRightColorHover: PropTypes.string,
3549
3544
  leftIcon: PropTypes.arrayOf(PropTypes.element),
3550
3545
  rightIcon: PropTypes.arrayOf(PropTypes.element),
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ for (let i = 0; i < 256; ++i) {
68
68
  function unsafeStringify(arr, offset = 0) {
69
69
  // Note: Be careful editing this code! It's been tuned for performance
70
70
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
71
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
71
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
72
72
  }
73
73
 
74
74
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -988,7 +988,7 @@ const File = ({
988
988
  setSingleFile(null);
989
989
  }
990
990
  if (multiple && !removeFile) {
991
- alert('Please add removeFile prop on NewFile component, it is a require in multiple mode');
991
+ alert('Please add removeFile prop on File component, it is a require in multiple mode');
992
992
  }
993
993
  if (maxCHoosenLength) {
994
994
  if (typeof maxCHoosenLength !== 'number') {
@@ -1004,7 +1004,7 @@ const File = ({
1004
1004
  }, [multiple, removeFile, filesArray && filesArray.length, defaultData, maxCHoosenLength]);
1005
1005
  React.useEffect(() => {
1006
1006
  if (deleteComponent && !removeComponent) {
1007
- alert('Please add removeComponent prop on NewFile component it is require when deleteComponent prop is true');
1007
+ alert('Please add removeComponent prop on File component it is require when deleteComponent prop is true');
1008
1008
  }
1009
1009
  }, [deleteComponent]);
1010
1010
  React.useEffect(() => {
@@ -3040,11 +3040,11 @@ const TelInput = ({
3040
3040
  type,
3041
3041
  value,
3042
3042
  radius,
3043
- inputChange,
3044
3043
  isHover,
3045
3044
  disabled,
3046
3045
  inpStyles,
3047
3046
  errorColor,
3047
+ inputChange,
3048
3048
  phoneDisplay,
3049
3049
  inpAttributes,
3050
3050
  phoneAlignItems,
@@ -3123,7 +3123,7 @@ const TextInput = ({
3123
3123
  }
3124
3124
  };
3125
3125
  React.useEffect(() => {
3126
- let newValue = value;
3126
+ let newValue = '';
3127
3127
  if (value !== undefined && value !== null) {
3128
3128
  newValue = value;
3129
3129
  if (maxLength && value.length > maxLength) {
@@ -3204,12 +3204,12 @@ const NumberInput = ({
3204
3204
  value,
3205
3205
  float,
3206
3206
  radius,
3207
- inputChange,
3208
3207
  maxLength,
3209
3208
  inpStyles,
3210
- inpAttributes,
3211
3209
  minNumSize,
3212
- maxNumSize
3210
+ maxNumSize,
3211
+ inputChange,
3212
+ inpAttributes
3213
3213
  }) => {
3214
3214
  const [innerValue, setInnerValue] = React.useState('');
3215
3215
  const [innerMinNumSize, setInnerMinNumSize] = React.useState(0);
@@ -3274,7 +3274,7 @@ const InputTypes = {
3274
3274
  PASSWORD: 'password'
3275
3275
  };
3276
3276
  const P = styled__default["default"].span`
3277
- animation: ${props => props.errorAnimation ? props.errorAnimation : 'none'};
3277
+ animation: ${true};
3278
3278
  `;
3279
3279
  const Input = ({
3280
3280
  type,
@@ -3296,7 +3296,6 @@ const Input = ({
3296
3296
  leftIcon,
3297
3297
  required,
3298
3298
  disabled,
3299
- transform,
3300
3299
  iconWidth,
3301
3300
  rightIcon,
3302
3301
  className,
@@ -3326,7 +3325,6 @@ const Input = ({
3326
3325
  errorMarginTop,
3327
3326
  boxShadowHover,
3328
3327
  errorClassName,
3329
- errorAnimation,
3330
3328
  labelFontFamily,
3331
3329
  phoneAlignItems,
3332
3330
  errorLineHeight,
@@ -3339,7 +3337,6 @@ const Input = ({
3339
3337
  telBorderRightStyle,
3340
3338
  telBorderRightColor,
3341
3339
  backgroundDisableColor,
3342
- errorAnimationDuration,
3343
3340
  telBorderRightColorHover
3344
3341
  }) => {
3345
3342
  const [show, setShow] = React.useState(false);
@@ -3358,12 +3355,12 @@ const Input = ({
3358
3355
  color: innerErrorMessage && errorColor ? errorColor : color ? color : merge.INPUT.color,
3359
3356
  backgroundColor: disabled ? backgroundDisableColor ? backgroundDisableColor : merge.INPUT.colors.backgroundDisable : backgroundColor ? backgroundColor : merge.INPUT.colors.background
3360
3357
  };
3358
+ const uuid = v4();
3361
3359
  const inpAttributes = {
3362
3360
  placeholder: placeholder ?? '',
3363
- iName: name ? name : `tui_${random}_tui`,
3361
+ iName: name ? name : `tui_${uuid}_tui`,
3364
3362
  autoComplete: autoComplete ?? merge.INPUT.autoComplete
3365
3363
  };
3366
- const random = Math.floor(Math.random() * 1000 + 1);
3367
3364
  const classProps = classnames__default["default"](className ?? merge.INPUT.className, type === 'number' ? styles$7['inp-num'] : '', styles$7['input-wrap']);
3368
3365
  const errorShow = styled.keyframes`
3369
3366
  100% {
@@ -3376,7 +3373,7 @@ const Input = ({
3376
3373
  }
3377
3374
  `;
3378
3375
  const animation = () => styled.css`
3379
- ${errorShow} ${errorAnimationDuration ? errorAnimationDuration : merge.INPUT.error.animationDuration} forwards
3376
+ ${errorShow} 240ms forwards
3380
3377
  `;
3381
3378
  const handleMouseEnter = () => {
3382
3379
  setIsHover(true);
@@ -3465,9 +3462,10 @@ const Input = ({
3465
3462
  show: show,
3466
3463
  type: type,
3467
3464
  value: value,
3468
- inputChange: change,
3469
3465
  isHover: isHover,
3470
3466
  disabled: disabled,
3467
+ inputChange: change,
3468
+ maxLength: maxLength,
3471
3469
  inpStyles: inpStyles,
3472
3470
  inpAttributes: inpAttributes,
3473
3471
  radius: radius ?? merge.INPUT.radius
@@ -3475,6 +3473,7 @@ const Input = ({
3475
3473
  value: value,
3476
3474
  inputChange: change,
3477
3475
  inpStyles: inpStyles,
3476
+ maxLength: maxLength,
3478
3477
  inpAttributes: inpAttributes,
3479
3478
  radius: radius ?? merge.INPUT.radius
3480
3479
  }), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
@@ -3493,7 +3492,6 @@ const Input = ({
3493
3492
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : merge.INPUT.colors.background
3494
3493
  }
3495
3494
  }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', innerErrorMessage ? /*#__PURE__*/React__default["default"].createElement(P, {
3496
- errorAnimation: errorAnimation ?? merge.INPUT.error.animation,
3497
3495
  animation: animation,
3498
3496
  style: {
3499
3497
  margin: '0px',
@@ -3508,7 +3506,7 @@ const Input = ({
3508
3506
  zIndex: errorZindex ?? merge.INPUT.error.zIndex,
3509
3507
  lineHeight: errorLineHeight ?? merge.INPUT.error.lineHeight,
3510
3508
  top: errorMarginTop ? `calc(100% + ${errorMarginTop})` : `calc(100% + ${merge.INPUT.error.marginTop})`,
3511
- transform: !errorAnimation && !merge.INPUT.error.animation ? 'scale3d(1,1,1)' : transform ? transform : merge.INPUT.error.transform
3509
+ transform: 'scale3d(1,1,1)'
3512
3510
  },
3513
3511
  className: errorClassName ?? merge.INPUT.error.className
3514
3512
  }, innerErrorMessage) : '');
@@ -3530,7 +3528,6 @@ Input.propTypes = {
3530
3528
  padding: PropTypes__default["default"].string,
3531
3529
  tooltip: PropTypes__default["default"].element,
3532
3530
  withoutDot: PropTypes__default["default"].bool,
3533
- transform: PropTypes__default["default"].string,
3534
3531
  className: PropTypes__default["default"].string,
3535
3532
  iconWidth: PropTypes__default["default"].string,
3536
3533
  boxSizing: PropTypes__default["default"].string,
@@ -3555,7 +3552,6 @@ Input.propTypes = {
3555
3552
  errorMessage: PropTypes__default["default"].string,
3556
3553
  phoneDisplay: PropTypes__default["default"].string,
3557
3554
  autoComplete: PropTypes__default["default"].string,
3558
- errorAnimation: PropTypes__default["default"].bool,
3559
3555
  labelDisplay: PropTypes__default["default"].string,
3560
3556
  errorPosition: PropTypes__default["default"].string,
3561
3557
  errorMarginTop: PropTypes__default["default"].string,
@@ -3574,7 +3570,6 @@ Input.propTypes = {
3574
3570
  telBorderRightColor: PropTypes__default["default"].string,
3575
3571
  phoneJustifyContent: PropTypes__default["default"].string,
3576
3572
  backgroundDisableColor: PropTypes__default["default"].string,
3577
- errorAnimationDuration: PropTypes__default["default"].string,
3578
3573
  telBorderRightColorHover: PropTypes__default["default"].string,
3579
3574
  leftIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
3580
3575
  rightIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
package/tui.config.js CHANGED
@@ -111,10 +111,7 @@ export default {
111
111
  zIndex: '1',
112
112
  className: '',
113
113
  marginTop: '10px',
114
- animation: false,
115
- transform: 'scale3d(0,0,0)',
116
114
  lineHeight: '19px',
117
- animationDuration: '240ms',
118
115
 
119
116
  font: {...fontObject}
120
117
  },