es-history-template 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15,47 +15,56 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
15
15
 
16
16
  const TableWrapper = styled__default["default"].div `
17
17
  width: 100%;
18
- overflow-x: auto;
18
+ flex: 1;
19
+ min-height: 0;
20
+ overflow: auto;
19
21
  border: 1px solid #e5e7eb;
20
22
  border-radius: 6px;
21
23
  background-color: #ffffff;
22
24
  `;
23
25
  const StyledTable = styled__default["default"].table `
24
26
  width: 100%;
25
- border-collapse: collapse;
27
+ border-collapse: separate;
28
+ border-spacing: 0;
26
29
  text-align: left;
27
30
  font-size: 13.5px;
28
31
  color: #374151;
29
32
 
30
33
  thead {
31
- background-color: #f9fafb;
32
- border-bottom: 2px solid #e5e7eb;
34
+ position: sticky;
35
+ top: 0;
36
+ z-index: 10;
33
37
 
34
38
  th {
39
+ position: sticky;
40
+ top: 0;
41
+ z-index: 10;
42
+ background-color: #f9fafb;
35
43
  padding: 10px 14px;
36
44
  font-weight: 600;
37
45
  color: #4b5563;
38
46
  white-space: nowrap;
39
47
  user-select: none;
48
+ border-bottom: 2px solid #e5e7eb;
40
49
  }
41
50
  }
42
51
 
43
52
  tbody {
44
53
  tr {
45
- border-bottom: 1px solid #f3f4f6;
46
54
  transition: background-color 0.15s ease-in-out;
47
55
 
48
56
  &:hover {
49
57
  background-color: #f8fafc;
50
58
  }
51
59
 
52
- &:last-child {
60
+ &:last-child td {
53
61
  border-bottom: none;
54
62
  }
55
63
 
56
64
  td {
57
65
  padding: 10px 14px;
58
66
  vertical-align: middle;
67
+ border-bottom: 1px solid #f3f4f6;
59
68
  }
60
69
  }
61
70
  }
@@ -214,8 +223,8 @@ const HistoryTable = ({ dataSource = [], onViewDetail, t = (key) => key, loading
214
223
  React__default["default"].createElement("th", { style: { width: '130px' } }, t('Mã')),
215
224
  React__default["default"].createElement("th", null, t('Tên')),
216
225
  React__default["default"].createElement("th", { style: { width: '130px', textAlign: 'center' } }, t('Thao tác')),
217
- React__default["default"].createElement("th", { style: { width: '170px' } }, t('Người thực hiện')),
218
- React__default["default"].createElement("th", { style: { width: '160px', textAlign: 'center' } }, t('Ngày thực hiện')),
226
+ React__default["default"].createElement("th", { style: { width: '200px' } }, t('Người thực hiện')),
227
+ React__default["default"].createElement("th", { style: { width: '200px', textAlign: 'center' } }, t('Ngày thực hiện')),
219
228
  React__default["default"].createElement("th", { style: { width: '100px', textAlign: 'center' } }, t('Chi tiết')))),
220
229
  React__default["default"].createElement("tbody", null, dataSource.map((item, index) => {
221
230
  var _a;
@@ -223,8 +232,7 @@ const HistoryTable = ({ dataSource = [], onViewDetail, t = (key) => key, loading
223
232
  React__default["default"].createElement("td", { style: { textAlign: 'center', color: '#6b7280' } }, index + 1),
224
233
  React__default["default"].createElement("td", { style: { fontWeight: 600, color: '#1f2937' } }, item.code || '-'),
225
234
  React__default["default"].createElement("td", null,
226
- React__default["default"].createElement("div", { style: { fontWeight: 500 } }, item.name || '-'),
227
- item.description && (React__default["default"].createElement("div", { style: { fontSize: '12px', color: '#6b7280', marginTop: '2px' } }, item.description))),
235
+ React__default["default"].createElement("div", { style: { fontWeight: 500 } }, item.name || '-')),
228
236
  React__default["default"].createElement("td", { style: { textAlign: 'center' } },
229
237
  React__default["default"].createElement(ActionBadge, { "$actionType": item.actionType || item.action }, item.action || '-')),
230
238
  React__default["default"].createElement("td", null,
@@ -336,9 +344,10 @@ const ModalContent = styled__default["default"].div `
336
344
  background: #ffffff;
337
345
  border-radius: 8px;
338
346
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
339
- width: ${({ $width }) => (typeof $width === 'number' ? `${$width}px` : $width || '950px')};
340
- max-width: 95vw;
341
- max-height: 90vh;
347
+ width: ${({ $width }) => (typeof $width === 'number' ? `${$width}px` : $width || '1425px')};
348
+ max-width: 96vw;
349
+ max-height: 88vh;
350
+ height: 80vh;
342
351
  display: flex;
343
352
  flex-direction: column;
344
353
  overflow: hidden;
@@ -362,6 +371,7 @@ const ModalHeader = styled__default["default"].div `
362
371
  padding: 14px 20px;
363
372
  border-bottom: 1px solid #e5e7eb;
364
373
  background-color: #f8fafc;
374
+ flex-shrink: 0;
365
375
  `;
366
376
  const HeaderTitle = styled__default["default"].div `
367
377
  display: flex;
@@ -402,9 +412,13 @@ const CloseButton = styled__default["default"].button `
402
412
  }
403
413
  `;
404
414
  const ModalBody = styled__default["default"].div `
405
- padding: 18px 20px;
415
+ padding: 16px 20px;
406
416
  overflow-y: auto;
417
+ overflow-x: hidden;
407
418
  flex: 1;
419
+ min-height: 0;
420
+ display: flex;
421
+ flex-direction: column;
408
422
  `;
409
423
  const ModalFooter = styled__default["default"].div `
410
424
  display: flex;
@@ -414,6 +428,7 @@ const ModalFooter = styled__default["default"].div `
414
428
  padding: 12px 20px;
415
429
  border-top: 1px solid #e5e7eb;
416
430
  background-color: #f8fafc;
431
+ flex-shrink: 0;
417
432
  `;
418
433
  const CloseBtn = styled__default["default"].button `
419
434
  padding: 7px 18px;
@@ -507,7 +522,7 @@ function normalizeApiResponse(res, defaultRecordCode, defaultRecordName, customE
507
522
  /**
508
523
  * Component Modal mở form xem lịch sử thao tác phiếu (chuẩn package đóng gói)
509
524
  */
510
- const HistoryModal = ({ isOpen, onClose, id, recordId, recordCode, recordName, title, dataSource, fetchHistoryApi, apiUrl = '/api/sys-setting-result-data/get-by-key', idParamName = 'id', getToken, axiosInstance, dataExtractor, onViewDetail, t = (key) => key, loading: externalLoading = false, width = '950px', className, }) => {
525
+ const HistoryModal = ({ isOpen, onClose, id, recordId, recordCode, recordName, title, dataSource, fetchHistoryApi, apiUrl = '/api/sys-setting-result-data/get-by-key', idParamName = 'id', getToken, axiosInstance, dataExtractor, onViewDetail, t = (key) => key, loading: externalLoading = false, width = '1425px', className, }) => {
511
526
  const [internalList, setInternalList] = React.useState([]);
512
527
  const [loading, setLoading] = React.useState(false);
513
528
  // Nhận id hoặc recordId truyền vào
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-history-template",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Component xem lịch sử thao tác phiếu",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -87,4 +87,4 @@
87
87
  "dependencies": {
88
88
  "postcss": "^8.4.35"
89
89
  }
90
- }
90
+ }