@xaypay/tui 0.0.88 → 0.0.90

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
@@ -2209,14 +2209,13 @@ Stepper.propTypes = {
2209
2209
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
2210
2210
  // require the crypto API and do not support built-in fallback to lower quality random number
2211
2211
  // generators (like Math.random()).
2212
- var getRandomValues;
2213
- var rnds8 = new Uint8Array(16);
2212
+ let getRandomValues;
2213
+ const rnds8 = new Uint8Array(16);
2214
2214
  function rng() {
2215
2215
  // lazy load so that environments that need to polyfill have a chance to do so
2216
2216
  if (!getRandomValues) {
2217
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
2218
- // find the complete implementation of crypto (msCrypto) on IE11.
2219
- 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);
2220
2219
 
2221
2220
  if (!getRandomValues) {
2222
2221
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
@@ -2226,43 +2225,35 @@ function rng() {
2226
2225
  return getRandomValues(rnds8);
2227
2226
  }
2228
2227
 
2229
- 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;
2230
-
2231
- function validate(uuid) {
2232
- return typeof uuid === 'string' && REGEX.test(uuid);
2233
- }
2234
-
2235
2228
  /**
2236
2229
  * Convert array of 16 byte values to UUID string format of the form:
2237
2230
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2238
2231
  */
2239
2232
 
2240
- var byteToHex = [];
2233
+ const byteToHex = [];
2241
2234
 
2242
- for (var i = 0; i < 256; ++i) {
2243
- 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));
2244
2237
  }
2245
2238
 
2246
- function stringify(arr) {
2247
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2239
+ function unsafeStringify(arr, offset = 0) {
2248
2240
  // Note: Be careful editing this code! It's been tuned for performance
2249
2241
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2250
- 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
2251
- // of the following:
2252
- // - One or more input array values don't map to a hex octet (leading to
2253
- // "undefined" in the uuid)
2254
- // - Invalid input values for the RFC `version` or `variant` fields
2255
-
2256
- if (!validate(uuid)) {
2257
- throw TypeError('Stringified UUID is invalid');
2258
- }
2259
-
2260
- 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();
2261
2243
  }
2262
2244
 
2245
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2246
+ var native = {
2247
+ randomUUID
2248
+ };
2249
+
2263
2250
  function v4(options, buf, offset) {
2251
+ if (native.randomUUID && !buf && !options) {
2252
+ return native.randomUUID();
2253
+ }
2254
+
2264
2255
  options = options || {};
2265
- 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`
2266
2257
 
2267
2258
  rnds[6] = rnds[6] & 0x0f | 0x40;
2268
2259
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
@@ -2270,14 +2261,14 @@ function v4(options, buf, offset) {
2270
2261
  if (buf) {
2271
2262
  offset = offset || 0;
2272
2263
 
2273
- for (var i = 0; i < 16; ++i) {
2264
+ for (let i = 0; i < 16; ++i) {
2274
2265
  buf[offset + i] = rnds[i];
2275
2266
  }
2276
2267
 
2277
2268
  return buf;
2278
2269
  }
2279
2270
 
2280
- return stringify(rnds);
2271
+ return unsafeStringify(rnds);
2281
2272
  }
2282
2273
 
2283
2274
  const SvgListItemPdf = ({
@@ -3959,6 +3950,7 @@ const NewAutocomplete = ({
3959
3950
  }))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default.createElement("span", {
3960
3951
  style: {
3961
3952
  position: 'absolute',
3953
+ zIndex: '9999999999',
3962
3954
  color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
3963
3955
  fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
3964
3956
  top: marginTop ? `calc(100% + ${marginTop})` : `calc(100% + ${configStyles.INPUT.marginTop})`,
@@ -3995,7 +3987,7 @@ const NewAutocomplete = ({
3995
3987
  setId('');
3996
3988
  setInnerValue('');
3997
3989
  }
3998
- }, []);
3990
+ }, [selected]);
3999
3991
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label ? /*#__PURE__*/React__default.createElement("label", {
4000
3992
  style: {
4001
3993
  color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
package/dist/index.js CHANGED
@@ -2239,14 +2239,13 @@ Stepper.propTypes = {
2239
2239
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
2240
2240
  // require the crypto API and do not support built-in fallback to lower quality random number
2241
2241
  // generators (like Math.random()).
2242
- var getRandomValues;
2243
- var rnds8 = new Uint8Array(16);
2242
+ let getRandomValues;
2243
+ const rnds8 = new Uint8Array(16);
2244
2244
  function rng() {
2245
2245
  // lazy load so that environments that need to polyfill have a chance to do so
2246
2246
  if (!getRandomValues) {
2247
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
2248
- // find the complete implementation of crypto (msCrypto) on IE11.
2249
- 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);
2250
2249
 
2251
2250
  if (!getRandomValues) {
2252
2251
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
@@ -2256,43 +2255,35 @@ function rng() {
2256
2255
  return getRandomValues(rnds8);
2257
2256
  }
2258
2257
 
2259
- 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;
2260
-
2261
- function validate(uuid) {
2262
- return typeof uuid === 'string' && REGEX.test(uuid);
2263
- }
2264
-
2265
2258
  /**
2266
2259
  * Convert array of 16 byte values to UUID string format of the form:
2267
2260
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2268
2261
  */
2269
2262
 
2270
- var byteToHex = [];
2263
+ const byteToHex = [];
2271
2264
 
2272
- for (var i = 0; i < 256; ++i) {
2273
- 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));
2274
2267
  }
2275
2268
 
2276
- function stringify(arr) {
2277
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2269
+ function unsafeStringify(arr, offset = 0) {
2278
2270
  // Note: Be careful editing this code! It's been tuned for performance
2279
2271
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2280
- 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
2281
- // of the following:
2282
- // - One or more input array values don't map to a hex octet (leading to
2283
- // "undefined" in the uuid)
2284
- // - Invalid input values for the RFC `version` or `variant` fields
2285
-
2286
- if (!validate(uuid)) {
2287
- throw TypeError('Stringified UUID is invalid');
2288
- }
2289
-
2290
- 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();
2291
2273
  }
2292
2274
 
2275
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2276
+ var native = {
2277
+ randomUUID
2278
+ };
2279
+
2293
2280
  function v4(options, buf, offset) {
2281
+ if (native.randomUUID && !buf && !options) {
2282
+ return native.randomUUID();
2283
+ }
2284
+
2294
2285
  options = options || {};
2295
- 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`
2296
2287
 
2297
2288
  rnds[6] = rnds[6] & 0x0f | 0x40;
2298
2289
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
@@ -2300,14 +2291,14 @@ function v4(options, buf, offset) {
2300
2291
  if (buf) {
2301
2292
  offset = offset || 0;
2302
2293
 
2303
- for (var i = 0; i < 16; ++i) {
2294
+ for (let i = 0; i < 16; ++i) {
2304
2295
  buf[offset + i] = rnds[i];
2305
2296
  }
2306
2297
 
2307
2298
  return buf;
2308
2299
  }
2309
2300
 
2310
- return stringify(rnds);
2301
+ return unsafeStringify(rnds);
2311
2302
  }
2312
2303
 
2313
2304
  const SvgListItemPdf = ({
@@ -3989,6 +3980,7 @@ const NewAutocomplete = ({
3989
3980
  }))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default["default"].createElement("span", {
3990
3981
  style: {
3991
3982
  position: 'absolute',
3983
+ zIndex: '9999999999',
3992
3984
  color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
3993
3985
  fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
3994
3986
  top: marginTop ? `calc(100% + ${marginTop})` : `calc(100% + ${configStyles.INPUT.marginTop})`,
@@ -4025,7 +4017,7 @@ const NewAutocomplete = ({
4025
4017
  setId('');
4026
4018
  setInnerValue('');
4027
4019
  }
4028
- }, []);
4020
+ }, [selected]);
4029
4021
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
4030
4022
  style: {
4031
4023
  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.88",
3
+ "version": "0.0.90",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -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
  };
@@ -28,7 +29,7 @@ const Template = (args) => {
28
29
  method: 'GET',
29
30
  headers: {
30
31
  'Content-Type': 'application/json',
31
- 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwMjE0NzEyYTllNzQwZWMyMjNhYzE2MGQyNGVkY2UzNyIsImp0aSI6IjJjNDMwNzVlNzExZTc4OWI1YzE3ZTY1OGZmMjdmZWZiMWU3NWU3ZGVkYjU5MTJlNjExMjg1YzE5YjAxZDQwYjc0OTg0ZTk5OTI0MTkxY2M0IiwiaWF0IjoxNjg2MjAxNDM4LjEyMzYwNiwibmJmIjoxNjg2MjAxNDM4LjEyMzYxMywiZXhwIjoxNjg2MjI2NjM4LjEwOTI5Niwic3ViIjoibWlu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JzdWIiOiJtaW5hczg5QG1haWwucnUiLCJzY29wZXMiOlsiZW1haWwiXX0.Laezbf2xobWHCeDsFD_9nrGsPznIqUAz56Y-KyfvGt6x6F7WpxAg5HovIeiaLdhi0wdHWZhYnOMVktlHz-Gw0wdC6i-0IMq27tc968o21sTwp3jkVTl543J334u2-ju-s0nx9Yfcd84ySd499sMlhZRbsxuUPKJTiPAXeG6_tqlnMGRcQPIN24SIY4FLzES2vIQ6SqeiSQm9UQFlf4rmHVE7bEhFUPHXymNLMk8gS7Jm_xdhWtuv2Ei0ipiTApmUwpE4GYnpiHnnrEoZVrJ-sFgFZJekV0theZp5qPvjyLOVaC1rPIwwt8pdQZcfwFGxWWC9J3cEHtPfw9UhIsLi_IjS0OsFWuast6z6qSGVBpymQPA3oA1QSO4iA2UPAC0Yj7cYpYHP1q76jxbnSfYM0ifWwPUanX2OUdMWRMGuwzct7gi2jC3WIwTICahxrKFr_YpbEupxweL2IbxUeGoKCY13bq97C4u7bGELPlhoNHxm2HTD1Gp_sdQcEepJj2OMOvxE3eRCaJwyCtjZgsFpZSZYxo_6cSuCDGb0oxXESMjLPvCrleIXVJykc9ZjiK0gCZzeX83N9QlndsJ4elOcM8dLy0OOvXoojF1o_TMqSw8sD8wjpEo9Bp0MyUs4hPjmiBSrPNSAo9jbpgLYWuTUvCpPXFqmRkZhr4T_hnnuHkk',
32
33
  },
33
34
  }).then((res)=> {
34
35
  return res.json()
@@ -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 = {
@@ -217,6 +217,7 @@ export const NewAutocomplete = ({
217
217
  <span
218
218
  style={{
219
219
  position: 'absolute',
220
+ zIndex: '9999999999',
220
221
  color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
221
222
  fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
222
223
  top: marginTop ? `calc(100% + ${marginTop})` : `calc(100% + ${configStyles.INPUT.marginTop})`,
@@ -270,8 +271,8 @@ export const NewAutocomplete = ({
270
271
  setId('');
271
272
  setInnerValue('');
272
273
  }
273
- }, []);
274
-
274
+ }, [selected]);
275
+
275
276
  return (
276
277
  <>
277
278
  {