zartui 3.1.80 → 3.1.82
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/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/pagination/Pagination.d.ts +38 -0
- package/es/pagination/Pagination.mjs +119 -0
- package/es/pagination/index.css +1 -0
- package/es/pagination/index.d.ts +33 -0
- package/es/pagination/index.mjs +8 -0
- package/es/pagination/style/index.d.ts +1 -0
- package/es/pagination/style/index.mjs +8 -0
- package/es/pagination/types.d.ts +11 -0
- package/es/pagination/types.mjs +0 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/pagination/Pagination.d.ts +38 -0
- package/lib/pagination/Pagination.js +148 -0
- package/lib/pagination/index.css +1 -0
- package/lib/pagination/index.d.ts +33 -0
- package/lib/pagination/index.js +37 -0
- package/lib/pagination/style/index.d.ts +1 -0
- package/lib/pagination/style/index.js +8 -0
- package/lib/pagination/types.d.ts +11 -0
- package/lib/pagination/types.js +15 -0
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +941 -828
- package/lib/zartui.es.js +941 -828
- package/lib/zartui.js +1013 -847
- package/lib/zartui.min.js +2 -2
- package/package.json +28 -28
package/es/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from "./notice-bar";
|
|
|
43
43
|
export * from "./notify";
|
|
44
44
|
export * from "./number-keyboard";
|
|
45
45
|
export * from "./overlay";
|
|
46
|
+
export * from "./pagination";
|
|
46
47
|
export * from "./password-input";
|
|
47
48
|
export * from "./picker";
|
|
48
49
|
export * from "./popover";
|
|
@@ -84,4 +85,4 @@ declare namespace _default {
|
|
|
84
85
|
}
|
|
85
86
|
export default _default;
|
|
86
87
|
export function install(app: any): void;
|
|
87
|
-
export const version: "3.1.
|
|
88
|
+
export const version: "3.1.82";
|
package/es/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ import { NoticeBar } from "./notice-bar/index.mjs";
|
|
|
42
42
|
import { Notify } from "./notify/index.mjs";
|
|
43
43
|
import { NumberKeyboard } from "./number-keyboard/index.mjs";
|
|
44
44
|
import { Overlay } from "./overlay/index.mjs";
|
|
45
|
+
import { Pagination } from "./pagination/index.mjs";
|
|
45
46
|
import { PasswordInput } from "./password-input/index.mjs";
|
|
46
47
|
import { Picker } from "./picker/index.mjs";
|
|
47
48
|
import { Popover } from "./popover/index.mjs";
|
|
@@ -77,7 +78,7 @@ import { Timeline } from "./timeline/index.mjs";
|
|
|
77
78
|
import { Toast } from "./toast/index.mjs";
|
|
78
79
|
import { Uploader } from "./uploader/index.mjs";
|
|
79
80
|
import { Video } from "./video/index.mjs";
|
|
80
|
-
const version = "3.1.
|
|
81
|
+
const version = "3.1.82";
|
|
81
82
|
function install(app) {
|
|
82
83
|
const components = [
|
|
83
84
|
ActionSheet,
|
|
@@ -124,6 +125,7 @@ function install(app) {
|
|
|
124
125
|
Notify,
|
|
125
126
|
NumberKeyboard,
|
|
126
127
|
Overlay,
|
|
128
|
+
Pagination,
|
|
127
129
|
PasswordInput,
|
|
128
130
|
Picker,
|
|
129
131
|
Popover,
|
|
@@ -213,6 +215,7 @@ export * from "./notice-bar/index.mjs";
|
|
|
213
215
|
export * from "./notify/index.mjs";
|
|
214
216
|
export * from "./number-keyboard/index.mjs";
|
|
215
217
|
export * from "./overlay/index.mjs";
|
|
218
|
+
export * from "./pagination/index.mjs";
|
|
216
219
|
export * from "./password-input/index.mjs";
|
|
217
220
|
export * from "./picker/index.mjs";
|
|
218
221
|
export * from "./popover/index.mjs";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
export declare const paginationProps: {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
totalPage: {
|
|
8
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type PaginationProps = ExtractPropTypes<typeof paginationProps>;
|
|
13
|
+
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
totalPage: {
|
|
19
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
totalPage: {
|
|
28
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{
|
|
32
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
modelValue: string | number;
|
|
36
|
+
totalPage: string | number;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { computed, defineComponent, ref, Fragment as _Fragment, createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
|
|
2
|
+
import ZtIcon from "../icon/index.mjs";
|
|
3
|
+
import ZtPopup from "../popup/index.mjs";
|
|
4
|
+
import ZtButton from "../button/index.mjs";
|
|
5
|
+
import { createNamespace, makeNumericProp } from "../utils/index.mjs";
|
|
6
|
+
const [name, bem] = createNamespace("pagination");
|
|
7
|
+
const paginationProps = {
|
|
8
|
+
modelValue: makeNumericProp(1),
|
|
9
|
+
totalPage: makeNumericProp(0)
|
|
10
|
+
};
|
|
11
|
+
var stdin_default = defineComponent({
|
|
12
|
+
name,
|
|
13
|
+
props: paginationProps,
|
|
14
|
+
emits: ["change", "update:modelValue"],
|
|
15
|
+
setup(props, {
|
|
16
|
+
emit
|
|
17
|
+
}) {
|
|
18
|
+
const popupVisible = ref(false);
|
|
19
|
+
const currentPage = computed(() => Number(props.modelValue));
|
|
20
|
+
const total = computed(() => Number(props.totalPage));
|
|
21
|
+
const pages = computed(() => Array.from({
|
|
22
|
+
length: Math.max(total.value, 0)
|
|
23
|
+
}, (_, index) => index + 1));
|
|
24
|
+
const prevDisabled = computed(() => currentPage.value <= 1);
|
|
25
|
+
const nextDisabled = computed(() => currentPage.value >= total.value);
|
|
26
|
+
const setPage = (value) => {
|
|
27
|
+
emit("update:modelValue", value);
|
|
28
|
+
emit("change", value);
|
|
29
|
+
};
|
|
30
|
+
const onPrev = () => {
|
|
31
|
+
if (!prevDisabled.value) {
|
|
32
|
+
setPage(currentPage.value - 1);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const onNext = () => {
|
|
36
|
+
if (!nextDisabled.value) {
|
|
37
|
+
setPage(currentPage.value + 1);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const onSelect = (value) => {
|
|
41
|
+
if (value !== currentPage.value) {
|
|
42
|
+
setPage(value);
|
|
43
|
+
}
|
|
44
|
+
popupVisible.value = false;
|
|
45
|
+
};
|
|
46
|
+
const closePopup = () => {
|
|
47
|
+
popupVisible.value = false;
|
|
48
|
+
};
|
|
49
|
+
return () => _createVNode(_Fragment, null, [_createVNode("div", {
|
|
50
|
+
"class": bem()
|
|
51
|
+
}, [_createVNode("button", {
|
|
52
|
+
"type": "button",
|
|
53
|
+
"class": [bem("button"), bem("prev"), {
|
|
54
|
+
[bem("button", {
|
|
55
|
+
disabled: true
|
|
56
|
+
})]: prevDisabled.value
|
|
57
|
+
}],
|
|
58
|
+
"aria-disabled": prevDisabled.value || void 0,
|
|
59
|
+
"onClick": onPrev
|
|
60
|
+
}, [_createVNode(ZtIcon, {
|
|
61
|
+
"name": "back",
|
|
62
|
+
"size": "24"
|
|
63
|
+
}, null)]), _createVNode("button", {
|
|
64
|
+
"type": "button",
|
|
65
|
+
"class": bem("page"),
|
|
66
|
+
"onClick": () => popupVisible.value = true
|
|
67
|
+
}, [_createVNode("span", {
|
|
68
|
+
"class": bem("text")
|
|
69
|
+
}, [currentPage.value, _createTextVNode("/"), total.value])]), _createVNode("button", {
|
|
70
|
+
"type": "button",
|
|
71
|
+
"class": [bem("button"), bem("next"), {
|
|
72
|
+
[bem("button", {
|
|
73
|
+
disabled: true
|
|
74
|
+
})]: nextDisabled.value
|
|
75
|
+
}],
|
|
76
|
+
"aria-disabled": nextDisabled.value || void 0,
|
|
77
|
+
"onClick": onNext
|
|
78
|
+
}, [_createVNode(ZtIcon, {
|
|
79
|
+
"name": "back",
|
|
80
|
+
"size": "24",
|
|
81
|
+
"class": bem("next-icon")
|
|
82
|
+
}, null)])]), _createVNode(ZtPopup, {
|
|
83
|
+
"show": popupVisible.value,
|
|
84
|
+
"onUpdate:show": ($event) => popupVisible.value = $event,
|
|
85
|
+
"round": true,
|
|
86
|
+
"closeable": true,
|
|
87
|
+
"position": "bottom",
|
|
88
|
+
"lockScroll": true,
|
|
89
|
+
"safeAreaInsetBottom": true,
|
|
90
|
+
"style": {
|
|
91
|
+
height: "80%"
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
default: () => [_createVNode("div", {
|
|
95
|
+
"class": bem("popup")
|
|
96
|
+
}, [_createVNode("div", {
|
|
97
|
+
"class": bem("popup-title")
|
|
98
|
+
}, [_createTextVNode("\u8DF3\u8F6C\u7FFB\u9875")]), _createVNode("div", {
|
|
99
|
+
"class": bem("popup-pages")
|
|
100
|
+
}, [pages.value.map((page) => _createVNode("button", {
|
|
101
|
+
"type": "button",
|
|
102
|
+
"class": bem("popup-page"),
|
|
103
|
+
"onClick": () => onSelect(page)
|
|
104
|
+
}, [page]))]), _createVNode("div", {
|
|
105
|
+
"class": bem("popup-footer")
|
|
106
|
+
}, [_createVNode(ZtButton, {
|
|
107
|
+
"type": "default",
|
|
108
|
+
"block": true,
|
|
109
|
+
"onClick": closePopup
|
|
110
|
+
}, {
|
|
111
|
+
default: () => [_createTextVNode("\u53D6\u6D88")]
|
|
112
|
+
})])])]
|
|
113
|
+
})]);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export {
|
|
117
|
+
stdin_default as default,
|
|
118
|
+
paginationProps
|
|
119
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--zt-pagination-bottom: 29px;--zt-pagination-item-size: 44px;--zt-pagination-gap: 16px;--zt-pagination-background: #2d4b7380;--zt-pagination-backdrop-filter: blur(5.44px);--zt-pagination-box-shadow: 0 4px 8px 0 #2d4b7333;--zt-pagination-text-color: #fff;--zt-pagination-disabled-icon-color: rgba(255, 255, 255, .45);--zt-pagination-font-size: 14px;--zt-pagination-text-line-height: 17px;--zt-pagination-z-index: 100}.zt-pagination{position:fixed;left:0;right:0;bottom:var(--zt-pagination-bottom);z-index:var(--zt-pagination-z-index);display:flex;align-items:center;justify-content:center;pointer-events:none}.zt-pagination__button,.zt-pagination__page{height:var(--zt-pagination-item-size);background:var(--zt-pagination-background);-webkit-backdrop-filter:var(--zt-pagination-backdrop-filter);backdrop-filter:var(--zt-pagination-backdrop-filter);box-shadow:var(--zt-pagination-box-shadow)}.zt-pagination__button{width:var(--zt-pagination-item-size);padding:0;border:0;border-radius:50%;color:var(--zt-pagination-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;transition:opacity var(--zt-duration-fast),transform var(--zt-duration-fast)}.zt-pagination__button:not(.zt-pagination__button--disabled):hover{opacity:.88;transform:scale(1.04)}.zt-pagination__button:not(.zt-pagination__button--disabled):active{opacity:.75;transform:scale(.96)}.zt-pagination__button--disabled{color:var(--zt-pagination-disabled-icon-color);cursor:default}.zt-pagination__page{margin:0 var(--zt-pagination-gap);padding:0 27px;border:0;border-radius:22px;display:flex;align-items:center;justify-content:center;color:var(--zt-pagination-text-color);cursor:pointer;pointer-events:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.zt-pagination__text{height:var(--zt-pagination-text-line-height);color:var(--zt-pagination-text-color);font-size:var(--zt-pagination-font-size);line-height:var(--zt-pagination-text-line-height)}.zt-pagination__next-icon{transform:rotate(180deg)}.zt-pagination__popup{height:100%;display:flex;flex-direction:column;background:#fff}.zt-pagination__popup-title{padding-top:var(--zt-popup-close-icon-margin);color:#2d4b73;font-size:18px;font-weight:600;text-align:center}.zt-pagination__popup-pages{flex:1;display:grid;grid-template-columns:repeat(5,40px);grid-auto-rows:40px;justify-content:space-around;row-gap:24px;padding:24px 0;overflow-y:auto}.zt-pagination__popup-page{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:#2d4b73;background:rgba(45,75,115,.04);font-size:16px;line-height:24px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:background-color var(--zt-duration-fast),transform var(--zt-duration-fast),opacity var(--zt-duration-fast)}.zt-pagination__popup-page:hover{background:rgba(45,75,115,.1);transform:scale(1.04)}.zt-pagination__popup-page:active{opacity:.75;transform:scale(.96)}.zt-pagination__popup-footer{padding:8px 16px;border-top:1px solid var(--zt-border-color)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const Pagination: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
totalPage: {
|
|
7
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
totalPage: {
|
|
16
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{
|
|
20
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
modelValue: string | number;
|
|
24
|
+
totalPage: string | number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
26
|
+
export default Pagination;
|
|
27
|
+
export type { PaginationProps } from './Pagination';
|
|
28
|
+
export type { PaginationThemeVars } from './types';
|
|
29
|
+
declare module 'vue' {
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
ZtPagination: typeof Pagination;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PaginationThemeVars = {
|
|
2
|
+
paginationBottom?: string;
|
|
3
|
+
paginationItemSize?: string;
|
|
4
|
+
paginationGap?: string;
|
|
5
|
+
paginationBackground?: string;
|
|
6
|
+
paginationBackdropFilter?: string;
|
|
7
|
+
paginationBoxShadow?: string;
|
|
8
|
+
paginationTextColor?: string;
|
|
9
|
+
paginationFontSize?: string;
|
|
10
|
+
paginationTextLineHeight?: string;
|
|
11
|
+
};
|
|
File without changes
|