@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,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
2
|
+
import { useCallback, useMemo, 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 "./pagination.css";
|
|
@@ -22,69 +21,45 @@ function computePages(current, totalPages) {
|
|
|
22
21
|
return items;
|
|
23
22
|
}
|
|
24
23
|
function ChevronLeft() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
strokeLinejoin: "round"
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
$[0] = t0;
|
|
44
|
-
} else t0 = $[0];
|
|
45
|
-
return t0;
|
|
24
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
25
|
+
width: "16",
|
|
26
|
+
height: "16",
|
|
27
|
+
viewBox: "0 0 16 16",
|
|
28
|
+
fill: "none",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
focusable: "false",
|
|
31
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
32
|
+
d: "M10 12L6 8l4-4",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "1.5",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round"
|
|
37
|
+
})
|
|
38
|
+
});
|
|
46
39
|
}
|
|
47
40
|
function ChevronRight() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
strokeLinejoin: "round"
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
$[0] = t0;
|
|
67
|
-
} else t0 = $[0];
|
|
68
|
-
return t0;
|
|
41
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
42
|
+
width: "16",
|
|
43
|
+
height: "16",
|
|
44
|
+
viewBox: "0 0 16 16",
|
|
45
|
+
fill: "none",
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
focusable: "false",
|
|
48
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
49
|
+
d: "M6 4l4 4-4 4",
|
|
50
|
+
stroke: "currentColor",
|
|
51
|
+
strokeWidth: "1.5",
|
|
52
|
+
strokeLinecap: "round",
|
|
53
|
+
strokeLinejoin: "round"
|
|
54
|
+
})
|
|
55
|
+
});
|
|
69
56
|
}
|
|
70
|
-
function Pagination(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let t5;
|
|
77
|
-
if ($[0] !== t4) {
|
|
78
|
-
t5 = void 0 === t4 ? [
|
|
79
|
-
10,
|
|
80
|
-
20,
|
|
81
|
-
50,
|
|
82
|
-
100
|
|
83
|
-
] : t4;
|
|
84
|
-
$[0] = t4;
|
|
85
|
-
$[1] = t5;
|
|
86
|
-
} else t5 = $[1];
|
|
87
|
-
const pageSizeOptions = t5;
|
|
57
|
+
function Pagination({ current: currentProp, defaultCurrent = 1, pageSize: pageSizeProp, defaultPageSize = 10, total, onChange, showSizeChanger = false, pageSizeOptions = [
|
|
58
|
+
10,
|
|
59
|
+
20,
|
|
60
|
+
50,
|
|
61
|
+
100
|
|
62
|
+
], showTotal, size, disabled, className, style, classNames, styles }) {
|
|
88
63
|
const ctx = useTaoConfig();
|
|
89
64
|
const resolvedSize = size ?? ctx.size;
|
|
90
65
|
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
@@ -94,242 +69,114 @@ function Pagination(t0) {
|
|
|
94
69
|
const isPageSizeControlled = void 0 !== pageSizeProp;
|
|
95
70
|
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
96
71
|
const pageSize = isPageSizeControlled ? pageSizeProp : internalPageSize;
|
|
97
|
-
if (!Number.isSafeInteger(total) || total < 0) throw new RangeError(
|
|
98
|
-
if (!Number.isSafeInteger(current)) throw new RangeError(
|
|
99
|
-
if (!isValidPageSize(pageSize)) throw new RangeError(
|
|
100
|
-
if (showSizeChanger && !pageSizeOptions.every(isValidPageSize)) throw new RangeError(
|
|
72
|
+
if (!Number.isSafeInteger(total) || total < 0) throw new RangeError('Pagination total must be a non-negative safe integer');
|
|
73
|
+
if (!Number.isSafeInteger(current)) throw new RangeError('Pagination current page must be a safe integer');
|
|
74
|
+
if (!isValidPageSize(pageSize)) throw new RangeError('Pagination pageSize must be a positive integer');
|
|
75
|
+
if (showSizeChanger && !pageSizeOptions.every(isValidPageSize)) throw new RangeError('Pagination pageSizeOptions must contain positive integers');
|
|
101
76
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
102
77
|
const boundedCurrent = Math.min(Math.max(1, internalCurrent), totalPages);
|
|
103
78
|
if (!isCurrentControlled && boundedCurrent !== internalCurrent) setInternalCurrent(boundedCurrent);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
$[6] = isCurrentControlled;
|
|
125
|
-
$[7] = isPageSizeControlled;
|
|
126
|
-
$[8] = onChange;
|
|
127
|
-
$[9] = pageSize;
|
|
128
|
-
$[10] = total;
|
|
129
|
-
$[11] = t7;
|
|
130
|
-
} else t7 = $[11];
|
|
131
|
-
const goTo = t7;
|
|
79
|
+
const pages = useMemo(()=>computePages(current, totalPages), [
|
|
80
|
+
current,
|
|
81
|
+
totalPages
|
|
82
|
+
]);
|
|
83
|
+
const goTo = useCallback((page, newPageSize)=>{
|
|
84
|
+
const ps = newPageSize ?? pageSize;
|
|
85
|
+
const maxPage = Math.max(1, Math.ceil(total / ps));
|
|
86
|
+
const safePage = Math.min(Math.max(1, page), maxPage);
|
|
87
|
+
if (safePage === current && ps === pageSize) return;
|
|
88
|
+
if (!isCurrentControlled) setInternalCurrent(safePage);
|
|
89
|
+
if (null != newPageSize && !isPageSizeControlled) setInternalPageSize(newPageSize);
|
|
90
|
+
onChange?.(safePage, ps);
|
|
91
|
+
}, [
|
|
92
|
+
current,
|
|
93
|
+
pageSize,
|
|
94
|
+
total,
|
|
95
|
+
isCurrentControlled,
|
|
96
|
+
isPageSizeControlled,
|
|
97
|
+
onChange
|
|
98
|
+
]);
|
|
132
99
|
const rangeStart = (current - 1) * pageSize + 1;
|
|
133
100
|
const rangeEnd = Math.min(current * pageSize, total);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
$[14] = t11;
|
|
143
|
-
} else t11 = $[14];
|
|
144
|
-
const t12 = styles?.root;
|
|
145
|
-
let t13;
|
|
146
|
-
if ($[15] !== style || $[16] !== t12) {
|
|
147
|
-
t13 = {
|
|
148
|
-
...t12,
|
|
101
|
+
return /*#__PURE__*/ jsxs("nav", {
|
|
102
|
+
"data-tao-pagination": "",
|
|
103
|
+
"data-tao-size": resolvedSize,
|
|
104
|
+
"data-tao-disabled": resolvedDisabled || void 0,
|
|
105
|
+
"aria-label": ctx.locale.messages.pagination,
|
|
106
|
+
className: cx(classNames?.root, className),
|
|
107
|
+
style: {
|
|
108
|
+
...styles?.root,
|
|
149
109
|
...style
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
0,
|
|
166
|
-
0
|
|
167
|
-
])
|
|
168
|
-
});
|
|
169
|
-
$[18] = classNames?.total;
|
|
170
|
-
$[19] = current;
|
|
171
|
-
$[20] = rangeEnd;
|
|
172
|
-
$[21] = rangeStart;
|
|
173
|
-
$[22] = showTotal;
|
|
174
|
-
$[23] = styles?.total;
|
|
175
|
-
$[24] = total;
|
|
176
|
-
$[25] = t14;
|
|
177
|
-
} else t14 = $[25];
|
|
178
|
-
const t15 = resolvedDisabled || current <= 1;
|
|
179
|
-
let t16;
|
|
180
|
-
if ($[26] !== current || $[27] !== goTo) {
|
|
181
|
-
t16 = ()=>goTo(current - 1);
|
|
182
|
-
$[26] = current;
|
|
183
|
-
$[27] = goTo;
|
|
184
|
-
$[28] = t16;
|
|
185
|
-
} else t16 = $[28];
|
|
186
|
-
const t17 = classNames?.item;
|
|
187
|
-
const t18 = styles?.item;
|
|
188
|
-
let t19;
|
|
189
|
-
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
190
|
-
t19 = /*#__PURE__*/ jsx(ChevronLeft, {});
|
|
191
|
-
$[29] = t19;
|
|
192
|
-
} else t19 = $[29];
|
|
193
|
-
let t20;
|
|
194
|
-
if ($[30] !== ctx.locale.messages.previousPage || $[31] !== t15 || $[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
|
|
195
|
-
t20 = /*#__PURE__*/ jsx("button", {
|
|
196
|
-
type: "button",
|
|
197
|
-
"data-tao-pagination-btn": "",
|
|
198
|
-
disabled: t15,
|
|
199
|
-
"aria-label": ctx.locale.messages.previousPage,
|
|
200
|
-
onClick: t16,
|
|
201
|
-
className: t17,
|
|
202
|
-
style: t18,
|
|
203
|
-
children: t19
|
|
204
|
-
});
|
|
205
|
-
$[30] = ctx.locale.messages.previousPage;
|
|
206
|
-
$[31] = t15;
|
|
207
|
-
$[32] = t16;
|
|
208
|
-
$[33] = t17;
|
|
209
|
-
$[34] = t18;
|
|
210
|
-
$[35] = t20;
|
|
211
|
-
} else t20 = $[35];
|
|
212
|
-
let t21;
|
|
213
|
-
if ($[36] !== classNames?.item || $[37] !== ctx.locale.messages || $[38] !== current || $[39] !== goTo || $[40] !== pages || $[41] !== resolvedDisabled || $[42] !== styles?.item) {
|
|
214
|
-
t21 = pages.map((item, i)=>"ellipsis" === item ? /*#__PURE__*/ jsx("span", {
|
|
215
|
-
"data-tao-pagination-ellipsis": "",
|
|
216
|
-
children: "\xb7\xb7\xb7"
|
|
217
|
-
}, `ellipsis-${pages[i - 1]}-${pages[i + 1]}`) : /*#__PURE__*/ jsx("button", {
|
|
110
|
+
},
|
|
111
|
+
children: [
|
|
112
|
+
showTotal && /*#__PURE__*/ jsx("span", {
|
|
113
|
+
"data-tao-pagination-total": "",
|
|
114
|
+
className: classNames?.total,
|
|
115
|
+
style: styles?.total,
|
|
116
|
+
children: showTotal(total, current >= 1 && rangeStart <= rangeEnd ? [
|
|
117
|
+
rangeStart,
|
|
118
|
+
rangeEnd
|
|
119
|
+
] : [
|
|
120
|
+
0,
|
|
121
|
+
0
|
|
122
|
+
])
|
|
123
|
+
}),
|
|
124
|
+
/*#__PURE__*/ jsx("button", {
|
|
218
125
|
type: "button",
|
|
219
126
|
"data-tao-pagination-btn": "",
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"aria-current": item === current ? "page" : void 0,
|
|
224
|
-
onClick: ()=>goTo(item),
|
|
127
|
+
disabled: resolvedDisabled || current <= 1,
|
|
128
|
+
"aria-label": ctx.locale.messages.previousPage,
|
|
129
|
+
onClick: ()=>goTo(current - 1),
|
|
225
130
|
className: classNames?.item,
|
|
226
131
|
style: styles?.item,
|
|
227
|
-
children:
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
style: {
|
|
277
|
-
width: "auto"
|
|
278
|
-
},
|
|
279
|
-
options: (pageSizeOptions.includes(pageSize) ? pageSizeOptions : [
|
|
280
|
-
...pageSizeOptions,
|
|
281
|
-
pageSize
|
|
282
|
-
]).map((opt)=>({
|
|
283
|
-
label: `${opt} ${ctx.locale.messages.itemsPerPage}`,
|
|
284
|
-
value: String(opt)
|
|
285
|
-
})),
|
|
286
|
-
value: String(pageSize),
|
|
287
|
-
onChange: (val)=>{
|
|
288
|
-
const newSize = Number(val);
|
|
289
|
-
goTo(1, newSize);
|
|
290
|
-
},
|
|
291
|
-
disabled: resolvedDisabled,
|
|
292
|
-
size: "large" === resolvedSize ? "medium" : resolvedSize
|
|
293
|
-
});
|
|
294
|
-
$[54] = ctx.locale.messages.itemsPerPage;
|
|
295
|
-
$[55] = ctx.locale.messages.pageSize;
|
|
296
|
-
$[56] = goTo;
|
|
297
|
-
$[57] = pageSize;
|
|
298
|
-
$[58] = pageSizeOptions;
|
|
299
|
-
$[59] = resolvedDisabled;
|
|
300
|
-
$[60] = resolvedSize;
|
|
301
|
-
$[61] = showSizeChanger;
|
|
302
|
-
$[62] = t28;
|
|
303
|
-
} else t28 = $[62];
|
|
304
|
-
let t29;
|
|
305
|
-
if ($[63] !== ctx.locale.messages.pagination || $[64] !== resolvedSize || $[65] !== t11 || $[66] !== t13 || $[67] !== t14 || $[68] !== t20 || $[69] !== t21 || $[70] !== t27 || $[71] !== t28 || $[72] !== t8) {
|
|
306
|
-
t29 = /*#__PURE__*/ jsxs("nav", {
|
|
307
|
-
"data-tao-pagination": "",
|
|
308
|
-
"data-tao-size": resolvedSize,
|
|
309
|
-
"data-tao-disabled": t8,
|
|
310
|
-
"aria-label": t9,
|
|
311
|
-
className: t11,
|
|
312
|
-
style: t13,
|
|
313
|
-
children: [
|
|
314
|
-
t14,
|
|
315
|
-
t20,
|
|
316
|
-
t21,
|
|
317
|
-
t27,
|
|
318
|
-
t28
|
|
319
|
-
]
|
|
320
|
-
});
|
|
321
|
-
$[63] = ctx.locale.messages.pagination;
|
|
322
|
-
$[64] = resolvedSize;
|
|
323
|
-
$[65] = t11;
|
|
324
|
-
$[66] = t13;
|
|
325
|
-
$[67] = t14;
|
|
326
|
-
$[68] = t20;
|
|
327
|
-
$[69] = t21;
|
|
328
|
-
$[70] = t27;
|
|
329
|
-
$[71] = t28;
|
|
330
|
-
$[72] = t8;
|
|
331
|
-
$[73] = t29;
|
|
332
|
-
} else t29 = $[73];
|
|
333
|
-
return t29;
|
|
132
|
+
children: /*#__PURE__*/ jsx(ChevronLeft, {})
|
|
133
|
+
}),
|
|
134
|
+
pages.map((item, i)=>'ellipsis' === item ? /*#__PURE__*/ jsx("span", {
|
|
135
|
+
"data-tao-pagination-ellipsis": "",
|
|
136
|
+
children: "\xb7\xb7\xb7"
|
|
137
|
+
}, `ellipsis-${pages[i - 1]}-${pages[i + 1]}`) : /*#__PURE__*/ jsx("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
"data-tao-pagination-btn": "",
|
|
140
|
+
"data-tao-active": item === current || void 0,
|
|
141
|
+
disabled: resolvedDisabled,
|
|
142
|
+
"aria-label": ctx.locale.messages.page(item),
|
|
143
|
+
"aria-current": item === current ? 'page' : void 0,
|
|
144
|
+
onClick: ()=>goTo(item),
|
|
145
|
+
className: classNames?.item,
|
|
146
|
+
style: styles?.item,
|
|
147
|
+
children: item
|
|
148
|
+
}, item)),
|
|
149
|
+
/*#__PURE__*/ jsx("button", {
|
|
150
|
+
type: "button",
|
|
151
|
+
"data-tao-pagination-btn": "",
|
|
152
|
+
disabled: resolvedDisabled || current >= totalPages,
|
|
153
|
+
"aria-label": ctx.locale.messages.nextPage,
|
|
154
|
+
onClick: ()=>goTo(current + 1),
|
|
155
|
+
className: classNames?.item,
|
|
156
|
+
style: styles?.item,
|
|
157
|
+
children: /*#__PURE__*/ jsx(ChevronRight, {})
|
|
158
|
+
}),
|
|
159
|
+
showSizeChanger && /*#__PURE__*/ jsx(Select, {
|
|
160
|
+
"aria-label": ctx.locale.messages.pageSize,
|
|
161
|
+
style: {
|
|
162
|
+
width: 'auto'
|
|
163
|
+
},
|
|
164
|
+
options: (pageSizeOptions.includes(pageSize) ? pageSizeOptions : [
|
|
165
|
+
...pageSizeOptions,
|
|
166
|
+
pageSize
|
|
167
|
+
]).map((opt)=>({
|
|
168
|
+
label: `${opt} ${ctx.locale.messages.itemsPerPage}`,
|
|
169
|
+
value: String(opt)
|
|
170
|
+
})),
|
|
171
|
+
value: String(pageSize),
|
|
172
|
+
onChange: (val)=>{
|
|
173
|
+
const newSize = Number(val);
|
|
174
|
+
goTo(1, newSize);
|
|
175
|
+
},
|
|
176
|
+
disabled: resolvedDisabled,
|
|
177
|
+
size: 'large' === resolvedSize ? 'medium' : resolvedSize
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
334
181
|
}
|
|
335
182
|
export { Pagination };
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
@layer components {
|
|
2
|
+
[data-tao-popconfirm] {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
max-width: 260px;
|
|
5
|
+
font-family: var(--tao-font-family);
|
|
6
|
+
font-size: var(--tao-font-size-base);
|
|
7
|
+
line-height: var(--tao-line-height);
|
|
8
|
+
color: var(--tao-color-text);
|
|
9
|
+
}
|
|
9
10
|
|
|
10
|
-
[data-tao-popconfirm-message] {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
11
|
+
[data-tao-popconfirm-message] {
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
gap: var(--tao-padding-xs);
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
[data-tao-popconfirm-icon] {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
[data-tao-popconfirm-icon] {
|
|
18
|
+
color: var(--tao-warning);
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
margin-block-start: 2px;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
[data-tao-popconfirm-text] {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
[data-tao-popconfirm-text] {
|
|
25
|
+
flex: 1;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
[data-tao-popconfirm-title] {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
[data-tao-popconfirm-title] {
|
|
30
|
+
font-weight: var(--tao-font-weight-strong);
|
|
31
|
+
color: var(--tao-color-text);
|
|
32
|
+
}
|
|
32
33
|
|
|
33
|
-
[data-tao-popconfirm-description] {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
34
|
+
[data-tao-popconfirm-description] {
|
|
35
|
+
color: var(--tao-color-text-secondary);
|
|
36
|
+
margin-block-start: var(--tao-padding-xs);
|
|
37
|
+
}
|
|
37
38
|
|
|
38
|
-
[data-tao-popconfirm-footer] {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
[data-tao-popconfirm-footer] {
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
gap: var(--tao-padding-xs);
|
|
42
|
+
margin-block-start: var(--tao-padding-sm);
|
|
43
|
+
display: flex;
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
|