@expcat/tigercat-react 1.2.19 → 1.2.30
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-7YUD6VIC.js → chunk-4LBTPCGE.js} +47 -16
- package/dist/{chunk-MMGZEG7G.mjs → chunk-56DP32W7.mjs} +93 -45
- package/dist/{chunk-36WZNVQ5.mjs → chunk-5XE5VBDS.mjs} +2 -3
- package/dist/{chunk-2DH6MGC6.js → chunk-7KPALCG3.js} +11 -7
- package/dist/{chunk-LKKZLYCA.mjs → chunk-CPNDCACQ.mjs} +1 -1
- package/dist/{chunk-T7ACOL7K.mjs → chunk-E43YLPOJ.mjs} +64 -15
- package/dist/{chunk-XHT2VIDR.js → chunk-FXVKJWUP.js} +19 -9
- package/dist/{chunk-RUZQN7X3.js → chunk-FZIF5LZW.js} +52 -25
- package/dist/{chunk-X37Q7VME.mjs → chunk-GYFR2O27.mjs} +11 -7
- package/dist/chunk-I5YYA7FB.mjs +244 -0
- package/dist/{chunk-3FEFHD3E.mjs → chunk-IUOTJ73N.mjs} +1 -0
- package/dist/{chunk-EX63M5ID.js → chunk-JCINYGGM.js} +93 -45
- package/dist/{chunk-CSH2QOOH.js → chunk-K5B4XXAI.js} +2 -2
- package/dist/{chunk-UE52NMPO.js → chunk-KTV3ZDSQ.js} +1 -0
- package/dist/{chunk-5EZWYEGJ.js → chunk-KYOO6JCF.js} +67 -18
- package/dist/{chunk-XPA2YCQO.js → chunk-M7HBWFQO.js} +1 -2
- package/dist/{chunk-6CAKUMWV.mjs → chunk-OXPKFDG6.mjs} +46 -15
- package/dist/{chunk-DTYDPMNR.js → chunk-P4INKEQ3.js} +76 -9
- package/dist/{chunk-5XS6PXBX.mjs → chunk-PKWHSCFK.mjs} +52 -25
- package/dist/{chunk-J5R4Q2QM.mjs → chunk-UQOMRXTD.mjs} +74 -7
- package/dist/chunk-UVWLYRAC.js +244 -0
- package/dist/{chunk-ZB55SAGI.mjs → chunk-WWDCH2XX.mjs} +19 -9
- package/dist/{chunk-OOE5ZJNW.mjs → chunk-XJXEAXWY.mjs} +19 -11
- package/dist/{chunk-3PWNNDNQ.js → chunk-ZDGBH4NA.js} +19 -11
- package/dist/components/ActivityFeed.js +2 -2
- package/dist/components/ActivityFeed.mjs +1 -1
- package/dist/components/ChatWindow.js +3 -2
- package/dist/components/ChatWindow.mjs +2 -1
- package/dist/components/CommentThread.js +2 -2
- package/dist/components/CommentThread.mjs +1 -1
- package/dist/components/CropUpload.js +2 -2
- package/dist/components/CropUpload.mjs +1 -1
- package/dist/components/DataTableWithToolbar.js +4 -3
- package/dist/components/DataTableWithToolbar.mjs +3 -2
- package/dist/components/FormWizard.js +3 -3
- package/dist/components/FormWizard.mjs +2 -2
- package/dist/components/Kanban.js +3 -3
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Menu.d.mts +4 -0
- package/dist/components/Menu.d.ts +4 -0
- package/dist/components/Menu.js +2 -2
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/MenuItem.mjs +1 -1
- package/dist/components/MenuItemGroup.js +2 -2
- package/dist/components/MenuItemGroup.mjs +1 -1
- package/dist/components/NotificationCenter.js +2 -2
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/Steps.js +2 -2
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +2 -2
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/SubMenu.js +2 -2
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/Table.js +3 -2
- package/dist/components/Table.mjs +2 -1
- package/dist/components/TaskBoard.js +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/package.json +2 -2
- package/dist/chunk-DXMSDLVJ.js +0 -168
- package/dist/chunk-GBJILZTY.mjs +0 -168
|
@@ -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 _chunkKYOO6JCFjs = require('./chunk-KYOO6JCF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk6Z4LLPZAjs = require('./chunk-6Z4LLPZA.js');
|
|
@@ -81,12 +81,17 @@ var DataTableWithToolbar = ({
|
|
|
81
81
|
);
|
|
82
82
|
const hasFilters = Boolean(_optionalChain([toolbar, 'optionalAccess', _14 => _14.filters]) && toolbar.filters.length > 0);
|
|
83
83
|
const hasBulkActions = Boolean(_optionalChain([toolbar, 'optionalAccess', _15 => _15.bulkActions]) && toolbar.bulkActions.length > 0);
|
|
84
|
+
const { bordered = false, ...remainingTableProps } = tableProps;
|
|
84
85
|
const selectedKeys = _nullishCoalesce(_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _16 => _16.selectedKeys]), () => ( _optionalChain([tableProps, 'access', _17 => _17.rowSelection, 'optionalAccess', _18 => _18.selectedRowKeys]))), () => ( []));
|
|
85
86
|
const selectedCount = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _19 => _19.selectedCount]), () => ( selectedKeys.length));
|
|
86
87
|
const bulkLabel = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _20 => _20.bulkActionsLabel]), () => ( "\u5DF2\u9009\u62E9"));
|
|
87
88
|
const wrapperClasses = _react.useMemo.call(void 0,
|
|
88
|
-
() => _tigercatcore.classNames.call(void 0,
|
|
89
|
-
|
|
89
|
+
() => _tigercatcore.classNames.call(void 0,
|
|
90
|
+
"tiger-data-table-with-toolbar flex flex-col",
|
|
91
|
+
bordered ? "border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] overflow-hidden bg-[var(--tiger-surface,#ffffff)] shadow-sm" : "gap-3.5",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
[className, bordered]
|
|
90
95
|
);
|
|
91
96
|
const handleSearchChange = (value) => {
|
|
92
97
|
if (_optionalChain([toolbar, 'optionalAccess', _21 => _21.searchValue]) === void 0) {
|
|
@@ -131,12 +136,15 @@ var DataTableWithToolbar = ({
|
|
|
131
136
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
132
137
|
"div",
|
|
133
138
|
{
|
|
134
|
-
className:
|
|
139
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
140
|
+
"tiger-data-table-toolbar flex flex-wrap items-center gap-3",
|
|
141
|
+
bordered ? "bg-[var(--tiger-surface-muted,#f9fafb)] dark:bg-gray-800/10 px-4 py-3.5 border-b border-[var(--tiger-border,#e5e7eb)]" : "bg-[var(--tiger-surface-muted,#f9fafb)]/80 dark:bg-gray-800/30 px-4 py-3.5 border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] shadow-sm"
|
|
142
|
+
),
|
|
135
143
|
role: "toolbar",
|
|
136
144
|
"aria-label": "\u6570\u636E\u8868\u683C\u5DE5\u5177\u680F",
|
|
137
145
|
children: [
|
|
138
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-
|
|
139
|
-
hasSearch ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 w-full sm:w-auto sm:min-w-[
|
|
146
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 flex-wrap flex-1 min-w-0", children: [
|
|
147
|
+
hasSearch ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 w-full sm:w-auto sm:min-w-[220px] sm:max-w-[320px]", children: [
|
|
140
148
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
149
|
_chunkZYJTHGQWjs.Input,
|
|
142
150
|
{
|
|
@@ -144,6 +152,25 @@ var DataTableWithToolbar = ({
|
|
|
144
152
|
size: "sm",
|
|
145
153
|
value: searchValue,
|
|
146
154
|
placeholder: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _38 => _38.searchPlaceholder]), () => ( "\u641C\u7D22")),
|
|
155
|
+
prefix: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
+
"svg",
|
|
157
|
+
{
|
|
158
|
+
className: "w-3.5 h-3.5 text-[var(--tiger-text-secondary,#6b7280)] shrink-0",
|
|
159
|
+
fill: "none",
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
strokeWidth: "2",
|
|
162
|
+
viewBox: "0 0 24 24",
|
|
163
|
+
"aria-hidden": "true",
|
|
164
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
165
|
+
"path",
|
|
166
|
+
{
|
|
167
|
+
strokeLinecap: "round",
|
|
168
|
+
strokeLinejoin: "round",
|
|
169
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
),
|
|
147
174
|
onChange: (event) => handleSearchChange(String(event.currentTarget.value)),
|
|
148
175
|
onKeyDown: (event) => {
|
|
149
176
|
if (event.key === "Enter") {
|
|
@@ -157,7 +184,7 @@ var DataTableWithToolbar = ({
|
|
|
157
184
|
{
|
|
158
185
|
size: "sm",
|
|
159
186
|
variant: "primary",
|
|
160
|
-
className: "whitespace-nowrap shrink-0",
|
|
187
|
+
className: "whitespace-nowrap shrink-0 rounded-[var(--tiger-radius-md,0.5rem)] px-3",
|
|
161
188
|
onClick: handleSearchSubmit,
|
|
162
189
|
disabled: !onSearch && !_optionalChain([toolbar, 'optionalAccess', _40 => _40.onSearch]),
|
|
163
190
|
children: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _41 => _41.searchButtonText]), () => ( "\u641C\u7D22"))
|
|
@@ -192,12 +219,15 @@ var DataTableWithToolbar = ({
|
|
|
192
219
|
);
|
|
193
220
|
})]) : null
|
|
194
221
|
] }),
|
|
195
|
-
hasBulkActions ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 flex-wrap ml-auto shrink-0", children: [
|
|
196
|
-
selectedCount > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
222
|
+
hasBulkActions ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2.5 flex-wrap ml-auto shrink-0", children: [
|
|
223
|
+
selectedCount > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-[var(--tiger-primary,#2563eb)]/10 text-[var(--tiger-primary,#2563eb)] text-xs font-medium border border-[var(--tiger-primary,#2563eb)]/15 shrink-0 transition-all duration-300", children: [
|
|
224
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "w-1.5 h-1.5 rounded-full bg-[var(--tiger-primary,#2563eb)] animate-pulse" }),
|
|
225
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
226
|
+
bulkLabel,
|
|
227
|
+
" ",
|
|
228
|
+
selectedCount,
|
|
229
|
+
" \u9879"
|
|
230
|
+
] })
|
|
201
231
|
] }) : null,
|
|
202
232
|
_optionalChain([toolbar, 'optionalAccess', _45 => _45.bulkActions, 'optionalAccess', _46 => _46.map, 'call', _47 => _47((action) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
203
233
|
_chunk56ZV3VVYjs.Button,
|
|
@@ -218,11 +248,12 @@ var DataTableWithToolbar = ({
|
|
|
218
248
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: wrapperClasses, "data-tiger-data-table-with-toolbar": true, children: [
|
|
219
249
|
renderToolbar(),
|
|
220
250
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
221
|
-
|
|
251
|
+
_chunkKYOO6JCFjs.Table,
|
|
222
252
|
{
|
|
223
|
-
...
|
|
253
|
+
...remainingTableProps,
|
|
254
|
+
bordered,
|
|
224
255
|
pagination,
|
|
225
|
-
className: tableClassName,
|
|
256
|
+
className: _tigercatcore.classNames.call(void 0, tableClassName, bordered && "border-none rounded-none shadow-none"),
|
|
226
257
|
onPageChange: handleTablePageChange
|
|
227
258
|
}
|
|
228
259
|
)
|
|
@@ -95,23 +95,9 @@ var CommentThread = ({
|
|
|
95
95
|
updateExpandedKeys(next);
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
const BTN_BASE = "px-
|
|
99
|
-
const ACTION_BTN = `${BTN_BASE} text-gray-
|
|
100
|
-
const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] font-
|
|
101
|
-
const renderActionButton = (label, key, onClick, active) => /* @__PURE__ */ jsx(
|
|
102
|
-
Button,
|
|
103
|
-
{
|
|
104
|
-
size: "sm",
|
|
105
|
-
variant: "ghost",
|
|
106
|
-
className: classNames(
|
|
107
|
-
ACTION_BTN,
|
|
108
|
-
active && "text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary,#2563eb)] font-medium"
|
|
109
|
-
),
|
|
110
|
-
onClick,
|
|
111
|
-
children: label
|
|
112
|
-
},
|
|
113
|
-
key
|
|
114
|
-
);
|
|
98
|
+
const BTN_BASE = "px-2 py-0.5 h-auto min-h-0 text-xs rounded-md transition-all duration-200 ease-out";
|
|
99
|
+
const ACTION_BTN = `${BTN_BASE} text-gray-500 dark:text-gray-400 font-medium flex items-center gap-1.5`;
|
|
100
|
+
const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] dark:text-blue-400 dark:hover:text-blue-300 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10`;
|
|
115
101
|
const renderNode = (node, depth, isLast) => {
|
|
116
102
|
const hasChildren = !!node.children && node.children.length > 0;
|
|
117
103
|
const isExpanded = expandedSet.has(node.id);
|
|
@@ -125,24 +111,70 @@ var CommentThread = ({
|
|
|
125
111
|
const likeLabel = node.liked ? likedText : likeText;
|
|
126
112
|
const likeCount = node.likes ? ` ${node.likes}` : "";
|
|
127
113
|
actions.push(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
/* @__PURE__ */ jsxs(
|
|
115
|
+
Button,
|
|
116
|
+
{
|
|
117
|
+
size: "sm",
|
|
118
|
+
variant: "ghost",
|
|
119
|
+
className: classNames(
|
|
120
|
+
ACTION_BTN,
|
|
121
|
+
"hover:text-blue-600 hover:bg-blue-50/50 dark:hover:text-blue-400 dark:hover:bg-blue-950/20",
|
|
122
|
+
node.liked && "text-blue-600 dark:text-blue-400 bg-blue-50/30 dark:bg-blue-950/10 font-semibold border-blue-200/40 dark:border-blue-800/30"
|
|
123
|
+
),
|
|
124
|
+
onClick: () => onLike?.(node, !node.liked),
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ jsx("svg", { className: classNames("w-3.5 h-3.5 transition-transform duration-200 active:scale-125", node.liked ? "fill-current" : "stroke-current fill-none"), viewBox: "0 0 24 24", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.421.068.848.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 010-7.764c.26-.85.1083-1.368 1.972-1.368h.908c.445 0 .72.498.523.898a8.963 8.963 0 00-.27.602" }) }),
|
|
127
|
+
/* @__PURE__ */ jsx("span", { children: `${likeLabel}${likeCount}` })
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"like"
|
|
133
131
|
)
|
|
134
132
|
);
|
|
135
133
|
}
|
|
136
134
|
if (showReply) {
|
|
137
135
|
actions.push(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
/* @__PURE__ */ jsxs(
|
|
137
|
+
Button,
|
|
138
|
+
{
|
|
139
|
+
size: "sm",
|
|
140
|
+
variant: "ghost",
|
|
141
|
+
className: classNames(
|
|
142
|
+
ACTION_BTN,
|
|
143
|
+
"hover:text-emerald-600 hover:bg-emerald-50/50 dark:hover:text-emerald-400 dark:hover:bg-emerald-950/20"
|
|
144
|
+
),
|
|
145
|
+
onClick: () => {
|
|
146
|
+
setReplyingTo((prev) => prev === node.id ? null : node.id);
|
|
147
|
+
setReplyValue("");
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
151
|
+
/* @__PURE__ */ jsx("span", { children: replyText })
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"reply"
|
|
155
|
+
)
|
|
142
156
|
);
|
|
143
157
|
}
|
|
144
158
|
if (showMore) {
|
|
145
|
-
actions.push(
|
|
159
|
+
actions.push(
|
|
160
|
+
/* @__PURE__ */ jsxs(
|
|
161
|
+
Button,
|
|
162
|
+
{
|
|
163
|
+
size: "sm",
|
|
164
|
+
variant: "ghost",
|
|
165
|
+
className: classNames(
|
|
166
|
+
ACTION_BTN,
|
|
167
|
+
"hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800"
|
|
168
|
+
),
|
|
169
|
+
onClick: () => onMore?.(node),
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ jsx("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" }) }),
|
|
172
|
+
/* @__PURE__ */ jsx("span", { children: moreText })
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"more"
|
|
176
|
+
)
|
|
177
|
+
);
|
|
146
178
|
}
|
|
147
179
|
if (node.actions && node.actions.length > 0) {
|
|
148
180
|
node.actions.forEach((action, index) => {
|
|
@@ -153,7 +185,10 @@ var CommentThread = ({
|
|
|
153
185
|
{
|
|
154
186
|
size: "sm",
|
|
155
187
|
variant: action.variant ?? "ghost",
|
|
156
|
-
className:
|
|
188
|
+
className: classNames(
|
|
189
|
+
ACTION_BTN,
|
|
190
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800"
|
|
191
|
+
),
|
|
157
192
|
disabled: action.disabled,
|
|
158
193
|
onClick: () => {
|
|
159
194
|
action.onClick?.(node, action);
|
|
@@ -171,8 +206,8 @@ var CommentThread = ({
|
|
|
171
206
|
{
|
|
172
207
|
className: classNames(
|
|
173
208
|
"tiger-comment-thread-item",
|
|
174
|
-
depth === 1 && "py-
|
|
175
|
-
depth === 1 && !isLast && showDivider && "border-b border-
|
|
209
|
+
depth === 1 && "py-5",
|
|
210
|
+
depth === 1 && !isLast && showDivider && "border-b border-gray-100 dark:border-gray-800/80"
|
|
176
211
|
),
|
|
177
212
|
children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
178
213
|
showAvatar && node.user ? /* @__PURE__ */ jsx(
|
|
@@ -181,27 +216,27 @@ var CommentThread = ({
|
|
|
181
216
|
size: depth === 1 ? "md" : "sm",
|
|
182
217
|
src: node.user.avatar,
|
|
183
218
|
text: node.user.name,
|
|
184
|
-
className: "shrink-0 mt-0.5"
|
|
219
|
+
className: "shrink-0 mt-0.5 ring-1 ring-black/5 dark:ring-white/10 shadow-sm transition-transform hover:scale-105 duration-200"
|
|
185
220
|
}
|
|
186
221
|
) : null,
|
|
187
222
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
188
223
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
189
|
-
node.user?.name ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "sm", weight: "bold", children: node.user.name }) : null,
|
|
190
|
-
node.user?.title ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", children: node.user.title }) : null,
|
|
191
|
-
node.tag ? /* @__PURE__ */ jsx(Tag, { size: "sm", variant: node.tag.variant ?? "default", children: node.tag.label }) : null,
|
|
192
|
-
node.tags?.map((tag, index) => /* @__PURE__ */ jsx(Tag, { size: "sm", variant: tag.variant ?? "default", children: tag.label }, `${node.id}-tag-${index}`)),
|
|
193
|
-
node.time ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", className: "ml-auto", children: formatCommentTime(node.time) }) : null
|
|
224
|
+
node.user?.name ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "sm", weight: "bold", className: "text-gray-900 dark:text-gray-100 hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer", children: node.user.name }) : null,
|
|
225
|
+
node.user?.title ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", className: "bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-500 dark:text-gray-400 font-medium", children: node.user.title }) : null,
|
|
226
|
+
node.tag ? /* @__PURE__ */ jsx(Tag, { size: "sm", variant: node.tag.variant ?? "default", className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10", children: node.tag.label }) : null,
|
|
227
|
+
node.tags?.map((tag, index) => /* @__PURE__ */ jsx(Tag, { size: "sm", variant: tag.variant ?? "default", className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10", children: tag.label }, `${node.id}-tag-${index}`)),
|
|
228
|
+
node.time ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", className: "ml-auto text-gray-400 dark:text-gray-500 font-normal", children: formatCommentTime(node.time) }) : null
|
|
194
229
|
] }),
|
|
195
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm text-
|
|
196
|
-
actions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1", children: actions }) : null,
|
|
197
|
-
replyingTo === node.id ? /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-
|
|
230
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed break-words mt-2 mb-3 pr-2", children: node.content }),
|
|
231
|
+
actions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: actions }) : null,
|
|
232
|
+
replyingTo === node.id ? /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-3 bg-gray-50/50 dark:bg-gray-900/30 border border-gray-100 dark:border-gray-800/80 p-4 rounded-xl shadow-sm backdrop-blur-sm transition-all duration-300", children: [
|
|
198
233
|
/* @__PURE__ */ jsx(
|
|
199
234
|
Textarea,
|
|
200
235
|
{
|
|
201
|
-
rows:
|
|
236
|
+
rows: 3,
|
|
202
237
|
value: replyValue,
|
|
203
238
|
placeholder: replyPlaceholder,
|
|
204
|
-
className: "bg-
|
|
239
|
+
className: "bg-white dark:bg-gray-950 border-gray-200 dark:border-gray-800 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 dark:focus:border-blue-400 rounded-lg shadow-inner transition-all duration-200",
|
|
205
240
|
onChange: (event) => setReplyValue(event.target.value)
|
|
206
241
|
}
|
|
207
242
|
),
|
|
@@ -211,6 +246,7 @@ var CommentThread = ({
|
|
|
211
246
|
{
|
|
212
247
|
size: "sm",
|
|
213
248
|
variant: "ghost",
|
|
249
|
+
className: "px-3 py-1.5 text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg transition-colors",
|
|
214
250
|
onClick: () => {
|
|
215
251
|
setReplyingTo(null);
|
|
216
252
|
setReplyValue("");
|
|
@@ -218,7 +254,16 @@ var CommentThread = ({
|
|
|
218
254
|
children: cancelReplyText
|
|
219
255
|
}
|
|
220
256
|
),
|
|
221
|
-
/* @__PURE__ */ jsx(
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
Button,
|
|
259
|
+
{
|
|
260
|
+
size: "sm",
|
|
261
|
+
variant: "primary",
|
|
262
|
+
className: "px-3 py-1.5 text-xs font-semibold shadow-sm hover:shadow transition-all duration-200 rounded-lg",
|
|
263
|
+
onClick: () => handleReplySubmit(node),
|
|
264
|
+
children: replyButtonText
|
|
265
|
+
}
|
|
266
|
+
)
|
|
222
267
|
] })
|
|
223
268
|
] }) : null,
|
|
224
269
|
hasChildren ? /* @__PURE__ */ jsx(
|
|
@@ -226,7 +271,7 @@ var CommentThread = ({
|
|
|
226
271
|
{
|
|
227
272
|
size: "sm",
|
|
228
273
|
variant: "ghost",
|
|
229
|
-
className: classNames("mt-2", PRIMARY_BTN),
|
|
274
|
+
className: classNames("mt-2 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10 transition-colors", PRIMARY_BTN),
|
|
230
275
|
"aria-expanded": isExpanded,
|
|
231
276
|
"aria-controls": repliesId,
|
|
232
277
|
onClick: () => toggleExpanded(node.id),
|
|
@@ -237,7 +282,7 @@ var CommentThread = ({
|
|
|
237
282
|
"div",
|
|
238
283
|
{
|
|
239
284
|
id: repliesId,
|
|
240
|
-
className: "mt-
|
|
285
|
+
className: "mt-4 ml-1 pl-4 border-l-2 border-gray-100 dark:border-gray-800 hover:border-blue-500/40 dark:hover:border-blue-400/40 space-y-4 transition-colors duration-300",
|
|
241
286
|
children: [
|
|
242
287
|
visibleChildren.map(
|
|
243
288
|
(child, index) => renderNode(child, depth + 1, index === visibleChildren.length - 1)
|
|
@@ -269,7 +314,10 @@ var CommentThread = ({
|
|
|
269
314
|
"data-tiger-comment-thread": true,
|
|
270
315
|
"aria-label": divProps["aria-label"] ?? (divProps["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B"),
|
|
271
316
|
...divProps,
|
|
272
|
-
children: resolvedNodes.length === 0 ? /* @__PURE__ */
|
|
317
|
+
children: resolvedNodes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center border border-dashed border-gray-200 dark:border-gray-800/80 rounded-xl py-12 px-4 bg-gray-50/20 dark:bg-gray-900/5 transition-colors", children: [
|
|
318
|
+
/* @__PURE__ */ jsx("svg", { className: "w-10 h-10 text-gray-300 dark:text-gray-600 mb-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
319
|
+
/* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", color: "muted", className: "font-medium", children: emptyText })
|
|
320
|
+
] }) : resolvedNodes.map((node, index) => renderNode(node, 1, index === resolvedNodes.length - 1))
|
|
273
321
|
}
|
|
274
322
|
);
|
|
275
323
|
};
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
getStepTailClasses,
|
|
10
10
|
getStepTitleClasses,
|
|
11
11
|
getStepsContainerClasses,
|
|
12
|
-
calculateStepStatus
|
|
13
|
-
stepFinishChar
|
|
12
|
+
calculateStepStatus
|
|
14
13
|
} from "@expcat/tigercat-core";
|
|
15
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
15
|
var StepsContext = createContext(null);
|
|
@@ -65,7 +64,7 @@ var StepsItem = ({
|
|
|
65
64
|
return /* @__PURE__ */ jsx("div", { className: iconClasses, children: icon });
|
|
66
65
|
}
|
|
67
66
|
if (stepStatus === "finish") {
|
|
68
|
-
return /* @__PURE__ */ jsx("div", { className: iconClasses, "aria-hidden": "true", children:
|
|
67
|
+
return /* @__PURE__ */ jsx("div", { className: iconClasses, "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 shrink-0 transition-transform duration-300 animate-fade-in", fill: "none", stroke: "currentColor", strokeWidth: "3", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) });
|
|
69
68
|
}
|
|
70
69
|
return /* @__PURE__ */ jsx("div", { className: iconClasses, children: stepIndex + 1 });
|
|
71
70
|
};
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
var _chunkP36GX65Njs = require('./chunk-P36GX65N.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkZRHDNGWOjs = require('./chunk-ZRHDNGWO.js');
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
var _chunkZYJTHGQWjs = require('./chunk-ZYJTHGQW.js');
|
|
7
10
|
|
|
8
11
|
|
|
@@ -64,7 +67,7 @@ var ChatWindow = ({
|
|
|
64
67
|
const inputValue = value !== void 0 ? value : innerValue;
|
|
65
68
|
const wrapperClasses = _react.useMemo.call(void 0,
|
|
66
69
|
() => _tigercatcore.classNames.call(void 0,
|
|
67
|
-
"tiger-chat-window flex flex-col w-full rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)]",
|
|
70
|
+
"tiger-chat-window flex flex-col w-full rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] shadow-sm overflow-hidden transition-all duration-300",
|
|
68
71
|
className
|
|
69
72
|
),
|
|
70
73
|
[className]
|
|
@@ -144,8 +147,8 @@ var ChatWindow = ({
|
|
|
144
147
|
"div",
|
|
145
148
|
{
|
|
146
149
|
className: _tigercatcore.classNames.call(void 0,
|
|
147
|
-
"rounded-[var(--tiger-radius-
|
|
148
|
-
isSelf ? "bg-[var(--tiger-primary,#2563eb)] text-white rounded-tr-
|
|
150
|
+
"rounded-[var(--tiger-radius-lg,0.75rem)] px-4 py-2.5 text-sm break-words shadow-sm transition-all",
|
|
151
|
+
isSelf ? "bg-[var(--tiger-primary,#2563eb)] text-white rounded-tr-[var(--tiger-radius-sm,0.375rem)]" : "bg-[var(--tiger-surface,#ffffff)] border border-[var(--tiger-border,#e5e7eb)] text-[var(--tiger-text,#111827)] rounded-tl-[var(--tiger-radius-sm,0.375rem)]"
|
|
149
152
|
),
|
|
150
153
|
"data-tiger-chat-bubble": true,
|
|
151
154
|
children: _nullishCoalesce(_optionalChain([renderMessage, 'optionalCall', _6 => _6(message, index)]), () => ( message.content))
|
|
@@ -177,6 +180,7 @@ var ChatWindow = ({
|
|
|
177
180
|
"div",
|
|
178
181
|
{
|
|
179
182
|
ref: messageListRef,
|
|
183
|
+
className: "flex-1 overflow-auto bg-[var(--tiger-surface-muted,#f9fafb)]",
|
|
180
184
|
role: "log",
|
|
181
185
|
"aria-live": "polite",
|
|
182
186
|
"aria-relevant": "additions text",
|
|
@@ -195,16 +199,16 @@ var ChatWindow = ({
|
|
|
195
199
|
"div",
|
|
196
200
|
{
|
|
197
201
|
ref: messageListRef,
|
|
198
|
-
className: "flex-1 overflow-auto p-
|
|
202
|
+
className: "flex-1 overflow-auto p-5 space-y-4 bg-[var(--tiger-surface-muted,#f9fafb)]",
|
|
199
203
|
role: "log",
|
|
200
204
|
"aria-live": "polite",
|
|
201
205
|
"aria-relevant": "additions text",
|
|
202
206
|
"aria-label": _nullishCoalesce(messageListAriaLabel, () => ( "\u6D88\u606F\u5217\u8868")),
|
|
203
|
-
children: messages.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full flex items-center justify-center
|
|
207
|
+
children: messages.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full flex items-center justify-center py-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZRHDNGWOjs.Empty, { description: emptyText }) }) : messages.map(renderMessageItem)
|
|
204
208
|
}
|
|
205
209
|
),
|
|
206
|
-
statusText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-
|
|
207
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-end gap-3 px-
|
|
210
|
+
statusText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-5 py-2 border-t border-[var(--tiger-border,#e5e7eb)] text-xs italic text-[var(--tiger-text-muted,#6b7280)] bg-[var(--tiger-surface-muted,#f9fafb)]", children: statusText }),
|
|
211
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-end gap-3 px-5 py-4 border-t border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] rounded-b-lg", children: [
|
|
208
212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1", children: inputType === "input" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
209
213
|
_chunkZYJTHGQWjs.Input,
|
|
210
214
|
{
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-QAIBQHIO.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/Table.tsx
|
|
2
6
|
import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
3
7
|
import {
|
|
@@ -12,7 +16,11 @@ import {
|
|
|
12
16
|
tableResponsiveCardListClasses,
|
|
13
17
|
tableResponsiveCardRowClasses,
|
|
14
18
|
tableResponsiveCardValueClasses,
|
|
15
|
-
tableLoadingOverlayClasses
|
|
19
|
+
tableLoadingOverlayClasses,
|
|
20
|
+
getImmediateTigerLocale,
|
|
21
|
+
isLazyTigerLocale,
|
|
22
|
+
mergeTigerLocale,
|
|
23
|
+
resolveTigerLocale
|
|
16
24
|
} from "@expcat/tigercat-core";
|
|
17
25
|
import { tableExportButtonClasses } from "@expcat/tigercat-core";
|
|
18
26
|
|
|
@@ -822,6 +830,10 @@ function renderSummaryRow(ctx, view) {
|
|
|
822
830
|
|
|
823
831
|
// src/components/Table/render-pagination.tsx
|
|
824
832
|
import {
|
|
833
|
+
formatIntlNumber,
|
|
834
|
+
formatPageAriaLabel,
|
|
835
|
+
formatPaginationTotal,
|
|
836
|
+
getPaginationLabels,
|
|
825
837
|
getSimplePaginationContainerClasses,
|
|
826
838
|
getSimplePaginationTotalClasses,
|
|
827
839
|
getSimplePaginationControlsClasses,
|
|
@@ -831,6 +843,14 @@ import {
|
|
|
831
843
|
getSimplePaginationButtonsWrapperClasses
|
|
832
844
|
} from "@expcat/tigercat-core";
|
|
833
845
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
846
|
+
var DEFAULT_PREV_TEXT = "Previous";
|
|
847
|
+
var DEFAULT_NEXT_TEXT = "Next";
|
|
848
|
+
function formatDefaultTotalText(total, range) {
|
|
849
|
+
return `Showing ${range[0]} to ${range[1]} of ${total} results`;
|
|
850
|
+
}
|
|
851
|
+
function formatDefaultPageIndicatorText(current, total) {
|
|
852
|
+
return `Page ${current} of ${total}`;
|
|
853
|
+
}
|
|
834
854
|
function renderPagination(ctx, view) {
|
|
835
855
|
const { pagination } = view;
|
|
836
856
|
if (pagination === false || !ctx.paginationInfo) {
|
|
@@ -839,8 +859,15 @@ function renderPagination(ctx, view) {
|
|
|
839
859
|
const { totalPages, startIndex, endIndex, hasNext, hasPrev } = ctx.paginationInfo;
|
|
840
860
|
const paginationConfig = pagination;
|
|
841
861
|
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.length;
|
|
862
|
+
const locale = view.disableI18n ? void 0 : view.locale;
|
|
863
|
+
const labels = locale ? getPaginationLabels(locale) : void 0;
|
|
864
|
+
const localeCode = locale?.locale;
|
|
865
|
+
const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : labels ? formatPaginationTotal(labels.totalText, total, [startIndex, endIndex], localeCode) : formatDefaultTotalText(total, [startIndex, endIndex]);
|
|
866
|
+
const finalPrevText = paginationConfig.prevText || labels?.prevPageAriaLabel || DEFAULT_PREV_TEXT;
|
|
867
|
+
const finalNextText = paginationConfig.nextText || labels?.nextPageAriaLabel || DEFAULT_NEXT_TEXT;
|
|
868
|
+
const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage, totalPages) : labels ? `${formatPageAriaLabel(labels.pageAriaLabel, ctx.currentPage, localeCode)} / ${formatIntlNumber(totalPages, localeCode)} ${labels.pageText}` : formatDefaultPageIndicatorText(ctx.currentPage, totalPages);
|
|
842
869
|
return /* @__PURE__ */ jsxs4("div", { className: getSimplePaginationContainerClasses(), children: [
|
|
843
|
-
paginationConfig.showTotal !== false && /* @__PURE__ */ jsx5("div", { className: getSimplePaginationTotalClasses(), children:
|
|
870
|
+
paginationConfig.showTotal !== false && /* @__PURE__ */ jsx5("div", { className: getSimplePaginationTotalClasses(), children: finalTotalText }),
|
|
844
871
|
/* @__PURE__ */ jsxs4("div", { className: getSimplePaginationControlsClasses(), children: [
|
|
845
872
|
paginationConfig.showSizeChanger !== false && /* @__PURE__ */ jsx5(
|
|
846
873
|
"select",
|
|
@@ -848,10 +875,7 @@ function renderPagination(ctx, view) {
|
|
|
848
875
|
className: getSimplePaginationSelectClasses(),
|
|
849
876
|
value: ctx.currentPageSize,
|
|
850
877
|
onChange: (e) => ctx.handlePageSizeChange(Number(e.target.value)),
|
|
851
|
-
children: (paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map((size) => /* @__PURE__ */
|
|
852
|
-
size,
|
|
853
|
-
" / page"
|
|
854
|
-
] }, size))
|
|
878
|
+
children: (paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map((size) => /* @__PURE__ */ jsx5("option", { value: size, children: paginationConfig.pageSizeText ? paginationConfig.pageSizeText(size) : labels ? `${formatIntlNumber(size, localeCode)} ${labels.itemsPerPageText}` : `${size} / page` }, size))
|
|
855
879
|
}
|
|
856
880
|
),
|
|
857
881
|
/* @__PURE__ */ jsxs4("div", { className: getSimplePaginationButtonsWrapperClasses(), children: [
|
|
@@ -861,22 +885,17 @@ function renderPagination(ctx, view) {
|
|
|
861
885
|
className: getSimplePaginationButtonClasses(!hasPrev),
|
|
862
886
|
disabled: !hasPrev,
|
|
863
887
|
onClick: () => ctx.handlePageChange(ctx.currentPage - 1),
|
|
864
|
-
children:
|
|
888
|
+
children: finalPrevText
|
|
865
889
|
}
|
|
866
890
|
),
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
"Page ",
|
|
869
|
-
ctx.currentPage,
|
|
870
|
-
" of ",
|
|
871
|
-
totalPages
|
|
872
|
-
] }),
|
|
891
|
+
/* @__PURE__ */ jsx5("span", { className: getSimplePaginationPageIndicatorClasses(), children: finalPageIndicatorText }),
|
|
873
892
|
/* @__PURE__ */ jsx5(
|
|
874
893
|
"button",
|
|
875
894
|
{
|
|
876
895
|
className: getSimplePaginationButtonClasses(!hasNext),
|
|
877
896
|
disabled: !hasNext,
|
|
878
897
|
onClick: () => ctx.handlePageChange(ctx.currentPage + 1),
|
|
879
|
-
children:
|
|
898
|
+
children: finalNextText
|
|
880
899
|
}
|
|
881
900
|
)
|
|
882
901
|
] })
|
|
@@ -948,6 +967,7 @@ function Table({
|
|
|
948
967
|
className,
|
|
949
968
|
...props
|
|
950
969
|
}) {
|
|
970
|
+
const config = useTigerConfig();
|
|
951
971
|
const wrapperRef = useRef(null);
|
|
952
972
|
const tableRef = useRef(null);
|
|
953
973
|
const [measuredColumnWidths, setMeasuredColumnWidths] = useState2({});
|
|
@@ -955,6 +975,31 @@ function Table({
|
|
|
955
975
|
const internalRowSelection = rowSelection;
|
|
956
976
|
const internalExpandable = expandable;
|
|
957
977
|
const internalRowClassName = rowClassName;
|
|
978
|
+
const paginationLocaleInput = pagination !== false && typeof pagination === "object" ? pagination.locale : void 0;
|
|
979
|
+
const isPaginationI18nDisabled = paginationLocaleInput === false;
|
|
980
|
+
const immediatePaginationLocale = useMemo2(
|
|
981
|
+
() => paginationLocaleInput && !isPaginationI18nDisabled ? getImmediateTigerLocale(paginationLocaleInput) : void 0,
|
|
982
|
+
[isPaginationI18nDisabled, paginationLocaleInput]
|
|
983
|
+
);
|
|
984
|
+
const [resolvedPaginationLocale, setResolvedPaginationLocale] = useState2(immediatePaginationLocale);
|
|
985
|
+
useEffect2(() => {
|
|
986
|
+
let active = true;
|
|
987
|
+
setResolvedPaginationLocale(immediatePaginationLocale);
|
|
988
|
+
if (paginationLocaleInput && !isPaginationI18nDisabled && isLazyTigerLocale(paginationLocaleInput)) {
|
|
989
|
+
resolveTigerLocale(paginationLocaleInput).then((nextLocale) => {
|
|
990
|
+
if (active) setResolvedPaginationLocale(nextLocale);
|
|
991
|
+
}).catch(() => {
|
|
992
|
+
if (active) setResolvedPaginationLocale(immediatePaginationLocale);
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
return () => {
|
|
996
|
+
active = false;
|
|
997
|
+
};
|
|
998
|
+
}, [isPaginationI18nDisabled, paginationLocaleInput, immediatePaginationLocale]);
|
|
999
|
+
const paginationLocale = useMemo2(
|
|
1000
|
+
() => isPaginationI18nDisabled ? void 0 : mergeTigerLocale(config.locale, resolvedPaginationLocale),
|
|
1001
|
+
[config.locale, isPaginationI18nDisabled, resolvedPaginationLocale]
|
|
1002
|
+
);
|
|
958
1003
|
const ctx = useTableState({
|
|
959
1004
|
columns,
|
|
960
1005
|
dataSource,
|
|
@@ -1152,7 +1197,11 @@ function Table({
|
|
|
1152
1197
|
]
|
|
1153
1198
|
}
|
|
1154
1199
|
),
|
|
1155
|
-
renderPagination(ctx, {
|
|
1200
|
+
renderPagination(ctx, {
|
|
1201
|
+
pagination,
|
|
1202
|
+
locale: paginationLocale,
|
|
1203
|
+
disableI18n: isPaginationI18nDisabled
|
|
1204
|
+
})
|
|
1156
1205
|
]
|
|
1157
1206
|
}
|
|
1158
1207
|
);
|
|
@@ -37,7 +37,7 @@ var CardItem = _react2.default.memo(
|
|
|
37
37
|
const cardClasses = _tigercatcore.classNames.call(void 0,
|
|
38
38
|
_tigercatcore.taskBoardCardClasses,
|
|
39
39
|
isDragging && _tigercatcore.taskBoardCardDraggingClasses,
|
|
40
|
-
isKbGrabbed && "ring-2 ring-[var(--tiger-primary,#2563eb)]"
|
|
40
|
+
isKbGrabbed && "ring-2 ring-[var(--tiger-primary,#2563eb)] ring-offset-2 shadow-[0_0_12px_rgba(37,99,235,0.25)]"
|
|
41
41
|
);
|
|
42
42
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
43
43
|
"div",
|
|
@@ -169,20 +169,30 @@ var ColumnItem = _react2.default.memo(
|
|
|
169
169
|
children: renderColumnHeader ? renderColumnHeader(column) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
170
170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: wipOver ? _tigercatcore.taskBoardWipExceededClasses : void 0, children: [
|
|
171
171
|
column.title,
|
|
172
|
-
showCardCount && cardCount ? null : column.wipLimit != null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
showCardCount && cardCount ? null : column.wipLimit != null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
173
|
+
"span",
|
|
174
|
+
{
|
|
175
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
176
|
+
"ml-2 text-xs font-normal transition-all duration-200 px-1.5 py-0.5 rounded",
|
|
177
|
+
wipOver ? "bg-red-50 dark:bg-red-950/30 text-[var(--tiger-error,#ef4444)] font-semibold border border-red-200/30 dark:border-red-900/30 shadow-xs" : "opacity-70 bg-[var(--tiger-border,#e5e7eb)]/20 text-[var(--tiger-text-secondary,#6b7280)]"
|
|
178
|
+
),
|
|
179
|
+
title: wipTitle,
|
|
180
|
+
children: [
|
|
181
|
+
"(",
|
|
182
|
+
column.cards.length,
|
|
183
|
+
"/",
|
|
184
|
+
column.wipLimit,
|
|
185
|
+
")"
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "ml-2 text-xs font-normal px-1.5 py-0.5 rounded bg-[var(--tiger-border,#e5e7eb)]/20 text-[var(--tiger-text-secondary,#6b7280)] opacity-70", children: column.cards.length })
|
|
179
189
|
] }),
|
|
180
190
|
showCardCount && cardCount && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
181
191
|
"span",
|
|
182
192
|
{
|
|
183
193
|
className: _tigercatcore.classNames.call(void 0,
|
|
184
194
|
_tigercatcore.kanbanCardCountClasses,
|
|
185
|
-
wipOver && _tigercatcore.taskBoardWipExceededClasses
|
|
195
|
+
wipOver && `${_tigercatcore.taskBoardWipExceededClasses} bg-red-50 dark:bg-red-950/30 border border-red-200/50 dark:border-red-900/30 font-semibold shadow-xs`
|
|
186
196
|
),
|
|
187
197
|
children: cardCount.limit ? `${cardCount.count}/${cardCount.limit}` : `${cardCount.count}`
|
|
188
198
|
}
|