@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.
- package/dist/{chunk-UQOMRXTD.mjs → chunk-7E24KEVK.mjs} +60 -44
- package/dist/{chunk-P4INKEQ3.js → chunk-7JFP3MIW.js} +60 -44
- package/dist/{chunk-IWLUYAZV.mjs → chunk-AIXYHS2L.mjs} +53 -42
- package/dist/{chunk-FXVKJWUP.js → chunk-ANN5P7TJ.js} +5 -1
- package/dist/{chunk-D62GWQBX.mjs → chunk-CHS54PVQ.mjs} +14 -3
- package/dist/{chunk-IUOTJ73N.mjs → chunk-D4FXVNRW.mjs} +1 -1
- package/dist/{chunk-SXHP4Q7O.js → chunk-DSXII6ZF.js} +23 -10
- package/dist/{chunk-UHRZKZVU.mjs → chunk-FWIYDMJA.mjs} +19 -5
- package/dist/{chunk-KTV3ZDSQ.js → chunk-H2YHUFMK.js} +2 -2
- package/dist/{chunk-WWDCH2XX.mjs → chunk-JOB47R6Q.mjs} +5 -1
- package/dist/{chunk-K5B4XXAI.js → chunk-LROHXQWX.js} +2 -2
- package/dist/{chunk-R4OVIDAY.mjs → chunk-M26BTAIB.mjs} +28 -3
- package/dist/{chunk-77F5YT4E.js → chunk-O7WBBZ7J.js} +27 -2
- package/dist/{chunk-AKDBQOKX.mjs → chunk-RL6HARKE.mjs} +20 -7
- package/dist/{chunk-CPNDCACQ.mjs → chunk-RVO6R37N.mjs} +1 -1
- package/dist/{chunk-OHSJ4KTU.js → chunk-TLU3ROLT.js} +17 -6
- package/dist/{chunk-IXHXSD2E.js → chunk-VAZYY35F.js} +55 -44
- package/dist/{chunk-APODZAVO.js → chunk-VHHYTCZQ.js} +2 -2
- package/dist/{chunk-VUODYCCC.mjs → chunk-VXOLIMK2.mjs} +1 -1
- package/dist/{chunk-KEF2PEP4.js → chunk-WYKUC5MM.js} +19 -5
- package/dist/components/CropUpload.js +4 -3
- package/dist/components/CropUpload.mjs +3 -2
- package/dist/components/DataTableWithToolbar.js +3 -3
- package/dist/components/DataTableWithToolbar.mjs +2 -2
- package/dist/components/Drawer.js +3 -2
- package/dist/components/Drawer.mjs +2 -1
- package/dist/components/FormWizard.js +2 -2
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/Kanban.js +3 -3
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Modal.js +3 -2
- package/dist/components/Modal.mjs +2 -1
- package/dist/components/Pagination.js +3 -2
- package/dist/components/Pagination.mjs +2 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/components/TaskBoard.js +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/VirtualTable.js +2 -2
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/index.js +11 -11
- package/dist/index.mjs +10 -10
- 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
|
|
76
|
-
|
|
77
|
-
|
|
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 || (
|
|
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
|
|
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
|
-
|
|
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(
|
|
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
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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.
|
|
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.
|
|
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
|
-
|
|
130
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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
|
-
|
|
142
|
-
|
|
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,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([
|
|
146
|
-
_optionalChain([
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
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
|
|
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
|
-
(
|
|
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
|
|
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
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
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 =
|
|
850
|
+
const labels = _tigercatcore.getPaginationLabels.call(void 0, locale);
|
|
856
851
|
const localeCode = _optionalChain([locale, 'optionalAccess', _66 => _66.locale]);
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
const
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
const
|
|
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:
|
|
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,
|
|
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',
|
|
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',
|
|
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',
|
|
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
|
|
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
|
-
|
|
251
|
+
_chunkVAZYY35Fjs.Table,
|
|
252
252
|
{
|
|
253
253
|
...remainingTableProps,
|
|
254
254
|
bordered,
|