@xaypay/tui 0.0.111 → 0.0.112

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
@@ -608,7 +608,8 @@ const TD = ({
608
608
  key: `${innerItem}_${innerItemIndex}`,
609
609
  className: styles$c['list-text'],
610
610
  style: {
611
- color: openListColor
611
+ color: openListColor,
612
+ maxWidth: (item.content.length * 9 <= 100 ? 100 : item.content.length * 9) + 'px'
612
613
  },
613
614
  onClick: e => handleContentListClick(e, {
614
615
  item,
@@ -618,7 +619,7 @@ const TD = ({
618
619
  listContent: innerItem.content,
619
620
  listContentIndex: innerItemIndex
620
621
  })
621
- }, innerItem.content.length >= item.content.length ? innerItem.content.substr(0, item.content.length - 4) + '...' : innerItem.content);
622
+ }, innerItem.content);
622
623
  })))) : '');
623
624
  };
624
625
 
@@ -1104,6 +1105,17 @@ const Table = ({
1104
1105
  };
1105
1106
  getData(moreData);
1106
1107
  };
1108
+ const handleTableClick = () => {
1109
+ const checkBodyMore = body.map(elemItem => {
1110
+ return elemItem.map(elemInnerItem => {
1111
+ if (Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1112
+ elemInnerItem.dotsStatus = 'deActive';
1113
+ }
1114
+ return elemInnerItem;
1115
+ });
1116
+ });
1117
+ setBody(() => checkBodyMore);
1118
+ };
1107
1119
  useEffect(() => {
1108
1120
  let checkedItems = [];
1109
1121
  const disabledArray = [];
@@ -1170,7 +1182,8 @@ const Table = ({
1170
1182
  style: {
1171
1183
  width: '100%',
1172
1184
  borderCollapse: 'collapse'
1173
- }
1185
+ },
1186
+ onClick: handleTableClick
1174
1187
  }, header && header.length > 0 && /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", {
1175
1188
  style: {
1176
1189
  color: tHeadColor ? tHeadColor : configStyles.TABLE.tHeadColor,
@@ -3368,7 +3381,7 @@ for (let i = 0; i < 256; ++i) {
3368
3381
  function unsafeStringify(arr, offset = 0) {
3369
3382
  // Note: Be careful editing this code! It's been tuned for performance
3370
3383
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
3371
- 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();
3384
+ 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]];
3372
3385
  }
3373
3386
 
3374
3387
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -4389,6 +4402,9 @@ const Textarea = ({
4389
4402
  if (!onChange) {
4390
4403
  alert('Please add onChange function on Textarea component');
4391
4404
  }
4405
+ if (value === '') {
4406
+ setError('');
4407
+ }
4392
4408
  setInnerValue(value);
4393
4409
  }, [value, onChange]);
4394
4410
  useEffect(() => {
package/dist/index.js CHANGED
@@ -638,7 +638,8 @@ const TD = ({
638
638
  key: `${innerItem}_${innerItemIndex}`,
639
639
  className: styles$c['list-text'],
640
640
  style: {
641
- color: openListColor
641
+ color: openListColor,
642
+ maxWidth: (item.content.length * 9 <= 100 ? 100 : item.content.length * 9) + 'px'
642
643
  },
643
644
  onClick: e => handleContentListClick(e, {
644
645
  item,
@@ -648,7 +649,7 @@ const TD = ({
648
649
  listContent: innerItem.content,
649
650
  listContentIndex: innerItemIndex
650
651
  })
651
- }, innerItem.content.length >= item.content.length ? innerItem.content.substr(0, item.content.length - 4) + '...' : innerItem.content);
652
+ }, innerItem.content);
652
653
  })))) : '');
653
654
  };
654
655
 
@@ -1134,6 +1135,17 @@ const Table = ({
1134
1135
  };
1135
1136
  getData(moreData);
1136
1137
  };
1138
+ const handleTableClick = () => {
1139
+ const checkBodyMore = body.map(elemItem => {
1140
+ return elemItem.map(elemInnerItem => {
1141
+ if (Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1142
+ elemInnerItem.dotsStatus = 'deActive';
1143
+ }
1144
+ return elemInnerItem;
1145
+ });
1146
+ });
1147
+ setBody(() => checkBodyMore);
1148
+ };
1137
1149
  React.useEffect(() => {
1138
1150
  let checkedItems = [];
1139
1151
  const disabledArray = [];
@@ -1200,7 +1212,8 @@ const Table = ({
1200
1212
  style: {
1201
1213
  width: '100%',
1202
1214
  borderCollapse: 'collapse'
1203
- }
1215
+ },
1216
+ onClick: handleTableClick
1204
1217
  }, header && header.length > 0 && /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement("tr", {
1205
1218
  style: {
1206
1219
  color: tHeadColor ? tHeadColor : configStyles.TABLE.tHeadColor,
@@ -3398,7 +3411,7 @@ for (let i = 0; i < 256; ++i) {
3398
3411
  function unsafeStringify(arr, offset = 0) {
3399
3412
  // Note: Be careful editing this code! It's been tuned for performance
3400
3413
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
3401
- 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();
3414
+ 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]];
3402
3415
  }
3403
3416
 
3404
3417
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -4419,6 +4432,9 @@ const Textarea = ({
4419
4432
  if (!onChange) {
4420
4433
  alert('Please add onChange function on Textarea component');
4421
4434
  }
4435
+ if (value === '') {
4436
+ setError('');
4437
+ }
4422
4438
  setInnerValue(value);
4423
4439
  }, [value, onChange]);
4424
4440
  React.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -484,6 +484,18 @@ export const Table = ({
484
484
  getData(moreData)
485
485
  }
486
486
 
487
+ const handleTableClick = () => {
488
+ const checkBodyMore = body.map((elemItem) => {
489
+ return elemItem.map((elemInnerItem) => {
490
+ if (Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
491
+ elemInnerItem.dotsStatus = 'deActive'
492
+ }
493
+ return elemInnerItem
494
+ })
495
+ })
496
+ setBody(() => checkBodyMore)
497
+ }
498
+
487
499
  useEffect(() => {
488
500
  let checkedItems = []
489
501
  const disabledArray = []
@@ -560,6 +572,7 @@ export const Table = ({
560
572
  width: '100%',
561
573
  borderCollapse: 'collapse',
562
574
  }}
575
+ onClick={handleTableClick}
563
576
  >
564
577
  {header && header.length > 0 && (
565
578
  <thead>
@@ -435,16 +435,7 @@ const Template = (args) => {
435
435
  console.log(tData, ' data from table click action, with getData props')
436
436
  }
437
437
 
438
- return (
439
- <Table
440
- {...args}
441
- arrowShow
442
- arrowColumn={3}
443
- dataBody={bodyData}
444
- dataHeader={headerData}
445
- getData={handleGetData}
446
- />
447
- )
438
+ return <Table {...args} dataBody={bodyData} dataHeader={headerData} getData={handleGetData} />
448
439
  }
449
440
 
450
441
  export const Default = Template.bind({})
@@ -295,6 +295,9 @@ const TD = ({
295
295
  className={styles['list-text']}
296
296
  style={{
297
297
  color: openListColor,
298
+ maxWidth:
299
+ (item.content.length * 9 <= 100 ? 100 : item.content.length * 9) +
300
+ 'px',
298
301
  }}
299
302
  onClick={(e) =>
300
303
  handleContentListClick(e, {
@@ -307,9 +310,7 @@ const TD = ({
307
310
  })
308
311
  }
309
312
  >
310
- {innerItem.content.length >= item.content.length
311
- ? innerItem.content.substr(0, item.content.length - 4) + '...'
312
- : innerItem.content}
313
+ {innerItem.content}
313
314
  </p>
314
315
  )
315
316
  })}
@@ -93,6 +93,10 @@ export const Textarea = ({
93
93
  alert('Please add onChange function on Textarea component')
94
94
  }
95
95
 
96
+ if (value === '') {
97
+ setError('')
98
+ }
99
+
96
100
  setInnerValue(value)
97
101
  }, [value, onChange])
98
102