@xaypay/tui 0.0.87 → 0.0.89

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
@@ -815,6 +815,9 @@ const Input = ({
815
815
  const handleMouseLeave = () => {
816
816
  setIsHover(false);
817
817
  };
818
+ const handleShowPass = () => {
819
+ setShow(!show);
820
+ };
818
821
  useEffect(() => {
819
822
  if (errorMessage) {
820
823
  setInnerErrorMessage(errorMessage);
@@ -876,10 +879,11 @@ const Input = ({
876
879
  onMouseEnter: handleMouseEnter,
877
880
  onMouseLeave: handleMouseLeave
878
881
  }, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/React__default.createElement("div", {
879
- onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
880
- onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
881
- onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
882
+ onClick: type === 'password' ? handleShowPass : _ => _,
882
883
  style: {
884
+ display: 'flex',
885
+ alignItems: 'center',
886
+ justifyContent: 'center',
883
887
  cursor: type === 'password' ? 'pointer' : 'default',
884
888
  height: height ? height : configStyles.INPUT.height,
885
889
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -931,10 +935,11 @@ const Input = ({
931
935
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
932
936
  }
933
937
  })), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
934
- onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
935
- onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
936
- onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
938
+ onClick: type === 'password' ? handleShowPass : _ => _,
937
939
  style: {
940
+ display: 'flex',
941
+ alignItems: 'center',
942
+ justifyContent: 'center',
938
943
  cursor: type === 'password' ? 'pointer' : 'default',
939
944
  height: height ? height : configStyles.INPUT.height,
940
945
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -1102,6 +1107,7 @@ const Button = ({
1102
1107
  textTransform,
1103
1108
  backgroundColor,
1104
1109
  disabledLineColor,
1110
+ btnIconMarginRight,
1105
1111
  backgroundHoverColor,
1106
1112
  disabledBackgroundColor,
1107
1113
  ...props
@@ -1124,12 +1130,12 @@ const Button = ({
1124
1130
  style: {
1125
1131
  display: 'flex',
1126
1132
  alignItems: 'center',
1133
+ justifyContent: 'center',
1127
1134
  fontSize: size ? size : configStyles.BUTTON.size,
1128
1135
  fontFamily: font ? font : configStyles.BUTTON.font,
1129
1136
  height: height ? height : configStyles.BUTTON.height,
1130
1137
  fontWeight: weight ? weight : configStyles.BUTTON.weight,
1131
1138
  padding: padding ? padding : configStyles.BUTTON.padding,
1132
- justifyContent: icon && label ? 'space-between' : 'center',
1133
1139
  borderRadius: radius ? radius : configStyles.BUTTON.radius,
1134
1140
  boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
1135
1141
  transition: transition ? transition : configStyles.BUTTON.transition,
@@ -1147,7 +1153,11 @@ const Button = ({
1147
1153
  onMouseEnter: handleMouseEnter,
1148
1154
  onMouseLeave: handleMouseLeave,
1149
1155
  className: classProps
1150
- }, props), icon && icon, " ", label && label, " ", !icon && !label && 'Add icon or label prop on Button component');
1156
+ }, props), icon && icon, " ", label && /*#__PURE__*/React__default.createElement("span", {
1157
+ style: {
1158
+ marginLeft: icon ? btnIconMarginRight ? btnIconMarginRight : configStyles.BUTTON.btnIconMarginRight : '0px'
1159
+ }
1160
+ }, label), " ", !icon && !label && 'Add icon or label prop on Button component');
1151
1161
  };
1152
1162
  Button.propTypes = {
1153
1163
  type: PropTypes.string,
@@ -1175,6 +1185,7 @@ Button.propTypes = {
1175
1185
  disabledColor: PropTypes.string,
1176
1186
  backgroundColor: PropTypes.string,
1177
1187
  disabledLineColor: PropTypes.string,
1188
+ btnIconMarginRight: PropTypes.string,
1178
1189
  backgroundHoverColor: PropTypes.string,
1179
1190
  disabledBackgroundColor: PropTypes.string
1180
1191
  };
@@ -1198,7 +1209,7 @@ const SvgArrow = ({
1198
1209
  fill: fillColor ? fillColor : '#3C393E'
1199
1210
  }));
1200
1211
 
1201
- var css_248z$9 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;width:100%;z-index:10}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1212
+ var css_248z$9 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;width:100%;z-index:99999999999}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1202
1213
  var styles$7 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
1203
1214
  styleInject(css_248z$9);
1204
1215
 
@@ -1422,7 +1433,7 @@ const Select = ({
1422
1433
  }
1423
1434
  }) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default.createElement("div", {
1424
1435
  className: `${styles$7['select-content-top-icon']}`
1425
- }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), showCloseIcon && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
1436
+ }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), (showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
1426
1437
  className: `${styles$7['close-icon']}`,
1427
1438
  onClick: disabled ? _ => _ : handleClearSelect,
1428
1439
  style: {
@@ -2198,14 +2209,13 @@ Stepper.propTypes = {
2198
2209
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
2199
2210
  // require the crypto API and do not support built-in fallback to lower quality random number
2200
2211
  // generators (like Math.random()).
2201
- var getRandomValues;
2202
- var rnds8 = new Uint8Array(16);
2212
+ let getRandomValues;
2213
+ const rnds8 = new Uint8Array(16);
2203
2214
  function rng() {
2204
2215
  // lazy load so that environments that need to polyfill have a chance to do so
2205
2216
  if (!getRandomValues) {
2206
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
2207
- // find the complete implementation of crypto (msCrypto) on IE11.
2208
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
2217
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
2218
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
2209
2219
 
2210
2220
  if (!getRandomValues) {
2211
2221
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
@@ -2215,43 +2225,35 @@ function rng() {
2215
2225
  return getRandomValues(rnds8);
2216
2226
  }
2217
2227
 
2218
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2219
-
2220
- function validate(uuid) {
2221
- return typeof uuid === 'string' && REGEX.test(uuid);
2222
- }
2223
-
2224
2228
  /**
2225
2229
  * Convert array of 16 byte values to UUID string format of the form:
2226
2230
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2227
2231
  */
2228
2232
 
2229
- var byteToHex = [];
2233
+ const byteToHex = [];
2230
2234
 
2231
- for (var i = 0; i < 256; ++i) {
2232
- byteToHex.push((i + 0x100).toString(16).substr(1));
2235
+ for (let i = 0; i < 256; ++i) {
2236
+ byteToHex.push((i + 0x100).toString(16).slice(1));
2233
2237
  }
2234
2238
 
2235
- function stringify(arr) {
2236
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2239
+ function unsafeStringify(arr, offset = 0) {
2237
2240
  // Note: Be careful editing this code! It's been tuned for performance
2238
2241
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2239
- var uuid = (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(); // Consistency check for valid UUID. If this throws, it's likely due to one
2240
- // of the following:
2241
- // - One or more input array values don't map to a hex octet (leading to
2242
- // "undefined" in the uuid)
2243
- // - Invalid input values for the RFC `version` or `variant` fields
2244
-
2245
- if (!validate(uuid)) {
2246
- throw TypeError('Stringified UUID is invalid');
2247
- }
2248
-
2249
- return uuid;
2242
+ 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();
2250
2243
  }
2251
2244
 
2245
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2246
+ var native = {
2247
+ randomUUID
2248
+ };
2249
+
2252
2250
  function v4(options, buf, offset) {
2251
+ if (native.randomUUID && !buf && !options) {
2252
+ return native.randomUUID();
2253
+ }
2254
+
2253
2255
  options = options || {};
2254
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2256
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2255
2257
 
2256
2258
  rnds[6] = rnds[6] & 0x0f | 0x40;
2257
2259
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
@@ -2259,14 +2261,14 @@ function v4(options, buf, offset) {
2259
2261
  if (buf) {
2260
2262
  offset = offset || 0;
2261
2263
 
2262
- for (var i = 0; i < 16; ++i) {
2264
+ for (let i = 0; i < 16; ++i) {
2263
2265
  buf[offset + i] = rnds[i];
2264
2266
  }
2265
2267
 
2266
2268
  return buf;
2267
2269
  }
2268
2270
 
2269
- return stringify(rnds);
2271
+ return unsafeStringify(rnds);
2270
2272
  }
2271
2273
 
2272
2274
  const SvgListItemPdf = ({
@@ -3984,7 +3986,7 @@ const NewAutocomplete = ({
3984
3986
  setId('');
3985
3987
  setInnerValue('');
3986
3988
  }
3987
- }, []);
3989
+ }, [selected]);
3988
3990
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label ? /*#__PURE__*/React__default.createElement("label", {
3989
3991
  style: {
3990
3992
  color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
package/dist/index.js CHANGED
@@ -845,6 +845,9 @@ const Input = ({
845
845
  const handleMouseLeave = () => {
846
846
  setIsHover(false);
847
847
  };
848
+ const handleShowPass = () => {
849
+ setShow(!show);
850
+ };
848
851
  React.useEffect(() => {
849
852
  if (errorMessage) {
850
853
  setInnerErrorMessage(errorMessage);
@@ -906,10 +909,11 @@ const Input = ({
906
909
  onMouseEnter: handleMouseEnter,
907
910
  onMouseLeave: handleMouseLeave
908
911
  }, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/React__default["default"].createElement("div", {
909
- onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
910
- onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
911
- onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
912
+ onClick: type === 'password' ? handleShowPass : _ => _,
912
913
  style: {
914
+ display: 'flex',
915
+ alignItems: 'center',
916
+ justifyContent: 'center',
913
917
  cursor: type === 'password' ? 'pointer' : 'default',
914
918
  height: height ? height : configStyles.INPUT.height,
915
919
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -961,10 +965,11 @@ const Input = ({
961
965
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
962
966
  }
963
967
  })), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
964
- onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
965
- onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
966
- onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
968
+ onClick: type === 'password' ? handleShowPass : _ => _,
967
969
  style: {
970
+ display: 'flex',
971
+ alignItems: 'center',
972
+ justifyContent: 'center',
968
973
  cursor: type === 'password' ? 'pointer' : 'default',
969
974
  height: height ? height : configStyles.INPUT.height,
970
975
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -1132,6 +1137,7 @@ const Button = ({
1132
1137
  textTransform,
1133
1138
  backgroundColor,
1134
1139
  disabledLineColor,
1140
+ btnIconMarginRight,
1135
1141
  backgroundHoverColor,
1136
1142
  disabledBackgroundColor,
1137
1143
  ...props
@@ -1154,12 +1160,12 @@ const Button = ({
1154
1160
  style: {
1155
1161
  display: 'flex',
1156
1162
  alignItems: 'center',
1163
+ justifyContent: 'center',
1157
1164
  fontSize: size ? size : configStyles.BUTTON.size,
1158
1165
  fontFamily: font ? font : configStyles.BUTTON.font,
1159
1166
  height: height ? height : configStyles.BUTTON.height,
1160
1167
  fontWeight: weight ? weight : configStyles.BUTTON.weight,
1161
1168
  padding: padding ? padding : configStyles.BUTTON.padding,
1162
- justifyContent: icon && label ? 'space-between' : 'center',
1163
1169
  borderRadius: radius ? radius : configStyles.BUTTON.radius,
1164
1170
  boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
1165
1171
  transition: transition ? transition : configStyles.BUTTON.transition,
@@ -1177,7 +1183,11 @@ const Button = ({
1177
1183
  onMouseEnter: handleMouseEnter,
1178
1184
  onMouseLeave: handleMouseLeave,
1179
1185
  className: classProps
1180
- }, props), icon && icon, " ", label && label, " ", !icon && !label && 'Add icon or label prop on Button component');
1186
+ }, props), icon && icon, " ", label && /*#__PURE__*/React__default["default"].createElement("span", {
1187
+ style: {
1188
+ marginLeft: icon ? btnIconMarginRight ? btnIconMarginRight : configStyles.BUTTON.btnIconMarginRight : '0px'
1189
+ }
1190
+ }, label), " ", !icon && !label && 'Add icon or label prop on Button component');
1181
1191
  };
1182
1192
  Button.propTypes = {
1183
1193
  type: PropTypes__default["default"].string,
@@ -1205,6 +1215,7 @@ Button.propTypes = {
1205
1215
  disabledColor: PropTypes__default["default"].string,
1206
1216
  backgroundColor: PropTypes__default["default"].string,
1207
1217
  disabledLineColor: PropTypes__default["default"].string,
1218
+ btnIconMarginRight: PropTypes__default["default"].string,
1208
1219
  backgroundHoverColor: PropTypes__default["default"].string,
1209
1220
  disabledBackgroundColor: PropTypes__default["default"].string
1210
1221
  };
@@ -1228,7 +1239,7 @@ const SvgArrow = ({
1228
1239
  fill: fillColor ? fillColor : '#3C393E'
1229
1240
  }));
1230
1241
 
1231
- var css_248z$9 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;width:100%;z-index:10}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1242
+ var css_248z$9 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;width:100%;z-index:99999999999}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;box-sizing:content-box;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1232
1243
  var styles$7 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
1233
1244
  styleInject(css_248z$9);
1234
1245
 
@@ -1452,7 +1463,7 @@ const Select = ({
1452
1463
  }
1453
1464
  }) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default["default"].createElement("div", {
1454
1465
  className: `${styles$7['select-content-top-icon']}`
1455
- }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), showCloseIcon && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
1466
+ }, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), (showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
1456
1467
  className: `${styles$7['close-icon']}`,
1457
1468
  onClick: disabled ? _ => _ : handleClearSelect,
1458
1469
  style: {
@@ -2228,14 +2239,13 @@ Stepper.propTypes = {
2228
2239
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
2229
2240
  // require the crypto API and do not support built-in fallback to lower quality random number
2230
2241
  // generators (like Math.random()).
2231
- var getRandomValues;
2232
- var rnds8 = new Uint8Array(16);
2242
+ let getRandomValues;
2243
+ const rnds8 = new Uint8Array(16);
2233
2244
  function rng() {
2234
2245
  // lazy load so that environments that need to polyfill have a chance to do so
2235
2246
  if (!getRandomValues) {
2236
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
2237
- // find the complete implementation of crypto (msCrypto) on IE11.
2238
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
2247
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
2248
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
2239
2249
 
2240
2250
  if (!getRandomValues) {
2241
2251
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
@@ -2245,43 +2255,35 @@ function rng() {
2245
2255
  return getRandomValues(rnds8);
2246
2256
  }
2247
2257
 
2248
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2249
-
2250
- function validate(uuid) {
2251
- return typeof uuid === 'string' && REGEX.test(uuid);
2252
- }
2253
-
2254
2258
  /**
2255
2259
  * Convert array of 16 byte values to UUID string format of the form:
2256
2260
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2257
2261
  */
2258
2262
 
2259
- var byteToHex = [];
2263
+ const byteToHex = [];
2260
2264
 
2261
- for (var i = 0; i < 256; ++i) {
2262
- byteToHex.push((i + 0x100).toString(16).substr(1));
2265
+ for (let i = 0; i < 256; ++i) {
2266
+ byteToHex.push((i + 0x100).toString(16).slice(1));
2263
2267
  }
2264
2268
 
2265
- function stringify(arr) {
2266
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2269
+ function unsafeStringify(arr, offset = 0) {
2267
2270
  // Note: Be careful editing this code! It's been tuned for performance
2268
2271
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2269
- var uuid = (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(); // Consistency check for valid UUID. If this throws, it's likely due to one
2270
- // of the following:
2271
- // - One or more input array values don't map to a hex octet (leading to
2272
- // "undefined" in the uuid)
2273
- // - Invalid input values for the RFC `version` or `variant` fields
2274
-
2275
- if (!validate(uuid)) {
2276
- throw TypeError('Stringified UUID is invalid');
2277
- }
2278
-
2279
- return uuid;
2272
+ 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();
2280
2273
  }
2281
2274
 
2275
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2276
+ var native = {
2277
+ randomUUID
2278
+ };
2279
+
2282
2280
  function v4(options, buf, offset) {
2281
+ if (native.randomUUID && !buf && !options) {
2282
+ return native.randomUUID();
2283
+ }
2284
+
2283
2285
  options = options || {};
2284
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2286
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2285
2287
 
2286
2288
  rnds[6] = rnds[6] & 0x0f | 0x40;
2287
2289
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
@@ -2289,14 +2291,14 @@ function v4(options, buf, offset) {
2289
2291
  if (buf) {
2290
2292
  offset = offset || 0;
2291
2293
 
2292
- for (var i = 0; i < 16; ++i) {
2294
+ for (let i = 0; i < 16; ++i) {
2293
2295
  buf[offset + i] = rnds[i];
2294
2296
  }
2295
2297
 
2296
2298
  return buf;
2297
2299
  }
2298
2300
 
2299
- return stringify(rnds);
2301
+ return unsafeStringify(rnds);
2300
2302
  }
2301
2303
 
2302
2304
  const SvgListItemPdf = ({
@@ -4014,7 +4016,7 @@ const NewAutocomplete = ({
4014
4016
  setId('');
4015
4017
  setInnerValue('');
4016
4018
  }
4017
- }, []);
4019
+ }, [selected]);
4018
4020
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
4019
4021
  style: {
4020
4022
  color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -29,6 +29,7 @@ export const Button = ({
29
29
  textTransform,
30
30
  backgroundColor,
31
31
  disabledLineColor,
32
+ btnIconMarginRight,
32
33
  backgroundHoverColor,
33
34
  disabledBackgroundColor,
34
35
  ...props
@@ -60,12 +61,12 @@ export const Button = ({
60
61
  style={{
61
62
  display: 'flex',
62
63
  alignItems: 'center',
64
+ justifyContent: 'center',
63
65
  fontSize: size ? size : configStyles.BUTTON.size,
64
66
  fontFamily: font ? font : configStyles.BUTTON.font,
65
67
  height: height ? height : configStyles.BUTTON.height,
66
68
  fontWeight: weight ? weight : configStyles.BUTTON.weight,
67
69
  padding: padding ? padding : configStyles.BUTTON.padding,
68
- justifyContent: icon && label? 'space-between' : 'center',
69
70
  borderRadius: radius ? radius : configStyles.BUTTON.radius,
70
71
  boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
71
72
  transition: transition ? transition : configStyles.BUTTON.transition,
@@ -98,7 +99,7 @@ export const Button = ({
98
99
  className={classProps}
99
100
  {...props}
100
101
  >
101
- {icon && icon} {label && label} {!icon && !label && 'Add icon or label prop on Button component'}
102
+ {icon && icon} {label && <span style={{ marginLeft: icon ? btnIconMarginRight ? btnIconMarginRight : configStyles.BUTTON.btnIconMarginRight : '0px' }}>{ label }</span>} {!icon && !label && 'Add icon or label prop on Button component'}
102
103
  </button>
103
104
  );
104
105
  };
@@ -129,6 +130,7 @@ Button.propTypes = {
129
130
  disabledColor: PropTypes.string,
130
131
  backgroundColor: PropTypes.string,
131
132
  disabledLineColor: PropTypes.string,
133
+ btnIconMarginRight: PropTypes.string,
132
134
  backgroundHoverColor: PropTypes.string,
133
135
  disabledBackgroundColor: PropTypes.string
134
136
  };
@@ -178,6 +178,10 @@ export const Input = ({
178
178
  setIsHover(false);
179
179
  };
180
180
 
181
+ const handleShowPass = () => {
182
+ setShow(!show);
183
+ };
184
+
181
185
  useEffect(() => {
182
186
  if (errorMessage) {
183
187
  setInnerErrorMessage(errorMessage);
@@ -248,10 +252,11 @@ export const Input = ({
248
252
  {
249
253
  leftIcon && leftIcon.length > 0 && type != 'tel' ?
250
254
  <div
251
- onMouseUp={type === 'password' ? _ => setShow(false) : _ => _}
252
- onMouseDown={type === 'password' ? _ => setShow(true) : _ => _}
253
- onMouseOut={type === 'password' ? _ => setShow(false) : _ => _}
255
+ onClick={type === 'password' ? handleShowPass : _ => _}
254
256
  style={{
257
+ display: 'flex',
258
+ alignItems: 'center',
259
+ justifyContent: 'center',
255
260
  cursor: type === 'password' ? 'pointer' : 'default',
256
261
  height: height ? height : configStyles.INPUT.height,
257
262
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -324,10 +329,11 @@ export const Input = ({
324
329
  {
325
330
  rightIcon && rightIcon.length > 0 ?
326
331
  <div
327
- onMouseUp={type === 'password' ? _ => setShow(false) : _ => _}
328
- onMouseDown={type === 'password' ? _ => setShow(true) : _ => _}
329
- onMouseOut={type === 'password' ? _ => setShow(false) : _ => _}
332
+ onClick={type === 'password' ? handleShowPass : _ => _}
330
333
  style={{
334
+ display: 'flex',
335
+ alignItems: 'center',
336
+ justifyContent: 'center',
331
337
  cursor: type === 'password' ? 'pointer' : 'default',
332
338
  height: height ? height : configStyles.INPUT.height,
333
339
  padding: padding ? padding : configStyles.INPUT.padding,
@@ -19,6 +19,7 @@ export default {
19
19
 
20
20
  const Template = (args) => {
21
21
  const [newOptions, setNewOptions] = useState([]);
22
+ const [sel, setSel] = useState({ "bbb":"0", "name":"gasdfgdsfgdsg" });
22
23
  const handleClick = (selected) => {
23
24
  console.log(selected, 'selected');
24
25
  };
@@ -42,7 +43,14 @@ const Template = (args) => {
42
43
  });
43
44
  };
44
45
 
45
- return <NewAutocomplete {...args} getItem={handleClick} selected={{ "bbb":"0", "name":"gasdfgdsfgdsg" }} options={newOptions} change={handleChange} />
46
+ return (
47
+ <>
48
+ <NewAutocomplete {...args} getItem={handleClick} selected={sel} options={newOptions} change={handleChange} />
49
+ <button style={{ padding: '15px', cursor: 'pointer', margin: '10px 15px 0px 0px', borderRadius: '10px', fontSize: '22px' }} onClick={_ => setSel({ "bbb":"0", "name":"gasdfgdsfgdsg" })}>reset selected</button>
50
+ <button style={{ padding: '15px', cursor: 'pointer', margin: '10px 15px 0px 0px', borderRadius: '10px', fontSize: '22px' }} onClick={_ => setSel({ "dd": "1", "name": "just ok" })}>change selected</button>
51
+ <button style={{ padding: '15px', cursor: 'pointer', margin: '10px 15px 0px 0px', borderRadius: '10px', fontSize: '22px' }} onClick={_ => setSel({ "dd": "", "name": "" })}>empty selected</button>
52
+ </>
53
+ );
46
54
  };
47
55
  export const Default = Template.bind({});
48
56
  Default.args = {
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { keyframes, css } from 'styled-components';
5
5
 
6
6
  import { compereConfigs } from './../../utils';
7
-
7
+
8
8
  export const NewAutocomplete = ({
9
9
  label,
10
10
  change,
@@ -270,8 +270,8 @@ export const NewAutocomplete = ({
270
270
  setId('');
271
271
  setInnerValue('');
272
272
  }
273
- }, []);
274
-
273
+ }, [selected]);
274
+
275
275
  return (
276
276
  <>
277
277
  {
@@ -267,7 +267,7 @@ export const Select = ({
267
267
  !disabled && multiple && newSelected.length > 1 && <span>{newSelected.length}</span>
268
268
  }
269
269
 
270
- {showCloseIcon && !disabled && newSelected && newSelected.length > 0 &&
270
+ {(showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 &&
271
271
  <div
272
272
  className={`${styles['close-icon']}`}
273
273
  onClick={disabled ? _ => _ : handleClearSelect}
@@ -16,7 +16,7 @@
16
16
  position: absolute;
17
17
  width: 100%;
18
18
  left: 0px;
19
- z-index: 10;
19
+ z-index: 99999999999;
20
20
  max-height: 0;
21
21
  overflow: hidden;
22
22
  animation: select-show 640ms linear forwards;
@@ -145,7 +145,8 @@ import StackAlt from './assets/stackalt.svg';
145
145
  disabledBackgroundColor: 'rgba(238, 238, 238, 1)', // for background color in disabled mode
146
146
  transition: 'background-color 240ms, color 240ms', // for transition
147
147
  hoverColor: '#001745', // for hover color
148
- backgroundHoverColor: '#CB3A3A' // for hover background color
148
+ backgroundHoverColor: '#CB3A3A', // for hover background color
149
+ btnIconMarginRight: '5px' // for button icon margin right
149
150
  }
150
151
  ```
151
152
 
package/tui.config.js CHANGED
@@ -22,7 +22,8 @@ module.exports = {
22
22
  disabledBackgroundColor: 'rgba(238, 238, 238, 1)', // for background color in disabled mode
23
23
  transition: 'background-color 240ms, color 240ms', // for transition
24
24
  hoverColor: '#001745', // for hover color
25
- backgroundHoverColor: '#CB3A3A' // for hover background color
25
+ backgroundHoverColor: '#CB3A3A', // for hover background color
26
+ btnIconMarginRight: '5px' // for button icon margin right
26
27
  },
27
28
  // default properties for <Input /> component
28
29
  INPUT: {
@@ -180,6 +181,7 @@ module.exports = {
180
181
  },
181
182
  // default properties for <Select /> component
182
183
  SELECT: {
184
+ showCloseIcon: true, // for select reset icon, when prop exist or true is show, otherwise is hide
183
185
  marginTop: '10px', // for error message postion from top
184
186
  labelWeight: '500', // for label font weight
185
187
  labelColor: '#3C393E', // for label color