@expcat/tigercat-react 1.2.31 → 1.2.34

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 (43) hide show
  1. package/dist/{chunk-UQOMRXTD.mjs → chunk-7E24KEVK.mjs} +60 -44
  2. package/dist/{chunk-P4INKEQ3.js → chunk-7JFP3MIW.js} +60 -44
  3. package/dist/{chunk-IWLUYAZV.mjs → chunk-AIXYHS2L.mjs} +53 -42
  4. package/dist/{chunk-FXVKJWUP.js → chunk-ANN5P7TJ.js} +5 -1
  5. package/dist/{chunk-D62GWQBX.mjs → chunk-CHS54PVQ.mjs} +14 -3
  6. package/dist/{chunk-IUOTJ73N.mjs → chunk-D4FXVNRW.mjs} +1 -1
  7. package/dist/{chunk-SXHP4Q7O.js → chunk-DSXII6ZF.js} +23 -10
  8. package/dist/{chunk-UHRZKZVU.mjs → chunk-FWIYDMJA.mjs} +19 -5
  9. package/dist/{chunk-KTV3ZDSQ.js → chunk-H2YHUFMK.js} +2 -2
  10. package/dist/{chunk-WWDCH2XX.mjs → chunk-JOB47R6Q.mjs} +5 -1
  11. package/dist/{chunk-K5B4XXAI.js → chunk-LROHXQWX.js} +2 -2
  12. package/dist/{chunk-R4OVIDAY.mjs → chunk-M26BTAIB.mjs} +28 -3
  13. package/dist/{chunk-77F5YT4E.js → chunk-O7WBBZ7J.js} +27 -2
  14. package/dist/{chunk-AKDBQOKX.mjs → chunk-RL6HARKE.mjs} +20 -7
  15. package/dist/{chunk-CPNDCACQ.mjs → chunk-RVO6R37N.mjs} +1 -1
  16. package/dist/{chunk-OHSJ4KTU.js → chunk-TLU3ROLT.js} +17 -6
  17. package/dist/{chunk-IXHXSD2E.js → chunk-VAZYY35F.js} +55 -44
  18. package/dist/{chunk-APODZAVO.js → chunk-VHHYTCZQ.js} +2 -2
  19. package/dist/{chunk-VUODYCCC.mjs → chunk-VXOLIMK2.mjs} +1 -1
  20. package/dist/{chunk-KEF2PEP4.js → chunk-WYKUC5MM.js} +19 -5
  21. package/dist/components/CropUpload.js +4 -3
  22. package/dist/components/CropUpload.mjs +3 -2
  23. package/dist/components/DataTableWithToolbar.js +3 -3
  24. package/dist/components/DataTableWithToolbar.mjs +2 -2
  25. package/dist/components/Drawer.js +3 -2
  26. package/dist/components/Drawer.mjs +2 -1
  27. package/dist/components/FormWizard.js +2 -2
  28. package/dist/components/FormWizard.mjs +1 -1
  29. package/dist/components/Kanban.js +3 -3
  30. package/dist/components/Kanban.mjs +2 -2
  31. package/dist/components/Modal.js +3 -2
  32. package/dist/components/Modal.mjs +2 -1
  33. package/dist/components/Pagination.js +3 -2
  34. package/dist/components/Pagination.mjs +2 -1
  35. package/dist/components/Table.js +2 -2
  36. package/dist/components/Table.mjs +1 -1
  37. package/dist/components/TaskBoard.js +2 -2
  38. package/dist/components/TaskBoard.mjs +1 -1
  39. package/dist/components/VirtualTable.js +2 -2
  40. package/dist/components/VirtualTable.mjs +1 -1
  41. package/dist/index.js +11 -11
  42. package/dist/index.mjs +10 -10
  43. package/package.json +2 -2
@@ -1,3 +1,7 @@
1
+ import {
2
+ useTigerConfig
3
+ } from "./chunk-QAIBQHIO.mjs";
4
+
1
5
  // src/components/Pagination.tsx
2
6
  import { useState, useCallback, useEffect, useMemo, useRef } from "react";
3
7
  import {
@@ -24,7 +28,8 @@ import {
24
28
  getPaginationJumperPage,
25
29
  getValidatedPaginationJumperValue,
26
30
  isLazyTigerLocale,
27
- resolveTigerLocale
31
+ resolveTigerLocale,
32
+ mergeTigerLocale
28
33
  } from "@expcat/tigercat-core";
29
34
  import { jsx, jsxs } from "react/jsx-runtime";
30
35
  var Pagination = ({
@@ -50,9 +55,11 @@ var Pagination = ({
50
55
  onChange,
51
56
  onPageSizeChange,
52
57
  locale,
58
+ labels: labelsOverride,
53
59
  ...props
54
60
  }) => {
55
61
  const { "aria-label": ariaLabelProp, ...navProps } = props;
62
+ const config = useTigerConfig();
56
63
  const immediateLocale = useMemo(() => getImmediateTigerLocale(locale), [locale]);
57
64
  const [loadedLocale, setLoadedLocale] = useState(
58
65
  immediateLocale
@@ -72,9 +79,16 @@ var Pagination = ({
72
79
  };
73
80
  }, [locale, immediateLocale]);
74
81
  const resolvedLocale = isLazyTigerLocale(locale) ? loadedLocale : immediateLocale;
75
- const labels = useMemo(() => getPaginationLabels(resolvedLocale), [resolvedLocale]);
76
- const localeCode = resolvedLocale?.locale;
77
- const isRtl = getLocaleDirection(resolvedLocale) === "rtl";
82
+ const mergedLocale = useMemo(
83
+ () => mergeTigerLocale(config.locale, resolvedLocale),
84
+ [config.locale, resolvedLocale]
85
+ );
86
+ const labels = useMemo(
87
+ () => getPaginationLabels(mergedLocale, labelsOverride),
88
+ [mergedLocale, labelsOverride]
89
+ );
90
+ const localeCode = mergedLocale?.locale;
91
+ const isRtl = getLocaleDirection(mergedLocale) === "rtl";
78
92
  const [internalCurrent, setInternalCurrent] = useState(defaultCurrent);
79
93
  const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
80
94
  const [quickJumperValue, setQuickJumperValue] = useState("");
@@ -176,7 +190,7 @@ var Pagination = ({
176
190
  const nextDisabled = validatedCurrentPage >= totalPages || disabled;
177
191
  const elements = [];
178
192
  if (showTotal) {
179
- const totalTextFn = totalText || (resolvedLocale?.pagination?.totalText ? (value, range) => formatPaginationTotal(labels.totalText, value, range, localeCode) : defaultTotalText);
193
+ const totalTextFn = totalText || (labelsOverride?.totalText || mergedLocale?.pagination?.totalText ? (value, range) => formatPaginationTotal(labels.totalText, value, range, localeCode) : defaultTotalText);
180
194
  elements.push(
181
195
  /* @__PURE__ */ jsx("span", { className: getTotalTextClasses(size), children: totalTextFn(total, pageRange) }, "total")
182
196
  );
@@ -1,6 +1,6 @@
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 _chunkSXHP4Q7Ojs = require('./chunk-SXHP4Q7O.js');
3
+ var _chunkDSXII6ZFjs = require('./chunk-DSXII6ZF.js');
4
4
 
5
5
 
6
6
  var _chunkFI53LYZ6js = require('./chunk-FI53LYZ6.js');
@@ -140,7 +140,7 @@ var CropUpload = ({
140
140
  }
141
141
  ),
142
142
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
143
- _chunkSXHP4Q7Ojs.Modal,
143
+ _chunkDSXII6ZFjs.Modal,
144
144
  {
145
145
  open: modalVisible,
146
146
  size: "lg",
@@ -271,6 +271,7 @@ var TaskBoard = ({
271
271
  renderColumnFooter,
272
272
  renderEmptyColumn,
273
273
  locale,
274
+ labels: labelsOverride,
274
275
  className,
275
276
  style,
276
277
  ...rest
@@ -280,7 +281,10 @@ var TaskBoard = ({
280
281
  () => mergeTigerLocale(config.locale, locale),
281
282
  [config.locale, locale]
282
283
  );
283
- const labels = useMemo(() => getTaskBoardLabels(mergedLocale), [mergedLocale]);
284
+ const labels = useMemo(
285
+ () => getTaskBoardLabels(mergedLocale, labelsOverride),
286
+ [mergedLocale, labelsOverride]
287
+ );
284
288
  const [innerColumns, setInnerColumns] = useState(defaultColumns);
285
289
  useEffect(() => {
286
290
  if (controlledColumns !== void 0) setInnerColumns(controlledColumns);
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkFXVKJWUPjs = require('./chunk-FXVKJWUP.js');
3
+ var _chunkANN5P7TJjs = require('./chunk-ANN5P7TJ.js');
4
4
 
5
5
  // src/components/Kanban.tsx
6
6
  var _jsxruntime = require('react/jsx-runtime');
@@ -11,7 +11,7 @@ var Kanban = ({
11
11
  ...props
12
12
  }) => {
13
13
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
14
- _chunkFXVKJWUPjs.TaskBoard,
14
+ _chunkANN5P7TJjs.TaskBoard,
15
15
  {
16
16
  showCardCount,
17
17
  allowAddCard,
@@ -8,11 +8,14 @@ import {
8
8
  getVirtualRowKey,
9
9
  getVirtualTableFixedInfo,
10
10
  getVirtualTableFixedCellStyle,
11
+ getTableFixedCellClasses,
12
+ getTableFixedHeaderCellClasses,
11
13
  virtualTableHeaderClasses,
12
14
  virtualTableHeaderCellClasses,
13
15
  virtualTableCellClasses,
14
16
  virtualTableEmptyClasses,
15
- virtualTableLoadingClasses
17
+ virtualTableLoadingClasses,
18
+ virtualTableRowSelectedClasses
16
19
  } from "@expcat/tigercat-core";
17
20
  import { jsx, jsxs } from "react/jsx-runtime";
18
21
  var VirtualTable = ({
@@ -77,7 +80,15 @@ var VirtualTable = ({
77
80
  return /* @__PURE__ */ jsx(
78
81
  "th",
79
82
  {
80
- className: virtualTableHeaderCellClasses,
83
+ className: classNames(
84
+ virtualTableHeaderCellClasses,
85
+ getTableFixedHeaderCellClasses({
86
+ view: "virtual-table",
87
+ column: col,
88
+ stickyHeader,
89
+ fixedInfo
90
+ })
91
+ ),
81
92
  style: { ...widthStyle, ...stickyStyle },
82
93
  children: col.title ?? ""
83
94
  },
@@ -101,7 +112,21 @@ var VirtualTable = ({
101
112
  children: columns.map((col) => /* @__PURE__ */ jsx(
102
113
  "td",
103
114
  {
104
- className: virtualTableCellClasses,
115
+ className: classNames(
116
+ virtualTableCellClasses,
117
+ getTableFixedCellClasses({
118
+ view: "virtual-table",
119
+ column: col,
120
+ record: row,
121
+ rowIndex: globalIdx,
122
+ striped,
123
+ stripedActive: striped && globalIdx % 2 === 1,
124
+ selected: isSelected,
125
+ hoverable: true,
126
+ fixedInfo,
127
+ selectedClassName: virtualTableRowSelectedClasses
128
+ })
129
+ ),
105
130
  style: getVirtualTableFixedCellStyle(col.key, fixedInfo),
106
131
  children: renderCell ? renderCell(row[col.key], row, col) : String(row[col.key] ?? "")
107
132
  },
@@ -13,6 +13,9 @@ var _react = require('react');
13
13
 
14
14
 
15
15
 
16
+
17
+
18
+
16
19
  var _tigercatcore = require('@expcat/tigercat-core');
17
20
  var _jsxruntime = require('react/jsx-runtime');
18
21
  var VirtualTable = ({
@@ -77,7 +80,15 @@ var VirtualTable = ({
77
80
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
78
81
  "th",
79
82
  {
80
- className: _tigercatcore.virtualTableHeaderCellClasses,
83
+ className: _tigercatcore.classNames.call(void 0,
84
+ _tigercatcore.virtualTableHeaderCellClasses,
85
+ _tigercatcore.getTableFixedHeaderCellClasses.call(void 0, {
86
+ view: "virtual-table",
87
+ column: col,
88
+ stickyHeader,
89
+ fixedInfo
90
+ })
91
+ ),
81
92
  style: { ...widthStyle, ...stickyStyle },
82
93
  children: _nullishCoalesce(col.title, () => ( ""))
83
94
  },
@@ -101,7 +112,21 @@ var VirtualTable = ({
101
112
  children: columns.map((col) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
102
113
  "td",
103
114
  {
104
- className: _tigercatcore.virtualTableCellClasses,
115
+ className: _tigercatcore.classNames.call(void 0,
116
+ _tigercatcore.virtualTableCellClasses,
117
+ _tigercatcore.getTableFixedCellClasses.call(void 0, {
118
+ view: "virtual-table",
119
+ column: col,
120
+ record: row,
121
+ rowIndex: globalIdx,
122
+ striped,
123
+ stripedActive: striped && globalIdx % 2 === 1,
124
+ selected: isSelected,
125
+ hoverable: true,
126
+ fixedInfo,
127
+ selectedClassName: _tigercatcore.virtualTableRowSelectedClasses
128
+ })
129
+ ),
105
130
  style: _tigercatcore.getVirtualTableFixedCellStyle.call(void 0, col.key, fixedInfo),
106
131
  children: renderCell ? renderCell(row[col.key], row, col) : String(_nullishCoalesce(row[col.key], () => ( "")))
107
132
  },
@@ -1,3 +1,6 @@
1
+ import {
2
+ useTigerConfig
3
+ } from "./chunk-QAIBQHIO.mjs";
1
4
  import {
2
5
  Button
3
6
  } from "./chunk-USWK2S3Y.mjs";
@@ -33,7 +36,8 @@ import {
33
36
  modalFooterClasses,
34
37
  restoreFocus,
35
38
  shouldCloseOnMaskClick,
36
- resolveSwipeGesture
39
+ resolveSwipeGesture,
40
+ mergeTigerLocale
37
41
  } from "@expcat/tigercat-core";
38
42
  import { jsx, jsxs } from "react/jsx-runtime";
39
43
  var Modal = ({
@@ -61,10 +65,16 @@ var Modal = ({
61
65
  okText,
62
66
  cancelText,
63
67
  locale,
68
+ labels,
64
69
  style,
65
70
  draggable: isDraggable = false,
66
71
  ...rest
67
72
  }) => {
73
+ const config = useTigerConfig();
74
+ const mergedLocale = useMemo(
75
+ () => mergeTigerLocale(config.locale, locale),
76
+ [config.locale, locale]
77
+ );
68
78
  const [hasBeenOpened, setHasBeenOpened] = React.useState(open);
69
79
  const [dragOffset, setDragOffset] = React.useState({ x: 0, y: 0 });
70
80
  useEffect(() => {
@@ -126,20 +136,23 @@ var Modal = ({
126
136
  const resolvedCloseAriaLabel = resolveLocaleText(
127
137
  "Close",
128
138
  closeAriaLabel,
129
- locale?.modal?.closeAriaLabel,
130
- locale?.common?.closeText
139
+ labels?.closeAriaLabel,
140
+ mergedLocale?.modal?.closeAriaLabel,
141
+ mergedLocale?.common?.closeText
131
142
  );
132
143
  const resolvedCancelText = resolveLocaleText(
133
144
  "\u53D6\u6D88",
134
145
  cancelText,
135
- locale?.modal?.cancelText,
136
- locale?.common?.cancelText
146
+ labels?.cancelText,
147
+ mergedLocale?.modal?.cancelText,
148
+ mergedLocale?.common?.cancelText
137
149
  );
138
150
  const resolvedOkText = resolveLocaleText(
139
151
  "\u786E\u5B9A",
140
152
  okText,
141
- locale?.modal?.okText,
142
- locale?.common?.okText
153
+ labels?.okText,
154
+ mergedLocale?.modal?.okText,
155
+ mergedLocale?.common?.okText
143
156
  );
144
157
  const reactId = useId();
145
158
  const modalId = useMemo(() => `tiger-modal-${reactId}`, [reactId]);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TaskBoard
3
- } from "./chunk-WWDCH2XX.mjs";
3
+ } from "./chunk-JOB47R6Q.mjs";
4
4
 
5
5
  // src/components/Kanban.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,5 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
4
+
5
+
3
6
 
4
7
 
5
8
 
@@ -29,6 +32,7 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
29
32
 
30
33
 
31
34
 
35
+
32
36
 
33
37
 
34
38
  var _tigercatcore = require('@expcat/tigercat-core');
@@ -76,11 +80,17 @@ var Drawer = ({
76
80
  onAfterLeave,
77
81
  closeAriaLabel,
78
82
  locale,
83
+ labels,
79
84
  children,
80
85
  footer,
81
86
  style,
82
87
  ...rest
83
88
  }) => {
89
+ const config = _chunkTDODFBBOjs.useTigerConfig.call(void 0, );
90
+ const mergedLocale = _react.useMemo.call(void 0,
91
+ () => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, locale),
92
+ [config.locale, locale]
93
+ );
84
94
  const [hasBeenOpened, setHasBeenOpened] = _react2.default.useState(open);
85
95
  const [deferredRendered, setDeferredRendered] = _react2.default.useState(open);
86
96
  _react.useEffect.call(void 0, () => {
@@ -142,8 +152,9 @@ var Drawer = ({
142
152
  const resolvedCloseAriaLabel = _tigercatcore.resolveLocaleText.call(void 0,
143
153
  "Close drawer",
144
154
  closeAriaLabel,
145
- _optionalChain([locale, 'optionalAccess', _5 => _5.drawer, 'optionalAccess', _6 => _6.closeAriaLabel]),
146
- _optionalChain([locale, 'optionalAccess', _7 => _7.common, 'optionalAccess', _8 => _8.closeText])
155
+ _optionalChain([labels, 'optionalAccess', _5 => _5.closeAriaLabel]),
156
+ _optionalChain([mergedLocale, 'optionalAccess', _6 => _6.drawer, 'optionalAccess', _7 => _7.closeAriaLabel]),
157
+ _optionalChain([mergedLocale, 'optionalAccess', _8 => _8.common, 'optionalAccess', _9 => _9.closeText])
147
158
  );
148
159
  _react.useEffect.call(void 0, () => {
149
160
  if (open) {
@@ -162,7 +173,7 @@ var Drawer = ({
162
173
  }, []);
163
174
  const handleTouchStart = _react.useCallback.call(void 0,
164
175
  (event) => {
165
- _optionalChain([dialogDivProps, 'access', _9 => _9.onTouchStart, 'optionalCall', _10 => _10(event)]);
176
+ _optionalChain([dialogDivProps, 'access', _10 => _10.onTouchStart, 'optionalCall', _11 => _11(event)]);
166
177
  if (!open) return;
167
178
  const point = _tigercatcore.getGestureTouchPoint.call(void 0, event.touches);
168
179
  touchStartRef.current = point;
@@ -172,7 +183,7 @@ var Drawer = ({
172
183
  );
173
184
  const handleTouchMove = _react.useCallback.call(void 0,
174
185
  (event) => {
175
- _optionalChain([dialogDivProps, 'access', _11 => _11.onTouchMove, 'optionalCall', _12 => _12(event)]);
186
+ _optionalChain([dialogDivProps, 'access', _12 => _12.onTouchMove, 'optionalCall', _13 => _13(event)]);
176
187
  if (!touchStartRef.current) return;
177
188
  const point = _tigercatcore.getGestureTouchPoint.call(void 0, event.touches);
178
189
  if (point) {
@@ -183,7 +194,7 @@ var Drawer = ({
183
194
  );
184
195
  const handleTouchEnd = _react.useCallback.call(void 0,
185
196
  (event) => {
186
- _optionalChain([dialogDivProps, 'access', _13 => _13.onTouchEnd, 'optionalCall', _14 => _14(event)]);
197
+ _optionalChain([dialogDivProps, 'access', _14 => _14.onTouchEnd, 'optionalCall', _15 => _15(event)]);
187
198
  const gesture = _tigercatcore.resolveSwipeGesture.call(void 0,
188
199
  touchStartRef.current,
189
200
  _nullishCoalesce(_tigercatcore.getGestureTouchPoint.call(void 0, event.changedTouches), () => ( touchCurrentRef.current)),
@@ -198,7 +209,7 @@ var Drawer = ({
198
209
  );
199
210
  const handleTouchCancel = _react.useCallback.call(void 0,
200
211
  (event) => {
201
- _optionalChain([dialogDivProps, 'access', _15 => _15.onTouchCancel, 'optionalCall', _16 => _16(event)]);
212
+ _optionalChain([dialogDivProps, 'access', _16 => _16.onTouchCancel, 'optionalCall', _17 => _17(event)]);
202
213
  resetTouchGesture();
203
214
  },
204
215
  [dialogDivProps, resetTouchGesture]
@@ -491,6 +491,8 @@ function useTableState(input) {
491
491
 
492
492
 
493
493
 
494
+
495
+
494
496
  function renderTableHeader(ctx, view) {
495
497
  const { size, stickyHeader, rowSelection, expandable, columnLockable, columnDraggable } = view;
496
498
  const expandHeaderTh = expandable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { className: _tigercatcore.getExpandIconCellClasses.call(void 0, size), "aria-label": "Expand" }) : null;
@@ -513,17 +515,7 @@ function renderTableHeader(ctx, view) {
513
515
  const isSorted = ctx.sortState.key === column.key;
514
516
  const sortDirection = isSorted ? ctx.sortState.direction : null;
515
517
  const ariaSort = column.sortable ? sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none" : void 0;
516
- const isFixedLeft = column.fixed === "left";
517
- const isFixedRight = column.fixed === "right";
518
- const fixedStyle = isFixedLeft ? {
519
- position: "sticky",
520
- left: `${ctx.fixedColumnsInfo.leftOffsets[column.key] || 0}px`,
521
- zIndex: 15
522
- } : isFixedRight ? {
523
- position: "sticky",
524
- right: `${ctx.fixedColumnsInfo.rightOffsets[column.key] || 0}px`,
525
- zIndex: 15
526
- } : void 0;
518
+ const fixedStyle = _tigercatcore.getFixedColumnStyle.call(void 0, column, ctx.fixedColumnsInfo, 15);
527
519
  const widthStyle = column.width ? {
528
520
  width: typeof column.width === "number" ? `${column.width}px` : column.width
529
521
  } : void 0;
@@ -540,7 +532,12 @@ function renderTableHeader(ctx, view) {
540
532
  !!column.sortable,
541
533
  column.headerClassName
542
534
  ),
543
- (isFixedLeft || isFixedRight) && "bg-[var(--tiger-surface-muted,#f9fafb)]"
535
+ _tigercatcore.getTableFixedHeaderCellClasses.call(void 0, {
536
+ view: "table",
537
+ column,
538
+ stickyHeader,
539
+ fixedInfo: ctx.fixedColumnsInfo
540
+ })
544
541
  ),
545
542
  style,
546
543
  draggable: columnDraggable ? true : void 0,
@@ -616,6 +613,8 @@ function renderTableHeader(ctx, view) {
616
613
 
617
614
 
618
615
 
616
+
617
+
619
618
  function renderTableBody(ctx, view) {
620
619
  const {
621
620
  size,
@@ -713,26 +712,22 @@ function renderTableBody(ctx, view) {
713
712
  ctx.displayColumns.map((column) => {
714
713
  const dataKey = column.dataKey || column.key;
715
714
  const cellValue = record[dataKey];
716
- const isFixedLeft = column.fixed === "left";
717
- const isFixedRight = column.fixed === "right";
718
- const fixedStyle = isFixedLeft ? {
719
- position: "sticky",
720
- left: `${ctx.fixedColumnsInfo.leftOffsets[column.key] || 0}px`,
721
- zIndex: 10
722
- } : isFixedRight ? {
723
- position: "sticky",
724
- right: `${ctx.fixedColumnsInfo.rightOffsets[column.key] || 0}px`,
725
- zIndex: 10
726
- } : void 0;
715
+ const fixedStyle = _tigercatcore.getFixedColumnStyle.call(void 0, column, ctx.fixedColumnsInfo, 10);
727
716
  const widthStyle = column.width ? {
728
717
  width: typeof column.width === "number" ? `${column.width}px` : column.width
729
718
  } : void 0;
730
719
  const style = fixedStyle ? { ...widthStyle, ...fixedStyle } : widthStyle;
731
- const stickyBgClass = striped && index % 2 === 0 ? "bg-[var(--tiger-surface-muted,#f9fafb)]/50" : "bg-[var(--tiger-surface,#ffffff)]";
732
- const stickyCellClass = isFixedLeft || isFixedRight ? _tigercatcore.classNames.call(void 0,
733
- stickyBgClass,
734
- hoverable && "group-hover:bg-[var(--tiger-surface-muted,#f9fafb)]"
735
- ) : void 0;
720
+ const stickyCellClass = _tigercatcore.getTableFixedCellClasses.call(void 0, {
721
+ view: "table",
722
+ column,
723
+ record,
724
+ rowIndex: index,
725
+ striped,
726
+ stripedActive: striped && index % 2 === 0,
727
+ selected: isSelected,
728
+ hoverable,
729
+ fixedInfo: ctx.fixedColumnsInfo
730
+ });
736
731
  const isEditing = _optionalChain([ctx, 'access', _61 => _61.editingCell, 'optionalAccess', _62 => _62.rowIndex]) === index && _optionalChain([ctx, 'access', _63 => _63.editingCell, 'optionalAccess', _64 => _64.columnKey]) === column.key;
737
732
  const cellEditable = ctx.isCellEditable(column.key, index);
738
733
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -852,18 +847,20 @@ function renderPagination(ctx, view) {
852
847
  const paginationConfig = pagination;
853
848
  const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.length;
854
849
  const locale = view.disableI18n ? void 0 : view.locale;
855
- const labels = locale ? _tigercatcore.getPaginationLabels.call(void 0, locale) : void 0;
850
+ const labels = _tigercatcore.getPaginationLabels.call(void 0, locale);
856
851
  const localeCode = _optionalChain([locale, 'optionalAccess', _66 => _66.locale]);
857
- const isZh = !!_optionalChain([localeCode, 'optionalAccess', _67 => _67.startsWith, 'call', _68 => _68("zh")]) || _optionalChain([locale, 'optionalAccess', _69 => _69.formWizard, 'optionalAccess', _70 => _70.prevText]) === "\u4E0A\u4E00\u6B65" || _optionalChain([locale, 'optionalAccess', _71 => _71.upload, 'optionalAccess', _72 => _72.clickToUploadText]) === "\u70B9\u51FB\u4E0A\u4F20";
858
- const defaultTotalText = (t, range) => isZh ? `\u5171 ${t} \u6761` : `Showing ${range[0]} to ${range[1]} of ${t} results`;
859
- const defaultPrevText = isZh ? "\u4E0A\u4E00\u9875" : "Previous";
860
- const defaultNextText = isZh ? "\u4E0B\u4E00\u9875" : "Next";
861
- const defaultPageIndicatorText = (current, total2) => isZh ? `\u7B2C ${current} \u9875 / \u5171 ${total2} \u9875` : `Page ${current} of ${total2}`;
862
- const defaultPageSizeText = (size) => isZh ? `${size} \u6761/\u9875` : `${size} / page`;
863
- const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : labels ? _tigercatcore.formatPaginationTotal.call(void 0, labels.totalText, total, [startIndex, endIndex], localeCode) : defaultTotalText(total, [startIndex, endIndex]);
864
- const finalPrevText = paginationConfig.prevText || _optionalChain([labels, 'optionalAccess', _73 => _73.prevPageAriaLabel]) || defaultPrevText;
865
- const finalNextText = paginationConfig.nextText || _optionalChain([labels, 'optionalAccess', _74 => _74.nextPageAriaLabel]) || defaultNextText;
866
- const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage, totalPages) : labels ? `${_tigercatcore.formatPageAriaLabel.call(void 0, labels.pageAriaLabel, ctx.currentPage, localeCode)} / ${_tigercatcore.formatIntlNumber.call(void 0, totalPages, localeCode)} ${labels.pageText}` : defaultPageIndicatorText(ctx.currentPage, totalPages);
852
+ const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : _tigercatcore.formatPaginationTotal.call(void 0, labels.totalText, total, [startIndex, endIndex], localeCode);
853
+ const finalPrevText = paginationConfig.prevText || labels.prevPageAriaLabel;
854
+ const finalNextText = paginationConfig.nextText || labels.nextPageAriaLabel;
855
+ const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage, totalPages) : _tigercatcore.formatPaginationPageIndicator.call(void 0,
856
+ labels.pageIndicatorText,
857
+ ctx.currentPage,
858
+ totalPages,
859
+ localeCode
860
+ );
861
+ const finalPrevAriaLabel = view.disableI18n ? finalPrevText : labels.prevPageAriaLabel;
862
+ const finalNextAriaLabel = view.disableI18n ? finalNextText : labels.nextPageAriaLabel;
863
+ const normalizedPageSizeOptions = paginationConfig.pageSizeOptions || [10, 20, 50, 100];
867
864
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _tigercatcore.getSimplePaginationContainerClasses.call(void 0, ), children: [
868
865
  paginationConfig.showTotal !== false && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.getSimplePaginationTotalClasses.call(void 0, ), children: finalTotalText }),
869
866
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _tigercatcore.getSimplePaginationControlsClasses.call(void 0, ), children: [
@@ -872,8 +869,13 @@ function renderPagination(ctx, view) {
872
869
  {
873
870
  className: _tigercatcore.getSimplePaginationSelectClasses.call(void 0, ),
874
871
  value: ctx.currentPageSize,
872
+ "aria-label": labels.itemsPerPageText,
875
873
  onChange: (e) => ctx.handlePageSizeChange(Number(e.target.value)),
876
- children: (paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map((size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value: size, children: paginationConfig.pageSizeText ? paginationConfig.pageSizeText(size) : labels ? `${_tigercatcore.formatIntlNumber.call(void 0, size, localeCode)} ${labels.itemsPerPageText}` : defaultPageSizeText(size) }, size))
874
+ children: normalizedPageSizeOptions.map((option) => {
875
+ const value = typeof option === "number" ? option : option.value;
876
+ const label = typeof option === "number" ? `${_tigercatcore.formatIntlNumber.call(void 0, value, localeCode)} ${labels.itemsPerPageText}` : _nullishCoalesce(option.label, () => ( `${_tigercatcore.formatIntlNumber.call(void 0, value, localeCode)} ${labels.itemsPerPageText}`));
877
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "option", { value, children: paginationConfig.pageSizeText ? paginationConfig.pageSizeText(value) : label }, value);
878
+ })
877
879
  }
878
880
  ),
879
881
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _tigercatcore.getSimplePaginationButtonsWrapperClasses.call(void 0, ), children: [
@@ -882,16 +884,25 @@ function renderPagination(ctx, view) {
882
884
  {
883
885
  className: _tigercatcore.getSimplePaginationButtonClasses.call(void 0, !hasPrev),
884
886
  disabled: !hasPrev,
887
+ "aria-label": finalPrevAriaLabel,
885
888
  onClick: () => ctx.handlePageChange(ctx.currentPage - 1),
886
889
  children: finalPrevText
887
890
  }
888
891
  ),
889
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _tigercatcore.getSimplePaginationPageIndicatorClasses.call(void 0, ), children: finalPageIndicatorText }),
892
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
893
+ "span",
894
+ {
895
+ className: _tigercatcore.getSimplePaginationPageIndicatorClasses.call(void 0, ),
896
+ "aria-label": finalPageIndicatorText,
897
+ children: finalPageIndicatorText
898
+ }
899
+ ),
890
900
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
891
901
  "button",
892
902
  {
893
903
  className: _tigercatcore.getSimplePaginationButtonClasses.call(void 0, !hasNext),
894
904
  disabled: !hasNext,
905
+ "aria-label": finalNextAriaLabel,
895
906
  onClick: () => ctx.handlePageChange(ctx.currentPage + 1),
896
907
  children: finalNextText
897
908
  }
@@ -1134,7 +1145,7 @@ function Table({
1134
1145
  const key = ctx.pageRowKeys[index];
1135
1146
  const isExpanded = ctx.expandedRowKeySet.has(key);
1136
1147
  const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
1137
- const expandedContent = internalExpandable && isExpanded && isRowExpandable ? _optionalChain([internalExpandable, 'access', _75 => _75.expandedRowRender, 'optionalCall', _76 => _76(record, index)]) : null;
1148
+ const expandedContent = internalExpandable && isExpanded && isRowExpandable ? _optionalChain([internalExpandable, 'access', _67 => _67.expandedRowRender, 'optionalCall', _68 => _68(record, index)]) : null;
1138
1149
  const expandedNode = expandedContent;
1139
1150
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1140
1151
  "div",
@@ -1142,13 +1153,13 @@ function Table({
1142
1153
  className: _tigercatcore.tableResponsiveCardClasses,
1143
1154
  onClick: () => ctx.handleRowClick(record, index, key),
1144
1155
  children: [
1145
- _optionalChain([internalRowSelection, 'optionalAccess', _77 => _77.showCheckbox]) !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-2 flex items-center gap-3", children: [
1156
+ _optionalChain([internalRowSelection, 'optionalAccess', _69 => _69.showCheckbox]) !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-2 flex items-center gap-3", children: [
1146
1157
  internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1147
1158
  "input",
1148
1159
  {
1149
1160
  type: internalRowSelection.type === "radio" ? "radio" : "checkbox",
1150
1161
  checked: ctx.selectedRowKeySet.has(key),
1151
- disabled: _optionalChain([internalRowSelection, 'access', _78 => _78.getCheckboxProps, 'optionalCall', _79 => _79(record), 'optionalAccess', _80 => _80.disabled]),
1162
+ disabled: _optionalChain([internalRowSelection, 'access', _70 => _70.getCheckboxProps, 'optionalCall', _71 => _71(record), 'optionalAccess', _72 => _72.disabled]),
1152
1163
  onClick: (event) => event.stopPropagation(),
1153
1164
  onChange: (event) => ctx.handleSelectRow(key, event.target.checked)
1154
1165
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunkIXHXSD2Ejs = require('./chunk-IXHXSD2E.js');
3
+ var _chunkVAZYY35Fjs = require('./chunk-VAZYY35F.js');
4
4
 
5
5
 
6
6
  var _chunk6Z4LLPZAjs = require('./chunk-6Z4LLPZA.js');
@@ -248,7 +248,7 @@ var DataTableWithToolbar = ({
248
248
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: wrapperClasses, "data-tiger-data-table-with-toolbar": true, children: [
249
249
  renderToolbar(),
250
250
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
251
- _chunkIXHXSD2Ejs.Table,
251
+ _chunkVAZYY35Fjs.Table,
252
252
  {
253
253
  ...remainingTableProps,
254
254
  bordered,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Table
3
- } from "./chunk-IWLUYAZV.mjs";
3
+ } from "./chunk-AIXYHS2L.mjs";
4
4
  import {
5
5
  Select
6
6
  } from "./chunk-T4OVGM4X.mjs";