@agile-team/mach-table 0.5.0 → 0.13.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agile-team/mach-table",
3
- "version": "0.5.0",
3
+ "version": "0.13.0",
4
4
  "description": "Enterprise-grade, framework-agnostic TypeScript data grid with virtualization, editing, grouping and extensibility",
5
5
  "keywords": [
6
6
  "data-grid",
@@ -11,8 +11,8 @@
11
11
  "vue",
12
12
  "react"
13
13
  ],
14
- "author": "Agile Team",
15
- "license": "MIT",
14
+ "author": "ChenyCHENYU (Agile Team)",
15
+ "license": "SEE LICENSE IN LICENSE",
16
16
  "homepage": "https://github.com/ChenyCHENYU/MachTable#readme",
17
17
  "bugs": {
18
18
  "url": "https://github.com/ChenyCHENYU/MachTable/issues"
@@ -531,6 +531,23 @@ input.mach-select-all {
531
531
  transform: rotate(90deg);
532
532
  }
533
533
 
534
+ .mach-detail-toggle--loading {
535
+ animation: mach-tree-spin 0.8s linear infinite;
536
+ color: var(--mach-primary);
537
+ }
538
+
539
+ .mach-detail-toggle--error {
540
+ color: #dc2626;
541
+ }
542
+
543
+ @keyframes mach-tree-spin {
544
+ to { transform: rotate(360deg); }
545
+ }
546
+
547
+ @media (prefers-reduced-motion: reduce) {
548
+ .mach-detail-toggle--loading { animation: none; }
549
+ }
550
+
534
551
  .mach-cell--group {
535
552
  cursor: pointer;
536
553
  background: var(--mach-header-bg);
@@ -637,6 +654,11 @@ input.mach-select-all {
637
654
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
638
655
  }
639
656
 
657
+ .mach-editor-validating {
658
+ cursor: progress;
659
+ opacity: 0.72;
660
+ }
661
+
640
662
  .mach-footer {
641
663
  display: flex;
642
664
  flex-shrink: 0;
@@ -1025,11 +1047,33 @@ input.mach-select-all {
1025
1047
  }
1026
1048
 
1027
1049
  .mach-column-panel {
1028
- min-width: 200px;
1050
+ min-width: 220px;
1029
1051
  max-height: 70vh;
1030
1052
  overflow: auto;
1031
1053
  }
1032
1054
 
1055
+ .mach-column-panel[role="dialog"] {
1056
+ width: min(440px, calc(100vw - 16px));
1057
+ }
1058
+
1059
+ .mach-column-workbench-search {
1060
+ box-sizing: border-box;
1061
+ width: 100%;
1062
+ height: 30px;
1063
+ padding: 0 9px;
1064
+ border: 1px solid var(--mach-border-color);
1065
+ border-radius: var(--mach-radius);
1066
+ background: var(--mach-body-bg);
1067
+ color: var(--mach-body-fg);
1068
+ font: inherit;
1069
+ outline: none;
1070
+ }
1071
+
1072
+ .mach-column-workbench-search:focus {
1073
+ border-color: var(--mach-primary);
1074
+ box-shadow: 0 0 0 2px var(--mach-primary-weak);
1075
+ }
1076
+
1033
1077
  .mach-column-panel-title {
1034
1078
  font-weight: 600;
1035
1079
  color: var(--mach-header-fg);
@@ -1076,7 +1120,7 @@ input.mach-select-all {
1076
1120
  }
1077
1121
 
1078
1122
  .mach-column-panel-list {
1079
- max-height: 180px;
1123
+ max-height: 280px;
1080
1124
  overflow: auto;
1081
1125
  display: flex;
1082
1126
  flex-direction: column;
@@ -1086,6 +1130,54 @@ input.mach-select-all {
1086
1130
  padding: 4px;
1087
1131
  }
1088
1132
 
1133
+ .mach-column-workbench-item {
1134
+ display: grid;
1135
+ grid-template-columns: minmax(120px, 1fr) 108px 26px 26px;
1136
+ align-items: center;
1137
+ gap: 4px;
1138
+ min-height: 32px;
1139
+ padding: 2px 3px;
1140
+ border-radius: var(--mach-radius);
1141
+ }
1142
+
1143
+ .mach-column-workbench-item:hover {
1144
+ background: var(--mach-row-hover-bg);
1145
+ }
1146
+
1147
+ .mach-column-workbench-label {
1148
+ display: flex;
1149
+ min-width: 0;
1150
+ align-items: center;
1151
+ gap: 7px;
1152
+ cursor: pointer;
1153
+ }
1154
+
1155
+ .mach-column-workbench-name {
1156
+ overflow: hidden;
1157
+ text-overflow: ellipsis;
1158
+ white-space: nowrap;
1159
+ }
1160
+
1161
+ .mach-column-workbench-pin,
1162
+ .mach-column-workbench-move {
1163
+ height: 26px;
1164
+ border: 1px solid var(--mach-border-color);
1165
+ border-radius: var(--mach-radius);
1166
+ background: var(--mach-body-bg);
1167
+ color: inherit;
1168
+ font: inherit;
1169
+ }
1170
+
1171
+ .mach-column-workbench-move {
1172
+ padding: 0;
1173
+ cursor: pointer;
1174
+ }
1175
+
1176
+ .mach-column-workbench-move:disabled {
1177
+ cursor: not-allowed;
1178
+ opacity: 0.35;
1179
+ }
1180
+
1089
1181
  .mach-tag {
1090
1182
  display: inline-flex;
1091
1183
  align-items: center;
@@ -1177,6 +1269,18 @@ input.mach-select-all {
1177
1269
  gap: 2px;
1178
1270
  }
1179
1271
 
1272
+ .mach-sr-only {
1273
+ position: absolute !important;
1274
+ width: 1px !important;
1275
+ height: 1px !important;
1276
+ padding: 0 !important;
1277
+ margin: -1px !important;
1278
+ overflow: hidden !important;
1279
+ clip: rect(0, 0, 0, 0) !important;
1280
+ white-space: nowrap !important;
1281
+ border: 0 !important;
1282
+ }
1283
+
1180
1284
  .mach-action-btn {
1181
1285
  display: inline-flex;
1182
1286
  align-items: center;
@@ -1203,6 +1307,50 @@ input.mach-select-all {
1203
1307
  color: var(--mach-danger);
1204
1308
  }
1205
1309
 
1310
+ .mach-action-btn--primary {
1311
+ color: var(--mach-primary);
1312
+ }
1313
+
1314
+ .mach-action-btn--warning {
1315
+ color: var(--mach-warning);
1316
+ }
1317
+
1318
+ .mach-action-btn--success,
1319
+ .mach-edit-control--confirm {
1320
+ color: var(--mach-success);
1321
+ }
1322
+
1323
+ .mach-action-btn--danger {
1324
+ color: var(--mach-danger);
1325
+ }
1326
+
1327
+ .mach-action-btn:focus-visible,
1328
+ .mach-edit-control:focus-visible,
1329
+ .mach-cell-edit-trigger:focus-visible,
1330
+ .mach-action-drawer__close:focus-visible {
1331
+ outline: 2px solid color-mix(in srgb, var(--mach-primary) 65%, transparent);
1332
+ outline-offset: 1px;
1333
+ }
1334
+
1335
+ .mach-action-btn:disabled {
1336
+ cursor: not-allowed;
1337
+ opacity: 0.4;
1338
+ }
1339
+
1340
+ .mach-action-btn--loading svg {
1341
+ animation: mach-spin 0.8s linear infinite;
1342
+ }
1343
+
1344
+ .mach-dictionary-value--loading {
1345
+ color: var(--mach-header-fg);
1346
+ opacity: 0.72;
1347
+ }
1348
+
1349
+ .mach-dictionary-value--error {
1350
+ text-decoration: underline dotted;
1351
+ text-underline-offset: 3px;
1352
+ }
1353
+
1206
1354
  .mach-action-btn--icon {
1207
1355
  padding: 0;
1208
1356
  width: 24px;
@@ -1210,7 +1358,262 @@ input.mach-select-all {
1210
1358
 
1211
1359
  .mach-context-menu-item--danger {
1212
1360
  color: var(--mach-danger);
1213
- }
1361
+ }
1362
+
1363
+ .mach-context-menu-item,
1364
+ .mach-action-drawer__item {
1365
+ display: flex;
1366
+ align-items: center;
1367
+ gap: 9px;
1368
+ }
1369
+
1370
+ .mach-context-menu-item--primary,
1371
+ .mach-action-drawer__item--primary {
1372
+ color: var(--mach-primary);
1373
+ }
1374
+
1375
+ .mach-context-menu-item--warning,
1376
+ .mach-action-drawer__item--warning {
1377
+ color: var(--mach-warning);
1378
+ }
1379
+
1380
+ .mach-context-menu-item--success,
1381
+ .mach-action-drawer__item--success {
1382
+ color: var(--mach-success);
1383
+ }
1384
+
1385
+ .mach-context-menu-item--danger,
1386
+ .mach-action-drawer__item--danger {
1387
+ color: var(--mach-danger);
1388
+ }
1389
+
1390
+ .mach-action-drawer-backdrop {
1391
+ position: fixed;
1392
+ inset: 0;
1393
+ z-index: calc(var(--mach-z-menu) + 2);
1394
+ background: rgba(15, 23, 42, 0.2);
1395
+ backdrop-filter: blur(1px);
1396
+ }
1397
+
1398
+ .mach-action-drawer {
1399
+ position: absolute;
1400
+ top: 0;
1401
+ right: 0;
1402
+ display: flex;
1403
+ flex-direction: column;
1404
+ width: min(340px, calc(100vw - 24px));
1405
+ height: 100%;
1406
+ background: var(--mach-body-bg);
1407
+ color: var(--mach-body-fg);
1408
+ border-left: 1px solid var(--mach-border-color);
1409
+ box-shadow: -16px 0 40px rgba(15, 23, 42, 0.14);
1410
+ font-family: var(--mach-font-family);
1411
+ animation: mach-drawer-in 0.18s ease-out;
1412
+ }
1413
+
1414
+ .mach-action-drawer__header {
1415
+ display: flex;
1416
+ align-items: center;
1417
+ justify-content: space-between;
1418
+ min-height: 56px;
1419
+ padding: 0 16px 0 20px;
1420
+ border-bottom: 1px solid var(--mach-border-color);
1421
+ }
1422
+
1423
+ .mach-action-drawer__close {
1424
+ display: inline-flex;
1425
+ align-items: center;
1426
+ justify-content: center;
1427
+ width: 30px;
1428
+ height: 30px;
1429
+ padding: 0;
1430
+ border: 0;
1431
+ border-radius: var(--mach-radius);
1432
+ background: transparent;
1433
+ color: var(--mach-header-fg);
1434
+ cursor: pointer;
1435
+ }
1436
+
1437
+ .mach-action-drawer__close:hover {
1438
+ color: var(--mach-primary);
1439
+ background: var(--mach-row-hover-bg);
1440
+ }
1441
+
1442
+ .mach-action-drawer__body {
1443
+ display: flex;
1444
+ flex-direction: column;
1445
+ gap: 4px;
1446
+ padding: 12px;
1447
+ overflow: auto;
1448
+ }
1449
+
1450
+ .mach-action-drawer__item {
1451
+ width: 100%;
1452
+ min-height: 40px;
1453
+ padding: 0 12px;
1454
+ border: 0;
1455
+ border-radius: var(--mach-radius);
1456
+ background: transparent;
1457
+ font: inherit;
1458
+ text-align: left;
1459
+ cursor: pointer;
1460
+ }
1461
+
1462
+ .mach-action-drawer__item:hover:not(:disabled) {
1463
+ background: var(--mach-row-hover-bg);
1464
+ }
1465
+
1466
+ .mach-action-drawer__item:disabled {
1467
+ opacity: 0.4;
1468
+ cursor: not-allowed;
1469
+ }
1470
+
1471
+ @keyframes mach-drawer-in {
1472
+ from { transform: translateX(18px); opacity: 0; }
1473
+ to { transform: translateX(0); opacity: 1; }
1474
+ }
1475
+
1476
+ @media (max-width: 640px) {
1477
+ .mach-action-drawer {
1478
+ top: auto;
1479
+ bottom: 0;
1480
+ width: 100%;
1481
+ height: auto;
1482
+ max-height: min(70vh, 520px);
1483
+ border-top: 1px solid var(--mach-border-color);
1484
+ border-left: 0;
1485
+ border-radius: var(--mach-radius-lg) var(--mach-radius-lg) 0 0;
1486
+ animation-name: mach-drawer-up;
1487
+ }
1488
+ }
1489
+
1490
+ @keyframes mach-drawer-up {
1491
+ from { transform: translateY(18px); opacity: 0; }
1492
+ to { transform: translateY(0); opacity: 1; }
1493
+ }
1494
+
1495
+ .mach-cell:has(.mach-cell-edit-trigger) {
1496
+ padding-right: 29px;
1497
+ }
1498
+
1499
+ .mach-cell-edit-trigger {
1500
+ position: absolute;
1501
+ right: 5px;
1502
+ top: 50%;
1503
+ display: inline-flex;
1504
+ align-items: center;
1505
+ justify-content: center;
1506
+ width: 20px;
1507
+ height: 20px;
1508
+ padding: 0;
1509
+ transform: translateY(-50%);
1510
+ border: 0;
1511
+ border-radius: var(--mach-radius-sm);
1512
+ background: transparent;
1513
+ color: var(--mach-header-fg);
1514
+ cursor: pointer;
1515
+ opacity: 0;
1516
+ transition: opacity var(--mach-transition), color var(--mach-transition), background-color var(--mach-transition);
1517
+ }
1518
+
1519
+ .mach-cell-edit-trigger svg {
1520
+ width: 13px;
1521
+ height: 13px;
1522
+ }
1523
+
1524
+ .mach-cell:hover .mach-cell-edit-trigger--hover,
1525
+ .mach-cell:focus-within .mach-cell-edit-trigger--hover,
1526
+ .mach-cell-edit-trigger--always {
1527
+ opacity: 0.72;
1528
+ }
1529
+
1530
+ .mach-cell-edit-trigger:hover {
1531
+ opacity: 1;
1532
+ color: var(--mach-primary);
1533
+ background: color-mix(in srgb, var(--mach-primary) 9%, transparent);
1534
+ }
1535
+
1536
+ .mach-cell--editing {
1537
+ overflow: visible;
1538
+ z-index: 4;
1539
+ }
1540
+
1541
+ .mach-cell-editor-shell,
1542
+ .mach-row-editor-shell {
1543
+ display: flex;
1544
+ align-items: center;
1545
+ width: 100%;
1546
+ min-width: 0;
1547
+ gap: 5px;
1548
+ }
1549
+
1550
+ .mach-cell-editor-shell > .mach-editor-input,
1551
+ .mach-cell-editor-shell > .mach-editor-select,
1552
+ .mach-cell-editor-shell > :not(.mach-cell-editor-controls),
1553
+ .mach-row-editor-shell > * {
1554
+ flex: 1 1 auto;
1555
+ min-width: 0;
1556
+ }
1557
+
1558
+ .mach-cell-editor-controls {
1559
+ display: inline-flex;
1560
+ flex: 0 0 auto;
1561
+ align-items: center;
1562
+ padding: 2px;
1563
+ border: 1px solid var(--mach-border-color);
1564
+ border-radius: var(--mach-radius);
1565
+ background: var(--mach-body-bg);
1566
+ box-shadow: var(--mach-shadow-sm);
1567
+ }
1568
+
1569
+ .mach-edit-control {
1570
+ display: inline-flex;
1571
+ align-items: center;
1572
+ justify-content: center;
1573
+ width: 23px;
1574
+ height: 23px;
1575
+ padding: 0;
1576
+ border: 0;
1577
+ border-radius: var(--mach-radius-sm);
1578
+ background: transparent;
1579
+ color: var(--mach-header-fg);
1580
+ cursor: pointer;
1581
+ }
1582
+
1583
+ .mach-edit-control svg {
1584
+ width: 14px;
1585
+ height: 14px;
1586
+ }
1587
+
1588
+ .mach-edit-control--confirm {
1589
+ color: var(--mach-primary);
1590
+ }
1591
+
1592
+ .mach-edit-control:hover {
1593
+ background: var(--mach-row-hover-bg);
1594
+ }
1595
+
1596
+ .mach-edit-control:disabled {
1597
+ opacity: 0.35;
1598
+ cursor: wait;
1599
+ }
1600
+
1601
+ .mach-row--editing,
1602
+ .mach-row--editing .mach-cell {
1603
+ background: color-mix(in srgb, var(--mach-primary) 3%, var(--mach-body-bg));
1604
+ }
1605
+
1606
+ .mach-cell--row-editing .mach-editor-input,
1607
+ .mach-cell--row-editing .mach-editor-select {
1608
+ border-color: color-mix(in srgb, var(--mach-primary) 45%, var(--mach-border-color));
1609
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
1610
+ }
1611
+
1612
+ .mach-cell--row-editing .mach-editor-input:focus,
1613
+ .mach-cell--row-editing .mach-editor-select:focus {
1614
+ border-color: var(--mach-primary);
1615
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--mach-primary) 12%, transparent);
1616
+ }
1214
1617
 
1215
1618
  .mach-tooltip {
1216
1619
  position: fixed;
@@ -1381,4 +1784,8 @@ input.mach-select-all {
1381
1784
  animation-iteration-count: 1 !important;
1382
1785
  transition-duration: 0.01ms !important;
1383
1786
  }
1787
+
1788
+ .mach-action-drawer {
1789
+ animation: none !important;
1790
+ }
1384
1791
  }