@xaypay/tui 0.2.2 → 0.2.3

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
@@ -72,18 +72,13 @@ function v4(options, buf, offset) {
72
72
  }
73
73
 
74
74
  function _extends() {
75
- _extends = Object.assign ? Object.assign.bind() : function (target) {
76
- for (var i = 1; i < arguments.length; i++) {
77
- var source = arguments[i];
78
- for (var key in source) {
79
- if (Object.prototype.hasOwnProperty.call(source, key)) {
80
- target[key] = source[key];
81
- }
82
- }
75
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
76
+ for (var e = 1; e < arguments.length; e++) {
77
+ var t = arguments[e];
78
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
83
79
  }
84
- return target;
85
- };
86
- return _extends.apply(this, arguments);
80
+ return n;
81
+ }, _extends.apply(null, arguments);
87
82
  }
88
83
 
89
84
  const SvgHeic = ({
@@ -1097,7 +1092,7 @@ var packageResult = {
1097
1092
  marginLeft: '10px'
1098
1093
  }
1099
1094
 
1100
- // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
1095
+ // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
1101
1096
  // unCheckedIcon: React.createElement(<SvgUnchecked fill="#E00" />),
1102
1097
  },
1103
1098
  // default properties for <Table /> component
@@ -2178,9 +2173,9 @@ const Checkbox$1 = ({
2178
2173
  },
2179
2174
  onClick: !innerDisabled && handleChecked ? handleClick : _ => _
2180
2175
  }, innerChecked && (ignoreDisabledForChecked ?? !innerDisabled) ? checkedIcon ? checkedIcon : /*#__PURE__*/React__default.createElement(SvgCheckboxChecked, {
2181
- fillColor: checkedColor ?? configStylesPromise.CHECKBOX.checkedColor
2176
+ fillColor: checkedColor
2182
2177
  }) : unCheckedIcon ? unCheckedIcon : /*#__PURE__*/React__default.createElement(SvgCheckboxUnchecked, {
2183
- fillColor: unCheckedColor ?? configStylesPromise.CHECKBOX.unCheckedColor
2178
+ fillColor: unCheckedColor
2184
2179
  }), label && /*#__PURE__*/React__default.createElement("span", {
2185
2180
  style: {
2186
2181
  marginLeft: labelMarginLeft
@@ -2229,12 +2224,12 @@ const SingleCheckbox = ({
2229
2224
  disabled: disabled,
2230
2225
  innerIndex: innerIndex,
2231
2226
  checkedIcon: checkedIcon,
2232
- checkedColor: checkedColor,
2233
2227
  unCheckedIcon: unCheckedIcon,
2234
2228
  handleChecked: handleChecked,
2235
- unCheckedColor: unCheckedColor,
2236
2229
  ignoreDisabledForChecked: ignoreDisabledForChecked,
2237
- labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.labelMarginLeft
2230
+ checkedColor: checkedColor ?? configStyles.CHECKBOX.colors.checked,
2231
+ unCheckedColor: unCheckedColor ?? configStyles.CHECKBOX.colors.unChecked,
2232
+ labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft
2238
2233
  });
2239
2234
  };
2240
2235
  SingleCheckbox.propTypes = {
@@ -4149,6 +4144,7 @@ const Input = ({
4149
4144
  const [show, setShow] = useState(false);
4150
4145
  const [isHover, setIsHover] = useState(false);
4151
4146
  const [classProps, setClassProps] = useState({});
4147
+ const [innerValue, setInnerValue] = useState('');
4152
4148
  const [configStyles, setConfigStyles] = useState({});
4153
4149
  const [innerErrorMessage, setInnerErrorMessage] = useState('');
4154
4150
  const inpStyles = configStyles.INPUT && {
@@ -4202,6 +4198,10 @@ const Input = ({
4202
4198
  !regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
4203
4199
  }
4204
4200
  }, [type, regexp, errorMessage, regexpErrorMessage]);
4201
+ useEffect(() => {
4202
+ const val = typeof value === 'number' ? value.toString() : value;
4203
+ setInnerValue(() => val);
4204
+ }, [value]);
4205
4205
  useEffect(() => {
4206
4206
  configStylesPromise.then(data => {
4207
4207
  setClassProps(() => classnames(className ?? data.INPUT.className, type === 'number' ? styles$7['inp-num'] : '', styles$7['input-wrap']));
@@ -4253,7 +4253,7 @@ const Input = ({
4253
4253
  }
4254
4254
  }, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/React__default.createElement(TelInput, {
4255
4255
  type: type,
4256
- value: value,
4256
+ value: innerValue,
4257
4257
  inputChange: change,
4258
4258
  isHover: isHover,
4259
4259
  disabled: disabled,
@@ -4268,8 +4268,8 @@ const Input = ({
4268
4268
  telBorderRightColor: telBorderRightColor ?? configStyles.INPUT.tel.borderRight.color,
4269
4269
  telBorderRightColorHover: telBorderRightColorHover ?? configStyles.INPUT.tel.borderRight.colors.hover
4270
4270
  }) : type === 'number' ? /*#__PURE__*/React__default.createElement(NumberInput, {
4271
- value: value,
4272
4271
  dots: withoutDot,
4272
+ value: innerValue,
4273
4273
  float: floatToFix,
4274
4274
  disabled: disabled,
4275
4275
  inputChange: change,
@@ -4282,7 +4282,7 @@ const Input = ({
4282
4282
  }) : type === 'password' ? /*#__PURE__*/React__default.createElement(PassInput, {
4283
4283
  show: show,
4284
4284
  type: type,
4285
- value: value,
4285
+ value: innerValue,
4286
4286
  disabled: disabled,
4287
4287
  inputChange: change,
4288
4288
  maxLength: maxLength,
@@ -4290,7 +4290,7 @@ const Input = ({
4290
4290
  inpAttributes: inpAttributes,
4291
4291
  radius: radius ?? configStyles.INPUT.radius
4292
4292
  }) : /*#__PURE__*/React__default.createElement(TextInput, {
4293
- value: value,
4293
+ value: innerValue,
4294
4294
  disabled: disabled,
4295
4295
  inputChange: change,
4296
4296
  inpStyles: inpStyles,
@@ -4395,7 +4395,7 @@ Input.propTypes = {
4395
4395
  leftIcon: PropTypes.arrayOf(PropTypes.element),
4396
4396
  rightIcon: PropTypes.arrayOf(PropTypes.element),
4397
4397
  type: PropTypes.oneOf(Object.values(InputTypes)),
4398
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
4398
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])
4399
4399
  };
4400
4400
 
4401
4401
  const RadioDirectionMode = {
@@ -5830,12 +5830,12 @@ const Checkbox = ({
5830
5830
  label: item[innerKeyNames.label],
5831
5831
  checked: item[innerKeyNames.checked],
5832
5832
  disabled: item[innerKeyNames.disabled],
5833
- ignoreDisabledForChecked: item[innerKeyNames.ignoreDisabledForChecked],
5834
- labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft,
5833
+ checkedIcon: checkedIcon ?? configStyles.CHECKBOX.checkedIcon,
5835
5834
  checkedColor: checkedColor ?? configStyles.CHECKBOX.colors.checked,
5835
+ unCheckedIcon: unCheckedIcon ?? configStyles.CHECKBOX.unCheckedIcon,
5836
+ ignoreDisabledForChecked: item[innerKeyNames.ignoreDisabledForChecked],
5836
5837
  unCheckedColor: unCheckedColor ?? configStyles.CHECKBOX.colors.unChecked,
5837
- checkedIcon: checkedIcon ?? configStyles.CHECKBOX.checkedIcon,
5838
- unCheckedIcon: unCheckedIcon ?? configStyles.CHECKBOX.unCheckedIcon
5838
+ labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft
5839
5839
  }));
5840
5840
  }));
5841
5841
  };
@@ -6288,6 +6288,20 @@ const Pagination = ({
6288
6288
  const [configStyles, setConfigStyles] = useState({});
6289
6289
  const [currentPageNumber, setCurrentPage] = useState(currentPage);
6290
6290
  const [currentTotalCount, setcurrentTotalCount] = useState(totalCount);
6291
+ useEffect(() => {
6292
+ configStylesPromise.then(data => {
6293
+ setClassProps(() => classnames(
6294
+ // TODO: check and remove pagination-bar-rem class
6295
+ styles$1.list, className ?? data.PAGINATION.className, `${styles$1['pagination-bar']} pagination-bar-rem`));
6296
+ setConfigStyles(() => {
6297
+ return {
6298
+ ...data
6299
+ };
6300
+ });
6301
+ }, error => {
6302
+ console.error(error);
6303
+ });
6304
+ }, []);
6291
6305
  useEffect(() => {
6292
6306
  setcurrentTotalCount(totalCount);
6293
6307
  }, [totalCount]);
@@ -6357,20 +6371,6 @@ const Pagination = ({
6357
6371
  }
6358
6372
  };
6359
6373
  let lastPage = paginationRange[paginationRange.length - 1];
6360
- useEffect(() => {
6361
- configStylesPromise.then(data => {
6362
- setClassProps(() => classnames(
6363
- // TODO: check and remove pagination-bar-rem class
6364
- styles$1.list, className ?? data.PAGINATION.className, `${styles$1['pagination-bar']} pagination-bar-rem`));
6365
- setConfigStyles(() => {
6366
- return {
6367
- ...data
6368
- };
6369
- });
6370
- }, error => {
6371
- console.error(error);
6372
- });
6373
- }, []);
6374
6374
  return configStyles.PAGINATION && /*#__PURE__*/React__default.createElement("div", {
6375
6375
  style: {
6376
6376
  display: 'flex',
package/dist/index.js CHANGED
@@ -103,18 +103,13 @@ function v4(options, buf, offset) {
103
103
  }
104
104
 
105
105
  function _extends() {
106
- _extends = Object.assign ? Object.assign.bind() : function (target) {
107
- for (var i = 1; i < arguments.length; i++) {
108
- var source = arguments[i];
109
- for (var key in source) {
110
- if (Object.prototype.hasOwnProperty.call(source, key)) {
111
- target[key] = source[key];
112
- }
113
- }
106
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
107
+ for (var e = 1; e < arguments.length; e++) {
108
+ var t = arguments[e];
109
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
114
110
  }
115
- return target;
116
- };
117
- return _extends.apply(this, arguments);
111
+ return n;
112
+ }, _extends.apply(null, arguments);
118
113
  }
119
114
 
120
115
  const SvgHeic = ({
@@ -1128,7 +1123,7 @@ var packageResult = {
1128
1123
  marginLeft: '10px'
1129
1124
  }
1130
1125
 
1131
- // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
1126
+ // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
1132
1127
  // unCheckedIcon: React.createElement(<SvgUnchecked fill="#E00" />),
1133
1128
  },
1134
1129
  // default properties for <Table /> component
@@ -2209,9 +2204,9 @@ const Checkbox$1 = ({
2209
2204
  },
2210
2205
  onClick: !innerDisabled && handleChecked ? handleClick : _ => _
2211
2206
  }, innerChecked && (ignoreDisabledForChecked ?? !innerDisabled) ? checkedIcon ? checkedIcon : /*#__PURE__*/React__default["default"].createElement(SvgCheckboxChecked, {
2212
- fillColor: checkedColor ?? configStylesPromise.CHECKBOX.checkedColor
2207
+ fillColor: checkedColor
2213
2208
  }) : unCheckedIcon ? unCheckedIcon : /*#__PURE__*/React__default["default"].createElement(SvgCheckboxUnchecked, {
2214
- fillColor: unCheckedColor ?? configStylesPromise.CHECKBOX.unCheckedColor
2209
+ fillColor: unCheckedColor
2215
2210
  }), label && /*#__PURE__*/React__default["default"].createElement("span", {
2216
2211
  style: {
2217
2212
  marginLeft: labelMarginLeft
@@ -2260,12 +2255,12 @@ const SingleCheckbox = ({
2260
2255
  disabled: disabled,
2261
2256
  innerIndex: innerIndex,
2262
2257
  checkedIcon: checkedIcon,
2263
- checkedColor: checkedColor,
2264
2258
  unCheckedIcon: unCheckedIcon,
2265
2259
  handleChecked: handleChecked,
2266
- unCheckedColor: unCheckedColor,
2267
2260
  ignoreDisabledForChecked: ignoreDisabledForChecked,
2268
- labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.labelMarginLeft
2261
+ checkedColor: checkedColor ?? configStyles.CHECKBOX.colors.checked,
2262
+ unCheckedColor: unCheckedColor ?? configStyles.CHECKBOX.colors.unChecked,
2263
+ labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft
2269
2264
  });
2270
2265
  };
2271
2266
  SingleCheckbox.propTypes = {
@@ -4180,6 +4175,7 @@ const Input = ({
4180
4175
  const [show, setShow] = React.useState(false);
4181
4176
  const [isHover, setIsHover] = React.useState(false);
4182
4177
  const [classProps, setClassProps] = React.useState({});
4178
+ const [innerValue, setInnerValue] = React.useState('');
4183
4179
  const [configStyles, setConfigStyles] = React.useState({});
4184
4180
  const [innerErrorMessage, setInnerErrorMessage] = React.useState('');
4185
4181
  const inpStyles = configStyles.INPUT && {
@@ -4233,6 +4229,10 @@ const Input = ({
4233
4229
  !regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
4234
4230
  }
4235
4231
  }, [type, regexp, errorMessage, regexpErrorMessage]);
4232
+ React.useEffect(() => {
4233
+ const val = typeof value === 'number' ? value.toString() : value;
4234
+ setInnerValue(() => val);
4235
+ }, [value]);
4236
4236
  React.useEffect(() => {
4237
4237
  configStylesPromise.then(data => {
4238
4238
  setClassProps(() => classnames__default["default"](className ?? data.INPUT.className, type === 'number' ? styles$7['inp-num'] : '', styles$7['input-wrap']));
@@ -4284,7 +4284,7 @@ const Input = ({
4284
4284
  }
4285
4285
  }, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/React__default["default"].createElement(TelInput, {
4286
4286
  type: type,
4287
- value: value,
4287
+ value: innerValue,
4288
4288
  inputChange: change,
4289
4289
  isHover: isHover,
4290
4290
  disabled: disabled,
@@ -4299,8 +4299,8 @@ const Input = ({
4299
4299
  telBorderRightColor: telBorderRightColor ?? configStyles.INPUT.tel.borderRight.color,
4300
4300
  telBorderRightColorHover: telBorderRightColorHover ?? configStyles.INPUT.tel.borderRight.colors.hover
4301
4301
  }) : type === 'number' ? /*#__PURE__*/React__default["default"].createElement(NumberInput, {
4302
- value: value,
4303
4302
  dots: withoutDot,
4303
+ value: innerValue,
4304
4304
  float: floatToFix,
4305
4305
  disabled: disabled,
4306
4306
  inputChange: change,
@@ -4313,7 +4313,7 @@ const Input = ({
4313
4313
  }) : type === 'password' ? /*#__PURE__*/React__default["default"].createElement(PassInput, {
4314
4314
  show: show,
4315
4315
  type: type,
4316
- value: value,
4316
+ value: innerValue,
4317
4317
  disabled: disabled,
4318
4318
  inputChange: change,
4319
4319
  maxLength: maxLength,
@@ -4321,7 +4321,7 @@ const Input = ({
4321
4321
  inpAttributes: inpAttributes,
4322
4322
  radius: radius ?? configStyles.INPUT.radius
4323
4323
  }) : /*#__PURE__*/React__default["default"].createElement(TextInput, {
4324
- value: value,
4324
+ value: innerValue,
4325
4325
  disabled: disabled,
4326
4326
  inputChange: change,
4327
4327
  inpStyles: inpStyles,
@@ -4426,7 +4426,7 @@ Input.propTypes = {
4426
4426
  leftIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
4427
4427
  rightIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
4428
4428
  type: PropTypes__default["default"].oneOf(Object.values(InputTypes)),
4429
- value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].object])
4429
+ value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number, PropTypes__default["default"].object])
4430
4430
  };
4431
4431
 
4432
4432
  const RadioDirectionMode = {
@@ -5861,12 +5861,12 @@ const Checkbox = ({
5861
5861
  label: item[innerKeyNames.label],
5862
5862
  checked: item[innerKeyNames.checked],
5863
5863
  disabled: item[innerKeyNames.disabled],
5864
- ignoreDisabledForChecked: item[innerKeyNames.ignoreDisabledForChecked],
5865
- labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft,
5864
+ checkedIcon: checkedIcon ?? configStyles.CHECKBOX.checkedIcon,
5866
5865
  checkedColor: checkedColor ?? configStyles.CHECKBOX.colors.checked,
5866
+ unCheckedIcon: unCheckedIcon ?? configStyles.CHECKBOX.unCheckedIcon,
5867
+ ignoreDisabledForChecked: item[innerKeyNames.ignoreDisabledForChecked],
5867
5868
  unCheckedColor: unCheckedColor ?? configStyles.CHECKBOX.colors.unChecked,
5868
- checkedIcon: checkedIcon ?? configStyles.CHECKBOX.checkedIcon,
5869
- unCheckedIcon: unCheckedIcon ?? configStyles.CHECKBOX.unCheckedIcon
5869
+ labelMarginLeft: labelMarginLeft ?? configStyles.CHECKBOX.label.marginLeft
5870
5870
  }));
5871
5871
  }));
5872
5872
  };
@@ -6319,6 +6319,20 @@ const Pagination = ({
6319
6319
  const [configStyles, setConfigStyles] = React.useState({});
6320
6320
  const [currentPageNumber, setCurrentPage] = React.useState(currentPage);
6321
6321
  const [currentTotalCount, setcurrentTotalCount] = React.useState(totalCount);
6322
+ React.useEffect(() => {
6323
+ configStylesPromise.then(data => {
6324
+ setClassProps(() => classnames__default["default"](
6325
+ // TODO: check and remove pagination-bar-rem class
6326
+ styles$1.list, className ?? data.PAGINATION.className, `${styles$1['pagination-bar']} pagination-bar-rem`));
6327
+ setConfigStyles(() => {
6328
+ return {
6329
+ ...data
6330
+ };
6331
+ });
6332
+ }, error => {
6333
+ console.error(error);
6334
+ });
6335
+ }, []);
6322
6336
  React.useEffect(() => {
6323
6337
  setcurrentTotalCount(totalCount);
6324
6338
  }, [totalCount]);
@@ -6388,20 +6402,6 @@ const Pagination = ({
6388
6402
  }
6389
6403
  };
6390
6404
  let lastPage = paginationRange[paginationRange.length - 1];
6391
- React.useEffect(() => {
6392
- configStylesPromise.then(data => {
6393
- setClassProps(() => classnames__default["default"](
6394
- // TODO: check and remove pagination-bar-rem class
6395
- styles$1.list, className ?? data.PAGINATION.className, `${styles$1['pagination-bar']} pagination-bar-rem`));
6396
- setConfigStyles(() => {
6397
- return {
6398
- ...data
6399
- };
6400
- });
6401
- }, error => {
6402
- console.error(error);
6403
- });
6404
- }, []);
6405
6405
  return configStyles.PAGINATION && /*#__PURE__*/React__default["default"].createElement("div", {
6406
6406
  style: {
6407
6407
  display: 'flex',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -82,5 +82,8 @@
82
82
  "prettier --write",
83
83
  "eslint --max-warnings=0"
84
84
  ]
85
+ },
86
+ "volta": {
87
+ "node": "20.14.0"
85
88
  }
86
89
  }
package/tui.config.js CHANGED
@@ -711,7 +711,7 @@ export default {
711
711
  marginLeft: '10px',
712
712
  }
713
713
 
714
- // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
714
+ // checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
715
715
  // unCheckedIcon: React.createElement(<SvgUnchecked fill="#E00" />),
716
716
  },
717
717
  // default properties for <Table /> component