@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +4019 -19251
- package/dist/nutui.umd.js +4012 -19344
- package/dist/packages/_es/ActionSheet.js +26 -157
- package/dist/packages/_es/Address.js +119 -542
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Audio.js +62 -264
- package/dist/packages/_es/AudioOperate.js +18 -107
- package/dist/packages/_es/Avatar.js +42 -165
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +24 -237
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +156 -500
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +24 -85
- package/dist/packages/_es/CollapseItem.js +70 -261
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/CountDown.js +61 -242
- package/dist/packages/_es/CountUp.js +149 -546
- package/dist/packages/_es/DatePicker.js +107 -322
- package/dist/packages/_es/Dialog.js +69 -261
- package/dist/packages/_es/Divider.js +18 -68
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +63 -198
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/ImagePreview.js +74 -298
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +66 -258
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +23 -110
- package/dist/packages/_es/Menu.js +30 -118
- package/dist/packages/_es/MenuItem.js +34 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +83 -387
- package/dist/packages/_es/Notify.js +81 -236
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +140 -464
- package/dist/packages/_es/OverLay.js +32 -105
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +138 -459
- package/dist/packages/_es/Popover.js +327 -965
- package/dist/packages/_es/Popup.js +64 -303
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +92 -346
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +92 -417
- package/dist/packages/_es/Rate.js +16 -139
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +46 -247
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +33 -89
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +46 -165
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +93 -499
- package/dist/packages/_es/Step.js +25 -119
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +26 -90
- package/dist/packages/_es/Swipe.js +46 -183
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +27 -186
- package/dist/packages/_es/Tabs.js +51 -209
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +23 -84
- package/dist/packages/_es/TimePannel.js +19 -52
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +80 -319
- package/dist/packages/_es/Uploader.js +112 -460
- package/dist/packages/_es/Video.js +83 -340
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +120 -675
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +11 -0
- package/dist/packages/checkbox/index.scss +6 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/input/index.scss +13 -1
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/radio/index.scss +1 -0
- package/dist/packages/switch/index.scss +3 -3
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/smartips/attributes.json +62 -10
- package/dist/smartips/tags.json +17 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +10 -1
- package/dist/styles/variables-jdt.scss +10 -1
- package/dist/styles/variables.scss +10 -1
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -3,117 +3,44 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (
|
|
7
|
-
for (var prop in
|
|
8
|
-
if (__hasOwnProp.call(
|
|
9
|
-
__defNormalProp(
|
|
6
|
+
var __spreadValues = (a2, b2) => {
|
|
7
|
+
for (var prop in b2 || (b2 = {}))
|
|
8
|
+
if (__hasOwnProp.call(b2, prop))
|
|
9
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
10
10
|
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(
|
|
12
|
-
if (__propIsEnum.call(
|
|
13
|
-
__defNormalProp(
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
12
|
+
if (__propIsEnum.call(b2, prop))
|
|
13
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return a2;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.22-beta.
|
|
18
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
19
19
|
* (c) 2022 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
22
|
-
import { computed, watch, onDeactivated, onBeforeUnmount, onMounted, onActivated, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
|
|
23
|
-
import { c as
|
|
24
|
-
import { _ as
|
|
22
|
+
import { computed as e, watch as o, onDeactivated as l, onBeforeUnmount as t, onMounted as a, onActivated as s, openBlock as n, createBlock as r, Transition as i, withCtx as c, withDirectives as u, createElementVNode as d, normalizeClass as v, withModifiers as p, normalizeStyle as m, renderSlot as y, vShow as f } from "vue";
|
|
23
|
+
import { c as b } from "./component.js";
|
|
24
|
+
import { _ as k } from "./plugin-vue_export-helper.js";
|
|
25
25
|
import "../locale/lang";
|
|
26
|
-
const { componentName, create } =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
zIndex: {
|
|
33
|
-
type: [Number, String],
|
|
34
|
-
default: 2e3
|
|
35
|
-
},
|
|
36
|
-
duration: {
|
|
37
|
-
type: [Number, String],
|
|
38
|
-
default: 0.3
|
|
39
|
-
},
|
|
40
|
-
overlayClass: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: ""
|
|
43
|
-
},
|
|
44
|
-
lockScroll: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true
|
|
47
|
-
},
|
|
48
|
-
overlayStyle: {
|
|
49
|
-
type: Object
|
|
50
|
-
},
|
|
51
|
-
closeOnClickOverlay: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: true
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const _sfc_main = create({
|
|
57
|
-
props: overlayProps,
|
|
58
|
-
emits: ["click", "update:visible"],
|
|
59
|
-
setup(props, { emit }) {
|
|
60
|
-
const classes = computed(() => {
|
|
61
|
-
const prefixCls = componentName;
|
|
62
|
-
return {
|
|
63
|
-
[prefixCls]: true,
|
|
64
|
-
[props.overlayClass]: true
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
watch(() => props.visible, (value) => {
|
|
68
|
-
value ? lock() : unlock();
|
|
69
|
-
});
|
|
70
|
-
const lock = () => {
|
|
71
|
-
if (props.lockScroll && props.visible) {
|
|
72
|
-
document.body.classList.add("nut-overflow-hidden");
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const unlock = () => {
|
|
76
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
77
|
-
};
|
|
78
|
-
onDeactivated(unlock);
|
|
79
|
-
onBeforeUnmount(unlock);
|
|
80
|
-
onMounted(lock);
|
|
81
|
-
onActivated(lock);
|
|
82
|
-
const style = computed(() => {
|
|
83
|
-
return __spreadValues({
|
|
84
|
-
animationDuration: `${props.duration}s`,
|
|
85
|
-
zIndex: props.zIndex
|
|
86
|
-
}, props.overlayStyle);
|
|
87
|
-
});
|
|
88
|
-
const touchmove = (e) => {
|
|
89
|
-
if (props.lockScroll)
|
|
90
|
-
e.preventDefault();
|
|
91
|
-
};
|
|
92
|
-
const onClick = (e) => {
|
|
93
|
-
emit("click", e);
|
|
94
|
-
if (props.closeOnClickOverlay) {
|
|
95
|
-
emit("update:visible", false);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return { classes, style, touchmove, onClick };
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
102
|
-
return openBlock(), createBlock(Transition, { name: "overlay-fade" }, {
|
|
103
|
-
default: withCtx(() => [
|
|
104
|
-
withDirectives(createElementVNode("view", {
|
|
105
|
-
class: normalizeClass(_ctx.classes),
|
|
106
|
-
onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
|
|
107
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
108
|
-
style: normalizeStyle(_ctx.style)
|
|
109
|
-
}, [
|
|
110
|
-
renderSlot(_ctx.$slots, "default")
|
|
111
|
-
], 38), [
|
|
112
|
-
[vShow, _ctx.visible]
|
|
113
|
-
])
|
|
114
|
-
]),
|
|
115
|
-
_: 3
|
|
26
|
+
const { componentName: C, create: S } = b("overlay"), h = { visible: { type: Boolean, default: false }, zIndex: { type: [Number, String], default: 2e3 }, duration: { type: [Number, String], default: 0.3 }, overlayClass: { type: String, default: "" }, lockScroll: { type: Boolean, default: true }, overlayStyle: { type: Object }, closeOnClickOverlay: { type: Boolean, default: true } };
|
|
27
|
+
var g = k(S({ props: h, emits: ["click", "update:visible"], setup(n2, { emit: r2 }) {
|
|
28
|
+
const i2 = e(() => ({ [C]: true, [n2.overlayClass]: true }));
|
|
29
|
+
o(() => n2.visible, (e2) => {
|
|
30
|
+
e2 ? c2() : u2();
|
|
116
31
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
32
|
+
const c2 = () => {
|
|
33
|
+
n2.lockScroll && n2.visible && document.body.classList.add("nut-overflow-hidden");
|
|
34
|
+
}, u2 = () => {
|
|
35
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
36
|
+
};
|
|
37
|
+
l(u2), t(u2), a(c2), s(c2);
|
|
38
|
+
return { classes: i2, style: e(() => __spreadValues({ animationDuration: `${n2.duration}s`, zIndex: n2.zIndex }, n2.overlayStyle)), touchmove: (e2) => {
|
|
39
|
+
n2.lockScroll && e2.preventDefault();
|
|
40
|
+
}, onClick: (e2) => {
|
|
41
|
+
r2("click", e2), n2.closeOnClickOverlay && r2("update:visible", false);
|
|
42
|
+
} };
|
|
43
|
+
} }), [["render", function(e2, o2, l2, t2, a2, s2) {
|
|
44
|
+
return n(), r(i, { name: "overlay-fade" }, { default: c(() => [u(d("view", { class: v(e2.classes), onTouchmove: o2[0] || (o2[0] = p((...o3) => e2.touchmove && e2.touchmove(...o3), ["stop"])), onClick: o2[1] || (o2[1] = (...o3) => e2.onClick && e2.onClick(...o3)), style: m(e2.style) }, [y(e2.$slots, "default")], 38), [[f, e2.visible]])]), _: 3 });
|
|
45
|
+
}]]);
|
|
46
|
+
export { g as default, h as overlayProps };
|
|
@@ -1,165 +1,47 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs, computed, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs as e, computed as t, watchEffect as a, openBlock as l, createElementBlock as n, createElementVNode as o, normalizeClass as i, renderSlot as u, createTextVNode as s, toDisplayString as r, Fragment as p, renderList as m, createCommentVNode as c } from "vue";
|
|
7
|
+
import { c as d } from "./component.js";
|
|
8
|
+
import { _ as v } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create, translate } =
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default: ""
|
|
28
|
-
},
|
|
29
|
-
pageCount: {
|
|
30
|
-
type: [String, Number],
|
|
31
|
-
default: ""
|
|
32
|
-
},
|
|
33
|
-
totalItems: {
|
|
34
|
-
type: [String, Number],
|
|
35
|
-
default: "0"
|
|
36
|
-
},
|
|
37
|
-
itemsPerPage: {
|
|
38
|
-
type: [String, Number],
|
|
39
|
-
default: "10"
|
|
40
|
-
},
|
|
41
|
-
showPageSize: {
|
|
42
|
-
type: [String, Number],
|
|
43
|
-
default: "5"
|
|
44
|
-
},
|
|
45
|
-
forceEllipses: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: false
|
|
10
|
+
const { componentName: g, create: f, translate: x } = d("pagination"), h = f({ props: { modelValue: { type: Number, default: 1 }, mode: { type: String, default: "multi" }, prevText: { type: String, default: "" }, nextText: { type: String, default: "" }, pageCount: { type: [String, Number], default: "" }, totalItems: { type: [String, Number], default: "0" }, itemsPerPage: { type: [String, Number], default: "10" }, showPageSize: { type: [String, Number], default: "5" }, forceEllipses: { type: Boolean, default: false } }, components: {}, emits: ["change", "update:modelValue"], setup(l2, { emit: n2 }) {
|
|
11
|
+
const { modelValue: o2, mode: i2, showPageSize: u2, forceEllipses: s2 } = e(l2), r2 = t(() => {
|
|
12
|
+
const { pageCount: t2, totalItems: a2, itemsPerPage: n3 } = e(l2), o3 = +t2.value || Math.ceil(+a2.value / +n3.value);
|
|
13
|
+
return Math.max(1, o3);
|
|
14
|
+
}), p2 = (e2, t2) => {
|
|
15
|
+
e2 > r2.value || e2 < 1 || (e2 != o2.value && n2("update:modelValue", e2), t2 && n2("change", e2));
|
|
16
|
+
}, m2 = (e2, t2, a2) => ({ number: e2, text: t2, active: a2 }), c2 = t(() => {
|
|
17
|
+
if (i2.value == "simple")
|
|
18
|
+
return;
|
|
19
|
+
let e2 = [];
|
|
20
|
+
const t2 = r2.value, a2 = u2.value;
|
|
21
|
+
let l3 = 1, n3 = t2;
|
|
22
|
+
const p3 = t2 > a2;
|
|
23
|
+
p3 && (l3 = Math.max(o2.value - Math.floor(a2 / 2), 1), n3 = l3 + a2 - 1, n3 > t2 && (n3 = t2, l3 = n3 - a2 + 1));
|
|
24
|
+
for (var c3 = l3; c3 <= n3; c3++) {
|
|
25
|
+
const t3 = m2(c3, c3, o2.value == c3);
|
|
26
|
+
e2.push(t3);
|
|
48
27
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const { modelValue, mode, showPageSize, forceEllipses } = toRefs(props);
|
|
54
|
-
const countRef = computed(() => {
|
|
55
|
-
const { pageCount, totalItems, itemsPerPage } = toRefs(props);
|
|
56
|
-
const num = +pageCount.value || Math.ceil(+totalItems.value / +itemsPerPage.value);
|
|
57
|
-
return Math.max(1, num);
|
|
58
|
-
});
|
|
59
|
-
const select = (curPage, isSelect) => {
|
|
60
|
-
if (curPage > countRef.value || curPage < 1)
|
|
61
|
-
return;
|
|
62
|
-
if (curPage != modelValue.value)
|
|
63
|
-
emit("update:modelValue", curPage);
|
|
64
|
-
if (isSelect)
|
|
65
|
-
emit("change", curPage);
|
|
66
|
-
};
|
|
67
|
-
const setPage = (number, text, active) => {
|
|
68
|
-
return { number, text, active };
|
|
69
|
-
};
|
|
70
|
-
const pages = computed(() => {
|
|
71
|
-
if (mode.value == "simple")
|
|
72
|
-
return;
|
|
73
|
-
let items = [];
|
|
74
|
-
const pageCount = countRef.value;
|
|
75
|
-
const pageSize = showPageSize.value;
|
|
76
|
-
let startPage = 1;
|
|
77
|
-
let endPage = pageCount;
|
|
78
|
-
const partialShow = pageCount > pageSize;
|
|
79
|
-
if (partialShow) {
|
|
80
|
-
startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
|
|
81
|
-
endPage = startPage + pageSize - 1;
|
|
82
|
-
if (endPage > pageCount) {
|
|
83
|
-
endPage = pageCount;
|
|
84
|
-
startPage = endPage - pageSize + 1;
|
|
85
|
-
}
|
|
28
|
+
if (p3 && a2 > 0 && s2.value) {
|
|
29
|
+
if (l3 > 1) {
|
|
30
|
+
const t3 = m2(l3 - 1, "...");
|
|
31
|
+
e2.unshift(t3);
|
|
86
32
|
}
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
33
|
+
if (n3 < t2) {
|
|
34
|
+
const t3 = m2(n3 + 1, "...");
|
|
35
|
+
e2.push(t3);
|
|
90
36
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
watchEffect(() => {
|
|
104
|
-
select(modelValue.value, false);
|
|
105
|
-
});
|
|
106
|
-
return {
|
|
107
|
-
modelValue,
|
|
108
|
-
select,
|
|
109
|
-
countRef,
|
|
110
|
-
mode,
|
|
111
|
-
pages,
|
|
112
|
-
forceEllipses,
|
|
113
|
-
translate
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
const _hoisted_1 = { class: "nut-pagination" };
|
|
118
|
-
const _hoisted_2 = {
|
|
119
|
-
key: 0,
|
|
120
|
-
class: "nut-pagination-contain"
|
|
121
|
-
};
|
|
122
|
-
const _hoisted_3 = ["onClick"];
|
|
123
|
-
const _hoisted_4 = {
|
|
124
|
-
key: 1,
|
|
125
|
-
class: "nut-pagination-contain"
|
|
126
|
-
};
|
|
127
|
-
const _hoisted_5 = { class: "nut-pagination-simple" };
|
|
128
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
129
|
-
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
130
|
-
createElementVNode("view", {
|
|
131
|
-
class: normalizeClass(["nut-pagination-prev", _ctx.mode == "multi" ? "" : "simple-border", _ctx.modelValue == 1 ? "disabled" : ""]),
|
|
132
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.select(_ctx.modelValue - 1, true))
|
|
133
|
-
}, [
|
|
134
|
-
renderSlot(_ctx.$slots, "prev-text", {}, () => [
|
|
135
|
-
createTextVNode(toDisplayString(_ctx.prevText || _ctx.translate("prev")), 1)
|
|
136
|
-
])
|
|
137
|
-
], 2),
|
|
138
|
-
_ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
139
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
|
|
140
|
-
return openBlock(), createElementBlock("view", {
|
|
141
|
-
key: index2 + "pagination",
|
|
142
|
-
class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
|
|
143
|
-
onClick: ($event) => _ctx.select(item.number, true)
|
|
144
|
-
}, [
|
|
145
|
-
renderSlot(_ctx.$slots, "page", { item }, () => [
|
|
146
|
-
createTextVNode(toDisplayString(item.text), 1)
|
|
147
|
-
])
|
|
148
|
-
], 10, _hoisted_3);
|
|
149
|
-
}), 128))
|
|
150
|
-
])) : createCommentVNode("", true),
|
|
151
|
-
_ctx.mode == "simple" ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
152
|
-
createElementVNode("view", _hoisted_5, toDisplayString(_ctx.modelValue) + "/" + toDisplayString(_ctx.countRef), 1)
|
|
153
|
-
])) : createCommentVNode("", true),
|
|
154
|
-
createElementVNode("view", {
|
|
155
|
-
class: normalizeClass(["nut-pagination-next", _ctx.modelValue >= _ctx.countRef ? "disabled" : ""]),
|
|
156
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.select(_ctx.modelValue + 1, true))
|
|
157
|
-
}, [
|
|
158
|
-
renderSlot(_ctx.$slots, "next-text", {}, () => [
|
|
159
|
-
createTextVNode(toDisplayString(_ctx.nextText || _ctx.translate("next")), 1)
|
|
160
|
-
])
|
|
161
|
-
], 2)
|
|
162
|
-
]);
|
|
163
|
-
}
|
|
164
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
165
|
-
export { index as default };
|
|
37
|
+
}
|
|
38
|
+
return e2;
|
|
39
|
+
});
|
|
40
|
+
return a(() => {
|
|
41
|
+
p2(o2.value, false);
|
|
42
|
+
}), { modelValue: o2, select: p2, countRef: r2, mode: i2, pages: c2, forceEllipses: s2, translate: x };
|
|
43
|
+
} }), y = { class: "nut-pagination" }, b = { key: 0, class: "nut-pagination-contain" }, V = ["onClick"], w = { key: 1, class: "nut-pagination-contain" }, S = { class: "nut-pagination-simple" };
|
|
44
|
+
var k = v(h, [["render", function(e2, t2, a2, d2, v2, g2) {
|
|
45
|
+
return l(), n("view", y, [o("view", { class: i(["nut-pagination-prev", e2.mode == "multi" ? "" : "simple-border", e2.modelValue == 1 ? "disabled" : ""]), onClick: t2[0] || (t2[0] = (t3) => e2.select(e2.modelValue - 1, true)) }, [u(e2.$slots, "prev-text", {}, () => [s(r(e2.prevText || e2.translate("prev")), 1)])], 2), e2.mode == "multi" ? (l(), n("view", b, [(l(true), n(p, null, m(e2.pages, (t3, a3) => (l(), n("view", { key: a3 + "pagination", class: i(["nut-pagination-item", t3.active ? "active" : ""]), onClick: (a4) => e2.select(t3.number, true) }, [u(e2.$slots, "page", { item: t3 }, () => [s(r(t3.text), 1)])], 10, V))), 128))])) : c("", true), e2.mode == "simple" ? (l(), n("view", w, [o("view", S, r(e2.modelValue) + "/" + r(e2.countRef), 1)])) : c("", true), o("view", { class: i(["nut-pagination-next", e2.modelValue >= e2.countRef ? "disabled" : ""]), onClick: t2[1] || (t2[1] = (t3) => e2.select(e2.modelValue + 1, true)) }, [u(e2.$slots, "next-text", {}, () => [s(r(e2.nextText || e2.translate("next")), 1)])], 2)]);
|
|
46
|
+
}]]);
|
|
47
|
+
export { k as default };
|