@expcat/tigercat-react 1.2.34 → 1.2.39

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 (33) hide show
  1. package/dist/{chunk-6HELKWFN.js → chunk-3LCISRAV.js} +17 -3
  2. package/dist/{chunk-KRFD27WA.js → chunk-AT2GRD6F.js} +2 -2
  3. package/dist/{chunk-VHHYTCZQ.js → chunk-FZX7USS4.js} +48 -7
  4. package/dist/{chunk-VXOLIMK2.mjs → chunk-JDJFSO2D.mjs} +48 -7
  5. package/dist/{chunk-UKBVJWP3.mjs → chunk-LJARWKJT.mjs} +1 -1
  6. package/dist/{chunk-JNRUOQNT.js → chunk-LJDILPI6.js} +2 -2
  7. package/dist/{chunk-VAZYY35F.js → chunk-M36PT6BS.js} +208 -66
  8. package/dist/{chunk-VE2YEFG2.mjs → chunk-PCPAMUAE.mjs} +1 -1
  9. package/dist/{chunk-O4UDB6ZE.mjs → chunk-TAYQDWXN.mjs} +1 -1
  10. package/dist/{chunk-AIXYHS2L.mjs → chunk-TSZKBVTA.mjs} +209 -67
  11. package/dist/{chunk-IAONLOJN.js → chunk-XU4TF2YA.js} +2 -2
  12. package/dist/{chunk-4XOWNEZA.mjs → chunk-ZDEOTMXP.mjs} +17 -3
  13. package/dist/components/ChatWindow.js +3 -3
  14. package/dist/components/ChatWindow.mjs +2 -2
  15. package/dist/components/DataTableWithToolbar.d.mts +1 -1
  16. package/dist/components/DataTableWithToolbar.d.ts +1 -1
  17. package/dist/components/DataTableWithToolbar.js +9 -3
  18. package/dist/components/DataTableWithToolbar.mjs +8 -2
  19. package/dist/components/Popconfirm.js +3 -3
  20. package/dist/components/Popconfirm.mjs +2 -2
  21. package/dist/components/Popover.js +3 -3
  22. package/dist/components/Popover.mjs +2 -2
  23. package/dist/components/Table.d.mts +1 -1
  24. package/dist/components/Table.d.ts +1 -1
  25. package/dist/components/Table.js +9 -2
  26. package/dist/components/Table.mjs +8 -1
  27. package/dist/components/Tooltip.js +3 -3
  28. package/dist/components/Tooltip.mjs +2 -2
  29. package/dist/index.js +16 -16
  30. package/dist/index.mjs +16 -16
  31. package/package.json +2 -2
  32. package/dist/{chunk-7KPALCG3.js → chunk-ABTJVM3X.js} +2 -2
  33. package/dist/{chunk-GYFR2O27.mjs → chunk-OXDX6CH2.mjs} +3 -3
@@ -1,6 +1,18 @@
1
+ import {
2
+ Select
3
+ } from "./chunk-T4OVGM4X.mjs";
4
+ import {
5
+ Radio
6
+ } from "./chunk-NPTXXUXF.mjs";
1
7
  import {
2
8
  useTigerConfig
3
9
  } from "./chunk-QAIBQHIO.mjs";
10
+ import {
11
+ Empty
12
+ } from "./chunk-WIWTY74F.mjs";
13
+ import {
14
+ Checkbox
15
+ } from "./chunk-MSHCPJIJ.mjs";
4
16
 
5
17
  // src/components/Table.tsx
6
18
  import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
@@ -8,13 +20,18 @@ import {
8
20
  classNames as classNames3,
9
21
  createTableResizeObserverController,
10
22
  getTableWrapperClasses,
23
+ getCardColumns,
24
+ getTableResponsiveCardListClasses,
11
25
  getTableResponsiveTableClasses,
12
26
  getTableVirtualRecommendation,
27
+ formatTableSelectRowAriaLabel,
28
+ formatTableSortByText,
29
+ getTableLabels,
13
30
  tableBaseClasses,
14
31
  tableResponsiveCardClasses,
15
32
  tableResponsiveCardLabelClasses,
16
- tableResponsiveCardListClasses,
17
33
  tableResponsiveCardRowClasses,
34
+ tableResponsiveCardTitleClasses,
18
35
  tableResponsiveCardValueClasses,
19
36
  tableLoadingOverlayClasses,
20
37
  getImmediateTigerLocale,
@@ -266,6 +283,17 @@ function useTableState(input) {
266
283
  const total = paginationConfig?.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : processedData.length;
267
284
  return calculatePagination(total, currentPage, currentPageSize);
268
285
  }, [processedData.length, currentPage, currentPageSize, pagination, paginationConfig?.total]);
286
+ function handleSetSort(newSortState) {
287
+ if (!isSortControlled) {
288
+ setUncontrolledSortState(newSortState);
289
+ }
290
+ onSortChange?.(newSortState);
291
+ onChange?.({
292
+ sort: newSortState,
293
+ filters: filterState,
294
+ pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
295
+ });
296
+ }
269
297
  function handleSort(columnKey) {
270
298
  const column = columnByKey[columnKey];
271
299
  if (!column || !column.sortable) return;
@@ -277,18 +305,9 @@ function useTableState(input) {
277
305
  newDirection = null;
278
306
  }
279
307
  }
280
- const newSortState = {
308
+ handleSetSort({
281
309
  key: newDirection ? columnKey : null,
282
310
  direction: newDirection
283
- };
284
- if (!isSortControlled) {
285
- setUncontrolledSortState(newSortState);
286
- }
287
- onSortChange?.(newSortState);
288
- onChange?.({
289
- sort: newSortState,
290
- filters: filterState,
291
- pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
292
311
  });
293
312
  }
294
313
  function handleFilter(columnKey, value) {
@@ -466,6 +485,7 @@ function useTableState(input) {
466
485
  handleFilter,
467
486
  handlePageChange,
468
487
  handlePageSizeChange,
488
+ handleSetSort,
469
489
  handleRowClick,
470
490
  handleToggleExpand,
471
491
  handleSelectRow,
@@ -913,7 +933,7 @@ function renderPagination(ctx, view) {
913
933
  }
914
934
 
915
935
  // src/components/Table.tsx
916
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
936
+ import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
917
937
  function Table({
918
938
  columns,
919
939
  columnLockable = false,
@@ -927,7 +947,9 @@ function Table({
927
947
  striped = false,
928
948
  hoverable = true,
929
949
  loading = false,
930
- emptyText = "No data",
950
+ locale,
951
+ labels,
952
+ emptyText,
931
953
  pagination = {
932
954
  current: 1,
933
955
  pageSize: 10,
@@ -944,6 +966,9 @@ function Table({
944
966
  maxHeight,
945
967
  tableLayout = "auto",
946
968
  responsiveMode = "scroll",
969
+ cardBreakpoint = "sm",
970
+ cardClassName,
971
+ renderCard,
947
972
  // v0.6.0 props
948
973
  virtual = false,
949
974
  autoVirtual = true,
@@ -985,12 +1010,18 @@ function Table({
985
1010
  const internalExpandable = expandable;
986
1011
  const internalRowClassName = rowClassName;
987
1012
  const paginationLocaleInput = pagination !== false && typeof pagination === "object" ? pagination.locale : void 0;
1013
+ const tableLocaleInput = locale;
988
1014
  const isPaginationI18nDisabled = paginationLocaleInput === false;
989
1015
  const immediatePaginationLocale = useMemo2(
990
1016
  () => paginationLocaleInput && !isPaginationI18nDisabled ? getImmediateTigerLocale(paginationLocaleInput) : void 0,
991
1017
  [isPaginationI18nDisabled, paginationLocaleInput]
992
1018
  );
993
1019
  const [resolvedPaginationLocale, setResolvedPaginationLocale] = useState2(immediatePaginationLocale);
1020
+ const immediateTableLocale = useMemo2(
1021
+ () => tableLocaleInput ? getImmediateTigerLocale(tableLocaleInput) : void 0,
1022
+ [tableLocaleInput]
1023
+ );
1024
+ const [resolvedTableLocale, setResolvedTableLocale] = useState2(immediateTableLocale);
994
1025
  useEffect2(() => {
995
1026
  let active = true;
996
1027
  setResolvedPaginationLocale(immediatePaginationLocale);
@@ -1005,10 +1036,36 @@ function Table({
1005
1036
  active = false;
1006
1037
  };
1007
1038
  }, [isPaginationI18nDisabled, paginationLocaleInput, immediatePaginationLocale]);
1039
+ useEffect2(() => {
1040
+ let active = true;
1041
+ setResolvedTableLocale(immediateTableLocale);
1042
+ if (tableLocaleInput && isLazyTigerLocale(tableLocaleInput)) {
1043
+ resolveTigerLocale(tableLocaleInput).then((nextLocale) => {
1044
+ if (active) setResolvedTableLocale(nextLocale);
1045
+ }).catch(() => {
1046
+ if (active) setResolvedTableLocale(immediateTableLocale);
1047
+ });
1048
+ }
1049
+ return () => {
1050
+ active = false;
1051
+ };
1052
+ }, [tableLocaleInput, immediateTableLocale]);
1008
1053
  const paginationLocale = useMemo2(
1009
1054
  () => isPaginationI18nDisabled ? void 0 : mergeTigerLocale(config.locale, resolvedPaginationLocale),
1010
1055
  [config.locale, isPaginationI18nDisabled, resolvedPaginationLocale]
1011
1056
  );
1057
+ const tableLocale = useMemo2(
1058
+ () => mergeTigerLocale(config.locale, resolvedTableLocale),
1059
+ [config.locale, resolvedTableLocale]
1060
+ );
1061
+ const tableLabelOverrides = useMemo2(
1062
+ () => emptyText === void 0 ? labels : { ...labels, emptyText },
1063
+ [emptyText, labels]
1064
+ );
1065
+ const tableLabels = useMemo2(
1066
+ () => getTableLabels(tableLocale, tableLabelOverrides),
1067
+ [tableLabelOverrides, tableLocale]
1068
+ );
1012
1069
  const ctx = useTableState({
1013
1070
  columns,
1014
1071
  dataSource,
@@ -1103,7 +1160,7 @@ function Table({
1103
1160
  ref: tableRef,
1104
1161
  className: classNames3(
1105
1162
  tableBaseClasses,
1106
- getTableResponsiveTableClasses(responsiveMode),
1163
+ getTableResponsiveTableClasses(responsiveMode, cardBreakpoint),
1107
1164
  tableLayout === "fixed" ? "table-fixed" : "table-auto",
1108
1165
  className
1109
1166
  ),
@@ -1126,7 +1183,7 @@ function Table({
1126
1183
  hoverable,
1127
1184
  striped,
1128
1185
  loading,
1129
- emptyText,
1186
+ emptyText: tableLabels.emptyText,
1130
1187
  rowSelection: internalRowSelection,
1131
1188
  expandable: internalExpandable,
1132
1189
  rowClassName: internalRowClassName,
@@ -1141,68 +1198,153 @@ function Table({
1141
1198
  ]
1142
1199
  }
1143
1200
  ),
1144
- responsiveMode === "card" && /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardListClasses, "data-tiger-table-mobile": "card", children: ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardClasses, children: emptyText }) : ctx.paginatedData.map((record, index) => {
1145
- const key = ctx.pageRowKeys[index];
1146
- const isExpanded = ctx.expandedRowKeySet.has(key);
1147
- const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
1148
- const expandedContent = internalExpandable && isExpanded && isRowExpandable ? internalExpandable.expandedRowRender?.(record, index) : null;
1149
- const expandedNode = expandedContent;
1150
- return /* @__PURE__ */ jsxs5(
1151
- "div",
1152
- {
1153
- className: tableResponsiveCardClasses,
1154
- onClick: () => ctx.handleRowClick(record, index, key),
1155
- children: [
1156
- internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 flex items-center gap-3", children: [
1157
- internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6(
1158
- "input",
1159
- {
1160
- type: internalRowSelection.type === "radio" ? "radio" : "checkbox",
1161
- checked: ctx.selectedRowKeySet.has(key),
1162
- disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
1163
- onClick: (event) => event.stopPropagation(),
1164
- onChange: (event) => ctx.handleSelectRow(key, event.target.checked)
1165
- }
1166
- ),
1167
- internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
1168
- "button",
1169
- {
1170
- type: "button",
1171
- className: "text-sm text-[var(--tiger-primary,#2563eb)]",
1172
- "aria-expanded": isExpanded,
1173
- onClick: (event) => {
1174
- event.stopPropagation();
1175
- ctx.handleToggleExpand(key, record);
1201
+ responsiveMode === "card" && /* @__PURE__ */ jsxs5(
1202
+ "div",
1203
+ {
1204
+ className: getTableResponsiveCardListClasses(cardBreakpoint),
1205
+ "data-tiger-table-mobile": "card",
1206
+ children: [
1207
+ internalRowSelection?.type !== "radio" && internalRowSelection?.showCheckbox !== false && internalRowSelection && ctx.paginatedData.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-between rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
1208
+ Checkbox,
1209
+ {
1210
+ size: "sm",
1211
+ checked: ctx.allSelected,
1212
+ indeterminate: ctx.someSelected,
1213
+ onChange: (checked) => ctx.handleSelectAll(checked),
1214
+ children: tableLabels.selectAllText
1215
+ }
1216
+ ) }) : null,
1217
+ ctx.displayColumns.some((column) => column.sortable) ? /* @__PURE__ */ jsx6("div", { className: "rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
1218
+ Select,
1219
+ {
1220
+ size: "sm",
1221
+ value: ctx.sortState.key && ctx.sortState.direction ? `${ctx.sortState.key}:${ctx.sortState.direction}` : "",
1222
+ options: [
1223
+ { label: tableLabels.clearSortText, value: "" },
1224
+ ...ctx.displayColumns.filter((column) => column.sortable).flatMap((column) => [
1225
+ {
1226
+ label: `${formatTableSortByText(tableLabels.sortByText, column.title)} \u2191`,
1227
+ value: `${column.key}:asc`
1176
1228
  },
1177
- children: isExpanded ? "Collapse" : "Expand"
1229
+ {
1230
+ label: `${formatTableSortByText(tableLabels.sortByText, column.title)} \u2193`,
1231
+ value: `${column.key}:desc`
1232
+ }
1233
+ ])
1234
+ ],
1235
+ clearable: false,
1236
+ onChange: (value) => {
1237
+ const nextValue = String(value ?? "");
1238
+ if (!nextValue) {
1239
+ ctx.handleSetSort({ key: null, direction: null });
1240
+ return;
1178
1241
  }
1179
- )
1180
- ] }) : null,
1181
- ctx.displayColumns.map((column) => {
1182
- const dataKey = column.dataKey || column.key;
1183
- const cellValue = record[dataKey];
1184
- const cellContent = column.render ? column.render(record, index) : cellValue;
1185
- return /* @__PURE__ */ jsxs5("div", { className: tableResponsiveCardRowClasses, children: [
1186
- /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
1187
- /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: cellContent })
1188
- ] }, column.key);
1189
- }),
1190
- expandedNode && /* @__PURE__ */ jsx6("div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
1191
- ]
1192
- },
1193
- key
1194
- );
1195
- }) }),
1242
+ const separatorIndex = nextValue.lastIndexOf(":");
1243
+ const key = nextValue.slice(0, separatorIndex);
1244
+ const direction = nextValue.slice(separatorIndex + 1);
1245
+ ctx.handleSetSort({ key, direction });
1246
+ }
1247
+ }
1248
+ ) }) : null,
1249
+ ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardClasses, children: /* @__PURE__ */ jsx6(Empty, { showImage: false, description: tableLabels.emptyText }) }) : ctx.paginatedData.map((record, index) => {
1250
+ const key = ctx.pageRowKeys[index];
1251
+ const isExpanded = ctx.expandedRowKeySet.has(key);
1252
+ const isSelected = ctx.selectedRowKeySet.has(key);
1253
+ const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
1254
+ const expandedContent = internalExpandable && isExpanded && isRowExpandable ? internalExpandable.expandedRowRender?.(record, index) : null;
1255
+ const expandedNode = expandedContent;
1256
+ const renderContext = {
1257
+ record,
1258
+ index,
1259
+ columns: ctx.displayColumns,
1260
+ selected: isSelected,
1261
+ expanded: isExpanded,
1262
+ toggleExpand: () => ctx.handleToggleExpand(key, record),
1263
+ selectRow: (checked) => ctx.handleSelectRow(key, checked)
1264
+ };
1265
+ const customCard = renderCard?.(renderContext);
1266
+ const resolvedCardClassName = typeof cardClassName === "function" ? cardClassName(record, index) : cardClassName;
1267
+ return /* @__PURE__ */ jsx6(
1268
+ "div",
1269
+ {
1270
+ className: classNames3(tableResponsiveCardClasses, resolvedCardClassName),
1271
+ onClick: () => ctx.handleRowClick(record, index, key),
1272
+ children: customCard !== void 0 && customCard !== null ? customCard : /* @__PURE__ */ jsxs5(Fragment, { children: [
1273
+ internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 flex items-center gap-3", children: [
1274
+ internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6("span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ jsx6(
1275
+ Radio,
1276
+ {
1277
+ value: key,
1278
+ checked: isSelected,
1279
+ disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
1280
+ "aria-label": formatTableSelectRowAriaLabel(
1281
+ tableLabels.selectRowAriaLabel,
1282
+ index + 1,
1283
+ tableLocale?.locale
1284
+ ),
1285
+ onChange: () => ctx.handleSelectRow(key, true)
1286
+ }
1287
+ ) : /* @__PURE__ */ jsx6(
1288
+ Checkbox,
1289
+ {
1290
+ size: "sm",
1291
+ checked: isSelected,
1292
+ disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
1293
+ "aria-label": formatTableSelectRowAriaLabel(
1294
+ tableLabels.selectRowAriaLabel,
1295
+ index + 1,
1296
+ tableLocale?.locale
1297
+ ),
1298
+ onChange: (checked) => ctx.handleSelectRow(key, checked)
1299
+ }
1300
+ ) }),
1301
+ internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
1302
+ "button",
1303
+ {
1304
+ type: "button",
1305
+ className: "text-sm text-[var(--tiger-primary,#2563eb)]",
1306
+ "aria-expanded": isExpanded,
1307
+ onClick: (event) => {
1308
+ event.stopPropagation();
1309
+ ctx.handleToggleExpand(key, record);
1310
+ },
1311
+ children: isExpanded ? tableLabels.collapseText : tableLabels.expandText
1312
+ }
1313
+ )
1314
+ ] }) : null,
1315
+ (() => {
1316
+ const { titleColumn, bodyColumns } = getCardColumns(ctx.displayColumns);
1317
+ const renderCellContent = (column) => {
1318
+ const dataKey = column.dataKey || column.key;
1319
+ return column.render ? column.render(record, index) : record[dataKey];
1320
+ };
1321
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
1322
+ titleColumn && /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardTitleClasses, children: renderCellContent(titleColumn) }),
1323
+ bodyColumns.map((column) => /* @__PURE__ */ jsxs5("div", { className: tableResponsiveCardRowClasses, children: [
1324
+ /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
1325
+ /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: renderCellContent(column) })
1326
+ ] }, column.key))
1327
+ ] });
1328
+ })(),
1329
+ expandedNode && /* @__PURE__ */ jsx6("div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
1330
+ ] })
1331
+ },
1332
+ key
1333
+ );
1334
+ })
1335
+ ]
1336
+ }
1337
+ ),
1196
1338
  loading && /* @__PURE__ */ jsxs5(
1197
1339
  "div",
1198
1340
  {
1199
1341
  className: tableLoadingOverlayClasses,
1200
1342
  role: "status",
1201
1343
  "aria-live": "polite",
1202
- "aria-label": "Loading",
1344
+ "aria-label": tableLabels.loadingText,
1203
1345
  children: [
1204
1346
  /* @__PURE__ */ jsx6(LoadingSpinner, {}),
1205
- /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Loading" })
1347
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: tableLabels.loadingText })
1206
1348
  ]
1207
1349
  }
1208
1350
  ),
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6HELKWFNjs = require('./chunk-6HELKWFN.js');
3
+ var _chunk3LCISRAVjs = require('./chunk-3LCISRAV.js');
4
4
 
5
5
 
6
6
  var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
@@ -41,7 +41,7 @@ var Popover = ({
41
41
  const popoverId = popoverIdRef.current;
42
42
  const titleId = `${popoverId}-title`;
43
43
  const contentId = `${popoverId}-content`;
44
- const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } = _chunk6HELKWFNjs.usePopup.call(void 0, { open, defaultOpen, disabled, trigger, placement, offset, onOpenChange });
44
+ const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } = _chunk3LCISRAVjs.usePopup.call(void 0, { open, defaultOpen, disabled, trigger, placement, offset, onOpenChange });
45
45
  const containerClasses = _react.useMemo.call(void 0,
46
46
  () => _tigercatcore.classNames.call(void 0, _tigercatcore.getPopoverContainerClasses.call(void 0, ), className),
47
47
  [className]
@@ -8,7 +8,8 @@ import {
8
8
  import { useCallback, useMemo, useRef, useState } from "react";
9
9
  import {
10
10
  getTransformOrigin,
11
- buildTriggerHandlerMap
11
+ buildTriggerHandlerMap,
12
+ restoreFocus
12
13
  } from "@expcat/tigercat-core";
13
14
  function usePopup(options) {
14
15
  const {
@@ -46,6 +47,19 @@ function usePopup(options) {
46
47
  },
47
48
  [disabled, isControlled, onOpenChange]
48
49
  );
50
+ const restoreTriggerFocus = useCallback(() => {
51
+ const trigger2 = triggerRef.current;
52
+ const target = trigger2?.querySelector(
53
+ 'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
54
+ ) ?? trigger2;
55
+ window.setTimeout(() => {
56
+ restoreFocus(target, { preventScroll: true });
57
+ }, 0);
58
+ }, []);
59
+ const closeAndRestoreFocus = useCallback(() => {
60
+ setVisible(false);
61
+ restoreTriggerFocus();
62
+ }, [restoreTriggerFocus, setVisible]);
49
63
  const handleToggle = useCallback(() => {
50
64
  if (!disabled) setVisible(!currentVisible);
51
65
  }, [disabled, currentVisible, setVisible]);
@@ -59,12 +73,12 @@ function usePopup(options) {
59
73
  useClickOutside({
60
74
  enabled: currentVisible && effectiveTrigger === "click",
61
75
  refs: [containerRef, floatingRef],
62
- onOutsideClick: () => setVisible(false),
76
+ onOutsideClick: closeAndRestoreFocus,
63
77
  defer: true
64
78
  });
65
79
  useEscapeKey({
66
80
  enabled: currentVisible && effectiveTrigger !== "manual",
67
- onEscape: () => setVisible(false)
81
+ onEscape: closeAndRestoreFocus
68
82
  });
69
83
  const floatingStyles = useMemo(
70
84
  () => ({
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk7KPALCG3js = require('../chunk-7KPALCG3.js');
4
+ var _chunkABTJVM3Xjs = require('../chunk-ABTJVM3X.js');
5
5
  require('../chunk-P36GX65N.js');
6
- require('../chunk-ZRHDNGWO.js');
7
6
  require('../chunk-ZYJTHGQW.js');
7
+ require('../chunk-ZRHDNGWO.js');
8
8
  require('../chunk-WVVXZKNI.js');
9
9
  require('../chunk-UKGQ7256.js');
10
10
  require('../chunk-56ZV3VVY.js');
@@ -14,4 +14,4 @@ require('../chunk-TQOWIDQT.js');
14
14
 
15
15
 
16
16
 
17
- exports.ChatWindow = _chunk7KPALCG3js.ChatWindow; exports.default = _chunk7KPALCG3js.ChatWindow_default;
17
+ exports.ChatWindow = _chunkABTJVM3Xjs.ChatWindow; exports.default = _chunkABTJVM3Xjs.ChatWindow_default;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ChatWindow,
3
3
  ChatWindow_default
4
- } from "../chunk-GYFR2O27.mjs";
4
+ } from "../chunk-OXDX6CH2.mjs";
5
5
  import "../chunk-7DUHHRAU.mjs";
6
- import "../chunk-WIWTY74F.mjs";
7
6
  import "../chunk-WNLUUD5N.mjs";
7
+ import "../chunk-WIWTY74F.mjs";
8
8
  import "../chunk-7QZ4XT2P.mjs";
9
9
  import "../chunk-UQMPEMY7.mjs";
10
10
  import "../chunk-USWK2S3Y.mjs";
@@ -41,6 +41,6 @@ interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<Ta
41
41
  */
42
42
  tableClassName?: string;
43
43
  }
44
- declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
44
+ declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, locale, labels, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
45
45
 
46
46
  export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
@@ -41,6 +41,6 @@ interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<Ta
41
41
  */
42
42
  tableClassName?: string;
43
43
  }
44
- declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
44
+ declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, locale, labels, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
45
45
 
46
46
  export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
@@ -1,14 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkVHHYTCZQjs = require('../chunk-VHHYTCZQ.js');
5
- require('../chunk-VAZYY35F.js');
4
+ var _chunkFZX7USS4js = require('../chunk-FZX7USS4.js');
5
+ require('../chunk-M36PT6BS.js');
6
6
  require('../chunk-6Z4LLPZA.js');
7
+ require('../chunk-TMON4MPO.js');
8
+ require('../chunk-ZFMMAYSX.js');
7
9
  require('../chunk-TDODFBBO.js');
8
10
  require('../chunk-ZYJTHGQW.js');
11
+ require('../chunk-ZRHDNGWO.js');
12
+ require('../chunk-F7H4ALKN.js');
13
+ require('../chunk-JLRRXRZO.js');
14
+ require('../chunk-UKGQ7256.js');
9
15
  require('../chunk-56ZV3VVY.js');
10
16
  require('../chunk-YMKA4L3Z.js');
11
17
 
12
18
 
13
19
 
14
- exports.DataTableWithToolbar = _chunkVHHYTCZQjs.DataTableWithToolbar; exports.default = _chunkVHHYTCZQjs.DataTableWithToolbar_default;
20
+ exports.DataTableWithToolbar = _chunkFZX7USS4js.DataTableWithToolbar; exports.default = _chunkFZX7USS4js.DataTableWithToolbar_default;
@@ -1,11 +1,17 @@
1
1
  import {
2
2
  DataTableWithToolbar,
3
3
  DataTableWithToolbar_default
4
- } from "../chunk-VXOLIMK2.mjs";
5
- import "../chunk-AIXYHS2L.mjs";
4
+ } from "../chunk-JDJFSO2D.mjs";
5
+ import "../chunk-TSZKBVTA.mjs";
6
6
  import "../chunk-T4OVGM4X.mjs";
7
+ import "../chunk-NPTXXUXF.mjs";
8
+ import "../chunk-IG75YSX3.mjs";
7
9
  import "../chunk-QAIBQHIO.mjs";
8
10
  import "../chunk-WNLUUD5N.mjs";
11
+ import "../chunk-WIWTY74F.mjs";
12
+ import "../chunk-MSHCPJIJ.mjs";
13
+ import "../chunk-DKT2EYVM.mjs";
14
+ import "../chunk-UQMPEMY7.mjs";
9
15
  import "../chunk-USWK2S3Y.mjs";
10
16
  import "../chunk-ZJWUBR2X.mjs";
11
17
  export {
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJNRUOQNTjs = require('../chunk-JNRUOQNT.js');
4
- require('../chunk-6HELKWFN.js');
3
+ var _chunkLJDILPI6js = require('../chunk-LJDILPI6.js');
4
+ require('../chunk-3LCISRAV.js');
5
5
  require('../chunk-STTQ5LXX.js');
6
6
 
7
7
 
8
- exports.Popconfirm = _chunkJNRUOQNTjs.Popconfirm;
8
+ exports.Popconfirm = _chunkLJDILPI6js.Popconfirm;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Popconfirm
3
- } from "../chunk-VE2YEFG2.mjs";
4
- import "../chunk-4XOWNEZA.mjs";
3
+ } from "../chunk-PCPAMUAE.mjs";
4
+ import "../chunk-ZDEOTMXP.mjs";
5
5
  import "../chunk-SEWNVIHH.mjs";
6
6
  export {
7
7
  Popconfirm
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIAONLOJNjs = require('../chunk-IAONLOJN.js');
4
- require('../chunk-6HELKWFN.js');
3
+ var _chunkXU4TF2YAjs = require('../chunk-XU4TF2YA.js');
4
+ require('../chunk-3LCISRAV.js');
5
5
  require('../chunk-STTQ5LXX.js');
6
6
 
7
7
 
8
- exports.Popover = _chunkIAONLOJNjs.Popover;
8
+ exports.Popover = _chunkXU4TF2YAjs.Popover;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Popover
3
- } from "../chunk-O4UDB6ZE.mjs";
4
- import "../chunk-4XOWNEZA.mjs";
3
+ } from "../chunk-TAYQDWXN.mjs";
4
+ import "../chunk-ZDEOTMXP.mjs";
5
5
  import "../chunk-SEWNVIHH.mjs";
6
6
  export {
7
7
  Popover
@@ -2,6 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { T as TableProps } from '../types-mtq1tZJd.mjs';
3
3
  import '@expcat/tigercat-core';
4
4
 
5
- declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
5
+ declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, locale, labels, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, cardClassName, renderCard, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
6
6
 
7
7
  export { Table, TableProps };
@@ -2,6 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { T as TableProps } from '../types-mtq1tZJd.js';
3
3
  import '@expcat/tigercat-core';
4
4
 
5
- declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
5
+ declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, locale, labels, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, cardClassName, renderCard, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
6
6
 
7
7
  export { Table, TableProps };
@@ -1,7 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVAZYY35Fjs = require('../chunk-VAZYY35F.js');
3
+ var _chunkM36PT6BSjs = require('../chunk-M36PT6BS.js');
4
+ require('../chunk-6Z4LLPZA.js');
5
+ require('../chunk-TMON4MPO.js');
6
+ require('../chunk-ZFMMAYSX.js');
4
7
  require('../chunk-TDODFBBO.js');
8
+ require('../chunk-ZRHDNGWO.js');
9
+ require('../chunk-F7H4ALKN.js');
10
+ require('../chunk-JLRRXRZO.js');
11
+ require('../chunk-UKGQ7256.js');
5
12
 
6
13
 
7
- exports.Table = _chunkVAZYY35Fjs.Table;
14
+ exports.Table = _chunkM36PT6BSjs.Table;