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/lib/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.80";
88
+ export const version: "3.1.82";
package/lib/index.js CHANGED
@@ -67,6 +67,7 @@ var import_notice_bar = require("./notice-bar");
67
67
  var import_notify = require("./notify");
68
68
  var import_number_keyboard = require("./number-keyboard");
69
69
  var import_overlay = require("./overlay");
70
+ var import_pagination = require("./pagination");
70
71
  var import_password_input = require("./password-input");
71
72
  var import_picker = require("./picker");
72
73
  var import_popover = require("./popover");
@@ -147,6 +148,7 @@ __reExport(stdin_exports, require("./notice-bar"), module.exports);
147
148
  __reExport(stdin_exports, require("./notify"), module.exports);
148
149
  __reExport(stdin_exports, require("./number-keyboard"), module.exports);
149
150
  __reExport(stdin_exports, require("./overlay"), module.exports);
151
+ __reExport(stdin_exports, require("./pagination"), module.exports);
150
152
  __reExport(stdin_exports, require("./password-input"), module.exports);
151
153
  __reExport(stdin_exports, require("./picker"), module.exports);
152
154
  __reExport(stdin_exports, require("./popover"), module.exports);
@@ -182,7 +184,7 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
182
184
  __reExport(stdin_exports, require("./toast"), module.exports);
183
185
  __reExport(stdin_exports, require("./uploader"), module.exports);
184
186
  __reExport(stdin_exports, require("./video"), module.exports);
185
- const version = "3.1.80";
187
+ const version = "3.1.82";
186
188
  function install(app) {
187
189
  const components = [
188
190
  import_action_sheet.ActionSheet,
@@ -229,6 +231,7 @@ function install(app) {
229
231
  import_notify.Notify,
230
232
  import_number_keyboard.NumberKeyboard,
231
233
  import_overlay.Overlay,
234
+ import_pagination.Pagination,
232
235
  import_password_input.PasswordInput,
233
236
  import_picker.Picker,
234
237
  import_popover.Popover,
@@ -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,148 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name2 in all)
9
+ __defProp(target, name2, { get: all[name2], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ default: () => stdin_default,
31
+ paginationProps: () => paginationProps
32
+ });
33
+ module.exports = __toCommonJS(stdin_exports);
34
+ var import_vue = require("vue");
35
+ var import_icon = __toESM(require("../icon"));
36
+ var import_popup = __toESM(require("../popup"));
37
+ var import_button = __toESM(require("../button"));
38
+ var import_utils = require("../utils");
39
+ const [name, bem] = (0, import_utils.createNamespace)("pagination");
40
+ const paginationProps = {
41
+ modelValue: (0, import_utils.makeNumericProp)(1),
42
+ totalPage: (0, import_utils.makeNumericProp)(0)
43
+ };
44
+ var stdin_default = (0, import_vue.defineComponent)({
45
+ name,
46
+ props: paginationProps,
47
+ emits: ["change", "update:modelValue"],
48
+ setup(props, {
49
+ emit
50
+ }) {
51
+ const popupVisible = (0, import_vue.ref)(false);
52
+ const currentPage = (0, import_vue.computed)(() => Number(props.modelValue));
53
+ const total = (0, import_vue.computed)(() => Number(props.totalPage));
54
+ const pages = (0, import_vue.computed)(() => Array.from({
55
+ length: Math.max(total.value, 0)
56
+ }, (_, index) => index + 1));
57
+ const prevDisabled = (0, import_vue.computed)(() => currentPage.value <= 1);
58
+ const nextDisabled = (0, import_vue.computed)(() => currentPage.value >= total.value);
59
+ const setPage = (value) => {
60
+ emit("update:modelValue", value);
61
+ emit("change", value);
62
+ };
63
+ const onPrev = () => {
64
+ if (!prevDisabled.value) {
65
+ setPage(currentPage.value - 1);
66
+ }
67
+ };
68
+ const onNext = () => {
69
+ if (!nextDisabled.value) {
70
+ setPage(currentPage.value + 1);
71
+ }
72
+ };
73
+ const onSelect = (value) => {
74
+ if (value !== currentPage.value) {
75
+ setPage(value);
76
+ }
77
+ popupVisible.value = false;
78
+ };
79
+ const closePopup = () => {
80
+ popupVisible.value = false;
81
+ };
82
+ return () => (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)("div", {
83
+ "class": bem()
84
+ }, [(0, import_vue.createVNode)("button", {
85
+ "type": "button",
86
+ "class": [bem("button"), bem("prev"), {
87
+ [bem("button", {
88
+ disabled: true
89
+ })]: prevDisabled.value
90
+ }],
91
+ "aria-disabled": prevDisabled.value || void 0,
92
+ "onClick": onPrev
93
+ }, [(0, import_vue.createVNode)(import_icon.default, {
94
+ "name": "back",
95
+ "size": "24"
96
+ }, null)]), (0, import_vue.createVNode)("button", {
97
+ "type": "button",
98
+ "class": bem("page"),
99
+ "onClick": () => popupVisible.value = true
100
+ }, [(0, import_vue.createVNode)("span", {
101
+ "class": bem("text")
102
+ }, [currentPage.value, (0, import_vue.createTextVNode)("/"), total.value])]), (0, import_vue.createVNode)("button", {
103
+ "type": "button",
104
+ "class": [bem("button"), bem("next"), {
105
+ [bem("button", {
106
+ disabled: true
107
+ })]: nextDisabled.value
108
+ }],
109
+ "aria-disabled": nextDisabled.value || void 0,
110
+ "onClick": onNext
111
+ }, [(0, import_vue.createVNode)(import_icon.default, {
112
+ "name": "back",
113
+ "size": "24",
114
+ "class": bem("next-icon")
115
+ }, null)])]), (0, import_vue.createVNode)(import_popup.default, {
116
+ "show": popupVisible.value,
117
+ "onUpdate:show": ($event) => popupVisible.value = $event,
118
+ "round": true,
119
+ "closeable": true,
120
+ "position": "bottom",
121
+ "lockScroll": true,
122
+ "safeAreaInsetBottom": true,
123
+ "style": {
124
+ height: "80%"
125
+ }
126
+ }, {
127
+ default: () => [(0, import_vue.createVNode)("div", {
128
+ "class": bem("popup")
129
+ }, [(0, import_vue.createVNode)("div", {
130
+ "class": bem("popup-title")
131
+ }, [(0, import_vue.createTextVNode)("\u8DF3\u8F6C\u7FFB\u9875")]), (0, import_vue.createVNode)("div", {
132
+ "class": bem("popup-pages")
133
+ }, [pages.value.map((page) => (0, import_vue.createVNode)("button", {
134
+ "type": "button",
135
+ "class": bem("popup-page"),
136
+ "onClick": () => onSelect(page)
137
+ }, [page]))]), (0, import_vue.createVNode)("div", {
138
+ "class": bem("popup-footer")
139
+ }, [(0, import_vue.createVNode)(import_button.default, {
140
+ "type": "default",
141
+ "block": true,
142
+ "onClick": closePopup
143
+ }, {
144
+ default: () => [(0, import_vue.createTextVNode)("\u53D6\u6D88")]
145
+ })])])]
146
+ })]);
147
+ }
148
+ });
@@ -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,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ Pagination: () => Pagination,
31
+ default: () => stdin_default
32
+ });
33
+ module.exports = __toCommonJS(stdin_exports);
34
+ var import_utils = require("../utils");
35
+ var import_Pagination = __toESM(require("./Pagination"));
36
+ const Pagination = (0, import_utils.withInstall)(import_Pagination.default);
37
+ var stdin_default = Pagination;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ require("../../style/base.css");
2
+ require("../../badge/index.css");
3
+ require("../../icon/index.css");
4
+ require("../../overlay/index.css");
5
+ require("../../popup/index.css");
6
+ require("../../loading/index.css");
7
+ require("../../button/index.css");
8
+ require("../index.css");
@@ -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
+ };
@@ -0,0 +1,15 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var stdin_exports = {};
15
+ module.exports = __toCommonJS(stdin_exports);