vue-devui 1.0.0-alpha.1 → 1.0.0-alpha.12
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 +161 -172
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +204 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +9051 -0
- package/auto-complete/index.umd.js +40 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +308 -1
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +120 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +5964 -1
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +89 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +8207 -1
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{carousel → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +217 -0
- package/countdown/index.umd.js +1 -0
- package/{accordion → countdown}/package.json +1 -1
- package/countdown/style.css +1 -0
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12031 -0
- package/date-picker-pro/index.umd.js +38 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +248 -0
- package/drawer/index.umd.js +1 -0
- package/{anchor → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +743 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +991 -1
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7751 -0
- package/form/index.umd.js +38 -0
- package/{toast → form}/package.json +1 -1
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +166 -0
- package/fullscreen/index.umd.js +1 -0
- package/fullscreen/package.json +7 -0
- package/fullscreen/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{sticky → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +218 -1
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +511 -1
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +8311 -1
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +308 -1
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +115 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +272 -1
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +741 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +7 -0
- package/modal/style.css +1 -0
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +293 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +19 -82
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +820 -1
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +218 -1
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +6062 -1
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +207 -1
- package/progress/index.umd.js +3 -1
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8056 -1
- package/radio/index.umd.js +38 -1
- package/radio/style.css +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +242 -1
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +248 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +173 -1
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8504 -2
- package/search/index.umd.js +38 -10
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9423 -1
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +145 -0
- package/skeleton/index.umd.js +1 -0
- package/skeleton/package.json +7 -0
- package/skeleton/style.css +1 -0
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +203 -1
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +6754 -1
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +63 -1
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +7852 -1
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11527 -0
- package/table/index.umd.js +38 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +407 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +156 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +7986 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9556 -0
- package/time-picker/index.umd.js +38 -0
- package/{date-picker → time-picker}/package.json +1 -1
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9604 -0
- package/time-select/index.umd.js +38 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.d.ts +7 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/timeline/package.json +7 -0
- package/timeline/style.css +1 -0
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5900 -1
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +10336 -1
- package/tree/index.umd.js +38 -1
- package/tree/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +1398 -1
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27443 -2
- package/vue-devui.umd.js +50 -10
- package/accordion/index.es.js +0 -1
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -1
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/carousel/index.es.js +0 -1
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/date-picker/index.es.js +0 -1
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/quadrant-diagram/index.es.js +0 -10
- package/quadrant-diagram/index.umd.js +0 -10
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/sticky/index.es.js +0 -1
- package/sticky/index.umd.js +0 -1
- package/tag-input/index.es.js +0 -1
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/toast/index.es.js +0 -1
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
- package/transfer/index.es.js +0 -10
- package/transfer/index.umd.js +0 -10
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
package/pagination/index.es.js
CHANGED
|
@@ -1 +1,820 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, ref, onMounted, onUnmounted, withDirectives, createVNode, createTextVNode, resolveDirective, toRefs, watch, resolveComponent, computed, Fragment, reactive, getCurrentInstance, mergeProps, nextTick } from "vue";
|
|
2
|
+
const paginationProps = {
|
|
3
|
+
pageSize: {
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 10
|
|
6
|
+
},
|
|
7
|
+
total: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
pageSizeOptions: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => [5, 10, 20, 50]
|
|
14
|
+
},
|
|
15
|
+
pageSizeDirection: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => ["centerDown", "centerUp"]
|
|
18
|
+
},
|
|
19
|
+
pageIndex: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 1
|
|
22
|
+
},
|
|
23
|
+
maxItems: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 10
|
|
26
|
+
},
|
|
27
|
+
preLink: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "<"
|
|
30
|
+
},
|
|
31
|
+
nextLink: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ">"
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
},
|
|
39
|
+
canJumpPage: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
canChangePageSize: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
canViewTotal: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
totalItemText: {
|
|
52
|
+
type: String
|
|
53
|
+
},
|
|
54
|
+
goToText: {
|
|
55
|
+
type: String
|
|
56
|
+
},
|
|
57
|
+
showJumpButton: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
showTruePageIndex: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
lite: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
showPageSelector: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
},
|
|
73
|
+
haveConfigMenu: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
autoFixPageIndex: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: true
|
|
80
|
+
},
|
|
81
|
+
autoHide: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
"onUpdate:pageIndex": {
|
|
86
|
+
type: Function
|
|
87
|
+
},
|
|
88
|
+
"onUpdate:pageSize": {
|
|
89
|
+
type: Function
|
|
90
|
+
},
|
|
91
|
+
"onPageIndexChange": {
|
|
92
|
+
type: Function
|
|
93
|
+
},
|
|
94
|
+
"onPageSizeChange": {
|
|
95
|
+
type: Function
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const handlePages = (cursor, maxItems, totalPages) => {
|
|
99
|
+
const currentPage = cursor;
|
|
100
|
+
const maxPages = maxItems;
|
|
101
|
+
if (maxPages >= totalPages) {
|
|
102
|
+
return [2, totalPages];
|
|
103
|
+
}
|
|
104
|
+
const midPages = maxPages - 2;
|
|
105
|
+
let midStart = currentPage - (midPages >> 1);
|
|
106
|
+
let midEnd = currentPage + (midPages - 1 >> 1);
|
|
107
|
+
if (midStart < 2) {
|
|
108
|
+
midStart = 2;
|
|
109
|
+
midEnd = maxPages - 2;
|
|
110
|
+
}
|
|
111
|
+
if (midEnd > totalPages) {
|
|
112
|
+
midStart = totalPages - maxPages + 3;
|
|
113
|
+
midEnd = totalPages;
|
|
114
|
+
}
|
|
115
|
+
return [midStart, midEnd];
|
|
116
|
+
};
|
|
117
|
+
function liteSelectOptions(total) {
|
|
118
|
+
return new Array(total || 1).fill(0).map((v, index2) => {
|
|
119
|
+
return {
|
|
120
|
+
name: `${index2 + 1}/${total}`,
|
|
121
|
+
value: index2 + 1
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function on(element, eventName, handler) {
|
|
126
|
+
if (document.addEventListener) {
|
|
127
|
+
if (element && eventName && handler) {
|
|
128
|
+
element.addEventListener(eventName, handler, false);
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
if (element && eventName && handler) {
|
|
132
|
+
element.attachEvent("on" + eventName, handler);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function off(element, eventName, handler) {
|
|
137
|
+
if (document.removeEventListener) {
|
|
138
|
+
if (element && eventName && handler) {
|
|
139
|
+
element.removeEventListener(eventName, handler, false);
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
if (element && eventName && handler) {
|
|
143
|
+
element.detachEvent("on" + eventName, handler);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const inBrowser = typeof window !== "undefined";
|
|
148
|
+
const ctx = Symbol("@@clickoutside");
|
|
149
|
+
const nodeList = /* @__PURE__ */ new Map();
|
|
150
|
+
let startClick;
|
|
151
|
+
let nid = 0;
|
|
152
|
+
let isFirst = true;
|
|
153
|
+
function createDocumentHandler(el, binding, vnode) {
|
|
154
|
+
if (inBrowser && isFirst) {
|
|
155
|
+
isFirst = false;
|
|
156
|
+
on(document, "mousedown", (e) => {
|
|
157
|
+
startClick = e;
|
|
158
|
+
});
|
|
159
|
+
on(document, "mouseup", (e) => {
|
|
160
|
+
for (const [id, node] of nodeList) {
|
|
161
|
+
node[ctx].documentHandler(e, startClick);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return function(mouseup, mousedown) {
|
|
166
|
+
if (!vnode || !binding.instance || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
el[ctx].bindingFn && el[ctx].bindingFn();
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const clickoutsideDirective = {
|
|
173
|
+
beforeMount: function(el, binding, vnode) {
|
|
174
|
+
nid++;
|
|
175
|
+
nodeList.set(nid, el);
|
|
176
|
+
el[ctx] = {
|
|
177
|
+
nid,
|
|
178
|
+
documentHandler: createDocumentHandler(el, binding, vnode),
|
|
179
|
+
bindingFn: binding.value
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
updated: function(el, binding, vnode) {
|
|
183
|
+
el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
|
|
184
|
+
el[ctx].bindingFn = binding.value;
|
|
185
|
+
},
|
|
186
|
+
unmounted: function(el) {
|
|
187
|
+
nodeList.delete(el[ctx].nid);
|
|
188
|
+
delete el[ctx];
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
function createBem(namespace, element, modifier) {
|
|
192
|
+
let cls = namespace;
|
|
193
|
+
if (element) {
|
|
194
|
+
cls += `__${element}`;
|
|
195
|
+
}
|
|
196
|
+
if (modifier) {
|
|
197
|
+
cls += `--${modifier}`;
|
|
198
|
+
}
|
|
199
|
+
return cls;
|
|
200
|
+
}
|
|
201
|
+
function useNamespace(block, needDot = false) {
|
|
202
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
203
|
+
const b = () => createBem(namespace);
|
|
204
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
205
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
206
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
207
|
+
return {
|
|
208
|
+
b,
|
|
209
|
+
e,
|
|
210
|
+
m,
|
|
211
|
+
em
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
var ConfigMenu = defineComponent({
|
|
215
|
+
directives: {
|
|
216
|
+
clickoutside: clickoutsideDirective
|
|
217
|
+
},
|
|
218
|
+
props: {
|
|
219
|
+
currentPageSize: Number,
|
|
220
|
+
pageSizeChange: Function,
|
|
221
|
+
pageSizeOptions: Array
|
|
222
|
+
},
|
|
223
|
+
setup() {
|
|
224
|
+
const paginationConfig = ref(null);
|
|
225
|
+
const isShowConfig = ref(false);
|
|
226
|
+
const closeConfigMenu = (e) => {
|
|
227
|
+
isShowConfig.value = isShowConfig.value ? false : !!e;
|
|
228
|
+
};
|
|
229
|
+
onMounted(() => {
|
|
230
|
+
on(paginationConfig.value, "click", closeConfigMenu);
|
|
231
|
+
});
|
|
232
|
+
onUnmounted(() => {
|
|
233
|
+
off(paginationConfig.value, "click", closeConfigMenu);
|
|
234
|
+
});
|
|
235
|
+
return {
|
|
236
|
+
paginationConfig,
|
|
237
|
+
isShowConfig,
|
|
238
|
+
closeConfigMenu
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
render() {
|
|
242
|
+
var _a;
|
|
243
|
+
const {
|
|
244
|
+
closeConfigMenu,
|
|
245
|
+
currentPageSize,
|
|
246
|
+
pageSizeChange,
|
|
247
|
+
pageSizeOptions,
|
|
248
|
+
isShowConfig,
|
|
249
|
+
$slots
|
|
250
|
+
} = this;
|
|
251
|
+
const ns = useNamespace("pagination");
|
|
252
|
+
return withDirectives(createVNode("div", {
|
|
253
|
+
"class": ns.e("config"),
|
|
254
|
+
"ref": "paginationConfig"
|
|
255
|
+
}, [createVNode("div", {
|
|
256
|
+
"class": ns.e("setup-icon")
|
|
257
|
+
}, [createVNode("i", {
|
|
258
|
+
"class": "icon-setting",
|
|
259
|
+
"style": "font-weight: bold;"
|
|
260
|
+
}, null)]), isShowConfig && createVNode("div", {
|
|
261
|
+
"class": ns.e("config-container")
|
|
262
|
+
}, [(_a = $slots.default) == null ? void 0 : _a.call($slots), createVNode("div", {
|
|
263
|
+
"class": ns.e("config-item")
|
|
264
|
+
}, [createVNode("div", {
|
|
265
|
+
"class": "config-item-title"
|
|
266
|
+
}, [createTextVNode("\u6BCF\u9875\u6761\u6570")]), createVNode("div", {
|
|
267
|
+
"class": ns.e("number")
|
|
268
|
+
}, [pageSizeOptions.map((v) => {
|
|
269
|
+
return createVNode("div", {
|
|
270
|
+
"class": {
|
|
271
|
+
choosed: v === currentPageSize
|
|
272
|
+
},
|
|
273
|
+
"key": v,
|
|
274
|
+
"onClick": pageSizeChange.bind(null, {
|
|
275
|
+
value: v
|
|
276
|
+
})
|
|
277
|
+
}, [v]);
|
|
278
|
+
})])])])]), [[resolveDirective("clickoutside"), closeConfigMenu]]);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
const jumpPageProps = {
|
|
282
|
+
goToText: String,
|
|
283
|
+
size: {
|
|
284
|
+
type: String,
|
|
285
|
+
default: ""
|
|
286
|
+
},
|
|
287
|
+
pageIndex: Number,
|
|
288
|
+
showJumpButton: Boolean,
|
|
289
|
+
totalPages: Number,
|
|
290
|
+
cursor: Number,
|
|
291
|
+
onChangeCursorEmit: Function
|
|
292
|
+
};
|
|
293
|
+
var JumpPage = defineComponent({
|
|
294
|
+
props: jumpPageProps,
|
|
295
|
+
emits: ["changeCursorEmit"],
|
|
296
|
+
setup(props, {
|
|
297
|
+
emit
|
|
298
|
+
}) {
|
|
299
|
+
const {
|
|
300
|
+
pageIndex,
|
|
301
|
+
totalPages,
|
|
302
|
+
cursor
|
|
303
|
+
} = toRefs(props);
|
|
304
|
+
const inputNum = ref(pageIndex == null ? void 0 : pageIndex.value);
|
|
305
|
+
watch(() => pageIndex == null ? void 0 : pageIndex.value, (val) => {
|
|
306
|
+
inputNum.value = val;
|
|
307
|
+
});
|
|
308
|
+
let curPage = pageIndex == null ? void 0 : pageIndex.value;
|
|
309
|
+
const jumpPageChange = (currentPage) => {
|
|
310
|
+
curPage = +currentPage;
|
|
311
|
+
inputNum.value = currentPage;
|
|
312
|
+
if (isNaN(currentPage)) {
|
|
313
|
+
setTimeout(() => {
|
|
314
|
+
inputNum.value = pageIndex == null ? void 0 : pageIndex.value;
|
|
315
|
+
}, 300);
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
const jump = (e) => {
|
|
319
|
+
if (curPage > (totalPages == null ? void 0 : totalPages.value)) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if ((e === "btn" || e.key === "Enter") && (cursor == null ? void 0 : cursor.value) !== curPage) {
|
|
323
|
+
emit("changeCursorEmit", curPage);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
return {
|
|
327
|
+
inputNum,
|
|
328
|
+
jumpPageChange,
|
|
329
|
+
jump
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
render() {
|
|
333
|
+
const {
|
|
334
|
+
goToText,
|
|
335
|
+
size,
|
|
336
|
+
inputNum,
|
|
337
|
+
jumpPageChange,
|
|
338
|
+
jump,
|
|
339
|
+
showJumpButton
|
|
340
|
+
} = this;
|
|
341
|
+
const ns = useNamespace("pagination");
|
|
342
|
+
const inputProps = {
|
|
343
|
+
class: [ns.e("input"), size ? ns.em("input", size) : ""],
|
|
344
|
+
size,
|
|
345
|
+
modelValue: String(inputNum),
|
|
346
|
+
"onUpdate:modelValue": jumpPageChange,
|
|
347
|
+
onKeydown: jump
|
|
348
|
+
};
|
|
349
|
+
return createVNode("div", {
|
|
350
|
+
"class": ns.e("jump-container")
|
|
351
|
+
}, [
|
|
352
|
+
goToText,
|
|
353
|
+
createVNode(resolveComponent("d-input"), inputProps, null),
|
|
354
|
+
goToText === "\u8DF3\u81F3" && "\u9875",
|
|
355
|
+
showJumpButton && createVNode("div", {
|
|
356
|
+
"class": [ns.e("jump-button"), size ? ns.em("jump-size", size) : ns.em("jump-size", "default")],
|
|
357
|
+
"onClick": jump.bind(null, "btn"),
|
|
358
|
+
"title": goToText
|
|
359
|
+
}, [createVNode("div", {
|
|
360
|
+
"class": ns.e("go")
|
|
361
|
+
}, null)])
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
const pageNumBtnProps = {
|
|
366
|
+
size: {
|
|
367
|
+
type: String,
|
|
368
|
+
default: ""
|
|
369
|
+
},
|
|
370
|
+
preLink: String,
|
|
371
|
+
nextLink: String,
|
|
372
|
+
lite: Boolean,
|
|
373
|
+
cursor: Number,
|
|
374
|
+
maxItems: Number,
|
|
375
|
+
totalPages: Number,
|
|
376
|
+
onChangeCursorEmit: Function,
|
|
377
|
+
showTruePageIndex: Boolean
|
|
378
|
+
};
|
|
379
|
+
var PageNumBtn = defineComponent({
|
|
380
|
+
props: pageNumBtnProps,
|
|
381
|
+
emits: ["changeCursorEmit"],
|
|
382
|
+
setup(props, {
|
|
383
|
+
emit
|
|
384
|
+
}) {
|
|
385
|
+
const showPageNum = computed(() => handlePages(props.cursor, props.maxItems, props.totalPages));
|
|
386
|
+
const changeCursor = (pageSize) => {
|
|
387
|
+
if (isNaN(pageSize)) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const page = pageSize < 1 ? 1 : pageSize > props.totalPages ? props.totalPages : pageSize | 0;
|
|
391
|
+
emit("changeCursorEmit", page);
|
|
392
|
+
};
|
|
393
|
+
const prevChange = (page) => {
|
|
394
|
+
if (props.cursor > 1) {
|
|
395
|
+
const toPage = page === -1 ? props.cursor - 1 : page;
|
|
396
|
+
emit("changeCursorEmit", toPage);
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
const nextChange = (page) => {
|
|
400
|
+
if (props.cursor < props.totalPages) {
|
|
401
|
+
const toPage = page === -1 ? props.cursor + 1 : page;
|
|
402
|
+
emit("changeCursorEmit", toPage);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
return {
|
|
406
|
+
showPageNum,
|
|
407
|
+
changeCursor,
|
|
408
|
+
prevChange,
|
|
409
|
+
nextChange
|
|
410
|
+
};
|
|
411
|
+
},
|
|
412
|
+
render() {
|
|
413
|
+
const {
|
|
414
|
+
size,
|
|
415
|
+
preLink,
|
|
416
|
+
nextLink,
|
|
417
|
+
lite,
|
|
418
|
+
changeCursor,
|
|
419
|
+
cursor,
|
|
420
|
+
showPageNum,
|
|
421
|
+
prevChange,
|
|
422
|
+
totalPages,
|
|
423
|
+
nextChange,
|
|
424
|
+
showTruePageIndex
|
|
425
|
+
} = this;
|
|
426
|
+
const ns = useNamespace("pagination");
|
|
427
|
+
return createVNode("ul", {
|
|
428
|
+
"class": [ns.e("list"), size ? ns.m(size) : ""]
|
|
429
|
+
}, [createVNode("li", {
|
|
430
|
+
"onClick": prevChange.bind(null, -1),
|
|
431
|
+
"class": {
|
|
432
|
+
[ns.e("item")]: true,
|
|
433
|
+
disabled: cursor <= 1
|
|
434
|
+
}
|
|
435
|
+
}, [createVNode("a", {
|
|
436
|
+
"innerHTML": preLink,
|
|
437
|
+
"class": ns.e("link")
|
|
438
|
+
}, null)]), !lite && createVNode(Fragment, null, [
|
|
439
|
+
createVNode("li", {
|
|
440
|
+
"onClick": changeCursor.bind(null, 1),
|
|
441
|
+
"class": {
|
|
442
|
+
[ns.e("item")]: true,
|
|
443
|
+
active: cursor === 1
|
|
444
|
+
}
|
|
445
|
+
}, [createVNode("a", {
|
|
446
|
+
"class": ns.e("link")
|
|
447
|
+
}, [createTextVNode("1")])]),
|
|
448
|
+
showPageNum[0] > 2 && createVNode("li", {
|
|
449
|
+
"onClick": prevChange.bind(null, showPageNum[0] - 1),
|
|
450
|
+
"class": ns.e("item")
|
|
451
|
+
}, [createVNode("a", {
|
|
452
|
+
"class": ns.e("link")
|
|
453
|
+
}, [createTextVNode("...")])]),
|
|
454
|
+
(() => {
|
|
455
|
+
const list = [];
|
|
456
|
+
for (let i = showPageNum[0]; i <= showPageNum[1]; i++) {
|
|
457
|
+
list.push(createVNode("li", {
|
|
458
|
+
"onClick": changeCursor.bind(null, i),
|
|
459
|
+
"key": i,
|
|
460
|
+
"class": {
|
|
461
|
+
[ns.e("item")]: true,
|
|
462
|
+
active: cursor === i
|
|
463
|
+
}
|
|
464
|
+
}, [createVNode("a", {
|
|
465
|
+
"class": ns.e("link")
|
|
466
|
+
}, [i])]));
|
|
467
|
+
}
|
|
468
|
+
return list;
|
|
469
|
+
})(),
|
|
470
|
+
showPageNum[1] < totalPages - 1 && createVNode("li", {
|
|
471
|
+
"onClick": nextChange.bind(null, showPageNum[1] + 1),
|
|
472
|
+
"class": ns.e("item")
|
|
473
|
+
}, [createVNode("a", {
|
|
474
|
+
"class": ns.e("link")
|
|
475
|
+
}, [createTextVNode("...")])]),
|
|
476
|
+
showPageNum[1] < totalPages && createVNode("li", {
|
|
477
|
+
"onClick": changeCursor.bind(null, totalPages),
|
|
478
|
+
"class": {
|
|
479
|
+
[ns.e("item")]: true,
|
|
480
|
+
active: cursor === totalPages
|
|
481
|
+
}
|
|
482
|
+
}, [createVNode("a", {
|
|
483
|
+
"class": ns.e("link")
|
|
484
|
+
}, [totalPages])]),
|
|
485
|
+
showTruePageIndex && cursor > totalPages && totalPages > 0 && createVNode(Fragment, null, [cursor > totalPages + 1 && createVNode("li", {
|
|
486
|
+
"class": [ns.e("item"), "disabled"]
|
|
487
|
+
}, [createVNode("a", {
|
|
488
|
+
"class": ns.e("link")
|
|
489
|
+
}, [createTextVNode("...")])]), createVNode("li", {
|
|
490
|
+
"class": [ns.e("item"), "disabled", "active"]
|
|
491
|
+
}, [createVNode("a", {
|
|
492
|
+
"class": ns.e("link")
|
|
493
|
+
}, [cursor])])])
|
|
494
|
+
]), createVNode("li", {
|
|
495
|
+
"onClick": nextChange.bind(null, -1),
|
|
496
|
+
"class": {
|
|
497
|
+
[ns.e("item")]: true,
|
|
498
|
+
disabled: cursor >= totalPages
|
|
499
|
+
}
|
|
500
|
+
}, [createVNode("a", {
|
|
501
|
+
"innerHTML": nextLink,
|
|
502
|
+
"class": ns.e("link")
|
|
503
|
+
}, null)])]);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
function deepAssign(...objects) {
|
|
507
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
508
|
+
return objects.reduce((prev, from) => {
|
|
509
|
+
Object.keys(from).forEach((key) => {
|
|
510
|
+
const pVal = prev[key];
|
|
511
|
+
const oVal = from[key];
|
|
512
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
513
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
514
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
515
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
516
|
+
} else {
|
|
517
|
+
prev[key] = oVal;
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
return prev;
|
|
521
|
+
}, {});
|
|
522
|
+
}
|
|
523
|
+
var zhCN = {
|
|
524
|
+
pagination: {
|
|
525
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
526
|
+
goToText: "\u8DF3\u81F3"
|
|
527
|
+
},
|
|
528
|
+
accordion: {
|
|
529
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
530
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
531
|
+
},
|
|
532
|
+
autoCompleteDropdown: {
|
|
533
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
534
|
+
},
|
|
535
|
+
cascaderList: {
|
|
536
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
537
|
+
},
|
|
538
|
+
colorPicker: {
|
|
539
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
540
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
541
|
+
},
|
|
542
|
+
datePickerPro: {
|
|
543
|
+
ok: "\u786E\u5B9A",
|
|
544
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
545
|
+
month1: "1\u6708",
|
|
546
|
+
month2: "2\u6708",
|
|
547
|
+
month3: "3\u6708",
|
|
548
|
+
month4: "4\u6708",
|
|
549
|
+
month5: "5\u6708",
|
|
550
|
+
month6: "6\u6708",
|
|
551
|
+
month7: "7\u6708",
|
|
552
|
+
month8: "8\u6708",
|
|
553
|
+
month9: "9\u6708",
|
|
554
|
+
month10: "10\u6708",
|
|
555
|
+
month11: "11\u6708",
|
|
556
|
+
month12: "12\u6708",
|
|
557
|
+
year: "\u5E74",
|
|
558
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
559
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
560
|
+
getWeekDays() {
|
|
561
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
562
|
+
},
|
|
563
|
+
getTimeArr() {
|
|
564
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
565
|
+
},
|
|
566
|
+
getYearMonthStr(year, month) {
|
|
567
|
+
return `${year}\u5E74${month}\u6708`;
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
editableSelect: {
|
|
571
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
572
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
573
|
+
},
|
|
574
|
+
input: {
|
|
575
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
576
|
+
},
|
|
577
|
+
splitterBar: {
|
|
578
|
+
collapse: "\u6536\u8D77",
|
|
579
|
+
expand: "\u5C55\u5F00"
|
|
580
|
+
},
|
|
581
|
+
stepsGuide: {
|
|
582
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
583
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
584
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
585
|
+
},
|
|
586
|
+
table: {
|
|
587
|
+
selectAll: "\u5168\u9009",
|
|
588
|
+
ok: "\u786E\u5B9A"
|
|
589
|
+
},
|
|
590
|
+
timePopup: {
|
|
591
|
+
ok: "\u786E\u5B9A"
|
|
592
|
+
},
|
|
593
|
+
transfer: {
|
|
594
|
+
unit: "\u9879",
|
|
595
|
+
panelUnit: "\u9879",
|
|
596
|
+
headerUnit: "\u9879",
|
|
597
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
598
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
599
|
+
},
|
|
600
|
+
tree: {
|
|
601
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
602
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
603
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
604
|
+
},
|
|
605
|
+
upload: {
|
|
606
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
607
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
608
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
609
|
+
},
|
|
610
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
611
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
612
|
+
},
|
|
613
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
614
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
615
|
+
},
|
|
616
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
617
|
+
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
search: {
|
|
621
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
622
|
+
},
|
|
623
|
+
select: {
|
|
624
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
625
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
626
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
627
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
628
|
+
},
|
|
629
|
+
tagInput: {
|
|
630
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
631
|
+
},
|
|
632
|
+
timeSelect: {
|
|
633
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
const lang = ref("zh-CN");
|
|
637
|
+
let langMessages = reactive({
|
|
638
|
+
[lang.value]: zhCN
|
|
639
|
+
});
|
|
640
|
+
const Locale = {
|
|
641
|
+
messages() {
|
|
642
|
+
return langMessages[lang.value];
|
|
643
|
+
},
|
|
644
|
+
lang() {
|
|
645
|
+
return lang.value;
|
|
646
|
+
},
|
|
647
|
+
use(newLang, newMessages) {
|
|
648
|
+
lang.value = newLang;
|
|
649
|
+
this.add({ [newLang]: newMessages });
|
|
650
|
+
},
|
|
651
|
+
add(newMessages = {}) {
|
|
652
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
656
|
+
function get(object, path) {
|
|
657
|
+
const keys = path.split(".");
|
|
658
|
+
let result = object;
|
|
659
|
+
keys.forEach((key) => {
|
|
660
|
+
var _a;
|
|
661
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
662
|
+
});
|
|
663
|
+
return result;
|
|
664
|
+
}
|
|
665
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
666
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
667
|
+
return (path) => {
|
|
668
|
+
var _a;
|
|
669
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
670
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
671
|
+
return message;
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
var pagination = "";
|
|
675
|
+
var Pagination = defineComponent({
|
|
676
|
+
name: "DPagination",
|
|
677
|
+
components: {
|
|
678
|
+
ConfigMenu,
|
|
679
|
+
JumpPage,
|
|
680
|
+
PageNumBtn
|
|
681
|
+
},
|
|
682
|
+
props: paginationProps,
|
|
683
|
+
emits: ["pageIndexChange", "pageSizeChange", "update:pageSize", "update:pageIndex"],
|
|
684
|
+
setup(props, {
|
|
685
|
+
emit,
|
|
686
|
+
slots
|
|
687
|
+
}) {
|
|
688
|
+
const app = getCurrentInstance();
|
|
689
|
+
const t = createI18nTranslate("DPagination", app);
|
|
690
|
+
const {
|
|
691
|
+
autoHide,
|
|
692
|
+
pageSizeOptions,
|
|
693
|
+
total,
|
|
694
|
+
canChangePageSize,
|
|
695
|
+
lite,
|
|
696
|
+
size,
|
|
697
|
+
pageSizeDirection,
|
|
698
|
+
showPageSelector,
|
|
699
|
+
canViewTotal,
|
|
700
|
+
totalItemText,
|
|
701
|
+
maxItems,
|
|
702
|
+
preLink,
|
|
703
|
+
nextLink,
|
|
704
|
+
showTruePageIndex,
|
|
705
|
+
canJumpPage,
|
|
706
|
+
goToText,
|
|
707
|
+
pageIndex,
|
|
708
|
+
showJumpButton,
|
|
709
|
+
haveConfigMenu
|
|
710
|
+
} = toRefs(props);
|
|
711
|
+
const ns = useNamespace("pagination");
|
|
712
|
+
const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
|
|
713
|
+
const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
|
|
714
|
+
const cursor = computed({
|
|
715
|
+
get() {
|
|
716
|
+
if (!props.showTruePageIndex && props.pageIndex > totalPages.value) {
|
|
717
|
+
emit("update:pageIndex", totalPages.value || 1);
|
|
718
|
+
return totalPages.value || 1;
|
|
719
|
+
}
|
|
720
|
+
return props.pageIndex || 1;
|
|
721
|
+
},
|
|
722
|
+
set(val) {
|
|
723
|
+
emit("update:pageIndex", val);
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
const currentPageSize = computed({
|
|
727
|
+
get() {
|
|
728
|
+
return props.pageSize;
|
|
729
|
+
},
|
|
730
|
+
set(val) {
|
|
731
|
+
emit("update:pageSize", val);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
const changeCursorEmit = (val) => {
|
|
735
|
+
cursor.value = val;
|
|
736
|
+
emit("pageIndexChange", val);
|
|
737
|
+
};
|
|
738
|
+
const pageSizeChange = (val) => {
|
|
739
|
+
currentPageSize.value = val.value;
|
|
740
|
+
if (props.autoFixPageIndex) {
|
|
741
|
+
nextTick(() => {
|
|
742
|
+
if (cursor.value > totalPages.value) {
|
|
743
|
+
changeCursorEmit(totalPages.value);
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
emit("pageSizeChange", val.value);
|
|
748
|
+
};
|
|
749
|
+
const litePageIndexChange = (page) => {
|
|
750
|
+
changeCursorEmit(page.value);
|
|
751
|
+
};
|
|
752
|
+
return () => {
|
|
753
|
+
return autoHide.value && Math.min(...pageSizeOptions.value) > total.value ? null : createVNode("div", {
|
|
754
|
+
"class": ns.b()
|
|
755
|
+
}, [
|
|
756
|
+
canChangePageSize.value && !lite.value && createVNode("div", {
|
|
757
|
+
"class": [ns.e("size"), size.value ? ns.em("size", size.value) : ""]
|
|
758
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
759
|
+
"options": pageSizeOptions.value,
|
|
760
|
+
"modelValue": currentPageSize.value,
|
|
761
|
+
"onValueChange": pageSizeChange,
|
|
762
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
763
|
+
}, null)]),
|
|
764
|
+
(!lite.value || lite.value && showPageSelector.value) && canViewTotal.value && createVNode("div", {
|
|
765
|
+
"class": ns.e("total-size")
|
|
766
|
+
}, [totalItemText.value || t("totalItemText"), createTextVNode(": "), total.value]),
|
|
767
|
+
lite.value && showPageSelector.value && createVNode("div", {
|
|
768
|
+
"class": ns.e("size")
|
|
769
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
770
|
+
"options": litePageOptions.value,
|
|
771
|
+
"disabled": total.value === 0,
|
|
772
|
+
"modelValue": cursor.value,
|
|
773
|
+
"onValueChange": litePageIndexChange,
|
|
774
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
775
|
+
}, null)]),
|
|
776
|
+
createVNode(resolveComponent("page-num-btn"), mergeProps({
|
|
777
|
+
cursor: cursor.value,
|
|
778
|
+
totalPages: totalPages.value,
|
|
779
|
+
size: size.value,
|
|
780
|
+
lite: lite.value,
|
|
781
|
+
maxItems: maxItems.value,
|
|
782
|
+
preLink: preLink.value,
|
|
783
|
+
nextLink: nextLink.value,
|
|
784
|
+
showTruePageIndex: showTruePageIndex.value
|
|
785
|
+
}, {
|
|
786
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
787
|
+
}), null),
|
|
788
|
+
canJumpPage.value && !lite.value && createVNode(resolveComponent("jump-page"), mergeProps({
|
|
789
|
+
goToText: goToText.value || t("goToText"),
|
|
790
|
+
size: size.value,
|
|
791
|
+
pageIndex: pageIndex.value,
|
|
792
|
+
totalPages: totalPages.value,
|
|
793
|
+
cursor: cursor.value,
|
|
794
|
+
showJumpButton: showJumpButton.value
|
|
795
|
+
}, {
|
|
796
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
797
|
+
}), null),
|
|
798
|
+
lite.value && haveConfigMenu.value && createVNode(resolveComponent("config-menu"), {
|
|
799
|
+
currentPageSize: currentPageSize.value,
|
|
800
|
+
pageSizeChange,
|
|
801
|
+
pageSizeOptions: pageSizeOptions.value
|
|
802
|
+
}, {
|
|
803
|
+
default: () => {
|
|
804
|
+
var _a;
|
|
805
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
806
|
+
}
|
|
807
|
+
})
|
|
808
|
+
]);
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
var index = {
|
|
813
|
+
title: "Pagination \u5206\u9875",
|
|
814
|
+
category: "\u5BFC\u822A",
|
|
815
|
+
status: "100%",
|
|
816
|
+
install(app) {
|
|
817
|
+
app.component(Pagination.name, Pagination);
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
export { Pagination, index as default, paginationProps };
|