@expcat/tigercat-vue 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-OK7MTFAX.mjs → chunk-4GYBJBFJ.mjs} +76 -19
- package/dist/{chunk-YCBU3C4T.mjs → chunk-4J5EK3WY.mjs} +100 -35
- package/dist/{chunk-2C5TOAYI.js → chunk-663C2UX7.js} +2 -2
- package/dist/{chunk-P453RVKY.js → chunk-6G5IMGTC.js} +85 -14
- package/dist/{chunk-5ZAIW5W3.mjs → chunk-AQE5RZDE.mjs} +1 -1
- package/dist/{chunk-DYJ4Z47L.mjs → chunk-BPRKQVIL.mjs} +143 -46
- package/dist/{chunk-KOLARHCT.js → chunk-DEDRUUK4.js} +1 -0
- package/dist/{chunk-OW5D4LU6.js → chunk-DPHLBHJY.js} +86 -19
- package/dist/{chunk-VPNIZPIF.js → chunk-DS7RQFEG.js} +15 -2
- package/dist/{chunk-BGMQIUPP.js → chunk-EU4IGIPC.js} +7 -4
- package/dist/{chunk-V6YR7CPK.js → chunk-F4FPIIVT.js} +56 -21
- package/dist/{chunk-CN7HFUFN.mjs → chunk-F5S26BR3.mjs} +7 -4
- package/dist/{chunk-YCBLL5K3.js → chunk-FKLK6RHZ.js} +76 -19
- package/dist/{chunk-U5S3ZEYZ.js → chunk-H5JDEKIV.js} +100 -35
- package/dist/{chunk-54G23KA7.mjs → chunk-IXJSZIAE.mjs} +21 -5
- package/dist/{chunk-XMGU52S5.js → chunk-L6W3XL3A.js} +143 -46
- package/dist/{chunk-ATRF7NPJ.mjs → chunk-LFQWJILV.mjs} +55 -20
- package/dist/{chunk-NMVKDWMK.mjs → chunk-MTYDCYGW.mjs} +83 -16
- package/dist/{chunk-F5JPUPWI.mjs → chunk-OF4MY6EC.mjs} +1 -0
- package/dist/{chunk-KLX7YHP2.mjs → chunk-OZLSZQXF.mjs} +83 -12
- package/dist/{chunk-PUSTYAMS.mjs → chunk-RE7K3KNW.mjs} +16 -3
- package/dist/{chunk-IIEMDA36.mjs → chunk-S45NWVQS.mjs} +14 -8
- package/dist/{chunk-CBZIVUCJ.js → chunk-VES3OJOP.js} +14 -8
- package/dist/{chunk-O5DBHXGJ.js → chunk-ZNGRSXFK.js} +21 -5
- package/dist/components/ActivityFeed.d.mts +6 -6
- package/dist/components/ActivityFeed.d.ts +6 -6
- package/dist/components/ActivityFeed.js +2 -2
- package/dist/components/ActivityFeed.mjs +1 -1
- package/dist/components/Affix.d.mts +4 -4
- package/dist/components/Affix.d.ts +4 -4
- package/dist/components/Alert.d.mts +3 -3
- package/dist/components/Alert.d.ts +3 -3
- package/dist/components/Anchor.d.mts +2 -2
- package/dist/components/Anchor.d.ts +2 -2
- package/dist/components/AreaChart.d.mts +2 -2
- package/dist/components/AreaChart.d.ts +2 -2
- package/dist/components/AutoComplete.d.mts +1 -1
- package/dist/components/AutoComplete.d.ts +1 -1
- package/dist/components/Avatar.d.mts +2 -2
- package/dist/components/Avatar.d.ts +2 -2
- package/dist/components/AvatarGroup.d.mts +1 -1
- package/dist/components/AvatarGroup.d.ts +1 -1
- package/dist/components/BackTop.d.mts +1 -1
- package/dist/components/BackTop.d.ts +1 -1
- package/dist/components/Badge.d.mts +4 -4
- package/dist/components/Badge.d.ts +4 -4
- package/dist/components/BarChart.d.mts +1 -1
- package/dist/components/BarChart.d.ts +1 -1
- package/dist/components/Breadcrumb.d.mts +2 -2
- package/dist/components/Breadcrumb.d.ts +2 -2
- package/dist/components/Button.d.mts +5 -5
- package/dist/components/Button.d.ts +5 -5
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/ButtonGroup.d.ts +1 -1
- package/dist/components/Calendar.d.mts +1 -1
- package/dist/components/Calendar.d.ts +1 -1
- package/dist/components/Card.d.mts +3 -3
- package/dist/components/Card.d.ts +3 -3
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartGrid.d.ts +1 -1
- package/dist/components/ChatWindow.d.mts +2 -2
- package/dist/components/ChatWindow.d.ts +2 -2
- package/dist/components/ChatWindow.js +3 -2
- package/dist/components/ChatWindow.mjs +2 -1
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/CodeEditor.d.ts +1 -1
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/Collapse.d.ts +1 -1
- package/dist/components/ColorSwatch.d.mts +1 -1
- package/dist/components/ColorSwatch.d.ts +1 -1
- package/dist/components/CommentThread.d.mts +3 -3
- package/dist/components/CommentThread.d.ts +3 -3
- package/dist/components/CommentThread.js +2 -2
- package/dist/components/CommentThread.mjs +1 -1
- package/dist/components/ConfigProvider.d.mts +1 -1
- package/dist/components/ConfigProvider.d.ts +1 -1
- package/dist/components/Countdown.d.mts +1 -1
- package/dist/components/Countdown.d.ts +1 -1
- package/dist/components/CropUpload.js +2 -2
- package/dist/components/CropUpload.mjs +1 -1
- package/dist/components/DataTableWithToolbar.d.mts +7 -7
- package/dist/components/DataTableWithToolbar.d.ts +7 -7
- package/dist/components/DataTableWithToolbar.js +4 -3
- package/dist/components/DataTableWithToolbar.mjs +3 -2
- package/dist/components/DatePicker.d.mts +3 -3
- package/dist/components/DatePicker.d.ts +3 -3
- package/dist/components/Descriptions.d.mts +3 -3
- package/dist/components/Descriptions.d.ts +3 -3
- package/dist/components/DonutChart.d.mts +2 -2
- package/dist/components/DonutChart.d.ts +2 -2
- package/dist/components/Drawer.d.mts +6 -6
- package/dist/components/Drawer.d.ts +6 -6
- package/dist/components/FileManager.d.mts +2 -2
- package/dist/components/FileManager.d.ts +2 -2
- package/dist/components/FloatButton.d.mts +4 -4
- package/dist/components/FloatButton.d.ts +4 -4
- package/dist/components/Form.d.mts +1 -1
- package/dist/components/Form.d.ts +1 -1
- package/dist/components/FormWizard.d.mts +11 -2
- package/dist/components/FormWizard.d.ts +11 -2
- package/dist/components/FormWizard.js +3 -3
- package/dist/components/FormWizard.mjs +2 -2
- package/dist/components/FunnelChart.d.mts +2 -2
- package/dist/components/FunnelChart.d.ts +2 -2
- package/dist/components/Gantt.d.mts +1 -1
- package/dist/components/Gantt.d.ts +1 -1
- package/dist/components/GaugeChart.d.mts +3 -3
- package/dist/components/GaugeChart.d.ts +3 -3
- package/dist/components/HeatmapChart.d.mts +2 -2
- package/dist/components/HeatmapChart.d.ts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/Image.d.ts +2 -2
- package/dist/components/ImageAnnotation.d.mts +2 -2
- package/dist/components/ImageAnnotation.d.ts +2 -2
- package/dist/components/ImagePreview.d.mts +1 -1
- package/dist/components/ImagePreview.d.ts +1 -1
- package/dist/components/InfiniteScroll.d.mts +2 -2
- package/dist/components/InfiniteScroll.d.ts +2 -2
- package/dist/components/Input.d.mts +5 -5
- package/dist/components/Input.d.ts +5 -5
- package/dist/components/InputGroup.d.mts +2 -2
- package/dist/components/InputGroup.d.ts +2 -2
- package/dist/components/InputNumber.d.mts +3 -3
- package/dist/components/InputNumber.d.ts +3 -3
- package/dist/components/Kanban.js +3 -3
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.d.ts +2 -2
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/List.d.mts +6 -6
- package/dist/components/List.d.ts +6 -6
- package/dist/components/Loading.d.mts +6 -6
- package/dist/components/Loading.d.ts +6 -6
- package/dist/components/MarkdownEditor.d.mts +1 -1
- package/dist/components/MarkdownEditor.d.ts +1 -1
- package/dist/components/Menu.d.mts +13 -3
- package/dist/components/Menu.d.ts +13 -3
- package/dist/components/Menu.js +2 -2
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuItem.js +3 -3
- package/dist/components/MenuItem.mjs +1 -1
- package/dist/components/MenuItemGroup.js +3 -3
- package/dist/components/MenuItemGroup.mjs +1 -1
- package/dist/components/Modal.d.mts +6 -6
- package/dist/components/Modal.d.ts +6 -6
- package/dist/components/NotificationCenter.d.mts +7 -7
- package/dist/components/NotificationCenter.d.ts +7 -7
- package/dist/components/NotificationCenter.js +2 -2
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NumberKeyboard.d.mts +1 -1
- package/dist/components/NumberKeyboard.d.ts +1 -1
- package/dist/components/OrgChart.d.mts +2 -2
- package/dist/components/OrgChart.d.ts +2 -2
- package/dist/components/Pagination.d.mts +3 -3
- package/dist/components/Pagination.d.ts +3 -3
- package/dist/components/PieChart.d.mts +2 -2
- package/dist/components/PieChart.d.ts +2 -2
- package/dist/components/Popconfirm.d.mts +1 -1
- package/dist/components/Popconfirm.d.ts +1 -1
- package/dist/components/Popover.d.mts +4 -4
- package/dist/components/Popover.d.ts +4 -4
- package/dist/components/Progress.d.mts +7 -7
- package/dist/components/Progress.d.ts +7 -7
- package/dist/components/QRCode.d.mts +2 -2
- package/dist/components/QRCode.d.ts +2 -2
- package/dist/components/RadarChart.d.mts +2 -2
- package/dist/components/RadarChart.d.ts +2 -2
- package/dist/components/RichTextEditor.d.mts +1 -1
- package/dist/components/RichTextEditor.d.ts +1 -1
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/Row.d.ts +1 -1
- package/dist/components/ScatterChart.d.mts +1 -1
- package/dist/components/ScatterChart.d.ts +1 -1
- package/dist/components/ScrollSpy.d.mts +2 -2
- package/dist/components/ScrollSpy.d.ts +2 -2
- package/dist/components/Segmented.d.mts +2 -2
- package/dist/components/Segmented.d.ts +2 -2
- package/dist/components/Signature.d.mts +4 -4
- package/dist/components/Signature.d.ts +4 -4
- package/dist/components/Skeleton.d.mts +2 -2
- package/dist/components/Skeleton.d.ts +2 -2
- package/dist/components/Slider.d.mts +1 -1
- package/dist/components/Slider.d.ts +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/Space.d.ts +2 -2
- package/dist/components/Spotlight.d.mts +6 -6
- package/dist/components/Spotlight.d.ts +6 -6
- package/dist/components/Statistic.d.mts +1 -1
- package/dist/components/Statistic.d.ts +1 -1
- package/dist/components/Steps.d.mts +2 -2
- package/dist/components/Steps.d.ts +2 -2
- package/dist/components/Steps.js +2 -2
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +3 -3
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/SubMenu.js +3 -3
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/SunburstChart.d.mts +1 -1
- package/dist/components/SunburstChart.d.ts +1 -1
- package/dist/components/Table.d.mts +5 -5
- package/dist/components/Table.d.ts +5 -5
- package/dist/components/Table.js +3 -2
- package/dist/components/Table.mjs +2 -1
- package/dist/components/Tabs.d.mts +3 -3
- package/dist/components/Tabs.d.ts +3 -3
- package/dist/components/Tag.d.mts +2 -2
- package/dist/components/Tag.d.ts +2 -2
- package/dist/components/TaskBoard.js +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Text.d.mts +3 -3
- package/dist/components/Text.d.ts +3 -3
- package/dist/components/Textarea.d.mts +2 -2
- package/dist/components/Textarea.d.ts +2 -2
- package/dist/components/TimePicker.d.mts +3 -3
- package/dist/components/TimePicker.d.ts +3 -3
- package/dist/components/Timeline.d.mts +1 -1
- package/dist/components/Timeline.d.ts +1 -1
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/Tour.d.mts +1 -1
- package/dist/components/Tour.d.ts +1 -1
- package/dist/components/Tree.d.mts +4 -4
- package/dist/components/Tree.d.ts +4 -4
- package/dist/components/TreeMapChart.d.mts +1 -1
- package/dist/components/TreeMapChart.d.ts +1 -1
- package/dist/components/Upload.d.mts +3 -3
- package/dist/components/Upload.d.ts +3 -3
- package/dist/components/VirtualTable.d.mts +3 -3
- package/dist/components/VirtualTable.d.ts +3 -3
- package/dist/components/Watermark.d.mts +6 -6
- package/dist/components/Watermark.d.ts +6 -6
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/package.json +2 -2
|
@@ -163,23 +163,9 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
163
163
|
updateExpandedKeys(next);
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
const BTN_BASE = "px-
|
|
167
|
-
const ACTION_BTN = `${BTN_BASE} text-gray-
|
|
168
|
-
const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] font-
|
|
169
|
-
const renderActionButton = (label, key, onClick, active) => _vue.h.call(void 0,
|
|
170
|
-
_chunk4VLNT2EDjs.Button,
|
|
171
|
-
{
|
|
172
|
-
key,
|
|
173
|
-
size: "sm",
|
|
174
|
-
variant: "ghost",
|
|
175
|
-
className: _tigercatcore.classNames.call(void 0,
|
|
176
|
-
ACTION_BTN,
|
|
177
|
-
active && "text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary,#2563eb)] font-medium"
|
|
178
|
-
),
|
|
179
|
-
onClick
|
|
180
|
-
},
|
|
181
|
-
{ default: () => label }
|
|
182
|
-
);
|
|
166
|
+
const BTN_BASE = "px-2 py-0.5 h-auto min-h-0 text-xs rounded-md transition-all duration-200 ease-out";
|
|
167
|
+
const ACTION_BTN = `${BTN_BASE} text-gray-500 dark:text-gray-400 font-medium flex items-center gap-1.5`;
|
|
168
|
+
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`;
|
|
183
169
|
const renderNode = (node, depth, isLast) => {
|
|
184
170
|
const hasChildren = !!node.children && node.children.length > 0;
|
|
185
171
|
const isExpanded = expandedSet.value.has(node.id);
|
|
@@ -193,24 +179,110 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
193
179
|
const likeLabel = node.liked ? props.likedText : props.likeText;
|
|
194
180
|
const likeCount = node.likes ? ` ${node.likes}` : "";
|
|
195
181
|
actions.push(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
182
|
+
_vue.h.call(void 0,
|
|
183
|
+
_chunk4VLNT2EDjs.Button,
|
|
184
|
+
{
|
|
185
|
+
key: "like",
|
|
186
|
+
size: "sm",
|
|
187
|
+
variant: "ghost",
|
|
188
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
189
|
+
ACTION_BTN,
|
|
190
|
+
"hover:text-blue-600 hover:bg-blue-50/50 dark:hover:text-blue-400 dark:hover:bg-blue-950/20",
|
|
191
|
+
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"
|
|
192
|
+
),
|
|
193
|
+
onClick: () => emit("like", node, !node.liked)
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
default: () => _vue.h.call(void 0, "span", { class: "flex items-center gap-1.5" }, [
|
|
197
|
+
_vue.h.call(void 0, "svg", {
|
|
198
|
+
class: _tigercatcore.classNames.call(void 0, "w-3.5 h-3.5 transition-transform duration-200 active:scale-125", node.liked ? "fill-current" : "stroke-current fill-none"),
|
|
199
|
+
viewBox: "0 0 24 24",
|
|
200
|
+
strokeWidth: "2"
|
|
201
|
+
}, [
|
|
202
|
+
_vue.h.call(void 0, "path", {
|
|
203
|
+
strokeLinecap: "round",
|
|
204
|
+
strokeLinejoin: "round",
|
|
205
|
+
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"
|
|
206
|
+
})
|
|
207
|
+
]),
|
|
208
|
+
_vue.h.call(void 0, "span", `${likeLabel}${likeCount}`)
|
|
209
|
+
])
|
|
210
|
+
}
|
|
201
211
|
)
|
|
202
212
|
);
|
|
203
213
|
}
|
|
204
214
|
if (props.showReply) {
|
|
205
215
|
actions.push(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
216
|
+
_vue.h.call(void 0,
|
|
217
|
+
_chunk4VLNT2EDjs.Button,
|
|
218
|
+
{
|
|
219
|
+
key: "reply",
|
|
220
|
+
size: "sm",
|
|
221
|
+
variant: "ghost",
|
|
222
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
223
|
+
ACTION_BTN,
|
|
224
|
+
"hover:text-emerald-600 hover:bg-emerald-50/50 dark:hover:text-emerald-400 dark:hover:bg-emerald-950/20"
|
|
225
|
+
),
|
|
226
|
+
onClick: () => {
|
|
227
|
+
replyingTo.value = replyingTo.value === node.id ? null : node.id;
|
|
228
|
+
replyValue.value = "";
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
default: () => _vue.h.call(void 0, "span", { class: "flex items-center gap-1.5" }, [
|
|
233
|
+
_vue.h.call(void 0, "svg", {
|
|
234
|
+
class: "w-3.5 h-3.5",
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
fill: "none",
|
|
237
|
+
stroke: "currentColor",
|
|
238
|
+
strokeWidth: "2"
|
|
239
|
+
}, [
|
|
240
|
+
_vue.h.call(void 0, "path", {
|
|
241
|
+
strokeLinecap: "round",
|
|
242
|
+
strokeLinejoin: "round",
|
|
243
|
+
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"
|
|
244
|
+
})
|
|
245
|
+
]),
|
|
246
|
+
_vue.h.call(void 0, "span", props.replyText)
|
|
247
|
+
])
|
|
248
|
+
}
|
|
249
|
+
)
|
|
210
250
|
);
|
|
211
251
|
}
|
|
212
252
|
if (props.showMore) {
|
|
213
|
-
actions.push(
|
|
253
|
+
actions.push(
|
|
254
|
+
_vue.h.call(void 0,
|
|
255
|
+
_chunk4VLNT2EDjs.Button,
|
|
256
|
+
{
|
|
257
|
+
key: "more",
|
|
258
|
+
size: "sm",
|
|
259
|
+
variant: "ghost",
|
|
260
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
261
|
+
ACTION_BTN,
|
|
262
|
+
"hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800"
|
|
263
|
+
),
|
|
264
|
+
onClick: () => emit("more", node)
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
default: () => _vue.h.call(void 0, "span", { class: "flex items-center gap-1.5" }, [
|
|
268
|
+
_vue.h.call(void 0, "svg", {
|
|
269
|
+
class: "w-3.5 h-3.5",
|
|
270
|
+
viewBox: "0 0 24 24",
|
|
271
|
+
fill: "none",
|
|
272
|
+
stroke: "currentColor",
|
|
273
|
+
strokeWidth: "2"
|
|
274
|
+
}, [
|
|
275
|
+
_vue.h.call(void 0, "path", {
|
|
276
|
+
strokeLinecap: "round",
|
|
277
|
+
strokeLinejoin: "round",
|
|
278
|
+
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"
|
|
279
|
+
})
|
|
280
|
+
]),
|
|
281
|
+
_vue.h.call(void 0, "span", props.moreText)
|
|
282
|
+
])
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
);
|
|
214
286
|
}
|
|
215
287
|
if (node.actions && node.actions.length > 0) {
|
|
216
288
|
node.actions.forEach((action, index) => {
|
|
@@ -222,7 +294,10 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
222
294
|
key: actionKey,
|
|
223
295
|
size: "sm",
|
|
224
296
|
variant: _nullishCoalesce(action.variant, () => ( "ghost")),
|
|
225
|
-
className:
|
|
297
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
298
|
+
ACTION_BTN,
|
|
299
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800"
|
|
300
|
+
),
|
|
226
301
|
disabled: action.disabled,
|
|
227
302
|
onClick: () => {
|
|
228
303
|
_optionalChain([action, 'access', _ => _.onClick, 'optionalCall', _2 => _2(node, action)]);
|
|
@@ -239,8 +314,8 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
239
314
|
{
|
|
240
315
|
class: _tigercatcore.classNames.call(void 0,
|
|
241
316
|
"tiger-comment-thread-item",
|
|
242
|
-
depth === 1 && "py-
|
|
243
|
-
depth === 1 && !isLast && props.showDivider && "border-b border-
|
|
317
|
+
depth === 1 && "py-5",
|
|
318
|
+
depth === 1 && !isLast && props.showDivider && "border-b border-gray-100 dark:border-gray-800/80"
|
|
244
319
|
),
|
|
245
320
|
key: node.id
|
|
246
321
|
},
|
|
@@ -250,23 +325,23 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
250
325
|
size: depth === 1 ? "md" : "sm",
|
|
251
326
|
src: node.user.avatar,
|
|
252
327
|
text: node.user.name,
|
|
253
|
-
className: "shrink-0 mt-0.5"
|
|
328
|
+
className: "shrink-0 mt-0.5 ring-1 ring-black/5 dark:ring-white/10 shadow-sm transition-transform hover:scale-105 duration-200"
|
|
254
329
|
}) : null,
|
|
255
330
|
_vue.h.call(void 0, "div", { class: "flex-1 min-w-0" }, [
|
|
256
331
|
_vue.h.call(void 0, "div", { class: "flex items-center gap-2 flex-wrap" }, [
|
|
257
332
|
_optionalChain([node, 'access', _3 => _3.user, 'optionalAccess', _4 => _4.name]) ? _vue.h.call(void 0,
|
|
258
333
|
_chunkTGHB5XSTjs.Text,
|
|
259
|
-
{ tag: "span", size: "sm", weight: "bold" },
|
|
334
|
+
{ tag: "span", size: "sm", weight: "bold", class: "text-gray-900 dark:text-gray-100 hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer" },
|
|
260
335
|
{ default: () => _optionalChain([node, 'access', _5 => _5.user, 'optionalAccess', _6 => _6.name]) }
|
|
261
336
|
) : null,
|
|
262
337
|
_optionalChain([node, 'access', _7 => _7.user, 'optionalAccess', _8 => _8.title]) ? _vue.h.call(void 0,
|
|
263
338
|
_chunkTGHB5XSTjs.Text,
|
|
264
|
-
{ tag: "span", size: "xs", color: "muted" },
|
|
339
|
+
{ tag: "span", size: "xs", color: "muted", class: "bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-500 dark:text-gray-400 font-medium" },
|
|
265
340
|
{ default: () => _optionalChain([node, 'access', _9 => _9.user, 'optionalAccess', _10 => _10.title]) }
|
|
266
341
|
) : null,
|
|
267
342
|
node.tag ? _vue.h.call(void 0,
|
|
268
343
|
_chunk2KDSHEZTjs.Tag,
|
|
269
|
-
{ size: "sm", variant: _nullishCoalesce(node.tag.variant, () => ( "default")) },
|
|
344
|
+
{ size: "sm", variant: _nullishCoalesce(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" },
|
|
270
345
|
{ default: () => _optionalChain([node, 'access', _11 => _11.tag, 'optionalAccess', _12 => _12.label]) }
|
|
271
346
|
) : null,
|
|
272
347
|
...(_nullishCoalesce(node.tags, () => ( []))).map(
|
|
@@ -275,36 +350,37 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
275
350
|
{
|
|
276
351
|
key: `${node.id}-tag-${index}`,
|
|
277
352
|
size: "sm",
|
|
278
|
-
variant: _nullishCoalesce(tag.variant, () => ( "default"))
|
|
353
|
+
variant: _nullishCoalesce(tag.variant, () => ( "default")),
|
|
354
|
+
className: "rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide uppercase border border-current bg-opacity-10"
|
|
279
355
|
},
|
|
280
356
|
{ default: () => tag.label }
|
|
281
357
|
)
|
|
282
358
|
),
|
|
283
359
|
node.time ? _vue.h.call(void 0,
|
|
284
360
|
_chunkTGHB5XSTjs.Text,
|
|
285
|
-
{ tag: "span", size: "xs", color: "muted", class: "ml-auto" },
|
|
361
|
+
{ tag: "span", size: "xs", color: "muted", class: "ml-auto text-gray-400 dark:text-gray-500 font-normal" },
|
|
286
362
|
{ default: () => _tigercatcore.formatCommentTime.call(void 0, node.time) }
|
|
287
363
|
) : null
|
|
288
364
|
]),
|
|
289
365
|
_vue.h.call(void 0,
|
|
290
366
|
"div",
|
|
291
367
|
{
|
|
292
|
-
class: "text-sm text-
|
|
368
|
+
class: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed break-words mt-2 mb-3 pr-2"
|
|
293
369
|
},
|
|
294
370
|
String(node.content)
|
|
295
371
|
),
|
|
296
|
-
actions.length > 0 ? _vue.h.call(void 0, "div", { class: "flex flex-wrap items-center gap-1" }, actions) : null,
|
|
372
|
+
actions.length > 0 ? _vue.h.call(void 0, "div", { class: "flex flex-wrap items-center gap-1.5" }, actions) : null,
|
|
297
373
|
replyingTo.value === node.id ? _vue.h.call(void 0,
|
|
298
374
|
"div",
|
|
299
375
|
{
|
|
300
|
-
class: "mt-3 space-y-
|
|
376
|
+
class: "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"
|
|
301
377
|
},
|
|
302
378
|
[
|
|
303
379
|
_vue.h.call(void 0, _chunk6FXYRDYHjs.Textarea, {
|
|
304
|
-
rows:
|
|
380
|
+
rows: 3,
|
|
305
381
|
modelValue: replyValue.value,
|
|
306
382
|
placeholder: props.replyPlaceholder,
|
|
307
|
-
className: "bg-
|
|
383
|
+
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",
|
|
308
384
|
"onUpdate:modelValue": (value) => {
|
|
309
385
|
replyValue.value = value;
|
|
310
386
|
}
|
|
@@ -315,6 +391,7 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
315
391
|
{
|
|
316
392
|
size: "sm",
|
|
317
393
|
variant: "ghost",
|
|
394
|
+
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",
|
|
318
395
|
onClick: () => {
|
|
319
396
|
replyingTo.value = null;
|
|
320
397
|
replyValue.value = "";
|
|
@@ -327,6 +404,7 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
327
404
|
{
|
|
328
405
|
size: "sm",
|
|
329
406
|
variant: "primary",
|
|
407
|
+
className: "px-3 py-1.5 text-xs font-semibold shadow-sm hover:shadow transition-all duration-200 rounded-lg",
|
|
330
408
|
onClick: () => handleReplySubmit(node)
|
|
331
409
|
},
|
|
332
410
|
{ default: () => props.replyButtonText }
|
|
@@ -339,7 +417,7 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
339
417
|
{
|
|
340
418
|
size: "sm",
|
|
341
419
|
variant: "ghost",
|
|
342
|
-
className: _tigercatcore.classNames.call(void 0, "mt-2", PRIMARY_BTN),
|
|
420
|
+
className: _tigercatcore.classNames.call(void 0, "mt-2 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10 transition-colors", PRIMARY_BTN),
|
|
343
421
|
"aria-expanded": isExpanded,
|
|
344
422
|
"aria-controls": repliesId,
|
|
345
423
|
onClick: () => toggleExpanded(node.id)
|
|
@@ -352,7 +430,7 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
352
430
|
"div",
|
|
353
431
|
{
|
|
354
432
|
id: repliesId,
|
|
355
|
-
class: "mt-
|
|
433
|
+
class: "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"
|
|
356
434
|
},
|
|
357
435
|
[
|
|
358
436
|
...visibleChildren.map(
|
|
@@ -379,9 +457,28 @@ var CommentThread = _vue.defineComponent.call(void 0, {
|
|
|
379
457
|
const ariaLabel = _nullishCoalesce(attrs["aria-label"], () => ( (attrs["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B")));
|
|
380
458
|
const children = resolvedNodes.value.length === 0 ? [
|
|
381
459
|
_vue.h.call(void 0,
|
|
382
|
-
|
|
383
|
-
{
|
|
384
|
-
|
|
460
|
+
"div",
|
|
461
|
+
{ class: "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" },
|
|
462
|
+
[
|
|
463
|
+
_vue.h.call(void 0, "svg", {
|
|
464
|
+
class: "w-10 h-10 text-gray-300 dark:text-gray-600 mb-3",
|
|
465
|
+
fill: "none",
|
|
466
|
+
viewBox: "0 0 24 24",
|
|
467
|
+
stroke: "currentColor",
|
|
468
|
+
strokeWidth: "1.5"
|
|
469
|
+
}, [
|
|
470
|
+
_vue.h.call(void 0, "path", {
|
|
471
|
+
strokeLinecap: "round",
|
|
472
|
+
strokeLinejoin: "round",
|
|
473
|
+
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"
|
|
474
|
+
})
|
|
475
|
+
]),
|
|
476
|
+
_vue.h.call(void 0,
|
|
477
|
+
_chunkTGHB5XSTjs.Text,
|
|
478
|
+
{ tag: "div", size: "sm", color: "muted", class: "font-medium" },
|
|
479
|
+
{ default: () => props.emptyText }
|
|
480
|
+
)
|
|
481
|
+
]
|
|
385
482
|
)
|
|
386
483
|
] : resolvedNodes.value.map(
|
|
387
484
|
(node, index) => renderNode(node, 1, index === resolvedNodes.value.length - 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MTYDCYGW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
6
|
} from "./chunk-PYT5DTQQ.mjs";
|
|
@@ -197,7 +197,8 @@ var DataTableWithToolbar = defineComponent({
|
|
|
197
197
|
const bulkLabel = computed(() => props.toolbar?.bulkActionsLabel ?? "\u5DF2\u9009\u62E9");
|
|
198
198
|
const wrapperClasses = computed(
|
|
199
199
|
() => classNames(
|
|
200
|
-
"tiger-data-table-with-toolbar flex flex-col
|
|
200
|
+
"tiger-data-table-with-toolbar flex flex-col",
|
|
201
|
+
props.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",
|
|
201
202
|
props.className,
|
|
202
203
|
coerceClassValue(attrs.class)
|
|
203
204
|
)
|
|
@@ -248,26 +249,49 @@ var DataTableWithToolbar = defineComponent({
|
|
|
248
249
|
leftNodes.push(
|
|
249
250
|
h(
|
|
250
251
|
"div",
|
|
251
|
-
{ class: "flex items-center gap-2 w-full sm:w-auto sm:min-w-[
|
|
252
|
+
{ class: "flex items-center gap-2 w-full sm:w-auto sm:min-w-[220px] sm:max-w-[320px]" },
|
|
252
253
|
[
|
|
253
|
-
h(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
h(
|
|
255
|
+
Input,
|
|
256
|
+
{
|
|
257
|
+
type: "search",
|
|
258
|
+
size: "sm",
|
|
259
|
+
modelValue: searchValue.value,
|
|
260
|
+
placeholder: props.toolbar?.searchPlaceholder ?? "\u641C\u7D22",
|
|
261
|
+
"onUpdate:modelValue": (value) => handleSearchChange(String(value ?? "")),
|
|
262
|
+
onKeydown: (event) => {
|
|
263
|
+
if (event.key === "Enter") {
|
|
264
|
+
handleSearchSubmit();
|
|
265
|
+
}
|
|
262
266
|
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
prefix: () => h(
|
|
270
|
+
"svg",
|
|
271
|
+
{
|
|
272
|
+
class: "w-3.5 h-3.5 text-[var(--tiger-text-secondary,#6b7280)] shrink-0",
|
|
273
|
+
fill: "none",
|
|
274
|
+
stroke: "currentColor",
|
|
275
|
+
"stroke-width": "2",
|
|
276
|
+
viewBox: "0 0 24 24",
|
|
277
|
+
"aria-hidden": "true"
|
|
278
|
+
},
|
|
279
|
+
[
|
|
280
|
+
h("path", {
|
|
281
|
+
"stroke-linecap": "round",
|
|
282
|
+
"stroke-linejoin": "round",
|
|
283
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
)
|
|
263
287
|
}
|
|
264
|
-
|
|
288
|
+
),
|
|
265
289
|
showButton ? h(
|
|
266
290
|
Button,
|
|
267
291
|
{
|
|
268
292
|
size: "sm",
|
|
269
293
|
variant: "primary",
|
|
270
|
-
class: "whitespace-nowrap shrink-0",
|
|
294
|
+
class: "whitespace-nowrap shrink-0 rounded-[var(--tiger-radius-md,0.5rem)] px-3",
|
|
271
295
|
onClick: handleSearchSubmit,
|
|
272
296
|
disabled: !canSearch.value
|
|
273
297
|
},
|
|
@@ -305,9 +329,16 @@ var DataTableWithToolbar = defineComponent({
|
|
|
305
329
|
if (selectedCount.value > 0) {
|
|
306
330
|
bulkChildren.push(
|
|
307
331
|
h(
|
|
308
|
-
"
|
|
309
|
-
{
|
|
310
|
-
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
class: "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"
|
|
335
|
+
},
|
|
336
|
+
[
|
|
337
|
+
h("span", {
|
|
338
|
+
class: "w-1.5 h-1.5 rounded-full bg-[var(--tiger-primary,#2563eb)] animate-pulse"
|
|
339
|
+
}),
|
|
340
|
+
h("span", null, `${bulkLabel.value} ${selectedCount.value} \u9879`)
|
|
341
|
+
]
|
|
311
342
|
)
|
|
312
343
|
);
|
|
313
344
|
}
|
|
@@ -331,15 +362,18 @@ var DataTableWithToolbar = defineComponent({
|
|
|
331
362
|
return h(
|
|
332
363
|
"div",
|
|
333
364
|
{
|
|
334
|
-
class:
|
|
365
|
+
class: classNames(
|
|
366
|
+
"tiger-data-table-toolbar flex flex-wrap items-center gap-3",
|
|
367
|
+
props.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"
|
|
368
|
+
),
|
|
335
369
|
role: "toolbar",
|
|
336
370
|
"aria-label": "\u6570\u636E\u8868\u683C\u5DE5\u5177\u680F"
|
|
337
371
|
},
|
|
338
372
|
[
|
|
339
|
-
h("div", { class: "flex items-center gap-
|
|
373
|
+
h("div", { class: "flex items-center gap-3 flex-wrap flex-1 min-w-0" }, leftNodes),
|
|
340
374
|
hasBulkActions.value ? h(
|
|
341
375
|
"div",
|
|
342
|
-
{ class: "flex items-center gap-2 flex-wrap ml-auto shrink-0" },
|
|
376
|
+
{ class: "flex items-center gap-2.5 flex-wrap ml-auto shrink-0" },
|
|
343
377
|
bulkChildren
|
|
344
378
|
) : null
|
|
345
379
|
]
|
|
@@ -369,6 +403,7 @@ var DataTableWithToolbar = defineComponent({
|
|
|
369
403
|
stickyHeader: props.stickyHeader,
|
|
370
404
|
maxHeight: props.maxHeight,
|
|
371
405
|
tableLayout: props.tableLayout,
|
|
406
|
+
class: props.bordered ? "border-none rounded-none shadow-none" : void 0,
|
|
372
407
|
onSelectionChange: (keys) => emit("selection-change", keys),
|
|
373
408
|
onPageChange: handleTablePageChange
|
|
374
409
|
};
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-VG6E4NX6.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/Table.ts
|
|
2
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
computed as computed2,
|
|
8
|
+
defineComponent,
|
|
9
|
+
h as h6,
|
|
10
|
+
onBeforeUnmount,
|
|
11
|
+
onMounted,
|
|
12
|
+
ref as ref2,
|
|
13
|
+
watch as watch2
|
|
14
|
+
} from "vue";
|
|
3
15
|
import {
|
|
4
16
|
classNames as classNames3,
|
|
5
17
|
createTableResizeObserverController,
|
|
18
|
+
getImmediateTigerLocale,
|
|
6
19
|
getTableWrapperClasses,
|
|
7
20
|
getTableResponsiveTableClasses,
|
|
8
21
|
getTableVirtualRecommendation,
|
|
22
|
+
isLazyTigerLocale,
|
|
23
|
+
mergeTigerLocale,
|
|
24
|
+
resolveTigerLocale,
|
|
9
25
|
tableBaseClasses,
|
|
10
26
|
tableResponsiveCardClasses,
|
|
11
27
|
tableResponsiveCardLabelClasses,
|
|
@@ -1068,6 +1084,10 @@ function renderSummaryRow(ctx, props) {
|
|
|
1068
1084
|
// src/components/Table/render-pagination.ts
|
|
1069
1085
|
import { h as h5 } from "vue";
|
|
1070
1086
|
import {
|
|
1087
|
+
formatIntlNumber,
|
|
1088
|
+
formatPageAriaLabel,
|
|
1089
|
+
formatPaginationTotal,
|
|
1090
|
+
getPaginationLabels,
|
|
1071
1091
|
getSimplePaginationContainerClasses,
|
|
1072
1092
|
getSimplePaginationTotalClasses,
|
|
1073
1093
|
getSimplePaginationControlsClasses,
|
|
@@ -1076,19 +1096,30 @@ import {
|
|
|
1076
1096
|
getSimplePaginationPageIndicatorClasses,
|
|
1077
1097
|
getSimplePaginationButtonsWrapperClasses
|
|
1078
1098
|
} from "@expcat/tigercat-core";
|
|
1079
|
-
|
|
1099
|
+
var DEFAULT_PREV_TEXT = "Previous";
|
|
1100
|
+
var DEFAULT_NEXT_TEXT = "Next";
|
|
1101
|
+
function formatDefaultTotalText(total, range) {
|
|
1102
|
+
return `Showing ${range[0]} to ${range[1]} of ${total} results`;
|
|
1103
|
+
}
|
|
1104
|
+
function formatDefaultPageIndicatorText(current, total) {
|
|
1105
|
+
return `Page ${current} of ${total}`;
|
|
1106
|
+
}
|
|
1107
|
+
function renderPagination(ctx, props, options = {}) {
|
|
1080
1108
|
if (props.pagination === false || !ctx.paginationInfo.value) {
|
|
1081
1109
|
return null;
|
|
1082
1110
|
}
|
|
1083
1111
|
const { totalPages, startIndex, endIndex, hasNext, hasPrev } = ctx.paginationInfo.value;
|
|
1084
1112
|
const paginationConfig = props.pagination;
|
|
1085
1113
|
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.value.length;
|
|
1114
|
+
const locale = options.disableI18n ? void 0 : options.locale;
|
|
1115
|
+
const labels = locale ? getPaginationLabels(locale) : void 0;
|
|
1116
|
+
const localeCode = locale?.locale;
|
|
1117
|
+
const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : labels ? formatPaginationTotal(labels.totalText, total, [startIndex, endIndex], localeCode) : formatDefaultTotalText(total, [startIndex, endIndex]);
|
|
1118
|
+
const finalPrevText = paginationConfig.prevText || labels?.prevPageAriaLabel || DEFAULT_PREV_TEXT;
|
|
1119
|
+
const finalNextText = paginationConfig.nextText || labels?.nextPageAriaLabel || DEFAULT_NEXT_TEXT;
|
|
1120
|
+
const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage.value, totalPages) : labels ? `${formatPageAriaLabel(labels.pageAriaLabel, ctx.currentPage.value, localeCode)} / ${formatIntlNumber(totalPages, localeCode)} ${labels.pageText}` : formatDefaultPageIndicatorText(ctx.currentPage.value, totalPages);
|
|
1086
1121
|
return h5("div", { class: getSimplePaginationContainerClasses() }, [
|
|
1087
|
-
paginationConfig.showTotal !== false && h5(
|
|
1088
|
-
"div",
|
|
1089
|
-
{ class: getSimplePaginationTotalClasses() },
|
|
1090
|
-
paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} results`
|
|
1091
|
-
),
|
|
1122
|
+
paginationConfig.showTotal !== false && h5("div", { class: getSimplePaginationTotalClasses() }, finalTotalText),
|
|
1092
1123
|
h5("div", { class: getSimplePaginationControlsClasses() }, [
|
|
1093
1124
|
paginationConfig.showSizeChanger !== false && h5(
|
|
1094
1125
|
"select",
|
|
@@ -1098,7 +1129,11 @@ function renderPagination(ctx, props) {
|
|
|
1098
1129
|
onChange: (e) => ctx.handlePageSizeChange(Number(e.target.value))
|
|
1099
1130
|
},
|
|
1100
1131
|
(paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map(
|
|
1101
|
-
(size) => h5(
|
|
1132
|
+
(size) => h5(
|
|
1133
|
+
"option",
|
|
1134
|
+
{ value: size },
|
|
1135
|
+
paginationConfig.pageSizeText ? paginationConfig.pageSizeText(size) : labels ? `${formatIntlNumber(size, localeCode)} ${labels.itemsPerPageText}` : `${size} / page`
|
|
1136
|
+
)
|
|
1102
1137
|
)
|
|
1103
1138
|
),
|
|
1104
1139
|
h5("div", { class: getSimplePaginationButtonsWrapperClasses() }, [
|
|
@@ -1109,13 +1144,9 @@ function renderPagination(ctx, props) {
|
|
|
1109
1144
|
disabled: !hasPrev,
|
|
1110
1145
|
onClick: () => ctx.handlePageChange(ctx.currentPage.value - 1)
|
|
1111
1146
|
},
|
|
1112
|
-
|
|
1113
|
-
),
|
|
1114
|
-
h5(
|
|
1115
|
-
"span",
|
|
1116
|
-
{ class: getSimplePaginationPageIndicatorClasses() },
|
|
1117
|
-
`Page ${ctx.currentPage.value} of ${totalPages}`
|
|
1147
|
+
finalPrevText
|
|
1118
1148
|
),
|
|
1149
|
+
h5("span", { class: getSimplePaginationPageIndicatorClasses() }, finalPageIndicatorText),
|
|
1119
1150
|
h5(
|
|
1120
1151
|
"button",
|
|
1121
1152
|
{
|
|
@@ -1123,7 +1154,7 @@ function renderPagination(ctx, props) {
|
|
|
1123
1154
|
disabled: !hasNext,
|
|
1124
1155
|
onClick: () => ctx.handlePageChange(ctx.currentPage.value + 1)
|
|
1125
1156
|
},
|
|
1126
|
-
|
|
1157
|
+
finalNextText
|
|
1127
1158
|
)
|
|
1128
1159
|
])
|
|
1129
1160
|
])
|
|
@@ -1136,11 +1167,44 @@ var Table = defineComponent({
|
|
|
1136
1167
|
props: tableProps,
|
|
1137
1168
|
emits: tableEmits,
|
|
1138
1169
|
setup(props, { emit, slots }) {
|
|
1170
|
+
const config = useTigerConfig();
|
|
1139
1171
|
const wrapperRef = ref2(null);
|
|
1140
1172
|
const tableRef = ref2(null);
|
|
1141
1173
|
const measuredColumnWidths = ref2({});
|
|
1142
1174
|
const measuredRowHeights = ref2([]);
|
|
1143
1175
|
const ctx = useTableState(props, emit, measuredColumnWidths);
|
|
1176
|
+
const resolvedPaginationLocale = ref2();
|
|
1177
|
+
let paginationLocaleResolveId = 0;
|
|
1178
|
+
const paginationLocaleInput = computed2(
|
|
1179
|
+
() => props.pagination !== false && typeof props.pagination === "object" ? props.pagination.locale : void 0
|
|
1180
|
+
);
|
|
1181
|
+
const isPaginationI18nDisabled = computed2(() => paginationLocaleInput.value === false);
|
|
1182
|
+
watch2(
|
|
1183
|
+
paginationLocaleInput,
|
|
1184
|
+
(locale) => {
|
|
1185
|
+
const resolveId = ++paginationLocaleResolveId;
|
|
1186
|
+
if (!locale) {
|
|
1187
|
+
resolvedPaginationLocale.value = void 0;
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
const immediateLocale = getImmediateTigerLocale(locale);
|
|
1191
|
+
resolvedPaginationLocale.value = immediateLocale;
|
|
1192
|
+
if (!isLazyTigerLocale(locale)) return;
|
|
1193
|
+
resolveTigerLocale(locale).then((nextLocale) => {
|
|
1194
|
+
if (resolveId === paginationLocaleResolveId) {
|
|
1195
|
+
resolvedPaginationLocale.value = nextLocale;
|
|
1196
|
+
}
|
|
1197
|
+
}).catch(() => {
|
|
1198
|
+
if (resolveId === paginationLocaleResolveId) {
|
|
1199
|
+
resolvedPaginationLocale.value = immediateLocale;
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
},
|
|
1203
|
+
{ immediate: true }
|
|
1204
|
+
);
|
|
1205
|
+
const paginationLocale = computed2(
|
|
1206
|
+
() => isPaginationI18nDisabled.value ? void 0 : mergeTigerLocale(config.value.locale, resolvedPaginationLocale.value)
|
|
1207
|
+
);
|
|
1144
1208
|
const resizeController = createTableResizeObserverController({
|
|
1145
1209
|
onResize: (snapshot) => {
|
|
1146
1210
|
if (!areNumberRecordsEqual(measuredColumnWidths.value, snapshot.columnWidths)) {
|
|
@@ -1302,7 +1366,10 @@ var Table = defineComponent({
|
|
|
1302
1366
|
},
|
|
1303
1367
|
[LoadingSpinner(), h6("span", { class: "sr-only" }, "Loading")]
|
|
1304
1368
|
),
|
|
1305
|
-
renderPagination(ctx, resolvedProps
|
|
1369
|
+
renderPagination(ctx, resolvedProps, {
|
|
1370
|
+
locale: paginationLocale.value,
|
|
1371
|
+
disableI18n: isPaginationI18nDisabled.value
|
|
1372
|
+
})
|
|
1306
1373
|
]
|
|
1307
1374
|
);
|
|
1308
1375
|
};
|