@rockshin/tao-ui 0.0.60 → 0.1.0
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/README.md +5 -1
- package/component-manifest.json +1 -1
- package/dist/components/affix/affix.css +1 -1
- package/dist/components/affix/affix.d.ts +1 -0
- package/dist/components/affix/affix.js +18 -17
- package/dist/components/alert/alert.css +123 -119
- package/dist/components/alert/alert.js +78 -188
- package/dist/components/app/app-modals.js +49 -98
- package/dist/components/app/app-notices.d.ts +2 -2
- package/dist/components/app/app-notices.js +294 -243
- package/dist/components/app/app-types.d.ts +6 -3
- package/dist/components/app/app.css +185 -183
- package/dist/components/app/app.js +1 -1
- package/dist/components/auto-complete/auto-complete.css +30 -28
- package/dist/components/auto-complete/auto-complete.d.ts +3 -1
- package/dist/components/auto-complete/auto-complete.js +2 -1
- package/dist/components/badge/badge.js +42 -127
- package/dist/components/border-beam/border-beam.css +1 -1
- package/dist/components/border-beam/border-beam.d.ts +1 -0
- package/dist/components/border-beam/border-beam.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.css +123 -120
- package/dist/components/breadcrumb/breadcrumb.js +160 -265
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +52 -151
- package/dist/components/calendar/calendar.js +28 -27
- package/dist/components/card/card-tabs.d.ts +56 -5
- package/dist/components/card/card-tabs.js +214 -468
- package/dist/components/card/card.d.ts +1 -2
- package/dist/components/card/card.js +64 -226
- package/dist/components/carousel/carousel.css +1 -1
- package/dist/components/carousel/carousel.d.ts +59 -4
- package/dist/components/carousel/carousel.js +299 -243
- package/dist/components/cascader/cascader.css +186 -184
- package/dist/components/cascader/cascader.d.ts +3 -1
- package/dist/components/cascader/cascader.js +28 -34
- package/dist/components/checkbox/checkbox.css +93 -90
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +171 -499
- package/dist/components/collapse/collapse-panels.js +145 -400
- package/dist/components/collapse/collapse.css +172 -170
- package/dist/components/collapse/collapse.d.ts +1 -1
- package/dist/components/collapse/collapse.js +62 -181
- package/dist/components/color-picker/color-picker.js +418 -982
- package/dist/components/context-menu/context-menu.css +4 -4
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +52 -138
- package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
- package/dist/components/date-picker/calendar/calendar-header.js +171 -337
- package/dist/components/date-picker/calendar/month-grid.js +33 -103
- package/dist/components/date-picker/calendar/time-panel.js +81 -210
- package/dist/components/date-picker/calendar/year-grid.js +36 -105
- package/dist/components/date-picker/date-localization.js +1 -1
- package/dist/components/date-picker/date-picker.css +599 -642
- package/dist/components/date-picker/date-picker.d.ts +2 -1
- package/dist/components/date-picker/date-picker.js +93 -104
- package/dist/components/date-picker/presets.js +12 -37
- package/dist/components/date-picker/range-picker.d.ts +2 -1
- package/dist/components/date-picker/range-picker.js +217 -252
- package/dist/components/date-picker/types.d.ts +2 -1
- package/dist/components/descriptions/descriptions.css +1 -1
- package/dist/components/descriptions/descriptions.js +30 -39
- package/dist/components/drawer/drawer.css +202 -200
- package/dist/components/drawer/drawer.js +28 -34
- package/dist/components/dropdown/dropdown-core.d.ts +32 -0
- package/dist/components/dropdown/dropdown-core.js +156 -0
- package/dist/components/dropdown/dropdown.css +38 -36
- package/dist/components/dropdown/dropdown.d.ts +4 -31
- package/dist/components/dropdown/dropdown.js +90 -276
- package/dist/components/empty/empty.css +30 -28
- package/dist/components/empty/empty.js +81 -236
- package/dist/components/float-button/float-button.css +1 -1
- package/dist/components/float-button/float-button.js +36 -47
- package/dist/components/form/field-control.js +2 -3
- package/dist/components/form/form-item.js +67 -129
- package/dist/components/form/form.css +36 -34
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.js +29 -100
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/use-form.js +48 -67
- package/dist/components/form-actions/form-actions.d.ts +1 -0
- package/dist/components/form-actions/form-actions.js +10 -36
- package/dist/components/form-field/form-field-view.d.ts +1 -0
- package/dist/components/form-field/form-field-view.js +81 -288
- package/dist/components/form-field/form-field.js +13 -31
- package/dist/components/form-field/form.css +74 -72
- package/dist/components/form-section/form-section.d.ts +1 -0
- package/dist/components/form-section/form-section.js +38 -91
- package/dist/components/image/image-icons.js +16 -31
- package/dist/components/image/image.css +1 -1
- package/dist/components/image/image.js +298 -911
- package/dist/components/input/base-input.d.ts +3 -1
- package/dist/components/input/base-input.js +8 -7
- package/dist/components/input/input-shared.css +62 -60
- package/dist/components/input/input-shared.d.ts +1 -1
- package/dist/components/input/input-shared.js +56 -100
- package/dist/components/input/input.css +222 -220
- package/dist/components/input/otp.d.ts +2 -1
- package/dist/components/input/otp.js +143 -324
- package/dist/components/input/password.js +12 -67
- package/dist/components/input/search.js +13 -13
- package/dist/components/input-number/input-number.d.ts +2 -1
- package/dist/components/input-number/input-number.js +30 -152
- package/dist/components/list/list-pagination.css +107 -105
- package/dist/components/list/list-pagination.d.ts +56 -5
- package/dist/components/list/list-pagination.js +249 -316
- package/dist/components/list/list.css +179 -177
- package/dist/components/list/list.js +170 -604
- package/dist/components/listy/listy.css +55 -53
- package/dist/components/listy/listy.d.ts +43 -4
- package/dist/components/listy/listy.js +198 -216
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.d.ts +1 -0
- package/dist/components/masonry/masonry.js +90 -244
- package/dist/components/mentions/mentions.css +153 -151
- package/dist/components/mentions/mentions.d.ts +53 -11
- package/dist/components/mentions/mentions.js +288 -73
- package/dist/components/menu/menu-render.d.ts +2 -1
- package/dist/components/menu/menu-render.js +149 -307
- package/dist/components/menu/menu.css +142 -140
- package/dist/components/modal/confirm-dialog.js +8 -18
- package/dist/components/modal/modal.css +165 -162
- package/dist/components/modal/modal.js +285 -731
- package/dist/components/modal/use-modal.js +25 -25
- package/dist/components/pagination/pagination.css +134 -131
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/pagination/pagination.js +137 -290
- package/dist/components/popconfirm/popconfirm.css +38 -36
- package/dist/components/popconfirm/popconfirm.js +105 -288
- package/dist/components/popover/popover.css +89 -87
- package/dist/components/popover/popover.js +168 -275
- package/dist/components/progress/progress.css +153 -151
- package/dist/components/progress/progress.js +34 -43
- package/dist/components/qr-code/qr-code.css +36 -34
- package/dist/components/qr-code/qr-code.js +83 -277
- package/dist/components/radio/radio.css +95 -92
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +114 -376
- package/dist/components/rate/rate.css +80 -78
- package/dist/components/rate/rate.d.ts +34 -6
- package/dist/components/rate/rate.js +160 -244
- package/dist/components/result/result.css +59 -57
- package/dist/components/result/result.d.ts +1 -0
- package/dist/components/result/result.js +118 -291
- package/dist/components/scroll-area/scroll-area.css +160 -148
- package/dist/components/scroll-area/scroll-area.js +284 -488
- package/dist/components/segmented/segmented.css +1 -1
- package/dist/components/segmented/segmented.js +59 -58
- package/dist/components/select/mobile-select.css +166 -164
- package/dist/components/select/mobile-select.js +48 -131
- package/dist/components/select/select-icons.js +59 -128
- package/dist/components/select/select-searchable-list.js +19 -19
- package/dist/components/select/select-tags.js +70 -156
- package/dist/components/select/select-types.d.ts +2 -1
- package/dist/components/select/select.css +509 -506
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +67 -65
- package/dist/components/select/use-select-selection.js +181 -269
- package/dist/components/skeleton/skeleton.css +105 -103
- package/dist/components/skeleton/skeleton.js +140 -399
- package/dist/components/slider/slider.css +160 -158
- package/dist/components/slider/slider.d.ts +45 -6
- package/dist/components/slider/slider.js +359 -74
- package/dist/components/sonner/index.d.ts +1 -1
- package/dist/components/sonner/sonner.css +190 -182
- package/dist/components/sonner/sonner.js +12 -11
- package/dist/components/spinner/spinner.css +80 -76
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.js +75 -219
- package/dist/components/splitter/splitter.css +157 -154
- package/dist/components/splitter/splitter.js +271 -448
- package/dist/components/statistic/statistic.css +1 -1
- package/dist/components/statistic/statistic.js +121 -413
- package/dist/components/status-icon/status-icon.js +14 -26
- package/dist/components/steps/steps-icons.js +63 -100
- package/dist/components/steps/steps.css +817 -807
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/steps.js +38 -94
- package/dist/components/steps/use-display-steps.js +21 -54
- package/dist/components/switch/switch-touch.css +17 -15
- package/dist/components/switch/switch.css +192 -190
- package/dist/components/switch/switch.js +63 -196
- package/dist/components/table/table-filter.d.ts +1 -1
- package/dist/components/table/table-filter.js +68 -155
- package/dist/components/table/table-icons.js +77 -152
- package/dist/components/table/table-summary.js +30 -77
- package/dist/components/table/table-types.d.ts +2 -1
- package/dist/components/table/table.css +468 -465
- package/dist/components/table/table.js +85 -84
- package/dist/components/table/use-table-data.js +137 -248
- package/dist/components/tabs/tabs.css +123 -120
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +156 -331
- package/dist/components/tag/tag.css +231 -221
- package/dist/components/tag/tag.js +110 -248
- package/dist/components/textarea/textarea.css +2 -1
- package/dist/components/textarea/textarea.d.ts +3 -1
- package/dist/components/textarea/textarea.js +16 -15
- package/dist/components/time-picker/time-picker.d.ts +1 -0
- package/dist/components/time-picker/time-picker.js +88 -220
- package/dist/components/timeline/timeline.css +1 -1
- package/dist/components/timeline/timeline.js +17 -17
- package/dist/components/tooltip/tooltip.css +79 -77
- package/dist/components/tooltip/tooltip.js +105 -215
- package/dist/components/tour/tour.css +1 -1
- package/dist/components/tour/tour.d.ts +59 -6
- package/dist/components/tour/tour.js +343 -622
- package/dist/components/transfer/transfer-list.js +19 -19
- package/dist/components/transfer/transfer-parts.js +63 -139
- package/dist/components/transfer/transfer.css +192 -190
- package/dist/components/transfer/transfer.js +57 -56
- package/dist/components/tree/tree-check.js +25 -32
- package/dist/components/tree/tree-keyboard.js +1 -1
- package/dist/components/tree/tree.css +204 -200
- package/dist/components/tree/tree.js +139 -277
- package/dist/components/tree-select/select-engine.css +200 -197
- package/dist/components/tree-select/select-engine.js +11 -38
- package/dist/components/tree-select/tree-select.css +21 -19
- package/dist/components/tree-select/tree-select.d.ts +3 -1
- package/dist/components/tree-select/tree-select.js +11 -10
- package/dist/components/upload/upload.js +193 -308
- package/dist/components/watermark/watermark-context.js +8 -14
- package/dist/components/watermark/watermark.css +1 -1
- package/dist/components/watermark/watermark.js +209 -400
- package/dist/docs/components/stack.doc.js +1 -1
- package/dist/docs/components/table.doc.js +1 -1
- package/dist/entries/affix.d.ts +0 -2
- package/dist/entries/affix.js +0 -2
- package/dist/entries/alert.d.ts +0 -2
- package/dist/entries/alert.js +0 -2
- package/dist/entries/app.d.ts +0 -2
- package/dist/entries/app.js +0 -2
- package/dist/entries/auto-complete.d.ts +0 -2
- package/dist/entries/auto-complete.js +0 -2
- package/dist/entries/avatar.d.ts +0 -2
- package/dist/entries/avatar.js +0 -2
- package/dist/entries/badge.d.ts +0 -2
- package/dist/entries/badge.js +0 -2
- package/dist/entries/border-beam.d.ts +0 -2
- package/dist/entries/border-beam.js +0 -2
- package/dist/entries/breadcrumb.d.ts +0 -2
- package/dist/entries/breadcrumb.js +0 -2
- package/dist/entries/button.d.ts +0 -2
- package/dist/entries/button.js +0 -2
- package/dist/entries/calendar.d.ts +0 -2
- package/dist/entries/calendar.js +0 -2
- package/dist/entries/card.d.ts +0 -2
- package/dist/entries/card.js +0 -2
- package/dist/entries/carousel.d.ts +0 -2
- package/dist/entries/carousel.js +0 -2
- package/dist/entries/cascader.d.ts +0 -2
- package/dist/entries/cascader.js +0 -2
- package/dist/entries/checkbox.d.ts +0 -2
- package/dist/entries/checkbox.js +0 -2
- package/dist/entries/collapse.d.ts +0 -2
- package/dist/entries/collapse.js +0 -2
- package/dist/entries/color-picker.d.ts +0 -2
- package/dist/entries/color-picker.js +0 -2
- package/dist/entries/context-menu.d.ts +0 -2
- package/dist/entries/context-menu.js +0 -2
- package/dist/entries/date-picker.d.ts +0 -2
- package/dist/entries/date-picker.js +0 -2
- package/dist/entries/descriptions.d.ts +0 -2
- package/dist/entries/descriptions.js +0 -2
- package/dist/entries/divider.d.ts +0 -2
- package/dist/entries/divider.js +0 -2
- package/dist/entries/drawer.d.ts +0 -2
- package/dist/entries/drawer.js +0 -2
- package/dist/entries/dropdown.d.ts +0 -2
- package/dist/entries/dropdown.js +0 -2
- package/dist/entries/empty.d.ts +0 -2
- package/dist/entries/empty.js +0 -2
- package/dist/entries/float-button.d.ts +0 -2
- package/dist/entries/float-button.js +0 -2
- package/dist/entries/form-actions.d.ts +0 -2
- package/dist/entries/form-actions.js +0 -2
- package/dist/entries/form-field.d.ts +0 -2
- package/dist/entries/form-field.js +0 -2
- package/dist/entries/form-layout.d.ts +0 -2
- package/dist/entries/form-layout.js +0 -2
- package/dist/entries/form-section.d.ts +0 -2
- package/dist/entries/form-section.js +0 -2
- package/dist/entries/form.d.ts +1 -3
- package/dist/entries/form.js +0 -2
- package/dist/entries/image.d.ts +0 -2
- package/dist/entries/image.js +0 -2
- package/dist/entries/input-number.d.ts +0 -2
- package/dist/entries/input-number.js +0 -2
- package/dist/entries/input.d.ts +1 -3
- package/dist/entries/input.js +0 -2
- package/dist/entries/list.d.ts +0 -2
- package/dist/entries/list.js +0 -2
- package/dist/entries/listy.d.ts +0 -2
- package/dist/entries/listy.js +0 -2
- package/dist/entries/masonry.d.ts +0 -2
- package/dist/entries/masonry.js +0 -2
- package/dist/entries/mentions.d.ts +0 -2
- package/dist/entries/mentions.js +0 -2
- package/dist/entries/modal.d.ts +0 -2
- package/dist/entries/modal.js +0 -2
- package/dist/entries/number-input.d.ts +0 -2
- package/dist/entries/number-input.js +0 -2
- package/dist/entries/pagination.d.ts +0 -2
- package/dist/entries/pagination.js +0 -2
- package/dist/entries/popconfirm.d.ts +0 -2
- package/dist/entries/popconfirm.js +0 -2
- package/dist/entries/popover.d.ts +0 -2
- package/dist/entries/popover.js +0 -2
- package/dist/entries/progress.d.ts +0 -2
- package/dist/entries/progress.js +0 -2
- package/dist/entries/provider.d.ts +1 -3
- package/dist/entries/provider.js +1 -3
- package/dist/entries/qr-code.d.ts +0 -2
- package/dist/entries/qr-code.js +0 -2
- package/dist/entries/radio.d.ts +0 -2
- package/dist/entries/radio.js +0 -2
- package/dist/entries/range-picker.d.ts +0 -2
- package/dist/entries/range-picker.js +0 -2
- package/dist/entries/rate.d.ts +0 -2
- package/dist/entries/rate.js +0 -2
- package/dist/entries/result.d.ts +0 -2
- package/dist/entries/result.js +0 -2
- package/dist/entries/scroll-area.d.ts +0 -2
- package/dist/entries/scroll-area.js +0 -2
- package/dist/entries/segmented.d.ts +0 -2
- package/dist/entries/segmented.js +0 -2
- package/dist/entries/select.d.ts +0 -2
- package/dist/entries/select.js +0 -2
- package/dist/entries/skeleton.d.ts +0 -2
- package/dist/entries/skeleton.js +0 -2
- package/dist/entries/slider.d.ts +0 -2
- package/dist/entries/slider.js +0 -2
- package/dist/entries/sonner.d.ts +0 -2
- package/dist/entries/sonner.js +0 -2
- package/dist/entries/spinner.d.ts +0 -2
- package/dist/entries/spinner.js +0 -2
- package/dist/entries/splitter.d.ts +0 -2
- package/dist/entries/splitter.js +0 -2
- package/dist/entries/stack.d.ts +0 -2
- package/dist/entries/stack.js +0 -2
- package/dist/entries/statistic.d.ts +0 -2
- package/dist/entries/statistic.js +0 -2
- package/dist/entries/steps.d.ts +0 -2
- package/dist/entries/steps.js +0 -2
- package/dist/entries/switch.d.ts +0 -2
- package/dist/entries/switch.js +0 -2
- package/dist/entries/table.d.ts +0 -2
- package/dist/entries/table.js +0 -2
- package/dist/entries/tabs.d.ts +0 -2
- package/dist/entries/tabs.js +0 -2
- package/dist/entries/tag.d.ts +0 -2
- package/dist/entries/tag.js +0 -2
- package/dist/entries/textarea.d.ts +0 -2
- package/dist/entries/textarea.js +0 -2
- package/dist/entries/time-picker.d.ts +0 -2
- package/dist/entries/time-picker.js +0 -2
- package/dist/entries/timeline.d.ts +0 -2
- package/dist/entries/timeline.js +0 -2
- package/dist/entries/tooltip.d.ts +0 -2
- package/dist/entries/tooltip.js +0 -2
- package/dist/entries/tour.d.ts +0 -2
- package/dist/entries/tour.js +0 -2
- package/dist/entries/transfer.d.ts +0 -2
- package/dist/entries/transfer.js +0 -2
- package/dist/entries/tree-select.d.ts +0 -2
- package/dist/entries/tree-select.js +0 -2
- package/dist/entries/tree.d.ts +0 -2
- package/dist/entries/tree.js +0 -2
- package/dist/entries/upload.d.ts +0 -2
- package/dist/entries/upload.js +0 -2
- package/dist/entries/watermark.d.ts +0 -2
- package/dist/entries/watermark.js +0 -2
- package/dist/index.d.ts +5 -7
- package/dist/index.js +2 -4
- package/dist/layouts/form-layout/form-layout.d.ts +1 -0
- package/dist/layouts/form-layout/form-layout.js +10 -36
- package/dist/layouts/stack/layout.css +46 -44
- package/dist/layouts/stack/stack.d.ts +1 -0
- package/dist/layouts/stack/stack.js +16 -69
- package/dist/locales/ar-EG.js +25 -2
- package/dist/locales/create-locale.d.ts +1 -2
- package/dist/locales/create-locale.js +0 -28
- package/dist/locales/de-DE.js +25 -2
- package/dist/locales/en-US.js +24 -1
- package/dist/locales/es-ES.js +25 -2
- package/dist/locales/fr-FR.js +25 -2
- package/dist/locales/hi-IN.js +25 -2
- package/dist/locales/id-ID.js +25 -2
- package/dist/locales/index.d.ts +10 -10
- package/dist/locales/index.js +9 -9
- package/dist/locales/it-IT.js +25 -2
- package/dist/locales/ja-JP.js +25 -2
- package/dist/locales/ko-KR.js +25 -2
- package/dist/locales/pt-BR.js +25 -2
- package/dist/locales/ru-RU.js +25 -2
- package/dist/locales/th-TH.js +25 -2
- package/dist/locales/tr-TR.js +25 -2
- package/dist/locales/vi-VN.js +25 -2
- package/dist/locales/zh-CN.js +25 -2
- package/dist/locales/zh-TW.js +25 -2
- package/dist/number-input/number-input.js +24 -81
- package/dist/number-input/use-number-input.js +42 -42
- package/dist/provider/locale.d.ts +1 -1
- package/dist/provider/tao-context.d.ts +38 -0
- package/dist/provider/tao-context.js +92 -0
- package/dist/provider/tao-portal-scope.d.ts +14 -0
- package/dist/provider/tao-portal-scope.js +54 -0
- package/dist/provider/tao-provider.d.ts +5 -55
- package/dist/provider/tao-provider.js +94 -378
- package/dist/theme/control.css +106 -126
- package/dist/theme/theme.css +2 -0
- package/dist/utils/dialog-content.js +55 -210
- package/dist/utils/overlay.js +15 -30
- package/dist/utils/rc-compat.d.ts +13 -0
- package/dist/utils/rc-compat.js +48 -0
- package/dist/utils/refs.js +5 -19
- package/package.json +10 -16
|
@@ -1,328 +1,261 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
5
4
|
import { cx } from "../../utils/semantic.js";
|
|
6
5
|
import { Select } from "../select/select.js";
|
|
7
6
|
import "./list-pagination.css";
|
|
7
|
+
function buildPageList(current, totalPages, showLessItems) {
|
|
8
|
+
const buffer = showLessItems ? 1 : 2;
|
|
9
|
+
if (totalPages <= 3 + 2 * buffer) return Array.from({
|
|
10
|
+
length: totalPages
|
|
11
|
+
}, (_, i)=>i + 1);
|
|
12
|
+
const pages = [
|
|
13
|
+
1
|
|
14
|
+
];
|
|
15
|
+
let left = Math.max(2, current - buffer);
|
|
16
|
+
let right = Math.min(totalPages - 1, current + buffer);
|
|
17
|
+
if (current - 1 <= buffer) right = Math.min(totalPages - 1, 1 + 2 * buffer);
|
|
18
|
+
if (totalPages - current <= buffer) left = Math.max(2, totalPages - 2 * buffer);
|
|
19
|
+
if (left > 2) pages.push('jump-prev');
|
|
20
|
+
for(let p = left; p <= right; p += 1)pages.push(p);
|
|
21
|
+
if (right < totalPages - 1) pages.push('jump-next');
|
|
22
|
+
pages.push(totalPages);
|
|
23
|
+
return pages;
|
|
24
|
+
}
|
|
8
25
|
function ListPaginationControl(props) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className = t5;
|
|
33
|
-
classNames = t6;
|
|
34
|
-
styles = t7;
|
|
35
|
-
style = t8;
|
|
36
|
-
components = t9;
|
|
37
|
-
selectComponentClass = t10;
|
|
38
|
-
showSizeChanger = t11;
|
|
39
|
-
pageSizeOptions = t12;
|
|
40
|
-
itemRender = t13;
|
|
41
|
-
locale = t14;
|
|
42
|
-
sizeChangerRender = t15;
|
|
43
|
-
rest = t16;
|
|
44
|
-
$[0] = props;
|
|
45
|
-
$[1] = className;
|
|
46
|
-
$[2] = classNames;
|
|
47
|
-
$[3] = components;
|
|
48
|
-
$[4] = itemRender;
|
|
49
|
-
$[5] = locale;
|
|
50
|
-
$[6] = pageSizeOptions;
|
|
51
|
-
$[7] = responsive;
|
|
52
|
-
$[8] = rest;
|
|
53
|
-
$[9] = rootClassName;
|
|
54
|
-
$[10] = selectComponentClass;
|
|
55
|
-
$[11] = showSizeChanger;
|
|
56
|
-
$[12] = size;
|
|
57
|
-
$[13] = sizeChangerRender;
|
|
58
|
-
$[14] = style;
|
|
59
|
-
$[15] = styles;
|
|
60
|
-
$[16] = t0;
|
|
61
|
-
} else {
|
|
62
|
-
className = $[1];
|
|
63
|
-
classNames = $[2];
|
|
64
|
-
components = $[3];
|
|
65
|
-
itemRender = $[4];
|
|
66
|
-
locale = $[5];
|
|
67
|
-
pageSizeOptions = $[6];
|
|
68
|
-
responsive = $[7];
|
|
69
|
-
rest = $[8];
|
|
70
|
-
rootClassName = $[9];
|
|
71
|
-
selectComponentClass = $[10];
|
|
72
|
-
showSizeChanger = $[11];
|
|
73
|
-
size = $[12];
|
|
74
|
-
sizeChangerRender = $[13];
|
|
75
|
-
style = $[14];
|
|
76
|
-
styles = $[15];
|
|
77
|
-
t0 = $[16];
|
|
78
|
-
}
|
|
79
|
-
const prefixCls = void 0 === t0 ? "tao-list-pages" : t0;
|
|
80
|
-
const { locale: contextLocale, size: contextSize, disabled } = useTaoConfig();
|
|
81
|
-
let t1;
|
|
82
|
-
if ($[17] !== classNames || $[18] !== props) {
|
|
83
|
-
t1 = "function" == typeof classNames ? classNames({
|
|
84
|
-
props
|
|
85
|
-
}) : classNames;
|
|
86
|
-
$[17] = classNames;
|
|
87
|
-
$[18] = props;
|
|
88
|
-
$[19] = t1;
|
|
89
|
-
} else t1 = $[19];
|
|
90
|
-
const classes = t1;
|
|
91
|
-
let t2;
|
|
92
|
-
if ($[20] !== props || $[21] !== styles) {
|
|
93
|
-
t2 = "function" == typeof styles ? styles({
|
|
94
|
-
props
|
|
95
|
-
}) : styles;
|
|
96
|
-
$[20] = props;
|
|
97
|
-
$[21] = styles;
|
|
98
|
-
$[22] = t2;
|
|
99
|
-
} else t2 = $[22];
|
|
100
|
-
const semanticStyles = t2;
|
|
26
|
+
const { position: _position, size, responsive, prefixCls = 'tao-list-pages', rootClassName, className, classNames, styles, style, components, selectComponentClass, showSizeChanger, pageSizeOptions = [
|
|
27
|
+
10,
|
|
28
|
+
20,
|
|
29
|
+
50,
|
|
30
|
+
100
|
|
31
|
+
], showQuickJumper, showLessItems = false, showTotal, hideOnSinglePage = false, simple = false, itemRender, locale, sizeChangerRender, total = 0, onChange, onShowSizeChange } = props;
|
|
32
|
+
const { locale: contextLocale, size: contextSize, disabled: ctxDisabled } = useTaoConfig();
|
|
33
|
+
const isDisabled = !!(props.disabled ?? ctxDisabled);
|
|
34
|
+
const [innerPageSize, setInnerPageSize] = useState(props.defaultPageSize ?? 10);
|
|
35
|
+
const resolvedPageSize = Math.max(1, void 0 !== props.pageSize ? props.pageSize : innerPageSize);
|
|
36
|
+
const totalPages = Math.max(1, Math.ceil(total / resolvedPageSize));
|
|
37
|
+
const [innerCurrent, setInnerCurrent] = useState(props.defaultCurrent ?? 1);
|
|
38
|
+
const rawCurrent = void 0 !== props.current ? props.current : innerCurrent;
|
|
39
|
+
const current = Math.min(totalPages, Math.max(1, rawCurrent));
|
|
40
|
+
const [jumpText, setJumpText] = useState('');
|
|
41
|
+
const [simpleInput, setSimpleInput] = useState(null);
|
|
42
|
+
if (hideOnSinglePage && totalPages <= 1) return null;
|
|
43
|
+
const classes = 'function' == typeof classNames ? classNames({
|
|
44
|
+
props
|
|
45
|
+
}) : classNames;
|
|
46
|
+
const semanticStyles = 'function' == typeof styles ? styles({
|
|
47
|
+
props
|
|
48
|
+
}) : styles;
|
|
101
49
|
const CustomSelect = components?.sizeChanger ?? selectComponentClass;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const t10 = semanticStyles?.root;
|
|
152
|
-
let t11;
|
|
153
|
-
if ($[40] !== style || $[41] !== t10) {
|
|
154
|
-
t11 = {
|
|
155
|
-
...t10,
|
|
156
|
-
...style
|
|
157
|
-
};
|
|
158
|
-
$[40] = style;
|
|
159
|
-
$[41] = t10;
|
|
160
|
-
$[42] = t11;
|
|
161
|
-
} else t11 = $[42];
|
|
162
|
-
const t12 = classes?.item;
|
|
163
|
-
let t13;
|
|
164
|
-
if ($[43] !== t12) {
|
|
165
|
-
t13 = {
|
|
166
|
-
item: t12
|
|
50
|
+
const selectProps = 'object' == typeof showSizeChanger ? showSizeChanger : {};
|
|
51
|
+
const mergedLocale = {
|
|
52
|
+
items_per_page: contextLocale.messages.itemsPerPage,
|
|
53
|
+
jump_to: contextLocale.messages.jumpTo,
|
|
54
|
+
jump_to_confirm: contextLocale.messages.jumpToConfirm,
|
|
55
|
+
page: contextLocale.messages.pageUnit,
|
|
56
|
+
prev_page: contextLocale.messages.previousPage,
|
|
57
|
+
next_page: contextLocale.messages.nextPage,
|
|
58
|
+
page_size: contextLocale.messages.pageSize,
|
|
59
|
+
prev_5: contextLocale.messages.previousPages,
|
|
60
|
+
next_5: contextLocale.messages.nextPages,
|
|
61
|
+
...locale
|
|
62
|
+
};
|
|
63
|
+
const goToPage = (nextPage, nextSize = resolvedPageSize)=>{
|
|
64
|
+
if (isDisabled) return;
|
|
65
|
+
const maxPages = Math.max(1, Math.ceil(total / nextSize));
|
|
66
|
+
const bounded = Math.min(maxPages, Math.max(1, nextPage));
|
|
67
|
+
if (void 0 === props.current) setInnerCurrent(bounded);
|
|
68
|
+
setSimpleInput(null);
|
|
69
|
+
onChange?.(bounded, nextSize);
|
|
70
|
+
};
|
|
71
|
+
const handleSizeChange = (nextSize)=>{
|
|
72
|
+
if (isDisabled || !Number.isFinite(nextSize) || nextSize < 1) return;
|
|
73
|
+
const maxPages = Math.max(1, Math.ceil(total / nextSize));
|
|
74
|
+
const bounded = Math.min(maxPages, Math.max(1, current));
|
|
75
|
+
if (void 0 === props.pageSize) setInnerPageSize(nextSize);
|
|
76
|
+
if (void 0 === props.current) setInnerCurrent(bounded);
|
|
77
|
+
onShowSizeChange?.(bounded, nextSize);
|
|
78
|
+
onChange?.(bounded, nextSize);
|
|
79
|
+
};
|
|
80
|
+
const renderNavButton = (page, type, disabledButton)=>{
|
|
81
|
+
const defaultEl = /*#__PURE__*/ jsx("button", {
|
|
82
|
+
"data-tao-list-page-button": "",
|
|
83
|
+
type: "button",
|
|
84
|
+
"aria-label": 'page' === type ? contextLocale.messages.page(page) : 'prev' === type ? contextLocale.previous : 'next' === type ? contextLocale.next : 'jump-prev' === type ? contextLocale.messages.previousPages : contextLocale.messages.nextPages,
|
|
85
|
+
"aria-current": 'page' === type && page === current ? 'page' : void 0,
|
|
86
|
+
disabled: disabledButton,
|
|
87
|
+
onClick: ()=>{
|
|
88
|
+
if (!disabledButton) goToPage(page);
|
|
89
|
+
},
|
|
90
|
+
children: 'page' === type ? page : 'prev' === type ? '‹' : 'next' === type ? '›' : '…'
|
|
91
|
+
});
|
|
92
|
+
return itemRender ? itemRender(page, type, defaultEl) : defaultEl;
|
|
93
|
+
};
|
|
94
|
+
const parsedSizeOptions = pageSizeOptions.map((opt)=>{
|
|
95
|
+
const num = Number(opt);
|
|
96
|
+
return {
|
|
97
|
+
value: num,
|
|
98
|
+
label: `${num} ${mergedLocale.items_per_page}`
|
|
167
99
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
100
|
+
});
|
|
101
|
+
const shouldShowSizeChanger = void 0 === showSizeChanger ? total > 50 : 'object' == typeof showSizeChanger ? true : showSizeChanger;
|
|
102
|
+
const commitQuickJump = ()=>{
|
|
103
|
+
const parsed = Number.parseInt(jumpText.trim(), 10);
|
|
104
|
+
setJumpText('');
|
|
105
|
+
if (!Number.isNaN(parsed)) goToPage(parsed);
|
|
106
|
+
};
|
|
107
|
+
const handleQuickJumpKey = (event)=>{
|
|
108
|
+
if ('Enter' === event.key) commitQuickJump();
|
|
109
|
+
};
|
|
110
|
+
const isSimpleReadOnly = 'object' == typeof simple && !!simple.readOnly;
|
|
111
|
+
const rangeStart = 0 === total ? 0 : (current - 1) * resolvedPageSize + 1;
|
|
112
|
+
const rangeEnd = Math.min(total, current * resolvedPageSize);
|
|
113
|
+
const jumpStep = showLessItems ? 3 : 5;
|
|
114
|
+
const prevDisabled = isDisabled || current <= 1;
|
|
115
|
+
const nextDisabled = isDisabled || current >= totalPages;
|
|
116
|
+
const renderSizeChanger = ()=>{
|
|
117
|
+
if (!shouldShowSizeChanger) return null;
|
|
118
|
+
const info = {
|
|
119
|
+
disabled: isDisabled,
|
|
120
|
+
size: resolvedPageSize,
|
|
121
|
+
quickGo: goToPage,
|
|
122
|
+
onSizeChange: handleSizeChange,
|
|
123
|
+
changeSize: handleSizeChange,
|
|
124
|
+
current,
|
|
125
|
+
pageSize: resolvedPageSize,
|
|
126
|
+
options: parsedSizeOptions,
|
|
127
|
+
className: `${prefixCls}-options-size-changer`,
|
|
128
|
+
'aria-label': mergedLocale.page_size
|
|
176
129
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
$[47] = pageSizeOptions;
|
|
184
|
-
$[48] = t16;
|
|
185
|
-
} else t16 = $[48];
|
|
186
|
-
const t17 = "object" == typeof showSizeChanger ? true : showSizeChanger;
|
|
187
|
-
let t18;
|
|
188
|
-
let t19;
|
|
189
|
-
let t20;
|
|
190
|
-
let t21;
|
|
191
|
-
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
|
-
t18 = /*#__PURE__*/ jsx("span", {
|
|
193
|
-
"aria-hidden": "true",
|
|
194
|
-
children: "‹"
|
|
195
|
-
});
|
|
196
|
-
t19 = /*#__PURE__*/ jsx("span", {
|
|
197
|
-
"aria-hidden": "true",
|
|
198
|
-
children: "›"
|
|
199
|
-
});
|
|
200
|
-
t20 = /*#__PURE__*/ jsx("span", {
|
|
201
|
-
"aria-hidden": "true",
|
|
202
|
-
children: "…"
|
|
130
|
+
if (sizeChangerRender) return sizeChangerRender(info);
|
|
131
|
+
if (CustomSelect) return /*#__PURE__*/ jsx(CustomSelect, {
|
|
132
|
+
value: info.size,
|
|
133
|
+
onChange: info.onSizeChange,
|
|
134
|
+
disabled: info.disabled,
|
|
135
|
+
className: info.className
|
|
203
136
|
});
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
137
|
+
return /*#__PURE__*/ jsx(Select, {
|
|
138
|
+
...selectProps,
|
|
139
|
+
value: String(info.size),
|
|
140
|
+
onChange: (value, option)=>{
|
|
141
|
+
info.onSizeChange(Number(value));
|
|
142
|
+
selectProps.onChange?.(value, option);
|
|
143
|
+
},
|
|
144
|
+
options: info.options.map((option)=>({
|
|
145
|
+
...option,
|
|
146
|
+
value: String(option.value)
|
|
147
|
+
})),
|
|
148
|
+
disabled: info.disabled,
|
|
149
|
+
size: 'default' === size ? 'medium' : size ?? contextSize,
|
|
150
|
+
"aria-label": info['aria-label'],
|
|
151
|
+
style: {
|
|
152
|
+
minWidth: 100,
|
|
153
|
+
...selectProps.style
|
|
154
|
+
}
|
|
207
155
|
});
|
|
208
|
-
$[49] = t18;
|
|
209
|
-
$[50] = t19;
|
|
210
|
-
$[51] = t20;
|
|
211
|
-
$[52] = t21;
|
|
212
|
-
} else {
|
|
213
|
-
t18 = $[49];
|
|
214
|
-
t19 = $[50];
|
|
215
|
-
t20 = $[51];
|
|
216
|
-
t21 = $[52];
|
|
217
|
-
}
|
|
218
|
-
let t22;
|
|
219
|
-
if ($[53] !== contextLocale.messages || $[54] !== contextLocale.next || $[55] !== contextLocale.previous || $[56] !== current || $[57] !== disabled || $[58] !== itemRender || $[59] !== props.disabled || $[60] !== props.simple || $[61] !== totalPages) {
|
|
220
|
-
t22 = itemRender ?? ((page, type)=>/*#__PURE__*/ jsx("button", {
|
|
221
|
-
ref: "next" === type && props.simple && 1 === current ? _temp : void 0,
|
|
222
|
-
"data-tao-list-page-button": "",
|
|
223
|
-
type: "button",
|
|
224
|
-
"aria-label": "page" === type ? contextLocale.messages.page(page) : "prev" === type ? contextLocale.previous : "next" === type ? contextLocale.next : "jump-prev" === type ? contextLocale.messages.previousPages : contextLocale.messages.nextPages,
|
|
225
|
-
"aria-current": "page" === type && page === current ? "page" : void 0,
|
|
226
|
-
disabled: !!(props.disabled ?? disabled) || page < 1 || page > totalPages,
|
|
227
|
-
children: "page" === type ? page : "prev" === type ? "\u2039" : "next" === type ? "\u203A" : "\u2026"
|
|
228
|
-
}));
|
|
229
|
-
$[53] = contextLocale.messages;
|
|
230
|
-
$[54] = contextLocale.next;
|
|
231
|
-
$[55] = contextLocale.previous;
|
|
232
|
-
$[56] = current;
|
|
233
|
-
$[57] = disabled;
|
|
234
|
-
$[58] = itemRender;
|
|
235
|
-
$[59] = props.disabled;
|
|
236
|
-
$[60] = props.simple;
|
|
237
|
-
$[61] = totalPages;
|
|
238
|
-
$[62] = t22;
|
|
239
|
-
} else t22 = $[62];
|
|
240
|
-
let t23;
|
|
241
|
-
if ($[63] !== CustomSelect || $[64] !== contextSize || $[65] !== selectProps || $[66] !== size || $[67] !== sizeChangerRender) {
|
|
242
|
-
t23 = sizeChangerRender ?? ((info)=>CustomSelect ? /*#__PURE__*/ jsx(CustomSelect, {
|
|
243
|
-
value: info.size,
|
|
244
|
-
onChange: info.onSizeChange,
|
|
245
|
-
disabled: info.disabled,
|
|
246
|
-
className: info.className
|
|
247
|
-
}) : /*#__PURE__*/ jsx(Select, {
|
|
248
|
-
...selectProps,
|
|
249
|
-
value: String(info.size),
|
|
250
|
-
onChange: (value, option)=>{
|
|
251
|
-
info.onSizeChange(Number(value));
|
|
252
|
-
selectProps.onChange?.(value, option);
|
|
253
|
-
},
|
|
254
|
-
options: info.options.map(_temp2),
|
|
255
|
-
disabled: info.disabled,
|
|
256
|
-
size: "default" === size ? "medium" : size ?? contextSize,
|
|
257
|
-
"aria-label": info["aria-label"],
|
|
258
|
-
style: {
|
|
259
|
-
minWidth: 100,
|
|
260
|
-
...selectProps.style
|
|
261
|
-
}
|
|
262
|
-
}));
|
|
263
|
-
$[63] = CustomSelect;
|
|
264
|
-
$[64] = contextSize;
|
|
265
|
-
$[65] = selectProps;
|
|
266
|
-
$[66] = size;
|
|
267
|
-
$[67] = sizeChangerRender;
|
|
268
|
-
$[68] = t23;
|
|
269
|
-
} else t23 = $[68];
|
|
270
|
-
let t24;
|
|
271
|
-
if ($[69] !== prefixCls || $[70] !== rest || $[71] !== t11 || $[72] !== t13 || $[73] !== t15 || $[74] !== t16 || $[75] !== t17 || $[76] !== t22 || $[77] !== t23 || $[78] !== t6 || $[79] !== t7 || $[80] !== t9) {
|
|
272
|
-
t24 = /*#__PURE__*/ jsx(pagination, {
|
|
273
|
-
...rest,
|
|
274
|
-
prefixCls: prefixCls,
|
|
275
|
-
disabled: t6,
|
|
276
|
-
locale: t7,
|
|
277
|
-
className: t9,
|
|
278
|
-
style: t11,
|
|
279
|
-
classNames: t13,
|
|
280
|
-
styles: t15,
|
|
281
|
-
pageSizeOptions: t16,
|
|
282
|
-
showSizeChanger: t17,
|
|
283
|
-
prevIcon: t18,
|
|
284
|
-
nextIcon: t19,
|
|
285
|
-
jumpPrevIcon: t20,
|
|
286
|
-
jumpNextIcon: t21,
|
|
287
|
-
itemRender: t22,
|
|
288
|
-
sizeChangerRender: t23
|
|
289
|
-
});
|
|
290
|
-
$[69] = prefixCls;
|
|
291
|
-
$[70] = rest;
|
|
292
|
-
$[71] = t11;
|
|
293
|
-
$[72] = t13;
|
|
294
|
-
$[73] = t15;
|
|
295
|
-
$[74] = t16;
|
|
296
|
-
$[75] = t17;
|
|
297
|
-
$[76] = t22;
|
|
298
|
-
$[77] = t23;
|
|
299
|
-
$[78] = t6;
|
|
300
|
-
$[79] = t7;
|
|
301
|
-
$[80] = t9;
|
|
302
|
-
$[81] = t24;
|
|
303
|
-
} else t24 = $[81];
|
|
304
|
-
let t25;
|
|
305
|
-
if ($[82] !== t24 || $[83] !== t4 || $[84] !== t5) {
|
|
306
|
-
t25 = /*#__PURE__*/ jsx("div", {
|
|
307
|
-
"data-tao-list-pages": "",
|
|
308
|
-
"data-tao-size": t4,
|
|
309
|
-
"data-tao-responsive": t5,
|
|
310
|
-
children: t24
|
|
311
|
-
});
|
|
312
|
-
$[82] = t24;
|
|
313
|
-
$[83] = t4;
|
|
314
|
-
$[84] = t5;
|
|
315
|
-
$[85] = t25;
|
|
316
|
-
} else t25 = $[85];
|
|
317
|
-
return t25;
|
|
318
|
-
}
|
|
319
|
-
function _temp2(option_0) {
|
|
320
|
-
return {
|
|
321
|
-
...option_0,
|
|
322
|
-
value: String(option_0.value)
|
|
323
156
|
};
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
157
|
+
return /*#__PURE__*/ jsx("div", {
|
|
158
|
+
"data-tao-list-pages": "",
|
|
159
|
+
"data-tao-size": 'default' === size ? 'medium' : size ?? contextSize,
|
|
160
|
+
"data-tao-responsive": responsive ? '' : void 0,
|
|
161
|
+
children: /*#__PURE__*/ jsxs("ul", {
|
|
162
|
+
className: cx(prefixCls, simple && `${prefixCls}-simple`, isDisabled && `${prefixCls}-disabled`, classes?.root, rootClassName, className),
|
|
163
|
+
style: {
|
|
164
|
+
...semanticStyles?.root,
|
|
165
|
+
...style
|
|
166
|
+
},
|
|
167
|
+
children: [
|
|
168
|
+
showTotal && /*#__PURE__*/ jsx("li", {
|
|
169
|
+
className: `${prefixCls}-total-text`,
|
|
170
|
+
children: showTotal(total, [
|
|
171
|
+
rangeStart,
|
|
172
|
+
rangeEnd
|
|
173
|
+
])
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ jsx("li", {
|
|
176
|
+
className: cx(`${prefixCls}-prev`, prevDisabled && `${prefixCls}-disabled`),
|
|
177
|
+
"aria-disabled": prevDisabled,
|
|
178
|
+
children: renderNavButton(Math.max(1, current - 1), 'prev', prevDisabled)
|
|
179
|
+
}),
|
|
180
|
+
simple ? /*#__PURE__*/ jsxs("li", {
|
|
181
|
+
className: `${prefixCls}-simple-pager`,
|
|
182
|
+
children: [
|
|
183
|
+
isSimpleReadOnly ? /*#__PURE__*/ jsx("span", {
|
|
184
|
+
children: current
|
|
185
|
+
}) : /*#__PURE__*/ jsx("input", {
|
|
186
|
+
type: "text",
|
|
187
|
+
"aria-label": mergedLocale.page,
|
|
188
|
+
disabled: isDisabled,
|
|
189
|
+
value: simpleInput ?? String(current),
|
|
190
|
+
onChange: (event)=>setSimpleInput(event.target.value),
|
|
191
|
+
onKeyDown: (event)=>{
|
|
192
|
+
if ('Enter' === event.key) {
|
|
193
|
+
const parsed = Number.parseInt((simpleInput ?? '').trim(), 10);
|
|
194
|
+
if (Number.isNaN(parsed)) setSimpleInput(null);
|
|
195
|
+
else goToPage(parsed);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
onBlur: ()=>setSimpleInput(null)
|
|
199
|
+
}),
|
|
200
|
+
/*#__PURE__*/ jsx("span", {
|
|
201
|
+
className: `${prefixCls}-slash`,
|
|
202
|
+
children: "/"
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ jsx("span", {
|
|
205
|
+
children: totalPages
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
}) : buildPageList(current, totalPages, showLessItems).map((entry)=>{
|
|
209
|
+
if ('jump-prev' === entry || 'jump-next' === entry) {
|
|
210
|
+
const target = 'jump-prev' === entry ? Math.max(1, current - jumpStep) : Math.min(totalPages, current + jumpStep);
|
|
211
|
+
return /*#__PURE__*/ jsx("li", {
|
|
212
|
+
className: cx(`${prefixCls}-${entry}`, classes?.item),
|
|
213
|
+
style: semanticStyles?.item,
|
|
214
|
+
children: renderNavButton(target, entry, isDisabled)
|
|
215
|
+
}, entry);
|
|
216
|
+
}
|
|
217
|
+
const active = entry === current;
|
|
218
|
+
return /*#__PURE__*/ jsx("li", {
|
|
219
|
+
className: cx(`${prefixCls}-item`, `${prefixCls}-item-${entry}`, active && `${prefixCls}-item-active`, classes?.item),
|
|
220
|
+
style: semanticStyles?.item,
|
|
221
|
+
children: renderNavButton(entry, 'page', isDisabled)
|
|
222
|
+
}, entry);
|
|
223
|
+
}),
|
|
224
|
+
/*#__PURE__*/ jsx("li", {
|
|
225
|
+
className: cx(`${prefixCls}-next`, nextDisabled && `${prefixCls}-disabled`),
|
|
226
|
+
"aria-disabled": nextDisabled,
|
|
227
|
+
children: renderNavButton(Math.min(totalPages, current + 1), 'next', nextDisabled)
|
|
228
|
+
}),
|
|
229
|
+
(shouldShowSizeChanger || showQuickJumper) && /*#__PURE__*/ jsxs("li", {
|
|
230
|
+
className: `${prefixCls}-options`,
|
|
231
|
+
children: [
|
|
232
|
+
renderSizeChanger(),
|
|
233
|
+
showQuickJumper && /*#__PURE__*/ jsxs("div", {
|
|
234
|
+
className: `${prefixCls}-options-quick-jumper`,
|
|
235
|
+
children: [
|
|
236
|
+
mergedLocale.jump_to,
|
|
237
|
+
/*#__PURE__*/ jsx("input", {
|
|
238
|
+
type: "text",
|
|
239
|
+
disabled: isDisabled,
|
|
240
|
+
value: jumpText,
|
|
241
|
+
onChange: (event)=>setJumpText(event.target.value),
|
|
242
|
+
onKeyUp: handleQuickJumpKey,
|
|
243
|
+
onBlur: commitQuickJump
|
|
244
|
+
}),
|
|
245
|
+
mergedLocale.page,
|
|
246
|
+
'object' == typeof showQuickJumper && showQuickJumper.goButton && /*#__PURE__*/ jsx("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
className: `${prefixCls}-options-quick-jumper-button`,
|
|
249
|
+
disabled: isDisabled,
|
|
250
|
+
onClick: commitQuickJump,
|
|
251
|
+
children: true === showQuickJumper.goButton ? mergedLocale.jump_to_confirm : showQuickJumper.goButton
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
})
|
|
255
|
+
]
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
})
|
|
259
|
+
});
|
|
327
260
|
}
|
|
328
261
|
export { ListPaginationControl };
|