@expcat/tigercat-react 1.2.46 → 1.2.52
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/{chunk-D4FXVNRW.mjs → chunk-3CJFNG54.mjs} +2 -2
- package/dist/{chunk-USWK2S3Y.mjs → chunk-5TE7KLE5.mjs} +3 -1
- package/dist/{chunk-VJJ76I7U.js → chunk-6HDMUF23.js} +2 -1
- package/dist/{chunk-CGIBGSNE.js → chunk-6TR7JB6C.js} +49 -8
- package/dist/{chunk-ZDGBH4NA.js → chunk-7DZWTHYM.js} +20 -8
- package/dist/{chunk-EWSYARW4.js → chunk-7GAMKBSL.js} +92 -58
- package/dist/{chunk-JLQBG5XU.js → chunk-AKUAI5FG.js} +1 -0
- package/dist/{chunk-FZIF5LZW.js → chunk-AW5M3EL4.js} +5 -5
- package/dist/{chunk-ZL44XLSB.mjs → chunk-BBWCJSVR.mjs} +1 -1
- package/dist/{chunk-CHS54PVQ.mjs → chunk-BWDQZSAB.mjs} +2 -1
- package/dist/{chunk-IHH2O7YK.js → chunk-C5BPHZXK.js} +19 -1
- package/dist/{chunk-UPPHGL64.js → chunk-CY5GRTAX.js} +4 -3
- package/dist/{chunk-AGHGG73I.mjs → chunk-DLJZMMD7.mjs} +145 -56
- package/dist/{chunk-H2YHUFMK.js → chunk-EEWHWEYO.js} +5 -5
- package/dist/{chunk-Y5E4XH6H.mjs → chunk-F6IXIH6B.mjs} +4 -3
- package/dist/{chunk-I5YYA7FB.mjs → chunk-FB34UWF7.mjs} +3 -3
- package/dist/{chunk-OFCKGWTS.js → chunk-FJDTVJTX.js} +7 -2
- package/dist/{chunk-UIO6O4MI.js → chunk-FQO7BKXW.js} +4 -2
- package/dist/{chunk-6KQYWZ6J.mjs → chunk-GN3TSQWW.mjs} +49 -8
- package/dist/{chunk-7JFP3MIW.js → chunk-GQFVVAEF.js} +3 -3
- package/dist/{chunk-TYZNV54N.mjs → chunk-H3DEILMB.mjs} +1 -0
- package/dist/{chunk-TUA5PDRX.mjs → chunk-HDCC4FBL.mjs} +19 -1
- package/dist/{chunk-RL6HARKE.mjs → chunk-I2AUOICV.mjs} +1 -1
- package/dist/{chunk-UVWLYRAC.js → chunk-I373B74W.js} +7 -7
- package/dist/{chunk-NF3OF7S5.mjs → chunk-IGAMV6ML.mjs} +1 -1
- package/dist/{chunk-P6E3DILH.mjs → chunk-IXV5YBCZ.mjs} +5 -3
- package/dist/{chunk-AE2QE2C6.js → chunk-JJUJRILK.js} +2 -2
- package/dist/{chunk-7E24KEVK.mjs → chunk-KGSDDVRC.mjs} +1 -1
- package/dist/{chunk-PKWHSCFK.mjs → chunk-L5AMVEQL.mjs} +2 -2
- package/dist/{chunk-BCQQYERG.js → chunk-N4PP3ENO.js} +2 -2
- package/dist/{chunk-56DP32W7.mjs → chunk-NVEIVIAW.mjs} +2 -2
- package/dist/{chunk-KVZE7UGH.mjs → chunk-OEZ3CSEM.mjs} +87 -53
- package/dist/{chunk-IFVIPIAA.js → chunk-OREZJC6O.js} +144 -55
- package/dist/{chunk-DSXII6ZF.js → chunk-OZD75CLT.js} +3 -3
- package/dist/{chunk-JCINYGGM.js → chunk-PUZDW7NR.js} +12 -12
- package/dist/{chunk-ABTJVM3X.js → chunk-RF2BA2N6.js} +2 -2
- package/dist/{chunk-TLU3ROLT.js → chunk-UMZ3PMUJ.js} +2 -1
- package/dist/{chunk-TGKNEMD4.mjs → chunk-WMPCN7OF.mjs} +3 -1
- package/dist/{chunk-HUMGEP7S.mjs → chunk-WX5VUIGT.mjs} +3 -2
- package/dist/{chunk-OXDX6CH2.mjs → chunk-Y5RQN5BO.mjs} +1 -1
- package/dist/{chunk-OQTPXPAP.mjs → chunk-YN5ZIWCE.mjs} +8 -3
- package/dist/{chunk-JVTAKNRO.mjs → chunk-ZA5EFHET.mjs} +1 -1
- package/dist/{chunk-VCULFIZ5.js → chunk-ZJI2VLIL.js} +2 -0
- package/dist/{chunk-XJXEAXWY.mjs → chunk-ZJXKVQ4G.mjs} +20 -8
- package/dist/{chunk-56ZV3VVY.js → chunk-ZLNBE4IS.js} +2 -0
- package/dist/{chunk-PR3PQUKM.js → chunk-ZZAR4IDS.js} +1 -1
- package/dist/components/ActivityFeed.js +5 -5
- package/dist/components/ActivityFeed.mjs +4 -4
- package/dist/components/Button.js +2 -2
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Card.js +2 -2
- package/dist/components/Card.mjs +1 -1
- package/dist/components/ChatWindow.js +3 -3
- package/dist/components/ChatWindow.mjs +2 -2
- package/dist/components/CommentThread.js +4 -4
- package/dist/components/CommentThread.mjs +3 -3
- package/dist/components/Content.js +2 -2
- package/dist/components/Content.mjs +1 -1
- package/dist/components/CropUpload.js +4 -4
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataTableWithToolbar.d.mts +10 -3
- package/dist/components/DataTableWithToolbar.d.ts +10 -3
- package/dist/components/DataTableWithToolbar.js +4 -4
- package/dist/components/DataTableWithToolbar.mjs +3 -3
- package/dist/components/Drawer.js +2 -2
- package/dist/components/Drawer.mjs +1 -1
- package/dist/components/Dropdown.js +2 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/DropdownItem.js +3 -3
- package/dist/components/DropdownItem.mjs +2 -2
- package/dist/components/DropdownMenu.js +2 -2
- package/dist/components/DropdownMenu.mjs +1 -1
- package/dist/components/Form.js +2 -2
- package/dist/components/Form.mjs +1 -1
- package/dist/components/FormItem.js +3 -3
- package/dist/components/FormItem.mjs +2 -2
- package/dist/components/FormWizard.js +3 -3
- package/dist/components/FormWizard.mjs +2 -2
- package/dist/components/Header.js +2 -2
- package/dist/components/Header.mjs +1 -1
- package/dist/components/Icon.js +2 -2
- package/dist/components/Icon.mjs +1 -1
- package/dist/components/Image.js +3 -2
- package/dist/components/Image.mjs +2 -1
- package/dist/components/Menu.js +2 -2
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/MenuItem.mjs +1 -1
- package/dist/components/MenuItemGroup.js +2 -2
- package/dist/components/MenuItemGroup.mjs +1 -1
- package/dist/components/Modal.js +3 -3
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.js +4 -4
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/SubMenu.js +2 -2
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/Table.d.mts +1 -1
- package/dist/components/Table.d.ts +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/components/Tag.js +2 -2
- package/dist/components/Tag.mjs +1 -1
- package/dist/components/Timeline.js +2 -2
- package/dist/components/Timeline.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -24
- package/dist/index.mjs +23 -23
- package/package.json +2 -2
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
getTableWrapperClasses,
|
|
23
23
|
getCardColumns,
|
|
24
24
|
getCardGridInfo,
|
|
25
|
+
getTableResponsiveCardClasses,
|
|
25
26
|
getTableResponsiveCardListClasses,
|
|
26
27
|
getTableResponsiveTableClasses,
|
|
27
28
|
getTableVirtualRecommendation,
|
|
@@ -29,7 +30,6 @@ import {
|
|
|
29
30
|
formatTableSortByText,
|
|
30
31
|
getTableLabels,
|
|
31
32
|
tableBaseClasses,
|
|
32
|
-
tableResponsiveCardClasses,
|
|
33
33
|
tableResponsiveCardLabelClasses,
|
|
34
34
|
tableResponsiveCardRowClasses,
|
|
35
35
|
tableResponsiveCardTitleClasses,
|
|
@@ -996,6 +996,9 @@ function Table({
|
|
|
996
996
|
cardClassName,
|
|
997
997
|
renderCard,
|
|
998
998
|
cardLayout,
|
|
999
|
+
cardSelectionPosition = "controls-row",
|
|
1000
|
+
cardPadding,
|
|
1001
|
+
cardFieldGap = "gap-3",
|
|
999
1002
|
// v0.6.0 props
|
|
1000
1003
|
virtual = false,
|
|
1001
1004
|
autoVirtual = true,
|
|
@@ -1291,7 +1294,7 @@ function Table({
|
|
|
1291
1294
|
}
|
|
1292
1295
|
}
|
|
1293
1296
|
) }) : null,
|
|
1294
|
-
ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className:
|
|
1297
|
+
ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: getTableResponsiveCardClasses(cardPadding), children: /* @__PURE__ */ jsx6(Empty, { showImage: false, description: tableLabels.emptyText }) }) : ctx.paginatedData.map((record, index) => {
|
|
1295
1298
|
const key = ctx.pageRowKeys[index];
|
|
1296
1299
|
const isExpanded = ctx.expandedRowKeySet.has(key);
|
|
1297
1300
|
const isSelected = ctx.selectedRowKeySet.has(key);
|
|
@@ -1309,54 +1312,57 @@ function Table({
|
|
|
1309
1312
|
};
|
|
1310
1313
|
const customCard = renderCard?.(renderContext);
|
|
1311
1314
|
const resolvedCardClassName = typeof cardClassName === "function" ? cardClassName(record, index) : cardClassName;
|
|
1315
|
+
const controlsNode = internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1316
|
+
internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6("span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ jsx6(
|
|
1317
|
+
Radio,
|
|
1318
|
+
{
|
|
1319
|
+
value: key,
|
|
1320
|
+
checked: isSelected,
|
|
1321
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1322
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1323
|
+
tableLabels.selectRowAriaLabel,
|
|
1324
|
+
index + 1,
|
|
1325
|
+
tableLocale?.locale
|
|
1326
|
+
),
|
|
1327
|
+
onChange: () => ctx.handleSelectRow(key, true)
|
|
1328
|
+
}
|
|
1329
|
+
) : /* @__PURE__ */ jsx6(
|
|
1330
|
+
Checkbox,
|
|
1331
|
+
{
|
|
1332
|
+
size: "sm",
|
|
1333
|
+
checked: isSelected,
|
|
1334
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1335
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1336
|
+
tableLabels.selectRowAriaLabel,
|
|
1337
|
+
index + 1,
|
|
1338
|
+
tableLocale?.locale
|
|
1339
|
+
),
|
|
1340
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1341
|
+
}
|
|
1342
|
+
) }),
|
|
1343
|
+
internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
|
|
1344
|
+
"button",
|
|
1345
|
+
{
|
|
1346
|
+
type: "button",
|
|
1347
|
+
className: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1348
|
+
"aria-expanded": isExpanded,
|
|
1349
|
+
onClick: (event) => {
|
|
1350
|
+
event.stopPropagation();
|
|
1351
|
+
ctx.handleToggleExpand(key, record);
|
|
1352
|
+
},
|
|
1353
|
+
children: isExpanded ? tableLabels.collapseText : tableLabels.expandText
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
] }) : null;
|
|
1312
1357
|
return /* @__PURE__ */ jsx6(
|
|
1313
1358
|
"div",
|
|
1314
1359
|
{
|
|
1315
|
-
className: classNames3(
|
|
1360
|
+
className: classNames3(
|
|
1361
|
+
getTableResponsiveCardClasses(cardPadding),
|
|
1362
|
+
resolvedCardClassName
|
|
1363
|
+
),
|
|
1316
1364
|
onClick: () => ctx.handleRowClick(record, index, key),
|
|
1317
1365
|
children: customCard !== void 0 && customCard !== null ? customCard : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1318
|
-
internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 flex items-center gap-3", children: [
|
|
1319
|
-
internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6("span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ jsx6(
|
|
1320
|
-
Radio,
|
|
1321
|
-
{
|
|
1322
|
-
value: key,
|
|
1323
|
-
checked: isSelected,
|
|
1324
|
-
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1325
|
-
"aria-label": formatTableSelectRowAriaLabel(
|
|
1326
|
-
tableLabels.selectRowAriaLabel,
|
|
1327
|
-
index + 1,
|
|
1328
|
-
tableLocale?.locale
|
|
1329
|
-
),
|
|
1330
|
-
onChange: () => ctx.handleSelectRow(key, true)
|
|
1331
|
-
}
|
|
1332
|
-
) : /* @__PURE__ */ jsx6(
|
|
1333
|
-
Checkbox,
|
|
1334
|
-
{
|
|
1335
|
-
size: "sm",
|
|
1336
|
-
checked: isSelected,
|
|
1337
|
-
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1338
|
-
"aria-label": formatTableSelectRowAriaLabel(
|
|
1339
|
-
tableLabels.selectRowAriaLabel,
|
|
1340
|
-
index + 1,
|
|
1341
|
-
tableLocale?.locale
|
|
1342
|
-
),
|
|
1343
|
-
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1344
|
-
}
|
|
1345
|
-
) }),
|
|
1346
|
-
internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
|
|
1347
|
-
"button",
|
|
1348
|
-
{
|
|
1349
|
-
type: "button",
|
|
1350
|
-
className: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1351
|
-
"aria-expanded": isExpanded,
|
|
1352
|
-
onClick: (event) => {
|
|
1353
|
-
event.stopPropagation();
|
|
1354
|
-
ctx.handleToggleExpand(key, record);
|
|
1355
|
-
},
|
|
1356
|
-
children: isExpanded ? tableLabels.collapseText : tableLabels.expandText
|
|
1357
|
-
}
|
|
1358
|
-
)
|
|
1359
|
-
] }) : null,
|
|
1360
1366
|
(() => {
|
|
1361
1367
|
const { titleColumn, bodyColumns } = getCardColumns(ctx.displayColumns);
|
|
1362
1368
|
const renderCellContent = (column) => {
|
|
@@ -1365,29 +1371,99 @@ function Table({
|
|
|
1365
1371
|
};
|
|
1366
1372
|
if (hasCustomCardLayout) {
|
|
1367
1373
|
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1368
|
-
titleColumn && /* @__PURE__ */
|
|
1369
|
-
|
|
1374
|
+
titleColumn && /* @__PURE__ */ jsxs5(
|
|
1375
|
+
"div",
|
|
1376
|
+
{
|
|
1377
|
+
className: classNames3(
|
|
1378
|
+
tableResponsiveCardTitleClasses,
|
|
1379
|
+
cardSelectionPosition === "title-inline" && controlsNode && "flex items-center gap-3"
|
|
1380
|
+
),
|
|
1381
|
+
children: [
|
|
1382
|
+
cardSelectionPosition === "title-inline" && controlsNode,
|
|
1383
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1", children: renderCellContent(titleColumn) })
|
|
1384
|
+
]
|
|
1385
|
+
}
|
|
1386
|
+
),
|
|
1387
|
+
(!titleColumn || cardSelectionPosition !== "title-inline") && controlsNode && /* @__PURE__ */ jsx6("div", { className: "mb-2 flex items-center gap-3", children: controlsNode }),
|
|
1388
|
+
/* @__PURE__ */ jsx6("div", { className: classNames3("grid grid-cols-12 mt-2", cardFieldGap), children: bodyColumns.map((column) => {
|
|
1370
1389
|
const layoutItem = cardLayoutMap.get(column.key);
|
|
1371
1390
|
const gridInfo = getCardGridInfo(column, layoutItem);
|
|
1372
1391
|
if (gridInfo.hideLabel) {
|
|
1373
|
-
return /* @__PURE__ */ jsx6(
|
|
1392
|
+
return /* @__PURE__ */ jsx6(
|
|
1393
|
+
"div",
|
|
1394
|
+
{
|
|
1395
|
+
className: classNames3(
|
|
1396
|
+
gridInfo.className,
|
|
1397
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1398
|
+
),
|
|
1399
|
+
children: renderCellContent(column)
|
|
1400
|
+
},
|
|
1401
|
+
column.key
|
|
1402
|
+
);
|
|
1374
1403
|
}
|
|
1375
1404
|
if (gridInfo.labelPosition === "top") {
|
|
1376
|
-
return /* @__PURE__ */ jsxs5(
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1405
|
+
return /* @__PURE__ */ jsxs5(
|
|
1406
|
+
"div",
|
|
1407
|
+
{
|
|
1408
|
+
className: classNames3(
|
|
1409
|
+
gridInfo.className,
|
|
1410
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1411
|
+
),
|
|
1412
|
+
children: [
|
|
1413
|
+
/* @__PURE__ */ jsx6(
|
|
1414
|
+
"div",
|
|
1415
|
+
{
|
|
1416
|
+
className: classNames3(
|
|
1417
|
+
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] mb-1",
|
|
1418
|
+
gridInfo.labelClassName
|
|
1419
|
+
),
|
|
1420
|
+
children: column.title
|
|
1421
|
+
}
|
|
1422
|
+
),
|
|
1423
|
+
/* @__PURE__ */ jsx6(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
className: classNames3(
|
|
1427
|
+
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1428
|
+
gridInfo.valueClassName
|
|
1429
|
+
),
|
|
1430
|
+
children: renderCellContent(column)
|
|
1431
|
+
}
|
|
1432
|
+
)
|
|
1433
|
+
]
|
|
1434
|
+
},
|
|
1435
|
+
column.key
|
|
1436
|
+
);
|
|
1380
1437
|
}
|
|
1381
1438
|
return /* @__PURE__ */ jsxs5(
|
|
1382
1439
|
"div",
|
|
1383
1440
|
{
|
|
1384
1441
|
className: classNames3(
|
|
1385
1442
|
gridInfo.className,
|
|
1386
|
-
"grid grid-cols-[auto_1fr] gap-2 items-baseline"
|
|
1443
|
+
"grid grid-cols-[auto_1fr] gap-2 items-baseline",
|
|
1444
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1387
1445
|
),
|
|
1388
1446
|
children: [
|
|
1389
|
-
/* @__PURE__ */ jsx6(
|
|
1390
|
-
|
|
1447
|
+
/* @__PURE__ */ jsx6(
|
|
1448
|
+
"div",
|
|
1449
|
+
{
|
|
1450
|
+
className: classNames3(
|
|
1451
|
+
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] shrink-0",
|
|
1452
|
+
gridInfo.labelClassName
|
|
1453
|
+
),
|
|
1454
|
+
children: column.title
|
|
1455
|
+
}
|
|
1456
|
+
),
|
|
1457
|
+
/* @__PURE__ */ jsx6(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
className: classNames3(
|
|
1461
|
+
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1462
|
+
gridInfo.valueClassName
|
|
1463
|
+
),
|
|
1464
|
+
children: renderCellContent(column)
|
|
1465
|
+
}
|
|
1466
|
+
)
|
|
1391
1467
|
]
|
|
1392
1468
|
},
|
|
1393
1469
|
column.key
|
|
@@ -1396,7 +1472,20 @@ function Table({
|
|
|
1396
1472
|
] });
|
|
1397
1473
|
}
|
|
1398
1474
|
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1399
|
-
titleColumn && /* @__PURE__ */
|
|
1475
|
+
titleColumn && /* @__PURE__ */ jsxs5(
|
|
1476
|
+
"div",
|
|
1477
|
+
{
|
|
1478
|
+
className: classNames3(
|
|
1479
|
+
tableResponsiveCardTitleClasses,
|
|
1480
|
+
cardSelectionPosition === "title-inline" && controlsNode && "flex items-center gap-3"
|
|
1481
|
+
),
|
|
1482
|
+
children: [
|
|
1483
|
+
cardSelectionPosition === "title-inline" && controlsNode,
|
|
1484
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1", children: renderCellContent(titleColumn) })
|
|
1485
|
+
]
|
|
1486
|
+
}
|
|
1487
|
+
),
|
|
1488
|
+
(!titleColumn || cardSelectionPosition !== "title-inline") && controlsNode && /* @__PURE__ */ jsx6("div", { className: "mb-2 flex items-center gap-3", children: controlsNode }),
|
|
1400
1489
|
bodyColumns.map((column) => /* @__PURE__ */ jsxs5("div", { className: tableResponsiveCardRowClasses, children: [
|
|
1401
1490
|
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
|
|
1402
1491
|
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: renderCellContent(column) })
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkOZD75CLTjs = require('./chunk-OZD75CLT.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkFI53LYZ6js = require('./chunk-FI53LYZ6.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkZLNBE4ISjs = require('./chunk-ZLNBE4IS.js');
|
|
10
10
|
|
|
11
11
|
// src/components/CropUpload.tsx
|
|
12
12
|
var _react = require('react');
|
|
@@ -140,7 +140,7 @@ var CropUpload = ({
|
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
142
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
143
|
-
|
|
143
|
+
_chunkOZD75CLTjs.Modal,
|
|
144
144
|
{
|
|
145
145
|
open: modalVisible,
|
|
146
146
|
size: "lg",
|
|
@@ -150,8 +150,8 @@ var CropUpload = ({
|
|
|
150
150
|
maskClosable: false,
|
|
151
151
|
onClose: handleCancel,
|
|
152
152
|
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-end gap-3", children: [
|
|
153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZLNBE4ISjs.Button, { variant: "secondary", onClick: handleCancel, children: "\u53D6\u6D88" }),
|
|
154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZLNBE4ISjs.Button, { onClick: handleConfirm, loading: cropping, children: "\u786E\u8BA4\u88C1\u526A" })
|
|
155
155
|
] }),
|
|
156
156
|
children: imageSrc && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFI53LYZ6js.ImageCropper, { ref: cropperRef, src: imageSrc, ...cropperProps })
|
|
157
157
|
}
|
|
@@ -38,7 +38,7 @@ var Form = forwardRef(
|
|
|
38
38
|
rules,
|
|
39
39
|
labelWidth,
|
|
40
40
|
labelPosition = "right",
|
|
41
|
-
labelAlign
|
|
41
|
+
labelAlign,
|
|
42
42
|
size = "md",
|
|
43
43
|
inlineMessage = true,
|
|
44
44
|
showRequiredAsterisk = true,
|
|
@@ -56,6 +56,7 @@ var Form = forwardRef(
|
|
|
56
56
|
maxHistorySize = 50,
|
|
57
57
|
...props
|
|
58
58
|
}, ref) => {
|
|
59
|
+
const resolvedLabelAlign = labelAlign ?? (labelPosition === "top" ? "left" : "right");
|
|
59
60
|
const [errors, setErrors] = useState([]);
|
|
60
61
|
const [formValues, setFormValues] = useState(model);
|
|
61
62
|
const fieldRulesRef = React.useRef({});
|
|
@@ -400,7 +401,7 @@ var Form = forwardRef(
|
|
|
400
401
|
rules,
|
|
401
402
|
labelWidth,
|
|
402
403
|
labelPosition,
|
|
403
|
-
labelAlign,
|
|
404
|
+
labelAlign: resolvedLabelAlign,
|
|
404
405
|
size,
|
|
405
406
|
inlineMessage,
|
|
406
407
|
showRequiredAsterisk,
|
|
@@ -420,7 +421,7 @@ var Form = forwardRef(
|
|
|
420
421
|
rules,
|
|
421
422
|
labelWidth,
|
|
422
423
|
labelPosition,
|
|
423
|
-
|
|
424
|
+
resolvedLabelAlign,
|
|
424
425
|
size,
|
|
425
426
|
inlineMessage,
|
|
426
427
|
showRequiredAsterisk,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Timeline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZA5EFHET.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Loading
|
|
6
6
|
} from "./chunk-FNJDBFKM.mjs";
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./chunk-XZVQ3PJS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Tag
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WMPCN7OF.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Text
|
|
15
15
|
} from "./chunk-HLS4CHWX.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Card
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IXV5YBCZ.mjs";
|
|
19
19
|
import {
|
|
20
20
|
Avatar
|
|
21
21
|
} from "./chunk-4ZZ7YRTB.mjs";
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
6
6
|
var _jsxruntime = require('react/jsx-runtime');
|
|
7
|
-
var Content = ({
|
|
8
|
-
|
|
7
|
+
var Content = ({
|
|
8
|
+
className,
|
|
9
|
+
padding = true,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
const contentClasses = _tigercatcore.classNames.call(void 0, _tigercatcore.getLayoutContentClasses.call(void 0, padding), className);
|
|
9
14
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "main", { className: contentClasses, ...props, children });
|
|
10
15
|
};
|
|
11
16
|
|
|
@@ -21,6 +21,7 @@ var Card = _react2.default.memo(
|
|
|
21
21
|
hoverable = false,
|
|
22
22
|
cover,
|
|
23
23
|
coverAlt = "Card cover image",
|
|
24
|
+
padding,
|
|
24
25
|
header,
|
|
25
26
|
footer,
|
|
26
27
|
actions,
|
|
@@ -29,11 +30,12 @@ var Card = _react2.default.memo(
|
|
|
29
30
|
...props
|
|
30
31
|
}) => {
|
|
31
32
|
const isHorizontal = direction === "horizontal";
|
|
32
|
-
const
|
|
33
|
+
const paddingClass = _tigercatcore.resolveCardPadding.call(void 0, size, padding);
|
|
34
|
+
const sectionSizeClass = cover ? paddingClass : void 0;
|
|
33
35
|
const cardClasses = _tigercatcore.classNames.call(void 0,
|
|
34
36
|
_tigercatcore.getCardClasses.call(void 0, variant, hoverable),
|
|
35
37
|
_tigercatcore.cardDirectionClasses[direction],
|
|
36
|
-
!cover &&
|
|
38
|
+
!cover && paddingClass,
|
|
37
39
|
className
|
|
38
40
|
);
|
|
39
41
|
const getSectionClasses = (baseClasses) => _tigercatcore.classNames.call(void 0, baseClasses, sectionSizeClass);
|
|
@@ -4,6 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ImagePreview
|
|
6
6
|
} from "./chunk-6GYT3EZD.mjs";
|
|
7
|
+
import {
|
|
8
|
+
usePopup
|
|
9
|
+
} from "./chunk-C44WSDEY.mjs";
|
|
10
|
+
import {
|
|
11
|
+
renderBodyPortal
|
|
12
|
+
} from "./chunk-SEWNVIHH.mjs";
|
|
7
13
|
|
|
8
14
|
// src/components/Image.tsx
|
|
9
15
|
import { useState, useRef, useEffect, useMemo, useContext, useCallback } from "react";
|
|
@@ -37,6 +43,7 @@ var Image = ({
|
|
|
37
43
|
fit = "cover",
|
|
38
44
|
fallbackSrc,
|
|
39
45
|
preview = true,
|
|
46
|
+
previewTrigger = "click",
|
|
40
47
|
lazy = false,
|
|
41
48
|
className,
|
|
42
49
|
errorRender,
|
|
@@ -54,6 +61,27 @@ var Image = ({
|
|
|
54
61
|
const containerRef = useRef(null);
|
|
55
62
|
const group = useContext(ImageGroupContext);
|
|
56
63
|
const registeredIndexRef = useRef(-1);
|
|
64
|
+
const hoverPreviewEnabled = preview && previewTrigger === "hover" && !group;
|
|
65
|
+
const clickPreviewEnabled = preview && previewTrigger !== "hover";
|
|
66
|
+
const {
|
|
67
|
+
currentVisible: hoverVisible,
|
|
68
|
+
triggerRef: hoverTriggerRef,
|
|
69
|
+
floatingRef: hoverFloatingRef,
|
|
70
|
+
floatingStyles: hoverFloatingStyles,
|
|
71
|
+
triggerHandlers: hoverTriggerHandlers
|
|
72
|
+
} = usePopup({
|
|
73
|
+
trigger: "hover",
|
|
74
|
+
placement: "right",
|
|
75
|
+
offset: 12,
|
|
76
|
+
disabled: !hoverPreviewEnabled
|
|
77
|
+
});
|
|
78
|
+
const setRootRef = useCallback(
|
|
79
|
+
(el) => {
|
|
80
|
+
containerRef.current = el;
|
|
81
|
+
hoverTriggerRef.current = el;
|
|
82
|
+
},
|
|
83
|
+
[hoverTriggerRef]
|
|
84
|
+
);
|
|
57
85
|
useEffect(() => {
|
|
58
86
|
if (group && src) {
|
|
59
87
|
registeredIndexRef.current = group.register(src);
|
|
@@ -99,7 +127,7 @@ var Image = ({
|
|
|
99
127
|
const handleClick = useCallback(
|
|
100
128
|
(e) => {
|
|
101
129
|
onClick?.(e);
|
|
102
|
-
if (!
|
|
130
|
+
if (!clickPreviewEnabled) return;
|
|
103
131
|
if (group) {
|
|
104
132
|
group.openPreview(registeredIndexRef.current >= 0 ? registeredIndexRef.current : 0);
|
|
105
133
|
} else {
|
|
@@ -107,17 +135,17 @@ var Image = ({
|
|
|
107
135
|
onPreviewOpenChange?.(true);
|
|
108
136
|
}
|
|
109
137
|
},
|
|
110
|
-
[
|
|
138
|
+
[clickPreviewEnabled, group, onClick, onPreviewOpenChange]
|
|
111
139
|
);
|
|
112
140
|
const handleKeyDown = useCallback(
|
|
113
141
|
(e) => {
|
|
114
142
|
onKeyDown?.(e);
|
|
115
|
-
if (
|
|
143
|
+
if (clickPreviewEnabled && (e.key === "Enter" || e.key === " ")) {
|
|
116
144
|
e.preventDefault();
|
|
117
145
|
handleClick(e);
|
|
118
146
|
}
|
|
119
147
|
},
|
|
120
|
-
[
|
|
148
|
+
[clickPreviewEnabled, handleClick, onKeyDown]
|
|
121
149
|
);
|
|
122
150
|
const containerClasses = useMemo(
|
|
123
151
|
() => classNames(imageBaseClasses, preview && imagePreviewCursorClass, className),
|
|
@@ -154,14 +182,15 @@ var Image = ({
|
|
|
154
182
|
"div",
|
|
155
183
|
{
|
|
156
184
|
...props,
|
|
157
|
-
ref:
|
|
185
|
+
ref: setRootRef,
|
|
158
186
|
className: containerClasses,
|
|
159
187
|
style: containerStyle,
|
|
160
|
-
role:
|
|
161
|
-
tabIndex:
|
|
162
|
-
"aria-label":
|
|
188
|
+
role: clickPreviewEnabled ? "button" : void 0,
|
|
189
|
+
tabIndex: clickPreviewEnabled ? 0 : void 0,
|
|
190
|
+
"aria-label": clickPreviewEnabled ? `Preview ${alt || "image"}` : void 0,
|
|
163
191
|
onClick: handleClick,
|
|
164
192
|
onKeyDown: handleKeyDown,
|
|
193
|
+
...hoverPreviewEnabled ? hoverTriggerHandlers : {},
|
|
165
194
|
children: content
|
|
166
195
|
}
|
|
167
196
|
),
|
|
@@ -176,6 +205,18 @@ var Image = ({
|
|
|
176
205
|
onPreviewOpenChange?.(val);
|
|
177
206
|
}
|
|
178
207
|
}
|
|
208
|
+
),
|
|
209
|
+
hoverPreviewEnabled && hoverVisible && src && renderBodyPortal(
|
|
210
|
+
/* @__PURE__ */ jsx(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
ref: hoverFloatingRef,
|
|
214
|
+
style: hoverFloatingStyles,
|
|
215
|
+
"aria-hidden": true,
|
|
216
|
+
className: "rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] p-1 shadow-lg",
|
|
217
|
+
children: /* @__PURE__ */ jsx("img", { src, alt: "", className: "block max-w-[16rem] max-h-[16rem] object-contain" })
|
|
218
|
+
}
|
|
219
|
+
)
|
|
179
220
|
)
|
|
180
221
|
] });
|
|
181
222
|
};
|
|
@@ -7,7 +7,7 @@ var _chunkM7HBWFQOjs = require('./chunk-M7HBWFQO.js');
|
|
|
7
7
|
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkZLNBE4ISjs = require('./chunk-ZLNBE4IS.js');
|
|
11
11
|
|
|
12
12
|
// src/components/FormWizard.tsx
|
|
13
13
|
var _react = require('react');
|
|
@@ -215,7 +215,7 @@ var FormWizard = ({
|
|
|
215
215
|
),
|
|
216
216
|
children: [
|
|
217
217
|
!isFirst ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
218
|
-
|
|
218
|
+
_chunkZLNBE4ISjs.Button,
|
|
219
219
|
{
|
|
220
220
|
htmlType: "button",
|
|
221
221
|
variant: "secondary",
|
|
@@ -227,7 +227,7 @@ var FormWizard = ({
|
|
|
227
227
|
}
|
|
228
228
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
229
229
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
230
|
-
|
|
230
|
+
_chunkZLNBE4ISjs.Button,
|
|
231
231
|
{
|
|
232
232
|
htmlType: "button",
|
|
233
233
|
variant: "primary",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
iconSvgDefaultStrokeLinejoin,
|
|
9
9
|
iconSvgDefaultStrokeWidth,
|
|
10
10
|
iconWrapperClasses,
|
|
11
|
+
getIconDefinition,
|
|
11
12
|
SVG_DEFAULT_FILL,
|
|
12
13
|
SVG_DEFAULT_STROKE,
|
|
13
14
|
SVG_DEFAULT_VIEWBOX_24,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
} from "@expcat/tigercat-core";
|
|
16
17
|
import { jsx } from "react/jsx-runtime";
|
|
17
18
|
var Icon = ({
|
|
19
|
+
name,
|
|
18
20
|
size = "md",
|
|
19
21
|
color = "currentColor",
|
|
20
22
|
className,
|
|
@@ -25,6 +27,22 @@ var Icon = ({
|
|
|
25
27
|
const iconClasses = classNames(iconWrapperClasses, className);
|
|
26
28
|
const iconStyle = { ...style, color };
|
|
27
29
|
const isDecorative = props["aria-label"] == null && props["aria-labelledby"] == null && props.role == null;
|
|
30
|
+
const hasChildren = React.Children.count(children) > 0;
|
|
31
|
+
const definition = !hasChildren && name ? getIconDefinition(name) : void 0;
|
|
32
|
+
const builtInSvg = definition ? /* @__PURE__ */ jsx(
|
|
33
|
+
"svg",
|
|
34
|
+
{
|
|
35
|
+
className: classNames(iconSvgBaseClasses, iconSizeClasses[size]),
|
|
36
|
+
xmlns: SVG_DEFAULT_XMLNS,
|
|
37
|
+
viewBox: definition.viewBox,
|
|
38
|
+
fill: definition.mode === "fill" ? "currentColor" : SVG_DEFAULT_FILL,
|
|
39
|
+
stroke: definition.mode === "stroke" ? "currentColor" : SVG_DEFAULT_STROKE,
|
|
40
|
+
strokeWidth: definition.mode === "stroke" ? 1.5 : void 0,
|
|
41
|
+
strokeLinecap: definition.mode === "stroke" ? iconSvgDefaultStrokeLinecap : void 0,
|
|
42
|
+
strokeLinejoin: definition.mode === "stroke" ? iconSvgDefaultStrokeLinejoin : void 0,
|
|
43
|
+
children: definition.paths.map((d, i) => /* @__PURE__ */ jsx("path", { d }, i))
|
|
44
|
+
}
|
|
45
|
+
) : null;
|
|
28
46
|
const processedChildren = React.Children.map(children, (child) => {
|
|
29
47
|
if (!React.isValidElement(child) || child.type !== "svg") {
|
|
30
48
|
return child;
|
|
@@ -49,7 +67,7 @@ var Icon = ({
|
|
|
49
67
|
className: iconClasses,
|
|
50
68
|
style: iconStyle,
|
|
51
69
|
...isDecorative ? { "aria-hidden": true } : { role: props.role ?? "img" },
|
|
52
|
-
children: processedChildren
|
|
70
|
+
children: builtInSvg ?? processedChildren
|
|
53
71
|
}
|
|
54
72
|
);
|
|
55
73
|
};
|